From 193ea228f7b9ed326b38873a0ce96c0810b093ba Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 23 Apr 2018 10:53:27 -0300 Subject: [PATCH 001/425] Minor code refactor in BaseObjectView::getScreenDpiFactor --- libobjrenderer/src/baseobjectview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 113491dc2b..1a21cd06a7 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -638,8 +638,9 @@ double BaseObjectView::getFontFactor(void) double BaseObjectView::getScreenDpiFactor(void) { - double factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f; - double pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(); + QScreen *screen = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow())); + double factor = screen->logicalDotsPerInch() / 96.0f; + double pixel_ratio = screen->devicePixelRatio(); if(factor < 1) return (1); From 762974766f1d51320e2684e780654288973c9b4b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 23 Apr 2018 15:01:56 -0300 Subject: [PATCH 002/425] Minor typo fixes in PgModelerCLI Improved the setTag operation in ModelWidget in order to cleanup the assigned tag to a set of objects Minor improvement on DatabaseExplorerWidget to show the rls attributes labels correctly in the attributes grid --- libpgmodeler/src/databasemodel.cpp | 9 +++++ libpgmodeler/src/databasemodel.h | 5 ++- .../src/databaseexplorerwidget.cpp | 7 ++-- libpgmodeler_ui/src/modelwidget.cpp | 16 ++++++--- main-cli/src/pgmodelercli.cpp | 36 +++++++++---------- 5 files changed, 48 insertions(+), 25 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 201a197e27..d2ad7fe148 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -8808,6 +8808,15 @@ void DatabaseModel::__getObjectReferences(BaseObject *object, vector &objects) +{ + for(auto &obj : objects) + { + if(BaseGraphicObject::isGraphicObject(obj->getObjectType())) + dynamic_cast(obj)->setModified(true); + } +} + void DatabaseModel::setObjectsModified(vector types) { ObjectType obj_types[]={OBJ_TABLE, OBJ_VIEW, diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 11406b0ad2..f0cde903cb 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -561,10 +561,13 @@ class DatabaseModel: public QObject, public BaseObject { meaning that ALL objects directly or inderectly linked to the 'object' are retrieved. */ void __getObjectReferences(BaseObject *object, vector &refs, bool exclude_perms=false); - /*! \brief Marks the graphical objects as modified forcing their redraw. User can specify only a set of + /*! \brief Marks the graphical objects of the provided types as modified forcing their redraw. User can specify only a set of graphical objects to be marked */ void setObjectsModified(vector types={}); + //! \brief Marks the graphical objects in the list as modified forcing their redraw. + void setObjectsModified(vector &objects); + /*! \brief Marks the objects with code invalidated forcing their code regeneration. User can specify only a set of graphical objects to be marked */ void setCodesInvalidated(vector types={}); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 1f47174fe2..395c187a24 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -93,7 +93,8 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {SERVER_VERSION, QT_TR_NOOP("Server version")}, {IDENT_FILE, QT_TR_NOOP("Ident file")}, {PASSWORD_ENCRYPTION, QT_TR_NOOP("Password encryption")}, {CONNECTION, QT_TR_NOOP("Connection ID")}, {SERVER_PID, QT_TR_NOOP("Server PID")}, {SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {REFERRERS, QT_TR_NOOP("Referrers")}, {IDENTITY_TYPE, QT_TR_NOOP("Identity")}, {COMMAND, QT_TR_NOOP("Command")}, - {USING_EXP, QT_TR_NOOP("USING expr.")}, {CHECK_EXP, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")} + {USING_EXP, QT_TR_NOOP("USING expr.")}, {CHECK_EXP, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")}, + {RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {RLS_FORCED, QT_TR_NOOP("RLS forced")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) @@ -509,7 +510,9 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { ParsersAttributes::OIDS, - ParsersAttributes::UNLOGGED }); + ParsersAttributes::UNLOGGED, + ParsersAttributes::RLS_ENABLED, + ParsersAttributes::RLS_FORCED}); formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, OBJ_TABLE, true); } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 000c455c1d..24166edcf7 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2006,11 +2006,13 @@ void ModelWidget::setTag(void) { op_id=op_list->registerObject(obj, Operation::OBJECT_MODIFIED, -1); tab->setTag(dynamic_cast(tag)); - tab->setModified(true); } } op_list->finishOperationChain(); + db_model->setObjectsModified(selected_objects); + scene->clearSelection(); + emit s_objectModified(); } catch(Exception &e) @@ -3134,9 +3136,9 @@ void ModelWidget::configureSubmenu(BaseObject *object) menus[i]->clear(); //Configuring actions "Move to schema", "Change Owner" and "Set tag" - if((i==0 && accepts_schema) || - (i==1 && accepts_owner) || - (i==2 && tab_or_view)) + if((types[i] == OBJ_SCHEMA && accepts_schema) || + (types[i] == OBJ_ROLE && accepts_owner) || + (types[i]==OBJ_TAG && tab_or_view)) { obj_list=db_model->getObjects(types[i]); @@ -3147,6 +3149,12 @@ void ModelWidget::configureSubmenu(BaseObject *object) } else { + if(types[i] == OBJ_TAG) + { + menus[i]->addAction(trUtf8("None"), this, SLOT(setTag())); + menus[i]->addSeparator(); + } + while(!obj_list.empty()) { act=new QAction(obj_list.back()->getName(), menus[i]); diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index c21c60a513..1ab1809edf 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -366,50 +366,50 @@ bool PgModelerCLI::isOptionRecognized(QString &op, bool &accepts_val) void PgModelerCLI::showMenu(void) { out << endl; - out << trUtf8("Usage: pgmodeler-cli [OPTIONS]") << endl; out << QString("pgModeler ") << GlobalAttributes::PGMODELER_VERSION << trUtf8(" command line interface.") << endl; out << trUtf8("PostgreSQL Database Modeler Project - pgmodeler.io") << endl; out << trUtf8("Copyright 2006-2018 Raphael A. Silva ") << endl; out << endl; - out << trUtf8("This CLI tool provides several operations over models and databases without the need to perform them\non pgModeler's graphical interface. All available options are described below.") << endl; + out << trUtf8("Usage: pgmodeler-cli [OPTIONS]") << endl << endl; + out << trUtf8("This CLI tool provides several operations over models and databases without the need to perform them\nin pgModeler's graphical interface. All available options are described below.") << endl; out << endl; out << trUtf8("General options: ") << endl; - out << trUtf8(" %1, %2 [FILE]\t\t Input model file (.dbm). This is mandatory in fix, export operations.").arg(short_opts[INPUT]).arg(INPUT) << endl; - out << trUtf8(" %1, %2 [DBNAME]\t Input database name. This is mandatory import operation.").arg(short_opts[INPUT_DB]).arg(INPUT_DB) << endl; - out << trUtf8(" %1, %2 [FILE]\t\t Output file. Mandatory use in fixing model or exporting to file, png or svg.").arg(short_opts[OUTPUT]).arg(OUTPUT) << endl; + out << trUtf8(" %1, %2 [FILE]\t\t Input model file (.dbm). This is mandatory for fix, export operations.").arg(short_opts[INPUT]).arg(INPUT) << endl; + out << trUtf8(" %1, %2 [DBNAME]\t Input database name. This is mandatory for import operation.").arg(short_opts[INPUT_DB]).arg(INPUT_DB) << endl; + out << trUtf8(" %1, %2 [FILE]\t\t Output file. This is mandatory for fixing model or exporting to file, png or svg.").arg(short_opts[OUTPUT]).arg(OUTPUT) << endl; out << trUtf8(" %1, %2\t\t Try to fix the structure of the input model file in order to make it loadable again.").arg(short_opts[FIX_MODEL]).arg(FIX_MODEL) << endl; - out << trUtf8(" %1, %2 [NUMBER]\t Model fix tries. When reaching the maximum count the invalid objects will be discard.").arg(short_opts[FIX_TRIES]).arg(FIX_TRIES) << endl; + out << trUtf8(" %1, %2 [NUMBER]\t Model fix tries. When reaching the maximum count the invalid objects will be discarded.").arg(short_opts[FIX_TRIES]).arg(FIX_TRIES) << endl; out << trUtf8(" %1, %2\t\t Export the input model to a sql script file.").arg(short_opts[EXPORT_TO_FILE]).arg(EXPORT_TO_FILE)<< endl; out << trUtf8(" %1, %2\t\t Export the input model to a png image.").arg(short_opts[EXPORT_TO_PNG]).arg(EXPORT_TO_PNG) << endl; out << trUtf8(" %1, %2\t\t Export the input model to a svg file.").arg(short_opts[EXPORT_TO_SVG]).arg(EXPORT_TO_SVG) << endl; out << trUtf8(" %1, %2\t\t Export the input model directly to a PostgreSQL server.").arg(short_opts[EXPORT_TO_DBMS]).arg(EXPORT_TO_DBMS) << endl; out << trUtf8(" %1, %2\t\t Import a database to an output file.").arg(short_opts[IMPORT_DB]).arg(IMPORT_DB) << endl; - out << trUtf8(" %1, %2\t\t\t Compares a model and database or two databases generating a SQL script to synch the latter in relation to the first.").arg(short_opts[DIFF]).arg(DIFF) << endl; + out << trUtf8(" %1, %2\t\t\t Compares a model and a database or two databases generating the SQL script to synch the latter in relation to the first.").arg(short_opts[DIFF]).arg(DIFF) << endl; out << trUtf8(" %1, %2\t\t Force the PostgreSQL version of generated SQL code.").arg(short_opts[PGSQL_VER]).arg(PGSQL_VER) << endl; - out << trUtf8(" %1, %2\t\t\t Silent execution. Only critical errors are shown during process.").arg(short_opts[SILENT]).arg(SILENT) << endl; + out << trUtf8(" %1, %2\t\t\t Silent execution. Only critical messages and errors are shown during process.").arg(short_opts[SILENT]).arg(SILENT) << endl; out << trUtf8(" %1, %2\t\t\t Show this help menu.").arg(short_opts[HELP]).arg(HELP) << endl; out << endl; out << trUtf8("Connection options: ") << endl; out << trUtf8(" %1, %2\t\t List available connections in file %3.").arg(short_opts[LIST_CONNS]).arg(LIST_CONNS).arg(GlobalAttributes::CONNECTIONS_CONF + GlobalAttributes::CONFIGURATION_EXT) << endl; out << trUtf8(" %1, %2 [ALIAS]\t Connection configuration alias to be used.").arg(short_opts[CONN_ALIAS]).arg(CONN_ALIAS) << endl; - out << trUtf8(" %1, %2 [HOST]\t\t PostgreSQL host which a task will operate.").arg(short_opts[HOST]).arg(HOST) << endl; + out << trUtf8(" %1, %2 [HOST]\t\t PostgreSQL host in which a task will operate.").arg(short_opts[HOST]).arg(HOST) << endl; out << trUtf8(" %1, %2 [PORT]\t\t PostgreSQL host listening port.").arg(short_opts[PORT]).arg(PORT) << endl; out << trUtf8(" %1, %2 [USER]\t\t PostgreSQL username.").arg(short_opts[USER]).arg(USER) << endl; out << trUtf8(" %1, %2 [PASSWORD]\t PostgreSQL user password.").arg(short_opts[PASSWD]).arg(PASSWD) << endl; out << trUtf8(" %1, %2 [DBNAME]\t Connection's initial database.").arg(short_opts[INITIAL_DB]).arg(INITIAL_DB) << endl; out << endl; out << trUtf8("PNG and SVG export options: ") << endl; - out << trUtf8(" %1, %2\t\t Draws the grid on the exported png image.").arg(short_opts[SHOW_GRID]).arg(SHOW_GRID) << endl; - out << trUtf8(" %1, %2\t Draws the page delimiters on the exported png image.").arg(short_opts[SHOW_DELIMITERS]).arg(SHOW_DELIMITERS) << endl; - out << trUtf8(" %1, %2\t\t Each page will be exported on a separated png image. (Only for PNG)").arg(short_opts[PAGE_BY_PAGE]).arg(PAGE_BY_PAGE) << endl; - out << trUtf8(" %1, %2 [FACTOR]\t\t Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG)").arg(short_opts[ZOOM_FACTOR]).arg(ZOOM_FACTOR).arg(ModelWidget::MINIMUM_ZOOM*100).arg(ModelWidget::MAXIMUM_ZOOM*100) << endl; + out << trUtf8(" %1, %2\t\t Draws the grid in the exported image.").arg(short_opts[SHOW_GRID]).arg(SHOW_GRID) << endl; + out << trUtf8(" %1, %2\t Draws the page delimiters in the exported image.").arg(short_opts[SHOW_DELIMITERS]).arg(SHOW_DELIMITERS) << endl; + out << trUtf8(" %1, %2\t\t Each page will be exported in a separated png image. (Only for PNG images)").arg(short_opts[PAGE_BY_PAGE]).arg(PAGE_BY_PAGE) << endl; + out << trUtf8(" %1, %2 [FACTOR]\t\t Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images)").arg(short_opts[ZOOM_FACTOR]).arg(ZOOM_FACTOR).arg(ModelWidget::MINIMUM_ZOOM*100).arg(ModelWidget::MAXIMUM_ZOOM*100) << endl; out << endl; out << trUtf8("DBMS export options: ") << endl; - out << trUtf8(" %1, %2\t Ignores errors related to duplicated objects that eventually exists on server side.").arg(short_opts[IGNORE_DUPLICATES]).arg(IGNORE_DUPLICATES) << endl; + out << trUtf8(" %1, %2\t Ignores errors related to duplicated objects that eventually exist in the server.").arg(short_opts[IGNORE_DUPLICATES]).arg(IGNORE_DUPLICATES) << endl; out << trUtf8(" %1, %2 [CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided.").arg(short_opts[IGNORE_ERROR_CODES]).arg(IGNORE_ERROR_CODES) << endl; out << trUtf8(" %1, %2\t\t Drop the database before execute a export process.").arg(short_opts[DROP_DATABASE]).arg(DROP_DATABASE) << endl; out << trUtf8(" %1, %2\t\t Runs the DROP commands attached to SQL-enabled objects.").arg(short_opts[DROP_OBJECTS]).arg(DROP_OBJECTS) << endl; - out << trUtf8(" %1, %2\t\t Simulates a export process. Actually executes all steps but undoing any modification.").arg(short_opts[SIMULATE]).arg(SIMULATE) << endl; + out << trUtf8(" %1, %2\t\t Simulates an export process by executing all steps but undoing any modification in the end.").arg(short_opts[SIMULATE]).arg(SIMULATE) << endl; out << trUtf8(" %1, %2\t\t Generates temporary names for database, roles and tablespaces when in simulation mode.").arg(short_opts[USE_TMP_NAMES]).arg(USE_TMP_NAMES) << endl; out << endl; out << trUtf8("Database import options: ") << endl; @@ -421,13 +421,13 @@ void PgModelerCLI::showMenu(void) out << trUtf8("Diff options: ") << endl; out << trUtf8(" %1, %2 [DBNAME]\t The database used in the comparison. All the SQL code generated is applied to it.").arg(short_opts[COMPARE_TO]).arg(COMPARE_TO) << endl; out << trUtf8(" %1, %2\t\t Save the generated diff code to output file.").arg(short_opts[SAVE_DIFF]).arg(SAVE_DIFF) << endl; - out << trUtf8(" %1, %2\t\t Apply the generated diff code to the database.").arg(short_opts[APPLY_DIFF]).arg(APPLY_DIFF) << endl; - out << trUtf8(" %1, %2\t Don't preview the generated diff code.").arg(short_opts[NO_DIFF_PREVIEW]).arg(NO_DIFF_PREVIEW) << endl; + out << trUtf8(" %1, %2\t\t Apply the generated diff code on the database server.").arg(short_opts[APPLY_DIFF]).arg(APPLY_DIFF) << endl; + out << trUtf8(" %1, %2\t Don't preview the generated diff code when applying it to the server.").arg(short_opts[NO_DIFF_PREVIEW]).arg(NO_DIFF_PREVIEW) << endl; out << trUtf8(" %1, %2\t Drop cluster level objects like roles and tablespaces.").arg(short_opts[DROP_CLUSTER_OBJS]).arg(DROP_CLUSTER_OBJS) << endl; out << trUtf8(" %1, %2\t\t Revoke permissions already set on the database. New permissions configured in the input model are still applied.").arg(short_opts[REVOKE_PERMISSIONS]).arg(REVOKE_PERMISSIONS) << endl; out << trUtf8(" %1, %2\t\t Drop missing objects. Generates DROP commands for objects that are present in the input model but not in the compared database.").arg(short_opts[DROP_MISSING_OBJS]).arg(DROP_MISSING_OBJS) << endl; out << trUtf8(" %1, %2\t Force the drop of missing columns and constraints. Causes only columns and constraints to be dropped, other missing objects aren't removed.").arg(short_opts[FORCE_DROP_COLS_CONSTRS]).arg(FORCE_DROP_COLS_CONSTRS) << endl; - out << trUtf8(" %1, %2\t\t Rename the destination database. When the databases have different names the destination one has its name changed.").arg(short_opts[RENAME_DB]).arg(RENAME_DB) << endl; + out << trUtf8(" %1, %2\t\t Rename the destination database when the names of the involved databases are different.").arg(short_opts[RENAME_DB]).arg(RENAME_DB) << endl; out << trUtf8(" %1, %2\t\t Don't drop or truncate objects in cascade mode.").arg(short_opts[NO_CASCADE_DROP_TRUNC]).arg(NO_CASCADE_DROP_TRUNC) << endl; out << trUtf8(" %1, %2\t Truncate tables prior to alter columns. Avoids errors related to type casting when the new type of a column isn't compatible to the old one.").arg(short_opts[TRUNC_ON_COLS_TYPE_CHANGE]).arg(TRUNC_ON_COLS_TYPE_CHANGE) << endl; out << trUtf8(" %1, %2\t Don't reuse sequences on serial columns. Drop the old sequence assigned to a serial column and creates a new one.").arg(short_opts[NO_SEQUENCE_REUSE]).arg(NO_SEQUENCE_REUSE) << endl; From 01bf0facb58f866cc7ebc40203203b0d7fa01232 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 24 Apr 2018 16:40:56 -0300 Subject: [PATCH 003/425] Detecting the PostgreSQL version when diffing databases in CLI --- main-cli/src/pgmodelercli.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 1ab1809edf..7a91ff94e2 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1344,6 +1344,15 @@ void PgModelerCLI::diffModelDatabase(void) diff_hlp.setDiffOption(ModelsDiffHelper::OPT_DONT_DROP_MISSING_OBJS, !parsed_opts.count(DROP_MISSING_OBJS)); diff_hlp.setDiffOption(ModelsDiffHelper::OPT_DROP_MISSING_COLS_CONSTR, !parsed_opts.count(FORCE_DROP_COLS_CONSTRS)); + if(!parsed_opts[PGSQL_VER].isEmpty()) + diff_hlp.setPgSQLVersion(parsed_opts[PGSQL_VER]); + else + { + extra_connection.connect(); + diff_hlp.setPgSQLVersion(extra_connection.getPgSQLVersion(true)); + extra_connection.close(); + } + printMessage(trUtf8("Comparing the generated models...")); diff_hlp.diffModels(); From 42a3a6587777b0a68b5cf3d02fb1db3bb5373385 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 25 Apr 2018 09:25:25 -0300 Subject: [PATCH 004/425] Added support to RESTART IDENTITY on truncate tables in DatabaseExplorerWidget Added an custom option checkbox in Messagebox for general purpose usage. --- libparsers/src/parsersattributes.cpp | 1 + libparsers/src/parsersattributes.h | 1 + .../src/databaseexplorerwidget.cpp | 3 +- libpgmodeler_ui/src/messagebox.cpp | 17 +- libpgmodeler_ui/src/messagebox.h | 3 + libpgmodeler_ui/ui/messagebox.ui | 356 ++++++++++-------- schemas/alter/truncate.sch | 11 +- 7 files changed, 230 insertions(+), 162 deletions(-) diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index dd0f7709ba..c68a77b855 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -410,6 +410,7 @@ namespace ParsersAttributes { RENAME=QString("rename"), REPLICATION=QString("replication"), RESTRICTION_FUNC=QString("restriction"), + RESTART_SEQ=QString("restart-seq"), RETURN_TABLE=QString("return-table"), RETURN_TYPE=QString("return-type"), RETURNS_SETOF=QString("returns-setof"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index d06ce98284..4e4a78bd14 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -424,6 +424,7 @@ namespace ParsersAttributes { RELATIONSHIP, RENAME, REPLICATION, + RESTART_SEQ, RESTRICTION_FUNC, RETURN_TABLE, RETURN_TYPE, diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 395c187a24..d93cc10784 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1268,6 +1268,7 @@ void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade) else msg=trUtf8("Do you really want to cascade truncate the table %1? This action will truncate all the tables that depends on it?").arg(obj_name); + msg_box.setCustomOptionText(trUtf8("Also restart sequences")); msg_box.show(msg, Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); if(msg_box.result()==QDialog::Accepted) @@ -1279,7 +1280,7 @@ void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade) attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(OBJ_TABLE); attribs[ParsersAttributes::SIGNATURE]=sch_name + QString(".\"%1\"").arg(obj_name); attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : ""); - + attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::_TRUE_ : ""); //Generate the truncate command schparser.ignoreEmptyAttributes(true); diff --git a/libpgmodeler_ui/src/messagebox.cpp b/libpgmodeler_ui/src/messagebox.cpp index efa66df897..4120492e6a 100644 --- a/libpgmodeler_ui/src/messagebox.cpp +++ b/libpgmodeler_ui/src/messagebox.cpp @@ -31,8 +31,10 @@ Messagebox::Messagebox(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) connect(show_errors_tb,SIGNAL(clicked()),this,SLOT(showExceptionList())); connect(show_errors_tb,SIGNAL(toggled(bool)),show_raw_info_tb,SLOT(setVisible(bool))); connect(show_raw_info_tb,SIGNAL(toggled(bool)),this,SLOT(showExceptionList(void))); - show_errors_tb->setVisible(false); + show_raw_info_tb->setVisible(false); + error_show_btns_wgt->setVisible(false); + custom_option_chk->setVisible(false); } void Messagebox::handleYesOkClick(void) @@ -62,6 +64,17 @@ bool Messagebox::isCancelled(void) return(cancelled); } +void Messagebox::setCustomOptionText(const QString &text) +{ + custom_option_chk->setVisible(!text.isEmpty()); + custom_option_chk->setText(text); +} + +bool Messagebox::isCustomOptionChecked(void) +{ + return(custom_option_chk->isChecked()); +} + void Messagebox::showExceptionList(void) { if(show_errors_tb->isChecked()) @@ -188,7 +201,7 @@ void Messagebox::show(const QString &title, const QString &msg, unsigned icon_ty this->setWindowTitle(aux_title); this->objs_group_wgt->setCurrentIndex(0); this->show_errors_tb->setChecked(false); - this->show_errors_tb->setVisible((exceptions_trw->topLevelItemCount() > 0)); + error_show_btns_wgt->setVisible((exceptions_trw->topLevelItemCount() > 0)); showExceptionList(); this->resize(this->minimumWidth(), this->minimumHeight()); diff --git a/libpgmodeler_ui/src/messagebox.h b/libpgmodeler_ui/src/messagebox.h index d549e1fb15..69228e1c36 100644 --- a/libpgmodeler_ui/src/messagebox.h +++ b/libpgmodeler_ui/src/messagebox.h @@ -67,6 +67,9 @@ class Messagebox: public QDialog, public Ui::Messagebox { bool isCancelled(void); + void setCustomOptionText(const QString &text); + bool isCustomOptionChecked(void); + private slots: void handleYesOkClick(void); void handleNoCancelClick(void); diff --git a/libpgmodeler_ui/ui/messagebox.ui b/libpgmodeler_ui/ui/messagebox.ui index 9f1a235117..38e5e05b28 100644 --- a/libpgmodeler_ui/ui/messagebox.ui +++ b/libpgmodeler_ui/ui/messagebox.ui @@ -10,7 +10,7 @@ 0 0 500 - 175 + 244 @@ -105,7 +105,7 @@ 0 - + 0 @@ -118,91 +118,121 @@ 0 - - 0 - - - - 2 + + + + 40 + 40 + - - - - - 40 - 40 - - - - - 40 - 40 - - - - - - - Qt::AlignCenter - - - - - - - true - - - - 0 - 0 - + + + 40 + 40 + + + + + + + Qt::AlignCenter + + + + + + + true + + + + 0 + 0 + + + + + 0 + 90 + + + + + 16777215 + 16777215 + + + + false + + + false + + + + + + msg + + + Qt::RichText + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + 4 + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + Qt::Vertical + + + + 20 + 84 + + + + + + + + + + Qt::Horizontal - - - 0 - 90 - + + QSizePolicy::Fixed - + - 16777215 - 16777215 + 5 + 20 - - false - - - false - - - - + + + + - msg - - - Qt::RichText - - - true - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - 4 - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + @@ -316,86 +346,100 @@ - - - - Qt::Horizontal - - + + + - 414 - 27 + 0 + 0 - - - - - - 4 - - - 4 - - - - - - 0 - 0 - - - - Show raw text errors or information. - - - - - - - :/icones/icones/codigofonte.png:/icones/icones/codigofonte.png - - - - 22 - 22 - - - - true - - - - - - - - 0 - 0 - - - - Show/hide exceptions stack. - - - ... - - - - :/icones/icones/refazer.png:/icones/icones/refazer.png - - - - 22 - 22 - - - - true - - - - + + + 0 + + + 0 + + + 4 + + + 4 + + + + + Qt::Horizontal + + + + 415 + 24 + + + + + + + + + 0 + 0 + + + + Show raw text errors or information. + + + + + + + :/icones/icones/codigofonte.png:/icones/icones/codigofonte.png + + + + 22 + 22 + + + + true + + + + + + + + 0 + 0 + + + + Show/hide exceptions stack. + + + ... + + + + :/icones/icones/refazer.png:/icones/icones/refazer.png + + + + 22 + 22 + + + + true + + + + + diff --git a/schemas/alter/truncate.sch b/schemas/alter/truncate.sch index f7b26cbb44..39a822b513 100644 --- a/schemas/alter/truncate.sch +++ b/schemas/alter/truncate.sch @@ -5,9 +5,14 @@ [TRUNCATE ] {sql-object} $sp {signature} +%if {restart-seq} %then + [ RESTART IDENTITY ] +%end + %if {cascade} %then - [ CASCADE] - %end - ; + [ CASCADE] +%end + +; $br [-- ddl-end --] $br From 061ed7be596b8b870e7fd6bdb7511bb098bd7c97 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 25 Apr 2018 09:47:40 -0300 Subject: [PATCH 005/425] Minor improvement in the text find widgets in SQLExecutionWidget in order to make them closable via dedicated button --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 ++ libpgmodeler_ui/ui/findreplacewidget.ui | 31 +++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 18d8acf839..fa4405d14d 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -51,6 +51,7 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) layout->addWidget(find_history_wgt); find_history_parent->setLayout(layout); find_history_parent->setVisible(false); + connect(find_history_wgt->hide_tb, SIGNAL(clicked(bool)), find_history_parent, SLOT(hide())); sql_cmd_hl=new SyntaxHighlighter(sql_cmd_txt, false); sql_cmd_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); @@ -74,6 +75,7 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) hbox->setContentsMargins(0,0,0,0); hbox->addWidget(find_replace_wgt); find_wgt_parent->setVisible(false); + connect(find_replace_wgt->hide_tb, SIGNAL(clicked(bool)), find_tb, SLOT(toggle())); run_sql_tb->setToolTip(run_sql_tb->toolTip() + QString(" (%1)").arg(run_sql_tb->shortcut().toString())); export_tb->setToolTip(export_tb->toolTip() + QString(" (%1)").arg(export_tb->shortcut().toString())); diff --git a/libpgmodeler_ui/ui/findreplacewidget.ui b/libpgmodeler_ui/ui/findreplacewidget.ui index 9bdea1a4c4..d5972e866d 100644 --- a/libpgmodeler_ui/ui/findreplacewidget.ui +++ b/libpgmodeler_ui/ui/findreplacewidget.ui @@ -7,7 +7,7 @@ 0 0 704 - 62 + 64 @@ -170,6 +170,35 @@ + + + + + 20 + 20 + + + + + 20 + 20 + + + + Hide this widget + + + ... + + + + :/icones/icones/fechar1.png:/icones/icones/fechar1.png + + + true + + + From 0b592180173e3d5748e5e8a861c52d706cc16347 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 25 Apr 2018 11:46:26 -0300 Subject: [PATCH 006/425] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index fa4405d14d..b00fa0af62 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -416,6 +416,7 @@ void SQLExecutionWidget::runSQLCommand(void) { ResultSet res; QStringList conn_notices; + qint64 start_exec=0, end_exec=0, total_exec = 0; output_tb->setChecked(true); @@ -436,9 +437,11 @@ void SQLExecutionWidget::runSQLCommand(void) } QApplication::setOverrideCursor(Qt::WaitCursor); + + start_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); sql_cmd_conn.executeDMLCommand(cmd, res); - conn_notices=sql_cmd_conn.getNotices(); + conn_notices=sql_cmd_conn.getNotices(); addToSQLHistory(cmd, res.getTupleCount()); output_tbw->setTabEnabled(0, !res.isEmpty()); @@ -474,9 +477,13 @@ void SQLExecutionWidget::runSQLCommand(void) QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); } + end_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); + total_exec = end_exec - start_exec; + PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command successfully executed. %2 %3") + PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command successfully executed in %2. %3 %4") .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))) + .arg(total_exec >= 1000 ? QString("%1 s").arg(total_exec/1000) : QString("%1 ms").arg(total_exec)) .arg(res.isEmpty() ? trUtf8("Rows affected") : trUtf8("Rows retrieved")) .arg(res.getTupleCount())), QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); From e446f75c2f75aac4aaddca651d741ea985ba7947 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 26 Apr 2018 11:19:51 -0300 Subject: [PATCH 007/425] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory. --- libpgmodeler_ui/libpgmodeler_ui.pro | 6 +- libpgmodeler_ui/src/resultsetmodel.cpp | 137 +++++++++++++++++++++ libpgmodeler_ui/src/resultsetmodel.h | 53 ++++++++ libpgmodeler_ui/src/sqlexecutionwidget.cpp | 29 ++++- libpgmodeler_ui/src/sqlexecutionwidget.h | 4 + libpgmodeler_ui/ui/sqlexecutionwidget.ui | 30 ++++- 6 files changed, 255 insertions(+), 4 deletions(-) create mode 100644 libpgmodeler_ui/src/resultsetmodel.cpp create mode 100644 libpgmodeler_ui/src/resultsetmodel.h diff --git a/libpgmodeler_ui/libpgmodeler_ui.pro b/libpgmodeler_ui/libpgmodeler_ui.pro index e0eacb7103..48455934a5 100644 --- a/libpgmodeler_ui/libpgmodeler_ui.pro +++ b/libpgmodeler_ui/libpgmodeler_ui.pro @@ -112,7 +112,8 @@ SOURCES += src/mainwindow.cpp \ src/sceneinfowidget.cpp \ src/bulkdataeditwidget.cpp \ src/policywidget.cpp \ - src/objectstablewidget.cpp + src/objectstablewidget.cpp \ + src/resultsetmodel.cpp HEADERS += src/mainwindow.h \ @@ -212,7 +213,8 @@ HEADERS += src/mainwindow.h \ src/sceneinfowidget.h \ src/bulkdataeditwidget.h \ src/policywidget.h \ - src/objectstablewidget.h + src/objectstablewidget.h \ + src/resultsetmodel.h FORMS += ui/mainwindow.ui \ ui/textboxwidget.ui \ diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp new file mode 100644 index 0000000000..425c7da751 --- /dev/null +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -0,0 +1,137 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "resultsetmodel.h" + +ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent) : QAbstractTableModel(parent) +{ + try + { + Catalog aux_cat = catalog; + vector type_ids; + vector::iterator end; + vector types; + map type_names; + int col = 0; + + col_cnt = res.getColumnCount(); + row_cnt = res.getTupleCount(); + insertColumns(0, col_cnt); + insertRows(0, row_cnt); + + for(col=0; col < col_cnt; col++) + { + header_data.push_back(res.getColumnName(col)); + type_ids.push_back(res.getColumnTypeId(col)); + } + + if(res.accessTuple(ResultSet::FIRST_TUPLE)) + { + do + { + //Fills the current row with the values of current tuple + for(int col=0; col < col_cnt; col++) + { + if(res.isColumnBinaryFormat(col)) + item_data.push_back(trUtf8("[binary data]")); + else + item_data.push_back(res.getColumnValue(col)); + } + } + while(res.accessTuple(ResultSet::NEXT_TUPLE)); + } + + aux_cat.setFilter(Catalog::LIST_ALL_OBJS); + std::sort(type_ids.begin(), type_ids.end()); + end=std::unique(type_ids.begin(), type_ids.end()); + type_ids.erase(end, type_ids.end()); + + types = aux_cat.getObjectsAttributes(OBJ_TYPE, QString(), QString(), type_ids); + col = 0; + + for(auto &tp : types) + type_names[tp[ParsersAttributes::OID].toInt()]=tp[ParsersAttributes::NAME]; + + for(col=0; col < col_cnt; col++) + tooltip_data.push_back(type_names[res.getColumnTypeId(col)]); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +int ResultSetModel::rowCount(const QModelIndex &) const +{ + return(row_cnt); +} + +int ResultSetModel::columnCount(const QModelIndex &) const +{ + return(col_cnt); +} + +QModelIndex ResultSetModel::index(int row, int column, const QModelIndex &parent) const +{ + return(QAbstractTableModel::index(row, column, parent)); +} + +QModelIndex ResultSetModel::parent(const QModelIndex &) const +{ + return(QModelIndex()); +} + +QVariant ResultSetModel::data(const QModelIndex &index, int role) const +{ + if(index.row() < row_cnt && index.column() < col_cnt) + { + if(role == Qt::DisplayRole) + return(item_data.at(index.row() * col_cnt + index.column())); + + if(role == Qt::TextAlignmentRole) + return(QVariant(Qt::AlignLeft | Qt::AlignVCenter)); + } + + return(QVariant(QVariant::Invalid)); +} + +QVariant ResultSetModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if(orientation == Qt::Horizontal) + { + if(section >= col_cnt) + return(QVariant(QVariant::Invalid)); + + if(role == Qt::DisplayRole) + return(header_data.at(section)); + + if(role == Qt::ToolTipRole) + return(tooltip_data.at(section)); + + if(role == Qt::TextAlignmentRole) + return(QVariant(Qt::AlignLeft | Qt::AlignVCenter)); + } + + return(QAbstractTableModel::headerData(section, orientation, role)); +} + +Qt::ItemFlags ResultSetModel::flags(const QModelIndex &) const +{ + return(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled ); +} + diff --git a/libpgmodeler_ui/src/resultsetmodel.h b/libpgmodeler_ui/src/resultsetmodel.h new file mode 100644 index 0000000000..bb961cfd2b --- /dev/null +++ b/libpgmodeler_ui/src/resultsetmodel.h @@ -0,0 +1,53 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler_ui +\class ResultSetModel +\brief Implements a model representation of ResultSet class which can be used to show large amount of data in instances of QTableView. +*/ + +#ifndef RESULT_SET_MODEL_H +#define RESULT_SET_MODEL_H + +#include +#include "resultset.h" +#include "catalog.h" + +class ResultSetModel: public QAbstractTableModel { + private: + Q_OBJECT + + int col_cnt, row_cnt; + QStringList item_data, header_data, tooltip_data; + + void insertColumn(int, const QModelIndex &){} + void insertRow(int, const QModelIndex &){} + + public: + ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent = 0); + virtual int rowCount(const QModelIndex &) const; + virtual int columnCount(const QModelIndex &) const; + virtual QModelIndex index(int row, int column, const QModelIndex &parent) const; + virtual QModelIndex parent(const QModelIndex &) const; + virtual QVariant data(const QModelIndex &index, int role) const; + virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; + virtual Qt::ItemFlags flags(const QModelIndex &) const; +}; + +#endif diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index b00fa0af62..85bf035ade 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -34,6 +34,8 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) { setupUi(this); + result_model = nullptr; + sql_cmd_txt=PgModelerUiNS::createNumberedTextEditor(sql_cmd_wgt); cmd_history_txt=PgModelerUiNS::createNumberedTextEditor(cmd_history_parent); cmd_history_txt->setCustomContextMenuEnabled(false); @@ -84,6 +86,7 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) find_tb->setToolTip(find_tb->toolTip() + QString(" (%1)").arg(find_tb->shortcut().toString())); results_tbw->setItemDelegate(new PlainTextItemDelegate(this, true)); + tableView->setItemDelegate(new PlainTextItemDelegate(this, true)); action_load=new QAction(QIcon(PgModelerUiNS::getIconPath("abrir")), trUtf8("Load"), this); action_save=new QAction(QIcon(PgModelerUiNS::getIconPath("salvar")), trUtf8("Save"), this); @@ -129,6 +132,16 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) v_splitter->handle(1)->installEventFilter(this); } +SQLExecutionWidget::~SQLExecutionWidget(void) +{ + if(result_model) + { + tableView->blockSignals(true); + tableView->setModel(nullptr); + delete(result_model); + } +} + bool SQLExecutionWidget::eventFilter(QObject *object, QEvent *event) { if(event->type() == QEvent::MouseButtonDblClick && object == v_splitter->handle(1)) @@ -187,7 +200,21 @@ void SQLExecutionWidget::fillResultsTable(ResultSet &res) aux_conn.setConnectionParams(sql_cmd_conn.getConnectionParams()); export_tb->setEnabled(res.getTupleCount() > 0); catalog.setConnection(aux_conn); - fillResultsTable(catalog, res, results_tbw); + + tableView->setSortingEnabled(false); + tableView->blockSignals(true); + tableView->setUpdatesEnabled(false); + tableView->setModel(nullptr); + + if(result_model) + delete(result_model); + + result_model = new ResultSetModel(res, catalog); + + tableView->setModel(result_model); + tableView->resizeColumnsToContents(); + tableView->setUpdatesEnabled(true); + tableView->blockSignals(false); } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index 8257fc1352..858d46247e 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -33,6 +33,7 @@ #include "codecompletionwidget.h" #include "numberedtexteditor.h" #include "findreplacewidget.h" +#include "resultsetmodel.h" class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { private: @@ -74,6 +75,8 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { FindReplaceWidget *find_history_wgt; + ResultSetModel *result_model; + /*! \brief Enables/Disables the fields for sql input and execution. When enabling a new connection to server will be opened. */ void enableSQLExecution(bool enable); @@ -103,6 +106,7 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { static const QString COLUMN_NULL_VALUE; SQLExecutionWidget(QWidget * parent = 0); + ~SQLExecutionWidget(void); //! \brief Configures the connection to query the server void setConnection(Connection conn); diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 60d3821d04..5e0821246c 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -581,7 +581,7 @@ 4 - + @@ -655,6 +655,34 @@ + + + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + true + + + QAbstractItemView::ContiguousSelection + + + true + + + false + + + true + + + true + + + 25 + + + From 1885f34d44f06dba6cdf9d615920720fd8446d0c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 26 Apr 2018 15:53:14 -0300 Subject: [PATCH 008/425] Refactored the methods in SQLExecutionWidget that copy results grid as text and csv to accept QTableView instance instead of QTableWidget --- libpgmodeler_ui/src/resultsetmodel.cpp | 24 +-- libpgmodeler_ui/src/resultsetmodel.h | 2 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 198 ++++++++++----------- libpgmodeler_ui/src/sqlexecutionwidget.h | 11 +- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 64 ++----- 5 files changed, 123 insertions(+), 176 deletions(-) diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index 425c7da751..548ff7c3da 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -29,12 +29,12 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent map type_names; int col = 0; - col_cnt = res.getColumnCount(); - row_cnt = res.getTupleCount(); - insertColumns(0, col_cnt); - insertRows(0, row_cnt); + col_count = res.getColumnCount(); + row_count = res.getTupleCount(); + insertColumns(0, col_count); + insertRows(0, row_count); - for(col=0; col < col_cnt; col++) + for(col=0; col < col_count; col++) { header_data.push_back(res.getColumnName(col)); type_ids.push_back(res.getColumnTypeId(col)); @@ -45,7 +45,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent do { //Fills the current row with the values of current tuple - for(int col=0; col < col_cnt; col++) + for(int col=0; col < col_count; col++) { if(res.isColumnBinaryFormat(col)) item_data.push_back(trUtf8("[binary data]")); @@ -67,7 +67,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent for(auto &tp : types) type_names[tp[ParsersAttributes::OID].toInt()]=tp[ParsersAttributes::NAME]; - for(col=0; col < col_cnt; col++) + for(col=0; col < col_count; col++) tooltip_data.push_back(type_names[res.getColumnTypeId(col)]); } catch(Exception &e) @@ -78,12 +78,12 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent int ResultSetModel::rowCount(const QModelIndex &) const { - return(row_cnt); + return(row_count); } int ResultSetModel::columnCount(const QModelIndex &) const { - return(col_cnt); + return(col_count); } QModelIndex ResultSetModel::index(int row, int column, const QModelIndex &parent) const @@ -98,10 +98,10 @@ QModelIndex ResultSetModel::parent(const QModelIndex &) const QVariant ResultSetModel::data(const QModelIndex &index, int role) const { - if(index.row() < row_cnt && index.column() < col_cnt) + if(index.row() < row_count && index.column() < col_count) { if(role == Qt::DisplayRole) - return(item_data.at(index.row() * col_cnt + index.column())); + return(item_data.at(index.row() * col_count + index.column())); if(role == Qt::TextAlignmentRole) return(QVariant(Qt::AlignLeft | Qt::AlignVCenter)); @@ -114,7 +114,7 @@ QVariant ResultSetModel::headerData(int section, Qt::Orientation orientation, in { if(orientation == Qt::Horizontal) { - if(section >= col_cnt) + if(section >= col_count) return(QVariant(QVariant::Invalid)); if(role == Qt::DisplayRole) diff --git a/libpgmodeler_ui/src/resultsetmodel.h b/libpgmodeler_ui/src/resultsetmodel.h index bb961cfd2b..ec1a6a5a34 100644 --- a/libpgmodeler_ui/src/resultsetmodel.h +++ b/libpgmodeler_ui/src/resultsetmodel.h @@ -33,7 +33,7 @@ class ResultSetModel: public QAbstractTableModel { private: Q_OBJECT - int col_cnt, row_cnt; + int col_count, row_count; QStringList item_data, header_data, tooltip_data; void insertColumn(int, const QModelIndex &){} diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 85bf035ade..1cb0fdf919 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -86,7 +86,6 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) find_tb->setToolTip(find_tb->toolTip() + QString(" (%1)").arg(find_tb->shortcut().toString())); results_tbw->setItemDelegate(new PlainTextItemDelegate(this, true)); - tableView->setItemDelegate(new PlainTextItemDelegate(this, true)); action_load=new QAction(QIcon(PgModelerUiNS::getIconPath("abrir")), trUtf8("Load"), this); action_save=new QAction(QIcon(PgModelerUiNS::getIconPath("salvar")), trUtf8("Save"), this); @@ -108,7 +107,7 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) connect(output_tb, SIGNAL(toggled(bool)), this, SLOT(toggleOutputPane(bool))); //Signal handling with C++11 lambdas Slots - connect(results_tbw, &QTableWidget::itemPressed, + connect(results_tbw, &QTableView::pressed, [&](){ SQLExecutionWidget::copySelection(results_tbw); }); connect(export_tb, &QToolButton::clicked, @@ -136,8 +135,8 @@ SQLExecutionWidget::~SQLExecutionWidget(void) { if(result_model) { - tableView->blockSignals(true); - tableView->setModel(nullptr); + results_tbw->blockSignals(true); + results_tbw->setModel(nullptr); delete(result_model); } } @@ -201,20 +200,20 @@ void SQLExecutionWidget::fillResultsTable(ResultSet &res) export_tb->setEnabled(res.getTupleCount() > 0); catalog.setConnection(aux_conn); - tableView->setSortingEnabled(false); - tableView->blockSignals(true); - tableView->setUpdatesEnabled(false); - tableView->setModel(nullptr); + results_tbw->setSortingEnabled(false); + results_tbw->blockSignals(true); + results_tbw->setUpdatesEnabled(false); + results_tbw->setModel(nullptr); if(result_model) delete(result_model); result_model = new ResultSetModel(res, catalog); - tableView->setModel(result_model); - tableView->resizeColumnsToContents(); - tableView->setUpdatesEnabled(true); - tableView->blockSignals(false); + results_tbw->setModel(result_model); + results_tbw->resizeColumnsToContents(); + results_tbw->setUpdatesEnabled(true); + results_tbw->blockSignals(false); } catch(Exception &e) { @@ -478,16 +477,8 @@ void SQLExecutionWidget::runSQLCommand(void) if(!res.isEmpty()) { fillResultsTable(res); - output_tbw->setTabText(0, trUtf8("Results (%1)").arg(results_tbw->rowCount())); - - if(res.getTupleCount() > max_result_rows) - { - conn_notices.append(trUtf8("The number of retrieved rows exceeds the maximum allowed in the results grid! The data was trucated.")); - conn_notices.append(trUtf8("Try to limit the result set by adjusting the query.")); - output_tbw->setCurrentIndex(1); - } - else - output_tbw->setCurrentIndex(0); + output_tbw->setTabText(0, trUtf8("Results (%1)").arg(results_tbw->model()->rowCount())); + output_tbw->setCurrentIndex(0); } else { @@ -587,7 +578,7 @@ void SQLExecutionWidget::loadCommands(void) } } -void SQLExecutionWidget::exportResults(QTableWidget *results_tbw) +void SQLExecutionWidget::exportResults(QTableView *results_tbw) { if(!results_tbw) throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -613,8 +604,18 @@ void SQLExecutionWidget::exportResults(QTableWidget *results_tbw) .arg(csv_file_dlg.selectedFiles().at(0)) , ERR_FILE_DIR_NOT_ACCESSED ,__PRETTY_FUNCTION__,__FILE__,__LINE__); - file.write(generateCSVBuffer(results_tbw, 0, 0, results_tbw->rowCount(), results_tbw->columnCount())); + QApplication::setOverrideCursor(Qt::WaitCursor); + results_tbw->setUpdatesEnabled(false); + results_tbw->blockSignals(true); + results_tbw->selectAll(); + + file.write(generateCSVBuffer(results_tbw)); file.close(); + + results_tbw->clearSelection(); + results_tbw->blockSignals(false); + results_tbw->setUpdatesEnabled(true); + QApplication::restoreOverrideCursor(); } } @@ -628,111 +629,102 @@ int SQLExecutionWidget::getMaxResultRows(void) return(max_result_rows); } -QByteArray SQLExecutionWidget::generateCSVBuffer(QTableWidget *results_tbw, int start_row, int start_col, int row_cnt, int col_cnt) +int SQLExecutionWidget::clearAll(void) { - if(!results_tbw) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); - - QByteArray buf; - QStringList line; + Messagebox msg_box; + int res = 0; - //If the selection interval is valid - if(start_row >=0 && start_col >=0 && - start_row + row_cnt <= results_tbw->rowCount() && - start_col + col_cnt <= results_tbw->columnCount()) - { - int col=0, row=0, - max_col=start_col + col_cnt, - max_row=start_row + row_cnt; + msg_box.show(trUtf8("The SQL input field and the results grid will be cleared! Want to proceed?"), + Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); - //Creating the header of csv - for(col=start_col; col < max_col; col++) - line.append(QString("\"%1\"").arg(results_tbw->horizontalHeaderItem(col)->text())); + res = msg_box.result(); - buf.append(line.join(';')); - buf.append('\n'); - line.clear(); + if(res==QDialog::Accepted) + { + sql_cmd_txt->setPlainText(QString()); + msgoutput_lst->clear(); + msgoutput_lst->setVisible(true); + results_parent->setVisible(false); + export_tb->setEnabled(false); + } - //Creating the content - for(row=start_row; row < max_row; row++) - { - for(col=start_col; col < max_col; col++) - line.append(QString("\"%1\"").arg(results_tbw->item(row, col)->text())); + return(res); +} - buf.append(line.join(';')); - line.clear(); - buf.append('\n'); - } - } +QByteArray SQLExecutionWidget::generateCSVBuffer(QTableView *results_tbw) +{ + return(generateBuffer(results_tbw, QChar(';'), true, true)); +} - return(buf); +QByteArray SQLExecutionWidget::generateTextBuffer(QTableView *results_tbw) +{ + return(generateBuffer(results_tbw, QChar('\t'), false, false)); } -QByteArray SQLExecutionWidget::generateTextBuffer(QTableWidget *results_tbw, int start_row, int start_col, int row_cnt, int col_cnt) +QByteArray SQLExecutionWidget::generateBuffer(QTableView *results_tbw, QChar separator, bool incl_col_names, bool use_quotes) { if(!results_tbw) throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + if(!results_tbw->selectionModel()) + return (QByteArray()); + + QAbstractItemModel *model = results_tbw->model(); + QModelIndexList sel_indexes = results_tbw->selectionModel()->selectedIndexes(); QByteArray buf; QStringList line; + QModelIndex index; + QString str_pattern = use_quotes ? QString("\"%1\"") : QString("%1"); + int start_row = -1, start_col = -1, + row_cnt = 0, col_cnt = 0; - //If the selection interval is valid - if(start_row >=0 && start_col >=0 && - start_row + row_cnt <= results_tbw->rowCount() && - start_col + col_cnt <= results_tbw->columnCount()) - { - int col=0, row=0, - max_col=start_col + col_cnt, - max_row=start_row + row_cnt; - - //Creating the content - for(row=start_row; row < max_row; row++) - { - for(col=start_col; col < max_col; col++) - { - line.push_back(results_tbw->item(row, col)->text()); - } - - buf.append(line.join('\t')); - line.clear(); - buf.append('\n'); - } - } + start_row = sel_indexes.at(0).row(); + start_col = sel_indexes.at(0).column(); + row_cnt = (sel_indexes.last().row() - start_row) + 1; + col_cnt = (sel_indexes.last().column() - start_col) + 1; - return(buf); -} - -int SQLExecutionWidget::clearAll(void) -{ - Messagebox msg_box; - int res = 0; + int col=0, row=0, + max_col=start_col + col_cnt, + max_row=start_row + row_cnt; - msg_box.show(trUtf8("The SQL input field and the results grid will be cleared! Want to proceed?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + if(incl_col_names) + { + //Creating the header + for(col=start_col; col < max_col; col++) + line.append(str_pattern.arg(model->headerData(col, Qt::Horizontal).toString())); - res = msg_box.result(); + buf.append(line.join(separator)); + buf.append('\n'); + line.clear(); + } - if(res==QDialog::Accepted) + //Creating the content + for(row=start_row; row < max_row; row++) { - sql_cmd_txt->setPlainText(QString()); - msgoutput_lst->clear(); - msgoutput_lst->setVisible(true); - results_parent->setVisible(false); - export_tb->setEnabled(false); + for(col=start_col; col < max_col; col++) + { + index = model->index(row, col); + line.append(str_pattern.arg(index.data().toString())); + } + + buf.append(line.join(separator)); + line.clear(); + buf.append('\n'); } - return(res); + return(buf); } -void SQLExecutionWidget::copySelection(QTableWidget *results_tbw, bool use_popup, bool csv_is_default) +void SQLExecutionWidget::copySelection(QTableView *results_tbw, bool use_popup, bool csv_is_default) { if(!results_tbw) throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); - QList sel_ranges=results_tbw->selectedRanges(); + QItemSelectionModel *selection = results_tbw->selectionModel(); - if(sel_ranges.count()==1 && (!use_popup || (use_popup && QApplication::mouseButtons()==Qt::RightButton))) + if(selection && (!use_popup || (use_popup && QApplication::mouseButtons()==Qt::RightButton))) { + QModelIndexList sel_indexes = selection->selectedIndexes(); QMenu copy_menu, copy_mode_menu; QAction *act = nullptr, *act_csv = nullptr, *act_txt = nullptr; @@ -747,15 +739,13 @@ void SQLExecutionWidget::copySelection(QTableWidget *results_tbw, bool use_popup if(!use_popup || act) { - QTableWidgetSelectionRange selection=sel_ranges.at(0); + //QTableWidgetSelectionRange selection=sel_ranges.at(0); QByteArray buf; if((use_popup && act == act_csv) || (!use_popup && csv_is_default)) { //Generates the csv buffer and assigns it to application's clipboard - buf=generateCSVBuffer(results_tbw, - selection.topRow(), selection.leftColumn(), - selection.rowCount(), selection.columnCount()); + buf=generateCSVBuffer(results_tbw); /* Making DataManipulationForm instances know that the clipboard has csv buffer * in order to paste the contents properly */ @@ -763,9 +753,7 @@ void SQLExecutionWidget::copySelection(QTableWidget *results_tbw, bool use_popup } else if((use_popup && act == act_txt) || (!use_popup && !csv_is_default)) { - buf=generateTextBuffer(results_tbw, - selection.topRow(), selection.leftColumn(), - selection.rowCount(), selection.columnCount()); + buf=generateTextBuffer(results_tbw); } qApp->clipboard()->setText(buf); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index 858d46247e..4081be8c37 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -116,16 +116,19 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { static void fillResultsTable(Catalog &catalog, ResultSet &res, QTableWidget *results_tbw, bool store_data=false); //! \brief Copy to clipboard (in csv format) the current selected items on results grid - static void copySelection(QTableWidget *results_tbw, bool use_popup=true, bool csv_is_default = false); + static void copySelection(QTableView *results_tbw, bool use_popup=true, bool csv_is_default = false); //! \brief Generates a CSV buffer based upon the selection on the results grid - static QByteArray generateCSVBuffer(QTableWidget *results_tbw, int start_row, int start_col, int row_cnt, int col_cnt); + static QByteArray generateCSVBuffer(QTableView *results_tbw); //! \brief Generates a Plain text buffer based upon the selection on the results grid (this method does not include the column names) - static QByteArray generateTextBuffer(QTableWidget *results_tbw, int start_row, int start_col, int row_cnt, int col_cnt); + static QByteArray generateTextBuffer(QTableView *results_tbw); + + //! \brief Generates a custom text buffer. User can specify a separator for columns, include column names and quote values + static QByteArray generateBuffer(QTableView *results_tbw, QChar separator, bool incl_col_names, bool use_quotes); //! \brief Exports the results to csv file - static void exportResults(QTableWidget *results_tbw); + static void exportResults(QTableView *results_tbw); static void setMaxResultRows(int max_val); diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 5e0821246c..16305c6758 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -605,14 +605,8 @@ 0 - - - - true - - - true - + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed @@ -622,67 +616,29 @@ QAbstractItemView::ContiguousSelection - - QAbstractItemView::ScrollPerItem - - - QAbstractItemView::ScrollPerPixel - - + + true + + false - + true + + true + 25 25 - - - ... - - - - - ... - - - - - - QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - - true - - - QAbstractItemView::ContiguousSelection - - - true - - - false - - - true - - - true - - - 25 - - - From 316d7ada8a3ce758094df7a21093e6f923f2b661 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 26 Apr 2018 17:54:57 -0300 Subject: [PATCH 009/425] Removed the experimental max rows limit from SQLExecutionWidget --- conf/defaults/pgmodeler.conf | 3 +- conf/dtd/pgmodeler.dtd | 1 - conf/pgmodeler.conf | 3 +- conf/schemas/pgmodeler.sch | 4 - libparsers/src/parsersattributes.cpp | 1 - libparsers/src/parsersattributes.h | 1 - libpgmodeler_ui/src/generalconfigwidget.cpp | 13 - libpgmodeler_ui/src/sqlexecutionwidget.cpp | 18 +- libpgmodeler_ui/src/sqlexecutionwidget.h | 10 - libpgmodeler_ui/ui/datamanipulationform.ui | 7 +- libpgmodeler_ui/ui/generalconfigwidget.ui | 288 ++++++-------------- 11 files changed, 99 insertions(+), 250 deletions(-) diff --git a/conf/defaults/pgmodeler.conf b/conf/defaults/pgmodeler.conf index 0d280ddfa2..38405c783c 100644 --- a/conf/defaults/pgmodeler.conf +++ b/conf/defaults/pgmodeler.conf @@ -37,8 +37,7 @@ align-objs-to-grid="true" min-object-opacity="10" history-max-length="1000" - use-curved-lines="true" - max-result-rows="20000"/> + use-curved-lines="true"/> diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd index cdea216667..51768e16d0 100644 --- a/conf/dtd/pgmodeler.dtd +++ b/conf/dtd/pgmodeler.dtd @@ -44,7 +44,6 @@ - diff --git a/conf/pgmodeler.conf b/conf/pgmodeler.conf index 0d280ddfa2..38405c783c 100644 --- a/conf/pgmodeler.conf +++ b/conf/pgmodeler.conf @@ -37,8 +37,7 @@ align-objs-to-grid="true" min-object-opacity="10" history-max-length="1000" - use-curved-lines="true" - max-result-rows="20000"/> + use-curved-lines="true"/> diff --git a/conf/schemas/pgmodeler.sch b/conf/schemas/pgmodeler.sch index d68dd6ad17..74715d9844 100644 --- a/conf/schemas/pgmodeler.sch +++ b/conf/schemas/pgmodeler.sch @@ -48,10 +48,6 @@ $sp [setText(simple_obj_creation_chk->statusTip()); @@ -182,9 +179,6 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa use_curved_lines_ht=new HintTextWidget(use_curved_lines_hint, this); use_curved_lines_ht->setText(use_curved_lines_chk->statusTip()); - max_result_rows_ht=new HintTextWidget(max_result_rows_hint, this); - max_result_rows_ht->setText(max_result_rows_spb->statusTip()); - selectPaperSize(); QList chk_boxes=this->findChildren(); @@ -308,11 +302,6 @@ void GeneralConfigWidget::loadConfiguration(void) min_obj_opacity_spb->setValue(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MIN_OBJECT_OPACITY].toUInt()); - int value = config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MAX_RESULT_ROWS].toInt(); - max_result_rows_chk->setChecked(value > 0); - max_result_rows_spb->setEnabled(value > 0); - max_result_rows_spb->setValue(value); - margin=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_MARGIN].split(','); custom_size=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_CUSTOM_SIZE].split(','); @@ -433,7 +422,6 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MIN_OBJECT_OPACITY]=QString::number(min_obj_opacity_spb->value()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HISTORY_MAX_LENGTH]=QString::number(history_max_length_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MAX_RESULT_ROWS]=QString::number(max_result_rows_chk->isChecked() ? max_result_rows_spb->value() : 0); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); @@ -552,7 +540,6 @@ void GeneralConfigWidget::applyConfiguration(void) MainWindow::setConfirmValidation(confirm_validation_chk->isChecked()); BaseObjectView::setPlaceholderEnabled(use_placeholders_chk->isChecked()); SQLExecutionWidget::setSQLHistoryMaxLength(history_max_length_spb->value()); - SQLExecutionWidget::setMaxResultRows(max_result_rows_chk->isChecked()? max_result_rows_spb->value() : 0); fnt.setFamily(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT]); fnt.setPointSize(fnt_size); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 1cb0fdf919..19b004a8a6 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -27,7 +27,6 @@ map SQLExecutionWidget::cmd_history; int SQLExecutionWidget::cmd_history_max_len = 1000; -int SQLExecutionWidget::max_result_rows = 20000; const QString SQLExecutionWidget::COLUMN_NULL_VALUE = QString("␀"); SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) @@ -294,16 +293,13 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab for(col=0; col < col_cnt; col++) { item=results_tbw->horizontalHeaderItem(col); - item->setToolTip(res.getColumnName(col) + QString(" [%1]").arg(type_names[res.getColumnTypeId(col)])); + item->setToolTip(type_names[res.getColumnTypeId(col)]); item->setData(Qt::UserRole, type_names[res.getColumnTypeId(col)]); } if(res.accessTuple(ResultSet::FIRST_TUPLE)) { - if(max_result_rows != 0 && res.getTupleCount() > max_result_rows) - results_tbw->setRowCount(max_result_rows); - else - results_tbw->setRowCount(res.getTupleCount()); + results_tbw->setRowCount(res.getTupleCount()); do { @@ -619,16 +615,6 @@ void SQLExecutionWidget::exportResults(QTableView *results_tbw) } } -void SQLExecutionWidget::setMaxResultRows(int max_val) -{ - max_result_rows = (max_val < 0 ? 0 : max_val); -} - -int SQLExecutionWidget::getMaxResultRows(void) -{ - return(max_result_rows); -} - int SQLExecutionWidget::clearAll(void) { Messagebox msg_box; diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index 4081be8c37..9b8ff25be8 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -43,12 +43,6 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { static int cmd_history_max_len; - /*! \brief The maximum amount of rows allowed to the results grid. - * This attribute is used to limit the amount of rows inserted in any QTableWidget instance - * by fillResultsTable() in order to avoid memory exhaustion leading to crash depending on - * the amount of rows stored in a result set */ - static int max_result_rows; - SchemaParser schparser; //! \brief Syntax highlighter for sql input field @@ -130,10 +124,6 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { //! \brief Exports the results to csv file static void exportResults(QTableView *results_tbw); - static void setMaxResultRows(int max_val); - - static int getMaxResultRows(void); - public slots: void configureSnippets(void); diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index 97d2c9f515..995d5ea701 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -1456,10 +1456,13 @@ 0 - 999999 + 1000000 + + + 50 - 500 + 1000 diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index e68bad1f52..19c46a92cd 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -1011,25 +1011,10 @@ 4 - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - + + + + Souce code editor args: @@ -1163,156 +1148,30 @@ - - - - - - - 0 - 0 - - - - - 60 - 0 - - - - Maximum number of rows to be displayed in the results grid. This is used as a security measure to avoid application crash due to memory exhaustion when retrieving a huge set of data from the database without using filtering keywords like <strong>LIMIT</strong> or <strong>WHERE</strong>. - - - 5000 - - - 500000 - - - 5000 - - - 20000 - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - rows - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 25 - 20 - - - - - - - - - - - - - false - - - - - + + - + 0 0 - 0 - 0 + 22 + 22 - - SQL history max. length: - - - - - - - true - - - - - - - Souce code editor: - - - - - - - Configurations directory: + + + 22 + 22 + - - + + 0 @@ -1332,7 +1191,7 @@ - Browse the source code editor application + Open in file manager @@ -1349,10 +1208,17 @@ - - + + + + Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. + + + + + - + 0 0 @@ -1363,31 +1229,22 @@ 0 - - - 16777215 - 16777215 - + + SQL history max. length: + + + + - Open in file manager - - - - - :/icones/icones/abrir.png:/icones/icones/abrir.png - - - - 22 - 22 - + + false - + Check if there is a new version on server @@ -1400,10 +1257,20 @@ - - - - Souce code editor args: + + + + true + + + + + + + + + + false @@ -1414,30 +1281,55 @@ - - - - Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + - - - - + Browse the source code editor application + + - - false + + + :/icones/icones/abrir.png:/icones/icones/abrir.png + + + + 22 + 22 + - - + + - Limit SQL results in: + Souce code editor: - - true + + + + + + Configurations directory: From f58e6f818219392ab06170a53b005376d5b0672b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 26 Apr 2018 17:55:34 -0300 Subject: [PATCH 010/425] Fixed the import of user defined types which names contains uppercase chars (issue #1114) --- libpgmodeler_ui/src/databaseimporthelper.cpp | 4 ++-- schemas/catalog/usertype.sch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 8743cae066..a0533c8e63 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1670,8 +1670,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) { /* Building the type name prepending the schema name in order to search it on the user defined types list at PgSQLType class */ - type_name=getObjectName(types[type_oid][ParsersAttributes::SCHEMA], true); - type_name+=QString(".") + types[type_oid][ParsersAttributes::NAME]; + type_name=BaseObject::formatName(getObjectName(types[type_oid][ParsersAttributes::SCHEMA], true), false); + type_name+=QString(".") + BaseObject::formatName(types[type_oid][ParsersAttributes::NAME], false); is_type_registered=PgSQLType::isRegistered(type_name, dbmodel); } else diff --git a/schemas/catalog/usertype.sch b/schemas/catalog/usertype.sch index 155838171a..9d42805268 100644 --- a/schemas/catalog/usertype.sch +++ b/schemas/catalog/usertype.sch @@ -3,7 +3,7 @@ # Code generation can be broken if incorrect changes are made. %if {list} %then - [SELECT tp.oid, replace(tp.oid::regtype::text, ns.nspname || '.', '') AS name FROM pg_type AS tp ] + [SELECT tp.oid, replace(replace(tp.oid::regtype::text,'"', ''), ns.nspname || '.', '') FROM pg_type AS tp ] [ LEFT JOIN pg_namespace AS ns ON tp.typnamespace = ns.oid ] %if {schema} %then @@ -34,7 +34,7 @@ %else %if {attribs} %then - [SELECT tp.oid, replace(tp.oid::regtype::text, ns.nspname || '.', '') AS name, tp.typnamespace AS schema, tp.typowner AS owner, ] + [SELECT tp.oid, replace(replace(tp.oid::regtype::text,'"', ''), ns.nspname || '.', '') AS name, tp.typnamespace AS schema, tp.typowner AS owner, ] #Retrieve the OID for table/view/sequence that generates the composite type [ (SELECT From 32680f675f7f0b7f4427d044f0802da8be19cc6e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 27 Apr 2018 15:08:53 -0300 Subject: [PATCH 011/425] The validator now checks if model has columns with spatial datatype and creates the postgis extension automatically --- libpgmodeler/src/databasemodel.cpp | 5 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 48 +++++++++++++++---- libpgmodeler_ui/src/modelvalidationwidget.cpp | 15 ++++++ libpgmodeler_ui/src/objectdepsrefswidget.cpp | 2 +- libpgmodeler_ui/src/validationinfo.h | 5 +- libpgmodeler_ui/ui/modelvalidationwidget.ui | 4 +- 6 files changed, 65 insertions(+), 14 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index d2ad7fe148..898d38e564 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -8101,7 +8101,10 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector { col=tab->getColumn(i1); - if(!col->isAddedByRelationship() && col->getType()==ptr_pgsqltype) + if(!col->isAddedByRelationship() && + (col->getType()==ptr_pgsqltype || + //Special case for postgis extension + (obj_type == OBJ_EXTENSION && object->getName() == QString("postgis") && col->getType().isGiSType()))) { refer=true; refs.push_back(col); diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index f53c0ff65a..cd0d404ee9 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -46,7 +46,8 @@ ModelValidationHelper::~ModelValidationHelper(void) void ModelValidationHelper::generateValidationInfo(unsigned val_type, BaseObject *object, vector refs) { if(!refs.empty() || - (val_type==ValidationInfo::BROKEN_REL_CONFIG && + val_type==ValidationInfo::MISSING_EXTENSION || + (val_type==ValidationInfo::BROKEN_REL_CONFIG && std::find(inv_rels.begin(), inv_rels.end(), object)==inv_rels.end())) { //Configures a validation info @@ -71,7 +72,7 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) //Resolving broken references by swaping the object ids if(info.getValidationType()==ValidationInfo::BROKEN_REFERENCE || - info.getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE) + info.getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE) { BaseObject *info_obj=info.getObject(), *aux_obj=nullptr; unsigned obj_id=info_obj->getObjectId(); @@ -190,6 +191,13 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) refs.pop_back(); } } + //Resolving the absence of postgis extension + else if(info.getValidationType()==ValidationInfo::MISSING_EXTENSION && !db_model->getExtension(QString("postgis"))) + { + Extension *extension = new Extension(); + extension->setName(QString("postgis")); + db_model->addExtension(extension); + } } catch(Exception &e) { @@ -274,13 +282,14 @@ void ModelValidationHelper::validateModel(void) map > dup_objects; map >::iterator mitr; QString name, signal_msg=QString("`%1' (%2)"); + bool postgis_exists = db_model->getObjectIndex(QString("postgis"), OBJ_EXTENSION) >= 0; warn_count=error_count=progress=0; val_infos.clear(); valid_canceled=false; /* Step 1: Validating broken references. This situation happens when a object references another - whose id is smaller than the id of the first one. */ + which id is smaller than the id of the first one. */ for(i=0; i < count && !valid_canceled; i++) { obj_list=db_model->getObjectList(types[i]); @@ -508,8 +517,31 @@ void ModelValidationHelper::validateModel(void) i++; mitr++; } + // Step 3: Checking if columns of any table is using GiS data types and the postgis extension is not created. + if(!postgis_exists) + { + obj_list=db_model->getObjectList(OBJ_TABLE); + itr=obj_list->begin(); + i=0; + + while(itr!=obj_list->end() && !valid_canceled) + { + table = dynamic_cast(*itr); + itr++; + + for(auto &obj : *table->getObjectList(OBJ_COLUMN)) + { + col = dynamic_cast(obj); + + if(col->getType().isGiSType()) + generateValidationInfo(ValidationInfo::MISSING_EXTENSION, col, {}); + } - /* Step 3: Checking if there are some invalidated relationship. In some cases, specially with identifier and generalization relationships, + progress=30 + ((i/static_cast(obj_list->size()))*20); + } + } + + /* Step 4: Checking if there are some invalidated relationship. In some cases, specially with identifier and generalization relationships, the columns aren't correctly propagated due to creation order and special behavior of those objects. Thus, in order to keep all columns synchonized it is need to make this step and change the relationship creation order if needed. This step is executed only when there is no validation infos generated because for each broken relationship there is the need to do a revalidation of all relationships */ @@ -520,7 +552,7 @@ void ModelValidationHelper::validateModel(void) while(itr!=obj_list->end() && !valid_canceled) { - progress=30 + ((i/static_cast(obj_list->size()))*20); + progress=40 + ((i/static_cast(obj_list->size()))*20); if(dynamic_cast(*itr)->isInvalidated()) generateValidationInfo(ValidationInfo::BROKEN_REL_CONFIG, *itr, {}); @@ -529,7 +561,6 @@ void ModelValidationHelper::validateModel(void) } } - if(!valid_canceled && !fix_mode) { //Step 3 (optional): Validating the SQL code onto a local DBMS. @@ -575,8 +606,9 @@ void ModelValidationHelper::applyFixes(void) { if(!validate_rels) validate_rels=(val_infos[i].getValidationType()==ValidationInfo::BROKEN_REFERENCE || - val_infos[i].getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE || - val_infos[i].getValidationType()==ValidationInfo::NO_UNIQUE_NAME); + val_infos[i].getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE || + val_infos[i].getValidationType()==ValidationInfo::NO_UNIQUE_NAME || + val_infos[i].getValidationType()==ValidationInfo::MISSING_EXTENSION); /* Checking if a broken relatinship is found, when this is the case all the pending validation info will not be analyzed until no broken relationship is found */ diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 9319a73cff..9017267c01 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -266,6 +266,16 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) .arg(val_info.getObject()->getObjectId())); else if(val_info.getValidationType()==ValidationInfo::SQL_VALIDATION_ERR) label->setText(trUtf8("SQL validation failed due to error(s) below. NOTE: These errors does not invalidates the model but may affect operations like export and diff.")); + else if(val_info.getValidationType() == ValidationInfo::MISSING_EXTENSION) + { + Column *col = dynamic_cast(val_info.getObject()); + + label->setText(trUtf8("The column %1 on %2 (%3) is referencing the geospatial data type %4 but the postgis extension is not present in the model!") + .arg(col->getName()) + .arg(col->getParentTable()->getSignature(true)) + .arg(BaseObject::getTypeName(OBJ_TABLE)) + .arg(~col->getType())); + } else label->setText(val_info.getErrors().at(0)); @@ -306,6 +316,11 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) PgModelerUiNS::createOutputTreeItem(output_trw, trUtf8("HINT: try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process."), QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), item); } + else if(val_info.getValidationType()==ValidationInfo::MISSING_EXTENSION) + { + PgModelerUiNS::createOutputTreeItem(output_trw, trUtf8("HINT: Create the extension in the model or let it be created by applying the needed fixes."), + QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), item); + } else { //Listing the referrer object on output pane diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index dd9e022078..01e834b5a0 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -84,12 +84,12 @@ void ObjectDepsRefsWidget::updateObjectTables(void) objs.erase(std::find(objs.begin(), objs.end(), this->object)); ObjectFinderWidget::updateObjectTable(dependences_tbw, objs); + objs.clear(); if(!inc_ind_refs_chk->isChecked()) model->getObjectReferences(object, objs); else model->__getObjectReferences(object, objs); - objs.clear(); ObjectFinderWidget::updateObjectTable(references_tbw, objs); references_tbw->resizeColumnsToContents(); diff --git a/libpgmodeler_ui/src/validationinfo.h b/libpgmodeler_ui/src/validationinfo.h index 81773c2289..4ff4872670 100644 --- a/libpgmodeler_ui/src/validationinfo.h +++ b/libpgmodeler_ui/src/validationinfo.h @@ -50,8 +50,9 @@ class ValidationInfo { BROKEN_REFERENCE=1, SP_OBJ_BROKEN_REFERENCE=2, BROKEN_REL_CONFIG=3, - SQL_VALIDATION_ERR=4, - VALIDATION_ABORTED=5; + MISSING_EXTENSION=4, + SQL_VALIDATION_ERR=5, + VALIDATION_ABORTED=6; ValidationInfo(void); ValidationInfo(unsigned val_type, BaseObject *object, vector references); diff --git a/libpgmodeler_ui/ui/modelvalidationwidget.ui b/libpgmodeler_ui/ui/modelvalidationwidget.ui index 6530560647..fdc016a937 100644 --- a/libpgmodeler_ui/ui/modelvalidationwidget.ui +++ b/libpgmodeler_ui/ui/modelvalidationwidget.ui @@ -718,7 +718,7 @@ Try to resolve the reported issues. - Apply Fix + Apply fixes @@ -753,7 +753,7 @@ Change the creation order for two objects by swapping their ids - Swap Ids + Swap ids From d37bf2da05136186023fa716e570db8e86b30dbd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 27 Apr 2018 16:20:07 -0300 Subject: [PATCH 012/425] Fixed the catalog query for user defined types --- schemas/catalog/usertype.sch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/catalog/usertype.sch b/schemas/catalog/usertype.sch index 9d42805268..f0c8175641 100644 --- a/schemas/catalog/usertype.sch +++ b/schemas/catalog/usertype.sch @@ -3,7 +3,7 @@ # Code generation can be broken if incorrect changes are made. %if {list} %then - [SELECT tp.oid, replace(replace(tp.oid::regtype::text,'"', ''), ns.nspname || '.', '') FROM pg_type AS tp ] + [SELECT tp.oid, replace(replace(tp.oid::regtype::text,'"', ''), ns.nspname || '.', '') AS name FROM pg_type AS tp ] [ LEFT JOIN pg_namespace AS ns ON tp.typnamespace = ns.oid ] %if {schema} %then From cf4c89390f4abc17dbce4d2c1f4a3a8027dccabe Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 29 Apr 2018 10:16:02 -0300 Subject: [PATCH 013/425] Added support to source code selection by clicking and moving the mouse over the line numbers widget --- libpgmodeler_ui/src/linenumberswidget.cpp | 34 +++++++++++++++++++++++ libpgmodeler_ui/src/linenumberswidget.h | 9 +++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index 11db826fd8..d01c9371aa 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -19,14 +19,20 @@ #include "linenumberswidget.h" #include #include +#include "exception.h" QColor LineNumbersWidget::font_color=Qt::lightGray; QColor LineNumbersWidget::bg_color=Qt::black; LineNumbersWidget::LineNumbersWidget(QPlainTextEdit * parent) : QWidget(parent) { + if(!parent) + throw Exception(ERR_ASG_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + parent_edt = qobject_cast(parent); first_line=line_count=0; dy=0; + has_selection = false; } void LineNumbersWidget::drawLineNumbers(unsigned first_line, unsigned line_count, int dy) @@ -67,6 +73,34 @@ void LineNumbersWidget::paintEvent(QPaintEvent *event) } } +void LineNumbersWidget::mousePressEvent(QMouseEvent *event) +{ + if(event->buttons() == Qt::LeftButton && !has_selection) + { + QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())); + cursor.select(QTextCursor::LineUnderCursor); + parent_edt->setTextCursor(cursor); + has_selection = true; + } +} + +void LineNumbersWidget::mouseMoveEvent(QMouseEvent *event) +{ + if(event->buttons() == Qt::LeftButton && has_selection) + { + QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())), + curr_cursor = parent_edt->textCursor(); + + curr_cursor.setPosition(cursor.position(), QTextCursor::KeepAnchor); + parent_edt->setTextCursor(curr_cursor); + } +} + +void LineNumbersWidget::mouseReleaseEvent(QMouseEvent *) +{ + has_selection = false; +} + QColor LineNumbersWidget::getBackgroundColor(void) { return(LineNumbersWidget::bg_color); diff --git a/libpgmodeler_ui/src/linenumberswidget.h b/libpgmodeler_ui/src/linenumberswidget.h index ac83e76c25..76e3b39aaf 100644 --- a/libpgmodeler_ui/src/linenumberswidget.h +++ b/libpgmodeler_ui/src/linenumberswidget.h @@ -32,6 +32,10 @@ class LineNumbersWidget : public QWidget { private: Q_OBJECT + QPlainTextEdit *parent_edt; + + bool has_selection; + //! \brief The first line number that must be drawn unsigned first_line, @@ -49,9 +53,12 @@ class LineNumbersWidget : public QWidget { protected: void paintEvent(QPaintEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *); public: - explicit LineNumbersWidget(QPlainTextEdit *parent = 0); + explicit LineNumbersWidget(QPlainTextEdit *parent); /*! \brief Draw the lines starting from 'first_line' and stoping at fisrt_line + line_count -1. The dy param. defines an initial Y translation before drawn lines */ From 9d2ebe23882bad05a4c9a5746760302305cf6772 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 30 Apr 2018 16:45:46 -0300 Subject: [PATCH 014/425] Selected lines numbers are now correctly highlighted in LineNumbersWidget --- libpgmodeler_ui/src/linenumberswidget.cpp | 71 +++++++++++++++++-- libpgmodeler_ui/src/linenumberswidget.h | 5 ++ tests/src/linenumberstest/linenumberstest.cpp | 60 ++++++++++++++++ tests/src/linenumberstest/linenumberstest.pro | 3 + tests/tests.pro | 11 +-- 5 files changed, 140 insertions(+), 10 deletions(-) create mode 100644 tests/src/linenumberstest/linenumberstest.cpp create mode 100644 tests/src/linenumberstest/linenumberstest.pro diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index d01c9371aa..ef34a3e880 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -20,6 +20,7 @@ #include #include #include "exception.h" +#include QColor LineNumbersWidget::font_color=Qt::lightGray; QColor LineNumbersWidget::bg_color=Qt::black; @@ -33,6 +34,10 @@ LineNumbersWidget::LineNumbersWidget(QPlainTextEdit * parent) : QWidget(parent) first_line=line_count=0; dy=0; has_selection = false; + first_sel_line = -1; + last_sel_line = -1; + + connect(parent_edt, SIGNAL(selectionChanged()), this, SLOT(updateSelectedLineNumbers())); } void LineNumbersWidget::drawLineNumbers(unsigned first_line, unsigned line_count, int dy) @@ -57,8 +62,11 @@ void LineNumbersWidget::setColors(const QColor &font_color, const QColor &bg_col void LineNumbersWidget::paintEvent(QPaintEvent *event) { QPainter painter(this); - int y=dy, height=fontMetrics().height(); + int y = dy, height = 0; unsigned last_line=first_line + line_count; + QFont font = painter.font(); + unsigned fs_line = std::min(first_sel_line, last_sel_line), + ls_line = std::max(first_sel_line, last_sel_line); //Repaint the widget to clear previous drawn numbers painter.fillRect(event->rect(), bg_color); @@ -67,8 +75,10 @@ void LineNumbersWidget::paintEvent(QPaintEvent *event) //Draw line numbers for(unsigned lin=first_line; lin < last_line; lin++) { - painter.drawText(0, y, this->width(), fontMetrics().height(), - Qt::AlignHCenter, QString::number(lin)); + font.setBold(lin-1 >= fs_line && lin-1 <= ls_line); + height = QFontMetrics(font).height(); + painter.setFont(font); + painter.drawText(0, y, this->width(), height, Qt::AlignHCenter, QString::number(lin)); y+=height; } } @@ -78,9 +88,13 @@ void LineNumbersWidget::mousePressEvent(QMouseEvent *event) if(event->buttons() == Qt::LeftButton && !has_selection) { QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())); + + parent_edt->blockSignals(true); cursor.select(QTextCursor::LineUnderCursor); parent_edt->setTextCursor(cursor); has_selection = true; + first_sel_line = last_sel_line = cursor.blockNumber(); + this->update(); } } @@ -91,14 +105,43 @@ void LineNumbersWidget::mouseMoveEvent(QMouseEvent *event) QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())), curr_cursor = parent_edt->textCursor(); - curr_cursor.setPosition(cursor.position(), QTextCursor::KeepAnchor); - parent_edt->setTextCursor(curr_cursor); + last_sel_line = cursor.blockNumber(); + + //If the current selected line is the same as the first one (when the first click ocurred) + if(first_sel_line == cursor.blockNumber()) + { + //Forcing the selection of the whole line + cursor.movePosition(QTextCursor::StartOfLine); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + parent_edt->setTextCursor(cursor); + } + //If the user wants selects lines below the first + else if(first_sel_line < cursor.blockNumber()) + { + cursor.movePosition(QTextCursor::EndOfLine); + curr_cursor.setPosition(cursor.position(), QTextCursor::KeepAnchor); + parent_edt->setTextCursor(curr_cursor); + } + //If the user wants selects lines above the first + else + { + int pos = curr_cursor.position(); + + //We first move the cursor related to the mouse position to the start of the line + cursor.movePosition(QTextCursor::StartOfLine); + //Then we move it to the position of the current cursor (where the click occured) + cursor.setPosition(pos, QTextCursor::KeepAnchor); + parent_edt->setTextCursor(cursor); + } + + this->update(); } } void LineNumbersWidget::mouseReleaseEvent(QMouseEvent *) { has_selection = false; + parent_edt->blockSignals(false); } QColor LineNumbersWidget::getBackgroundColor(void) @@ -106,4 +149,22 @@ QColor LineNumbersWidget::getBackgroundColor(void) return(LineNumbersWidget::bg_color); } +void LineNumbersWidget::updateSelectedLineNumbers(void) +{ + QTextCursor cursor = parent_edt->textCursor(); + if(cursor.hasSelection()) + { + QTextCursor start = cursor, + end = cursor; + + start.setPosition(cursor.selectionStart()); + first_sel_line = start.blockNumber(); + end.setPosition(cursor.selectionEnd()); + last_sel_line = end.blockNumber(); + } + else + first_sel_line = last_sel_line = -1; + + this->update(); +} diff --git a/libpgmodeler_ui/src/linenumberswidget.h b/libpgmodeler_ui/src/linenumberswidget.h index 76e3b39aaf..309fa8fad5 100644 --- a/libpgmodeler_ui/src/linenumberswidget.h +++ b/libpgmodeler_ui/src/linenumberswidget.h @@ -45,6 +45,8 @@ class LineNumbersWidget : public QWidget { //! \brief The y axis increment to start drawn the line number int dy; + int first_sel_line, last_sel_line; + //! \brief Font color for drawn line numbers static QColor font_color, @@ -68,6 +70,9 @@ class LineNumbersWidget : public QWidget { static void setColors(const QColor &font_color, const QColor &bg_color); static QColor getBackgroundColor(void); + + private slots: + void updateSelectedLineNumbers(void); }; #endif diff --git a/tests/src/linenumberstest/linenumberstest.cpp b/tests/src/linenumberstest/linenumberstest.cpp new file mode 100644 index 0000000000..37aaff4e1b --- /dev/null +++ b/tests/src/linenumberstest/linenumberstest.cpp @@ -0,0 +1,60 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include +#include "numberedtexteditor.h" +#include +#include + +class LineNumbersTest: public QObject { + private: + Q_OBJECT + + private slots: + void handleLineSelectionUsingMouse(void); +}; + +void LineNumbersTest::handleLineSelectionUsingMouse(void) +{ + QDialog *dlg=new QDialog; + NumberedTextEditor *edt=new NumberedTextEditor(dlg); + QHBoxLayout *layout=new QHBoxLayout(dlg); + + LineNumbersWidget::setColors(Qt::darkGray, QColor(230,230,230)); + layout->addWidget(edt); + dlg->setMinimumSize(640,480); + + edt->setPlainText("--\n\ +-- PostgreSQL database dump\n\ +--\n\ +-- Dumped from database version 9.4.4\n\ +-- Dumped by pg_dump version 9.4.4\n\ +-- Started on 2015-07-20 19:24:52 WEST\n\ +\n\ +SET statement_timeout = 0;\n\ +SET lock_timeout = 0;\n\ +SET client_encoding = 'UTF8';\n\ +SET standard_conforming_strings = on;\n\ +SET check_function_bodies = false;\n\ +SET client_min_messages = warning;"); + + dlg->exec(); +} + +QTEST_MAIN(LineNumbersTest) +#include "linenumberstest.moc" diff --git a/tests/src/linenumberstest/linenumberstest.pro b/tests/src/linenumberstest/linenumberstest.pro new file mode 100644 index 0000000000..728f7a5aa1 --- /dev/null +++ b/tests/src/linenumberstest/linenumberstest.pro @@ -0,0 +1,3 @@ +include(../../tests.pri) +SOURCES += linenumberstest.cpp + diff --git a/tests/tests.pro b/tests/tests.pro index 6e60d5c27b..b8020f0218 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -8,9 +8,10 @@ # refactored code, containing almost all changes done by the refactoring author. TEMPLATE = subdirs SUBDIRS = src/main \ - src/baseobjecttest \ - src/roletest \ - src/syntaxhighlightertest \ - src/databasemodeltest \ - src/schemaparsertest +src/baseobjecttest \ +src/roletest \ +src/syntaxhighlightertest \ +src/databasemodeltest \ +src/schemaparsertest \ +src/linenumberstest \ From bd51e975f9544529249738d377f7eb195cf82f4e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 1 May 2018 08:23:56 -0300 Subject: [PATCH 015/425] Improved the selected lines highlighting in LineNumbersWidget --- libpgmodeler_ui/src/linenumberswidget.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index ef34a3e880..670937cae4 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -36,7 +36,6 @@ LineNumbersWidget::LineNumbersWidget(QPlainTextEdit * parent) : QWidget(parent) has_selection = false; first_sel_line = -1; last_sel_line = -1; - connect(parent_edt, SIGNAL(selectionChanged()), this, SLOT(updateSelectedLineNumbers())); } @@ -78,6 +77,17 @@ void LineNumbersWidget::paintEvent(QPaintEvent *event) font.setBold(lin-1 >= fs_line && lin-1 <= ls_line); height = QFontMetrics(font).height(); painter.setFont(font); + + if(font.bold()) + { + painter.setBrush(bg_color.dark(150)); + painter.setPen(Qt::transparent); + painter.drawRect(QRect(-1, y, this->width() + 1, height)); + painter.setPen(font_color.light(180)); + } + else + painter.setPen(font_color); + painter.drawText(0, y, this->width(), height, Qt::AlignHCenter, QString::number(lin)); y+=height; } From c4ff4fff6d8e7d2ac63b898126e13bd924038c76 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 2 May 2018 08:29:15 -0300 Subject: [PATCH 016/425] Added column names to the code completion widget used in the filter widget at DataManipulationForm --- libpgmodeler_ui/src/codecompletionwidget.cpp | 8 +++++++- libpgmodeler_ui/src/codecompletionwidget.h | 7 +++++-- libpgmodeler_ui/src/datamanipulationform.cpp | 3 +++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 5324a4f59e..737dd633a0 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -35,7 +35,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool name_list=new QListWidget(completion_wgt); name_list->setSpacing(2); name_list->setIconSize(QSize(16,16)); - name_list->setSortingEnabled(true); + name_list->setSortingEnabled(false); persistent_chk=new QCheckBox(completion_wgt); persistent_chk->setText(trUtf8("Make &persistent")); @@ -258,6 +258,12 @@ void CodeCompletionWidget::insertCustomItems(const QStringList &names, const QSt } } +void CodeCompletionWidget::insertCustomItems(const QStringList &names, const QString &tooltip, ObjectType obj_type) +{ + for(auto &name : names) + insertCustomItem(name, tooltip, QPixmap(PgModelerUiNS::getIconPath(obj_type))); +} + void CodeCompletionWidget::clearCustomItems(void) { custom_items.clear(); diff --git a/libpgmodeler_ui/src/codecompletionwidget.h b/libpgmodeler_ui/src/codecompletionwidget.h index 347104e912..d8faf7a3d5 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.h +++ b/libpgmodeler_ui/src/codecompletionwidget.h @@ -112,11 +112,14 @@ class CodeCompletionWidget: public QWidget highlighter uses an different configuration */ void configureCompletion(DatabaseModel *db_model, SyntaxHighlighter *syntax_hl=nullptr, const QString &keywords_grp=QString("keywords")); - //! \brief Inserts a custom named item on the list with a custom icon. Custom item will be always appear at the beggining of the list + //! \brief Inserts a custom named item on the list with a custom icon. Custom item will always appear at the beggining of the list void insertCustomItem(const QString &name, const QString &tooltip, const QPixmap &icon); - //! \brief Inserts several custom named item on the list with a custom icon. Custom item will be always appear at the beggining of the list + //! \brief Inserts several custom named item on the list with a custom icon. Custom item will always appear at the beggining of the list void insertCustomItems(const QStringList &names, const QStringList &tooltips, const QPixmap &icon); + +//! \brief Inserts several custom named items on the list with an icon related to the obj_type. Custom item will always appear at the beggining of the list + void insertCustomItems(const QStringList &names, const QString &tooltip, ObjectType obj_type); //! \brief Clear the custom added items void clearCustomItems(void); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 64ab8b381e..0e7394af5e 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -374,6 +374,9 @@ void DataManipulationForm::retrieveData(void) paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && table_cmb->currentData().toUInt() == OBJ_TABLE && !col_names.isEmpty()); + + code_compl_wgt->clearCustomItems(); + code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), OBJ_COLUMN); } catch(Exception &e) { From 888a2329f6aa613ea42d0c693ee187d64d7aba19 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 2 May 2018 17:47:02 -0300 Subject: [PATCH 017/425] Fixed a bug when selecting line in LineNumbersWidget from bottom to top. Fixed the tab behavior on comment box (issue #1116) --- libpgmodeler_ui/src/linenumberswidget.cpp | 53 +++++++------------ libpgmodeler_ui/src/linenumberswidget.h | 2 +- libpgmodeler_ui/ui/baseobjectwidget.ui | 3 ++ tests/src/linenumberstest/linenumberstest.cpp | 32 ++++++++++- 4 files changed, 55 insertions(+), 35 deletions(-) diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index 670937cae4..ad73c30467 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -21,6 +21,7 @@ #include #include "exception.h" #include +#include QColor LineNumbersWidget::font_color=Qt::lightGray; QColor LineNumbersWidget::bg_color=Qt::black; @@ -31,12 +32,13 @@ LineNumbersWidget::LineNumbersWidget(QPlainTextEdit * parent) : QWidget(parent) throw Exception(ERR_ASG_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); parent_edt = qobject_cast(parent); - first_line=line_count=0; + first_line=line_count=start_sel_pos=0; dy=0; has_selection = false; - first_sel_line = -1; - last_sel_line = -1; - connect(parent_edt, SIGNAL(selectionChanged()), this, SLOT(updateSelectedLineNumbers())); + start_sel_line = -1; + end_sel_line = -1; + + connect(parent_edt, SIGNAL(selectionChanged()), this, SLOT(updateSelectedLineNumbers())); } void LineNumbersWidget::drawLineNumbers(unsigned first_line, unsigned line_count, int dy) @@ -64,8 +66,8 @@ void LineNumbersWidget::paintEvent(QPaintEvent *event) int y = dy, height = 0; unsigned last_line=first_line + line_count; QFont font = painter.font(); - unsigned fs_line = std::min(first_sel_line, last_sel_line), - ls_line = std::max(first_sel_line, last_sel_line); + unsigned fs_line = std::min(start_sel_line, end_sel_line), + ls_line = std::max(start_sel_line, end_sel_line); //Repaint the widget to clear previous drawn numbers painter.fillRect(event->rect(), bg_color); @@ -99,12 +101,11 @@ void LineNumbersWidget::mousePressEvent(QMouseEvent *event) { QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())); - parent_edt->blockSignals(true); cursor.select(QTextCursor::LineUnderCursor); parent_edt->setTextCursor(cursor); has_selection = true; - first_sel_line = last_sel_line = cursor.blockNumber(); - this->update(); + start_sel_line = end_sel_line = cursor.blockNumber(); + start_sel_pos = cursor.position(); } } @@ -115,43 +116,29 @@ void LineNumbersWidget::mouseMoveEvent(QMouseEvent *event) QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())), curr_cursor = parent_edt->textCursor(); - last_sel_line = cursor.blockNumber(); + end_sel_line = cursor.blockNumber(); - //If the current selected line is the same as the first one (when the first click ocurred) - if(first_sel_line == cursor.blockNumber()) - { - //Forcing the selection of the whole line - cursor.movePosition(QTextCursor::StartOfLine); - cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); - parent_edt->setTextCursor(cursor); - } //If the user wants selects lines below the first - else if(first_sel_line < cursor.blockNumber()) + if(start_sel_line < end_sel_line) { cursor.movePosition(QTextCursor::EndOfLine); curr_cursor.setPosition(cursor.position(), QTextCursor::KeepAnchor); parent_edt->setTextCursor(curr_cursor); } //If the user wants selects lines above the first - else + else if(start_sel_line > end_sel_line) { - int pos = curr_cursor.position(); - - //We first move the cursor related to the mouse position to the start of the line - cursor.movePosition(QTextCursor::StartOfLine); - //Then we move it to the position of the current cursor (where the click occured) - cursor.setPosition(pos, QTextCursor::KeepAnchor); - parent_edt->setTextCursor(cursor); + curr_cursor.setPosition(start_sel_pos); + curr_cursor.movePosition(QTextCursor::EndOfLine); + curr_cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, curr_cursor.position() - cursor.position()); + parent_edt->setTextCursor(curr_cursor); } - - this->update(); } } void LineNumbersWidget::mouseReleaseEvent(QMouseEvent *) { has_selection = false; - parent_edt->blockSignals(false); } QColor LineNumbersWidget::getBackgroundColor(void) @@ -169,12 +156,12 @@ void LineNumbersWidget::updateSelectedLineNumbers(void) end = cursor; start.setPosition(cursor.selectionStart()); - first_sel_line = start.blockNumber(); + start_sel_line = start.blockNumber(); end.setPosition(cursor.selectionEnd()); - last_sel_line = end.blockNumber(); + end_sel_line = end.blockNumber(); } else - first_sel_line = last_sel_line = -1; + start_sel_line = end_sel_line = -1; this->update(); } diff --git a/libpgmodeler_ui/src/linenumberswidget.h b/libpgmodeler_ui/src/linenumberswidget.h index 309fa8fad5..1b6bc033da 100644 --- a/libpgmodeler_ui/src/linenumberswidget.h +++ b/libpgmodeler_ui/src/linenumberswidget.h @@ -45,7 +45,7 @@ class LineNumbersWidget : public QWidget { //! \brief The y axis increment to start drawn the line number int dy; - int first_sel_line, last_sel_line; + int start_sel_line, end_sel_line, start_sel_pos; //! \brief Font color for drawn line numbers static QColor font_color, diff --git a/libpgmodeler_ui/ui/baseobjectwidget.ui b/libpgmodeler_ui/ui/baseobjectwidget.ui index c3db5ea209..6d8136f248 100644 --- a/libpgmodeler_ui/ui/baseobjectwidget.ui +++ b/libpgmodeler_ui/ui/baseobjectwidget.ui @@ -507,6 +507,9 @@ This will disable the code of all child and referrer objects. 80 + + true + diff --git a/tests/src/linenumberstest/linenumberstest.cpp b/tests/src/linenumberstest/linenumberstest.cpp index 37aaff4e1b..8fe9823259 100644 --- a/tests/src/linenumberstest/linenumberstest.cpp +++ b/tests/src/linenumberstest/linenumberstest.cpp @@ -37,7 +37,7 @@ void LineNumbersTest::handleLineSelectionUsingMouse(void) LineNumbersWidget::setColors(Qt::darkGray, QColor(230,230,230)); layout->addWidget(edt); - dlg->setMinimumSize(640,480); + dlg->setMinimumSize(640,220); edt->setPlainText("--\n\ -- PostgreSQL database dump\n\ @@ -51,6 +51,36 @@ SET lock_timeout = 0;\n\ SET client_encoding = 'UTF8';\n\ SET standard_conforming_strings = on;\n\ SET check_function_bodies = false;\n\ +SET client_min_messages = warning;\n\ +--\n\ +-- PostgreSQL database dump\n\ +--\n\ +-- Dumped from database version 9.4.4\n\ +-- Dumped by pg_dump version 9.4.4\n\ +-- Started on 2015-07-20 19:24:52 WEST\n\ +SET statement_timeout = 0;\n\ +SET lock_timeout = 0;\n\ +SET client_encoding = 'UTF8';\n\ +SET standard_conforming_strings = on;\n\ +SET check_function_bodies = false;\n\ +SET client_min_messages = warning;\n\ +-- Dumped from database version 9.4.4\n\ +-- Dumped by pg_dump version 9.4.4\n\ +-- Started on 2015-07-20 19:24:52 WEST\n\ +SET statement_timeout = 0;\n\ +SET lock_timeout = 0;\n\ +SET client_encoding = 'UTF8';\n\ +SET standard_conforming_strings = on;\n\ +SET check_function_bodies = false;\n\ +SET client_min_messages = warning;\n\ +-- Dumped from database version 9.4.4\n\ +-- Dumped by pg_dump version 9.4.4\n\ +-- Started on 2015-07-20 19:24:52 WEST\n\ +SET statement_timeout = 0;\n\ +SET lock_timeout = 0;\n\ +SET client_encoding = 'UTF8';\n\ +SET standard_conforming_strings = on;\n\ +SET check_function_bodies = false;\n\ SET client_min_messages = warning;"); dlg->exec(); From ba2a671010ce362eceeede51ee53a56d602b63eb Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 3 May 2018 09:44:05 -0300 Subject: [PATCH 018/425] Disabled the drag & drop for items in the side listing at ConfigurationForm (issue #1117) --- libpgmodeler_ui/ui/configurationform.ui | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/ui/configurationform.ui b/libpgmodeler_ui/ui/configurationform.ui index c33ee5bf83..e2e72b0462 100644 --- a/libpgmodeler_ui/ui/configurationform.ui +++ b/libpgmodeler_ui/ui/configurationform.ui @@ -117,7 +117,7 @@ false - QAbstractItemView::DragOnly + QAbstractItemView::NoDragDrop Qt::IgnoreAction @@ -205,6 +205,9 @@ :/icones/icones/relationshiptv.png:/icones/icones/relationshiptv.png + + ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled + @@ -244,6 +247,9 @@ :/icones/icones/codesnippet.png:/icones/icones/codesnippet.png + + ItemIsSelectable|ItemIsUserCheckable|ItemIsEnabled + From 36ccf2d1393bca4dff6cc0ed8176ae86cc8b0214 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 3 May 2018 09:51:29 -0300 Subject: [PATCH 019/425] Fixed the check boxes disabling linked to identifier (issue #1118) --- libpgmodeler_ui/src/relationshipwidget.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index f96962eb41..478dd38fa2 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -157,8 +157,12 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent connect(deferrable_chk, SIGNAL(toggled(bool)), deferral_cmb, SLOT(setEnabled(bool))); connect(deferrable_chk, SIGNAL(toggled(bool)), deferral_lbl, SLOT(setEnabled(bool))); - connect(identifier_chk, SIGNAL(toggled(bool)), table1_mand_chk, SLOT(setDisabled(bool))); - connect(identifier_chk, SIGNAL(toggled(bool)), table2_mand_chk, SLOT(setDisabled(bool))); + connect(identifier_chk, &QCheckBox::toggled, [&](){ + table1_mand_chk->setDisabled(identifier_chk->isChecked()); + table2_mand_chk->setEnabled(!identifier_chk->isChecked() && + this->object && + dynamic_cast(this->object)->getRelationshipType() != BaseRelationship::RELATIONSHIP_1N); + }); connect(attributes_tab, SIGNAL(s_rowsRemoved(void)), this, SLOT(removeObjects(void))); connect(attributes_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addObject(void))); From f33ad6769017c436767f474a97b44047a1706289 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 3 May 2018 14:36:45 -0300 Subject: [PATCH 020/425] Refactored the LineNumbersWidget improving the line selection feature --- libpgmodeler_ui/src/linenumberswidget.cpp | 55 ++++++++++------------- libpgmodeler_ui/src/linenumberswidget.h | 5 +-- 2 files changed, 25 insertions(+), 35 deletions(-) diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index ad73c30467..35b564f698 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -36,9 +36,8 @@ LineNumbersWidget::LineNumbersWidget(QPlainTextEdit * parent) : QWidget(parent) dy=0; has_selection = false; start_sel_line = -1; - end_sel_line = -1; - connect(parent_edt, SIGNAL(selectionChanged()), this, SLOT(updateSelectedLineNumbers())); + connect(parent_edt, SIGNAL(selectionChanged()), this, SLOT(update())); } void LineNumbersWidget::drawLineNumbers(unsigned first_line, unsigned line_count, int dy) @@ -66,8 +65,17 @@ void LineNumbersWidget::paintEvent(QPaintEvent *event) int y = dy, height = 0; unsigned last_line=first_line + line_count; QFont font = painter.font(); - unsigned fs_line = std::min(start_sel_line, end_sel_line), - ls_line = std::max(start_sel_line, end_sel_line); + unsigned fs_line = 0, ls_line = 0; + QTextCursor cursor = parent_edt->textCursor(); + + if(cursor.hasSelection()) + { + QTextCursor start = cursor, end = cursor; + start.setPosition(cursor.selectionStart(), QTextCursor::MoveAnchor); + fs_line = start.blockNumber(); + end.setPosition(cursor.selectionEnd(), QTextCursor::KeepAnchor); + ls_line = end.blockNumber(); + } //Repaint the widget to clear previous drawn numbers painter.fillRect(event->rect(), bg_color); @@ -76,7 +84,7 @@ void LineNumbersWidget::paintEvent(QPaintEvent *event) //Draw line numbers for(unsigned lin=first_line; lin < last_line; lin++) { - font.setBold(lin-1 >= fs_line && lin-1 <= ls_line); + font.setBold(cursor.hasSelection() && lin-1 >= fs_line && lin-1 <= ls_line); height = QFontMetrics(font).height(); painter.setFont(font); @@ -101,10 +109,10 @@ void LineNumbersWidget::mousePressEvent(QMouseEvent *event) { QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())); + has_selection = true; cursor.select(QTextCursor::LineUnderCursor); parent_edt->setTextCursor(cursor); - has_selection = true; - start_sel_line = end_sel_line = cursor.blockNumber(); + start_sel_line = cursor.blockNumber(); start_sel_pos = cursor.position(); } } @@ -116,23 +124,28 @@ void LineNumbersWidget::mouseMoveEvent(QMouseEvent *event) QTextCursor cursor = parent_edt->cursorForPosition(QPoint(0, event->pos().y())), curr_cursor = parent_edt->textCursor(); - end_sel_line = cursor.blockNumber(); - //If the user wants selects lines below the first - if(start_sel_line < end_sel_line) + if(start_sel_line < cursor.blockNumber()) { cursor.movePosition(QTextCursor::EndOfLine); curr_cursor.setPosition(cursor.position(), QTextCursor::KeepAnchor); parent_edt->setTextCursor(curr_cursor); } //If the user wants selects lines above the first - else if(start_sel_line > end_sel_line) + else if(start_sel_line > cursor.blockNumber()) { curr_cursor.setPosition(start_sel_pos); curr_cursor.movePosition(QTextCursor::EndOfLine); curr_cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, curr_cursor.position() - cursor.position()); parent_edt->setTextCursor(curr_cursor); } + else + { + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + parent_edt->setTextCursor(cursor); + } + + this->update(); } } @@ -145,23 +158,3 @@ QColor LineNumbersWidget::getBackgroundColor(void) { return(LineNumbersWidget::bg_color); } - -void LineNumbersWidget::updateSelectedLineNumbers(void) -{ - QTextCursor cursor = parent_edt->textCursor(); - - if(cursor.hasSelection()) - { - QTextCursor start = cursor, - end = cursor; - - start.setPosition(cursor.selectionStart()); - start_sel_line = start.blockNumber(); - end.setPosition(cursor.selectionEnd()); - end_sel_line = end.blockNumber(); - } - else - start_sel_line = end_sel_line = -1; - - this->update(); -} diff --git a/libpgmodeler_ui/src/linenumberswidget.h b/libpgmodeler_ui/src/linenumberswidget.h index 1b6bc033da..420f63b2c6 100644 --- a/libpgmodeler_ui/src/linenumberswidget.h +++ b/libpgmodeler_ui/src/linenumberswidget.h @@ -45,7 +45,7 @@ class LineNumbersWidget : public QWidget { //! \brief The y axis increment to start drawn the line number int dy; - int start_sel_line, end_sel_line, start_sel_pos; + int start_sel_line, start_sel_pos; //! \brief Font color for drawn line numbers static QColor font_color, @@ -70,9 +70,6 @@ class LineNumbersWidget : public QWidget { static void setColors(const QColor &font_color, const QColor &bg_color); static QColor getBackgroundColor(void); - - private slots: - void updateSelectedLineNumbers(void); }; #endif From a24c03edefe7c285fd697473469e8bed4dfbc7be Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 3 May 2018 15:00:46 -0300 Subject: [PATCH 021/425] Removing unused includes --- libpgmodeler_ui/src/linenumberswidget.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index 35b564f698..eb8ffb76b6 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -20,8 +20,6 @@ #include #include #include "exception.h" -#include -#include QColor LineNumbersWidget::font_color=Qt::lightGray; QColor LineNumbersWidget::bg_color=Qt::black; From e267b6d418c635513bb3c3912102f92b7a01f71e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 4 May 2018 14:33:48 -0300 Subject: [PATCH 022/425] Minor fixes in messages in PgModelerCLI --- main-cli/src/pgmodelercli.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 7a91ff94e2..a618817666 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1383,9 +1383,10 @@ void PgModelerCLI::diffModelDatabase(void) QString res, buff, line; QTextStream in(stdin), preview; + buff += "\n** Press ENTER to scroll the preview **\n"; buff += "\n### DIFF PREVIEW ###\n\n"; buff += diff_hlp.getDiffDefinition(); - buff += "\n### END PREVIEW ###\n\n"; + buff += "\n### END OF PREVIEW ###\n\n"; preview.setString(&buff, QIODevice::ReadOnly); @@ -1406,7 +1407,7 @@ void PgModelerCLI::diffModelDatabase(void) } out << endl; - out << trUtf8("** WARNING: you are about to apply the generated SQL code to the server! Data can be lost in the process.") << endl; + out << trUtf8("** WARNING: You are about to apply the generated diff code to the server. Data can be lost in the process!") << endl; do { From 2a427a6dedddb4ab014918e42107ca26322e6528 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 7 May 2018 09:33:16 -0300 Subject: [PATCH 023/425] Updates on CHANGELOG.md and RELEASENOTES.md for 0.9.1 --- CHANGELOG.md | 47 +++++++++++++++++++++++++ RELEASENOTES.md | 93 ++++++++++++++++++++++++------------------------- 2 files changed, 92 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ac057b6c7..6e598663c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,53 @@ Change Log --------- +v0.9.1 +------ +Release date: May 14, 2018
+ +* [New] Added support to line selection by clicking and moving the mouse over the line numbers widget in any source code field. +* [New] The validator now checks if the model has columns referencing spatial data types and creates the postgis extension automatically when fixing the model. +* [New] Added support to RESTART IDENTITY on truncate tables in DatabaseExplorerWidget. +* [New] Added an custom option checkbox in Messagebox for general purpose usage. +* [New] Added support to diff operation in CLI. +* [New] Added support to import database from CLI. +* [New] Adding missing types regrole and regnamespace. +* [Change] Added column names to the code completion widget used in the filter widget at DataManipulationForm. +* [Change] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory. +* [Change] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query. +* [Change] Minor improvement in the text find widgets in SQL tool in order to make them closable via dedicated button. +* [Change] Improved the set tag operation in ModelWidget in order to cleanup the assigned tags to a set of objects. +* [Change] Minor improvement on DatabaseExplorerWidget to show the rls attributes labels correctly in the attributes grid. +* [Change] Refactored all the CLI options. +* [Change] Minor change in Connection::generateConnectionString in order to put the dbname param in the start of the string. +* [Change] Improved the performance of the row duplication action in DataManipulationForm. +* [Change] Minor improvement in order to update the schemas boxes when the tables have their extended attributes box toggled. +* [Change] Improved the performance of "Move to schema" operation. +* [Change] Added an busy cursor while closing a model. +* [Change] Improved the object selection in object finder. +* [Change] Changed the behaviour of select and fade buttons in ObjectFinderWidget in such way to enable the user to select/fade the objects in the listing (or not included in the results). +* [Fix] Fixed the check boxes disabling when dealing with identifier relationships. +* [Fix] Disabled the drag & drop for items in the side listing at ConfigurationForm. +* [Fix] Fixed the tab behavior on comment box in all editing forms of database objects. +* [Fix] Fixed the catalog query for user defined types. +* [Fix] Fixed the import of user defined types which names contains uppercase characters. +* [Fix] Minor typo fixes in CLI. +* [Fix] Fix window scaling on HiDPI/Retina screens. +* [Fix] Minor fix in Connection::getConnectionId in order to omit port when that parameter is not configured in the connection. +* [Fix] Fixed a bug in ModelExportHelper that was failing to remane the database when the command appeared. +* [Fix] Fixed a bug in CollationWidget that was referencing the collation attributes LC_??? using the wrong constant. +* [Fix] Fixed the behaviour of the message box that warns about the need of validate the model prior to export, save or diff. Now rejecting the dialog (i.e. closing it) will be considered that the user wants to proceed with the pending operation even with an invalid model. +* [Fix] Fixed the import of comments for constraints,triggers, index and rules. +* [Fix] The value input in BulkDataEditWidget will be focused as soon as the widget appears. +* [Fix] Fixed a bug in the aggregate import process. +* [Fix] Minor fix in DataManipulationForm to avoid the generation of a where clause when the filter is filled only with spaces. +* [Fix] Minor fix in the magnfier tool to use the same render hints as the canvas viewport. +* [Fix] Fixed a bug in the diff process that was trying to recreate the whole database when the "Force recreation" option was set. +* [Fix] Fixed a bug when showing the source of tables in DatabaseExplorerWidget when these objects have permissions assigned. +* [Fix] Adjusting tables position when the parent schema is moved and the alignment to grid is enabled. +* [Fix] Minor fix in the CLI menu. +* [Fix] Fixed the saving process for large models by stopping the threads related to temp models saving while the model file is being written. + v0.9.1-beta1 ------ Release date: April 6, 2018
diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3840d69f48..ca78f91910 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,50 +1,47 @@ -v0.9.1-beta1 +v0.9.1 ------ -Release date: April 6, 2018
-Changes since: v0.9.1-beta
- -Summary: finally we've reached the last beta release of the 0.9.1! This time pgModeler brings important fixes and new features requested long ago which are finally implemented in experimental stage.
- -The first new feature we have in this release is the support to multiples relationships for the same pair of tables. In previous versions, pgModeler would refuse to create a second relationship between the tables A and B. From now on, pgModeler will accept the creation of one-to-many and many-to-many relationships linking A and B more then once. For the other kinds of relationships (generalization, copy, one-to-one) the old rule is still valid: only one relationship per table pair is accepted.
- -Some missing features of PostgreSQL are present in this version too being them: row level security (RLS) and identity columns. For RLS, introduced in PostgreSQL 9.5, we have added the related options to toggle it in tables (ENABLE|FORCE RLS) as well the support to policy objects which are the main part of this new security modality. The identity columns, introduced in PostgreSQL 10, are now fully supported by pgModeler and you can make use of them from the column editing form.
- -Other new feature is the support to multiple check constraints by domains. Actually, this is more a patch than a new feature because pgModeler was unaware that domains could support more than one check constraint, so we have fixed that now.
- -Now, talking about changes, we fixed an old missinterpretation of the PostgreSQL's documentations by changing the way extensions are stored in the database model. Previously, this kind of objects were stored at schemas level but the right way to store them is at database level. So now instead of seeing extensions in the schema's subtree you'll see them in the database subtree. All validation rules, export, import and diff processes were fixed in such way to reflect the right way to treat these objects.
- -Another important change, and that one is related to an annoying behaviour of the tool, is that pgModeler will silently ignore the absence of the plugins folder and proceed with the normal startup avoiding the display of a message box regarding the missing folder and automatically disabling the plugins search mechanism.
- -In the fixes section, we've included a patch for a bug that was causing recurrent crashes on macOS when the user tried to load a second model file making almost impossible the working on two or more database models at once. Also, we've patched the reverse engineering in such way to avoid the duplication of data types related to tables, sequences and views which was causing problems in the validation process. Another fix was done in the diff process that was generating a malformed DROP command for extensions.
- -The set of changes of this release has 47 entries between new features, changes, improvements and bug fixes. Below we highlight some of them, for the complete list, please, consider reading the CHANGELOG.md.
- -* [New] Added the ability to create multiples one-to-many and many-to-many relatationships between the same pair of tables. -* [New] Added the ability to use more special ascii chars in the middle of object names. -* [New] Added support to multi line comments in UI. -* [New] Added full support to row level security (RLS), including export, import and diff of this kind of object. -* [New] Added support to bulk data editing in DataManipulationForm. -* [New] Added an option to diff process to force the generation of DROP commands for columns and constraints even if the missing objects need to be preserved. This is useful to work with partial models and the user need to remove columns/constraints and preserve the rest of objects. -* [New] Added support to identity columns (PostgreSQL 10). -* [New] Added the support to BYPASSRLS option on roles. -* [New] Added support to IS_TEMPLATE and ALLOW_CONNECTIONS options in database object. -* [New] Added the procedures to fix old style domains in CLI. -* [New] Added support to multiple check constraint in domains. -* [New] Added support to sort items alphabetically (ascending) or by oid in DatabaseExplorerWidget. -* [Change] Changed the input mode of the password field in ConnectionsConfigWidget in order to hide the passwords in the form. NOTE: the passwords are still in plain text in the config file. -* [Change] Moved extensions from schema level to database level in order to reproduce better the PostgreSQL's behavior. -* [Change] In GeneralConfigWidget when restoring default settings the default settings for syntax highlight are restored as well. -* [Change] pgModeler will not try to create the plugins path anymore. This will avoid constant error messages during startup. Now, it'll silently ignore the absence of that folder and skip the plugin loading. -* [Change] Improved the source editing in external application. The use is informed about the app running state and the contents for the source editor field are locked until the user closes the external app. -* [Fix] Fixed the query catalog for built-in types to include the types related to domains. -* [Fix] Fixed the extension creation, allowing only one instance of the named extension per database no matter the schema used to allocate its children objects. -* [Fix] Fixed a bug when dropping Functions in DatabaseExplorerWidget. -* [Fix] Fixed a bug that was causing the disabling of connections for database models created prior to 0.9.1-beta1. -* [Fix] Fixed a bug on import process that was wrongly creating types derivated from tables/sequence/views causing duplication problems during validation. -* [Fix] Fixed a crash on macOs when opening a second model. -* [Fix] Fixed an issue in diff process that was generating a malformed DROP command for extensions. -* [Fix] Fixed the diff for domains which contain multiple check constraints. -* [Fix] Fixed a bug that was not selecting the correct spatial type in the widget. -* [Fix] Fixed a conflict of shortcuts in DatabaseExplorerWidget. Now F5 updates a leaf/subtree and Alt+F5 performs quick refresh of the tree. -* [Fix] Fixed a problem with sqlexecutionwidget.ui that is not building properly in Qt 5.10. +Release date: May 14, 2018
+Changes since: v0.9.1-beta1
+ +Summary: after eight months of hard work we finally have the stable release 0.9.1. This version is a mark in the pgModeler's development and so important as the release 0.8.2 in terms of improvements because it brought features requested long ago and that will make pgModeler even better to work with, being some of them: crow's foot notation support, multiple relationships for the same table pair, support to row level security, identity columns and much more.
+ +For this release specifically (considering only the work after 0.9.1-beta1), the golden rule was to fix bugs, adjust the current features and introduce few new things and thus was done: 21 bug fixes, 14 changes/improvements and 7 new features. + +The majority of new features are related to the CLI which received the ability to import and diff databases which can make it even better to integrate to automtated deployment processess or run quick tasks over models or databases without the need to open pgModeler's GUI.
+ +Some important improvements were done in the overall performance of the SQL tool. The query execution and results display are a lot better now being quicker and less eager in terms of memory consumption avoiding crashes when querying large tables. The data manipulation also received a patch that makes the row duplication more efficient.
+ +Now, for the fixes, another patch was introduced in order to resize correctly dialogs in HiDPI/Retina displays. Several reverse engineering bugs were fixes and now databases are imported more precisely compared to previous releases. Lastly, a bug that seems to happen only on macOS while dealing with large models is finally fixed and was related to some running threads messing around with the main process avoiding it to correctly save the model and causing hang ups sometimes.
+ +The whole set of changes of this release (considering the alpha and beta stages) has 152 entries being 43 new features, 47 changes/improvements and 62 bug fixes. Below we highlight some of news for the work since 0.9.1-beta1, for the complete list of changes, please, take a look into the CHANGELOG.md.
+ +* [New] Added support to line selection by clicking and moving the mouse over the line numbers widget in any source code field. +* [New] The validator now checks if the model has columns referencing spatial data types and creates the postgis extension automatically when fixing the model. +* [New] Added support to RESTART IDENTITY on truncate tables in DatabaseExplorerWidget. +* [New] Added support to diff operation in CLI. +* [New] Added support to import database from CLI. +* [New] Adding missing types regrole and regnamespace. +* [Change] Added column names to the code completion widget used in the filter widget at DataManipulationForm. +* [Change] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory. +* [Change] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query. +* [Change] Minor improvement in the text find widgets in SQL tool in order to make them closable via dedicated button. +* [Change] Improved the set tag operation in ModelWidget in order to cleanup the assigned tags to a set of objects. +* [Change] Refactored all the CLI options. +* [Change] Improved the performance of the row duplication action in DataManipulationForm. +* [Change] Improved the performance of "Move to schema" operation. +* [Change] Changed the behaviour of select and fade buttons in ObjectFinderWidget in such way to enable the user to select/fade the objects in the listing (or not included in the results). +* [Fix] Fixed the tab behavior on comment box in all editing forms of database objects. +* [Fix] Fixed the catalog query for user defined types. +* [Fix] Fixed the import of user defined types which names contains uppercase characters. +* [Fix] Fix window scaling on HiDPI/Retina screens. +* [Fix] Fixed a bug in ModelExportHelper that was failing to remane the database when the command appeared. +* [Fix] Fixed a bug in CollationWidget that was referencing the collation attributes LC_??? using the wrong constant. +* [Fix] Fixed the behaviour of the message box that warns about the need of validate the model prior to export, save or diff. Now rejecting the dialog (i.e. closing it) will be considered that the user wants to proceed with the pending operation even with an invalid model. +* [Fix] Fixed the import of comments for constraints,triggers, index and rules. +* [Fix] Fixed a bug in the aggregate import process. +* [Fix] Minor fix in DataManipulationForm to avoid the generation of a where clause when the filter is filled only with spaces. +* [Fix] Minor fix in the magnfier tool to use the same render hints as the canvas viewport. +* [Fix] Fixed a bug in the diff process that was trying to recreate the whole database when the "Force recreation" option was set. +* [Fix] Fixed a bug when showing the source of tables in DatabaseExplorerWidget when these objects have permissions assigned. +* [Fix] Fixed the saving process for large models by stopping the threads related to temp models saving while the model file is being written. From 01374a1b636959915b4a01dc66a0eb518c93783f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 8 May 2018 11:37:49 -0300 Subject: [PATCH 024/425] Improved the object duplication/copy operation so the rules, index, triggers, and policies can be copied together with the parent object (issue #1120) --- libpgmodeler_ui/src/modelwidget.cpp | 48 ++++++++++++++++------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 24166edcf7..128f436c64 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2212,9 +2212,9 @@ void ModelWidget::copyObjects(bool duplicate_mode) vector deps; BaseObject *object=nullptr; TableObject *tab_obj=nullptr; - Table *table=nullptr; + BaseTable *table=nullptr; Constraint *constr=nullptr; - ObjectType types[]={ OBJ_TRIGGER, OBJ_INDEX, OBJ_CONSTRAINT }; + ObjectType types[]={ OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_CONSTRAINT, OBJ_POLICY }; unsigned i, type_id, count; Messagebox msg_box; @@ -2256,11 +2256,11 @@ void ModelWidget::copyObjects(bool duplicate_mode) /* Copying the special objects (which references columns added by relationship) in order to be correclty created when pasted */ - if(object->getObjectType()==OBJ_TABLE) + if(object->getObjectType()==OBJ_TABLE || object->getObjectType() == OBJ_VIEW) { - table=dynamic_cast
(object); + table=dynamic_cast(object); - for(type_id=0; type_id < 3; type_id++) + for(type_id=0; type_id < 4; type_id++) { count=table->getObjectCount(types[type_id]); @@ -2273,14 +2273,16 @@ void ModelWidget::copyObjects(bool duplicate_mode) columns added by relationship. Case the object is a constraint, it cannot be a primary key because this type of constraint is treated separetely by relationships */ if(!tab_obj->isAddedByRelationship() && - ((constr && + (!constr || + (((constr && (constr->getConstraintType()==ConstraintType::foreign_key || (constr->getConstraintType()==ConstraintType::unique && - constr->isReferRelationshipAddedColumn()))) || - (types[type_id]==OBJ_TRIGGER && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || - (types[type_id]==OBJ_INDEX && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()))) + constr->isReferRelationshipAddedColumn()))))))) deps.push_back(tab_obj); } + + if(object->getObjectType() == OBJ_VIEW && type_id >= 2) + break; } } } @@ -2376,7 +2378,7 @@ void ModelWidget::pasteObjects(void) aux_object=db_model->getObject(aux_name, obj_type); else { - if(sel_view && (obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE)) + if(sel_view && (obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE || obj_type==OBJ_INDEX)) aux_object=sel_view->getObject(aux_name, obj_type); else if(sel_table) aux_object=sel_table->getObject(aux_name, obj_type); @@ -2422,7 +2424,12 @@ void ModelWidget::pasteObjects(void) else { if(tab_obj) - tab_obj->setName(PgModelerNS::generateUniqueName(tab_obj, (*sel_table->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true)); + { + if(sel_table) + tab_obj->setName(PgModelerNS::generateUniqueName(tab_obj, (*sel_table->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true)); + else + tab_obj->setName(PgModelerNS::generateUniqueName(tab_obj, (*sel_view->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true)); + } else object->setName(PgModelerNS::generateUniqueName(object, (*db_model->getObjectList(object->getObjectType())), false, QString("_cp"), true)); @@ -2469,11 +2476,12 @@ void ModelWidget::pasteObjects(void) parent=sel_view; /* Only generates the XML for a table object when the selected receiver object - is a table or is a view and the current object is a trigger or rule (because + is a table or is a view and the current object is a trigger, index, or rule (because view's only accepts this two types) */ if(sel_table || (sel_view && (tab_obj->getObjectType()==OBJ_TRIGGER || - tab_obj->getObjectType()==OBJ_RULE))) + tab_obj->getObjectType()==OBJ_RULE || + tab_obj->getObjectType()==OBJ_INDEX))) { //Backups the original parent table orig_parent_tab=tab_obj->getParentTable(); @@ -2551,17 +2559,11 @@ void ModelWidget::pasteObjects(void) //Special case for table objects if(tab_obj) { - if(sel_table && - (tab_obj->getObjectType()==OBJ_COLUMN || tab_obj->getObjectType()==OBJ_RULE)) + if(sel_table && tab_obj->getObjectType()==OBJ_COLUMN) { sel_table->addObject(tab_obj); sel_table->setModified(true); } - else if(sel_view && tab_obj->getObjectType()==OBJ_RULE) - { - sel_view->addObject(tab_obj); - sel_view->setModified(true); - } //Updates the fk relationships if the constraint is a foreign-key if(constr && constr->getConstraintType()==ConstraintType::foreign_key) @@ -2641,7 +2643,11 @@ void ModelWidget::duplicateObject(void) table = dynamic_cast(object)->getParentTable(); PgModelerNS::copyObject(&dup_object, object, obj_type); - dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); + + if(table->getObjectType() == OBJ_TABLE) + dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); + else + dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, -1, table); table->addObject(dup_object); From 196f54a6f751df53f698ab51d8708361c6acfeb1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 8 May 2018 11:46:12 -0300 Subject: [PATCH 025/425] Additional updates on CHANGELOG.md and RELEASENOTES.md --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e598663c4..7474f1ebfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ v0.9.1 * [New] Added support to diff operation in CLI. * [New] Added support to import database from CLI. * [New] Adding missing types regrole and regnamespace. +* [Change] Improved the copy/duplicate operation in order to copy rules, index, trigger and policies together to their parents. * [Change] Added column names to the code completion widget used in the filter widget at DataManipulationForm. * [Change] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory. * [Change] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ca78f91910..4034cefe83 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -22,6 +22,7 @@ The whole set of changes of this release (considering the alpha and beta stages) * [New] Added support to diff operation in CLI. * [New] Added support to import database from CLI. * [New] Adding missing types regrole and regnamespace. +* [Change] Improved the copy/duplicate operation in order to copy rules, index, trigger and policies together to their parents. * [Change] Added column names to the code completion widget used in the filter widget at DataManipulationForm. * [Change] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory. * [Change] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query. From 79eb5247fa75ca4301320e4d22dc92db37aad36c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 9 May 2018 16:16:24 -0300 Subject: [PATCH 026/425] Minor layout adjustment on AboutWidget Minor layout adjustment on DonationWidget --- conf/ui-style.conf | 26 +- libpgmodeler_ui/src/aboutwidget.cpp | 19 +- .../src/appearanceconfigwidget.cpp | 2 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 4 +- libpgmodeler_ui/src/baseconfigwidget.h | 5 +- .../src/connectionsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 7 +- .../src/relationshipconfigwidget.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 2 +- libpgmodeler_ui/ui/aboutwidget.ui | 936 +++++------------- libpgmodeler_ui/ui/donatewidget.ui | 8 +- 11 files changed, 293 insertions(+), 720 deletions(-) diff --git a/conf/ui-style.conf b/conf/ui-style.conf index 0320e1a21a..cc481818e7 100644 --- a/conf/ui-style.conf +++ b/conf/ui-style.conf @@ -34,12 +34,14 @@ UpdateNotifierWidget > QFrame } AboutWidget > QFrame > QLabel#title_lbl, -AboutWidget > QFrame > QLabel#slogan_lbl, AboutWidget > QFrame > QLabel#about_lbl, -AboutWidget > QFrame > QLabel#pgmodeler_ver_lbl, AboutWidget > QFrame > QLabel#build_lbl, AboutWidget > QFrame > QLabel#copyright_lbl { - color: #000; + color: #000; +} + +AboutWidget > QFrame > QLabel#pgmodeler_ver_lbl { + color: #4C7DD0; } DonateWidget > QFrame > QLabel#title_lbl, @@ -436,23 +438,8 @@ QTabWidget#models_tbw > QTabBar::tab:selected { margin-top: 0px; } -/*QSplitter#h_splitter::handle { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0); -} */ - -/*QSplitter#h_splitter_opr_objs::handle { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0); - border-left: 1px solid #404040; -}*/ - -/*QSplitter#v_splitter::handle, QSplitter#v_splitter1::handle,QSplitter#v_splitter2::handle { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0); -} */ - SQLToolWidget > QWidget#bg_frame { - /*background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0);*/ - /*border-bottom: 1px solid #d0d0d0; - border-top: transparent;*/ + } /* Floating hint widget member of HintTextWidget */ @@ -471,7 +458,6 @@ HintTextWidget > QWidget HintTextWidget > QWidget > QLabel { color: #0000c0; - /*font-size: 8pt;*/ } QTabWidget#databases_tbw > QTabBar::close-button { diff --git a/libpgmodeler_ui/src/aboutwidget.cpp b/libpgmodeler_ui/src/aboutwidget.cpp index 5c36d6391d..7e01b667c3 100644 --- a/libpgmodeler_ui/src/aboutwidget.cpp +++ b/libpgmodeler_ui/src/aboutwidget.cpp @@ -31,14 +31,13 @@ AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent) drop_shadow->setBlurRadius(30); this->setGraphicsEffect(drop_shadow); - pgmodeler_ver_lbl->setText(QString("v%1").arg(GlobalAttributes::PGMODELER_VERSION)); - build_num_lbl->setText(GlobalAttributes::PGMODELER_BUILD_NUMBER); - - for(int row=0; row < contributors_tab->rowCount(); row++) - contributors_tab->item(row, 2)->setToolTip(contributors_tab->item(row, 2)->text().replace(QString("; "), QString(";\n"))); + PgModelerUiNS::configureWidgetFont(title_lbl, PgModelerUiNS::HUGE_FONT_FACTOR); + PgModelerUiNS::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNS::HUGE_FONT_FACTOR); + PgModelerUiNS::configureWidgetFont(build_lbl, PgModelerUiNS::BIG_FONT_FACTOR); + PgModelerUiNS::configureWidgetFont(build_num_lbl, PgModelerUiNS::BIG_FONT_FACTOR); - contributors_tab->sortByColumn(0, Qt::AscendingOrder); - contributors_tab->resizeColumnsToContents(); + pgmodeler_ver_lbl->setText(QString("v%1 ").arg(GlobalAttributes::PGMODELER_VERSION)); + build_num_lbl->setText(QString("%1 Qt %2").arg(GlobalAttributes::PGMODELER_BUILD_NUMBER).arg(QT_VERSION_STR)); connect(hide_tb, &QToolButton::clicked, this, [&](){ @@ -46,12 +45,6 @@ AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent) emit s_visibilityChanged(false); }); - PgModelerUiNS::configureWidgetFont(title_lbl, PgModelerUiNS::HUGE_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(slogan_lbl, PgModelerUiNS::BIG_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNS::HUGE_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(build_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(build_num_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); - float factor = BaseObjectView::getScreenDpiFactor(); this->adjustSize(); this->resize(this->minimumWidth() * factor, this->minimumHeight() * factor); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 15104d7136..6bfb5c8178 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -384,7 +384,7 @@ void AppearanceConfigWidget::restoreDefaults(void) { try { - BaseConfigWidget::restoreDefaults(GlobalAttributes::OBJECTS_STYLE_CONF); + BaseConfigWidget::restoreDefaults(GlobalAttributes::OBJECTS_STYLE_CONF, false); this->loadConfiguration(); setConfigurationChanged(true); } diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index 8a94221c0b..e211d74e14 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -99,7 +99,7 @@ void BaseConfigWidget::saveConfiguration(const QString &conf_id, map%1!").arg(bkp_filename), Messagebox::INFO_ICON); diff --git a/libpgmodeler_ui/src/baseconfigwidget.h b/libpgmodeler_ui/src/baseconfigwidget.h index 572f584f5f..9225a529ba 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.h +++ b/libpgmodeler_ui/src/baseconfigwidget.h @@ -55,8 +55,9 @@ class BaseConfigWidget: public QWidget { //! \brief Get a configuratoin key from the xml parser void getConfigurationParams(map &config_params, const vector &key_attribs); - //! \brief Restore the configuration specified by conf_in loading them from the original file (conf/defaults) - void restoreDefaults(const QString &conf_id); + /*! \brief Restore the configuration specified by conf_in loading them from the original file (conf/defaults) + * The silent parameter indicates that the restoration should not emit a message box informing the restoration sucess */ + void restoreDefaults(const QString &conf_id, bool silent); //! \brief Adds a parameter to the specified configuration parameters set static void addConfigurationParam(map &config_params, const QString ¶m, const attribs_map &attribs); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 6af970c210..6a764e5dda 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -451,7 +451,7 @@ void ConnectionsConfigWidget::restoreDefaults(void) try { //Restore the default connection config file - BaseConfigWidget::restoreDefaults(GlobalAttributes::CONNECTIONS_CONF); + BaseConfigWidget::restoreDefaults(GlobalAttributes::CONNECTIONS_CONF, false); //Remove all connections while(connections_cmb->count() > 0) diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 162a0765fb..b9dada0f9d 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -557,9 +557,10 @@ void GeneralConfigWidget::restoreDefaults(void) { try { - BaseConfigWidget::restoreDefaults(GlobalAttributes::GENERAL_CONF); - BaseConfigWidget::restoreDefaults(GlobalAttributes::XML_HIGHLIGHT_CONF); - BaseConfigWidget::restoreDefaults(GlobalAttributes::SQL_HIGHLIGHT_CONF); + BaseConfigWidget::restoreDefaults(GlobalAttributes::GENERAL_CONF, false); + BaseConfigWidget::restoreDefaults(GlobalAttributes::XML_HIGHLIGHT_CONF, true); + BaseConfigWidget::restoreDefaults(GlobalAttributes::SQL_HIGHLIGHT_CONF, true); + BaseConfigWidget::restoreDefaults(GlobalAttributes::UI_STYLE_CONF, true); this->loadConfiguration(); this->applyConfiguration(); setConfigurationChanged(true); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 8703e73d1e..e869133b14 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -191,7 +191,7 @@ void RelationshipConfigWidget::restoreDefaults(void) { try { - BaseConfigWidget::restoreDefaults(GlobalAttributes::RELATIONSHIPS_CONF); + BaseConfigWidget::restoreDefaults(GlobalAttributes::RELATIONSHIPS_CONF, false); this->loadConfiguration(); setConfigurationChanged(true); } diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index c270999116..67d02a78f7 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -484,7 +484,7 @@ void SnippetsConfigWidget::restoreDefaults(void) { try { - BaseConfigWidget::restoreDefaults(GlobalAttributes::SNIPPETS_CONF); + BaseConfigWidget::restoreDefaults(GlobalAttributes::SNIPPETS_CONF, false); this->loadConfiguration(); setConfigurationChanged(true); } diff --git a/libpgmodeler_ui/ui/aboutwidget.ui b/libpgmodeler_ui/ui/aboutwidget.ui index 2fdb9dcc26..5df306c8fd 100644 --- a/libpgmodeler_ui/ui/aboutwidget.ui +++ b/libpgmodeler_ui/ui/aboutwidget.ui @@ -9,8 +9,8 @@ 0 0 - 575 - 550 + 550 + 530 @@ -21,14 +21,14 @@ - 575 - 550 + 550 + 530 16777215 - 600 + 550 @@ -68,7 +68,7 @@ QFrame::Raised - + 6 @@ -81,32 +81,7 @@ 6 - - 6 - - - - - - 0 - 0 - - - - - 75 - true - - - - PostgreSQL Database Modeler - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - + @@ -116,14 +91,14 @@ - 100 - 100 + 50 + 50 - 100 - 100 + 50 + 50 @@ -137,190 +112,32 @@ - - - - - 0 - 0 - - - - - 0 - 0 - - - - - false - - - - QFrame::NoFrame - - - Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. - - - Qt::PlainText - - - Qt::AlignJustify|Qt::AlignTop - - - true - - - 0 - - - Qt::TextSelectableByMouse - - - - - - - - 0 - 0 - - - - - 230 - 0 - - - - - 16777215 - 16777215 - - - - - true - - - - Design, configure, deploy - - - - - - - - - - 0 - 0 - - - - <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" text-decoration: underline; color:#2980b9;">https://pgmodeler.io</span></a></p></body></html> - - - Qt::RichText - - - 5 - - - true - - - - - - - pgModeler is proudly a brazilian software! - - - - - - - - - :/imagens/imagens/brazil_flag.png - - - Qt::AlignHCenter|Qt::AlignTop - - - + + - - - - 0 - 0 - - - - <html><head/><body><p>Copyright 2006-2016 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.io</span></a>&gt;</p></body></html> + + + Qt::Horizontal - - Qt::AutoText - - - 5 - - - true + + + 40 + 20 + - + - - - - - - - 20 - 20 - - - - - 20 - 20 - - - - Hide this widget - - - ... - - - - :/icones/icones/fechar1.png:/icones/icones/fechar1.png - - - true - - - - - - - 6 - - + - + 0 0 - 60 + 0 0 @@ -337,19 +154,15 @@ true + + + - 0.0.0.0 + 0.0.0 - - - - - - 6 - - + @@ -368,20 +181,17 @@ Qt::LeftToRight - Build: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + build: -1 - + - + 0 0 @@ -436,482 +246,258 @@ -1 + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + PostgreSQL Database Modeler + + + Qt::AlignCenter + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + - - - - - 0 - 0 - - + + - 0 - 0 + 20 + 20 - - 0 + + + 20 + 20 + + + + Hide this widget + + + ... + + + + :/icones/icones/fechar1.png:/icones/icones/fechar1.png + + + true - - - License - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - Droid Sans Tamil - - - - QFrame::Sunken - - - QAbstractScrollArea::AdjustToContents - - - false - - - QTextEdit::WidgetWidth - - - true - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Droid Sans Tamil'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier';">pgModeler - PostgreSQL Database Modeler<br />Copyright 2006-2016 - Raphael Araújo e Silva<br /><br />This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3.<br /><br />This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<br /><br />The complete text of GPLv3 is at LICENSE file on pgModeler's source code root directory. Also, you can get the complete GNU General Public License at &lt;</span><a href="http://www.gnu.org/licenses"><span style=" font-family:'Courier'; text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses</span></a><span style=" font-family:'Courier';">&gt;</span></p></body></html> - - - false - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - - - - - - Contributors - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - false - - - - QFrame::NoFrame - - - <html><head/><body><p>This page is dedicated to all contributors who gave a bit of their time in make pgModeler a better software somehow. The complete list of people that helped pgModeler can be found at <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>If you have a great idea to improve pgModeler please submit it <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">here</span></a>. No ideas for now but want to help? Why not donate a few bucks <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">here</span></a>!?</p></body></html> - - - Qt::RichText - - - Qt::AlignJustify|Qt::AlignTop - - - true - - - 0 - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse - - - - - - - - 0 - 0 - - - - Qt::ScrollBarAsNeeded - - - Qt::ScrollBarAsNeeded - - - QAbstractItemView::NoEditTriggers - - - false - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectItems - - - QAbstractItemView::ScrollPerItem - - - true - - - false - - - true - - - true - - - false - - - true - - - false - - - false - - - false - - - - 1 - - - - - 2 - - - - - 3 - - - - - 4 - - - - - 5 - - - - - 6 - - - - - 7 - - - - - 8 - - - - - 9 - - - - - 10 - - - - - Name - - - - - Country - - - - - Contribution - - - - - Damien Degois - - - - - France - - - - :/icones/icones/flag_france.png:/icones/icones/flag_france.png - - - - - French UI translation and several improvements in auxiliary scripts. - - - - - Ji Bin - - - - - China - - - - :/icones/icones/flag_china.png:/icones/icones/flag_china.png - - - - - Chinese UI translation and small fixes. - - - - - Pierre-Samuel LE STANG - - - - - France - - - - :/icones/icones/flag_france.png:/icones/icones/flag_france.png - - - - - French UI translation. - - - - - Lisandro Damián Nicanor - - - - - Argentina - - - - :/icones/icones/flag_argentina.png:/icones/icones/flag_argentina.png - - - - - Improvements on build scripts enabling the custom packaging in Linux distros; Per-user settings; pgModeler's package maintainer in Debian Linux. - - - - - Pavel Alexeev - - - - - Russia - - - - :/icones/icones/flag_russia.png:/icones/icones/flag_russia.png - - - - - Additional work for packaging in Linux distros; pgModeler's package maintainer in Fedora Linux. - - - - - Mariusz Fik - - - - - Poland - - - - :/icones/icones/flag_poland.png:/icones/icones/flag_poland.png - - - - - Custom packaging first ideas. Tester of first version of custom packaging patch. - - - - - Jonathan DUPRE - - - - - France - - - - :/icones/icones/flag_france.png:/icones/icones/flag_france.png - - - - - French UI translation. - - - - - Gilberto Castillo - - - - - Cuba - - - - :/icones/icones/flag_cuba.png:/icones/icones/flag_cuba.png - - - - - Spanish UI translation. - - - - - -Danúbio Viana Nogueira - - - - - Brazil - - - - :/imagens/imagens/brazil_flag.png:/imagens/imagens/brazil_flag.png - - - - - Brazilian Portuguese UI translation. - - - - - Alfredo Marcillo - - - - - Ecuador - - - - :/icones/icones/flag_ecuador.png:/icones/icones/flag_ecuador.png - - - - - Spanish UI translation review. - - - - - - - + Qt::Vertical - QSizePolicy::Expanding + QSizePolicy::Fixed 20 - 10 + 20 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + false + + + + QFrame::NoFrame + + + Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. + + + Qt::PlainText + + + Qt::AlignJustify|Qt::AlignTop + + + true + + + 0 + + + Qt::TextSelectableByMouse + + + + + + + License + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + QFrame::Sunken + + + QAbstractScrollArea::AdjustToContents + + + false + + + QTextEdit::WidgetWidth + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier';">pgModeler - PostgreSQL Database Modeler<br />Copyright 2006-2018 - Raphael Araújo e Silva<br /><br />This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3.<br /><br />This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.<br /><br />The complete text of GPLv3 is at LICENSE file on pgModeler's source code root directory. Also, you can get the complete GNU General Public License at &lt;</span><a href="http://www.gnu.org/licenses"><span style=" font-family:'Courier'; text-decoration: underline; color:#0000ff;">http://www.gnu.org/licenses</span></a><span style=" font-family:'Courier';">&gt;</span></p></body></html> + + + false + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + + 0 + 0 + + + + <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" text-decoration: underline; color:#2980b9;">https://pgmodeler.io</span></a></p></body></html> + + + Qt::RichText + + + 5 + + + true + + + + + + + pgModeler is proudly a brazilian software! + + + + + + + + + :/imagens/imagens/brazil_flag.png + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + + + 0 + 0 + + + + <html><head/><body><p>Copyright 2006-2018 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.io</span></a>&gt;</p></body></html> + + + Qt::AutoText + + + 5 + + + true + + + + + diff --git a/libpgmodeler_ui/ui/donatewidget.ui b/libpgmodeler_ui/ui/donatewidget.ui index d150e9660d..82b6988a59 100644 --- a/libpgmodeler_ui/ui/donatewidget.ui +++ b/libpgmodeler_ui/ui/donatewidget.ui @@ -166,6 +166,12 @@ + + + 0 + 0 + + 0 @@ -203,7 +209,7 @@ - 40 + 118 20 From 10721157fefe0534330469a5c20386d724ac5619 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 11 May 2018 14:24:11 -0300 Subject: [PATCH 027/425] Fixed a bug when import identity columns in certain cases when the identity column was followed by another column which datatype was not accepted for identity, e.g, text after smallint (issue #1123) --- libpgmodeler_ui/src/databaseimporthelper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index a0533c8e63..3030f94852 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1695,6 +1695,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], OBJ_DOMAIN); } + col.setIdentityType(BaseType::null); col.setType(PgSQLType::parseString(type_name)); col.setNotNull(!itr->second[ParsersAttributes::NOT_NULL].isEmpty()); col.setComment(itr->second[ParsersAttributes::COMMENT]); From db432407c6e051823cc0c4f1f956061900c66808 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 11 May 2018 14:24:31 -0300 Subject: [PATCH 028/425] Minor typo fixes in dbmodel.sch --- schemas/sql/dbmodel.sch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/schemas/sql/dbmodel.sch b/schemas/sql/dbmodel.sch index 722d21f128..4642eecdb9 100644 --- a/schemas/sql/dbmodel.sch +++ b/schemas/sql/dbmodel.sch @@ -25,14 +25,14 @@ $br $br %if {role} %then {role} %end %if {tablespace} %then - [-- Tablespaces creation must be done outside an multicommand file.] $br - [-- These commands were put in this file only for convenience.] $br + [-- Tablespaces creation must be done outside a multicommand file.] $br + [-- These commands were put in this file only as a convenience.] $br {tablespace} $br %end $br - [-- Database creation must be done outside an multicommand file.] $br - [-- These commands were put in this file only for convenience.] $br + [-- Database creation must be done outside a multicommand file.] $br + [-- These commands were put in this file only as a convenience.] $br {database} $br %end From 046925b6da35ec35e1d27cd1a14a0d41d1588cfa Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 11 May 2018 14:32:35 -0300 Subject: [PATCH 029/425] Additional updates for CHANGELOG.md and RELEASENOTES.md --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7474f1ebfb..005b7d7ba2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ v0.9.1 * [Change] Added an busy cursor while closing a model. * [Change] Improved the object selection in object finder. * [Change] Changed the behaviour of select and fade buttons in ObjectFinderWidget in such way to enable the user to select/fade the objects in the listing (or not included in the results). +* [Fix] Fixed a bug when import identity columns in certain cases when the identity column was followed by another column which data type was not accepted for identity, e.g, text after smallint. * [Fix] Fixed the check boxes disabling when dealing with identifier relationships. * [Fix] Disabled the drag & drop for items in the side listing at ConfigurationForm. * [Fix] Fixed the tab behavior on comment box in all editing forms of database objects. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4034cefe83..f77074d8b2 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -32,6 +32,7 @@ The whole set of changes of this release (considering the alpha and beta stages) * [Change] Improved the performance of the row duplication action in DataManipulationForm. * [Change] Improved the performance of "Move to schema" operation. * [Change] Changed the behaviour of select and fade buttons in ObjectFinderWidget in such way to enable the user to select/fade the objects in the listing (or not included in the results). +* [Fix] Fixed a bug when import identity columns in certain cases when the identity column was followed by another column which data type was not accepted for identity, e.g, text after smallint. * [Fix] Fixed the tab behavior on comment box in all editing forms of database objects. * [Fix] Fixed the catalog query for user defined types. * [Fix] Fixed the import of user defined types which names contains uppercase characters. From 77df97b917a2a651de0cb146fbc3e9460e9be164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20Ara=C3=BAjo=20e=20Silva?= Date: Mon, 14 May 2018 17:44:13 -0300 Subject: [PATCH 030/425] Update issue templates --- .github/ISSUE_TEMPLATE/Bug_report.md | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/Bug_report.md diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md new file mode 100644 index 0000000000..4de26c77d9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -0,0 +1,35 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. From 888fdb3dd408661b9350723f04b64dcf52235ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20Ara=C3=BAjo=20e=20Silva?= Date: Mon, 14 May 2018 17:52:15 -0300 Subject: [PATCH 031/425] Update issue templates --- .github/ISSUE_TEMPLATE/Bug_report.md | 43 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 4de26c77d9..212fe179f8 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -1,35 +1,34 @@ --- name: Bug report -about: Create a report to help us improve +about: Instructions on how to report pgModeler bugs --- -**Describe the bug** -A clear and concise description of what the bug is. +**Bug description** +_A clear and concise description of what the bug is._ -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error +**How to reproduce** +_Please, if the bug can be reproduceable describe the steps in full details_ **Expected behavior** -A clear and concise description of what you expected to happen. +_A clear and concise description of what you expected to happen._ **Screenshots** -If applicable, add screenshots to help explain your problem. +_If applicable, add screenshots to help explain your problem._ -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] +**Info about your desktop** + - OS: + - Version: + - Window manager: + - pgModeler version: + - Qt version: -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] +**Stacktrace** +_If pgModeler crashed after the bug raised attach the stacktrace below_ -**Additional context** -Add any other context about the problem here. +``` + Put the stacktrace here! +``` + +**Additional info** +_Add any other information that you may find useful to help in the problem solving._ From 77940269358b9791e1dd27a7b8ece3eaaad018fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20Ara=C3=BAjo=20e=20Silva?= Date: Mon, 14 May 2018 17:54:49 -0300 Subject: [PATCH 032/425] Update issue templates --- .github/ISSUE_TEMPLATE/Bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 212fe179f8..1ec4465fc7 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -8,7 +8,7 @@ about: Instructions on how to report pgModeler bugs _A clear and concise description of what the bug is._ **How to reproduce** -_Please, if the bug can be reproduceable describe the steps in full details_ +_Please, if the bug can be reproduceable describe the steps in full details. If possible provide a sample model and/or a SQL dump for test purposes._ **Expected behavior** _A clear and concise description of what you expected to happen._ From 288b8642c3dd3580ddae7b2606fdf4c3c29a8af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20Ara=C3=BAjo=20e=20Silva?= Date: Mon, 14 May 2018 17:58:42 -0300 Subject: [PATCH 033/425] Update issue templates --- .github/ISSUE_TEMPLATE/Bug_report.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 1ec4465fc7..682c7ce7d2 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -1,6 +1,8 @@ --- -name: Bug report -about: Instructions on how to report pgModeler bugs +name: Report a bug +about: Instructions on how to report pgModeler bugs. Before report any bug please + check if someone already has submited issues similiar to yours. Duplicated issues + will be ignored. --- From f466930cc1d1b94af3e352c883a8416b8c56c214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20Ara=C3=BAjo=20e=20Silva?= Date: Tue, 15 May 2018 09:48:52 -0300 Subject: [PATCH 034/425] Update issue templates --- .github/ISSUE_TEMPLATE/Bug_report.md | 4 +++- .github/ISSUE_TEMPLATE/Custom.md | 8 ++++++++ .github/ISSUE_TEMPLATE/Feature_request.md | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/Custom.md create mode 100644 .github/ISSUE_TEMPLATE/Feature_request.md diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 682c7ce7d2..4d054a0f2e 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -25,11 +25,13 @@ _If applicable, add screenshots to help explain your problem._ - pgModeler version: - Qt version: -**Stacktrace** +**Stacktrace / Debug info** _If pgModeler crashed after the bug raised attach the stacktrace below_ ``` + Put the stacktrace here! + ``` **Additional info** diff --git a/.github/ISSUE_TEMPLATE/Custom.md b/.github/ISSUE_TEMPLATE/Custom.md new file mode 100644 index 0000000000..219c04f5c1 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Custom.md @@ -0,0 +1,8 @@ +--- +name: General discussion +about: For any discussion not related to bugs or feature requests please use this + one. + +--- + + diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md new file mode 100644 index 0000000000..f3ad5eb15b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -0,0 +1,14 @@ +--- +name: Feature request / improvement +about: Give your suggestions for improvements to this project. + +--- + +**Feature description** +_A clear and concise description of what the problem is._ + +**Sample image** +_If the feature requested is a visual improvement, please, attach some images to make it clear._ + +**Additional info** +_Add any other context or screenshots about the feature request here._ From 436585153f372bdcdd01fbbf33faee5af0c5d424 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 17 May 2018 11:09:26 -0300 Subject: [PATCH 035/425] Minor fix schema file sql/table.sch --- schemas/sql/table.sch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/schemas/sql/table.sch b/schemas/sql/table.sch index dcbdfd89c4..fe953bf77f 100644 --- a/schemas/sql/table.sch +++ b/schemas/sql/table.sch @@ -33,12 +33,15 @@ %if %not {constr-sql-disabled} %and {constraints} %then [,] $br %end %end + + %if {inh-columns} %then + $br {inh-columns} + %end - %if {inh-columns} %then {inh-columns} %end - - %if {constraints} %then + %if {constraints} %then {constraints} %end + %end $br ) From a4b12c224850b37d7dd8416383faf388b4ea0e73 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 21 May 2018 10:06:38 -0300 Subject: [PATCH 036/425] Version upgrade 0.9.1 -> 0.9.2-alpha --- libutils/src/globalattributes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index 7410b5116f..db98c9f3e7 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -25,7 +25,7 @@ namespace GlobalAttributes { PGMODELER_APP_NAME=QString("pgmodeler"), PGMODELER_URI=QString("pgmodeler.io"), PGMODELER_REVERSE_URI=QString("io.pgmodeler"), - PGMODELER_VERSION=QString("0.9.1"), + PGMODELER_VERSION=QString("0.9.2-alpha"), PGMODELER_BUILD_NUMBER=QString(BUILDNUM), PGMODELER_SITE=QString("https://pgmodeler.io"), PGMODELER_SUPPORT=QString("https://github.com/pgmodeler/pgmodeler/issues"), From 0a135e99d1bb1c580806bd6dd210f984b126ed1b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 21 May 2018 10:07:22 -0300 Subject: [PATCH 037/425] Moved the bulkDataEdit from DataManipulationForm to PgModelerUiNS in order to make it usable by other classes Added bulk data edit in TableDataWidget --- libpgmodeler_ui/src/datamanipulationform.cpp | 30 +- libpgmodeler_ui/src/datamanipulationform.h | 3 - libpgmodeler_ui/src/modelwidget.cpp | 43 +- libpgmodeler_ui/src/modelwidget.h | 5 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 30 ++ libpgmodeler_ui/src/pgmodeleruins.h | 4 + libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 - libpgmodeler_ui/src/tabledatawidget.cpp | 7 + libpgmodeler_ui/ui/tabledatawidget.ui | 398 ++++++++++--------- 9 files changed, 294 insertions(+), 228 deletions(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 0e7394af5e..273b32b6d3 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -116,12 +116,15 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): connect(duplicate_tb, SIGNAL(clicked()), this, SLOT(duplicateRows())); connect(undo_tb, SIGNAL(clicked()), this, SLOT(undoOperations())); connect(save_tb, SIGNAL(clicked()), this, SLOT(saveChanges())); - connect(bulkedit_tb, SIGNAL(clicked()), this, SLOT(bulkDataEdit())); connect(ord_columns_lst, SIGNAL(currentRowChanged(int)), this, SLOT(enableColumnControlButtons())); connect(move_down_tb, SIGNAL(clicked()), this, SLOT(swapColumns())); connect(move_up_tb, SIGNAL(clicked()), this, SLOT(swapColumns())); connect(filter_tb, SIGNAL(toggled(bool)), v_splitter, SLOT(setVisible(bool))); + connect(bulkedit_tb, &QToolButton::clicked, [&](){ + PgModelerUiNS::bulkDataEdit(results_tbw); + }); + connect(filter_tb, &QToolButton::toggled, [&](bool checked){ @@ -1127,31 +1130,6 @@ void DataManipulationForm::browseReferrerTable(void) browseTable(qobject_cast(sender())->data().toString(), true); } -void DataManipulationForm::bulkDataEdit(void) -{ - BaseForm base_frm; - BulkDataEditWidget *bulkedit_wgt = new BulkDataEditWidget; - - base_frm.setMainWidget(bulkedit_wgt); - base_frm.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); - - if(base_frm.exec() == QDialog::Accepted) - { - QList sel_ranges=results_tbw->selectedRanges(); - - for(auto range : sel_ranges) - { - for(int row = range.topRow(); row <= range.bottomRow(); row++) - { - for(int col = range.leftColumn(); col <= range.rightColumn(); col++) - { - results_tbw->item(row, col)->setText(bulkedit_wgt->value_edt->toPlainText()); - } - } - } - } -} - void DataManipulationForm::browseReferencedTable(void) { browseTable(qobject_cast(sender())->data().toString(), false); diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 30f91b75ec..1e4f6d89fc 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -176,9 +176,6 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { //! brief Browse the referencing table data using the selected row in the results grid void browseReferrerTable(void); - - //! brief Changes the values of the grid selection at once - void bulkDataEdit(void); }; #endif diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 128f436c64..be56457884 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -56,6 +56,7 @@ #include "swapobjectsidswidget.h" #include "genericsqlwidget.h" #include "policywidget.h" +#include "tabledatawidget.h" vector ModelWidget::copied_objects; vector ModelWidget::cutted_objects; @@ -209,6 +210,8 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) zoom_info_lbl->setVisible(false); zoom_info_timer.setInterval(3000); + action_edit_data=new QAction(QIcon(PgModelerUiNS::getIconPath("editdata")), trUtf8("Edit data"), this); + action_source_code=new QAction(QIcon(PgModelerUiNS::getIconPath("codigosql")), trUtf8("Source"), this); action_source_code->setShortcut(QKeySequence(trUtf8("Alt+S"))); action_source_code->setToolTip(trUtf8("Show object source code")); @@ -223,11 +226,11 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) action_remove=new QAction(QIcon(PgModelerUiNS::getIconPath("excluir")), trUtf8("Delete"), this); action_remove->setShortcut(QKeySequence(trUtf8("Del"))); - action_remove->setMenuRole(QAction::NoRole); + action_remove->setMenuRole(QAction::NoRole); action_cascade_del=new QAction(QIcon(PgModelerUiNS::getIconPath("delcascade")), trUtf8("Del. cascade"), this); action_cascade_del->setShortcut(QKeySequence(trUtf8("Shift+Del"))); - action_cascade_del->setMenuRole(QAction::NoRole); + action_cascade_del->setMenuRole(QAction::NoRole); action_select_all=new QAction(QIcon(PgModelerUiNS::getIconPath("seltodos")), trUtf8("Select all"), this); action_select_all->setToolTip(trUtf8("Selects all the graphical objects in the model")); @@ -237,15 +240,15 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) action_copy=new QAction(QIcon(PgModelerUiNS::getIconPath("copiar")), trUtf8("Copy"), this); action_copy->setShortcut(QKeySequence(trUtf8("Ctrl+C"))); - action_copy->setMenuRole(QAction::NoRole); + action_copy->setMenuRole(QAction::NoRole); action_paste=new QAction(QIcon(PgModelerUiNS::getIconPath("colar")), trUtf8("Paste"), this); action_paste->setShortcut(QKeySequence(trUtf8("Ctrl+V"))); - action_paste->setMenuRole(QAction::NoRole); + action_paste->setMenuRole(QAction::NoRole); action_cut=new QAction(QIcon(PgModelerUiNS::getIconPath("recortar")), trUtf8("Cut"), this); action_cut->setShortcut(QKeySequence(trUtf8("Ctrl+X"))); - action_cut->setMenuRole(QAction::NoRole); + action_cut->setMenuRole(QAction::NoRole); action_deps_refs=new QAction(QIcon(PgModelerUiNS::getIconPath("depsrefs")), trUtf8("Deps && Referrers"), this); @@ -293,7 +296,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) action_duplicate=new QAction(QIcon(PgModelerUiNS::getIconPath("duplicate")), trUtf8("Duplicate"), this); action_duplicate->setShortcut(QKeySequence(trUtf8("Ctrl+D"))); - action_duplicate->setMenuRole(QAction::NoRole); + action_duplicate->setMenuRole(QAction::NoRole); action_extended_attribs=new QAction(QIcon(PgModelerUiNS::getIconPath("toggleattribs")), trUtf8("Extended attributes"), this); action_show_ext_attribs=new QAction(trUtf8("Show"), this); @@ -409,6 +412,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(action, SIGNAL(triggered(bool)), this, SLOT(selectAllObjects())); } + connect(action_edit_data, SIGNAL(triggered(bool)), this, SLOT(editTableData())); connect(&zoom_info_timer, SIGNAL(timeout()), zoom_info_lbl, SLOT(hide())); connect(action_source_code, SIGNAL(triggered(bool)), this, SLOT(showSourceCode(void))); connect(action_edit, SIGNAL(triggered(bool)),this,SLOT(editObject(void))); @@ -433,24 +437,18 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(action_remove_rel_points, SIGNAL(triggered(bool)), this, SLOT(removeRelationshipPoints(void))); connect(action_enable_sql, SIGNAL(triggered(bool)), this, SLOT(toggleObjectSQL(void))); connect(action_disable_sql, SIGNAL(triggered(bool)), this, SLOT(toggleObjectSQL(void))); - connect(action_remove, &QAction::triggered, [&](){ removeObjects(false); }); connect(action_cascade_del, &QAction::triggered, [&](){ removeObjects(true); }); - connect(action_fade_in, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); connect(action_fade_out, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); connect(action_fade_rels_in, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); connect(action_fade_rels_out, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); - connect(action_show_ext_attribs, SIGNAL(triggered(bool)), this, SLOT(toggleExtendedAttributes())); connect(action_hide_ext_attribs, SIGNAL(triggered(bool)), this, SLOT(toggleExtendedAttributes())); - connect(action_show_schemas_rects, SIGNAL(triggered(bool)), this, SLOT(toggleSchemasRectangles())); connect(action_hide_schemas_rects, SIGNAL(triggered(bool)), this, SLOT(toggleSchemasRectangles())); - connect(db_model, SIGNAL(s_objectAdded(BaseObject*)), this, SLOT(handleObjectAddition(BaseObject *))); connect(db_model, SIGNAL(s_objectRemoved(BaseObject*)), this, SLOT(handleObjectRemoval(BaseObject *))); - connect(scene, SIGNAL(s_objectsMoved(bool)), this, SLOT(handleObjectsMovement(bool))); connect(scene, SIGNAL(s_objectModified(BaseGraphicObject*)), this, SLOT(handleObjectModification(BaseGraphicObject*))); connect(scene, SIGNAL(s_objectDoubleClicked(BaseGraphicObject*)), this, SLOT(handleObjectDoubleClick(BaseGraphicObject*))); @@ -458,9 +456,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(scene, SIGNAL(s_popupMenuRequested(void)), this, SLOT(showObjectMenu(void))); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(configureObjectSelection(void))); connect(scene, SIGNAL(s_objectsSelectedInRange(void)), this, SLOT(configureObjectSelection(void))); - connect(scene, &ObjectsScene::s_extAttributesToggled, [&](){ modified = true; }); - connect(scene, SIGNAL(s_popupMenuRequested(BaseObject*)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_popupMenuRequested(void)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), new_obj_overlay_wgt, SLOT(hide())); @@ -3218,14 +3214,15 @@ void ModelWidget::configureSubmenu(BaseObject *object) if(tab_or_view) quick_actions_menu.addAction(action_set_tag); - //Display the "Edit permissions" action a single object is selected and it accepts permissions if(object && Permission::objectAcceptsPermission(obj_type)) { quick_actions_menu.addAction(action_edit_perms); action_edit_perms->setData(QVariant::fromValue(object)); } - //Display the "Edit permissions" action a single object is selected and it accepts permissions + if(object && obj_type == OBJ_TABLE) + quick_actions_menu.addAction(action_edit_data); + if(object && BaseObject::acceptsCustomSQL(obj_type)) { action_append_sql->setData(QVariant::fromValue(object)); @@ -4377,6 +4374,20 @@ void ModelWidget::jumpToTable(void) viewport->centerOn(tab_view); } +void ModelWidget::editTableData(void) +{ + BaseForm base_form(this); + TableDataWidget *tab_data_wgt=new TableDataWidget(this); + + tab_data_wgt->setAttributes(db_model, dynamic_cast
(selected_objects.at(0))); + base_form.setMainWidget(tab_data_wgt); + base_form.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + base_form.exec(); + + this->setModified(true); + emit s_objectManipulated(); +} + void ModelWidget::rearrangeTablesHierarchically(void) { vector objects; diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index 375ff61fc5..a2fd4b48a0 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -243,7 +243,8 @@ class ModelWidget: public QWidget { *action_jump_to_table, *action_schemas_rects, *action_show_schemas_rects, - *action_hide_schemas_rects; + *action_hide_schemas_rects, + *action_edit_data; //! \brief Actions used to create new objects on the model map actions_new_objects; @@ -476,6 +477,8 @@ class ModelWidget: public QWidget { void jumpToTable(void); + void editTableData(void); + public slots: void loadModel(const QString &filename); void saveModel(const QString &filename); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index b03c296c79..15730cb3c8 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -5,6 +5,8 @@ #include "numberedtexteditor.h" #include #include +#include "baseform.h" +#include "bulkdataeditwidget.h" namespace PgModelerUiNS { @@ -321,4 +323,32 @@ namespace PgModelerUiNS { widget->setMinimumSize(widget->minimumSize()); widget->resize(curr_w, curr_h); } + + void bulkDataEdit(QTableWidget *results_tbw) + { + if(!results_tbw) + return; + + BaseForm base_frm; + BulkDataEditWidget *bulkedit_wgt = new BulkDataEditWidget; + + base_frm.setMainWidget(bulkedit_wgt); + base_frm.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + + if(base_frm.exec() == QDialog::Accepted) + { + QList sel_ranges=results_tbw->selectedRanges(); + + for(auto range : sel_ranges) + { + for(int row = range.topRow(); row <= range.bottomRow(); row++) + { + for(int col = range.leftColumn(); col <= range.rightColumn(); col++) + { + results_tbw->item(row, col)->setText(bulkedit_wgt->value_edt->toPlainText()); + } + } + } + } + } } diff --git a/libpgmodeler_ui/src/pgmodeleruins.h b/libpgmodeler_ui/src/pgmodeleruins.h index 523b738e0b..9cba39927a 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.h +++ b/libpgmodeler_ui/src/pgmodeleruins.h @@ -27,6 +27,7 @@ #include #include +#include #include #include "baseobject.h" #include "numberedtexteditor.h" @@ -77,6 +78,9 @@ namespace PgModelerUiNS { //! \brief Resizes the provided dialog considering font dpi changes as well screen size extern void resizeDialog(QDialog *dialog); + + //! brief Changes the values of the grid selection at once + extern void bulkDataEdit(QTableWidget *results_tbw); } #endif diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 19b004a8a6..32d41a13e4 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -710,7 +710,6 @@ void SQLExecutionWidget::copySelection(QTableView *results_tbw, bool use_popup, if(selection && (!use_popup || (use_popup && QApplication::mouseButtons()==Qt::RightButton))) { - QModelIndexList sel_indexes = selection->selectedIndexes(); QMenu copy_menu, copy_mode_menu; QAction *act = nullptr, *act_csv = nullptr, *act_txt = nullptr; @@ -725,7 +724,6 @@ void SQLExecutionWidget::copySelection(QTableView *results_tbw, bool use_popup, if(!use_popup || act) { - //QTableWidgetSelectionRange selection=sel_ranges.at(0); QByteArray buf; if((use_popup && act == act_csv) || (!use_popup && csv_is_default)) diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 74bb0add73..a41b07e72f 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -18,6 +18,7 @@ #include "tabledatawidget.h" #include "htmlitemdelegate.h" +#include "bulkdataeditwidget.h" const QString TableDataWidget::PLACEHOLDER_COLUMN=QString("$placeholder$"); @@ -73,6 +74,11 @@ TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, BASE connect(csv_load_wgt, &CsvLoadWidget::s_csvFileLoaded, [&](){ populateDataGrid(csv_load_wgt->getCsvBuffer(Table::DATA_SEPARATOR, Table::DATA_LINE_BREAK)); }); + + connect(bulkedit_tb, &QToolButton::clicked, [&](){ + PgModelerUiNS::bulkDataEdit(data_tbw); + }); + } void TableDataWidget::insertRowOnTabPress(int curr_row, int curr_col, int prev_row, int prev_col) @@ -262,6 +268,7 @@ void TableDataWidget::enableButtons(void) add_row_tb->setEnabled(data_tbw->columnCount() > 0); del_cols_tb->setEnabled(rows_selected); dup_rows_tb->setEnabled(cols_selected); + bulkedit_tb->setEnabled(!sel_ranges.isEmpty()); } void TableDataWidget::setAttributes(DatabaseModel *model, Table *table) diff --git a/libpgmodeler_ui/ui/tabledatawidget.ui b/libpgmodeler_ui/ui/tabledatawidget.ui index 8760d88775..7dff03a6b1 100644 --- a/libpgmodeler_ui/ui/tabledatawidget.ui +++ b/libpgmodeler_ui/ui/tabledatawidget.ui @@ -26,7 +26,160 @@ 0 - + + + + true + + + + 0 + 0 + + + + QAbstractScrollArea::AdjustToContents + + + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked + + + QAbstractItemView::NoDragDrop + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectItems + + + QAbstractItemView::ScrollPerPixel + + + false + + + 0 + + + 0 + + + true + + + 25 + + + false + + + true + + + false + + + 25 + + + 25 + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + 24 + 24 + + + + + 24 + 24 + + + + + + + Qt::AutoText + + + :/icones/icones/msgbox_alerta.png + + + true + + + + + + + + 0 + 0 + + + + + 50 + false + false + false + true + + + + Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. + + + true + + + + + + + @@ -36,6 +189,22 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 2 + 20 + + + + @@ -68,8 +237,8 @@ - - + + Qt::Horizontal @@ -116,23 +285,7 @@ - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 2 - 20 - - - - - + false @@ -177,71 +330,7 @@ - - - - true - - - - 0 - 0 - - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked - - - QAbstractItemView::NoDragDrop - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectItems - - - QAbstractItemView::ScrollPerPixel - - - false - - - 0 - - - 0 - - - true - - - 25 - - - false - - - true - - - false - - - 25 - - - 25 - - - - + Qt::Horizontal @@ -257,7 +346,20 @@ - + + + + Qt::Horizontal + + + + 203 + 20 + + + + + true @@ -292,20 +394,7 @@ - - - - Qt::Horizontal - - - - 203 - 20 - - - - - + false @@ -433,7 +522,7 @@ - + @@ -522,93 +611,41 @@ - - - - - 0 - 0 - + + + + false 0 - 30 + 0 - - QFrame::StyledPanel + + + 8 + - - QFrame::Raised + + Change the values of all selected cells at once + + + + :/icones/icones/bulkedit.png:/icones/icones/bulkedit.png + + + + 22 + 22 + + + + Ctrl+E + + + Qt::ToolButtonIconOnly - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - 24 - 24 - - - - - 24 - 24 - - - - - - - Qt::AutoText - - - :/icones/icones/msgbox_alerta.png - - - true - - - - - - - - 0 - 0 - - - - - 50 - false - false - false - true - - - - Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. - - - true - - - - @@ -624,6 +661,7 @@ csv_load_tb csv_load_parent warn_frm + bulkedit_tb From 7b70032227e7f5ac817de1b97f2eb0d36d19ebac Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 21 May 2018 17:13:45 -0300 Subject: [PATCH 038/425] Added the ability to paste CSV text from clipboard into the TableDataWidget --- libpgmodeler_ui/src/csvloadwidget.cpp | 27 +- libpgmodeler_ui/src/csvloadwidget.h | 9 + libpgmodeler_ui/src/datamanipulationform.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 8 +- libpgmodeler_ui/src/tabledatawidget.cpp | 54 ++- libpgmodeler_ui/src/tabledatawidget.h | 4 + libpgmodeler_ui/ui/tabledatawidget.ui | 453 +++++++++++-------- 7 files changed, 363 insertions(+), 194 deletions(-) diff --git a/libpgmodeler_ui/src/csvloadwidget.cpp b/libpgmodeler_ui/src/csvloadwidget.cpp index 28f794e1a8..164ed909df 100644 --- a/libpgmodeler_ui/src/csvloadwidget.cpp +++ b/libpgmodeler_ui/src/csvloadwidget.cpp @@ -147,11 +147,7 @@ void CsvLoadWidget::loadCsvFile(void) if(!csv_buffer.isEmpty()) { - QString separator; - QStringList separators={ QString(";"), QString(","), QString(" "), QString("\t") }; - separators += (separator_edt->text().isEmpty() ? QString(";") : separator_edt->text()); - separator = separators[separator_cmb->currentIndex()]; - csv_rows = loadCsvFromBuffer(csv_buffer, separator, + csv_rows = loadCsvFromBuffer(csv_buffer, getSeparator(), txt_delim_chk->isChecked() ? txt_delim_edt->text() : QString(), col_names_chk->isChecked(), csv_columns); } @@ -160,6 +156,13 @@ void CsvLoadWidget::loadCsvFile(void) emit s_csvFileLoaded(); } +QString CsvLoadWidget::getSeparator(void) +{ + QStringList separators={ QString(";"), QString(","), QString(" "), QString("\t") }; + separators += (separator_edt->text().isEmpty() ? QString(";") : separator_edt->text()); + return(separators[separator_cmb->currentIndex()]); +} + QString CsvLoadWidget::getCsvBuffer(QString separator, QString line_break) { QString buffer; @@ -185,3 +188,17 @@ bool CsvLoadWidget::isColumnsInFirstRow(void) { return(col_names_chk->isChecked()); } + +void CsvLoadWidget::loadCsvBuffer(const QString csv_buffer, const QString &separator, const QString &text_delim, bool cols_in_first_row) +{ + csv_columns.clear(); + csv_rows.clear(); + csv_rows = loadCsvFromBuffer(csv_buffer, separator, text_delim, cols_in_first_row, csv_columns); +} + +void CsvLoadWidget::loadCsvBuffer(const QString csv_buffer) +{ + loadCsvBuffer(csv_buffer, getSeparator(), + txt_delim_chk->isChecked() ? txt_delim_edt->text() : QString(), + col_names_chk->isChecked()); +} diff --git a/libpgmodeler_ui/src/csvloadwidget.h b/libpgmodeler_ui/src/csvloadwidget.h index be030eb609..ec5f875858 100644 --- a/libpgmodeler_ui/src/csvloadwidget.h +++ b/libpgmodeler_ui/src/csvloadwidget.h @@ -55,6 +55,15 @@ class CsvLoadWidget : public QWidget, Ui::CsvLoadWidget { bool isColumnsInFirstRow(void); + /*! \brief Loads a csv document from a buffer and stores the result in the internal csv_columns and csv_rows attributes for later usage. + * The separator and text delimiter chars can be specified overriding the ones configured in the widget */ + void loadCsvBuffer(const QString csv_buffer, const QString &separator, const QString &text_delim, bool cols_in_first_row); + + //! \brief Loads a csv document from a buffer and stores the result in the internal csv_columns and csv_rows attributes for later usage. + void loadCsvBuffer(const QString csv_buffer); + + QString getSeparator(void); + /*! \brief Loads a csv document from a buffer. The user can specify the value separator, text delimiter and an object which will store the column names. * In that case, the column names are only extracted from the first row if the cols_in_first_row is true */ static QList loadCsvFromBuffer(const QString &csv_buffer, const QString &separator, const QString &text_delim, bool cols_in_first_row, QStringList &csv_cols); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 273b32b6d3..12fbeacbb1 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -167,7 +167,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): act = item_menu.addAction(delete_tb->icon(), trUtf8("Delete row(s)"), this, SLOT(markDeleteOnRows()), delete_tb->shortcut()); act->setEnabled(delete_tb->isEnabled()); - act = item_menu.addAction(bulkedit_tb->icon(), trUtf8("Edit cell(s)"), this, SLOT(bulkDataEdit()), bulkedit_tb->shortcut()); + act = item_menu.addAction(bulkedit_tb->icon(), trUtf8("Edit cell(s)"), bulkedit_tb, SLOT(click()), bulkedit_tb->shortcut()); act->setEnabled(bulkedit_tb->isEnabled()); } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index be56457884..c259e05cfa 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -4376,14 +4376,10 @@ void ModelWidget::jumpToTable(void) void ModelWidget::editTableData(void) { - BaseForm base_form(this); - TableDataWidget *tab_data_wgt=new TableDataWidget(this); + TableDataWidget *tab_data_wgt=new TableDataWidget; tab_data_wgt->setAttributes(db_model, dynamic_cast
(selected_objects.at(0))); - base_form.setMainWidget(tab_data_wgt); - base_form.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); - base_form.exec(); - + openEditingForm(tab_data_wgt); this->setModified(true); emit s_objectManipulated(); } diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index a41b07e72f..fdae8177b6 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -19,6 +19,7 @@ #include "tabledatawidget.h" #include "htmlitemdelegate.h" #include "bulkdataeditwidget.h" +#include "sqlexecutionwidget.h" const QString TableDataWidget::PLACEHOLDER_COLUMN=QString("$placeholder$"); @@ -75,10 +76,49 @@ TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, BASE populateDataGrid(csv_load_wgt->getCsvBuffer(Table::DATA_SEPARATOR, Table::DATA_LINE_BREAK)); }); + connect(paste_tb, &QToolButton::clicked, [&](){ + csv_load_wgt->loadCsvBuffer(qApp->clipboard()->text(), QString(";"), QString("\""), true); + populateDataGrid(csv_load_wgt->getCsvBuffer(Table::DATA_SEPARATOR, Table::DATA_LINE_BREAK)); + qApp->clipboard()->clear(); + paste_tb->setEnabled(false); + }); + connect(bulkedit_tb, &QToolButton::clicked, [&](){ PgModelerUiNS::bulkDataEdit(data_tbw); }); + connect(copy_tb, &QToolButton::clicked, [&](){ + SQLExecutionWidget::copySelection(data_tbw, false, true); + paste_tb->setEnabled(true); + }); + + connect(data_tbw, &QTableWidget::itemPressed, + [&](){ + if(QApplication::mouseButtons()==Qt::RightButton) + { + QMenu item_menu; + QAction *act = nullptr; + QList btns = { add_row_tb, add_col_tb, dup_rows_tb, nullptr, + del_rows_tb, del_cols_tb, nullptr, + clear_rows_tb, clear_cols_tb, nullptr, + copy_tb, paste_tb }; + + for(auto &btn : btns) + { + if(!btn) + { + item_menu.addSeparator(); + continue; + } + + act = item_menu.addAction(btn->icon(), btn->text(), btn, SLOT(click()), btn->shortcut()); + act->setEnabled(btn->isEnabled()); + act->setMenu(btn->menu()); + } + + item_menu.exec(QCursor::pos()); + } + }); } void TableDataWidget::insertRowOnTabPress(int curr_row, int curr_col, int prev_row, int prev_col) @@ -269,6 +309,7 @@ void TableDataWidget::enableButtons(void) del_cols_tb->setEnabled(rows_selected); dup_rows_tb->setEnabled(cols_selected); bulkedit_tb->setEnabled(!sel_ranges.isEmpty()); + copy_tb->setEnabled(!sel_ranges.isEmpty()); } void TableDataWidget::setAttributes(DatabaseModel *model, Table *table) @@ -302,14 +343,13 @@ void TableDataWidget::populateDataGrid(const QString &data) else ini_data=table->getInitialData(); - /* If the initial data buffer is preset the columns there have priority over the current table's columns */ if(!ini_data.isEmpty()) { buffer=ini_data.split(Table::DATA_LINE_BREAK); - //The first line of the buffer always have the column names + //The first line of the buffer always has the column names if(!buffer.isEmpty() && !buffer[0].isEmpty()) columns.append(buffer[0].split(Table::DATA_SEPARATOR)); } @@ -471,6 +511,16 @@ QString TableDataWidget::generateDataBuffer(void) return(buffer.join(Table::DATA_LINE_BREAK)); } +void TableDataWidget::enterEvent(QEvent *) +{ + paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty()); +} + +void TableDataWidget::showEvent(QShowEvent *) +{ + paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty()); +} + void TableDataWidget::addRow(void) { int row=data_tbw->rowCount(); diff --git a/libpgmodeler_ui/src/tabledatawidget.h b/libpgmodeler_ui/src/tabledatawidget.h index 564eeb9b36..f82a91ce66 100644 --- a/libpgmodeler_ui/src/tabledatawidget.h +++ b/libpgmodeler_ui/src/tabledatawidget.h @@ -54,6 +54,10 @@ class TableDataWidget: public BaseObjectWidget, public Ui::TableDataWidget { //! brief Generated the CSV-like buffer to be used as initial data in the table object QString generateDataBuffer(void); + void showEvent(QShowEvent *); + + void enterEvent(QEvent *); + public: static const QString PLACEHOLDER_COLUMN; diff --git a/libpgmodeler_ui/ui/tabledatawidget.ui b/libpgmodeler_ui/ui/tabledatawidget.ui index 7dff03a6b1..33f0863902 100644 --- a/libpgmodeler_ui/ui/tabledatawidget.ui +++ b/libpgmodeler_ui/ui/tabledatawidget.ui @@ -6,7 +6,7 @@ 0 0 - 666 + 658 412 @@ -26,7 +26,7 @@ 0 - + true @@ -90,7 +90,195 @@ - + + + + false + + + + 0 + 0 + + + + + 8 + + + + Copy items on the grid + + + Copy + + + + :/icones/icones/copiar.png:/icones/icones/copiar.png + + + + 22 + 22 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + + + + + true + + + + 0 + 0 + + + + Add empty rows + + + Add row + + + + :/icones/icones/addrow.png:/icones/icones/addrow.png + + + + 22 + 22 + + + + Ins + + + Qt::ToolButtonIconOnly + + + + + + + false + + + + 0 + 0 + + + + Delete the selected columns + + + Delete column + + + + :/icones/icones/delcol.png:/icones/icones/delcol.png + + + + 22 + 22 + + + + Del + + + Qt::ToolButtonIconOnly + + + + + + + false + + + + 0 + 0 + + + + + 8 + + + + Paste items on the grid + + + Paste + + + + :/icones/icones/colar.png:/icones/icones/colar.png + + + + 22 + 22 + + + + Ctrl+V + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + + + + + true + + + + 0 + 0 + + + + Fills the grid using a CSV file + + + + :/icones/icones/loadcsv.png:/icones/icones/loadcsv.png + + + + 22 + 22 + + + + + + + true + + + Qt::ToolButtonIconOnly + + + + @@ -179,34 +367,8 @@ - - - - - 0 - 0 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 2 - 20 - - - - - - + true @@ -217,11 +379,14 @@ - Add empty rows + Add an empty column + + + Add column - :/icones/icones/addrow.png:/icones/icones/addrow.png + :/icones/icones/addcol.png:/icones/icones/addcol.png @@ -229,34 +394,18 @@ 22 - - Ins + + QToolButton::InstantPopup Qt::ToolButtonIconOnly - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 2 - 20 - - - - - - + + - true + false @@ -265,11 +414,14 @@ - Add an empty column + Duplicate the selected rows + + + Duplicate rows - :/icones/icones/addcol.png:/icones/icones/addcol.png + :/icones/icones/duprow.png:/icones/icones/duprow.png @@ -277,16 +429,29 @@ 22 - - QToolButton::InstantPopup + + Ctrl+D Qt::ToolButtonIconOnly - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + false @@ -296,12 +461,20 @@ 0 + + + 8 + + - Remove all rows from the grid preserving columns + Change the values of all selected cells at once + + + Bulk data edit - :/icones/icones/delrows.png:/icones/icones/delrows.png + :/icones/icones/bulkedit.png:/icones/icones/bulkedit.png @@ -310,7 +483,7 @@ - Shift+Del + Ctrl+E Qt::ToolButtonIconOnly @@ -330,8 +503,8 @@ - - + + Qt::Horizontal @@ -340,61 +513,23 @@ - 2 + 10 20 - - - - Qt::Horizontal - - - - 203 - 20 - - - - - - - - true - + + 0 0 - - Fills the grid using a CSV file - - - - :/icones/icones/loadcsv.png:/icones/icones/loadcsv.png - - - - 22 - 22 - - - - - - - true - - - Qt::ToolButtonIconOnly - - + false @@ -408,6 +543,9 @@ Remove all columns (and rows) from the grid + + Delete all columns + :/icones/icones/delcols.png:/icones/icones/delcols.png @@ -426,70 +564,6 @@ - - - - false - - - - 0 - 0 - - - - Duplicate the selected rows - - - - :/icones/icones/duprow.png:/icones/icones/duprow.png - - - - 22 - 22 - - - - Ctrl+D - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - Delete the selected columns - - - - :/icones/icones/delcol.png:/icones/icones/delcol.png - - - - 22 - 22 - - - - Del - - - Qt::ToolButtonIconOnly - - - @@ -504,6 +578,9 @@ Delete the selected rows + + Delete rows + :/icones/icones/delrow.png:/icones/icones/delrow.png @@ -522,7 +599,7 @@ - + @@ -612,7 +689,7 @@ - + false @@ -622,17 +699,15 @@ 0 - - - 8 - - - Change the values of all selected cells at once + Remove all rows from the grid preserving columns + + + Delete all rows - :/icones/icones/bulkedit.png:/icones/icones/bulkedit.png + :/icones/icones/delrows.png:/icones/icones/delrows.png @@ -641,13 +716,29 @@ - Ctrl+E + Shift+Del Qt::ToolButtonIconOnly + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + clear_rows_tb hint_frm @@ -662,6 +753,8 @@ csv_load_parent warn_frm bulkedit_tb + copy_tb + paste_tb From caaee2b8e5378b3ad1936e0eeb16467f8370eaef Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 21 May 2018 17:19:59 -0300 Subject: [PATCH 039/425] Minor typo in TableDataWidget --- libpgmodeler_ui/ui/csvloadwidget.ui | 2 +- libpgmodeler_ui/ui/tabledatawidget.ui | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/ui/csvloadwidget.ui b/libpgmodeler_ui/ui/csvloadwidget.ui index 51a614e1d9..c32cb6d6b5 100644 --- a/libpgmodeler_ui/ui/csvloadwidget.ui +++ b/libpgmodeler_ui/ui/csvloadwidget.ui @@ -6,7 +6,7 @@ 0 0 - 729 + 710 100 diff --git a/libpgmodeler_ui/ui/tabledatawidget.ui b/libpgmodeler_ui/ui/tabledatawidget.ui index 33f0863902..338096de71 100644 --- a/libpgmodeler_ui/ui/tabledatawidget.ui +++ b/libpgmodeler_ui/ui/tabledatawidget.ui @@ -357,7 +357,7 @@ - Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. + <html><head/><body><p>Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <span style=" font-weight:600;">INSERT</span> commands.</p></body></html> true From 1bc744365f7f02af36b295f29993ec98e6ed3f16 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 22 May 2018 13:45:25 -0300 Subject: [PATCH 040/425] Fix a crash when importing CSV files into DataManipulationForm --- libpgmodeler_ui/src/datamanipulationform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 12fbeacbb1..7081948534 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -536,7 +536,7 @@ void DataManipulationForm::loadDataFromCsv(bool load_from_clipboard) addRow(); row_id=results_tbw->rowCount() - 1; - for(int i = 0; i < values.count(); i++) + for(int i = 0; i < values.count() && i < cols.count(); i++) { if((!load_from_clipboard && csv_load_wgt->isColumnsInFirstRow()) || (load_from_clipboard && !cols.isEmpty())) From feb2e92ca11b19de51047a5301a1117244e24daa Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 27 May 2018 14:17:03 -0300 Subject: [PATCH 041/425] Added support to sequence options for identity columns (issue #1132) --- libparsers/src/parsersattributes.cpp | 1 + libparsers/src/parsersattributes.h | 1 + libpgmodeler/src/column.cpp | 120 ++++++++++++++++++- libpgmodeler/src/column.h | 29 +++++ libpgmodeler/src/databasemodel.cpp | 2 + libpgmodeler/src/sequence.cpp | 52 ++++---- libpgmodeler/src/sequence.h | 2 +- libpgmodeler_ui/src/columnwidget.cpp | 49 +++++++- libpgmodeler_ui/src/columnwidget.h | 2 + libpgmodeler_ui/src/databaseimporthelper.cpp | 4 + libpgmodeler_ui/src/sequencewidget.cpp | 65 +++++++++- libpgmodeler_ui/src/sequencewidget.h | 14 ++- libpgmodeler_ui/src/tablewidget.cpp | 5 +- libpgmodeler_ui/ui/baseobjectwidget.ui | 10 +- libpgmodeler_ui/ui/columnwidget.ui | 77 ++++++++---- libpgmodeler_ui/ui/sequencewidget.ui | 58 +++++---- schemas/alter/column.sch | 42 +++++++ schemas/sql/column.sch | 33 +++++ schemas/xml/column.sch | 10 +- schemas/xml/dtd/column.dtd | 6 + schemas/xml/sequence.sch | 45 ++++--- 21 files changed, 518 insertions(+), 109 deletions(-) diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 3a3068e96d..4801c12cbe 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -124,6 +124,7 @@ namespace ParsersAttributes { CROWS_FOOT=QString("crows-foot"), CTE_EXPRESSION=QString("cte-exp"), CUR_VERSION=QString("cur-version"), + CUR_IDENTITY_TYPE=QString("cur-identity-type"), CUSTOM_COLOR=QString("custom-color"), CUSTOM_FILTER=QString("custom-filter"), CUSTOMIDXS=QString("customidxs"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index c58b148a6f..75ca8c4f50 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -139,6 +139,7 @@ namespace ParsersAttributes { CROWS_FOOT, CTE_EXPRESSION, CUR_VERSION, + CUR_IDENTITY_TYPE, CUSTOM_COLOR, CUSTOM_FILTER, CUSTOMIDXS, diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index dc2a7defe2..d85ff2e35c 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -21,7 +21,7 @@ Column::Column(void) { obj_type=OBJ_COLUMN; - not_null=false; + not_null=seq_cycle=false; attributes[ParsersAttributes::TYPE]=QString(); attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); attributes[ParsersAttributes::NOT_NULL]=QString(); @@ -29,6 +29,13 @@ Column::Column(void) attributes[ParsersAttributes::SEQUENCE]=QString(); attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); attributes[ParsersAttributes::IDENTITY_TYPE]=QString(); + attributes[ParsersAttributes::INCREMENT]=QString(); + attributes[ParsersAttributes::MIN_VALUE]=QString(); + attributes[ParsersAttributes::MAX_VALUE]=QString(); + attributes[ParsersAttributes::START]=QString(); + attributes[ParsersAttributes::CACHE]=QString(); + attributes[ParsersAttributes::CYCLE]=QString(); + parent_rel=sequence=nullptr; identity_type=BaseType::null; } @@ -185,6 +192,46 @@ BaseObject *Column::getSequence(void) return(sequence); } +bool Column::isIdSeqCycle(void) +{ + return(seq_cycle); +} + +QString Column::getIdSeqMaxValue(void) +{ + return(seq_max_value); +} + +QString Column::getIdSeqMinValue(void) +{ + return(seq_min_value); +} + +QString Column::getIdSeqIncrement(void) +{ + return(seq_increment); +} + +QString Column::getIdSeqStart(void) +{ + return(seq_start); +} + +QString Column::getIdSeqCache(void) +{ + return(seq_cache); +} + +void Column::setIdSeqAttributes(QString minv, QString maxv, QString inc, QString start, QString cache, bool cycle) +{ + seq_min_value = minv; + seq_max_value = maxv; + seq_increment = inc; + seq_start = start; + seq_cache = cache; + seq_cycle = cycle; +} + QString Column::getCodeDefinition(unsigned def_type) { QString code_def=getCachedCode(def_type, false); @@ -198,7 +245,15 @@ QString Column::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::IDENTITY_TYPE]=QString(); if(identity_type != BaseType::null) - attributes[ParsersAttributes::IDENTITY_TYPE] = ~identity_type; + { + attributes[ParsersAttributes::IDENTITY_TYPE] = ~identity_type; + attributes[ParsersAttributes::INCREMENT]=seq_increment; + attributes[ParsersAttributes::MIN_VALUE]=seq_min_value; + attributes[ParsersAttributes::MAX_VALUE]=seq_max_value; + attributes[ParsersAttributes::START]=seq_start; + attributes[ParsersAttributes::CACHE]=seq_cache; + attributes[ParsersAttributes::CYCLE]=(seq_cycle ? ParsersAttributes::_TRUE_ : QString()); + } else { if(!sequence) @@ -207,7 +262,7 @@ QString Column::getCodeDefinition(unsigned def_type) { //Configuring the default value of the column to get the next value of the sequence if(def_type==SchemaParser::SQL_DEFINITION) - attributes[ParsersAttributes::DEFAULT_VALUE]=QString("nextval('%1'::regclass)").arg(sequence->getSignature());//.remove("\"")); + attributes[ParsersAttributes::DEFAULT_VALUE]=QString("nextval('%1'::regclass)").arg(sequence->getSignature()); attributes[ParsersAttributes::SEQUENCE]=sequence->getName(true); } @@ -230,6 +285,7 @@ QString Column::getAlterDefinition(BaseObject *object) { attribs_map attribs; QString def_val; + bool ident_seq_changed = false; BaseObject::setBasicAttributes(true); @@ -263,6 +319,57 @@ QString Column::getAlterDefinition(BaseObject *object) this->identity_type != col->identity_type) attribs[ParsersAttributes::NEW_IDENTITY_TYPE] = ~col->identity_type; + attribs[ParsersAttributes::CUR_IDENTITY_TYPE] = QString(); + attribs[ParsersAttributes::MIN_VALUE] = QString(); + attribs[ParsersAttributes::MAX_VALUE] = QString(); + attribs[ParsersAttributes::START] = QString(); + attribs[ParsersAttributes::INCREMENT] = QString(); + attribs[ParsersAttributes::CACHE] = QString(); + attribs[ParsersAttributes::CYCLE] = QString(); + + //Checking differences in the underlying sequence (identity col) + if(attribs[ParsersAttributes::IDENTITY_TYPE] != ParsersAttributes::UNSET) + { + if(!col->seq_min_value.isEmpty() && this->seq_min_value != col->seq_min_value) + { + attribs[ParsersAttributes::MIN_VALUE] = col->seq_min_value; + ident_seq_changed = true; + } + + if(!col->seq_max_value.isEmpty() && this->seq_max_value != col->seq_max_value) + { + attribs[ParsersAttributes::MAX_VALUE] = col->seq_max_value; + ident_seq_changed = true; + } + + if(!col->seq_start.isEmpty() && this->seq_start != col->seq_start) + { + attribs[ParsersAttributes::START] = col->seq_start; + ident_seq_changed = true; + } + + if(!col->seq_increment.isEmpty() && this->seq_increment != col->seq_increment) + { + attribs[ParsersAttributes::INCREMENT] = col->seq_increment; + ident_seq_changed = true; + } + + if(!col->seq_cache.isEmpty() && this->seq_cache != col->seq_cache) + { + attribs[ParsersAttributes::CACHE] = col->seq_cache; + ident_seq_changed = true; + } + + if(this->seq_cycle != col->seq_cycle) + { + attribs[ParsersAttributes::CYCLE] = (col->seq_cycle ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + ident_seq_changed = true; + } + + if(ident_seq_changed) + attribs[ParsersAttributes::CUR_IDENTITY_TYPE] = ~this->identity_type; + } + copyAttributes(attribs); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); } @@ -288,6 +395,13 @@ void Column::operator = (Column &col) this->sequence=col.sequence; this->identity_type=col.identity_type; + this->seq_cache = col.seq_cache; + this->seq_cycle = col.seq_cycle; + this->seq_increment = col.seq_increment; + this->seq_max_value = col.seq_max_value; + this->seq_min_value = col.seq_min_value; + this->seq_start = col.seq_start; + this->setParentTable(col.getParentTable()); this->setAddedByCopy(false); this->setAddedByGeneralization(false); diff --git a/libpgmodeler/src/column.h b/libpgmodeler/src/column.h index e68e9402a4..6a5fde5bd7 100644 --- a/libpgmodeler/src/column.h +++ b/libpgmodeler/src/column.h @@ -58,6 +58,25 @@ class Column: public TableObject{ //! \brief Identity type of the column (GENERATED BY DEFAULT | ALWAYS) IdentityType identity_type; + /*! \brief Indicates that the underlying sequence is cyclic + (the counter resets when maximum value is reached) (only for identity column) */ + bool seq_cycle; + + //! \brief Underlying sequence's minimum value (only for identity column) + QString seq_min_value, + + //! \brief Underlying sequence's maximum value (only for identity column) + seq_max_value, + + //! \brief Underlying sequence's current sequence value (only for identity column) + seq_start, + + //! \brief Underlying sequence's value increment (only for identity column) + seq_increment, + + //! \brief Underlying sequence's cache value (only for identity column) + seq_cache; + public: Column(void); @@ -116,6 +135,16 @@ class Column: public TableObject{ //! \brief Returns the sequence generator of default value BaseObject *getSequence(void); + //! \brief Sets at once all the necessary fields to define the underlying sequence's attributes + void setIdSeqAttributes(QString minv, QString maxv, QString inc, QString start, QString cache, bool cycle); + + bool isIdSeqCycle(void); + QString getIdSeqMaxValue(void); + QString getIdSeqMinValue(void); + QString getIdSeqIncrement(void); + QString getIdSeqStart(void); + QString getIdSeqCache(void); + //! \brief Copies on column to other void operator = (Column &col); }; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 898d38e564..6647d3dd16 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4674,6 +4674,8 @@ Column *DatabaseModel::createColumn(void) xmlparser.getElementAttributes(attribs); column->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::_TRUE_); column->setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); + column->setIdSeqAttributes(attribs[ParsersAttributes::MIN_VALUE], attribs[ParsersAttributes::MAX_VALUE], attribs[ParsersAttributes::INCREMENT], + attribs[ParsersAttributes::START], attribs[ParsersAttributes::CACHE], attribs[ParsersAttributes::CYCLE] == ParsersAttributes::_TRUE_); if(!attribs[ParsersAttributes::IDENTITY_TYPE].isEmpty()) column->setIdentityType(IdentityType(attribs[ParsersAttributes::IDENTITY_TYPE])); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 808df35f2a..5225c6244a 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -44,24 +44,32 @@ Sequence::Sequence(void) attributes[ParsersAttributes::COL_IS_IDENTITY]=QString(); } -bool Sequence::isNullValue(const QString &value) +bool Sequence::isZeroValue(const QString &value) { + if(value.isEmpty()) + return(false); + unsigned i, count; - bool is_null; + bool is_zero; i=0; - is_null=true; + is_zero=true; count=value.size(); - while(i < count && is_null) + + while(i < count && is_zero) { - is_null=(value[i]=='0' || value[i]=='+' || value[i]=='-'); + is_zero=(value[i]=='0' || value[i]=='+' || value[i]=='-'); i++; } - return(is_null); + + return(is_zero); } bool Sequence::isValidValue(const QString &value) { + if(value.isEmpty()) + return(false); + /* To be valid the value can be start with + or -, have only numbers and it's length must not exceed the MAX_POSITIVE_VALUE length */ if(value.size() > MAX_BIG_POSITIVE_VALUE.size()) @@ -122,7 +130,7 @@ QString Sequence::formatValue(const QString &value) int Sequence::compareValues(QString value1, QString value2) { - if(value1==value2) + if(value1==value2 || value1.isEmpty() || value2.isEmpty()) return(0); else { @@ -174,12 +182,14 @@ void Sequence::setDefaultValues(PgSQLType serial_type) { QString min, max; - if(serial_type==QString("smallserial")) + if(serial_type==QString("smallserial") || + serial_type.isEquivalentTo(QString("smallint"))) { min=MAX_SMALL_NEGATIVE_VALUE; max=MAX_SMALL_POSITIVE_VALUE; } - else if(serial_type==QString("bigserial")) + else if(serial_type==QString("bigserial") || + serial_type.isEquivalentTo(QString("bigint"))) { min=MAX_BIG_NEGATIVE_VALUE; max=MAX_BIG_POSITIVE_VALUE; @@ -235,22 +245,16 @@ void Sequence::setValues(QString minv, QString maxv, QString inc, QString start, start=formatValue(start); cache=formatValue(cache); - //Raises an error when some values are empty - if(minv.isEmpty() || maxv.isEmpty() || inc.isEmpty() || - start.isEmpty() || cache.isEmpty()) - throw Exception(ERR_ASG_INV_VALUE_SEQ_ATTRIBS,__PRETTY_FUNCTION__,__FILE__,__LINE__); - //Raises an error when the min value is greater than max value - else if(compareValues(minv,maxv) > 0) + if(compareValues(minv,maxv) > 0) throw Exception(ERR_ASG_INV_SEQ_MIN_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the start value is less that min value or grater than max value - else if(compareValues(start, minv) < 0 || - compareValues(start, maxv) > 0) + else if(compareValues(start, minv) < 0 || compareValues(start, maxv) > 0) throw Exception(ERR_ASG_INV_SEQ_START_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the increment value is null (0) - else if(isNullValue(inc)) + else if(isZeroValue(inc)) throw Exception(ERR_ASG_INV_SEQ_INCR_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the cache value is null (0) - else if(isNullValue(cache)) + else if(isZeroValue(cache)) throw Exception(ERR_ASG_INV_SEQ_CACHE_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->min_value=minv; @@ -442,19 +446,19 @@ QString Sequence::getAlterDefinition(BaseObject *object) attribs[ParsersAttributes::OWNER_COLUMN]=ParsersAttributes::UNSET; } - if(this->increment!=seq->increment) + if(!seq->increment.isEmpty() && this->increment!=seq->increment) attribs[ParsersAttributes::INCREMENT]=seq->increment; - if(this->min_value!=seq->min_value) + if(!seq->min_value.isEmpty() && this->min_value!=seq->min_value) attribs[ParsersAttributes::MIN_VALUE]=seq->min_value; - if(this->max_value!=seq->max_value) + if(!seq->max_value.isEmpty() && this->max_value!=seq->max_value) attribs[ParsersAttributes::MAX_VALUE]=seq->max_value; - if(this->start!=seq->start) + if(!seq->start.isEmpty() && this->start!=seq->start) attribs[ParsersAttributes::START]=seq->start; - if(this->cache!=seq->cache) + if(!seq->cache.isEmpty() && this->cache!=seq->cache) attribs[ParsersAttributes::CACHE]=seq->cache; if(this->cycle!=seq->cycle) diff --git a/libpgmodeler/src/sequence.h b/libpgmodeler/src/sequence.h index 4f7bd2cf5e..a95dd699ff 100644 --- a/libpgmodeler/src/sequence.h +++ b/libpgmodeler/src/sequence.h @@ -53,7 +53,7 @@ class Sequence: public BaseObject { bool isValidValue(const QString &value); //! \brief Returns true when the passed value is null (zero) - bool isNullValue(const QString &value); + bool isZeroValue(const QString &value); //! \brief Returns the formated value excluding the aditional operators QString formatValue(const QString &value); diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 6eb8f8467e..74746f0b64 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -17,6 +17,8 @@ */ #include "columnwidget.h" +#include "sequencewidget.h" +#include "baseform.h" ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN) { @@ -26,6 +28,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN QStringList list; Ui_ColumnWidget::setupUi(this); + edit_seq_btn->setVisible(false); IdentityType::getTypes(list); identity_type_cmb->addItems(list); @@ -44,7 +47,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN column_grid->addWidget(default_value_grp,1,0,1,1); column_grid->addItem(spacer,column_grid->count(),0); - dynamic_cast(default_value_grp->layout())->addWidget(sequence_sel, 1, 1, 1, 2); + dynamic_cast(default_value_grp->layout())->addWidget(sequence_sel, 1, 1, 1, 6); configureFormLayout(column_grid, OBJ_COLUMN); configureTabOrder({ data_type }); @@ -59,6 +62,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN def_value_txt->setEnabled(false); identity_type_cmb->setEnabled(false); notnull_chk->setEnabled(true); + edit_seq_btn->setVisible(false); }); connect(expression_rb, &QRadioButton::clicked, @@ -67,6 +71,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN def_value_txt->setEnabled(true); identity_type_cmb->setEnabled(false); notnull_chk->setEnabled(true); + edit_seq_btn->setVisible(false); }); connect(identity_rb, &QRadioButton::clicked, @@ -76,8 +81,11 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN identity_type_cmb->setEnabled(true); notnull_chk->setChecked(true); notnull_chk->setEnabled(false); + edit_seq_btn->setVisible(true); }); + connect(edit_seq_btn, SIGNAL(clicked(bool)), this, SLOT(editSequenceAttributes())); + setMinimumSize(540, 480); } catch(Exception &e) @@ -96,6 +104,9 @@ void ColumnWidget::setAttributes(DatabaseModel *model, OperationList *op_list, B BaseObjectWidget::setAttributes(model, op_list, column, parent_obj); sequence_sel->setModel(model); + ident_col_seq.setValues(QString(), QString(), QString(), QString(), QString()); + ident_col_seq.setCycle(false); + if(column) { type=column->getType(); @@ -104,13 +115,13 @@ void ColumnWidget::setAttributes(DatabaseModel *model, OperationList *op_list, B if(column->getSequence()) { - sequence_rb->setChecked(true); + sequence_rb->click(); sequence_sel->setEnabled(true); sequence_sel->setSelectedObject(column->getSequence()); } else if(column->getIdentityType() != BaseType::null) { - identity_rb->setChecked(true); + identity_rb->click(); identity_type_cmb->setEnabled(true); identity_type_cmb->setCurrentText(~column->getIdentityType()); notnull_chk->setEnabled(false); @@ -122,6 +133,35 @@ void ColumnWidget::setAttributes(DatabaseModel *model, OperationList *op_list, B UserTypeConfig::DOMAIN_TYPE | UserTypeConfig::EXTENSION_TYPE, true,false); } +void ColumnWidget::editSequenceAttributes(void) +{ + Column *col = dynamic_cast(this->object); + Schema *schema = nullptr; + BaseForm editing_form(this); + SequenceWidget *seq_wgt=new SequenceWidget; + BaseTable *table = col ? col->getParentTable() : nullptr; + + if(table) + schema = dynamic_cast(table->getSchema()); + else + schema = this->model->getSchema("public"); + + ident_col_seq.setName(QString("%1_%2_seq").arg(table ? table->getName() : QString()).arg(col ? col->getName() : QString("new_column"))); + ident_col_seq.setName(PgModelerNS::generateUniqueName(&ident_col_seq, *model->getObjectList(OBJ_SEQUENCE), false)); + ident_col_seq.setSchema(schema); + + if(col) + { + ident_col_seq.setDefaultValues(col->getType()); + ident_col_seq.setValues(col->getIdSeqMinValue(), col->getIdSeqMaxValue(), col->getIdSeqIncrement(), col->getIdSeqStart(), col->getIdSeqCache()); + ident_col_seq.setCycle(col->isIdSeqCycle()); + } + + seq_wgt->setAttributesReadonly(this->model, nullptr, nullptr, &ident_col_seq, col); + editing_form.setMainWidget(seq_wgt); + editing_form.exec(); +} + void ColumnWidget::applyConfiguration(void) { try @@ -141,6 +181,9 @@ void ColumnWidget::applyConfiguration(void) else column->setIdentityType(IdentityType(identity_type_cmb->currentText())); + column->setIdSeqAttributes(ident_col_seq.getMinValue(), ident_col_seq.getMaxValue(), ident_col_seq.getIncrement(), + ident_col_seq.getStart(), ident_col_seq.getCache(), ident_col_seq.isCycle()); + if(table) { pk = dynamic_cast
(table)->getPrimaryKey(); diff --git a/libpgmodeler_ui/src/columnwidget.h b/libpgmodeler_ui/src/columnwidget.h index 42bf2dfa5c..c1b8780a0d 100644 --- a/libpgmodeler_ui/src/columnwidget.h +++ b/libpgmodeler_ui/src/columnwidget.h @@ -36,12 +36,14 @@ class ColumnWidget: public BaseObjectWidget, public Ui::ColumnWidget { SyntaxHighlighter *hl_default_value; PgSQLTypeWidget *data_type; ObjectSelectorWidget *sequence_sel; + Sequence ident_col_seq; public: ColumnWidget(QWidget * parent = 0); void setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Column *column); private slots: + void editSequenceAttributes(void); public slots: void applyConfiguration(void); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 3030f94852..c66f1ef7ae 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1473,7 +1473,11 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) //Disable the sequence's SQL when the owner column is identity if(col && col->isIdentity()) + { + col->setIdSeqAttributes(seq->getMinValue(), seq->getMaxValue(), seq->getIncrement(), + seq->getStart(), seq->getCache(), seq->isCycle()); seq->setSQLDisabled(true); + } } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/sequencewidget.cpp b/libpgmodeler_ui/src/sequencewidget.cpp index d736855f9e..6f6b131129 100644 --- a/libpgmodeler_ui/src/sequencewidget.cpp +++ b/libpgmodeler_ui/src/sequencewidget.cpp @@ -26,13 +26,19 @@ SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_SE column_sel=nullptr; column_sel=new ObjectSelectorWidget(OBJ_COLUMN, true, this); - sequence_grid->addWidget(column_sel,3,1,1,3); + sequence_grid->addWidget(column_sel, 4, 1, 1, 3); configureFormLayout(sequence_grid, OBJ_SEQUENCE); sequence_grid->addItem(new QSpacerItem(10,0,QSizePolicy::Minimum,QSizePolicy::Expanding), sequence_grid->count(), 0); configureTabOrder(); - setMinimumSize(520, 320); + def_values_cmb->addItem(trUtf8("User defined")); + def_values_cmb->addItem(QString("smallserial")); + def_values_cmb->addItem(QString("serial")); + def_values_cmb->addItem(QString("bigserial")); + setMinimumSize(520, 350); + + connect(def_values_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(setDefaultValues())); } catch(Exception &e) { @@ -40,7 +46,31 @@ SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_SE } } +void SequenceWidget::setAttributesReadonly(DatabaseModel *model, OperationList *op_list, Schema *schema, Sequence *sequence, Column *column) +{ + setAttributes(model, sequence); + BaseObjectWidget::setAttributes(model, op_list, sequence, schema, NAN, NAN, false); + + name_edt->setReadOnly(true); + comment_edt->setEnabled(false); + schema_sel->setEnabled(false); + append_sql_tb->setEnabled(false); + edt_perms_tb->setEnabled(false); + column_sel->setSelectedObject(column); + column_sel->setEnabled(false); + disable_sql_chk->setEnabled(false); + owner_sel->setSelectedObject(column && column->getParentTable() ? + column->getParentTable()->getOwner() : nullptr); + owner_sel->setEnabled(false); +} + void SequenceWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Sequence *sequence) +{ + setAttributes(model, sequence); + BaseObjectWidget::setAttributes(model, op_list, sequence, schema); +} + +void SequenceWidget::setAttributes(DatabaseModel *model, Sequence *sequence) { column_sel->setModel(model); @@ -63,8 +93,6 @@ void SequenceWidget::setAttributes(DatabaseModel *model, OperationList *op_list, cache_edt->setText(QString("1")); increment_edt->setText(QString("1")); } - - BaseObjectWidget::setAttributes(model,op_list,sequence,schema); } void SequenceWidget::applyConfiguration(void) @@ -91,3 +119,32 @@ void SequenceWidget::applyConfiguration(void) } } +void SequenceWidget::setDefaultValues(void) +{ + Sequence *seq = dynamic_cast(this->object); + + if(seq && def_values_cmb->currentIndex() == 0) + { + start_edt->setText(seq->getStart()); + cache_edt->setText(seq->getCache()); + minimum_edt->setText(seq->getMinValue()); + maximum_edt->setText(seq->getMaxValue()); + increment_edt->setText(seq->getIncrement()); + } + else + { + QString min = "0", max = Sequence::MAX_POSITIVE_VALUE; + + if(def_values_cmb->currentText() == "smallserial") + max = Sequence::MAX_SMALL_POSITIVE_VALUE; + else if(def_values_cmb->currentText() == "bigserial") + max = Sequence::MAX_BIG_POSITIVE_VALUE; + + start_edt->setText("1"); + cache_edt->setText("1"); + increment_edt->setText("1"); + minimum_edt->setText(min); + maximum_edt->setText(max); + } +} + diff --git a/libpgmodeler_ui/src/sequencewidget.h b/libpgmodeler_ui/src/sequencewidget.h index 8b055c633a..47b3cadc53 100644 --- a/libpgmodeler_ui/src/sequencewidget.h +++ b/libpgmodeler_ui/src/sequencewidget.h @@ -34,13 +34,25 @@ class SequenceWidget: public BaseObjectWidget, public Ui::SequenceWidget { ObjectSelectorWidget *column_sel; + protected: + void setAttributes(DatabaseModel *model, Sequence *sequence); + + /*! \brief This auxiliary method is used in ColumnWidget to enable the user to edit the underlying sequence's attributes + * when handling an indentity column. This method disable almost all fields in the form letting only the ones related to + * sequence's values configuration enabled */ + void setAttributesReadonly(DatabaseModel *model, OperationList *op_list, Schema *schema, Sequence *sequence, Column *column); + public: SequenceWidget(QWidget * parent = 0); - void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Sequence *sequence); public slots: void applyConfiguration(void); + + private slots: + void setDefaultValues(void); + + friend class ColumnWidget; }; #endif diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 8099d124a4..76ee54d7fc 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -33,18 +33,17 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) ObjectType types[]={ OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_POLICY }; map > fields_map; QFrame *frame=nullptr; - QToolButton *edt_data_tb=nullptr; + QPushButton *edt_data_tb=nullptr; Ui_TableWidget::setupUi(this); - edt_data_tb=new QToolButton(this); + edt_data_tb=new QPushButton(this); QPixmap icon=QPixmap(PgModelerUiNS::getIconPath("editdata")); edt_data_tb->setMinimumSize(edt_perms_tb->minimumSize()); edt_data_tb->setText(trUtf8("Edit data")); edt_data_tb->setToolTip(trUtf8("Define initial data for the table")); edt_data_tb->setIcon(icon); edt_data_tb->setIconSize(edt_perms_tb->iconSize()); - edt_data_tb->setToolButtonStyle(edt_perms_tb->toolButtonStyle()); connect(edt_data_tb, SIGNAL(clicked(bool)), this, SLOT(editData())); misc_btns_lt->insertWidget(1, edt_data_tb); diff --git a/libpgmodeler_ui/ui/baseobjectwidget.ui b/libpgmodeler_ui/ui/baseobjectwidget.ui index 6d8136f248..7c0c984c46 100644 --- a/libpgmodeler_ui/ui/baseobjectwidget.ui +++ b/libpgmodeler_ui/ui/baseobjectwidget.ui @@ -147,7 +147,7 @@ Schema: - + 318 @@ -193,9 +193,6 @@ 22 - - Qt::ToolButtonTextBesideIcon - @@ -331,7 +328,7 @@ This will disable the code of all child and referrer objects. Collation: - + 197 @@ -377,9 +374,6 @@ This will disable the code of all child and referrer objects. 22 - - Qt::ToolButtonTextBesideIcon - diff --git a/libpgmodeler_ui/ui/columnwidget.ui b/libpgmodeler_ui/ui/columnwidget.ui index 7bcc7008d1..4ba331f204 100644 --- a/libpgmodeler_ui/ui/columnwidget.ui +++ b/libpgmodeler_ui/ui/columnwidget.ui @@ -6,8 +6,8 @@ 0 0 - 347 - 171 + 585 + 250 @@ -44,10 +44,23 @@ 4 - - - - false + + + + + 0 + 30 + + + + Edit the underlying sequence's attributes + + + Edit sequence + + + + :/icones/icones/sequence.png:/icones/icones/sequence.png @@ -75,20 +88,7 @@ - - - - - 0 - 0 - - - - &NOT NULL - - - - + @@ -116,6 +116,39 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + + + + + + 0 + 0 + + + + &NOT NULL + + + @@ -126,6 +159,8 @@ def_value_txt sequence_rb - + + + diff --git a/libpgmodeler_ui/ui/sequencewidget.ui b/libpgmodeler_ui/ui/sequencewidget.ui index 91333f0dc3..524accdafd 100644 --- a/libpgmodeler_ui/ui/sequencewidget.ui +++ b/libpgmodeler_ui/ui/sequencewidget.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 214 + 603 + 165 @@ -24,42 +24,52 @@ - 2 + 0 - 2 + 0 - 2 + 0 - 2 + 0 6 + + + Defualt values: + + + + + + + Cyclic: - + - + Start: - + @@ -80,15 +90,15 @@ - - + + - Maximum: + Increment: - - + + 0 @@ -108,14 +118,14 @@ - + Minimum: - + @@ -136,15 +146,15 @@ - - + + - Increment: + Maximum: - - + + 0 @@ -164,14 +174,14 @@ - + Cache: - + @@ -192,7 +202,7 @@ - + Owner Col.: diff --git a/schemas/alter/column.sch b/schemas/alter/column.sch index 445b085986..5b74ea6cc7 100644 --- a/schemas/alter/column.sch +++ b/schemas/alter/column.sch @@ -44,6 +44,48 @@ {ddl-end} %end + %if {cur-identity-type} %and {min-value} %then + {alter-table} + [ SET GENERATED ] {cur-identity-type} [ SET MINVALUE ] {min-value} + {ddl-end} + %end + + %if {cur-identity-type} %and {max-value} %then + {alter-table} + [ SET GENERATED ] {cur-identity-type} [ SET MAXVALUE ] {max-value} + {ddl-end} + %end + + %if {cur-identity-type} %and {start} %then + {alter-table} + [ SET GENERATED ] {cur-identity-type} [ SET START WITH ] {start} + {ddl-end} + %end + + %if {cur-identity-type} %and {cache} %then + {alter-table} + [ SET GENERATED ] {cur-identity-type} [ SET CACHE ] {cache} + {ddl-end} + %end + + %if {cur-identity-type} %and {increment} %then + {alter-table} + [ SET GENERATED ] {cur-identity-type} [ SET INCREMENT ] {increment} + {ddl-end} + %end + + %if {cur-identity-type} %and {cycle} %then + + {alter-table} + [ SET GENERATED ] {cur-identity-type} [ SET] + + %if ({cycle}=="false") %then [ NO] %end + + [ CYCLE] + + {ddl-end} + %end + %if {identity-type} %or {new-identity-type} %then {alter-table} diff --git a/schemas/sql/column.sch b/schemas/sql/column.sch index 165be70e55..b116099e42 100644 --- a/schemas/sql/column.sch +++ b/schemas/sql/column.sch @@ -21,6 +21,39 @@ %if ({pgsql-ver} >=f "10.0") %and {identity-type} %then [ GENERATED ] {identity-type} [ AS IDENTITY ] + + %if {increment} %or {min-value} %or {max-value} %or {start} %or {cache} %or {cycle} %then + [(] + %end + + %if {increment} %then + [ INCREMENT BY ] {increment} + %end + + %if {min-value} %then + [ MINVALUE ] {min-value} + %end + + %if {max-value} %then + [ MAXVALUE ] {max-value} + %end + + %if {start} %then + [ START WITH ] {start} + %end + + %if {cache} %then + [ CACHE ] {cache} + %end + + %if {cycle} %then + [ CYCLE] + %end + + %if {increment} %or {min-value} %or {max-value} %or {start} %or {cache} %or {cycle} %then + [ )] + %end + %else %if {default-value} %then [ DEFAULT ] {default-value} diff --git a/schemas/xml/column.sch b/schemas/xml/column.sch index cbf10ba1b9..788f161e62 100644 --- a/schemas/xml/column.sch +++ b/schemas/xml/column.sch @@ -16,7 +16,15 @@ $tb [ + + + + + + diff --git a/schemas/xml/sequence.sch b/schemas/xml/sequence.sch index a4d39a5011..f6759115b8 100644 --- a/schemas/xml/sequence.sch +++ b/schemas/xml/sequence.sch @@ -3,26 +3,39 @@ # Code generation can be broken if incorrect changes are made. [ $br From 9f33a56643f282195933dd72c195008e7d5c4ea4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 28 May 2018 09:45:28 -0300 Subject: [PATCH 042/425] French translation update Updated the other lang dictionaries with the new text brought by new releases --- lang/es_ES.qm | Bin 310128 -> 296206 bytes lang/es_ES.ts | 3648 ++++++++++-------- lang/fr_FR.qm | Bin 224921 -> 411925 bytes lang/fr_FR.ts | 9753 ++++++++++++++++++++++++++++++++----------------- lang/nl_NL.qm | Bin 329146 -> 300495 bytes lang/nl_NL.ts | 7696 ++++++++++++++++++++------------------ lang/pt_BR.qm | Bin 111678 -> 102867 bytes lang/pt_BR.ts | 9259 ++++++++++++++-------------------------------- lang/zh_CN.qm | Bin 74005 -> 72280 bytes lang/zh_CN.ts | 3996 +++++++++----------- 10 files changed, 17096 insertions(+), 17256 deletions(-) diff --git a/lang/es_ES.qm b/lang/es_ES.qm index 15fab2a28b2263b7d19ad807dae8451b42d3abf3..782ea80bfcc19ae4b1e75b90ac9ba48b42fbc42e 100644 GIT binary patch delta 17903 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 z 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 C)2Acerca de pgModeler - + + 0.0.0 + 0.0.0 + + + + build: + + + + PostgreSQL Database Modeler Modelador para Bases de Datos PostgreSQL - + Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. Herramienta de modelado de datos de código abierto diseñada para PostgreSQL. ¡No más comandos de DDL escritos a mano, deje a pgModeler hacer el trabajo para usted! Este software reúne los conceptos de diagramas entidad-relación y las características que PostgreSQL implementa como extensiones de estándares SQL. - - Design, configure, deploy - Diseño, configurar, implementar - - - - pgModeler is proudly a brazilian software! - pgModeler es orgullosamente un programa brasileño! + + <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" text-decoration: underline; color:#2980b9;">https://pgmodeler.io</span></a></p></body></html> + - - <a href="http://pgmodeler.com.br">http://pgmodeler.com.br</a> + + <html><head/><body><p>Copyright 2006-2018 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.io</span></a>&gt;</p></body></html> - - <html><head/><body><p>Copyright 2006-2016 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> + + pgModeler is proudly a brazilian software! + pgModeler es orgullosamente un programa brasileño! - + Hide this widget Ocultar este widget - + ... ... - - 0.0.0.0 - 0.0.0.0 - - - - Build: - Contruido: - - - + (BUILD_NUM) (NUM_CONSTRUIDO) - + License Licencia - - - Contributors - Colaboradores - - - - <html><head/><body><p>This page is dedicated to all contributors who gave a bit of their time in make pgModeler a better software somehow. The complete list of people that helped pgModeler can be found at <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>If you have a great idea to improve pgModeler please submit it <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">here</span></a>. No ideas for now but want to help? Why not donate a few bucks <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">here</span></a>!?</p></body></html> - <html><head/><body><p>Esta página está dedicada a todos los colaboradores que dieron un poco de su tiempo en hacer pgModeler un mejor software de alguna manera. La lista completa de las personas que ayudó pgModeler se puede encontrar en <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>Si usted tiene una gran idea para mejorar pgModeler favor enviarlo <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">aquí</span></a>. ¿Sin ideas por ahora, pero quiere ayudar? Por qué no donar un poco de dinero <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">aquí</span></a>!?</p></body></html> - - - - 1 - 1 - - - - 2 - 2 - - - - 3 - 3 - - - - 4 - 4 - - - - 5 - 5 - - - - 6 - 6 - - - - 7 - 7 - - - - 8 - 8 - - - - 9 - 9 - - - - Name - Nombre - - - - Country - País - - - - Contribution - Contribución - - - - Damien Degois - Damien Degois - - - - - - France - Francia - - - - French UI translation and several improvements in auxiliary scripts. - Traducción de IU francés y varias mejoras en scripts auxiliares. - - - - Ji Bin - Ji Bin - - - - China - China - - - - Chinese UI translation and small fixes. - Traducción de IU chino y pequeñas correcciones. - - - - Pierre-Samuel LE STANG - Pierre-Samuel LE STANG - - - - - French UI translation. - Traducción de IU al francés. - - - - Lisandro Damián Nicanor - Lisandro Damián Nicanor - - - - Argentina - Argentina - - - - Improvements on build scripts enabling the custom packaging in Linux distros; Per-user settings; pgModeler's package maintainer in Debian Linux. - Mejoras en scripts de construcción que permitan el embalaje personalizado en distribuciones de Linux; Por usuario ajustes; pgModeler y apos; s mantenedor de paquetes en Debian Linux. - - - - Pavel Alexeev - Pavel Alexeev - - - - Russia - Rusia - - - - Additional work for packaging in Linux distros; pgModeler's package maintainer in Fedora Linux. - El trabajo adicional para el empaquetado en la distribuciones de Linux; pgModeler's empaquetador de paquetes en Fedora Linux. - - - - Mariusz Fik - Mariusz Fik - - - - Poland - Polonia - - - - Custom packaging first ideas. Tester of first version of custom packaging patch. - Empaquetados hechos a medida primeras ideas. Probador de primera versión del parche de empaquetados personalizados. - - - - Jonathan DUPRE - - - - - Gilberto Castillo - - - - - Cuba - - - - - Spanish UI translation. - - - - - -Danúbio Viana Nogueira - - - - - Brazil - - - - - Brazilian Portuguese UI translation. - - AggregateWidget @@ -612,12 +413,12 @@ Danúbio Viana Nogueira Application - + Unknown exception caught! Excepción desconocida capturada! - + Failed to create initial configuration in `%1'! Check if the current user has write permission over that path and at least read permission over `%2'. No se pudo crear la configuración inicial en `%1'! Compruebe si el usuario actual tiene permiso de escritura sobre ese camino y al menos permiso de lectura sobre `%2'. @@ -654,7 +455,7 @@ Danúbio Viana Nogueira &Ok - + %1 properties %1 propiedades @@ -662,172 +463,177 @@ Danúbio Viana Nogueira BaseObject - + Column Columna - + Constraint Restricción - + Function Función - + Trigger Trigger - + Index Índice - + Rule Regla - + Table Tabla - + View Vista - + Domain Domínio - + Schema Esquema - + Aggregate Agregado - + Operator Operador - + Sequence Secuencia - + Role Rol - + Conversion Conversión - + Cast Cast - + Language Lenguaje - + Type Tipo - + Tablespace Tablespace - + Operator Family Família de Operadores - + Operator Class Operador de Clases - + Database Base de Dados - + Collation Colación - + Extension Extensión - + Event Trigger Evento Trigger - + Relationship Relación - + + Policy + + + + Textbox Cuadro de Texto - + Permission Permisos - + Parameter Parámetro - + Type Attribute Tipo atributo - + Tag Tag - + Basic Relationship Relación básica - + Generic SQL - + new_object nuevo_objecto @@ -856,89 +662,89 @@ Danúbio Viana Nogueira Comentario: - + Tablespace: Tablespace: - + Schema: Esquema: - + Edit object's permissions Editar permisos del objeto - + Edit permissions Editar permisos - + This object is protected thus no change in form will be applied to it. - + Disables the generated SQL code using comment tokens (--). This will disable the code of all child and referrer objects. Desactiva el código SQL generado utilizando fichas comentario (-). Esto desactivará el código de todos los objetos secundarios y referenciales. - + Disable SQL code Desactivar Código SQL - + Collation: Colación: - + Append or prepend a set of SQL commands to the object's definition. Anexar o anteponer un conjunto de comandos SQL para la definicióno bjeto's. - + Custom SQL SQL personalizado - + Owner: Propietario: - + ID: ID: - + icone icone - + Required field. Leaving this empty will raise errors! Campo requerido. Dejando este vacío elevará errores! - + Value(s) Valor(es) - + Version Versión - + The <em style='color: %1'><strong>highlighted</strong></em> fields in the form or one of their values are available only on specific PostgreSQL versions. Generating SQL code for versions other than those specified in the fields' tooltips may create incompatible code. Los campos <em style ='color: %1'><strong>resaltados</strong></em> en el formulario o uno de sus valores sólo están disponibles en versiones específicas de PostgreSQL. Generar código SQL para versiones distintas a las especificadas en las sugerencias de los campos puede crear código incompatible. @@ -947,7 +753,7 @@ Esto desactivará el código de todos los objetos secundarios y referenciales. BaseRelationship - + rel_%1_%2 rel_%1_%2 @@ -955,12 +761,12 @@ Esto desactivará el código de todos los objetos secundarios y referenciales. BaseTableView - + Toggles the extended attributes display - + Connected rels: %1 Rels conectados: %1 @@ -1059,6 +865,14 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.Seleccione carpeta de destino del informe + + BulkDataEditWidget + + + Bulk data edit + + + CastWidget @@ -1120,12 +934,12 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.Hace que el widget se puede cerrar solamente por tecla ESC o clic del ratón sobre otros controles. - + SQL Keyword Palabra clave SQL - + (no items found.) (No se encontraron items.) (No se encontró ninguna.) @@ -1196,17 +1010,32 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.Valor por Defecto: - + + Edit the underlying sequence's attributes + + + + + Edit sequence + + + + + Identity: + + + + E&xpression: E&xpresión: - + &NOT NULL - + Se&quence: @@ -1229,37 +1058,37 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.Relaciones - + Appearance Apariencia - + Connections Conexiones - + Snippets Snippets - + Plug-ins Plug-ins - + Defaults Valores por Defecto - + &Apply &Aplicar - + &Cancel &Cancelar @@ -1287,22 +1116,22 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.Contraseña: - + Connection Alias: Alias de Conexión: - + Connection DB: BD Conexión: - + Host/Port: Host/Puerto: - + User: Usuario: @@ -1312,87 +1141,87 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.Timeout: - + SSL Mode: Modo SSL: - + Disable Desactivado - + Diff Diff - + Export Exportar - + Import Importar - + Validation Validación - + Security Seguridad - + Allow Permitir - + Require Requerido - + AC verification Verificación de AC - + Full verification Verificación Completa - + Kerberos Server: Servidor Kerberos: - + Client Certificate: Certificado Cliente: - + Revoked Certs.: Cert. Revocados: - + Client Key: Clave Cliente: - + Root Certificate: Certificado Root: - + ~/.postgresql/root.crt ~/.postgresql/root.crt @@ -1402,17 +1231,17 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.Conexiones: - + second(s) segundo(s) - + Force GSSAPI Forzar a GSSAPI - + ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.crt @@ -1432,12 +1261,12 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.Testear - + ~/.postgresql/root.crl ~/.postgresql/root.crl - + ~/.postgresql/postgresql.key ~/.postgresql/postgresql.key @@ -1478,12 +1307,12 @@ Esto desactivará el código de todos los objetos secundarios y referenciales.General - + Other params: Otros parámetros: - + Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. Especifique los parámetros de conexión adicionales en la forma [param]=[valor]. Estos parámetros se describen en el capítulo <strong> libpq </strong> en la documentación de PostgreSQL. @@ -1493,12 +1322,12 @@ Esto desactivará el código de todos los objetos secundarios y referenciales. - + Automatically browses the named database when using this connection to manage databases on <strong>Manage</strong> view. Busca automáticamente la base de datos llamada cuando se utiliza esta conexión para administrar bases de datos en la vista <strong>Manage</strong>. - + Auto browse Auto explorar @@ -1931,51 +1760,46 @@ Desmarcando esto hará que el SQL que se adjunta al final del mandato CREATE DAT - Type: - Tipo: - - - Generic INSERT INSERT genérico - + Include serial columns Incluir columnas serial - + Exclude serial columns Excluir columnas serial - + Generic SELECT SELECT genérico - + Table SELECT SELECT tabla - + Generic UPDATE - + Table UPDATE UPDATE genérico - + Generic DELETE DELETE genérico - + Table DELETE DELETE tabla @@ -2019,97 +1843,106 @@ Desmarcando esto hará que el SQL que se adjunta al final del mandato CREATE DAT - Ctrl+X Ctrl+X - + Undo modifications Deshacer modificaciones - + Ctrl+Z Ctrl+Z - - + + Ins Ins - + Mark the selected rows to be deleted Marque las filas seleccionadas para ser borradas - - - - - + + + + + Del Del - + + Change the values of all selected cells at once + + + + + Ctrl+E + Ctrl+E + + + Duplicate the selected rows - + Ctrl+D - + Add new rows from a CSV file - + Filter the result set Filtrar el conjunto de resultados - + Table: Tabla: - + Schema: Esquema: - + in in - + Hide views Ocultar vista - + Filter expression Filtrar expresión - + Order && Limit Order && Límite - + results (Use <strong>0</strong> for no limit) - + Column: Columna: @@ -2139,183 +1972,193 @@ Desmarcando esto hará que el SQL que se adjunta al final del mandato CREATE DAT - + ASC ASC - + Add empty rows - + DESC DESC - + Limit in: Límite en: - + Add Item Añadir Item - + Remove Item Eliminar Item - + Clear the order by columns list Desactive el orden de lista columnas - + Move selected item up Mover arriba el item seleccionado - + Move selected item down Mover abajo el item seleccionado - + Copy as CSV - + Copy as text - + Copy items - + Pase items - + Browse tables - + Duplicate row(s) - + Delete row(s) - + + Edit cell(s) + + + + <strong>WARNING: </strong> There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now? - + Rows returned: <strong>%1</strong>&nbsp;&nbsp;&nbsp; - + <em>(Limit: <strong>%1</strong>)</em> <em>(Límite: <strong>%1</strong>)</em> - + none - + + Column + + + + No objects found Objects no encontrado - + Found %1 object(s) Encontrado %1 objecto(s) - + Views can't have their data handled through this grid, this way, all operations are disabled. Las vistas no pueden tener sus datos manejados a través de esta red, de esta manera, todas las operaciones están desactivadas. - + The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. <strong>WARNING:</strong> those operations can affect more than one row. La tabla seleccionada no posee una clave primaria! Las actualizaciones y eliminaciones se realizarán teniendo en cuenta todas las columnas como clave primaria. <strong>WARNING:</strong> estas operaciones pueden afectar a más de una fila. - + Referenced tables - - + + (none) - + Referrer tables - + This row is marked to be %1 Esta fila se marca para ser %1 - + deleted eliminado - + updated actualizado - + inserted insertado - + [binary data] [datos binarios] - + <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving? <strong>WARNING:</strong> Una vez que su cometido no es posible deshacer los cambios! Procedo con salvar? - + delete eliminar - + update actualizar - + insert insertar @@ -2328,112 +2171,104 @@ Desmarcando esto hará que el SQL que se adjunta al final del mandato CREATE DAT Formulario - - Toggles the display of extension objects - Cambia la visualización de extensión de objetos - - - + + Data &Grid Datos &Cuadrícula - + + Alt+G Alt+G - - - - - + + + + + ... ... - - Toggles the display of system objects. - - - - - System - - - - - Extension - Extensión - - - + Open the grid to visualize or edit data - + Open a new SQL execution pane Abrir un nuevo panel de ejecución de SQL - + Ctrl+F6 Ctrl+F6 - + Update the objects tree Actualizar el árbol de objetos - - Ctrl+S - Ctrl+S + + Toggle the display of filter widget as well the system/extension objects. + + + + + Sort items alphabetically. When unchecked, items are sorted by OID. + - + + Sort alphabetically + + + + Drop this database Eliminar esta base de datos - + Expands all items Expande todos los item - + Collapses all items Contrae todos los item - + Filters the currently loaded items in the tree by using a pattern and matching their names. If <strong>By OID</strong> is checked the pattern is interpreted as an integer value that represents the object id (OID). <br><br/><strong>HINT:</strong> if you need to search the entire database use the full refresh (<strong>Ctrl+F5</strong>) prior the filtering. - + Filter: Filtro: - + By OID Por OID - + Attribute Atributo - + Value Valor - + Show raw attributes @@ -3328,141 +3163,186 @@ Desmarcando esto hará que el SQL que se adjunta al final del mandato CREATE DAT - - Snippets - Snippets + + Identity + - - Drop object - Drop object + + Command + - - Drop cascade + + USING expr. + + + + + CHECK expr. + + + + + Roles + Roles + + + + RLS enabled + + + + + RLS forced + + + + + Show objects filter + + + + + Show system objects + + + + + Show extension objects + + + + + Snippets + Snippets + + + + Drop object + Drop object + + + + Drop cascade Drop cascade - + Truncate Truncate - + Trunc. cascade Trunc. cascade - + Show data Mostrar dato - + Reload properties Recargar propiedades - + Update Actualizar - + Rename Renombrar - + Source code Código fuente - + Quick refresh - + Full refresh - + -- Source code unavailable for this kind of object -- - + Do you really want to drop the object <strong>%1</strong> <em>(%2)</em>? ¿De verdad quiere borrar el objeto <strong>%1</strong> <em>(%2)</em>? - + Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it. - + + Also restart sequences + + + + Src. table: %1 Src. column(s): %2 - + Ref. table: %1 Ref. column(s): %2 - + -- Source code genaration for buil-in and base types currently unavailable -- - + -- Source code unavailable for the object %1 (%2). -- - - + + Warning Advertencia - + You're running a demonstration version! The data manipulation feature is available only in the full version! Usted está ejecutando una versión de demostración! La función de manipulación de datos sólo está disponible en la versión completa! - + <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? <strong>ATENCION:</strong> Vas a dejar toda la base de datos <strong>%1</strong>! Todos los datos serán completamente eliminados. ¿Realmente desea continuar? - + Do you really want to truncate the table <strong>%1</strong>? ¿De verdad quiere truncar la tabla <strong>%1</strong>? - + Do you really want to <strong>cascade</strong> truncate the table <strong>%1</strong>? This action will truncate all the tables that depends on it? ¿De verdad quieres truncar en <strong>cascade</strong> la tabla <strong>%1</strong>? ¿Esta acción truncar todas las tablas que depende de ella? DatabaseImportForm - - - Database Import - Importar Bases de Datos - - - - Database import - Importar bases de datos - Settings @@ -3479,185 +3359,151 @@ Ref. column(s): %2 Conexión: - - Origin point: - Punto de origen: - - - - Starting point where objects will be put. - Punto inicial donde se colocarán el objetos. - - - - Tables per row: - Tablas por fila: - - - - Tables per row - Tablas por fila - - - - Spacing: - Espaciado: - - - - Spacing between objects - Espaciado entre objeto - - - - Schemas per row: - Esquema por fila: - - - + Automatically resolve dependencies Resolver dependencias automáticamente - - - - + + + + ... ... - + Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. Colores al azar serán asignados a las relaciones importados que faciliten la identificación de los vínculos entre las tablas, principalmente en modelos de gran tamaño. - - Schemas per row - - - - + Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. - + Random colors for relationships Colores aleatorios para las relaciones - + Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. Permite la importación de sistema de objetos integrados. Se recomienda seleccionar sólo aquellos objetos que se hace referencia directamente por las que ser importados. ADVERTENCIA: Trate de importar un enorme conjunto de objetos del sistema puede inflar el modelo resultante o incluso estrellarse pgModeler debido a la memoria / CPU uso excesivo. - + Import system objects Importa objeto del sistema - + Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. Permite la importación de objetos creados por las extensiones. Generalmente no hay necesidad de revisar esta opción, pero si hay objetos en la base de datos que hace referencia directa a esta categoría de objetos de este modo debe estar habilitado. - + Import extension objects Importar extensiones de objetos - + pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. pgModeler ignora los errores de importación y tratará de crear el mayor número posible de objetos. Al marcar esta opción, la operación de importación no se concluye, pero un modelo incompleto se construirá. Esta opción genera un archivo de registro en el directorio temporal de pgModeler. - + Ignore import errors Ignorar errores de importación - + All catalog queries as well the created objects' source code are printed to standard output (stdout). - + + + Import database + + + + Debug mode Modo depurarión - + Create all imported objects in the current working model instead of create a new one. Crear todos los objetos importados en el modelo de trabajo actual en lugar de crear uno nuevo. - + Import objects to the working model Importar objetos al modelo de trabajo - + Database Base de datos - + Filter: Filtrar: - + Filter object by it's OID Filtrar objeto por OID - + By OID Por OID - + Select all objects Seleccionar todos los objetos - + Clear object selection Limpiar los objetos seleccionados - + Expands all items Expandir todos los item - + Collapses all items Contrae todos los item - + Output Salida - + Progress label... Etiqueta de Progreso... - + Cancel Cancelar - + &Import &Importar - + &Close &Cerrar @@ -3667,57 +3513,57 @@ Ref. column(s): %2 <strong>ATENCIÓN:</strong> Estás a punto de importar objetos al modelo actual de trabajo! Esta acción provocará cambios irreversibles a él, incluso en caso de errores críticos durante el proceso. ¿Quieres proceder? - + Importing process aborted! Proceso de Importación abortado! - + Importing process canceled by user! Proceso de Importación cancelado por usuario! - + Importing process sucessfuly ended! Proceso de Importación terminado satisfactoriamente! - + No databases found Base de datos no encontrada - + Found %1 database(s) Encontrada %1 bases de dato(s) - + Retrieving objects from database... Recuperando objetos de base de datos... - + Retrieving cluster level objects... Recuperando objetos a nivel de clúster... - + Retrieving objects of schema `%1'... Recuperando objetos del esquema `%1'... - + Retrieving objects of `%1' (%2)... - + This is a PostgreSQL built-in data type and cannot be imported. Esta es una tipo de datos incorporado PostgreSQL y no se puede importar. - + This is a pgModeler's built-in object. It will be ignored if checked by user. Esta es objeto incorporado del pgModeler. Se ignora si se activa por el usuario. @@ -3776,7 +3622,7 @@ Ref. column(s): %2 - + Assigning sequences to columns... @@ -3786,12 +3632,12 @@ Ref. column(s): %2 La importación de base de datos terminó pero algunos errores se genera y se guarda en el archivo de registro `%1'. Este archivo se prolongará hasta salga de pgModeler. - + Destroying unused detached columns... Destruyendo columnas separadas no utilizados... - + Creating table inheritances... Creación de herencias de tabla... @@ -3799,68 +3645,68 @@ Ref. column(s): %2 DatabaseModel - + The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2' La versión de demostración sólo puede crear `%1' instancias de cada tipo de objeto! Tienes que llegar a este límite para el tipo: `%2' - + Loading: `%1' (%2) Cargando: `%1' (%2) - - + + Validating relationships... - - Generating %1 of the object `%2' (%3) - Generando %1 del objecto `%2' (%3) + + Generating %1 code: `%2' (%3) + - + Saving object `%1' (%2) - + Saving metadata of the object `%1' (%2) - + Metadata file successfully saved! - + Process successfully ended but no metadata was saved! - + Creating object `%1' (%2) Creando objecto `%1' (%2) - + Object `%1' (%2) already exists. Ignoring. - + Loading metadata for object `%1' (%2) - + Object `%1' (%2) not found. Ignoring metadata. - + Metadata file successfully loaded! @@ -3873,57 +3719,72 @@ Ref. column(s): %2 Atributos - + LC_COLLATE: LC_COLLATE: - + LC_CTYPE: LC_CTYPE: - + Template DB: DB Modelo: - + Model Author: Autor del Modelo: - + Encoding: Codificación: - + Connections: Conexiones: - + + Options: + Opciones: + + + + Allow connections + + + + + Is template + + + + Default Objects Objectos por Defecto - + Tablespace: Tablespace: - + Schema: Esquema: - + Collation: Colación: - + Owner: Propietario: @@ -3940,8 +3801,8 @@ Ref. column(s): %2 - - + + Default Por Defecto @@ -3949,29 +3810,44 @@ Ref. column(s): %2 DomainWidget - + + Attributes + Atributos + + + Default Value: Valor Por Defecto: - - Constraint - Resticción + + Not null + No null + + + + Check constraints + - + + Expression: + Expresión: + + + Name: Nombre: - - Not Null: - No Nulo: + + Name + Nombre - - Check Expr.: - Expr. Chequeo: + + Expression + Expresión @@ -4002,7 +3878,7 @@ Ref. column(s): %2 <html><head/><body><p>pgModeler es traído a usted gracias a un <span style=" font-style:italic;">gran esfuerzo para crear y distribuir un producto de calidad</span>. Este proyecto está alcanzando niveles de madurez nunca imaginados. Todo esto es el resultado de un trabajo conjunto entre su autor y la <span style=" font-weight:600;">comunidad Open Source </span>. <br/><br/>Este software tiene un largo camino por recorrer y con su ayuda seguiremos manteniendo el buen trabajo y trayendo nuevas mejoras en cada versión. Si te gustó pgModeler y cree que merece una contribución, haz una donación!</p></body></html> - + I want to help! ¡Quiero ayudar! @@ -4480,6 +4356,11 @@ Ref. column(s): %2 Unable to write the file `%1' due to one or more errors in the definition generation process! + + + There is already a relationship between `%1' (%2) and `%3' (%4) in the model! When using relationships of the type generalization, copy and one-to-one there can't be other relationships linked to the pair of tables. + + The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent! @@ -4615,6 +4496,26 @@ Ref. column(s): %2 Failed to drop the database `%1' because it is defined as the default database for the connection `%2'! + + + The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it! + + + + + The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'. + + + + + Reference to an invalid affected command in policy `%1'! + + + + + Reference to an invalid special role in policy `%1'! + + Assignment of invalid type to the object! @@ -4805,11 +4706,6 @@ Ref. column(s): %2 Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it! Imposible escribir en el archivo `%1'! Asegurase de que el diretório existe o si el usuário tiene permisos de aceso al mismo! - - - There is already a relationship between `%1' (%2) and `%3' (%4) in the model! - Ya existe una Relación entre `%1' (%2) y `%3' (%4) en el modelo! - One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! @@ -5336,37 +5232,47 @@ Mensage retornada por el SGBD: `%1' Formulario - + + Hide this widget + Ocultar este widget + + + + ... + ... + + + Replace one occurrence Reemplazar una ocurrencia - + Replace Reemplazar - + Replace all occurrences Reemplazar todas las ocurrencias - + Replace All Reemplazar todas - + Replace the selection and find the next one Reemplace la selección y buscar la siguiente - + Replace && Find Reemplazar && Buscar - + Replace: Reemplazar: @@ -5434,82 +5340,82 @@ Mensage retornada por el SGBD: `%1' Filas Retornadas: - + Return Method: Método de Retorno: - + Behavior: Comportamiento: - + Set Conjunto - + Language: - + Si&mple - + Tab&le - + Return Table Tabla de retorno - + Execution Cost: Costo ejecución: - + Windown Func. Func. Ventana. - + Leakproof Prueba de fugas - + Parameters Parámetros - + Definition Definición - + Dynamic Library: Biblioteca Dinámica: - + Symbol: Símbolo: - + Library: Biblioteca: - + Source code: Código fuente: @@ -5563,7 +5469,7 @@ Mensage retornada por el SGBD: `%1' Histórico de operaciones: - + Check if there is a new version on server Compruebe si hay una nueva versión en el servidor @@ -5760,62 +5666,62 @@ Mensage retornada por el SGBD: `%1' - + SQL history max. length: - + Souce code editor: - + lines lineas - + Clear the entire SQL comand history. - + Clear history Limpiar historial - + Configurations directory: Directorio de configuraciones: - + Browse the source code editor application Examinar la aplicación del editor de código fuente - + Open in file manager Abrir en el administrador de archivos - + Check updates at startup Comprobar actualizaciones al inicio - + Souce code editor args: - + User interface language: Idioma de la interfaz de usuario: - + Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. @@ -6140,12 +6046,12 @@ Mensage retornada por el SGBD: `%1' - + All files (*.*) - + Load file @@ -6464,6 +6370,11 @@ Mensage retornada por el SGBD: `%1' &Diff &Diff + + + Determine the changes between model/database and another database + + Design database models @@ -6516,8 +6427,8 @@ Mensage retornada por el SGBD: `%1' - Rearrange objects on the canvas hierarchically - Reorganizar los objetos en el lienzo jerárquicamente + Rearrange objects over the canvas + @@ -6799,11 +6710,6 @@ Mensage retornada por el SGBD: `%1' Ctrl+Shift+H Ctrl+Shift+H - - - Determine the changes between model and database - Determinar los cambios entre el modelo y la base de datos - Ctrl+Shift+D @@ -6840,7 +6746,7 @@ Mensage retornada por el SGBD: `%1' Administrar base de datos existentes - + (Demo) (Demo) @@ -6850,174 +6756,189 @@ Mensage retornada por el SGBD: `%1' Guardando modelos temp - + Clear Menu Limpiar Menú - + The demonstration version can create only `one' instance of database model! La versión de demostración sólo puede crear `una' instancia de modelo de base de datos! - + Save model Guardar Modelo - + Save modified model(s) Guardar modelo(s) modificado(s) - + The following models were modified but not saved: %1. Do you really want to quit pgModeler? Los siguientes modelos fueron modificados pero no guardados: %1. ¿De verdad quieres salir de pgModeler? - + The model <strong>%1</strong> was modified! Do you really want to close without save it? Se ha modificado el modelo <strong>%1</strong>. ¿Realmente quieres cerrar sin guardarlo? - - + + Warning Advertencia - + You're running a demonstration version! The model saving feature is available only in the full version! Usted está ejecutando una versión de demostración! La función de ahorro de modelo está disponible sólo en la versión completa! - - - + + + Confirmation Confirmación - + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! It's recommended to validate it before save in order to create a consistent model otherwise the generated file will be broken demanding manual fixes to be loadable again! <strong>ADVERTENCIA:</strong> El modelo <strong>%1</strong> está invalidado! Se recomienda para validarlo antes de guardar con el fin de crear un modelo coherente de lo contrario el archivo generado se romperá exigiendo correcciones manuales que sea cargable de nuevo! - + Save anyway Guardar de todos modos - - - + + + Validate Validar - + Save '%1' as... Guardar '%1' como... - - + + Database model (*.dbm);;All files (*.*) Modelo de base de datos (*.dbm);; Todos los arquivos (*.*) - + Access support page - + You're running a demonstration version! Note that you'll be able to create only <strong>%1</strong> instances of each type of object and some key features will be disabled or limited!<br/><br/>You can purchase a full binary copy or get the source code at <a href='http://pgmodeler.com.br'>pgmodeler.com.br</a>. <strong>NOTE:</strong> pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and cover all development costs.<br/><br/> <strong>HINT:</strong> in order to test all features it's recommended to use the <strong>demo.dbm</strong> model located in </strong>Sample models</strong> at <strong>Welcome</strong> view.<br/><br/><br/><br/> - + Rearrange objects over the canvas is an irreversible operation! Would like to proceed? - + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the export process it's recommended to validate in order to correctly create the objects on database server! <strong>ADVERTENCIA:</strong> El modelo <strong>%1</strong> está invalidado. Antes de ejecutar el proceso de exportación se recomienda validar para crear correctamente los objetos en el servidor de base de datos! - + + Grid + + + + + Hierarchical + + + + + Scattered + + + + Export anyway Exportar de todas modos - + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the diff process it's recommended to validate in order to correctly analyze and generate the difference between the model and a database! <strong>ADVERTENCIA:</strong> El modelo <strong>%1</strong> está invalidado! Antes ejecutar el proceso diff se recomienda para validar el fin de analizar correctamente y generar la diferencia entre el modelo y una base de datos! - + Diff anyway Diff de todas modo - + Database model printing Imprimir modelo de Base de datos - + Changes were detected in the definitions of paper/margin of the model which may cause the incorrect print of the objects. Do you want to continue printing using the new settings? To use the default settings click 'No' or 'Cancel' to abort printing. Se detectaron cambios en las definiciones de papel / margen del modelo que pueden causar la impresión incorrecta de los objetos. ¿Quieres continuar con la impresión utilizando la nueva configuración? Para utilizar la configuración predeterminada, haga clic 'No' o 'Cancel' para abortar la impresión. - + Load model Cargar modelo - + Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again. No se pudo cargar el archivo de modelo de base de datos `%1'. Compruebe la pila de errores para ver los detalles. Usted puede tratar de arreglarlo con el fin de hacer que se puede cargar de nuevo. - + Fix model Fijar modelo - + Cancel Cancelar - + This action will open a web browser window! Want to proceed? Esta acción abrirá una ventana del navegador web! ¿Quieres continuar? - + (no samples found) (no hay ejemplos encontrados) - + save guardar - + export exportar - + diff diff - + Executing pending <strong>%1</strong> operation... Ejecución de operarienes pendientes <strong>%1</strong>... @@ -7030,74 +6951,74 @@ Mensage retornada por el SGBD: `%1' Diálogo - + msg msg - + Exceptions Excepciones - + Show raw text errors or information. Mostrar errores de texto crudos o información. - + Show/hide exceptions stack. Mostrar/ocultar pila excepciones. - + ... ... - - + + &Yes &Si - - + + &No &No - + Cancel Cancelar - + &Ok &Ok - + &Cancel &Cancelar - + Error Error - + Alert Alerta - + Information Información - + Confirmation Confirmación @@ -7359,415 +7280,453 @@ Mensage retornada por el SGBD: `%1' ModelDatabaseDiffForm - - - Database model diff - Diff de modelo de base de datos - - - - Generate diff from model - Generar diff del modelo - Settings Configuraciones - - Input database - Base de datos de entrada - - - + + Connection: Conexión: - + ... ... - + + + Database: bases de datos: - + Ignore import errors Ignorar errores de importación - - Trucate tables before alter columns - Trucate tablas antes alterar las columnas - - - + Import system objects Importar objectos del sistema - + Import extension objects Importar extensión de objecto - + For DROP command, the objects that depends on an object to be dropped will be deleted as well. For TRUNCATE command, tables that are linked to a table to be truncated will be truncate too. <strong>NOTE:</strong> this option can affect more objects than listed in the output or diff preview. Para comando DROP, los objetos que depende de un objeto que se retiren serán eliminados también. Para comando TRUNCATE, tablas que están vinculadas a una mesa para truncar se truncará también. <strong>NOTA:</strong> esta opción puede afectar a varios objetos que se enumeran en la salida o diff vista previa. - + Drop or truncate in cascade mode Drop o truncate en cascada mode - + Permissions already set on database objects will be kept.The ones configured on the model will be applied to the database. Permisos ya establecidos en los objetos de base de datos serán los kept.The configuradas en el modelo se puede aplicar a la base de datos. - + Keep object's permissions Mantenga los permisos del objeto - + Database cluster level objects like roles and tablespaces will not be dropped. No se cayeron objetos de base de datos a nivel de grupo como los roles y espacios de tabla. - + Keep cluster objects Mantenga objetos clúster - + Recreate only unmodifiable objects Recrear objetos sólo no modificables - + Force recreation of objects Forzar recreación de objetos - + Ignores errors generated by duplicated objects when exporting the diff to database. Ignora errores generados por objetos duplicados cuando se exporta el diff de base de datos. - + Ignore duplicity errors Ignorar duplicidad de errores - + Serial columns are converted to integer and having the default value changed to <strong>nextval(sequence)</strong> function call. By default, a new sequence is created for each serial column but checking this option sequences matching the name on column's default value will be reused and will not be dropped. Columnas de serie se convierten a entero y haber cambiado el valor predeterminado para llamada a la función <strong>nextval(sequence)</strong>. De forma predeterminada, se crea una nueva secuencia para cada columna de serie, pero marcando esta opción secuencias que coinciden con el nombre en valor por defecto de la columna se volverá a utilizar y no se borró. - + Reuse sequences on serial columns Reciclar secuencias sobre columnas de serial - + Diff mode Modo diff - + Override the PostgreSQL version when generating the diff. The default is to use the same version as the input database. Anular la versión de PostgreSQL al generar el diff. El valor por defecto es usar la misma versión que la base de datos de entrada. - + Use PostgreSQL: Use PostgreSQL: - + Compares the model and the input database storing the diff in a SQL file for later usage. Compara el modelo y la base de datos de entrada almacenar el diff en un archivo SQL para un uso posterior. - + File: Archivo: - + Select output file Seleccionar archivo de salida - + Compares the model and the input database generating a diff and applying it directly to the latter. <strong>WARNING:</strong> this mode causes irreversible changes on the database and in case of failure the original structure is not restored, so make sure to have a backup before proceed. Compara el modelo y la base de datos de entrada generar un diff y aplicándolo directamente a éste. < strong>ADVERTENCIA:</strong> este modo provoca cambios irreversibles en la base de datos y en caso de fallo de la estructura original no se restablece, así que asegúrese de tener una copia de seguridad antes de proceder. - + Ignores as many as possible errors on import step. This option generates an incomplete diff. - + Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. - + Import system (built-in) objects. Use this if the import step is returning errors related to missing objects. - + Import objects created by extensions. Use this if the import step is returning errors even importing built in ones. - + Instead of use an ALTER command to modify certain kind of objects a DROP and CREATE will be used in order to do a full modification. This option does not affects the database object. - + No command to rename the destination database will be generated even the model's name differ from database name. - + Preserve database name - + Avoid the generation of DROP commands for objects that exists in database but not in the model. This is useful when diff a partial model against the complete database. - + Do not drop missing objects - + Store in S&QL file - + + Diff tool + + + + + Generate diff code + + + + + Source database + + + + + Current model: + + + + + (model) + + + + + Compare to + + + + Appl&y on server - + Diff Diff - + + Froce the generation of DROP commands for columns and constraints that exist in database but not in the model. This is useful when diff a partial model against the complete database and the user needs to drop columns and constraint but preserve the rest of the objects. + + + + + Drop missing columns and constraints + + + + + Truncate tables before alter columns + + + + Import && Export - + Import Importar - + Export Exportar - + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. - + Ignore error codes - + Output Salida - + Changes: Cambios: - + Cancel Cancelar - + Progress label... Etiqueta de progreso... - + Step label... Etiqueta de pasos... - + <html><head/><body><p>Objects marked with an <span style=" font-weight:600;">ALTER</span> may not be effectively changed unless that the differences detected are in attributes that can be modified through ALTER commands otherwise no operationwill be performed or, if the force recreation is checked, the object will be dropped and created again.</p></body></html> <html><head/><body><p>Objetos marcados con un <span style=" font-weight:600;">ALTER</span> No se puede cambiar de manera efectiva a menos que las diferencias detectadas son en los atributos que se pueden modificar a través de comandos ALTER de lo contrario no se realizará ninguna operationwill o, si la fuerza de la recreación está marcada, el objeto será dado de baja y creó de nuevo.</p></body></html> - + Objects to be created Objetos que se creen - - - - + + + + 0 0 - + Objects to be dropped Objetos que se borran - + Possible objects to be changed Objetos posibles de ser cambiados - + Ignored objects (system ones or with sql disabled) Objetos ignorados (los del sistema o con sql disabilitado) - + Diff Preview Vista previa Diff - + &Apply diff &Aplicar diff - + &Generate &Generar - + &Close &Cerrar - - + + Waiting process to start... Proceso en espera para iniciar... - - Importing database <strong>%1</strong>... - Importando base de datos <strong>%1</strong>... - - - - Comparing the model <strong>%1</strong> and database <strong>%2</strong>... - Comparando el modelo <strong>%1</strong> y la base de datos <strong>%2</strong>... - - - + Confirmation Confirmación - + <strong>WARNING:</strong> The generated diff is ready to be exported! Once started this process will cause irreversible changes on the database. Do you really want to proceed? <strong>ADVERTENCIA:</strong> El diff generada está listo para ser exportado! Una vez iniciado este proceso provocará cambios irreversibles en la base de datos. ¿Realmente desea continuar? - + Apply diff Aplicar diff - + Preview diff Vista previa Diff - - Exporting diff to database <strong>%1</strong>... - Exportando diff a base de datos <strong>%1</strong>... + + model not saved yet + + + + + (none) + + + + + Step %1/%2: Importing database <strong>%3</strong>... + + + + + Step %1/%2: Comparing <strong>%3</strong> and <strong>%4</strong>... + + + + + Step %1/%2: Exporting diff to database <strong>%3</strong>... + - + Diff process paused. Waiting user action... Proceso Diff en pausa. Esperando acción del usuario... - + Saving diff to file <strong>%1</strong> Guardando diff a archivo <strong>%1</strong> - + Diff process sucessfully ended! Proceso Diff finalizado satisfactoriamente! - - + + No operations left. No hay operaciones a la izquierda. - + Operation cancelled by the user. Operación cancelada por el usuario. - + Process aborted due to errors! Proceso abortado debido a errores! - + -- SQL code purposely truncated at this point in demo version! - + -- No differences were detected between model and database. -- -- No se detectaron diferencias entre el modelo y la base de datos. -- - + Error code <strong>%1</strong> found and ignored. Proceeding with export. Error de código encontrado <strong>%1</strong> y ignorado. Procediendo con la exportación. - + Save diff as... Salvar diff como... - + SQL code (*.sql);;All files (*.*) Código SQL (*.sql);;Todos los archivos (*.*) @@ -7776,10 +7735,6 @@ Mensage retornada por el SGBD: `%1' ModelExportForm - Model Export - Exportar Modelo - - Export model Exportar Modelo @@ -8033,17 +7988,17 @@ Mensage retornada por el SGBD: `%1' - + SVG representation of database model - + SVG file generated by pgModeler - + Output file `%1' successfully written. @@ -8093,55 +8048,55 @@ Mensage retornada por el SGBD: `%1' Modo de simulación activado. - + Generating SQL for `%1' objects... Generación de SQL para los objetos `%1'... - + Destroying objects created on the server. Destruyendo los objetos creados en el servidor. - + Restoring original names of database, roles and tablespaces. Restauración de los nombres originales de base de datos, roles y tablespaces. - - + + Creating object `%1' (%2) Creando objecto `%1' (%2) - + Creating database `%1' - + Connecting to database `%1' - + Renaming `%1' (%2) to `%3' - - + + Dropping object `%1' (%2) Borrando objetos `%1' (%2) - + Changing object `%1' (%2) Cambiando objecto `%1' (%2) - + Running auxiliary command. Ejecución de comandos auxiliar. @@ -8307,127 +8262,131 @@ p, li { white-space: pre-wrap; } ModelObjectsWidget - Model Objects Modelo Objetos - + + Visible object types + + + + Hide this widget Ocultar este widget - - - - - - + + + + + + ... ... - + 1 1 - + ID ID - + Object Objecto - + Type Tipo - + Parent Object Objeto Padre - + Parent Type Tipo del Padre - - Visible Object Types - Tipos de objetos visibles - - - + Select All Marcar Todos - + Clear All Desmarcar Todos - + + Model objects + + + + Select Selecionar - + Return Retorno - + Cancel Cancelar - + Esc Esc - + Tree view Vista en árbol - + List view Vista en lista - + Objects view configuration Configuración de la Vista de objetos - + Expands all items Expande todos los items - + Collapses all items Contrae todos los items - + Filter: Filtrar: - + By ID Por ID - + New Nuevo @@ -8502,12 +8461,12 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca ModelValidationHelper - + There are pending errors! SQL validation will not be executed. Hay errores pendientes! No se ejecutará la validación de SQL. - + Operation canceled by the user. Operación cancelada por el usuario. @@ -8565,6 +8524,11 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca ... ... + + + Swap ids + + SQL Validation: @@ -8580,11 +8544,6 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Try to resolve the reported issues. Trate de resolver los problemas comunicados. - - - Apply Fix - Aplicar Fijar - Ctrl+S @@ -8625,16 +8584,16 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Esc Esc + + + Apply fixes + + Change the creation order for two objects by swapping their ids Cambiar el orden de la creación de dos objetos mediante el canje de sus ids - - - Swap Ids - Intercambiar Ids - Va&lidate @@ -8666,17 +8625,27 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca - + + The column <strong>%1</strong> on <strong>%2</strong> <em>(%3)</em> is referencing the geospatial data type <strong>%4</strong> but the <strong>postgis</strong> extension is not present in the model! + + + + <strong>HINT:</strong> try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process. - + + <strong>HINT:</strong> Create the extension in the model or let it be created by applying the needed fixes. + + + + SQL validation not executed! No connection defined. - + Database model successfully validated. @@ -8686,32 +8655,32 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Validación de SQL ha fallado debido a un error (s) a continuación. <strong>NOTA:</strong><em> Estos errores no invalida el modelo, pero pueden afectar a las operaciones como <strong>export</strong> and <strong>diff</strong>.</em> - + <em>The above object was created by a relationship. Change the name pattern on it's generator relationship. Fix will not be applied!</em> <em>El objetivo anterior fue creado por una relación. Cambiar el patrón de nombre en él la relación de generador. Fijar no se aplicará!</em> - + Conflicting object: <strong>%1</strong> <em>(%2)</em>. Objeto en conflicto: <strong>%1</strong> <em>(%2)</em>. - + Relationship: <strong>%1</strong> [id: %2]. Relación: <strong>%1</strong> [id: %2]. - + Referrer object: <strong>%1</strong> <em>(%2)</em> [id: %3]. Objeto referente:: <strong>%1</strong> <em>(%2)</em> [id: %3]. - + Running SQL commands on server... Ejecución de comandos SQL en el servidor... - + Processing object: %1 Procesando object: %1 @@ -8719,408 +8688,420 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca ModelWidget - + One to One (1-1) Uno a Uno (1-1) - + One to Many (1-n) Uno a Muchos (1-n) - + Many to Many (n-n) Mucho a Mucho (n-n) - - + + Copy Copiar - + Inheritance Herencia - + <strong>ATTENTION:</strong> The database model is protected! Operations that could modify it are disabled! <strong>ATENCIÓN:</strong> El modelo de base de datos está protegida! Operaciones que podrían modificar la misma son habilitado! - + Source Fuente - + Alt+S Alt+S - + Show object source code Exibir el código-Fuente del objeto - - + + Properties Propiedades - + Space Espacio - + Edit the object properties Edita las propriedades del objeto - - + + Protect Proteger - - + + Unprotect Desproteger - + Protects object(s) from modifications Protege objeto(s) a partir de las modificaciones - - + + Delete Eliminar - + Del Del - - + + Del. cascade Del. cascada - + Shift+Del Shift+Del - + Select all Seleccionar todos - + + Select + Selecionar + + + Ctrl+A Ctrl+A - + Selects all the graphical objects in the model Selecciona todos los objetos gráficos en el modelo - + + Edit data + Editar datos + + + Convert Convertir - + Ctrl+C Ctrl+C - + Paste Pegar - + Ctrl+V Ctrl+V - + Cut Cortar - + Ctrl+X Ctrl+X - + Deps && Referrers Deps && Referreridos - + New Nuevo - + Add a new object in the model Adicionar un nuevo objeto en el modelo - + Quick Rápido - + Quick action for the selected object Acciones rápidas para la selección de objecto - + Rename Renombrar - + F2 F2 - + Quick rename the object Renombrar rápida del objeto - + Move to schema Mover al esquema - + Set tag Configurar tag - + Edit permissions Editar permisos - + Ctrl+E Ctrl+E - + Change owner Cambiar propietario - + Select children Seleccione los hijos - + Select tagged - - Highlight - Aspecto interesante - - - + Open relationship Abrir relación - + Custom SQL Personalizar SQL - + Alt+Q Alt+Q - + Convert to sequence Converir a secuencia - + Convert to serial Converir a serial - + Break line Saltos de líena - + Remove points Remover puntos - + Enable SQL Habilitar SQL - + Disable SQL Deshabilitar SQL - + Duplicate Duplicar - + Ctrl+D - + Extended attributes Atributos extendidos - + + Show Mostrar - + + Hide Ocultar - + Jump to table Ir a tabla - + + Schemas rectangles + + + + Fade in/out - - + + Fade in - - + + Fade out - - - + + + Relationships Relaciones - + Swap ids - + Edit the objects creation order by swapping their ids - + 90° (vertical) 90° (vertical) - + 90° (horizontal) 90° (horizontal) - + 90° + 90° (vertical) 90° + 90° (vertical) - + 90° + 90° (horizontal) 90° + 90° (horizontal) - - - + + + All objects Todos los objetos - - + + Schemas - - + + Tables Tablas - - + + Views Vistas - - + + Textboxes - + Zoom: %1% Zoom: %1% - + Do you really want to convert the relationship into an intermediate table? ¿Realmente desea convertir la relación en una tabla intermedia? - + Loading database model Cargando modelo de base de datos - + Saving database model Guardando modelo de base de datos @@ -9145,67 +9126,72 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca También copiar todas las dependencias de los objetos seleccionados? Esto minimiza la ruptura de referencias cuando los objetos copiados se pegan en otro modelo. - + Pasting objects... Pegar Objetos... - + Validating object: `%1' (%2) Validando El objeto: `%1' (%2) - + Generating XML for: `%1' (%2) Generando código XML del objeto: `%1' (%2) - + Pasting object: `%1' (%2) Pegar Objetos: `%1' (%2) - + Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details! No todos los objetos se pegan a la modelo debido a errores devueltos durante el proceso! Consulte a un error de pila para más detalles! - + <strong>CAUTION:</strong> You are about to delete objects in cascade mode which means more objects than the selected will be dropped too. Do you really want to proceed? <strong>PRECAUCIÓN:</strong> Estás a punto de eliminar objetos en modo de cascada que significa más objetos que el seleccionado se redujo también. ¿Realmente desea continuar? - + <strong>CAUTION:</strong> Remove multiple objects at once can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? <strong>PRECAUCIÓN:</strong> Eliminar varios objetos a la vez puede causar invalidaciones irreversibles a otros objetos en el modelo que causa este tipo de objetos no válidos para ser borrados también. ¿Realmente desea continuar? - + <strong>CAUTION:</strong> Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? <strong>PRECAUCIÓN:</strong> Eliminar una relación puede causar invalidaciones irreversibles a otros objetos en el modelo que causa este tipo de objetos no válidos para ser borrados también. ¿Realmente desea continuar? - + Do you really want to delete the selected object? ¿Realmente desea eliminar el objeto seleccionado? - + The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details. La eliminación en cascada encontró algunos problemas al ejecutar! Algunos objetos no podían ser borrados o registrados en la historia de la operación! Por favor, consulte a un error de la pila para obtener más detalles. - + (no objects) (no hay objetos) - + + None + + + + Source code Código fuente - + Constraints Restricciones @@ -9213,32 +9199,32 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca ModelsDiffHelper - + Processing object `%1' (%2)... Procesando objecto `%1' (%2)... - + Skipping object `%1' (%2)... Omitiendo objeto `%1' (%2)... - + Processing diff infos... Procesando diff infos... - + Processing `%1' info for object `%2' (%3)... - + No differences between the model and database. - + Preparing diff code... @@ -9251,78 +9237,78 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Formulario - + Role Rol - + Tag Tag - + Cast Cast - + A A - + Language Lenguaje - + Textbox Textbox - + Event Trigger Evento Trigger - + Tablespace Tablespace - + Schema Esquema - + Domain Dominio - + Conversion Conversión - + Aggregate Agregado - + Collation Collation - + Table Tabla - + Type Tipo @@ -9332,12 +9318,12 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Op. Familia - + Sequence Sequencia - + Extension Extensión @@ -9347,12 +9333,12 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Función - + Op. Class Op. Clase - + Operator Operador @@ -9362,13 +9348,13 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Vista - + Permissions Permisos - + Rule Regla @@ -9388,37 +9374,42 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Restricción - + Generic SQL - + Trigger Trigger - + + Policy + + + + Many-to-many Muchos-a-muchos - + One-to-many Uno-a-muchos - + One-to-one Uno-a-uno - + Inheritance Herencia - + Copy Copia @@ -9519,6 +9510,7 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca + 9 9 @@ -9548,37 +9540,37 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca B - + 8 8 - + 1 1 - + 2 2 - + 3 3 - + 5 5 - + 4 4 - + 0 0 @@ -9586,63 +9578,67 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca NumberedTextEditor - - + Load file - + Load the object's source code from an external file - - Edit source + + Load + Cargar + + + + Edit - + Edit the source code in the preferred external editor - + Clear Limpiar - + Upper case - + Lower case - + Ident right - + Ident left - + SQL file (*.sql);;All files (*.*) Archivo SQL (*.sql);;Todos los archivos (*.*) - - The source code is currently being edited in the application `%1' (pid: %2)! Only one instance of the source code editor application is allowed. + + The source editor `%1' is running on `pid: %2'. - + Could not start the source code editor application `%1'! Make to sure that the source editor path defined in the general settings points to a valid executable and the current user has permission to run the application. Error message returned: `%2' @@ -9718,113 +9714,135 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Formulario - + Pattern: Patrón: - + Find Buscar - + Defines the search filter Define el filtro de búsqueda - + Filter Filtro - + Clears the search results Limpiar los resultados de la búsqueda - + Clear Limpiar - - Highlight graphical objects when selecting them or their children on the result list - Resaltar objetos gráficos al seleccionar a ellos oa sus hijos en la lista de resultados - - - - Highlight - Resaltar - - - - + + ... ... - + Hide this widget Ocultar este widget - + + (Un)selects the graphical objects in the results grid + + + + + Select + Selecionar + + + Regular Expression Expresión Regular - + Exact Match Resultado Exacto - + Select All Selecionar todos - + Clear All Limpiar Todos - + Case Sensitive Sensible Case - + ID ID - + Object Objecto - + Type Tipo - + Parent Object Objecto Padre - + Parent Type Tipo del Padre - + + Fades outs all the graphical objects in the results grid (or those not listed). The current fade in/out state of all objects is modified. + + + + + Fade out + + + + + + Listed + + + + + + Not listed + + + + Found <strong>%1</strong> object(s). Encontrado objecto(s) <strong>%1</strong>. - + No objects found. Objetos no encontrados. @@ -9876,131 +9894,131 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Seleccionar Objecto - + Select %1 - ObjectTableWidget + ObjectsTableWidget - + Form - Formulario + Formulario - + Add Item - Adicionar Item + - + Ins - Ins + Ins - + Remove Item - Remover Item + - + Del - Del + Del - + Update Item - Actualizar Item + Actualizar Item - + Alt+R - Alt+R + Alt+R - + Remove All - Remover Todo + - + Shift+Del - Shift+Del + Shift+Del - + Duplicate item - + Ctrl+D - + Edit Item - Editar Item + Editar Item - + Space - Espacio + Espacio - + Move Up - Mover Arriba + Mover Arriba - + Ctrl+Up - Ctrl+Up + Ctrl+Up - + Move Down - Mover Abajo + Mover Abajo - + Ctrl+Down - Ctrl+Down + Ctrl+Down - + Move to start - Mover al inicio + Mover al inicio - + Ctrl+Home - Ctrl+Home + Ctrl+Home - + Move to end - Mover al final + Mover al final - + Ctrl+End, Ctrl+S - Ctrl+End, Ctrl+S + Ctrl+End, Ctrl+S - - + + Confirmation - Confirmación + Confirmación - + Do you really want to remove the selected item? - ¿Realmente desea eliminar el elemento seleccionado? + ¿Realmente desea eliminar el elemento seleccionado? - + Do you really want to remove all the items? @@ -10321,13 +10339,13 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca - + Roles Roles - + Privileges Privilégios @@ -10382,32 +10400,27 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca Vista previa Código - - Type: - Tipo: - - - - Role - Rol - - - + Id Id - - Leave the <em><strong>Roles</strong></em> empty to create a permission applicable to <strong><em>PUBLIC</em></strong>. - Deje los <em><strong>Roles</strong></em> vacío para crear un permiso aplicable a <strong><em>PUBLIC</em></strong>. + + Name + Nombre - + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + + + + -- No permissions defined for the specified object! -- No hay permisos definidos para el objeto especificado! - + /* Could not generate the SQL code preview for permissions! / * No se pudo generar el código SQL para previsualización permisos! @@ -10415,384 +10428,674 @@ The requested size %1 x %2 was too big and there was not enough memory to alloca PgModelerCLI - + Unrecognized option '%1'. Opción no reconocido '%1'. - + Value not specified for option '%1'. El valor no se especifica para la opción '%1'. - + Option '%1' does not accept values. Opción '%1' no acepta valores. - - Connection aliased as '%1' was not found on configuration file. - Conexión con alias como '%1' no se ha encontrado en el archivo de configuración. - - - + Usage: pgmodeler-cli [OPTIONS] El uso: pgmodeler-cli [OPTIONS] - - + + command line interface. interfaz de línea de comandos. - - PostgreSQL Database Modeler Project - pgmodeler.com.br - Proyecto Modelador Base de datos PostgreSQL - pgmodeler.com.br - - - - Copyright 2006-2015 Raphael A. Silva <raphael@pgmodeler.com.br> - Copyright 2006-2013 Raphael A. Silva <rkhaotix@gmail.com> - - - - This CLI tool provides the operations to export pgModeler's database models without -the need to load them on graphical interface as well to fix model files to the most recent -accepted structure. All available options are described below. - Esta herramienta proporciona una manera de exportar pgModeler's modelos de base de datos sin -la necesidad de cargarlos en la interfaz gráfica. Todos los disponibles exportación -modos se describen a continuación. - - - + General options: Opciones Generales: - + DBMS export options: Opciones de exportación del SGDB: - + Miscellaneous options: Otros Opciones: - + There are no connections configured. No hay conexiones configuradas. - - Available connections (alias : conn. string) - Conexiones disponibles (alias:. Conn cadena) - - - - No export mode specified! - No se especifica el modo de exportación! - - - - Export, fix model and update mime operations can't be used at the same time! - Las operaciones de exportación, modelo fijo y actualización mime no se pueden utilizar al mismo tiempo! - - - - No input file specified! - Sin archivo de entrada especificado! - - - - No output file specified! - Sin archivo de salida especificado! - - - + Input file must be different from output! Archivo de entrada debe ser diferente de la salida! - + Incomplete connection information! Información de conexión incompleto! - + Invalid zoom specified! Inválido Zoom especificado! - + Invalid action specified to update mime option! Acción inválida para actualizar opción mimo! - + Starting model fixing... Iniciar fijación modelo... - + Starting mime update... Iniciar actualización de mime... - + Starting model export... Comenzando del modelo de exportación ... + + + Model successfully fixed! + Modelo fijado correctamente! + + + + PNG and SVG export options: + + + + + Connection aliased as '%1' was not found in the configuration file. + + + + + PostgreSQL Database Modeler Project - pgmodeler.io + + + + + Copyright 2006-2018 Raphael A. Silva <raphael@pgmodeler.io> + + + + + This CLI tool provides several operations over models and databases without the need to perform them +in pgModeler's graphical interface. All available options are described below. + + + + + %1, %2 [FILE] Input model file (.dbm). This is mandatory for fix, export operations. + + + + + %1, %2 [DBNAME] Input database name. This is mandatory for import operation. + + + + + %1, %2 [FILE] Output file. This is mandatory for fixing model or exporting to file, png or svg. + + + + + %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + + + + + %1, %2 [NUMBER] Model fix tries. When reaching the maximum count the invalid objects will be discarded. + + + + + %1, %2 Export the input model to a sql script file. + + + + + %1, %2 Export the input model to a png image. + + + + + %1, %2 Export the input model to a svg file. + + + + + %1, %2 Export the input model directly to a PostgreSQL server. + + + + + %1, %2 Import a database to an output file. + + + + + %1, %2 Compares a model and a database or two databases generating the SQL script to synch the latter in relation to the first. + + + + + %1, %2 Force the PostgreSQL version of generated SQL code. + + + + + %1, %2 Silent execution. Only critical messages and errors are shown during process. + + + + + %1, %2 Show this help menu. + + + + + Connection options: + + + + + %1, %2 List available connections in file %3. + + + + + %1, %2 [ALIAS] Connection configuration alias to be used. + + + + + %1, %2 [HOST] PostgreSQL host in which a task will operate. + + + + + %1, %2 [PORT] PostgreSQL host listening port. + + + + + %1, %2 [USER] PostgreSQL username. + + + + + %1, %2 [PASSWORD] PostgreSQL user password. + + + + + %1, %2 [DBNAME] Connection's initial database. + + - Loading input file: - Cargando archivo de entrada: + %1, %2 Draws the grid in the exported image. + + + + + %1, %2 Draws the page delimiters in the exported image. + + + + + %1, %2 Each page will be exported in a separated png image. (Only for PNG images) + + + + + %1, %2 [FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images) + - Fixed model file: - Fijando archivo de modelo: + %1, %2 Ignores errors related to duplicated objects that eventually exist in the server. + + + + + %1, %2 [CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided. + + + + + %1, %2 Drop the database before execute a export process. + + + + + %1, %2 Runs the DROP commands attached to SQL-enabled objects. + + + + + %1, %2 Simulates an export process by executing all steps but undoing any modification in the end. + + + + + %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + + + + + Database import options: + - Model successfully fixed! - Modelo fijado correctamente! + %1, %2 Ignore all errors and try to create as many as possible objects. + - - PNG and SVG export options: + + %1, %2 Import system built-in objects. This option causes the model bloating due to the importing of unneeded objects. - - %1, %2=[FILE] Input model file (.dbm). Mandatory use when fixing a model or exporting it. + + %1, %2 Import extension objects. This option causes the model bloating due to the importing of unneeded objects. - - %1, %2=[FILE] Output file. Mandatory use when fixing model or export to file or png. + + %1, %2 Run import in debug mode printing all queries executed in the server. - - %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + + Diff options: - - %1, %2 Model fix tries. When reaching the maximum count the invalid objects will be discard. + + %1, %2 [DBNAME] The database used in the comparison. All the SQL code generated is applied to it. - - %1, %2 Export to a sql script file. + + %1, %2 Save the generated diff code to output file. - - %1, %2 Export to a png image. + + %1, %2 Apply the generated diff code on the database server. - - %1, %2 Export to a svg file. + + %1, %2 Don't preview the generated diff code when applying it to the server. - - %1, %2 Export directly to a PostgreSQL server. + + %1, %2 Drop cluster level objects like roles and tablespaces. - - %1, %2 List available connections on %3 file. + + %1, %2 Revoke permissions already set on the database. New permissions configured in the input model are still applied. - - %1, %2 Version of generated SQL code. Only for file or dbms export. + + %1, %2 Drop missing objects. Generates DROP commands for objects that are present in the input model but not in the compared database. - - %1, %2 Silent execution. Only critical errors are shown during process. + + %1, %2 Force the drop of missing columns and constraints. Causes only columns and constraints to be dropped, other missing objects aren't removed. - - %1, %2 Show this help menu. + + %1, %2 Rename the destination database when the names of the involved databases are different. - - %1, %2 Draws the grid on the exported png image. + + %1, %2 Don't drop or truncate objects in cascade mode. - - %1, %2 Draws the page delimiters on the exported png image. + + %1, %2 Truncate tables prior to alter columns. Avoids errors related to type casting when the new type of a column isn't compatible to the old one. - - %1, %2 Each page will be exported on a separated png image. (Only for PNG) + + %1, %2 Don't reuse sequences on serial columns. Drop the old sequence assigned to a serial column and creates a new one. - - %1, %2=[FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG) + + %1, %2 Don't force the recreation of objects. Avoids the usage of a DROP and CREATE commands to create a new version of the objects. - - %1, %2 Ignores errors related to duplicated objects that eventually exists on server side. + + %1, %2 Don't recreate the unmodifiable objects. These objects are the ones which can't be changed via ALTER command. - - %1, %2=[CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided. + + %1, %2 [ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. - - %1, %2 Drop the database before execute a export process. + + ** The diff process allows the usage of the following options related to import and export operations: - - %1, %2 Runs the DROP commands attached to SQL-enabled objects. + + * Export: - - %1, %2 Simulates a export process. Actually executes all steps but undoing any modification. + + * Import: - - %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + + ** When running the diff using two databases (%1 and %2) there's the need to specify two connections/aliases. - - %1, %2=[ALIAS] Connection configuration alias to be used. + + If only one connection is set it will be used to import the input database as well to retrieve database used in the comparison. - - %1, %2=[HOST] PostgreSQL host which export will operate. + + A second connection can be specified by appending a 1 on any connection configuration parameter listed above. - - %1, %2=[PORT] PostgreSQL host listening port. + + Available connections (alias : connection string) - - %1, %2=[USER] PostgreSQL username. + + No operation mode was specified! - - %1, %2=[PASSWORD] PostgreSQL user password. + + Export, fix model, import database, diff and update mime operations can't be used at the same time! - - %1, %2=[DBNAME] Connection's initial database. + + Multiple export mode was specified! - - %1, %2=[ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + + No input file was specified! - - Multiple export mode specified! + + No input database was specified! - - Mime database successfully updated. + + No output file was specified! - - Export to PNG image: - Exportar a imagen PNG: + + No input file or database was specified! + + + + + The input file and database can't be used at the same time! + + + + + No database to be compared was specified! + - - Export to SVG file: + + No diff action (save or apply) was specified! - - Export to SQL script file: - Exportar a archivo de comandos SQL: + + No output file for the diff code was specified! + - - Export to DBMS: - Exportar a SGDB: + + ** Error code `%1' found and ignored. Proceeding with export. + - - Export successfully ended! - Exportación terminó correctamente! + + ** Command: %1 + - + Extracting objects' XML... Exportando objetos XML... - + Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! Archivo de entrada no es válido! Parece que no es un modelo pgModeler generada o el archivo está dañado! - + Recreating objects... Recreando objetos... - - -** Object(s) that couldn't fixed: - -** Objeto(s) que no podían ser fijado: + + +** Object(s) that couldn't fixed: + +** Objeto(s) que no podían ser fijado: + + + + WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) + ADVERTENCIA: Hay objetos que tal vez no se pueden arreglar. Tratando de nuevo ... (Trata %1/%2) + + + + + Loading input file: %1 + + + + + Fixed model file: %1 + + + + + Export to PNG image: %1 + + + + + Export to SVG file: %1 + + + + + Export to SQL script file: %1 + + + + + Export to DBMS: %1 + + + + + Export successfully ended! + + + + + + Starting database import... + + + + + + Input database: %1 + + + + + Saving the imported database to file... + + + + + Import successfully ended! + + + + + + Starting diff process... + + + + + Input model: %1 + + + + + Compare to: %1 + + + + + Loading input model... + + + + + + Importing the database `%1'... + + + + + Comparing the generated models... + + + + + No differences were detected. + + + + + Saving diff to file `%1' + + + + + ** WARNING: You are about to apply the generated diff code to the server. Data can be lost in the process! + + + + + ** Proceed with the diff applying? (yes/no) > + + + + + yes + + + + + + no + + + + + Diff code not applied to the server. + + + + + Applying diff to the database `%1'... + + + + + Diff successfully ended! + + - - WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) - ADVERTENCIA: Hay objetos que tal vez no se pueden arreglar. Tratando de nuevo ... (Trata %1/%2) + + Mime database successfully updated! + + - + Database model files (.dbm) are already associated to pgModeler! Archivos de modelo de base de datos (.dbm) ya están asociados a pgModeler! - + There is no file association related to pgModeler and .dbm files! No hay ninguna asociación de archivos relacionados con pgModeler y archivos .dbm! - + Mime database operation: %1 Operación Mime de base de datos: %1 - + Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. No se puede borrar el archivo% 1! Compruebe si el usuario actual tiene permisos para eliminarlo y si existe el archivo. - + Running update-mime-database command... Ejecución de comando update-mime-database... @@ -10818,17 +11121,17 @@ modos se describen a continuación. PgModelerUiNS - + Do you want to apply the <strong>SQL %1 status</strong> to the object's references too? This will avoid problems when exporting or validating the model. ¿Desea aplicar el <strong>SQL %1 estatus</strong> a las referencias del objeto también? Esto evitará problemas al exportar o validar el modelo. - + disabling deshabilitando - + enabling habilitando @@ -10967,18 +11270,66 @@ modos se describen a continuación. Biblioteca + + PolicyWidget + + + Basics + + + + + Command: + + + + + Permissive + + + + + Roles + Roles + + + + Expressions + Expresiones + + + + USING: + + + + + CHECK: + + + + + Name + Nombre + + + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + + + QObject - + new_database new_database - - - - + + + + %1 (line: %2) %1 (line: %2) @@ -11554,74 +11905,82 @@ modos se describen a continuación. por Defecto - + Referer View: Vista Intermedia: - + Referer view references one or more columns of a table to construct it's own columns. Vista Intermedia hace referencia a una o más columnas de una tabla de construir es propias columnas. - + Referenced table has its columns referenced by a view in order to construct the columns of this latter. Tabla referenciada tiene sus columnas referenciadas por una vista para construir las columnas de este último. - + Referer Table: Tabla Intermedia: - + Referer table references one or more columns of a table through foreign keys. This is the (n) side of relationship. Tabla intermedia referencia a una o más columnas de una tabla a través de claves externas. Este es el lado (n) de relación. - + Referenced table has its columns referenced by a table's foreign key. This is the (1) side of relationship. Tabla referenciada tiene sus columnas referenciadas por una mesa y apos; s clave externa. Esta es la (1) lado de relación. - + Referenced Table: Tabla Referenciada: - - - + + + Reference Table: Tabla Referencia: - + Reference table has the columns from its primary key will copied to the receiver table in order to represent the linking between them. This is the (1) side of relationship. Tabla de referencia tiene las columnas de su clave primaria se copian en la tabla del receptor con el fin de representar a la vinculación entre ellos. Esta es la (1) lado de relación. - + Receiver Table: Tabla Receptora: - + Receiver (or referer) table will receive the generated columns and the foreign key in order to represent the linking between them. This is the (n) side of relationship. Receptor tabla (o intermedia) recibirá las columnas generadas y la clave externa con el fin de representar a la vinculación entre ellos. Este es el lado (n) de relación. - + In many-to-many relationships both tables are used as reference to generate the table that represents the linking. Columns from both tables are copied to the resultant table and two foreign keys are created as well in order to reference each participant table. En muchos-a-muchos relación ambas tablas se utilizan como referencia para generar la tabla que representa la vinculación. Las columnas de ambas tablas se copian en la tabla resultante y dos claves externas se crean así con el fin de hacer referencia a cada mesa participante. - - + + is required es requerido + + ResultSetModel + + + [binary data] + [datos binarios] + + RoleWidget @@ -11631,7 +11990,7 @@ modos se describen a continuación. - + Validity Validez @@ -11652,54 +12011,59 @@ modos se describen a continuación. - Inherit Permissions - Heredar Permisos + Inherit permissions + - Can create Database - Puede Crear Base de Datos + Can create database + - Can Login - Permitir Login + Bypass RLS + - Can create Role - Puede Crear Rol + Can use replication + - Can use Replication - Puede usar Replicación + Can login + Puede login + + + + Can create role + - - + + Members Miembros - - + + Member of Miembro de - - + + Members (Admin.) Miembros (Admin.) - + Password: Contraseña: - + Encrypted Encriptada @@ -11709,7 +12073,7 @@ modos se describen a continuación. - + Role Rol @@ -11760,7 +12124,7 @@ modos se describen a continuación. Formulario - + Save SQL commands Guardar comandos SQL @@ -11805,218 +12169,221 @@ modos se describen a continuación. - - Ctrl+S - Ctrl+S - - - + Run the specified SQL command Ejecutar un comando SQL especificada - + Run SQL Ejecutar SQL - + F6 F6 - + Clear sql input field and results Limpiar campo de entrada de SQL y resultados - + Clear All Limpiar Todos - - + + Export results to a CSV file Exportar resultados a un acchivo CSV - + Snippe&ts Snippe&ts - + + Alt+T + + + + E&xport E&xportar - + + Alt+X + + + + Toggles the output pane - + &Output - + Alt+O Alt+O - + Current working database - - - + + + Results - + Messages - + History - - ... ... - + SQL file (*.sql);;All files (*.*) Archivo SQL (*.sql);;Todos los archivos (*.*) - + Load Cargar - + Save - + Save as Guardar como - + [binary data] [datos binarios] - + No results retrieved or changes done due to the error above. - - + + Messages (%1) - + Results (%1) - - [%1]: SQL command successfully executed. <em>%2 <strong>%3</strong></em> + + [%1]: SQL command successfully executed in <em><strong>%2</strong></em>. <em>%3 <strong>%4</strong></em> - + Rows affected - + Rows retrieved - + Load SQL commands Cargar comandos SQL - + Save CSV file Guardar archivos CSV - + Comma-separated values file (*.csv);;All files (*.*) Archivo de valores separados por comas (*.csv);;Todos los archivos (*.*) - + The SQL input field and the results grid will be cleared! Want to proceed? El campo de entrada de SQL y la cuadrícula de resultados se borrará! ¿Quieres continuar? - + Copy selection Copiar la selección - + Plain format - + CVS format - + This action will wipe out all the SQL commands history for all connections! Do you really want to proceed? - + Clear history Limpiar historial - + Save history - + Reload history - + Find in history - + Hide find tool - + This action will wipe out all the SQL commands history for the current connection! Do you really want to proceed? @@ -12113,20 +12480,20 @@ modos se describen a continuación. - - + + Currently selected object(s) - - + + Dimensions of the selected object(s) - - + + Current zoom factor @@ -12162,40 +12529,50 @@ modos se describen a continuación. SequenceWidget - + Cyclic: Cíclico: - + Start: Inicio: - + Maximum: Maximo: - + Minimum: Minimo: - + + Defualt values: + + + + Increment: Incremento: - + Cache: Cache: - + Owner Col.: Dueño Col.: + + + User defined + + SnippetsConfigWidget @@ -12372,82 +12749,77 @@ modos se describen a continuación. PostgreSQL - + iconecodigo iconecodigo - + SQL SQL - + Code display: Visualización de Código: - + Original Originales - + Original + depedencies' SQL Originales + SQL dependientes - + Original + children's SQL Originales + SQL hijos - + Save the SQL code to a file. Guardar el código SQL code para un archivo. - + Save SQL Guardar SQL - + XML XML - - - Type: - Tipo: - Source code visualization Visualización del código fuente - + <strong>Original:</strong> displays only the original object's SQL code.<br/><br/> <strong>Dependencies:</strong> displays the original code including all dependencies needed to properly create the selected object.<br/><br/> <strong>Children:</strong> displays the original code including all object's children SQL code. This option is used only by schemas, tables and views. - + Save SQL code as... Guardar código SQL como... - + SQL code (*.sql);;All files (*.*) Código SQL (*.sql);;Todos los archivos (*.*) - + Generating source code... Generación de código fuente... - + -- NOTE: the code below contains the SQL for the selected object -- as well for its dependencies and children (if applicable). -- @@ -12472,19 +12844,19 @@ modos se describen a continuación. - + -- SQL code purposely truncated at this point in demo version! - + -- SQL code unavailable for this type of object -- -- Código SQL disponible para este tipo de objeto -- - + <!-- XML code preview disabled in demonstration version --> <!-- Código XML previsualización desactivado en la versión de demostración --> @@ -12571,12 +12943,12 @@ modos se describen a continuación. Table - + new_table nueva_tabla - + In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2' En la demostración mesas versión sólo pueden tener `%1' instancias de cada tipo de objeto hijo o antepasado de la tabla! Tienes que llegar a este límite para el tipo: `%2' @@ -12589,104 +12961,179 @@ modos se describen a continuación. - + + Copy items on the grid + + + + + Copy + + + + Add empty rows - + + Add row + + + + Ins Ins - + + Delete column + + + + + Paste items on the grid + + + + + Paste + Pegar + + + + Ctrl+V + Ctrl+V + + + Fills the grid using a CSV file - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + + <html><head/><body><p>Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <span style=" font-weight:600;">INSERT</span> commands.</p></body></html> + + + + + Add column + + + + + Duplicate rows + + + + + Change the values of all selected cells at once + + + + + Bulk data edit + + + + + Ctrl+E + Ctrl+E + + + + Delete all columns + + + + + Delete rows - - Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> - + Add an empty column - + Remove all rows from the grid preserving columns - + + Delete all rows + + + + Shift+Del Shift+Del - + Delete the selected rows - - + + Del Del - + Duplicate the selected rows - + Ctrl+D - + Delete the selected columns - + Remove all columns (and rows) from the grid - + Ctrl+Shift+Del - + Delete columns is an irreversible action! Do you really want to proceed? - + Remove all rows is an irreversible action! Do you really want to proceed? - + Remove all columns is an irreversible action! Do you really want to proceed? - - + + Unknown column - + Duplicated column @@ -12694,7 +13141,7 @@ modos se describen a continuación. TableObjectView - + Relationship: %1 @@ -12709,162 +13156,213 @@ Relación: %1 Opciones - + Tag: Tag: - + With OID Con OIDs - + Generate ALTER for columns/constraints Generar ALTER para columnas/restricciones - + Unlogged Invitados - + + Enable row level security + + + + + Force RLS for owner + + + + &Columns &Columnas - + Co&nstraints - + Tri&ggers - + &Rules &Reglas - + &Indexes &Indíces - + + &Policies + + + + &Tables &Tablas - + Edit data Editar datos - + Define initial data for the table Definir los datos iniciales de la tabla - - - - - - + + + + + + + Name Nombre - + Schema Esquema - - - + + + Type Tipo - + PK - + Default Value Valor por defecto - + Attribute(s) Atributo(s) - + It is not possible to mark a column as primary key when the table already has a primary key which was created by a relationship! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. - + It is not possible to mark a column created by a relationship as primary key! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. - + ON DELETE ON DELETE - + ON UPDATE ON UPDATE - + Refer. Table Tabla Refer - + Firing Firing - + Events Eventos - + Execution Ejecución - + Event Evento - + Indexing Indezado - + + Command + + + + + Permissive + + + + + USING expression + + + + + CHECK expression + + + + + Roles + Roles + + + Parent Padre - + Copy Copia + + + Yes + Si + + + + No + No + TablespaceWidget @@ -12964,7 +13462,7 @@ Relación: %1 Subrayado - + Select text color Seleccionar color del texto @@ -13389,132 +13887,162 @@ Relación: %1 Referencias - + Expression Alias: Alias Expresión: - + Column: Columna: - + Table: Tabla: - + Table Alias: Alias Tabla: - + Used in: Usado en: - + Column Columna - + Expression Expresión - + Reference Type: Tipo de Referencia: - - SELECT-FROM - SELECT-FROM + + View Definition + Definición de Vista + + + + Expression: + Expresión: + + + + Column Alias: + Alias de Columna: + + + + The element will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns + - - FROM-WHERE - FROM-WHERE + + SELECT ... + - - After WHERE - After WHERE + + The element will be used as part of the WHERE clause in form of conditional expression + - View Definition - Definición de Vista + WHERE ... + - - Expression: - Expresión: + + The element is used in the FROM portion of the command in order to reference tables or construct JOIN statements + - Column Alias: - Alias de Columna: + FROM ... + + + + + The element's expression is used exclusively as the view's definition + + + + + The element will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements + + + + + End expression + - + Triggers Triggers - + Rules Reglas - + Indexes Índices - + Table Expression Expresión de tabla - + Code Preview Vista previa código - + Options Opciones - + Tag: Tag: - + Mode: Modo: - + Ordinary Ordinario - + Recursi&ve - + &Materialized - + With no data Sin datos @@ -13535,8 +14063,8 @@ Relación: %1 - Flags: SF FW AW VD - Banderas: SF FW AW VD + Flags: SF FW AW EX VD + @@ -13581,7 +14109,7 @@ Relación: %1 Evento - + /* Could not generate the SQL code. Make sure all attributes are correctly filled! / * No se pudo generar el código SQL. Asegúrese de que todos los atributos se rellenan correctamente! diff --git a/lang/fr_FR.qm b/lang/fr_FR.qm index 7b1f0ecfd4496306b88ed58dc09713d7396eb7e5..ebcebe06c4f11bb7b0d25473ab5f1c1614e59c74 100644 GIT binary patch literal 411925 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 NvVVdjA3t&I{{Xkh%ZC5} delta 47616 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 Uzt|Sc3KvTQyR-jD>yY;U0ID%TCIA2c diff --git a/lang/fr_FR.ts b/lang/fr_FR.ts index c10f2c124d..ba610dacee 100644 --- a/lang/fr_FR.ts +++ b/lang/fr_FR.ts @@ -4,661 +4,647 @@ AboutWidget + About pgModeler À propos de pgModeler - PostgreSQL Database Modeler - PostgreSQL Database Modeler - - - Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. - Outil de modéliation entité-association pour PostgreSQL. Plus aucun ordre LDD à saisir à la main, laissez PgModeler le faire pour vous ! Ce logiciel fusionne le concept de modélisation entité-association et toutes les fonctionnalités étendues que propose PostgreSQL en plus des standards SQL. - - - Design, configure, deploy - Concevoir, configurer, déployer - - - <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" font-size:11pt; font-style:italic; text-decoration: underline; color:#0057ae;">http://pgmodeler.com.br</span></a></p></body></html> - <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" font-size:11pt; font-style:italic; text-decoration: underline; color:#0057ae;">http://pgmodeler.com.br</span></a></p></body></html> - - - pgModeler is proudly a brazilian software! - pgModeler est un logiciel brésilien et fier de l'être! - - - <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - - - Contributors - Contributeurs - - - <html><head/><body><p>This page is dedicated to all contributors who gave a bit of their time in make pgModeler a better software somehow. The complete list of people that helped pgModeler can be found at <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>If you have a great idea to improve pgModeler please submit it <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">here</span></a>. No ideas for now but want to help? Why not donate a few bucks <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">here</span></a>!?</p></body></html> - <html><head/><body><p>Cette page est dédiée à tous les contributeurs qui ont donné un peu de leur temps afin de rendre ce logiciel meilleur d'une manière ou d'une autre. La liste complète des personnes est disponible sur <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>Si vous avez une idée géniable afin d'améliorer pgModeler n'hésitez pas à la soumettre <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">ici</span></a>. Vous n'avez pas d'idée mais vous voulez aider ? Pourquoi ne pas un don <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">ici</span></a> !?</p></body></html> - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - 6 - 6 - - - Name - Nom - - - Country - Pays - - - Contribution - Contribution - - - Damien Degois - Damien Degois - - - France - France - - - French UI translation and several improvements in auxiliary scripts. - Francisation IHM et amélioration de scripts. - - - Ji Bin - Ji Bin - - - China - Chine - - - Chinese UI translation and small fixes. - Traduction en lagnue chinoise et quelques corrections. - - - Pierre-Samuel LE STANG - Pierre-Samuel LE STANG + + 0.0.0 + 0.0.0 - French UI translation. - Francisation IHM. + + build: + - Lisandro Damián Nicanor - Lisandro Damián Nicanor + + PostgreSQL Database Modeler + Modeleur de base de données PostgreSQL - Argentina - Argentine + + Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. + Outil open source de modélisation de bases de données PostgreSQL. Plus aucun ordre LDD à saisir à la main, laissez pgModeler le faire pour vous ! Ce logiciel fusionne le concept de modélisation entité-association et toutes les fonctionnalités étendues que propose PostgreSQL en plus des standards SQL. - Russia - Russie + + <html><head/><body><p>Copyright 2006-2018 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.io</span></a>&gt;</p></body></html> + - N/A - Inconnu + + pgModeler is proudly a brazilian software! + pgModeler est un logiciel brésilien et fier de l'être ! - Hide this widget - Cacher ce widget + + <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" text-decoration: underline; color:#2980b9;">https://pgmodeler.io</span></a></p></body></html> + + ... ... - 0.0.0.0 - 0.0.0.0 - - - License - Licence - - - Build: - Build: - - - (CODE_NAME) - - - + (BUILD_NUM) - - - - Improvements on build scripts enabling the custom packaging in Linux distros; Per-user settings; pgModeler's package maintainer in Debian Linux. - - - - Pavel Alexeev - - - - Additional work for packaging in Linux distros; pgModeler's package maintainer in Fedora Linux. - - - - Mariusz Fik - - - - Poland - - - - Custom packaging first ideas. Tester of first version of custom packaging patch. - - - - <a href="http://pgmodeler.com.br">http://pgmodeler.com.br</a> - - - - <html><head/><body><p>Copyright 2006-2016 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> {2006-2016 ?} {0057a?} - - - 7 - 7 - - - 8 - 8 - - - Jonathan DUPRE - - - - Gilberto Castillo - + - Cuba - + + License + - Spanish UI translation. - + + Hide this widget + Cacher ce widget AggregateWidget - Form - Formulaire - - + Final Function: - Fonction finale: + Fonction finale : + Sort Operator: - Opérateur de tri: + Opérateur de tri : + Initial Condition: - Condition initiale: + Condition initiale : + Funtion Inputs Entrées de la fonction + Function State État de la fonction + Transition Func.: - Fonction de transition: + Fonction de transition : + Input Data Type Type de donnée en entrée + State Data Type Type de donnée d'état + An aggregate function that accepts the types <em><strong>typeA</strong></em> and <em><strong>typeB</strong></em> as input types and which type of state is <em><strong>state_type</strong></em>, must obey the following rules: <br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Final Function:</strong> <em>void final_function(<strong>state_type</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Transition Function:</strong> <em><strong>state_type</strong> transition_function(<strong>state_type</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> - Une fonction d'agrégation qui accepte les types <em><strong>typeA</strong></em> et <em><strong>typeB</strong></em> comme types d'entrées et dont le type d'état est <em><strong>type_etat</strong></em>, doit obéir aux règles suivantes:<br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Fonction Finale:</strong> <em>void fonction_finale(<strong>type_etat</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Fonction de Transition,:</strong> <em><strong>type_etat</strong> fonction_transition(<strong>type_etat</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> + Une fonction d'agrégat qui accepte les types <em><strong>typeA</strong></em> et <em><strong>typeB</strong></em> en types d'entrée et dont le type d'état est <em><strong>state_type</strong></em>, vous devez respecter les règles suivantes : <br/> <strong>&nbsp;&nbsp;&nbsp;• Fonction finale : </strong><em>void final_function (<strong>state_type</strong>)</em><br/> <strong>&nbsp;&nbsp;&nbsp;• Fonction de transition: </strong><em><strong>state_type</strong> transition_function(<strong>state_type</strong>,<strong>typeA</strong>, <strong>typeB</strong>)</em> AppearanceConfigWidget + Form Formulaire + Element: - Élement: + Élément : + Global: Font style - Global: Style de police + Global : Style de police + Global: Constraints descriptor - Global: Marqueurs de contraintes + Global : Marqueurs de contraintes + Global: Object selection - Global: Selection d'objet + Global : Sélection d'objet + Global: Position hint text - Global: Texte de la boite de coordonées + Global : Texte de la boite de coordonnées + Global: Position hint box - Global: Fond de la boite de coordonées + Global : Fond de la boite de coordonnées + Global: Objects type - Global: Type de colonne + Global : Type de colonne + Global: Lock arc - Global: Cadenas (objet vérouillé, couleur de l'arceau) + Global : Cadenas (objet verrouillé, couleur de l'arceau) + Global: Lock body - Global: Cadenas (objet vérouillé, couleur du corps) + Global : Cadenas (objet verrouillé, couleur du corps) + Table: Schema name - Table: Nom du schema + Table : Nom du schéma + Table: Table name - Table: Nom de la table + Table : Nom de la table + Table: Columns box - Table: Zone des colonnes + Table : Zone des colonnes + Table: Extended attributes box - Table: Zone d'attributs étendus + Table : Zone d'attributs étendus + Table: Title box - Table: Zone de titre + Table : Zone de titre + Rule: Name - Règle: Nom + Règle : Nom + Rule: Descriptor - Règle: Couleur de l'icône + Règle : Couleur de l'icône + Index: Name - Index: Nom + Index : Nom + Index: Descriptor - Index: Couleur de l'icône + Index : Couleur de l'icône + Trigger: Name - Déclencheur: Nom + Déclencheur : Nom + Trigger: Descriptor - Déclencheur: Couleur de l'icône + Déclencheur : Couleur de l'icône + View: Schema name - Vue: Nom du schema + Vue : Nom du schéma + View: View name - Vue: Nom de la vue + Vue : Nom de la vue + View: References box - Vue: Couleur d'arriere plan + Vue : Couleur d'arrière plan + View: Extended attributes box - Vue: Dialogue des attributs étendus + Vue : Dialogue des attributs étendus + View: Title box - Vue: Couleur d'arriere plan de la barre de titre + Vue : Couleur d'arrière plan de la barre de titre + View: Table / columns alias - Vue: Alias de table / colonne + Vue : Alias de table / colonne + View: Referenced column - Vue: Colonne référencée + Vue : Colonne référencée + View: Referenced table - Vue: Table référencée + Vue : Table référencée + View: Reference descriptor - Vue: Couleur de l'icône des références + Vue : Couleur de l'icône des références + Textbox: Body - Zone de texte: Corps + Zone de texte : Corps + Column: Column name - Colonne: Nom de la colonne + Colonne : Nom de la colonne + Column: Descriptor - Colonne: Couleur de l'icône + Colonne : Couleur de l'icône + Column: Included / Inherited by relationship - Colonne: Incluses / Héritées par associations + Colonne : Incluses / Héritées par associations + Column: Protected - Colonne: Protégée + Colonne : Protégée + Column (pk): Column name - Colonne (pk): Nom de la colonne + Colonne (pk) : Nom de la colonne + Column (pk): Descriptor - Colonne (pk): Couleur de l'icône + Colonne (pk) : Couleur de l'icône + Column (fk): Column name - Colonne (fk): Nom de la colonne + Colonne (fk) : Nom de la colonne + Column (fk): Descriptor - Colonne (fk): Couleur de l'icône + Colonne (fk) : Couleur de l'icône + Column (uq): Column name - Colonne (uq): Nom de la colonne + Colonne (uq) : Nom de la colonne + Column (uq): Descriptor - Colonne (uq): Couleur de l'icône + Colonne (uq) : Couleur de l'icône + Column (nn): Column name - Colonne (nn): Nom de la colonne + Colonne (nn) : Nom de la colonne + Column (nn): Descriptor - Colnne (nn): Couleur de l'icône + Colonne (nn) : Couleur de l'icône + Relationship: Descriptor - Associations: Couleur de l'icône + Associations : Couleur de l'icône + Relationship: Label text - Associations: Texte de l'étiquette + Associations : Texte de l'étiquette + Relationship: Label box - Relations: Arrière plan de l'étiquette + Relations : Arrière plan de l'étiquette + Relationship: Attribute text - Relations: Texte des attributs + Relations : Texte des attributs + Relationship: Attribute descriptor - Relations: Couleur de l'icône des attributs + Relations : Couleur de l'icône des attributs + Tag: Name Nom + Tag: Body Corps + Font: - Police: + Police : + pt pt + Bold Gras + Italic Italique + Colors: - Couleur: + Couleur : + Underline Souligné + Placeholder: Body - + Placeholder : Corps + + + + Constraint: Name + Contrainte : Nom + + + + Constraint: Descriptor + Contrainte : Descripteur Application + Unknown exception caught! - Exception inconnue générée! + Exception inconnue générée ! + Failed to create initial configuration in `%1'! Check if the current user has write permission over that path and at least read permission over `%2'. - Impossible de créer les fichiers de configuration initiale dans `%1'! Vérifiez si vous avez la permission d'écriture dans ce dossier. Vérifiez l'existence et d'avoir les droits en lecture sur le dossier `%2'. + Impossible de créer les fichiers de configuration initiaux dans `%1' ! Vérifiez que le dossier existe que vous avez la permission d'écriture dans `%2'. + + + + BaseConfigWidget + + + A backup of the previous settings was saved into <strong>%1</strong>! + Une sauvegarde des paramètres précédents a été enregistrée dans <strong>%1</strong> ! BaseForm + Dialog Dialogue + + &Apply &Appliquer - &Cancel - A&nnuler - - + &Ok &Ok + + &Cancel + A&nnuler + + + %1 properties - + %1 propriétés BaseObject + Column Colonne + Constraint Contrainte + Function Fonction + Trigger Déclencheur + Index Index + Rule Règle + Table Table + View Vue + Domain Domaine + Schema Schéma + Aggregate Fonction d'agrégat + Operator Opérateur + Sequence Séquence + Role Rôle + Conversion Convertion + Cast Convertion de type + Language Langage + Type Type + Operator Family Famille d'opérateurs + Operator Class Classe d'opérateurs + Database Base de données + Extension Extension + Relationship Relation + Collation Collation + Textbox - Zone de texte + Boite de texte + Event Trigger Déclencheur sur évènement + + Policy + Politique + + + Permission Permission + Parameter Paramètre + Type Attribute Attribut de type + Basic Relationship Relation simple + Tag - Tag + Balise + + + + Generic SQL + SQL générique + new_object - IMPOSSIBLE ! PROBLEME AU LANCEMENT SI %N EST PRESENT nouvel_objet nouveaux_objets + Tablespace - Intuitif - Tablespace + Espace de stockage BaseObjectView + SQL off SQL désactivé @@ -666,287 +652,293 @@ BaseObjectWidget - Form - Formulaire - - + Name: - Nom: + Nom : + ID: - Identifiant: + Identifiant : + icone icône + Comment: - Commentaire: + Commentaire : + Tablespace: - Tablespace: + Espace de stockage : + Edit object's permissions - Editer les permissions de l'objet + Modifier les permissions de l'objet + Disables the generated SQL code using comment tokens (--). This will disable the code of all child and referrer objects. - Désactivez le SQL généré en utilisant les marqueurs de commentaire (--). -Ceci désactivera le SQL pour les objets enfants dont cet objet est le parent. + Désactivez le code SQL généré en utilisant les marqueurs de commentaire (--). +Ceci désactivera également le code SQL pour ses objets enfants. + Append or prepend a set of SQL commands to the object's definition. - Doutes Ajouter des commandes SQL avant ou après la définition de cet objet. + Custom SQL Code SQL Libre + Owner: - Propriétaire: + Propriétaire : + Schema: - Schéma: + Schéma : + Disable SQL code Désactiver le code SQL + Collation: - Collation: + Collation : + Edit permissions - Editer les permissions + Modifier les permissions + This object is protected thus no change in form will be applied to it. - L'objet est vérouillé, par conséquent aucun changement dans le formulaire ne lui sera appliqué. - - - Create / Edit: - Créer / Éditer: + L'objet est verrouillé, par conséquent aucun changement dans le formulaire ne lui sera appliqué. + Required field. Leaving this empty will raise errors! - Champ requis. Laisser ce champ vide génèrera une erreur! + Champ requis. Laisser ce champ vide génèrera une erreur ! + Value(s) Valeur(s) + Version - Version - - - The <em style='color: %1'><strong>highlighted</strong></em> fields on the form are available only on specific PostgreSQL versions. When generating SQL code for versions other than those specified on fields' tooltips pgModeler will ignore their values. - Les champs en <em style='color: %1'><strong>surbrillance</strong></em> dans le formulaire sont disponibles pour certaines versions de PostgreSQL uniquement. Ils seront ignorés s'il est demandé un export SQL pour une version de PostgreSQL non spécifiée dans l'infobulle du champ. + + The <em style='color: %1'><strong>highlighted</strong></em> fields in the form or one of their values are available only on specific PostgreSQL versions. Generating SQL code for versions other than those specified in the fields' tooltips may create incompatible code. - + Les champs <em style='color:%1'><strong>en surbrillance</strong></em> dans le formulaire ou de l'une des valeurs ne sont disponibles que sur des versions spécifiques de PostgreSQL. La génération de code SQL pour des versions autres que celles spécifiées dans les info-bulles des champs peut créer un code incompatible. BaseRelationship + rel_%1_%2 rel_%1_%2 + + BaseTableView + + + Toggles the extended attributes display + (Dés)activer l'affichage des attributs étendus + + + + Connected rels: %1 + Rels connectés : %1 + + BugReportForm + Bug Report Signaler un bug + Bug report Signaler un bug + Create Créer + &Cancel A&nnuler + Use the form below to generate a complete bug report. Please, try to be as clear as possible when describing the actions that can reproduce the bug. Additionally, it's important to attach a sample database model so that the bug can be quickly discovered and fixed! Utilisez le formulaire ci-dessous pour générer un rapport d'erreur complet. Merci d'être le plus clair possible dans la description de vos actions afin que le bug puisse être reproduit. De plus, il est important de joindre un modèle de base dans lequel le bug puisse être rapidement découvert, et par la même occasion rapidement corrigé ! + Report Rapport + Issue details Détails du problème + Output: Sortie : + Select the report's output folder Sélectionnez un dossier de sortie pour écrire le rapport d'erreur + + ... ... + <html><head/><body><p>If you prefer it's possible to report this issue anytime on pgModeler's project repository at <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#0057ae;">GitHub</span></a>. </p></body></html> - <html><head/><body><p>Il vous est également possible de signaler un bug à tout moment via le dépôt du projet pgModeler sur <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#0057ae;">GitHub</span></a>. </p></body></html> + <html><head/><body><p>Il vous est également possible de signaler un bug à tout moment via le dépôt du projet pgModeler sur <a href="http ://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration : underline; color :#0057ae;">GitHub</span></a>. </p></body></html> + Database Model Modèle de base - In none occasion the models sent within the report will be published. They are kept safe and are used only for debug purpose. - Les modèles de base de données joints avec les rapports d'erreur NE SONT EN AUCUN CAS publiés. Ils ne sont utilisés qu'à des fins de debogage. - - + Attach the below database model file to be debugged. Joindre le fichier modèle ci-dessous pour débogage. + Attach a different database model Joindre un autre modèle de base + Bug report successfuly generated! Please, send the file <strong>%1</strong> to <em>%2</em> in order be analyzed. Thank you for the collaboration! Le rapport de bug a été généré avec succès ! S'il vous plait, veuillez envoyer le fichier <strong>%1</strong> à <em>%2</em> pour expertise. Merci de votre collaboration ! + Load model - Sélectionner un modèle + Charger un modèle + Database model (*.dbm);;All files (*.*) Modèle de base de données (*.dbm);; Tous les fichiers (*.*) + Select report output folder - Sélection du dossier de sortie + Sélectionner le dossier de sortie du rapport - CastWidget + BulkDataEditWidget - Form - Formulaire + + Bulk data edit + Modification de données en masse + + + CastWidget + Conversion Func.: - Fonction de conversion: + Fonction de conversion : + Cast Type: - Conversion de type: - - - Explicit - Explicite - - - Implicit - Implicite + Conversion de type : + Assignment Affectation + Input / Output Entrée / Sortie + Source data type Type de donnée source + Target data type Type de donnée cible + The function to be assigned to a cast from <em><strong>typeA</strong></em> to <em><strong>typeB</strong></em> must have the following signature: <em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. - La fonction à affecter à une convertion de <em><strong>typeA</strong></em> vers <em><strong>typeB</strong></em> doit avoir la signature suivante: <em><strong>typeB</strong> fonction(<strong>typeA</strong>, integer, boolean)</em>. + La fonction convertissant de <em><strong>typeA</strong></em> vers <em><strong>typeB</strong></em> doit avoir la signature suivante : <em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. + I&mplicit - + I&mplicite + E&xplicit - - - - - Catalog - - Object type: %1 - ? - - Type d'objet: %1 - Types d'objets: %1 - - - - - CentralWidget - - Form - Formulaire - - - New model - Nouveau modèle - - - Open model - Ouvrir modèle - - - Sample models - Modèles de démo - - - Recent models - Modèles récents - - - Last session - Dernière session + E&xplicite CodeCompletionWidget - Make persistent - Rentre persistant + + Make &persistent + Rendre &persistant + Makes the widget closable only by ESC key or mouse click on other controls. Rendre ce widget refermable uniquement par la touche Échap ou par un clic sur les autres contrôles. + SQL Keyword Mot-clé SQL + (no items found.) (aucun élément trouvé.) @@ -954,30 +946,33 @@ Ceci désactivera le SQL pour les objets enfants dont cet objet est le parent. CollationWidget - Form - Formulaire - - + Locale: - Locale: + Locale : + Encoding: - Encodage: + Encodage : + LC_COLLATE: - LC_COLLATE: + LC_COLLATE : + LC_CTYPE: - LC_CTYPE: + LC_CTYPE : + The fields <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong>, <strong><em>LC_COLLATE & LC_CTYPE</em></strong> are mutually exclusive, so you have to set only one of them in order to properly handle a collation. - Les champs <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong> et <strong><em>LC_COLLATE & LC_CTYPE</em></strong> sont mutuellement exclusifs, vous ne devez en définir qu'un de manière à gérer correctement la collation. + Les champs <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong> et <strong><em>LC_COLLATE & LC_CTYPE</em></strong> sont mutuellement exclusifs, vous ne devez en définir qu'un seul de manière à gérer correctement la collation. + + Not defined Non défini @@ -985,18 +980,22 @@ Ceci désactivera le SQL pour les objets enfants dont cet objet est le parent. ColorPickerWidget + Form Formulaire + Generate random color(s) Génération aléatoire de couleur(s) + Alt+R Alt+R + Select color Sélectionner une couleur @@ -1004,2272 +1003,3003 @@ Ceci désactivera le SQL pour les objets enfants dont cet objet est le parent. ColumnWidget - Form - Formulaire - - + Default Value: - Valeur par défaut: + Valeur par défaut : - Expression: - Expression: + + E&xpression: + E&xpression : - NOT NULL - Non-Null + + &NOT NULL + &NON NULL - Sequence: - Séquence: + + Se&quence: + Sé&quence : - E&xpression: + + Edit the underlying sequence's attributes - &NOT NULL + + Edit sequence - Se&quence: - + + Identity: + Identité : ConfigurationForm + pgModeler Configuration Paramètres de pgModeler + Relationships Associations + Appearance Apparence + Connections Connexions + Snippets - Snippets + Extraits de code + &Apply &Appliquer + &Cancel A&nnuler + Defaults Défauts + General Général + Plug-ins Extensions - Any modification made until now in the current section will be lost! Do you really want to restore default settings? - Toutes les modifications réalisées jusqu'à présent dans la section actuelle seront perdues! Souhaitez vous réellement restaurer les paramètres par défaut? + + In some cases restore the default settings related to it may solve the problem. Would like to do that? + Dans certains cas, restaurer les paramètres liés par défaut peut résoudre le problème. Voulez-vous le faire ? + + + + Restore + Restaurer - - - Connection - ERROR: trying to open an already stablished connection. - ERREUR: impossible de démarrer une connection déjà établie. + + Any modification made until now in the current section will be lost! Do you really want to restore default settings? + Toutes les modifications réalisées jusqu'à maintenant dans la section actuelle seront perdues ! Souhaitez-vous réellement restaurer les paramètres par défaut ? ConnectionsConfigWidget - Form - Formulaire - - + Connections: - Connexions: + Connexions : + Create new connection Créer une nouvelle connexion + Cancel edition Annuler l'édition + Duplicate the selected connection Dupliquer la connexion sélectionnée + Edit selected connection - Editer la connexion sélectionnée + Modifier la connexion sélectionnée + Delete selected connection Supprimer la connexion sélectionnée + Connection Alias: - Alias de la connexion: + Alias de la connexion : + Connection DB: - Nom de la base: + Nom de la base : + Host/Port: - Hôte/Port: + Hôte/Port : + User: - Utilisateur: + Utilisateur : + Password: - Mot de passe: + Mot de passe : + Timeout: - Délai d'expiration: + Délai d'expiration : + second(s) seconde(s) + SSL Mode: - Mode SSL: + Mode SSL : + Disable Désactivé + Allow Autorisé + Require Requis + AC verification Vérification des AC + Full verification Vérification complète + Client Certificate: - Certificat Client: + Certificat client : + ~/.postgresql/postgresql.crt ~/.postgresql/postgresql.crt + Automatically browses the named database when using this connection to manage databases on <strong>Manage</strong> view. - Parcourir et afficher automatiquement le contenu de la base de données indiquée ci-contre lors de l'utilisation de cette connexion dans le <strong>Manager</strong>. + Parcourt automatiquement la base de données nommée lors de l'utilisation de cette connexion pour gérer les bases de données dans la vue <strong>Gérer</strong>. + Auto browse Toujours montrer + Client Key: - Clef client: + Clé client : + ~/.postgresql/postgresql.key ~/.postgresql/postgresql.key + Root Certificate: - Certificat racine: + Certificat racine : + ~/.postgresql/root.crt ~/.postgresql/root.crt + Revoked Certs.: - Liste de révocations: + Liste de révocations : + ~/.postgresql/root.crl ~/.postgresql/root.crl - Kerberus Server: - Serveur Kerberos: - - + Force GSSAPI Forcer GSSAPI - Options: - Options: - - + Add Ajouter + Update Mettre à jour + Test Tester + Success Succès - Connection successfuly stablished! - -Server details: - -PID: `%1' -Protocol: `%2' -Version: `%3' - Connexion établie avec succès! - -Détails du serveur : - -PID: `%1' -Protocole: `%2' -Version: `%3' - - - There is an unsaved connection! Want to save it? - Le paramétrage de la connexion n'a pas été sauvegardé! Voulez-vous enregistrer les changements? - - + + Edit database connections - + Modifier les connexions de la base de données + General - Général + Général + Other params: - + Autres paramètres : + Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. - + Spécifier des paramètres de connexion supplémentaires sous la forme [param]=[valeur]. Ces paramètres sont décrits dans le chapitre <strong>libpq</strong> de la doc de PostgreSQL. + Default for: - + Par défaut pour : + Diff - Différencier + Différencier + Export - Exporter + Exporter + Import - Importer + Importer + Validation - + Validation + Security - + Sécurité + Kerberos Server: - + Serveur Kerberos : + Indicates in which operations (diff, export, import or validation) the connection is used if none is explicitly specified by the user. - + Indique dans quelles opérations (differencier, exporter, importer ou validation) la connexion est utilisée si aucune n'est explicitement spécifiée par l'utilisateur. - There is a connection being created or edited! Do you want to save it? - - + + Connection successfully established! + +Server details: + +PID: `%1' +Protocol: `%2' +Version: `%3' + Connexion établie avec succès ! + +Détails du serveur : + +PID : `%1' +Protocole : `%2' +Version : `%3' + + + + There is a connection being created or edited! Do you want to save it? + Une connexion est en cours de création ou d'édition ! Voulez-vous la sauvegarder ? + + Found %1 connection(s) - + %1 connexion(s) trouvée(s) + No connections found - + Aucune connexion trouvée + Edit connections - + Modifier les connexions ConstraintWidget - Form - Formulaire - - + Constraint Type: - Type de contrainte: + Type de contrainte : + Fill Factor: - Taux de remplissage: + Taux de remplissage : + Match: - Comparaison: + Comparaison : + This attribute cannot be changed once the object is created. Cet attribut ne peut pas être modifié une fois l'objet créé. + Expression: - Expression: + Expression : + Deferrable: - Différable: + Reportable : + Deferral: - Report: + Report : + ON DELETE: - ON DELETE: + ON DELETE : + ON UPDATE: - ON UPDATE: + ON UPDATE : + Columns Colonnes + + Column: - Colonne: + Colonne : + Referenced Columns Colonnes référencées + Table: - Table: + Table : + Indexing: - Indexation: + Indexation : + Exclude Elements - Élements exclus + Éléments exclus + No inherit: - Pas d'héritage: + Pas d'héritage : + + Column Colonne + + Type Type + Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they can raise errors. To create primary key using columns included by relationship use the following options: identifier field, attributes & constraints tab or primary key tab on the relationship form. - Les colonnes inclues dans la relation de peuvent être ajoutées/retirés manuellement de la clef primaire sous peine d’erreur. Pour créer une clef primaire utilisant des colonnes contenues dans une relation, veuillez utiliser une des options suivantes: champ identifiant, l'onglet attributs et contraintes ou l'onglet clef primaire du formulaire de la relation. + Les colonnes inclues dans la relation ne peuvent être ajoutées/retirées manuellement de la clé primaire sous peine d’erreur. Pour créer une clé primaire utilisant des colonnes contenues dans une relation, veuillez utiliser une des options suivantes: champ identifiant, l'onglet attributs et contraintes ou l'onglet clé primaire du formulaire de la relation. ConversionWidget - Form - Formulaire - - + Source Encoding: - Encodage de la source: + Encodage de la source : + Target Encoding: - Encodage de la destination: + Encodage de la destination : + Conversion Func.: - Fonction de conversion: + Fonction de conversion : + Default Conversion: - Convertion par défaut: + Conversion par défaut : + The function to be assigned to an encoding conversion must have the following signature: <em>void function(integer, integer, cstring, internal, integer)</em>. - La fonction à affecter à une convertion d'encodage doit avoir la signature suivante: <em>void function(integer, integer, cstring, internal, integer)</em>. + La fonction de convertion d'encodage doit avoir la signature suivante : <em>void function(integer, integer, cstring, internal, integer)</em>. CrashHandlerForm + Crash Handler Gestionnaire d'incident + Stack trace - Piles d'exécution + Pile d'exécution + Input: - Entrée: + Entrée : + Load report file for analysis - Ouvrir un rapport d'erreur pour analyse + Charger un rapport d'erreur pour analyse + Save the attached model file on the filesystem - Sauvegarder le modèle joint sur le système de fichiers + Enregistrer le modèle joint sur le système de fichiers + pgModeler bug report (*.bug);;All files (*.*) Rapport de bug pgModeler (*.bug);;Tous les fichiers (*.*) + Load report - Ouvrir un rapport d'erreur + Charger un rapport + Save model Enregistrer le modèle + Database model (*.dbm);;All files (*.*) Modèle de base de données (*.dbm);; Tous les fichiers (*.*) + Crash handler Gestionnaire d'incident + Bug report analysis mode activated. Mode d'analyse de rapport d'erreur activé. + Oops! pgModeler just crashed! - Oh oh! pgModeler s'est planté ! + Oups ! pgModeler a planté ! + We apologize for what happened! It is clear that a nasty bug caused that. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. - Nous vous prions de nous excuser pour ce qui vient de se passer ! Il est clair qu'un vilain bug soit à l'origine de tout cela. Veuillez renseigner le formulaire ci-dessous en décrivant les actions qui vous avez faites avant que pgModeler ne sombre de manière inopinée. Ceci nous aidera à exterminer ce bug et ainsi améliorer le logiciel. + Veuillez nous excuser pour ce qui vient de se passer ! Il est clair qu'un vilain bug est à l'origine de tout cela. Veuillez renseigner le formulaire ci-dessous en décrivant les actions que vous avez faites avant que pgModeler ne sombre de manière inopinée. Cela nous aidera à exterminer ce bug et ainsi, à améliorer le logiciel. - CustomSQLWidget + CsvLoadWidget + Form - Formulaire + Formulaire + + + + Load CSV + Charger un fichier CSV + + + + CSV File: + Fichier CSV : + + + + Select output file + Sélectionner un fichier de sortie + + + + ... + + + + + Separator: + Séparateur : + + + + Use the first row as column names in the CSV file. By unchecking this option the first row is used as data. + Utiliser la 1ère ligne comme noms de colonne pour le fichier CSV. En décochant cette option, la 1ère ligne est utilisée comme données. + + + + Columns in the first row + Colonnes dans la 1ère ligne + + + + Load + Charger + + + + Semicolon (;) + Point virgule (;) + + + + Comma (,) + Virgule (,) + + + + Space + Espace + + + + Tabulation + + + + + Other + Autre + + + + ; + + + + + Text delimiter: + Délimiteur : + + + + " + + + + + Load CSV file + Charger un fichier CSV + + Comma-separted values (*.csv);;All files (*.*) + Valeurs séparées par une virgule (*.csv);;Tous les fichiers (*.*) + + + + CustomSQLWidget + + SQL code Code SQL + Puts an SELECT command template at current cursor position. Insère une commande SELECT à la position courante du curseur. + &SELECT &SELECT + Puts an INSERT command template at current cursor position. Insère une commande INSERT à la position courante du curseur. + &INSERT &INSERT + Puts an UPDATE command template at current cursor position. Insère une commande UPDATE à la position courante du curseur. + Puts an DELETE command template at current cursor position. Insère une commande DELETE à la position courante du curseur. + &DELETE &DELETE + &Clear E&ffacer + Append SQL Code SQL suffixé + + Append the SQL code at the very end of model definition. Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE command. Ajouter le code SQL à la toute fin de la définition du modèle Sinon (décoché) pgModeler ajoutera ce code après la commande SQL CREATE DATABASE. + Append at end of model definition. Suffixer à la fin de la définition du modèle. + Prepend SQL Code SQL préfixé + Prepend at beginning of model definition. Préfixer au tout début de la définition du modèle. + <html><head/><body><p>Use custom commands with extreme caution because you can change the semantics of the entire model when running SQL validation or export processes. Additionally, depending on the amount of commands, those processes can have their performance sensibly degradated.</p></body></html> <html><head/><body><p>Utilisez cet espace pour y inscrire vos commandes SQL personnalisées avec précaution. Vous pourriez créer des incohérences qui peuvent interférer avec les fonctionnalités de validation et d'export du modèle. De plus, selon la nature des commandes entrées ces fonctionnalités peuvent être ralenties.</p></body></html> - Append / Prepend SQL code - Code SQL préfixé/suffixé - - - Type: - Type: - - + Generic INSERT INSERT générique + Include serial columns - Inclure les colonnes de type "serial" + Inclure les colonnes en série + Exclude serial columns - Exclure les colonnes de type "serial" + Exclure les colonnes en série + Generic SELECT - SELECT générique + Faut-il le traduire ? + + Table SELECT - Table SELECT + Faut-il le traduire ? + + Generic UPDATE - UPDATE générique + Faut-il le traduire ? + + Table UPDATE - Table UPDATE + Faut-il le traduire ? + + Generic DELETE - DELETE générique + Faut-il le traduire ? + + Table DELETE - Table DELETE + Faut-il le traduire ? + + &UPDATE - &UPDATE + Faut-il le traduire ? + + Add custom SQL code - + Ajouter un code SQL personnalisé DataManipulationForm + Data Manipulation Édition des données + &Close &Fermer - Rows returned: - Lignes retournées: - - - 0 - 0 - - - Maximum limit of listed rows - Nombre maximum de lignes en retour de résulat - - - (Limit: 0) - (Limit: 0) - - - Empty values are assumed as <strong>DEFAULT</strong>. To use special values like <strong>NULL</strong>, a function call like <strong>now()</strong> or a specific data escaping, enclose values in <strong>&lt;&gt;</strong>. To use <strong>&lt;</strong> or <strong>&gt;</strong> as part of the value prepend the backslash character, e.g., <strong>\&lt;</strong> or <strong>\&gt;</strong>. - Les valeurs vides sont affichées en tant que <strong>DEFAULT</strong>. Pour utiliser les valeurs spéciales telles que <strong>NULL</strong>, un appel à une fonction comme <strong>now()</strong> ou toute autre fonction d'échappement spécifique, entourez ces valeurs/fonctions avec <strong>&lt;&gt;</strong>. Pour utiliser <strong>&lt;</strong> ou <strong>&gt;</strong> en tant que caractères à part entière, protégez-les avec un antislash : <strong>\&lt;</strong> ou <strong>\&gt;</strong>. - - + Refresh listing Actualiser la liste - Refresh - Actualiser - - + F5 F5 + Save changes Enregistrer les changements - Save - Enregistrer - - + Ctrl+S Ctrl+S - Copy the selection as CSV buffer - Copier la sélection avec un formatage de type CSV - - - Copy - Copier - - - Ctrl+C - Ctrl+C - - + Export results to CSV file Exporter les résultats vers un fichier CSV - Export - Exporter - - + Ctrl+X Ctrl+X + Undo modifications Annuler les modifications - Undo - Annuler - - + Ctrl+Z Ctrl+Z - Add data - Ajouter une ligne - - - Add - Ajouter - - + + Ins Ins + Mark the selected rows to be deleted Marquer les lignes sélectionner pour suppression - Delete - Supprimer - - + + + + + Del Suppr + Filter the result set Filtrer les résultats + Table: - Table: + Table : + Schema: - Schéma: + Schéma : + in dans + Hide views Masquer les vues + Filter expression Expression pour filtrer + Order && Limit - Order && Limit + Ordre && Limite + Column: - Colonne: + Colonne : + Limit in: - Limit : - - - 000000 - 000000 - - - 100 - 100 - - - results - lignes + Limite : + Add Item Ajouter un élément + Remove Item Supprimer un élément + Clear the order by columns list Effacer la liste + Move selected item up Déplacer vers le haut + Move selected item down Déplacer vers le bas + + Copy as CSV + Copier en CSV + + + + Copy as text + Copier en texte + + + + Copy items + Copier les éléments + + + + Pase items + Coller les éléments + + + + Browse tables + Navigateur de tables + + + + Duplicate row(s) + Dupliquer ligne(s) + + + + Delete row(s) + Effacer ligne(s) + + + + Edit cell(s) + Modifier cellule(s) + + + <em>(Limit: <strong>%1</strong>)</em> - <em>(Limit: <strong>%1</strong>)</em> + <em>(Limite : <strong>%1</strong>)</em> + + + + Column + Colonne + No objects found Aucun objet trouvé + Found %1 object(s) - %1 objets trouvés + %1 objet(s) trouvé(s) + Views can't have their data handled through this grid, this way, all operations are disabled. - Les données des vues ne sont pas modifiables par le biais de cette grille de résultats, de ce fait, aucune opération de modification n'est permise. + Les données des vues ne sont pas modifiables via cette grille, de ce fait, toutes les opérations sont bloquées. + The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. <strong>WARNING:</strong> those operations can affect more than one row. - La table sélectionnée ne comporte pas de clé primaire ! Les mises à jour et les suppressions seront réalisées en considérant que l'ensemble des colonnes constitue une clé primaire. <strong>ATTENTION:</strong> ces opérations peuvent affecter plus d'une ligne. + La table sélectionnée n'a pas sa propre clé primaire ! Les mises à jour et les suppressions seront réalisées en considérant que l'ensemble des colonnes constitue une clé primaire. <strong>ATTENTION :</strong> ces opérations peuvent affecter plus d'une ligne. + + + + Referenced tables + Tables référencées + + + + + (none) + (aucun) + + + + Referrer tables + Tables de référence + This row is marked to be %1 - Cette ligne est estampillée pour être %1 + Cette ligne est marquée pour être %1 + deleted - supprimée + supprimé + updated mise à jour + inserted - insérée + inséré + [binary data] [données binaires] + <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving? - <strong>ATTENTION:</strong> Une fois validés (Commit), il ne sera plus possible d'annuler les changements ! Sauvegarder les changements ? + <strong>ATTENTION :</strong> Une fois validés, il ne sera plus possible d'annuler les changements ! Sauvegarder les changements ? + + + + delete + effacer + update - update + mettre à jour + insert - insert + inserer + ASC - Intuitif ASC + DESC - Intuitif DESC - delete - delete - - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> - - - + Add empty rows - + Ajouter des lignes vides + Duplicate the selected rows - - - - Duplicate - + Dupliquer les lignes sélectionnées + Ctrl+D - + Ctrl+D + results (Use <strong>0</strong> for no limit) - + résultats (Utiliser <strong>0</strong> pour ne pas limiter) + <strong>WARNING: </strong> There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now? - + <strong>ALERTE :</strong> Des lignes modifiées attendent d'être soumises ! Voulez-vous vraiment les jeter et récupérer les données maintenant ? + Rows returned: <strong>%1</strong>&nbsp;&nbsp;&nbsp; - + Lignes retournées : <strong>%1</strong>&nbsp;&nbsp;&nbsp; + none - + aucun - - - DatabaseExplorerWidget - Form - Formulaire + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + <html><head/><body><p>Les valeurs vides sont supposées être <span style="font-weight :600;">DEFAULT</span>. Pour utiliser des valeurs spéciales comme <span style="font-weight :600;">NULL</span>, un appel de fonction comme <span style="font-weight :600;">now()</span> ou un échappement des données spécifiques, entourer les valeurs de deux barres obliques, par exemple <span style="font-weight :600;">/valeur/</span>. Pour utiliser une barre oblique dans le cadre de la valeur, ajouter le caractère barre oblique inverse, par exemple <span style="font-weight :600;">/</span>.</p></body></html> - Toggles the display of system objects. - Basculer l'affichage des objets système. + + Copy items on the grid + Copier les éléments sur la grille - Sys. objects - Objets syst. + + Paste items on the grid + Copier les éléments sur la grille - Toggles the display of extension objects - Basculer l'affichage des objets issus des extensions + + Ctrl+V + - Ext. objects - Objets ext. + + Browse referenced tables + Parcourir les tables référencées - Open the grid to visualize or edit data. - Ouvre l'éditeur de données. + + Add new rows from a CSV file + Ajouter de nouvelles lignes depuis un fichier CSV - Data &Grid - &Grille des données + + Change the values of all selected cells at once + Modifier d'un coup les valeurs de toutes les cellules sélectionnées - Alt+G - Alt+G + + Ctrl+E + Ctrl+E + + + DatabaseExplorerWidget - Open a new SQL execution pane. - Ouvre un nouvel onglet d'exécution SQL. + + Form + Formulaire - ... - ... + + + Data &Grid + &Grille des données - Ctrl+F5 - Ctrl+F5 + + + Alt+G + Alt+G - Update the objects tree. - Actualiser l'arbre des objets. + + + + + + ... + ... + Expands all items Ouvre tous les nœuds de l'arborescence + Collapses all items Ferme tous les nœuds de l'arborescence + Filter: - Filtrer: + Filtrer : + By OID Par OID + + Attribute Attribut + Value Valeur - Show raw attributes names - Afficher le nom réel des attributs - - + (not found, OID: %1) - (inconnu, OID: %1) + (OID: %1 non trouvé) + By value - Par valeur + Par valeur + Collatable - Collatable - - - Collation - Collation + Assemblable + + Constraint - Contrainte + Contrainte + Default - Défaut + Défaut + Definition - Définition - - - Dimension - Dimension + Définition + Element - Élement + Élément + Encrypted - Encrypté + Chiffré + Enumerations - Énumérations - - - Expression - Expression + Énumérations + Function - Fonction + Fonction + Language - Langage + Langage + Length - Longueur + Longueur + Library - Bibliothèque + Bibliothèque + Materialized - Matérialisée + Matérialisée + Name - Nom - - - Permissions - Permissions + Nom + Precision - Précision + Précision + Preferred - Préféré + Préféré + Schema - Schéma + Schéma + Storage Stockage + Superuser Super utilisateur + Tablespace - Espace de stockage logique - - - Type - Type + Espace de stockage + Unlogged - Unlogged + Déconnecté + Validity - Validité + Validité + Subtype - Sous-type + Sous-type - Arguments - Arguments + + + + Columns + Colonnes - Table - Table + + Event + Évènement - Columns - Colonnes + + Client encoding + Codage du client - Event - Evènement + + Configuration file + Fichier de configuration - Unique - Unique + + Data directory + Dossier de données - Snippets - Snippets + + Dynamic library path + Chemin de la bibliothèque dynamique - Drop object - Supprimer l'objet + + Dynamic shared memory + Mémoire partagée dynamique - Drop cascade - Supprimer en cascade + + Hba file + Fichier hba - Truncate - Truncate + + Listen addresses + Écouter des adresses - Trunc. cascade - Trunc. cascade + + Max. connections + Connexions max. - Show data + + Listen port + Écouter port + + + + Server encoding + Encodage serveur + + + + SSL ca file + Fichier ca SSL + + + + SSL cert file + Fichier cert SSL + + + + SSL crl file + Fichier crl SSL + + + + SSL key file + Fichier clé SSL + + + + Server version + Version serveur + + + + Ident file + Fichier d'identité + + + + Password encryption + Mot de passe de chiffrement + + + + Connection ID + ID connexion + + + + Server PID + PID serveur + + + + Server protocol + Protocole serveur + + + + Identity + Identité + + + + Command + Commande + + + + Roles + Rôles + + + + Show objects filter + Afficher les objets filtrés + + + + Show system objects + Afficher les objets système + + + + Show extension objects + Afficher les objets d'extension + + + + Snippets + Bouts de code + + + + Drop object + Supprimer l'objet + + + + Drop cascade + Supprimer en cascade + + + + Truncate + Tronquer + + + + Trunc. cascade + Tronquer en cascade + + + + Show data Afficher les données + Reload properties Recharger les propriétés + Update Mettre à jour - Do you really want to drop the object <strong>%1</strong> <em>(%2)</em>? - Voulez-vous vraiment supprimer l'objet <strong>%1</strong> <em>(%2)</em> ? + + -- Source code unavailable for this kind of object -- + -- Code source indisponible pour ce type d'objet -- - Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it? - Voulez-vous vraiment supprimer EN CASCADE l'objet <strong>%1</strong> <em>(%2)</em>? Cette action sera susceptible de supprimer en plus d'autres objets qui en dépendent. + + Do you really want to drop the object <strong>%1</strong> <em>(%2)</em>? + Voulez-vous vraiment supprimer l'objet <strong>%1</strong> <em>(%2)</em> ? + Do you really want to truncate the table <strong>%1</strong>? - Voulez-vous vraiment vider la table <strong>%1</strong> ? + Voulez-vous vraiment tronquer la table <strong>%1</strong> ? + Do you really want to <strong>cascade</strong> truncate the table <strong>%1</strong>? This action will truncate all the tables that depends on it? - Voulez-vous vraiment vider EN CASCADE la table <strong>%1</strong> <em>(%2)</em>? Cette action sera susceptible de supprimer d'autres lignes dans les tables qui en dépendent. + Voulez-vous vraiment tronquer en <strong>cascade</strong> la table <strong>%1</strong> ? Cette action tronquera toutes les tables qui en dépendent ! + Admin. roles - + Rôles admin. + Alignment - + Alignement + Analyze func. - + Fonc. d'analyse + Arg. count - + Nombre d'arg. + Arg. default count - + Nombre d'arg. par défaut + Arg. defaults - + Arg. par défaut + Arg. modes - + Modes des arg. + Arg. names - + Noms des arg. + Arg. types - + Types des arg. + Behavior type - + Type de comportement + Cast type - + Type de conversion + Category - + Catégorie + Comment - + Commentaire + Commutator Op. - + Commutateur Op. - Configuration - + + Collation + + Conn. limit - + Limite conn. + + + + Configuration + + Create DB - + Créer DB + Create role - + Créer rôle + Curr. version - + Version courante + Default value - + Valeur par défaut + Delimiter - + Délimiteur + Dest. type - + Type de dest. + + + + Dimension + + Directory - + Répertoire + Dest. encoding - + Encodage de dest. + Encoding - + Encodage + Exec. cost - + Exec. du coût + Op. family - + Famille d'op. + + + + Expression + + Final func. - + Fonc. finale + Func. type - + Type de fonc. + Handler func. - + Gestionnaire de fonc. + Handles type - + Type de poignées + Hashes + Index type - + Type d'index + Inherit - + Hérité + Ini. condition - + Condition ini. + Inline func. - + Func. en ligne + Input func. - + Fonc. d'entrée + Internal length - + Longueur interne + Interval type - + Type d'interval + I/O cast - + Conversion E/S + Join func. - + Fonc. de jointure + LC COLLATE + Faut-il le traduire ? + LC CTYPE + Faut-il le traduire ? + Leak proof - + Étanche + Left type - + Type gauche + Can login - + Peut se connecter + Member roles - + Rôles des membres + Merges - + Fusionne + Negator op. - + Négateur op. + Not null - + Non nul + Object type - - - - OID - + Type d'objet + With OIDs - + Avec OIDs + Old version + Ancienne version + + + + OID + Faut-il le traduire ? + Operator - + Opérateur + Operator func. - + Fonc. de l'opérateur + Output func. - + Func. de sortie + Owner - + Propriétaire + Owner column - + Colonne propriétaire + Parents - + + Password - + Mot de passe + + + + Permissions + + Range attributes - + Attributs de plage + Receive func. - + Fonc. de réception + Ref. roles - + Rôles de ref. + Replication - + Reproduction + Restriction func. - + Fonc. de restriction + Return type - + Type de retour + Returns SETOF - + Retours SETOF + Right type - + Type droit + Rows amount - + Montant des lignes + Security type - + Type de sécurité + Send func. - + Fonc. d'envoi + Sort op. - + Op. de tri + Source type - + Type de source + Src. encoding - + Encodage de la src. + State type - + Type d'état + Type mod. in func. - + Type de mod. dans la fonc. + Type mod. out func. - + Type de mod. hors fonc. + Transition func. - + Fonc. de transition + Trusted - + Fiable + Type attribute - + Attribut de type + + + + Type + + Types - + + Validator func. - + Fonc. de validateur + Windows func. - + Fonc. de fenêtre + false - + faux + true - + vrai + Cache value - + Valeur du cache - Cycle - + + Increment + Incrément - Increment - + + Cycle + + Max. value - + Valeur max + Min. value - + Valeur min + Start value - + Valeur de départ + Last value - + Dernière valeure + Op. class - + Classe d'op. + Canonical func. - + Fonc. de Canonical + Subtype diff func. - + Fonc de comparaison de sous-type + Deferrable - + Reportable + For each row - + Pour chaque ligne + Firing - + Déclencheur + On insert - + À l'insertion + + On delete - + À la suppression + + On update - + À la mise à jour + On truncate - + Au tronquage + + + + Arguments + + + + + Table + + Trigger func. - + Fonc. de déclenchement + Condition - + + Deferment - + Ajournement + Execution mode - + Mode d'exécution + Commands - Commandes + Commandes - Position - + + Comparison type + Type de comparaison - Comparison type - + + Position + + Ref. columns - + Colonnes de ref. + Expressions - + + Fill factor - + Facteur de remplissage + No inherit - + Non hérité + Op. classes - + Classes op. + Operators - + Opérateurs + Ref. table - + Table de ref. - Predicate - + + Unique + - Collations - + + Predicate + Prédicat + Inherited - + Hérité - System - + + Collations + - Extension - Extension + + SSL + - Open the grid to visualize or edit data - + + Referrers + Référents - Open a new SQL execution pane + + USING expr. + Faut-il le traduire ? - Ctrl+F6 - Ctrl+F6 - - - Update the objects tree + + CHECK expr. + Faut-il le traduire ? - Ctrl+S - Ctrl+S - - - Drop this database + + RLS enabled - Filters the currently loaded items in the tree by using a pattern and matching their names. If <strong>By OID</strong> is checked the pattern is interpreted as an integer value that represents the object id (OID). <br><br/><strong>HINT:</strong> if you need to search the entire database use the full refresh (<strong>Ctrl+F5</strong>) prior the filtering. + + RLS forced - Show raw attributes + + Also restart sequences - -- Source code not generated! Hit F7 or middle-click the item to load it. -- - + + + Warning + Avertissement + + + + You're running a demonstration version! The data manipulation feature is available only in the full version! + Vous utilisez une version de démonstration ! Cette fonctionnalité de manipulation de données est uniquement disponible dans la version complète ! + + + + <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? + <strong>ATTENTION :</strong> Vous êtes sur le point de supprimer l'intégralité de la base de données <strong>%1</strong> ! Toutes les données seront définitivement détruites. Voulez-vous vraiment le faire ? + + + + Open the grid to visualize or edit data + Ouvrir la grille pour visualiser ou modifier les données + + + + Open a new SQL execution pane + Ouvrir un nouveau panneau d'exécution de code SQL + + + + Ctrl+F6 + + + + + Update the objects tree + Mettre à jour l'arborescence des objets + + + + Drop this database + Supprimer cette base de données + + + + Filters the currently loaded items in the tree by using a pattern and matching their names. If <strong>By OID</strong> is checked the pattern is interpreted as an integer value that represents the object id (OID). <br><br/><strong>HINT:</strong> if you need to search the entire database use the full refresh (<strong>Ctrl+F5</strong>) prior the filtering. + Filtre les éléments actuellement chargés dans l'arborescence en utilisant un motif et en faisant correspondre leurs noms. Si <strong>Par OID</strong> est coché, le motif est interprété comme une valeur entière qui représente l'identifiant de l'objet (OID).<br><br/><strong>ASTUCE :</strong> si vous devez effectuer une recherche dans toute la base de données, utilisez l'actualisation complète (<strong>Ctrl+F5</strong>) avant le filtrage. + + + + Show raw attributes + Afficher les attributs brutes + + + + -- Source code not generated! Hit F7 or middle-click the item to load it. -- + -- Code source non généré ! Appuyer sur F7 ou faire un clic molette sur l'élément pour le charger. -- + Rename - Renommer + Renommer + Source code - Code source + Code source + Quick refresh - + Rafraîchissement rapide + Full refresh - + Rafraîchissement complet + Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it. - + Voulez-vous vraiment supprimer en <strong>cascade</strong> l'objet <strong>%1</strong><em> (%2)</em> ? Cette action supprimera tous les autres objets qui en dépendent. + Src. table: %1 Src. column(s): %2 - + Table src. : %1 +Colonne(s) src. : %2 + Ref. table: %1 Ref. column(s): %2 - + Table de ref. : %1 +Colonne(s) de ref. : %2 + -- Source code genaration for buil-in and base types currently unavailable -- - + -- Génération de code source pour les types intégrés et les type de base actuellement indisponibles -- + -- Source code unavailable for the object %1 (%2). -- - + -- Code source indisponible pour l'objet %1 (%2). -- + + + + Toggle the display of filter widget as well the system/extension objects. + (Dés)activer l'affichage du widget de filtre ainsi que les objets système/extension. + + + + Sort items alphabetically. When unchecked, items are sorted by OID. + Trier les éléments par ordre alphabétique. Lorsque ce n'est pas coché, les éléments sont triés par OID. + + + + Sort alphabetically + Trier par ordre alphabétique DatabaseImportForm - Database Import - Import d'une base de données - - + &Import &Importer + &Close &Fermer + Options Options - Starting point where objects will be put. - Point d'origine à partir duquel les objets seront créés sur le schéma. - - - Spacing: - Espacement: - - + Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. - Active l'importation des objets créés par les extensions. Généralement il n'y a pas lieu d'activer cette option sauf si des objets en base référencent directement ce type d'objet. + Active l'import des objets créés par les extensions. Généralement il n'y a pas lieu d'activer cette option sauf si des objets en base référencent directement ce type d'objet. + Import extension objects Importer les objets des extensions + Connection: - Connexion: + Connexion : + Ignore import errors Ignorer les erreurs + pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. - pgModeler ignorera les erreurs qui pourront survenir lors de l'importation et essayera de créer autant d'objets qui lui sera possible. En activant cette fonction le processus d'importation ne sera pas interrompu, toutefois vous pourrez vous retrouver avec un modèle incomplet. Cette option active la génération d'un fichier log dans le dossier temporaire de pgModeler. + pgModeler ignorera les erreurs qui pourront survenir lors de l'import et essayera de créer autant d'objets qui lui sera possible. En activant cette fonction le processus d'import ne sera pas interrompu, toutefois vous pourrez vous retrouver avec un modèle incomplet. Cette option active la génération d'un fichier log dans le dossier temporaire de pgModeler. + Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. - Active l'importation des objets système. Il est recommandé d'utiliser ce mode uniquement lorsque le reste du modèle y fait directement référence (afin de conserver une intégrité). ATTENTION : Ceci va entrainer la création de beaucoup d'élements qui peuvent rendre difficile la lecture du schéma, voir même provoquer un plantage de pgModeler en cas de saturation mémoire ou CPU. + Active l'importation d'objets intégrés au système. Il est recommandé de sélectionner uniquement les objets directement référencés par ceux à importer. AVERTISSEMENT : Essayer d'importer un grand nombre d'objets système peut gonfler le modèle résultant ou même planter pgModeler en raison de la surutilisation de la mémoire/cpu. + Import system objects Importer les objets système + Automatically resolve dependencies Résoudre automatiquement les dépendances - Resolve some of the object's dependencies by query the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types and extensions. - Résoudre certaines dépendances entre les objets en interrogeant le catalogue lorsqu'un objet n'existe pas dans la base à importer. Dans certains cas il vous sera nécessaire de combiner cette option avec celles ci-dessous. Cette option ne s'applique pas aux objets situés au niveau du cluster tels que les rôles, les tablespaces, les langues, les types de données ou encore les extentions. - - - Origin point: - Point d'origine: - - - Connect and list available databases - Connecter et lister les bases de données disponibles - - + + + + ... ... + Debug mode Activer le mode debug - All catalog queries as well the created objects' source code are printed to standard outupt (stdout). - Toutes les requêtes effectuées sur le catalogue ainsi que le code source de tous les objets créés sera affiché sur la sortie standard (stdout). - - - Spacing between objects - Espacement inter-objets - - - Schemas per row - Nombre maximal de schémas pouvant être placés sur une seule ligne (en longueur) - - - Tables per row: - Tables sur une ligne: - - - Schemas per row: - Schémas sur une ligne: - - - Tables per row - Nombre maximal de tables pouvant être placées sur une seule ligne (en longueur) - - - Database import - Importation d'une base (Base existante vers modèle) - - + Settings Paramètres + Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. - Coloriser les associations de manière aléatoire afin de faciliter l'identification des liens entre les tables, cela peut être utile sur de grands modèles. + Colorer les associations de manière aléatoire afin de faciliter l'identification des liens entre les tables, cela peut être utile sur de grands modèles. + Random colors for relationships - Coloriser les associations de manière aléatoire + Colorer les associations de manière aléatoire + Database Base de données + Select all objects Tout cocher + Clear object selection Tout décocher + Expands all items Développer tous les éléments + Collapses all items Replier tous les éléments + Filter: - Filtrer: + Filtrer : + Filter object by it's OID Filtrer un objet par son OID + By OID Par OID + Output Sortie + Progress label... Indicateur de progression... + Cancel Annuler + Retrieving objects from database... - Récupération des objets à partir de la base de données... + Récupération des objets depuis la base de données... + Importing process aborted! - Processus d'importation en erreur ! + Processus d'import abandonnée ! + Importing process canceled by user! - Processus d'importation interrompu par l'utilisateur ! + Processus d'import interrompu par l'utilisateur ! + Importing process sucessfuly ended! - Processus d'importation terminé avec succès ! + Processus d'import terminé avec succès ! + No databases found Aucune base de données trouvée + Found %1 database(s) %1 base(s) de données trouvée(s) + Retrieving cluster level objects... Récupération des objets du cluster... + Retrieving objects of schema `%1'... Récupération des objets du schéma `%1'... - Retrieving objects of table `%1'... - Récupération des objets de la table `%1'... + + Retrieving objects of `%1' (%2)... + Réccupération des objets de `%1' (%2)... + This is a PostgreSQL built-in data type and cannot be imported. - Ce type de données est déjà intégré nativement dans PostgreSQL. Il ne peut être importé. + C'est un type de données nativement intégré à PostgreSQL. Il ne peut être importé. + This is a pgModeler's built-in object. It will be ignored if checked by user. - Cet objet fait partie intégrante de pgModeler. Il sera ignoré même si vous le cochez. + C'est un objet nativement intégré à pgModeler. Il sera ignoré s'il est coché par l'utilisateur. + Create all imported objects in the current working model instead of create a new one. - + Créer tous les objets importés dans le modèle de travail actuel au lieu d'en créer un nouveau. + Import objects to the working model - + Importer les objets dans le modèle de travail en cours + <strong>ATTENTION:</strong> You are about to import objects to the current working model! This action will cause irreversible changes to it even in case of critical errors during the process. Do you want to proceed? - - - - Schemas per row - + <strong>ATTENTION :</strong> Vous êtes sur le point d'importer des objets dans le modèle de travail actuel ! Cette action entraînera des modifications irréversibles même en cas d'erreurs critiques au cours du processus. Voulez-vous poursuivre ? + Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. - + Résoudre certaines dépendances de l'objet en interrogeant le catalogue. Dans certains cas, il est nécessaire de combiner cette option avec les autres ci-dessous. Cette option ne s'applique pas aux objets du niveau de la base de données, tels que le rôle, l'espace de stockage et la langue, pour les types de données et les extensions. + All catalog queries as well the created objects' source code are printed to standard output (stdout). - + Toutes les requêtes de catalogue ainsi que le code source des objets créés sont imprimés sur la sortie standard (stdout). + + + + + Import database + Importer une base de données DatabaseImportHelper + Retrieving system objects... `%1' Récupération des objets système... `%1' + + Retrieving objects... `%1' Récupération des objets... `%1' + Creating table inheritances... Création des tables héritées... - Creating objects permissions... - Création des permissions... - - + Creating object `%1' (%2)... Création de l'objet `%1' (%2)... - Trying to recreate object `%1' (%2)... - Tentative de recréation de l'objet `%1' (%2)... - - + Creating columns permissions... Création des permissions sur les champs... - Update relationships of `%1' (%2)... - Mise à jour des associations de `%1' (%2)... - - + Destroying unused detached columns... - Suppression des colonnes détachées de la table parent (héritage)... + Destruction des colonnes détachées inutilisées... + The database import ended but some errors were generated and saved into the log file `%1'. This file will last until pgModeler quit. - L'import de la base a échoué mais les erreurs rencontrées ont été sauvegardées dans le fichier journal `%1'. Ce fichier sera disponible jusqu'à la fermeture de pgModeler. + L'import de la base de données est términée mais des erreurs ont été générées et sauvegardées dans le journal `%1'. Ce fichier sera disponible jusqu'à la fermeture de pgModeler. + + + + Creating object `%1' (%2), oid `%3'... + Création de l'objet `%1' (%2), oid `%3'... + + + + Trying to recreate object `%1' (%2), oid `%3'... + Tentative de création de l'objet `%1' (%2), oid `%3'... + Import failed to recreate some objects in `%1' tries. - + L'import a échoué à recréer certains objets à `%1' reprise(s). + Creating permissions for object `%1' (%2)... - + Création des autorisations pour l'objet `%1' (%2)... + Updating relationships of `%1' (%2)... - + Mise à jour des relations de `%1' (%2)... + Validating relationships... - + Validation des relations... + Assigning sequences to columns... - + Affectation des séquences aux colonnes... DatabaseModel + The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2' - Cette version de démonstration peut créer seulement `%1' instances pour chaque type d'objet ! Cette limite a été atteinte pour les objets de type : `%2' + Cette version de démonstration peut seulement créer `%1' instances pour chaque type d'objet ! Cette limite a été atteinte pour les objets de type : `%2' + Loading: `%1' (%2) - Chargement: `%1' (%2) + Chargement : `%1' (%2) - Generating %1 of the object `%2' (%3) - Génération %1 de l'objet `%2' (%3) + + + Validating relationships... + Validation des relations... - Validating relationships... + + Generating %1 code: `%2' (%3) + Saving object `%1' (%2) - + Enregistrement de l'objet `%1' (%2) + Saving metadata of the object `%1' (%2) - + Enregistrement des métadonnées de l'objet `%1' (%2) + Metadata file successfully saved! - + Fichier de métadonnées enregistré avec succès ! + Process successfully ended but no metadata was saved! - + Le processus s'est terminé avec succès mais aucune métadonnée n'a été enregistrée ! + Creating object `%1' (%2) - + Création de l'objet `%1' (%2) + Object `%1' (%2) already exists. Ignoring. - + L'objet `%1' (%2) existe déjà et a été ignoré. + Loading metadata for object `%1' (%2) - + Chargement des métadonnées de l'objet `%1' (%2) + Object `%1' (%2) not found. Ignoring metadata. - + Objet`%1' (%2) introuvable. Métadonnée ignorée. + Metadata file successfully loaded! - + Fichier de métadonnées chargé avec succès ! DatabaseWidget - Form - Formulaire - - + Attributes Attributs + Template DB: - Modèle de BDD: + Modèle de BDD : + Model Author: - Auteur du modèle: + Auteur du modèle : + Encoding: - Encodage: + Encodage : + Default Objects Attributs par défaut des objets + Tablespace: - Tablespace: + Espace de stockage : + Schema: - Schéma: + Schéma : + Collation: - Collation: + Collation : + Owner: - Propriétaire: + Propriétaire : + LC_COLLATE: - LC_COLLATE: + LC_COLLATE : + Connections: - Connexions: + Connexions : + LC_CTYPE: - LC_CTYPE: + LC_CTYPE : + The fields <strong>LC_COLLATE</strong> and <strong>LC_CTYPE</strong> have pre-configured values based upon the running system. You can freely modify those values if you intend to export the model to another host. - Les champs <strong>LC_COLLATE</strong> et <strong>LC_CTYPE</strong> ont déjà des valeur pré-configurées basées sur le système. Vous pouvez librement les modifier si vous deviez exporter le modèle pour une autre machine hôte. + Les champs <strong>LC_COLLATE</strong> et <strong>LC_CTYPE</strong> ont déjà des valeurs pré-configurées basées sur le système. Vous pouvez librement les modifier si vous devez exporter le modèle vers une autre machine hôte. + Use the above fields to specify the default attributes assigned to new objects created on the database model. Leaving a field empty will cause PostgreSQL to use the default values when exporting the model. - Utilisez les champs ci-dessus pour spécifier les attributs par défaut à assigner aux futurs objets qui seront créés dans le modèle. Laisser ces champs vides fera en sorte que PostgreSQL utilise ses valeurs par défaut lors de l'exportation du modèle. + Utilisez les champs ci-dessus pour spécifier les attributs par défaut à assigner aux nouveaux objets créés dans le modèle. Laisser un champ vide fera que PostgreSQL utilisera ses valeurs par défaut lors de l'export du modèle. + + + + Default Défaut + + + Options: + Options : + + + + Allow connections + Autoriser les connexions + + + + Is template + Est le modèle + DomainWidget - Form - Formulaire + + Name: + Nom : - Constraint - Contrainte + + Default Value: + Valeur par défaut : - Name: - Nom: + + Attributes + Attributs - Not Null: - Non Null: + + Not null + Non nulle - Check Expr.: - Expr. de vérif.: + + Check constraints + Vérifier les contraintes - Default Value: - Valeur par défaut: + + Expression: + Expression : + + + + Name + Nom + + + + Expression + DonateWidget + Form - Formulaire + Formulaire + Donate to pgModeler - + Faire un don à pgModeler + Hide this widget - + Cacher ce widget + ... - ... + ... + <html><head/><body><p>pgModeler is brought to you thanks to a <span style=" font-style:italic;">great effort to create and distribute a quality product</span>. This project is reaching out levels of maturity never imagined. All this is the result of a joint work between its author and the <span style=" font-weight:600;">Open Source community</span>. <br/><br/>This software has a long way to go yet and with your help we'll keep maintaining the good job and bringing new improvements on each release. If you did like pgModeler and thinks it deserves a contribution please make a donation!</p></body></html> - + <html><head/><body><p>pgModeler vous est offert grâce à un <span style=" font-style :italic;">gros effort pour créer et distribuer un produit de qualité </span>. Ce projet atteint un niveau de maturité jamais imaginé. Tout ceci est le résultat d'un travail conjoint entre son auteur et la <span style="font-weight :600;">Communauté Open Source</span>.<br/><br/>Ce logiciel a encore un long chemin à parcourir mais avec votre aide, nous continuerons à faire du bon travail et à apporter de nouvelles améliorations à chaque version. Si vous avez aimé pgModeler et pensez qu'il mérite une contribution, faites un don ! </p></body></html> + I want to help! - + Je veux aider ! ElementsWidget + Form Formulaire + Column: - Colonne: + Colonne : + Expression: - Expression: + Expression : + Collation: - Collation: + Collation : + Operator Class: - Classe d'opérateurs: + Classe d'opérateurs : + Operator: - Opérateur: + Opérateur : + Sorting: - Tri: + Tri : + Ascending Ascendant + Descending Descendant + Nulls first Null en premier + Element - Élement + Élément + Type - Type + + Operator Class Classe d'opérateur + Sorting Tri + Nulls First - Null en premier + Vides en premier + Collation - Collation + + Operator Operateur + Expression - Expression + + Yes Oui + No Non @@ -3277,1069 +4007,1330 @@ Ref. column(s): %2 EventTriggerWidget - Form - Formulaire - - + Event: - Evènement: + Évènement : + Function: - Fonction: + Fonction : + Filter Filtrer + Tag: - Tag: + Étiquette : + Tag command - Commande de déclenchement + Balise de la commande Exception + Assignment of a pseudo-type to the type of the column! - Utilisation d'un pseudo-type comme type de la colonne! - - - Zero length assignment! - Affectation de longueur nulle! + Utilisation d'un pseudo-type comme type de la colonne ! + Assignment of a precision greater than the length of the type! - Utilisation d'une précision est plus grande que la longueur du type! + Utilisation d'une précision est plus grande que la longueur du type ! + Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6! - Utilisation d'une précision de type time, timestamp ou interval invalide. La précision de ces types doit être inférieure ou égale à 6! + Utilisation d'une précision de type time, timestamp ou interval invalide. La précision de ces types doit être inférieure ou égale à 6 ! + Reference to a column which index is out of the capacity of the column list! - Référence à une colonne dont l'index dépasse la capacité de la liste des colonnes! + Référence à une colonne dont l'index dépasse la capacité de la liste des colonnes ! + Assignment of not allocated object! - Indefini ? - Utilisation d'un objet non référencé! + Utilisation d'un objet non référencé ! + Assigning object of an invalid type! - Assignation d'un objet dont le type est invalide! + Assignation d'un objet dont le type est invalide ! + Removing an object of an invalid type! - Suppression d'un objet dont le type est invalide! + Suppression d'un objet dont le type est invalide ! + Obtaining an object of an invalid type! - L'objet obtenu est de type invalide! + L'objet obtenu est de type invalide ! + Assignment of empty name to table return type! - Affectation d'un nom vide au type retourné par la table! + Affectation d'un nom vide au type retourné par la table ! + Reference to an event which does not belongs to trigger! - Qui ne provient ? - Référence à un évènement qui n'appartient pas au déclencheur! + Référence à un évènement qui n'appartient pas au déclencheur ! + Assignment of a function which language is invalid! - Définition d'une fonction dont le langage est invalide! + Définition d'une fonction dont le langage est invalide ! + Assignment of empty name to an object! - Affectation d'un nom vide à l'objet! + Affectation d'un nom vide à l'objet ! + Assignment of schema object which type is invalid! - Affectation d'un schema dont le type est invalide! + Affectation d'un schema dont le type est invalide ! + Assignment of tablespace object with invalid type! - Utilisation d'un tablespace dont le type est invalide! + Utilisation d'un espace logique dont le type est invalide ! + Assignment of tablespace to an invalid object! - Affectation d'un tablespace à un objet invalide! + Affectation d'un espace logique à un objet invalide ! + Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique! - Affectation d'un tablespace à une contrainte dont le type est invalide! Pour appartenir à un tablespace une contrainte doit être une clef primaire ou unique! + Affectation d'un espace logique à une contrainte dont le type est invalide ! Pour appartenir à un espace logique une contrainte doit être une clé primaire ou unique ! + Assignment of owner object which type is invalid! - Affectation d'un propiétaire dont le type est invalide! + Affectation d'un propiétaire dont le type est invalide ! + Assignment of owner to an invalid object! - Affectation d'un propriétaire à un objet invalide! + Affectation d'un propriétaire à un objet invalide ! + Reference to a function with invalid type! - Référence à une fonction dont le type est invalide! + Référence à une fonction dont le type est invalide ! + Reference to an argument of the operator with invalid type! - Référence à un argument de l'opérateur dont le type est invalide! + Référence à un argument de l'opérateur dont le type est invalide ! + Reference to an operator with invalid type! - Référence à un opérateur dont le type est invalide! + Référence à un opérateur dont le type est invalide ! + Assignment of value to an invalid option type on role! - Utilisation d'un attribut invalide pour un rôle! + Utilisation d'un attribut invalide pour un rôle ! + Reference to an invalid role type! - Référence à un type de rôle invalide! + Référence à un type de rôle invalide ! + Insertion of empty command to the rule! - Ajout d'une commande vide dans cette règle! + Insertion d'une commande vide dans cette règle ! + Is not possible to create a self generalization/copy relationship! The table can not inherit or copy their own attributes! - Impossible de créer une association de généralisation/copie avec elle même! Une table ne peut hériter ou copier ses propres attributs! + Impossible de créer une association de généralisation/copie de relation avec elle même ! Une table ne peut hériter ou copier ses propres attributs ! + Assignment of an object that already belongs to another table! - Utilisation d'un objet appartenant déjà à une autre table! + Utilisation d'un objet appartenant déjà à une autre table ! + Assignment of a schema to the sequence which differs from the schema of the owner table! - Affectation d'un schéma à la séquence diffèrent du schéma de la table! + Affectation d'un schéma à la séquence diffèrent du schéma de la table ! + Assignment of an invalid value to one of the sequence attributes! - Utilisation d'une valeur invalide comme attribut de séquence! + Utilisation d'une valeur invalide comme attribut de séquence ! + Assignment of a minimum value to the sequence which is greater than the maximum value! - La valeur minimale de la séquence est supérieure à la valeur maximale! + La valeur minimale de la séquence est supérieure à la valeur maximale ! + Assignment of a null increment value to the sequence! - La valeur de l'incrément de la séquence est nulle! + La valeur de l'incrément de la séquence est nulle ! + Assignment of null cache value to the sequence! - La valeur cache de la séquence est nul! + La valeur cache de la séquence est nulle ! + Allocation of object with invalid type! - Le type de l'objet alloué est invalide! + Le type de l'objet alloué est invalide ! + Assignment of not allocated language! - Indéfini ? - Utilisation d'un langage inconnu! + Utilisation d'un langage inconnu ! + Assignment of language object which type is invalid! - Définition d'un objet langage dont le type est invalide! + Définition d'un objet langage dont le type est invalide ! + Reference to data type with an index outside the capacity of data types list! - Référence à un type de donnée dont l'index est en dehors de la capacité de la liste des types de données! + Référence à un type de donnée dont l'index est en dehors de la capacité de la liste des types de données ! + Assignment of invalid type to the object! - Affectation d'un type invalide à l'objet! + Affectation d'un type invalide à l'objet ! + Obtaining types with invalid quantity! - Utilisation d'une quantité de types invalide! + Utilisation d'une quantité de types invalide ! + Insertion of item which already exists in the attributes list of the type! - Ajout d'un attribut déjà présent dans la définition de ce type! + Insertion d'un attribut déjà présent dans la définition de ce type ! + Insertion of invalid item in the attributes list of the type! - Ajout d'un attribut invalide à la liste des attributs de ce type! + Insertion d'un attribut invalide à la liste des attributs de ce type ! + Insertion of item which already exists in the enumarations list of the type! - Ajout d'un élément déjà existant dans l'énumeration! + Insertion d'un élément déjà existant dans l'énumeration ! + Insertion of invalid item in the enumerations list of the type! - Ajout d'un élément invlaide dans l'énumeration! + Insertion d'un élément invlaide dans l'énumeration ! + Assignment of invalid configuration to the type! - La configuration assigné au type est invalide! + La configuration assigné au type est invalide ! + Assignment of an operator which input type count is invalid to aggregate function! - Utilisation d'un opérateur dont le nombre d'argument est invalide avec une fonction d'agrégation (un et seulement un)! + Utilisation d'un opérateur dont le nombre d'argument est invalide avec une fonction d'agrégation ! + Assignment of an operator which types of arguments is invalid! - Utilisation d'un opérateur dont le type des arguments est invalide! + Utilisation d'un opérateur dont le type des arguments est invalide ! + + There is already a relationship between `%1' (%2) and `%3' (%4) in the model! When using relationships of the type generalization, copy and one-to-one there can't be other relationships linked to the pair of tables. + Il y a déjà une relation entre `%1 '(%2) et `%3' (%4) dans le modèle ! Lors de l'utilisation de relations de type généralisation, copie et un-à-un, il ne peut y avoir d'autres relations liées à la paire de tables. + + + A view reference must be used in at least one these SQL scopes: View Definition, SELECT-FROM, FROM-WHERE or After WHERE! - Lors de la définition d'une vue, une référence doit utiliser au moins une des options suivantes:SELECT-FROM, FROM-WHERE ou Après WHERE! + Lors de la définition d'une vue, une référence doit utiliser au moins un des champs SQL : SELECT-FROM, FROM-WHERE ou après WHERE ! + + + + Unable to load the configuration file `%1'! Please check if file exists in its folder and/or if it is not corrupted! + Impossible de charger le fichier de configuration `%1'! Merci de vérifier que le fichier existe dans son dossier et / ou s'il n'est pas corrompu ! + Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again! Impossible de trouver le fichier des préférences par défaut `%1' ! Pour restaurer les préférences par défaut veuillez vérifier l'existance de ce fichier et réessayez ! + Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3' Impossible de charger l'extension `%1' depuis la bibliothèque`%2' ! Message retourné par le gestionnaire d'extension : `%3' - Unknown attribute `%1' in file %2, line %3, column %4! - Attribut `%1' incconu dans le fichier %2, ligne %3, colonne %4 ! + + Failed to drop the database `%1' because it is defined as the default database for the connection `%2'! + Impossible de supprimer la base de données `%1 'car elle est définie comme base de données par défaut pour la connexion`%2' ! + + + + The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it! + La colonne `%1' doit être `NOT NULL' car elle compose la clé primaire de la table `%2'. Vous devez supprimer la colonne de la contrainte mentionnée afin de désactiver le `NOT NULL' dessus ! + + + + The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'. + La colonne d'identité `%1' a un type de données invalide ! Le type de données doit être `smallint', `integer' ou `bigint'. - Invalid use of a view referece as whole SQL definition! The assigned reference must be an expression! - À contrôler - Utilisation invalide d'une vue en tant que définition SQL! La référence doit être une expression! + + Reference to an invalid affected command in policy `%1'! + Référence à une commande affectée invalide dans la règle `%1' ! + + Reference to an invalid special role in policy `%1'! + Référence à un rôle spécial invalide dans la politique `%1' ! + + + Assignment of a second definition expression to the view! - Assignation d'une seconde expression à la vue! + Assignation d'une seconde expression à la vue ! + Assignment of collation object which type is invalid! - À contrôler - Utilisation d'un objet collation invlaide! + Utilisation d'un objet collation invalide ! + Collations must be created at least with attributes LC_COLLATE and LC_CTYPE defined! - Les collations doivent être définies avec les attributs LC_COLLATE et LC_CTYPE renseignés! + Les collations doivent être définies avec les attributs LC_COLLATE et LC_CTYPE renseignés ! + Reference to an invalid copy table option! - Référence à une option invalide de copie de table! + Référence à une option invalide de copie de table ! + The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers! - Le mode AU LIEU DE (INSTEAD OF) ne peut être utilisé comme trigger de table! Ce n'est valable que pour les triggers de vue! + Le mode AU LIEU DE (INSTEAD OF) ne peut être utilisé comme déclencheur de table ! Ce n'est valable que pour les déclencheurs de vue ! + The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table! - L'événement TRUNCATE ne peut être utilisé que lors d'un trigger sur chaque ligne et qu'il appartient à une table! + L'événement TRUNCATE ne peut être utilisé que lors d'un déclencheur sur chaque ligne et que s'il appartient à une table ! + The INSTEAD OF mode cannot be used on view triggers that executes for each statement! - Le mode AU LIEU DE (INSTEAD OF) ne peut être utilisé avec triggeurs de vues qui s’exécutent à chaque requête! + Le mode AU LIEU DE (INSTEAD OF) ne peut être utilisé avec des déclencheurs de vues qui s’exécutent à chaque requête ! + Constraint triggers can only be executed on AFTER events and for each row! - Les triggeurs de contraintes ne peuvent être exécutés qu'après (AFTER) et pour chaque lignes! + Les déclencheurs de contraintes ne peuvent être exécutés qu'APRÈS les événements et pour chaque ligne ! + A view trigger cannot be AFTER/BEFORE when it executes for each row! - Les triggeurs de vues ne peuvent être AFTER/BEFORE quand il sont configuré pour une exécution sur chaque ligne! + Les déclencheurs de vues ne peuvent être AFTER/BEFORE quand il sont configurés pour une exécution sur chaque ligne ! + A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event! - Un triggeur ne peut faire référence aux colonnes quand il est utilisé en mode INSTEAD OF sur un événement de type UPDATE! + Un déclencheur ne peut faire référence aux colonnes quand il est utilisé en mode INSTEAD OF sur un événement de type UPDATE ! + Only constraint triggers can be deferrable or reference another table! - Seuls les déclencheurs de contraintes peuvent être déférés ou référencer une autre table! - - - Reference to a function id which is incompatible whit the user define type configuration! - Doutes - Référence faite à un identifiant de fonction incompatible avec le type configuré! + Seuls les déclencheurs de contraintes peuvent être déférés ou référencer une autre table ! + The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack! - La procédure de validation a échouée à cause d'une erreur levée par l'assistant de validation. Pour de plus amples informations, referez vous à la pile des exceptions! + La procédure de validation a échouée à cause d'une erreur levée par l'assistant de validation. Pour de plus d'informations, referez-vous à la pile des exceptions ! + Assignment of an invalid strategy/support number to an operator class element! - Hum ... numéro de stratégie/support ? - Affectation d'un numéro de stratégie/support invalide à un élément de la classe 'operator'! + Affectation d'un numéro de stratégie/support invalide à un élément de la classe 'operator' ! + Insertion of element which already exists in the element list! - Insertion d'un élément déjà existant dans la liste des éléments! + Insertion d'un élément déjà existant dans la liste des éléments ! + Reference to a parameter which index is out of the parameter list bounds! - Référence un paramètre dont l'index est hors des limites de la liste de ces derniers! + Référence un paramètre dont l'index est hors des limites de la liste de ces derniers ! + Reference to an argument which index is out of argument list bounds! - Référence un argument dont l'index est hors des limites de la liste de ces derniers! + Référence un argument dont l'index est hors des limites de la liste de ces derniers ! + Assignment of a name which contains invalid characters! - Utilisation de caractères invalides dans le nom! + Utilisation de caractères invalides dans le nom ! + Assignment of a name which length exceeds the maximum of 63 characters! - Utilisation de plus de 63 caractères dans le nom! + Utilisation de plus de 63 caractères dans le nom ! + Reference to a role which index is out of role list bounds! - Référence un rôle dont l'index est hors des limites de la liste de ces derniers! + Référence un rôle dont l'index est hors des limites de la liste de ces derniers ! + Reference to a command which index is out of the command list bounds! - Référence une commande dont l'index est hors des limites de la liste de ces dernières! + Référence une commande dont l'index est hors des limites de la liste de ces dernières ! + Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values! - À contrôler. - Affectation de la valeur de départ de la séquence en dehors des limites de cette dernière (min et max)! + Affectation de la valeur de départ de la séquence en dehors de la plage de cette dernière définie par les valeurs min et max ! + Reference to a label which index is out of labels list bounds! - Référence un label dont l'index est hors des limites de la liste de ces derniers! + Référence un label dont l'index est hors des limites de la liste de ces derniers ! + Reference to an attribute which index is out of the attributes list bounds! - Référence un attribut dont l'index est hors des limites de la liste de ces derniers! + Référence un attribut dont l'index est hors des limites de la liste de ces derniers ! + Reference to an enumeration which index is out of the enumerations list bounds! - Référence une énumération dont l'index est hors des limites de la liste de ces dernières! + Référence une énumération dont l'index est hors des limites de la liste de ces dernières ! + Reference to an element which index is out of element list bounds! - Référence un élément dont l'index est hors des limites de la liste de ces derniers! + Référence un élément dont l'index est hors des limites de la liste de ces derniers ! + Reference to an object which index is out of object list bounds! - Référence un objet dont l'index est hors des limites de la liste de ces derniers! + Référence un objet dont l'index est hors des limites de la liste de ces derniers ! + Removal of an object not allocated! - Suppression d'un objet non alloué! + Suppression d'un objet non alloué ! + The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference! - L'objet `%1' (%2) ne peut être modifié car il est est réservé à PostgreSQL! Cet objet apparaît dans le modèle uniquement comme référence! - - - Unsupported PostgreSQL version (%1) detected! Valid versions are: %2 - Une version non supportée de PostgreSQL (%1) a été détectée! Les versions supportées sont: %2 + L'objet `%1' (%2) ne peut être modifié car il est est réservé à PostgreSQL ! Cet objet apparaît dans le modèle uniquement comme référence ! + Operation with object(s) which type(s) is invalid! - Opérations sur des objet(s) dont le(s) type(s) sont invalides! + Opérations sur un ou des objets dont les types sont invalides ! + Reference to object with invalid type! - Référence à un objet ayant un type invalide! + Référence à un objet ayant un type invalide ! + Operation with object not allocated! - Opération sur des objets non alloués! + Opération sur des objets non alloués ! + The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user! - Une association de type 1-1, quand les deux tables sont obligatoires, n'est pas implémentée car celà requiert la fusion des tables, ce qui casse le modèle réalisé par l'utilisateur! + Une association de type 1-1, quand les deux tables sont obligatoires, n'est pas implémentée car cela requiert la fusion des tables, ce qui casse le modèle réalisé par l'utilisateur ! + Assignment of an invalid expression to the object! - Affectation d'une expression invalide à l'objet! + Affectation d'une expression invalide à l'objet ! + Assignment of a primary key to a table which already has one! - Impossible de définir une clef primaire à une table qui en possède déjà une! + Impossible de définir une clé primaire à une table qui en possède déjà une ! + Identifier relationship can not be created for a self relationship, relationships of the type n-n, copy or generalization! - Review needed ! Doutes ... - Seules des associations de type 1:1 ou 1:n peuvents être utilisé comme identifiant. En aucun cas les autoassociations, associations n:n, généralisations ou copies ne le peuvent! + La relation d'identifiant ne peut pas être créée pour une relation vers elle même, pour les relations de type n-n, pour la copie ou pour la généralisation! + An attribute can not be added to a copy or generalization relationship! - Un attribut ne peut être ajouté à une relation copie ou généralisation! + Un attribut ne peut être ajouté à une relation copie ou généralisation ! + A foreign key can not be added to a relationship because is created automatically when this is connected! - Une clef étrangère ne peut être ajoutée à une relation car elle est créée automatiquement lors de la mise en relation! + Une clé étrangère ne peut être ajoutée à une relation car elle est créée automatiquement lors de la mise en relation ! + Reference to an user-defined data type that not exists in the model! - Référence à un type de donné défini par l'utilisateur qui n'existe pas dans le modèle! + Référence à un type de donné défini par l'utilisateur qui n'existe pas dans le modèle ! + Assignment of invalid maximum size to operation list! - La taille maximum affectée à la liste d'opérations est invalide! + La taille maximum affectée à la liste d'opérations est invalide ! + One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! - Un ou plusieurs objets ont été invalidés et automatiquement supprimés car ils référençaient des colonnes qui étaient incluses dans des relations et qui n'existaient plus du fait de la suppression de relation ou d'exclusion de ces colonnes! + Un ou plusieurs objets ont été invalidés et automatiquement supprimés car ils référençaient des colonnes qui étaient incluses dans des associations et qui n'existaient plus du fait de la suppression de l'associations ou de l'exclusion de ces colonnes ! + Reference to an invalid privilege type! - Référence à un type de privilège invalide! + Référence à un type de privilège invalide ! + Insertion of a role which already exists in the role list of the permission! - Ajout d'un rôle déjà existant dans la liste de cette permission! + Insertion d'un rôle déjà existant dans la liste de cette permission ! + Assignment of privilege incompatible with the type of object referenced by permission! - Utilisation d'un privilège incompatible avec le type d'objet référencé par la permission! + Utilisation d'un privilège incompatible avec le type d'objet référencé par la permission ! + It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature! - Il est impossible de créer des tableaux de domaines ou séquences (dimension >= 1)! PostgreSQL n'inplémente pas encore cette fonctionnalité! + Il est impossible de créer des tableaux de domaines ou de séquences (dimension >= 1) ! PostgreSQL n'inplémente pas encore cette fonctionnalité ! + Assignment of invalid name to the table generated from N-N relationship! - Le nom de la table générée par la relation N-N est invalide! + Le nom de la table générée par la relation N-N est invalide ! + Reference to a column of the objects table with invalid index! - Référence à une colonne de la table ayant un index invalide! + Référence à une colonne de la table ayant un index invalide ! + Reference to a row of the objects table with invalid index! - Référence à une ligne de la table ayant un index invalide! + Référence à une ligne de la table ayant un index invalide ! + Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns! - Les contraintes telles que clef primaire, clef étrangère ou l'unicité doivent avoir au moins une colonne associée! Pour les clefs étrangères, les colonnes référencées doivent également être sélectionnées! - - - Unable to load one or more configuration files! Please check if files exists in the configuration folder and if they are not corrupted to preventing this error to occur again on the next startup! - Impossible de charger un ou plusieurs fichiers de configuration! Veuillez vérifier que les fichiers existent bien dans le dossier de configuration et qu'ils ne soient pas corrompus pour éviter que l'erreur ne se produise à nouveau au prochain lancement! + Les contraintes telles que clé primaire, clé étrangère ou unicité doivent avoir au moins une colonne associée ! Pour les clés étrangères, les colonnes référencées doivent également être sélectionnées ! + The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack! ** Executed SQL command: ** %1 - Le process d'exportation a échoué suite à une erreur déclenchée par le serveur PostgreSQL lors de la tentative d'exécution d'une commande SQL. Pour plus de détails concernant l'erreur vérifiez la pile d'exceptions! + Le process d'exportat a échoué suite à une erreur déclenchée par le serveur PostgreSQL lors de la tentative d'exécution d'une commande SQL. Pour plus de détails concernant l'erreur vérifiez la pile d'exceptions ! ** Commande SQL exécutée: ** %1 + One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details. - Une ou plusieurs extensions n'ont pas été activée(s) car des erreurs sont apparues lors du processus de chargment. Pour plus de détails, consultez la pile d'exceptions. - - - Invalid syntax in file %1, line %2, column %3! - Syntaxe invalide dans le fichier %1, ligne %2, colonne %3! + Une ou plusieurs extensions n'ont pas été activées suite à la survenue d'erreurs lors du chargement. Pour plus de détails, consultez la pile d'exceptions. + Assignment of empty XML buffer to parser! - Passage d'un tampon XML vide au parseur! - - - Could not access the file or directory %1! Make sure that it exists or if the user has access permissions on it! - Impossible d'accéder au fichier ou dossier %1! Assurez vous qu'il existe et que l'utilisateur a le droit d'y accéder! + Passage d'un tampon XML vide à l'analyseur ! + Assignment of empty DTD file name! - Le nom du fichier DTD est vide! + Le nom du fichier DTD est vide ! + Assignment of empty name to the DTD declaration! - Le nom de la DTD est vide! + Le nom de la déclaration DTD est vide ! + Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated! - Opération sur un élément de l'arbre XML non initialisé! Il est nécessaire de remplir le tampon de l'analyseur XML et de lancer l'interprétation pour que l'arbre soit généré! - - - Could not load file %1. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! - Impossible de charger le fichier %1. Le fichier semble incohérent ou une de ses dépendances (fichiers DTD) contient des erreurs ou est manquantes! + Opération sur l'arbre d'élément non alloué ! Il est nécessaire de charger le tampon d'analyseur XML et de l'interpréter pour que l'arbre soit généré ! + Operation with unallocated tree element! - Opération sur un élément non alloué de l'arbre! + Opération avec un élément de l'arbre non alloué ! + Operation with element which does not exists in the element tree currently loaded! - Opération sur un élément inexistant dans l'arbre des élément actullement chargé! + Opération avec un élément inexistant dans l'arbre des éléments actullement chargé ! + Assignment of a value to an invalid connection parameter! - Affectation d'une valeur à un paramètre de connexion invalide! + Affectation d'une valeur à un paramètre de connexion invalide ! + Operation on connection not established! - Opération sur une connexion non établie! + Opération sur une connexion non établie ! + Attempt to connect without define configuration parameters! - Tentative de connexion sans paramètre de configuration défini! + Tentative de connexion sans paramètre de configuration défini ! + Assignment of not allocated SQL command result! - indéfini ? - Affectation d'un résultat de commande SQL non alloué! + Affectation d'un résultat de commande SQL non alloué ! + Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client! - Impossible de retourner le résultat de la commande SQL car la réponse du SGBD n'a pas été comprise par le client! + Impossible de retourner le résultat de la commande SQL car la réponse du SGBD n'a pas été comprise par le client ! + Reference to a column of tuple with invalid index! - Référence à une colonne de tuple dont l'index est invalide! + Référence à une colonne de tuple dont l'index est invalide ! + Reference to a column of tuple with invalid name! - Référence à une colonne de tuple dont le nom est invalide! - - - Reference to a tuple with index invalid or the result is empty (no tuples)! - Référence à un tuple avec un index invalide ou le résultat est vide (pas de tuple)! + Référence à une colonne de tuple dont le nom est invalide ! + Assignment of a not allocated column to object `%1' (%2)! - + Affectation d'une colonne non allouée à l'objet `%1 '(%2) ! + Assignment of a not allocated schema to object `%1' (%2)! - + Affectation d'un schéma non allouée à l'objet `%1 '(%2) ! + The object `%1' (%2) has inconsistent SQL or XML definition! - + L'objet `%1 '(%2) a une définition SQL ou XML incohérente ! + The object `%1' (%2) already exists on `%3' (%4)! - + L'objet `%1 '(%2) existe déjà sur `%3' (%4) ! + The object `%1' (%2) cannot be assigned because there is already exists in the container object `%3'! - + L'objet `%1 '(%2) ne peut être assigné car il existe déjà dans l'objet conteneur `%3' ! + The insertion of the parameter `%1' will not be possible because there is another parameter with same name in the function `%2'! - + L'insertion du paramètre `%1' ne sera pas possible car il existe un autre paramètre avec le même nom dans la fonction `%2' ! + The insertion of the table return type `%1' will not be possible because there is another return type with the same name in the `%2'! - + L'insertion du type de retour de la table `%1' ne sera pas possible car il existe un autre type de retour avec le même nom dans le`%2' ! + The column `%1' cannot be assigned to the trigger `%2' because they belongs to different parent tables! - + La colonne `%1' ne peut pas être affectée au déclencheur `%2' car ils appartiennent à des tables parentes différentes ! + Assignment of a not allocated function to object `%1' (%2)! - + Affectation d'une fonction non allouée à l'objet `%1' (%2) ! + Assignment of a function which return type is different from `%1'! - + Affectation d'une fonction dont le type de retour est différent de `%1' ! + Assignment of a function which parameter count is invalid to the object `%1' (%2)! - + Affectation d'une fonction dont le nombre de paramètres n'est pas valide pour l'objet `%1' (%2) ! + Event trigger function must be coded in any language other than SQL! - + La fonction de déclenchement d'événement doit être codée dans n'importe quelle langue autre que SQL ! + Assignment of not allocated table to object `%1' (%2)! - + Affectation de la table non allouée à l'objet `%1' (%2) ! + Assignment of appended or prepended SQL to an invalid object! - + Affectation de code SQL ajouté ou préfixé à un objet invalide ! + The insertion of the role `%1' is not possible because this is already being referenced by role `%2'! - + L'insertion du rôle `%1 n'est pas possible car il est déjà référencé par le rôle `%2' ! + Reference redundancy detected by having the role `%1' referencing the role `%2'! - + Redondance de références détectée en ayant le rôle `%1' référençant le rôle `%2' ! + The role `%1' can not be listed as a member of itself! - + Le rôle `%1' ne peut pas être listé comme un membre de lui-même ! + Assignment of owner table which is not in the same schema as the sequence `%1'! - + Affectation de la table propriétaire qui n'est pas dans le même schéma que la séquence `%1' ! + Assignment of owner table which does not belong to the same owner of the sequence `%1'! - + Affectation de la table propriétaire qui n'appartient pas au même propriétaire de la séquence `%1' ! + Assignment of a nonexistent owner column to the sequence `%1'! - + Affectation d'une colonne propriétaire inexistante à la séquence `%1' ! + Assignment of an owner column to the sequence `%1' that is not related to any table! - + Affectation d'une colonne propriétaire à la séquence `%1' qui n'est liée à aucune table ! + Assignment of a function with invalid return type to object `%1' (%2)! - + Affectation d'une fonction avec un type de retour invalide à l'objet `%1' (%2) ! + Assignment of a function with invalid parameter(s) type(s) to object `%1' (%2)! - + Affectation d'une fonction avec un (des) paramètre(s) non valide(s) à l'objet `%1' (%2) ! + Assignment of an empty directory to object `%1' (%2)! - + Affectation d'un répertoire vide à l'objet `%1' (%2) ! + Assignment of system reserved name to the object `%1' (%2)! - + Affectation du nom réservé au système à l'objet `%1' (%2) ! + One function with invalid configuration is been used by the object `%1' (%2)! - + Une fonction avec une configuration invalide est utilisée par l'objet `%1' (%2) ! + The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4)! - + L'objet `%1' (%2) ne peut pas être supprimé car il est référencé par l'objet `%3' (%4) ! + The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4) that belongs to `%5' (%6)! - + L'objet `%1' (%2) ne peut pas être supprimé car il est référencé par l'objet `%3' (%4) appartenant à `%5' (%6) ! + The creation of the relationship `%1' between the table `%2' and `%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! - + La création de la relation `%1' entre la table `%2' et `%3' ne peut pas être effectuée car il n'y a pas de clé primaire. Si la relation est du type n-n, les deux tables doivent avoir des clés primaires ! + Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'! - + Impossible de créer une relation de copie car la colonne `%1' de la table `%2' existe déjà dans la table `%3' ! + Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types! - + Impossible de créer la relation de généralisation car la colonne `%1' de la table `%2' ne peut pas être fusionnée avec la colonne `%3' de la table `%4' car ils ont des types incompatibles ! + The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model! - + L'objet `%1' (%2) fait référence à l'objet `%3' (%4) qui n'a pas été trouvé dans le modèle ! + Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it! - - - - There is already a relationship between `%1' (%2) and `%3' (%4) in the model! - + Impossible d'écrire le fichier ou le répertoire `%1' ! Assurez-vous que le répertoire de sortie existe et que l'utilisateur a les droits d'écriture dedans ! + The primary key `%1' can only be allocated if declared within a block of code that defines a table or relationship! - + La clé primaire `%1' ne peut être allouée que si elle est déclarée dans un bloc de code qui définit une table ou une relation ! + There is already a permission on object `%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! - + Il y a déjà une permission sur l'objet `%1' (%2) qui a un ou plusieurs rôles égaux à ceux présents dans l'autorisation à assigner à l'objet ! + A permission is referencing the object `%1' (%2) which was not found in the model! - + Une permission fait référence à l'objet `%1' (%2) qui n'a pas été trouvé dans le modèle ! + The object `%1' (%2) can not be created because its not being assigned to any schema! - + L'objet `%1' (%2) ne peut pas être créé car il n'est affecté à aucun schéma ! + The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'! - + L'espace de stockage `%1' ne peut pas être inséré dans le modèle car il pointe sur le même répertoire que l'espace de table `%2' ! + The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! - + La fonction `%1' ne peut pas obtenir un code source en tant que définition car sa langue est définie sur C. Utilisez plutôt le symbole d'attributs et la bibliothèque dynamique ! + The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! - + La fonction `%1' peut avoir le symbole des attributs et la bibliothèque dynamique configurés uniquement si la langue est définie sur C. Dans tous les autres cas, il faut spécifier un code source qui le définit dans le SGBD ! + The operator `%1' can not be assigned as a comutator of operator `%2' because it has incompatible settings! - + L'opérateur `%1' ne peut pas être affecté en tant que commutateur de l'opérateur `%2'car il comporte des paramètres incompatibles ! + The operator `%1' can not be assigned as negator of operator `%2' because it has incompatible settings! - + L'opérateur `%1' ne peut pas être affecté en tant que négateur de l'opérateur `%2' car il a des paramètres incompatibles ! + The type `%1' can not self refer in the attributes `element' or `copy type' or be used as a data type of an attribute in the configuration of a composite type! - + Le type `%1' ne peut pas se référer à lui-même dans les attributs `element' ou `copy type' ou être utilisé comme type de données d'un attribut dans la configuration d'un type composite ! + Assignment of invalid element to type `%1'! - + Affectation d'un élément invalide de type `%1' ! + Assignment of invalid alignment to type `%1'! - + Affectation de l'alignement invalide de type `%1' ! + The relationship `%1' can not make use of the special primary key because it is marked as identifier or it is a self relationship! - + La relation `%1' ne peut pas utiliser la clé primaire spéciale car elle est marquée comme identifiant ou c'est une association d'elle-même ! + The object `%1' (%2) can not be edited or deleted because it was automatically included through a relationship! If the object is an attribute or constraint the modifications must be done on the relationship editing form. - + L'objet `%1' (%2) ne peut pas être modifié ou supprimé car il a été automatiquement inclus dans une association ! Si l'objet est un attribut ou une contrainte, les modifications doivent être effectuées sur le formulaire d'édition de la relation. + The object `%1' (%2) can not be deleted because it is protected! - + L'objet `%1' (%2) ne peut pas être supprimé car il est protégé ! + The group `%1' has already been declared earlier! - + Le groupe `%1' a déjà été déclaré ! + The group `%1' can not be built in the groups declaration block (%2)! - + Le groupe `%1' ne peut pas être construit dans le bloc de déclaration de groupe (%2) ! + The group `%1' was built but not declared in the groups declaration block (%2)! - + Le groupe `%1' a été construit mais pas déclaré dans le bloc de déclaration de groupe (%2) ! + The group `%1' can not be built without possessing child elements! - + Le groupe `%1' ne peut pas être construit sans posséder d'éléments enfants ! + The group `%1' can not be built once more because this was done in previous blocks! - + Le groupe `%1' ne peut pas être construit une fois de plus car cela a été fait dans les blocs précédents ! + The group `%1' has been declared but not built! - + Le groupe `%1' a été déclaré mais pas construit ! + The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect! - + La nouvelle configuration de la fonction invalide l'objet `%1' (%2) ! Dans ce cas, il est nécessaire d'annuler la relation entre l'objet affecté et la fonction afin que la nouvelle configuration prenne effet ! - Invalid instruction `%1' on file %2, line %3, column %4! - + + Error while interpreting XML buffer at line %1 column %2. +Message generated by the parser: %3. %4 + Erreur lors de l'interprétation du tampon XML à la ligne %1, colonne %2. +Message généré par l'analyseur : %3. %4 - Invalid metacharacter `%1' in file %2, line %3, column %4! - + + Attempt to start a connection already stablished! + Tentative de lancement d'une connexion déjà établie ! - Invalid operator `%1' in comparison expression, file %2, line %3, column %4! - + + Could not connect to the database. +Message returned: `%1' + Impossible de se connecter à la base de données. +Message renvoyé : `%1' - Attribute `%1' with an undefined value in file %2, line %3, column %4! - + + Unable to allocate command result for the SQL because the server has generated a fatal error! +Message returned by the DBMS: `%1' + Impossible d'allouer le résultat de la commande SQL car le serveur a généré une erreur fatale ! +Message renvoyé par le SGBD : `%1' - Attribute `%1' with an invalid name in file %2, line %3, column %4! - - - - Error while interpreting XML buffer at line %1 column %2. -Message generated by the parser: %3. %4 - - - - Attempt to start a connection already stablished! - - - - Could not connect to the database. -Message returned: `%1' - - - - Unable to allocate command result for the SQL because the server has generated a fatal error! -Message returned by the DBMS: `%1' - - - - Reference to a column of a tuple which was not yet initialized (tuple navigation not started)! - + + Reference to a column of a tuple which was not yet initialized (tuple navigation not started)! + Référence à une colonne d'un tuple qui n'a pas encore été initialisé (navigation en tuple non démarrée) ! + Could not execute the SQL command. Message returned: `%1' - + Impossible d'exécuter la commande SQL. + Message renvoyé : `%1' + It is not possible mix ordinary references (SELECT-FROM, FROM-WHERE, After WHERE) with references used as view SQL definition! - + Il n'est pas possible de mélanger des références ordinaires (SELECT-FROM, FROM-WHERE, Après WHERE) avec des références utilisées comme vue de définition SQL ! + The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object! - + L'objet `%1' (%2) ne peut pas se référencer lui-même ! Cette opération n'est pas autorisée pour ce genre d'objet ! + Only operator families which uses `btree' as indexing method are accepted by operator class elements! - + Seules les familles d'opérateurs qui utilisent `btree 'comme méthode d'indexation sont acceptées par les éléments de classe d'opérateur ! + Copy relationship between tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table! - + L'association de copie entre les tables `%1' et `%2' ne peut pas être effectuée car la première copie déjà les attributs de `%3' ! Les tables ne peuvent avoir qu'une seule table de copie ! + Assignment of a column which has no parent table to the object `%1' (%2)! - + Affectation d'une colonne qui n'a pas de table parent à l'objet `%1' (%2) ! + The operator class assigned to the object `%1' (%2) must use `btree' as indexing method! - + La classe d'opérateur affectée à l'objet `%1' (%2) doit utiliser` btree' comme méthode d'indexation ! + The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified! - + L'extension `%1' est enregistrée en tant que type de données et ne peut pas avoir l'attribut `handle datatype' modifié ! + The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'! - + L'association clé étrangère `%1' ne peut pas être créée car la clé étrangère qui la représente n'a pas été créée sur la table `%2' ! + Assignement of an invalid object name pattern to the relationship `%1'! - + Affectation d'un modèle de nom d'objet invalide à la relation `%1' ! + Reference to an invalid object name pattern id on the relationship `%1'! - + Référence à un identifiant de modèle de nom d'objet invalide sur la relation `%1' ! + Mixing incompatibles DBMS export modes: `ignore object duplications', `drop database' or `drop objects' cannot be used with `simulate export'! - + Mélange incompatibles des modes d'export du SGBD : `ignore object duplications', `drop database' ou `drop objects' ne peuvent être utilisés avec `simulate export' ! + Mixing incompatibles DROP options: `drop database' and `drop objects' cannot be used at the same time! - + Mixage incompatible des options DROP : `drop database' et `drop objects' ne peuvent pas être utilisés en même temps ! + Invalid object id swapping operation! The objects involved are the same! - + Opération d'échange d'identifiant d'objet invalide ! Les objets impliqués sont les mêmes ! + Invalid object id swapping operation! The database itself, tablespaces or roles cannot have the ids swapped! - + Opération d'échange d'identifiant d'objet invalide ! La base de données elle-même, les espaces de stockage ou les rôles ne peuvent pas échanger leurs identifiants ! + The widget already has a parent and cannot be assigned to a different object! - - - - The object `%1' (%2) could not be imported due to one or more errors! Check the exception stack for more details. - + Le widget a déjà un parent et ne peut pas être assigné à un objet différent ! + Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case. - + Impossible de charger le fichier de modèle de base de données `%1'. Vérifiez la pile d'erreurs pour plus de détails. Essayez d'exécuter `pgmodeler-cli --fix-model' afin de corriger la structure du fichier si besoin. + The column `%1' cannot reference it's parent table `%2' as data type! - + La colonne `%1' ne peut pas référencer sa table parent `%2' comme type de données ! + Operation with an invalid element id `%1'! - + Opération avec un identifiant d'élément invalide `%1' ! + Reference to an invalid color id `%1' for element `%2'! - + Référence à un identifiant de couleur invalide `%1' pour l'élément `%2' ! + The sequence `%1' can't be assigned to the column `%2' because the data type of the latter is incompatible. The type used must be an integer one! - + La séquence `%1' ne peut pas être affectée à la colonne `%2' car le type de données de cette dernière est incompatible. Le type utilisé doit être un entier ! + The option to generate temporary object names can only be used in simulation mode! - + L'option de génération de noms d'objets temporaires ne peut être utilisée qu'en mode simulation ! + Could not assign the variable `%1' to event trigger's filter. Currently, PostgreSQL supports only the `TAG' variable! - - - - Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. - - ** Returned error ** - -%4 - + Impossible d'affecter la variable `%1 'au filtre du déclencheur d'événement. Actuellement, PostgreSQL supporte uniquement la variable `TAG' ! + Malformed unescaped value on row `%1' column `%2'! - + Valeur non echappée malformée à la ligne `%1', colonne `%2' ! + The object `%1' (%2) can't be handled because some needed fields are not set! Please, make sure to fill at least the requires fields in order to properly create or update the object. - + L'objet `%1' (%2) ne peut pas être manipulé car certains champs nécessaires ne sont pas définis ! Merci de vous assurer de remplir au moins les champs requis afin de créer ou de mettre à jour correctement l'objet. + A relationship can only be swapped by other object of the same kind! - + Une association ne peut être permutée que par un autre objet du même genre ! + Assignment of a null type to object `%1' (%2)! - + Affectation d'un type nul à l'objet `%1' (%2) ! + Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition! - + Impossible de créer l'association de généralisation car la contrainte `%1' de la table `%2' ne peut pas être fusionnée avec la contrainte `%3' de la table `%4' en raison de leurs compositions incompatibles ! + Unable to write the file `%1' due to one or more errors in the definition generation process! - + Impossible d'écrire le fichier `%1' en raison d'une ou de plusieurs erreurs dans le processus de génération de définition ! + The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent! - + La configuration de la relation `%1' génère une redondance entre les associations `%2 . La redondance sur l'identificateur ou les relations de généralisation/copie de l'association ne sont pas acceptées car elles entraînent une répartition incorrecte des colonnes, ce qui rend le modèle incohérent ! + + + + Invalid syntax in file `%1', line %2, column %3! + Syntaxe non valide dans le fichier `%1', ligne %2, colonne %3! + + + + Invalid instruction `%1' on file `%2', line %3, column %4! + Instruction invalide `%1' dans le fichier `%2', ligne `%3', colonne `%4' ! + + + + Unknown attribute `%1' in file `%2', line %3, column %4! + Attribut inconnu `%1' dans le fichier `%2', ligne `%3', colonne `%4' ! + + + + Invalid metacharacter `%1' in file `%2', line %3, column %4! + Métacaractère invalide `%1' dans le fichier `%2', ligne `%3', colonne `%4' ! + + + + Invalid operator `%1' in comparison expression, file `%2', line %3, column %4! + Opérateur invalide `%1' dans l'expression de comparaison, fichier `%2', ligne`%3', colonne `%4' ! + + + + Attribute `%1' with an undefined value in file `%2', line %3, column %4! + L'attribut `%1' a une valeur non définie dans le fichier `%2', ligne`%3', colonne `%4' ! + + + + Attribute `%1' with an invalid name in file `%2', line %3, column %4! + L'attribut `%1' a un nom invalide dans le fichier `%2', ligne`%3', colonne `%4' ! + + + + Could not access the file or directory `%1'! Make sure that it exists or if the user has access permissions on it! + Impossible d'acceder au fichier ou fossier `%1' ! Vérifiez qu'il existe et que l'utilisateur à les droits d'écritures ! + + + + Could not load file `%1'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! + Impossible de charger le fichier `%1'. La même chose semble être incohérente ou l'une de ses dépendances (fichiers DTD) a des erreurs ou est manquante ! + Reference to a tuple with an invalid index or the result is empty (no tuples)! - + Référence à un tuple avec un index invalide ou le résultat est vide (pas de tuple) ! + Invalid use of a view reference as whole SQL definition! The assigned reference must be an expression! - + Utilisation invalide d'une référence de vue comme définition SQL entière ! La référence affectée doit être une expression ! + At the moment pgModeler does not support the creation of primary keys which some columns were generated by relationship connection. To create primary keys with this feature you can use the field `Identifier' or the tab `Primary key' on relationship editing form! - + Actuellement pgModeler ne supporte pas la création de clés primaires dont certaines colonnes ont été générées par la connection d'associations. Pour créer des clés primaires avec cette fonctionnalité, vous pouvez utiliser le champ `Identifier' ou l'onglet `Primary key' sur le formulaire d'édition de relation ! + Reference to a function id which is incompatible with the user define type configuration! - + Référence à un identifiant de fonction incompatible avec la configuration du type de définition de l'utilisateur ! + + + + Unsupported PostgreSQL version (%1) detected! Valid versions are between %2 and %3. + Version PostgreSQL non prise en charge (%1) détectée! Les versions valides sont comprises entre %2 et %3. + Invalid use of variadic parameter mode! This mode can be used only with an array or "any" data type! - + Utilisation invalide du mode paramètre variadique ! Ce mode ne peut être utilisé qu'avec un tableau ou un type de données "any" ! + + The object `%1' (%2), oid `%3', could not be imported due to one or more errors! Check the exception stack for more details. `HINT:' if the object somehow references objects in `pg_catalog' or `information_schema' consider enable the importing of system objects. + L'objet `%1 '(%2), oid `%3', n'a pu être importé en raison d'au moins une erreur ! Vérifiez la pile d'exceptions pour plus de détails. `REMARQUE : 'Si l'objet référence d'une manière ou d'une autre les objets dans` pg_catalog' ou `information_schema ', envisagez d'importer les objets système. + + + Assignment of an invalid object to `%1' (%2)! The assigned object must be of type `%3'. - + Affectation d'un objet invalide à `%1' (%2) ! L'objet affecté doit être de type `%3'. + It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function or a sequence object must be directly assigned to the column! - + Il n'est pas possible de convertir le type de la colonne `%1' en série ! Il doit avoir un type basé sur `integer' et sa valeur par défaut doit être un appel à la fonction `nextval (seq_name::regclass)' ou un objet séquence doit être directement assigné à la colonne ! + + + + Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. + + ** Returned error ** + +%4 + Impossible d'exécuter l'opération `%1 'sur `%2' en utilisant les données de la ligne `%3 '! Tous les changements ont été annulés. + + ** Erreur retournée ** + +%4 + Trying to undo/redo an invalid operation over an object that does not exists anymore or can't be handled! The operation history will be cleaned up. - + Tentative d'annulation/de rétablissement d'une opération invalide sur un objet qui n'existe plus ou ne peut plus être géré ! L'historique des opérations sera nettoyé. + A parent table of `%1' which OID is `%2' was not found in the set of imported objects! - + Une table parente de `%1' dont l'OID est `%2' n'a pas été trouvée dans l'ensemble des objets importés ! + The enumeration `%1' can't be assigned to the type `%2' because contains invalid characters! - + L'énumération `%1' ne peut pas être affectée au type `%2' car elle contient des caractères non valides ! + The enumeration `%1' can't be assigned to the type `%2' because is too long! - + L'énumération `%1' ne peut pas être affectée au type `%2' car elle est trop longue ! + The connection was idle for too long and was automatically closed! - + La connexion était inactive depuis trop longtemps et a été automatiquement fermée ! + The connection was unexpectedly closed by the database server `%1' at port `%2'! - + La connexion a été fermée de manière inattendue par le serveur de la base de données `%1' sur le port `%2' ! ExtensionWidget - Form - Formulaire - - + Version: - Version: + Version : + Old Version: - Ancienne version: + Ancienne version : + This attribute cannot be changed once the object is created. Cet attribut ne peut être modifié une fois l'objet créé. + Handles data type - Prendre en charge les types de données + Gérer les types de données FindReplaceWidget + Form Formulaire + + Hide this widget + + + + + ... + ... + + + Replace one occurrence Remplace une occurrence + Replace Remplacer + Replace all occurrences Remplace toutes les occurrences + Replace All Remplacer tout + Replace the selection and find the next one Remplacer l'occurrence courante et trouver le suivant + Replace && Find Remplacer && Suivant + Replace: - Remplacer par: + Remplacer par : + Find: - Recherche: + Recherche : + Find previous Précédent + Shift+F3 - Shift+F3 + Maj+F3 + Find next Suivant + F3 F3 + Case sensitive Respecter la casse + Regular expression Expression régulière + Whole words Mots entier @@ -4347,563 +5338,753 @@ Message returned by the DBMS: `%1' FunctionWidget - Form - Formulaire - - + Attributes Attributs - Langague: - Langage: - - + Function Type: - Type de fonction: + Type de fonction : + Execution Cost: - Coût d'exécution: + Coût d'exécution : + Rows Returned: - Lignes retournées: + Lignes retournées : + Behavior: - Comportement: + Comportement : + Security: - Sécurité: + Sécurité : + Return Method: - Type de retour: - - - Simple - Simple + Type de retour : + Set Multiple - Table - Table - - + Return Table Table de retour + Windown Func. - Fonct. fenêtrage + Fonct. fenêtrage. + Leakproof Leakproof + Parameters Arguments + Definition Définition + Dynamic Library: - Bibliotèque dynamique: + Bibliothèque dynamique : + Symbol: - Symbole: + Symbole : + Library: - Bibliotèque: + Bibliothèque : + Source code: - Code source: + Code source : + Column Colonne + + Type - Type + + Name Nom + Mode - Mode + + Default Value Valeur par défaut + Si&mple - + Si&mple + Tab&le - + Tab&le + + + + Language: + Langage : GeneralConfigWidget + Form Formulaire + Milimeters Millimètres + Pixels Pixels + Inches Pouces + Centimeter Centimètres + A0 (841 x 1189 mm) A0 (841 x 1189 mm) + General && Design Général && modélisation - The opened models will be saved periodically - Les modèles ouverts seront sauvegardés à interval régulier - - + Check if there is a new version on server Vérifier la présence d'une nouvelle version au lancement + Design Modélisation + Graphical objects (table, views and textboxes) will be created in a single step without the need to click on canvas - Les nouveaux objets graphiques (tables, vues, zones de textes) seront ajoutés au modèle sans avoir besoin d'effectuer un second clic sur le caneva pour les positionner + Les objets graphiques (tables, vues, zones de textes) seront créés en une seule étape sans avoir besoin de cliquer sur le canevas. + Simplify creation of graphical objects Créer les nouveaux objets en un clic + After loading the model the last zoom and position on canvas will be restored - Restaure la dernière position ainsi que le zoom sur le caneva à l'écran lors de l'ouverture d'un modèle + Après le chargement du modèle, le dernier zoom et la position du canevas seront restaurés. + Save and restore last position and zoom Sauvegarder la position et le zoom - Disable antialiasing for lines and texts improving performance on huge models (requires restart) - Désactive l'anticrénelage pour les lignes et les textes afin d'améliorer la réactivité de l'application sur des modèles très etoffés (nécessite un redémarrage) - - + Disable render smoothness Désactiver l'anticrénelage + Hide the object that represents the relationship name - Masque l'étiquette indiquant le nom de chaque association - - - Operations like save, export and diff will be executed without asking user to validate the model - Certaines opérations comme l'enregistrement du fichier, l'export ou encore le différenetiel seront lancées sans demander à l'utilisateur de valider le modèle avant + Masque l'étiquette indiquant le nom de chaque association. + Validate before save, export or diff Validation du modèle toujours requise + Hide the object which represents the tag assigned to the table - Masque l'étiquette indiquant le tag associé à chaque table + Masquer l'objet qui représente la balise affectée à la table. + Hide the portion of table which represent triggers, indexes and rules - Masque les règles, les déclencheurs et les index dans l'affichage des tables - - - Swap panning and range selection triggers - Inverser le comportement du clic gauche - - - Toggles the code completion in all fields that accepts the input of SQL commads. - Active la complétion du code SQL dans les zones de texte prévues à cet effet. + Masque les règles, les déclencheurs et les index dans l'affichage des tables. + Enable SQL code completion Activer la complétion du code SQL + Printing && Code Impression && édition + + Size: + Taille : + + + + pt + pt + + + + Font: + Police : + + + + Hide relationship name + Masquer le nom des associations + + + + Hide table extended attributes + Masquer les attributs étendus des tables + + + + Paper: + Papier : + + + + Orientation: + Orientation : + + + + General + Général + + + + Operation history: + Historique des opérations : + + + + Hide table tags + Masquer les balises des tables + + + + Printing + Impression + + + + + Options: + Options : + + + + Print grid + Imprimer la grille + + + A1 (594 x 841 mm) - A1 (594 x 841 mm) + + A2 (420 x 594 mm) - A2 (420 x 594 mm) + + A3 (297 x 420 mm) - A3 (297 x 420 mm) + + A4 (210 x 297 mm) - A4 (210 x 297 mm) + + A5 (148 x 210 mm) - A5 (148 x 210 mm) + + A6 (105 x 148 mm) - A6 (105 x 148 mm) + + A7 (74 x 105 mm) - A7 (74 x 105 mm) + + A8 (52 x 74 mm) - A8 (52 x 74 mm) + + A9 (37 x 52 mm) - A9 (37 x 52 mm) + + B0 (1030 x 1456 mm) - B0 (1030 x 1456 mm) + + B1 (728 x 1030 mm) - B1 (728 x 1030 mm) + + B10 (32 x 45 mm) - B10 (32 x 45 mm) + + B2 (515 x 728 mm) - B2 (515 x 728 mm) + + B3 (364 x 515 mm) - B3 (364 x 515 mm) + + B4 (257 x 364 mm) - B4 (257 x 364 mm) + + B5 (182 x 257 mm) - B5 (182 x 257 mm) + + B6 (128 x 182 mm) - B6 (128 x 182 mm) + + B7 (91 x 128 mm) - B7 (91 x 128 mm) + + B8 (64 x 91 mm) - B8 (64 x 91 mm) + + B9 (45 x 64 mm) - B9 (45 x 64 mm) + + C5E (163 x 229 mm) - C5E (163 x 229 mm) + + Comm10E (105 x 241 mm) - Comm10E (105 x 241 mm) + + DLE (110 x 220 mm) - DLE (110 x 220 mm) + + Executive (191 x 254 mm) - Executive (191 x 254 mm) + + Folio (210 x 330 mm) - Folio (210 x 330 mm) + + Ledger (432 x 279 mm) - Ledger (432 x 279 mm) + + Legal (216 x 356 mm) - Legal (216 x 356 mm) + + Letter (216 x 279 mm) - Lettre (216 x 279 mm) + + Tabloid (279 x 432 mm) - Tabloid (279 x 432 mm) + - Code font style - Style de police pour le code SQL + + Custom + Personnalisé - Size: - Taille: + + Unity: + Unité : - pt - pt + + Custom Size: + Taille papier : - Font: - Police: + + Width: + Largeur : - Hide relationship name - Masquer le nom des associations + + Height: + Hauteur : - Hide table extended attributes - Masquer les attributs étendus des tables + + Page Margins: + Marges : - Paper: - Papier: + + Left: + Gauche : - Orientation: - Orientation: + + Left margin + Marge de gauche - Autosave interval: - Interval d'auto-enregistrement: + + Top: + Haut : - Grid size: - Taille de la grille: + + Top margin + Marge du haut - General - Général + + Right: + Droite : - Check for updates at startup - Vérifier MAJ au démarrage + + Right margin + Marge de droite - Operation history: - Historique des opérations: + + Bottom: + Bas : - By default panning mode is triggered with left click and range selection with Shift + left click. - Par défaut : le clic gauche permet de déplacer le canevas (glisser-déplacer), la sélection multiple (rectangle) s'effectue par Shift + clic gauche. + + Bottom margin + Marge du bas - Hide table tags - Masquer le tag des tables + + Landscape + Paysage - Printing - Impression + + Portrait + Portrait - Options: - Options: - + + Print page numbers + Imprimer les numéros de page + - Print grid - Imprimer la grille + + Start move the canvas when the cursor is on the canvas edges + Commencer à déplacer le canevas lorsque le curseur se trouve sur les bords de celui-ci. - Custom - Personalisé + + Move canvas by keep mouse on corners + Déplacer le canevas en gardant la souris sur les coins - Unity: - Unité: + + Disable antialiasing for lines and texts improving performance when handling huge models. + Désactiver l'antialiasing pour les lignes et les textes améliore les performances lors de la manipulation d'énormes modèles. - Custom Size: - Taille papier: + + Triggers a dialog asking the user to validate the model before a save, export or diff operation. + Déclenche une boîte de dialogue demandant à l'utilisateur de valider le modèle avant une opération de sauvegarde, d'export ou de comparaison. - Width: - Largeur: + + When enabled this option creates a placeholder object at the previous table's position when starting to move it. This will cause graphical updates on relationship lines to be performed only when the drag & drop action is done improving the performance. Disabling placeholders will cause those updates to be executed every time the table's position changes a single pixel (classical behavior). + Lorsqu'elle est activée, cette option crée un objet réservé à la position de la table précédente lorsque vous commencez à la déplacer. Afin d'améliorer les performances, la mise à jour graphique sur les lignes associées ne se fera uniquement qu'une fois l'action de glisser-déposer términée. La désactivation des espaces réservés entraîne l'exécution de ces mises à jour chaque fois que la position de la table change d'un seul pixel (comportement classique). - Height: - Hauteur: + + Use placeholders when moving tables + Utiliser des espaces réservés lors du déplacement de tables - Page Margins: - Marges de la page: + + Toggles the code completion in all fields that accepts the input of SQL commands. + (Dés)active l'achèvement du code dans tous les champs qui acceptent les commandes SQL en entrée. - Left: - Gauche: + + Code style + Style du code - Left margin - Marge gauche + + Colors: + Couleurs : - Top: - Haut: + + Display line numbers + Afficher les numéros de ligne - Top margin - Marge haute + + Highlight lines at cursor's position + Surligner les lignes à la position du curseur - Right: - Droite: + + Custom tab width: + Largeur d'onglet personnalisé : - Right margin - Marge droite + + Line numbers' font color + Couleur de la police des numéros de ligne - Bottom: - Bas: + + Line numbers' background color + Couleur d'arrière-plan des numéros de ligne - Bottom margin - Marge basse + + Highlighted line color + Couleur de la ligne en surbrillance - Landscape - Paysage + + The little brown fox jumps over the lazy dog + Le petit renard brun saute par-dessus le chien paresseux - Portrait - Portrait + + System default + Défaillance du système - Print page numbers - Imprimer les numéros de page + + All files (*.*) + Tous les fichiers (*.*) - minute(s) - minute(s) + + Load file + Charger un fichier - items - entrées + + Minimum object opacity (%): + Opacité min. des objets (%) : - pixels - pixels + + Defines the minimum opacity percentage applied to the objects when using the fade out feature. A zero opacity causes the object to be completely hidden not being possible to interact with it in the canvas area. + Définit le pourcentage d'opacité minimum appliqué aux objets lorsqu'ils sont estompés. Une opacité nulle cache complètement l'objet sans qu'il soit possible d'interagir avec lui dans la zone de canevas. - Start move the canvas when the cursor is on the canvas edges - + + Canvas grid size: + Taille de grille du canevas : - Move canvas by keep mouse on corners - + + Defines the vertical and horizontal grid size. This value affects the spacing of objects when using object grid alignment feature. + Définit la taille de la grille verticale et horizontale. Cette valeur affecte l'espacement des objets lors de l'utilisation de la fonction d'alignement des objets sur la grille. - Disable antialiasing for lines and texts improving performance when handling huge models. - + + By default the range selection is triggered with Shift + left click. By checking this option range selection will be activated only with a single click and move. + Par défaut, la sélection de plage est déclenchée avec Maj + clic gauche. En cochant cette option, la sélection de la gamme sera activée qu'en un seul clic et se déplacera. - Triggers a dialog asking the user to validate the model before a save, export or diff operation. - + + Trigger range selection with a single click + Déclenchement de la sélection en un clic - When enabled this option creates a placeholder object at the previous table's position when starting to move it. This will cause graphical updates on relationship lines to be performed only when the drag & drop action is done improving the performance. Disabling placeholders will cause those updates to be executed every time the table's position changes a single pixel (classical behavior). - + + Defines the maximum amount of elements held in the operation history. Once reached the maximum number the history is automatically cleaned. + Définit le nombre maximal d'éléments contenus dans l'historique des opérations. Une fois le nombre maximum atteint, l'historique est automatiquement nettoyé. - Use placeholders when moving tables - + + Defines the period when the opened models will be saved automatically. + Définit la période (en minute) d'enregistrement automatique des modèles ouverts. - Toggles the code completion in all fields that accepts the input of SQL commands. - + + Autosave interval (minutes): + Intervalle sauv. auto : - Code style - + + Replaces any straight line in relationship by curved ones in order to improve the model's visualization. + Remplace les lignes droites des relations par des courbes pour améliorer la lisibilité du modèle. - Colors: - Couleur: + + Use curved lines for relationships + Utiliser des lignes courbes pour les associations - Display line numbers - + + SQL history max. length: + Longueur max. de l'historique SQL : - Highlight lines at cursor's position - + + Souce code editor: + Éditeur de code source : - Custom tab width: - + + lines + lignes - Line numbers' font color - + + Clear the entire SQL comand history. + Nettoyer complètement l'historique des commandes SQL. - Line numbers' background color - + + Clear history + Nettoyer l'historique - Highlighted line color - + + Configurations directory: + Dossier de configuration : - The little brown fox jumps over the lazy dog - + + Browse the source code editor application + Rechercher l'éditeur de code source + + + + Open in file manager + Ouvrir dans le gestionnaire de fichier + + + + Check updates at startup + Vérifier MAJ au démarrage + + + + Souce code editor args: + Arg. pour l'éditeur de code source : + + + + User interface language: + Langue de l'interface graphique : + + + + Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. + Remplace la langue de l'interface utilisateur définie par défaut par le système. Nécessite de redémarrer le programme. <strong>REMARQUE :</strong> les traductions de l'interface utilisateur sont des collaborations avec des tiers; par conséquent, toute faute de frappe ou erreur doit être signalée directement à leurs responsables respectifs. - GraphicalView + GenericSQLWidget - Connected rels: %1 - Associations : %1 + + SQL code + Code SQL HintTextWidget + Form Formulaire @@ -4911,2857 +6092,3640 @@ Message returned by the DBMS: `%1' IndexWidget - Form - Formulaire - - + Attributes Attributs + Indexing: - Indexation: + Indexation : + Fill Factor: - Taux de remplissage: + Taux de remplissage : + Options: - Options: + Options : + Concurrent Concurrent + Unique Unique + Fast update Mise à jour rapide + Elements - Élements + Éléments + Buffering - + Mémoire tampon + Predicate: - + Prédicat : LanguageWidget - Form - Formulaire - - + Trusted: - De confiance: + De confiance : + The functions to be assigned to the language should have, respectively, the following signatures:<br/><br/> <strong>Handler Function:</strong> <em>language_handler function()</em><br/> <strong>Validator Function:</strong> <em>void function(oid)</em><br/> <strong>Inline Function:</strong> <em>void function(internal)</em> - Les fonctions attribuées au langage doivent avoir espectivement les signatures suivantes:<br/><br/> <strong>Fonction de management:</strong> <em>language_handler fonction()</em><br/> <strong>Fonction de validation:</strong> <em>void fonction(oid)</em><br/> <strong>Fonction Inline:</strong> <em>void fonction(internal)</em> + Les fonctions attribuées au langage doivent avoir respectivement les signatures suivantes :<br/><br/> <strong>Fonction de gestion :</strong> <em>language_handler function()</em><br/> <strong>Fonction de validation :</strong> <em>void function(oid)</em><br/> <strong>Fonction sur une ligne :</strong> <em>void function(internal)</em> + Validator Func.: - + Fonc. de validation : + Handler Func.: - + Fonc. gestionnaire : + Inline Func.: - + Fonc. en ligne : MainWindow + pgModeler - PostgreSQL Database Modeler - pgModeler - PostgreSQL Database Modeler + pgModeler – Modeleur de bases de données PostgreSQL + + + + &Validation + + + + + Alt+V + + + + + Ctrl+F + + + Alt+O + + + + + Alt+B + + + + &File &Fichier + &Edit Édit&ion + &Show &Affichage - &Plugins - E&xtensions - - + Plugins Extensions + New Nouveau + Controls Contrôles + General Général + Ctrl+N Ctrl+N - Save - Enregistrer - - + Ctrl+S Ctrl+S + Zoom in Zoom + + Ctrl+= Ctrl+= + Zoom out Zoom - + Zoom - Zoom - + Ctrl+- Ctrl+- - Load - Ouvrir - - + Ctrl+O Ctrl+O - Next - Suivant - - - Ctrl+Right - Ctrl+Right - - - Previous - Précédent - - - Ctrl+Left - Ctrl+Left - - - Save as - Enregistrer sous - - - Exit - Quitter - - + Ctrl+Q Ctrl+Q - About pgModeler - À propos de pgModeler - - + Export the current opened model in different modes Exporter le modèle courant sous différentes formes - Close - Fermer - - + Close current model Fermer le modèle courant + Ctrl+H Ctrl+H - Settings - Paramètres - - + Edit pgModeler settings Configurer pgModeler + F10 F10 - Wiki - Wiki - - - Access the wiki pages - Visiter le wiki (site) - - - CSS - CSS - - + Access the list of loaded plugins - Accéder a la liste des extensions chargées - - - Recent Models - Modèles récents + Accéder à la liste des extensions chargées + Load recently opened model Charger des modèles ouverts récemment - Import - Importer - - + Import existing database to new model (reverse engineering) Importer une base de données existante vers un modèle (reverse engineering) + Ctrl+Shift+I - Ctrl+Shift+I - - - Restore Session - Restaurer la session - - - Fix a model - Réparer un modèle + Ctrl+Maj+I + New version found! - Nouvelle version disponible! + Nouvelle version disponible ! + Update for the current version is available on project's site Une mise à jour pour votre version est disponible sur le site de pgModeler - Check for update - Vérifier les mises à jour - - + Main menu Menu principal + Show expanded Afficher la barre de menus + Hide main menu Cacher la barre de menus + Hides the main menu bar and put the action on a separated action Masque la barre de menu (le menu reste accessible via un bouton dans la barre d'outils) + Ctrl+Shift+H - Ctrl+Shift+H - - - Diff - Différencier - - - Determine the changes between model and database - Déterminer les modifications apportées entre un modèle et une base existante + Ctrl+Maj+H + Welcome Accueil + Welcome screen Écran d'accueil + Design Modéliser - Design datase models - Modéliser une base de données - - + Manage Administrer + Manage existent databases Administrer des bases existantes - Bug report - Rapporter un bug - - - F1 - F1 - - + O&bjects O&bjets - Alt+B - Alt+B - - - &Validation - &Validation - - - Alt+V - Alt+V - - + &Operations &Opérations - Alt+O - Alt+O - - + Find Object Chercher un objet - Ctrl+F - Ctrl+F - - - msg - message - - - Help - Aide - - - F4 - F4 - - - Print - Imprimer - - - Ctrl+P - Ctrl+P - - - Undo - Annuler - - - Ctrl+Z - Ctrl+Z - - - Redo - Rétablir - - - Ctrl+Y - Ctrl+Y - - - Export - Exporter - - + Ctrl+Shift+S - Ctrl+Shift+S + Ctrl+Maj+S + Show grid Afficher la grille - Ctrl+G - Ctrl+G - - - Ctrl+W - Ctrl+W - - - Normal zoom - Zoom normal - - - Ctrl+0 - Ctrl+0 - - - Align to grid - Aligner sur la grille - - + Align objects position to grid Aligner les objets sur la grille - Show delimiters - Afficher les délimiteurs - - + Show the page delimiters Afficher les délimiteurs de page - Ctrl+L - Ctrl+L - - + Save all Tout enregistrer - Overview - Vue d'ensemble - - + Show the model overview Afficher la vue d'ensemble du modèle - Save all models - Enregistrer tous les modèles - - + Clear Menu - Vider cette liste des modèles récents + Vider le menu + The demonstration version can create only `one' instance of database model! - La version de démonstration ne peut gérer qu'un seul modèle de base à la fois ! + La version de démonstration ne peut gérer qu'une seule instance de modèle de base de données ! + + Save model Enregistrer le modèle + + Warning Avertissement + Save '%1' as... Enregistrer '%1' sous... + + Database model (*.dbm);;All files (*.*) Modèle de base de données (*.dbm);; Tous les fichiers (*.*) + Database model printing Impression du modèle de base de données - Confirmation - Confirmation - - - Some models were modified! Do you really want to quit pgModeler without save them? - Des modifications n'ont pas été enregistrées ! Êtes-vous sûr de vouloir QUITTER pgModeler SANS SAUVEGARDER ? - - - The model was modified! Do you really want to close without save it? - Le modèle a été modifié. -Voulez-vous vraiment le FERMER SANS le SAUVEGARDER? - - + Save anyway Sauvegarder quand même + + + Validate Valider + Changes were detected in the definitions of paper/margin of the model which may cause the incorrect print of the objects. Do you want to continue printing using the new settings? To use the default settings click 'No' or 'Cancel' to abort printing. - Des modifications ont été détectées dans les définitions du papier ou des marges du modèle ce qui pourrait causer une mauvaise impression des objets. Souhaitez vous continuer l'impression avec les nouveaux paramètres? Pour utiliser les paramètres par défaut cliquez sur 'Non' ou 'Annuler' pour interrompre l'impression. + Des modifications ont été détectées dans les définitions du papier ou des marges du modèle ce qui pourrait causer une mauvaise impression des objets. Souhaitez-vous continuer l'impression avec les nouveaux paramètres ? Pour utiliser les paramètres par défaut cliquez sur 'Non' ou sur 'Annuler' pour interrompre l'impression. + Load model Charger un modèle + Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again. - Impossible de charger le modèle `%1'. Consultez la pile d'appel pour plus de détails. Essayez de réparer le modèle pour tenter de l'ouvrir à nouveau. + Impossible de charger le ficher modèle de base de données `%1'. Consultez la pile d'appel pour plus de détails. Essayez de réparer le modèle pour tenter de l'ouvrir à nouveau. + Fix model Réparer un modèle + Cancel Annuler - Open Wiki pages - Accèder au Wiki - - + This action will open a web browser window! Want to proceed? - Cette action ouvrira votre navigateur web! Souhaitez vous continuer? + Cette action ouvrira votre navigateur web ! Souhaitez vous continuer ? + Toggle the model objects widget - + (Dés)activer le widget des objets du modèle + Toogle the model validation widgets - + (Dés)activer le widget de validation du modèle + Toggle the operation history widget - + (Dés)activer le widget de l'historique des opérations + Toggle the object finder - + (Dés)activer le chercheur d'objet + action_main_menu - + action_menu_principal + Expands the main menu bar in classical mode - + Développe la barre de menus principale en mode classique - (Demo) - + + Saving temp. models + Sauvegarde temp. des modèles - Saving temp. models - + + Grid + Grille + + + + Hierarchical + Hiérarchique + + + + Scattered + Dispersé + + + + (Demo) + (Démo) + You're running a demonstration version! The model saving feature is available only in the full version! - + Vous utilisez une version de démonstration ! La fonction d'enregistrement du modèle est uniquement disponible dans la version complète ! + + + + + + Confirmation + + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! It's recommended to validate it before save in order to create a consistent model otherwise the generated file will be broken demanding manual fixes to be loadable again! - <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de l'enregistrer il est recommandé de le valider afin de créer un modèle cohérent, sinon il peut en résulter un fichier mal formé nécessitant une édition manuelle pour pouvoir être chargé à nouveau dans l'application par la suite ! + <strong>AVERTISSEMENT :</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Il est recommandé de le valider avant de l'enregistrer afin de créer un modèle cohérent, sinon il peut en résulter un fichier cassé nécessitant une réparation manuelle pour être chargé à nouveau chargeable ! + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the export process it's recommended to validate in order to correctly create the objects on database server! - <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de procéder à un export il est recommandé de valider le modèle afin s'assurer de créer correctement les objets en base ! + <strong>AVERTISSEMENT :</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de procéder à un export il est recommandé de le valider afin de s'assurer de correctement créer les objets sur le serveur de base de données ! + Export anyway Exporter quand même + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the diff process it's recommended to validate in order to correctly analyze and generate the difference between the model and a database! - <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de procéder à un différentiel il est recommandé de valider le modèle afin s'assurer que l'analyse entre celui-ci de la base de donnée se fasse correctement ! + <strong>AVERTISSEMENT :</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de procéder à une comparaison il est recommandé de le valider afin de s'assurer que l'analyse entre celui-ci de la base de donnée se fasse correctement ! + Diff anyway - Différencier quand même + Comparer quand même + (no samples found) - + (aucun exemple trouvé) + save - + sauvegarde + export - + exporter + diff - + comparer + Executing pending <strong>%1</strong> operation... - + Exécution de l'opération <strong>%1</strong> en attente... + + + + Rearrange objects over the canvas is an irreversible operation! Would like to proceed? + Réorganiser les objets sur le canvas est une opération irréversible ! Voulez-vous poursuivre ? + He&lp - + Ai&de + Pl&ugins - + Mod&ules + &New - + &Nouveau + New model - Nouveau modèle + Nouveau modèle + &Save - E&nregistrer + E&nregistrer + &Zoom in - + &Zoomer + Zoo&m out - + Dézoo&mer + &Load - O&uvrir + C&harger + Sa&ve as - + Enre&gistrer sous + E&xit - + Qui&tter + Exit pgModeler - + Quitter pgModeler + &About pgModeler - + &À propos de pgModeler + + + + F4 + + &Print - + Im&primer + Print model - + Imprimer le modèle + + Ctrl+P + + + + &Undo - + Ann&uler + Undo operation - + Annuler l'opération + + + + Ctrl+Z + + &Redo - + &Rétablir + Redo operation - + Rétablir l'opération + + + + Ctrl+Y + + &Export - &Exporter + &Exporter + Ctrl+Shift+E - + Ctrl+Maj+E + &Show grid - + A&fficher la grille + + + + Ctrl+G + + &Close - &Fermer + &Fermer + + + + Ctrl+W + + &Normal zoom - + Zoom &normal + + + + Ctrl+0 + + &Align to grid - + &Aligner sur la grille + Show &delimiters - + Afficher les &délimiteurs + + + + Ctrl+L + + &Settings - + Paramètre&s + F12 - F12 + + &Overview - + &Vue d'ensemble + &Support - + + Access the support page - + Accéder à la page du support + + + + F1 + + New object - + Nouvel objet + &Recent Models - + Modèles &récents + &Import - &Importer + &Importer + Rest&ore Session - + Restaurer la sessi&on + &Fix a model - + Réparer u&n modèle + &Check for update - + Re&chercher une mise à jour + &Diff - + &Comparer + Ctrl+Shift+D - + Ctrl+Maj+D + Shift+W - + Maj+W + Design database models - + Conception de modèles de base de données + Shift+D - + Maj+D + Shift+M - + Maj+M + &Bug report - + Rapport de &bug + Report a bug - + Rapporter un bug + Donate - + Faire un don + Help pgModeler by donating! - + Aider pgModeler en faisant un don ! + Objects me&tadata - + Mé&tadonnées des objets + Objects metadata - + Métadonnées des objets + Save modified model(s) - + Enregistrer le(s) modèle(s) modifié(s) + The following models were modified but not saved: %1. Do you really want to quit pgModeler? - + Les modèles suivants ont été modifiés mais non enregistrés : %1. Voulez-vous vraiment quitter pgModeler ? + The model <strong>%1</strong> was modified! Do you really want to close without save it? - + Le modèle <strong>%1</strong> a été modifié ! Êtes-vous certain de vouloir quitter sans l'enregistrer ? + Access support page - + Accéder à la page de support + You're running a demonstration version! Note that you'll be able to create only <strong>%1</strong> instances of each type of object and some key features will be disabled or limited!<br/><br/>You can purchase a full binary copy or get the source code at <a href='http://pgmodeler.com.br'>pgmodeler.com.br</a>. <strong>NOTE:</strong> pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and cover all development costs.<br/><br/> <strong>HINT:</strong> in order to test all features it's recommended to use the <strong>demo.dbm</strong> model located in </strong>Sample models</strong> at <strong>Welcome</strong> view.<br/><br/><br/><br/> - + Vous utilisez une version de démonstration ! Notez que vous ne pourrez créer que <strong>%1</strong> instances de chaque type d'objet et que certaines fonctionnalités clés seront désactivées ou limitées !<br/><br/>Vous pouvez acheter une copie binaire complète ou obtenir le code source sur <a href='http://pgmodeler.com.br'> pgmodeler.com.br </a>. <strong> REMARQUE :</strong> pgModeler est un logiciel open source, mais l'achat de copies binaires ou la fourniture de dons soutiendra le projet et couvrira tous les coûts de développement.<br/><br/> <strong>CONSEIL :</strong> Pour tester toutes les fonctionnalités, il est recommandé d'utiliser le modèle <strong>demo.dbm</strong> situé dans <strong>exemples de modèles</strong> dans la vue <strong>Bienvenue</strong>.<br/><br/><br/><br/><br/> + + + + Determine the changes between model/database and another database + Déterminer les changements entre le modèle/la base de données et une autre base de données + + + + Arrange objects + Organiser des objets + + + + Rearrange objects over the canvas + Réorganiser les objets sur le canevas Messagebox + Dialog Boîte de dialogue + msg message + Exceptions Exceptions + Show/hide exceptions stack. - Afficher/cacher la pile d'exceptions. + Afficher/cacher la pile d'exceptions. + ... ... + + &Yes &Oui + + &No &Non + + Information + + + + + Confirmation + + + + Cancel Annuler + Error Erreur + Alert Alerte - Information - Information - - - Confirmation - Confirmation - - + &Ok &Ok + &Cancel A&nnuler + Show raw text errors or information. - + Afficher le texte brute des erreurs ou des informations. MetadataHandlingForm + Handle metadata - + Gérer les métadonnées + &Apply - &Appliquer + &Appliquer + &Cancel - A&nnuler + A&nnuler + Handle objects metadata - + Gérer les métadonnées d'objets + Settings - Paramètres + Paramètres + Extract from: - + Extraction depuis : + Loading a metadata file to the current model is an irreversible operation so be sure to specify a backup file before proceed. - - - - Options - Options + Le chargement d'un fichier de métadonnées dans le modèle actuel est une opération irréversible, assurez-vous de spécifier un fichier de sauvegarde avant de continuer. + Handles the following database model attributes in the metadata file: author, zoom factor, last position and default objects. - + Gère, dans le fichier de métadonnées, les attributs de modèle de base de données suivants : auteur, facteur de zoom, dernière position et objets par défaut. + Database model metadata - + Métadonnées du modèle de base de données + Handles the objects' positioning in the metadata file. - + Gère le positionnement des objets dans le fichier de métadonnées. + + + + Options + + Objects' positioning - + Positionnement des objets + Handles the objects' custom colors in the metadata file. Currently available only for relationships and schemas. - + Gère les couleurs personnalisées des objets dans le fichier de métadonnées. Actuellement disponible uniquement pour les associations et les schémas. + Custom object's colors - + Couleurs de l'objet personnalisé + Handles the objects' protection status in the metadata file. - + Gère l'état de protection des objets dans le fichier de métadonnées. + Objects' protection status - + Statut de protection des objets + Handles the objects' SQL disabled status in the metadata file. - + Gère le statut désactivé du code SQL des objets dans le fichier de métadonnées. + Objects' SQL disabled status - + Statut désactivé du code SQL des objets + Handles the objects' custom SQL commands in the metadata file. - + Gère les commandes SQL personnalisées des objets dans le fichier de métadonnées. + Custom SQL commands - - - - Save textboxes to the output file when extracting metadata. When loading the file textboxes are recreated and duplicated ones are ignored. - + Commandes SQL personnalisées + Textbox objects - - - - Save tags to the output file when extracting metadata. When loading the file tags are recreated and duplicated ones are ignored. - + Objets de zone de texte + Tag objects - + Balises des objets + Backup file: - + Fichier de sauvegarde : + + Select file - - - - ... - ... + Sélectionner un fichier + Apply to: - + Appliquer à : + Operation: - - - - Extracts the objects metadata from one of the loaded models and apply to the current model. - - - - Extract from a &model - - - - Reads the objects metadata from a previously saved backup file and apply to the current model. - - - - Restore a bac&kup file - + Opération : + Output - + Sortie + Progress label... - Indicateur de progression... + Indicateur de progression... + + model not saved yet - + modèle pas encore enregistré + The backup file cannot be the same as the input model! - + Le fichier de sauvegarde ne peut être le même que le modèle d'entrée ! + Extracting metadata to file `%1' - + Extraction des métadonnées vers le fichier `%1' + Saving backup metadata to file `%1' - + Enregistrement des métadonnées de sauvegarde vers le fichier `%1' + Applying metadata from file `%1' - + Application des métadonnées depuis le fichier `%1' + Metadata processing aborted! - + Traitement des métadonnées abandonné ! + Objects metadata file (*.omf);;All files (*.*) - + Fichiers de métadonnées d'objets (*.omf);;Tous les fichiers (*.*) - - - ModelDatabaseDiffForm - Settings - Paramètres + + Handles the objects' fade out status in the metadata file. + Gère l'estompement des objets dans le fichier de métadonnées. - Connection: - Connexion: + + Objects' fade out status + Effet d'estompement des objets - Connect and list available databases - Connecter et lister les bases de données disponibles + + Save tags to the output file when extracting metadata. When loading the file, the tags are recreated and duplicated ones are ignored. + Enregistrer les étiquettes dans le fichier de sortie lors de l'extraction des métadonnées. Lors du chargement du fichier, les balises sont recréées et les doublons ignorés. - ... - ... + + Save textboxes to the output file when extracting metadata. When loading the file, the textboxes are recreated and duplicated ones are ignored. + Enregistrer les zones de texte dans le fichier de sortie lors de l'extraction des métadonnées. Lors du chargement du fichier, les zones de texte sont recréées et les zones dupliquées ignorées. - Ignore import errors - Ignorer les erreurs + + Handles the tables' and views' extended attributes display status in the metadata file. + Gère l'état d'affichage des attributs étendus des tables et des vues dans le fichier de métadonnées. - Import system objects - Importer les objets système + + Tables' extended attributes display + Affichage étendu des attributs des tables - Import extension objects - Importer les objets des extensions + + Save generic SQL objects to the output file when extracting metadata. When loading the file, the objects are recreated and duplicated ones are ignored. + Enregistrer les objets SQL génériques dans le fichier de sortie lors de l'extraction des métadonnées. Lors du chargement du fichier, les objets sont recréés et les doublons ignorés. - File: - Fichier: + + Generic SQL objects + Objets SQL génériques - Select output file - Sélectionner un fichier de sortie + + ... + - Cancel - Annuler + + Extracts the objects' metadata from the loaded models and apply to the current focused model. A backup file can be specified to where the focused model's current metadata will be saved. + Extrait les métadonnées des objets des modèles chargés et s'applique au modèle ciblé actuel. L'emplacement du fichier de sauvegarde dans lequel les métadonnées actuelles du modèle ciblé seront enregistrées peut-être spécifié. - Progress label... - Indicateur de progression... + + &Extract and restore + &Extraction et restauration - 0 - 0 + + Extracts the objects metadata from one of the loaded models saving the info to a backup file. + Extrait les métadonnées d'objets de l'un des modèles chargés et enregistre les informations dans un fichier. - &Close - &Fermer + + Extract &only + Extracti&on seule - Waiting process to start... - En attente... + + Reads the objects' metadata from a previously saved backup file and apply to the current model. + Lit les métadonnées des objets à partir d'un fichier de sauvegarde précédemment enregistré et s'applique au modèle actuel. - Confirmation - Confirmation + + &Restore a backup file + &Restaurer une sauvegarde + + + ModelDatabaseDiffForm - SQL code (*.sql);;All files (*.*) - Code SQL (*.sql);;Tous les fichiers (*.*) + + Settings + Paramètres - Database model diff - + + + Connection: + Connexion : - Generate diff from model - + + Ignore import errors + Ignorer les erreurs d'import - Input database - + + Import system objects + Importer les objets système - Database: - + + Import extension objects + Importer les objets des extensions - Options - + + File: + Fichier : - Trucate tables before alter columns - + + Select output file + Sélectionner un fichier de sortie - For DROP command, the objects that depends on an object to be dropped will be deleted as well. For TRUNCATE command, tables that are linked to a table to be truncated will be truncate too. <strong>NOTE:</strong> this option can affect more objects than listed in the output or diff preview. - + + Cancel + Annuler - Drop or truncate in cascade mode - + + Progress label... + Indicateur de progression... + + &Close + &Fermer + + + + + Waiting process to start... + En attente du démarrage de la tâche... + + + + SQL code (*.sql);;All files (*.*) + Code SQL (*.sql);;Tous les fichiers (*.*) + + + + + + Database: + Base de données : + + + + For DROP command, the objects that depends on an object to be dropped will be deleted as well. For TRUNCATE command, tables that are linked to a table to be truncated will be truncate too. <strong>NOTE:</strong> this option can affect more objects than listed in the output or diff preview. + Pour la commande DROP, les objets qui dépendent d'un objet à supprimer seront également supprimés. Pour la commande TRUNCATE, les tables liées à une table à tronquer seront également tronquées. <strong>REMARQUE :</strong> cette option peut affecter plus d'objets que ceux listés dans l'aperçu de sortie ou de comparaison. + + + + Drop or truncate in cascade mode + Supprimer ou tronquer en mode cascade + + + Permissions already set on database objects will be kept.The ones configured on the model will be applied to the database. - + Les autorisations déjà définies sur les objets de la base de données seront conservées. Les données configurées sur le modèle seront appliquées à la base de données. + Keep object's permissions - + Conserver les permissions des objets + Database cluster level objects like roles and tablespaces will not be dropped. - + Les objets de niveau de cluster de base de données tels que les rôles et les espaces de stockage ne seront pas supprimés. + Keep cluster objects - + Conserver les objets de cluster + Recreate only unmodifiable objects - + Recréer uniquement des objets non modifiables + Force recreation of objects - + Forcer la recréation d'objets + Ignores errors generated by duplicated objects when exporting the diff to database. - + Ignore les erreurs générées par les objets dupliqués lors de l'export de la comparaison vers la base de données. + Ignore duplicity errors - + Ignorer les erreurs de duplicité + Serial columns are converted to integer and having the default value changed to <strong>nextval(sequence)</strong> function call. By default, a new sequence is created for each serial column but checking this option sequences matching the name on column's default value will be reused and will not be dropped. - + Les colonnes de séries sont converties en nombre entier et la valeur par défaut est changée en appel de fonction <strong>nextval(sequence)</strong>. Par défaut, une nouvelle séquence est créée pour chaque colonne série, mais en cochant cette option, les séquences correspondantes au nom de la valeur par défaut de la colonne seront réutilisées et ne seront pas supprimées. + Reuse sequences on serial columns - + Réutiliser des séquences sur des colonnes de séries + Diff mode - + Mode comparaison + Override the PostgreSQL version when generating the diff. The default is to use the same version as the input database. - + Outrepasser la version de PostgreSQL lors de la génération de la comparaison. Par défaut, la valeur est celle de la version de la base de données. + Use PostgreSQL: - + Utiliser PostgreSQL : + Compares the model and the input database storing the diff in a SQL file for later usage. - + Compare le modèle avec la base de données d'entrée et stock le résultat dans un fichier SQL pour une utilisation ultérieure. + + + + ... + + Compares the model and the input database generating a diff and applying it directly to the latter. <strong>WARNING:</strong> this mode causes irreversible changes on the database and in case of failure the original structure is not restored, so make sure to have a backup before proceed. - + Compare le modèle et la base de données d'entrée générant un résultat qui est appliqué directement à cette dernière. <strong>AVERTISSEMENT :</strong> ce mode entraîne des modifications irréversibles sur la base de données et, en cas d'échec, la structure d'origine n'est pas restaurée. Assurez-vous donc d'avoir une sauvegarde avant de continuer. + Output - + Sortie + Changes: - + Modifications : + Step label... - + Étiquette étape... + <html><head/><body><p>Objects marked with an <span style=" font-weight:600;">ALTER</span> may not be effectively changed unless that the differences detected are in attributes that can be modified through ALTER commands otherwise no operationwill be performed or, if the force recreation is checked, the object will be dropped and created again.</p></body></html> - + <html><head/><body><p>Les objets marqués d'un <span style="font-weight : 600;">ALTER</span> ne peuvent être modifiés efficacement que si les différences détectées sont dans les attributs qui peuvent être modifié à l'aide des commandes ALTER. Dans le cas contraire, aucune opération ne sera effectuée ou, si la recréation de force est vérifiée, l'objet sera supprimé et créé à nouveau.</p></body></html> + Objects to be created - + Objets à créer + + + + + + + 0 + + Objects to be dropped - + Objets à supprimer + Possible objects to be changed - + Objets possiblement modifiables + Ignored objects (system ones or with sql disabled) - + Objets ignorés (ceux du système ou avec code SQL désactivé) + Diff Preview - + Aperçu de la comparaison + &Apply diff - + &Appliquer la comparaison + &Generate - + &Générer - Importing database <strong>%1</strong>... - + + <strong>WARNING:</strong> The generated diff is ready to be exported! Once started this process will cause irreversible changes on the database. Do you really want to proceed? + <strong>AVERTISSEMENT :</strong> La comparaison générée est prête à être exportée ! Une fois démarré, ce processus entraînera des changements irréversibles dans la base de données. Voulez-vous vraiment poursuivre ? - Comparing the model <strong>%1</strong> and database <strong>%2</strong>... - + + Apply diff + Appliquer la comparaison - <strong>WARNING:</strong> The generated diff is ready to be exported! Once started this process will cause irreversible changes on the database. Do you really want to proceed? - + + Preview diff + Aperçu de la comparaison - Apply diff - + + model not saved yet + modèle pas encore enregistré - Preview diff - + + (none) + (aucun) - Exporting diff to database <strong>%1</strong>... - + + Step %1/%2: Importing database <strong>%3</strong>... + Étape %1/%2 : Import de la base de données <strong>%3</strong>... + + + + Step %1/%2: Comparing <strong>%3</strong> and <strong>%4</strong>... + Étape %1/%2 : Comparaison de <strong>%3</strong> et de <strong>%4</strong>... + + + + Confirmation + + + + + Step %1/%2: Exporting diff to database <strong>%3</strong>... + Étape %1/%2 : Export de la comparaison de la base de données <strong>%3</strong>... + Diff process paused. Waiting user action... - + Comparaison mise en pause. En attente d'une action utilisateur... + Saving diff to file <strong>%1</strong> - + Enregistrement de la comparaison vers le fichier <strong>%1</strong> + Diff process sucessfully ended! - + Comparaison términée avec succès ! + + No operations left. - + Aucune opération restante. + Operation cancelled by the user. - + Opération annulée par l'utilisateur. + Process aborted due to errors! - + Processus abandonné en raison d'erreurs ! + -- No differences were detected between model and database. -- - + -- Aucune différence détectée entre le modèle et la base de données. -- + Error code <strong>%1</strong> found and ignored. Proceeding with export. - Code erreur <strong>%1</strong> reçu et ignoré. Poursuite de l'export. + Code erreur <strong>%1</strong> reçu et ignoré. Poursuite de l'export. + Save diff as... - + Enregistrer la comparaison sous... + Ignores as many as possible errors on import step. This option generates an incomplete diff. - + Ignore autant d'erreurs que possible sur l'étape de l'import. Cette option génère une comparaison incomplète. + Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. - + Efface les données de toutes les tables qui auront des colonnes modifiées. Ceci est utile pour éviter les erreurs liées à la conversion de type. <strong>AVERTISSEMENT :</strong> N'utilisez PAS cette option sur les serveurs de production et faites toujours une sauvegarde avant de l'utiliser. + Import system (built-in) objects. Use this if the import step is returning errors related to missing objects. - + Importer des objets système (intégrés). Utiliser cette option si l'étape d'import renvoie des erreurs liées à des objets manquants. + Import objects created by extensions. Use this if the import step is returning errors even importing built in ones. - + Importer des objets créés par des extensions. Utiliser cette option si l'étape d'import renvoie des erreurs, même si celles-ci sont importées. + Instead of use an ALTER command to modify certain kind of objects a DROP and CREATE will be used in order to do a full modification. This option does not affects the database object. - + Au lieu d'utiliser une commande ALTER pour modifier certains types d'objets, un DROP et un CREATE seront utilisés pour effectuer une modification complète. Cette option n'affecte pas l'objet de base de données. + No command to rename the destination database will be generated even the model's name differ from database name. - + Aucune commande permettant de renommer la base de données de destination ne sera générée même si le nom du modèle diffère du nom de la base de données. + Preserve database name - + Conserver le nom de la base de données + Avoid the generation of DROP commands for objects that exists in database but not in the model. This is useful when diff a partial model against the complete database. - + Éviter la génération de commandes DROP pour les objets qui existent dans la base de données mais pas dans le modèle. Ceci est utile lorsque un modèle partiel a été comparé à la base de données complète. + Do not drop missing objects - + Ne pas supprimer les objets manquants + Store in S&QL file - + Stocker dans un fichier S&QL + Appl&y on server - + Appliquer sur le serveur + -- SQL code purposely truncated at this point in demo version! - + + +-- Le code SQL est volontairement tronqué à ce stade dans la version démo ! + + + + Diff tool + Outil de comparaison + + + + Generate diff code + Générer un code de comparaison + + + + Source database + Base de données source + + + + Current model: + Modèle courant : + + + + (model) + (modèle) + + + + Compare to + Comparer à + + + + Diff + Comparaison + + + + Import && Export + Import && Export + + + + Import + + + + + Export + + + + + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. + Cette option avancée oblige pgModeler à ignorer les erreurs supplémentaires par leurs codes numériques. Ces erreurs doivent être renseignées dans l'entrée ci-dessous et séparées par des espaces. Pour la liste complète des codes d'erreur, consulter les documents PostgreSQL, section <strong>Annexe A. Codes d'erreur PostgreSQL</strong>. <strong>AVERTISSEMENT :</strong> utiliser cette option avec un soin extrême, car elle peut interférer dans le résultat de l'export finale. + + + + Ignore error codes + Ignorer les codes d'erreur + + + + Froce the generation of DROP commands for columns and constraints that exist in database but not in the model. This is useful when diff a partial model against the complete database and the user needs to drop columns and constraint but preserve the rest of the objects. + Forcer la génération de commandes DROP pour les colonnes et les contraintes qui existent dans la base de données mais pas dans le modèle. Ceci est utile lorsqu'un modèle partiel est comparé à la base de données complète et que l'utilisateur doit supprimer les colonnes ainsi que les contraintes mais conserver les autres objets. + + + + Drop missing columns and constraints + Supprimer colonnes/contraintes manquantes + + + + Truncate tables before alter columns + Tronquer les tables avant de modifier les colonnes ModelExportForm - Model Export - Export du modèle - - + + File: - Fichier: + Fichier : + + Select target file Sélectionner le fichier cible + + ... ... + Zoom: - Zoom: + Zoom : + + Export model - Exportation d'un modèle + Export d'un modèle + Settings Paramètres + Database server Serveur de base de données + pgModeler ignores errors generated by duplicated objects and creates only that ones which does not exists in the database. This option may be used when an object was created after a previous model export. pgModeler ignorera les erreurs générées en raison d'objets dupliqués et ne créera uniquement ceux qui n'existent pas déjà en base. Cette option peut être utile lorsqu'un objet est créé après un précédent export. + PostgreSQL version in which the SQL code should be generated. It is recommended to select this option only when the version of the DBMS, somehow, is not identifiable or if you need to generate a specific version of SQL code for test purposes. Version de PostgreSQL pour laquelle le code SQL sera généré. Il est recommandé d'activer cette option uniquement si la version du SGBD n'est pas identifiable ou pour une raison spécifique par exemple pour des essais. + If <strong>DB</strong> is checked pgModeler will destroy the database if already exists on the server. When <strong>Objects</strong> is checked pgModeler will execute the DROP command attached to SQL-enabled objects. <strong>WARNING:</strong> this option leads to data loss so make sure to have a backup first. - Si <strong>BDD</strong> est coché pgModeler procèdera à la suppression complète de la base de données si elle existe déjà. Lorsque <strong>Objets</strong> est coché pgModeler effectuera la commande DROP rattachée à l'objet (si la génération du code SQL pour cet objet n'a pas été désactivée dans ses propriétés) <strong>AVERTISSEMENT:</strong> cette option engendre la perte de données, pensez à faire une sauvegarde avant. + Si <strong>BDD</strong> est coché, pgModeler procédera à la suppression complète de la base de données si elle existe déjà. Lorsque <strong>Objets</strong> est coché pgModeler effectuera la commande DROP rattachée à l'objet (si la génération du code SQL pour cet objet n'a pas été désactivée dans ses propriétés). <strong>AVERTISSEMENT :</strong> cette option engendre la perte de données, pensez à faire une sauvegarde avant. + Drop: - Ordre SQL intuitif - Drop: + Suppr. : + DB BDD - Objects - Objets - - - PNG Image - Image PNG - - + Show delimiters Afficher les délimiteurs de page + Exporting the model page by page will generate files with a <strong>_p[n]</strong> suffix where <strong>n</strong> is the page id. Check if the current user has write permission on output folder. - Exporter le modèle page par page génèrera des fichiers avec un suffixe de type <strong>_p[n]</strong> où <strong>n</strong> est le numéro de la page. Vérifiez que vous avez bien le droit d'écriture dans le dossier de sortie. + Exporter le modèle page par page générera des fichiers avec un suffixe de type <strong>_p[n]</strong> où <strong>n</strong> est le numéro de la page. Vérifiez que vous avez bien le droit d'écriture dans le dossier de sortie. + Page by page Une image par page + + PostgreSQL: - PostgreSQL: + PostgreSQL : + PostgreSQL version in which the SQL code should be generated Version de PostgreSQL pour laquelle le code SQL doit être généré + Cancel Annuler + pgModeler will destroy the database if already exists on the server. Make sure to have a backup before use this option because all data will be lost. pgModeler détruira la base de données si elle existe déjà sur le serveur. Assurez-vous d'avoir une sauvegarde si besoin avant car les données seront définitivement perdues. - Image: - Image: - - + Show grid Afficher la grille + Connection: - Connexion: + Connexion : + Ignore object duplicity Ignorer les objets dupliqués + SQL file Fichier texte SQL + + I&mage (PNG) + + + + Output Progression + Progress label... Indicateur de progression... + &Export &Exporter + &Close &Fermer + Initializing model export... - Initialisation de l'exportation du modèle... + Initialisation de l'export du modèle... + Saving file '%1' Enregistrement du fichier '%1' + + Exporting process aborted! - Processus d'exportation terminé en erreur! + Export abandonnée ! + Exporting process canceled by user! - Processus d'exportation annulé par l'utilisateur! + Export annulée par l'utilisateur ! + Exporting process sucessfuly ended! - Processus d'exportation terminé avec succès! + Export terminée avec succès ! + Export model as... Exporter le modèle sous... + Error code <strong>%1</strong> found and ignored. Proceeding with export. Code erreur <strong>%1</strong> reçu et ignoré. Poursuite de l'export. - SQL code (*.sql);;All files (*.*) - Fichiers SQL (*.sql);;Tous les fichiers (*.*) - - - PNG image (*.png);;All files (*.*) - Image PNG (*.png);;Tous les fichiers (*.*) - - + Ob&jects - + Ob&jets + Graphics file - - - - Image (PNG) - + Fichier graphique + Type: - Type: - - - Vectorial (SVG) - + Type : + SQL script (*.sql);;All files (*.*) - + Script SQL (*.sql);;Tous les fichiers (*.*) + Portable Network Graphics (*.png);;All files (*.*) - + Portable Network Graphics (*.png);;Tous les fichiers (*.*) + Scalable Vector Graphics (*.svg);;All files (*.*) - + Scalable Vector Graphics (*.svg);;Tous les fichiers (*.*) + + + + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. + Cette option avancée oblige pgModeler à ignorer les erreurs supplémentaires par leurs codes numériques. Ces erreurs doivent être renseignées dans l'entrée ci-dessous et séparées par des espaces. Pour la liste complète des codes d'erreur, consulter les documents PostgreSQL, section <strong>Annexe A. Codes d'erreur PostgreSQL</strong>. <strong>AVERTISSEMENT :</strong> utiliser cette option avec un soin extrême, car elle peut interférer dans le résultat de l'export finale. + + + + Ignore error codes + Ignorer les codes d'erreur + + + + &Vectorial (SVG) + &Vectoriel (SVG) ModelExportHelper + Generating SQL code for PostgreSQL `%1' - + Génération du code SQL pour PostgreSQL `%1' + Output SQL file `%1' successfully written. - + Fichier SQL de sortie `%1' écrit avec succès. + Rendering objects to page %1/%2. - + Rendu des objets de la page %1/%2. + Output image `%1' successfully written. - + Fichier image de sortie `%1' écrit avec succès. + Starting export to DBMS. - + Lancement de l'export vers le SGBD. + PostgreSQL version detection overridden. Using version `%1'. - + Détection de version dépassée de PostgreSQL. Utilisation de la version `%1'. + PostgreSQL `%1' server detected. - + Serveur PostgreSQL `%1' détecté. + Generating temporary names for database, roles and tablespaces. - + Génération de noms, de rôles et d'espace de stockage temporaires pour la base de données. + Enabling the SQL code for database `%1' to avoid errors. - + Activation du code SQL de la base de données `%1' pour éviter les erreurs. + Ignoring object duplication errors. - + Omission des erreurs de duplication d'objet. + Ignoring the following error code(s): `%1'. - + Omission des codes erreur suivants : `%1'. + Trying to drop database `%1'. - + Tentative de suppression de la base de données `%1'. + Simulation mode activated. - + Mode simulation activé. + Generating SQL for `%1' objects... - + Génération de code SQL pour `%1' objets... + Destroying objects created on the server. - + Destruction des objets créés sur le server. + Restoring original names of database, roles and tablespaces. - + Restauration des noms, des rôles et des espaces de stockage originaux de la base de données. + + + Creating object `%1' (%2) - + Création de l'objet `%1' (%2) + + Dropping object `%1' (%2) - + Suppression de l'objet `%1' (%2) + Changing object `%1' (%2) - + Modification de l'objet `%1' (%2) + Running auxiliary command. - + Exécution de la commande auxiliaire. + Exporting model to SVG file. - + Export du modèle vers un fichier SVG. + SVG representation of database model - + Représentation SVG d'un modèle de base de données + SVG file generated by pgModeler - + Fichier SVG généré par pgModeler + Output file `%1' successfully written. - + Fichier de sortie `%1' écrit avec succès. + Creating database `%1' - + Création de la base de données `%1' + Connecting to database `%1' - + Connexion à la base de données `%1' + Renaming `%1' (%2) to `%3' - + Renommage de `%1' (%2) en `%3' ModelFixForm + Model file fix Réparer un fichier modèle + &Fix &Réparer + &Close &Fermer + Fix model file Réparer un modèle + <html><head/><body><p>[pgmodeler-cli not found error]</p></body></html> <html><head/><body><p>[pgmodeler-cli not found error]</p></body></html> + pgmodeler-cli: - pgmodeler-cli: + pgmodeler-cli : + Browse for pgmodeler-cli tool Rechercher l'outil pgmodeler-cli + + + ... ... + The specified file is not the pgModeler command line tool (pgmodeler-cli). Ce fichier n'est pas l'outil en ligne de commande de pgModeler (pgmodeler-cli). + Input file: - Fichier source: + Fichier source : + Output file: - Fichier cible: + Fichier cible : + Fix tries: - Tentatives: - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Waiting process to start...</p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">En attente...</p></body></html> + Tentatives : + Select input file Sélectionner le modèle à réparer + Select output file Sélectionner un fichier de sortie + Load fixed model when finish Charger le modèle réparé une fois l'opération terminée + In some cases the fix process will fail to restore all objects within the model demanding manual fixes by changing the file on a text editor. <strong>NOTE:</strong> relationships may lost their graphical configuration like custom points and line color. - Dans certains cas, le processus de réparation peut échouer à restaurer et récupérer tous les objets du modèle, ce qui peut réclamer des modifications manuelles dans le fichier à partir d'un éditeur de texte. <strong>REMARQUE:</strong> les associations peuvent perdre leur configuration graphique tels que des points placés manuellement par l'utilisateur ou la couleur. + Dans certains cas, le processus de réparation peut échouer à restaurer et récupérer tous les objets du modèle, ce qui peut réclamer des modifications manuelles dans le fichier à partir d'un éditeur de texte. <strong>REMARQUE :</strong> les associations peuvent perdre leur configuration graphique tels que des points placés manuellement par l'utilisateur ou la couleur. + Waiting process to start... - En attente... + Processus en attente de lancement... + Could not locate <strong>%1</strong> tool on <strong>%2</strong>. The fix process can't continue! Please check pgModeler installation or try to manually specify the command below. - Impossible de localiser l'outil <strong>%1</strong> dans <strong>%2</strong>. Impossible de continuer ! Veuillez vérifier votre installation de pgModeler ou alors spécifiez l'emplacement de l'outil. + Impossible de localiser l'outil <strong>%1</strong> sur <strong>%2</strong>. Le processus de réparation ne peut continuer ! Vérifiez votre installation de pgModeler ou spécifiez manuellement la commande ci-dessous. + pgModeler command line tool (%1) Outil en ligne de commande de pgModeler (%1) + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Monospace'; font-size:10pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Waiting process to start...</span></p></body></html> - + < !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http ://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">En attente du lancement du processus...</span></p></body></html> ModelNavigationWidget + Form Formulaire + Previous model Modèle précédent - Ctrl+Up - Ctrl+Haut + + Alt+C + + Next model Modèle suivant - Ctrl+Down - Ctrl+Bas - - + Close model Fermer + ... ... + (model not saved yet) - (modèle pas encore sauvegardé) + (modèle pas encore enregistré) + Ctrl+Left - Ctrl+Left + Ctrl+Gauche + Ctrl+Right - Ctrl+Right - - - Alt+C - + Ctrl+Droite ModelObjectsWidget + Model Objects Objets du modèle + Hide this widget Cacher ce widget + 1 1 + Object Objet + Type Type + Parent Object Objet parent + Parent Type Type parent - Visible Object Types - Afficher les objets des types suivants - - + Select All - Tout sélect. + Tout sélectionner + Clear All Tout effacer + Select Sélectionner + Return - Retour + Retour + Cancel Annuler + Esc - Échap. + Échap + Objects view configuration Filtres d'affichage des objets + Expands all items Développer tous les éléments + Collapses all items Replier tous les éléments + Filter: - Filtrer: + Filtrer : + + + + + + ... ... + Tree view Vue en arbre + List view Vue en liste + New Nouveau + ID - ID + Identifiant + By ID - + Par identifiant + + + + Visible object types + Types d'objets visibles + + + + Model objects + Objets de modèle ModelOverviewWidget + Model overview Vue générale du modèle + + + Failed to generate the overview image. +The requested size %1 x %2 was too big and there was not enough memory to allocate! + Impossible de générer l'aperçu de l'image. +La taille demandée%1 x%2 était trop grande et il n'y avait pas assez de mémoire à allouer ! + ModelRestorationForm + Model restoration Restauration de modèle + &Restore &Restaurer + &Cancel A&nnuler - Modified: %1 - Modifié: %1 - - + pgModeler was not closed properly in a previous execution and some models were still being edited. Click <strong>Restore</strong> to reopen the models or <strong>Cancel</strong> to abort the restoration. - + pgModeler n'a pas été fermé correctement lors d'une précédente exécution et certains modèles étaient encore en cours d'édition. Cliquez sur <strong>Restaurer</strong> pour rouvrir les modèles ou sur <strong>Annuler</strong> pour abandonner la restauration. + pgModeler will try to recover the selected models but will not destroy them in case of loading failure. This option serves as a last resort in order to try to recover the database model. Temporary models will last until the application is closed so the user must try to manually recover the files before exit pgModeler. - + pgModeler va essayer de récupérer les modèles sélectionnés mais ne les détruira pas en cas d'échec de chargement. Cette option sert de dernier recours pour essayer de récupérer le modèle de base de données. Les modèles temporaires resteront jusqu'à ce que l'application soit fermée. L'utilisateur doit donc essayer de récupérer manuellement les fichiers avant de quitter pgModeler. + Keep temporary models in case of restoration failure - + Conserver les modèles temporaires en cas d'échec de la restauration + Database - Base de données + Base de données + File - + Fichier + Modified - + Modifié + Size - + Taille ModelValidationHelper + There are pending errors! SQL validation will not be executed. - + Il y a des erreurs en attente ! La validation SQL ne sera pas exécutée. + Operation canceled by the user. - + Opération annulée par l'utilisateur. ModelValidationWidget + Form Formulaire + + 0 0 + Try to apply a fix on the selected validation info. Essayer d'appliquer le correctif sur l’élément sélectionné. + Clear validation results Effacer le résultat de la validation + Va&lidate Va&lider + Warnings: does not prevents model to be saved. - Avertissements: n'empêche de pouvoir sauvegarder le modèle. + Avertissements : n'empêche de pouvoir sauvegarder le modèle. + Errors: model will not be saved while there are validation errors. - Erreurs: le modèle ne peut être sauvegardé tant que des erreurs de validation subsistent. - - - Use unique temporary names for database, role and tablespace objects - Utiliser des noms uniques et temporaires pour la base, les rôles et les tablespaces + Erreurs : le modèle ne peut être sauvegardé tant que des erreurs de validation subsistent. + SQL Validation: - Validation SQL: - - - Connection alias - Alias de la connexion + Validation SQL : + PostgreSQL version Version de PostgreSQL - SQL validation, if enabled, will occur only on the last step or when there are no warnings. - Validation SQL, si activée, ne sera déclenchée qu'à la fin ou uniquement s'il n'y a pas d'avertissements. - - - Using temporary names will avoid object duplication errors when running the SQL validation. - Utiliser des noms temporaires évite les erreurs dues aux objets dupliqués lors de la validation SQL. - - + Try to resolve the reported issues. Essayer de résoudre les problèmes rencontrés. + Ctrl+S Ctrl+S + Clear Effacer + Options Options + Cancel the SQL validation in progress. Annuler le processus de validation SQL en cours. + Cancel Annuler + Esc Échap - Change the creation order for two objects by swapping their ids - Modifie l'ordre de création de deux objets en échangeant leurs numéros d'identification - - - Swap Ids - Echanger identifiants + + Apply fixes + - Enable validation of SQL code on DBMS (requires connection) - Activer la validation SQL sur le serveur (requiert une connexion) + + Change the creation order for two objects by swapping their ids + Modifie l'ordre de création de deux objets en échangeant leurs numéros d'identification - Apply Fix - Appliquer le correctif + + Swap ids + Échanger identifiants + Hide this widget Fermer ce widget + ... ... + The object <strong>%1</strong> <em>(%2)</em> [id: %3] is being referenced by <strong>%4</strong> object(s) before its creation. L'objet <strong>%1</strong> <em>(%2)</em> [id: %3] est référencé par <strong>%4</strong> objet(s) avant sa création. + Autodetect Auto détection + The object <strong>%1</strong> <em>(%2)</em> [id: %3]%4 is referencing columns created by <strong>%5</strong> relationship(s) but is created before them. - L'objet <strong>%1</strong> <em>(%2)</em> [id: %3]%4 a pour référence des colonnes créées par <strong>%5</strong> association(s) but is created before them. + L'objet <strong>%1</strong> <em>(%2)</em> [id : %3]%4 référence des colonnes créées par <strong>%5</strong> association(s) mais a été créé avant eux. + The object <strong>%1</strong> <em>(%2)</em> has a name that conflicts with <strong>%3</strong> object's name(s). - Le nom de l'objet <strong>%1</strong> <em>(%2)</em> entre en conflit avec l'objet<strong>%3</strong>. - - - Database model sucessfully validated. - Modèle de données validé avec succès. - - - Running SQL validation... - Validation SQL en cours... + Le nom de l'objet <strong>%1</strong> <em>(%2)</em> entre en conflit avec celui de l'objet<strong>%3</strong>. + Processing object: %1 - Traitement de l'objet: %1 + Traitement de l'objet : %1 + Conflicting object: <strong>%1</strong> <em>(%2)</em>. - Objet en conflit: <strong>%1</strong> <em>(%2)</em>. + Objet en conflit : <strong>%1</strong> <em>(%2)</em>. + Referrer object: <strong>%1</strong> <em>(%2)</em> [id: %3]. - Seconde lecture ? - Objet réferent: <strong>%1</strong> <em>(%2)</em> [id: %3]. + Objet réferent : <strong>%1</strong> <em>(%2)</em> [id: %3]. + SQL validation failed due to error(s) below. <strong>NOTE:</strong><em> These errors does not invalidates the model but may affect operations like <strong>export</strong> and <strong>diff</strong>.</em> - + La validation SQL a échoué en raison des erreurs ci-dessous. <strong>REMARQUE :</strong><em> Ces erreurs n'invalident pas le modèle mais peuvent affecter des opérations telles que <strong>l'export</strong> et <strong>la comparaison</strong>. </em> - <em>The above object was created by a relationship. Change the name pattern on it's generator relationship. Fix will not be applied!</em> + + The column <strong>%1</strong> on <strong>%2</strong> <em>(%3)</em> is referencing the geospatial data type <strong>%4</strong> but the <strong>postgis</strong> extension is not present in the model! - Relationship: <strong>%1</strong> [id: %2]. + + <strong>HINT:</strong> Create the extension in the model or let it be created by applying the needed fixes. + + <em>The above object was created by a relationship. Change the name pattern on it's generator relationship. Fix will not be applied!</em> + <em>L'objet ci-dessus a été créé par une relation. Changer le motif du nom sur sa relation de générateur. La correction ne sera pas appliquée !</Em> + + + + Relationship: <strong>%1</strong> [id: %2]. + Relation : <strong>%1</strong> [id : %2]. + + + Running SQL commands on server... - Execution des commandes SQL sur le serveur... + Exécution des commandes SQL sur le serveur... + Enables the validation of SQL code in DBMS. This process requires the use of a pre-configured connection. SQL validation will occur only in the last step (when all objects were validated) or when there are no warnings. - + Active la validation du code SQL dans la SGBD. Ce processus nécessite l'utilisation d'une connexion pré-configurée. La validation SQL ne se produira qu'à la dernière étape (lorsque tous les objets ont été validés) ou lorsqu'il n'y a pas d'avertissement. + Connection to be used in the SQL validation - + Connexion à utiliser dans la validation SQL + pgModeler will generate unique and temporary names for database, role and tablespace objects. This option avoids object duplication errors when running the SQL validation. - + pgModeler générera des noms uniques et temporaires pour les objets base de données, rôle et espace de stockage. Cette option évite les erreurs de duplication d'objet lors de l'exécution de la validation SQL. + Use unique temporary names for cluster level objects - + Utiliser des noms temporaires uniques pour les objets de niveau cluster + The relationship <strong>%1</strong> [id: %2] is in a permanent invalidation state and needs to be relocated. - + La relation <strong>%1</strong> [id : %2] est dans un état d'invalidation permanent et a besoin d'être déplacé. + <strong>HINT:</strong> try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process. - + <strong>CONSEIL :</strong> essayer d'échanger la relation par une autre qui est liée à celle-ci via des colonnes générées ou des contraintes pour résoudre ce problème. Noter que d'autres objets peuvent être perdus dans le processus d'échange. + SQL validation not executed! No connection defined. - + La validation SQL n'est pas exécutée ! Aucune connexion définie. + Database model successfully validated. - + Modèle de base de données validé avec succès. ModelWidget + + Copy Copier - Generalization - Généralisation - - + Convert Convertir + New Nouveau + Quick - Act. rapides + Actions rapides + Source code Code source + Show object source code Afficher le code source de l'objet - Source - Source - - + + Properties Propriétés + Space Espace + Edit the object properties - Editer les propriétés de l'objet + Modifier les propriétés de l'objet + + Protect Vérrouiller + + Unprotect Déverrouiller + Protects object(s) from modifications - Empêcher l(es)'objet(s) d'être modifiés + Empêcher la modification du ou des objets + + Delete - Supprimer + Effacer + Shift+Del Shift+Suppr + Select all - Tout sélect. + Tout sélectionner + Selects all the graphical objects in the model Sélectionner tous les objets graphiques du modèle + Paste Coller + Cut Couper + Deps && Referrers - Dép. && Rèf. + Dépendances && Rèférences + Add a new object in the model Ajouter un nouvel objet dans le modèle + Rename Renommer + Quick rename the object Renommage rapide de l'objet + Move to schema Déplacer vers le schema + Edit permissions - Editer les permissions + Modifier les permissions + Change owner Changer le propriétaire + Select children - Sélectionnez les éléments - - - Highlight - Mettre en avant + Sélectionner les enfants + Del Suppr - Ctrl+A - Ctrl+A - - - F2 - F2 - - + Custom SQL - Code SQL Libre - - - Alt+Q - Alt+Q + Code SQL personnalisé + Loading database model Ouverture du modèle de base de données + Saving database model Enregistrement du modèle de base de données + Also copy all dependencies of selected objects? This minimizes the breakdown of references when copied objects are pasted into another model. - Copier également les dépendences des objets sélectionnés? Ceci minimise la perte des références lorsque les objets copiés sont collés dans un autre modèle. + Copier également les dépendences des objets sélectionnés ? Cela minimise la casse des références lorsque les objets copiés sont collés dans un autre modèle. + Pasting objects... Collage des objets... + Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details! - Tous les objets n'ont pas été collés dans le modèle à cause d'erreurs retournés durant le processus! Se référer à la pile d'erreurs pour plus de détails! + Tous les objets n'ont pas été collés dans le modèle car des erreurs ont été retournées durant le processus ! Se référer à la pile d'erreurs pour plus de détails ! + Do you really want to delete the selected object? - Souhaitez vous réellement supprimer l'objet sélectionné? + Souhaitez-vous réellement effacer l'objet sélectionné ? + (no objects) (aucun objet) + + None + + + + Constraints Contraintes + One to One (1-1) - + Un à un (1-1) + One to Many (1-n) - + Un à plusieurs (1-n) + Many to Many (n-n) - + Plusieurs à plusieurs (n-n) + <strong>ATTENTION:</strong> The database model is protected! Operations that could modify it are disabled! - + <strong>ATTENTION :</strong> Le modèle de base de données est protégé ! Les opérations qui pourraient le modifier sont désactivées ! + + + + Edit data + Modifier données + + + + Source + + Alt+S - + + + Del. cascade Supprimer en cascade + Ctrl+C - Ctrl+C + + Ctrl+V - Ctrl+V + + Ctrl+X - Ctrl+X + + Quick action for the selected object - Actions rapides sur l'objet sélectionné + Action rapide pour l'objet sélectionné + + + + F2 + + Set tag - Affecter un tag + Affecter une balise + Ctrl+E - Ctrl+E + + + + + Select tagged + Séléction balisée + + + + Select + Sélectionner + Open relationship - + Ouvrir les relations + + Alt+Q + + + + Convert to sequence - + Convertir en séquence + Convert to serial - + Convertir en série + Break line - + Ligne d'interruption + Remove points - + Supprimer des points + Enable SQL - + Activer le code SQL + Disable SQL - + Désactiver le code SQL + + + + Duplicate + Dupliquer + + + + Ctrl+D + + + + + Extended attributes + Attributs étendus + + + + + Show + Afficher + + + + + Hide + Masquer + + + + Jump to table + Sauter à la table + + + + Schemas rectangles + Rectangles de schémas + + + + Fade in/out + Effets de fondu + + + Fade in + Accentuer + + + + + Fade out + Estomper + + + + + + Relationships + Associations + + + + Swap ids + Échanger identifiants + + + + Edit the objects creation order by swapping their ids + Modifier l'ordre de création des objets en échangeant leurs identifiants + + + 90° (vertical) - + + 90° (horizontal) - + + 90° + 90° (vertical) - + + 90° + 90° (horizontal) - + + + + + + + All objects + Tous les objets + + + + + Schemas + Schémas + + + Views + Vues + + + + + Textboxes + Boites de textes + + + + + Tables + + + + + Ctrl+A + + + + Zoom: %1% - + Zoom : %1% + Do you really want to convert the relationship into an intermediate table? - + Voulez-vous vraiment convertir les relations en une table intermédiaire ? + Validating object: `%1' (%2) - + Validation de l'objet : `%1' (%2) + Generating XML for: `%1' (%2) - + Génération du code XML pour : `%1' (%2) + Pasting object: `%1' (%2) - + Collage de l'objet : `%1' (%2) + <strong>CAUTION:</strong> You are about to delete objects in cascade mode which means more objects than the selected will be dropped too. Do you really want to proceed? - + <strong>ATTENTION :</strong> Vous êtes sur le point de supprimer des objets en mode cascade, ce qui signifie que des objets non sélectionnés seront également supprimés. Voulez-vous vraiment poursuivre ? + <strong>CAUTION:</strong> Remove multiple objects at once can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? - + <strong>ATTENTION :</strong> Supprimer plusieurs objets à la fois peut entraîner des invalidations irréversibles sur d'autres objets du modèle, entraînant également la suppression de ces objets invalides. Voulez-vous vraiment poursuivre ? + <strong>CAUTION:</strong> Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? - + <strong>ATTENTION :</strong> Supprimer une relation peut entraîner des invalidations irréversibles d'autres objets dans le modèle, entraînant également la suppression de ces objets invalides. Voulez-vous vraiment poursuivre ? + The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details. - + La suppression en cascade a rencontré des problèmes lors de son exécution ! Certains objets n'ont pas pu être supprimés ou enregistrés dans l'historique des opérations ! Veuillez vous reporter à la pile d'erreurs pour plus de détails. + Inheritance - + Héritage + Do you want to %1 the selected schema's children too? - + Voulez-vous %1 les enfants du schèma séléctionné aussi ? + protect - + protéger + unprotect - + déprotéger ModelsDiffHelper + Processing object `%1' (%2)... - + Traitement de l'objet `%1' (%2)... + Skipping object `%1' (%2)... - + Omission de l'objet `%1' (%2)... + Processing diff infos... - + Comparaison des informations... + Processing `%1' info for object `%2' (%3)... - + Traitement de l'info `%1' pour l'objet `%2' (%3)... + No differences between the model and database. - + Aucune différence entre le modèle et la base de données. + Preparing diff code... - + Préparation du code de comparaison... NewObjectOverlayWidget + Form - Formulaire + Formulaire + Role Rôle + Tag Tag + Cast - Convertion de type + Conversion de type + Language Langage + Textbox Zone de texte + Event Trigger - Déclencheur sur évènement + Déclencheur sur évènement + Tablespace - Tablespace + Espace de stockage + Schema Schéma + Domain - Domaine + Domaine + Conversion - Convertion + Conversion - Aggregate - Fonction d'agrégat + + Extension + - Collation - Collation + + Type + - Table - Table + + Aggregate + Agrégat - Type - Type + + Collation + + Sequence - Séquence + Séquence - Extension - Extension + + Table + + Function - Fonction + Fonction + View Vue + + Permissions - Permissions + - Rule - Règle + + Index + - Index - Index + + Rule + Règle + Column - Colonne + Colonne + Constraint - Contrainte + Contrainte + Trigger - Déclencheur + Déclencheur + Copy - Copie + Copie - M - M + + + A + - 9 - 9 + + G + - Z - Z + + K + - 1 - 1 + + H + - 2 - 2 + + J + - 3 - 3 + + D + - 5 - 5 + + E + - 4 - 4 + + F + - 0 - 0 + + L + - A - + + O + - Op. Family - + + U + - Op. Class - + + I + - Operator - + + R + - Many-to-many - + + S + - One-to-many - + + Q + - One-to-one - + + T + - Inheritance - + + P + - G - + + M + - K - + + Y + - H - + + W + - J - + + + 9 + - D - + + Z + - E - + + X + - F - + + C + - L - + + V + - O - + + B + + + + + 8 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 5 + + + + + 4 + + + + + 0 + + + + + Op. Family + Famille d'op. - U - + + Op. Class + Classe d'op. - I - + + Operator + Opérateur - R - + + Many-to-many + Plusieurs-à-plusieurs - S - + + One-to-many + Un-à-plusieurs - Q - + + One-to-one + Un-à-un - T - + + Inheritance + Héritage - P - + + Generic SQL + SQL générique - Y - + + Policy + Politique + + + NumberedTextEditor - W - + + Load + Charger - X - + + Load the object's source code from an external file + Charger le code source de l'objet depuis un fichier externe - C - + + Edit + Modifier - V - + + Edit the source code in the preferred external editor + Modifier le code source avec son éditeur préféré - B - + + Clear + Nettoyer - - - NumberedTextEditor + Upper case - + Majuscule + Lower case - + Minuscule + Ident right - + Ident droit + Ident left - + Ident gauche + + + + SQL file (*.sql);;All files (*.*) + Fichier SQL (*.sql);;Tous les fichiers (*.*) + + + + Load file + Charger un fichier + + + + The source editor `%1' is running on `pid: %2'. + L'éditeur de source `%1' s'exécute sur pid : `%2'. + + + + Could not start the source code editor application `%1'! Make to sure that the source editor path defined in the general settings points to a valid executable and the current user has permission to run the application. Error message returned: `%2' + Impossible de démarrer l'application de l'éditeur de code source `%1' ! Assurez-vous que le chemin de l'éditeur source défini dans les paramètres généraux pointe vers un exécutable valide et que l'utilisateur actuel a l'autorisation d'exécuter l'application. Message d'erreur renvoyé : `%2' ObjectDepsRefsWidget - Form - Formulaire - - + Dependencies Dépendances + + Object Objet + + Type Type + + Parent Object Objet parent + + Parent Type Type parent + References Références + + ID - Intuitif ID + Exclude indirect dependencies Exclure les dépendances indirectes + Include indirect references Inclure les références indirectes + This object does not exists anymore. The dependencies and references listing are disabled. Cet objet n'existe plus. L'affichage de ses dépendances et références est désactivé. + Object's dependencies & references Dépendances et références d'un objet @@ -7769,117 +9733,169 @@ p, li { white-space: pre-wrap; } ObjectFinderWidget + Form Formulaire + Pattern: - Motif: + Motif : + Hide this widget Cacher ce widget + + ... ... - Highlight - Mettre en avant - - + Find Chercher + Clears the search results - Éffacer les résultats + Effacer les résultats + Clear Effacer + + (Un)selects the graphical objects in the results grid + + + + Regular Expression Expression régulières + Exact Match Correspondance exacte + Select All - Tout sélect. + Tout sélectionner + Clear All Tout effacer + Case Sensitive Sensible à la casse + Object Objet + Type Type + Parent Object Objet parent + Parent Type Type parent + + Fades outs all the graphical objects in the results grid (or those not listed). The current fade in/out state of all objects is modified. + + + + Defines the search filter Défini le filtre de recherche + Filter Filtrer + + + Listed + + + + + + Not listed + + + + Found <strong>%1</strong> object(s). <strong>%1</strong> objet(s) trouvé(s). + No objects found. Aucun objet trouvé. - Highlight graphical objects when selecting them or their children on the result list - + + ID + Identifiant - ID - ID + + Select + Sélectionner + + + + Fade out + Estomper ObjectRenameWidget + Form Formulaire + .... .... + to: - en: + en : + + Rename Renommer + Cancel Annuler @@ -7887,279 +9903,338 @@ p, li { white-space: pre-wrap; } ObjectSelectorWidget + Form Formulaire + Clear field - Effeacer le champs + Effacer le champ + Select Object Sélectionner un objet + Select %1 - + Sélectionner %1 - ObjectTableWidget + ObjectsTableWidget + Form Formulaire + Add Item Ajouter un élément + Ins - Ins + Insérer + Remove Item Supprimer un élément + Del - Suppr. + Suppr + Update Item - Actualiser les éléments + Actualiser l'élément + Alt+R - Alt+R + + Remove All Tout supprimer + Shift+Del - Shift+Del + Maj+Suppr. + + Duplicate item + Dupliquer l'élément + + + + Ctrl+D + + + + Edit Item - Editer l'élément + Modifier l'élément + Space - Space + Espace + Move Up Déplacer vers le haut + Ctrl+Up Ctrl+Haut + Move Down Déplacer vers le bas + Ctrl+Down Ctrl+Bas + Move to start Déplacer au début + Ctrl+Home Ctrl+début + Move to end Déplacer à la fin + Ctrl+End, Ctrl+S Ctrl+Fin, Ctrl+S - Confirmação - Confirmation - - + Do you really want to remove the selected item? - Souhaitez vous réellement supprimer l'élément sélectionné? + Souhaitez-vous réellement supprimer l'élément sélectionné ? - Do you really want to remove the all items? - Souhaitez vous réellement supprimer tous les éléments? + + + Confirmation + - Confirmation - Confirmation + + Do you really want to remove all the items? + Souhaitez-vous réellement supprimer tous les éléments ? OperationList + (invalid object) - + (objet invalide) OperationListWidget + + Executed Operations Opérations exécutées + Hide this widget Cacher ce widget + ... ... + 1 1 + Operations: - Opérations: + Opérations : + + 0 0 + Position: - Position: + Position : + Delete operation history Supprimer l'historique des opérations + Undo Annuler + Redo Rétablir + Object: %1 - Objet: %1 + Objet : %1 + Name: %1 - Nom: %1 + Nom : %1 + created créé + removed supprimé + modified modifié + moved déplacé + Operation: %1 - Opération: %1 - - - Undoing operations... - Annulation des opérations... - - - Redoing operations... - Rétablissement des opérations... + Opération : %1 + Operation history exclusion - ?? À controler dans le contexte ?? Exclure l'historique des opérations + Delete the executed operations history is an irreversible action, do you want to continue? - Supprimer l'historique des opérations exécutées est une action irréversible, souhaitez vous continuer? + Effacer l'historique des opérations exécutées est une action irréversible, souhaitez-vous continuer ? OperatorClassWidget - Form - Formulaire - - + Default Class: - Classe par défaut: + Classe par défaut : + Indexing: - Indexation: + Indexation : + Elements - Élements + Éléments + Element Type: - Type d'élement: + Type d'élément : + Operator - Operateur + Opérateur + Function Fonction + Storage Stockage + Function: - Fonction: + Fonction : + Operator: - Opérateur: + Opérateur : + Support/Strategy: - Support/Stratégie: + Support/Stratégie : + + Op. Family: - Famille d'opérateurs: + Famille d'opérateurs : + Storage Type Type de Stockage + Object Objet + Type - Type + + Support/Strategy Support/Stratégie + Operator Family Famille d'opérateurs @@ -8167,96 +10242,103 @@ p, li { white-space: pre-wrap; } OperatorFamilyWidget - Form - Formulaire - - + Indexing: - Indexation: + Indexation : OperatorWidget - Form - Formulaire - - + Options: - Options: + Options : + MERGES MERGES + HASHES HASHES + Arguments Arguments + Advanced Avancé + Restrict: - Restriction: + Restriction : + Commutator: - Commutateur: + Commutateur : + Negator: - Négateur: + Négateur : + Operator Func.: - Fonction de l'opérateur: + Fonction de l'opérateur : + Join: - Jointure: + Jointure : + Right Argument Type - Type argument à droite + Type argument droit + Left Argument Type - Type d'argument à gauche + Type d'argument gauche + To create a unary operator it is necessary to specify as <strong><em>'any'</em></strong> one of its arguments. Additionally, the function that defines the operator must have only one parameter and this, in turn, must have the same data type of the the argument of unary operator. - Pour créer un opérateur unaire il est nécessaire de spécifier <strong><em>'any'</em></strong> comme l'un de ses arguments. De plus, la fonction qui définit l'opérateur doit avoir seulement un paramètre et celui-ci doit avoir le même type de donnée que l'argument de l'opérateur unaire. + Pour créer un opérateur unitaire, il est nécessaire de spécifier <strong><em>'any'</em></strong> comme l'un de ses arguments. De plus, la fonction qui définit l'opérateur doit avoir seulement un paramètre et celui-ci doit avoir le même type de donnée que l'argument de l'opérateur unitaire. ParameterWidget - Form - Formulaire - - + Default Value: - Valeur par défaut: + Valeur par défaut : + Mode: - Mode: + Mode : + IN IN + OUT OUT + VARIADIC VARIADIC @@ -8264,528 +10346,912 @@ p, li { white-space: pre-wrap; } PermissionWidget - Form - Formulaire - - + + Roles Rôles + ID: - Identifiant: + Identifiant : + + Permissions Permissions + Add Permission Ajouter permission + Update Permission Actualiser permission + Cancel Operation Annuler l'opération + + Privileges Privilèges + Disable SQL code Désactiver le code SQL - Grant - Grant + + Cascade + Cascade + + + + Privilege + Privilège + + + + GRANT OPTION + GRANT OPTION + + + + Code Preview + Prévisualisation du code + + + + Name + Nom + + + + Id + + + + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + Laissez la grille <em><strong>Rôles</strong></em> vide afin de créer un %1 applicable à <strong><em>PUBLIC</em></strong>. + + + + -- No permissions defined for the specified object! + -- Aucune permission définie pour cet objet ! + + + + /* Could not generate the SQL code preview for permissions! + /* Impossible de générer la prévisualisation du code SQL pour les permissions ! + + + + Edit permissions + Modifier les permissions + + + + &Grant + Acco&rder + + + + Re&voke + Ré&voquer + + + + PgModelerCLI + + + Unrecognized option '%1'. + Option '%1' non reconnue. + + + + Value not specified for option '%1'. + Valeur pour l'option '%1' manquante. + + + + Option '%1' does not accept values. + L'option '%1' n'accepte pas de valeur. + + + + Usage: pgmodeler-cli [OPTIONS] + Utilisation : pgmodeler-cli [OPTIONS] + + + + + command line interface. + interface en ligne de commande. + + + + General options: + Options générales : + + + + DBMS export options: + Options d'export directe dans un serveur : + + + + Input file must be different from output! + Le fichier source doit être différent du fichier de sortie ! + + + + Incomplete connection information! + Les informations de connexion sont incomplètes ! + + + + Starting model export... + Début de l'export du modèle... + + + + Miscellaneous options: + Options diverses : + + + + There are no connections configured. + Il n'y a aucune connexion configurée. + + + + Invalid zoom specified! + Zoom spécifié invalide ! + + + + Invalid action specified to update mime option! + Action spécifiée invalide pour mettre à jour l'option mime ! + + + + Starting model fixing... + Lancement de la fixation du modèle... + + + + Starting mime update... + Lancement de la mise à jour du mime... + + + + Model successfully fixed! + Modèle fixé avec succès ! + + + + Extracting objects' XML... + Extraction des objets XML... + + + + Connection aliased as '%1' was not found in the configuration file. + + + + + PostgreSQL Database Modeler Project - pgmodeler.io + + + + + Copyright 2006-2018 Raphael A. Silva <raphael@pgmodeler.io> + + + + + This CLI tool provides several operations over models and databases without the need to perform them +in pgModeler's graphical interface. All available options are described below. + + + + + %1, %2 [FILE] Input model file (.dbm). This is mandatory for fix, export operations. + + + + + %1, %2 [DBNAME] Input database name. This is mandatory for import operation. + + + + + %1, %2 [FILE] Output file. This is mandatory for fixing model or exporting to file, png or svg. + + + + + %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + + + + + %1, %2 [NUMBER] Model fix tries. When reaching the maximum count the invalid objects will be discarded. + + + + + %1, %2 Export the input model to a sql script file. + + + + + %1, %2 Export the input model to a png image. + - Revoke - Revoke + + %1, %2 Export the input model to a svg file. + - Cascade - Cascade + + %1, %2 Export the input model directly to a PostgreSQL server. + - Privilege - Privilège + + %1, %2 Import a database to an output file. + - GRANT OPTION - GRANT OPTION + + %1, %2 Compares a model and a database or two databases generating the SQL script to synch the latter in relation to the first. + - Code Preview - Prévisualisation du code + + %1, %2 Force the PostgreSQL version of generated SQL code. + - Type: - Type: + + %1, %2 Silent execution. Only critical messages and errors are shown during process. + - Role - Rôle + + %1, %2 Show this help menu. + - Id - Identifiant + + Connection options: + - Leave the <em><strong>Roles</strong></em> empty to create a permission applicable to <strong><em>PUBLIC</em></strong>. - Laissez le champ <em><strong>Rôles</strong></em> vide pour créer une permission applicable à <strong><em>PUBLIC</em></strong>. + + %1, %2 List available connections in file %3. + - -- No permissions defined for the specified object! - -- Aucune permission définie pour cet objet! + + %1, %2 [ALIAS] Connection configuration alias to be used. + - /* Could not generate the SQL code preview for permissions! - /* Impossible de générer la prévisualisation du code SQL pour les permissions! + + %1, %2 [HOST] PostgreSQL host in which a task will operate. + - Edit permissions - Editer les permissions + + %1, %2 [PORT] PostgreSQL host listening port. + - &Grant + + %1, %2 [USER] PostgreSQL username. - Re&voke + + %1, %2 [PASSWORD] PostgreSQL user password. - - - PgModelerCLI - Unrecognized option '%1'. - Option '%1' non reconnue. + + %1, %2 [DBNAME] Connection's initial database. + - Value not specified for option '%1'. - Valeur pour l'option '%1' manquante. + + %1, %2 Draws the grid in the exported image. + - Option '%1' does not accept values. - L'option '%1' n'accepte pas de valeur. + + %1, %2 Draws the page delimiters in the exported image. + - Connection aliased as '%1' was not found on configuration file. - La connexion nommé '%1' n'existe pas dans le fichier de configuration. + + %1, %2 Each page will be exported in a separated png image. (Only for PNG images) + - Usage: pgmodeler-cli [OPTIONS] - Utilisation: pgmodeler-cli [OPTIONS] + + %1, %2 [FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images) + - command line interface. - interface en ligne de commande + + %1, %2 Ignores errors related to duplicated objects that eventually exist in the server. + - PostgreSQL Database Modeler Project - pgmodeler.com.br - PostgreSQL Database Modeler Project - pgmodeler.com.br + + %1, %2 [CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided. + %1, %2=[CODES] Ignore les erreurs supplémentaires par leurs codes. Une liste de codes alphanumériques séparés par des virgules doit être fournie. {1,?} {2 ?} - General options: - Options générales: + + %1, %2 Drop the database before execute a export process. + - %1, %2 Export to a sql script file. - %1, %2 Export vers un fichier SQL. + + %1, %2 Runs the DROP commands attached to SQL-enabled objects. + - %1, %2 Export to a png image. - %1, %2 Export en image PNG. + + %1, %2 Simulates an export process by executing all steps but undoing any modification in the end. + - %1, %2 Export directly to a PostgreSQL server. - %1, %2 Exporter directement dans un serveur PostgreSQL. + + %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + - %1, %2 List available connections on %3 file. - %1, %2 Lister les connexions disponnibles dans le fichier %3. + + Database import options: + - %1, %2 Version of generated SQL code. Only for file or dbms export. - %1, %2 Version de PostgreSQL pour laquelle doit être généré l'export. Uniquement pour les exports fichier SQL et en direct dans le serveur. + + %1, %2 Ignore all errors and try to create as many as possible objects. + - %1, %2 Silent execution. Only critical errors are shown during process. - %1, %2 Exécution silencieuse. Seuls les avertissements et erreurs seront affichés pendant le traitement. + + %1, %2 Import system built-in objects. This option causes the model bloating due to the importing of unneeded objects. + - %1, %2 Show this help menu. - %1, %2 Affiche ce menu. + + %1, %2 Import extension objects. This option causes the model bloating due to the importing of unneeded objects. + - PNG export options: - Option d'export PNG: + + %1, %2 Run import in debug mode printing all queries executed in the server. + - %1, %2 Draws the grid on the exported png image. - %1, %2 Dessiner la grille. + + Diff options: + - %1, %2 Draws the page delimiters on the exported png image. - %1, %2 Dessiner les limites de pages. + + %1, %2 [DBNAME] The database used in the comparison. All the SQL code generated is applied to it. + - DBMS export options: - Option d'exportation directe dans un serveur: + + %1, %2 Save the generated diff code to output file. + - %1, %2 Ignores errors related to duplicated objects that eventually exists on server side. - %1, %2 Ignorer les erreurs relatives à d'éventuels objets dupliqués déjà existant sur le serveur. + + %1, %2 Apply the generated diff code on the database server. + - %1, %2=[ALIAS] Connection configuration alias to be used. - %1, %2=[ALIAS] Alias de connexion à utiliser. + + %1, %2 Don't preview the generated diff code when applying it to the server. + - %1, %2=[HOST] PostgreSQL host which export will operate. - %1, %2=[HOST] Hôte du serveur PostgreSQL. + + %1, %2 Drop cluster level objects like roles and tablespaces. + - %1, %2=[PORT] PostgreSQL host listening port. - %1, %2=[PORT] Port du serveur PostgreSQL. + + %1, %2 Revoke permissions already set on the database. New permissions configured in the input model are still applied. + - %1, %2=[USER] PosrgreSQL username. - %1, %2=[USER] Nom d'utilisateur. + + %1, %2 Drop missing objects. Generates DROP commands for objects that are present in the input model but not in the compared database. + - %1, %2=[PASSWORD] PosrgreSQL user password. - %1, %2=[PASSWORD] Mot de passe. + + %1, %2 Force the drop of missing columns and constraints. Causes only columns and constraints to be dropped, other missing objects aren't removed. + - %1, %2=[DBNAME] Connection's initial database. - %1, %2=[DBNAME] Base de données initiale de connexion. + + %1, %2 Rename the destination database when the names of the involved databases are different. + - Available connections (alias : conn. string) - Connexions disponibles (alias : chaîne de conn.) + + %1, %2 Don't drop or truncate objects in cascade mode. + - No export mode specified! - Pas de mode d'export spécifié! + + %1, %2 Truncate tables prior to alter columns. Avoids errors related to type casting when the new type of a column isn't compatible to the old one. + - Multiple export mode especified! - Multiples mode d'exportation spécifiés! + + %1, %2 Don't reuse sequences on serial columns. Drop the old sequence assigned to a serial column and creates a new one. + - No input file specified! - Pas de fichier source! + + %1, %2 Don't force the recreation of objects. Avoids the usage of a DROP and CREATE commands to create a new version of the objects. + - No output file specified! - Pas de fichier de sortie! + + %1, %2 Don't recreate the unmodifiable objects. These objects are the ones which can't be changed via ALTER command. + - Input file must be different from output! - Le fichier source doit être différent du fichier de sortie! + + %1, %2 [ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + - Incomplete connection information! - Les information de connexion sont incomplètes! + + ** The diff process allows the usage of the following options related to import and export operations: + - Starting model export... - Début de l'export du modèle... + + * Export: + - Loading input file: - Chargement du fichier source: + + * Import: + - Export to PNG image: - Export en image PNG: + + ** When running the diff using two databases (%1 and %2) there's the need to specify two connections/aliases. + - Export to SQL script file: - Export en fichier SQL: + + If only one connection is set it will be used to import the input database as well to retrieve database used in the comparison. + - Export to DBMS: - Export directement en base: + + A second connection can be specified by appending a 1 on any connection configuration parameter listed above. + - Export successfully ended! - Export complété avec succès! + + Available connections (alias : connection string) + - Copyright 2006-2015 Raphael A. Silva <raphael@pgmodeler.com.br> - + + No operation mode was specified! + - This CLI tool provides the operations to export pgModeler's database models without -the need to load them on graphical interface as well to fix model files to the most recent -accepted structure. All available options are described below. - Cet outil en ligne de commande permet d'exporter des modèles de base pgModeler sans avoir besoin de les ouvrir via l'interface graphique. Il permet aussi de réparer des fichiers de modèle vers un format de structure le plus récent. Toutes les options disponibles sont décrites ci-dessous. + + Export, fix model, import database, diff and update mime operations can't be used at the same time! + - %1, %2=[FILE] Input model file (.dbm). Mandatory use when fixing a model or exporting it. + + Multiple export mode was specified! - %1, %2=[FILE] Output file. Mandatory use when fixing model or export to file or png. + + No input file was specified! - %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + + No input database was specified! - %1, %2 Model fix tries. When reaching the maximum count the invalid objects will be discard. + + No output file was specified! - %1, %2 Drop the database before execute a export process. + + No input file or database was specified! - %1, %2 Runs the DROP commands attached to SQL-enabled objects. + + The input file and database can't be used at the same time! - %1, %2 Simulates a export process. Actually executes all steps but undoing any modification. + + No database to be compared was specified! - %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + + No diff action (save or apply) was specified! - Miscellaneous options: + + No output file for the diff code was specified! - %1, %2=[ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + + ** Error code `%1' found and ignored. Proceeding with export. - There are no connections configured. + + ** Command: %1 - Export, fix model and update mime operations can't be used at the same time! + + Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! + Fichier d'entrée invalide ! Il semble que ce ne soit pas un modèle généré par pgModeler ou que le fichier soit corrompu ! + + + + Recreating objects... + Recréation des objets... + + + + +** Object(s) that couldn't fixed: + +** Ces objets ne peuvent être corrigés : + + + + WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) + AVERTISSEMENT : Certains objets ne peuvent peut-être pas être corrigés. Nouvel essai... (%1/%2) + + + + + Loading input file: %1 - Invalid zoom specified! + + Fixed model file: %1 - Invalid action specified to update mime option! + + Export to PNG image: %1 - Starting model fixing... + + Export to SVG file: %1 - Starting mime update... + + Export to SQL script file: %1 - Fixed model file: + + Export to DBMS: %1 - Model successfully fixed! + + Export successfully ended! + - Extracting objects' XML... + + Starting database import... - Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! + + + Input database: %1 - Recreating objects... + + Saving the imported database to file... - -** Object(s) that couldn't fixed: + + Import successfully ended! + - WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) + + Starting diff process... - Database model files (.dbm) are already associated to pgModeler! + + Input model: %1 - There is no file association related to pgModeler and .dbm files! + + Compare to: %1 - Mime database operation: %1 + + Loading input model... - Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. + + + Importing the database `%1'... - Running update-mime-database command... + + Comparing the generated models... - This CLI tool provides the operations to export pgModeler's database models without - the need to load them on graphical interface as well to fix model files to the most recent - accepted structure. All available options are described below. + + No differences were detected. - %1, %2 Export to a svg file. + + Saving diff to file `%1' - PNG and SVG export options: + + ** WARNING: You are about to apply the generated diff code to the server. Data can be lost in the process! - %1, %2 Each page will be exported on a separated png image. (Only for PNG) + + ** Proceed with the diff applying? (yes/no) > - %1, %2=[FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG) + + yes - %1, %2=[USER] PostgreSQL username. + + + no - %1, %2=[PASSWORD] PostgreSQL user password. + + Diff code not applied to the server. - Multiple export mode specified! + + Applying diff to the database `%1'... - Mime database successfully updated. + + Diff successfully ended! + - Export to SVG file: + + Mime database successfully updated! + + + + Database model files (.dbm) are already associated to pgModeler! + Les fichiers de modèle de bases de données (.dbm) sont déjà associés à pgModeler ! + + + + There is no file association related to pgModeler and .dbm files! + Il n'y a pas d'association entre pgModeler et .les fichiers dbm ! + + + + Mime database operation: %1 + Opération de base de données mime : %1 + + + + Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. + Impossible d'effacer le fichier %1 ! Vérifiez si l'utilisateur actuel dispose des autorisations pour le supprimer et si le fichier existe. + + + + Running update-mime-database command... + Exécution de la commande update-mime-database... + + + + PNG and SVG export options: + Options d'export en PNG et SVG : + PgModelerPlugin + Plugin Information - Information de l'extension + Information d'extension + Version: %1 - Version: %1 + Version : %1 + Author: %1 - Auteur: %1 + Auteur : %1 PgModelerUiNS + Do you want to apply the <strong>SQL %1 status</strong> to the object's references too? This will avoid problems when exporting or validating the model. - Souhaitez-vous appliquer <strong>SQL %1 status</strong> aux références de l'objet également ? Cela permet d'éviter des porlbèmes lors de l'exportation ou la validation du modèle. + Souhaitez-vous appliquer <strong>statut SQL %1 </strong> aux références de l'objet également ? Cela permet d'éviter des problèmes lors de l'export ou de la validation du modèle. + disabling - + désactivation + enabling - + activation PgSQLTypeWidget + Form Formulaire + Data Type Type de donnée + SRID: - SRID: + SRID : + Variation: - Variation: + Variation : + Z Z + M M + + Precision Précision + Spatial: - Spatial: + Spatial : + + Dimension Dimension + Format: - Format: + Format : + Timezone: - Fuseau horaire: + Fuseau horaire : + Type: - Type: + Type : + P: - P: + P : + + Length - Taille ? Longueur + L: - L: + L : + Interval: - Intervalle: + Intervalle : + [ ]: - [ ]: + [ ] : + NONE AUCUN @@ -8793,667 +11259,888 @@ accepted structure. All available options are described below. PluginsConfigWidget + Form Formulaire + Plug-ins root directory: - Répertoire racine des extentions: + Répertoire racine des extensions : + Open in file manager - Ouvrir dans le getionnaire de fichier + Ouvrir dans le gestionnaire de fichier + Loaded plug-ins Extensions chargées + Plugin Extension + Version - Version + + Library Bibliothèque + + PolicyWidget + + + Basics + Notions de base + + + + Command: + Commande : + + + + Permissive + Permissif + + + + Roles + Rôles + + + + Expressions + + + + + USING: + UTILISANT : + + + + CHECK: + VÉRIFIER : + + + + Name + Nom + + + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + Laissez la grille <em><strong>Rôles</strong></em> vide afin de créer un %1 applicable à <strong><em>PUBLIC</em></strong>. + + QObject + new_database - nouvelle_base + nouvelle_base_de_données + + + + %1 (line: %2) - %1 (ligne: %2) + %1 (ligne : %2) Relationship + %1_has_one_%2 - Traduction approprié ? - %1_has_one_%2 + Faut-il le traduire ? + + %1_has_many_%2 - Traduction approprié ? - %1_has_many_%2 + Faut-il le traduire ? + + many_%1_has_many_%2 - Traduction approprié ? - many_%1_has_many_%2 + Faut-il le traduire ? + + %1_inherits_%2 - Traduction approprié ? - %1_inherits_%2 + Faut-il le traduire ? + + %1_copies_%2 - Traduction approprié ? - %1_copies_%2 + Faut-il le traduire ? + RelationshipConfigWidget + Form Formulaire + Connect FK to PK columns - Relier les associations avec chacune des colonnes des clés étrangères/primaires concernées + Relier les colonnes associant clés étrangères/clés primaires + Connect tables' center points Relier les associations aux tables en un point central + Foreign key settings Clés étrangères + Deferral: - Report: + Report : + Deferrable: - Différable: + Reportable : + ON DELETE: - ON DELETE: + ON DELETE : + ON UPDATE: - ON UPDATE: + ON UPDATE : + Name patterns Règles de nommage + Relationship type: - Type d'association: + Type d'association : + Foreign Key (Target): - Clé étrangère (Cible): + Clé étrangère (Cible) : + Unique Key Name: - Nom contrainte unique: + Nom contrainte unique : + Primary Key Name: - Nom contrainte clé primaire: + Nom contrainte clé primaire : + Primary Key Column: - Nom colonne clé primaire: + Nom colonne clé primaire : + Column (Target): - Colonne (Cible): + Colonne (Cible) : + Foreign Key (Source): - Clé étrangère (Source): + Clé étrangère (Source) : + Column (Source): - Colonne (Source): + Colonne (Source) : + One to one (1:1) - Un à un (1:1) + Un à un (1 :1) + Connection Mode Affichage + FK Settings && Patterns - Clès étrangères && nommage + Clés étrangères && nommage + One to many (1:n) - Un à plusieurs (1:n) + Un à plusieurs (1 :n) + Many to many (n:n) - Plusieurs à plusieurs (n:n) + Plusieurs à plusieurs (n :n) + Generalization Généralisation + Copy Copie + Default Défaut - This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. - Ce mode d'affichage est disponible uniquement pour les associations de type <strong>un à un</strong>, <strong>un à plusieurs</strong> et <strong>les associations à clé étrangère</strong>. Il permet une meilleure sémantique pour relier les tables en traçant les lignes sur chacunes des colonnes concernées par l'assocation. - - - This mode is the classical one. It connects the relationship to tables through their central points. - Ceci est le mode classique. L'association est reliée aux tables en un seul trait central. - - + Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). - Motif pour les noms de clés étrangères générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). + Motif pour les noms de clés étrangères générées qui sont basées sur la clé primaire d'une table référencée (1 :1 et 1 :n) ou sur la clé primaire de la table source (n :n). + Pattern for columns generated based upon target table's pk (n-n). - Motif pour les noms de colonnes générées qui sont basées sur la clé primaire de la table cible (n:n). + Motif pour les noms de colonnes générées qui sont basées sur la clé primaire de la table cible (n :n). + Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). - Motif pour les noms de colonnes générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). + Motif pour les noms de colonnes générées qui sont basées sur la clé primaire d'une table référencée (1 :1 et 1 :n) ou sur la clé primaire de la table source (n :n). + Pattern for foreign key generated based upon target table's pk (n-n). - Motif pour les noms de clés étrangères générées qui sont basées sur une clé primaire de la table cible (n:n). + Motif pour les noms de clés étrangères générées qui sont basées sur une clé primaire de la table cible (n :n). + Pattern for unique key generated by the relationship. Motif pour les noms de clés uniques qui sont générées par une association. + + Pattern for primary key generated by identifier relationship. Motif pour les noms de clés primaires qui sont générées par une association. + + + This mode renders the relationships in crow's foot notation which has a better semantics and readability. It also determines the optimal point where the relationship is connected on the tables' edges taking their position into account. + Ce mode affiche les associations en pied d'oiseau ce qui améliore le sémantique et la lisibilité. Il détermine également le point optimal où la relation est connectée sur les bords des tables en tenant compte de leur position. + + + + Crow's foot notation + Affichage en pied d'oiseau + + + + This mode determines the optimal point where the relationship is connected on the tables' edges taking their position into account. It implies the usage of the classical ER notation. + Ce mode détermine le point optimal où la relation est connectée sur les bords des tables en tenant compte de leur position. Cela implique l'utilisation de la notation ER classique. + + + + Connect tables' edges + Connecter les bords des tables + + + + This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. It implies the usage of the classical ER notation. + Ce mode d'affichage est disponible uniquement pour les associations de type <strong>un-à-un</strong>, <strong>un-à-plusieurs</strong> et <strong>les associations aux clés étrangères</strong> mais fournit une meilleure sémantique lors de l'association de tables en plaçant les lignes sur le point exact où l'association se produit. Cela implique l'utilisation de la notation ER classique. + + + + This mode is the classical one. It connects the relationship to tables through their central points. It implies the usage of the classical ER notation. + Ce mode est le classique. Il relie les associations de tables depuis leurs points centraux. Cela implique l'utilisation de la notation ER classique. + RelationshipWidget - Form - Formulaire - - + General Général + One to one relationship Association un à un - 1-1 - 1-1 - - + One to many relationship Association un à plusieurs + 1-n 1-n + Many to many relationship Association plusieurs à plusieurs + n-n n-n + Generalization relationship (inheritance) Association de généralisation (héritage) - gen - gen - - + Dependency / Copy relationship Relation de dépendance / copie + dep dep + Relationship generated via foreign key - Relation générée par une clef étrangère + Relation générée par une clé étrangère + fk fk + Identifier Identifiant + Rel. Type: - Type de relation: + Type de relation : + Table 1: - Table n°1: + Table n°1 : + Table 2: - Table n°2: + Table n°2 : + Foreign key Settings Propriétés par défaut des clés étrangères + + Use the values defined on settings dialogs for the fields below Utiliser les paramètres de pgModeler pour les champs ci-dessous + + Use global settings for these fields Utiliser les paramètres globaux de pgModeler + ON DELETE: - Intuitif - ON DELETE: + ON DELETE : + ON UPDATE: - Intuitif - ON UPDATE: + ON UPDATE : + + + + &1-1 + + + + + &gen + + Name Patterns Règles de nommage + Column (Source): - Colonne (Source): + Colonne (Source) : + Column (Target): - Colonne (Cible): + Colonne (Cible) : + Foreign Key (Source): - Clé étrangère (Source): + Clé étrangère (Source) : + Foreign Key (Target): - Clé étrangère (Cible): + Clé étrangère (Cible) : + Cardinality: - Cardinalité: + Cardinalité : + [SRC] is required [SRC] est requis + [DST] is required [DST] est requis + + Name of the table generated from many to many relationship Nom de la table générée par une relation plusieurs à plusieurs + Deferrable: - Différable: + Reportable : + Deferral: - Report: + Report : + Copy Options Options de copie + INDEXES - INDEXES + INDEX + COMMENTS COMMENTAIRES + INCLUDING INCLURE + DEFAULTS DEFAUTS - EXCLUDING - EXCLURE - - + CONSTRAINTS CONTRAINTES + Use defaults Utiliser les valeurs par défauts + ALL TOUT + STORAGE STOCKAGE + Gen. Table Name: - Nom nouvelle table: + Nom nouvelle table : + Attributes Attributs + Constraints Contraintes + Primary key - Clef primaire + Clé primaire + Advanced Avancé + Attribute Attribut + + + Type - Type + + Constraint Contrainte + Name Nom + This advanced tab shows the objects (columns or table) auto created by the relationship's connection as well the foreign keys that represents the link between the participant tables. - Cet onglet avancé montre les objets (colonnes ou tables) générés automatiquement par la relation ainsi que les clefs étrangères qui forment le(s) lien(s) entre les tables. + Cet onglet avancé montre les objets (colonnes ou tables) générés automatiquement par la relation ainsi que les clés étrangères qui forment le(s) lien(s) entre les tables. + + is required est requis + + + Reference Table: - Table de référence: + Table référente : + Default Défaut + Receiver Table: - Table de destination: + Table de destination : + Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). - Motif pour les noms de colonnes générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). + Motif pour les noms de colonnes générées qui sont basées sur la clé primaire d'une table référencée (1 :1 et 1 :n) ou sur la clé primaire de la table source (n :n). + Pattern for columns generated based upon target table's pk (n-n). - Motif pour les noms de colonnes générées qui sont basées sur la clé primaire de la table cible (n:n). + Motif pour les noms de colonnes générées qui sont basées sur la clé primaire de la table cible (n :n). + Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). - Motif pour les noms de clés étrangères générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). + Motif pour les noms de clés étrangères générées qui sont basées sur la clé primaire d'une table référencée (1 :1 et 1 :n) ou sur la clé primaire de la table source (n :n). + Pattern for foreign key generated based upon target table's pk (n-n). - Motif pour les noms de clés étrangères générées qui sont basées sur une clé primaire de la table cible (n:n). + Motif pour les noms de clés étrangères générées qui sont basées sur une clé primaire de la table cible (n :n). + + Pattern for primary key generated by identifier relationship. - Motif pour les noms de clés primaires qui sont générées par une association. + Motif pour les noms de clés primaires qui sont générées par une association. + Primary Key Name: - Nom contrainte clé primaire: + Nom de clé primaire : + Pattern for unique key generated by the relationship. - Motif pour les noms de clés uniques qui sont générées par une association. + Motif pour les noms de clés uniques qui sont générées par une association. + Unique Key Name: - Nom contrainte unique: + Nom clé unique : + Primay Key Column: - + Colonne de clé primaire : + The receiver's primary key will be composed by the generated foreign key columns. - + La clé primaire du destinataire sera composée des colonnes de clé étrangère générées. + Instead of create a multi-valued primary key with the generated foreign keys columns a single column is created and used as primary key. - + Au lieu de créer une clé primaire à valeurs multiples avec les colonnes de clés étrangères générées, une seule colonne est créée et utilisée comme clé primaire. + Single PK column - + Colonne clé primaire simple + Custom Color: - + Couleur personnalisée : + Use the special primary key if you want to include a primary key containing generated columns to the receiver table. <strong>Important:</strong> if this is a new relationship there is a need to finish its creation and reopen this dialog to create the special primary key. - + Utilisez la clé primaire spéciale si vous souhaitez inclure une clé primaire contenant des colonnes générées dans la table de destination. <strong>Important :</strong> s'il s'agit d'une nouvelle relation, il est nécessaire de terminer sa création et de réouvrir cette boîte de dialogue pour créer la clé primaire spéciale. + Referer View: - + Vue référente : + Referer view references one or more columns of a table to construct it's own columns. - + La vue référente référence une ou plusieurs colonnes d'une table pour construire ses propres colonnes. + Referenced table has its columns referenced by a view in order to construct the columns of this latter. - + La table référencée a ses colonnes référencées par une vue afin de construire les colonnes de cette dernière. + Referer Table: - + Table référente : + Referer table references one or more columns of a table through foreign keys. This is the (n) side of relationship. - + La table référente référence une ou plusieurs colonnes d'une table via des clés étrangères. C'est le côté (n) de la relation. + Referenced table has its columns referenced by a table's foreign key. This is the (1) side of relationship. - + La table référencée a ses colonnes référencées par la clé étrangère d'une table. C'est le côté (1) de la relation. + Referenced Table: - + Table référencée : + Reference table has the columns from its primary key will copied to the receiver table in order to represent the linking between them. This is the (1) side of relationship. - + La table de référence a les colonnes de sa clé primaire copiées dans la table de réception afin de représenter la liaison entre elles. C'est le côté (1) de la relation. + Receiver (or referer) table will receive the generated columns and the foreign key in order to represent the linking between them. This is the (n) side of relationship. - + La table référente recevra les colonnes générées et la clé étrangère afin de représenter la liaison entre elles. C'est le côté (n) de la relation. + In many-to-many relationships both tables are used as reference to generate the table that represents the linking. Columns from both tables are copied to the resultant table and two foreign keys are created as well in order to reference each participant table. - - - - &1-1 - - - - &gen - + Dans les relations plusieurs-à-plusieurs, les deux tables sont utilisées comme référence pour générer la table qui représente la liaison. Les colonnes des deux tables sont copiées dans la table résultante et deux clés étrangères sont également créées afin de référencer chaque table participante. + E&XCLUDING - + E&XCLUSION + Available tokens to define name patterns:<br/> <strong>%1</strong> = Reference (source) primary key column name. <em>(Ignored on constraint patterns)</em><br/> <strong>%2</strong> = Reference (source) table name.<br/> <strong>%3</strong> = Receiver (destination) table name.<br/> <strong>%4</strong> = Generated table name. <em>(Only for n:n relationships)</em> - + Formes disponibles pour définir les modèles de noms : <br/> <strong>%1</strong> = Nom de la colonne de clé primaire de référence (source). <em>(Ignoré sur les modèles de contrainte)</em><br/> <strong>%2</strong> = Nom de la table de référence (source).<br/> <strong>%3</strong> = Nom de la table référencée (ou de déstination). <br/> <strong>%4</strong> = Nom de la table générée. <em>(Seulement pour les relations n:n)</em> - RoleWidget + ResultSetModel - Form - Formulaire + + [binary data] + [données binaires] + + + RoleWidget + Password: - Mot de passe: + Mot de passe : + Connections: - Connexions: + Connexions : + Attributes Attributs + Superuser Super utilisateur - Inherit Permissions + + Inherit permissions Hériter des permissions - Can create Database + + Can create database Peut créer des bases de données - Can create Role - Peut créer des rôles + + Can use replication + Peut utiliser la réplication - Can use Replication - Peut utiliser la réplication + + Can login + Peut se loguer + Encrypted Encrypté - Can Login - Peut s'authentifier - - + + Members Membres + + Member of Membre de + + Members (Admin.) - Membres (Admin.) - - - Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. - Definir <strong><em>Connexions</em></strong> à <strong><em>-1</em></strong> créé le rôle sans limite de connexion.<br/> Décocher <strong><em>Validité</em></strong> créé un rôle qui n'expire jamais. + Membres (Admin.) + Role Rôle + + Validity Validité + yyyy-MMM-dd hh:mm:ss - + aaaa-MMM-jj hh :mm :ss + Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. - + L'affectation de <strong><em>-1</em></strong> à <strong><em>Connexions</em></strong> crée un rôle sans limite de connexion.<br/> Décocher <strong><em>Validité</em></strong> crée un rôle qui n'expire jamais. + + + + Bypass RLS + Contournement RLS + + + + Can create role + Peut créer des rôles RuleWidget - Form - Formulaire - - + Event: - Evènement: + Évènement : + Execution Type: - Type d'exécution: + Type d'exécution : + Conditional Expr.: - Expr. conditionnelle: + Expr. conditionnelle : + Commands Commandes + SQL Command: - Commandes SQL: + Commandes SQL : + SQL command Commande SQL + To create a rule that does not perform any action (<strong>DO NOTHING</strong>) simply do not specify commands in the SQL commands table. Pour créer une règle qui n'éxécute aucune action (<strong>DO NOTHING</strong>), ne spécifiez aucune commandes dans le champs des commandes SQL. @@ -9461,912 +12148,1314 @@ accepted structure. All available options are described below. SQLExecutionWidget + Form Formulaire - Load SQL script - Ouvrir un script SQL - - - &Load - O&uvrir - - + Save SQL commands Sauvegarder commandes SQL - &Save - E&nregistrer - - - &Find - &Rechercher - - + Alt+F Alt+F + Run the specified SQL command - Exécute la commande SQL entrée + Exécuter la commande SQL entrée + Run SQL Exécuter SQL + F6 F6 + Clear sql input field and results Effacer le code SQL et la grille de résultat + Clear All Effacer + + Export results to a CSV file Exporter les résultats dans un fichier CSV + Snippe&ts - Snippe&ts + Extrai&ts + + + + Alt+T + + E&xport E&xporter - Shows the command history - Afficher l'historique des commandes + + ... + ... + + + + SQL file (*.sql);;All files (*.*) + Fichier SQL (*.sql);;Tous les fichiers (*.*) + + + + Load + Charger - &History - &Historique + + Save + Enregistrer - Alt+H - Alt+H + + Save as + Enregistrer sous - Command History - Historique des commandes + + [binary data] + [données binaires] - Clear sql input field and results. - Effacer les résultats et le code SQL saisi. + + + Messages (%1) + - Clear - Effacer + + [%1]: SQL command successfully executed in <em><strong>%2</strong></em>. <em>%3 <strong>%4</strong></em> + - ... - ... + + Save CSV file + Sauvegarder fichier CSV - 0 - 0 + + Comma-separated values file (*.csv);;All files (*.*) + Fichiers CSV avec champs séparés par des virgules (*.csv);;Tous les fichiers (*.*) - Rows returned: - Lignes retournées: + + The SQL input field and the results grid will be cleared! Want to proceed? + Le champ d'entrée SQL ainsi que la grille des résultats vont être purgés ! Voulez-vous poursuivre ? - SQL file (*.sql);;All files (*.*) - Fichier SQL (*.sql);;Tous les fichiers (*.*) + + Save history + Enregistrer l'historique - [binary data] - [données binaires] + + Reload history + Recharger l'historique - Save CSV file - Sauvegarder fichier CSV + + Find in history + Rechercher dans l'historique - Comma-separated values file (*.csv);;All files (*.*) - Fichiers CSV, champs séparés par des points-virgules (*.csv);;Tous les fichiers (*.*) + + Hide find tool + Masquer l'outil de recherche - The SQL input field and the results grid will be cleared! Want to proceed? - Tout le code SQL ainsi que la grille des résultats vont être purgés! Continuer? + + This action will wipe out all the SQL commands history for the current connection! Do you really want to proceed? + Cette action effacera tout l'historique des commandes SQL pour la connexion en cours ! Voulez-vous vraiment poursuivre ? + Load SQL commands - + Charger commandes SQL + Copy selection - + Copier la sélection + Search in SQL code - + Rechercher dans le code SQL + Toggles the output pane - + (Dés)active le volet de sortie + &Output - + S&ortie + Alt+O - Alt+O + Alt+O + + + Results - + Résultats + Messages - + + History - + Historique + No results retrieved or changes done due to the error above. - + Aucun résultat n'a été récupéré ou des modifications ont été effectuées en raison de l'erreur ci-dessus. - Messages (%1) - + + Results (%1) + Resultats (%1) - Results (%1) - + + Rows affected + Lignes affectées - [%1]: SQL command successfully executed. <em>%2 <strong>%3</strong></em> - + + Rows retrieved + Lignes récupérées - Rows affected - + + Plain format + Format simple - Rows retrieved - + + CVS format + Format CVS + + This action will wipe out all the SQL commands history for all connections! Do you really want to proceed? + Cette action effacera tout l'historique des commandes SQL pour toutes les connexions ! Voulez-vous vraiment poursuivre ? + + + Clear history - + Nettoyer l'historique - - - SQLToolWidget - Form - Formulaire + + Close the current SQL script + Fermer le script SQL actuel - Database explorer - Explorateur de bases de données + + SQL script currently handled + Script SQL actuellement géré + + + + (not saved) + (non enregistré) - Connect to server - Démarrer la connexion + + Handle external SQL script + Gérer le script SQL externe - Disconnect from server - Se déconnecter + + &Script + - Browse selected database. - Charger les informations de la base sélectionnée + + Fi&nd + &Rechercher - Drop the selected database - Supprimer la base de données sélectionnée + + Alt+X + - Shift+Del - Shift+Del + + Current working database + Base de données de travail actuelle + + + + SQLToolWidget + + + Form + Formulaire - Update the database list. - Actualiser la liste des bases de données. + + Database explorer + Explorateur de bases de données + SQL execution - Exécuteur SQL + Exécuteur de code SQL + + ... ... + Warning Avertissement - <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? - <strong>ATTENTION:</strong> Vous êtes sur le point de supprimer l'intégralité de la base de données <strong>%1</strong>! Toutes les données seront définitivement supprimées. Détruire la base ? - - - You're running a demonstration version! The data manipulation feature is available only in the full version! - Vous utilisez la version de démonstration ! Cette fonctionnalité est disponible uniquement sur la version complète ! - - + Disconnect from all databases - + Se déconnecter de toutes les bases de données + Update the database list - + Mettre à jour la liste des bases de données + Toggle the object's attributes grid - + (Dés)active la grille des attributs de l'objet + Attributes - Attributs + Attributs + Alt+R - Alt+R + Alt+R + Toggle the display of source code pane - + (Dés)active l'affichage du volet du code source + + Source code - Code source + Code source + <strong>ATTENTION:</strong> Disconnect from all databases will close any opened tab in this view! Do you really want to proceed? - + <strong>ATTENTION :</strong> Se déconnecter de toutes les bases de données fermera tout onglet ouvert dans cette vue ! Voulez-vous vraiment poursuivre ? - SchemaWidget + SceneInfoWidget + Form - Formulaire + Formulaire + + + + + Current position of the mouse in the canvas + Position actuelle de la souris dans le canevas + + + + + + + - + + + + + + Current zoom factor + Facteur de zoom actuel + + + Currently selected object(s) + Objet(s) actuellement sélectionné(s) + + + + + Dimensions of the selected object(s) + Dimensions de(s) l'objet(s) sélectionné(s) + + + + No selection + Aucune séléction + + + + N/A + Inconnu + + + + Sel. objects: %1 + Objets select. : %1 + + + + SchemaWidget + + Show rectangle Afficher le rectangle + Fill color: - Couleur de remplissage: + Couleur de remplissage : SequenceWidget - Form - Formulaire - - + Cyclic: - Cyclique: + Cyclique : + Start: - Début: + Début : + Maximum: - Maximum: + Maximum : + Minimum: - Minimum: + Minimum : + + + + Defualt values: + + Increment: - Incrément: + Incrément : + Cache: - Cache: + Cache : + Owner Col.: - Pas mieux - Owner Col.: + Proprio. Col. : + + + + User defined + SnippetsConfigWidget + Form - Formulaire + Formulaire + Create new connection - Créer une nouvelle connexion + Créer une nouvelle connexion + Cancel edition - Annuler l'édition + Annuler l'édition + Edit selected connection - Editer la connexion sélectionnée + Modifier la connexion sélectionnée + Delete selected connection - Supprimer la connexion sélectionnée + Supprimer la connexion sélectionnée + Remove All - Tout supprimer + Tout supprimer + Shift+Del - Shift+Del + Maj+Suppr + Filter: - Filtrer: + Filtrer : + ID: - Identifiant: + Identifiant : + Add - Ajouter + Ajouter + Update - Mettre à jour + Mettre à jour + General - Général + Général + Label: - + Étiquette : + Applies to: - + S'applique à : + Parsable or dynamic snippets are written in the <strong>schema micro language</strong> syntax. When using a parsable snippet the attributes surrounded in <strong>{}</strong> will be replaced by the selected object's matching attributes. - + Les extraits de code analysables ou dynamiques sont écrits dans la syntaxe <strong>schema micro language</strong>. Lorsque vous utilisez un extrait de code analysé, les attributs entourés par des <strong>{}</strong> seront remplacés par les attributs correspondants de l'objet sélectionné. + Parsable - + Analysable + When handling parsable snippets empty attributes will be replaced by a value in the format <strong>{attribute}</strong>. Note that this option can affect the semantics of the resulting snippet. - + Lors de la manipulation d'extraits de code analysables, les attributs vides seront remplacés par une valeur au format <strong>{attribut}</strong>. Noter que cette option peut affecter la sémantique de l'extrait résultant. + Placeholders - + Élément de substitution + Parse the snippet in order to check if there are syntax errors. - + Analyser l'extrait de code afin de vérifier s'il existe des erreurs de syntaxe. + Parse - + Analyser + Snippets: - + Extraits : + General purpose - + Usage général + All snippets - + Tous les extraits + /* Error parsing the snippet '%1': %2 */ - + /* Erreur lors de l'analyse de l'extrait '%1': + + %2 */ + Duplicated snippet id <strong>%1</strong> detected. Please, specify a different one! - + Identifiant <strong>%1</strong> d'extrait dupliqué détécté. Merci d'en choisir un autre ! + Invalid ID pattern detected <strong>%1</strong>. This one must start with at leat one letter and be composed by letters, numbers and/or underscore! - + Motif d'identification <strong>%1</strong> incorrect détecté. Celui-ci doit commencer par au moins une lettre et être composé de lettres, de chiffres et/ou de tirets bas _ ! + Empty label for snippet <strong>%1</strong>. Please, specify a value for it! - + Label vide pour l'extrait <strong>%1</strong>. Merci de lui spécifier une valeur ! + Empty code for snippet <strong>%1</strong>. Please, specify a value for it! - + Code vide pour l'extrait <strong>%1</strong>. Merci de lui spécifier une valeur ! + The dynamic snippet contains syntax error(s). Additional info: <br/><em>%1</em> - + L'extrait dynamique contient des erreurs de syntax. Plus d'informations : <br/><em>%1</em> + Do you really want to remove all snippets? - + Voulez-vous vraiment supprimer tous les extraits ? + No syntax errors found in the snippet. - + Aucune erreur de syntax retrouvée dans l'extrait. SourceCodeWidget - Form - Formulaire - - + Version: - Version: + Version : + PostgreSQL PostgreSQL + iconecodigo - icone + icône + SQL SQL - XML - XML + + Original + - Type: - Type: + + XML + XML + Source code visualization Visualisation du code source + SQL code (*.sql);;All files (*.*) - Code SQL (*.sql);;Tous les fichiers (*.*) + Code SQL (*.sql);;Tous les fichiers (*.*) + Generating source code... Génération du code source... + + -- NOTE: the code below contains the SQL for the selected object +-- as well for its dependencies and children (if applicable). +-- +-- This feature is only a convinience in order to permit you to test +-- the whole object's SQL definition at once. +-- +-- When exporting or generating the SQL for the whole database model +-- all objects will be placed at their original positions. + + + + -- NOTE: le code ci-dessous contient le code SQL de l'objet sélectionné +-- ainsi que de ses dépendances et enfants (le cas échéant). +-- +-- Cette fonctionnalité n'est qu'une commodité vous permettant de tester +-- la définition SQL de l'objet entier. +-- +-- Lors de l'export ou de la génération du code SQL pour l'ensemble du modèle de base de données, +-- tous les objets seront placés à leurs positions d'origine. + + + + + + -- SQL code unavailable for this type of object -- -- Code SQL non disponible pour ce type d'objet. -- + Code display: - - - - Original - + Affichage du code : + Original + depedencies' SQL - + Original + dépendances de SQL + Original + children's SQL - + Original + enfants de SQL + Save the SQL code to a file. - + Enregistrer le code SQL dans un fichier. + Save SQL - + Enregistrer le code SQL + Save SQL code as... - - - - -- NOTE: the code below contains the SQL for the selected object --- as well for its dependencies and children (if applicable). --- --- This feature is only a convinience in order to permit you to test --- the whole object's SQL definition at once. --- --- When exporting or generating the SQL for the whole database model --- all objects will be placed at their original positions. - - - - + Enregistrer le code SQL sous... + <!-- XML code preview disabled in demonstration version --> - + < !-- Aperçu du code XML désactivé dans la version de démonstration --> + <strong>Original:</strong> displays only the original object's SQL code.<br/><br/> <strong>Dependencies:</strong> displays the original code including all dependencies needed to properly create the selected object.<br/><br/> <strong>Children:</strong> displays the original code including all object's children SQL code. This option is used only by schemas, tables and views. - + <strong>Original :</strong> affiche uniquement le code SQL de l'objet d'origine.<br/><br/> <strong>Dépendances :</strong> affiche le code d'origine ainsi que toutes les dépendances nécessaires pour créer correctement l'objet sélectionné.<br/><br/> <strong>Enfants :</strong> affiche le code original ainsi que le code SQL de tous les enfants. Cette option est utilisée uniquement par les schémas, les tables et les vues. + -- SQL code purposely truncated at this point in demo version! - + + +-- Le code SQL est volontairement tronqué à ce stade dans la version démo ! SwapObjectsIdsWidget - Form - Formulaire + + Create: + Créer : + + + + + ID: + Identifiant : + + + + Before: + Avant : + + + + Swap the values of the fields + Procède à l'échange + + + + Swap values + Échanger + + + + Change objects creation order + Changer l'ordre de création des objets + + + + Change the objects creation order is an irreversible operation and cause the operations history to be automatically erased. Note that the creation order configured in this form is not definitive and may change after a model validation. + Modifier l'ordre de création des objets est une opération irréversible qui entraîne l'effacement automatique de l'historique des opérations. Noter que l'ordre de création configuré dans ce formulaire n'est pas définitif et peut changer après la validation d'un modèle. + + + + Swap the object ids changing their creation order + Modifie l'ordre de création de deux objets en échangeant leurs numéros d'identification - Create: - Créer: + + Swap ids + Échanger identifiants - ID: - Identifiant: + + Filter: + Filtrer : - Before: - Avant: + + ID + Identifiant - It's recommended to use this feature only when the SQL validation fails in cases when a object is being referenced in portions where the ordinary validation couldn't reach, e.g., inside of a rule command or check constraint expression. - Il est recommandé d'utiliser cette fonctionnalité seulement lorsque la validation SQL échoue. C'est souvent le cas lorsque des objets possèdent des références vers d'autres objets que vous avez créé ultérieurement dans le modèle . Echanger les ID débloque la situation. + + Object + Objet - Swap the values of the fields - Procède à l'échange + + Type + - Swap values - Échanger + + Parent Object + Objet parent - Change objects creation order - + + Parent Type + Type parent Table + new_table nouvelle_table + In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2' - + Dans la version de démonstration, les tables ne peuvent contenir que `%1' instance(s) de chaque type d'objet enfant ou table ancêtre ! Vous avez atteint cette limite pour le type : `%2' TableDataWidget + Edit table data + Modifier les données de la table + + + + Copy items on the grid + Copier les éléments sur la grille + + + + Copy + Add empty rows - + Ajouter des lignes vides - Add - Ajouter + + Add row + + Ins - Ins + Insérer - Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. - + + Ctrl+D + + Add an empty column - + Ajouter une colonne vide - Remove all rows from the grid preserving columns + + Delete rows - Clear - Effacer + + Remove all rows from the grid preserving columns + Supprimer toutes les lignes des colonnes de préservation de la grille + Shift+Del - + Maj+Suppr + Delete the selected rows - + Supprimer les lignes sélectionnées - Delete - Supprimer + + + Del + Suppr - Del - + + Duplicate the selected rows + Dupliquer les lignes sélectionnées + + + + Delete the selected columns + Supprimer les colonnes sélectionnées - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> + + Delete column - Duplicate the selected rows + + Paste items on the grid + Copier les éléments sur la grille + + + + Paste + Coller + + + + Ctrl+V - Duplicate + + <html><head/><body><p>Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <span style=" font-weight:600;">INSERT</span> commands.</p></body></html> - Ctrl+D + + Add column - Delete the selected columns + + Duplicate rows + + Change the values of all selected cells at once + Modifier d'un coup les valeurs de toutes les cellules sélectionnées + + + + Bulk data edit + Modification de données en masse + + + + Ctrl+E + Ctrl+E + + + Remove all columns (and rows) from the grid + Supprimer toutes les colonnes (et lignes) de la grille + + + + Delete all columns + Ctrl+Shift+Del + Ctrl+Maj+Suppr + + + + Delete all rows + Delete columns is an irreversible action! Do you really want to proceed? - + Effacer des colonnes est une action irréversible ! Voulez-vous vraiment poursuivre ? + Remove all rows is an irreversible action! Do you really want to proceed? - + Supprimer toutes les lignes est une action irréversible ! Voulez-vous vraiment poursuivre ? + Remove all columns is an irreversible action! Do you really want to proceed? - + Supprimer toutes les colonnes est une action irréversible ! Voulez-vous vraiment poursuivre ? + + Unknown column - + Colonne inconnue + Duplicated column - + Colonne dupliquée - (no columns) - + + Fills the grid using a CSV file + Remplit la grille en utilisant un fichier CSV + + + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + <html><head/><body><p>Les valeurs vides sont supposées être <span style="font-weight :600;">DEFAULT</span>. Pour utiliser des valeurs spéciales comme <span style="font-weight :600;">NULL</span>, un appel de fonction comme <span style="font-weight :600;">now()</span> ou un échappement des données spécifiques, entourer les valeurs de deux barres obliques, par exemple <span style="font-weight :600;">/valeur/</span>. Pour utiliser une barre oblique dans le cadre de la valeur, ajouter le caractère barre oblique inverse, par exemple <span style="font-weight :600;">/</span>.</p></body></html> TableObjectView + Relationship: %1 - - - - - TableView - - Connected rels: %1 - Associations: %1 + +Relations : %1 TableWidget - Form - Formulaire - - + Options Options + Tag: - Tag: + Balise : + With OID Avec OID + Generate ALTER for columns/constraints Utiliser ALTER pour les colonnes/contraintes + Unlogged Unlogged - Columns - Colonnes - - - Constraints - Contraintes - - - Triggers - Déclencheur - - - Rules - Règles - - - Indexes - Indexes - - - Tables - Tables - - + + + + + + + Name Nom + Schema Schéma + + + Type - Type + + + PK + Faut-il le traduire ? + CP + + + Default Value Valeur par défaut - Attribute - Attribut + + Attribute(s) + Attribut(s) + + It is not possible to mark a column as primary key when the table already has a primary key which was created by a relationship! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. + Il n'est pas possible de marquer une colonne comme clé primaire quand la table a déjà une clé primaire qui a été créée par une relation ! Cette action doit être effectuée dans la section <strong>Clé primaire</strong> du formulaire d'édition de la relation. + + + + It is not possible to mark a column created by a relationship as primary key! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. + Il n'est pas possible de marquer une colonne créée par une relation comme clé primaire ! Cette action doit être effectuée dans la section <strong>Clé primaire</strong> du formulaire d'édition de la relation. + + + ON DELETE - ON DELETE + Faut-il le traduire ? + À la suppression + ON UPDATE - ON UPDATE + Faut-il le traduire ? + À la mise à jour + Refer. Table - Table référ. + Table de référ. + Firing Déclencheur + Events Evènements + Execution Exécution + Event Evènement + Indexing Indexation + + Command + Commande + + + + Permissive + Permissif + + + + USING expression + Faut-il le traduire ? + + + + + CHECK expression + Faut-il le traduire ? + + + + + Roles + Rôles + + + Parent - Parent + + Copy Copie + + Yes + Oui + + + + No + Non + + + &Columns - + &Colonnes + Co&nstraints - + Co&ntraintes + Tri&ggers - + Décl&encheurs + &Rules - + &Régles + &Indexes - + &Index + &Tables - + &Tables + Edit data - + Modifier données + Define initial data for the table - + Définir les données initiales de la table + + + + Enable row level security + Activer la sécurité au niveau de la ligne + + + + Force RLS for owner + Forcer RLS pour le propriétaire + + + + &Policies + &Politiques TablespaceWidget + Form Formulaire + Directory: - Dossier: + Dossier : TagWidget - Form - Formulaire - - + Colors Couleurs + Extended body: - Corps étendu: + Corps étendu : + Body: - Corps: + Corps : + Title: - Titre: + Titre : + Schema name: - Nom du schéma: + Nom du schéma : + Table name: - Nom de la table: + Nom de la table : TaskProgressWidget + Executing tasks Exécution des tâches + + Waiting task to start... En attente du démarrage de la tâche ... @@ -10374,633 +13463,727 @@ Relationship: %1 TextboxWidget - Form - Formulaire - - + Font: - Police: + Police : + Text Texte + pt pt + Color: - Couleur: + Couleur : + Bold Gras + Italic Italique + Underline Souligné + Select text color - Sélection de la couleur de texte + Sélection de la couleur du texte TriggerWidget - Form - Formulaire - - + Event: - Evènement: + Évènement : + INSERT INSERT + DELETE DELETE + UPDATE UPDATE + TRUNCATE TRUNCATE + Deferrable: - Différable: + Reportable : + Columns Colonnes + Column: - Colonne: + Colonne : + Arguments Arguments + Constraint Contrainte + FOR EACH ROW Pour chaque ligne + Refer. Table: - Table référ.: + Table référ. : + Condition: - Condition: + Condition : + Argument: - Argument: + Argument : + Function: - Fonction: + Fonction : + Options: - Options: + Options : + Excution: - Excution: + Exécution : + Column Colonne + Type - Type + TypeWidget - Form - Formulaire - - + Configuration: - Configuration: + Configuration : + Base Type Type de base + Enumeration - Enumération - - - Composite - Composite + Énumération + Enumerations Énumérations + Enumeration: - Énumeration: + Énumération : + + + Attributes Attributs + Internal Length: - Long. interne: + Long. interne : + Storage: - Stockage: + Stockage : + Category: - Catégorie: + Catégorie : + Delimiter: - Délimiteur: + Délimiteur : + Alignment: - Alignement: + Alignement : + char char + smallint smallint + integer integer + double precision - double precision + double précision + Default Value: - Valeur par défaut: + Valeur par défaut : + Range - Interval + Intervalle + Options: - Options: + Options : + By value Par valeur + Preferred Préféré + Collatable - Collatable + Assemblable + Functions Fonctions + INPUT: - INPUT: + INPUT : + OUTPUT: - OUTPUT: + OUTPUT : + RECV: - RECV: + RECV : + SEND: - SEND: + SEND : + TPMOD_IN: - TPMOD_IN: + TPMOD_IN : + TPMOD_OUT: - TPMOD_OUT: + TPMOD_OUT : + ANALYZE: - ANALYZE: + ANALYZE : + Name: - Nom: + Nom : + Collation: - Collation: + Collation : + Subtype Diff Func.: - Fonction de différence du sous-type: + Fonction de différence du sous-type : + Operator Class: - Classe d'opérateurs: + Classe d'opérateurs : + Canonical Func.: - Fonction canonique: + Fonction canonique : + Like Type - Type de Like + Type de Like + Element Type Type d'élement + Subtype Sous-type + Name Nom + Type - Type + + Collation - Collation + + The functions to be assigned to a type should be written in C language and possess, respectively, the following signatures:<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any function(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring function(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta function(any)</em></td> <td><strong>RECV:</strong> <em>any function(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer function(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring function(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean function(internal)</em></td> <tr> </table> - La fonction assignée à un type devrait être écrite en langage C et possèder, les signatures respective suivantes:<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any fonction(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring fonction(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta fonction(any)</em></td> <td><strong>RECV:</strong> <em>any fonction(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer fonction(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring fonction(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean fonction(internal)</em></td> <tr> </table> + Les fonctions assignées à un type devraient être écrites en langage C et possèder, les signatures suivantes :<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any function(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring function(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta function(any)</em></td> <td><strong>RECV:</strong> <em>any function(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer function(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring function(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean function(internal)</em></td> <tr> </table> + The functions to be assigned to a range type should have the following signatures:<br/><br/><strong>Canonical:</strong> <em>any function(any)</em> <br/><strong>Subtype Diff:</strong> <em>double precision function(subtype, subtype)</em> - Les fonction assignables au type interval (RANGE) doivent avoir la signature suivante:<br/><br/><strong>Canonique:</strong> <em>any function(any)</em> <br/><strong>Subtype Diff:</strong> <em>double precision function(subtype, subtype)</em> + Les fonction assignables au type plage (RANGE) doivent avoir la signature suivante :<br/><br/><strong>Canonical:</strong> <em>any function(any)</em> <br/><strong>Subtype Diff:</strong> <em>double precision function(subtype, subtype)</em> + Co&mposite - + Co&mposite UpdateNotifierWidget + Update Notifier Vérificateur de mise à jour - New update found! - Nouvelle mise à jour disponible! - - + Hide this widget Cacher ce widget + ... ... + Released in: - Date de sortie: + Date de sortie : + mmm dd, yyyy - dd mmm yyyy - - - Version: - Version: + jj mmm aaaa + 0.0.0 0.0.0 + Changelog Journal des modifications + Redirects to purchase page. Redirige vers la page web pour acheter. + Get binary package Télécharger l'application compilée + Redirects to GitHub source repository. Redirige vers la page web du dépôt GitHub. + Get source code Télécharger le code source - <strong>Note:</strong> Both actions below will open a new web browser window - <strong>Remarque:</strong> Ces boutons entraînent l'ouverture de votre navigateur web - - - Purchase a new package - Acheter un nouveau paquet - - + + Failed to check updates Impossible de vérifier la présence de mise à jour - The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <strong>%1</strong>. - Le vérificateur de mise à jour n'a pas pu vérifier la présence de nouvelles versions ! Vérifiez votre connexion à Internet et réessayez ! Code d'erreur retourné : <strong>%1</strong>. + + The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <em>%1</em> - <strong>%2</strong>. + Le notificateur de mise à jour n'a pas pu vérifier les nouvelles versions ! Merci de vérifier votre connexion internet et de réessayer ! Erreur de connexion renvoyée : <em>%1</em> - <strong>%2</strong>. + No updates found - Aucune mise à jour disponible + Aucune mise à jour trouvée + You are running the most recent pgModeler version! No update needed. Vous utilisez déjà la version de pgModeler la plus récente ! Aucune mise à jour requise. + The update notifier failed to check for new versions! A HTTP status code was returned: <strong>%1</strong> Le vérificateur de mise à jour n'a pas pu vérifier la présence de nouvelles versions ! Code retour HTTP reçu : <strong>%1</strong> - Recover a package - - - + Update found! - + Mise à jour trouvée ! + New version: - + Nouvelle version : ViewWidget - Form - Formulaire - - + References Références + Column Colonne + Expression Expression + Used in: - Utilisé dans: + Utilisé dans : + Reference Type: - Type de référence: - - - SELECT-FROM - SELECT-FROM - - - FROM-WHERE - FROM-WHERE - - - After WHERE - Après WHERE + Type de référence : + View Definition Définition de la vue + Options Options + Tag: - Tag: + Balise : + Mode: - Mode: + Mode : + Ordinary Ordinaire - Recursive - Récursif - - - Materialized - Matérialisée - - + With no data - With no data + Sans données + Table: - Table: + Table : + Table Alias: - Alias table: + Alias table : + Column: - Colonne: + Colonne : + Column Alias: - Alias colonne: + Alias colonne : + Expression: - Expression: + Expression : + Expression Alias: - Alias expression: + Alias expression : + + + + SELECT ... + Faut-il le traduire ? + + + + + WHERE ... + Faut-il le traduire ? + + + FROM ... + Faut-il le traduire ? + + + + Triggers Déclencheur + Rules Règles + + Indexes + + + + Table Expression CTE + Code Preview Prévisualisation du code + + Alias Col. + Alias col. + + + Col./Expr. - Col./Expr. + + Alias - Alias + - Alias Col. - Alias col. + + Flags: SF FW AW EX VD + Marques : SF FW AW EX VD - Flags: SF FW AW VD - Flags: SF FW AW VD + + To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[table].*</strong></em> + Pour référencer toutes les colonnes d'une table (*), ne pas remplir le champ <strong>Colonne</strong> revient à écrire <em><strong>[schema].[table].*</Strong></em> + + + Name Nom + Refer. Table - Table référ. + Table de référ. + Firing Déclenche + Events Evènements + + Indexing + Indexation + + + Execution Exécution + Event Evènement + /* Could not generate the SQL code. Make sure all attributes are correctly filled! - /* Le code SQL ne peut être généré. Vérifiez que les champs sont correctement remplis! - - - To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[tablel].*</strong></em> - Pour référencer toutes les colonnes dans une table (*) ne remplissez pas le champs <strong>Colonne</strong>, ceci revient à écrire <em><strong>[schéma].[table].*</strong></em> + /* Le code SQL ne peut être généré. Vérifiez que les champs sont correctement remplis ! + Recursi&ve - + Récursi&f + &Materialized - - - - - WelcomeWidget - - Form - Formulaire + &Matérialiser - New model - Nouveau modèle + + The element will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns + L'élément sera utilisé dans le cadre de l'instruction SELECT pour extraire des colonnes ou des expressions qui composeront les colonnes de la vue. - Open model - Ouvrir modèle + + The element will be used as part of the WHERE clause in form of conditional expression + L'élément sera utilisé dans le cadre de la clause WHERE sous forme d'expression conditionnelle. - Sample models - Modèles de démo + + The element is used in the FROM portion of the command in order to reference tables or construct JOIN statements + L'élément est utilisé dans la partie FROM de la commande afin de référencer des tables ou de construire des instructions JOIN. - Recent models - Modèles récents + + The element's expression is used exclusively as the view's definition + L'expression de l'élément est utilisée exclusivement comme définition de la vue. - Last session - Dernière session + + The element will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements + L'élément sera ajouté à la fin de la définition de la vue. Ceci est utile lors de l'utilisation des instructions GROUP BY/HAVING. - - - Xml2Object - Xml2Object - Xml2Object + + End expression + Expression finale - Xml2ObjectWidget - - XML2Object - XML2Object - + WelcomeWidget - Load XML - Charger XML + + Form + Formulaire - Clear - Effacer + + New model + Nouveau modèle - Generate - Générer + + Open model + Ouvrir modèle - Close - Fermer + + Sample models + Modèles de démo - Database model (*.dbm);;XML file (*.xml);;All files (*.*) - Modèle de base de données (*.dbm);;Fichier XML (*.xml);;Tous les fichiers (*.*) + + Recent models + Modèles récents - Load file - Charger un fichier + + Last session + Dernière session diff --git a/lang/nl_NL.qm b/lang/nl_NL.qm index 5a3df20d0b94a409b732d14df809b6fe64e342eb..d5035fc2002a704053ed28a857253b607ac8298b 100644 GIT binary patch delta 18658 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 delta 38019 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

tMW)<@SUuG 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 diff --git a/lang/nl_NL.ts b/lang/nl_NL.ts index 83dfa028b2..0d901913f3 100644 --- a/lang/nl_NL.ts +++ b/lang/nl_NL.ts @@ -9,250 +9,63 @@ Over pgModeler - + + 0.0.0 + 0.0.0 + + + + build: + + + + PostgreSQL Database Modeler PostgreSQL Database Modeler - + Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. Een Open Source data modeleer tool ontworpen voor PostgreSQL. Met pgModeler hoef je niet langer zelf je DDL commando's schrijven, laat dit over aan pgModeler! Deze software brengt de concepten van Entity-Relationship diagrammen samen met de features die PostgreSQL implementeerd als uitbreidingen van de SQL standaard. - - Design, configure, deploy - Ontwerp, configureer, implementeer - - - - pgModeler is proudly a brazilian software! - pgModeler is trotse braziliaanse software! + + <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" text-decoration: underline; color:#2980b9;">https://pgmodeler.io</span></a></p></body></html> + - - <a href="http://pgmodeler.com.br">http://pgmodeler.com.br</a> + + <html><head/><body><p>Copyright 2006-2018 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.io</span></a>&gt;</p></body></html> - - <html><head/><body><p>Copyright 2006-2016 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - + + pgModeler is proudly a brazilian software! + pgModeler is trotse braziliaanse software! - + Hide this widget Verberg dit widget - + ... - - 0.0.0.0 - - - - - (CODE_NAME) - - - - - Build: - - - - + (BUILD_NUM) - + License Licensie - - - Contributors - Medewerkers - - - - <html><head/><body><p>This page is dedicated to all contributors who gave a bit of their time in make pgModeler a better software somehow. The complete list of people that helped pgModeler can be found at <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>If you have a great idea to improve pgModeler please submit it <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">here</span></a>. No ideas for now but want to help? Why not donate a few bucks <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">here</span></a>!?</p></body></html> - <html><head/><body><p>Deze pagina is opgedragen aan alle medewerkers die een beetje van hun tijd opofferden om pgModeler te verbeteren op verschillende manieren. De volledige lijst van individuen die meewerken aan pgModeler is terug te vinden op <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>Indien je een geweldig idee hebt om pgModeler te verbeteren, <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">aarzel dan niet om het ons te laten weten</span></a>. Geen idee hoe je ons kan helpen? Waarom geen kleine bijdrage <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">storten</span></a>!?</p></body></html> - - - - 1 - - - - - 2 - - - - - 3 - - - - - 4 - - - - - 5 - - - - - 6 - - - - - 7 - - - - - 8 - - - - - Name - Naam - - - - Country - Land - - - - Contribution - Bijdrage - - - - Damien Degois - - - - - - - France - Frankrijk - - - - French UI translation and several improvements in auxiliary scripts. - Franse vertaling en verschillende verbeteringen in scripts. - - - - Ji Bin - - - - - China - China - - - - Chinese UI translation and small fixes. - Chinese vertaling en kleine verbeteringen. - - - - Pierre-Samuel LE STANG - - - - - - French UI translation. - Franse vertaling. - - - - Lisandro Damián Nicanor - - - - - Argentina - Argentinië - - - - Improvements on build scripts enabling the custom packaging in Linux distros; Per-user settings; pgModeler's package maintainer in Debian Linux. - Aanpassingen aan de build script die aangepaste verpakking for Linux distro's mogelijk maakt; per-user instellingen; Debian Linux package maintainer voor pgModeler. - - - - Pavel Alexeev - - - - - Russia - Rusland - - - - Additional work for packaging in Linux distros; pgModeler's package maintainer in Fedora Linux. - Bijkomend werk voor Linux Distro verpakking; Fedora Linux package maintainer voor pgModeler. - - - - Mariusz Fik - - - - - Poland - Polen - - - - Custom packaging first ideas. Tester of first version of custom packaging patch. - Eerste ideëen betreffende aangepaste verpakkingen. Tester van de eerste versie van de aangepaste verpakkingen patch. - - - - Jonathan DUPRE - - - - - Gilberto Castillo - - - - - Cuba - Cuba - - - - Spanish UI translation. - Spaanse vertaling. - AggregateWidget - - Form - Venster - Final Function: @@ -294,7 +107,7 @@ Status Data Type - + An aggregate function that accepts the types <em><strong>typeA</strong></em> and <em><strong>typeB</strong></em> as input types and which type of state is <em><strong>state_type</strong></em>, must obey the following rules: <br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Final Function:</strong> <em>void final_function(<strong>state_type</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Transition Function:</strong> <em><strong>state_type</strong> transition_function(<strong>state_type</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> Een aggregatie-funtie die de types <em><strong>typeA</strong></em> en <em><strong>typeB</strong></em> als invoer aanvaardt en waarvan het status-type <em><strong>status_type</strong></em> is. De volgende regels moeten voldaan zijn: <br/><br/> <strong>&nbsp;&nbsp;&nbsp;• Finale Functie:</strong> <em>void finale_functie(<strong>status_type</strong>)</em><br/> <strong>&nbsp;&nbsp;&nbsp;• Overgangsfunctie:</strong> <em><strong>status_type</strong> transitie_functie(<strong>status_type</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> @@ -408,181 +221,191 @@ + Constraint: Name + + + + + Constraint: Descriptor + + + + View: Schema name View: Schemanaam - + View: View name View: View-naam - + View: References box View: Referenties box - + View: Extended attributes box View: Uitgebreide attributen box - + View: Title box View: Titel box - + View: Table / columns alias View: Tabel / Kolom alias - + View: Referenced column View: Gerefereerde kolom - + View: Referenced table View: Gerefereerde tabel - + View: Reference descriptor View: Referentiebeschrijving - + Textbox: Body Tekst box: Inhoud - + Column: Column name Kolom: Kolom naam - + Column: Descriptor Kolom: Beschrijving - + Column: Included / Inherited by relationship Kolom: Ingesloten / Overgeërfd via relatie - + Column: Protected Kolom: Beschermd - + Column (pk): Column name Kolom (pk): Kolom naam - + Column (pk): Descriptor Kolom (pk): Beschrijving - + Column (fk): Column name Kolom (fk): Kolom naam - + Column (fk): Descriptor Kolom (fk): Beschrijving - + Column (uq): Column name Kolom (uq): Kolom naam - + Column (uq): Descriptor Kolom (uq): Beschrijving - + Column (nn): Column name Kolom (nn): Kolom naam - + Column (nn): Descriptor Kolom (nn): Beschrijving - + Relationship: Descriptor Relatie: Beschrijving - + Relationship: Label text Relatie: Label tekst - + Relationship: Label box Relatie: Label box - + Relationship: Attribute text Relatie: Attribuut tekst - + Relationship: Attribute descriptor Relatie: Attribuut beschrijving - + Tag: Name Tag: Naam - + Tag: Body Tag: Inhoud - + Placeholder: Body - + Font: Lettertype: - + Colors: Kleuren: - + pt pt - + Underline Onderstrepen - + Italic Cursief - + Bold Vet @@ -590,16 +413,24 @@ Application - + Unknown exception caught! Een onbekende uitzondering trad op! - + Failed to create initial configuration in `%1'! Check if the current user has write permission over that path and at least read permission over `%2'. De initiële configuratie kon niet worden gecreëerd in `%1'! Kijk na of de huidige gebruiker schrijf-machtigingen heeft op dit pad en minstens lees-machtigingen op '%2'. + + BaseConfigWidget + + + A backup of the previous settings was saved into <strong>%1</strong>! + + + BaseForm @@ -624,7 +455,7 @@ &Ok - + %1 properties @@ -632,167 +463,177 @@ BaseObject - + Column Kolom - + Constraint Constraint - + Function Functie - + Trigger Trigger - + Index Index - + Rule Regel - + Table Tabel - + View View - + Domain Domein - + Schema Schema - + Aggregate Aggregator - + Operator Operator - + Sequence Sequentie - + Role Rol - + Conversion Conversie - + Cast Cast - + Language Taal - + Type Type - + Tablespace Tablespace - + Operator Family Operator Familie - + Operator Class Operator Klasse - + Database Database - + Collation Sortering - + Extension Uitbreiding - + Event Trigger Event Trigger - + Relationship Relatie - + + Policy + + + + Textbox Tekst box - + Permission Machtiging - + Parameter Parameter - + Type Attribute Type Attribuut - + Tag Tag - + Basic Relationship Basisrelatie + + + Generic SQL + + - + new_object nieuw_object @@ -803,17 +644,13 @@ BaseObjectView - + SQL off SQL uit BaseObjectWidget - - Form - Venster - Name: @@ -825,114 +662,119 @@ Commentaar: - + Tablespace: Tablespace: - + Schema: Schema: - + Edit object's permissions Machtiginen voor dit object aanpassen - + Edit permissions Machtigingen aanpassen - + This object is protected thus no change in form will be applied to it. Dit object is beschermd en dus worden vorm-aanpassingen niet toegepast. - + Disables the generated SQL code using comment tokens (--). This will disable the code of all child and referrer objects. Maakt de gegenereerde SQL code onuitvoerbaar via comment-tokens (--). Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten wordt uitgeschakeld. - + Disable SQL code Niet-uitvoerbare SQL code - + Collation: Sortering: - + Append or prepend a set of SQL commands to the object's definition. Voeg SQL commando toe voor of na de definitie van het object. - + Custom SQL Aangepaste SQL - + Owner: Eigenaar: - + ID: ID: - + icone icone - Create / Edit: - Creëer / Pas aan: - - - + Required field. Leaving this empty will raise errors! Vereist veld. Dit veld leeglaten leidt tot foutmeldingen! - + Value(s) Waarde(s) - + Version Versie - + The <em style='color: %1'><strong>highlighted</strong></em> fields in the form or one of their values are available only on specific PostgreSQL versions. Generating SQL code for versions other than those specified in the fields' tooltips may create incompatible code. - - The <em style='color: %1'><strong>highlighted</strong></em> fields on the form are available only on specific PostgreSQL versions. When generating SQL code for versions other than those specified on fields' tooltips pgModeler will ignore their values. - De <em style='color: %1'><strong>aangeduidde</strong></em> velden zijn enkel beschikbaar in specifieke versies van PostgreSQL. Wanneer SQL code voor andere versies wordt gegenereerd zal pgModeler deze negeren. - BaseRelationship - + rel_%1_%2 rel_%1_%2 - BugReportForm + BaseTableView - - Bug Report + + Toggles the extended attributes display + + + + + Connected rels: %1 + Verbonden relaties: %1 + + + + BugReportForm + + + Bug Report Bug Rapport @@ -991,10 +833,6 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w Database Model Database Model - - In none occasion the models sent within the report will be published. They are kept safe and are used only for debug purpose. - Database modellen die u ons opstuurt worden onder geen enkel beding gepubliceerd. Deze worden op een veilige manier bewaard door de ontwikkelaars en worden enkel geraadpleegd voor debugging doeleinden. - Attach the below database model file to be debugged. @@ -1027,15 +865,15 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w - CastWidget - - Form - Venster - + BulkDataEditWidget - Implicit - Impliciet + + Bulk data edit + + + + CastWidget I&mplicit @@ -1066,10 +904,6 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w E&xplicit - - Explicit - Expliciet - Source data type @@ -1086,62 +920,31 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w De functie die wordt gebruikt bij den cast van <em><strong>typeA</strong></em> naar <em><strong>typeB</strong></em> moet de volgende signature hebben:: <em><strong>typeB</strong> functie(<strong>typeA</strong>, integer, boolean)</em>. - - CentralWidget - - Form - Venster - - - New model - Nieuw model - - - Open model - Open model - - - Sample models - Voorbeeldmodellen - - - Recent models - Recente modellen - - - Last session - Vorige sessie - - CodeCompletionWidget - - Make persistent - Maakt blijvend + + Make &persistent + - + Makes the widget closable only by ESC key or mouse click on other controls. Zorgt ervoor dat widgets enkel kunnen worden gesloten via de ESC toets of via een muisklik op andere controls. - + SQL Keyword SQL Sleutelwoord - + (no items found.) (geen items gevonden.) CollationWidget - - Form - Venster - Locale: @@ -1199,41 +1002,40 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w ColumnWidget - - Form - Venster - Default Value: Standaardwaarde: - - E&xpression: + + Edit the underlying sequence's attributes - - &NOT NULL + + Edit sequence - - Se&quence: + + Identity: - Expression: - Expressie: + + E&xpression: + - NOT NULL - NOT NULL + + &NOT NULL + - Sequence: - Sequentie: + + Se&quence: + @@ -1254,42 +1056,52 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w Relaties - + Appearance Voorkomen - + Connections Verbindingen - + Snippets Snippets - + Plug-ins Plug-ins - + Defaults Standaard waarden - + &Apply &Toepassen - + &Cancel &Annuleren + In some cases restore the default settings related to it may solve the problem. Would like to do that? + + + + + Restore + + + + Any modification made until now in the current section will be lost! Do you really want to restore default settings? De waarden in de huidige sectie zullen worden overschreven! Bent u er zeker van dat u de standaard waarden wilt instellen? @@ -1297,129 +1109,117 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w ConnectionsConfigWidget - Form - Venster - - - + Password: Wachtwoord: - + Connection Alias: Verbindingsalias: - + Connection DB: Verbinding DB: - + Host/Port: Host/Poort: - + User: Gebruiker: - + Timeout: Timeout: - + SSL Mode: SSL Modus: - + Disable Uit - + Diff Diff - + Export Exporteer - + Import Importeren - + Validation - + Security - + Allow Toegelaten - + Require Vereist - + AC verification AC verificatie - + Full verification Volledige verificatie - + Kerberos Server: - + Client Certificate: Client Certificaat: - + Revoked Certs.: Herroepen Certs: - + Client Key: Client Sleutel: - + Root Certificate: Root Certificaat: - Options: - Opties: - - - Kerberus Server: - Kerberos Server: - - - + ~/.postgresql/root.crt @@ -1429,42 +1229,42 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w Verbindingen: - + second(s) Second(en) - + Force GSSAPI Forceer GSSAPI - + ~/.postgresql/postgresql.crt - + Add Toevoegen - + Update Updaten - + Test Test - + ~/.postgresql/root.crl - + ~/.postgresql/postgresql.key @@ -1475,7 +1275,7 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w - + Edit database connections @@ -1505,27 +1305,27 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w Algemeen - + Other params: - + Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. - + Default for: - + Automatically browses the named database when using this connection to manage databases on <strong>Manage</strong> view. Bladert automatisch door de genoemde database wanneer deze verbinding wordt gebruikt om databases te beheren via de <strong>Beheer</strong> view. - + Auto browse @@ -1535,54 +1335,44 @@ Dit zorgt ervoor dat de code voor alle kinder-objecten en refererende objecten w - + Success Success - - Connection successfuly stablished! + + Connection successfully established! Server details: PID: `%1' Protocol: `%2' Version: `%3' - De verebinding werd aangemaakt! - -Details Server: - -PID: `%1' -Protocol: `%2' -Versie: `%3' + - + There is a connection being created or edited! Do you want to save it? Wenst u de nieuwe of aan te passen verbinding op te slaan vooraleer verder te gaan? - + Found %1 connection(s) %1 verbinding(en) gevonden - + No connections found Geen verbindingen gevonden - + Edit connections ConstraintWidget - - Form - Venster - Match: @@ -1665,29 +1455,25 @@ Versie: `%3' Vul-factor: - - + + Column Kolom - - + + Type Type - + Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they can raise errors. To create primary key using columns included by relationship use the following options: identifier field, attributes & constraints tab or primary key tab on the relationship form. Kolommen die werden ingesloten via relaties kunnen niet manueel worden toegevoegd aan of verwijderd uit de primaire sleutel. Dit soort aanpassingen kan tot fouten leiden. Om een primaire sleutel aan te maken via kolommen die werden ingesloten door relaties, gebruik de volgende opties: identifier veld, attributen & constraints tab-blad of primaire sleutel tab=blad in het relatie-venster. ConversionWidget - - Form - Venster - Source Encoding: @@ -1717,77 +1503,171 @@ Versie: `%3' CrashHandlerForm - + Crash Handler Crash Handler - + Stack trace Stack trace - + Input: Invoer: - + Load report file for analysis Laad rapport bestand voor analyze - + Save the attached model file on the filesystem Bewaar het ingevoegde model bestaand op het bestandssysteem - + pgModeler bug report (*.bug);;All files (*.*) pgModeler bug rapport (*.bug);;Alle bestanden (*.*) - + Load report Laad rapport - + Save model Bewaar model - + Database model (*.dbm);;All files (*.*) Database model (*.dbm);;Alle bestanden (*.*) - + Crash handler Crash Handler - + Bug report analysis mode activated. Bug rapport analyze modus is geactiveerd. - + Oops! pgModeler just crashed! Oeps! pgModeler crashte! - + We apologize for what happened! It is clear that a nasty bug caused that. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. We verontschuldigen ons voor wat net gebeurde! Het is overduidelijk dat een ernstige bug dit veroorzaakte. Gelieve het formuleer hieronder in te vullen met een beschrijving van wat u deed vooraleer pgModeler onverwachts afsloot. Dit zal ons helpen om deze bug te corrigeren en de software te verbeteren. - CustomSQLWidget + CsvLoadWidget + Form - Venster + Venster + + + + Load CSV + + + + + CSV File: + + + + + Select output file + Selecteer uitvoerbestand + + + + ... + ... + + + + Separator: + + + + + Use the first row as column names in the CSV file. By unchecking this option the first row is used as data. + + + + + Columns in the first row + + + + + Load + Laden + + + + Semicolon (;) + + + + + Comma (,) + + + + + Space + Spatie + + + + Tabulation + + + + + Other + + + + + ; + + + + + Text delimiter: + + + + + " + + + + + Load CSV file + + + + + Comma-separted values (*.csv);;All files (*.*) + + + + CustomSQLWidget Add custom SQL code @@ -1877,56 +1757,47 @@ Deze optie afvinken zorgt ervoor dat de SQL wordt ingevoegd na het CREATE DATABA <html><head/><body><p>Wees voorzichtig bij het gebruik van aangepaste SQL. Dit kan leiden tot een verandering van de betekenis van het volledige model wanneer SQL validatie wordt uigevoerd of wanneer het model wordt geëxporteerd. Het is ook mogelijk, afhankelijk van de hoeveelheid commando's, dat de prestaties van deze processen voelbaar en negatief kunnen worden beïnvloed.</p></body></html> - Append / Prepend SQL code - Voeg SQL code voor/na - - - - Type: - Type: - - - + Generic INSERT Generische INSERT - + Include serial columns Sluit seriële kolommen in - + Exclude serial columns Sluit seriële kolommen uit - + Generic SELECT Generische SELECT - + Table SELECT Tabel SELECT - + Generic UPDATE Generische UPDATE - + Table UPDATE Tabel UPDATE - + Generic DELETE Generische DELETE - + Table DELETE Tabel DELETE @@ -1944,339 +1815,348 @@ Deze optie afvinken zorgt ervoor dat de SQL wordt ingevoegd na het CREATE DATABA &Sluiten - Rows returned: - Aantal rijen: - - - 0 - 0 - - - Maximum limit of listed rows - Maximum limit van weergegeven rijen - - - (Limit: 0) - (Limiet: 0) - - - Empty values are assumed as <strong>DEFAULT</strong>. To use special values like <strong>NULL</strong>, a function call like <strong>now()</strong> or a specific data escaping, enclose values in <strong>&lt;&gt;</strong>. To use <strong>&lt;</strong> or <strong>&gt;</strong> as part of the value prepend the backslash character, e.g., <strong>\&lt;</strong> or <strong>\&gt;</strong>. - Een lege waarde wordt verondersteld <strong>DEFAULT</strong> te zijn. Om speciale waarden zoals <strong>NULL</strong>, een functie-aanroep zoals <strong>now()</strong> of een specifieke data-escaping te gebruiken, sluit deze waarden in tussen<strong>&lt;&gt;</strong>. Om <strong>&lt;</strong> of <strong>&gt;</strong> te gebruiken als deel van een waarde, voeg een backslash toe voor de waarde, bv., <strong>\&lt;</strong> of <strong>\&gt;</strong>. - - - + Refresh listing De lijst wordt vernieuwd - - Refresh - Vernieuwen - - - + F5 F5 - + Save changes Aanpassingen opslaan - - Save - Opslaan - - - + Ctrl+S Ctrl+S - - Copy the selection as CSV buffer - Kopieer de selectie als CSV buffer - - - - Copy - Kopieer - - - - Ctrl+C - Ctrl+C - - - + Export results to CSV file Exporteer de resultaten naar een CSV bestand - - Export - Exporteer - - - + Ctrl+X Ctrl+X - + Undo modifications Aanpassingen ongedaan maken - - Undo - Ongedaan maken - - - + Ctrl+Z Ctrl+Z - Add data - Data toevoegen - - - - Add - Toevoegen - - - - + + Ins Ins - + Mark the selected rows to be deleted Markeer de geselecteerde rij als 'te verwijderen' - - - Delete - Verwijderen - - - - - - - + + + + + Del Del - + Duplicate the selected rows - - Duplicate + + Ctrl+D - - Ctrl+D + + Add new rows from a CSV file - + Filter the result set Filter de resultaten - + Table: Tabel: - + Schema: Schema: - + in in - + Hide views Verberg views - + Filter expression Filterexpressie - + Order && Limit Sortering && Limiet - + results (Use <strong>0</strong> for no limit) - + Column: Kolom: - - ASC - ASC + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> + + Copy items on the grid - - Add empty rows + + Paste items on the grid - - DESC - DESC + + Ctrl+V + Ctrl+V - - Limit in: - Limiet in: + + Browse referenced tables + + + + + Change the values of all selected cells at once + + + + + Ctrl+E + Ctrl+E + + + + ASC + ASC - 000000 - 000000 + + Add empty rows + - 100 - 100 + + DESC + DESC - results - resultaten + + Limit in: + Limiet in: - + Add Item Item Toevoegen - + Remove Item Item Verwijderen - + Clear the order by columns list Maak de sorterings-kolomlijst leeg - + Move selected item up Verplaats het geselecteerde item naar boven - + Move selected item down Verplaats het geselecteerde item naar beneden - - <strong>WARNING: </strong> There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now? + + Copy as CSV - - Rows returned: <strong>%1</strong>&nbsp;&nbsp;&nbsp; + + Copy as text - - <em>(Limit: <strong>%1</strong>)</em> - <em>(Limiet: <strong>%1</strong>)</em> + + Copy items + - - none + + Pase items - - No objects found - Geen objecten gevonden + + Browse tables + - - Found %1 object(s) - %1 object(en) gevonden + + Duplicate row(s) + - - Views can't have their data handled through this grid, this way, all operations are disabled. + + Delete row(s) + + + + + Edit cell(s) + + + + + <strong>WARNING: </strong> There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now? + + + + + Rows returned: <strong>%1</strong>&nbsp;&nbsp;&nbsp; + + + + + <em>(Limit: <strong>%1</strong>)</em> + <em>(Limiet: <strong>%1</strong>)</em> + + + + none + + + + + Column + Kolom + + + + No objects found + Geen objecten gevonden + + + + Found %1 object(s) + %1 object(en) gevonden + + + + Views can't have their data handled through this grid, this way, all operations are disabled. Data van views kan niet worden aangepast via dit raster, alle operaties zijn uitgeschakeld. - + The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. <strong>WARNING:</strong> those operations can affect more than one row. De geselecteerde tabel bevat geen primary key! Update en delete commando's worden uitgevoerd door alle kolommen als primary key te beschouwen. <strong>OPGEPAST</strong> deze acties kunnen meer dan één rij beïnvloeden. - + + Referenced tables + + + + + + (none) + + + + + Referrer tables + + + + This row is marked to be %1 Deze rij is als %1 gemarkeerd. - + deleted verwijderd - + updated aangepast - + inserted ingevoegd - + [binary data] [binaire data] - + <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving? <strong>OPGEPAST: </strong> Eens toegepast is het niet langer mogelijk om aanpassingen ongedaan te maken! Bent u zeker dat u wilt opslaan? - + delete delete - + update update - + insert insert @@ -2289,1030 +2169,1178 @@ Deze optie afvinken zorgt ervoor dat de SQL wordt ingevoegd na het CREATE DATABA Venster - - Toggles the display of system objects. - Schakelt de weergave van systeemobjecten in of uit. - - - - System - Systeem - - - - Toggles the display of extension objects - Schakelt de weergave van uitbreidingsobjecten in of uit - - - - Extension - Uitbreiding - - - Open the grid to visualize or edit data. - Open het raster om data te visualiseren of aan te passen. - - - + + Data &Grid Data &Grid - + + Alt+G Alt+G - Open a new SQL execution pane. - Open een nieuw SQL uitvoerpaneel. - - - - - - - + + + + + ... ... - Ctrl+F5 - Ctrl+F5 - - - Update the objects tree. - Verfrish de objectenstructuur. - - - + Open the grid to visualize or edit data - + Open a new SQL execution pane - + Ctrl+F6 Ctrl+F6 - + Update the objects tree - - Ctrl+S - Ctrl+S + + Toggle the display of filter widget as well the system/extension objects. + - + + Sort items alphabetically. When unchecked, items are sorted by OID. + + + + + Sort alphabetically + + + + Drop this database Verwijder deze database - + Expands all items Alle items uitklappen - + Collapses all items Alle items inklappen - + Filters the currently loaded items in the tree by using a pattern and matching their names. If <strong>By OID</strong> is checked the pattern is interpreted as an integer value that represents the object id (OID). <br><br/><strong>HINT:</strong> if you need to search the entire database use the full refresh (<strong>Ctrl+F5</strong>) prior the filtering. - + Filter: Filter: - + By OID Per OID - - + + Attribute Attribuut - + Value Waarde - + Show raw attributes - Show raw attributes names - Toon onbewerkte attribuutnamen - - - + (not found, OID: %1) (niet gevonden, OID: %1) - + -- Source code not generated! Hit F7 or middle-click the item to load it. -- - + Admin. roles Admin. rollen - + Alignment Uitlijning - + Analyze func. Analyzeer func. - + Arg. count Aantal Argumenten - + Arg. default count Standaard aantal argument - + Arg. defaults Standaardargumenten - + Arg. modes Argumentenmodus - + Arg. names Argumentennamen - + Arg. types Argumententypes - + Behavior type Gedragstype - + By value Per waarde - + Cast type Cast type - + Category Categorie - + Collatable Sorteerbaar - + Collation Sortering - + Comment Commentaar - + Commutator Op. Commutator Op. - + Configuration Configuratie - + Conn. limit Verbindingslimiet - - + + Constraint Constraint - + Create DB Maak DB aan - + Create role Maak rol aan - + Curr. version Huidige versie - + Default Standaard - + Default value Standaardwaarde - + Definition Definitie - + Delimiter Delimiter - + Dest. type Doeltype - + Dimension Dimensie - + Directory Map - + Dest. encoding Doelcodering - + Element Element - + Encoding Codering - + Encrypted Geëncrypteerd - + Enumerations Enumeraties - + Exec. cost Uitvoeringskost - + Expression Expressie - + Op. family Operator Familie - + Final func. Finale functie - + Function Functie - + Func. type Functietype - + Handler func. Behandelende Functie - + Handles type Behandelt type - + Hashes Hashes - + Index type Indextype - + Inherit Erft over - + Ini. condition Initiële Vereiste: - + Inline func. Inline Functie - + Input func. Invoerfunctie - + Internal length Interne lengte - + Interval type Intervalstype - + I/O cast I/O cast - + Join func. Join func. - + Language Taal - + LC COLLATE LC COLLATE - + LC CTYPE LC CTYPE - + Leak proof Lekdicht - + Left type Linkse type - + Length Lengte - + Library Bibliotheek - + Can login Kan inloggen - + Materialized Gematerialiseerd - + Member roles Lid-rollen - + Merges Samenvoegingen - + Name Naam - + Negator op. Negator op. - + Not null Niet null - + Object type Objecttype - + OID OID - + With OIDs Met OIDs - + Old version Oude versie - + Operator Operator - + Operator func. Operator functie - + Output func. Uitvoerfunctie - + Owner Eigenaar - + Owner column Bezittende kolom - + Parents Ouders - + Password Wachtwoord - + Permissions Machtigingen - + Precision Precisie - + Preferred Voorkeur - + Range attributes Omvangsattributen - + Receive func. Ontvangersfunctie - + Ref. roles Ref. rollen - + Replication Replicatie - + Restriction func. Belemmeringsfunctie - + Return type Resultaatstype - + Returns SETOF Geeft SETOF terug - + Right type Rechtse type - + Rows amount Aantal rijen - + Schema Schema - + Security type Beveiligingstype - + Send func. Zendfunctie - + Sort op. Sorteeroperato - + Source type Brontype - + Src. encoding Broncodering - + State type Statustype - + Storage Opslag - + Superuser Superuser - + Tablespace Tablespace - + Type mod. in func. Type mod. in functie - + Type mod. out func. Type mod. buiten functie - + Transition func. Transitiefunctie - + Trusted Vertrouwd - + Type Type - + Type attribute Typeattribuut - + Types Types - + Unlogged Niet gelogged - + Validator func. Validatiefunctie - + Validity Geldigheid - + Windows func. Windowing func. - + false onwaar - + true waar - + Cache value Cachewaarde - + Cycle Cyclus - + Increment Toename - + Max. value Max. waarde - + Min. value Min. waarde - + Start value Startwaarde - + Last value Laatste waarde - + Subtype Subtype - + Op. class Op. klasse - + Canonical func. Canonische func. - + Subtype diff func. Subtype diff func. - + Deferrable Uitstelbaar - + For each row Voor elke rij - + Firing Afvuring - + On insert Bij insert - - + + On delete Bij delete - - + + On update Bij update - + On truncate Bij truncate - + Arguments Argumenten - + Table Tabel - + Trigger func. Trigger func. - - - + + + Columns Kolommen - + Condition Voorwaarde - + Deferment Uitstel - + Event Event - + Execution mode Uitvoeringsmodus - + Commands Commando's - + Position Positie - + Comparison type Vergelijkingstype - + Ref. columns Ref. columns - + Expressions Expressies - + Fill factor Vulfactor - + No inherit Geen overerving - + Op. classes Op. klasses - + Operators Operators - + Ref. table Ref. tabel - + Unique Uniek - + Predicate Predicaat - + Collations Sorteringen - + Inherited Overgeërfd - + + Client encoding + + + + + Configuration file + + + + + Data directory + + + + + Dynamic library path + + + + + Dynamic shared memory + + + + + Hba file + + + + + Listen addresses + + + + + Max. connections + + + + + Listen port + + + + + Server encoding + + + + + SSL + + + + + SSL ca file + + + + + SSL cert file + + + + + SSL crl file + + + + + SSL key file + + + + + Server version + + + + + Ident file + + + + + Password encryption + + + + + Connection ID + + + + + Server PID + + + + + Server protocol + + + + + Referrers + + + + + Identity + + + + + Command + + + + + USING expr. + + + + + CHECK expr. + + + + + Roles + Rollen + + + + RLS enabled + + + + + RLS forced + + + + + Show objects filter + + + + + Show system objects + + + + + Show extension objects + + + + Snippets Snippets - + Drop object Verwijder object - + Drop cascade Verwijder cascade - + Truncate Truncate - + Trunc. cascade Trunc. cascade - + Show data Toon data - + Reload properties Eigenschappen herladen - + Update Updaten - + Rename Hernoem - + Source code Broncode - + Quick refresh - + Full refresh - + + -- Source code unavailable for this kind of object -- + + + + Do you really want to drop the object <strong>%1</strong> <em>(%2)</em>? Bent u zeker dat u het object <strong>%1</strong> <em>%2</em> wilt verwijderen? - + Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it. Bent u er zeker van dat u het object &lt;strong&gt;%1&lt;/strong&gt; &lt;em&gt;(%2)&lt;/em&gt; via &lt;strong&gt;cascade&lt;/strong&gt; wilt verwijderen? Deze actie verwijdert ook alle objecten die afhankelijk zijn van dit object. - + Do you really want to truncate the table <strong>%1</strong>? Bent u zeker dat u de tabel <strong>%1</strong> wil truncaten? - + Do you really want to <strong>cascade</strong> truncate the table <strong>%1</strong>? This action will truncate all the tables that depends on it? Bent u er zeker van dat u de tabel <strong>%1</strong> <em>(%2)</em> via <strong>cascade</strong> wilt verwijderen? Deze actie verwijdert ook alle tabellen die afhankelijk zijn van deze tabel. - + + Also restart sequences + + + + Src. table: %1 Src. column(s): %2 - + Ref. table: %1 Ref. column(s): %2 - + -- Source code genaration for buil-in and base types currently unavailable -- - + -- Source code unavailable for the object %1 (%2). -- - - - DatabaseImportForm - - Database Import - Database Import + + + Warning + Opgepast - - Database import - Database import + + You're running a demonstration version! The data manipulation feature is available only in the full version! + Dit is een demonstratie-versie. De data manipulatie functionaliteit is enkel beschikbaar in de volledige versie! + + + <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? + <strong>PAS OP:</strong> U staat op het punt om de volledige database <strong>%1</strong> te verwijderen! Alle data zal verloren gaan. Bent u zeker dat u verder wilt gaan? + + + + DatabaseImportForm Settings @@ -3329,249 +3357,211 @@ Ref. column(s): %2 Verbinding: - - Origin point: - Oorsprongspunt: - - - - Starting point where objects will be put. - Startpunt waar objecten zullen worden neergezet. - - - - Tables per row: - Tabellen per rij: - - - - Tables per row - Tabellen per rij - - - - Spacing: - Spatiëring: - - - - Spacing between objects - Spatiëring tussen objecten - - - - Schemas per row: - Schemas per rij: - - - + Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. - + Automatically resolve dependencies Los afhankelijkheden automatisch op - + Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. Om de identificatie van de links tussen tabellen in grote modellen makkelijker te maken zullen willekeurige kleuren worden gebruikt om de geïmporteerde relaties aan te duiden. - + Random colors for relationships Willekeurige kleuren voor relaties - + Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. Activeert het importeren van ingebouwde systeemobjecten. Het is aangeraden om enkel objecten te importeren waarnaar onmiddellijk worden gerefereerd. PAS OP: grote hoeveelheden systeemobjecten importeren kan leiden tot een opgezwollen resultaatsmodel of kan zelfs pgModeler tot een crash leiden omwillen van geheugen- of processor-uitputting. - + + + Import database + + + + Import system objects Importeer systeemobjecten - + Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. Activeert het importeren van objecten die werden aangemaakt door uitbreidingen. Algemeen gezien is er geen nood om deze optie aan te vinken tenzij er objecten in de databse leven die onmiddellijk naar objecten van deze categorie refereren. - + Import extension objects Importeer uitbreidingsobjecten - + pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. pgModeler negeert importeerfouten en zal pogen om zoveel mogelijk objecten aan te maken. Door deze optie aan te vinken zal de importeer-taak niet afbreken bij een fout maar zal een onvolledig model worden aangemaakt. Deze optie creëert een log bestand in de tijdelijke map voor pgModeler. - + Ignore import errors Negeer importeerfouten - - Schemas per row - Schemas per rij - - - Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types and extensions. - Los sommige afhankelijkheden van objecten op door de catalogus raad te plegen wanneer een object niet in de geladen set bestaat. In sommige gevallen is het nodig om deze optie met andere opties te combineren. Deze optie is niet van toepassing op database-niveau objecten zoals rollen, tablespaces en talen alsook data types en uitbreidingen. - - - + All catalog queries as well the created objects' source code are printed to standard output (stdout). Alle catalogusqueries plus the broncode van de aangemaakte objecten wordt naar de standaard output (stdout) geprint. - + Debug mode Debugmodus - + Create all imported objects in the current working model instead of create a new one. Maak alle geïmporteerde objecten aan in het huidige model en maak geen nieuw model aan. - + Import objects to the working model Importeer de objecten in het huidige model - + Database Database - + Filter: Filter: - + Filter object by it's OID Filter objecten per hun OID - + By OID Per OID - + Select all objects Selecteer alle objecten - - - - + + + + ... ... - + Clear object selection Maak de objectselectie ongedaan - + Expands all items Alle items uitklappen - + Collapses all items Alle items inklappen - + Output Uitvoer - + Progress label... Vooruitgangslabel... - + Cancel Annuleren - + &Import - + &Close &Sluiten - + <strong>ATTENTION:</strong> You are about to import objects to the current working model! This action will cause irreversible changes to it even in case of critical errors during the process. Do you want to proceed? <strong>OPGEPAST:</strong> U staat op het punt om objecten te importeren in het huidige model! Deze actie zal onherroepbare verandering teweegbrengen, zelfs wanneer kritische problemen opduiken gedurende dit proces. Bent u zeker dat u verder wilt gaan? - + Importing process aborted! Het import proces werd afgebroken! - + Importing process canceled by user! Het import proces werd geannuleerd door de gebruiker! - + Importing process sucessfuly ended! Het import proces werd succesvol beëindigt! - + No databases found Er werd database gevonden - + Found %1 database(s) Er werd(en) %1 database(s) gevonden - + Retrieving objects from database... De objecten worden van de database opgehaald... - + Retrieving cluster level objects... De objecten op cluster-niveau worden opgehaald... - + Retrieving objects of schema `%1'... De objecten uit schema `%1' worden opgehaald... - - Retrieving objects of table `%1'... - De objecten van tabel `%1' worden opgehaald... + + Retrieving objects of `%1' (%2)... + - + This is a PostgreSQL built-in data type and cannot be imported. Dit is een ingebouwd type van PostgreSQL en kan niet worden geïmporteerd. - + This is a pgModeler's built-in object. It will be ignored if checked by user. Dit is een ingebouwd object van pgModeler. Dit object wordt genegeerd indien aangevinkt door de gebruiker. @@ -3590,58 +3580,62 @@ Ref. column(s): %2 Objecten ophalen... `%1' - - - Creating object `%1' (%2)... - Object aanmaken `%1' (%2)... + + Creating object `%1' (%2), oid `%3'... + - - Trying to recreate object `%1' (%2)... - Object `%1' proberen aan te maken (%2)... + + Trying to recreate object `%1' (%2), oid `%3'... + - + + Creating object `%1' (%2)... + Object aanmaken `%1' (%2)... + + + Import failed to recreate some objects in `%1' tries. Het importeren faalde na `%1' pogingen om sommige objecten te her-creëeren. - + Creating permissions for object `%1' (%2)... Machtigingen aanmaken voor object `%1' (%2)... - + Creating columns permissions... Kolommachtigingen aanmaken... - + Updating relationships of `%1' (%2)... Updaten van de relaties voor `%1' (%2)... - + Validating relationships... - + The database import ended but some errors were generated and saved into the log file `%1'. This file will last until pgModeler quit. Het importeren van de database is voltooid maar er werden enkele fouten gegenereerd, deze werden opgeslagen in het log-bestand `%1'. Dit bestand zal worden verwijderd wanneer u pgModeler afsluit. - + Destroying unused detached columns... De vrijstaande kolommen worden verwijderd... - + Assigning sequences to columns... - + Creating table inheritances... Tabel-overervingen worden aangemaakt... @@ -3649,135 +3643,146 @@ Ref. column(s): %2 DatabaseModel - + The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2' U kan slechts `%1' instancies per object type aanmaken in demonstratie-versies! U heeft deze limiet bereikt voor het type `%2' - + Loading: `%1' (%2) Bezig met laden: `%1' (%2) - - + + Validating relationships... - - Generating %1 of the object `%2' (%3) - Genereren van %1 van het type `%2' (%3) + + Generating %1 code: `%2' (%3) + - + Saving object `%1' (%2) - + Saving metadata of the object `%1' (%2) - + Metadata file successfully saved! - + Process successfully ended but no metadata was saved! - + Creating object `%1' (%2) Object `%1' (%2) wordt aangemaakt. - + Object `%1' (%2) already exists. Ignoring. - + Loading metadata for object `%1' (%2) - + Object `%1' (%2) not found. Ignoring metadata. - + Metadata file successfully loaded! DatabaseWidget - - Form - Venster - Attributes Attributen - + LC_COLLATE: - + LC_CTYPE: - + Template DB: Sjabloon DB: - + Model Author: Modelauteur: - + Encoding: Codering: - + Connections: Verbindingen: - + + Options: + Opties: + + + + Allow connections + + + + + Is template + + + + Default Objects Standaardobjecten - + Tablespace: Tablespace: - + Schema: Schema: - + Collation: Sortering: - + Owner: Eigenaar: @@ -3794,8 +3799,8 @@ Ref. column(s): %2 - - + + Default Standaard @@ -3803,33 +3808,44 @@ Ref. column(s): %2 DomainWidget - Form - Venster + + Attributes + Attributen - + Default Value: Standaardwaarde: - - Constraint - Constraint + + Not null + Niet null + + + + Check constraints + - + + Expression: + Expressie: + + + Name: Naam: - - Not Null: - Not Null: + + Name + Naam - - Check Expr.: - Check Expressie: + + Expression + Expressie @@ -3860,7 +3876,7 @@ Ref. column(s): %2 <html><head/><body><p>pgModeler komt tot stand dankzij <span style=" font-style:italic;">een grote inzet om een kwaliteitsvol product te bezorgen</span>. Dit project heeft een niveau van volwassenheid bereikt die nooit was voorzien. Dit alles is het resultaat van de samenwerken tussen de auteur(s) en de <span style=" font-weight:600;">Open Source gemeenschap</span>. <br/><br/>Dit product heeft nog een lange weg af te leggen; met uw hulp kunnen we deze uitdaging aan en kunnen we nieuwe verbeteringen en toevoegingen aan dit product blijven publiceren bij elke release. Als u vertrouwd op pgMOdeler en denkt dat u kan bijdragen, gelieve dan een donatie te maken aan pgModeler!</p></body></html> - + I want to help! Ik wil helpen! @@ -3873,47 +3889,47 @@ Ref. column(s): %2 Venster - + Column: Kolom: - + Expression: Expressie: - + Collation: Sortering: - + Operator Class: Operator Klasse: - + Operator: Operator: - + Sorting: Sortering: - + Ascending Stijgend - + Descending Afdalend - + Nulls first Nulls eerst @@ -3943,37 +3959,33 @@ Ref. column(s): %2 Nulls eerst - + Collation Sortering - + Operator Operator - + Expression Expressie - + Yes Ja - + No Nee EventTriggerWidget - - Form - Venster - Event: @@ -4009,725 +4021,791 @@ Ref. column(s): %2 - Zero length assignment! - Toewijzing van een waarde met lengte nul! - - - Assignment of a precision greater than the length of the type! Toewijzing van een waarde met grotere precisie dan de toegewezen locatie! - + Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6! Toewijzing van een ongeldige precisie aan het type time, timestamp of interval. De precisie moet in dit geval kleiner dan of gelijk zijn aan 6! - + Assignment of a not allocated column to object `%1' (%2)! Toewijzing van een niet-gealloceerde kolom aan het object `%1' (%2)! - + Reference to a column which index is out of the capacity of the column list! Referentie naar een kolom wiens index buiten de capaciteit van de kolomlijst ligt! - + Assignment of not allocated object! Toewijzing van een niet-gealloceerd object! - + Assignment of a not allocated schema to object `%1' (%2)! Toewijzing van een niet-gealloceerde schema aan het object `%1' (%2)! - + The object `%1' (%2) has inconsistent SQL or XML definition! het object `%1' (%2) heeft een inconsistente SQL of XML definitie! - + The object `%1' (%2) already exists on `%3' (%4)! Het object `%1' (%2) bestaat reeds op `%3' (%4)! - + The object `%1' (%2) cannot be assigned because there is already exists in the container object `%3'! Het object `%1' (%2) kan niet worden toegewezen omdat het reeds bestaat in het container-object `%3'! - + Assigning object of an invalid type! Toewijzing van een object van een ongeldig type! - + Removing an object of an invalid type! Verwijdering van een object van een ongeldig type! - + Obtaining an object of an invalid type! Het verkregen object is van een ongeldig type! - + Assignment of empty name to table return type! Toewijzing van een lege naam aan een tabel-terugkeertype! - + The insertion of the parameter `%1' will not be possible because there is another parameter with same name in the function `%2'! Het toevoegen van parameter `%1' is niet mogelijk omdat de functie `%2' reeds een parameter met deze naam bevat! - + The insertion of the table return type `%1' will not be possible because there is another return type with the same name in the `%2'! Het invoegen van tabel-terugkeertype `%1' is niet mogelijk omdat er reeds een terugkeer-type met deze naam bestaat in `%2'! - + Reference to a parameter which index is out of the parameter list bounds! Een referentie naar een parameter met een index die buiten de limieten ligt van de parameterlijst! - + Reference to an event which does not belongs to trigger! Een referentie naar een event die niet tot de trigger behoort! - + The column `%1' cannot be assigned to the trigger `%2' because they belongs to different parent tables! De kolom `%1' kan niet toegewezen worden aan de trigger `%2' omdat deze tot verschillende ouder-tabellen behoren! - + Assignment of a not allocated function to object `%1' (%2)! Toewijzing van een niet-gealloceerde functie aan het object `%1' (%2)! - + Assignment of a function which return type is different from `%1'! Toewijzing van een functie waarvan het terugkeertype verschilt van `%1'! - + Assignment of a function which parameter count is invalid to the object `%1' (%2)! Toewijzing van een functie waarvan het aantal parameters ongeldig is voor het object `%1' (%2)! - + Assignment of a function which language is invalid! Toewijzing van een functie waarvan de taal ongeldig is! - + Event trigger function must be coded in any language other than SQL! Event triggerfunctie moet geschreven zijn in een taal die verschilt van SQL! - + Assignment of not allocated table to object `%1' (%2)! Toewijzing van een niet-gealloceerde tabel aan object `%1' (%2)! - + Reference to an argument which index is out of argument list bounds! Referentie naar een argument met een index die buiten de limieten ligt van de argumentenlijst! - + Assignment of empty name to an object! Toewijzing van een lege naam aan een object! - + Assignment of a name which contains invalid characters! Toewijzen van een naam die ongeldige karakters bevat! - + Assignment of a name which length exceeds the maximum of 63 characters! Toewijzing van een naam die de maximumlengte van 63 karakters overtreed! - + Assignment of schema object which type is invalid! Toewijzing van een schemaobject wiens type ongeldig is! - + Assignment of tablespace object with invalid type! Toewijzing van een tablespaceobject met een ongeldig type! - + Assignment of tablespace to an invalid object! Toewijzing van een tablespace aan een ongeldig object! - + Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique! Toewijzing van een tablespace aan een constraint wiens type ongeldig is! Om tot een tablespace te behoren moet een constraint een primary key of een unieke sleutel zijn! - + Assignment of owner object which type is invalid! Toewijzing van een eigenaarsobject wiens type ongeldig is! - + Assignment of owner to an invalid object! Toewijzing van een eigenaar aan een ongeldig object! - + Assignment of appended or prepended SQL to an invalid object! Toewijzing van toegevoegde of voorgevoegde SQL aan een ongeldig object! - + Reference to a function with invalid type! Referentie naar een functie met een ongeldig type! - + Reference to an argument of the operator with invalid type! Referentie naar een argument van de operator met een ongeldig type! - + Reference to an operator with invalid type! Referentie naar een operator met een ongeldig type! - + Assignment of value to an invalid option type on role! Toewijzing van een waarde aan een ongeldig optietype van een rol! - + Reference to an invalid role type! Referentie naar een ongeldig rol-type! - + The insertion of the role `%1' is not possible because this is already being referenced by role `%2'! Het invoegen van de rol `%1' is onmogelijk omdat deze reeds wordt gerefereerd door rol `%2'! - + Reference redundancy detected by having the role `%1' referencing the role `%2'! Referentieredundantie gedetecteerd doordat de rol `%1' refereert naar rol `%2'! - + The role `%1' can not be listed as a member of itself! De rol `%1' kan geen lid zijn van zichzelf! - + Reference to a role which index is out of role list bounds! Referentie naar een rol wiens index buiten de limieten van de rollelijst ligt! - + Insertion of empty command to the rule! Invoeging van een leeg commando aan de regel! - + Reference to a command which index is out of the command list bounds! Referentie naar een commando wiens index buiten de limieten van de commandolijst ligt! - + Is not possible to create a self generalization/copy relationship! The table can not inherit or copy their own attributes! Het is onmodelijk om een zelf-generalisatie/kopieer-relatie aan te maken! De tabel kan niet van zichzelf erven of zijn eigen attributen kopieren! - + Assignment of an object that already belongs to another table! Toewijzing van een object dat reeds aan een andere tabel toehoort! - + Assignment of a schema to the sequence which differs from the schema of the owner table! Toewijzing van een schema aan de sequentie die verschilt van het schema van de eigenaars-tabel! - + Assignment of an invalid value to one of the sequence attributes! Toewijzing van een ongeldige waarde aan een van de sequentie-attributen! - + Assignment of a minimum value to the sequence which is greater than the maximum value! Toewijzing van een minimumwaarde die groter is dan de maximumwaarde van de sequentie! - + Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values! Toewijzing van een startwaarde aan de sequentie die de omvang extrapoleerd als gedefinieerd door de minimum- en maximumwaarden! - + Assignment of a null increment value to the sequence! Toewijzing van een null-vermeerdering aan de sequentie! - + Assignment of null cache value to the sequence! Toewijzing van null-cachewaarden aan de sequentie! - + Assignment of owner table which is not in the same schema as the sequence `%1'! Toewijzing van een eigenaarstabel die zich niet in hetzelfde schema bevindt als de sequentie `%1'! - + Assignment of owner table which does not belong to the same owner of the sequence `%1'! Toewijzing van een eigenaarstabel die niet tot dezelfde eigenaar behoort als de sequentie `%1'! - + Assignment of a nonexistent owner column to the sequence `%1'! Toewijzing van een niet-bestaande eigenaarskolom aan de sequentie `%1'! - + Assignment of an owner column to the sequence `%1' that is not related to any table! Toewijzing van een eigenaarskolom aan de sequentie `%1' die aan geen enkele tabel gerelateerd is! - + Reference to a label which index is out of labels list bounds! Referentie naar een label wiens index buiten de limieten ligt van de label-lijst! - + Allocation of object with invalid type! Allocatie van een object met ongeldig type! - + Assignment of a function with invalid return type to object `%1' (%2)! Toewijzing van een functie met een ongeldige terugkeerwaarde aan object `%1' (%2)! - + Assignment of a function with invalid parameter(s) type(s) to object `%1' (%2)! Toewijzing van een functie met ongeldige parametertype(s) aan object `%1' (%2)! - + Assignment of not allocated language! Toewijzing van een niet-gealloceerde taal! - + Assignment of language object which type is invalid! Toewijzing van een taalobject wiens type ongeldig is! - + Reference to data type with an index outside the capacity of data types list! Referentie naar een datatype met een index die buiten de capaciteit van de datatype lijst ligt! - + Assignment of a null type to object `%1' (%2)! Toewijzing van een null type aan het object `%1' (%2)! - + Assignment of invalid type to the object! Toewijzing van een ongeldig type aan het object! - + Assignment of an empty directory to object `%1' (%2)! Toewijzing van een lege map aan object `%1' (%2)! - + Obtaining types with invalid quantity! Types met ongeldige hoeveelheid verkregen! - + Insertion of item which already exists in the attributes list of the type! Invoegen van een item dat reeds bestaat in de attributenlijst van het type! - + Insertion of invalid item in the attributes list of the type! Invoegen van een ongeldig item in de attributenlijst van het type! - + Insertion of item which already exists in the enumarations list of the type! Invoegen van een item dat reeds bestaat in de enumeratielijst van het type! - + Insertion of invalid item in the enumerations list of the type! Invoegen van een ongeldig item in de enumeratielijst van het type! - + Reference to an attribute which index is out of the attributes list bounds! Referentie naar een attribuut met een index die buiten de limieten van de attributenlijst ligt! - + Reference to an enumeration which index is out of the enumerations list bounds! Referentie naar een enumeratie met een index buiten de limieten van de enumeratielijst! - + Assignment of invalid configuration to the type! Toewijzing van een ongeldige configuratie aan het type! - The data type `%1' can not be assigned because it already exists in the types list of the aggregate function `%2'! - Het datatype `%1' kan niet worden toegewezen omdat het reeds bestaat in de typelijst van de aggregatiefunctie `%2'! + + There is already a relationship between `%1' (%2) and `%3' (%4) in the model! When using relationships of the type generalization, copy and one-to-one there can't be other relationships linked to the pair of tables. + + + + + Unable to load the configuration file `%1'! Please check if file exists in its folder and/or if it is not corrupted! + - + + Invalid syntax in file `%1', line %2, column %3! + + + + + Invalid instruction `%1' on file `%2', line %3, column %4! + + + + + Unknown attribute `%1' in file `%2', line %3, column %4! + + + + + Invalid metacharacter `%1' in file `%2', line %3, column %4! + + + + + Invalid operator `%1' in comparison expression, file `%2', line %3, column %4! + + + + + Attribute `%1' with an undefined value in file `%2', line %3, column %4! + + + + + Attribute `%1' with an invalid name in file `%2', line %3, column %4! + + + + + Could not access the file or directory `%1'! Make sure that it exists or if the user has access permissions on it! + + + + + Could not load file `%1'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! + + + + + Unsupported PostgreSQL version (%1) detected! Valid versions are between %2 and %3. + + + + + Failed to drop the database `%1' because it is defined as the default database for the connection `%2'! + + + + + The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it! + + + + + The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'. + + + + + Reference to an invalid affected command in policy `%1'! + + + + + Reference to an invalid special role in policy `%1'! + + + + Assignment of an operator which input type count is invalid to aggregate function! Toewijzing van een operatie wiens inputtypehoeveelheid ongeldig is voor een aggregatiefunctie! - + Assignment of an operator which types of arguments is invalid! Toewijzing van een operator wiens argumententypes ongeldig zijn! - + Assignment of system reserved name to the object `%1' (%2)! Toewijzing van een systeem-gereserveerde naam aan het object `%1' (%2)! - + One function with invalid configuration is been used by the object `%1' (%2)! Een functie met ongeldige configuratie wordt gebruikt door het object `%1' (%2)! - + Assignment of an invalid strategy/support number to an operator class element! Toewijzing van een ongeldig strategy- of supportnummer aan een operatorklasse element! - + Insertion of element which already exists in the element list! Invoegen van een element dat reeds bestaat in de elementenlijst! - + Reference to an element which index is out of element list bounds! Referentie naar een element wiens index buiten de limiet van de elementenlijst valt! - + Reference to an object which index is out of object list bounds! Referentie anar een object wiens index buiten de limiet van de objectenlijst valt! - + Removal of an object not allocated! Verwijdering van een niet-gealloceerd object! - + The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4)! Het object `%1' (%2) kan niet worden verwijderd omdat object `%3' (%4) ernaar verwijst! - + The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4) that belongs to `%5' (%6)! Het object `%1' (%2) kan niet worden verwijderd omdat object `%3' (%4), dat aan `%5' (%6) toehoort, ernaar verwijst! - + Operation with object(s) which type(s) is invalid! Operatie met object(en) van een ongeldig type! - + Reference to object with invalid type! Verwijzing naar een object van een ongeldig type! - + Operation with object not allocated! Operatie op een niet-gealloceerd object! - + The creation of the relationship `%1' between the table `%2' and `%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! Het aanmaken van de relatie `%1' tussen de tabellen `%2' en `%3' kan niet worden voltooid omdat deze geen primary key bevatten. Indien de relatie van het type n-n is, moeten beide tabellen over een primary key beschikken! - + The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user! De relatie van het type 1-1 waar beide tabellen verplicht meespelen is niet geimplementeerd omdat dit een fusie tussen de tabellen vereist die het design van de gebruiker zou breken! - + Assignment of an invalid expression to the object! Toewijzing van een ongeldige expressie aan het object! - + Assignment of a primary key to a table which already has one! Toewijzing van een primary key aan een tabel die reeds over een primary key beschikt! - + Identifier relationship can not be created for a self relationship, relationships of the type n-n, copy or generalization! De identifier-relatie kan niet worden aangemaakt voor een zelf-relatie, relaties van het type n-n, kopie or generalisatie! - + Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'! De kopie-relatie kon niet worden aangemaakt omdat de kolom `%1' in table `%2' reeds bestaat in tabel `%3'! - + Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types! De generalisatierelatie kan niet worden aangemaakt omdat de kolom `%1' in tabel `%2' niet kan worden samengevoegd met kolom `%3' van tabel `%4', deze kolommen hebben incompatibele types! - + Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition! De generalisatierelatie kan niet worden aangemaakt omdat de constraint `%1' in tabel `%2' niet kan worden samengevoegd met constraint `%3' van tabel `%4', deze constraints hebben een incompatibele compositie! - + An attribute can not be added to a copy or generalization relationship! Een attribuut kan niet worden toegevoegd aan een kopie of een generalisatierelatie! - + A foreign key can not be added to a relationship because is created automatically when this is connected! Een foreign key kan niet worden toegevoegd aan een relatie omdat deze automatisch wordt aangemaakt wanneer deze wordt verbonden! - + The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model! Het object `%1' (%2) refereert naar het object `%3' (%4), dit laatste object kon niet worden gevonden in het model! - + Reference to an user-defined data type that not exists in the model! Referentie naar een gebruikersgedefinieerd type dat niet in het model bestaat! - + Assignment of invalid maximum size to operation list! Toewijzing van een ongeldige maximumwaarde aan de operatielijst! - + Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it! Het bestand of de map `%1' kon niet worden aangemaakt! Zorg ervoor dat de uitvoermap bestaat en dat de gebruiker er schrijfmachtigingen toe heeft! - + Unable to write the file `%1' due to one or more errors in the definition generation process! Het bestand `%1' kan niet worden geschreven omwille van een of meerdere fouten die optraden tijdens het definitie-generatie proces! - There is already a relationship between `%1' (%2) and `%3' (%4) in the model! - Het model bevat reeds een relatie tussen `%1' (%2) en `%3' (%4)! - - - The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent! De configuratie van de relatie `%1' creeert een redundantie tussen de relaties `%2'. Redundanties van identifiers of generalisatie/kopie-relaties zijn niet geldig omdat deze kunnen leiden tot het incorrect verspreiden van kolommen en dit kan het model inconsistent maken! - + One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! Een of meerdere objecten werden als ongeldig gemarkeerd en werde automatisch verwijderd omdat deze naar kolommen refereerden die werden ingesloten door relaties die niet langer bestaan omwille van het ontkoppelen van de relatie of het uitsluiten van zulke gegenereerde kolommen! - + The primary key `%1' can only be allocated if declared within a block of code that defines a table or relationship! Een foreign key `%1' kan niet worden toegevoegd aan een relatie omdat deze automatisch wordt aangemaakt wanneer deze wordt verbonden! - + Reference to an invalid privilege type! Referentie naar een ongeldig machtigingstype! - + Insertion of a role which already exists in the role list of the permission! Invoegen van een rol die reeds in de rollenlijst van de machtiging aanwezig is! - + Assignment of privilege incompatible with the type of object referenced by permission! Toewijzing van een machtiging die niet compatibel is met het type waarnaar wordt verwezen door de machtiging! - + There is already a permission on object `%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! Er bestaat reeds een machtiging op object `%1' (%2) die een of meerdere zelfde rollen bevat als deze die onderdeel uitmaken van de nieuwe machtiging die aan het object worden toegewezen! - + A permission is referencing the object `%1' (%2) which was not found in the model! Een machtiging refereert naar object `%1' (%2) dat niet in het model kon worden teruggevonden! - + The object `%1' (%2) can not be created because its not being assigned to any schema! Het object `%1' (%2) kan niet worden aangemaakt omdat het niet aan een schema is toegewezen! - + The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'! De tablespace `%1' kan niet worden ingevoegd in het model omdat het naar dezelfde map verwijst als de tablespace `%2'! - + It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature! Het is niet mogelijk om arrays van domeinen of sequenties (dimensie >= 1) aan te maken! Dit feature is nog niet aanwezig in PostgreSQL! - + The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! De functie `%1' kan geen broncode bevatten als definitie omdat de taal is ingesteld als 'C'. Gebruik het attributensymbool en dynamische bibliotheek in de plaats! - + The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! De functie `%1' kan enkel symboolattributen en een dynamische bibliotheek configureren waneer de taal is ingesteld als zijnde 'C'. In alle andere gevallen moet u broncode specifieren die de functie definieert in het DBMS! - + The operator `%1' can not be assigned as a comutator of operator `%2' because it has incompatible settings! De operator `%1' kan niet worden toegewezen als comutator van operator `%2' omdat deze incompatibele instellingen heeft! - + The operator `%1' can not be assigned as negator of operator `%2' because it has incompatible settings! De operator `%1' kan niet worden toegewezen als negator van operator `%2' omdat deze incompatibele instellingen heeft! - + The type `%1' can not self refer in the attributes `element' or `copy type' or be used as a data type of an attribute in the configuration of a composite type! Het type `%1' kan geen zelf-referentie bevatten in de attributen 'element' of 'kopie type' noch kan het worden gebruikt als het data type van een attribuut in de configuratie van een composiet-type! - + Assignment of invalid element to type `%1'! Toewijzing van een ongeldig element aan type `%1'! - + Assignment of invalid alignment to type `%1'! Toewijzing van een ongeldig uitlijning aan type `%1'! - + Assignment of invalid name to the table generated from N-N relationship! Een ongeldige naam werd toegewezen aan de tabel gegenereerd op basis van een N-N relatie! - + The relationship `%1' can not make use of the special primary key because it is marked as identifier or it is a self relationship! De relatie `%1' kan geen gebruik maken van de primary key omdat deze is aangeduid als identifier of omdat het een zelfverwijzende relatie is! - + The object `%1' (%2) can not be edited or deleted because it was automatically included through a relationship! If the object is an attribute or constraint the modifications must be done on the relationship editing form. Het object `%1' (%2) kan niet worden bewerkt of verwijderd omdat het automatisch werd ingesloten via een relatie! Indien het object een attribuut of een constraint is moeten de bewerkingen worden uitgevoerd via het Relatie bewerk-venster. - + The object `%1' (%2) can not be deleted because it is protected! Het object `%1' (%2) kan niet worden verwijderd omdat het beschermd is! - + The group `%1' has already been declared earlier! De groep `%1' werd reeds eerder gedeclareerd! - + The group `%1' can not be built in the groups declaration block (%2)! De groep `%1' kan niet worden opgebouwd in de groependeclaratie-block (%2)! - + The group `%1' was built but not declared in the groups declaration block (%2)! De groep `%1' werd opgebouwd maar is niet gedeclareerd in de groependeclaratie-block (%2)! - + The group `%1' can not be built without possessing child elements! De groep `%1' kan niet worden opgebouwd zonder kind-elementen! - + The group `%1' can not be built once more because this was done in previous blocks! De groep `%1' kan niet worden opgebouwd omdat dit reeds werd uitgevoerd in een vorige block! - + The group `%1' has been declared but not built! De groep `%1' werd gedeclareerd maar niet opgebouwd! - + Reference to a column of the objects table with invalid index! Een referentie naar een kolom in de objectentabel met een ongeldige index! - + Reference to a row of the objects table with invalid index! Een referentie naar een rij in de objectentabel met een ongeldige index! - + The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference! Het object `%1' (%2) kan niet worden gemanipuleerd omdat dit een gereserveerd object is in PostgreSQL! Dit object bestaat enkel als referentie in het databasemodel! - + The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect! De nieuwe configuratie van de functie maakt het object `%1' (%2) niet langer gevalideerd! Om de nieuwe configuratie in voege te doen treden moet u de relatie tussen het beinvloedde object en de functie ongedaan maken. - + A view reference must be used in at least one these SQL scopes: View Definition, SELECT-FROM, FROM-WHERE or After WHERE! Een viewreferentie moet minstens in een van de volgende SQL scopes worden gebruikt: View Definitie, SELECT-FROM, FROM_WHERE of Na WHERE! - + Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns! Constraints zoals primary key, foreign key of unique key moeten minstens een kolom bevatten! Voor foreign keys moeten ook de gerefereerde kolommen worden geselecteerd! - Unable to load one or more configuration files! Please check if files exists in the configuration folder and if they are not corrupted to preventing this error to occur again on the next startup! - Een of meerdere configuratiebestanden kunnen niet worden geladen! Om ervoor te zorgen dat deze fout zich niet voordoet de volgende maal u het programma opstart, gelieve na te kijken of deze bestanden in de configuratie-map bestaan en dat deze niet gecorrupteerd zijn. - - - Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again! Het standaardinstellingsbestand `%1' kon niet worden gevonden. Kijk na of dit bestand bestaat om de standaardinstellingen terug te zetten en probeer opnieuw! - + The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack! ** Executed SQL command: ** @@ -4740,413 +4818,355 @@ Ref. column(s): %2 %1 - + Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3' De plugin `%1' kon niet worden geladen van de bibliotheek `%2'! De plugin manager antwoordde met: `%3' - + One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details. Een of meerdere plugin werden niet geactiveerd omwille van fouten gedurende het laadproces! Kijk de exception stack na voor meer details. - - - Invalid syntax in file %1, line %2, column %3! - Het bestand %1 bevat ongeldige syntax op lijn %2, kolom %3! - - - - Invalid instruction `%1' on file %2, line %3, column %4! - De instructie `%1' in bestand %2 op lijn %3, kolom %4 is ongeldig! - - - - Unknown attribute `%1' in file %2, line %3, column %4! - De attribuut `%1' in bestand %2 op lijn %3, kolom %4 is ongeldig! - - - - Invalid metacharacter `%1' in file %2, line %3, column %4! - Het metakarakter `%1' in bestand %2 op lijn %3, kolom %4 is ongeldig! - - - - Invalid operator `%1' in comparison expression, file %2, line %3, column %4! - De operator `%1' binnen de vergelijkingsexpressie in bestand %2 op lijn %3, kolom %4 is ongeldig! - - - - Attribute `%1' with an undefined value in file %2, line %3, column %4! - Een attribuut `%1' met een ongedefinieerde waarde in bestand %2 op lijn %3, kolom %4! - - Attribute `%1' with an invalid name in file %2, line %3, column %4! - Een attribuut `%1' met een ongeldige naam in bestand %2 op lijn %3, kolom %4! - - - Assignment of empty XML buffer to parser! Toewijzingen van een lege XML buffer aan de parser! - Could not access the file or directory %1! Make sure that it exists or if the user has access permissions on it! - Het bestand of de map %1 is niet toegankelijk! Zorg ervoor dat het pad bestaat en dat de gebuiker toegangsmachtigingen tot dit pad heeft! - - - Assignment of empty DTD file name! Toewijzing van een lege DTD bestandsnaam! - + Assignment of empty name to the DTD declaration! Toewijzing van een lege naam aan de DTD declaratie! - + Error while interpreting XML buffer at line %1 column %2. Message generated by the parser: %3. %4 Er trad een fout op tijdens het interpreteren van de XML buffer op lijn %1, kolom %2. De parser antwoordde met: %3. %4 - + Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated! Een operatie werd uitgevoerd op een niet-gealloceerd element in de boomstructuur! De XML parser buffer moet eerst worden geladen en geinterpreteerd zodat deze boomstructuur kan worden gegenereerd! - Could not load file %1. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! - Het bestand %1 kon niet worden geladen. Ditzelfde lijkt inconsistent te zijn of een van zijn dependencies (DTD bestanden) heeft ofwel fouten of ontbreekt! - - - Operation with unallocated tree element! Operatie met een niet-gealloceerd object! - + Operation with element which does not exists in the element tree currently loaded! Er werd een operatie uitgevoerd op een element dat niet bestaat in de huidig geladen elementen-boomstructuur! - + Assignment of a value to an invalid connection parameter! Toewijzing van een waarde aan een ongeldige verbindingsparameter! - + Operation on connection not established! Er werd een operatie uitgevoerd op een niet-verbonden verbinding! - + Attempt to connect without define configuration parameters! Poging tot verbinden zonder dat de configuratieparameters zijn gedefinieerd! - + Attempt to start a connection already stablished! Poging tot het starten van een verbinding die reeds verbonden is! - + Could not connect to the database. Message returned: `%1' Er kon geen verbinding worden gemaakt met de database. Het bericht is: `%1' - + Assignment of not allocated SQL command result! Toewijzing van een niet-gealloceerde SQL commandoresultaat! - + Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client! Het is niet mogelijk om het resultaat van het SQL commando te allocaren omdat de client het antwoord van de DBMS niet verstond! - + Unable to allocate command result for the SQL because the server has generated a fatal error! Message returned by the DBMS: `%1' Het commandoresultaat voor de SQL code kan niet worden gealloceerd omdat de server een fatale fout genereerde! Het bericht dat terugkwam van de DBMS is: `%1' - + Reference to a column of tuple with invalid index! Referentie naar een kolom van een tuple met een ongeldige index! - + Reference to a column of tuple with invalid name! Referentie naar een kolom van een tuple met een ongeldige naam! - + Reference to a tuple with an invalid index or the result is empty (no tuples)! Referentie naar een tuple met een ongeldige index of het resultaat is leeg (geen tuples)! - + Reference to a column of a tuple which was not yet initialized (tuple navigation not started)! Referentie naar een kolom van een tuple dat nog niet werd geinitializeerd (tuple-navigatie nog niet gestart)! - + Could not execute the SQL command. Message returned: `%1' Het SQL commando kon niet worden uitgevoerd. Het teruggekeerde bericht is: `%1' - + Invalid use of a view reference as whole SQL definition! The assigned reference must be an expression! Ongeldig gebruik van een view-referentie als volledige SQL definitie! De toegewezen referentie moet een expressie zijn! - + Assignment of a second definition expression to the view! Toewijzing van een tweede definitie-expressie aan de view! - + It is not possible mix ordinary references (SELECT-FROM, FROM-WHERE, After WHERE) with references used as view SQL definition! Gewone referenties (SELECT-FROM, FROM-WHERE, Na WHERE) kunnen niet worden gemixt met referenties die gebruikt worden als SQL definitie! - + Assignment of collation object which type is invalid! Toewijzing van een sorteringsobject wiens type ongeldig is! - + At the moment pgModeler does not support the creation of primary keys which some columns were generated by relationship connection. To create primary keys with this feature you can use the field `Identifier' or the tab `Primary key' on relationship editing form! Op dit moment ondersteunt pgModeler de aanmaak van primary keys waarvan sommige kolomen door relatie-verbindingen worden gegenereerd nog niet. Om primary keys met dit feature aan te maken kan u gebruik maken van het veld 'Identifier' of het 'Primary key' tab-blad in het relatie-bewerkingsvenster! - + Collations must be created at least with attributes LC_COLLATE and LC_CTYPE defined! Sorteringsmethodes moeten worden aangemaakt en minstens LC_COLLATE en LC_CTYPE gedefinieerd hebben! - + The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object! Het object `%1' (%2) kan niet naar zichzelf verwijzen! Deze operatie is niet toegelaten voor dit type object! - + Only operator families which uses `btree' as indexing method are accepted by operator class elements! Enkel operator-families die gebruik maken van `btree' als indexeringsmethod kunnen worden aanvaard als operatorklasse element! - + Reference to an invalid copy table option! Referentie naar een ongeldige kopie-tabel optie! - + Copy relationship between tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table! De kopie-relatie tussen tabellen `%1' en `%2' kan niet worden aangemaakt omdat de eerste reeds attributen kopieert van `%3'! Tabellen kunnen over slechts een kopie-tabel beschikken! - + The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers! De INSTEAD OF modus kan niet worden gebruikt voor triggers die aan tabellen toehoren! Dit is enkel beschikbaar voor triggers die aan views toehoren! - + The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table! Het TRUNCATE event kan enkel worden gebruikt wanneer de trigger uitvoert voor elk statement en aan een tabel toebehoort! - + The INSTEAD OF mode cannot be used on view triggers that executes for each statement! De INSTEAD OF modus kan niet worden gebruikt voor view triggers die voor elk statement worden uitgevoerd! - + Constraint triggers can only be executed on AFTER events and for each row! Constraint triggers kunnen enkel worden uitgevoerd NA events en voor elke rij! - + A view trigger cannot be AFTER/BEFORE when it executes for each row! Een view trigger kan niet AFTER/BEFORE zijn wanneer deze voor elke rij wordt uitgevoerd! - + A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event! Een trigger kan niet naar kolommen refereren wanneer deze gebruikt maakt van de INSTEAD OF modus binnen een UPDATE event! - + Assignment of a column which has no parent table to the object `%1' (%2)! Toewijzing van een kolom aan object `%1' (%2) die geen ouder-tabel heeft! - + Only constraint triggers can be deferrable or reference another table! Enkel constraint triggers kunnen uitstelbaar zijn of naar andere tabellen refereren! - + Reference to a function id which is incompatible with the user define type configuration! Een referentie naar een functie id die niet compatibel is met de configuratie van het gebruiker gedefinieerde type! - + The operator class assigned to the object `%1' (%2) must use `btree' as indexing method! De operatorklasse die is toegewezen aan het object `%1' (%2) moet 'btree' als indexeringsmethod gebruiken! - Unsupported PostgreSQL version (%1) detected! Valid versions are: %2 - Er werd een niet-ondersteunde versie van PostgreSQL gedetecteerd (%1)! Geldige versies zijn: %2 - - - The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack! Het validatieproces faalde omwille van een fout in de validatie-helper. Kijk voor meer details over de fout de exception stack na! - + The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified! De uitbreiding `%1' is geregistreerd als een data type, het 'behandeld data type' attribuut kan niet worden aangepast! - + The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'! De fk relatie `%1' kan niet worden aangemaakt omdat de foreign key die deze relatie weergeeft niet werd aangemaakt op tabel `%2'! - + Assignement of an invalid object name pattern to the relationship `%1'! Toewijzijng van een ongeldig objectnaamspatroon aan de relatie `%1'! - + Reference to an invalid object name pattern id on the relationship `%1'! Referentie naar een ongeldige id van objectnaamspatronen voor de relatie `%1'! - + Invalid use of variadic parameter mode! This mode can be used only with an array or "any" data type! - + + The object `%1' (%2), oid `%3', could not be imported due to one or more errors! Check the exception stack for more details. `HINT:' if the object somehow references objects in `pg_catalog' or `information_schema' consider enable the importing of system objects. + + + + It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function or a sequence object must be directly assigned to the column! - + A parent table of `%1' which OID is `%2' was not found in the set of imported objects! - + The enumeration `%1' can't be assigned to the type `%2' because contains invalid characters! - + The enumeration `%1' can't be assigned to the type `%2' because is too long! - + The connection was idle for too long and was automatically closed! - + The connection was unexpectedly closed by the database server `%1' at port `%2'! - Invalid use of variadic parameter mode! This mode can be used only with array data types! - Ongeldig gebruik van varierende-parametermodus! Deze modus kan enkel worden gebruikt bij array types! - - - + Mixing incompatibles DBMS export modes: `ignore object duplications', `drop database' or `drop objects' cannot be used with `simulate export'! Mixen van niet-compatibele DBMS export-modussen: `negeer object duplicaten', `verwijder database' of `verwijder objecten' kan niet samen worden gebruikt met `simuleer export'! - + Mixing incompatibles DROP options: `drop database' and `drop objects' cannot be used at the same time! Mixen van niet-compatibele DROP opties: `verwijder database' en `verwijder objecten' kunnen niet samen worden gebruikt! - + Invalid object id swapping operation! The objects involved are the same! Ongeldige object id wissel-operatie! De betrokken objecten zijn dezelfde! - + Invalid object id swapping operation! The database itself, tablespaces or roles cannot have the ids swapped! Ongeldige object id wissel-operatie! De database zelf, tablespaces en rollen kunnen geen ids omwisselen! - + The widget already has a parent and cannot be assigned to a different object! Het widget heeft reeds een ouder en kan niet aan een ander object worden toegewezen! - The object `%1' (%2) could not be imported due to one or more errors! Check the exception stack for more details. - Het object `%1' (%2) kon niet worden geïmporteerd omwille van een of meer fouten! Kijk de exception stack na voor meer details. - - - Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case. Het datababase modelbestand `%1' kon niet worden geladen. Kijk de foutenstack na voor meer details. Probeer `pgmodeler-cli --fix-model' uit te voeren op het model om de bestandsstructuur te corigeren indien dit nodig zou zijn. - + The column `%1' cannot reference it's parent table `%2' as data type! De kolom `%1' kan niet naar de oudertabel `%2' als data type verwijzen! - + Operation with an invalid element id `%1'! Operatie met een ongeldige olement id `%1'! - + Reference to an invalid color id `%1' for element `%2'! Referentie naar een ongeldige kleuren-id `%1' voor element `%2'! - + Assignment of an invalid object to `%1' (%2)! The assigned object must be of type `%3'. Toewijzing van een ongeldig object aan `%1' (%2)! Het toegewezen object moet van het type `%3' zijn. - + The sequence `%1' can't be assigned to the column `%2' because the data type of the latter is incompatible. The type used must be an integer one! De sequentie `%1' kan niet aan de kolom `%2' worden toegewezen omdat het data type van de kolom niet compatibel is. Het gebruikte type moet een integer type zijn! - + The option to generate temporary object names can only be used in simulation mode! De optie om tijdelijke objectnamen te genereren kan enkel worden gebruikt in simulatie-modus! - It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function! - Het is niet mogelijk om het type van kolom `%1' naar serial om te vormen! Het type van de kolom moet een `integer'-gebaseerd type zijn en de standaardwaarde moet een aanroep van de `nextval(seq_name::regclass)' functie zijn! - - - + Could not assign the variable `%1' to event trigger's filter. Currently, PostgreSQL supports only the `TAG' variable! De variabele `%1' kon niet worden toegewezen aan de filter van de event trigger! Op dit moment ondersteunt PostgreSQL enkel de `TAG' variabele! - + Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. ** Returned error ** @@ -5159,32 +5179,28 @@ Het bericht dat terugkwam van de DBMS is: `%1' %4 - + Malformed unescaped value on row `%1' column `%2'! Incorrect gevormde un-escape waarde op rij `%1', kolom `%2'! - + Trying to undo/redo an invalid operation over an object that does not exists anymore or can't be handled! The operation history will be cleaned up. Poging tot het ongedaan maken of opnieuw uitvoeren van een ongeldige operatie op een object dat niet langer bestaat of niet kan worden behandeld! De taakgeschiedenis zal worden leeggemaakt. - + The object `%1' (%2) can't be handled because some needed fields are not set! Please, make sure to fill at least the requires fields in order to properly create or update the object. Het object `%1' (%2) kan niet worden behandeld omdat sommige nodige velden niet werden ingesteld! Gelieve de verplichte velden in te voeren om het object correct aan te kunnen maken of passen. - + A relationship can only be swapped by other object of the same kind! De relatie kan enkel worden omgewisseld door een ander object van dezelfde soort! ExtensionWidget - - Form - Venster - Version: @@ -5214,87 +5230,93 @@ Het bericht dat terugkwam van de DBMS is: `%1' Venster - + + Hide this widget + Verberg dit widget + + + + ... + ... + + + Replace one occurrence Vervang één voorkomen - + Replace Vervangen - + Replace all occurrences Vervang alle voorkomens - + Replace All Vervang Allen - + Replace the selection and find the next one Vervang in de selectie en vindt de volgende - + Replace && Find Vervang && Zoek - + Replace: Vervang: - + Find: Zoek: - + Find previous Zoek vorige - + Shift+F3 - + Find next Zoek volgende - + F3 - + Case sensitive Hoofdlettergevoelig - + Regular expression Regular expression - + Whole words Volledig woord - FunctionWidget - - Form - Venster - + FunctionWidget Attributes @@ -5316,90 +5338,82 @@ Het bericht dat terugkwam van de DBMS is: `%1' Aantal rijen - - Langague: - Taal: - - - + Return Method: Terugkeermethode: - + Behavior: Gedrag: - Simple - Simpel - - - + Set Set - Table - Tabel + + Language: + - + Si&mple - + Tab&le - + Return Table Terugkeertabel - + Execution Cost: Uitvoeringskost: - + Windown Func. Windowing Functie - + Leakproof Lekdicht - + Parameters Parameters - + Definition Definitie - + Dynamic Library: Dynamische Bibliotheek - + Symbol: Symbool: - + Library: Bibliotheek: - + Source code: Broncode: @@ -5443,532 +5457,609 @@ Het bericht dat terugkwam van de DBMS is: `%1' Algemeen && Design - + General Algemeen - - The opened models will be saved periodically - De geopende modellen worden periodiek opgeslagen - - - - Autosave interval: - Automatische opslaginterval: - - - + Operation history: Taakgeschiedenis: - - minute(s) - minuten - - - - items - items - - - + Check if there is a new version on server Vink dit aan om na te kijken of een nieuwe versie beschikbaar is op de server - - Check for updates at startup - Zoek naar updates bij het opstarten - - - - pixels - pixels - - - - Grid size: - Rastergrootte: - - - + Design Design - + Graphical objects (table, views and textboxes) will be created in a single step without the need to click on canvas Grafische objecten (tabellen, views en tekstvakken) worden in een enkele stap aangemaakt zonder op het canvas te hoeven klikken - + Simplify creation of graphical objects Should be 'Vereenvoudig de aanmaak van grafische objecten' but that's way too long for the space Versimpel creatie van grafische objecten - + After loading the model the last zoom and position on canvas will be restored Nadat het model geladen is wordt de laatste zoomwaarde en positie op het canvas hersteld - + Save and restore last position and zoom Behoud de laatste positie en zoom - Disable antialiasing for lines and texts improving performance on huge models (requires restart) - Schakel anti-aliassing uit voor lijnen en tekst, dit verbetert de performantie bij grote modellen (vereist opnieuw opstarten van de applicatie) - - - + Disable render smoothness Schakel vlakke rendering uit - + Hide the object that represents the relationship name Verberg het object dat de relatienaam voorstelt - + Hide relationship name Verberg relatienaam - Operations like save, export and diff will be executed without asking user to validate the model - Operaties zoals opslaan, exporteren en diff worden uitgevoerd zonder dat de gebruiker gevraagd wordt om het model te valideren - - - + Validate before save, export or diff Valideer voor opslaan, exporteren of diff - + Hide the object which represents the tag assigned to the table Verberg het tag object dat is toegekend aan de tabel - + Hide table tags Verberg tabel-tags - + Start move the canvas when the cursor is on the canvas edges Verplaatst het canvas wanneer de cursor zich op de rand van het canvas bevindt - + Move canvas by keep mouse on corners Verplaats canvas bij muis in de hoeken - + Hide the portion of table which represent triggers, indexes and rules Verberg het tabel-gedeelte dat triggers, indexes en regels voorstelt - + Hide table extended attributes Verberg uitgebreide attributen - - By default panning mode is triggered with left click and range selection with Shift + left click. - De standaard panning modus wordt geactiveerd met linkermuisknop en een gebied-selectie via Shift+Linkermuisknop. - - - + Disable antialiasing for lines and texts improving performance when handling huge models. - + Triggers a dialog asking the user to validate the model before a save, export or diff operation. - - Swap panning and range selection triggers - Wissel panning- && gebiedsselectietriggers - - - + When enabled this option creates a placeholder object at the previous table's position when starting to move it. This will cause graphical updates on relationship lines to be performed only when the drag & drop action is done improving the performance. Disabling placeholders will cause those updates to be executed every time the table's position changes a single pixel (classical behavior). - + Use placeholders when moving tables - + Toggles the code completion in all fields that accepts the input of SQL commands. Schakelt codevervollediging aan of af in alle velden die SQL commando's aanvaarden. - + + Minimum object opacity (%): + + + + + Defines the minimum opacity percentage applied to the objects when using the fade out feature. A zero opacity causes the object to be completely hidden not being possible to interact with it in the canvas area. + + + + + Canvas grid size: + + + + + Defines the vertical and horizontal grid size. This value affects the spacing of objects when using object grid alignment feature. + + + + + By default the range selection is triggered with Shift + left click. By checking this option range selection will be activated only with a single click and move. + + + + + Trigger range selection with a single click + + + + + Defines the maximum amount of elements held in the operation history. Once reached the maximum number the history is automatically cleaned. + + + + + Defines the period when the opened models will be saved automatically. + + + + + Autosave interval (minutes): + + + + Enable SQL code completion Schakel SQL codevervollediging in - + + Replaces any straight line in relationship by curved ones in order to improve the model's visualization. + + + + + Use curved lines for relationships + + + + + Souce code editor args: + + + + + lines + + + + + Clear the entire SQL comand history. + + + + + Clear history + + + + + Open in file manager + Open in bestandsbeheer + + + + Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. + + + + + SQL history max. length: + + + + + Check updates at startup + + + + + User interface language: + + + + + Browse the source code editor application + + + + + Souce code editor: + + + + + Configurations directory: + + + + Printing && Code Printen && Code - + Code style Codestijl - + Size: Grootte: - + Font: Lettertype: - + Colors: Kleuren: - - + + Options: Opties: - + Display line numbers Geef lijnnummers weer - + Highlight lines at cursor's position Licht de huidige lijn onder de cursor op - + pt pt - + Custom tab width: - + Printing Printen - + Print grid Print raster - + Print page numbers Print paginanummers - + Paper: Papier: - + A0 (841 x 1189 mm) - + A1 (594 x 841 mm) - + A2 (420 x 594 mm) - + A3 (297 x 420 mm) - + A4 (210 x 297 mm) - + A5 (148 x 210 mm) - + A6 (105 x 148 mm) - + A7 (74 x 105 mm) - + A8 (52 x 74 mm) - + A9 (37 x 52 mm) - + B0 (1030 x 1456 mm) - + B1 (728 x 1030 mm) - + B10 (32 x 45 mm) - + B2 (515 x 728 mm) - + B3 (364 x 515 mm) - + B4 (257 x 364 mm) - + B5 (182 x 257 mm) - + B6 (128 x 182 mm) - + B7 (91 x 128 mm) - + B8 (64 x 91 mm) - + B9 (45 x 64 mm) - + C5E (163 x 229 mm) - + Comm10E (105 x 241 mm) - + DLE (110 x 220 mm) - + Executive (191 x 254 mm) - + Folio (210 x 330 mm) - + Ledger (432 x 279 mm) - + Legal (216 x 356 mm) - + Letter (216 x 279 mm) - + Tabloid (279 x 432 mm) - + Custom Aangepast - + Orientation: Oriëntatie: - + Landscape Landschap - + Portrait Portret - + Unity: Eenheid: - + Custom Size: Aangepaste Grootte: - + Width: Breedte: - + Height: Hoogte: - + Page Margins: Paginamarges: - + Left: Links: - + Left margin Linkermarge - + Top: Kop: - + Top margin Kopmarge - + Right: Rechts: - + Right margin Rechtermarge - + Bottom: Voet: - + Bottom margin Voetmarge - + Milimeters Milimeters - + Pixels Pixels - + Inches Inches - + Centimeter Centimeter - + Line numbers' font color Lettertypekleur van lijnnummers - + Line numbers' background color Achtergrondkleur van lijnnummers - + Highlighted line color Uitlichtkleur - + The little brown fox jumps over the lazy dog The little brown fox jumps over the lazy dog + + + System default + + + + + All files (*.*) + + + + + Load file + + - GraphicalView + GenericSQLWidget - - Connected rels: %1 - Verbonden relaties: %1 + + SQL code + SQL code @@ -5981,10 +6072,6 @@ Het bericht dat terugkwam van de DBMS is: `%1' IndexWidget - - Form - Venster - Attributes @@ -6038,10 +6125,6 @@ Het bericht dat terugkwam van de DBMS is: `%1' LanguageWidget - - Form - Venster - Trusted: @@ -6136,839 +6219,725 @@ Het bericht dat terugkwam van de DBMS is: `%1' Ctrl+F - msg - msg - - - + &File &Bestand - + &Edit &Bewerken - Help - Help - - - + &Show &Weergave - &Plugins - &Plugins - - - + General Algemeen - + Controls Controls - + &Load &Laden - + Sa&ve as - + E&xit - + Exit pgModeler - + &About pgModeler - + &Print - + Print model - + &Undo - + Undo operation - + &Redo - + Redo operation - + &Export &Exporteer - + Ctrl+Shift+E - + &Show grid - + &Close &Sluiten - + &Normal zoom - + &Align to grid - + Show &delimiters - + &Settings - + F12 F12 - + &Overview - + &Support - + Access the support page - + New Nieuw - + &Diff - + + Determine the changes between model/database and another database + + + + Shift+M - + &Bug report - + Objects me&tadata - + Objects metadata - - Ctrl+N - + + Arrange objects + - Save - Opslaan + + Rearrange objects over the canvas + + + + + Ctrl+N + - + Ctrl+S Ctrl+S - + Zoom in Inzoomen - + Ctrl+= Ctrl+= - + Zoom out Uitzoomen - + Zoom - Zoom - - + He&lp - + Pl&ugins - + &New - + New model Nieuw model - + &Save Op&slaan - + &Zoom in - + Zoo&m out - + Ctrl+- Ctrl+- - Load - Laden - - - + Ctrl+O Ctrl+O - Save as - Opslaan als - - - Exit - Afsluiten - - - + Ctrl+Q Ctrl+Q - About pgModeler - Over pgModeler - - - + F4 F4 - Print - Printen - - - + Ctrl+P Ctrl+P - Undo - Ongedaan maken - - - + Ctrl+Z Ctrl+Z - Redo - Opnieuw doen - - - + Ctrl+Y Ctrl+Y - Export - Exporteer - - - + Export the current opened model in different modes Exporteer het huidig geopende model in verschillende modussen - + &Recent Models - + &Import - + Rest&ore Session - + &Fix a model - + &Check for update - + Ctrl+Shift+S Ctrl+Shift+S - + Show grid Raster tonen - + Ctrl+G Ctrl+G - Close - Sluiten - - - + Close current model Sluit dit model - + Ctrl+W Ctrl+W - Normal zoom - Normale zoom - - - + Ctrl+0 Ctrl+0 - Align to grid - Uitlijnen op raster - - - + Align objects position to grid Lijn objecten uit op het raster - + Ctrl+H Ctrl+H - Show delimiters - Delimiters tonen - - - + Show the page delimiters Toon pagina-delimiters - + Ctrl+L Ctrl+L - Settings - Instellingen - - - + Edit pgModeler settings Bewerk de pgModeler instellingen - + Save all Alles opslaan - Overview - Overzicht - - - + Show the model overview Toon modeloverzicht - + F10 F10 - Wiki - Wiki - - - Access the wiki pages - Ga naar de wiki paginas - - - + F1 F1 - + New object - + Plugins Plugins - + Access the list of loaded plugins Bekijk de lijst van geladen plugins - Recent Models - Recente Modellen - - - + Load recently opened model Laad recent geopend model - Import - Importeren - - - + Import existing database to new model (reverse engineering) Importeert een bestaande database in een nieuw model (Reverse Engineering) - + Ctrl+Shift+I Ctrl+Shift+I - Restore Session - Sessie Herstellen - - - Fix a model - Corrigeer een model - - - + New version found! Er is een nieuwe versie beschikbaar! - + Update for the current version is available on project's site Er is een update beschikbaar voor de huidige versie op de website van het project - Check for update - Zoek naar updates - - - + action_main_menu - + Main menu Hoofdmenu - + Show expanded Toon uitgeklapt - + Expands the main menu bar in classical mode Klapt het hoofdmenu uit in klassieke modus - + Hide main menu Verberg hoofdmenu - + Hides the main menu bar and put the action on a separated action This looks like something that could use revisiting (the original EN text that is) Verbergt de hoofdmenu en verplaats de actie naar een afgescheiden actie - + Ctrl+Shift+H Ctrl+Shift+H - Diff - Diff - - - - Determine the changes between model and database - Bepaal de verschillen tussen het model en een database - - - + Ctrl+Shift+D - + Welcome Welkom - + Welcome screen Welkomstscherm - + Shift+W - + Design Design - + Design database models Design databasemodellen - + Shift+D - + Manage Beheer - + Manage existent databases Beheer bestaande databases - Bug report - Bug rapport - - - + Report a bug Rapporteer een bug - + Donate Doneer - + Help pgModeler by donating! Help pgModeler via donering! - + (Demo) (Demo) - - Save all models - Sla alle modellen op - - - Some models were modified! Do you really want to quit pgModeler without save them? - Sommige modellen werden aangepast! Bent u er zeker van dat u pgModeler wilt sluiten zonder deze op te slaan? - Saving temp. models Tijdelijke modellen opslaan - + Clear Menu Menu leegmaken - + The demonstration version can create only `one' instance of database model! De demonstratieversie kan slechts één databasemodel instantie aanmaken! - - + + Save model Model opslaan - The model was modified! Do you really want to close without save it? - Het model werd aangepast! Bent u er zeker van dat u het wilt sluiten zonder het op te slaan? + + Grid + + + + + Hierarchical + - + + Scattered + + + + Save modified model(s) - + The following models were modified but not saved: %1. Do you really want to quit pgModeler? - + The model <strong>%1</strong> was modified! Do you really want to close without save it? - - + + Warning Opgepast - + You're running a demonstration version! The model saving feature is available only in the full version! Dit is een demonstratie-versie! Het opslaan van modellen is enkel beschikbaar in de volledige versie! - - - + + + Confirmation Bevestiging - + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! It's recommended to validate it before save in order to create a consistent model otherwise the generated file will be broken demanding manual fixes to be loadable again! <strong>PAS OP: </strong> Het model <strong>%1</strong> is niet gevalideerd! Het is aangeraden om het model te valideren vooraleer dit op te slaan om ervoor te zorgen dat u een consistent model behoudt, anders is het modelijk dat het gegenereerde bestand onvolledig is en manuele correcties zal vereissen om het opnieuw te kunnen laden! - + Save anyway Toch opslaan - - - + + + Validate Valideer - + Save '%1' as... Sla '%1' op als... - - + + Database model (*.dbm);;All files (*.*) Database model (*.dbm);;Alle bestanden (*.*) - + Access support page - + You're running a demonstration version! Note that you'll be able to create only <strong>%1</strong> instances of each type of object and some key features will be disabled or limited!<br/><br/>You can purchase a full binary copy or get the source code at <a href='http://pgmodeler.com.br'>pgmodeler.com.br</a>. <strong>NOTE:</strong> pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and cover all development costs.<br/><br/> <strong>HINT:</strong> in order to test all features it's recommended to use the <strong>demo.dbm</strong> model located in </strong>Sample models</strong> at <strong>Welcome</strong> view.<br/><br/><br/><br/> - You're running a demonstration version! The model export feature can be tested twice per pgModeler execution! - Dit is een demonstratie-versie. De model-export functionaliteit kan slechts twee maal per pgModeler uitvoering worden getest! + + Rearrange objects over the canvas is an irreversible operation! Would like to proceed? + - + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the export process it's recommended to validate in order to correctly create the objects on database server! <strong>PAS OP:</strong> Het model <strong>%1</strong> is niet gevalideerd! Vooraleer u het export proces start is het aangeraden om de validatie uit te voeren. Dit zorgt ervoor dat de objecten correct op de database server kunnen worden aangemaakt! - + Export anyway Toch exporteren - You're running a demonstration version! The database import (reverse engineering) feature is available only in the full version! - Dit is een demonstratie-versie! De database-import functie (reverse engineering) is enkel beschikbaar in de volledige versie! - - - You're running a demonstration version! The model-database diff feature is available only in the full version! - Dit is een demonstratie-versie! De databasemodel diff functie is enkel beschikbaar in de volledige versie! - - - + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the diff process it's recommended to validate in order to correctly analyze and generate the difference between the model and a database! <strong>PAS OP:</strong> Het model <strong>%1</strong> is niet gevalideerd! Het is aangeradem om het model te valideren vooraleer u het diff process start. Dit zorgt voor een correcte analyse en het correct genereren van de diff tussen het model en de database! - + Diff anyway Voer diff toch uit - + Database model printing Databasemodel printen - + Changes were detected in the definitions of paper/margin of the model which may cause the incorrect print of the objects. Do you want to continue printing using the new settings? To use the default settings click 'No' or 'Cancel' to abort printing. Er werden veranderingen gedetecteerd tussen de papier- en margedefinities van het model die ertoe kunnen leiden dat de objectenn foutief worden geprint. Wenst u te printen met deze nieuwe instellingen? Om de standaardinstellingen te gebruiken, klik op 'Nee' of klik 'Annuleren' om het printen af te breken. - + Load model Laad model - + Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again. Het database modelbestand `%1' kon niet worden geladen. Kijk de error stack na voor details. U kan proberen het probleem te corrigeren om het bestand weer laadbaar te maken. - + Fix model Corrigeer model - + Cancel Annuleren - Open Wiki pages - Open Wiki paginas - - - + This action will open a web browser window! Want to proceed? Deze actie opent een browservenster! Wilt u verdergaan? - + (no samples found) (geen voorbeelden gevonden) - You're running a demonstration version! Note that you'll be able to create only <strong>%1</strong> instances of each type of object and some key features will be disabled!<br/><br/>You can purchase a full binary copy or get the source code at <a href='http://pgmodeler.com.br'>pgmodeler.com.br</a>. <strong>NOTE:</strong> pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and cover all development costs.<br/><br/><br/><br/> - Dit is een demonstratieversie! Houdt er rekening mee dat u slechts <strong>%1</strong> instantie van elk type object aan zal kunnen maken en dat sommige features uitgeschakeld zijn!<br/><br/>U kan de volledige versie aankopen of de broncode raadplegen via <a href='http://pgmodeler.com.br'>pgmodeler.com.br</a>. <strong>LET OP:</strong> pgModeler is open source software maar volledige versies aakopen of doneren aan het project ondersteunen het project en de ontwikkelingskosten hiervan.<br/><br/><br/><br/> - - - The execution of demonstration version has finished! Did you like pgModeler and want to purchase it? Use the following promocodes and receive good discounts:<br/><br/> <strong>D3M02BR0NZ3</strong> (Discount on bronze package)<br/> <strong>D3M02S1LV3R</strong> (Discount on silver package)<br/> <strong>D3M02G0LD</strong> (Discount on gold package)<br/> <strong>D3M02PL4T1NUM</strong> (Discount on platinum package)<br/> <strong>D3M02D14M0ND</strong> (Discount on diamond package)<br/> <br/>Thank you for testing pgModeler! - De uitvoer van de demonstratieversie is voltooid! Vindt u pgModeler een goed product en wenst u het aan te schaffen? Gebruik de volgende promocodes en krijg een aangename korting:<br/><br/> <strong>D3M02BR0NZ3</strong> (Korting voor brons-pakket)<br/> <strong>D3M02S1LV3R</strong> (Korting voor zilver pakket)<br/> <strong>D3M02G0LD</strong> (Korting voor gouden pakket)<br/> <strong>D3M02PL4T1NUM</strong> (Korting voor platinum pakket)<br/> <strong>D3M02D14M0ND</strong> (Korting voor diamanten pakket)<br/> <br/>Hartelijk dank om pgModeler te testen! - - - + save opslaan - + export exporteer - + diff diff - + Executing pending <strong>%1</strong> operation... De uitvoer wacht op <strong>%1</strong> taak... @@ -6981,74 +6950,74 @@ Het bericht dat terugkwam van de DBMS is: `%1' Dialoogvenster - + msg - + Exceptions Uitzonderingen - + Show raw text errors or information. Toon technische error-tekst en -informatie. - + Show/hide exceptions stack. Toon/verberg uitzonderingsstack. - + ... - - + + &Yes &Ja - - + + &No &Nee - + Cancel Annuleren - + &Ok &OK - + &Cancel &Annuleren - + Error Fout - + Alert Waarschuwing - + Information Informatie - + Confirmation Bevestiging @@ -7096,592 +7065,667 @@ Het bericht dat terugkwam van de DBMS is: `%1' Opties - + Handles the following database model attributes in the metadata file: author, zoom factor, last position and default objects. - + Database model metadata - + Handles the objects' positioning in the metadata file. - + Objects' positioning - + Handles the objects' custom colors in the metadata file. Currently available only for relationships and schemas. - + Custom object's colors - - Handles the objects' protection status in the metadata file. + + Handles the objects' protection status in the metadata file. + + + + + Objects' protection status + + + + + Handles the objects' SQL disabled status in the metadata file. + + + + + Objects' SQL disabled status + + + + + Handles the objects' fade out status in the metadata file. - - Objects' protection status + + Objects' fade out status - - Handles the objects' SQL disabled status in the metadata file. + + Save tags to the output file when extracting metadata. When loading the file, the tags are recreated and duplicated ones are ignored. - - Objects' SQL disabled status + + Save textboxes to the output file when extracting metadata. When loading the file, the textboxes are recreated and duplicated ones are ignored. - + Handles the objects' custom SQL commands in the metadata file. - + Custom SQL commands - - Save textboxes to the output file when extracting metadata. When loading the file textboxes are recreated and duplicated ones are ignored. + + Textbox objects - Textbox objects + Tag objects - - Save tags to the output file when extracting metadata. When loading the file tags are recreated and duplicated ones are ignored. + + Handles the tables' and views' extended attributes display status in the metadata file. - - Tag objects + + Tables' extended attributes display + + + + + Save generic SQL objects to the output file when extracting metadata. When loading the file, the objects are recreated and duplicated ones are ignored. + + + + + Generic SQL objects - + Backup file: - - + + Select file - + ... ... - - Apply to: + + Extracts the objects' metadata from the loaded models and apply to the current focused model. A backup file can be specified to where the focused model's current metadata will be saved. - - Operation: + + &Extract and restore + + + + + Extracts the objects metadata from one of the loaded models saving the info to a backup file. + + + + + Extract &only - - Extracts the objects metadata from one of the loaded models and apply to the current model. + + Reads the objects' metadata from a previously saved backup file and apply to the current model. - - Extract from a &model + + &Restore a backup file - - Reads the objects metadata from a previously saved backup file and apply to the current model. + + Apply to: - - Restore a bac&kup file + + Operation: - + Output Uitvoer - + Progress label... Vooruitgangslabel... - - + + model not saved yet - + The backup file cannot be the same as the input model! - + Extracting metadata to file `%1' - + Saving backup metadata to file `%1' - + Applying metadata from file `%1' - + Metadata processing aborted! - + Objects metadata file (*.omf);;All files (*.*) ModelDatabaseDiffForm - - - Database model diff - Databasemodel verschillen - - - - Generate diff from model - Genereer een diff op basis van het model - Settings Instellingen - - Input database - Invoerdatabase - - - + + Connection: Verbinding: - + + + Database: Database: - - Options - Opties - - - Ignores as many as possible errors on import step. This option generates a incomplete diff. - Negeer zoveel mogelijk fouten gedurende de invoer-stap. Deze optie genereerd een onvolledige diff. - - - + Ignore import errors Negeer importeerfouten - Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production server and always make a backup before use this options. - Maak de data van alle tabellen waarvan kolommen werden aangepast leeg. Dit kan nuttig zijn om fouten te vermijden die worden veroorzaakt door type-casting. <strong>PAS OP</strong> gebruik deze optie NIET op een productie-server en maak altijd een backup vooraleer deze opties te gebruiken. - - - - Trucate tables before alter columns - Trunceer de tabellen vooraleer de kolommen aan te passen - - - Import system (built in) objects. Use this if the import step is returning errors. - Importeer systeem- /ingebouwde objecten. Gebruik deze optie indien de importeer-stap fouten genereert. - - - + Import system objects Importeer systeemobjecten - Import extension objects. Use this if the import step is returning errors even importing built in ones. - Importeer uitbreidingsobjecten. Gebruik deze optie indien de importeer-stap fouten genereert. - - - + Import extension objects Importeer uitbreidingsobjecten - + For DROP command, the objects that depends on an object to be dropped will be deleted as well. For TRUNCATE command, tables that are linked to a table to be truncated will be truncate too. <strong>NOTE:</strong> this option can affect more objects than listed in the output or diff preview. Voor DROP commando's worden objecten die afhankelijk zijn van het object dat verwijderd wordt, ook verwijderd. Voor het TRUNCATE commando worden tabellen die gelinkt zijn aan de te trunceren tabel ook getrunceerd. <strong>LET OP:</strong> deze optie kan objecten beïnvloeden die niet in het uitvoer- of diff-voorbeeld opgenomen zijn. - + Drop or truncate in cascade mode Drop of trunceer in cascade modus - + Permissions already set on database objects will be kept.The ones configured on the model will be applied to the database. Machtigingen die reeds op databaseobjecten zijn toegepast zullen behouden blijven. De machtigingen die door het model worden gespecifieerd zullen worden toegepast op de database. - + Keep object's permissions Behoudt de machtigingen van het object - + Database cluster level objects like roles and tablespaces will not be dropped. Database cluster-niveau objecten zoals rollen en tablespaces zullen niet worden verwijderd. - + Keep cluster objects Behoudt clusterobjecten - + Recreate only unmodifiable objects Hercreeer enkel niet-aanpasbare objecten - Instead of use an ALTER command to modify certain kind of objects a DROP and CREATE will be used in order to do a full modification. This option does not affects database objects. - In plaats van een ALTER commando om een bepaald soort object aan te passen, wordt eerst een DROP en dan een CREATE gebruikt. Deze optie beïnvloedt geen database objecten. - - - + Force recreation of objects Forceer het heraanmaken van objecten - + Ignores errors generated by duplicated objects when exporting the diff to database. Negeer fouten die worden gegenereerd door duplicate objecten gedurende het exporteren van de diff naar de database. - + Ignore duplicity errors Negeer fouten omwille van duplicaten - + Serial columns are converted to integer and having the default value changed to <strong>nextval(sequence)</strong> function call. By default, a new sequence is created for each serial column but checking this option sequences matching the name on column's default value will be reused and will not be dropped. Seriële kolommen worden geconverteerd naar integers en hun standaardwaarde wordt ingesteld als een functieaanroep naar <strong>nextval(sequentie)</strong>. Normaal gezien wordt een nieuwe sequentie aangemaakt voor elke seriële kolom maar deze optie aanvinken zorgt ervoor dat sequenties die de naam van de kolom gebruiken worden hergebruikt in plaats van verwijderd. - + Reuse sequences on serial columns Hergebruik sequenties op seriële kolommen - + No command to rename the destination database will be generated even the model's name differ from database name. Behoudt de naam van de doeldatabase wanneer deze verschilt van de databasenaam in het model. - + Preserve database name Behoudt databasenaam - + Diff mode Diff modus - + Override the PostgreSQL version when generating the diff. The default is to use the same version as the input database. Zet de versie waarvoor de diff wordt gegenereerd expliciet zelf. Standaard wordt dezelfde versie gebruikt als de invoerdatabase. - + Use PostgreSQL: Gebruikt PostgreSQL: - + Compares the model and the input database storing the diff in a SQL file for later usage. Vergelijkt het model en de invoerdatabase en slaat het verschil op in een SQL bestand voor later gebruik. - Store in SQL file - Sla op in SQL bestand - - - + File: Bestand: - + Select output file Selecteer uitvoerbestand - + ... ... - + Compares the model and the input database generating a diff and applying it directly to the latter. <strong>WARNING:</strong> this mode causes irreversible changes on the database and in case of failure the original structure is not restored, so make sure to have a backup before proceed. Vergelijkt het model met de invoerdatabase en genereerd een diff die op die laatste wordt toegepast. <strong>PAS OP:</strong> deze modus veroorzaakt onherroepelijke veranderingen in de database en in geval van falen wordt de originele structuur niet hersteld, zorg ervoor dat u een backup hebt vooraleer u verdergaat. - Apply on server - Toepassen op de server - - - + Ignores as many as possible errors on import step. This option generates an incomplete diff. - + Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. - + Import system (built-in) objects. Use this if the import step is returning errors related to missing objects. - + Import objects created by extensions. Use this if the import step is returning errors even importing built in ones. - + Instead of use an ALTER command to modify certain kind of objects a DROP and CREATE will be used in order to do a full modification. This option does not affects the database object. - + Avoid the generation of DROP commands for objects that exists in database but not in the model. This is useful when diff a partial model against the complete database. - + Do not drop missing objects - + Store in S&QL file - + + Diff tool + + + + + Generate diff code + + + + + Source database + + + + + Current model: + + + + + (model) + + + + + Compare to + + + + Appl&y on server - + + Diff + Diff + + + + Froce the generation of DROP commands for columns and constraints that exist in database but not in the model. This is useful when diff a partial model against the complete database and the user needs to drop columns and constraint but preserve the rest of the objects. + + + + + Drop missing columns and constraints + + + + + Truncate tables before alter columns + + + + + Import && Export + + + + + Import + Importeren + + + + Export + Exporteer + + + + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. + + + + + Ignore error codes + + + + Output Uitvoer - + Changes: Aanpassingen: - + Cancel Annuleren - + Progress label... Vooruitgangslabel... - + Step label... Staplabel... - + <html><head/><body><p>Objects marked with an <span style=" font-weight:600;">ALTER</span> may not be effectively changed unless that the differences detected are in attributes that can be modified through ALTER commands otherwise no operationwill be performed or, if the force recreation is checked, the object will be dropped and created again.</p></body></html> <html><head/><body><p>Objecten die zijn aangeduid met <span style=" font-weight:600;">ALTER</span> kunnen mogelijkerwijs niet worden aangepast tenzij de gedetecteerde verschillen in de attribute liggen die kunnen worden aangepast via een ALTER commando; in alle andere gevallen zal geen actie worden ondernomen of, indien 'Forceer het heraanmaken van objecten' is aangevinkt, zal het object worden verwijderd en heraangemaakt.</p></body></html> - + Objects to be created Objecten die aangemaakt moeten worden - - - - + + + + 0 0 - + Objects to be dropped Objecten die verwijderd moeten worden - + Possible objects to be changed Objecten die mogelijkerwijs aangepast moeten worden - + Ignored objects (system ones or with sql disabled) Genegeerde objecten (systeemobjecten of objecten waarvan SQL is uitgeschakeld) - + Diff Preview Diff voorbeeld - + &Apply diff Diff &Toepassen - + &Generate &Genereer - + &Close &Sluiten - - + + Waiting process to start... Wachten op het starten van de taak... - - Importing database <strong>%1</strong>... - Bezig met het importeren van database <strong>%1</strong>... - - - - Comparing the model <strong>%1</strong> and database <strong>%2</strong>... - Bezig met het vergelijken van model <strong>%1</strong> en database <strong>%2</strong>... - - - + Confirmation Bevestiging - + <strong>WARNING:</strong> The generated diff is ready to be exported! Once started this process will cause irreversible changes on the database. Do you really want to proceed? <strong>PAS OP:</strong> De gegenereerde diff is klaar om geëxporteerd te worden! Eens gestart zal dit proces onherroepelijke veranderingen aanbrengen aan de database. Bent u zeker dat u wilt verdergaan? - + Apply diff Diff toepassen - + Preview diff Diff belijken - - Exporting diff to database <strong>%1</strong>... - Diff exporteren naar database <strong>%1</strong>... + + model not saved yet + + + + + (none) + + + + + Step %1/%2: Importing database <strong>%3</strong>... + + + + + Step %1/%2: Comparing <strong>%3</strong> and <strong>%4</strong>... + + + + + Step %1/%2: Exporting diff to database <strong>%3</strong>... + - + Diff process paused. Waiting user action... Het diff proces is gepauzeerd. Wachten op een actie van de gebruiker... - + Saving diff to file <strong>%1</strong> De diff wordt opgeslagen in het bestand <strong>%1</strong> - + Diff process sucessfully ended! Het diff proces werd succesvol beëindigd! - - + + No operations left. Er zijn geen operaties meer. - + Operation cancelled by the user. De operatie werd geannulleerd door de gebruiker. - + Process aborted due to errors! Het proces werd afgebroken omwille van fouten! - + -- SQL code purposely truncated at this point in demo version! - + -- No differences were detected between model and database. -- -- Er werden geen verschillen gedetecteerd tussen het model en de database. -- - + Error code <strong>%1</strong> found and ignored. Proceeding with export. Foutencode <strong>%1</strong> trad op en werd genegeerd. De export gaat voort. - + Save diff as... Sla diff op als... - + SQL code (*.sql);;All files (*.*) SQL Code (*.sql);;Alle bestanden (*.*) @@ -7690,10 +7734,6 @@ Het bericht dat terugkwam van de DBMS is: `%1' ModelExportForm - Model Export - Modelexport - - Export model Exporteer model @@ -7704,227 +7744,217 @@ Het bericht dat terugkwam van de DBMS is: `%1' Instellingen - + Database server Database server - + pgModeler ignores errors generated by duplicated objects and creates only that ones which does not exists in the database. This option may be used when an object was created after a previous model export. pgModeler negeert fouten die worden gegenereerd door duplicate objecten en creëert objecten die nog niet in de database bestaan. Deze optie kan worden gebruikt wanneer een object werd gecreëerd door een eerdere model export. - + Ignore object duplicity Negeer object-duplicaten - + Connection: Verbinding: - + PostgreSQL version in which the SQL code should be generated. It is recommended to select this option only when the version of the DBMS, somehow, is not identifiable or if you need to generate a specific version of SQL code for test purposes. De PostgreSQL versie waarvoor SQL code moet worden gegenereerd. Het is aangeraden om deze optie enkel in te stellen wanneer de versie niet automatisch kan worden bepaald of wanneer u een specifieke versie nodig hebt voor bijvoorbeeld test-doeleinden. - - + + PostgreSQL: PostgreSQL: - + + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. + + + + + Ignore error codes + + + + If <strong>DB</strong> is checked pgModeler will destroy the database if already exists on the server. When <strong>Objects</strong> is checked pgModeler will execute the DROP command attached to SQL-enabled objects. <strong>WARNING:</strong> this option leads to data loss so make sure to have a backup first. Indien <strong>DB</strong> aangevinkt is, zal pgModeler de database verwijderen indien deze reeds in de server bestaat. Indien <strong>Objecten</string> is aangevinkt zal pgModeler DROP commando's toevoegen aan de objecten waarvoor SQL is ingeschakeld. <strong>PAS OP:</strong> deze optie kan tot dataverlies leiden, zorg ervoor dat u een recente backup kan terugplaatsen. - + Drop: Verwijder: - + DB DB - Objects - Objecten - - - + pgModeler will destroy the database if already exists on the server. Make sure to have a backup before use this option because all data will be lost. pgModeler zal de database verwijderen indien deze reeds in de server aanwezig is. Zorg ervoor dat u een recente backup kan terugplaatsen indien nodig want alle data zal verloren gaan. - PNG Image - PNG Afbeelding - - - + Zoom: Zoom: - + Show grid Raster tonen - + Show delimiters Delimiters tonen - + Exporting the model page by page will generate files with a <strong>_p[n]</strong> suffix where <strong>n</strong> is the page id. Check if the current user has write permission on output folder. Het model pagina per pagina exportern genereert bestanden met de suffix <strong>_p[n]</strong> waarbij <strong>n</strong> de pagina id is. Zorg ervoor dat de huidige gebruiker schrijf-machtiging heeft in de uitvoermap. - + Page by page Pagina per pagina - - + + Select target file Selecteer doelbestand - - + + ... ... - Image: - Afbeelding: - - - + SQL file SQL bestand - - + + File: Bestand: - + Ob&jects - + Graphics file - - Image (PNG) - - - - + Type: Type: - - Vectorial (SVG) + + PostgreSQL version in which the SQL code should be generated + De PostgreSQL versie waarvoor SQL code moet worden gegenereerd + + + + I&mage (PNG) - - PostgreSQL version in which the SQL code should be generated - De PostgreSQL versie waarvoor SQL code moet worden gegenereerd + + &Vectorial (SVG) + - + Output Uitvoer - + Cancel Annuleren - + Progress label... Vooruitgangslabel... - + &Export &Exporteer - + &Close &Sluiten - + Error code <strong>%1</strong> found and ignored. Proceeding with export. Foutencode <strong>%1</strong> trad op en werd genegeerd. De export gaat voort. - + Initializing model export... Model export wordt geïnitialiseerd... - + Saving file '%1' Bestand `%1' wordt opgeslagen - - + + Exporting process aborted! Het export proces werd afgebroken! - + Export model as... Exporteer model als... - + SQL script (*.sql);;All files (*.*) - + Portable Network Graphics (*.png);;All files (*.*) - + Scalable Vector Graphics (*.svg);;All files (*.*) - SQL code (*.sql);;All files (*.*) - SQL Code (*.sql);;Alle bestanden (*.*) - - - PNG image (*.png);;All files (*.*) - PNG Afbeelding (*.png);;Alle bestanden (*.*) - - - + Exporting process canceled by user! Het export proces werd geannuleerd door de gebruiker! - + Exporting process sucessfuly ended! Het export proces werd succesvol beëindigt! @@ -7932,156 +7962,140 @@ Het bericht dat terugkwam van de DBMS is: `%1' ModelExportHelper - + Generating SQL code for PostgreSQL `%1' Bezig met het genereren van SQL code voor PostgreSQL `%1' - + Output SQL file `%1' successfully written. Het uitvoer-SQL bestand `%1' werd succesvol opgeslagen. - + Rendering objects to page %1/%2. Objecten worden gerendered naar pagina %1/%2. - + Output image `%1' successfully written. Uitvoerafbeelding `%1' werd succesvol opgeslagen. - + Exporting model to SVG file. - + SVG representation of database model - + SVG file generated by pgModeler - + Output file `%1' successfully written. - + Starting export to DBMS. De export naar het DBMS begint. - + PostgreSQL version detection overridden. Using version `%1'. PostgreSQL versie-detectie werd overschreven. Versie `%1' wordt gebruikt. - + PostgreSQL `%1' server detected. PostgreSQL `%1' server ontdekt. - + Generating temporary names for database, roles and tablespaces. De tijdelijke namen voor de database, rollen en tablespaces worden gegenereerd. - + Enabling the SQL code for database `%1' to avoid errors. SQL code voor de database `%1' wordt geactiveerd om fouten te vermijden. - + Ignoring object duplication errors. Duplicaten-fouten worden genegeerd. - + Ignoring the following error code(s): `%1'. De volgende foutencode(s) worden genegeerd: `%1' - + Trying to drop database `%1'. Proberen om database `%1' te verwijderen. - + Simulation mode activated. Simulatiemodus geactiveerd. - Creating object `%1' (%2). - Creëer object `%1' (%2). - - - Creating database `%1'. - Creëer database `%1'. - - - Connecting to database `%1'. - Verbinden met database `%1'. - - - + Generating SQL for `%1' objects... Genereren van SQL voor `%1' objecten... - + Destroying objects created on the server. Objecten aangemaakt op de server worden verwijderd. - + Restoring original names of database, roles and tablespaces. De originele namen van de database, rollen en tablespaces worden teruggezet. - Dropping object `%1' (%2). - Object `%1' (%2) wordt verwijderd. - - - - - + + + Creating object `%1' (%2) Object `%1' (%2) wordt aangemaakt. - + Creating database `%1' - + Connecting to database `%1' - + Renaming `%1' (%2) to `%3' - - + + Dropping object `%1' (%2) Object `%1' (%2) wordt verwijderd - + Changing object `%1' (%2) Object `%1' (%2) wordt aangepast. - + Running auxiliary command. Een hulpcommando wordt uitgevoerd. @@ -8159,18 +8173,6 @@ p, li { white-space: pre-wrap; } Fix tries: Correctiepogingen: - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Waiting process to start...</p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Wachten op het starten van het process...</p></body></html> - Select input file @@ -8230,30 +8232,22 @@ p, li { white-space: pre-wrap; } - + Alt+C - - Ctrl+Up - Ctrl+Op - Next model Volgende model - Ctrl+Down - Ctrl+Neer - - - + Close model Sluit model - + ... ... @@ -8267,127 +8261,131 @@ p, li { white-space: pre-wrap; } ModelObjectsWidget - Model Objects Modelobjecten - + + Visible object types + + + + Hide this widget Verberg dit widget - - - - - - + + + + + + ... ... - + 1 1 - + ID ID - + Object Object - + Type Type - + Parent Object Ouder Object - + Parent Type Ouder Type - - Visible Object Types - Zichtbare Object Types - - - + Select All Selecteer Alles - + Clear All Alles Wissen - + + Model objects + + + + Select Selecteer - + Return Keer terug - + Cancel Annuleren - + Esc Esc - + Tree view Boomstructuur - + List view Lijst - + Objects view configuration Object-overzichtsconfiguratie - + Expands all items Alle items uitklappen - + Collapses all items Alle items inklappen - + Filter: Filter: - + By ID Volgens ID - + New Nieuw @@ -8399,6 +8397,12 @@ p, li { white-space: pre-wrap; } Model overview Modeloverzicht + + + Failed to generate the overview image. +The requested size %1 x %2 was too big and there was not enough memory to allocate! + + ModelRestorationForm @@ -8452,20 +8456,16 @@ p, li { white-space: pre-wrap; } &Restore &Herstel - - Modified: %1 - Aangepast: %1 - ModelValidationHelper - + There are pending errors! SQL validation will not be executed. Er zijn fouten! SQL validatie zal niet worden uitgevoerd. - + Operation canceled by the user. De operatie werd geannuleerd door de gebruiker. @@ -8478,143 +8478,123 @@ p, li { white-space: pre-wrap; } Venster - + Enables the validation of SQL code in DBMS. This process requires the use of a pre-configured connection. SQL validation will occur only in the last step (when all objects were validated) or when there are no warnings. - + Connection to be used in the SQL validation - + pgModeler will generate unique and temporary names for database, role and tablespace objects. This option avoids object duplication errors when running the SQL validation. - + Use unique temporary names for cluster level objects - + Warnings: does not prevents model to be saved. Let op: dit voorkomt niet dat het model kan worden opgeslagen. - - + + 0 0 - + Errors: model will not be saved while there are validation errors. Fouten: het model zal niet worden opgeslagen zolang er validatiefouten zijn. - + Hide this widget Verberg dit widget - + ... ... - Use unique temporary names for database, role and tablespace objects - Gebruik unieke namen voor de database, rollen en tablespace objecten - - - Enable validation of SQL code on DBMS (requires connection) - Activeer validatie van SQL code op het DBMS (vereist een verbinding) + + Swap ids + - + SQL Validation: SQL Validatie: - Connection alias - Verbindingsalias - - - + PostgreSQL version PostgreSQL versie - SQL validation, if enabled, will occur only on the last step or when there are no warnings. - Wanneer SQL validatie is geactiveerd, zal deze enkel worden uitgevoerd als laatste stap of wanneer er geen waarschuwingen zijn. - - - Using temporary names will avoid object duplication errors when running the SQL validation. - Tijdelijke namen gebruiken vermijdt object-duplicatiefouten wanneer SQL validatie wordt uitgevoerd. - - - + Try to resolve the reported issues. Probeer om de gerapporteerde problemen te verhelpen. - - Apply Fix - Verhelp - - - + Ctrl+S Ctrl+S - + Clear validation results Validatieresultaten leegmaken - + Clear Leegmaken - + Try to apply a fix on the selected validation info. Probeer de validatieinformatie te verhelpen. - + Options Opties - + Cancel the SQL validation in progress. Annuleer de lopende SQL validatie. - + Cancel Annuleren - + Esc Esc - - Change the creation order for two objects by swapping their ids - Wijzig de aanmaak-volgorde voor twee objecten door hun ids om te wisselen + + Apply fixes + - - Swap Ids - Wissel Ids om + + Change the creation order for two objects by swapping their ids + Wijzig de aanmaak-volgorde voor twee objecten door hun ids om te wisselen - + Va&lidate Va&lideer @@ -8624,76 +8604,82 @@ p, li { white-space: pre-wrap; } Autodetecteer - + The object <strong>%1</strong> <em>(%2)</em> [id: %3] is being referenced by <strong>%4</strong> object(s) before its creation. Het object <strong>%1</strong> <em>(%2)</em> [id: %3] wordt door <strong>%4</strong> object(en) gerefereerd vóór zijn aanmaak. - + The object <strong>%1</strong> <em>(%2)</em> [id: %3]%4 is referencing columns created by <strong>%5</strong> relationship(s) but is created before them. Het object <strong>%1</strong> <em>(%2)</em> [id: %3]%4 refereerd naar kolommen aangemaakt door <strong>%5</strong> relatie(s) maar wordt vóór deze aangemaakt. - + The object <strong>%1</strong> <em>(%2)</em> has a name that conflicts with <strong>%3</strong> object's name(s). Het object <strong>%1</strong> <em>(%2)</em> heeft een naam die conflicteerd met de naam van <strong>%3</strong> andere objecten. - + The relationship <strong>%1</strong> [id: %2] is in a permanent invalidation state and needs to be relocated. De relatie <strong>%1</strong> [id: %2] is in een permanente ongeldige staat en moet worden herplaats. - + SQL validation failed due to error(s) below. <strong>NOTE:</strong><em> These errors does not invalidates the model but may affect operations like <strong>export</strong> and <strong>diff</strong>.</em> SQL validatie faalde omwille van de volgende fouten. <strong>LET OP:</strong><em> Deze fouten ontkrachten het model niet maar kunnen <strong>export</strong> en <strong>diff</strong> beïnvloeden.</em> - <strong>HINT:</strong> try to swap the mentioned relationship by another one in order to solve this situation. Note that other objects may be lost in this process. - <strong>HINT:</strong> probeer om de vermeldde relatie om te wisselen met een andere relatie om dit probleem trachten te verhelpen maar wees ervan bewust dat dit ervoor kan zorgen dat bepaalde andere objecten verloren gaan in het process. + + The column <strong>%1</strong> on <strong>%2</strong> <em>(%3)</em> is referencing the geospatial data type <strong>%4</strong> but the <strong>postgis</strong> extension is not present in the model! + - + <strong>HINT:</strong> try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process. - + + <strong>HINT:</strong> Create the extension in the model or let it be created by applying the needed fixes. + + + + <em>The above object was created by a relationship. Change the name pattern on it's generator relationship. Fix will not be applied!</em> <em>Het hierboven vermeldde object werd aangemaakt door een relatie. Verander het naamspatroon van de genererende relatie. Dit probleem kan niet automatisch worden verholpen!</em> - + Conflicting object: <strong>%1</strong> <em>(%2)</em>. Conflicterende object: <strong>%1</strong> <em>(%2)</em>. - + Relationship: <strong>%1</strong> [id: %2]. Relatie: <strong>%1</strong> [id: %2]. - + Referrer object: <strong>%1</strong> <em>(%2)</em> [id: %3]. Refererende object: <strong>%1</strong> <em>(%2)</em> [id: %3]. - + SQL validation not executed! No connection defined. - + Database model successfully validated. Het database model werd succesvol gevalideerd. - + Running SQL commands on server... De SQL commando's worden uitgevoerd op de server... - + Processing object: %1 Bezig met het verwerken van object: %1 @@ -8701,397 +8687,510 @@ p, li { white-space: pre-wrap; } ModelWidget - + One to One (1-1) Een-op-een (1-1) - + One to Many (1-n) Een op meer (1-n) - + Many to Many (n-n) Meer op meer (n-n) - - + + Copy Kopieer - Generalization - Generalisatie - - - + Inheritance Overerving - + <strong>ATTENTION:</strong> The database model is protected! Operations that could modify it are disabled! <strong>OPGELET:</strong> Het databasemodel is beschermd! Operaties die het zouden kunnen aanpassen zijn uitgeschakeld! - + Source Bron - + Alt+S Alt+S - + Show object source code Toon object broncode - - + + Properties Eigenschappen - + Space Spatie - + Edit the object properties Bewerk de eigenschappen van het object - - + + Protect Bescherm - - + + Unprotect Bescherming af - + Protects object(s) from modifications Beschermt object(en) tegen aanpassingen - - + + Delete Verwijderen - + Del Del - - + + Del. cascade Verwijder cascade - + Shift+Del Shift+Del - + Select all Selecteer Alles - + + Select tagged + + + + + Select + Selecteer + + + Ctrl+A Ctrl+A - + Selects all the graphical objects in the model Selecteert alle grafische objecten in het model - + + Edit data + + + + Convert Converteer - + Ctrl+C Ctrl+C - + Paste Plakken - + Ctrl+V Ctrl+V - + Cut Knippen - + Ctrl+X Ctrl+X - + Deps && Referrers Afhankelijkheden && Verwijzers - + New Nieuw - + Add a new object in the model Voeg een nieuw object toe aan het model - + Quick Snel - + Quick action for the selected object Snelle actie voor het geselecteerde object - + Rename Hernoem - + F2 F2 - + Quick rename the object Snelle hernoeming van het object - + Move to schema Verplaats naar schema - + Set tag Zet tag - + Edit permissions Machtigingen aanpassen - + Ctrl+E Ctrl+E - + Change owner Eigenaar veranderen - + Select children Selecteer kinderen - - Highlight - Licht op - - - + Open relationship Open relatie - + Custom SQL Aangepaste SQL - + Alt+Q Alt+Q - + Convert to sequence Converteer naar sequentie - + Convert to serial Converteer naar serieel - + Break line Nieuw lijn - + Remove points Verwijder punten - + Enable SQL Schakel SQL in - + Disable SQL Schakel SQL uit - + + Duplicate + + + + + Ctrl+D + + + + + Extended attributes + + + + + + Show + + + + + + Hide + + + + + Jump to table + + + + + Schemas rectangles + + + + + Fade in/out + + + + + + Fade in + + + + + + Fade out + + + + + + + Relationships + Relaties + + + + Swap ids + + + + + Edit the objects creation order by swapping their ids + + + + 90° (vertical) 90° (vertikaal) - + 90° (horizontal) 90° (horizontaal) - + 90° + 90° (vertical) 90° + 90° (vertikaal) - + 90° + 90° (horizontal) 90° + 90° (horizontaal) - + + + + All objects + + + + + + Schemas + + + + + + Tables + Tabellen + + + + + Views + + + + + + Textboxes + + + + Zoom: %1% Zoom: %1% - + Do you really want to convert the relationship into an intermediate table? Bent u zeker dat u de relatie wilt converteren naar een intermediaire tabel? - + Loading database model Het databasemodel wordt geladen - + Saving database model Het databasemodel wordt opgeslagen - + Do you want to %1 the selected schema's children too? - + protect - + unprotect - + Also copy all dependencies of selected objects? This minimizes the breakdown of references when copied objects are pasted into another model. Wenst u alle afhankelijken van de geselecteerde objecten ook te kopiëren? Dit minimalizeert het verbreken van referenties wanneer gekopieerde objecten in een ander model worden geplakt. - + Pasting objects... Bezig met het plakken van objecten... - + Validating object: `%1' (%2) Bezig met het valideren van object: `%1' (%2) - + Generating XML for: `%1' (%2) Bezig met het genereren van XML voor: `%1' (%2) - + Pasting object: `%1' (%2) Bezig met het plakken van object: `%1' (%2) - + Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details! Niet alle objecten werden in het model geplakt omwille van fouten die werden gegenereerd gedurende dit proces. Kijk de error-stack na voor meer details! - + <strong>CAUTION:</strong> You are about to delete objects in cascade mode which means more objects than the selected will be dropped too. Do you really want to proceed? <strong>PAS OP:<strong> U staat op het punt om objecten te verwijderen in cascade modus, dit betekent dat ook objecten die niet geselecteerd zijn verwijderd kunnen worden. Bent u zeker dat u wilt verdergaan? - + <strong>CAUTION:</strong> Remove multiple objects at once can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? <strong>PAS OP:</strong> Meerdere objecten in één keer verwijderen kan onherroepbare ongeldigheden veroorzaken in andere objecten binnen het model en ervoor zorgen dat deze objecten ook worden verwijderd. Bent u zeker dat u verder wenst te gaan? - + <strong>CAUTION:</strong> Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? <strong>PAS OP:</strong> Een relatie verwijderen kan onherroepbare ongeldigheden veroorzaken in andere objecten en ervoor zorgen dat deze objecten ook worden verwijderd. Bent u er zeker van dat u wenst verder te gaan? - + Do you really want to delete the selected object? Bent u er zeker van dat u het geselecteerde object wenst te verwijderen? - + The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details. Het cascade verwijderen kwam enkele problemenen tegen tijdens het uitvoeren! Sommige objecten konden niet worden verwijderd of geregistreerd in de actie-geschiedenis! Gelieve de error-stack na te kijken voor meer details. - + (no objects) (geen objecten) - + + None + + + + Source code Broncode - + Constraints Constraints @@ -9099,39 +9198,35 @@ p, li { white-space: pre-wrap; } ModelsDiffHelper - + Processing object `%1' (%2)... Object `%1' wordt behandeld (%2)... - + Skipping object `%1' (%2)... Object `%1' wordt overgeslagen (%2)... - + Processing diff infos... Diff informatie wordt verwerkt... - + Processing `%1' info for object `%2' (%3)... `%1' informatie voor object `%2' wordt verwerkt (%3)... - + No differences between the model and database. - + Preparing diff code... - - Comparison between model and database finished. - De vergelijking tussen het model en de database is voltooid. - NewObjectOverlayWidget @@ -9141,119 +9236,119 @@ p, li { white-space: pre-wrap; } Venster - + Role Rol - + Tag Tag - + Cast Cast - - + + A A - + Language Taal - + Textbox Tekst box - + Event Trigger Event Trigger - + Tablespace Tablespace - + Schema Schema - + Domain Domein - + Conversion Conversie - + Aggregate Aggregator - + Collation Sortering - + Table Tabel - + Type Type - + Op. Family Op. Familie - + Sequence Sequentie - + Extension Uitbreiding - + Function Functie - + Op. Class Op. Klasse - + Operator Operator - + View View - - + + Permissions Machtigingen @@ -9263,202 +9358,218 @@ p, li { white-space: pre-wrap; } Regel - + Index Index - + Column Kolom - + Constraint Constraint - + + Generic SQL + + + + Trigger Trigger - + + Policy + + + + Many-to-many Meer-op-meer - + One-to-many Een-op-meer - + One-to-one Een-op-een - + Inheritance Overerving - + Copy Kopieer - + G G - + K K - + H H - + J J - + D D - + E E - + F F - + L L - + O O - + U U - + I I - + R R - + S S - + Q Q - + T T - + P P - + M M - + Y Y - + W W - + + 9 9 - + Z Z - + X X - + C C - + V V - + B B - + + 8 + 8 + + + 1 1 - + 2 2 - + 3 3 - + 5 5 - + 4 4 - + 0 0 @@ -9466,84 +9577,125 @@ p, li { white-space: pre-wrap; } NumberedTextEditor - + + Load + Laden + + + + Load the object's source code from an external file + + + + + Edit + + + + + Edit the source code in the preferred external editor + + + + + Clear + Leegmaken + + + Upper case - + Lower case - + Ident right - + Ident left + + + SQL file (*.sql);;All files (*.*) + SQL Code (*.sql);;Alle bestanden (*.*) + + + + Load file + + + + + The source editor `%1' is running on `pid: %2'. + + + + + Could not start the source code editor application `%1'! Make to sure that the source editor path defined in the general settings points to a valid executable and the current user has permission to run the application. Error message returned: `%2' + + ObjectDepsRefsWidget - - Form - Venster - Dependencies Afhankelijken - - + + ID ID - - + + Object Object - - + + Type Type - - + + Parent Object Ouder Object - - + + Parent Type Ouder Type - + Exclude indirect dependencies Sluit indirecte afhankelijken uit - + References Referenties - + Include indirect references Neem indirecte afhankele op - + This object does not exists anymore. The dependencies and references listing are disabled. Dit object bestaat niet langer. Het lijsten van afhankelijken en referenties is uitgeschakeld. @@ -9561,113 +9713,135 @@ p, li { white-space: pre-wrap; } Venster - + Pattern: Patroon: - + Find Zoek - + Defines the search filter Definieert de zoekfilter - + Filter Filter - + Clears the search results Maakt de zoekresultaten leeg - + Clear Leegmaken - - Highlight graphical objects when selecting them or their children on the result list - Licht grafische objecten op wanneer deze of hun kinderen geselecteerd worden in de resultatenlijst - - - - Highlight - Licht op - - - - + + ... ... - + Hide this widget Verberg dit widget - + + (Un)selects the graphical objects in the results grid + + + + + Select + Selecteer + + + Regular Expression Regular expression - + Exact Match Exacte Overeenkomst - + Select All Selecteer Alles - + Clear All Alles Wissen - + Case Sensitive Hoofdlettergevoelig - + ID ID - + Object Object - + Type Type - + Parent Object Ouder Object - + Parent Type Ouder Type - + + Fades outs all the graphical objects in the results grid (or those not listed). The current fade in/out state of all objects is modified. + + + + + Fade out + + + + + + Listed + + + + + + Not listed + + + + Found <strong>%1</strong> object(s). <strong>%1</strong> object(en) gevonden. - + No objects found. Geen objecten gevonden. @@ -9719,144 +9893,142 @@ p, li { white-space: pre-wrap; } Selecteer Object - + Select %1 - ObjectTableWidget + ObjectsTableWidget - + Form - Venster + Venster - + Add Item - Item Toevoegen + Item Toevoegen - + Ins - Ins + Ins - + Remove Item - Item Verwijderen + Item Verwijderen - + Del - Del + Del - + Update Item - Item Updaten + Item Updaten - + Alt+R - Alt+R + Alt+R - + Remove All - Alles Verwijderen + Alles Verwijderen - + Shift+Del - Shift+Del + Shift+Del + + + + Duplicate item + + + + + Ctrl+D + - + Edit Item - Item Aanpassen + Item Aanpassen - + Space - Spatie + Spatie - + Move Up - Naar Boven + Naar Boven - + Ctrl+Up - Ctrl+Up + - + Move Down - Naar Beneden + Naar Beneden - + Ctrl+Down - Ctrl+Down + - + Move to start - Naar de eerste plaats + Naar de eerste plaats - + Ctrl+Home - Ctrl+Home + Ctrl+Home - + Move to end - Naar de laatste plaats + Naar de laatste plaats - + Ctrl+End, Ctrl+S - Ctrl+End, Ctrl+S + Ctrl+End, Ctrl+S - Confirmação - Bevestiging + + + Confirmation + Bevestiging - + Do you really want to remove the selected item? - Bent u zeker dat u het geselecteerde item wilt verwijderen? - - - - - Confirmation - Bevestiging + Bent u zeker dat u het geselecteerde item wilt verwijderen? - - Do you really want to remove the all items? - Bent u zeker dat u alle items wilt verwijderen? + + Do you really want to remove all the items? + OperationList - + (invalid object) (ongeldig object) - - Undoing change on object `%1' (%2). - Aanpassingen op object `%1' ongedaan maken (%2). - - - Redoing change on object `%1' (%2). - Aanpassingen op object `%1' opnieuw topassen (%2). - OperationListWidget @@ -9913,65 +10085,53 @@ p, li { white-space: pre-wrap; } Opnieuw doen - + Object: %1 Object: %1 - + Name: %1 Naam: %1 - + created aangemaakt - + removed verwijderd - + modified aangepast - + moved verplaatst - + Operation: %1 Actie: %1 - Undoing operations... - Acties ongedaan maken... - - - Redoing operations... - Acties opnieuw uitvoeren... - - - + Operation history exclusion Actiegeschiedenisuitsluiting - + Delete the executed operations history is an irreversible action, do you want to continue? Het verwijderen van de geschiedenis van de uitgevoerde acties kan niet worden ongedaan gemaakt, bent u zeker dat u wilt verdergaan? OperatorClassWidget - - Form - Venster - Default Class: @@ -10056,10 +10216,6 @@ p, li { white-space: pre-wrap; } OperatorFamilyWidget - - Form - Venster - Indexing: @@ -10068,10 +10224,6 @@ p, li { white-space: pre-wrap; } OperatorWidget - - Form - Venster - MERGES @@ -10140,10 +10292,6 @@ p, li { white-space: pre-wrap; } ParameterWidget - - Form - Venster - Default Value: @@ -10172,10 +10320,6 @@ p, li { white-space: pre-wrap; } PermissionWidget - - Form - Venster - @@ -10193,499 +10337,763 @@ p, li { white-space: pre-wrap; } Niet-uitvoerbare SQL code - - - Roles - Rollen + + + Roles + Rollen + + + + + Privileges + Machtiginen + + + + Edit permissions + Machtigingen aanpassen + + + + &Grant + + + + + Re&voke + + + + + Cascade + Cascade + + + + Privilege + Machtiging + + + + GRANT OPTION + GRANT OPTION + + + + Add Permission + Machtiging toekennen + + + + Update Permission + Machtiging aanpassen + + + + Cancel Operation + Actie annuleren + + + + Code Preview + Codevoorbeeld + + + + Id + Id + + + + Name + Naam + + + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + + + + + -- No permissions defined for the specified object! + -- Er zijn geen machtigingen gedefinieerd voor het gespecifieerde object! + + + + /* Could not generate the SQL code preview for permissions! + /* Er kon geen SQL Codevoorbeeld worden gegenereerd voor de machtigingen! + + + + PgModelerCLI + + + Unrecognized option '%1'. + Niet-herkende optie '%1'. + + + + Value not specified for option '%1'. + Er is geen waarde gespecifieerd voor optie '%1'. + + + + Option '%1' does not accept values. + Optie '%1' aanvaardt geen waardes. + + + + Usage: pgmodeler-cli [OPTIONS] + Gebruik: pgmodeler-cli [OPTIES] + + + + + command line interface. + commandolijn interface. + + + + General options: + Algemene opties: + + + + PNG and SVG export options: + + + + + DBMS export options: + DBMS exporteringsopties: + + + + Miscellaneous options: + Andere opties: + + + + There are no connections configured. + Er zijn geen verbindingen geconfigureerd. + + + + Input file must be different from output! + Het invoerbestand mag niet hetzelfde zijn als het uitvoerbestand! + + + + Incomplete connection information! + Onvolledige verbindingsinformatie! + + + + Invalid zoom specified! + Een ongeldige zoom gespecifieerd! + + + + Invalid action specified to update mime option! + The actie om de mime optie the updaten is ongeldig! + + + + Starting model fixing... + Modelcorrectie begint... + + + + Starting mime update... + Mime update begint... + + + + Starting model export... + Model export begint... + + + + Model successfully fixed! + Het model werd succesvol gecorrigeerd! + + + + Connection aliased as '%1' was not found in the configuration file. + + + + + PostgreSQL Database Modeler Project - pgmodeler.io + + + + + Copyright 2006-2018 Raphael A. Silva <raphael@pgmodeler.io> + + + + + This CLI tool provides several operations over models and databases without the need to perform them +in pgModeler's graphical interface. All available options are described below. + + + + + %1, %2 [FILE] Input model file (.dbm). This is mandatory for fix, export operations. + + + + + %1, %2 [DBNAME] Input database name. This is mandatory for import operation. + + + + + %1, %2 [FILE] Output file. This is mandatory for fixing model or exporting to file, png or svg. + + + + + %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + + + + + %1, %2 [NUMBER] Model fix tries. When reaching the maximum count the invalid objects will be discarded. + + + + + %1, %2 Export the input model to a sql script file. + + + + + %1, %2 Export the input model to a png image. + + + + + %1, %2 Export the input model to a svg file. + + + + + %1, %2 Export the input model directly to a PostgreSQL server. + + + + + %1, %2 Import a database to an output file. + + + + + %1, %2 Compares a model and a database or two databases generating the SQL script to synch the latter in relation to the first. + + + + + %1, %2 Force the PostgreSQL version of generated SQL code. + - - - Privileges - Machtiginen + + %1, %2 Silent execution. Only critical messages and errors are shown during process. + - Grant - GRANT + + %1, %2 Show this help menu. + - Revoke - REVOKE + + Connection options: + - - Edit permissions - Machtigingen aanpassen + + %1, %2 List available connections in file %3. + - - &Grant + + %1, %2 [ALIAS] Connection configuration alias to be used. - - Re&voke + + %1, %2 [HOST] PostgreSQL host in which a task will operate. - - Cascade - Cascade + + %1, %2 [PORT] PostgreSQL host listening port. + - - Privilege - Machtiging + + %1, %2 [USER] PostgreSQL username. + - - GRANT OPTION - GRANT OPTION + + %1, %2 [PASSWORD] PostgreSQL user password. + - - Add Permission - Machtiging toekennen + + %1, %2 [DBNAME] Connection's initial database. + - - Update Permission - Machtiging aanpassen + + %1, %2 Draws the grid in the exported image. + - - Cancel Operation - Actie annuleren + + %1, %2 Draws the page delimiters in the exported image. + - - Code Preview - Codevoorbeeld + + %1, %2 Each page will be exported in a separated png image. (Only for PNG images) + - - Type: - Type: + + %1, %2 [FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images) + - - Role - Rol + + %1, %2 Ignores errors related to duplicated objects that eventually exist in the server. + - - Id - Id + + %1, %2 [CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided. + - - Leave the <em><strong>Roles</strong></em> empty to create a permission applicable to <strong><em>PUBLIC</em></strong>. - Laat de <em><strong>Rollen</strong></em> leeg om een machtiging aan te maken die op <strong><em>PUBLIC</em></strong> van toepassing is. + + %1, %2 Drop the database before execute a export process. + - - -- No permissions defined for the specified object! - -- Er zijn geen machtigingen gedefinieerd voor het gespecifieerde object! + + %1, %2 Runs the DROP commands attached to SQL-enabled objects. + - - /* Could not generate the SQL code preview for permissions! - /* Er kon geen SQL Codevoorbeeld worden gegenereerd voor de machtigingen! + + %1, %2 Simulates an export process by executing all steps but undoing any modification in the end. + - - - PgModelerCLI - - Unrecognized option '%1'. - Niet-herkende optie '%1'. + + %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + - - Value not specified for option '%1'. - Er is geen waarde gespecifieerd voor optie '%1'. + + Database import options: + - - Option '%1' does not accept values. - Optie '%1' aanvaardt geen waardes. + + %1, %2 Ignore all errors and try to create as many as possible objects. + - - Connection aliased as '%1' was not found on configuration file. - De verbindingsalias '%1' werd niet teruggevonden in het configuratiebestand. + + %1, %2 Import system built-in objects. This option causes the model bloating due to the importing of unneeded objects. + - - Usage: pgmodeler-cli [OPTIONS] - Gebruik: pgmodeler-cli [OPTIES] + + %1, %2 Import extension objects. This option causes the model bloating due to the importing of unneeded objects. + - - - command line interface. - commandolijn interface. + + %1, %2 Run import in debug mode printing all queries executed in the server. + - - PostgreSQL Database Modeler Project - pgmodeler.com.br - PostgreSQL Database Modelling Project - pgmodeler.com.br + + Diff options: + - - Copyright 2006-2015 Raphael A. Silva <raphael@pgmodeler.com.br> - Copyright 2006-2015 Raphael A. Silva <raphael@pgmodeler.com.br> + + %1, %2 [DBNAME] The database used in the comparison. All the SQL code generated is applied to it. + - This CLI tool provides the operations to export pgModeler's database models without -the need to load them on graphical interface as well to fix model files to the most recent -accepted structure. All available options are described below. - Dit CLI tool maakt het mogelijk om pgModeler database modellen te exporteren zonder -deze in de grafische interface te hoeven laden alsook om modellen te herstellen naar de -laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschreven. + + %1, %2 Save the generated diff code to output file. + - - General options: - Algemene opties: + + %1, %2 Apply the generated diff code on the database server. + - - %1, %2=[FILE] Input model file (.dbm). Mandatory use when fixing a model or exporting it. - %1, %2=[BESTAND] Input model bestand (.dbm). Verplicht wanneer een model wordt geïmporteerd or hersteld. + + %1, %2 Don't preview the generated diff code when applying it to the server. + - - %1, %2=[FILE] Output file. Mandatory use when fixing model or export to file or png. - %1, %2=[BESTAND] Uitvoerbestand. Verplicht wanneer een model wordt hersteld of geexporteerd naar een bestand of PNG. + + %1, %2 Drop cluster level objects like roles and tablespaces. + - - %1, %2 Try to fix the structure of the input model file in order to make it loadable again. - %1, %2 Probeer de structuur van het invoerbestand te herstellen zodat het opnieuw kan worden geladen. + + %1, %2 Revoke permissions already set on the database. New permissions configured in the input model are still applied. + - - %1, %2 Model fix tries. When reaching the maximum count the invalid objects will be discard. - %1, %2 Aantel herstelpogingen. Na het bereiken van deze limiet worden ongeldige objecten verwijderd. + + %1, %2 Drop missing objects. Generates DROP commands for objects that are present in the input model but not in the compared database. + - - %1, %2 Export to a sql script file. - %1, %2 Exporteer naar een sql script bestand. + + %1, %2 Force the drop of missing columns and constraints. Causes only columns and constraints to be dropped, other missing objects aren't removed. + - - %1, %2 Export to a png image. - %1, %2 Exporteer naar een PNG afbeelding. + + %1, %2 Rename the destination database when the names of the involved databases are different. + - - %1, %2 Export directly to a PostgreSQL server. - %1, %2 Exporteer direct naar een PostgreSQL server. + + %1, %2 Don't drop or truncate objects in cascade mode. + - - %1, %2 List available connections on %3 file. - %1, %2 Toon de beschikbare verbindingen in bestand %3. + + %1, %2 Truncate tables prior to alter columns. Avoids errors related to type casting when the new type of a column isn't compatible to the old one. + - - %1, %2 Version of generated SQL code. Only for file or dbms export. - %1, %2 Versie voor de gegenereerde SQL code. ENkel geldig bij bestands- of DBMS export. + + %1, %2 Don't reuse sequences on serial columns. Drop the old sequence assigned to a serial column and creates a new one. + - - %1, %2 Silent execution. Only critical errors are shown during process. - %1, %2 Stille uitvoer. Enkel kritische fouten worden getoond tijdens het proces. + + %1, %2 Don't force the recreation of objects. Avoids the usage of a DROP and CREATE commands to create a new version of the objects. + - - %1, %2 Show this help menu. - %1, %2 Toon deze helpmenu. + + %1, %2 Don't recreate the unmodifiable objects. These objects are the ones which can't be changed via ALTER command. + - PNG export options: - PNG exporteeringsopties: + + %1, %2 [ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + - - %1, %2 Draws the grid on the exported png image. - %1, %2 Tekent het raster in de geexporteerde PNG afbeelding. + + ** The diff process allows the usage of the following options related to import and export operations: + - - %1, %2 Draws the page delimiters on the exported png image. - %1, %2 Tekent de paginamarkering op de geexporteerde PNG afbeelding. + + * Export: + - %1, %2 Each page will be exported on a separated png image. - %1, %2 Elke pagina wordt als apparte PNG afbeelding geexporteerd. + + * Import: + - %1, %2=[FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 - %1, %2=[FACTOR] Past een zoom (in procent) toe vooraleer te exporteren naar PNG afbeelding. Geaccepteerde zoomintervals: %3-%4 + + ** When running the diff using two databases (%1 and %2) there's the need to specify two connections/aliases. + - - This CLI tool provides the operations to export pgModeler's database models without - the need to load them on graphical interface as well to fix model files to the most recent - accepted structure. All available options are described below. + + If only one connection is set it will be used to import the input database as well to retrieve database used in the comparison. - - %1, %2 Export to a svg file. + + A second connection can be specified by appending a 1 on any connection configuration parameter listed above. - - PNG and SVG export options: + + Available connections (alias : connection string) - - %1, %2 Each page will be exported on a separated png image. (Only for PNG) + + No operation mode was specified! - - %1, %2=[FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG) + + Export, fix model, import database, diff and update mime operations can't be used at the same time! - - DBMS export options: - DBMS exporteringsopties: + + Multiple export mode was specified! + - - %1, %2 Ignores errors related to duplicated objects that eventually exists on server side. - %1, %2 Negeert fouten omwille van duplicate objecten die uiteindelijk op de server zullen bestaan. + + No input file was specified! + - - %1, %2 Drop the database before execute a export process. - %1, %2 Verwijder de database vooraleer het exporteringsprocess te starten. + + No input database was specified! + - - %1, %2 Runs the DROP commands attached to SQL-enabled objects. - %1, %2 Voert de DROP commando's uit die geassocieerd zijn met SQL-ingeschakelde objecten. + + No output file was specified! + - - %1, %2 Simulates a export process. Actually executes all steps but undoing any modification. - %1, %2 Simuleert het exporteringsprocess. Alle stappen worden uitgevoerd maar aanpassingen worden ongedaan gemaakt. + + No input file or database was specified! + - - %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. - %1, %2 Genereert tijdelijke namen voor databases, rollen en tablespaces wanneer simulatiemodus is gespecifieerd. + + The input file and database can't be used at the same time! + - - %1, %2=[ALIAS] Connection configuration alias to be used. - %1, %2=[ALIAS] Verbindingsconfiguratiealias diemoet worden gebruikt. + + No database to be compared was specified! + - - %1, %2=[HOST] PostgreSQL host which export will operate. - %1, %2=[HOST] PostgreSQL host waarnaar te exporteren. + + No diff action (save or apply) was specified! + - - %1, %2=[PORT] PostgreSQL host listening port. - %1, %2=[POORT] De poort waarop de PostgreSQL host luistert. + + No output file for the diff code was specified! + - - %1, %2=[USER] PostgreSQL username. - %1, %2=[GEBRUIKER] PostgreSQL gebruikersnaam. + + ** Error code `%1' found and ignored. Proceeding with export. + - - %1, %2=[PASSWORD] PostgreSQL user password. - %1, %2=[WACHTWOORD] PostgreSQL wachtwoord. + + ** Command: %1 + - - %1, %2=[DBNAME] Connection's initial database. - %1, %2=[DBNAAM] De verbinding's initiele database. + + Extracting objects' XML... + De XML van de objecten word geextraheerd... - - Miscellaneous options: - Andere opties: + + Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! + Het invoerbestand is ongeldig! Kijk na of dit bestand door pgModeler werd gegenereerd ofdat het bestand gecorrupteerd raakte! - - %1, %2=[ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. - %1, %2=[ACTIE] Behandelt de bestandsassociatie met .dbm bestanden. De ACTIE kan [%3 | %4] zijn. + + Recreating objects... + De objecten worden heraangemaakt... - - There are no connections configured. - Er zijn geen verbindingen geconfigureerd. + + +** Object(s) that couldn't fixed: + ** Object(en) die niet kon(den) worden gecorrigeerd: - - Available connections (alias : conn. string) - Beschikbare verbindingen (alias: conn. string) + + WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) + OPGEPAST: Er zijn objecten die niet konden worden gecorrigeerd. We proberen opnieuw... (poging %1 van %2) - - No export mode specified! - Er is geen exportmodus gespecifieerd! + + + Loading input file: %1 + - - Export, fix model and update mime operations can't be used at the same time! - 'Exporteer en corrigeer model' kan niet samen worden gebruikt met 'update the mime operaties'! + + Fixed model file: %1 + - - Multiple export mode specified! - Meerdere exportmodussen gespecifieerd! + + Export to PNG image: %1 + - - No input file specified! - Er werd geen invoerbestand gespecifieerd! + + Export to SVG file: %1 + - - No output file specified! - Er werd geen uitvoerbestand gespecifieerd! + + Export to SQL script file: %1 + - - Input file must be different from output! - Het invoerbestand mag niet hetzelfde zijn als het uitvoerbestand! + + Export to DBMS: %1 + - - Incomplete connection information! - Onvolledige verbindingsinformatie! + + Export successfully ended! + + - - Invalid zoom specified! - Een ongeldige zoom gespecifieerd! + + Starting database import... + - - Invalid action specified to update mime option! - The actie om de mime optie the updaten is ongeldig! + + + Input database: %1 + - - Starting model fixing... - Modelcorrectie begint... + + Saving the imported database to file... + - - Starting mime update... - Mime update begint... + + Import successfully ended! + + - - Starting model export... - Model export begint... + + Starting diff process... + - - Loading input file: - Bezig met het laden van invoerbestand: + + Input model: %1 + - - Fixed model file: - Het modelbestand werd gecorrigeerd: + + Compare to: %1 + - - Model successfully fixed! - Het model werd succesvol gecorrigeerd! + + Loading input model... + - - Mime database successfully updated. - De mime database werd succesvol geupdate. + + + Importing the database `%1'... + - - Export to PNG image: - Exporteren naar PNG afbeelding: + + Comparing the generated models... + - - Export to SVG file: + + No differences were detected. - - Export to SQL script file: - Exporteren naar SQL script bestand: + + Saving diff to file `%1' + - - Export to DBMS: - Exporteren naar DBMS: + + ** WARNING: You are about to apply the generated diff code to the server. Data can be lost in the process! + - - Export successfully ended! - De export is succesvol beëindigd! + + ** Proceed with the diff applying? (yes/no) > + - - Extracting objects' XML... - De XML van de objecten word geextraheerd... + + yes + - - Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! - Het invoerbestand is ongeldig! Kijk na of dit bestand door pgModeler werd gegenereerd ofdat het bestand gecorrupteerd raakte! + + + no + - - Recreating objects... - De objecten worden heraangemaakt... + + Diff code not applied to the server. + - - -** Object(s) that couldn't fixed: - ** Object(en) die niet kon(den) worden gecorrigeerd: + + Applying diff to the database `%1'... + - - WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) - OPGEPAST: Er zijn objecten die niet konden worden gecorrigeerd. We proberen opnieuw... (poging %1 van %2) + + Diff successfully ended! + + + + + + Mime database successfully updated! + + - + Database model files (.dbm) are already associated to pgModeler! Database modelbestanden (.dbm) zijn reeds geassocieerd met pgModeler! - + There is no file association related to pgModeler and .dbm files! Er is geen bestandsassociatie tussen pgModeler and .dbm bestanden! - + Mime database operation: %1 Mime databaseoperatie: %1 - + Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. Het bestand %1 kan niet worden verwijderd! Kijk na of de huidige gebruiker voldoende machtigingen heeft om het bestand te verwijderen en of het bestand bestaat. - + Running update-mime-database command... Het update-mime-database commando wordt uitgevoerd... @@ -10711,17 +11119,17 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr PgModelerUiNS - + Do you want to apply the <strong>SQL %1 status</strong> to the object's references too? This will avoid problems when exporting or validating the model. Wenst u de <strong> SQL %1 status</strong> ook toe te passen op de referenties van het object? Dit vermijdt problemen bij het exporteren of valideren van het model. - + disabling uitschakelen - + enabling inschakelen @@ -10817,7 +11225,7 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr [ ]: - + NONE GEEN @@ -10860,18 +11268,66 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr Bibliotheek + + PolicyWidget + + + Basics + + + + + Command: + + + + + Permissive + + + + + Roles + Rollen + + + + Expressions + Expressies + + + + USING: + + + + + CHECK: + + + + + Name + Naam + + + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + + + QObject - + new_database nieuwe_database - - - - + + + + %1 (line: %2) %1 (lijn %2) @@ -10917,158 +11373,178 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr Verbindingsmodus - - This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. - Deze modus is enkel beschikbaar voor <strong>one-to-one</strong>, <strong>one-to-many</strong> en <strong>fk relaties</strong> maar voorziet in betere semantiek bij het linken van tabellen door de lijnen te plaatsen op de exacte locatie waar de relatie zich bevindt. - - - + Connect FK to PK columns Verbindt FK naar PK kolommen - - This mode is the classical one. It connects the relationship to tables through their central points. - Dit is de klassieke modus. Deze verbindt de relaties tussen tabellen via hun centrale punt. + + This mode renders the relationships in crow's foot notation which has a better semantics and readability. It also determines the optimal point where the relationship is connected on the tables' edges taking their position into account. + + + + + Crow's foot notation + + + + + This mode determines the optimal point where the relationship is connected on the tables' edges taking their position into account. It implies the usage of the classical ER notation. + + + + + Connect tables' edges + + + + + This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. It implies the usage of the classical ER notation. + + + + + This mode is the classical one. It connects the relationship to tables through their central points. It implies the usage of the classical ER notation. + - + Connect tables' center points Verbindt de centrale punten van de tabellen - + FK Settings && Patterns FK instellingen && Patronen - + Foreign key settings Foreign key instellingen - + Deferral: Uitstel: - + Deferrable: Uitstelbaar: - + ON DELETE: ON DELETE: - + ON UPDATE: ON UPDATE: - + Name patterns Naamspatronen - + Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). Het patroon voor de foreign key wordt gegenereerd op basis van de pk van de gerefereerde tabel (1-1 en 1-n) of op basis van de pk van de brontabel (n-n). - + Foreign Key (Source): Foreign Key (Bron): - + Relationship type: Relatietype: - + Pattern for columns generated based upon target table's pk (n-n). Het patroon voor kolommen die worden gegenereerd op basis van de pk van de doeltabel (n-n). - + Column (Target): Kolom (Doel): - + One to one (1:1) Een-op-een (1:1) - + One to many (1:n) Een op meerdere (1:n) - + Many to many (n:n) Meerdere op meerdere (n:n) - + Generalization Generalisatie - + Copy Kopieer - + Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). Het patroon voor de kolommen wordt gegenereerd op basis van de pk van de gerefereerde tabel (1-1 en 1-n) of op basis van de pk van de brontabel (n-n). - + Column (Source): Kolom (Bron): - + Pattern for foreign key generated based upon target table's pk (n-n). Het patroon voor de foreign key wordt gegenereerd op basis van de pk van de doeltabel (n-n). - + Foreign Key (Target): Foreign Key (Doel): - + Pattern for unique key generated by the relationship. Het patroon voor de unieke sleutel wordt gegenereerd op basis van de relatie. - + Unique Key Name: Naam van de unieke sleutel: - - + + Pattern for primary key generated by identifier relationship. Het patroon voor de primary key wordt gegenereerd op basis van de relatie met de identifier. - + Primary Key Name: Naam van de Primary Key: - + Primary Key Column: Primary Key Kolom: - + Default Standaard @@ -11076,327 +11552,311 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr RelationshipWidget - Form - Venster - - - + General Algemeen - + Table 1: Tabel 1: - + Name Patterns Naamspatronen - - + + Use the values defined on settings dialogs for the fields below Gebruik de waarden ingesteld in het instellingsvenster voor de velden hieronder - - + + Use global settings for these fields Gebruik globale instellingen voor deze velden - + Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). Het patroon voor de kolommen wordt gegenereerd op basis van de pk van de gerefereerde tabel (1-1 en 1-n) of op basis van de pk van de brontabel (n-n). - + Column (Source): Kolom (Bron): - + Pattern for columns generated based upon target table's pk (n-n). Het patroon voor kolommen die worden gegenereerd op basis van de pk van de doeltabel (n-n). - + Column (Target): Kolom (Doel): - + Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). Het patroon voor de foreign key wordt gegenereerd op basis van de pk van de gerefereerde tabel (1-1 en 1-n) of op basis van de pk van de brontabel (n-n). - + Foreign Key (Source): Foreign Key (Bron): - + Pattern for foreign key generated based upon target table's pk (n-n). Het patroon voor de foreign key wordt gegenereerd op basis van de pk van de doeltabel (n-n). - + Foreign Key (Target): Foreign Key (Doel): - - + + Pattern for primary key generated by identifier relationship. Het patroon voor de primary key wordt gegenereerd op basis van de relatie met de identifier. - + Primary Key Name: Naam van de Primary Key: - + Pattern for unique key generated by the relationship. Het patroon voor de unieke sleutel wordt gegenereerd op basis van de relatie. - + Unique Key Name: Naam van de unieke sleutel: - + Primay Key Column: Primary Key Kolom: - + Cardinality: Cardinaliteit: - - + + Name of the table generated from many to many relationship De naam van de tabel die is gegenereerd op basis van de meer-op-meer relatie - + Gen. Table Name: Algemene Tabelnaam: - + Rel. Type: Relatietype: - + Table 2: Tabel 2: - + [SRC] is required [BRON] is vereist - + [DST] is required [DOEL] is vereist - + Foreign key Settings Foreign key instellingen - + Deferrable: Uitstelbaar: - + Deferral: Uitstel: - + ON DELETE: ON DELETE: - + ON UPDATE: ON UPDATE: - + One to one relationship Een-op-een relatie - + &1-1 - + &gen - + E&XCLUDING - 1-1 - 1-1 - - - + One to many relationship Een-op-meer relatie - + 1-n 1-n - + Many to many relationship Meer-op-meer relatie - + n-n n-n - + Generalization relationship (inheritance) Generalisatierelatie (overerving) - gen - gen - - - + Dependency / Copy relationship Afhankelijkheid / Kopieer de relatie - + dep dep - + Relationship generated via foreign key Relatie gegenereerd via foreign key - + fk fk - + The receiver's primary key will be composed by the generated foreign key columns. De ontvanger's primary key wordt samengesteld door de gegenereerde foreign key kolommen. - + Identifier Identifier - + Instead of create a multi-valued primary key with the generated foreign keys columns a single column is created and used as primary key. In plaats van een multi-kolom primary key te creeren op basis van de foreign key kolommen, wordt een enkele kolom aangemaakt en gebruikt als primary key. - + Single PK column Enkele PK kolom - + Custom Color: Aangepaste kleur: - + Copy Options Kopieeropties - + INDEXES INDEXES - + COMMENTS COMMENTS - + INCLUDING INCLUDING - + DEFAULTS DEFAULTS - EXCLUDING - EXCLUDING - - - + CONSTRAINTS CONSTRAINTS - + Use defaults Gebruik standaardwaarden - + ALL ALL - + STORAGE STORAGE - + Attributes Attributen - + Constraints Constraints - + Primary key Primary key - + Advanced Geavanceerd @@ -11432,10 +11892,6 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr This advanced tab shows the objects (columns or table) auto created by the relationship's connection as well the foreign keys that represents the link between the participant tables. Dit geavanceerde tab-blad toont de objecten (kolommen of tabellen) die automatisch worden aangemaakt door de verbindingen van de relatie alsook de foreign keys die de link tussen de deelnemende tabellen voorstelt. - - Available tokens to define name patterns:<br/> <strong>%1</strong> = Reference (source) primary key column name. <em>(Ignored on constraint patterns)</em><br/> <strong>%2</strong> = Reference (source) table name.<br/> <strong>%3</strong> = Receiver (destination) table name.<br/> <strong>%4</strong> = Generated table name. <em>(Only for n:n relationships)</em> - Beschikbare tokens om naamspatronen te definieren:<br/> <strong>%1</strong> = (Bron)referentie primary key kolom naam. <em>(Genegeerd bij constraint-patronen)</em><br/> <strong>%2</strong> = (Bron)referentie tabelnaam.<br/> <strong>%3</strong> = Receiver (doel) tabelnaam.<br/> <strong>%4</strong> = Gegenereerde tabelnaam. <em>(Enkel voor n:n relaties)</em> - Available tokens to define name patterns:<br/> <strong>%1</strong> = Reference (source) primary key column name. <em>(Ignored on constraint patterns)</em><br/> <strong>%2</strong> = Reference (source) table name.<br/> <strong>%3</strong> = Receiver (destination) table name.<br/> <strong>%4</strong> = Generated table name. <em>(Only for n:n relationships)</em> @@ -11447,80 +11903,84 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr Standaard - + Referer View: Refererende View: - + Referer view references one or more columns of a table to construct it's own columns. De refererende view refereert naar een of meerdere kolommen van een tabel om zijn eigen kolommen aan te maken. - + Referenced table has its columns referenced by a view in order to construct the columns of this latter. De gerefereerde tabel heeft kolommen waarnaar wordt gerefereerd door een view die deze kolommen gebruikt om zijn eigen kolommen aan te maken. - + Referer Table: Refererende Tabel: - + Referer table references one or more columns of a table through foreign keys. This is the (n) side of relationship. De refererende tabel refereert naar een of meerdere kolommen in een andere tabel via foreign keys. Dit is the (n)-zijde van de relatie. - + Referenced table has its columns referenced by a table's foreign key. This is the (1) side of relationship. De gerefereerde tabel heeft kolommen waarnaar wordt gerefereerd door een foreign key in een andere tabel. Dit is de (1) zijde van de relatie. - + Referenced Table: Gerefereerde Tabel: - - - + + + Reference Table: Referentietabel: - + Reference table has the columns from its primary key will copied to the receiver table in order to represent the linking between them. This is the (1) side of relationship. De referentietabel heeft kolommen in zijn primary key die gekopieerd zullen worden naar de ontvangende tabel om de link tussen deze te bewerkstelligen. Dit is de (1) zijde van de relatie. - + Receiver Table: Ontvangende Tabel: - + Receiver (or referer) table will receive the generated columns and the foreign key in order to represent the linking between them. This is the (n) side of relationship. De ontvanger (of gerefereerde) tabel zal de gegenereerde kolommen en de foreign key ontvangen om de link tussen beiden te bewerkstelligen. Dit is de (n) zijde van de relatie. - + In many-to-many relationships both tables are used as reference to generate the table that represents the linking. Columns from both tables are copied to the resultant table and two foreign keys are created as well in order to reference each participant table. In meer-op-meer relaties worden beide tabellen als referentie gebruikt om de link-tabel te representeren. Kolommen van beide tabellen worden gekopieerd naar de resulterende link-tabel en foreign keys naar elke deelnemende tabel worden aangemaakt. - - + + is required is vereist - RoleWidget + ResultSetModel - Form - Venster + + [binary data] + [binaire data] + + + RoleWidget yyyy-MMM-dd hh:mm:ss @@ -11528,7 +11988,7 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr - + Validity Geldigheid @@ -11549,78 +12009,75 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr - Inherit Permissions - Erf Machtigingen Over + Inherit permissions + - Can create Database - Kan Database Aanmaken + Can create database + - Can Login - Kan Inloggen + Bypass RLS + - Can create Role - Kan Rol Aanmaken + Can use replication + - Can use Replication - Kan Replicatie Gebruiken + Can login + Kan inloggen - - + + Can create role + + + + + Members Leden - - + + Member of Lid van - - + + Members (Admin.) Leden (Admin.) - + Password: Wachtwoord: - + Encrypted Geëncrypteerd - - Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. - <strong><em>-1</em></strong> toewijzen aan <strong><em>Verbindingen</em></strong> maakt een rol aan zonder verbindingslimiet.<br/> Vink <strong><em>Geldigheid</em></strong> af om een rol aan te maken die nooit vervalt. - Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. - + Role Rol RuleWidget - - Form - Venster - Event: @@ -11665,227 +12122,269 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr Venster - - Load SQL script - Laad SQL script + + Save SQL commands + Sla SQL commando's op - - &Load - &Laden + + Search in SQL code + - - - Save SQL commands - Sla SQL commando's op + + Close the current SQL script + - - &Save - Op&slaan + + SQL script currently handled + - - Search in SQL code + + (not saved) + + + + + Handle external SQL script - - &Find - &Zoeken + + &Script + - + Alt+F Alt+Z - + + Fi&nd + + + + Run the specified SQL command Voer het commando uit - + Run SQL Uitvoeren - + F6 F6 - + Clear sql input field and results Wis SQL invoerveld en resultaten - + Clear All Alles Wissen - - + + Export results to a CSV file Exporteer de resultaten naar CSV bestand - + Snippe&ts Snippe&ts - + + Alt+T + + + + E&xport E&xporteren - + + Alt+X + + + + Toggles the output pane - + &Output - + Alt+O Alt+O - - - + + Current working database + + + + + + Results - + Messages - + History - Shows the command history - Toon de commandogeschiedenis - - - &History - &Geschiedenis - - - Alt+H - Alt+G - - - Command History - Commandogeschiedenis - - - Clear sql input field and results. - Wis SQL invoerveld en resultaten - - - Clear - Leegmaken - - - - + ... ... - 0 - 0 + + SQL file (*.sql);;All files (*.*) + SQL Code (*.sql);;Alle bestanden (*.*) + + + + Load + Laden - Rows returned: - Aantal rijen: + + Save + Opslaan - - SQL file (*.sql);;All files (*.*) - SQL Code (*.sql);;Alle bestanden (*.*) + + Save as + Opslaan als - + [binary data] [binaire data] - [<strong>%1</strong>] SQL command successfully executed. <em>Rows affected <strong>%2</strong></em> - [<strong>%1</strong>] SQL command werd succesvol uitgevoerd. <em><strong>%2</strong> rijen werden beïnvloed</em> - - - + No results retrieved or changes done due to the error above. - - + + Messages (%1) - + Results (%1) - - [%1]: SQL command successfully executed. <em>%2 <strong>%3</strong></em> + + [%1]: SQL command successfully executed in <em><strong>%2</strong></em>. <em>%3 <strong>%4</strong></em> - + Rows affected - + Rows retrieved - + Load SQL commands Laad SQL commando's - + Save CSV file Sla CSV bestand op - + Comma-separated values file (*.csv);;All files (*.*) Bestand met komma-gesepareerde waarden (*.csv);;Alle bestanden (*.*) - + The SQL input field and the results grid will be cleared! Want to proceed? Het SQL invoerveld en de resultaten-lijst zullen worden leeggemaakt! Wenst u verder te gaan? - + Copy selection Kopiëer de selectie - + + Plain format + + + + + CVS format + + + + + This action will wipe out all the SQL commands history for all connections! Do you really want to proceed? + + + + Clear history + + + Save history + + + + + Reload history + + + + + Find in history + + + + + Hide find tool + + + + + This action will wipe out all the SQL commands history for the current connection! Do you really want to proceed? + + SQLToolWidget @@ -11895,90 +12394,125 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr Venster - + Database explorer Databaseverkenner - + Disconnect from all databases Van alle databases ontkoppelen - - + + ... - + Update the database list - + Toggle the object's attributes grid - + Attributes Attributen - + Alt+R Alt+R - + Toggle the display of source code pane - - + + Source code Broncode - Update the database list. - Update de database lijst. - - - + SQL execution SQL uitvoering - - - + Warning Opgepast - + <strong>ATTENTION:</strong> Disconnect from all databases will close any opened tab in this view! Do you really want to proceed? <strong>LET OP:</strong> Van alle databases ontkoppelen sluit alle tab-bladen in dit venster! Bent u zeker dat u verder wilt gaan? + + + SceneInfoWidget - - <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? - <strong>PAS OP:</strong> U staat op het punt om de volledige database <strong>%1</strong> te verwijderen! Alle data zal verloren gaan. Bent u zeker dat u verder wilt gaan? + + Form + Venster - - You're running a demonstration version! The data manipulation feature is available only in the full version! - Dit is een demonstratie-versie. De data manipulatie functionaliteit is enkel beschikbaar in de volledige versie! + + + Current position of the mouse in the canvas + + + + + + + + - + + + + + + Current zoom factor + + + + + + Currently selected object(s) + + + + + + Dimensions of the selected object(s) + + + + + No selection + + + + + N/A + + + + + Sel. objects: %1 + SchemaWidget - - Form - Venster - Fill color: @@ -11993,44 +12527,50 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr SequenceWidget - Form - Venster - - - + Cyclic: Cyclisch: - + Start: Start: - + Maximum: Maximum: - + Minimum: - + + Defualt values: + + + + Increment: Toename: - + Cache: Cache: - + Owner Col.: Bezittende kolom: + + + User defined + + SnippetsConfigWidget @@ -12194,65 +12734,8 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr Algemeen - - SourceCodeEditorForm - - Form - Venster - - - Load SQL script - Laad SQL script - - - &Load - &Laden - - - Save SQL commands - Bewaar SQL commando's - - - &Save - Op&slaan - - - &Find - &Zoek - - - Alt+F - Z is accelarator for Find - Alt+Z - - - Clear sql input field and results - Wis SQL invoerveld en resultaten - - - Clear All - Alles Wissen - - - Export results to a CSV file - Exporteer de resultaten naar CSV bestand - - - &Apply - Not sure p is a good accellerator here (t would be better but that is used for snippets) - Toe&passen - - - &Cancel - &Annuleren - - SourceCodeWidget - - Form - Venster - Version: @@ -12308,42 +12791,33 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr XML XML - - - Type: - Type: - Source code visualization Broncodevisualisatie - <strong>Original:</strong> displays only the original object's SQL code.<br/><br/><strong>Dependencies:</strong> display the original code including all dependencies needed to properly create the selected object.<br/><br/><strong>Children:</strong> display the original code including all children's SQL code. This option is used only by schemas, tables and views. - <strong>Origineel:</strong> toon enkel de originele SQL code van het object.<br/><br/><strong>Afhankelijken:</strong> toon de originele code inclusief alle afhankelijken die nodig zijn om het geselecteerde object correct aan te maken.<br/><br/><strong>Kinderen:</strong> toon de originele code inclusief de code voor alle kinderen. Deze optie wordt enkel gebruikt door schema's, tabellen en views. - - - + <strong>Original:</strong> displays only the original object's SQL code.<br/><br/> <strong>Dependencies:</strong> displays the original code including all dependencies needed to properly create the selected object.<br/><br/> <strong>Children:</strong> displays the original code including all object's children SQL code. This option is used only by schemas, tables and views. - + Save SQL code as... Sla SQL code op als... - + SQL code (*.sql);;All files (*.*) SQL Code (*.sql);;Alle bestanden (*.*) - + Generating source code... De broncode wordt gegeneerd... - + -- NOTE: the code below contains the SQL for the selected object -- as well for its dependencies and children (if applicable). -- @@ -12368,68 +12842,98 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr - + -- SQL code purposely truncated at this point in demo version! - - --- SQL code purposely truncated at this point on demo version! - -- In de demo-versie wordt de SQL code hier moedwillig afgekort! - - - + -- SQL code unavailable for this type of object -- -- Er is geen SQL code beschikbaar voor dit type object -- - + <!-- XML code preview disabled in demonstration version --> <!-- XML codevoorbeelden zijn niet beschikbaar in de demo-versie --> SwapObjectsIdsWidget - - Form - Venster - Change objects creation order - - Create: - Aanmaken: + + Create: + Aanmaken: + + + + + ID: + ID: + + + + Before: + Voor: + + + + Change the objects creation order is an irreversible operation and cause the operations history to be automatically erased. Note that the creation order configured in this form is not definitive and may change after a model validation. + + + + + Swap the object ids changing their creation order + + + + + Swap ids + + + + + Filter: + Filter: + + + + ID + ID + + + + Object + Object - - - ID: - ID: + + Type + Type - - Before: - Voor: + + Parent Object + Ouder Object - - It's recommended to use this feature only when the SQL validation fails in cases when a object is being referenced in portions where the ordinary validation couldn't reach, e.g., inside of a rule command or check constraint expression. - Het is aangeraden om dit feature enkel te gebruiken wanneer SQL validatie faalt in gevallen waarin naar een object wordt verwezen in delen waar de gewone validitie niet inkijkt, bijvoorbeeld binnen een regel-commando or check-constraint expressie. + + Parent Type + Ouder Type - + Swap the values of the fields Wissel de veldwaarden om - + Swap values Wissel de waarden om @@ -12437,12 +12941,12 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr Table - + new_table nieuwe_tabel - + In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2' Tabellen kunnen slechts `%1' instancies per kind-object type of voorouder-tabellen hebben in demonstratie-versies! U heeft deze limiet bereikt voor het type `%2' @@ -12455,324 +12959,407 @@ laatste geaccepteerde structuur. Alle beschikbare opties worden hieronder beschr - + Add empty rows - - - Add - Toevoegen - - - + Ins Ins - - Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. + + Add an empty column - - Add an empty column + + Delete rows - - Remove all rows from the grid preserving columns + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> - - - Clear - Leegmaken + + Remove all rows from the grid preserving columns + - + Shift+Del Shift+Del - + Delete the selected rows - - - Delete - Verwijderen - - - - + + Del Del - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> + + Duplicate the selected rows - - Duplicate the selected rows + + Ctrl+D + + + + + Delete the selected columns + + + + + Copy items on the grid + + + + + Copy + + + + + Add row + + + + + Delete column + + + + + Paste items on the grid + + + + + Paste + Plakken + + + + Ctrl+V + Ctrl+V + + + + Fills the grid using a CSV file + + + + + <html><head/><body><p>Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <span style=" font-weight:600;">INSERT</span> commands.</p></body></html> + + + + + Add column - Duplicate + Duplicate rows - - Ctrl+D + + Change the values of all selected cells at once - - Delete the selected columns + + Bulk data edit - + + Ctrl+E + Ctrl+E + + + Remove all columns (and rows) from the grid - + + Delete all columns + + + + Ctrl+Shift+Del - + + Delete all rows + + + + Delete columns is an irreversible action! Do you really want to proceed? - + Remove all rows is an irreversible action! Do you really want to proceed? - + Remove all columns is an irreversible action! Do you really want to proceed? - + + Unknown column - + Duplicated column - - - (no columns) - - TableObjectView - + Relationship: %1 Relatie: %1 - - TableView - - - Connected rels: %1 - Verbonden relaties: %1 - - TableWidget - - Form - Venster - Options Opties - + Tag: Tag: - + With OID Met OID - + Generate ALTER for columns/constraints Genereer ALTER voor kolommen/constraints - + Unlogged Niet gelogged - + + Enable row level security + + + + + Force RLS for owner + + + + &Columns - + Co&nstraints - + Tri&ggers - + &Rules - + &Indexes - - &Tables + + &Policies - Columns - Kolommen - - - Constraints - Constraints - - - Triggers - Triggers - - - Rules - Regels - - - Indexes - Indexen - - - Tables - Tabellen + + &Tables + - + Edit data - + Define initial data for the table - - - - - - + + + + + + + Name Naam - + Schema Schema - - - + + + Type Type - + + PK + + + + Default Value Standaardwaarde - - Attribute - Attribuut + + Attribute(s) + + + + + It is not possible to mark a column as primary key when the table already has a primary key which was created by a relationship! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. + - + + It is not possible to mark a column created by a relationship as primary key! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. + + + + ON DELETE ON DELETE - + ON UPDATE ON UPDATE - + Refer. Table Refer. Tabel - + Firing Afvuring - + Events Events - + Execution Uitvoering - + Event Event - + Indexing Indexering - + + Command + + + + + Permissive + + + + + USING expression + + + + + CHECK expression + + + + + Roles + Rollen + + + Parent Ouder - + Copy Kopie + + + Yes + Ja + + + + No + Nee + TablespaceWidget @@ -12789,10 +13376,6 @@ Relationship: %1 TagWidget - - Form - Venster - Colors @@ -12827,23 +13410,19 @@ Relationship: %1 TaskProgressWidget - + Executing tasks Taken uitvoeren - - + + Waiting task to start... Wachten op het starten van de taak... TextboxWidget - - Form - Venster - Font: @@ -12880,17 +13459,13 @@ Relationship: %1 Onderstrepen - + Select text color Selecteer tekstkleur TriggerWidget - - Form - Venster - Constraint @@ -12977,22 +13552,18 @@ Relationship: %1 Uitvoer: - + Column Kolom - + Type Type TypeWidget - - Form - Venster - Range @@ -13135,10 +13706,6 @@ Relationship: %1 Co&mposite - - Composite - Composite - Enumerations @@ -13222,10 +13789,6 @@ Relationship: %1 Update Notifier Update Aankondiging - - New update found! - Er is een nieuwe update! - Hide this widget @@ -13246,10 +13809,6 @@ Relationship: %1 mmm dd, yyyy mmm dd, yyyy - - Version: - Versie: - Update found! @@ -13291,248 +13850,263 @@ Relationship: %1 Verkrijg de broncode - <strong>Note:</strong> Both actions below will open a new web browser window - <strong>Let op:</strong> Beide acties zullen in een browservenster openen - - - - Recover a package - Herstel een pakket - - - - Purchase a new package - Koop een nieuw pakket aan - - - - + + Failed to check updates Het ophalen van update informatie faalde - - The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <strong>%1</strong>. - Het ophalen van nieuwe versie informatie faalde! Gelieve uw internetverbinding na te kijken en opnieuw te proberen! De verbindingsfout die werd gegenereerd is <strong>%1</strong>. + + The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <em>%1</em> - <strong>%2</strong>. + - + No updates found Geen nieuwe updates - + You are running the most recent pgModeler version! No update needed. Dit is de meest recente versie van pgModeler! - + The update notifier failed to check for new versions! A HTTP status code was returned: <strong>%1</strong> Het ophalen van nieuwe versie informatie faalde! De volgende HTTP status code werd gegenereerd: <strong>%1</strong> ViewWidget - - Form - Venster - References Referenties - + Expression Alias: Expressiealias: - + Column: Kolom: - + Table: Tabel: - + Table Alias: Tabelalias: - + Used in: Gebruikt in: - + Column Kolom - + Expression Expressie - + Reference Type: Referentietype: - - SELECT-FROM - SELECT-FROM + + View Definition + Viewdefinitie + + + + Expression: + Expressie: + + + + Column Alias: + Kolomalias: + + + + The element will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns + - - FROM-WHERE - FROM-WHERE + + SELECT ... + - - After WHERE - Na WHERE + + The element will be used as part of the WHERE clause in form of conditional expression + - View Definition - Viewdefinitie + WHERE ... + - - Expression: - Expressie: + + The element is used in the FROM portion of the command in order to reference tables or construct JOIN statements + - Column Alias: - Kolomalias: + FROM ... + + + + + The element's expression is used exclusively as the view's definition + + + + + The element will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements + + + + + End expression + - + Triggers Triggers - + Rules Regels - + + Indexes + Indexen + + + Table Expression Tabelexpressie - + Code Preview Codevoorbeeld - + Options Opties - + Tag: Tag: - + Mode: Modus: - + Ordinary Gewoon - + Recursi&ve - + &Materialized - Recursive - Recursief - - - Materialized - Gematerialiseerd - - - + With no data Zonder data - + Col./Expr. Kol./Expr. - + Alias Alias - + Alias Col. Alias Kol. - - Flags: SF FW AW VD - Vlaggen: SF FW AW VD + + Flags: SF FW AW EX VD + - - To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[tablel].*</strong></em> - Om naar alle kolommen in een tabel te refereren (*), laat het veld <strong>Kolom</strong> leeg, dit is equivalent aan <em><strong>[schema].[tabel].*</strong></em> + + To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[table].*</strong></em> + - - + + + Name Naam - + Refer. Table Refer. Tabel - + Firing Afvuring - + Events Events - + + Indexing + Indexering + + + Execution Uitvoering - + Event Event - + /* Could not generate the SQL code. Make sure all attributes are correctly filled! /* De SQL code kon niet worden gegenereerd. Kijk na of alle attributen correct zijn ingevuld! diff --git a/lang/pt_BR.qm b/lang/pt_BR.qm index 9060df3e01d45506eda6f864b5b0c80e2d546e09..b3cecf0428889b1732f707dcd0b92e1dad8dd54b 100644 GIT binary patch delta 9090 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 diff --git a/lang/pt_BR.ts b/lang/pt_BR.ts index caf91dac77..8b1f3fc5cf 100644 --- a/lang/pt_BR.ts +++ b/lang/pt_BR.ts @@ -1,62 +1,6 @@ - - AboutForm - - About pgModeler - Sobre o pgModeler - - - Close - Fechar - - - PostgreSQL Database Modeler - Modelador de Banco de Dados PostgreSQL - - - Design, configure, deploy - Desenhe, configure, implante - - - Copyright 2006-2013 - Raphael Araújo e Silva <rkhaotix@gmail.com> - -The pgModeler project is a CASE tool for modeling relational databases for PostgreSQL DBMS through the use of modeling techniques from entity-relationship diagrams as well merging concepts that PostgreSQL implements. - -Special thanks to friends of the software development team of the Legislative Assembly, Tocantins, Brazil: Michel de Almeida, Felipe Santana, Jonas Nepomuceno, Ricardo Ishibashi and Álvaro Nunes. - Copyright 2006-2012 - Raphael Araújo e Silva <rkhaotix@gmail.com> - -O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de bancos de dados relacionais para o SGDB PostgreSQL através do uso de técnicas de modelagem de diagramas entidade-relacionamento, como também mesclando conceitos implementados pelo próprio PostgreSQL. - -Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Assembleia Legislativa, Tocantins, Brasil: Michel de Almeida, Felipe Santana, Jonas Nepomuceno, Ricardo Ishibashi and Álvaro Nunes. {2006-2013 ?} - - - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -The complete text of GPLv3 is at LICENSE file on source code root directory. Also, you can get the complete GNU General Public License at <http://www.gnu.org/licenses/> - Este programa é software livre: você pode redistribuí-lo e/ou modificá-lo sob os termos da Licença Pública Geral da GNU como publicada pela Free Software Foundation versão 3. - -Este programa é distribuído na esperança de que seja útil, mas SEM QUALQUER GARANTIA; inclusive sem a garantia implícita de COMERCIABILIDADE ou ADEQUAÇÃO À UM PROPÓSITO ESPECÍFICO. Leia a Licença Pública Geral da GNU para mais detalhes. - -O texto completo da GPLv3 está no arquivo LICENSE no diretório raiz do código fonte. Você também pode obter a Licença Pública Geral da GNU completa em <http://www.gnu.org/licenses/> - - - Version %1 - Versão %1 - - - Copyright 2006-2013 - Raphael Araújo e Silva <rkhaotix@gmail.com> - -The pgModeler project is a CASE tool for modeling relational databases for PostgreSQL DBMS through the use of modeling techniques from entity-relationship diagrams as well merging concepts that PostgreSQL implements. - Em dúvida sobre "bem como mesclando". - Copyright 2006-2013 - Raphael Araújo e Silva <rkhaotix@gmail.com> - -O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de bancos de dados relacionais para o SGDB PostgreSQL através do uso de técnicas de modelagem de diagramas entidade-relacionamento, como também mesclando conceitos implementados pelo próprio PostgreSQL. - - AboutWidget @@ -71,22 +15,10 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. - - Design, configure, deploy - Desenhe, configure, implante - - - <a href="http://pgmodeler.com.br">http://pgmodeler.com.br</a> - - pgModeler is proudly a brazilian software! - - <html><head/><body><p>Copyright 2006-2016 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - - Hide this widget @@ -95,18 +27,6 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de ... - - 0.0.0.0 - - - - (CODE_NAME) - - - - Build: - - (BUILD_NUM) @@ -116,156 +36,28 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de - Contributors - - - - <html><head/><body><p>This page is dedicated to all contributors who gave a bit of their time in make pgModeler a better software somehow. The complete list of people that helped pgModeler can be found at <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>If you have a great idea to improve pgModeler please submit it <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">here</span></a>. No ideas for now but want to help? Why not donate a few bucks <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">here</span></a>!?</p></body></html> - - - - 1 - - - - 2 - - - - 3 - - - - 4 - - - - 5 - - - - 6 - - - - 7 - - - - 8 - - - - Name - Nome - - - Country - - - - Contribution - - - - Damien Degois - - - - France - - - - French UI translation and several improvements in auxiliary scripts. - - - - Ji Bin - - - - China - - - - Chinese UI translation and small fixes. - - - - Pierre-Samuel LE STANG - - - - French UI translation. - - - - Lisandro Damián Nicanor - - - - Argentina - - - - Improvements on build scripts enabling the custom packaging in Linux distros; Per-user settings; pgModeler's package maintainer in Debian Linux. - - - - Pavel Alexeev - - - - Russia - - - - Additional work for packaging in Linux distros; pgModeler's package maintainer in Fedora Linux. - - - - Mariusz Fik - - - - Poland - - - - Custom packaging first ideas. Tester of first version of custom packaging patch. - - - - Jonathan DUPRE + 0.0.0 - Gilberto Castillo + build: - Cuba + <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" text-decoration: underline; color:#2980b9;">https://pgmodeler.io</span></a></p></body></html> - Spanish UI translation. + <html><head/><body><p>Copyright 2006-2018 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.io</span></a>&gt;</p></body></html> AggregateWidget - - Form - Formulário - Final Function: Função Final: - - Transition Function: - Função de Transição: - Sort Operator: Operador de Ordenação: @@ -299,17 +91,6 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de - - Aplicacao - - Error - Erro - - - Unknown exception caught! - Exceção desconhecida capturada! - - AppearanceConfigWidget @@ -520,18 +301,6 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de Colors: Cores: - - Font color / Fill color 1 - Cor da fonte / Cor do preenchimento 1 - - - Fill color 2 - Cor do preenchimento 2 - - - Border color - Cor da borda - Underline Sublinhado @@ -552,13 +321,17 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de Placeholder: Body + + Constraint: Name + + + + Constraint: Descriptor + + Application - - Error - Erro - Unknown exception caught! Exceção desconhecida capturada! @@ -569,26 +342,10 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de - BancoDadosWidget - - Model Author: - Autor do Modelo: - + BaseConfigWidget - Encoding: - Codificação: - - - Connections: - Conexões: - - - Default - Padrão - - - Template DB: - DB Modelo: + A backup of the previous settings was saved into <strong>%1</strong>! + @@ -751,6 +508,14 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de Basic Relationship + + Policy + + + + Generic SQL + + BaseObjectView @@ -761,10 +526,6 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de BaseObjectWidget - - Form - Formulário - Name: Nome: @@ -790,22 +551,10 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de Schema: Esquema: - - Permissions: - Permissões: - - - Edit Permissions - Editar Permissões - This object is protected thus no change in form will be applied to it. Este objeto está protegido, assim nenhuma alteração no formulário será aplicada ao mesmo. - - Create / Edit: - Criar / Editar: - Value(s) Valor(es) @@ -814,18 +563,10 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de Version Versão - - The field(s) or value(s) highlighted on the form is(are) for the exclusive use and/or mandatory in specific versions of PostgreSQL. Failure to complete that may cause errors in the generation of SQL code for each version shown in tool tips of the highlighted fields. - O(s) campo(s) ou valor(es) destacado(s) no formulário é(são) de uso exclusivo e/ou obrigatório em versões específicas do PostgreSQL. O não preenchimento do(s) mesmo(s) pode ocasionar erros na geração de código SQL de cada versão indicada nas dicas de ferramenta dos campos destacados. - Edit permissions Editar permissões - - Disables the generated SQL code using comment tokens (--) - Desabilitar o código SQL gerado usando símbolos de comentário (--) - Disable SQL code Desabilitar código SQL @@ -838,10 +579,6 @@ O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de Required field. Leaving this empty will raise errors! Campo requerido. Deixá-lo em branco gerará erros! - - The <em style='color: %1'><strong>highlighted</strong></em> fields on the form are available only on specific PostgreSQL versions. When generating SQL code for versions other than those specified on field's tooltips pgModeler will ignore it's values. - Os campos <em style='color: %1'><strong>destacados</strong></em> no formulário estão disponíveis apenas em versões específicas do PostgreSQL. Ao gerar código SQL para versões diferentes daquelas especificadas nas dicas de campo, o pgModeler ignorará estes valores. - Edit object's permissions Editar permissões do objeto @@ -875,6 +612,17 @@ This will disable the code of all child and referrer objects. + + BaseTableView + + Toggles the extended attributes display + + + + Connected rels: %1 + + + BugReportForm @@ -951,5729 +699,3554 @@ This will disable the code of all child and referrer objects. - CaixaMensagem + BulkDataEditWidget - Show/hide exceptions stack. - Exibir/Esconder pilha de exceções. + Bulk data edit + + + + CastWidget - &Yes - &Sim + Cast Type: + Molde de Tipo: - &No - &Não + Assignment + Atribuição - Cancel - Cancelar + Input / Output + Entrada / Saída - Error - Erro + Source data type + Tipo dado origem - Alert - Alerta + Target data type + Tipo dado destino - Information - Informação + The function to be assigned to a cast from <em><strong>typeA</strong></em> to <em><strong>typeB</strong></em> must have the following signature: <em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. + A função a ser atribuída à uma moldagem do <em><strong>tipoA</strong></em> para o <em><strong>tipoB</strong></em> deve possuir a seguinte assinatura: <em><strong>tipoB</strong> funcao(<strong>tipoA</strong>, integer, boolean)</em>. - &Cancel - &Cancelar + I&mplicit + - Exceptions - Exceções + Conversion Func.: + Função de Conv.: - Show excpetion stack in text format (useful to report errors). - Exibe a pilha de exceções em formato texto (útil para se reportar erros). + E&xplicit + - CaixaTextoWidget + CodeCompletionWidget - Bold - Negrito + Makes the widget closable only by ESC key or mouse click on other controls. + - Italic - Itálico + SQL Keyword + - Select text color - Selecionar cor de texto + (no items found.) + - Underline - Sublinhado + Make &persistent + - CastWidget - - Form - Formulário - - - Cast Type: - Molde de Tipo: - + CollationWidget - Implicit - Implícita + Locale: + Localidade: - Assignment - Atribuição + Encoding: + Codificação: - Input / Output - Entrada / Saída + LC_COLLATE: + - Conversion Function: - Função de Conversão: + LC_CTYPE: + - Source data type - Tipo dado origem + The fields <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong>, <strong><em>LC_COLLATE & LC_CTYPE</em></strong> are mutually exclusive, so you have to set only one of them in order to properly handle a collation. + Os campos <strong><em>Intercalação</em></strong>, <strong><em>Localidade</em></strong>, <strong><em>LC_COLLATE & LC_CTYPE</em></strong> são mutuamente exclusivos, então você tem que definir apenas um deles a fim de manipular corretamente a intercalação. - Target data type - Tipo dado destino + Not defined + Não definido + + + ColorPickerWidget - The function to be assigned to a cast from <em><strong>typeA</strong></em> to <em><strong>typeB</strong></em> must have the following signature: <em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. - A função a ser atribuída à uma moldagem do <em><strong>tipoA</strong></em> para o <em><strong>tipoB</strong></em> deve possuir a seguinte assinatura: <em><strong>tipoB</strong> funcao(<strong>tipoA</strong>, integer, boolean)</em>. + Form + Formulário - I&mplicit + Generate random color(s) - Conversion Func.: - Função de Conv.: + Alt+R + - E&xplicit + Select color - ClasseOperadoresWidget - - Default Class: - Classe Padrão: - - - Indexing: - Indexação: - + ColumnWidget - Elements - Elementos + Default Value: + Valor Padrão: - Elemente Type: - Tipo de Elemento: + E&xpression: + - Operator - Operador + &NOT NULL + - Function - Função + Se&quence: + - Storage - Armazenamento + Edit the underlying sequence's attributes + - Function: - Função: + Edit sequence + - Operator: - Operador: + Identity: + + + + ConfigurationForm - Support/Strategy: - Suporte/Estratégia: + pgModeler Configuration + Configuração do pgModeler - Recheck - Rechecar + &Apply + &Aplicar - Family: - Família: + &Cancel + &Cancelar - Storage Type - Tipo de Armazenamento + Defaults + Padrões - Object - Objeto + General + Geral - Type - Tipo + Plug-ins + Plugins - Support/Strategy - Suporte/Estratégia + Any modification made until now in the current section will be lost! Do you really want to restore default settings? + Qualquer modificação feita até agora na seção atual será perdida! Deseja realmente restaurar as configurações padrão? - Yes - Sim + Relationships + - No - Não + Appearance + - - - CodeCompletionWidget - Make persistent + Connections - Makes the widget closable only by ESC key or mouse click on other controls. + Snippets - SQL Keyword + In some cases restore the default settings related to it may solve the problem. Would like to do that? - (no items found.) + Restore - CodigoFonteWidget + ConnectionsConfigWidget - Version: - Versão: + Connections: + Conexões: - Type: - Tipo: + Create new connection + Criar nova conexão - Source code visualization - Visualização de Código-Fonte + Cancel edition + Cancelar edição - Generating source code... - Gerando código-fonte... + Edit selected connection + Editar conexão selecionada - -- SQL code unavailable for this type of object -- - -- Código SQL não disponível para este tipo de objeto. -- + Delete selected connection + Apagar conexão selecionada - - - CollationWidget - Form - Formulário + Connection Alias: + Apelido da Conexão: - Locale: - Localidade: + Connection DB: + BD Conexão: - Encoding: - Codificação: + Host/Port: + Servidor/Porta: - LC_COLLATE: - + User: + Usuário: - LC_CTYPE: - + Password: + Senha: - The fields <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong>, <strong><em>LC_COLLATE & LC_CTYPE</em></strong> are mutually exclusive, so you have to set only one of them in order to properly handle a collation. - Os campos <strong><em>Intercalação</em></strong>, <strong><em>Localidade</em></strong>, <strong><em>LC_COLLATE & LC_CTYPE</em></strong> são mutuamente exclusivos, então você tem que definir apenas um deles a fim de manipular corretamente a intercalação. + Timeout: + Tempo limite: - Not defined - Não definido + second(s) + segundo(s) - - - ColorPickerWidget - Form - Formulário + SSL Mode: + Modo SSL: - Generate random color(s) - + Disable + Desabilitar - Alt+R - + Allow + Permitir - Select color - + Require + Requerir - - - ColumnWidget - Form - Formulário + AC verification + Verificação de AC - Default Value: - Valor Padrão: + Full verification + Verificação Completa - Not Null: - Não Nulo: + Client Certificate: + Certificado Cliente: - E&xpression: - + ~/.postgresql/postgresql.crt + - &NOT NULL - + Client Key: + Chave Cliente: - Se&quence: - + ~/.postgresql/postgresql.key + - - - ColunaWidget - Default Value: - Valor Padrão: + Root Certificate: + Certificado Raiz: - Not Null: - Não Nulo: + ~/.postgresql/root.crt + - - - ConfAparenciaWidget - Element: - Elemento: + Revoked Certs.: + Cert. Revogados: - Global: Font style - Global: Estilo de fonte + ~/.postgresql/root.crl + - Global: Constraints descriptor - Global: Descritor de restrições + Force GSSAPI + Forçar GSSAPI - Global: Object selection - Global: Seleção de objetos + Add + Adicionar - Global: Position hint text - Global: Texto informativo de posição + Update + Atualizar - Global: Position hint box - Global: Caixa do informativo de posição + Test + Testar - Global: Objects type - Global: Tipo de objetos + Success + Sucesso - Global: Lock arc - Global: Arco de cadeado + Edit database connections + - Global: Lock body - Global: Corpo do cadeado + Duplicate the selected connection + - Table: Schema name - Tabela: Nome de esquema + General + Geral - Table: Table name - Tabela: Nome de tabela + Other params: + - Table: Columns box - Tabela: Caixa de colunas + Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. + - Table: Extended attributes box - Tabela: Caixa de atributos extendidos + Default for: + - Table: Title box - Tabela: Caixa de título + Automatically browses the named database when using this connection to manage databases on <strong>Manage</strong> view. + - Index: Descriptor - Índice: Descritor + Auto browse + - Trigger: Descriptor - Gatilho: Descritor + Diff + - View: Schema name - Visão: Nome de esquema - - - View: View name - Visão: Nome de visão + Export + Exportar - View: References box - Visão: Caixa de referências + Import + - View: Title box - Visão: Caixa de título + Validation + - View: Table / columns alias - Visão: Alias de tabela / coluna + Security + - View: Referenced column - Visão: Coluna referenciada + Kerberos Server: + - View: Referenced table - Visão: Tabela referenciada + Indicates in which operations (diff, export, import or validation) the connection is used if none is explicitly specified by the user. + - View: Reference descriptor - Visão: Descritor de referência + There is a connection being created or edited! Do you want to save it? + - Textbox: Body - Caixa de Texto: Corpo + Found %1 connection(s) + - Column: Column name - Coluna: Nome de coluna + No connections found + - Column: Descriptor - Coluna: Descritor + Edit connections + - Column: Included / Inherited by relationship - Coluna: Incluída / Herdada por relacionamento + Connection successfully established! + +Server details: + +PID: `%1' +Protocol: `%2' +Version: `%3' + + + + ConstraintWidget - Column: Protected - Coluna: Protegida + Constraint Type: + Tipo de Restrição: - Column (pk): Column name - Coluna (pk): Nome de coluna + Fill Factor: + Fator Preenc.: - Column (pk): Descriptor - Coluna (pk): Descritor + Match: + Confrontar: - Column (fk): Column name - Coluna (fk): Nome de coluna + Deferrable: + Postergável: - Column (fk): Descriptor - Coluna (fk): Descritor + Deferral: + Postergação: - Column (uq): Column name - Coluna (uq): Nome de coluna + ON DELETE: + - Column (uq): Descriptor - Coluna (uq): Descritor + ON UPDATE: + - Column (nn): Column name - Coluna (nn): Nome de coluna + Columns + Colunas - Column (nn): Descriptor - Coluna (nn): Descritor + Column: + Coluna: - Relationship: Descriptor - Relacionamento: Descritor + Referenced Columns + Colunas Referenciadas - Relationship: Label text - Relacionamento: Texto do rótulo + Table: + Tabela: - Relationship: Label box - Relacionamento: Caixa do rótulo + Column + Coluna - Relationship: Attribute text - Relacionamento: Texto do atributo + Type + Tipo - Relationship: Attribute descriptor - Relacionamento: Descritor do atributo + No inherit: + Sem herança: - Bold - Negrito + Exclude Elements + Excluir Elementos - Italic - Itálico + Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they can raise errors. To create primary key using columns included by relationship use the following options: identifier field, attributes & constraints tab or primary key tab on the relationship form. + Colunas que foram incluídas por relacionamento não podem ser adicionadas / removidas manualmente da chave primária. Se tais alterações forem feitas elas podem gerar erros. Para criar chaves primárias usando colunas incluídas por relacionamentos use as seguintes opções: campo identificador, aba atributos & restrições ou aba chave primária no formulário de relacionamento. - Colors: - Cores: + This attribute cannot be changed once the object is created. + - Font color / Fill color 1 - Cor da fonte / preenchimento 1 + Expression: + Expressão: - Fill color 2 - Cor de preenchimento 2 + Indexing: + Indexação: + + + ConversionWidget - Border color - Cor da borda + Source Encoding: + Codificação Origem: - Underline - Sublinhado + Target Encoding: + Codificação Destino: - Rule: Name - Regra: Nome + Default Conversion: + Conversão Padrão: - Rule: Descriptor - Regra: Descritor + The function to be assigned to an encoding conversion must have the following signature: <em>void function(integer, integer, cstring, internal, integer)</em>. + A função a ser atribuída a uma conversão de codificação deve possuir a seguinte assinatura: <em>void funcao(integer, integer, cstring, internal, integer)</em>. - Index: Name - Índice: Nome + Conversion Func.: + Função de Conv.: + + + CrashHandlerForm - Trigger: Name - Gatilho: Nome + Crash Handler + - Font: - Fonte: + Stack trace + Rastreamento de pilha - - - ConfConexoesWidget - Connections: - Conexões: + Input: + - Create new connection - Criar nova conexão + Load report file for analysis + - Cancel edition - Cancelar edição + Save the attached model file on the filesystem + - Edit selected connection - Editar conexão selecionada + pgModeler bug report (*.bug);;All files (*.*) + - Connection Alias: - Alias Conexão: + Load report + - Connection DB: - BD Conexão: + Save model + Salvar modelo - Host/Port: - Host/Porta: + Database model (*.dbm);;All files (*.*) + Modelo de banco de dados (*.dbm);; Todos os arquivos (*.*) - User: - Usuário: + Crash handler + - Password: - Senha: + Bug report analysis mode activated. + - Timeout: - Timeout: + Oops! pgModeler just crashed! + Oopa! O pgModeler acaba de travar! - second(s) - segundo(s) + We apologize for what happened! It is clear that a nasty bug caused that. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. + + + + CsvLoadWidget - SSL Mode: - Modo SSL: + Form + Formulário - Disable - Desativado + Load CSV + - Allow - Permitir + CSV File: + - Require - Requerido + Select output file + - AC verification - Verificação de AC + ... + - Full verification - Verificação Completa + Separator: + - Client Key: - Chave Cliente: + Use the first row as column names in the CSV file. By unchecking this option the first row is used as data. + - Revoked Certs.: - Cert. Revogados: + Columns in the first row + - Kerberus Server: - Servidor Kerberus: + Load + Carregar - Force GSSAPI - Forçar GSSAPI + Semicolon (;) + - Options: - Opções: + Comma (,) + - Add - Adicionar + Space + - Update - Atualizar + Tabulation + - Test - Testar + Other + - Delete selected connection - Excluir conexão selecionada + ; + - Client Certificate: - Certificado Cliente: + Text delimiter: + - Root Certificate: - Certificado Raiz: + " + - Success - Sucesso + Load CSV file + - Connection successfuly stablished! - Conexão efetuada com sucesso! + Comma-separted values (*.csv);;All files (*.*) + - ConfGeralWidget + CustomSQLWidget - Grid size: - Tamanho da grade: + Add custom SQL code + - Operation history: - Histórico de operações: + SQL code + - items - itens + Puts an SELECT command template at current cursor position. + - Save model every: - Salvar modelo a cada: + &SELECT + - minute(s) - minuto(s) + Puts an INSERT command template at current cursor position. + - Save widgets position - Salvar posição de widgets + &INSERT + - Save current session - Salvar sessão atual + Puts an UPDATE command template at current cursor position. + - Paper: - Papel: + &UPDATE + - Custom (Based on margins) - Personalizado (Baseado nas margens) + Puts an DELETE command template at current cursor position. + - Orientation: - Orientação: + &DELETE + - Portrait - Retrato + &Clear + - Landscape - Paisagem + Append SQL + - Margins: - Margens: + Append the SQL code at the very end of model definition. +Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE command. + - Milimeters - Milímetros + Append at end of model definition. + - Inches - Polegadas + Prepend SQL + - Centimeter - Centímetros + Prepend at beginning of model definition. + - Left: - Esq.: + <html><head/><body><p>Use custom commands with extreme caution because you can change the semantics of the entire model when running SQL validation or export processes. Additionally, depending on the amount of commands, those processes can have their performance sensibly degradated.</p></body></html> + - Left margin - Margem esquerda + Generic INSERT + - Top: - Topo: + Include serial columns + - Top margin - Margem topo + Exclude serial columns + - Right: - Dir.: - + Generic SELECT + + - Right margin - Margem direita + Table SELECT + - Bottom: - Base: + Generic UPDATE + - Bottom margin - Margem base + Table UPDATE + + + + Generic DELETE + + + + Table DELETE + - ConfigurationForm + DataManipulationForm - pgModeler Configuration - Configuração do pgModeler + Data Manipulation + - &Apply - &Aplicar + &Close + &Fechar - &Cancel - &Cancelar + Refresh listing + - Defaults - Padrões + F5 + - General - Geral + Save changes + - Style - Estilo + Ctrl+S + - Connetions - Conexões + Export results to CSV file + - Plug-ins - Plugins + Ctrl+X + - Confirmation - Confirmação + Undo modifications + - Any modification made until now in the current section will be lost! Do you really want to restore default settings? - Qualquer modificação feita até agora na seção atual será perdida! Deseja realmente restaurar as configurações padrão? + Ctrl+Z + - Relationships + Add empty rows - Appearance + Ins - Connections + Mark the selected rows to be deleted - Snippets + Del - - - ConnectionsConfigWidget - Form - Formulário + Duplicate the selected rows + - Connections: - Conexões: + Ctrl+D + - Create new connection - Criar nova conexão + Filter the result set + - Cancel edition - Cancelar edição + Table: + Tabela: - Edit selected connection - Editar conexão selecionada + Schema: + Esquema: - Delete selected connection - Apagar conexão selecionada + in + - Connection Alias: - Apelido da Conexão: + Hide views + - Connection DB: - BD Conexão: + Filter expression + - Host/Port: - Servidor/Porta: + Order && Limit + - User: - Usuário: + results (Use <strong>0</strong> for no limit) + - Password: - Senha: + Limit in: + - Timeout: - Tempo limite: + Add Item + Adicionar Item - second(s) - segundo(s) + Remove Item + Remover Item - SSL Mode: - Modo SSL: + Clear the order by columns list + - Disable - Desabilitar + Move selected item up + - Allow - Permitir + Move selected item down + - Require - Requerir + ASC + - AC verification - Verificação de AC + DESC + - Full verification - Verificação Completa + Column: + Coluna: - Client Certificate: - Certificado Cliente: + <strong>WARNING: </strong> There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now? + - ~/.postgresql/postgresql.crt - + Rows returned: <strong>%1</strong>&nbsp;&nbsp;&nbsp; + - Client Key: - Chave Cliente: + <em>(Limit: <strong>%1</strong>)</em> + - ~/.postgresql/postgresql.key - + none + - Root Certificate: - Certificado Raiz: + No objects found + - ~/.postgresql/root.crt - + Found %1 object(s) + - Revoked Certs.: - Cert. Revogados: + Views can't have their data handled through this grid, this way, all operations are disabled. + - ~/.postgresql/root.crl - + The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. <strong>WARNING:</strong> those operations can affect more than one row. + - Kerberus Server: - Servidor Kerberus: + This row is marked to be %1 + - Force GSSAPI - Forçar GSSAPI + deleted + - Options: - Opções: + updated + - Add - Adicionar + inserted + - Update - Atualizar + [binary data] + - Test - Testar + <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving? + - Success - Sucesso + delete + - Connection successfuly stablished! - Conexão estabelecida com sucesso! + update + - Edit database connections + insert - Duplicate the selected connection + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> - General - Geral + Copy items on the grid + - Other params: + Paste items on the grid - Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. + Ctrl+V - Default for: + Browse referenced tables - Automatically browses the named database when using this connection to manage databases on <strong>Manage</strong> view. + Change the values of all selected cells at once - Auto browse + Ctrl+E - Diff + Add new rows from a CSV file - Export - Exportar + Copy as CSV + - Import + Copy as text - Validation + Copy items - Security + Pase items - Kerberos Server: + Browse tables - Indicates in which operations (diff, export, import or validation) the connection is used if none is explicitly specified by the user. + Duplicate row(s) - Connection successfuly stablished! - -Server details: - -PID: `%1' -Protocol: `%2' -Version: `%3' + Delete row(s) - There is a connection being created or edited! Do you want to save it? + Edit cell(s) - Found %1 connection(s) + Column + Coluna + + + Referenced tables - No connections found + (none) - Edit connections + Referrer tables - ConstraintWidget + DatabaseExplorerWidget Form - Formulário + Formulário - Constraint Type: - Tipo de Restrição: + Open the grid to visualize or edit data + - Check Expr.: - Expr.Checagem: + Data &Grid + - Fill Factor: - Fator Preenc.: + Alt+G + - Match: - Confrontar: + Open a new SQL execution pane + - Deferrable: - Postergável: + ... + - Deferral: - Postergação: + Ctrl+F6 + - ON DELETE: - + Update the objects tree + - ON UPDATE: - + Drop this database + - Columns - Colunas + Expands all items + Expandir todos os itens - Column: - Coluna: + Collapses all items + Recolher todos os itens - Referenced Columns - Colunas Referenciadas + Filters the currently loaded items in the tree by using a pattern and matching their names. If <strong>By OID</strong> is checked the pattern is interpreted as an integer value that represents the object id (OID). <br><br/><strong>HINT:</strong> if you need to search the entire database use the full refresh (<strong>Ctrl+F5</strong>) prior the filtering. + - Table: - Tabela: + Filter: + - Column - Coluna + By OID + - Type - Tipo + Attribute + Atributo - Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they will be ignored. To create primary key using columns included by relationship use the feature attributes, constraints and primary key on the relationship form. - Colunas as quais foram incluídas por relacionamento não podem ser adicionadas/removidas manualmente das chaves-primárias. Caso isso ocorra tais alterações serão ignoradas. Para criar chaves-primárias usando colunas incluídas por relacionamentos utilize o recurso de atributos, restrições e chave-primária no formulário de edição relacionamentos. + Value + - No inherit: - Sem herança: + Show raw attributes + - Exclude Elements - Excluir Elementos + (not found, OID: %1) + - Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they can raise errors. To create primary key using columns included by relationship use the following options: identifier field, attributes & constraints tab or primary key tab on the relationship form. - Colunas que foram incluídas por relacionamento não podem ser adicionadas / removidas manualmente da chave primária. Se tais alterações forem feitas elas podem gerar erros. Para criar chaves primárias usando colunas incluídas por relacionamentos use as seguintes opções: campo identificador, aba atributos & restrições ou aba chave primária no formulário de relacionamento. + -- Source code not generated! Hit F7 or middle-click the item to load it. -- + - This attribute cannot be changed once the object is created. + Admin. roles - Expression: - Expressão: + Alignment + - Indexing: - Indexação: + Analyze func. + - - - ConversaoCodificacaoWidget - Source Encoding: - Codificação Origem: + Arg. count + - Target Encoding: - Codificação Destino: + Arg. default count + - Convertion Function: - Função de Conversão: + Arg. defaults + - Default Conversion: - Conversão Padrão: + Arg. modes + - The function to be assigned to an encoding conversion must have the following signature: <em>void function(integer, integer, cstring, internal, integer)</em>. - A função a ser atribuída a uma conversão de codificação deve possuir a seguinte assinatura: <em>void funcao(integer, integer, cstring, internal, integer)</em>. + Arg. names + - - - ConversaoTipoWidget - Conversion Type: - Tipo da Conversão: + Arg. types + - Implicit - Implícita + Behavior type + - Assignment - Atribuição + By value + Por valor - Input / Output - Entrada / Saída + Cast type + - Convertion Function: - Função de Conversão: + Category + - The function to be assigned to a cast from <em><strong>typeA</strong></em> to <em><strong>typeB</strong></em> must have the following signature: <em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. - A função a ser atribuída a uma conversão do <em><strong>tipoA</strong></em> para o <em><strong>tipoB</strong></em> deve possuir a seguinte assinatura: <em><strong>tipoB</strong> funcao(<strong>tipoA</strong>, integer, boolean)</em>. + Collatable + Intercalável - Source data type - Tipo dado origem + Collation + Intercalação - Target data type - Tipo dado destino + Comment + - - - ConversionWidget - Form - Formulário + Commutator Op. + - Source Encoding: - Codificação Origem: + Configuration + - Target Encoding: - Codificação Destino: + Conn. limit + - Default Conversion: - Conversão Padrão: + Constraint + Restrição - The function to be assigned to an encoding conversion must have the following signature: <em>void function(integer, integer, cstring, internal, integer)</em>. - A função a ser atribuída a uma conversão de codificação deve possuir a seguinte assinatura: <em>void funcao(integer, integer, cstring, internal, integer)</em>. + Create DB + - Conversion Func.: - Função de Conv.: + Create role + - - - CrashHandler - pgModeler Crash Handler - Gerenciador de erros do pgModeler + Curr. version + - Oops! pgModeler just crashed! - Oopa! O pgModeler acaba de travar! + Default + Padrão - Create - Criar + Default value + - &Cancel - &Cancelar + Definition + Definição - We apologize for what happened! It is clear that a nasty bug caused it. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. - Pedimos desculpas pelo ocorrido! Está claro que um bug desagradável causou isso. Por favor, preencha o formulário abaixo descrevendo suas ações antes do pgModeler fechar inesperadamente. Isso ajudará na eliminação do bug e melhoria do software. + Delimiter + - Report - Relatório + Dest. type + - Actions made before the crash: - Ações feitas antes do travamento: + Dimension + Dimensão - Loaded Model - Modelo Carregado + Directory + - Attach the below database model file that possibly generates the crash. - Anexar abaixo o modelo de banco de dados que possivelmente gera o travamento. + Dest. encoding + - Stack trace - Rastreamento de pilha + Element + Elemento - pgModeler crash file analysis - Análise de arquivo de travamento do pgModeler + Encoding + - Error - Erro + Encrypted + Encriptado - File: %1 -Size: %2 bytes - - - Arquivo: %1 -Tamanho: %2 bytes - - + Enumerations + Enumerações - Information - Informação + Exec. cost + - Crash report successfuly generated! Please send the file '%1' to %2 in order be debugged. Thank you for the collaboration! - Relatório de travamento gerado com sucesso! Por favor, envie o arquivo '%1' para %2 a fim de que possa ser depurado. Obrigado pela colaboração! + Expression + Expressão - - - CrashHandlerForm - Crash Handler + Op. family - Stack trace - Rastreamento de pilha + Final func. + - Input: - + Function + Função - Load report file for analysis + Func. type - Save the attached model file on the filesystem + Handler func. - pgModeler bug report (*.bug);;All files (*.*) + Handles type - Load report + Hashes - Save model - Salvar modelo + Index type + - Database model (*.dbm);;All files (*.*) - Modelo de banco de dados (*.dbm);; Todos os arquivos (*.*) + Inherit + - Crash handler + Ini. condition - Bug report analysis mode activated. + Inline func. - Oops! pgModeler just crashed! - Oopa! O pgModeler acaba de travar! + Input func. + - We apologize for what happened! It is clear that a nasty bug caused that. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. + Internal length - - - CustomSQLWidget - Add custom SQL code + Interval type - SQL code + I/O cast - Puts an SELECT command template at current cursor position. + Join func. - &SELECT - + Language + Linguagem - Puts an INSERT command template at current cursor position. + LC COLLATE - &INSERT + LC CTYPE - Puts an UPDATE command template at current cursor position. + Leak proof - &UPDATE + Left type - Puts an DELETE command template at current cursor position. - + Length + Comprimento - &DELETE - + Library + Biblioteca - &Clear + Can login - Append SQL + Materialized - Append the SQL code at the very end of model definition. -Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE command. + Member roles - Append at end of model definition. + Merges - Prepend SQL - + Name + Nome - Prepend at beginning of model definition. + Negator op. - <html><head/><body><p>Use custom commands with extreme caution because you can change the semantics of the entire model when running SQL validation or export processes. Additionally, depending on the amount of commands, those processes can have their performance sensibly degradated.</p></body></html> + Not null - Type: - Tipo: + Object type + - Generic INSERT + OID - Include serial columns + With OIDs - Exclude serial columns + Old version - Generic SELECT - + Operator + Operador - Table SELECT + Operator func. - Generic UPDATE + Output func. - Table UPDATE + Owner - Generic DELETE + Owner column - Table DELETE + Parents - - - DataManipulationForm - Data Manipulation + Password - &Close - &Fechar + Permissions + Permissões - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> - + Precision + Precisão - Refresh listing - + Preferred + Preferido - Refresh + Range attributes - F5 + Receive func. - Save changes + Ref. roles - Save - Salvar - - - Ctrl+S + Replication - Copy the selection as CSV buffer + Restriction func. - Copy - Copiar - - - Ctrl+C + Return type - Export results to CSV file + Returns SETOF - Export - Exportar - - - Ctrl+X + Right type - Undo modifications + Rows amount - Undo - Desfazer + Schema + Esquema - Ctrl+Z + Security type - Add empty rows + Send func. - Add - Adicionar - - - Ins + Sort op. - Mark the selected rows to be deleted + Source type - Delete + Src. encoding - Del + State type - Duplicate the selected rows - + Storage + Armazenamento - Duplicate - + Superuser + Superusuário - Ctrl+D - + Tablespace + Espaço de Tabela - Filter the result set + Type mod. in func. - Table: - Tabela: - - - Schema: - Esquema: + Type mod. out func. + - in + Transition func. - Hide views + Trusted - Filter expression - + Type + Tipo - Order && Limit + Type attribute - results (Use <strong>0</strong> for no limit) + Types - Limit in: + Unlogged - Add Item - Adicionar Item + Validator func. + - Remove Item - Remover Item + Validity + Validade - Clear the order by columns list + Windows func. - Move selected item up + false - Move selected item down + true - ASC + Cache value - DESC + Cycle - Column: - Coluna: - - - <strong>WARNING: </strong> There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now? + Increment - Rows returned: <strong>%1</strong>&nbsp;&nbsp;&nbsp; + Max. value - <em>(Limit: <strong>%1</strong>)</em> + Min. value - none + Start value - No objects found + Last value - Found %1 object(s) - + Subtype + Subtipo - Views can't have their data handled through this grid, this way, all operations are disabled. + Op. class - The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. <strong>WARNING:</strong> those operations can affect more than one row. + Canonical func. - This row is marked to be %1 + Subtype diff func. - deleted + Deferrable - updated + For each row - inserted - + Firing + Disparo - [binary data] + On insert - <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving? + On delete - delete + On update - update + On truncate - insert - + Arguments + Argumentos - - - DatabaseExplorerWidget - Form - Formulário + Table + Tabela - Toggles the display of system objects. + Trigger func. - System - + Columns + Colunas - Toggles the display of extension objects + Condition - Extension + Deferment - Open the grid to visualize or edit data - + Event + Evento - Data &Grid + Execution mode - Alt+G + Commands - Open a new SQL execution pane + Position - ... + Comparison type - Ctrl+F6 + Ref. columns - Update the objects tree + Expressions - Ctrl+S + Fill factor - Drop this database + No inherit - Expands all items - Expandir todos os itens + Op. classes + - Collapses all items - Recolher todos os itens + Operators + Operadores - Filters the currently loaded items in the tree by using a pattern and matching their names. If <strong>By OID</strong> is checked the pattern is interpreted as an integer value that represents the object id (OID). <br><br/><strong>HINT:</strong> if you need to search the entire database use the full refresh (<strong>Ctrl+F5</strong>) prior the filtering. + Ref. table - Filter: - + Unique + Único - By OID + Predicate - Attribute - Atributo - - - Value + Collations - Show raw attributes + Inherited - (not found, OID: %1) + Snippets - -- Source code not generated! Hit F7 or middle-click the item to load it. -- + Drop object - Admin. roles + Drop cascade - Alignment + Truncate - Analyze func. + Trunc. cascade - Arg. count + Show data - Arg. default count + Reload properties - Arg. defaults - + Update + Atualizar - Arg. modes + Rename + Renomear + + + Source code - Arg. names + Quick refresh - Arg. types + Full refresh - Behavior type + Do you really want to drop the object <strong>%1</strong> <em>(%2)</em>? - By value - Por valor + Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it. + - Cast type + Do you really want to truncate the table <strong>%1</strong>? - Category + Do you really want to <strong>cascade</strong> truncate the table <strong>%1</strong>? This action will truncate all the tables that depends on it? - Collatable - Intercalável + Src. table: %1 +Src. column(s): %2 + - Collation - Intercalação + Ref. table: %1 +Ref. column(s): %2 + - Comment + -- Source code genaration for buil-in and base types currently unavailable -- - Commutator Op. + -- Source code unavailable for the object %1 (%2). -- - Configuration + Toggle the display of filter widget as well the system/extension objects. - Conn. limit + Sort items alphabetically. When unchecked, items are sorted by OID. - Constraint - Restrição + Sort alphabetically + - Create DB + Client encoding - Create role + Configuration file - Curr. version + Data directory - Default - Padrão + Dynamic library path + - Default value + Dynamic shared memory - Definition - Definição + Hba file + - Delimiter + Listen addresses - Dest. type + Max. connections - Dimension - Dimensão + Listen port + - Directory + Server encoding - Dest. encoding + SSL - Element - Elemento + SSL ca file + - Encoding + SSL cert file - Encrypted - Encriptado + SSL crl file + - Enumerations - Enumerações + SSL key file + - Exec. cost + Server version - Expression - Expressão + Ident file + - Op. family + Password encryption - Final func. + Connection ID - Function - Função + Server PID + - Func. type + Server protocol - Handler func. + Referrers - Handles type + Identity - Hashes + Command - Index type + USING expr. - Inherit + CHECK expr. - Ini. condition + Roles + Papéis + + + RLS enabled - Inline func. + RLS forced - Input func. + Show objects filter - Internal length + Show system objects - Interval type + Show extension objects - I/O cast + -- Source code unavailable for this kind of object -- - Join func. + Also restart sequences - Language - Linguagem + Warning + - LC COLLATE + You're running a demonstration version! The data manipulation feature is available only in the full version! - LC CTYPE + <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? + + + DatabaseImportForm - Leak proof + Settings - Left type + Options - Length - Comprimento + Connection: + Conexão: - Library - Biblioteca + Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. + - Can login + Automatically resolve dependencies - Materialized + Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. - Member roles + Random colors for relationships - Merges + Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. - Name - Nome + Import system objects + - Negator op. + Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. - Not null + Import extension objects - Object type + pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. - OID + Ignore import errors - With OIDs + All catalog queries as well the created objects' source code are printed to standard output (stdout). - Old version + Debug mode - Operator - Operador + Create all imported objects in the current working model instead of create a new one. + - Operator func. + Import objects to the working model - Output func. + Database + Banco de Dados + + + Filter: - Owner + Filter object by it's OID - Owner column + By OID - Parents + Select all objects - Password + ... - Permissions - Permissões + Clear object selection + - Precision - Precisão + Expands all items + Expandir todos os itens - Preferred - Preferido + Collapses all items + Recolher todos os itens - Range attributes + Output - Receive func. - + Progress label... + Rótulo de progresso... - Ref. roles - + Cancel + Cancelar - Replication + &Import - Restriction func. - + &Close + &Fechar - Return type + <strong>ATTENTION:</strong> You are about to import objects to the current working model! This action will cause irreversible changes to it even in case of critical errors during the process. Do you want to proceed? - Returns SETOF + Importing process aborted! - Right type + Importing process canceled by user! - Rows amount + Importing process sucessfuly ended! - Schema - Esquema + No databases found + - Security type + Found %1 database(s) - Send func. + Retrieving objects from database... - Sort op. + Retrieving cluster level objects... - Source type + Retrieving objects of schema `%1'... - Src. encoding + This is a PostgreSQL built-in data type and cannot be imported. - State type + This is a pgModeler's built-in object. It will be ignored if checked by user. - Storage - Armazenamento + Import database + - Superuser - Superusuário + Retrieving objects of `%1' (%2)... + + + + DatabaseImportHelper - Tablespace - Espaço de Tabela + Retrieving system objects... `%1' + - Type mod. in func. + Retrieving objects... `%1' - Type mod. out func. + Creating object `%1' (%2)... - Transition func. + Import failed to recreate some objects in `%1' tries. - Trusted + Creating permissions for object `%1' (%2)... - Type - Tipo + Creating columns permissions... + - Type attribute + Updating relationships of `%1' (%2)... - Types + Validating relationships... - Unlogged + The database import ended but some errors were generated and saved into the log file `%1'. This file will last until pgModeler quit. - Validator func. + Creating table inheritances... - Validity - Validade + Destroying unused detached columns... + - Windows func. + Assigning sequences to columns... - false + Creating object `%1' (%2), oid `%3'... - true - - - - Cache value + Trying to recreate object `%1' (%2), oid `%3'... + + + DatabaseModel - Cycle + The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2' - Increment + Loading: `%1' (%2) - Max. value + Validating relationships... - Min. value + Saving object `%1' (%2) - Start value + Saving metadata of the object `%1' (%2) - Last value + Metadata file successfully saved! - Subtype - Subtipo + Process successfully ended but no metadata was saved! + - Op. class + Creating object `%1' (%2) - Canonical func. + Object `%1' (%2) already exists. Ignoring. - Subtype diff func. + Loading metadata for object `%1' (%2) - Deferrable + Object `%1' (%2) not found. Ignoring metadata. - For each row + Metadata file successfully loaded! - Firing - Disparo + Generating %1 code: `%2' (%3) + + + + DatabaseWidget - On insert - + Template DB: + DB Modelo: - On delete - + Model Author: + Autor do Modelo: - On update - + Encoding: + Codificação: - On truncate - + LC_COLLATE: + - Arguments - Argumentos + Connections: + Conexões: - Table - Tabela + LC_CTYPE: + - Trigger func. - + Default + Padrão - Columns - Colunas + Attributes + Atributos - Condition + Default Objects - Deferment - + Tablespace: + Esp. de Tabela: - Event - Evento + Schema: + Esquema: - Execution mode - + Collation: + Intercalação: - Commands + Owner: - Position + The fields <strong>LC_COLLATE</strong> and <strong>LC_CTYPE</strong> have pre-configured values based upon the running system. You can freely modify those values if you intend to export the model to another host. - Comparison type + Use the above fields to specify the default attributes assigned to new objects created on the database model. Leaving a field empty will cause PostgreSQL to use the default values when exporting the model. - Ref. columns - + Options: + Opções: - Expressions + Allow connections - Fill factor + Is template + + + DomainWidget - No inherit - + Default Value: + Valor Padrão: - Op. classes - + Name: + Nome: - Operators - Operadores + Attributes + Atributos - Ref. table + Not null - Unique - Único + Check constraints + - Predicate - + Expression: + Expressão: - Collations - + Name + Nome - Inherited - + Expression + Expressão + + + DonateWidget - Snippets - + Form + Formulário - Drop object + Donate to pgModeler - Drop cascade + Hide this widget - Truncate + ... - Trunc. cascade + <html><head/><body><p>pgModeler is brought to you thanks to a <span style=" font-style:italic;">great effort to create and distribute a quality product</span>. This project is reaching out levels of maturity never imagined. All this is the result of a joint work between its author and the <span style=" font-weight:600;">Open Source community</span>. <br/><br/>This software has a long way to go yet and with your help we'll keep maintaining the good job and bringing new improvements on each release. If you did like pgModeler and thinks it deserves a contribution please make a donation!</p></body></html> - Show data + I want to help! + + + ElementsWidget - Reload properties - + Form + Formulário - Update - Atualizar + Column: + Coluna: - Rename - Renomear + Expression: + Expressão: - Source code - + Collation: + Intercalação: - Quick refresh - + Operator Class: + Classe de Operadores: - Full refresh - + Operator: + Operador: - Do you really want to drop the object <strong>%1</strong> <em>(%2)</em>? - + Sorting: + Ordenação: - Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it. - + Ascending + Ascendente - Do you really want to truncate the table <strong>%1</strong>? - + Descending + Descendente - Do you really want to <strong>cascade</strong> truncate the table <strong>%1</strong>? This action will truncate all the tables that depends on it? - + Nulls first + Nulos primeiro - Src. table: %1 -Src. column(s): %2 - + Element + Elemento - Ref. table: %1 -Ref. column(s): %2 - + Type + Tipo - -- Source code genaration for buil-in and base types currently unavailable -- - + Operator Class + Classe de Operadores - -- Source code unavailable for the object %1 (%2). -- - + Sorting + Ordenação - - - DatabaseImportForm - Database Import - + Nulls First + Nulos Primeiro - Database import - + Collation + Intercalação - Settings - + Operator + Operador - Options - + Expression + Expressão - Connection: - Conexão: + Yes + Sim - Origin point: - + No + Não + + + EventTriggerWidget - Starting point where objects will be put. - + Event: + Evento: - Tables per row: - + Function: + Função: - Tables per row + Filter - Spacing: + Tag: - Schemas per row + Tag command + + + Exception - Spacing between objects - + Assignment of a pseudo-type to the type of the column! + Atribuição de um pseudo-tipo ao tipo da coluna! - Schemas per row: - + Assignment of a precision greater than the length of the type! + Atribuição de precisão maior do que o comprimento do tipo! - Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. - + Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6! + Atribuição de precisão inválida a um tipo time, timestamp ou interval. A precisão neste caso deve ser igual ou inferior a 6! - Automatically resolve dependencies - - - - Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. - - - - Random colors for relationships - - - - Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. - - - - Import system objects - - - - Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. - - - - Import extension objects - - - - pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. - - - - Ignore import errors - - - - All catalog queries as well the created objects' source code are printed to standard output (stdout). - - - - Debug mode - - - - Create all imported objects in the current working model instead of create a new one. - - - - Import objects to the working model - - - - Database - Banco de Dados - - - Filter: - - - - Filter object by it's OID - - - - By OID - - - - Select all objects - - - - ... - - - - Clear object selection - - - - Expands all items - Expandir todos os itens - - - Collapses all items - Recolher todos os itens - - - Output - - - - Progress label... - Rótulo de progresso... - - - Cancel - Cancelar - - - &Import - - - - &Close - &Fechar - - - <strong>ATTENTION:</strong> You are about to import objects to the current working model! This action will cause irreversible changes to it even in case of critical errors during the process. Do you want to proceed? - - - - Importing process aborted! - - - - Importing process canceled by user! - - - - Importing process sucessfuly ended! - - - - No databases found - - - - Found %1 database(s) - - - - Retrieving objects from database... - - - - Retrieving cluster level objects... - - - - Retrieving objects of schema `%1'... - - - - Retrieving objects of table `%1'... - - - - This is a PostgreSQL built-in data type and cannot be imported. - - - - This is a pgModeler's built-in object. It will be ignored if checked by user. - - - - - DatabaseImportHelper - - Retrieving system objects... `%1' - - - - Retrieving objects... `%1' - - - - Creating object `%1' (%2)... - - - - Trying to recreate object `%1' (%2)... - - - - Import failed to recreate some objects in `%1' tries. - - - - Creating permissions for object `%1' (%2)... - - - - Creating columns permissions... - - - - Updating relationships of `%1' (%2)... - - - - Validating relationships... - - - - The database import ended but some errors were generated and saved into the log file `%1'. This file will last until pgModeler quit. - - - - Creating table inheritances... - - - - Destroying unused detached columns... - - - - Assigning sequences to columns... - - - - - DatabaseModel - - Loading object: %1 (%2) - Carregando objeto: %1 (%2) - - - Generating %1 of the object: %2 (%3) - Gerando %1 do objeto: %2 (%3) - - - The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2' - - - - Loading: `%1' (%2) - - - - Validating relationships... - - - - Generating %1 of the object `%2' (%3) - - - - Saving object `%1' (%2) - - - - Saving metadata of the object `%1' (%2) - - - - Metadata file successfully saved! - - - - Process successfully ended but no metadata was saved! - - - - Creating object `%1' (%2) - - - - Object `%1' (%2) already exists. Ignoring. - - - - Loading metadata for object `%1' (%2) - - - - Object `%1' (%2) not found. Ignoring metadata. - - - - Metadata file successfully loaded! - - - - - DatabaseWidget - - Form - Formulário - - - Template DB: - DB Modelo: - - - Model Author: - Autor do Modelo: - - - Encoding: - Codificação: - - - LC_COLLATE: - - - - Connections: - Conexões: - - - LC_CTYPE: - - - - Default - Padrão - - - Attributes - Atributos - - - Default Objects - - - - Tablespace: - Esp. de Tabela: - - - Schema: - Esquema: - - - Collation: - Intercalação: - - - Owner: - - - - The fields <strong>LC_COLLATE</strong> and <strong>LC_CTYPE</strong> have pre-configured values based upon the running system. You can freely modify those values if you intend to export the model to another host. - - - - Use the above fields to specify the default attributes assigned to new objects created on the database model. Leaving a field empty will cause PostgreSQL to use the default values when exporting the model. - - - - - DomainWidget - - Form - Formulário - - - Default Value: - Valor Padrão: - - - Constraint - Restrição - - - Name: - Nome: - - - Not Null: - Não Nulo: - - - Check Expr.: - Expr.Checagem: - - - - DominioWidget - - Default Value: - Valor Padrão: - - - Constraint Name: - Nome da Restrição: - - - Check Expression: - Expressão de Checagem: - - - Not Null: - Não Nulo: - - - - DonateWidget - - Form - Formulário - - - Donate to pgModeler - - - - Hide this widget - - - - ... - - - - <html><head/><body><p>pgModeler is brought to you thanks to a <span style=" font-style:italic;">great effort to create and distribute a quality product</span>. This project is reaching out levels of maturity never imagined. All this is the result of a joint work between its author and the <span style=" font-weight:600;">Open Source community</span>. <br/><br/>This software has a long way to go yet and with your help we'll keep maintaining the good job and bringing new improvements on each release. If you did like pgModeler and thinks it deserves a contribution please make a donation!</p></body></html> - - - - I want to help! - - - - - ElementsWidget - - Form - Formulário - - - Column: - Coluna: - - - Expression: - Expressão: - - - Collation: - Intercalação: - - - Operator Class: - Classe de Operadores: - - - Operator: - Operador: - - - Sorting: - Ordenação: - - - Ascending - Ascendente - - - Descending - Descendente - - - Nulls first - Nulos primeiro - - - Element - Elemento - - - Type - Tipo - - - Operator Class - Classe de Operadores - - - Sorting - Ordenação - - - Nulls First - Nulos Primeiro - - - Collation - Intercalação - - - Operator - Operador - - - Expression - Expressão - - - Yes - Sim - - - No - Não - - - - EspacoTabelaWidget - - Directory: - Diretório: - - - - EventTriggerWidget - - Event: - Evento: - - - Function: - Função: - - - Filter - - - - Tag: - - - - Tag command - - - - - Excecao - - Insufficient memory space to allocate the object! - Espaço em memória insuficiente para alocar o objeto! - - - Assignment of a pseudo-type to the type of the column! - Atribuição de um pseudo-tipo ao tipo da coluna! - - - Zero length assignment! - Atribuição de comprimento igual a zero! - - - Assignment of a precision greater than the length of the type! - Atribuição de precisão maior do que o comprimento do tipo! - - - Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6! - Atribuição de precisão inválida a um tipo time, timestamp ou interval. A precisão neste caso deve ser igual ou inferior a 6! - - - Assignment of a not allocated column to object '%1' (%2)! - Atribuição de coluna não alocada ao objeto '%1' (%2)! - - - Reference to a column which index is out of the capacity of the column list! - Referência a uma coluna com índice fora da capacidade da lista de colunas! - - - Assignment of not allocated object! - Atribuição de um objeto não alocado! - - - Assignment of a not allocated schema to object '%1' (%2)! - Atribuição de um esquema não alocado ao objeto '%1' (%2)! - - - The object '%1' (%2) has inconsistent configuration (invalid SQL/XML definition)! - O objeto '%1' (%2) possui configuração inconsistente (definição SQL/XML inválida)! - - - The object '%1' (%2) already exists in the list of elements of the same type in the object '%3' (%4)! - O objeto '%1' (%2) já existente na lista de elementos desse mesmo tipo no objeto '%3' (%4)! - - - The object '%1' (%2) can't be assigned because there is already exists in the container object '%3'! - O objeto '%1' (%2) não pode ser atribuído pois já existe no container de objetos '%3'! - - - Assignment of object of an invalid type! - Atribuição de objeto de tipo inválido! - - - Removing an object of an invalid type! - Remoção de objeto de tipo inválido! - - - Obtaining an object of an invalid type! - Obtenção de um objeto com tipo inválido! - - - Assignment of empty name to table return type! - Atribuição de nome vazio ao tipo de retorno de tabela! - - - The insertion of the parameter '%1' will not be possible because there is another parameter with same name in the function '%2'! - A inserção do parâmetro '%1' não será possível pois já existe outro parâmetro com mesmo nome na função '%2'! - - - The insertion of the table return type '%1' will not be possible because there is another return type with the same name in the '%2'! - A inserção do tipo de retorno de tabela '%1' não será possível pois já existe outro tipo de retorno com mesmo nome na função '%2'! - - - Reference to a parameter which index is out of the parameter list capacity! - Referência a um parâmetro com índice fora da capacidade da lista de parâmetros! - - - Reference to an event which does not belongs to trigger! - Referência a um evento não pertecente ao gatilho! - - - The column '%1' can't be assigned to the trigger '%2' because does not belongs to the trigger parent table! - A coluna '%1' não pode ser atribuída ao gatilho '%2' pois a mesma não pertence à tabela pai do gatilho! - - - Assignment of a not allocated function to object '%1' (%2)! - Atribuição de função não alocada ao objeto '%1' (%2)! - - - Assignment of a function which return type is different from 'trigger'! - Atribuição de função com tipo de retorno diferente de 'trigger'! - - - Assignment of a function which parameter count is invalid to the object '%1' (%2)! - Atribuição de função com número de parâmetros inválido ao objeto '%1' (%2)! - - - Assignment of a function which language is invalid! - Atribuição de função com linguagem inválida! - - - Assignment of not allocated table to object '%1' (%2)! - Atribuição de tabela não alocada ao objeto '%1' (%2)! - - - Reference to an argument which index is out of argument list capacity! - Referência a um argumento com índice fora da capacidade da lista de argumentos! - - - Insertion of a column which name is already registered to another column of the object! - Inserção de coluna com nome já registrado em outra coluna do objeto! - - - Assignment of empty name to an object! - Atribuição de nome vazio a um objeto! - - - Assignment of invalid name to an object! - Atribuição de nome inválido a um objeto! - - - Assignment of schema object which type is invalid! - Atribuição de um objeto esquema com tipo inválido! - - - Assignment of tablespace object with invalid type! - Atribuição de objeto espaço de tabela com tipo inválido! - - - Assignment of tablespace to an invalid object! - Atribuição de um espaço de tabela a um objeto de tipo inválido! - - - Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique! - Atribuição de um objeto espaço de tabela a uma restrição de tipo inválido! A restrição deve ser uma chave-primária ou única para pode pertencer a um espaço de tabela! - - - Assignment of owner object which type is invalid! - Atribuição de um objeto papel com tipo inválido! - - - Assignment of owner to an invalid object! - Atribuição de um dono a um objeto de tipo inválido! - - - Reference to a function with invalid type! - Referência a uma função com tipo inválido! - - - Reference to an argument of the operator with invalid type! - Referência a um argumento do operador com tipo inválido! - - - Reference to an operator with invalid type! - Referência a um operador com tipo inválido! - - - Assigment of value to an invalid option type on role! - Atribuição de valor a uma opção de tipo inválido no papel! - - - Reference to an invalid role type! - Referência a um tipo de papel inválido! - - - The insertion of the role '%1' is not possible because this is already being referenced by role '%2'! - A inserção do papel '%1' não será possível pois este já está sendo referenciado pelo papel '%2'! - - - Reference redundance detected by having the role '%1' referencing the role '%2'! - Referência redundante detectada ao fazer com que o papel '%1' referencie o papel '%2'! - - - The role '%1' can not be listed as a member of itself! - O papel '%1' não pode ser relacionado com um membro dele mesmo! - - - Reference to a paper which index is out of paper list capacity! - Referência a um papel com índice fora da capacidade da lista de papéis! - - - Insertion of null command to the rule! - Inserção de comando nulo à regra! - - - Reference to a command which index is out of the command list capacity! - Referência a um comando com índice fora da capacidade da lista de comandos! - - - Is not possible to create a self generalization/dependecy relationship! The table can not inherit or copy their own attributes! - Não é possível criar um auto-relacionamento de generalização ou dependência! A tabela não pode herdar ou copiar seus próprios atributos! - - - Assignment of an object that already belongs to another table! - Atribuição de um objeto o qual já pertence a outra tabela! - - - Assignment of a schema to the sequence which differs from the schema of the owner table! - Atribuição de esquema à seqüência o qual difere do esquema da tabela possuidora! - - - Assignment of an invalid value to one of the sequence attributes! - Atribuição de valor inválido a um dos atributos da seqüência! - - - Assignment of a minimum value to the sequence which is greater than the maximum value! - Atribuição de valor mínimo da seqüência maior do que o valor máximo! - - - Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values​​! - Atribuição de valor de início da seqüência extrapolando o intervalo definido pelos valores mínimo e máximo! - - - Assignment of a null increment value to the sequence! - Atribuição de incremento de seqüência com valor nulo! - - - Assignment of null cache value to the sequence! - Atribuição de cache de seqüência com valor nulo! - - - Assignment of owner table which is not in the same schema as the sequence '%1'! - Atribuição de tabela possuidora a qual não faz parte do mesmo esquema da seqüência '%1'! - - - Assignment of owner table which does not belong to the same owner of the sequence '%1'! - Atribuição de tabela possuidora a qual não pertence ao mesmo dono da seqüência '%1'! - - - Assignment of a nonexistent owner column to the sequence '%1'! - Atribuição de coluna possuidora inexistente à seqüência '%1'! - - - Assignment of an owner column to the sequence '%1' that is not related to any table! - Atribuição de uma coluna possuidora a sequencia '%1' a qual não está relacionada a nenhuma tabela! - - - Reference to a label which index is out of labels list capacity! - Referência a um rótulo com índice fora da capacidade da lista de rótulos! - - - Allocation of object with invalid type! - Alocação de objeto com tipo inválido! - - - Assignment of a function with invalid return type to object '%1' (%2)! - Atribuição de função com tipo de retorno inválido ao objeto '%1' (%2)! - - - Assignment of a function with invalid parameter(s) type(s) to object '%1' (%2)! - Atribuição de função com tipo de parâmetro(s) inválido(s) ao objeto '%1' (%2)! - - - Assignment of not allocated language! - Atribuição de linguagem não alocada! - - - Assignment of language object which type is invalid! - Atribuição de linguagem com tipo inválido! - - - Reference to data type with an index outside the capacity of data types list! - Referência a tipo de dado com índice fora da capacidade da lista de tipos de dados! - - - Assignment of a null type to to object '%1' (%2)! - Atribuição de tipo nulo ao objeto '%1' (%2)! - - - Assignment of invalid type to the object! - Atribuição de um tipo inválido ao objeto! - - - Assignment of an empty directory to object '%1' (%2)! - Atribuição de um diretório vazio ao objeto: '%1' (%2)! - - - Obtaining types with invalid quantity! - Obtenção de tipos com quantidade inválida! - - - Insertion of item which already exists in the attributes list of the type! - Inserção de item já existente na lista de atibutos do tipo! - - - Insertion of invalid item in the attributes list of the type! - Inserção de item inválido na lista de atibutos do tipo! - - - Insertion of item which already exists in the enumarations list of the type! - Inserção de item já existente na lista de enumerações do tipo! - - - Insertion of invalid item in the enumerations list of the type! - Inserção de item inválido na lista de emumerações do tipo! - - - Reference to an attribute which index is out of the attributes list capacity! - Referência a um atributo com índice fora da capacidade da lista de atributos! - - - Reference to an enumeration which index is out of the enumerations list capacity! - Referência a uma enumeração com índice fora da capacidade da lista de enumerações! - - - Assignment of invalid configuration to the type! - Atribuição de configuração inválida ao tipo! - - - The data type '%1' can not be assigned because it already exists in the types list of the aggregate function '%2'! - O tipo de dado '%1' não pode ser atribuído pois o mesmo já existente na lista de tipos da função de agregação '%2'! - - - Assignment of an operator which input type count is invalid to aggregate function! - Atribuição de operador a uma função de agregação com quantidade de tipos de entrada inválida! - - - Assigment of an operator which types of arguments is invalid! - Atribuição de operador com argumentos de tipos inválidos! - - - Assignment of system reserved name to the object '%1' (%2)! - Atribuição de nome reservado pelo sistema ao objeto '%1' (%2)! - - - One function with invalid configuration is been used by the object '%1' (%2)! - Uma função de configuração inválida está sendo usada pelo objeto '%1' (%2)! - - - Assignment of invalid id to the user! - Atribuição de id de usuário inválido! - - - Assignment of an invalid strategy/support number to an operator class element! - Atribuição de valor inválido ao número de estratégia/suporte do elemento de classe de operadores! - - - Insertion of element which already exists in the element list! - Inserção de elemento já existente na lista de elementos! - - - Reference to an element which index is out of element list capacity! - Referência a um elemento com índice fora da capacidade da lista de elementos! - - - Reference to an object which index is out of object list capacity! - Referência a um objeto com índice fora da capacidade da lista de objetos! - - - Removal of an object not allocated! - Remoção de objeto não alocado! - - - The object '%1' (%2) can not be removed because it is being referenced by object '%3' (%4)! - O objeto '%1' (%2) não pode ser removido pois está sendo referenciado pelo objeto '%3' (%4)! - - - The object '%1' (%2) can not be removed because it is being referenced by object '%3' (%4) that belongs to '%5' (%6)! - O objeto '%1' (%2) não pode ser removido pois está sendo referenciado pelo objeto '%3' (%4) pertecente à '%5' (%6)! - - - Operation with object(s) which type(s) is invalid! - Operação com objeto(s) de tipo(s) inválido(s)! - - - Reference to object with invalid type! - Referência a um objeto com tipo inválido! - - - Operation with object not allocated! - Operação com objeto não alocado! - - - The creation of the relationship '%1' between the table '%2' and '%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! - A criação do relacionamento '%1' entre as tabela '%2' e '%3' não pode ser feito pois uma delas não possui uma chave primária. Caso o relacionamento seja do tipo n-n ambas as tabelas devem possuir chaves primárias! - - - The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user! - O relacionamento do tipo 1-1 onde ambas as tabelas são de participação obrigatória não é implementado por necessitar de fusão entre tabelas o que quebra a modelagem feita pelo usuário! - - - Assignment of an invalid expression to the object! - Atribuição de expressão inválida ao objeto! - - - Assignment of a primary key to a table which already has one! - Atribuição de chave primária à uma tabela a qual já possui uma! - - - Identifier relationship can not be created for a self relationship, relationships of the type n-n, dependency or generalization! - Relacionamento identificador não pode ser criado para um autorelacionamentos, relacionamentos do tipo n-n, dependência ou generalização! - - - Unable to create a dependency relationship because the column '%1' in table '%2' already exists in table '%3'! - Impossível criar o relacionamento de dependência pois a coluna '%1' da tabela '%2' já existe na tabela '%3'! - - - Unable to create the generalization relationship because the column '%1' in table '%2' can not be merged with the column '%3' of table '%4' because they have incompatible types! - Impossível criar o relacionamento de generalização pois a coluna '%1' da tabela '%2' não pode ser fundida com a coluna '%3' da tabela '%4' por serem de tipos incompatíveis! - - - An attribute can not be added to a dependence or generalization relationship! - Um atributo não pode ser adicionado a um relacionamento de generalização ou dependência! - - - A foreign key can not be added to a relationship because is created automatically when this is connected! - Uma chave estrangeira não pode ser adicionado a um relacionamento pois esta é criada automaticamente no momento da ligação do mesmo! - - - The object '%1' (%2) is referencing the object '%3' (%4) which was not found in the list of objects of the same type in the model! - O objeto '%1' (%2) está referenciando o objeto '%3' (%4) o qual não foi encontrado na lista de objetos de mesmo tipo no modelo! - - - Reference to an user-defined data type that not exists in the model! - Referência a tipo de dado definido pelo usuário o qual não existe no modelo! - - - Assignment of invalid maximum size to operation list! - Atribuição de tamanho máximo inválido à lista de operações! - - - Unable to write the file %1! Make sure the directory exists, or if the user has access permissions on it! - Não foi possível salvar o arquivo %1! Certifique-se de que o diretório existe ou se o usuário tem permissão de acesso ao mesmo! - - - Unable to write the model in the file %1 due to one or more errors in the definition generation process! - Não foi possível gravar o modelo no arquivo %1 devido a um ou mais erros no processo de geração da definição do mesmo! - - - There is already a relationship between '%1' (%2) and '%3' (%4) in the model! - Já existe um relacionamento entre '%1' (%2) and '%3' (%4) no modelo! - - - The configuration of the relationship '%1' generates a redundancy between the relationships '%2'. Redundancy on identifier or generalization/dependency relationships are not accepted since they result in incorrect column spreading making the model inconsistent! - A configuração do relacionamento '%1' gera uma redundância entre os relacionamentos '%2'. Redundância de relacionamentos identificadores ou de generalização/dependência não são aceitos pois resultam em propagação incorreta de colunas tornando o modelo inconsiste! - - - One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! - Um ou mais objetos foram invalidados e automaticamente removidos pois os mesmos referenciavam colunas de tabelas as quais foram incluídas através de relacionamentos e que deixaram de existir devido a desconexão ou exclusão dos relacionamentos geradores de tais colunas! - - - The primary key '%1' can only be allocated if declared within a block of code that defines a table or relationship! - A chave-primária '%1' só pode ser alocada caso a mesma esteja declarada dentro de um bloco de código que define uma tabela ou relacionamento! - - - Reference to an invalid privilege type! - Referência a um tipo de privilégio inválido! - - - Insertion of an role which already exists in the role list of the permission! - Inserção de um papel já existente na lista de papéis da permissão! - - - Assignment of privilege incompatible with the type of object referenced by permission! - Atribuição de privilégio incompatível com o tipo do objeto referenciado pela permissão! - - - There is already a permission on object '%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! - Já existe uma permissão sobre o objeto '%1' (%2) a qual possui um ou mais papéis iguais aos presentes na permissão a ser atribuída ao objeto! - - - A permission is referencing the object '%1' (%2) which was not found in the model! - Uma permissão está referenciando o objeto '%1' (%2) o qual não foi encontrado no modelo! - - - The object '%1' (%2) can not be created by not being assigned to any schema! - O objeto '%1' (%2) não pode ser criado por não estar atribuído a nenhum esquema! - - - The tablespace '%1' can not be inserted into the model because it points to the same directory as the tablespace '%2'! - O espaço de tabela '%1' não pode ser inserido no modelo pois o mesmo aponta para o mesmo diretório que o espaço de tabela '%2'! - - - It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature! - Não é possível criar arrays de domínios ou sequências (dimensão >= 1)! O PostgreSQL ainda não implementa esta funcionalidade! - - - The function '%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! - A função '%1' não pode receber um código-fonte como definição pois sua linguagem está definida como C. Os atributos símbolo e biblioteca dinâmica é que devem ser utilizados! - - - The function '%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! - A função '%1' só pode ter os atributos de símbolo e biblioteca configurados caso sua linguagem esteja definida como C. Para os demais casos é necessário especificar um código-fonte que a define o SGBD! - - - The operator '%1' can not be assigned as a comutator of operator '%2' because it has incompatible settings! - O operador '%1' não pode ser atribuído como comutador do operador '%2' pois possui configuração incompatível! - - - The operator '%1' can not be assigned as negator of operator '%2' because it has incompatible settings! - O operador '%1' não pode ser atribuído como negador do operador '%2' pois possui configuração incompatível! - - - The type '%1' can not self refer in the attributes 'element' or 'copy type' or be used as a data type of an attribute in the configuration of a composite type! - O tipo '%1' não pode se referenciar nos atributos 'elemento' ou 'tipo cópia' ou ser usado como tipo de dado de um atributo na configuração de tipo composto! - - - Assignment of invalid element to type '%1'! - Atribuição de elemento inválido ao tipo '%1'! - - - Assignment of invalid alignment to type '%1'! - Atribuição de alinhamento inválido ao tipo '%1'! - - - Assignment of invalid name to the table generated from N-N relationship! - Atribuição de nome inválido à tabela gerada por relacionamento N-N! - - - The relationship '%1' can not make use of the special primary key. Only generalization/dependency relationships have access to this resource! - O relacionamento '%1' não pode fazer uso da chave-primária especial. Apenas relacionamentos de generalização/dependência têm acesso a este recurso! - - - Assignment of invalid suffix to the relationship '%1'! - Atribuição de sufixo inválido ao relacionamento '%1'! - - - The object '%1' (%2) can not be edited or deleted because it was automatically included through a relationship! To manipulate the object is necessary to make it from the edit form of the relationship that holds it. - O objeto '%1' (%2) não pode ser editado ou excluído por ter sido incluído automaticamente através de relacionamento! Para manipular o objeto é necessário fazê-lo a partir do formulário de edição do relacionamento que o detém. - - - The object '%1' (%2) can not be deleted because it is protected! - O objeto '%1' (%2) não pode ser excluído por estar protegido! - - - The group '%1' has already been declared earlier! - O grupo '%1' já foi declarado anteriormente! - - - The group '%1' can not be built in the groups declaration block ('%2')! - O grupo '%1' não pode ser construído no bloco de declaração de grupos ('%2')! - - - The group '%1' was built but not declared in the groups declaration block ('%2')! - O grupo '%1' foi construído porém não declarado no bloco de declaração de grupos ('%2')! - - - The group '%1' can not be built without possessing child elements! - O grupo '%1' não pode ser construído sem possuir elementos filhos! - - - The group '%1' can not be built once more because this was done in previous blocks! - O grupo '%1' não pode ser construído novamente pois já foi construído em blocos anteriores! - - - The group '%1' has been declared but not built! - O grupo '%1' foi declarado porém não construído! - - - Reference to a column of objects table with invalid index! - Referência a uma coluna da tabela de objetos com índice inválido! - - - Reference to a row of objects table with invalid index! - Referência a uma linha da tabela de objetos com índice inválido! - - - The schema public and the languages plpgsql, c and sql can not be manipulated because they are reserved to PostgreSQL! They are present in the model database only as a reference! - O esquema 'public' e as linguagens 'plpgsql', 'c' e 'sql' não podem ser manipuladas por serem reservados ao PostgreSQL! Os mesmos estão presentes no modelo de banco de dados apenas como referência! - - - The new configuration function invalidates the object '%1' (%2)! In this case it is needed to undo the relationship between the affected object and function so that the new configuration of the latter to take effect! - A nova configuração da função invalida o objeto '%1' (%2) o qual a referencia! Neste caso é necessário desfazer a relação entre o objeto afetado e a função para que a nova configuração desta última seja efetivada! - - - A vision reference must have at least one SQL application : SELECT, FROM, FROM-WHERE or After WHERE! - Uma referência de visão deve possuir pelo menos uma aplicação SQL: SELECT-FROM, FROM-WHERE ou Após WHERE! - - - Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns! - Restrições do tipo chave-primária, chave-estrangeira ou única devem possuir pelo menos uma coluna relacionada às mesmas! Para chaves-estrangeira devem ser selecionadas, adicionalmente, as colunas referenciadas! - - - Unable to load one or more configuration files! Please check if files exists in the configuration folder and if they are not corrupted to preventing this error to occur again on the next startup! - Não foi possível carregar um ou mais arquivos de configuração! Por favor, cheque se os arquivos existem na pasta de configurações e se o mesmos não estão corrompidos para que este erro não se repita na próxima inicialização! - - - Could not find the default settings file '%1'! To restore default settings check the existence of the file and try again! - Não foi possível encontrar o arquivo de configurações padrão '%1'! Para restaurar as configurações padrão cheque a existência do referido arquivo e tente novamente! - - - The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack! - -** Executed SQL command: ** - -%1 - O processo de exportação falhou devido a um erro disparado pelo servidor PostgreSQL na tentativa de execução de um comando SQL. Para obter mais detalhes sobre erro cheque a pilha de exceções! - -** Comando SQL executado: ** - -%1 - - - Could not load the plugin '%1' from the library '%2'! Message returned by plugin manager: '%3' - Não foi possível carregar o plugin '%1' a partir da biblioteca '%2'! Mensagem retornada pelo gerenciador de plugins: '%3' - - - One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details. - Um ou mais plugins não foram ativados devido a erros no processo de carregamento! Verifique a pilha de exceções para mais detalhes. - - - Invalid syntax in file %1, line %2, column %3! - Sintaxe inválida no arquivo %1, linha %2, coluna %3! - - - Invalid conditional instruction '%1' on file %2, line %3, column %4! - Instrução condicional '%1' inválida no arquivo %2, linha %3, coluna %4! - - - Unknown attribute '%1' in file %2, line %3, column %4! - Atributo '%1' desconhecido no arquivo %2, linha %3, coluna %4! - - - Invalid metacharacter '%1' in file %2, line %3, column %4! - Metacaractere '%1' inválido no arquivo %2, linha %3, coluna %4! - - - Attribute '%1' with an undefined value in file %2, line %3, column %4! - Atributo '%1' com valor indefinido no arquivo %2, linha %3, coluna %4! - - - Assignment of empty XML buffer to parser! - Atribuição de buffer de código XML vazio ao parser! - - - Could not access the file or directory %1! Make sure that it exists or if the user has access permissions on it! - Não foi possível acessar o arquivo ou diretório %1! Certifique-se de que o mesmo existe e o usuário possui permissões de acesso a ele! - - - Assignment of empty DTD file name! - Atribuição de nome de arquivo DTD vazio! - - - Assignment of empty name to the DTD declaration! - Atribuição de nome vazio à declaração DTD! - - - Error while interpreting XML buffer at line %1 column %2. -Message generated by the parser: '%3'. %4 - Erro ao interpretar buffer XML na linha %1 coluna %2. - Mensagem gerada pelo parser: '%3'. %4 - - - Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated! - Operação sobre árvore de elementos não alocada! É necessário carregar o buffer XML do parser e interpretá-lo para que a árvore seja gerada! - - - Could not load file %1. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! - Não foi possível carregar o arquivo %1. O mesmo parece estar inconsistente ou uma de suas dependências (arquivos DTD) possui erros ou está ausente! - - - Operation with unallocated tree element! - Operação com elemento de árvore de elementos não alocado! - - - Operation with element which does not exists in the element tree currently loaded! - Operação com elemento o qual não faz parte da árvore de elementos carregada atualmente! - - - Assignment of a value to an invalid connection parameter! - Atribuição de valor a um parâmetro de conexão inválido! - - - Operation on connection not established! - Operação sobre conexão não estabelecida! - - - Attempt to connect without define configuration parameters! - Tentativa de conexão sem parâmetros de configuração definidos! - - - Could not connect to the database. -Message returned: '%1' - Não foi possível estabelecer conexão com o banco de dados. -Mensagem retornada: '%1' - - - Assignment of not allocated SQL command result! - Atribuição de resultado de comando SQL não alocado! - - - Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client! - Não foi possível alocar o resultado do comando SQL pois a resposta do SGBD não foi compreendida pelo cliente! - - - Unable to allocate command result for the SQL because the server has generated a fatal error! -Message returned by the DBMS: %1 - Não foi possível alocar o resultado do comando SQL pois o servidor gerou um erro fatal! -Mensagem retornada pelo SGBD: %1 - - - Unable to allocate the result of the SQL command because the command passed was an empty SQL! - Não foi possível alocar o resultado do comando SQL pois o comando passado foi uma SQL vazia! - - - Reference to a column of tuple with invalid index! - Referência à uma coluna da tupla com índice inválido! - - - Reference to a column of tuple with invalid name! - Referência à uma coluna da tupla com nome inválido! - - - Reference to a tuple with index invalid or the result is empty (no tuples)! - Referência à uma tupla com índice inválido ou o resultado está vazio (sem tuplas)! - - - Could not execute the SQL command. - Message returned: %1 - Não foi possível executar o comando SQL. - Mensagem retornada: %1 - - - - Exception - - Insufficient memory space to allocate the object! - Espaço em memória insuficiente para alocar o objeto! - - - Assignment of a pseudo-type to the type of the column! - Atribuição de um pseudo-tipo ao tipo da coluna! - - - Zero length assignment! - Atribuição de comprimento igual a zero! - - - Assignment of a precision greater than the length of the type! - Atribuição de precisão maior do que o comprimento do tipo! - - - Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6! - Atribuição de precisão inválida a um tipo time, timestamp ou interval. A precisão neste caso deve ser igual ou inferior a 6! - - - Assignment of a not allocated column to object '%1' (%2)! - Atribuição de coluna não alocada ao objeto '%1' (%2)! - - - Reference to a column which index is out of the capacity of the column list! - Referência a uma coluna com índice fora da capacidade da lista de colunas! - - - Assignment of not allocated object! - Atribuição de um objeto não alocado! - - - Assignment of a not allocated schema to object '%1' (%2)! - Atribuição de um esquema não alocado ao objeto '%1' (%2)! - - - The object '%1' (%2) has inconsistent configuration (invalid SQL/XML definition)! - O objeto '%1' (%2) possui configuração inconsistente (definição SQL/XML inválida)! - - - The object '%1' (%2) already exists in the list of elements of the same type in the object '%3' (%4)! - O objeto '%1' (%2) já existente na lista de elementos desse mesmo tipo no objeto '%3' (%4)! - - - The object '%1' (%2) can't be assigned because there is already exists in the container object '%3'! - O objeto '%1' (%2) não pode ser atribuído pois já existe no container de objetos '%3'! - - - Removing an object of an invalid type! - Remoção de objeto de tipo inválido! - - - Obtaining an object of an invalid type! - Obtenção de um objeto com tipo inválido! - - - Assignment of empty name to table return type! - Atribuição de nome vazio ao tipo de retorno de tabela! - - - The insertion of the parameter '%1' will not be possible because there is another parameter with same name in the function '%2'! - A inserção do parâmetro '%1' não será possível pois já existe outro parâmetro com mesmo nome na função '%2'! - - - The insertion of the table return type '%1' will not be possible because there is another return type with the same name in the '%2'! - A inserção do tipo de retorno de tabela '%1' não será possível pois já existe outro tipo de retorno com mesmo nome na função '%2'! - - - Reference to an event which does not belongs to trigger! - Referência a um evento não pertecente ao gatilho! - - - Assignment of a not allocated function to object '%1' (%2)! - Atribuição de função não alocada ao objeto '%1' (%2)! - - - Assignment of a function which return type is different from 'trigger'! - Atribuição de função com tipo de retorno diferente de 'trigger'! - - - Assignment of a function which parameter count is invalid to the object '%1' (%2)! - Atribuição de função com número de parâmetros inválido ao objeto '%1' (%2)! - - - Assignment of a function which language is invalid! - Atribuição de função com linguagem inválida! - - - Assignment of not allocated table to object '%1' (%2)! - Atribuição de tabela não alocada ao objeto '%1' (%2)! - - - Insertion of a column which name is already registered to another column of the object! - Inserção de coluna com nome já registrado em outra coluna do objeto! - - - Assignment of empty name to an object! - Atribuição de nome vazio a um objeto! - - - Assignment of invalid name to an object! - Atribuição de nome inválido a um objeto! - - - Assignment of schema object which type is invalid! - Atribuição de um objeto esquema com tipo inválido! - - - Assignment of tablespace object with invalid type! - Atribuição de objeto espaço de tabela com tipo inválido! - - - Assignment of tablespace to an invalid object! - Atribuição de um espaço de tabela a um objeto de tipo inválido! - - - Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique! - Atribuição de um objeto espaço de tabela a uma restrição de tipo inválido! A restrição deve ser uma chave-primária ou única para pode pertencer a um espaço de tabela! - - - Assignment of owner object which type is invalid! - Atribuição de um objeto papel com tipo inválido! - - - Assignment of owner to an invalid object! - Atribuição de um dono a um objeto de tipo inválido! - - - Reference to a function with invalid type! - Referência a uma função com tipo inválido! - - - Reference to an argument of the operator with invalid type! - Referência a um argumento do operador com tipo inválido! - - - Reference to an operator with invalid type! - Referência a um operador com tipo inválido! - - - Reference to an invalid role type! - Referência a um tipo de papel inválido! - - - The insertion of the role '%1' is not possible because this is already being referenced by role '%2'! - A inserção do papel '%1' não será possível pois este já está sendo referenciado pelo papel '%2'! - - - The role '%1' can not be listed as a member of itself! - O papel '%1' não pode ser relacionado com um membro dele mesmo! - - - Assignment of an object that already belongs to another table! - Atribuição de um objeto o qual já pertence a outra tabela! - - - Assignment of a schema to the sequence which differs from the schema of the owner table! - Atribuição de esquema à seqüência o qual difere do esquema da tabela possuidora! - - - Assignment of an invalid value to one of the sequence attributes! - Atribuição de valor inválido a um dos atributos da seqüência! - - - Assignment of a minimum value to the sequence which is greater than the maximum value! - Atribuição de valor mínimo da seqüência maior do que o valor máximo! - - - Assignment of a null increment value to the sequence! - Atribuição de incremento de seqüência com valor nulo! - - - Assignment of null cache value to the sequence! - Atribuição de cache de seqüência com valor nulo! - - - Assignment of owner table which is not in the same schema as the sequence '%1'! - Atribuição de tabela possuidora a qual não faz parte do mesmo esquema da seqüência '%1'! - - - Assignment of owner table which does not belong to the same owner of the sequence '%1'! - Atribuição de tabela possuidora a qual não pertence ao mesmo dono da seqüência '%1'! - - - Assignment of a nonexistent owner column to the sequence '%1'! - Atribuição de coluna possuidora inexistente à seqüência '%1'! - - - Assignment of an owner column to the sequence '%1' that is not related to any table! - Atribuição de uma coluna possuidora a sequencia '%1' a qual não está relacionada a nenhuma tabela! - - - Allocation of object with invalid type! - Alocação de objeto com tipo inválido! - - - Assignment of a function with invalid return type to object '%1' (%2)! - Atribuição de função com tipo de retorno inválido ao objeto '%1' (%2)! - - - Assignment of a function with invalid parameter(s) type(s) to object '%1' (%2)! - Atribuição de função com tipo de parâmetro(s) inválido(s) ao objeto '%1' (%2)! - - - Assignment of not allocated language! - Atribuição de linguagem não alocada! - - - Assignment of language object which type is invalid! - Atribuição de linguagem com tipo inválido! - - - Reference to data type with an index outside the capacity of data types list! - Referência a tipo de dado com índice fora da capacidade da lista de tipos de dados! - - - Assignment of a null type to to object '%1' (%2)! - Atribuição de tipo nulo ao objeto '%1' (%2)! - - - Assignment of invalid type to the object! - Atribuição de um tipo inválido ao objeto! - - - Assignment of an empty directory to object '%1' (%2)! - Atribuição de um diretório vazio ao objeto: '%1' (%2)! - - - Obtaining types with invalid quantity! - Obtenção de tipos com quantidade inválida! - - - Insertion of item which already exists in the attributes list of the type! - Inserção de item já existente na lista de atibutos do tipo! - - - Insertion of invalid item in the attributes list of the type! - Inserção de item inválido na lista de atibutos do tipo! - - - Insertion of item which already exists in the enumarations list of the type! - Inserção de item já existente na lista de enumerações do tipo! - - - Insertion of invalid item in the enumerations list of the type! - Inserção de item inválido na lista de emumerações do tipo! - - - Assignment of invalid configuration to the type! - Atribuição de configuração inválida ao tipo! - - - The data type '%1' can not be assigned because it already exists in the types list of the aggregate function '%2'! - O tipo de dado '%1' não pode ser atribuído pois o mesmo já existente na lista de tipos da função de agregação '%2'! - - - Assignment of system reserved name to the object '%1' (%2)! - Atribuição de nome reservado pelo sistema ao objeto '%1' (%2)! - - - One function with invalid configuration is been used by the object '%1' (%2)! - Uma função de configuração inválida está sendo usada pelo objeto '%1' (%2)! - - - Assignment of invalid id to the user! - Atribuição de id de usuário inválido! - - - Assignment of an invalid strategy/support number to an operator class element! - Atribuição de valor inválido ao número de estratégia/suporte do elemento de classe de operadores! - - - Insertion of element which already exists in the element list! - Inserção de elemento já existente na lista de elementos! - - - Removal of an object not allocated! - Remoção de objeto não alocado! - - - The object '%1' (%2) can not be removed because it is being referenced by object '%3' (%4)! - O objeto '%1' (%2) não pode ser removido pois está sendo referenciado pelo objeto '%3' (%4)! - - - The object '%1' (%2) can not be removed because it is being referenced by object '%3' (%4) that belongs to '%5' (%6)! - O objeto '%1' (%2) não pode ser removido pois está sendo referenciado pelo objeto '%3' (%4) pertecente à '%5' (%6)! - - - Operation with object(s) which type(s) is invalid! - Operação com objeto(s) de tipo(s) inválido(s)! - - - Reference to object with invalid type! - Referência a um objeto com tipo inválido! - - - Operation with object not allocated! - Operação com objeto não alocado! - - - The creation of the relationship '%1' between the table '%2' and '%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! - A criação do relacionamento '%1' entre as tabela '%2' e '%3' não pode ser feito pois uma delas não possui uma chave primária. Caso o relacionamento seja do tipo n-n ambas as tabelas devem possuir chaves primárias! - - - The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user! - O relacionamento do tipo 1-1 onde ambas as tabelas são de participação obrigatória não é implementado por necessitar de fusão entre tabelas o que quebra a modelagem feita pelo usuário! - - - Assignment of an invalid expression to the object! - Atribuição de expressão inválida ao objeto! - - - Assignment of a primary key to a table which already has one! - Atribuição de chave primária à uma tabela a qual já possui uma! - - - Unable to create the generalization relationship because the column '%1' in table '%2' can not be merged with the column '%3' of table '%4' because they have incompatible types! - Impossível criar o relacionamento de generalização pois a coluna '%1' da tabela '%2' não pode ser fundida com a coluna '%3' da tabela '%4' por serem de tipos incompatíveis! - - - A foreign key can not be added to a relationship because is created automatically when this is connected! - Uma chave estrangeira não pode ser adicionado a um relacionamento pois esta é criada automaticamente no momento da ligação do mesmo! - - - The object '%1' (%2) is referencing the object '%3' (%4) which was not found in the list of objects of the same type in the model! - O objeto '%1' (%2) está referenciando o objeto '%3' (%4) o qual não foi encontrado na lista de objetos de mesmo tipo no modelo! - - - Reference to an user-defined data type that not exists in the model! - Referência a tipo de dado definido pelo usuário o qual não existe no modelo! - - - Assignment of invalid maximum size to operation list! - Atribuição de tamanho máximo inválido à lista de operações! - - - Unable to write the file %1! Make sure the directory exists, or if the user has access permissions on it! - Não foi possível salvar o arquivo %1! Certifique-se de que o diretório existe ou se o usuário tem permissão de acesso ao mesmo! - - - Unable to write the model in the file %1 due to one or more errors in the definition generation process! - Não foi possível gravar o modelo no arquivo %1 devido a um ou mais erros no processo de geração da definição do mesmo! - - - There is already a relationship between '%1' (%2) and '%3' (%4) in the model! - Já existe um relacionamento entre '%1' (%2) and '%3' (%4) no modelo! - - - One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! - Um ou mais objetos foram invalidados e automaticamente removidos pois os mesmos referenciavam colunas de tabelas as quais foram incluídas através de relacionamentos e que deixaram de existir devido a desconexão ou exclusão dos relacionamentos geradores de tais colunas! - - - The primary key '%1' can only be allocated if declared within a block of code that defines a table or relationship! - A chave-primária '%1' só pode ser alocada caso a mesma esteja declarada dentro de um bloco de código que define uma tabela ou relacionamento! - - - Reference to an invalid privilege type! - Referência a um tipo de privilégio inválido! - - - Assignment of privilege incompatible with the type of object referenced by permission! - Atribuição de privilégio incompatível com o tipo do objeto referenciado pela permissão! - - - There is already a permission on object '%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! - Já existe uma permissão sobre o objeto '%1' (%2) a qual possui um ou mais papéis iguais aos presentes na permissão a ser atribuída ao objeto! - - - A permission is referencing the object '%1' (%2) which was not found in the model! - Uma permissão está referenciando o objeto '%1' (%2) o qual não foi encontrado no modelo! - - - The tablespace '%1' can not be inserted into the model because it points to the same directory as the tablespace '%2'! - O espaço de tabela '%1' não pode ser inserido no modelo pois o mesmo aponta para o mesmo diretório que o espaço de tabela '%2'! - - - It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature! - Não é possível criar arrays de domínios ou sequências (dimensão >= 1)! O PostgreSQL ainda não implementa esta funcionalidade! - - - The function '%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! - A função '%1' não pode receber um código-fonte como definição pois sua linguagem está definida como C. Os atributos símbolo e biblioteca dinâmica é que devem ser utilizados! - - - The function '%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! - A função '%1' só pode ter os atributos de símbolo e biblioteca configurados caso sua linguagem esteja definida como C. Para os demais casos é necessário especificar um código-fonte que a define o SGBD! - - - The operator '%1' can not be assigned as a comutator of operator '%2' because it has incompatible settings! - O operador '%1' não pode ser atribuído como comutador do operador '%2' pois possui configuração incompatível! - - - The operator '%1' can not be assigned as negator of operator '%2' because it has incompatible settings! - O operador '%1' não pode ser atribuído como negador do operador '%2' pois possui configuração incompatível! - - - The type '%1' can not self refer in the attributes 'element' or 'copy type' or be used as a data type of an attribute in the configuration of a composite type! - O tipo '%1' não pode se referenciar nos atributos 'elemento' ou 'tipo cópia' ou ser usado como tipo de dado de um atributo na configuração de tipo composto! - - - Assignment of invalid element to type '%1'! - Atribuição de elemento inválido ao tipo '%1'! - - - Assignment of invalid alignment to type '%1'! - Atribuição de alinhamento inválido ao tipo '%1'! - - - Assignment of invalid name to the table generated from N-N relationship! - Atribuição de nome inválido à tabela gerada por relacionamento N-N! - - - Assignment of invalid suffix to the relationship '%1'! - Atribuição de sufixo inválido ao relacionamento '%1'! - - - The object '%1' (%2) can not be edited or deleted because it was automatically included through a relationship! To manipulate the object is necessary to make it from the edit form of the relationship that holds it. - O objeto '%1' (%2) não pode ser editado ou excluído por ter sido incluído automaticamente através de relacionamento! Para manipular o objeto é necessário fazê-lo a partir do formulário de edição do relacionamento que o detém. - - - The object '%1' (%2) can not be deleted because it is protected! - O objeto '%1' (%2) não pode ser excluído por estar protegido! - - - The group '%1' has already been declared earlier! - O grupo '%1' já foi declarado anteriormente! - - - The group '%1' can not be built in the groups declaration block ('%2')! - O grupo '%1' não pode ser construído no bloco de declaração de grupos ('%2')! - - - The group '%1' was built but not declared in the groups declaration block ('%2')! - O grupo '%1' foi construído porém não declarado no bloco de declaração de grupos ('%2')! - - - The group '%1' can not be built without possessing child elements! - O grupo '%1' não pode ser construído sem possuir elementos filhos! - - - The group '%1' can not be built once more because this was done in previous blocks! - O grupo '%1' não pode ser construído novamente pois já foi construído em blocos anteriores! - - - The group '%1' has been declared but not built! - O grupo '%1' foi declarado porém não construído! - - - The schema public and the languages plpgsql, c and sql can not be manipulated because they are reserved to PostgreSQL! They are present in the model database only as a reference! - O esquema 'public' e as linguagens 'plpgsql', 'c' e 'sql' não podem ser manipuladas por serem reservados ao PostgreSQL! Os mesmos estão presentes no modelo de banco de dados apenas como referência! - - - The new configuration function invalidates the object '%1' (%2)! In this case it is needed to undo the relationship between the affected object and function so that the new configuration of the latter to take effect! - A nova configuração da função invalida o objeto '%1' (%2) o qual a referencia! Neste caso é necessário desfazer a relação entre o objeto afetado e a função para que a nova configuração desta última seja efetivada! - - - Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns! - Restrições do tipo chave-primária, chave-estrangeira ou única devem possuir pelo menos uma coluna relacionada às mesmas! Para chaves-estrangeira devem ser selecionadas, adicionalmente, as colunas referenciadas! - - - Unable to load one or more configuration files! Please check if files exists in the configuration folder and if they are not corrupted to preventing this error to occur again on the next startup! - Não foi possível carregar um ou mais arquivos de configuração! Por favor, cheque se os arquivos existem na pasta de configurações e se o mesmos não estão corrompidos para que este erro não se repita na próxima inicialização! - - - Could not find the default settings file '%1'! To restore default settings check the existence of the file and try again! - Não foi possível encontrar o arquivo de configurações padrão '%1'! Para restaurar as configurações padrão cheque a existência do referido arquivo e tente novamente! - - - The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack! - -** Executed SQL command: ** - -%1 - O processo de exportação falhou devido a um erro disparado pelo servidor PostgreSQL na tentativa de execução de um comando SQL. Para obter mais detalhes sobre erro cheque a pilha de exceções! - -** Comando SQL executado: ** - -%1 - - - Could not load the plugin '%1' from the library '%2'! Message returned by plugin manager: '%3' - Não foi possível carregar o plugin '%1' a partir da biblioteca '%2'! Mensagem retornada pelo gerenciador de plugins: '%3' - - - One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details. - Um ou mais plugins não foram ativados devido a erros no processo de carregamento! Verifique a pilha de exceções para mais detalhes. - - - Invalid syntax in file %1, line %2, column %3! - Sintaxe inválida no arquivo %1, linha %2, coluna %3! - - - Invalid conditional instruction '%1' on file %2, line %3, column %4! - Instrução condicional '%1' inválida no arquivo %2, linha %3, coluna %4! - - - Unknown attribute '%1' in file %2, line %3, column %4! - Atributo '%1' desconhecido no arquivo %2, linha %3, coluna %4! - - - Invalid metacharacter '%1' in file %2, line %3, column %4! - Metacaractere '%1' inválido no arquivo %2, linha %3, coluna %4! - - - Attribute '%1' with an undefined value in file %2, line %3, column %4! - Atributo '%1' com valor indefinido no arquivo %2, linha %3, coluna %4! - - - Assignment of empty XML buffer to parser! - Atribuição de buffer de código XML vazio ao parser! - - - Could not access the file or directory %1! Make sure that it exists or if the user has access permissions on it! - Não foi possível acessar o arquivo ou diretório %1! Certifique-se de que o mesmo existe e o usuário possui permissões de acesso a ele! - - - Assignment of empty DTD file name! - Atribuição de nome de arquivo DTD vazio! - - - Assignment of empty name to the DTD declaration! - Atribuição de nome vazio à declaração DTD! - - - Error while interpreting XML buffer at line %1 column %2. -Message generated by the parser: '%3'. %4 - Erro ao interpretar buffer XML na linha %1 coluna %2. - Mensagem gerada pelo parser: '%3'. %4 - - - Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated! - Operação sobre árvore de elementos não alocada! É necessário carregar o buffer XML do parser e interpretá-lo para que a árvore seja gerada! - - - Could not load file %1. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! - Não foi possível carregar o arquivo %1. O mesmo parece estar inconsistente ou uma de suas dependências (arquivos DTD) possui erros ou está ausente! - - - Operation with unallocated tree element! - Operação com elemento de árvore de elementos não alocado! - - - Operation with element which does not exists in the element tree currently loaded! - Operação com elemento o qual não faz parte da árvore de elementos carregada atualmente! - - - Assignment of a value to an invalid connection parameter! - Atribuição de valor a um parâmetro de conexão inválido! - - - Operation on connection not established! - Operação sobre conexão não estabelecida! - - - Attempt to connect without define configuration parameters! - Tentativa de conexão sem parâmetros de configuração definidos! - - - Could not connect to the database. -Message returned: '%1' - Não foi possível estabelecer conexão com o banco de dados. -Mensagem retornada: '%1' - - - Assignment of not allocated SQL command result! - Atribuição de resultado de comando SQL não alocado! - - - Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client! - Não foi possível alocar o resultado do comando SQL pois a resposta do SGBD não foi compreendida pelo cliente! - - - Unable to allocate command result for the SQL because the server has generated a fatal error! -Message returned by the DBMS: %1 - Não foi possível alocar o resultado do comando SQL pois o servidor gerou um erro fatal! -Mensagem retornada pelo SGBD: %1 - - - Unable to allocate the result of the SQL command because the command passed was an empty SQL! - Não foi possível alocar o resultado do comando SQL pois o comando passado foi uma SQL vazia! - - - Reference to a column of tuple with invalid index! - Referência à uma coluna da tupla com índice inválido! - - - Reference to a column of tuple with invalid name! - Referência à uma coluna da tupla com nome inválido! - - - Reference to a tuple with index invalid or the result is empty (no tuples)! - Referência à uma tupla com índice inválido ou o resultado está vazio (sem tuplas)! - - - Could not execute the SQL command. - Message returned: %1 - Não foi possível executar o comando SQL. - Mensagem retornada: %1 - - - Assignment of a not allocated column to object `%1' (%2)! - - - - Assignment of a not allocated schema to object `%1' (%2)! - - - - The object `%1' (%2) has inconsistent SQL or XML definition! - - - - The object `%1' (%2) already exists on `%3' (%4)! - - - - The object `%1' (%2) cannot be assigned because there is already exists in the container object `%3'! - - - - Assigning object of an invalid type! - - - - The insertion of the parameter `%1' will not be possible because there is another parameter with same name in the function `%2'! - - - - The insertion of the table return type `%1' will not be possible because there is another return type with the same name in the `%2'! - - - - Reference to a parameter which index is out of the parameter list bounds! - - - - The column `%1' cannot be assigned to the trigger `%2' because they belongs to different parent tables! - - - - Assignment of a not allocated function to object `%1' (%2)! - - - - Assignment of a function which return type is different from `%1'! - - - - Assignment of a function which parameter count is invalid to the object `%1' (%2)! - - - - Event trigger function must be coded in any language other than SQL! - - - - Assignment of not allocated table to object `%1' (%2)! - - - - Reference to an argument which index is out of argument list bounds! - - - - Assignment of a name which contains invalid characters! - - - - Assignment of a name which length exceeds the maximum of 63 characters! - - - - Assignment of appended or prepended SQL to an invalid object! - - - - Assignment of value to an invalid option type on role! - - - - The insertion of the role `%1' is not possible because this is already being referenced by role `%2'! - - - - Reference redundancy detected by having the role `%1' referencing the role `%2'! - - - - The role `%1' can not be listed as a member of itself! - - - - Reference to a role which index is out of role list bounds! - - - - Insertion of empty command to the rule! - - - - Reference to a command which index is out of the command list bounds! - - - - Is not possible to create a self generalization/copy relationship! The table can not inherit or copy their own attributes! - - - - Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values! - - - - Assignment of owner table which is not in the same schema as the sequence `%1'! - - - - Assignment of owner table which does not belong to the same owner of the sequence `%1'! - - - - Assignment of a nonexistent owner column to the sequence `%1'! - - - - Assignment of an owner column to the sequence `%1' that is not related to any table! - - - - Reference to a label which index is out of labels list bounds! - - - - Assignment of a function with invalid return type to object `%1' (%2)! - - - - Assignment of a function with invalid parameter(s) type(s) to object `%1' (%2)! - - - - Assignment of a null type to object `%1' (%2)! - - - - Assignment of an empty directory to object `%1' (%2)! - - - - Reference to an attribute which index is out of the attributes list bounds! - - - - Reference to an enumeration which index is out of the enumerations list bounds! - - - - Assignment of an operator which input type count is invalid to aggregate function! - - - - Assignment of an operator which types of arguments is invalid! - - - - Assignment of system reserved name to the object `%1' (%2)! - - - - One function with invalid configuration is been used by the object `%1' (%2)! - - - - Reference to an element which index is out of element list bounds! - - - - Reference to an object which index is out of object list bounds! - - - - The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4)! - - - - The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4) that belongs to `%5' (%6)! - - - - The creation of the relationship `%1' between the table `%2' and `%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! - - - - Identifier relationship can not be created for a self relationship, relationships of the type n-n, copy or generalization! - - - - Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'! - - - - Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types! - - - - Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition! - - - - An attribute can not be added to a copy or generalization relationship! - - - - The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model! - - - - Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it! - - - - Unable to write the file `%1' due to one or more errors in the definition generation process! - - - - There is already a relationship between `%1' (%2) and `%3' (%4) in the model! - - - - The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent! - - - - The primary key `%1' can only be allocated if declared within a block of code that defines a table or relationship! - - - - Insertion of a role which already exists in the role list of the permission! - - - - There is already a permission on object `%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! - - - - A permission is referencing the object `%1' (%2) which was not found in the model! - - - - The object `%1' (%2) can not be created because its not being assigned to any schema! - + Reference to a column which index is out of the capacity of the column list! + Referência a uma coluna com índice fora da capacidade da lista de colunas! - The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'! - + Assignment of not allocated object! + Atribuição de um objeto não alocado! - The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! - + Removing an object of an invalid type! + Remoção de objeto de tipo inválido! - The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! - + Obtaining an object of an invalid type! + Obtenção de um objeto com tipo inválido! - The operator `%1' can not be assigned as a comutator of operator `%2' because it has incompatible settings! - + Assignment of empty name to table return type! + Atribuição de nome vazio ao tipo de retorno de tabela! - The operator `%1' can not be assigned as negator of operator `%2' because it has incompatible settings! - + Reference to an event which does not belongs to trigger! + Referência a um evento não pertecente ao gatilho! - The type `%1' can not self refer in the attributes `element' or `copy type' or be used as a data type of an attribute in the configuration of a composite type! - + Assignment of a function which language is invalid! + Atribuição de função com linguagem inválida! - Assignment of invalid element to type `%1'! - + Assignment of empty name to an object! + Atribuição de nome vazio a um objeto! - Assignment of invalid alignment to type `%1'! - + Assignment of schema object which type is invalid! + Atribuição de um objeto esquema com tipo inválido! - The relationship `%1' can not make use of the special primary key because it is marked as identifier or it is a self relationship! - + Assignment of tablespace object with invalid type! + Atribuição de objeto espaço de tabela com tipo inválido! - The object `%1' (%2) can not be edited or deleted because it was automatically included through a relationship! If the object is an attribute or constraint the modifications must be done on the relationship editing form. - + Assignment of tablespace to an invalid object! + Atribuição de um espaço de tabela a um objeto de tipo inválido! - The object `%1' (%2) can not be deleted because it is protected! - + Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique! + Atribuição de um objeto espaço de tabela a uma restrição de tipo inválido! A restrição deve ser uma chave-primária ou única para pode pertencer a um espaço de tabela! - The group `%1' has already been declared earlier! - + Assignment of owner object which type is invalid! + Atribuição de um objeto papel com tipo inválido! - The group `%1' can not be built in the groups declaration block (%2)! - + Assignment of owner to an invalid object! + Atribuição de um dono a um objeto de tipo inválido! - The group `%1' was built but not declared in the groups declaration block (%2)! - + Reference to a function with invalid type! + Referência a uma função com tipo inválido! - The group `%1' can not be built without possessing child elements! - + Reference to an argument of the operator with invalid type! + Referência a um argumento do operador com tipo inválido! - The group `%1' can not be built once more because this was done in previous blocks! - + Reference to an operator with invalid type! + Referência a um operador com tipo inválido! - The group `%1' has been declared but not built! - + Reference to an invalid role type! + Referência a um tipo de papel inválido! - Reference to a column of the objects table with invalid index! - + Assignment of an object that already belongs to another table! + Atribuição de um objeto o qual já pertence a outra tabela! - Reference to a row of the objects table with invalid index! - + Assignment of a schema to the sequence which differs from the schema of the owner table! + Atribuição de esquema à seqüência o qual difere do esquema da tabela possuidora! - The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference! - + Assignment of an invalid value to one of the sequence attributes! + Atribuição de valor inválido a um dos atributos da seqüência! - The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect! - + Assignment of a minimum value to the sequence which is greater than the maximum value! + Atribuição de valor mínimo da seqüência maior do que o valor máximo! - A view reference must be used in at least one these SQL scopes: View Definition, SELECT-FROM, FROM-WHERE or After WHERE! - + Assignment of a null increment value to the sequence! + Atribuição de incremento de seqüência com valor nulo! - Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again! - + Assignment of null cache value to the sequence! + Atribuição de cache de seqüência com valor nulo! - Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3' - + Allocation of object with invalid type! + Alocação de objeto com tipo inválido! - Invalid instruction `%1' on file %2, line %3, column %4! - + Assignment of not allocated language! + Atribuição de linguagem não alocada! - Unknown attribute `%1' in file %2, line %3, column %4! - + Assignment of language object which type is invalid! + Atribuição de linguagem com tipo inválido! - Invalid metacharacter `%1' in file %2, line %3, column %4! - + Reference to data type with an index outside the capacity of data types list! + Referência a tipo de dado com índice fora da capacidade da lista de tipos de dados! - Invalid operator `%1' in comparison expression, file %2, line %3, column %4! - + Assignment of invalid type to the object! + Atribuição de um tipo inválido ao objeto! - Attribute `%1' with an undefined value in file %2, line %3, column %4! - + Obtaining types with invalid quantity! + Obtenção de tipos com quantidade inválida! - Attribute `%1' with an invalid name in file %2, line %3, column %4! - + Insertion of item which already exists in the attributes list of the type! + Inserção de item já existente na lista de atibutos do tipo! - Error while interpreting XML buffer at line %1 column %2. -Message generated by the parser: %3. %4 - + Insertion of invalid item in the attributes list of the type! + Inserção de item inválido na lista de atibutos do tipo! - Attempt to start a connection already stablished! - + Insertion of item which already exists in the enumarations list of the type! + Inserção de item já existente na lista de enumerações do tipo! - Could not connect to the database. -Message returned: `%1' - + Insertion of invalid item in the enumerations list of the type! + Inserção de item inválido na lista de emumerações do tipo! - Unable to allocate command result for the SQL because the server has generated a fatal error! -Message returned by the DBMS: `%1' - + Assignment of invalid configuration to the type! + Atribuição de configuração inválida ao tipo! - Reference to a tuple with an invalid index or the result is empty (no tuples)! - + Assignment of an invalid strategy/support number to an operator class element! + Atribuição de valor inválido ao número de estratégia/suporte do elemento de classe de operadores! - Reference to a column of a tuple which was not yet initialized (tuple navigation not started)! - + Insertion of element which already exists in the element list! + Inserção de elemento já existente na lista de elementos! - Could not execute the SQL command. - Message returned: `%1' - + Removal of an object not allocated! + Remoção de objeto não alocado! - Invalid use of a view reference as whole SQL definition! The assigned reference must be an expression! - + Operation with object(s) which type(s) is invalid! + Operação com objeto(s) de tipo(s) inválido(s)! - Assignment of a second definition expression to the view! - + Reference to object with invalid type! + Referência a um objeto com tipo inválido! - It is not possible mix ordinary references (SELECT-FROM, FROM-WHERE, After WHERE) with references used as view SQL definition! - + Operation with object not allocated! + Operação com objeto não alocado! - Assignment of collation object which type is invalid! - + The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user! + O relacionamento do tipo 1-1 onde ambas as tabelas são de participação obrigatória não é implementado por necessitar de fusão entre tabelas o que quebra a modelagem feita pelo usuário! - At the moment pgModeler does not support the creation of primary keys which some columns were generated by relationship connection. To create primary keys with this feature you can use the field `Identifier' or the tab `Primary key' on relationship editing form! - + Assignment of an invalid expression to the object! + Atribuição de expressão inválida ao objeto! - Collations must be created at least with attributes LC_COLLATE and LC_CTYPE defined! - + Assignment of a primary key to a table which already has one! + Atribuição de chave primária à uma tabela a qual já possui uma! - The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object! - + A foreign key can not be added to a relationship because is created automatically when this is connected! + Uma chave estrangeira não pode ser adicionado a um relacionamento pois esta é criada automaticamente no momento da ligação do mesmo! - Only operator families which uses `btree' as indexing method are accepted by operator class elements! - + Reference to an user-defined data type that not exists in the model! + Referência a tipo de dado definido pelo usuário o qual não existe no modelo! - Reference to an invalid copy table option! - + Assignment of invalid maximum size to operation list! + Atribuição de tamanho máximo inválido à lista de operações! - Copy relationship between tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table! - + One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! + Um ou mais objetos foram invalidados e automaticamente removidos pois os mesmos referenciavam colunas de tabelas as quais foram incluídas através de relacionamentos e que deixaram de existir devido a desconexão ou exclusão dos relacionamentos geradores de tais colunas! - The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers! - + Reference to an invalid privilege type! + Referência a um tipo de privilégio inválido! - The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table! - + Assignment of privilege incompatible with the type of object referenced by permission! + Atribuição de privilégio incompatível com o tipo do objeto referenciado pela permissão! - The INSTEAD OF mode cannot be used on view triggers that executes for each statement! - + It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature! + Não é possível criar arrays de domínios ou sequências (dimensão >= 1)! O PostgreSQL ainda não implementa esta funcionalidade! - Constraint triggers can only be executed on AFTER events and for each row! - + Assignment of invalid name to the table generated from N-N relationship! + Atribuição de nome inválido à tabela gerada por relacionamento N-N! - A view trigger cannot be AFTER/BEFORE when it executes for each row! - + Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns! + Restrições do tipo chave-primária, chave-estrangeira ou única devem possuir pelo menos uma coluna relacionada às mesmas! Para chaves-estrangeira devem ser selecionadas, adicionalmente, as colunas referenciadas! - A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event! - + The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack! + +** Executed SQL command: ** + +%1 + O processo de exportação falhou devido a um erro disparado pelo servidor PostgreSQL na tentativa de execução de um comando SQL. Para obter mais detalhes sobre erro cheque a pilha de exceções! + +** Comando SQL executado: ** + +%1 - Assignment of a column which has no parent table to the object `%1' (%2)! - + One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details. + Um ou mais plugins não foram ativados devido a erros no processo de carregamento! Verifique a pilha de exceções para mais detalhes. - Only constraint triggers can be deferrable or reference another table! - + Assignment of empty XML buffer to parser! + Atribuição de buffer de código XML vazio ao parser! - Reference to a function id which is incompatible with the user define type configuration! - + Assignment of empty DTD file name! + Atribuição de nome de arquivo DTD vazio! - The operator class assigned to the object `%1' (%2) must use `btree' as indexing method! - + Assignment of empty name to the DTD declaration! + Atribuição de nome vazio à declaração DTD! - Unsupported PostgreSQL version (%1) detected! Valid versions are: %2 - + Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated! + Operação sobre árvore de elementos não alocada! É necessário carregar o buffer XML do parser e interpretá-lo para que a árvore seja gerada! - The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack! - + Operation with unallocated tree element! + Operação com elemento de árvore de elementos não alocado! - The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified! - + Operation with element which does not exists in the element tree currently loaded! + Operação com elemento o qual não faz parte da árvore de elementos carregada atualmente! - The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'! - + Assignment of a value to an invalid connection parameter! + Atribuição de valor a um parâmetro de conexão inválido! - Assignement of an invalid object name pattern to the relationship `%1'! - + Operation on connection not established! + Operação sobre conexão não estabelecida! - Reference to an invalid object name pattern id on the relationship `%1'! - + Attempt to connect without define configuration parameters! + Tentativa de conexão sem parâmetros de configuração definidos! - Invalid use of variadic parameter mode! This mode can be used only with an array or "any" data type! - + Assignment of not allocated SQL command result! + Atribuição de resultado de comando SQL não alocado! - Mixing incompatibles DBMS export modes: `ignore object duplications', `drop database' or `drop objects' cannot be used with `simulate export'! - + Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client! + Não foi possível alocar o resultado do comando SQL pois a resposta do SGBD não foi compreendida pelo cliente! - Mixing incompatibles DROP options: `drop database' and `drop objects' cannot be used at the same time! - + Reference to a column of tuple with invalid index! + Referência à uma coluna da tupla com índice inválido! - Invalid object id swapping operation! The objects involved are the same! - + Reference to a column of tuple with invalid name! + Referência à uma coluna da tupla com nome inválido! - Invalid object id swapping operation! The database itself, tablespaces or roles cannot have the ids swapped! + Assignment of a not allocated column to object `%1' (%2)! - The widget already has a parent and cannot be assigned to a different object! + Assignment of a not allocated schema to object `%1' (%2)! - The object `%1' (%2) could not be imported due to one or more errors! Check the exception stack for more details. + The object `%1' (%2) has inconsistent SQL or XML definition! - Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case. + The object `%1' (%2) already exists on `%3' (%4)! - The column `%1' cannot reference it's parent table `%2' as data type! + The object `%1' (%2) cannot be assigned because there is already exists in the container object `%3'! - Operation with an invalid element id `%1'! + Assigning object of an invalid type! - Reference to an invalid color id `%1' for element `%2'! + The insertion of the parameter `%1' will not be possible because there is another parameter with same name in the function `%2'! - Assignment of an invalid object to `%1' (%2)! The assigned object must be of type `%3'. + The insertion of the table return type `%1' will not be possible because there is another return type with the same name in the `%2'! - The sequence `%1' can't be assigned to the column `%2' because the data type of the latter is incompatible. The type used must be an integer one! + Reference to a parameter which index is out of the parameter list bounds! - The option to generate temporary object names can only be used in simulation mode! + The column `%1' cannot be assigned to the trigger `%2' because they belongs to different parent tables! - It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function or a sequence object must be directly assigned to the column! + Assignment of a not allocated function to object `%1' (%2)! - Could not assign the variable `%1' to event trigger's filter. Currently, PostgreSQL supports only the `TAG' variable! + Assignment of a function which return type is different from `%1'! - Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. - - ** Returned error ** - -%4 + Assignment of a function which parameter count is invalid to the object `%1' (%2)! - Malformed unescaped value on row `%1' column `%2'! + Event trigger function must be coded in any language other than SQL! - Trying to undo/redo an invalid operation over an object that does not exists anymore or can't be handled! The operation history will be cleaned up. + Assignment of not allocated table to object `%1' (%2)! - The object `%1' (%2) can't be handled because some needed fields are not set! Please, make sure to fill at least the requires fields in order to properly create or update the object. + Reference to an argument which index is out of argument list bounds! - A relationship can only be swapped by other object of the same kind! + Assignment of a name which contains invalid characters! - A parent table of `%1' which OID is `%2' was not found in the set of imported objects! + Assignment of a name which length exceeds the maximum of 63 characters! - The enumeration `%1' can't be assigned to the type `%2' because contains invalid characters! + Assignment of appended or prepended SQL to an invalid object! - The enumeration `%1' can't be assigned to the type `%2' because is too long! + Assignment of value to an invalid option type on role! - The connection was idle for too long and was automatically closed! + The insertion of the role `%1' is not possible because this is already being referenced by role `%2'! - The connection was unexpectedly closed by the database server `%1' at port `%2'! + Reference redundancy detected by having the role `%1' referencing the role `%2'! - - - ExportHelper - - PostgreSQL %1 version code generation... - Geração de código do PostgreSQL versão %1... - - PostgreSQL version detection overrided. Using version %1... - Detecção de versão do PostgreSQL sobreposta. Usando versão %1... + The role `%1' can not be listed as a member of itself! + - PostgreSQL %1 server detected... - Servidor PostgreSQL %1 detectado... + Reference to a role which index is out of role list bounds! + - Ignoring object duplication error... - Ignorando erro de duplicação de objeto... + Insertion of empty command to the rule! + - Creating object '%1' (%2)... - Criando objeto '%1' (%2)... + Reference to a command which index is out of the command list bounds! + - Creating database '%1'... - Criando banco de dados '%1'... + Is not possible to create a self generalization/copy relationship! The table can not inherit or copy their own attributes! + - Connecting to database '%1'... - Conectando ao banco de dados '%1'... + Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values! + - Creating objects on database '%1'... - Criando objetos no banco de dados '%1'... + Assignment of owner table which is not in the same schema as the sequence `%1'! + - - - ExtensionWidget - Version: - Versão: + Assignment of owner table which does not belong to the same owner of the sequence `%1'! + - Old Version: + Assignment of a nonexistent owner column to the sequence `%1'! - This attribute cannot be changed once the object is created. + Assignment of an owner column to the sequence `%1' that is not related to any table! - Handles data type + Reference to a label which index is out of labels list bounds! - - - FamiliaOperadoresWidget - Indexing: - Indexação: + Assignment of a function with invalid return type to object `%1' (%2)! + - - - FindReplaceWidget - Form - Formulário + Assignment of a function with invalid parameter(s) type(s) to object `%1' (%2)! + - Replace one occurrence + Assignment of a null type to object `%1' (%2)! - Replace + Assignment of an empty directory to object `%1' (%2)! - Replace all occurrences + Reference to an attribute which index is out of the attributes list bounds! - Replace All + Reference to an enumeration which index is out of the enumerations list bounds! - Replace the selection and find the next one + Assignment of an operator which input type count is invalid to aggregate function! - Replace && Find + Assignment of an operator which types of arguments is invalid! - Replace: + Assignment of system reserved name to the object `%1' (%2)! - Find: + One function with invalid configuration is been used by the object `%1' (%2)! - Find previous + Reference to an element which index is out of element list bounds! - Shift+F3 + Reference to an object which index is out of object list bounds! - Find next + The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4)! - F3 + The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4) that belongs to `%5' (%6)! - Case sensitive + The creation of the relationship `%1' between the table `%2' and `%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! - Regular expression + Identifier relationship can not be created for a self relationship, relationships of the type n-n, copy or generalization! - Whole words + Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'! - - - FormBasico - &Apply - &Aplicar + Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types! + - &Cancel - &Cancelar + Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition! + - - - FormConfiguracao - pgModeler Configuration - Configurações do pgModeler + An attribute can not be added to a copy or generalization relationship! + - &Apply - &Aplicar + The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model! + - &Cancel - &Cancelar + Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it! + - Defaults - Padrões + Unable to write the file `%1' due to one or more errors in the definition generation process! + - General - Geral + The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent! + - Style - Aparência + The primary key `%1' can only be allocated if declared within a block of code that defines a table or relationship! + - Connetions - Conexões + Insertion of a role which already exists in the role list of the permission! + - Confirmation - Confirmação + There is already a permission on object `%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! + - Any modification made until now in the current section will be lost! Do you really want to restore default settings? - Qualquer modificação feita até agora na seção atual será perdida! Deseja realmente restaurar as configurações padrão? + A permission is referencing the object `%1' (%2) which was not found in the model! + - - - FormExportacao - Model Export - Exportação do Modelo + The object `%1' (%2) can not be created because its not being assigned to any schema! + - Select the export type: - Selecione o tipo de exportação do modelo: + The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'! + - File: - Arquivo: + The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! + - Select target file - Selecionar arquivo de destino + The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! + - PostgreSQL version in which the SQL code should be generated - Versão do PostgreSQL no qual do código SQL deve ser gerado + The operator `%1' can not be assigned as a comutator of operator `%2' because it has incompatible settings! + - Check if the system user has write permission on target folder. - Certifique-se que o usuário do sistema possui permissão de gravação sobre a pasta de destino do arquivo SQL. + The operator `%1' can not be assigned as negator of operator `%2' because it has incompatible settings! + - Options: - Opções: + The type `%1' can not self refer in the attributes `element' or `copy type' or be used as a data type of an attribute in the configuration of a composite type! + - Show grid - Exibir grade + Assignment of invalid element to type `%1'! + - Ignore object duplicity - Ignorar duplicidade de objetos + Assignment of invalid alignment to type `%1'! + - The pgModeler ignores errors generated by duplicate objects and creates only model objects that do not exist in the database. This option may be used when an object was created after a later model export. - O pgModeler ignora os erros gerados por duplicidade de objetos e cria apenas objetos do modelo não existentes no banco de dados serão. Esta opção pode ser usada quando um objeto foi criado no modelo posteriormente a uma exportação. + The relationship `%1' can not make use of the special primary key because it is marked as identifier or it is a self relationship! + - Export to DBMS: - Exportação para o SGBD: + The object `%1' (%2) can not be edited or deleted because it was automatically included through a relationship! If the object is an attribute or constraint the modifications must be done on the relationship editing form. + - Connection: - Conexão: + The object `%1' (%2) can not be deleted because it is protected! + - It is recommended to select this option only when the version of the DBMS, somehow, is not identifiable or if you need to generate a specific version of SQL code for testing. - Recomenda-se marcar esta opção somente quando a versão do SGBD, de alguma forma, não seja identificável ou se é necessário gerar uma versão específica de código SQL para testes. + The group `%1' has already been declared earlier! + - &Export - &Exportar + The group `%1' can not be built in the groups declaration block (%2)! + - &Close - &Fechar + The group `%1' was built but not declared in the groups declaration block (%2)! + - Generating source code... - Gerando código-fonte... + The group `%1' can not be built without possessing child elements! + - Initializing model export... - Iniciando exportação do modelo... + The group `%1' can not be built once more because this was done in previous blocks! + - Saving file '%1' - Salvando arquivo '%1' + The group `%1' has been declared but not built! + - Creating object '%1' (%2)... - Criando objeto '%1' (%2)... + Reference to a column of the objects table with invalid index! + - Creating database '%1'... - Criando banco de dados '%1'... + Reference to a row of the objects table with invalid index! + - Connecting to database '%1'... - Conectando ao banco de dados '%1'... + The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference! + - Creating objects on database '%1'... - Criando objetos No banco de dados '%1'... + The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect! + - Exporting process sucessfuly ended! - Exportação finalizada com sucesso! + A view reference must be used in at least one these SQL scopes: View Definition, SELECT-FROM, FROM-WHERE or After WHERE! + - Error on export! - Falha na exportação! + Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again! + - Export model as... - Exportar modelo como... + Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3' + - SQL code (*.sql);;All files (*.*) - Código SQL (*.sql);;Todos os Arquivos (*.*) + Error while interpreting XML buffer at line %1 column %2. +Message generated by the parser: %3. %4 + - PNG image (*.png);;All files (*.*) - Imagem PNG (*.png);;Todos os Arquivos (*.*) + Attempt to start a connection already stablished! + - Export to SQL file: - Exportação para arquivo SQL: + Could not connect to the database. +Message returned: `%1' + - Export to PNG image: - Exportação para imagem PNG: + Unable to allocate command result for the SQL because the server has generated a fatal error! +Message returned by the DBMS: `%1' + - Image: - Imagem: + Reference to a tuple with an invalid index or the result is empty (no tuples)! + - Show the page delimiters - Exibir limites de páginas + Reference to a column of a tuple which was not yet initialized (tuple navigation not started)! + - Check if the system user has write permission on image target folder. - Certifique-se que o usuário do sistema possui permissão de gravação sobre a pasta de destino da imagem. + Could not execute the SQL command. + Message returned: `%1' + - - - FormPrincipal - File - Arquivo + Invalid use of a view reference as whole SQL definition! The assigned reference must be an expression! + - Edit - Editar + Assignment of a second definition expression to the view! + - Help - Ajuda + It is not possible mix ordinary references (SELECT-FROM, FROM-WHERE, After WHERE) with references used as view SQL definition! + - Show - Exibir + Assignment of collation object which type is invalid! + - New - Novo + At the moment pgModeler does not support the creation of primary keys which some columns were generated by relationship connection. To create primary keys with this feature you can use the field `Identifier' or the tab `Primary key' on relationship editing form! + - Save - Salvar + Collations must be created at least with attributes LC_COLLATE and LC_CTYPE defined! + - Zoom - - Diminuir zoom + The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object! + - Load - Carregar + Only operator families which uses `btree' as indexing method are accepted by operator class elements! + - Next - Próximo + Reference to an invalid copy table option! + - Previous - Anterior + Copy relationship between tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table! + - Exit - Sair + The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers! + - About pgModeler - Sobre o pgModeler + The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table! + - Print - Imprimir + The INSTEAD OF mode cannot be used on view triggers that executes for each statement! + - Undo - Desfazer + Constraint triggers can only be executed on AFTER events and for each row! + - Redo - Refazer + A view trigger cannot be AFTER/BEFORE when it executes for each row! + - Export - Exportar + A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event! + - Show grid - Exibir grade + Assignment of a column which has no parent table to the object `%1' (%2)! + - Align to grid - Alinhar à grade + Only constraint triggers can be deferrable or reference another table! + - Fullscreen - Tela cheia + Reference to a function id which is incompatible with the user define type configuration! + - Show the model on fullscreen mode - Exibe o modelo em tela cheia + The operator class assigned to the object `%1' (%2) must use `btree' as indexing method! + - Show the page delimiters - Exibe os limitadores de página + The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack! + - Configurations - Configurações + The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified! + - Save all models - Salvar modelos + The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'! + - Some models were modified! Do you want to save them before finish the pgModeler? - Alguns modelos foram modificados! Deseja salvar todos antes de encerrar o pgModeler? + Assignement of an invalid object name pattern to the relationship `%1'! + - Save '%1' as... - Salvar '%1' como... + Reference to an invalid object name pattern id on the relationship `%1'! + - Print grid - Imprimir grade + Invalid use of variadic parameter mode! This mode can be used only with an array or "any" data type! + - Print page numbers - Imprimir número de páginas + Mixing incompatibles DBMS export modes: `ignore object duplications', `drop database' or `drop objects' cannot be used with `simulate export'! + - Model Options - Opções do modelo + Mixing incompatibles DROP options: `drop database' and `drop objects' cannot be used at the same time! + - Confirmation - Confirmação + Invalid object id swapping operation! The objects involved are the same! + - Load model - Carregar modelo + Invalid object id swapping operation! The database itself, tablespaces or roles cannot have the ids swapped! + - Overview - Visão Geral + The widget already has a parent and cannot be assigned to a different object! + - Show the model overview - Exibe a visão geral do modelo + Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case. + - Zoom in - Zoom + + The column `%1' cannot reference it's parent table `%2' as data type! + - Zoom out - Zoom - + Operation with an invalid element id `%1'! + - Save as - Salvar como + Reference to an invalid color id `%1' for element `%2'! + - Close model - Fechar modelo + Assignment of an invalid object to `%1' (%2)! The assigned object must be of type `%3'. + - Normal zoom - Zoom normal + The sequence `%1' can't be assigned to the column `%2' because the data type of the latter is incompatible. The type used must be an integer one! + - Align objects position to grid - Alinhar objetos à grade + The option to generate temporary object names can only be used in simulation mode! + - Show delimiters - Exibir limites + It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function or a sequence object must be directly assigned to the column! + - Save all - Salvar todos + Could not assign the variable `%1' to event trigger's filter. Currently, PostgreSQL supports only the `TAG' variable! + - Database model printing - Impressão do modelo de banco de dados + Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. + + ** Returned error ** + +%4 + - Changes were detected in the definitions of paper/margin of the model which may cause the incorrect print of the objects. Do you want to continue printing using the new settings? To use the default settings click 'No' or 'Cancel' to abort printing. - Foram detectadas modificações nas definições de papel/margem do modelo o que pode provocar a impressão incorreta dos objetos. Deseja prosseguir com a impressão usando as novas configurações? Para usar as configurações padrão clique 'Não' ou em 'Cancelar' para abortar a impressão. + Malformed unescaped value on row `%1' column `%2'! + - Tools - Ferramentas + Trying to undo/redo an invalid operation over an object that does not exists anymore or can't be handled! The operation history will be cleaned up. + - View - Exibição + The object `%1' (%2) can't be handled because some needed fields are not set! Please, make sure to fill at least the requires fields in order to properly create or update the object. + - Model - Modelo + A relationship can only be swapped by other object of the same kind! + - Database model (*.dbm);;All files (*.*) - Modelo de banco de dados (*.dbm);; Todos os arquivos (*.*) + A parent table of `%1' which OID is `%2' was not found in the set of imported objects! + - Save model - Salvar modelo + The enumeration `%1' can't be assigned to the type `%2' because contains invalid characters! + - The model were modified! Do you want to save it before close? - O modelo foi modificado! Deseja salvá-lo antes de fechar? + The enumeration `%1' can't be assigned to the type `%2' because is too long! + - - - FormRestauracaoModelo - Modified: %1 - Modificado: %1 + The connection was idle for too long and was automatically closed! + - yyyy-MM-dd hh:mm:ss - dd/MM/yyyy hh:mm:ss + The connection was unexpectedly closed by the database server `%1' at port `%2'! + - - - FormRestauracaoModelos - Model restoration - Restauração de modelos + There is already a relationship between `%1' (%2) and `%3' (%4) in the model! When using relationships of the type generalization, copy and one-to-one there can't be other relationships linked to the pair of tables. + - &Restore - &Restaurar + Unable to load the configuration file `%1'! Please check if file exists in its folder and/or if it is not corrupted! + - &Cancel - &Cancelar + Invalid syntax in file `%1', line %2, column %3! + - pgModeler was not closed properly in a previous execution and some models were still being edited. Click 'Restore' to reopen the models or 'Cancel' to abort the restoration. - pgModeler não foi encerrado corretamente em uma execução anterior e alguns modelos ainda estavam em edição. Clique 'Restaurar' para reabrir os modelos ou 'Cancelar' para abortar a restauração. + Invalid instruction `%1' on file `%2', line %3, column %4! + - - - FormSobre - Version %1 - Versão %1 + Unknown attribute `%1' in file `%2', line %3, column %4! + - Close - Fechar + Invalid metacharacter `%1' in file `%2', line %3, column %4! + - Copyright 2006-2012 - Raphael Araújo e Silva <rkhaotix@gmail.com> - -The pgModeler project is a CASE tool for modeling relational databases for PostgreSQL DBMS through the use of modeling techniques from entity-relationship diagrams as well merging concepts that PostgreSQL implements. - -Special thanks to friends of the software development team of the Legislative Assembly, Tocantins, Brazil: Michel de Almeida, Felipe Santana, Jonas Nepomuceno, Ricardo Ishibashi and Álvaro Nunes. - Copyright 2006-2012 - Raphael Araújo e Silva <rkhaotix@gmail.com> - -O projeto pgModeler trata de uma ferramenta CASE para a criação de modelos de bancos de dados relacionais para o SGDB PostgreSQL através do uso de técnicas de modelagem de diagramas entidade-relacionamento, como também mesclando conceitos implementados pelo próprio PostgreSQL. - -Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Assembleia Legislativa, Tocantins, Brasil: Michel de Almeida, Felipe Santana, Jonas Nepomuceno, Ricardo Ishibashi and Álvaro Nunes. + Invalid operator `%1' in comparison expression, file `%2', line %3, column %4! + - About pgModeler - Sobre o pgModeler + Attribute `%1' with an undefined value in file `%2', line %3, column %4! + - Design, configure, deploy - Desenhe, configure, implante + Attribute `%1' with an invalid name in file `%2', line %3, column %4! + - - - FuncaoAgregacaoWidget - Final Function: - Função Final: + Could not access the file or directory `%1'! Make sure that it exists or if the user has access permissions on it! + - Transition Function: - Função de Transição: + Could not load file `%1'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! + - Sort Operator: - Operador de Ordenação: + Unsupported PostgreSQL version (%1) detected! Valid versions are between %2 and %3. + - Final Condition: - Condição Inicial: + The object `%1' (%2), oid `%3', could not be imported due to one or more errors! Check the exception stack for more details. `HINT:' if the object somehow references objects in `pg_catalog' or `information_schema' consider enable the importing of system objects. + - Funtion Inputs - Entradas da Função + Failed to drop the database `%1' because it is defined as the default database for the connection `%2'! + - Function State - Estado da Função + The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it! + - Input Data Type - Tipo de Dados de Entrada + The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'. + - State Data Type - Tipo de Dado de Estado + Reference to an invalid affected command in policy `%1'! + - An aggregate function that accepts the types <em><strong>typeA</strong></em> and <em><strong>typeB</strong></em> as input types and which type of state is <em><strong>state_type</strong></em>, must obey the following rules: <br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Final Function:</strong> <em>void final_function(<strong>state_type</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Transition Function:</strong> <em><strong>state_type</strong> transition_function(<strong>state_type</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> - Uma função de agregação que aceita os tipos <em><strong>tipoA</strong></em> e <em><strong>tipoB</strong></em> como entrada e cujo tipo de estado seja <em><strong>tipo_estado</strong></em>, deve obedecer às seguintes regras:<br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Função Final:</strong> <em>void funcao_final(<strong>tipo_estado</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Função Transição:</strong> <em><strong>tipo_estado</strong> funcao_transicao(<strong>tipo_estado</strong>, <strong>tipoA</strong>, <strong>tipoB</strong>)</em> + Reference to an invalid special role in policy `%1'! + - FuncaoWidget - - Attributes - Atributos - + ExtensionWidget - Langague: - Linguagem: + Version: + Versão: - Function Type: - Tipo de Função: + Old Version: + - Window Function: - Função Janela: + This attribute cannot be changed once the object is created. + - Execution Cost: - Custo de Execução: + Handles data type + + + + FindReplaceWidget - Rows Returned: - Linhas Retornadas: + Form + Formulário - Behavior: - Comportamento: + Replace one occurrence + - Security: - Segurança: + Replace + - Return Method: - Método de Retorno: + Replace all occurrences + - Simple - Simples + Replace All + - Set - Conjunto + Replace the selection and find the next one + - Table - Tabela + Replace && Find + - Parameters - Parâmetros + Replace: + - Definition - Definição + Find: + - Dynamic Library: - Biblioteca Dinâmica: + Find previous + - Symbol: - Símbolo: + Shift+F3 + - Library: - Biblioteca: + Find next + - Source code: - Código-Fonte: + F3 + - Column - Coluna + Case sensitive + - Type - Tipo + Regular expression + - Name - Nome + Whole words + - Default Value - Valor Padrão + Hide this widget + - Return Table - Tabela de retorno + ... + FunctionWidget - - Form - Formulário - Attributes Atributos @@ -6698,26 +4271,10 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Function Type: Tipo de Função: - - Langague: - Linguagem: - - - Simple - Simples - Set Conjunto - - Table - Tabela - - - Window Function: - Função Janela: - Return Table Tabela de Retorno @@ -6786,68 +4343,9 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Mode - - - GatilhoWidget - - Triggering Mode: - Modo Disparo: - - - Execute per row - Executar por linha - - - Event: - Evento: - - - Deferrable: - Postergável: - - - Deferral: - Postergação: - - - Referenced Table: - Tab. Referenciada: - - - Conditional Expr.: - Expr. Condicional: - - - Columns - Colunas - - - Column: - Coluna: - - - Arguments - Argumentos - - - Argument: - Argumento: - - Function: - Função: - - - Column - Coluna - - - Type - Tipo - - - Constraint Trigger: - Gatilho Restrição: + Language: + @@ -6856,14 +4354,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Form Formulário - - Printing Options: - Opções de Impressão: - - - Save widgets position - Salvar posição dos widgets - Milimeters Milímetros @@ -6880,10 +4370,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Centimeter Centímetro - - Save current session - Salvar sessão atual - A0 (841 x 1189 mm) @@ -7004,10 +4490,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Tabloid (279 x 432 mm) Tablóide (279 x 432 mm) - - Custom (Based on margins) - Personalizado (Baseado nas margens) - Paper: Papel: @@ -7016,18 +4498,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Orientation: Orientação: - - Margins: - Margens: - - - Autosave interval: - Intervalo de Auto salvamento: - - - Grid size: - Tamanho da grade: - Operation history: Histórico de operações: @@ -7077,20 +4547,8 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Retrato - Print page numbers - Imprimir número de páginas - - - minute(s) - minuto(s) - - - items - itens - - - pixels - pixeis + Print page numbers + Imprimir número de páginas General && Design @@ -7100,18 +4558,10 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da General Geral - - The opened models will be saved periodically - - Check if there is a new version on server - - Check for updates at startup - - Design @@ -7140,14 +4590,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Move canvas by keep mouse on corners - - By default panning mode is triggered with left click and range selection with Shift + left click. - - - - Swap panning and range selection triggers - - Graphical objects (table, views and textboxes) will be created in a single step without the need to click on canvas @@ -7288,396 +4730,189 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da The little brown fox jumps over the lazy dog - - - GraphicalView - Connected rels: %1 + Minimum object opacity (%): - - - HintTextWidget - - Form - Formulário - - - - IndexWidget - Form - Formulário + Defines the minimum opacity percentage applied to the objects when using the fade out feature. A zero opacity causes the object to be completely hidden not being possible to interact with it in the canvas area. + - Fill Factor: - Fator Preenc.: + Canvas grid size: + - Indexing: - Indexação: + Defines the vertical and horizontal grid size. This value affects the spacing of objects when using object grid alignment feature. + - Options: - Opções: + By default the range selection is triggered with Shift + left click. By checking this option range selection will be activated only with a single click and move. + - Concurrent - Concorrente + Trigger range selection with a single click + - Unique - Único + Defines the maximum amount of elements held in the operation history. Once reached the maximum number the history is automatically cleaned. + - Fast update - Atual. Rápida + Defines the period when the opened models will be saved automatically. + - Conditional Expr.: - Expr. Condicional: + Autosave interval (minutes): + - Elements - Elementos + Replaces any straight line in relationship by curved ones in order to improve the model's visualization. + - Column: - Coluna: + Use curved lines for relationships + - Expression: - Expressão: + Souce code editor args: + - Operator Class: - Classe Operadores: + lines + - Ascending - Ascendente + Clear the entire SQL comand history. + - Descending - Descendente + Clear history + - Nulls first - Nulos primeiro + Open in file manager + Abrir gerenciador de arquivos - Sorting: - Ordenação: + Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. + - Element - Elemento + SQL history max. length: + - Type - Tipo + Check updates at startup + - Sorting - Ordenação + User interface language: + - Nulls First - Nulos Primeiro + Browse the source code editor application + - Expression - Expressão + Souce code editor: + - Yes - Sim + Configurations directory: + - No - Não + System default + - Attributes - Atributos + All files (*.*) + - Buffering + Load file + + + GenericSQLWidget - Predicate: + SQL code - IndiceWidget + HintTextWidget - Indexing Type: - Tipo Indexação: + Form + Formulário + + + IndexWidget Fill Factor: - Fator Preenc.: + Fator Preenc.: + + + Indexing: + Indexação: Options: - Opções: + Opções: Concurrent - Concorrente + Concorrente - Check duplicates - Checar duplicados + Unique + Único Fast update - Atual. Rápida - - - Conditional Expr.: - Expr. Condicional: + Atual. Rápida Elements - Elementos - - - Column: - Coluna: - - - Expression: - Expressão: - - - Operator Class: - Classe Operadores: - - - Sorting: - Ordenação: - - - Ascending - Ascendente - - - Descending - Descendente - - - Nulls first - Nulos primeiro - - - Type - Tipo - - - Operator Class - Classe Operadores - - - Sorting - Ordenação - - - Element - Elemento - - - Nulls First - Nulos Primeiro + Elementos - Expressão - Expressão + Attributes + Atributos - Sim - Sim + Buffering + - Não - Não + Predicate: + LanguageWidget - - Form - Formulário - Trusted: Confiável: - - Handler Function: - Função Manipuladora: - - - Validator Function: - Função Validadora: - - - Inline Function: - Função em Linha: - The functions to be assigned to the language should have, respectively, the following signatures:<br/><br/> <strong>Handler Function:</strong> <em>language_handler function()</em><br/> <strong>Validator Function:</strong> <em>void function(oid)</em><br/> <strong>Inline Function:</strong> <em>void function(internal)</em> As funções a serem atribuídas à linguagem devem possuir, respectivamente, as seguintes assinaturas:<br/><br/> <strong>Função Manipuladora:</strong> <em>language_handler funcao()</em><br/> <strong>Função Validadora:</strong> <em>void funcao(oid)</em><br/> <strong>Função em Linha:</strong> <em>void funcao(internal)</em> Validator Func.: - - - - Handler Func.: - - - - Inline Func.: - - - - - LinguagemWidget - - Trusted: - Confiável: - - - Handler Function: - Função Handler: - - - Validator Function: - Função Validator: - - - Inline Function: - Função Inline: - - - The functions to be assigned to the language should have, respectively, the following signatures:<br/><br/> <strong>Handler Function:</strong> <em>language_handler function()</em><br/> <strong>Validator Function:</strong> <em>void function(oid)</em><br/> <strong>Inline Function:</strong> <em>void function(internal)</em> - As funções a serem atribuídas à linguagem devem possuir, respectivamente, as seguintes assinaturas:<br/><br/> <strong>Função Handler:</strong> <em>language_handler funcao()</em><br/> <strong>Função Validator:</strong> <em>void funcao(oid)</em><br/> <strong>Função Inline:</strong> <em>void funcao(internal)</em> - - - - ListaObjetosWidget - - Dependencies - Dependências - - - Object - Objeto - - - Type - Tipo - - - Parent Object - Objeto Pai - - - Parent Type - Tipo Pai - - - References - Referências - - - Dependeces / References of Object - Dependências / Referências do Objeto - - - - ListaOperacoes - - Undoing operation on object: %1 (%2) - Desfazendo operação no objeto: %1 (%2) - - - Redoing operation on object:: %1 (%2) - Refazendo operação no objeto: %1 (%2) - - - - ListaOperacoesWidget - - Executed Operations - Operações Executadas - - - Operations: - Operações: - - - Position: - Posição: - - - Delete operation history - Excluir histórico de operações - - - Undo - Desfazer - - - Redo - Refazer - - - Object: %1 - Objeto: %1 - - - Name: %1 - Nome: %1 - - - removed - removido - - - modified - modificado - - - moved - movimentado - - - Operation: %1 - Operação: %1 - - - Undoing operations... - Desfazendo operações... - - - Redoing operations... - Refazendo operações... - - - Operation history exclusion - Exclusão de histórico de operações + - Delete the executed operations history is an irreversible action, do you want to continue? - Excluir o histórico de operações executadas é uma ação irreversível, deseja realmente prosseguir? + Handler Func.: + - created - criado + Inline Func.: + @@ -7694,34 +4929,10 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da &Edit &Editar - - &Help - A&juda - &Show &Mostrar - - &Tools - &Ferramentas - - - File - Arquivo - - - View - Ver - - - Edit - Editar - - - Model - Modelo - Plugins @@ -7734,10 +4945,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Ctrl+N - - Save - Salvar - Ctrl+S @@ -7762,66 +4969,26 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Ctrl+- - - Load - Carregar - Ctrl+O - - Next - Próximo - - - Previous - Anterior - - - Save as - Salvar como - - - Exit - Sair - Ctrl+Q - - About pgModeler - Sobre o pgModeler - - - Print - Imprimir - Ctrl+P - - Undo - Desfazer - Ctrl+Z - - Redo - Refazer - Ctrl+Y - - Export - Exportar - Ctrl+Shift+S @@ -7834,42 +5001,18 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Ctrl+G - - Close model - Fechar modelo - Ctrl+W - - Normal zoom - Zoom normal - Ctrl+0 - - Align to grid - Alinhar à grade - Align objects position to grid Alinhar objetos à grade - - Fullscreen - Tela inteira - - - Show the model on fullscreen mode - Mostra o modelo em tela inteira - - - Show delimiters - Mostrar delimitadores - Show the page delimiters Mostrar os delimitadores da página @@ -7878,46 +5021,22 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Ctrl+L - - Configurations - Configurações - Save all Salvar todos - - Overview - Visão Geral - Show the model overview Mostra a visão geral do modelo - - pgModeler Wiki - Wiki pgModeler - F1 - - Save all models - Salvar todos os modelos - - - Some models were modified! Do you want to save them before finish the pgModeler? - Alguns modelos foram modificados! Deseja salvá-los antes de encerrar o pgModeler? - Save model Salvar modelo - - The model were modified! Do you want to save it before close? - O modelo foi modificado! Deseja salvá-lo antes de fechar? - Save '%1' as... Salvar '%1' como... @@ -7942,22 +5061,10 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Load model Carregar modelo - - Open Wiki pages - Abrir Páginas Wiki - This action will open a web browser window! Want to proceed? Esta ação abrirá uma janela do navegador de internet! Deseja prosseguir? - - Ctrl+Right - Ctrl+Direita - - - Ctrl+Left - Ctrl+Esquerda - Ctrl+H @@ -8242,10 +5349,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da &Diff - - Determine the changes between model and database - - Ctrl+Shift+D @@ -8410,52 +5513,33 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Executing pending <strong>%1</strong> operation... - - - MessageBox - - Dialog - Diálogo - - - Show excpetion stack in text format (useful to report errors). - Mostra a pilha de exceções em formato texto (útil para reportar erros). - - - Show/hide exceptions stack. - Mostrar/Esconder pilha de exceções. - - - Exceptions - Exceções - - &Yes - &Sim + Determine the changes between model/database and another database + - &No - &Não + Arrange objects + - Cancel - Cancelar + Rearrange objects over the canvas + - Error - Erro + Grid + - Alert - Alerta + Hierarchical + - Information - Informação + Scattered + - &Cancel - &Cancelar + Rearrange objects over the canvas is an irreversible operation! Would like to proceed? + @@ -8603,18 +5687,10 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Custom SQL commands - - Save textboxes to the output file when extracting metadata. When loading the file textboxes are recreated and duplicated ones are ignored. - - Textbox objects - - Save tags to the output file when extracting metadata. When loading the file tags are recreated and duplicated ones are ignored. - - Tag objects @@ -8640,102 +5716,122 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da - Extracts the objects metadata from one of the loaded models and apply to the current model. + Output + + + + Progress label... + Rótulo de progresso... + + + model not saved yet + + + + The backup file cannot be the same as the input model! - Extract from a &model + Extracting metadata to file `%1' - Reads the objects metadata from a previously saved backup file and apply to the current model. + Saving backup metadata to file `%1' - Restore a bac&kup file + Applying metadata from file `%1' - Output + Metadata processing aborted! - Progress label... - Rótulo de progresso... + Objects metadata file (*.omf);;All files (*.*) + - model not saved yet + Handles the objects' fade out status in the metadata file. - The backup file cannot be the same as the input model! + Objects' fade out status - Extracting metadata to file `%1' + Save tags to the output file when extracting metadata. When loading the file, the tags are recreated and duplicated ones are ignored. - Saving backup metadata to file `%1' + Save textboxes to the output file when extracting metadata. When loading the file, the textboxes are recreated and duplicated ones are ignored. - Applying metadata from file `%1' + Handles the tables' and views' extended attributes display status in the metadata file. - Metadata processing aborted! + Tables' extended attributes display - Objects metadata file (*.omf);;All files (*.*) + Save generic SQL objects to the output file when extracting metadata. When loading the file, the objects are recreated and duplicated ones are ignored. - - - ModelDatabaseDiffForm - Database model diff + Generic SQL objects - Generate diff from model + Extracts the objects' metadata from the loaded models and apply to the current focused model. A backup file can be specified to where the focused model's current metadata will be saved. - Settings + &Extract and restore - Input database + Extracts the objects metadata from one of the loaded models saving the info to a backup file. - Connection: - Conexão: + Extract &only + - Database: + Reads the objects' metadata from a previously saved backup file and apply to the current model. + + + + &Restore a backup file + + + ModelDatabaseDiffForm - Options + Settings - Ignores as many as possible errors on import step. This option generates an incomplete diff. + Connection: + Conexão: + + + Database: - Ignore import errors + Ignores as many as possible errors on import step. This option generates an incomplete diff. - Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. + Ignore import errors - Trucate tables before alter columns + Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. @@ -8926,14 +6022,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Waiting process to start... - - Importing database <strong>%1</strong>... - - - - Comparing the model <strong>%1</strong> and database <strong>%2</strong>... - - Confirmation Confirmação @@ -8950,10 +6038,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Preview diff - - Exporting diff to database <strong>%1</strong>... - - Diff process paused. Waiting user action... @@ -8975,46 +6059,114 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da - Process aborted due to errors! + Process aborted due to errors! + + + + + +-- SQL code purposely truncated at this point in demo version! + + + + -- No differences were detected between model and database. -- + + + + Error code <strong>%1</strong> found and ignored. Proceeding with export. + + + + Save diff as... + + + + SQL code (*.sql);;All files (*.*) + Código SQL (*.sql);;Todos os Arquivos (*.*) + + + Diff tool + + + + Generate diff code + + + + Source database + + + + Current model: + + + + (model) + + + + Compare to + + + + Diff + + + + Froce the generation of DROP commands for columns and constraints that exist in database but not in the model. This is useful when diff a partial model against the complete database and the user needs to drop columns and constraint but preserve the rest of the objects. + + + + Drop missing columns and constraints + + + + Truncate tables before alter columns + + + + Import && Export + + + + Import + + + + Export + Exportar + + + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. + + + + Ignore error codes - - --- SQL code purposely truncated at this point in demo version! + model not saved yet - -- No differences were detected between model and database. -- + (none) - Error code <strong>%1</strong> found and ignored. Proceeding with export. + Step %1/%2: Importing database <strong>%3</strong>... - Save diff as... + Step %1/%2: Comparing <strong>%3</strong> and <strong>%4</strong>... - SQL code (*.sql);;All files (*.*) - Código SQL (*.sql);;Todos os Arquivos (*.*) + Step %1/%2: Exporting diff to database <strong>%3</strong>... + ModelExportForm - - Model Export - Exportação do Modelo - - - Select the export type: - Selecione o tipo de exportação: - - - Export to SQL file: - Exportação para arquivo SQL: - File: Arquivo: @@ -9035,54 +6187,18 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da PostgreSQL version in which the SQL code should be generated Versão do PostgreSQL no qual o código SQL deve ser gerado - - Check if the system user has write permission on target folder. - Verifique se o usuário do sistema possui permissão de gravação sobre a pasta de destino. - - - Export to PNG image: - Exportação para imagem PNG: - - - Image: - Imagem: - - - Options: - Opções: - Show grid Mostrar grade - - Show the page delimiters - Mostrar delimitadores de página - - - Check if the system user has write permission on image target folder. - Verifique se o usuário do sistema possui permissão de gravação sobre a pasta de destino da imagem. - Connection: Conexão: - - It is recommended to select this option only when the version of the DBMS, somehow, is not identifiable or if you need to generate a specific version of SQL code for testing. - É recomendado selecionar esta opção somente quando a versão do SGBD, de alguma forma, não seja identificável ou se é necessário gerar uma versão específica de código SQL para testes. - Ignore object duplicity Ignorar duplicidade de objetos - - The pgModeler ignores errors generated by duplicate objects and creates only model objects that do not exist in the database. This option may be used when an object was created after a later model export. - O pgModeler ignora os erros gerados por duplicidade de objetos e cria apenas objetos do modelo não existentes no banco de dados. Esta opção pode ser usada quando um objeto foi criado depois de uma posterior exportação do modelo. - - - Export to DBMS: - Exportação para o SGBD: - Progress label... Rótulo de progresso... @@ -9095,10 +6211,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da &Close &Fechar - - Generating source code... - Gerando código-fonte... - Initializing model export... Iniciando exportação do modelo... @@ -9107,42 +6219,14 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Saving file '%1' Salvando arquivo '%1' - - Creating object '%1' (%2)... - Criando objeto '%1' (%2)... - - - Creating database '%1'... - Criando banco de dados '%1'... - - - Connecting to database '%1'... - Conectando ao banco de dados '%1'... - - - Creating objects on database '%1'... - Criando objetos No banco de dados '%1'... - Exporting process sucessfuly ended! Processo de exportação finalizado com sucesso! - - Error on export! - Erro na exportação! - Export model as... Exportar modelo como... - - SQL code (*.sql);;All files (*.*) - Código SQL (*.sql);;Todos os Arquivos (*.*) - - - PNG image (*.png);;All files (*.*) - Imagem PNG (*.png);;Todos os Arquivos (*.*) - Export model @@ -9187,10 +6271,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Graphics file - - Image (PNG) - - Type: Tipo: @@ -9199,10 +6279,6 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Zoom: - - Vectorial (SVG) - - Show delimiters @@ -9251,6 +6327,22 @@ Agradecimentos especiais aos amigos da equipe de desenvolvimento de software da Exporting process canceled by user! + + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. + + + + Ignore error codes + + + + I&mage (PNG) + + + + &Vectorial (SVG) + + ModelExportHelper @@ -9515,10 +6607,6 @@ p, li { white-space: pre-wrap; } Parent Type Tipo Pai - - Visible Object Types - Tipos de Objeto Visíveis - Select All Selecionar Todos @@ -9587,6 +6675,14 @@ p, li { white-space: pre-wrap; } By ID + + Visible object types + + + + Model objects + + ModelOverviewWidget @@ -9594,6 +6690,11 @@ p, li { white-space: pre-wrap; } Model overview Visão geral do modelo + + Failed to generate the overview image. +The requested size %1 x %2 was too big and there was not enough memory to allocate! + + ModelRestorationForm @@ -9609,18 +6710,6 @@ p, li { white-space: pre-wrap; } &Cancel &Cancelar - - pgModeler was not closed properly in a previous execution and some models were still being edited. Click 'Restore' to reopen the models or 'Cancel' to abort the restoration. - pgModeler não foi encerrado corretamente em uma execução anterior e alguns modelos ainda estavam em edição. Clique 'Restaurar' para reabrir os modelos ou 'Cancelar' para abortar a restauração. - - - Modified: %1 - Modificado: %1 - - - yyyy-MM-dd hh:mm:ss - dd/MM/yyyy hh:mm:ss - pgModeler was not closed properly in a previous execution and some models were still being edited. Click <strong>Restore</strong> to reopen the models or <strong>Cancel</strong> to abort the restoration. @@ -9711,10 +6800,6 @@ p, li { white-space: pre-wrap; } Try to resolve the reported issues. - - Apply Fix - - Ctrl+S @@ -9723,10 +6808,6 @@ p, li { white-space: pre-wrap; } Change the creation order for two objects by swapping their ids - - Swap Ids - - Va&lidate @@ -9823,6 +6904,22 @@ p, li { white-space: pre-wrap; } Processing object: %1 + + Apply fixes + + + + Swap ids + + + + The column <strong>%1</strong> on <strong>%2</strong> <em>(%3)</em> is referencing the geospatial data type <strong>%4</strong> but the <strong>postgis</strong> extension is not present in the model! + + + + <strong>HINT:</strong> Create the extension in the model or let it be created by applying the needed fixes. + + ModelWidget @@ -9830,14 +6927,6 @@ p, li { white-space: pre-wrap; } Copy Copiar - - Generalization - Generalização - - - <strong>CAUTION:</strong> The object model is protected! New objects will be inserted only when the protection is removed! - <strong>ATENÇÃO:</strong> O modelo de objetos está protegido! Novos objetos só poderão ser inseridos quando a proteção for removida! - Source code Código fonte @@ -9866,18 +6955,10 @@ p, li { white-space: pre-wrap; } Protects object(s) from modifications Protege objeto(s) contra modificações - - Unprotect objetc(s) from modifications - Desprotege objeto(s) contra modificações - Delete Apagar - - Delete the selected object(s) - Apaga o(s) objeto(s) selecionado(s) - Select all Selecionar todos @@ -9886,50 +6967,18 @@ p, li { white-space: pre-wrap; } Selects all the graphical objects in the model Seleciona todos os objetos gráficos no modelo - - Convert rel. n-n - Converter rel. n-n - - - Converts the n-n relationship into table - Converte o relacionamento n-n em tabela - - - Copy the selected objects(s) - Copia o(s) objeto(s) selecionado(s) - Paste Colar - - Paste the previous copied object(s) - Cola o(s) objeto(s) copiados previamente - Cut Recortar - - Cut the selected object(s) - Recorta o(s) objeto(s) selecionado(s) - - - Displays objects that reference and that are dependent of the selected object - Exibe os objetos que referenciam e os que são dependentes do objeto selecionado - - - New object - Novo objeto - Add a new object in the model Adiciona um novo objeto no modelo - - Quick actions - Ações rápidas - Rename Renomear @@ -9942,50 +6991,18 @@ p, li { white-space: pre-wrap; } Move to schema Mover para o esquema - - Move the object to another schema - Mover o objeto para outro esquema - Edit permissions Editar permissões - - Edit object's permissions - Editar permissões do objeto - Change owner Mudar proprietário - - Change object's owner - Mudar proprietário do objeto - Select children Selecionar filhos - - Selects all the children graphical objects on the selected schema - Seleciona todos os objetos gráficos filhos no esquema selecionado - - - Highlight - Destacar - - - Clears the current selection and centers the model view on the selected object. - Limpa a seleção atual e centraliza a visualização do modelo no objeto selecionado. - - - Confirmation - Confirmação - - - Do you really want to convert the relationship? - Deseja realmente converter o relacionamento? - Loading database model Carregando modelo de banco de dados @@ -10002,26 +7019,10 @@ p, li { white-space: pre-wrap; } Pasting objects... Colando objetos... - - Validating object: %1 (%2) - Validando o objeto: %1 (%2) - - - Generating XML code of object: %1 (%2) - Gerando código XML do objeto: %1 (%2) - - - Pasting object: %1 (%2) - Colando o objeto: %1 (%2) - Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details! Nem todos objetos foram colados ao modelo devido a erros retornados durante o processo! Consulte a pilha de erros para mais detalhes! - - CAUTION: Remove multiple objects at once can cause irreversible invalidations to other objects in the model. Do you really want to delete ALL selected objects? - ATENÇÃO: Remover vários objetos de uma só vez pode provocar invalidações irreversíveis de outros objetos no modelo. Tem certeza de que deseja excluir TODOS os objetos selecionados? - Do you really want to delete the selected object? Deseja realmente apagar o objeto selecionado? @@ -10034,18 +7035,6 @@ p, li { white-space: pre-wrap; } Constraints Restrições - - Dependencies - Dependências - - - CAUTION: Remove multiple objects at once can cause irreversible invalidations to other objects in the model. Such invalid objects will be deleted too. Do you really want to delete ALL selected objects? - ATENÇÃO: Remover múltiplos objetos de uma vez pode causar invalidações irreversíveis a outros objetos no modelo. Tais objetos inválidos serão apagados também. Deseja realmente apagar TODOS os objetos selecionados? - - - CAUTION: Remove a relationship can cause irreversible invalidations to other objects in the model. Such invalid objects will be deleted too. Do you really want to delete the relationship? - ATENÇÃO: Remover um relacionamento pode causar invalidações irreversíveis a outros objetos no modelo. Tais objetos inválidos serão apagados também. Deseja realmente apagar o relacionamento? - One to One (1-1) @@ -10238,179 +7227,93 @@ p, li { white-space: pre-wrap; } The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details. - - - ModeloBD - - Loading object: %1 (%2) - Carregando objeto: %1 (%2) - - - Generating %1 of the object: %2 (%3) - Gerando %1 do objeto: %2 (%3) - - - - ModeloWidget - - Generalization - Generalização - - - <strong>CAUTION:</strong> The object model is protected! New objects will be inserted only when the protection is removed! - <strong>ATENÇÃO:</strong> O modelo de objetos encontra-se protegido! Novos objetos só poderão ser inseridos quando esta situação for revertida! - - - Source code - Código-fonte - - - Show object source code - Exibe o código-fonte do objeto - - - Properties - Propriedades - - - Edit the object properties - Edita as propriedades do objeto - - Protect - Proteger - - - Unprotect - Desproteger - - - Pretects the object(s) against modifications - Protege o(s) objeto(s) contra modificações - - - Removes from the objetc(s) the protection against modifications - Remove a proteção contra modificação do(s) objeto(s) - - - Delete - Excluir - - - Delete the selected object(s) - Exclui o(s) objeto(s) selecionado(s) - - - Select all - Selecionar todos - - - Selects all the graphical objects in the model - Seleciona todos os objetos gráficos no modelo - - - Converts the n-n relationship into table - Converte o relacionamento n-n para tabela própria - - - Copy - Copiar - - - Copy the selected objects(s) - Copia o(s) objeto(s) selecionado(s) - - - Paste - Colar - - - Paste the previos copied object(s) - Cola o(s) objeto(s) anteriormente copiado(s) + Edit data + - Cut - Recortar + Select tagged + - Displays objects that reference and that are dependent of the selected object - Exibe os objetos que referenciam e os que são dependência do objeto selecionado + Select + Selecionar - New object - Novo objeto + Duplicate + - Add a new object in the model - Adiciona um novo objeto no modelo + Ctrl+D + - Loading database model - Carregando modelo de banco de dados + Extended attributes + - Saving database model - Salvando modelo de banco de dados + Show + Exibir - Confirmation - Confirmação + Hide + - Also copy all dependencies of selected objects? This minimizes the breakdown of references when copied objects are pasted into another model. - Deseja copiar também todas dependências dos objetos selecionados? Isso minimiza a quebra de referências quando os objetos copiados forem colados em outro modelo. + Jump to table + - Pasting objects... - Colando objetos... + Schemas rectangles + - Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details! - Nem todos objetos foram colados ao modelo devido a erros retornados durante o processo! Consulte a pilha de erros para mais detalhes! + Fade in/out + - Do you really want to delete the selected object? - Tem certeza de que deseja excluir o objeto selecionado? + Fade in + - Constraints - Restrições + Fade out + - Convert a relationship is an irreversible operation and causes the deletion of all operation history! Do you want to continue? - Converter um relacionamento é uma operação irreversível e provoca a exclusão de todo histórico de operações! Deseja continuar? + Relationships + - Dependence - Dependência + Swap ids + - Convert rel. n-n - Converter rel n-n + Edit the objects creation order by swapping their ids + - Cut the selected object(s) - Recortar o(s) objeto(s) selecionado(s) + All objects + - Relationship - Relacionamento + Schemas + - CAUTION: Remove multiple objects at once can cause irreversible invalidations to other objects in the model. Do you really want to delete ALL selected objects? - ATENÇÃO: Remover vários objetos de uma só vez pode provocar invalidações irreversíveis de outros objetos no modelo. Tem certeza de que deseja excluir TODOS os objetos selecionados? + Tables + Tabelas - Validating object: %1 (%2) - Validando o objeto: %1 (%2) + Views + - Pasting object: %1 (%2) - Colando o objeto: %1 (%2) + Textboxes + - Generating XML code of object: %1 (%2) - Gerando código XML do objeto: %1 (%2) + None + @@ -10702,6 +7605,18 @@ p, li { white-space: pre-wrap; } 0 + + Generic SQL + + + + Policy + + + + 8 + + NumberedTextEditor @@ -10721,13 +7636,45 @@ p, li { white-space: pre-wrap; } Ident left + + Load + Carregar + + + Load the object's source code from an external file + + + + Edit + Editar + + + Edit the source code in the preferred external editor + + + + Clear + + + + SQL file (*.sql);;All files (*.*) + + + + Load file + + + + The source editor `%1' is running on `pid: %2'. + + + + Could not start the source code editor application `%1'! Make to sure that the source editor path defined in the general settings points to a valid executable and the current user has permission to run the application. Error message returned: `%2' + + ObjectDepsRefsWidget - - Form - Formulário - Dependencies Dependências @@ -10752,10 +7699,6 @@ p, li { white-space: pre-wrap; } References Referências - - Dependences / References of Object - Dependências / Referências de Objeto - Object's dependencies & references @@ -10803,14 +7746,6 @@ p, li { white-space: pre-wrap; } Clear - - Highlight graphical objects when selecting them or their children on the result list - - - - Highlight - Destacar - ... @@ -10871,6 +7806,30 @@ p, li { white-space: pre-wrap; } No objects found. + + (Un)selects the graphical objects in the results grid + + + + Select + Selecionar + + + Fades outs all the graphical objects in the results grid (or those not listed). The current fade in/out state of all objects is modified. + + + + Fade out + + + + Listed + + + + Not listed + + ObjectRenameWidget @@ -10915,343 +7874,106 @@ p, li { white-space: pre-wrap; } - ObjectTableWidget + ObjectsTableWidget Form - Formulário + Formulário Add Item - Adicionar Item + Adicionar Item Ins - + Remove Item - Remover Item + Remover Item Del - + Update Item - Atualizar Item + Atualizar Item Alt+R - + Remove All - Remover Todos + Shift+Del - - - - Edit Item - Editar Item - - - Space - - - - Move Up - Mover para cima - - - Ctrl+Up - - - - Move Down - Mover para baixo - - - Ctrl+Down - - - - Move to start - Mover para o início - - - Ctrl+Home - - - - Move to end - Mover para o final - - - Ctrl+End, Ctrl+S - - - - Confirmação - Confirmação - - - Do you really want to remove the selected item? - Deseja realmente remover o item selecionado? - - - Do you really want to remove the all items? - Deseja realmente remover todos os itens? - - - Confirmation - Confirmação - - - - ObjetoBase - - Column - Coluna - - - Constraint - Restrição - - - Function - Função - - - Trigger - Gatilho - - - Index - Índice - - - Rule - Regra - - - Table - Tabela - - - View - Visão - - - Domain - Domínio - - - Schema - Esquema - - - Aggregate - Função de Agregação - - - Operator - Operador - - - Sequence - Seqüência - - - Role - Papel - - - Conversion - Conversão de Codificação - - - Cast - Conversão de Tipo - - - Language - Linguagem - - - Type - Tipo - - - Tablespace - Espaço de Tabela - - - Operator Family - Família de Operadores - - - Operator Class - Classe de Operadores - - - Database - Banco de Dados - - - Table-Table Relationship - Relacionamento Tabela-Tabela - - - Textbox - Caixa de Texto - - - Permission - Permissão - - - Parameter - Parâmetro - - - Table-View Relationship - Relacionamento Tabela-Visão - - - - ObjetoBaseWidget - - Name: - Nome: - - - Comment: - Comentário: - - - Tablespace: - Esp. de Tabela: - - - Owner: - Dono: - - - Schema: - Esquema: - - - Permissions: - Permissões: - - - This object is protected thus no change in form will be applied to it. - Este o objeto encontra-se protegido, assim nenhuma alteração no formulário será aplicada ao mesmo. - - - Parent Object: - Objeto Pai: - - - Value(s) - Valor(es) - - - Version - Versão - - - The field(s) or value(s) highlighted on the form is(are) for the exclusive use and/or mandatory in specific versions of PostgreSQL. Failure to complete that may cause errors in the generation of SQL code for each version shown in tool tips of the highlighted fields. - O(s) campo(s) ou valor(es) destacado(s) no formulário é(são) de uso exclusivo e/ou obrigatório em versões específicas do PostgreSQL. O não preenchimento do(s) mesmo(s) pode ocasionar erros na geração de código SQL de cada versão indicada nas dicas de ferramenta dos campos destacados. - - - Criate / Edit: - Criação / Edição: - - - Edit Permissions - Editar Permissões - - - - OperadorWidget - - Options: - Opções: + - Arguments - Argumentos + Duplicate item + - Functions - Funções + Ctrl+D + - Constraints: - Restrição: + Edit Item + Editar Item - Operator: - Operador: + Space + - Operators - Operadores + Move Up + Mover para cima - Commutation: - Comutação: + Ctrl+Up + - Negation: - Negação: + Move Down + Mover para baixo - Sort (1): - Ordenação (1): + Ctrl+Down + - Sort (2): - Ordenação (2): + Move to start + Mover para o início - Less than: - Menor que: + Ctrl+Home + - Greater then: - Maior que: + Move to end + - Right Argument Type - Tipo Argumento Direita + Ctrl+End, Ctrl+S + - Left Argument Type - Tipo Argumento Esquerda + Confirmation + Confirmação - To create a unary operator it is necessary to specify as <strong><em>'any'</em></strong> one of its arguments. Additionally, the function that defines the operator must have only one parameter and this, in turn, must have the same data type of the the argument of unary operator. - Para a criação de um operador unário é necessário especificar como <strong><em>'any'</em></strong> um de seus argumentos. Adicionalmente, a função que define o operador deve possuir apenas uma parâmetro e este, por sua vez, deve ter o tipo de dado igual ao tipo de dado do argumento do operador unário. + Do you really want to remove the selected item? + - Join: - Junção: + Do you really want to remove all the items? + OperationList - - Undoing operation on object: %1 (%2) - Desfazendo operação no objeto: %1 (%2) - - - Redoing operation on object:: %1 (%2) - Refazendo operação no objeto: %1 (%2) - (invalid object) @@ -11319,14 +8041,6 @@ p, li { white-space: pre-wrap; } Operation: %1 Operação: %1 - - Undoing operations... - Desfazendo operações... - - - Redoing operations... - Refazendo operações... - Operation history exclusion Exclusão de histórico de operações @@ -11346,10 +8060,6 @@ p, li { white-space: pre-wrap; } OperatorClassWidget - - Form - Formulário - Default Class: Classe Padrão: @@ -11362,10 +8072,6 @@ p, li { white-space: pre-wrap; } Elements Elementos - - Elemente Type: - Tipo de Elemento: - Operator Operador @@ -11390,14 +8096,6 @@ p, li { white-space: pre-wrap; } Support/Strategy: Suporte/Estratégia: - - Recheck - Rechecar - - - Family: - Família: - Storage Type Tipo de Armazenamento @@ -11414,14 +8112,6 @@ p, li { white-space: pre-wrap; } Support/Strategy Suporte/Estratégia - - Yes - Sim - - - No - Não - Element Type: Tipo de Elemento: @@ -11437,10 +8127,6 @@ p, li { white-space: pre-wrap; } OperatorFamilyWidget - - Form - Formulário - Indexing: Indexação: @@ -11448,10 +8134,6 @@ p, li { white-space: pre-wrap; } OperatorWidget - - Form - Formulário - HASHES @@ -11468,46 +8150,10 @@ p, li { white-space: pre-wrap; } Arguments Argumentos - - Functions - Funções - Join: Junção: - - Operator: - Operador: - - - Operators - Operadores - - - Commutation: - Comutação: - - - Negation: - Negação: - - - Sort (1): - Ordenação (1): - - - Sort (2): - Ordenação (2): - - - Less than: - Menor que: - - - Greater then: - Maior que: - Right Argument Type Tipo Argumento Direita @@ -11528,10 +8174,6 @@ p, li { white-space: pre-wrap; } Restrict: Restrito: - - Commutator - Comutador - Negator: Negador: @@ -11546,579 +8188,645 @@ p, li { white-space: pre-wrap; } - PapelWidget + ParameterWidget - Password: - Senha: + Default Value: + Valor Padrão: - Validity: - Validade: + Mode: + Modo: - Connections: - Conexões: + IN + - Attributes - Atributos + OUT + - Superuser - Superusuário + VARIADIC + + + + PermissionWidget - Inherit Permissions - Herdar Permissões + Roles + Papéis - Create Database - Criar Banco de Dados + ID: + - Can Login - Permitir Login + Permissions + Permissões - Create Users/Groups - Criar Usuários/Grupos + Add Permission + Adicionar Permissão - Encrypted Password - Senha Criptografada + Update Permission + Atualizar Permissão - Members - Membros + Cancel Operation + Cancelar Operação - Role - Papel + Privileges + Privilégios - Validity - Validade + Privilege + Privilégio - Members (Admin.) - Membros (Admin.) + GRANT OPTION + - Member of - Membro de + Id + - - - ParameterWidget - Form - Formulário + Disable SQL code + Desabilitar código SQL - Default Value: - Valor Padrão: + Cascade + Cascata - Mode: - Modo: + Edit permissions + Editar permissões - IN - + &Grant + - OUT - + Re&voke + - VARIADIC + Code Preview + Previsão de Código + + + -- No permissions defined for the specified object! - - - ParametroWidget - Default Value: - Valor Padrão: + /* Could not generate the SQL code preview for permissions! + - Mode: - Modo: + Name + Nome + + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + - PermissaoWidget + PgModelerCLI - Roles - Papéis + Unrecognized option '%1'. + Opção '%1' não reconehcida. - Privileges - Privilégios + Value not specified for option '%1'. + Valor não specificado para a opção '%1'. - Cancel Operation - Cancelar Operação + Option '%1' does not accept values. + Opção '%1' não aceita valores. - Update Permission - Atualizar Permissão + Usage: pgmodeler-cli [OPTIONS] + Uso: pgmodeler-cli [OPÇÕES] - Add Permission - Adicionar Permissão + command line interface. + interface da linha de comando. - Type: - Tipo: + DBMS export options: + Opções da exportação SGBD: - Role - Papel + Input file must be different from output! + Arquivo de entrada deve ser diferente do de saída! - Permissions - Permissões + Incomplete connection information! + Informação de conexão incompleta! + + + Starting model export... + Iniciando exportação de modelo... + + + General options: + + + + PNG and SVG export options: + + + + Miscellaneous options: + + + + There are no connections configured. + + + + Invalid zoom specified! + + + + Invalid action specified to update mime option! + + + + Starting model fixing... + + + + Starting mime update... + + + + Model successfully fixed! + + + + Extracting objects' XML... + + + + Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! + + + + Recreating objects... + + + + +** Object(s) that couldn't fixed: + + + + WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) + + + + Database model files (.dbm) are already associated to pgModeler! + + + + There is no file association related to pgModeler and .dbm files! + - Privilege - Privilégio + Mime database operation: %1 + - - - PermissionWidget - Form - Formulário + Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. + - Roles - Papéis + Running update-mime-database command... + - ID: - + Connection aliased as '%1' was not found in the configuration file. + - Permissions - Permissões + PostgreSQL Database Modeler Project - pgmodeler.io + - Add Permission - Adicionar Permissão + Copyright 2006-2018 Raphael A. Silva <raphael@pgmodeler.io> + - Update Permission - Atualizar Permissão + This CLI tool provides several operations over models and databases without the need to perform them +in pgModeler's graphical interface. All available options are described below. + - Cancel Operation - Cancelar Operação + %1, %2 [FILE] Input model file (.dbm). This is mandatory for fix, export operations. + - Privileges - Privilégios + %1, %2 [DBNAME] Input database name. This is mandatory for import operation. + - Privilege - Privilégio + %1, %2 [FILE] Output file. This is mandatory for fixing model or exporting to file, png or svg. + - GRANT OPTION - + %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + - Type: - Tipo: + %1, %2 [NUMBER] Model fix tries. When reaching the maximum count the invalid objects will be discarded. + - Role - Papel + %1, %2 Export the input model to a sql script file. + - Id - + %1, %2 Export the input model to a png image. + - Disable SQL code - Desabilitar código SQL + %1, %2 Export the input model to a svg file. + - Grant - Conceder + %1, %2 Export the input model directly to a PostgreSQL server. + - Revoke - Revogar + %1, %2 Import a database to an output file. + - Cascade - Cascata + %1, %2 Compares a model and a database or two databases generating the SQL script to synch the latter in relation to the first. + - Leave the <em><strong>Roles</strong></em> empty to create a permission applicable to <strong><em>PUBLIC</em></strong>. - Deixe os <em><strong>Papéis</strong></em> em branco para criar uma permissão aplicável a <strong><em>PUBLIC</em></strong>. + %1, %2 Force the PostgreSQL version of generated SQL code. + - Edit permissions - Editar permissões + %1, %2 Silent execution. Only critical messages and errors are shown during process. + - &Grant + %1, %2 Show this help menu. - Re&voke + Connection options: - Code Preview - Previsão de Código + %1, %2 List available connections in file %3. + - -- No permissions defined for the specified object! + %1, %2 [ALIAS] Connection configuration alias to be used. - /* Could not generate the SQL code preview for permissions! + %1, %2 [HOST] PostgreSQL host in which a task will operate. - - - PgModelerCLI - Unrecognized option '%1'. - Opção '%1' não reconehcida. + %1, %2 [PORT] PostgreSQL host listening port. + - Value not specified for option '%1'. - Valor não specificado para a opção '%1'. + %1, %2 [USER] PostgreSQL username. + - Option '%1' does not accept values. - Opção '%1' não aceita valores. + %1, %2 [PASSWORD] PostgreSQL user password. + - Connection aliased as '%1' was not found on configuration file. - Conexão apelidada de '%1' não foi encontrada no arquivo de configuração. + %1, %2 [DBNAME] Connection's initial database. + - Usage: pgmodeler-cli [OPTIONS] - Uso: pgmodeler-cli [OPÇÕES] + %1, %2 Draws the grid in the exported image. + - command line interface. - interface da linha de comando. + %1, %2 Draws the page delimiters in the exported image. + - PostgreSQL Database Modeler Project - pgmodeler.com.br - Projeto Modelador de Banco de Dados PostgreSQL - pgmodeler.com.br + %1, %2 Each page will be exported in a separated png image. (Only for PNG images) + - This tool provides a way to export pgModeler's database models without -the need to load them on graphical interface. All available exporting -modes are described below. - Esta ferramenta provê um modo de exportar modelos de banco de dados do pgModeler sem -a necessidade de carregá-los na interface gráfica. Todos os modos de exportações -disponíveis estão descritos abaixo. + %1, %2 [FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images) + - Options: - Opções: + %1, %2 Ignores errors related to duplicated objects that eventually exist in the server. + - %1, %2=[FILE] Input model file (.dbm). - %1, %2=[ARQUIVO] Arquivo de entrada do modelo (.dbm). + %1, %2 [CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided. + - %1, %2=[FILE] Output file. Available only on export to file or png. - %1, %2=[ARQUIVO] Arquivo de saída. Disponível apenas ao exportar para arquivo ou png. + %1, %2 Drop the database before execute a export process. + - %1, %2 Export to a sql script file. - %1, %2 Exportar para um arquivo de script sql. + %1, %2 Runs the DROP commands attached to SQL-enabled objects. + - %1, %2 Export to a png image. - %1, %2 Exportar para uma imagem png. + %1, %2 Simulates an export process by executing all steps but undoing any modification in the end. + - %1, %2 Export directly to a PostgreSQL server. - %1, %2 Exportar diretamente para um servidor PostgreSQL. + %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + - %1, %2 Version of generated SQL code. Only for file or dbms export. - %1, %2 Versão de código SQL gerado. Exportação apenas para arquivo ou SGDB. + Database import options: + - %1, %2 Silent execution. Only critical errors are shown during process. - %1, %2 Execução silenciosa. Apenas erros críticos são mostrados durante o processo. + %1, %2 Ignore all errors and try to create as many as possible objects. + - %1, %2 Show this help menu. - %1, %2 Mostrar este menu de ajuda. + %1, %2 Import system built-in objects. This option causes the model bloating due to the importing of unneeded objects. + - PNG export options: - Opções de exportação PNG: + %1, %2 Import extension objects. This option causes the model bloating due to the importing of unneeded objects. + - %1, %2 Draws the grid on the exported png image. - %1, %2 Desenha a grade na imagem png exportada. + %1, %2 Run import in debug mode printing all queries executed in the server. + - %1, %2 Draws the page delimiters on the exported png image. - %1, %2 Desenha os delimitadores de página na imagem png exportada. + Diff options: + - DBMS export options: - Opções da exportação SGBD: + %1, %2 [DBNAME] The database used in the comparison. All the SQL code generated is applied to it. + - %1, %2 Ignores errors related to duplicated objects that eventually exists on server side. - %1, %2 Ignora erros relacionados a objetos duplicados que eventualmente existam no lado servidor. + %1, %2 Save the generated diff code to output file. + - %1, %2=[ALIAS] Connection configuration alias to be used. - %1, %2=[APELIDO] Apelido da configuração da conexão a ser usada. + %1, %2 Apply the generated diff code on the database server. + - %1, %2=[HOST] PostgreSQL host which export will operate. - %1, %2=[SERVIDOR] Servidor PostgreSQL no qual a exportação irá operar. + %1, %2 Don't preview the generated diff code when applying it to the server. + - %1, %2=[PORT] PostgreSQL host listening port. - %1, %2=[PORTA] Porta de escuta do servidor PostgreSQL. + %1, %2 Drop cluster level objects like roles and tablespaces. + - %1, %2=[USER] PosrgreSQL username. - %1, %2=[USUARIO] Nome de usuário PostgreSQL. + %1, %2 Revoke permissions already set on the database. New permissions configured in the input model are still applied. + - %1, %2=[PASSWORD] PosrgreSQL user password. - %1, %2=[SENHA] Senha de usuário PosrgreSQL. + %1, %2 Drop missing objects. Generates DROP commands for objects that are present in the input model but not in the compared database. + - %1, %2=[DBNAME] Connection's initial database. - %1, %2=[NOMEBD] Banco de dados inicial da conexão. + %1, %2 Force the drop of missing columns and constraints. Causes only columns and constraints to be dropped, other missing objects aren't removed. + - No export mode specified! - Modo de exportação não especificado! + %1, %2 Rename the destination database when the names of the involved databases are different. + - Multiple export mode especified! - Modo de exportação múltiplo especificado! + %1, %2 Don't drop or truncate objects in cascade mode. + - No input file specified! - Arquivo de entrada não especificado! + %1, %2 Truncate tables prior to alter columns. Avoids errors related to type casting when the new type of a column isn't compatible to the old one. + - No output file specified! - Arquivo de saída não especificado! + %1, %2 Don't reuse sequences on serial columns. Drop the old sequence assigned to a serial column and creates a new one. + - Input file must be different from output! - Arquivo de entrada deve ser diferente do de saída! + %1, %2 Don't force the recreation of objects. Avoids the usage of a DROP and CREATE commands to create a new version of the objects. + - Incomplete connection information! - Informação de conexão incompleta! + %1, %2 Don't recreate the unmodifiable objects. These objects are the ones which can't be changed via ALTER command. + - Starting model export... - Iniciando exportação de modelo... + %1, %2 [ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + - Loading input file: - Carregando arquivo de entrada: + ** The diff process allows the usage of the following options related to import and export operations: + - Export to PNG image: - Exportar para imagem PNG: + * Export: + - Export to SQL script file: - Exportar para arquivo de script SQL: + * Import: + - Export to DBMS: - Exportar para SGBD: + ** When running the diff using two databases (%1 and %2) there's the need to specify two connections/aliases. + - Export successfully ended! - Exportação finalizada com sucesso! + If only one connection is set it will be used to import the input database as well to retrieve database used in the comparison. + - Copyright 2006-2015 Raphael A. Silva <raphael@pgmodeler.com.br> + A second connection can be specified by appending a 1 on any connection configuration parameter listed above. - This CLI tool provides the operations to export pgModeler's database models without - the need to load them on graphical interface as well to fix model files to the most recent - accepted structure. All available options are described below. + Available connections (alias : connection string) - General options: + No operation mode was specified! - %1, %2=[FILE] Input model file (.dbm). Mandatory use when fixing a model or exporting it. + Export, fix model, import database, diff and update mime operations can't be used at the same time! - %1, %2=[FILE] Output file. Mandatory use when fixing model or export to file or png. + Multiple export mode was specified! - %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + No input file was specified! - %1, %2 Model fix tries. When reaching the maximum count the invalid objects will be discard. + No input database was specified! - %1, %2 Export to a svg file. + No output file was specified! - %1, %2 List available connections on %3 file. + No input file or database was specified! - PNG and SVG export options: + The input file and database can't be used at the same time! - %1, %2 Each page will be exported on a separated png image. (Only for PNG) + No database to be compared was specified! - %1, %2=[FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG) + No diff action (save or apply) was specified! - %1, %2 Drop the database before execute a export process. + No output file for the diff code was specified! - %1, %2 Runs the DROP commands attached to SQL-enabled objects. + ** Error code `%1' found and ignored. Proceeding with export. - %1, %2 Simulates a export process. Actually executes all steps but undoing any modification. + ** Command: %1 - %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + Loading input file: %1 - %1, %2=[USER] PostgreSQL username. + Fixed model file: %1 - %1, %2=[PASSWORD] PostgreSQL user password. + Export to PNG image: %1 - Miscellaneous options: + Export to SVG file: %1 - %1, %2=[ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + Export to SQL script file: %1 - There are no connections configured. + Export to DBMS: %1 - Available connections (alias : conn. string) + Export successfully ended! + - Export, fix model and update mime operations can't be used at the same time! + Starting database import... - Multiple export mode specified! + Input database: %1 - Invalid zoom specified! + Saving the imported database to file... - Invalid action specified to update mime option! + Import successfully ended! + - Starting model fixing... + Starting diff process... - Starting mime update... + Input model: %1 - Fixed model file: + Compare to: %1 - Model successfully fixed! + Loading input model... - Mime database successfully updated. + Importing the database `%1'... - Export to SVG file: + Comparing the generated models... - Extracting objects' XML... + No differences were detected. - Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! + Saving diff to file `%1' - Recreating objects... + ** WARNING: You are about to apply the generated diff code to the server. Data can be lost in the process! - -** Object(s) that couldn't fixed: + ** Proceed with the diff applying? (yes/no) > - WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) + yes - Database model files (.dbm) are already associated to pgModeler! + no - There is no file association related to pgModeler and .dbm files! + Diff code not applied to the server. - Mime database operation: %1 + Applying diff to the database `%1'... - Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. + Diff successfully ended! + - Running update-mime-database command... + Mime database successfully updated! + @@ -12245,10 +8953,6 @@ disponíveis estão descritos abaixo. Loaded plug-ins Plugins carregados - - <html><head/><body><p>Details about plugins development and installation can be found at <a href="http://www.pgmodeler.com.br/wiki/doku.php?id=plugins"><span style=" text-decoration: underline; color:#0057ae;">pgModeler Wiki</span></a>. <span style=" font-weight:600;">Note:</span> plugin installation requires pgModeler to be restarted.</p></body></html> - <html><head/><body><p>Detalhes sobre o desenvolvimento e instalação de plugins podem ser encontrados em <a href="http://www.pgmodeler.com.br/wiki/doku.php?id=plugins"><span style=" text-decoration: underline; color:#0057ae;">Wiki pgModeler</span></a>. <span style=" font-weight:600;">Nota:</span> a instalação de plugins requer que o pgModeler seja reiniciado.</p></body></html> - Plugin @@ -12263,190 +8967,53 @@ disponíveis estão descritos abaixo. - ProgressoTarefa - - Executing tasks - Executando tarefas - - - - QObject - - new_database - novo_banco_de_dados - - - %1 (line: %2) - %1 (linha: %2) - - - - QuickRenameWidget - - Form - Formulário - - - to: - para: - - - Rename - Renomear - - - Cancel - Cancelar - - - - RegraWidget - - Event: - Evento: - - - Execution Type: - Tipo Execução: - - - Conditional Expr.: - Expr. Condicional: - - - Executed Commands - Comandos Executados - - - SQL Command: - Comando SQL: - - - To create a rule that does not perform any action (<strong>DO NOTHING</strong>) simply do not specify commands in the SQL commands table. - Para se criar uma regra que não execute ação alguma (<strong>DO NOTHING</strong>) basta não especificar comandos na tabela de comandos SQL. - - - SQL command - Comando SQL - - - - RelacionamentoWidget - - General - Geral - - - Relationship: - Relacionamento: - - - One to one relationship - Relacionamento de um para um - - - One to many relationship - Relacionamento de um para muitos - - - Many to many relationship - Relacionamento de muitos para muitos - - - Generalization relationship (inheritance) - Relacionamento de generalização (herança) - - - Dependency relationship - Relacionamento de dependência entre tabelas ou entre uma tabela e visão - - - Identifier - Identificador - - - Source Table: - Tabela Origem: - - - Target Table: - Tabela Destino: - - - Cardinality: - Cardinalidade: - - - Source Required - Origem Obrigatória - - - Target Required - Destino Obrigatória - - - Name of the table generated from many to many relationship - Nome da tabela gerada pelo relacionamento muitos para muitos - + PolicyWidget - Table Name: - Nome Tab. N-N: - - - Foreign key - Chave-estrangeira - - - Deferrable: - Postergável: - - - Deferral: - Postergação: - - - Attributes - Atributos + Basics + - Constraints - Restrições + Command: + - Primary key - Chave-primária + Permissive + - Attribute - Atributo + Roles + Papéis - Type - Tipo + Expressions + - Constraint - Restrição + USING: + - Editing attributes of an existing relationship is allowed, but must be done carefully because it may break references to columns and cause invalidation of objects such as triggers, indexes, constraints and sequences. - A edição de atributos de um relacionamento já existente é permitida, porém, deve ser feita com atenção pois pode quebrar referências à colunas e causar a invalidez de objetos como gatilhos, índices, restrições e sequências. + CHECK: + - Use the special primary key if you want to include a primary key containing inherited / copied columns to the receiving table. This is a feature available only for generalization / dependency relationships. - Utilize o recurso de chave-primária especial caso queira incluir uma chave-primária contendo as colunas heradas/copiadas na tabela receptora. Este é um recurso disponível apenas para relacionamentos de generalização/dependência. + Name + Nome - Automatic Suffix - Sufixo Automático + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + + + + QObject - Source Suffix: - Sufixo Origem: + new_database + novo_banco_de_dados - Target Suffix: - Sufixo Destino: + %1 (line: %2) + %1 (linha: %2) @@ -12482,18 +9049,10 @@ disponíveis estão descritos abaixo. Connection Mode - - This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. - - Connect FK to PK columns - - This mode is the classical one. It connects the relationship to tables through their central points. - - Connect tables' center points @@ -12606,21 +9165,37 @@ disponíveis estão descritos abaixo. Default Padrão + + This mode renders the relationships in crow's foot notation which has a better semantics and readability. It also determines the optimal point where the relationship is connected on the tables' edges taking their position into account. + + + + Crow's foot notation + + + + This mode determines the optimal point where the relationship is connected on the tables' edges taking their position into account. It implies the usage of the classical ER notation. + + + + Connect tables' edges + + + + This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. It implies the usage of the classical ER notation. + + + + This mode is the classical one. It connects the relationship to tables through their central points. It implies the usage of the classical ER notation. + + RelationshipWidget - - Form - Formulário - General Geral - - Relationship: - Relacionamento: - One to one relationship Relacionamento de um para um @@ -12689,22 +9264,6 @@ disponíveis estão descritos abaixo. Name of the table generated from many to many relationship Nome da tabela gerada pelo relacionamento muitos para muitos - - Table Name: - Nome Tab.: - - - Source Suffix: - Sufixo Origem: - - - Target Suffix: - Sufixo Destino: - - - Foreign key - Chave estrangeira - Deferrable: Postergável: @@ -12713,10 +9272,6 @@ disponíveis estão descritos abaixo. Deferral: Postergação: - - Automatic Suffix - Sufixo Automático - Attributes Atributos @@ -12749,14 +9304,6 @@ disponíveis estão descritos abaixo. Name Nome - - Editing attributes of an existing relationship is allowed, but must be done carefully because it may break references to columns and cause invalidation of objects such as triggers, indexes, constraints and sequences. - A edição de atributos de um relacionamento já existente é permitida, porém deve ser feita cuidadosamente, pois pode quebrar referências à colunas e causar a invalidação de objetos como gatilhos, índices, restrições e sequências. - - - Use the special primary key if you want to include a primary key containing inherited / copied columns to the receiving table. This is a feature available only for generalization / copy relationships. - Use a chave primária especial se você quer incluir uma chave primária contendo colunas herdadas / copiadas para a tabela receptora. Esta é uma característica disponível apenas para relacionamentos de generalização / cópia. - This advanced tab shows the objects (columns or table) auto created by the relationship's connection as well the foreign keys that represents the link between the participant tables. Esta aba avançada mostra os objetos (colunas ou tabela) auto criados pela conexão do relacionamento, bem como as chaves estrangeiras que representam a ligação entre as tabelas participantes. @@ -12809,22 +9356,6 @@ disponíveis estão descritos abaixo. STORAGE - - Reference Suffix: - Sufixo de Referência: - - - Table 1 - Tabela 1 - - - Suffix: - Sufixo: - - - Table 2 - Tabela 2 - Name Patterns @@ -12991,74 +9522,18 @@ disponíveis estão descritos abaixo. - RestricaoWidget - - Constraint Type: - Tipo de Restrição: - - - Check Expr.: - Expr.Checagem: - - - Fill Factor: - Fator Preenc.: - - - Comparison: - Comparação: - - - Deferrable: - Postergável: - - - Deferral: - Postergação: - - - Columns - Colunas - - - Column: - Coluna: - - - Referenced Columns - Colunas Referenciadas - - - Table: - Tabela: - - - Column - Coluna - + ResultSetModel - Type - Tipo - - - Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they will be ignored. To create primary key using columns included by relationship use the feature attributes, constraints and primary key on the relationship form. - Colunas as quais foram incluídas por relacionamento não podem ser adicionadas/removidas manualmente das chaves-primárias. Caso isso ocorra tais alterações serão ignoradas. Para criar chaves-primárias usando colunas incluídas por relacionamentos utilize o recurso de atributos, restrições e chave-primária no formulário de edição relacionamentos. + [binary data] + RoleWidget - - Form - Formulário - Password: Senha: - - Validity: - Validade: - Connections: Conexões: @@ -13071,26 +9546,6 @@ disponíveis estão descritos abaixo. Superuser Superusuário - - Inherit Permissions - Herdar Permissões - - - Create Database - Criar Banco de Dados - - - Can Login - Pode Logar - - - Create Users/Groups - Criar Usuários/Grupos - - - Encrypted Password - Senha Criptografada - Members Membros @@ -13112,40 +9567,44 @@ disponíveis estão descritos abaixo. Validade - Can create Database - Pode criar Banco de Dados + Encrypted + Encriptado - Can create Role - Pode criar Papel + yyyy-MMM-dd hh:mm:ss + - Can use Replication - Pode usar Replicação + Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. + - Encrypted - Encriptado + Inherit permissions + - Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. - Atribuindo <strong><em>-1</em></strong> à <strong><em>Conexões</em></strong> cria um papel sem limite de conexão.<br/> Desmarcando <strong><em>Validade</em></strong> cria um papel que nunca expira. + Can create database + - yyyy-MMM-dd hh:mm:ss + Bypass RLS - Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. + Can use replication + + + + Can login + + + + Can create role RuleWidget - - Form - Formulário - Event: Evento: @@ -13158,10 +9617,6 @@ disponíveis estão descritos abaixo. Conditional Expr.: Expr. Condicional: - - Executed Commands - Comandos Executados - SQL Command: Comando SQL: @@ -13185,30 +9640,14 @@ disponíveis estão descritos abaixo. Form Formulário - - Load SQL script - - - - &Load - - Save SQL commands - - &Save - - Search in SQL code - - &Find - - Alt+F @@ -13293,10 +9732,6 @@ disponíveis estão descritos abaixo. Results (%1) - - [%1]: SQL command successfully executed. <em>%2 <strong>%3</strong></em> - - Rows affected @@ -13329,6 +9764,90 @@ disponíveis estão descritos abaixo. Clear history + + Close the current SQL script + + + + SQL script currently handled + + + + (not saved) + + + + Handle external SQL script + + + + &Script + + + + Fi&nd + + + + Alt+T + + + + Alt+X + + + + Current working database + + + + Load + Carregar + + + Save + Salvar + + + Save as + Salvar como + + + [%1]: SQL command successfully executed in <em><strong>%2</strong></em>. <em>%3 <strong>%4</strong></em> + + + + Plain format + + + + CVS format + + + + This action will wipe out all the SQL commands history for all connections! Do you really want to proceed? + + + + Save history + + + + Reload history + + + + Find in history + + + + Hide find tool + + + + This action will wipe out all the SQL commands history for the current connection! Do you really want to proceed? + + SQLToolWidget @@ -13384,51 +9903,59 @@ disponíveis estão descritos abaixo. <strong>ATTENTION:</strong> Disconnect from all databases will close any opened tab in this view! Do you really want to proceed? + + + SceneInfoWidget - <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? + Form + Formulário + + + Current position of the mouse in the canvas - You're running a demonstration version! The data manipulation feature is available only in the full version! + - - - - SchemaWidget - Form - Formulário + Current zoom factor + - Show rectangle - Mostrar retângulo + Currently selected object(s) + - Fill color: - Cor de preenchimento: + Dimensions of the selected object(s) + + + + No selection + + + + N/A + - Select fill color - Seleciona cor de preenchimento + Sel. objects: %1 + - SeletorObjetoWidget + SchemaWidget - Clear field - Limpar campo + Show rectangle + Mostrar retângulo - Select Object - Selecionar Objeto + Fill color: + Cor de preenchimento: SequenceWidget - - Form - Formulário - Cyclic: Cíclica: @@ -13453,44 +9980,17 @@ disponíveis estão descritos abaixo. Cache: Cache: - - Owner: - Proprietário: - Owner Col.: - - - SequenciaWidget - - Cyclic: - Cíclica: - - - Start: - Início: - - Maximum: - Máximo: - - - Minimum: - Mínimo: - - - Increment: - Incremento: - - - Cache: - Cache: + Defualt values: + - Owner: - Possuidora: + User defined + @@ -13624,10 +10124,6 @@ disponíveis estão descritos abaixo. SourceCodeWidget - - Form - Formulário - Version: Versão: @@ -13648,10 +10144,6 @@ disponíveis estão descritos abaixo. XML - - Type: - Tipo: - Source code visualization Visualização de código fonte @@ -13743,10 +10235,6 @@ disponíveis estão descritos abaixo. Before: - - It's recommended to use this feature only when the SQL validation fails in cases when a object is being referenced in portions where the ordinary validation couldn't reach, e.g., inside of a rule command or check constraint expression. - - Swap the values of the fields @@ -13755,135 +10243,41 @@ disponíveis estão descritos abaixo. Swap values - - - TabelaObjetosWidget - - Add Item - Adicionar Item - - - Remove Item - Remover Item - - - Update Item - Atualizar Item - - - Remove All - Excluir Todos - - - Edit Item - Editar Item - - - Move Up - Mover para cima - - - Move Down - Mover para baixo - - - Move to start - Mover para o início - - - Move to end - Mover para o fim - - - Do you really want to remove the selected item? - Tem certeza de que deseja remover o item selecionado? - - - Do you really want to remove the all items? - Tem certeza de que deseja remover todos os itens? - - - Confirmação - Confirmation - - - - TabelaWidget - - Columns - Colunas - - Constraints - Restrições - - - Triggers - Gatilhos - - - Rules - Rules + Change the objects creation order is an irreversible operation and cause the operations history to be automatically erased. Note that the creation order configured in this form is not definitive and may change after a model validation. + - Indexes - Índices + Swap the object ids changing their creation order + - Tables - Tabelas + Swap ids + - Ancestor Tables: - Tabelas Ancestrais: + Filter: + - Copied Tables: - Tabelas Copiadas: + ID + - Name - Nome + Object + Objeto Type - Tipo - - - Default Value - Valor Padrão - - - Refer. Table - Tab. Refer. - - - Events - Eventos - - - Execution - Execução - - - Event - Evento - - - Indexing - Indexação - - - With OIDs: - Com OIDs: + Tipo - Attribute - Atributo + Parent Object + Objeto Pai - Firing - Disparo + Parent Type + Tipo Pai @@ -13907,18 +10301,10 @@ disponíveis estão descritos abaixo. Add empty rows - - Add - Adicionar - Ins - - Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. - - Add an empty column @@ -13927,10 +10313,6 @@ disponíveis estão descritos abaixo. Remove all rows from the grid preserving columns - - Clear - - Shift+Del @@ -13939,26 +10321,14 @@ disponíveis estão descritos abaixo. Delete the selected rows - - Delete - - Del - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> - - Duplicate the selected rows - - Duplicate - - Ctrl+D @@ -13996,67 +10366,88 @@ disponíveis estão descritos abaixo. - (no columns) + Copy items on the grid - - - TableObjectView - -Relationship: %1 + Copy + Copiar + + + Add row - - - TableView - Connected rels: %1 + Delete column - - - TableWidget - Form - Formulário + Paste items on the grid + - With OIDs: - Com OIDs: + Paste + Colar - Columns - Colunas + Ctrl+V + - Constraints - Restrições + Fills the grid using a CSV file + - Triggers - Gatilhos + <html><head/><body><p>Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <span style=" font-weight:600;">INSERT</span> commands.</p></body></html> + - Rules - Regras + Add column + - Indexes - Índices + Duplicate rows + - Tables - Tabelas + Change the values of all selected cells at once + + + + Bulk data edit + + + + Ctrl+E + + + + Delete all columns + + + + Delete rows + - Ancestor Tables: - Tabelas Ancestrais: + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + + + + Delete all rows + + + + TableObjectView - Copied Tables: - Tabelas Copiadas: + +Relationship: %1 + + + + TableWidget Name Nome @@ -14069,10 +10460,6 @@ Relationship: %1 Default Value Valor Padrão - - Attribute - Atributo - ON DELETE @@ -14110,64 +10497,120 @@ Relationship: %1 Esquema - Parent - Pai + Parent + Pai + + + Copy + Copiar + + + Options + + + + Tag: + + + + With OID + + + + Generate ALTER for columns/constraints + + + + Unlogged + + + + &Columns + + + + Co&nstraints + + + + Tri&ggers + + + + &Rules + + + + &Indexes + + + + &Tables + - Copy - Copiar + Edit data + - Options + Define initial data for the table - Tag: + Enable row level security - With OID + Force RLS for owner - Generate ALTER for columns/constraints + &Policies - Unlogged + PK - &Columns + Attribute(s) - Co&nstraints + It is not possible to mark a column as primary key when the table already has a primary key which was created by a relationship! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. - Tri&ggers + It is not possible to mark a column created by a relationship as primary key! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. - &Rules + Command - &Indexes + Permissive - &Tables + USING expression - Edit data + CHECK expression - Define initial data for the table - + Roles + Papéis + + + Yes + Sim + + + No + Não @@ -14221,10 +10664,6 @@ Relationship: %1 TextboxWidget - - Form - Formulário - Bold Negrito @@ -14258,142 +10697,8 @@ Relationship: %1 - - TipoPgSQLWidget - - Data Type - Tipo de Dado - - - Type: - Tipo: - - - Length - Comprimento - - - Precision - Precisão - - - Dimension - Dimensão - - - Interval: - Intervalo: - - - Format: - Formato: - - - Spatial: - Espacial: - - - Variation: - Variação: - - - - TipoWidget - - Configuration: - Configuração: - - - Base Type - Tipo Base - - - Enumeration - Enumeração - - - Composite - Composto - - - Enumerations - Enumerações - - - Enumeration: - Enumeração: - - - Attributes - Atributos - - - Internal Length: - Comp. Interno: - - - Storage: - Armazenamento: - - - By Value: - Por Valor: - - - Category: - Categoria: - - - Preferred: - Preferido: - - - Delimiter: - Delimitador: - - - Alignment: - Alinhamento: - - - Default Value: - Valor Padrão: - - - Functions - Funções - - - Copy Type - Tipo Cópia - - - Element Type - Tipo Elemento - - - Name - Nome - - - Type - Tipo - - - The functions to be assigned to a type should be written in C language and possess, respectively, the following signatures:<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any function(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring function(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta function(any)</em></td> <td><strong>RECV:</strong> <em>any function(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer function(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring function(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean function(internal)</em></td> <tr> </table> - As funções a serem atribuídas ao tipo devem ser todas escritas em linguagem C e possuirem, respectivamente, as seguintes assinaturas:<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any funcao(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring funcao(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta funcao(any)</em></td> <td><strong>RECV:</strong> <em>any funcao(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer funcao(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring funcao(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean funcao(internal)</em></td> <tr> </table> - - TriggerWidget - - Form - Formulário - - - Execute per row - Executar por linha - Event: Evento: @@ -14418,18 +10723,6 @@ Relationship: %1 Deferrable: Postergável: - - Deferral: - Postergação: - - - Referenced Table: - Tab. Referenciada: - - - Conditional Expr.: - Expr. Condicional: - Columns Colunas @@ -14450,10 +10743,6 @@ Relationship: %1 Function: Função: - - Constraint Trigger: - Gatilho Restrição: - Column Coluna @@ -14489,10 +10778,6 @@ Relationship: %1 TypeWidget - - Form - Formulário - Configuration: Configuração: @@ -14505,10 +10790,6 @@ Relationship: %1 Enumeration Enumeração - - Composite - Composto - Enumerations Enumerações @@ -14529,18 +10810,10 @@ Relationship: %1 Storage: Armazenamento: - - By Value: - Por Valor: - Category: Categoria: - - Preferred: - Preferido: - Delimiter: Delimitador: @@ -14732,22 +11005,10 @@ Relationship: %1 Get source code - - Recover a package - - - - Purchase a new package - - Failed to check updates - - The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <strong>%1</strong>. - - No updates found @@ -14760,21 +11021,17 @@ Relationship: %1 The update notifier failed to check for new versions! A HTTP status code was returned: <strong>%1</strong> + + The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <em>%1</em> - <strong>%2</strong>. + + ViewWidget - - Form - Formulário - References Referências - - Type: - Tipo: - Column Coluna @@ -14787,18 +11044,6 @@ Relationship: %1 Used in: Usado em: - - SELECT-FROM - - - - FROM-WHERE - - - - After WHERE - Após WHERE - Table: Tabela: @@ -14839,15 +11084,6 @@ Relationship: %1 Alias Col. Apelido Col. - - To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[tablel].*</strong></em> - Versão em inglês com erro! (tablel) - Para referenciar todas as colunas de uma tabela (*) basta não preencher o campo <strong>Coluna</strong>, isso é equivalente a escrever <em><strong>[esquema].[tabela].*</strong></em> - - - -- Could not generate the code. Make sure all attributes are correctly filled! -- - -- Impossível gerar código. Verifique se todos os atributos foram preenchidos corretamente! -- - Reference Type: Tipo Referência: @@ -14868,10 +11104,6 @@ Relationship: %1 Table Expression Expressão de Tabela - - Flags: SF FW AW VD - Sinalizadores: SF FW AW VD - Name Nome @@ -14928,130 +11160,57 @@ Relationship: %1 With no data - - - VisaoGeralWidget - - Model overview - Visão geral do modelo - - - - VisaoObjetosWidget - - Objects of Model - Objetos do Modelo - - - Visible Objects Type - Tipos de Objetos Visíveis - - Select All - Marcar Todos - - - Clear All - Desmarcar Todos - - - Select - Selecionar - - - Cancel - Cancelar - - - Objects view configuration - Configuração da visão de objetos - - - Tree view - Visão em árvore - - - List view - Visão em lista - - - Object - Objeto - - - Type - Tipo - - - Parent Object - Objeto Pai - - - Parent Type - Tipo Pai - - - - VisaoWidget - - References - Referências - - - Type: - Tipo: - - - Column - Coluna + The element will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns + - Expression - Expressão + SELECT ... + - Used in: - Usado em: + The element will be used as part of the WHERE clause in form of conditional expression + - After WHERE - Após WHERE + WHERE ... + - Table: - Tabela: + The element is used in the FROM portion of the command in order to reference tables or construct JOIN statements + - Table Alias: - Alias Tabela: + FROM ... + - Column: - Coluna: + The element's expression is used exclusively as the view's definition + - Column Alias: - Alias Coluna: + The element will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements + - Expression: - Expressão: + End expression + - Expression Alias: - Alias Expressão: + Indexes + Índices - Code Preview - Previsão de Código + Flags: SF FW AW EX VD + - To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[tablel].*</strong></em> - Para se referenciar todas as colunas de uma tabela (*) basta não preencher o campo <strong>Coluna</strong>, isso é equivalente a se escrever <em><strong>[esquema].[tabela].*</strong></em> + To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[table].*</strong></em> + - -- Could not generate the code. Make sure all attributes are correctly filled! -- - -- Impossível gerar código. Verifique se todos os atributos foram preenchidos corretamente! -- + Indexing + Indexação diff --git a/lang/zh_CN.qm b/lang/zh_CN.qm index 45596b5ae3c8382b0854de8c6ebeaf8443167880..aad7da52c40f5bbb9264369e4f666c81b895b332 100644 GIT binary patch delta 8648 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 e*RCFNLYG1-mB{^tb!ETBrPq^5%^7W=*% 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 diff --git a/lang/zh_CN.ts b/lang/zh_CN.ts index deba0c9869..c5c9a72669 100644 --- a/lang/zh_CN.ts +++ b/lang/zh_CN.ts @@ -1,61 +1,6 @@ - - AboutForm - - Version %1 - 版本 %1 - - - Close - 关闭 - - - PostgreSQL Database Modeler - PostgreSQL 数据库建模工具 - - - 0.0.0.0 - 0.0.0.0 - - - <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" font-size:11pt; font-style:italic; text-decoration: underline; color:#0057ae;">http://pgmodeler.com.br</span></a></p></body></html> - <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" font-size:11pt; font-style:italic; text-decoration: underline; color:#0057ae;">http://pgmodeler.com.br</span></a></p></body></html> - - - Copyright 2006-2012 - Raphael Araújo e Silva <rkhaotix@gmail.com> - -The pgModeler project is a CASE tool for modeling relational databases for PostgreSQL DBMS through the use of modeling techniques from entity-relationship diagrams as well merging concepts that PostgreSQL implements. - -Special thanks to friends of the software development team of the Legislative Assembly, Tocantins, Brazil: Michel de Almeida, Felipe Santana, Jonas Nepomuceno, Ricardo Ishibashi and Álvaro Nunes. - 版权所有 2006-2012 - Raphael Araújo e Silva <rkhaotix@gmail.com> - -pgModeler 项目是通过使用实体-关系图并结合 PostgreSQL 实现的相关理论概念,对 PostgreSQL DBMS 关系型数据库进行建模的 CASE 工具。 - -特别感谢巴西托坎廷斯立法大会软件开发团队的朋友们:Michel de Almeida,Felipe Santana,Jonas Nepomuceno,Ricardo Ishibashi 和 Álvaro Nunes。 - - - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -The complete text of GPLv3 is at LICENSE file on source code root directory. Also, you can get the complete GNU General Public License at <http://www.gnu.org/licenses/> - 本软件是自由软件。你可以遵照自由软件基金会发布的 GNU 通用公共授权协议第三版本 (GPLv3) 所有条文来修改和重新发布这一程序。 - -发布这一程序的目的是希望它有用,但没有任何担保;亦无对适售性或特定目的适用性所为的默示性担保。详情请参照GNU通用公共授权。 - -GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 GNU 通用公共授权协议请见<http://www.gnu.org/licenses/> - - - About pgModeler - 关于 pgModeler - - - Design, configure, deploy - 设计, 配置, 部署 - - AboutWidget @@ -70,22 +15,10 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. - - Design, configure, deploy - 设计, 配置, 部署 - - - <a href="http://pgmodeler.com.br">http://pgmodeler.com.br</a> - - pgModeler is proudly a brazilian software! - - <html><head/><body><p>Copyright 2006-2016 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - - Hide this widget @@ -94,18 +27,6 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G ... - - 0.0.0.0 - 0.0.0.0 - - - (CODE_NAME) - - - - Build: - - (BUILD_NUM) @@ -115,139 +36,19 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G - Contributors - - - - <html><head/><body><p>This page is dedicated to all contributors who gave a bit of their time in make pgModeler a better software somehow. The complete list of people that helped pgModeler can be found at <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>If you have a great idea to improve pgModeler please submit it <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">here</span></a>. No ideas for now but want to help? Why not donate a few bucks <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">here</span></a>!?</p></body></html> - - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - 6 - 6 - - - 7 - 7 - - - 8 - 8 - - - Name - 名称 - - - Country - - - - Contribution - - - - Damien Degois - - - - France - - - - French UI translation and several improvements in auxiliary scripts. - - - - Ji Bin - - - - China - - - - Chinese UI translation and small fixes. - - - - Pierre-Samuel LE STANG - - - - French UI translation. - - - - Lisandro Damián Nicanor - - - - Argentina - - - - Improvements on build scripts enabling the custom packaging in Linux distros; Per-user settings; pgModeler's package maintainer in Debian Linux. - - - - Pavel Alexeev - - - - Russia - - - - Additional work for packaging in Linux distros; pgModeler's package maintainer in Fedora Linux. - - - - Mariusz Fik - - - - Poland - - - - Custom packaging first ideas. Tester of first version of custom packaging patch. - - - - Jonathan DUPRE - + 0.0.0 + 0.0.0 - Gilberto Castillo + build: - Cuba + <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" text-decoration: underline; color:#2980b9;">https://pgmodeler.io</span></a></p></body></html> - Spanish UI translation. + <html><head/><body><p>Copyright 2006-2018 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.io</span></a>&gt;</p></body></html> @@ -257,18 +58,10 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Final Function: 最终处理函数: - - Transition Function: - 状态转换函数: - Sort Operator: 排序操作符: - - Final Condition: - 最终条件: - Funtion Inputs 函数输入 @@ -289,10 +82,6 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G An aggregate function that accepts the types <em><strong>typeA</strong></em> and <em><strong>typeB</strong></em> as input types and which type of state is <em><strong>state_type</strong></em>, must obey the following rules: <br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Final Function:</strong> <em>void final_function(<strong>state_type</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Transition Function:</strong> <em><strong>state_type</strong> transition_function(<strong>state_type</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> 聚合函数接受类型 <em><strong>typeA</strong></em> 和 <em><strong>typeB</strong></em> 作为输入类型,并且类型状态为 <em><strong>state_type</strong></em>, 函数必须遵循如下规则:<br/><br/> <strong> &nbsp;&nbsp;&nbsp;•最终处理函数:</strong> <em>void final_function(<strong>state_type</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• 过渡处理函数:</strong> <em><strong>state_type</strong> transition_function(<strong>state_type</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> - - Form - Form - Initial Condition: @@ -484,18 +273,6 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Colors: 颜色: - - Font color / Fill color 1 - 字体颜色/填充颜色1 - - - Fill color 2 - 填充颜色2 - - - Border color - 边框颜色 - Underline 下划线 @@ -544,13 +321,17 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Placeholder: Body + + Constraint: Name + + + + Constraint: Descriptor + + Application - - Error - 错误 - Unknown exception caught! 捕捉到未知异常! @@ -560,6 +341,13 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G + + BaseConfigWidget + + A backup of the previous settings was saved into <strong>%1</strong>! + + + BaseForm @@ -673,10 +461,6 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Database 数据库 - - Table-Table Relationship - 表-表关系 - Textbox 文本框 @@ -689,10 +473,6 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Parameter 参数 - - Table-View Relationship - 表-视图关系 - Collation @@ -727,6 +507,14 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Basic Relationship + + Policy + + + + Generic SQL + + BaseObjectView @@ -757,18 +545,10 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Schema: 模式: - - Permissions: - 权限: - This object is protected thus no change in form will be applied to it. 此对象处于受保护状态,无法对它应用任何修改。 - - Parent Object: - 父对象: - Value(s) @@ -777,26 +557,10 @@ GPLv3 的完整内容放在源代码根目录的 LICENSE 文件中。完整的 G Version 版本 - - The field(s) or value(s) highlighted on the form is(are) for the exclusive use and/or mandatory in specific versions of PostgreSQL. Failure to complete that may cause errors in the generation of SQL code for each version shown in tool tips of the highlighted fields. - 窗口中高亮显示的字段或值只能用于特定版本的 PostgreSQL。在生成高亮字段工具提示中显示的各版本 SQL 代码时可能会发生错误,导致无法完成操作。 - - - Form - Form - icone icone - - Criate / Edit: - 创建/修改: - - - Edit Permissions - 修改权限 - Edit permissions 编辑权限 @@ -846,6 +610,17 @@ This will disable the code of all child and referrer objects. + + BaseTableView + + Toggles the extended attributes display + + + + Connected rels: %1 + + + BugReportForm @@ -922,15 +697,14 @@ This will disable the code of all child and referrer objects. - CastWidget + BulkDataEditWidget - Conversion Type: - 转换类型: - - - Implicit - 隐式转换 + Bulk data edit + + + + CastWidget Assignment 强制转换 @@ -939,18 +713,10 @@ This will disable the code of all child and referrer objects. Input / Output 输入 / 输出 - - Conversion Function: - 转换函数: - The function to be assigned to a cast from <em><strong>typeA</strong></em> to <em><strong>typeB</strong></em> must have the following signature: <em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. 将<em><strong>类型 A</strong></em>转换成 <em><strong>类型 B</strong></em>的函数签名:<em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. - - Form - Form - Source data type 原始数据类型 @@ -978,10 +744,6 @@ This will disable the code of all child and referrer objects. CodeCompletionWidget - - Make persistent - - Makes the widget closable only by ESC key or mouse click on other controls. @@ -994,13 +756,13 @@ This will disable the code of all child and referrer objects. (no items found.) + + Make &persistent + + CollationWidget - - Form - Form - Locale: @@ -1052,23 +814,27 @@ This will disable the code of all child and referrer objects. 默认值: - Form - Form + E&xpression: + - Not Null: - 非空: + &NOT NULL + - E&xpression: + Se&quence: - &NOT NULL + Edit the underlying sequence's attributes - Se&quence: + Edit sequence + + + + Identity: @@ -1094,22 +860,10 @@ This will disable the code of all child and referrer objects. General 常规 - - Style - 样式 - - - Connetions - 连接 - Plug-ins 插件 - - Confirmation - 确认 - Any modification made until now in the current section will be lost! Do you really want to restore default settings? 当前部分所做的修改将会丢失!要恢复到默认设置吗? @@ -1130,6 +884,14 @@ This will disable the code of all child and referrer objects. Snippets + + In some cases restore the default settings related to it may solve the problem. Would like to do that? + + + + Restore + + ConnectionsConfigWidget @@ -1209,18 +971,10 @@ This will disable the code of all child and referrer objects. Revoked Certs.: 已吊销证书: - - Kerberus Server: - Kerberus 服务器: - Force GSSAPI 强制 GSSAPI - - Options: - 选项: - Add 新建 @@ -1233,10 +987,6 @@ This will disable the code of all child and referrer objects. Test 测试 - - Form - Form - Delete selected connection 删除选中的连接 @@ -1269,10 +1019,6 @@ This will disable the code of all child and referrer objects. Success 成功 - - Connection successfuly stablished! - 成功建立连接! - Edit database connections @@ -1333,16 +1079,6 @@ This will disable the code of all child and referrer objects. Indicates in which operations (diff, export, import or validation) the connection is used if none is explicitly specified by the user. - - Connection successfuly stablished! - -Server details: - -PID: `%1' -Protocol: `%2' -Version: `%3' - - There is a connection being created or edited! Do you want to save it? @@ -1359,6 +1095,16 @@ Version: `%3' Edit connections + + Connection successfully established! + +Server details: + +PID: `%1' +Protocol: `%2' +Version: `%3' + + ConstraintWidget @@ -1366,18 +1112,10 @@ Version: `%3' Constraint Type: 约束类型: - - Check Expr.: - 检查表达式: - Fill Factor: 填充因子: - - Comparison: - 比较: - Deferrable: 可延迟: @@ -1410,10 +1148,6 @@ Version: `%3' Type 类型 - - Form - Form - ON DELETE: ON DELETE: @@ -1422,10 +1156,6 @@ Version: `%3' ON UPDATE: ON UPDATE: - - Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they will be ignored. To create primary key using columns included by relationship use the feature attributes, constraints and primary key on the relationship form. - 包含在关系中的列不能被手动添加/删除主键。这样的操作会被忽略。要将关系中的列创建为主键,请使用“创建/编辑:关系”窗口中的特征属性和主键约束。 - Match: @@ -1465,10 +1195,6 @@ Version: `%3' Target Encoding: 目标编码: - - Conversion Function: - 转换函数: - Default Conversion: 默认转换: @@ -1477,136 +1203,142 @@ Version: `%3' The function to be assigned to an encoding conversion must have the following signature: <em>void function(integer, integer, cstring, internal, integer)</em>. 编码转换的函数签名:<em>void function(integer, integer, cstring, internal, integer)</em>。 - - Form - Form - Conversion Func.: - CrashHandler + CrashHandlerForm - pgModeler Crash Handler - pgModeler 故障处理程序 + Crash Handler + - Oops! pgModeler just crashed! - 糟糕!pgModeler 崩溃了! + Stack trace + 堆栈跟踪信息 - Create - 创建 + Input: + - &Cancel - 取消(&C) + Load report file for analysis + - We apologize for what happened! It is clear that a nasty bug caused it. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. - 我们为此深表歉意!显然,这是由讨厌的 bug 引起的。请描述一下在 pgModule 意外退出前你所做过的操作,并填写在下面的输入框内。这些将有助于我们错误的消除和软件的改进。 + Save the attached model file on the filesystem + - Report - 报告 + pgModeler bug report (*.bug);;All files (*.*) + - Actions made before the crash: - 崩溃前的操作: + Load report + - Loaded Model - 已打开的模型 + Save model + 保存模型 - Attach the below database model file that possibly generates the crash. - 附上可能导致软件崩溃的数据库模型文件。 + Database model (*.dbm);;All files (*.*) + 数据库模型 (*.dbm);; 所有文件 (*.*) - Stack trace - 堆栈跟踪信息 + Crash handler + - pgModeler crash file analysis - pgModeler 崩溃文件分析 + Bug report analysis mode activated. + - Error - 错误 + Oops! pgModeler just crashed! + 糟糕!pgModeler 崩溃了! - File: %1 -Size: %2 bytes - - - 文件: %1 -大小: %2 bytes - - + We apologize for what happened! It is clear that a nasty bug caused that. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. + + + + CsvLoadWidget - Information - 信息 + Form + Form - Crash report successfuly generated! Please send the file '%1' to %2 in order be debugged. Thank you for the collaboration! - 成功生成故障报告!请将文件 ‘%1' 发送到 %2,以便用于调试。感谢您的合作! + Load CSV + - - - CrashHandlerForm - Crash Handler + CSV File: - Stack trace - 堆栈跟踪信息 + Select output file + - Input: + ... - Load report file for analysis + Separator: - Save the attached model file on the filesystem + Use the first row as column names in the CSV file. By unchecking this option the first row is used as data. - pgModeler bug report (*.bug);;All files (*.*) + Columns in the first row - Load report + Load + 打开 + + + Semicolon (;) - Save model - 保存模型 + Comma (,) + - Database model (*.dbm);;All files (*.*) - 数据库模型 (*.dbm);; 所有文件 (*.*) + Space + Space - Crash handler + Tabulation - Bug report analysis mode activated. + Other - Oops! pgModeler just crashed! - 糟糕!pgModeler 崩溃了! + ; + - We apologize for what happened! It is clear that a nasty bug caused that. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. + Text delimiter: + + + + " + + + + Load CSV file + + + + Comma-separted values (*.csv);;All files (*.*) @@ -1681,10 +1413,6 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE <html><head/><body><p>Use custom commands with extreme caution because you can change the semantics of the entire model when running SQL validation or export processes. Additionally, depending on the amount of commands, those processes can have their performance sensibly degradated.</p></body></html> - - Type: - 类型: - Generic INSERT @@ -1732,18 +1460,10 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE &Close 关闭(&C) - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> - - Refresh listing - - Refresh - - F5 F5 @@ -1752,34 +1472,14 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE Save changes - - Save - 保存 - Ctrl+S Ctrl+S - - Copy the selection as CSV buffer - - - - Copy - 复制 - - - Ctrl+C - - Export results to CSV file - - Export - 导出 - Ctrl+X @@ -1788,10 +1488,6 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE Undo modifications - - Undo - 撤销 - Ctrl+Z Ctrl+Z @@ -1800,10 +1496,6 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE Add empty rows - - Add - 新建 - Ins Ins @@ -1812,10 +1504,6 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE Mark the selected rows to be deleted - - Delete - 删除 - Del Del @@ -1824,10 +1512,6 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE Duplicate the selected rows - - Duplicate - - Ctrl+D @@ -1968,29 +1652,93 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE insert - - - DatabaseExplorerWidget - Form - Form + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + - Toggles the display of system objects. + Copy items on the grid - System + Paste items on the grid - Toggles the display of extension objects + Ctrl+V - Extension + Browse referenced tables + + + + Change the values of all selected cells at once + + + + Ctrl+E + + + + Add new rows from a CSV file + + + + Copy as CSV + + + + Copy as text + + + + Copy items + + + + Pase items + + + + Browse tables + + Duplicate row(s) + + + + Delete row(s) + + + + Edit cell(s) + + + + Column + + + + Referenced tables + + + + (none) + + + + Referrer tables + + + + + DatabaseExplorerWidget + + Form + Form + Open the grid to visualize or edit data @@ -2019,10 +1767,6 @@ Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE Update the objects tree - - Ctrl+S - Ctrl+S - Drop this database @@ -2761,131 +2505,251 @@ Ref. column(s): %2 -- Source code unavailable for the object %1 (%2). -- - - - DatabaseImportForm - Database Import + Toggle the display of filter widget as well the system/extension objects. - Database import + Sort items alphabetically. When unchecked, items are sorted by OID. - Settings + Sort alphabetically - Options + Client encoding - Connection: - 连接: + Configuration file + - Origin point: + Data directory - Starting point where objects will be put. + Dynamic library path - Tables per row: + Dynamic shared memory - Tables per row + Hba file - Spacing: + Listen addresses - Schemas per row + Max. connections - Spacing between objects + Listen port - Schemas per row: + Server encoding - Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. + SSL - Automatically resolve dependencies + SSL ca file - Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. + SSL cert file - Random colors for relationships + SSL crl file - Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. + SSL key file - Import system objects + Server version - Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. + Ident file - Import extension objects + Password encryption - pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. + Connection ID - Ignore import errors + Server PID - All catalog queries as well the created objects' source code are printed to standard output (stdout). + Server protocol - Debug mode + Referrers - Create all imported objects in the current working model instead of create a new one. + Identity - Import objects to the working model + Command - Database - 数据库 + USING expr. + - Filter: + CHECK expr. - Filter object by it's OID - + Roles + 角色 - By OID + RLS enabled + + + + RLS forced + + + + Show objects filter + + + + Show system objects + + + + Show extension objects + + + + -- Source code unavailable for this kind of object -- + + + + Also restart sequences + + + + Warning + + + + You're running a demonstration version! The data manipulation feature is available only in the full version! + + + + <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? + + + + + DatabaseImportForm + + Settings + + + + Options + + + + Connection: + 连接: + + + Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. + + + + Automatically resolve dependencies + + + + Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. + + + + Random colors for relationships + + + + Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. + + + + Import system objects + + + + Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. + + + + Import extension objects + + + + pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. + + + + Ignore import errors + + + + All catalog queries as well the created objects' source code are printed to standard output (stdout). + + + + Debug mode + + + + Create all imported objects in the current working model instead of create a new one. + + + + Import objects to the working model + + + + Database + 数据库 + + + Filter: + + + + Filter object by it's OID + + + + By OID @@ -2965,15 +2829,19 @@ Ref. column(s): %2 - Retrieving objects of table `%1'... + This is a PostgreSQL built-in data type and cannot be imported. - This is a PostgreSQL built-in data type and cannot be imported. + This is a pgModeler's built-in object. It will be ignored if checked by user. - This is a pgModeler's built-in object. It will be ignored if checked by user. + Import database + + + + Retrieving objects of `%1' (%2)... @@ -2991,10 +2859,6 @@ Ref. column(s): %2 Creating object `%1' (%2)... - - Trying to recreate object `%1' (%2)... - - Import failed to recreate some objects in `%1' tries. @@ -3031,17 +2895,17 @@ Ref. column(s): %2 Assigning sequences to columns... - - - DatabaseModel - Loading object: %1 (%2) - 正在载入对象:%1 (%2) + Creating object `%1' (%2), oid `%3'... + - Generating %1 of the object: %2 (%3) - 正在生成对象的 %1:%2 (%3) + Trying to recreate object `%1' (%2), oid `%3'... + + + + DatabaseModel The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2' @@ -3054,10 +2918,6 @@ Ref. column(s): %2 Validating relationships... - - Generating %1 of the object `%2' (%3) - - Saving object `%1' (%2) @@ -3094,6 +2954,10 @@ Ref. column(s): %2 Metadata file successfully loaded! + + Generating %1 code: `%2' (%3) + + DatabaseWidget @@ -3113,10 +2977,6 @@ Ref. column(s): %2 Default 默认 - - Form - Form - Template DB: 数据库模板: @@ -3161,6 +3021,18 @@ Ref. column(s): %2 Use the above fields to specify the default attributes assigned to new objects created on the database model. Leaving a field empty will cause PostgreSQL to use the default values when exporting the model. + + Options: + 选项: + + + Allow connections + + + + Is template + + DomainWidget @@ -3169,32 +3041,32 @@ Ref. column(s): %2 默认值: - Constraint Name: - 约束名称: + Name: + 名称: - Check Expression: - 检查表达式: + Attributes + 属性 - Form - Form + Not null + - Not Null: - 非空: + Check constraints + - Constraint - 约束 + Expression: + - Name: - 名称: + Name + 名称 - Check Expr.: - 检查表达式: + Expression + 表达式 @@ -3332,18 +3204,10 @@ Ref. column(s): %2 Exception - - Insufficient memory space to allocate the object! - 内存不足,无法分配对象! - Assignment of a pseudo-type to the type of the column! 列类型不能为伪类型! - - Zero length assignment! - 长度不能为 0! - Assignment of a precision greater than the length of the type! 精度不能大于类型长度! @@ -3352,10 +3216,6 @@ Ref. column(s): %2 Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6! 类型 time,timestamp 或 interval 的精度设置无效。精度必须小于等于 6! - - Assignment of a not allocated column to object '%1' (%2)! - 必须给对象'%1' (%2) 设置列! - Reference to a column which index is out of the capacity of the column list! 不能引用不在列列表中的列! @@ -3364,26 +3224,6 @@ Ref. column(s): %2 Assignment of not allocated object! 必须设置对象! - - Assignment of a not allocated schema to object '%1' (%2)! - 必须给对象 '%1' (%2) 设置模式! - - - The object '%1' (%2) has inconsistent configuration (invalid SQL/XML definition)! - 对象 '%1' (%2) 设置冲突 (无效的 SQL/XML 定义)! - - - The object '%1' (%2) already exists in the list of elements of the same type in the object '%3' (%4)! - 对象 '%1' (%2) 已经存在于对象 '%3' (%4) 的同类型元素列表中! - - - The object '%1' (%2) can't be assigned because there is already exists in the container object '%3'! - 对象 '%1' (%2) 不能被赋值,因其已存在于容器对象 '%3'! - - - Assignment of object of an invalid type! - 设置的对象无效! - Removing an object of an invalid type! 不能移除无效类型的对象! @@ -3396,62 +3236,18 @@ Ref. column(s): %2 Assignment of empty name to table return type! 表的返回值类型的名称不能为空! - - The insertion of the parameter '%1' will not be possible because there is another parameter with same name in the function '%2'! - 无法插入参数 '%1',因为函数 '%2' 中已经存在一个相同名称的参数了! - - - The insertion of the table return type '%1' will not be possible because there is another return type with the same name in the '%2'! - 无法插入表返回类型 '%1',因为在 '%2' 中已经存在一个相同名称的返回类型! - - - Reference to a parameter which index is out of the parameter list capacity! - 不能引用不在参数列表中的参数! - Reference to an event which does not belongs to trigger! 不能引用不属于触发器的事件! - - The column '%1' can't be assigned to the trigger '%2' because does not belongs to the trigger parent table! - 列 '%1' 无法赋值给触发器 '%2',因为它不属于触发器父表! - - - Assignment of a not allocated function to object '%1' (%2)! - 必须给对象 '%1' (%2) 设置函数! - - - Assignment of a function which return type is different from 'trigger'! - 函数的返回值类型与‘触发器’的不一致! - - - Assignment of a function which parameter count is invalid to the object '%1' (%2)! - 对于对象 '%1' (%2),函数的参数数目不匹配! - Assignment of a function which language is invalid! 语言转换函数无效! - - Assignment of not allocated table to object '%1' (%2)! - 必须给对象 '%1'(%2) 设置表! - - - Reference to an argument which index is out of argument list capacity! - 引用的参数超出参数列表范围! - - - Insertion of a column which name is already registered to another column of the object! - 要插入的列名称已经被注册给了另一个列的对象! - Assignment of empty name to an object! 对象名称不能为空! - - Assignment of invalid name to an object! - 对象名称无效! - Assignment of schema object which type is invalid! 模式对象类型无效! @@ -3488,42 +3284,10 @@ Ref. column(s): %2 Reference to an operator with invalid type! 引用了无效的操作符类型! - - Assigment of value to an invalid option type on role! - 角色选项值的类型无效! - Reference to an invalid role type! 引用了无效的角色类型! - - The insertion of the role '%1' is not possible because this is already being referenced by role '%2'! - 无法插件角色 '%1',因为它已经被角色 '%2' 引用了! - - - Reference redundance detected by having the role '%1' referencing the role '%2'! - 发现角色 '%1' 到角色 '%2' 的引用冗余! - - - The role '%1' can not be listed as a member of itself! - 角色 '%1' 不能列入自身的成员中! - - - Reference to a paper which index is out of paper list capacity! - 纸型引用超出纸型列表范围! - - - Insertion of null command to the rule! - 不能规则插入空命令! - - - Reference to a command which index is out of the command list capacity! - 引用的命令超出命令列表范围! - - - Is not possible to create a self generalization/dependecy relationship! The table can not inherit or copy their own attributes! - 无法创建自身泛化的关系/自身依赖的关系!表不能继承或复制自身的属性! - Assignment of an object that already belongs to another table! 对象已属于另一个表! @@ -3540,10 +3304,6 @@ Ref. column(s): %2 Assignment of a minimum value to the sequence which is greater than the maximum value! 序列的最小值大于其最大值! - - Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values​​! - 序列的起始值不在序列的最小值与最大值的范围内! - Assignment of a null increment value to the sequence! 不能给序列设置空的自增值! @@ -3552,38 +3312,10 @@ Ref. column(s): %2 Assignment of null cache value to the sequence! 序列缓冲值不能为空! - - Assignment of owner table which is not in the same schema as the sequence '%1'! - 表与序列 '%1' 不在同一模式中! - - - Assignment of owner table which does not belong to the same owner of the sequence '%1'! - 表与序列 '%1' 的所有者不同! - - - Assignment of a nonexistent owner column to the sequence '%1'! - 序列 '%1' 的列不存在! - - - Assignment of an owner column to the sequence '%1' that is not related to any table! - 序列 '%1' 的列未关联到任何表! - - - Reference to a label which index is out of labels list capacity! - 引用的标签不在标签列表的范围内! - Allocation of object with invalid type! 不能创建类型无效的对象! - - Assignment of a function with invalid return type to object '%1' (%2)! - 对象 '%1'(%2) 函数的返回类型无效! - - - Assignment of a function with invalid parameter(s) type(s) to object '%1' (%2)! - 对象 '%1'(%2) 函数的参数类型无效! - Assignment of not allocated language! 没有指定语言! @@ -3596,18 +3328,10 @@ Ref. column(s): %2 Reference to data type with an index outside the capacity of data types list! 引用的数据类型不在数据类型列表的范围内! - - Assignment of a null type to to object '%1' (%2)! - 对象 '%1'(%2) 类型不能为空! - Assignment of invalid type to the object! 对象的类型无效! - - Assignment of an empty directory to object '%1' (%2)! - 对象 '%1'(%2) 的目录不能为空! - Obtaining types with invalid quantity! 正确获取的类型的数量无效! @@ -3628,69 +3352,21 @@ Ref. column(s): %2 Insertion of invalid item in the enumerations list of the type! 插入类型枚举列表的项目无效! - - Reference to an attribute which index is out of the attributes list capacity! - 引用的属性超出属性列表的范围! - - - Reference to an enumeration which index is out of the enumerations list capacity! - 引用的枚举值超出枚举值列表的范围! - Assignment of invalid configuration to the type! 类型的配置无效! - The data type '%1' can not be assigned because it already exists in the types list of the aggregate function '%2'! - 无法指派数据类型 '%1',因其已存在于聚合函数 '%2' 的类型列表! + Assignment of an invalid strategy/support number to an operator class element! + 操作符类元素的策略/支持值无效! - Assignment of an operator which input type count is invalid to aggregate function! - 聚合函数的操作符输入类型的数目无效! + Insertion of element which already exists in the element list! + 插入的元素已存在于元素列表! - Assigment of an operator which types of arguments is invalid! - 操作符的参数类型无效! - - - Assignment of system reserved name to the object '%1' (%2)! - 对象 '%1'(%2) 使用了系统保留名称! - - - One function with invalid configuration is been used by the object '%1' (%2)! - 用于对象 '%1'(%2) 的函数的配置无效! - - - Assignment of invalid id to the user! - 无效的用户ID! - - - Assignment of an invalid strategy/support number to an operator class element! - 操作符类元素的策略/支持值无效! - - - Insertion of element which already exists in the element list! - 插入的元素已存在于元素列表! - - - Reference to an element which index is out of element list capacity! - 引用的元素不在元素列表的范围内! - - - Reference to an object which index is out of object list capacity! - 引用的对象不在对象列表的范围内! - - - Removal of an object not allocated! - 不能移除未分配的对象! - - - The object '%1' (%2) can not be removed because it is being referenced by object '%3' (%4)! - 无法移除对象 '%1'(%2),因其被对象 '%3'(%4) 引用了! - - - The object '%1' (%2) can not be removed because it is being referenced by object '%3' (%4) that belongs to '%5' (%6)! - 无法移除对象 '%1'(%2),因其已被对象 '%5'(%6) 中的对象 '%3'(%4) 引用了! + Removal of an object not allocated! + 不能移除未分配的对象! Operation with object(s) which type(s) is invalid! @@ -3704,10 +3380,6 @@ Ref. column(s): %2 Operation with object not allocated! 无法操作未分配的对象! - - The creation of the relationship '%1' between the table '%2' and '%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! - 无法创建关系 '%1',因为表 '%2' 或表 '%3' 缺少主键。如果创建的是 N-N 关系,则两个表都必须有主键! - The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user! 强制执行两表 1-1 关系的功能尚未实现,因为它结合模型中由用户定义的两人互相分离的表! @@ -3720,30 +3392,10 @@ Ref. column(s): %2 Assignment of a primary key to a table which already has one! 表的主键已存在! - - Identifier relationship can not be created for a self relationship, relationships of the type n-n, dependency or generalization! - 不能给自引用关系,N-N 类型关系,依赖关系或泛化关系创建标识符关系! - - - Unable to create a dependency relationship because the column '%1' in table '%2' already exists in table '%3'! - 无法创建依赖关系,因为表 '%2'中的列 '%1' 已经存在于表 '%3'! - - - Unable to create the generalization relationship because the column '%1' in table '%2' can not be merged with the column '%3' of table '%4' because they have incompatible types! - 无法创建泛化关系,因为表 '%2' 中的列 '%1' 不能被合并到表 '%4' 中的列 '%3',因为他们的类型不兼容! - - - An attribute can not be added to a dependence or generalization relationship! - 属性无法添加到依赖关系或者泛化关系中! - A foreign key can not be added to a relationship because is created automatically when this is connected! 无法给关系添加外键,因为在连接时已经自动添加了! - - The object '%1' (%2) is referencing the object '%3' (%4) which was not found in the list of objects of the same type in the model! - 对象 '%1'(%2) 所引用的对象 '%3'(%4) 不存在于模型中同类型的对象列表! - Reference to an user-defined data type that not exists in the model! 引用的用户自定义类型不存在于模型! @@ -3752,166 +3404,30 @@ Ref. column(s): %2 Assignment of invalid maximum size to operation list! 操作列表的最大值无效! - - Unable to write the file %1! Make sure the directory exists, or if the user has access permissions on it! - 无法写入文件 %1!请确保该目录存在,或者检查用户是否具有访问权限! - - - Unable to write the model in the file %1 due to one or more errors in the definition generation process! - 无法保存模式到文件 %1,因为在定义生成过程中出现一个或多个错误! - - - There is already a relationship between '%1' (%2) and '%3' (%4) in the model! - 模型中已存在 '%1'(%2) 和 '%3'(%4) 的关系! - - - The configuration of the relationship '%1' generates a redundancy between the relationships '%2'. Redundancy on identifier or generalization/dependency relationships are not accepted since they result in incorrect column spreading making the model inconsistent! - 关系 “%1”的配置产生了一个在关系'%2' 中的冗余。标识符或者泛化 / 依赖关系不支持冗余,因为他们会生成错误的列从而导致模型错误! - One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! 一个或者多个对象无效,并自动删除了。因为他们引用的表列所在的关系已经不存在了,由于连接中断或者排除生成的列! - - The primary key '%1' can only be allocated if declared within a block of code that defines a table or relationship! - 主键 '%1' 只有在表或关系定义的代码块中声明之后才可以被分配! - Reference to an invalid privilege type! 引用了无效的权限类型! - - Insertion of an role which already exists in the role list of the permission! - 插入的角色已存在于权限角色列表! - Assignment of privilege incompatible with the type of object referenced by permission! 权限与被允许引用的对象的类型不一致! - - There is already a permission on object '%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! - 对象 '%1'(%2) 已经有一个权限,分配给此对象权限的角色中有一个或多个功能相当的角色! - - - A permission is referencing the object '%1' (%2) which was not found in the model! - 权限所引用的对象 '%1'(%2) 不存在模型中! - - - The object '%1' (%2) can not be created by not being assigned to any schema! - 无法创建对象 '%1'(%2),因为还没有给它指定模式! - - - The tablespace '%1' can not be inserted into the model because it points to the same directory as the tablespace '%2'! - 表空间 '%1' 无法被加到模型中。因为它指向的目录和表空间 '%2' 的相同! - It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature! 无法创建维数 > = 1域或序列数组!PostgreSQL 尚未实现此功能! - - The function '%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! - 函数 '%1' 无法获取定义的源代码,因为它的语言被设成了 C 语言。请使用属性号和动态库代替! - - - The function '%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! - 函数 '%1'只有当语言被设置成 C 语言时,才需要属性符号和动态库配置。其他情况下,您必须在 DBMS 中定义它的源代码! - - - The operator '%1' can not be assigned as a comutator of operator '%2' because it has incompatible settings! - 操作符 '%1' 不能被设置成操作符 '%2' 的转接器,因为两者的设置不兼容! - - - The operator '%1' can not be assigned as negator of operator '%2' because it has incompatible settings! - 操作符 '%1' 不能被设置成操作符 '%2' 的否定操作符,因为两者的设置不兼容! - - - The type '%1' can not self refer in the attributes 'element' or 'copy type' or be used as a data type of an attribute in the configuration of a composite type! - 类型 '%1' 不能对'元素’或'复制类型'进行自引用,或被用作组合类型配置中属性的数据类型! - - - Assignment of invalid element to type '%1'! - 指派给类型 '%1' 的元素无效! - - - Assignment of invalid alignment to type '%1'! - 指派了无效的对齐给类型 ‘%1'! - Assignment of invalid name to the table generated from N-N relationship! 分配无效名称给由 N-N 关系生成的表! - - The relationship '%1' can not make use of the special primary key. Only generalization/dependency relationships have access to this resource! - 关系 '%1' 无法使用特殊主键。只有泛化 / 依赖关系才能! - - - Assignment of invalid suffix to the relationship '%1'! - 分配无效前缀给关系 '%1'! - - - The object '%1' (%2) can not be edited or deleted because it was automatically included through a relationship! To manipulate the object is necessary to make it from the edit form of the relationship that holds it. - 无法修改或删除对象 '%1'(%2),因为它已经被关系自动包含了!要修改对象请到对应的关系修改窗口中操作。 - - - The object '%1' (%2) can not be deleted because it is protected! - 无法删除对象 '%1'(%2),因为它是被保护的! - - - The group '%1' has already been declared earlier! - 组 '%1'已经声明过了! - - - The group '%1' can not be built in the groups declaration block ('%2')! - 组 '%1'无法在组声明区域 (%2) 中构建! - - - The group '%1' was built but not declared in the groups declaration block ('%2')! - 组 '%1'已被构建,但是不是在组声明区域 (%2) 中声明的! - - - The group '%1' can not be built without possessing child elements! - 无法构建组 '%1',因为没有子元素! - - - The group '%1' can not be built once more because this was done in previous blocks! - 无法重新构建组 '%1',因为之前已经做过了! - - - The group '%1' has been declared but not built! - 组 '%1' 已经声明,但是没构建! - - - Reference to a column of objects table with invalid index! - 请参考索引无效的对象表中的一列! - - - Reference to a row of objects table with invalid index! - 请参考索引无效的对象表中的一行! - - - The schema public and the languages plpgsql, c and sql can not be manipulated because they are reserved to PostgreSQL! They are present in the model database only as a reference! - 模式 public 和语言 plpgsql,C,SQL 都无法修改,因为它们是系统保留的!它们在模型数据库中只是一个参考! - - - The new configuration function invalidates the object '%1' (%2)! In this case it is needed to undo the relationship between the affected object and function so that the new configuration of the latter to take effect! - 新的配置函数使对象 '%1'(%2) 无效!在这种情况下,需要重新配置下对象与函数的关系,然后,新的配置就会起作用了! - - - A vision reference must have at least one SQL application : SELECT, FROM, FROM-WHERE or After WHERE! - 一个视图引用必须至少有一个 SQL 应用:SELECT,FROM,FROM-WHERE 或者 WHERE 后! - Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns! 主键,外键,唯一键等约束必须有至少一列来关联他们!对于外键约束引用列必须被选中! - - Unable to load one or more configuration files! Please check if files exists in the configuration folder and if they are not corrupted to preventing this error to occur again on the next startup! - 无法载入一个或多少配置文件!请检查文件是否存在配置目录中或者文件错误来防止错误继续在下一次启动中发生! - - - Could not find the default settings file '%1'! To restore default settings check the existence of the file and try again! - 没有发现默认的配置文件 '%1'!重新保存默认设置到文件中! - The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack! @@ -3924,42 +3440,14 @@ Ref. column(s): %2 %1 - - Could not load the plugin '%1' from the library '%2'! Message returned by plugin manager: '%3' - 无法从库 '%2' 中加载插件 '%1'!插件管理器的返回信息:'%3' - One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details. 插件加载发生错误,一个或多个插件没有激活!详情请查看异常信息。 - - Invalid syntax in file %1, line %2, column %3! - 错误语法位于文件 %1,行 %2,列 %3 有! - - - Invalid conditional instruction '%1' on file %2, line %3, column %4! - 错误的条件结构 '%1' 位于文件 %2,行 %3,列 %4! - - - Unknown attribute '%1' in file %2, line %3, column %4! - 未知属性 '%1' 位于文件 %2,行 %3,列 %4! - - - Invalid metacharacter '%1' in file %2, line %3, column %4! - 错误的字符 '%1' 位于文件 %2,行 %3,列 %4! - - - Attribute '%1' with an undefined value in file %2, line %3, column %4! - 未赋值的属性 '%1' 位于文件 %2,行 %3,列 %4! - Assignment of empty XML buffer to parser! 分配空白 XML 缓存给解析器! - - Could not access the file or directory %1! Make sure that it exists or if the user has access permissions on it! - 无法访问文件或目录 %1!请确保它存在,或者检查用户具有访问权限! - Assignment of empty DTD file name! 分配一个空 DTD 文件名! @@ -3968,19 +3456,10 @@ Ref. column(s): %2 Assignment of empty name to the DTD declaration! 分配空白名称给 DTD 声明! - - Error while interpreting XML buffer at line %1 column %2. -Message generated by the parser: '%3'. %4 - 解析 XML 缓存发生错误,错误位于行 %1 列 %2。解析器生成的消息:'%3'。%4 - Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated! 操作在未分配的元素树上!必须要先载入 XML 解析器缓存并执行解析,这样树才能生成! - - Could not load file %1. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! - 无法载入文件 %1。它出现了不一致性或其中有的依赖项出现错误或已经丢失! - Operation with unallocated tree element! 操作在未分配的树元素上! @@ -4001,12 +3480,6 @@ Message generated by the parser: '%3'. %4 Attempt to connect without define configuration parameters! 尝试没有定义配置参数的连接! - - Could not connect to the database. -Message returned: '%1' - 无法连接数据库。 -返回的信息:'%1' - Assignment of not allocated SQL command result! 指定的 SQL 命令结果不存在! @@ -4015,15 +3488,6 @@ Message returned: '%1' Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client! 无法获得 SQL 命令结果,因为服务器端的反馈客户端无法识别! - - Unable to allocate command result for the SQL because the server has generated a fatal error! -Message returned by the DBMS: %1 - 无法获取 SQL 的命令结果,因为服务端产生了严重错误!数据库服务器返回的信息:%1 - - - Unable to allocate the result of the SQL command because the command passed was an empty SQL! - 无法获取 SQL 命令的结果,因为命令是一条空 SQL! - Reference to a column of tuple with invalid index! 引用的一列元组索引无效! @@ -4032,16 +3496,6 @@ Message returned by the DBMS: %1 Reference to a column of tuple with invalid name! 引用的一列元组名字无效! - - Reference to a tuple with index invalid or the result is empty (no tuples)! - 引用的元组索引无效或者结果为空(没有)! - - - Could not execute the SQL command. - Message returned: %1 - 无法执行 SQL 命令。 -返回的信息: %1 - Assignment of a not allocated column to object `%1' (%2)! @@ -4266,10 +3720,6 @@ Message returned by the DBMS: %1 Unable to write the file `%1' due to one or more errors in the definition generation process! - - There is already a relationship between `%1' (%2) and `%3' (%4) in the model! - - The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent! @@ -4390,30 +3840,6 @@ Message returned by the DBMS: %1 Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3' - - Invalid instruction `%1' on file %2, line %3, column %4! - - - - Unknown attribute `%1' in file %2, line %3, column %4! - - - - Invalid metacharacter `%1' in file %2, line %3, column %4! - - - - Invalid operator `%1' in comparison expression, file %2, line %3, column %4! - - - - Attribute `%1' with an undefined value in file %2, line %3, column %4! - - - - Attribute `%1' with an invalid name in file %2, line %3, column %4! - - Error while interpreting XML buffer at line %1 column %2. Message generated by the parser: %3. %4 @@ -4526,10 +3952,6 @@ Message returned by the DBMS: `%1' The operator class assigned to the object `%1' (%2) must use `btree' as indexing method! - - Unsupported PostgreSQL version (%1) detected! Valid versions are: %2 - - The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack! @@ -4574,10 +3996,6 @@ Message returned by the DBMS: `%1' The widget already has a parent and cannot be assigned to a different object! - - The object `%1' (%2) could not be imported due to one or more errors! Check the exception stack for more details. - - Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case. @@ -4658,24 +4076,77 @@ Message returned by the DBMS: `%1' The connection was unexpectedly closed by the database server `%1' at port `%2'! - - - ExportHelper - Creating object '%1' (%2)... - 正在创建对象 '%1' (%2)... + There is already a relationship between `%1' (%2) and `%3' (%4) in the model! When using relationships of the type generalization, copy and one-to-one there can't be other relationships linked to the pair of tables. + + + + Unable to load the configuration file `%1'! Please check if file exists in its folder and/or if it is not corrupted! + + + + Invalid syntax in file `%1', line %2, column %3! + + + + Invalid instruction `%1' on file `%2', line %3, column %4! + + + + Unknown attribute `%1' in file `%2', line %3, column %4! + + + + Invalid metacharacter `%1' in file `%2', line %3, column %4! + + + + Invalid operator `%1' in comparison expression, file `%2', line %3, column %4! + + + + Attribute `%1' with an undefined value in file `%2', line %3, column %4! + + + + Attribute `%1' with an invalid name in file `%2', line %3, column %4! + + + + Could not access the file or directory `%1'! Make sure that it exists or if the user has access permissions on it! + + + + Could not load file `%1'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! + + + + Unsupported PostgreSQL version (%1) detected! Valid versions are between %2 and %3. + + + + The object `%1' (%2), oid `%3', could not be imported due to one or more errors! Check the exception stack for more details. `HINT:' if the object somehow references objects in `pg_catalog' or `information_schema' consider enable the importing of system objects. + + + + Failed to drop the database `%1' because it is defined as the default database for the connection `%2'! + + + + The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it! + - Creating database '%1'... - 正在创建数据库 '%1'... + The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'. + - Connecting to database '%1'... - 正在连接数据库 '%1'... + Reference to an invalid affected command in policy `%1'! + - Creating objects on database '%1'... - 正在对数据库 '%1' 创建对象... + Reference to an invalid special role in policy `%1'! + @@ -4763,6 +4234,14 @@ Message returned by the DBMS: `%1' Whole words + + Hide this widget + + + + ... + + FunctionWidget @@ -4770,18 +4249,10 @@ Message returned by the DBMS: `%1' Attributes 属性 - - Langague: - 语言: - Function Type: 函数类型: - - Window Function: - 窗口函数: - Execution Cost: 执行开销: @@ -4802,18 +4273,10 @@ Message returned by the DBMS: `%1' Return Method: 返回方法: - - Simple - 简单 - Set - - Table - - Parameters 参数 @@ -4854,18 +4317,10 @@ Message returned by the DBMS: `%1' Default Value 默认值 - - Form - Form - Return Table 返回表 - - IN/OUT - IN/OUT - Si&mple @@ -4886,41 +4341,17 @@ Message returned by the DBMS: `%1' Mode + + Language: + + GeneralConfigWidget - - Grid size: - 网格大小: - Operation history: 操作记录: - - items - - - - Autosave interval: - 自动保存的时间间隔: - - - minute(s) - 分钟 - - - Save widgets position - 保存部件位置 - - - Save current session - 保存当前会话 - - - Printing Options: - 打印选项: - Print grid 打印网格 @@ -4933,10 +4364,6 @@ Message returned by the DBMS: `%1' Paper: 纸型: - - Custom (Based on margins) - 定制 (基于边框) - Orientation: 方向: @@ -4949,10 +4376,6 @@ Message returned by the DBMS: `%1' Landscape 横向 - - Margins: - 边距: - Milimeters 毫米 @@ -4993,10 +4416,6 @@ Message returned by the DBMS: `%1' Form Form - - pixels - 像素 - A0 (841 x 1189 mm) A0 (841 x 1189 mm) @@ -5137,18 +4556,10 @@ Message returned by the DBMS: `%1' General 常规 - - The opened models will be saved periodically - - Check if there is a new version on server - - Check for updates at startup - - Design @@ -5177,14 +4588,6 @@ Message returned by the DBMS: `%1' Move canvas by keep mouse on corners - - By default panning mode is triggered with left click and range selection with Shift + left click. - - - - Swap panning and range selection triggers - - Graphical objects (table, views and textboxes) will be created in a single step without the need to click on canvas @@ -5325,118 +4728,146 @@ Message returned by the DBMS: `%1' The little brown fox jumps over the lazy dog - - - GraphicalView - Connected rels: %1 + Minimum object opacity (%): - - - HintTextWidget - Form - Form + Defines the minimum opacity percentage applied to the objects when using the fade out feature. A zero opacity causes the object to be completely hidden not being possible to interact with it in the canvas area. + - - - IndexWidget - Indexing Type: - 索引类型: + Canvas grid size: + - Fill Factor: - 填充因子: + Defines the vertical and horizontal grid size. This value affects the spacing of objects when using object grid alignment feature. + - Options: - 选项: + By default the range selection is triggered with Shift + left click. By checking this option range selection will be activated only with a single click and move. + - Concurrent - 并发 + Trigger range selection with a single click + - Check duplicates - 检查重复 + Defines the maximum amount of elements held in the operation history. Once reached the maximum number the history is automatically cleaned. + - Fast update - 快速更新 + Defines the period when the opened models will be saved automatically. + - Conditional Expr.: - 条件表达式: + Autosave interval (minutes): + - Elements - 元素 + Replaces any straight line in relationship by curved ones in order to improve the model's visualization. + - Column: - 列: + Use curved lines for relationships + - Expression: - 表达式: + Souce code editor args: + - Operator Class: - 操作符类: + lines + - Sorting: - 正在排序: + Clear the entire SQL comand history. + - Ascending - 升序 + Clear history + - Descending - 降序 + Open in file manager + 在文件管理器中打开 - Nulls first - Null 值优先 + Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. + - Type - 类型 + SQL history max. length: + - Operator Class - 操作符类 + Check updates at startup + - Sorting - 排序 + User interface language: + + + + Browse the source code editor application + + + + Souce code editor: + + + + Configurations directory: + + + + System default + + + + All files (*.*) + + + + Load file + + + + + GenericSQLWidget + + SQL code + + + + HintTextWidget Form - Form + Form + + + IndexWidget - Element - 元素 + Fill Factor: + 填充因子: - Nulls First - Null 值优先 + Options: + 选项: - Expressão - 表达式 + Concurrent + 并发 - Sim - + Fast update + 快速更新 - Não - + Elements + 元素 Attributes @@ -5465,26 +4896,10 @@ Message returned by the DBMS: `%1' Trusted: 可信: - - Handler Function: - 处理函数: - - - Validator Function: - 验证函数: - - - Inline Function: - 内联函数: - The functions to be assigned to the language should have, respectively, the following signatures:<br/><br/> <strong>Handler Function:</strong> <em>language_handler function()</em><br/> <strong>Validator Function:</strong> <em>void function(oid)</em><br/> <strong>Inline Function:</strong> <em>void function(internal)</em> 语言处理函数的签名分别为:<br/><br/> <strong>处理函数:</strong> <em>language_handler function()</em><br/> <strong>验证函数:</strong> <em>void function(oid)</em><br/> <strong>内联函数:</strong> <em>void function(internal)</em> - - Form - Form - Validator Func.: @@ -5508,134 +4923,30 @@ Message returned by the DBMS: `%1' &Edit 编辑(&E) - - &Help - 帮助(&H) - &Show 视图(&S) - - &Tools - 工具(&T) - - - &Plugins - 插件(&P) - - - File - 文件 - - - Edit - 编辑 - - - Help - 帮助 - - - Show - 显示 - New 新建 - - Save - 保存 - Zoom - 缩小 - - Load - 打开 - - - Next - 下一个 - - - Previous - 上一个 - - - Exit - 退出 - - - About pgModeler - 关于 pgModeler - - - Print - 打印 - - - Undo - 撤销 - - - Redo - 重做 - - - Export - 导出 - Show grid 显示网格 - - Align to grid - 对齐到网格 - - - Fullscreen - 全屏 - - - Show the model on fullscreen mode - 在全屏模式下显示模型 - Show the page delimiters 显示分页符 - - Configurations - 配置 - - - Save all models - 保存全部模型 - - - Some models were modified! Do you want to save them before finish the pgModeler? - 模型已被修改!你要在关闭 pgModeler 之前保存它们吗? - Save '%1' as... 保存 '%1' 为... - - Print grid - 打印网格 - - - Print page numbers - 打印页码 - - - Model Options - 模型选项 - Confirmation 确认 @@ -5644,10 +4955,6 @@ Message returned by the DBMS: `%1' Load model 打开模型 - - Overview - 概览 - Show the model overview 显示模型概览 @@ -5688,14 +4995,6 @@ Message returned by the DBMS: `%1' Ctrl+O Ctrl+O - - Save as - 另存为 - - - F2 - F2 - Ctrl+P Ctrl+P @@ -5712,14 +5011,6 @@ Message returned by the DBMS: `%1' Ctrl+G Ctrl+G - - Close model - 关闭模型 - - - Normal zoom - 正常比例 - Ctrl+0 Ctrl+0 @@ -5728,22 +5019,10 @@ Message returned by the DBMS: `%1' Align objects position to grid 对齐对象到网格 - - F11 - F11 - - - Show delimiters - 显示分页符 - Ctrl+L Ctrl+L - - Widgets - 部件 - Save all 保存全部 @@ -5756,18 +5035,6 @@ Message returned by the DBMS: `%1' Changes were detected in the definitions of paper/margin of the model which may cause the incorrect print of the objects. Do you want to continue printing using the new settings? To use the default settings click 'No' or 'Cancel' to abort printing. 模型的纸型/页边距已改变,这可能导致对象打印出错。要使用新的设置继续打印吗?要使用默认设置,请单击“否”或“取消”中止打印。 - - Tools - 工具 - - - View - 视图 - - - Model - 模型 - Database model (*.dbm);;All files (*.*) 数据库模型 (*.dbm);; 所有文件 (*.*) @@ -5776,18 +5043,10 @@ Message returned by the DBMS: `%1' Save model 保存模型 - - The model were modified! Do you want to save it before close? - 模型已被修改!要在关闭前保存吗? - Ctrl+Q - - F3 - F3 - Ctrl+Shift+S @@ -6088,10 +5347,6 @@ Message returned by the DBMS: `%1' &Diff - - Determine the changes between model and database - - Ctrl+Shift+D @@ -6256,64 +5511,33 @@ Message returned by the DBMS: `%1' Executing pending <strong>%1</strong> operation... - - - MessageBox - - Show/hide exceptions stack. - 显示/隐藏异常堆栈。 - - - &Yes - 是(&Y) - - - &No - 否(&N) - - - Cancel - 取消 - - - Error - 错误 - - - Alert - 警告 - - - Information - 信息 - - &Cancel - 取消(&C) + Determine the changes between model/database and another database + - Dialog - Dialog + Arrange objects + - ... - ...... + Rearrange objects over the canvas + - msg - 信息 + Grid + - &Ok - 确定(&O) + Hierarchical + - Exceptions - 异常 + Scattered + - Show excpetion stack in text format (useful to report errors). - 以文本形式显示异常堆栈(有助于报告错误)。 + Rearrange objects over the canvas is an irreversible operation! Would like to proceed? + @@ -6462,138 +5686,150 @@ Message returned by the DBMS: `%1' - Save textboxes to the output file when extracting metadata. When loading the file textboxes are recreated and duplicated ones are ignored. + Textbox objects - Textbox objects + Tag objects - Save tags to the output file when extracting metadata. When loading the file tags are recreated and duplicated ones are ignored. + Backup file: - Tag objects + Select file - Backup file: + ... - Select file + Apply to: - ... + Operation: - Apply to: + Output - Operation: + Progress label... + 处理标签... + + + model not saved yet - Extracts the objects metadata from one of the loaded models and apply to the current model. + The backup file cannot be the same as the input model! - Extract from a &model + Extracting metadata to file `%1' - Reads the objects metadata from a previously saved backup file and apply to the current model. + Saving backup metadata to file `%1' - Restore a bac&kup file + Applying metadata from file `%1' - Output + Metadata processing aborted! - Progress label... - 处理标签... + Objects metadata file (*.omf);;All files (*.*) + - model not saved yet + Handles the objects' fade out status in the metadata file. - The backup file cannot be the same as the input model! + Objects' fade out status - Extracting metadata to file `%1' + Save tags to the output file when extracting metadata. When loading the file, the tags are recreated and duplicated ones are ignored. - Saving backup metadata to file `%1' + Save textboxes to the output file when extracting metadata. When loading the file, the textboxes are recreated and duplicated ones are ignored. - Applying metadata from file `%1' + Handles the tables' and views' extended attributes display status in the metadata file. - Metadata processing aborted! + Tables' extended attributes display - Objects metadata file (*.omf);;All files (*.*) + Save generic SQL objects to the output file when extracting metadata. When loading the file, the objects are recreated and duplicated ones are ignored. - - - ModelDatabaseDiffForm - Database model diff + Generic SQL objects - Generate diff from model + Extracts the objects' metadata from the loaded models and apply to the current focused model. A backup file can be specified to where the focused model's current metadata will be saved. - Settings + &Extract and restore - Input database + Extracts the objects metadata from one of the loaded models saving the info to a backup file. - Connection: - 连接: + Extract &only + - Database: + Reads the objects' metadata from a previously saved backup file and apply to the current model. - Options + &Restore a backup file + + + ModelDatabaseDiffForm - Ignores as many as possible errors on import step. This option generates an incomplete diff. + Settings - Ignore import errors + Connection: + 连接: + + + Database: - Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. + Ignores as many as possible errors on import step. This option generates an incomplete diff. + + + + Ignore import errors - Trucate tables before alter columns + Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. @@ -6784,14 +6020,6 @@ Message returned by the DBMS: `%1' Waiting process to start... - - Importing database <strong>%1</strong>... - - - - Comparing the model <strong>%1</strong> and database <strong>%2</strong>... - - Confirmation 确认 @@ -6808,10 +6036,6 @@ Message returned by the DBMS: `%1' Preview diff - - Exporting diff to database <strong>%1</strong>... - - Diff process paused. Waiting user action... @@ -6858,136 +6082,136 @@ Message returned by the DBMS: `%1' SQL code (*.sql);;All files (*.*) SQL 代码 (*.sql);;所有文件 (*.*) - - - ModelExportForm - Model Export - 导出模型 + Diff tool + - Select the export type: - 选择导出类型: + Generate diff code + - File: - 文件: + Source database + - Select target file - 选择目标文件 + Current model: + - PostgreSQL version in which the SQL code should be generated - 生成 SQL 代码的 PostgreSQL 版本 + (model) + - Check if the system user has write permission on target folder. - 检查系统用户是否具有目标文件夹的写权限。 + Compare to + - Options: - 选项: + Diff + - Show grid - 显示网格 + Froce the generation of DROP commands for columns and constraints that exist in database but not in the model. This is useful when diff a partial model against the complete database and the user needs to drop columns and constraint but preserve the rest of the objects. + - Ignore object duplicity - 忽略重复对象 + Drop missing columns and constraints + - The pgModeler ignores errors generated by duplicate objects and creates only model objects that do not exist in the database. This option may be used when an object was created after a later model export. - pgModeler 忽略重复对象的错误,并只会创建数据库中不存在的模型对象。此选项可用在模型导出以后才创建的对象。 + Truncate tables before alter columns + - Export to DBMS: - 导出到数据库系统: + Import && Export + - Connection: - 连接: + Import + - It is recommended to select this option only when the version of the DBMS, somehow, is not identifiable or if you need to generate a specific version of SQL code for testing. - 当无法确定数据库系统的版本或想生成用于测试的特定版本 SQL 代码时,建议选择此项。 + Export + 导出 - &Export - 导出(&E) + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. + - &Close - 关闭(&C) + Ignore error codes + - Generating source code... - 正在生成源代码... + model not saved yet + - Initializing model export... - 正在初始化模型导出... + (none) + - Saving file '%1' - 正在保存文件 '%1' + Step %1/%2: Importing database <strong>%3</strong>... + - Creating object '%1' (%2)... - 正在创建对象 '%1' (%2)... + Step %1/%2: Comparing <strong>%3</strong> and <strong>%4</strong>... + - Creating database '%1'... - 正在创建数据库 '%1'... + Step %1/%2: Exporting diff to database <strong>%3</strong>... + + + + ModelExportForm - Connecting to database '%1'... - 正在连接数据库 '%1'... + File: + 文件: - Creating objects on database '%1'... - 正在对数据库 '%1' 创建对象... + Select target file + 选择目标文件 - Exporting process sucessfuly ended! - 成功导出! + PostgreSQL version in which the SQL code should be generated + 生成 SQL 代码的 PostgreSQL 版本 - Error on export! - 导出出错! + Show grid + 显示网格 - Export model as... - 导出模型为... + Ignore object duplicity + 忽略重复对象 - SQL code (*.sql);;All files (*.*) - SQL 代码 (*.sql);;所有文件 (*.*) + Connection: + 连接: - PNG image (*.png);;All files (*.*) - PNG 图像 (*.png);; 所有文件 (*.*) + &Export + 导出(&E) - Export to SQL file: - 导出到 SQL 文件: + &Close + 关闭(&C) - Export to PNG image: - 导出到 PNG 图像: + Initializing model export... + 正在初始化模型导出... - Image: - 图像: + Saving file '%1' + 正在保存文件 '%1' - Show the page delimiters - 显示分页符 + Exporting process sucessfuly ended! + 成功导出! - Check if the system user has write permission on image target folder. - 检查系统用户是否有图像目标文件夹的写权限。 + Export model as... + 导出模型为... ... @@ -7001,10 +6225,6 @@ Message returned by the DBMS: `%1' Progress label... 处理标签... - - ico - ico - Export model @@ -7049,10 +6269,6 @@ Message returned by the DBMS: `%1' Graphics file - - Image (PNG) - - Type: 类型: @@ -7061,10 +6277,6 @@ Message returned by the DBMS: `%1' Zoom: - - Vectorial (SVG) - - Show delimiters 显示分页符 @@ -7113,6 +6325,22 @@ Message returned by the DBMS: `%1' Exporting process canceled by user! + + This advanced option causes pgModeler to ignore extra errors by their numeric codes. These errors must be informed in the input below and separeted by space. For the complete list of error codes check the PostgreSQL docs, section <strong> Appendix A. PostgreSQL Error Codes</strong>. <strong>WARNING:</strong> use this option with extreme care since it can interfere in final export result. + + + + Ignore error codes + + + + I&mage (PNG) + + + + &Vectorial (SVG) + + ModelExportHelper @@ -7377,10 +6605,6 @@ p, li { white-space: pre-wrap; } Parent Type 父类型 - - Visible Object Types - - Select All 选择全部 @@ -7449,6 +6673,14 @@ p, li { white-space: pre-wrap; } By ID + + Visible object types + + + + Model objects + + ModelOverviewWidget @@ -7456,17 +6688,14 @@ p, li { white-space: pre-wrap; } Model overview 模型概览 + + Failed to generate the overview image. +The requested size %1 x %2 was too big and there was not enough memory to allocate! + + ModelRestorationForm - - Modified: %1 - 修改:%1 - - - yyyy-MM-dd hh:mm:ss - yyyy-MM-dd hh:mm:ss - Model restoration 模型恢复 @@ -7479,10 +6708,6 @@ p, li { white-space: pre-wrap; } &Cancel 取消(&C) - - pgModeler was not closed properly in a previous execution and some models were still being edited. Click 'Restore' to reopen the models or 'Cancel' to abort the restoration. - pgModeler 在之前运行时没有正常关闭且部分模型还处于编辑状态。单击“恢复”重新打开模型或“取消”放弃恢复。 - pgModeler was not closed properly in a previous execution and some models were still being edited. Click <strong>Restore</strong> to reopen the models or <strong>Cancel</strong> to abort the restoration. @@ -7573,10 +6798,6 @@ p, li { white-space: pre-wrap; } Try to resolve the reported issues. - - Apply Fix - - Ctrl+S Ctrl+S @@ -7585,10 +6806,6 @@ p, li { white-space: pre-wrap; } Change the creation order for two objects by swapping their ids - - Swap Ids - - Va&lidate @@ -7685,17 +6902,25 @@ p, li { white-space: pre-wrap; } Processing object: %1 - - - ModelWidget - Generalization - 泛化 + Apply fixes + - <strong>CAUTION:</strong> The object model is protected! New objects will be inserted only when the protection is removed! - <STRONG>警告:</STRONG>对象模型处于受保护状态!只有在移除保护之后才可以插入对象! + Swap ids + + + + The column <strong>%1</strong> on <strong>%2</strong> <em>(%3)</em> is referencing the geospatial data type <strong>%4</strong> but the <strong>postgis</strong> extension is not present in the model! + + + <strong>HINT:</strong> Create the extension in the model or let it be created by applying the needed fixes. + + + + + ModelWidget Source code 源代码 @@ -7720,22 +6945,10 @@ p, li { white-space: pre-wrap; } Unprotect 取消保护 - - Pretects the object(s) against modifications - 添加修改保护 - - - Removes from the objetc(s) the protection against modifications - 移除修改保护 - Delete 删除 - - Delete the selected object(s) - 删除选中对象 - Select all 选择全部 @@ -7744,46 +6957,22 @@ p, li { white-space: pre-wrap; } Selects all the graphical objects in the model 选择模型中的全部图形对象 - - Converts the n-n relationship into table - 将 N-N 关系转换成表 - Copy 复制 - - Copy the selected objects(s) - 复制选中对象 - Paste 粘贴 - - Paste the previos copied object(s) - 粘贴已复制的对象 - Cut 剪切 - - Displays objects that reference and that are dependent of the selected object - 显示选中对象的引用对象和依赖对象 - - - New object - 新建对象 - Add a new object in the model 添加新对象到模型中 - - Quick actions - 快速操作 - Rename 重命名 @@ -7796,34 +6985,18 @@ p, li { white-space: pre-wrap; } Move to schema 移动到模式 - - Move the object to another schema - 将此对象移动到另一个模式 - Edit permissions 编辑权限 - - Edit object's permissions - 编辑对象的权限 - Change owner 变更所有者 - - Change object's owner - 变更对象的所有者 - Select children 选择子对象 - - Selects all the children graphical objects on the selected schema - 选择所选定模式的所有子图形对象 - Loading database model 正在载入数据库模型 @@ -7832,10 +7005,6 @@ p, li { white-space: pre-wrap; } Saving database model 正在保存数据库模型 - - Confirmation - 确认 - Also copy all dependencies of selected objects? This minimizes the breakdown of references when copied objects are pasted into another model. 同时复制选中对象的依赖对象吗?这会最大限度减小已复制对象被粘贴到其他模型时,发生引用失效的机会。 @@ -7857,80 +7026,32 @@ p, li { white-space: pre-wrap; } 约束 - Convert a relationship is an irreversible operation and causes the deletion of all operation history! Do you want to continue? - 转换关系是不可逆操作并会删除所有操作记录!要继续吗? + Protects object(s) from modifications + - Dependence - 依赖 + (no objects) + - Convert rel. n-n - 转换 N-N 关系 + One to One (1-1) + - Cut the selected object(s) - 剪切选中的对象 + One to Many (1-n) + - Depend. / Refer. - 依赖/引用 + Many to Many (n-n) + - Relationship - 关系 + Inheritance + - CAUTION: Remove multiple objects at once can cause irreversible invalidations to other objects in the model. Do you really want to delete ALL selected objects? - 注意:同时删除多个对象可能会造成模型中其他对象不可逆的失效。要删除所有选中的对象吗? - - - Validating object: %1 (%2) - 正在验证对象:%1 (%2) - - - Pasting object: %1 (%2) - 正在粘贴对象:%1 (%2) - - - Generating XML code of object: %1 (%2) - 正在生成对象 %1 (%2) 的 XML 代码 - - - Protects object(s) from modifications - - - - Dependencies - 依赖 - - - Highlight - - - - (no objects) - - - - One to One (1-1) - - - - One to Many (1-n) - - - - Many to Many (n-n) - - - - Inheritance - - - - <strong>ATTENTION:</strong> The database model is protected! Operations that could modify it are disabled! - + <strong>ATTENTION:</strong> The database model is protected! Operations that could modify it are disabled! + Source @@ -8104,6 +7225,94 @@ p, li { white-space: pre-wrap; } The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details. + + Edit data + + + + Select tagged + + + + Select + 选择 + + + Duplicate + + + + Ctrl+D + + + + Extended attributes + + + + Show + 显示 + + + Hide + + + + Jump to table + + + + Schemas rectangles + + + + Fade in/out + + + + Fade in + + + + Fade out + + + + Relationships + + + + Swap ids + + + + Edit the objects creation order by swapping their ids + + + + All objects + + + + Schemas + + + + Tables + + + + Views + + + + Textboxes + + + + None + + ModelsDiffHelper @@ -8394,6 +7603,18 @@ p, li { white-space: pre-wrap; } 0 0 + + Generic SQL + + + + Policy + + + + 8 + 8 + NumberedTextEditor @@ -8413,6 +7634,42 @@ p, li { white-space: pre-wrap; } Ident left + + Load + 打开 + + + Load the object's source code from an external file + + + + Edit + 编辑 + + + Edit the source code in the preferred external editor + + + + Clear + + + + SQL file (*.sql);;All files (*.*) + + + + Load file + + + + The source editor `%1' is running on `pid: %2'. + + + + Could not start the source code editor application `%1'! Make to sure that the source editor path defined in the general settings points to a valid executable and the current user has permission to run the application. Error message returned: `%2' + + ObjectDepsRefsWidget @@ -8440,14 +7697,6 @@ p, li { white-space: pre-wrap; } References 引用 - - Dependeces / References of Object - 对象的依赖/引用 - - - Form - Form - Object's dependencies & references @@ -8495,14 +7744,6 @@ p, li { white-space: pre-wrap; } Clear - - Highlight graphical objects when selecting them or their children on the result list - - - - Highlight - - ... @@ -8563,6 +7804,30 @@ p, li { white-space: pre-wrap; } No objects found. + + (Un)selects the graphical objects in the results grid + + + + Select + 选择 + + + Fades outs all the graphical objects in the results grid (or those not listed). The current fade in/out state of all objects is modified. + + + + Fade out + + + + Listed + + + + Not listed + + ObjectRenameWidget @@ -8607,110 +7872,106 @@ p, li { white-space: pre-wrap; } - ObjectTableWidget + ObjectsTableWidget - Add Item - 添加项目 - - - Remove Item - 移除项目 + Form + Form - Update Item - 更新项目 + Add Item + 添加项目 - Remove All - 删除全部 + Ins + Ins - Edit Item - 编辑项目 + Remove Item + 移除项目 - Move Up - 上移 + Del + Del - Move Down - 下移 + Update Item + 更新项目 - Move to start - 移至开头 + Alt+R + Alt+R - Move to end - 移至末尾 + Remove All + 删除全部 - Do you really want to remove the selected item? - 要移除选中的项目吗? + Shift+Del + Shift+Del - Do you really want to remove the all items? - 要移除全部项目吗? + Duplicate item + - Form - Form + Ctrl+D + - Ins - Ins + Edit Item + 编辑项目 - Del - Del + Space + Space - Alt+R - Alt+R + Move Up + 上移 - Shift+Del - Shift+Del + Ctrl+Up + Ctrl+Up - Space - Space + Move Down + 下移 - Ctrl+Up - Ctrl+Up + Ctrl+Down + Ctrl+Down - Ctrl+Down - Ctrl+Down + Move to start + 移至开头 Ctrl+Home - Ctrl+Home + Ctrl+Home - Ctrl+End, Ctrl+S - Ctrl+End, Ctrl+S + Move to end + 移至末尾 - Confirmação - 确认 + Ctrl+End, Ctrl+S + Ctrl+End, Ctrl+S Confirmation 确认 - - - OperationList - Undoing operation on object: %1 (%2) - 正在撤销对象操作: %1 (%2) + Do you really want to remove the selected item? + 要移除选中的项目吗? - Redoing operation on object:: %1 (%2) - 正在重做对象操作: %1 (%2) + Do you really want to remove all the items? + + + + OperationList (invalid object) @@ -8766,14 +8027,6 @@ p, li { white-space: pre-wrap; } Operation: %1 操作:%1 - - Undoing operations... - 正在撤销操作... - - - Redoing operations... - 正在重做操作... - Operation history exclusion 不显示操作记录 @@ -8817,10 +8070,6 @@ p, li { white-space: pre-wrap; } Elements 元素 - - Elemente Type: - 元素类型: - Operator 操作符 @@ -8845,14 +8094,6 @@ p, li { white-space: pre-wrap; } Support/Strategy: 支持/策略: - - Recheck - 重新检查 - - - Family: - 族: - Storage Type 存储类型 @@ -8870,24 +8111,12 @@ p, li { white-space: pre-wrap; } 支持/策略 - Yes - + Element Type: + - No - - - - Form - Form - - - Element Type: - - - - Op. Family: - + Op. Family: + Operator Family @@ -8900,10 +8129,6 @@ p, li { white-space: pre-wrap; } Indexing: 正在建立索引: - - Form - Form - OperatorWidget @@ -8915,46 +8140,6 @@ p, li { white-space: pre-wrap; } Arguments 参数 - - Functions - 函数 - - - Constraints: - 约束: - - - Operator: - 操作符: - - - Operators - 操作符 - - - Commutation: - 交换: - - - Negation: - 否定: - - - Sort (1): - 排序 (1): - - - Sort (2): - 排序 (2): - - - Less than: - 小于: - - - Greater then: - 大于: - Right Argument Type 右参数类型 @@ -8967,10 +8152,6 @@ p, li { white-space: pre-wrap; } To create a unary operator it is necessary to specify as <strong><em>'any'</em></strong> one of its arguments. Additionally, the function that defines the operator must have only one parameter and this, in turn, must have the same data type of the the argument of unary operator. 在创建单目操作符时必须指定它们参数中的<strong><em>任何</em></strong>一个。另外,作为操作符的函数必须有且只有一个参数,而且这个参数的类型必须与单目操作符参数的类型相同。 - - Form - Form - MERGES 融合连接 (MERGES) @@ -9014,10 +8195,6 @@ p, li { white-space: pre-wrap; } Mode: 模式: - - Form - Form - IN IN @@ -9053,18 +8230,6 @@ p, li { white-space: pre-wrap; } Add Permission 添加权限 - - Type: - 类型: - - - Role - 角色 - - - Form - Form - ID: ID: @@ -9093,10 +8258,6 @@ p, li { white-space: pre-wrap; } Cascade - - Leave the <em><strong>Roles</strong></em> empty to create a permission applicable to <strong><em>PUBLIC</em></strong>. - - Edit permissions 编辑权限 @@ -9121,6 +8282,14 @@ p, li { white-space: pre-wrap; } /* Could not generate the SQL code preview for permissions! + + Name + 名称 + + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + + PgModelerCLI @@ -9137,290 +8306,525 @@ p, li { white-space: pre-wrap; } - Connection aliased as '%1' was not found on configuration file. + Usage: pgmodeler-cli [OPTIONS] - Usage: pgmodeler-cli [OPTIONS] + command line interface. - command line interface. + DBMS export options: - PostgreSQL Database Modeler Project - pgmodeler.com.br + Input file must be different from output! - %1, %2 Export to a sql script file. + Incomplete connection information! - %1, %2 Export to a png image. + Starting model export... - %1, %2 Export directly to a PostgreSQL server. + General options: - %1, %2 Version of generated SQL code. Only for file or dbms export. + PNG and SVG export options: - %1, %2 Silent execution. Only critical errors are shown during process. + Miscellaneous options: - %1, %2 Show this help menu. + There are no connections configured. - %1, %2 Draws the grid on the exported png image. + Invalid zoom specified! - %1, %2 Draws the page delimiters on the exported png image. + Invalid action specified to update mime option! - DBMS export options: + Starting model fixing... + + + + Starting mime update... - %1, %2 Ignores errors related to duplicated objects that eventually exists on server side. + Model successfully fixed! - %1, %2=[ALIAS] Connection configuration alias to be used. + Extracting objects' XML... - %1, %2=[HOST] PostgreSQL host which export will operate. + Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! - %1, %2=[PORT] PostgreSQL host listening port. + Recreating objects... - %1, %2=[DBNAME] Connection's initial database. + +** Object(s) that couldn't fixed: - No export mode specified! + WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) - No input file specified! + Database model files (.dbm) are already associated to pgModeler! - No output file specified! + There is no file association related to pgModeler and .dbm files! - Input file must be different from output! + Mime database operation: %1 - Incomplete connection information! + Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. - Starting model export... + Running update-mime-database command... - Loading input file: + Connection aliased as '%1' was not found in the configuration file. - Export to PNG image: + PostgreSQL Database Modeler Project - pgmodeler.io - Export to SQL script file: + Copyright 2006-2018 Raphael A. Silva <raphael@pgmodeler.io> - Export to DBMS: + This CLI tool provides several operations over models and databases without the need to perform them +in pgModeler's graphical interface. All available options are described below. - Export successfully ended! + %1, %2 [FILE] Input model file (.dbm). This is mandatory for fix, export operations. - Copyright 2006-2015 Raphael A. Silva <raphael@pgmodeler.com.br> + %1, %2 [DBNAME] Input database name. This is mandatory for import operation. - This CLI tool provides the operations to export pgModeler's database models without - the need to load them on graphical interface as well to fix model files to the most recent - accepted structure. All available options are described below. + %1, %2 [FILE] Output file. This is mandatory for fixing model or exporting to file, png or svg. - General options: + %1, %2 Try to fix the structure of the input model file in order to make it loadable again. - %1, %2=[FILE] Input model file (.dbm). Mandatory use when fixing a model or exporting it. + %1, %2 [NUMBER] Model fix tries. When reaching the maximum count the invalid objects will be discarded. - %1, %2=[FILE] Output file. Mandatory use when fixing model or export to file or png. + %1, %2 Export the input model to a sql script file. - %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + %1, %2 Export the input model to a png image. - %1, %2 Model fix tries. When reaching the maximum count the invalid objects will be discard. + %1, %2 Export the input model to a svg file. - %1, %2 Export to a svg file. + %1, %2 Export the input model directly to a PostgreSQL server. - %1, %2 List available connections on %3 file. + %1, %2 Import a database to an output file. - PNG and SVG export options: + %1, %2 Compares a model and a database or two databases generating the SQL script to synch the latter in relation to the first. - %1, %2 Each page will be exported on a separated png image. (Only for PNG) + %1, %2 Force the PostgreSQL version of generated SQL code. - %1, %2=[FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG) + %1, %2 Silent execution. Only critical messages and errors are shown during process. - %1, %2 Drop the database before execute a export process. + %1, %2 Show this help menu. - %1, %2 Runs the DROP commands attached to SQL-enabled objects. + Connection options: - %1, %2 Simulates a export process. Actually executes all steps but undoing any modification. + %1, %2 List available connections in file %3. - %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + %1, %2 [ALIAS] Connection configuration alias to be used. - %1, %2=[USER] PostgreSQL username. + %1, %2 [HOST] PostgreSQL host in which a task will operate. - %1, %2=[PASSWORD] PostgreSQL user password. + %1, %2 [PORT] PostgreSQL host listening port. - Miscellaneous options: + %1, %2 [USER] PostgreSQL username. - %1, %2=[ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + %1, %2 [PASSWORD] PostgreSQL user password. - There are no connections configured. + %1, %2 [DBNAME] Connection's initial database. - Available connections (alias : conn. string) + %1, %2 Draws the grid in the exported image. - Export, fix model and update mime operations can't be used at the same time! + %1, %2 Draws the page delimiters in the exported image. - Multiple export mode specified! + %1, %2 Each page will be exported in a separated png image. (Only for PNG images) - Invalid zoom specified! + %1, %2 [FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images) - Invalid action specified to update mime option! + %1, %2 Ignores errors related to duplicated objects that eventually exist in the server. - Starting model fixing... + %1, %2 [CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided. - Starting mime update... + %1, %2 Drop the database before execute a export process. - Fixed model file: + %1, %2 Runs the DROP commands attached to SQL-enabled objects. - Model successfully fixed! + %1, %2 Simulates an export process by executing all steps but undoing any modification in the end. - Mime database successfully updated. + %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. - Export to SVG file: + Database import options: - Extracting objects' XML... + %1, %2 Ignore all errors and try to create as many as possible objects. - Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! + %1, %2 Import system built-in objects. This option causes the model bloating due to the importing of unneeded objects. - Recreating objects... + %1, %2 Import extension objects. This option causes the model bloating due to the importing of unneeded objects. - -** Object(s) that couldn't fixed: + %1, %2 Run import in debug mode printing all queries executed in the server. - WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) + Diff options: - Database model files (.dbm) are already associated to pgModeler! + %1, %2 [DBNAME] The database used in the comparison. All the SQL code generated is applied to it. - There is no file association related to pgModeler and .dbm files! + %1, %2 Save the generated diff code to output file. - Mime database operation: %1 + %1, %2 Apply the generated diff code on the database server. - Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. + %1, %2 Don't preview the generated diff code when applying it to the server. - Running update-mime-database command... + %1, %2 Drop cluster level objects like roles and tablespaces. + + + + %1, %2 Revoke permissions already set on the database. New permissions configured in the input model are still applied. + + + + %1, %2 Drop missing objects. Generates DROP commands for objects that are present in the input model but not in the compared database. + + + + %1, %2 Force the drop of missing columns and constraints. Causes only columns and constraints to be dropped, other missing objects aren't removed. + + + + %1, %2 Rename the destination database when the names of the involved databases are different. + + + + %1, %2 Don't drop or truncate objects in cascade mode. + + + + %1, %2 Truncate tables prior to alter columns. Avoids errors related to type casting when the new type of a column isn't compatible to the old one. + + + + %1, %2 Don't reuse sequences on serial columns. Drop the old sequence assigned to a serial column and creates a new one. + + + + %1, %2 Don't force the recreation of objects. Avoids the usage of a DROP and CREATE commands to create a new version of the objects. + + + + %1, %2 Don't recreate the unmodifiable objects. These objects are the ones which can't be changed via ALTER command. + + + + %1, %2 [ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + + + + ** The diff process allows the usage of the following options related to import and export operations: + + + + * Export: + + + + * Import: + + + + ** When running the diff using two databases (%1 and %2) there's the need to specify two connections/aliases. + + + + If only one connection is set it will be used to import the input database as well to retrieve database used in the comparison. + + + + A second connection can be specified by appending a 1 on any connection configuration parameter listed above. + + + + Available connections (alias : connection string) + + + + No operation mode was specified! + + + + Export, fix model, import database, diff and update mime operations can't be used at the same time! + + + + Multiple export mode was specified! + + + + No input file was specified! + + + + No input database was specified! + + + + No output file was specified! + + + + No input file or database was specified! + + + + The input file and database can't be used at the same time! + + + + No database to be compared was specified! + + + + No diff action (save or apply) was specified! + + + + No output file for the diff code was specified! + + + + ** Error code `%1' found and ignored. Proceeding with export. + + + + ** Command: %1 + + + + Loading input file: %1 + + + + Fixed model file: %1 + + + + Export to PNG image: %1 + + + + Export to SVG file: %1 + + + + Export to SQL script file: %1 + + + + Export to DBMS: %1 + + + + Export successfully ended! + + + + + Starting database import... + + + + Input database: %1 + + + + Saving the imported database to file... + + + + Import successfully ended! + + + + + Starting diff process... + + + + Input model: %1 + + + + Compare to: %1 + + + + Loading input model... + + + + Importing the database `%1'... + + + + Comparing the generated models... + + + + No differences were detected. + + + + Saving diff to file `%1' + + + + ** WARNING: You are about to apply the generated diff code to the server. Data can be lost in the process! + + + + ** Proceed with the diff applying? (yes/no) > + + + + yes + + + + no + + + + Diff code not applied to the server. + + + + Applying diff to the database `%1'... + + + + Diff successfully ended! + + + + + Mime database successfully updated! + @@ -9547,10 +8951,6 @@ p, li { white-space: pre-wrap; } Loaded plug-ins 已加载的插件 - - <html><head/><body><p>Details about plugins development and installation can be found at <a href="http://www.pgmodeler.com.br/wiki/doku.php?id=plugins"><span style=" text-decoration: underline; color:#0057ae;">pgModeler Wiki</span></a>. <span style=" font-weight:600;">Note:</span> plugin installation requires pgModeler to be restarted.</p></body></html> - <html><head/><body><p>关于插件开发和安装的详细信息可以在<a href="http://www.pgmodeler.com.br/wiki/doku.php?id=plugins"><span style=" text-decoration: underline; color:#0057ae;">pgModeler Wiki</span></a>中找到。 <span style=" font-weight:600;">注意:</span> 安装插件需要重启pgModeler。 - Plugin 插件 @@ -9564,6 +8964,45 @@ p, li { white-space: pre-wrap; } 动态链接库 + + PolicyWidget + + Basics + + + + Command: + + + + Permissive + + + + Roles + 角色 + + + Expressions + + + + USING: + + + + CHECK: + + + + Name + 名称 + + + Leave the <em><strong>Roles</strong></em> grid empty in order to create a %1 applicable to <strong><em>PUBLIC</em></strong>. + + + QObject @@ -9575,21 +9014,6 @@ p, li { white-space: pre-wrap; } %1 (行:%2) - - QuickRenameWidget - - Form - Form - - - Rename - 重命名 - - - Cancel - 取消 - - Relationship @@ -9623,18 +9047,10 @@ p, li { white-space: pre-wrap; } Connection Mode - - This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. - - Connect FK to PK columns - - This mode is the classical one. It connects the relationship to tables through their central points. - - Connect tables' center points @@ -9747,6 +9163,30 @@ p, li { white-space: pre-wrap; } Default 默认 + + This mode renders the relationships in crow's foot notation which has a better semantics and readability. It also determines the optimal point where the relationship is connected on the tables' edges taking their position into account. + + + + Crow's foot notation + + + + This mode determines the optimal point where the relationship is connected on the tables' edges taking their position into account. It implies the usage of the classical ER notation. + + + + Connect tables' edges + + + + This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. It implies the usage of the classical ER notation. + + + + This mode is the classical one. It connects the relationship to tables through their central points. It implies the usage of the classical ER notation. + + RelationshipWidget @@ -9754,10 +9194,6 @@ p, li { white-space: pre-wrap; } General 常规 - - Relationship: - 关系: - One to one relationship 一对一关系 @@ -9774,46 +9210,18 @@ p, li { white-space: pre-wrap; } Generalization relationship (inheritance) 泛化关系 (继承) - - Dependency relationship - 依赖关系 - Identifier 标识符 - - Source Table: - 原始表: - - - Target Table: - 目标表: - Cardinality: 基数: - - Source Required - 原始对象是必须的 - - - Target Required - 目标对象是必须的 - Name of the table generated from many to many relationship 多对多关系生成表的名称 - - Table Name: - 表名称: - - - Foreign key - 外键 - Deferrable: 可延迟: @@ -9846,26 +9254,6 @@ p, li { white-space: pre-wrap; } Constraint 约束 - - Editing attributes of an existing relationship is allowed, but must be done carefully because it may break references to columns and cause invalidation of objects such as triggers, indexes, constraints and sequences. - 编辑现有关系的属性是允许的,但必须小心,因为此操作会导致无效的对象 (如触发器,索引,约束和序列),进而破坏引用列。 - - - Use the special primary key if you want to include a primary key containing inherited / copied columns to the receiving table. This is a feature available only for generalization / dependency relationships. - 如果你想在受方表中包含一个带有继承/复制列的主键,请使用特殊主键。此特性仅适用于泛化/依赖关系。 - - - Automatic Suffix - 自动补充后缀 - - - Form - Form - - - 1-1 - 1-1 - 1-n 1-N @@ -9874,22 +9262,10 @@ p, li { white-space: pre-wrap; } n-n N-N - - gen - gen - dep dep - - Source Suffix: - 原始后缀: - - - Target Suffix: - 目标后缀: - Dependency / Copy relationship @@ -10143,16 +9519,19 @@ p, li { white-space: pre-wrap; } + + ResultSetModel + + [binary data] + + + RoleWidget Password: 密码: - - Validity: - 合法性: - Connections: 连接: @@ -10165,26 +9544,6 @@ p, li { white-space: pre-wrap; } Superuser 超级用户 - - Inherit Permissions - 继承权限 - - - Create Database - 创建数据库 - - - Can Login - 允许登录 - - - Create Users/Groups - 创建用户/组 - - - Encrypted Password - 加密密码 - Members 成员 @@ -10202,47 +9561,43 @@ p, li { white-space: pre-wrap; } 成员(管理员) - Form - Form - - - SysID: - SysID: + Member of + 成员 - yyyy-MMM-dd hh:mm - yyyy-MMM-dd hh:mm + Encrypted + - Member of - 成员 + yyyy-MMM-dd hh:mm:ss + - SysID - SysID + Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. + - Can create Database + Inherit permissions - Can create Role + Can create database - Can use Replication + Bypass RLS - Encrypted + Can use replication - yyyy-MMM-dd hh:mm:ss + Can login - Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. + Can create role @@ -10260,10 +9615,6 @@ p, li { white-space: pre-wrap; } Conditional Expr.: 条件表达式: - - Executed Commands - 执行的命令 - SQL Command: SQL 命令: @@ -10272,10 +9623,6 @@ p, li { white-space: pre-wrap; } To create a rule that does not perform any action (<strong>DO NOTHING</strong>) simply do not specify commands in the SQL commands table. 创建一个不执行任何操作的规则(<STRONG>DO NOTHING</STRONG>)简单点说,就是 SQL 命令表中没有的命令。 - - Form - Form - SQL command SQL 命令 @@ -10291,30 +9638,14 @@ p, li { white-space: pre-wrap; } Form Form - - Load SQL script - - - - &Load - - Save SQL commands - - &Save - - Search in SQL code - - &Find - - Alt+F @@ -10399,10 +9730,6 @@ p, li { white-space: pre-wrap; } Results (%1) - - [%1]: SQL command successfully executed. <em>%2 <strong>%3</strong></em> - - Rows affected @@ -10435,6 +9762,90 @@ p, li { white-space: pre-wrap; } Clear history + + Close the current SQL script + + + + SQL script currently handled + + + + (not saved) + + + + Handle external SQL script + + + + &Script + + + + Fi&nd + + + + Alt+T + + + + Alt+X + + + + Current working database + + + + Load + 打开 + + + Save + 保存 + + + Save as + 另存为 + + + [%1]: SQL command successfully executed in <em><strong>%2</strong></em>. <em>%3 <strong>%4</strong></em> + + + + Plain format + + + + CVS format + + + + This action will wipe out all the SQL commands history for all connections! Do you really want to proceed? + + + + Save history + + + + Reload history + + + + Find in history + + + + Hide find tool + + + + This action will wipe out all the SQL commands history for the current connection! Do you really want to proceed? + + SQLToolWidget @@ -10490,21 +9901,48 @@ p, li { white-space: pre-wrap; } <strong>ATTENTION:</strong> Disconnect from all databases will close any opened tab in this view! Do you really want to proceed? + + + SceneInfoWidget + + Form + Form + + + Current position of the mouse in the canvas + + - <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? + - - You're running a demonstration version! The data manipulation feature is available only in the full version! + Current zoom factor + + + + Currently selected object(s) + + + + Dimensions of the selected object(s) + + + + No selection + + + + N/A + + + + Sel. objects: %1 SchemaWidget - - Form - Form - Show rectangle @@ -10541,15 +9979,15 @@ p, li { white-space: pre-wrap; } 缓存: - Owner: - 所有者: + Owner Col.: + - Form - Form + Defualt values: + - Owner Col.: + User defined @@ -10688,10 +10126,6 @@ p, li { white-space: pre-wrap; } Version: 版本: - - Type: - 类型: - Source code visualization 查看源代码 @@ -10704,10 +10138,6 @@ p, li { white-space: pre-wrap; } -- SQL code unavailable for this type of object -- -- 无法生成此对象类型的 SQL 代码 -- - - Form - Form - PostgreSQL PostgreSQL @@ -10800,20 +10230,52 @@ p, li { white-space: pre-wrap; } ID: - Before: + Before: + + + + Swap the values of the fields + + + + Swap values + + + + Change the objects creation order is an irreversible operation and cause the operations history to be automatically erased. Note that the creation order configured in this form is not definitive and may change after a model validation. + + + + Swap the object ids changing their creation order + + + + Swap ids + + + + Filter: + + + + ID - It's recommended to use this feature only when the SQL validation fails in cases when a object is being referenced in portions where the ordinary validation couldn't reach, e.g., inside of a rule command or check constraint expression. - + Object + 对象 - Swap the values of the fields - + Type + 类型 - Swap values - + Parent Object + 父对象 + + + Parent Type + 父类型 @@ -10837,18 +10299,10 @@ p, li { white-space: pre-wrap; } Add empty rows - - Add - 新建 - Ins Ins - - Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. - - Add an empty column @@ -10857,10 +10311,6 @@ p, li { white-space: pre-wrap; } Remove all rows from the grid preserving columns - - Clear - - Shift+Del Shift+Del @@ -10869,26 +10319,14 @@ p, li { white-space: pre-wrap; } Delete the selected rows - - Delete - 删除 - Del Del - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> - - Duplicate the selected rows - - Duplicate - - Ctrl+D @@ -10926,59 +10364,88 @@ p, li { white-space: pre-wrap; } - (no columns) + Copy items on the grid - - - TableObjectView - -Relationship: %1 + Copy + 复制 + + + Add row - - - TableView - Connected rels: %1 + Delete column - - - TableWidget - Columns - + Paste items on the grid + - Constraints - 约束 + Paste + 粘贴 - Triggers - 触发器 + Ctrl+V + - Rules - 规则 + Fills the grid using a CSV file + - Indexes - 索引 + <html><head/><body><p>Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely ignored when generating the <span style=" font-weight:600;">INSERT</span> commands.</p></body></html> + - Tables - + Add column + + + + Duplicate rows + + + + Change the values of all selected cells at once + + + + Bulk data edit + + + + Ctrl+E + - Ancestor Tables: - 祖先表: + Delete all columns + + + + Delete rows + + + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + + + + Delete all rows + + + + TableObjectView - Copied Tables: - 复制的表: + +Relationship: %1 + + + + TableWidget Name 名称 @@ -11011,18 +10478,6 @@ Relationship: %1 Indexing 索引 - - Form - Form - - - With OIDs: - 接受 OIDs: - - - Attribute - 属性 - ON DELETE ON DELETE @@ -11099,6 +10554,62 @@ Relationship: %1 Define initial data for the table + + Enable row level security + + + + Force RLS for owner + + + + &Policies + + + + PK + + + + Attribute(s) + + + + It is not possible to mark a column as primary key when the table already has a primary key which was created by a relationship! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. + + + + It is not possible to mark a column created by a relationship as primary key! This action should be done in the section <strong>Primary key</strong> of the relationship's editing form. + + + + Command + + + + Permissive + + + + USING expression + + + + CHECK expression + + + + Roles + 角色 + + + Yes + + + + No + + TablespaceWidget @@ -11140,10 +10651,6 @@ Relationship: %1 TaskProgressWidget - - Loading object: [object] (type) - 载入对象:[对象] (类型) - Executing tasks 正在执行的任务 @@ -11167,10 +10674,6 @@ Relationship: %1 Select text color 选择文本颜色 - - Form - Form - Underline 下划线 @@ -11194,14 +10697,6 @@ Relationship: %1 TriggerWidget - - Triggering Mode: - 触发器模式: - - - Execute per row - 逐行执行 - Event: 事件: @@ -11210,18 +10705,6 @@ Relationship: %1 Deferrable: 可延迟: - - Deferral: - 延迟: - - - Referenced Table: - 引用表: - - - Conditional Expr.: - 条件表达式: - Columns @@ -11250,14 +10733,6 @@ Relationship: %1 Type 类型 - - Form - Form - - - INSTEAD OF - INSTEAD OF - INSERT INSERT @@ -11274,10 +10749,6 @@ Relationship: %1 TRUNCATE TRUNCATE - - Constraint Trigger: - 约束触发器: - Constraint 约束 @@ -11317,10 +10788,6 @@ Relationship: %1 Enumeration 枚举 - - Composite - 组合 - Enumerations 枚举 @@ -11341,18 +10808,10 @@ Relationship: %1 Storage: 存储: - - By Value: - 按值: - Category: 类别: - - Preferred: - 首选: - Delimiter: 分隔符: @@ -11369,10 +10828,6 @@ Relationship: %1 Functions 函数 - - Copy Type - 复制类型 - Element Type 元素类型 @@ -11385,10 +10840,6 @@ Relationship: %1 Type 类型 - - Form - Form - char char @@ -11552,22 +11003,10 @@ Relationship: %1 Get source code - - Recover a package - - - - Purchase a new package - - Failed to check updates - - The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <strong>%1</strong>. - - No updates found @@ -11580,6 +11019,10 @@ Relationship: %1 The update notifier failed to check for new versions! A HTTP status code was returned: <strong>%1</strong> + + The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <em>%1</em> - <strong>%2</strong>. + + ViewWidget @@ -11587,10 +11030,6 @@ Relationship: %1 References 引用 - - Type: - 类型: - Column @@ -11603,10 +11042,6 @@ Relationship: %1 Used in: 被用在: - - After WHERE - WHERE 之后 - Table: 表: @@ -11635,26 +11070,6 @@ Relationship: %1 Code Preview 代码预览 - - To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[tablel].*</strong></em> - 要引用表中全部列 (*) 保留空的 <strong>Column</strong> 字段即可,这等同于 <em><strong>[schema].[tablel].*</strong></em> - - - -- Could not generate the code. Make sure all attributes are correctly filled! -- - -- 无法生成代码。请确认已正确填写全部属性! -- - - - Form - Form - - - SELECT-FROM - SELECT-FROM - - - FROM-WHERE - FROM-WHERE - Col./Expr. 列/表达式 @@ -11667,10 +11082,6 @@ Relationship: %1 Alias Col. 列别名 - - SF FW AW - SF FW AW - Reference Type: @@ -11691,10 +11102,6 @@ Relationship: %1 Table Expression - - Flags: SF FW AW VD - - Name 名称 @@ -11751,68 +11158,57 @@ Relationship: %1 With no data - - - VisaoObjetosWidget - - Objects of Model - 模型中的对象 - - - Visible Objects Type - 可见对象类型 - - Select All - 选择全部 + The element will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns + - Clear All - 取消全部 + SELECT ... + - Select - 选择 + The element will be used as part of the WHERE clause in form of conditional expression + - Cancel - 取消 + WHERE ... + - Objects view configuration - 对象视图配置 + The element is used in the FROM portion of the command in order to reference tables or construct JOIN statements + - Tree view - 树视图 + FROM ... + - List view - 列表视图 + The element's expression is used exclusively as the view's definition + - 1 - 1 + The element will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements + - ... - ... + End expression + - Object - 对象 + Indexes + 索引 - Type - 类型 + Flags: SF FW AW EX VD + - Parent Object - 父对象 + To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[table].*</strong></em> + - Parent Type - 父类型 + Indexing + 索引 From 3b8e1aa302c5dd92eecfbed3ffdc1370858317ab Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 28 May 2018 10:15:59 -0300 Subject: [PATCH 043/425] Minor adjustment on constraints rendering at extended attributes section of tables. --- libobjrenderer/src/tableobjectview.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 383a499a82..fff435ef9b 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -368,6 +368,10 @@ void TableObjectView::configureObject(void) str_constr = TXT_UNIQUE; else if(type == ConstraintType::exclude) str_constr = TXT_EXCLUDE; + else if(type == ConstraintType::check) + str_constr = TXT_CHECK; + + atribs_tip = (~type).toLower(); } if(!str_constr.isEmpty()) From 6a0bf2605b87bc021b54c09cccba92dccd9b294b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 28 May 2018 11:48:54 -0300 Subject: [PATCH 044/425] Fixed a crash when trying to remove an fk relationship when it was created from a foreign key which references protected columns (added by relationship) --- libpgmodeler/src/databasemodel.cpp | 25 ++++++++++++- libpgmodeler_ui/src/constraintwidget.cpp | 3 -- libpgmodeler_ui/src/modelwidget.cpp | 43 +++------------------- libpgmodeler_ui/src/relationshipwidget.cpp | 8 +++- 4 files changed, 37 insertions(+), 42 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 6647d3dd16..2583a5df82 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1707,7 +1707,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) Reference ref; ObjectType tab_obj_type[3]={ OBJ_CONSTRAINT, OBJ_TRIGGER, OBJ_INDEX }; bool found=false; - vector objects, rem_objects; + vector objects, rem_objects, upd_tables_rels; try { @@ -1765,9 +1765,15 @@ void DatabaseModel::storeSpecialObjectsXML(void) if(found) { + constr = dynamic_cast(tab_obj); + //When found the special object must be removed from the parent table table->removeObject(tab_obj->getName(), tab_obj->getObjectType()); + //We need to store the table which fk was referencing relationship added columns in order to update the fk relationships of that table + if(constr && constr->getConstraintType() == ConstraintType::foreign_key) + upd_tables_rels.push_back(table); + //Removes the permission from the table object removePermissions(tab_obj); @@ -1777,6 +1783,22 @@ void DatabaseModel::storeSpecialObjectsXML(void) } } + //Updating fk rels of tables which had fks referencing relationship added columns + if(!upd_tables_rels.empty()) + { + vector::iterator end; + + if(upd_tables_rels.size() > 1) + { + std::sort(upd_tables_rels.begin(), upd_tables_rels.end()); + end = std::unique(upd_tables_rels.begin(), upd_tables_rels.end()); + upd_tables_rels.erase(end, upd_tables_rels.end()); + } + + for(auto &tab : upd_tables_rels) + updateTableFKRelationships(dynamic_cast

(tab)); + } + //Making a copy of the sequences list to avoid iterator invalidation when removing an object rem_objects.assign(sequences.begin(), sequences.end()); itr=rem_objects.begin(); @@ -3064,6 +3086,7 @@ void DatabaseModel::loadModel(const QString &filename) { emit s_objectLoaded(100, trUtf8("Validating relationships..."), OBJ_RELATIONSHIP); validateRelationships(); + updateTablesFKRelationships(); } } catch(Exception &e) diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 4bb4eca7c1..6b8b06736b 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -309,9 +309,6 @@ void ConstraintWidget::selectConstraintType(void) no_inherit_lbl->setVisible(constr_type==ConstraintType::check); warn_frm->setVisible(constr_type==ConstraintType::check); - /*fill_factor_lbl->setVisible(constr_type==ConstraintType::unique || - constr_type==ConstraintType::primary_key || - constr_type==ConstraintType::exclude); */ fill_factor_chk->setVisible(constr_type==ConstraintType::unique || constr_type==ConstraintType::primary_key || constr_type==ConstraintType::exclude); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index c259e05cfa..2e0c399276 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2681,7 +2681,7 @@ void ModelWidget::removeObjects(bool cascade) ObjectType obj_type=BASE_OBJECT, parent_type=BASE_OBJECT; BaseObject *object=nullptr, *aux_obj=nullptr; vector sel_objs, aux_sel_objs; - vector constrs; + map> objs_map; map>::reverse_iterator ritr, ritr_end; QAction *obj_sender=dynamic_cast(sender()); @@ -2782,37 +2782,6 @@ void ModelWidget::removeObjects(bool cascade) //If the object is as FK relationship remove the foreign keys that generates it if(obj_type==BASE_RELATIONSHIP) { - /*rel=dynamic_cast(object); - if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) - { - aux_table=dynamic_cast
(rel->getTable(BaseRelationship::DST_TABLE)); - dynamic_cast
(rel->getTable(BaseRelationship::SRC_TABLE))->getForeignKeys(constrs,false, aux_table); - - if(!rel->isSelfRelationship()) - { - aux_table=dynamic_cast
(rel->getTable(BaseRelationship::SRC_TABLE)); - dynamic_cast
(rel->getTable(BaseRelationship::DST_TABLE))->getForeignKeys(constrs,false, aux_table); - } - - //Adds the fks to the map of objects to be removed - while(!constrs.empty()) - { - tab_obj=constrs.back(); - obj_id=tab_obj->getObjectId(); - - if(objs_map.count(obj_id)==0) - { - objs_map[tab_obj->getObjectId()]=std::make_tuple(tab_obj, - tab_obj->getName(true), - tab_obj->getObjectType(), - tab_obj->getParentTable()->getName(true), - tab_obj->getParentTable()->getObjectType()); - - } - constrs.pop_back(); - } - }*/ - rel = dynamic_cast(object); if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) @@ -2826,7 +2795,7 @@ void ModelWidget::removeObjects(bool cascade) tab_obj->getName(true), tab_obj->getObjectType(), tab_obj->getParentTable()->getName(true), - tab_obj->getParentTable()->getObjectType()); + OBJ_TABLE); } } @@ -2840,10 +2809,10 @@ void ModelWidget::removeObjects(bool cascade) parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : OBJ_DATABASE); objs_map[object->getObjectId()]=std::make_tuple(object, - obj_name, - obj_type, - parent_name, - parent_type); + obj_name, + obj_type, + parent_name, + parent_type); } } diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 478dd38fa2..3eb0bf9445 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -668,8 +668,14 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) { BaseForm editing_form(this); WidgetClass *object_wgt=new WidgetClass; + BaseObject *parent_aux = nullptr; - object_wgt->setAttributes(this->model, this->op_list, (!parent ? this->object : parent), dynamic_cast(object)); + if(this->object->getObjectType() == BASE_RELATIONSHIP) + parent_aux = dynamic_cast(this->object)->getTable(BaseRelationship::SRC_TABLE); + else + parent_aux = !parent ? this->object : parent; + + object_wgt->setAttributes(this->model, this->op_list, parent_aux, dynamic_cast(object)); editing_form.setMainWidget(object_wgt); return(editing_form.exec()); From 0e383fd6ebb7d0754c80ae96dec07b78760ca553 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 29 May 2018 19:33:52 -0300 Subject: [PATCH 045/425] Start to adding support to logical view (representation) of the model where graphical objects can have a more friendly name for a compact view as well for those who don't need to see details about tables (clients of the business, for instance) --- libobjrenderer/src/baseobjectview.cpp | 6 + libobjrenderer/src/baseobjectview.h | 7 + libobjrenderer/src/basetableview.cpp | 6 +- libobjrenderer/src/graphicalview.cpp | 4 +- libobjrenderer/src/relationshipview.cpp | 18 ++- libobjrenderer/src/schemaview.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 19 ++- libobjrenderer/src/tabletitleview.cpp | 9 +- libobjrenderer/src/tableview.cpp | 4 +- libparsers/src/parsersattributes.cpp | 1 + libparsers/src/parsersattributes.h | 1 + libpgmodeler/src/baseobject.cpp | 36 ++++- libpgmodeler/src/baseobject.h | 15 ++ libpgmodeler/src/column.cpp | 1 + libpgmodeler/src/databasemodel.cpp | 8 +- libpgmodeler/src/permission.cpp | 6 +- libpgmodeler/src/permission.h | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 30 +++- libpgmodeler_ui/src/baseobjectwidget.h | 3 + libpgmodeler_ui/src/databaseimporthelper.cpp | 2 +- libpgmodeler_ui/src/mainwindow.cpp | 20 ++- libpgmodeler_ui/src/mainwindow.h | 1 + libpgmodeler_ui/src/modelobjectswidget.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 2 +- libpgmodeler_ui/src/permissionwidget.cpp | 2 +- libpgmodeler_ui/ui/baseobjectwidget.ui | 155 ++++++++++++++++++- libpgmodeler_ui/ui/mainwindow.ui | 38 ++++- schemas/xml/column.sch | 4 + schemas/xml/constraint.sch | 4 + schemas/xml/dtd/column.dtd | 1 + schemas/xml/dtd/constraint.dtd | 1 + schemas/xml/dtd/index.dtd | 1 + schemas/xml/dtd/policy.dtd | 1 + schemas/xml/dtd/relationship.dtd | 1 + schemas/xml/dtd/rule.dtd | 1 + schemas/xml/dtd/schema.dtd | 1 + schemas/xml/dtd/table.dtd | 1 + schemas/xml/dtd/trigger.dtd | 1 + schemas/xml/dtd/view.dtd | 1 + schemas/xml/index.sch | 6 +- schemas/xml/policy.sch | 4 + schemas/xml/relationship.sch | 4 + schemas/xml/rule.sch | 4 + schemas/xml/schema.sch | 4 + schemas/xml/table.sch | 5 + schemas/xml/trigger.sch | 5 + schemas/xml/view.sch | 4 + 47 files changed, 409 insertions(+), 45 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 1a21cd06a7..15b6d3cbf5 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -24,6 +24,7 @@ map BaseObjectView::font_config; map> BaseObjectView::color_config; unsigned BaseObjectView::global_sel_order=1; bool BaseObjectView::use_placeholder=true; +bool BaseObjectView::logical_view=false; BaseObjectView::BaseObjectView(BaseObject *object) { @@ -397,6 +398,11 @@ bool BaseObjectView::isPlaceholderEnabled(void) return(use_placeholder); } +void BaseObjectView::setLogicalViewMode(bool value) +{ + logical_view = value; +} + QVariant BaseObjectView::itemChange(GraphicsItemChange change, const QVariant &value) { if(change==ItemPositionHasChanged) diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 5a7aba7614..72767fb825 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -46,6 +46,11 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { is incremented each time an object is selected. */ static unsigned global_sel_order; + /*! \brief Stores the current status for object's logical view display. + * In logical view the logical name of object's are shown. Also, data types and constraint descriptors are hidden, + * as well the table's extended area are collapsed by default */ + static bool logical_view; + /*! \brief Stores the selection order of the current object. This attribute is used to know when an item was selected before another in the scene because the implementation of the method QGraphicsScene :: selectedItem() the selected objects are returned without @@ -153,6 +158,8 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { static bool isPlaceholderEnabled(void); + static void setLogicalViewMode(bool value); + //! \brief Sets the font style for the specified element id static void setFontStyle(const QString &id, QTextCharFormat font_fmt); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 362d3f76f2..86a0829b07 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -351,7 +351,7 @@ void BaseTableView::__configureObject(float width) { BaseTable *tab = dynamic_cast(this->getSourceObject()); - if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs) + if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && !logical_view) { QPen pen = ext_attribs_body->pen(); float py = 0; @@ -454,11 +454,11 @@ float BaseTableView::calculateWidth(void) This width is used to set the uniform width of table */ if(!columns->childItems().isEmpty() && (columns->boundingRect().width() > title->boundingRect().width() && - (hide_ext_attribs || dynamic_cast(this->getSourceObject())->isExtAttribsHidden() || + (hide_ext_attribs || logical_view || dynamic_cast(this->getSourceObject())->isExtAttribsHidden() || (columns->boundingRect().width() > ext_attribs->boundingRect().width())))) return(columns->boundingRect().width() + (2 * HORIZ_SPACING)); - if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && + if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && !logical_view && !dynamic_cast(this->getSourceObject())->isExtAttribsHidden() && (ext_attribs->boundingRect().width() > title->boundingRect().width() && ext_attribs->boundingRect().width() > columns->boundingRect().width())) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index d1dccd5841..61e353aaa4 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -107,8 +107,8 @@ void GraphicalView::configureObject(void) view->getObjectList(OBJ_INDEX)->begin(), view->getObjectList(OBJ_INDEX)->end()); - ext_attribs->setVisible(!tab_objs.empty() && !hide_ext_attribs); - ext_attribs_body->setVisible(!tab_objs.empty() && !hide_ext_attribs); + ext_attribs->setVisible(!tab_objs.empty() && !hide_ext_attribs && !logical_view); + ext_attribs_body->setVisible(!tab_objs.empty() && !hide_ext_attribs && !logical_view); if(!tab_objs.empty()) { diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 56f02bc645..942cdc161b 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1750,7 +1750,7 @@ void RelationshipView::configureAttributes(void) attrib->setPos(px, py); - text->setText(col->getName()); + text->setText(logical_view && !col->getLogicalName().isEmpty() ? col->getLogicalName() : col->getName()); text->setPos(QPointF(desc->pos().x() + desc->boundingRect().width() + (HORIZ_SPACING * factor), 0)); desc->setPos(0, VERT_SPACING * factor); @@ -1803,6 +1803,22 @@ void RelationshipView::configureLabels(void) labels[BaseRelationship::REL_NAME_LABEL]->setVisible(!hide_name_label); configureLabelPosition(BaseRelationship::REL_NAME_LABEL, x, y); + if(!hide_name_label) + { + Textbox *txtbox = dynamic_cast(labels[BaseRelationship::REL_NAME_LABEL]->getSourceObject()); + + if(logical_view && !base_rel->getLogicalName().isEmpty()) + { + txtbox->setComment(base_rel->getLogicalName()); + txtbox->setModified(true); + } + else if(txtbox->getComment() != base_rel->getName(true)) + { + txtbox->setComment(base_rel->getName(true)); + txtbox->setModified(true); + } + } + //Hides the cardinality labels when crow's feet is enabled if(labels[BaseRelationship::SRC_CARD_LABEL] && labels[BaseRelationship::DST_CARD_LABEL]) { diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index cc065fcc35..b3b3712130 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -200,7 +200,7 @@ void SchemaView::configureObject(void) } //Configures the schema name at the top - sch_name->setText(schema->getName()); + sch_name->setText(logical_view && !schema->getLogicalName().isEmpty() ? schema->getLogicalName() : schema->getName()); font=BaseObjectView::getFontStyle(ParsersAttributes::GLOBAL).font(); font.setItalic(true); font.setBold(true); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index fff435ef9b..25d652eabc 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -266,8 +266,7 @@ void TableObjectView::configureObject(void) px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HORIZ_SPACING); //Configuring the labels as follow: [object name] [type] [constraints] - //Configuring tha name label - lables[0]->setText(tab_obj->getName()); + lables[0]->setText(logical_view && !tab_obj->getLogicalName().isEmpty() ? tab_obj->getLogicalName() : tab_obj->getName()); //Strikeout the column name when its SQL is disabled QFont font=fmt.font(); @@ -281,10 +280,16 @@ void TableObjectView::configureObject(void) //Configuring the type label fmt=font_config[ParsersAttributes::OBJECT_TYPE]; - if(column) - lables[1]->setText(TYPE_SEPARATOR + (*column->getType())); + + if(logical_view) + lables[1]->setText(" "); else - lables[1]->setText(TYPE_SEPARATOR + tab_obj->getSchemaName()); + { + if(column) + lables[1]->setText(TYPE_SEPARATOR + (*column->getType())); + else + lables[1]->setText(TYPE_SEPARATOR + tab_obj->getSchemaName()); + } lables[1]->setFont(fmt.font()); lables[1]->setBrush(fmt.foreground()); @@ -293,7 +298,9 @@ void TableObjectView::configureObject(void) //Configuring the constraints label fmt=font_config[ParsersAttributes::CONSTRAINTS]; - if(column) + if(logical_view) + lables[2]->setText(" "); + else if(column) lables[2]->setText(str_constr); else { diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index ed7e1c71dc..98c693e23e 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -89,13 +89,18 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(schema->isRectVisible()) schema_name->setText(QString(" ")); else - schema_name->setText(schema->getName() + QString(".")); + { + if(logical_view && !schema->getLogicalName().isEmpty()) + schema_name->setText(schema->getLogicalName() + QString(".")); + else + schema_name->setText(schema->getName() + QString(".")); + } fmt=font_config[name_attrib]; font=fmt.font(); obj_name->setFont(font); - obj_name->setText(object->getName()); + obj_name->setText(logical_view && !object->getLogicalName().isEmpty() ? object->getLogicalName() : object->getName()); if(!tag) { diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 8385f31e29..e66898c802 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -80,8 +80,8 @@ void TableView::configureObject(void) //Special case: if there is no item on extended attributes, the extended body is hidden if(obj_idx==1) { - groups[obj_idx]->setVisible(count > 0 && !hide_ext_attribs); - bodies[obj_idx]->setVisible(count > 0 && !hide_ext_attribs); + groups[obj_idx]->setVisible(count > 0 && !hide_ext_attribs && !logical_view); + bodies[obj_idx]->setVisible(count > 0 && !hide_ext_attribs && !logical_view); } for(i=0; i < count; i++) diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 4801c12cbe..2092a32c04 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -287,6 +287,7 @@ namespace ParsersAttributes { LOCALE=QString("locale"), LOCKER_ARC=QString("locker-arc"), LOCKER_BODY=QString("locker-body"), + LOGICAL_NAME=QString("logical-name"), LOGIN=QString("login"), LOOKAHEAD_CHAR=QString("lookahead-char"), MATERIALIZED=QString("materialized"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 75ca8c4f50..366139f604 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -302,6 +302,7 @@ namespace ParsersAttributes { LOCALE, LOCKER_ARC, LOCKER_BODY, + LOGICAL_NAME, LOGIN, LOOKAHEAD_CHAR, MATERIALIZED, diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 62b1aa10de..27d527f81b 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -83,6 +83,7 @@ BaseObject::BaseObject(void) database=nullptr; collation=nullptr; attributes[ParsersAttributes::NAME]=QString(); + attributes[ParsersAttributes::LOGICAL_NAME]=QString(); attributes[ParsersAttributes::COMMENT]=QString(); attributes[ParsersAttributes::OWNER]=QString(); attributes[ParsersAttributes::TABLESPACE]=QString(); @@ -360,6 +361,15 @@ void BaseObject::setName(const QString &name) this->obj_name=aux_name; } +void BaseObject::setLogicalName(const QString &name) +{ + if(name.size() > OBJECT_NAME_MAX_LENGTH) + throw Exception(ERR_ASG_LONG_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + this->logical_name = name; + setCodeInvalidated(this->logical_name != name); +} + void BaseObject::setComment(const QString &comment) { setCodeInvalidated(this->comment!=comment); @@ -449,10 +459,19 @@ bool BaseObject::acceptsAlterCommand(ObjectType obj_type) bool BaseObject::acceptsDropCommand(ObjectType obj_type) { return(obj_type!=OBJ_PERMISSION && obj_type!=OBJ_RELATIONSHIP && - obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_TYPE_ATTRIBUTE && - obj_type!=OBJ_PARAMETER && obj_type!=BASE_OBJECT && - obj_type!=OBJ_TAG && obj_type!=BASE_RELATIONSHIP && - obj_type!=BASE_TABLE); + obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_TYPE_ATTRIBUTE && + obj_type!=OBJ_PARAMETER && obj_type!=BASE_OBJECT && + obj_type!=OBJ_TAG && obj_type!=BASE_RELATIONSHIP && + obj_type!=BASE_TABLE); +} + +bool BaseObject::acceptsLogicalName(ObjectType obj_type) +{ + return(obj_type==OBJ_RELATIONSHIP || obj_type==BASE_RELATIONSHIP || + obj_type==OBJ_TABLE || obj_type==OBJ_SCHEMA || + obj_type == OBJ_COLUMN || obj_type == OBJ_CONSTRAINT || + obj_type == OBJ_INDEX || obj_type == OBJ_RULE || + obj_type == OBJ_TRIGGER || obj_type == OBJ_POLICY); } bool BaseObject::acceptsCustomSQL(void) @@ -556,6 +575,11 @@ QString BaseObject::getName(bool format, bool prepend_schema) return(this->obj_name); } +QString BaseObject::getLogicalName(void) +{ + return(this->logical_name); +} + QString BaseObject::getSignature(bool format) { return(this->getName(format, true)); @@ -653,6 +677,9 @@ void BaseObject::setBasicAttributes(bool format_name) if(attributes[ParsersAttributes::NAME].isEmpty()) attributes[ParsersAttributes::NAME]=this->getName(format_name); + if(attributes[ParsersAttributes::LOGICAL_NAME].isEmpty()) + attributes[ParsersAttributes::LOGICAL_NAME]=this->getLogicalName(); + if(attributes[ParsersAttributes::SIGNATURE].isEmpty()) attributes[ParsersAttributes::SIGNATURE]=this->getSignature(format_name); @@ -975,6 +1002,7 @@ void BaseObject::operator = (BaseObject &obj) this->database=obj.database; this->comment=obj.comment; this->obj_name=obj.obj_name; + this->logical_name=obj.logical_name; this->obj_type=obj.obj_type; this->is_protected=obj.is_protected; this->sql_disabled=obj.sql_disabled; diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 910fcde30e..0b656121e1 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -164,9 +164,13 @@ class BaseObject { //! \brief Comments related to object QString comment, + //! \brief Object's name (in PostgreSQL accepted format) obj_name, + //! \brief Object's logical (human readable) name + logical_name, + //! \brief The set of SQL commands appended on the objectc's definition appended_sql, @@ -277,6 +281,11 @@ class BaseObject { //! \brief Defines the objects name. If the passed name isn't valid it'll raise an error virtual void setName(const QString &name); + /*! \brief Defines the object's logical name. A logical name is used when the database model is being + * displayed in logical mode more user/client friendly. This method raises an error when the provided + * name is larger than 63 bytes (the same rule for PostgreSQL names length) */ + virtual void setLogicalName(const QString &name); + //! \brief Toggles the object's modify protection virtual void setProtected(bool value); @@ -319,6 +328,9 @@ class BaseObject { the parameter 'prepend_schema' includes the schema name on the objects name (defult) */ virtual QString getName(bool format=false, bool prepend_schema=true); + //! \brief Returns the object's logical (user friendly) name + virtual QString getLogicalName(void); + //! \brief Returns the name of the object with schema name (when available) prepended by default virtual QString getSignature(bool format=true); @@ -407,6 +419,9 @@ class BaseObject { //! \brief Returns if the specified type accepts the use of DROP commands static bool acceptsDropCommand(ObjectType obj_type); + //! \brief Returns if the specified type accepts a logical name + static bool acceptsLogicalName(ObjectType obj_type); + //! \brief Returns if the object accepts to have a schema assigned bool acceptsSchema(void); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index d85ff2e35c..596d69e91c 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -385,6 +385,7 @@ void Column::operator = (Column &col) this->is_protected=col.is_protected; this->obj_name=col.obj_name; + this->logical_name=col.logical_name; this->old_name=col.old_name; this->type=col.type; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 2583a5df82..a8c2ae217d 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -520,7 +520,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r if(obj_idx >= 0) { - if(Permission::objectAcceptsPermission(obj_type)) + if(Permission::acceptsPermission(obj_type)) removePermissions(object); obj_list->erase(obj_list->begin() + obj_idx); @@ -3195,9 +3195,13 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.getElementAttributes(attribs); obj_type_aux=object->getObjectType(); + if(obj_type_aux!=OBJ_CAST) object->setName(attribs[ParsersAttributes::NAME]); + if(BaseObject::acceptsLogicalName(obj_type_aux)) + object->setLogicalName(attribs[ParsersAttributes::LOGICAL_NAME]); + protected_obj=attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_; sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_; @@ -6114,6 +6118,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) base_rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_FK, tables[0], tables[1], false, false); base_rel->setName(attribs[ParsersAttributes::NAME]); + base_rel->setLogicalName(attribs[ParsersAttributes::LOGICAL_NAME]); addRelationship(base_rel); } else if(base_rel) @@ -6178,6 +6183,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) rel->setTableNameRelNN(attribs[ParsersAttributes::TABLE_NAME]); rel->setName(attribs[ParsersAttributes::NAME]); + rel->setLogicalName(attribs[ParsersAttributes::LOGICAL_NAME]); base_rel=rel; //Configuring the name patterns diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 82b59ec762..0e3beef0dd 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -34,7 +34,7 @@ Permission::Permission(BaseObject *obj) /* Raises an error if the object type to be associated to the permission is invalid according to the rule (see class definition) */ - if(!objectAcceptsPermission(obj->getObjectType())) + if(!acceptsPermission(obj->getObjectType())) throw Exception(ERR_ASG_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->object=obj; @@ -51,7 +51,7 @@ Permission::Permission(BaseObject *obj) attributes[ParsersAttributes::PRIVILEGES_GOP]=QString(); } -bool Permission::objectAcceptsPermission(ObjectType obj_type, int privilege) +bool Permission::acceptsPermission(ObjectType obj_type, int privilege) { bool result=false; unsigned priv_id=static_cast(privilege); @@ -142,7 +142,7 @@ void Permission::setPrivilege(unsigned priv_id, bool value, bool grant_op) if(priv_id > PRIV_USAGE) throw Exception(ERR_REF_INV_PRIVILEGE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!objectAcceptsPermission(object->getObjectType(), priv_id)) + if(!acceptsPermission(object->getObjectType(), priv_id)) //Raises an error if the privilege is invalid according to the object type throw Exception(ERR_ASG_INCOMP_PRIV_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/permission.h b/libpgmodeler/src/permission.h index e0198fa492..d35142a127 100644 --- a/libpgmodeler/src/permission.h +++ b/libpgmodeler/src/permission.h @@ -154,7 +154,7 @@ class Permission: public BaseObject { bool isSimilarTo(Permission *perm); //! \brief Returns if the passed object type accepts permission - static bool objectAcceptsPermission(ObjectType obj_type, int privilege=-1); + static bool acceptsPermission(ObjectType obj_type, int privilege=-1); //! \brief Returns the SQL / XML definition for the permission virtual QString getCodeDefinition(unsigned def_type) final; diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index a1f300b212..780b2a8258 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -61,12 +61,21 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge tablespace_sel=new ObjectSelectorWidget(OBJ_TABLESPACE, true, this); owner_sel=new ObjectSelectorWidget(OBJ_ROLE, true, this); + name_ht=new HintTextWidget(name_hint, this); + name_ht->setText(name_edt->statusTip()); + + logical_name_ht=new HintTextWidget(logical_name_hint, this); + logical_name_ht->setText(logical_name_edt->statusTip()); + baseobject_grid = new QGridLayout; baseobject_grid->setObjectName("objetobase_grid"); baseobject_grid->addWidget(protected_obj_frm, 0, 0, 1, 0); baseobject_grid->addWidget(name_lbl, 1, 0, 1, 1); baseobject_grid->addWidget(name_edt, 1, 1, 1, 1); baseobject_grid->addWidget(id_ico_wgt, 1, 2, 1, 3); + baseobject_grid->addWidget(logical_name_lbl, 2, 0, 1, 1); + baseobject_grid->addWidget(logical_name_edt, 2, 1, 1, 1); + baseobject_grid->addWidget(logical_name_hint_wgt, 2, 2, 1, 3); baseobject_grid->addWidget(schema_lbl, 4, 0, 1, 1); baseobject_grid->addWidget(schema_sel, 4, 1, 1, 4); baseobject_grid->addWidget(collation_lbl, 5, 0, 1, 1); @@ -212,7 +221,7 @@ void BaseObjectWidget::configureTabOrder(vector widgets) int idx=0, cnt=0; widgets.insert(widgets.begin(), - { name_edt, schema_sel , collation_sel, owner_sel, tablespace_sel, + { name_edt, name_ht, logical_name_edt, logical_name_ht, schema_sel , collation_sel, owner_sel, tablespace_sel, comment_edt, append_sql_tb, edt_perms_tb, disable_sql_chk }); for(auto &wgt : widgets) @@ -344,17 +353,15 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis if(object) { - //bool prot = false; - - obj_id_lbl->setVisible(true); obj_id_lbl->setText(QString("ID: %1").arg(object->getObjectId())); - if(handled_obj_type!=BASE_OBJECT) + if(handled_obj_type != BASE_OBJECT) name_edt->setText(object->getName()); else name_edt->setText(object->getSignature()); comment_edt->setPlainText(object->getComment()); + logical_name_edt->setText(object->getLogicalName()); /* When creating a new table or relationship the object is pre allocated and the flag new_object is set. In order to avoid the selectors to have empty values, we check if the flag is false which means @@ -382,7 +389,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis else { object_protected = false; - obj_id_lbl->setVisible(false); + obj_id_lbl->setText(" "); protected_obj_frm->setVisible(false); if(parent_obj && parent_obj->getObjectType()==OBJ_SCHEMA) @@ -432,7 +439,13 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_TAG && obj_type!=OBJ_PARAMETER); - edt_perms_tb->setVisible(Permission::objectAcceptsPermission(obj_type)); + name_hint->setVisible(BaseObject::acceptsLogicalName(obj_type)); + + logical_name_edt->setVisible(BaseObject::acceptsLogicalName(obj_type)); + logical_name_hint_wgt->setVisible(BaseObject::acceptsLogicalName(obj_type)); + logical_name_lbl->setVisible(BaseObject::acceptsLogicalName(obj_type)); + + edt_perms_tb->setVisible(Permission::acceptsPermission(obj_type)); append_sql_tb->setVisible(BaseObject::acceptsCustomSQL(obj_type)); schema_lbl->setVisible(BaseObject::acceptsSchema(obj_type)); @@ -736,6 +749,9 @@ void BaseObjectWidget::applyConfiguration(void) object->setName(name_edt->text().trimmed().toUtf8()); } + if(logical_name_edt->isVisible()) + object->setLogicalName(logical_name_edt->text().trimmed()); + //Sets the object's comment if(comment_edt->isVisible()) object->setComment(comment_edt->toPlainText().toUtf8()); diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 4f31363919..9dad951ef6 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -33,6 +33,7 @@ #include "ui_baseobjectwidget.h" #include "pgsqltypewidget.h" #include "pgmodeleruins.h" +#include "hinttextwidget.h" /* Declaring the PgSQLType class as a Qt metatype in order to permit that instances of the class be used as data of QVariant and QMetaType */ @@ -54,6 +55,8 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { QHBoxLayout *misc_btns_lt; + HintTextWidget *name_ht, *logical_name_ht; + //! \brief Store the kind of object being handled by the widget (configured in the constructor) ObjectType handled_obj_type; diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index c66f1ef7ae..931053c2ca 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -2136,7 +2136,7 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) Permission *perm=nullptr; QString sig; - if(Permission::objectAcceptsPermission(obj_type)) + if(Permission::acceptsPermission(obj_type)) { QStringList perm_list; vector privs, gop_privs; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index d7ce6e8b05..294071b8c8 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -203,7 +203,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(action_redo,SIGNAL(triggered(bool)),oper_list_wgt,SLOT(redoOperation(void))); connect(model_nav_wgt, SIGNAL(s_modelCloseRequested(int)), this, SLOT(closeModel(int))); - connect(model_nav_wgt, SIGNAL(s_currentModelChanged(int)), this, SLOT(setCurrentModel())); + connect(model_nav_wgt, SIGNAL(s_currentModelChanged(int)), this, SLOT(setCurrentModel())); connect(action_print, SIGNAL(triggered(bool)), this, SLOT(printModel(void))); connect(action_configuration, SIGNAL(triggered(bool)), configuration_form, SLOT(show())); @@ -227,6 +227,8 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(model_valid_wgt, &ModelValidationWidget::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); connect(sql_tool_wgt, &SQLToolWidget::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); + connect(logical_view_btn, SIGNAL(toggled(bool)), this, SLOT(toggleLogicalView())); + window_title=this->windowTitle() + QString(" ") + GlobalAttributes::PGMODELER_VERSION; #ifdef DEMO_VERSION @@ -1966,3 +1968,19 @@ void MainWindow::arrangeObjects(void) QApplication::restoreOverrideCursor(); } } + +void MainWindow::toggleLogicalView(void) +{ + ModelWidget *model_wgt = nullptr; + + BaseObjectView::setLogicalViewMode(logical_view_btn->isChecked()); + QApplication::setOverrideCursor(Qt::WaitCursor); + + for(int idx = 0; idx < models_tbw->count(); idx++) + { + model_wgt = dynamic_cast(models_tbw->widget(idx)); + model_wgt->getDatabaseModel()->setObjectsModified({ OBJ_TABLE, OBJ_RELATIONSHIP, BASE_RELATIONSHIP, OBJ_VIEW, OBJ_SCHEMA}); + } + + QApplication::restoreOverrideCursor(); +} diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 6acf2f6ded..52e722d4ae 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -291,6 +291,7 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { void handleObjectsMetadata(void); void restoreTemporaryModels(void); void arrangeObjects(void); + void toggleLogicalView(void); }; #endif diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index b7aa3839f4..500e21c596 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -669,7 +669,7 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject try { if(db_model && visible_objs_map[OBJ_PERMISSION] && - Permission::objectAcceptsPermission(object->getObjectType())) + Permission::acceptsPermission(object->getObjectType())) { vector perms; QTreeWidgetItem *item=new QTreeWidgetItem(root); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 2e0c399276..e684b258d6 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -3183,7 +3183,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) if(tab_or_view) quick_actions_menu.addAction(action_set_tag); - if(object && Permission::objectAcceptsPermission(obj_type)) + if(object && Permission::acceptsPermission(obj_type)) { quick_actions_menu.addAction(action_edit_perms); action_edit_perms->setData(QVariant::fromValue(object)); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 818b9666d2..59e6591a3b 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -150,7 +150,7 @@ void PermissionWidget::setAttributes(DatabaseModel *model, BaseObject *parent_ob chk1->setChecked(false); //Enabling the checkboxes using a validation of privilege type against the curret object type. - privileges_tbw->setRowHidden(priv, !Permission::objectAcceptsPermission(object->getObjectType(), priv)); + privileges_tbw->setRowHidden(priv, !Permission::acceptsPermission(object->getObjectType(), priv)); } listPermissions(); diff --git a/libpgmodeler_ui/ui/baseobjectwidget.ui b/libpgmodeler_ui/ui/baseobjectwidget.ui index 7c0c984c46..8a1f4b6888 100644 --- a/libpgmodeler_ui/ui/baseobjectwidget.ui +++ b/libpgmodeler_ui/ui/baseobjectwidget.ui @@ -74,6 +74,9 @@ 16777215 + + This is the name of the object in the PostgreSQL database or physical name. + @@ -397,9 +400,9 @@ This will disable the code of all child and referrer objects. - 210 - 90 - 141 + 200 + 80 + 161 31 @@ -419,6 +422,28 @@ This will disable the code of all child and referrer objects. 0 + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + @@ -505,6 +530,130 @@ This will disable the code of all child and referrer objects. true + + + + 80 + 120 + 111 + 25 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + This is a user/client friendly name for the object. When displaying the model in logical view this is the name shown for the object instead of its real name. If this field is empty the real name will be displayed. + + + + + + + + + 8 + 120 + 81 + 16 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Logical: + + + + + + 200 + 120 + 94 + 31 + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 63 + 20 + + + + + + name_edt diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index fa5ee1db02..8cd28a5449 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -10,7 +10,7 @@ 0 0 1068 - 673 + 708 @@ -517,7 +517,7 @@ Toggle the object finder - Find Object + Find objects @@ -540,6 +540,38 @@ + + + + + 0 + 0 + + + + Toogle the logical (more compact) view + + + Logical view + + + + :/icones/icones/visaogeral.png:/icones/icones/visaogeral.png + + + + 22 + 22 + + + + true + + + Qt::ToolButtonTextBesideIcon + + + @@ -678,7 +710,7 @@ 0 0 1068 - 23 + 25 diff --git a/schemas/xml/column.sch b/schemas/xml/column.sch index 788f161e62..5dc027914e 100644 --- a/schemas/xml/column.sch +++ b/schemas/xml/column.sch @@ -3,6 +3,10 @@ # Code generation can be broken if incorrect changes are made. $tb [ + diff --git a/schemas/xml/dtd/constraint.dtd b/schemas/xml/dtd/constraint.dtd index be1946fbdb..3f584a2617 100644 --- a/schemas/xml/dtd/constraint.dtd +++ b/schemas/xml/dtd/constraint.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/index.dtd b/schemas/xml/dtd/index.dtd index f7d02fe9e3..e5cce0bc0a 100644 --- a/schemas/xml/dtd/index.dtd +++ b/schemas/xml/dtd/index.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/policy.dtd b/schemas/xml/dtd/policy.dtd index bc5c4d06b3..964e7cf6e7 100644 --- a/schemas/xml/dtd/policy.dtd +++ b/schemas/xml/dtd/policy.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/relationship.dtd b/schemas/xml/dtd/relationship.dtd index 01baad3ad9..5f8ccc5262 100644 --- a/schemas/xml/dtd/relationship.dtd +++ b/schemas/xml/dtd/relationship.dtd @@ -7,6 +7,7 @@ + diff --git a/schemas/xml/dtd/rule.dtd b/schemas/xml/dtd/rule.dtd index a340b78336..a923aade7b 100644 --- a/schemas/xml/dtd/rule.dtd +++ b/schemas/xml/dtd/rule.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/schema.dtd b/schemas/xml/dtd/schema.dtd index 8e17e3fc82..143a11f628 100644 --- a/schemas/xml/dtd/schema.dtd +++ b/schemas/xml/dtd/schema.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 5e4c9aa922..2545ea7877 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -11,6 +11,7 @@ + diff --git a/schemas/xml/dtd/trigger.dtd b/schemas/xml/dtd/trigger.dtd index 22d745cd16..56f77a5cf2 100644 --- a/schemas/xml/dtd/trigger.dtd +++ b/schemas/xml/dtd/trigger.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index ef084530bd..764d436b97 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/index.sch b/schemas/xml/index.sch index f544636b16..f750c3836b 100644 --- a/schemas/xml/index.sch +++ b/schemas/xml/index.sch @@ -3,7 +3,11 @@ # Code generation can be broken if incorrect changes are made. [ $br %else diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index f7d29dddfd..d13280156f 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -2,6 +2,11 @@ # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. [
Date: Tue, 29 May 2018 21:30:07 -0300 Subject: [PATCH 046/425] Renamed the "logical view" to "compact view" and all the settings/ attributes related to it --- conf/dtd/pgmodeler.dtd | 1 + conf/pgmodeler.conf | 3 +- conf/schemas/pgmodeler.sch | 1 + libobjrenderer/src/baseobjectview.cpp | 6 +-- libobjrenderer/src/baseobjectview.h | 10 ++-- libobjrenderer/src/basetableview.cpp | 6 +-- libobjrenderer/src/graphicalview.cpp | 4 +- libobjrenderer/src/relationshipview.cpp | 6 +-- libobjrenderer/src/schemaview.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 6 +-- libobjrenderer/src/tabletitleview.cpp | 6 +-- libobjrenderer/src/tableview.cpp | 4 +- libparsers/src/parsersattributes.cpp | 2 +- libparsers/src/parsersattributes.h | 2 +- libpgmodeler/src/baseobject.cpp | 20 ++++---- libpgmodeler/src/baseobject.h | 20 ++++---- libpgmodeler/src/column.cpp | 2 +- libpgmodeler/src/databasemodel.cpp | 8 +-- libpgmodeler_ui/res/icones/compactview.png | Bin 0 -> 771 bytes libpgmodeler_ui/res/resources.qrc | 1 + libpgmodeler_ui/src/baseobjectwidget.cpp | 20 +++----- libpgmodeler_ui/src/baseobjectwidget.h | 2 +- libpgmodeler_ui/src/mainwindow.cpp | 17 +++++-- libpgmodeler_ui/src/mainwindow.h | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 20 ++++++++ libpgmodeler_ui/src/modelwidget.h | 2 + libpgmodeler_ui/ui/baseobjectwidget.ui | 54 +++++---------------- libpgmodeler_ui/ui/mainwindow.ui | 51 ++++++++----------- schemas/xml/column.sch | 4 +- schemas/xml/constraint.sch | 6 +-- schemas/xml/dtd/column.dtd | 2 +- schemas/xml/dtd/constraint.dtd | 2 +- schemas/xml/dtd/index.dtd | 2 +- schemas/xml/dtd/policy.dtd | 2 +- schemas/xml/dtd/relationship.dtd | 2 +- schemas/xml/dtd/rule.dtd | 2 +- schemas/xml/dtd/schema.dtd | 2 +- schemas/xml/dtd/table.dtd | 2 +- schemas/xml/dtd/trigger.dtd | 2 +- schemas/xml/dtd/view.dtd | 2 +- schemas/xml/index.sch | 4 +- schemas/xml/policy.sch | 6 +-- schemas/xml/relationship.sch | 4 +- schemas/xml/rule.sch | 4 +- schemas/xml/schema.sch | 6 +-- schemas/xml/table.sch | 6 +-- schemas/xml/trigger.sch | 4 +- schemas/xml/view.sch | 4 +- 48 files changed, 165 insertions(+), 181 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/compactview.png diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd index 51768e16d0..7e78b2c0c8 100644 --- a/conf/dtd/pgmodeler.dtd +++ b/conf/dtd/pgmodeler.dtd @@ -44,6 +44,7 @@ + diff --git a/conf/pgmodeler.conf b/conf/pgmodeler.conf index 38405c783c..3830192a0d 100644 --- a/conf/pgmodeler.conf +++ b/conf/pgmodeler.conf @@ -37,7 +37,8 @@ align-objs-to-grid="true" min-object-opacity="10" history-max-length="1000" - use-curved-lines="true"/> + use-curved-lines="true" + compact-view="false"/> diff --git a/conf/schemas/pgmodeler.sch b/conf/schemas/pgmodeler.sch index 74715d9844..466d0e3964 100644 --- a/conf/schemas/pgmodeler.sch +++ b/conf/schemas/pgmodeler.sch @@ -47,6 +47,7 @@ $sp [ BaseObjectView::font_config; map> BaseObjectView::color_config; unsigned BaseObjectView::global_sel_order=1; bool BaseObjectView::use_placeholder=true; -bool BaseObjectView::logical_view=false; +bool BaseObjectView::compact_view=false; BaseObjectView::BaseObjectView(BaseObject *object) { @@ -398,9 +398,9 @@ bool BaseObjectView::isPlaceholderEnabled(void) return(use_placeholder); } -void BaseObjectView::setLogicalViewMode(bool value) +void BaseObjectView::setCompactViewMode(bool value) { - logical_view = value; + compact_view = value; } QVariant BaseObjectView::itemChange(GraphicsItemChange change, const QVariant &value) diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 72767fb825..7f3a413a29 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -46,10 +46,10 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { is incremented each time an object is selected. */ static unsigned global_sel_order; - /*! \brief Stores the current status for object's logical view display. - * In logical view the logical name of object's are shown. Also, data types and constraint descriptors are hidden, - * as well the table's extended area are collapsed by default */ - static bool logical_view; + /*! \brief Stores the current status for object's compact view display. + * In compact view the alias of object's are shown instead of name. Also, data types and constraint types are hidden, + * as well the table's extended area is collapsed by default */ + static bool compact_view; /*! \brief Stores the selection order of the current object. This attribute is used to know when an item was selected before another in the scene because the implementation of @@ -158,7 +158,7 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { static bool isPlaceholderEnabled(void); - static void setLogicalViewMode(bool value); + static void setCompactViewMode(bool value); //! \brief Sets the font style for the specified element id static void setFontStyle(const QString &id, QTextCharFormat font_fmt); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 86a0829b07..362d3f76f2 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -351,7 +351,7 @@ void BaseTableView::__configureObject(float width) { BaseTable *tab = dynamic_cast(this->getSourceObject()); - if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && !logical_view) + if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs) { QPen pen = ext_attribs_body->pen(); float py = 0; @@ -454,11 +454,11 @@ float BaseTableView::calculateWidth(void) This width is used to set the uniform width of table */ if(!columns->childItems().isEmpty() && (columns->boundingRect().width() > title->boundingRect().width() && - (hide_ext_attribs || logical_view || dynamic_cast(this->getSourceObject())->isExtAttribsHidden() || + (hide_ext_attribs || dynamic_cast(this->getSourceObject())->isExtAttribsHidden() || (columns->boundingRect().width() > ext_attribs->boundingRect().width())))) return(columns->boundingRect().width() + (2 * HORIZ_SPACING)); - if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && !logical_view && + if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && !dynamic_cast(this->getSourceObject())->isExtAttribsHidden() && (ext_attribs->boundingRect().width() > title->boundingRect().width() && ext_attribs->boundingRect().width() > columns->boundingRect().width())) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 61e353aaa4..d1dccd5841 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -107,8 +107,8 @@ void GraphicalView::configureObject(void) view->getObjectList(OBJ_INDEX)->begin(), view->getObjectList(OBJ_INDEX)->end()); - ext_attribs->setVisible(!tab_objs.empty() && !hide_ext_attribs && !logical_view); - ext_attribs_body->setVisible(!tab_objs.empty() && !hide_ext_attribs && !logical_view); + ext_attribs->setVisible(!tab_objs.empty() && !hide_ext_attribs); + ext_attribs_body->setVisible(!tab_objs.empty() && !hide_ext_attribs); if(!tab_objs.empty()) { diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 942cdc161b..6c0e7fa7a7 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1750,7 +1750,7 @@ void RelationshipView::configureAttributes(void) attrib->setPos(px, py); - text->setText(logical_view && !col->getLogicalName().isEmpty() ? col->getLogicalName() : col->getName()); + text->setText(compact_view && !col->getAlias().isEmpty() ? col->getAlias() : col->getName()); text->setPos(QPointF(desc->pos().x() + desc->boundingRect().width() + (HORIZ_SPACING * factor), 0)); desc->setPos(0, VERT_SPACING * factor); @@ -1807,9 +1807,9 @@ void RelationshipView::configureLabels(void) { Textbox *txtbox = dynamic_cast(labels[BaseRelationship::REL_NAME_LABEL]->getSourceObject()); - if(logical_view && !base_rel->getLogicalName().isEmpty()) + if(compact_view && !base_rel->getAlias().isEmpty()) { - txtbox->setComment(base_rel->getLogicalName()); + txtbox->setComment(base_rel->getAlias()); txtbox->setModified(true); } else if(txtbox->getComment() != base_rel->getName(true)) diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index b3b3712130..5f848d39f2 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -200,7 +200,7 @@ void SchemaView::configureObject(void) } //Configures the schema name at the top - sch_name->setText(logical_view && !schema->getLogicalName().isEmpty() ? schema->getLogicalName() : schema->getName()); + sch_name->setText(compact_view && !schema->getAlias().isEmpty() ? schema->getAlias() : schema->getName()); font=BaseObjectView::getFontStyle(ParsersAttributes::GLOBAL).font(); font.setItalic(true); font.setBold(true); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 25d652eabc..1e72e2d02b 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -266,7 +266,7 @@ void TableObjectView::configureObject(void) px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HORIZ_SPACING); //Configuring the labels as follow: [object name] [type] [constraints] - lables[0]->setText(logical_view && !tab_obj->getLogicalName().isEmpty() ? tab_obj->getLogicalName() : tab_obj->getName()); + lables[0]->setText(compact_view && !tab_obj->getAlias().isEmpty() ? tab_obj->getAlias() : tab_obj->getName()); //Strikeout the column name when its SQL is disabled QFont font=fmt.font(); @@ -281,7 +281,7 @@ void TableObjectView::configureObject(void) //Configuring the type label fmt=font_config[ParsersAttributes::OBJECT_TYPE]; - if(logical_view) + if(compact_view) lables[1]->setText(" "); else { @@ -298,7 +298,7 @@ void TableObjectView::configureObject(void) //Configuring the constraints label fmt=font_config[ParsersAttributes::CONSTRAINTS]; - if(logical_view) + if(compact_view) lables[2]->setText(" "); else if(column) lables[2]->setText(str_constr); diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 98c693e23e..8f3fb818bc 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -90,8 +90,8 @@ void TableTitleView::configureObject(BaseGraphicObject *object) schema_name->setText(QString(" ")); else { - if(logical_view && !schema->getLogicalName().isEmpty()) - schema_name->setText(schema->getLogicalName() + QString(".")); + if(compact_view && !schema->getAlias().isEmpty()) + schema_name->setText(schema->getAlias() + QString(".")); else schema_name->setText(schema->getName() + QString(".")); } @@ -100,7 +100,7 @@ void TableTitleView::configureObject(BaseGraphicObject *object) font=fmt.font(); obj_name->setFont(font); - obj_name->setText(logical_view && !object->getLogicalName().isEmpty() ? object->getLogicalName() : object->getName()); + obj_name->setText(compact_view && !object->getAlias().isEmpty() ? object->getAlias() : object->getName()); if(!tag) { diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index e66898c802..8385f31e29 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -80,8 +80,8 @@ void TableView::configureObject(void) //Special case: if there is no item on extended attributes, the extended body is hidden if(obj_idx==1) { - groups[obj_idx]->setVisible(count > 0 && !hide_ext_attribs && !logical_view); - bodies[obj_idx]->setVisible(count > 0 && !hide_ext_attribs && !logical_view); + groups[obj_idx]->setVisible(count > 0 && !hide_ext_attribs); + bodies[obj_idx]->setVisible(count > 0 && !hide_ext_attribs); } for(i=0; i < count; i++) diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 2092a32c04..7c65072861 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -92,6 +92,7 @@ namespace ParsersAttributes { COMMENT=QString("comment"), COMMUTATOR_OP=QString("commutator-op"), COMPARISON_TYPE=QString("comparison-type"), + COMPACT_VIEW=QString("compact-view"), COMPLETION_TRIGGER=QString("completion-trigger"), COMPOSITE_TYPE=QString("composite"), CONCURRENT=QString("concurrent"), @@ -287,7 +288,6 @@ namespace ParsersAttributes { LOCALE=QString("locale"), LOCKER_ARC=QString("locker-arc"), LOCKER_BODY=QString("locker-body"), - LOGICAL_NAME=QString("logical-name"), LOGIN=QString("login"), LOOKAHEAD_CHAR=QString("lookahead-char"), MATERIALIZED=QString("materialized"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 366139f604..9a98c7c96c 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -107,6 +107,7 @@ namespace ParsersAttributes { COMMENT, COMMUTATOR_OP, COMPARISON_TYPE, + COMPACT_VIEW, COMPLETION_TRIGGER, COMPOSITE_TYPE, CONCURRENT, @@ -302,7 +303,6 @@ namespace ParsersAttributes { LOCALE, LOCKER_ARC, LOCKER_BODY, - LOGICAL_NAME, LOGIN, LOOKAHEAD_CHAR, MATERIALIZED, diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 27d527f81b..5b5a772542 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -83,7 +83,7 @@ BaseObject::BaseObject(void) database=nullptr; collation=nullptr; attributes[ParsersAttributes::NAME]=QString(); - attributes[ParsersAttributes::LOGICAL_NAME]=QString(); + attributes[ParsersAttributes::ALIAS]=QString(); attributes[ParsersAttributes::COMMENT]=QString(); attributes[ParsersAttributes::OWNER]=QString(); attributes[ParsersAttributes::TABLESPACE]=QString(); @@ -361,13 +361,13 @@ void BaseObject::setName(const QString &name) this->obj_name=aux_name; } -void BaseObject::setLogicalName(const QString &name) +void BaseObject::setAlias(const QString &name) { if(name.size() > OBJECT_NAME_MAX_LENGTH) throw Exception(ERR_ASG_LONG_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); - this->logical_name = name; - setCodeInvalidated(this->logical_name != name); + this->alias = name; + setCodeInvalidated(this->alias != name); } void BaseObject::setComment(const QString &comment) @@ -465,7 +465,7 @@ bool BaseObject::acceptsDropCommand(ObjectType obj_type) obj_type!=BASE_TABLE); } -bool BaseObject::acceptsLogicalName(ObjectType obj_type) +bool BaseObject::acceptsAlias(ObjectType obj_type) { return(obj_type==OBJ_RELATIONSHIP || obj_type==BASE_RELATIONSHIP || obj_type==OBJ_TABLE || obj_type==OBJ_SCHEMA || @@ -575,9 +575,9 @@ QString BaseObject::getName(bool format, bool prepend_schema) return(this->obj_name); } -QString BaseObject::getLogicalName(void) +QString BaseObject::getAlias(void) { - return(this->logical_name); + return(this->alias); } QString BaseObject::getSignature(bool format) @@ -677,8 +677,8 @@ void BaseObject::setBasicAttributes(bool format_name) if(attributes[ParsersAttributes::NAME].isEmpty()) attributes[ParsersAttributes::NAME]=this->getName(format_name); - if(attributes[ParsersAttributes::LOGICAL_NAME].isEmpty()) - attributes[ParsersAttributes::LOGICAL_NAME]=this->getLogicalName(); + if(attributes[ParsersAttributes::ALIAS].isEmpty()) + attributes[ParsersAttributes::ALIAS]=this->getAlias(); if(attributes[ParsersAttributes::SIGNATURE].isEmpty()) attributes[ParsersAttributes::SIGNATURE]=this->getSignature(format_name); @@ -1002,7 +1002,7 @@ void BaseObject::operator = (BaseObject &obj) this->database=obj.database; this->comment=obj.comment; this->obj_name=obj.obj_name; - this->logical_name=obj.logical_name; + this->alias=obj.alias; this->obj_type=obj.obj_type; this->is_protected=obj.is_protected; this->sql_disabled=obj.sql_disabled; diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 0b656121e1..c6f0aae3b8 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -168,8 +168,8 @@ class BaseObject { //! \brief Object's name (in PostgreSQL accepted format) obj_name, - //! \brief Object's logical (human readable) name - logical_name, + //! \brief Object's alias (human readable / friendly) name + alias, //! \brief The set of SQL commands appended on the objectc's definition appended_sql, @@ -281,10 +281,10 @@ class BaseObject { //! \brief Defines the objects name. If the passed name isn't valid it'll raise an error virtual void setName(const QString &name); - /*! \brief Defines the object's logical name. A logical name is used when the database model is being - * displayed in logical mode more user/client friendly. This method raises an error when the provided - * name is larger than 63 bytes (the same rule for PostgreSQL names length) */ - virtual void setLogicalName(const QString &name); + /*! \brief Defines the object's alias (human readable / friendly name). An alias is used when the database model is being + * displayed in compact view. This method raises an error when the provided name is larger than 63 bytes + * (the same rule for PostgreSQL names length) */ + virtual void setAlias(const QString &name); //! \brief Toggles the object's modify protection virtual void setProtected(bool value); @@ -328,8 +328,8 @@ class BaseObject { the parameter 'prepend_schema' includes the schema name on the objects name (defult) */ virtual QString getName(bool format=false, bool prepend_schema=true); - //! \brief Returns the object's logical (user friendly) name - virtual QString getLogicalName(void); + //! \brief Returns the object's alias (user friendly) name + virtual QString getAlias(void); //! \brief Returns the name of the object with schema name (when available) prepended by default virtual QString getSignature(bool format=true); @@ -419,8 +419,8 @@ class BaseObject { //! \brief Returns if the specified type accepts the use of DROP commands static bool acceptsDropCommand(ObjectType obj_type); - //! \brief Returns if the specified type accepts a logical name - static bool acceptsLogicalName(ObjectType obj_type); + //! \brief Returns if the specified type accepts an alias (friendly name) + static bool acceptsAlias(ObjectType obj_type); //! \brief Returns if the object accepts to have a schema assigned bool acceptsSchema(void); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 596d69e91c..59a33d92e7 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -385,7 +385,7 @@ void Column::operator = (Column &col) this->is_protected=col.is_protected; this->obj_name=col.obj_name; - this->logical_name=col.logical_name; + this->alias=col.alias; this->old_name=col.old_name; this->type=col.type; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index a8c2ae217d..9c59b9c881 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3199,8 +3199,8 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) if(obj_type_aux!=OBJ_CAST) object->setName(attribs[ParsersAttributes::NAME]); - if(BaseObject::acceptsLogicalName(obj_type_aux)) - object->setLogicalName(attribs[ParsersAttributes::LOGICAL_NAME]); + if(BaseObject::acceptsAlias(obj_type_aux)) + object->setAlias(attribs[ParsersAttributes::ALIAS]); protected_obj=attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_; sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_; @@ -6118,7 +6118,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) base_rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_FK, tables[0], tables[1], false, false); base_rel->setName(attribs[ParsersAttributes::NAME]); - base_rel->setLogicalName(attribs[ParsersAttributes::LOGICAL_NAME]); + base_rel->setAlias(attribs[ParsersAttributes::ALIAS]); addRelationship(base_rel); } else if(base_rel) @@ -6183,7 +6183,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) rel->setTableNameRelNN(attribs[ParsersAttributes::TABLE_NAME]); rel->setName(attribs[ParsersAttributes::NAME]); - rel->setLogicalName(attribs[ParsersAttributes::LOGICAL_NAME]); + rel->setAlias(attribs[ParsersAttributes::ALIAS]); base_rel=rel; //Configuring the name patterns diff --git a/libpgmodeler_ui/res/icones/compactview.png b/libpgmodeler_ui/res/icones/compactview.png new file mode 100644 index 0000000000000000000000000000000000000000..671d3fdcba70eb667bbf4a12e7c9a099382ee94e GIT binary patch literal 771 zcmV+e1N{7nP)FE4XJ!ZZ-xFz? zHk(K!t|gPnScvvJhgWe(#6iS~NB|H32qupM0GiDv+U?FG1wcBJ$s}HW=t4w2ydfPD zfHRpRSY3U3S^)qe!piH9f7SZ4M~{JXwV^l#W>?>q80Z5SMt7=0v3s`}0O)rY*+2lx z=z?2fD&o5z-06!NT^+JSUH~Bk-juFPMLhd$t}mX-Wl?^76#%fY(LgSjd;i-3%Zgn5 z+-AxnzFaOdw~nT1hx-l)5#IjuKlU>Kcs5&S{xV0rSSqnW8hwB$9B}%$s2}i%7m7vZ z?_UU-4#1_}L67*uLV*qH+i^qj7fh1;;`yZ|Hm+X<0BW`B$+hbG!f*0Oc3#{ zjrEkbHkHd_F`s9nT=h7xZ||PuttX$A_zo%HnB}dP51^q{aG6&a0Ibj&8w&seHoty> zH6w?zerD8pG{jU7fMHm;zHkVVYljLHe6OD4-HYYHb@#3DG0-zPZd^DKIuMBn^K&=f zrqk)lu%$WD0U-o9=Mw=CkqFX0a)6-QdE@{=H?znAEXxWH03Z?v!nFT)roc4K?E`Qk zc+yo6;`IFPabVKZc%r{z$HuS@sH$qHsv2ktBuUz(0Qgj^)vCI#ALpEt4MA=g;rzaA zi3y+WLY8H;TCH}yUjOOVuy;sLJ4uoR0CYMX9l-jq$s+(U`|cOF^Rj)}vH%zWOgm4m zOPEvdJluYI_V;{{&>y)BK(gQdyaOOy0B(?x=@+)eoCvj1oG$icones/bulkedit.png icones/policy_grp.png icones/policy.png + icones/compactview.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 780b2a8258..95cc3416eb 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -61,9 +61,6 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge tablespace_sel=new ObjectSelectorWidget(OBJ_TABLESPACE, true, this); owner_sel=new ObjectSelectorWidget(OBJ_ROLE, true, this); - name_ht=new HintTextWidget(name_hint, this); - name_ht->setText(name_edt->statusTip()); - logical_name_ht=new HintTextWidget(logical_name_hint, this); logical_name_ht->setText(logical_name_edt->statusTip()); @@ -221,7 +218,7 @@ void BaseObjectWidget::configureTabOrder(vector widgets) int idx=0, cnt=0; widgets.insert(widgets.begin(), - { name_edt, name_ht, logical_name_edt, logical_name_ht, schema_sel , collation_sel, owner_sel, tablespace_sel, + { name_edt, logical_name_edt, logical_name_ht, schema_sel , collation_sel, owner_sel, tablespace_sel, comment_edt, append_sql_tb, edt_perms_tb, disable_sql_chk }); for(auto &wgt : widgets) @@ -353,6 +350,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis if(object) { + obj_id_lbl->setVisible(true); obj_id_lbl->setText(QString("ID: %1").arg(object->getObjectId())); if(handled_obj_type != BASE_OBJECT) @@ -361,7 +359,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis name_edt->setText(object->getSignature()); comment_edt->setPlainText(object->getComment()); - logical_name_edt->setText(object->getLogicalName()); + logical_name_edt->setText(object->getAlias()); /* When creating a new table or relationship the object is pre allocated and the flag new_object is set. In order to avoid the selectors to have empty values, we check if the flag is false which means @@ -389,7 +387,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis else { object_protected = false; - obj_id_lbl->setText(" "); + obj_id_lbl->setVisible(false); protected_obj_frm->setVisible(false); if(parent_obj && parent_obj->getObjectType()==OBJ_SCHEMA) @@ -439,11 +437,9 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_TAG && obj_type!=OBJ_PARAMETER); - name_hint->setVisible(BaseObject::acceptsLogicalName(obj_type)); - - logical_name_edt->setVisible(BaseObject::acceptsLogicalName(obj_type)); - logical_name_hint_wgt->setVisible(BaseObject::acceptsLogicalName(obj_type)); - logical_name_lbl->setVisible(BaseObject::acceptsLogicalName(obj_type)); + logical_name_edt->setVisible(BaseObject::acceptsAlias(obj_type)); + logical_name_hint_wgt->setVisible(BaseObject::acceptsAlias(obj_type)); + logical_name_lbl->setVisible(BaseObject::acceptsAlias(obj_type)); edt_perms_tb->setVisible(Permission::acceptsPermission(obj_type)); append_sql_tb->setVisible(BaseObject::acceptsCustomSQL(obj_type)); @@ -750,7 +746,7 @@ void BaseObjectWidget::applyConfiguration(void) } if(logical_name_edt->isVisible()) - object->setLogicalName(logical_name_edt->text().trimmed()); + object->setAlias(logical_name_edt->text().trimmed()); //Sets the object's comment if(comment_edt->isVisible()) diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 9dad951ef6..dec82d9bd6 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -55,7 +55,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { QHBoxLayout *misc_btns_lt; - HintTextWidget *name_ht, *logical_name_ht; + HintTextWidget *logical_name_ht; //! \brief Store the kind of object being handled by the widget (configured in the constructor) ObjectType handled_obj_type; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 294071b8c8..ee50757aca 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -73,7 +73,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par grid->addWidget(sql_tool_wgt, 0, 0); views_stw->widget(MANAGE_VIEW)->setLayout(grid); - configuration_form=new ConfigurationForm(nullptr, Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); + configuration_form=new ConfigurationForm(nullptr, Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); PgModelerUiNS::resizeDialog(configuration_form); configuration_form->loadConfiguration(); @@ -118,6 +118,8 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par //Enables the action to restore session when there are registered session files action_restore_session->setEnabled(!prev_session_files.isEmpty()); central_wgt->last_session_tb->setEnabled(action_restore_session->isEnabled()); + + } catch(Exception &e) { @@ -227,7 +229,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(model_valid_wgt, &ModelValidationWidget::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); connect(sql_tool_wgt, &SQLToolWidget::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); - connect(logical_view_btn, SIGNAL(toggled(bool)), this, SLOT(toggleLogicalView())); + connect(action_compact_view, SIGNAL(toggled(bool)), this, SLOT(toggleCompactView())); window_title=this->windowTitle() + QString(" ") + GlobalAttributes::PGMODELER_VERSION; @@ -388,6 +390,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par action_show_grid->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]==ParsersAttributes::_TRUE_); action_alin_objs_grade->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::ALIGN_OBJS_TO_GRID]==ParsersAttributes::_TRUE_); action_show_delimiters->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]==ParsersAttributes::_TRUE_); + action_compact_view->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]==ParsersAttributes::_TRUE_); ObjectsScene::setGridOptions(action_show_grid->isChecked(), action_alin_objs_grade->isChecked(), @@ -621,7 +624,9 @@ void MainWindow::closeEvent(QCloseEvent *event) conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GENERAL_CONF_WGT)); confs=conf_wgt->getConfigurationParams(); + attribs[ParsersAttributes::COMPACT_VIEW]=action_compact_view->isChecked() ? ParsersAttributes::_TRUE_ : QString(); attribs[ParsersAttributes::SHOW_MAIN_MENU]=main_menu_mb->isVisible() ? ParsersAttributes::_TRUE_ : QString(); + conf_wgt->addConfigurationParam(ParsersAttributes::CONFIGURATION, attribs); attribs.clear(); @@ -1616,6 +1621,7 @@ void MainWindow::updateToolsState(bool model_closed) action_alin_objs_grade->setEnabled(enabled); action_undo->setEnabled(enabled); action_redo->setEnabled(enabled); + action_compact_view->setEnabled(enabled); action_handle_metadata->setEnabled(enabled); @@ -1969,17 +1975,18 @@ void MainWindow::arrangeObjects(void) } } -void MainWindow::toggleLogicalView(void) +void MainWindow::toggleCompactView(void) { ModelWidget *model_wgt = nullptr; - BaseObjectView::setLogicalViewMode(logical_view_btn->isChecked()); + BaseObjectView::setCompactViewMode(action_compact_view->isChecked()); QApplication::setOverrideCursor(Qt::WaitCursor); for(int idx = 0; idx < models_tbw->count(); idx++) { model_wgt = dynamic_cast(models_tbw->widget(idx)); - model_wgt->getDatabaseModel()->setObjectsModified({ OBJ_TABLE, OBJ_RELATIONSHIP, BASE_RELATIONSHIP, OBJ_VIEW, OBJ_SCHEMA}); + model_wgt->toggleAllExtendedAttributes(action_compact_view->isChecked()); + model_wgt->getDatabaseModel()->setObjectsModified({ OBJ_TABLE, OBJ_VIEW, OBJ_RELATIONSHIP, BASE_RELATIONSHIP, OBJ_SCHEMA}); } QApplication::restoreOverrideCursor(); diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 52e722d4ae..d3b3dcf6b7 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -291,7 +291,7 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { void handleObjectsMetadata(void); void restoreTemporaryModels(void); void arrangeObjects(void); - void toggleLogicalView(void); + void toggleCompactView(void); }; #endif diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index e684b258d6..d8cc910040 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -3427,6 +3427,26 @@ void ModelWidget::fadeObjectsOut(void) fadeObjects(qobject_cast(sender()), false); } +void ModelWidget::toggleAllExtendedAttributes(bool value) +{ + BaseTable *base_tab = nullptr; + vector objects; + + this->scene->clearSelection(); + objects.assign(db_model->getObjectList(OBJ_TABLE)->begin(), db_model->getObjectList(OBJ_TABLE)->end()); + objects.insert(objects.end(), db_model->getObjectList(OBJ_VIEW)->begin(), db_model->getObjectList(OBJ_VIEW)->end()); + + for(auto obj : objects) + { + base_tab = dynamic_cast(obj); + + if(base_tab) + base_tab->setExtAttribsHidden(value); + } + + this->setModified(true); +} + void ModelWidget::toggleExtendedAttributes(void) { bool hide = sender() == action_hide_ext_attribs; diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index a2fd4b48a0..ac387379f2 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -274,6 +274,8 @@ class ModelWidget: public QWidget { void fadeObjects(const vector &objects, bool fade_in); + void toggleAllExtendedAttributes(bool value); + public: static constexpr double MINIMUM_ZOOM=0.050000, MAXIMUM_ZOOM=5.000001, diff --git a/libpgmodeler_ui/ui/baseobjectwidget.ui b/libpgmodeler_ui/ui/baseobjectwidget.ui index 8a1f4b6888..f2aa134c57 100644 --- a/libpgmodeler_ui/ui/baseobjectwidget.ui +++ b/libpgmodeler_ui/ui/baseobjectwidget.ui @@ -75,7 +75,7 @@ - This is the name of the object in the PostgreSQL database or physical name. + This is the name of the object in the PostgreSQL database. @@ -422,32 +422,10 @@ This will disable the code of all child and referrer objects. 0 - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - - + 0 0 @@ -558,7 +536,7 @@ This will disable the code of all child and referrer objects. - This is a user/client friendly name for the object. When displaying the model in logical view this is the name shown for the object instead of its real name. If this field is empty the real name will be displayed. + This is a more friendly name for the object. When displaying the model in compact view this is the name shown for the object instead of its real name. If this field is empty the real name will be displayed anyway. @@ -586,7 +564,7 @@ This will disable the code of all child and referrer objects. - Logical: + Alias: @@ -594,10 +572,16 @@ This will disable the code of all child and referrer objects. 200 120 - 94 + 31 31 + + + 0 + 0 + + 6 @@ -636,22 +620,6 @@ This will disable the code of all child and referrer objects. - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 63 - 20 - - - - diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index 8cd28a5449..bba2df780f 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -540,38 +540,6 @@ - - - - - 0 - 0 - - - - Toogle the logical (more compact) view - - - Logical view - - - - :/icones/icones/visaogeral.png:/icones/icones/visaogeral.png - - - - 22 - 22 - - - - true - - - Qt::ToolButtonTextBesideIcon - - - @@ -905,6 +873,7 @@ + @@ -1546,6 +1515,24 @@ Rearrange objects over the canvas + + + true + + + false + + + + :/icones/icones/compactview.png:/icones/icones/compactview.png + + + Compact view + + + Toggle the compact view on the model(s) + + models_tbw diff --git a/schemas/xml/column.sch b/schemas/xml/column.sch index 5dc027914e..780737d903 100644 --- a/schemas/xml/column.sch +++ b/schemas/xml/column.sch @@ -3,8 +3,8 @@ # Code generation can be broken if incorrect changes are made. $tb [ - + diff --git a/schemas/xml/dtd/constraint.dtd b/schemas/xml/dtd/constraint.dtd index 3f584a2617..55588c535c 100644 --- a/schemas/xml/dtd/constraint.dtd +++ b/schemas/xml/dtd/constraint.dtd @@ -4,7 +4,7 @@ --> - + diff --git a/schemas/xml/dtd/index.dtd b/schemas/xml/dtd/index.dtd index e5cce0bc0a..250bdb8d4e 100644 --- a/schemas/xml/dtd/index.dtd +++ b/schemas/xml/dtd/index.dtd @@ -4,7 +4,7 @@ --> - + diff --git a/schemas/xml/dtd/policy.dtd b/schemas/xml/dtd/policy.dtd index 964e7cf6e7..eba99706e2 100644 --- a/schemas/xml/dtd/policy.dtd +++ b/schemas/xml/dtd/policy.dtd @@ -4,7 +4,7 @@ --> - + diff --git a/schemas/xml/dtd/relationship.dtd b/schemas/xml/dtd/relationship.dtd index 5f8ccc5262..5db5cefc53 100644 --- a/schemas/xml/dtd/relationship.dtd +++ b/schemas/xml/dtd/relationship.dtd @@ -7,7 +7,7 @@ - + diff --git a/schemas/xml/dtd/rule.dtd b/schemas/xml/dtd/rule.dtd index a923aade7b..0ce3103323 100644 --- a/schemas/xml/dtd/rule.dtd +++ b/schemas/xml/dtd/rule.dtd @@ -4,7 +4,7 @@ --> - + diff --git a/schemas/xml/dtd/schema.dtd b/schemas/xml/dtd/schema.dtd index 143a11f628..99cc73d800 100644 --- a/schemas/xml/dtd/schema.dtd +++ b/schemas/xml/dtd/schema.dtd @@ -4,7 +4,7 @@ --> - + diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 2545ea7877..5e751a70a1 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -11,7 +11,7 @@ - + diff --git a/schemas/xml/dtd/trigger.dtd b/schemas/xml/dtd/trigger.dtd index 56f77a5cf2..8781a9b2bb 100644 --- a/schemas/xml/dtd/trigger.dtd +++ b/schemas/xml/dtd/trigger.dtd @@ -4,7 +4,7 @@ --> - + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 764d436b97..9d7f02ea66 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -4,7 +4,7 @@ --> - + diff --git a/schemas/xml/index.sch b/schemas/xml/index.sch index f750c3836b..1202f0fb71 100644 --- a/schemas/xml/index.sch +++ b/schemas/xml/index.sch @@ -4,8 +4,8 @@ [ $br diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index d13280156f..325d351bd3 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -3,9 +3,9 @@ # Code generation can be broken if incorrect changes are made. [
Date: Fri, 1 Jun 2018 11:58:15 -0300 Subject: [PATCH 047/425] Fixing metadata handling to include alias attributes of the objects (WIP) --- libpgmodeler/src/databasemodel.cpp | 12 +++-- libpgmodeler/src/databasemodel.h | 3 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 4 ++ libpgmodeler_ui/src/metadatahandlingform.h | 2 +- libpgmodeler_ui/ui/metadatahandlingform.ui | 52 +++++++++++++++++++- schemas/xml/dtd/metadata.dtd | 1 + schemas/xml/info.sch | 3 +- 7 files changed, 68 insertions(+), 9 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 9c59b9c881..a8f2dbd72f 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -9265,7 +9265,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option bool save_db_attribs=false, save_objs_pos=false, save_objs_prot=false, save_objs_sqldis=false, save_textboxes=false, save_tags=false, save_custom_sql=false, save_custom_colors=false, save_fadeout=false, - save_extattribs=false, save_genericsqls=false; + save_extattribs=false, save_genericsqls=false, save_objs_aliases=false; QStringList labels_attrs={ ParsersAttributes::SRC_LABEL, ParsersAttributes::DST_LABEL, ParsersAttributes::NAME_LABEL }; @@ -9281,6 +9281,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option save_fadeout=(META_OBJS_FADEDOUT & options) == META_OBJS_FADEDOUT; save_extattribs=(META_OBJS_EXTATTRIBS & options) == META_OBJS_EXTATTRIBS; save_genericsqls=(META_GENERIC_SQL_OBJS & options) == META_GENERIC_SQL_OBJS; + save_objs_aliases=(META_OBJS_ALIASES & options) == META_OBJS_ALIASES; output.open(QFile::WriteOnly); @@ -9305,7 +9306,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_db_attribs) objects.push_back(this); - if(save_objs_pos) + if(save_objs_pos || save_objs_aliases) { objects.insert(objects.end(), schemas.begin(), schemas.end()); objects.insert(objects.end(), tables.begin(), tables.end()); @@ -9317,7 +9318,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option for(BaseObject *object : relationships) { rel=dynamic_cast(object); - if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_NN && rel->getReceiverTable()) + + if(save_objs_pos && rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_NN && rel->getReceiverTable()) { tab_nn=rel->getReceiverTable(); src_tab=rel->getTable(BaseRelationship::SRC_TABLE); @@ -9370,6 +9372,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option base_tab=dynamic_cast(object); attribs[ParsersAttributes::NAME]=object->getSignature(); + attribs[ParsersAttributes::ALIAS]=(save_objs_aliases ? object->getAlias() : QString()); attribs[ParsersAttributes::TYPE]=object->getSchemaName(); attribs[ParsersAttributes::PROTECTED]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::SQL_DISABLED]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? ParsersAttributes::_TRUE_ : QString()); @@ -9511,7 +9514,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option (save_custom_sql && (!attribs[ParsersAttributes::APPENDED_SQL].isEmpty() || !attribs[ParsersAttributes::PREPENDED_SQL].isEmpty())) || (save_fadeout && !attribs[ParsersAttributes::FADED_OUT].isEmpty()) || - (save_extattribs && !attribs[ParsersAttributes::HIDE_EXT_ATTRIBS].isEmpty())) + (save_extattribs && !attribs[ParsersAttributes::HIDE_EXT_ATTRIBS].isEmpty()) || + (save_objs_aliases && !attribs[ParsersAttributes::ALIAS].isEmpty())) { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving metadata of the object `%1' (%2)") diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index f0cde903cb..c44ae50773 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -181,7 +181,8 @@ class DatabaseModel: public QObject, public BaseObject { META_TEXTBOX_OBJS=256, //! \brief Handle textboxes object when save/load metadata file META_TAG_OBJS=512, //! \brief Handle tags object when save/load metadata file META_GENERIC_SQL_OBJS=1024, //! \brief Handle generic sql object when save/load metadata file - META_ALL_INFO=2047; //! \brief Handle all metadata information about objects when save/load metadata file + META_OBJS_ALIASES=2048, //! \brief Handle the object's aliases (graphical objects and table children objects) when save/load metadata file + META_ALL_INFO=4095; //! \brief Handle all metadata information about objects when save/load metadata file DatabaseModel(void); diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 2bb8f8f70c..811b3658ec 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -70,6 +70,9 @@ MetadataHandlingForm::MetadataHandlingForm(QWidget *parent, Qt::WindowFlags f) : generic_sql_objs_ht=new HintTextWidget(generic_sql_objs_hint, this); generic_sql_objs_ht->setText(generic_sql_objs_chk->statusTip()); + objs_aliases_ht=new HintTextWidget(objs_aliases_hint, this); + objs_aliases_ht->setText(objs_aliases_chk->statusTip()); + htmlitem_deleg=new HtmlItemDelegate(this); output_trw->setItemDelegateForColumn(0, htmlitem_deleg); @@ -158,6 +161,7 @@ void MetadataHandlingForm::handleObjectsMetada(void) options+=(objs_fadedout_chk->isChecked() ? DatabaseModel::META_OBJS_FADEDOUT : 0); options+=(objs_extattribs_chk->isChecked() ? DatabaseModel::META_OBJS_EXTATTRIBS : 0); options+=(generic_sql_objs_chk->isChecked() ? DatabaseModel::META_GENERIC_SQL_OBJS : 0); + options+=(objs_aliases_chk->isChecked() ? DatabaseModel::META_OBJS_ALIASES : 0); connect(model_wgt->getDatabaseModel(), SIGNAL(s_objectLoaded(int,QString,unsigned)), this, SLOT(updateProgress(int,QString,unsigned))); diff --git a/libpgmodeler_ui/src/metadatahandlingform.h b/libpgmodeler_ui/src/metadatahandlingform.h index 32a6e17f64..176ac0220f 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.h +++ b/libpgmodeler_ui/src/metadatahandlingform.h @@ -42,7 +42,7 @@ class MetadataHandlingForm: public QDialog, public Ui::MetadataHandlingForm { HintTextWidget *db_metadata_ht, *objs_positioning_ht, *objs_protection_ht, *objs_sql_disabled_ht, *custom_sql_ht, *textbox_objs_ht, *tag_objs_ht, *custom_colors_ht, *extract_restore_ht, *restore_ht, *objs_fadedout_ht, *objs_extattribs_ht, - *generic_sql_objs_ht, *extract_only_ht; + *generic_sql_objs_ht, *extract_only_ht, *objs_aliases_ht; void showEvent(QShowEvent *); void selectFile(bool is_output); diff --git a/libpgmodeler_ui/ui/metadatahandlingform.ui b/libpgmodeler_ui/ui/metadatahandlingform.ui index 6b572f1fdc..27382232e9 100644 --- a/libpgmodeler_ui/ui/metadatahandlingform.ui +++ b/libpgmodeler_ui/ui/metadatahandlingform.ui @@ -367,6 +367,54 @@ 10 + + + + + + + 0 + 0 + + + + + + + Handles the objects' aliases in the metadata file. Only for graphical objects and table's children objects. + + + Objects' aliases + + + true + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + @@ -415,7 +463,7 @@ - + Qt::Vertical @@ -860,7 +908,7 @@ - + diff --git a/schemas/xml/dtd/metadata.dtd b/schemas/xml/dtd/metadata.dtd index 00e795ab52..a1fac59092 100644 --- a/schemas/xml/dtd/metadata.dtd +++ b/schemas/xml/dtd/metadata.dtd @@ -40,5 +40,6 @@ + diff --git a/schemas/xml/info.sch b/schemas/xml/info.sch index 673ba88075..fcdde3e2fd 100644 --- a/schemas/xml/info.sch +++ b/schemas/xml/info.sch @@ -52,10 +52,11 @@ $tb [ Date: Fri, 1 Jun 2018 14:20:49 -0300 Subject: [PATCH 048/425] Finished the support to save/load object's metadata containing aliases information --- libpgmodeler/src/databasemodel.cpp | 52 ++++++++++++-- libpgmodeler_ui/src/metadatahandlingform.cpp | 20 +++++- libpgmodeler_ui/src/metadatahandlingform.h | 3 +- libpgmodeler_ui/ui/metadatahandlingform.ui | 73 +++++++++++++++++++- schemas/xml/dtd/metadata.dtd | 1 + schemas/xml/info.sch | 8 ++- 6 files changed, 145 insertions(+), 12 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index a8f2dbd72f..ca074df9d8 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -9252,7 +9252,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option QFile output(filename); QByteArray buf; QString objs_def; - vector objects; + vector objects, tab_objs; attribs_map attribs; BaseGraphicObject *graph_obj=nullptr; Relationship *rel=nullptr; @@ -9333,6 +9333,22 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option objects.push_back(tab_nn); } } + + //Saving aliases the children of tables and views + if(save_objs_aliases) + { + for(auto &tab : tables) + { + tab_objs = dynamic_cast
(tab)->getObjects(); + objects.insert(objects.end(), tab_objs.begin(), tab_objs.end()); + } + + for(auto &vw : views) + { + tab_objs = dynamic_cast(vw)->getObjects(); + objects.insert(objects.end(), tab_objs.begin(), tab_objs.end()); + } + } } if(save_objs_prot || save_objs_sqldis) @@ -9367,11 +9383,15 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option objs_def+=object->getCodeDefinition(SchemaParser::XML_DEFINITION); continue; } + //Discarding the relationship added table objects (when extracting aliases) + else if(TableObject::isTableObject(obj_type) && dynamic_cast(object)->isAddedByRelationship()) + continue; graph_obj=dynamic_cast(object); base_tab=dynamic_cast(object); - attribs[ParsersAttributes::NAME]=object->getSignature(); + attribs[ParsersAttributes::TABLE]=QString(); + attribs[ParsersAttributes::NAME]=(TableObject::isTableObject(obj_type) ? object->getName() : object->getSignature()); attribs[ParsersAttributes::ALIAS]=(save_objs_aliases ? object->getAlias() : QString()); attribs[ParsersAttributes::TYPE]=object->getSchemaName(); attribs[ParsersAttributes::PROTECTED]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? ParsersAttributes::_TRUE_ : QString()); @@ -9379,10 +9399,15 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::TAG]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); attribs[ParsersAttributes::APPENDED_SQL]=object->getAppendedSQL(); attribs[ParsersAttributes::PREPENDED_SQL]=object->getPrependedSQL(); - attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::FADED_OUT]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? ParsersAttributes::_TRUE_ : QString()); + if(TableObject::isTableObject(obj_type)) + { + base_tab = dynamic_cast(object)->getParentTable(); + attribs[ParsersAttributes::TABLE]=base_tab->getSignature(); + } + if(save_custom_sql && obj_type==OBJ_DATABASE) { attribs[ParsersAttributes::APPEND_AT_EOD]=(this->isAppendAtEOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); @@ -9576,12 +9601,11 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option BaseRelationship *rel=nullptr; Schema *schema=nullptr; Tag *tag=nullptr; - QPointF pnt; int progress=0; bool load_db_attribs=false, load_objs_pos=false, load_objs_prot=false, load_objs_sqldis=false, load_textboxes=false, load_tags=false, load_custom_sql=false, load_custom_colors=false, load_fadeout=false, - load_extattribs=false, load_genericsqls=false; + load_extattribs=false, load_genericsqls=false, load_objs_aliases=false; load_db_attribs=(META_DB_ATTRIBUTES & options) == META_DB_ATTRIBUTES; load_objs_pos=(META_OBJS_POSITIONING & options) == META_OBJS_POSITIONING; @@ -9594,6 +9618,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option load_fadeout=(META_OBJS_FADEDOUT & options) == META_OBJS_FADEDOUT; load_extattribs=(META_OBJS_EXTATTRIBS & options) == META_OBJS_EXTATTRIBS; load_genericsqls=(META_GENERIC_SQL_OBJS & options) == META_GENERIC_SQL_OBJS; + load_objs_aliases=(META_OBJS_ALIASES & options) == META_OBJS_ALIASES; try { @@ -9669,6 +9694,20 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option object=this; } + else if(TableObject::isTableObject(obj_type)) + { + base_tab = getTable(attribs[ParsersAttributes::TABLE]); + + if(!base_tab && (obj_type == OBJ_RULE || obj_type == OBJ_INDEX || obj_type == OBJ_TRIGGER)) + base_tab = getView(attribs[ParsersAttributes::TABLE]); + + if(base_tab) + object = base_tab->getObject(attribs[ParsersAttributes::OBJECT], obj_type); + + //Discarding the object if it was added by relationship + if(object && dynamic_cast(object)->isAddedByRelationship()) + object = nullptr; + } else object=getObject(obj_name, obj_type); @@ -9714,6 +9753,9 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option this->setPrependAtBOD(attribs[ParsersAttributes::PREPEND_AT_BOD]==ParsersAttributes::_TRUE_); } + if(load_objs_aliases && !attribs[ParsersAttributes::ALIAS].isEmpty()) + object->setAlias(attribs[ParsersAttributes::ALIAS]); + if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) { do diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 811b3658ec..e462cff642 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -91,6 +91,8 @@ MetadataHandlingForm::MetadataHandlingForm(QWidget *parent, Qt::WindowFlags f) : connect(restore_rb, SIGNAL(toggled(bool)), this, SLOT(enableMetadataHandling())); connect(extract_restore_rb, SIGNAL(toggled(bool)), this, SLOT(enableMetadataHandling())); connect(extract_only_rb, SIGNAL(toggled(bool)), this, SLOT(enableMetadataHandling())); + connect(select_all_btn, SIGNAL(clicked(bool)), this, SLOT(selectAllOptions())); + connect(clear_all_btn, SIGNAL(clicked(bool)), this, SLOT(selectAllOptions())); } void MetadataHandlingForm::enableMetadataHandling(void) @@ -106,6 +108,20 @@ void MetadataHandlingForm::enableMetadataHandling(void) (restore_rb->isChecked() && !backup_file_edt->text().isEmpty())))); } +void MetadataHandlingForm::selectAllOptions(void) +{ + bool check = sender() == select_all_btn; + QCheckBox *checkbox = nullptr; + + for(auto &obj : options_grp->children()) + { + checkbox = dynamic_cast(obj); + + if(checkbox) + checkbox->setChecked(check); + } +} + void MetadataHandlingForm::setModelWidget(ModelWidget *model_wgt) { this->model_wgt=model_wgt; @@ -163,7 +179,7 @@ void MetadataHandlingForm::handleObjectsMetada(void) options+=(generic_sql_objs_chk->isChecked() ? DatabaseModel::META_GENERIC_SQL_OBJS : 0); options+=(objs_aliases_chk->isChecked() ? DatabaseModel::META_OBJS_ALIASES : 0); - connect(model_wgt->getDatabaseModel(), SIGNAL(s_objectLoaded(int,QString,unsigned)), this, SLOT(updateProgress(int,QString,unsigned))); + connect(model_wgt->getDatabaseModel(), SIGNAL(s_objectLoaded(int,QString,unsigned)), this, SLOT(updateProgress(int,QString,unsigned)), Qt::UniqueConnection); if(extract_restore_rb->isChecked() || extract_only_rb->isChecked()) { @@ -183,7 +199,7 @@ void MetadataHandlingForm::handleObjectsMetada(void) tmp_file.close(); } - connect(extract_model, SIGNAL(s_objectLoaded(int,QString,unsigned)), this, SLOT(updateProgress(int,QString,unsigned))); + connect(extract_model, SIGNAL(s_objectLoaded(int,QString,unsigned)), this, SLOT(updateProgress(int,QString,unsigned)), Qt::UniqueConnection); root_item=PgModelerUiNS::createOutputTreeItem(output_trw, PgModelerUiNS::formatMessage(trUtf8("Extracting metadata to file `%1'").arg(metadata_file)), diff --git a/libpgmodeler_ui/src/metadatahandlingform.h b/libpgmodeler_ui/src/metadatahandlingform.h index 176ac0220f..5d9c807a45 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.h +++ b/libpgmodeler_ui/src/metadatahandlingform.h @@ -54,8 +54,9 @@ class MetadataHandlingForm: public QDialog, public Ui::MetadataHandlingForm { private slots: void updateProgress(int progress, QString msg, unsigned type_id); - void handleObjectsMetada(void); + void handleObjectsMetada(void); void enableMetadataHandling(void); + void selectAllOptions(void); signals: void s_metadataHandled(void); diff --git a/libpgmodeler_ui/ui/metadatahandlingform.ui b/libpgmodeler_ui/ui/metadatahandlingform.ui index 27382232e9..56cf539196 100644 --- a/libpgmodeler_ui/ui/metadatahandlingform.ui +++ b/libpgmodeler_ui/ui/metadatahandlingform.ui @@ -6,8 +6,8 @@ 0 0 - 666 - 574 + 727 + 661 @@ -344,7 +344,7 @@ - + 0 @@ -956,6 +956,73 @@ + + + + + 0 + 0 + + + + + 6 + + + 0 + + + 10 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 252 + 20 + + + + + + + + Select all + + + + + + + Clear all + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + diff --git a/schemas/xml/dtd/metadata.dtd b/schemas/xml/dtd/metadata.dtd index a1fac59092..7bae17ae26 100644 --- a/schemas/xml/dtd/metadata.dtd +++ b/schemas/xml/dtd/metadata.dtd @@ -41,5 +41,6 @@ + diff --git a/schemas/xml/info.sch b/schemas/xml/info.sch index fcdde3e2fd..ab4b50423b 100644 --- a/schemas/xml/info.sch +++ b/schemas/xml/info.sch @@ -52,12 +52,18 @@ $tb [ $br From becc98294cbcb879116de6f9c9c53e18aa24928a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 1 Jun 2018 17:28:31 -0300 Subject: [PATCH 049/425] Replicating the usage of aliases in relationship created objects --- libpgmodeler/src/baseobject.cpp | 2 +- libpgmodeler/src/relationship.cpp | 74 ++++++++++++++++++++++--------- libpgmodeler/src/relationship.h | 2 +- schemas/xml/dtd/policy.dtd | 1 - schemas/xml/policy.sch | 4 -- 5 files changed, 55 insertions(+), 28 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 5b5a772542..781248e5bc 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -471,7 +471,7 @@ bool BaseObject::acceptsAlias(ObjectType obj_type) obj_type==OBJ_TABLE || obj_type==OBJ_SCHEMA || obj_type == OBJ_COLUMN || obj_type == OBJ_CONSTRAINT || obj_type == OBJ_INDEX || obj_type == OBJ_RULE || - obj_type == OBJ_TRIGGER || obj_type == OBJ_POLICY); + obj_type == OBJ_TRIGGER); } bool BaseObject::acceptsCustomSQL(void) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index bd244cd1d6..43c62fde30 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -172,25 +172,36 @@ QString Relationship::getNamePattern(unsigned pat_id) return(name_patterns[pat_id]); } -QString Relationship::generateObjectName(unsigned pat_id, Column *id_col) +QString Relationship::generateObjectName(unsigned pat_id, Column *id_col, bool use_alias) { - QString name; + QString name, aux_name; name=name_patterns[pat_id]; name.replace(GEN_TAB_TOKEN, (rel_type==RELATIONSHIP_NN ? tab_name_relnn : QString())); if(rel_type==RELATIONSHIP_NN) { - name.replace(SRC_TAB_TOKEN, src_table->getName()); - name.replace(DST_TAB_TOKEN, dst_table->getName()); + aux_name = use_alias && !src_table->getAlias().isEmpty() ? src_table->getAlias() : src_table->getName(); + name.replace(SRC_TAB_TOKEN, aux_name); + + aux_name = use_alias && !dst_table->getAlias().isEmpty() ? dst_table->getAlias() : dst_table->getName(); + name.replace(DST_TAB_TOKEN, aux_name); } else { - name.replace(SRC_TAB_TOKEN, getReferenceTable()->getName()); - name.replace(DST_TAB_TOKEN, getReceiverTable()->getName()); + aux_name = use_alias && !getReferenceTable()->getAlias().isEmpty() ? getReferenceTable()->getAlias() : getReferenceTable()->getName(); + name.replace(SRC_TAB_TOKEN, aux_name); + + aux_name = use_alias && !getReceiverTable()->getAlias().isEmpty() ? getReceiverTable()->getAlias() : getReceiverTable()->getName(); + name.replace(DST_TAB_TOKEN, aux_name); } - name.replace(SRC_COL_TOKEN, (id_col ? id_col->getName() : QString())); + aux_name.clear(); + + if(id_col) + aux_name = use_alias && !id_col->getAlias().isEmpty() ? id_col->getAlias() : id_col->getName(); + + name.replace(SRC_COL_TOKEN, aux_name); if(name.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) name.remove(BaseObject::OBJECT_NAME_MAX_LENGTH, name.size()); @@ -257,6 +268,7 @@ void Relationship::createSpecialPrimaryKey(void) 2) Use the same tablespace as the receiver table */ pk_special=new Constraint; pk_special->setName(generateObjectName(PK_PATTERN)); + pk_special->setAlias(generateObjectName(PK_PATTERN, nullptr, true)); pk_special->setConstraintType(ConstraintType::primary_key); pk_special->setAddedByLinking(true); pk_special->setProtected(true); @@ -1189,6 +1201,7 @@ void Relationship::configureIndentifierRel(Table *recv_tab) new_pk=true; pk->setName(generateObjectName(PK_PATTERN)); + pk->setAlias(generateObjectName(PK_PATTERN, nullptr, true)); } //Adds the columns from the strong entity primary key on the weak entity primary key @@ -1250,6 +1263,7 @@ void Relationship::addUniqueKey(Table *recv_tab) uq->addColumn(gen_columns[i++], Constraint::SOURCE_COLS); uq->setName(generateObjectName(UQ_PATTERN)); + uq->setAlias(generateObjectName(UQ_PATTERN, nullptr, true)); uq->setName(PgModelerNS::generateUniqueName(uq, (*recv_tab->getObjectList(OBJ_CONSTRAINT)))); recv_tab->addConstraint(uq); } @@ -1271,7 +1285,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del Constraint *pk=nullptr, *pk_aux=nullptr, *fk=nullptr; unsigned i, i1, qty; Column *column=nullptr, *column_aux=nullptr; - QString name, aux; + QString name, aux, fk_alias; try { @@ -1355,20 +1369,29 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del } //Configures the foreign key name - aux.clear(); if(rel_type!=RELATIONSHIP_NN) + { name=generateObjectName(SRC_FK_PATTERN); + fk_alias=generateObjectName(SRC_FK_PATTERN, nullptr, true); + } else { if(ref_tab==src_table) + { name=generateObjectName(SRC_FK_PATTERN); + fk_alias=generateObjectName(SRC_FK_PATTERN, nullptr, true); + } else + { name=generateObjectName(DST_FK_PATTERN); + fk_alias=generateObjectName(DST_FK_PATTERN, nullptr, true); + } } fk->setName(name); + fk->setAlias(fk_alias); fk->setName(PgModelerNS::generateUniqueName(fk, (*recv_tab->getObjectList(OBJ_CONSTRAINT)))); recv_tab->addConstraint(fk); } @@ -1428,7 +1451,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b Constraint *dst_pk=nullptr, *src_pk=nullptr, *pk=nullptr; unsigned i, count; Column *column=nullptr, *column_aux=nullptr; - QString name, prev_name; + QString name, prev_name, col_alias; try { @@ -1466,15 +1489,26 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b prev_name=prev_ref_col_names[column_aux->getObjectId()]; if(rel_type!=RELATIONSHIP_NN) + { name=generateObjectName(SRC_COL_PATTERN, column_aux); + col_alias=generateObjectName(SRC_COL_PATTERN, column_aux, true); + } else { if(ref_tab==src_table && (!isSelfRelationship() || (isSelfRelationship() && !is_dst_table))) + { name=generateObjectName(SRC_COL_PATTERN, column_aux); + col_alias=generateObjectName(SRC_COL_PATTERN, column_aux, true); + } else + { name=generateObjectName(DST_COL_PATTERN, column_aux); + col_alias=generateObjectName(DST_COL_PATTERN, column_aux, true); + } } + column->setAlias(col_alias); + //Protects the column evicting that the user modifies it column->setAddedByLinking(true); @@ -1718,6 +1752,7 @@ void Relationship::addColumnsRelNn(void) { pk_col=new Column; pk_col->setName(generateObjectName(PK_COL_PATTERN)); + pk_col->setAlias(generateObjectName(PK_COL_PATTERN, nullptr, true)); pk_col->setType(PgSQLType(QString("serial"))); pk_col->setAddedByLinking(true); table_relnn->addColumn(pk_col); @@ -1726,6 +1761,7 @@ void Relationship::addColumnsRelNn(void) //Creates the primary key for the n-n relationship table pk_tabnn=new Constraint; pk_tabnn->setName(generateObjectName(PK_PATTERN)); + pk_tabnn->setAlias(generateObjectName(PK_PATTERN, nullptr, true)); pk_tabnn->setConstraintType(ConstraintType::primary_key); pk_tabnn->setAddedByLinking(true); @@ -2191,7 +2227,7 @@ bool Relationship::isInvalidated(void) Constraint *fk=nullptr, *fk1=nullptr, *constr=nullptr, *pk=nullptr; bool valid=false; Column *rel_pk_col=nullptr, *gen_col=nullptr, *pk_col=nullptr; - QString col_name; + QString col_name, col_alias; if(invalidated) { @@ -2262,9 +2298,8 @@ bool Relationship::isInvalidated(void) obtained directly from the primary key */ col_name=generateObjectName(SRC_COL_PATTERN, rel_pk_col); valid=(rel_pk_col==pk_col && - (gen_col->getName()==col_name || - gen_col->getName().contains(pk_col->getName())) && - (rel_pk_col->getType()==gen_col->getType() || + (gen_col->getName()==col_name || gen_col->getName().contains(pk_col->getName())) && + (rel_pk_col->getType()==gen_col->getType() || (rel_pk_col->getType()==QString("serial") && gen_col->getType()==QString("integer")) || (rel_pk_col->getType()==QString("bigserial") && gen_col->getType()==QString("bigint")) || (rel_pk_col->getType()==QString("smallserial") && gen_col->getType()==QString("smallint")))); @@ -2274,8 +2309,7 @@ bool Relationship::isInvalidated(void) /* For copy / generalization relationships, is obtained the number of columns created when connecting it and comparing with the number of columns of the source table */ - else if(rel_type==RELATIONSHIP_DEP || - rel_type==RELATIONSHIP_GEN) + else if(rel_type==RELATIONSHIP_DEP || rel_type==RELATIONSHIP_GEN) { table=getReferenceTable(); table1=getReceiverTable(); @@ -2352,8 +2386,7 @@ bool Relationship::isInvalidated(void) valid=(rel_cols_count == tab_cols_count); - /* Checking if the columns created with the connection still exists - in reference table */ + // Checking if the columns created with the connection still exists in reference table count=fk->getColumnCount(Constraint::SOURCE_COLS); pk=table->getPrimaryKey(); @@ -2362,11 +2395,10 @@ bool Relationship::isInvalidated(void) gen_col=fk->getColumn(i, Constraint::SOURCE_COLS); pk_col=pk->getColumn(i, Constraint::SOURCE_COLS); valid=(gen_col->getName()==generateObjectName(SRC_COL_PATTERN, pk_col) || - gen_col->getName().contains(pk_col->getName())); + gen_col->getName().contains(pk_col->getName())); } - /* Checking if the columns created with the connection still exists - in receiver table */ + // Checking if the columns created with the connection still exists in receiver table count=fk1->getColumnCount(Constraint::SOURCE_COLS); pk=table1->getPrimaryKey(); diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index 86d56a5528..9a25244c5a 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -268,7 +268,7 @@ class Relationship: public BaseRelationship { void removeColumnFromTablePK(Table *table, Column *column); //! \brief Generates the object name according to the specified name pattern - QString generateObjectName(unsigned pat_id, Column *id_col=nullptr); + QString generateObjectName(unsigned pat_id, Column *id_col=nullptr, bool use_alias=false); protected: //! \brief Destroy all the relationship attributes and constraints diff --git a/schemas/xml/dtd/policy.dtd b/schemas/xml/dtd/policy.dtd index eba99706e2..bc5c4d06b3 100644 --- a/schemas/xml/dtd/policy.dtd +++ b/schemas/xml/dtd/policy.dtd @@ -4,7 +4,6 @@ --> - diff --git a/schemas/xml/policy.sch b/schemas/xml/policy.sch index b5d3f2478e..d33cacec7a 100644 --- a/schemas/xml/policy.sch +++ b/schemas/xml/policy.sch @@ -4,10 +4,6 @@ [ Date: Fri, 1 Jun 2018 18:55:00 -0300 Subject: [PATCH 050/425] Added support to alias on view references (WIP) --- libobjrenderer/src/tableobjectview.cpp | 35 +++- libpgmodeler/src/baseobject.cpp | 10 +- libpgmodeler/src/baseobject.h | 2 +- libpgmodeler/src/reference.cpp | 13 ++ libpgmodeler/src/reference.h | 11 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 20 +-- libpgmodeler_ui/src/baseobjectwidget.h | 2 +- libpgmodeler_ui/src/viewwidget.cpp | 11 +- libpgmodeler_ui/ui/baseobjectwidget.ui | 6 +- libpgmodeler_ui/ui/viewwidget.ui | 217 +++++++++++++++-------- 10 files changed, 216 insertions(+), 111 deletions(-) diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 1e72e2d02b..2554055906 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -428,17 +428,27 @@ void TableObjectView::configureObject(Reference reference) { //Configures the name label as: [table].[column] fmt=font_config[ParsersAttributes::REF_TABLE]; - lables[0]->setText(reference.getTable()->getName() + "."); + + if(compact_view && !reference.getReferenceAlias().isEmpty()) + lables[0]->setText(reference.getReferenceAlias()); + else + lables[0]->setText(reference.getTable()->getName() + "."); + lables[0]->setFont(fmt.font()); lables[0]->setBrush(fmt.foreground()); lables[0]->setPos(px, 0); px+=lables[0]->boundingRect().width(); fmt=font_config[ParsersAttributes::REF_COLUMN]; - if(reference.getColumn()) - lables[1]->setText(reference.getColumn()->getName()); + if(compact_view && !reference.getReferenceAlias().isEmpty()) + lables[1]->setText(QString(" ")); else - lables[1]->setText("*"); + { + if(reference.getColumn()) + lables[1]->setText(reference.getColumn()->getName()); + else + lables[1]->setText("*"); + } lables[1]->setFont(fmt.font()); lables[1]->setBrush(fmt.foreground()); @@ -448,10 +458,14 @@ void TableObjectView::configureObject(Reference reference) else { fmt=font_config[ParsersAttributes::REF_TABLE]; + str_aux = compact_view && !reference.getReferenceAlias().isEmpty() ? reference.getReferenceAlias() : QString(); - str_aux=reference.getExpression().simplified().mid(0,25); - if(reference.getExpression().size() > 25) str_aux+=QString("..."); - str_aux.replace(QString("\n"), QString(" ")); + if(str_aux.isEmpty()) + { + str_aux=reference.getExpression().simplified().mid(0,25); + if(reference.getExpression().size() > 25) str_aux+=QString("..."); + str_aux.replace(QString("\n"), QString(" ")); + } lables[0]->setText(str_aux); lables[0]->setFont(fmt.font()); @@ -462,8 +476,9 @@ void TableObjectView::configureObject(Reference reference) } //Configures a label for the alias (if there is one) - if((reference.getColumn() && !reference.getColumnAlias().isEmpty()) || - (!reference.getAlias().isEmpty() && reference.getReferenceType()==Reference::REFER_EXPRESSION)) + if(!compact_view && + ((reference.getColumn() && !reference.getColumnAlias().isEmpty()) || + (!reference.getAlias().isEmpty() && reference.getReferenceType()==Reference::REFER_EXPRESSION))) { if(reference.getReferenceType()==Reference::REFER_EXPRESSION) str_aux=reference.getAlias(); @@ -477,6 +492,8 @@ void TableObjectView::configureObject(Reference reference) lables[2]->setBrush(fmt.foreground()); lables[2]->setPos(px, 0); } + else + lables[2]->setText(QString(" ")); descriptor->setPos(HORIZ_SPACING, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); bounding_rect.setTopLeft(QPointF(descriptor->pos().x(), lables[0]->pos().y())); diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 781248e5bc..3ee3eb12f6 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -361,13 +361,13 @@ void BaseObject::setName(const QString &name) this->obj_name=aux_name; } -void BaseObject::setAlias(const QString &name) +void BaseObject::setAlias(const QString &alias) { - if(name.size() > OBJECT_NAME_MAX_LENGTH) + if(alias.size() > OBJECT_NAME_MAX_LENGTH) throw Exception(ERR_ASG_LONG_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); - this->alias = name; - setCodeInvalidated(this->alias != name); + this->alias = alias; + setCodeInvalidated(this->alias != alias); } void BaseObject::setComment(const QString &comment) @@ -468,7 +468,7 @@ bool BaseObject::acceptsDropCommand(ObjectType obj_type) bool BaseObject::acceptsAlias(ObjectType obj_type) { return(obj_type==OBJ_RELATIONSHIP || obj_type==BASE_RELATIONSHIP || - obj_type==OBJ_TABLE || obj_type==OBJ_SCHEMA || + obj_type==OBJ_TABLE || obj_type==OBJ_SCHEMA || obj_type==OBJ_VIEW || obj_type == OBJ_COLUMN || obj_type == OBJ_CONSTRAINT || obj_type == OBJ_INDEX || obj_type == OBJ_RULE || obj_type == OBJ_TRIGGER); diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index c6f0aae3b8..4d79416824 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -284,7 +284,7 @@ class BaseObject { /*! \brief Defines the object's alias (human readable / friendly name). An alias is used when the database model is being * displayed in compact view. This method raises an error when the provided name is larger than 63 bytes * (the same rule for PostgreSQL names length) */ - virtual void setAlias(const QString &name); + virtual void setAlias(const QString &alias); //! \brief Toggles the object's modify protection virtual void setProtected(bool value); diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 68e3537f57..72aff9c366 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -106,6 +106,19 @@ unsigned Reference::getReferenceType(void) return(REFER_EXPRESSION); } +void Reference::setReferenceAlias(const QString &alias) +{ + if(alias.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) + throw Exception(ERR_ASG_LONG_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + ref_alias = alias; +} + +QString Reference::getReferenceAlias(void) +{ + return(ref_alias); +} + QString Reference::getSQLDefinition(unsigned sql_type) { QString sql_def, tab_name; diff --git a/libpgmodeler/src/reference.h b/libpgmodeler/src/reference.h index 0067a77590..747a2845c0 100644 --- a/libpgmodeler/src/reference.h +++ b/libpgmodeler/src/reference.h @@ -39,10 +39,15 @@ class Reference { //! \brief Stores the expression that defines one reference QString expression, + //! \brief Stores the alias to the expression or table alias, + //! \brief Stores only the alias for the column - column_alias; + column_alias, + + //! \brief Stores the alias for the reference. This text will be displayed when the view is being show in compact mode + ref_alias; //! \brief Indicates if the expression is used as entire view definition bool is_def_expr; @@ -89,6 +94,10 @@ class Reference { //! \brief Returns the reference typ (see REFER_??? constants) unsigned getReferenceType(void); + void setReferenceAlias(const QString &alias); + + QString getReferenceAlias(void); + //! \brief Returns the SQL code definition QString getSQLDefinition(unsigned sql_type); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 95cc3416eb..546d22580e 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -61,8 +61,8 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge tablespace_sel=new ObjectSelectorWidget(OBJ_TABLESPACE, true, this); owner_sel=new ObjectSelectorWidget(OBJ_ROLE, true, this); - logical_name_ht=new HintTextWidget(logical_name_hint, this); - logical_name_ht->setText(logical_name_edt->statusTip()); + alias_ht=new HintTextWidget(alias_hint, this); + alias_ht->setText(alias_edt->statusTip()); baseobject_grid = new QGridLayout; baseobject_grid->setObjectName("objetobase_grid"); @@ -71,8 +71,8 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge baseobject_grid->addWidget(name_edt, 1, 1, 1, 1); baseobject_grid->addWidget(id_ico_wgt, 1, 2, 1, 3); baseobject_grid->addWidget(logical_name_lbl, 2, 0, 1, 1); - baseobject_grid->addWidget(logical_name_edt, 2, 1, 1, 1); - baseobject_grid->addWidget(logical_name_hint_wgt, 2, 2, 1, 3); + baseobject_grid->addWidget(alias_edt, 2, 1, 1, 1); + baseobject_grid->addWidget(alias_hint_wgt, 2, 2, 1, 3); baseobject_grid->addWidget(schema_lbl, 4, 0, 1, 1); baseobject_grid->addWidget(schema_sel, 4, 1, 1, 4); baseobject_grid->addWidget(collation_lbl, 5, 0, 1, 1); @@ -218,7 +218,7 @@ void BaseObjectWidget::configureTabOrder(vector widgets) int idx=0, cnt=0; widgets.insert(widgets.begin(), - { name_edt, logical_name_edt, logical_name_ht, schema_sel , collation_sel, owner_sel, tablespace_sel, + { name_edt, alias_edt, alias_ht, schema_sel , collation_sel, owner_sel, tablespace_sel, comment_edt, append_sql_tb, edt_perms_tb, disable_sql_chk }); for(auto &wgt : widgets) @@ -359,7 +359,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis name_edt->setText(object->getSignature()); comment_edt->setPlainText(object->getComment()); - logical_name_edt->setText(object->getAlias()); + alias_edt->setText(object->getAlias()); /* When creating a new table or relationship the object is pre allocated and the flag new_object is set. In order to avoid the selectors to have empty values, we check if the flag is false which means @@ -437,8 +437,8 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_TAG && obj_type!=OBJ_PARAMETER); - logical_name_edt->setVisible(BaseObject::acceptsAlias(obj_type)); - logical_name_hint_wgt->setVisible(BaseObject::acceptsAlias(obj_type)); + alias_edt->setVisible(BaseObject::acceptsAlias(obj_type)); + alias_hint_wgt->setVisible(BaseObject::acceptsAlias(obj_type)); logical_name_lbl->setVisible(BaseObject::acceptsAlias(obj_type)); edt_perms_tb->setVisible(Permission::acceptsPermission(obj_type)); @@ -745,8 +745,8 @@ void BaseObjectWidget::applyConfiguration(void) object->setName(name_edt->text().trimmed().toUtf8()); } - if(logical_name_edt->isVisible()) - object->setAlias(logical_name_edt->text().trimmed()); + if(alias_edt->isVisible()) + object->setAlias(alias_edt->text().trimmed()); //Sets the object's comment if(comment_edt->isVisible()) diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index dec82d9bd6..9bcef52b06 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -55,7 +55,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { QHBoxLayout *misc_btns_lt; - HintTextWidget *logical_name_ht; + HintTextWidget *alias_ht; //! \brief Store the kind of object being handled by the widget (configured in the constructor) ObjectType handled_obj_type; diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 3c5e087860..9eb8376957 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -76,10 +76,10 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) frame_info=generateInformationFrame(trUtf8("To reference all columns in a table (*) just do not fill the field Column, this is the same as write [schema].[table].*")); - referencias_grid->addWidget(table_sel, 2,1,1,2); - referencias_grid->addWidget(column_sel, 3,1,1,2); - referencias_grid->addWidget(frame_info, 6, 0, 1, 0); - referencias_grid->addWidget(references_tab, 7,0,2,0); + referencias_grid->addWidget(table_sel, 3,1,1,2); + referencias_grid->addWidget(column_sel, 4,1,1,2); + referencias_grid->addWidget(frame_info, 7, 0, 1, 0); + referencias_grid->addWidget(references_tab, 8,0,2,0); //Configuring the table objects that stores the triggers and rules for(unsigned i=0, tab_id=1; i < sizeof(types)/sizeof(ObjectType); i++, tab_id++) @@ -495,6 +495,8 @@ void ViewWidget::handleReference(int ref_idx) ref=Reference(expression_txt->toPlainText(), expr_alias_edt->text().toUtf8()); } + ref.setReferenceAlias(ref_alias_edt->text()); + /* The reference must have an SQL application (be between SELECT-FROM, FROM-WHERE or after WHERE), if the user do not check some of these attributes raises an error */ if(!select_from_chk->isChecked() && !from_where_chk->isChecked() && @@ -532,6 +534,7 @@ void ViewWidget::editReference(int ref_idx) //Get the reference at the selected table row ref=references_tab->getRowData(ref_idx).value(); ref_type_cmb->setCurrentIndex(ref.getReferenceType()); + ref_alias_edt->setText(ref.getReferenceAlias()); if(ref.getReferenceType()==Reference::REFER_COLUMN) { diff --git a/libpgmodeler_ui/ui/baseobjectwidget.ui b/libpgmodeler_ui/ui/baseobjectwidget.ui index f2aa134c57..1d0f66d1a1 100644 --- a/libpgmodeler_ui/ui/baseobjectwidget.ui +++ b/libpgmodeler_ui/ui/baseobjectwidget.ui @@ -508,7 +508,7 @@ This will disable the code of all child and referrer objects. true - + 80 @@ -567,7 +567,7 @@ This will disable the code of all child and referrer objects. Alias: - + 200 @@ -599,7 +599,7 @@ This will disable the code of all child and referrer objects. 0 - + 0 diff --git a/libpgmodeler_ui/ui/viewwidget.ui b/libpgmodeler_ui/ui/viewwidget.ui index 8f2ede6e12..7d4ec588a5 100644 --- a/libpgmodeler_ui/ui/viewwidget.ui +++ b/libpgmodeler_ui/ui/viewwidget.ui @@ -48,8 +48,8 @@ 6 - - + + 100 @@ -57,82 +57,52 @@ - Reference Type: - - - - - - - - Column - - - - - Expression - - - - - - - - Used in: - - - - - - - Table: + Reference alias: - - + + - + 0 0 - - Table Alias: + + + 0 + 0 + - - - - - - - 0 - 0 - + + + 16777215 + 16777215 + + + + This is a more friendly name for the object. When displaying the model in compact view this is the name shown for the object instead of its real name. If this field is empty the real name will be displayed anyway. - - - - - Column: + - - - - - 0 - 0 - + + + + + 100 + 0 + - Column Alias: + Reference type: - + @@ -142,14 +112,14 @@ - + Expression: - + @@ -158,11 +128,11 @@ - Expression Alias: + Expression alias: - + @@ -172,20 +142,7 @@ - - - - Qt::Horizontal - - - - 40 - 20 - - - - - + @@ -288,6 +245,112 @@ + + + + + Column + + + + + Expression + + + + + + + + Used in: + + + + + + + Table: + + + + + + + + 0 + 0 + + + + Table alias: + + + + + + + + 0 + 0 + + + + + + + + Column: + + + + + + + + 0 + 0 + + + + Column alias: + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + From 8f984272e7526be77a82e13922d3057d99aa4f11 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 2 Jun 2018 21:18:55 -0300 Subject: [PATCH 051/425] Improved the model loading from file by blocking signals of relationships avoiding excessive/repetive rendering of objects. They whole model is fully rendered when the file was completely loaded --- libobjrenderer/src/tableobjectview.cpp | 2 +- libpgmodeler/src/baserelationship.cpp | 17 ++++++++------- libpgmodeler/src/databasemodel.cpp | 29 +++++++++++++++++++++----- libpgmodeler_ui/src/mainwindow.cpp | 13 +++++++++++- 4 files changed, 47 insertions(+), 14 deletions(-) diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 2554055906..0d60669e2a 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -441,7 +441,7 @@ void TableObjectView::configureObject(Reference reference) fmt=font_config[ParsersAttributes::REF_COLUMN]; if(compact_view && !reference.getReferenceAlias().isEmpty()) - lables[1]->setText(QString(" ")); + lables[1]->setText(QString()); else { if(reference.getColumn()) diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 45d88161f0..325df69657 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -263,17 +263,20 @@ void BaseRelationship::setConnected(bool value) { connected=value; - src_table->setModified(true); + if(!this->signalsBlocked()) + { + src_table->setModified(true); - if(dst_table!=src_table) - dst_table->setModified(true); + if(dst_table!=src_table) + dst_table->setModified(true); - dynamic_cast(src_table->getSchema())->setModified(true); + dynamic_cast(src_table->getSchema())->setModified(true); - if(dst_table->getSchema()!=src_table->getSchema()) - dynamic_cast(dst_table->getSchema())->setModified(true); + if(dst_table->getSchema()!=src_table->getSchema()) + dynamic_cast(dst_table->getSchema())->setModified(true); - this->setModified(true); + this->setModified(true); + } } void BaseRelationship::disconnectRelationship(void) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index ca074df9d8..4cbc23df63 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1130,7 +1130,7 @@ void DatabaseModel::updateTableFKRelationships(Table *table) } else { - rel->setModified(true); + rel->setModified(!loading_model); itr1++; idx++; } } @@ -1284,6 +1284,7 @@ void DatabaseModel::disconnectRelationships(void) { base_rel=dynamic_cast(*ritr_rel); ritr_rel++; + base_rel->blockSignals(loading_model); if(base_rel->getObjectType()==OBJ_RELATIONSHIP) { @@ -1292,6 +1293,8 @@ void DatabaseModel::disconnectRelationships(void) } else base_rel->disconnectRelationship(); + + base_rel->blockSignals(false); } } catch(Exception &e) @@ -1542,11 +1545,14 @@ void DatabaseModel::validateRelationships(void) //The validation continues until there is some invalid relationship while(found_inval_rel); - //Updates the schemas to ajdust its sizes due to the tables resizings - while(!schemas.empty()) + if(!loading_model) { - schemas.back()->setModified(true); - schemas.pop_back(); + //Updates the schemas to ajdust its sizes due to the tables resizings + while(!schemas.empty()) + { + schemas.back()->setModified(true); + schemas.pop_back(); + } } //Stores the errors related to creation of special objects on the general error vector @@ -1964,6 +1970,7 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) if(rel->getObjectType()==OBJ_RELATIONSHIP) checkRelationshipRedundancy(dynamic_cast(rel)); + rel->blockSignals(loading_model); __addObject(rel, obj_idx); if(rel->getObjectType()==OBJ_RELATIONSHIP) @@ -1973,6 +1980,8 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) } else rel->connectRelationship(); + + rel->blockSignals(false); } catch(Exception &e) { @@ -2000,7 +2009,9 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) } else if(rel->getObjectType()==BASE_RELATIONSHIP) { + rel->blockSignals(loading_model); rel->disconnectRelationship(); + rel->blockSignals(false); } __removeObject(rel, obj_idx); @@ -3079,6 +3090,8 @@ void DatabaseModel::loadModel(const QString &filename) } this->setInvalidated(false); + + emit s_objectLoaded(100, trUtf8("Validating relationships..."), OBJ_RELATIONSHIP); this->setObjectsModified({OBJ_RELATIONSHIP, BASE_RELATIONSHIP}); //Doing another relationship validation when there are inheritances to avoid incomplete tables @@ -6132,7 +6145,9 @@ BaseRelationship *DatabaseModel::createRelationship(void) .arg(BaseObject::getTypeName(BASE_RELATIONSHIP)), ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + base_rel->blockSignals(loading_model); base_rel->disconnectRelationship(); + base_rel->blockSignals(false); } else { @@ -6283,7 +6298,11 @@ BaseRelationship *DatabaseModel::createRelationship(void) /* If the FK relationship does not reference a foreign key (models generated in older versions) * we need to assign them to the respective relationships */ if(base_rel && base_rel->getObjectType()==BASE_RELATIONSHIP) + { + base_rel->blockSignals(loading_model); base_rel->connectRelationship(); + base_rel->blockSignals(false); + } if(base_rel && base_rel->getRelationshipType() == BaseRelationship::RELATIONSHIP_FK && diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index ee50757aca..ecd5ba70fa 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -500,6 +500,8 @@ void MainWindow::restoreLastSession(void) { try { + qApp->setOverrideCursor(Qt::WaitCursor); + while(!prev_session_files.isEmpty()) { this->addModel(prev_session_files.front()); @@ -508,9 +510,11 @@ void MainWindow::restoreLastSession(void) action_restore_session->setEnabled(false); central_wgt->last_session_tb->setEnabled(false); + qApp->restoreOverrideCursor(); } catch(Exception &e) { + qApp->restoreOverrideCursor(); Messagebox msg_box; msg_box.show(e); } @@ -796,12 +800,15 @@ void MainWindow::loadModelFromAction(void) try { + qApp->setOverrideCursor(Qt::WaitCursor); addModel(filename); recent_models.push_back(act->data().toString()); updateRecentModelsMenu(); + qApp->restoreOverrideCursor(); } catch(Exception &e) { + qApp->restoreOverrideCursor(); if(QFileInfo(filename).exists()) showFixMessage(e, filename); else @@ -1561,16 +1568,20 @@ void MainWindow::loadModels(const QStringList &list) try { + qApp->setOverrideCursor(Qt::WaitCursor); + for(i=0; i < list.count(); i++) { addModel(list[i]); recent_models.push_front(list[i]); } - updateRecentModelsMenu(); + updateRecentModelsMenu(); + qApp->restoreOverrideCursor(); } catch(Exception &e) { + qApp->restoreOverrideCursor(); showFixMessage(e, list[i]); } } From d9bec5429a5b02ffa729470beb865ab93e6f372c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 2 Jun 2018 22:01:39 -0300 Subject: [PATCH 052/425] View references now have full support to aliases for compact view integration --- libobjrenderer/src/tableobjectview.cpp | 4 ++-- libparsers/src/parsersattributes.cpp | 1 + libparsers/src/parsersattributes.h | 1 + libpgmodeler/src/databasemodel.cpp | 14 ++++++++++---- libpgmodeler/src/reference.cpp | 1 + schemas/xml/dtd/view.dtd | 1 + schemas/xml/reference.sch | 4 ++++ 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 0d60669e2a..3154109424 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -441,7 +441,7 @@ void TableObjectView::configureObject(Reference reference) fmt=font_config[ParsersAttributes::REF_COLUMN]; if(compact_view && !reference.getReferenceAlias().isEmpty()) - lables[1]->setText(QString()); + lables[1]->setText(QString(" ")); else { if(reference.getColumn()) @@ -493,7 +493,7 @@ void TableObjectView::configureObject(Reference reference) lables[2]->setPos(px, 0); } else - lables[2]->setText(QString(" ")); + lables[2]->setText(QString()); descriptor->setPos(HORIZ_SPACING, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); bounding_rect.setTopLeft(QPointF(descriptor->pos().x(), lables[0]->pos().y())); diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 7c65072861..5d248aef17 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -389,6 +389,7 @@ namespace ParsersAttributes { RECURSIVE=QString("recursive"), RECV_FUNC=QString("receive"), REDUCED_FORM=QString("reduced-form"), + REF_ALIAS=QString("ref-alias"), REF_COLUMN=QString("ref-column"), REF_ROLES=QString("ref-roles"), REF_TABLE=QString("ref-table"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 9a98c7c96c..5e9d3f9a29 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -404,6 +404,7 @@ namespace ParsersAttributes { RECURSIVE, RECV_FUNC, REDUCED_FORM, + REF_ALIAS, REF_COLUMN, REF_ROLES, REF_TABLE, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 4cbc23df63..e49e71e04e 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -5728,6 +5728,7 @@ View *DatabaseModel::createView(void) unsigned type; int ref_idx, i, count; bool refs_in_expr=false; + Reference reference; try { @@ -5793,9 +5794,11 @@ View *DatabaseModel::createView(void) } //Adds the configured reference to a temporarily list - refs.push_back(Reference(table, column, - attribs[ParsersAttributes::ALIAS], - attribs[ParsersAttributes::COLUMN_ALIAS])); + reference = Reference(table, column, + attribs[ParsersAttributes::ALIAS], + attribs[ParsersAttributes::COLUMN_ALIAS]); + reference.setReferenceAlias(attribs[ParsersAttributes::REF_ALIAS]); + refs.push_back(reference); } else { @@ -5804,7 +5807,10 @@ View *DatabaseModel::createView(void) xmlparser.accessElement(XMLParser::CHILD_ELEMENT); xmlparser.accessElement(XMLParser::CHILD_ELEMENT); - refs.push_back(Reference(xmlparser.getElementContent(),str_aux)); + + reference = Reference(xmlparser.getElementContent(),str_aux); + reference.setReferenceAlias(attribs[ParsersAttributes::REF_ALIAS]); + refs.push_back(reference); xmlparser.restorePosition(); } diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 72aff9c366..ba2ebbbcb1 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -226,6 +226,7 @@ QString Reference::getXMLDefinition(void) if(column) attribs[ParsersAttributes::COLUMN]=column->getName(); + attribs[ParsersAttributes::REF_ALIAS]=ref_alias; attribs[ParsersAttributes::EXPRESSION]=expression; attribs[ParsersAttributes::ALIAS]=alias; attribs[ParsersAttributes::COLUMN_ALIAS]=column_alias; diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 9d7f02ea66..3bb34066ba 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -14,6 +14,7 @@ + diff --git a/schemas/xml/reference.sch b/schemas/xml/reference.sch index d55713d37b..c8756fd63a 100644 --- a/schemas/xml/reference.sch +++ b/schemas/xml/reference.sch @@ -3,6 +3,10 @@ # Code generation can be broken if incorrect changes are made. $tb Date: Mon, 4 Jun 2018 15:39:14 -0300 Subject: [PATCH 053/425] Fixed a bug that was not quoting extension name when needed (issue #249) --- libpgmodeler/src/extension.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index d4ef4246b3..2968e65ffe 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -85,11 +85,11 @@ QString Extension::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::NAME]=this->getName(true, false); + attributes[ParsersAttributes::NAME]=this->getName(def_type==SchemaParser::SQL_DEFINITION, false); attributes[ParsersAttributes::HANDLES_TYPE]=(handles_type ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::CUR_VERSION]=versions[CUR_VERSION]; attributes[ParsersAttributes::OLD_VERSION]=versions[OLD_VERSION]; - attributes[ParsersAttributes::NAME]=this->getName(def_type==SchemaParser::SQL_DEFINITION, false); + return(BaseObject::__getCodeDefinition(def_type)); } @@ -119,7 +119,7 @@ QString Extension::getAlterDefinition(BaseObject *object) QString Extension::getDropDefinition(bool cascade) { - attributes[ParsersAttributes::NAME] = this->getName(); + attributes[ParsersAttributes::NAME] = this->getName(true); return(BaseObject::getDropDefinition(cascade)); } From b351dc4919625e9ae81dbf5d837bc762e57fb738 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 6 Jun 2018 16:56:43 -0300 Subject: [PATCH 054/425] Refactored the view editing dialog by moving the references handling form to a dedicated modal dialog Minor fix in HintTextWidget to stay on top of all widget when being displayed --- conf/defaults/sql-highlight.conf | 15 +- conf/sql-highlight.conf | 15 +- libobjrenderer/src/baseobjectview.cpp | 7 +- libobjrenderer/src/baseobjectview.h | 4 +- libpgmodeler/src/reference.cpp | 2 +- libpgmodeler/src/reference.h | 10 +- libpgmodeler_ui/libpgmodeler_ui.pro | 9 +- libpgmodeler_ui/src/baseform.cpp | 2 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 2 + libpgmodeler_ui/src/hinttextwidget.cpp | 6 + libpgmodeler_ui/src/hinttextwidget.h | 2 + libpgmodeler_ui/src/mainwindow.cpp | 2 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 1 + libpgmodeler_ui/src/referencewidget.cpp | 171 ++++++++ libpgmodeler_ui/src/referencewidget.h | 67 +++ libpgmodeler_ui/src/viewwidget.cpp | 272 ++++--------- libpgmodeler_ui/src/viewwidget.h | 31 +- libpgmodeler_ui/ui/referencewidget.ui | 427 ++++++++++++++++++++ libpgmodeler_ui/ui/viewwidget.ui | 322 +-------------- libutils/src/exception.cpp | 2 +- 20 files changed, 803 insertions(+), 566 deletions(-) create mode 100644 libpgmodeler_ui/src/referencewidget.cpp create mode 100644 libpgmodeler_ui/src/referencewidget.h create mode 100644 libpgmodeler_ui/ui/referencewidget.ui diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index b02abf0314..23f10f06d4 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -9,7 +9,7 @@ --> - + @@ -17,7 +17,6 @@ - @@ -85,19 +84,13 @@ - + - - - - + @@ -351,6 +344,7 @@ + @@ -389,6 +383,7 @@ + - + @@ -17,7 +17,6 @@ - @@ -85,19 +84,13 @@ - + - - - - + @@ -351,6 +344,7 @@ + @@ -389,6 +383,7 @@ + setMinimumSize(min_size); this->resize(curr_w, curr_h); + this->adjustSize(); } void BaseForm::closeEvent(QCloseEvent *) @@ -136,7 +137,6 @@ void BaseForm::setMainWidget(BaseObjectWidget *widget) setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); connect(cancel_btn, SIGNAL(clicked(bool)), this, SLOT(reject())); - //connect(this, SIGNAL(rejected()), widget, SLOT(cancelConfiguration())); connect(apply_ok_btn, SIGNAL(clicked(bool)), widget, SLOT(applyConfiguration())); connect(widget, SIGNAL(s_closeRequested()), this, SLOT(accept())); } diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index b9dada0f9d..c6c4406c9a 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -459,6 +459,8 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_ARGS]=source_editor_args_edt->text(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]=ui_language_cmb->currentData().toString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]=(BaseObjectView::isCompactViewEnabled() ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); diff --git a/libpgmodeler_ui/src/hinttextwidget.cpp b/libpgmodeler_ui/src/hinttextwidget.cpp index 2ff0e363ba..ad689fd2d8 100644 --- a/libpgmodeler_ui/src/hinttextwidget.cpp +++ b/libpgmodeler_ui/src/hinttextwidget.cpp @@ -140,3 +140,9 @@ bool HintTextWidget::eventFilter(QObject *object, QEvent *event) return(QWidget::eventFilter(object, event)); } + +void HintTextWidget::showEvent(QShowEvent *) +{ + this->activateWindow(); + this->raise(); +} diff --git a/libpgmodeler_ui/src/hinttextwidget.h b/libpgmodeler_ui/src/hinttextwidget.h index d49c5bf8b8..0bdd09e51e 100644 --- a/libpgmodeler_ui/src/hinttextwidget.h +++ b/libpgmodeler_ui/src/hinttextwidget.h @@ -41,6 +41,8 @@ class HintTextWidget: public QWidget, public Ui::HintTextWidget { bool eventFilter(QObject *object, QEvent *event); + void showEvent(QShowEvent *); + public: const static unsigned SMALL_ICON=16, MEDIUM_ICON=24, diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index ecd5ba70fa..5cdafa4ef9 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1990,7 +1990,7 @@ void MainWindow::toggleCompactView(void) { ModelWidget *model_wgt = nullptr; - BaseObjectView::setCompactViewMode(action_compact_view->isChecked()); + BaseObjectView::setCompactViewEnabled(action_compact_view->isChecked()); QApplication::setOverrideCursor(Qt::WaitCursor); for(int idx = 0; idx < models_tbw->count(); idx++) diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 15730cb3c8..0abaf0ecfb 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -322,6 +322,7 @@ namespace PgModelerUiNS { widget->setMinimumSize(widget->minimumSize()); widget->resize(curr_w, curr_h); + widget->adjustSize(); } void bulkDataEdit(QTableWidget *results_tbw) diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp new file mode 100644 index 0000000000..121f57a969 --- /dev/null +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -0,0 +1,171 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "referencewidget.h" +#include "baseobjectwidget.h" + +ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) +{ + setupUi(this); + + ref_alias_ht=new HintTextWidget(ref_alias_hint, this); + ref_alias_ht->setText(ref_alias_edt->statusTip()); + + used_in_ht=new HintTextWidget(used_in_hint, this); + used_in_ht->setText(select_from_chk->statusTip()); + + ref_object_ht=new HintTextWidget(ref_object_hint, this); + ref_object_ht->setText(trUtf8("To reference all columns of a table select only a table in the object selector, this is the same as write [schema].[table].*. In order to reference a only a single column of a table select a column object in the selector.")); + + expression_txt=new NumberedTextEditor(this, true); + expression_hl=new SyntaxHighlighter(expression_txt, false, true); + expression_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + + ref_object_sel=new ObjectSelectorWidget({ OBJ_TABLE, OBJ_COLUMN }, true, this); + ref_object_sel->enableObjectCreation(false); + expression_cp=new CodeCompletionWidget(expression_txt, true); + + reference_grid->addWidget(ref_object_sel, 3, 1, 1, 3); + reference_grid->addWidget(expression_txt, 5, 1, 1, 4); + + selectReferenceType(); + setMinimumSize(630, 380); + + connect(view_def_chk, SIGNAL(toggled(bool)), select_from_chk, SLOT(setDisabled(bool))); + connect(view_def_chk, SIGNAL(toggled(bool)), from_where_chk, SLOT(setDisabled(bool))); + connect(view_def_chk, SIGNAL(toggled(bool)), after_where_chk, SLOT(setDisabled(bool))); + connect(view_def_chk, SIGNAL(toggled(bool)), end_expr_chk, SLOT(setDisabled(bool))); + connect(ref_type_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(selectReferenceType(void))); + + connect(ref_object_sel, &ObjectSelectorWidget::s_objectSelected, [&](){ + col_alias_edt->setEnabled(dynamic_cast(ref_object_sel->getSelectedObject())); + }); + + connect(ref_object_sel, &ObjectSelectorWidget::s_selectorCleared, [&](){ + col_alias_edt->setEnabled(false); + }); +} + +void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseModel *model) +{ + this->ref_flags = ref_flags; + this->reference = ref; + + expression_cp->configureCompletion(model, expression_hl); + ref_object_sel->setModel(model); + + ref_type_cmb->setCurrentIndex(ref.getReferenceType()); + ref_alias_edt->setText(ref.getReferenceAlias()); + + if(ref.getReferenceType()==Reference::REFER_COLUMN) + { + if(ref.getColumn()) + ref_object_sel->setSelectedObject(ref.getColumn()); + else + ref_object_sel->setSelectedObject(ref.getTable()); + + tab_alias_edt->setText(ref.getAlias()); + col_alias_edt->setText(ref.getColumnAlias()); + } + else + { + expression_txt->setPlainText(ref.getExpression()); + expr_alias_edt->setText(ref.getAlias()); + } + + if(ref_flags == Reference::SQL_VIEW_DEFINITION) + view_def_chk->setChecked(true); + else + { + select_from_chk->setChecked((ref_flags & Reference::SQL_REFER_SELECT) == Reference::SQL_REFER_SELECT); + from_where_chk->setChecked((ref_flags & Reference::SQL_REFER_FROM) == Reference::SQL_REFER_FROM); + after_where_chk->setChecked((ref_flags & Reference::SQL_REFER_WHERE) == Reference::SQL_REFER_WHERE); + end_expr_chk->setChecked((ref_flags & Reference::SQL_REFER_END_EXPR) == Reference::SQL_REFER_END_EXPR); + } +} + +Reference ReferenceWidget::getReference(void) +{ + return(reference); +} + +unsigned ReferenceWidget::getReferenceFlags(void) +{ + return(ref_flags); +} + +void ReferenceWidget::applyConfiguration(void) +{ + try + { + //Creating a reference to a column + if(static_cast(ref_type_cmb->currentIndex())==Reference::REFER_COLUMN) + { + Column *column = dynamic_cast(ref_object_sel->getSelectedObject()); + Table *table = (column ? dynamic_cast
(column->getParentTable()) : + dynamic_cast
(ref_object_sel->getSelectedObject())); + reference = Reference(table, column, tab_alias_edt->text(), col_alias_edt->text()); + } + //Creating a reference to an expression + else + reference = Reference(expression_txt->toPlainText(), expr_alias_edt->text().toUtf8()); + + reference.setReferenceAlias(ref_alias_edt->text()); + + /* The reference must have an SQL application (be between SELECT-FROM, FROM-WHERE or after WHERE), + if the user do not check some of these attributes raises an error */ + if(!select_from_chk->isChecked() && !from_where_chk->isChecked() && + !after_where_chk->isChecked() && !end_expr_chk->isChecked() && + !view_def_chk->isChecked()) + throw Exception(ERR_SQL_SCOPE_INV_VIEW_REF,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + if(view_def_chk->isChecked()) + ref_flags = Reference::SQL_VIEW_DEFINITION; + + if(select_from_chk->isChecked()) + ref_flags |= Reference::SQL_REFER_SELECT; + + if(from_where_chk->isChecked()) + ref_flags |= Reference::SQL_REFER_FROM; + + if(after_where_chk->isChecked()) + ref_flags |= Reference::SQL_REFER_WHERE; + + if(end_expr_chk->isChecked()) + ref_flags |= Reference::SQL_REFER_WHERE; + + emit s_closeRequested(); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void ReferenceWidget::selectReferenceType(void) +{ + //Marks if the select reference type treats a reference to an object + bool ref_obj=(ref_type_cmb->currentIndex()==static_cast(Reference::REFER_COLUMN)); + ref_object_sel->setEnabled(ref_obj); + tab_alias_edt->setEnabled(ref_obj); + col_alias_edt->setEnabled(ref_obj); + view_def_chk->setChecked(false); + expression_txt->setEnabled(!ref_obj); + expr_alias_edt->setEnabled(!ref_obj); + view_def_chk->setVisible(!ref_obj); +} diff --git a/libpgmodeler_ui/src/referencewidget.h b/libpgmodeler_ui/src/referencewidget.h new file mode 100644 index 0000000000..8ef7ccf4a6 --- /dev/null +++ b/libpgmodeler_ui/src/referencewidget.h @@ -0,0 +1,67 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#ifndef REFERENCE_WIDGET_H +#define REFERENCE_WIDGET_H + +#include +#include "ui_referencewidget.h" +#include "numberedtexteditor.h" +#include "syntaxhighlighter.h" +#include "codecompletionwidget.h" +#include "objectselectorwidget.h" +#include "hinttextwidget.h" + +class ReferenceWidget : public QWidget, Ui::ReferenceWidget { + private: + Q_OBJECT + + HintTextWidget *ref_alias_ht, *used_in_ht, *ref_object_ht; + + NumberedTextEditor *expression_txt; + + SyntaxHighlighter *expression_hl; + + CodeCompletionWidget *expression_cp; + + ObjectSelectorWidget *ref_object_sel; + + unsigned ref_flags; + + Reference reference; + + public: + explicit ReferenceWidget(QWidget *parent = 0); + + void setAttributes(Reference ref, unsigned ref_flags, DatabaseModel *model); + + Reference getReference(void); + + unsigned getReferenceFlags(void); + + public slots: + void applyConfiguration(void); + + private slots: + void selectReferenceType(void); + + signals: + void s_closeRequested(void); +}; + +#endif diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 9eb8376957..2d4c135b1b 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -21,6 +21,7 @@ #include "triggerwidget.h" #include "indexwidget.h" #include "baseform.h" +#include "referencewidget.h" ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) { @@ -36,11 +37,6 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) Ui_ViewWidget::setupUi(this); - expression_txt=new NumberedTextEditor(this, true); - expression_hl=new SyntaxHighlighter(expression_txt, false, true); - expression_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); - referencias_grid->addWidget(expression_txt, 4, 1, 1, 4); - code_txt=new NumberedTextEditor(this); code_txt->setReadOnly(true); code_hl=new SyntaxHighlighter(code_txt); @@ -59,27 +55,19 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) tag_sel=new ObjectSelectorWidget(OBJ_TAG, false, this); dynamic_cast(options_gb->layout())->addWidget(tag_sel, 0, 1, 1, 4); - table_sel=new ObjectSelectorWidget(OBJ_TABLE, true, this); - table_sel->enableObjectCreation(false); - column_sel=new ObjectSelectorWidget(OBJ_COLUMN, true, this); - column_sel->enableObjectCreation(false); + references_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::UPDATE_BUTTON, true, this); + references_tab->setColumnCount(5); + references_tab->setHeaderLabel(trUtf8("Col./Expr."), 0); + references_tab->setHeaderLabel(trUtf8("Table alias"), 1); + references_tab->setHeaderLabel(trUtf8("Column alias"), 2); + references_tab->setHeaderLabel(trUtf8("Flags: SF FW AW EX VD"), 3); + references_tab->setHeaderLabel(trUtf8("Reference alias"), 4); - references_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS, true, this); - references_tab->setColumnCount(4); - references_tab->setHeaderLabel(trUtf8("Col./Expr."),0); - references_tab->setHeaderLabel(trUtf8("Alias"),1); - references_tab->setHeaderLabel(trUtf8("Alias Col."),2); - references_tab->setHeaderLabel(trUtf8("Flags: SF FW AW EX VD"),3); + vbox=new QVBoxLayout(tabWidget->widget(0)); + vbox->setContentsMargins(4,4,4,4); + vbox->addWidget(references_tab); cte_expression_cp=new CodeCompletionWidget(cte_expression_txt, true); - expression_cp=new CodeCompletionWidget(expression_txt, true); - - frame_info=generateInformationFrame(trUtf8("To reference all columns in a table (*) just do not fill the field Column, this is the same as write [schema].[table].*")); - - referencias_grid->addWidget(table_sel, 3,1,1,2); - referencias_grid->addWidget(column_sel, 4,1,1,2); - referencias_grid->addWidget(frame_info, 7, 0, 1, 0); - referencias_grid->addWidget(references_tab, 8,0,2,0); //Configuring the table objects that stores the triggers and rules for(unsigned i=0, tab_id=1; i < sizeof(types)/sizeof(ObjectType); i++, tab_id++) @@ -132,20 +120,10 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) view_grid->addWidget(frame, view_grid->count()+1, 0, 1,3); frame->setParent(this); - connect(ref_type_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(selectReferenceType(void))); - connect(column_sel, SIGNAL(s_objectSelected(void)), this, SLOT(showObjectName(void))); - connect(column_sel, SIGNAL(s_selectorCleared(void)), this, SLOT(showObjectName(void))); - connect(table_sel, SIGNAL(s_objectSelected(void)), this, SLOT(showObjectName(void))); - connect(references_tab, SIGNAL(s_rowAdded(int)), this, SLOT(handleReference(int))); - connect(references_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(handleReference(int))); + connect(references_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addReference(int))); connect(references_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editReference(int))); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateCodePreview(void))); - connect(view_def_chk, SIGNAL(toggled(bool)), select_from_chk, SLOT(setDisabled(bool))); - connect(view_def_chk, SIGNAL(toggled(bool)), from_where_chk, SLOT(setDisabled(bool))); - connect(view_def_chk, SIGNAL(toggled(bool)), after_where_chk, SLOT(setDisabled(bool))); - connect(view_def_chk, SIGNAL(toggled(bool)), expr_alias_edt, SLOT(setDisabled(bool))); - connect(view_def_chk, SIGNAL(toggled(bool)), expr_alias_lbl, SLOT(setDisabled(bool))); connect(materialized_rb, SIGNAL(toggled(bool)), with_no_data_chk, SLOT(setEnabled(bool))); connect(materialized_rb, SIGNAL(toggled(bool)), tablespace_sel, SLOT(setEnabled(bool))); connect(materialized_rb, SIGNAL(toggled(bool)), tablespace_lbl, SLOT(setEnabled(bool))); @@ -158,13 +136,8 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) connect(schema_sel, SIGNAL(s_objectSelected(void)), this, SLOT(updateCodePreview(void))); connect(schema_sel, SIGNAL(s_selectorCleared(void)), this, SLOT(updateCodePreview(void))); - selectReferenceType(); - - configureTabOrder({ tag_sel, ordinary_rb, recursive_rb, with_no_data_chk, tabWidget, - ref_type_cmb, select_from_chk, from_where_chk, after_where_chk, - table_sel, tab_alias_edt, column_sel, col_alias_edt }); - - setMinimumSize(600, 730); + configureTabOrder({ tag_sel, ordinary_rb, recursive_rb, with_no_data_chk, tabWidget }); + setMinimumSize(600, 650); } catch(Exception &e) { @@ -176,8 +149,8 @@ ObjectsTableWidget *ViewWidget::getObjectTable(ObjectType obj_type) { if(objects_tab_map.count(obj_type) > 0) return(objects_tab_map[obj_type]); - else - return(nullptr); + + return(nullptr); } template @@ -306,6 +279,11 @@ void ViewWidget::removeObjects(void) } } +void ViewWidget::addReference(int row) +{ + openReferenceForm(Reference(), row, false); +} + void ViewWidget::removeObject(int row) { View *view=nullptr; @@ -440,161 +418,67 @@ void ViewWidget::listObjects(ObjectType obj_type) } } -void ViewWidget::clearReferenceForm(void) -{ - column_sel->clearSelector(); - table_sel->clearSelector(); - col_alias_edt->clear(); - expr_alias_edt->clear(); - tab_alias_edt->clear(); - expression_txt->clear(); - select_from_chk->setChecked(false); - from_where_chk->setChecked(false); - after_where_chk->setChecked(false); -} - -void ViewWidget::selectReferenceType(void) -{ - //Marks if the select reference type treats a reference to an object - bool ref_obj=(ref_type_cmb->currentIndex()==static_cast(Reference::REFER_COLUMN)); - - table_lbl->setVisible(ref_obj); - column_lbl->setVisible(ref_obj); - table_sel->setVisible(ref_obj); - column_sel->setVisible(ref_obj); - col_alias_lbl->setVisible(ref_obj); - col_alias_edt->setVisible(ref_obj); - tab_alias_edt->setVisible(ref_obj); - tab_alias_lbl->setVisible(ref_obj); - frame_info->setVisible(ref_obj); - - view_def_chk->setChecked(false); - expression_lbl->setVisible(!ref_obj); - expression_txt->setVisible(!ref_obj); - expr_alias_edt->setVisible(!ref_obj); - expr_alias_lbl->setVisible(!ref_obj); - view_def_chk->setVisible(!ref_obj); -} - -void ViewWidget::handleReference(int ref_idx) +int ViewWidget::openReferenceForm(Reference ref, int row, bool update) { - try - { - Reference ref; - - //Creating a reference to a column - if(static_cast(ref_type_cmb->currentIndex())==Reference::REFER_COLUMN) - { - ref=Reference(dynamic_cast
(table_sel->getSelectedObject()), - dynamic_cast(column_sel->getSelectedObject()), - tab_alias_edt->text().toUtf8(), col_alias_edt->text().toUtf8()); - } - //Creating a reference to an expression - else - { - ref=Reference(expression_txt->toPlainText(), expr_alias_edt->text().toUtf8()); - } - - ref.setReferenceAlias(ref_alias_edt->text()); + BaseForm editing_form(this); + ReferenceWidget *ref_wgt=new ReferenceWidget; + unsigned ref_flags = 0; + int result = 0; + QString str_aux; - /* The reference must have an SQL application (be between SELECT-FROM, FROM-WHERE or after WHERE), - if the user do not check some of these attributes raises an error */ - if(!select_from_chk->isChecked() && !from_where_chk->isChecked() && - !after_where_chk->isChecked() && !end_expr_chk->isChecked() && - !view_def_chk->isChecked()) - throw Exception(ERR_SQL_SCOPE_INV_VIEW_REF,__PRETTY_FUNCTION__,__FILE__,__LINE__); + editing_form.setMainWidget(ref_wgt); + editing_form.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); - if(view_def_chk->isChecked()) - { - select_from_chk->setChecked(false); - from_where_chk->setChecked(false); - after_where_chk->setChecked(false); - } + disconnect(editing_form.apply_ok_btn, SIGNAL(clicked(bool)), &editing_form, SLOT(accept())); + connect(editing_form.apply_ok_btn, SIGNAL(clicked(bool)), ref_wgt, SLOT(applyConfiguration())); + connect(ref_wgt, SIGNAL(s_closeRequested()), &editing_form, SLOT(accept())); - showReferenceData(ref, select_from_chk->isChecked(), from_where_chk->isChecked(), - after_where_chk->isChecked(), end_expr_chk->isChecked(), view_def_chk->isChecked() ,ref_idx); + str_aux = references_tab->getCellText(references_tab->getSelectedRow(), 3); - clearReferenceForm(); - references_tab->clearSelection(); - } - catch(Exception &e) + if(str_aux[4] == '1') + ref_flags = Reference::SQL_VIEW_DEFINITION; + else { - if(references_tab->getCellText(ref_idx, 0).isEmpty()) - references_tab->removeRow(ref_idx); + if(str_aux[0] == '1') + ref_flags |= Reference::SQL_REFER_SELECT; - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } -} + if(str_aux[1] == '1') + ref_flags |= Reference::SQL_REFER_FROM; -void ViewWidget::editReference(int ref_idx) -{ - Reference ref; - QString str_aux; + if(str_aux[2] == '1') + ref_flags |= Reference::SQL_REFER_WHERE; - //Get the reference at the selected table row - ref=references_tab->getRowData(ref_idx).value(); - ref_type_cmb->setCurrentIndex(ref.getReferenceType()); - ref_alias_edt->setText(ref.getReferenceAlias()); + if(str_aux[3] == '1') + ref_flags |= Reference::SQL_REFER_END_EXPR; + } - if(ref.getReferenceType()==Reference::REFER_COLUMN) - { - if(ref.getColumn()) - column_sel->setSelectedObject(ref.getColumn()); - else - table_sel->setSelectedObject(ref.getTable()); + ref_wgt->setAttributes(ref, ref_flags, model); + result = editing_form.exec(); + disconnect(ref_wgt, nullptr, &editing_form, nullptr); - col_alias_edt->setText(ref.getColumnAlias()); - tab_alias_edt->setText(ref.getAlias()); - } - else - { - expression_txt->setPlainText(ref.getExpression()); - expr_alias_edt->setText(ref.getAlias()); - } + if(result == QDialog::Accepted) + showReferenceData(ref_wgt->getReference(), ref_wgt->getReferenceFlags(), row); + else if(!update) + references_tab->removeRow(row); - str_aux=references_tab->getCellText(ref_idx,3); - select_from_chk->setChecked(str_aux[0]=='1'); - from_where_chk->setChecked(str_aux[1]=='1'); - after_where_chk->setChecked(str_aux[2]=='1'); - end_expr_chk->setChecked(str_aux[3]=='1'); - view_def_chk->setChecked(str_aux[4]=='1'); + return(result); } -void ViewWidget::showObjectName(void) +void ViewWidget::editReference(int ref_idx) { - Column *col=nullptr; - QObject *obj_sender=sender(); - - //If the sender is the table selector means that user want to reference all table columns - if(obj_sender==table_sel) - { - column_sel->blockSignals(true); - //Clears the column selector indicating the situation. (TABLE.*) - column_sel->clearSelector(); - - column_sel->blockSignals(false); - } - //If the sender is not the table sender the user wants to reference a specific column - else - { - col=dynamic_cast(column_sel->getSelectedObject()); - - table_sel->blockSignals(true); - - if(col) - table_sel->setSelectedObject(col->getParentTable()); - else - table_sel->clearSelector(); - - table_sel->blockSignals(false); - } + openReferenceForm(references_tab->getRowData(ref_idx).value(), ref_idx, true); } -void ViewWidget::showReferenceData(Reference refer, bool selec_from, bool from_where, bool after_where, bool end_expr, bool view_def, unsigned row) +void ViewWidget::showReferenceData(Reference refer, unsigned ref_flags, unsigned row) { Table *tab=nullptr; Column *col=nullptr; QString str_aux; + bool selec_from = (ref_flags & Reference::SQL_REFER_SELECT) == Reference::SQL_REFER_SELECT, + from_where = (ref_flags & Reference::SQL_REFER_FROM) == Reference::SQL_REFER_FROM, + after_where = (ref_flags & Reference::SQL_REFER_WHERE) == Reference::SQL_REFER_WHERE, + end_expr = (ref_flags & Reference::SQL_REFER_END_EXPR) == Reference::SQL_REFER_END_EXPR, + view_def = (ref_flags & Reference::SQL_VIEW_DEFINITION) == Reference::SQL_VIEW_DEFINITION; if(refer.getReferenceType()==Reference::REFER_COLUMN) { @@ -627,7 +511,9 @@ void ViewWidget::showReferenceData(Reference refer, bool selec_from, bool from_w str_aux+=(after_where ? QString("1") : QString("0")); str_aux+=(end_expr ? QString("1") : QString("0")); str_aux+=(view_def ? QString("1") : QString("0")); - references_tab->setCellText(str_aux,row,3); + references_tab->setCellText(str_aux, row, 3); + + references_tab->setCellText(refer.getReferenceAlias(), row, 4); refer.setDefinitionExpression(view_def); references_tab->setRowData(QVariant::fromValue(refer), row); @@ -718,8 +604,7 @@ void ViewWidget::updateCodePreview(void) void ViewWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, View *view, double px, double py) { - unsigned i, count; - bool sel_from = false, from_where = false, after_where = false, view_def = false, end_expr = false; + unsigned i, count, ref_flags = 0; Reference refer; if(!view) @@ -740,15 +625,11 @@ void ViewWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch recursive_rb->setChecked(view->isRecursive()); with_no_data_chk->setChecked(view->isWithNoData()); - expression_cp->configureCompletion(model, expression_hl); cte_expression_cp->configureCompletion(model, cte_expression_hl); op_list->startOperationChain(); operation_count=op_list->getCurrentSize(); - column_sel->setModel(model); - table_sel->setModel(model); - tag_sel->setModel(this->model); tag_sel->setSelectedObject(view->getTag()); @@ -761,14 +642,25 @@ void ViewWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch { references_tab->addRow(); + ref_flags = 0; refer=view->getReference(i); - sel_from=(view->getReferenceIndex(refer,Reference::SQL_REFER_SELECT) >= 0); - from_where=(view->getReferenceIndex(refer,Reference::SQL_REFER_FROM) >= 0); - after_where=(view->getReferenceIndex(refer,Reference::SQL_REFER_WHERE)>= 0); - end_expr=(view->getReferenceIndex(refer,Reference::SQL_REFER_END_EXPR)>= 0); - view_def=(view->getReferenceIndex(refer,Reference::SQL_VIEW_DEFINITION)>= 0); - showReferenceData(refer, sel_from, from_where, after_where, end_expr, view_def, i); + if(view->getReferenceIndex(refer, Reference::SQL_VIEW_DEFINITION) >= 0) + ref_flags = Reference::SQL_VIEW_DEFINITION; + + if(view->getReferenceIndex(refer, Reference::SQL_REFER_SELECT) >= 0) + ref_flags |= Reference::SQL_REFER_SELECT; + + if(view->getReferenceIndex(refer, Reference::SQL_REFER_FROM) >= 0) + ref_flags |= Reference::SQL_REFER_FROM; + + if(view->getReferenceIndex(refer, Reference::SQL_REFER_WHERE) >= 0) + ref_flags |= Reference::SQL_REFER_WHERE; + + if(view->getReferenceIndex(refer, Reference::SQL_REFER_END_EXPR) >= 0) + ref_flags |= Reference::SQL_REFER_END_EXPR; + + showReferenceData(refer, ref_flags, i); } references_tab->blockSignals(false); diff --git a/libpgmodeler_ui/src/viewwidget.h b/libpgmodeler_ui/src/viewwidget.h index f499437f13..65112e490c 100644 --- a/libpgmodeler_ui/src/viewwidget.h +++ b/libpgmodeler_ui/src/viewwidget.h @@ -41,35 +41,25 @@ class ViewWidget: public BaseObjectWidget, public Ui::ViewWidget { private: Q_OBJECT - QFrame *frame_info; - ObjectSelectorWidget *tag_sel; - NumberedTextEditor *cte_expression_txt, *code_txt, *expression_txt; + NumberedTextEditor *cte_expression_txt, *code_txt; //! \brief Stores all the view references ObjectsTableWidget *references_tab; map objects_tab_map; - SyntaxHighlighter *expression_hl, - *code_hl, - *cte_expression_hl; - - CodeCompletionWidget *cte_expression_cp, - *expression_cp; + SyntaxHighlighter *code_hl, *cte_expression_hl; - ObjectSelectorWidget *table_sel, - *column_sel; + CodeCompletionWidget *cte_expression_cp; //! \brief Shows the reference at the reference's table - void showReferenceData(Reference refer, bool selec_from, bool from_where, - bool after_where, bool end_expr, bool view_def, unsigned row); - - void clearReferenceForm(void); + void showReferenceData(Reference refer, unsigned ref_flags, unsigned row); //! \brief Returns the object table according with the child type ObjectsTableWidget *getObjectTable(ObjectType obj_type); + ObjectType getObjectType(QObject *sender); void showObjectData(TableObject *object, int row); @@ -81,24 +71,20 @@ class ViewWidget: public BaseObjectWidget, public Ui::ViewWidget { template int openEditingForm(TableObject *object); + int openReferenceForm(Reference ref, int row, bool update); + public: ViewWidget(QWidget * parent = 0); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, View *view, double px, double py); private slots: - //! \brief Shows the field according to the selected reference type - void selectReferenceType(void); - //! \brief Creates a reference from the values filled on the form void handleReference(int ref_idx); //! \brief Edits the selected reference void editReference(int ref_idx); - //! \brief Controls the form which are show the table and column names of the reference - void showObjectName(void); - //! \brief Updates the sql code field of the view form void updateCodePreview(void); @@ -114,6 +100,9 @@ class ViewWidget: public BaseObjectWidget, public Ui::ViewWidget { //! \brief Removes all objects from the table that calls the slot void removeObjects(void); + //! \brief Opens the reference form when a new row is added in the references grid + void addReference(int row); + public slots: void applyConfiguration(void); void cancelConfiguration(void); diff --git a/libpgmodeler_ui/ui/referencewidget.ui b/libpgmodeler_ui/ui/referencewidget.ui new file mode 100644 index 0000000000..8caabc25a5 --- /dev/null +++ b/libpgmodeler_ui/ui/referencewidget.ui @@ -0,0 +1,427 @@ + + + ReferenceWidget + + + + 0 + 0 + 622 + 184 + + + + + 0 + 0 + + + + Reference properties + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + Table alias: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Ref. type: + + + + + + + + 0 + 0 + + + + Used in: + + + + + + + + 0 + 0 + + + + Expression: + + + + + + + + 0 + 0 + + + + Expr. alias: + + + + + + + + 0 + 0 + + + + + + + + + + + 0 + 0 + + + + + false + + + + + + + <strong>SELECT</strong><br/>The reference will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns.<br/><strong>FROM</strong><br/>The reference is used in the FROM portion of the command in order to reference tables or construct JOIN statements.<br/><strong>WHERE</strong><br/>The reference will be used as part of the WHERE clause in form of conditional expression. <br/><strong>GROUP/HAVING</strong><br/>The reference will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements.<br/><strong>View definition</strong><br/>The reference's expression is used exclusively as the view's definition. + + + SELECT + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + false + + + + FROM + + + + + + + + 0 + 0 + + + + + false + + + + WHERE + + + + + + + + 0 + 0 + + + + + false + + + + GROUP/HAVING + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + View Definition + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + View's references can point to a table, column or expression. + + + Table / Column + + + + Table / Column + + + + + Expression + + + + + + + + + 0 + 0 + + + + Ref. alias: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + This is a more friendly description for the reference. When displaying the model in compact view this is the text shown for the reference instead of its real description. If this field is empty the real description will be displayed anyway. + + + + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + 0 + 0 + + + + Ref. object: + + + + + + + + 0 + 0 + + + + Column alias: + + + + + + + false + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + diff --git a/libpgmodeler_ui/ui/viewwidget.ui b/libpgmodeler_ui/ui/viewwidget.ui index 7d4ec588a5..8955fb17ea 100644 --- a/libpgmodeler_ui/ui/viewwidget.ui +++ b/libpgmodeler_ui/ui/viewwidget.ui @@ -28,330 +28,10 @@ 0 - + References - - - 6 - - - 6 - - - 6 - - - 6 - - - 6 - - - - - - 100 - 0 - - - - Reference alias: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - This is a more friendly name for the object. When displaying the model in compact view this is the name shown for the object instead of its real name. If this field is empty the real name will be displayed anyway. - - - - - - - - - - - 100 - 0 - - - - Reference type: - - - - - - - - 0 - 0 - - - - - - - - Expression: - - - - - - - - 0 - 0 - - - - Expression alias: - - - - - - - - 0 - 0 - - - - - - - - - - - 0 - 0 - - - - The element will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns - - - SELECT ... - - - - - - - - 0 - 0 - - - - The element will be used as part of the WHERE clause in form of conditional expression - - - WHERE ... - - - - - - - - 0 - 0 - - - - - 137 - 0 - - - - The element is used in the FROM portion of the command in order to reference tables or construct JOIN statements - - - FROM ... - - - - - - - - 0 - 0 - - - - The element's expression is used exclusively as the view's definition - - - View Definition - - - - - - - - 0 - 0 - - - - The element will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements - - - End expression - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Column - - - - - Expression - - - - - - - - Used in: - - - - - - - Table: - - - - - - - - 0 - 0 - - - - Table alias: - - - - - - - - 0 - 0 - - - - - - - - Column: - - - - - - - - 0 - 0 - - - - Column alias: - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 7e731343ed..ec5fc797ec 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -159,7 +159,7 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_REF_LIN_OBJTAB_INV_INDEX", QT_TR_NOOP("Reference to a row of the objects table with invalid index!")}, {"ERR_OPR_RESERVED_OBJECT", QT_TR_NOOP("The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference!")}, {"ERR_FUNC_CONFIG_INV_OBJECT", QT_TR_NOOP("The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect!")}, - {"ERR_SQL_SCOPE_INV_VIEW_REF", QT_TR_NOOP("A view reference must be used in at least one these SQL scopes: View Definition, SELECT-FROM, FROM-WHERE or After WHERE!")}, + {"ERR_SQL_SCOPE_INV_VIEW_REF", QT_TR_NOOP("A view reference should be used in at least one these SQL scopes: View Definition, SELECT, FROM, WHERE or GROUP/HAVING!")}, {"ERR_CONSTR_NO_COLUMNS", QT_TR_NOOP("Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns!")}, {"ERR_CONFIG_NOT_LOADED", QT_TR_NOOP("Unable to load the configuration file `%1'! Please check if file exists in its folder and/or if it is not corrupted!")}, {"ERR_DEFAULT_CONFIG_NOT_REST", QT_TR_NOOP("Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again!")}, From 51f8673b2351b0377acb108ced650398187d5b3f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 7 Jun 2018 10:35:06 -0300 Subject: [PATCH 055/425] Finished the view editing dialog adjustments --- libobjrenderer/src/graphicalview.cpp | 3 +- libpgmodeler/src/databasemodel.cpp | 4 +-- libpgmodeler/src/view.cpp | 4 +++ libpgmodeler_ui/src/viewwidget.cpp | 49 ++++++++++++++++----------- libpgmodeler_ui/src/viewwidget.h | 8 +++-- libpgmodeler_ui/ui/referencewidget.ui | 2 +- 6 files changed, 43 insertions(+), 27 deletions(-) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index d1dccd5841..8967980536 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -58,8 +58,7 @@ void GraphicalView::configureObject(void) count=count1=view->getReferenceCount(Reference::SQL_VIEW_DEFINITION); //Moves the references group to the origin to be moved latter - columns->moveBy(-columns->scenePos().x(), - -columns->scenePos().y()); + columns->moveBy(-columns->scenePos().x(), -columns->scenePos().y()); subitems=columns->childItems(); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index e49e71e04e..3fd5acde16 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1255,8 +1255,8 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) for(i=0; i < ref_count; i++) { - ref=view->getReference(i, Reference::SQL_REFER_SELECT); - tab=ref.getTable(); + ref = view->getReference(i, Reference::SQL_REFER_SELECT); + tab = ref.getTable(); rel=getRelationship(view,tab); if(tab && !rel) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 864a50fb41..a89eec7305 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -255,6 +255,10 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) //Gets the expression list expr_list=getExpressionList(sql_type); + //Avoiding the insertion of a duplicated reference in the expression list + if(std::find(expr_list->begin(), expr_list->end(), idx) != expr_list->end()) + return; + //Inserts the reference id on the expression list if(expr_id >= 0 && expr_id < static_cast(expr_list->size())) expr_list->insert(expr_list->begin() + expr_id, static_cast(idx)); diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 2d4c135b1b..eefba37993 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -122,6 +122,7 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) connect(references_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addReference(int))); connect(references_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editReference(int))); + connect(references_tab, SIGNAL(s_rowDuplicated(int,int)), this, SLOT(duplicateReference(int,int))); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(updateCodePreview(void))); connect(materialized_rb, SIGNAL(toggled(bool)), with_no_data_chk, SLOT(setEnabled(bool))); @@ -284,6 +285,12 @@ void ViewWidget::addReference(int row) openReferenceForm(Reference(), row, false); } +void ViewWidget::duplicateReference(int orig_row, int new_row) +{ + showReferenceData(references_tab->getRowData(orig_row).value(), + getReferenceFlag(orig_row), new_row); +} + void ViewWidget::removeObject(int row) { View *view=nullptr; @@ -422,9 +429,7 @@ int ViewWidget::openReferenceForm(Reference ref, int row, bool update) { BaseForm editing_form(this); ReferenceWidget *ref_wgt=new ReferenceWidget; - unsigned ref_flags = 0; int result = 0; - QString str_aux; editing_form.setMainWidget(ref_wgt); editing_form.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); @@ -433,35 +438,41 @@ int ViewWidget::openReferenceForm(Reference ref, int row, bool update) connect(editing_form.apply_ok_btn, SIGNAL(clicked(bool)), ref_wgt, SLOT(applyConfiguration())); connect(ref_wgt, SIGNAL(s_closeRequested()), &editing_form, SLOT(accept())); - str_aux = references_tab->getCellText(references_tab->getSelectedRow(), 3); + ref_wgt->setAttributes(ref, getReferenceFlag(row), model); + result = editing_form.exec(); + disconnect(ref_wgt, nullptr, &editing_form, nullptr); + + if(result == QDialog::Accepted) + showReferenceData(ref_wgt->getReference(), ref_wgt->getReferenceFlags(), row); + else if(!update) + references_tab->removeRow(row); - if(str_aux[4] == '1') + return(result); +} + +unsigned ViewWidget::getReferenceFlag(int row) +{ + QString flags_str = references_tab->getCellText(row, 3); + unsigned ref_flags = 0; + + if(flags_str[4] == '1') ref_flags = Reference::SQL_VIEW_DEFINITION; else { - if(str_aux[0] == '1') + if(flags_str[0] == '1') ref_flags |= Reference::SQL_REFER_SELECT; - if(str_aux[1] == '1') + if(flags_str[1] == '1') ref_flags |= Reference::SQL_REFER_FROM; - if(str_aux[2] == '1') + if(flags_str[2] == '1') ref_flags |= Reference::SQL_REFER_WHERE; - if(str_aux[3] == '1') + if(flags_str[3] == '1') ref_flags |= Reference::SQL_REFER_END_EXPR; } - ref_wgt->setAttributes(ref, ref_flags, model); - result = editing_form.exec(); - disconnect(ref_wgt, nullptr, &editing_form, nullptr); - - if(result == QDialog::Accepted) - showReferenceData(ref_wgt->getReference(), ref_wgt->getReferenceFlags(), row); - else if(!update) - references_tab->removeRow(row); - - return(result); + return(ref_flags); } void ViewWidget::editReference(int ref_idx) @@ -706,7 +717,7 @@ void ViewWidget::applyConfiguration(void) refer=references_tab->getRowData(i).value(); //Get the SQL application string for the current reference - str_aux=references_tab->getCellText(i,3); + str_aux=references_tab->getCellText(i, 3); for(unsigned i=0; i < sizeof(expr_type)/sizeof(unsigned); i++) { if(str_aux[i]=='1') diff --git a/libpgmodeler_ui/src/viewwidget.h b/libpgmodeler_ui/src/viewwidget.h index 65112e490c..a9d4546429 100644 --- a/libpgmodeler_ui/src/viewwidget.h +++ b/libpgmodeler_ui/src/viewwidget.h @@ -73,15 +73,14 @@ class ViewWidget: public BaseObjectWidget, public Ui::ViewWidget { int openReferenceForm(Reference ref, int row, bool update); + unsigned getReferenceFlag(int row); + public: ViewWidget(QWidget * parent = 0); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, View *view, double px, double py); private slots: - //! \brief Creates a reference from the values filled on the form - void handleReference(int ref_idx); - //! \brief Edits the selected reference void editReference(int ref_idx); @@ -103,6 +102,9 @@ class ViewWidget: public BaseObjectWidget, public Ui::ViewWidget { //! \brief Opens the reference form when a new row is added in the references grid void addReference(int row); + //! \brief Duplicate the current selected reference + void duplicateReference(int orig_row, int new_row); + public slots: void applyConfiguration(void); void cancelConfiguration(void); diff --git a/libpgmodeler_ui/ui/referencewidget.ui b/libpgmodeler_ui/ui/referencewidget.ui index 8caabc25a5..3659d59a8f 100644 --- a/libpgmodeler_ui/ui/referencewidget.ui +++ b/libpgmodeler_ui/ui/referencewidget.ui @@ -132,7 +132,7 @@ - <strong>SELECT</strong><br/>The reference will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns.<br/><strong>FROM</strong><br/>The reference is used in the FROM portion of the command in order to reference tables or construct JOIN statements.<br/><strong>WHERE</strong><br/>The reference will be used as part of the WHERE clause in form of conditional expression. <br/><strong>GROUP/HAVING</strong><br/>The reference will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements.<br/><strong>View definition</strong><br/>The reference's expression is used exclusively as the view's definition. + <strong>SELECT</strong><br/>The reference will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns.<br/><strong>FROM</strong><br/>The reference is used in the FROM portion of the command in order to reference tables or construct JOIN statements.<br/><strong>WHERE</strong><br/>The reference will be used as part of the WHERE clause in form of conditional expression. <br/><strong>GROUP/HAVING</strong><br/>The reference will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements.<br/><strong>View definition</strong><br/>The reference's expression is used exclusively as the view's definition.<br/> SELECT From d8ecae6a63503e793025fff6de30206b571bc2cd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 11 Jun 2018 15:42:52 -0300 Subject: [PATCH 056/425] Adding support to alias on policies --- conf/defaults/objects-style.conf | 2 + conf/dtd/objects-style.dtd | 4 +- conf/objects-style.conf | 2 + conf/schemas/objects-style.sch | 2 + libobjrenderer/src/tableobjectview.cpp | 24 +++++- libobjrenderer/src/tableview.cpp | 3 + libpgmodeler/src/baseobject.cpp | 2 +- .../src/appearanceconfigwidget.cpp | 82 +++++++++++++------ libpgmodeler_ui/ui/appearanceconfigwidget.ui | 10 +++ schemas/xml/dtd/policy.dtd | 1 + schemas/xml/policy.sch | 8 +- 11 files changed, 108 insertions(+), 32 deletions(-) diff --git a/conf/defaults/objects-style.conf b/conf/defaults/objects-style.conf index 79480a3415..5cc006fef7 100644 --- a/conf/defaults/objects-style.conf +++ b/conf/defaults/objects-style.conf @@ -19,6 +19,7 @@ + @@ -51,6 +52,7 @@ + diff --git a/conf/dtd/objects-style.dtd b/conf/dtd/objects-style.dtd index 52e2f8d93e..0f913cbfda 100644 --- a/conf/dtd/objects-style.dtd +++ b/conf/dtd/objects-style.dtd @@ -15,7 +15,7 @@ + constraints|object-type|ref-table|ref-column|alias|pos-info|tag|policy) "table-name"> @@ -23,4 +23,4 @@ + pos-info|tag|placeholder|policy) "table-title"> diff --git a/conf/objects-style.conf b/conf/objects-style.conf index 79480a3415..5cc006fef7 100644 --- a/conf/objects-style.conf +++ b/conf/objects-style.conf @@ -19,6 +19,7 @@ + @@ -51,6 +52,7 @@ + diff --git a/conf/schemas/objects-style.sch b/conf/schemas/objects-style.sch index 51079b3b24..e23da22923 100644 --- a/conf/schemas/objects-style.sch +++ b/conf/schemas/objects-style.sch @@ -21,6 +21,7 @@ [ ] $br [ ] $br [ ] $br +[ ] $br [ ] $br [ ] $br [ ] $br @@ -52,6 +53,7 @@ $br [ ] $br [ ] $br [ ] $br +[ ] $br [ ] $br [ ] $br [ ] $br diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 3154109424..6707201ed2 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -150,8 +150,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setPen(pen); } } - else if(obj_type==OBJ_INDEX || obj_type==OBJ_RULE || - obj_type==OBJ_TRIGGER || obj_type==OBJ_CONSTRAINT) + else if(obj_type != BASE_OBJECT) { TableObject *tab_obj=dynamic_cast(this->getSourceObject()); QGraphicsPolygonItem *desc=dynamic_cast(descriptor); @@ -176,8 +175,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) { QGraphicsEllipseItem *desc=dynamic_cast(descriptor); - desc->setRect(QRectF(QPointF(0,0), - QSizeF(9.0f * factor, 9.0f * factor))); + desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0f * factor, 9.0f * factor))); desc->setBrush(this->getFillStyle(ParsersAttributes::REFERENCE)); pen = this->getBorderStyle(ParsersAttributes::REFERENCE); @@ -308,6 +306,7 @@ void TableObjectView::configureObject(void) Trigger *trigger=dynamic_cast(tab_obj); Index *index=dynamic_cast(tab_obj); Constraint *constr=dynamic_cast(tab_obj); + Policy *policy = dynamic_cast(tab_obj); if(rule) { @@ -380,6 +379,23 @@ void TableObjectView::configureObject(void) atribs_tip = (~type).toLower(); } + else if(policy) + { + if(policy->isPermissive()) + { + str_constr += QString("p"); + atribs_tip += QString("permissive"); + } + else + { + str_constr += QString("r"); + atribs_tip += QString("restrictive"); + } + + atribs_tip += QString(", "); + str_constr += (~policy->getPolicyCommand()).toLower().at(0); + atribs_tip += (~policy->getPolicyCommand()).toLower(); + } if(!str_constr.isEmpty()) lables[2]->setText(CONSTR_DELIM_START + QString(" ") + diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 8385f31e29..842b8941fd 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -69,6 +69,9 @@ void TableView::configureObject(void) tab_objs.insert(tab_objs.end(), table->getObjectList(OBJ_RULE)->begin(), table->getObjectList(OBJ_RULE)->end()); + tab_objs.insert(tab_objs.end(), + table->getObjectList(OBJ_POLICY)->begin(), + table->getObjectList(OBJ_POLICY)->end()); } //Gets the subitems of the current group diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 3ee3eb12f6..5ae0e34bc4 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -471,7 +471,7 @@ bool BaseObject::acceptsAlias(ObjectType obj_type) obj_type==OBJ_TABLE || obj_type==OBJ_SCHEMA || obj_type==OBJ_VIEW || obj_type == OBJ_COLUMN || obj_type == OBJ_CONSTRAINT || obj_type == OBJ_INDEX || obj_type == OBJ_RULE || - obj_type == OBJ_TRIGGER); + obj_type == OBJ_TRIGGER || obj_type == OBJ_POLICY); } bool BaseObject::acceptsCustomSQL(void) diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 6bfb5c8178..b8ca6d6b34 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -25,36 +25,70 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid setupUi(this); QString conf_ids[]={ - ParsersAttributes::GLOBAL,ParsersAttributes::CONSTRAINTS, ParsersAttributes::OBJ_SELECTION, - ParsersAttributes::POSITION_INFO, ParsersAttributes::POSITION_INFO, - ParsersAttributes::OBJECT_TYPE, ParsersAttributes::LOCKER_ARC, ParsersAttributes::LOCKER_BODY, - ParsersAttributes::TABLE_SCHEMA_NAME, ParsersAttributes::TABLE_NAME, ParsersAttributes::TABLE_BODY, - ParsersAttributes::TABLE_EXT_BODY, ParsersAttributes::TABLE_TITLE, - BaseObject::getSchemaName(OBJ_RULE), BaseObject::getSchemaName(OBJ_RULE), - BaseObject::getSchemaName(OBJ_INDEX), BaseObject::getSchemaName(OBJ_INDEX), - BaseObject::getSchemaName(OBJ_TRIGGER), BaseObject::getSchemaName(OBJ_TRIGGER), - BaseObject::getSchemaName(OBJ_CONSTRAINT), BaseObject::getSchemaName(OBJ_CONSTRAINT), - ParsersAttributes::VIEW_SCHEMA_NAME, ParsersAttributes::VIEW_NAME, - ParsersAttributes::VIEW_BODY /*23*/, ParsersAttributes::VIEW_EXT_BODY /*24*/, ParsersAttributes::VIEW_TITLE /*25*/, ParsersAttributes::ALIAS, - ParsersAttributes::REF_COLUMN, ParsersAttributes::REF_TABLE, ParsersAttributes::REFERENCE, - BaseObject::getSchemaName(OBJ_TEXTBOX), ParsersAttributes::COLUMN, ParsersAttributes::COLUMN, - ParsersAttributes::INH_COLUMN, ParsersAttributes::PROT_COLUMN, ParsersAttributes::PK_COLUMN, - ParsersAttributes::PK_COLUMN, ParsersAttributes::FK_COLUMN, ParsersAttributes::FK_COLUMN, - ParsersAttributes::UQ_COLUMN, ParsersAttributes::UQ_COLUMN, ParsersAttributes::NN_COLUMN, - ParsersAttributes::NN_COLUMN, ParsersAttributes::RELATIONSHIP, ParsersAttributes::LABEL, - ParsersAttributes::LABEL, ParsersAttributes::ATTRIBUTE, ParsersAttributes::ATTRIBUTE, - ParsersAttributes::TAG, ParsersAttributes::TAG, ParsersAttributes::PLACEHOLDER}; + ParsersAttributes::GLOBAL, //0 + ParsersAttributes::CONSTRAINTS, //1 + ParsersAttributes::OBJ_SELECTION, //2 + ParsersAttributes::POSITION_INFO, //3 + ParsersAttributes::POSITION_INFO, //4 + ParsersAttributes::OBJECT_TYPE, //5 + ParsersAttributes::LOCKER_ARC, //6 + ParsersAttributes::LOCKER_BODY, //7 + ParsersAttributes::TABLE_SCHEMA_NAME, //8 + ParsersAttributes::TABLE_NAME, //9 + ParsersAttributes::TABLE_BODY, //10 + ParsersAttributes::TABLE_EXT_BODY, //11 + ParsersAttributes::TABLE_TITLE, //12 + BaseObject::getSchemaName(OBJ_RULE), //13 + BaseObject::getSchemaName(OBJ_RULE), //14 + BaseObject::getSchemaName(OBJ_INDEX), //15 + BaseObject::getSchemaName(OBJ_INDEX), //16 + BaseObject::getSchemaName(OBJ_TRIGGER), //17 + BaseObject::getSchemaName(OBJ_TRIGGER), //18 + BaseObject::getSchemaName(OBJ_CONSTRAINT), //19 + BaseObject::getSchemaName(OBJ_CONSTRAINT), //20 + BaseObject::getSchemaName(OBJ_POLICY), //21 + BaseObject::getSchemaName(OBJ_POLICY), //22 + ParsersAttributes::VIEW_SCHEMA_NAME, //21 -> 23 + ParsersAttributes::VIEW_NAME, //22 + ParsersAttributes::VIEW_BODY, //23 + ParsersAttributes::VIEW_EXT_BODY, //24 + ParsersAttributes::VIEW_TITLE, //25 + ParsersAttributes::ALIAS, //26 + ParsersAttributes::REF_COLUMN, //27 + ParsersAttributes::REF_TABLE, //28 + ParsersAttributes::REFERENCE, //29 + BaseObject::getSchemaName(OBJ_TEXTBOX), //30 + ParsersAttributes::COLUMN, //31 + ParsersAttributes::COLUMN, //32 + ParsersAttributes::INH_COLUMN, //33 + ParsersAttributes::PROT_COLUMN, //34 + ParsersAttributes::PK_COLUMN, //35 + ParsersAttributes::PK_COLUMN, //36 + ParsersAttributes::FK_COLUMN, //37 + ParsersAttributes::FK_COLUMN, //38 + ParsersAttributes::UQ_COLUMN, //39 + ParsersAttributes::UQ_COLUMN, //40 + ParsersAttributes::NN_COLUMN, //41 + ParsersAttributes::NN_COLUMN, //42 + ParsersAttributes::RELATIONSHIP, //43 + ParsersAttributes::LABEL, //44 + ParsersAttributes::LABEL, //45 + ParsersAttributes::ATTRIBUTE, //46 + ParsersAttributes::ATTRIBUTE, //47 + ParsersAttributes::TAG, //48 + ParsersAttributes::TAG, //49 + ParsersAttributes::PLACEHOLDER /*50*/}; int i, count=element_cmb->count(), //This auxiliary vector stores the id of elements that represents color/font conf. of objects - obj_conf_ids_vect[]={ 2, 4, 6, 7, 10, 11, 12, 14, 16, 18, 20, 23, 24, 25, - 29, 30, 32, 36, 38, 40, 42, 43, 45, 47, 49, 50 }; + obj_conf_ids_vect[]={ 2, 4, 6, 7, 10, 11, 12, 14, 16, 18, 20, 22, 25, 26, 27, + 31, 32, 34, 38, 40, 42, 44, 45, 47, 49, 51, 52 }; vector conf_obj_ids(obj_conf_ids_vect, obj_conf_ids_vect + sizeof(obj_conf_ids_vect) / sizeof(int)); conf_items.resize(count); for(i=0; i < count; i++) { conf_items[i].conf_id=conf_ids[i]; - conf_items[i].obj_conf=(std::find(conf_obj_ids.begin(), conf_obj_ids.end(), i)!=conf_obj_ids.end()); + conf_items[i].obj_conf=(std::find(conf_obj_ids.begin(), conf_obj_ids.end(), i) != conf_obj_ids.end()); } color_picker=new ColorPickerWidget(3, this); @@ -302,8 +336,8 @@ void AppearanceConfigWidget::enableConfigElement(void) color_picker->setVisible(colors_lbl->isVisible()); //Buttons visible when a object configuration element is selected - //color_picker->setButtonVisible(1, conf_items[idx].obj_conf); - //color_picker->setButtonVisible(2, conf_items[idx].obj_conf); + color_picker->setButtonVisible(1, conf_items[idx].obj_conf); + color_picker->setButtonVisible(2, conf_items[idx].obj_conf); underline_chk->blockSignals(true); italic_chk->blockSignals(true); diff --git a/libpgmodeler_ui/ui/appearanceconfigwidget.ui b/libpgmodeler_ui/ui/appearanceconfigwidget.ui index 4c3e082f50..cb62533654 100644 --- a/libpgmodeler_ui/ui/appearanceconfigwidget.ui +++ b/libpgmodeler_ui/ui/appearanceconfigwidget.ui @@ -167,6 +167,16 @@ Constraint: Descriptor + + + Policy: Name + + + + + Policy: Descriptor + + View: Schema name diff --git a/schemas/xml/dtd/policy.dtd b/schemas/xml/dtd/policy.dtd index bc5c4d06b3..eba99706e2 100644 --- a/schemas/xml/dtd/policy.dtd +++ b/schemas/xml/dtd/policy.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/policy.sch b/schemas/xml/policy.sch index d33cacec7a..10df7afdd0 100644 --- a/schemas/xml/policy.sch +++ b/schemas/xml/policy.sch @@ -2,7 +2,13 @@ # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -[ Date: Wed, 13 Jun 2018 17:00:03 -0300 Subject: [PATCH 057/425] Minor adjustments in the toolbar actions --- libpgmodeler_ui/res/icones/help_big.png | Bin 0 -> 6369 bytes libpgmodeler_ui/res/icones/moreactions.png | Bin 0 -> 1092 bytes libpgmodeler_ui/res/resources.qrc | 2 + libpgmodeler_ui/src/mainwindow.cpp | 47 +++++--- libpgmodeler_ui/src/mainwindow.h | 6 +- libpgmodeler_ui/src/welcomewidget.cpp | 2 +- libpgmodeler_ui/ui/mainwindow.ui | 15 ++- libpgmodeler_ui/ui/welcomewidget.ui | 123 ++++++++++++++------- 8 files changed, 134 insertions(+), 61 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/help_big.png create mode 100644 libpgmodeler_ui/res/icones/moreactions.png diff --git a/libpgmodeler_ui/res/icones/help_big.png b/libpgmodeler_ui/res/icones/help_big.png new file mode 100644 index 0000000000000000000000000000000000000000..34d769e6b1137a9609a7827ed8c320c5246d2a1d GIT binary patch literal 6369 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 literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/icones/moreactions.png b/libpgmodeler_ui/res/icones/moreactions.png new file mode 100644 index 0000000000000000000000000000000000000000..2ffd625838887aeac7bce9cf4642b18c991dc323 GIT binary patch literal 1092 zcmV-K1iSl*P)u3_F{4j zIfR)*4kILxi(pQ>iWxL`HVCo<9$dsvHmi_Tqq36?3`v&#nCYr|9x~nb^zT?9}&Dtpt@)0fA`$7y+anVTHQ<#HECMn>MZZJQ3F zjhWlBE`&g_Sj6JuqNm>q$kc4xrh$P0PkAgBgE0m~1R{bE!h5^jRW7CUL3xiio&Ayf4hc)eXrfJS{e3tV+@24U}g|e)4bn+yIWzp_H{rAv0159 zyln>nB7$w(-q=;@{?}T2^R9D#Ise#k97rkmu7dgbd0tyvdyq^f8zR{^z4wqMBJAw! zfQZoD-F<3uaKkE@$H$DLI`BD+4W2& z!!673FxtsaAzpT}`rPSf0RW}%uj0MeKc)kphKJP{`}3s9fqXuH3V``HhMnsUZ9H{j z*E}15fqXvS3jkA7Q|m;;tw8j~;NakgN~yLC{$5>!GJmfjW@w|pFfhc>tPy#fe>J3$ zedkp?_io>7v1r^{x%6EzxC1hgNMLw)xSyVwRp zicones/policy_grp.png icones/policy.png icones/compactview.png + icones/help_big.png + icones/moreactions.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 5cdafa4ef9..3f02532434 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -83,6 +83,8 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par action_plugins->setEnabled(!plugins_menu->isEmpty()); action_plugins->setMenu(plugins_menu); + action_other_actions->setMenu(&more_actions_menu); + confs=GeneralConfigWidget::getConfigurationParams(); itr=confs.begin(); itr_end=confs.end(); @@ -140,6 +142,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par control_tb->addAction(action_bug_report); control_tb->addAction(action_donate); + control_tb->addAction(action_support); control_tb->addAction(action_about); control_tb->addAction(action_update_found); @@ -168,6 +171,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(central_wgt->new_tb, SIGNAL(clicked()), this, SLOT(addModel())); connect(central_wgt->open_tb, SIGNAL(clicked()), this, SLOT(loadModel())); connect(central_wgt->last_session_tb, SIGNAL(clicked()), this, SLOT(restoreLastSession())); + connect(central_wgt->support_tb, SIGNAL(clicked()), this, SLOT(openSupport())); #ifndef NO_UPDATE_CHECK connect(update_notifier_wgt, SIGNAL(s_updateAvailable(bool)), action_update_found, SLOT(setVisible(bool))); @@ -980,10 +984,10 @@ void MainWindow::setCurrentModel(void) removeModelActions(); - edit_menu->clear(); - edit_menu->addAction(action_undo); - edit_menu->addAction(action_redo); - edit_menu->addSeparator(); + edit_menu->clear(); + edit_menu->addAction(action_undo); + edit_menu->addAction(action_redo); + edit_menu->addSeparator(); //Avoids the tree state saving in order to restore the current model tree state model_objs_wgt->saveTreeState(false); @@ -992,7 +996,7 @@ void MainWindow::setCurrentModel(void) if(current_model) model_objs_wgt->saveTreeState(model_tree_states[current_model]); - models_tbw->setCurrentIndex(model_nav_wgt->getCurrentIndex()); + models_tbw->setCurrentIndex(model_nav_wgt->getCurrentIndex()); current_model=dynamic_cast(models_tbw->currentWidget()); action_arrange_objects->setEnabled(current_model != nullptr); @@ -1004,7 +1008,7 @@ void MainWindow::setCurrentModel(void) current_model->setFocus(Qt::OtherFocusReason); current_model->cancelObjectAddition(); - general_tb->addAction(current_model->action_new_object); + general_tb->addAction(current_model->action_new_object); tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_new_object)); tool_btn->setPopupMode(QToolButton::InstantPopup); btns.push_back(tool_btn); @@ -1022,7 +1026,7 @@ void MainWindow::setCurrentModel(void) tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_source_code)); btns.push_back(tool_btn); - general_tb->addAction(current_model->action_select_all); + /* general_tb->addAction(current_model->action_select_all); tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_select_all)); tool_btn->setPopupMode(QToolButton::InstantPopup); btns.push_back(tool_btn); @@ -1032,22 +1036,37 @@ void MainWindow::setCurrentModel(void) tool_btn->setPopupMode(QToolButton::InstantPopup); btns.push_back(tool_btn); + general_tb->addAction(current_model->action_extended_attribs); + tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_extended_attribs)); + tool_btn->setPopupMode(QToolButton::InstantPopup); + btns.push_back(tool_btn); + general_tb->addAction(current_model->action_edit_creation_order); tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_edit_creation_order)); + btns.push_back(tool_btn); */ + + more_actions_menu.clear(); + more_actions_menu.addAction(current_model->action_select_all); + more_actions_menu.addAction(current_model->action_fade); + more_actions_menu.addAction(current_model->action_extended_attribs); + more_actions_menu.addAction(current_model->action_edit_creation_order); + general_tb->addAction(action_other_actions); + tool_btn = qobject_cast(general_tb->widgetForAction(action_other_actions)); + tool_btn->setPopupMode(QToolButton::InstantPopup); btns.push_back(tool_btn); for(QToolButton *btn : btns) { PgModelerUiNS::configureWidgetFont(btn, PgModelerUiNS::SMALL_FONT_FACTOR); btn->setGraphicsEffect(createDropShadow(tool_btn)); - } + } - edit_menu->addAction(current_model->action_copy); - edit_menu->addAction(current_model->action_cut); - edit_menu->addAction(current_model->action_duplicate); - edit_menu->addAction(current_model->action_paste); - edit_menu->addAction(current_model->action_remove); - edit_menu->addAction(current_model->action_cascade_del); + edit_menu->addAction(current_model->action_copy); + edit_menu->addAction(current_model->action_cut); + edit_menu->addAction(current_model->action_duplicate); + edit_menu->addAction(current_model->action_paste); + edit_menu->addAction(current_model->action_remove); + edit_menu->addAction(current_model->action_cascade_del); if(current_model->getFilename().isEmpty()) this->setWindowTitle(window_title); diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index d3b3dcf6b7..11e7fe5d9e 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -58,7 +58,7 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { //! \brief Maximum number of files listed on recent models menu const static int MAX_RECENT_MODELS=15; - const static int GENERAL_ACTIONS_COUNT=8; + const static int GENERAL_ACTIONS_COUNT=7; const static int WELCOME_VIEW=0, DESIGN_VIEW=1, @@ -143,7 +143,9 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { sample_mdls_menu, - arrange_menu; + arrange_menu, + + more_actions_menu; //! \brief QMainWindow::closeEvent() overload: Saves the configurations before close the application void closeEvent(QCloseEvent *event); diff --git a/libpgmodeler_ui/src/welcomewidget.cpp b/libpgmodeler_ui/src/welcomewidget.cpp index 13d28a7961..b12111e209 100644 --- a/libpgmodeler_ui/src/welcomewidget.cpp +++ b/libpgmodeler_ui/src/welcomewidget.cpp @@ -24,7 +24,7 @@ WelcomeWidget::WelcomeWidget(QWidget *parent): QWidget(parent) { setupUi(this); - QList btns= { new_tb, open_tb, recent_tb, last_session_tb, sample_tb }; + QList btns= { new_tb, open_tb, recent_tb, last_session_tb, sample_tb, support_tb }; QGraphicsDropShadowEffect *shadow=nullptr; for(auto &btn : btns) diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index bba2df780f..f200eb290f 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -678,7 +678,7 @@ 0 0 1068 - 25 + 23 @@ -804,7 +804,6 @@ - @@ -1533,6 +1532,18 @@ Toggle the compact view on the model(s) + + + + :/icones/icones/moreactions.png:/icones/icones/moreactions.png + + + More + + + Addition action over the model + + models_tbw diff --git a/libpgmodeler_ui/ui/welcomewidget.ui b/libpgmodeler_ui/ui/welcomewidget.ui index 6fbd0c1398..263400061e 100644 --- a/libpgmodeler_ui/ui/welcomewidget.ui +++ b/libpgmodeler_ui/ui/welcomewidget.ui @@ -6,8 +6,8 @@ 0 0 - 658 - 362 + 714 + 353 @@ -35,18 +35,9 @@ 0 - - 0 - - - - 10 - - - 25 - - + + @@ -71,17 +62,23 @@ - - - - 5 + + + + 20 + + + 10 - + + 20 + + - 125 - 85 + 110 + 80 @@ -102,8 +99,8 @@ - 60 - 60 + 55 + 55 @@ -114,12 +111,12 @@ - + - 125 - 85 + 110 + 80 @@ -140,8 +137,8 @@ - 60 - 60 + 55 + 55 @@ -152,15 +149,15 @@ - + true - 125 - 85 + 110 + 80 @@ -181,8 +178,8 @@ - 60 - 60 + 55 + 55 @@ -196,15 +193,15 @@ - + false - 125 - 85 + 110 + 80 @@ -225,8 +222,8 @@ - 60 - 60 + 55 + 55 @@ -240,15 +237,15 @@ - + false - 125 - 85 + 110 + 80 @@ -270,8 +267,50 @@ - 60 - 60 + 55 + 55 + + + + Qt::ToolButtonTextUnderIcon + + + true + + + + + + + true + + + + 110 + 80 + + + + + 50 + false + PreferAntialias + + + + false + + + Support + + + + :/icones/icones/help_big.png:/icones/icones/help_big.png + + + + 55 + 55 From dd3a745e1e3d309160008b50eba8d895f0af66ed Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 14 Jun 2018 11:26:58 -0300 Subject: [PATCH 058/425] Fixed the method BaseObjectWidget::setRequiredField to make object selector fields as required correctly. --- libpgmodeler_ui/src/baseobjectwidget.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 546d22580e..394308c7c7 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -162,14 +162,18 @@ void BaseObjectWidget::setRequiredField(QWidget *widget) } else if(edt || txt || sel) { - QPalette pal; - pal.setColor(QPalette::Base, bgcolor); - pal.setColor(QPalette::Text, QColor(0,0,0)); - if(sel) + { widget=sel->obj_name_txt; - - widget->setPalette(pal); + widget->setStyleSheet(QString("ObjectSelectorWidget > QPlainTextEdit { background-color: %1; }").arg(bgcolor.name())); + } + else + { + QPalette pal; + pal.setColor(QPalette::Base, bgcolor); + pal.setColor(QPalette::Text, QColor(0,0,0)); + widget->setPalette(pal); + } } str_aux=(!widget->toolTip().isEmpty() ? QString("\n") : QString()); From 5b60a166fa8b83a21b251a7711100021bdbcf897 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 15 Jun 2018 16:21:35 -0300 Subject: [PATCH 059/425] Fixed the generation of Database object source in DatabaseExplorerWidget --- libpgmodeler_ui/src/databaseexplorerwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index d93cc10784..5375542b5e 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1726,7 +1726,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) attribs_map attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).value(); bool is_column=false; unsigned oid=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(), - db_oid=objects_trw->topLevelItem(0)->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(), + db_oid=objects_trw->topLevelItem(0)->child(0)->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(), sys_oid=0; int sbar_value=(objects_trw->verticalScrollBar() ? objects_trw->verticalScrollBar()->value() : 0); @@ -1758,7 +1758,9 @@ void DatabaseExplorerWidget::loadObjectSource(void) import_hlp.setImportOptions(toggle_disp_menu.actions().at(0)->isChecked(), toggle_disp_menu.actions().at(1)->isChecked(), true, false, false, false, false); + import_hlp.setSelectedOIDs(&dbmodel, {{OBJ_DATABASE, {db_oid}}, {obj_type,{oid}}}, {}); + sys_oid=import_hlp.getLastSystemOID(); //Currently pgModeler does not support the visualization of base types and built-in ones From 560e5757c43a813efb5326fd4b4aeac551a410f7 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 20 Jun 2018 08:52:18 -0300 Subject: [PATCH 060/425] Change the behaviour of the fade in/out of relationships linked to a table by applying the effect on the other tables that are related to the selected one. --- libpgmodeler_ui/src/modelwidget.cpp | 30 ++++++++++++----------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index d8cc910040..16cbc4b648 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -3304,7 +3304,10 @@ void ModelWidget::configureFadeMenu(void) } if(obj_type == OBJ_TABLE || obj_type == OBJ_VIEW) + { fade_menu.addAction(action_fade_rels); + action_fade_rels->setText(trUtf8("Table && Relationships")); + } } } } @@ -3342,7 +3345,6 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) return; vector list; - //BaseObjectView *obj_view = nullptr; //If the database object is selected or there is no object select if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == OBJ_DATABASE)) @@ -3388,7 +3390,16 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) vector rel_list = db_model->getRelationships(dynamic_cast(selected_objects[0])); for(auto rel : rel_list) + { list.push_back(rel); + list.push_back(rel->getTable(BaseRelationship::SRC_TABLE)); + list.push_back(rel->getTable(BaseRelationship::DST_TABLE)); + } + + vector::iterator end; + std::sort(list.begin(), list.end()); + end=std::unique(list.begin(), list.end()); + list.erase(end, list.end()); } else //Applying fade to the selected objects @@ -3396,23 +3407,6 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) } } - /*for(auto obj : list) - { - obj_view = dynamic_cast(dynamic_cast(obj)->getReceiverObject()); - - if(obj_view) - { - dynamic_cast(obj)->setFadedOut(!fade_in); - - obj_view->setOpacity(fade_in ? 1 : min_object_opacity); - - //If the minimum opacity is zero the object hidden - obj_view->setVisible(fade_in || (!fade_in && min_object_opacity > 0)); - - this->modified = true; - } - } */ - fadeObjects(list, fade_in); scene->clearSelection(); } From 82d6351fc78f6f80bc67dbd1ff85fdc1fe391c81 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 20 Jun 2018 14:33:33 -0300 Subject: [PATCH 061/425] Fixed the tab order in PolicyWidget --- libpgmodeler_ui/src/policywidget.cpp | 11 +++++++---- libpgmodeler_ui/ui/policywidget.ui | 7 ++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index 201bd48b14..6104b9a74b 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -27,14 +27,16 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_POLICY model_objs_wgt = new ModelObjectsWidget(true, this); model_objs_wgt->setObjectVisible(OBJ_ROLE, true); - check_edt = PgModelerUiNS::createNumberedTextEditor(check_wgt); - check_hl = new SyntaxHighlighter(check_edt); - check_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); - using_edt = PgModelerUiNS::createNumberedTextEditor(using_wgt); + using_edt->setTabChangesFocus(true); using_hl = new SyntaxHighlighter(using_edt); using_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + check_edt = PgModelerUiNS::createNumberedTextEditor(check_wgt); + check_edt->setTabChangesFocus(true); + check_hl = new SyntaxHighlighter(check_edt); + check_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + roles_tab = new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ (ObjectsTableWidget::DUPLICATE_BUTTON | ObjectsTableWidget::UPDATE_BUTTON | @@ -58,6 +60,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_POLICY command_cmb->addItems(cmds); configureFormLayout(policy_grid, OBJ_POLICY); + configureTabOrder({ basics_grp, attribs_tbw }); connect(roles_tab, SIGNAL(s_rowAdded(int)), model_objs_wgt, SLOT(show())); connect(model_objs_wgt, SIGNAL(s_visibilityChanged(BaseObject*, bool)), this, SLOT(selectRole(BaseObject*, bool))); diff --git a/libpgmodeler_ui/ui/policywidget.ui b/libpgmodeler_ui/ui/policywidget.ui index e06bde08b3..dc8789f42f 100644 --- a/libpgmodeler_ui/ui/policywidget.ui +++ b/libpgmodeler_ui/ui/policywidget.ui @@ -33,7 +33,7 @@ 4 - + Basics @@ -169,6 +169,11 @@ + + command_cmb + permissive_chk + attribs_tbw + From 501ee531909ae0414a077991fcf21f8b74d50a31 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 21 Jun 2018 15:56:01 -0300 Subject: [PATCH 062/425] Minor adjustment on OperationList::removeFromPool to avoid throw an exception when an invalid index is passed --- libpgmodeler/src/operationlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index f5e2d5e758..edfb742101 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -314,9 +314,9 @@ void OperationList::removeFromPool(unsigned obj_idx) BaseObject *object=nullptr; vector::iterator itr; - //Raises an error if the object index is invalid (out of bound) + //Avoiding the removal of an object in invalid index (out of bound) if(obj_idx >= object_pool.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + return; //Gets the element to bo removed through its index itr=object_pool.begin() + obj_idx; From a7ae0a205fb1d5eefb67e01c7e6f778b2c906cbd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 26 Jun 2018 16:33:32 -0300 Subject: [PATCH 063/425] Minor fix in SQLExecutionWidget allowing the output widget to be resized to a size lower than the default one. --- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 16305c6758..11d3e0dd6e 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -7,7 +7,7 @@ 0 0 843 - 478 + 349 @@ -546,11 +546,11 @@ - - - 0 - 0 - + + + 0 + 0 + QTabWidget::South @@ -583,12 +583,6 @@ - - - 100 - 200 - - 0 From 06403363f46333ad6dc76f9d32aa2f6d347b9271 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 27 Jun 2018 10:58:58 -0300 Subject: [PATCH 064/425] Adding support to truncate tables on DataManipulationForm Minor adjustment on buttons style in DatabaseExplorerWidget, DataManipulationForm and SQLExecutionWidget --- .../src/databaseexplorerwidget.cpp | 85 +- libpgmodeler_ui/src/databaseexplorerwidget.h | 3 + libpgmodeler_ui/src/datamanipulationform.cpp | 49 + libpgmodeler_ui/src/datamanipulationform.h | 11 +- libpgmodeler_ui/ui/databaseexplorerwidget.ui | 21 + libpgmodeler_ui/ui/datamanipulationform.ui | 2126 +++++++++-------- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 28 +- 7 files changed, 1266 insertions(+), 1057 deletions(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 5375542b5e..d79ddc9279 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1250,55 +1250,70 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) } } -void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade) +bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QString &obj_name, bool cascade, Connection connection) { - Messagebox msg_box; - try { - if(item && static_cast(item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt()) > 0) - { - QString msg, obj_name, sch_name; + Messagebox msg_box; + QString msg; - obj_name=item->data(DatabaseImportForm::OBJECT_NAME, Qt::UserRole).toString(); - sch_name=BaseObject::formatName(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString()); + if(!cascade) + msg=trUtf8("Do you really want to truncate the table %1.%2?").arg(sch_name).arg(obj_name); + else + msg=trUtf8("Do you really want to truncate in cascade mode the table %1.%2? This action will truncate all the tables that depends on it?").arg(sch_name).arg(obj_name); - if(!cascade) - msg=trUtf8("Do you really want to truncate the table %1?").arg(obj_name); - else - msg=trUtf8("Do you really want to cascade truncate the table %1? This action will truncate all the tables that depends on it?").arg(obj_name); + msg_box.setCustomOptionText(trUtf8("Also restart sequences")); + msg_box.show(msg, Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); - msg_box.setCustomOptionText(trUtf8("Also restart sequences")); - msg_box.show(msg, Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + if(msg_box.result()==QDialog::Accepted) + { + attribs_map attribs; + QString truc_cmd; + Connection conn; + SchemaParser schparser; - if(msg_box.result()==QDialog::Accepted) - { - attribs_map attribs; - QString truc_cmd; - Connection conn; + attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(OBJ_TABLE); + attribs[ParsersAttributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); + attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : ""); + attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::_TRUE_ : ""); - attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(OBJ_TABLE); - attribs[ParsersAttributes::SIGNATURE]=sch_name + QString(".\"%1\"").arg(obj_name); - attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : ""); - attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::_TRUE_ : ""); + //Generate the truncate command + schparser.ignoreEmptyAttributes(true); + schparser.ignoreUnkownAttributes(true); + truc_cmd=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::ALTER_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + + ParsersAttributes::TRUNCATE + GlobalAttributes::SCHEMA_EXT, + attribs); - //Generate the truncate command - schparser.ignoreEmptyAttributes(true); - schparser.ignoreUnkownAttributes(true); - truc_cmd=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::ALTER_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::TRUNCATE + GlobalAttributes::SCHEMA_EXT, - attribs); + //Executes the truncate cmd + conn = connection; + conn.connect(); + conn.executeDDLCommand(truc_cmd); + } - //Executes the truncate cmd - conn=connection; - conn.connect(); - conn.executeDDLCommand(truc_cmd); - } + return(msg_box.result()==QDialog::Accepted); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__); + } +} + +void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade) +{ + try + { + if(item && static_cast(item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt()) > 0) + { + QString obj_name, sch_name; + obj_name=item->data(DatabaseImportForm::OBJECT_NAME, Qt::UserRole).toString(); + sch_name=BaseObject::formatName(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString()); + truncateTable(sch_name, obj_name, cascade, connection); } } catch(Exception &e) { + Messagebox msg_box; msg_box.show(e); } } diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.h b/libpgmodeler_ui/src/databaseexplorerwidget.h index cd58b1c9f4..b9ae5037b7 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.h +++ b/libpgmodeler_ui/src/databaseexplorerwidget.h @@ -155,6 +155,9 @@ class DatabaseExplorerWidget: public QWidget, public Ui::DatabaseExplorerWidget //! \brief Clears the object's properties table void clearObjectProperties(void); + //! \brief Truncates a named table (in cascade mode or not) using the provided connection + static bool truncateTable(const QString &sch_name, const QString &obj_name, bool cascade, Connection connection); + public slots: //! \brief Lists all objects for the current selected database void listObjects(void); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 7081948534..62244933b8 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -23,6 +23,7 @@ #include "plaintextitemdelegate.h" #include "baseform.h" #include "bulkdataeditwidget.h" +#include "databaseexplorerwidget.h" const QColor DataManipulationForm::ROW_COLORS[3]={ QColor(QString("#C0FFC0")), QColor(QString("#FFFFC0")), QColor(QString("#FFC0C0")) }; const unsigned DataManipulationForm::NO_OPERATION=0; @@ -67,6 +68,10 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): paste_tb->setEnabled(true); }); + truncate_tb->setMenu(&truncate_menu); + truncate_menu.addAction(QIcon(PgModelerUiNS::getIconPath("truncate")), trUtf8("Truncate"), this, SLOT(truncateTable()))->setData(QVariant::fromValue(false)); + truncate_menu.addAction(QIcon(PgModelerUiNS::getIconPath("trunccascade")), trUtf8("Truncate cascade"), this, SLOT(truncateTable()))->setData(QVariant::fromValue(true)); + copy_tb->setMenu(©_menu); refresh_tb->setToolTip(refresh_tb->toolTip() + QString(" (%1)").arg(refresh_tb->shortcut().toString())); save_tb->setToolTip(save_tb->toolTip() + QString(" (%1)").arg(save_tb->shortcut().toString())); @@ -120,6 +125,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): connect(move_down_tb, SIGNAL(clicked()), this, SLOT(swapColumns())); connect(move_up_tb, SIGNAL(clicked()), this, SLOT(swapColumns())); connect(filter_tb, SIGNAL(toggled(bool)), v_splitter, SLOT(setVisible(bool))); + connect(truncate_tb, SIGNAL(clicked(bool)), this, SLOT(truncateTable())); connect(bulkedit_tb, &QToolButton::clicked, [&](){ PgModelerUiNS::bulkDataEdit(results_tbw); @@ -378,6 +384,10 @@ void DataManipulationForm::retrieveData(void) table_cmb->currentData().toUInt() == OBJ_TABLE && !col_names.isEmpty()); + truncate_tb->setEnabled(table_cmb->currentData().toUInt() == OBJ_TABLE && + res.getTupleCount() > 0 && + !col_names.isEmpty()); + code_compl_wgt->clearCustomItems(); code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), OBJ_COLUMN); } @@ -400,6 +410,8 @@ void DataManipulationForm::disableControlButtons(void) add_tb->setEnabled(false); duplicate_tb->setEnabled(false); export_tb->setEnabled(false); + paste_tb->setEnabled(false); + truncate_tb->setEnabled(false); csv_load_tb->setEnabled(false); csv_load_tb->setChecked(false); clearChangedRows(); @@ -1375,3 +1387,40 @@ QString DataManipulationForm::getDMLCommand(int row) return(fmt_cmd); } + +void DataManipulationForm::resizeEvent(QResizeEvent *event) +{ + Qt::ToolButtonStyle style = Qt::ToolButtonIconOnly; + QToolButton *btn = nullptr; + + if(event->size().width() > this->baseSize().width()) + style = Qt::ToolButtonTextBesideIcon; + + if(refresh_tb->toolButtonStyle() != style) + { + for(auto obj : bnts_parent_wgt->children()) + { + btn = qobject_cast(obj); + + if(btn) + btn->setToolButtonStyle(style); + } + } +} + +void DataManipulationForm::truncateTable(void) +{ + try + { + QAction *act = dynamic_cast(sender()); + + if(DatabaseExplorerWidget::truncateTable(schema_cmb->currentText(), table_cmb->currentText(), + act->data().toBool(), Connection(tmpl_conn_params))) + retrieveData(); + } + catch(Exception &e) + { + Messagebox msg_box; + msg_box.show(e); + } +} diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 1e4f6d89fc..7640e5fecd 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -49,7 +49,7 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { CodeCompletionWidget *code_compl_wgt; - QMenu fks_menu, copy_menu; + QMenu fks_menu, copy_menu, truncate_menu; //! \brief Store the template connection params to be used by catalogs and command execution connections attribs_map tmpl_conn_params; @@ -102,6 +102,8 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { //! brief Browse a referenced or referencing table by the provided foreign key name void browseTable(const QString &fk_name, bool browse_ref_tab); + void resizeEvent(QResizeEvent *event); + public: DataManipulationForm(QWidget * parent = 0, Qt::WindowFlags f = 0); @@ -171,11 +173,14 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { //! \brief Add new rows to the grid based upon the CSV loaded void loadDataFromCsv(bool load_from_clipboard = false); - //! brief Browse the referenced table data using the selected row in the results grid + //! \brief Browse the referenced table data using the selected row in the results grid void browseReferencedTable(void); - //! brief Browse the referencing table data using the selected row in the results grid + //! \brief Browse the referencing table data using the selected row in the results grid void browseReferrerTable(void); + + //! \brief Truncates the browsed table + void truncateTable(void); }; #endif diff --git a/libpgmodeler_ui/ui/databaseexplorerwidget.ui b/libpgmodeler_ui/ui/databaseexplorerwidget.ui index 82082236c4..ac107cb19e 100644 --- a/libpgmodeler_ui/ui/databaseexplorerwidget.ui +++ b/libpgmodeler_ui/ui/databaseexplorerwidget.ui @@ -34,6 +34,9 @@ + + 4 + @@ -69,6 +72,9 @@ Qt::ToolButtonIconOnly + + true + @@ -109,6 +115,9 @@ Qt::ToolButtonIconOnly + + true + @@ -143,6 +152,9 @@ Qt::ToolButtonIconOnly + + true + @@ -169,6 +181,9 @@ Ctrl+F6 + + true + @@ -192,6 +207,9 @@ 22 + + true + @@ -215,6 +233,9 @@ 22 + + true + diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index 995d5ea701..5199138371 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -6,16 +6,22 @@ 0 0 - 800 + 758 600 - 800 + 700 600 + + + 1250 + 0 + + Data Manipulation @@ -176,1043 +182,150 @@ 4 - - - - - 0 - 0 - - + + 0 - 30 + 0 - - QFrame::StyledPanel + + + + + + + 0 + 0 + - - QFrame::Raised + + Qt::Horizontal - - - 2 + + false + + + + true - - 2 + + QAbstractScrollArea::AdjustToContents - - 2 + + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked - - 2 + + true - - - - - 24 - 24 - - - - - 24 - 24 - - - - - - - Qt::AutoText - - - :/icones/icones/msgbox_info.png - - - true - - - - - - - - 0 - 0 - - - - - 50 - false - false - false - true - - - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> - - - true - - - - - - - - - - - 0 - 0 - - - - - 2 + + QAbstractItemView::ExtendedSelection - - 2 + + QAbstractItemView::SelectItems - - 2 + + QAbstractItemView::ScrollPerItem - - 2 + + QAbstractItemView::ScrollPerPixel - - - - - 0 - 0 - + + false + + + 0 + + + 0 + + + true + + + 30 + + + false + + + true + + + false + + + false + + + 25 + + + 25 + + + false + + + + + Qt::Vertical + + + false + + + + Filter expression + + + + 4 - - - false - + + 4 - - + + 4 - - -1 + + 4 - - - - - - - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Refresh listing - - - - :/icones/icones/atualizar.png:/icones/icones/atualizar.png - - - - 22 - 22 - - - - F5 - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Save changes - - - - :/icones/icones/salvar.png:/icones/icones/salvar.png - - - - 22 - 22 - - - - Ctrl+S - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Copy items on the grid - - - - :/icones/icones/copiar.png:/icones/icones/copiar.png - - - - 22 - 22 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Paste items on the grid - - - - :/icones/icones/colar.png:/icones/icones/colar.png - - - - 22 - 22 - - - - Ctrl+V - - - QToolButton::InstantPopup - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Export results to CSV file - - - - :/icones/icones/exportdata.png:/icones/icones/exportdata.png - - - - 22 - 22 - - - - Ctrl+X - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Browse referenced tables - - - - :/icones/icones/browsetable.png:/icones/icones/browsetable.png - - - - 22 - 22 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonIconOnly - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Undo modifications - - - - :/icones/icones/desfazer.png:/icones/icones/desfazer.png - - - - 22 - 22 - - - - Ctrl+Z - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Add empty rows - - - - :/icones/icones/addrow.png:/icones/icones/addrow.png - - - - 22 - 22 - - - - Ins - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Mark the selected rows to be deleted - - - - :/icones/icones/delrow.png:/icones/icones/delrow.png - - - - 22 - 22 - - - - Del - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Change the values of all selected cells at once - - - - :/icones/icones/bulkedit.png:/icones/icones/bulkedit.png - - - - 22 - 22 - - - - Ctrl+E - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Duplicate the selected rows - - - - :/icones/icones/duprow.png:/icones/icones/duprow.png - - - - 22 - 22 - - - - Ctrl+D - - - Qt::ToolButtonIconOnly - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - true - - - - 0 - 0 - - - - Add new rows from a CSV file - - - - :/icones/icones/loadcsv.png:/icones/icones/loadcsv.png - - - - 22 - 22 - - - - - - - true - - - Qt::ToolButtonIconOnly - - - - - - - false - - - - 0 - 0 - - - - - 8 - - - - Filter the result set - - - - :/icones/icones/filter.png:/icones/icones/filter.png - - - - 22 - 22 - - - - true - - - Qt::ToolButtonIconOnly - - - - - - - - - - 0 - 0 - - - - Table: - - - - - - - - 0 - 0 - - - - Schema: - + + + + + 0 + 0 + + + + + 0 + 0 + + + + + - - - - - Qt::Horizontal + + + Order && Limit - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - 20 - - - QComboBox::InsertAtBottom - - - QComboBox::AdjustToContentsOnFirstShow - - - - 16 - 16 - - - - - - - - - 0 - 0 - - - - 20 - - - QComboBox::InsertAtBottom - - - - 16 - 16 - - - - - - - - 0 - - - - - - 0 - 0 - - - - in - - - - - - - - 20 - 20 - - - - - 22 - 22 - - - - - - - :/icones/icones/database.png - - - true - - - - - - - - 0 - 0 - - - - - - - 5 - - - - - - - - - - 0 - 0 - - - - Hide views - - - true - - - - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - 24 - 24 - - - - - 24 - 24 - - - - - - - Qt::AutoText - - - :/icones/icones/msgbox_alerta.png - - - true + + + 4 - - - - - - - 50 - false - false - false - false - true - + + 4 - - + + 4 - - true - - - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - false - - - - true - - - QAbstractScrollArea::AdjustToContents - - - QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectItems - - - QAbstractItemView::ScrollPerItem - - - QAbstractItemView::ScrollPerPixel - - - false - - - 0 - - - 0 - - - true - - - 30 - - - false - - - true - - - false - - - false - - - 25 - - - 25 - - - false - - - - - Qt::Vertical - - - false - - - - Filter expression - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - Order && Limit - - - - 4 - - - 4 - - - 4 - - - 4 + + 4 @@ -1550,14 +663,993 @@ - - + + + + + 0 + 0 + + + + + 0 + 30 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + 24 + 24 + + + + + 24 + 24 + + + + + + + Qt::AutoText + + + :/icones/icones/msgbox_alerta.png + + + true + + + + + + + + 50 + false + false + false + false + true + + + + + + + true + + + + + + + + 0 0 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + 0 + 0 + + + + + false + + + + + + + -1 + + + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + 24 + 24 + + + + + 24 + 24 + + + + + + + Qt::AutoText + + + :/icones/icones/msgbox_info.png + + + true + + + + + + + + 0 + 0 + + + + + 50 + false + false + false + true + + + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + + + true + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + Schema: + + + + + + + + 0 + 0 + + + + 20 + + + QComboBox::InsertAtBottom + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + Table: + + + + + + + + 0 + 0 + + + + 20 + + + QComboBox::InsertAtBottom + + + QComboBox::AdjustToContentsOnFirstShow + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + Hide views + + + true + + + + + + + + + 0 + + + + + + 20 + 20 + + + + + 22 + 22 + + + + + + + :/icones/icones/database.png + + + true + + + + + + + + 0 + 0 + + + + + + + 5 + + + + + + + + + + + + 0 + 0 + + + + + 4 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + false + + + + 0 + 0 + + + + Refresh listing + + + Refresh + + + + :/icones/icones/atualizar.png:/icones/icones/atualizar.png + + + + 22 + 22 + + + + F5 + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Save changes + + + Save + + + + :/icones/icones/salvar.png:/icones/icones/salvar.png + + + + 22 + 22 + + + + Ctrl+S + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Copy items on the grid + + + Copy + + + + :/icones/icones/copiar.png:/icones/icones/copiar.png + + + + 22 + 22 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Paste items on the grid + + + Paste + + + + :/icones/icones/colar.png:/icones/icones/colar.png + + + + 22 + 22 + + + + Ctrl+V + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Export results to CSV file + + + Export + + + + :/icones/icones/exportdata.png:/icones/icones/exportdata.png + + + + 22 + 22 + + + + Ctrl+X + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Browse referenced tables + + + Browse + + + + :/icones/icones/browsetable.png:/icones/icones/browsetable.png + + + + 22 + 22 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 8 + 20 + + + + + + + + false + + + + 0 + 0 + + + + Undo modifications + + + Undo + + + + :/icones/icones/desfazer.png:/icones/icones/desfazer.png + + + + 22 + 22 + + + + Ctrl+Z + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Add empty rows + + + Add + + + + :/icones/icones/addrow.png:/icones/icones/addrow.png + + + + 22 + 22 + + + + Ins + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Mark the selected rows to be deleted + + + Delete + + + + :/icones/icones/delrow.png:/icones/icones/delrow.png + + + + 22 + 22 + + + + Del + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Change the values of all selected cells at once + + + Edit + + + + :/icones/icones/bulkedit.png:/icones/icones/bulkedit.png + + + + 22 + 22 + + + + Ctrl+E + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Duplicate the selected rows + + + Duplicate + + + + :/icones/icones/duprow.png:/icones/icones/duprow.png + + + + 22 + 22 + + + + Ctrl+D + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Truncate the browsed table + + + Truncate + + + + :/icones/icones/truncate.png:/icones/icones/truncate.png + + + + 22 + 22 + + + + Del + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 8 + 20 + + + + + + + + true + + + + 0 + 0 + + + + Add new rows from a CSV file + + + Load CSV + + + + :/icones/icones/loadcsv.png:/icones/icones/loadcsv.png + + + + 22 + 22 + + + + + + + true + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Filter the result set + + + Filter + + + + :/icones/icones/filter.png:/icones/icones/filter.png + + + + 22 + 22 + + + + true + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Horizontal + + + + 235 + 20 + + + + + diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 11d3e0dd6e..741cf5607c 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -127,6 +127,9 @@ + + 4 + @@ -169,6 +172,9 @@ Qt::ToolButtonTextBesideIcon + + true + @@ -210,6 +216,9 @@ Qt::ToolButtonTextBesideIcon + + true + @@ -251,6 +260,9 @@ Qt::ToolButtonTextBesideIcon + + true + @@ -283,6 +295,9 @@ Qt::ToolButtonTextBesideIcon + + true + @@ -327,6 +342,9 @@ Qt::ToolButtonTextBesideIcon + + true + @@ -368,6 +386,9 @@ Qt::ToolButtonTextBesideIcon + + true + @@ -409,6 +430,9 @@ Qt::ToolButtonTextBesideIcon + + true + @@ -611,7 +635,7 @@ QAbstractItemView::ContiguousSelection - true + false false @@ -620,7 +644,7 @@ true - true + false 25 From aaccab95c8177f40c5ea2244bf91557ee92c78cf Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 4 Jul 2018 08:46:42 -0300 Subject: [PATCH 065/425] Start adding support to sql execution cancellement in SQLExecutionWidget --- libpgconnector/src/connection.cpp | 86 ++++++++++++++++++++- libpgconnector/src/connection.h | 17 +++- libpgconnector/src/resultset.cpp | 11 ++- libpgconnector/src/resultset.h | 7 +- libpgmodeler_ui/libpgmodeler_ui.pro | 6 +- libpgmodeler_ui/res/icones/stop.png | Bin 0 -> 563 bytes libpgmodeler_ui/res/resources.qrc | 1 + libpgmodeler_ui/src/sqlexecutionhelper.cpp | 73 +++++++++++++++++ libpgmodeler_ui/src/sqlexecutionhelper.h | 57 ++++++++++++++ libpgmodeler_ui/src/sqlexecutionwidget.cpp | 19 +++-- libpgmodeler_ui/src/sqlexecutionwidget.h | 5 ++ libpgmodeler_ui/ui/sqlexecutionwidget.ui | 46 ++++++++++- libutils/src/exception.cpp | 3 + libutils/src/exception.h | 7 +- 14 files changed, 319 insertions(+), 19 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/stop.png create mode 100644 libpgmodeler_ui/src/sqlexecutionhelper.cpp create mode 100644 libpgmodeler_ui/src/sqlexecutionhelper.h diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index c284c83acc..13c8c48a70 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -57,6 +57,7 @@ Connection::Connection(void) { connection=nullptr; auto_browse_db=false; + async_conn=false; cmd_exec_timeout=0; for(unsigned idx=OP_VALIDATION; idx <= OP_DIFF; idx++) @@ -211,7 +212,7 @@ bool Connection::isConnErrorSilenced(void) return(silence_conn_err); } -void Connection::connect(void) +void Connection::connect(bool async) { /* If the connection string is not established indicates that the user is trying to connect without configuring connection parameters, @@ -234,6 +235,7 @@ void Connection::connect(void) //Try to connect to the database connection=PQconnectdb(connection_str.toStdString().c_str()); last_cmd_execution=QDateTime::currentDateTime(); + async_conn = async; /* If the connection descriptor has not been allocated or if the connection state is CONNECTION_BAD it indicates that the connection was not successful */ @@ -265,6 +267,7 @@ void Connection::close(void) connection=nullptr; last_cmd_execution=QDateTime(); + async_conn=false; } } @@ -394,6 +397,9 @@ void Connection::executeDMLCommand(const QString &sql, ResultSet &result) if(!connection) throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + if(async_conn) + throw Exception(ERR_EXEC_SYNC_CMD_ASYN_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + validateConnectionStatus(); notices.clear(); @@ -435,6 +441,9 @@ void Connection::executeDDLCommand(const QString &sql) if(!connection) throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + if(async_conn) + throw Exception(ERR_EXEC_SYNC_CMD_ASYN_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + validateConnectionStatus(); notices.clear(); sql_res=PQexec(connection, sql.toStdString().c_str()); @@ -461,6 +470,80 @@ void Connection::executeDDLCommand(const QString &sql) PQclear(sql_res); } +void Connection::executeAsyncCommand(const QString &sql) +{ + if(!connection) + throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + + if(!async_conn) + throw Exception(ERR_EXEC_SYNC_CMD_ASYN_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + + validateConnectionStatus(); + notices.clear(); + + //Prints the SQL to stdout when the flag is active + if(print_sql) + { + QTextStream out(stdout); + out << QString("\n---\n") << sql << endl; + } + + PQsendQuery(connection, sql.toStdString().c_str()); + PQsetnonblocking(connection, 1); + PQsetSingleRowMode(connection); + + //Raise an error in case the command sql execution is not sucessful + if(strlen(PQerrorMessage(connection)) > 0) + { + throw Exception(QString(Exception::getErrorMessage(ERR_CMD_SQL_NOT_EXECUTED)) + .arg(PQerrorMessage(connection)), + ERR_CMD_SQL_NOT_EXECUTED, __PRETTY_FUNCTION__, __FILE__, __LINE__); + } +} + +bool Connection::fetchSingleResult(ResultSet &result) +{ + PGresult *sql_res=nullptr; + + if(!connection) + throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + + if(!async_conn) + throw Exception(ERR_EXEC_SYNC_CMD_ASYN_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + + if(!PQconsumeInput(connection)) + { + throw Exception(QString(Exception::getErrorMessage(ERR_CONN_DATA_NOT_CONSUMED)) + .arg(PQerrorMessage(connection)), + ERR_CONN_DATA_NOT_CONSUMED, __PRETTY_FUNCTION__, __FILE__, __LINE__); + } + + if(!PQisBusy(connection)) + { + result.clearResultSet(); + sql_res = PQgetResult(connection); + + if(sql_res) + { + ResultSet *new_res=nullptr; + + //Generates the resultset based on the sql result descriptor + new_res=new ResultSet(sql_res); + + //Copy the new resultset to the parameter resultset + result=*(new_res); + + //Deallocate the new resultset + delete(new_res); + PQclear(sql_res); + } + + return(true); + } + + return(false); +} + void Connection::setDefaultForOperation(unsigned op_id, bool value) { if(op_id > OP_NONE) @@ -510,6 +593,7 @@ void Connection::operator = (const Connection &conn) if(this->isStablished()) this->close(); + this->async_conn=false; this->auto_browse_db=conn.auto_browse_db; this->connection_params=conn.connection_params; this->connection_str=conn.connection_str; diff --git a/libpgconnector/src/connection.h b/libpgconnector/src/connection.h index 40016e2359..f227f1d667 100644 --- a/libpgconnector/src/connection.h +++ b/libpgconnector/src/connection.h @@ -86,7 +86,12 @@ class Connection { /*! \brief Indicates in which operations (diff, export, import, validation) the connection is used if none is explicitly specified by the user in the UI */ - default_for_oper[4]; + default_for_oper[4], + + /*! \brief Indicates that the connection is in asynchronous mode. An async connection should run the sql commands + * using executeAsyncCommand() and retrieve results via fetchSingleResult(). Any try to call executeDMLCommand or executeDDLCommand + * in a async connection will raise errors */ + async_conn; /*! \brief Validates the connection status (command exec. timeout and connection status) and raise errors in case of exceeded timeout or bad connection. This method is called prior any @@ -168,8 +173,10 @@ class Connection { //! \brief Set if the database configured on the connection is auto browseable when using the SQLTool manage database void setAutoBrowseDB(bool value); - //! \brief Open the connection to the database - void connect(void); + /*! \brief Open the connection to the database. The async parameter switches the connection to asynchronous mode and the results are + * retrived row by row (see PQsetnonblocking and PQsetSingleRow). + * In this mode the commands need to be executed using executeAsyncCommand() and results fetched using fetchSingleResult() */ + void connect(bool async = false); //! \brief Resets the database connection void reset(void); @@ -226,6 +233,10 @@ class Connection { to be an data definition one */ void executeDDLCommand(const QString &sql); + void executeAsyncCommand(const QString &sql); + + bool fetchSingleResult(ResultSet &res); + //! \brief Toggles the default status for the connect in the specified operation (OP_??? constants). void setDefaultForOperation(unsigned op_id, bool value); diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index 81dac934cc..646304fc66 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -67,10 +67,10 @@ ResultSet::ResultSet(PGresult *sql_result) ResultSet::~ResultSet(void) { - destroyResultSet(); + clearResultSet(); } -void ResultSet::destroyResultSet(void) +void ResultSet::clearResultSet(void) { /* Destroy the resultset of the object if it was not copied to another class instance (see 'operator =') */ @@ -316,6 +316,11 @@ bool ResultSet::isEmpty(void) return(empty_result); } +bool ResultSet::isValid(void) +{ + return(sql_result != nullptr); +} + void ResultSet::operator = (ResultSet &res) { /* Mark the result parameter as copied, avoiding @@ -324,7 +329,7 @@ void ResultSet::operator = (ResultSet &res) /* If the resultset 'this' is allocated, it will be deallocated to avoid memory leaks */ - destroyResultSet(); + clearResultSet(); //Copy the parameter restulset attributes to 'this' resultset this->current_tuple=res.current_tuple; diff --git a/libpgconnector/src/resultset.h b/libpgconnector/src/resultset.h index d07ad541ec..82962e2c56 100644 --- a/libpgconnector/src/resultset.h +++ b/libpgconnector/src/resultset.h @@ -46,8 +46,6 @@ class ResultSet { when this flag is marked as false */ bool is_res_copied; - void destroyResultSet(void); - void validateColumnIndex(int column_idx); int validateColumnName(const QString &column_name); @@ -122,6 +120,11 @@ class ResultSet { //! \brief Returns if the result set is empty due a DML command that does not returned any data bool isEmpty(void); + //! \brief Returns if the result set is valid (created from a valid result set) + bool isValid(void); + + void clearResultSet(void); + //! \brief Make a copy between two resultsets void operator = (ResultSet &res); diff --git a/libpgmodeler_ui/libpgmodeler_ui.pro b/libpgmodeler_ui/libpgmodeler_ui.pro index f984978a43..98a312b443 100644 --- a/libpgmodeler_ui/libpgmodeler_ui.pro +++ b/libpgmodeler_ui/libpgmodeler_ui.pro @@ -114,7 +114,8 @@ SOURCES += src/mainwindow.cpp \ src/policywidget.cpp \ src/objectstablewidget.cpp \ src/resultsetmodel.cpp \ - src/referencewidget.cpp + src/referencewidget.cpp \ + src/sqlexecutionhelper.cpp HEADERS += src/mainwindow.h \ @@ -216,7 +217,8 @@ HEADERS += src/mainwindow.h \ src/policywidget.h \ src/objectstablewidget.h \ src/resultsetmodel.h \ - src/referencewidget.h + src/referencewidget.h \ + src/sqlexecutionhelper.h FORMS += ui/mainwindow.ui \ ui/textboxwidget.ui \ diff --git a/libpgmodeler_ui/res/icones/stop.png b/libpgmodeler_ui/res/icones/stop.png new file mode 100644 index 0000000000000000000000000000000000000000..2fa991e063c1c802f9b4f3c648d818ad06d873ea GIT binary patch literal 563 zcmV-30?hr1P)t*Hv8XAR`|RJkVnM$3E=Uym&po%>~r_-tBQFN82Yd$v# zlx4{T!2QR2CAnT&5j;G6L0OhO91d{=?DsDifZ;S?Es49`9V~o*jey<)s;Y_!03%@} zlEC`4Ve>rsR#kPC@l66v(~Ncje0|J5oaUx!#;6*o>zWfVL6OxdIFqUCno$IbqF@?! z#HqS2-v14qi*yx55l5hHTc)a$<1#n_f*_v=Nq_|B zQ;dtJ%p?tfQ$?0#aW&BQJ)PO?NXU!xQ$lJu=YyeUoEiGQk5j;VPp67RLJ9-`Wu`Nu zQ$TrEpH>|2EtS?`fgc%FZ+=}fv)S~6v*?OCsjN>etYwO*r_7T zb4J|MiCAKTSyv(5fl`vYTor2gvJ@q+*W002ovPDHLkV1hz> B^8o+= literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/resources.qrc b/libpgmodeler_ui/res/resources.qrc index daa3d5b8e6..a9b4d60f48 100644 --- a/libpgmodeler_ui/res/resources.qrc +++ b/libpgmodeler_ui/res/resources.qrc @@ -242,6 +242,7 @@ icones/compactview.png icones/help_big.png icones/moreactions.png + icones/stop.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.cpp b/libpgmodeler_ui/src/sqlexecutionhelper.cpp new file mode 100644 index 0000000000..e44114adc7 --- /dev/null +++ b/libpgmodeler_ui/src/sqlexecutionhelper.cpp @@ -0,0 +1,73 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "sqlexecutionhelper.h" +#include + +SQLExecutionHelper::SQLExecutionHelper(void) : QObject(nullptr) +{ + +} + +void SQLExecutionHelper::setConnection(Connection conn) +{ + connection = conn; +} + +void SQLExecutionHelper::setCommand(const QString &cmd) +{ + command = cmd; +} + +void SQLExecutionHelper::executeCommand(void) +{ + try + { + ResultSet res; + bool fetched = false; + + connection.connect(true); + connection.executeAsyncCommand(command); + + do + { + fetched = connection.fetchSingleResult(res); + + if(this->thread()) + this->thread()->msleep(20); + } + while(fetched && res.isValid() && !cancelled); + + connection.close(); + + if(cancelled) + emit s_executionCancelled(); + else + emit s_executionFinished(); + } + catch(Exception &e) + { + connection.close(); + emit s_executionAborted(e); + } +} + +void SQLExecutionHelper::cancelCommand(void) +{ + cancelled = true; +} diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.h b/libpgmodeler_ui/src/sqlexecutionhelper.h new file mode 100644 index 0000000000..70ad76addb --- /dev/null +++ b/libpgmodeler_ui/src/sqlexecutionhelper.h @@ -0,0 +1,57 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler_ui +\class SQLExecutionHelper +\brief Implements a command execution helper that permit the execution of SQL commands in a thread +*/ + +#ifndef SQL_EXECUTION_HELPER_H +#define SQL_EXECUTION_HELPER_H + +#include +#include "connection.h" + +class SQLExecutionHelper : public QObject { + private: + Q_OBJECT + + Connection connection; + + QString command; + + bool cancelled; + + public: + SQLExecutionHelper(void); + + void setConnection(Connection conn); + void setCommand(const QString &cmd); + + public slots: + void executeCommand(void); + void cancelCommand(void); + + signals: + void s_executionFinished(void); + void s_executionCancelled(void); + void s_executionAborted(Exception e); +}; + +#endif diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 32d41a13e4..66d94e94ee 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -128,6 +128,11 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) toggleOutputPane(false); filename_wgt->setVisible(false); v_splitter->handle(1)->installEventFilter(this); + + sql_exec_hlp.moveToThread(&sql_exec_thread); + connect(&sql_exec_thread, SIGNAL(started()), &sql_exec_hlp, SLOT(executeCommand())); + connect(&sql_exec_hlp, SIGNAL(s_executionCancelled()), &sql_exec_thread, SLOT(quit())); + connect(stop_tb, SIGNAL(clicked(bool)), &sql_exec_hlp, SLOT(cancelCommand())); } SQLExecutionWidget::~SQLExecutionWidget(void) @@ -436,9 +441,9 @@ void SQLExecutionWidget::runSQLCommand(void) try { - ResultSet res; - QStringList conn_notices; - qint64 start_exec=0, end_exec=0, total_exec = 0; + //ResultSet res; + //QStringList conn_notices; + //qint64 start_exec=0, end_exec=0, total_exec = 0; output_tb->setChecked(true); @@ -449,7 +454,11 @@ void SQLExecutionWidget::runSQLCommand(void) msgoutput_lst->clear(); - if(!sql_cmd_conn.isStablished()) + sql_exec_hlp.setCommand(cmd); + sql_exec_hlp.setConnection(sql_cmd_conn); + sql_exec_thread.start(); + + /*if(!sql_cmd_conn.isStablished()) { sql_cmd_conn.setNoticeEnabled(true); sql_cmd_conn.connect(); @@ -504,7 +513,7 @@ void SQLExecutionWidget::runSQLCommand(void) output_tbw->setTabText(1, trUtf8("Messages (%1)").arg(msgoutput_lst->count())); - QApplication::restoreOverrideCursor(); + QApplication::restoreOverrideCursor(); */ } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index 9b8ff25be8..f210ca6057 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -34,6 +34,7 @@ #include "numberedtexteditor.h" #include "findreplacewidget.h" #include "resultsetmodel.h" +#include "sqlexecutionhelper.h" class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { private: @@ -45,6 +46,10 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { SchemaParser schparser; + QThread sql_exec_thread; + + SQLExecutionHelper sql_exec_hlp; + //! \brief Syntax highlighter for sql input field SyntaxHighlighter *sql_cmd_hl, diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 741cf5607c..c2d8301419 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -242,7 +242,7 @@ Run the specified SQL command - Run SQL + Run @@ -265,6 +265,50 @@ + + + + true + + + + 0 + 0 + + + + + 0 + 30 + + + + Run the specified SQL command + + + Stop + + + + :/icones/icones/stop.png:/icones/icones/stop.png + + + + 22 + 22 + + + + F6 + + + Qt::ToolButtonTextBesideIcon + + + true + + + diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index ec5fc797ec..35e47eca69 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -252,6 +252,9 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_ASG_INV_IDENTITY_COLUMN", QT_TR_NOOP("The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'.")}, {"ERR_REF_INV_AFFECTED_CMD", QT_TR_NOOP("Reference to an invalid affected command in policy `%1'!")}, {"ERR_REF_INV_SPECIAL_ROLE", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")}, + {"ERR_EXEC_SYNC_CMD_ASYN_CONN",QT_TR_NOOP("Executing an synchronous SQL command in an asynchronous connection!")}, + {"ERR_EXEC_ASYNC_CMD_SYN_CONN",QT_TR_NOOP("Executing an asynchronous SQL command in a synchronous connection!")}, + {"ERR_CONN_DATA_NOT_CONSUMED",QT_TR_NOOP("Failed to consume data from asynchronous connection! Error returned: `%1'")} }; Exception::Exception(void) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 24682bbc44..1d83e92936 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -279,12 +279,15 @@ enum ErrorType { ERR_NULL_PK_COLUMN, ERR_INV_IDENTITY_COLUMN, ERR_REF_INV_AFFECTED_CMD, - ERR_REF_INV_SPECIAL_ROLE + ERR_REF_INV_SPECIAL_ROLE, + ERR_EXEC_SYNC_CMD_ASYN_CONN, + ERR_EXEC_ASYNC_CMD_SYN_CONN, + ERR_CONN_DATA_NOT_CONSUMED }; class Exception { private: - static const int ERROR_COUNT=233; + static const int ERROR_COUNT=236; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ From a5e3e366ee3e91c36dec63353ff8722bb6bcf22a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 4 Jul 2018 15:56:44 -0300 Subject: [PATCH 066/425] SQL execution cancellation implementation checkpoint. --- libpgconnector/src/connection.cpp | 8 +- libpgconnector/src/resultset.cpp | 3 +- libpgmodeler_ui/src/resultsetmodel.cpp | 42 +++++++ libpgmodeler_ui/src/resultsetmodel.h | 4 +- libpgmodeler_ui/src/sqlexecutionhelper.cpp | 41 ++++++- libpgmodeler_ui/src/sqlexecutionhelper.h | 8 ++ libpgmodeler_ui/src/sqlexecutionwidget.cpp | 134 +++++++++++++++++++-- libpgmodeler_ui/src/sqlexecutionwidget.h | 20 ++- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 108 ++++++++--------- 9 files changed, 289 insertions(+), 79 deletions(-) diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index 13c8c48a70..01ded3d183 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -481,6 +481,10 @@ void Connection::executeAsyncCommand(const QString &sql) validateConnectionStatus(); notices.clear(); + PQsendQuery(connection, sql.toStdString().c_str()); + PQsetnonblocking(connection, 1); + PQsetSingleRowMode(connection); + //Prints the SQL to stdout when the flag is active if(print_sql) { @@ -488,10 +492,6 @@ void Connection::executeAsyncCommand(const QString &sql) out << QString("\n---\n") << sql << endl; } - PQsendQuery(connection, sql.toStdString().c_str()); - PQsetnonblocking(connection, 1); - PQsetSingleRowMode(connection); - //Raise an error in case the command sql execution is not sucessful if(strlen(PQerrorMessage(connection)) > 0) { diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index 646304fc66..4d19bbf1f6 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -55,10 +55,11 @@ ResultSet::ResultSet(PGresult *sql_result) //In case of sucess states the result will be created case PGRES_COMMAND_OK: case PGRES_TUPLES_OK: + case PGRES_SINGLE_TUPLE: case PGRES_COPY_OUT: case PGRES_COPY_IN: default: - empty_result=(res_state!=PGRES_TUPLES_OK && res_state!=PGRES_EMPTY_QUERY); + empty_result=(res_state!=PGRES_TUPLES_OK && res_state!=PGRES_SINGLE_TUPLE && res_state!=PGRES_EMPTY_QUERY); current_tuple=-1; is_res_copied=false; break; diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index 548ff7c3da..79c763b401 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -135,3 +135,45 @@ Qt::ItemFlags ResultSetModel::flags(const QModelIndex &) const return(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled ); } +void ResultSetModel::append(ResultSet &res) +{ + try + { + if(res.isValid() && !res.isEmpty()) + { + if(res.accessTuple(ResultSet::FIRST_TUPLE)) + { + do + { + for(int col=0; col < col_count; col++) + { + if(col < res.getColumnCount()) + { + if(res.isColumnBinaryFormat(col)) + item_data.push_back(trUtf8("[binary data]")); + else + item_data.push_back(res.getColumnValue(col)); + } + else + { + item_data.push_back(QString()); + } + } + } + while(res.accessTuple(ResultSet::NEXT_TUPLE)); + } + + row_count += res.getTupleCount(); + } + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +bool ResultSetModel::isEmpty(void) +{ + return(row_count <= 0); +} + diff --git a/libpgmodeler_ui/src/resultsetmodel.h b/libpgmodeler_ui/src/resultsetmodel.h index ec1a6a5a34..770d50e352 100644 --- a/libpgmodeler_ui/src/resultsetmodel.h +++ b/libpgmodeler_ui/src/resultsetmodel.h @@ -41,13 +41,15 @@ class ResultSetModel: public QAbstractTableModel { public: ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent = 0); - virtual int rowCount(const QModelIndex &) const; + virtual int rowCount(const QModelIndex & = QModelIndex()) const; virtual int columnCount(const QModelIndex &) const; virtual QModelIndex index(int row, int column, const QModelIndex &parent) const; virtual QModelIndex parent(const QModelIndex &) const; virtual QVariant data(const QModelIndex &index, int role) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const; virtual Qt::ItemFlags flags(const QModelIndex &) const; + void append(ResultSet &res); + bool isEmpty(void); }; #endif diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.cpp b/libpgmodeler_ui/src/sqlexecutionhelper.cpp index e44114adc7..05e1c8c136 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.cpp +++ b/libpgmodeler_ui/src/sqlexecutionhelper.cpp @@ -18,10 +18,13 @@ #include "sqlexecutionhelper.h" #include +#include +#include SQLExecutionHelper::SQLExecutionHelper(void) : QObject(nullptr) { - + cancelled = false; + result_model = nullptr; } void SQLExecutionHelper::setConnection(Connection conn) @@ -34,25 +37,55 @@ void SQLExecutionHelper::setCommand(const QString &cmd) command = cmd; } +ResultSetModel *SQLExecutionHelper::getResultSetModel(void) +{ + return(result_model); +} + +bool SQLExecutionHelper::isCancelled(void) +{ + return(cancelled); +} + +QStringList SQLExecutionHelper::getNotices(void) +{ + return(notices); +} + void SQLExecutionHelper::executeCommand(void) { try { ResultSet res; bool fetched = false; + Catalog catalog; + Connection aux_conn = connection; + catalog.setConnection(aux_conn); + result_model = nullptr; + cancelled = false; connection.connect(true); + connection.setNoticeEnabled(true); connection.executeAsyncCommand(command); do { fetched = connection.fetchSingleResult(res); - if(this->thread()) - this->thread()->msleep(20); + if(res.isValid()) + { + if(!result_model) + result_model = new ResultSetModel(res, catalog); + else + result_model->append(res); + } + + if(fetched && !res.isValid()) + break; } - while(fetched && res.isValid() && !cancelled); + while(!cancelled); + notices = connection.getNotices(); connection.close(); if(cancelled) diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.h b/libpgmodeler_ui/src/sqlexecutionhelper.h index 70ad76addb..d62b2b8ca6 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.h +++ b/libpgmodeler_ui/src/sqlexecutionhelper.h @@ -27,6 +27,7 @@ #include #include "connection.h" +#include "resultsetmodel.h" class SQLExecutionHelper : public QObject { private: @@ -36,13 +37,20 @@ class SQLExecutionHelper : public QObject { QString command; + ResultSetModel *result_model; + bool cancelled; + QStringList notices; + public: SQLExecutionHelper(void); void setConnection(Connection conn); void setCommand(const QString &cmd); + ResultSetModel *getResultSetModel(void); + bool isCancelled(void); + QStringList getNotices(void); public slots: void executeCommand(void); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 66d94e94ee..6c62bb0985 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -129,14 +129,25 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) filename_wgt->setVisible(false); v_splitter->handle(1)->installEventFilter(this); + stop_tb->setVisible(false); sql_exec_hlp.moveToThread(&sql_exec_thread); + connect(&sql_exec_thread, SIGNAL(started()), &sql_exec_hlp, SLOT(executeCommand())); - connect(&sql_exec_hlp, SIGNAL(s_executionCancelled()), &sql_exec_thread, SLOT(quit())); - connect(stop_tb, SIGNAL(clicked(bool)), &sql_exec_hlp, SLOT(cancelCommand())); + connect(&sql_exec_hlp, SIGNAL(s_executionCancelled()), this, SLOT(finishExecution())); + connect(&sql_exec_hlp, SIGNAL(s_executionFinished()), this, SLOT(finishExecution())); + connect(&sql_exec_hlp, SIGNAL(s_executionAborted(Exception)), &sql_exec_thread, SLOT(quit())); + connect(&sql_exec_hlp, SIGNAL(s_executionAborted(Exception)), this, SLOT(handleExecutionAborted(Exception))); + connect(stop_tb, SIGNAL(clicked(bool)), &sql_exec_hlp, SLOT(cancelCommand()), Qt::DirectConnection); } SQLExecutionWidget::~SQLExecutionWidget(void) { + if(sql_exec_thread.isRunning()) + { + sql_exec_hlp.cancelCommand(); + sql_exec_thread.quit(); + } + if(result_model) { results_tbw->blockSignals(true); @@ -225,6 +236,65 @@ void SQLExecutionWidget::fillResultsTable(ResultSet &res) } } +void SQLExecutionWidget::fillResultsTable(void) +{ + ResultSetModel *old_model = dynamic_cast(results_tbw->model()), + *new_model = sql_exec_hlp.getResultSetModel(); + + end_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); + total_exec = end_exec - start_exec; + + results_tbw->setSortingEnabled(false); + results_tbw->blockSignals(true); + results_tbw->setUpdatesEnabled(false); + results_tbw->setModel(nullptr); + + if(old_model) + delete(old_model); + + results_tbw->setModel(new_model); + results_tbw->resizeColumnsToContents(); + results_tbw->setUpdatesEnabled(true); + results_tbw->blockSignals(false); + + addToSQLHistory(sql_cmd_txt->toPlainText(), new_model->rowCount()); + + output_tbw->setTabEnabled(0, !new_model->isEmpty()); + results_parent->setVisible(!new_model->isEmpty()); + export_tb->setEnabled(!new_model->isEmpty()); + + if(!new_model->isEmpty()) + { + output_tbw->setTabText(0, trUtf8("Results (%1)").arg(new_model->rowCount())); + output_tbw->setCurrentIndex(0); + } + else + { + output_tbw->setTabText(0, trUtf8("Results")); + output_tbw->setCurrentIndex(1); + } + + msgoutput_lst->clear(); + + for(QString notice : sql_exec_hlp.getNotices()) + { + PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNS::formatMessage(QString("[%1]: %2").arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))).arg(notice)), + QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + } + + PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command successfully executed in %2. %3 %4") + .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))) + .arg(total_exec >= 1000 ? QString("%1 s").arg(total_exec/1000) : QString("%1 ms").arg(total_exec)) + .arg(new_model->isEmpty() ? trUtf8("Rows affected") : trUtf8("Rows retrieved")) + .arg(new_model->rowCount())), + QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + + output_tbw->setTabText(1, trUtf8("Messages (%1)").arg(msgoutput_lst->count())); +} + + void SQLExecutionWidget::showEvent(QShowEvent *) { sql_cmd_txt->setFocus(); @@ -247,6 +317,7 @@ void SQLExecutionWidget::resizeEvent(QResizeEvent *event) snippets_tb->setToolButtonStyle(style); export_tb->setToolButtonStyle(style); output_tb->setToolButtonStyle(style); + stop_tb->setToolButtonStyle(style); } } @@ -350,10 +421,11 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab } } -void SQLExecutionWidget::showError(Exception &e) +void SQLExecutionWidget::handleExecutionAborted(Exception e) { QString time_str=QString("[%1]:").arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))); + switchToExecutionMode(false); msgoutput_lst->clear(); PgModelerUiNS::createOutputListItem(msgoutput_lst, @@ -378,6 +450,16 @@ void SQLExecutionWidget::showError(Exception &e) output_tbw->setTabEnabled(0, false); } +void SQLExecutionWidget::finishExecution(void) +{ + sql_exec_thread.quit(); + + if(!sql_exec_hlp.isCancelled()) + fillResultsTable(); + + switchToExecutionMode(false); +} + void SQLExecutionWidget::addToSQLHistory(const QString &cmd, unsigned rows, const QString &error) { if(!cmd.isEmpty()) @@ -435,6 +517,34 @@ void SQLExecutionWidget::validateSQLHistoryLength(const QString &conn_id, const cmd_history_txt->appendPlainText(fmt_cmd); } +void SQLExecutionWidget::switchToExecutionMode(bool value) +{ + run_sql_tb->setVisible(!value); + stop_tb->setVisible(value); + file_tb->setEnabled(!value); + find_tb->setEnabled(!value); + clear_btn->setEnabled(!value); + snippets_tb->setEnabled(!value); + export_tb->setEnabled(!value); + output_tb->setEnabled(!value); + sql_cmd_txt->setEnabled(!value); + cmd_history_parent->setEnabled(!value); + find_history_parent->setEnabled(!value); + + if(value) + { + this->setCursor(Qt::WaitCursor); + sql_cmd_txt->setCursor(Qt::WaitCursor); + sql_cmd_txt->clearFocus(); + } + else + { + this->setCursor(Qt::ArrowCursor); + sql_cmd_txt->setCursor(Qt::ArrowCursor); + sql_cmd_txt->setFocus(); + } +} + void SQLExecutionWidget::runSQLCommand(void) { QString cmd=sql_cmd_txt->textCursor().selectedText(); @@ -443,7 +553,6 @@ void SQLExecutionWidget::runSQLCommand(void) { //ResultSet res; //QStringList conn_notices; - //qint64 start_exec=0, end_exec=0, total_exec = 0; output_tb->setChecked(true); @@ -453,10 +562,17 @@ void SQLExecutionWidget::runSQLCommand(void) cmd.replace(QChar::ParagraphSeparator, '\n'); msgoutput_lst->clear(); - sql_exec_hlp.setCommand(cmd); sql_exec_hlp.setConnection(sql_cmd_conn); + + start_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); sql_exec_thread.start(); + switchToExecutionMode(true); + + PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNS::formatMessage(trUtf8("[%1]: Running SQL command...") + .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz")))), + QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); /*if(!sql_cmd_conn.isStablished()) { @@ -469,7 +585,7 @@ void SQLExecutionWidget::runSQLCommand(void) QApplication::setOverrideCursor(Qt::WaitCursor); - start_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); + sql_cmd_conn.executeDMLCommand(cmd, res); conn_notices=sql_cmd_conn.getNotices(); @@ -518,9 +634,9 @@ void SQLExecutionWidget::runSQLCommand(void) catch(Exception &e) { addToSQLHistory(cmd, 0, e.getErrorMessage()); - QApplication::restoreOverrideCursor(); - sql_cmd_conn.close(); - showError(e); + //QApplication::restoreOverrideCursor(); + //sql_cmd_conn.close(); + //handleExecutionAborted(e); } } diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index f210ca6057..74dd407417 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -44,6 +44,8 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { static int cmd_history_max_len; + qint64 start_exec, end_exec, total_exec; + SchemaParser schparser; QThread sql_exec_thread; @@ -83,14 +85,15 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { //! \brief Stores the command on the sql command history void addToSQLHistory(const QString &cmd, unsigned rows=0, const QString &error=QString()); - //! \brief Show the exception message in the output widget - void showError(Exception &e); - //! \brief Fills the result grid with the specified result set void fillResultsTable(ResultSet &res); + void fillResultsTable(void); + static void validateSQLHistoryLength(const QString &conn_id, const QString &fmt_cmd = QString(), NumberedTextEditor *cmd_history_txt = nullptr); + void switchToExecutionMode(bool value); + protected: //! \brief Widget that serves as SQL commands input NumberedTextEditor *sql_cmd_txt, @@ -129,9 +132,6 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { //! \brief Exports the results to csv file static void exportResults(QTableView *results_tbw); - public slots: - void configureSnippets(void); - //! \brief Save the history of all connections open in the SQL Execution to the sql-history.conf static void saveSQLHistory(void); @@ -144,6 +144,14 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { static int getSQLHistoryMaxLength(void); + public slots: + void configureSnippets(void); + + //! \brief Show the exception message in the output widget + void handleExecutionAborted(Exception e); + + void finishExecution(void); + private slots: //! \brief Enables the command buttons when user fills the sql field void enableCommandButtons(void); diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index c2d8301419..578b4e8edd 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -131,9 +131,15 @@ 4 - + - true + false + + + + 0 + 0 + @@ -142,14 +148,14 @@ - Handle external SQL script + Run the specified SQL command - &Script + Run - :/icones/icones/codigosql.png:/icones/icones/codigosql.png + :/icones/icones/run.png:/icones/icones/run.png @@ -158,16 +164,7 @@ - Alt+F - - - false - - - false - - - QToolButton::InstantPopup + F6 Qt::ToolButtonTextBesideIcon @@ -178,9 +175,15 @@ - + - false + true + + + + 0 + 0 + @@ -189,14 +192,14 @@ - Search in SQL code + Cancel the execution of the current SQL command - Fi&nd + Stop - :/icones/icones/buscar.png:/icones/icones/buscar.png + :/icones/icones/stop.png:/icones/icones/stop.png @@ -204,14 +207,8 @@ 22 - - true - - - false - - - QToolButton::InstantPopup + + F6 Qt::ToolButtonTextBesideIcon @@ -222,15 +219,9 @@ - + - false - - - - 0 - 0 - + true @@ -239,14 +230,14 @@ - Run the specified SQL command + Handle external SQL script - Run + &Script - :/icones/icones/run.png:/icones/icones/run.png + :/icones/icones/codigosql.png:/icones/icones/codigosql.png @@ -255,7 +246,16 @@ - F6 + Alt+F + + + false + + + false + + + QToolButton::InstantPopup Qt::ToolButtonTextBesideIcon @@ -266,15 +266,9 @@ - + - true - - - - 0 - 0 - + false @@ -283,14 +277,14 @@ - Run the specified SQL command + Search in SQL code - Stop + Fi&nd - :/icones/icones/stop.png:/icones/icones/stop.png + :/icones/icones/buscar.png:/icones/icones/buscar.png @@ -298,8 +292,14 @@ 22 - - F6 + + true + + + false + + + QToolButton::InstantPopup Qt::ToolButtonTextBesideIcon @@ -624,7 +624,7 @@ QTabWidget::South - 0 + 1 false From a7157296d1e50bb96b9dd3bec2a1d04d6d42fa64 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 4 Jul 2018 18:04:32 -0300 Subject: [PATCH 067/425] Minor fix in sqlexecutionwidget.ui to force the exhibition of grid headers --- libpgconnector/src/connection.cpp | 1 - libpgmodeler_ui/ui/sqlexecutionwidget.ui | 6 ------ 2 files changed, 7 deletions(-) diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index c284c83acc..cfb9dce13f 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -518,4 +518,3 @@ void Connection::operator = (const Connection &conn) for(unsigned idx=OP_VALIDATION; idx <= OP_DIFF; idx++) default_for_oper[idx]=conn.default_for_oper[idx]; } - diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 741cf5607c..2d8701ea6a 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -634,18 +634,12 @@ QAbstractItemView::ContiguousSelection - - false - false true - - false - 25 From 42759e45deb85754961490c91b8755645eca322b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 5 Jul 2018 15:02:20 -0300 Subject: [PATCH 068/425] Finished the support to sql cancelation in SQLExecutionWidget --- libpgconnector/src/connection.cpp | 94 +------ libpgconnector/src/connection.h | 20 +- libpgmodeler_ui/src/sqlexecutionhelper.cpp | 41 +-- libpgmodeler_ui/src/sqlexecutionhelper.h | 14 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 282 +++++++-------------- libpgmodeler_ui/src/sqlexecutionwidget.h | 11 +- libpgmodeler_ui/src/sqltoolwidget.cpp | 11 +- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 6 - libutils/src/exception.cpp | 5 +- libutils/src/exception.h | 7 +- 10 files changed, 143 insertions(+), 348 deletions(-) diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index 01ded3d183..4a8569db66 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -57,7 +57,6 @@ Connection::Connection(void) { connection=nullptr; auto_browse_db=false; - async_conn=false; cmd_exec_timeout=0; for(unsigned idx=OP_VALIDATION; idx <= OP_DIFF; idx++) @@ -212,7 +211,7 @@ bool Connection::isConnErrorSilenced(void) return(silence_conn_err); } -void Connection::connect(bool async) +void Connection::connect(void) { /* If the connection string is not established indicates that the user is trying to connect without configuring connection parameters, @@ -235,7 +234,6 @@ void Connection::connect(bool async) //Try to connect to the database connection=PQconnectdb(connection_str.toStdString().c_str()); last_cmd_execution=QDateTime::currentDateTime(); - async_conn = async; /* If the connection descriptor has not been allocated or if the connection state is CONNECTION_BAD it indicates that the connection was not successful */ @@ -267,7 +265,6 @@ void Connection::close(void) connection=nullptr; last_cmd_execution=QDateTime(); - async_conn=false; } } @@ -397,9 +394,6 @@ void Connection::executeDMLCommand(const QString &sql, ResultSet &result) if(!connection) throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); - if(async_conn) - throw Exception(ERR_EXEC_SYNC_CMD_ASYN_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); - validateConnectionStatus(); notices.clear(); @@ -441,9 +435,6 @@ void Connection::executeDDLCommand(const QString &sql) if(!connection) throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); - if(async_conn) - throw Exception(ERR_EXEC_SYNC_CMD_ASYN_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); - validateConnectionStatus(); notices.clear(); sql_res=PQexec(connection, sql.toStdString().c_str()); @@ -470,80 +461,6 @@ void Connection::executeDDLCommand(const QString &sql) PQclear(sql_res); } -void Connection::executeAsyncCommand(const QString &sql) -{ - if(!connection) - throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); - - if(!async_conn) - throw Exception(ERR_EXEC_SYNC_CMD_ASYN_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); - - validateConnectionStatus(); - notices.clear(); - - PQsendQuery(connection, sql.toStdString().c_str()); - PQsetnonblocking(connection, 1); - PQsetSingleRowMode(connection); - - //Prints the SQL to stdout when the flag is active - if(print_sql) - { - QTextStream out(stdout); - out << QString("\n---\n") << sql << endl; - } - - //Raise an error in case the command sql execution is not sucessful - if(strlen(PQerrorMessage(connection)) > 0) - { - throw Exception(QString(Exception::getErrorMessage(ERR_CMD_SQL_NOT_EXECUTED)) - .arg(PQerrorMessage(connection)), - ERR_CMD_SQL_NOT_EXECUTED, __PRETTY_FUNCTION__, __FILE__, __LINE__); - } -} - -bool Connection::fetchSingleResult(ResultSet &result) -{ - PGresult *sql_res=nullptr; - - if(!connection) - throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); - - if(!async_conn) - throw Exception(ERR_EXEC_SYNC_CMD_ASYN_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); - - if(!PQconsumeInput(connection)) - { - throw Exception(QString(Exception::getErrorMessage(ERR_CONN_DATA_NOT_CONSUMED)) - .arg(PQerrorMessage(connection)), - ERR_CONN_DATA_NOT_CONSUMED, __PRETTY_FUNCTION__, __FILE__, __LINE__); - } - - if(!PQisBusy(connection)) - { - result.clearResultSet(); - sql_res = PQgetResult(connection); - - if(sql_res) - { - ResultSet *new_res=nullptr; - - //Generates the resultset based on the sql result descriptor - new_res=new ResultSet(sql_res); - - //Copy the new resultset to the parameter resultset - result=*(new_res); - - //Deallocate the new resultset - delete(new_res); - PQclear(sql_res); - } - - return(true); - } - - return(false); -} - void Connection::setDefaultForOperation(unsigned op_id, bool value) { if(op_id > OP_NONE) @@ -593,7 +510,6 @@ void Connection::operator = (const Connection &conn) if(this->isStablished()) this->close(); - this->async_conn=false; this->auto_browse_db=conn.auto_browse_db; this->connection_params=conn.connection_params; this->connection_str=conn.connection_str; @@ -603,3 +519,11 @@ void Connection::operator = (const Connection &conn) default_for_oper[idx]=conn.default_for_oper[idx]; } +void Connection::requestCancel(void) +{ + if(!connection) + throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + + PQrequestCancel(connection); +} + diff --git a/libpgconnector/src/connection.h b/libpgconnector/src/connection.h index f227f1d667..c064f7b35f 100644 --- a/libpgconnector/src/connection.h +++ b/libpgconnector/src/connection.h @@ -86,12 +86,7 @@ class Connection { /*! \brief Indicates in which operations (diff, export, import, validation) the connection is used if none is explicitly specified by the user in the UI */ - default_for_oper[4], - - /*! \brief Indicates that the connection is in asynchronous mode. An async connection should run the sql commands - * using executeAsyncCommand() and retrieve results via fetchSingleResult(). Any try to call executeDMLCommand or executeDDLCommand - * in a async connection will raise errors */ - async_conn; + default_for_oper[4]; /*! \brief Validates the connection status (command exec. timeout and connection status) and raise errors in case of exceeded timeout or bad connection. This method is called prior any @@ -173,10 +168,8 @@ class Connection { //! \brief Set if the database configured on the connection is auto browseable when using the SQLTool manage database void setAutoBrowseDB(bool value); - /*! \brief Open the connection to the database. The async parameter switches the connection to asynchronous mode and the results are - * retrived row by row (see PQsetnonblocking and PQsetSingleRow). - * In this mode the commands need to be executed using executeAsyncCommand() and results fetched using fetchSingleResult() */ - void connect(bool async = false); + //! \brief Open the connection to the database. + void connect(void); //! \brief Resets the database connection void reset(void); @@ -184,6 +177,9 @@ class Connection { //! \brief Close the opened connection void close(void); + //! \brief Request the cancel of the running command on a opened connection + void requestCancel(void); + //! \brief Returns the value of specified parameter name QString getConnectionParam(const QString ¶m); @@ -233,10 +229,6 @@ class Connection { to be an data definition one */ void executeDDLCommand(const QString &sql); - void executeAsyncCommand(const QString &sql); - - bool fetchSingleResult(ResultSet &res); - //! \brief Toggles the default status for the connect in the specified operation (OP_??? constants). void setDefaultForOperation(unsigned op_id, bool value); diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.cpp b/libpgmodeler_ui/src/sqlexecutionhelper.cpp index 05e1c8c136..6646260c19 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.cpp +++ b/libpgmodeler_ui/src/sqlexecutionhelper.cpp @@ -17,9 +17,6 @@ */ #include "sqlexecutionhelper.h" -#include -#include -#include SQLExecutionHelper::SQLExecutionHelper(void) : QObject(nullptr) { @@ -27,14 +24,10 @@ SQLExecutionHelper::SQLExecutionHelper(void) : QObject(nullptr) result_model = nullptr; } -void SQLExecutionHelper::setConnection(Connection conn) -{ - connection = conn; -} - -void SQLExecutionHelper::setCommand(const QString &cmd) +void SQLExecutionHelper::setParameters(Connection conn, const QString &cmd) { command = cmd; + connection = conn; } ResultSetModel *SQLExecutionHelper::getResultSetModel(void) @@ -57,41 +50,22 @@ void SQLExecutionHelper::executeCommand(void) try { ResultSet res; - bool fetched = false; Catalog catalog; Connection aux_conn = connection; catalog.setConnection(aux_conn); result_model = nullptr; cancelled = false; - connection.connect(true); + connection.connect(); connection.setNoticeEnabled(true); - connection.executeAsyncCommand(command); - - do - { - fetched = connection.fetchSingleResult(res); + connection.executeDMLCommand(command, res); - if(res.isValid()) - { - if(!result_model) - result_model = new ResultSetModel(res, catalog); - else - result_model->append(res); - } - - if(fetched && !res.isValid()) - break; - } - while(!cancelled); + if(!res.isEmpty()) + result_model = new ResultSetModel(res, catalog); notices = connection.getNotices(); connection.close(); - - if(cancelled) - emit s_executionCancelled(); - else - emit s_executionFinished(); + emit s_executionFinished(res.getTupleCount()); } catch(Exception &e) { @@ -102,5 +76,6 @@ void SQLExecutionHelper::executeCommand(void) void SQLExecutionHelper::cancelCommand(void) { + connection.requestCancel(); cancelled = true; } diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.h b/libpgmodeler_ui/src/sqlexecutionhelper.h index d62b2b8ca6..311897d940 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.h +++ b/libpgmodeler_ui/src/sqlexecutionhelper.h @@ -26,6 +26,7 @@ #define SQL_EXECUTION_HELPER_H #include +#include #include "connection.h" #include "resultsetmodel.h" @@ -41,15 +42,22 @@ class SQLExecutionHelper : public QObject { bool cancelled; + int affected_rows; + QStringList notices; public: SQLExecutionHelper(void); - void setConnection(Connection conn); - void setCommand(const QString &cmd); + //! \brief Configures the execution params. (connection and sql command to be executed) + void setParameters(Connection conn, const QString &cmd); + + //! \brief Returns the result set model created in the execution. This object is not deleted after the execution. ResultSetModel *getResultSetModel(void); + bool isCancelled(void); + + //! \brief Returns the notices generated by the execution QStringList getNotices(void); public slots: @@ -57,7 +65,7 @@ class SQLExecutionHelper : public QObject { void cancelCommand(void); signals: - void s_executionFinished(void); + void s_executionFinished(int rows_affected); void s_executionCancelled(void); void s_executionAborted(Exception e); }; diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 6c62bb0985..9f9ca1b430 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -33,8 +33,6 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) { setupUi(this); - result_model = nullptr; - sql_cmd_txt=PgModelerUiNS::createNumberedTextEditor(sql_cmd_wgt); cmd_history_txt=PgModelerUiNS::createNumberedTextEditor(cmd_history_parent); cmd_history_txt->setCustomContextMenuEnabled(false); @@ -134,7 +132,7 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) connect(&sql_exec_thread, SIGNAL(started()), &sql_exec_hlp, SLOT(executeCommand())); connect(&sql_exec_hlp, SIGNAL(s_executionCancelled()), this, SLOT(finishExecution())); - connect(&sql_exec_hlp, SIGNAL(s_executionFinished()), this, SLOT(finishExecution())); + connect(&sql_exec_hlp, SIGNAL(s_executionFinished(int)), this, SLOT(finishExecution(int))); connect(&sql_exec_hlp, SIGNAL(s_executionAborted(Exception)), &sql_exec_thread, SLOT(quit())); connect(&sql_exec_hlp, SIGNAL(s_executionAborted(Exception)), this, SLOT(handleExecutionAborted(Exception))); connect(stop_tb, SIGNAL(clicked(bool)), &sql_exec_hlp, SLOT(cancelCommand()), Qt::DirectConnection); @@ -148,12 +146,7 @@ SQLExecutionWidget::~SQLExecutionWidget(void) sql_exec_thread.quit(); } - if(result_model) - { - results_tbw->blockSignals(true); - results_tbw->setModel(nullptr); - delete(result_model); - } + destroyResultModel(); } bool SQLExecutionWidget::eventFilter(QObject *object, QEvent *event) @@ -204,97 +197,11 @@ void SQLExecutionWidget::enableCommandButtons(void) clear_btn->setEnabled(run_sql_tb->isEnabled()); } -void SQLExecutionWidget::fillResultsTable(ResultSet &res) -{ - try - { - Catalog catalog; - Connection aux_conn; - - aux_conn.setConnectionParams(sql_cmd_conn.getConnectionParams()); - export_tb->setEnabled(res.getTupleCount() > 0); - catalog.setConnection(aux_conn); - - results_tbw->setSortingEnabled(false); - results_tbw->blockSignals(true); - results_tbw->setUpdatesEnabled(false); - results_tbw->setModel(nullptr); - - if(result_model) - delete(result_model); - - result_model = new ResultSetModel(res, catalog); - - results_tbw->setModel(result_model); - results_tbw->resizeColumnsToContents(); - results_tbw->setUpdatesEnabled(true); - results_tbw->blockSignals(false); - } - catch(Exception &e) - { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } -} - void SQLExecutionWidget::fillResultsTable(void) { - ResultSetModel *old_model = dynamic_cast(results_tbw->model()), - *new_model = sql_exec_hlp.getResultSetModel(); - - end_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); - total_exec = end_exec - start_exec; - - results_tbw->setSortingEnabled(false); - results_tbw->blockSignals(true); - results_tbw->setUpdatesEnabled(false); - results_tbw->setModel(nullptr); - - if(old_model) - delete(old_model); - - results_tbw->setModel(new_model); - results_tbw->resizeColumnsToContents(); - results_tbw->setUpdatesEnabled(true); - results_tbw->blockSignals(false); - - addToSQLHistory(sql_cmd_txt->toPlainText(), new_model->rowCount()); - - output_tbw->setTabEnabled(0, !new_model->isEmpty()); - results_parent->setVisible(!new_model->isEmpty()); - export_tb->setEnabled(!new_model->isEmpty()); - - if(!new_model->isEmpty()) - { - output_tbw->setTabText(0, trUtf8("Results (%1)").arg(new_model->rowCount())); - output_tbw->setCurrentIndex(0); - } - else - { - output_tbw->setTabText(0, trUtf8("Results")); - output_tbw->setCurrentIndex(1); - } - msgoutput_lst->clear(); - - for(QString notice : sql_exec_hlp.getNotices()) - { - PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(QString("[%1]: %2").arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))).arg(notice)), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); - } - - PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command successfully executed in %2. %3 %4") - .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))) - .arg(total_exec >= 1000 ? QString("%1 s").arg(total_exec/1000) : QString("%1 ms").arg(total_exec)) - .arg(new_model->isEmpty() ? trUtf8("Rows affected") : trUtf8("Rows retrieved")) - .arg(new_model->rowCount())), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); - - output_tbw->setTabText(1, trUtf8("Messages (%1)").arg(msgoutput_lst->count())); } - void SQLExecutionWidget::showEvent(QShowEvent *) { sql_cmd_txt->setFocus(); @@ -448,14 +355,70 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) output_tbw->setTabText(1, trUtf8("Messages (%1)").arg(msgoutput_lst->count())); output_tbw->setCurrentIndex(1); output_tbw->setTabEnabled(0, false); + + addToSQLHistory(sql_cmd_txt->toPlainText(), 0, e.getErrorMessage()); } -void SQLExecutionWidget::finishExecution(void) +void SQLExecutionWidget::finishExecution(int rows_affected) { sql_exec_thread.quit(); - if(!sql_exec_hlp.isCancelled()) - fillResultsTable(); + if(sql_exec_hlp.isCancelled()) + destroyResultModel(); + else + { + bool empty = false; + ResultSetModel *res_model = sql_exec_hlp.getResultSetModel(); + + results_tbw->setSortingEnabled(false); + results_tbw->blockSignals(true); + results_tbw->setUpdatesEnabled(false); + destroyResultModel(); + results_tbw->setModel(res_model); + results_tbw->resizeColumnsToContents(); + results_tbw->setUpdatesEnabled(true); + results_tbw->blockSignals(false); + + end_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); + total_exec = end_exec - start_exec; + + addToSQLHistory(sql_cmd_txt->toPlainText(), rows_affected); + + empty = (!res_model || res_model->rowCount() == 0); + output_tbw->setTabEnabled(0, !empty); + results_parent->setVisible(!empty); + export_tb->setEnabled(!empty); + + if(!empty) + { + output_tbw->setTabText(0, trUtf8("Results (%1)").arg(res_model->rowCount())); + output_tbw->setCurrentIndex(0); + } + else + { + output_tbw->setTabText(0, trUtf8("Results")); + output_tbw->setCurrentIndex(1); + } + + msgoutput_lst->clear(); + + for(QString notice : sql_exec_hlp.getNotices()) + { + PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNS::formatMessage(QString("[%1]: %2").arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))).arg(notice)), + QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + } + + PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command successfully executed in %2. %3 %4") + .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))) + .arg(total_exec >= 1000 ? QString("%1 s").arg(total_exec/1000) : QString("%1 ms").arg(total_exec)) + .arg(!res_model ? trUtf8("Rows affected") : trUtf8("Rows retrieved")) + .arg(rows_affected)), + QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + + output_tbw->setTabText(1, trUtf8("Messages (%1)").arg(msgoutput_lst->count())); + } switchToExecutionMode(false); } @@ -469,17 +432,19 @@ void SQLExecutionWidget::addToSQLHistory(const QString &cmd, unsigned rows, cons if(!cmd_history_txt->toPlainText().isEmpty()) fmt_cmd += QString("\n"); - fmt_cmd += QString("-- Executed at [%1] -- \n").arg(QDateTime::currentDateTime().toString(QString("yyyy-MM-dd hh:mm:ss.zzz"))); + fmt_cmd += QString("-- %1 [%2] -- \n") + .arg(trUtf8("Executed at")) + .arg(QDateTime::currentDateTime().toString(QString("yyyy-MM-dd hh:mm:ss.zzz"))); fmt_cmd += cmd; fmt_cmd += QChar('\n'); if(!error.isEmpty()) { - fmt_cmd += QString("-- Query failed --\n"); + fmt_cmd += QString("-- %1 --\n").arg(trUtf8("Query failed")); fmt_cmd += QString("/*\n%1\n*/\n").arg(error); } else - fmt_cmd += QString("-- Rows retrieved: %1\n").arg(rows); + fmt_cmd += QString("-- %1 %2\n").arg(trUtf8("Rows:")).arg(rows); if(!fmt_cmd.trimmed().endsWith(ParsersAttributes::DDL_END_TOKEN)) fmt_cmd += ParsersAttributes::DDL_END_TOKEN + QChar('\n'); @@ -545,99 +510,42 @@ void SQLExecutionWidget::switchToExecutionMode(bool value) } } -void SQLExecutionWidget::runSQLCommand(void) +void SQLExecutionWidget::destroyResultModel(void) { - QString cmd=sql_cmd_txt->textCursor().selectedText(); - - try + if(results_tbw->model()) { - //ResultSet res; - //QStringList conn_notices; - - output_tb->setChecked(true); - - if(cmd.isEmpty()) - cmd=sql_cmd_txt->toPlainText(); - else - cmd.replace(QChar::ParagraphSeparator, '\n'); - - msgoutput_lst->clear(); - sql_exec_hlp.setCommand(cmd); - sql_exec_hlp.setConnection(sql_cmd_conn); - - start_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); - sql_exec_thread.start(); - switchToExecutionMode(true); - - PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(trUtf8("[%1]: Running SQL command...") - .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz")))), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); - - /*if(!sql_cmd_conn.isStablished()) - { - sql_cmd_conn.setNoticeEnabled(true); - sql_cmd_conn.connect(); - - //The connection will break the execution if it keeps idle for one hour or more - sql_cmd_conn.setSQLExecutionTimout(3600); - } - - QApplication::setOverrideCursor(Qt::WaitCursor); - - - sql_cmd_conn.executeDMLCommand(cmd, res); - - conn_notices=sql_cmd_conn.getNotices(); - addToSQLHistory(cmd, res.getTupleCount()); - - output_tbw->setTabEnabled(0, !res.isEmpty()); - results_parent->setVisible(!res.isEmpty()); - export_tb->setEnabled(!res.isEmpty()); - - if(!res.isEmpty()) - { - fillResultsTable(res); - output_tbw->setTabText(0, trUtf8("Results (%1)").arg(results_tbw->model()->rowCount())); - output_tbw->setCurrentIndex(0); - } - else - { - output_tbw->setTabText(0, trUtf8("Results")); - output_tbw->setCurrentIndex(1); - } + ResultSetModel *result_model = dynamic_cast(results_tbw->model()); + results_tbw->blockSignals(true); + results_tbw->setModel(nullptr); + delete(result_model); + results_tbw->blockSignals(false); + } +} - msgoutput_lst->clear(); +void SQLExecutionWidget::runSQLCommand(void) +{ + QString cmd=sql_cmd_txt->textCursor().selectedText(); - for(QString notice : conn_notices) - { - PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(QString("[%1]: %2").arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))).arg(notice)), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); - } + output_tb->setChecked(true); - end_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); - total_exec = end_exec - start_exec; - - PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command successfully executed in %2. %3 %4") - .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))) - .arg(total_exec >= 1000 ? QString("%1 s").arg(total_exec/1000) : QString("%1 ms").arg(total_exec)) - .arg(res.isEmpty() ? trUtf8("Rows affected") : trUtf8("Rows retrieved")) - .arg(res.getTupleCount())), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + if(cmd.isEmpty()) + cmd=sql_cmd_txt->toPlainText(); + else + cmd.replace(QChar::ParagraphSeparator, '\n'); - output_tbw->setTabText(1, trUtf8("Messages (%1)").arg(msgoutput_lst->count())); + msgoutput_lst->clear(); + sql_exec_hlp.setParameters(sql_cmd_conn, cmd); + start_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); + sql_exec_thread.start(); + switchToExecutionMode(true); - QApplication::restoreOverrideCursor(); */ - } - catch(Exception &e) - { - addToSQLHistory(cmd, 0, e.getErrorMessage()); - //QApplication::restoreOverrideCursor(); - //sql_cmd_conn.close(); - //handleExecutionAborted(e); - } + output_tbw->setTabEnabled(0, false); + output_tbw->setTabText(0, trUtf8("Results")); + output_tbw->setCurrentIndex(1); + PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNS::formatMessage(trUtf8("[%1]: The query is running...") + .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz")))), + QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); } void SQLExecutionWidget::saveCommands(void) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index 74dd407417..aaab858171 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -76,8 +76,6 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { FindReplaceWidget *find_history_wgt; - ResultSetModel *result_model; - /*! \brief Enables/Disables the fields for sql input and execution. When enabling a new connection to server will be opened. */ void enableSQLExecution(bool enable); @@ -85,15 +83,14 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { //! \brief Stores the command on the sql command history void addToSQLHistory(const QString &cmd, unsigned rows=0, const QString &error=QString()); - //! \brief Fills the result grid with the specified result set - void fillResultsTable(ResultSet &res); - void fillResultsTable(void); static void validateSQLHistoryLength(const QString &conn_id, const QString &fmt_cmd = QString(), NumberedTextEditor *cmd_history_txt = nullptr); void switchToExecutionMode(bool value); + void destroyResultModel(void); + protected: //! \brief Widget that serves as SQL commands input NumberedTextEditor *sql_cmd_txt, @@ -150,8 +147,6 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { //! \brief Show the exception message in the output widget void handleExecutionAborted(Exception e); - void finishExecution(void); - private slots: //! \brief Enables the command buttons when user fills the sql field void enableCommandButtons(void); @@ -174,6 +169,8 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { void showHistoryContextMenu(void); + void finishExecution(int rows_affected = 0); + friend class SQLToolWidget; }; diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 906b9564a8..7ba9964ce3 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -342,9 +342,12 @@ void SQLToolWidget::showSnippet(const QString &snip) sql_exec_wgt=dynamic_cast(sql_exec_tbw->currentWidget()); - QTextCursor cursor=sql_exec_wgt->sql_cmd_txt->textCursor(); - cursor.movePosition(QTextCursor::End); + if(sql_exec_wgt->sql_cmd_txt->isEnabled()) + { + QTextCursor cursor=sql_exec_wgt->sql_cmd_txt->textCursor(); + cursor.movePosition(QTextCursor::End); - sql_exec_wgt->sql_cmd_txt->appendPlainText(snip); - sql_exec_wgt->sql_cmd_txt->setTextCursor(cursor); + sql_exec_wgt->sql_cmd_txt->appendPlainText(snip); + sql_exec_wgt->sql_cmd_txt->setTextCursor(cursor); + } } diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 578b4e8edd..ccf4ab3881 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -678,18 +678,12 @@ QAbstractItemView::ContiguousSelection - - false - false true - - false - 25 diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 35e47eca69..568352c0db 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -251,10 +251,7 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_NULL_PK_COLUMN", QT_TR_NOOP("The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it!")}, {"ERR_ASG_INV_IDENTITY_COLUMN", QT_TR_NOOP("The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'.")}, {"ERR_REF_INV_AFFECTED_CMD", QT_TR_NOOP("Reference to an invalid affected command in policy `%1'!")}, - {"ERR_REF_INV_SPECIAL_ROLE", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")}, - {"ERR_EXEC_SYNC_CMD_ASYN_CONN",QT_TR_NOOP("Executing an synchronous SQL command in an asynchronous connection!")}, - {"ERR_EXEC_ASYNC_CMD_SYN_CONN",QT_TR_NOOP("Executing an asynchronous SQL command in a synchronous connection!")}, - {"ERR_CONN_DATA_NOT_CONSUMED",QT_TR_NOOP("Failed to consume data from asynchronous connection! Error returned: `%1'")} + {"ERR_REF_INV_SPECIAL_ROLE", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")} }; Exception::Exception(void) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 1d83e92936..24682bbc44 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -279,15 +279,12 @@ enum ErrorType { ERR_NULL_PK_COLUMN, ERR_INV_IDENTITY_COLUMN, ERR_REF_INV_AFFECTED_CMD, - ERR_REF_INV_SPECIAL_ROLE, - ERR_EXEC_SYNC_CMD_ASYN_CONN, - ERR_EXEC_ASYNC_CMD_SYN_CONN, - ERR_CONN_DATA_NOT_CONSUMED + ERR_REF_INV_SPECIAL_ROLE }; class Exception { private: - static const int ERROR_COUNT=236; + static const int ERROR_COUNT=233; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ From 52f495d13d0ed457a72d76703d1755d9e40e9a86 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 6 Jul 2018 08:40:38 -0300 Subject: [PATCH 069/425] Minor adjustment in SQLExecutionHelper to keep the connection open even the command finishes successfully in order to allow transactional commands --- libpgmodeler_ui/src/sqlexecutionhelper.cpp | 23 ++++++++++++++++------ libpgmodeler_ui/src/sqlexecutionhelper.h | 5 +++-- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 9 ++++----- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 2 +- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.cpp b/libpgmodeler_ui/src/sqlexecutionhelper.cpp index 6646260c19..fd511c60f7 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.cpp +++ b/libpgmodeler_ui/src/sqlexecutionhelper.cpp @@ -24,12 +24,16 @@ SQLExecutionHelper::SQLExecutionHelper(void) : QObject(nullptr) result_model = nullptr; } -void SQLExecutionHelper::setParameters(Connection conn, const QString &cmd) +void SQLExecutionHelper::setConnection(Connection conn) { - command = cmd; connection = conn; } +void SQLExecutionHelper::setCommand(const QString &cmd) +{ + command = cmd; +} + ResultSetModel *SQLExecutionHelper::getResultSetModel(void) { return(result_model); @@ -51,20 +55,27 @@ void SQLExecutionHelper::executeCommand(void) { ResultSet res; Catalog catalog; - Connection aux_conn = connection; + Connection aux_conn = Connection(connection.getConnectionParams()); catalog.setConnection(aux_conn); result_model = nullptr; cancelled = false; - connection.connect(); - connection.setNoticeEnabled(true); + + if(!connection.isStablished()) + { + connection.connect(); + connection.setNoticeEnabled(true); + + //The connection will break the execution if it keeps idle for one hour or more + connection.setSQLExecutionTimout(3600); + } + connection.executeDMLCommand(command, res); if(!res.isEmpty()) result_model = new ResultSetModel(res, catalog); notices = connection.getNotices(); - connection.close(); emit s_executionFinished(res.getTupleCount()); } catch(Exception &e) diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.h b/libpgmodeler_ui/src/sqlexecutionhelper.h index 311897d940..ab3c5205a4 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.h +++ b/libpgmodeler_ui/src/sqlexecutionhelper.h @@ -49,8 +49,9 @@ class SQLExecutionHelper : public QObject { public: SQLExecutionHelper(void); - //! \brief Configures the execution params. (connection and sql command to be executed) - void setParameters(Connection conn, const QString &cmd); + void setConnection(Connection conn); + + void setCommand(const QString &cmd); //! \brief Returns the result set model created in the execution. This object is not deleted after the execution. ResultSetModel *getResultSetModel(void); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 9f9ca1b430..946262ba29 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -182,7 +182,7 @@ bool SQLExecutionWidget::eventFilter(QObject *object, QEvent *event) void SQLExecutionWidget::setConnection(Connection conn) { - sql_cmd_conn=conn; + sql_exec_hlp.setConnection(conn); db_name_lbl->setText(QString("%1@%2:%3") .arg(conn.getConnectionParam(Connection::PARAM_DB_NAME)) .arg(conn.getConnectionParam(Connection::PARAM_SERVER_IP).isEmpty() ? @@ -361,8 +361,6 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) void SQLExecutionWidget::finishExecution(int rows_affected) { - sql_exec_thread.quit(); - if(sql_exec_hlp.isCancelled()) destroyResultModel(); else @@ -421,6 +419,7 @@ void SQLExecutionWidget::finishExecution(int rows_affected) } switchToExecutionMode(false); + sql_exec_thread.quit(); } void SQLExecutionWidget::addToSQLHistory(const QString &cmd, unsigned rows, const QString &error) @@ -534,7 +533,7 @@ void SQLExecutionWidget::runSQLCommand(void) cmd.replace(QChar::ParagraphSeparator, '\n'); msgoutput_lst->clear(); - sql_exec_hlp.setParameters(sql_cmd_conn, cmd); + sql_exec_hlp.setCommand(cmd); start_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); sql_exec_thread.start(); switchToExecutionMode(true); @@ -543,7 +542,7 @@ void SQLExecutionWidget::runSQLCommand(void) output_tbw->setTabText(0, trUtf8("Results")); output_tbw->setCurrentIndex(1); PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(trUtf8("[%1]: The query is running...") + PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command is running...") .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz")))), QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); } diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index ccf4ab3881..a56b0a7675 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -208,7 +208,7 @@ - F6 + Esc Qt::ToolButtonTextBesideIcon From 13703385379686730c376bac2bee5c0047372b8b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 6 Jul 2018 09:03:05 -0300 Subject: [PATCH 070/425] Configured the shortcut for stop button on SQLExecutionWidget --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 946262ba29..760d7360bf 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -77,6 +77,7 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) connect(find_replace_wgt->hide_tb, SIGNAL(clicked(bool)), find_tb, SLOT(toggle())); run_sql_tb->setToolTip(run_sql_tb->toolTip() + QString(" (%1)").arg(run_sql_tb->shortcut().toString())); + stop_tb->setToolTip(stop_tb->toolTip() + QString(" (%1)").arg(stop_tb->shortcut().toString())); export_tb->setToolTip(export_tb->toolTip() + QString(" (%1)").arg(export_tb->shortcut().toString())); file_tb->setToolTip(file_tb->toolTip() + QString(" (%1)").arg(file_tb->shortcut().toString())); output_tb->setToolTip(output_tb->toolTip() + QString(" (%1)").arg(output_tb->shortcut().toString())); @@ -183,6 +184,8 @@ bool SQLExecutionWidget::eventFilter(QObject *object, QEvent *event) void SQLExecutionWidget::setConnection(Connection conn) { sql_exec_hlp.setConnection(conn); + sql_cmd_conn = conn; + db_name_lbl->setText(QString("%1@%2:%3") .arg(conn.getConnectionParam(Connection::PARAM_DB_NAME)) .arg(conn.getConnectionParam(Connection::PARAM_SERVER_IP).isEmpty() ? @@ -439,7 +442,7 @@ void SQLExecutionWidget::addToSQLHistory(const QString &cmd, unsigned rows, cons if(!error.isEmpty()) { - fmt_cmd += QString("-- %1 --\n").arg(trUtf8("Query failed")); + fmt_cmd += QString("-- %1 --\n").arg(trUtf8("Command failed")); fmt_cmd += QString("/*\n%1\n*/\n").arg(error); } else From 8b3528a438ff6bb86ad3762878756a8941230ec3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 6 Jul 2018 19:11:57 -0300 Subject: [PATCH 071/425] Minor form size adjustments --- libpgmodeler_ui/src/tablewidget.cpp | 2 +- libpgmodeler_ui/src/viewwidget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 76ee54d7fc..6cec366e9a 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -159,7 +159,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) configureFormLayout(table_grid, OBJ_TABLE); configureTabOrder({ tag_sel }); - setMinimumSize(600, 610); + setMinimumSize(660, 620); } template diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index eefba37993..58cab2588b 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -138,7 +138,7 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) connect(schema_sel, SIGNAL(s_selectorCleared(void)), this, SLOT(updateCodePreview(void))); configureTabOrder({ tag_sel, ordinary_rb, recursive_rb, with_no_data_chk, tabWidget }); - setMinimumSize(600, 650); + setMinimumSize(660, 650); } catch(Exception &e) { From c18826d936ae5e85234dcda9583ea1b6fff81d09 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 9 Jul 2018 11:37:36 -0300 Subject: [PATCH 072/425] Fixed the offset of strings composing the StorageType --- libpgmodeler/src/pgsqltypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler/src/pgsqltypes.h b/libpgmodeler/src/pgsqltypes.h index 32dc8ee473..8649a5e97f 100644 --- a/libpgmodeler/src/pgsqltypes.h +++ b/libpgmodeler/src/pgsqltypes.h @@ -580,7 +580,7 @@ class EncodingType: public BaseType{ class StorageType: public BaseType{ private: - static const unsigned offset=207; + static const unsigned offset=205; static const unsigned types_count=4; public: From e3869b23b92156ff58a71d8e2f910a54dcea8ef9 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 28 Jul 2018 10:50:11 -0300 Subject: [PATCH 073/425] Fix a shortcut conflict in DataManipulationform --- libpgmodeler_ui/ui/datamanipulationform.ui | 3 --- 1 file changed, 3 deletions(-) diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index 5199138371..4caea69908 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -1527,9 +1527,6 @@ 22 - - Del - QToolButton::InstantPopup From 42f938a871783f0e634095355f6675f1b36a6b55 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 8 Aug 2018 14:29:40 -0300 Subject: [PATCH 074/425] Minor fix on stylesheet in order to display the extended button on general toolbar (issue #1154) --- conf/defaults/ui-style.conf | 112 ++++--------------- conf/ui-style.conf | 81 ++------------ libpgmodeler_ui/src/codecompletionwidget.cpp | 4 +- 3 files changed, 36 insertions(+), 161 deletions(-) diff --git a/conf/defaults/ui-style.conf b/conf/defaults/ui-style.conf index 8e33e761c7..41e6804721 100644 --- a/conf/defaults/ui-style.conf +++ b/conf/defaults/ui-style.conf @@ -22,7 +22,6 @@ CodeCompletionWidget > QWidget } BaseForm, MessageBox, ConfigurationForm, ModelExportForm, ModelDatabaseDiffForm, DatabaseImportForm { - /*background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F6F5F4, stop: 1 #E0DFDE);*/ padding-bottom: 2px; } @@ -34,12 +33,14 @@ UpdateNotifierWidget > QFrame } AboutWidget > QFrame > QLabel#title_lbl, -AboutWidget > QFrame > QLabel#slogan_lbl, AboutWidget > QFrame > QLabel#about_lbl, -AboutWidget > QFrame > QLabel#pgmodeler_ver_lbl, AboutWidget > QFrame > QLabel#build_lbl, AboutWidget > QFrame > QLabel#copyright_lbl { - color: #000; + color: #000; +} + +AboutWidget > QFrame > QLabel#pgmodeler_ver_lbl { + color: #4C7DD0; } DonateWidget > QFrame > QLabel#title_lbl, @@ -155,10 +156,6 @@ QToolBar#control_tb > QToolButton::menu-indicator border: transparent; } -QHeaderView { - /*font-size: 8pt;*/ -} - WelcomeWidget > QToolButton { border: transparent; @@ -178,7 +175,6 @@ WelcomeWidget > QToolButton::menu-indicator QToolBar#general_tb > QToolButton { - /*font-size: 7.5pt;*/ font-weight: bold; color: #f0f0f0; min-width: 65px; @@ -187,7 +183,13 @@ QToolBar#general_tb > QToolButton margin-right: 0; } -QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover +QToolBar#general_tb > QToolButton#qt_toolbar_ext_button +{ + min-height: 20px; +} + +QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover, +QToolBar#general_tb > QToolButton#qt_toolbar_ext_button { color: #fff; background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #80606060 , stop: 1 #80A0A0A0); @@ -197,7 +199,11 @@ QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover border-bottom: 1px solid #606060; } -QToolBar#general_tb > QToolButton:pressed, WelcomeWidget > QToolButton:pressed, QToolBar#general_tb > QToolButton:checked +QToolBar#general_tb > QToolButton:pressed, +WelcomeWidget > QToolButton:pressed, +QToolBar#general_tb > QToolButton:checked, +QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:hover, +QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:pressed { background-image: url(":/styles/styles/btn_checked_bg.png"); border-right: 1px solid #404040; @@ -321,67 +327,7 @@ QToolBar#update_tb::separator { margin-right: 2px; } - -/* QWidget#tool_btns_bar_wgt { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FFFFFF , stop: 1 #E6E6E6); - border-top: 1px solid #808080; - border-right: 1px solid #808080; - border-bottom: 1px solid #808080; - margin: 0; -} */ - -/* QWidget#tool_btns_bar_wgt > QPushButton { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F1F1, stop: 1 #A1A1A1); - margin-top: 5px; - margin-bottom: 5px; - padding: 2px; - padding-left: 5px; - padding-right: 5px; - border: 1px solid #a0a0a0; - border-radius: 2px; - font-size: 8pt; - color: #000; -} */ - -/*QWidget#tool_btns_bar_wgt > QPushButton:hover { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #1E65AB, stop: 1 #257BD1); - border: 1px solid #175089; - color: #FFFFFF; -} */ - -/*QWidget#tool_btns_bar_wgt > QPushButton#validation_btn { - margin-left: 5px; -} - -QWidget#tool_btns_bar_wgt > QPushButton#find_obj_btn { - margin-left: 5px; -} - -QWidget#tool_btns_bar_wgt > QPushButton#sql_tool_btn { - margin-left: 5px; -} - -QWidget#tool_btns_bar_wgt > QPushButton#objects_btn{ - margin-right: 5px; -} - -QWidget#tool_btns_bar_wgt > QPushButton#operations_btn{ - margin-right: 5px; -} */ - -/*QWidget#tool_btns_bar_wgt > QPushButton:checked { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #606060, stop: 1 #A0A0A0); - border-color: #808080; - color: #000; -} - -QWidget#tool_btns_bar_wgt > QPushButton:checked:hover { - color: #ffffff; -} */ - QTabWidget#models_tbw::pane { - /*background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFFFFF , stop: 1 #E6E6E6);*/ - /*border-bottom: 1px solid #d0d0d0;*/ border-top: transparent; } @@ -403,7 +349,6 @@ QTabWidget#models_tbw > QTabBar::close-button:hover { QTabWidget#models_tbw > QTabBar::tab { border: 1px solid #C4C4C4; text-align: center; - /*font-size: 8.5pt;*/ min-height: 30px; min-width: 50px; padding-left: 5; @@ -436,23 +381,8 @@ QTabWidget#models_tbw > QTabBar::tab:selected { margin-top: 0px; } -/*QSplitter#h_splitter::handle { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0); -} */ - -/*QSplitter#h_splitter_opr_objs::handle { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0); - border-left: 1px solid #404040; -}*/ - -/*QSplitter#v_splitter::handle, QSplitter#v_splitter1::handle,QSplitter#v_splitter2::handle { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0); -} */ - SQLToolWidget > QWidget#bg_frame { - /*background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFAFA , stop: 1 #E0E0E0);*/ - /*border-bottom: 1px solid #d0d0d0; - border-top: transparent;*/ + } /* Floating hint widget member of HintTextWidget */ @@ -471,7 +401,6 @@ HintTextWidget > QWidget HintTextWidget > QWidget > QLabel { color: #0000c0; - /*font-size: 8pt;*/ } QTabWidget#databases_tbw > QTabBar::close-button { @@ -503,3 +432,8 @@ QTabWidget#sql_exec_tbw > QTabBar::close-button:hover { height: 16px; image: url(':/styles/styles/close_tab_hover.png'); } + +QWidget#menu_title_wgt { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffffff , stop: 1 #E6E6E6); + border: 1px solid #c0a0a0a0; +} diff --git a/conf/ui-style.conf b/conf/ui-style.conf index cc481818e7..41e6804721 100644 --- a/conf/ui-style.conf +++ b/conf/ui-style.conf @@ -22,7 +22,6 @@ CodeCompletionWidget > QWidget } BaseForm, MessageBox, ConfigurationForm, ModelExportForm, ModelDatabaseDiffForm, DatabaseImportForm { - /*background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F6F5F4, stop: 1 #E0DFDE);*/ padding-bottom: 2px; } @@ -157,10 +156,6 @@ QToolBar#control_tb > QToolButton::menu-indicator border: transparent; } -QHeaderView { - /*font-size: 8pt;*/ -} - WelcomeWidget > QToolButton { border: transparent; @@ -180,7 +175,6 @@ WelcomeWidget > QToolButton::menu-indicator QToolBar#general_tb > QToolButton { - /*font-size: 7.5pt;*/ font-weight: bold; color: #f0f0f0; min-width: 65px; @@ -189,7 +183,13 @@ QToolBar#general_tb > QToolButton margin-right: 0; } -QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover +QToolBar#general_tb > QToolButton#qt_toolbar_ext_button +{ + min-height: 20px; +} + +QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover, +QToolBar#general_tb > QToolButton#qt_toolbar_ext_button { color: #fff; background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #80606060 , stop: 1 #80A0A0A0); @@ -199,7 +199,11 @@ QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover border-bottom: 1px solid #606060; } -QToolBar#general_tb > QToolButton:pressed, WelcomeWidget > QToolButton:pressed, QToolBar#general_tb > QToolButton:checked +QToolBar#general_tb > QToolButton:pressed, +WelcomeWidget > QToolButton:pressed, +QToolBar#general_tb > QToolButton:checked, +QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:hover, +QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:pressed { background-image: url(":/styles/styles/btn_checked_bg.png"); border-right: 1px solid #404040; @@ -323,67 +327,7 @@ QToolBar#update_tb::separator { margin-right: 2px; } - -/* QWidget#tool_btns_bar_wgt { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FFFFFF , stop: 1 #E6E6E6); - border-top: 1px solid #808080; - border-right: 1px solid #808080; - border-bottom: 1px solid #808080; - margin: 0; -} */ - -/* QWidget#tool_btns_bar_wgt > QPushButton { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #F1F1F1, stop: 1 #A1A1A1); - margin-top: 5px; - margin-bottom: 5px; - padding: 2px; - padding-left: 5px; - padding-right: 5px; - border: 1px solid #a0a0a0; - border-radius: 2px; - font-size: 8pt; - color: #000; -} */ - -/*QWidget#tool_btns_bar_wgt > QPushButton:hover { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #1E65AB, stop: 1 #257BD1); - border: 1px solid #175089; - color: #FFFFFF; -} */ - -/*QWidget#tool_btns_bar_wgt > QPushButton#validation_btn { - margin-left: 5px; -} - -QWidget#tool_btns_bar_wgt > QPushButton#find_obj_btn { - margin-left: 5px; -} - -QWidget#tool_btns_bar_wgt > QPushButton#sql_tool_btn { - margin-left: 5px; -} - -QWidget#tool_btns_bar_wgt > QPushButton#objects_btn{ - margin-right: 5px; -} - -QWidget#tool_btns_bar_wgt > QPushButton#operations_btn{ - margin-right: 5px; -} */ - -/*QWidget#tool_btns_bar_wgt > QPushButton:checked { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #606060, stop: 1 #A0A0A0); - border-color: #808080; - color: #000; -} - -QWidget#tool_btns_bar_wgt > QPushButton:checked:hover { - color: #ffffff; -} */ - QTabWidget#models_tbw::pane { - /*background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #FFFFFF , stop: 1 #E6E6E6);*/ - /*border-bottom: 1px solid #d0d0d0;*/ border-top: transparent; } @@ -405,7 +349,6 @@ QTabWidget#models_tbw > QTabBar::close-button:hover { QTabWidget#models_tbw > QTabBar::tab { border: 1px solid #C4C4C4; text-align: center; - /*font-size: 8.5pt;*/ min-height: 30px; min-width: 50px; padding-left: 5; diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 737dd633a0..7886790947 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -49,9 +49,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool vbox->setSpacing(6); completion_wgt->setLayout(vbox); - QFont font=name_list->font(); - font.setPointSizeF(8); - name_list->setFont(font); + PgModelerUiNS::configureWidgetFont(name_list, PgModelerUiNS::SMALL_FONT_FACTOR); this->code_field_txt=code_field_txt; auto_triggered=false; From 3ff79cf7ef527824234131901875442ed9c0495d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 8 Aug 2018 14:36:57 -0300 Subject: [PATCH 075/425] Fixed the disabling of design related action when switching to manage view --- libpgmodeler_ui/ui/mainwindow.ui | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index f200eb290f..902f165c4e 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -678,7 +678,7 @@ 0 0 1068 - 23 + 27 @@ -744,6 +744,7 @@ + From 5d2644ef1e20cb76c685bb91795c8bf99ec5c20a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 9 Aug 2018 15:18:07 -0300 Subject: [PATCH 076/425] Updates on CHANGELOG.md and RELEASENOTES.md for 0.9.2-alpha --- CHANGELOG.md | 37 +++++++++++ RELEASENOTES.md | 82 ++++++++++-------------- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 3 + 3 files changed, 75 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 005b7d7ba2..4aeb89a0fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,43 @@ Change Log --------- +v0.9.2-alpha +------ +Release date: August 17, 2018
+ +* [New] Added the support to cancelling SQL execution in SQLExecutionWidget. +* [New] Added support to truncate tables in DataManipulationForm. +* [New] Added support to aliases on some graphical objects that is used in the compact view mode. +* [New] Added support to save/load object's metadata containing aliases information. +* [New] Added support to compact view of the model where graphical objects can have a more friendly name for a reduced view as well for those who don't need to see details about tables (clients of the business, for instance). +* [New] Added support to sequence options for identity columns. +* [New] Added the ability to paste CSV text from clipboard into the TableDataWidget. +* [New] Added support to bulk data edit in TableDataWidget. +* [Change] Minor adjustment on buttons style in DatabaseExplorerWidget, DataManipulationForm and SQLExecutionWidget. +* [Change] Minor adjustment on OperationList::removeFromPool to avoid throw an exception when an invalid index is passed. +* [Change] Changed the behaviour of the fade in/out of relationships linked to a table by applying the effect on the other tables that are related to the selected one. +* [Change] Refactored the view editing dialog by moving the references handling form to a dedicated modal dialog. +* [Change] Improved the model loading from file by blocking signals of relationships avoiding excessive/repetive rendering of objects. The whole model is fully rendered when the file was completely loaded. +* [Change] Minor adjustment on constraints rendering at extended attributes section of tables. +* [Change] French translation update. +* [Change] Updated the other lang dictionaries with the new text brought by new releases. +* [Fix] Fixed the disabling of some actions related to design when switching to manage view. +* [Fix] Minor fix on stylesheet in order to display the extended button on general toolbar. +* [Fix] Fix a shortcut conflict in DataManipulationform. +* [Fix] Fixed the offset of strings composing the StorageType. +* [Fix] Minor form size adjustments. +* [Fix] Minor fix in sqlexecutionwidget.ui to force the exhibition of grid headers +* [Fix] Minor fix in SQLExecutionWidget allowing the output widget to be resized to a size lower than the default one. +* [Fix] Fixed the tab order in PolicyWidget. +* [Fix] Fixed the generation of Database object source in DatabaseExplorerWidget. +* [Fix] Fixed the method BaseObjectWidget::setRequiredField to make object selector fields as required correctly. +* [Fix] Minor fix in HintTextWidget to stay on top of all widget when being displayed. +* [Fix] Fixed a bug that was not quoting extension name when needed. +* [Fix] Fixed a crash when trying to remove a fk relationship when it was created from a foreign key which references protected columns (added by relationship). +* [Fix] Fix a crash when importing CSV files into DataManipulationForm. +* [Fix] Minor typo in TableDataWidget. +* [Fix] Minor fix on schema file sql/table.sch. + v0.9.1 ------ Release date: May 14, 2018
diff --git a/RELEASENOTES.md b/RELEASENOTES.md index f77074d8b2..0f447557e7 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,49 +1,37 @@ -v0.9.1 +v0.9.2-alpha ------ -Release date: May 14, 2018
-Changes since: v0.9.1-beta1
- -Summary: after eight months of hard work we finally have the stable release 0.9.1. This version is a mark in the pgModeler's development and so important as the release 0.8.2 in terms of improvements because it brought features requested long ago and that will make pgModeler even better to work with, being some of them: crow's foot notation support, multiple relationships for the same table pair, support to row level security, identity columns and much more.
- -For this release specifically (considering only the work after 0.9.1-beta1), the golden rule was to fix bugs, adjust the current features and introduce few new things and thus was done: 21 bug fixes, 14 changes/improvements and 7 new features. - -The majority of new features are related to the CLI which received the ability to import and diff databases which can make it even better to integrate to automtated deployment processess or run quick tasks over models or databases without the need to open pgModeler's GUI.
- -Some important improvements were done in the overall performance of the SQL tool. The query execution and results display are a lot better now being quicker and less eager in terms of memory consumption avoiding crashes when querying large tables. The data manipulation also received a patch that makes the row duplication more efficient.
- -Now, for the fixes, another patch was introduced in order to resize correctly dialogs in HiDPI/Retina displays. Several reverse engineering bugs were fixes and now databases are imported more precisely compared to previous releases. Lastly, a bug that seems to happen only on macOS while dealing with large models is finally fixed and was related to some running threads messing around with the main process avoiding it to correctly save the model and causing hang ups sometimes.
- -The whole set of changes of this release (considering the alpha and beta stages) has 152 entries being 43 new features, 47 changes/improvements and 62 bug fixes. Below we highlight some of news for the work since 0.9.1-beta1, for the complete list of changes, please, take a look into the CHANGELOG.md.
- -* [New] Added support to line selection by clicking and moving the mouse over the line numbers widget in any source code field. -* [New] The validator now checks if the model has columns referencing spatial data types and creates the postgis extension automatically when fixing the model. -* [New] Added support to RESTART IDENTITY on truncate tables in DatabaseExplorerWidget. -* [New] Added support to diff operation in CLI. -* [New] Added support to import database from CLI. -* [New] Adding missing types regrole and regnamespace. -* [Change] Improved the copy/duplicate operation in order to copy rules, index, trigger and policies together to their parents. -* [Change] Added column names to the code completion widget used in the filter widget at DataManipulationForm. -* [Change] Improved the SQLExecutionWidget in such way that it'll display large amount of data more quickly and consuming less memory. -* [Change] Minor improvement in SQLExecutionWidget to show the amount of time took to run a query. -* [Change] Minor improvement in the text find widgets in SQL tool in order to make them closable via dedicated button. -* [Change] Improved the set tag operation in ModelWidget in order to cleanup the assigned tags to a set of objects. -* [Change] Refactored all the CLI options. -* [Change] Improved the performance of the row duplication action in DataManipulationForm. -* [Change] Improved the performance of "Move to schema" operation. -* [Change] Changed the behaviour of select and fade buttons in ObjectFinderWidget in such way to enable the user to select/fade the objects in the listing (or not included in the results). -* [Fix] Fixed a bug when import identity columns in certain cases when the identity column was followed by another column which data type was not accepted for identity, e.g, text after smallint. -* [Fix] Fixed the tab behavior on comment box in all editing forms of database objects. -* [Fix] Fixed the catalog query for user defined types. -* [Fix] Fixed the import of user defined types which names contains uppercase characters. -* [Fix] Fix window scaling on HiDPI/Retina screens. -* [Fix] Fixed a bug in ModelExportHelper that was failing to remane the database when the command appeared. -* [Fix] Fixed a bug in CollationWidget that was referencing the collation attributes LC_??? using the wrong constant. -* [Fix] Fixed the behaviour of the message box that warns about the need of validate the model prior to export, save or diff. Now rejecting the dialog (i.e. closing it) will be considered that the user wants to proceed with the pending operation even with an invalid model. -* [Fix] Fixed the import of comments for constraints,triggers, index and rules. -* [Fix] Fixed a bug in the aggregate import process. -* [Fix] Minor fix in DataManipulationForm to avoid the generation of a where clause when the filter is filled only with spaces. -* [Fix] Minor fix in the magnfier tool to use the same render hints as the canvas viewport. -* [Fix] Fixed a bug in the diff process that was trying to recreate the whole database when the "Force recreation" option was set. -* [Fix] Fixed a bug when showing the source of tables in DatabaseExplorerWidget when these objects have permissions assigned. -* [Fix] Fixed the saving process for large models by stopping the threads related to temp models saving while the model file is being written. +Release date: August 17, 2018
+Changes since: v0.9.1
+ +Summary: this release does not have an extensive change log but brings some long desired features as well important fixes. The first feature to talk about is the long awaited SQL execution cancelling which enables the user to abort the execution of any command issued to the server in the SQL execution field (Manage view) without the need to kill the application in order to interrupt the running SQL (like on previous releases).
+ +Another feature introduced is the compact view of the model. This one makes the tables and views smaller by hiding the columns' data types and other informations. This feature came as a support to those developers who need to present their models to an audience without database specific knowledge. The trick here is to replace the original names of graphical objects by more friendly ones so the audience can understand the essence of the model being worked without worry about the tech details.
+ +More features were implemented in this release too being them: the support to sequence options on indentity columns, the support to bulk data edition on data manipulation dialog, the support to paste CSV text from clipboard into the dialog where initial data can be specified for tables (in design view) and some other.
+ +One important change done was a partial refactoring of the View editing form by moving the fields related to view's references to a dedicated dialog making the whole form a bit less complicated to use. I have plans to keep improving that dialog in special but in future releases a full UX/UI remodeling will be done in the application.
+ +Below some of the changes of this release, for the complete list of changes, please, take a look into the CHANGELOG.md.
+ +* [New] Added the support to cancelling SQL execution in SQLExecutionWidget. +* [New] Added support to truncate tables in DataManipulationForm. +* [New] Added support to aliases on some graphical objects to be is used in the compact view mode. +* [New] Added support to save/load object's metadata containing aliases information. +* [New] Added support to compact view of the model where graphical objects can have a more friendly name for a reduced view as well for those who don't need to see details about tables (clients of the business, for instance). +* [New] Added support to sequence options for identity columns. +* [New] Added the ability to paste CSV text from clipboard into the TableDataWidget. +* [New] Added support to bulk data edit in TableDataWidget. +* [Change] Changed the behaviour of the fade in/out of relationships linked to a table by applying the effect on the other tables that are related to the selected one. +* [Change] Refactored the view editing dialog by moving the references handling form to a dedicated modal dialog. +* [Change] Improved the model loading from file by blocking signals of relationships avoiding excessive/repetive rendering of objects. The whole model is fully rendered when the file was completely loaded. +* [Change] Minor adjustment on constraints rendering at extended attributes section of tables. +* [Fix] Minor fix on stylesheet in order to display the extended button on general toolbar. +* [Fix] Fix a shortcut conflict in DataManipulationform. +* [Fix] Fixed the offset of strings composing the StorageType. +* [Fix] Minor fix in SQLExecutionWidget allowing the output widget to be resized to a size lower than the default one. +* [Fix] Fixed the generation of Database object source in DatabaseExplorerWidget. +* [Fix] Minor fix in HintTextWidget to stay on top of all widget when being displayed. +* [Fix] Fixed a bug that was not quoting extension name when needed. +* [Fix] Fixed a crash when trying to remove a fk relationship when it was created from a foreign key which references protected columns (added by relationship). +* [Fix] Fix a crash when importing CSV files into DataManipulationForm. diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index a56b0a7675..8aff7454a7 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -292,6 +292,9 @@ 22 + + Ctrl+F + true From f5ffceb07a0cde554db1fc28c7d8ec81eda4cacc Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 10 Aug 2018 19:04:15 -0300 Subject: [PATCH 077/425] Updated the Qt version on linux deploy script --- linuxdeploy.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/linuxdeploy.sh b/linuxdeploy.sh index 045c9c975c..69ca39393e 100755 --- a/linuxdeploy.sh +++ b/linuxdeploy.sh @@ -4,20 +4,23 @@ case `uname -m` in "x86_64") ARCH="linux64" - FALLBACK_QT_ROOT=/opt/qt-5.9.3/5.9.3/gcc_64 + FALLBACK_QT_ROOT=/opt/qt-5.9.6/5.9.6/gcc_64 FALLBACK_QMAKE_ROOT="$FALLBACK_QT_ROOT/bin" ;; - - *) + + *) ARCH="linux32" FALLBACK_QT_ROOT=/opt/qt-5.6.2/5.6/gcc FALLBACK_QMAKE_ROOT="$FALLBACK_QT_ROOT/bin" ;; esac -# Uncomment this line if your system doesn't have LLVM (clang) compiler tools -#QMAKE_ARGS="-r -spec linux-g++" -QMAKE_ARGS="-r -spec linux-clang" +# Uncomment this line if you want to compile using LLVM (clang) compiler tools +# QMAKE_ARGS="-r -spec linux-clang" + +# Comment this one if you've decided to use LLVM +QMAKE_ARGS="-r -spec linux-g++" + QMAKE_ROOT=/usr/bin QMAKE_CMD=qmake LOG="$PWD/linuxdeploy.log" From 00dc1f503cb72f9ab3efdc968cb4eea5dd80e037 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 13 Aug 2018 16:49:45 -0300 Subject: [PATCH 078/425] Minor adjustment in NewObjectOverlayWidget by putting the toolbuttons under categories --- .../src/newobjectoverlaywidget.cpp | 11 +- libpgmodeler_ui/ui/newobjectoverlaywidget.ui | 3249 +++++++++-------- 2 files changed, 1679 insertions(+), 1581 deletions(-) diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index 9435231c64..8a94788195 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -113,18 +113,19 @@ void NewObjectOverlayWidget::setSelectedObjects(vector &sel_objs) else if(sel_objs.empty()) obj_type=OBJ_DATABASE; - db_objs_btns_wgt->setVisible(obj_type==OBJ_DATABASE); - sch_objs_btns_wgt->setVisible(obj_type==OBJ_DATABASE || obj_type==OBJ_SCHEMA); + db_objs_grp->setVisible(obj_type==OBJ_DATABASE); + sch_objs_grp->setVisible(obj_type==OBJ_DATABASE || obj_type==OBJ_SCHEMA); - tab_objs_btns_wgt->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW || obj_type==OBJ_RELATIONSHIP); + tab_objs_grp->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW || obj_type==OBJ_RELATIONSHIP); column_tb->setDisabled(obj_type==OBJ_VIEW); constraint_tb->setDisabled(obj_type==OBJ_VIEW); index_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); rule_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); trigger_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); + policy_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); tab_perms_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); - rel_btns_wgt->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==OBJ_TABLE) || - (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==OBJ_TABLE && sel_objs.at(1)->getObjectType()==OBJ_TABLE)); + rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==OBJ_TABLE) || + (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==OBJ_TABLE && sel_objs.at(1)->getObjectType()==OBJ_TABLE)); overlay_frm->adjustSize(); this->adjustSize(); diff --git a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui index 54d72ddc2d..df8a6ecaf3 100644 --- a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui +++ b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui @@ -6,8 +6,8 @@ 0 0 - 408 - 702 + 426 + 911 @@ -83,1652 +83,1749 @@ 4 - - - - 0 - 0 - + + + Database objects - + - 0 + 4 - 0 + 4 - 0 + 4 - 0 + 4 - - 6 - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Schema - - - - :/icones/icones/schema.png:/icones/icones/schema.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Tablespace - - - - :/icones/icones/tablespace.png:/icones/icones/tablespace.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Cast - - - - :/icones/icones/cast.png:/icones/icones/cast.png - - - - 32 - 32 - - - - A - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Role - - - - :/icones/icones/role.png:/icones/icones/role.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Extension - - - - :/icones/icones/extension.png:/icones/icones/extension.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Event Trigger - - - - :/icones/icones/eventtrigger.png:/icones/icones/eventtrigger.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Language - - - - :/icones/icones/language.png:/icones/icones/language.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Generic SQL - - - - :/icones/icones/genericsql.png:/icones/icones/genericsql.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Tag - - - - :/icones/icones/tag.png:/icones/icones/tag.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Textbox - - - - :/icones/icones/textbox.png:/icones/icones/textbox.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - - - - 0 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::StrongFocus - - - Type - - - - :/icones/icones/usertype.png:/icones/icones/usertype.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Conversion - - - - :/icones/icones/conversion.png:/icones/icones/conversion.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Aggregate - - - - :/icones/icones/aggregate.png:/icones/icones/aggregate.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Operator - - - - :/icones/icones/operator.png:/icones/icones/operator.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Domain - - - - :/icones/icones/domain.png:/icones/icones/domain.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Collation - - - - :/icones/icones/collation.png:/icones/icones/collation.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Sequence - - - - :/icones/icones/sequence.png:/icones/icones/sequence.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Op. Family - - - - :/icones/icones/opfamily.png:/icones/icones/opfamily.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Table - - - - :/icones/icones/table.png:/icones/icones/table.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Function - - - - :/icones/icones/function.png:/icones/icones/function.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - View - - - - :/icones/icones/view.png:/icones/icones/view.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Op. Class - - - - :/icones/icones/opclass.png:/icones/icones/opclass.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - + + 0 0 - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Permissions - - - - :/icones/icones/permission.png:/icones/icones/permission.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Schema + + + + :/icones/icones/schema.png:/icones/icones/schema.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Tablespace + + + + :/icones/icones/tablespace.png:/icones/icones/tablespace.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Role + + + + :/icones/icones/role.png:/icones/icones/role.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Language + + + + :/icones/icones/language.png:/icones/icones/language.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Generic SQL + + + + :/icones/icones/genericsql.png:/icones/icones/genericsql.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Tag + + + + :/icones/icones/tag.png:/icones/icones/tag.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Cast + + + + :/icones/icones/cast.png:/icones/icones/cast.png + + + + 32 + 32 + + + + A + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Extension + + + + :/icones/icones/extension.png:/icones/icones/extension.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Event Trigger + + + + :/icones/icones/eventtrigger.png:/icones/icones/eventtrigger.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Textbox + + + + :/icones/icones/textbox.png:/icones/icones/textbox.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + - - - - 0 - 0 - + + + Schema objects - + - 0 + 4 - 0 + 4 - 0 + 4 - 0 + 4 - - 6 - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Constraint - - - - :/icones/icones/constraint.png:/icones/icones/constraint.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Column - - - - :/icones/icones/column.png:/icones/icones/column.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Permissions - - - - :/icones/icones/permission.png:/icones/icones/permission.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Index - - - - :/icones/icones/index.png:/icones/icones/index.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Rule - - - - :/icones/icones/rule.png:/icones/icones/rule.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Trigger - - - - :/icones/icones/trigger.png:/icones/icones/trigger.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - + + 0 0 - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Policy - - - - :/icones/icones/policy.png:/icones/icones/policy.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::StrongFocus + + + Type + + + + :/icones/icones/usertype.png:/icones/icones/usertype.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Conversion + + + + :/icones/icones/conversion.png:/icones/icones/conversion.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Aggregate + + + + :/icones/icones/aggregate.png:/icones/icones/aggregate.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Operator + + + + :/icones/icones/operator.png:/icones/icones/operator.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Domain + + + + :/icones/icones/domain.png:/icones/icones/domain.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Collation + + + + :/icones/icones/collation.png:/icones/icones/collation.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Sequence + + + + :/icones/icones/sequence.png:/icones/icones/sequence.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Op. Family + + + + :/icones/icones/opfamily.png:/icones/icones/opfamily.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Table + + + + :/icones/icones/table.png:/icones/icones/table.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Function + + + + :/icones/icones/function.png:/icones/icones/function.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + View + + + + :/icones/icones/view.png:/icones/icones/view.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Op. Class + + + + :/icones/icones/opclass.png:/icones/icones/opclass.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Permissions + + + + :/icones/icones/permission.png:/icones/icones/permission.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + - - - - 0 - 0 - + + + Table objects - + - 0 + 4 - 0 + 4 - 0 + 4 - 0 + 4 - - 6 - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Many-to-many - - - - :/icones/icones/relationshipnn.png:/icones/icones/relationshipnn.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - One-to-many - - - - :/icones/icones/relationship1n.png:/icones/icones/relationship1n.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - - + 0 0 - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - One-to-one - - - - :/icones/icones/relationship11.png:/icones/icones/relationship11.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Constraint + + + + :/icones/icones/constraint.png:/icones/icones/constraint.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Column + + + + :/icones/icones/column.png:/icones/icones/column.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Permissions + + + + :/icones/icones/permission.png:/icones/icones/permission.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Index + + + + :/icones/icones/index.png:/icones/icones/index.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Rule + + + + :/icones/icones/rule.png:/icones/icones/rule.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Trigger + + + + :/icones/icones/trigger.png:/icones/icones/trigger.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Policy + + + + :/icones/icones/policy.png:/icones/icones/policy.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + - - + + + + + + + Relationships + + + + 4 + + + 4 + + + 4 + + + 4 + + + 0 0 - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Inheritance - - - - :/icones/icones/relationshipgen.png:/icones/icones/relationshipgen.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Many-to-many + + + + :/icones/icones/relationshipnn.png:/icones/icones/relationshipnn.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + One-to-many + + + + :/icones/icones/relationship1n.png:/icones/icones/relationship1n.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + One-to-one + + + + :/icones/icones/relationship11.png:/icones/icones/relationship11.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Inheritance + + + + :/icones/icones/relationshipgen.png:/icones/icones/relationshipgen.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Copy + + + + :/icones/icones/relationshipdep.png:/icones/icones/relationshipdep.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Copy - - - - :/icones/icones/relationshipdep.png:/icones/icones/relationshipdep.png + + + + Qt::Horizontal - + - 32 - 32 + 40 + 20 - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - + From 9c4dc2f720fea1dbe2b9e419b3a06e71c6bf0666 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 13 Aug 2018 16:51:18 -0300 Subject: [PATCH 079/425] Minor ui stylesheet fixes and syntax highlighting style updates. --- conf/defaults/sql-highlight.conf | 8 ++++++++ conf/defaults/ui-style.conf | 7 +++---- conf/sql-highlight.conf | 8 ++++++++ conf/ui-style.conf | 7 +++---- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index 23f10f06d4..ebf49fd513 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -116,6 +116,7 @@ + @@ -139,6 +140,7 @@ + @@ -178,6 +180,7 @@ + @@ -191,6 +194,8 @@ + + @@ -345,6 +350,7 @@ + @@ -368,6 +374,7 @@ + @@ -376,6 +383,7 @@ + diff --git a/conf/defaults/ui-style.conf b/conf/defaults/ui-style.conf index 41e6804721..8e88b4ae72 100644 --- a/conf/defaults/ui-style.conf +++ b/conf/defaults/ui-style.conf @@ -76,16 +76,15 @@ NewObjectOverlayWidget > QFrame { border-radius: 6px } -NewObjectOverlayWidget > QFrame > QWidget > QToolButton +NewObjectOverlayWidget > QFrame > QGroupBox > QWidget > QToolButton { color: #000; font-style: italic; - /*font-size: 8pt;*/ border-radius: 6px; min-width: 110px } -NewObjectOverlayWidget > QFrame > QWidget > QToolButton:hover +NewObjectOverlayWidget > QFrame > QGroupBox > QWidget > QToolButton:hover { font-weight: bold; background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #80e0e0e0 , stop: 1 #80ffffff); @@ -94,7 +93,7 @@ NewObjectOverlayWidget > QFrame > QWidget > QToolButton:hover } -NewObjectOverlayWidget > QFrame > QWidget > QToolButton:pressed +NewObjectOverlayWidget > QFrame > QGroupBox > QWidget > QToolButton:pressed { background-color: #80023d86; border: 1px solid #012149; diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index 23f10f06d4..ebf49fd513 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -116,6 +116,7 @@ + @@ -139,6 +140,7 @@ + @@ -178,6 +180,7 @@ + @@ -191,6 +194,8 @@ + + @@ -345,6 +350,7 @@ + @@ -368,6 +374,7 @@ + @@ -376,6 +383,7 @@ + diff --git a/conf/ui-style.conf b/conf/ui-style.conf index 41e6804721..8e88b4ae72 100644 --- a/conf/ui-style.conf +++ b/conf/ui-style.conf @@ -76,16 +76,15 @@ NewObjectOverlayWidget > QFrame { border-radius: 6px } -NewObjectOverlayWidget > QFrame > QWidget > QToolButton +NewObjectOverlayWidget > QFrame > QGroupBox > QWidget > QToolButton { color: #000; font-style: italic; - /*font-size: 8pt;*/ border-radius: 6px; min-width: 110px } -NewObjectOverlayWidget > QFrame > QWidget > QToolButton:hover +NewObjectOverlayWidget > QFrame > QGroupBox > QWidget > QToolButton:hover { font-weight: bold; background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #80e0e0e0 , stop: 1 #80ffffff); @@ -94,7 +93,7 @@ NewObjectOverlayWidget > QFrame > QWidget > QToolButton:hover } -NewObjectOverlayWidget > QFrame > QWidget > QToolButton:pressed +NewObjectOverlayWidget > QFrame > QGroupBox > QWidget > QToolButton:pressed { background-color: #80023d86; border: 1px solid #012149; From 86352fbf7b2d902d17e0209602d8af41404d834e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 13 Aug 2018 16:52:54 -0300 Subject: [PATCH 080/425] Added some statistics attributes for tables on DatabaseExplorerWidget --- libparsers/src/parsersattributes.cpp | 16 ++++++- libparsers/src/parsersattributes.h | 17 ++++++- .../src/databaseexplorerwidget.cpp | 7 ++- schemas/catalog/table.sch | 46 +++++++++++-------- 4 files changed, 63 insertions(+), 23 deletions(-) diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 5d248aef17..988e733bb2 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -33,6 +33,7 @@ namespace ParsersAttributes { ALTER_CMDS=QString("alter-cmds"), ALLOW_CONNS=QString("allow-conns"), ANALYZE_FUNC=QString("analyze"), + ANALYZE_COUNT=QString("analyze-count"), ANCESTOR_TABLE=QString("ancestor-table"), APPEND_AT_EOD=QString("append-at-eod"), APPENDED_SQL=QString("appended-sql"), @@ -47,6 +48,8 @@ namespace ParsersAttributes { ASC_ORDER=QString("asc-order"), ASSIGNMENT=QString("assignment"), ATTRIBUTE=QString("attribute"), + AUTOVACUUM_COUNT=QString("autovacuum-count"), + AUTOANALYZE_COUNT=QString("autoanalyze-count"), AUTO_BROWSE_DB=QString("auto-browse-db"), AUTOSAVE_INTERVAL=QString("autosave-interval"), BACKGROUND_COLOR=QString("background-color"), @@ -247,6 +250,8 @@ namespace ParsersAttributes { INDEX_TYPE=QString("index-type"), INDEX=QString("index"), INDEXES=QString("indexes"), + INDEX_SCAN=QString("index-scan"), + INDEX_SCAN_READ=QString("index-scan-read"), INFO=QString("info"), INH_COLUMN=QString("inh-column"), INH_COLUMNS=QString("inh-columns"), @@ -274,6 +279,9 @@ namespace ParsersAttributes { LAST_SYS_OID=QString("last-sys-oid"), LAST_VALUE=QString("last-value"), LAST_ZOOM=QString("last-zoom"), + LAST_ANALYZE=QString("last-analyze"), + LAST_AUTOVACUUM=QString("last-autovacuum"), + LAST_VACUUM=QString("last-vacuum"), LEAKPROOF=QString("leakproof"), LEFT_TYPE=QString("left-type"), LEFT=QString("left"), @@ -438,6 +446,8 @@ namespace ParsersAttributes { SELECT_OBJECTS=QString("select-objects"), SEND_FUNC=QString("send"), SEQUENCE=QString("sequence"), + SEQ_SCAN=QString("seq-scan"), + SEQ_SCAN_READ=QString("seq-scan-read"), SERVER_ENCODING=QString("server-encoding"), SERVER_VERSION=QString("server-version"), SERVER_PID=QString("server-pid"), @@ -515,6 +525,9 @@ namespace ParsersAttributes { TRUNCATE_PRIV=QString("truncate"), TRUNCATE=QString("truncate"), TRUSTED=QString("trusted"), + TUPLES_DEL=QString("tuples-del"), + TUPLES_UPD=QString("tuples-upd"), + TUPLES_INS=QString("tuples-ins"), TYPE_ATTRIBUTE=QString("typeattrib"), TYPE_OID=QString("type-oid"), TYPE=QString("type"), @@ -538,6 +551,7 @@ namespace ParsersAttributes { USE_SORTING=QString("use-sorting"), USE_UNIQUE_NAMES=QString("use-unique-names"), USING_EXP=QString("using-exp"), + VACUUM_COUNT=QString("vacuum-count"), VALIDATOR_FUNC=QString("validator"), VALIDATOR=QString("validator"), VALIDITY=QString("validity"), @@ -562,6 +576,6 @@ namespace ParsersAttributes { WORD_SEPARATORS=QString("word-separators"), WORKING_DIR=QString("working-dir"), X_POS=QString("x"), - Y_POS=QString("y"); + Y_POS=QString("y"); } diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 5e9d3f9a29..e9f51853c6 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -574,7 +574,22 @@ namespace ParsersAttributes { WORD_SEPARATORS, WORKING_DIR, X_POS, - Y_POS; + Y_POS, + INDEX_SCAN, + INDEX_SCAN_READ, + LAST_ANALYZE, + LAST_AUTOVACUUM, + LAST_VACUUM, + TUPLES_DEL, + TUPLES_UPD, + TUPLES_INS, + SEQ_SCAN, + SEQ_SCAN_READ, + VACUUM_COUNT, + AUTOVACUUM_COUNT, + ANALYZE_COUNT, + AUTOANALYZE_COUNT + ; } #endif diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index d79ddc9279..66450712c8 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -94,7 +94,12 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {CONNECTION, QT_TR_NOOP("Connection ID")}, {SERVER_PID, QT_TR_NOOP("Server PID")}, {SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {REFERRERS, QT_TR_NOOP("Referrers")}, {IDENTITY_TYPE, QT_TR_NOOP("Identity")}, {COMMAND, QT_TR_NOOP("Command")}, {USING_EXP, QT_TR_NOOP("USING expr.")}, {CHECK_EXP, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")}, - {RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {RLS_FORCED, QT_TR_NOOP("RLS forced")} + {RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {RLS_FORCED, QT_TR_NOOP("RLS forced")}, {INDEX_SCAN, QT_TR_NOOP("Index scans")}, + {INDEX_SCAN_READ, QT_TR_NOOP("Index scans tuples")}, {LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, {LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, + {LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, + {TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {SEQ_SCAN, QT_TR_NOOP("Sequential scans")}, {SEQ_SCAN_READ, QT_TR_NOOP("Sequential scans tuples")}, + {VACUUM_COUNT, QT_TR_NOOP("Vacuum count")}, {AUTOVACUUM_COUNT, QT_TR_NOOP("Autovacuum count")}, {ANALYZE_COUNT, QT_TR_NOOP("Analyze count")}, + {AUTOANALYZE_COUNT, QT_TR_NOOP("Autoanalyze count")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) diff --git a/schemas/catalog/table.sch b/schemas/catalog/table.sch index aefff00e4a..75f829ab6a 100644 --- a/schemas/catalog/table.sch +++ b/schemas/catalog/table.sch @@ -22,8 +22,8 @@ %else %if {attribs} %then - [SELECT tb.oid, tb.relname AS name, tb.relnamespace AS schema, tb.relowner AS owner, tb.reltuples::int8 AS row_amount, - tb.reltablespace AS tablespace, tb.relacl AS permission, relhasoids AS oids_bool, ] + [SELECT tb.oid, tb.relname AS name, tb.relnamespace AS schema, tb.relowner AS owner, + tb.reltablespace AS tablespace, tb.relacl AS permission, relhasoids AS oids_bool, ] %if ({pgsql-ver} == "9.0") %then [ FALSE AS unlogged_bool, ] @@ -36,43 +36,49 @@ %end %if ({pgsql-ver} Date: Mon, 13 Aug 2018 16:53:44 -0300 Subject: [PATCH 081/425] Fixed the query catalog for policies which was causing syntax error when combining import sys. objects and import ext. objects options. --- schemas/catalog/policy.sch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/schemas/catalog/policy.sch b/schemas/catalog/policy.sch index 5ef4071ac4..43f7934c9a 100644 --- a/schemas/catalog/policy.sch +++ b/schemas/catalog/policy.sch @@ -15,12 +15,15 @@ %if {table} %then [ AND tb.relkind='r' AND tb.relname=] '{table}' %end + + %if {last-sys-oid} %or {not-ext-object} %then + [ AND ] + %end - [ AND ] %else [ WHERE ] %end - + %if {last-sys-oid} %then [ pl.oid ] {oid-filter-op} $sp {last-sys-oid} %end From 31735bfa7988e6e3125c8871bb00f08eedafdbd4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 13 Aug 2018 16:54:16 -0300 Subject: [PATCH 082/425] Fixed a regression that caused notices not to be shown in the output panel at SQLExecutionWidget --- libpgmodeler_ui/src/sqlexecutionhelper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.cpp b/libpgmodeler_ui/src/sqlexecutionhelper.cpp index fd511c60f7..51f261bb49 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.cpp +++ b/libpgmodeler_ui/src/sqlexecutionhelper.cpp @@ -63,19 +63,19 @@ void SQLExecutionHelper::executeCommand(void) if(!connection.isStablished()) { - connection.connect(); - connection.setNoticeEnabled(true); + connection.setNoticeEnabled(true); + connection.connect(); //The connection will break the execution if it keeps idle for one hour or more connection.setSQLExecutionTimout(3600); } connection.executeDMLCommand(command, res); + notices = connection.getNotices(); if(!res.isEmpty()) result_model = new ResultSetModel(res, catalog); - notices = connection.getNotices(); emit s_executionFinished(res.getTupleCount()); } catch(Exception &e) From 811f274b37e6312d300d42c8091fdc023277f95c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 14 Aug 2018 11:20:02 -0300 Subject: [PATCH 083/425] Fixed a bug that was preventing to create a view containing the same name as a table but in different schema (issue #1157) --- libpgmodeler/src/databasemodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 3fd5acde16..f791925c96 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1045,7 +1045,6 @@ void DatabaseModel::addView(View *view, int obj_idx) try { __addObject(view, obj_idx); - PgSQLType::addUserType(view->getName(true), view, this, UserTypeConfig::VIEW_TYPE); updateViewRelationships(view); @@ -1261,7 +1260,8 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) rel=getRelationship(view,tab); if(tab && !rel) { - rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_DEP,view,tab,false,false); + rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_DEP, view, tab, false, false); + rel->setName(PgModelerNS::generateUniqueName(rel, base_relationships)); addRelationship(rel); } } From 55f1087b827ca3f1c2edde1a1e2e0b1d0f2c8290 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 14 Aug 2018 17:30:07 -0300 Subject: [PATCH 084/425] Added support to save/restore the dialogs sizes Fixed the general toolbar decoration --- conf/defaults/pgmodeler.conf | 4 +- conf/dtd/pgmodeler.dtd | 11 +- conf/pgmodeler.conf | 3 +- conf/schemas/pgmodeler.sch | 7 + conf/schemas/widget.sch | 8 + conf/ui-style.conf | 2 +- libparsers/src/parsersattributes.cpp | 4 + libparsers/src/parsersattributes.h | 4 + libpgmodeler_ui/src/configurationform.cpp | 1 - libpgmodeler_ui/src/datamanipulationform.cpp | 21 ++- libpgmodeler_ui/src/datamanipulationform.h | 4 + libpgmodeler_ui/src/generalconfigwidget.cpp | 105 ++++++++--- libpgmodeler_ui/src/generalconfigwidget.h | 7 +- libpgmodeler_ui/src/mainwindow.cpp | 59 +++--- libpgmodeler_ui/src/modelvalidationwidget.cpp | 3 + libpgmodeler_ui/src/modelwidget.cpp | 9 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 6 +- libpgmodeler_ui/src/pgmodeleruins.h | 2 +- libpgmodeler_ui/src/welcomewidget.cpp | 4 +- libpgmodeler_ui/ui/generalconfigwidget.ui | 177 +++++++++--------- libpgmodeler_ui/ui/mainwindow.ui | 6 + libpgmodeler_ui/ui/swapobjectsidswidget.ui | 5 - 22 files changed, 302 insertions(+), 150 deletions(-) diff --git a/conf/defaults/pgmodeler.conf b/conf/defaults/pgmodeler.conf index 38405c783c..f26210ece4 100644 --- a/conf/defaults/pgmodeler.conf +++ b/conf/defaults/pgmodeler.conf @@ -37,7 +37,9 @@ align-objs-to-grid="true" min-object-opacity="10" history-max-length="1000" - use-curved-lines="true"/> + use-curved-lines="true" + compact-view="false" + save-restore-geometry="true"/> diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd index 7e78b2c0c8..c874136128 100644 --- a/conf/dtd/pgmodeler.dtd +++ b/conf/dtd/pgmodeler.dtd @@ -2,7 +2,7 @@ CAUTION: Do not modify this file directly on it's code unless you know what you are doing. Unexpected results may occur if the code is changed deliberately. --> - + @@ -45,17 +45,19 @@ + + - + @@ -66,5 +68,10 @@ + + + + + diff --git a/conf/pgmodeler.conf b/conf/pgmodeler.conf index 3830192a0d..f26210ece4 100644 --- a/conf/pgmodeler.conf +++ b/conf/pgmodeler.conf @@ -38,7 +38,8 @@ min-object-opacity="10" history-max-length="1000" use-curved-lines="true" - compact-view="false"/> + compact-view="false" + save-restore-geometry="true"/> diff --git a/conf/schemas/pgmodeler.sch b/conf/schemas/pgmodeler.sch index 466d0e3964..02af5b471e 100644 --- a/conf/schemas/pgmodeler.sch +++ b/conf/schemas/pgmodeler.sch @@ -48,6 +48,7 @@ $sp [ $br %end +%if {widgets-geometry} %then + $sp $br + $sp {widgets-geometry} + $sp $br +%end + $br diff --git a/conf/schemas/widget.sch b/conf/schemas/widget.sch index 95626c56fd..b8f82bc85e 100644 --- a/conf/schemas/widget.sch +++ b/conf/schemas/widget.sch @@ -20,6 +20,14 @@ $tb [ QToolButton::menu-indicator QToolBar#general_tb > QToolButton { - font-weight: bold; + /*font-weight: bold;*/ color: #f0f0f0; min-width: 65px; margin-bottom: 8px; diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 988e733bb2..cc4c0f7d32 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -231,6 +231,7 @@ namespace ParsersAttributes { HAS_CHANGES=QString("has-changes"), HASHES=QString("hashes"), HBA_FILE=QString("hba-file"), + HEIGHT=QString("height"), HIDE_EXT_ATTRIBS=QString("hide-ext-attribs"), HIDE_REL_NAME=QString("hide-rel-name"), HIDE_TABLE_TAGS=QString("hide-table-tags"), @@ -438,6 +439,7 @@ namespace ParsersAttributes { ROW_AMOUNT=QString("row-amount"), RULES=QString("rules"), SAVE_LAST_POSITION=QString("save-last-position"), + SAVE_RESTORE_GEOMETRY=QString("save-restore-geometry"), SCHEMA=QString("schema"), SEARCH_PATH=QString("search-path"), SECURITY_TYPE=QString("security-type"), @@ -567,6 +569,8 @@ namespace ParsersAttributes { VIEW_TITLE=QString("view-title"), VISIBLE=QString("visible"), WIDGET=QString("widget"), + WIDGETS_GEOMETRY=QString("widgets-geometry"), + WIDTH=QString("width"), WILDCARD=QString("wildcard"), WINDOW_FUNC=QString("window-func"), WITH_NO_DATA=QString("with-no-data"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index e9f51853c6..cc0377006d 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -243,6 +243,7 @@ namespace ParsersAttributes { HAS_CHANGES, HASHES, HBA_FILE, + HEIGHT, HIDE_EXT_ATTRIBS, HIDE_REL_NAME, HIDE_TABLE_TAGS, @@ -442,6 +443,7 @@ namespace ParsersAttributes { ROW_AMOUNT, RULES, SAVE_LAST_POSITION, + SAVE_RESTORE_GEOMETRY, SCHEMA, SEARCH_PATH, SECURITY_TYPE, @@ -565,6 +567,8 @@ namespace ParsersAttributes { VIEW_TITLE, VISIBLE, WIDGET, + WIDGETS_GEOMETRY, + WIDTH, WILDCARD, WINDOW_FUNC, WITH_NO_DATA, diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index b832b17f4d..d6bd1ad561 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -97,7 +97,6 @@ void ConfigurationForm::applyConfiguration(void) general_conf->applyConfiguration(); relationships_conf->applyConfiguration(); - QDialog::accept(); } diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 62244933b8..b5515f2c7c 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -24,6 +24,7 @@ #include "baseform.h" #include "bulkdataeditwidget.h" #include "databaseexplorerwidget.h" +#include "generalconfigwidget.h" const QColor DataManipulationForm::ROW_COLORS[3]={ QColor(QString("#C0FFC0")), QColor(QString("#FFFFC0")), QColor(QString("#FFC0C0")) }; const unsigned DataManipulationForm::NO_OPERATION=0; @@ -101,7 +102,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): paste_tb->setEnabled(false); }); - connect(csv_load_tb, SIGNAL(toggled(bool)), csv_load_parent, SLOT(setVisible(bool))); + connect(csv_load_tb, SIGNAL(toggled(bool)), csv_load_parent, SLOT(setVisible(bool))); connect(close_btn, SIGNAL(clicked()), this, SLOT(reject())); connect(schema_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(listTables())); connect(hide_views_chk, SIGNAL(toggled(bool)), this, SLOT(listTables())); @@ -233,7 +234,13 @@ void DataManipulationForm::setAttributes(Connection conn, const QString curr_sch void DataManipulationForm::setHasCsvClipboard(bool value) { - has_csv_clipboard = value; + has_csv_clipboard = value; +} + +void DataManipulationForm::reject(void) +{ + GeneralConfigWidget::saveWidgetGeometry(this); + QDialog::reject(); } void DataManipulationForm::listTables(void) @@ -1408,6 +1415,16 @@ void DataManipulationForm::resizeEvent(QResizeEvent *event) } } +void DataManipulationForm::closeEvent(QCloseEvent *) +{ + GeneralConfigWidget::saveWidgetGeometry(this); +} + +void DataManipulationForm::showEvent(QShowEvent *) +{ + GeneralConfigWidget::restoreWidgetGeometry(this); +} + void DataManipulationForm::truncateTable(void) { try diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 7640e5fecd..a19ff6f7d2 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -103,6 +103,8 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { void browseTable(const QString &fk_name, bool browse_ref_tab); void resizeEvent(QResizeEvent *event); + void closeEvent(QCloseEvent *); + void showEvent(QShowEvent *); public: DataManipulationForm(QWidget * parent = 0, Qt::WindowFlags f = 0); @@ -113,6 +115,8 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { static void setHasCsvClipboard(bool value); private slots: + void reject(void); + //! \brief List the tables based upon the current schema void listTables(void); diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index c6c4406c9a..3d80d44028 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -27,6 +27,7 @@ #include "sqlexecutionwidget.h" map GeneralConfigWidget::config_params; +map GeneralConfigWidget::widgets_geom; GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { @@ -127,6 +128,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_APP]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes:: SAVE_RESTORE_GEOMETRY]=QString(); simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this); simp_obj_creation_ht->setText(simple_obj_creation_chk->statusTip()); @@ -259,7 +261,7 @@ void GeneralConfigWidget::loadConfiguration(void) QStringList margin, custom_size; vector key_attribs; unsigned interv=0; - int tab_width=0; + int tab_width=0, x=0, y=0, w=0, h=0; for(QWidget *wgt : child_wgts) wgt->blockSignals(true); @@ -328,12 +330,27 @@ void GeneralConfigWidget::loadConfiguration(void) source_editor_edt->setText(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_APP]); source_editor_args_edt->setText(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_ARGS]); + save_restore_geometry_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]==ParsersAttributes::_TRUE_); + int ui_idx = ui_language_cmb->findData(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]); ui_language_cmb->setCurrentIndex(ui_idx >= 0 ? ui_idx : 0); for(QWidget *wgt : child_wgts) wgt->blockSignals(false); + widgets_geom.clear(); + for(auto itr : config_params) + { + if(itr.second.count(ParsersAttributes::WIDTH)) + { + x = itr.second[ParsersAttributes::X_POS].toInt(); + y = itr.second[ParsersAttributes::Y_POS].toInt(); + w = itr.second[ParsersAttributes::WIDTH].toInt(); + h = itr.second[ParsersAttributes::HEIGHT].toInt(); + widgets_geom[itr.first] = QRect(QPoint(x,y), QSize(w, h)); + } + } + updateFontPreview(); this->applyConfiguration(); } @@ -350,22 +367,22 @@ void GeneralConfigWidget::addConfigurationParam(const QString ¶m, const attr void GeneralConfigWidget::removeConfigurationParam(const QRegExp ¶m_reg) { - map::iterator itr, itr_end; + map::iterator itr, itr_end; - itr=config_params.begin(); - itr_end=config_params.end(); + itr=config_params.begin(); + itr_end=config_params.end(); - while(itr!=itr_end) + while(itr!=itr_end) + { + if(param_reg.exactMatch(itr->first)) { - if(param_reg.exactMatch(itr->first)) - { - config_params.erase(itr); - itr=config_params.begin(); - itr_end=config_params.end(); - } - - itr++; + config_params.erase(itr); + itr=config_params.begin(); + itr_end=config_params.end(); } + + itr++; + } } map GeneralConfigWidget::getConfigurationParams(void) @@ -375,17 +392,41 @@ map GeneralConfigWidget::getConfigurationParams(void) QString GeneralConfigWidget::getConfigurationParam(const QString §ion_id, const QString ¶m_name) { - if(config_params.count(section_id) && - config_params[section_id].count(param_name)) - return(config_params[section_id][param_name]); - else - return(QString()); + if(config_params.count(section_id) && + config_params[section_id].count(param_name)) + return(config_params[section_id][param_name]); + else + return(QString()); +} + +void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) +{ + if(!widget || + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) + return; + + QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; + widgets_geom[dlg_name.toLower()] = widget->geometry(); +} + +void GeneralConfigWidget::restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) +{ + if(!widget || + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) + return; + + QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; + dlg_name = dlg_name.toLower(); + + if(widgets_geom.count(dlg_name) && widgets_geom[dlg_name].width() > 0 && widgets_geom[dlg_name].height() > 0) + widget->setGeometry(widgets_geom[dlg_name]); } void GeneralConfigWidget::saveConfiguration(void) { try { + attribs_map attribs; map::iterator itr, itr_end; QString file_sch, root_dir, widget_sch; bool show_grid=false, show_delim=false, align_grid=false; @@ -460,6 +501,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]=ui_language_cmb->currentData().toString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]=(BaseObjectView::isCompactViewEnabled() ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]=(save_restore_geometry_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); @@ -468,6 +510,7 @@ void GeneralConfigWidget::saveConfiguration(void) itr_end=config_params.end(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DOCK_WIDGETS]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGETS_GEOMETRY]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]=QString(); @@ -486,18 +529,35 @@ void GeneralConfigWidget::saveConfiguration(void) schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } else if(itr->first==ParsersAttributes::VALIDATOR || - itr->first==ParsersAttributes::OBJECT_FINDER || - itr->first==ParsersAttributes::SQL_TOOL) + itr->first==ParsersAttributes::OBJECT_FINDER || + itr->first==ParsersAttributes::SQL_TOOL) { schparser.ignoreUnkownAttributes(true); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DOCK_WIDGETS]+= - schparser.getCodeDefinition(widget_sch, itr->second); + schparser.getCodeDefinition(widget_sch, itr->second); schparser.ignoreUnkownAttributes(false); } itr++; } + if(save_restore_geometry_chk->isChecked()) + { + for(auto &itr : widgets_geom) + { + attribs[ParsersAttributes::ID] = itr.first; + attribs[ParsersAttributes::X_POS] = QString::number(itr.second.left()); + attribs[ParsersAttributes::Y_POS] = QString::number(itr.second.top()); + attribs[ParsersAttributes::WIDTH] = QString::number(itr.second.width()); + attribs[ParsersAttributes::HEIGHT] = QString::number(itr.second.height()); + + schparser.ignoreUnkownAttributes(true); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGETS_GEOMETRY]+= + schparser.getCodeDefinition(widget_sch, attribs); + schparser.ignoreUnkownAttributes(false); + } + } + BaseConfigWidget::saveConfiguration(GlobalAttributes::GENERAL_CONF, config_params); } catch(Exception &e) @@ -515,6 +575,9 @@ void GeneralConfigWidget::applyConfiguration(void) if(fnt_size < 5.0f) fnt_size=5.0f; + if(!save_restore_geometry_chk->isChecked()) + widgets_geom.clear(); + unity_cmb->setCurrentIndex(UNIT_POINT); ObjectsScene::setPaperConfiguration(static_cast(paper_cmb->itemData(paper_cmb->currentIndex()).toInt()), (portrait_rb->isChecked() ? QPrinter::Portrait : QPrinter::Landscape), diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index 48fbc01281..4aae4b4704 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -1,4 +1,4 @@ -/* +/* # PostgreSQL Database Modeler (pgModeler) # # Copyright 2006-2018 - Raphael Araújo e Silva @@ -40,6 +40,8 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg NumberedTextEditor *font_preview_txt; + static map widgets_geom; + static map config_params; static const unsigned UNIT_MILIMETERS=0, @@ -69,6 +71,9 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg Section id can be , , or */ static QString getConfigurationParam(const QString §ion_id, const QString ¶m_name); + static void saveWidgetGeometry(QWidget *widget, const QString &custom_wgt_name = QString()); + static void restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name = QString()); + public slots: void applyConfiguration(void); void restoreDefaults(void); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 3f02532434..80ec394e0e 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -212,9 +212,15 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(model_nav_wgt, SIGNAL(s_currentModelChanged(int)), this, SLOT(setCurrentModel())); connect(action_print, SIGNAL(triggered(bool)), this, SLOT(printModel(void))); - connect(action_configuration, SIGNAL(triggered(bool)), configuration_form, SLOT(show())); + + connect(action_configuration, &QAction::triggered, [&](){ + GeneralConfigWidget::restoreWidgetGeometry(configuration_form); + configuration_form->exec(); + GeneralConfigWidget::saveWidgetGeometry(configuration_form); + }); connect(oper_list_wgt, SIGNAL(s_operationExecuted(void)), overview_wgt, SLOT(updateOverview(void))); + connect(configuration_form, SIGNAL(finished(int)), this, SLOT(applyConfigurations(void))); connect(configuration_form, SIGNAL(rejected()), this, SLOT(updateConnections())); connect(&model_save_timer, SIGNAL(timeout(void)), this, SLOT(saveAllModels(void))); @@ -343,6 +349,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par QList actions=general_tb->actions(); QToolButton *btn=nullptr; + QFont font; for(auto &act : actions) { @@ -350,7 +357,10 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par if(btn) { - PgModelerUiNS::configureWidgetFont(btn, PgModelerUiNS::SMALL_FONT_FACTOR); + PgModelerUiNS::configureWidgetFont(btn, static_cast(PgModelerUiNS::MEDIUM_FONT_FACTOR)); + font = btn->font(); + font.setBold(true); + btn->setFont(font); btn->setGraphicsEffect(createDropShadow(btn)); } } @@ -554,7 +564,10 @@ void MainWindow::fixModel(const QString &filename) } PgModelerUiNS::resizeDialog(&model_fix_form); + GeneralConfigWidget::restoreWidgetGeometry(&model_fix_form); model_fix_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&model_fix_form); + disconnect(&model_fix_form, nullptr, this, nullptr); } @@ -1004,6 +1017,7 @@ void MainWindow::setCurrentModel(void) { QToolButton *tool_btn=nullptr; QList btns; + QFont font; current_model->setFocus(Qt::OtherFocusReason); current_model->cancelObjectAddition(); @@ -1026,25 +1040,6 @@ void MainWindow::setCurrentModel(void) tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_source_code)); btns.push_back(tool_btn); - /* general_tb->addAction(current_model->action_select_all); - tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_select_all)); - tool_btn->setPopupMode(QToolButton::InstantPopup); - btns.push_back(tool_btn); - - general_tb->addAction(current_model->action_fade); - tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_fade)); - tool_btn->setPopupMode(QToolButton::InstantPopup); - btns.push_back(tool_btn); - - general_tb->addAction(current_model->action_extended_attribs); - tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_extended_attribs)); - tool_btn->setPopupMode(QToolButton::InstantPopup); - btns.push_back(tool_btn); - - general_tb->addAction(current_model->action_edit_creation_order); - tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_edit_creation_order)); - btns.push_back(tool_btn); */ - more_actions_menu.clear(); more_actions_menu.addAction(current_model->action_select_all); more_actions_menu.addAction(current_model->action_fade); @@ -1057,7 +1052,10 @@ void MainWindow::setCurrentModel(void) for(QToolButton *btn : btns) { - PgModelerUiNS::configureWidgetFont(btn, PgModelerUiNS::SMALL_FONT_FACTOR); + PgModelerUiNS::configureWidgetFont(btn, static_cast(PgModelerUiNS::MEDIUM_FONT_FACTOR)); + font = btn->font(); + font.setBold(true); + btn->setFont(font); btn->setGraphicsEffect(createDropShadow(tool_btn)); } @@ -1263,7 +1261,7 @@ void MainWindow::updateModelTabName(void) void MainWindow::applyConfigurations(void) { - if(!sender() || + if(!sender() || (sender()==configuration_form && configuration_form->result()==QDialog::Accepted)) { GeneralConfigWidget *conf_wgt=nullptr; @@ -1435,8 +1433,12 @@ void MainWindow::exportModel(void) { stopTimers(true); connect(&model_export_form, &ModelExportForm::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); + PgModelerUiNS::resizeDialog(&model_export_form); + GeneralConfigWidget::restoreWidgetGeometry(&model_export_form); model_export_form.exec(current_model); + GeneralConfigWidget::saveWidgetGeometry(&model_export_form); + stopTimers(false); } } @@ -1450,7 +1452,9 @@ void MainWindow::importDatabase(void) connect(&db_import_form, &DatabaseImportForm::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); db_import_form.setModelWidget(current_model); PgModelerUiNS::resizeDialog(&db_import_form); + GeneralConfigWidget::restoreWidgetGeometry(&db_import_form); db_import_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&db_import_form); stopTimers(false); if(db_import_form.result()==QDialog::Accepted && db_import_form.getModelWidget()) @@ -1491,8 +1495,11 @@ void MainWindow::diffModelDatabase(void) stopTimers(true); connect(&modeldb_diff_frm, &ModelDatabaseDiffForm::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); + PgModelerUiNS::resizeDialog(&modeldb_diff_frm); + GeneralConfigWidget::restoreWidgetGeometry(&modeldb_diff_frm); modeldb_diff_frm.exec(); + GeneralConfigWidget::saveWidgetGeometry(&modeldb_diff_frm); stopTimers(false); } } @@ -1960,7 +1967,9 @@ void MainWindow::reportBug(void) { BugReportForm bugrep_frm; PgModelerUiNS::resizeDialog(&bugrep_frm); + GeneralConfigWidget::restoreWidgetGeometry(&bugrep_frm); bugrep_frm.exec(); + GeneralConfigWidget::saveWidgetGeometry(&bugrep_frm); } void MainWindow::removeOperations(void) @@ -1979,7 +1988,11 @@ void MainWindow::handleObjectsMetadata(void) objs_meta_frm.setModelWidget(current_model); objs_meta_frm.setModelWidgets(model_nav_wgt->getModelWidgets()); connect(&objs_meta_frm, SIGNAL(s_metadataHandled()), model_objs_wgt, SLOT(updateObjectsView())); + + PgModelerUiNS::resizeDialog(&objs_meta_frm); + GeneralConfigWidget::restoreWidgetGeometry(&objs_meta_frm); objs_meta_frm.exec(); + GeneralConfigWidget::saveWidgetGeometry(&objs_meta_frm); } void MainWindow::arrangeObjects(void) diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 9017267c01..68b6876b69 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -575,5 +575,8 @@ void ModelValidationWidget::swapObjectsIds(void) SwapObjectsIdsWidget *swap_ids_wgt=new SwapObjectsIdsWidget; swap_ids_wgt->setModel(model_wgt->getDatabaseModel()); parent_form.setMainWidget(swap_ids_wgt); + + GeneralConfigWidget::restoreWidgetGeometry(&parent_form, this->metaObject()->className()); parent_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&parent_form, this->metaObject()->className()); } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 16cbc4b648..a5df90cf33 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -57,6 +57,7 @@ #include "genericsqlwidget.h" #include "policywidget.h" #include "tabledatawidget.h" +#include "generalconfigwidget.h" vector ModelWidget::copied_objects; vector ModelWidget::cutted_objects; @@ -1603,6 +1604,7 @@ int ModelWidget::openEditingForm(QWidget *widget, unsigned button_conf) { BaseForm editing_form(this); BaseObjectWidget *base_obj_wgt=qobject_cast(widget); + int res = 0; if(base_obj_wgt) editing_form.setMainWidget(base_obj_wgt); @@ -1610,7 +1612,12 @@ int ModelWidget::openEditingForm(QWidget *widget, unsigned button_conf) editing_form.setMainWidget(widget); editing_form.setButtonConfiguration(button_conf); - return(editing_form.exec()); + + GeneralConfigWidget::restoreWidgetGeometry(&editing_form, widget->metaObject()->className()); + res = editing_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&editing_form, widget->metaObject()->className()); + + return(res); } template diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 0abaf0ecfb..ba14253b80 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -201,7 +201,7 @@ namespace PgModelerUiNS { switch(factor_id) { case SMALL_FONT_FACTOR: - factor=0.85f; + factor=0.80f; break; case MEDIUM_FONT_FACTOR: factor=0.90f; @@ -215,10 +215,10 @@ namespace PgModelerUiNS { break; } - configureWidgetFont(widget, factor); + __configureWidgetFont(widget, factor); } - void configureWidgetFont(QWidget *widget, float factor) + void __configureWidgetFont(QWidget *widget, float factor) { if(!widget) return; diff --git a/libpgmodeler_ui/src/pgmodeleruins.h b/libpgmodeler_ui/src/pgmodeleruins.h index 9cba39927a..d2d64cc4cf 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.h +++ b/libpgmodeler_ui/src/pgmodeleruins.h @@ -39,7 +39,7 @@ namespace PgModelerUiNS { HUGE_FONT_FACTOR = 3; extern void configureWidgetFont(QWidget *widget, unsigned factor_id); - extern void configureWidgetFont(QWidget *widget, float factor); + extern void __configureWidgetFont(QWidget *widget, float factor); /*! \brief Creates a NumberedTextEditor instance automatically assigning it to 'parent'. This method will create a layout if 'parent' doesn't has one. If parent has a layout diff --git a/libpgmodeler_ui/src/welcomewidget.cpp b/libpgmodeler_ui/src/welcomewidget.cpp index b12111e209..bc9424d49e 100644 --- a/libpgmodeler_ui/src/welcomewidget.cpp +++ b/libpgmodeler_ui/src/welcomewidget.cpp @@ -36,9 +36,9 @@ WelcomeWidget::WelcomeWidget(QWidget *parent): QWidget(parent) btn->setGraphicsEffect(shadow); #ifdef Q_OS_LINUX - PgModelerUiNS::configureWidgetFont(btn, 1.20f); + PgModelerUiNS::__configureWidgetFont(btn, 1.20f); #else - PgModelerUiNS::configureWidgetFont(btn, 1.50f); + PgModelerUiNS::__configureWidgetFont(btn, 1.50f); #endif } } diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 19c46a92cd..9e0a340d81 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -1011,6 +1011,88 @@ 4 + + + + + + + false + + + + + + + true + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Browse the source code editor application + + + + + + + :/icones/icones/abrir.png:/icones/icones/abrir.png + + + + 22 + 22 + + + + + + + + Check if there is a new version on server + + + Check updates at startup + + + false + + + + + + + Configurations directory: + + + + + + + Souce code editor: + + + @@ -1018,6 +1100,13 @@ + + + + User interface language: + + + @@ -1234,36 +1323,6 @@ - - - - - - - false - - - - - - - Check if there is a new version on server - - - Check updates at startup - - - false - - - - - - - true - - - @@ -1274,62 +1333,10 @@ - - - - User interface language: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Browse the source code editor application - - - - - - - :/icones/icones/abrir.png:/icones/icones/abrir.png - - - - 22 - 22 - - - - - - - - Souce code editor: - - - - - + + - Configurations directory: + Save/restore the dialogs dimensions diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index 902f165c4e..391a91b591 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -768,6 +768,12 @@ 0 + + + 50 + false + + General diff --git a/libpgmodeler_ui/ui/swapobjectsidswidget.ui b/libpgmodeler_ui/ui/swapobjectsidswidget.ui index b36d3604a1..6e57d3ec83 100644 --- a/libpgmodeler_ui/ui/swapobjectsidswidget.ui +++ b/libpgmodeler_ui/ui/swapobjectsidswidget.ui @@ -438,11 +438,6 @@ 81 - - - 9 - - QAbstractItemView::NoEditTriggers From 7af0c5445923bfba1369da1b5a662361101e10ba Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 15 Aug 2018 01:14:19 -0300 Subject: [PATCH 085/425] Fixed an error raised right after activating the dialogs dimension save/ restore and closing the configration form --- libpgmodeler_ui/src/generalconfigwidget.cpp | 2 ++ libpgmodeler_ui/src/mainwindow.cpp | 2 +- libpgmodeler_ui/ui/generalconfigwidget.ui | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 3d80d44028..421198e2b4 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -533,9 +533,11 @@ void GeneralConfigWidget::saveConfiguration(void) itr->first==ParsersAttributes::SQL_TOOL) { schparser.ignoreUnkownAttributes(true); + schparser.ignoreEmptyAttributes(true); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DOCK_WIDGETS]+= schparser.getCodeDefinition(widget_sch, itr->second); schparser.ignoreUnkownAttributes(false); + schparser.ignoreEmptyAttributes(false); } itr++; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 80ec394e0e..99a1200941 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1071,7 +1071,7 @@ void MainWindow::setCurrentModel(void) else this->setWindowTitle(window_title + QString(" - ") + QDir::toNativeSeparators(current_model->getFilename())); - connect(current_model, SIGNAL(s_manipulationCanceled(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); + connect(current_model, SIGNAL(s_manipulationCanceled(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectsMoved(void)),oper_list_wgt, SLOT(updateOperationList(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectModified(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectCreated(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 9e0a340d81..83c7cb3ad0 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -6,7 +6,7 @@ 0 0 - 671 + 743 587 From 688df78bf6830a74f003071f4319f76975015f5f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 15 Aug 2018 14:45:44 -0300 Subject: [PATCH 086/425] Fixed the editing form canceling operation. Now operations done when the form were opened are undone correctly. --- libpgmodeler_ui/src/baseform.cpp | 1 + libpgmodeler_ui/src/baseobjectwidget.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp index 4ee8531788..2618f48cd7 100644 --- a/libpgmodeler_ui/src/baseform.cpp +++ b/libpgmodeler_ui/src/baseform.cpp @@ -136,6 +136,7 @@ void BaseForm::setMainWidget(BaseObjectWidget *widget) resizeForm(widget); setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + connect(cancel_btn, SIGNAL(clicked(bool)), widget, SLOT(cancelConfiguration())); connect(cancel_btn, SIGNAL(clicked(bool)), this, SLOT(reject())); connect(apply_ok_btn, SIGNAL(clicked(bool)), widget, SLOT(applyConfiguration())); connect(widget, SIGNAL(s_closeRequested()), this, SLOT(accept())); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 394308c7c7..e44b37d09c 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -294,6 +294,9 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis if(!model || (uses_op_list && !op_list)) throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + if(op_list) + operation_count = op_list->getCurrentSize(); + this->model=model; if(parent_obj) @@ -918,8 +921,8 @@ void BaseObjectWidget::cancelConfiguration(void) //If the object is not a new one, restore its previous state if(op_list && - ((!new_object && obj_type!=OBJ_DATABASE && obj_type!=OBJ_PERMISSION) || - (new_object && (obj_type==OBJ_TABLE || obj_type==OBJ_VIEW || obj_type==OBJ_RELATIONSHIP)))) + ((!new_object && obj_type!=OBJ_DATABASE && obj_type!=OBJ_PERMISSION && operation_count != op_list->getCurrentSize()) || + (new_object && (obj_type==OBJ_TABLE || obj_type==OBJ_VIEW || obj_type==OBJ_RELATIONSHIP)))) { try { From 8e1593bf2b13d51d19d4a54b79452e20228896ec Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 15 Aug 2018 14:46:23 -0300 Subject: [PATCH 087/425] Minor performance tuning when handling big models. --- libpgmodeler_ui/src/mainwindow.cpp | 11 +++-- libpgmodeler_ui/src/modelobjectswidget.cpp | 26 ++++++++-- libpgmodeler_ui/src/objectfinderwidget.cpp | 54 +++++++++++++-------- libpgmodeler_ui/src/operationlistwidget.cpp | 3 ++ libpgmodeler_ui/ui/mainwindow.ui | 20 ++++---- 5 files changed, 75 insertions(+), 39 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 99a1200941..f05ec4b430 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -748,6 +748,7 @@ void MainWindow::saveTemporaryModels(void) if(count > 0) { + QApplication::setOverrideCursor(Qt::WaitCursor); canvas_info_parent->setVisible(false); bg_saving_wgt->setVisible(true); bg_saving_pb->setValue(0); @@ -767,14 +768,15 @@ void MainWindow::saveTemporaryModels(void) bg_saving_pb->setValue(100); bg_saving_wgt->setVisible(false); canvas_info_parent->setVisible(true); + QApplication::restoreOverrideCursor(); } - tmpmodel_thread.quit(); + tmpmodel_thread.quit(); } catch(Exception &e) { + QApplication::restoreOverrideCursor(); Messagebox msg_box; - tmpmodel_thread.quit(); msg_box.show(e); } @@ -1071,7 +1073,7 @@ void MainWindow::setCurrentModel(void) else this->setWindowTitle(window_title + QString(" - ") + QDir::toNativeSeparators(current_model->getFilename())); - connect(current_model, SIGNAL(s_manipulationCanceled(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); + connect(current_model, SIGNAL(s_manipulationCanceled(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectsMoved(void)),oper_list_wgt, SLOT(updateOperationList(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectModified(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectCreated(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); @@ -1646,7 +1648,6 @@ void MainWindow::updateToolsState(bool model_closed) action_save_model->setEnabled(enabled); action_save_all->setEnabled(enabled); action_export->setEnabled(enabled); - //action_diff->setEnabled(enabled); action_close_model->setEnabled(enabled); action_show_grid->setEnabled(enabled); action_show_delimiters->setEnabled(enabled); @@ -1683,7 +1684,7 @@ void MainWindow::updateDockWidgets(void) model_valid_wgt->setModel(current_model); if(current_model && obj_finder_wgt->result_tbw->rowCount() > 0) - obj_finder_wgt->findObjects(); + obj_finder_wgt->findObjects(); } void MainWindow::executePlugin(void) diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 500e21c596..c6faa31a21 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -129,7 +129,9 @@ void ModelObjectsWidget::editObject(void) Permission *perm=dynamic_cast(obj); if(perm) - model_wgt->showObjectForm(OBJ_PERMISSION,perm->getObject()); + model_wgt->showObjectForm(OBJ_PERMISSION,perm->getObject()); + else + model_wgt->editObject(); } else model_wgt->editObject(); @@ -429,11 +431,11 @@ void ModelObjectsWidget::filterObjects(void) void ModelObjectsWidget::updateObjectsView(void) { - updateDatabaseTree(); - updateObjectsList(); + updateDatabaseTree(); + updateObjectsList(); - if(!filter_edt->text().isEmpty()) - filterObjects(); + if(!filter_edt->text().isEmpty()) + filterObjects(); } void ModelObjectsWidget::updateObjectsList(void) @@ -442,6 +444,10 @@ void ModelObjectsWidget::updateObjectsList(void) if(db_model) { + //Avoiding update the tree if the model is not modified and there's already items on it + if(model_wgt && !model_wgt->isModified() && objectslist_tbw->rowCount() > 0) + return; + vector visible_types; for(auto &tp : visible_objs_map) @@ -700,6 +706,10 @@ void ModelObjectsWidget::updateDatabaseTree(void) objectstree_tw->clear(); else { + //Avoiding update the list if the model is not modified and there's already items on it + if(!model_wgt->isModified() && objectstree_tw->topLevelItemCount() > 0) + return; + QString str_aux; BaseObject *object=nullptr; QTreeWidgetItem *root=nullptr,*item1=nullptr, *item2=nullptr; @@ -716,6 +726,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) if(save_tree_state) saveTreeState(tree_state); + objectstree_tw->setUpdatesEnabled(false); objectstree_tw->clear(); if(visible_objs_map[OBJ_DATABASE]) @@ -768,6 +779,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) } } + objectstree_tw->setUpdatesEnabled(true); objectstree_tw->expandItem(root); if(save_tree_state) @@ -952,6 +964,8 @@ void ModelObjectsWidget::restoreTreeState(vector &tree_items) { QTreeWidgetItem *item=nullptr, *parent_item=nullptr; + objectslist_tbw->setUpdatesEnabled(false); + while(!tree_items.empty()) { item=getTreeItem(tree_items.back()); @@ -969,6 +983,8 @@ void ModelObjectsWidget::restoreTreeState(vector &tree_items) tree_items.pop_back(); } + + objectslist_tbw->setUpdatesEnabled(true); } QTreeWidgetItem *ModelObjectsWidget::getTreeItem(BaseObject *object) diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 5c2c22877a..8046940174 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -216,7 +216,6 @@ void ObjectFinderWidget::findObjects(void) if(model_wgt) { vector types; - clearResult(); //Getting the selected object types @@ -320,10 +319,9 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorrowCount() > 0) - tab_wgt->removeRow(0); - + tab_wgt->setUpdatesEnabled(false); tab_wgt->setSortingEnabled(false); for(lin_idx=0, i=0; i < objs.size(); i++) @@ -333,26 +331,30 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorinsertRow(lin_idx); + new_row = false; + + if(static_cast(lin_idx) >= tab_wgt->rowCount()) + { + tab_wgt->insertRow(lin_idx); + new_row = true; + } //First column: Object id - tab_item=new QTableWidgetItem; - //tab_item->setFont(fnt); + tab_item=(new_row ? new QTableWidgetItem : tab_wgt->item(lin_idx, 0)); tab_item->setText(QString::number(objs[i]->getObjectId())); tab_item->setData(Qt::UserRole, QVariant::fromValue(reinterpret_cast(objs[i]))); - tab_wgt->setItem(lin_idx, 0, tab_item); - + if(new_row) tab_wgt->setItem(lin_idx, 0, tab_item); //Second column: Object name if(tab_wgt->columnCount() > 1) { - tab_item=new QTableWidgetItem; + tab_item=(new_row ? new QTableWidgetItem : tab_wgt->item(lin_idx, 1)); tab_item->setData(Qt::UserRole, QVariant::fromValue(reinterpret_cast(objs[i]))); fnt=tab_item->font(); tab_item->setText(objs[i]->getName()); tab_item->setIcon(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(objs[i]->getObjectType()) + str_aux))); - tab_wgt->setItem(lin_idx, 1, tab_item); + if(new_row) tab_wgt->setItem(lin_idx, 1, tab_item); if(objs[i]->isProtected() || objs[i]->isSystemObject()) { @@ -365,6 +367,12 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorsetForeground(BaseObjectView::getFontStyle(ParsersAttributes::INH_COLUMN).foreground()); } + else + { + fnt.setItalic(false); + tab_item->setForeground(BaseObjectView::getFontStyle(ParsersAttributes::COLUMN).foreground()); + } + fnt.setStrikeOut(objs[i]->isSQLDisabled() && !objs[i]->isSystemObject()); tab_item->setFont(fnt); @@ -375,16 +383,16 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorcolumnCount() > 2) { fnt.setItalic(true); - tab_item=new QTableWidgetItem; + tab_item=(new_row ? new QTableWidgetItem : tab_wgt->item(lin_idx, 2)); tab_item->setFont(fnt); tab_item->setText(objs[i]->getTypeName()); - tab_wgt->setItem(lin_idx, 2, tab_item); + if(new_row) tab_wgt->setItem(lin_idx, 2, tab_item); } //Fourth column: Parent object name if(tab_wgt->columnCount() > 3) { - tab_item=new QTableWidgetItem; + tab_item=(new_row ? new QTableWidgetItem : tab_wgt->item(lin_idx, 3)); if(dynamic_cast(objs[i])) parent_obj=dynamic_cast(objs[i])->getParentTable(); @@ -397,18 +405,22 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorsetText(parent_obj ? parent_obj->getName() : QString("-")); tab_item->setData(Qt::UserRole, QVariant::fromValue(reinterpret_cast(parent_obj))); - - tab_wgt->setItem(lin_idx, 3, tab_item); + if(new_row) tab_wgt->setItem(lin_idx, 3, tab_item); if(parent_obj) { if(parent_obj->isProtected() || parent_obj->isSystemObject()) { fnt.setItalic(true); - tab_item->setFont(fnt); tab_item->setForeground(BaseObjectView::getFontStyle(ParsersAttributes::PROT_COLUMN).foreground()); } + else + { + fnt.setItalic(false); + tab_item->setForeground(BaseObjectView::getFontStyle(ParsersAttributes::COLUMN).foreground()); + } + tab_item->setFont(fnt); tab_item->setIcon(QPixmap(PgModelerUiNS::getIconPath(parent_obj->getObjectType()))); } } @@ -416,16 +428,20 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorcolumnCount() > 4) { - tab_item=new QTableWidgetItem; + tab_item=(new_row ? new QTableWidgetItem : tab_wgt->item(lin_idx, 4)); fnt.setItalic(true); tab_item->setFont(fnt); tab_item->setText(parent_obj ? parent_obj->getTypeName() : QString("-")); - tab_wgt->setItem(lin_idx, 4, tab_item); + if(new_row) tab_wgt->setItem(lin_idx, 4, tab_item); } lin_idx++; } + if(static_cast(objs.size()) != tab_wgt->rowCount()) + tab_wgt->setRowCount(objs.size()); + + tab_wgt->setUpdatesEnabled(true); tab_wgt->setSortingEnabled(true); } } diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 6cee4a8adb..31a3733579 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -72,6 +72,7 @@ void OperationListWidget::updateOperationList(void) QFont font=this->font(); bool value=false; + operations_tw->setUpdatesEnabled(false); op_count_lbl->setText(QString("%1").arg(model_wgt->op_list->getCurrentSize())); current_pos_lbl->setText(QString("%1").arg(model_wgt->op_list->getCurrentIndex())); redo_tb->setEnabled(model_wgt->op_list->isRedoAvailable()); @@ -139,6 +140,8 @@ void OperationListWidget::updateOperationList(void) if(value) operations_tw->scrollToItem(item1); } + + operations_tw->setUpdatesEnabled(true); } emit s_operationListUpdated(); diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index 391a91b591..6e3b72261f 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -554,7 +554,7 @@ 3 - + 0 @@ -562,14 +562,14 @@ - Toggle the operation history widget + Toggle the model objects widget - &Operations + O&bjects - :/icones/icones/funcao.png:/icones/icones/funcao.png + :/icones/icones/tablespace.png:/icones/icones/tablespace.png @@ -578,7 +578,7 @@ - Alt+O + Alt+B true @@ -605,7 +605,7 @@ - + 0 @@ -613,14 +613,14 @@ - Toggle the model objects widget + Toggle the operation history widget - O&bjects + &Operations - :/icones/icones/tablespace.png:/icones/icones/tablespace.png + :/icones/icones/funcao.png:/icones/icones/funcao.png @@ -629,7 +629,7 @@ - Alt+B + Alt+O true From 2c80bffc5092188f6249477fdc1060fcb16d2dbc Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 15 Aug 2018 17:30:46 -0300 Subject: [PATCH 088/425] Minor adjustments on UI stylesheet In DatabaseExplorerWidget the root item will come automatically selcted when browsing a database --- conf/defaults/ui-style.conf | 42 +++++++++++++------ conf/ui-style.conf | 42 +++++++++++++------ .../src/databaseexplorerwidget.cpp | 3 +- libpgmodeler_ui/src/mainwindow.cpp | 5 ++- libpgmodeler_ui/src/mainwindow.h | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 10 +---- libpgmodeler_ui/src/modelobjectswidget.h | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 2 +- libpgmodeler_ui/ui/mainwindow.ui | 14 +++++++ 9 files changed, 82 insertions(+), 40 deletions(-) diff --git a/conf/defaults/ui-style.conf b/conf/defaults/ui-style.conf index 8e88b4ae72..2836c7578b 100644 --- a/conf/defaults/ui-style.conf +++ b/conf/defaults/ui-style.conf @@ -174,12 +174,27 @@ WelcomeWidget > QToolButton::menu-indicator QToolBar#general_tb > QToolButton { - font-weight: bold; color: #f0f0f0; min-width: 65px; - margin-bottom: 8px; - margin-left: 0; - margin-right: 0; + margin-bottom: 2px; + margin-top: 2px; + margin-left: 3px; + margin-right: 3px; +} + +QToolBar#general_tb +{ + border-right: 1px solid #202020; +} + +QToolBar#general_tb::separator +{ + background-color: #80404040; + border-top: 1px solid #202020; + border-left: 1px solid #202020; + border-right: 1px solid #606060; + border-bottom: 1px solid #606060; + height: 1px; } QToolBar#general_tb > QToolButton#qt_toolbar_ext_button @@ -187,7 +202,8 @@ QToolBar#general_tb > QToolButton#qt_toolbar_ext_button min-height: 20px; } -QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover, +QToolBar#general_tb > QToolButton:hover, +WelcomeWidget > QToolButton:hover, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button { color: #fff; @@ -198,25 +214,25 @@ QToolBar#general_tb > QToolButton#qt_toolbar_ext_button border-bottom: 1px solid #606060; } +QToolBar#general_tb > QToolButton:checked, QToolBar#general_tb > QToolButton:pressed, WelcomeWidget > QToolButton:pressed, -QToolBar#general_tb > QToolButton:checked, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:hover, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:pressed { - background-image: url(":/styles/styles/btn_checked_bg.png"); - border-right: 1px solid #404040; - border-bottom: 1px solid #404040; - border-left: 1px solid #404040; - border-top: 1px solid #404040; - padding: 0; - color: #000 + color: #fff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #804aa5ff , stop: 1 #8081cdff); + border-top: 1px solid qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #48a5fc , stop: 1 #3a86cc); + border-left: 1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #48a5fc , stop: 1 #3a86cc); + border-right: 1px solid #3a86cc; + border-bottom: 1px solid #3a86cc; } WelcomeWidget > QToolButton:disabled { color: #404040; } + QToolBar#general_tb > QToolButton:disabled { color: #808080; diff --git a/conf/ui-style.conf b/conf/ui-style.conf index 47bf235f0b..2836c7578b 100644 --- a/conf/ui-style.conf +++ b/conf/ui-style.conf @@ -174,12 +174,27 @@ WelcomeWidget > QToolButton::menu-indicator QToolBar#general_tb > QToolButton { - /*font-weight: bold;*/ color: #f0f0f0; min-width: 65px; - margin-bottom: 8px; - margin-left: 0; - margin-right: 0; + margin-bottom: 2px; + margin-top: 2px; + margin-left: 3px; + margin-right: 3px; +} + +QToolBar#general_tb +{ + border-right: 1px solid #202020; +} + +QToolBar#general_tb::separator +{ + background-color: #80404040; + border-top: 1px solid #202020; + border-left: 1px solid #202020; + border-right: 1px solid #606060; + border-bottom: 1px solid #606060; + height: 1px; } QToolBar#general_tb > QToolButton#qt_toolbar_ext_button @@ -187,7 +202,8 @@ QToolBar#general_tb > QToolButton#qt_toolbar_ext_button min-height: 20px; } -QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover, +QToolBar#general_tb > QToolButton:hover, +WelcomeWidget > QToolButton:hover, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button { color: #fff; @@ -198,25 +214,25 @@ QToolBar#general_tb > QToolButton#qt_toolbar_ext_button border-bottom: 1px solid #606060; } +QToolBar#general_tb > QToolButton:checked, QToolBar#general_tb > QToolButton:pressed, WelcomeWidget > QToolButton:pressed, -QToolBar#general_tb > QToolButton:checked, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:hover, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:pressed { - background-image: url(":/styles/styles/btn_checked_bg.png"); - border-right: 1px solid #404040; - border-bottom: 1px solid #404040; - border-left: 1px solid #404040; - border-top: 1px solid #404040; - padding: 0; - color: #000 + color: #fff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #804aa5ff , stop: 1 #8081cdff); + border-top: 1px solid qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #48a5fc , stop: 1 #3a86cc); + border-left: 1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #48a5fc , stop: 1 #3a86cc); + border-right: 1px solid #3a86cc; + border-bottom: 1px solid #3a86cc; } WelcomeWidget > QToolButton:disabled { color: #404040; } + QToolBar#general_tb > QToolButton:disabled { color: #808080; diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 66450712c8..f2fab5a24d 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -951,9 +951,10 @@ void DatabaseExplorerWidget::listObjects(void) root->addChild(curr_root); objects_trw->addTopLevelItem(root); root->setExpanded(true); + root->setSelected(true); + objects_trw->setCurrentItem(root); QApplication::restoreOverrideCursor(); - objects_trw->blockSignals(false); import_helper.closeConnection(); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index f05ec4b430..2d92cc6b92 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1024,6 +1024,8 @@ void MainWindow::setCurrentModel(void) current_model->setFocus(Qt::OtherFocusReason); current_model->cancelObjectAddition(); + general_tb->addSeparator(); + general_tb->addAction(current_model->action_new_object); tool_btn=qobject_cast(general_tb->widgetForAction(current_model->action_new_object)); tool_btn->setPopupMode(QToolButton::InstantPopup); @@ -1073,7 +1075,8 @@ void MainWindow::setCurrentModel(void) else this->setWindowTitle(window_title + QString(" - ") + QDir::toNativeSeparators(current_model->getFilename())); - connect(current_model, SIGNAL(s_manipulationCanceled(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); + //connect(current_model, SIGNAL(s_manipulationCanceled(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); + connect(current_model, SIGNAL(s_manipulationCanceled(void)),oper_list_wgt, SLOT(updateOperationList(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectsMoved(void)),oper_list_wgt, SLOT(updateOperationList(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectModified(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectCreated(void)),this, SLOT(updateDockWidgets(void)), Qt::UniqueConnection); diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 11e7fe5d9e..aee053abc8 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -58,7 +58,7 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { //! \brief Maximum number of files listed on recent models menu const static int MAX_RECENT_MODELS=15; - const static int GENERAL_ACTIONS_COUNT=7; + const static int GENERAL_ACTIONS_COUNT=9; const static int WELCOME_VIEW=0, DESIGN_VIEW=1, diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index c6faa31a21..9986c4cd2f 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -444,10 +444,6 @@ void ModelObjectsWidget::updateObjectsList(void) if(db_model) { - //Avoiding update the tree if the model is not modified and there's already items on it - if(model_wgt && !model_wgt->isModified() && objectslist_tbw->rowCount() > 0) - return; - vector visible_types; for(auto &tp : visible_objs_map) @@ -706,10 +702,6 @@ void ModelObjectsWidget::updateDatabaseTree(void) objectstree_tw->clear(); else { - //Avoiding update the list if the model is not modified and there's already items on it - if(!model_wgt->isModified() && objectstree_tw->topLevelItemCount() > 0) - return; - QString str_aux; BaseObject *object=nullptr; QTreeWidgetItem *root=nullptr,*item1=nullptr, *item2=nullptr; @@ -802,7 +794,7 @@ BaseObject *ModelObjectsWidget::getSelectedObject(void) void ModelObjectsWidget::enableObjectCreation(bool value) { - enable_obj_creation=value; + enable_obj_creation=value; } void ModelObjectsWidget::close(void) diff --git a/libpgmodeler_ui/src/modelobjectswidget.h b/libpgmodeler_ui/src/modelobjectswidget.h index 2c71b20ca7..e4616a6b3e 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.h +++ b/libpgmodeler_ui/src/modelobjectswidget.h @@ -38,7 +38,7 @@ class ModelObjectsWidget: public QWidget, public Ui::ModelObjectsWidget { /*! \brief Indicates if the widget must be used as a simplified view (without the most interactions). The purpose to use it as simplified view is to be serve as a object pick commonly used on the object selectors. See ObjectSelectorWidget for details. */ - bool simplified_view, + bool simplified_view, /*! \brief Indicates if the object tree state must be saved, this means, that the current item expansion is memorized and can be restored at any moment via restoreTreeState() method */ diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index a5df90cf33..7acc28875d 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1799,7 +1799,7 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb emit s_objectManipulated(); } else - emit s_manipulationCanceled(); + emit s_manipulationCanceled(); this->setFocus(); } diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index 6e3b72261f..d0d5c77891 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -503,6 +503,9 @@ Qt::ToolButtonTextBesideIcon + + false + @@ -538,6 +541,9 @@ Qt::ToolButtonTextBesideIcon + + false +
@@ -586,6 +592,9 @@ Qt::ToolButtonTextBesideIcon + + false +
@@ -637,6 +646,9 @@ Qt::ToolButtonTextBesideIcon + + false + @@ -807,9 +819,11 @@ + + From ad1d169c6f00c7114cc1348cedc0c7f5e58cf5b7 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 15 Aug 2018 17:51:03 -0300 Subject: [PATCH 089/425] Fixed a bug in ObjectFinderWidget that was forcing schemas rectangles to appear even if the flag indicating them to be visible was set to false --- libpgmodeler_ui/src/modelwidget.cpp | 6 +++++- libpgmodeler_ui/src/objectfinderwidget.cpp | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 7acc28875d..b1864b7cae 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -3322,10 +3322,14 @@ void ModelWidget::configureFadeMenu(void) void ModelWidget::fadeObjects(const vector &objects, bool fade_in) { BaseObjectView *obj_view = nullptr; + Schema *schema = nullptr; for(auto obj : objects) { - if(!BaseGraphicObject::isGraphicObject(obj->getObjectType())) + schema = dynamic_cast(obj); + + if(!BaseGraphicObject::isGraphicObject(obj->getObjectType()) || + (schema && !schema->isRectVisible())) continue; obj_view = dynamic_cast(dynamic_cast(obj)->getReceiverObject()); diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 8046940174..8608f64dfd 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -269,9 +269,13 @@ void ObjectFinderWidget::selectObject(void) if(graph_obj) { BaseObjectView *obj=dynamic_cast(graph_obj->getReceiverObject()); - model_wgt->scene->clearSelection(); - model_wgt->viewport->centerOn(obj); - obj->setSelected(true); + + if(obj) + { + model_wgt->scene->clearSelection(); + model_wgt->viewport->centerOn(obj); + obj->setSelected(true); + } } } //Showing the popup menu for the selected object in the result set From 8bf551a4556bde0ba5905d86a9376097bfc9bce3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 09:40:45 -0300 Subject: [PATCH 090/425] Removing the extra separator in general toolbar at MainWindow --- libpgmodeler_ui/src/mainwindow.h | 2 +- libpgmodeler_ui/ui/mainwindow.ui | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index aee053abc8..65a9d0bb45 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -58,7 +58,7 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { //! \brief Maximum number of files listed on recent models menu const static int MAX_RECENT_MODELS=15; - const static int GENERAL_ACTIONS_COUNT=9; + const static int GENERAL_ACTIONS_COUNT=8; const static int WELCOME_VIEW=0, DESIGN_VIEW=1, diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index d0d5c77891..39aaaaaccd 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -823,7 +823,6 @@ - From d842096aa53f80ddb3b12555a315ef3a3d54ca1c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 10:59:33 -0300 Subject: [PATCH 091/425] Minor adjustments of features on demo version --- libpgmodeler_ui/src/databaseexplorerwidget.cpp | 8 -------- libpgmodeler_ui/src/datamanipulationform.cpp | 8 ++++++++ libpgmodeler_ui/src/mainwindow.cpp | 11 +++++------ libutils/src/globalattributes.cpp | 2 +- main-cli/src/main.cpp | 4 ++-- main-cli/src/pgmodelercli.cpp | 5 ++--- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index f2fab5a24d..e662c12a38 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1913,13 +1913,6 @@ QString DatabaseExplorerWidget::getObjectSource(BaseObject *object, DatabaseMode void DatabaseExplorerWidget::openDataGrid(const QString &schema, const QString &table, bool hide_views) { -#ifdef DEMO_VERSION -#warning "DEMO VERSION: data manipulation feature disabled warning." - Messagebox msg_box; - msg_box.show(trUtf8("Warning"), - trUtf8("You're running a demonstration version! The data manipulation feature is available only in the full version!"), - Messagebox::ALERT_ICON, Messagebox::OK_BUTTON); -#else DataManipulationForm *data_manip=new DataManipulationForm; Connection conn=Connection(this->connection.getConnectionParams()); @@ -1931,7 +1924,6 @@ void DatabaseExplorerWidget::openDataGrid(const QString &schema, const QString & PgModelerUiNS::resizeDialog(data_manip); data_manip->show(); -#endif } void DatabaseExplorerWidget::dropDatabase(void) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index b5515f2c7c..356f4979f8 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -1219,6 +1219,13 @@ void DataManipulationForm::insertRowOnTabPress(int curr_row, int curr_col, int p void DataManipulationForm::saveChanges(void) { +#ifdef DEMO_VERSION +#warning "DEMO VERSION: data manipulation save feature disabled warning." + Messagebox msg_box; + msg_box.show(trUtf8("Warning"), + trUtf8("You're running a demonstration version! The save feature of the data manipulation form is available only in the full version!"), + Messagebox::ALERT_ICON, Messagebox::OK_BUTTON); +#else int row=0; Connection conn=Connection(tmpl_conn_params); @@ -1281,6 +1288,7 @@ void DataManipulationForm::saveChanges(void) .arg(op_names[op_type]).arg(tab_name).arg(row + 1).arg(e.getErrorMessage()), ERR_ROW_DATA_NOT_MANIPULATED,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } +#endif } QString DataManipulationForm::getDMLCommand(int row) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 2d92cc6b92..ad489877b8 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -879,7 +879,6 @@ void MainWindow::addModel(const QString &filename) //Creating the system objects (public schema and languages C, SQL and pgpgsql) model_tab->db_model->createSystemObjects(filename.isEmpty()); - model_tab->db_model->setInvalidated(false); if(!filename.isEmpty()) { @@ -887,11 +886,12 @@ void MainWindow::addModel(const QString &filename) { model_tab->loadModel(filename); models_tbw->setTabToolTip(models_tbw->currentIndex(), filename); + //Get the "public" schema and set as system object public_sch=dynamic_cast(model_tab->db_model->getObject(QString("public"), OBJ_SCHEMA)); if(public_sch) public_sch->setSystemObject(true); - models_tbw->setVisible(true); + model_tab->db_model->setInvalidated(false); model_tab->restoreLastCanvasPosition(); } catch(Exception &e) @@ -913,6 +913,7 @@ void MainWindow::addModel(const QString &filename) model_nav_wgt->addModel(model_tab); models_tbw->setUpdatesEnabled(true); + models_tbw->setVisible(true); setCurrentModel(); if(start_timers) @@ -927,8 +928,6 @@ void MainWindow::addModel(const QString &filename) if(action_alin_objs_grade->isChecked()) current_model->scene->alignObjectsToGrid(); - - models_tbw->update(); } catch(Exception &e) { @@ -1879,8 +1878,8 @@ void MainWindow::showDemoVersionWarning(void) Messagebox msg_box; msg_box.show(trUtf8("Warning"), trUtf8("You're running a demonstration version! Note that you'll be able to create only %1 instances \ - of each type of object and some key features will be disabled or limited!

You can purchase a full binary copy or get the source code at pgmodeler.com.br.\ - NOTE: pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and cover all development costs.

\ + of each type of object and some key features will be disabled or limited!

You can purchase a full binary copy or get the source code at https://pgmodeler.io.\ + NOTE: pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and keep the development alive and at full speed!

\ HINT: in order to test all features it's recommended to use the demo.dbm model located in Sample models at Welcome view.



").arg(GlobalAttributes::MAX_OBJECT_COUNT), Messagebox::ALERT_ICON, Messagebox::OK_BUTTON); #endif diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index db98c9f3e7..725e98a433 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -141,7 +141,7 @@ namespace GlobalAttributes { #ifdef DEMO_VERSION //Maximum object creation counter for demo version - const unsigned MAX_OBJECT_COUNT=9; + const unsigned MAX_OBJECT_COUNT=15; #endif diff --git a/main-cli/src/main.cpp b/main-cli/src/main.cpp index 979f0f809e..ba1d6185ba 100644 --- a/main-cli/src/main.cpp +++ b/main-cli/src/main.cpp @@ -26,8 +26,8 @@ int main(int argc, char **argv) #ifdef DEMO_VERSION out << endl; out << QString("pgModeler ") << GlobalAttributes::PGMODELER_VERSION << QT_TR_NOOP(" command line interface.") << endl; - out << QT_TR_NOOP("PostgreSQL Database Modeler Project - pgmodeler.com.br") << endl; - out << QT_TR_NOOP("Copyright 2006-2015 Raphael A. Silva ") << endl; + out << QT_TR_NOOP("PostgreSQL Database Modeler Project - pgmodeler.io") << endl; + out << QT_TR_NOOP("Copyright 2006-2018 Raphael A. Silva ") << endl; out << QT_TR_NOOP("\n** CLI disabled in demonstration version! **") << endl << endl; #else try diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index a618817666..9b22b109ff 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1370,7 +1370,6 @@ void PgModelerCLI::diffModelDatabase(void) if(!output.open(QFile::WriteOnly)) throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(parsed_opts[OUTPUT]), ERR_FILE_DIR_NOT_WRITTEN, __PRETTY_FUNCTION__,__FILE__,__LINE__); - output.write(diff_hlp.getDiffDefinition().toUtf8()); output.close(); } @@ -1430,8 +1429,8 @@ void PgModelerCLI::diffModelDatabase(void) { printMessage(trUtf8("Applying diff to the database `%1'...").arg(dbname)); export_hlp.setExportToDBMSParams(diff_hlp.getDiffDefinition(), - &extra_connection, - parsed_opts[COMPARE_TO], parsed_opts.count(IGNORE_DUPLICATES)); + &extra_connection, + parsed_opts[COMPARE_TO], parsed_opts.count(IGNORE_DUPLICATES)); if(parsed_opts.count(IGNORE_ERROR_CODES)) export_hlp.setIgnoredErrors(parsed_opts[IGNORE_ERROR_CODES].split(',')); From d654dae6366081ed536789c16b1ef24ac8683ea1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 11:16:42 -0300 Subject: [PATCH 092/425] Removing icons at the top of the dialogs: DatabaseImportForm, MetaDataHandlingForm, ModelDatabaseDiffForm, ModelExportForm, ModelFixForm --- libpgmodeler_ui/ui/databaseimportform.ui | 44 +- libpgmodeler_ui/ui/metadatahandlingform.ui | 70 +-- libpgmodeler_ui/ui/modeldatabasediffform.ui | 52 -- libpgmodeler_ui/ui/modelexportform.ui | 55 -- libpgmodeler_ui/ui/modelfixform.ui | 578 +++++++++----------- 5 files changed, 257 insertions(+), 542 deletions(-) diff --git a/libpgmodeler_ui/ui/databaseimportform.ui b/libpgmodeler_ui/ui/databaseimportform.ui index 39235995fe..75f29d0f17 100644 --- a/libpgmodeler_ui/ui/databaseimportform.ui +++ b/libpgmodeler_ui/ui/databaseimportform.ui @@ -81,49 +81,7 @@ 4 - - - - - 0 - 0 - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/icones/icones/import.png - - - - - - - - 13 - 75 - true - - - - Import database - - - - + diff --git a/libpgmodeler_ui/ui/metadatahandlingform.ui b/libpgmodeler_ui/ui/metadatahandlingform.ui index 56cf539196..d866525fc4 100644 --- a/libpgmodeler_ui/ui/metadatahandlingform.ui +++ b/libpgmodeler_ui/ui/metadatahandlingform.ui @@ -7,7 +7,7 @@ 0 0 727 - 661 + 609 @@ -173,52 +173,6 @@ 4 - - - - - - 0 - 0 - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/icones/icones/objmetadata.png - - - - - - - - 13 - 75 - true - - - - Handle objects metadata - - - - - - @@ -1405,28 +1359,6 @@ - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - -
diff --git a/libpgmodeler_ui/ui/modeldatabasediffform.ui b/libpgmodeler_ui/ui/modeldatabasediffform.ui index 4fccfe761c..c1eb3868f0 100644 --- a/libpgmodeler_ui/ui/modeldatabasediffform.ui +++ b/libpgmodeler_ui/ui/modeldatabasediffform.ui @@ -85,58 +85,6 @@ 4 - - - - - - 0 - 0 - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/icones/icones/diff.png - - - - - - - - 0 - 0 - - - - - 13 - 75 - true - - - - Generate diff code - - - - - - diff --git a/libpgmodeler_ui/ui/modelexportform.ui b/libpgmodeler_ui/ui/modelexportform.ui index e0003788ae..d8582f2f9f 100644 --- a/libpgmodeler_ui/ui/modelexportform.ui +++ b/libpgmodeler_ui/ui/modelexportform.ui @@ -82,61 +82,6 @@ 4 - - - 2 - - - - - - 0 - 0 - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/icones/icones/exportar.png - - - - - - - - 0 - 0 - - - - - 13 - 75 - true - - - - Export model - - - - - - diff --git a/libpgmodeler_ui/ui/modelfixform.ui b/libpgmodeler_ui/ui/modelfixform.ui index 7a25ee3773..7619e432ea 100644 --- a/libpgmodeler_ui/ui/modelfixform.ui +++ b/libpgmodeler_ui/ui/modelfixform.ui @@ -81,160 +81,8 @@ 4 - - - - - - - 0 - 0 - - - - - 32 - 32 - - - - - 32 - 32 - - - - - - - :/icones/icones/fixobject.png - - - - - - - - 13 - 75 - true - - - - Fix model file - - - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - - 0 - 0 - - - - - 0 - 48 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - 24 - 24 - - - - - 24 - 24 - - - - - - - Qt::AutoText - - - :/icones/icones/msgbox_alerta.png - - - true - - - - - - - - 50 - false - false - false - false - true - - - - <html><head/><body><p>[pgmodeler-cli not found error]</p></body></html> - - - true - - - - - - - - + + 0 @@ -242,126 +90,41 @@ - pgmodeler-cli: + Input file: - - - - 0 - - - - - - - - true - - - Browse for pgmodeler-cli tool - - - ... - - - - :/icones/icones/abrir.png:/icones/icones/abrir.png + + + + + + 1 - - - 22 - 22 - + + 100 - - - - - - - - - 170 - 0 - 0 - - - - - - - - - 170 - 0 - 0 - - - - - - - - - 128 - 128 - 128 - - - - - - - - - false - + + + + + 0 + 0 + - The specified file is not the pgModeler command line tool (pgmodeler-cli). + Load fixed model when finish + + + true - - - - - 0 - 0 - - - - Input file: - - - - - - - - 0 - 0 - - - - Output file: - - - - - - - Fix tries: - - - - + @@ -475,7 +238,7 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:10pt; font-weight:400; font-style:normal;"> +</style></head><body style=" font-family:'Monospace'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Waiting process to start...</span></p></body></html> @@ -486,38 +249,8 @@ p, li { white-space: pre-wrap; } - - - - - - - - - true - - - Select input file - - - ... - - - - :/icones/icones/abrir.png:/icones/icones/abrir.png - - - - 22 - 22 - - - - - - - - + + @@ -546,37 +279,91 @@ p, li { white-space: pre-wrap; } - - - - - - 1 - - - 100 - - - - - - - - 0 - 0 - - - - Load fixed model when finish - - - true - - - - + + + + + 0 + 0 + + + + + 0 + 48 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + 24 + 24 + + + + + 24 + 24 + + + + + + + Qt::AutoText + + + :/icones/icones/msgbox_alerta.png + + + true + + + + + + + + 50 + false + false + false + false + true + + + + <html><head/><body><p>[pgmodeler-cli not found error]</p></body></html> + + + true + + + + + - + @@ -666,6 +453,151 @@ p, li { white-space: pre-wrap; } + + + + + 0 + 0 + + + + pgmodeler-cli: + + + + + + + 0 + + + + + + + + true + + + Browse for pgmodeler-cli tool + + + ... + + + + :/icones/icones/abrir.png:/icones/icones/abrir.png + + + + 22 + 22 + + + + + + + + + + + + + 170 + 0 + 0 + + + + + + + + + 170 + 0 + 0 + + + + + + + + + 128 + 128 + 128 + + + + + + + + + false + + + + The specified file is not the pgModeler command line tool (pgmodeler-cli). + + + + + + + + + + 0 + 0 + + + + Output file: + + + + + + + Fix tries: + + + + + + + + + + + + true + + + Select input file + + + ... + + + + :/icones/icones/abrir.png:/icones/icones/abrir.png + + + + 22 + 22 + + + + + + From 7bf2342836a3d6272368a390709e90b3427acdcb Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 15:21:49 -0300 Subject: [PATCH 093/425] Some adjustments done in the dialog size save feature in order to store the maximized state of the dialogs. --- conf/dtd/pgmodeler.dtd | 1 + conf/schemas/widget.sch | 9 +- libparsers/src/parsersattributes.cpp | 1 + libparsers/src/parsersattributes.h | 1 + libpgmodeler_ui/src/generalconfigwidget.cpp | 55 +++++++++--- libpgmodeler_ui/src/generalconfigwidget.h | 15 +++- libpgmodeler_ui/src/mainwindow.cpp | 6 ++ libpgmodeler_ui/ui/generalconfigwidget.ui | 98 +++++++++++++++++++-- main/src/main.cpp | 2 +- 9 files changed, 165 insertions(+), 23 deletions(-) diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd index c874136128..3f1b0ead91 100644 --- a/conf/dtd/pgmodeler.dtd +++ b/conf/dtd/pgmodeler.dtd @@ -72,6 +72,7 @@ + diff --git a/conf/schemas/widget.sch b/conf/schemas/widget.sch index b8f82bc85e..a76f05a063 100644 --- a/conf/schemas/widget.sch +++ b/conf/schemas/widget.sch @@ -25,8 +25,13 @@ $tb [ GeneralConfigWidget::config_params; -map GeneralConfigWidget::widgets_geom; +map GeneralConfigWidget::widgets_geom; GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { @@ -89,6 +89,8 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa connect(font_preview_txt, SIGNAL(cursorPositionChanged()), this, SLOT(updateFontPreview())); connect(select_editor_btn, SIGNAL(clicked(bool)), this, SLOT(selectSourceEditor())); + connect(save_restore_geometry_chk, SIGNAL(toggled(bool)), reset_sizes_tb, SLOT(setEnabled(bool))); + connect(reset_sizes_tb, SIGNAL(clicked(bool)), this, SLOT(resetDialogsSizes())); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::GRID_SIZE]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]=QString(); @@ -331,6 +333,7 @@ void GeneralConfigWidget::loadConfiguration(void) source_editor_args_edt->setText(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_ARGS]); save_restore_geometry_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]==ParsersAttributes::_TRUE_); + reset_sizes_tb->setEnabled(save_restore_geometry_chk->isChecked()); int ui_idx = ui_language_cmb->findData(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]); ui_language_cmb->setCurrentIndex(ui_idx >= 0 ? ui_idx : 0); @@ -341,13 +344,14 @@ void GeneralConfigWidget::loadConfiguration(void) widgets_geom.clear(); for(auto itr : config_params) { - if(itr.second.count(ParsersAttributes::WIDTH)) + if(itr.second.count(ParsersAttributes::X_POS)) { x = itr.second[ParsersAttributes::X_POS].toInt(); y = itr.second[ParsersAttributes::Y_POS].toInt(); w = itr.second[ParsersAttributes::WIDTH].toInt(); h = itr.second[ParsersAttributes::HEIGHT].toInt(); - widgets_geom[itr.first] = QRect(QPoint(x,y), QSize(w, h)); + widgets_geom[itr.first].geometry = QRect(QPoint(x,y), QSize(w, h)); + widgets_geom[itr.first].maximized = itr.second[ParsersAttributes::MAXIMIZED] == ParsersAttributes::_TRUE_; } } @@ -406,20 +410,36 @@ void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &cus return; QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; - widgets_geom[dlg_name.toLower()] = widget->geometry(); + + widgets_geom[dlg_name.toLower()].geometry = widget->geometry(); + widgets_geom[dlg_name.toLower()].maximized = widget->isMaximized(); } -void GeneralConfigWidget::restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) +bool GeneralConfigWidget::restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { if(!widget || config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) - return; + return(false); QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; dlg_name = dlg_name.toLower(); - if(widgets_geom.count(dlg_name) && widgets_geom[dlg_name].width() > 0 && widgets_geom[dlg_name].height() > 0) - widget->setGeometry(widgets_geom[dlg_name]); + if(widgets_geom.count(dlg_name) && + (widgets_geom[dlg_name].maximized || + (widgets_geom[dlg_name].geometry.width() > 0 && widgets_geom[dlg_name].geometry.height() > 0))) + { + if(widgets_geom[dlg_name].maximized) + { + widget->move(widgets_geom[dlg_name].geometry.topLeft()); + widget->setWindowState(Qt::WindowMaximized); + } + else + widget->setGeometry(widgets_geom[dlg_name].geometry); + + return(true); + } + + return(false); } void GeneralConfigWidget::saveConfiguration(void) @@ -548,10 +568,11 @@ void GeneralConfigWidget::saveConfiguration(void) for(auto &itr : widgets_geom) { attribs[ParsersAttributes::ID] = itr.first; - attribs[ParsersAttributes::X_POS] = QString::number(itr.second.left()); - attribs[ParsersAttributes::Y_POS] = QString::number(itr.second.top()); - attribs[ParsersAttributes::WIDTH] = QString::number(itr.second.width()); - attribs[ParsersAttributes::HEIGHT] = QString::number(itr.second.height()); + attribs[ParsersAttributes::X_POS] = QString::number(itr.second.geometry.left()); + attribs[ParsersAttributes::Y_POS] = QString::number(itr.second.geometry.top()); + attribs[ParsersAttributes::WIDTH] = QString::number(itr.second.geometry.width()); + attribs[ParsersAttributes::HEIGHT] = QString::number(itr.second.geometry.height()); + attribs[ParsersAttributes::MAXIMIZED] = itr.second.maximized ? ParsersAttributes::_TRUE_ : QString(); schparser.ignoreUnkownAttributes(true); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGETS_GEOMETRY]+= @@ -709,3 +730,13 @@ void GeneralConfigWidget::selectSourceEditor(void) if(sel_editor_dlg.result()==QDialog::Accepted) source_editor_edt->setText(sel_editor_dlg.selectedFiles().at(0)); } + +void GeneralConfigWidget::resetDialogsSizes(void) +{ + Messagebox msg_box; + msg_box.show(trUtf8("This action will reset all dialogs to their default size and positions on the screen! Do you really want to proceed?"), + Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + + if(msg_box.result() == QDialog::Accepted) + widgets_geom.clear(); +} diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index 4aae4b4704..4d888cd892 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -36,11 +36,21 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg private: Q_OBJECT + /* This simple struct is used to store the widgets geometry and maximized state + * in order to save this info to configuration file being possible to restore + * it when reloading the application */ + struct WidgetState + { + QRect geometry; + bool maximized; + WidgetState() { maximized = false; } + }; + QWidgetList child_wgts; NumberedTextEditor *font_preview_txt; - static map widgets_geom; + static map widgets_geom; static map config_params; @@ -72,7 +82,7 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg static QString getConfigurationParam(const QString §ion_id, const QString ¶m_name); static void saveWidgetGeometry(QWidget *widget, const QString &custom_wgt_name = QString()); - static void restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name = QString()); + static bool restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name = QString()); public slots: void applyConfiguration(void); @@ -83,6 +93,7 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg private slots: void convertMarginUnity(void); void updateFontPreview(void); + void resetDialogsSizes(void); }; #endif diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index ad489877b8..dbba31fce8 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -426,6 +426,10 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par action_update_found->setVisible(false); QTimer::singleShot(1000, this, SLOT(restoreTemporaryModels())); + //If there's no previuos geometry registered for the mainwindow display it maximized + if(!GeneralConfigWidget::restoreWidgetGeometry(this)) + this->setWindowState(Qt::WindowMaximized); + #ifdef NO_UPDATE_CHECK #warning "NO UPDATE CHECK: Update checking is disabled." #else @@ -594,6 +598,8 @@ void MainWindow::closeEvent(QCloseEvent *event) GeneralConfigWidget *conf_wgt=nullptr; map confs; + GeneralConfigWidget::saveWidgetGeometry(this); + //Stops the saving timers as well the temp. model saving thread before close pgmodeler model_save_timer.stop(); tmpmodel_save_timer.stop(); diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 83c7cb3ad0..8d4354bfd3 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -1227,9 +1227,12 @@ Qt::Horizontal + + QSizePolicy::Fixed + - 40 + 100 20 @@ -1334,11 +1337,94 @@ - - - Save/restore the dialogs dimensions - - + + + + + Save/restore dialogs sizes + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 25 + 20 + + + + + + + + false + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + Reset the dialogs sizes and positions to their default values. + + + Reset sizes + + + + :/icones/icones/atualizar.png:/icones/icones/atualizar.png + + + + 22 + 22 + + + + Qt::ToolButtonTextBesideIcon + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 100 + 20 + + + + + diff --git a/main/src/main.cpp b/main/src/main.cpp index 8c29ccaaa6..357531bbe2 100644 --- a/main/src/main.cpp +++ b/main/src/main.cpp @@ -139,7 +139,7 @@ int main(int argc, char **argv) fmain.loadModels(params); #endif - fmain.showMaximized(); + fmain.show(); splash.finish(&fmain); res=app.exec(); app.closeAllWindows(); From a36ad60127c4421caeafc397ec1c242b9ff0fb84 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 15:56:10 -0300 Subject: [PATCH 094/425] Minor adjustment in NewObjectOverlayWidget --- libpgmodeler_ui/ui/newobjectoverlaywidget.ui | 90 ++++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui index df8a6ecaf3..e5715488b2 100644 --- a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui +++ b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui @@ -7,7 +7,7 @@ 0 0 426 - 911 + 840 @@ -567,6 +567,50 @@ + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Permissions + + + + :/icones/icones/permission.png:/icones/icones/permission.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + @@ -1143,50 +1187,6 @@ - - - - - 0 - 0 - - - - - 95 - 50 - - - - - 50 - false - - - - Qt::NoFocus - - - Permissions - - - - :/icones/icones/permission.png:/icones/icones/permission.png - - - - 32 - 32 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextUnderIcon - - - From a5eaa3a4c8d29ab85c4b1b5e4aa1f60c5383f474 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 16:14:23 -0300 Subject: [PATCH 095/425] Updates on CHANGELOG.md and RELEASENOTES.md for 0.9.2-alpha --- CHANGELOG.md | 15 ++++++++++++++- RELEASENOTES.md | 7 +++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aeb89a0fc..b97efa6743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,9 +3,10 @@ Change Log v0.9.2-alpha ------ -Release date: August 17, 2018
+Release date: August 20, 2018
* [New] Added the support to cancelling SQL execution in SQLExecutionWidget. +* [New] Added support to save/restore the dialogs sizes and positions. * [New] Added support to truncate tables in DataManipulationForm. * [New] Added support to aliases on some graphical objects that is used in the compact view mode. * [New] Added support to save/load object's metadata containing aliases information. @@ -21,6 +22,18 @@ v0.9.2-alpha * [Change] Minor adjustment on constraints rendering at extended attributes section of tables. * [Change] French translation update. * [Change] Updated the other lang dictionaries with the new text brought by new releases. +* [Change] Removing icons at the top of the dialogs: DatabaseImportForm, MetaDataHandlingForm, ModelDatabaseDiffForm, ModelExportForm, ModelFixForm. +* [Change] Minor adjustments in the features of the demo version. +* [Change] Minor adjustments in the UI stylesheet. +* [Change] In DatabaseExplorerWidget the root item will come automatically selcted when browsing a database. +* [Change] Minor performance tuning when handling big models. +* [Change] Added some statistics attributes for tables on DatabaseExplorerWidget. +* [Change] Minor adjustment in NewObjectOverlayWidget by putting the tool buttons under categories. +* [Fix] Fixed a bug in ObjectFinderWidget that was forcing schemas rectangles to appear even if the flag indicating them to be visible was set to false. +* [Fix] Fixed the editing form cancel operation. Now operations done when the form was active are undone correctly. +* [Fix] Fixed a bug that was preventing to create a view containing the same name as a table but in different schema. +* [Fix] Fixed a regression that caused notices not to be shown in the output panel at SQLExecutionWidget. +* [Fix] Fixed the query catalog for policies which was causing syntax error when combining import system objects and extension objects options. * [Fix] Fixed the disabling of some actions related to design when switching to manage view. * [Fix] Minor fix on stylesheet in order to display the extended button on general toolbar. * [Fix] Fix a shortcut conflict in DataManipulationform. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0f447557e7..0563e2773d 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,20 +1,23 @@ v0.9.2-alpha ------ -Release date: August 17, 2018
+Release date: August 20, 2018
Changes since: v0.9.1
Summary: this release does not have an extensive change log but brings some long desired features as well important fixes. The first feature to talk about is the long awaited SQL execution cancelling which enables the user to abort the execution of any command issued to the server in the SQL execution field (Manage view) without the need to kill the application in order to interrupt the running SQL (like on previous releases).
Another feature introduced is the compact view of the model. This one makes the tables and views smaller by hiding the columns' data types and other informations. This feature came as a support to those developers who need to present their models to an audience without database specific knowledge. The trick here is to replace the original names of graphical objects by more friendly ones so the audience can understand the essence of the model being worked without worry about the tech details.
-More features were implemented in this release too being them: the support to sequence options on indentity columns, the support to bulk data edition on data manipulation dialog, the support to paste CSV text from clipboard into the dialog where initial data can be specified for tables (in design view) and some other.
+Also I decided to include a functionality to save and restore the majority of dialogs sizes and their positions, another long requested feature. This one can be useful for those who don't want pgModeler to resize the forms automatically everytime (specially when working in high resolution screens or dual monitors environments). This feature comes activated by default on new installations and can be deactivated at general settings.
+ +More features were implemented in this release too, being some of them: the support to sequence options on indentity columns, the support to bulk data edition on data manipulation dialog, the support to paste CSV text from clipboard into the dialog where initial data can be specified for tables (in design view) and some other.
One important change done was a partial refactoring of the View editing form by moving the fields related to view's references to a dedicated dialog making the whole form a bit less complicated to use. I have plans to keep improving that dialog in special but in future releases a full UX/UI remodeling will be done in the application.
Below some of the changes of this release, for the complete list of changes, please, take a look into the CHANGELOG.md.
* [New] Added the support to cancelling SQL execution in SQLExecutionWidget. +* [New] Added support to save/restore the dialogs sizes and positions. * [New] Added support to truncate tables in DataManipulationForm. * [New] Added support to aliases on some graphical objects to be is used in the compact view mode. * [New] Added support to save/load object's metadata containing aliases information. From bb39bde21c17dfaeb90f6eed542146a8c7d57867 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 20:02:58 -0300 Subject: [PATCH 096/425] Minor adjustments on the item delegates to draw text in the right alignment --- libpgmodeler_ui/src/codecompletionwidget.cpp | 2 +- libpgmodeler_ui/src/htmlitemdelegate.cpp | 5 +++-- libpgmodeler_ui/src/modelvalidationwidget.cpp | 4 ---- libpgmodeler_ui/src/pgmodeleruins.cpp | 11 +++++++++++ libpgmodeler_ui/src/sqlexecutionwidget.cpp | 4 ++-- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 7886790947..4fc5228a55 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -49,7 +49,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool vbox->setSpacing(6); completion_wgt->setLayout(vbox); - PgModelerUiNS::configureWidgetFont(name_list, PgModelerUiNS::SMALL_FONT_FACTOR); + PgModelerUiNS::configureWidgetFont(name_list, PgModelerUiNS::SMALL_FONT_FACTOR); this->code_field_txt=code_field_txt; auto_triggered=false; diff --git a/libpgmodeler_ui/src/htmlitemdelegate.cpp b/libpgmodeler_ui/src/htmlitemdelegate.cpp index 7374ab0063..1a196bec24 100644 --- a/libpgmodeler_ui/src/htmlitemdelegate.cpp +++ b/libpgmodeler_ui/src/htmlitemdelegate.cpp @@ -45,7 +45,7 @@ void HtmlItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti text.replace(QString("\n"), QString("
")); rect=QRect(QPoint(option.rect.left() + option.decorationSize.width() + 5, - option.rect.top()), option.rect.size()); + option.rect.top()), option.rect.size()); //Painting the correct background color according to the item state if((option.state & QStyle::State_Selected) == QStyle::State_Selected) @@ -63,7 +63,8 @@ void HtmlItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti //Set the text to a html document instance and draw it to the painter doc.setHtml(text); - painter->translate(rect.topLeft()); + int dy = abs(option.rect.height() - option.decorationSize.height()) / 2; + painter->translate(rect.topLeft() - QPoint(0, dy)); doc.drawContents(painter); } diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 68b6876b69..15f4faf45c 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -284,7 +284,6 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) val_info.getValidationType()==ValidationInfo::VALIDATION_ABORTED) { QStringList errors=val_info.getErrors(); - QFont fnt; item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); validation_prog_pb->setValue(validation_prog_pb->maximum()); reenableValidation(); @@ -299,9 +298,6 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) label1->setTextInteractionFlags(Qt::TextSelectableByMouse); label1->setText(errors.back()); label1->setTextInteractionFlags(Qt::TextSelectableByMouse); - fnt=label1->font(); - fnt.setPointSizeF(8.0f); - label1->setFont(fnt); output_trw->setItemWidget(item1, 0, label1); errors.pop_back(); } diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index ba14253b80..036301a402 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -42,10 +42,12 @@ namespace PgModelerUiNS { else { QLabel *label=new QLabel; + label->setUpdatesEnabled(false); label->setTextFormat(Qt::AutoText); label->setText(text); label->setWordWrap(true); label->setTextInteractionFlags(Qt::TextSelectableByMouse); + label->setUpdatesEnabled(true); label->setMinimumHeight(output_trw->iconSize().height() * 1.5); label->setMaximumHeight(label->heightForWidth(label->width())); output_trw->setItemWidget(item, 0, label); @@ -65,6 +67,7 @@ namespace PgModelerUiNS { throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); QListWidgetItem *item=new QListWidgetItem; + item->setIcon(ico); output_lst->addItem(item); @@ -73,6 +76,14 @@ namespace PgModelerUiNS { else { QLabel *label=new QLabel(text); + int txt_height = 0; + + txt_height = output_lst->fontMetrics().height() * text.count(QString("
")); + + if(txt_height == 0) + txt_height = output_lst->fontMetrics().height(); + + item->setSizeHint(QSize(output_lst->width(), txt_height)); output_lst->setItemWidget(item, label); } } diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 760d7360bf..affb325e0f 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -406,8 +406,8 @@ void SQLExecutionWidget::finishExecution(int rows_affected) for(QString notice : sql_exec_hlp.getNotices()) { PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(QString("[%1]: %2").arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))).arg(notice)), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + QString("[%1]: %2").arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))).arg(notice.trimmed()), + QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), false); } PgModelerUiNS::createOutputListItem(msgoutput_lst, From de047d6e466fcf11ff1ced0d85a3d6288706ef84 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 20:05:21 -0300 Subject: [PATCH 097/425] Adjusted the font size of code completion widget --- libpgmodeler_ui/src/codecompletionwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 4fc5228a55..78c93b338b 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -49,7 +49,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool vbox->setSpacing(6); completion_wgt->setLayout(vbox); - PgModelerUiNS::configureWidgetFont(name_list, PgModelerUiNS::SMALL_FONT_FACTOR); + PgModelerUiNS::configureWidgetFont(name_list, PgModelerUiNS::MEDIUM_FONT_FACTOR); this->code_field_txt=code_field_txt; auto_triggered=false; From 4277e8f11baf55f8f616eec3fda1cfa8bfb980bd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 20:19:50 -0300 Subject: [PATCH 098/425] Update on CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b97efa6743..1b9b3e8957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ v0.9.2-alpha * [New] Added support to sequence options for identity columns. * [New] Added the ability to paste CSV text from clipboard into the TableDataWidget. * [New] Added support to bulk data edit in TableDataWidget. +* [Change] Minor adjustments on the item delegates in order draw text in the right alignment. * [Change] Minor adjustment on buttons style in DatabaseExplorerWidget, DataManipulationForm and SQLExecutionWidget. * [Change] Minor adjustment on OperationList::removeFromPool to avoid throw an exception when an invalid index is passed. * [Change] Changed the behaviour of the fade in/out of relationships linked to a table by applying the effect on the other tables that are related to the selected one. From cb1f9c7c0c958dd0fb4cbaba1c10eb1dfdcbe794 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 Aug 2018 21:35:53 -0300 Subject: [PATCH 099/425] Minor fix on linuxdeploy.sh to use the most recent Qt IFW Improved the pgmodeler.vars in order to locate Qt's libs and paths by using the qtpaths application --- linuxdeploy.sh | 2 +- pgmodeler.vars | 33 +++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/linuxdeploy.sh b/linuxdeploy.sh index 69ca39393e..b984b7c9d7 100755 --- a/linuxdeploy.sh +++ b/linuxdeploy.sh @@ -24,7 +24,7 @@ QMAKE_ARGS="-r -spec linux-g++" QMAKE_ROOT=/usr/bin QMAKE_CMD=qmake LOG="$PWD/linuxdeploy.log" -QT_IFW_ROOT=/opt/qt-ifw-1.5.0 +QT_IFW_ROOT=/opt/qt-ifw-3.0.4 STARTUP_SCRIPT="start-pgmodeler.sh" MIME_UPDATE_SCRIPT="dbm-mime-type.sh" diff --git a/pgmodeler.vars b/pgmodeler.vars index 96c558bdfa..7a7fbdddce 100644 --- a/pgmodeler.vars +++ b/pgmodeler.vars @@ -9,19 +9,36 @@ # In both cases above you will need to set the PGMODELER_ROOT variable with # the full path to pgModeler root directory. -# Specify here the full path to Qt framework installation in QT_ROOT -# The path used here must be until the "gcc" directory. For instance, if you have -# Qt 5.1.1 installed on your home directory then the path must be: /home/user/Qt5.1.1/5.1.1/gcc + +# ---[ Custom Qt configuration ]--- +# +# This section specifies some environment vars responsible to find Qt framework installation in your system. +# Make sure to have the command "qtpaths" correctly mapped into your PATH environment variable or use the +# QT_PATHS_BIN variable below to specify the mentioned command. # -# NOTE: Use this configuration only if you have a custom Qt installation other than as defined by +# If you have a custom Qt installation at /opt/qt-5.9.6 for example, the path to the command above should be +# /opt/qt-5.9.6/5.9.6/gcc_64 +# +# NOTE: Use the configuration below only if you have a custom Qt installation other than as defined by # your system or if Qt isn't included/installed by default on your distro. -# export QT_ROOT="/path/to/qt/gcc" -# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$QT_ROOT/lib" -# export PATH=$PATH:"$QT_ROOT/bin" + +# Replace the value of this variable by the full path to "qtpaths" if you have a custom Qt installation +# export QT_PATHS_BIN=qtpaths + +# Qt's main environment variables +# export QT_ROOT="$($QT_PATHS_BIN --install-prefix)" +# export QT_BIN="$($QT_PATHS_BIN --binaries-dir)" +# export QT_PLUGIN_PATH="$($QT_PATHS_BIN --plugin-dir)" + +# Change the "lib64" by "lib" if you're running a 32 bit system +# export QT_LIBS="$QT_ROOT/lib64" + +# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$QT_LIBS" +# export PATH=$PATH:"$QT_BIN" +# --- [ End custom configuration ] --- # Specify here the full path to the pgmodeler's root directory -# export PGMODELER_ROOT="/path/to/pgmodeler" export PGMODELER_ROOT="$(dirname "$(readlink -f "$0")")" export PGMODELER_TMPL_CONF_DIR="$PGMODELER_ROOT/conf" From 214c4225b7fb45f9a0cfbb0a56deb6ec8ab0c064 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 18 Aug 2018 09:24:42 -0300 Subject: [PATCH 100/425] Avoiding trying to request execution cancel when the connection is still not stablished in SQLExecutionHelper --- libpgmodeler_ui/src/sqlexecutionhelper.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.cpp b/libpgmodeler_ui/src/sqlexecutionhelper.cpp index 51f261bb49..8a3221624c 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.cpp +++ b/libpgmodeler_ui/src/sqlexecutionhelper.cpp @@ -63,15 +63,15 @@ void SQLExecutionHelper::executeCommand(void) if(!connection.isStablished()) { - connection.setNoticeEnabled(true); - connection.connect(); + connection.setNoticeEnabled(true); + connection.connect(); //The connection will break the execution if it keeps idle for one hour or more connection.setSQLExecutionTimout(3600); } connection.executeDMLCommand(command, res); - notices = connection.getNotices(); + notices = connection.getNotices(); if(!res.isEmpty()) result_model = new ResultSetModel(res, catalog); @@ -87,6 +87,9 @@ void SQLExecutionHelper::executeCommand(void) void SQLExecutionHelper::cancelCommand(void) { - connection.requestCancel(); - cancelled = true; + if(connection.isStablished()) + { + connection.requestCancel(); + cancelled = true; + } } From b82e340cfc2795e5a93f1aa293a56c4c0d704ccc Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 18 Aug 2018 17:18:26 -0300 Subject: [PATCH 101/425] Adding missing routines to save/restore sizes of PermissionWidget, SequenceWidget (when handling sequence options at ColumnWidget), TableDataWidget and CustomSQLWidget --- libpgmodeler_ui/src/baseobjectwidget.cpp | 13 ++++-- libpgmodeler_ui/src/columnwidget.cpp | 3 ++ libpgmodeler_ui/src/generalconfigwidget.cpp | 48 ++++++++++----------- libpgmodeler_ui/src/modelwidget.cpp | 6 +-- libpgmodeler_ui/src/tablewidget.cpp | 4 ++ 5 files changed, 44 insertions(+), 30 deletions(-) diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index e44b37d09c..69af6dd646 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -20,6 +20,7 @@ #include "permissionwidget.h" #include "customsqlwidget.h" #include "baseform.h" +#include "generalconfigwidget.h" const QColor BaseObjectWidget::PROT_LINE_BGCOLOR=QColor(255,180,180); const QColor BaseObjectWidget::PROT_LINE_FGCOLOR=QColor(80,80,80); @@ -665,17 +666,23 @@ void BaseObjectWidget::editPermissions(void) permission_wgt->setAttributes(this->model, parent_obj, this->object); parent_form.setMainWidget(permission_wgt); parent_form.setButtonConfiguration(Messagebox::OK_BUTTON); + + GeneralConfigWidget::restoreWidgetGeometry(&parent_form, permission_wgt->metaObject()->className()); parent_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&parent_form, permission_wgt->metaObject()->className()); } void BaseObjectWidget::editCustomSQL(void) { BaseForm parent_form(this); - CustomSQLWidget *customsql_wgt=new CustomSQLWidget; + CustomSQLWidget *customsql_wgt=new CustomSQLWidget; + + customsql_wgt->setAttributes(this->model, this->object); + parent_form.setMainWidget(customsql_wgt); - customsql_wgt->setAttributes(this->model, this->object); - parent_form.setMainWidget(customsql_wgt); + GeneralConfigWidget::restoreWidgetGeometry(&parent_form, customsql_wgt->metaObject()->className()); parent_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&parent_form, customsql_wgt->metaObject()->className()); } void BaseObjectWidget::applyConfiguration(void) diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 74746f0b64..f2eca51012 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -19,6 +19,7 @@ #include "columnwidget.h" #include "sequencewidget.h" #include "baseform.h" +#include "generalconfigwidget.h" ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN) { @@ -159,7 +160,9 @@ void ColumnWidget::editSequenceAttributes(void) seq_wgt->setAttributesReadonly(this->model, nullptr, nullptr, &ident_col_seq, col); editing_form.setMainWidget(seq_wgt); + GeneralConfigWidget::restoreWidgetGeometry(&editing_form, seq_wgt->metaObject()->className()); editing_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&editing_form, seq_wgt->metaObject()->className()); } void ColumnWidget::applyConfiguration(void) diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 6f6b06584d..885b931a94 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -405,41 +405,41 @@ QString GeneralConfigWidget::getConfigurationParam(const QString §ion_id, co void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { - if(!widget || - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) - return; + if(!widget || + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) + return; - QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; + QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; - widgets_geom[dlg_name.toLower()].geometry = widget->geometry(); - widgets_geom[dlg_name.toLower()].maximized = widget->isMaximized(); + widgets_geom[dlg_name.toLower()].geometry = widget->geometry(); + widgets_geom[dlg_name.toLower()].maximized = widget->isMaximized(); } bool GeneralConfigWidget::restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { - if(!widget || - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) - return(false); + if(!widget || + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) + return(false); - QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; - dlg_name = dlg_name.toLower(); + QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; + dlg_name = dlg_name.toLower(); - if(widgets_geom.count(dlg_name) && - (widgets_geom[dlg_name].maximized || - (widgets_geom[dlg_name].geometry.width() > 0 && widgets_geom[dlg_name].geometry.height() > 0))) - { - if(widgets_geom[dlg_name].maximized) + if(widgets_geom.count(dlg_name) && + (widgets_geom[dlg_name].maximized || + (widgets_geom[dlg_name].geometry.width() > 0 && widgets_geom[dlg_name].geometry.height() > 0))) { - widget->move(widgets_geom[dlg_name].geometry.topLeft()); - widget->setWindowState(Qt::WindowMaximized); - } - else - widget->setGeometry(widgets_geom[dlg_name].geometry); + if(widgets_geom[dlg_name].maximized) + { + widget->move(widgets_geom[dlg_name].geometry.topLeft()); + widget->setWindowState(Qt::WindowMaximized); + } + else + widget->setGeometry(widgets_geom[dlg_name].geometry); - return(true); - } + return(true); + } - return(false); + return(false); } void GeneralConfigWidget::saveConfiguration(void) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index b1864b7cae..c959ab3bdd 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1604,7 +1604,7 @@ int ModelWidget::openEditingForm(QWidget *widget, unsigned button_conf) { BaseForm editing_form(this); BaseObjectWidget *base_obj_wgt=qobject_cast(widget); - int res = 0; + int res = 0; if(base_obj_wgt) editing_form.setMainWidget(base_obj_wgt); @@ -1614,10 +1614,10 @@ int ModelWidget::openEditingForm(QWidget *widget, unsigned button_conf) editing_form.setButtonConfiguration(button_conf); GeneralConfigWidget::restoreWidgetGeometry(&editing_form, widget->metaObject()->className()); - res = editing_form.exec(); + res = editing_form.exec(); GeneralConfigWidget::saveWidgetGeometry(&editing_form, widget->metaObject()->className()); - return(res); + return(res); } template diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 6cec366e9a..13aa4ca987 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -25,6 +25,7 @@ #include "baseform.h" #include "tabledatawidget.h" #include "policywidget.h" +#include "generalconfigwidget.h" TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) { @@ -724,7 +725,10 @@ void TableWidget::editData(void) tab_data_wgt->setAttributes(this->model, dynamic_cast
(this->object)); base_form.setMainWidget(tab_data_wgt); base_form.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + + GeneralConfigWidget::restoreWidgetGeometry(&base_form, tab_data_wgt->metaObject()->className()); base_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&base_form, tab_data_wgt->metaObject()->className()); } void TableWidget::applyConfiguration(void) From 63c241a489048cc2dbc5f218d21201b545371aa7 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 18 Aug 2018 17:52:16 -0300 Subject: [PATCH 102/425] Adding missing options to CopyOptions class related to copy relationship attributes. --- conf/defaults/sql-highlight.conf | 1 + conf/sql-highlight.conf | 1 + libpgmodeler/src/copyoptions.cpp | 7 +++-- libpgmodeler/src/copyoptions.h | 8 +++--- libpgmodeler/src/relationship.cpp | 2 +- libpgmodeler_ui/src/relationshipwidget.cpp | 31 +++++++++++++++++----- libpgmodeler_ui/ui/relationshipwidget.ui | 22 ++++++++++++++- 7 files changed, 59 insertions(+), 13 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index ebf49fd513..076b77692d 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -337,6 +337,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index ebf49fd513..076b77692d 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -337,6 +337,7 @@ + diff --git a/libpgmodeler/src/copyoptions.cpp b/libpgmodeler/src/copyoptions.cpp index cfb06271ac..b416c532a9 100644 --- a/libpgmodeler/src/copyoptions.cpp +++ b/libpgmodeler/src/copyoptions.cpp @@ -17,6 +17,7 @@ */ #include "copyoptions.h" +#include "baseobject.h" CopyOptions::CopyOptions(void) { @@ -64,8 +65,8 @@ QString CopyOptions::getSQLDefinition(void) { QString def, mode, op_name; unsigned op_id, - ids[]={ALL, DEFAULTS, CONSTRAINTS, - INDEXES, STORAGE, COMMENTS }, + ids[]={ALL, DEFAULTS, CONSTRAINTS, INDEXES, + STORAGE, COMMENTS, IDENTITY, STATISTICS }, cnt = sizeof(ids) / sizeof(unsigned); mode = (copy_mode == INCLUDING ? QString(" INCLUDING") : QString(" EXCLUDING")); @@ -83,6 +84,8 @@ QString CopyOptions::getSQLDefinition(void) case INDEXES: op_name=QString(" INDEXES"); break; case STORAGE: op_name=QString(" STORAGE"); break; case COMMENTS: op_name=QString(" COMMENTS"); break; + case IDENTITY: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSQLVersions::PGSQL_VERSION_96.toFloat() ? QString(" IDENTITY") : QString()); break; + case STATISTICS: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSQLVersions::PGSQL_VERSION_96.toFloat() ? QString(" STATISTICS") : QString()); break; } if(!op_name.isEmpty()) diff --git a/libpgmodeler/src/copyoptions.h b/libpgmodeler/src/copyoptions.h index 16107d8072..82f6ead014 100644 --- a/libpgmodeler/src/copyoptions.h +++ b/libpgmodeler/src/copyoptions.h @@ -38,9 +38,11 @@ class CopyOptions { INDEXES=4, STORAGE=8, COMMENTS=16, - ALL=31, - INCLUDING=64, - EXCLUDING=128; + IDENTITY=32, + STATISTICS=64, + ALL=127, + INCLUDING=256, + EXCLUDING=512; CopyOptions(void); CopyOptions(unsigned copy_mode, unsigned copy_op_ids); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 43c62fde30..897ffdb79e 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2522,7 +2522,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) if(copy_options.getCopyMode()!=0) { attributes[ParsersAttributes::COPY_OPTIONS]=QString("%1").arg(copy_options.getCopyOptionsIds()); - attributes[ParsersAttributes::COPY_MODE]=QString("%1").arg(copy_options.getCopyMode());; + attributes[ParsersAttributes::COPY_MODE]=QString("%1").arg(copy_options.getCopyMode()); } reduced_form=(attributes[ParsersAttributes::COLUMNS].isEmpty() && diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 3eb0bf9445..7ca707f44d 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -20,7 +20,9 @@ #include "constraintwidget.h" #include "columnwidget.h" #include "tablewidget.h" -#include "configurationform.h" +#include "baseform.h" +#include "relationshipconfigwidget.h" +#include "generalconfigwidget.h" RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_RELATIONSHIP) { @@ -333,6 +335,8 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l storage_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::STORAGE)); comments_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::COMMENTS)); indexes_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::INDEXES)); + identity_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::IDENTITY)); + statistics_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::STATISTICS)); } } } @@ -658,7 +662,11 @@ void RelationshipWidget::showAdvancedObject(int row) tab, tab->getPosition().x(), tab->getPosition().y()); editing_form.setMainWidget(table_wgt); + + GeneralConfigWidget::restoreWidgetGeometry(&editing_form, table_wgt->metaObject()->className()); editing_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&editing_form, table_wgt->metaObject()->className()); + tab->setProtected(false); } } @@ -669,6 +677,7 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) BaseForm editing_form(this); WidgetClass *object_wgt=new WidgetClass; BaseObject *parent_aux = nullptr; + int res = 0; if(this->object->getObjectType() == BASE_RELATIONSHIP) parent_aux = dynamic_cast(this->object)->getTable(BaseRelationship::SRC_TABLE); @@ -678,7 +687,11 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) object_wgt->setAttributes(this->model, this->op_list, parent_aux, dynamic_cast(object)); editing_form.setMainWidget(object_wgt); - return(editing_form.exec()); + GeneralConfigWidget::restoreWidgetGeometry(&editing_form, object_wgt->metaObject()->className()); + res = editing_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&editing_form, object_wgt->metaObject()->className()); + + return(res); } void RelationshipWidget::addObject(void) @@ -921,6 +934,8 @@ void RelationshipWidget::selectCopyOptions(void) storage_chk->setEnabled(!all_chk->isChecked() && !defaults_rb->isChecked()); comments_chk->setEnabled(!all_chk->isChecked() && !defaults_rb->isChecked()); indexes_chk->setEnabled(!all_chk->isChecked() && !defaults_rb->isChecked()); + identity_chk->setEnabled(!all_chk->isChecked() && !defaults_rb->isChecked()); + statistics_chk->setEnabled(!all_chk->isChecked() && !defaults_rb->isChecked()); if(all_chk->isChecked() || defaults_rb->isChecked()) { @@ -932,6 +947,8 @@ void RelationshipWidget::selectCopyOptions(void) storage_chk->setChecked(false); comments_chk->setChecked(false); indexes_chk->setChecked(false); + identity_chk->setChecked(false); + statistics_chk->setChecked(false); } } @@ -1008,11 +1025,11 @@ void RelationshipWidget::applyConfiguration(void) if(this->object->getObjectType()==OBJ_RELATIONSHIP) { QPlainTextEdit *pattern_fields[]={ src_col_pattern_txt, dst_col_pattern_txt, - src_fk_pattern_txt, dst_fk_pattern_txt, - pk_pattern_txt, uq_pattern_txt, pk_col_pattern_txt }; + src_fk_pattern_txt, dst_fk_pattern_txt, + pk_pattern_txt, uq_pattern_txt, pk_col_pattern_txt }; unsigned pattern_ids[]= { Relationship::SRC_COL_PATTERN, Relationship::DST_COL_PATTERN, - Relationship::SRC_FK_PATTERN, Relationship::DST_FK_PATTERN, - Relationship::PK_PATTERN, Relationship::UQ_PATTERN, Relationship::PK_COL_PATTERN }; + Relationship::SRC_FK_PATTERN, Relationship::DST_FK_PATTERN, + Relationship::PK_PATTERN, Relationship::UQ_PATTERN, Relationship::PK_COL_PATTERN }; rel=dynamic_cast(base_rel); @@ -1039,6 +1056,8 @@ void RelationshipWidget::applyConfiguration(void) copy_ops+=(comments_chk->isChecked() ? CopyOptions::COMMENTS : 0); copy_ops+=(indexes_chk->isChecked() ? CopyOptions::INDEXES : 0); copy_ops+=(storage_chk->isChecked() ? CopyOptions::STORAGE : 0); + copy_ops+=(identity_chk->isChecked() ? CopyOptions::IDENTITY : 0); + copy_ops+=(statistics_chk->isChecked() ? CopyOptions::STATISTICS : 0); } rel->setCopyOptions(CopyOptions(copy_mode, copy_ops)); diff --git a/libpgmodeler_ui/ui/relationshipwidget.ui b/libpgmodeler_ui/ui/relationshipwidget.ui index 7078bd1379..fce87e4987 100644 --- a/libpgmodeler_ui/ui/relationshipwidget.ui +++ b/libpgmodeler_ui/ui/relationshipwidget.ui @@ -6,7 +6,7 @@ 0 0 - 818 + 858 1701 @@ -1001,6 +1001,26 @@ + + + + false + + + STATISTICS + + + + + + + false + + + IDENTITY + + + From ae32fbb90b0a86d92065bf8b2fe8d986078d6f98 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 18 Aug 2018 17:54:10 -0300 Subject: [PATCH 103/425] Update on CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b9b3e8957..75bb042df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ v0.9.2-alpha * [New] Added support to sequence options for identity columns. * [New] Added the ability to paste CSV text from clipboard into the TableDataWidget. * [New] Added support to bulk data edit in TableDataWidget. +* [Change] Added missing copy options on copy relationships. * [Change] Minor adjustments on the item delegates in order draw text in the right alignment. * [Change] Minor adjustment on buttons style in DatabaseExplorerWidget, DataManipulationForm and SQLExecutionWidget. * [Change] Minor adjustment on OperationList::removeFromPool to avoid throw an exception when an invalid index is passed. From 403f54a536fdd106b161b93c46ee4f49b85f6c49 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 20 Aug 2018 16:54:44 -0300 Subject: [PATCH 104/425] Version upgrade 0.9.2-alpha -> 0.9.2-alpha1 --- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 11 ++++++++++- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 8 ++++---- libutils/src/globalattributes.cpp | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 67d02a78f7..8581408e64 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -555,7 +555,16 @@ void SnippetsConfigWidget::configureSnippetsMenu(QMenu *snip_menu, vectoraddMenu(submenus[ParsersAttributes::GENERAL]); + { + if(snip_menu->isEmpty()) + snip_menu->addMenu(submenus[ParsersAttributes::GENERAL]); + else + { + //Inserting the "general" submenu at the top of snippets actions + snip_menu->insertMenu(snip_menu->actions().at(0), submenus[ParsersAttributes::GENERAL]); + snip_menu->insertSeparator(snip_menu->actions().at(1)); + } + } } bool SnippetsConfigWidget::isSnippetExists(const QString &snip_id) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index affb325e0f..4070beeee0 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -339,15 +339,15 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) msgoutput_lst->clear(); PgModelerUiNS::createOutputListItem(msgoutput_lst, - QString("%1 %2").arg(time_str).arg(e.getErrorMessage()), - QPixmap(PgModelerUiNS::getIconPath("msgbox_erro")), false); + QString("%1 %2").arg(time_str).arg(e.getErrorMessage()), + QPixmap(PgModelerUiNS::getIconPath("msgbox_erro")), false); if(e.getErrorType()==ERR_CONNECTION_TIMEOUT || e.getErrorType()==ERR_CONNECTION_BROKEN) { PgModelerUiNS::createOutputListItem(msgoutput_lst, - QString("%1 %2").arg(time_str).arg(trUtf8("No results retrieved or changes done due to the error above.")), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), false); + QString("%1 %2").arg(time_str).arg(trUtf8("No results retrieved or changes done due to the error above! Run the command again.")), + QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), false); } msgoutput_lst->setVisible(true); diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index 725e98a433..84f34616f8 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -25,7 +25,7 @@ namespace GlobalAttributes { PGMODELER_APP_NAME=QString("pgmodeler"), PGMODELER_URI=QString("pgmodeler.io"), PGMODELER_REVERSE_URI=QString("io.pgmodeler"), - PGMODELER_VERSION=QString("0.9.2-alpha"), + PGMODELER_VERSION=QString("0.9.2-alpha1"), PGMODELER_BUILD_NUMBER=QString(BUILDNUM), PGMODELER_SITE=QString("https://pgmodeler.io"), PGMODELER_SUPPORT=QString("https://github.com/pgmodeler/pgmodeler/issues"), From 5375c62022ff054e5b9410ec40273f2464445089 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 20 Aug 2018 17:48:23 -0300 Subject: [PATCH 105/425] Fixed some bugs related to dialog size restoration in DataManipulationForm and TableWidget --- libpgmodeler_ui/src/databaseexplorerwidget.cpp | 3 ++- libpgmodeler_ui/src/datamanipulationform.cpp | 5 ----- libpgmodeler_ui/src/datamanipulationform.h | 1 - libpgmodeler_ui/src/tablewidget.cpp | 11 +++++++++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index e662c12a38..fb15f00485 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -23,6 +23,7 @@ #include "snippetsconfigwidget.h" #include "plaintextitemdelegate.h" #include "pgmodeleruins.h" +#include "generalconfigwidget.h" using namespace ParsersAttributes; @@ -1921,8 +1922,8 @@ void DatabaseExplorerWidget::openDataGrid(const QString &schema, const QString & data_manip->hide_views_chk->setChecked(hide_views); data_manip->setAttributes(conn, schema, table); - PgModelerUiNS::resizeDialog(data_manip); + GeneralConfigWidget::restoreWidgetGeometry(data_manip); data_manip->show(); } diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 356f4979f8..f307606d5f 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -1428,11 +1428,6 @@ void DataManipulationForm::closeEvent(QCloseEvent *) GeneralConfigWidget::saveWidgetGeometry(this); } -void DataManipulationForm::showEvent(QShowEvent *) -{ - GeneralConfigWidget::restoreWidgetGeometry(this); -} - void DataManipulationForm::truncateTable(void) { try diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index a19ff6f7d2..adf9672ea9 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -104,7 +104,6 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { void resizeEvent(QResizeEvent *event); void closeEvent(QCloseEvent *); - void showEvent(QShowEvent *); public: DataManipulationForm(QWidget * parent = 0, Qt::WindowFlags f = 0); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 13aa4ca987..af2f6eaa20 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -168,10 +168,17 @@ int TableWidget::openEditingForm(TableObject *object) { BaseForm editing_form(this); WidgetClass *object_wgt=new WidgetClass; + int res = 0; + object_wgt->setAttributes(this->model, this->op_list, - dynamic_cast
(this->object), dynamic_cast(object)); + dynamic_cast
(this->object), dynamic_cast(object)); editing_form.setMainWidget(object_wgt); - return(editing_form.exec()); + + GeneralConfigWidget::restoreWidgetGeometry(&editing_form, object_wgt->metaObject()->className()); + res = editing_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&editing_form, object_wgt->metaObject()->className()); + + return(res); } ObjectsTableWidget *TableWidget::getObjectTable(ObjectType obj_type) From 84c34403f7bf362ab84824aa8b3d0983128ccb46 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 26 Aug 2018 13:34:07 -0300 Subject: [PATCH 106/425] Fixes a bad erase in View::removeReference (issue #1161) --- libpgmodeler/src/view.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index a89eec7305..39d2442271 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -358,9 +358,9 @@ void View::removeReference(unsigned ref_id) { //Removes the reference id from the expression list if(references[*itr]==references[ref_id]) - vect_idref[i]->erase(itr); - - itr++; + itr = vect_idref[i]->erase(itr); + else + itr++; } } From de0abe653bf39ccce35bde1460793a119dcade66 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 29 Aug 2018 17:49:41 -0300 Subject: [PATCH 107/425] Some fixes were done in the ModelOverviewWidget in order to support large models without exceed the screen size when configuring the size of the overall widget. --- libpgmodeler_ui/src/modeloverviewwidget.cpp | 88 ++++++++++++++++++--- libpgmodeler_ui/src/modeloverviewwidget.h | 2 + libpgmodeler_ui/ui/databaseimportform.ui | 2 +- libpgmodeler_ui/ui/generalconfigwidget.ui | 6 +- libpgmodeler_ui/ui/modeldatabasediffform.ui | 8 +- libpgmodeler_ui/ui/modelexportform.ui | 2 +- libpgmodeler_ui/ui/modeloverviewwidget.ui | 15 ++-- 7 files changed, 96 insertions(+), 27 deletions(-) diff --git a/libpgmodeler_ui/src/modeloverviewwidget.cpp b/libpgmodeler_ui/src/modeloverviewwidget.cpp index a63ebf8a0d..86e8a0966b 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.cpp +++ b/libpgmodeler_ui/src/modeloverviewwidget.cpp @@ -22,10 +22,22 @@ ModelOverviewWidget::ModelOverviewWidget(QWidget *parent) : QWidget(parent, Qt::WindowCloseButtonHint | Qt::Tool) { setupUi(this); + + scrollarea = nullptr; this->model=nullptr; zoom_factor=1; curr_resize_factor=RESIZE_FACTOR; this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); + + QVBoxLayout *vbox = new QVBoxLayout; + scrollarea=new QScrollArea(frame); + scrollarea->setWidgetResizable(true); + scrollarea->setFrameStyle(QFrame::Box); + scrollarea->setFrameShadow(QFrame::Plain); + vbox->addWidget(scrollarea); + vbox->setContentsMargins(0,0,0,0); + frame->setLayout(vbox); + label->setStyleSheet("QLabel#label{ border: 0px; }"); } void ModelOverviewWidget::show(ModelWidget *model) @@ -130,6 +142,9 @@ void ModelOverviewWidget::updateOverview(bool force_update) else { frame->setEnabled(true); + + p.setRenderHints(QPainter::Antialiasing, false); + p.setRenderHints(QPainter::TextAntialiasing, false); this->model->scene->render(&p, pix.rect(), scene_rect.toRect()); //Resizes the pixmap to the previous configured QSize @@ -151,13 +166,26 @@ void ModelOverviewWidget::resizeWindowFrame(void) //Resizes the window frame based upon the model's viewport dimensions size=this->model->viewport->geometry().size(); - size.setWidth((size.width() * factor)); - size.setHeight((size.height() * factor)); + size.setWidth(size.width() * factor); + size.setHeight(size.height() * factor); window_frm->resize(size.toSize()); //Set the frame position based upon the viewport scroll bar values - window_frm->move(QPoint(h_scroll->value() * factor, v_scroll->value() * factor)); + window_frm->move(QPoint(h_scroll->value() * factor - (scrollarea->isVisible() ? scrollarea->horizontalScrollBar()->value() : 0), + v_scroll->value() * factor - (scrollarea->isVisible() ? scrollarea->verticalScrollBar()->value() : 0))); + if(scrollarea->isVisible()) + { + if(window_frm->geometry().bottom() > frame->geometry().bottom()) + scrollarea->verticalScrollBar()->setValue(scrollarea->verticalScrollBar()->value() + (scrollarea->verticalScrollBar()->maximum() * 0.30)); + else if(window_frm->geometry().top() < 0) + scrollarea->verticalScrollBar()->setValue(scrollarea->verticalScrollBar()->value() - (scrollarea->verticalScrollBar()->maximum() * 0.30)); + + if(window_frm->geometry().right() > frame->geometry().right()) + scrollarea->horizontalScrollBar()->setValue(scrollarea->horizontalScrollBar()->value() + (scrollarea->horizontalScrollBar()->maximum() * 0.30)); + else if(window_frm->geometry().left() < 0) + scrollarea->horizontalScrollBar()->setValue(scrollarea->horizontalScrollBar()->value() - (scrollarea->horizontalScrollBar()->maximum() * 0.30)); + } } } @@ -174,9 +202,9 @@ void ModelOverviewWidget::resizeOverview(void) curr_size.setWidth(curr_size.width() * RESIZE_FACTOR); curr_size.setHeight(curr_size.height() * RESIZE_FACTOR); - //If the size exceeds the screen half width or height - if(curr_size.width() > screen_rect.width() * 0.80f || - curr_size.height() > screen_rect.height() * 0.80f) + //If the size exceeds the screen's width or height in 90% + if(curr_size.width() > screen_rect.width() * 0.90f || + curr_size.height() > screen_rect.height() * 0.90f) { int max_val = std::max(scene_rect.width(), scene_rect.height()); @@ -203,9 +231,45 @@ void ModelOverviewWidget::resizeOverview(void) pixmap_size=scene_rect.size().toSize(); } - this->resize(curr_size.toSize()); - this->setMaximumSize(curr_size.toSize()); - this->setMinimumSize(curr_size.toSize()); + QSize size = curr_size.toSize(); + bool show_scrollarea = false; + + if(curr_size.width() > screen_rect.width() * 0.90 ) + { + size.setWidth(screen_rect.width() * 0.90); + show_scrollarea = true; + } + + if(curr_size.height() > screen_rect.height() * 0.90) + { + size.setHeight(screen_rect.height() * 0.90); + show_scrollarea = true; + } + + if(show_scrollarea) + { + frame->setStyleSheet("QFrame#frame{ border: 0px; }"); + frame->layout()->removeWidget(label); + frame->layout()->addWidget(scrollarea); + scrollarea->setVisible(true); + scrollarea->setWidget(label); + window_frm->setParent(scrollarea); + } + else + { + frame->setStyleSheet(""); + scrollarea->setVisible(false); + scrollarea->takeWidget(); + frame->layout()->removeWidget(scrollarea); + frame->layout()->addWidget(label); + window_frm->setParent(frame); + } + + window_frm->setVisible(true); + this->resize(size); + this->setMaximumSize(size); + this->setMinimumSize(size); + this->adjustSize(); } } @@ -241,7 +305,7 @@ void ModelOverviewWidget::mouseMoveEvent(QMouseEvent *event) rect1=frame->geometry(); - if(rect.left() < 0) + /*if(rect.left() < 0) rect.translate(abs(rect.left()),0); if(rect.top() < 0) @@ -251,9 +315,9 @@ void ModelOverviewWidget::mouseMoveEvent(QMouseEvent *event) rect.translate((rect1.right() - rect.right())-rect1.left(),0); if(rect.bottom() >= rect1.bottom()) - rect.translate(0,(rect1.bottom() - rect.bottom())-rect1.top()); + rect.translate(0,(rect1.bottom() - rect.bottom())-rect1.top());*/ - window_frm->setGeometry(rect); + //window_frm->setGeometry(rect); this->model->viewport->horizontalScrollBar()->setValue(ceilf(zoom_factor * scene_rect.width() * (rect.x()/static_cast(rect1.width())))); this->model->viewport->verticalScrollBar()->setValue(ceilf(zoom_factor * scene_rect.height() * (rect.y()/static_cast(rect1.height())))); } diff --git a/libpgmodeler_ui/src/modeloverviewwidget.h b/libpgmodeler_ui/src/modeloverviewwidget.h index d5e950a27b..b69b495724 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.h +++ b/libpgmodeler_ui/src/modeloverviewwidget.h @@ -34,6 +34,8 @@ class ModelOverviewWidget: public QWidget, public Ui::ModelOverviewWidget { private: Q_OBJECT + QScrollArea *scrollarea; + //! \brief Model which object are drawn on the overview widget ModelWidget *model; diff --git a/libpgmodeler_ui/ui/databaseimportform.ui b/libpgmodeler_ui/ui/databaseimportform.ui index 75f29d0f17..db732a9175 100644 --- a/libpgmodeler_ui/ui/databaseimportform.ui +++ b/libpgmodeler_ui/ui/databaseimportform.ui @@ -399,7 +399,7 @@ - pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. + pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will not be aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 8d4354bfd3..8fe315d8e6 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -209,7 +209,7 @@ - Defines the vertical and horizontal grid size. This value affects the spacing of objects when using object grid alignment feature. + Defines the vertical and horizontal grid size. This value affects the spacing of objects when using the feature that aligns the objects on the grid. 10 @@ -417,7 +417,7 @@ - Hide the portion of table which represent triggers, indexes and rules + Hide the portion of table which represents triggers, indexes and rules. Hide table extended attributes @@ -718,7 +718,7 @@ - Disable antialiasing for lines and texts improving performance when handling huge models. + Disable the antialiasing for lines and texts improving performance when handling huge models. Disable render smoothness diff --git a/libpgmodeler_ui/ui/modeldatabasediffform.ui b/libpgmodeler_ui/ui/modeldatabasediffform.ui index c1eb3868f0..38c521c64c 100644 --- a/libpgmodeler_ui/ui/modeldatabasediffform.ui +++ b/libpgmodeler_ui/ui/modeldatabasediffform.ui @@ -140,7 +140,7 @@ - Source database + Input false @@ -446,7 +446,7 @@ - Override the PostgreSQL version when generating the diff. The default is to use the same version as the input database. + Override the PostgreSQL version when generating the diff code. The default is to use the same version as the input database (detected automatically). Use PostgreSQL: @@ -814,7 +814,7 @@ - Permissions already set on database objects will be kept.The ones configured on the model will be applied to the database. + Permissions already set on database objects will be kept. The ones configured on the model will be applied to the database. Keep object's permissions @@ -913,7 +913,7 @@ - Froce the generation of DROP commands for columns and constraints that exist in database but not in the model. This is useful when diff a partial model against the complete database and the user needs to drop columns and constraint but preserve the rest of the objects. + Force the generation of DROP commands for columns and constraints that exist in database but not in the model. This is useful when diff a partial model against the complete database and the user needs to drop columns and constraint but preserve the rest of the objects. Drop missing columns and constraints diff --git a/libpgmodeler_ui/ui/modelexportform.ui b/libpgmodeler_ui/ui/modelexportform.ui index d8582f2f9f..b2d4447626 100644 --- a/libpgmodeler_ui/ui/modelexportform.ui +++ b/libpgmodeler_ui/ui/modelexportform.ui @@ -489,7 +489,7 @@ - If <strong>DB</strong> is checked pgModeler will destroy the database if already exists on the server. When <strong>Objects</strong> is checked pgModeler will execute the DROP command attached to SQL-enabled objects. <strong>WARNING:</strong> this option leads to data loss so make sure to have a backup first. + If <strong>DB</strong> is checked pgModeler will destroy the database if already exists on the server. When <strong>Objects</strong> is checked pgModeler will execute the DROP command attached to SQL-enabled objects. <strong>WARNING:</strong> this option leads to data loss so make sure to have a backup before exporting. Drop: diff --git a/libpgmodeler_ui/ui/modeloverviewwidget.ui b/libpgmodeler_ui/ui/modeloverviewwidget.ui index c00c2c36f3..0ae83805b7 100644 --- a/libpgmodeler_ui/ui/modeloverviewwidget.ui +++ b/libpgmodeler_ui/ui/modeloverviewwidget.ui @@ -53,7 +53,10 @@ border: 1px solid #707070; - + + + 0 + 0 @@ -66,10 +69,7 @@ 0 - - 0 - - + @@ -99,7 +99,7 @@ - QFrame::Box + QFrame::NoFrame QFrame::Plain @@ -156,6 +156,9 @@ + + QFrame::NoFrame + From cd0651b9c2d28e6dd1d1cfee2464ebc6f7f26d0f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 30 Aug 2018 10:29:44 -0300 Subject: [PATCH 108/425] Additional fix on ModelOverviewWidget in order to improve the model navigation --- libpgmodeler_ui/src/modeloverviewwidget.cpp | 27 ++++++--------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/libpgmodeler_ui/src/modeloverviewwidget.cpp b/libpgmodeler_ui/src/modeloverviewwidget.cpp index 86e8a0966b..6753f8828e 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.cpp +++ b/libpgmodeler_ui/src/modeloverviewwidget.cpp @@ -34,6 +34,7 @@ ModelOverviewWidget::ModelOverviewWidget(QWidget *parent) : QWidget(parent, Qt:: scrollarea->setWidgetResizable(true); scrollarea->setFrameStyle(QFrame::Box); scrollarea->setFrameShadow(QFrame::Plain); + scrollarea->setVisible(false); vbox->addWidget(scrollarea); vbox->setContentsMargins(0,0,0,0); frame->setLayout(vbox); @@ -126,6 +127,8 @@ void ModelOverviewWidget::updateOverview(bool force_update) { QPixmap pix; + QApplication::setOverrideCursor(Qt::WaitCursor); + //Creates a pixmap with the size of the scene pix=QPixmap(pixmap_size); @@ -152,6 +155,7 @@ void ModelOverviewWidget::updateOverview(bool force_update) } label->resize(curr_size.toSize()); + QApplication::restoreOverrideCursor(); } } @@ -246,7 +250,7 @@ void ModelOverviewWidget::resizeOverview(void) show_scrollarea = true; } - if(show_scrollarea) + if(show_scrollarea && !scrollarea->isVisible()) { frame->setStyleSheet("QFrame#frame{ border: 0px; }"); frame->layout()->removeWidget(label); @@ -255,7 +259,7 @@ void ModelOverviewWidget::resizeOverview(void) scrollarea->setWidget(label); window_frm->setParent(scrollarea); } - else + else if(!show_scrollarea) { frame->setStyleSheet(""); scrollarea->setVisible(false); @@ -269,7 +273,6 @@ void ModelOverviewWidget::resizeOverview(void) this->resize(size); this->setMaximumSize(size); this->setMinimumSize(size); - this->adjustSize(); } } @@ -292,7 +295,7 @@ void ModelOverviewWidget::mouseMoveEvent(QMouseEvent *event) if(event->buttons()==Qt::LeftButton) { QRect rect=window_frm->geometry(), rect1; - int width, height, x=event->x(), y=event->y(); + int width = 0, height = 0, x=event->x(), y=event->y() + scrollarea->verticalScrollBar()->value(); width=rect.width()/2; height=rect.height()/2; @@ -303,21 +306,7 @@ void ModelOverviewWidget::mouseMoveEvent(QMouseEvent *event) rect.setRight(x + width); rect.setBottom(y + height); - rect1=frame->geometry(); - - /*if(rect.left() < 0) - rect.translate(abs(rect.left()),0); - - if(rect.top() < 0) - rect.translate(0, abs(rect.top())); - - if(rect.right() >= rect1.right()) - rect.translate((rect1.right() - rect.right())-rect1.left(),0); - - if(rect.bottom() >= rect1.bottom()) - rect.translate(0,(rect1.bottom() - rect.bottom())-rect1.top());*/ - - //window_frm->setGeometry(rect); + rect1=label->geometry(); this->model->viewport->horizontalScrollBar()->setValue(ceilf(zoom_factor * scene_rect.width() * (rect.x()/static_cast(rect1.width())))); this->model->viewport->verticalScrollBar()->setValue(ceilf(zoom_factor * scene_rect.height() * (rect.y()/static_cast(rect1.height())))); } From 5e7cf38f0491341841086065360c4c98c7db1f34 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 30 Aug 2018 10:55:15 -0300 Subject: [PATCH 109/425] pgModeler will not use the official docs url in the help buttons --- libpgmodeler_ui/src/mainwindow.cpp | 9 +-------- libutils/src/globalattributes.cpp | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index dbba31fce8..88b5541a71 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1718,14 +1718,7 @@ void MainWindow::showOverview(bool show) void MainWindow::openSupport(void) { - Messagebox msg_box; - - msg_box.show(trUtf8("Access support page"), - trUtf8("This action will open a web browser window! Want to proceed?"), - Messagebox::CONFIRM_ICON,Messagebox::YES_NO_BUTTONS); - - if(msg_box.result()==QDialog::Accepted) - QDesktopServices::openUrl(QUrl(GlobalAttributes::PGMODELER_SUPPORT)); + QDesktopServices::openUrl(QUrl(GlobalAttributes::PGMODELER_SUPPORT)); } void MainWindow::toggleUpdateNotifier(bool show) diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index 84f34616f8..3e62d69063 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -28,7 +28,7 @@ namespace GlobalAttributes { PGMODELER_VERSION=QString("0.9.2-alpha1"), PGMODELER_BUILD_NUMBER=QString(BUILDNUM), PGMODELER_SITE=QString("https://pgmodeler.io"), - PGMODELER_SUPPORT=QString("https://github.com/pgmodeler/pgmodeler/issues"), + PGMODELER_SUPPORT=QString("https://pgmodeler.io/support/docs"), PGMODELER_SRC_URL=QString("https://github.com/pgmodeler/pgmodeler/releases"), PGMODELER_DOWNLOAD_URL=QString("%1/download").arg(PGMODELER_SITE), PGMODELER_DONATE_URL=QString("%1/#donationForm").arg(PGMODELER_SITE), From d46f1bcff08c828ed61fb1d5eac371d93deac041 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 5 Sep 2018 14:01:34 -0300 Subject: [PATCH 110/425] Fixed a bug that was causing FK relationship deletion to crash the application sometimes. --- libpgmodeler/src/databasemodel.cpp | 65 ++++++++++++++--------------- libpgmodeler_ui/src/modelwidget.cpp | 8 ++-- 2 files changed, 35 insertions(+), 38 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index f791925c96..7198fa4416 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -6120,25 +6120,42 @@ BaseRelationship *DatabaseModel::createRelationship(void) /* Creates the fk relationship if it not exists. This generally happens when a foreign key is added to the table after its creation. */ - if(/*!base_rel &&*/ attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_FK) + if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_FK) { - vector fks; - dynamic_cast
(tables[0])->getForeignKeys(fks, false, dynamic_cast
(tables[1])); - - /* If the tables[0] doesn't has any fk that references the tables[1] indicates that the relationship - is being created before the fk that represents it (inconsistence!). In this case an error is raised. */ - if(fks.empty()) - { - throw Exception(Exception::getErrorMessage(ERR_ALOC_INV_FK_RELATIONSHIP) - .arg(attribs[ParsersAttributes::NAME]) - .arg(tables[0]->getName(true)), - ERR_ALOC_INV_FK_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); - } - base_rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_FK, tables[0], tables[1], false, false); base_rel->setName(attribs[ParsersAttributes::NAME]); base_rel->setAlias(attribs[ParsersAttributes::ALIAS]); addRelationship(base_rel); + + /* If the source table doesn't have any fk that references the destination table indicates that the relationship + is being created before the fk that represents it or the fk is invalid (inconsistence!). In this case an error is raised. */ + if(base_rel->getRelationshipType() == BaseRelationship::RELATIONSHIP_FK && + !base_rel->getReferenceForeignKey()) + { + Table *src_tab = dynamic_cast
(base_rel->getTable(BaseRelationship::SRC_TABLE)), + *dst_tab = dynamic_cast
(base_rel->getTable(BaseRelationship::DST_TABLE)); + vector fks; + + src_tab->getForeignKeys(fks, false, dst_tab); + + for(auto fk : fks) + { + if(!getRelationship(src_tab, dst_tab, fk)) + { + base_rel->setReferenceForeignKey(fk); + break; + } + } + + //Throws an error if the relationship was created without a valid foreign key attached to it + if(!base_rel->getReferenceForeignKey()) + { + throw Exception(Exception::getErrorMessage(ERR_ALOC_INV_FK_RELATIONSHIP) + .arg(attribs[ParsersAttributes::NAME]) + .arg(src_tab->getName(true)), + ERR_ALOC_INV_FK_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + } } else if(base_rel) base_rel->setName(attribs[ParsersAttributes::NAME]); @@ -6310,26 +6327,6 @@ BaseRelationship *DatabaseModel::createRelationship(void) base_rel->blockSignals(false); } - if(base_rel && - base_rel->getRelationshipType() == BaseRelationship::RELATIONSHIP_FK && - !base_rel->getReferenceForeignKey()) - { - Table *src_tab = dynamic_cast
(base_rel->getTable(BaseRelationship::SRC_TABLE)), - *dst_tab = dynamic_cast
(base_rel->getTable(BaseRelationship::DST_TABLE)); - vector fks; - - src_tab->getForeignKeys(fks, false, dst_tab); - - for(auto fk : fks) - { - if(!getRelationship(src_tab, dst_tab, fk)) - { - base_rel->setReferenceForeignKey(fk); - break; - } - } - } - return(base_rel); } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index c959ab3bdd..e0d3e942de 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2799,10 +2799,10 @@ void ModelWidget::removeObjects(bool cascade) if(objs_map.count(obj_id)==0) { objs_map[tab_obj->getObjectId()]=std::make_tuple(tab_obj, - tab_obj->getName(true), - tab_obj->getObjectType(), - tab_obj->getParentTable()->getName(true), - OBJ_TABLE); + tab_obj->getName(true), + tab_obj->getObjectType(), + tab_obj->getParentTable()->getName(true), + OBJ_TABLE); } } From 7e2fea58e578fa7a56d4865adf8760a6f5d8e20f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 6 Sep 2018 11:20:43 -0300 Subject: [PATCH 111/425] Making pgModeler honor the columns arrangement in primary keys (issue #1173) --- libpgmodeler/src/constraint.cpp | 7 +++- libpgmodeler/src/constraint.h | 3 ++ libpgmodeler_ui/src/constraintwidget.cpp | 41 +++++++++--------------- libpgmodeler_ui/src/tablewidget.cpp | 12 +++++++ 4 files changed, 36 insertions(+), 27 deletions(-) diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 8bb2818b97..39e7c6a884 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -276,7 +276,12 @@ ActionType Constraint::getActionType(unsigned act_id) if(act_id==DELETE_ACTION) return(del_action); else - return(upd_action); + return(upd_action); +} + +vector Constraint::getColumns(unsigned col_type) +{ + return(col_type==SOURCE_COLS ? columns : ref_columns); } QString Constraint::getExpression(void) diff --git a/libpgmodeler/src/constraint.h b/libpgmodeler/src/constraint.h index b0c335931b..c34b6e7b22 100644 --- a/libpgmodeler/src/constraint.h +++ b/libpgmodeler/src/constraint.h @@ -146,6 +146,9 @@ class Constraint: public TableObject{ //! \brief Retuns the action type (ON DELETE or ON UPDATE) of a foreign key ActionType getActionType(unsigned act_id); + //! \brief Returns the list of columns of the specified type SOURCE_COLS or REFERENCED_COLS + vector getColumns(unsigned col_type); + /*! \brief Returns one column (using its index) from the internal constraint column lists. Use the constants SOURCE_COLS or REFERENCED_COLS to access the lists */ Column *getColumn(unsigned col_idx, unsigned col_type); diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 6b8b06736b..d123539b6c 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -355,6 +355,7 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis Column *column=nullptr; Table *ref_table=nullptr; vector excl_elems; + vector columns; if(!parent_obj) throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -368,25 +369,17 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis info_frm->setVisible(this->table!=nullptr); ref_table_sel->setModel(model); - if(this->table) - count=table->getObjectCount(OBJ_COLUMN); - else - count=relationship->getAttributeCount(); - columns_tab->blockSignals(true); - for(i=0, row=0; i < count; i++) - { - if(this->table) - column=dynamic_cast(table->getObject(i, OBJ_COLUMN)); - else - column=relationship->getAttribute(i); - if(constr && constr->isColumnExists(column, Constraint::SOURCE_COLS)) - { - columns_tab->addRow(); - addColumn(column, Constraint::SOURCE_COLS, row); - row++; - } + if(constr) + { + row = 0; + for(auto column : constr->getColumns(Constraint::SOURCE_COLS)) + { + columns_tab->addRow(); + addColumn(column, Constraint::SOURCE_COLS, row); + row++; + } } updateColumnsCombo(Constraint::SOURCE_COLS); @@ -422,16 +415,12 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis ref_columns_tab->blockSignals(true); ref_table_sel->setSelectedObject(ref_table); - count=ref_table->getColumnCount(); - for(i=0, row=0; i < count; i++) + row = 0; + for(auto column : constr->getColumns(Constraint::REFERENCED_COLS)) { - column=ref_table->getColumn(i); - if(constr->isColumnExists(column, Constraint::REFERENCED_COLS)) - { - ref_columns_tab->addRow(); - addColumn(column, Constraint::REFERENCED_COLS, row); - row++; - } + ref_columns_tab->addRow(); + addColumn(column, Constraint::REFERENCED_COLS, row); + row++; } updateColumnsCombo(Constraint::REFERENCED_COLS); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index af2f6eaa20..9606aa2a7e 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -792,10 +792,22 @@ void TableWidget::applyConfiguration(void) } else if(!pk->isAddedByRelationship()) { + vector orig_pk_cols = pk->getColumns(Constraint::SOURCE_COLS); + //If the table owns a pk we only update the columns op_list->registerObject(pk, Operation::OBJECT_MODIFIED, -1, table); pk->removeColumns(); + /* Adding the original primary key columns if they also exists in the + * list of columns generated by the selection in the column list */ + for(auto col : orig_pk_cols) + { + if(std::find(pk_cols.begin(), pk_cols.end(), col) != pk_cols.end()) + pk->addColumn(col, Constraint::SOURCE_COLS); + } + + /* Adding the other columns selected in the grid as pk columns. + * Duplicated columns are discarded by the method Constraint::addColumn */ for(Column *col : pk_cols) pk->addColumn(col, Constraint::SOURCE_COLS); } From e6dd933c5c7dfc699e08557bad46d3df6388a186 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 6 Sep 2018 11:25:40 -0300 Subject: [PATCH 112/425] Increasing to 5 minutes the period in which the thread that saves temp models will run. --- libpgmodeler_ui/src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 88b5541a71..f81850c7d2 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -344,8 +344,8 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par configureSamplesMenu(); applyConfigurations(); - //Temporary models are saved every two minutes - tmpmodel_save_timer.setInterval(120000); + //Temporary models are saved every five minutes + tmpmodel_save_timer.setInterval(300000); QList actions=general_tb->actions(); QToolButton *btn=nullptr; From 98703358c1eebd5cefe339092212e5498ef6e2e9 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 6 Sep 2018 16:49:36 -0300 Subject: [PATCH 113/425] Added support to tab adding via shortcut or corner button in the SQL Execution panel --- libpgmodeler_ui/res/icones/newtab.png | Bin 0 -> 796 bytes libpgmodeler_ui/res/resources.qrc | 1 + libpgmodeler_ui/src/sqltoolwidget.cpp | 19 ++++++++++++++++--- libpgmodeler_ui/src/sqltoolwidget.h | 2 ++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/newtab.png diff --git a/libpgmodeler_ui/res/icones/newtab.png b/libpgmodeler_ui/res/icones/newtab.png new file mode 100644 index 0000000000000000000000000000000000000000..294d1506972cd013e5f2906ab54f85bbae8a9891 GIT binary patch literal 796 zcmV+%1LOROP)lnFh-3W zJnw}>jnPD-a`x((69=On;9x|>7;%&=iz|p(v$LU@>F%ofabO2W*(J;{BbWUoolZTv zzMrl~Qn1BCMkYD9uF%A$k6<;$OODU~lI^VhF9LcaIe;enz&wiBDbOzJt|IwGsh8jP z`$ZE8&*CG5$_r3Ah(vo4siArk%0<-d)Qnha%98_P#>}?>^7VQMW zr9B`CUT>(DZ4o+m2`nruRO-#@Db?_@_n|qgz-ON?Gq>k5bB|r4HNBfCIfAjfRJfW) zrYeLB`w+Lt-^nZ#cMH^;Qy)Bg==={di&unY{$#kP2N-|8;!9-WErc2%}r)-1+ zbp)SnEP$p-lF;k*Fvbim5VVE!ElRhIC|*Ltw}f&DYdg5|k|ipaz+Wd6e{3iKAR;4$ z12{iRQC_2)uVKt0X>t~&hNWb6wM)HPTmW}onyhRp0AQ^hNdW5P?kS=|ff_}*f-ya& z(-|)R{wuRPFMh$5?8|=d2?#*Y8M0mz=VyrQb&M%!ZGVyGWxNnlMoTRRtR4 zZa=wG06b5y+W8KVf5JBv2qD~4;C8@pgb+5Yzi)w2LLW$A)Kjn-oBhB@OE7kU_uhZ! zH|N}3KU`JEF3{)gcTXxn630KBc=N4;5rBxyz46+Kf7yzR_o|?(y!y)Pcgi1s`r!c> zSOV`oola-0p@a0t77=Q-+MRmSw|mfCJ`4j{HUg4N3fAO`B|PnFv<5>F`Ct-lN4Ca~7u>H?(e0x=W1tgZ_LAP2ewLR)O{ a@VEtiC^w|#i95ak0000icones/help_big.png icones/moreactions.png icones/stop.png + icones/newtab.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 7ba9964ce3..ceb4f8de9c 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -22,6 +22,7 @@ #include "snippetsconfigwidget.h" #include "sqlexecutionwidget.h" #include "connectionsconfigwidget.h" +#include "pgmodeleruins.h" SQLToolWidget::SQLToolWidget(QWidget * parent) : QWidget(parent) { @@ -29,9 +30,16 @@ SQLToolWidget::SQLToolWidget(QWidget * parent) : QWidget(parent) h_splitter->setSizes({315, 10000}); h_splitter->handle(1)->installEventFilter(this); - v_splitter->setSizes({1000, 400}); + sql_exec_corner_btn = new QToolButton; + sql_exec_corner_btn->setIcon(QPixmap(PgModelerUiNS::getIconPath("newtab"))); + sql_exec_corner_btn->setIconSize(QSize(18, 18)); + sql_exec_corner_btn->setStyleSheet("QToolButton { margin-left: 4px; margin-bottom: 4px; padding: 2px; }"); + sql_exec_corner_btn->setShortcut(QKeySequence("Ctrl+T")); + sql_exec_corner_btn->setToolTip(trUtf8("Add a new execution tab for the current database (%1)").arg(sql_exec_corner_btn->shortcut().toString())); + sql_exec_tbw->setCornerWidget(sql_exec_corner_btn, Qt::TopRightCorner); + QVBoxLayout *vbox=new QVBoxLayout; sourcecode_txt=new NumberedTextEditor(sourcecode_gb); sourcecode_txt->setReadOnly(true); @@ -50,6 +58,7 @@ SQLToolWidget::SQLToolWidget(QWidget * parent) : QWidget(parent) connect(database_cmb, SIGNAL(activated(int)), this, SLOT(browseDatabase())); connect(disconnect_tb, SIGNAL(clicked()), this, SLOT(disconnectFromDatabases())); connect(source_pane_tb, SIGNAL(toggled(bool)), sourcecode_gb, SLOT(setVisible(bool))); + connect(sql_exec_corner_btn, SIGNAL(clicked(bool)), this, SLOT(addSQLExecutionTab())); connect(databases_tbw, &QTabWidget::currentChanged, [&](){ @@ -277,9 +286,13 @@ void SQLToolWidget::addSQLExecutionTab(void) try { SQLExecutionWidget *sql_exec_wgt=new SQLExecutionWidget; - DatabaseExplorerWidget *db_explorer_wgt=dynamic_cast(sender()); - Connection conn=db_explorer_wgt->getConnection(); + DatabaseExplorerWidget *db_explorer_wgt=dynamic_cast(databases_tbw->currentWidget()); + Connection conn; + + if(!db_explorer_wgt) + return; + conn = db_explorer_wgt->getConnection(); sql_exec_wgt->setConnection(conn); sql_exec_tbw->addTab(sql_exec_wgt, conn.getConnectionParam(Connection::PARAM_DB_NAME)); sql_exec_tbw->setCurrentWidget(sql_exec_wgt); diff --git a/libpgmodeler_ui/src/sqltoolwidget.h b/libpgmodeler_ui/src/sqltoolwidget.h index f471a4e624..841a352935 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.h +++ b/libpgmodeler_ui/src/sqltoolwidget.h @@ -38,6 +38,8 @@ class SQLToolWidget: public QWidget, public Ui::SQLToolWidget { private: Q_OBJECT + QToolButton *sql_exec_corner_btn; + NumberedTextEditor *sourcecode_txt; SyntaxHighlighter *sourcecode_hl; From ebbcf3dc3ed6d5dcda1de8ef7ab3ffb6fb2ae454 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 9 Sep 2018 12:08:46 -0300 Subject: [PATCH 114/425] Simplified the temp. models saving process removing the thread that was controlling it. Actually the thread was unnacessary because the process was being executed in the main thread no matter if there was another thread to control the saving. Minor adjustment on the hint text resizing. --- libpgmodeler_ui/src/constraintwidget.cpp | 4 +--- libpgmodeler_ui/src/hinttextwidget.cpp | 11 +++++++---- libpgmodeler_ui/src/mainwindow.cpp | 21 ++++++++------------- libpgmodeler_ui/src/mainwindow.h | 3 --- libpgmodeler_ui/ui/generalconfigwidget.ui | 13 ++++++++----- 5 files changed, 24 insertions(+), 28 deletions(-) diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index d123539b6c..70e1fb0a9e 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -351,11 +351,9 @@ void ConstraintWidget::selectConstraintType(void) void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Constraint *constr) { ObjectType obj_type; - unsigned count, i, row; - Column *column=nullptr; + unsigned row = 0; Table *ref_table=nullptr; vector excl_elems; - vector columns; if(!parent_obj) throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler_ui/src/hinttextwidget.cpp b/libpgmodeler_ui/src/hinttextwidget.cpp index ad689fd2d8..75682a8f6b 100644 --- a/libpgmodeler_ui/src/hinttextwidget.cpp +++ b/libpgmodeler_ui/src/hinttextwidget.cpp @@ -95,17 +95,20 @@ void HintTextWidget::setText(const QString &text) QFontMetrics f=text_lbl->fontMetrics(); QString txt=text; QRect ret; - QSize txt_size; + QSize txt_size, max_size; txt.replace(QRegExp(QString("(<)(br)(/)?(>)")), QString("\n")); txt.remove(QRegExp(QString("(<)(/)?([a-z]|[A-Z])+(>)"))); ret=f.boundingRect(0,0, this->maximumWidth(), this->maximumHeight(), Qt::TextWordWrap | Qt::AlignLeft | Qt::AlignTop , txt); txt_size=QSize(ret.size().width() + 15, ret.size().height() + 15); + max_size=txt_size; + max_size.setWidth(max_size.width() * 1.025); + max_size.setHeight(max_size.height() * 1.05); text_lbl->setMargin(5); text_lbl->setText(text); - text_lbl->setMaximumSize(txt_size); - text_lbl->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); + text_lbl->setMaximumSize(max_size); + text_lbl->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred); this->setMinimumSize(txt_size); this->adjustSize(); } @@ -129,7 +132,7 @@ QString HintTextWidget::getText(void) bool HintTextWidget::eventFilter(QObject *object, QEvent *event) { //Close the hint when it text lost its focus - if(object==text_lbl && (event->type()==QEvent::MouseButtonPress || event->type()==QEvent::FocusOut)) + if(object==text_lbl && (event->type()==QEvent::MouseButtonDblClick || event->type()==QEvent::FocusOut)) { hint_tb->setChecked(false); return(true); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index f81850c7d2..242f99ed3b 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -323,9 +323,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(model_valid_wgt, SIGNAL(s_fixApplied()), this, SLOT(removeOperations()), Qt::QueuedConnection); connect(model_valid_wgt, SIGNAL(s_graphicalObjectsUpdated()), model_objs_wgt, SLOT(updateObjectsView()), Qt::QueuedConnection); - connect(&tmpmodel_save_timer, SIGNAL(timeout()), &tmpmodel_thread, SLOT(start())); - connect(&tmpmodel_thread, SIGNAL(started()), this, SLOT(saveTemporaryModels())); - connect(&tmpmodel_thread, &QThread::started, [&](){ tmpmodel_thread.setPriority(QThread::HighPriority); }); + connect(&tmpmodel_save_timer, SIGNAL(timeout()), this, SLOT(saveTemporaryModels())); models_tbw_parent->resize(QSize(models_tbw_parent->maximumWidth(), models_tbw_parent->height())); @@ -344,9 +342,6 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par configureSamplesMenu(); applyConfigurations(); - //Temporary models are saved every five minutes - tmpmodel_save_timer.setInterval(300000); - QList actions=general_tb->actions(); QToolButton *btn=nullptr; QFont font; @@ -545,7 +540,6 @@ void MainWindow::stopTimers(bool value) { tmpmodel_save_timer.stop(); model_save_timer.stop(); - tmpmodel_thread.quit(); } else { @@ -603,7 +597,6 @@ void MainWindow::closeEvent(QCloseEvent *event) //Stops the saving timers as well the temp. model saving thread before close pgmodeler model_save_timer.stop(); tmpmodel_save_timer.stop(); - tmpmodel_thread.quit(); plugins_menu->clear(); //If not in demo version there is no confirmation before close the software @@ -765,10 +758,8 @@ void MainWindow::saveTemporaryModels(void) model=dynamic_cast(models_tbw->widget(i)); bg_saving_pb->setValue(((i+1)/static_cast(count)) * 100); - if(model->isModified() || !QFileInfo(model->getTempFilename()).exists()) + if(model->isModified() /*|| !QFileInfo(model->getTempFilename()).exists()*/) model->getDatabaseModel()->saveModel(model->getTempFilename(), SchemaParser::XML_DEFINITION); - - QThread::msleep(200); } bg_saving_pb->setValue(100); @@ -777,14 +768,14 @@ void MainWindow::saveTemporaryModels(void) QApplication::restoreOverrideCursor(); } - tmpmodel_thread.quit(); + tmpmodel_save_timer.start(); } catch(Exception &e) { QApplication::restoreOverrideCursor(); Messagebox msg_box; - tmpmodel_thread.quit(); msg_box.show(e); + tmpmodel_save_timer.start(); } #endif } @@ -1293,6 +1284,10 @@ void MainWindow::applyConfigurations(void) model_save_timer.start(); } + //Temporary models are saved every five minutes + tmpmodel_save_timer.setInterval(model_save_timer.interval() != 0 ? model_save_timer.interval()/2 : 300000); + tmpmodel_save_timer.start(); + //Force the update of all opened models count=models_tbw->count(); for(i=0; i < count; i++) diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 65a9d0bb45..6336fcb17c 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -88,9 +88,6 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { //! \brief Widget used to navigate through the opened models. ModelNavigationWidget *model_nav_wgt; - //! \brief Thread that controls temporary model file savings - QThread tmpmodel_thread; - //! \brief Timer used for auto saving the model and temporary model. QTimer model_save_timer, tmpmodel_save_timer; diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 8fe315d8e6..a32ffd9c43 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -93,7 +93,7 @@ - 200 + 210 0 @@ -182,7 +182,7 @@ - 200 + 210 0 @@ -505,7 +505,7 @@ - 200 + 210 0 @@ -638,7 +638,7 @@ - Defines the period when the opened models will be saved automatically. + Defines the period when the opened models will be saved automatically. The temporary models saving period will be defined as the half of the value defined here. If the autosave is disabled the temporary models saving will occur in a period of 5 minutes. Autosave interval (minutes): @@ -660,11 +660,14 @@ - 1 + 5 30 + + 5 + From 2589bcd2ee316e751139a0755794a57b8fa5d50e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 10 Sep 2018 17:35:23 -0300 Subject: [PATCH 115/425] When the model is loaded it is copied to the tmp models storage as a first version of the temporary dbm file. --- libpgmodeler_ui/src/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 242f99ed3b..ee6958ee5c 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -758,7 +758,7 @@ void MainWindow::saveTemporaryModels(void) model=dynamic_cast(models_tbw->widget(i)); bg_saving_pb->setValue(((i+1)/static_cast(count)) * 100); - if(model->isModified() /*|| !QFileInfo(model->getTempFilename()).exists()*/) + if(model->isModified()) model->getDatabaseModel()->saveModel(model->getTempFilename(), SchemaParser::XML_DEFINITION); } @@ -890,6 +890,9 @@ void MainWindow::addModel(const QString &filename) model_tab->db_model->setInvalidated(false); model_tab->restoreLastCanvasPosition(); + + //Making a copy of the loaded database model file as the first version of the temp. model + QFile::copy(filename, model_tab->getTempFilename()); } catch(Exception &e) { From 821db38568d5a72ef78e73c187edd6f974ff97bb Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 10 Sep 2018 17:35:41 -0300 Subject: [PATCH 116/425] Minor tooltip fix on DatabaseExplorerWidget --- libpgmodeler_ui/src/databaseexplorerwidget.cpp | 1 - libpgmodeler_ui/ui/databaseexplorerwidget.ui | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index fb15f00485..88052d63a9 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -117,7 +117,6 @@ DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) data_grid_tb->setToolTip(data_grid_tb->toolTip() + QString(" (%1)").arg(data_grid_tb->shortcut().toString())); runsql_tb->setToolTip(runsql_tb->toolTip() + QString(" (%1)").arg(runsql_tb->shortcut().toString())); - refresh_tb->setToolTip(refresh_tb->toolTip() + QString(" (%1)").arg(refresh_tb->shortcut().toString())); QAction *act = nullptr; diff --git a/libpgmodeler_ui/ui/databaseexplorerwidget.ui b/libpgmodeler_ui/ui/databaseexplorerwidget.ui index ac107cb19e..87dbacb9d4 100644 --- a/libpgmodeler_ui/ui/databaseexplorerwidget.ui +++ b/libpgmodeler_ui/ui/databaseexplorerwidget.ui @@ -163,7 +163,7 @@ true - Open a new SQL execution pane + Add a new SQL execution tab for the current database ... From e0222203504036f0e2e546bb0c11ef4bc83d42b9 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 11 Sep 2018 14:55:28 -0300 Subject: [PATCH 117/425] Improved the object duplication feature in ModelWidget --- libpgmodeler/src/table.cpp | 71 +++++++++++++++-------------- libpgmodeler/src/table.h | 10 +++- libpgmodeler_ui/src/modelwidget.cpp | 68 +++++++++++++++++++++------ libpgmodeler_ui/src/modelwidget.h | 2 +- 4 files changed, 100 insertions(+), 51 deletions(-) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 3daa505f40..8e0b962f8e 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -192,7 +192,7 @@ void Table::setRelObjectsIndexesAttribute(void) } } -void Table::setColumnsAttribute(unsigned def_type) +void Table::setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols) { QString str_cols, inh_cols; unsigned i, count; @@ -202,8 +202,8 @@ void Table::setColumnsAttribute(unsigned def_type) { /* Do not generates the column code definition when it is not included by relatoinship, in case of XML definition. */ - if((def_type==SchemaParser::SQL_DEFINITION && !columns[i]->isAddedByCopy() && !columns[i]->isAddedByGeneralization())|| - (def_type==SchemaParser::XML_DEFINITION && !columns[i]->isAddedByRelationship())) + if((def_type==SchemaParser::SQL_DEFINITION && !columns[i]->isAddedByCopy() && !columns[i]->isAddedByGeneralization()) || + (def_type==SchemaParser::XML_DEFINITION && (!columns[i]->isAddedByRelationship() || (incl_rel_added_cols && columns[i]->isAddedByRelationship())))) { str_cols+=columns[i]->getCodeDefinition(def_type); @@ -1429,44 +1429,49 @@ void Table::updateAlterCmdsStatus(void) dynamic_cast(constraints[i])->getConstraintType()!=ConstraintType::foreign_key); } -QString Table::getCodeDefinition(unsigned def_type) +QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) { - QString code_def=getCachedCode(def_type, false); - if(!code_def.isEmpty()) return(code_def); + attributes[ParsersAttributes::OIDS]=(with_oid ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::UNLOGGED]=(unlogged ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RLS_ENABLED]=(rls_enabled ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RLS_FORCED]=(rls_forced ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::COPY_TABLE]=QString(); + attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); + attributes[ParsersAttributes::TAG]=QString(); + attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::OIDS]=(with_oid ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::UNLOGGED]=(unlogged ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RLS_ENABLED]=(rls_enabled ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RLS_FORCED]=(rls_forced ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::COPY_TABLE]=QString(); - attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); - attributes[ParsersAttributes::TAG]=QString(); - attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); + if(def_type==SchemaParser::SQL_DEFINITION && copy_table) + attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); - if(def_type==SchemaParser::SQL_DEFINITION && copy_table) - attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); + if(tag && def_type==SchemaParser::XML_DEFINITION) + attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); - if(tag && def_type==SchemaParser::XML_DEFINITION) - attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); + (copy_table ? copy_table->getName(true) : QString()); - (copy_table ? copy_table->getName(true) : QString()); + setColumnsAttribute(def_type, incl_rel_added_objs); + setConstraintsAttribute(def_type); + setAncestorTableAttribute(); - setColumnsAttribute(def_type); - setConstraintsAttribute(def_type); - setAncestorTableAttribute(); + if(def_type==SchemaParser::XML_DEFINITION) + { + setRelObjectsIndexesAttribute(); + setPositionAttribute(); + setFadedOutAttribute(); + attributes[ParsersAttributes::INITIAL_DATA]=initial_data; + } + else + attributes[ParsersAttributes::INITIAL_DATA]=getInitialDataCommands(); - if(def_type==SchemaParser::XML_DEFINITION) - { - setRelObjectsIndexesAttribute(); - setPositionAttribute(); - setFadedOutAttribute(); - attributes[ParsersAttributes::INITIAL_DATA]=initial_data; - } - else - attributes[ParsersAttributes::INITIAL_DATA]=getInitialDataCommands(); + return(BaseObject::__getCodeDefinition(def_type)); +} + +QString Table::getCodeDefinition(unsigned def_type) +{ + QString code_def=getCachedCode(def_type, false); + if(!code_def.isEmpty()) return(code_def); - return(BaseObject::__getCodeDefinition(def_type)); + return(__getCodeDefinition(def_type, false)); } void Table::operator = (Table &tab) diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index f94db964e8..102a3e1863 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -85,11 +85,11 @@ class Table: public BaseTable { BaseObject *getObject(const QString &name, ObjectType obj_type, int &obj_idx); //! \brief The methods below generates the table attributes used by the SchemaParser - void setColumnsAttribute(unsigned def_type); + void setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols); void setConstraintsAttribute(unsigned def_type); void setCommentAttribute(TableObject *tab_obj); void setAncestorTableAttribute(void); - void setRelObjectsIndexesAttribute(void); + void setRelObjectsIndexesAttribute(void); protected: //! \brief Adds an ancestor table @@ -393,6 +393,12 @@ class Table: public BaseTable { In invalid columns exist in the buffer they will be rejected when generating the commands */ QString getInitialDataCommands(void); + /*! \brief Generates the table's SQL code considering adding the relationship added object or not. + * Note if the method is called with incl_rel_added_objs = true it can produce an SQL/XML code + * that does not reflect the real semantics of the table. So take care to use this method and always + * invalidate the tables code (see setCodeInvalidated()) after retrieving the resulting code */ + QString __getCodeDefinition(unsigned def_type, bool incl_rel_added_objs); + friend class Relationship; friend class OperationList; }; diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index e0d3e942de..30eeac49f6 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2263,7 +2263,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) { table=dynamic_cast(object); - for(type_id=0; type_id < 4; type_id++) + for(type_id=0; type_id <= 4; type_id++) { count=table->getObjectCount(types[type_id]); @@ -2275,12 +2275,14 @@ void ModelWidget::copyObjects(bool duplicate_mode) /* The object is only inserted at the list when it was not included by relationship but references columns added by relationship. Case the object is a constraint, it cannot be a primary key because this type of constraint is treated separetely by relationships */ - if(!tab_obj->isAddedByRelationship() && + if(duplicate_mode || + (!duplicate_mode && + !tab_obj->isAddedByRelationship() && (!constr || (((constr && (constr->getConstraintType()==ConstraintType::foreign_key || (constr->getConstraintType()==ConstraintType::unique && - constr->isReferRelationshipAddedColumn()))))))) + constr->isReferRelationshipAddedColumn())))))))) deps.push_back(tab_obj); } @@ -2317,7 +2319,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) } } -void ModelWidget::pasteObjects(void) +void ModelWidget::pasteObjects(bool duplicate_mode) { map xml_objs; BaseTable *orig_parent_tab=nullptr; @@ -2325,7 +2327,7 @@ void ModelWidget::pasteObjects(void) map orig_obj_names; BaseObject *object=nullptr, *aux_object=nullptr; TableObject *tab_obj=nullptr; - Table *sel_table=nullptr; + Table *sel_table=nullptr, *aux_table = nullptr; View *sel_view=nullptr; BaseTable *parent=nullptr; Function *func=nullptr; @@ -2467,8 +2469,18 @@ void ModelWidget::pasteObjects(void) object->getObjectType()); if(!tab_obj) + { + aux_table = dynamic_cast
(object);; + //Stores the XML definition on a xml buffer map - xml_objs[object]=object->getCodeDefinition(SchemaParser::XML_DEFINITION); + if(duplicate_mode && aux_table) + { + xml_objs[object] = aux_table->__getCodeDefinition(SchemaParser::XML_DEFINITION, true); + object->setCodeInvalidated(true); + } + else + xml_objs[object]=object->getCodeDefinition(SchemaParser::XML_DEFINITION); + } //Store the original parent table of the object else if(tab_obj && (sel_table || sel_view)) @@ -2479,21 +2491,29 @@ void ModelWidget::pasteObjects(void) parent=sel_view; /* Only generates the XML for a table object when the selected receiver object - is a table or is a view and the current object is a trigger, index, or rule (because - view's only accepts this two types) */ + * is a table or is a view and the current object is a trigger, index, or rule (because + * view's only accepts this two types) */ if(sel_table || (sel_view && (tab_obj->getObjectType()==OBJ_TRIGGER || - tab_obj->getObjectType()==OBJ_RULE || - tab_obj->getObjectType()==OBJ_INDEX))) + tab_obj->getObjectType()==OBJ_RULE || + tab_obj->getObjectType()==OBJ_INDEX))) { //Backups the original parent table orig_parent_tab=tab_obj->getParentTable(); + constr = dynamic_cast(tab_obj); + //Set the parent table as the selected table/view tab_obj->setParentTable(parent); //Generates the XML code with the new parent table - xml_objs[object]=object->getCodeDefinition(SchemaParser::XML_DEFINITION); + if(constr) + { + xml_objs[object]=constr->getCodeDefinition(SchemaParser::XML_DEFINITION, duplicate_mode); + tab_obj->setCodeInvalidated(true); + } + else + xml_objs[object]=object->getCodeDefinition(SchemaParser::XML_DEFINITION); //Restore the original parent table tab_obj->setParentTable(orig_parent_tab); @@ -2502,7 +2522,15 @@ void ModelWidget::pasteObjects(void) else if(tab_obj) { //Generates the XML code with the new parent table - xml_objs[object]=tab_obj->getCodeDefinition(SchemaParser::XML_DEFINITION); + constr = dynamic_cast(tab_obj); + + if(constr) + { + xml_objs[object]=constr->getCodeDefinition(SchemaParser::XML_DEFINITION, duplicate_mode); + tab_obj->setCodeInvalidated(true); + } + else + xml_objs[object]=tab_obj->getCodeDefinition(SchemaParser::XML_DEFINITION); } } @@ -2550,7 +2578,7 @@ void ModelWidget::pasteObjects(void) constr=dynamic_cast(tab_obj); /* Once created, the object is added on the model, except for relationships and table objects - because they are inserted automatically */ + * because they are inserted automatically */ if(object && !tab_obj && !dynamic_cast(object)) { if(db_model->getObjectIndex(object->getSignature(), object->getObjectType()) >= 0) @@ -2567,6 +2595,13 @@ void ModelWidget::pasteObjects(void) sel_table->addObject(tab_obj); sel_table->setModified(true); } + else if(constr && duplicate_mode && + constr->getConstraintType() == ConstraintType::primary_key && + constr->getParentTable()->getObjectIndex(constr) < 0) + { + constr->getParentTable()->addObject(constr); + constr->getParentTable()->setModified(true); + } //Updates the fk relationships if the constraint is a foreign-key if(constr && constr->getConstraintType()==ConstraintType::foreign_key) @@ -2657,14 +2692,17 @@ void ModelWidget::duplicateObject(void) table->setModified(true); if(obj_type == OBJ_COLUMN) - db_model->validateRelationships(); + db_model->validateRelationships(); + else if(obj_type == OBJ_CONSTRAINT && + dynamic_cast(object)->getConstraintType() == ConstraintType::foreign_key) + db_model->updateTableFKRelationships(dynamic_cast
(table)); emit s_objectCreated(); } else if(!selected_objects.empty()) { copyObjects(true); - pasteObjects(); + pasteObjects(true); } } catch(Exception &e) diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index ac387379f2..d55018242a 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -420,7 +420,7 @@ class ModelWidget: public QWidget { void copyObjects(bool duplicate_mode = false); //! \brief Paste all the objects copied previously - void pasteObjects(void); + void pasteObjects(bool duplicate_mode = false); //! \brief Duplicate the selected table object in its parent table void duplicateObject(void); From 78deea8ab286d70abc86fdea3d980bcce0dec26b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 14 Sep 2018 08:09:03 -0300 Subject: [PATCH 118/425] Fixed a bug when creating a view reference as the whole view definition (issue #1176) --- libpgmodeler/src/reference.h | 2 +- libpgmodeler_ui/src/referencewidget.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libpgmodeler/src/reference.h b/libpgmodeler/src/reference.h index 4576e5eab4..6d8985201e 100644 --- a/libpgmodeler/src/reference.h +++ b/libpgmodeler/src/reference.h @@ -62,7 +62,7 @@ class Reference { SQL_REFER_SELECT=2, SQL_REFER_FROM=4, SQL_REFER_END_EXPR=8, - SQL_VIEW_DEFINITION=15; + SQL_VIEW_DEFINITION=16; Reference(void); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 121f57a969..639953bd0d 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -23,6 +23,7 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) { setupUi(this); + ref_flags = 0; ref_alias_ht=new HintTextWidget(ref_alias_hint, this); ref_alias_ht->setText(ref_alias_edt->statusTip()); @@ -134,6 +135,8 @@ void ReferenceWidget::applyConfiguration(void) !view_def_chk->isChecked()) throw Exception(ERR_SQL_SCOPE_INV_VIEW_REF,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ref_flags = 0; + if(view_def_chk->isChecked()) ref_flags = Reference::SQL_VIEW_DEFINITION; @@ -147,7 +150,7 @@ void ReferenceWidget::applyConfiguration(void) ref_flags |= Reference::SQL_REFER_WHERE; if(end_expr_chk->isChecked()) - ref_flags |= Reference::SQL_REFER_WHERE; + ref_flags |= Reference::SQL_REFER_END_EXPR; emit s_closeRequested(); } From e10c1971e2003e408eb47a950cc20ea1842db8d6 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 14 Sep 2018 09:08:15 -0300 Subject: [PATCH 119/425] Adding a column labeled "Alias" on all objects tables in TableWidget so the aliases of children can be shown --- libpgmodeler_ui/src/tablewidget.cpp | 30 ++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 9606aa2a7e..085d6848d6 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -94,7 +94,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) connect(tab, SIGNAL(s_rowsMoved(int,int)), this, SLOT(swapObjects(int,int))); } - objects_tab_map[OBJ_COLUMN]->setColumnCount(5); + objects_tab_map[OBJ_COLUMN]->setColumnCount(6); objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("PK"), 0); objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Name"), 1); objects_tab_map[OBJ_COLUMN]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),1); @@ -102,6 +102,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) objects_tab_map[OBJ_COLUMN]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),2); objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Default Value"), 3); objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Attribute(s)"), 4); + objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Alias"), 5); objects_tab_map[OBJ_COLUMN]->adjustColumnToContents(0); connect(objects_tab_map[OBJ_COLUMN], &ObjectsTableWidget::s_cellClicked, [&](int row, int col){ @@ -118,15 +119,16 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) } }); - objects_tab_map[OBJ_CONSTRAINT]->setColumnCount(4); + objects_tab_map[OBJ_CONSTRAINT]->setColumnCount(5); objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[OBJ_CONSTRAINT]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("Type"), 1); objects_tab_map[OBJ_CONSTRAINT]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("ON DELETE"), 2); objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("ON UPDATE"), 3); + objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("Alias"), 4); - objects_tab_map[OBJ_TRIGGER]->setColumnCount(4); + objects_tab_map[OBJ_TRIGGER]->setColumnCount(5); objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[OBJ_TRIGGER]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Refer. Table"), 1); @@ -134,19 +136,22 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Firing"), 2); objects_tab_map[OBJ_TRIGGER]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("trigger")),2); objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Events"), 3); + objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Alias"), 4); - objects_tab_map[OBJ_RULE]->setColumnCount(3); + objects_tab_map[OBJ_RULE]->setColumnCount(4); objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[OBJ_RULE]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Execution"), 1); objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Event"), 2); + objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Alias"), 3); - objects_tab_map[OBJ_INDEX]->setColumnCount(2); + objects_tab_map[OBJ_INDEX]->setColumnCount(3); objects_tab_map[OBJ_INDEX]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[OBJ_INDEX]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); objects_tab_map[OBJ_INDEX]->setHeaderLabel(trUtf8("Indexing"), 1); + objects_tab_map[OBJ_INDEX]->setHeaderLabel(trUtf8("Alias"), 2); - objects_tab_map[OBJ_POLICY]->setColumnCount(6); + objects_tab_map[OBJ_POLICY]->setColumnCount(7); objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[OBJ_POLICY]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Command"), 1); @@ -156,6 +161,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("CHECK expression"), 4); objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Roles"), 5); objects_tab_map[OBJ_POLICY]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),5); + objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Alias"), 6); configureFormLayout(table_grid, OBJ_TABLE); configureTabOrder({ tag_sel }); @@ -445,6 +451,7 @@ void TableWidget::showObjectData(TableObject *object, int row) if(column->isAddedByRelationship() || (pk && pk->isAddedByRelationship())) tab->setCellDisabled(row, 0, true); + tab->setCellText(column->getAlias(), row, 5); tab->adjustColumnToContents(0); } else if(obj_type==OBJ_CONSTRAINT) @@ -467,6 +474,8 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(QString("-"),row,2); tab->setCellText(QString("-"),row,3); } + + tab->setCellText(constr->getAlias(), row, 4); } else if(obj_type==OBJ_TRIGGER) { @@ -487,7 +496,8 @@ void TableWidget::showObjectData(TableObject *object, int row) str_aux+=~events[i] + QString(", "); } str_aux.remove(str_aux.size()-2, 2); - tab->setCellText(str_aux ,row,3); + tab->setCellText(str_aux ,row,3); + tab->setCellText(trigger->getAlias(), row, 4); } else if(obj_type==OBJ_RULE) { @@ -498,6 +508,8 @@ void TableWidget::showObjectData(TableObject *object, int row) //Column 2: Rule event type tab->setCellText(~rule->getEventType(),row,2); + + tab->setCellText(rule->getAlias(), row, 3); } else if(obj_type==OBJ_INDEX) { @@ -505,6 +517,8 @@ void TableWidget::showObjectData(TableObject *object, int row) //Coluna 1: Indexing type tab->setCellText(~index->getIndexingType(),row,1); + + tab->setCellText(index->getAlias(), row, 2); } else if(obj_type==OBJ_POLICY) { @@ -529,6 +543,8 @@ void TableWidget::showObjectData(TableObject *object, int row) //Column 5: Roles tab->setCellText(!rol_names.isEmpty() ? rol_names.join(", ") : QString("PUBLIC"), row, 5); + + tab->setCellText(policy->getAlias(), row, 6); } //Changes the foreground/background color of the table row if the object is protected or added by relationship From 5f82499f91ad4e33f29bb7d06790c8a679db58c6 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 14 Sep 2018 15:17:52 -0300 Subject: [PATCH 120/425] Improved the reverse engineering performance by avoiding update relationships as they are being imported. Added an transient attribute to objects DatabaseModel, Table and View in order to give a hint on the maximum count of objects held. This attribute is used to preallocate the vectors which stores the children objects in order to avoid excessive memory allocation/deallocation due to vector resizing. --- libparsers/src/parsersattributes.cpp | 1 + libparsers/src/parsersattributes.h | 1 + libpgmodeler/src/baseobject.h | 5 ++ libpgmodeler/src/basetable.cpp | 1 + libpgmodeler/src/basetable.h | 8 +++ libpgmodeler/src/databasemodel.cpp | 69 +++++++++++++++++--- libpgmodeler/src/databasemodel.h | 16 ++++- libpgmodeler/src/operationlist.cpp | 1 + libpgmodeler/src/table.cpp | 29 ++++++++ libpgmodeler/src/table.h | 4 ++ libpgmodeler/src/view.cpp | 32 ++++++++- libpgmodeler/src/view.h | 4 ++ libpgmodeler_ui/src/databaseimporthelper.cpp | 6 ++ libpgmodeler_ui/src/modelsdiffhelper.cpp | 3 +- schemas/xml/dbmodel.sch | 4 ++ schemas/xml/dtd/dbmodel.dtd | 1 + schemas/xml/dtd/table.dtd | 1 + schemas/xml/dtd/view.dtd | 1 + schemas/xml/table.sch | 6 +- schemas/xml/view.sch | 2 +- 20 files changed, 177 insertions(+), 18 deletions(-) diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index f915eb061e..b3a5ed9b0d 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -301,6 +301,7 @@ namespace ParsersAttributes { LOOKAHEAD_CHAR=QString("lookahead-char"), MATERIALIZED=QString("materialized"), MAX_CONNECTIONS=QString("max-connections"), + MAX_OBJ_COUNT=QString("max-obj-count"), MAX_VALUE=QString("max-value"), MAXIMIZED=QString("maximized"), MEMBER_ROLES=QString("member-roles"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 84b54017bc..491dacf703 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -308,6 +308,7 @@ namespace ParsersAttributes { LOOKAHEAD_CHAR, MATERIALIZED, MAX_CONNECTIONS, + MAX_OBJ_COUNT, MAX_VALUE, MAXIMIZED, MEMBER_ROLES, diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 4d79416824..81469d9c97 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -232,6 +232,11 @@ class BaseObject { //! \brief Maximum number of characters that an object name on PostgreSQL can have static const int OBJECT_NAME_MAX_LENGTH=63; + /*! \brief The default number of objects supposed to be stored in objects list. + * This values is just a reference (hint) and is used to preallocate (reserve) space on vectors which handle objects + * to avoid excessive allocation/deallocation by resizing the vectors due to insert operation */ + static const unsigned DEF_MAX_OBJ_COUNT=20; + BaseObject(void); BaseObject(bool system_obj); virtual ~BaseObject(void){} diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 4a796acf70..a94c9f508e 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -24,6 +24,7 @@ BaseTable::BaseTable(void) obj_type=BASE_TABLE; attributes[ParsersAttributes::TAG]=QString(); attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=QString(); + attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString(); hide_ext_attribs=false; } diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index 7f4a465156..b285e47d79 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -80,6 +80,14 @@ class BaseTable: public BaseGraphicObject { virtual QString getAlterDefinition(BaseObject *object); + /*! \brief Set the initial capacity of the objects list for a optimized memory usage. + * This method should be called prior to adding the first object to the table because, depending o the capacity, + * there'll be memory reallocations which can degradate the performance */ + virtual void setObjectListsCapacity(unsigned capacity) = 0; + + //! \brief Returns the maximum item count from all of the objects lists + virtual unsigned getMaxObjectCount(void) = 0; + //! \brief Copy the attributes between two tables void operator = (BaseTable &tab); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 7198fa4416..273d644a90 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -649,18 +649,26 @@ unsigned DatabaseModel::getObjectCount(ObjectType obj_type) if(!obj_list) throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); else - return(obj_list->size()); + return(obj_list->size()); +} + +unsigned DatabaseModel::getMaxObjectCount(void) +{ + vector types = getObjectTypes(false, {OBJ_DATABASE}); + unsigned count = 0, max = 0; + + for(auto &type : types) + { + count = getObjectList(type)->size(); + if(count > max) max = count; + } + + return(max); } unsigned DatabaseModel::getObjectCount(void) { - vector types={ - BASE_RELATIONSHIP,OBJ_RELATIONSHIP, OBJ_TABLE, OBJ_VIEW, - OBJ_AGGREGATE, OBJ_OPERATOR, OBJ_SEQUENCE, OBJ_CONVERSION, - OBJ_CAST, OBJ_OPFAMILY, OBJ_OPCLASS, OBJ_TEXTBOX, OBJ_DOMAIN, - OBJ_TYPE, OBJ_FUNCTION, OBJ_SCHEMA, OBJ_LANGUAGE, OBJ_TABLESPACE, - OBJ_ROLE, OBJ_PERMISSION, OBJ_COLLATION, OBJ_EXTENSION, OBJ_TAG, - OBJ_EVENT_TRIGGER, OBJ_GENERIC_SQL}; + vector types= getObjectTypes(false, {OBJ_DATABASE}); unsigned count=0; for(auto &type : types) @@ -2979,6 +2987,8 @@ void DatabaseModel::loadModel(const QString &filename) //Gets the basic model information xmlparser.getElementAttributes(attribs); + setObjectListsCapacity(attribs[ParsersAttributes::MAX_OBJ_COUNT].toUInt()); + this->author=attribs[ParsersAttributes::MODEL_AUTHOR]; pos_str=attribs[ParsersAttributes::LAST_POSITION].split(','); @@ -3347,6 +3357,46 @@ QString DatabaseModel::getErrorExtraInfo(void) return extra_info; } +void DatabaseModel::setLoadingModel(bool value) +{ + loading_model = value; +} + +void DatabaseModel::setObjectListsCapacity(unsigned capacity) +{ + if(capacity < BaseObject::DEF_MAX_OBJ_COUNT || + capacity > (BaseObject::DEF_MAX_OBJ_COUNT * 1000)) + capacity = BaseObject::DEF_MAX_OBJ_COUNT; + + unsigned half_cap = capacity/2, one_fourth_cap = capacity/4; + + views.reserve(capacity); + tables.reserve(capacity); + relationships.reserve(capacity); + base_relationships.reserve(capacity); + sequences.reserve(capacity); + permissions.reserve(capacity); + schemas.reserve(half_cap); + roles.reserve(half_cap); + functions.reserve(half_cap); + types.reserve(half_cap); + textboxes.reserve(half_cap); + aggregates.reserve(half_cap); + operators.reserve(half_cap); + op_classes.reserve(half_cap); + op_families.reserve(half_cap); + domains.reserve(half_cap); + collations.reserve(half_cap); + extensions.reserve(half_cap); + tags.reserve(half_cap); + genericsqls.reserve(half_cap); + tablespaces.reserve(one_fourth_cap); + languages.reserve(one_fourth_cap); + casts.reserve(one_fourth_cap); + conversions.reserve(one_fourth_cap); + eventtriggers.reserve(one_fourth_cap); +} + void DatabaseModel::setLastPosition(const QPoint &pnt) { last_pos=pnt; @@ -4594,6 +4644,7 @@ Table *DatabaseModel::createTable(void) setBasicAttributes(table); xmlparser.getElementAttributes(attribs); + table->setObjectListsCapacity(attribs[ParsersAttributes::MAX_OBJ_COUNT].toUInt()); table->setWithOIDs(attribs[ParsersAttributes::OIDS]==ParsersAttributes::_TRUE_); table->setUnlogged(attribs[ParsersAttributes::UNLOGGED]==ParsersAttributes::_TRUE_); table->setRLSEnabled(attribs[ParsersAttributes::RLS_ENABLED]==ParsersAttributes::_TRUE_); @@ -5736,6 +5787,7 @@ View *DatabaseModel::createView(void) setBasicAttributes(view); xmlparser.getElementAttributes(attribs); + view->setObjectListsCapacity(attribs[ParsersAttributes::MAX_OBJ_COUNT].toUInt()); view->setMaterialized(attribs[ParsersAttributes::MATERIALIZED]==ParsersAttributes::_TRUE_); view->setRecursive(attribs[ParsersAttributes::RECURSIVE]==ParsersAttributes::_TRUE_); view->setWithNoData(attribs[ParsersAttributes::WITH_NO_DATA]==ParsersAttributes::_TRUE_); @@ -6757,6 +6809,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) if(def_type==SchemaParser::XML_DEFINITION) { + attribs_aux[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); attribs_aux[ParsersAttributes::PROTECTED]=(this->is_protected ? ParsersAttributes::_TRUE_ : QString()); attribs_aux[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs_aux[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index c44ae50773..53152eb4ff 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -169,6 +169,16 @@ class DatabaseModel: public QObject, public BaseObject { //! \brief Returns extra error info when loading database models QString getErrorExtraInfo(void); + /*! \brief This method forces the indication that the model is being loaded or not by setting the attribute loading_model. + * The attribute loading_model causes the model perform certain operations only when model starts/ends the loading process, + * for instance, if loading_model = true graphical objects will be rendered only when the loading process finishes (loading_model =false) + * otherwise the objects are rendered as they are added to the model. The drawback of this approach is, depending on the operation being used after + * calling this method, the user is obligated to call the methdo setObjectsModified() to force the graphical objects rendering. */ + void setLoadingModel(bool value); + + //! \brief Set the initial capacity of the objects list for a optimized memory usage + void setObjectListsCapacity(unsigned capacity); + public: static const unsigned META_DB_ATTRIBUTES=1, //! \brief Handle database model attribute when save/load metadata file META_OBJS_POSITIONING=2, //! \brief Handle objects' positioning when save/load metadata file @@ -282,9 +292,11 @@ class DatabaseModel: public QObject, public BaseObject { //! \brief Returns the object count for the specified type unsigned getObjectCount(ObjectType obj_type); - //! \brief Returns the object count for all object types + //! \brief Returns the object count for all object types. unsigned getObjectCount(void); + unsigned getMaxObjectCount(void); + //! \brief Retuns the specified localization value QString getLocalization(unsigned localiz_id); @@ -619,6 +631,8 @@ class DatabaseModel: public QObject, public BaseObject { //! \brief Signal emitted when an object is created from a xml code void s_objectLoaded(int progress, QString object_id, unsigned obj_type); + + friend class DatabaseImportHelper; }; #endif diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index edfb742101..0736878c85 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -32,6 +32,7 @@ OperationList::OperationList(DatabaseModel *model) current_index=0; next_op_chain=Operation::NO_CHAIN; ignore_chain=false; + operations.reserve(max_size); } OperationList::~OperationList(void) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 8e0b962f8e..150dd4fd1c 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1459,6 +1459,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) setPositionAttribute(); setFadedOutAttribute(); attributes[ParsersAttributes::INITIAL_DATA]=initial_data; + attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); } else attributes[ParsersAttributes::INITIAL_DATA]=getInitialDataCommands(); @@ -1844,3 +1845,31 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi return(fmt_cmd); } + +void Table::setObjectListsCapacity(unsigned capacity) +{ + if(capacity < DEF_MAX_OBJ_COUNT || capacity > DEF_MAX_OBJ_COUNT * 10) + capacity = DEF_MAX_OBJ_COUNT; + + columns.reserve(capacity); + constraints.reserve(capacity/2); + indexes.reserve(capacity/2); + rules.reserve(capacity/2); + triggers.reserve(capacity/2); + policies.reserve(capacity/2); +} + +unsigned Table::getMaxObjectCount(void) +{ + unsigned count = 0, max = 0; + vector types = { OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_INDEX, + OBJ_RULE, OBJ_TRIGGER, OBJ_POLICY }; + + for(auto type : types) + { + count = getObjectList(type)->size(); + if(count > max) max = count; + } + + return(max); +} diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 102a3e1863..1c1ce62448 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -399,6 +399,10 @@ class Table: public BaseTable { * invalidate the tables code (see setCodeInvalidated()) after retrieving the resulting code */ QString __getCodeDefinition(unsigned def_type, bool incl_rel_added_objs); + void setObjectListsCapacity(unsigned capacity); + + unsigned getMaxObjectCount(void); + friend class Relationship; friend class OperationList; }; diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 39d2442271..ea26fc0402 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -37,10 +37,10 @@ View::View(void) : BaseTable() View::~View(void) { - ObjectType types[]={ OBJ_TRIGGER, OBJ_RULE }; + ObjectType types[]={ OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX }; vector *list=nullptr; - for(unsigned i=0; i < 2; i++) + for(unsigned i=0; i < 3; i++) { list=getObjectList(types[i]); while(!list->empty()) @@ -596,6 +596,7 @@ QString View::getCodeDefinition(unsigned def_type) setPositionAttribute(); setFadedOutAttribute(); setReferencesAttribute(); + attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); } return(BaseObject::__getCodeDefinition(def_type)); @@ -604,7 +605,32 @@ QString View::getCodeDefinition(unsigned def_type) void View::setSQLObjectAttribute(void) { if(materialized) - attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(OBJ_VIEW); + attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(OBJ_VIEW); +} + +void View::setObjectListsCapacity(unsigned capacity) +{ + if(capacity < DEF_MAX_OBJ_COUNT || capacity > DEF_MAX_OBJ_COUNT * 10) + capacity = DEF_MAX_OBJ_COUNT; + + references.reserve(capacity); + indexes.reserve(capacity/2); + rules.reserve(capacity/2); + triggers.reserve(capacity/2); +} + +unsigned View::getMaxObjectCount(void) +{ + unsigned count = 0, max = references.size(); + vector types = { OBJ_INDEX, OBJ_RULE, OBJ_TRIGGER }; + + for(auto type : types) + { + count = getObjectList(type)->size(); + if(count > max) max = count; + } + + return(max); } QString View::getDropDefinition(bool cascade) diff --git a/libpgmodeler/src/view.h b/libpgmodeler/src/view.h index 8c0547a5e8..d9d8316159 100644 --- a/libpgmodeler/src/view.h +++ b/libpgmodeler/src/view.h @@ -234,6 +234,10 @@ class View: public BaseTable { //! \brief Returns if the view has an reference expression that is used as view definition bool hasDefinitionExpression(void); + void setObjectListsCapacity(unsigned capacity); + + unsigned getMaxObjectCount(void); + //! \brief Copy the attributes between two views void operator = (View &visao); }; diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 931053c2ca..1b2081944e 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -547,6 +547,9 @@ void DatabaseImportHelper::importDatabase(void) if(!dbmodel) throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + dbmodel->setLoadingModel(true); + dbmodel->setObjectListsCapacity(creation_order.size()); + retrieveSystemObjects(); retrieveUserObjects(); createObjects(); @@ -597,6 +600,8 @@ void DatabaseImportHelper::importDatabase(void) else emit s_importCanceled(); + dbmodel->setLoadingModel(false); + if(!import_canceled) { //Generating random colors for relationships @@ -1653,6 +1658,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) itr=itr1=columns[attribs[ParsersAttributes::OID].toUInt()].begin(); itr_end=columns[attribs[ParsersAttributes::OID].toUInt()].end(); + attribs[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(columns[attribs[ParsersAttributes::OID].toUInt()].size()); //Creating columns while(itr!=itr_end) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index fb2f6fe164..351a87a5da 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -303,7 +303,8 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) //If the objects does not differ, try to compare their XML definition if(!objs_differs) xml_differs=object->isCodeDiffersFrom(aux_object, - { ParsersAttributes::PROTECTED, + { ParsersAttributes::MAX_OBJ_COUNT, + ParsersAttributes::PROTECTED, ParsersAttributes::SQL_DISABLED, ParsersAttributes::RECT_VISIBLE, ParsersAttributes::FILL_COLOR, diff --git a/schemas/xml/dbmodel.sch b/schemas/xml/dbmodel.sch index bfbd95f773..930f513c51 100644 --- a/schemas/xml/dbmodel.sch +++ b/schemas/xml/dbmodel.sch @@ -21,6 +21,10 @@ %if {last-zoom} %then [ last-zoom=] "{last-zoom}" %end + + %if {max-obj-count} %then + [ max-obj-count=] "{max-obj-count}" + %end %if {default-schema} %or {default-owner} %then $br $tb diff --git a/schemas/xml/dtd/dbmodel.dtd b/schemas/xml/dtd/dbmodel.dtd index 32c45743a1..1f84c56544 100644 --- a/schemas/xml/dtd/dbmodel.dtd +++ b/schemas/xml/dtd/dbmodel.dtd @@ -78,3 +78,4 @@ + diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 5e751a70a1..62771ba2c0 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -23,3 +23,4 @@ + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 3bb34066ba..14fb7e1ea0 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -12,6 +12,7 @@ + diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index 325d351bd3..652ea356fc 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -3,10 +3,7 @@ # Code generation can be broken if incorrect changes are made. [
$br {schema} diff --git a/schemas/xml/view.sch b/schemas/xml/view.sch index aa1b609d17..097c2c9da7 100644 --- a/schemas/xml/view.sch +++ b/schemas/xml/view.sch @@ -14,7 +14,7 @@ %if {sql-disabled} %then [ sql-disabled=] "true" %end %if {hide-ext-attribs} %then [ hide-ext-attribs=] "true" %end %if {faded-out} %then [ faded-out=] "true" %end - + %if {max-obj-count} %then [ max-obj-count=] "{max-obj-count}" %end > $br {schema} From 95e868db76f6690a0891426235fe3c4228b9c7be Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 14 Sep 2018 15:33:19 -0300 Subject: [PATCH 121/425] Fixed a minor bug that was preventing the copy action to be enabled in DataManipulationForm --- libpgmodeler_ui/src/datamanipulationform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index f307606d5f..c1d54b5233 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -439,7 +439,7 @@ void DataManipulationForm::enableRowControlButtons(void) delete_tb->setEnabled(cols_selected); duplicate_tb->setEnabled(cols_selected); - copy_tb->setEnabled(sel_ranges.count() == 1); + copy_tb->setEnabled(sel_ranges.count() != 0); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && table_cmb->currentData().toUInt() == OBJ_TABLE && !col_names.isEmpty()); From 2cca3a14a5d2a153e610e36cc42569bae81e3084 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 17 Sep 2018 15:02:22 -0300 Subject: [PATCH 122/425] Added support to hide columns on data manipulation dialog --- libpgmodeler_ui/src/datamanipulationform.cpp | 76 +- libpgmodeler_ui/src/datamanipulationform.h | 6 + libpgmodeler_ui/ui/datamanipulationform.ui | 732 +++++++++++-------- 3 files changed, 496 insertions(+), 318 deletions(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index c1d54b5233..f56b6df9e2 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -86,7 +86,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): //Forcing the splitter that handles the bottom widgets to resize its children to their minimum size h_splitter->setSizes({500, 250, 500}); - v_splitter->setVisible(false); + filter_tbw->setVisible(false); csv_load_parent->setVisible(false); csv_load_wgt = new CsvLoadWidget(this, false); @@ -102,7 +102,25 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): paste_tb->setEnabled(false); }); - connect(csv_load_tb, SIGNAL(toggled(bool)), csv_load_parent, SLOT(setVisible(bool))); + connect(columns_lst, &QListWidget::itemDoubleClicked, [&](QListWidgetItem *item){ + if(item->checkState() == Qt::Checked) + item->setCheckState(Qt::Unchecked); + else + item->setCheckState(Qt::Checked); + + toggleColumnDisplay(item); + }); + + connect(select_all_tb, &QToolButton::clicked, [&](){ + setColumnsCheckState(Qt::Checked); + }); + + connect(clear_all_tb, &QToolButton::clicked, [&](){ + setColumnsCheckState(Qt::Unchecked); + }); + + connect(columns_lst, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(toggleColumnDisplay(QListWidgetItem*))); + connect(csv_load_tb, SIGNAL(toggled(bool)), csv_load_parent, SLOT(setVisible(bool))); connect(close_btn, SIGNAL(clicked()), this, SLOT(reject())); connect(schema_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(listTables())); connect(hide_views_chk, SIGNAL(toggled(bool)), this, SLOT(listTables())); @@ -125,7 +143,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): connect(ord_columns_lst, SIGNAL(currentRowChanged(int)), this, SLOT(enableColumnControlButtons())); connect(move_down_tb, SIGNAL(clicked()), this, SLOT(swapColumns())); connect(move_up_tb, SIGNAL(clicked()), this, SLOT(swapColumns())); - connect(filter_tb, SIGNAL(toggled(bool)), v_splitter, SLOT(setVisible(bool))); + connect(filter_tb, SIGNAL(toggled(bool)), filter_tbw, SLOT(setVisible(bool))); connect(truncate_tb, SIGNAL(clicked(bool)), this, SLOT(truncateTable())); connect(bulkedit_tb, &QToolButton::clicked, [&](){ @@ -397,6 +415,22 @@ void DataManipulationForm::retrieveData(void) code_compl_wgt->clearCustomItems(); code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), OBJ_COLUMN); + + columns_lst->clear(); + QListWidgetItem *item = nullptr; + + for(auto &col : col_names) + { + columns_lst->addItem(col); + item = columns_lst->item(columns_lst->count() - 1); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setCheckState(Qt::Checked); + item->setData(Qt::UserRole, item->checkState()); + } + + //Restoring the visibily of the columns + for(int idx = 0; idx < results_tbw->horizontalHeader()->count(); idx++) + results_tbw->horizontalHeader()->setSectionHidden(idx, false); } catch(Exception &e) { @@ -1428,6 +1462,22 @@ void DataManipulationForm::closeEvent(QCloseEvent *) GeneralConfigWidget::saveWidgetGeometry(this); } +void DataManipulationForm::setColumnsCheckState(Qt::CheckState state) +{ + QListWidgetItem *item = nullptr; + + results_tbw->blockSignals(true); + + for(int idx = 0; idx < columns_lst->count(); idx++) + { + item = columns_lst->item(idx); + item->setCheckState(state); + toggleColumnDisplay(item); + } + + results_tbw->blockSignals(false); +} + void DataManipulationForm::truncateTable(void) { try @@ -1442,5 +1492,23 @@ void DataManipulationForm::truncateTable(void) { Messagebox msg_box; msg_box.show(e); - } + } +} + +void DataManipulationForm::toggleColumnDisplay(QListWidgetItem *item) +{ + if(!item) + return; + + if(item->checkState() != static_cast(item->data(Qt::UserRole).toInt())) + { + int idx = 0; + bool hide = false; + + idx = col_names.indexOf(item->text()); + hide = item->checkState() == Qt::Unchecked; + results_tbw->horizontalHeader()->setSectionHidden(idx, hide); + item->setCheckState(hide ? Qt::Unchecked : Qt::Checked); + item->setData(Qt::UserRole, item->checkState()); + } } diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index adf9672ea9..78799762b9 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -103,8 +103,11 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { void browseTable(const QString &fk_name, bool browse_ref_tab); void resizeEvent(QResizeEvent *event); + void closeEvent(QCloseEvent *); + void setColumnsCheckState(Qt::CheckState state); + public: DataManipulationForm(QWidget * parent = 0, Qt::WindowFlags f = 0); @@ -184,6 +187,9 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { //! \brief Truncates the browsed table void truncateTable(void); + + //! \brief Display or hides a column when the related item is interacted in the column list at filter section + void toggleColumnDisplay(QListWidgetItem *item); }; #endif diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index 4caea69908..725d9366e3 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -6,7 +6,7 @@ 0 0 - 758 + 961 600 @@ -268,18 +268,15 @@ false - - - Qt::Vertical - - - false + + + 0 - - - Filter expression - - + + + Filter + + 4 @@ -293,28 +290,407 @@ 4 - - - - 0 - 0 - + + + Qt::Vertical - - - 0 - 0 - + + false + + + Expression + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + Order && Limit + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Add Item + + + + + + + :/icones/icones/adicionar.png:/icones/icones/adicionar.png + + + + 20 + 20 + + + + Ins + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Remove Item + + + + + + + :/icones/icones/remover.png:/icones/icones/remover.png + + + + 20 + 20 + + + + Del + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Clear the order by columns list + + + + + + + :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png + + + + 20 + 20 + + + + Del + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Move selected item up + + + + + + + :/icones/icones/movercima.png:/icones/icones/movercima.png + + + + 20 + 20 + + + + Del + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Move selected item down + + + + + + + :/icones/icones/moverbaixo.png:/icones/icones/moverbaixo.png + + + + 20 + 20 + + + + Del + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + 0 + + + 1000000 + + + 50 + + + 1000 + + + + + + + + 0 + 0 + + + + Column: + + + + + + + + 0 + 0 + + + + results (Use <strong>0</strong> for no limit) + + + + + + + Limit in: + + + + + + + + + + 0 + 0 + + + + QComboBox::InsertAlphabetically + + + + + + + + 0 + 0 + + + + ASC + + + true + + + + + + + + 0 + 0 + + + + DESC + + + + + + + - - - Order && Limit - - + + + Columns + + 4 @@ -327,229 +703,58 @@ 4 - - - - - 0 - 0 - - - + + - - + + - + Qt::Horizontal - 40 + 58 20 - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Add Item - - - - - - - :/icones/icones/adicionar.png:/icones/icones/adicionar.png - - - - 20 - 20 - - - - Ins - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Remove Item - - - - - - - :/icones/icones/remover.png:/icones/icones/remover.png - - - - 20 - 20 - - - - Del - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Clear the order by columns list - - - - - - - :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png - - - - 20 - 20 - - - - Del - - - - - - - false - + - + 0 0 - - - 0 - 0 - - - - Move selected item up - - - - - - :/icones/icones/movercima.png:/icones/icones/movercima.png - - - - 20 - 20 - - - - Del + Select all - - - false - + - + 0 0 - - - 0 - 0 - - - - Move selected item down - - - - - - :/icones/icones/moverbaixo.png:/icones/icones/moverbaixo.png - - - - 20 - 20 - - - - Del + Clear all - + Qt::Horizontal - 40 + 58 20 @@ -557,107 +762,6 @@ - - - - - 0 - 0 - - - - 0 - - - 1000000 - - - 50 - - - 1000 - - - - - - - - 0 - 0 - - - - Column: - - - - - - - - 0 - 0 - - - - results (Use <strong>0</strong> for no limit) - - - - - - - Limit in: - - - - - - - - - - 0 - 0 - - - - QComboBox::InsertAlphabetically - - - - - - - - 0 - 0 - - - - ASC - - - true - - - - - - - - 0 - 0 - - - - DESC - - - - - From 2b8abb68fd4fdd85976ff0fa7a510a88bda682c8 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 19 Sep 2018 17:25:21 -0300 Subject: [PATCH 123/425] Created the relationship type BaseRelationship::RELATIONSHIP_PART to identify partitioning relationships Created the class PartitioningType to identify the type of partitionin used by the partitioned tables Improved the column copying and validation on class Relationship to include partitioning relatinoship logic --- libpgmodeler/src/baserelationship.cpp | 2 +- libpgmodeler/src/baserelationship.h | 3 +- libpgmodeler/src/pgsqltypes.cpp | 46 ++- libpgmodeler/src/pgsqltypes.h | 21 +- libpgmodeler/src/relationship.cpp | 111 ++++++-- libpgmodeler/src/relationship.h | 2 +- libpgmodeler/src/table.cpp | 31 +- libpgmodeler/src/table.h | 23 +- libutils/src/exception.cpp | 6 +- libutils/src/exception.h | 8 +- .../partrelationshiptest.cpp | 269 ++++++++++++++++++ .../partrelationshiptest.pro | 2 + tests/tests.pro | 1 + 13 files changed, 481 insertions(+), 44 deletions(-) create mode 100644 tests/src/partrelationshiptest/partrelationshiptest.cpp create mode 100644 tests/src/partrelationshiptest/partrelationshiptest.pro diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 325df69657..1f19c452cd 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -129,7 +129,7 @@ void BaseRelationship::configureRelationship(void) and the source and destination table are the same. */ if((rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_DEP) && src_table==dst_table) - throw Exception(ERR_INV_INH_COPY_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ERR_INV_INH_COPY_PART_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Allocates the textbox for the name label lables[REL_NAME_LABEL]=new Textbox; diff --git a/libpgmodeler/src/baserelationship.h b/libpgmodeler/src/baserelationship.h index d26cee1e74..a1c702b1a6 100644 --- a/libpgmodeler/src/baserelationship.h +++ b/libpgmodeler/src/baserelationship.h @@ -99,7 +99,8 @@ class BaseRelationship: public BaseGraphicObject { RELATIONSHIP_NN=12, //! \brief Many to many RELATIONSHIP_GEN=13, //! \brief Generalization (Inheritance) RELATIONSHIP_DEP=14, //! \brief Dependency (table-view) / Copy (table-table) - RELATIONSHIP_FK=15; //! \brief Relationship generated by creating a foreign key manually on a table + RELATIONSHIP_PART=15,//! \brief Partitioning relationship + RELATIONSHIP_FK=16; //! \brief Relationship generated by creating a foreign key manually on a table //! \brief Constats used to reference the relationship labels static const unsigned SRC_CARD_LABEL=0, diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 745cea71cd..8052b47ab0 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -241,7 +241,13 @@ QString BaseType::type_list[types_count]= "SELECT", "INSERT", "DELETE", - "UPDATE" + "UPDATE", + + //Types used by the class PartitioningType + //offsets 258 to 260 + "RANGE", + "LIST", + "HASH", }; BaseType::BaseType(void) @@ -2195,3 +2201,41 @@ unsigned PolicyCmdType::operator = (const QString &type_name) return(type_id); } +/*************************** + * CLASS: PartitioningType * + ***************************/ +PartitioningType::PartitioningType(void) +{ + type_idx=offset; +} + +PartitioningType::PartitioningType(unsigned type_id) +{ + (*this)=type_id; +} + +PartitioningType::PartitioningType(const QString &type_name) +{ + (*this)=type_name; +} + +void PartitioningType::getTypes(QStringList &tipos) +{ + BaseType::getTypes(tipos,offset,types_count); +} + +unsigned PartitioningType::operator = (unsigned type_id) +{ + BaseType::setType(type_id,offset,types_count); + return(type_idx); +} + +unsigned PartitioningType::operator = (const QString &type_name) +{ + unsigned type_id; + + type_id=BaseType::getType(type_name, offset, types_count); + BaseType::setType(type_id,offset,types_count); + return(type_id); +} + diff --git a/libpgmodeler/src/pgsqltypes.h b/libpgmodeler/src/pgsqltypes.h index 8649a5e97f..b30200eb7a 100644 --- a/libpgmodeler/src/pgsqltypes.h +++ b/libpgmodeler/src/pgsqltypes.h @@ -33,7 +33,7 @@ class BaseType{ protected: - static const unsigned types_count=258; + static const unsigned types_count=261; static QString type_list[types_count]; //! \brief Index of the type on the type_list vector @@ -746,4 +746,23 @@ class PolicyCmdType: public BaseType { unsigned operator = (const QString &type_name); }; +class PartitioningType: public BaseType { + private: + static const unsigned offset=258; + static const unsigned types_count=3; + + public: + static const unsigned range=offset; + static const unsigned list=offset+1; + static const unsigned hash=offset+2; + + PartitioningType(const QString &type_name); + PartitioningType(unsigned type_id); + PartitioningType(void); + + static void getTypes(QStringList&type_list); + unsigned operator = (unsigned type_id); + unsigned operator = (const QString &type_name); +}; + #endif diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 897ffdb79e..89711ed929 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -89,6 +89,8 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, str_aux=QApplication::translate("Relationship","many_%1_has_many_%2",""); else if(rel_type==RELATIONSHIP_GEN) str_aux=QApplication::translate("Relationship","%1_inherits_%2",""); + else if(rel_type==RELATIONSHIP_PART) + str_aux=QApplication::translate("Relationship","%1_is_partition_of_%2",""); else str_aux=QApplication::translate("Relationship","%1_copies_%2",""); @@ -806,7 +808,7 @@ void Relationship::addConstraints(Table *recv_tab) } } -void Relationship::addColumnsRelGen(void) +void Relationship::addColumnsRelGenPart(void) { Table *src_tab=nullptr, *dst_tab=nullptr, *parent_tab=nullptr, *aux_tab=nullptr; @@ -830,12 +832,29 @@ void Relationship::addColumnsRelGen(void) { src_tab=dynamic_cast
(src_table); dst_tab=dynamic_cast
(dst_table); - + //Gets the column count from participant tables src_count=src_tab->getColumnCount(); dst_count=dst_tab->getColumnCount(); rejected_col_count=0; + /* If the relationship is partitioning the destination table (partitioned) shoud have + * a partitioning type defined otherwise and error is raised */ + if(rel_type == RELATIONSHIP_PART && dst_tab->getPartitioningType() == PartitioningType::null) + throw Exception(Exception::getErrorMessage(ERR_INV_PARTITIONIG_TYPE_PART_REL) + .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), + ERR_INV_PARTITIONIG_TYPE_PART_REL, __PRETTY_FUNCTION__,__FILE__,__LINE__); + + /* If the relationship is partitioning the source table (partition) should be empty + * or at least have the same number of columns of the destination table (partitioned), + * otherwise an exception is raised. */ + if(rel_type == RELATIONSHIP_PART && src_count > 0 && src_count != dst_count) + { + throw Exception(Exception::getErrorMessage(ERR_INV_COLUMN_COUNT_PART_REL) + .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), + ERR_INV_COLUMN_COUNT_PART_REL, __PRETTY_FUNCTION__,__FILE__,__LINE__); + } + /* This for compares the columns of the receiver table with the columns of the reference table in order to resolve the conflicting names */ @@ -920,7 +939,7 @@ void Relationship::addColumnsRelGen(void) parent_tab=aux_tab->getCopyTable(); cond=(parent_tab && aux_col->getParentTable()==parent_tab && - aux_col->isAddedByGeneralization()); + aux_col->isAddedByCopy()); } if(id_tab==0) @@ -934,7 +953,7 @@ void Relationship::addColumnsRelGen(void) column is from the table itself or it came from a copy table and the destination column is from the destination table or came from a copy table of the destination table itself */ - if(rel_type==RELATIONSHIP_DEP && + if((rel_type==RELATIONSHIP_DEP) && ((!src_flags[0] && !src_flags[1]) || (!src_flags[0] && src_flags[1])) && @@ -945,13 +964,18 @@ void Relationship::addColumnsRelGen(void) err_type=ERR_DUPLIC_COLS_COPY_REL; } /* Error condition 2: The relationship type is generalization and the column - types is incompatible */ - else if(rel_type==RELATIONSHIP_GEN && - src_type!=dst_type) + * types is incompatible */ + else if((rel_type == RELATIONSHIP_GEN || rel_type==RELATIONSHIP_PART) && src_type != dst_type) err_type=ERR_INCOMP_COLS_INHERIT_REL; } } + /* In partition relationships, raises an error if the currently evaluated column from + * source table (partition) does not exist in the destination table (partitioned) because + * both tables should have the same columns */ + if(src_count > 0 && !duplic && rel_type == RELATIONSHIP_PART) + err_type = ERR_INV_COLUMN_COUNT_PART_REL; + //In case that no error was detected (ERR_CUSTOM) if(err_type==ERR_CUSTOM) { @@ -964,9 +988,7 @@ void Relationship::addColumnsRelGen(void) (*column)=(*dst_col); if(rel_type==RELATIONSHIP_GEN) - { column->setAddedByGeneralization(true); - } else column->setAddedByCopy(true); @@ -1025,17 +1047,23 @@ void Relationship::addColumnsRelGen(void) if(err_type==ERR_DUPLIC_COLS_COPY_REL) { msg=QString(str_aux) - .arg(dst_col->getName()) - .arg(dst_tab->getName()) - .arg(src_tab->getName()); + .arg(dst_col->getName(true)) + .arg(dst_tab->getName(true)) + .arg(src_tab->getName(true)); + } + else if(err_type==ERR_INV_COLUMN_COUNT_PART_REL) + { + msg=QString(str_aux) + .arg(src_tab->getName(true)) + .arg(dst_tab->getName(true)); } else { msg=QString(str_aux) - .arg(dst_col->getName()) - .arg(dst_tab->getName()) - .arg(src_col->getName()) - .arg(src_tab->getName()); + .arg(dst_col->getName(true)) + .arg(dst_tab->getName(true)) + .arg(src_col->getName(true)) + .arg(src_tab->getName(true)); } throw Exception(msg, err_type,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1110,7 +1138,7 @@ void Relationship::connectRelationship(void) addConstraintsRelGen(); //Creates the columns on the receiver table following the rules for generalization rules - addColumnsRelGen(); + addColumnsRelGenPart(); //The reference table is added as parent table on the receiver getReceiverTable()->addAncestorTable(dynamic_cast
(getReferenceTable())); @@ -1118,12 +1146,18 @@ void Relationship::connectRelationship(void) else if(rel_type==RELATIONSHIP_DEP) { //Creates the columns on the receiver table following the rules for copy rules - addColumnsRelGen(); + addColumnsRelGenPart(); //The reference table is added as copy table on the receiver getReceiverTable()->setCopyTable(dynamic_cast
(getReferenceTable())); getReceiverTable()->setCopyTableOptions(this->copy_options); } + else if(rel_type == RELATIONSHIP_PART) + { + //Creates the columns on the receiver table following the rules for copy rules + addColumnsRelGenPart(); + getReceiverTable()->setPartionedTable(dynamic_cast
(getReferenceTable())); + } else if(rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N) { @@ -1862,7 +1896,8 @@ Table *Relationship::getReceiverTable(void) /* For generalization / copy relationships the columns are always added in the source table */ else if(rel_type==RELATIONSHIP_GEN || - rel_type==RELATIONSHIP_DEP) + rel_type==RELATIONSHIP_DEP || + rel_type==RELATIONSHIP_PART) return(dynamic_cast
(src_table)); //For n-n relationships, the columns are added in the table that represents the relationship (table_relnn) else @@ -2226,8 +2261,8 @@ bool Relationship::isInvalidated(void) Table *table=nullptr, *table1=nullptr; Constraint *fk=nullptr, *fk1=nullptr, *constr=nullptr, *pk=nullptr; bool valid=false; - Column *rel_pk_col=nullptr, *gen_col=nullptr, *pk_col=nullptr; - QString col_name, col_alias; + Column *rel_pk_col=nullptr, *gen_col=nullptr, *col_aux=nullptr, *col_aux1 = nullptr, *pk_col=nullptr; + QString col_name; if(invalidated) { @@ -2298,7 +2333,7 @@ bool Relationship::isInvalidated(void) obtained directly from the primary key */ col_name=generateObjectName(SRC_COL_PATTERN, rel_pk_col); valid=(rel_pk_col==pk_col && - (gen_col->getName()==col_name || gen_col->getName().contains(pk_col->getName())) && + (gen_col->getName()==col_name ||gen_col->getName().contains(pk_col->getName())) && (rel_pk_col->getType()==gen_col->getType() || (rel_pk_col->getType()==QString("serial") && gen_col->getType()==QString("integer")) || (rel_pk_col->getType()==QString("bigserial") && gen_col->getType()==QString("bigint")) || @@ -2309,7 +2344,7 @@ bool Relationship::isInvalidated(void) /* For copy / generalization relationships, is obtained the number of columns created when connecting it and comparing with the number of columns of the source table */ - else if(rel_type==RELATIONSHIP_DEP || rel_type==RELATIONSHIP_GEN) + else if(rel_type==RELATIONSHIP_DEP || rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_PART) { table=getReferenceTable(); table1=getReceiverTable(); @@ -2325,16 +2360,40 @@ bool Relationship::isInvalidated(void) valid=(rel_cols_count == tab_cols_count); /* Checking if the columns created with inheritance / copy still exist - in reference table */ + in reference table, and their types are compatible */ for(i=0; i < gen_columns.size() && valid; i++) - valid=table->getColumn(gen_columns[i]->getName(true)); + { + gen_col = gen_columns[i]; + col_aux = table->getColumn(gen_col->getName(true)); + valid = col_aux && (col_aux->getType().isEquivalentTo(gen_col->getType()) || + col_aux->getType().getAliasType().isEquivalentTo(gen_col->getType())); + } + + // Specific for partition relatoinship: check if all the columns on the source table (partition) exist on the partitioned table + if(rel_type==RELATIONSHIP_PART) + { + count = table1->getColumnCount(); + + for(i=0; i < count && valid; i++) + { + col_aux1 = table1->getColumn(i); + col_aux = table->getColumn(col_aux1->getName(true)); + valid = col_aux && (col_aux->getType().isEquivalentTo(col_aux1->getType()) || + col_aux->getType().getAliasType().isEquivalentTo(col_aux1->getType())); + } + } /* Checking if the reference table columns are in the receiver table. In theory all columns must exist in the two table because one inherits another soon they will possess all the same columns. if this not happen indicates that a reference table column was renamed */ for(i=0; i < tab_cols_count && valid; i++) - valid=table1->getColumn(table->getColumn(i)->getName(true)); + { + col_aux = table->getColumn(i); + col_aux1 = table1->getColumn(col_aux->getName(true)); + valid = col_aux && (col_aux->getType().isEquivalentTo(col_aux1->getType()) || + col_aux->getType().getAliasType().isEquivalentTo(col_aux1->getType())); + } //Checking if the check constraints were not renamed in the parent table for(i=0; i < ck_constraints.size() && valid; i++) diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index 9a25244c5a..41763eb6d6 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -221,7 +221,7 @@ class Relationship: public BaseRelationship { /*! \brief Copy columns from one table to another. This operation is done in relationships of type copy / generalization. It is necessary to check duplicate names and incompatible types of columns */ - void addColumnsRelGen(void); + void addColumnsRelGenPart(void); /*! \brief Copy constraints from the parent table to the child. Currently, only check constraints are copied only if the NO INHERIT attribute is not set and diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 150dd4fd1c..4bd3d0dba2 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -42,7 +42,9 @@ Table::Table(void) : BaseTable() attributes[ParsersAttributes::RLS_ENABLED]=QString(); attributes[ParsersAttributes::RLS_FORCED]=QString(); - copy_table=nullptr; + copy_table=partioned_table=nullptr; + partitioning_type=BaseType::null; + this->setName(trUtf8("new_table").toUtf8()); } @@ -97,6 +99,17 @@ void Table::setRLSForced(bool value) rls_forced = value; } +void Table::setPartitioningType(PartitioningType part_type) +{ + setCodeInvalidated(partitioning_type != part_type); + partitioning_type = part_type; +} + +PartitioningType Table::getPartitioningType(void) +{ + return(partitioning_type); +} + void Table::setProtected(bool value) { ObjectType obj_types[]={ OBJ_COLUMN, OBJ_CONSTRAINT, @@ -362,7 +375,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) //Raises an error if the user try to set the table as ancestor/copy of itself else if((obj_type==OBJ_TABLE || obj_type==BASE_TABLE) && obj==this) - throw Exception(ERR_INV_INH_COPY_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ERR_INV_INH_COPY_PART_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); switch(obj_type) { @@ -519,7 +532,12 @@ void Table::addPolicy(Policy *pol, int idx_pol) catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } + } +} + +void Table::setPartionedTable(Table *table) +{ + partioned_table = table; } void Table::addConstraint(Constraint *constr, int idx) @@ -543,7 +561,7 @@ void Table::addAncestorTable(Table *tab, int idx) catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } + } } void Table::setCopyTable(Table *tab) @@ -1512,6 +1530,11 @@ bool Table::isReferRelationshipAddedObject(void) return(found); } +bool Table::isPartition(void) +{ + return(partioned_table != nullptr); +} + void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2) { vector *obj_list=nullptr; diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 1c1ce62448..31ec57b160 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -54,6 +54,9 @@ class Table: public BaseTable { //! \brief Stores the tables that 'this' object inherits attributes vector
ancestor_tables; + + //! \brief Stores the table which this one is partition of + Table *partioned_table; //! \brief Specifies the table from which columns are copied Table *copy_table; @@ -80,6 +83,9 @@ class Table: public BaseTable { //! \brief Stores the relationship added column / constraints indexes map col_indexes, constr_indexes; + //! \brief The partitioning mode/type used by the table + PartitioningType partitioning_type; + /*! \brief Gets one table ancestor (OBJ_TABLE) or copy (BASE_TABLE) using its name and stores the index of the found object on parameter 'obj_idx' */ BaseObject *getObject(const QString &name, ObjectType obj_type, int &obj_idx); @@ -94,10 +100,7 @@ class Table: public BaseTable { protected: //! \brief Adds an ancestor table void addAncestorTable(Table *tab, int idx=-1); - - //! \brief Adds an copy table - void addCopyTable(Table *tab, int idx=-1); - + //! \brief Removes an acestor table using its name void removeAncestorTable(const QString &name); @@ -139,6 +142,12 @@ class Table: public BaseTable { //! \brief Defines if the row level security on table is forced for the table owner void setRLSForced(bool value); + //! \brief Defines if the partitioning type of the table + void setPartitioningType(PartitioningType part_type); + + //! \brief Returns the current partitioning type defined for the table + PartitioningType getPartitioningType(void); + //! \brief Adds an object to the table. It can be inserted at a specified index 'obj_idx'. void addObject(BaseObject *obj, int obj_idx=-1); @@ -175,6 +184,9 @@ class Table: public BaseTable { //! \brief Adds a policy to table (optionally the user can add the object at the specified index 'idx') void addPolicy(Policy *pol, int idx_pol=-1); + //! \brief Adds a partition table + void setPartionedTable(Table *table); + //! \brief Configures the copy table void setCopyTable(Table *tab); @@ -347,6 +359,9 @@ class Table: public BaseTable { //! \brief Returns if the table references objects added by relationship bool isReferRelationshipAddedObject(void); + + //! \brief Returns if the table is a partition of another table + bool isPartition(void); //! \brief Copy the attributes between two tables void operator = (Table &tabela); diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 568352c0db..7877bc9f00 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -67,7 +67,7 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_REF_ROLE_INV_INDEX", QT_TR_NOOP("Reference to a role which index is out of role list bounds!")}, {"ERR_INS_EMPTY_RULE_COMMAND", QT_TR_NOOP("Insertion of empty command to the rule!")}, {"ERR_REF_RULE_CMD_INV_INDEX", QT_TR_NOOP("Reference to a command which index is out of the command list bounds!")}, - {"ERR_INV_INH_COPY_RELATIONSHIP", QT_TR_NOOP("Is not possible to create a self generalization/copy relationship! The table can not inherit or copy their own attributes!")}, + {"ERR_INV_INH_COPY_PART_RELATIONSHIP", QT_TR_NOOP("Is not possible to create a self generalization/copy/partition relationship! The table can not inherit or copy its own attributes or be a partition of itself!")}, {"ERR_ASG_OBJ_BELONGS_OTHER_TABLE", QT_TR_NOOP("Assignment of an object that already belongs to another table!")}, {"ERR_ASG_SEQ_DIF_TABLE_SCHEMA", QT_TR_NOOP("Assignment of a schema to the sequence which differs from the schema of the owner table!")}, {"ERR_ASG_INV_VALUE_SEQ_ATTRIBS", QT_TR_NOOP("Assignment of an invalid value to one of the sequence attributes!")}, @@ -251,7 +251,9 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_NULL_PK_COLUMN", QT_TR_NOOP("The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it!")}, {"ERR_ASG_INV_IDENTITY_COLUMN", QT_TR_NOOP("The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'.")}, {"ERR_REF_INV_AFFECTED_CMD", QT_TR_NOOP("Reference to an invalid affected command in policy `%1'!")}, - {"ERR_REF_INV_SPECIAL_ROLE", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")} + {"ERR_REF_INV_SPECIAL_ROLE", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")}, + {"ERR_INV_COLUMN_COUNT_PART_REL", QT_TR_NOOP("Unable to create a partition relationship because the partion table `%1' is not empty or has columns that are not present on the partitioned table `%2'!")}, + {"ERR_INV_PARTITIONIG_TYPE_PART_REL", QT_TR_NOOP("Unable to create a partition relationship between the tables `%1' (partition) and `%2' (partitioned) because no partitioning type is defined on the latter!")} }; Exception::Exception(void) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 24682bbc44..2a2a7c7cf5 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -95,7 +95,7 @@ enum ErrorType { ERR_REF_ROLE_INV_INDEX, ERR_INS_EMPTY_RULE_COMMAND, ERR_REF_RULE_CMD_INV_INDEX, - ERR_INV_INH_COPY_RELATIONSHIP, + ERR_INV_INH_COPY_PART_RELATIONSHIP, ERR_ASG_OBJ_BELONGS_OTHER_TABLE, ERR_ASG_SEQ_DIF_TABLE_SCHEMA, ERR_ASG_INV_VALUE_SEQ_ATTRIBS, @@ -279,12 +279,14 @@ enum ErrorType { ERR_NULL_PK_COLUMN, ERR_INV_IDENTITY_COLUMN, ERR_REF_INV_AFFECTED_CMD, - ERR_REF_INV_SPECIAL_ROLE + ERR_REF_INV_SPECIAL_ROLE, + ERR_INV_COLUMN_COUNT_PART_REL, + ERR_INV_PARTITIONIG_TYPE_PART_REL }; class Exception { private: - static const int ERROR_COUNT=233; + static const int ERROR_COUNT=235; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ diff --git a/tests/src/partrelationshiptest/partrelationshiptest.cpp b/tests/src/partrelationshiptest/partrelationshiptest.cpp new file mode 100644 index 0000000000..24defa128b --- /dev/null +++ b/tests/src/partrelationshiptest/partrelationshiptest.cpp @@ -0,0 +1,269 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include +#include "relationship.h" + +class PartRelationhipTest: public QObject { + private: + Q_OBJECT + + private slots: + void connRelTableNoColumnsAndTableTwoColumns(void); + void connRelTablesTwoColumnsSameNameShouldNotRaiseError(void); + void connRelTablePartionHasMoreColsThanPartitionedTableShouldRaiseError(void); + void connRelTablePartionHasDifferentColsThanPartitionedTableShouldRaiseError(void); + void connRelShouldInvalidateIfPartitionedColumnChanges(void); +}; + +void PartRelationhipTest::connRelTableNoColumnsAndTableTwoColumns(void) +{ + Schema *schema = new Schema; + Table *partitioned = new Table; + Table *partition = new Table; + Column *col = new Column, *col1 = new Column; + Relationship *part_rel = nullptr; + + try + { + schema->setName("public"); + partitioned->setSchema(schema); + partition->setSchema(schema); + + partitioned->setPartitioningType(PartitioningType::list); + partitioned->setName("table_a"); + partition->setName("partion_a"); + + col->setName("id"); + col->setType(PgSQLType("serial")); + col1->setName("sku"); + col1->setType(PgSQLType("smallint")); + + partitioned->addColumn(col); + partitioned->addColumn(col1); + + part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel->connectRelationship(); + + QVERIFY(partitioned->getColumnCount() == partition->getColumnCount()); + } + catch(Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } +} + +void PartRelationhipTest::connRelTablesTwoColumnsSameNameShouldNotRaiseError(void) +{ + Schema *schema = new Schema; + Table *partitioned = new Table; + Table *partition = new Table; + Column *col = new Column, *col1 = new Column; + Relationship *part_rel = nullptr; + + try + { + schema->setName("public"); + partitioned->setSchema(schema); + partition->setSchema(schema); + + partitioned->setPartitioningType(PartitioningType::list); + partitioned->setName("table_a"); + partition->setName("partion_a"); + + col->setName("id"); + col->setType(PgSQLType("serial")); + col1->setName("sku"); + col1->setType(PgSQLType("smallint")); + + partitioned->addColumn(col); + partitioned->addColumn(col1); + + col = new Column; + col1 = new Column; + col->setName("id"); + col->setType(PgSQLType("serial")); + col1->setName("sku"); + col1->setType(PgSQLType("smallint")); + + partition->addColumn(col); + partition->addColumn(col1); + + part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel->connectRelationship(); + + QVERIFY(partitioned->getColumnCount() == partition->getColumnCount()); + } + catch(Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } +} + +void PartRelationhipTest::connRelTablePartionHasMoreColsThanPartitionedTableShouldRaiseError(void) +{ + Schema *schema = new Schema; + Table *partitioned = new Table; + Table *partition = new Table; + Column *col = new Column, *col1 = new Column, *col2 = nullptr; + Relationship *part_rel = nullptr; + + try + { + schema->setName("public"); + partitioned->setSchema(schema); + partition->setSchema(schema); + + partitioned->setPartitioningType(PartitioningType::list); + partitioned->setName("table_a"); + partition->setName("partion_a"); + + col->setName("id"); + col->setType(PgSQLType("serial")); + col1->setName("sku"); + col1->setType(PgSQLType("smallint")); + + partitioned->addColumn(col); + partitioned->addColumn(col1); + + col = new Column; + col1 = new Column; + col->setName("id"); + col->setType(PgSQLType("serial")); + col1->setName("sku"); + col1->setType(PgSQLType("smallint")); + col2 = new Column; + col2->setName("date"); + col2->setType(PgSQLType("date")); + + partition->addColumn(col); + partition->addColumn(col1); + partition->addColumn(col2); + + part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel->connectRelationship(); + + QFAIL("Should return exception because tables have different column count!"); + } + catch(Exception &e) + { + QVERIFY(e.getErrorType() == ERR_INV_COLUMN_COUNT_PART_REL); + } +} + +void PartRelationhipTest::connRelTablePartionHasDifferentColsThanPartitionedTableShouldRaiseError(void) +{ + Schema *schema = new Schema; + Table *partitioned = new Table; + Table *partition = new Table; + Column *col = new Column, *col1 = new Column; + Relationship *part_rel = nullptr; + + try + { + schema->setName("public"); + partitioned->setSchema(schema); + partition->setSchema(schema); + + partitioned->setPartitioningType(PartitioningType::list); + partitioned->setName("table_a"); + partition->setName("partion_a"); + + col->setName("id"); + col->setType(PgSQLType("serial")); + col1->setName("sku"); + col1->setType(PgSQLType("smallint")); + + partitioned->addColumn(col); + partitioned->addColumn(col1); + + col = new Column; + col1 = new Column; + col->setName("tag_id"); + col->setType(PgSQLType("serial")); + col1->setName("serial_number"); + col1->setType(PgSQLType("smallint")); + + partition->addColumn(col); + partition->addColumn(col1); + + part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel->connectRelationship(); + + QFAIL("Should return exception because tables have different columns names!"); + } + catch(Exception &e) + { + QVERIFY(e.getErrorType() == ERR_INV_COLUMN_COUNT_PART_REL); + } +} + +void PartRelationhipTest::connRelShouldInvalidateIfPartitionedColumnChanges(void) +{ + Schema *schema = new Schema; + Table *partitioned = new Table; + Table *partition = new Table; + Column *col = new Column, *col1 = new Column; + Relationship *part_rel = nullptr; + + try + { + schema->setName("public"); + partitioned->setSchema(schema); + partition->setSchema(schema); + + partitioned->setPartitioningType(PartitioningType::list); + partitioned->setName("table_a"); + partition->setName("partion_a"); + + col->setName("id"); + col->setType(PgSQLType("serial")); + col1->setName("sku"); + col1->setType(PgSQLType("smallint")); + + partitioned->addColumn(col); + partitioned->addColumn(col1); + + col = new Column; + col1 = new Column; + col->setName("id"); + col->setType(PgSQLType("serial")); + col1->setName("sku"); + col1->setType(PgSQLType("smallint")); + + partition->addColumn(col); + partition->addColumn(col1); + + part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel->connectRelationship(); + + partitioned->getColumn(0)->setName("new_id"); + QVERIFY(part_rel->isInvalidated() == true); + + partitioned->getColumn(0)->setName("id"); + partitioned->getColumn(0)->setType(PgSQLType("date")); + QVERIFY(part_rel->isInvalidated() == true); + } + catch(Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } +} + +QTEST_MAIN(PartRelationhipTest) +#include "partrelationshiptest.moc" diff --git a/tests/src/partrelationshiptest/partrelationshiptest.pro b/tests/src/partrelationshiptest/partrelationshiptest.pro new file mode 100644 index 0000000000..9274ff84b3 --- /dev/null +++ b/tests/src/partrelationshiptest/partrelationshiptest.pro @@ -0,0 +1,2 @@ +include(../../tests.pri) +SOURCES += partrelationshiptest.cpp diff --git a/tests/tests.pro b/tests/tests.pro index b8020f0218..a3d827eca2 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -14,4 +14,5 @@ src/syntaxhighlightertest \ src/databasemodeltest \ src/schemaparsertest \ src/linenumberstest \ +src/partrelationshiptest From 5bacdfc1f7c179535b5284a59bebb6d014c16340 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 20 Sep 2018 18:02:17 -0300 Subject: [PATCH 124/425] Adding support to write partitioning type on table's xml Improved the RelationshipView in order to draw partitioning relationships Starting to modify RelationshipWidget in order to handle partitioning relatinships (WIP) Modified RelationshipConfigWidget in order to write name partterns for partitioning relationships --- conf/defaults/relationships.conf | 3 +- conf/dtd/relationships.dtd | 2 +- conf/relationships.conf | 3 +- libobjrenderer/src/relationshipview.cpp | 40 +++- libobjrenderer/src/tabletitleview.cpp | 11 +- libobjrenderer/src/tableview.cpp | 3 + libparsers/src/parsersattributes.cpp | 2 + libparsers/src/parsersattributes.h | 2 + libpgmodeler/src/baserelationship.cpp | 26 +++ libpgmodeler/src/baserelationship.h | 4 + libpgmodeler/src/databasemodel.cpp | 3 + libpgmodeler/src/relationship.cpp | 5 +- libpgmodeler/src/table.cpp | 3 + .../res/icones/relationshippart.png | Bin 0 -> 1448 bytes libpgmodeler_ui/res/resources.qrc | 1 + libpgmodeler_ui/src/modelwidget.cpp | 10 +- .../src/newobjectoverlaywidget.cpp | 3 +- .../src/relationshipconfigwidget.cpp | 11 +- libpgmodeler_ui/src/relationshipwidget.cpp | 36 +-- libpgmodeler_ui/ui/newobjectoverlaywidget.ui | 44 ++++ .../ui/relationshipconfigwidget.ui | 28 +-- libpgmodeler_ui/ui/relationshipwidget.ui | 206 +----------------- schemas/xml/dtd/relationship.dtd | 2 +- schemas/xml/dtd/table.dtd | 1 + schemas/xml/relationship.sch | 2 +- schemas/xml/table.sch | 1 + 26 files changed, 186 insertions(+), 266 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/relationshippart.png diff --git a/conf/defaults/relationships.conf b/conf/defaults/relationships.conf index 11e005177f..65fadde900 100644 --- a/conf/defaults/relationships.conf +++ b/conf/defaults/relationships.conf @@ -4,7 +4,7 @@ Unexpected results may occur if the code is changed deliberately. --> - + @@ -12,5 +12,6 @@ + diff --git a/conf/dtd/relationships.dtd b/conf/dtd/relationships.dtd index 08590b5ebb..5d68890dd6 100644 --- a/conf/dtd/relationships.dtd +++ b/conf/dtd/relationships.dtd @@ -16,7 +16,7 @@ - + diff --git a/conf/relationships.conf b/conf/relationships.conf index 586d01f869..2714c6e59f 100644 --- a/conf/relationships.conf +++ b/conf/relationships.conf @@ -4,7 +4,7 @@ Unexpected results may occur if the code is changed deliberately. --> - + @@ -12,5 +12,6 @@ + diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 6c0e7fa7a7..485628672b 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -871,7 +871,7 @@ void RelationshipView::configureLine(void) line = QLineF(tables[1]->getCenter(), points[points.size() - 1]); } - if(rel_type==BaseRelationship::RELATIONSHIP_GEN || rel_type==BaseRelationship::RELATIONSHIP_DEP) + if(rel_type==BaseRelationship::RELATIONSHIP_GEN || rel_type==BaseRelationship::RELATIONSHIP_DEP || rel_type==BaseRelationship::RELATIONSHIP_PART) size_factor = 0.40; else if(use_crows_foot) { @@ -884,7 +884,8 @@ void RelationshipView::configureLine(void) else size_factor = 1.5 * font_factor; - if(rel_type == BaseRelationship::RELATIONSHIP_GEN || + if(rel_type == BaseRelationship::RELATIONSHIP_PART || + rel_type == BaseRelationship::RELATIONSHIP_GEN || rel_type == BaseRelationship::RELATIONSHIP_DEP || rel_type == BaseRelationship::RELATIONSHIP_11 || (tab_idx == 0 && rel_type == BaseRelationship::RELATIONSHIP_1N) || @@ -1007,8 +1008,9 @@ void RelationshipView::configureLine(void) pen=BaseObjectView::getBorderStyle(ParsersAttributes::RELATIONSHIP); } - //For dependency relationships the line is dashed - if(rel_type==BaseRelationship::RELATIONSHIP_DEP) + //For dependency/partition relationships the line is dashed + if(rel_type==BaseRelationship::RELATIONSHIP_DEP || + rel_type == BaseRelationship::RELATIONSHIP_PART) pen.setStyle(Qt::DashLine); /* For identifier relationships an additional point is created on the center of the @@ -1125,6 +1127,7 @@ void RelationshipView::configureLine(void) (!base_rel->isSelfRelationship() && ((line_conn_mode != CONNECT_TABLE_EGDES && rel_type==BaseRelationship::RELATIONSHIP_DEP) || (line_conn_mode != CONNECT_TABLE_EGDES && rel_type==BaseRelationship::RELATIONSHIP_GEN) || + (line_conn_mode != CONNECT_TABLE_EGDES && rel_type==BaseRelationship::RELATIONSHIP_PART) || (line_conn_mode != CONNECT_TABLE_EGDES && rel_type==BaseRelationship::RELATIONSHIP_NN && !use_crows_foot)))) { for(i=0; i < 2; i++) @@ -1264,7 +1267,8 @@ void RelationshipView::configureDescriptor(void) //Using the default color pen=BaseObjectView::getBorderStyle(ParsersAttributes::RELATIONSHIP); - if(rel_type==BaseRelationship::RELATIONSHIP_DEP) + if(rel_type==BaseRelationship::RELATIONSHIP_DEP || + rel_type == BaseRelationship::RELATIONSHIP_PART) pen.setStyle(Qt::DashLine); descriptor->setPen(pen); @@ -1290,10 +1294,18 @@ void RelationshipView::configureDescriptor(void) descriptor->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::RELATIONSHIP)); if(rel_type==BaseRelationship::RELATIONSHIP_DEP || - rel_type==BaseRelationship::RELATIONSHIP_GEN) + rel_type==BaseRelationship::RELATIONSHIP_GEN) + { + pol.append(QPointF(0,0)); pol.append(QPointF(18,10)); + pol.append(QPointF(0,20)); pol.append(QPointF(0,10)); + } + else if(rel_type==BaseRelationship::RELATIONSHIP_PART) { - pol.append(QPointF(0,0)); pol.append(QPointF(18,10)); - pol.append(QPointF(0,20)); pol.append(QPointF(0,10)); + pol.append(QPointF(0,9)); pol.append(QPointF(9,9)); + pol.append(QPointF(3,3)); pol.append(QPointF(6,0)); + pol.append(QPointF(17,11)); pol.append(QPointF(17,12)); + pol.append(QPointF(6,23)); pol.append(QPointF(3,20)); + pol.append(QPointF(9,14)); pol.append(QPointF(0,14)); } else { @@ -1329,7 +1341,9 @@ void RelationshipView::configureDescriptor(void) /* Workaround to avoid the inheritance / dependency relationship to get the descriptor rotated to the wrong side * We create and auxiliary line with points from the position at 65% of the curve to the 45% and use the * angle of that line instead of the angle at 50% of the curve */ - if((rel_type == BaseRelationship::RELATIONSHIP_DEP || rel_type == BaseRelationship::RELATIONSHIP_GEN) && + if((rel_type == BaseRelationship::RELATIONSHIP_DEP || + rel_type == BaseRelationship::RELATIONSHIP_GEN || + rel_type == BaseRelationship::RELATIONSHIP_PART) && curve->isControlPointsInverted() && !curve->isSimpleCurve() && !curve->isStraightLine()) { QLineF lin_aux = QLineF(path.pointAtPercent(0.65), path.pointAtPercent(0.45)); @@ -1398,12 +1412,13 @@ void RelationshipView::configureDescriptor(void) this->configurePositionInfo(); /* If the crow's feet is enabled the relationship descriptor is hidden - * for 1:1, 1:n, n:n and fk relationship. For generalization and dependency + * for 1:1, 1:n, n:n and fk relationship. For generalization, dependency and partitioning * relationships the descriptor is still displayed. */ descriptor->setVisible(!use_crows_foot || (use_crows_foot && ( rel_type == BaseRelationship::RELATIONSHIP_DEP || - rel_type == BaseRelationship::RELATIONSHIP_GEN))); + rel_type == BaseRelationship::RELATIONSHIP_GEN || + rel_type == BaseRelationship::RELATIONSHIP_PART))); obj_shadow->setVisible(descriptor->isVisible()); } @@ -1828,7 +1843,8 @@ void RelationshipView::configureLabels(void) if(!use_crows_foot && rel_type!=BaseRelationship::RELATIONSHIP_GEN && - rel_type!=BaseRelationship::RELATIONSHIP_DEP) + rel_type!=BaseRelationship::RELATIONSHIP_DEP && + rel_type!=BaseRelationship::RELATIONSHIP_PART) { QPointF pi, pf, p_int, pos; unsigned idx, i1; diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 8f3fb818bc..de55e82b3d 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -51,9 +51,10 @@ void TableTitleView::configureObject(BaseGraphicObject *object) QTextCharFormat fmt; QString name_attrib, schema_name_attrib, title_color_attrib; QPen pen; - Schema *schema=dynamic_cast(object->getSchema()); + Schema *schema=nullptr; QFont font; - Tag *tag=dynamic_cast(object)->getTag(); + Tag *tag=nullptr; + Table *table = dynamic_cast
(object); //Raises an error if the object related to the title is not allocated if(!object) @@ -63,6 +64,9 @@ void TableTitleView::configureObject(BaseGraphicObject *object) object->getObjectType()!=OBJ_VIEW) throw Exception(ERR_OPR_OBJ_INV_TYPE, __PRETTY_FUNCTION__, __FILE__, __LINE__); + schema=dynamic_cast(object->getSchema()); + tag=dynamic_cast(object)->getTag(); + if(object->getObjectType()==OBJ_VIEW && !tag) { name_attrib=ParsersAttributes::VIEW_NAME; @@ -118,7 +122,8 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(tag) pen.setColor(tag->getElementColor(title_color_attrib, Tag::BORDER_COLOR)); - if(object->getObjectType()==OBJ_VIEW) + if(object->getObjectType()==OBJ_VIEW || + (table && table->isPartition())) pen.setStyle(Qt::DashLine); box->setPen(pen); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 842b8941fd..90e9eef810 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -158,6 +158,9 @@ void TableView::configureObject(void) bodies[obj_idx]->setRect(QRectF(0,0, width, groups[obj_idx]->boundingRect().height() + (2 * VERT_SPACING))); pen=this->getBorderStyle(atribs[obj_idx]); + if(table->isPartition()) + pen.setStyle(Qt::DashLine); + if(!tag) bodies[obj_idx]->setBrush(this->getFillStyle(atribs[obj_idx])); else diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index b3a5ed9b0d..e6033040ed 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -360,6 +360,7 @@ namespace ParsersAttributes { PARENTS=QString("parents"), PARSABLE=QString("parsable"), PARTIAL_MATCH=QString("partial-match"), + PARTITIONING_TYPE=QString("partitioning-type"), PASSWORD=QString("password"), PASSWORD_ENCRYPTION=QString("password-encryption"), PATH=QString("path"), @@ -419,6 +420,7 @@ namespace ParsersAttributes { RELATIONSHIP_FK=QString("relfk"), RELATIONSHIP_GEN=QString("relgen"), RELATIONSHIP_NN=QString("relnn"), + RELATIONSHIP_PART=QString("relpart"), RELATIONSHIP=QString("relationship"), RENAME=QString("rename"), REPLICATION=QString("replication"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 491dacf703..22557e6430 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -367,6 +367,7 @@ namespace ParsersAttributes { PARENTS, PARSABLE, PARTIAL_MATCH, + PARTITIONING_TYPE, PASSWORD, PASSWORD_ENCRYPTION, PATH, @@ -426,6 +427,7 @@ namespace ParsersAttributes { RELATIONSHIP_FK, RELATIONSHIP_GEN, RELATIONSHIP_NN, + RELATIONSHIP_PART, RELATIONSHIP, RENAME, REPLICATION, diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 1f19c452cd..39d52acb3a 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -95,6 +95,7 @@ void BaseRelationship::configureRelationship(void) attributes[ParsersAttributes::RELATIONSHIP_NN]=QString(); attributes[ParsersAttributes::RELATIONSHIP_GEN]=QString(); attributes[ParsersAttributes::RELATIONSHIP_DEP]=QString(); + attributes[ParsersAttributes::RELATIONSHIP_PART]=QString(); attributes[ParsersAttributes::RELATIONSHIP_1N]=QString(); attributes[ParsersAttributes::RELATIONSHIP_11]=QString(); attributes[ParsersAttributes::CONSTRAINTS]=QString(); @@ -506,6 +507,7 @@ QString BaseRelationship::getRelTypeAttribute(void) case RELATIONSHIP_1N: return(ParsersAttributes::RELATIONSHIP_1N); break; case RELATIONSHIP_NN: return(ParsersAttributes::RELATIONSHIP_NN); break; case RELATIONSHIP_GEN: return(ParsersAttributes::RELATIONSHIP_GEN); break; + case RELATIONSHIP_PART: return(ParsersAttributes::RELATIONSHIP_PART); break; case RELATIONSHIP_FK: return(ParsersAttributes::RELATIONSHIP_FK); break; default: if(src_table->getObjectType()==OBJ_VIEW) @@ -516,6 +518,30 @@ QString BaseRelationship::getRelTypeAttribute(void) } } +QString BaseRelationship::getRelationshipTypeName(unsigned rel_type, bool is_view) +{ + switch(rel_type) + { + case RELATIONSHIP_11: return(trUtf8("One-to-one")); break; + case RELATIONSHIP_1N: return(trUtf8("One-to-many")); break; + case RELATIONSHIP_NN: return(trUtf8("Many-to-many")); break; + case RELATIONSHIP_GEN: return(trUtf8("Inheritance")); break; + case RELATIONSHIP_PART: return(trUtf8("Partitioning")); break; + case RELATIONSHIP_FK: return(trUtf8("FK relationship")); break; + default: + if(is_view) + return(trUtf8("Dependency")); + else + return(trUtf8("Copy")); + break; + } +} + +QString BaseRelationship::getRelationshipTypeName(void) +{ + return(getRelationshipTypeName(rel_type, src_table->getObjectType()==OBJ_VIEW)); +} + void BaseRelationship::setCodeInvalidated(bool value) { BaseObject::setCodeInvalidated(value); diff --git a/libpgmodeler/src/baserelationship.h b/libpgmodeler/src/baserelationship.h index a1c702b1a6..ee26b215a1 100644 --- a/libpgmodeler/src/baserelationship.h +++ b/libpgmodeler/src/baserelationship.h @@ -172,6 +172,10 @@ class BaseRelationship: public BaseGraphicObject { virtual QString getAlterDefinition(BaseObject *) { return(""); } + static QString getRelationshipTypeName(unsigned rel_type, bool is_view = false); + + QString getRelationshipTypeName(void); + friend class DatabaseModel; friend class RelationshipWidget; friend class ModelWidget; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 273d644a90..ecf0b4fa77 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4652,6 +4652,7 @@ Table *DatabaseModel::createTable(void) table->setGenerateAlterCmds(attribs[ParsersAttributes::GEN_ALTER_CMDS]==ParsersAttributes::_TRUE_); table->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); table->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); + table->setPartitioningType(PartitioningType(attribs[ParsersAttributes::PARTITIONING_TYPE])); if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) { @@ -6257,6 +6258,8 @@ BaseRelationship *DatabaseModel::createRelationship(void) rel_type=BaseRelationship::RELATIONSHIP_GEN; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_DEP) rel_type=BaseRelationship::RELATIONSHIP_DEP; + else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_PART) + rel_type=BaseRelationship::RELATIONSHIP_PART; rel=new Relationship(rel_type, dynamic_cast
(tables[0]), diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 89711ed929..9272d5cca8 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2034,7 +2034,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) vector::iterator itr_atrib, itr_atrib_end; TableObject *tab_obj=nullptr; - if(rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_DEP) + if(rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_DEP || rel_type== RELATIONSHIP_PART) { table=getReceiverTable(); @@ -2058,6 +2058,8 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) ck_constraints.pop_back(); } } + else if(rel_type == RELATIONSHIP_PART) + table->setPartionedTable(nullptr); else table->setCopyTable(nullptr); } @@ -2542,6 +2544,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::TABLE_NAME]=tab_name_relnn; attributes[ParsersAttributes::RELATIONSHIP_GEN]=(rel_type==RELATIONSHIP_GEN ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::RELATIONSHIP_DEP]=(rel_type==RELATIONSHIP_DEP ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RELATIONSHIP_PART]=(rel_type==RELATIONSHIP_PART ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::SRC_COL_PATTERN]=name_patterns[SRC_COL_PATTERN]; attributes[ParsersAttributes::DST_COL_PATTERN]=name_patterns[DST_COL_PATTERN]; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 4bd3d0dba2..b27d6864fb 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -41,6 +41,7 @@ Table::Table(void) : BaseTable() attributes[ParsersAttributes::INITIAL_DATA]=QString(); attributes[ParsersAttributes::RLS_ENABLED]=QString(); attributes[ParsersAttributes::RLS_FORCED]=QString(); + attributes[ParsersAttributes::PARTITIONING_TYPE]=QString(); copy_table=partioned_table=nullptr; partitioning_type=BaseType::null; @@ -216,6 +217,7 @@ void Table::setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols) /* Do not generates the column code definition when it is not included by relatoinship, in case of XML definition. */ if((def_type==SchemaParser::SQL_DEFINITION && !columns[i]->isAddedByCopy() && !columns[i]->isAddedByGeneralization()) || + (def_type==SchemaParser::SQL_DEFINITION && columns[i]->isAddedByCopy() && this->isPartition()) || (def_type==SchemaParser::XML_DEFINITION && (!columns[i]->isAddedByRelationship() || (incl_rel_added_cols && columns[i]->isAddedByRelationship())))) { str_cols+=columns[i]->getCodeDefinition(def_type); @@ -1458,6 +1460,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); attributes[ParsersAttributes::TAG]=QString(); attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::PARTITIONING_TYPE]=~partitioning_type; if(def_type==SchemaParser::SQL_DEFINITION && copy_table) attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); diff --git a/libpgmodeler_ui/res/icones/relationshippart.png b/libpgmodeler_ui/res/icones/relationshippart.png new file mode 100644 index 0000000000000000000000000000000000000000..ae77edd4579dfc92b7c2f269624fa428fa24b5fe GIT binary patch literal 1448 zcmV;Z1y}lsP)DiRktLaHSJVX>c(ha2Hx4OHV>PF4Ya;! z8H~MjP_U&N?4gJZOLQy3vcVABT4}a6jWnsSXc@5?ShK3pMXjzi-h1|-$zuFd(>vIK z1NVO4chC9VbAIQ1hapZbUAmN=mX>yf=lLB_D3T<(Y&Kit^UkT_Uj#w8^7gyOtAe3L zMb3Gi1HUv=*w)rI(A3oA*fs!;88WeBLPKA;Ey$1z0yo=qMA5kbWfKvMfWAB*g%T=*0oZ zvaA@uc5SFcQH+Or=YNTS-EL<9P+nes`*{GCmXlRD4WrQrj@!D_bUGb!b90*+V@;c-$mMd4sx}JUR{0YI0j>vOI0k%4aZHwFT)*-K z3~yB7)%+41E!_uwc6OF(Bj;O1fQX<=PsJX6W>TC8Jn$ei{yS>k`w+SMOzce80?V^N zJP9vfzI?m9yqpdnK1}uX^^}p3LB++z>y*2i4K;Qk+H}` z{cb<~)bAz67=8Zb*Cd{5pv+y_R8@1FI=<^At&m0l)@Z%$BkJ$(pInznpU;O|w{AhL zR->}A5+08S9UUErL?WoIt;M~2_i(ng6{cb%T)*7JTh=#WEqVo7c^X87{-3|c;IG$l z>Vp&b^kW;UN?${FmmPY&9tMK}4u=B{hXZF@npYZMyz`lv8TG`(1WukjiPqLujE|4w z>eZ{5o}NZ;Z!d<2hjHf288kLFVqjnZ?d|O-EG&d1N$_|)v0Qt-UZ_<6nm%&m2p&Iv z44ch{>gwuPr33S_7cFyZc7~uV1)uVcOwvEMB{I?PWm_ z7=Tfq&$kOeR##USjgF48^XJb)5Cr7qda$st zfTvHNqPck`1xVC-enKTmyqeUpiOzzAR%z&m1#o$Tktvbeo5 z07X4LJrgA*B`-z)Qj#QSG#X4zO~u~VU(XymJ3A9cww1m3K?XoRfQMp>o%ZN6A-33Q zvtAIrw3H|jtpTtPKuU4NiBI-7|0RSq@ zdp86T?UqV476DNdDH`^u^FM-rZ3yDOavn{AYHV!Gyh5>WfYJtc`wxStFz=21?G3jd zf$2wZ87p;I9r48;IZa*r_dpC2=IF19)^9l!74glDiGITnf zgYh5|odZB96uL7qGIEG91|ninP^-^ubrNC;g9ia1#uzcS@(BP0gF!Fb2%XhxHRYBz zxD%a6on5?mQ5OgV)MH~~nouYtJbCgYH4=%WEH5vsB}r1rvdmj7mYa9)-Yw%ePU3lf zndkZCl$4ZbI-PED_wL;b27}=lfXzqegbul_sIIp56aX4g6v=EhA6o4%s)UN$d@5GL zt5uDOMx$8*5J_q*R~Ut)g>AKIwOUO|jK^2lX7UeBUSs%Zicones/moreactions.png icones/stop.png icones/newtab.png + icones/relationshippart.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 30eeac49f6..46d18b29a0 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -80,9 +80,9 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) QGridLayout *grid=nullptr; QAction *action=nullptr; QString str_ico, str_txt; - QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen") }, + QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen"), QString("part") }, rel_labels={ trUtf8("One to One (1-1)"), trUtf8("One to Many (1-n)"), - trUtf8("Many to Many (n-n)"), trUtf8("Copy"), trUtf8("Inheritance") }; + trUtf8("Many to Many (n-n)"), trUtf8("Copy"), trUtf8("Inheritance"), trUtf8("Partitioning") }; ObjectType types[]={ OBJ_TABLE, OBJ_VIEW, OBJ_TEXTBOX, OBJ_RELATIONSHIP, OBJ_CAST, OBJ_CONVERSION, OBJ_DOMAIN, OBJ_FUNCTION, OBJ_AGGREGATE, OBJ_LANGUAGE, @@ -94,7 +94,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) unsigned i, obj_cnt=sizeof(types)/sizeof(ObjectType), rel_types_id[]={ BaseRelationship::RELATIONSHIP_11, BaseRelationship::RELATIONSHIP_1N, BaseRelationship::RELATIONSHIP_NN, BaseRelationship::RELATIONSHIP_DEP, - BaseRelationship::RELATIONSHIP_GEN }; + BaseRelationship::RELATIONSHIP_GEN, BaseRelationship::RELATIONSHIP_PART}; current_zoom=1; modified=panning_mode=false; @@ -375,9 +375,9 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) for(int i=0; i < rel_types_cod.size(); i++) { str_ico=BaseObject::getSchemaName(OBJ_RELATIONSHIP) + rel_types_cod[i]; - str_txt=rel_labels[i]; - action=new QAction(QIcon(PgModelerUiNS::getIconPath(str_ico)), str_txt, this); + action=new QAction(QIcon(PgModelerUiNS::getIconPath(str_ico)), + BaseRelationship::getRelationshipTypeName(rel_types_id[i], false), this); //Storing a unique identifier for the relationship type action->setData(QVariant(OBJ_RELATIONSHIP + rel_types_id[i])); diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index 8a94788195..5d91e85ae9 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -62,7 +62,8 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par { rel1n_tb, std::make_tuple(trUtf8("2"), 1) }, { relnn_tb, std::make_tuple(trUtf8("3"), 2) }, { reldep_tb, std::make_tuple(trUtf8("5"), 3) }, - { relgen_tb, std::make_tuple(trUtf8("4"), 4) } }; + { relgen_tb, std::make_tuple(trUtf8("4"), 4) }, + { relpart_tb, std::make_tuple(trUtf8("5"), 5) }}; vector permission_btns={db_sch_perms_tb, tab_perms_tb }; diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index e869133b14..c649dd09eb 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -24,7 +24,10 @@ RelationshipConfigWidget::RelationshipConfigWidget(QWidget * parent) : BaseConfi { QStringList list, rel_types={ ParsersAttributes::RELATIONSHIP_11, ParsersAttributes::RELATIONSHIP_1N, ParsersAttributes::RELATIONSHIP_NN, ParsersAttributes::RELATIONSHIP_GEN, - ParsersAttributes::RELATIONSHIP_DEP }; + ParsersAttributes::RELATIONSHIP_DEP, ParsersAttributes::RELATIONSHIP_PART }; + unsigned rel_types_id[]={ BaseRelationship::RELATIONSHIP_11, BaseRelationship::RELATIONSHIP_1N, + BaseRelationship::RELATIONSHIP_NN, BaseRelationship::RELATIONSHIP_GEN, + BaseRelationship::RELATIONSHIP_DEP, BaseRelationship::RELATIONSHIP_PART}; Ui_RelationshipConfigWidget::setupUi(this); @@ -65,7 +68,7 @@ RelationshipConfigWidget::RelationshipConfigWidget(QWidget * parent) : BaseConfi upd_action_cmb->addItems(list); for(int i=0; i < rel_types.size(); i++) - rel_type_cmb->setItemData(i, rel_types[i]); + rel_type_cmb->addItem(BaseRelationship::getRelationshipTypeName(rel_types_id[i]), rel_types[i]); connect(crows_foot_rb, SIGNAL(toggled(bool)), this, SLOT(enableConnModePreview(void))); connect(fk_to_pk_rb, SIGNAL(toggled(bool)), this, SLOT(enableConnModePreview(void))); @@ -114,6 +117,7 @@ void RelationshipConfigWidget::loadConfiguration(void) patterns[ParsersAttributes::RELATIONSHIP_NN]=config_params[ParsersAttributes::RELATIONSHIP_NN]; patterns[ParsersAttributes::RELATIONSHIP_GEN]=config_params[ParsersAttributes::RELATIONSHIP_GEN]; patterns[ParsersAttributes::RELATIONSHIP_DEP]=config_params[ParsersAttributes::RELATIONSHIP_DEP]; + patterns[ParsersAttributes::RELATIONSHIP_PART]=config_params[ParsersAttributes::RELATIONSHIP_PART]; fillNamePatterns(); this->applyConfiguration(); @@ -215,7 +219,7 @@ void RelationshipConfigWidget::fillNamePatterns(void) ParsersAttributes::PK_COL_PATTERN }; relnn=(rel_type==ParsersAttributes::RELATIONSHIP_NN); - reldep=(rel_type==ParsersAttributes::RELATIONSHIP_DEP); + reldep=(rel_type==ParsersAttributes::RELATIONSHIP_DEP || rel_type==ParsersAttributes::RELATIONSHIP_PART); relgen=(rel_type==ParsersAttributes::RELATIONSHIP_GEN); dst_col_pattern_txt->setEnabled(relnn); @@ -256,7 +260,6 @@ void RelationshipConfigWidget::updatePattern(void) { dst_fk_pattern_txt, ParsersAttributes::DST_FK_PATTERN }, { pk_col_pattern_txt, ParsersAttributes::PK_COL_PATTERN } }; - setConfigurationChanged(true); patterns[rel_type][inputs_map[input]]=input->toPlainText(); } diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 7ca707f44d..c737222090 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -243,15 +243,8 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } rel_type=base_rel->getRelationshipType(); - switch(rel_type) - { - case BaseRelationship::RELATIONSHIP_11: rel_11_rb->setChecked(true); break; - case BaseRelationship::RELATIONSHIP_1N: rel_1n_rb->setChecked(true); break; - case BaseRelationship::RELATIONSHIP_NN: rel_nn_rb->setChecked(true); break; - case BaseRelationship::RELATIONSHIP_GEN: rel_gen_rb->setChecked(true); break; - case BaseRelationship::RELATIONSHIP_FK: rel_fk_rb->setChecked(true); break; - case BaseRelationship::RELATIONSHIP_DEP: rel_dep_rb->setChecked(true); break; - } + rel_type_name_lbl->setText(base_rel->getRelationshipTypeName()); + rel_icon_lbl->setPixmap(PgModelerUiNS::getIconPath(base_rel->getRelTypeAttribute().replace("rel", "relationship"))); aux_rel=dynamic_cast(base_rel); @@ -277,7 +270,18 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } else if(aux_rel) { - if(rel_type!=BaseRelationship::RELATIONSHIP_NN) + if(rel_type == BaseRelationship::RELATIONSHIP_PART) + { + ref_table_lbl->setText(trUtf8("Partitioned Table:")); + ref_table_ht->setText(trUtf8("Partitioned table is the one which is splitted into smaller pieces (partitions). This table is where the partitioning strategy or type is defined.")); + + recv_table_lbl->setText(trUtf8("Partition Table:")); + recv_table_ht->setText(trUtf8("Partition table is the one attached to a partitioned table in which operations over data will be routed (according to the paritionig rule) when trying to handle the partitioned table.")); + + ref_table_txt->setPlainText(aux_rel->getReferenceTable()->getName(true)); + recv_table_txt->setPlainText(aux_rel->getReceiverTable()->getName(true)); + } + else if(rel_type!=BaseRelationship::RELATIONSHIP_NN) { ref_table_lbl->setText(trUtf8("Reference Table:")); ref_table_ht->setText(trUtf8("Reference table has the columns from its primary key will copied to the receiver table in order to represent the linking between them. This is the (1) side of relationship.")); @@ -348,6 +352,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l relgen_dep=(rel_type==BaseRelationship::RELATIONSHIP_DEP || rel_type==BaseRelationship::RELATIONSHIP_GEN || + rel_type==BaseRelationship::RELATIONSHIP_PART || rel_type==BaseRelationship::RELATIONSHIP_FK); use_name_patterns=(rel1n || relnn || @@ -425,10 +430,15 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l QSize RelationshipWidget::getIdealSize(void) { - if(rel_fk_rb->isChecked() || - (rel_dep_rb->isChecked() && this->object && this->object->getObjectType()==BASE_RELATIONSHIP)) + unsigned rel_type = 0; + + if(this->object) + rel_type = dynamic_cast(this->object)->getRelationshipType(); + + if(rel_type == BaseRelationship::RELATIONSHIP_FK || + (BaseRelationship::RELATIONSHIP_DEP && this->object && this->object->getObjectType()==BASE_RELATIONSHIP)) return(QSize(640, 320)); - else if(rel_gen_rb->isChecked()) + else if(BaseRelationship::RELATIONSHIP_GEN) return(QSize(640, 520)); else return(QSize(640, 680)); diff --git a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui index e5715488b2..8d7c9d5c92 100644 --- a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui +++ b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui @@ -1811,6 +1811,50 @@ + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Partitioning + + + + :/icones/icones/relationshippart.png:/icones/icones/relationshippart.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + diff --git a/libpgmodeler_ui/ui/relationshipconfigwidget.ui b/libpgmodeler_ui/ui/relationshipconfigwidget.ui index 76c7f8e4b8..db89e5ad41 100644 --- a/libpgmodeler_ui/ui/relationshipconfigwidget.ui +++ b/libpgmodeler_ui/ui/relationshipconfigwidget.ui @@ -749,33 +749,7 @@ - - - - One to one (1:1) - - - - - One to many (1:n) - - - - - Many to many (n:n) - - - - - Generalization - - - - - Copy - - - + diff --git a/libpgmodeler_ui/ui/relationshipwidget.ui b/libpgmodeler_ui/ui/relationshipwidget.ui index fce87e4987..64a92332d3 100644 --- a/libpgmodeler_ui/ui/relationshipwidget.ui +++ b/libpgmodeler_ui/ui/relationshipwidget.ui @@ -504,212 +504,34 @@ - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - true - - - - One to one relationship - - - &1-1 - - - - - - - false - - - - 0 - 0 - - + - 0 - 0 + 22 + 22 - 16777215 - 16777215 + 22 + 22 - - - true - - - - One to many relationship - - - 1-n + + true - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - + - true + 75 + true - - Many to many relationship - - - n-n - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - true - - - - Generalization relationship (inheritance) - - - &gen - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - true - - - - Dependency / Copy relationship - - - dep - - - - - - - false - - - - 0 - 0 - - - - - 50 - 0 - - - - - true - - - - Relationship generated via foreign key - - fk + rel_type @@ -1524,12 +1346,6 @@ rel_attribs_tbw - rel_11_rb - rel_1n_rb - rel_nn_rb - rel_gen_rb - rel_dep_rb - rel_fk_rb table1_mand_chk table2_mand_chk relnn_tab_name_edt diff --git a/schemas/xml/dtd/relationship.dtd b/schemas/xml/dtd/relationship.dtd index 5db5cefc53..f30a07d9dd 100644 --- a/schemas/xml/dtd/relationship.dtd +++ b/schemas/xml/dtd/relationship.dtd @@ -10,7 +10,7 @@ - + diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 62771ba2c0..3b35380470 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -24,3 +24,4 @@ + diff --git a/schemas/xml/relationship.sch b/schemas/xml/relationship.sch index 57f449a3b6..0f89db78a7 100644 --- a/schemas/xml/relationship.sch +++ b/schemas/xml/relationship.sch @@ -53,7 +53,7 @@ $br $tb [ dst-table=] "{dst-table}" %end -%if %not {relgen} %and %not {reldep} %then +%if %not {relgen} %and %not {reldep} %and %not {relpart} %then $br $tb [ src-required=] %if {src-required} %then "true" %else "false" %end [ dst-required=] %if {dst-required} %then "true" %else "false" %end diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index 652ea356fc..70f5399860 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -13,6 +13,7 @@ %if {faded-out} %then [ faded-out=] "true" %end %if {rls-enabled} %then [ rls-enabled=] "true" %end %if {rls-forced} %then [ rls-forced=] "true" %end + %if {partitioning-type} %then [ partitioning-type=] "{partitioning-type}" %end %if {max-obj-count} %then [ max-obj-count=] "{max-obj-count}" %end > $br From 38dbb843ffd343473205d438dd62f70ec763a9fe Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 21 Sep 2018 09:38:29 -0300 Subject: [PATCH 125/425] Created the class PartitionKey to handle the partition key elements Changed the way partitioning type is saved to table's xml --- libobjrenderer/src/relationshipview.cpp | 9 +++--- libparsers/src/parsersattributes.cpp | 2 +- libparsers/src/parsersattributes.h | 2 +- libpgmodeler/libpgmodeler.pro | 6 ++-- libpgmodeler/src/databasemodel.cpp | 7 ++++- libpgmodeler/src/partitionkey.cpp | 29 ++++++++++++++++++ libpgmodeler/src/partitionkey.h | 39 +++++++++++++++++++++++++ libpgmodeler/src/table.cpp | 4 +-- schemas/xml/dtd/table.dtd | 6 +++- schemas/xml/partitionkey.sch | 16 ++++++++++ schemas/xml/table.sch | 9 +++++- 11 files changed, 115 insertions(+), 14 deletions(-) create mode 100644 libpgmodeler/src/partitionkey.cpp create mode 100644 libpgmodeler/src/partitionkey.h create mode 100644 schemas/xml/partitionkey.sch diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 485628672b..1cae030f86 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1301,11 +1301,10 @@ void RelationshipView::configureDescriptor(void) } else if(rel_type==BaseRelationship::RELATIONSHIP_PART) { - pol.append(QPointF(0,9)); pol.append(QPointF(9,9)); - pol.append(QPointF(3,3)); pol.append(QPointF(6,0)); - pol.append(QPointF(17,11)); pol.append(QPointF(17,12)); - pol.append(QPointF(6,23)); pol.append(QPointF(3,20)); - pol.append(QPointF(9,14)); pol.append(QPointF(0,14)); + pol.append(QPointF(0,5)); pol.append(QPointF(10,5)); + pol.append(QPointF(10,0)); pol.append(QPointF(19,9)); + pol.append(QPointF(10,18)); pol.append(QPointF(10,13)); + pol.append(QPointF(0,13)); } else { diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index e6033040ed..eb4eb51e8f 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -360,7 +360,7 @@ namespace ParsersAttributes { PARENTS=QString("parents"), PARSABLE=QString("parsable"), PARTIAL_MATCH=QString("partial-match"), - PARTITIONING_TYPE=QString("partitioning-type"), + PARTITIONING=QString("partitioning"), PASSWORD=QString("password"), PASSWORD_ENCRYPTION=QString("password-encryption"), PATH=QString("path"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 22557e6430..c3527eb6ec 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -367,7 +367,7 @@ namespace ParsersAttributes { PARENTS, PARSABLE, PARTIAL_MATCH, - PARTITIONING_TYPE, + PARTITIONING, PASSWORD, PASSWORD_ENCRYPTION, PATH, diff --git a/libpgmodeler/libpgmodeler.pro b/libpgmodeler/libpgmodeler.pro index 96a255a38f..acf330c818 100644 --- a/libpgmodeler/libpgmodeler.pro +++ b/libpgmodeler/libpgmodeler.pro @@ -60,7 +60,8 @@ HEADERS += src/textbox.h \ src/tag.h \ src/eventtrigger.h \ src/genericsql.h \ - src/policy.h + src/policy.h \ + src/partitionkey.h SOURCES += src/textbox.cpp \ src/domain.cpp \ @@ -109,7 +110,8 @@ SOURCES += src/textbox.cpp \ src/eventtrigger.cpp \ src/operation.cpp \ src/genericsql.cpp \ - src/policy.cpp + src/policy.cpp \ + src/partitionkey.cpp unix|windows: LIBS += -L$$OUT_PWD/../libparsers/ -lparsers \ -L$$OUT_PWD/../libutils/ -lutils diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index ecf0b4fa77..3e99011b08 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4652,7 +4652,6 @@ Table *DatabaseModel::createTable(void) table->setGenerateAlterCmds(attribs[ParsersAttributes::GEN_ALTER_CMDS]==ParsersAttributes::_TRUE_); table->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); table->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); - table->setPartitioningType(PartitioningType(attribs[ParsersAttributes::PARTITIONING_TYPE])); if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) { @@ -4719,6 +4718,12 @@ Table *DatabaseModel::createTable(void) xmlparser.restorePosition(); } + else if(elem==ParsersAttributes::PARTITIONING) + { + xmlparser.getElementAttributes(aux_attribs); + table->setPartitioningType(aux_attribs[ParsersAttributes::TYPE]); +#warning "TODO: load partitionkey tag data" + } //Retrieving initial data else if(elem==ParsersAttributes::INITIAL_DATA) { diff --git a/libpgmodeler/src/partitionkey.cpp b/libpgmodeler/src/partitionkey.cpp new file mode 100644 index 0000000000..a83b86f935 --- /dev/null +++ b/libpgmodeler/src/partitionkey.cpp @@ -0,0 +1,29 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "partitionkey.h" + +PartitionKey::PartitionKey(void) +{ + +} + +QString PartitionKey::getCodeDefinition(unsigned def_type) +{ + +} diff --git a/libpgmodeler/src/partitionkey.h b/libpgmodeler/src/partitionkey.h new file mode 100644 index 0000000000..7b1357e7dc --- /dev/null +++ b/libpgmodeler/src/partitionkey.h @@ -0,0 +1,39 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler +\brief Implements the operations to manipulate partition key elements. +*/ + +#ifndef PARTITION_KEY_H +#define PARTITION_KEY_H + +#include "element.h" + +class PartitionKey: public Element { + private: + + public: + PartitionKey(void); + + //! \brief Returns the SQL / XML code definition for the partition key + virtual QString getCodeDefinition(unsigned def_type) final; +}; + +#endif diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index b27d6864fb..ea14fa7d94 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -41,7 +41,7 @@ Table::Table(void) : BaseTable() attributes[ParsersAttributes::INITIAL_DATA]=QString(); attributes[ParsersAttributes::RLS_ENABLED]=QString(); attributes[ParsersAttributes::RLS_FORCED]=QString(); - attributes[ParsersAttributes::PARTITIONING_TYPE]=QString(); + attributes[ParsersAttributes::PARTITIONING]=QString(); copy_table=partioned_table=nullptr; partitioning_type=BaseType::null; @@ -1460,7 +1460,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); attributes[ParsersAttributes::TAG]=QString(); attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::PARTITIONING_TYPE]=~partitioning_type; + attributes[ParsersAttributes::PARTITIONING]=~partitioning_type; if(def_type==SchemaParser::SQL_DEFINITION && copy_table) attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 3b35380470..24d78b33a5 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -8,8 +8,12 @@ %constraint; + - + + + + diff --git a/schemas/xml/partitionkey.sch b/schemas/xml/partitionkey.sch new file mode 100644 index 0000000000..3e27e70aed --- /dev/null +++ b/schemas/xml/partitionkey.sch @@ -0,0 +1,16 @@ +# XML definition for indexes elements +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$tb $tb $br + +%if {column} %then + $tb $tb $tb [ $br +%else + $tb $tb $tb $br +%end + +%if {opclass} %then + $tb $tb $tb {opclass} +%end + +$tb $tb $br diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index 70f5399860..2ff2b5e303 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -13,7 +13,6 @@ %if {faded-out} %then [ faded-out=] "true" %end %if {rls-enabled} %then [ rls-enabled=] "true" %end %if {rls-forced} %then [ rls-forced=] "true" %end - %if {partitioning-type} %then [ partitioning-type=] "{partitioning-type}" %end %if {max-obj-count} %then [ max-obj-count=] "{max-obj-count}" %end > $br @@ -32,6 +31,14 @@ %if {col-indexes} %then {col-indexes} %end %if {constr-indexes} %then {constr-indexes} %end + %if {partitioning} %then + $tb [] $br + $tb $tb [] $br + $tb $tb $tb [] $br + $tb $tb [] $br + $tb [] $br + %end + %if {initial-data} %then $tb $br From f55e14e78837fe0fc932b5cf1bf954b28953c627 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 24 Sep 2018 09:09:53 -0300 Subject: [PATCH 126/425] Added some validations when creating partitioning relationships --- libobjrenderer/src/relationshipview.cpp | 7 +++---- libpgmodeler/src/databasemodel.cpp | 4 +++- libpgmodeler/src/relationship.cpp | 14 ++++++++++---- libpgmodeler/src/table.cpp | 5 +++++ libpgmodeler/src/table.h | 3 +++ libpgmodeler_ui/src/modelwidget.cpp | 12 ++++++------ libutils/src/exception.cpp | 3 ++- libutils/src/exception.h | 3 ++- schemas/sql/paritionkey.sch | 18 ++++++++++++++++++ 9 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 schemas/sql/paritionkey.sch diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 1cae030f86..e843086fb6 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1301,10 +1301,9 @@ void RelationshipView::configureDescriptor(void) } else if(rel_type==BaseRelationship::RELATIONSHIP_PART) { - pol.append(QPointF(0,5)); pol.append(QPointF(10,5)); - pol.append(QPointF(10,0)); pol.append(QPointF(19,9)); - pol.append(QPointF(10,18)); pol.append(QPointF(10,13)); - pol.append(QPointF(0,13)); + pol.append(QPointF(0,4)); pol.append(QPointF(4,0)); + pol.append(QPointF(18,12)); pol.append(QPointF(4,24)); + pol.append(QPointF(0,20)); pol.append(QPointF(10,12)); } else { diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 3e99011b08..ea9323c31b 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -6561,9 +6561,11 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab /* Relationship validation condition: > Case the object is a column and its reference by the parent table primary key + > Case the parent table is a partition and a column is being removed > Case the object is a constraint and its a table primary key */ revalidate_rels=((obj_type==OBJ_COLUMN && - parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::primary_key)) || + (parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::primary_key) || + parent_tab->isPartition())) || (obj_type==OBJ_CONSTRAINT && dynamic_cast(object)->getConstraintType()==ConstraintType::primary_key)); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 9272d5cca8..1398cdcd3d 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -69,6 +69,12 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, .arg(dst_tab->getName(true)) .arg(src_tab->getCopyTable()->getName(true)), ERR_COPY_REL_TAB_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + else if(rel_type==RELATIONSHIP_PART && src_tab->getPartitionedTable()) + throw Exception(Exception::getErrorMessage(ERR_PART_REL_PATITIONED_DEFINED) + .arg(src_tab->getName(true)) + .arg(dst_tab->getName(true)) + .arg(src_tab->getPartitionedTable()->getName(true)), + ERR_PART_REL_PATITIONED_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); copy_options=copy_op; table_relnn=nullptr; @@ -2380,8 +2386,8 @@ bool Relationship::isInvalidated(void) { col_aux1 = table1->getColumn(i); col_aux = table->getColumn(col_aux1->getName(true)); - valid = col_aux && (col_aux->getType().isEquivalentTo(col_aux1->getType()) || - col_aux->getType().getAliasType().isEquivalentTo(col_aux1->getType())); + valid = col_aux && col_aux1 && (col_aux->getType().isEquivalentTo(col_aux1->getType()) || + col_aux->getType().getAliasType().isEquivalentTo(col_aux1->getType())); } } @@ -2393,8 +2399,8 @@ bool Relationship::isInvalidated(void) { col_aux = table->getColumn(i); col_aux1 = table1->getColumn(col_aux->getName(true)); - valid = col_aux && (col_aux->getType().isEquivalentTo(col_aux1->getType()) || - col_aux->getType().getAliasType().isEquivalentTo(col_aux1->getType())); + valid = col_aux && col_aux1 && (col_aux->getType().isEquivalentTo(col_aux1->getType()) || + col_aux->getType().getAliasType().isEquivalentTo(col_aux1->getType())); } //Checking if the check constraints were not renamed in the parent table diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index ea14fa7d94..598079910c 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -111,6 +111,11 @@ PartitioningType Table::getPartitioningType(void) return(partitioning_type); } +Table *Table::getPartitionedTable(void) +{ + return(partioned_table); +} + void Table::setProtected(bool value) { ObjectType obj_types[]={ OBJ_COLUMN, OBJ_CONSTRAINT, diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 31ec57b160..5bb5ea2231 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -148,6 +148,9 @@ class Table: public BaseTable { //! \brief Returns the current partitioning type defined for the table PartitioningType getPartitioningType(void); + //! \brief Returns the partitioned table which this table is a partition of + Table *getPartitionedTable(void); + //! \brief Adds an object to the table. It can be inserted at a specified index 'obj_idx'. void addObject(BaseObject *obj, int obj_idx=-1); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 46d18b29a0..14f0d74158 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2854,10 +2854,10 @@ void ModelWidget::removeObjects(bool cascade) parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : OBJ_DATABASE); objs_map[object->getObjectId()]=std::make_tuple(object, - obj_name, - obj_type, - parent_name, - parent_type); + obj_name, + obj_type, + parent_name, + parent_type); } } @@ -2882,7 +2882,7 @@ void ModelWidget::removeObjects(bool cascade) else if(parent_type!=OBJ_DATABASE) { /* If the parent table does not exist on the model of the object to be removed - does not exists in parent table, it'll not be processed */ + * does not exists in parent table, it'll not be processed */ table=dynamic_cast(db_model->getObject(parent_name, parent_type)); if(!table || (table && table->getObjectIndex(obj_name, obj_type) < 0)) continue; @@ -2931,7 +2931,7 @@ void ModelWidget::removeObjects(bool cascade) aux_table=dynamic_cast
(table); if(aux_table && obj_type==OBJ_CONSTRAINT && - dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::foreign_key) + dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::foreign_key) db_model->updateTableFKRelationships(aux_table); table->setModified(true); diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 7877bc9f00..cbc9b347fc 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -204,7 +204,8 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_OBJECT_REFERENCING_ITSELF", QT_TR_NOOP("The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object!")}, {"ERR_ASG_INV_OPFAM_OPCLSELEM", QT_TR_NOOP("Only operator families which uses `btree' as indexing method are accepted by operator class elements!")}, {"ERR_REF_INV_LIKE_OP_TYPE", QT_TR_NOOP("Reference to an invalid copy table option!")}, - {"ERR_COPY_REL_TAB_DEFINED", QT_TR_NOOP("Copy relationship between tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table!")}, + {"ERR_COPY_REL_TAB_DEFINED", QT_TR_NOOP("The copy relationship between the tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table!")}, + {"ERR_PART_REL_PATITIONED_DEFINED", QT_TR_NOOP("The paritioning relationship between the tables `%1' and `%2' cannot be done because the first one is already a partition of the table `%3'! Partition tables can be participating of only one partition hierarchy at a time!")}, {"ERR_TABLE_TRIG_INSTEADOF_FIRING",QT_TR_NOOP("The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers!")}, {"ERR_TRIGGER_INV_TRUNCATE_USAGE",QT_TR_NOOP("The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table!")}, {"ERR_TRIGGER_INV_INSTEADOF_USAGE",QT_TR_NOOP("The INSTEAD OF mode cannot be used on view triggers that executes for each statement!")}, diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 2a2a7c7cf5..2050be8429 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -233,6 +233,7 @@ enum ErrorType { ERR_ASG_INV_OPFAM_OPCLSELEM, ERR_REF_INV_LIKE_OP_TYPE, ERR_COPY_REL_TAB_DEFINED, + ERR_PART_REL_PATITIONED_DEFINED, ERR_TABLE_TRIG_INSTEADOF_FIRING, ERR_TRIGGER_INV_TRUNCATE_USAGE, ERR_TRIGGER_INV_INSTEADOF_USAGE, @@ -286,7 +287,7 @@ enum ErrorType { class Exception { private: - static const int ERROR_COUNT=235; + static const int ERROR_COUNT=236; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ diff --git a/schemas/sql/paritionkey.sch b/schemas/sql/paritionkey.sch new file mode 100644 index 0000000000..2868ac2c50 --- /dev/null +++ b/schemas/sql/paritionkey.sch @@ -0,0 +1,18 @@ +# SQL definition for partition key elements +# PostgreSQL Version: 10.x +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$br $tb $sp $tb + +%if {column} %then + {column} +%else + %if {expression} %then + ({expression}) + %end +%end + +%if {opclass} %then + $tb $tb $tb {opclass} +%end From 55ae5a8c3029f7ba5c74fa8d9446575266669983 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 24 Sep 2018 17:26:32 -0300 Subject: [PATCH 127/425] Added a tab "Partition keys" that will handle partitioning configuration on TableWidget Added a method in ObjectsTableWidget to hide some horizontal header sections Added a missing validation to BaseRelationship --- libpgmodeler/src/baserelationship.cpp | 3 +- libpgmodeler/src/element.h | 1 + libpgmodeler/src/table.cpp | 7 +- libpgmodeler/src/table.h | 7 + libpgmodeler_ui/src/elementswidget.cpp | 41 ++++- libpgmodeler_ui/src/elementswidget.h | 11 +- libpgmodeler_ui/src/objectstablewidget.cpp | 8 + libpgmodeler_ui/src/objectstablewidget.h | 3 + libpgmodeler_ui/src/tablewidget.cpp | 31 +++- libpgmodeler_ui/src/tablewidget.h | 3 +- libpgmodeler_ui/ui/elementswidget.ui | 4 +- libpgmodeler_ui/ui/tablewidget.ui | 199 ++++++++++++++------- libutils/src/exception.cpp | 2 +- 13 files changed, 235 insertions(+), 85 deletions(-) diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 39d52acb3a..738f870c89 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -128,8 +128,7 @@ void BaseRelationship::configureRelationship(void) /* Raises an error if the relationship type is generalization or dependency and the source and destination table are the same. */ - if((rel_type==RELATIONSHIP_GEN || - rel_type==RELATIONSHIP_DEP) && src_table==dst_table) + if((rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_DEP || rel_type==RELATIONSHIP_PART) && src_table==dst_table) throw Exception(ERR_INV_INH_COPY_PART_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Allocates the textbox for the name label diff --git a/libpgmodeler/src/element.h b/libpgmodeler/src/element.h index 181161a8bb..f2347d963f 100644 --- a/libpgmodeler/src/element.h +++ b/libpgmodeler/src/element.h @@ -45,6 +45,7 @@ class Element { /*! \brief Sorting attributes of the element (ASC|DESC, NULLS [FIRST|LAST]) This attibutes can be configured used the constants ASC_ORDER and nullptrS_FIRST */ bool sorting_attibs[2], + //! \brief Enable the use of the sort attributes sorting_enabled; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 598079910c..19fe730e59 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1690,7 +1690,12 @@ vector Table::getObjects(bool excl_cols_constr) vector Table::getObjects(void) { - return(getObjects(false)); + return(getObjects(false)); +} + +vector Table::getPartitionKeys(void) +{ + return(partition_keys); } void Table::setCodeInvalidated(bool value) diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 5bb5ea2231..8061e734fc 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -36,6 +36,7 @@ #include "role.h" #include "policy.h" #include "copyoptions.h" +#include "partitionkey.h" #include class Table: public BaseTable { @@ -55,6 +56,9 @@ class Table: public BaseTable { //! \brief Stores the tables that 'this' object inherits attributes vector
ancestor_tables; + //! \brief Stores the partition keys of the table partitioning being used + vector partition_keys; + //! \brief Stores the table which this one is partition of Table *partioned_table; @@ -327,6 +331,9 @@ class Table: public BaseTable { //! \brief Returns all child objects of the table. This is the same as call getObjects(false) vector getObjects(void); + //! \brief Returns all the partition keys used by the table + vector getPartitionKeys(void); + /*! \brief Stores on the specified vector 'fks' the foreign key present on table. The boolean paramenter is used to include those foreign keys includes by relationship. The third parameter is used to filter the search, including only the foreign keys that references the specified table */ diff --git a/libpgmodeler_ui/src/elementswidget.cpp b/libpgmodeler_ui/src/elementswidget.cpp index e4f7b34799..b4290f8bd4 100644 --- a/libpgmodeler_ui/src/elementswidget.cpp +++ b/libpgmodeler_ui/src/elementswidget.cpp @@ -23,7 +23,7 @@ ElementsWidget::ElementsWidget(QWidget *parent) : QWidget(parent) try { map > fields_map; - QFrame *frame=nullptr; + warning_frame=nullptr; setupUi(this); elem_expr_hl=new SyntaxHighlighter(elem_expr_txt, false, true); @@ -52,9 +52,9 @@ ElementsWidget::ElementsWidget(QWidget *parent) : QWidget(parent) element_grid->addWidget(elements_tab, 7,0,1,3); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_91)].push_back(collation_lbl); - frame=BaseObjectWidget::generateVersionWarningFrame(fields_map); - element_grid->addWidget(frame, element_grid->count()+1, 0, 1, 3); - frame->setParent(this); + warning_frame=BaseObjectWidget::generateVersionWarningFrame(fields_map); + element_grid->addWidget(warning_frame, element_grid->count()+1, 0, 1, 3); + warning_frame->setParent(this); connect(elements_tab, SIGNAL(s_rowAdded(int)), this, SLOT(handleElement(int))); connect(elements_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(handleElement(int))); @@ -123,12 +123,12 @@ void ElementsWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) updateColumnsCombo(); } -void ElementsWidget::setAttributes(DatabaseModel *model, BaseTable *table, vector &elems) +void ElementsWidget::setAttributes(DatabaseModel *model, BaseTable *table, vector elems) { setAttributes(model, table); collation_sel->setVisible(true); collation_lbl->setVisible(true); - + warning_frame->setVisible(true); elements_tab->setHeaderLabel(trUtf8("Collation"), 2); elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("collation")),2); elements_tab->blockSignals(true); @@ -142,7 +142,7 @@ void ElementsWidget::setAttributes(DatabaseModel *model, BaseTable *table, vecto elements_tab->blockSignals(false); } -void ElementsWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, vector &elems) +void ElementsWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, vector elems) { setAttributes(model, parent_obj); operator_sel->setVisible(true); @@ -161,6 +161,32 @@ void ElementsWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, elements_tab->blockSignals(false); } +void ElementsWidget::setAttributes(DatabaseModel *model, BaseTable *table, vector elems) +{ + setAttributes(model, table); + elements_tab->setHeaderVisible(2, false); + elements_tab->setHeaderVisible(4, false); + elements_tab->setHeaderVisible(5, false); + + collation_sel->setVisible(false); + collation_lbl->setVisible(false); + sorting_chk->setVisible(false); + ascending_rb->setVisible(false); + descending_rb->setVisible(false); + nulls_first_chk->setVisible(false); + warning_frame->setVisible(false); + elements_tab->blockSignals(true); + +#warning "TODO: handle partition keys" + for(unsigned i=0; i < elems.size(); i++) + { + //elements_tab->addRow(); + //showElementData(elems[i], i); + } + + elements_tab->blockSignals(false); +} + void ElementsWidget::clear(void) { column_cmb->clear(); @@ -178,6 +204,7 @@ void ElementsWidget::clear(void) collation_sel->setVisible(false); collation_lbl->setVisible(false); + warning_frame->setVisible(false); operator_sel->setVisible(false); operator_lbl->setVisible(false); } diff --git a/libpgmodeler_ui/src/elementswidget.h b/libpgmodeler_ui/src/elementswidget.h index a14045141d..7d9dc4d709 100644 --- a/libpgmodeler_ui/src/elementswidget.h +++ b/libpgmodeler_ui/src/elementswidget.h @@ -30,6 +30,7 @@ #include "objectstablewidget.h" #include "objectselectorwidget.h" #include "baseobjectwidget.h" +#include "partitionkey.h" /* Declaring the IndexElement and ExcludeElement class as a Qt metatype in order to permit that instances of the class be used as data of QVariant and QMetaType */ @@ -40,6 +41,9 @@ Q_DECLARE_METATYPE(ExcludeElement) class ElementsWidget: public QWidget, public Ui::ElementsWidget { private: Q_OBJECT + + QFrame *warning_frame; + //! \brief Parent object (table or relationship) from which the columns will be referenced on the elements BaseObject *parent_obj; @@ -71,10 +75,13 @@ class ElementsWidget: public QWidget, public Ui::ElementsWidget { ElementsWidget(QWidget *parent = 0); //! \brief Enables the widget to handle index elements - void setAttributes(DatabaseModel *model, BaseTable *table, vector &elems); + void setAttributes(DatabaseModel *model, BaseTable *table, vector elems); //! \brief Enables the widget to handle exclude constraint elements - void setAttributes(DatabaseModel *model, BaseObject *parent_obj, vector &elems); + void setAttributes(DatabaseModel *model, BaseObject *parent_obj, vector elems); + + //! \brief Enables the widget to handle partition key elements + void setAttributes(DatabaseModel *model, BaseTable *table, vector elems); //! \brief Copy the current elements into the list void getElements(vector &elems); diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 4b59c4ca88..978c4d68df 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -139,6 +139,14 @@ void ObjectsTableWidget::setHeaderLabel(const QString &label, unsigned col_idx) item->setText(label); } +void ObjectsTableWidget::setHeaderVisible(unsigned col_idx, bool visible) +{ + if(col_idx >= static_cast(table_tbw->columnCount())) + throw Exception(ERR_REF_COL_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + table_tbw->horizontalHeader()->setSectionHidden(col_idx, !visible); +} + void ObjectsTableWidget::setHeaderIcon(const QIcon &icon, unsigned col_idx) { QTableWidgetItem *item=nullptr; diff --git a/libpgmodeler_ui/src/objectstablewidget.h b/libpgmodeler_ui/src/objectstablewidget.h index a68a0feb0e..1613bac278 100644 --- a/libpgmodeler_ui/src/objectstablewidget.h +++ b/libpgmodeler_ui/src/objectstablewidget.h @@ -62,6 +62,9 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { //! \brief Sets the specified column header label void setHeaderLabel(const QString &label, unsigned col_idx); + //! \brief Sets the specified column header to be visible or not + void setHeaderVisible(unsigned col_idx, bool visible); + //! \brief Sets the specified column header icon void setHeaderIcon(const QIcon &icon, unsigned col_idx); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 085d6848d6..3453bc65a8 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -30,11 +30,13 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) { QGridLayout *grid=nullptr; + QVBoxLayout *vbox=nullptr; ObjectsTableWidget *tab=nullptr; ObjectType types[]={ OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_POLICY }; map > fields_map; QFrame *frame=nullptr; QPushButton *edt_data_tb=nullptr; + QStringList part_types; Ui_TableWidget::setupUi(this); @@ -65,13 +67,15 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) parent_tables->setHeaderLabel(trUtf8("Type"), 2); parent_tables->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),2); - tag_sel=new ObjectSelectorWidget(OBJ_TAG, false, this); - dynamic_cast(options_gb->layout())->addWidget(tag_sel, 0, 1,1,3); + tag_sel = new ObjectSelectorWidget(OBJ_TAG, false, this); + vbox = new QVBoxLayout(tag_sel_parent); + vbox->addWidget(tag_sel); + vbox->setContentsMargins(0,0,0,0); grid=new QGridLayout; grid->addWidget(parent_tables, 0,0,1,1); grid->setContentsMargins(4,4,4,4); - attributes_tbw->widget(6)->setLayout(grid); + attributes_tbw->widget(7)->setLayout(grid); //Configuring the table objects that stores the columns, triggers, constraints, rules and indexes for(unsigned i=0; i <= 5; i++) @@ -163,9 +167,28 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) objects_tab_map[OBJ_POLICY]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),5); objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Alias"), 6); + partion_keys_tab = new ObjectsTableWidget; + partion_keys_tab->setEnabled(false); + partion_keys_tab->setColumnCount(3); + partion_keys_tab->setHeaderLabel(trUtf8("Element"), 0); + partion_keys_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + partion_keys_tab->setHeaderLabel(trUtf8("Type"), 1); + partion_keys_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + partion_keys_tab->setHeaderLabel(trUtf8("Operator Class"), 2); + partion_keys_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("opclass")),2); + grid = dynamic_cast(attributes_tbw->widget(6)->layout()); + grid->addWidget(partion_keys_tab, 1, 0, 1, 2); + + PartitioningType::getTypes(part_types); + part_types.push_front(trUtf8("None")); + partitioning_type_cmb->addItems(part_types); + + connect(partitioning_type_cmb, &QComboBox::currentTextChanged, [&](){ + partion_keys_tab->setEnabled(partitioning_type_cmb->currentIndex() != 0); + }); + configureFormLayout(table_grid, OBJ_TABLE); configureTabOrder({ tag_sel }); - setMinimumSize(660, 620); } diff --git a/libpgmodeler_ui/src/tablewidget.h b/libpgmodeler_ui/src/tablewidget.h index 2019e12fa7..d1914cd939 100644 --- a/libpgmodeler_ui/src/tablewidget.h +++ b/libpgmodeler_ui/src/tablewidget.h @@ -29,12 +29,13 @@ #include "ui_tablewidget.h" #include "objectstablewidget.h" #include "tableview.h" +#include "elementswidget.h" class TableWidget: public BaseObjectWidget, public Ui::TableWidget { private: Q_OBJECT - ObjectsTableWidget *parent_tables; + ObjectsTableWidget *parent_tables, *partion_keys_tab; ObjectSelectorWidget *tag_sel; diff --git a/libpgmodeler_ui/ui/elementswidget.ui b/libpgmodeler_ui/ui/elementswidget.ui index 8fa0ad6028..d96a4604a1 100644 --- a/libpgmodeler_ui/ui/elementswidget.ui +++ b/libpgmodeler_ui/ui/elementswidget.ui @@ -6,7 +6,7 @@ 0 0 - 385 + 538 210 @@ -60,7 +60,7 @@ false - + 0 0 diff --git a/libpgmodeler_ui/ui/tablewidget.ui b/libpgmodeler_ui/ui/tablewidget.ui index b04805a16a..b4f0ada1c3 100644 --- a/libpgmodeler_ui/ui/tablewidget.ui +++ b/libpgmodeler_ui/ui/tablewidget.ui @@ -6,7 +6,7 @@ 0 0 - 513 + 658 348 @@ -37,7 +37,7 @@ Options - + 4 @@ -50,30 +50,82 @@ 4 - - - - With OID - - - false + + + + 10 - + + + + With OID + + + false + + + + + + + + 0 + 0 + + + + Unlogged + + + + + + + + 0 + 0 + + + + Enable row level security + + + + + + + true + + + + 0 + 0 + + + + Force RLS for owner + + + + + + + + 0 + 0 + + + + Generate ALTER for columns/constraints + + + + - - - - - 0 - 0 - - - - Unlogged - - + + - + @@ -92,48 +144,6 @@ - - - - - 0 - 0 - - - - Enable row level security - - - - - - - true - - - - 0 - 0 - - - - Force RLS for owner - - - - - - - - 0 - 0 - - - - Generate ALTER for columns/constraints - - - @@ -172,6 +182,65 @@ &Policies + + + Partition &keys + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + Partitioning: + + + + + + + + + + 150 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Tables diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index cbc9b347fc..7a4d244dd1 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -67,7 +67,7 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_REF_ROLE_INV_INDEX", QT_TR_NOOP("Reference to a role which index is out of role list bounds!")}, {"ERR_INS_EMPTY_RULE_COMMAND", QT_TR_NOOP("Insertion of empty command to the rule!")}, {"ERR_REF_RULE_CMD_INV_INDEX", QT_TR_NOOP("Reference to a command which index is out of the command list bounds!")}, - {"ERR_INV_INH_COPY_PART_RELATIONSHIP", QT_TR_NOOP("Is not possible to create a self generalization/copy/partition relationship! The table can not inherit or copy its own attributes or be a partition of itself!")}, + {"ERR_INV_INH_COPY_PART_RELATIONSHIP", QT_TR_NOOP("It's not possible to create a self generalization/copy/partition relationship! The table can not inherit or copy its own attributes or be a partition of itself!")}, {"ERR_ASG_OBJ_BELONGS_OTHER_TABLE", QT_TR_NOOP("Assignment of an object that already belongs to another table!")}, {"ERR_ASG_SEQ_DIF_TABLE_SCHEMA", QT_TR_NOOP("Assignment of a schema to the sequence which differs from the schema of the owner table!")}, {"ERR_ASG_INV_VALUE_SEQ_ATTRIBS", QT_TR_NOOP("Assignment of an invalid value to one of the sequence attributes!")}, From 73f9882d03462056c9d6ef707eae6d7f031ba9aa Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 26 Sep 2018 09:25:06 -0300 Subject: [PATCH 128/425] Improved the Index/Exclude/ParitionKey elements handling by creating a generic form/grid that handles these kinds of objects (ElementsTableWidget) Modified the classes IndexWidget, ConstraintWidget and TableWidget to use the new element handling widget ElementsTableWidget --- libpgmodeler/src/element.h | 8 +- libpgmodeler_ui/libpgmodeler_ui.pro | 14 +- libpgmodeler_ui/src/constraintwidget.cpp | 9 +- libpgmodeler_ui/src/constraintwidget.h | 4 +- libpgmodeler_ui/src/elementstablewidget.cpp | 186 +++++++ libpgmodeler_ui/src/elementstablewidget.h | 132 +++++ libpgmodeler_ui/src/elementswidget.cpp | 462 ------------------ libpgmodeler_ui/src/elementwidget.cpp | 285 +++++++++++ .../src/{elementswidget.h => elementwidget.h} | 60 +-- libpgmodeler_ui/src/indexwidget.cpp | 31 +- libpgmodeler_ui/src/indexwidget.h | 9 +- libpgmodeler_ui/src/tablewidget.cpp | 11 +- libpgmodeler_ui/src/tablewidget.h | 6 +- .../{elementswidget.ui => elementwidget.ui} | 16 +- libutils/src/pgsqlversions.cpp | 12 +- libutils/src/pgsqlversions.h | 1 + main/src/main.cpp | 2 +- 17 files changed, 692 insertions(+), 556 deletions(-) create mode 100644 libpgmodeler_ui/src/elementstablewidget.cpp create mode 100644 libpgmodeler_ui/src/elementstablewidget.h delete mode 100644 libpgmodeler_ui/src/elementswidget.cpp create mode 100644 libpgmodeler_ui/src/elementwidget.cpp rename libpgmodeler_ui/src/{elementswidget.h => elementwidget.h} (58%) rename libpgmodeler_ui/ui/{elementswidget.ui => elementwidget.ui} (97%) diff --git a/libpgmodeler/src/element.h b/libpgmodeler/src/element.h index f2347d963f..01cab59455 100644 --- a/libpgmodeler/src/element.h +++ b/libpgmodeler/src/element.h @@ -26,6 +26,7 @@ #include "column.h" #include "operatorclass.h" +#include "collation.h" class Element { private: @@ -67,6 +68,8 @@ class Element { void setExpression(const QString &expression); void setOperatorClass(OperatorClass *oper_class); void setSortingEnabled(bool value); + virtual void setCollation(Collation *){} + virtual void setOperator(Operator *){} //! \brief Sets the state of one of the element sorting method void setSortingAttribute(unsigned attrib, bool value); @@ -77,9 +80,12 @@ class Element { Column *getColumn(void); QString getExpression(void); OperatorClass *getOperatorClass(void); + virtual Collation *getCollation(void){ return(nullptr); } + virtual Operator *getOperator(void){ return(nullptr); } + bool isSortingEnabled(void); - virtual QString getCodeDefinition(unsigned) = 0; + virtual QString getCodeDefinition(unsigned) { return(QString()); } bool operator == (Element &elem); }; diff --git a/libpgmodeler_ui/libpgmodeler_ui.pro b/libpgmodeler_ui/libpgmodeler_ui.pro index 98a312b443..579a3447d4 100644 --- a/libpgmodeler_ui/libpgmodeler_ui.pro +++ b/libpgmodeler_ui/libpgmodeler_ui.pro @@ -66,7 +66,6 @@ SOURCES += src/mainwindow.cpp \ src/pgmodelerplugin.cpp \ src/pluginsconfigwidget.cpp \ src/collationwidget.cpp \ - src/elementswidget.cpp \ src/modelexporthelper.cpp \ src/modelvalidationwidget.cpp \ src/modelvalidationhelper.cpp \ @@ -115,7 +114,9 @@ SOURCES += src/mainwindow.cpp \ src/objectstablewidget.cpp \ src/resultsetmodel.cpp \ src/referencewidget.cpp \ - src/sqlexecutionhelper.cpp + src/sqlexecutionhelper.cpp \ + src/elementstablewidget.cpp \ + src/elementwidget.cpp HEADERS += src/mainwindow.h \ @@ -169,7 +170,6 @@ HEADERS += src/mainwindow.h \ src/objectrenamewidget.h \ src/pluginsconfigwidget.h \ src/collationwidget.h \ - src/elementswidget.h \ src/modelexporthelper.h \ src/modelvalidationwidget.h \ src/modelvalidationhelper.h \ @@ -218,7 +218,9 @@ HEADERS += src/mainwindow.h \ src/objectstablewidget.h \ src/resultsetmodel.h \ src/referencewidget.h \ - src/sqlexecutionhelper.h + src/sqlexecutionhelper.h \ + src/elementstablewidget.h \ + src/elementwidget.h FORMS += ui/mainwindow.ui \ ui/textboxwidget.ui \ @@ -267,7 +269,6 @@ FORMS += ui/mainwindow.ui \ ui/pluginsconfigwidget.ui \ ui/schemawidget.ui \ ui/collationwidget.ui \ - ui/elementswidget.ui \ ui/modelvalidationwidget.ui \ ui/extensionwidget.ui \ ui/objectfinderwidget.ui \ @@ -302,7 +303,8 @@ FORMS += ui/mainwindow.ui \ ui/bulkdataeditwidget.ui \ ui/policywidget.ui \ ui/objectstablewidget.ui \ - ui/referencewidget.ui + ui/referencewidget.ui \ + ui/elementwidget.ui unix|windows: LIBS += -L$$OUT_PWD/../libobjrenderer/ -lobjrenderer \ -L$$OUT_PWD/../libpgconnector/ -lpgconnector \ diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 70e1fb0a9e..a55d9a405a 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -29,10 +29,10 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, OB Ui_ConstraintWidget::setupUi(this); - excl_elems_wgt=new ElementsWidget(this); + excl_elems_tab=new ElementsTableWidget(this); grid=new QGridLayout; grid->setContentsMargins(4,4,4,4); - grid->addWidget(excl_elems_wgt,0,0); + grid->addWidget(excl_elems_tab,0,0); excl_elems_grp->setLayout(grid); expression_hl=new SyntaxHighlighter(expression_txt, false, true); @@ -427,7 +427,8 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis } } - excl_elems_wgt->setAttributes(model, parent_obj, excl_elems); + excl_elems_tab->setAttributes(model, parent_obj); + excl_elems_tab->setElements(excl_elems); } void ConstraintWidget::applyConfiguration(void) @@ -479,7 +480,7 @@ void ConstraintWidget::applyConfiguration(void) } } - excl_elems_wgt->getElements(excl_elems); + excl_elems_tab->getElements(excl_elems); constr->addExcludeElements(excl_elems); //Raises an error if the user try to create a primary key that has columns added by relationship (not supported) diff --git a/libpgmodeler_ui/src/constraintwidget.h b/libpgmodeler_ui/src/constraintwidget.h index 531f64cb82..8899355f46 100644 --- a/libpgmodeler_ui/src/constraintwidget.h +++ b/libpgmodeler_ui/src/constraintwidget.h @@ -29,7 +29,7 @@ #include "ui_constraintwidget.h" #include "objectstablewidget.h" #include "messagebox.h" -#include "elementswidget.h" +#include "elementstablewidget.h" class ConstraintWidget: public BaseObjectWidget, public Ui::ConstraintWidget { private: @@ -39,7 +39,7 @@ class ConstraintWidget: public BaseObjectWidget, public Ui::ConstraintWidget { SyntaxHighlighter *expression_hl; - ElementsWidget *excl_elems_wgt; + ElementsTableWidget *excl_elems_tab; /*! \brief Table widgets used to store the columns that forms the constraint as well the referenced columns (only for foreign keys) */ diff --git a/libpgmodeler_ui/src/elementstablewidget.cpp b/libpgmodeler_ui/src/elementstablewidget.cpp new file mode 100644 index 0000000000..65057f5599 --- /dev/null +++ b/libpgmodeler_ui/src/elementstablewidget.cpp @@ -0,0 +1,186 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "elementstablewidget.h" +#include "generalconfigwidget.h" + +ElementsTableWidget::ElementsTableWidget(QWidget *parent) : QWidget(parent) +{ + try + { + handled_elem = nullptr; + model = nullptr; + parent_obj = nullptr; + + element_wgt = new ElementWidget; + element_form.setMainWidget(element_wgt); + element_form.setButtonConfiguration(); + connect(&element_form, SIGNAL(accepted()), element_wgt, SLOT(applyConfiguration())); + + QVBoxLayout *vbox = new QVBoxLayout(this); + elements_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ + (ObjectsTableWidget::UPDATE_BUTTON | ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + + elements_tab->setColumnCount(7); + elements_tab->setHeaderLabel(trUtf8("Element"), 0); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + elements_tab->setHeaderLabel(trUtf8("Type"), 1); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + elements_tab->setHeaderLabel(trUtf8("Operator"), 2); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("operator")),2); + elements_tab->setHeaderLabel(trUtf8("Operator Class"), 3); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("opclass")),3); + elements_tab->setHeaderLabel(trUtf8("Collation"), 4); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("collation")),4); + elements_tab->setHeaderLabel(trUtf8("Sorting"), 5); + elements_tab->setHeaderLabel(trUtf8("Nulls First"), 6); + + vbox->setContentsMargins(4,4,4,4); + vbox->addWidget(elements_tab); + + connect(elements_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addElement(int))); + connect(elements_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editElement(int))); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +ElementsTableWidget::~ElementsTableWidget(void) +{ + if(handled_elem) + delete(handled_elem); +} + +void ElementsTableWidget::showElementData(Element *elem, int elem_idx) +{ + if(!elem) + return; + + if(elem->getColumn()) + { + elements_tab->setCellText(elem->getColumn()->getName(), elem_idx, 0); + elements_tab->setCellText(elem->getColumn()->getTypeName(), elem_idx, 1); + } + else + { + elements_tab->setCellText(elem->getExpression(), elem_idx, 0); + elements_tab->setCellText(trUtf8("Expression"), elem_idx, 1); + } + + elements_tab->clearCellText(elem_idx, 2); + if(elem->getOperator()) + elements_tab->setCellText(elem->getOperator()->getSignature(true), elem_idx, 2); + + elements_tab->clearCellText(elem_idx, 3); + if(elem->getOperatorClass()) + elements_tab->setCellText(elem->getOperatorClass()->getName(true), elem_idx, 3); + + elements_tab->clearCellText(elem_idx, 4); + if(elem->getCollation()) + elements_tab->setCellText(elem->getCollation()->getName(true), elem_idx, 4); + + if(elem->isSortingEnabled()) + { + if(elem->getSortingAttribute(IndexElement::ASC_ORDER)) + elements_tab->setCellText(trUtf8("Ascending"), elem_idx, 5); + else + elements_tab->setCellText(trUtf8("Descending"), elem_idx, 5); + + if(elem->getSortingAttribute(IndexElement::NULLS_FIRST)) + elements_tab->setCellText(trUtf8("Yes"), elem_idx, 6); + else + elements_tab->setCellText(trUtf8("No"), elem_idx, 6); + } + else + { + elements_tab->clearCellText(elem_idx, 4); + elements_tab->clearCellText(elem_idx, 5); + } + + elements_tab->setRowData(copyElementData(elem), elem_idx); +} + +QVariant ElementsTableWidget::copyElementData(Element *elem) +{ + if(dynamic_cast(elem)) + return(QVariant::fromValue(*dynamic_cast(elem))); + + if(dynamic_cast(elem)) + return(QVariant::fromValue(*dynamic_cast(elem))); + + if(dynamic_cast(elem)) + return(QVariant::fromValue(*dynamic_cast(elem))); + + return(QVariant()); +} + +int ElementsTableWidget::openElementForm(Element *elem) +{ + int res = 0; + + GeneralConfigWidget::restoreWidgetGeometry(&element_form, element_wgt->metaObject()->className()); + element_wgt->setAttributes(model, parent_obj, elem); + element_form.setWindowTitle(element_wgt->windowTitle()); + res = element_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&element_form, element_wgt->metaObject()->className()); + + return(res); +} + +void ElementsTableWidget::editElement(int elem_idx) +{ + QVariant data = elements_tab->getRowData(elem_idx); + Element *elem = nullptr; + IndexElement idx_elem; + ExcludeElement exc_elem; + PartitionKey part_key; + int res = 0; + + if(data.canConvert()) + { + idx_elem = data.value(); + elem = &idx_elem; + } + + if(data.canConvert()) + { + exc_elem = data.value(); + elem = &exc_elem; + } + + if(data.canConvert()) + { + part_key = data.value(); + elem = &part_key; + } + + res = openElementForm(elem); + + if(elem && res == QDialog::Accepted) + showElementData(element_wgt->getElement(), elem_idx); +} + +void ElementsTableWidget::addElement(int elem_idx) +{ + if(openElementForm(handled_elem) == QDialog::Accepted) + showElementData(element_wgt->getElement(), elem_idx); + else + elements_tab->removeRow(elem_idx); +} diff --git a/libpgmodeler_ui/src/elementstablewidget.h b/libpgmodeler_ui/src/elementstablewidget.h new file mode 100644 index 0000000000..6c681679d7 --- /dev/null +++ b/libpgmodeler_ui/src/elementstablewidget.h @@ -0,0 +1,132 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler_ui +\class ElementsTableWidget +\brief Implements the operations to create/edit constraints (exclude), indexes and partition keys elements via form storing them on a objects table (grid). +*/ + +#ifndef ELEMENTS_TABLES_WIDGET_H +#define ELEMENTS_TABLES_WIDGET_H + +#include +#include "objectstablewidget.h" +#include "indexelement.h" +#include "excludeelement.h" +#include "partitionkey.h" +#include "baseform.h" +#include "elementwidget.h" + +/* Declaring the IndexElement and ExcludeElement class as a Qt metatype in order to permit + * that instances of the class be used as data of QVariant and QMetaType */ +#include +Q_DECLARE_METATYPE(IndexElement) +Q_DECLARE_METATYPE(ExcludeElement) +Q_DECLARE_METATYPE(PartitionKey) + +class ElementsTableWidget: public QWidget { + private: + Q_OBJECT + + Element *handled_elem; + + ElementWidget *element_wgt; + + BaseForm element_form; + + DatabaseModel *model; + + BaseObject *parent_obj; + + //! \brief Table widget used to control the index elements + ObjectsTableWidget *elements_tab; + + //! \brief Shows the element data on the elements table at the specified line + void showElementData(Element *elem, int elem_idx); + + QVariant copyElementData(Element *elem); + + int openElementForm(Element *elem); + + public: + ElementsTableWidget(QWidget *parent = 0); + ~ElementsTableWidget(void); + + template + void setAttributes(DatabaseModel *model, BaseObject *parent_obj) + { + if(handled_elem && !dynamic_cast(handled_elem)) + { + delete(handled_elem); + handled_elem = nullptr; + } + + if(!handled_elem) + handled_elem = new Class; + + this->model = model; + this->parent_obj = parent_obj; + + if(dynamic_cast(handled_elem)) + elements_tab->setHeaderVisible(2, false); + + if(dynamic_cast(handled_elem)) + elements_tab->setHeaderVisible(4, false); + + if(dynamic_cast(handled_elem)) + { + elements_tab->setHeaderVisible(2, false); + elements_tab->setHeaderVisible(4, false); + elements_tab->setHeaderVisible(5, false); + elements_tab->setHeaderVisible(6, false); + } + } + + template + void setElements(vector elems) + { + elements_tab->blockSignals(true); + for(auto &elem : elems) + { + elements_tab->addRow(); + showElementData(&elem, elements_tab->getRowCount() - 1); + } + elements_tab->blockSignals(false); + } + + template + void getElements(vector &elems) + { + if(elements_tab->getRowCount() > 0) + { + if(elements_tab->getRowData(0).canConvert()) + { + elems.clear(); + for(unsigned i=0; i < elements_tab->getRowCount(); i++) + elems.push_back(elements_tab->getRowData(i).value()); + } + } + } + + private slots: + void addElement(int elem_idx); + void editElement(int elem_idx); +}; + +#endif diff --git a/libpgmodeler_ui/src/elementswidget.cpp b/libpgmodeler_ui/src/elementswidget.cpp deleted file mode 100644 index b4290f8bd4..0000000000 --- a/libpgmodeler_ui/src/elementswidget.cpp +++ /dev/null @@ -1,462 +0,0 @@ -/* -# PostgreSQL Database Modeler (pgModeler) -# -# Copyright 2006-2018 - Raphael Araújo e Silva -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation version 3. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# The complete text of GPLv3 is at LICENSE file on source code root directory. -# Also, you can get the complete GNU General Public License at -*/ - -#include "elementswidget.h" - -ElementsWidget::ElementsWidget(QWidget *parent) : QWidget(parent) -{ - try - { - map > fields_map; - warning_frame=nullptr; - - setupUi(this); - elem_expr_hl=new SyntaxHighlighter(elem_expr_txt, false, true); - elem_expr_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); - - parent_obj=nullptr; - elements_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); - op_class_sel=new ObjectSelectorWidget(OBJ_OPCLASS, true, this); - collation_sel=new ObjectSelectorWidget(OBJ_COLLATION, true, this); - operator_sel=new ObjectSelectorWidget(OBJ_OPERATOR, true, this); - - - elements_tab->setColumnCount(6); - elements_tab->setHeaderLabel(trUtf8("Element"), 0); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); - elements_tab->setHeaderLabel(trUtf8("Type"), 1); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); - elements_tab->setHeaderLabel(trUtf8("Operator Class"), 3); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("opclass")),3); - elements_tab->setHeaderLabel(trUtf8("Sorting"), 4); - elements_tab->setHeaderLabel(trUtf8("Nulls First"), 5); - - element_grid->addWidget(collation_sel, 3,1,1,2); - element_grid->addWidget(op_class_sel, 4,1,1,2); - element_grid->addWidget(operator_sel, 5,1,1,2); - element_grid->addWidget(elements_tab, 7,0,1,3); - - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_91)].push_back(collation_lbl); - warning_frame=BaseObjectWidget::generateVersionWarningFrame(fields_map); - element_grid->addWidget(warning_frame, element_grid->count()+1, 0, 1, 3); - warning_frame->setParent(this); - - connect(elements_tab, SIGNAL(s_rowAdded(int)), this, SLOT(handleElement(int))); - connect(elements_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(handleElement(int))); - connect(elements_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editElement(int))); - connect(column_rb, SIGNAL(toggled(bool)), this, SLOT(selectElementObject(void))); - connect(expression_rb, SIGNAL(toggled(bool)), this, SLOT(selectElementObject(void))); - connect(sorting_chk, SIGNAL(toggled(bool)), ascending_rb, SLOT(setEnabled(bool))); - connect(sorting_chk, SIGNAL(toggled(bool)), descending_rb, SLOT(setEnabled(bool))); - connect(sorting_chk, SIGNAL(toggled(bool)), nulls_first_chk, SLOT(setEnabled(bool))); - - this->setEnabled(false); - collation_sel->setVisible(false); - collation_lbl->setVisible(false); - operator_sel->setVisible(false); - operator_lbl->setVisible(false); - - BaseObjectWidget::setRequiredField(operator_sel); - BaseObjectWidget::setRequiredField(operator_lbl); - - setTabOrder(column_rb, column_cmb); - setTabOrder(column_cmb, expression_rb); - setTabOrder(expression_rb, elem_expr_txt); - setTabOrder(elem_expr_txt, collation_sel); - setTabOrder(collation_sel, collation_sel->rem_object_tb); - setTabOrder(collation_sel->rem_object_tb, collation_sel->sel_object_tb); - setTabOrder(collation_sel->sel_object_tb, op_class_sel); - - setTabOrder(op_class_sel, op_class_sel->rem_object_tb); - setTabOrder(op_class_sel->rem_object_tb, op_class_sel->sel_object_tb); - setTabOrder(op_class_sel->sel_object_tb, sorting_chk); - - setTabOrder(sorting_chk, ascending_rb); - setTabOrder(ascending_rb, descending_rb); - setTabOrder(descending_rb, nulls_first_chk); - } - catch(Exception &e) - { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } -} - -void ElementsWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) -{ - if(!model || !parent_obj) - { - this->setEnabled(false); - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); - } - else if(parent_obj->getObjectType()!=OBJ_TABLE && - parent_obj->getObjectType()!=OBJ_VIEW && - parent_obj->getObjectType()!=OBJ_RELATIONSHIP) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); - - this->setEnabled(true); - this->parent_obj=parent_obj; - - op_class_sel->setModel(model); - collation_sel->setModel(model); - operator_sel->setModel(model); - - cols_combo_parent->setVisible(parent_obj->getObjectType() == OBJ_TABLE); - column_rb->setVisible(parent_obj->getObjectType() == OBJ_TABLE); - expression_rb->setChecked(parent_obj->getObjectType() == OBJ_VIEW); - - if(parent_obj->getObjectType() == OBJ_TABLE) - updateColumnsCombo(); -} - -void ElementsWidget::setAttributes(DatabaseModel *model, BaseTable *table, vector elems) -{ - setAttributes(model, table); - collation_sel->setVisible(true); - collation_lbl->setVisible(true); - warning_frame->setVisible(true); - elements_tab->setHeaderLabel(trUtf8("Collation"), 2); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("collation")),2); - elements_tab->blockSignals(true); - - for(unsigned i=0; i < elems.size(); i++) - { - elements_tab->addRow(); - showElementData(elems[i], i); - } - - elements_tab->blockSignals(false); -} - -void ElementsWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, vector elems) -{ - setAttributes(model, parent_obj); - operator_sel->setVisible(true); - operator_lbl->setVisible(true); - - elements_tab->setHeaderLabel(trUtf8("Operator"), 2); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("operator")),2); - elements_tab->blockSignals(true); - - for(unsigned i=0; i < elems.size(); i++) - { - elements_tab->addRow(); - showElementData(elems[i], i); - } - - elements_tab->blockSignals(false); -} - -void ElementsWidget::setAttributes(DatabaseModel *model, BaseTable *table, vector elems) -{ - setAttributes(model, table); - elements_tab->setHeaderVisible(2, false); - elements_tab->setHeaderVisible(4, false); - elements_tab->setHeaderVisible(5, false); - - collation_sel->setVisible(false); - collation_lbl->setVisible(false); - sorting_chk->setVisible(false); - ascending_rb->setVisible(false); - descending_rb->setVisible(false); - nulls_first_chk->setVisible(false); - warning_frame->setVisible(false); - elements_tab->blockSignals(true); - -#warning "TODO: handle partition keys" - for(unsigned i=0; i < elems.size(); i++) - { - //elements_tab->addRow(); - //showElementData(elems[i], i); - } - - elements_tab->blockSignals(false); -} - -void ElementsWidget::clear(void) -{ - column_cmb->clear(); - sorting_chk->setEnabled(true); - - elements_tab->blockSignals(true); - elements_tab->removeRows(); - elements_tab->blockSignals(false); - - op_class_sel->clearSelector(); - operator_sel->clearSelector(); - elem_expr_txt->clear(); - ascending_rb->setChecked(true); - column_rb->setChecked(true); - - collation_sel->setVisible(false); - collation_lbl->setVisible(false); - warning_frame->setVisible(false); - operator_sel->setVisible(false); - operator_lbl->setVisible(false); -} - -void ElementsWidget::updateColumnsCombo(void) -{ - Table *table = dynamic_cast
(parent_obj); - Relationship *rel = dynamic_cast(parent_obj); - Column *column=nullptr; - unsigned i, col_count=0; - - try - { - column_cmb->clear(); - column_cmb->setVisible(true); - column_rb->setVisible(true); - - if(table) - { - col_count=table->getColumnCount(); - for(i=0; i < col_count; i++) - { - column=table->getColumn(i); - column_cmb->addItem(column->getName(), - QVariant::fromValue(column)); - } - } - else if(rel) - { - col_count=rel->getAttributeCount(); - for(i=0; i < col_count; i++) - { - column=rel->getAttribute(i); - column_cmb->addItem(column->getName(), - QVariant::fromValue(column)); - } - } - } - catch(Exception &e) - { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } -} - -void ElementsWidget::showElementData(IndexElement elem, int elem_idx) -{ - showElementData(&elem, elem_idx); -} - -void ElementsWidget::showElementData(ExcludeElement elem, int elem_idx) -{ - showElementData(&elem, elem_idx); -} - -void ElementsWidget::showElementData(Element *elem, int elem_idx) -{ - IndexElement *idxelem = dynamic_cast(elem); - ExcludeElement *excelem = dynamic_cast(elem); - - if(elem->getColumn()) - { - elements_tab->setCellText(elem->getColumn()->getName(), elem_idx, 0); - elements_tab->setCellText(elem->getColumn()->getTypeName(), elem_idx, 1); - } - else - { - elements_tab->setCellText(elem->getExpression(), elem_idx, 0); - elements_tab->setCellText(trUtf8("Expression"), elem_idx, 1); - } - - elements_tab->clearCellText(elem_idx, 2); - if(idxelem && idxelem->getCollation()) - elements_tab->setCellText(idxelem->getCollation()->getName(true), elem_idx, 2); - else if(excelem && excelem->getOperator()) - elements_tab->setCellText(excelem->getOperator()->getSignature(true), elem_idx, 2); - - elements_tab->clearCellText(elem_idx, 3); - if(elem->getOperatorClass()) - elements_tab->setCellText(elem->getOperatorClass()->getName(true), elem_idx, 3); - - if(elem->isSortingEnabled()) - { - if(elem->getSortingAttribute(IndexElement::ASC_ORDER)) - elements_tab->setCellText(ascending_rb->text(), elem_idx, 4); - else - elements_tab->setCellText(descending_rb->text(), elem_idx, 4); - - if(elem->getSortingAttribute(IndexElement::NULLS_FIRST)) - elements_tab->setCellText(trUtf8("Yes"), elem_idx, 5); - else - elements_tab->setCellText(trUtf8("No"), elem_idx, 5); - } - else - { - elements_tab->clearCellText(elem_idx, 4); - elements_tab->clearCellText(elem_idx, 5); - } - - if(dynamic_cast(elem)) - elements_tab->setRowData(QVariant::fromValue(*dynamic_cast(elem)), elem_idx); - else - elements_tab->setRowData(QVariant::fromValue(*dynamic_cast(elem)), elem_idx); -} - -void ElementsWidget::handleElement(int elem_idx) -{ - if(column_rb->isChecked() || - (expression_rb->isChecked() && !elem_expr_txt->toPlainText().isEmpty())) - { - IndexElement idxelem; - ExcludeElement excelem; - - /* Selects the correct element based upon the visibility of operator - selector (available only for ExcludeElement) */ - Element *elem = (operator_sel->isVisible() ? - dynamic_cast(&excelem) : - dynamic_cast(&idxelem)); - - elem->setSortingEnabled(sorting_chk->isChecked()); - elem->setSortingAttribute(IndexElement::NULLS_FIRST, nulls_first_chk->isChecked()); - elem->setSortingAttribute(IndexElement::ASC_ORDER, ascending_rb->isChecked()); - elem->setOperatorClass(dynamic_cast(op_class_sel->getSelectedObject())); - - if(collation_sel->isVisible()) - idxelem.setCollation(dynamic_cast(collation_sel->getSelectedObject())); - - if(operator_sel->isVisible()) - excelem.setOperator(dynamic_cast(operator_sel->getSelectedObject())); - - if(expression_rb->isChecked()) - elem->setExpression(elem_expr_txt->toPlainText().toUtf8()); - else - elem->setColumn(reinterpret_cast(column_cmb->itemData(column_cmb->currentIndex()).value())); - - showElementData(elem, elem_idx); - - elem_expr_txt->clear(); - ascending_rb->setChecked(true); - sorting_chk->setChecked(true); - op_class_sel->clearSelector(); - operator_sel->clearSelector(); - collation_sel->clearSelector(); - nulls_first_chk->setChecked(false); - } - else if(elements_tab->getCellText(elem_idx,0).isEmpty()) - elements_tab->removeRow(elem_idx); - - emit s_elementHandled(elem_idx); -} - -void ElementsWidget::editElement(int elem_idx) -{ - Element *elem = nullptr; - IndexElement idxelem; - ExcludeElement excelem; - QVariant data = elements_tab->getRowData(elem_idx); - - //If the data is an IndexElement - if(data.canConvert()) - { - idxelem = data.value(); - elem = &idxelem; - } - else - { - excelem = data.value(); - elem = &excelem; - } - - if(elem->getColumn()) - { - column_rb->setChecked(true); - column_cmb->setCurrentIndex(column_cmb->findText(elem->getColumn()->getName())); - } - else - { - expression_rb->setChecked(true); - elem_expr_txt->setPlainText(elem->getExpression()); - } - - if(elem->getSortingAttribute(IndexElement::ASC_ORDER)) - ascending_rb->setChecked(true); - else - descending_rb->setChecked(true); - - nulls_first_chk->setChecked(elem->getSortingAttribute(IndexElement::NULLS_FIRST)); - sorting_chk->setChecked(elem->isSortingEnabled()); - op_class_sel->setSelectedObject(elem->getOperatorClass()); - - //Specific for IndexElement - if(collation_sel->isVisible()) - collation_sel->setSelectedObject(idxelem.getCollation()); - - //Specific for ExcludeElement - if(operator_sel->isVisible()) - operator_sel->setSelectedObject(excelem.getOperator()); -} - -void ElementsWidget::selectElementObject(void) -{ - QObject *obj_sender=sender(); - - column_rb->blockSignals(true); - expression_rb->blockSignals(true); - - if(obj_sender==column_rb) - { - elem_expr_txt->clear(); - column_cmb->setEnabled(true); - expression_rb->setChecked(false); - column_rb->setChecked(true); - elem_expr_txt->setEnabled(false); - } - else - { - column_cmb->setEnabled(false); - column_rb->setChecked(false); - expression_rb->setChecked(true); - elem_expr_txt->setEnabled(true); - } - - column_rb->blockSignals(false); - expression_rb->blockSignals(false); -} - -void ElementsWidget::getElements(vector &elems) -{ - if(elements_tab->getRowCount() > 0) - { - //Confirming if the data on elements table is IndexElement - if(elements_tab->getRowData(0).canConvert()) - { - elems.clear(); - - for(unsigned i=0; i < elements_tab->getRowCount(); i++) - elems.push_back(elements_tab->getRowData(i).value()); - } - } -} - -void ElementsWidget::getElements(vector &elems) -{ - if(elements_tab->getRowCount() > 0) - { - //Confirming if the data on elements table is ExcludeElement - if(elements_tab->getRowData(0).canConvert()) - { - elems.clear(); - - for(unsigned i=0; i < elements_tab->getRowCount(); i++) - elems.push_back(elements_tab->getRowData(i).value()); - } - } -} - diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp new file mode 100644 index 0000000000..2d25e3432c --- /dev/null +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -0,0 +1,285 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "elementwidget.h" + +ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) +{ + try + { + map > fields_map; + + warning_frame=nullptr; + element = nullptr; + + setupUi(this); + elem_expr_hl=new SyntaxHighlighter(elem_expr_txt, false, true); + elem_expr_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + + parent_obj=nullptr; + op_class_sel=new ObjectSelectorWidget(OBJ_OPCLASS, true, this); + collation_sel=new ObjectSelectorWidget(OBJ_COLLATION, true, this); + operator_sel=new ObjectSelectorWidget(OBJ_OPERATOR, true, this); + + element_grid->addWidget(collation_sel, 3,1,1,2); + element_grid->addWidget(op_class_sel, 4,1,1,2); + element_grid->addWidget(operator_sel, 5,1,1,2); + + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_91)].push_back(collation_lbl); + warning_frame=BaseObjectWidget::generateVersionWarningFrame(fields_map); + element_grid->addWidget(warning_frame, element_grid->count()+1, 0, 1, 3); + warning_frame->setParent(this); + + connect(column_rb, SIGNAL(toggled(bool)), this, SLOT(selectElementObject(void))); + connect(expression_rb, SIGNAL(toggled(bool)), this, SLOT(selectElementObject(void))); + connect(sorting_chk, SIGNAL(toggled(bool)), ascending_rb, SLOT(setEnabled(bool))); + connect(sorting_chk, SIGNAL(toggled(bool)), descending_rb, SLOT(setEnabled(bool))); + connect(sorting_chk, SIGNAL(toggled(bool)), nulls_first_chk, SLOT(setEnabled(bool))); + + this->setEnabled(false); + collation_sel->setVisible(false); + collation_lbl->setVisible(false); + operator_sel->setVisible(false); + operator_lbl->setVisible(false); + + BaseObjectWidget::setRequiredField(operator_sel); + BaseObjectWidget::setRequiredField(operator_lbl); + + setTabOrder(column_rb, column_cmb); + setTabOrder(column_cmb, expression_rb); + setTabOrder(expression_rb, elem_expr_txt); + setTabOrder(elem_expr_txt, collation_sel); + setTabOrder(collation_sel, collation_sel->rem_object_tb); + setTabOrder(collation_sel->rem_object_tb, collation_sel->sel_object_tb); + setTabOrder(collation_sel->sel_object_tb, op_class_sel); + + setTabOrder(op_class_sel, op_class_sel->rem_object_tb); + setTabOrder(op_class_sel->rem_object_tb, op_class_sel->sel_object_tb); + setTabOrder(op_class_sel->sel_object_tb, sorting_chk); + + setTabOrder(sorting_chk, ascending_rb); + setTabOrder(ascending_rb, descending_rb); + setTabOrder(descending_rb, nulls_first_chk); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, Element *elem) +{ + if(!elem) + this->setEnabled(false); + else + { + IndexElement *idx_elem = dynamic_cast(elem); + ExcludeElement *exc_elem = dynamic_cast(elem); + PartitionKey *part_key = dynamic_cast(elem); + Column *column = elem->getColumn(); + + setAttributes(model, parent_obj); + + if(idx_elem) + setIndexElement(idx_elem); + else if(exc_elem) + setExcludeElement(exc_elem); + else + setPartitionKey(part_key); + + if(column || (!column && elem->getExpression().isEmpty())) + { + column_rb->setChecked(true); + + if(column) + column_cmb->setCurrentIndex(column_cmb->findText(column->getName())); + } + else + { + expression_rb->setChecked(true); + elem_expr_txt->setPlainText(elem->getExpression()); + } + + if(elem->getSortingAttribute(IndexElement::ASC_ORDER)) + ascending_rb->setChecked(true); + else + descending_rb->setChecked(true); + + nulls_first_chk->setChecked(elem->getSortingAttribute(IndexElement::NULLS_FIRST)); + sorting_chk->setChecked(elem->isSortingEnabled()); + op_class_sel->setSelectedObject(elem->getOperatorClass()); + collation_sel->setSelectedObject(elem->getCollation()); + operator_sel->setSelectedObject(elem->getOperator()); + } +} + +void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) +{ + if(!model || !parent_obj) + { + this->setEnabled(false); + throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + else if(parent_obj->getObjectType()!=OBJ_TABLE && + parent_obj->getObjectType()!=OBJ_VIEW && + parent_obj->getObjectType()!=OBJ_RELATIONSHIP) + throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + this->setEnabled(true); + this->parent_obj=parent_obj; + + op_class_sel->setModel(model); + collation_sel->setModel(model); + operator_sel->setModel(model); + + cols_combo_parent->setVisible(parent_obj->getObjectType() == OBJ_TABLE); + column_rb->setVisible(parent_obj->getObjectType() == OBJ_TABLE); + expression_rb->setChecked(parent_obj->getObjectType() == OBJ_VIEW); + + if(parent_obj->getObjectType() == OBJ_TABLE) + updateColumnsCombo(); +} + +void ElementWidget::setIndexElement(IndexElement *elem) +{ + createElement(elem); + setWindowTitle(trUtf8("Index element properties")); + collation_sel->setVisible(true); + collation_lbl->setVisible(true); + warning_frame->setVisible(true); +} + +void ElementWidget::setExcludeElement(ExcludeElement *elem) +{ + createElement(elem); + setWindowTitle(trUtf8("Exclude element properties")); + operator_sel->setVisible(true); + operator_lbl->setVisible(true); +} + +void ElementWidget::setPartitionKey(PartitionKey *elem) +{ + createElement(elem); + setWindowTitle(trUtf8("Partition key properties")); + collation_sel->setVisible(false); + collation_lbl->setVisible(false); + sorting_chk->setVisible(false); + ascending_rb->setVisible(false); + descending_rb->setVisible(false); + nulls_first_chk->setVisible(false); + warning_frame->setVisible(false); +} + +Element *ElementWidget::getElement(void) +{ + return(element); +} + +void ElementWidget::applyConfiguration(void) +{ + element->setSortingEnabled(sorting_chk->isChecked()); + element->setSortingAttribute(IndexElement::NULLS_FIRST, nulls_first_chk->isChecked()); + element->setSortingAttribute(IndexElement::ASC_ORDER, ascending_rb->isChecked()); + element->setOperatorClass(dynamic_cast(op_class_sel->getSelectedObject())); + element->setCollation(dynamic_cast(collation_sel->getSelectedObject())); + element->setOperator(dynamic_cast(operator_sel->getSelectedObject())); + + if(expression_rb->isChecked()) + element->setExpression(elem_expr_txt->toPlainText().toUtf8()); + else + element->setColumn(reinterpret_cast(column_cmb->itemData(column_cmb->currentIndex()).value())); +} + +void ElementWidget::updateColumnsCombo(void) +{ + Table *table = dynamic_cast
(parent_obj); + Relationship *rel = dynamic_cast(parent_obj); + Column *column=nullptr; + unsigned i, col_count=0; + + try + { + column_cmb->clear(); + column_cmb->setVisible(true); + column_rb->setVisible(true); + + if(table) + { + col_count=table->getColumnCount(); + for(i=0; i < col_count; i++) + { + column=table->getColumn(i); + column_cmb->addItem(column->getName(), + QVariant::fromValue(column)); + } + } + else if(rel) + { + col_count=rel->getAttributeCount(); + for(i=0; i < col_count; i++) + { + column=rel->getAttribute(i); + column_cmb->addItem(column->getName(), + QVariant::fromValue(column)); + } + } + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void ElementWidget::selectElementObject(void) +{ + QObject *obj_sender=sender(); + + column_rb->blockSignals(true); + expression_rb->blockSignals(true); + + if(obj_sender==column_rb) + { + elem_expr_txt->clear(); + column_cmb->setEnabled(true); + expression_rb->setChecked(false); + column_rb->setChecked(true); + elem_expr_txt->setEnabled(false); + } + else + { + column_cmb->setEnabled(false); + column_rb->setChecked(false); + expression_rb->setChecked(true); + elem_expr_txt->setEnabled(true); + } + + column_rb->blockSignals(false); + expression_rb->blockSignals(false); +} + +template +void ElementWidget::createElement(Class *elem) +{ + if(element && !dynamic_cast(element)) + delete(element); + + if(!element) + element = new Class; + + *element = *elem; +} diff --git a/libpgmodeler_ui/src/elementswidget.h b/libpgmodeler_ui/src/elementwidget.h similarity index 58% rename from libpgmodeler_ui/src/elementswidget.h rename to libpgmodeler_ui/src/elementwidget.h index 7d9dc4d709..cc0aa06615 100644 --- a/libpgmodeler_ui/src/elementswidget.h +++ b/libpgmodeler_ui/src/elementwidget.h @@ -19,39 +19,31 @@ /** \ingroup libpgmodeler_ui \class ElementWidget -\brief Implements the operations to create/edit constraints (exclude) and indexes elements via form. +\brief Implements the operations to create/edit constraints (exclude) and indexes elements, and partition keys via form. */ #ifndef ELEMENT_WIDGET_H #define ELEMENT_WIDGET_H #include -#include "ui_elementswidget.h" +#include "ui_elementwidget.h" #include "objectstablewidget.h" #include "objectselectorwidget.h" -#include "baseobjectwidget.h" #include "partitionkey.h" -/* Declaring the IndexElement and ExcludeElement class as a Qt metatype in order to permit - that instances of the class be used as data of QVariant and QMetaType */ -#include -Q_DECLARE_METATYPE(IndexElement) -Q_DECLARE_METATYPE(ExcludeElement) - -class ElementsWidget: public QWidget, public Ui::ElementsWidget { +class ElementWidget: public QWidget, public Ui::ElementWidget { private: Q_OBJECT QFrame *warning_frame; + Element *element; + //! \brief Parent object (table or relationship) from which the columns will be referenced on the elements BaseObject *parent_obj; //! \brief Syntax highlighter for element expression - SyntaxHighlighter *elem_expr_hl; - - //! \brief Table widget used to control the index elements - ObjectsTableWidget *elements_tab; + SyntaxHighlighter *elem_expr_hl; //! \brief Operator class selector ObjectSelectorWidget *op_class_sel, @@ -65,40 +57,32 @@ class ElementsWidget: public QWidget, public Ui::ElementsWidget { //! \brief Updates the column combobox with the existent columns on parent table void updateColumnsCombo(void); - //! \brief Shows the element data on the elements table at the specified line - void showElementData(Element *elem, int elem_idx); - void showElementData(IndexElement elem, int elem_idx); - void showElementData(ExcludeElement elem, int elem_idx); void setAttributes(DatabaseModel *model, BaseObject *parent_obj); - - public: - ElementsWidget(QWidget *parent = 0); - + //! \brief Enables the widget to handle index elements - void setAttributes(DatabaseModel *model, BaseTable *table, vector elems); - + void setIndexElement(IndexElement *elem); + //! \brief Enables the widget to handle exclude constraint elements - void setAttributes(DatabaseModel *model, BaseObject *parent_obj, vector elems); + void setExcludeElement(ExcludeElement *elem); //! \brief Enables the widget to handle partition key elements - void setAttributes(DatabaseModel *model, BaseTable *table, vector elems); - - //! \brief Copy the current elements into the list - void getElements(vector &elems); + void setPartitionKey(PartitionKey *elem); + + template + void createElement(Class *elem); - //! \brief Copy the current elements into the list - void getElements(vector &elems); + public: + ElementWidget(QWidget *parent = 0); + void setAttributes(DatabaseModel *model, BaseObject *parent_obj, Element *elem); + + Element *getElement(void); + public slots: - void clear(void); - + void applyConfiguration(void); + private slots: void selectElementObject(void); - void handleElement(int elem_idx); - void editElement(int elem_idx); - - signals: - void s_elementHandled(int elem_idx); }; #endif diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index fe8fb3a1c2..4399296753 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -33,11 +33,11 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_INDEX) predicate_hl=new SyntaxHighlighter(predicate_txt, false, true); predicate_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); - elements_wgt = new ElementsWidget(this); + elements_tab = new ElementsTableWidget(this); grid=new QGridLayout; grid->setContentsMargins(4,4,4,4); - grid->addWidget(elements_wgt,0,0); + grid->addWidget(elements_tab,0,0); tabWidget->widget(1)->setLayout(grid); configureFormLayout(index_grid, OBJ_INDEX); @@ -56,7 +56,7 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_INDEX) connect(indexing_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(selectIndexingType(void))); connect(fill_factor_chk, SIGNAL(toggled(bool)), fill_factor_sb, SLOT(setEnabled(bool))); - connect(elements_wgt, SIGNAL(s_elementHandled(int)), this, SLOT(enableSortingOptions())); + //connect(elements_tab, SIGNAL(s_elementHandled(int)), this, SLOT(enableSortingOptions())); configureTabOrder(); selectIndexingType(); @@ -74,22 +74,22 @@ void IndexWidget::selectIndexingType(void) fast_update_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::gin); buffering_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::gist); fill_factor_sb->setEnabled(fill_factor_chk->isChecked() && fill_factor_chk->isEnabled()); - enableSortingOptions(); + //enableSortingOptions(); } -void IndexWidget::enableSortingOptions(void) +/*void IndexWidget::enableSortingOptions(void) { - elements_wgt->sorting_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::btree); - elements_wgt->ascending_rb->setEnabled(elements_wgt->sorting_chk->isEnabled()); - elements_wgt->descending_rb->setEnabled(elements_wgt->sorting_chk->isEnabled()); - elements_wgt->nulls_first_chk->setEnabled(elements_wgt->sorting_chk->isEnabled()); + elements_tab->sorting_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::btree); + elements_tab->ascending_rb->setEnabled(elements_tab->sorting_chk->isEnabled()); + elements_tab->descending_rb->setEnabled(elements_tab->sorting_chk->isEnabled()); + elements_tab->nulls_first_chk->setEnabled(elements_tab->sorting_chk->isEnabled()); - if(!elements_wgt->sorting_chk->isEnabled()) + if(!elements_tab->sorting_chk->isEnabled()) { - elements_wgt->sorting_chk->setChecked(false); - elements_wgt->nulls_first_chk->setChecked(false); + elements_tab->sorting_chk->setChecked(false); + elements_tab->nulls_first_chk->setChecked(false); } -} +}*/ void IndexWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseTable *parent_obj, Index *index) { @@ -122,7 +122,8 @@ void IndexWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Ba selectIndexingType(); } - elements_wgt->setAttributes(model, parent_obj, idx_elems); + elements_tab->setAttributes(model, parent_obj); + elements_tab->setElements(idx_elems); } void IndexWidget::applyConfiguration(void) @@ -150,7 +151,7 @@ void IndexWidget::applyConfiguration(void) else index->setFillFactor(0); - elements_wgt->getElements(idx_elems); + elements_tab->getElements(idx_elems); index->addIndexElements(idx_elems); finishConfiguration(); diff --git a/libpgmodeler_ui/src/indexwidget.h b/libpgmodeler_ui/src/indexwidget.h index 2a52493e33..9e550f025d 100644 --- a/libpgmodeler_ui/src/indexwidget.h +++ b/libpgmodeler_ui/src/indexwidget.h @@ -27,8 +27,8 @@ #include "baseobjectwidget.h" #include "ui_indexwidget.h" -#include "objectstablewidget.h" -#include "elementswidget.h" +//#include "objectstablewidget.h" +#include "elementstablewidget.h" class IndexWidget: public BaseObjectWidget, public Ui::IndexWidget { private: @@ -37,7 +37,8 @@ class IndexWidget: public BaseObjectWidget, public Ui::IndexWidget { //! \brief Syntax highlighter for predicate SyntaxHighlighter *predicate_hl; - ElementsWidget *elements_wgt; + //ElementWidget *elements_wgt; + ElementsTableWidget *elements_tab; public: IndexWidget(QWidget * parent = 0); @@ -45,7 +46,7 @@ class IndexWidget: public BaseObjectWidget, public Ui::IndexWidget { private slots: void selectIndexingType(void); - void enableSortingOptions(void); + //void enableSortingOptions(void); public slots: void applyConfiguration(void); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 3453bc65a8..445855ff40 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -167,15 +167,8 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) objects_tab_map[OBJ_POLICY]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),5); objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Alias"), 6); - partion_keys_tab = new ObjectsTableWidget; + partion_keys_tab = new ElementsTableWidget; partion_keys_tab->setEnabled(false); - partion_keys_tab->setColumnCount(3); - partion_keys_tab->setHeaderLabel(trUtf8("Element"), 0); - partion_keys_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); - partion_keys_tab->setHeaderLabel(trUtf8("Type"), 1); - partion_keys_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); - partion_keys_tab->setHeaderLabel(trUtf8("Operator Class"), 2); - partion_keys_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("opclass")),2); grid = dynamic_cast(attributes_tbw->widget(6)->layout()); grid->addWidget(partion_keys_tab, 1, 0, 1, 2); @@ -304,6 +297,8 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc tag_sel->setModel(this->model); tag_sel->setSelectedObject(table->getTag()); + + partion_keys_tab->setAttributes(model, table); } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/tablewidget.h b/libpgmodeler_ui/src/tablewidget.h index d1914cd939..e9a661c5fa 100644 --- a/libpgmodeler_ui/src/tablewidget.h +++ b/libpgmodeler_ui/src/tablewidget.h @@ -29,13 +29,15 @@ #include "ui_tablewidget.h" #include "objectstablewidget.h" #include "tableview.h" -#include "elementswidget.h" +#include "elementstablewidget.h" class TableWidget: public BaseObjectWidget, public Ui::TableWidget { private: Q_OBJECT - ObjectsTableWidget *parent_tables, *partion_keys_tab; + ObjectsTableWidget *parent_tables; + + ElementsTableWidget *partion_keys_tab; ObjectSelectorWidget *tag_sel; diff --git a/libpgmodeler_ui/ui/elementswidget.ui b/libpgmodeler_ui/ui/elementwidget.ui similarity index 97% rename from libpgmodeler_ui/ui/elementswidget.ui rename to libpgmodeler_ui/ui/elementwidget.ui index d96a4604a1..59e518f02b 100644 --- a/libpgmodeler_ui/ui/elementswidget.ui +++ b/libpgmodeler_ui/ui/elementwidget.ui @@ -1,30 +1,30 @@ - ElementsWidget - + ElementWidget + 0 0 538 - 210 + 214 - Form + Element properties - 0 + 4 - 0 + 4 - 0 + 4 - 0 + 4 6 diff --git a/libutils/src/pgsqlversions.cpp b/libutils/src/pgsqlversions.cpp index 39c00ad80d..167da71b57 100644 --- a/libutils/src/pgsqlversions.cpp +++ b/libutils/src/pgsqlversions.cpp @@ -28,12 +28,14 @@ namespace PgSQLVersions { PGSQL_VERSION_95=QString("9.5"), PGSQL_VERSION_96=QString("9.6"), PGSQL_VERSION_100=QString("10.0"), - DEFAULT_VERSION=PGSQL_VERSION_100; + PGSQL_VERSION_110=QString("11.0"), + DEFAULT_VERSION=PGSQL_VERSION_110; const QStringList ALL_VERSIONS={ - PGSQL_VERSION_100, PGSQL_VERSION_96, - PGSQL_VERSION_95, PGSQL_VERSION_94, - PGSQL_VERSION_93, PGSQL_VERSION_92, - PGSQL_VERSION_91, PGSQL_VERSION_90 }; + PGSQL_VERSION_110, PGSQL_VERSION_100, + PGSQL_VERSION_96, PGSQL_VERSION_95, + PGSQL_VERSION_94, PGSQL_VERSION_93, + PGSQL_VERSION_92, PGSQL_VERSION_91, + PGSQL_VERSION_90 }; } diff --git a/libutils/src/pgsqlversions.h b/libutils/src/pgsqlversions.h index 9470d7ca66..694c00dd02 100644 --- a/libutils/src/pgsqlversions.h +++ b/libutils/src/pgsqlversions.h @@ -38,6 +38,7 @@ namespace PgSQLVersions { PGSQL_VERSION_95, PGSQL_VERSION_96, PGSQL_VERSION_100, + PGSQL_VERSION_110, DEFAULT_VERSION; extern const QStringList ALL_VERSIONS; diff --git a/main/src/main.cpp b/main/src/main.cpp index 357531bbe2..4ba4d22762 100644 --- a/main/src/main.cpp +++ b/main/src/main.cpp @@ -88,7 +88,7 @@ int main(int argc, char **argv) try { /* Registering the below classes as metatypes in order to make - them liable to be sent through signal parameters. */ + * them liable to be sent through signal parameters. */ qRegisterMetaType("ObjectType"); qRegisterMetaType("Exception"); qRegisterMetaType("ValidationInfo"); From d9879101e8cfe42161ada8e6bdba0ec0fc31eec1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 26 Sep 2018 14:34:12 -0300 Subject: [PATCH 129/425] Added support to resize grid cells to fit contents on ObjectsTableWidget --- libpgmodeler_ui/res/icones/resizecols.png | Bin 0 -> 895 bytes libpgmodeler_ui/res/resources.qrc | 1 + libpgmodeler_ui/src/elementstablewidget.h | 8 +++++ libpgmodeler_ui/src/elementwidget.cpp | 4 ++- libpgmodeler_ui/src/elementwidget.h | 3 ++ libpgmodeler_ui/src/objectstablewidget.cpp | 9 ++++++ libpgmodeler_ui/src/objectstablewidget.h | 3 +- libpgmodeler_ui/ui/objectstablewidget.ui | 35 +++++++++++++++++++++ 8 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/resizecols.png diff --git a/libpgmodeler_ui/res/icones/resizecols.png b/libpgmodeler_ui/res/icones/resizecols.png new file mode 100644 index 0000000000000000000000000000000000000000..eca12ab4f9b34ff2f4dfbbd1930f3677b59fde6e GIT binary patch literal 895 zcmV-_1AzRAP)bZO}JseLBcStFlv)L?~rXhsz z8W8*R>=gS9#c><}^7%ZqTCMp&0Nb{`#kwB{fnQ#o#WYRY+Svp1=uT? z*f06}{i#R_;*PoLNCXHw;FqRpn5KzkS>7DOFpyHF2jDsor9z>As;cz&_j`*jEiKXA z-Hi}}k;#$t0HS`8uIrel$>QRoH@>{QjBVTLI^Z}?jM5LuWETLk=XRz&#b?G;O8`5T$#aRaRD3 z7#JAvPQTHa6#ypgTx9xn3ILX6#iqbt1AiSl&4Vjjl*{E5@VHgJGa@hmWbv^dzc9q(Fz;&RnuP@qx_pxyr2S`eR-vJlWt%1}Xh|+;IkcI={ z8km{;JLWntKR+L+0lx#KC#8Ks;%X`iKyg#xI1bCt@+gYpyPn?)T-AjTfqK~J+X&d5 z6gUdt9B^I;@!PVjQ!OnmiMeZJaldTaMpe}<;3Dt?*!BY`zzN`#VHmFl2M5O$MLBt> z2nPdfSF6?Mz{$N>+YtP3m<7%QXZ9v#LgUAg1=zqA@C*0}IAH+4l#~H%K)ONw`UCm} V0uAZuicones/stop.png icones/newtab.png icones/relationshippart.png + icones/resizecols.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/elementstablewidget.h b/libpgmodeler_ui/src/elementstablewidget.h index 6c681679d7..0f053e3d39 100644 --- a/libpgmodeler_ui/src/elementstablewidget.h +++ b/libpgmodeler_ui/src/elementstablewidget.h @@ -44,6 +44,9 @@ class ElementsTableWidget: public QWidget { private: Q_OBJECT + /*! \brief Store an instance of the element being handled (see setAttributes()) + * This one is used to determine the settings of the element widget open when the user + * wants to create new elements on the grid */ Element *handled_elem; ElementWidget *element_wgt; @@ -60,14 +63,17 @@ class ElementsTableWidget: public QWidget { //! \brief Shows the element data on the elements table at the specified line void showElementData(Element *elem, int elem_idx); + //! \brief Copies the provided element storing it on a QVariant according to its real type (class) QVariant copyElementData(Element *elem); + //! \brief Opens the element editing form using the attributes of the provided element int openElementForm(Element *elem); public: ElementsTableWidget(QWidget *parent = 0); ~ElementsTableWidget(void); + //! \brief Configures the grid based upon the template Class in use template void setAttributes(DatabaseModel *model, BaseObject *parent_obj) { @@ -98,6 +104,7 @@ class ElementsTableWidget: public QWidget { } } + //! \brief Fills the grid with the elements on the vector vector template void setElements(vector elems) { @@ -110,6 +117,7 @@ class ElementsTableWidget: public QWidget { elements_tab->blockSignals(false); } + //! \brief Fills the provided vector with the elements on the grid template void getElements(vector &elems) { diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index 2d25e3432c..6036d4eba9 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -102,7 +102,8 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, else setPartitionKey(part_key); - if(column || (!column && elem->getExpression().isEmpty())) + if(parent_obj->getObjectType() == OBJ_TABLE && + (column || (!column && elem->getExpression().isEmpty()))) { column_rb->setChecked(true); @@ -170,6 +171,7 @@ void ElementWidget::setExcludeElement(ExcludeElement *elem) setWindowTitle(trUtf8("Exclude element properties")); operator_sel->setVisible(true); operator_lbl->setVisible(true); + warning_frame->setVisible(false); } void ElementWidget::setPartitionKey(PartitionKey *elem) diff --git a/libpgmodeler_ui/src/elementwidget.h b/libpgmodeler_ui/src/elementwidget.h index cc0aa06615..b296217b2f 100644 --- a/libpgmodeler_ui/src/elementwidget.h +++ b/libpgmodeler_ui/src/elementwidget.h @@ -68,14 +68,17 @@ class ElementWidget: public QWidget, public Ui::ElementWidget { //! \brief Enables the widget to handle partition key elements void setPartitionKey(PartitionKey *elem); + //! \brief Allocates the handled element based upon the provided Class (should be child of Element) template void createElement(Class *elem); public: ElementWidget(QWidget *parent = 0); + //! \brief Configures the widget to handle the element considering its type (IndexElement, ExcludeElement, PartitionKey) void setAttributes(DatabaseModel *model, BaseObject *parent_obj, Element *elem); + //! \brief Returns the configured element Element *getElement(void); public slots: diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 978c4d68df..986c558db6 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -41,6 +41,12 @@ ObjectsTableWidget::ObjectsTableWidget(unsigned button_conf, bool conf_exclusion emit s_cellClicked(row, col); }); + connect(resize_cols_tb, &QToolButton::clicked, [&](){ + table_tbw->resizeColumnsToContents(); + table_tbw->resizeRowsToContents(); + table_tbw->horizontalHeader()->setSectionResizeMode(table_tbw->horizontalHeader()->count() - 1, QHeaderView::Stretch); + }); + this->conf_exclusion=conf_exclusion; setButtonConfiguration(button_conf); @@ -603,6 +609,9 @@ void ObjectsTableWidget::setButtonsEnabled(unsigned button_conf, bool value) if((button_conf & DUPLICATE_BUTTON) == DUPLICATE_BUTTON) duplicate_tb->setEnabled(value && lin >= 0); + + if((button_conf & RESIZE_COLS_BUTTON) == RESIZE_COLS_BUTTON) + resize_cols_tb->setEnabled(value && table_tbw->rowCount() > 0); } void ObjectsTableWidget::setButtonsEnabled(void) diff --git a/libpgmodeler_ui/src/objectstablewidget.h b/libpgmodeler_ui/src/objectstablewidget.h index 1613bac278..ab0bb4c6a0 100644 --- a/libpgmodeler_ui/src/objectstablewidget.h +++ b/libpgmodeler_ui/src/objectstablewidget.h @@ -51,7 +51,8 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { EDIT_BUTTON=16, DUPLICATE_BUTTON=32, REMOVE_ALL_BUTTON=64, - ALL_BUTTONS=127, + RESIZE_COLS_BUTTON=128, + ALL_BUTTONS=255, NO_BUTTONS=0; ObjectsTableWidget(unsigned button_conf=ALL_BUTTONS, bool conf_exclusion=false, QWidget * parent = 0); diff --git a/libpgmodeler_ui/ui/objectstablewidget.ui b/libpgmodeler_ui/ui/objectstablewidget.ui index 6a9d6b2686..a3c3f69990 100644 --- a/libpgmodeler_ui/ui/objectstablewidget.ui +++ b/libpgmodeler_ui/ui/objectstablewidget.ui @@ -417,6 +417,41 @@ + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Resize columns to fit contents + + + + + + + :/icones/icones/resizecols.png:/icones/icones/resizecols.png + + + + 22 + 22 + + + + From fffcf40d4b079f189302f5a017b399ff3f0aa9fb Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 26 Sep 2018 14:52:07 -0300 Subject: [PATCH 130/425] Setting a minimal size for the ElementWidget --- libpgmodeler_ui/ui/elementwidget.ui | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/ui/elementwidget.ui b/libpgmodeler_ui/ui/elementwidget.ui index 59e518f02b..52222603aa 100644 --- a/libpgmodeler_ui/ui/elementwidget.ui +++ b/libpgmodeler_ui/ui/elementwidget.ui @@ -6,10 +6,16 @@ 0 0 - 538 - 214 + 540 + 215 + + + 540 + 215 + + Element properties From 8568bb21db3c8085855ff9559497166e475411f0 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 27 Sep 2018 21:20:57 -0300 Subject: [PATCH 131/425] Avoiding the creation of cardinality labels for partitioning relationships --- libpgmodeler/src/baserelationship.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 738f870c89..0fdb79ed38 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -137,7 +137,8 @@ void BaseRelationship::configureRelationship(void) //Allocates the cardinality labels only when the relationship is not generalization or dependency (copy) if(rel_type!=RELATIONSHIP_GEN && - rel_type!=RELATIONSHIP_DEP) + rel_type!=RELATIONSHIP_DEP && + rel_type!=RELATIONSHIP_PART) { lables[SRC_CARD_LABEL]=new Textbox; lables[DST_CARD_LABEL]=new Textbox; From f84de1ccb4a71edff0e29240af1a2afdfc4c74cd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 28 Sep 2018 09:16:44 -0300 Subject: [PATCH 132/425] Stating to add logic to setup partition keys of tables --- libpgmodeler/src/element.cpp | 22 ++++++++++++++++------ libpgmodeler/src/element.h | 4 ++++ libpgmodeler/src/table.cpp | 26 ++++++++++++++++++++++++++ libpgmodeler/src/table.h | 6 ++++++ libpgmodeler_ui/src/tablewidget.cpp | 23 ++++++++++++++++++----- libpgmodeler_ui/src/tablewidget.h | 2 +- 6 files changed, 71 insertions(+), 12 deletions(-) diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 9cdb024074..f5288fcb9c 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -115,12 +115,22 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) } } +bool Element::isEqualsTo(Element &elem) +{ + return(this->column == elem.column && + this->expression == elem.expression && + this->operator_class == elem.operator_class && + this->sorting_enabled == elem.sorting_enabled && + this->sorting_attibs[ASC_ORDER] == elem.sorting_attibs[ASC_ORDER] && + this->sorting_attibs[NULLS_FIRST] == elem.sorting_attibs[NULLS_FIRST]); +} + bool Element::operator == (Element &elem) { - return(this->column == elem.column && - this->expression == elem.expression && - this->operator_class == elem.operator_class && - this->sorting_enabled == elem.sorting_enabled && - this->sorting_attibs[ASC_ORDER] == elem.sorting_attibs[ASC_ORDER] && - this->sorting_attibs[NULLS_FIRST] == elem.sorting_attibs[NULLS_FIRST]); + return(isEqualsTo(elem)); +} + +bool Element::operator == (const Element &elem) +{ + return(isEqualsTo(const_cast(elem))); } diff --git a/libpgmodeler/src/element.h b/libpgmodeler/src/element.h index 01cab59455..25175a1115 100644 --- a/libpgmodeler/src/element.h +++ b/libpgmodeler/src/element.h @@ -50,6 +50,9 @@ class Element { //! \brief Enable the use of the sort attributes sorting_enabled; + //! \brief Compares the attributes of provided element against this returning true/false if the match or not + bool isEqualsTo(Element &elem); + protected: SchemaParser schparser; @@ -87,6 +90,7 @@ class Element { virtual QString getCodeDefinition(unsigned) { return(QString()); } bool operator == (Element &elem); + bool operator ==(const Element &elem); }; #endif diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 19fe730e59..77cc199fcf 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -589,6 +589,32 @@ void Table::setCopyTableOptions(CopyOptions like_op) } } +void Table::addPartitionKeys(vector &part_keys) +{ + vector part_keys_bkp = partition_keys; + + partition_keys.clear(); + + for(auto &part_key : part_keys) + { + if(std::find(partition_keys.begin(), partition_keys.end(), part_key) != partition_keys.end()) + { + partition_keys = part_keys_bkp; + throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + + partition_keys.push_back(part_key); + } + + setCodeInvalidated(true); +} + +void Table::removePartitionKeys(void) +{ + partition_keys.clear(); + setCodeInvalidated(true); +} + Table *Table::getCopyTable(void) { return(copy_table); diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 8061e734fc..5e4efb887d 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -200,6 +200,12 @@ class Table: public BaseTable { //! \brief Configures the copy table options void setCopyTableOptions(CopyOptions copy_op); + //! \brief Adds partition keys to the table. This method overrides the currently configure partition keys. + void addPartitionKeys(vector &part_keys); + + //! \brief Remove all partition keys configured for the table + void removePartitionKeys(void); + //! \brief Returns the copy table Table *getCopyTable(void); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 445855ff40..a3ec455bd2 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -167,17 +167,17 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) objects_tab_map[OBJ_POLICY]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),5); objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Alias"), 6); - partion_keys_tab = new ElementsTableWidget; - partion_keys_tab->setEnabled(false); + partition_keys_tab = new ElementsTableWidget; + partition_keys_tab->setEnabled(false); grid = dynamic_cast(attributes_tbw->widget(6)->layout()); - grid->addWidget(partion_keys_tab, 1, 0, 1, 2); + grid->addWidget(partition_keys_tab, 1, 0, 1, 2); PartitioningType::getTypes(part_types); part_types.push_front(trUtf8("None")); partitioning_type_cmb->addItems(part_types); connect(partitioning_type_cmb, &QComboBox::currentTextChanged, [&](){ - partion_keys_tab->setEnabled(partitioning_type_cmb->currentIndex() != 0); + partition_keys_tab->setEnabled(partitioning_type_cmb->currentIndex() != 0); }); configureFormLayout(table_grid, OBJ_TABLE); @@ -298,7 +298,7 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc tag_sel->setModel(this->model); tag_sel->setSelectedObject(table->getTag()); - partion_keys_tab->setAttributes(model, table); + partition_keys_tab->setAttributes(model, table); } catch(Exception &e) { @@ -780,7 +780,9 @@ void TableWidget::applyConfiguration(void) Constraint *pk = nullptr; vector rels; vector pk_cols; + vector part_keys; ObjectsTableWidget *col_tab = objects_tab_map[OBJ_COLUMN]; + PartitioningType part_type; if(!this->new_object) op_list->registerObject(this->object, Operation::OBJECT_MODIFIED); @@ -795,6 +797,17 @@ void TableWidget::applyConfiguration(void) table->setUnlogged(unlogged_chk->isChecked()); table->setTag(dynamic_cast(tag_sel->getSelectedObject())); + part_type = partitioning_type_cmb->currentIndex() == 0 ? BaseType::null : PartitioningType(partitioning_type_cmb->currentText()); + table->setPartitioningType(part_type); + + if(part_type != BaseType::null) + { + partition_keys_tab->getElements(part_keys); + table->addPartitionKeys(part_keys); + } + else + table->removePartitionKeys(); + BaseObjectWidget::applyConfiguration(); //Retrieving all columns marked as primary key diff --git a/libpgmodeler_ui/src/tablewidget.h b/libpgmodeler_ui/src/tablewidget.h index e9a661c5fa..71a2daadcc 100644 --- a/libpgmodeler_ui/src/tablewidget.h +++ b/libpgmodeler_ui/src/tablewidget.h @@ -37,7 +37,7 @@ class TableWidget: public BaseObjectWidget, public Ui::TableWidget { ObjectsTableWidget *parent_tables; - ElementsTableWidget *partion_keys_tab; + ElementsTableWidget *partition_keys_tab; ObjectSelectorWidget *tag_sel; From 686be34d73b5cb17d87f3f22406c7d09e4e6650d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 28 Sep 2018 10:47:16 -0300 Subject: [PATCH 133/425] Improved the models destruction when closing the application --- libpgmodeler/src/databasemodel.cpp | 96 ++++++++++++++++++------------ libpgmodeler_ui/src/mainwindow.cpp | 13 ++++ 2 files changed, 72 insertions(+), 37 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index ea9323c31b..d71006c6fe 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -739,60 +739,80 @@ void DatabaseModel::setProtected(bool value) void DatabaseModel::destroyObjects(void) { - ObjectType types[]={ - BASE_RELATIONSHIP,OBJ_RELATIONSHIP, OBJ_TABLE, OBJ_VIEW, - OBJ_AGGREGATE, OBJ_OPERATOR, - OBJ_SEQUENCE, OBJ_CONVERSION, - OBJ_CAST, OBJ_OPFAMILY, OBJ_OPCLASS, - BASE_RELATIONSHIP, OBJ_TEXTBOX, - OBJ_DOMAIN, OBJ_TYPE, OBJ_FUNCTION, - OBJ_LANGUAGE, OBJ_TABLESPACE, OBJ_ROLE, OBJ_COLLATION, - OBJ_EXTENSION, OBJ_SCHEMA, OBJ_PERMISSION, OBJ_TAG, OBJ_GENERIC_SQL }; - ObjectType graph_types[]={ OBJ_SCHEMA, BASE_RELATIONSHIP, OBJ_RELATIONSHIP, OBJ_TABLE, OBJ_VIEW }; - vector *list=nullptr; BaseObject *object=nullptr; - unsigned i, cnt=sizeof(types)/sizeof(ObjectType); + map objects; + map::reverse_iterator ritr, ritr_end; + vector rem_obj_types; //Blocking signals of all graphical objects to avoid uneeded updates in the destruction this->blockSignals(true); - for(i=0; i < 5; i++) + for(unsigned i=0; i < 5; i++) { for(auto &object : *this->getObjectList(graph_types[i])) dynamic_cast(object)->blockSignals(true); } - //Removing the special objects first - storeSpecialObjectsXML(); - disconnectRelationships(); + try + { + //Removing the special objects first + storeSpecialObjectsXML(); + disconnectRelationships(); + } + catch(Exception &e) + { + /* DEBUG: An exception at this point shouldn't never occur but if + * it is raised, we spit out the error to the stdout in order to try to + * find out the problem! */ + QTextStream out(stdout); + out << trUtf8("** FAIL TO DESTROY ALL OBJECTS **") << endl; + out << e.getExceptionsText() << endl; + } - for(i=0; i < cnt; i++) + objects = getCreationOrder(SchemaParser::XML_DEFINITION, true); + ritr = objects.rbegin(), + ritr_end = objects.rend(); + + while(ritr != ritr_end) { - list=getObjectList(types[i]); + object = ritr->second; + ritr++; - while(!list->empty()) - { - object=list->back(); + // We ignore the database itself as well table children objects + if(object->getObjectType() == OBJ_DATABASE || + TableObject::isTableObject(object->getObjectType())) + continue; - /* If the object is graphical destroy using the __removeObject in order - emit the signal to object scene to remove the graphical representation - of the to-be-destroyed object */ - if(dynamic_cast(object)) - { - __removeObject(object,-1,false); + // Register the type of the object being removed so the respective list can be cleaned in the end + rem_obj_types.push_back(object->getObjectType()); - if(object->getObjectType()==OBJ_RELATIONSHIP) - dynamic_cast(object)->destroyObjects(); - } - else - list->pop_back(); + /* If the object is graphical destroy using the __removeObject in order + emit the signal to object scene to remove the graphical representation + of the to-be-destroyed object */ + if(dynamic_cast(object)) + { + __removeObject(object,-1,false); - delete(object); + if(object->getObjectType()==OBJ_RELATIONSHIP) + dynamic_cast(object)->destroyObjects(); } + + delete(object); } PgSQLType::removeUserTypes(this); + + //Cleaning out the list of removed objects to avoid segfaults while calling this method again + if(!rem_obj_types.empty()) + { + std::sort(rem_obj_types.begin(), rem_obj_types.end()); + vector::iterator end = std::unique(rem_obj_types.begin(), rem_obj_types.end()); + rem_obj_types.erase(end, rem_obj_types.end()); + + for(auto type : rem_obj_types) + getObjectList(type)->clear(); + } } void DatabaseModel::addTable(Table *table, int obj_idx) @@ -1268,8 +1288,8 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) rel=getRelationship(view,tab); if(tab && !rel) { - rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_DEP, view, tab, false, false); - rel->setName(PgModelerNS::generateUniqueName(rel, base_relationships)); + rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_DEP, view, tab, false, false); + rel->setName(PgModelerNS::generateUniqueName(rel, base_relationships)); addRelationship(rel); } } @@ -4722,7 +4742,7 @@ Table *DatabaseModel::createTable(void) { xmlparser.getElementAttributes(aux_attribs); table->setPartitioningType(aux_attribs[ParsersAttributes::TYPE]); -#warning "TODO: load partitionkey tag data" + #warning "TODO: load partitionkey tag data" } //Retrieving initial data else if(elem==ParsersAttributes::INITIAL_DATA) @@ -8169,7 +8189,9 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector switch(obj_type) { case OBJ_TYPE: ptr_pgsqltype=dynamic_cast(object); break; - case OBJ_DOMAIN: ptr_pgsqltype=dynamic_cast(object); break; + case OBJ_DOMAIN: + ptr_pgsqltype=dynamic_cast(object); + break; case OBJ_SEQUENCE: ptr_pgsqltype=dynamic_cast(object); break; case OBJ_EXTENSION: ptr_pgsqltype=dynamic_cast(object); break; case OBJ_VIEW: ptr_pgsqltype=dynamic_cast(object); break; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index ee6958ee5c..ee2ff2defd 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -441,6 +441,19 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par MainWindow::~MainWindow(void) { + ModelWidget *model = nullptr; + int idx = 0; + + /* Destroying models from the last to the first in order + * to destroy other objects inside the models in the proper order */ + while(models_tbw->count() > 0) + { + idx = models_tbw->count() - 1; + model = dynamic_cast(models_tbw->widget(idx)); + models_tbw->removeTab(idx); + delete(model); + } + //This fix the crash on exit at Mac OSX system (but not sure why) (???) file_menu->clear(); delete(restoration_form); From ae0a1535c392c01e4ebf791106218d328b057f66 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 28 Sep 2018 11:08:08 -0300 Subject: [PATCH 134/425] Fixed the order of recent models saved on the file pgmodeler.conf --- libpgmodeler_ui/src/generalconfigwidget.cpp | 6 +++--- libpgmodeler_ui/src/mainwindow.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 885b931a94..2a952634bf 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -553,11 +553,11 @@ void GeneralConfigWidget::saveConfiguration(void) itr->first==ParsersAttributes::SQL_TOOL) { schparser.ignoreUnkownAttributes(true); - schparser.ignoreEmptyAttributes(true); + schparser.ignoreEmptyAttributes(true); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DOCK_WIDGETS]+= - schparser.getCodeDefinition(widget_sch, itr->second); + schparser.getCodeDefinition(widget_sch, itr->second); schparser.ignoreUnkownAttributes(false); - schparser.ignoreEmptyAttributes(false); + schparser.ignoreEmptyAttributes(false); } itr++; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index ee2ff2defd..bec2007006 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -692,7 +692,7 @@ void MainWindow::closeEvent(QCloseEvent *event) while(!recent_models.isEmpty()) { - param_id=QString("%1%2").arg(ParsersAttributes::RECENT).arg(i++); + param_id=QString("%1%2").arg(ParsersAttributes::RECENT).arg(QString::number(i++).rightJustified(2, '0')); attribs[ParsersAttributes::ID]=param_id; attribs[ParsersAttributes::PATH]=recent_models.front(); conf_wgt->addConfigurationParam(param_id, attribs); From eadbb8dbe0433f7f7ff4412b393e12b0a5c0b998 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 28 Sep 2018 12:04:10 -0300 Subject: [PATCH 135/425] Fixed the diff process in such way to create new columns with their respective COMMENT ON statement when present. Fixed the detection of comment changes for columns on diff process. --- libpgmodeler/src/baseobject.cpp | 20 +++++++++++++++++--- libpgmodeler/src/baseobject.h | 2 ++ libpgmodeler/src/column.cpp | 7 +++++-- libpgmodeler/src/table.cpp | 2 +- schemas/sql/column.sch | 14 +++++++++----- schemas/sql/constraint.sch | 4 ++++ 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 5ae0e34bc4..303487ee67 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -1216,6 +1216,20 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff } } + alter += getAlterCommentDefinition(object, attributes); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } + + return(alter); +} + +QString BaseObject::getAlterCommentDefinition(BaseObject *object, attribs_map attributes) +{ + try + { if(this->getComment()!=object->getComment()) { if(object->getComment().isEmpty()) @@ -1225,13 +1239,13 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - alter+=schparser.getCodeDefinition(ParsersAttributes::COMMENT, attributes, SchemaParser::SQL_DEFINITION); + return(schparser.getCodeDefinition(ParsersAttributes::COMMENT, attributes, SchemaParser::SQL_DEFINITION)); } + + return(QString()); } catch(Exception &e) { throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } - - return(alter); } diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 81469d9c97..edb0d6b823 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -228,6 +228,8 @@ class BaseObject { static QString getAlterDefinition(QString sch_name, attribs_map &attribs, bool ignore_ukn_attribs=false, bool ignore_empty_attribs=false); + QString getAlterCommentDefinition(BaseObject *object, attribs_map attributes); + public: //! \brief Maximum number of characters that an object name on PostgreSQL can have static const int OBJECT_NAME_MAX_LENGTH=63; diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 59a33d92e7..7fc67fc173 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -284,7 +284,7 @@ QString Column::getAlterDefinition(BaseObject *object) try { attribs_map attribs; - QString def_val; + QString def_val, alter_def; bool ident_seq_changed = false; BaseObject::setBasicAttributes(true); @@ -371,7 +371,10 @@ QString Column::getAlterDefinition(BaseObject *object) } copyAttributes(attribs); - return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); + alter_def = BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true); + alter_def += getAlterCommentDefinition(object, attributes); + + return(alter_def); } catch(Exception &e) { diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 77cc199fcf..a9a39457a0 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -151,7 +151,7 @@ void Table::setProtected(bool value) void Table::setCommentAttribute(TableObject *tab_obj) { - if(tab_obj && !tab_obj->getComment().isEmpty()) + if(tab_obj && !tab_obj->getComment().isEmpty() && tab_obj->isDeclaredInTable()) { attribs_map attribs; diff --git a/schemas/sql/column.sch b/schemas/sql/column.sch index b116099e42..dc179e6352 100644 --- a/schemas/sql/column.sch +++ b/schemas/sql/column.sch @@ -6,11 +6,11 @@ %if {decl-in-table} %then $tb %else -[-- object: ] {name} [ | type: ] {sql-object} [ --] $br -[-- ] {drop} - %if {table} %then - [ALTER TABLE ] {table} [ ADD COLUMN ] - %end + [-- object: ] {name} [ | type: ] {sql-object} [ --] $br + [-- ] {drop} + %if {table} %then + [ALTER TABLE ] {table} [ ADD COLUMN ] + %end %end {name} $sp {type} @@ -70,4 +70,8 @@ $br [-- ddl-end --] $br $br %end +%if %not {decl-in-table} %and {comment} %then + {comment} $br +%end + $br diff --git a/schemas/sql/constraint.sch b/schemas/sql/constraint.sch index a6564653a2..4e99b50e62 100644 --- a/schemas/sql/constraint.sch +++ b/schemas/sql/constraint.sch @@ -76,4 +76,8 @@ [-- ddl-end --] $br %end +%if %not {decl-in-table} %and {comment} %then + {comment} $br +%end + $br From 3d827fc1642ddc8e01aea735ca95b6b5609e899b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 1 Oct 2018 15:04:47 -0300 Subject: [PATCH 136/425] Adding support to load partition keys and partitioning type on TableWidget --- libpgmodeler/src/table.cpp | 17 ++++- libpgmodeler_ui/src/elementstablewidget.cpp | 66 ++++++++-------- libpgmodeler_ui/src/elementstablewidget.h | 85 +++++++++++---------- libpgmodeler_ui/src/tablewidget.cpp | 13 +++- libutils/src/exception.cpp | 3 +- libutils/src/exception.h | 5 +- 6 files changed, 104 insertions(+), 85 deletions(-) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index a9a39457a0..32c4e84dd8 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -593,7 +593,14 @@ void Table::addPartitionKeys(vector &part_keys) { vector part_keys_bkp = partition_keys; - partition_keys.clear(); + if(partitioning_type == BaseType::null) + return; + + if(partitioning_type == PartitioningType::list && part_keys.size() > 1) + throw Exception(Exception::getErrorMessage(ERR_INV_PARTITION_KEY_COUNT).arg(this->getSignature()), + ERR_INV_PARTITION_KEY_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + partition_keys.clear(); for(auto &part_key : part_keys) { @@ -1536,9 +1543,11 @@ void Table::operator = (Table &tab) this->with_oid=tab.with_oid; this->col_indexes=tab.col_indexes; this->constr_indexes=tab.constr_indexes; - - setGenerateAlterCmds(tab.gen_alter_cmds); - setProtected(tab.is_protected); + this->partitioning_type=tab.partitioning_type; + this->initial_data=tab.initial_data; + this->partition_keys=tab.partition_keys; + this->copy_op=tab.copy_op; + this->unlogged=tab.unlogged; PgSQLType::renameUserType(prev_name, this, this->getName(true)); } diff --git a/libpgmodeler_ui/src/elementstablewidget.cpp b/libpgmodeler_ui/src/elementstablewidget.cpp index 65057f5599..e16fb0e057 100644 --- a/libpgmodeler_ui/src/elementstablewidget.cpp +++ b/libpgmodeler_ui/src/elementstablewidget.cpp @@ -34,7 +34,7 @@ ElementsTableWidget::ElementsTableWidget(QWidget *parent) : QWidget(parent) QVBoxLayout *vbox = new QVBoxLayout(this); elements_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::UPDATE_BUTTON | ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + (ObjectsTableWidget::UPDATE_BUTTON | ObjectsTableWidget::DUPLICATE_BUTTON), true, this); elements_tab->setColumnCount(7); elements_tab->setHeaderLabel(trUtf8("Element"), 0); @@ -59,19 +59,19 @@ ElementsTableWidget::ElementsTableWidget(QWidget *parent) : QWidget(parent) catch(Exception &e) { throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } + } } ElementsTableWidget::~ElementsTableWidget(void) { - if(handled_elem) - delete(handled_elem); + if(handled_elem) + delete(handled_elem); } void ElementsTableWidget::showElementData(Element *elem, int elem_idx) { if(!elem) - return; + return; if(elem->getColumn()) { @@ -86,15 +86,15 @@ void ElementsTableWidget::showElementData(Element *elem, int elem_idx) elements_tab->clearCellText(elem_idx, 2); if(elem->getOperator()) - elements_tab->setCellText(elem->getOperator()->getSignature(true), elem_idx, 2); + elements_tab->setCellText(elem->getOperator()->getSignature(true), elem_idx, 2); elements_tab->clearCellText(elem_idx, 3); if(elem->getOperatorClass()) - elements_tab->setCellText(elem->getOperatorClass()->getName(true), elem_idx, 3); + elements_tab->setCellText(elem->getOperatorClass()->getName(true), elem_idx, 3); elements_tab->clearCellText(elem_idx, 4); if(elem->getCollation()) - elements_tab->setCellText(elem->getCollation()->getName(true), elem_idx, 4); + elements_tab->setCellText(elem->getCollation()->getName(true), elem_idx, 4); if(elem->isSortingEnabled()) { @@ -119,29 +119,29 @@ void ElementsTableWidget::showElementData(Element *elem, int elem_idx) QVariant ElementsTableWidget::copyElementData(Element *elem) { - if(dynamic_cast(elem)) - return(QVariant::fromValue(*dynamic_cast(elem))); + if(dynamic_cast(elem)) + return(QVariant::fromValue(*dynamic_cast(elem))); - if(dynamic_cast(elem)) - return(QVariant::fromValue(*dynamic_cast(elem))); + if(dynamic_cast(elem)) + return(QVariant::fromValue(*dynamic_cast(elem))); - if(dynamic_cast(elem)) - return(QVariant::fromValue(*dynamic_cast(elem))); + if(dynamic_cast(elem)) + return(QVariant::fromValue(*dynamic_cast(elem))); - return(QVariant()); + return(QVariant()); } int ElementsTableWidget::openElementForm(Element *elem) { - int res = 0; + int res = 0; - GeneralConfigWidget::restoreWidgetGeometry(&element_form, element_wgt->metaObject()->className()); - element_wgt->setAttributes(model, parent_obj, elem); - element_form.setWindowTitle(element_wgt->windowTitle()); - res = element_form.exec(); - GeneralConfigWidget::saveWidgetGeometry(&element_form, element_wgt->metaObject()->className()); + GeneralConfigWidget::restoreWidgetGeometry(&element_form, element_wgt->metaObject()->className()); + element_wgt->setAttributes(model, parent_obj, elem); + element_form.setWindowTitle(element_wgt->windowTitle()); + res = element_form.exec(); + GeneralConfigWidget::saveWidgetGeometry(&element_form, element_wgt->metaObject()->className()); - return(res); + return(res); } void ElementsTableWidget::editElement(int elem_idx) @@ -155,32 +155,32 @@ void ElementsTableWidget::editElement(int elem_idx) if(data.canConvert()) { - idx_elem = data.value(); - elem = &idx_elem; + idx_elem = data.value(); + elem = &idx_elem; } if(data.canConvert()) { - exc_elem = data.value(); - elem = &exc_elem; + exc_elem = data.value(); + elem = &exc_elem; } if(data.canConvert()) { - part_key = data.value(); - elem = &part_key; + part_key = data.value(); + elem = &part_key; } res = openElementForm(elem); if(elem && res == QDialog::Accepted) - showElementData(element_wgt->getElement(), elem_idx); + showElementData(element_wgt->getElement(), elem_idx); } void ElementsTableWidget::addElement(int elem_idx) { - if(openElementForm(handled_elem) == QDialog::Accepted) - showElementData(element_wgt->getElement(), elem_idx); - else - elements_tab->removeRow(elem_idx); + if(openElementForm(handled_elem) == QDialog::Accepted) + showElementData(element_wgt->getElement(), elem_idx); + else + elements_tab->removeRow(elem_idx); } diff --git a/libpgmodeler_ui/src/elementstablewidget.h b/libpgmodeler_ui/src/elementstablewidget.h index 0f053e3d39..74004bb3ed 100644 --- a/libpgmodeler_ui/src/elementstablewidget.h +++ b/libpgmodeler_ui/src/elementstablewidget.h @@ -77,64 +77,65 @@ class ElementsTableWidget: public QWidget { template void setAttributes(DatabaseModel *model, BaseObject *parent_obj) { - if(handled_elem && !dynamic_cast(handled_elem)) - { - delete(handled_elem); - handled_elem = nullptr; - } - - if(!handled_elem) - handled_elem = new Class; - - this->model = model; - this->parent_obj = parent_obj; - - if(dynamic_cast(handled_elem)) - elements_tab->setHeaderVisible(2, false); - - if(dynamic_cast(handled_elem)) - elements_tab->setHeaderVisible(4, false); - - if(dynamic_cast(handled_elem)) - { - elements_tab->setHeaderVisible(2, false); - elements_tab->setHeaderVisible(4, false); - elements_tab->setHeaderVisible(5, false); - elements_tab->setHeaderVisible(6, false); - } + if(handled_elem && !dynamic_cast(handled_elem)) + { + delete(handled_elem); + handled_elem = nullptr; + } + + if(!handled_elem) + handled_elem = new Class; + + this->model = model; + this->parent_obj = parent_obj; + + if(dynamic_cast(handled_elem)) + elements_tab->setHeaderVisible(2, false); + + if(dynamic_cast(handled_elem)) + elements_tab->setHeaderVisible(4, false); + + if(dynamic_cast(handled_elem)) + { + elements_tab->setHeaderVisible(2, false); + elements_tab->setHeaderVisible(4, false); + elements_tab->setHeaderVisible(5, false); + elements_tab->setHeaderVisible(6, false); + } } //! \brief Fills the grid with the elements on the vector vector template void setElements(vector elems) { - elements_tab->blockSignals(true); - for(auto &elem : elems) - { - elements_tab->addRow(); - showElementData(&elem, elements_tab->getRowCount() - 1); - } - elements_tab->blockSignals(false); + elements_tab->blockSignals(true); + for(auto &elem : elems) + { + elements_tab->addRow(); + showElementData(&elem, elements_tab->getRowCount() - 1); + } + elements_tab->clearSelection(); + elements_tab->blockSignals(false); } //! \brief Fills the provided vector with the elements on the grid template void getElements(vector &elems) { - if(elements_tab->getRowCount() > 0) - { - if(elements_tab->getRowData(0).canConvert()) + if(elements_tab->getRowCount() > 0) { - elems.clear(); - for(unsigned i=0; i < elements_tab->getRowCount(); i++) - elems.push_back(elements_tab->getRowData(i).value()); + if(elements_tab->getRowData(0).canConvert()) + { + elems.clear(); + for(unsigned i=0; i < elements_tab->getRowCount(); i++) + elems.push_back(elements_tab->getRowData(i).value()); + } } - } } - private slots: - void addElement(int elem_idx); - void editElement(int elem_idx); + private slots: + void addElement(int elem_idx); + void editElement(int elem_idx); }; #endif diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index a3ec455bd2..9213a74000 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -241,6 +241,7 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc unsigned i, count; Table *aux_tab=nullptr; ObjectType types[]={ OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_POLICY }; + vector part_keys; if(!table) { @@ -298,7 +299,13 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc tag_sel->setModel(this->model); tag_sel->setSelectedObject(table->getTag()); + int idx = partitioning_type_cmb->findText(~table->getPartitioningType()); + partitioning_type_cmb->setCurrentIndex(idx < 0 ? 0 : idx); partition_keys_tab->setAttributes(model, table); + + part_keys = table->getPartitionKeys(); + partition_keys_tab->setAttributes(this->model, table); + partition_keys_tab->setElements(part_keys); } catch(Exception &e) { @@ -802,11 +809,11 @@ void TableWidget::applyConfiguration(void) if(part_type != BaseType::null) { - partition_keys_tab->getElements(part_keys); - table->addPartitionKeys(part_keys); + partition_keys_tab->getElements(part_keys); + table->addPartitionKeys(part_keys); } else - table->removePartitionKeys(); + table->removePartitionKeys(); BaseObjectWidget::applyConfiguration(); diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 7a4d244dd1..d075303a3a 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -254,7 +254,8 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_REF_INV_AFFECTED_CMD", QT_TR_NOOP("Reference to an invalid affected command in policy `%1'!")}, {"ERR_REF_INV_SPECIAL_ROLE", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")}, {"ERR_INV_COLUMN_COUNT_PART_REL", QT_TR_NOOP("Unable to create a partition relationship because the partion table `%1' is not empty or has columns that are not present on the partitioned table `%2'!")}, - {"ERR_INV_PARTITIONIG_TYPE_PART_REL", QT_TR_NOOP("Unable to create a partition relationship between the tables `%1' (partition) and `%2' (partitioned) because no partitioning type is defined on the latter!")} + {"ERR_INV_PARTITIONIG_TYPE_PART_REL", QT_TR_NOOP("Unable to create a partition relationship between the tables `%1' (partition) and `%2' (partitioned) because no partitioning type is defined on the latter!")}, + {"ERR_INV_PARTITION_KEY_COUNT", QT_TR_NOOP("Invalid amount of partition keys being assinged to the table `%1'! Multiples partition keys are allowed only on `HASH' and `RANGE' partitioning strategies.")} }; Exception::Exception(void) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 2050be8429..b2e7e1cf61 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -282,12 +282,13 @@ enum ErrorType { ERR_REF_INV_AFFECTED_CMD, ERR_REF_INV_SPECIAL_ROLE, ERR_INV_COLUMN_COUNT_PART_REL, - ERR_INV_PARTITIONIG_TYPE_PART_REL + ERR_INV_PARTITIONIG_TYPE_PART_REL, + ERR_INV_PARTITION_KEY_COUNT }; class Exception { private: - static const int ERROR_COUNT=236; + static const int ERROR_COUNT=237; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ From 1239e276c1a3d59b3bd2e9cf0f76eb564e486738 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 2 Oct 2018 17:44:06 -0300 Subject: [PATCH 137/425] Fixed the creation of elements (index, exclude, patition key) on DatabaseModel PartitionKey class is now able to generate SQL and XML code. Fixed the class Relationship to reuse compatible columns when handling partitioning relationships Start to include partitioning code on Table class --- conf/defaults/sql-highlight.conf | 1 + conf/sql-highlight.conf | 1 + libparsers/src/parsersattributes.cpp | 2 + libparsers/src/parsersattributes.h | 2 + libpgmodeler/src/databasemodel.cpp | 146 +++++++++++++---- libpgmodeler/src/element.h | 8 +- libpgmodeler/src/partitionkey.cpp | 24 +++ libpgmodeler/src/partitionkey.h | 18 ++- libpgmodeler/src/relationship.cpp | 29 +--- libpgmodeler/src/table.cpp | 181 ++++++++++++++-------- libpgmodeler/src/table.h | 7 + libpgmodeler_ui/src/elementstablewidget.h | 1 - libpgmodeler_ui/src/elementwidget.cpp | 136 ++++++++-------- libpgmodeler_ui/src/modelwidget.cpp | 1 + libutils/src/exception.cpp | 6 +- libutils/src/exception.h | 7 +- schemas/sql/paritionkey.sch | 18 --- schemas/sql/table.sch | 12 +- schemas/xml/dtd/table.dtd | 2 +- schemas/xml/partitionkey.sch | 4 + schemas/xml/table.sch | 6 +- 21 files changed, 390 insertions(+), 222 deletions(-) delete mode 100644 schemas/sql/paritionkey.sch diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index 076b77692d..2017731db1 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -285,6 +285,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index 076b77692d..2017731db1 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -285,6 +285,7 @@ + diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index eb4eb51e8f..f4398d99f2 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -360,6 +360,8 @@ namespace ParsersAttributes { PARENTS=QString("parents"), PARSABLE=QString("parsable"), PARTIAL_MATCH=QString("partial-match"), + PARTITION_KEY=QString("partitionkey"), + PARTITIONED_TABLE=QString("partitioned-table"), PARTITIONING=QString("partitioning"), PASSWORD=QString("password"), PASSWORD_ENCRYPTION=QString("password-encryption"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index c3527eb6ec..a929fd015a 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -367,6 +367,8 @@ namespace ParsersAttributes { PARENTS, PARSABLE, PARTIAL_MATCH, + PARTITION_KEY, + PARTITIONED_TABLE, PARTITIONING, PASSWORD, PASSWORD_ENCRYPTION, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index d71006c6fe..57057e36aa 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4657,6 +4657,8 @@ Table *DatabaseModel::createTable(void) ObjectType obj_type; vector idxs; vector names; + PartitionKey part_key; + vector partition_keys; try { @@ -4742,7 +4744,25 @@ Table *DatabaseModel::createTable(void) { xmlparser.getElementAttributes(aux_attribs); table->setPartitioningType(aux_attribs[ParsersAttributes::TYPE]); - #warning "TODO: load partitionkey tag data" + xmlparser.savePosition(); + + if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + { + do + { + if(xmlparser.getElementType()==XML_ELEMENT_NODE && + xmlparser.getElementName()==ParsersAttributes::PARTITION_KEY) + { + createElement(part_key, nullptr, table); + partition_keys.push_back(part_key); + } + } + while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + + table->addPartitionKeys(partition_keys); + } + + xmlparser.restorePosition(); } //Retrieving initial data else if(elem==ParsersAttributes::INITIAL_DATA) @@ -5062,13 +5082,20 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec Operator *oper=nullptr; Collation *collation=nullptr; QString xml_elem; + bool is_part_key = false; xml_elem=xmlparser.getElementName(); + is_part_key = xml_elem == ParsersAttributes::PARTITION_KEY; - if(xml_elem==ParsersAttributes::INDEX_ELEMENT || xml_elem==ParsersAttributes::EXCLUDE_ELEMENT) + if(xml_elem==ParsersAttributes::INDEX_ELEMENT || xml_elem==ParsersAttributes::EXCLUDE_ELEMENT || is_part_key) { xmlparser.getElementAttributes(attribs); + elem.setColumn(nullptr); + elem.setCollation(nullptr); + elem.setOperator(nullptr); + elem.setOperatorClass(nullptr); + elem.setSortingAttribute(Element::ASC_ORDER, attribs[ParsersAttributes::ASC_ORDER]==ParsersAttributes::_TRUE_); elem.setSortingAttribute(Element::NULLS_FIRST, attribs[ParsersAttributes::NULLS_FIRST]==ParsersAttributes::_TRUE_); elem.setSortingEnabled(attribs[ParsersAttributes::USE_SORTING]!=ParsersAttributes::_FALSE_); @@ -5090,18 +5117,29 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec //Raises an error if the operator class doesn't exists if(!op_class) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) - .arg(tab_obj->getName()) - .arg(tab_obj->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_OPCLASS)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + if(!is_part_key) + { + throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + .arg(tab_obj->getName()) + .arg(tab_obj->getTypeName()) + .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(BaseObject::getTypeName(OBJ_OPCLASS)), + ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + else + { + throw Exception(QString(Exception::getErrorMessage(ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL)) + .arg(parent_obj->getName()) + .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(BaseObject::getTypeName(OBJ_OPCLASS)), + ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } } elem.setOperatorClass(op_class); } //Checking if elem is a ExcludeElement to be able to assign an operator to it - else if(xml_elem==ParsersAttributes::OPERATOR && dynamic_cast(&elem)) + else if(xml_elem==ParsersAttributes::OPERATOR) { xmlparser.getElementAttributes(attribs); oper=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_OPERATOR)); @@ -5117,9 +5155,9 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - dynamic_cast(elem).setOperator(oper); + elem.setOperator(oper); } - else if(xml_elem==ParsersAttributes::COLLATION && dynamic_cast(&elem)) + else if(xml_elem==ParsersAttributes::COLLATION) { xmlparser.getElementAttributes(attribs); collation=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], OBJ_COLLATION)); @@ -5127,15 +5165,26 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec //Raises an error if the operator class doesn't exists if(!collation) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) - .arg(tab_obj->getName()) - .arg(tab_obj->getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLLATION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + if(!is_part_key) + { + throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + .arg(tab_obj->getName()) + .arg(tab_obj->getTypeName()) + .arg(attribs[ParsersAttributes::NAME]) + .arg(BaseObject::getTypeName(OBJ_COLLATION)), + ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + else + { + throw Exception(QString(Exception::getErrorMessage(ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL)) + .arg(parent_obj->getName()) + .arg(attribs[ParsersAttributes::NAME]) + .arg(BaseObject::getTypeName(OBJ_COLLATION)), + ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } } - dynamic_cast(elem).setCollation(collation); + elem.setCollation(collation); } else if(xml_elem==ParsersAttributes::COLUMN) { @@ -5156,12 +5205,23 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec //Raises an error if the column doesn't exists if(!column) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) - .arg(tab_obj->getName()) - .arg(tab_obj->getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLUMN)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + if(!is_part_key) + { + throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + .arg(tab_obj->getName()) + .arg(tab_obj->getTypeName()) + .arg(attribs[ParsersAttributes::NAME]) + .arg(BaseObject::getTypeName(OBJ_COLUMN)), + ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + else + { + throw Exception(QString(Exception::getErrorMessage(ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL)) + .arg(parent_obj->getName()) + .arg(attribs[ParsersAttributes::NAME]) + .arg(BaseObject::getTypeName(OBJ_COLUMN)), + ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } } elem.setColumn(column); @@ -6584,10 +6644,10 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab > Case the parent table is a partition and a column is being removed > Case the object is a constraint and its a table primary key */ revalidate_rels=((obj_type==OBJ_COLUMN && - (parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::primary_key) || - parent_tab->isPartition())) || - (obj_type==OBJ_CONSTRAINT && - dynamic_cast(object)->getConstraintType()==ConstraintType::primary_key)); + (parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::primary_key) || + parent_tab->isPartition() || parent_tab->isPartitioned())) || + (obj_type==OBJ_CONSTRAINT && + dynamic_cast(object)->getConstraintType()==ConstraintType::primary_key)); /* Additional validation for columns: checks if the parent table participates on a generalization/copy as destination table */ @@ -6601,7 +6661,7 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab rel=dynamic_cast(*itr); itr++; ref_tab_inheritance=(rel->getRelationshipType()==Relationship::RELATIONSHIP_GEN && - rel->getReferenceTable()==parent_tab); + rel->getReferenceTable()==parent_tab); } } @@ -8608,6 +8668,17 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } + //Checking if the partition keys are referencing the operator class + for(auto &part_key : table->getPartitionKeys()) + { + if(part_key.getOperatorClass() == object) + { + refer = true; + refs.push_back(table); + break; + } + } + itr++; } } @@ -8739,6 +8810,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector vector *tab_obj_list=nullptr; vector::iterator tab_itr, tab_itr_end; TableObject *tab_obj=nullptr; + Table *table = nullptr; count=sizeof(obj_types)/sizeof(ObjectType); for(i=0; i < count && (!exclusion_mode || (exclusion_mode && !refer)); i++) @@ -8766,9 +8838,11 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { + table = dynamic_cast
(*itr); + for(i=0; i < count && (!exclusion_mode || (exclusion_mode && !refer)); i++) { - tab_obj_list=dynamic_cast
(*itr)->getObjectList(tab_obj_types[i]); + tab_obj_list=table->getObjectList(tab_obj_types[i]); tab_itr=tab_obj_list->begin(); tab_itr_end=tab_obj_list->end(); @@ -8785,6 +8859,18 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector tab_itr++; } } + + //Checking if the partition keys are referencing the operator class + for(auto &part_key : table->getPartitionKeys()) + { + if(part_key.getCollation() == object) + { + refer = true; + refs.push_back(table); + break; + } + } + itr++; } } diff --git a/libpgmodeler/src/element.h b/libpgmodeler/src/element.h index 25175a1115..ec55173293 100644 --- a/libpgmodeler/src/element.h +++ b/libpgmodeler/src/element.h @@ -67,12 +67,12 @@ class Element { virtual ~Element(void) {} //! \brief Element configuration methods - void setColumn(Column *column); - void setExpression(const QString &expression); - void setOperatorClass(OperatorClass *oper_class); - void setSortingEnabled(bool value); + virtual void setColumn(Column *column); + virtual void setExpression(const QString &expression); + virtual void setOperatorClass(OperatorClass *oper_class); virtual void setCollation(Collation *){} virtual void setOperator(Operator *){} + void setSortingEnabled(bool value); //! \brief Sets the state of one of the element sorting method void setSortingAttribute(unsigned attrib, bool value); diff --git a/libpgmodeler/src/partitionkey.cpp b/libpgmodeler/src/partitionkey.cpp index a83b86f935..43d520a53e 100644 --- a/libpgmodeler/src/partitionkey.cpp +++ b/libpgmodeler/src/partitionkey.cpp @@ -20,10 +20,34 @@ PartitionKey::PartitionKey(void) { + collation = nullptr; +} +void PartitionKey::setCollation(Collation *collation) +{ + this->collation=collation; +} + +Collation *PartitionKey::getCollation(void) +{ + return(collation); } QString PartitionKey::getCodeDefinition(unsigned def_type) { + attribs_map attribs; + schparser.setPgSQLVersion(BaseObject::getPgSQLVersion()); + + attribs[ParsersAttributes::COLLATION]=QString(); + configureAttributes(attribs, def_type); + + if(collation) + { + if(def_type==SchemaParser::SQL_DEFINITION) + attribs[ParsersAttributes::COLLATION]=collation->getName(true); + else + attribs[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); + } + return(schparser.getCodeDefinition(ParsersAttributes::PARTITION_KEY, attribs, def_type)); } diff --git a/libpgmodeler/src/partitionkey.h b/libpgmodeler/src/partitionkey.h index 7b1357e7dc..713101ec3d 100644 --- a/libpgmodeler/src/partitionkey.h +++ b/libpgmodeler/src/partitionkey.h @@ -27,13 +27,21 @@ #include "element.h" class PartitionKey: public Element { - private: + private: + //! \brief Collation referenced by the element + Collation *collation; - public: - PartitionKey(void); + public: + PartitionKey(void); - //! \brief Returns the SQL / XML code definition for the partition key - virtual QString getCodeDefinition(unsigned def_type) final; + //! \brief Defines the collation referenced by the element + void setCollation(Collation *collation); + + //! \brief Get the collation referenced by the element + Collation *getCollation(void); + + //! \brief Returns the SQL / XML code definition for the partition key + virtual QString getCodeDefinition(unsigned def_type) final; }; #endif diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 1398cdcd3d..4b02270a39 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -846,21 +846,11 @@ void Relationship::addColumnsRelGenPart(void) /* If the relationship is partitioning the destination table (partitioned) shoud have * a partitioning type defined otherwise and error is raised */ - if(rel_type == RELATIONSHIP_PART && dst_tab->getPartitioningType() == PartitioningType::null) + if(rel_type == RELATIONSHIP_PART && !dst_tab->isPartitioned()) throw Exception(Exception::getErrorMessage(ERR_INV_PARTITIONIG_TYPE_PART_REL) .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), ERR_INV_PARTITIONIG_TYPE_PART_REL, __PRETTY_FUNCTION__,__FILE__,__LINE__); - /* If the relationship is partitioning the source table (partition) should be empty - * or at least have the same number of columns of the destination table (partitioned), - * otherwise an exception is raised. */ - if(rel_type == RELATIONSHIP_PART && src_count > 0 && src_count != dst_count) - { - throw Exception(Exception::getErrorMessage(ERR_INV_COLUMN_COUNT_PART_REL) - .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), - ERR_INV_COLUMN_COUNT_PART_REL, __PRETTY_FUNCTION__,__FILE__,__LINE__); - } - /* This for compares the columns of the receiver table with the columns of the reference table in order to resolve the conflicting names */ @@ -934,8 +924,7 @@ void Relationship::addColumnsRelGenPart(void) for(idx=0; idx < tab_count; idx++) { parent_tab=dynamic_cast
(aux_tab->getObject(idx, OBJ_TABLE)); - cond=(aux_col->getParentTable()==parent_tab && - aux_col->isAddedByGeneralization()); + cond=(aux_col->getParentTable()==parent_tab && aux_col->isAddedByGeneralization()); } } @@ -943,9 +932,8 @@ void Relationship::addColumnsRelGenPart(void) else { parent_tab=aux_tab->getCopyTable(); - cond=(parent_tab && - aux_col->getParentTable()==parent_tab && - aux_col->isAddedByCopy()); + cond=(parent_tab && rel_type == RELATIONSHIP_DEP && + aux_col->getParentTable()==parent_tab && aux_col->isAddedByCopy()); } if(id_tab==0) @@ -976,12 +964,6 @@ void Relationship::addColumnsRelGenPart(void) } } - /* In partition relationships, raises an error if the currently evaluated column from - * source table (partition) does not exist in the destination table (partitioned) because - * both tables should have the same columns */ - if(src_count > 0 && !duplic && rel_type == RELATIONSHIP_PART) - err_type = ERR_INV_COLUMN_COUNT_PART_REL; - //In case that no error was detected (ERR_CUSTOM) if(err_type==ERR_CUSTOM) { @@ -1021,6 +1003,9 @@ void Relationship::addColumnsRelGenPart(void) } } + if((src_tab->getColumnCount() + columns.size()) != dst_tab->getColumnCount() && rel_type == RELATIONSHIP_PART) + err_type = ERR_INV_COLUMN_COUNT_PART_REL; + //In case that no duplicity error is detected if(err_type==ERR_CUSTOM) { diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 32c4e84dd8..91f3424046 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -42,6 +42,8 @@ Table::Table(void) : BaseTable() attributes[ParsersAttributes::RLS_ENABLED]=QString(); attributes[ParsersAttributes::RLS_FORCED]=QString(); attributes[ParsersAttributes::PARTITIONING]=QString(); + attributes[ParsersAttributes::PARTITION_KEY]=QString(); + attributes[ParsersAttributes::PARTITIONED_TABLE]=QString(); copy_table=partioned_table=nullptr; partitioning_type=BaseType::null; @@ -222,7 +224,7 @@ void Table::setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols) /* Do not generates the column code definition when it is not included by relatoinship, in case of XML definition. */ if((def_type==SchemaParser::SQL_DEFINITION && !columns[i]->isAddedByCopy() && !columns[i]->isAddedByGeneralization()) || - (def_type==SchemaParser::SQL_DEFINITION && columns[i]->isAddedByCopy() && this->isPartition()) || + (def_type==SchemaParser::SQL_DEFINITION && columns[i]->isAddedByCopy() && this->isPartition()) || (def_type==SchemaParser::XML_DEFINITION && (!columns[i]->isAddedByRelationship() || (incl_rel_added_cols && columns[i]->isAddedByRelationship())))) { str_cols+=columns[i]->getCodeDefinition(def_type); @@ -591,7 +593,7 @@ void Table::setCopyTableOptions(CopyOptions like_op) void Table::addPartitionKeys(vector &part_keys) { - vector part_keys_bkp = partition_keys; + vector part_keys_bkp = partition_keys; if(partitioning_type == BaseType::null) return; @@ -602,18 +604,26 @@ void Table::addPartitionKeys(vector &part_keys) partition_keys.clear(); - for(auto &part_key : part_keys) - { - if(std::find(partition_keys.begin(), partition_keys.end(), part_key) != partition_keys.end()) + for(auto &part_key : part_keys) { - partition_keys = part_keys_bkp; - throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); - } + if(std::find(partition_keys.begin(), partition_keys.end(), part_key) != partition_keys.end()) + { + partition_keys = part_keys_bkp; + throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } - partition_keys.push_back(part_key); - } + if(part_key.getColumn() && part_key.getColumn()->isAddedByRelationship()) + { + partition_keys = part_keys_bkp; + throw Exception(Exception::getErrorMessage(ERR_ASG_INV_COLUMN_PARTITION_KEY) + .arg(part_key.getColumn()->getSignature(true)), + ERR_ASG_INV_COLUMN_PARTITION_KEY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } - setCodeInvalidated(true); + partition_keys.push_back(part_key); + } + + setCodeInvalidated(true); } void Table::removePartitionKeys(void) @@ -737,6 +747,14 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) ERR_REM_INDIRECT_REFERENCE,__PRETTY_FUNCTION__,__FILE__,__LINE__); } + //Raises an error if the column is being referenced by any partition key + if(isPartitionKeyRefColumn(column)) + { + throw Exception(Exception::getErrorMessage(ERR_REM_COL_REF_PARTITION_KEY) + .arg(column->getName()).arg(this->getName(true)), + ERR_REM_COL_REF_PARTITION_KEY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + column->setParentTable(nullptr); columns.erase(itr); } @@ -1462,6 +1480,25 @@ bool Table::isConstraintRefColumn(Column *column, ConstraintType constr_type) return(found); } +bool Table::isPartitionKeyRefColumn(Column *column) +{ + bool found=false; + + if(column) + { + for(auto &part_key : partition_keys) + { + if(part_key.getColumn() == column) + { + found = true; + break; + } + } + } + + return(found); +} + void Table::setGenerateAlterCmds(bool value) { setCodeInvalidated(gen_alter_cmds != value); @@ -1489,41 +1526,54 @@ void Table::updateAlterCmdsStatus(void) QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) { - attributes[ParsersAttributes::OIDS]=(with_oid ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::UNLOGGED]=(unlogged ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RLS_ENABLED]=(rls_enabled ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RLS_FORCED]=(rls_forced ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::COPY_TABLE]=QString(); - attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); - attributes[ParsersAttributes::TAG]=QString(); - attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::PARTITIONING]=~partitioning_type; - - if(def_type==SchemaParser::SQL_DEFINITION && copy_table) - attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); - - if(tag && def_type==SchemaParser::XML_DEFINITION) - attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); - - (copy_table ? copy_table->getName(true) : QString()); - - setColumnsAttribute(def_type, incl_rel_added_objs); - setConstraintsAttribute(def_type); - setAncestorTableAttribute(); - - if(def_type==SchemaParser::XML_DEFINITION) - { - setRelObjectsIndexesAttribute(); - setPositionAttribute(); - setFadedOutAttribute(); - attributes[ParsersAttributes::INITIAL_DATA]=initial_data; - attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); - } - else - attributes[ParsersAttributes::INITIAL_DATA]=getInitialDataCommands(); + QStringList part_keys_code; + attributes[ParsersAttributes::OIDS]=(with_oid ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::UNLOGGED]=(unlogged ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RLS_ENABLED]=(rls_enabled ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RLS_FORCED]=(rls_forced ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::COPY_TABLE]=QString(); + attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); + attributes[ParsersAttributes::TAG]=QString(); + attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::PARTITIONING]=~partitioning_type; + attributes[ParsersAttributes::PARTITION_KEY]=QString(); + + for(auto part_key : partition_keys) + part_keys_code+=part_key.getCodeDefinition(def_type); + + if(def_type == SchemaParser::SQL_DEFINITION) + attributes[ParsersAttributes::PARTITION_KEY]=part_keys_code.join(','); + else + attributes[ParsersAttributes::PARTITION_KEY]=part_keys_code.join(' '); + + if(def_type==SchemaParser::SQL_DEFINITION && copy_table) + attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); + + if(def_type==SchemaParser::SQL_DEFINITION && partioned_table) + attributes[ParsersAttributes::PARTITIONED_TABLE]=partioned_table->getName(true); + + if(tag && def_type==SchemaParser::XML_DEFINITION) + attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); + + (copy_table ? copy_table->getName(true) : QString()); - return(BaseObject::__getCodeDefinition(def_type)); + setColumnsAttribute(def_type, incl_rel_added_objs); + setConstraintsAttribute(def_type); + setAncestorTableAttribute(); + + if(def_type==SchemaParser::XML_DEFINITION) + { + setRelObjectsIndexesAttribute(); + setPositionAttribute(); + setFadedOutAttribute(); + attributes[ParsersAttributes::INITIAL_DATA]=initial_data; + attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); + } + else + attributes[ParsersAttributes::INITIAL_DATA]=getInitialDataCommands(); + + return(BaseObject::__getCodeDefinition(def_type)); } QString Table::getCodeDefinition(unsigned def_type) @@ -1575,7 +1625,12 @@ bool Table::isReferRelationshipAddedObject(void) bool Table::isPartition(void) { - return(partioned_table != nullptr); + return(partioned_table != nullptr); +} + +bool Table::isPartitioned(void) +{ + return(partitioning_type != BaseType::null); } void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2) @@ -1919,28 +1974,28 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi void Table::setObjectListsCapacity(unsigned capacity) { - if(capacity < DEF_MAX_OBJ_COUNT || capacity > DEF_MAX_OBJ_COUNT * 10) - capacity = DEF_MAX_OBJ_COUNT; + if(capacity < DEF_MAX_OBJ_COUNT || capacity > DEF_MAX_OBJ_COUNT * 10) + capacity = DEF_MAX_OBJ_COUNT; - columns.reserve(capacity); - constraints.reserve(capacity/2); - indexes.reserve(capacity/2); - rules.reserve(capacity/2); - triggers.reserve(capacity/2); - policies.reserve(capacity/2); + columns.reserve(capacity); + constraints.reserve(capacity/2); + indexes.reserve(capacity/2); + rules.reserve(capacity/2); + triggers.reserve(capacity/2); + policies.reserve(capacity/2); } unsigned Table::getMaxObjectCount(void) { - unsigned count = 0, max = 0; - vector types = { OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_INDEX, - OBJ_RULE, OBJ_TRIGGER, OBJ_POLICY }; + unsigned count = 0, max = 0; + vector types = { OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_INDEX, + OBJ_RULE, OBJ_TRIGGER, OBJ_POLICY }; - for(auto type : types) - { - count = getObjectList(type)->size(); - if(count > max) max = count; - } + for(auto type : types) + { + count = getObjectList(type)->size(); + if(count > max) max = count; + } - return(max); + return(max); } diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 5e4efb887d..e63f937003 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -370,6 +370,10 @@ class Table: public BaseTable { The user must specify the constraint type */ bool isConstraintRefColumn(Column *column, ConstraintType constr_type); + /*! \brief Returns if the specified column is referenced by one of the constraints on table. + The user must specify the constraint type */ + bool isPartitionKeyRefColumn(Column *column); + //! \brief Swaps two objects position void swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2); @@ -379,6 +383,9 @@ class Table: public BaseTable { //! \brief Returns if the table is a partition of another table bool isPartition(void); + //! \brief Returns if the table is a partitioned. This is the same as getPartitioningType() != BaseType::null + bool isPartitioned(void); + //! \brief Copy the attributes between two tables void operator = (Table &tabela); diff --git a/libpgmodeler_ui/src/elementstablewidget.h b/libpgmodeler_ui/src/elementstablewidget.h index 74004bb3ed..946129d882 100644 --- a/libpgmodeler_ui/src/elementstablewidget.h +++ b/libpgmodeler_ui/src/elementstablewidget.h @@ -98,7 +98,6 @@ class ElementsTableWidget: public QWidget { if(dynamic_cast(handled_elem)) { elements_tab->setHeaderVisible(2, false); - elements_tab->setHeaderVisible(4, false); elements_tab->setHeaderVisible(5, false); elements_tab->setHeaderVisible(6, false); } diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index 6036d4eba9..ab239798db 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -79,54 +79,54 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) catch(Exception &e) { throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } + } } void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, Element *elem) { - if(!elem) - this->setEnabled(false); - else - { - IndexElement *idx_elem = dynamic_cast(elem); - ExcludeElement *exc_elem = dynamic_cast(elem); - PartitionKey *part_key = dynamic_cast(elem); - Column *column = elem->getColumn(); - - setAttributes(model, parent_obj); - - if(idx_elem) - setIndexElement(idx_elem); - else if(exc_elem) - setExcludeElement(exc_elem); + if(!elem) + this->setEnabled(false); else - setPartitionKey(part_key); - - if(parent_obj->getObjectType() == OBJ_TABLE && - (column || (!column && elem->getExpression().isEmpty()))) { - column_rb->setChecked(true); + IndexElement *idx_elem = dynamic_cast(elem); + ExcludeElement *exc_elem = dynamic_cast(elem); + PartitionKey *part_key = dynamic_cast(elem); + Column *column = elem->getColumn(); + + setAttributes(model, parent_obj); + + if(idx_elem) + setIndexElement(idx_elem); + else if(exc_elem) + setExcludeElement(exc_elem); + else + setPartitionKey(part_key); + + if(parent_obj->getObjectType() == OBJ_TABLE && + (column || (!column && elem->getExpression().isEmpty()))) + { + column_rb->setChecked(true); - if(column) - column_cmb->setCurrentIndex(column_cmb->findText(column->getName())); - } - else - { - expression_rb->setChecked(true); - elem_expr_txt->setPlainText(elem->getExpression()); - } + if(column) + column_cmb->setCurrentIndex(column_cmb->findText(column->getName())); + } + else + { + expression_rb->setChecked(true); + elem_expr_txt->setPlainText(elem->getExpression()); + } - if(elem->getSortingAttribute(IndexElement::ASC_ORDER)) - ascending_rb->setChecked(true); - else - descending_rb->setChecked(true); - - nulls_first_chk->setChecked(elem->getSortingAttribute(IndexElement::NULLS_FIRST)); - sorting_chk->setChecked(elem->isSortingEnabled()); - op_class_sel->setSelectedObject(elem->getOperatorClass()); - collation_sel->setSelectedObject(elem->getCollation()); - operator_sel->setSelectedObject(elem->getOperator()); - } + if(elem->getSortingAttribute(IndexElement::ASC_ORDER)) + ascending_rb->setChecked(true); + else + descending_rb->setChecked(true); + + nulls_first_chk->setChecked(elem->getSortingAttribute(IndexElement::NULLS_FIRST)); + sorting_chk->setChecked(elem->isSortingEnabled()); + op_class_sel->setSelectedObject(elem->getOperatorClass()); + collation_sel->setSelectedObject(elem->getCollation()); + operator_sel->setSelectedObject(elem->getOperator()); + } } void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) @@ -176,35 +176,35 @@ void ElementWidget::setExcludeElement(ExcludeElement *elem) void ElementWidget::setPartitionKey(PartitionKey *elem) { - createElement(elem); - setWindowTitle(trUtf8("Partition key properties")); - collation_sel->setVisible(false); - collation_lbl->setVisible(false); - sorting_chk->setVisible(false); - ascending_rb->setVisible(false); - descending_rb->setVisible(false); - nulls_first_chk->setVisible(false); - warning_frame->setVisible(false); + createElement(elem); + setWindowTitle(trUtf8("Partition key properties")); + collation_sel->setVisible(true); + collation_lbl->setVisible(true); + sorting_chk->setVisible(false); + ascending_rb->setVisible(false); + descending_rb->setVisible(false); + nulls_first_chk->setVisible(false); + warning_frame->setVisible(true); } Element *ElementWidget::getElement(void) { - return(element); + return(element); } void ElementWidget::applyConfiguration(void) { - element->setSortingEnabled(sorting_chk->isChecked()); - element->setSortingAttribute(IndexElement::NULLS_FIRST, nulls_first_chk->isChecked()); - element->setSortingAttribute(IndexElement::ASC_ORDER, ascending_rb->isChecked()); - element->setOperatorClass(dynamic_cast(op_class_sel->getSelectedObject())); - element->setCollation(dynamic_cast(collation_sel->getSelectedObject())); - element->setOperator(dynamic_cast(operator_sel->getSelectedObject())); - - if(expression_rb->isChecked()) - element->setExpression(elem_expr_txt->toPlainText().toUtf8()); - else - element->setColumn(reinterpret_cast(column_cmb->itemData(column_cmb->currentIndex()).value())); + element->setSortingEnabled(sorting_chk->isChecked()); + element->setSortingAttribute(IndexElement::NULLS_FIRST, nulls_first_chk->isChecked()); + element->setSortingAttribute(IndexElement::ASC_ORDER, ascending_rb->isChecked()); + element->setOperatorClass(dynamic_cast(op_class_sel->getSelectedObject())); + element->setCollation(dynamic_cast(collation_sel->getSelectedObject())); + element->setOperator(dynamic_cast(operator_sel->getSelectedObject())); + + if(expression_rb->isChecked()) + element->setExpression(elem_expr_txt->toPlainText().toUtf8()); + else + element->setColumn(reinterpret_cast(column_cmb->itemData(column_cmb->currentIndex()).value())); } void ElementWidget::updateColumnsCombo(void) @@ -227,7 +227,7 @@ void ElementWidget::updateColumnsCombo(void) { column=table->getColumn(i); column_cmb->addItem(column->getName(), - QVariant::fromValue(column)); + QVariant::fromValue(column)); } } else if(rel) @@ -237,7 +237,7 @@ void ElementWidget::updateColumnsCombo(void) { column=rel->getAttribute(i); column_cmb->addItem(column->getName(), - QVariant::fromValue(column)); + QVariant::fromValue(column)); } } } @@ -277,11 +277,11 @@ void ElementWidget::selectElementObject(void) template void ElementWidget::createElement(Class *elem) { - if(element && !dynamic_cast(element)) - delete(element); + if(element && !dynamic_cast(element)) + delete(element); - if(!element) - element = new Class; + if(!element) + element = new Class; - *element = *elem; + *element = *elem; } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 14f0d74158..b50884f3d0 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2930,6 +2930,7 @@ void ModelWidget::removeObjects(bool cascade) db_model->removePermissions(tab_obj); aux_table=dynamic_cast
(table); + if(aux_table && obj_type==OBJ_CONSTRAINT && dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::foreign_key) db_model->updateTableFKRelationships(aux_table); diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index d075303a3a..fa860db204 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -255,7 +255,11 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_REF_INV_SPECIAL_ROLE", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")}, {"ERR_INV_COLUMN_COUNT_PART_REL", QT_TR_NOOP("Unable to create a partition relationship because the partion table `%1' is not empty or has columns that are not present on the partitioned table `%2'!")}, {"ERR_INV_PARTITIONIG_TYPE_PART_REL", QT_TR_NOOP("Unable to create a partition relationship between the tables `%1' (partition) and `%2' (partitioned) because no partitioning type is defined on the latter!")}, - {"ERR_INV_PARTITION_KEY_COUNT", QT_TR_NOOP("Invalid amount of partition keys being assinged to the table `%1'! Multiples partition keys are allowed only on `HASH' and `RANGE' partitioning strategies.")} + {"ERR_INV_PARTITION_KEY_COUNT", QT_TR_NOOP("Invalid amount of partition keys being assinged to the table `%1'! Multiples partition keys are allowed only on `HASH' and `RANGE' partitioning strategies.")}, + {"ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL", QT_TR_NOOP("A partition key of the table `%1' is referencing the object `%3' (%4) which was not found in the model!")}, + {"ERR_ASG_INV_COLUMN_PARTITION_KEY", QT_TR_NOOP("The column `%1' can't be assigned to a partition key because it was created by a relatinship and this kind of operation is not yet supported! HINT: create the column manually on the table and then create the partition key using it.")}, + {"ERR_REM_COL_REF_PARTITION_KEY", QT_TR_NOOP("The column `%1' on the table `%2' can't be removed because it is being referenced by one or more patition keys!")}, + }; Exception::Exception(void) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index b2e7e1cf61..edc6b4250b 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -283,12 +283,15 @@ enum ErrorType { ERR_REF_INV_SPECIAL_ROLE, ERR_INV_COLUMN_COUNT_PART_REL, ERR_INV_PARTITIONIG_TYPE_PART_REL, - ERR_INV_PARTITION_KEY_COUNT + ERR_INV_PARTITION_KEY_COUNT, + ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL, + ERR_ASG_INV_COLUMN_PARTITION_KEY, + ERR_REM_COL_REF_PARTITION_KEY }; class Exception { private: - static const int ERROR_COUNT=237; + static const int ERROR_COUNT=240; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ diff --git a/schemas/sql/paritionkey.sch b/schemas/sql/paritionkey.sch deleted file mode 100644 index 2868ac2c50..0000000000 --- a/schemas/sql/paritionkey.sch +++ /dev/null @@ -1,18 +0,0 @@ -# SQL definition for partition key elements -# PostgreSQL Version: 10.x -# CAUTION: Do not modify this file unless you know what you are doing. -# Code generation can be broken if incorrect changes are made. - -$br $tb $sp $tb - -%if {column} %then - {column} -%else - %if {expression} %then - ({expression}) - %end -%end - -%if {opclass} %then - $tb $tb $tb {opclass} -%end diff --git a/schemas/sql/table.sch b/schemas/sql/table.sch index fe953bf77f..97c6673ffc 100644 --- a/schemas/sql/table.sch +++ b/schemas/sql/table.sch @@ -18,7 +18,11 @@ [ UNLOGGED] %end -[ TABLE ] {name} ( $br +[ TABLE ] {name} + +%if ({pgsql-ver} >=f "10.0") %and {partitioned-table} %then [ PARTITION OF ] {partitioned-table} %end + +[ (] $br %if {copy-table} %then $tb LIKE $sp {copy-table} %if %not {gen-alter-cmds} %then @@ -46,8 +50,10 @@ $br ) -%if {ancestor-table} %then [ INHERITS(] {ancestor-table} [)] $br %end -%if {oids} %then [WITH ( OIDS = TRUE )] %end +%if ({pgsql-ver} >=f "10.0") %and {partitioned-table} %then $br [FOR VALUES ] ... %end +%if ({pgsql-ver} >=f "10.0") %and {partitioning} %then $br [PARTITION BY ] {partitioning} [ (] {partitionkey} $br [)] %end +%if {ancestor-table} %then [ INHERITS(] {ancestor-table} [)] %end +%if {oids} %then $br [WITH ( OIDS = TRUE )] %end %if {tablespace} %then $br [TABLESPACE ] {tablespace} %end diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 24d78b33a5..6fcafdd94a 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -8,7 +8,7 @@ %constraint; - + diff --git a/schemas/xml/partitionkey.sch b/schemas/xml/partitionkey.sch index 3e27e70aed..375151ada9 100644 --- a/schemas/xml/partitionkey.sch +++ b/schemas/xml/partitionkey.sch @@ -9,6 +9,10 @@ $tb $tb $br $tb $tb $tb $br %end +%if {collation} %then + $tb $tb {collation} +%end + %if {opclass} %then $tb $tb $tb {opclass} %end diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index 2ff2b5e303..2b0c8eab74 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -31,11 +31,9 @@ %if {col-indexes} %then {col-indexes} %end %if {constr-indexes} %then {constr-indexes} %end - %if {partitioning} %then + %if {partitioning} %and {partitionkey} %then $tb [] $br - $tb $tb [] $br - $tb $tb $tb [] $br - $tb $tb [] $br + {partitionkey} $tb [] $br %end From e7016423221a08d811e30cf6cf6e1c2ac9a33d15 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 3 Oct 2018 17:40:00 -0300 Subject: [PATCH 138/425] Added support to specify partition bounding expression on partitioning relationships Move the fk settings, copy options and name patterns group boxes to a dedicated tab on RelationshipWidget --- conf/defaults/sql-highlight.conf | 2 + conf/sql-highlight.conf | 2 + libparsers/src/parsersattributes.cpp | 1 + libparsers/src/parsersattributes.h | 1 + libpgmodeler/src/baserelationship.cpp | 1 + libpgmodeler/src/databasemodel.cpp | 9 +- libpgmodeler/src/relationship.cpp | 20 +- libpgmodeler/src/relationship.h | 13 +- libpgmodeler/src/table.cpp | 11 +- libpgmodeler/src/table.h | 6 + libpgmodeler_ui/src/baseobjectwidget.cpp | 5 + libpgmodeler_ui/src/baseobjectwidget.h | 3 + libpgmodeler_ui/src/modelwidget.cpp | 11 +- libpgmodeler_ui/src/relationshipwidget.cpp | 59 +- libpgmodeler_ui/src/relationshipwidget.h | 16 +- libpgmodeler_ui/ui/relationshipwidget.ui | 955 ++++++++++++--------- schemas/sql/partitionkey.sch | 20 + schemas/sql/table.sch | 13 +- schemas/xml/dtd/relationship.dtd | 2 +- schemas/xml/relationship.sch | 6 +- 20 files changed, 705 insertions(+), 451 deletions(-) create mode 100644 schemas/sql/partitionkey.sch diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index 2017731db1..0ac55aafc1 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -253,6 +253,7 @@ + @@ -306,6 +307,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index 2017731db1..0ac55aafc1 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -253,6 +253,7 @@ + @@ -306,6 +307,7 @@ + diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index f4398d99f2..81301efcdd 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -361,6 +361,7 @@ namespace ParsersAttributes { PARSABLE=QString("parsable"), PARTIAL_MATCH=QString("partial-match"), PARTITION_KEY=QString("partitionkey"), + PARTITION_BOUND_EXPR=QString("partition-bound-expr"), PARTITIONED_TABLE=QString("partitioned-table"), PARTITIONING=QString("partitioning"), PASSWORD=QString("password"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index a929fd015a..06799e8b4e 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -369,6 +369,7 @@ namespace ParsersAttributes { PARTIAL_MATCH, PARTITION_KEY, PARTITIONED_TABLE, + PARTITION_BOUND_EXPR, PARTITIONING, PASSWORD, PASSWORD_ENCRYPTION, diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 0fdb79ed38..c235c31ad8 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -115,6 +115,7 @@ void BaseRelationship::configureRelationship(void) attributes[ParsersAttributes::DEL_ACTION]=QString(); attributes[ParsersAttributes::CUSTOM_COLOR]=QString(); attributes[ParsersAttributes::REFERENCE_FK]=QString(); + attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); //Check if the relationship type is valid if(rel_type <= RELATIONSHIP_FK) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 57057e36aa..94dd3f33e1 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -6377,7 +6377,14 @@ BaseRelationship *DatabaseModel::createRelationship(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::COLUMN && rel) + if(elem == ParsersAttributes::EXPRESSION && rel) + { + xmlparser.savePosition(); + xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + rel->setPartitionBoundingExpr(xmlparser.getElementContent()); + xmlparser.restorePosition(); + } + else if(elem==ParsersAttributes::COLUMN && rel) { xmlparser.savePosition(); rel->addObject(createColumn()); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 4b02270a39..be7775b673 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -329,6 +329,17 @@ QString Relationship::getTableNameRelNN(void) return(tab_name_relnn); } +void Relationship::setPartitionBoundingExpr(const QString &part_bound_expr) +{ + part_bounding_expr = part_bound_expr; + this->invalidated = true; +} + +QString Relationship::getPartitionBoundingExpr(void) +{ + return(part_bounding_expr); +} + bool Relationship::isDeferrable(void) { return(deferrable); @@ -1145,9 +1156,10 @@ void Relationship::connectRelationship(void) } else if(rel_type == RELATIONSHIP_PART) { - //Creates the columns on the receiver table following the rules for copy rules - addColumnsRelGenPart(); - getReceiverTable()->setPartionedTable(dynamic_cast
(getReferenceTable())); + //Creates the columns on the receiver table following the rules for copy rules + addColumnsRelGenPart(); + getReceiverTable()->setPartionedTable(dynamic_cast
(getReferenceTable())); + getReceiverTable()->setPartitionBoundingExpr(part_bounding_expr); } else if(rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N) @@ -2545,6 +2557,8 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::DST_FK_PATTERN]=name_patterns[DST_FK_PATTERN]; attributes[ParsersAttributes::PK_COL_PATTERN]=name_patterns[PK_COL_PATTERN]; + attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=part_bounding_expr; + attributes[ParsersAttributes::COLUMNS]=QString(); count=rel_attributes.size(); for(i=0; i < count; i++) diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index 41763eb6d6..815a1dcaf0 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -206,6 +206,9 @@ class Relationship: public BaseRelationship { src_tab_prev_name, dst_tab_prev_name; + //! \brief The partition bounding expression + QString part_bounding_expr; + //! \brief Indicates if the column exists on the referenced column list bool isColumnExists(Column *column); @@ -347,6 +350,13 @@ class Relationship: public BaseRelationship { //! \brief Returns the name of the table auto generated by the n-n relationship QString getTableNameRelNN(void); + /*! \brief Defines the partition bounding expression associated to the partition table (receiver table) + * when the relationship is connected (only for partitioning relationship) */ + void setPartitionBoundingExpr(const QString &part_bound_expr); + + //! \brief Returns the partition bouding expression configured for the relationship (only for partitioning relationship) + QString getPartitionBoundingExpr(void); + //! \brief Defines if the created foreign key is deferrable (only for 1-1, 1-n relationships) void setDeferrable(bool value); @@ -357,7 +367,7 @@ class Relationship: public BaseRelationship { void setDeferralType(DeferralType defer_type); /*! \brief Defines the type of action for generated foreign keys (ON DELETE and ON UPDATE) - User must use Constraint::[DELETE_ACTION|UPDATE_ACTION] (only for 1-1, 1-n relationships) */ + User must use Constraint::[DELETE_ACTION|UPDATE_ACTION] (only for 1-1, 1-n relationships) */ void setActionType(ActionType act_type, unsigned act_id); //! \brief Returns the deferral tyep for the created foreign key (only for 1-1, 1-n relationships) @@ -474,6 +484,7 @@ class Relationship: public BaseRelationship { Table *getReferenceTable(void); void setSiglePKColumn(bool value); + bool isSiglePKColumn(void); //! \brief Returns SQL / XML definition for the relationship. diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 91f3424046..24ad43ef36 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -44,6 +44,7 @@ Table::Table(void) : BaseTable() attributes[ParsersAttributes::PARTITIONING]=QString(); attributes[ParsersAttributes::PARTITION_KEY]=QString(); attributes[ParsersAttributes::PARTITIONED_TABLE]=QString(); + attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); copy_table=partioned_table=nullptr; partitioning_type=BaseType::null; @@ -546,7 +547,14 @@ void Table::addPolicy(Policy *pol, int idx_pol) void Table::setPartionedTable(Table *table) { - partioned_table = table; + setCodeInvalidated(partioned_table != table); + partioned_table = table; +} + +void Table::setPartitionBoundingExpr(const QString part_bound_expr) +{ + setCodeInvalidated(part_bounding_expr != part_bound_expr); + part_bounding_expr = part_bound_expr; } void Table::addConstraint(Constraint *constr, int idx) @@ -1538,6 +1546,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::PARTITIONING]=~partitioning_type; attributes[ParsersAttributes::PARTITION_KEY]=QString(); + attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=part_bounding_expr; for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index e63f937003..102d5eb2ed 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -45,6 +45,9 @@ class Table: public BaseTable { This will produce a set of INSERT commands that is appended to the table's SQL definition */ QString initial_data; + //! \brief The partition bounding expression + QString part_bounding_expr; + //! \brief Vectors that store basic table attributes vector columns; vector constraints; @@ -194,6 +197,9 @@ class Table: public BaseTable { //! \brief Adds a partition table void setPartionedTable(Table *table); + //! \brief Defines the partition bounding expression + void setPartitionBoundingExpr(const QString part_bound_expr); + //! \brief Configures the copy table void setCopyTable(Table *tab); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 69af6dd646..0b40127641 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -258,6 +258,11 @@ void BaseObjectWidget::configureTabOrder(vector widgets) QWidget::setTabOrder(tab_order[idx], tab_order[idx+1]); } +BaseObject *BaseObjectWidget::getHandledObject(void) +{ + return(object); +} + void BaseObjectWidget::cancelChainedOperation(void) { bool op_list_changed=false; diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 9bcef52b06..97aaf29726 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -134,6 +134,8 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { void disableReferencesSQL(BaseObject *object); void configureTabOrder(vector widgets={}); + + BaseObject *getHandledObject(void); public: //! \brief Constants used to generate version intervals for version alert frame @@ -192,6 +194,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { void s_closeRequested(void); friend class BaseForm; + friend class ModelWidget; }; template diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index b50884f3d0..b53eea2f70 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1604,18 +1604,25 @@ int ModelWidget::openEditingForm(QWidget *widget, unsigned button_conf) { BaseForm editing_form(this); BaseObjectWidget *base_obj_wgt=qobject_cast(widget); + QString class_name = widget->metaObject()->className(); int res = 0; if(base_obj_wgt) + { + BaseRelationship *rel = dynamic_cast(base_obj_wgt->getHandledObject()); editing_form.setMainWidget(base_obj_wgt); + + if(rel) + class_name.prepend(rel->getRelationshipTypeName().replace(QRegExp("( )+|(\\-)+"), QString())); + } else editing_form.setMainWidget(widget); editing_form.setButtonConfiguration(button_conf); - GeneralConfigWidget::restoreWidgetGeometry(&editing_form, widget->metaObject()->className()); + GeneralConfigWidget::restoreWidgetGeometry(&editing_form, class_name); res = editing_form.exec(); - GeneralConfigWidget::saveWidgetGeometry(&editing_form, widget->metaObject()->className()); + GeneralConfigWidget::saveWidgetGeometry(&editing_form, class_name); return(res); } diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index c737222090..f617e9be31 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -100,18 +100,18 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent grid=new QGridLayout; grid->addWidget(attributes_tab, 0,0,1,1); grid->setContentsMargins(4,4,4,4); - rel_attribs_tbw->widget(1)->setLayout(grid); + rel_attribs_tbw->widget(ATTRIBUTES_TAB)->setLayout(grid); grid=new QGridLayout; grid->addWidget(constraints_tab, 0,0,1,1); grid->setContentsMargins(4,4,4,4); - rel_attribs_tbw->widget(2)->setLayout(grid); + rel_attribs_tbw->widget(CONSTRAINTS_TAB)->setLayout(grid); - grid=dynamic_cast(rel_attribs_tbw->widget(3)->layout()); + grid=dynamic_cast(rel_attribs_tbw->widget(SPECIAL_PK_TAB)->layout()); frame=generateInformationFrame(trUtf8("Use the special primary key if you want to include a primary key containing generated columns to the receiver table. Important: if this is a new relationship there is a need to finish its creation and reopen this dialog to create the special primary key.")); grid->addWidget(frame, 1, 0, 1, 1); - frame->setParent(rel_attribs_tbw->widget(3)); + frame->setParent(rel_attribs_tbw->widget(SPECIAL_PK_TAB)); grid=new QGridLayout; grid->setContentsMargins(4,4,4,4); @@ -121,11 +121,11 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent frame=generateInformationFrame(trUtf8("This advanced tab shows the objects (columns or table) auto created by the relationship's connection as well the foreign keys that represents the link between the participant tables.")); grid->addWidget(frame, 1, 0, 1, 1); - rel_attribs_tbw->widget(4)->setLayout(grid); + rel_attribs_tbw->widget(ADVANCED_TAB)->setLayout(grid); color_picker=new ColorPickerWidget(1,this); color_picker->setEnabled(false); - grid=dynamic_cast(rel_attribs_tbw->widget(0)->layout()); + grid=dynamic_cast(rel_attribs_tbw->widget(GENERAL_TAB)->layout()); grid->addWidget(color_picker, 0, 1); configureFormLayout(relationship_grid, OBJ_RELATIONSHIP); @@ -150,11 +150,18 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent del_action_cmb->addItems(list); upd_action_cmb->addItems(list); - tabs={ nullptr, rel_attribs_tbw->widget(ATTRIBUTES_TAB), rel_attribs_tbw->widget(CONSTRAINTS_TAB), - rel_attribs_tbw->widget(SPECIAL_PK_TAB), rel_attribs_tbw->widget(ADVANCED_TAB) }; + tabs={ nullptr, rel_attribs_tbw->widget(SETTINGS_TAB), + rel_attribs_tbw->widget(ATTRIBUTES_TAB), rel_attribs_tbw->widget(CONSTRAINTS_TAB), + rel_attribs_tbw->widget(SPECIAL_PK_TAB), rel_attribs_tbw->widget(ADVANCED_TAB) }; - tab_labels=QStringList{ QString(), rel_attribs_tbw->tabText(ATTRIBUTES_TAB), rel_attribs_tbw->tabText(CONSTRAINTS_TAB), - rel_attribs_tbw->tabText(SPECIAL_PK_TAB), rel_attribs_tbw->tabText(ADVANCED_TAB)}; + tab_labels=QStringList{ QString(), rel_attribs_tbw->tabText(SETTINGS_TAB), + rel_attribs_tbw->tabText(ATTRIBUTES_TAB), rel_attribs_tbw->tabText(CONSTRAINTS_TAB), + rel_attribs_tbw->tabText(SPECIAL_PK_TAB), rel_attribs_tbw->tabText(ADVANCED_TAB)}; + + part_bound_expr_txt=new NumberedTextEditor(this, true); + part_bound_expr_hl=new SyntaxHighlighter(part_bound_expr_txt); + part_bound_expr_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + dynamic_cast(part_bound_expr_gb->layout())->addWidget(part_bound_expr_txt, 1, 0); connect(deferrable_chk, SIGNAL(toggled(bool)), deferral_cmb, SLOT(setEnabled(bool))); connect(deferrable_chk, SIGNAL(toggled(bool)), deferral_lbl, SLOT(setEnabled(bool))); @@ -194,7 +201,9 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent connect(fk_gconf_chk, SIGNAL(toggled(bool)), this, SLOT(useFKGlobalSettings(bool))); connect(patterns_gconf_chk, SIGNAL(toggled(bool)), this, SLOT(usePatternGlobalSettings(bool))); - setMinimumSize(620, 670); + connect(gen_bound_expr_tb, SIGNAL(clicked(bool)), this, SLOT(generateBoundingExpr())); + + setMinimumSize(600, 380); } catch(Exception &e) { @@ -301,6 +310,8 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l ref_table_txt->setPlainText(base_rel->getTable(BaseRelationship::SRC_TABLE)->getName(true)); recv_table_txt->setPlainText(base_rel->getTable(BaseRelationship::DST_TABLE)->getName(true)); } + + part_type_lbl->setText(~aux_rel->getReferenceTable()->getPartitioningType()); } disable_sql_chk->setVisible(base_rel->getObjectType()==OBJ_RELATIONSHIP); @@ -342,6 +353,8 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l identity_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::IDENTITY)); statistics_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::STATISTICS)); } + else if(rel_type == BaseRelationship::RELATIONSHIP_PART && this->new_object) + generateBoundingExpr(); } } @@ -388,12 +401,14 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l relnn_tab_name_edt->setVisible(relnn); gen_tab_name_hint->setVisible(relnn); - for(i=ATTRIBUTES_TAB; i <= ADVANCED_TAB; i++) + part_bound_expr_gb->setVisible(rel_type==BaseRelationship::RELATIONSHIP_PART); + + for(i=SETTINGS_TAB; i <= ADVANCED_TAB; i++) rel_attribs_tbw->removeTab(1); if(!relgen_dep) { - for(i=ATTRIBUTES_TAB; i <= SPECIAL_PK_TAB; i++) + for(i=SETTINGS_TAB; i <= SPECIAL_PK_TAB; i++) rel_attribs_tbw->addTab(tabs[i], tab_labels[i]); } else if(relgen_dep && base_rel->getObjectType()==OBJ_RELATIONSHIP) @@ -512,6 +527,22 @@ void RelationshipWidget::usePatternGlobalSettings(bool value) } } +void RelationshipWidget::generateBoundingExpr(void) +{ + PartitioningType part_type = part_type_lbl->text(); + QString tmpl; + + if(part_type == PartitioningType::list) + tmpl = QString("IN ( value )"); + else if(part_type == PartitioningType::range) + tmpl = QString("FROM ( value )\nTO ( value )"); + else + tmpl = QString("WITH ( MODULUS m, REMAINDER r )"); + + part_bound_expr_txt->clear(); + part_bound_expr_txt->setPlainText(tmpl); +} + void RelationshipWidget::listObjects(ObjectType obj_type) { ObjectsTableWidget *tab=nullptr; @@ -1053,6 +1084,8 @@ void RelationshipWidget::applyConfiguration(void) rel_type=rel->getRelationshipType(); rel->blockSignals(true); + rel->setPartitionBoundingExpr(part_bound_expr_txt->toPlainText()); + if(!defaults_rb->isChecked()) { if(including_rb->isChecked()) diff --git a/libpgmodeler_ui/src/relationshipwidget.h b/libpgmodeler_ui/src/relationshipwidget.h index e0ff0b0be5..8061f7c29d 100644 --- a/libpgmodeler_ui/src/relationshipwidget.h +++ b/libpgmodeler_ui/src/relationshipwidget.h @@ -36,15 +36,18 @@ class RelationshipWidget: public BaseObjectWidget, public Ui::RelationshipWidget Q_OBJECT static const unsigned GENERAL_TAB=0, - ATTRIBUTES_TAB=1, - CONSTRAINTS_TAB=2, - SPECIAL_PK_TAB=3, - ADVANCED_TAB=4; + SETTINGS_TAB=1, + ATTRIBUTES_TAB=2, + CONSTRAINTS_TAB=3, + SPECIAL_PK_TAB=4, + ADVANCED_TAB=5; HintTextWidget *gen_tab_name_ht, *ref_table_ht, *recv_table_ht, *identifier_ht, *single_pk_ht; ColorPickerWidget *color_picker; + NumberedTextEditor *part_bound_expr_txt; + //! \brief Stores the tab objects to change the configuration of the form depending on the type of the relationship QWidgetList tabs; @@ -53,7 +56,8 @@ class RelationshipWidget: public BaseObjectWidget, public Ui::RelationshipWidget SyntaxHighlighter *table1_hl, *table2_hl, - *patterns_hl[7]; + *patterns_hl[7], + *part_bound_expr_hl; //! \brief Table widgets that stores the attributes, constraint and advanced objects of relationship ObjectsTableWidget *attributes_tab, @@ -93,9 +97,9 @@ class RelationshipWidget: public BaseObjectWidget, public Ui::RelationshipWidget void selectCopyOptions(void); void listSpecialPkColumns(void); void duplicateObject(int curr_row, int new_row); - void useFKGlobalSettings(bool value); void usePatternGlobalSettings(bool value); + void generateBoundingExpr(void); public slots: void applyConfiguration(void); diff --git a/libpgmodeler_ui/ui/relationshipwidget.ui b/libpgmodeler_ui/ui/relationshipwidget.ui index 64a92332d3..e9f0f6f7b1 100644 --- a/libpgmodeler_ui/ui/relationshipwidget.ui +++ b/libpgmodeler_ui/ui/relationshipwidget.ui @@ -7,7 +7,7 @@ 0 0 858 - 1701 + 1251 @@ -25,7 +25,7 @@ 16777215 - 1701 + 16777215 @@ -52,6 +52,12 @@ 0 + + + 16777215 + 16777215 + + 0 @@ -175,22 +181,6 @@ - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - - - - @@ -293,214 +283,6 @@ - - - - - 0 - 0 - - - - Foreign key Settings - - - false - - - false - - - - 6 - - - 4 - - - 4 - - - 4 - - - 4 - - - - - true - - - Use the values defined on settings dialogs for the fields below - - - Use global settings for these fields - - - true - - - - - - - false - - - - 0 - 20 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - - - - 0 - 0 - - - - - 90 - 0 - - - - - 90 - 16777215 - - - - Deferrable: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Deferral: - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - QComboBox::AdjustToContents - - - - - - - ON DELETE: - - - - - - - - - - ON UPDATE: - - - - - - - - - - - - @@ -681,194 +463,29 @@ - - + + + + + + + Name of the table generated from many to many relationship + + + + + - + 0 0 - - Copy Options - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - false - - - INDEXES - - - - - - - false - - - COMMENTS - - - - - - - INCLUDING - - - - - - - false - - - DEFAULTS - - - - - - - - 0 - 0 - - - - E&XCLUDING - - - - - - - false - - - CONSTRAINTS - - - - - - - - 0 - 0 - - - - Use defaults - - - true - - - - - - - false - - - ALL - - - - - - - false - - - STORAGE - - - - - - - - 0 - 1 - - - - - 16777215 - 1 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - false - - - STATISTICS - - - - - - - false - - - IDENTITY - - - - - - - - - - - - - Name of the table generated from many to many relationship - - - - - - - - 0 - 0 - - - - - 22 - 22 - + + + 22 + 22 + @@ -944,7 +561,126 @@ - + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + Bounding expression + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + + Partitioning type: + + + + + + + + 75 + true + + + + NONE + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + Generate the partition bounding expression based upon the partitioning type in use. + + + Generate expression + + + + :/icones/icones/codigosql.png:/icones/icones/codigosql.png + + + + 22 + 22 + + + + Qt::ToolButtonTextBesideIcon + + + + + + + + + + + + + Settings + + + + 4 + + + 4 + + + 4 + + + 4 + + @@ -1279,6 +1015,392 @@ + + + + + 0 + 0 + + + + Foreign key Settings + + + false + + + false + + + + 6 + + + 4 + + + 4 + + + 4 + + + 4 + + + + + true + + + Use the values defined on settings dialogs for the fields below + + + Use global settings for these fields + + + true + + + + + + + false + + + + 0 + 20 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + + 0 + 0 + + + + + 90 + 0 + + + + + 90 + 16777215 + + + + Deferrable: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Deferral: + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + QComboBox::AdjustToContents + + + + + + + ON DELETE: + + + + + + + + + + ON UPDATE: + + + + + + + + + + + + + + + + + 0 + 0 + + + + Copy Options + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + false + + + INDEXES + + + + + + + false + + + COMMENTS + + + + + + + INCLUDING + + + + + + + false + + + DEFAULTS + + + + + + + + 0 + 0 + + + + E&XCLUDING + + + + + + + false + + + CONSTRAINTS + + + + + + + + 0 + 0 + + + + Use defaults + + + true + + + + + + + false + + + ALL + + + + + + + false + + + STORAGE + + + + + + + + 0 + 1 + + + + + 16777215 + 1 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + false + + + STATISTICS + + + + + + + false + + + IDENTITY + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -1351,17 +1473,10 @@ relnn_tab_name_edt ref_table_txt recv_table_txt - defaults_rb - including_rb - excluding_rb - all_chk - defaults_chk - constraints_chk - indexes_chk - storage_chk - comments_chk rel_columns_lst - + + + diff --git a/schemas/sql/partitionkey.sch b/schemas/sql/partitionkey.sch new file mode 100644 index 0000000000..e239d7913c --- /dev/null +++ b/schemas/sql/partitionkey.sch @@ -0,0 +1,20 @@ +# SQL definition for partition key elements +# PostgreSQL Version: 10.x +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +$br $tb +%if {column} %then + {column} +%else + %if {expression} %then + ({expression}) + %end +%end + +%if {collation} %then + [ COLLATE ] {collation} +%end + +%if {opclass} %then + $sp {opclass} +%end diff --git a/schemas/sql/table.sch b/schemas/sql/table.sch index 97c6673ffc..9d2ef2f46b 100644 --- a/schemas/sql/table.sch +++ b/schemas/sql/table.sch @@ -50,8 +50,17 @@ $br ) -%if ({pgsql-ver} >=f "10.0") %and {partitioned-table} %then $br [FOR VALUES ] ... %end -%if ({pgsql-ver} >=f "10.0") %and {partitioning} %then $br [PARTITION BY ] {partitioning} [ (] {partitionkey} $br [)] %end +%if ({pgsql-ver} >=f "10.0") %and {partitioned-table} %then + $br [FOR VALUES ] + + %if {partition-bound-expr} %then + {partition-bound-expr} + %else + $tb [/* Undefined bounding expression */] + %end +%end + +%if ({pgsql-ver} >=f "10.0") %and {partitioning} %then $br [PARTITION BY ] {partitioning} [ (] {partitionkey} [)] %end %if {ancestor-table} %then [ INHERITS(] {ancestor-table} [)] %end %if {oids} %then $br [WITH ( OIDS = TRUE )] %end %if {tablespace} %then diff --git a/schemas/xml/dtd/relationship.dtd b/schemas/xml/dtd/relationship.dtd index f30a07d9dd..6acf64b843 100644 --- a/schemas/xml/dtd/relationship.dtd +++ b/schemas/xml/dtd/relationship.dtd @@ -5,7 +5,7 @@ %label; - + diff --git a/schemas/xml/relationship.sch b/schemas/xml/relationship.sch index 0f89db78a7..1df477d8ff 100644 --- a/schemas/xml/relationship.sch +++ b/schemas/xml/relationship.sch @@ -98,7 +98,7 @@ $br $tb [ dst-table=] "{dst-table}" %if {points} %then $tb $br $tb {points} $tb $br %end %if {labels-pos} %then {labels-pos} %end - %if %not {relgen} %and %not {reldep} %then + %if %not {relgen} %and %not {reldep} %and %not {relpart} %then %if {columns} %then {columns} %end %if {constraints} %then {constraints} %end %end @@ -106,6 +106,10 @@ $br $tb [ dst-table=] "{dst-table}" %if {special-pk-cols} %then $tb [ $br %end + + %if {partition-bound-expr} %then + $tb $br + %end $br $br %end From 2f7cbbba6886429d659f0ea173438a03b0274fc1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 4 Oct 2018 15:30:24 -0300 Subject: [PATCH 139/425] Added a missing validation in Relationship to avoid creating other types of relatinships involving partitioned or partition tables. --- conf/defaults/sql-highlight.conf | 2 ++ conf/sql-highlight.conf | 2 ++ libpgmodeler/src/relationship.cpp | 18 ++++++++-- libpgmodeler/src/table.cpp | 2 +- libpgmodeler_ui/src/relationshipwidget.cpp | 8 ++--- libpgmodeler_ui/ui/objectstablewidget.ui | 38 +++++++++++----------- libutils/src/exception.cpp | 1 + libutils/src/exception.h | 3 +- schemas/sql/partitionkey.sch | 2 +- schemas/sql/table.sch | 6 +++- 10 files changed, 53 insertions(+), 29 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index 0ac55aafc1..fd3fca2d52 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -204,6 +204,7 @@ + @@ -243,6 +244,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index 0ac55aafc1..fd3fca2d52 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -204,6 +204,7 @@ + @@ -243,6 +244,7 @@ + diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index be7775b673..9963c3f35f 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -63,19 +63,33 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)), ERR_LINK_TABLES_NO_PK,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(rel_type==RELATIONSHIP_DEP && src_tab->getCopyTable()) + + // Raises an error if the user tries to create another copy relationship if the table already copies another table + if(rel_type==RELATIONSHIP_DEP && src_tab->getCopyTable()) throw Exception(Exception::getErrorMessage(ERR_COPY_REL_TAB_DEFINED) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getCopyTable()->getName(true)), ERR_COPY_REL_TAB_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(rel_type==RELATIONSHIP_PART && src_tab->getPartitionedTable()) + + // Raises an error if the user tries to create a partitioning relationship where one of the tables are already a partition table + if(rel_type==RELATIONSHIP_PART && src_tab->getPartitionedTable()) throw Exception(Exception::getErrorMessage(ERR_PART_REL_PATITIONED_DEFINED) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getPartitionedTable()->getName(true)), ERR_PART_REL_PATITIONED_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + // Raises an error if the user tries to create a relationship that is not partitioning using partition/partitioned tables + if(rel_type!=RELATIONSHIP_PART && (src_tab->isPartition() || src_tab->isPartitioned() || + dst_tab->isPartition() || dst_tab->isPartitioned())) + throw Exception(Exception::getErrorMessage(ERR_INV_REL_TYPE_FOR_PART_TABLES) + .arg(src_tab->getName(true)) + .arg(dst_tab->getName(true)) + .arg(src_tab->isPartitioned() || src_tab->isPartition() ? src_tab->getName(true) : dst_tab->getName(true)), + ERR_INV_REL_TYPE_FOR_PART_TABLES,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + copy_options=copy_op; table_relnn=nullptr; fk_rel1n=pk_relident=pk_special=uq_rel11=nullptr; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 24ad43ef36..577d3b587a 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -226,7 +226,7 @@ void Table::setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols) relatoinship, in case of XML definition. */ if((def_type==SchemaParser::SQL_DEFINITION && !columns[i]->isAddedByCopy() && !columns[i]->isAddedByGeneralization()) || (def_type==SchemaParser::SQL_DEFINITION && columns[i]->isAddedByCopy() && this->isPartition()) || - (def_type==SchemaParser::XML_DEFINITION && (!columns[i]->isAddedByRelationship() || (incl_rel_added_cols && columns[i]->isAddedByRelationship())))) + (def_type==SchemaParser::XML_DEFINITION && (!columns[i]->isAddedByRelationship() || (incl_rel_added_cols && columns[i]->isAddedByRelationship())))) { str_cols+=columns[i]->getCodeDefinition(def_type); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index f617e9be31..15418ea7fa 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -533,13 +533,13 @@ void RelationshipWidget::generateBoundingExpr(void) QString tmpl; if(part_type == PartitioningType::list) - tmpl = QString("IN ( value )"); + tmpl = QString("IN (value)"); else if(part_type == PartitioningType::range) - tmpl = QString("FROM ( value )\nTO ( value )"); + tmpl = QString("FROM (value)\nTO (value)"); else - tmpl = QString("WITH ( MODULUS m, REMAINDER r )"); + tmpl = QString("WITH (MODULUS m, REMAINDER r)"); - part_bound_expr_txt->clear(); + part_bound_expr_txt->setPlainText(QString()); part_bound_expr_txt->setPlainText(tmpl); } diff --git a/libpgmodeler_ui/ui/objectstablewidget.ui b/libpgmodeler_ui/ui/objectstablewidget.ui index a3c3f69990..1a99418c24 100644 --- a/libpgmodeler_ui/ui/objectstablewidget.ui +++ b/libpgmodeler_ui/ui/objectstablewidget.ui @@ -43,7 +43,7 @@ true - + 0 0 @@ -81,7 +81,7 @@ false - + 0 0 @@ -119,7 +119,7 @@ false - + 0 0 @@ -157,7 +157,7 @@ false - + 0 0 @@ -195,7 +195,7 @@ false - + 0 0 @@ -233,7 +233,7 @@ false - + 0 0 @@ -271,7 +271,7 @@ false - + 0 0 @@ -309,7 +309,7 @@ false - + 0 0 @@ -347,7 +347,7 @@ false - + 0 0 @@ -385,7 +385,7 @@ false - + 0 0 @@ -423,7 +423,7 @@ false - + 0 0 @@ -506,33 +506,33 @@ - - + + Qt::Horizontal - QSizePolicy::Preferred + QSizePolicy::Expanding - 97 + 92 22 - - + + Qt::Horizontal - QSizePolicy::Preferred + QSizePolicy::Expanding - 92 + 97 22 diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index fa860db204..557ee3a400 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -206,6 +206,7 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_REF_INV_LIKE_OP_TYPE", QT_TR_NOOP("Reference to an invalid copy table option!")}, {"ERR_COPY_REL_TAB_DEFINED", QT_TR_NOOP("The copy relationship between the tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table!")}, {"ERR_PART_REL_PATITIONED_DEFINED", QT_TR_NOOP("The paritioning relationship between the tables `%1' and `%2' cannot be done because the first one is already a partition of the table `%3'! Partition tables can be participating of only one partition hierarchy at a time!")}, + {"ERR_INV_REL_TYPE_FOR_PART_TABLES", QT_TR_NOOP("The relationship between the tables `%1' and `%2' cannot be done because the table `%3' is part of a partitioning hierachy either as a partitioned table or as a partition table! That table can't be used in other relationships except the partitioning one.")}, {"ERR_TABLE_TRIG_INSTEADOF_FIRING",QT_TR_NOOP("The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers!")}, {"ERR_TRIGGER_INV_TRUNCATE_USAGE",QT_TR_NOOP("The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table!")}, {"ERR_TRIGGER_INV_INSTEADOF_USAGE",QT_TR_NOOP("The INSTEAD OF mode cannot be used on view triggers that executes for each statement!")}, diff --git a/libutils/src/exception.h b/libutils/src/exception.h index edc6b4250b..0967dcca5f 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -234,6 +234,7 @@ enum ErrorType { ERR_REF_INV_LIKE_OP_TYPE, ERR_COPY_REL_TAB_DEFINED, ERR_PART_REL_PATITIONED_DEFINED, + ERR_INV_REL_TYPE_FOR_PART_TABLES, ERR_TABLE_TRIG_INSTEADOF_FIRING, ERR_TRIGGER_INV_TRUNCATE_USAGE, ERR_TRIGGER_INV_INSTEADOF_USAGE, @@ -291,7 +292,7 @@ enum ErrorType { class Exception { private: - static const int ERROR_COUNT=240; + static const int ERROR_COUNT=241; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ diff --git a/schemas/sql/partitionkey.sch b/schemas/sql/partitionkey.sch index e239d7913c..370ecd144c 100644 --- a/schemas/sql/partitionkey.sch +++ b/schemas/sql/partitionkey.sch @@ -2,7 +2,7 @@ # PostgreSQL Version: 10.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -$br $tb + %if {column} %then {column} %else diff --git a/schemas/sql/table.sch b/schemas/sql/table.sch index 9d2ef2f46b..a802505bc6 100644 --- a/schemas/sql/table.sch +++ b/schemas/sql/table.sch @@ -20,7 +20,9 @@ [ TABLE ] {name} -%if ({pgsql-ver} >=f "10.0") %and {partitioned-table} %then [ PARTITION OF ] {partitioned-table} %end +%if ({pgsql-ver} >=f "10.0") %and {partitioned-table} %then [ PARTITION OF ] {partitioned-table} $sp %end + +%if %not {partitioned-table} %or ({pgsql-ver} =f "10.0") %and {partitioned-table} %then $br [FOR VALUES ] From 49fadddc574a5b3d76012a205a27aa0eebd26a47 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 4 Oct 2018 18:05:54 -0300 Subject: [PATCH 140/425] Start to fix a bug that was causing special primary key configured on a relationship to make the original primary key of the table to disappear after disconnect the relationship. Now pgModeler stores in memory the original pk prior the connection of relationship and creation of the special pk. When disconnected, the original pk is restored on its parent table. --- libparsers/src/parsersattributes.cpp | 5 +- libparsers/src/parsersattributes.h | 1 + libpgmodeler/src/baserelationship.cpp | 1 + libpgmodeler/src/databasemodel.cpp | 20 ++++++-- libpgmodeler/src/relationship.cpp | 57 +++++++++++++++++++--- libpgmodeler/src/relationship.h | 6 ++- libpgmodeler_ui/src/relationshipwidget.cpp | 12 +++-- libutils/src/exception.cpp | 2 +- schemas/sql/table.sch | 4 ++ schemas/xml/relationship.sch | 6 ++- 10 files changed, 95 insertions(+), 19 deletions(-) diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 81301efcdd..a1784591f4 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -344,6 +344,7 @@ namespace ParsersAttributes { OPERATOR_FUNC=QString("operfunc"), OPERATOR=QString("operator"), OPERATORS=QString("operators"), + ORIGINAL_PK=QString("original-pk"), OUTPUT_FUNC=QString("output"), OWNER_COLUMN=QString("owner-col"), OWNER=QString("owner"), @@ -455,8 +456,8 @@ namespace ParsersAttributes { SELECT_OBJECTS=QString("select-objects"), SEND_FUNC=QString("send"), SEQUENCE=QString("sequence"), - SEQ_SCAN=QString("seq-scan"), - SEQ_SCAN_READ=QString("seq-scan-read"), + SEQ_SCAN=QString("seq-scan"), + SEQ_SCAN_READ=QString("seq-scan-read"), SERVER_ENCODING=QString("server-encoding"), SERVER_VERSION=QString("server-version"), SERVER_PID=QString("server-pid"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 06799e8b4e..126ccee54d 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -351,6 +351,7 @@ namespace ParsersAttributes { OPERATOR_FUNC, OPERATOR, OPERATORS, + ORIGINAL_PK, OUTPUT_FUNC, OWNER_COLUMN, OWNER, diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index c235c31ad8..8756bc4694 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -116,6 +116,7 @@ void BaseRelationship::configureRelationship(void) attributes[ParsersAttributes::CUSTOM_COLOR]=QString(); attributes[ParsersAttributes::REFERENCE_FK]=QString(); attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); + attributes[ParsersAttributes::ORIGINAL_PK]=QString(); //Check if the relationship type is valid if(rel_type <= RELATIONSHIP_FK) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 94dd3f33e1..69c215d052 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4987,7 +4987,6 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setIndexType(attribs[ParsersAttributes::INDEX_TYPE]); } - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) { do @@ -6192,7 +6191,7 @@ Textbox *DatabaseModel::createTextbox(void) BaseRelationship *DatabaseModel::createRelationship(void) { vector cols_special_pk; - attribs_map attribs; + attribs_map attribs, constr_attribs; map labels_id; BaseRelationship *base_rel=nullptr; Relationship *rel=nullptr; @@ -6206,6 +6205,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) tab_attribs[2]={ ParsersAttributes::SRC_TABLE, ParsersAttributes::DST_TABLE }; QColor custom_color=Qt::transparent; + Table *table = nullptr; try { @@ -6393,7 +6393,21 @@ BaseRelationship *DatabaseModel::createRelationship(void) else if(elem==ParsersAttributes::CONSTRAINT && rel) { xmlparser.savePosition(); - rel->addObject(createConstraint(rel)); + xmlparser.getElementAttributes(constr_attribs); + + /* If we find a primary key constraint at this point means that we're handling the original primary key stored by the relationship. + * Since relationships can't have primary keys created manually by the users we assume that + * the relationship contains a special primary key (created during relationship connection) + * and the current constraint is the original one owned by one of the tables prior the connection + * of the relationship. */ + if(constr_attribs[ParsersAttributes::TYPE] == ParsersAttributes::PK_CONSTR) + { + table = getTable(constr_attribs[ParsersAttributes::TABLE]); + rel->setOriginalPrimaryKey(createConstraint(table)); + } + else + rel->addObject(createConstraint(rel)); + xmlparser.restorePosition(); } else if(elem==ParsersAttributes::LINE) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 9963c3f35f..82a5d507c3 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -89,10 +89,9 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, .arg(src_tab->isPartitioned() || src_tab->isPartition() ? src_tab->getName(true) : dst_tab->getName(true)), ERR_INV_REL_TYPE_FOR_PART_TABLES,__PRETTY_FUNCTION__,__FILE__,__LINE__); - copy_options=copy_op; table_relnn=nullptr; - fk_rel1n=pk_relident=pk_special=uq_rel11=nullptr; + fk_rel1n=pk_relident=pk_special=uq_rel11=pk_original=nullptr; this->deferrable=deferrable; this->deferral_type=deferral_type; this->del_action=fk_del_act; @@ -231,6 +230,11 @@ QString Relationship::generateObjectName(unsigned pat_id, Column *id_col, bool u return(name); } +void Relationship::setOriginalPrimaryKey(Constraint *pk) +{ + pk_original = pk; +} + void Relationship::setMandatoryTable(unsigned table_id, bool value) { BaseRelationship::setMandatoryTable(table_id, value); @@ -282,6 +286,14 @@ void Relationship::createSpecialPrimaryKey(void) { unsigned i, count; vector gen_cols; + Table *table = getReceiverTable(); + + // First we need to remove the original primary key in order to use the special pk + if(table->getPrimaryKey()) + { + pk_original = table->getPrimaryKey(); + table->removeObject(pk_original); + } /* Allocates the primary key with the following feature: 1) Protected and included by linking in order to be easily identified @@ -299,6 +311,10 @@ void Relationship::createSpecialPrimaryKey(void) //For generalization relationships generates the primary key in form of ALTER command pk_special->setDeclaredInTable(this->getRelationshipType()!=RELATIONSHIP_GEN); + // Adding the collumns of the original primary key to the special one + for(i=0; pk_original && i < pk_original->getColumnCount(Constraint::SOURCE_COLS); i++) + pk_special->addColumn(pk_original->getColumn(i, Constraint::SOURCE_COLS), Constraint::SOURCE_COLS); + gen_cols=gen_columns; for(auto &attrib : rel_attributes) gen_cols.push_back(dynamic_cast(attrib)); @@ -457,7 +473,8 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) /* Raises an error if the user try to add manually a special primary key on the relationship and the relationship type is not generalization or copy */ if((rel_type==RELATIONSHIP_GEN || - rel_type==RELATIONSHIP_DEP) && + rel_type==RELATIONSHIP_DEP || + rel_type==RELATIONSHIP_PART) && !(tab_obj->isAddedByRelationship() && tab_obj->isProtected() && tab_obj->getObjectType()==OBJ_CONSTRAINT)) @@ -1101,7 +1118,7 @@ void Relationship::addColumnsRelGenPart(void) } } -void Relationship::addConstraintsRelGen(void) +void Relationship::addConstraintsRelGenPart(void) { Table *parent_tab=dynamic_cast
(getReferenceTable()), *child_tab=dynamic_cast
(getReceiverTable()); @@ -1151,7 +1168,7 @@ void Relationship::connectRelationship(void) if(rel_type==RELATIONSHIP_GEN) { //Copying the CHECK constraints before adding custom constraints like special pk - addConstraintsRelGen(); + addConstraintsRelGenPart(); //Creates the columns on the receiver table following the rules for generalization rules addColumnsRelGenPart(); @@ -1170,6 +1187,9 @@ void Relationship::connectRelationship(void) } else if(rel_type == RELATIONSHIP_PART) { + //Copying the CHECK constraints before adding custom constraints like special pk + addConstraintsRelGenPart(); + //Creates the columns on the receiver table following the rules for copy rules addColumnsRelGenPart(); getReceiverTable()->setPartionedTable(dynamic_cast
(getReferenceTable())); @@ -2062,12 +2082,16 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) //Removes the special primary key if(table->getObjectIndex(pk_special) >= 0) + { table->removeObject(pk_special); - if(rel_type==RELATIONSHIP_GEN) - { - table->removeObject(getReferenceTable()); + // Restoring the original primary key of the table + if(pk_original) + table->addObject(pk_original); + } + if(rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_PART) + { while(!ck_constraints.empty()) { table->removeObject(ck_constraints.back()); @@ -2075,6 +2099,9 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) ck_constraints.pop_back(); } } + + if(rel_type==RELATIONSHIP_GEN) + table->removeObject(getReferenceTable()); else if(rel_type == RELATIONSHIP_PART) table->setPartionedTable(nullptr); else @@ -2142,7 +2169,13 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) pk_relident=nullptr; } else if(pk_special && table->getObjectIndex(pk_special) >= 0) + { table->removeObject(pk_special); + + // Restoring the original primary key of the table + if(pk_original) + table->addObject(pk_original); + } } else if(rel_type==RELATIONSHIP_NN) { @@ -2220,6 +2253,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) table_relnn=nullptr; } + pk_original = nullptr; BaseRelationship::disconnectRelationship(); } } @@ -2590,6 +2624,13 @@ QString Relationship::getCodeDefinition(unsigned def_type) getCodeDefinition(SchemaParser::XML_DEFINITION, true); } + if(pk_original) + { + pk_original->setParentTable(getReceiverTable()); + attributes[ParsersAttributes::ORIGINAL_PK]=pk_original->getCodeDefinition(SchemaParser::XML_DEFINITION); + pk_original->setParentTable(nullptr); + } + count=column_ids_pk_rel.size(); for(i=0; i < count; i++) { diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index 815a1dcaf0..c624e86738 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -172,6 +172,8 @@ class Relationship: public BaseRelationship { to generalization / copy relationships */ *pk_special, + *pk_original, + //! \brief Stores the unique key that represents the 1-1 relationship (including the fk_rel1n) *uq_rel11; @@ -229,7 +231,7 @@ class Relationship: public BaseRelationship { /*! \brief Copy constraints from the parent table to the child. Currently, only check constraints are copied only if the NO INHERIT attribute is not set and there are no conflicting constraints (name or expression) on the child table */ - void addConstraintsRelGen(void); + void addConstraintsRelGenPart(void); /*! \brief Creates the foreign key that represents the relationship and adds it to the receiver table. Must be specified the actions ON DELETE and UPDATE. */ @@ -273,6 +275,8 @@ class Relationship: public BaseRelationship { //! \brief Generates the object name according to the specified name pattern QString generateObjectName(unsigned pat_id, Column *id_col=nullptr, bool use_alias=false); + void setOriginalPrimaryKey(Constraint *pk); + protected: //! \brief Destroy all the relationship attributes and constraints void destroyObjects(void); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 15418ea7fa..6674d68dac 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -311,7 +311,8 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l recv_table_txt->setPlainText(base_rel->getTable(BaseRelationship::DST_TABLE)->getName(true)); } - part_type_lbl->setText(~aux_rel->getReferenceTable()->getPartitioningType()); + if(rel_type == BaseRelationship::RELATIONSHIP_PART) + part_type_lbl->setText(~aux_rel->getReferenceTable()->getPartitioningType()); } disable_sql_chk->setVisible(base_rel->getObjectType()==OBJ_RELATIONSHIP); @@ -353,8 +354,13 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l identity_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::IDENTITY)); statistics_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::STATISTICS)); } - else if(rel_type == BaseRelationship::RELATIONSHIP_PART && this->new_object) - generateBoundingExpr(); + else if(rel_type == BaseRelationship::RELATIONSHIP_PART) + { + if(this->new_object) + generateBoundingExpr(); + else + part_bound_expr_txt->setPlainText(aux_rel->getPartitionBoundingExpr()); + } } } diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 557ee3a400..5ef884a4c8 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -119,7 +119,7 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_DUPLIC_COLS_COPY_REL", QT_TR_NOOP("Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'!")}, {"ERR_INCOMP_COLS_INHERIT_REL", QT_TR_NOOP("Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types!")}, {"ERR_INCOMP_CONSTRS_INHERIT_REL", QT_TR_NOOP("Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition!")}, - {"ERR_ASG_OBJ_INV_REL_TYPE", QT_TR_NOOP("An attribute can not be added to a copy or generalization relationship!")}, + {"ERR_ASG_OBJ_INV_REL_TYPE", QT_TR_NOOP("An attribute can not be added to a copy, generalization or partitioning relationship!")}, {"ERR_ASG_FOREIGN_KEY_REL", QT_TR_NOOP("A foreign key can not be added to a relationship because is created automatically when this is connected!")}, {"ERR_REF_OBJ_INEXISTS_MODEL", QT_TR_NOOP("The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model!")}, {"ERR_REF_INEXIST_USER_TYPE", QT_TR_NOOP("Reference to an user-defined data type that not exists in the model!")}, diff --git a/schemas/sql/table.sch b/schemas/sql/table.sch index a802505bc6..a4588436d9 100644 --- a/schemas/sql/table.sch +++ b/schemas/sql/table.sch @@ -52,6 +52,10 @@ $br ) +%else + %if {partitioned-table} %and {constraints} %then + [ (] $br {constraints} [)] $br + %end %end %if ({pgsql-ver} >=f "10.0") %and {partitioned-table} %then diff --git a/schemas/xml/relationship.sch b/schemas/xml/relationship.sch index 1df477d8ff..8e07bb7fc6 100644 --- a/schemas/xml/relationship.sch +++ b/schemas/xml/relationship.sch @@ -102,6 +102,10 @@ $br $tb [ dst-table=] "{dst-table}" %if {columns} %then {columns} %end %if {constraints} %then {constraints} %end %end + + %if {original-pk} %then + {original-pk} + %end %if {special-pk-cols} %then $tb [ $br @@ -109,7 +113,7 @@ $br $tb [ dst-table=] "{dst-table}" %if {partition-bound-expr} %then $tb $br - %end + %end $br $br %end From 66ca01d793c13d5d627dc8208f6b44c8ec54a75d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 4 Oct 2018 19:50:35 -0300 Subject: [PATCH 141/425] Forcing the partitioning relationship to be invalidated when the reference table (partitioned) partitioning type is set to null (no partitioning) --- libpgmodeler/src/relationship.cpp | 9 +++++++++ libpgmodeler_ui/src/tablewidget.cpp | 3 +++ 2 files changed, 12 insertions(+) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 82a5d507c3..79c943c4d2 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -72,6 +72,13 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, .arg(src_tab->getCopyTable()->getName(true)), ERR_COPY_REL_TAB_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + /* If the relationship is partitioning the destination table (partitioned) shoud have + * a partitioning type defined otherwise and error is raised */ + if(rel_type == RELATIONSHIP_PART && !dst_tab->isPartitioned()) + throw Exception(Exception::getErrorMessage(ERR_INV_PARTITIONIG_TYPE_PART_REL) + .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), + ERR_INV_PARTITIONIG_TYPE_PART_REL, __PRETTY_FUNCTION__,__FILE__,__LINE__); + // Raises an error if the user tries to create a partitioning relationship where one of the tables are already a partition table if(rel_type==RELATIONSHIP_PART && src_tab->getPartitionedTable()) throw Exception(Exception::getErrorMessage(ERR_PART_REL_PATITIONED_DEFINED) @@ -2426,6 +2433,7 @@ bool Relationship::isInvalidated(void) if(rel_type==RELATIONSHIP_PART) { count = table1->getColumnCount(); + valid = table->isPartitioned(); for(i=0; i < count && valid; i++) { @@ -2454,6 +2462,7 @@ bool Relationship::isInvalidated(void) constr=table->getConstraint(ck_constraints[i]->getName(true)); valid=(constr && !constr->isNoInherit() && constr->getConstraintType()==ConstraintType::check); } + } /* For n-n relationships, it is necessary the comparisons: diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 9213a74000..80e0627287 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -811,6 +811,9 @@ void TableWidget::applyConfiguration(void) { partition_keys_tab->getElements(part_keys); table->addPartitionKeys(part_keys); + + if(part_keys.empty()) + part_type = BaseType::null; } else table->removePartitionKeys(); From 071d36a7b4a661fd1bd74a89cd84286bcd1e624c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 4 Oct 2018 22:44:43 -0300 Subject: [PATCH 142/425] Fine tuning the validation of the entities used in the partitioning relationship creation. --- libpgmodeler/src/relationship.cpp | 18 +++++++++++++++--- libutils/src/exception.cpp | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 79c943c4d2..edcacdea53 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -87,9 +87,21 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, .arg(src_tab->getPartitionedTable()->getName(true)), ERR_PART_REL_PATITIONED_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); - // Raises an error if the user tries to create a relationship that is not partitioning using partition/partitioned tables - if(rel_type!=RELATIONSHIP_PART && (src_tab->isPartition() || src_tab->isPartitioned() || - dst_tab->isPartition() || dst_tab->isPartitioned())) + /* Raises an error if the user tries to create a relationship in the following configuration: + * 1) Many-to-many relationship where one of the tables is a partitioned one + * it will be created a fk in the intermediate table which references the partitioned table which + * is not allowed by partitioning rules. + * + * 2) One-to-many relationship which the reference table is partitioned and the received is a ordinary table, because + * a fk will be created on the ordinary table (receiver) which will be referencing the partitioned table, situation + * that is not allowed as too. + * + * 3) Generalization, copy relationship or one-to-many in which one of the tables is part of a partitioning hierarchy. + */ + if((rel_type == RELATIONSHIP_NN && (src_tab->isPartitioned() || dst_tab->isPartitioned())) || + (rel_type == RELATIONSHIP_1N && getReferenceTable()->isPartitioned() && !getReceiverTable()->isPartitioned()) || + ((rel_type == RELATIONSHIP_GEN || rel_type == RELATIONSHIP_DEP || rel_type == RELATIONSHIP_11) && + (src_tab->isPartition() || src_tab->isPartitioned() || dst_tab->isPartition() || dst_tab->isPartitioned()))) throw Exception(Exception::getErrorMessage(ERR_INV_REL_TYPE_FOR_PART_TABLES) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 5ef884a4c8..06fd18bb34 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -206,7 +206,7 @@ QString Exception::messages[ERROR_COUNT][2]={ {"ERR_REF_INV_LIKE_OP_TYPE", QT_TR_NOOP("Reference to an invalid copy table option!")}, {"ERR_COPY_REL_TAB_DEFINED", QT_TR_NOOP("The copy relationship between the tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table!")}, {"ERR_PART_REL_PATITIONED_DEFINED", QT_TR_NOOP("The paritioning relationship between the tables `%1' and `%2' cannot be done because the first one is already a partition of the table `%3'! Partition tables can be participating of only one partition hierarchy at a time!")}, - {"ERR_INV_REL_TYPE_FOR_PART_TABLES", QT_TR_NOOP("The relationship between the tables `%1' and `%2' cannot be done because the table `%3' is part of a partitioning hierachy either as a partitioned table or as a partition table! That table can't be used in other relationships except the partitioning one.")}, + {"ERR_INV_REL_TYPE_FOR_PART_TABLES", QT_TR_NOOP("The relationship between the tables `%1' and `%2' can't be created because the first entity is part of a partitioning hierachy! The table `%3' can't be used in `generalization', `copy' and `one-to-one' relationships. In `one-to-many' and `many-to-many' relationships the mentioned table can't be referenced by the generated foreign key(s).")}, {"ERR_TABLE_TRIG_INSTEADOF_FIRING",QT_TR_NOOP("The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers!")}, {"ERR_TRIGGER_INV_TRUNCATE_USAGE",QT_TR_NOOP("The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table!")}, {"ERR_TRIGGER_INV_INSTEADOF_USAGE",QT_TR_NOOP("The INSTEAD OF mode cannot be used on view triggers that executes for each statement!")}, From 534c7bb85ef8bd822a0469fafe2082861e790066 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 8 Oct 2018 16:00:43 -0300 Subject: [PATCH 143/425] Fixed the tooltip of some graphical objects (adding comments and aliases issue #1187) Fixed the catalog query for tables to select partitioned tables too. Fixed the catalog query for types to avoid selecting partitioned tables as being data types. --- libobjrenderer/src/basetableview.cpp | 4 +-- libobjrenderer/src/graphicalview.cpp | 7 +++++ libobjrenderer/src/relationshipview.cpp | 21 ++++++++++++++- libobjrenderer/src/schemaview.cpp | 4 ++- libobjrenderer/src/tableobjectview.cpp | 4 +++ libobjrenderer/src/tableview.cpp | 14 ++++++++++ libobjrenderer/src/textboxview.cpp | 27 +++++-------------- libobjrenderer/src/textboxview.h | 4 +++ .../src/databaseexplorerwidget.cpp | 3 ++- libpgmodeler_ui/ui/mainwindow.ui | 1 + schemas/catalog/table.sch | 6 ++--- schemas/catalog/usertype.sch | 4 +-- 12 files changed, 67 insertions(+), 32 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 362d3f76f2..a5a2f8056e 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -441,9 +441,7 @@ void BaseTableView::__configureObject(float width) this->table_tooltip=this->getSourceObject()->getName(true) + QString(" (") + this->getSourceObject()->getTypeName() + QString(") \n") + QString("Id: %1\n").arg(this->getSourceObject()->getObjectId()) + - TableObjectView::CONSTR_DELIM_START + - trUtf8("Connected rels: %1").arg(this->getConnectRelsCount()) + - TableObjectView::CONSTR_DELIM_END; + trUtf8("Connected rels: %1").arg(this->getConnectRelsCount()); this->setToolTip(this->table_tooltip); } diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 8967980536..83bb53022b 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -221,6 +221,13 @@ void GraphicalView::configureObject(void) this->bounding_rect.setWidth(title->boundingRect().width()); BaseTableView::__configureObject(width); + + if(!view->getAlias().isEmpty()) + table_tooltip += QString("\nAlias: %1").arg(view->getAlias()); + + if(!view->getComment().isEmpty()) + table_tooltip += QString("\n---\n%1").arg(view->getComment()); + BaseObjectView::__configureObject(); BaseObjectView::configureObjectShadow(); BaseObjectView::configureObjectSelection(); diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index e843086fb6..afd74427fe 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1231,7 +1231,14 @@ void RelationshipView::configureLine(void) tool_tip=base_rel->getName(true) + QString(" (") + base_rel->getTypeName() + QString(")"); - tool_tip += QString("\nId: %1").arg(base_rel->getObjectId()); + tool_tip += QString("\nId: %1\n").arg(base_rel->getObjectId()) + + TableObjectView::CONSTR_DELIM_START + + QString(" %1 ").arg(base_rel->getRelationshipTypeName()) + + TableObjectView::CONSTR_DELIM_END; + + if(!base_rel->getAlias().isEmpty()) + tool_tip += QString("\nAlias: %1").arg(base_rel->getAlias()); + this->setToolTip(tool_tip); for(i=0; i < 3; i++) @@ -1241,6 +1248,18 @@ void RelationshipView::configureLine(void) } descriptor->setToolTip(tool_tip); + + for(auto &curve : curves) + curve->setToolTip(tool_tip); + + for(int i = 0; i < 2; i++) + { + if(cf_descriptors[i]) + cf_descriptors[i]->setToolTip(tool_tip); + + if(round_cf_descriptors[i]) + round_cf_descriptors[i]->setToolTip(tool_tip); + } } } diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index 5f848d39f2..72dd6c3597 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -242,7 +242,9 @@ void SchemaView::configureObject(void) this->bounding_rect=rect; this->setVisible(true); - this->setToolTip(schema->getName(true) + QString(" (") + schema->getTypeName() + QString(")")); + this->setToolTip(schema->getName(true) + + QString(" (") + schema->getTypeName() + QString(")") + + QString("\nId: %1").arg(schema->getObjectId())); sch_name->setToolTip(this->toolTip()); this->protected_icon->setPos(QPointF( sch_name->boundingRect().width() + sp_h, diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 6707201ed2..1cb2c5b1d3 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -410,8 +410,12 @@ void TableObjectView::configureObject(void) atribs_tip=QString("\n") + CONSTR_DELIM_START + QString(" ") + atribs_tip + QString(" ") + CONSTR_DELIM_END; + } + if(!tab_obj->getComment().isEmpty()) + atribs_tip += QString("\n---\n%1").arg(tab_obj->getComment()); + lables[2]->setFont(fmt.font()); lables[2]->setBrush(fmt.foreground()); lables[2]->setPos(px, 0); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 90e9eef810..79ea070b3f 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -42,6 +42,7 @@ void TableView::configureObject(void) //Configures the table title title->configureObject(table); + px=0; old_width=this->bounding_rect.width(); @@ -201,6 +202,19 @@ void TableView::configureObject(void) } BaseTableView::__configureObject(width); + + if(table->isPartitioned()) + table_tooltip += QString("\n%1 (%2)").arg(trUtf8("Partitioned")).arg(~table->getPartitioningType()); + + if(table->isPartition()) + table_tooltip += QString("\n%1 of %2").arg(trUtf8("Partition")).arg(table->getPartitionedTable()->getSignature(true)); + + if(!table->getAlias().isEmpty()) + table_tooltip += QString("\nAlias: %1").arg(table->getAlias()); + + if(!table->getComment().isEmpty()) + table_tooltip += QString("\n---\n%1").arg(table->getComment()); + BaseObjectView::__configureObject(); BaseObjectView::configureObjectShadow(); BaseObjectView::configureObjectSelection(); diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 4b707fa9f7..3883d62073 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -70,27 +70,10 @@ void TextboxView::setFontStyle(const QTextCharFormat &fmt) } } -/*void TextboxView::togglePlaceholder(bool visible) +void TextboxView::setToolTip(const QString &tooltip) { - if(use_placeholder && this->scene()) - { - if(!placeholder_pol->scene()) - this->scene()->addItem(placeholder_pol); - - if(visible) - { - QPen pen=BaseObjectView::getBorderStyle(ParsersAttributes::PLACEHOLDER); - pen.setStyle(Qt::DashLine); - - placeholder_pol->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::PLACEHOLDER)); - placeholder_pol->setPen(pen); - placeholder_pol->setPolygon(box->polygon()); - placeholder_pol->setPos(this->mapToScene(this->bounding_rect.topLeft())); - } - - placeholder_pol->setVisible(visible); - } -}*/ + txtbox_tooltip = tooltip; +} void TextboxView::__configureObject(void) { @@ -137,8 +120,10 @@ void TextboxView::__configureObject(void) this->bounding_rect.setTopLeft(box->boundingRect().topLeft()); this->bounding_rect.setBottomRight(box->boundingRect().bottomRight()); - BaseObjectView::__configureObject(); + + if(!txtbox_tooltip.isEmpty()) + this->BaseObjectView::setToolTip(txtbox_tooltip); } void TextboxView::configureObject(void) diff --git a/libobjrenderer/src/textboxview.h b/libobjrenderer/src/textboxview.h index 2cfa29d7c5..473ddd3e4d 100644 --- a/libobjrenderer/src/textboxview.h +++ b/libobjrenderer/src/textboxview.h @@ -36,6 +36,8 @@ class TextboxView: public BaseObjectView { //! \brief Indicates the the font / color styles will be overriden (need to call setColorStyle, setFontStyle) bool override_style; + QString txtbox_tooltip; + protected: //! \brief Graphical item that represent the box QGraphicsPolygonItem *box; @@ -64,6 +66,8 @@ class TextboxView: public BaseObjectView { the style can be overriden (via constructor) */ void setFontStyle(const QTextCharFormat &fmt); + void setToolTip(const QString &tooltip); + protected slots: virtual void configureObject(void); }; diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 88052d63a9..b939991154 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1932,7 +1932,8 @@ void DatabaseExplorerWidget::dropDatabase(void) QString dbname = connection.getConnectionParam(Connection::PARAM_DB_NAME); msg_box.show(trUtf8("Warning"), - trUtf8("CAUTION: You are about to drop the entire database %1! All data will be completely wiped out. Do you really want to proceed?").arg(dbname), + trUtf8("CAUTION: You are about to drop the entire database %1 from the server %2! All data will be completely wiped out. Do you really want to proceed?") + .arg(dbname).arg(connection.getConnectionId(true)), Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); if(msg_box.result()==QDialog::Accepted) diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index 39aaaaaccd..c60ebcbcc5 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -756,6 +756,7 @@ + diff --git a/schemas/catalog/table.sch b/schemas/catalog/table.sch index 75f829ab6a..c06c14af9c 100644 --- a/schemas/catalog/table.sch +++ b/schemas/catalog/table.sch @@ -7,9 +7,9 @@ %if {schema} %then [ LEFT JOIN pg_namespace AS ns ON ns.oid=tb.relnamespace - WHERE tb.relkind='r' AND ns.nspname= ] '{schema}' + WHERE tb.relkind IN ('r','p') AND ns.nspname= ] '{schema}' %else - [ WHERE tb.relkind='r'] + [ WHERE tb.relkind IN ('r','p')] %end %if {last-sys-oid} %then @@ -54,7 +54,7 @@ [ FROM pg_class AS tb LEFT JOIN pg_tables AS _tb1 ON _tb1.tablename=tb.relname LEFT JOIN pg_stat_all_tables AS st ON st.relid=tb.oid - WHERE tb.relkind='r' ] + WHERE tb.relkind IN ('r','p') ] %if {last-sys-oid} %then [ AND tb.oid ] {oid-filter-op} $sp {last-sys-oid} diff --git a/schemas/catalog/usertype.sch b/schemas/catalog/usertype.sch index f0c8175641..056b72aa3e 100644 --- a/schemas/catalog/usertype.sch +++ b/schemas/catalog/usertype.sch @@ -16,7 +16,7 @@ #Excluding types related to tables/views/sequeces/materialized views %if {filter-tab-types} %then - [ AND (SELECT count(oid) FROM pg_class WHERE relname=typname AND relkind IN ('r','S','v','m'))=0 ] + [ AND (SELECT count(oid) FROM pg_class WHERE relname=typname AND relkind IN ('r','S','v','m','p'))=0 ] %end %if {exc-builtin-arrays} %then @@ -134,7 +134,7 @@ #Excluding types related to tables/views/sequeces/materialized views %if {filter-tab-types} %then - [ AND (SELECT count(oid) FROM pg_class WHERE relname=typname AND relkind IN ('r','S','v','m'))=0 ] + [ AND (SELECT count(oid) FROM pg_class WHERE relname=typname AND relkind IN ('r','S','v','m','p'))=0 ] %end %if {exc-builtin-arrays} %then From bfb24a145c21e35d686c0fc7d5582e55fde2e90d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 10 Oct 2018 15:27:03 -0300 Subject: [PATCH 144/425] Fixed a bug in SchemaParser that was causing only the first %set line (in a if block) to be parsed no matter that there were other %set below the same block. --- libparsers/src/schemaparser.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 3bb7248e9e..3c158ccd8d 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -1182,14 +1182,17 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) if(!extract && if_level >= 0) { //If in 'else' the related 'if' is false, extracts the attribute - if(prev_cond==TOKEN_ELSE && !vet_expif[if_level]) + if(prev_cond == TOKEN_ELSE && !vet_expif[if_level]) extract=true; - else if(prev_cond!=TOKEN_ELSE) + else if(prev_cond != TOKEN_ELSE) { //If in the 'if' part all the previous ifs until the current must be true extract=true; for(int i=0; i <= if_level && extract; i++) - extract=vet_expif[i]; + { + extract=(vet_expif[i] && !vet_tk_else[i]) || + (!vet_expif[i] && vet_tk_else[i]); + } } } From 714d8873c9565a1e666a475bc5469fb21381dfae Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 10 Oct 2018 15:27:32 -0300 Subject: [PATCH 145/425] Removed the cached catalog query test feature fom Catalog --- libpgconnector/src/catalog.cpp | 52 ++++++++++++++++++++++++---------- libpgconnector/src/catalog.h | 11 ++++--- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 28b95fc865..66a7cc98e8 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -27,7 +27,6 @@ const QString Catalog::ARRAY_PATTERN=QString("((\\[)[0-9]+(\\:)[0-9]+(\\])=)?(\\ const QString Catalog::GET_EXT_OBJS_SQL=QString("SELECT objid AS oid FROM pg_depend WHERE objid > 0 AND refobjid > 0 AND deptype='e'"); const QString Catalog::PGMODELER_TEMP_DB_OBJ=QString("__pgmodeler_tmp"); -bool Catalog::use_cached_queries=false; attribs_map Catalog::catalog_queries; map Catalog::oid_fields= @@ -157,13 +156,12 @@ bool Catalog::isExtensionObject(unsigned oid) void Catalog::loadCatalogQuery(const QString &qry_id) { - if((!use_cached_queries) || - (use_cached_queries && catalog_queries.count(qry_id)==0)) + if(catalog_queries.count(qry_id)==0) { QFile input; input.setFileName(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - CATALOG_SCH_DIR + GlobalAttributes::DIR_SEPARATOR + - qry_id + GlobalAttributes::SCHEMA_EXT); + CATALOG_SCH_DIR + GlobalAttributes::DIR_SEPARATOR + + qry_id + GlobalAttributes::SCHEMA_EXT); if(!input.open(QFile::ReadOnly)) throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(input.fileName()), @@ -476,6 +474,40 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ } } +vector Catalog::getMultipleAttributes(const QString &catalog_sch, attribs_map attribs) +{ + try + { + ResultSet res; + attribs_map tuple; + vector obj_attribs; + + loadCatalogQuery(catalog_sch); + schparser.ignoreUnkownAttributes(true); + schparser.ignoreEmptyAttributes(true); + + attribs[ParsersAttributes::PGSQL_VERSION]=schparser.getPgSQLVersion(); + connection.executeDMLCommand(schparser.getCodeDefinition(attribs).simplified(), res); + + if(res.accessTuple(ResultSet::FIRST_TUPLE)) + { + do + { + tuple=changeAttributeNames(res.getTupleValues()); + obj_attribs.push_back(tuple); + tuple.clear(); + } + while(res.accessTuple(ResultSet::NEXT_TUPLE)); + } + + return(obj_attribs); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + QString Catalog::getCommentQuery(const QString &oid_field, bool is_shared_obj) { QString query_id=ParsersAttributes::COMMENT; @@ -752,16 +784,6 @@ QStringList Catalog::parseRuleCommands(const QString &cmds) return(cmds.mid(start,(end - start) + 1).split(';', QString::SkipEmptyParts)); } -void Catalog::enableCachedQueries(bool value) -{ - use_cached_queries=value; -} - -bool Catalog::isCachedQueriesEnabled(void) -{ - return(use_cached_queries); -} - void Catalog::operator = (const Catalog &catalog) { try diff --git a/libpgconnector/src/catalog.h b/libpgconnector/src/catalog.h index 4b45018906..576f2adccc 100644 --- a/libpgconnector/src/catalog.h +++ b/libpgconnector/src/catalog.h @@ -65,10 +65,7 @@ class Catalog { there are different fields that tells if the object (or its parent) is part of extension. */ static map ext_oid_fields; - //! \brief Indicates is the use of cached catalog queries is enabled - static bool use_cached_queries; - - //! \brief Store the cached catalog queries (only when use_cached_queries=true) + //! \brief Store the cached catalog queries static attribs_map catalog_queries; //! \brief Connection used to query the pg_catalog @@ -188,6 +185,12 @@ class Catalog { //! \brief Returns a set of multiple attributes (several tuples) for the specified object type vector getMultipleAttributes(ObjectType obj_type, attribs_map extra_attribs=attribs_map()); + /*! \brief Returns a set of multiple attributes (several tuples) for the specified catalog schema file. + * This version of the method differs from the one in which the user need to provide the object type. + * This one, the user is responsible to provide all attributes that will be parsed together with the + * catalog file. */ + vector getMultipleAttributes(const QString &catalog_sch, attribs_map attribs=attribs_map()); + /*! \brief Retrieve all available objects attributes for the specified type. Internally this method calls the get method for the specified type. User can filter items by oids (except for table child objects), by schema (in the object type is suitable to accept schema) and by table name (only when retriving child objects for a specific table) */ From f35dc5b3b432962ebe6d79d3f7014e6e27b94096 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 10 Oct 2018 15:28:38 -0300 Subject: [PATCH 146/425] Starting to add support to partitioned/partition tables importing on DatabaseImportHelper --- libpgmodeler/src/table.cpp | 5 + libpgmodeler/src/table.h | 2 + libpgmodeler_ui/src/databaseimporthelper.cpp | 143 ++++++++++++++++++ libpgmodeler_ui/src/databaseimporthelper.h | 8 +- schemas/catalog/aggregate.sch | 31 ++-- schemas/catalog/function.sch | 24 ++- schemas/catalog/partitionkey.sch | 19 +++ schemas/catalog/table.sch | 30 +++- .../src/schemaparsertest/schemaparsertest.cpp | 28 ++++ 9 files changed, 268 insertions(+), 22 deletions(-) create mode 100644 schemas/catalog/partitionkey.sch diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 577d3b587a..edcc6552ac 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -557,6 +557,11 @@ void Table::setPartitionBoundingExpr(const QString part_bound_expr) part_bounding_expr = part_bound_expr; } +QString Table::getPartitionBoundingExpr(void) +{ + return(part_bounding_expr); +} + void Table::addConstraint(Constraint *constr, int idx) { try diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 102d5eb2ed..e2d2d1743e 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -200,6 +200,8 @@ class Table: public BaseTable { //! \brief Defines the partition bounding expression void setPartitionBoundingExpr(const QString part_bound_expr); + QString getPartitionBoundingExpr(void); + //! \brief Configures the copy table void setCopyTable(Table *tab); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 1b2081944e..fdbc554516 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -554,6 +554,7 @@ void DatabaseImportHelper::importDatabase(void) retrieveUserObjects(); createObjects(); createTableInheritances(); + createTablePartitionings(); createConstraints(); destroyDetachedColumns(); createPermissions(); @@ -901,6 +902,7 @@ void DatabaseImportHelper::resetImportParameters(void) connection.close(); catalog.closeConnection(); inherited_cols.clear(); + imported_tables.clear(); } QString DatabaseImportHelper::dumpObjectAttributes(attribs_map &attribs) @@ -1760,7 +1762,31 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) for(unsigned col_idx : inh_cols) inherited_cols.push_back(table->getColumn(col_idx)); + // Storing the partition bound expression temporarily in the table in order to configure the partition hierarchy later + table->setPartitionBoundingExpr(attribs[ParsersAttributes::PARTITION_BOUND_EXPR].remove(QRegExp("^(FOR)( )+(VALUES)( )*", Qt::CaseInsensitive))); + + // Retrieving the partitioned table related to the partition table being created + if(!attribs[ParsersAttributes::PARTITIONED_TABLE].isEmpty()) + { + Table *partitioned_tab = nullptr; + + attribs[ParsersAttributes::PARTITIONED_TABLE] = + getDependencyObject(attribs[ParsersAttributes::PARTITIONED_TABLE], OBJ_TABLE, true, auto_resolve_deps, false); + + partitioned_tab = dbmodel->getTable(attribs[ParsersAttributes::PARTITIONED_TABLE]); + table->setPartionedTable(partitioned_tab); + + if(!partitioned_tab) + { + throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(OBJ_TABLE)) + .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(OBJ_TABLE)), + ERR_REF_OBJ_INEXISTS_MODEL ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + } + dbmodel->addTable(table); + imported_tables[tab_oid] = table; } catch(Exception &e) { @@ -2263,6 +2289,123 @@ void DatabaseImportHelper::createTableInheritances(void) } } +void DatabaseImportHelper::createTablePartitionings(void) +{ + if(imported_tables.empty()) + return; + + try + { + QStringList oids, cols, collations, opclasses, exprs; + attribs_map attribs; + vector attribs_vect; + vector part_keys; + PartitionKey part_key; + PartitioningType part_type; + Table *table = nullptr, *part_table = nullptr; + unsigned tab_oid = 0; + QString coll_name, opc_name, part_bound_expr; + Collation *coll = nullptr; + OperatorClass *opclass = nullptr; + Relationship *rel_part = nullptr; + + emit s_progressUpdated(95, + trUtf8("Creating table partitionings..."), + OBJ_RELATIONSHIP); + + // Retriveing the partition keys for each table + for(auto &itr : imported_tables) + oids.push_back(QString::number(itr.first)); + + attribs[ParsersAttributes::FILTER_OIDS] = oids.join(','); + attribs_vect = catalog.getMultipleAttributes(ParsersAttributes::PARTITION_KEY, attribs); + + // With the parition key attributes retrived we need to assing them properly to the tables + for(auto &pk_attr : attribs_vect) + { + tab_oid = pk_attr[ParsersAttributes::TABLE].toUInt(); + + if(imported_tables.count(tab_oid)) + { + table = imported_tables[tab_oid]; + part_type = PartitioningType(pk_attr[ParsersAttributes::PARTITIONING]); + table->setPartitioningType(part_type); + + cols=Catalog::parseArrayValues(pk_attr[ParsersAttributes::COLUMNS]); + collations=Catalog::parseArrayValues(pk_attr[ParsersAttributes::COLLATIONS]); + opclasses=Catalog::parseArrayValues(pk_attr[ParsersAttributes::OP_CLASSES]); + exprs = parseIndexExpressions(pk_attr[ParsersAttributes::EXPRESSIONS]); + + for(int i = 0; i < cols.size(); i++) + { + part_key = PartitionKey(); + + // Retrieving the column used by the partition key + if(cols[i] != QString("0")) + part_key.setColumn(table->getColumn(getColumnName(pk_attr[ParsersAttributes::TABLE], cols[i]))); + else if(!exprs.isEmpty()) + { + part_key.setExpression(exprs.front()); + exprs.pop_front(); + } + + // Retriving the collation for the partion key + if(i < collations.size() && collations[i] != QString("0")) + { + coll_name = getDependencyObject(collations[i], OBJ_COLLATION, false, true, false); + coll = dynamic_cast(dbmodel->getObject(coll_name, OBJ_COLLATION)); + + //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" + if(coll && (!coll->isSystemObject() || + (coll->isSystemObject() && coll->getName() != QString("default")))) + part_key.setCollation(coll); + } + + // Retriving the operator class for the partion key + if(i < opclasses.size() && opclasses[i] != QString("0")) + { + opc_name = getDependencyObject(opclasses[i], OBJ_OPCLASS, true, true, false); + opclass = dynamic_cast(dbmodel->getObject(opc_name, OBJ_OPCLASS)); + + if(opclass) + part_key.setOperatorClass(opclass); + } + + part_keys.push_back(part_key); + } + + table->addPartitionKeys(part_keys); + part_keys.clear(); + } + } + + // Creating the paritioning relationships + for(auto &itr : imported_tables) + { + table = itr.second; + + if(table->isPartition()) + { + part_bound_expr = table->getPartitionBoundingExpr(); + part_table = table->getPartitionedTable(); + + /* Here, we force the detaching of the partition table so when + * creating the relationship below all the needed validations can be done correctly */ + table->setPartionedTable(nullptr); + table->setPartitionBoundingExpr(QString()); + + rel_part = new Relationship(BaseRelationship::RELATIONSHIP_PART, table, part_table); + rel_part->setPartitionBoundingExpr(part_bound_expr); + dbmodel->addRelationship(rel_part); + } + } + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + void DatabaseImportHelper::destroyDetachedColumns(void) { if(inherited_cols.empty() || import_canceled) diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 9288430758..fc924ef003 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -125,7 +125,10 @@ class DatabaseImportHelper: public QObject { //! \brief Reference for the database model instance of the model widget DatabaseModel *dbmodel; - + + //! \brief Stored the table created (value) from the oid (key) so the partitioning hierarchy (if existent) can be reconstructed + map imported_tables; + XMLParser *xmlparser; SchemaParser schparser; @@ -159,8 +162,9 @@ class DatabaseImportHelper: public QObject { void createEventTrigger(attribs_map &attribs); void __createTableInheritances(void); void createTableInheritances(void); + void createTablePartitionings(void); void destroyDetachedColumns(void); - + //! \brief Tries to assign imported sequences that are related to nextval() calls used in columns default values void assignSequencesToColumns(void); diff --git a/schemas/catalog/aggregate.sch b/schemas/catalog/aggregate.sch index 36f5092bfc..7ee693d1ae 100644 --- a/schemas/catalog/aggregate.sch +++ b/schemas/catalog/aggregate.sch @@ -2,6 +2,12 @@ # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. +%if ({pgsql-ver} <=f "10.0") %then + %set {is-agg} [pr.proisagg IS TRUE] +%else + %set {is-agg} [pr.prokind = 'a'] +%end + %if {list} %then [SELECT pr.oid, proname || '(' || @@ -14,9 +20,9 @@ %if {schema} %then [ LEFT JOIN pg_namespace AS ns ON pr.pronamespace = ns.oid - WHERE pr.proisagg IS TRUE AND ns.nspname = ] '{schema}' + WHERE ] {is-agg} [ AND ns.nspname = ] '{schema}' %else - [ WHERE pr.proisagg IS TRUE ] + [ WHERE ] {is-agg} %end %if {last-sys-oid} %then @@ -24,7 +30,7 @@ %end %if {not-ext-object} %then - [ AND ] ( {not-ext-object} ) # [ IS FALSE ] + [ AND ] ( {not-ext-object} ) %end %else @@ -43,23 +49,24 @@ [ LEFT JOIN pg_namespace AS ns ON pr.pronamespace = ns.oid ] %end - [ WHERE pr.proisagg IS TRUE ] + [ WHERE ] {is-agg} + %if {last-sys-oid} %then - [ AND pr.oid ] {oid-filter-op} $sp {last-sys-oid} + [ AND pr.oid ] {oid-filter-op} $sp {last-sys-oid} %end %if {not-ext-object} %then - [ AND ] ( {not-ext-object} ) + [ AND ] ( {not-ext-object} ) %end %if {filter-oids} %or {schema} %then - %if {filter-oids} %then - [ AND pr.oid IN (] {filter-oids} ) - %end + %if {filter-oids} %then + [ AND pr.oid IN (] {filter-oids} ) + %end - %if {schema} %then - [ AND ns.nspname = ] '{schema}' - %end + %if {schema} %then + [ AND ns.nspname = ] '{schema}' + %end %end %end %end diff --git a/schemas/catalog/function.sch b/schemas/catalog/function.sch index fea8fbe3ad..2e76ba35ab 100644 --- a/schemas/catalog/function.sch +++ b/schemas/catalog/function.sch @@ -2,15 +2,23 @@ # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. +%if ({pgsql-ver} <=f "10.0") %then + %set {is-not-agg} [pr.proisagg IS FALSE] + %set {window-func} [pr.proiswindow AS window_func_bool] +%else + %set {is-not-agg} [pr.prokind <> 'a'] + %set {window-func} [CASE pr.prokind WHEN 'w' THEN TRUE ELSE FALSE END AS window_func_bool] +%end + %if {list} %then [SELECT pr.oid, proname || '(' || array_to_string(proargtypes::regtype] $ob $cb [,',') || ')' AS name FROM pg_proc AS pr ] %if {schema} %then [ LEFT JOIN pg_namespace AS ns ON pr.pronamespace = ns.oid - WHERE pr.proisagg IS FALSE AND ns.nspname = ] '{schema}' + WHERE ] {is-not-agg} [ AND ns.nspname = ] '{schema}' %else - [ WHERE pr.proisagg IS FALSE ] + [ WHERE ] {is-not-agg} %end %if {last-sys-oid} %then @@ -30,9 +38,11 @@ pr.proname AS name, pr.prolang AS language, pr.procost AS execution_cost, - pr.prorows AS row_amount, - pr.proiswindow AS window_func_bool, - pr.proretset AS returns_setof_bool, + pr.prorows AS row_amount, ] + + {window-func}, + + [ pr.proretset AS returns_setof_bool, pr.pronargs AS arg_count, pr.pronargdefaults AS arg_def_count, pr.prorettype AS return_type, ] @@ -64,7 +74,7 @@ ELSE 'CALLED ON NULL INPUT' END AS behavior_type, ] - %if ({pgsql-ver} <=f "9.1") %then + %if ({pgsql-ver} <=f "9.1") %then [ NULL AS leakproof_bool, ] %else [ pr.proleakproof AS leakproof_bool, ] @@ -78,7 +88,7 @@ [ LEFT JOIN pg_namespace AS ns ON pr.pronamespace = ns.oid ] %end - [ WHERE pr.proisagg IS FALSE ] + [ WHERE ] {is-not-agg} %if {last-sys-oid} %then [ AND pr.oid ] {oid-filter-op} $sp {last-sys-oid} diff --git a/schemas/catalog/partitionkey.sch b/schemas/catalog/partitionkey.sch new file mode 100644 index 0000000000..9797569b5b --- /dev/null +++ b/schemas/catalog/partitionkey.sch @@ -0,0 +1,19 @@ +# Catalog queries for table partition keys +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[SELECT partrelid AS table, + CASE partstrat + WHEN 'l' then 'LIST' + WHEN 'r' then 'RANGE' + ELSE 'HASH' + END AS partitioning, + pg_get_expr(partexprs, partrelid) AS expressions, + partattrs::oid] $ob $cb [ AS columns, + partclass::oid] $ob $cb [ AS opclasses, + partcollation::oid] $ob $cb [ AS collations + FROM pg_partitioned_table ] + +%if {filter-oids} %then + [ WHERE partrelid IN (] {filter-oids} ) +%end diff --git a/schemas/catalog/table.sch b/schemas/catalog/table.sch index c06c14af9c..1ceec43004 100644 --- a/schemas/catalog/table.sch +++ b/schemas/catalog/table.sch @@ -43,7 +43,35 @@ [ tb.relforcerowsecurity AS rls_forced_bool, ] %end - [(SELECT array_agg(inhparent) AS parents FROM pg_inherits WHERE inhrelid = tb.oid)], + [(SELECT array_agg(inhparent) AS parents FROM pg_inherits WHERE inhrelid = tb.oid] + + # In PostgreSQL 10+ we need to separate partitioned tables from parent tables + %if ({pgsql-ver} >=f "10.0") %then + [ AND inhparent NOT IN (SELECT partrelid FROM pg_partitioned_table)] + %end + + [)], + + %if ({pgsql-ver} >=f "10.0") %then + [ CASE relkind + WHEN 'p' THEN TRUE + ELSE FALSE + END AS is_partitioned_bool, + + CASE relispartition + WHEN TRUE THEN + (SELECT inhparent FROM pg_inherits WHERE inhrelid = tb.oid) + ELSE + NULL + END AS partitioned_table, + + pg_get_expr(relpartbound, tb.oid) AS partition_bound_expr, + + ] + %else + [ FALSE AS is_partitioned_bool, NULL AS partitioned_table, NULL AS partition_bound_expr,] + %end + ({comment}) [ AS comment ] diff --git a/tests/src/schemaparsertest/schemaparsertest.cpp b/tests/src/schemaparsertest/schemaparsertest.cpp index da23dd864e..e040acdf82 100644 --- a/tests/src/schemaparsertest/schemaparsertest.cpp +++ b/tests/src/schemaparsertest/schemaparsertest.cpp @@ -25,6 +25,7 @@ class SchemaParserTest: public QObject { private slots: void testExpressionEvaluationWithCasts(void); + void testSetOperationInIf(void); }; void SchemaParserTest::testExpressionEvaluationWithCasts(void) @@ -51,5 +52,32 @@ void SchemaParserTest::testExpressionEvaluationWithCasts(void) } } +void SchemaParserTest::testSetOperationInIf(void) +{ + SchemaParser schparser; + QString buffer; + attribs_map attribs; + + buffer = "%set {ver} 10.0\n"; + buffer += "\n%if ({ver} <=f \"9.3\") %then"; + buffer += "\n %set {variable1} [don't ]"; + buffer += "\n %set {variable2} [extract]"; + buffer += "\n%else"; + buffer += "\n %set {variable3} [extract ]"; + buffer += "\n %set {variable4} [in else]"; + buffer += "\n{variable3}{variable4}"; + buffer += "\n%end"; + + try + { + schparser.loadBuffer(buffer); + QCOMPARE(schparser.getCodeDefinition(attribs) == "extract in else", true); + } + catch(Exception &e) + { + QFAIL(e.getExceptionsText().toStdString().c_str()); + } +} + QTEST_MAIN(SchemaParserTest) #include "schemaparsertest.moc" From 487047798e84d1ba6b627fa17f0c640aff5725e1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 10 Oct 2018 17:54:00 -0300 Subject: [PATCH 147/425] pgModeler is now able to import a partitioning hierachy --- libpgmodeler/src/databasemodel.cpp | 24 +++++++++--- libpgmodeler/src/relationship.cpp | 2 +- libpgmodeler_ui/src/relationshipwidget.cpp | 9 ++++- libpgmodeler_ui/ui/relationshipwidget.ui | 44 +++++++++++++++++++++- schemas/catalog/constraint.sch | 40 ++++++++++---------- schemas/sql/table.sch | 6 +-- 6 files changed, 93 insertions(+), 32 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 69c215d052..fd6f130853 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1644,11 +1644,11 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) /* Only identifier relationships or relationship that has identifier attributes (primary keys) are checked */ if((!rel->isSelfRelationship() && - (rel->isIdentifier() || - rel->hasIndentifierAttribute())) || - + (rel->isIdentifier() || + rel->hasIndentifierAttribute())) || (rel_type==Relationship::RELATIONSHIP_GEN || - rel_type==Relationship::RELATIONSHIP_DEP)) + rel_type==Relationship::RELATIONSHIP_DEP || + rel_type==Relationship::RELATIONSHIP_PART)) { BaseTable *ref_table=nullptr, *src_table=nullptr; Table *recv_table=nullptr; @@ -1690,7 +1690,8 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) (rel_aux->isIdentifier() || rel_aux->hasIndentifierAttribute())) || (aux_rel_type==Relationship::RELATIONSHIP_GEN || - aux_rel_type==Relationship::RELATIONSHIP_DEP))) + aux_rel_type==Relationship::RELATIONSHIP_DEP || + aux_rel_type==Relationship::RELATIONSHIP_PART))) { //The receiver table will be the receiver from the current relationship @@ -8925,6 +8926,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector Trigger *trig=nullptr; Index *index=nullptr; Constraint *constr=nullptr; + vector part_keys; count=tab->getConstraintCount(); for(idx=0; idx < count && (!exclusion_mode || (exclusion_mode && !refer)); idx++) @@ -8963,6 +8965,18 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } + + part_keys = tab->getPartitionKeys(); + for(auto &part_key : part_keys) + { + if(part_key.getColumn() == column) + { + refer = true; + refs.push_back(tab); + break; + } + } + } else if(obj_types[i]==OBJ_RELATIONSHIP) { diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index edcacdea53..0e012f94bd 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -380,7 +380,7 @@ QString Relationship::getTableNameRelNN(void) void Relationship::setPartitionBoundingExpr(const QString &part_bound_expr) { - part_bounding_expr = part_bound_expr; + part_bounding_expr = part_bound_expr.toLower() == ParsersAttributes::DEFAULT.toLower() ? QString() : part_bound_expr; this->invalidated = true; } diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 6674d68dac..9b09cd1ff2 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -200,8 +200,8 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent connect(fk_gconf_chk, SIGNAL(toggled(bool)), this, SLOT(useFKGlobalSettings(bool))); connect(patterns_gconf_chk, SIGNAL(toggled(bool)), this, SLOT(usePatternGlobalSettings(bool))); - connect(gen_bound_expr_tb, SIGNAL(clicked(bool)), this, SLOT(generateBoundingExpr())); + connect(default_part_chk, SIGNAL(toggled(bool)), part_bound_expr_txt, SLOT(setDisabled(bool))); setMinimumSize(600, 380); } @@ -312,7 +312,10 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } if(rel_type == BaseRelationship::RELATIONSHIP_PART) + { part_type_lbl->setText(~aux_rel->getReferenceTable()->getPartitioningType()); + default_part_chk->setChecked(aux_rel->getPartitionBoundingExpr().isEmpty()); + } } disable_sql_chk->setVisible(base_rel->getObjectType()==OBJ_RELATIONSHIP); @@ -547,6 +550,7 @@ void RelationshipWidget::generateBoundingExpr(void) part_bound_expr_txt->setPlainText(QString()); part_bound_expr_txt->setPlainText(tmpl); + default_part_chk->setChecked(false); } void RelationshipWidget::listObjects(ObjectType obj_type) @@ -1090,7 +1094,7 @@ void RelationshipWidget::applyConfiguration(void) rel_type=rel->getRelationshipType(); rel->blockSignals(true); - rel->setPartitionBoundingExpr(part_bound_expr_txt->toPlainText()); + rel->setPartitionBoundingExpr(default_part_chk->isChecked() ? QString() : part_bound_expr_txt->toPlainText()); if(!defaults_rb->isChecked()) { @@ -1152,6 +1156,7 @@ void RelationshipWidget::applyConfiguration(void) //Checking if there is relationship redundancy if(rel_type==BaseRelationship::RELATIONSHIP_DEP || rel_type==BaseRelationship::RELATIONSHIP_GEN || + rel_type==BaseRelationship::RELATIONSHIP_PART || rel->isIdentifier()) model->checkRelationshipRedundancy(rel); diff --git a/libpgmodeler_ui/ui/relationshipwidget.ui b/libpgmodeler_ui/ui/relationshipwidget.ui index e9f0f6f7b1..b972ae0c56 100644 --- a/libpgmodeler_ui/ui/relationshipwidget.ui +++ b/libpgmodeler_ui/ui/relationshipwidget.ui @@ -623,7 +623,7 @@ Qt::Horizontal - QSizePolicy::Expanding + QSizePolicy::Fixed @@ -633,6 +633,48 @@ + + + + Default partition + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + diff --git a/schemas/catalog/constraint.sch b/schemas/catalog/constraint.sch index 22d125f48b..2e357ba4f2 100644 --- a/schemas/catalog/constraint.sch +++ b/schemas/catalog/constraint.sch @@ -11,7 +11,7 @@ WHERE nspname= ] '{schema}' %if {table} %then - [ AND relkind='r' AND relname=] '{table}' + [ AND relkind IN ('r','p') AND relname=] '{table}' %end %end @@ -30,8 +30,9 @@ [ WHERE ] %end - #Avoiding the listing of constraint generated by constraint triggers - [ cs.oid NOT IN (SELECT DISTINCT tgconstraint FROM pg_trigger WHERE tgconstrindid=0)] + #Avoiding the listing of constraint generated by constraint triggers and those inherited + [ cs.oid NOT IN (SELECT DISTINCT tgconstraint FROM pg_trigger WHERE tgconstrindid=0) + AND cs.conislocal IS TRUE ] %if {not-ext-object} %then [ AND ]( {not-ext-object} ) @@ -115,37 +116,38 @@ WHERE ns.nspname= ] '{schema}' %if {table} %then - [ AND tb.relkind='r' AND tb.relname= ] '{table}' + [ AND tb.relkind IN ('r','p') AND tb.relname= ] '{table}' %end %end %if {last-sys-oid} %then - %if {schema} %then - [ AND ] - %else - [ WHERE ] - %end - [ cs.oid ] {oid-filter-op} $sp {last-sys-oid} + %if {schema} %then + [ AND ] + %else + [ WHERE ] + %end + [ cs.oid ] {oid-filter-op} $sp {last-sys-oid} %end %if {filter-oids} %then - %if {schema} %or {last-sys-oid} %then - [ AND ] - %else - [ WHERE ] - %end + %if {schema} %or {last-sys-oid} %then + [ AND ] + %else + [ WHERE ] + %end [ cs.oid IN (] {filter-oids} ) %end %if {filter-oids} %or {last-sys-oid} %or {schema} %then - [ AND ] + [ AND ] %else - [ WHERE ] + [ WHERE ] %end - #Avoiding the listing of constraint generated by constraint triggers - [ cs.oid NOT IN (SELECT DISTINCT tgconstraint FROM pg_trigger WHERE tgconstrindid=0)] + #Avoiding the listing of constraint generated by constraint triggers and those inherited + [ cs.oid NOT IN (SELECT DISTINCT tgconstraint FROM pg_trigger WHERE tgconstrindid=0) + AND cs.conislocal IS TRUE ] %if {not-ext-object} %then [ AND ]( {not-ext-object} ) diff --git a/schemas/sql/table.sch b/schemas/sql/table.sch index a4588436d9..70b2c3f4f2 100644 --- a/schemas/sql/table.sch +++ b/schemas/sql/table.sch @@ -59,12 +59,10 @@ $br ) %end %if ({pgsql-ver} >=f "10.0") %and {partitioned-table} %then - $br [FOR VALUES ] - %if {partition-bound-expr} %then - {partition-bound-expr} + $br [FOR VALUES ] {partition-bound-expr} %else - $tb [/* Undefined bounding expression */] + DEFAULT %end %end From 43fc23a65041dbc3797a6d12002035164dea7109 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 11 Oct 2018 16:11:42 -0300 Subject: [PATCH 148/425] Partition keys are now created while creating the tables on DatabaseImportHelper --- libparsers/src/parsersattributes.cpp | 26 ++-- libparsers/src/parsersattributes.h | 29 ++-- .../src/databaseexplorerwidget.cpp | 27 +++- libpgmodeler_ui/src/databaseimporthelper.cpp | 137 ++++++++---------- schemas/catalog/table.sch | 30 +++- 5 files changed, 132 insertions(+), 117 deletions(-) diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index a1784591f4..6996ebf456 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -33,7 +33,6 @@ namespace ParsersAttributes { ALTER_CMDS=QString("alter-cmds"), ALLOW_CONNS=QString("allow-conns"), ANALYZE_FUNC=QString("analyze"), - ANALYZE_COUNT=QString("analyze-count"), ANCESTOR_TABLE=QString("ancestor-table"), APPEND_AT_EOD=QString("append-at-eod"), APPENDED_SQL=QString("appended-sql"), @@ -48,8 +47,6 @@ namespace ParsersAttributes { ASC_ORDER=QString("asc-order"), ASSIGNMENT=QString("assignment"), ATTRIBUTE=QString("attribute"), - AUTOVACUUM_COUNT=QString("autovacuum-count"), - AUTOANALYZE_COUNT=QString("autoanalyze-count"), AUTO_BROWSE_DB=QString("auto-browse-db"), AUTOSAVE_INTERVAL=QString("autosave-interval"), BACKGROUND_COLOR=QString("background-color"), @@ -138,6 +135,7 @@ namespace ParsersAttributes { DATABASE=QString("database"), DB_MODEL=QString("dbmodel"), DDL_END_TOKEN=QString("-- ddl-end --"), + DEAD_ROWS_AMOUNT=QString("dead-rows-amount"), DECL_IN_TABLE=QString("decl-in-table"), DECLARATION=QString("declaration"), DEFAULT_COLLATION=QString("default-collation"), @@ -251,8 +249,6 @@ namespace ParsersAttributes { INDEX_TYPE=QString("index-type"), INDEX=QString("index"), INDEXES=QString("indexes"), - INDEX_SCAN=QString("index-scan"), - INDEX_SCAN_READ=QString("index-scan-read"), INFO=QString("info"), INH_COLUMN=QString("inh-column"), INH_COLUMNS=QString("inh-columns"), @@ -269,6 +265,7 @@ namespace ParsersAttributes { INTERVAL_TYPE=QString("interval-type"), INVERT_RANGESEL_TRIGGER=QString("invert-rangesel-trigger"), IS_TEMPLATE=QString("is-template"), + IS_PARTITIONED=QString("is-partitioned"), IO_CAST=QString("io-cast"), ITALIC=QString("italic"), JOIN_FUNC=QString("join"), @@ -280,9 +277,9 @@ namespace ParsersAttributes { LAST_SYS_OID=QString("last-sys-oid"), LAST_VALUE=QString("last-value"), LAST_ZOOM=QString("last-zoom"), - LAST_ANALYZE=QString("last-analyze"), - LAST_AUTOVACUUM=QString("last-autovacuum"), - LAST_VACUUM=QString("last-vacuum"), + LAST_ANALYZE=QString("last-analyze"), + LAST_AUTOVACUUM=QString("last-autovacuum"), + LAST_VACUUM=QString("last-vacuum"), LEAKPROOF=QString("leakproof"), LEFT_TYPE=QString("left-type"), LEFT=QString("left"), @@ -365,6 +362,10 @@ namespace ParsersAttributes { PARTITION_BOUND_EXPR=QString("partition-bound-expr"), PARTITIONED_TABLE=QString("partitioned-table"), PARTITIONING=QString("partitioning"), + PART_KEY_COLS=QString("part-key-cols"), + PART_KEY_COLLS=QString("part-key-colls"), + PART_KEY_OPCLS=QString("part-key-opcls"), + PART_KEY_EXPRS=QString("part-key-exprs"), PASSWORD=QString("password"), PASSWORD_ENCRYPTION=QString("password-encryption"), PATH=QString("path"), @@ -456,8 +457,6 @@ namespace ParsersAttributes { SELECT_OBJECTS=QString("select-objects"), SEND_FUNC=QString("send"), SEQUENCE=QString("sequence"), - SEQ_SCAN=QString("seq-scan"), - SEQ_SCAN_READ=QString("seq-scan-read"), SERVER_ENCODING=QString("server-encoding"), SERVER_VERSION=QString("server-version"), SERVER_PID=QString("server-pid"), @@ -535,9 +534,9 @@ namespace ParsersAttributes { TRUNCATE_PRIV=QString("truncate"), TRUNCATE=QString("truncate"), TRUSTED=QString("trusted"), - TUPLES_DEL=QString("tuples-del"), - TUPLES_UPD=QString("tuples-upd"), - TUPLES_INS=QString("tuples-ins"), + TUPLES_DEL=QString("tuples-del"), + TUPLES_UPD=QString("tuples-upd"), + TUPLES_INS=QString("tuples-ins"), TYPE_ATTRIBUTE=QString("typeattrib"), TYPE_OID=QString("type-oid"), TYPE=QString("type"), @@ -561,7 +560,6 @@ namespace ParsersAttributes { USE_SORTING=QString("use-sorting"), USE_UNIQUE_NAMES=QString("use-unique-names"), USING_EXP=QString("using-exp"), - VACUUM_COUNT=QString("vacuum-count"), VALIDATOR_FUNC=QString("validator"), VALIDATOR=QString("validator"), VALIDITY=QString("validity"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 126ccee54d..1f8d7b5751 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -150,6 +150,7 @@ namespace ParsersAttributes { DATE, DB_MODEL, DDL_END_TOKEN, + DEAD_ROWS_AMOUNT, DECL_IN_TABLE, DECLARATION, DEFAULT_COLLATION, @@ -280,6 +281,7 @@ namespace ParsersAttributes { INVERT_RANGESEL_TRIGGER, IO_CAST, IS_TEMPLATE, + IS_PARTITIONED, ITALIC, JOIN_FUNC, LABEL, @@ -372,6 +374,10 @@ namespace ParsersAttributes { PARTITIONED_TABLE, PARTITION_BOUND_EXPR, PARTITIONING, + PART_KEY_COLS, + PART_KEY_COLLS, + PART_KEY_OPCLS, + PART_KEY_EXPRS, PASSWORD, PASSWORD_ENCRYPTION, PATH, @@ -586,22 +592,13 @@ namespace ParsersAttributes { WORD_SEPARATORS, WORKING_DIR, X_POS, - Y_POS, - INDEX_SCAN, - INDEX_SCAN_READ, - LAST_ANALYZE, - LAST_AUTOVACUUM, - LAST_VACUUM, - TUPLES_DEL, - TUPLES_UPD, - TUPLES_INS, - SEQ_SCAN, - SEQ_SCAN_READ, - VACUUM_COUNT, - AUTOVACUUM_COUNT, - ANALYZE_COUNT, - AUTOANALYZE_COUNT - ; + Y_POS, + LAST_ANALYZE, + LAST_AUTOVACUUM, + LAST_VACUUM, + TUPLES_DEL, + TUPLES_UPD, + TUPLES_INS; } #endif diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index b939991154..3eb13eda07 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -95,12 +95,11 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {CONNECTION, QT_TR_NOOP("Connection ID")}, {SERVER_PID, QT_TR_NOOP("Server PID")}, {SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {REFERRERS, QT_TR_NOOP("Referrers")}, {IDENTITY_TYPE, QT_TR_NOOP("Identity")}, {COMMAND, QT_TR_NOOP("Command")}, {USING_EXP, QT_TR_NOOP("USING expr.")}, {CHECK_EXP, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")}, - {RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {RLS_FORCED, QT_TR_NOOP("RLS forced")}, {INDEX_SCAN, QT_TR_NOOP("Index scans")}, - {INDEX_SCAN_READ, QT_TR_NOOP("Index scans tuples")}, {LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, {LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, - {LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, - {TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {SEQ_SCAN, QT_TR_NOOP("Sequential scans")}, {SEQ_SCAN_READ, QT_TR_NOOP("Sequential scans tuples")}, - {VACUUM_COUNT, QT_TR_NOOP("Vacuum count")}, {AUTOVACUUM_COUNT, QT_TR_NOOP("Autovacuum count")}, {ANALYZE_COUNT, QT_TR_NOOP("Analyze count")}, - {AUTOANALYZE_COUNT, QT_TR_NOOP("Autoanalyze count")} + {RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {RLS_FORCED, QT_TR_NOOP("RLS forced")}, {LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, + {LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, + {TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, {TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {IS_PARTITIONED, QT_TR_NOOP("Partitioned")}, + {PARTITIONED_TABLE, QT_TR_NOOP("Partition of")}, {PARTITION_BOUND_EXPR, QT_TR_NOOP("Partition bound expr.")}, {DEAD_ROWS_AMOUNT, QT_TR_NOOP("Dead rows amount")}, + {PARTITION_KEY, QT_TR_NOOP("Partition keys")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) @@ -514,12 +513,28 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) { + QStringList part_keys; + formatBooleanAttribs(attribs, { ParsersAttributes::OIDS, ParsersAttributes::UNLOGGED, ParsersAttributes::RLS_ENABLED, ParsersAttributes::RLS_FORCED}); formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, OBJ_TABLE, true); + + part_keys.push_back(getObjectsNames(OBJ_COLUMN, + Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]), + getObjectName(OBJ_SCHEMA, attribs[ParsersAttributes::SCHEMA]), + attribs[ParsersAttributes::NAME]).join(ELEM_SEPARATOR)); + + part_keys.push_back(Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ELEM_SEPARATOR)); + part_keys.removeAll(QString()); + + attribs[ParsersAttributes::PARTITION_KEY] = part_keys.join(ELEM_SEPARATOR); + attribs.erase(ParsersAttributes::PART_KEY_COLLS); + attribs.erase(ParsersAttributes::PART_KEY_OPCLS); + attribs.erase(ParsersAttributes::PART_KEY_EXPRS); + attribs.erase(ParsersAttributes::PART_KEY_COLS); } void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index fdbc554516..2b396abfc9 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1785,6 +1785,66 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) } } + // Creating partition keys if present + if(attribs[ParsersAttributes::IS_PARTITIONED] == ParsersAttributes::_TRUE_) + { + QStringList cols, collations, opclasses, exprs; + PartitionKey part_key; + PartitioningType part_type; + QString coll_name, opc_name; + Collation *coll = nullptr; + OperatorClass *opclass = nullptr; + vector part_keys; + + part_type = PartitioningType(attribs[ParsersAttributes::PARTITIONING]); + table->setPartitioningType(part_type); + + cols=Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]); + collations=Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLLS]); + opclasses=Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_OPCLS]); + exprs = parseIndexExpressions(attribs[ParsersAttributes::PART_KEY_EXPRS]); + + for(int i = 0; i < cols.size(); i++) + { + part_key = PartitionKey(); + + // Retrieving the column used by the partition key + if(cols[i] != QString("0")) + part_key.setColumn(table->getColumn(getColumnName(attribs[ParsersAttributes::OID], cols[i]))); + else if(!exprs.isEmpty()) + { + part_key.setExpression(exprs.front()); + exprs.pop_front(); + } + + // Retriving the collation for the partion key + if(i < collations.size() && collations[i] != QString("0")) + { + coll_name = getDependencyObject(collations[i], OBJ_COLLATION, false, true, false); + coll = dynamic_cast(dbmodel->getObject(coll_name, OBJ_COLLATION)); + + //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" + if(coll && (!coll->isSystemObject() || + (coll->isSystemObject() && coll->getName() != QString("default")))) + part_key.setCollation(coll); + } + + // Retriving the operator class for the partion key + if(i < opclasses.size() && opclasses[i] != QString("0")) + { + opc_name = getDependencyObject(opclasses[i], OBJ_OPCLASS, true, true, false); + opclass = dynamic_cast(dbmodel->getObject(opc_name, OBJ_OPCLASS)); + + if(opclass) + part_key.setOperatorClass(opclass); + } + + part_keys.push_back(part_key); + } + + table->addPartitionKeys(part_keys); + } + dbmodel->addTable(table); imported_tables[tab_oid] = table; } @@ -2296,89 +2356,14 @@ void DatabaseImportHelper::createTablePartitionings(void) try { - QStringList oids, cols, collations, opclasses, exprs; - attribs_map attribs; - vector attribs_vect; - vector part_keys; - PartitionKey part_key; - PartitioningType part_type; Table *table = nullptr, *part_table = nullptr; - unsigned tab_oid = 0; - QString coll_name, opc_name, part_bound_expr; - Collation *coll = nullptr; - OperatorClass *opclass = nullptr; + QString part_bound_expr; Relationship *rel_part = nullptr; emit s_progressUpdated(95, trUtf8("Creating table partitionings..."), OBJ_RELATIONSHIP); - // Retriveing the partition keys for each table - for(auto &itr : imported_tables) - oids.push_back(QString::number(itr.first)); - - attribs[ParsersAttributes::FILTER_OIDS] = oids.join(','); - attribs_vect = catalog.getMultipleAttributes(ParsersAttributes::PARTITION_KEY, attribs); - - // With the parition key attributes retrived we need to assing them properly to the tables - for(auto &pk_attr : attribs_vect) - { - tab_oid = pk_attr[ParsersAttributes::TABLE].toUInt(); - - if(imported_tables.count(tab_oid)) - { - table = imported_tables[tab_oid]; - part_type = PartitioningType(pk_attr[ParsersAttributes::PARTITIONING]); - table->setPartitioningType(part_type); - - cols=Catalog::parseArrayValues(pk_attr[ParsersAttributes::COLUMNS]); - collations=Catalog::parseArrayValues(pk_attr[ParsersAttributes::COLLATIONS]); - opclasses=Catalog::parseArrayValues(pk_attr[ParsersAttributes::OP_CLASSES]); - exprs = parseIndexExpressions(pk_attr[ParsersAttributes::EXPRESSIONS]); - - for(int i = 0; i < cols.size(); i++) - { - part_key = PartitionKey(); - - // Retrieving the column used by the partition key - if(cols[i] != QString("0")) - part_key.setColumn(table->getColumn(getColumnName(pk_attr[ParsersAttributes::TABLE], cols[i]))); - else if(!exprs.isEmpty()) - { - part_key.setExpression(exprs.front()); - exprs.pop_front(); - } - - // Retriving the collation for the partion key - if(i < collations.size() && collations[i] != QString("0")) - { - coll_name = getDependencyObject(collations[i], OBJ_COLLATION, false, true, false); - coll = dynamic_cast(dbmodel->getObject(coll_name, OBJ_COLLATION)); - - //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" - if(coll && (!coll->isSystemObject() || - (coll->isSystemObject() && coll->getName() != QString("default")))) - part_key.setCollation(coll); - } - - // Retriving the operator class for the partion key - if(i < opclasses.size() && opclasses[i] != QString("0")) - { - opc_name = getDependencyObject(opclasses[i], OBJ_OPCLASS, true, true, false); - opclass = dynamic_cast(dbmodel->getObject(opc_name, OBJ_OPCLASS)); - - if(opclass) - part_key.setOperatorClass(opclass); - } - - part_keys.push_back(part_key); - } - - table->addPartitionKeys(part_keys); - part_keys.clear(); - } - } - // Creating the paritioning relationships for(auto &itr : imported_tables) { diff --git a/schemas/catalog/table.sch b/schemas/catalog/table.sch index 1ceec43004..a710487fcf 100644 --- a/schemas/catalog/table.sch +++ b/schemas/catalog/table.sch @@ -75,14 +75,34 @@ ({comment}) [ AS comment ] - [ , st.seq_scan AS seq_scan, st.seq_tup_read AS seq_scan_read, st.idx_scan AS index_scan, st.idx_tup_fetch AS index_scan_read, - st.n_tup_ins AS tuples_ins, st.n_tup_upd AS tuples_upd, st.n_tup_del AS tuples_del, st.n_live_tup AS row_amount, - st.last_vacuum, st.last_autovacuum, st.last_analyze, st.vacuum_count, st.autovacuum_count, st.analyze_count, st.autoanalyze_count ] + [ , st.n_tup_ins AS tuples_ins, st.n_tup_upd AS tuples_upd, st.n_tup_del AS tuples_del, st.n_live_tup AS row_amount, + st.n_dead_tup AS dead_rows_amount, st.last_vacuum, st.last_autovacuum, st.last_analyze, ] + + %if ({pgsql-ver} >=f "10.0") %then + [ CASE partstrat + WHEN 'l' then 'LIST' + WHEN 'r' then 'RANGE' + ELSE 'HASH' + END AS partitioning, + pg_get_expr(partexprs, partrelid) AS part_key_exprs, + partattrs::oid] $ob $cb [ AS part_key_cols, + partclass::oid] $ob $cb [ AS part_key_opcls, + partcollation::oid] $ob $cb [ AS part_key_colls ] + %else + [ NULL AS partitioning, NULL AS part_key_exprs, NULL AS part_key_cols, + NULL AS part_key_opcls, NULL AS part_key_colls ] + %end [ FROM pg_class AS tb LEFT JOIN pg_tables AS _tb1 ON _tb1.tablename=tb.relname - LEFT JOIN pg_stat_all_tables AS st ON st.relid=tb.oid - WHERE tb.relkind IN ('r','p') ] + LEFT JOIN pg_stat_all_tables AS st ON st.relid=tb.oid ] + + %if ({pgsql-ver} >=f "10.0") %then + [ LEFT JOIN pg_partitioned_table AS pt ON pt.partrelid = tb.oid ] + %end + + + [ WHERE tb.relkind IN ('r','p') ] %if {last-sys-oid} %then [ AND tb.oid ] {oid-filter-op} $sp {last-sys-oid} From fad2b5a4591f8a82333d03cfbdc2a7f547b250ac Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 11 Oct 2018 16:13:52 -0300 Subject: [PATCH 149/425] Removed unused catalog query file --- schemas/catalog/partitionkey.sch | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 schemas/catalog/partitionkey.sch diff --git a/schemas/catalog/partitionkey.sch b/schemas/catalog/partitionkey.sch deleted file mode 100644 index 9797569b5b..0000000000 --- a/schemas/catalog/partitionkey.sch +++ /dev/null @@ -1,19 +0,0 @@ -# Catalog queries for table partition keys -# CAUTION: Do not modify this file unless you know what you are doing. -# Code generation can be broken if incorrect changes are made. - -[SELECT partrelid AS table, - CASE partstrat - WHEN 'l' then 'LIST' - WHEN 'r' then 'RANGE' - ELSE 'HASH' - END AS partitioning, - pg_get_expr(partexprs, partrelid) AS expressions, - partattrs::oid] $ob $cb [ AS columns, - partclass::oid] $ob $cb [ AS opclasses, - partcollation::oid] $ob $cb [ AS collations - FROM pg_partitioned_table ] - -%if {filter-oids} %then - [ WHERE partrelid IN (] {filter-oids} ) -%end From 3a7b3804c7b732f7abdcd1306e64e9b0cee51f3c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 16 Oct 2018 17:02:44 -0300 Subject: [PATCH 150/425] Added auxiliary methods in Table class in order to add/remove and retrieve partition tables Partition tables are now displayed in the "Tables" tab at TableWidget --- libpgmodeler/src/table.cpp | 69 +++++++++++++++++++++++++---- libpgmodeler/src/table.h | 23 +++++++++- libpgmodeler_ui/src/tablewidget.cpp | 21 +++++++++ 3 files changed, 104 insertions(+), 9 deletions(-) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index edcc6552ac..77709af92e 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -46,7 +46,7 @@ Table::Table(void) : BaseTable() attributes[ParsersAttributes::PARTITIONED_TABLE]=QString(); attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); - copy_table=partioned_table=nullptr; + copy_table=partitioned_table=nullptr; partitioning_type=BaseType::null; this->setName(trUtf8("new_table").toUtf8()); @@ -63,6 +63,7 @@ Table::~Table(void) } ancestor_tables.clear(); + partition_tables.clear(); } void Table::setName(const QString &name) @@ -116,7 +117,7 @@ PartitioningType Table::getPartitioningType(void) Table *Table::getPartitionedTable(void) { - return(partioned_table); + return(partitioned_table); } void Table::setProtected(bool value) @@ -547,8 +548,15 @@ void Table::addPolicy(Policy *pol, int idx_pol) void Table::setPartionedTable(Table *table) { - setCodeInvalidated(partioned_table != table); - partioned_table = table; + setCodeInvalidated(partitioned_table != table); + + if(table != partitioned_table && partitioned_table) + partitioned_table->removePartitionTable(this); + + partitioned_table = table; + + if(partitioned_table) + partitioned_table->addPartitionTable(this); } void Table::setPartitionBoundingExpr(const QString part_bound_expr) @@ -562,6 +570,16 @@ QString Table::getPartitionBoundingExpr(void) return(part_bounding_expr); } +vector
Table::getPartionTables(void) +{ + return(partition_tables); +} + +bool Table::isPartitionTableExists(Table *table, bool compare_names) +{ + return(getPartitionTableIndex(table, compare_names) >= 0); +} + void Table::addConstraint(Constraint *constr, int idx) { try @@ -583,7 +601,42 @@ void Table::addAncestorTable(Table *tab, int idx) catch(Exception &e) { throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); - } + } +} + +void Table::addPartitionTable(Table *tab) +{ + if(tab && std::find(partition_tables.begin(), partition_tables.end(), tab) == partition_tables.end()) + partition_tables.push_back(tab); +} + +void Table::removePartitionTable(Table *tab) +{ + int idx = getPartitionTableIndex(tab, false); + + if(idx >= 0) + partition_tables.erase(partition_tables.begin() + idx); +} + +int Table::getPartitionTableIndex(Table *tab, bool compare_names) +{ + if(!tab) + return(-1); + + vector
::iterator itr = partition_tables.begin(); + + while(itr != partition_tables.end()) + { + if(*itr == tab || (compare_names && tab->getName(true) == (*itr)->getName(true))) + break; + + itr++; + } + + if(itr == partition_tables.end()) + return(-1); + + return(itr - partition_tables.begin()); } void Table::setCopyTable(Table *tab) @@ -1564,8 +1617,8 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) if(def_type==SchemaParser::SQL_DEFINITION && copy_table) attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); - if(def_type==SchemaParser::SQL_DEFINITION && partioned_table) - attributes[ParsersAttributes::PARTITIONED_TABLE]=partioned_table->getName(true); + if(def_type==SchemaParser::SQL_DEFINITION && partitioned_table) + attributes[ParsersAttributes::PARTITIONED_TABLE]=partitioned_table->getName(true); if(tag && def_type==SchemaParser::XML_DEFINITION) attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); @@ -1639,7 +1692,7 @@ bool Table::isReferRelationshipAddedObject(void) bool Table::isPartition(void) { - return(partioned_table != nullptr); + return(partitioned_table != nullptr); } bool Table::isPartitioned(void) diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index e2d2d1743e..dcf1abdefb 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -58,12 +58,15 @@ class Table: public BaseTable { //! \brief Stores the tables that 'this' object inherits attributes vector
ancestor_tables; + + //! \brief Stores the tables that 'this' object has as its partitions + vector
partition_tables; //! \brief Stores the partition keys of the table partitioning being used vector partition_keys; //! \brief Stores the table which this one is partition of - Table *partioned_table; + Table *partitioned_table; //! \brief Specifies the table from which columns are copied Table *copy_table; @@ -107,6 +110,17 @@ class Table: public BaseTable { protected: //! \brief Adds an ancestor table void addAncestorTable(Table *tab, int idx=-1); + + //! \brief Adds a partition table + void addPartitionTable(Table *tab); + + //! \brief Removes a partition table + void removePartitionTable(Table *tab); + + /*! \brief Returns the index of the partition table. If the + * compare_names is true then the search will compare the names if + * the object itself is not present in the list of partitions */ + int getPartitionTableIndex(Table *tab, bool compare_names); //! \brief Removes an acestor table using its name void removeAncestorTable(const QString &name); @@ -200,8 +214,15 @@ class Table: public BaseTable { //! \brief Defines the partition bounding expression void setPartitionBoundingExpr(const QString part_bound_expr); + //! \brief Returns the partition bounding expression QString getPartitionBoundingExpr(void); + //! \brief Returns the partition tables + vector
getPartionTables(void); + + //! \brief Returs if the provided table is amongst the partitions + bool isPartitionTableExists(Table *table, bool compare_names); + //! \brief Configures the copy table void setCopyTable(Table *tab); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 80e0627287..7253192d0a 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -283,12 +283,33 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc aux_tab=table->getCopyTable(); if(aux_tab) { + i = parent_tables->getRowCount(); parent_tables->addRow(); parent_tables->setCellText(aux_tab->getName(), i, 0); parent_tables->setCellText(aux_tab->getSchema()->getName(), i, 1); parent_tables->setCellText(trUtf8("Copy"), i, 2); } + aux_tab=table->getPartitionedTable(); + if(aux_tab) + { + i = parent_tables->getRowCount(); + parent_tables->addRow(); + parent_tables->setCellText(aux_tab->getName(), i, 0); + parent_tables->setCellText(aux_tab->getSchema()->getName(), i, 1); + parent_tables->setCellText(trUtf8("Partitioned"), i, 2); + } + + i = parent_tables->getRowCount(); + for(auto &tab : table->getPartionTables()) + { + parent_tables->addRow(); + parent_tables->setCellText(tab->getName(), i, 0); + parent_tables->setCellText(tab->getSchema()->getName(), i, 1); + parent_tables->setCellText(trUtf8("Partition"), i, 2); + i++; + } + parent_tables->clearSelection(); with_oids_chk->setChecked(table->isWithOIDs()); unlogged_chk->setChecked(table->isUnlogged()); From aadfe17184534e0ad49c7bb942445daf5d5009de Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 17 Oct 2018 15:38:41 -0300 Subject: [PATCH 151/425] Initial support for partition attaching/detaching detection in diff process --- conf/defaults/sql-highlight.conf | 2 ++ conf/sql-highlight.conf | 2 ++ libpgmodeler/src/relationship.cpp | 25 ++++++++++++--- libpgmodeler/src/relationship.h | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 37 +++++++++++++++------- libpgmodeler_ui/src/relationshipwidget.cpp | 2 +- schemas/alter/relationship.sch | 36 +++++++++++++++++++-- 7 files changed, 85 insertions(+), 21 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index fd3fca2d52..a9ef32e006 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -91,6 +91,7 @@ bold="true" italic="false" underline="false" foreground-color="#000000"> + @@ -159,6 +160,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index fd3fca2d52..a9ef32e006 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -91,6 +91,7 @@ bold="true" italic="false" underline="false" foreground-color="#000000"> + @@ -159,6 +160,7 @@ + diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 0e012f94bd..6cdf8e5284 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2705,14 +2705,29 @@ void Relationship::operator = (Relationship &rel) this->single_pk_column=rel.single_pk_column; } -QString Relationship::getInheritDefinition(bool undo_inherit) +QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) { - if(rel_type!=RELATIONSHIP_GEN) + if(rel_type != RELATIONSHIP_GEN && rel_type != RELATIONSHIP_PART) return(QString()); - attributes[ParsersAttributes::INHERIT]=(undo_inherit ? ParsersAttributes::UNSET : ParsersAttributes::_TRUE_); - attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); - attributes[ParsersAttributes::ANCESTOR_TABLE]=getReferenceTable()->getName(true); + attributes[ParsersAttributes::INHERIT]=QString(); + attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); + attributes[ParsersAttributes::PARTITIONED_TABLE]=QString(); + attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); + + if(rel_type == RELATIONSHIP_GEN) + { + attributes[ParsersAttributes::INHERIT]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::_TRUE_); + attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); + attributes[ParsersAttributes::ANCESTOR_TABLE]=getReferenceTable()->getName(true); + } + else + { + attributes[ParsersAttributes::PARTITIONING]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::_TRUE_); + attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); + attributes[ParsersAttributes::PARTITIONED_TABLE]=getReferenceTable()->getName(true); + attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=getReceiverTable()->getPartitionBoundingExpr(); + } return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes)); } diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index c624e86738..4c85d36dd8 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -497,7 +497,7 @@ class Relationship: public BaseRelationship { //! \brief Copies the attributes from one relationship to another void operator = (Relationship &rel); - QString getInheritDefinition(bool undo_inherit); + QString getAlterRelationshipDefinition(bool undo_inh_part); //! \brief Returns true when the reference table is mandatory in the relationship bool isReferenceTableMandatory(void); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 351a87a5da..ef317e0cb9 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -137,7 +137,7 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d comp_tab=src_table; } else if(diff_type==ObjectsDiffInfo::CREATE_OBJECT || - diff_type==ObjectsDiffInfo::ALTER_OBJECT) + diff_type==ObjectsDiffInfo::ALTER_OBJECT) { ref_tab=src_table; comp_tab=imp_table; @@ -177,8 +177,8 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d } /* If the object does not exists it will generate a drop info and the original - one (tab_obj) was not included by generalization (to avoid drop inherited columns) */ - else if(!aux_obj && !tab_obj->isAddedByGeneralization()) + one (tab_obj) was not included by generalization or partitioning (to avoid drop inherited/copied columns) */ + else if(!aux_obj && !tab_obj->isAddedByGeneralization() && !tab_obj->isAddedByCopy()) { if(diff_type!=ObjectsDiffInfo::DROP_OBJECT || (diff_type==ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OPT_DONT_DROP_MISSING_OBJS]) || @@ -264,7 +264,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) !diff_opts[OPT_KEEP_OBJ_PERMS])))) generateDiffInfo(diff_type, object); - //Processing relationship (in this case only generalization ones are considered) + //Processing relationship (in this case only generalization and patitioning ones are considered) else if(obj_type==OBJ_RELATIONSHIP) { Table *ref_tab=nullptr, *rec_tab=nullptr; @@ -272,15 +272,28 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) rec_tab=aux_model->getTable(rel->getReceiverTable()->getName(true)); - if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN) + if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN || + rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART) { - ref_tab=aux_model->getTable(rel->getReferenceTable()->getName(true)); + Relationship *aux_rel = nullptr; + + ref_tab = aux_model->getTable(rel->getReferenceTable()->getName(true)); + aux_rel = dynamic_cast(aux_model->getRelationship(ref_tab, rec_tab)); /* If the receiver table exists on the model generates a info for the relationship, otherwise, the generalization will be created automatically when the table is created (see table's code defintion) */ - if(rec_tab && !aux_model->getRelationship(ref_tab, rec_tab)) + if(rec_tab && !aux_rel) generateDiffInfo(diff_type, rel); + else if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART && + rec_tab && + aux_model == imported_model && + aux_rel && rel->getPartitionBoundingExpr().simplified() != + aux_rel->getPartitionBoundingExpr().simplified()) + { + generateDiffInfo(ObjectsDiffInfo::DROP_OBJECT, rel); + generateDiffInfo(ObjectsDiffInfo::CREATE_OBJECT, rel); + } } } else if(obj_type!=OBJ_PERMISSION) @@ -688,10 +701,11 @@ void ModelsDiffHelper::processDiffInfos(void) //Generating the DROP commands if(diff_type==ObjectsDiffInfo::DROP_OBJECT) { - if(rel && rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN) + if(rel && (rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN || + rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART)) { //Undoing inheritances - no_inherit_def+=rel->getInheritDefinition(true); + no_inherit_def+=rel->getAlterRelationshipDefinition(true); } else if(obj_type==OBJ_PERMISSION) //Unsetting permissions @@ -714,10 +728,11 @@ void ModelsDiffHelper::processDiffInfos(void) //Generating the CREATE commands else if(diff_type==ObjectsDiffInfo::CREATE_OBJECT) { - if(rel && rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN) + if(rel && (rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN || + rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART)) { //Creating inheritances - inherit_def+=rel->getInheritDefinition(false); + inherit_def+=rel->getAlterRelationshipDefinition(false); } else if(obj_type==OBJ_PERMISSION) //Setting permissions diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 9b09cd1ff2..42857e1c63 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -544,7 +544,7 @@ void RelationshipWidget::generateBoundingExpr(void) if(part_type == PartitioningType::list) tmpl = QString("IN (value)"); else if(part_type == PartitioningType::range) - tmpl = QString("FROM (value)\nTO (value)"); + tmpl = QString("FROM (value) TO (value)"); else tmpl = QString("WITH (MODULUS m, REMAINDER r)"); diff --git a/schemas/alter/relationship.sch b/schemas/alter/relationship.sch index 47619fb5e8..f3ab423f9d 100644 --- a/schemas/alter/relationship.sch +++ b/schemas/alter/relationship.sch @@ -3,11 +3,41 @@ # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -[ALTER TABLE ] {table} +%set {alter-table} [ALTER TABLE ] + +%if {partitioned-table} %then + + %if ({pgsql-ver} >=f "10.0") %then + + {alter-table} {partitioned-table} + + %if ({partitioning}=="unset") %then [ DETACH] %else [ ATTACH] %end + + [ PARTITION ] {table} + + %if ({partitioning}!="unset") %then + + %if {partition-bound-expr} %then + [ FOR VALUES ] {partition-bound-expr} + %else + [ DEFAULT] + %end + + %end + + %end + +%else + + {alter-table} {table} -%if ({inherit}=="unset") %then [ NO] %end + %if ({inherit}=="unset") %then [ NO] %end -[ INHERIT ] {ancestor-table} ; $br + [ INHERIT ] {ancestor-table} +%end + +; $br + [-- ddl-end --] $br From 6b4fa3153c33553eaf3a550c4b164df99b0284b3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 17 Oct 2018 17:11:10 -0300 Subject: [PATCH 152/425] Improved the diff process in such way to avoid generating unnecessary/ noise commands related to changing types of columns to integer and setting nextval() call as default value --- libpgmodeler_ui/src/modelsdiffhelper.cpp | 33 ++++++++++++++++-------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index ef317e0cb9..d5a617134a 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -285,6 +285,9 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) created (see table's code defintion) */ if(rec_tab && !aux_rel) generateDiffInfo(diff_type, rel); + /* Special case for partitioning: we detach (drop) and reattach (create) the partition + * if the partition bound expression differs from a model to another. This is done only + * if the receiver table (partition) exists in the imported model. */ else if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART && rec_tab && aux_model == imported_model && @@ -468,7 +471,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, ObjectsDiffInfo diff_info; /* If the info is for ALTER and there is a DROP info on the list, - the object will be recreated instead of modified */ + * the object will be recreated instead of modified */ if((!diff_opts[OPT_FORCE_RECREATION] || diff_opts[OPT_RECREATE_UNCHANGEBLE]) && diff_type==ObjectsDiffInfo::ALTER_OBJECT && isDiffInfoExists(ObjectsDiffInfo::DROP_OBJECT, old_object, nullptr) && @@ -485,9 +488,9 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, *old_col=dynamic_cast(old_object); /* Special case for columns marked with ALTER. - If the type of them is "serial" or similar then a sequence will be created and the - type of the column changed to "integer" or similar, this because the ALTER command - for columns don't accept the type "serial" */ + * If the type of them is "serial" or similar then a sequence will be created and the + * type of the column changed to "integer" or similar, this because the ALTER command + * for columns don't accept the type "serial" */ if(diff_type==ObjectsDiffInfo::ALTER_OBJECT && col && old_col && (col->getType()!=old_col->getType() && col->getType().isSerialType())) { @@ -511,11 +514,19 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, //Assigns the sequence to the column in order to configure the default value correctly aux_col->setSequence(seq); - //Creates a new ALTER info with the created column - diff_info=ObjectsDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, aux_col, col); - diff_infos.push_back(diff_info); - diffs_counter[ObjectsDiffInfo::ALTER_OBJECT]++; - emit s_objectsDiffInfoGenerated(diff_info); + /* Creates a new ALTER info with the created column onlly if we don't need to reuse sequences + * or if the sequence reusing is enabled but the type of the columns aren't equivalent or even + * the types are equivalent but the sequences used by each columns aren't the same */ + if(!diff_opts[OPT_REUSE_SEQUENCES] || + (diff_opts[OPT_REUSE_SEQUENCES] && + (!col->getType().getAliasType().isEquivalentTo(old_col->getType()) || + (old_col->getSequence() && old_col->getSequence()->getSignature() != seq->getSignature())))) + { + diff_info=ObjectsDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, aux_col, col); + diff_infos.push_back(diff_info); + diffs_counter[ObjectsDiffInfo::ALTER_OBJECT]++; + emit s_objectsDiffInfoGenerated(diff_info); + } if(!diff_opts[OPT_REUSE_SEQUENCES] || imported_model->getObjectIndex(seq->getSignature(), OBJ_SEQUENCE) < 0) { @@ -545,8 +556,8 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, } } - /* Stores the created objects in the temp list in order to be destroyed at the - end of the process. */ + /* Stores the created objects in the temp list in order to be destroyed + * at the end of the process. */ tmp_objects.push_back(aux_col); tmp_objects.push_back(seq); } From d27403d268e39f8cea63cffd5058af9486468a5e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 18 Oct 2018 14:49:10 -0300 Subject: [PATCH 153/425] Removed unused labels and fixed warning frame on ModelWidget Minor improvements on table's attributes display at DatabaseExplorerWidget --- .../src/databaseexplorerwidget.cpp | 3 ++- libpgmodeler_ui/src/modelwidget.cpp | 20 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 3eb13eda07..0e9307aee9 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -99,7 +99,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, {TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {IS_PARTITIONED, QT_TR_NOOP("Partitioned")}, {PARTITIONED_TABLE, QT_TR_NOOP("Partition of")}, {PARTITION_BOUND_EXPR, QT_TR_NOOP("Partition bound expr.")}, {DEAD_ROWS_AMOUNT, QT_TR_NOOP("Dead rows amount")}, - {PARTITION_KEY, QT_TR_NOOP("Partition keys")} + {PARTITION_KEY, QT_TR_NOOP("Partition keys")}, {PARTITIONING, QT_TR_NOOP("Partitioning")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) @@ -521,6 +521,7 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) ParsersAttributes::RLS_FORCED}); formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, OBJ_TABLE, true); + formatOidAttribs(attribs, { ParsersAttributes::PARTITIONED_TABLE }, OBJ_TABLE, false); part_keys.push_back(getObjectsNames(OBJ_COLUMN, Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]), diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index b53eea2f70..4efeabfe20 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -79,10 +79,8 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) QLabel *label=nullptr; QGridLayout *grid=nullptr; QAction *action=nullptr; - QString str_ico, str_txt; - QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen"), QString("part") }, - rel_labels={ trUtf8("One to One (1-1)"), trUtf8("One to Many (1-n)"), - trUtf8("Many to Many (n-n)"), trUtf8("Copy"), trUtf8("Inheritance"), trUtf8("Partitioning") }; + QString str_ico; + QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen"), QString("part") }; ObjectType types[]={ OBJ_TABLE, OBJ_VIEW, OBJ_TEXTBOX, OBJ_RELATIONSHIP, OBJ_CAST, OBJ_CONVERSION, OBJ_DOMAIN, OBJ_FUNCTION, OBJ_AGGREGATE, OBJ_LANGUAGE, @@ -110,17 +108,17 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) tmp_file.close(); protected_model_frm=new QFrame(this); - protected_model_frm->setGeometry(QRect(20, 10, 511, 48)); - protected_model_frm->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - protected_model_frm->setMinimumSize(QSize(0, 48)); - protected_model_frm->setMaximumHeight(48); + protected_model_frm->setGeometry(QRect(20, 10, 500, 25)); + protected_model_frm->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + protected_model_frm->setMinimumSize(QSize(0, 25)); protected_model_frm->setFrameShape(QFrame::StyledPanel); protected_model_frm->setFrameShadow(QFrame::Raised); protected_model_frm->setVisible(false); label=new QLabel(protected_model_frm); - label->setMinimumSize(QSize(32, 32)); - label->setMaximumSize(QSize(32, 32)); + label->setMinimumSize(QSize(20, 20)); + label->setMaximumSize(QSize(20, 20)); + label->setScaledContents(true); label->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); grid=new QGridLayout; @@ -152,7 +150,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) viewport=new QGraphicsView(scene); updateRenderHints(); - viewport->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); + viewport->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); //Force the scene to be drawn from the left to right and from top to bottom viewport->setAlignment(Qt::AlignLeft | Qt::AlignTop); From 63a9d251d579a1fffa15fa786068fc08636cff6a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 18 Oct 2018 15:49:55 -0300 Subject: [PATCH 154/425] Added a hint text on RelationshipWidget to document the correct use of default partitions --- libpgmodeler_ui/src/baseobjectwidget.cpp | 4 ++-- libpgmodeler_ui/src/relationshipwidget.cpp | 3 +++ libpgmodeler_ui/src/relationshipwidget.h | 3 ++- libpgmodeler_ui/src/tablewidget.cpp | 1 + libpgmodeler_ui/ui/relationshipwidget.ui | 3 +++ libpgmodeler_ui/ui/tablewidget.ui | 2 +- 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 0b40127641..ef63456131 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -601,8 +601,8 @@ void BaseObjectWidget::highlightVersionSpecificFields(mapsetStyleSheet(QString("QWidget { font-weight: bold; font-style: italic; color: %1}").arg(color.name())); - wgt->setToolTip(QString("") + - trUtf8("Version") + + wgt->setToolTip(QString("") + + trUtf8("Version ") + itr.first + QString(" %1").arg(field_name)); } } diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 42857e1c63..981c003926 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -50,6 +50,9 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent single_pk_ht=new HintTextWidget(single_pk_hint, this); single_pk_ht->setText(single_pk_chk->statusTip()); + default_part_ht=new HintTextWidget(default_part_hint, this); + default_part_ht->setText(default_part_chk->statusTip()); + table1_hl=nullptr; table1_hl=new SyntaxHighlighter(ref_table_txt, true); table1_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); diff --git a/libpgmodeler_ui/src/relationshipwidget.h b/libpgmodeler_ui/src/relationshipwidget.h index 8061f7c29d..046f84c4a5 100644 --- a/libpgmodeler_ui/src/relationshipwidget.h +++ b/libpgmodeler_ui/src/relationshipwidget.h @@ -42,7 +42,8 @@ class RelationshipWidget: public BaseObjectWidget, public Ui::RelationshipWidget SPECIAL_PK_TAB=4, ADVANCED_TAB=5; - HintTextWidget *gen_tab_name_ht, *ref_table_ht, *recv_table_ht, *identifier_ht, *single_pk_ht; + HintTextWidget *gen_tab_name_ht, *ref_table_ht, *recv_table_ht, + *identifier_ht, *single_pk_ht, *default_part_ht; ColorPickerWidget *color_picker; diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 7253192d0a..5889f63a98 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -54,6 +54,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_91)].push_back(unlogged_chk); fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(enable_rls_chk); fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(force_rls_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_100)].push_back(partitioning_type_lbl); frame=generateVersionWarningFrame(fields_map); table_grid->addWidget(frame, table_grid->count()+1, 0, 1, 2); frame->setParent(this); diff --git a/libpgmodeler_ui/ui/relationshipwidget.ui b/libpgmodeler_ui/ui/relationshipwidget.ui index b972ae0c56..5e012412d7 100644 --- a/libpgmodeler_ui/ui/relationshipwidget.ui +++ b/libpgmodeler_ui/ui/relationshipwidget.ui @@ -635,6 +635,9 @@ + + Default partitions are only supported on <strong>PostgreSQL 11+</strong>. Using this option and exporting the code to PostgreSQL 10 syntax errors will be raised. + Default partition diff --git a/libpgmodeler_ui/ui/tablewidget.ui b/libpgmodeler_ui/ui/tablewidget.ui index b4f0ada1c3..07dd20b804 100644 --- a/libpgmodeler_ui/ui/tablewidget.ui +++ b/libpgmodeler_ui/ui/tablewidget.ui @@ -200,7 +200,7 @@ 4 - + 0 From f365a48a66a5589d5f89b6d7dc5c8bcdbeb26d3c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 19 Oct 2018 09:04:08 -0300 Subject: [PATCH 155/425] Fixed a bug when importing columns which data types is some user defined type in form of array, e.g., custom_type[]. (issue #1189) --- libpgmodeler_ui/src/databaseimporthelper.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 2b396abfc9..b458b654ab 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1681,9 +1681,20 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(types.count(type_oid)!=0 && type_oid > catalog.getLastSysObjectOID()) { /* Building the type name prepending the schema name in order to search it on - the user defined types list at PgSQLType class */ + * the user defined types list at PgSQLType class */ type_name=BaseObject::formatName(getObjectName(types[type_oid][ParsersAttributes::SCHEMA], true), false); - type_name+=QString(".") + BaseObject::formatName(types[type_oid][ParsersAttributes::NAME], false); + type_name+=QString("."); + + if(types[type_oid][ParsersAttributes::CATEGORY] == ~CategoryType(CategoryType::array)) + { + int dim = types[type_oid][ParsersAttributes::NAME].count(QString("[]")); + QString aux_name = types[type_oid][ParsersAttributes::NAME].remove(QString("[]")); + type_name+=BaseObject::formatName(aux_name, false); + type_name+=QString("[]").repeated(dim); + } + else + type_name+=BaseObject::formatName(types[type_oid][ParsersAttributes::NAME], false); + is_type_registered=PgSQLType::isRegistered(type_name, dbmodel); } else From 5130cf56313c96fbb9f792f136cfd91368ffde19 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 19 Oct 2018 16:34:44 -0300 Subject: [PATCH 156/425] Added support to old/new tables aliases on triggers (issue #1178) --- conf/defaults/sql-highlight.conf | 3 + conf/sql-highlight.conf | 3 + libparsers/src/parsersattributes.cpp | 2 + libparsers/src/parsersattributes.h | 2 + libpgmodeler/src/databasemodel.cpp | 2 + libpgmodeler/src/trigger.cpp | 30 + libpgmodeler/src/trigger.h | 11 + libpgmodeler_ui/src/triggerwidget.cpp | 43 +- libpgmodeler_ui/src/triggerwidget.h | 1 + libpgmodeler_ui/ui/triggerwidget.ui | 761 +++++++++++++++----------- schemas/catalog/trigger.sch | 7 + schemas/sql/trigger.sch | 7 + schemas/xml/dtd/trigger.dtd | 2 + schemas/xml/trigger.sch | 6 + 14 files changed, 541 insertions(+), 339 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index a9ef32e006..d4e132424c 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -260,6 +260,7 @@ + @@ -279,6 +280,7 @@ + @@ -310,6 +312,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index a9ef32e006..d4e132424c 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -260,6 +260,7 @@ + @@ -279,6 +280,7 @@ + @@ -310,6 +312,7 @@ + diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 6996ebf456..42783185c3 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -315,6 +315,7 @@ namespace ParsersAttributes { NAMES=QString("names"), NEGATOR_OP=QString("negator-op"), NEW_NAME=QString("new-name"), + NEW_TABLE_NAME=QString("new-table-name"), NEW_IDENTITY_TYPE=QString("new-identity-type"), NEW_VERSION=QString("new-version"), NN_COLUMN=QString("nn-column"), @@ -333,6 +334,7 @@ namespace ParsersAttributes { OID=QString("oid"), OIDS=QString("oids"), OLD_NAME=QString("old-name"), + OLD_TABLE_NAME=QString("old-table-name"), OLD_VERSION=QString("old-version"), OP_CLASS=QString("opclass"), OP_CLASSES=QString("opclasses"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 1f8d7b5751..8d690e5f06 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -327,6 +327,7 @@ namespace ParsersAttributes { NAMES, NEGATOR_OP, NEW_NAME, + NEW_TABLE_NAME, NEW_IDENTITY_TYPE, NEW_VERSION, NN_COLUMN, @@ -345,6 +346,7 @@ namespace ParsersAttributes { OID, OIDS, OLD_NAME, + OLD_TABLE_NAME, OLD_VERSION, OP_CLASS, OP_CLASSES, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index fd6f130853..2fbaac97ce 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -5490,6 +5490,8 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setFiringType(FiringType(attribs[ParsersAttributes::FIRING_TYPE])); + trigger->setTransitionTableName(Trigger::OLD_TABLE_NAME, attribs[ParsersAttributes::OLD_TABLE_NAME]); + trigger->setTransitionTableName(Trigger::NEW_TABLE_NAME, attribs[ParsersAttributes::NEW_TABLE_NAME]); list_aux=attribs[ParsersAttributes::ARGUMENTS].split(','); count=list_aux.count(); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 0b26af80e2..e932d77e00 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -49,6 +49,8 @@ Trigger::Trigger(void) attributes[ParsersAttributes::DEFERRABLE]=QString(); attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); attributes[ParsersAttributes::CONSTRAINT]=QString(); + attributes[ParsersAttributes::OLD_TABLE_NAME]=QString(); + attributes[ParsersAttributes::NEW_TABLE_NAME]=QString(); } void Trigger::addArgument(const QString &arg) @@ -287,6 +289,23 @@ void Trigger::setConstraint(bool value) is_constraint=value; } +void Trigger::setTransitionTableName(unsigned tab_idx, const QString &name) +{ + if(tab_idx > NEW_TABLE_NAME) + throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + setCodeInvalidated(transition_tabs_names[tab_idx] != name); + transition_tabs_names[tab_idx] = name; +} + +QString Trigger::getTransitionTableName(unsigned tab_idx) +{ + if(tab_idx > NEW_TABLE_NAME) + throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + return(transition_tabs_names[tab_idx]); +} + bool Trigger::isConstraint(void) { return(is_constraint); @@ -403,6 +422,17 @@ QString Trigger::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::DEFERRABLE]=(is_deferrable ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::DEFER_TYPE]=(~deferral_type); + if(def_type == SchemaParser::XML_DEFINITION) + { + attributes[ParsersAttributes::OLD_TABLE_NAME]=transition_tabs_names[OLD_TABLE_NAME]; + attributes[ParsersAttributes::NEW_TABLE_NAME]=transition_tabs_names[NEW_TABLE_NAME]; + } + else + { + attributes[ParsersAttributes::OLD_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[OLD_TABLE_NAME]); + attributes[ParsersAttributes::NEW_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[NEW_TABLE_NAME]); + } + return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/trigger.h b/libpgmodeler/src/trigger.h index bc2d86dca2..4a0fdd05ec 100644 --- a/libpgmodeler/src/trigger.h +++ b/libpgmodeler/src/trigger.h @@ -31,6 +31,9 @@ class Trigger: public TableObject{ private: + //! \brief Stores the transtion tables names (OLD and NEW) [REFERENCING { OLD | NEW } TABLE name] + QString transition_tabs_names[2]; + //! \brief Arguments passed to the function that trigger executes vector arguments; @@ -73,6 +76,8 @@ class Trigger: public TableObject{ void setArgumentAttribute(unsigned tipo_def); public: + static constexpr unsigned OLD_TABLE_NAME=0, NEW_TABLE_NAME=1; + Trigger(void); /*! \brief Adds a column as a firing condition (only when the event UPDATE is used). @@ -112,6 +117,12 @@ class Trigger: public TableObject{ //! \brief Defines if the trigger is constraint void setConstraint(bool value); + //! \brief Defines the transition table name (OLD|NEW) referenced by the trigger + void setTransitionTableName(unsigned tab_idx, const QString &name); + + //! \brief Returns the transition table name (OLD|NEW) referenced by the trigger + QString getTransitionTableName(unsigned tab_idx); + //! \brief Returns true if the trigger executes on the passed event bool isExecuteOnEvent(EventType event); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index d619ad9466..427f4b0a4d 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -40,8 +40,7 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TRIG function_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); ref_table_sel->setEnabled(false); - trigger_grid->addWidget(function_sel, 2, 2, 1, 1); - trigger_grid->addWidget(ref_table_sel, 6, 2, 1, 1); + trigger_grid->addWidget(function_sel, 3, 1, 1, 5); columns_tab->setColumnCount(2); columns_tab->setHeaderLabel(trUtf8("Column"), 0); @@ -51,6 +50,7 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TRIG dynamic_cast(arg_cols_tbw->widget(1)->layout())->addWidget(columns_tab, 1,0,1,3); dynamic_cast(arg_cols_tbw->widget(0)->layout())->addWidget(arguments_tab, 1,0,1,3); + dynamic_cast(arg_cols_tbw->widget(2)->layout())->addWidget(ref_table_sel, 1, 1, 1, 1); DeferralType::getTypes(list); deferral_type_cmb->addItems(list); @@ -67,15 +67,21 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TRIG connect(arguments_tab, SIGNAL(s_rowAdded(int)), this, SLOT(handleArgument(int))); connect(arguments_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(handleArgument(int))); connect(arguments_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editArgument(int))); - connect(constr_trig_chk, SIGNAL(toggled(bool)), this, SLOT(setConstraintTrigger(bool))); + connect(constraint_rb, SIGNAL(toggled(bool)), this, SLOT(setConstraintTrigger(bool))); connect(update_chk, SIGNAL(toggled(bool)), this, SLOT(selectUpdateEvent(void))); + connect(insert_chk, SIGNAL(toggled(bool)), this, SLOT(enableTransitionTableNames())); + connect(delete_chk, SIGNAL(toggled(bool)), this, SLOT(enableTransitionTableNames())); + connect(update_chk, SIGNAL(toggled(bool)), this, SLOT(enableTransitionTableNames())); + connect(truncate_chk, SIGNAL(toggled(bool)), this, SLOT(enableTransitionTableNames())); + connect(firing_mode_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableTransitionTableNames())); + setRequiredField(event_lbl); setRequiredField(firing_mode_lbl); setRequiredField(function_lbl); setRequiredField(function_sel); - setMinimumSize(580, 580); + setMinimumSize(580, 500); } catch(Exception &e) { @@ -112,6 +118,26 @@ void TriggerWidget::setConstraintTrigger(bool value) firing_mode_cmb->setCurrentText(~FiringType(FiringType::after)); } +void TriggerWidget::enableTransitionTableNames(void) +{ + int num_evnts = 0; + QWidget *wgt = nullptr; + QCheckBox *chk = nullptr; + FiringType firing_type = firing_mode_cmb->currentText(); + + for(auto &obj : events_wgt->children()) + { + wgt = qobject_cast(obj); + chk = dynamic_cast(wgt); + + if(chk && chk->isChecked()) + num_evnts++; + } + + old_table_edt->setEnabled(firing_type == FiringType::after && num_evnts == 1 && (update_chk->isChecked() || delete_chk->isChecked())); + new_table_edt->setEnabled(firing_type == FiringType::after && num_evnts == 1 && (update_chk->isChecked() || insert_chk->isChecked())); +} + void TriggerWidget::addColumn(int lin_idx) { Column *column=nullptr; @@ -203,7 +229,7 @@ void TriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, if(trigger) { - constr_trig_chk->setChecked(trigger->isConstraint()); + constraint_rb->setChecked(trigger->isConstraint()); exec_per_row_chk->setChecked(trigger->isExecutePerRow()); cond_expr_txt->setPlainText(trigger->getCondition()); @@ -239,6 +265,9 @@ void TriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, columns_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (column_cmb->count()!=0)); arguments_tab->blockSignals(false); columns_tab->blockSignals(false); + + old_table_edt->setText(trigger->getTransitionTableName(Trigger::OLD_TABLE_NAME)); + new_table_edt->setText(trigger->getTransitionTableName(Trigger::NEW_TABLE_NAME)); } updateColumnsCombo(); @@ -255,7 +284,7 @@ void TriggerWidget::applyConfiguration(void) startConfiguration(); trigger=dynamic_cast(this->object); - trigger->setConstraint(constr_trig_chk->isChecked()); + trigger->setConstraint(constraint_rb->isChecked()); trigger->setFiringType(FiringType(firing_mode_cmb->currentText())); trigger->setExecutePerRow(exec_per_row_chk->isChecked()); trigger->setDeferrable(deferrable_chk->isChecked()); @@ -267,6 +296,8 @@ void TriggerWidget::applyConfiguration(void) trigger->setEvent(EventType::on_update, update_chk->isChecked()); trigger->setEvent(EventType::on_delete, delete_chk->isChecked()); trigger->setEvent(EventType::on_truncate, truncate_chk->isChecked()); + trigger->setTransitionTableName(Trigger::OLD_TABLE_NAME, old_table_edt->isEnabled() ? old_table_edt->text() : QString()); + trigger->setTransitionTableName(Trigger::NEW_TABLE_NAME, new_table_edt->isEnabled() ? new_table_edt->text() : QString()); trigger->removeArguments(); trigger->removeColumns(); diff --git a/libpgmodeler_ui/src/triggerwidget.h b/libpgmodeler_ui/src/triggerwidget.h index 1b80954709..6c72f38420 100644 --- a/libpgmodeler_ui/src/triggerwidget.h +++ b/libpgmodeler_ui/src/triggerwidget.h @@ -59,6 +59,7 @@ class TriggerWidget: public BaseObjectWidget, public Ui::TriggerWidget { void editArgument(int lin_idx); void updateColumnsCombo(void); void setConstraintTrigger(bool value); + void enableTransitionTableNames(void); public slots: void applyConfiguration(void); diff --git a/libpgmodeler_ui/ui/triggerwidget.ui b/libpgmodeler_ui/ui/triggerwidget.ui index 39e8d22090..03422827fb 100644 --- a/libpgmodeler_ui/ui/triggerwidget.ui +++ b/libpgmodeler_ui/ui/triggerwidget.ui @@ -6,8 +6,8 @@ 0 0 - 511 - 347 + 765 + 419 @@ -29,150 +29,7 @@ 4 - - 6 - - - - - - - - 0 - 0 - - - - Constraint - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Deferrable: - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - - - - - - - - - true - - - - 0 - 0 - - - - - 113 - 0 - - - - - 16777215 - 16777215 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 5 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - FOR EACH ROW - - - - - - + @@ -193,171 +50,24 @@ - Event: + Events: - - - - QLayout::SetDefaultConstraint - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - INSERT - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - DELETE - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - UPDATE - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - TRUNCATE - - - - - - - - - false - + + 0 0 - - - 0 - 0 - - - - - 16777215 - 16777215 - - - Refer. Table: + Type: - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Condition: - - - - + 0 @@ -467,13 +177,357 @@ + + + Constraint + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Options: + + + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Deferrable: + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + QFrame::Sunken + + + 1 + + + 0 + + + Qt::ScrollBarAsNeeded + + + Qt::ScrollBarAsNeeded + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Refer. Table: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Condition: + + + + + - - - + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + INSERT + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + DELETE + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + UPDATE + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + TRUNCATE + + + + + + + + + + + 0 + 0 + + + + Ordinary trigger + + true + + + + + + + 0 + 0 + + + + Constraint trigger + + + + + 0 @@ -493,12 +547,12 @@ - Function: + FOR EACH ROW - - + + true @@ -520,12 +574,9 @@ 16777215 - - Options: - - + true @@ -553,10 +604,13 @@ - - + + + + true + - + 0 0 @@ -564,45 +618,86 @@ 0 - 50 + 0 16777215 - 90 + 16777215 - - QFrame::Sunken - - - 1 - - - 0 + + Function: - - Qt::ScrollBarAsNeeded + + + + + + + 0 + 0 + - - Qt::ScrollBarAsNeeded + + Transition tables names + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 180 + 0 + + + + + + + + OLD: + + + + + + + NEW: + + + + + + + + 180 + 0 + + + + + - firing_mode_cmb - exec_per_row_chk - insert_chk - delete_chk - update_chk - truncate_chk - constr_trig_chk deferrable_chk deferral_type_cmb - cond_expr_txt arg_cols_tbw argument_edt column_cmb diff --git a/schemas/catalog/trigger.sch b/schemas/catalog/trigger.sch index 6a990369e2..dd76237ad4 100644 --- a/schemas/catalog/trigger.sch +++ b/schemas/catalog/trigger.sch @@ -75,6 +75,13 @@ regexp_replace(regexp_replace(pg_get_triggerdef(tg.oid), '(.)+((INSERT|DELETE|UPDATE)|( OF))', ''), '( ON)(.)*','') ELSE NULL END AS columns, ] + + + %if ({pgsql-ver} >= "10.0") %then + [ tgoldtable AS old_table_name, tgnewtable AS new_table_name, ] + %else + [ NULL AS old_table_name, NULL AS new_table_name, ] + %end ({comment}) [ AS comment ] diff --git a/schemas/sql/trigger.sch b/schemas/sql/trigger.sch index 027449e911..e3c6cb3116 100644 --- a/schemas/sql/trigger.sch +++ b/schemas/sql/trigger.sch @@ -31,6 +31,13 @@ $tb [ON ] {table} $br %end %end +%if {old-table-name} %or {new-table-name} %and ({pgsql-ver} >=f "10.0") %then + $tb REFERENCING + %if {old-table-name} %then [ OLD TABLE AS ] {old-table-name} %end + %if {new-table-name} %then [ NEW TABLE AS ] {new-table-name} %end + $br +%end + $tb [FOR EACH ] %if {per-line} %then ROW %else STATEMENT %end $br %if {condition} %then $tb WHEN $sp ({condition}) $br %end diff --git a/schemas/xml/dtd/trigger.dtd b/schemas/xml/dtd/trigger.dtd index 8781a9b2bb..6c6f8672f9 100644 --- a/schemas/xml/dtd/trigger.dtd +++ b/schemas/xml/dtd/trigger.dtd @@ -19,3 +19,5 @@ + + diff --git a/schemas/xml/trigger.sch b/schemas/xml/trigger.sch index bcfb0738a2..8ab1a32da7 100644 --- a/schemas/xml/trigger.sch +++ b/schemas/xml/trigger.sch @@ -43,6 +43,12 @@ %if {sql-disabled} %then [ sql-disabled=] "true" %end + + %if {old-table-name} %or {new-table-name} %then + $br $tb + %if {old-table-name} %then [ old-table-name=] "{old-table-name}" %end + %if {new-table-name} %then [ new-table-name=] "{new-table-name}" %end + %end > $br %if {comment} %then $tb {comment} %end From 129b7f4ed19598c365504972621d7004e2fca4ff Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 14:25:45 -0300 Subject: [PATCH 157/425] Minor code refactoring to make it more close to C++11 --- crashhandler/src/crashhandlerform.cpp | 18 +- crashhandler/src/crashhandlerform.h | 2 +- crashhandler/src/main.cpp | 2 +- libobjrenderer/src/baseobjectview.cpp | 16 +- libobjrenderer/src/basetableview.cpp | 2 +- libobjrenderer/src/basetableview.h | 2 +- libobjrenderer/src/objectsscene.cpp | 2 +- libobjrenderer/src/objectsscene.h | 2 +- libobjrenderer/src/relationshipview.cpp | 6 +- libobjrenderer/src/relationshipview.h | 2 +- libobjrenderer/src/roundedrectitem.h | 2 +- libobjrenderer/src/tableobjectview.cpp | 4 +- libobjrenderer/src/tabletitleview.cpp | 4 +- libobjrenderer/src/tableview.cpp | 4 +- libparsers/src/attribsmap.h | 2 +- libparsers/src/schemaparser.cpp | 130 ++--- libparsers/src/schemaparser.h | 2 +- libparsers/src/xmlparser.cpp | 38 +- libparsers/src/xmlparser.h | 2 +- libpgconnector/src/catalog.cpp | 12 +- libpgconnector/src/catalog.h | 2 +- libpgconnector/src/connection.cpp | 40 +- libpgconnector/src/connection.h | 2 +- libpgconnector/src/resultset.cpp | 34 +- libpgconnector/src/resultset.h | 2 +- libpgmodeler/src/aggregate.cpp | 16 +- libpgmodeler/src/aggregate.h | 2 +- libpgmodeler/src/baseobject.cpp | 80 +-- libpgmodeler/src/baseobject.h | 6 +- libpgmodeler/src/baserelationship.cpp | 18 +- libpgmodeler/src/baserelationship.h | 6 +- libpgmodeler/src/cast.cpp | 26 +- libpgmodeler/src/cast.h | 2 +- libpgmodeler/src/collation.cpp | 10 +- libpgmodeler/src/collation.h | 2 +- libpgmodeler/src/column.cpp | 22 +- libpgmodeler/src/constraint.cpp | 32 +- libpgmodeler/src/constraint.h | 4 +- libpgmodeler/src/conversion.cpp | 24 +- libpgmodeler/src/conversion.h | 2 +- libpgmodeler/src/copyoptions.cpp | 8 +- libpgmodeler/src/copyoptions.h | 2 +- libpgmodeler/src/databasemodel.cpp | 428 +++++++-------- libpgmodeler/src/databasemodel.h | 2 +- libpgmodeler/src/domain.cpp | 10 +- libpgmodeler/src/element.cpp | 4 +- libpgmodeler/src/element.h | 2 +- libpgmodeler/src/eventtrigger.cpp | 14 +- libpgmodeler/src/extension.cpp | 10 +- libpgmodeler/src/extension.h | 2 +- libpgmodeler/src/function.cpp | 36 +- libpgmodeler/src/index.cpp | 24 +- libpgmodeler/src/index.h | 2 +- libpgmodeler/src/language.cpp | 12 +- libpgmodeler/src/language.h | 2 +- libpgmodeler/src/operation.h | 4 +- libpgmodeler/src/operationlist.cpp | 32 +- libpgmodeler/src/operator.cpp | 36 +- libpgmodeler/src/operator.h | 2 +- libpgmodeler/src/operatorclass.cpp | 6 +- libpgmodeler/src/operatorclasselement.cpp | 10 +- libpgmodeler/src/operatorclasselement.h | 2 +- libpgmodeler/src/parameter.cpp | 4 +- libpgmodeler/src/permission.cpp | 20 +- libpgmodeler/src/permission.h | 2 +- libpgmodeler/src/pgmodelerns.cpp | 4 +- libpgmodeler/src/pgmodelerns.h | 4 +- libpgmodeler/src/pgsqltypes.cpp | 22 +- libpgmodeler/src/pgsqltypes.h | 310 +++++------ libpgmodeler/src/policy.cpp | 8 +- libpgmodeler/src/reference.cpp | 12 +- libpgmodeler/src/reference.h | 4 +- libpgmodeler/src/relationship.cpp | 124 ++--- libpgmodeler/src/relationship.h | 14 +- libpgmodeler/src/role.cpp | 34 +- libpgmodeler/src/role.h | 4 +- libpgmodeler/src/rule.cpp | 6 +- libpgmodeler/src/schema.cpp | 4 +- libpgmodeler/src/sequence.cpp | 36 +- libpgmodeler/src/table.cpp | 68 +-- libpgmodeler/src/tablespace.cpp | 6 +- libpgmodeler/src/tag.cpp | 12 +- libpgmodeler/src/tag.h | 2 +- libpgmodeler/src/textbox.cpp | 4 +- libpgmodeler/src/textbox.h | 2 +- libpgmodeler/src/trigger.cpp | 54 +- libpgmodeler/src/type.cpp | 80 +-- libpgmodeler/src/type.h | 4 +- libpgmodeler/src/view.cpp | 36 +- libpgmodeler_ui/src/aboutwidget.cpp | 4 +- libpgmodeler_ui/src/aggregatewidget.cpp | 2 +- .../src/appearanceconfigwidget.cpp | 12 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 64 +-- libpgmodeler_ui/src/baseobjectwidget.cpp | 16 +- libpgmodeler_ui/src/baseobjectwidget.h | 4 +- libpgmodeler_ui/src/bugreportform.cpp | 24 +- libpgmodeler_ui/src/bugreportform.h | 2 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 2 +- libpgmodeler_ui/src/colorpickerwidget.cpp | 10 +- libpgmodeler_ui/src/colorpickerwidget.h | 2 +- libpgmodeler_ui/src/columnwidget.cpp | 10 +- libpgmodeler_ui/src/configurationform.cpp | 4 +- libpgmodeler_ui/src/configurationform.h | 2 +- .../src/connectionsconfigwidget.cpp | 26 +- libpgmodeler_ui/src/constraintwidget.cpp | 14 +- libpgmodeler_ui/src/csvloadwidget.cpp | 4 +- libpgmodeler_ui/src/customsqlwidget.cpp | 8 +- .../src/databaseexplorerwidget.cpp | 18 +- libpgmodeler_ui/src/databaseimportform.cpp | 2 +- libpgmodeler_ui/src/databaseimportform.h | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 26 +- libpgmodeler_ui/src/datamanipulationform.cpp | 19 +- libpgmodeler_ui/src/datamanipulationform.h | 7 +- libpgmodeler_ui/src/domainwidget.cpp | 2 +- libpgmodeler_ui/src/donatewidget.cpp | 2 +- libpgmodeler_ui/src/elementwidget.cpp | 8 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 2 +- libpgmodeler_ui/src/findreplacewidget.cpp | 2 +- libpgmodeler_ui/src/functionwidget.cpp | 16 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 34 +- libpgmodeler_ui/src/generalconfigwidget.h | 2 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 2 +- libpgmodeler_ui/src/hinttextwidget.cpp | 2 +- libpgmodeler_ui/src/hinttextwidget.h | 2 +- libpgmodeler_ui/src/indexwidget.cpp | 8 +- libpgmodeler_ui/src/linenumberswidget.cpp | 2 +- libpgmodeler_ui/src/mainwindow.cpp | 24 +- libpgmodeler_ui/src/mainwindow.h | 8 +- libpgmodeler_ui/src/messagebox.h | 4 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 6 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 10 +- libpgmodeler_ui/src/modeldatabasediffform.h | 2 +- libpgmodeler_ui/src/modelexportform.cpp | 4 +- libpgmodeler_ui/src/modelexporthelper.cpp | 24 +- libpgmodeler_ui/src/modelfixform.cpp | 4 +- libpgmodeler_ui/src/modelfixform.h | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 2 +- libpgmodeler_ui/src/modelrestorationform.cpp | 10 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 16 +- libpgmodeler_ui/src/modelsdiffhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 4 +- libpgmodeler_ui/src/modelvalidationwidget.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 70 +-- libpgmodeler_ui/src/modelwidget.h | 8 +- libpgmodeler_ui/src/numberedtexteditor.cpp | 14 +- libpgmodeler_ui/src/objectdepsrefswidget.cpp | 2 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 10 +- libpgmodeler_ui/src/objectsdiffinfo.cpp | 10 +- libpgmodeler_ui/src/objectsdiffinfo.h | 10 +- libpgmodeler_ui/src/objectselectorwidget.cpp | 2 +- libpgmodeler_ui/src/objectstablewidget.cpp | 22 +- libpgmodeler_ui/src/objectstablewidget.h | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 4 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 2 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 2 +- libpgmodeler_ui/src/permissionwidget.cpp | 10 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 8 +- libpgmodeler_ui/src/pgmodeleruins.h | 2 +- libpgmodeler_ui/src/pgsqltypewidget.cpp | 4 +- libpgmodeler_ui/src/pluginsconfigwidget.cpp | 16 +- libpgmodeler_ui/src/policywidget.cpp | 6 +- libpgmodeler_ui/src/referencewidget.cpp | 4 +- .../src/relationshipconfigwidget.cpp | 24 +- libpgmodeler_ui/src/relationshipwidget.cpp | 18 +- libpgmodeler_ui/src/relationshipwidget.h | 2 +- libpgmodeler_ui/src/rolewidget.cpp | 14 +- libpgmodeler_ui/src/rulewidget.cpp | 6 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 20 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 10 +- libpgmodeler_ui/src/sourcecodewidget.h | 2 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 92 ++-- libpgmodeler_ui/src/sqltoolwidget.cpp | 2 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 4 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 40 +- libpgmodeler_ui/src/syntaxhighlighter.h | 2 +- libpgmodeler_ui/src/tabledatawidget.cpp | 4 +- libpgmodeler_ui/src/tablewidget.cpp | 18 +- libpgmodeler_ui/src/triggerwidget.cpp | 4 +- libpgmodeler_ui/src/updatenotifierwidget.cpp | 10 +- libpgmodeler_ui/src/validationinfo.cpp | 4 +- libpgmodeler_ui/src/validationinfo.h | 2 +- libpgmodeler_ui/src/viewwidget.cpp | 10 +- libutils/src/exception.cpp | 507 +++++++++--------- libutils/src/exception.h | 501 +++++++++-------- libutils/src/globalattributes.cpp | 142 ++--- libutils/src/globalattributes.h | 120 ++--- libutils/src/pgsqlversions.cpp | 32 +- libutils/src/pgsqlversions.h | 22 +- main-cli/src/main.cpp | 4 +- main-cli/src/pgmodelercli.cpp | 88 +-- main/src/application.cpp | 64 +-- main/src/main.cpp | 14 +- plugins/dummy/src/dummy.cpp | 6 +- plugins/xml2object/src/xml2object.cpp | 8 +- plugins/xml2object/src/xml2objectwidget.cpp | 6 +- .../databasemodeltest/databasemodeltest.cpp | 10 +- .../partrelationshiptest.cpp | 4 +- .../syntaxhighlightertest.cpp | 2 +- 198 files changed, 2311 insertions(+), 2323 deletions(-) diff --git a/crashhandler/src/crashhandlerform.cpp b/crashhandler/src/crashhandlerform.cpp index 64452c5fad..e149b2b68d 100644 --- a/crashhandler/src/crashhandlerform.cpp +++ b/crashhandler/src/crashhandlerform.cpp @@ -44,9 +44,9 @@ CrashHandlerForm::CrashHandlerForm(bool analysis_mode, QWidget *parent, Qt::Wind report_twg->addTab(wgt, trUtf8("Stack trace")); //Open for reading the stack trace file generated on the last crash - input.setFileName(GlobalAttributes::TEMPORARY_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::STACKTRACE_FILE); + input.setFileName(GlobalAttributes::TemporaryDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::StacktraceFile); input.open(QFile::ReadOnly); if(input.isOpen()) @@ -56,9 +56,9 @@ CrashHandlerForm::CrashHandlerForm(bool analysis_mode, QWidget *parent, Qt::Wind //Removes the stack trace file QDir stack_file; - stack_file.remove(GlobalAttributes::TEMPORARY_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::STACKTRACE_FILE); + stack_file.remove(GlobalAttributes::TemporaryDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::StacktraceFile); //Shows the stacktrace loaded on the widget stack_txt->setPlainText(buf); @@ -125,7 +125,7 @@ void CrashHandlerForm::loadReport(const QString &filename) //Raises an error if the file could not be opened if(!input.isOpen()) - msgbox.show(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(filename), Messagebox::ERROR_ICON); + msgbox.show(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(filename), Messagebox::ERROR_ICON); else { QByteArray uncomp_buf; @@ -210,8 +210,8 @@ void CrashHandlerForm::saveModel(void) output.open(QFile::WriteOnly); if(!output.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(file_dlg.selectedFiles().at(0)), - ERR_FILE_DIR_NOT_WRITTEN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(file_dlg.selectedFiles().at(0)), + FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf.append(model_txt->toPlainText()); output.write(buf.data(),buf.size()); diff --git a/crashhandler/src/crashhandlerform.h b/crashhandler/src/crashhandlerform.h index c30f913798..db037f6183 100644 --- a/crashhandler/src/crashhandlerform.h +++ b/crashhandler/src/crashhandlerform.h @@ -59,7 +59,7 @@ class CrashHandlerForm: public BugReportForm { public: //! \brief Analysis mode argument - const static QString ANALYSIS_MODE; + static const QString ANALYSIS_MODE; CrashHandlerForm(bool analysis_mode=false, QWidget * parent = 0, Qt::WindowFlags f = 0); diff --git a/crashhandler/src/main.cpp b/crashhandler/src/main.cpp index 902b7ca630..f39eeb5354 100644 --- a/crashhandler/src/main.cpp +++ b/crashhandler/src/main.cpp @@ -30,7 +30,7 @@ int main(int argc, char **argv) QTranslator translator; //Loads the ui translation for crashhandler - translator.load(QLocale::system().name(), GlobalAttributes::LANGUAGES_DIR); + translator.load(QLocale::system().name(), GlobalAttributes::LanguagesDir); app.installTranslator(&translator); CrashHandlerForm crashhandler(args.size() > 1 && args[1]==CrashHandlerForm::ANALYSIS_MODE); diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index b1d3a7b3b2..ce4ea29840 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -208,19 +208,19 @@ void BaseObjectView::loadObjectsStyle(void) map::iterator itr; QStringList list; QString elem, - config_file=GlobalAttributes::CONFIGURATIONS_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::OBJECTS_STYLE_CONF + GlobalAttributes::CONFIGURATION_EXT; + config_file=GlobalAttributes::ConfigurationsDir + GlobalAttributes::DirSeparator + + GlobalAttributes::ObjectsStyleConf + GlobalAttributes::ConfigurationExt; XMLParser xmlparser; try { xmlparser.restartParser(); - xmlparser.setDTDFile(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::OBJECT_DTD_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::OBJECTS_STYLE_CONF + - GlobalAttributes::OBJECT_DTD_EXT, GlobalAttributes::OBJECTS_STYLE_CONF); + xmlparser.setDTDFile(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::ObjectDTDDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::ObjectsStyleConf + + GlobalAttributes::ObjectDTDExt, GlobalAttributes::ObjectsStyleConf); xmlparser.loadXMLFile(config_file); if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index a5a2f8056e..1c355f60f0 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -24,7 +24,7 @@ bool BaseTableView::hide_tags=false; BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) { if(!base_tab) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); body=new RoundedRectItem; body->setRoundedCorners(RoundedRectItem::BOTTOMLEFT_CORNER | RoundedRectItem::BOTTOMRIGHT_CORNER); diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 67b6b75f06..494b1cbd87 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -88,7 +88,7 @@ class BaseTableView: public BaseObjectView { float calculateWidth(void); public: - static const unsigned LEFT_CONN_POINT=0, + static constexpr unsigned LEFT_CONN_POINT=0, RIGHT_CONN_POINT=1; BaseTableView(BaseTable *base_tab); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 64bb7337a9..4d36393b26 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -350,7 +350,7 @@ void ObjectsScene::getPaperConfiguration(QPrinter::PaperSize &paper_sz, QPrinter void ObjectsScene::configurePrinter(QPrinter *printer) { if(!printer) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(paper_size!=QPrinter::Custom) printer->setPaperSize(paper_size); diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index ff080597e4..1d93538de2 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -49,7 +49,7 @@ class ObjectsScene: public QGraphicsScene { //! \brief Indicates if the scene need to be moved bool move_scene; - static const int SCENE_MOVE_STEP=20, + static constexpr int SCENE_MOVE_STEP=20, SCENE_MOVE_TIMEOUT=50, SCENE_MOVE_THRESHOLD=30; diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index afd74427fe..8b0f1af11a 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -26,7 +26,7 @@ unsigned RelationshipView::line_conn_mode=RelationshipView::CONNECT_FK_TO_PK; RelationshipView::RelationshipView(BaseRelationship *rel) : BaseObjectView(rel) { if(!rel) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); for(unsigned i=BaseRelationship::SRC_CARD_LABEL; i <= BaseRelationship::REL_NAME_LABEL; i++) @@ -199,7 +199,7 @@ unsigned RelationshipView::getLineConnectinMode(void) QPointF RelationshipView::getConnectionPoint(unsigned table_idx) { if(table_idx > 2) - throw Exception(ERR_REF_ELEM_INV_INDEX ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(conn_points[table_idx]); } @@ -1984,7 +1984,7 @@ void RelationshipView::configureLabels(void) void RelationshipView::configureLabelPosition(unsigned label_id, double x, double y) { if(label_id > BaseRelationship::REL_NAME_LABEL) - throw Exception(ERR_REF_OBJ_INV_INDEX ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(labels[label_id]) { diff --git a/libobjrenderer/src/relationshipview.h b/libobjrenderer/src/relationshipview.h index 624403c5d4..aa1a51e819 100644 --- a/libobjrenderer/src/relationshipview.h +++ b/libobjrenderer/src/relationshipview.h @@ -158,7 +158,7 @@ class RelationshipView: public BaseObjectView { void configureObject(void); public: - static const unsigned CONNECT_CENTER_PNTS=0, + static constexpr unsigned CONNECT_CENTER_PNTS=0, CONNECT_FK_TO_PK=1, CONNECT_TABLE_EGDES=2; diff --git a/libobjrenderer/src/roundedrectitem.h b/libobjrenderer/src/roundedrectitem.h index 7c51cf9198..b1d0ddc294 100644 --- a/libobjrenderer/src/roundedrectitem.h +++ b/libobjrenderer/src/roundedrectitem.h @@ -51,7 +51,7 @@ class RoundedRectItem: public QGraphicsRectItem { public: //! \brief Implies a normal rectangle (no rounded corner) - static const unsigned NO_CORNERS=0, + static constexpr unsigned NO_CORNERS=0, //! \brief The top-left corner will be rounded TOPLEFT_CORNER=2, diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 1cb2c5b1d3..cde7869a76 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -527,7 +527,7 @@ void TableObjectView::configureObject(Reference reference) void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) { if(obj_idx >= 4) - throw Exception(ERR_REF_OBJ_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefObjectInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); if(obj_idx==0) descriptor->setPos(px, descriptor->pos().y()); @@ -538,7 +538,7 @@ void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) QGraphicsItem *TableObjectView::getChildObject(unsigned obj_idx) { if(obj_idx >= 4) - throw Exception(ERR_REF_OBJ_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefObjectInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); if(obj_idx==0) return(descriptor); diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index de55e82b3d..294667cd53 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -58,11 +58,11 @@ void TableTitleView::configureObject(BaseGraphicObject *object) //Raises an error if the object related to the title is not allocated if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(OprNotAllocatedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Raises an error if the object is invalid else if(object->getObjectType()!=OBJ_TABLE && object->getObjectType()!=OBJ_VIEW) - throw Exception(ERR_OPR_OBJ_INV_TYPE, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(OprObjectInvalidType, __PRETTY_FUNCTION__, __FILE__, __LINE__); schema=dynamic_cast(object->getSchema()); tag=dynamic_cast(object)->getTag(); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 79ea070b3f..c321c59124 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -231,9 +231,9 @@ void TableView::configureObject(void) QPointF TableView::getConnectionPoints(TableObject *tab_obj, unsigned pnt_type) { if(!tab_obj) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(pnt_type > RIGHT_CONN_POINT) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(conn_points.count(tab_obj)==0) //Returns the center point in case of the connection point of the table object wasn't calculated already return(this->getCenter()); diff --git a/libparsers/src/attribsmap.h b/libparsers/src/attribsmap.h index 39c05b51a7..fc68c8159d 100644 --- a/libparsers/src/attribsmap.h +++ b/libparsers/src/attribsmap.h @@ -28,5 +28,5 @@ to store objects attributes and used by SchemaParser, XMLParser and several othe #include #include -typedef std::map attribs_map; +using attribs_map = std::map; #endif diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 3c158ccd8d..42d22a43a5 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -65,26 +65,26 @@ SchemaParser::SchemaParser(void) { line=column=comment_count=0; ignore_unk_atribs=ignore_empty_atribs=false; - pgsql_version=PgSQLVersions::DEFAULT_VERSION; + pgsql_version=PgSQLVersions::DefaulVersion; } void SchemaParser::setPgSQLVersion(const QString &pgsql_ver) { unsigned curr_ver = QString(pgsql_ver).remove('.').toUInt(), - version90 = QString(PgSQLVersions::PGSQL_VERSION_90).remove('.').toUInt(), - default_ver = QString(PgSQLVersions::DEFAULT_VERSION).remove('.').toUInt(); + version90 = QString(PgSQLVersions::PgSQLVersion90).remove('.').toUInt(), + default_ver = QString(PgSQLVersions::DefaulVersion).remove('.').toUInt(); if(curr_ver != 0 && (curr_ver < version90)) - throw Exception(Exception::getErrorMessage(ERR_INV_POSTGRESQL_VERSION) + throw Exception(Exception::getErrorMessage(ErrorType::InvPostgreSQLVersion) .arg(pgsql_ver) - .arg(PgSQLVersions::PGSQL_VERSION_90) - .arg(PgSQLVersions::DEFAULT_VERSION), - ERR_INV_POSTGRESQL_VERSION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + .arg(PgSQLVersions::PgSQLVersion90) + .arg(PgSQLVersions::DefaulVersion), + InvPostgreSQLVersion,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(curr_ver > 0 && curr_ver <= default_ver) pgsql_version=pgsql_ver; else - pgsql_version=PgSQLVersions::DEFAULT_VERSION; + pgsql_version=PgSQLVersions::DefaulVersion; } QString SchemaParser::getPgSQLVersion(void) @@ -187,8 +187,8 @@ void SchemaParser::loadFile(const QString &filename) input.open(QFile::ReadOnly); if(!input.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(filename), - ERR_FILE_DIR_NOT_ACCESSED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorType::FileDirectoryNotAccessed).arg(filename), + ErrorType::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf=input.readAll(); input.close(); @@ -245,15 +245,15 @@ QString SchemaParser::getAttribute(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!ATTR_REGEXP.exactMatch(atrib)) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_ATTRIBUTE)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) .arg(atrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_ATTRIBUTE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(atrib); @@ -330,9 +330,9 @@ QString SchemaParser::getPureText(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(text); @@ -369,9 +369,9 @@ QString SchemaParser::getConditional(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg(line + comment_count + 1).arg(column+1), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(conditional); @@ -406,9 +406,9 @@ QString SchemaParser::getMetaCharacter(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg(line + comment_count + 1).arg(column+1), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(meta); @@ -485,15 +485,15 @@ bool SchemaParser::evaluateComparisonExpr(void) error=true; else if(!opers.contains(QString(oper).remove('f').remove('i'))) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_OPERATOR_IN_EXPR)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidOperatorInExpression)) .arg(oper).arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_OPERATOR_IN_EXPR,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidOperatorInExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(attributes.count(attrib)==0 && !ignore_unk_atribs) { - throw Exception(Exception::getErrorMessage(ERR_UNK_ATTRIBUTE) + throw Exception(Exception::getErrorMessage(ErrorType::UnkownAttribute) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ERR_UNK_ATTRIBUTE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -554,9 +554,9 @@ bool SchemaParser::evaluateComparisonExpr(void) } if(error) - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(expr_is_true); } @@ -605,9 +605,9 @@ void SchemaParser::defineAttribute(void) if(attributes.count(attrib)==0 && !ignore_unk_atribs) { - throw Exception(Exception::getErrorMessage(ERR_UNK_ATTRIBUTE) + throw Exception(Exception::getErrorMessage(ErrorType::UnkownAttribute) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ERR_UNK_ATTRIBUTE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } value+=attributes[attrib]; @@ -644,9 +644,9 @@ void SchemaParser::defineAttribute(void) //Checking if the attribute has a valid name if(!ATTR_REGEXP.exactMatch(attrib)) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_ATTRIBUTE)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) .arg(attrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_ATTRIBUTE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } /* Creates the attribute in the attribute map of the schema, making the attribute @@ -655,9 +655,9 @@ void SchemaParser::defineAttribute(void) attributes[attrib]=value; } else - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void SchemaParser::unsetAttribute(void) @@ -684,24 +684,24 @@ void SchemaParser::unsetAttribute(void) if(attributes.count(attrib)==0 && !ignore_unk_atribs) { - throw Exception(Exception::getErrorMessage(ERR_UNK_ATTRIBUTE) + throw Exception(Exception::getErrorMessage(ErrorType::UnkownAttribute) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ERR_UNK_ATTRIBUTE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!ATTR_REGEXP.exactMatch(attrib)) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_ATTRIBUTE)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) .arg(attrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_ATTRIBUTE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } attributes[attrib]=QString(); break; default: - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } } @@ -778,9 +778,9 @@ bool SchemaParser::evaluateExpression(void) //Raises an error if the attribute does is unknown if(attributes.count(attrib)==0 && !ignore_unk_atribs) { - throw Exception(Exception::getErrorMessage(ERR_UNK_ATTRIBUTE) + throw Exception(Exception::getErrorMessage(ErrorType::UnkownAttribute) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ERR_UNK_ATTRIBUTE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Error 1: A conditional token other than %or %not %and if found on conditional expression @@ -844,9 +844,9 @@ bool SchemaParser::evaluateExpression(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(expr_is_true); @@ -871,9 +871,9 @@ char SchemaParser::translateMetaCharacter(const QString &meta) if(metas.count(meta)==0) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_METACHARACTER)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidMetacharacter)) .arg(meta).arg(filename).arg(line + comment_count +1).arg(column+1), - ERR_INV_METACHARACTER,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidMetacharacter,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(metas.at(meta)); @@ -888,8 +888,8 @@ QString SchemaParser::getCodeDefinition(const QString & obj_name, attribs_map &a if(def_type==SQL_DEFINITION) { //Formats the filename - filename=GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SQL_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + obj_name + GlobalAttributes::SCHEMA_EXT; + filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::SQLSchemaDir + GlobalAttributes::DirSeparator + obj_name + GlobalAttributes::SchemaExt; attribs[ParsersAttributes::PGSQL_VERSION]=pgsql_version; @@ -898,9 +898,9 @@ QString SchemaParser::getCodeDefinition(const QString & obj_name, attribs_map &a } else { - filename=GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + obj_name + - GlobalAttributes::SCHEMA_EXT; + filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + obj_name + + GlobalAttributes::SchemaExt; return(convertCharsToXMLEntities(getCodeDefinition(filename, attribs))); } @@ -1062,9 +1062,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) //Checks whether the metacharacter is part of the 'if' expression (this is an error) if(if_level>=0 && vet_tk_if[if_level] && !vet_tk_then[if_level]) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) .arg(filename).arg(line + comment_count +1).arg(column+1), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -1106,9 +1106,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) { if(!ignore_unk_atribs) { - throw Exception(QString(Exception::getErrorMessage(ERR_UNK_ATTRIBUTE)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::UnkownAttribute)) .arg(atrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ERR_UNK_ATTRIBUTE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else attributes[atrib]=QString(); @@ -1143,9 +1143,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) raises an exception */ if(attributes[atrib].isEmpty() && !ignore_empty_atribs) { - throw Exception(QString(Exception::getErrorMessage(ERR_UNDEF_ATTRIB_VALUE)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::UndefinedAttributeValue)) .arg(atrib).arg(filename).arg(line + comment_count +1).arg(column+1), - ERR_UNDEF_ATTRIB_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::UndefinedAttributeValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); } /* If the parser is not in an if / else, concatenates the value of the attribute @@ -1166,9 +1166,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) cond!=TOKEN_AND && cond!=TOKEN_SET && cond!=TOKEN_UNSET) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_INSTRUCTION)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidInstruction)) .arg(cond).arg(filename).arg(line + comment_count +1).arg(column+1), - ERR_INV_INSTRUCTION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::InvalidInstruction,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(cond==TOKEN_SET || cond==TOKEN_UNSET) { @@ -1317,9 +1317,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) raises an exception */ if(word.isEmpty() && !ignore_empty_atribs) { - throw Exception(QString(Exception::getErrorMessage(ERR_UNDEF_ATTRIB_VALUE)) + throw Exception(QString(Exception::getErrorMessage(UndefinedAttributeValue)) .arg(atrib).arg(filename).arg(line + comment_count +1).arg(column+1), - ERR_UNDEF_ATTRIB_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + UndefinedAttributeValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1367,9 +1367,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) if(error) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(InvalidSyntax)) .arg(filename).arg(line + comment_count +1).arg(column+1), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } break; @@ -1389,9 +1389,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) because only an attribute must be on the 'if' expression */ if(vet_tk_if[if_level] && !vet_tk_then[if_level]) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(InvalidSyntax)) .arg(filename).arg(line + comment_count +1).arg(column+1), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Case the parser is in 'if' section else if(vet_tk_if[if_level] && @@ -1414,9 +1414,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) was not closed thus the parser returns an error */ if(if_cnt!=end_cnt) { - throw Exception(QString(Exception::getErrorMessage(ERR_INV_SYNTAX)) + throw Exception(QString(Exception::getErrorMessage(InvalidSyntax)) .arg(filename).arg(line + comment_count +1).arg(column+1), - ERR_INV_SYNTAX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libparsers/src/schemaparser.h b/libparsers/src/schemaparser.h index 13a2c1da91..06962822c0 100644 --- a/libparsers/src/schemaparser.h +++ b/libparsers/src/schemaparser.h @@ -187,7 +187,7 @@ class SchemaParser { public: //! \brief Constants used to get a specific object definition - static const unsigned SQL_DEFINITION=0, + static constexpr unsigned SQL_DEFINITION=0, XML_DEFINITION=1; SchemaParser(void); diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index cb78d0f51e..7e673a82cf 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -75,8 +75,8 @@ void XMLParser::loadXMLFile(const QString &filename) //Case the file opening was not sucessful if(!input.isOpen()) { - throw Exception(QString(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED)).arg(filename), - ERR_FILE_DIR_NOT_ACCESSED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(QString(Exception::getErrorMessage(ErrorType::FileDirectoryNotAccessed)).arg(filename), + ErrorType::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); } buffer=input.readAll(); @@ -99,7 +99,7 @@ void XMLParser::loadXMLBuffer(const QString &xml_buf) int pos1=-1, pos2=-1, tam=0; if(xml_buf.isEmpty()) - throw Exception(ERR_ASG_EMPTY_XML_BUFFER,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::AsgEmptyXMLBuffer,__PRETTY_FUNCTION__,__FILE__,__LINE__); pos1=xml_buf.indexOf(QLatin1String("")); @@ -128,10 +128,10 @@ void XMLParser::setDTDFile(const QString &dtd_file, const QString &dtd_name) QString fmt_dtd_file; if(dtd_file.isEmpty()) - throw Exception(ERR_ASG_EMPTY_DTD_FILE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::AsgEmptyDTDFile,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(dtd_name.isEmpty()) - throw Exception(ERR_ASG_EMPTY_DTD_NAME,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::AsgEmptyDTDName,__PRETTY_FUNCTION__,__FILE__,__LINE__); #ifndef Q_OS_WIN fmt_dtd_file=QString("file://"); @@ -193,9 +193,9 @@ void XMLParser::readBuffer(void) if(xml_doc) restartParser(); //Raise an exception with the error massege from the parser xml - throw Exception(QString(Exception::getErrorMessage(ERR_LIBXMLERR)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::LibXMLError)) .arg(xml_error->line).arg(xml_error->int2).arg(msg).arg(file), - ERR_LIBXMLERR,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::LibXMLError,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Gets the referênce to the root element on the document @@ -206,7 +206,7 @@ void XMLParser::readBuffer(void) void XMLParser::savePosition(void) { if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); elems_stack.push(curr_elem); } @@ -214,7 +214,7 @@ void XMLParser::savePosition(void) void XMLParser::restorePosition(void) { if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(elems_stack.empty()) curr_elem=root_elem; @@ -228,9 +228,9 @@ void XMLParser::restorePosition(void) void XMLParser::restorePosition(const xmlNode *elem) { if(!elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(elem->doc!=xml_doc) - throw Exception(ERR_OPR_INEXIST_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprInexistentElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); restartNavigation(); curr_elem=const_cast(elem); @@ -239,7 +239,7 @@ void XMLParser::restorePosition(const xmlNode *elem) void XMLParser::restartNavigation(void) { if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); curr_elem=root_elem; @@ -271,7 +271,7 @@ bool XMLParser::accessElement(unsigned elem_type) xmlNode *elems[4]; if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); elems[ROOT_ELEMENT]=curr_elem->parent; elems[CHILD_ELEMENT]=curr_elem->children; @@ -293,7 +293,7 @@ bool XMLParser::accessElement(unsigned elem_type) bool XMLParser::hasElement(unsigned elem_type, xmlElementType xml_node_type) { if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(elem_type==ROOT_ELEMENT) /* Returns the verification if the current element has a parent. @@ -318,7 +318,7 @@ bool XMLParser::hasElement(unsigned elem_type, xmlElementType xml_node_type) bool XMLParser::hasAttributes(void) { if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(curr_elem->properties!=nullptr); } @@ -326,7 +326,7 @@ bool XMLParser::hasAttributes(void) QString XMLParser::getElementContent(void) { if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* If the current element has node returns the content of the CDATA instead of return the content of the element itself */ @@ -340,7 +340,7 @@ QString XMLParser::getElementContent(void) QString XMLParser::getElementName(void) { if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(QString(reinterpret_cast(curr_elem->name))); } @@ -348,7 +348,7 @@ QString XMLParser::getElementName(void) xmlElementType XMLParser::getElementType(void) { if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(curr_elem->type); } @@ -364,7 +364,7 @@ void XMLParser::getElementAttributes(attribs_map &attributes) QString attrib, value; if(!root_elem) - throw Exception(ERR_OPR_NOT_ALOC_ELEM_TREE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Always clears the passed attributes maps attributes.clear(); diff --git a/libparsers/src/xmlparser.h b/libparsers/src/xmlparser.h index fae7432727..4485d30a04 100644 --- a/libparsers/src/xmlparser.h +++ b/libparsers/src/xmlparser.h @@ -74,7 +74,7 @@ class XMLParser { public: //! \brief Constants used to referência the elements on the element tree - static const unsigned ROOT_ELEMENT=0, + static constexpr unsigned ROOT_ELEMENT=0, CHILD_ELEMENT=1, NEXT_ELEMENT=2, PREVIOUS_ELEMENT=3; diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 66a7cc98e8..04a3bfa855 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -159,13 +159,13 @@ void Catalog::loadCatalogQuery(const QString &qry_id) if(catalog_queries.count(qry_id)==0) { QFile input; - input.setFileName(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - CATALOG_SCH_DIR + GlobalAttributes::DIR_SEPARATOR + - qry_id + GlobalAttributes::SCHEMA_EXT); + input.setFileName(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + CATALOG_SCH_DIR + GlobalAttributes::DirSeparator + + qry_id + GlobalAttributes::SchemaExt); if(!input.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(input.fileName()), - ERR_FILE_DIR_NOT_ACCESSED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(input.fileName()), + FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); catalog_queries[qry_id]=QString(input.readAll()); input.close(); @@ -640,7 +640,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS if(res.getTupleCount() > 1) throw Exception(QApplication::translate("Catalog","The catalog query returned more than one OID!","", -1), - ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(res.isEmpty()) return("0"); diff --git a/libpgconnector/src/catalog.h b/libpgconnector/src/catalog.h index 576f2adccc..a2cdae91e8 100644 --- a/libpgconnector/src/catalog.h +++ b/libpgconnector/src/catalog.h @@ -129,7 +129,7 @@ class Catalog { static const QString PGMODELER_TEMP_DB_OBJ; //! \brief Excludes the system objects from listing - static const unsigned EXCL_SYSTEM_OBJS=1, + static constexpr unsigned EXCL_SYSTEM_OBJS=1, //! \brief Excludes the extension generated objects from listing EXCL_EXTENSION_OBJS=2, diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index 95be646e81..149ba66550 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -89,7 +89,7 @@ void Connection::setConnectionParam(const QString ¶m, const QString &value) //Raise an error in case the param name is empty if(param.isEmpty()) - throw Exception(ERR_ASG_INV_CONN_PARAM, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(AsgInvalidConnParameter, __PRETTY_FUNCTION__, __FILE__, __LINE__); /* Set the value to the specified param on the map. @@ -170,15 +170,15 @@ void Connection::validateConnectionStatus(void) if(dt >= cmd_exec_timeout) { close(); - throw Exception(ERR_CONNECTION_TIMEOUT, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ConnectionTimeout, __PRETTY_FUNCTION__, __FILE__, __LINE__); } } if(PQstatus(connection)==CONNECTION_BAD) - throw Exception(Exception::getErrorMessage(ERR_CONNECTION_BROKEN) + throw Exception(Exception::getErrorMessage(ConnectionBroken) .arg(connection_params[PARAM_SERVER_FQDN].isEmpty() ? connection_params[PARAM_SERVER_IP] : connection_params[PARAM_SERVER_FQDN]) .arg(connection_params[PARAM_PORT]), - ERR_CONNECTION_BROKEN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + ConnectionBroken, __PRETTY_FUNCTION__, __FILE__, __LINE__); } void Connection::setNoticeEnabled(bool value) @@ -217,11 +217,11 @@ void Connection::connect(void) is trying to connect without configuring connection parameters, thus an error is raised */ if(connection_str.isEmpty()) - throw Exception(ERR_CONNECTION_NOT_CONFIGURED, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ConnectionNotConfigured, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(connection) { if(!silence_conn_err) - throw Exception(ERR_CONNECTION_ALREADY_STABLISHED, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ConnectionAlreadyStablished, __PRETTY_FUNCTION__, __FILE__, __LINE__); else { QTextStream err(stderr); @@ -240,8 +240,8 @@ void Connection::connect(void) if(connection==nullptr || PQstatus(connection)==CONNECTION_BAD) { //Raise the error generated by the DBMS - throw Exception(QString(Exception::getErrorMessage(ERR_CONNECTION_NOT_STABLISHED)) - .arg(PQerrorMessage(connection)), ERR_CONNECTION_NOT_STABLISHED, + throw Exception(QString(Exception::getErrorMessage(ConnectionNotStablished)) + .arg(PQerrorMessage(connection)), ConnectionNotStablished, __PRETTY_FUNCTION__, __FILE__, __LINE__); } @@ -272,7 +272,7 @@ void Connection::reset(void) { //Raise an erro in case the user try to reset a not opened connection if(!connection) - throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Reinicia a conexão PQreset(connection); @@ -293,7 +293,7 @@ attribs_map Connection::getServerInfo(void) attribs_map info; if(!connection) - throw Exception(ERR_OPR_NOT_ALOC_CONN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedConnection,__PRETTY_FUNCTION__,__FILE__,__LINE__); info[SERVER_PID]=QString::number(PQbackendPID(connection)); info[SERVER_VERSION]=getPgSQLVersion(); @@ -351,7 +351,7 @@ QString Connection::getPgSQLVersion(bool major_only) QString raw_ver, fmt_ver; if(!connection) - throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); raw_ver=QString("%1").arg(PQserverVersion(connection)); @@ -392,7 +392,7 @@ void Connection::executeDMLCommand(const QString &sql, ResultSet &result) //Raise an error in case the user try to close a not opened connection if(!connection) - throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); validateConnectionStatus(); notices.clear(); @@ -410,9 +410,9 @@ void Connection::executeDMLCommand(const QString &sql, ResultSet &result) //Raise an error in case the command sql execution is not sucessful if(strlen(PQerrorMessage(connection))>0) { - throw Exception(QString(Exception::getErrorMessage(ERR_CMD_SQL_NOT_EXECUTED)) + throw Exception(QString(Exception::getErrorMessage(SQLCommandNotExecuted)) .arg(PQerrorMessage(connection)), - ERR_CMD_SQL_NOT_EXECUTED, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, + SQLCommandNotExecuted, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, QString(PQresultErrorField(sql_res, PG_DIAG_SQLSTATE))); } @@ -433,7 +433,7 @@ void Connection::executeDDLCommand(const QString &sql) //Raise an error in case the user try to close a not opened connection if(!connection) - throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); validateConnectionStatus(); notices.clear(); @@ -453,9 +453,9 @@ void Connection::executeDDLCommand(const QString &sql) PQclear(sql_res); - throw Exception(QString(Exception::getErrorMessage(ERR_CMD_SQL_NOT_EXECUTED)) + throw Exception(QString(Exception::getErrorMessage(SQLCommandNotExecuted)) .arg(PQerrorMessage(connection)), - ERR_CMD_SQL_NOT_EXECUTED, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, field); + SQLCommandNotExecuted, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, field); } PQclear(sql_res); @@ -464,7 +464,7 @@ void Connection::executeDDLCommand(const QString &sql) void Connection::setDefaultForOperation(unsigned op_id, bool value) { if(op_id > OP_NONE) - throw Exception(ERR_REF_ELEM_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefElementInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(op_id!=OP_NONE) default_for_oper[op_id]=value; } @@ -472,7 +472,7 @@ void Connection::setDefaultForOperation(unsigned op_id, bool value) bool Connection::isDefaultForOperation(unsigned op_id) { if(op_id > OP_NONE) - throw Exception(ERR_REF_ELEM_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefElementInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(op_id==OP_NONE) return(false); @@ -522,7 +522,7 @@ void Connection::operator = (const Connection &conn) void Connection::requestCancel(void) { if(!connection) - throw Exception(ERR_OPR_NOT_ALOC_CONN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); PQrequestCancel(connection); } diff --git a/libpgconnector/src/connection.h b/libpgconnector/src/connection.h index c064f7b35f..892ef13452 100644 --- a/libpgconnector/src/connection.h +++ b/libpgconnector/src/connection.h @@ -124,7 +124,7 @@ class Connection { SERVER_PID; //! \brief Constants used to reference the default usage in model operations (see setDefaultForOperation()) - static const unsigned OP_VALIDATION=0, + static constexpr unsigned OP_VALIDATION=0, OP_EXPORT=1, OP_IMPORT=2, OP_DIFF=3, diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index 4d19bbf1f6..aab2632c4d 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -32,7 +32,7 @@ ResultSet::ResultSet(PGresult *sql_result) int res_state; if(!sql_result) - throw Exception(ERR_ASG_SQL_RESULT_NOT_ALOC, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(AsgNotAllocatedSQLResult, __PRETTY_FUNCTION__, __FILE__, __LINE__); this->sql_result=sql_result; res_state=PQresultStatus(this->sql_result); @@ -42,14 +42,14 @@ ResultSet::ResultSet(PGresult *sql_result) { //Generating an error in case the server returns an incomprehensible response case PGRES_BAD_RESPONSE: - throw Exception(ERR_INCOMPREHENSIBLE_DBMS_RESP, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(IncomprehensibleDBMSResponse, __PRETTY_FUNCTION__, __FILE__, __LINE__); break; //Generating an error in case the server returns a fatal error case PGRES_FATAL_ERROR: - str_aux=QString(Exception::getErrorMessage(ERR_DBMS_FATAL_ERROR)) + str_aux=QString(Exception::getErrorMessage(DBMSFatalError)) .arg(PQresultErrorMessage(sql_result)); - throw Exception(str_aux,ERR_DBMS_FATAL_ERROR, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(str_aux,DBMSFatalError, __PRETTY_FUNCTION__, __FILE__, __LINE__); break; //In case of sucess states the result will be created @@ -89,7 +89,7 @@ QString ResultSet::getColumnName(int column_idx) { //Throws an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(ERR_REF_TUPLE_COL_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Returns the column name on the specified index return(QString(PQfname(sql_result, column_idx))); @@ -99,7 +99,7 @@ unsigned ResultSet::getColumnTypeId(int column_idx) { //Throws an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(ERR_REF_TUPLE_COL_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Returns the column type id on the specified index return(static_cast(PQftype(sql_result, column_idx))); @@ -115,7 +115,7 @@ int ResultSet::getColumnIndex(const QString &column_name) /* In case the index is negative indicates that the column doesn't exists in the tuple thus an error will be raised */ if(col_idx < 0) - throw Exception(ERR_REF_TUPLE_COL_INV_NAME, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefTupleColumnInvalidName, __PRETTY_FUNCTION__, __FILE__, __LINE__); return(col_idx); } @@ -128,9 +128,9 @@ int ResultSet::validateColumnName(const QString &column_name) a tuple of an empty result or generated from an INSERT, DELETE, UPDATE, that is, which command do not return lines but only do updates or removal */ if(getTupleCount()==0 || empty_result) - throw Exception(ERR_REF_TUPLE_INEXISTENT, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(current_tuple < 0 || current_tuple >= getTupleCount()) - throw Exception(ERR_REF_INV_TUPLE_COLUMN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Get the column index through its name return (getColumnIndex(column_name)); @@ -152,14 +152,14 @@ void ResultSet::validateColumnIndex(int column_idx) { //Raise an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(ERR_REF_TUPLE_COL_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); /* Raises an error if the user try to get the value of a column in a tuple of an empty result or generated from an INSERT, DELETE, UPDATE, that is, which command do not return lines but only do updates or removal */ else if(getTupleCount()==0 || empty_result) - throw Exception(ERR_REF_TUPLE_INEXISTENT, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(current_tuple < 0 || current_tuple >= getTupleCount()) - throw Exception(ERR_REF_INV_TUPLE_COLUMN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); } char *ResultSet::getColumnValue(int column_idx) @@ -194,9 +194,9 @@ int ResultSet::getColumnSize(int column_idx) { //Raise an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(ERR_REF_TUPLE_COL_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(current_tuple < 0 || current_tuple >= getTupleCount()) - throw Exception(ERR_REF_INV_TUPLE_COLUMN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Retorns the column value length on the current tuple return(PQgetlength(sql_result, current_tuple, column_idx)); @@ -207,7 +207,7 @@ attribs_map ResultSet::getTupleValues(void) attribs_map tup_vals; if(current_tuple < 0 || current_tuple >= getTupleCount()) - throw Exception(ERR_REF_TUPLE_INEXISTENT, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); for(int col=0; col < getColumnCount(); col++) tup_vals[getColumnName(col)]=getColumnValue(col); @@ -260,7 +260,7 @@ bool ResultSet::isColumnBinaryFormat(int column_idx) { //Raise an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(ERR_REF_TUPLE_COL_INV_INDEX, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); /* Returns the column format in the current tuple. According to libpq documentation, value = 0, indicates column text format, @@ -279,7 +279,7 @@ bool ResultSet::accessTuple(unsigned tuple_type) The tuple type to be accessed is invalid, out of set defined by the class */ if(empty_result || tuple_type > NEXT_TUPLE) - throw Exception(ERR_REF_TUPLE_INEXISTENT, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); if(tuple_count==0) return(false); diff --git a/libpgconnector/src/resultset.h b/libpgconnector/src/resultset.h index 82962e2c56..746ce2d2a4 100644 --- a/libpgconnector/src/resultset.h +++ b/libpgconnector/src/resultset.h @@ -67,7 +67,7 @@ class ResultSet { public: //! \brief Constants used to navigate through the resultset - static const unsigned FIRST_TUPLE=0, + static constexpr unsigned FIRST_TUPLE=0, LAST_TUPLE=1, PREVIOUS_TUPLE=2, NEXT_TUPLE=3; diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 6f8112037b..1582754cae 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -36,14 +36,14 @@ void Aggregate::setFunction(unsigned func_idx, Function *func) { //Case the function index is invalid raises an error if(func_idx!=FINAL_FUNC && func_idx!=TRANSITION_FUNC) - throw Exception(ERR_REF_FUNCTION_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Checks if the function is valid, if not the case raises an error if(!isValidFunction(func_idx, func)) - throw Exception(Exception::getErrorMessage(ERR_USING_INV_FUNC_CONFIG) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidConfiguration) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_AGGREGATE)), - ERR_USING_INV_FUNC_CONFIG,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(functions[func_idx]!=func); functions[func_idx]=func; @@ -124,11 +124,11 @@ void Aggregate::setSortOperator(Operator *sort_op) func=sort_op->getFunction(Operator::FUNC_OPERATOR); //Validating the condition 1 if(data_types.size()!=1) - throw Exception(ERR_ASG_INV_OPER_ARGS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidOperatorArguments,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Validating the condition 2 else if(func->getParameter(0).getType()!=data_types[0] || (func->getParameterCount()==2 && func->getParameter(1).getType()!=data_types[0])) - throw Exception(ERR_ASG_INV_OPERATOR_TYPES,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidOperatorTypes,__PRETTY_FUNCTION__,__FILE__,__LINE__); } setCodeInvalidated(sort_operator != sort_op); @@ -168,7 +168,7 @@ void Aggregate::removeDataType(unsigned type_idx) { //Raises an exception if the type index is out of bound if(type_idx >= data_types.size()) - throw Exception(ERR_REF_TYPE_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Removes the type at the specified position data_types.erase(data_types.begin() + type_idx); @@ -190,7 +190,7 @@ Function *Aggregate::getFunction(unsigned func_idx) { //Raises an exception if the function index is invalid if(func_idx!=FINAL_FUNC && func_idx!=TRANSITION_FUNC) - throw Exception(ERR_REF_FUNCTION_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_idx]); } @@ -214,7 +214,7 @@ PgSQLType Aggregate::getDataType(unsigned type_idx) { //Raises an exception if the type index is out of bound if(type_idx >= data_types.size()) - throw Exception(ERR_REF_TYPE_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(data_types[type_idx]); } diff --git a/libpgmodeler/src/aggregate.h b/libpgmodeler/src/aggregate.h index 3bb5b59a17..fa28b5a72f 100644 --- a/libpgmodeler/src/aggregate.h +++ b/libpgmodeler/src/aggregate.h @@ -65,7 +65,7 @@ class Aggregate: public BaseObject { public: //! \brief Constants used to reference the functions used by the aggregate - static const unsigned FINAL_FUNC=0, + static constexpr unsigned FINAL_FUNC=0, TRANSITION_FUNC=1; Aggregate(void); diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 303487ee67..7ae98d7007 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -68,7 +68,7 @@ QString BaseObject::objs_sql[OBJECT_TYPE_COUNT]={ DatabaseModel, Tag */ unsigned BaseObject::global_id=4000; -QString BaseObject::pgsql_ver=PgSQLVersions::DEFAULT_VERSION; +QString BaseObject::pgsql_ver=PgSQLVersions::DefaulVersion; bool BaseObject::use_cached_code=true; BaseObject::BaseObject(void) @@ -348,12 +348,12 @@ void BaseObject::setName(const QString &name) if(!isValidName(aux_name)) { if(aux_name.isEmpty()) - throw Exception(ERR_ASG_EMPTY_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the name is quoted we add 2 bytes to the maximum in order to check if it exceeds the limit else if(aux_name.size() > (OBJECT_NAME_MAX_LENGTH + (is_quoted ? 2 : 0))) - throw Exception(ERR_ASG_LONG_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else - throw Exception(ERR_ASG_INV_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } aux_name.remove('"'); @@ -364,7 +364,7 @@ void BaseObject::setName(const QString &name) void BaseObject::setAlias(const QString &alias) { if(alias.size() > OBJECT_NAME_MAX_LENGTH) - throw Exception(ERR_ASG_LONG_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->alias = alias; setCodeInvalidated(this->alias != alias); @@ -492,14 +492,14 @@ bool BaseObject::acceptsDropCommand(void) void BaseObject::setSchema(BaseObject *schema) { if(!schema) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_SCHEMA) + throw Exception(Exception::getErrorMessage(AsgNotAllocatedSchema) .arg(this->obj_name) .arg(this->getTypeName()), - ERR_ASG_NOT_ALOC_SCHEMA,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNotAllocatedSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(schema && schema->getObjectType()!=OBJ_SCHEMA) - throw Exception(ERR_ASG_INV_SCHEMA_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsSchema()) - throw Exception(ERR_ASG_INV_SCHEMA_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->schema != schema); this->schema=schema; @@ -508,9 +508,9 @@ void BaseObject::setSchema(BaseObject *schema) void BaseObject::setOwner(BaseObject *owner) { if(owner && owner->getObjectType()!=OBJ_ROLE) - throw Exception(ERR_ASG_INV_ROLE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidRoleObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsOwner()) - throw Exception(ERR_ASG_ROLE_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgRoleObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->owner != owner); this->owner=owner; @@ -519,9 +519,9 @@ void BaseObject::setOwner(BaseObject *owner) void BaseObject::setTablespace(BaseObject *tablespace) { if(tablespace && tablespace->getObjectType()!=OBJ_TABLESPACE) - throw Exception(ERR_ASG_INV_TABLESPACE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTablespaceObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsTablespace()) - throw Exception(ERR_ASG_TABSPC_INV_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgTablespaceInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->tablespace != tablespace); this->tablespace=tablespace; @@ -530,9 +530,9 @@ void BaseObject::setTablespace(BaseObject *tablespace) void BaseObject::setCollation(BaseObject *collation) { if(collation && !acceptsCollation()) - throw Exception(ERR_ASG_INV_COLLATION_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(collation && collation->getObjectType()!=OBJ_COLLATION) - throw Exception(ERR_ASG_INV_COLLATION_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->collation != collation); this->collation=collation; @@ -541,7 +541,7 @@ void BaseObject::setCollation(BaseObject *collation) void BaseObject::setAppendedSQL(const QString &sql) { if(!acceptsCustomSQL()) - throw Exception(ERR_ASG_APPSQL_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgCustomSQLObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->appended_sql != sql); this->appended_sql=sql; @@ -550,7 +550,7 @@ void BaseObject::setAppendedSQL(const QString &sql) void BaseObject::setPrependedSQL(const QString &sql) { if(!acceptsCustomSQL()) - throw Exception(ERR_ASG_APPSQL_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgCustomSQLObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->prepended_sql != sql); this->prepended_sql=sql; @@ -754,9 +754,9 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(obj_type!=OBJ_TABLESPACE && obj_type!=OBJ_DATABASE) { SchemaParser sch_parser; - QString filename=GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::ALTER_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::OWNER + GlobalAttributes::SCHEMA_EXT; + QString filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::OWNER + GlobalAttributes::SchemaExt; sch_parser.ignoreUnkownAttributes(true); attributes[ParsersAttributes::OWNER]=sch_parser.getCodeDefinition(filename, attributes); @@ -856,11 +856,11 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) schparser.restartParser(); clearAttributes(); - if(e.getErrorType()==ERR_UNDEF_ATTRIB_VALUE) - throw Exception(Exception::getErrorMessage(ERR_ASG_OBJ_INV_DEFINITION) + if(e.getErrorType()==UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_ASG_OBJ_INV_DEFINITION,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } @@ -892,26 +892,26 @@ void BaseObject::swapObjectsIds(BaseObject *obj1, BaseObject *obj2, bool enable_ { //Raises an error if some of the objects aren't allocated if(!obj1 || !obj2) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the involved objects are the same else if(obj1==obj2) - throw Exception(ERR_INV_ID_SWAP_SAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvIdSwapSameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the some of the objects are system objects else if(obj1->isSystemObject()) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(obj1->getName()) .arg(obj1->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(obj2->isSystemObject()) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(obj2->getName()) .arg(obj2->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the object is object is cluster level and the swap of these types isn't enabled else if(!enable_cl_obj_swap && (obj1->getObjectType()==OBJ_DATABASE || obj1->getObjectType()==OBJ_TABLESPACE || obj1->getObjectType()==OBJ_ROLE || obj2->getObjectType()==OBJ_DATABASE || obj2->getObjectType()==OBJ_TABLESPACE || obj2->getObjectType()==OBJ_ROLE)) - throw Exception(ERR_INV_ID_SWAP_INV_OBJ_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvIdSwapInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { unsigned id_bkp=obj1->object_id; @@ -924,12 +924,12 @@ void BaseObject::updateObjectId(BaseObject *obj) { //Raises an error if some of the objects aren't allocated if(!obj) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(obj->isSystemObject()) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(obj->getName()) .arg(obj->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else obj->object_id=++global_id; } @@ -1075,9 +1075,9 @@ bool BaseObject::isCodeDiffersFrom(const QString &xml_def1, const QString &xml_d bool BaseObject::isCodeDiffersFrom(BaseObject *object, const vector &ignored_attribs, const vector &ignored_tags) { if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(object->getObjectType()!=this->getObjectType()) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -1147,9 +1147,9 @@ QString BaseObject::getAlterDefinition(QString sch_name, attribs_map &attribs, b try { SchemaParser schparser; - QString alter_sch_dir=GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::ALTER_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - QString("%1") + GlobalAttributes::SCHEMA_EXT; + QString alter_sch_dir=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + + QString("%1") + GlobalAttributes::SchemaExt; schparser.setPgSQLVersion(BaseObject::pgsql_ver); schparser.ignoreEmptyAttributes(ignore_empty_attribs); @@ -1182,12 +1182,12 @@ QString BaseObject::getAlterDefinition(BaseObject *object) QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff) { if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); QString alter; if(object->obj_type!=this->obj_type) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setBasicAttributes(true); diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index edb0d6b823..2e0c77cc46 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -105,7 +105,7 @@ class BaseObject { unsigned object_id; //! \brief Objects type count declared on enum ObjectType - static const int OBJECT_TYPE_COUNT=37; + static constexpr int OBJECT_TYPE_COUNT=37; /*! \brief Indicates whether the object is protected or not. A protected object indicates that it can not suffer changes in position @@ -232,12 +232,12 @@ class BaseObject { public: //! \brief Maximum number of characters that an object name on PostgreSQL can have - static const int OBJECT_NAME_MAX_LENGTH=63; + static constexpr int OBJECT_NAME_MAX_LENGTH=63; /*! \brief The default number of objects supposed to be stored in objects list. * This values is just a reference (hint) and is used to preallocate (reserve) space on vectors which handle objects * to avoid excessive allocation/deallocation by resizing the vectors due to insert operation */ - static const unsigned DEF_MAX_OBJ_COUNT=20; + static constexpr unsigned DEF_MAX_OBJ_COUNT=20; BaseObject(void); BaseObject(bool system_obj); diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 8756bc4694..88b4a04e31 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -22,7 +22,7 @@ BaseRelationship::BaseRelationship(BaseRelationship *rel) { if(!rel) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); for(unsigned i=0; i < 3; i++) lables[i]=nullptr; @@ -123,15 +123,15 @@ void BaseRelationship::configureRelationship(void) { //Raises an error if one of the tables is not allocated if(!src_table || !dst_table) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_TABLE) + throw Exception(Exception::getErrorMessage(AsgNotAllocatedTable) .arg(this->getName()) .arg(BaseObject::getTypeName(BASE_RELATIONSHIP)), - ERR_ASG_NOT_ALOC_TABLE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNotAllocatedTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the relationship type is generalization or dependency and the source and destination table are the same. */ if((rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_DEP || rel_type==RELATIONSHIP_PART) && src_table==dst_table) - throw Exception(ERR_INV_INH_COPY_PART_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Allocates the textbox for the name label lables[REL_NAME_LABEL]=new Textbox; @@ -154,7 +154,7 @@ void BaseRelationship::configureRelationship(void) } else //Raises an error if the specified relationship typ is invalid - throw Exception(ERR_ALOC_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AllocationObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } BaseRelationship::~BaseRelationship(void) @@ -193,7 +193,7 @@ void BaseRelationship::setMandatoryTable(unsigned table_id, bool value) if(rel_type==RELATIONSHIP_11 && ((table_id==SRC_TABLE && value && dst_mandatory) || (table_id==DST_TABLE && value && src_mandatory))) - throw Exception(ERR_NOT_IMPL_REL_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(NotImplementedRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Case the source table is mandatory if(table_id==SRC_TABLE) @@ -306,7 +306,7 @@ Textbox *BaseRelationship::getLabel(unsigned label_id) return(lables[label_id]); else //Raises an error when the label id is invalid - throw Exception(ERR_REF_LABEL_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefLabelInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); } unsigned BaseRelationship::getRelationshipType(void) @@ -438,7 +438,7 @@ void BaseRelationship::setPoints(const vector &points) void BaseRelationship::setLabelDistance(unsigned label_id, QPointF label_dist) { if(label_id > REL_NAME_LABEL) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->lables_dist[label_id]=label_dist; this->setCodeInvalidated(true); @@ -447,7 +447,7 @@ void BaseRelationship::setLabelDistance(unsigned label_id, QPointF label_dist) QPointF BaseRelationship::getLabelDistance(unsigned label_id) { if(label_id > REL_NAME_LABEL) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->lables_dist[label_id]); } diff --git a/libpgmodeler/src/baserelationship.h b/libpgmodeler/src/baserelationship.h index ee26b215a1..0b1053a2d3 100644 --- a/libpgmodeler/src/baserelationship.h +++ b/libpgmodeler/src/baserelationship.h @@ -94,7 +94,7 @@ class BaseRelationship: public BaseGraphicObject { public: //! \brief Constants used to assign the type to relationship - static const unsigned RELATIONSHIP_11=10, //! \brief One to one + static constexpr unsigned RELATIONSHIP_11=10, //! \brief One to one RELATIONSHIP_1N=11, //! \brief One to many RELATIONSHIP_NN=12, //! \brief Many to many RELATIONSHIP_GEN=13, //! \brief Generalization (Inheritance) @@ -103,12 +103,12 @@ class BaseRelationship: public BaseGraphicObject { RELATIONSHIP_FK=16; //! \brief Relationship generated by creating a foreign key manually on a table //! \brief Constats used to reference the relationship labels - static const unsigned SRC_CARD_LABEL=0, + static constexpr unsigned SRC_CARD_LABEL=0, DST_CARD_LABEL=1, REL_NAME_LABEL=2; //! \brief Constants used to reference the source and destination tables - static const unsigned SRC_TABLE=0, + static constexpr unsigned SRC_TABLE=0, DST_TABLE=1; BaseRelationship(BaseRelationship *rel); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 906c35092e..917b250c6f 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -38,17 +38,17 @@ void Cast::setDataType(unsigned type_idx, PgSQLType type) { //Raises an error if the passed data type is null if((*type).isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_ASG_NULL_TYPE_OBJECT) + throw Exception(Exception::getErrorMessage(AsgNullTypeObject) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_CAST)), - ERR_ASG_NULL_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->types[type_idx] != type); this->types[type_idx]=type; } else //Raises an error if the type index is invalid - throw Exception(ERR_REF_TYPE_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the cast name (in form of signature: cast(src_type, dst_type) ) this->obj_name=QString("cast(%1,%2)").arg(~types[SRC_TYPE]).arg(~types[DST_TYPE]); @@ -58,7 +58,7 @@ void Cast::setCastType(unsigned cast_type) { //Raises an error if the user tries to assign an invalid cast type if(cast_type > IMPLICIT) - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->cast_type != cast_type); this->cast_type=cast_type; @@ -77,20 +77,20 @@ void Cast::setCastFunction(Function *cast_func) PgSQLType ret_type; if(!cast_func) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_FUNCTION) + throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_CAST)), - ERR_ASG_NOT_ALOC_FUNCTION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Retrieve the cast function parameter count for specific validations param_count=cast_func->getParameterCount(); //Raises an error if the function don't have at least 1 parameter or a maximum of 3 if(param_count==0 || param_count > 3) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_INV_PARAM_COUNT) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_CAST)), - ERR_ASG_FUNC_INV_PARAM_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { /* Error condition 1: Check if the first function parameter data type differs @@ -110,10 +110,10 @@ void Cast::setCastFunction(Function *cast_func) //In case some error condition is reached raises an error if(error) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNCTION_INV_PARAMS) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_CAST)), - ERR_ASG_FUNCTION_INV_PARAMS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } /* Raises an error if the return type of the function differs from the destination data type. @@ -121,10 +121,10 @@ void Cast::setCastFunction(Function *cast_func) ret_type=cast_func->getReturnType(); if(ret_type!=this->types[DST_TYPE] && !ret_type.canCastTo(this->types[DST_TYPE])) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNCTION_INV_RET_TYPE) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_CAST)), - ERR_ASG_FUNCTION_INV_RET_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(cast_function != cast_func); this->cast_function=cast_func; @@ -133,7 +133,7 @@ void Cast::setCastFunction(Function *cast_func) PgSQLType Cast::getDataType(unsigned type_idx) { if(type_idx > DST_TYPE) - throw Exception(ERR_REF_TYPE_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->types[type_idx]); } diff --git a/libpgmodeler/src/cast.h b/libpgmodeler/src/cast.h index 7658f82143..052da97e24 100644 --- a/libpgmodeler/src/cast.h +++ b/libpgmodeler/src/cast.h @@ -49,7 +49,7 @@ class Cast: public BaseObject { public: //! \brief Constants used to access the data types envolved in the cast - static const unsigned SRC_TYPE=0, + static constexpr unsigned SRC_TYPE=0, DST_TYPE=1, //! \brief Constants used to define the cast type EXPLICIT=0, diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index fe1870fb2d..f7358bb97e 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -41,7 +41,7 @@ void Collation::setLocalization(unsigned lc_id, QString lc_name) if(locale.isEmpty()) { if(lc_id > _LC_COLLATE) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Removes encoding specification from localization e.g 'aa_BB.ENC' will turn into 'aa_BB' since the encoding is appended on code generation */ @@ -60,10 +60,10 @@ void Collation::setEncoding(EncodingType encoding) void Collation::setCollation(BaseObject *collation) { if(collation==this) - throw Exception(Exception::getErrorMessage(ERR_OBJECT_REFERENCING_ITSELF) + throw Exception(Exception::getErrorMessage(ObjectReferencingItself) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_OBJECT_REFERENCING_ITSELF,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ObjectReferencingItself,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setCollation(collation); @@ -80,7 +80,7 @@ QString Collation::getLocale(void) QString Collation::getLocalization(unsigned lc_id) { if(lc_id > _LC_COLLATE) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(localization[lc_id]); } @@ -114,7 +114,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) QString lc_attribs[2]={ ParsersAttributes::_LC_CTYPE_, ParsersAttributes::_LC_COLLATE_ }; if(localization[_LC_CTYPE].isEmpty() && localization[_LC_COLLATE].isEmpty()) - throw Exception(ERR_EMPTY_LOCAL_ATTRIB_COLLATION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(EmptyLCCollationAttributes,__PRETTY_FUNCTION__,__FILE__,__LINE__); for(unsigned int i=_LC_CTYPE; i <= _LC_COLLATE; i++) { diff --git a/libpgmodeler/src/collation.h b/libpgmodeler/src/collation.h index 3551a12c6d..6ce3ae7055 100644 --- a/libpgmodeler/src/collation.h +++ b/libpgmodeler/src/collation.h @@ -48,7 +48,7 @@ class Collation : public BaseObject { locale; public: - static const unsigned _LC_CTYPE=0, + static constexpr unsigned _LC_CTYPE=0, _LC_COLLATE=1; Collation(void); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 7fc67fc173..ef5cdf849a 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -66,11 +66,11 @@ void Column::setType(PgSQLType type) { //An error is raised if the column receive a pseudo-type as data type. if(type.isPseudoType()) - throw Exception(ERR_ASG_PSDTYPE_COLUMN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::AsgPseudoTypeColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(this->identity_type != BaseType::null && !type.isIntegerType()) { - throw Exception(Exception::getErrorMessage(ERR_INV_IDENTITY_COLUMN).arg(getSignature()), - ERR_INV_IDENTITY_COLUMN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(Exception::getErrorMessage(ErrorType::InvalidIdentityColumn).arg(getSignature()), + ErrorType::InvalidIdentityColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); } setCodeInvalidated(this->type != type); @@ -81,8 +81,8 @@ void Column::setIdentityType(IdentityType id_type) { if(id_type != BaseType::null && !type.isIntegerType()) { - throw Exception(Exception::getErrorMessage(ERR_INV_IDENTITY_COLUMN).arg(getSignature()), - ERR_INV_IDENTITY_COLUMN, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(Exception::getErrorMessage(ErrorType::InvalidIdentityColumn).arg(getSignature()), + ErrorType::InvalidIdentityColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); } setCodeInvalidated(identity_type != id_type); @@ -153,7 +153,7 @@ QString Column::getOldName(bool format) void Column::setParentRelationship(BaseObject *parent_rel) { if(parent_rel && parent_rel->getObjectType()!=OBJ_RELATIONSHIP) - throw Exception(ERR_ASG_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->parent_rel=parent_rel; } @@ -168,16 +168,16 @@ void Column::setSequence(BaseObject *seq) if(seq) { if(seq->getObjectType()!=OBJ_SEQUENCE) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_OBJECT_TYPE) + throw Exception(Exception::getErrorMessage(AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) .arg(BaseObject::getTypeName(OBJ_SEQUENCE)), - ERR_ASG_INV_OBJECT_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!type.isIntegerType()) - throw Exception(Exception::getErrorMessage(ERR_INCOMP_COL_TYPE_FOR_SEQ) + throw Exception(Exception::getErrorMessage(IncompColumnTypeForSequence) .arg(seq->getName(true)) .arg(this->obj_name), - ERR_INCOMP_COL_TYPE_FOR_SEQ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + IncompColumnTypeForSequence,__PRETTY_FUNCTION__,__FILE__,__LINE__); default_value=QString(); identity_type=BaseType::null; @@ -279,7 +279,7 @@ QString Column::getAlterDefinition(BaseObject *object) Column *col=dynamic_cast(object); if(!col) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 39e7c6a884..657de43014 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -88,7 +88,7 @@ bool Constraint::isColumnExists(Column *column, unsigned col_type) //Raises an error if the column is not allocated if(!column) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Gets the iterators from the specified internal list if(col_type==SOURCE_COLS) @@ -147,10 +147,10 @@ void Constraint::addColumn(Column *column, unsigned col_type) { //Raises an error if the column is not allocated if(!column) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_COLUMN) + throw Exception(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_CONSTRAINT)), - ERR_ASG_NOT_ALOC_COLUMN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(constr_type!=ConstraintType::check) { //Adds the column only if the column doesn't exists on the internal list @@ -176,7 +176,7 @@ void Constraint::setTablespace(BaseObject *tabspc) if(tabspc && constr_type!=ConstraintType::primary_key && constr_type!=ConstraintType::unique) - throw Exception(ERR_ASG_TABSPC_INV_CONSTR_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgTablespaceInvalidConstraintType,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setTablespace(tabspc); } @@ -297,7 +297,7 @@ Column *Constraint::getColumn(unsigned col_idx, unsigned col_type) //Raises an error if the column index is invalid (out of bound) if(col_idx>=col_list->size()) - throw Exception(ERR_REF_COLUMN_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefColumnInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(col_list->at(col_idx)); } @@ -506,9 +506,9 @@ void Constraint::addExcludeElements(vector &elems) void Constraint::addExcludeElement(ExcludeElement elem) { if(getExcludeElementIndex(elem) >= 0) - throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(elem.getExpression().isEmpty() && !elem.getColumn()) - throw Exception(ERR_ASG_INV_EXPR_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); excl_elements.push_back(elem); setCodeInvalidated(true); @@ -522,7 +522,7 @@ void Constraint::addExcludeElement(const QString &expr, Operator *oper, Operator //Raises an error if the expression is empty if(expr.isEmpty()) - throw Exception(ERR_ASG_INV_EXPR_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the element elem.setExpression(expr); @@ -533,7 +533,7 @@ void Constraint::addExcludeElement(const QString &expr, Operator *oper, Operator elem.setSortingAttribute(ExcludeElement::ASC_ORDER, asc_order); if(getExcludeElementIndex(elem) >= 0) - throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); excl_elements.push_back(elem); setCodeInvalidated(true); @@ -552,10 +552,10 @@ void Constraint::addExcludeElement(Column *column, Operator *oper, OperatorClass //Case the column is not allocated raises an error if(!column) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_COLUMN) + throw Exception(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn) .arg(this->getName()) .arg(this->getTypeName()), - ERR_ASG_NOT_ALOC_COLUMN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the element elem.setColumn(column); @@ -566,7 +566,7 @@ void Constraint::addExcludeElement(Column *column, Operator *oper, OperatorClass elem.setSortingAttribute(ExcludeElement::ASC_ORDER, asc_order); if(getExcludeElementIndex(elem) >= 0) - throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); excl_elements.push_back(elem); setCodeInvalidated(true); @@ -580,7 +580,7 @@ void Constraint::addExcludeElement(Column *column, Operator *oper, OperatorClass void Constraint::removeExcludeElement(unsigned elem_idx) { if(elem_idx >= excl_elements.size()) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); excl_elements.erase(excl_elements.begin() + elem_idx); setCodeInvalidated(true); @@ -607,7 +607,7 @@ void Constraint::setColumnsNotNull(bool value) ExcludeElement Constraint::getExcludeElement(unsigned elem_idx) { if(elem_idx >= excl_elements.size()) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(excl_elements[elem_idx]); } @@ -746,9 +746,9 @@ QString Constraint::getSignature(bool format) bool Constraint::isCodeDiffersFrom(BaseObject *object, const vector &ignored_attribs, const vector &ignored_tags) { if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(object->getObjectType()!=this->getObjectType()) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/constraint.h b/libpgmodeler/src/constraint.h index c34b6e7b22..ef3b5131aa 100644 --- a/libpgmodeler/src/constraint.h +++ b/libpgmodeler/src/constraint.h @@ -86,13 +86,13 @@ class Constraint: public TableObject{ public: /*! \brief Access the source columns that means the columns that constrais is applied (from the constraint's parent table) */ - static const unsigned SOURCE_COLS=0, + static constexpr unsigned SOURCE_COLS=0, /*! \brief Access the referenced columns that means the columns from the referenced table primary key (only for foreign keys) */ REFERENCED_COLS=1; - static const unsigned DELETE_ACTION=0, + static constexpr unsigned DELETE_ACTION=0, UPDATE_ACTION=1; Constraint(void); diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index 3b8d3bae95..bd082276ab 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -36,34 +36,34 @@ void Conversion::setEncoding(unsigned encoding_idx, EncodingType encoding_type) { //If the passed enconding type is null an error is raised if((~encoding_type).isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_ASG_NULL_TYPE_OBJECT) + throw Exception(Exception::getErrorMessage(AsgNullTypeObject) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_CONVERSION)), - ERR_ASG_NULL_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Assigns the encoding to the conversion in the specified index this->encodings[encoding_idx]=encoding_type; } else //Raises an error if the encoding index is invalid - throw Exception(ERR_REF_TYPE_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void Conversion::setConversionFunction(Function *conv_func) { //Raises an error in case the passed conversion function is null if(!conv_func) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_FUNCTION) + throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) .arg(BaseObject::getTypeName(OBJ_CONVERSION)), - ERR_ASG_NOT_ALOC_FUNCTION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* The conversion function must have 5 parameters if it's not the case raises an error. */ else if(conv_func->getParameterCount()!=5) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_INV_PARAM_COUNT) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName(true)) .arg(BaseObject::getTypeName(OBJ_CONVERSION)), - ERR_ASG_FUNC_INV_PARAM_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the function parameters does not following the type order: interger, integer, cstring, internal, integer */ else if(conv_func->getParameter(0).getType()!=QString("integer") || @@ -71,16 +71,16 @@ void Conversion::setConversionFunction(Function *conv_func) conv_func->getParameter(2).getType()!=QString("cstring") || conv_func->getParameter(3).getType()!=QString("internal") || conv_func->getParameter(4).getType()!=QString("integer")) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNCTION_INV_PARAMS) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName(true)) .arg(BaseObject::getTypeName(OBJ_CONVERSION)), - ERR_ASG_FUNCTION_INV_PARAMS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the conversion function return type is not 'void' else if(conv_func->getReturnType()!=QString("void")) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNCTION_INV_RET_TYPE) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName(true)) .arg(BaseObject::getTypeName(OBJ_CONVERSION)), - ERR_ASG_FUNCTION_INV_RET_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(conversion_func != conv_func); this->conversion_func=conv_func; @@ -95,7 +95,7 @@ void Conversion::setDefault(bool value) EncodingType Conversion::getEncoding(unsigned encoding_idx) { if(encoding_idx > DST_ENCODING) - throw Exception(ERR_REF_TYPE_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->encodings[encoding_idx]); } diff --git a/libpgmodeler/src/conversion.h b/libpgmodeler/src/conversion.h index e67e2f7c4b..7a59408fb2 100644 --- a/libpgmodeler/src/conversion.h +++ b/libpgmodeler/src/conversion.h @@ -45,7 +45,7 @@ class Conversion: public BaseObject { public: //! \brief Constants used to access the conversion encodings - static const unsigned SRC_ENCODING=0, + static constexpr unsigned SRC_ENCODING=0, DST_ENCODING=1; Conversion(void); diff --git a/libpgmodeler/src/copyoptions.cpp b/libpgmodeler/src/copyoptions.cpp index b416c532a9..846615a880 100644 --- a/libpgmodeler/src/copyoptions.cpp +++ b/libpgmodeler/src/copyoptions.cpp @@ -27,7 +27,7 @@ CopyOptions::CopyOptions(void) CopyOptions::CopyOptions(unsigned copy_mode, unsigned copy_op_ids) { if((copy_mode!=0 && copy_mode!=INCLUDING && copy_mode!=EXCLUDING) || copy_op_ids > ALL) - throw Exception(ERR_REF_INV_LIKE_OP_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidLikeOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->copy_mode = copy_mode; this->copy_op_ids = copy_op_ids; @@ -41,7 +41,7 @@ unsigned CopyOptions::getCopyMode(void) bool CopyOptions::isOptionSet(unsigned op) { if(op > ALL) - throw Exception(ERR_REF_INV_LIKE_OP_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidLikeOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return((copy_op_ids & op) == op); } @@ -84,8 +84,8 @@ QString CopyOptions::getSQLDefinition(void) case INDEXES: op_name=QString(" INDEXES"); break; case STORAGE: op_name=QString(" STORAGE"); break; case COMMENTS: op_name=QString(" COMMENTS"); break; - case IDENTITY: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSQLVersions::PGSQL_VERSION_96.toFloat() ? QString(" IDENTITY") : QString()); break; - case STATISTICS: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSQLVersions::PGSQL_VERSION_96.toFloat() ? QString(" STATISTICS") : QString()); break; + case IDENTITY: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSQLVersions::PgSQLVersion96.toFloat() ? QString(" IDENTITY") : QString()); break; + case STATISTICS: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSQLVersions::PgSQLVersion96.toFloat() ? QString(" STATISTICS") : QString()); break; } if(!op_name.isEmpty()) diff --git a/libpgmodeler/src/copyoptions.h b/libpgmodeler/src/copyoptions.h index 82f6ead014..d1f1581bda 100644 --- a/libpgmodeler/src/copyoptions.h +++ b/libpgmodeler/src/copyoptions.h @@ -33,7 +33,7 @@ class CopyOptions { unsigned copy_mode, copy_op_ids; public: - static const unsigned DEFAULTS=1, + static constexpr unsigned DEFAULTS=1, CONSTRAINTS=2, INDEXES=4, STORAGE=8, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 2fbaac97ce..936d039886 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -76,7 +76,7 @@ void DatabaseModel::setEncoding(EncodingType encod) void DatabaseModel::setLocalization(unsigned localiz_id, const QString &value) { if(localiz_id > Collation::_LC_COLLATE) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); localizations[localiz_id]=value; } @@ -90,7 +90,7 @@ void DatabaseModel::setConnectionLimit(int conn_lim) void DatabaseModel::setTemplateDB(const QString &temp_db) { if(!temp_db.isEmpty() && !BaseObject::isValidName(temp_db)) - throw Exception(ERR_ASG_INV_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->template_db=temp_db; } @@ -296,7 +296,7 @@ void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) if(TableObject::isTableObject(obj_type) || obj_type==BASE_OBJECT || obj_type==BASE_RELATIONSHIP || obj_type==OBJ_DATABASE) - throw Exception(ERR_REM_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -305,7 +305,7 @@ void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) obj_list=getObjectList(obj_type); if(obj_idx >= obj_list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); object=(*obj_list)[obj_idx]; if(obj_type==OBJ_TEXTBOX) @@ -363,7 +363,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) vector::iterator itr, itr_end; if(!object) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=object->getObjectType(); @@ -371,9 +371,9 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) #ifdef DEMO_VERSION #warning "DEMO VERSION: database model object creation limit." obj_list=getObjectList(obj_type); - if(obj_list && obj_list->size() >= GlobalAttributes::MAX_OBJECT_COUNT) + if(obj_list && obj_list->size() >= GlobalAttributes::MaxObjectCount) throw Exception(trUtf8("The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2'") - .arg(GlobalAttributes::MAX_OBJECT_COUNT) + .arg(GlobalAttributes::MaxObjectCount) .arg(BaseObject::getTypeName(obj_type)), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -396,10 +396,10 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) there is some other tablespace pointing to the same directory */ if(tabspc->getDirectory()==aux_tabspc->getDirectory()) { - throw Exception(Exception::getErrorMessage(ERR_ASG_DUP_TABLESPACE_DIR) + throw Exception(Exception::getErrorMessage(AsgTablespaceDuplicatedDirectory) .arg(tabspc->getName()) .arg(aux_tabspc->getName()), - ERR_ASG_DUP_TABLESPACE_DIR,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgTablespaceDuplicatedDirectory,__PRETTY_FUNCTION__,__FILE__,__LINE__); } itr++; @@ -418,13 +418,13 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) { QString str_aux; - str_aux=QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + str_aux=QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(object->getName(obj_type != OBJ_EXTENSION)) .arg(object->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); - throw Exception(str_aux,ERR_ASG_DUPLIC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } try @@ -464,7 +464,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_refs) { if(!object) - throw Exception(ERR_REM_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RemNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { vector *obj_list=nullptr; @@ -474,7 +474,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { vector refs; @@ -491,7 +491,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r //Raises an error indicating the object that is referencing the table if(!dynamic_cast(refs[0])) { - err_type=ERR_REM_DIRECT_REFERENCE; + err_type=RemDirectReference; throw Exception(QString(Exception::getErrorMessage(err_type)) .arg(object->getName(true)) .arg(object->getTypeName()) @@ -503,7 +503,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r { BaseObject *ref_obj_parent=dynamic_cast(refs[0])->getParentTable(); - err_type=ERR_REM_INDIRECT_REFERENCE; + err_type=RemInderectReference; throw Exception(QString(Exception::getErrorMessage(err_type)) .arg(object->getName(true)) .arg(object->getTypeName()) @@ -541,7 +541,7 @@ vector DatabaseModel::getObjects(ObjectType obj_type, BaseObject * obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=obj_list->begin(); itr_end=obj_list->end(); @@ -598,7 +598,7 @@ BaseObject *DatabaseModel::getObject(const QString &name, ObjectType obj_type, i obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { QString signature; @@ -633,9 +633,9 @@ BaseObject *DatabaseModel::getObject(unsigned obj_idx, ObjectType obj_type) obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(obj_idx >= obj_list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); else return(obj_list->at(obj_idx)); } @@ -647,7 +647,7 @@ unsigned DatabaseModel::getObjectCount(ObjectType obj_type) obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else return(obj_list->size()); } @@ -680,7 +680,7 @@ unsigned DatabaseModel::getObjectCount(void) QString DatabaseModel::getLocalization(unsigned localiz_id) { if(localiz_id > Collation::_LC_COLLATE) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(localizations[localiz_id]); } @@ -703,7 +703,7 @@ EncodingType DatabaseModel::getEncoding(void) BaseObject *DatabaseModel::getDefaultObject(ObjectType obj_type) { if(default_objs.count(obj_type)==0) - throw Exception(ERR_REF_OBJ_INV_TYPE, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); return(default_objs[obj_type]); } @@ -1113,7 +1113,7 @@ void DatabaseModel::removeView(View *view, int obj_idx) void DatabaseModel::updateTableFKRelationships(Table *table) { if(!table) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(table->getDatabase()==this) { Table *ref_tab=nullptr; @@ -1215,7 +1215,7 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) vector::iterator itr, itr_end; if(!view) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(getObjectIndex(view) < 0 || force_rel_removal) { //Remove all the relationship related to the view when this latter no longer exists @@ -1475,7 +1475,7 @@ void DatabaseModel::validateRelationships(void) /* If the relationship connection failed after 'rels_gen_pk' times at the different errors or exists on the fail_rels vector (already tried to be validated) it will be deleted from model */ - if((e.getErrorType()!=ERR_LINK_TABLES_NO_PK && conn_tries[rel] > rels_gen_pk) || + if((e.getErrorType()!=InvLinkTablesNoPrimaryKey && conn_tries[rel] > rels_gen_pk) || (std::find(fail_rels.begin(), fail_rels.end(), rel)!=fail_rels.end())) { //Removes the relationship @@ -1491,7 +1491,7 @@ void DatabaseModel::validateRelationships(void) the connection tries exceed the size of the relationship the relationship is isolated on a "failed to validate" list. This list will be appended to the main rel list when there is only one relationship to be validated */ - else if(e.getErrorType()==ERR_LINK_TABLES_NO_PK && + else if(e.getErrorType()==InvLinkTablesNoPrimaryKey && (conn_tries[rel] > rels.size() || rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_NN)) { @@ -1617,7 +1617,7 @@ void DatabaseModel::validateRelationships(void) this->setObjectsModified(); //Redirects all the errors captured on the revalidation - throw Exception(ERR_INVALIDATED_OBJECTS,__PRETTY_FUNCTION__,__FILE__,__LINE__,errors); + throw Exception(RemInvalidatedObjects,__PRETTY_FUNCTION__,__FILE__,__LINE__,errors); } if(!loading_model) @@ -1637,7 +1637,7 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) //Raises an error if the user try to check the redundancy starting from a unnallocated relationship if(!rel) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); rel_type=rel->getRelationshipType(); @@ -1713,10 +1713,10 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) if(found_cycle) { str_aux+=rel->getName(); - msg=Exception::getErrorMessage(ERR_INS_REL_GENS_REDUNDACY) + msg=Exception::getErrorMessage(InsRelationshipRedundancy) .arg(rel->getName()) .arg(str_aux); - throw Exception(msg,ERR_INS_REL_GENS_REDUNDACY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg,InsRelationshipRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -1986,12 +1986,12 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) rel->getRelationshipType() != Relationship::RELATIONSHIP_FK && getRelationship(tab1,tab2)) { - msg=Exception::getErrorMessage(ERR_DUPLIC_RELATIONSHIP) + msg=Exception::getErrorMessage(InsDuplicatedRelationship) .arg(tab1->getName(true)) .arg(tab1->getTypeName()) .arg(tab2->getName(true)) .arg(tab2->getTypeName()); - throw Exception(msg,ERR_DUPLIC_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg,InsDuplicatedRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -2065,7 +2065,7 @@ BaseRelationship *DatabaseModel::getRelationship(unsigned obj_idx, ObjectType re { //Raises an error if the object type used to get a relationship is invalid if(rel_type!=OBJ_RELATIONSHIP && rel_type!=BASE_RELATIONSHIP) - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(getObject(obj_idx, rel_type))); } @@ -2477,12 +2477,12 @@ void DatabaseModel::addDomain(Domain *domain, int obj_idx) //Raises an error if found a type with the same name as the domain if(found) { - str_aux=QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + str_aux=QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(domain->getName(true)) .arg(domain->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); - throw Exception(str_aux, ERR_ASG_DUPLIC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux, AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } try @@ -2643,12 +2643,12 @@ void DatabaseModel::addType(Type *type, int obj_idx) if(found) { - str_aux=QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + str_aux=QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(type->getName(true)) .arg(type->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); - throw Exception(str_aux, ERR_ASG_DUPLIC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux, AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } try @@ -2735,39 +2735,39 @@ void DatabaseModel::addPermission(Permission *perm) try { if(!perm) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); TableObject *tab_obj=dynamic_cast(perm->getObject()); if(getPermissionIndex(perm, false) >=0) { - throw Exception(Exception::getErrorMessage(ERR_ASG_DUPLIC_PERMISSION) + throw Exception(Exception::getErrorMessage(AsgDuplicatedPermission) .arg(perm->getObject()->getName()) .arg(perm->getObject()->getTypeName()), - ERR_ASG_DUPLIC_PERMISSION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the permission is referencing an object that does not exists on model else if(perm->getObject()!=this && ((tab_obj && (getObjectIndex(tab_obj->getParentTable()) < 0)) || (!tab_obj && (getObjectIndex(perm->getObject()) < 0)))) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(perm->getName()) .arg(perm->getObject()->getTypeName()) .arg(perm->getObject()->getName()) .arg(perm->getObject()->getTypeName()), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); permissions.push_back(perm); perm->setDatabase(this); } catch(Exception &e) { - if(e.getErrorType()==ERR_ASG_DUPLIC_OBJECT) + if(e.getErrorType()==AsgDuplicatedObject) throw - Exception(Exception::getErrorMessage(ERR_ASG_DUPLIC_PERMISSION) + Exception(Exception::getErrorMessage(AsgDuplicatedPermission) .arg(perm->getObject()->getName()) .arg(perm->getObject()->getTypeName()), - ERR_ASG_DUPLIC_PERMISSION,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); @@ -2793,7 +2793,7 @@ void DatabaseModel::removePermissions(BaseObject *object) unsigned idx=0; if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=permissions.begin(); itr_end=permissions.end(); @@ -2821,7 +2821,7 @@ void DatabaseModel::getPermissions(BaseObject *object, vector &per Permission *perm=nullptr; if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=permissions.begin(); itr_end=permissions.end(); @@ -2935,7 +2935,7 @@ int DatabaseModel::getObjectIndex(BaseObject *object) obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { itr=obj_list->begin(); @@ -2985,12 +2985,12 @@ void DatabaseModel::loadModel(const QString &filename) map def_objs; //Configuring the path to the base path for objects DTD - dtd_file=GlobalAttributes::SCHEMAS_ROOT_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::OBJECT_DTD_DIR + - GlobalAttributes::DIR_SEPARATOR; + dtd_file=GlobalAttributes::SchemasRootDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::ObjectDTDDir + + GlobalAttributes::DirSeparator; try { @@ -2998,9 +2998,9 @@ void DatabaseModel::loadModel(const QString &filename) xmlparser.restartParser(); //Loads the root DTD - xmlparser.setDTDFile(dtd_file + GlobalAttributes::ROOT_DTD + - GlobalAttributes::OBJECT_DTD_EXT, - GlobalAttributes::ROOT_DTD); + xmlparser.setDTDFile(dtd_file + GlobalAttributes::RootDTD + + GlobalAttributes::ObjectDTDExt, + GlobalAttributes::RootDTD); //Loads the file validating it against the root DTD xmlparser.loadXMLFile(filename); @@ -3096,12 +3096,12 @@ void DatabaseModel::loadModel(const QString &filename) object=this->getObject(itr.second, itr.first); if(!object) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(this->getName()) .arg(this->getTypeName()) .arg(itr.second) .arg(BaseObject::getTypeName(itr.first)), - ERR_ASG_DUPLIC_PERMISSION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setDefaultObject(object); } @@ -3141,10 +3141,10 @@ void DatabaseModel::loadModel(const QString &filename) if(xmlparser.getCurrentElement()) extra_info=QString(QObject::trUtf8("%1 (line: %2)")).arg(xmlparser.getLoadedFilename()).arg(xmlparser.getCurrentElement()->line); - if(e.getErrorType()>=ERR_INV_SYNTAX) + if(e.getErrorType()>=InvalidSyntax) { - str_aux=QString(Exception::getErrorMessage(ERR_LOAD_INV_MODEL_FILE)).arg(filename); - throw Exception(str_aux,ERR_LOAD_INV_MODEL_FILE,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); + str_aux=QString(Exception::getErrorMessage(InvModelFileNotLoaded)).arg(filename); + throw Exception(str_aux,InvModelFileNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); @@ -3234,7 +3234,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) bool has_error=false, protected_obj=false, sql_disabled=false; if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); xmlparser.getElementAttributes(attribs); @@ -3343,12 +3343,12 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) if(has_error) { - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(object->getName()) .arg(object->getTypeName()) .arg(attribs_aux[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(obj_type)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!object->getSchema() && (obj_type_aux==OBJ_FUNCTION || obj_type_aux==OBJ_TABLE || @@ -3358,10 +3358,10 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) obj_type_aux==OBJ_TYPE || obj_type_aux==OBJ_OPFAMILY || obj_type_aux==OBJ_OPCLASS)) { - throw Exception(Exception::getErrorMessage(ERR_ALOC_OBJECT_NO_SCHEMA) + throw Exception(Exception::getErrorMessage(InvObjectAllocationNoSchema) .arg(object->getName()) .arg(object->getTypeName()), - ERR_ALOC_OBJECT_NO_SCHEMA,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvObjectAllocationNoSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -3513,12 +3513,12 @@ Role *DatabaseModel::createRole(void) //Raises an error if the roles doesn't exists if(!ref_role) { - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(role->getName()) .arg(BaseObject::getTypeName(OBJ_ROLE)) .arg(list[i]) .arg(BaseObject::getTypeName(OBJ_ROLE)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } role->addRole(role_type, ref_role); @@ -3624,12 +3624,12 @@ Language *DatabaseModel::createLanguage(void) //Raises an error if the function doesn't exists if(!func) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(lang->getName()) .arg(lang->getTypeName()) .arg(signature) .arg(BaseObject::getTypeName(OBJ_FUNCTION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(ref_type==ParsersAttributes::VALIDATOR_FUNC) lang->setFunction(dynamic_cast(func), Language::VALIDATOR_FUNC); @@ -3641,7 +3641,7 @@ Language *DatabaseModel::createLanguage(void) } else //Raises an error if the function type is invalid - throw Exception(ERR_REF_FUNCTION_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -3755,12 +3755,12 @@ Function *DatabaseModel::createFunction(void) //Raises an error if the function doesn't exisits if(!object) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(func->getName()) .arg(func->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_LANGUAGE)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); func->setLanguage(dynamic_cast(object)); } @@ -3799,11 +3799,11 @@ Function *DatabaseModel::createFunction(void) delete(func); } - if(e.getErrorType()==ERR_REF_INEXIST_USER_TYPE) - throw Exception(Exception::getErrorMessage(ERR_ASG_OBJ_INV_DEFINITION) + if(e.getErrorType()==RefUserTypeInexistsModel) + throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) .arg(str_aux) .arg(BaseObject::getTypeName(OBJ_FUNCTION)), - ERR_ASG_OBJ_INV_DEFINITION,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); + AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } @@ -3893,12 +3893,12 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) //Raises an error if the operator class doesn't exists if(!collation) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(tpattrib.getName()) .arg(tpattrib.getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_COLLATION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } tpattrib.setCollation(collation); @@ -3970,7 +3970,7 @@ PgSQLType DatabaseModel::createPgSQLType(void) { //Raises an error if the referenced type name doesn't exists if(PgSQLType::getUserTypeIndex(name,nullptr,this) == BaseType::null) - throw Exception(ERR_REF_INEXIST_USER_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefUserTypeInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_idx=PgSQLType::getUserTypeIndex(name, ptype); return(PgSQLType(type_idx,length,dimension,precision,with_timezone,interv_type,spatial_type)); @@ -4085,12 +4085,12 @@ Type *DatabaseModel::createType(void) //Raises an error if the operator class doesn't exists if(!collation) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_COLLATION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } type->setCollation(collation); @@ -4103,12 +4103,12 @@ Type *DatabaseModel::createType(void) //Raises an error if the operator class doesn't exists if(!op_class) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_OPCLASS)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } type->setSubtypeOpClass(op_class); @@ -4123,15 +4123,15 @@ Type *DatabaseModel::createType(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_FUNCTION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the function type is invalid else if(func_types.count(attribs[ParsersAttributes::REF_TYPE])==0) - throw Exception(ERR_REF_FUNCTION_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); type->setFunction(func_types[attribs[ParsersAttributes::REF_TYPE]], dynamic_cast(func)); } @@ -4148,11 +4148,11 @@ Type *DatabaseModel::createType(void) delete(type); } - if(e.getErrorType()==ERR_REF_INEXIST_USER_TYPE) - throw Exception(Exception::getErrorMessage(ERR_ASG_OBJ_INV_DEFINITION) + if(e.getErrorType()==RefUserTypeInexistsModel) + throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) .arg(str_aux) .arg(type->getTypeName()), - ERR_ASG_OBJ_INV_DEFINITION,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); + AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } @@ -4263,12 +4263,12 @@ Cast *DatabaseModel::createCast(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(cast->getName()) .arg(cast->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_FUNCTION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); cast->setCastFunction(dynamic_cast(func)); } @@ -4322,12 +4322,12 @@ Conversion *DatabaseModel::createConversion(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(conv->getName()) .arg(conv->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_FUNCTION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); conv->setConversionFunction(dynamic_cast(func)); } @@ -4387,12 +4387,12 @@ Operator *DatabaseModel::createOperator(void) //Raises an error if the auxiliary operator doesn't exists if(!oper_aux && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(oper->getSignature(true)) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_OPERATOR)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setOperator(dynamic_cast(oper_aux), oper_types[attribs[ParsersAttributes::REF_TYPE]]); @@ -4416,12 +4416,12 @@ Operator *DatabaseModel::createOperator(void) //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(oper->getName()) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_FUNCTION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setFunction(dynamic_cast(func), func_types[attribs[ParsersAttributes::REF_TYPE]]); @@ -4479,12 +4479,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) //Raises an error if the operator family doesn't exists if(!object) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_OPFAMILY)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); op_class->setFamily(dynamic_cast(object)); } @@ -4529,12 +4529,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],OBJ_OPFAMILY); if(!object && !attribs_aux[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs_aux[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_OPFAMILY)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); class_elem.setOperatorFamily(dynamic_cast(object)); xmlparser.restorePosition(); @@ -4620,12 +4620,12 @@ Aggregate *DatabaseModel::createAggregate(void) //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(aggreg->getName()) .arg(aggreg->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_FUNCTION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::TRANSITION_FUNC) aggreg->setFunction(Aggregate::TRANSITION_FUNC, @@ -4697,12 +4697,12 @@ Table *DatabaseModel::createTable(void) if(!tag) { - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_TABLE)) .arg(aux_attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(OBJ_TAG)) - , ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + , RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } table->setTag(dynamic_cast(tag)); @@ -4823,12 +4823,12 @@ Column *DatabaseModel::createColumn(void) seq=getObject(attribs[ParsersAttributes::SEQUENCE], OBJ_SEQUENCE); if(!seq) - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_COLUMN)) .arg(attribs[ParsersAttributes::SEQUENCE]) .arg(BaseObject::getTypeName(OBJ_SEQUENCE)), - ERR_PERM_REF_INEXIST_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); column->setSequence(seq); @@ -4893,7 +4893,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) rel=dynamic_cast(parent_obj); else //Raises an error if the user tries to create a constraint in a invalid parent - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -4905,13 +4905,13 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Raises an error if the parent table doesn't exists if(!table) { - str_aux=QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_CONSTRAINT)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(OBJ_TABLE)); - throw Exception(str_aux,ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -4939,9 +4939,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Raises an error if the constraint is a primary key and no parent object is specified if(!parent_obj && constr_type==ConstraintType::primary_key) - throw Exception(Exception::getErrorMessage(ERR_INV_PRIM_KEY_ALOCATION) + throw Exception(Exception::getErrorMessage(InvPrimaryKeyAllocation) .arg(constr->getName()), - ERR_INV_PRIM_KEY_ALOCATION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvPrimaryKeyAllocation,__PRETTY_FUNCTION__,__FILE__,__LINE__); deferrable=(attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::_TRUE_); constr->setDeferrable(deferrable); @@ -4968,13 +4968,13 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Raises an error if the referenced table doesn't exists if(!ref_table) { - str_aux=QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(constr->getName()) .arg(constr->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) .arg(BaseObject::getTypeName(OBJ_TABLE)); - throw Exception(str_aux,ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } constr->setReferencedTable(dynamic_cast(ref_table)); @@ -5119,20 +5119,20 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_OPCLASS)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { - throw Exception(QString(Exception::getErrorMessage(ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_OPCLASS)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5147,12 +5147,12 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec //Raises an error if the operator doesn't exists if(!oper) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_OPERATOR)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } elem.setOperator(oper); @@ -5167,20 +5167,20 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_COLLATION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { - throw Exception(QString(Exception::getErrorMessage(ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_COLLATION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5207,20 +5207,20 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_COLUMN)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { - throw Exception(QString(Exception::getErrorMessage(ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_COLUMN)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5251,7 +5251,7 @@ QString DatabaseModel::getAlterDefinition(BaseObject *object) DatabaseModel *db_aux=dynamic_cast(object); if(!db_aux) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -5301,13 +5301,13 @@ Index *DatabaseModel::createIndex(void) //Raises an error if the parent table doesn't exists if(!table) { - str_aux=QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_INDEX)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(OBJ_TABLE)); - throw Exception(str_aux,ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } index=new Index; @@ -5380,12 +5380,12 @@ Rule *DatabaseModel::createRule(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_VIEW)); if(!table) - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_RULE)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(OBJ_TABLE)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); rule->setExecutionType(attribs[ParsersAttributes::EXEC_TYPE]); @@ -5459,12 +5459,12 @@ Trigger *DatabaseModel::createTrigger(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_VIEW)); if(!table) - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_TRIGGER)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(OBJ_TABLE)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); trigger=new Trigger; @@ -5516,12 +5516,12 @@ Trigger *DatabaseModel::createTrigger(void) //Raises an error if the trigger is referencing a inexistent table if(!ref_table) { - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) .arg(BaseObject::getTypeName(OBJ_TABLE)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } trigger->setReferecendTable(dynamic_cast(ref_table)); @@ -5543,13 +5543,13 @@ Trigger *DatabaseModel::createTrigger(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) { - str_aux=QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_FUNCTION)); - throw Exception(str_aux,ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } trigger->setFunction(dynamic_cast(func)); @@ -5613,12 +5613,12 @@ Policy *DatabaseModel::createPolicy(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE)); if(!table) - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_POLICY)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(OBJ_TABLE)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::_TRUE_); policy->setPolicyCommand(PolicyCmdType(attribs[ParsersAttributes::COMMAND])); @@ -5660,12 +5660,12 @@ Policy *DatabaseModel::createPolicy(void) //Raises an error if the referenced role doesn't exists if(!role) { - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(policy->getName()) .arg(policy->getTypeName()) .arg(name) .arg(BaseObject::getTypeName(OBJ_ROLE)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } policy->addRole(role); @@ -5718,12 +5718,12 @@ EventTrigger *DatabaseModel::createEventTrigger(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(event_trig->getName()) .arg(event_trig->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(OBJ_FUNCTION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } event_trig->setFunction(dynamic_cast(func)); @@ -5822,13 +5822,13 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) //Raises an error if the column parent table doesn't exists if(!table) { - str_aux=QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(sequence->getName()) .arg(BaseObject::getTypeName(OBJ_SEQUENCE)) .arg(tab_name) .arg(BaseObject::getTypeName(OBJ_TABLE)); - throw Exception(str_aux,ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } column=dynamic_cast
(table)->getColumn(col_name); @@ -5838,9 +5838,9 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) //Raises an error if the column doesn't exists if(!column && !ignore_onwer) - throw Exception(Exception::getErrorMessage(ERR_ASG_INEXIST_OWNER_COL_SEQ) + throw Exception(Exception::getErrorMessage(AsgInexistentSeqOwnerColumn) .arg(sequence->getName(true)), - ERR_ASG_INEXIST_OWNER_COL_SEQ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgInexistentSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); sequence->setOwnerColumn(column); } @@ -5903,13 +5903,13 @@ View *DatabaseModel::createView(void) //Raises an error if the table doesn't exists if(!table) { - str_aux=QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(view->getName()) .arg(BaseObject::getTypeName(OBJ_VIEW)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(OBJ_TABLE)); - throw Exception(str_aux,ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(!attribs[ParsersAttributes::COLUMN].isEmpty()) @@ -5922,14 +5922,14 @@ View *DatabaseModel::createView(void) //Raises an error if the view references an inexistant column if(!column) { - str_aux=QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(view->getName()) .arg(BaseObject::getTypeName(OBJ_VIEW)) .arg(attribs[ParsersAttributes::TABLE] + QString(".") + attribs[ParsersAttributes::COLUMN]) .arg(BaseObject::getTypeName(OBJ_COLUMN)); - throw Exception(str_aux,ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5997,12 +5997,12 @@ View *DatabaseModel::createView(void) if(!tag) { - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(OBJ_TABLE)) .arg(aux_attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(OBJ_TAG)) - , ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + , RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } view->setTag(dynamic_cast(tag)); @@ -6071,12 +6071,12 @@ Collation *DatabaseModel::createCollation(void) //Raises an error if the copy collation doesn't exists if(!copy_coll) { - throw Exception(QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(collation->getName()) .arg(BaseObject::getTypeName(OBJ_COLLATION)) .arg(attribs[ParsersAttributes::COLLATION]) .arg(BaseObject::getTypeName(OBJ_COLLATION)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } collation->setCollation(dynamic_cast(copy_coll)); @@ -6245,13 +6245,13 @@ BaseRelationship *DatabaseModel::createRelationship(void) //Raises an error if some table doesn't exists if(!tables[i]) { - str_aux=QString(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL)) + str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(obj_rel_type)) .arg(attribs[tab_attribs[i]]) .arg(BaseObject::getTypeName(table_types[i])); - throw Exception(str_aux,ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -6291,10 +6291,10 @@ BaseRelationship *DatabaseModel::createRelationship(void) //Throws an error if the relationship was created without a valid foreign key attached to it if(!base_rel->getReferenceForeignKey()) { - throw Exception(Exception::getErrorMessage(ERR_ALOC_INV_FK_RELATIONSHIP) + throw Exception(Exception::getErrorMessage(InvAllocationFKRelationship) .arg(attribs[ParsersAttributes::NAME]) .arg(src_tab->getName(true)), - ERR_ALOC_INV_FK_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvAllocationFKRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -6302,12 +6302,12 @@ BaseRelationship *DatabaseModel::createRelationship(void) base_rel->setName(attribs[ParsersAttributes::NAME]); if(!base_rel) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(this->getName()) .arg(this->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(BASE_RELATIONSHIP)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); base_rel->blockSignals(loading_model); base_rel->disconnectRelationship(); @@ -6539,10 +6539,10 @@ Permission *DatabaseModel::createPermission(void) //Raises an error if the permission references an object that does not exists if(!object) - throw Exception(Exception::getErrorMessage(ERR_PERM_REF_INEXIST_OBJECT) + throw Exception(Exception::getErrorMessage(PermissionRefInexistObject) .arg(obj_name) .arg(BaseObject::getTypeName(obj_type)), - ERR_PERM_REF_INEXIST_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); perm=new Permission(object); perm->setRevoke(revoke); @@ -6564,10 +6564,10 @@ Permission *DatabaseModel::createPermission(void) //Raises an error if the referenced role doesn't exists if(!role) { - throw Exception(Exception::getErrorMessage(ERR_PERM_REF_INEXIST_OBJECT) + throw Exception(Exception::getErrorMessage(PermissionRefInexistObject) .arg(list[i]) .arg(BaseObject::getTypeName(OBJ_ROLE)), - ERR_REF_OBJ_INEXISTS_MODEL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6641,12 +6641,12 @@ void DatabaseModel::validateColumnRemoval(Column *column) //Raises an error if there are objects referencing the column if(!refs.empty()) - throw Exception(Exception::getErrorMessage(ERR_REM_DIRECT_REFERENCE) + throw Exception(Exception::getErrorMessage(RemDirectReference) .arg(column->getParentTable()->getName(true) + QString(".") + column->getName(true)) .arg(column->getTypeName()) .arg(refs[0]->getName(true)) .arg(refs[0]->getTypeName()), - ERR_REM_DIRECT_REFERENCE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RemDirectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -6919,7 +6919,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[ParsersAttributes::SEARCH_PATH]=search_path; attribs_aux[ParsersAttributes::MODEL_AUTHOR]=author; - attribs_aux[ParsersAttributes::PGMODELER_VERSION]=GlobalAttributes::PGMODELER_VERSION; + attribs_aux[ParsersAttributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; if(def_type==SchemaParser::XML_DEFINITION) { @@ -7402,8 +7402,8 @@ void DatabaseModel::saveModel(const QString &filename, unsigned def_type) output.open(QFile::WriteOnly); if(!output.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(filename), - ERR_FILE_DIR_NOT_WRITTEN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), + FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -7414,8 +7414,8 @@ void DatabaseModel::saveModel(const QString &filename, unsigned def_type) catch(Exception &e) { if(output.isOpen()) output.close(); - throw Exception(Exception::getErrorMessage(ERR_FILE_NOT_WRITTER_INV_DEF).arg(filename), - ERR_FILE_NOT_WRITTER_INV_DEF,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(Exception::getErrorMessage(FileNotWrittenInvalidDefinition).arg(filename), + FileNotWrittenInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -9194,7 +9194,7 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s //Raise an error if the schema is not allocated if(!schema) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Get all the objects on the informed schema for(unsigned i=0; i < 5; i++) @@ -9439,7 +9439,7 @@ void DatabaseModel::setDefaultObject(BaseObject *object, ObjectType obj_type) { if((!object && default_objs.count(obj_type)==0) || (object && default_objs.count(object->getObjectType())==0)) - throw Exception(ERR_REF_OBJ_INV_TYPE, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); if(!object) default_objs[obj_type]=nullptr; @@ -9516,8 +9516,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option output.open(QFile::WriteOnly); if(!output.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(filename), - ERR_FILE_DIR_NOT_WRITTEN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), + FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -9686,9 +9686,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { schparser.ignoreUnkownAttributes(true); attribs[ParsersAttributes::POSITION]= - schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::POSITION + GlobalAttributes::SCHEMA_EXT, attribs); + schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::POSITION + GlobalAttributes::SchemaExt, attribs); } } else @@ -9713,9 +9713,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option schparser.ignoreUnkownAttributes(true); attribs[ParsersAttributes::POSITION]+= - schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::POSITION + GlobalAttributes::SCHEMA_EXT, attribs); + schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::POSITION + GlobalAttributes::SchemaExt, attribs); } //Saving the labels' custom positions @@ -9728,13 +9728,13 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option aux_attribs[ParsersAttributes::Y_POS]=QString::number(pnt.y()); aux_attribs[ParsersAttributes::REF_TYPE]=labels_attrs[id]; - aux_attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::POSITION + GlobalAttributes::SCHEMA_EXT, aux_attribs); + aux_attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::POSITION + GlobalAttributes::SchemaExt, aux_attribs); - attribs[ParsersAttributes::POSITION]+=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::LABEL + GlobalAttributes::SCHEMA_EXT, aux_attribs); + attribs[ParsersAttributes::POSITION]+=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::LABEL + GlobalAttributes::SchemaExt, aux_attribs); } } } @@ -9744,14 +9744,14 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_custom_sql) { if(!object->getAppendedSQL().isEmpty()) - attribs[ParsersAttributes::APPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - QString(ParsersAttributes::APPENDED_SQL).remove(QChar('-')) + GlobalAttributes::SCHEMA_EXT, attribs); + attribs[ParsersAttributes::APPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + + QString(ParsersAttributes::APPENDED_SQL).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); if(!object->getPrependedSQL().isEmpty()) - attribs[ParsersAttributes::PREPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - QString(ParsersAttributes::PREPENDED_SQL).remove(QChar('-')) + GlobalAttributes::SCHEMA_EXT, attribs); + attribs[ParsersAttributes::PREPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + + QString(ParsersAttributes::PREPENDED_SQL).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); } /* The object's metadata code will be generated only if one of the key attributes @@ -9778,9 +9778,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option schparser.ignoreUnkownAttributes(true); objs_def+=schparser.convertCharsToXMLEntities( - schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::INFO + GlobalAttributes::SCHEMA_EXT, attribs)); + schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::INFO + GlobalAttributes::SchemaExt, attribs)); } else idx++; @@ -9792,9 +9792,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { //Generates the metadata XML buffer attribs[ParsersAttributes::INFO]=objs_def; - buf.append(schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::METADATA + GlobalAttributes::SCHEMA_EXT, attribs)); + buf.append(schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::METADATA + GlobalAttributes::SchemaExt, attribs)); output.write(buf.data(),buf.size()); emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), BASE_OBJECT); @@ -9807,20 +9807,20 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option catch(Exception &e) { if(output.isOpen()) output.close(); - throw Exception(Exception::getErrorMessage(ERR_FILE_NOT_WRITTER_INV_DEF).arg(filename), - ERR_FILE_NOT_WRITTER_INV_DEF,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(Exception::getErrorMessage(FileNotWrittenInvalidDefinition).arg(filename), + FileNotWrittenInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned options) { QString elem_name, aux_elem, obj_name, ref_type, - dtd_file=GlobalAttributes::SCHEMAS_ROOT_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::XML_SCHEMA_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::OBJECT_DTD_DIR + - GlobalAttributes::DIR_SEPARATOR; + dtd_file=GlobalAttributes::SchemasRootDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::XMLSchemaDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::ObjectDTDDir + + GlobalAttributes::DirSeparator; attribs_map attribs, aux_attrib; ObjectType obj_type; BaseObject *object=nullptr, *new_object=nullptr; @@ -9858,9 +9858,9 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option xmlparser.restartParser(); - xmlparser.setDTDFile(dtd_file + GlobalAttributes::METADATA_DTD + - GlobalAttributes::OBJECT_DTD_EXT, - GlobalAttributes::METADATA_DTD); + xmlparser.setDTDFile(dtd_file + GlobalAttributes::MetadataDTD + + GlobalAttributes::ObjectDTDExt, + GlobalAttributes::MetadataDTD); xmlparser.loadXMLFile(filename); diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 53152eb4ff..0f3502faae 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -180,7 +180,7 @@ class DatabaseModel: public QObject, public BaseObject { void setObjectListsCapacity(unsigned capacity); public: - static const unsigned META_DB_ATTRIBUTES=1, //! \brief Handle database model attribute when save/load metadata file + static constexpr unsigned META_DB_ATTRIBUTES=1, //! \brief Handle database model attribute when save/load metadata file META_OBJS_POSITIONING=2, //! \brief Handle objects' positioning when save/load metadata file META_OBJS_PROTECTION=4, //! \brief Handle objects' protection status when save/load metadata file META_OBJS_SQLDISABLED=8, //! \brief Handle objects' sql disabled status when save/load metadata file diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index fe5672dc5c..6cde10f77b 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -32,19 +32,19 @@ void Domain::addCheckConstraint(const QString &name, const QString &expr) { //Raises an error if the constraint name is invalid if(!name.isEmpty() && !BaseObject::isValidName(name)) - throw Exception(ERR_ASG_INV_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(expr.isEmpty()) - throw Exception(ERR_ASG_INV_EXPR_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(chk_constrs.count(name)) { - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(name) .arg(BaseObject::getTypeName(OBJ_CONSTRAINT)) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_ASG_DUPLIC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } chk_constrs[name] = expr; @@ -161,7 +161,7 @@ QString Domain::getAlterDefinition(BaseObject *object) Domain *domain=dynamic_cast(object); if(!domain) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index f5288fcb9c..d35f225679 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -53,7 +53,7 @@ void Element::setOperatorClass(OperatorClass *oper_class) void Element::setSortingAttribute(unsigned attrib, bool value) { if(attrib > NULLS_FIRST) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); sorting_attibs[attrib]=value; } @@ -71,7 +71,7 @@ bool Element::isSortingEnabled(void) bool Element::getSortingAttribute(unsigned attrib) { if(attrib > NULLS_FIRST) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(sorting_attibs[attrib]); } diff --git a/libpgmodeler/src/element.h b/libpgmodeler/src/element.h index ec55173293..da71411473 100644 --- a/libpgmodeler/src/element.h +++ b/libpgmodeler/src/element.h @@ -60,7 +60,7 @@ class Element { public: //! \brief Constants used to reference the sorting method of the element - static const unsigned ASC_ORDER=0, + static constexpr unsigned ASC_ORDER=0, NULLS_FIRST=1; Element(void); diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 7d5edd7a81..e72fec9c2c 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -36,22 +36,22 @@ void EventTrigger::setEvent(EventTriggerType evnt_type) void EventTrigger::setFunction(Function *func) { if(!func) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_FUNCTION) + throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_EVENT_TRIGGER)), - ERR_ASG_NOT_ALOC_FUNCTION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions with return type other that event_trigger are not accepted else if(func->getReturnType()!=QString("event_trigger")) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_TRIGGER_FUNCTION).arg(QString("event_trigger")),__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(AsgInvalidTriggerFunction).arg(QString("event_trigger")),__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions with one or more parameters are not accepted else if(func->getParameterCount()!=0) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_INV_PARAM_COUNT) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_EVENT_TRIGGER)), - ERR_ASG_FUNC_INV_PARAM_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions coded in SQL lang. is not accepted by event triggers else if(func->getLanguage()->getName()==~LanguageType(LanguageType::sql)) - throw Exception(ERR_ASG_EVNT_TRIG_FUNC_INV_LANG,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgEventTriggerFuncInvalidLang,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(function != func); function=func; @@ -60,7 +60,7 @@ void EventTrigger::setFunction(Function *func) void EventTrigger::setFilter(const QString &variable, const QStringList &values) { if(variable.toLower()!=ParsersAttributes::TAG) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_EVENT_TRIGGER_VARIABLE).arg(variable),__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(AsgInvalidEventTriggerVariable).arg(variable),__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!values.isEmpty()) { diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 2968e65ffe..0c948dbc4f 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -51,9 +51,9 @@ void Extension::setHandlesType(bool value) try to change the attribute value. This cannot be done to avoid cascade reference breaking on table columns/functions or any other objects that references PgSQLType */ if(!value && PgSQLType::getUserTypeIndex(this->getName(true), this) != BaseType::null) - throw Exception(Exception::getErrorMessage(ERR_REG_EXT_NOT_HANDLING_TYPE) + throw Exception(Exception::getErrorMessage(ExtensionHandlingTypeImmutable) .arg(this->getName(true)), - ERR_REG_EXT_NOT_HANDLING_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ExtensionHandlingTypeImmutable,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->handles_type=value; } @@ -61,7 +61,7 @@ void Extension::setHandlesType(bool value) void Extension::setVersion(unsigned ver, const QString &value) { if(ver > OLD_VERSION) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(versions[ver] != value); versions[ver]=value; @@ -75,7 +75,7 @@ bool Extension::handlesType(void) QString Extension::getVersion(unsigned ver) { if(ver > OLD_VERSION) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(versions[ver]); } @@ -98,7 +98,7 @@ QString Extension::getAlterDefinition(BaseObject *object) Extension *ext=dynamic_cast(object); if(!ext) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/extension.h b/libpgmodeler/src/extension.h index 2ca77f871b..4a55c47341 100644 --- a/libpgmodeler/src/extension.h +++ b/libpgmodeler/src/extension.h @@ -40,7 +40,7 @@ class Extension: public BaseObject { QString versions[2]; public: - static const unsigned CUR_VERSION=0, + static constexpr unsigned CUR_VERSION=0, OLD_VERSION=1; Extension(void); diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index b7ef235a6b..8ec97ecef0 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -80,10 +80,10 @@ void Function::addParameter(Parameter param) //If a duplicated parameter is found an error is raised if(found) - throw Exception(Exception::getErrorMessage(ERR_ASG_DUPLIC_PARAM_FUNCTION) + throw Exception(Exception::getErrorMessage(AsgDuplicatedParameterFunction) .arg(param.getName()) .arg(this->signature), - ERR_ASG_DUPLIC_PARAM_FUNCTION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedParameterFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Inserts the parameter in the function parameters.push_back(param); @@ -94,7 +94,7 @@ void Function::addReturnedTableColumn(const QString &name, PgSQLType type) { //Raises an error if the column name is empty if(name.isEmpty()) - throw Exception(ERR_ASG_EMPTY_NAME_RET_TABLE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgEmptyNameTableReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr,itr_end; bool found=false; @@ -113,10 +113,10 @@ void Function::addReturnedTableColumn(const QString &name, PgSQLType type) //Raises an error if the column is duplicated if(found) - throw Exception(Exception::getErrorMessage(ERR_INS_DUPLIC_RET_TAB_TYPE) + throw Exception(Exception::getErrorMessage(InsDuplicatedTableReturnType) .arg(name) .arg(this->signature), - ERR_INS_DUPLIC_RET_TAB_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InsDuplicatedTableReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); Parameter p; p.setName(name); @@ -174,9 +174,9 @@ void Function::setRowAmount(unsigned row_amount) void Function::setLibrary(const QString &library) { if(language->getName().toLower()!=~LanguageType("c")) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_REFLIB_LANG_NOT_C) + throw Exception(Exception::getErrorMessage(AsgRefLibraryFuncLanguageNotC) .arg(this->getSignature()), - ERR_ASG_FUNC_REFLIB_LANG_NOT_C,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgRefLibraryFuncLanguageNotC,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->library != library); this->library=library; @@ -185,9 +185,9 @@ void Function::setLibrary(const QString &library) void Function::setSymbol(const QString &symbol) { if(language->getName().toLower()!=~LanguageType("c")) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_REFLIB_LANG_NOT_C) + throw Exception(Exception::getErrorMessage(AsgRefLibraryFuncLanguageNotC) .arg(this->getSignature()), - ERR_ASG_FUNC_REFLIB_LANG_NOT_C,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgRefLibraryFuncLanguageNotC,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->symbol != symbol); this->symbol=symbol; @@ -209,10 +209,10 @@ void Function::setLanguage(BaseObject *language) { //Raises an error if the language is not allocated if(!language) - throw Exception(ERR_ASG_NOT_ALOC_LANGUAGE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocatedLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the language object is invalid else if(language->getObjectType()!=OBJ_LANGUAGE) - throw Exception(ERR_ASG_INV_LANGUAGE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidLanguageObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->language != language); this->language=language; @@ -251,9 +251,9 @@ void Function::setBehaviorType(BehaviorType behav_type) void Function::setSourceCode(const QString &src_code) { if(language && language->getName().toLower()==~LanguageType("c")) - throw Exception(Exception::getErrorMessage(ERR_ASG_CODE_FUNC_C_LANGUAGE) + throw Exception(Exception::getErrorMessage(AsgSourceCodeFuncCLanguage) .arg(this->getSignature()), - ERR_ASG_CODE_FUNC_C_LANGUAGE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgSourceCodeFuncCLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->source_code != src_code); this->source_code=src_code; @@ -323,7 +323,7 @@ Parameter Function::getParameter(unsigned param_idx) { //Raises an error if the parameter index is out of bound if(param_idx>=parameters.size()) - throw Exception(ERR_REF_PARAM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefParameterInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(parameters[param_idx]); } @@ -332,7 +332,7 @@ Parameter Function::getReturnedTableColumn(unsigned column_idx) { //Raises an error if the column index is out of bound if(column_idx>=ret_table_columns.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(ret_table_columns[column_idx]); } @@ -395,7 +395,7 @@ void Function::removeParameter(unsigned param_idx) { //Raises an error if parameter index is out of bound if(param_idx>=parameters.size()) - throw Exception(ERR_REF_PARAM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefParameterInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr; itr=parameters.begin()+param_idx; @@ -407,7 +407,7 @@ void Function::removeParameter(unsigned param_idx) void Function::removeReturnedTableColumn(unsigned column_idx) { if(column_idx>=ret_table_columns.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr; itr=ret_table_columns.begin()+column_idx; @@ -499,7 +499,7 @@ QString Function::getAlterDefinition(BaseObject *object) Function *func=dynamic_cast(object); if(!func) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 242e61b5bc..8d083e8fca 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -74,9 +74,9 @@ int Index::getElementIndex(IndexElement elem) void Index::addIndexElement(IndexElement elem) { if(getElementIndex(elem) >= 0) - throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(elem.getExpression().isEmpty() && !elem.getColumn()) - throw Exception(ERR_ASG_INV_EXPR_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); idx_elements.push_back(elem); setCodeInvalidated(true); @@ -91,7 +91,7 @@ void Index::addIndexElement(const QString &expr, Collation *coll, OperatorClass //Raises an error if the expression is empty if(expr.isEmpty()) - throw Exception(ERR_ASG_INV_EXPR_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the element elem.setExpression(expr); @@ -102,7 +102,7 @@ void Index::addIndexElement(const QString &expr, Collation *coll, OperatorClass elem.setSortingAttribute(IndexElement::ASC_ORDER, asc_order); if(getElementIndex(elem) >= 0) - throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); idx_elements.push_back(elem); setCodeInvalidated(true); @@ -122,10 +122,10 @@ void Index::addIndexElement(Column *column, Collation *coll, OperatorClass *op_c //Case the column is not allocated raises an error if(!column) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_COLUMN) + throw Exception(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn) .arg(this->getName()) .arg(this->getTypeName()), - ERR_ASG_NOT_ALOC_COLUMN, __PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::AsgNotAllocatedColumn, __PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the element elem.setColumn(column); @@ -136,7 +136,7 @@ void Index::addIndexElement(Column *column, Collation *coll, OperatorClass *op_c elem.setSortingAttribute(IndexElement::ASC_ORDER, asc_order); if(getElementIndex(elem) >= 0) - throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); idx_elements.push_back(elem); setCodeInvalidated(true); @@ -169,7 +169,7 @@ void Index::addIndexElements(vector &elems) void Index::removeIndexElement(unsigned idx_elem) { if(idx_elem >= idx_elements.size()) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); idx_elements.erase(idx_elements.begin() + idx_elem); setCodeInvalidated(true); @@ -184,7 +184,7 @@ void Index::removeIndexElements(void) IndexElement Index::getIndexElement(unsigned elem_idx) { if(elem_idx >= idx_elements.size()) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(idx_elements[elem_idx]); } @@ -202,7 +202,7 @@ unsigned Index::getIndexElementCount(void) void Index::setIndexAttribute(unsigned attrib_id, bool value) { if(attrib_id > BUFFERING) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(index_attribs[attrib_id] != value); index_attribs[attrib_id]=value; @@ -235,7 +235,7 @@ unsigned Index::getFillFactor(void) bool Index::getIndexAttribute(unsigned attrib_id) { if(attrib_id > BUFFERING) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(index_attribs[attrib_id]); } @@ -380,7 +380,7 @@ QString Index::getAlterDefinition(BaseObject *object) Index *index=dynamic_cast(object); if(!index) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/index.h b/libpgmodeler/src/index.h index d372b739be..5bdbb019a4 100644 --- a/libpgmodeler/src/index.h +++ b/libpgmodeler/src/index.h @@ -54,7 +54,7 @@ class Index: public TableObject{ void validateElements(void); public: - static const unsigned UNIQUE=0, + static constexpr unsigned UNIQUE=0, CONCURRENT=1, FAST_UPDATE=2, BUFFERING=3; diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 050e3a8eae..f435891a7f 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -36,10 +36,10 @@ void Language::setName(const QString &name) { //Raises an error if the user try to set an system reserved language name (C, SQL) if(name.toLower()==~LanguageType("c") || name.toLower()==~LanguageType("sql")) - throw Exception(Exception::getErrorMessage(ERR_ASG_RESERVED_NAME) + throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_LANGUAGE)), - ERR_ASG_RESERVED_NAME,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); } @@ -83,19 +83,19 @@ void Language::setFunction(Function *func, unsigned func_type) //Raises an error in case the function return type doesn't matches the required by each rule else if((func_type==HANDLER_FUNC && func->getReturnType()!=QString("language_handler")) || ((func_type==VALIDATOR_FUNC || func_type==INLINE_FUNC) && func->getReturnType()!=QString("void"))) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNCTION_INV_RET_TYPE) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName(true)) .arg(BaseObject::getTypeName(OBJ_LANGUAGE)), - ERR_ASG_FUNCTION_INV_RET_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else //Raises an error in case the function has invalid parameters (count and types) - throw Exception(ERR_ASG_FUNCTION_INV_PARAMS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } Function * Language::getFunction(unsigned func_type) { if(func_type > INLINE_FUNC) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_type]); } diff --git a/libpgmodeler/src/language.h b/libpgmodeler/src/language.h index c76b41ce48..c24804d8d8 100644 --- a/libpgmodeler/src/language.h +++ b/libpgmodeler/src/language.h @@ -45,7 +45,7 @@ class Language: public BaseObject{ > VALIDATOR: Function that validates the code written in the language's syntax > HANDLER: Function that executes the functions written in the language's syntax > INLINE: Function that executes inline instructions (DO's) (only on PostgreSQL 9.x) */ - static const unsigned VALIDATOR_FUNC=0, + static constexpr unsigned VALIDATOR_FUNC=0, HANDLER_FUNC=1, INLINE_FUNC=2; diff --git a/libpgmodeler/src/operation.h b/libpgmodeler/src/operation.h index f8fc51e5f0..64334cadcd 100644 --- a/libpgmodeler/src/operation.h +++ b/libpgmodeler/src/operation.h @@ -70,7 +70,7 @@ class Operation { public: //! \brief Constants used to reference the type of operations - static const unsigned NO_OPERATION=0, + static constexpr unsigned NO_OPERATION=0, OBJECT_MODIFIED=1, OBJECT_CREATED=2, OBJECT_REMOVED=3, @@ -81,7 +81,7 @@ class Operation { OBJECT_MOVED=4; //! \brief Operation chain types - static const unsigned NO_CHAIN=0, //! \brief The operation is not part of a chain + static constexpr unsigned NO_CHAIN=0, //! \brief The operation is not part of a chain CHAIN_START=1, //! \brief The operation is the head of the chain CHAIN_MIDDLE=2, //! \brief The operation is in the middle of the chain CHAIN_END=3; //! \brief The operation is the last on the chain diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 0736878c85..e91fb5e6f9 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -25,7 +25,7 @@ OperationList::OperationList(DatabaseModel *model) /* Raises an error if the user tries to allocate an operation list linked to to an unallocated model */ if(!model) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->model=model; xmlparser=model->getXMLParser(); @@ -140,7 +140,7 @@ void OperationList::setMaximumSize(unsigned max) { //Raises an error if a zero max size is assigned to the list if(max==0) - throw Exception(ERR_ASG_INV_MAX_SIZE_OP_LIST,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidMaxSizeOpList,__PRETTY_FUNCTION__,__FILE__,__LINE__); max_size=max; } @@ -154,7 +154,7 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) //Raises an error if the object to be added is not allocated if(!object) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=object->getObjectType(); @@ -167,11 +167,11 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) if(obj_type!=BASE_OBJECT && obj_type!=OBJ_DATABASE) PgModelerNS::copyObject(©_obj, object, obj_type); else - throw Exception(ERR_ASG_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the copy fails (returning a null object) if(!copy_obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else //Inserts the copy on the pool object_pool.push_back(copy_obj); @@ -297,7 +297,7 @@ bool OperationList::isObjectOnPool(BaseObject *object) vector::iterator itr, itr_end; if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=object_pool.begin(); itr_end=object_pool.end(); @@ -348,18 +348,18 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje { //Raises an error if the user tries to register an operation with null object if(!object) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=object->getObjectType(); if(tab_obj && !parent_obj) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(parent_obj && (((obj_type==OBJ_COLUMN || obj_type==OBJ_CONSTRAINT) && (parent_obj->getObjectType()!=OBJ_RELATIONSHIP && parent_obj->getObjectType()!=OBJ_TABLE)) || ((obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE || obj_type==OBJ_INDEX) && !dynamic_cast(parent_obj)))) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the operations list is full makes the automatic cleaning before inserting a new operation if(current_index == static_cast(max_size-1)) @@ -457,7 +457,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje } //Raises an error if both parent table / relationship isn't allocated else - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -501,7 +501,7 @@ void OperationList::getOperationData(unsigned oper_idx, unsigned &oper_type, QSt BaseObject *pool_obj=nullptr; if(oper_idx >= operations.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); operation=operations[oper_idx]; oper_type=operation->getOperationType(); @@ -617,8 +617,8 @@ void OperationList::undoOperation(void) while(!ignore_chain && isUndoAvailable() && operation->getChainType()!=Operation::NO_CHAIN); - if(error.getErrorType()!=ERR_CUSTOM) - throw Exception(ERR_UNDO_REDO_OPR_INV_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); + if(error.getErrorType()!=Custom) + throw Exception(UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); } } @@ -672,8 +672,8 @@ void OperationList::redoOperation(void) while(!ignore_chain && isRedoAvailable() && operation->getChainType()!=Operation::NO_CHAIN); - if(error.getErrorType()!=ERR_CUSTOM) - throw Exception(ERR_UNDO_REDO_OPR_INV_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); + if(error.getErrorType()!=Custom) + throw Exception(UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); } } @@ -984,7 +984,7 @@ void OperationList::updateObjectIndex(BaseObject *object, unsigned new_idx) Operation *oper=nullptr; if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=operations.begin(); itr_end=operations.end(); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 276ab253f7..b0d86d5a31 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -82,9 +82,9 @@ bool Operator::isValidName(const QString &name) void Operator::setName(const QString &name) { if(name.isEmpty()) - throw Exception(ERR_ASG_EMPTY_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!isValidName(name)) - throw Exception(ERR_ASG_INV_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->obj_name=name; } @@ -93,22 +93,22 @@ void Operator::setFunction(Function *func, unsigned func_type) { //Raises an error if the function type is invalid if(func_type > FUNC_RESTRICT) - throw Exception(ERR_REF_FUNCTION_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(func_type==FUNC_OPERATOR) { //Raises an error if the function is not allocated if(!func) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_FUNCTION) + throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) .arg(BaseObject::getTypeName(OBJ_OPERATOR)), - ERR_ASG_NOT_ALOC_FUNCTION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the parameter count is invalid. To be used by the operator the function must own 1 or 2 parameters */ else if(func->getParameterCount()==0 || func->getParameterCount() > 2) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_INV_PARAM_COUNT) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_OPERATOR)), - ERR_ASG_FUNC_INV_PARAM_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { unsigned param_count=func->getParameterCount(); @@ -140,10 +140,10 @@ void Operator::setFunction(Function *func, unsigned func_type) (param_count==1 && ((argument_types[0]!=QString("\"any\"") && argument_types[0]!=param_type1) || (argument_types[1]!=QString("\"any\"") && argument_types[1]!=param_type1)))) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNCTION_INV_PARAMS) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_OPERATOR)), - ERR_ASG_FUNCTION_INV_PARAMS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -155,7 +155,7 @@ void Operator::setArgumentType(PgSQLType arg_type, unsigned arg_id) { //Raises an error if the argument id is invalid if(arg_id > RIGHT_ARG) - throw Exception( ERR_REF_OPER_ARG_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception( RefOperatorArgumentInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(argument_types[arg_id] != arg_type); argument_types[arg_id]=arg_type; @@ -165,7 +165,7 @@ void Operator::setOperator(Operator *oper, unsigned op_type) { //Raises an error if the operator type is invalid if(op_type > OPER_NEGATOR) - throw Exception(ERR_REF_OPER_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefOperatorInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { /* Validating the Commutator OP: According to the PostgreSQL documentation @@ -176,10 +176,10 @@ void Operator::setOperator(Operator *oper, unsigned op_type) is not satisfied. */ if(oper && op_type==OPER_COMMUTATOR && argument_types[LEFT_ARG]!=oper->argument_types[RIGHT_ARG]) { - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_COM_OPEERATOR) + throw Exception(Exception::getErrorMessage(AsgInvalidCommutatorOperator) .arg(oper->getSignature(true)) .arg(this->getSignature(true)), - ERR_ASG_FUNC_INV_PARAM_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); } /* Validating Negator OP: According to the PostgreSQL documentation the negator operator must have its arguments as the same type of arguments from the @@ -190,10 +190,10 @@ void Operator::setOperator(Operator *oper, unsigned op_type) (argument_types[LEFT_ARG]!=oper->argument_types[LEFT_ARG] && argument_types[RIGHT_ARG]!=oper->argument_types[RIGHT_ARG])) { - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_NEG_OPERATOR) + throw Exception(Exception::getErrorMessage(AsgInvalidNegatorOperator) .arg(oper->getSignature(true)) .arg(this->getSignature(true)), - ERR_ASG_FUNC_INV_PARAM_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); } setCodeInvalidated(operators[op_type] != oper); @@ -217,7 +217,7 @@ Function *Operator::getFunction(unsigned func_type) { //Raises an error if the function type is invalid if(func_type > FUNC_RESTRICT) - throw Exception(ERR_REF_OPER_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefOperatorInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_type]); } @@ -226,7 +226,7 @@ PgSQLType Operator::getArgumentType(unsigned arg_id) { //Raises an error if the argument id is invalid if(arg_id > RIGHT_ARG) - throw Exception( ERR_REF_OPER_ARG_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception( RefOperatorArgumentInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(argument_types[arg_id]); } @@ -234,7 +234,7 @@ Operator *Operator::getOperator(unsigned op_type) { //Raises an error if the operator type is invalid if(op_type > OPER_NEGATOR) - throw Exception(ERR_REF_FUNCTION_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(operators[op_type]); } diff --git a/libpgmodeler/src/operator.h b/libpgmodeler/src/operator.h index aa5685e5fc..3807b602c2 100644 --- a/libpgmodeler/src/operator.h +++ b/libpgmodeler/src/operator.h @@ -45,7 +45,7 @@ class Operator: public BaseObject { merges; //! \brief Indicates that the operator can execute a merge join public: - static const unsigned FUNC_OPERATOR=0, + static constexpr unsigned FUNC_OPERATOR=0, FUNC_JOIN=1, FUNC_RESTRICT=2, LEFT_ARG=0, diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index 514f421b82..e58c51f7c8 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -39,7 +39,7 @@ void OperatorClass::setDataType(PgSQLType data_type) { //A null datatype is not accepted by the operator class if(data_type==PgSQLType::null) - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->data_type != data_type); this->data_type=data_type; @@ -94,7 +94,7 @@ void OperatorClass::removeElement(unsigned elem_idx) { //Raises an error in case the element index is out of bound if(elem_idx >= elements.size()) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Removes the item from the elements list elements.erase(elements.begin() + elem_idx); @@ -111,7 +111,7 @@ OperatorClassElement OperatorClass::getElement(unsigned elem_idx) { //Raises an error in case the element index is out of bound if(elem_idx >= elements.size()) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Returns the element on the specified index return(elements[elem_idx]); diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 1c2b1922f1..4e86eb375c 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -31,11 +31,11 @@ void OperatorClassElement::setFunction(Function *func, unsigned stg_number) { //Raises an exception case the function is not allocated if(!func) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error case the stratagy number is zero (invalid) else if(stg_number==0) - throw Exception(ERR_ASG_INV_SUPSTG_NUMBER,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidSupportStrategyNumber,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Clear the attributes not related to the FUNCTION element type this->_operator=nullptr; @@ -51,11 +51,11 @@ void OperatorClassElement::setOperator(Operator *oper, unsigned stg_number) { //Raises an error in case the operator is not allocated if(!oper) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error case the stratagy number is zero (invalid) else if(stg_number==0) - throw Exception(ERR_ASG_INV_SUPSTG_NUMBER,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidSupportStrategyNumber,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Clear the attributes not related to the OPERATOR element type this->function=nullptr; @@ -71,7 +71,7 @@ void OperatorClassElement::setOperatorFamily(OperatorFamily *op_family) if(this->element_type==OPERATOR_ELEM) { if(op_family && op_family->getIndexingType()!=IndexingType::btree) - throw Exception(ERR_ASG_INV_OPFAM_OPCLSELEM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidOpFamilyOpClassElem,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->op_family=op_family; } diff --git a/libpgmodeler/src/operatorclasselement.h b/libpgmodeler/src/operatorclasselement.h index 07463ad465..3c21b9e4c1 100644 --- a/libpgmodeler/src/operatorclasselement.h +++ b/libpgmodeler/src/operatorclasselement.h @@ -60,7 +60,7 @@ class OperatorClassElement { public: //! \brief Constants used to reference the element types - static const unsigned OPERATOR_ELEM=0, + static constexpr unsigned OPERATOR_ELEM=0, FUNCTION_ELEM=1, STORAGE_ELEM=2; diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 580ad98c4d..7f8b080fb0 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -27,7 +27,7 @@ Parameter::Parameter(void) void Parameter::setType(PgSQLType type) { if(!type.isArrayType() && !type.isPolymorphicType() && is_variadic) - throw Exception(ERR_INV_USE_VARIADIC_PARAM_MODE ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvUsageVariadicParamMode ,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->type != type); this->type=type; @@ -50,7 +50,7 @@ void Parameter::setOut(bool value) void Parameter::setVariadic(bool value) { if(value && !type.isArrayType() && !type.isPolymorphicType()) - throw Exception(ERR_INV_USE_VARIADIC_PARAM_MODE ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvUsageVariadicParamMode ,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(is_variadic != value); is_variadic=value; diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 0e3beef0dd..d2d94530cf 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -30,12 +30,12 @@ Permission::Permission(BaseObject *obj) //Raises an error if the object associated to the permission is no allocated if(!obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the object type to be associated to the permission is invalid according to the rule (see class definition) */ if(!acceptsPermission(obj->getObjectType())) - throw Exception(ERR_ASG_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->object=obj; this->obj_type=OBJ_PERMISSION; @@ -123,11 +123,11 @@ void Permission::addRole(Role *role) { //Raises an error if the role is not allocated if(!role) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the role already exists in the permission if(isRoleExists(role)) - throw Exception(ERR_INS_DUP_ROLE_PERMISSION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedRolePermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); roles.push_back(role); setCodeInvalidated(true); @@ -140,11 +140,11 @@ void Permission::setPrivilege(unsigned priv_id, bool value, bool grant_op) { //Caso o tipo de privilégio sejá inválido dispara uma exceção if(priv_id > PRIV_USAGE) - throw Exception(ERR_REF_INV_PRIVILEGE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!acceptsPermission(object->getObjectType(), priv_id)) //Raises an error if the privilege is invalid according to the object type - throw Exception(ERR_ASG_INCOMP_PRIV_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidPrivilegeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated((privileges[priv_id] != value) || grant_option[priv_id] != grant_op); privileges[priv_id]=value; @@ -205,7 +205,7 @@ bool Permission::isSimilarTo(Permission *perm) void Permission::removeRole(unsigned role_idx) { if(role_idx > roles.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); roles.erase(roles.begin() + role_idx); generatePermissionId(); @@ -222,7 +222,7 @@ void Permission::removeRoles(void) Role *Permission::getRole(unsigned role_idx) { if(role_idx > roles.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(roles[role_idx]); } @@ -246,7 +246,7 @@ bool Permission::getPrivilege(unsigned priv_id) { //Raises an error if the privilege is invalid if(priv_id > PRIV_USAGE) - throw Exception(ERR_REF_INV_PRIVILEGE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(privileges[priv_id]); } @@ -255,7 +255,7 @@ bool Permission::getGrantOption(unsigned priv_id) { //Raises an error if the privilege is invalid if(priv_id > PRIV_USAGE) - throw Exception(ERR_REF_INV_PRIVILEGE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(grant_option[priv_id]); } diff --git a/libpgmodeler/src/permission.h b/libpgmodeler/src/permission.h index d35142a127..c792328f52 100644 --- a/libpgmodeler/src/permission.h +++ b/libpgmodeler/src/permission.h @@ -84,7 +84,7 @@ class Permission: public BaseObject { public: //! \brief Constants used to reference the privileges - static const unsigned PRIV_SELECT=0, + static constexpr unsigned PRIV_SELECT=0, PRIV_INSERT=1, PRIV_UPDATE=2, PRIV_DELETE=3, diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index 84e933a0ae..b2949fd138 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -33,7 +33,7 @@ namespace PgModelerNS { //Raises an error if the copy object is not allocated if(!copy_obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Allocates the source object if its not allocated if(!orig_obj) @@ -151,7 +151,7 @@ namespace PgModelerNS { copyObject(psrc_obj, dynamic_cast(copy_obj)); break; default: - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } } diff --git a/libpgmodeler/src/pgmodelerns.h b/libpgmodeler/src/pgmodelerns.h index 109ddca216..8f1226ae63 100644 --- a/libpgmodeler/src/pgmodelerns.h +++ b/libpgmodeler/src/pgmodelerns.h @@ -29,10 +29,10 @@ namespace PgModelerNS { //! \brief Default char used as unescaped value start delimiter - const static QChar UNESC_VALUE_START='/'; + static const QChar UNESC_VALUE_START='/'; //! \brief Default char used as unescaped value end delimiter - const static QChar UNESC_VALUE_END='/'; + static const QChar UNESC_VALUE_END='/'; /*! \brief Template function that makes a copy from 'copy_obj' to 'psrc_obj' doing the cast to the correct object type. If the source object (psrc_obj) is not allocated the function allocates the attributes diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 8052b47ab0..7cb343f2fe 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -258,7 +258,7 @@ BaseType::BaseType(void) QString BaseType::getTypeString(unsigned type_id) { if(type_id > types_count) - throw Exception(ERR_REF_TYPE_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type_list[type_id]); } @@ -267,10 +267,10 @@ void BaseType::setType(unsigned type_id,unsigned offset,unsigned count) { //Raises an error if the type count is invalid if(count==0 || count > this->types_count) - throw Exception(ERR_OBT_TYPES_INV_QUANTITY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtTypesInvalidQuantity,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the type id is invalid else if(!isTypeValid(type_id,offset,count)) - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else type_idx=type_id; } @@ -285,7 +285,7 @@ void BaseType::getTypes(QStringList &types,unsigned offset,unsigned count) { //Raises an error if the type count is invalid if(count==0 || count > BaseType::types_count) - throw Exception(ERR_OBT_TYPES_INV_QUANTITY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtTypesInvalidQuantity,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { unsigned idx,total; @@ -940,7 +940,7 @@ unsigned PgSQLType::operator = (unsigned type_id) else if(type_id > 0) BaseType::setType(type_id,offset,types_count); else if(type_id==0) - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type_idx); } @@ -953,7 +953,7 @@ unsigned PgSQLType::operator = (const QString &type_name) usr_type_idx=getUserTypeIndex(type_name, nullptr); if(type_idx==0 && usr_type_idx==0) - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(type_idx!=0) { BaseType::setType(type_idx,offset,types_count); @@ -1121,7 +1121,7 @@ void PgSQLType::setUserType(unsigned type_id) (type_id >= lim1 && type_id < lim2)) type_idx=type_id; else - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void PgSQLType::setUserType(void *ptype) @@ -1130,7 +1130,7 @@ void PgSQLType::setUserType(void *ptype) idx=getUserTypeIndex(QString(),ptype); if(idx <= 0) - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else type_idx=idx; } @@ -1535,7 +1535,7 @@ void PgSQLType::setDimension(unsigned dim) if(static_cast(idx) < user_types.size() && (user_types[idx].type_conf==UserTypeConfig::DOMAIN_TYPE || user_types[idx].type_conf==UserTypeConfig::SEQUENCE_TYPE)) - throw Exception(ERR_ASG_INV_DOMAIN_ARRAY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidDomainArray,__PRETTY_FUNCTION__,__FILE__,__LINE__); } dimension=dim; @@ -1553,12 +1553,12 @@ void PgSQLType::setPrecision(int prec) //Raises an error if the user tries to specify a precision > length if(((BaseType::type_list[type_idx]==QString("numeric") || BaseType::type_list[type_idx]==QString("decimal")) && prec > static_cast(length))) - throw Exception(ERR_ASG_INV_PRECISION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::AsgInvalidPrecision,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the precision is greater thant 6 else if(((BaseType::type_list[type_idx]==QString("time") || BaseType::type_list[type_idx]==QString("timestamp") || BaseType::type_list[type_idx]==QString("interval")) && prec > 6)) - throw Exception(ERR_ASG_INV_PREC_TIMESTAMP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorType::AsgInvalidPrecisionTimestamp,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->precision=prec; } diff --git a/libpgmodeler/src/pgsqltypes.h b/libpgmodeler/src/pgsqltypes.h index b30200eb7a..0d1a9e48e0 100644 --- a/libpgmodeler/src/pgsqltypes.h +++ b/libpgmodeler/src/pgsqltypes.h @@ -33,7 +33,7 @@ class BaseType{ protected: - static const unsigned types_count=261; + static constexpr unsigned types_count=261; static QString type_list[types_count]; //! \brief Index of the type on the type_list vector @@ -53,7 +53,7 @@ class BaseType{ static unsigned getType(const QString &type_name, unsigned offset, unsigned count); public: - static const unsigned null=0; + static constexpr unsigned null=0; BaseType(void); @@ -80,17 +80,17 @@ class BaseType{ class ActionType: public BaseType{ private: //! \brief Initial position of the names related to the class on BaseType::type_list - static const unsigned offset=1; + static constexpr unsigned offset=1; //! \brief Type count for the class related to the list - static const unsigned types_count=5; + static constexpr unsigned types_count=5; public: - static const unsigned no_action=offset; - static const unsigned restrict=offset+1; - static const unsigned cascade=offset+2; - static const unsigned set_null=offset+3; - static const unsigned set_default=offset+4; + static constexpr unsigned no_action=offset; + static constexpr unsigned restrict=offset+1; + static constexpr unsigned cascade=offset+2; + static constexpr unsigned set_null=offset+3; + static constexpr unsigned set_default=offset+4; ActionType(const QString &type_name); ActionType(unsigned type_id); @@ -104,15 +104,15 @@ class ActionType: public BaseType{ class ConstraintType: public BaseType{ private: - static const unsigned offset=6; - static const unsigned types_count=5; + static constexpr unsigned offset=6; + static constexpr unsigned types_count=5; public: - static const unsigned primary_key=offset; - static const unsigned foreign_key=offset+1; - static const unsigned check=offset+2; - static const unsigned unique=offset+3; - static const unsigned exclude=offset+4; + static constexpr unsigned primary_key=offset; + static constexpr unsigned foreign_key=offset+1; + static constexpr unsigned check=offset+2; + static constexpr unsigned unique=offset+3; + static constexpr unsigned exclude=offset+4; ConstraintType(const QString &type_name); ConstraintType(unsigned type_id); @@ -125,15 +125,15 @@ class ConstraintType: public BaseType{ class EventType: public BaseType{ private: - static const unsigned offset=11; - static const unsigned types_count=5; + static constexpr unsigned offset=11; + static constexpr unsigned types_count=5; public: - static const unsigned on_select=offset; - static const unsigned on_insert=offset+1; - static const unsigned on_delete=offset+2; - static const unsigned on_update=offset+3; - static const unsigned on_truncate=offset+4; + static constexpr unsigned on_select=offset; + static constexpr unsigned on_insert=offset+1; + static constexpr unsigned on_delete=offset+2; + static constexpr unsigned on_update=offset+3; + static constexpr unsigned on_truncate=offset+4; EventType(const QString &type_name); EventType(unsigned type_id); @@ -151,12 +151,12 @@ class EventType: public BaseType{ class ExecutionType: public BaseType{ private: - static const unsigned offset=16; - static const unsigned types_count=2; + static constexpr unsigned offset=16; + static constexpr unsigned types_count=2; public: - static const unsigned also=offset; - static const unsigned instead=offset+1; + static constexpr unsigned also=offset; + static constexpr unsigned instead=offset+1; ExecutionType(const QString &type_name); ExecutionType(unsigned type_id); @@ -169,13 +169,13 @@ class ExecutionType: public BaseType{ class FunctionType: public BaseType{ private: - static const unsigned offset=18; - static const unsigned types_count=3; + static constexpr unsigned offset=18; + static constexpr unsigned types_count=3; public: - static const unsigned _volatile_=offset; - static const unsigned stable=offset+1; - static const unsigned immutable=offset+2; + static constexpr unsigned _volatile_=offset; + static constexpr unsigned stable=offset+1; + static constexpr unsigned immutable=offset+2; FunctionType(const QString &type_name); FunctionType(unsigned type_id); @@ -188,16 +188,16 @@ class FunctionType: public BaseType{ class IndexingType: public BaseType{ private: - static const unsigned offset=21; - static const unsigned types_count=6; + static constexpr unsigned offset=21; + static constexpr unsigned types_count=6; public: - static const unsigned btree=offset; - static const unsigned gist=offset+1; - static const unsigned hash=offset+2; - static const unsigned gin=offset+3; - static const unsigned spgist=offset+4; - static const unsigned brin=offset+5; + static constexpr unsigned btree=offset; + static constexpr unsigned gist=offset+1; + static constexpr unsigned hash=offset+2; + static constexpr unsigned gin=offset+3; + static constexpr unsigned spgist=offset+4; + static constexpr unsigned brin=offset+5; IndexingType(const QString &type_name); IndexingType(unsigned type_id); @@ -210,23 +210,23 @@ class IndexingType: public BaseType{ class IntervalType: public BaseType{ private: - static const unsigned offset=138; - static const unsigned types_count=13; + static constexpr unsigned offset=138; + static constexpr unsigned types_count=13; public: - static const unsigned year=offset; - static const unsigned month=offset+1; - static const unsigned day=offset+2; - static const unsigned hour=offset+3; - static const unsigned minute=offset+4; - static const unsigned second=offset+5; - static const unsigned year_to_month=offset+6; - static const unsigned day_to_hour=offset+7; - static const unsigned day_to_minute=offset+8; - static const unsigned day_to_second=offset+9; - static const unsigned hour_to_minute=offset+10; - static const unsigned hour_to_second=offset+11; - static const unsigned minute_to_second=offset+12; + static constexpr unsigned year=offset; + static constexpr unsigned month=offset+1; + static constexpr unsigned day=offset+2; + static constexpr unsigned hour=offset+3; + static constexpr unsigned minute=offset+4; + static constexpr unsigned second=offset+5; + static constexpr unsigned year_to_month=offset+6; + static constexpr unsigned day_to_hour=offset+7; + static constexpr unsigned day_to_minute=offset+8; + static constexpr unsigned day_to_second=offset+9; + static constexpr unsigned hour_to_minute=offset+10; + static constexpr unsigned hour_to_second=offset+11; + static constexpr unsigned minute_to_second=offset+12; IntervalType(const QString &type_name); IntervalType(unsigned type_id); @@ -261,7 +261,7 @@ class UserTypeConfig { bool invalidated; public: - static const unsigned BASE_TYPE=1, //! \brief The type refers to a user-defined base type (class Type) + static constexpr unsigned BASE_TYPE=1, //! \brief The type refers to a user-defined base type (class Type) DOMAIN_TYPE=2, //! \brief The type refers to a domain TABLE_TYPE=4, //! \brief The type refers to a table SEQUENCE_TYPE=8, //! \brief The type refers to a sequence @@ -280,27 +280,27 @@ class UserTypeConfig { class SpatialType: public BaseType{ private: unsigned variation; - static const unsigned offset=231; - static const unsigned types_count=16; + static constexpr unsigned offset=231; + static constexpr unsigned types_count=16; /*! \brief Used in conjunction with spatial_type, and denotes the SRID value for the spatial type. This value goes from -1 to n. */ int srid; public: - static const unsigned no_var=0; - static const unsigned var_z=1; - static const unsigned var_m=2; - static const unsigned var_zm=3; - - static const unsigned point=offset; - static const unsigned linestring=offset+1; - static const unsigned polygon=offset+2; - static const unsigned multipoint=offset+3; - static const unsigned multilinestring=offset+4; - static const unsigned multipolygon=offset+5; - static const unsigned geometry=offset+6; - static const unsigned geometrycollection=offset+7; + static constexpr unsigned no_var=0; + static constexpr unsigned var_z=1; + static constexpr unsigned var_m=2; + static constexpr unsigned var_zm=3; + + static constexpr unsigned point=offset; + static constexpr unsigned linestring=offset+1; + static constexpr unsigned polygon=offset+2; + static constexpr unsigned multipoint=offset+3; + static constexpr unsigned multilinestring=offset+4; + static constexpr unsigned multipolygon=offset+5; + static constexpr unsigned geometry=offset+6; + static constexpr unsigned geometrycollection=offset+7; SpatialType(const QString &type_name, int srid, unsigned variation_id=SpatialType::no_var); SpatialType(unsigned type_id, int srid, unsigned var_id=SpatialType::no_var); @@ -318,16 +318,16 @@ class SpatialType: public BaseType{ class PgSQLType: public BaseType{ private: - static const unsigned offset=27; - static const unsigned types_count=111; + static constexpr unsigned offset=27; + static constexpr unsigned types_count=111; //! \brief Offset for oid types - static const unsigned oid_start=108; - static const unsigned oid_end=122; + static constexpr unsigned oid_start=108; + static constexpr unsigned oid_end=122; //! \brief Offset for pseudo types - static const unsigned pseudo_start=123; - static const unsigned pseudo_end=137; + static constexpr unsigned pseudo_start=123; + static constexpr unsigned pseudo_end=137; //! \brief Configuration for user defined types static vector user_types; @@ -500,13 +500,13 @@ class PgSQLType: public BaseType{ class BehaviorType: public BaseType{ private: - static const unsigned offset=151; - static const unsigned types_count=3; + static constexpr unsigned offset=151; + static constexpr unsigned types_count=3; public: - static const unsigned called_on_null_input=offset; - static const unsigned returns_null_on_null_input=offset+1; - static const unsigned strict=offset+2; + static constexpr unsigned called_on_null_input=offset; + static constexpr unsigned returns_null_on_null_input=offset+1; + static constexpr unsigned strict=offset+2; BehaviorType(const QString &type_name); BehaviorType(unsigned type_id); @@ -519,12 +519,12 @@ class BehaviorType: public BaseType{ class SecurityType: public BaseType{ private: - static const unsigned offset=154; - static const unsigned types_count=2; + static constexpr unsigned offset=154; + static constexpr unsigned types_count=2; public: - static const unsigned invoker=offset; - static const unsigned definer=offset+1; + static constexpr unsigned invoker=offset; + static constexpr unsigned definer=offset+1; SecurityType(unsigned type_id); SecurityType(const QString &type_name); @@ -537,17 +537,17 @@ class SecurityType: public BaseType{ class LanguageType: public BaseType{ private: - static const unsigned offset=156; - static const unsigned types_count=7; + static constexpr unsigned offset=156; + static constexpr unsigned types_count=7; public: - static const unsigned sql=offset; - static const unsigned c=offset+1; - static const unsigned plpgsql=offset+2; - static const unsigned pltcl=offset+3; - static const unsigned plperl=offset+4; - static const unsigned plpython=offset+5; - static const unsigned internal=offset+6; + static constexpr unsigned sql=offset; + static constexpr unsigned c=offset+1; + static constexpr unsigned plpgsql=offset+2; + static constexpr unsigned pltcl=offset+3; + static constexpr unsigned plperl=offset+4; + static constexpr unsigned plpython=offset+5; + static constexpr unsigned internal=offset+6; LanguageType(const QString &type_name); LanguageType(unsigned type_id); @@ -560,8 +560,8 @@ class LanguageType: public BaseType{ class EncodingType: public BaseType{ private: - static const unsigned offset=163; - static const unsigned types_count=42; + static constexpr unsigned offset=163; + static constexpr unsigned types_count=42; public: EncodingType(void); @@ -580,14 +580,14 @@ class EncodingType: public BaseType{ class StorageType: public BaseType{ private: - static const unsigned offset=205; - static const unsigned types_count=4; + static constexpr unsigned offset=205; + static constexpr unsigned types_count=4; public: - static const unsigned plain=offset; - static const unsigned external=offset+1; - static const unsigned extended=offset+2; - static const unsigned main=offset+3; + static constexpr unsigned plain=offset; + static constexpr unsigned external=offset+1; + static constexpr unsigned extended=offset+2; + static constexpr unsigned main=offset+3; StorageType(void); StorageType(const QString &type_name); @@ -603,13 +603,13 @@ class StorageType: public BaseType{ class MatchType: public BaseType{ private: - static const unsigned offset=209; - static const unsigned types_count=3; + static constexpr unsigned offset=209; + static constexpr unsigned types_count=3; public: - static const unsigned full=offset; - static const unsigned partial=offset+1; - static const unsigned simple=offset+2; + static constexpr unsigned full=offset; + static constexpr unsigned partial=offset+1; + static constexpr unsigned simple=offset+2; MatchType(unsigned type_id); MatchType(const QString &type_name); @@ -622,12 +622,12 @@ class MatchType: public BaseType{ class DeferralType: public BaseType{ private: - static const unsigned offset=212; - static const unsigned types_count=2; + static constexpr unsigned offset=212; + static constexpr unsigned types_count=2; public: - static const unsigned immediate=offset; - static const unsigned deferred=offset+1; + static constexpr unsigned immediate=offset; + static constexpr unsigned deferred=offset+1; DeferralType(unsigned type_id); DeferralType(const QString &type_name); @@ -640,24 +640,24 @@ class DeferralType: public BaseType{ class CategoryType: public BaseType{ private: - static const unsigned offset=214; - static const unsigned types_count=14; + static constexpr unsigned offset=214; + static constexpr unsigned types_count=14; public: - static const unsigned userdefined=offset; - static const unsigned array=offset+1; - static const unsigned boolean=offset+2; - static const unsigned composite=offset+3; - static const unsigned datetime=offset+4; - static const unsigned enumeration=offset+5; - static const unsigned geometric=offset+6; - static const unsigned networkaddr=offset+7; - static const unsigned numeric=offset+8; - static const unsigned pseudotypes=offset+9; - static const unsigned stringt=offset+10; - static const unsigned timespan=offset+11; - static const unsigned bitstring=offset+12; - static const unsigned unknown=offset+13; + static constexpr unsigned userdefined=offset; + static constexpr unsigned array=offset+1; + static constexpr unsigned boolean=offset+2; + static constexpr unsigned composite=offset+3; + static constexpr unsigned datetime=offset+4; + static constexpr unsigned enumeration=offset+5; + static constexpr unsigned geometric=offset+6; + static constexpr unsigned networkaddr=offset+7; + static constexpr unsigned numeric=offset+8; + static constexpr unsigned pseudotypes=offset+9; + static constexpr unsigned stringt=offset+10; + static constexpr unsigned timespan=offset+11; + static constexpr unsigned bitstring=offset+12; + static constexpr unsigned unknown=offset+13; CategoryType(unsigned type_id); CategoryType(const QString &type_name); @@ -670,13 +670,13 @@ class CategoryType: public BaseType{ class FiringType: public BaseType{ private: - static const unsigned offset=228; - static const unsigned types_count=3; + static constexpr unsigned offset=228; + static constexpr unsigned types_count=3; public: - static const unsigned before=offset; - static const unsigned after=offset+1; - static const unsigned instead_of=offset+2; + static constexpr unsigned before=offset; + static constexpr unsigned after=offset+1; + static constexpr unsigned instead_of=offset+2; FiringType(const QString &type_name); FiringType(unsigned type_id); @@ -689,14 +689,14 @@ class FiringType: public BaseType{ class EventTriggerType: public BaseType{ private: - static const unsigned offset=247; - static const unsigned types_count=4; + static constexpr unsigned offset=247; + static constexpr unsigned types_count=4; public: - static const unsigned ddl_command_start=offset; - static const unsigned ddl_command_end=offset+1; - static const unsigned sql_drop=offset+2; - static const unsigned table_rewrite=offset+3; + static constexpr unsigned ddl_command_start=offset; + static constexpr unsigned ddl_command_end=offset+1; + static constexpr unsigned sql_drop=offset+2; + static constexpr unsigned table_rewrite=offset+3; EventTriggerType(const QString &type_name); EventTriggerType(unsigned type_id); @@ -709,12 +709,12 @@ class EventTriggerType: public BaseType{ class IdentityType: public BaseType{ private: - static const unsigned offset=251; - static const unsigned types_count=2; + static constexpr unsigned offset=251; + static constexpr unsigned types_count=2; public: - static const unsigned always=offset; - static const unsigned by_default=offset+1; + static constexpr unsigned always=offset; + static constexpr unsigned by_default=offset+1; IdentityType(const QString &type_name); IdentityType(unsigned type_id); @@ -727,15 +727,15 @@ class IdentityType: public BaseType{ class PolicyCmdType: public BaseType { private: - static const unsigned offset=253; - static const unsigned types_count=5; + static constexpr unsigned offset=253; + static constexpr unsigned types_count=5; public: - static const unsigned all=offset; - static const unsigned select=offset+1; - static const unsigned insert=offset+2; - static const unsigned updated=offset+3; - static const unsigned delete_=offset+4; + static constexpr unsigned all=offset; + static constexpr unsigned select=offset+1; + static constexpr unsigned insert=offset+2; + static constexpr unsigned updated=offset+3; + static constexpr unsigned delete_=offset+4; PolicyCmdType(const QString &type_name); PolicyCmdType(unsigned type_id); @@ -748,13 +748,13 @@ class PolicyCmdType: public BaseType { class PartitioningType: public BaseType { private: - static const unsigned offset=258; - static const unsigned types_count=3; + static constexpr unsigned offset=258; + static constexpr unsigned types_count=3; public: - static const unsigned range=offset; - static const unsigned list=offset+1; - static const unsigned hash=offset+2; + static constexpr unsigned range=offset; + static constexpr unsigned list=offset+1; + static constexpr unsigned hash=offset+2; PartitioningType(const QString &type_name); PartitioningType(unsigned type_id); diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index b01a3c5fdf..ef43721ba4 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -34,11 +34,11 @@ void Policy::setParentTable(BaseTable *table) { if(table && table->getObjectType() != OBJ_TABLE) { - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_OBJECT_TYPE) + throw Exception(Exception::getErrorMessage(AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) .arg(BaseObject::getTypeName(OBJ_TABLE)), - ERR_ASG_INV_OBJECT_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } TableObject::setParentTable(table); @@ -91,7 +91,7 @@ QString Policy::getCheckExpression(void) void Policy::addRole(Role *role) { if(!role) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(std::find(roles.begin(), roles.end(), role) == roles.end()) roles.push_back(role); @@ -144,7 +144,7 @@ QString Policy::getAlterDefinition(BaseObject *object) Policy *policy=dynamic_cast(object); if(!policy) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 3289827940..da232a4526 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -29,16 +29,16 @@ Reference::Reference(Table *table, Column *column, const QString &tab_alias, con { //Raises an error if the table is not allocated if(!table) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the table/column alias has an invalid name else if((!tab_alias.isEmpty() && !BaseObject::isValidName(tab_alias)) || (!col_alias.isEmpty() && !BaseObject::isValidName(col_alias))) - throw Exception(ERR_ASG_INV_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the column parent table differs from the passed table else if(column && column->getParentTable()!=table) - throw Exception(ERR_ASG_OBJ_BELONGS_OTHER_TABLE ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectBelongsAnotherTable ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->table=table; this->column=column; @@ -51,10 +51,10 @@ Reference::Reference(const QString &expression, const QString &expr_alias) { //Raises an error if the user try to create an reference using an empty expression if(expression.isEmpty()) - throw Exception(ERR_ASG_INV_EXPR_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the expression alias has an invalid name else if(!expr_alias.isEmpty() && !BaseObject::isValidName(expr_alias)) - throw Exception(ERR_ASG_INV_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); table=nullptr; column=nullptr; @@ -109,7 +109,7 @@ unsigned Reference::getReferenceType(void) void Reference::setReferenceAlias(const QString &alias) { if(alias.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) - throw Exception(ERR_ASG_LONG_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); ref_alias = alias; } diff --git a/libpgmodeler/src/reference.h b/libpgmodeler/src/reference.h index 6d8985201e..9fd5821eac 100644 --- a/libpgmodeler/src/reference.h +++ b/libpgmodeler/src/reference.h @@ -54,11 +54,11 @@ class Reference { public: //! \brief Constants used to define the reference type - static const unsigned REFER_COLUMN=0, //! \brief The reference is based on a table column + static constexpr unsigned REFER_COLUMN=0, //! \brief The reference is based on a table column REFER_EXPRESSION=1; //! \brief The reference is based on an expression //! \brief Constants used on the view code generation - static const unsigned SQL_REFER_WHERE=1, + static constexpr unsigned SQL_REFER_WHERE=1, SQL_REFER_SELECT=2, SQL_REFER_FROM=4, SQL_REFER_END_EXPR=8, diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 6cdf8e5284..251c5f213f 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -26,18 +26,18 @@ const QString Relationship::DST_TAB_TOKEN=QString("{dt}"); const QString Relationship::GEN_TAB_TOKEN=QString("{gt}"); const QString Relationship::SRC_COL_TOKEN=QString("{sc}"); -const unsigned Relationship::SRC_COL_PATTERN=0; -const unsigned Relationship::DST_COL_PATTERN=1; -const unsigned Relationship::PK_PATTERN=2; -const unsigned Relationship::UQ_PATTERN=3; -const unsigned Relationship::SRC_FK_PATTERN=4; -const unsigned Relationship::DST_FK_PATTERN=5; -const unsigned Relationship::PK_COL_PATTERN=6; +constexpr unsigned Relationship::SRC_COL_PATTERN; +constexpr unsigned Relationship::DST_COL_PATTERN; +constexpr unsigned Relationship::PK_PATTERN; +constexpr unsigned Relationship::UQ_PATTERN; +constexpr unsigned Relationship::SRC_FK_PATTERN; +constexpr unsigned Relationship::DST_FK_PATTERN; +constexpr unsigned Relationship::PK_COL_PATTERN; Relationship::Relationship(Relationship *rel) : BaseRelationship(rel) { if(!rel) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); (*(this))=(*rel); } @@ -58,34 +58,34 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, if(((rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N) && !this->getReferenceTable()->getPrimaryKey()) || (rel_type==RELATIONSHIP_NN && (!src_tab->getPrimaryKey() || !dst_tab->getPrimaryKey()))) - throw Exception(Exception::getErrorMessage(ERR_LINK_TABLES_NO_PK) + throw Exception(Exception::getErrorMessage(InvLinkTablesNoPrimaryKey) .arg(obj_name) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)), - ERR_LINK_TABLES_NO_PK,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvLinkTablesNoPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); // Raises an error if the user tries to create another copy relationship if the table already copies another table if(rel_type==RELATIONSHIP_DEP && src_tab->getCopyTable()) - throw Exception(Exception::getErrorMessage(ERR_COPY_REL_TAB_DEFINED) + throw Exception(Exception::getErrorMessage(InvCopyRelTableDefined) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getCopyTable()->getName(true)), - ERR_COPY_REL_TAB_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvCopyRelTableDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* If the relationship is partitioning the destination table (partitioned) shoud have * a partitioning type defined otherwise and error is raised */ if(rel_type == RELATIONSHIP_PART && !dst_tab->isPartitioned()) - throw Exception(Exception::getErrorMessage(ERR_INV_PARTITIONIG_TYPE_PART_REL) + throw Exception(Exception::getErrorMessage(InvPartitioningTypePartRel) .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), - ERR_INV_PARTITIONIG_TYPE_PART_REL, __PRETTY_FUNCTION__,__FILE__,__LINE__); + InvPartitioningTypePartRel, __PRETTY_FUNCTION__,__FILE__,__LINE__); // Raises an error if the user tries to create a partitioning relationship where one of the tables are already a partition table if(rel_type==RELATIONSHIP_PART && src_tab->getPartitionedTable()) - throw Exception(Exception::getErrorMessage(ERR_PART_REL_PATITIONED_DEFINED) + throw Exception(Exception::getErrorMessage(InvPartRelPartitionedDefined) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getPartitionedTable()->getName(true)), - ERR_PART_REL_PATITIONED_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvPartRelPartitionedDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the user tries to create a relationship in the following configuration: * 1) Many-to-many relationship where one of the tables is a partitioned one @@ -102,11 +102,11 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, (rel_type == RELATIONSHIP_1N && getReferenceTable()->isPartitioned() && !getReceiverTable()->isPartitioned()) || ((rel_type == RELATIONSHIP_GEN || rel_type == RELATIONSHIP_DEP || rel_type == RELATIONSHIP_11) && (src_tab->isPartition() || src_tab->isPartitioned() || dst_tab->isPartition() || dst_tab->isPartitioned()))) - throw Exception(Exception::getErrorMessage(ERR_INV_REL_TYPE_FOR_PART_TABLES) + throw Exception(Exception::getErrorMessage(InvRelTypeForPatitionTables) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->isPartitioned() || src_tab->isPartition() ? src_tab->getName(true) : dst_tab->getName(true)), - ERR_INV_REL_TYPE_FOR_PART_TABLES,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvRelTypeForPatitionTables,__PRETTY_FUNCTION__,__FILE__,__LINE__); copy_options=copy_op; table_relnn=nullptr; @@ -193,10 +193,10 @@ void Relationship::setNamePattern(unsigned pat_id, const QString &pattern) aux_name.replace(pat_tokens[i], QString("%1").arg(static_cast('a' + i))); if(pat_id > PK_COL_PATTERN) - throw Exception(Exception::getErrorMessage(ERR_REF_INV_NAME_PATTERN_ID) + throw Exception(Exception::getErrorMessage(RefInvalidNamePatternId) .arg(this->getName()),__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!BaseObject::isValidName(aux_name)) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_NAME_PATTERN) + throw Exception(Exception::getErrorMessage(AsgInvalidNamePattern) .arg(this->getName()),__PRETTY_FUNCTION__,__FILE__,__LINE__); name_patterns[pat_id]=pattern; @@ -207,7 +207,7 @@ void Relationship::setNamePattern(unsigned pat_id, const QString &pattern) QString Relationship::getNamePattern(unsigned pat_id) { if(pat_id > PK_COL_PATTERN) - throw Exception(ERR_REF_INV_NAME_PATTERN_ID,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidNamePatternId,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(name_patterns[pat_id]); } @@ -276,7 +276,7 @@ void Relationship::setIdentifier(bool value) (rel_type==RELATIONSHIP_NN || rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_DEP))) - throw Exception(ERR_INV_IDENT_RELATIOSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvIdentifierRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); identifier=value; this->invalidated=true; @@ -287,9 +287,9 @@ void Relationship::setSpecialPrimaryKeyCols(vector &cols) /* Raises an error if the user try to set columns for special primary key when the relationship type is identifier or self relationship */ if(!cols.empty() && (isSelfRelationship() || isIdentifier())) - throw Exception(Exception::getErrorMessage(ERR_INV_USE_ESPECIAL_PK) + throw Exception(Exception::getErrorMessage(InvUseSpecialPrimaryKey) .arg(this->getName()), - ERR_INV_USE_ESPECIAL_PK,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvUseSpecialPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->column_ids_pk_rel=cols; } @@ -365,7 +365,7 @@ void Relationship::setTableNameRelNN(const QString &name) if(rel_type==RELATIONSHIP_NN) { if(!BaseObject::isValidName(name)) - throw Exception(ERR_ASG_INV_NAME_TABLE_RELNN, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidNameTableRelNN, __PRETTY_FUNCTION__,__FILE__,__LINE__); tab_name_relnn=name; tab_name_relnn.remove('"'); @@ -433,7 +433,7 @@ int Relationship::getObjectIndex(TableObject *object) //Raises an error if the object is not allocated if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Selecting the correct list using the object type obj_type=object->getObjectType(); @@ -443,7 +443,7 @@ int Relationship::getObjectIndex(TableObject *object) list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) - throw Exception(ERR_REF_OBJ_INV_TYPE, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); itr=list->begin(); itr_end=list->end(); @@ -469,7 +469,7 @@ bool Relationship::isColumnExists(Column *column) //Raises an error if the column is not allocated if(!column) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=gen_columns.begin(); itr_end=gen_columns.end(); @@ -497,7 +497,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) !(tab_obj->isAddedByRelationship() && tab_obj->isProtected() && tab_obj->getObjectType()==OBJ_CONSTRAINT)) - throw Exception(ERR_ASG_OBJ_INV_REL_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectInvalidRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -513,7 +513,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) obj_list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) - throw Exception(ERR_ASG_OBJECT_INV_TYPE, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); //Defines the parent table for the object only for validation tab_obj->setParentTable(src_table); @@ -528,7 +528,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) //Raises an error if the user try to add as foreign key to relationship if(rest->getConstraintType()==ConstraintType::foreign_key) - throw Exception(ERR_ASG_FOREIGN_KEY_REL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgForeignKeyRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); rest->getCodeDefinition(SchemaParser::SQL_DEFINITION); } @@ -550,20 +550,20 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) this->invalidated=true; } else - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(tab_obj->getName(true)) .arg(tab_obj->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_ASG_DUPLIC_OBJECT, __PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedObject, __PRETTY_FUNCTION__,__FILE__,__LINE__); } catch(Exception &e) { - if(e.getErrorType()==ERR_UNDEF_ATTRIB_VALUE) - throw Exception(Exception::getErrorMessage(ERR_ASG_OBJ_INV_DEFINITION) + if(e.getErrorType()==UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()), - ERR_ASG_OBJ_INV_DEFINITION,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } @@ -595,11 +595,11 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) else if(obj_type==OBJ_CONSTRAINT) obj_list=&rel_constraints; else - throw Exception(ERR_REF_OBJ_INV_TYPE, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the object index is out of bound if(obj_id >= obj_list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); tab_obj=obj_list->at(obj_id); recv_table=this->getReceiverTable(); @@ -628,14 +628,14 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) //Raises an error if the column to be removed is referenced by a relationship constraint if(refer) - throw Exception(Exception::getErrorMessage(ERR_REM_INDIRECT_REFERENCE) + throw Exception(Exception::getErrorMessage(RemInderectReference) .arg(col->getName()) .arg(col->getTypeName()) .arg(constr->getName()) .arg(constr->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_REM_INDIRECT_REFERENCE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RemInderectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Generating the column index inside the special pk column list col_idx=getObjectIndex(col) + gen_columns.size(); @@ -663,7 +663,7 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) void Relationship::removeObject(TableObject *object) { if(!object) - throw Exception(ERR_REM_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RemNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); removeObject(getObjectIndex(object),object->getObjectType()); } @@ -713,10 +713,10 @@ TableObject *Relationship::getObject(unsigned obj_idx, ObjectType obj_type) else if(obj_type==OBJ_CONSTRAINT) list=&rel_constraints; else - throw Exception(ERR_REF_OBJ_INV_TYPE, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); if(obj_idx >= list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex, __PRETTY_FUNCTION__,__FILE__,__LINE__); return(list->at(obj_idx)); } @@ -733,7 +733,7 @@ TableObject *Relationship::getObject(const QString &name, ObjectType obj_type) else if(obj_type==OBJ_CONSTRAINT) list=&rel_constraints; else - throw Exception(ERR_REF_OBJ_INV_TYPE, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); itr=list->begin(); itr_end=list->end(); @@ -755,7 +755,7 @@ Column *Relationship::getAttribute(unsigned attrib_idx) { //Raises an error if the attribute index is out of bound if(attrib_idx >= rel_attributes.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(rel_attributes[attrib_idx])); } @@ -774,7 +774,7 @@ Constraint *Relationship::getConstraint(unsigned constr_idx) { //Raises an error if the constraint index is out of bound if(constr_idx >= rel_constraints.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(rel_constraints[constr_idx])); } @@ -806,7 +806,7 @@ unsigned Relationship::getObjectCount(ObjectType obj_type) else if(obj_type==OBJ_CONSTRAINT) return(rel_constraints.size()); else - throw Exception(ERR_REF_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void Relationship::addConstraints(Table *recv_tab) @@ -886,7 +886,7 @@ void Relationship::addColumnsRelGenPart(void) idx, tab_count; vector columns; ObjectType types[2]={OBJ_TABLE, BASE_TABLE}; - ErrorType err_type=ERR_CUSTOM; + ErrorType err_type=Custom; bool duplic=false, cond=false, /* 0 -> Column created by inheritance relationship 1 -> Column created by copy relationship */ @@ -908,14 +908,14 @@ void Relationship::addColumnsRelGenPart(void) /* If the relationship is partitioning the destination table (partitioned) shoud have * a partitioning type defined otherwise and error is raised */ if(rel_type == RELATIONSHIP_PART && !dst_tab->isPartitioned()) - throw Exception(Exception::getErrorMessage(ERR_INV_PARTITIONIG_TYPE_PART_REL) + throw Exception(Exception::getErrorMessage(InvPartitioningTypePartRel) .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), - ERR_INV_PARTITIONIG_TYPE_PART_REL, __PRETTY_FUNCTION__,__FILE__,__LINE__); + InvPartitioningTypePartRel, __PRETTY_FUNCTION__,__FILE__,__LINE__); /* This for compares the columns of the receiver table with the columns of the reference table in order to resolve the conflicting names */ - for(i=0; i < dst_count && err_type==ERR_CUSTOM; i++) + for(i=0; i < dst_count && err_type==Custom; i++) { //Gets the column from the receiver (destination) table dst_col=dst_tab->getColumn(i); @@ -1016,17 +1016,17 @@ void Relationship::addColumnsRelGenPart(void) ((!dst_flags[0] && !dst_flags[1]) || (!dst_flags[0] && dst_flags[1]))) { - err_type=ERR_DUPLIC_COLS_COPY_REL; + err_type=InvCopyRelationshipDuplicCols; } /* Error condition 2: The relationship type is generalization and the column * types is incompatible */ else if((rel_type == RELATIONSHIP_GEN || rel_type==RELATIONSHIP_PART) && src_type != dst_type) - err_type=ERR_INCOMP_COLS_INHERIT_REL; + err_type=InvInheritRelationshipIncompCols; } } //In case that no error was detected (ERR_CUSTOM) - if(err_type==ERR_CUSTOM) + if(err_type==Custom) { //In case there is no column duplicity if(!duplic) @@ -1065,10 +1065,10 @@ void Relationship::addColumnsRelGenPart(void) } if((src_tab->getColumnCount() + columns.size()) != dst_tab->getColumnCount() && rel_type == RELATIONSHIP_PART) - err_type = ERR_INV_COLUMN_COUNT_PART_REL; + err_type = InvColumnCountPartRel; //In case that no duplicity error is detected - if(err_type==ERR_CUSTOM) + if(err_type==Custom) { vector::iterator itr, itr_end; @@ -1096,14 +1096,14 @@ void Relationship::addColumnsRelGenPart(void) str_aux=Exception::getErrorMessage(err_type); - if(err_type==ERR_DUPLIC_COLS_COPY_REL) + if(err_type==InvCopyRelationshipDuplicCols) { msg=QString(str_aux) .arg(dst_col->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getName(true)); } - else if(err_type==ERR_INV_COLUMN_COUNT_PART_REL) + else if(err_type==InvColumnCountPartRel) { msg=QString(str_aux) .arg(src_tab->getName(true)) @@ -1165,10 +1165,10 @@ void Relationship::addConstraintsRelGenPart(void) } else if(aux_constr->getConstraintType()!=ConstraintType::check || aux_constr->getExpression().simplified()!=constr->getExpression().simplified()) - throw Exception(Exception::getErrorMessage(ERR_INCOMP_CONSTRS_INHERIT_REL) + throw Exception(Exception::getErrorMessage(InvInheritRelationshipIncompConstrs) .arg(constr->getName()).arg(parent_tab->getName(false, true)) .arg(aux_constr->getName()).arg(child_tab->getName(false, true)), - ERR_INCOMP_CONSTRS_INHERIT_REL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvInheritRelationshipIncompConstrs,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -1552,11 +1552,11 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b the relationship is 1-1, 1-n or n-n */ if((!src_pk && (rel_type==RELATIONSHIP_1N || rel_type==RELATIONSHIP_11)) || (!src_pk && !dst_pk && rel_type==RELATIONSHIP_NN)) - throw Exception(Exception::getErrorMessage(ERR_LINK_TABLES_NO_PK) + throw Exception(Exception::getErrorMessage(InvLinkTablesNoPrimaryKey) .arg(this->obj_name) .arg(ref_tab->getName(true)) .arg(recv_tab->getName(true)), - ERR_LINK_TABLES_NO_PK,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvLinkTablesNoPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); count=pk->getColumnCount(Constraint::SOURCE_COLS); diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index 4c85d36dd8..cc93d07082 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -301,13 +301,13 @@ class Relationship: public BaseRelationship { SRC_COL_TOKEN; //{sc} //! \brief Patterns ids - static const unsigned SRC_COL_PATTERN, - DST_COL_PATTERN, - PK_PATTERN, - UQ_PATTERN, - SRC_FK_PATTERN, - DST_FK_PATTERN, - PK_COL_PATTERN; + static constexpr unsigned SRC_COL_PATTERN=0, + DST_COL_PATTERN=1, + PK_PATTERN=2, + UQ_PATTERN=3, + SRC_FK_PATTERN=4, + DST_FK_PATTERN=5, + PK_COL_PATTERN=6; Relationship(Relationship *rel); diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 982ee2ca23..7992974d0d 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -51,7 +51,7 @@ void Role::setOption(unsigned op_type, bool value) { if(op_type > OP_BYPASSRLS) //Raises an error if the option type is invalid - throw Exception(ERR_ASG_VAL_INV_ROLE_OPT_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgValueInvalidRoleOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(options[op_type] != value); options[op_type]=value; @@ -61,12 +61,12 @@ void Role::addRole(unsigned role_type, Role *role) { //Raises an error if the role to be added is not allocated if(!role) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the role to be added is the 'this' role else if(role && this==role) - throw Exception(Exception::getErrorMessage(ERR_ROLE_MEMBER_ITSELF) + throw Exception(Exception::getErrorMessage(AsgRoleMemberItself) .arg(role->getName()), - ERR_ROLE_MEMBER_ITSELF,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgRoleMemberItself,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { bool role_ref, role_mem, role_adm, @@ -87,10 +87,10 @@ void Role::addRole(unsigned role_type, Role *role) if((role_type==REF_ROLE && role_ref) || (role_type==MEMBER_ROLE && (role_mem || role_adm)) || (role_type==ADMIN_ROLE && (role_adm || role_mem))) - throw Exception(Exception::getErrorMessage(ERR_INS_DUPLIC_ROLE) + throw Exception(Exception::getErrorMessage(InsDuplicatedRole) .arg(role->getName()) .arg(this->getName()), - ERR_INS_DUPLIC_ROLE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Checking for redundant reference between roles. A redundant reference can happen when: @@ -117,10 +117,10 @@ void Role::addRole(unsigned role_type, Role *role) else if((role_type==REF_ROLE && ((role_mem || role_adm) || role_ref1)) || (role_type==MEMBER_ROLE && ((role_mem1 || role_adm1) || role_ref)) || (role_type==ADMIN_ROLE && ((role_mem1 || role_adm1) || role_ref))) - throw Exception(Exception::getErrorMessage(ERR_ROLE_REF_REDUNDANCY) + throw Exception(Exception::getErrorMessage(AsgRoleReferenceRedundancy) .arg(this->getName()) .arg(role->getName()), - ERR_ROLE_REF_REDUNDANCY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgRoleReferenceRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { switch(role_type) @@ -201,12 +201,12 @@ void Role::removeRole(unsigned role_type, unsigned role_idx) case ADMIN_ROLE: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(ERR_REF_INV_ROLE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } if(role_idx >= list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=list->begin() + role_idx; list->erase(itr); @@ -224,7 +224,7 @@ void Role::removeRoles(unsigned role_type) case ADMIN_ROLE: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(ERR_REF_INV_ROLE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } @@ -245,7 +245,7 @@ bool Role::isRoleExists(unsigned role_type, Role *role) case ADMIN_ROLE: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(ERR_REF_INV_ROLE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } @@ -263,7 +263,7 @@ bool Role::isRoleExists(unsigned role_type, Role *role) bool Role::getOption(unsigned op_type) { if(op_type > OP_BYPASSRLS) - throw Exception(ERR_ASG_VAL_INV_ROLE_OPT_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgValueInvalidRoleOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(options[op_type]); } @@ -279,13 +279,13 @@ Role *Role::getRole(unsigned role_type, unsigned role_idx) case ADMIN_ROLE: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(ERR_REF_INV_ROLE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } //Raises an error if the role index is invalid (out of bound) if(role_idx > list->size()) - throw Exception(ERR_REF_ROLE_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefRoleInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(list->at(role_idx)); } @@ -301,7 +301,7 @@ unsigned Role::getRoleCount(unsigned role_type) case ADMIN_ROLE: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(ERR_REF_INV_ROLE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } @@ -355,7 +355,7 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) Role *role=dynamic_cast(object); if(!role) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/role.h b/libpgmodeler/src/role.h index df8a486865..b456916b52 100644 --- a/libpgmodeler/src/role.h +++ b/libpgmodeler/src/role.h @@ -59,7 +59,7 @@ class Role: public BaseObject { public: //! \brief Constants used to reference the available options for the role - static const unsigned OP_SUPERUSER=0, + static constexpr unsigned OP_SUPERUSER=0, OP_CREATEDB=1, OP_CREATEROLE=2, OP_INHERIT=3, @@ -69,7 +69,7 @@ class Role: public BaseObject { OP_BYPASSRLS=7; //! \brief Constants used to reference the internal role lists of the class - static const unsigned REF_ROLE=10, + static constexpr unsigned REF_ROLE=10, MEMBER_ROLE=20, ADMIN_ROLE=30; diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index f8364202ee..372d77837d 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -66,7 +66,7 @@ void Rule::addCommand(const QString &cmd) { //Raises an error if the command is empty if(cmd.isEmpty()) - throw Exception(ERR_INS_EMPTY_RULE_COMMAND,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsEmptyRuleCommand,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { QString cmd_aux=cmd; @@ -95,7 +95,7 @@ QString Rule::getCommand(unsigned cmd_idx) { //Raises an error if the command index is out of bound if(cmd_idx >= commands.size()) - throw Exception(ERR_REF_RULE_CMD_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefRuleCommandInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(commands[cmd_idx]); } @@ -109,7 +109,7 @@ void Rule::removeCommand(unsigned cmd_idx) { //Raises an error if the command index is out of bound if(cmd_idx>=commands.size()) - throw Exception(ERR_REF_RULE_CMD_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefRuleCommandInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); commands.erase(commands.begin() + cmd_idx); setCodeInvalidated(true); diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index 9ee5d93d3b..daf2f9ea6d 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -32,10 +32,10 @@ void Schema::setName(const QString &name) /* Schema names starting with pg_ is reserved to PostgreSQL if its the case raises an error */ if(name.mid(0,3)==QString("pg_")) - throw Exception(Exception::getErrorMessage(ERR_ASG_RESERVED_NAME) + throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_SCHEMA)), - ERR_ASG_RESERVED_NAME,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); } diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 5225c6244a..582048f2dc 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -224,7 +224,7 @@ void Sequence::setSchema(BaseObject *schema) //Raises an error when the passed schema differs from the table schema if(table && table->getSchema()!=schema) - throw Exception(ERR_ASG_SEQ_DIF_TABLE_SCHEMA,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgSchemaSequenceDiffersTableSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); } BaseObject::setSchema(schema); @@ -246,16 +246,16 @@ void Sequence::setValues(QString minv, QString maxv, QString inc, QString start, cache=formatValue(cache); if(compareValues(minv,maxv) > 0) - throw Exception(ERR_ASG_INV_SEQ_MIN_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidSequenceMinValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the start value is less that min value or grater than max value else if(compareValues(start, minv) < 0 || compareValues(start, maxv) > 0) - throw Exception(ERR_ASG_INV_SEQ_START_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidSequenceStartValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the increment value is null (0) else if(isZeroValue(inc)) - throw Exception(ERR_ASG_INV_SEQ_INCR_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidSequenceIncrementValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the cache value is null (0) else if(isZeroValue(cache)) - throw Exception(ERR_ASG_INV_SEQ_CACHE_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidSequenceCacheValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->min_value=minv; this->max_value=maxv; @@ -274,24 +274,24 @@ void Sequence::setOwnerColumn(Table *table, const QString &col_name) { //Raises an error if the table schema differs from the sequence schema if(table->getSchema()!=this->schema) - throw Exception(Exception::getErrorMessage(ERR_ASG_TAB_DIF_SEQ_SCHEMA) + throw Exception(Exception::getErrorMessage(AsgSeqOwnerTableDifferentSchema) .arg(this->getName(true)), - ERR_ASG_TAB_DIF_SEQ_SCHEMA,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgSeqOwnerTableDifferentSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the table owner role differs from the sequence owner if(table->getOwner()!=this->owner) - throw Exception(Exception::getErrorMessage(ERR_ASG_SEQ_OWNER_DIF_TABLE) + throw Exception(Exception::getErrorMessage(AsgSeqOwnerTableDifferentRole) .arg(this->getName(true)), - ERR_ASG_SEQ_OWNER_DIF_TABLE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgSeqOwnerTableDifferentRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Gets the column with the passed name this->owner_col=table->getColumn(col_name); //Raises an error if the column doesn't exists if(!this->owner_col) - throw Exception(Exception::getErrorMessage(ERR_ASG_INEXIST_OWNER_COL_SEQ) + throw Exception(Exception::getErrorMessage(AsgInexistentSeqOwnerColumn) .arg(this->getName(true)), - ERR_ASG_INEXIST_OWNER_COL_SEQ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgInexistentSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* If the onwer column was added by relationship and the column id is greater than sequence id, change the sequence id to be greater to avoid reference errors */ @@ -315,21 +315,21 @@ void Sequence::setOwnerColumn(Column *column) //Raises an error when the column doesn't has a parent table if(!table) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_OWNER_COL_SEQ) + throw Exception(Exception::getErrorMessage(AsgInvalidSeqOwnerColumn) .arg(this->getName(true)), - ERR_ASG_INV_OWNER_COL_SEQ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgInvalidSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the table schema differs from the sequence schema if(table->getSchema()!=this->schema) - throw Exception(Exception::getErrorMessage(ERR_ASG_TAB_DIF_SEQ_SCHEMA) + throw Exception(Exception::getErrorMessage(AsgSeqOwnerTableDifferentSchema) .arg(this->getName(true)), - ERR_ASG_TAB_DIF_SEQ_SCHEMA,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgSeqOwnerTableDifferentSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the table owner role differs from the sequence owner if(table->getOwner()!=this->owner) - throw Exception(Exception::getErrorMessage(ERR_ASG_SEQ_OWNER_DIF_TABLE) + throw Exception(Exception::getErrorMessage(AsgSeqOwnerTableDifferentRole) .arg(this->getName(true)), - ERR_ASG_SEQ_OWNER_DIF_TABLE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgSeqOwnerTableDifferentRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->owner_col=column; @@ -417,7 +417,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) Sequence *seq=dynamic_cast(object); if(!seq) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 77709af92e..cac290c9db 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -344,7 +344,7 @@ vector *Table::getObjectList(ObjectType obj_type) else if(obj_type==OBJ_POLICY) return(&policies); else - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void Table::addObject(BaseObject *obj, int obj_idx) @@ -352,7 +352,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) ObjectType obj_type; if(!obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { int idx; @@ -362,10 +362,10 @@ void Table::addObject(BaseObject *obj, int obj_idx) #warning "DEMO VERSION: table children objects creation limit." vector *obj_list=(obj_type!=OBJ_TABLE ? getObjectList(obj_type) : nullptr); - if((obj_list && obj_list->size() >= GlobalAttributes::MAX_OBJECT_COUNT) || - (obj_type==OBJ_TABLE && ancestor_tables.size() >= GlobalAttributes::MAX_OBJECT_COUNT)) + if((obj_list && obj_list->size() >= GlobalAttributes::MaxObjectCount) || + (obj_type==OBJ_TABLE && ancestor_tables.size() >= GlobalAttributes::MaxObjectCount)) throw Exception(trUtf8("In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2'") - .arg(GlobalAttributes::MAX_OBJECT_COUNT) + .arg(GlobalAttributes::MaxObjectCount) .arg(BaseObject::getTypeName(obj_type)), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -376,17 +376,17 @@ void Table::addObject(BaseObject *obj, int obj_idx) //Raises an error if already exists a object with the same name and type if(getObject(obj->getName(),obj_type,idx)) { - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(obj->getName(true)) .arg(obj->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_ASG_DUPLIC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the user try to set the table as ancestor/copy of itself else if((obj_type==OBJ_TABLE || obj_type==BASE_TABLE) && obj==this) - throw Exception(ERR_INV_INH_COPY_PART_RELATIONSHIP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); switch(obj_type) { @@ -408,24 +408,24 @@ void Table::addObject(BaseObject *obj, int obj_idx) tab_obj->setParentTable(this); //Raises an error if the parent table of the table object is different from table 'this' else if(tab_obj->getParentTable()!=this) - throw Exception(ERR_ASG_OBJ_BELONGS_OTHER_TABLE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectBelongsAnotherTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Validates the object SQL code befor insert on table obj->getCodeDefinition(SchemaParser::SQL_DEFINITION); if(col && col->getType()==this) { - throw Exception(Exception::getErrorMessage(ERR_INV_COLUMN_TABLE_TYPE) + throw Exception(Exception::getErrorMessage(InvColumnTableType) .arg(col->getName()) .arg(this->getName()), - ERR_INV_COLUMN_TABLE_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvColumnTableType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(obj_type==OBJ_CONSTRAINT) { //Raises a error if the user try to add a second primary key on the table if(dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::primary_key && this->getPrimaryKey()) - throw Exception(ERR_ASG_EXISTING_PK_TABLE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgExistingPrimaryKeyTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(obj_type==OBJ_TRIGGER) dynamic_cast(tab_obj)->validateTrigger(); @@ -467,7 +467,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) break; default: - throw Exception(ERR_ASG_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } @@ -475,11 +475,11 @@ void Table::addObject(BaseObject *obj, int obj_idx) } catch(Exception &e) { - if(e.getErrorType()==ERR_UNDEF_ATTRIB_VALUE) - throw Exception(Exception::getErrorMessage(ERR_ASG_OBJ_INV_DEFINITION) + if(e.getErrorType()==UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) .arg(obj->getName()) .arg(obj->getTypeName()), - ERR_ASG_OBJ_INV_DEFINITION,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } @@ -665,8 +665,8 @@ void Table::addPartitionKeys(vector &part_keys) return; if(partitioning_type == PartitioningType::list && part_keys.size() > 1) - throw Exception(Exception::getErrorMessage(ERR_INV_PARTITION_KEY_COUNT).arg(this->getSignature()), - ERR_INV_PARTITION_KEY_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvPartitionKeyCount).arg(this->getSignature()), + InvPartitionKeyCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); partition_keys.clear(); @@ -675,15 +675,15 @@ void Table::addPartitionKeys(vector &part_keys) if(std::find(partition_keys.begin(), partition_keys.end(), part_key) != partition_keys.end()) { partition_keys = part_keys_bkp; - throw Exception(ERR_INS_DUPLIC_ELEMENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(part_key.getColumn() && part_key.getColumn()->isAddedByRelationship()) { partition_keys = part_keys_bkp; - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_COLUMN_PARTITION_KEY) + throw Exception(Exception::getErrorMessage(AsgInvalidColumnPartitionKey) .arg(part_key.getColumn()->getSignature(true)), - ERR_ASG_INV_COLUMN_PARTITION_KEY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgInvalidColumnPartitionKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); } partition_keys.push_back(part_key); @@ -744,7 +744,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) { //Raises an error if the user try to remove a object with invalid type if(!TableObject::isTableObject(obj_type) && obj_type!=OBJ_TABLE) - throw Exception(ERR_REM_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(obj_type==OBJ_TABLE && obj_idx < ancestor_tables.size()) { @@ -775,7 +775,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) //Raises an error if the object index is out of bound if(obj_idx >= obj_list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(obj_type!=OBJ_COLUMN) { @@ -803,22 +803,22 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) //Case some trigger, constraint, index is referencing the column raises an error if(!refs.empty()) { - throw Exception(Exception::getErrorMessage(ERR_REM_INDIRECT_REFERENCE) + throw Exception(Exception::getErrorMessage(RemInderectReference) .arg(column->getName()) .arg(column->getTypeName()) .arg(refs[0]->getName()) .arg(refs[0]->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_REM_INDIRECT_REFERENCE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RemInderectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the column is being referenced by any partition key if(isPartitionKeyRefColumn(column)) { - throw Exception(Exception::getErrorMessage(ERR_REM_COL_REF_PARTITION_KEY) + throw Exception(Exception::getErrorMessage(RemColumnRefByPartitionKey) .arg(column->getName()).arg(this->getName(true)), - ERR_REM_COL_REF_PARTITION_KEY,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RemColumnRefByPartitionKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); } column->setParentTable(nullptr); @@ -1099,7 +1099,7 @@ BaseObject *Table::getObject(const QString &name, ObjectType obj_type, int &obj_ else obj_idx=-1; } else - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(object); } @@ -1112,7 +1112,7 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) { //Raises an error if the object index is out of bound if(obj_idx >= ancestor_tables.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(ancestor_tables[obj_idx]); } @@ -1123,7 +1123,7 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) return(obj_list->at(obj_idx)); else //Raises an error if the object index is out of bound - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1296,7 +1296,7 @@ unsigned Table::getObjectCount(ObjectType obj_type, bool inc_added_by_rel) } } else - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); } Constraint *Table::getPrimaryKey(void) @@ -1382,7 +1382,7 @@ void Table::setRelObjectsIndexes(const vector &obj_names, const vector< else if(obj_type==OBJ_CONSTRAINT) obj_idxs_map=&constr_indexes; else - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); for(idx=0; idx < size; idx++) (*obj_idxs_map)[obj_names[idx]]=idxs[idx]; @@ -1714,7 +1714,7 @@ void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2 //Raises an error if both index is out of list bounds if(idx1 >= obj_list->size() && idx2 >= obj_list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the idx1 is out of bound inserts the element idx2 at the list's begin else if(idx1 >= obj_list->size()) { @@ -1874,7 +1874,7 @@ QString Table::getAlterDefinition(BaseObject *object) Table *tab=dynamic_cast
(object); if(!tab) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/tablespace.cpp b/libpgmodeler/src/tablespace.cpp index 1531dd87d9..e37c3e9bd8 100644 --- a/libpgmodeler/src/tablespace.cpp +++ b/libpgmodeler/src/tablespace.cpp @@ -32,10 +32,10 @@ void Tablespace::setName(const QString &name) /* Tablespace names starting with pg_ is reserved to PostgreSQL if its the case raises an error */ if(name.mid(0,3)==QString("pg_")) - throw Exception(Exception::getErrorMessage(ERR_ASG_RESERVED_NAME) + throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_TABLESPACE)), - ERR_ASG_RESERVED_NAME,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); } @@ -47,7 +47,7 @@ void Tablespace::setDirectory(const QString &dir) //Raises an error if the directory is an empty path if(dir_aux.isEmpty()) - throw Exception(ERR_ASG_EMPTY_DIR_NAME,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgEmptyDirectoryName,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->directory != dir_aux); this->directory=dir_aux; diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 0a736bb857..400af833eb 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -42,9 +42,9 @@ Tag::Tag(void) void Tag::setName(const QString &name) { if(name.isEmpty()) - throw Exception(ERR_ASG_EMPTY_NAME_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(name.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) - throw Exception(ERR_ASG_LONG_NAME_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgLongNameObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->obj_name=name; } @@ -106,13 +106,13 @@ QColor Tag::getElementColor(const QString &elem_id, unsigned color_id) void Tag::validateElementId(const QString &id, unsigned color_id) { if(color_config.count(id) == 0) - throw Exception(Exception::getErrorMessage(ERR_OPR_INV_ELEMENT_ID).arg(id), - ERR_OPR_INV_ELEMENT_ID ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(OprInvalidElementId).arg(id), + OprInvalidElementId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if((color_id > COLOR_COUNT) || (color_id > 0 && (id==ParsersAttributes::TABLE_NAME || id==ParsersAttributes::TABLE_SCHEMA_NAME))) - throw Exception(Exception::getErrorMessage(ERR_REF_ELEMENT_COLOR_ID).arg(id).arg(color_id), - ERR_REF_ELEMENT_COLOR_ID ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(RefInvalidElementColorId).arg(id).arg(color_id), + RefInvalidElementColorId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } QLinearGradient Tag::getFillStyle(const QString &elem_id) diff --git a/libpgmodeler/src/tag.h b/libpgmodeler/src/tag.h index e4ca3a6809..0bd69fb147 100644 --- a/libpgmodeler/src/tag.h +++ b/libpgmodeler/src/tag.h @@ -43,7 +43,7 @@ class Tag: public BaseObject { void validateElementId(const QString &elem_id, unsigned color_id); public: - static const unsigned FILL_COLOR1=0, + static constexpr unsigned FILL_COLOR1=0, FILL_COLOR2=1, BORDER_COLOR=2, COLOR_COUNT=3; diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index 53ab434176..c5c5367038 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -74,7 +74,7 @@ void Textbox::operator = (Textbox &txtbox) void Textbox::setTextAttribute(unsigned attrib, bool value) { if(attrib > UNDERLINE_TXT) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); text_attributes[attrib]=value; } @@ -92,7 +92,7 @@ QColor Textbox::getTextColor(void) bool Textbox::getTextAttribute(unsigned attrib) { if(attrib > UNDERLINE_TXT) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(text_attributes[attrib]); } diff --git a/libpgmodeler/src/textbox.h b/libpgmodeler/src/textbox.h index 321e3f8c07..c1fdd14f2e 100644 --- a/libpgmodeler/src/textbox.h +++ b/libpgmodeler/src/textbox.h @@ -42,7 +42,7 @@ class Textbox: public BaseGraphicObject{ public: //! \brief Constants used to configure the text attributes - static const unsigned ITALIC_TXT=0, + static constexpr unsigned ITALIC_TXT=0, BOLD_TXT=1, UNDERLINE_TXT=2; diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index e932d77e00..1beb29edd4 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -86,7 +86,7 @@ void Trigger::setFiringType(FiringType firing_type) void Trigger::setEvent(EventType event, bool value) { if(event==EventType::on_select) - throw Exception(ERR_REF_INV_TRIGGER_EVENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidTriggerEvent,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(events[event] != value); events[event]=value; @@ -96,21 +96,21 @@ void Trigger::setFunction(Function *func) { //Case the function is null an error is raised if(!func) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_FUNCTION) + throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_TRIGGER)), - ERR_ASG_NOT_ALOC_FUNCTION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { //Case the function doesn't returns 'trigger' it cannot be used with the trigger thus raise an error if(func->getReturnType()!=QString("trigger")) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_TRIGGER_FUNCTION).arg(QString("trigger")),__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(AsgInvalidTriggerFunction).arg(QString("trigger")),__PRETTY_FUNCTION__,__FILE__,__LINE__); //Case the function has some parameters raise an error else if(func->getParameterCount()!=0) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_INV_PARAM_COUNT) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_TRIGGER)), - ERR_ASG_FUNC_INV_PARAM_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(function != func); this->function=func; @@ -126,21 +126,21 @@ void Trigger::setCondition(const QString &cond) void Trigger::addColumn(Column *column) { if(!column) - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_COLUMN)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn)) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_ASG_NOT_ALOC_COLUMN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!column->getParentTable()) - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_COLUMN_NO_PARENT)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::AsgColumnNoParent)) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_ASG_NOT_ALOC_COLUMN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(this->getParentTable() && column->getParentTable() != this->getParentTable()) - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_INV_COLUMN_TRIGGER)) + throw Exception(QString(Exception::getErrorMessage(ErrorType::AsgInvalidColumnTrigger)) .arg(column->getName(true)) .arg(this->getName(true)), - ERR_ASG_INV_COLUMN_TRIGGER,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorType::AsgInvalidColumnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); upd_columns.push_back(column); setCodeInvalidated(true); @@ -150,7 +150,7 @@ void Trigger::editArgument(unsigned arg_idx, const QString &new_arg) { //Raises an error if the argument index is invalid (out of bound) if(arg_idx>=arguments.size()) - throw Exception(ERR_REF_ARG_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr; @@ -169,7 +169,7 @@ void Trigger::setExecutePerRow(bool value) bool Trigger::isExecuteOnEvent(EventType event) { if(event==EventType::on_select) - throw Exception(ERR_REF_INV_TRIGGER_EVENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidTriggerEvent,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(events.at(!event)); } @@ -183,7 +183,7 @@ QString Trigger::getArgument(unsigned arg_idx) { //Raises an error if the argument index is invalid (out of bound) if(arg_idx>=arguments.size()) - throw Exception(ERR_REF_ARG_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(arguments[arg_idx]); } @@ -192,7 +192,7 @@ Column *Trigger::getColumn(unsigned col_idx) { //Raises an error if the column index is invalid (out of bound) if(col_idx>=upd_columns.size()) - throw Exception(ERR_REF_COLUMN_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefColumnInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(upd_columns[col_idx]); } @@ -226,7 +226,7 @@ void Trigger::removeArgument(unsigned arg_idx) { //Raises an error if the argument index is invalid (out of bound) if(arg_idx>=arguments.size()) - throw Exception(ERR_REF_ARG_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr; itr=arguments.begin()+arg_idx; @@ -250,7 +250,7 @@ void Trigger::setReferecendTable(BaseTable *ref_table) { //If the referenced table isn't valid raises an error if(ref_table && ref_table->getObjectType()!=OBJ_TABLE) - throw Exception(ERR_ASG_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(referenced_table != ref_table); this->referenced_table=ref_table; @@ -292,7 +292,7 @@ void Trigger::setConstraint(bool value) void Trigger::setTransitionTableName(unsigned tab_idx, const QString &name) { if(tab_idx > NEW_TABLE_NAME) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(transition_tabs_names[tab_idx] != name); transition_tabs_names[tab_idx] = name; @@ -301,7 +301,7 @@ void Trigger::setTransitionTableName(unsigned tab_idx, const QString &name) QString Trigger::getTransitionTableName(unsigned tab_idx) { if(tab_idx > NEW_TABLE_NAME) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(transition_tabs_names[tab_idx]); } @@ -446,33 +446,33 @@ void Trigger::validateTrigger(void) { //The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers if(firing_type==FiringType::instead_of && parent_type==OBJ_TABLE) - throw Exception(ERR_TABLE_TRIG_INSTEADOF_FIRING,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvTableTriggerInsteadOfFiring,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The INSTEAD OF mode cannot be used on view triggers that executes for each statement else if(firing_type==FiringType::instead_of && parent_type==OBJ_VIEW && !is_exec_per_row) - throw Exception(ERR_TRIGGER_INV_INSTEADOF_USAGE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvUsageInsteadOfOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event else if(firing_type==FiringType::instead_of && events[EventType::on_update] && !upd_columns.empty()) - throw Exception(ERR_TRIGGER_INV_INSTEADOF_UPDATE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvUsageInsteadOfUpdateTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table else if(events[EventType::on_truncate] && (is_exec_per_row || parent_type==OBJ_VIEW)) - throw Exception(ERR_TRIGGER_INV_TRUNCATE_USAGE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvUsageTruncateOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A view trigger cannot be AFTER/BEFORE when it executes for each row else if(parent_type==OBJ_VIEW && is_exec_per_row && (firing_type==FiringType::after || firing_type==FiringType::before)) - throw Exception(ERR_VIEW_TRIG_INV_AFTBFR_USAGE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvUsageAfterBeforeViewTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Only constraint triggers can be deferrable or reference another table else if(referenced_table || is_deferrable) - throw Exception(ERR_TRIG_USING_CONSTRIG_ATRIBS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvUseConstraintTriggerAttribs,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Constraint triggers can only be executed on AFTER events and for each row else { if(firing_type!=FiringType::after && !is_exec_per_row) - throw Exception(ERR_CONST_TRIG_NOT_AFTER_ROW,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvConstrTriggerNotAfterRow,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index cc3c5d5c87..467a861728 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -98,14 +98,14 @@ void Type::addAttribute(TypeAttribute attrib) { //Raises an error if the attribute has an empty name or null type if(attrib.getName().isEmpty() || attrib.getType()==PgSQLType::null) - throw Exception(ERR_INS_INV_TYPE_ATTRIB,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsInvalidTypeAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the passed attribute has the same type as the defining type (this) else if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !attrib.getType()) - throw Exception(Exception::getErrorMessage(ERR_USER_TYPE_SELF_REFERENCE).arg(this->getName(true)), - ERR_USER_TYPE_SELF_REFERENCE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvUserTypeSelfReference).arg(this->getName(true)), + InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the attribute already exists else if(getAttributeIndex(attrib.getName()) >= 0) - throw Exception(ERR_INS_DUPLIC_ITEMS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedItems,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_attribs.push_back(attrib); setCodeInvalidated(true); @@ -115,7 +115,7 @@ void Type::removeAttribute(unsigned attrib_idx) { //Raises an error if the attribute index is out of bound if(attrib_idx >= type_attribs.size()) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_attribs.erase(type_attribs.begin() + attrib_idx); setCodeInvalidated(true); @@ -148,17 +148,17 @@ void Type::addEnumeration(const QString &enum_name) { //Raises an error if the enumaration name is empty if(enum_name.isEmpty()) - throw Exception(ERR_INS_INV_TYPE_ENUM_ITEM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsInvalidEnumerationItem,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the enumeration name is invalid (exceeds the maximum length) else if(enum_name.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) - throw Exception(Exception::getErrorMessage(ERR_ASG_ENUM_LONG_NAME).arg(enum_name).arg(this->getName(true)), - ERR_ASG_ENUM_LONG_NAME,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(AsgEnumLongName).arg(enum_name).arg(this->getName(true)), + AsgEnumLongName,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(enum_name.contains(QChar(','))) - throw Exception(Exception::getErrorMessage(ERR_ASG_ENUM_INV_CHARS).arg(enum_name).arg(this->getName(true)), - ERR_ASG_ENUM_INV_CHARS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(AsgEnumInvalidChars).arg(enum_name).arg(this->getName(true)), + AsgEnumInvalidChars,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the enumeration already exists else if(isEnumerationExists(enum_name)) - throw Exception(ERR_INS_DUPLIC_ENUM_ITEM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InsDuplicatedEnumerationItem,__PRETTY_FUNCTION__,__FILE__,__LINE__); enumerations.push_back(enum_name); setCodeInvalidated(true); @@ -167,7 +167,7 @@ void Type::addEnumeration(const QString &enum_name) void Type::removeEnumeration(unsigned enum_idx) { if(enum_idx >= enumerations.size()) - throw Exception(ERR_REF_ENUM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefEnumerationInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); enumerations.erase(enumerations.begin() + enum_idx); setCodeInvalidated(true); @@ -183,7 +183,7 @@ void Type::setConfiguration(unsigned conf) { //Raises an error if the configuration type is invalid if(conf < BASE_TYPE || conf > RANGE_TYPE) - throw Exception(ERR_ASG_INV_TYPE_CONFIG,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_attribs.clear(); enumerations.clear(); @@ -216,7 +216,7 @@ void Type::setFunction(unsigned func_id, Function *func) //Raises an error if the function id is invalid if(func_id >= funcs_len) - throw Exception(ERR_REF_FUNCTION_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(func) param_count=func->getParameterCount(); @@ -225,14 +225,14 @@ void Type::setFunction(unsigned func_id, Function *func) to the type's configuraiton */ if((config==BASE_TYPE && func_id >= CANONICAL_FUNC) || (config==RANGE_TYPE && func_id <= ANALYZE_FUNC)) - throw Exception(ERR_REF_FUNCTION_INV_TYPE_CONF,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefInvalidFunctionIdTypeConfig,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the function isn't defined and the function id is INPUT or OUTPUT, because this function is mandatory for base types */ else if(!func && (func_id==INPUT_FUNC || func_id==OUTPUT_FUNC)) - throw Exception(Exception::getErrorMessage(ERR_ASG_NOT_ALOC_FUNCTION) + throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) .arg(BaseObject::getTypeName(OBJ_TYPE)), - ERR_ASG_NOT_ALOC_FUNCTION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(func) { @@ -241,7 +241,7 @@ void Type::setFunction(unsigned func_id, Function *func) if((func_id!=CANONICAL_FUNC && func_id!=SUBTYPE_DIFF_FUNC) && func->getLanguage()->getName()!=~LanguageType(LanguageType::c) && func->getLanguage()->getName()!=~LanguageType(LanguageType::internal)) - throw Exception(ERR_ASG_FUNC_INV_LANGUAGE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgFunctionInvalidLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the parameter count for INPUT and RECV functions is different from 1 or 3. */ @@ -252,10 +252,10 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==OUTPUT_FUNC || func_id==SEND_FUNC || func_id==TPMOD_IN_FUNC || func_id==TPMOD_OUT_FUNC || func_id==ANALYZE_FUNC || func_id==CANONICAL_FUNC))) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNC_INV_PARAM_COUNT) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_TYPE)), - ERR_ASG_FUNC_INV_PARAM_COUNT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Checking the return types of function in relation to type. INPUT, RECV and CANONICAL functions must return the data type that is being defined according to the documentation, but to facilitate the implementation the function must return data type @@ -272,10 +272,10 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==ANALYZE_FUNC && func->getReturnType()!=QString("boolean")) || (func_id==CANONICAL_FUNC && func->getReturnType()!=QString("\"any\"")) || (func_id==SUBTYPE_DIFF_FUNC && func->getReturnType()!=QString("double precision"))) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNCTION_INV_RET_TYPE) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName()) .arg(BaseObject::getTypeName(OBJ_TYPE)), - ERR_ASG_FUNCTION_INV_RET_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Validating the parameter types of function in relation to the type configuration. The INPUT function must have parameters with type (cstring, oid, integer). @@ -303,10 +303,10 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==SUBTYPE_DIFF_FUNC && (func->getParameter(0).getType()!=this->subtype || func->getParameter(1).getType()!=this->subtype))) - throw Exception(Exception::getErrorMessage(ERR_ASG_FUNCTION_INV_PARAMS) + throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName()) .arg(this->getTypeName()), - ERR_ASG_FUNCTION_INV_PARAMS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); func->setProtected(false); } @@ -375,8 +375,8 @@ void Type::setAlignment(PgSQLType type) //Raises an error if the type assigned to the alignment is invalid according to the rule if(tp!=QString("char") && tp!=QString("smallint") && tp!=QString("integer") && tp!=QString("double precision")) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_ALIGNMENT_TYPE).arg(this->getName(true)), - ERR_ASG_INV_ALIGNMENT_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(AsgInvalidAlignmentType).arg(this->getName(true)), + AsgInvalidAlignmentType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(alignment != type); alignment=tp; @@ -399,13 +399,13 @@ void Type::setDefaultValue(const QString &value) void Type::setElement(PgSQLType elem) { if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !elem) - throw Exception(Exception::getErrorMessage(ERR_USER_TYPE_SELF_REFERENCE).arg(this->getName(true)), - ERR_USER_TYPE_SELF_REFERENCE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvUserTypeSelfReference).arg(this->getName(true)), + InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(elem!=QString("\"any\"") && (elem.isOIDType() || elem.isPseudoType() || elem.isUserType() || elem.isArrayType())) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_ELEMENT_TYPE).arg(this->getName(true)), - ERR_ASG_INV_ELEMENT_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(AsgInvalidElementType).arg(this->getName(true)), + AsgInvalidElementType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(element != elem); this->element=elem; @@ -472,8 +472,8 @@ void Type::setCollatable(bool value) void Type::setLikeType(PgSQLType like_type) { if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !like_type) - throw Exception(Exception::getErrorMessage(ERR_USER_TYPE_SELF_REFERENCE).arg(this->getName(true)), - ERR_USER_TYPE_SELF_REFERENCE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvUserTypeSelfReference).arg(this->getName(true)), + InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->like_type != like_type); this->like_type=like_type; @@ -482,8 +482,8 @@ void Type::setLikeType(PgSQLType like_type) void Type::setSubtype(PgSQLType subtype) { if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !subtype) - throw Exception(Exception::getErrorMessage(ERR_USER_TYPE_SELF_REFERENCE).arg(this->getName(true)), - ERR_USER_TYPE_SELF_REFERENCE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvUserTypeSelfReference).arg(this->getName(true)), + InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->subtype != subtype); this->subtype=subtype; @@ -492,10 +492,10 @@ void Type::setSubtype(PgSQLType subtype) void Type::setSubtypeOpClass(OperatorClass *opclass) { if(opclass && opclass->getIndexingType()!=IndexingType::btree) - throw Exception(Exception::getErrorMessage(ERR_ASG_INV_OPCLASS_OBJ) + throw Exception(Exception::getErrorMessage(AsgInvalidOpClassObject) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_ASG_INV_OPCLASS_OBJ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgInvalidOpClassObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(subtype_opclass != opclass); subtype_opclass=opclass; @@ -504,7 +504,7 @@ void Type::setSubtypeOpClass(OperatorClass *opclass) TypeAttribute Type::getAttribute(unsigned attrib_idx) { if(attrib_idx >= type_attribs.size()) - throw Exception(ERR_REF_ATTRIB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type_attribs[attrib_idx]); } @@ -517,7 +517,7 @@ unsigned Type::getAttributeCount(void) QString Type::getEnumeration(unsigned idx_enum) { if(idx_enum >= enumerations.size()) - throw Exception(ERR_REF_ENUM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefEnumerationInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(enumerations[idx_enum]); } @@ -530,7 +530,7 @@ unsigned Type::getEnumerationCount(void) Function *Type::getFunction(unsigned func_id) { if(func_id >= sizeof(functions)/sizeof(Function *)) - throw Exception(ERR_REF_FUNCTION_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_id]); } @@ -712,7 +712,7 @@ QString Type::getAlterDefinition(BaseObject *object) Type *type=dynamic_cast(object); if(!type) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/type.h b/libpgmodeler/src/type.h index 1d4eb4e371..98b9607dfe 100644 --- a/libpgmodeler/src/type.h +++ b/libpgmodeler/src/type.h @@ -106,12 +106,12 @@ class Type: public BaseObject { void convertFunctionParameters(bool inverse_conv=false); public: - static const unsigned BASE_TYPE=10, + static constexpr unsigned BASE_TYPE=10, ENUMERATION_TYPE=11, COMPOSITE_TYPE=12, RANGE_TYPE=13; - static const unsigned INPUT_FUNC=0, + static constexpr unsigned INPUT_FUNC=0, OUTPUT_FUNC=1, RECV_FUNC=2, SEND_FUNC=3, diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index ea26fc0402..4ef864cfb1 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -226,17 +226,17 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) { //Raises an error if the expression is empty if(refer.getExpression().isEmpty()) - throw Exception(ERR_INV_VIEW_DEF_EXPRESSION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidViewDefExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if already exists a definition expression else if(hasDefinitionExpression()) - throw Exception(ERR_ASG_SEC_VIEW_DEF_EXPRESSION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgSecondViewDefExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the user try to add a definition expression when already exists another references else if(!references.empty()) - throw Exception(ERR_MIX_VIEW_DEF_EXPR_REFS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(MixingViewDefExprsReferences,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the user try to add a ordinary reference when there is a reference used as definition expression else if(hasDefinitionExpression()) - throw Exception(ERR_MIX_VIEW_DEF_EXPR_REFS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(MixingViewDefExprsReferences,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Checks if the reference already exists idx=getReferenceIndex(refer); @@ -264,7 +264,7 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) expr_list->insert(expr_list->begin() + expr_id, static_cast(idx)); //Raises an error if the expression id is invalid else if(expr_id >= 0 && expr_id >= static_cast(expr_list->size())) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); else expr_list->push_back(static_cast(idx)); @@ -320,7 +320,7 @@ Reference View::getReference(unsigned ref_id) { //Raises an error if the reference id is out of bound if(ref_id >= references.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(references[ref_id]); } @@ -331,7 +331,7 @@ Reference View::getReference(unsigned ref_id, unsigned sql_type) //Raises an error if the reference id is out of bound if(ref_id >= references.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(sql_type==Reference::SQL_VIEW_DEFINITION || vect_idref) return(references[ref_id]); @@ -347,7 +347,7 @@ void View::removeReference(unsigned ref_id) //Raises an error if the reference id is out of bound if(ref_id >= references.size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); for(i=0; i < 3; i++) { @@ -384,7 +384,7 @@ void View::removeReference(unsigned expr_id, unsigned sql_type) vector *vect_idref=getExpressionList(sql_type); if(expr_id >= vect_idref->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vect_idref->erase(vect_idref->begin() + expr_id); setCodeInvalidated(true); @@ -697,7 +697,7 @@ int View::getObjectIndex(const QString &name, ObjectType obj_type) void View::addObject(BaseObject *obj, int obj_idx) { if(!obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { try @@ -708,12 +708,12 @@ void View::addObject(BaseObject *obj, int obj_idx) //Raises an error if already exists a object with the same name and type if(getObjectIndex(obj->getName(), tab_obj->getObjectType()) >= 0) { - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(obj->getName(true)) .arg(obj->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - ERR_ASG_DUPLIC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Validates the object definition @@ -734,11 +734,11 @@ void View::addObject(BaseObject *obj, int obj_idx) } catch(Exception &e) { - if(e.getErrorType()==ERR_UNDEF_ATTRIB_VALUE) - throw Exception(Exception::getErrorMessage(ERR_ASG_OBJ_INV_DEFINITION) + if(e.getErrorType()==UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) .arg(obj->getName()) .arg(obj->getTypeName()), - ERR_ASG_OBJ_INV_DEFINITION,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } @@ -788,7 +788,7 @@ void View::removeObject(unsigned obj_idx, ObjectType obj_type) //Raises an error if the object index is out of bound if(obj_idx >= obj_list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=obj_list->begin() + obj_idx; (*itr)->setParentTable(nullptr); @@ -862,7 +862,7 @@ TableObject *View::getObject(unsigned obj_idx, ObjectType obj_type) //Raises an error if the object index is out of bound if(obj_idx >= obj_list->size()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(obj_list->at(obj_idx)); } @@ -957,7 +957,7 @@ vector *View::getObjectList(ObjectType obj_type) else if(obj_type==OBJ_INDEX) return(&indexes); else - throw Exception(ERR_OBT_OBJ_INVALID_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void View::removeObjects(void) diff --git a/libpgmodeler_ui/src/aboutwidget.cpp b/libpgmodeler_ui/src/aboutwidget.cpp index 7e01b667c3..51c7340de8 100644 --- a/libpgmodeler_ui/src/aboutwidget.cpp +++ b/libpgmodeler_ui/src/aboutwidget.cpp @@ -36,8 +36,8 @@ AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent) PgModelerUiNS::configureWidgetFont(build_lbl, PgModelerUiNS::BIG_FONT_FACTOR); PgModelerUiNS::configureWidgetFont(build_num_lbl, PgModelerUiNS::BIG_FONT_FACTOR); - pgmodeler_ver_lbl->setText(QString("v%1 ").arg(GlobalAttributes::PGMODELER_VERSION)); - build_num_lbl->setText(QString("%1 Qt %2").arg(GlobalAttributes::PGMODELER_BUILD_NUMBER).arg(QT_VERSION_STR)); + pgmodeler_ver_lbl->setText(QString("v%1 ").arg(GlobalAttributes::PgModelerVersion)); + build_num_lbl->setText(QString("%1 Qt %2").arg(GlobalAttributes::PgModelerBuildNumber).arg(QT_VERSION_STR)); connect(hide_tb, &QToolButton::clicked, this, [&](){ diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index 38b6169c21..1754d56722 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -28,7 +28,7 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_ QFrame *frame=nullptr; initial_cond_hl=new SyntaxHighlighter(initial_cond_txt); - initial_cond_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + initial_cond_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); final_func_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); transition_func_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index b8ca6d6b34..dc9318fa59 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -157,9 +157,9 @@ void AppearanceConfigWidget::loadExampleModel(void) if(model->getObjectCount()==0) { - model->loadModel(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::EXAMPLE_MODEL); + model->loadModel(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::ExampleModel); count=model->getObjectCount(OBJ_TABLE); for(i=0; i < count; i++) @@ -307,8 +307,8 @@ void AppearanceConfigWidget::saveConfiguration(void) } } - config_params[GlobalAttributes::OBJECTS_STYLE_CONF]=attribs; - BaseConfigWidget::saveConfiguration(GlobalAttributes::OBJECTS_STYLE_CONF, config_params); + config_params[GlobalAttributes::ObjectsStyleConf]=attribs; + BaseConfigWidget::saveConfiguration(GlobalAttributes::ObjectsStyleConf, config_params); } catch(Exception &e) { @@ -418,7 +418,7 @@ void AppearanceConfigWidget::restoreDefaults(void) { try { - BaseConfigWidget::restoreDefaults(GlobalAttributes::OBJECTS_STYLE_CONF, false); + BaseConfigWidget::restoreDefaults(GlobalAttributes::ObjectsStyleConf, false); this->loadConfiguration(); setConfigurationChanged(true); } diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index e211d74e14..69b7f9521e 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -50,18 +50,18 @@ void BaseConfigWidget::saveConfiguration(const QString &conf_id, map::iterator itr, itr_end; @@ -83,8 +83,8 @@ void BaseConfigWidget::saveConfiguration(const QString &conf_id, maptable=nullptr; if(!model || (uses_op_list && !op_list)) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(op_list) operation_count = op_list->getCurrentSize(); @@ -314,7 +314,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis else if(parent_type==OBJ_RELATIONSHIP) this->relationship=dynamic_cast(parent_obj); else if(parent_type!=OBJ_DATABASE && parent_type!=OBJ_SCHEMA) - throw Exception(ERR_ASG_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -495,7 +495,7 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ { QFrame *frame=nullptr; map > fields_map; - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_91)].push_back(collation_lbl); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion91)].push_back(collation_lbl); frame=generateVersionWarningFrame(fields_map); baseobject_grid->addWidget(frame, baseobject_grid->count()+1, 0, 1, 0); frame->setParent(this); @@ -748,12 +748,12 @@ void BaseObjectWidget::applyConfiguration(void) //Raises an error if another object is found with the same name as the editing object if(!new_obj && aux_obj && aux_obj!=object) { - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(obj_name) .arg(BaseObject::getTypeName(obj_type)) .arg(parent_obj->getName(true)) .arg(parent_obj->getTypeName()), - ERR_ASG_DUPLIC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -891,10 +891,10 @@ void BaseObjectWidget::finishConfiguration(void) { QApplication::restoreOverrideCursor(); - if(e.getErrorType()==ERR_ASG_OBJ_INV_DEFINITION) - throw Exception(Exception::getErrorMessage(ERR_REQ_FIELDS_NOT_FILLED) + if(e.getErrorType()==AsgObjectInvalidDefinition) + throw Exception(Exception::getErrorMessage(RequiredFieldsNotFilled) .arg(this->object->getName()).arg(this->object->getTypeName()), - ERR_REQ_FIELDS_NOT_FILLED,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + RequiredFieldsNotFilled,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 97aaf29726..fdb44c178e 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -45,7 +45,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { Q_OBJECT protected: - static const int MAX_OBJECT_SIZE=16777215; + static constexpr int MAX_OBJECT_SIZE=16777215; static const QColor PROT_LINE_BGCOLOR, PROT_LINE_FGCOLOR, RELINC_LINE_BGCOLOR, @@ -139,7 +139,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { public: //! \brief Constants used to generate version intervals for version alert frame - static const unsigned UNTIL_VERSION=0, + static constexpr unsigned UNTIL_VERSION=0, VERSIONS_INTERVAL=1, AFTER_VERSION=2; diff --git a/libpgmodeler_ui/src/bugreportform.cpp b/libpgmodeler_ui/src/bugreportform.cpp index 2e9262cf49..51477f2079 100644 --- a/libpgmodeler_ui/src/bugreportform.cpp +++ b/libpgmodeler_ui/src/bugreportform.cpp @@ -22,8 +22,6 @@ #include "messagebox.h" #include "pgmodeleruins.h" -const char BugReportForm::CHR_DELIMITER=static_cast(3); - BugReportForm::BugReportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { setupUi(this); @@ -42,13 +40,13 @@ BugReportForm::BugReportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(paren connect(actions_txt, SIGNAL(textChanged()), this, SLOT(enableGeneration())); connect(output_edt, SIGNAL(textChanged(QString)), this, SLOT(enableGeneration())); - output_edt->setText(QFileInfo(GlobalAttributes::TEMPORARY_DIR).absoluteFilePath()); + output_edt->setText(QFileInfo(GlobalAttributes::TemporaryDir).absoluteFilePath()); //Installs a syntax highlighter on model_txt widget hl_model_txt=new SyntaxHighlighter(model_txt); - hl_model_txt->loadConfiguration(GlobalAttributes::XML_HIGHLIGHT_CONF_PATH); + hl_model_txt->loadConfiguration(GlobalAttributes::XMLHighlightConfPath); - QDir tmp_dir=QDir(GlobalAttributes::TEMPORARY_DIR, QString("*.dbm"), QDir::Name, QDir::Files | QDir::NoDotAndDotDot); + QDir tmp_dir=QDir(GlobalAttributes::TemporaryDir, QString("*.dbm"), QDir::Name, QDir::Files | QDir::NoDotAndDotDot); tmp_dir.setSorting(QDir::Time); QStringList list=tmp_dir.entryList(); @@ -57,8 +55,8 @@ BugReportForm::BugReportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(paren QFile input; //Opens the last modified model file showing it on the proper widget - input.setFileName(GlobalAttributes::TEMPORARY_DIR + - GlobalAttributes::DIR_SEPARATOR + list[0]); + input.setFileName(GlobalAttributes::TemporaryDir + + GlobalAttributes::DirSeparator + list[0]); input.open(QFile::ReadOnly); model_txt->setPlainText(QString(input.readAll())); @@ -96,8 +94,8 @@ void BugReportForm::generateReport(const QByteArray &buf) Messagebox msgbox; QFile output; QString filename=QFileInfo(QString(output_edt->text() + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::BUG_REPORT_FILE) + GlobalAttributes::DirSeparator + + GlobalAttributes::BugReportFile) .arg(QDateTime::currentDateTime().toString(QString("_yyyyMMdd_hhmm")))).absoluteFilePath(); //Opens the file for writting @@ -105,7 +103,7 @@ void BugReportForm::generateReport(const QByteArray &buf) output.open(QFile::WriteOnly); if(!output.isOpen()) - msgbox.show(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(filename), Messagebox::ERROR_ICON); + msgbox.show(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), Messagebox::ERROR_ICON); else { QByteArray comp_buf; @@ -117,7 +115,7 @@ void BugReportForm::generateReport(const QByteArray &buf) output.write(comp_buf.data(), comp_buf.size()); output.close(); - msgbox.show(trUtf8("Bug report successfuly generated! Please, send the file %1 to %2 in order be analyzed. Thank you for the collaboration!").arg(filename).arg(GlobalAttributes::BUG_REPORT_EMAIL), + msgbox.show(trUtf8("Bug report successfuly generated! Please, send the file %1 to %2 in order be analyzed. Thank you for the collaboration!").arg(filename).arg(GlobalAttributes::BugReportEmail), Messagebox::INFO_ICON); } } @@ -142,8 +140,8 @@ void BugReportForm::attachModel(void) input.open(QFile::ReadOnly); if(!input.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(file_dlg.selectedFiles().at(0)), - ERR_FILE_DIR_NOT_ACCESSED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(file_dlg.selectedFiles().at(0)), + FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf=input.readAll(); model_txt->setPlainText(QString(buf)); diff --git a/libpgmodeler_ui/src/bugreportform.h b/libpgmodeler_ui/src/bugreportform.h index 58ce26c9cc..e806cb5304 100644 --- a/libpgmodeler_ui/src/bugreportform.h +++ b/libpgmodeler_ui/src/bugreportform.h @@ -38,7 +38,7 @@ class BugReportForm : public QDialog, public Ui::BugReportForm { protected: //! \brief Delimiter character which separates the sections of the compressed file - const static char CHR_DELIMITER; + static constexpr char CHR_DELIMITER = static_cast(3); //! \brief Generates an uncompressed buffer based upon the data in fields virtual QByteArray generateReportBuffer(void); diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 78c93b338b..6b88cbdccd 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -24,7 +24,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool enable_snippets) : QWidget(dynamic_cast(code_field_txt)) { if(!code_field_txt) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->enable_snippets = enable_snippets; popup_timer.setInterval(300); diff --git a/libpgmodeler_ui/src/colorpickerwidget.cpp b/libpgmodeler_ui/src/colorpickerwidget.cpp index 857c59d715..c5b8a2769d 100644 --- a/libpgmodeler_ui/src/colorpickerwidget.cpp +++ b/libpgmodeler_ui/src/colorpickerwidget.cpp @@ -80,7 +80,7 @@ void ColorPickerWidget::setColor(int color_idx, const QColor &color) QString cl_name; if(color_idx < 0 || color_idx >= colors.size()) - throw Exception(ERR_REF_ELEM_INV_INDEX ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(this->isEnabled()) cl_name=color.name(); @@ -94,7 +94,7 @@ void ColorPickerWidget::setColor(int color_idx, const QColor &color) QColor ColorPickerWidget::getColor(int color_idx) { if(color_idx < 0 || color_idx >= colors.size()) - throw Exception(ERR_REF_ELEM_INV_INDEX ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(colors[color_idx]); } @@ -107,7 +107,7 @@ unsigned ColorPickerWidget::getColorCount(void) bool ColorPickerWidget::isButtonVisible(unsigned idx) { if(idx >= static_cast(buttons.size())) - throw Exception(ERR_REF_ELEM_INV_INDEX ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(buttons[idx]->isVisible()); } @@ -115,7 +115,7 @@ bool ColorPickerWidget::isButtonVisible(unsigned idx) void ColorPickerWidget::setButtonToolTip(unsigned button_idx, const QString &tooltip) { if(button_idx >= static_cast(buttons.size())) - throw Exception(ERR_REF_ELEM_INV_INDEX ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); buttons[button_idx]->setToolTip(tooltip); } @@ -134,7 +134,7 @@ void ColorPickerWidget::setEnabled(bool value) void ColorPickerWidget::setButtonVisible(unsigned idx, bool value) { if(idx >= static_cast(buttons.size())) - throw Exception(ERR_REF_ELEM_INV_INDEX ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); buttons[idx]->setVisible(value); } diff --git a/libpgmodeler_ui/src/colorpickerwidget.h b/libpgmodeler_ui/src/colorpickerwidget.h index 95e30b3611..18f0e7e28d 100644 --- a/libpgmodeler_ui/src/colorpickerwidget.h +++ b/libpgmodeler_ui/src/colorpickerwidget.h @@ -53,7 +53,7 @@ class ColorPickerWidget: public QWidget, public Ui::ColorPickerWidget { bool eventFilter(QObject *object, QEvent *event); public: - static const int MAX_COLOR_BUTTONS=20; + static constexpr int MAX_COLOR_BUTTONS=20; explicit ColorPickerWidget(int color_count, QWidget * parent = 0); diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index f2eca51012..ebccbb8ab3 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -39,7 +39,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN hl_default_value=nullptr; hl_default_value=new SyntaxHighlighter(def_value_txt, true); - hl_default_value->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + hl_default_value->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); sequence_sel=new ObjectSelectorWidget(OBJ_SEQUENCE, true, this); sequence_sel->setEnabled(false); @@ -54,7 +54,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN configureTabOrder({ data_type }); map > fields_map; - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_100)].push_back(identity_rb); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion100)].push_back(identity_rb); highlightVersionSpecificFields(fields_map); connect(sequence_rb, &QRadioButton::clicked, @@ -100,7 +100,7 @@ void ColumnWidget::setAttributes(DatabaseModel *model, OperationList *op_list, B PgSQLType type; if(!parent_obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, column, parent_obj); sequence_sel->setModel(model); @@ -191,10 +191,10 @@ void ColumnWidget::applyConfiguration(void) { pk = dynamic_cast
(table)->getPrimaryKey(); if(pk && pk->isColumnReferenced(column) && !notnull_chk->isChecked()) - throw Exception(Exception::getErrorMessage(ERR_NULL_PK_COLUMN) + throw Exception(Exception::getErrorMessage(NullPrimaryKeyColumn) .arg(column->getName()) .arg(pk->getParentTable()->getSignature(true)), - ERR_NULL_PK_COLUMN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + NullPrimaryKeyColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); } BaseObjectWidget::applyConfiguration(); diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index d6bd1ad561..ca3698e784 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -115,13 +115,13 @@ void ConfigurationForm::loadConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==ERR_PLUGINS_NOT_LOADED) + if(e.getErrorType()==PluginsNotLoaded) { msg_box.show(e); } else { - Exception ex = Exception(Exception::getErrorMessage(ERR_CONFIG_NOT_LOADED).arg(e.getExtraInfo()),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + Exception ex = Exception(Exception::getErrorMessage(ConfigurationNotLoaded).arg(e.getExtraInfo()),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); msg_box.show(ex, QString("%1 %2").arg(ex.getErrorMessage()).arg(trUtf8("In some cases restore the default settings related to it may solve the problem. Would like to do that?")), Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS, trUtf8("Restore"), QString(), QString(), PgModelerUiNS::getIconPath("atualizar")); diff --git a/libpgmodeler_ui/src/configurationform.h b/libpgmodeler_ui/src/configurationform.h index ab33447504..b92bc46187 100644 --- a/libpgmodeler_ui/src/configurationform.h +++ b/libpgmodeler_ui/src/configurationform.h @@ -48,7 +48,7 @@ class ConfigurationForm: public QDialog, public Ui::ConfigurationForm { void showEvent(QShowEvent *); public: - static const int GENERAL_CONF_WGT=0, + static constexpr int GENERAL_CONF_WGT=0, RELATIONSHIPS_CONF_WGT=1, APPEARANCE_CONF_WGT=2, CONNECTIONS_CONF_WGT=3, diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 6a764e5dda..e92db3a26f 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -112,7 +112,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) destroyConnections(); key_attribs.push_back(ParsersAttributes::ALIAS); - BaseConfigWidget::loadConfiguration(GlobalAttributes::CONNECTIONS_CONF, config_params, key_attribs); + BaseConfigWidget::loadConfiguration(GlobalAttributes::ConnectionsConf, config_params, key_attribs); /*try { @@ -451,7 +451,7 @@ void ConnectionsConfigWidget::restoreDefaults(void) try { //Restore the default connection config file - BaseConfigWidget::restoreDefaults(GlobalAttributes::CONNECTIONS_CONF, false); + BaseConfigWidget::restoreDefaults(GlobalAttributes::ConnectionsConf, false); //Remove all connections while(connections_cmb->count() > 0) @@ -489,12 +489,12 @@ void ConnectionsConfigWidget::saveConfiguration(void) handleConnection(); } - config_params[GlobalAttributes::CONNECTIONS_CONF].clear(); + config_params[GlobalAttributes::ConnectionsConf].clear(); /* Workaround: When there is no connection, to prevent saving an empty file, is necessary to fill the attribute CONNECTIONS with white spaces */ if(connections.empty()) - config_params[GlobalAttributes::CONNECTIONS_CONF][ParsersAttributes::CONNECTIONS]=QString(" "); + config_params[GlobalAttributes::ConnectionsConf][ParsersAttributes::CONNECTIONS]=QString(" "); else { for(Connection *conn : connections) @@ -514,13 +514,13 @@ void ConnectionsConfigWidget::saveConfiguration(void) attribs[DEFAULT_FOR.arg(ParsersAttributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OP_VALIDATION) ? ParsersAttributes::_TRUE_ : QString()); schparser.ignoreUnkownAttributes(true); - config_params[GlobalAttributes::CONNECTIONS_CONF][ParsersAttributes::CONNECTIONS]+= - schparser.getCodeDefinition(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SCHEMAS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::CONNECTIONS_CONF + - GlobalAttributes::SCHEMA_EXT, + config_params[GlobalAttributes::ConnectionsConf][ParsersAttributes::CONNECTIONS]+= + schparser.getCodeDefinition(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::SchemasDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::ConnectionsConf + + GlobalAttributes::SchemaExt, attribs); schparser.ignoreUnkownAttributes(false); @@ -528,7 +528,7 @@ void ConnectionsConfigWidget::saveConfiguration(void) } schparser.ignoreUnkownAttributes(true); - BaseConfigWidget::saveConfiguration(GlobalAttributes::CONNECTIONS_CONF, config_params); + BaseConfigWidget::saveConfiguration(GlobalAttributes::ConnectionsConf, config_params); schparser.ignoreUnkownAttributes(false); } catch(Exception &e) @@ -559,7 +559,7 @@ void ConnectionsConfigWidget::fillConnectionsComboBox(QComboBox *combo, bool inc Connection *def_conn=nullptr; if(!combo) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); getConnections(connections); diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index a55d9a405a..dfb4371595 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -36,7 +36,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, OB excl_elems_grp->setLayout(grid); expression_hl=new SyntaxHighlighter(expression_txt, false, true); - expression_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + expression_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); columns_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ (ObjectsTableWidget::EDIT_BUTTON | @@ -89,8 +89,8 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, OB constraint_grid->addWidget(info_frm, constraint_grid->count()+1, 0, 1, 0); info_frm->setParent(this); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_92)].push_back(no_inherit_lbl); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(indexing_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion92)].push_back(no_inherit_lbl); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_chk); values_map[indexing_chk].push_back(~IndexingType(IndexingType::brin)); warn_frm=generateVersionWarningFrame(fields_map, &values_map); @@ -356,11 +356,11 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis vector excl_elems; if(!parent_obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=parent_obj->getObjectType(); if(obj_type!=OBJ_TABLE && obj_type!=OBJ_RELATIONSHIP) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, constr, parent_obj); @@ -486,7 +486,7 @@ void ConstraintWidget::applyConfiguration(void) //Raises an error if the user try to create a primary key that has columns added by relationship (not supported) if(constr->getConstraintType()==ConstraintType::primary_key && constr->isReferRelationshipAddedColumn()) - throw Exception(ERR_PK_USING_COLS_ADDED_BY_REL,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(UnsupportedPKColsAddedByRel,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::applyConfiguration(); @@ -497,7 +497,7 @@ void ConstraintWidget::applyConfiguration(void) constr->getColumnCount(Constraint::SOURCE_COLS)==0) || (constr->getConstraintType()==ConstraintType::foreign_key && constr->getColumnCount(Constraint::REFERENCED_COLS)==0)) - throw Exception(ERR_CONSTR_NO_COLUMNS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvConstratintNoColumns,__PRETTY_FUNCTION__,__FILE__,__LINE__); finishConfiguration(); diff --git a/libpgmodeler_ui/src/csvloadwidget.cpp b/libpgmodeler_ui/src/csvloadwidget.cpp index 164ed909df..3b36ddae2d 100644 --- a/libpgmodeler_ui/src/csvloadwidget.cpp +++ b/libpgmodeler_ui/src/csvloadwidget.cpp @@ -137,8 +137,8 @@ void CsvLoadWidget::loadCsvFile(void) file.setFileName(file_edt->text()); if(!file.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(file_edt->text()), - ERR_FILE_DIR_NOT_ACCESSED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(file_edt->text()), + FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); csv_columns.clear(); csv_rows.clear(); diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index f0c5884812..671511fb8d 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -32,11 +32,11 @@ CustomSQLWidget::CustomSQLWidget(QWidget *parent) : BaseObjectWidget(parent) prepend_sql_txt=PgModelerUiNS::createNumberedTextEditor(prepend_sql_wgt, true); append_sql_hl=new SyntaxHighlighter(append_sql_txt); - append_sql_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + append_sql_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); append_sql_cp=new CodeCompletionWidget(append_sql_txt, true); prepend_sql_hl=new SyntaxHighlighter(prepend_sql_txt); - prepend_sql_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + prepend_sql_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); prepend_sql_cp=new CodeCompletionWidget(prepend_sql_txt, true); name_edt->setReadOnly(true); @@ -122,9 +122,9 @@ void CustomSQLWidget::configureMenus(void) void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) { if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!BaseObject::acceptsCustomSQL(object->getObjectType())) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 0e9307aee9..1d4b721091 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1124,7 +1124,7 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *item) { if(!item) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); QString obj_name=item->text(0); @@ -1302,9 +1302,9 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin //Generate the truncate command schparser.ignoreEmptyAttributes(true); schparser.ignoreUnkownAttributes(true); - truc_cmd=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::ALTER_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::TRUNCATE + GlobalAttributes::SCHEMA_EXT, + truc_cmd=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::TRUNCATE + GlobalAttributes::SchemaExt, attribs); //Executes the truncate cmd @@ -1701,9 +1701,9 @@ void DatabaseExplorerWidget::finishObjectRename(void) //Generate the drop command schparser.ignoreEmptyAttributes(true); schparser.ignoreUnkownAttributes(true); - rename_cmd=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::ALTER_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::RENAME + GlobalAttributes::SCHEMA_EXT, + rename_cmd=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::RENAME + GlobalAttributes::SchemaExt, attribs); //Executes the rename cmd @@ -1967,9 +1967,9 @@ void DatabaseExplorerWidget::dropDatabase(void) catch(Exception &e) { if(connection.getConnectionParam(Connection::PARAM_DB_NAME) == default_db) - throw Exception(Exception::getErrorMessage(ERR_DROP_CURRDB_DEFAULT) + throw Exception(Exception::getErrorMessage(DropCurrentDBDefault) .arg(dbname).arg(connection.getConnectionParam(Connection::PARAM_ALIAS)), - ERR_DROP_CURRDB_DEFAULT,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + DropCurrentDBDefault,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index a52611c7b0..018371b899 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -422,7 +422,7 @@ void DatabaseImportForm::filterObjects(void) void DatabaseImportForm::filterObjects(QTreeWidget *tree_wgt, const QString &pattern, int search_column, bool sel_single_leaf) { if(!tree_wgt) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); QList items; QTreeWidgetItemIterator itr(tree_wgt); diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index ed05b44315..1525fa5569 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -80,7 +80,7 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { public: //! \brief Constants used to access the tree widget items data - static const unsigned OBJECT_ID=1, + static constexpr unsigned OBJECT_ID=1, OBJECT_TYPE=2, OBJECT_NAME=3, OBJECT_SCHEMA=4, diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index b458b654ab..c9acb9e742 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -67,7 +67,7 @@ void DatabaseImportHelper::setCurrentDatabase(const QString &dbname) void DatabaseImportHelper::setSelectedOIDs(DatabaseModel *db_model, const map > &obj_oids, const map > &col_oids) { if(!db_model) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); dbmodel=db_model; xmlparser=dbmodel->getXMLParser(); @@ -545,7 +545,7 @@ void DatabaseImportHelper::importDatabase(void) try { if(!dbmodel) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); dbmodel->setLoadingModel(true); dbmodel->setObjectListsCapacity(creation_order.size()); @@ -578,8 +578,8 @@ void DatabaseImportHelper::importDatabase(void) QString log_name; //Writing the erros to log file - log_name=GlobalAttributes::TEMPORARY_DIR + - GlobalAttributes::DIR_SEPARATOR + + log_name=GlobalAttributes::TemporaryDir + + GlobalAttributes::DirSeparator + QString("%1_%2_%3.log").arg(dbmodel->getName()) .arg(QString("import")) .arg(QDateTime::currentDateTime().toString(QString("yyyy-MM-dd_hhmmss"))); @@ -748,9 +748,9 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) } catch(Exception &e) { - throw Exception(Exception::getErrorMessage(ERR_OBJECT_NOT_IMPORTED) + throw Exception(Exception::getErrorMessage(ObjectNotImported) .arg(obj_name).arg(BaseObject::getTypeName(obj_type)).arg(attribs[ParsersAttributes::OID]), - ERR_OBJECT_NOT_IMPORTED,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs)); + ObjectNotImported,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs)); } } @@ -1789,10 +1789,10 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(!partitioned_tab) { - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(OBJ_TABLE)) .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(OBJ_TABLE)), - ERR_REF_OBJ_INEXISTS_MODEL ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -2020,10 +2020,10 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) parent_tab=dynamic_cast(dbmodel->getObject(tab_name, OBJ_VIEW)); if(!parent_tab) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(OBJ_INDEX)) .arg(tab_name).arg(BaseObject::getTypeName(OBJ_TABLE)), - ERR_REF_OBJ_INEXISTS_MODEL ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } cols=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]); @@ -2293,7 +2293,7 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) /* If the role doesn't exists and there is a name defined, throws an error because the roles wasn't found on the model */ if(!role && !role_name.isEmpty()) - throw Exception(Exception::getErrorMessage(ERR_REF_OBJ_INEXISTS_MODEL) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(QString("permission_%1").arg(perm_list[i])).arg(BaseObject::getTypeName(OBJ_PERMISSION)) .arg(role_name).arg(BaseObject::getTypeName(OBJ_ROLE)) ,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -2529,8 +2529,8 @@ void DatabaseImportHelper::__createTableInheritances(void) } if(!parent_tab) - throw Exception(Exception::getErrorMessage(ERR_INV_INH_PARENT_TAB_NOT_FOUND).arg(child_tab->getSignature()).arg(inh_list.front()), - ERR_INV_INH_PARENT_TAB_NOT_FOUND,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvInheritParentTableNotFound).arg(child_tab->getSignature()).arg(inh_list.front()), + InvInheritParentTableNotFound,__PRETTY_FUNCTION__,__FILE__,__LINE__); inh_list.pop_front(); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index f56b6df9e2..34397210ae 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -27,12 +27,13 @@ #include "generalconfigwidget.h" const QColor DataManipulationForm::ROW_COLORS[3]={ QColor(QString("#C0FFC0")), QColor(QString("#FFFFC0")), QColor(QString("#FFC0C0")) }; -const unsigned DataManipulationForm::NO_OPERATION=0; -const unsigned DataManipulationForm::OP_INSERT=1; -const unsigned DataManipulationForm::OP_UPDATE=2; -const unsigned DataManipulationForm::OP_DELETE=3; bool DataManipulationForm::has_csv_clipboard=false; +constexpr unsigned DataManipulationForm::NO_OPERATION; +constexpr unsigned DataManipulationForm::OP_INSERT; +constexpr unsigned DataManipulationForm::OP_UPDATE; +constexpr unsigned DataManipulationForm::OP_DELETE; + DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): QDialog(parent, f) { QAction *act = nullptr; @@ -45,7 +46,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): PgModelerUiNS::configureWidgetFont(warning_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); filter_hl=new SyntaxHighlighter(filter_txt); - filter_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + filter_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); code_compl_wgt=new CodeCompletionWidget(filter_txt); code_compl_wgt->configureCompletion(nullptr, filter_hl); @@ -1318,9 +1319,9 @@ void DataManipulationForm::saveChanges(void) results_tbw->selectRow(row); results_tbw->scrollToItem(results_tbw->item(row, 0)); - throw Exception(Exception::getErrorMessage(ERR_ROW_DATA_NOT_MANIPULATED) + throw Exception(Exception::getErrorMessage(RowDataNotManipulated) .arg(op_names[op_type]).arg(tab_name).arg(row + 1).arg(e.getErrorMessage()), - ERR_ROW_DATA_NOT_MANIPULATED,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + RowDataNotManipulated,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } #endif } @@ -1389,9 +1390,9 @@ QString DataManipulationForm::getDMLCommand(int row) if((value.startsWith(PgModelerNS::UNESC_VALUE_START) && value.endsWith(QString("\\") + PgModelerNS::UNESC_VALUE_END)) || (value.startsWith(PgModelerNS::UNESC_VALUE_START) && !value.endsWith(PgModelerNS::UNESC_VALUE_END)) || (!value.startsWith(PgModelerNS::UNESC_VALUE_START) && !value.endsWith(QString("\\") + PgModelerNS::UNESC_VALUE_END) && value.endsWith(PgModelerNS::UNESC_VALUE_END))) - throw Exception(Exception::getErrorMessage(ERR_MALFORMED_UNESCAPED_VALUE) + throw Exception(Exception::getErrorMessage(MalformedUnescapedValue) .arg(row + 1).arg(col_name), - ERR_MALFORMED_UNESCAPED_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); col_list.push_back(QString("\"%1\"").arg(col_name)); diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 78799762b9..a3213fed0b 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -36,8 +36,11 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { Q_OBJECT //! \brief Constants used to mark the type of operation performed on rows - static const unsigned NO_OPERATION, OP_INSERT, OP_UPDATE, OP_DELETE; - + static constexpr unsigned NO_OPERATION=0, + OP_INSERT=1, + OP_UPDATE=2, + OP_DELETE=3; + //! \brief Default row colors for each operation type static const QColor ROW_COLORS[3]; diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index a25e8c4ba5..c57e148aa8 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -27,7 +27,7 @@ DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_DOMAIN check_expr_hl=nullptr; check_expr_hl=new SyntaxHighlighter(check_expr_txt, false, true); - check_expr_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + check_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); data_type=nullptr; data_type=new PgSQLTypeWidget(this); diff --git a/libpgmodeler_ui/src/donatewidget.cpp b/libpgmodeler_ui/src/donatewidget.cpp index 41371f6f95..09c0b1979c 100644 --- a/libpgmodeler_ui/src/donatewidget.cpp +++ b/libpgmodeler_ui/src/donatewidget.cpp @@ -40,7 +40,7 @@ DonateWidget::DonateWidget(QWidget *parent) : QWidget(parent) connect(donate_tb, &QToolButton::clicked, [&](){ - QDesktopServices::openUrl(QUrl(GlobalAttributes::PGMODELER_DONATE_URL)); + QDesktopServices::openUrl(QUrl(GlobalAttributes::PgModelerDonateURL)); this->close(); emit s_visibilityChanged(false); }); diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index ab239798db..64e1167366 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -29,7 +29,7 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) setupUi(this); elem_expr_hl=new SyntaxHighlighter(elem_expr_txt, false, true); - elem_expr_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + elem_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); parent_obj=nullptr; op_class_sel=new ObjectSelectorWidget(OBJ_OPCLASS, true, this); @@ -40,7 +40,7 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) element_grid->addWidget(op_class_sel, 4,1,1,2); element_grid->addWidget(operator_sel, 5,1,1,2); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_91)].push_back(collation_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion91)].push_back(collation_lbl); warning_frame=BaseObjectWidget::generateVersionWarningFrame(fields_map); element_grid->addWidget(warning_frame, element_grid->count()+1, 0, 1, 3); warning_frame->setParent(this); @@ -134,12 +134,12 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) if(!model || !parent_obj) { this->setEnabled(false); - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(parent_obj->getObjectType()!=OBJ_TABLE && parent_obj->getObjectType()!=OBJ_VIEW && parent_obj->getObjectType()!=OBJ_RELATIONSHIP) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setEnabled(true); this->parent_obj=parent_obj; diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 5286c6c496..6c36de5aaa 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -42,7 +42,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent configureFormLayout(eventtrigger_grid, OBJ_EVENT_TRIGGER); setRequiredField(function_lbl); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(event_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(event_lbl); values_map[event_lbl].push_back(~EventTriggerType(EventTriggerType::table_rewrite)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/findreplacewidget.cpp b/libpgmodeler_ui/src/findreplacewidget.cpp index 25726970ee..a088bd4b79 100644 --- a/libpgmodeler_ui/src/findreplacewidget.cpp +++ b/libpgmodeler_ui/src/findreplacewidget.cpp @@ -21,7 +21,7 @@ FindReplaceWidget::FindReplaceWidget(QPlainTextEdit *txt_edit, QWidget *parent): QWidget(parent) { if(!txt_edit) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setupUi(this); text_edt=txt_edit; diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index 329a66c001..d30d5bdb50 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -80,7 +80,7 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_FU ret_table_gb->setLayout(grid1); ret_table_gb->setVisible(false); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_92)].push_back(leakproof_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion92)].push_back(leakproof_chk); frame=generateVersionWarningFrame(fields_map, &value_map); grid->addWidget(frame, grid->count()+1, 0, 1, 5); frame->setParent(func_config_twg->widget(0)); @@ -366,15 +366,15 @@ void FunctionWidget::selectLanguage(void) { try { - source_code_hl->loadConfiguration(GlobalAttributes::CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + + source_code_hl->loadConfiguration(GlobalAttributes::ConfigurationsDir + + GlobalAttributes::DirSeparator + language_cmb->currentText() + - GlobalAttributes::HIGHLIGHT_FILE_SUF + - GlobalAttributes::CONFIGURATION_EXT); + GlobalAttributes::HighlightFileSuffix + + GlobalAttributes::ConfigurationExt); } catch(Exception &) { - source_code_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + source_code_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); } source_code_hl->rehighlight(); @@ -483,10 +483,10 @@ void FunctionWidget::validateConfiguredFunction(void) } catch(Exception &e) { - throw Exception(Exception::getErrorMessage(ERR_FUNC_CONFIG_INV_OBJECT) + throw Exception(Exception::getErrorMessage(InvFuncConfigInvalidatesObject) .arg(object->getName(true)) .arg(object->getTypeName()), - ERR_FUNC_CONFIG_INV_OBJECT, + InvFuncConfigInvalidatesObject, __PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 2a952634bf..5a764ca3be 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -221,7 +221,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa connect(radio, SIGNAL(clicked()), this, SLOT(setConfigurationChanged())); } - confs_dir_edt->setText(GlobalAttributes::CONFIGURATIONS_DIR); + confs_dir_edt->setText(GlobalAttributes::ConfigurationsDir); connect(open_dir_tb, &QToolButton::clicked, [&](){ QDesktopServices::openUrl(QUrl(QString("file://") + confs_dir_edt->text())); @@ -237,8 +237,8 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa #endif //Retrieving the available UI dictionaries - QStringList langs = QDir(GlobalAttributes::LANGUAGES_DIR + - GlobalAttributes::DIR_SEPARATOR, + QStringList langs = QDir(GlobalAttributes::LanguagesDir + + GlobalAttributes::DirSeparator, QString("*.qm"), QDir::Name, QDir::AllEntries | QDir::NoDotAndDotDot).entryList(); langs.replaceInStrings(QString(".qm"), QString()); @@ -269,7 +269,7 @@ void GeneralConfigWidget::loadConfiguration(void) wgt->blockSignals(true); key_attribs.push_back(ParsersAttributes::ID); - BaseConfigWidget::loadConfiguration(GlobalAttributes::GENERAL_CONF, config_params, key_attribs); + BaseConfigWidget::loadConfiguration(GlobalAttributes::GeneralConf, config_params, key_attribs); grid_size_spb->setValue((config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::GRID_SIZE]).toUInt()); oplist_size_spb->setValue((config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]).toUInt()); @@ -451,20 +451,20 @@ void GeneralConfigWidget::saveConfiguration(void) QString file_sch, root_dir, widget_sch; bool show_grid=false, show_delim=false, align_grid=false; - root_dir=GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR; + root_dir=GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator; file_sch=root_dir + - GlobalAttributes::SCHEMAS_DIR + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::SchemasDir + + GlobalAttributes::DirSeparator + ParsersAttributes::_FILE_ + - GlobalAttributes::SCHEMA_EXT; + GlobalAttributes::SchemaExt; widget_sch=root_dir + - GlobalAttributes::SCHEMAS_DIR + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::SchemasDir + + GlobalAttributes::DirSeparator + ParsersAttributes::WIDGET + - GlobalAttributes::SCHEMA_EXT; + GlobalAttributes::SchemaExt; config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::GRID_SIZE]=QString::number(grid_size_spb->value()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]=QString::number(oplist_size_spb->value()); @@ -581,7 +581,7 @@ void GeneralConfigWidget::saveConfiguration(void) } } - BaseConfigWidget::saveConfiguration(GlobalAttributes::GENERAL_CONF, config_params); + BaseConfigWidget::saveConfiguration(GlobalAttributes::GeneralConf, config_params); } catch(Exception &e) { @@ -645,10 +645,10 @@ void GeneralConfigWidget::restoreDefaults(void) { try { - BaseConfigWidget::restoreDefaults(GlobalAttributes::GENERAL_CONF, false); - BaseConfigWidget::restoreDefaults(GlobalAttributes::XML_HIGHLIGHT_CONF, true); - BaseConfigWidget::restoreDefaults(GlobalAttributes::SQL_HIGHLIGHT_CONF, true); - BaseConfigWidget::restoreDefaults(GlobalAttributes::UI_STYLE_CONF, true); + BaseConfigWidget::restoreDefaults(GlobalAttributes::GeneralConf, false); + BaseConfigWidget::restoreDefaults(GlobalAttributes::XMLHighlightConf, true); + BaseConfigWidget::restoreDefaults(GlobalAttributes::SQLHighlightConf, true); + BaseConfigWidget::restoreDefaults(GlobalAttributes::UiStyleConf, true); this->loadConfiguration(); this->applyConfiguration(); setConfigurationChanged(true); diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index 4d888cd892..f8492057c7 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -54,7 +54,7 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg static map config_params; - static const unsigned UNIT_MILIMETERS=0, + static constexpr unsigned UNIT_MILIMETERS=0, UNIT_POINT=1, UNIT_INCHS=2, UNIT_CENTIMETERS=3; diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index e68af13bbb..1889d7eae8 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -25,7 +25,7 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, OB definition_txt = PgModelerUiNS::createNumberedTextEditor(sqlcode_grp, true); definition_hl = new SyntaxHighlighter(definition_txt); - definition_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + definition_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); definition_cp=new CodeCompletionWidget(definition_txt, true); diff --git a/libpgmodeler_ui/src/hinttextwidget.cpp b/libpgmodeler_ui/src/hinttextwidget.cpp index 75682a8f6b..a827afc2a4 100644 --- a/libpgmodeler_ui/src/hinttextwidget.cpp +++ b/libpgmodeler_ui/src/hinttextwidget.cpp @@ -24,7 +24,7 @@ HintTextWidget::HintTextWidget(QWidget *btn_parent, QWidget *parent): QWidget(parent) { if(!btn_parent) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); QHBoxLayout *layout=new QHBoxLayout(btn_parent); QGraphicsDropShadowEffect *shadow=nullptr; diff --git a/libpgmodeler_ui/src/hinttextwidget.h b/libpgmodeler_ui/src/hinttextwidget.h index 0bdd09e51e..e0921d138e 100644 --- a/libpgmodeler_ui/src/hinttextwidget.h +++ b/libpgmodeler_ui/src/hinttextwidget.h @@ -44,7 +44,7 @@ class HintTextWidget: public QWidget, public Ui::HintTextWidget { void showEvent(QShowEvent *); public: - const static unsigned SMALL_ICON=16, + static constexpr unsigned SMALL_ICON=16, MEDIUM_ICON=24, LARGE_ICON=32; diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index 4399296753..aa1f0d8b7f 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -31,7 +31,7 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_INDEX) Ui_IndexWidget::setupUi(this); predicate_hl=new SyntaxHighlighter(predicate_txt, false, true); - predicate_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + predicate_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); elements_tab = new ElementsTableWidget(this); @@ -45,8 +45,8 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_INDEX) IndexingType::getTypes(list); indexing_cmb->addItems(list); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_92)].push_back(buffering_chk); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion92)].push_back(buffering_chk); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); @@ -96,7 +96,7 @@ void IndexWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Ba vector idx_elems; if(!parent_obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, index, parent_obj); diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index eb8ffb76b6..5634b15d51 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -27,7 +27,7 @@ QColor LineNumbersWidget::bg_color=Qt::black; LineNumbersWidget::LineNumbersWidget(QPlainTextEdit * parent) : QWidget(parent) { if(!parent) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); parent_edt = qobject_cast(parent); first_line=line_count=start_sel_pos=0; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index bec2007006..d3e050ba3e 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -241,7 +241,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(action_compact_view, SIGNAL(toggled(bool)), this, SLOT(toggleCompactView())); - window_title=this->windowTitle() + QString(" ") + GlobalAttributes::PGMODELER_VERSION; + window_title=this->windowTitle() + QString(" ") + GlobalAttributes::PgModelerVersion; #ifdef DEMO_VERSION window_title+=trUtf8(" (Demo)"); @@ -571,7 +571,7 @@ void MainWindow::fixModel(const QString &filename) { QFileInfo fi(filename); model_fix_form.input_file_edt->setText(fi.absoluteFilePath()); - model_fix_form.output_file_edt->setText(fi.absolutePath() + GlobalAttributes::DIR_SEPARATOR + fi.baseName() + QString("_fixed.") + fi.suffix()); + model_fix_form.output_file_edt->setText(fi.absolutePath() + GlobalAttributes::DirSeparator + fi.baseName() + QString("_fixed.") + fi.suffix()); } PgModelerUiNS::resizeDialog(&model_fix_form); @@ -710,7 +710,7 @@ void MainWindow::closeEvent(QCloseEvent *event) restoration_form->removeTemporaryModels(); //Remove import log files - QDir dir(GlobalAttributes::TEMPORARY_DIR); + QDir dir(GlobalAttributes::TemporaryDir); QStringList log_files; dir.setNameFilters({QString("*.log")}); @@ -953,9 +953,9 @@ void MainWindow::addModel(ModelWidget *model_wgt) try { if(!model_wgt) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(model_wgt->parent()) - throw Exception(ERR_ASG_WGT_ALREADY_HAS_PARENT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgWidgetAlreadyHasParent,__PRETTY_FUNCTION__,__FILE__,__LINE__); model_nav_wgt->addModel(model_wgt); @@ -983,7 +983,7 @@ int MainWindow::getModelCount(void) ModelWidget *MainWindow::getModel(int idx) { if(idx < 0 || idx > models_tbw->count()) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(models_tbw->widget(idx))); } @@ -1637,8 +1637,8 @@ void MainWindow::showFixMessage(Exception &e, const QString &filename) { Messagebox msg_box; - msg_box.show(Exception(Exception::getErrorMessage(ERR_MODEL_FILE_NOT_LOADED).arg(filename), - ERR_MODEL_FILE_NOT_LOADED ,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e), + msg_box.show(Exception(Exception::getErrorMessage(ModelFileNotLoaded).arg(filename), + ModelFileNotLoaded ,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e), trUtf8("Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again.").arg(filename), Messagebox::ERROR_ICON, Messagebox::YES_NO_BUTTONS, trUtf8("Fix model"), trUtf8("Cancel"), QString(), @@ -1729,7 +1729,7 @@ void MainWindow::showOverview(bool show) void MainWindow::openSupport(void) { - QDesktopServices::openUrl(QUrl(GlobalAttributes::PGMODELER_SUPPORT)); + QDesktopServices::openUrl(QUrl(GlobalAttributes::PgModelerSupport)); } void MainWindow::toggleUpdateNotifier(bool show) @@ -1803,7 +1803,7 @@ QGraphicsDropShadowEffect *MainWindow::createDropShadow(QToolButton *btn) void MainWindow::configureSamplesMenu(void) { - QDir dir(GlobalAttributes::SAMPLES_DIR); + QDir dir(GlobalAttributes::SamplesDir); QStringList files=dir.entryList({QString("*.dbm")}); QAction *act=nullptr; QString path; @@ -1811,7 +1811,7 @@ void MainWindow::configureSamplesMenu(void) while(!files.isEmpty()) { act=sample_mdls_menu.addAction(files.front(),this,SLOT(loadModelFromAction(void))); - path=QFileInfo(GlobalAttributes::SAMPLES_DIR + GlobalAttributes::DIR_SEPARATOR + files.front()).absoluteFilePath(); + path=QFileInfo(GlobalAttributes::SamplesDir + GlobalAttributes::DirSeparator + files.front()).absoluteFilePath(); act->setToolTip(path); act->setData(path); files.pop_front(); @@ -1890,7 +1890,7 @@ void MainWindow::showDemoVersionWarning(void) trUtf8("You're running a demonstration version! Note that you'll be able to create only %1 instances \ of each type of object and some key features will be disabled or limited!

You can purchase a full binary copy or get the source code at https://pgmodeler.io.\ NOTE: pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and keep the development alive and at full speed!

\ - HINT: in order to test all features it's recommended to use the demo.dbm model located in Sample models at Welcome view.



").arg(GlobalAttributes::MAX_OBJECT_COUNT), + HINT: in order to test all features it's recommended to use the demo.dbm model located in Sample models at Welcome view.



").arg(GlobalAttributes::MaxObjectCount), Messagebox::ALERT_ICON, Messagebox::OK_BUTTON); #endif } diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 6336fcb17c..d3187ce847 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -56,18 +56,18 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { Q_OBJECT //! \brief Maximum number of files listed on recent models menu - const static int MAX_RECENT_MODELS=15; + static constexpr int MAX_RECENT_MODELS=15; - const static int GENERAL_ACTIONS_COUNT=8; + static constexpr int GENERAL_ACTIONS_COUNT=8; - const static int WELCOME_VIEW=0, + static constexpr int WELCOME_VIEW=0, DESIGN_VIEW=1, MANAGE_VIEW=2; static bool confirm_validation; //! \brief Constants used to mark a pending operation to be executed after validate model - const static unsigned NO_PENDING_OPER=0, + static constexpr unsigned NO_PENDING_OPER=0, PENDING_SAVE_OPER=1, PENDING_SAVE_AS_OPER=2, PENDING_EXPORT_OPER=3, diff --git a/libpgmodeler_ui/src/messagebox.h b/libpgmodeler_ui/src/messagebox.h index 69228e1c36..c97add8176 100644 --- a/libpgmodeler_ui/src/messagebox.h +++ b/libpgmodeler_ui/src/messagebox.h @@ -36,14 +36,14 @@ class Messagebox: public QDialog, public Ui::Messagebox { public: //! \brief Constants used to define the message icon - static const unsigned NO_ICON=10, + static constexpr unsigned NO_ICON=10, ERROR_ICON=11, INFO_ICON=12, ALERT_ICON=13, CONFIRM_ICON=14; //! \brief Constants used to configure the visible buttons - static const unsigned YES_NO_BUTTONS=0, + static constexpr unsigned YES_NO_BUTTONS=0, OK_CANCEL_BUTTONS=1, OK_BUTTON=2, ALL_BUTTONS=3; diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index e462cff642..3a23fc8559 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -152,7 +152,7 @@ void MetadataHandlingForm::handleObjectsMetada(void) if(!backup_file_edt->text().isEmpty() && backup_file_edt->text() == model_wgt->getFilename()) throw Exception(trUtf8("The backup file cannot be the same as the input model!"), - ERR_CUSTOM, __PRETTY_FUNCTION__,__FILE__,__LINE__); + Custom, __PRETTY_FUNCTION__,__FILE__,__LINE__); QTemporaryFile tmp_file; QString metadata_file; @@ -190,8 +190,8 @@ void MetadataHandlingForm::handleObjectsMetada(void) else { //Configuring the temporary metadata file - tmp_file.setFileTemplate(GlobalAttributes::TEMPORARY_DIR + - GlobalAttributes::DIR_SEPARATOR + + tmp_file.setFileTemplate(GlobalAttributes::TemporaryDir + + GlobalAttributes::DirSeparator + QString("%1_metadata_XXXXXX.%2").arg(extract_model->getName()).arg(QString("omf"))); tmp_file.open(); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index fa395531a9..6d5f23c08c 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -98,9 +98,9 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) ignore_error_codes_ht->setText(ignore_error_codes_chk->statusTip()); sqlcode_hl=new SyntaxHighlighter(sqlcode_txt); - sqlcode_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + sqlcode_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - pgsql_ver_cmb->addItems(PgSQLVersions::ALL_VERSIONS); + pgsql_ver_cmb->addItems(PgSQLVersions::AllVersions); PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); @@ -430,7 +430,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) try { if(thread_id != SRC_IMPORT_THREAD && thread_id != IMPORT_THREAD) - throw Exception(ERR_ALOC_OBJECT_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AllocationObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); createThread(thread_id); @@ -621,8 +621,8 @@ void ModelDatabaseDiffForm::saveDiffToFile(void) output.setFileName(file_edt->text()); if(!output.open(QFile::WriteOnly)) - captureThreadError(Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(file_edt->text()), - ERR_FILE_DIR_NOT_WRITTEN, __PRETTY_FUNCTION__,__FILE__,__LINE__)); + captureThreadError(Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(file_edt->text()), + FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__)); output.write(sqlcode_txt->toPlainText().toUtf8()); output.close(); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index 0094bad297..18a4580e73 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -110,7 +110,7 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { void finishDiff(void); //! \brief Constants used to reference the thread/helper to be handled in createThread() and destroyThread() - static const unsigned SRC_IMPORT_THREAD=0, + static constexpr unsigned SRC_IMPORT_THREAD=0, IMPORT_THREAD=1, DIFF_THREAD=2, EXPORT_THREAD=3; diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index 1442cc6b0f..583e4c100d 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -93,8 +93,8 @@ ModelExportForm::ModelExportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(p connect(svg_rb, SIGNAL(toggled(bool)), page_by_page_chk, SLOT(setDisabled(bool))); connect(ignore_error_codes_chk, SIGNAL(toggled(bool)), error_codes_edt, SLOT(setEnabled(bool))); - pgsqlvers_cmb->addItems(PgSQLVersions::ALL_VERSIONS); - pgsqlvers1_cmb->addItems(PgSQLVersions::ALL_VERSIONS); + pgsqlvers_cmb->addItems(PgSQLVersions::AllVersions); + pgsqlvers1_cmb->addItems(PgSQLVersions::AllVersions); double values[]={ ModelWidget::MINIMUM_ZOOM, 0.10f, 0.25f, 0.5f, 0.75f, 1, 1.25f, 1.50f, 1.75f, 2, 2.25, 2.50, 2.75, 3, 3.25, 3.50, 3.75, ModelWidget::MAXIMUM_ZOOM }; diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 6953a39dbb..63fd7e94ef 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -62,7 +62,7 @@ void ModelExportHelper::setIgnoredErrors(const QStringList &err_codes) void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &filename, const QString &pgsql_ver) { if(!db_model) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); connect(db_model, SIGNAL(s_objectLoaded(int,QString,uint)), this, SLOT(updateProgress(int,QString,uint))); @@ -91,7 +91,7 @@ void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &file void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename, double zoom, bool show_grid, bool show_delim, bool page_by_page, QGraphicsView *viewp) { if(!scene) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -146,7 +146,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename pages=scene->getPagesForPrinting(page_sz, margins.size(), h_cnt, v_cnt); //Configures the template filename for pages pixmaps - tmpl_filename=fi.absolutePath() + GlobalAttributes::DIR_SEPARATOR + fi.baseName() + QString("_p%1.") + fi.completeSuffix(); + tmpl_filename=fi.absolutePath() + GlobalAttributes::DirSeparator + fi.baseName() + QString("_p%1.") + fi.completeSuffix(); } else { @@ -214,8 +214,8 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename ObjectsScene::setGridOptions(shw_grd, align_objs, shw_dlm); scene->update(); - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(file), - ERR_FILE_DIR_NOT_WRITTEN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(file), + FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -243,7 +243,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename, bool show_grid, bool show_delim) { if(!scene) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); bool shw_dlm=false, shw_grd=false, align_objs=false; QSvgGenerator svg_gen; @@ -273,8 +273,8 @@ void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename scene->update(); if(!fi.exists() || !fi.isWritable() || !fi.isReadable()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(filename), - ERR_FILE_DIR_NOT_WRITTEN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), + FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); QFile svg_file; svg_file.setFileName(filename); @@ -322,15 +322,15 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c try { if(!db_model) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* If the export is called using ignore duplications or drop database and simulation mode at same time an error is raised because the simulate mode (mainly used as SQL validation) cannot undo column addition (this can be changed in the future) */ if(simulate && (ignore_dup || drop_db || drop_objs)) - throw Exception(ERR_MIX_INCOMP_EXPORT_OPTS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(MixingIncompExportOptions,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(drop_db && drop_objs) - throw Exception(ERR_MIX_INCOMP_DROP_OPTS,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(MixingIncompDropOptions,__PRETTY_FUNCTION__,__FILE__,__LINE__); connect(db_model, SIGNAL(s_objectLoaded(int,QString,uint)), this, SLOT(updateProgress(int,QString,uint)), Qt::DirectConnection); @@ -364,7 +364,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c generateTempObjectNames(db_model); } else if(use_tmp_names) - throw Exception(ERR_INV_USE_TMPNAMES_EXPORT_OPT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvUsageTempNamesExportOption,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(simulate && db_model->isSQLDisabled()) diff --git a/libpgmodeler_ui/src/modelfixform.cpp b/libpgmodeler_ui/src/modelfixform.cpp index 227188a84b..e573a67226 100644 --- a/libpgmodeler_ui/src/modelfixform.cpp +++ b/libpgmodeler_ui/src/modelfixform.cpp @@ -72,7 +72,7 @@ void ModelFixForm::hideEvent(QHideEvent *) int ModelFixForm::exec(void) { - QFileInfo fi(GlobalAttributes::PGMODELER_CLI_PATH); + QFileInfo fi(GlobalAttributes::PgModelerCLIPath); //Show an warning if the cli command doesn't exists if(!fi.exists()) @@ -85,7 +85,7 @@ int ModelFixForm::exec(void) sel_cli_exe_tb->setVisible(true); } else - pgmodeler_cli_edt->setText(GlobalAttributes::PGMODELER_CLI_PATH); + pgmodeler_cli_edt->setText(GlobalAttributes::PgModelerCLIPath); return(QDialog::exec()); } diff --git a/libpgmodeler_ui/src/modelfixform.h b/libpgmodeler_ui/src/modelfixform.h index fe008ac2c6..c492617932 100644 --- a/libpgmodeler_ui/src/modelfixform.h +++ b/libpgmodeler_ui/src/modelfixform.h @@ -33,7 +33,7 @@ class ModelFixForm: public QDialog, public Ui::ModelFixForm { private: Q_OBJECT - const static QString PGMODELER_CLI; + static const QString PGMODELER_CLI; //! \brief Process used to execute pgmodeler-cli QProcess pgmodeler_cli_proc; diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 9986c4cd2f..a49400db91 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -223,7 +223,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr QString obj_name; if(!object) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=object->getObjectType(); tab_obj=dynamic_cast(object); diff --git a/libpgmodeler_ui/src/modelrestorationform.cpp b/libpgmodeler_ui/src/modelrestorationform.cpp index 2e434fe72e..c474b22c55 100644 --- a/libpgmodeler_ui/src/modelrestorationform.cpp +++ b/libpgmodeler_ui/src/modelrestorationform.cpp @@ -35,7 +35,7 @@ ModelRestorationForm::ModelRestorationForm(QWidget *parent, Qt::WindowFlags f) : QStringList ModelRestorationForm::getTemporaryModels(void) { //Returns if there is some .dbm file on the tmp dir - return(QDir(GlobalAttributes::TEMPORARY_DIR, QString("*.dbm"), QDir::Name, QDir::Files | QDir::NoDotAndDotDot).entryList()); + return(QDir(GlobalAttributes::TemporaryDir, QString("*.dbm"), QDir::Name, QDir::Files | QDir::NoDotAndDotDot).entryList()); } int ModelRestorationForm::exec(void) @@ -51,8 +51,8 @@ int ModelRestorationForm::exec(void) while(!file_list.isEmpty()) { - info.setFile(GlobalAttributes::TEMPORARY_DIR, file_list.front()); - filename=GlobalAttributes::TEMPORARY_DIR + GlobalAttributes::DIR_SEPARATOR + file_list.front(); + info.setFile(GlobalAttributes::TemporaryDir, file_list.front()); + filename=GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + file_list.front(); input.setFileName(filename); input.open(QFile::ReadOnly); @@ -105,7 +105,7 @@ void ModelRestorationForm::removeTemporaryModels(void) while(!file_list.isEmpty()) { - tmp_file.remove(GlobalAttributes::TEMPORARY_DIR + GlobalAttributes::DIR_SEPARATOR + file_list.front()); + tmp_file.remove(GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + file_list.front()); file_list.pop_front(); } } @@ -114,7 +114,7 @@ void ModelRestorationForm::removeTemporaryModel(const QString &tmp_model) { QDir tmp_file; QString file=QFileInfo(tmp_model).fileName(); - tmp_file.remove(GlobalAttributes::TEMPORARY_DIR + GlobalAttributes::DIR_SEPARATOR + file); + tmp_file.remove(GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + file); } void ModelRestorationForm::enableRestoration(void) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index d5a617134a..cc2469406b 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -23,7 +23,7 @@ ModelsDiffHelper::ModelsDiffHelper(void) { diff_canceled=false; - pgsql_version=PgSQLVersions::DEFAULT_VERSION; + pgsql_version=PgSQLVersions::DefaulVersion; source_model=imported_model=nullptr; resetDiffCounter(); @@ -47,7 +47,7 @@ ModelsDiffHelper::~ModelsDiffHelper(void) void ModelsDiffHelper::setDiffOption(unsigned opt_id, bool value) { if(opt_id > OPT_DROP_MISSING_COLS_CONSTR) - throw Exception(ERR_REF_ELEM_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opt_id == OPT_DROP_MISSING_COLS_CONSTR) diff_opts[opt_id]=value & !diff_opts[OPT_DROP_MISSING_COLS_CONSTR]; @@ -82,7 +82,7 @@ void ModelsDiffHelper::setModels(DatabaseModel *src_model, DatabaseModel *imp_mo unsigned ModelsDiffHelper::getDiffTypeCount(unsigned diff_type) { if(diff_type >= ObjectsDiffInfo::NO_DIFFERENCE) - throw Exception(ERR_REF_ELEM_INV_INDEX ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(diffs_counter[diff_type]); } @@ -92,7 +92,7 @@ void ModelsDiffHelper::diffModels(void) try { if(!source_model || !imported_model) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); //First, we need to detect the objects to be dropped diffModels(ObjectsDiffInfo::DROP_OBJECT); @@ -870,7 +870,7 @@ void ModelsDiffHelper::processDiffInfos(void) //Attributes used on the diff schema file attribs[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::_TRUE_; - attribs[ParsersAttributes::PGMODELER_VERSION]=GlobalAttributes::PGMODELER_VERSION; + attribs[ParsersAttributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; attribs[ParsersAttributes::DB_MODEL]=source_model->getName(); attribs[ParsersAttributes::DATABASE]=imported_model->getName(); attribs[ParsersAttributes::DATE]=QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); @@ -923,9 +923,9 @@ void ModelsDiffHelper::processDiffInfos(void) //Generating the whole diff buffer schparser.setPgSQLVersion(pgsql_version); - diff_def=schparser.getCodeDefinition(GlobalAttributes::SCHEMAS_ROOT_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::ALTER_SCHEMA_DIR + GlobalAttributes::DIR_SEPARATOR + - ParsersAttributes::DIFF + GlobalAttributes::SCHEMA_EXT, attribs); + diff_def=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + + ParsersAttributes::DIFF + GlobalAttributes::SchemaExt, attribs); } if(diff_def.isEmpty()) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.h b/libpgmodeler_ui/src/modelsdiffhelper.h index 8a0b2534de..e24e588057 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.h +++ b/libpgmodeler_ui/src/modelsdiffhelper.h @@ -99,7 +99,7 @@ class ModelsDiffHelper: public QObject { BaseObject *getRelNNTable(const QString &obj_name, DatabaseModel *model); public: - static const unsigned OPT_KEEP_CLUSTER_OBJS=0, + static constexpr unsigned OPT_KEEP_CLUSTER_OBJS=0, //! \brief Indicates if any DROP/TRUNCATE generated must be in cascade mode OPT_CASCADE_MODE=1, diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index cd0d404ee9..ef3d6ddab1 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -233,7 +233,7 @@ void ModelValidationHelper::redirectExportProgress(int prog, QString msg, Object void ModelValidationHelper::setValidationParams(DatabaseModel *model, Connection *conn, const QString &pgsql_ver, bool use_tmp_names) { if(!model) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); fix_mode=false; valid_canceled=false; @@ -259,7 +259,7 @@ bool ModelValidationHelper::isInFixMode() void ModelValidationHelper::validateModel(void) { if(!db_model) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 15f4faf45c..a95b444bd2 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -30,7 +30,7 @@ ModelValidationWidget::ModelValidationWidget(QWidget *parent): QWidget(parent) output_trw->setItemDelegateForColumn(0, htmlitem_del); version_cmb->addItem(trUtf8("Autodetect")); - version_cmb->addItems(PgSQLVersions::ALL_VERSIONS); + version_cmb->addItems(PgSQLVersions::AllVersions); options_frm->setVisible(false); curr_step=0; diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 4efeabfe20..915e7e9a7d 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -68,10 +68,10 @@ bool ModelWidget::simple_obj_creation=true; ModelWidget *ModelWidget::src_model=nullptr; float ModelWidget::min_object_opacity=0.10f; -const unsigned ModelWidget::BREAK_VERT_NINETY_DEGREES=0; -const unsigned ModelWidget::BREAK_HORIZ_NINETY_DEGREES=1; -const unsigned ModelWidget::BREAK_VERT_2NINETY_DEGREES=2; -const unsigned ModelWidget::BREAK_HORIZ_2NINETY_DEGREES=3; +constexpr unsigned ModelWidget::BREAK_VERT_NINETY_DEGREES; +constexpr unsigned ModelWidget::BREAK_HORIZ_NINETY_DEGREES; +constexpr unsigned ModelWidget::BREAK_VERT_2NINETY_DEGREES; +constexpr unsigned ModelWidget::BREAK_HORIZ_2NINETY_DEGREES; ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) { @@ -102,7 +102,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) QTemporaryFile tmp_file; //Configuring the template mask which includes the full path to temporary dir - tmp_file.setFileTemplate(GlobalAttributes::TEMPORARY_DIR + GlobalAttributes::DIR_SEPARATOR + QString("model_XXXXXX") + QString(".dbm")); + tmp_file.setFileTemplate(GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + QString("model_XXXXXX") + QString(".dbm")); tmp_file.open(); tmp_filename=tmp_file.fileName(); tmp_file.close(); @@ -1670,10 +1670,10 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb if(obj_type!=OBJ_PERMISSION) { if(object && obj_type!=object->getObjectType()) - throw Exception(ERR_OPR_OBJ_INV_TYPE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the user try to call the table object form without specify a parent object else if(!parent_obj && TableObject::isTableObject(obj_type)) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(object && dynamic_cast(object)) @@ -1683,9 +1683,9 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb that can be edited only on its fill color an rectangle attributes */ if(object && object->isSystemObject() && (object->getObjectType()!=OBJ_SCHEMA || object->getName()!="public")) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(object->getName()).arg(object->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(obj_type==OBJ_SCHEMA) res=openEditingForm(object); @@ -1869,9 +1869,9 @@ void ModelWidget::renameObject(void) BaseObject *obj=reinterpret_cast(act->data().value()); if(obj->isSystemObject()) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(obj->getName()).arg(obj->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); ObjectRenameWidget objectrename_wgt(this); objectrename_wgt.setAttributes(obj, this->db_model, this->op_list); @@ -1970,10 +1970,10 @@ void ModelWidget::changeOwner(void) if(obj->acceptsOwner() && obj->getOwner()!=owner) { if(obj->isSystemObject()) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(obj->getName()) .arg(obj->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Register an operation only if the object is not the database itself if(obj->getObjectType()!=OBJ_DATABASE) @@ -2178,9 +2178,9 @@ void ModelWidget::protectObject(void) if(tab_obj->isAddedByRelationship()) { - throw Exception(QString(Exception::getErrorMessage(ERR_OPR_REL_INCL_OBJECT)) + throw Exception(QString(Exception::getErrorMessage(OprRelationshipAddedObject)) .arg(object->getName()).arg(object->getTypeName()), - ERR_OPR_REL_INCL_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprRelationshipAddedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -2230,9 +2230,9 @@ void ModelWidget::copyObjects(bool duplicate_mode) { //Raise an error if the user try to copy a reserved object if(selected_objects[0]->isSystemObject()) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(selected_objects[0]->getName()).arg(selected_objects[0]->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(!duplicate_mode) @@ -2635,7 +2635,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) if(!errors.empty()) { Messagebox msg_box; - msg_box.show(Exception(trUtf8("Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors), + msg_box.show(Exception(trUtf8("Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors), QString(), Messagebox::ALERT_ICON); } @@ -2902,16 +2902,16 @@ void ModelWidget::removeObjects(bool cascade) //Raises an error if the user try to remove a reserved object if(object->isSystemObject()) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(object->getName()).arg(object->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the user try to remove a protected object else if(object->isProtected()) { - throw Exception(QString(Exception::getErrorMessage(ERR_REM_PROTECTED_OBJECT)) + throw Exception(QString(Exception::getErrorMessage(RemProtectedObject)) .arg(object->getName(true)) .arg(object->getTypeName()), - ERR_REM_PROTECTED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -2948,11 +2948,11 @@ void ModelWidget::removeObjects(bool cascade) } catch(Exception &e) { - if(cascade && (e.getErrorType()==ERR_INVALIDATED_OBJECTS || - e.getErrorType()==ERR_REM_DIRECT_REFERENCE || - e.getErrorType()==ERR_REM_INDIRECT_REFERENCE || - e.getErrorType()==ERR_REM_PROTECTED_OBJECT || - e.getErrorType()==ERR_OPR_RESERVED_OBJECT)) + if(cascade && (e.getErrorType()==RemInvalidatedObjects || + e.getErrorType()==RemDirectReference || + e.getErrorType()==RemInderectReference || + e.getErrorType()==RemProtectedObject || + e.getErrorType()==OprReservedObject)) errors.push_back(e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); @@ -2978,11 +2978,11 @@ void ModelWidget::removeObjects(bool cascade) } catch(Exception &e) { - if(cascade && (e.getErrorType()==ERR_INVALIDATED_OBJECTS || - e.getErrorType()==ERR_REM_DIRECT_REFERENCE || - e.getErrorType()==ERR_REM_INDIRECT_REFERENCE || - e.getErrorType()==ERR_REM_PROTECTED_OBJECT || - e.getErrorType()==ERR_OPR_RESERVED_OBJECT)) + if(cascade && (e.getErrorType()==RemInvalidatedObjects || + e.getErrorType()==RemDirectReference || + e.getErrorType()==RemInderectReference || + e.getErrorType()==RemProtectedObject || + e.getErrorType()==OprReservedObject)) errors.push_back(e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); @@ -3009,7 +3009,7 @@ void ModelWidget::removeObjects(bool cascade) if(!errors.empty()) { - msg_box.show(Exception(ERR_INVALIDATED_OBJECTS, __PRETTY_FUNCTION__,__FILE__,__LINE__, errors), + msg_box.show(Exception(RemInvalidatedObjects, __PRETTY_FUNCTION__,__FILE__,__LINE__, errors), trUtf8("The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details."), Messagebox::ALERT_ICON); } @@ -4131,8 +4131,8 @@ void ModelWidget::convertIntegerToSerial(void) QString serial_tp; if(!col_type.isIntegerType() || (!col->getDefaultValue().contains(regexp) && !col->getSequence())) - throw Exception(Exception::getErrorMessage(ERR_INV_CONV_INTEGER_TO_SERIAL).arg(col->getName()), - ERR_INV_CONV_INTEGER_TO_SERIAL ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvConversionIntegerToSerial).arg(col->getName()), + InvConversionIntegerToSerial ,__PRETTY_FUNCTION__,__FILE__,__LINE__); op_list->registerObject(col, Operation::OBJECT_MODIFIED, -1, tab); diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index d55018242a..f97255ee63 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -194,10 +194,10 @@ class ModelWidget: public QWidget { void showMagnifierArea(bool show); protected: - static const unsigned BREAK_VERT_NINETY_DEGREES, //Break vertically the line in one 90° angle - BREAK_HORIZ_NINETY_DEGREES, //Break horizontally the line in one 90° angle - BREAK_VERT_2NINETY_DEGREES, //Break vertically the line in two 90° angles - BREAK_HORIZ_2NINETY_DEGREES;//Break horizontally the line in two 90° angles + static constexpr unsigned BREAK_VERT_NINETY_DEGREES=0, //Break vertically the line in one 90° angle + BREAK_HORIZ_NINETY_DEGREES=1, //Break horizontally the line in one 90° angle + BREAK_VERT_2NINETY_DEGREES=2, //Break vertically the line in two 90° angles + BREAK_HORIZ_2NINETY_DEGREES=3;//Break horizontally the line in two 90° angles QAction *action_source_code, *action_edit, diff --git a/libpgmodeler_ui/src/numberedtexteditor.cpp b/libpgmodeler_ui/src/numberedtexteditor.cpp index 56fec138ce..a8430aae1b 100644 --- a/libpgmodeler_ui/src/numberedtexteditor.cpp +++ b/libpgmodeler_ui/src/numberedtexteditor.cpp @@ -342,9 +342,9 @@ void NumberedTextEditor::loadFile(void) file.setFileName(sql_file_dlg.selectedFiles().at(0)); if(!file.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED) + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) .arg(sql_file_dlg.selectedFiles().at(0)) - ,ERR_FILE_DIR_NOT_ACCESSED ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ,FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->clear(); this->setPlainText(file.readAll()); @@ -360,15 +360,15 @@ void NumberedTextEditor::editSource(void) QByteArray buffer; QFile input; - tmp_src_file.setFileTemplate(GlobalAttributes::TEMPORARY_DIR + GlobalAttributes::DIR_SEPARATOR + QString("source_XXXXXX") + QString(".sql")); + tmp_src_file.setFileTemplate(GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + QString("source_XXXXXX") + QString(".sql")); tmp_src_file.open(); tmp_src_file.close(); input.setFileName(tmp_src_file.fileName()); if(!input.open(QFile::WriteOnly | QFile::Truncate)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED) + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) .arg(tmp_src_file.fileName()) - ,ERR_FILE_DIR_NOT_ACCESSED ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ,FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); buffer.append(this->toPlainText()); input.write(buffer); @@ -403,9 +403,9 @@ void NumberedTextEditor::updateSource(void) this->setReadOnly(false); if(!input.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED) + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) .arg(tmp_src_file.fileName()) - ,ERR_FILE_DIR_NOT_ACCESSED ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ,FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setPlainText(input.readAll()); input.close(); diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index 01e834b5a0..ab410b6610 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -54,7 +54,7 @@ void ObjectDepsRefsWidget::setAttributes(DatabaseModel *model, BaseObject *objec void ObjectDepsRefsWidget::setAttributes(ModelWidget *model_wgt, BaseObject *object, BaseObject *parent_obj) { if(!model_wgt) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->model_wgt=model_wgt; setAttributes(model_wgt->getDatabaseModel(), object, parent_obj); diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index ea92d20a6a..bddd60e33d 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -38,12 +38,12 @@ void ObjectRenameWidget::setAttributes(BaseObject *object, DatabaseModel *model, TableObject *tab_obj=dynamic_cast(object); if(!object || !op_list) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(tab_obj && tab_obj->isAddedByRelationship()) - throw Exception(Exception::getErrorMessage(ERR_OPR_REL_INCL_OBJECT) + throw Exception(Exception::getErrorMessage(OprRelationshipAddedObject) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - ,ERR_OPR_REL_INCL_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ,OprRelationshipAddedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->adjustSize(); this->object=object; @@ -119,12 +119,12 @@ void ObjectRenameWidget::applyRenaming(void) //Raises a error if another object is found if(aux_obj && aux_obj!=object) { - throw Exception(QString(Exception::getErrorMessage(ERR_ASG_DUPLIC_OBJECT)) + throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(fmt_name) .arg(object->getTypeName()) .arg(parent_obj->getName(true)) .arg(parent_obj->getTypeName()), - ERR_ASG_DUPLIC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler_ui/src/objectsdiffinfo.cpp b/libpgmodeler_ui/src/objectsdiffinfo.cpp index d27beaf9fd..54d253c147 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.cpp +++ b/libpgmodeler_ui/src/objectsdiffinfo.cpp @@ -18,11 +18,11 @@ #include "objectsdiffinfo.h" -const unsigned ObjectsDiffInfo::CREATE_OBJECT=0; -const unsigned ObjectsDiffInfo::DROP_OBJECT=1; -const unsigned ObjectsDiffInfo::ALTER_OBJECT=2; -const unsigned ObjectsDiffInfo::IGNORE_OBJECT=3; -const unsigned ObjectsDiffInfo::NO_DIFFERENCE=4; +constexpr unsigned ObjectsDiffInfo::CREATE_OBJECT; +constexpr unsigned ObjectsDiffInfo::DROP_OBJECT; +constexpr unsigned ObjectsDiffInfo::ALTER_OBJECT; +constexpr unsigned ObjectsDiffInfo::IGNORE_OBJECT; +constexpr unsigned ObjectsDiffInfo::NO_DIFFERENCE; ObjectsDiffInfo::ObjectsDiffInfo(void) { diff --git a/libpgmodeler_ui/src/objectsdiffinfo.h b/libpgmodeler_ui/src/objectsdiffinfo.h index 1e28a13ea0..2452a62a5c 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.h +++ b/libpgmodeler_ui/src/objectsdiffinfo.h @@ -36,11 +36,11 @@ class ObjectsDiffInfo { BaseObject *object, *old_object; public: - static const unsigned CREATE_OBJECT, - DROP_OBJECT, - ALTER_OBJECT, - IGNORE_OBJECT, - NO_DIFFERENCE; + static constexpr unsigned CREATE_OBJECT=0, + DROP_OBJECT=1, + ALTER_OBJECT=2, + IGNORE_OBJECT=3, + NO_DIFFERENCE=4; ObjectsDiffInfo(void); ObjectsDiffInfo(unsigned diff_type, BaseObject *ref_object, BaseObject *old_object); diff --git a/libpgmodeler_ui/src/objectselectorwidget.cpp b/libpgmodeler_ui/src/objectselectorwidget.cpp index 1d40df1184..d6a394d762 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.cpp +++ b/libpgmodeler_ui/src/objectselectorwidget.cpp @@ -58,7 +58,7 @@ void ObjectSelectorWidget::configureSelector(bool install_highlighter) if(install_highlighter) { obj_name_hl=new SyntaxHighlighter(obj_name_txt, true); - obj_name_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + obj_name_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); } else { diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 986c558db6..996291c2c8 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -101,10 +101,10 @@ void ObjectsTableWidget::setButtonConfiguration(unsigned button_conf) QTableWidgetItem *ObjectsTableWidget::getItem(unsigned row_idx, unsigned col_idx) { if(row_idx >= static_cast(table_tbw->rowCount())) - throw Exception(ERR_REF_LIN_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(ERR_REF_COL_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(table_tbw->item(row_idx, col_idx)); } @@ -139,7 +139,7 @@ void ObjectsTableWidget::setHeaderLabel(const QString &label, unsigned col_idx) QTableWidgetItem *item=nullptr; if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(ERR_REF_COL_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); item=table_tbw->horizontalHeaderItem(col_idx); item->setText(label); @@ -148,7 +148,7 @@ void ObjectsTableWidget::setHeaderLabel(const QString &label, unsigned col_idx) void ObjectsTableWidget::setHeaderVisible(unsigned col_idx, bool visible) { if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(ERR_REF_COL_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); table_tbw->horizontalHeader()->setSectionHidden(col_idx, !visible); } @@ -158,7 +158,7 @@ void ObjectsTableWidget::setHeaderIcon(const QIcon &icon, unsigned col_idx) QTableWidgetItem *item=nullptr; if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(ERR_REF_COL_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); item=table_tbw->horizontalHeaderItem(col_idx); item->setIcon(icon); @@ -192,7 +192,7 @@ void ObjectsTableWidget::setRowFont(int row_idx, const QFont &font, const QColor int col_count, i; if(row_idx >= table_tbw->rowCount()) - throw Exception(ERR_REF_LIN_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); col_count=table_tbw->columnCount(); for(i=0; i < col_count; i++) @@ -209,7 +209,7 @@ void ObjectsTableWidget::setRowData(const QVariant &data, unsigned row_idx) QTableWidgetItem *item=nullptr; if(row_idx >= static_cast(table_tbw->rowCount())) - throw Exception(ERR_REF_LIN_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Gets the vertical header of the row. This header stores the whole row data. item=table_tbw->verticalHeaderItem(row_idx); @@ -231,7 +231,7 @@ QString ObjectsTableWidget::getHeaderLabel(unsigned col_idx) QTableWidgetItem *item=nullptr; if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(ERR_REF_COL_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); item=table_tbw->horizontalHeaderItem(col_idx); return(item->text()); @@ -272,7 +272,7 @@ QVariant ObjectsTableWidget::getRowData(unsigned row_idx) QTableWidgetItem *item=nullptr; if(row_idx >= static_cast(table_tbw->rowCount())) - throw Exception(ERR_REF_LIN_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); item=table_tbw->verticalHeaderItem(row_idx); return(item->data(Qt::UserRole)); @@ -369,7 +369,7 @@ void ObjectsTableWidget::removeRow(unsigned row_idx) bool conf; if(row_idx >= static_cast(table_tbw->rowCount())) - throw Exception(ERR_REF_LIN_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Before remove the row, clears the selection table_tbw->clearSelection(); @@ -465,7 +465,7 @@ void ObjectsTableWidget::removeRows(void) void ObjectsTableWidget::removeColumn(unsigned col_idx) { if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(ERR_REF_COL_OBJTAB_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); table_tbw->removeColumn(col_idx); table_tbw->clearSelection(); diff --git a/libpgmodeler_ui/src/objectstablewidget.h b/libpgmodeler_ui/src/objectstablewidget.h index ab0bb4c6a0..a12ab917af 100644 --- a/libpgmodeler_ui/src/objectstablewidget.h +++ b/libpgmodeler_ui/src/objectstablewidget.h @@ -44,7 +44,7 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { public: //! \brief Constants used to configure the table buttons - static const unsigned ADD_BUTTON=1, + static constexpr unsigned ADD_BUTTON=1, REMOVE_BUTTON=2, UPDATE_BUTTON=4, MOVE_BUTTONS=8, diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 31a3733579..c2206beb46 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -169,7 +169,7 @@ void OperationListWidget::undoOperation(void) QApplication::restoreOverrideCursor(); this->updateOperationList(); - if(e.getErrorType()==ERR_UNDO_REDO_OPR_INV_OBJECT) + if(e.getErrorType()==UndoRedoOperationInvalidObject) { Messagebox msg_box; msg_box.show(e, "", Messagebox::ALERT_ICON); @@ -193,7 +193,7 @@ void OperationListWidget::redoOperation(void) { QApplication::restoreOverrideCursor(); - if(e.getErrorType()==ERR_UNDO_REDO_OPR_INV_OBJECT) + if(e.getErrorType()==UndoRedoOperationInvalidObject) { Messagebox msg_box; msg_box.show(e, "", Messagebox::ALERT_ICON); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 4c4404cba3..4f09729f69 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -62,7 +62,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare this->setLayout(grid); configureFormLayout(grid, OBJ_OPCLASS); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index 5276008693..ab0b88edf0 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -32,7 +32,7 @@ OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(pa indexing_cmb->addItems(types); setRequiredField(indexing_lbl); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); opfamily_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), opfamily_grid->count()+1, 0, 1, 0); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 59e6591a3b..1b05f4ff75 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -34,7 +34,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, OB Ui_PermissionWidget::setupUi(this); code_hl=new SyntaxHighlighter(code_txt); - code_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + code_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); object_selection_wgt=new ModelObjectsWidget(true); permission=nullptr; @@ -262,11 +262,11 @@ void PermissionWidget::showSelectedRoleData(void) //Raise an error if the role already exists on selected role table if(role && row_idx >= 0) { - throw Exception(Exception::getErrorMessage(ERR_ASG_DUPL_OBJ_CONTAINER) + throw Exception(Exception::getErrorMessage(AsgDuplicatedObjectContainer) .arg(role->getName()) .arg(role->getTypeName()) .arg(roles_gb->title()), - ERR_INS_DUPLIC_ROLE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -326,10 +326,10 @@ void PermissionWidget::updatePermission(void) else { //Raises an error if the configured permission already exists - throw Exception(Exception::getErrorMessage(ERR_ASG_DUPLIC_PERMISSION) + throw Exception(Exception::getErrorMessage(AsgDuplicatedPermission) .arg(permission->getObject()->getName()) .arg(permission->getObject()->getTypeName()), - ERR_ASG_DUPLIC_PERMISSION,__PRETTY_FUNCTION__,__FILE__,__LINE__); + AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); } delete(perm_bkp); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 036301a402..444cfa6866 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -27,7 +27,7 @@ namespace PgModelerUiNS { QTreeWidgetItem *createOutputTreeItem(QTreeWidget *output_trw, const QString &text, const QPixmap &ico, QTreeWidgetItem *parent, bool expand_item, bool word_wrap) { if(!output_trw) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); QTreeWidgetItem *item=nullptr; @@ -64,7 +64,7 @@ namespace PgModelerUiNS { void createOutputListItem(QListWidget *output_lst, const QString &text, const QPixmap &ico, bool is_formated) { if(!output_lst) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); QListWidgetItem *item=new QListWidgetItem; @@ -97,10 +97,10 @@ namespace PgModelerUiNS { bool curr_val=object->isSQLDisabled(); if(object->isSystemObject()) - throw Exception(Exception::getErrorMessage(ERR_OPR_RESERVED_OBJECT) + throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(object->getName(true)) .arg(object->getTypeName()), - ERR_OPR_RESERVED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); object->setSQLDisabled(disable); diff --git a/libpgmodeler_ui/src/pgmodeleruins.h b/libpgmodeler_ui/src/pgmodeleruins.h index d2d64cc4cf..3f90d70960 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.h +++ b/libpgmodeler_ui/src/pgmodeleruins.h @@ -33,7 +33,7 @@ #include "numberedtexteditor.h" namespace PgModelerUiNS { - static const unsigned SMALL_FONT_FACTOR = 0, + static constexpr unsigned SMALL_FONT_FACTOR = 0, MEDIUM_FONT_FACTOR = 1, BIG_FONT_FACTOR = 2, HUGE_FONT_FACTOR = 3; diff --git a/libpgmodeler_ui/src/pgsqltypewidget.cpp b/libpgmodeler_ui/src/pgsqltypewidget.cpp index 6bd122972f..657016b53d 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.cpp +++ b/libpgmodeler_ui/src/pgsqltypewidget.cpp @@ -35,7 +35,7 @@ PgSQLTypeWidget::PgSQLTypeWidget(QWidget *parent, const QString &label) : QWidge format_hl=nullptr; format_hl=new SyntaxHighlighter(format_txt, true); - format_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + format_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); this->adjustSize(); IntervalType::getTypes(interval_lst); @@ -213,7 +213,7 @@ void PgSQLTypeWidget::setAttributes(PgSQLType type, DatabaseModel *model, unsig PgSQLType PgSQLTypeWidget::getPgSQLType(void) { if(format_txt->toPlainText() == INVALID_TYPE) - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type); } diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.cpp b/libpgmodeler_ui/src/pluginsconfigwidget.cpp index 1288a10a5e..e480149414 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.cpp +++ b/libpgmodeler_ui/src/pluginsconfigwidget.cpp @@ -23,7 +23,7 @@ PluginsConfigWidget::PluginsConfigWidget(QWidget *parent) : BaseConfigWidget(par setupUi(this); QGridLayout *grid=new QGridLayout(loaded_plugins_gb); - QDir dir=QDir(GlobalAttributes::PLUGINS_DIR); + QDir dir=QDir(GlobalAttributes::PluginsDir); root_dir_edt->setText(dir.absolutePath()); @@ -65,8 +65,8 @@ void PluginsConfigWidget::loadConfiguration(void) { vector errors; QString lib, plugin_name, - dir_plugins=GlobalAttributes::PLUGINS_DIR + - GlobalAttributes::DIR_SEPARATOR; + dir_plugins=GlobalAttributes::PluginsDir + + GlobalAttributes::DirSeparator; QPluginLoader plugin_loader; QStringList dir_list; PgModelerPlugin *plugin=nullptr; @@ -99,7 +99,7 @@ void PluginsConfigWidget::loadConfiguration(void) QString("lib") + plugin_name + QString(".dylib"); #else lib=dir_plugins + plugin_name + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::DirSeparator + QString("lib") + plugin_name + QString(".so"); #endif #endif @@ -121,7 +121,7 @@ void PluginsConfigWidget::loadConfiguration(void) plugin_action->setShortcut(plugin->getPluginShortcut()); icon.load(dir_plugins + plugin_name + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::DirSeparator + plugin_name + QString(".png")); plugin_action->setIcon(icon); @@ -133,18 +133,18 @@ void PluginsConfigWidget::loadConfiguration(void) } else { - errors.push_back(Exception(Exception::getErrorMessage(ERR_PLUGIN_NOT_LOADED) + errors.push_back(Exception(Exception::getErrorMessage(PluginNotLoaded) .arg(dir_list.front()) .arg(lib) .arg(plugin_loader.errorString()), - ERR_PLUGIN_NOT_LOADED, __PRETTY_FUNCTION__,__FILE__,__LINE__)); + PluginNotLoaded, __PRETTY_FUNCTION__,__FILE__,__LINE__)); } dir_list.pop_front(); plugins_tab->clearSelection(); } if(!errors.empty()) - throw Exception(ERR_PLUGINS_NOT_LOADED,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors); + throw Exception(PluginsNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors); } void PluginsConfigWidget::installPluginsActions(QToolBar *toolbar, QMenu *menu, QObject *recv, const char *slot) diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index 6104b9a74b..94b1c3a0b7 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -30,12 +30,12 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_POLICY using_edt = PgModelerUiNS::createNumberedTextEditor(using_wgt); using_edt->setTabChangesFocus(true); using_hl = new SyntaxHighlighter(using_edt); - using_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + using_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); check_edt = PgModelerUiNS::createNumberedTextEditor(check_wgt); check_edt->setTabChangesFocus(true); check_hl = new SyntaxHighlighter(check_edt); - check_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + check_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); roles_tab = new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ (ObjectsTableWidget::DUPLICATE_BUTTON | @@ -74,7 +74,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_POLICY void PolicyWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Policy *policy) { if(!parent_obj) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, policy, parent_obj); model_objs_wgt->setModel(model); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 639953bd0d..7374297730 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -35,7 +35,7 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) expression_txt=new NumberedTextEditor(this, true); expression_hl=new SyntaxHighlighter(expression_txt, false, true); - expression_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + expression_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); ref_object_sel=new ObjectSelectorWidget({ OBJ_TABLE, OBJ_COLUMN }, true, this); ref_object_sel->enableObjectCreation(false); @@ -133,7 +133,7 @@ void ReferenceWidget::applyConfiguration(void) if(!select_from_chk->isChecked() && !from_where_chk->isChecked() && !after_where_chk->isChecked() && !end_expr_chk->isChecked() && !view_def_chk->isChecked()) - throw Exception(ERR_SQL_SCOPE_INV_VIEW_REF,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvSQLScopeViewReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); ref_flags = 0; diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index c649dd09eb..9ea1294ce6 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -39,10 +39,10 @@ RelationshipConfigWidget::RelationshipConfigWidget(QWidget * parent) : BaseConfi for(int i=0; i < pattern_fields.size(); i++) { pattern_hl=new SyntaxHighlighter(pattern_fields[i], true); - pattern_hl->loadConfiguration(GlobalAttributes::CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::PATTERN_HIGHLIGHT_CONF + - GlobalAttributes::CONFIGURATION_EXT); + pattern_hl->loadConfiguration(GlobalAttributes::ConfigurationsDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::PatternHighlightConf + + GlobalAttributes::ConfigurationExt); connect(pattern_fields[i], SIGNAL(textChanged()), this, SLOT(updatePattern())); } @@ -96,7 +96,7 @@ void RelationshipConfigWidget::loadConfiguration(void) { int idx; vector key_attribs={ParsersAttributes::TYPE}; - BaseConfigWidget::loadConfiguration(GlobalAttributes::RELATIONSHIPS_CONF, config_params, key_attribs); + BaseConfigWidget::loadConfiguration(GlobalAttributes::RelationshipsConf, config_params, key_attribs); fk_to_pk_rb->setChecked(config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]==ParsersAttributes::CONNECT_FK_TO_PK); center_pnts_rb->setChecked(config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]==ParsersAttributes::CONNECT_CENTER_PNTS); @@ -134,14 +134,14 @@ void RelationshipConfigWidget::saveConfiguration(void) { QString patterns_sch, root_dir; - root_dir=GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR; + root_dir=GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator; patterns_sch=root_dir + - GlobalAttributes::SCHEMAS_DIR + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::SchemasDir + + GlobalAttributes::DirSeparator + ParsersAttributes::PATTERNS + - GlobalAttributes::SCHEMA_EXT; + GlobalAttributes::SchemaExt; if(crows_foot_rb->isChecked()) @@ -168,7 +168,7 @@ void RelationshipConfigWidget::saveConfiguration(void) config_params[ParsersAttributes::NAME_PATTERNS][ParsersAttributes::PATTERNS]+=schparser.getCodeDefinition(patterns_sch, itr.second); } - BaseConfigWidget::saveConfiguration(GlobalAttributes::RELATIONSHIPS_CONF, config_params); + BaseConfigWidget::saveConfiguration(GlobalAttributes::RelationshipsConf, config_params); } catch(Exception &e) { @@ -195,7 +195,7 @@ void RelationshipConfigWidget::restoreDefaults(void) { try { - BaseConfigWidget::restoreDefaults(GlobalAttributes::RELATIONSHIPS_CONF, false); + BaseConfigWidget::restoreDefaults(GlobalAttributes::RelationshipsConf, false); this->loadConfiguration(); setConfigurationChanged(true); } diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 981c003926..6ad34aa29d 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -55,19 +55,19 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent table1_hl=nullptr; table1_hl=new SyntaxHighlighter(ref_table_txt, true); - table1_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + table1_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); table2_hl=nullptr; table2_hl=new SyntaxHighlighter(recv_table_txt, true); - table2_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + table2_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); for(int i=0; i < pattern_fields.size(); i++) { patterns_hl[i]=new SyntaxHighlighter(qobject_cast(pattern_fields[i]), true); - patterns_hl[i]->loadConfiguration(GlobalAttributes::CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::PATTERN_HIGHLIGHT_CONF + - GlobalAttributes::CONFIGURATION_EXT); + patterns_hl[i]->loadConfiguration(GlobalAttributes::ConfigurationsDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::PatternHighlightConf + + GlobalAttributes::ConfigurationExt); } attributes_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ @@ -163,7 +163,7 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent part_bound_expr_txt=new NumberedTextEditor(this, true); part_bound_expr_hl=new SyntaxHighlighter(part_bound_expr_txt); - part_bound_expr_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + part_bound_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); dynamic_cast(part_bound_expr_gb->layout())->addWidget(part_bound_expr_txt, 1, 0); connect(deferrable_chk, SIGNAL(toggled(bool)), deferral_cmb, SLOT(setEnabled(bool))); @@ -244,7 +244,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l bool rel1n=false, relnn=false, relgen_dep=false, use_name_patterns=false; if(!base_rel) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, base_rel); @@ -1172,7 +1172,7 @@ void RelationshipWidget::applyConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==ERR_INVALIDATED_OBJECTS) + if(e.getErrorType()==RemInvalidatedObjects) msg_box.show(e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); diff --git a/libpgmodeler_ui/src/relationshipwidget.h b/libpgmodeler_ui/src/relationshipwidget.h index 046f84c4a5..837d0b508c 100644 --- a/libpgmodeler_ui/src/relationshipwidget.h +++ b/libpgmodeler_ui/src/relationshipwidget.h @@ -35,7 +35,7 @@ class RelationshipWidget: public BaseObjectWidget, public Ui::RelationshipWidget private: Q_OBJECT - static const unsigned GENERAL_TAB=0, + static constexpr unsigned GENERAL_TAB=0, SETTINGS_TAB=1, ATTRIBUTES_TAB=2, CONSTRAINTS_TAB=3, diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index 2e4c40128d..88b5a1bf33 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -38,8 +38,8 @@ RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_ROLE) role_grid->addWidget(frame, role_grid->count()+1, 0, 1, 4); frame->setParent(this); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_91)].push_back(can_replicate_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(bypass_rls_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion91)].push_back(can_replicate_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(bypass_rls_chk); frame=generateVersionWarningFrame(fields_map); role_grid->addWidget(frame, role_grid->count()+1, 0, 1, 0); frame->setParent(this); @@ -143,7 +143,7 @@ void RoleWidget::showRoleData(Role *role, unsigned table_id, unsigned row) role_types[3]={ Role::REF_ROLE, Role::MEMBER_ROLE, Role::ADMIN_ROLE }; if(table_id > 3) - throw Exception(ERR_REF_OBJ_INV_INDEX,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); members_tab[table_id]->setRowData(QVariant::fromValue(reinterpret_cast(role)), row); members_tab[table_id]->setCellText(role->getName(), row, 0); @@ -219,10 +219,10 @@ void RoleWidget::showSelectedRoleData(void) if(!members_tab[idx_tab]->getRowData(lin).value()) members_tab[idx_tab]->removeRow(lin); - msg_box.show(Exception(Exception::getErrorMessage(ERR_ROLE_REF_REDUNDANCY) + msg_box.show(Exception(Exception::getErrorMessage(AsgRoleReferenceRedundancy) .arg(obj_sel->getName()) .arg(name_edt->text()), - ERR_ROLE_REF_REDUNDANCY,__PRETTY_FUNCTION__,__FILE__,__LINE__)); + AsgRoleReferenceRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__)); } //If the role does not exist on table, show its data else if(obj_sel && idx_lin < 0) @@ -237,10 +237,10 @@ void RoleWidget::showSelectedRoleData(void) //Raises an error if the role already is in the table if(obj_sel && idx_lin >= 0) { - msg_box.show( Exception(Exception::getErrorMessage(ERR_INS_DUPLIC_ROLE) + msg_box.show( Exception(Exception::getErrorMessage(InsDuplicatedRole) .arg(obj_sel->getName()) .arg(name_edt->text()), - ERR_INS_DUPLIC_ROLE,__PRETTY_FUNCTION__,__FILE__,__LINE__)); + InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__)); } } } diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index 788ebdc9d2..e86f5ce86c 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -28,10 +28,10 @@ RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_RULE) Ui_RuleWidget::setupUi(this); cond_expr_hl=new SyntaxHighlighter(cond_expr_txt, false, true); - cond_expr_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + cond_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); command_hl=new SyntaxHighlighter(comando_txt, false, true); - command_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + command_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); command_cp=new CodeCompletionWidget(comando_txt); commands_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); @@ -87,7 +87,7 @@ void RuleWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Bas unsigned qtd, i; if(!parent_tab) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, rule, parent_tab); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 8581408e64..71f2330c29 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -64,7 +64,7 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( try { snippet_hl=new SyntaxHighlighter(snippet_txt); - snippet_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + snippet_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); } catch(Exception &e) { @@ -270,7 +270,7 @@ void SnippetsConfigWidget::loadConfiguration(void) QStringList inv_snippets; this->resetForm(); - BaseConfigWidget::loadConfiguration(GlobalAttributes::SNIPPETS_CONF, config_params, { ParsersAttributes::ID }); + BaseConfigWidget::loadConfiguration(GlobalAttributes::SnippetsConf, config_params, { ParsersAttributes::ID }); //Check if there are invalid snippets loaded for(auto &snip : config_params) @@ -445,14 +445,14 @@ void SnippetsConfigWidget::saveConfiguration(void) { try { - QString root_dir=GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR, + QString root_dir=GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator, snippet_sch=root_dir + - GlobalAttributes::SCHEMAS_DIR + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::SchemasDir + + GlobalAttributes::DirSeparator + ParsersAttributes::SNIPPET + - GlobalAttributes::SCHEMA_EXT; + GlobalAttributes::SchemaExt; attribs_map attribs; ObjectType obj_type; @@ -471,8 +471,8 @@ void SnippetsConfigWidget::saveConfiguration(void) } } - config_params[GlobalAttributes::SNIPPETS_CONF]=attribs; - BaseConfigWidget::saveConfiguration(GlobalAttributes::SNIPPETS_CONF, config_params); + config_params[GlobalAttributes::SnippetsConf]=attribs; + BaseConfigWidget::saveConfiguration(GlobalAttributes::SnippetsConf, config_params); } catch(Exception &e) { @@ -484,7 +484,7 @@ void SnippetsConfigWidget::restoreDefaults(void) { try { - BaseConfigWidget::restoreDefaults(GlobalAttributes::SNIPPETS_CONF, false); + BaseConfigWidget::restoreDefaults(GlobalAttributes::SnippetsConf, false); this->loadConfiguration(); setConfigurationChanged(true); } diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index 02c9d73241..376a2177b7 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -39,7 +39,7 @@ SourceCodeWidget::SourceCodeWidget(QWidget *parent): BaseObjectWidget(parent) xmlcode_txt->setReadOnly(true); name_edt->setReadOnly(true); - version_cmb->addItems(PgSQLVersions::ALL_VERSIONS); + version_cmb->addItems(PgSQLVersions::AllVersions); code_options_ht=new HintTextWidget(code_options_hint, this); code_options_ht->setText( @@ -109,8 +109,8 @@ void SourceCodeWidget::saveSQLCode(void) out.setFileName(file_dlg.selectedFiles().at(0)); if(!out.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(file_dlg.selectedFiles().at(0)), - ERR_FILE_DIR_NOT_WRITTEN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(file_dlg.selectedFiles().at(0)), + FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf.append(sqlcode_txt->toPlainText()); out.write(buf.data(), buf.size()); @@ -242,10 +242,10 @@ void SourceCodeWidget::setAttributes(DatabaseModel *model, BaseObject *object) obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(object->getObjectType()))); if(!hl_sqlcode->isConfigurationLoaded()) - hl_sqlcode->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + hl_sqlcode->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); if(!hl_xmlcode->isConfigurationLoaded()) - hl_xmlcode->loadConfiguration(GlobalAttributes::XML_HIGHLIGHT_CONF_PATH); + hl_xmlcode->loadConfiguration(GlobalAttributes::XMLHighlightConfPath); generateSourceCode(); } diff --git a/libpgmodeler_ui/src/sourcecodewidget.h b/libpgmodeler_ui/src/sourcecodewidget.h index 43f0021cc7..e1ef1e9b33 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.h +++ b/libpgmodeler_ui/src/sourcecodewidget.h @@ -34,7 +34,7 @@ class SourceCodeWidget: public BaseObjectWidget, public Ui::SourceCodeWidget { private: Q_OBJECT - static const int ORIGINAL_SQL=0, + static constexpr int ORIGINAL_SQL=0, DEPENDENCIES_SQL=1, CHILDREN_SQL=2; diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 4070beeee0..6bcc3a00d0 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -53,10 +53,10 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) connect(find_history_wgt->hide_tb, SIGNAL(clicked(bool)), find_history_parent, SLOT(hide())); sql_cmd_hl=new SyntaxHighlighter(sql_cmd_txt, false); - sql_cmd_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + sql_cmd_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); cmd_history_hl=new SyntaxHighlighter(cmd_history_txt, false); - cmd_history_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + cmd_history_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); results_parent->setVisible(false); output_tbw->setTabEnabled(0, false); @@ -234,7 +234,7 @@ void SQLExecutionWidget::resizeEvent(QResizeEvent *event) void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTableWidget *results_tbw, bool store_data) { if(!results_tbw) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -342,8 +342,8 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) QString("%1 %2").arg(time_str).arg(e.getErrorMessage()), QPixmap(PgModelerUiNS::getIconPath("msgbox_erro")), false); - if(e.getErrorType()==ERR_CONNECTION_TIMEOUT || - e.getErrorType()==ERR_CONNECTION_BROKEN) + if(e.getErrorType()==ConnectionTimeout || + e.getErrorType()==ConnectionBroken) { PgModelerUiNS::createOutputListItem(msgoutput_lst, QString("%1 %2").arg(time_str).arg(trUtf8("No results retrieved or changes done due to the error above! Run the command again.")), @@ -573,8 +573,8 @@ void SQLExecutionWidget::saveCommands(void) file.setFileName(filename); if(!file.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(filename), - ERR_FILE_DIR_NOT_ACCESSED ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(filename), + FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); file.write(sql_cmd_txt->toPlainText().toUtf8()); file.close(); @@ -596,9 +596,9 @@ void SQLExecutionWidget::loadCommands(void) file.setFileName(sql_file_dlg.selectedFiles().at(0)); if(!file.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED) + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) .arg(sql_file_dlg.selectedFiles().at(0)) - ,ERR_FILE_DIR_NOT_ACCESSED ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ,FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); sql_cmd_txt->clear(); sql_cmd_txt->setPlainText(file.readAll()); @@ -612,7 +612,7 @@ void SQLExecutionWidget::loadCommands(void) void SQLExecutionWidget::exportResults(QTableView *results_tbw) { if(!results_tbw) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); QFileDialog csv_file_dlg; @@ -631,9 +631,9 @@ void SQLExecutionWidget::exportResults(QTableView *results_tbw) file.setFileName(csv_file_dlg.selectedFiles().at(0)); if(!file.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED) + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) .arg(csv_file_dlg.selectedFiles().at(0)) - , ERR_FILE_DIR_NOT_ACCESSED ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + , FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); QApplication::setOverrideCursor(Qt::WaitCursor); results_tbw->setUpdatesEnabled(false); @@ -685,7 +685,7 @@ QByteArray SQLExecutionWidget::generateTextBuffer(QTableView *results_tbw) QByteArray SQLExecutionWidget::generateBuffer(QTableView *results_tbw, QChar separator, bool incl_col_names, bool use_quotes) { if(!results_tbw) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!results_tbw->selectionModel()) return (QByteArray()); @@ -739,7 +739,7 @@ QByteArray SQLExecutionWidget::generateBuffer(QTableView *results_tbw, QChar sep void SQLExecutionWidget::copySelection(QTableView *results_tbw, bool use_popup, bool csv_is_default) { if(!results_tbw) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); QItemSelectionModel *selection = results_tbw->selectionModel(); @@ -832,34 +832,34 @@ void SQLExecutionWidget::saveSQLHistory(void) attribs[ParsersAttributes::CONNECTION] = hist.first; attribs[ParsersAttributes::COMMANDS] = hist.second; schparser.ignoreEmptyAttributes(true); - commands += schparser.getCodeDefinition(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SCHEMAS_DIR + - GlobalAttributes::DIR_SEPARATOR + + commands += schparser.getCodeDefinition(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::SchemasDir + + GlobalAttributes::DirSeparator + ParsersAttributes::COMMANDS + - GlobalAttributes::SCHEMA_EXT, attribs); + GlobalAttributes::SchemaExt, attribs); } - schparser.loadFile(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SCHEMAS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SQL_HISTORY_CONF + - GlobalAttributes::SCHEMA_EXT); + schparser.loadFile(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::SchemasDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::SQLHistoryConf + + GlobalAttributes::SchemaExt); attribs.clear(); attribs[ParsersAttributes::COMMANDS] = commands; buffer.append(schparser.getCodeDefinition(attribs)); - file.setFileName(GlobalAttributes::CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SQL_HISTORY_CONF + - GlobalAttributes::CONFIGURATION_EXT); + file.setFileName(GlobalAttributes::ConfigurationsDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::SQLHistoryConf + + GlobalAttributes::ConfigurationExt); if(!file.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(file.fileName()), - ERR_FILE_DIR_NOT_ACCESSED, __PRETTY_FUNCTION__, __FILE__ ,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(file.fileName()), + FileDirectoryNotAccessed, __PRETTY_FUNCTION__, __FILE__ ,__LINE__); file.write(buffer); file.close(); @@ -877,18 +877,18 @@ void SQLExecutionWidget::loadSQLHistory(void) XMLParser xmlparser; attribs_map attribs; - xmlparser.setDTDFile(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::OBJECT_DTD_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SQL_HISTORY_CONF + - GlobalAttributes::OBJECT_DTD_EXT, - GlobalAttributes::SQL_HISTORY_CONF); + xmlparser.setDTDFile(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::ObjectDTDDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::SQLHistoryConf + + GlobalAttributes::ObjectDTDExt, + GlobalAttributes::SQLHistoryConf); - xmlparser.loadXMLFile(GlobalAttributes::CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SQL_HISTORY_CONF + - GlobalAttributes::CONFIGURATION_EXT); + xmlparser.loadXMLFile(GlobalAttributes::ConfigurationsDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::SQLHistoryConf + + GlobalAttributes::ConfigurationExt); cmd_history.clear(); @@ -925,10 +925,10 @@ void SQLExecutionWidget::destroySQLHistory(void) if(msg_box.result() == QDialog::Accepted) { - QFile::remove(GlobalAttributes::CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SQL_HISTORY_CONF + - GlobalAttributes::CONFIGURATION_EXT); + QFile::remove(GlobalAttributes::ConfigurationsDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::SQLHistoryConf + + GlobalAttributes::ConfigurationExt); SQLExecutionWidget::cmd_history.clear(); } diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index ceb4f8de9c..3b21aefa91 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -45,7 +45,7 @@ SQLToolWidget::SQLToolWidget(QWidget * parent) : QWidget(parent) sourcecode_txt->setReadOnly(true); sourcecode_hl=new SyntaxHighlighter(sourcecode_txt); - sourcecode_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + sourcecode_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); vbox->setContentsMargins(4,4,4,4); vbox->addWidget(sourcecode_txt); diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index ee97aa35c0..109e4a2afe 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -183,11 +183,11 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) *graph_dst_obj=dynamic_cast(dst_obj); if(!src_obj && !dst_obj) - throw Exception(ERR_OPR_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raise an exception if the user try to swap an id of relationship by other object of different kind else if((src_obj->getObjectType()==OBJ_RELATIONSHIP || dst_obj->getObjectType()==OBJ_RELATIONSHIP) && (src_obj->getObjectType() != dst_obj->getObjectType())) - throw Exception(ERR_INV_REL_ID_SWAP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(InvRelationshipIdSwap,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 9537fd8004..dbc0030505 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -24,7 +24,7 @@ QFont SyntaxHighlighter::default_font=QFont(QString("Source Code Pro"), 10); SyntaxHighlighter::SyntaxHighlighter(QPlainTextEdit *parent, bool single_line_mode, bool use_custom_tab_width) : QSyntaxHighlighter(parent) { if(!parent) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setDocument(parent->document()); this->single_line_mode=single_line_mode; @@ -372,13 +372,13 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) { clearConfiguration(); xmlparser.restartParser(); - xmlparser.setDTDFile(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::OBJECT_DTD_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::CODE_HIGHLIGHT_CONF + - GlobalAttributes::OBJECT_DTD_EXT, - GlobalAttributes::CODE_HIGHLIGHT_CONF); + xmlparser.setDTDFile(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::ObjectDTDDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::CodeHighlightConf + + GlobalAttributes::ObjectDTDExt, + GlobalAttributes::CodeHighlightConf); xmlparser.loadXMLFile(filename); @@ -439,15 +439,15 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) //Raises an error if the group was declared before if(find(groups_order.begin(), groups_order.end(), group)!=groups_order.end()) { - throw Exception(Exception::getErrorMessage(ERR_REDECL_HL_GROUP).arg(group), - ERR_REDECL_HL_GROUP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvRedeclarationGroup).arg(group), + InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group is being declared and build at the declaration statment (not permitted) else if(attribs.size() > 1 || xmlparser.hasElement(XMLParser::CHILD_ELEMENT)) { - throw Exception(Exception::getErrorMessage(ERR_DEF_INV_GROUP_DECL) + throw Exception(Exception::getErrorMessage(InvGroupDeclaration) .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), - ERR_REDECL_HL_GROUP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } groups_order.push_back(group); @@ -458,21 +458,21 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) //Raises an error if the group is being constructed by a second time if(initial_exprs.count(group)!=0) { - throw Exception(Exception::getErrorMessage(ERR_DEF_DUPLIC_GROUP).arg(group), - ERR_DEF_DUPLIC_GROUP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(DefDuplicatedGroup).arg(group), + DefDuplicatedGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group is being constructed without being declared else if(find(groups_order.begin(), groups_order.end(), group)==groups_order.end()) { - throw Exception(Exception::getErrorMessage(ERR_DEF_NOT_DECL_GROUP) + throw Exception(Exception::getErrorMessage(DefNotDeclaredGroup) .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), - ERR_DEF_NOT_DECL_GROUP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + DefNotDeclaredGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group does not have children element else if(!xmlparser.hasElement(XMLParser::CHILD_ELEMENT)) { - throw Exception(Exception::getErrorMessage(ERR_DEF_EMPTY_GROUP).arg(group), - ERR_DEF_EMPTY_GROUP,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(DefEmptyGroup).arg(group), + DefEmptyGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } chr_sensitive=(attribs[ParsersAttributes::CASE_SENSITIVE]==ParsersAttributes::_TRUE_); @@ -568,8 +568,8 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) if(initial_exprs[group].size()==0) { //Raises an error if the group was declared but not constructed - throw Exception(Exception::getErrorMessage(ERR_GROUP_DECL_NOT_DEFINED).arg(group), - ERR_GROUP_DECL_NOT_DEFINED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(InvGroupDeclarationNotDefined).arg(group), + InvGroupDeclarationNotDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler_ui/src/syntaxhighlighter.h b/libpgmodeler_ui/src/syntaxhighlighter.h index 67e949f09b..a3300c0d08 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.h +++ b/libpgmodeler_ui/src/syntaxhighlighter.h @@ -64,7 +64,7 @@ class SyntaxHighlighter: public QSyntaxHighlighter { static QFont default_font; //! \brief Indicates that the current block has no special meaning - static const int SIMPLE_BLOCK=-1, + static constexpr int SIMPLE_BLOCK=-1, /*! \brief Indicates that the current block has an open (but still to close) expression (e.g. multline comments) When the highlighter finds this const it'll do special operation like highlight next blocks with the same diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index fdae8177b6..7cec58e5e2 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -494,9 +494,9 @@ QString TableDataWidget::generateDataBuffer(void) if((value.startsWith(PgModelerNS::UNESC_VALUE_START) && value.endsWith(QString("\\") + PgModelerNS::UNESC_VALUE_END)) || (value.startsWith(PgModelerNS::UNESC_VALUE_START) && !value.endsWith(PgModelerNS::UNESC_VALUE_END)) || (!value.startsWith(PgModelerNS::UNESC_VALUE_START) && !value.endsWith(QString("\\") + PgModelerNS::UNESC_VALUE_END) && value.endsWith(PgModelerNS::UNESC_VALUE_END))) - throw Exception(Exception::getErrorMessage(ERR_MALFORMED_UNESCAPED_VALUE) + throw Exception(Exception::getErrorMessage(MalformedUnescapedValue) .arg(row + 1).arg(col_names[col]), - ERR_MALFORMED_UNESCAPED_VALUE,__PRETTY_FUNCTION__,__FILE__,__LINE__); + MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); val_list.push_back(value); } diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 5889f63a98..17a8220e22 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -51,10 +51,10 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) connect(edt_data_tb, SIGNAL(clicked(bool)), this, SLOT(editData())); misc_btns_lt->insertWidget(1, edt_data_tb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_91)].push_back(unlogged_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(enable_rls_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_95)].push_back(force_rls_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_100)].push_back(partitioning_type_lbl); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion91)].push_back(unlogged_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(enable_rls_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(force_rls_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion100)].push_back(partitioning_type_lbl); frame=generateVersionWarningFrame(fields_map); table_grid->addWidget(frame, table_grid->count()+1, 0, 1, 2); frame->setParent(this); @@ -635,10 +635,10 @@ void TableWidget::removeObjects(void) table->removeObject(object); } else - throw Exception(Exception::getErrorMessage(ERR_REM_PROTECTED_OBJECT) + throw Exception(Exception::getErrorMessage(RemProtectedObject) .arg(object->getName()) .arg(object->getTypeName()), - ERR_REM_PROTECTED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(obj_type == OBJ_CONSTRAINT) @@ -688,10 +688,10 @@ void TableWidget::removeObject(int row) table->setModified(true); } else - throw Exception(Exception::getErrorMessage(ERR_REM_PROTECTED_OBJECT) + throw Exception(Exception::getErrorMessage(RemProtectedObject) .arg(object->getName()) .arg(object->getTypeName()), - ERR_REM_PROTECTED_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(obj_type == OBJ_CONSTRAINT) listObjects(OBJ_COLUMN); @@ -911,7 +911,7 @@ void TableWidget::applyConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==ERR_INVALIDATED_OBJECTS) + if(e.getErrorType()==RemInvalidatedObjects) msg_box.show(e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index 427f4b0a4d..dba70d04d3 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -27,7 +27,7 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TRIG Ui_TriggerWidget::setupUi(this); cond_expr_hl=new SyntaxHighlighter(cond_expr_txt, false, true); - cond_expr_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + cond_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); columns_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ (ObjectsTableWidget::EDIT_BUTTON | @@ -221,7 +221,7 @@ void TriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Column *column=nullptr; if(!parent_table) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, trigger, parent_table); ref_table_sel->setModel(model); diff --git a/libpgmodeler_ui/src/updatenotifierwidget.cpp b/libpgmodeler_ui/src/updatenotifierwidget.cpp index e1376cb0be..3eb74267ae 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.cpp +++ b/libpgmodeler_ui/src/updatenotifierwidget.cpp @@ -37,8 +37,8 @@ UpdateNotifierWidget::UpdateNotifierWidget(QWidget *parent) : QWidget(parent) connect(&update_chk_manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleUpdateChecked(QNetworkReply*))); //C++11 lambda slots - connect(get_source_tb, &QToolButton::clicked, this, [&](){ activateLink(GlobalAttributes::PGMODELER_SRC_URL); }); - connect(get_binary_tb, &QToolButton::clicked, this, [&](){ activateLink(GlobalAttributes::PGMODELER_DOWNLOAD_URL); }); + connect(get_source_tb, &QToolButton::clicked, this, [&](){ activateLink(GlobalAttributes::PgModelerSourceURL); }); + connect(get_binary_tb, &QToolButton::clicked, this, [&](){ activateLink(GlobalAttributes::PgModelerDownloadURL); }); connect(hide_tb, &QToolButton::clicked, this, @@ -97,7 +97,7 @@ void UpdateNotifierWidget::activateLink(const QString &link) void UpdateNotifierWidget::checkForUpdate(void) { - QUrl url(GlobalAttributes::PGMODELER_UPD_CHECK_URL + GlobalAttributes::PGMODELER_VERSION); + QUrl url(GlobalAttributes::PgModelerUpdateCheckURL + GlobalAttributes::PgModelerVersion); QNetworkRequest req(url); req.setRawHeader("User-Agent", "pgModelerUpdateCheck"); @@ -124,8 +124,8 @@ void UpdateNotifierWidget::handleUpdateChecked(QNetworkReply *reply) { QString url=reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString(); - if(http_status==302 && !url.startsWith(GlobalAttributes::PGMODELER_SITE)) - url.prepend(GlobalAttributes::PGMODELER_SITE); + if(http_status==302 && !url.startsWith(GlobalAttributes::PgModelerSite)) + url.prepend(GlobalAttributes::PgModelerSite); QNetworkRequest req(url); update_chk_reply=update_chk_manager.get(req); diff --git a/libpgmodeler_ui/src/validationinfo.cpp b/libpgmodeler_ui/src/validationinfo.cpp index b97ce3ee58..d08f056256 100644 --- a/libpgmodeler_ui/src/validationinfo.cpp +++ b/libpgmodeler_ui/src/validationinfo.cpp @@ -27,10 +27,10 @@ ValidationInfo::ValidationInfo(void) ValidationInfo::ValidationInfo(unsigned val_type, BaseObject *object, vector references) { if(val_type >= SQL_VALIDATION_ERR) - throw Exception(ERR_ASG_INV_TYPE_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if((val_type==NO_UNIQUE_NAME || val_type==BROKEN_REFERENCE) && (!object || references.empty())) - throw Exception(ERR_ASG_NOT_ALOC_OBJECT,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->val_type=val_type; this->object=object; diff --git a/libpgmodeler_ui/src/validationinfo.h b/libpgmodeler_ui/src/validationinfo.h index 4ff4872670..6409c1ee66 100644 --- a/libpgmodeler_ui/src/validationinfo.h +++ b/libpgmodeler_ui/src/validationinfo.h @@ -46,7 +46,7 @@ class ValidationInfo { QStringList errors; public: - static const unsigned NO_UNIQUE_NAME=0, + static constexpr unsigned NO_UNIQUE_NAME=0, BROKEN_REFERENCE=1, SP_OBJ_BROKEN_REFERENCE=2, BROKEN_REL_CONFIG=3, diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 58cab2588b..0bbe0740e6 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -40,14 +40,14 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) code_txt=new NumberedTextEditor(this); code_txt->setReadOnly(true); code_hl=new SyntaxHighlighter(code_txt); - code_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + code_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); vbox=new QVBoxLayout(code_prev_tab); vbox->setContentsMargins(4,4,4,4); vbox->addWidget(code_txt); cte_expression_txt=new NumberedTextEditor(this, true); cte_expression_hl=new SyntaxHighlighter(cte_expression_txt); - cte_expression_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + cte_expression_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); vbox=new QVBoxLayout(cte_tab); vbox->setContentsMargins(4,4,4,4); vbox->addWidget(cte_expression_txt); @@ -113,9 +113,9 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) tablespace_lbl->setEnabled(false); configureFormLayout(view_grid, OBJ_VIEW); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_93)].push_back(recursive_rb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_93)].push_back(materialized_rb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PGSQL_VERSION_93)].push_back(with_no_data_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion93)].push_back(recursive_rb); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion93)].push_back(materialized_rb); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion93)].push_back(with_no_data_chk); frame=generateVersionWarningFrame(fields_map); view_grid->addWidget(frame, view_grid->count()+1, 0, 1,3); frame->setParent(this); diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 06fd18bb34..b39533b00b 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -18,259 +18,258 @@ #include "exception.h" #include -QString Exception::messages[ERROR_COUNT][2]={ - {"ERR_CUSTOM", QString(" ")}, - {"ERR_ASG_PSDTYPE_COLUMN", QT_TR_NOOP("Assignment of a pseudo-type to the type of the column!")}, - {"ERR_ASG_INV_PRECISION", QT_TR_NOOP("Assignment of a precision greater than the length of the type!")}, - {"ERR_ASG_INV_PREC_TIMESTAMP", QT_TR_NOOP("Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6!")}, - {"ERR_ASG_NOT_ALOC_COLUMN", QT_TR_NOOP("Assignment of a not allocated column to object `%1' (%2)!")}, - {"ERR_REF_COLUMN_INV_INDEX", QT_TR_NOOP("Reference to a column which index is out of the capacity of the column list!")}, - {"ERR_ASG_NOT_ALOC_OBJECT", QT_TR_NOOP("Assignment of not allocated object!")}, - {"ERR_ASG_NOT_ALOC_SCHEMA", QT_TR_NOOP("Assignment of a not allocated schema to object `%1' (%2)!")}, - {"ERR_ASG_OBJ_INV_DEFINITION", QT_TR_NOOP("The object `%1' (%2) has inconsistent SQL or XML definition!")}, - {"ERR_ASG_DUPLIC_OBJECT", QT_TR_NOOP("The object `%1' (%2) already exists on `%3' (%4)!")}, - {"ERR_ASG_DUPL_OBJ_CONTAINER", QT_TR_NOOP("The object `%1' (%2) cannot be assigned because there is already exists in the container object `%3'!")}, - {"ERR_ASG_OBJECT_INV_TYPE", QT_TR_NOOP("Assigning object of an invalid type!")}, - {"ERR_REM_OBJ_INVALID_TYPE", QT_TR_NOOP("Removing an object of an invalid type!")}, - {"ERR_OBT_OBJ_INVALID_TYPE", QT_TR_NOOP("Obtaining an object of an invalid type!")}, - {"ERR_ASG_EMPTY_NAME_RET_TABLE", QT_TR_NOOP("Assignment of empty name to table return type!")}, - {"ERR_ASG_DUPLIC_PARAM_FUNCTION", QT_TR_NOOP("The insertion of the parameter `%1' will not be possible because there is another parameter with same name in the function `%2'!")}, - {"ERR_INS_DUPLIC_RET_TAB_TYPE", QT_TR_NOOP("The insertion of the table return type `%1' will not be possible because there is another return type with the same name in the `%2'!")}, - {"ERR_REF_PARAM_INV_INDEX", QT_TR_NOOP("Reference to a parameter which index is out of the parameter list bounds!")}, - {"ERR_REF_INV_TRIGGER_EVENT", QT_TR_NOOP("Reference to an event which does not belongs to trigger!")}, - {"ERR_ASG_INV_COLUMN_TRIGGER",QT_TR_NOOP("The column `%1' cannot be assigned to the trigger `%2' because they belongs to different parent tables!")}, - {"ERR_ASG_NOT_ALOC_FUNCTION", QT_TR_NOOP("Assignment of a not allocated function to object `%1' (%2)!")}, - {"ERR_ASG_INV_TRIGGER_FUNCTION", QT_TR_NOOP("Assignment of a function which return type is different from `%1'!")}, - {"ERR_ASG_FUNC_INV_PARAM_COUNT", QT_TR_NOOP("Assignment of a function which parameter count is invalid to the object `%1' (%2)!")}, - {"ERR_ASG_FUNC_INV_LANGUAGE", QT_TR_NOOP("Assignment of a function which language is invalid!")}, - {"ERR_ASG_EVNT_TRIG_FUNC_INV_LANG", QT_TR_NOOP("Event trigger function must be coded in any language other than SQL!")}, - {"ERR_ASG_NOT_ALOC_TABLE", QT_TR_NOOP("Assignment of not allocated table to object `%1' (%2)!")}, - {"ERR_REF_ARG_INV_INDEX", QT_TR_NOOP("Reference to an argument which index is out of argument list bounds!")}, - {"ERR_ASG_EMPTY_NAME_OBJECT", QT_TR_NOOP("Assignment of empty name to an object!")}, - {"ERR_ASG_INV_NAME_OBJECT", QT_TR_NOOP("Assignment of a name which contains invalid characters!")}, - {"ERR_ASG_LONG_NAME_OBJECT", QT_TR_NOOP("Assignment of a name which length exceeds the maximum of 63 characters!")}, - {"ERR_ASG_INV_SCHEMA_OBJECT", QT_TR_NOOP("Assignment of schema object which type is invalid!")}, - {"ERR_ASG_INV_TABLESPACE_OBJECT", QT_TR_NOOP("Assignment of tablespace object with invalid type!")}, - {"ERR_ASG_TABSPC_INV_OBJECT", QT_TR_NOOP("Assignment of tablespace to an invalid object!")}, - {"ERR_ASG_TABSPC_INV_CONSTR_TYPE", QT_TR_NOOP("Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique!")}, - {"ERR_ASG_INV_ROLE_OBJECT", QT_TR_NOOP("Assignment of owner object which type is invalid!")}, - {"ERR_ASG_ROLE_OBJECT_INV_TYPE", QT_TR_NOOP("Assignment of owner to an invalid object!")}, - {"ERR_ASG_APPSQL_OBJECT_INV_TYPE", QT_TR_NOOP("Assignment of appended or prepended SQL to an invalid object!")}, - {"ERR_REF_FUNCTION_INV_TYPE", QT_TR_NOOP("Reference to a function with invalid type!")}, - {"ERR_REF_OPER_ARG_INV_TYPE", QT_TR_NOOP("Reference to an argument of the operator with invalid type!")}, - {"ERR_REF_OPER_INV_TYPE", QT_TR_NOOP("Reference to an operator with invalid type!")}, - {"ERR_ASG_VAL_INV_ROLE_OPT_TYPE", QT_TR_NOOP("Assignment of value to an invalid option type on role!")}, - {"ERR_REF_INV_ROLE_TYPE", QT_TR_NOOP("Reference to an invalid role type!")}, - {"ERR_INS_DUPLIC_ROLE", QT_TR_NOOP("The insertion of the role `%1' is not possible because this is already being referenced by role `%2'!")}, - {"ERR_ROLE_REF_REDUNDANCY",QT_TR_NOOP("Reference redundancy detected by having the role `%1' referencing the role `%2'!")}, - {"ERR_ROLE_MEMBER_ITSELF", QT_TR_NOOP("The role `%1' can not be listed as a member of itself!")}, - {"ERR_REF_ROLE_INV_INDEX", QT_TR_NOOP("Reference to a role which index is out of role list bounds!")}, - {"ERR_INS_EMPTY_RULE_COMMAND", QT_TR_NOOP("Insertion of empty command to the rule!")}, - {"ERR_REF_RULE_CMD_INV_INDEX", QT_TR_NOOP("Reference to a command which index is out of the command list bounds!")}, - {"ERR_INV_INH_COPY_PART_RELATIONSHIP", QT_TR_NOOP("It's not possible to create a self generalization/copy/partition relationship! The table can not inherit or copy its own attributes or be a partition of itself!")}, - {"ERR_ASG_OBJ_BELONGS_OTHER_TABLE", QT_TR_NOOP("Assignment of an object that already belongs to another table!")}, - {"ERR_ASG_SEQ_DIF_TABLE_SCHEMA", QT_TR_NOOP("Assignment of a schema to the sequence which differs from the schema of the owner table!")}, - {"ERR_ASG_INV_VALUE_SEQ_ATTRIBS", QT_TR_NOOP("Assignment of an invalid value to one of the sequence attributes!")}, - {"ERR_ASG_INV_SEQ_MIN_VALUE", QT_TR_NOOP("Assignment of a minimum value to the sequence which is greater than the maximum value!")}, - {"ERR_ASG_INV_SEQ_START_VALUE", QT_TR_NOOP("Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values!")}, - {"ERR_ASG_INV_SEQ_INCR_VALUE", QT_TR_NOOP("Assignment of a null increment value to the sequence!")}, - {"ERR_ASG_INV_SEQ_CACHE_VALUE", QT_TR_NOOP("Assignment of null cache value to the sequence!")}, - {"ERR_ASG_TAB_DIF_SEQ_SCHEMA", QT_TR_NOOP("Assignment of owner table which is not in the same schema as the sequence `%1'!")}, - {"ERR_ASG_SEQ_OWNER_DIF_TABLE", QT_TR_NOOP("Assignment of owner table which does not belong to the same owner of the sequence `%1'!")}, - {"ERR_ASG_INEXIST_OWNER_COL_SEQ", QT_TR_NOOP("Assignment of a nonexistent owner column to the sequence `%1'!")}, - {"ERR_ASG_INV_OWNER_COL_SEQ", QT_TR_NOOP("Assignment of an owner column to the sequence `%1' that is not related to any table!")}, - {"ERR_REF_LABEL_INV_INDEX", QT_TR_NOOP("Reference to a label which index is out of labels list bounds!")}, - {"ERR_ALOC_OBJECT_INV_TYPE", QT_TR_NOOP("Allocation of object with invalid type!")}, - {"ERR_ASG_FUNCTION_INV_RET_TYPE", QT_TR_NOOP("Assignment of a function with invalid return type to object `%1' (%2)!")}, - {"ERR_ASG_FUNCTION_INV_PARAMS", QT_TR_NOOP("Assignment of a function with invalid parameter(s) type(s) to object `%1' (%2)!")}, - {"ERR_ASG_NOT_ALOC_LANGUAGE", QT_TR_NOOP("Assignment of not allocated language!")}, - {"ERR_ASG_INV_LANGUAGE_OBJECT", QT_TR_NOOP("Assignment of language object which type is invalid!")}, - {"ERR_REF_TYPE_INV_INDEX", QT_TR_NOOP("Reference to data type with an index outside the capacity of data types list!")}, - {"ERR_ASG_NULL_TYPE_OBJECT", QT_TR_NOOP("Assignment of a null type to object `%1' (%2)!")}, - {"ERR_ASG_INV_TYPE_OBJECT", QT_TR_NOOP("Assignment of invalid type to the object!")}, - {"ERR_ASG_EMPTY_DIR_NAME", QT_TR_NOOP("Assignment of an empty directory to object `%1' (%2)!")}, - {"ERR_OBT_TYPES_INV_QUANTITY", QT_TR_NOOP("Obtaining types with invalid quantity!")}, - {"ERR_INS_DUPLIC_ITEMS", QT_TR_NOOP("Insertion of item which already exists in the attributes list of the type!")}, - {"ERR_INS_INV_TYPE_ATTRIB", QT_TR_NOOP("Insertion of invalid item in the attributes list of the type!")}, - {"ERR_INS_DUPLIC_ENUM_ITEM", QT_TR_NOOP("Insertion of item which already exists in the enumarations list of the type!")}, - {"ERR_INS_INV_TYPE_ENUM_ITEM", QT_TR_NOOP("Insertion of invalid item in the enumerations list of the type!")}, - {"ERR_REF_ATTRIB_INV_INDEX", QT_TR_NOOP("Reference to an attribute which index is out of the attributes list bounds!")}, - {"ERR_REF_ENUM_INV_INDEX", QT_TR_NOOP("Reference to an enumeration which index is out of the enumerations list bounds!")}, - {"ERR_ASG_INV_TYPE_CONFIG", QT_TR_NOOP("Assignment of invalid configuration to the type!")}, - {"ERR_ASG_INV_OPER_ARGS", QT_TR_NOOP("Assignment of an operator which input type count is invalid to aggregate function!")}, - {"ERR_ASG_INV_OPERATOR_TYPES", QT_TR_NOOP("Assignment of an operator which types of arguments is invalid!")}, - {"ERR_ASG_RESERVED_NAME", QT_TR_NOOP("Assignment of system reserved name to the object `%1' (%2)!")}, - {"ERR_USING_INV_FUNC_CONFIG", QT_TR_NOOP("One function with invalid configuration is been used by the object `%1' (%2)!")}, - {"ERR_ASG_INV_SUPSTG_NUMBER", QT_TR_NOOP("Assignment of an invalid strategy/support number to an operator class element!")}, - {"ERR_INS_DUPLIC_ELEMENT", QT_TR_NOOP("Insertion of element which already exists in the element list!")}, - {"ERR_REF_ELEM_INV_INDEX", QT_TR_NOOP("Reference to an element which index is out of element list bounds!")}, - {"ERR_REF_OBJ_INV_INDEX", QT_TR_NOOP("Reference to an object which index is out of object list bounds!")}, - {"ERR_REM_NOT_ALOC_OBJECT", QT_TR_NOOP("Removal of an object not allocated!")}, - {"ERR_REM_DIRECT_REFERENCE", QT_TR_NOOP("The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4)!")}, - {"ERR_REM_INDIRECT_REFERENCE", QT_TR_NOOP("The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4) that belongs to `%5' (%6)!")}, - {"ERR_OPR_OBJ_INV_TYPE", QT_TR_NOOP("Operation with object(s) which type(s) is invalid!")}, - {"ERR_REF_OBJ_INV_TYPE", QT_TR_NOOP("Reference to object with invalid type!")}, - {"ERR_OPR_NOT_ALOC_OBJECT", QT_TR_NOOP("Operation with object not allocated!")}, - {"ERR_LINK_TABLES_NO_PK", QT_TR_NOOP("The creation of the relationship `%1' between the table `%2' and `%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys!")}, - {"ERR_NOT_IMPL_REL_TYPE", QT_TR_NOOP("The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user!")}, - {"ERR_ASG_INV_EXPR_OBJECT", QT_TR_NOOP("Assignment of an invalid expression to the object!")}, - {"ERR_ASG_EXISTING_PK_TABLE", QT_TR_NOOP("Assignment of a primary key to a table which already has one!")}, - {"ERR_INV_IDENT_RELATIOSHIP", QT_TR_NOOP("Identifier relationship can not be created for a self relationship, relationships of the type n-n, copy or generalization!")}, - {"ERR_DUPLIC_COLS_COPY_REL", QT_TR_NOOP("Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'!")}, - {"ERR_INCOMP_COLS_INHERIT_REL", QT_TR_NOOP("Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types!")}, - {"ERR_INCOMP_CONSTRS_INHERIT_REL", QT_TR_NOOP("Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition!")}, - {"ERR_ASG_OBJ_INV_REL_TYPE", QT_TR_NOOP("An attribute can not be added to a copy, generalization or partitioning relationship!")}, - {"ERR_ASG_FOREIGN_KEY_REL", QT_TR_NOOP("A foreign key can not be added to a relationship because is created automatically when this is connected!")}, - {"ERR_REF_OBJ_INEXISTS_MODEL", QT_TR_NOOP("The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model!")}, - {"ERR_REF_INEXIST_USER_TYPE", QT_TR_NOOP("Reference to an user-defined data type that not exists in the model!")}, - {"ERR_ASG_INV_MAX_SIZE_OP_LIST", QT_TR_NOOP("Assignment of invalid maximum size to operation list!")}, - {"ERR_FILE_DIR_NOT_WRITTEN", QT_TR_NOOP("Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it!")}, - {"ERR_FILE_NOT_WRITTER_INV_DEF", QT_TR_NOOP("Unable to write the file `%1' due to one or more errors in the definition generation process!")}, - {"ERR_DUPLIC_RELATIONSHIP", QT_TR_NOOP("There is already a relationship between `%1' (%2) and `%3' (%4) in the model! When using relationships of the type generalization, copy and one-to-one there can't be other relationships linked to the pair of tables.")}, - {"ERR_INS_REL_GENS_REDUNDACY", QT_TR_NOOP("The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent!")}, - {"ERR_INVALIDATED_OBJECTS", QT_TR_NOOP("One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns!")}, - {"ERR_INV_PRIM_KEY_ALOCATION", QT_TR_NOOP("The primary key `%1' can only be allocated if declared within a block of code that defines a table or relationship!")}, - {"ERR_REF_INV_PRIVILEGE_TYPE",QT_TR_NOOP("Reference to an invalid privilege type!")}, - {"ERR_INS_DUP_ROLE_PERMISSION", QT_TR_NOOP("Insertion of a role which already exists in the role list of the permission!")}, - {"ERR_ASG_INCOMP_PRIV_OBJECT", QT_TR_NOOP("Assignment of privilege incompatible with the type of object referenced by permission!")}, - {"ERR_ASG_DUPLIC_PERMISSION", QT_TR_NOOP("There is already a permission on object `%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object!")}, - {"ERR_PERM_REF_INEXIST_OBJECT", QT_TR_NOOP("A permission is referencing the object `%1' (%2) which was not found in the model!")}, - {"ERR_ALOC_OBJECT_NO_SCHEMA", QT_TR_NOOP("The object `%1' (%2) can not be created because its not being assigned to any schema!")}, - {"ERR_ASG_DUP_TABLESPACE_DIR", QT_TR_NOOP("The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'!")}, - {"ERR_ASG_INV_DOMAIN_ARRAY", QT_TR_NOOP("It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature!")}, - {"ERR_ASG_CODE_FUNC_C_LANGUAGE", QT_TR_NOOP("The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead!")}, - {"ERR_ASG_FUNC_REFLIB_LANG_NOT_C", QT_TR_NOOP("The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS!")}, - {"ERR_ASG_INV_COM_OPEERATOR", QT_TR_NOOP("The operator `%1' can not be assigned as a comutator of operator `%2' because it has incompatible settings!")}, - {"ERR_ASG_INV_NEG_OPERATOR", QT_TR_NOOP("The operator `%1' can not be assigned as negator of operator `%2' because it has incompatible settings!")}, - {"ERR_USER_TYPE_SELF_REFERENCE", QT_TR_NOOP("The type `%1' can not self refer in the attributes `element' or `copy type' or be used as a data type of an attribute in the configuration of a composite type!")}, - {"ERR_ASG_INV_ELEMENT_TYPE", QT_TR_NOOP("Assignment of invalid element to type `%1'!")}, - {"ERR_ASG_INV_ALIGNMENT_TYPE",QT_TR_NOOP("Assignment of invalid alignment to type `%1'!")}, - {"ERR_ASG_INV_NAME_TABLE_RELNN", QT_TR_NOOP("Assignment of invalid name to the table generated from N-N relationship!")}, - {"ERR_INV_USE_ESPECIAL_PK", QT_TR_NOOP("The relationship `%1' can not make use of the special primary key because it is marked as identifier or it is a self relationship!")}, - {"ERR_OPR_REL_INCL_OBJECT", QT_TR_NOOP("The object `%1' (%2) can not be edited or deleted because it was automatically included through a relationship! If the object is an attribute or constraint the modifications must be done on the relationship editing form.")}, - {"ERR_REM_PROTECTED_OBJECT", QT_TR_NOOP("The object `%1' (%2) can not be deleted because it is protected!")}, - {"ERR_REDECL_HL_GROUP", QT_TR_NOOP("The group `%1' has already been declared earlier!")}, - {"ERR_DEF_INV_GROUP_DECL", QT_TR_NOOP("The group `%1' can not be built in the groups declaration block (%2)!")}, - {"ERR_DEF_NOT_DECL_GROUP", QT_TR_NOOP("The group `%1' was built but not declared in the groups declaration block (%2)!")}, - {"ERR_DEF_EMPTY_GROUP", QT_TR_NOOP("The group `%1' can not be built without possessing child elements!")}, - {"ERR_DEF_DUPLIC_GROUP", QT_TR_NOOP("The group `%1' can not be built once more because this was done in previous blocks!")}, - {"ERR_GROUP_DECL_NOT_DEFINED", QT_TR_NOOP("The group `%1' has been declared but not built!")}, - {"ERR_REF_COL_OBJTAB_INV_INDEX", QT_TR_NOOP("Reference to a column of the objects table with invalid index!")}, - {"ERR_REF_LIN_OBJTAB_INV_INDEX", QT_TR_NOOP("Reference to a row of the objects table with invalid index!")}, - {"ERR_OPR_RESERVED_OBJECT", QT_TR_NOOP("The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference!")}, - {"ERR_FUNC_CONFIG_INV_OBJECT", QT_TR_NOOP("The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect!")}, - {"ERR_SQL_SCOPE_INV_VIEW_REF", QT_TR_NOOP("A view reference should be used in at least one these SQL scopes: View Definition, SELECT, FROM, WHERE or GROUP/HAVING!")}, - {"ERR_CONSTR_NO_COLUMNS", QT_TR_NOOP("Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns!")}, - {"ERR_CONFIG_NOT_LOADED", QT_TR_NOOP("Unable to load the configuration file `%1'! Please check if file exists in its folder and/or if it is not corrupted!")}, - {"ERR_DEFAULT_CONFIG_NOT_REST", QT_TR_NOOP("Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again!")}, - {"ERR_EXPORT_FAILURE", QT_TR_NOOP("The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack!\n\n** Executed SQL command: **\n\n%1")}, - {"ERR_PLUGIN_NOT_LOADED", QT_TR_NOOP("Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3'")}, - {"ERR_PLUGINS_NOT_LOADED", QT_TR_NOOP("One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details.")}, - {"ERR_INV_SYNTAX", QT_TR_NOOP("Invalid syntax in file `%1', line %2, column %3!")}, - {"ERR_INV_INSTRUCTION", QT_TR_NOOP("Invalid instruction `%1' on file `%2', line %3, column %4!")}, - {"ERR_UNK_ATTRIBUTE", QT_TR_NOOP("Unknown attribute `%1' in file `%2', line %3, column %4!")}, - {"ERR_INV_METACHARACTER", QT_TR_NOOP("Invalid metacharacter `%1' in file `%2', line %3, column %4!")}, - {"ERR_INV_OPERATOR_IN_EXPR", QT_TR_NOOP("Invalid operator `%1' in comparison expression, file `%2', line %3, column %4!")}, - {"ERR_UNDEF_ATTRIB_VALUE", QT_TR_NOOP("Attribute `%1' with an undefined value in file `%2', line %3, column %4!")}, - {"ERR_INV_ATTRIBUTE", QT_TR_NOOP("Attribute `%1' with an invalid name in file `%2', line %3, column %4!")}, - {"ERR_ASG_EMPTY_XML_BUFFER", QT_TR_NOOP("Assignment of empty XML buffer to parser!")}, - {"ERR_FILE_DIR_NOT_ACCESSED", QT_TR_NOOP("Could not access the file or directory `%1'! Make sure that it exists or if the user has access permissions on it!")}, - {"ERR_ASG_EMPTY_DTD_FILE", QT_TR_NOOP("Assignment of empty DTD file name!")}, - {"ERR_ASG_EMPTY_DTD_NAME", QT_TR_NOOP("Assignment of empty name to the DTD declaration!")}, - {"ERR_LIBXMLERR", QT_TR_NOOP("Error while interpreting XML buffer at line %1 column %2.\nMessage generated by the parser: %3. %4")}, - {"ERR_OPR_NOT_ALOC_ELEM_TREE", QT_TR_NOOP("Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated!")}, - {"ERR_LOAD_INV_MODEL_FILE", QT_TR_NOOP("Could not load file `%1'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing!")}, - {"ERR_OPR_NOT_ALOC_ELEMENT", QT_TR_NOOP("Operation with unallocated tree element!")}, - {"ERR_OPR_INEXIST_ELEMENT", QT_TR_NOOP("Operation with element which does not exists in the element tree currently loaded!")}, - {"ERR_ASG_INV_CONN_PARAM", QT_TR_NOOP("Assignment of a value to an invalid connection parameter!")}, - {"ERR_OPR_NOT_ALOC_CONN", QT_TR_NOOP("Operation on connection not established!")}, - {"ERR_CONNECTION_NOT_CONFIGURED", QT_TR_NOOP("Attempt to connect without define configuration parameters!")}, - {"ERR_CONNECTION_ALREADY_STABLISHED", QT_TR_NOOP("Attempt to start a connection already stablished!")}, - {"ERR_CONNECTION_NOT_STABLISHED", QT_TR_NOOP("Could not connect to the database.\nMessage returned: `%1'")}, - {"ERR_ASG_SQL_RESULT_NOT_ALOC", QT_TR_NOOP("Assignment of not allocated SQL command result!")}, - {"ERR_INCOMPREHENSIBLE_DBMS_RESP", QT_TR_NOOP("Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client!")}, - {"ERR_DBMS_FATAL_ERROR", QT_TR_NOOP("Unable to allocate command result for the SQL because the server has generated a fatal error!\nMessage returned by the DBMS: `%1'")}, - {"ERR_REF_TUPLE_COL_INV_INDEX", QT_TR_NOOP("Reference to a column of tuple with invalid index!")}, - {"ERR_REF_TUPLE_COL_INV_NAME", QT_TR_NOOP("Reference to a column of tuple with invalid name!")}, - {"ERR_REF_TUPLE_INEXISTENT", QT_TR_NOOP("Reference to a tuple with an invalid index or the result is empty (no tuples)!")}, - {"ERR_REF_INV_TUPLE_COLUMN", QT_TR_NOOP("Reference to a column of a tuple which was not yet initialized (tuple navigation not started)!")}, - {"ERR_CMD_SQL_NOT_EXECUTED", QT_TR_NOOP("Could not execute the SQL command.\n Message returned: `%1'")}, - {"ERR_INV_VIEW_DEF_EXPRESSION", QT_TR_NOOP("Invalid use of a view reference as whole SQL definition! The assigned reference must be an expression!")}, - {"ERR_ASG_SEC_VIEW_DEF_EXPRESSION", QT_TR_NOOP("Assignment of a second definition expression to the view!")}, - {"ERR_MIX_VIEW_DEF_EXPR_REFS", QT_TR_NOOP("It is not possible mix ordinary references (SELECT-FROM, FROM-WHERE, After WHERE) with references used as view SQL definition!")}, - {"ERR_ASG_INV_COLLATION_OBJECT", QT_TR_NOOP("Assignment of collation object which type is invalid!")}, - {"ERR_PK_USING_COLS_ADDED_BY_REL", QT_TR_NOOP("At the moment pgModeler does not support the creation of primary keys which some columns were generated by relationship connection. To create primary keys with this feature you can use the field `Identifier' or the tab `Primary key' on relationship editing form!")}, - {"ERR_EMPTY_LOCAL_ATTRIB_COLLATION", QT_TR_NOOP("Collations must be created at least with attributes LC_COLLATE and LC_CTYPE defined!")}, - {"ERR_OBJECT_REFERENCING_ITSELF", QT_TR_NOOP("The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object!")}, - {"ERR_ASG_INV_OPFAM_OPCLSELEM", QT_TR_NOOP("Only operator families which uses `btree' as indexing method are accepted by operator class elements!")}, - {"ERR_REF_INV_LIKE_OP_TYPE", QT_TR_NOOP("Reference to an invalid copy table option!")}, - {"ERR_COPY_REL_TAB_DEFINED", QT_TR_NOOP("The copy relationship between the tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table!")}, - {"ERR_PART_REL_PATITIONED_DEFINED", QT_TR_NOOP("The paritioning relationship between the tables `%1' and `%2' cannot be done because the first one is already a partition of the table `%3'! Partition tables can be participating of only one partition hierarchy at a time!")}, - {"ERR_INV_REL_TYPE_FOR_PART_TABLES", QT_TR_NOOP("The relationship between the tables `%1' and `%2' can't be created because the first entity is part of a partitioning hierachy! The table `%3' can't be used in `generalization', `copy' and `one-to-one' relationships. In `one-to-many' and `many-to-many' relationships the mentioned table can't be referenced by the generated foreign key(s).")}, - {"ERR_TABLE_TRIG_INSTEADOF_FIRING",QT_TR_NOOP("The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers!")}, - {"ERR_TRIGGER_INV_TRUNCATE_USAGE",QT_TR_NOOP("The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table!")}, - {"ERR_TRIGGER_INV_INSTEADOF_USAGE",QT_TR_NOOP("The INSTEAD OF mode cannot be used on view triggers that executes for each statement!")}, - {"ERR_CONST_TRIG_NOT_AFTER_ROW",QT_TR_NOOP("Constraint triggers can only be executed on AFTER events and for each row!")}, - {"ERR_VIEW_TRIG_INV_AFTBFR_USAGE",QT_TR_NOOP("A view trigger cannot be AFTER/BEFORE when it executes for each row!")}, - {"ERR_TRIGGER_INV_INSTEADOF_UPDATE",QT_TR_NOOP("A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event!")}, - {"ERR_ASG_COLUMN_NO_PARENT",QT_TR_NOOP("Assignment of a column which has no parent table to the object `%1' (%2)!")}, - {"ERR_TRIG_USING_CONSTRIG_ATRIBS",QT_TR_NOOP("Only constraint triggers can be deferrable or reference another table!")}, - {"ERR_REF_FUNCTION_INV_TYPE_CONF", QT_TR_NOOP("Reference to a function id which is incompatible with the user define type configuration!")}, - {"ERR_ASG_INV_OPCLASS_OBJ", QT_TR_NOOP("The operator class assigned to the object `%1' (%2) must use `btree' as indexing method!")}, - {"ERR_INV_POSTGRESQL_VERSION", QT_TR_NOOP("Unsupported PostgreSQL version (%1) detected! Valid versions are between %2 and %3.")}, - {"ERR_VALIDATION_FAILURE", QT_TR_NOOP("The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack!")}, - {"ERR_REG_EXT_NOT_HANDLING_TYPE", QT_TR_NOOP("The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified!")}, - {"ERR_ALOC_INV_FK_RELATIONSHIP", QT_TR_NOOP("The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'!")}, - {"ERR_ASG_INV_NAME_PATTERN", QT_TR_NOOP("Assignement of an invalid object name pattern to the relationship `%1'!")}, - {"ERR_REF_INV_NAME_PATTERN_ID", QT_TR_NOOP("Reference to an invalid object name pattern id on the relationship `%1'!")}, - {"ERR_INV_USE_VARIADIC_PARAM_MODE", QT_TR_NOOP("Invalid use of variadic parameter mode! This mode can be used only with an array or \"any\" data type!")}, - {"ERR_MIX_INCOMP_EXPORT_OPTS", QT_TR_NOOP("Mixing incompatibles DBMS export modes: `ignore object duplications', `drop database' or `drop objects' cannot be used with `simulate export'!")}, - {"ERR_MIX_INCOMP_DROP_OPTS", QT_TR_NOOP("Mixing incompatibles DROP options: `drop database' and `drop objects' cannot be used at the same time!")}, - {"ERR_INV_ID_SWAP_SAME_OBJECT", QT_TR_NOOP("Invalid object id swapping operation! The objects involved are the same!")}, - {"ERR_INV_ID_SWAP_INV_OBJ_TYPE", QT_TR_NOOP("Invalid object id swapping operation! The database itself, tablespaces or roles cannot have the ids swapped!")}, - {"ERR_ASG_WGT_ALREADY_HAS_PARENT", QT_TR_NOOP("The widget already has a parent and cannot be assigned to a different object!")}, - {"ERR_OBJECT_NOT_IMPORTED", QT_TR_NOOP("The object `%1' (%2), oid `%3', could not be imported due to one or more errors! Check the exception stack for more details. `HINT:' if the object somehow references objects in `pg_catalog' or `information_schema' consider enable the importing of system objects.")}, - {"ERR_MODEL_FILE_NOT_LOADED", QT_TR_NOOP("Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case.")}, - {"ERR_INV_COLUMN_TABLE_TYPE", QT_TR_NOOP("The column `%1' cannot reference it's parent table `%2' as data type!")}, - {"ERR_OPR_INV_ELEMENT_ID", QT_TR_NOOP("Operation with an invalid element id `%1'!")}, - {"ERR_REF_ELEMENT_COLOR_ID", QT_TR_NOOP("Reference to an invalid color id `%1' for element `%2'!")}, - {"ERR_ASG_INV_OBJECT_TYPE", QT_TR_NOOP("Assignment of an invalid object to `%1' (%2)! The assigned object must be of type `%3'.")}, - {"ERR_INCOMP_COL_TYPE_FOR_SEQ", QT_TR_NOOP("The sequence `%1' can't be assigned to the column `%2' because the data type of the latter is incompatible. The type used must be an integer one!")}, - {"ERR_INV_USE_TMPNAMES_EXPORT_OPT", QT_TR_NOOP("The option to generate temporary object names can only be used in simulation mode!")}, - {"ERR_INV_CONV_INTEGER_TO_SERIAL", QT_TR_NOOP("It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function or a sequence object must be directly assigned to the column!")}, - {"ERR_ASG_INV_EVENT_TRIGGER_VARIABLE", QT_TR_NOOP("Could not assign the variable `%1' to event trigger's filter. Currently, PostgreSQL supports only the `TAG' variable!")}, - {"ERR_ROW_DATA_NOT_MANIPULATED", QT_TR_NOOP("Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. \n\n ** Returned error ** \n\n%4")}, - {"ERR_MALFORMED_UNESCAPED_VALUE", QT_TR_NOOP("Malformed unescaped value on row `%1' column `%2'!")}, - {"ERR_UNDO_REDO_OPR_INV_OBJECT", QT_TR_NOOP("Trying to undo/redo an invalid operation over an object that does not exists anymore or can't be handled! The operation history will be cleaned up.")}, - {"ERR_REQ_FIELDS_NOT_FILLED", QT_TR_NOOP("The object `%1' (%2) can't be handled because some needed fields are not set! Please, make sure to fill at least the requires fields in order to properly create or update the object.")}, - {"ERR_INV_REL_ID_SWAP", QT_TR_NOOP("A relationship can only be swapped by other object of the same kind!")}, - {"ERR_INV_INH_PARENT_TAB_NOT_FOUND", QT_TR_NOOP("A parent table of `%1' which OID is `%2' was not found in the set of imported objects!")}, - {"ERR_ASG_ENUM_INV_CHARS", QT_TR_NOOP("The enumeration `%1' can't be assigned to the type `%2' because contains invalid characters!")}, - {"ERR_ASG_ENUM_LONG_NAME", QT_TR_NOOP("The enumeration `%1' can't be assigned to the type `%2' because is too long!")}, - {"ERR_CONNECTION_TIMEOUT", QT_TR_NOOP("The connection was idle for too long and was automatically closed!")}, - {"ERR_CONNECTION_BROKEN", QT_TR_NOOP("The connection was unexpectedly closed by the database server `%1' at port `%2'!")}, - {"ERR_DROP_CURRDB_DEFAULT", QT_TR_NOOP("Failed to drop the database `%1' because it is defined as the default database for the connection `%2'!")}, - {"ERR_NULL_PK_COLUMN", QT_TR_NOOP("The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it!")}, - {"ERR_ASG_INV_IDENTITY_COLUMN", QT_TR_NOOP("The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'.")}, - {"ERR_REF_INV_AFFECTED_CMD", QT_TR_NOOP("Reference to an invalid affected command in policy `%1'!")}, - {"ERR_REF_INV_SPECIAL_ROLE", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")}, - {"ERR_INV_COLUMN_COUNT_PART_REL", QT_TR_NOOP("Unable to create a partition relationship because the partion table `%1' is not empty or has columns that are not present on the partitioned table `%2'!")}, - {"ERR_INV_PARTITIONIG_TYPE_PART_REL", QT_TR_NOOP("Unable to create a partition relationship between the tables `%1' (partition) and `%2' (partitioned) because no partitioning type is defined on the latter!")}, - {"ERR_INV_PARTITION_KEY_COUNT", QT_TR_NOOP("Invalid amount of partition keys being assinged to the table `%1'! Multiples partition keys are allowed only on `HASH' and `RANGE' partitioning strategies.")}, - {"ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL", QT_TR_NOOP("A partition key of the table `%1' is referencing the object `%3' (%4) which was not found in the model!")}, - {"ERR_ASG_INV_COLUMN_PARTITION_KEY", QT_TR_NOOP("The column `%1' can't be assigned to a partition key because it was created by a relatinship and this kind of operation is not yet supported! HINT: create the column manually on the table and then create the partition key using it.")}, - {"ERR_REM_COL_REF_PARTITION_KEY", QT_TR_NOOP("The column `%1' on the table `%2' can't be removed because it is being referenced by one or more patition keys!")}, - +QString Exception::messages[Exception::ErrorCount][2]={ + {"Custom", QString(" ")}, + {"AsgPseudoTypeColumn", QT_TR_NOOP("Assignment of a pseudo-type to the type of the column!")}, + {"AsgInvalidPrecision", QT_TR_NOOP("Assignment of a precision greater than the length of the type!")}, + {"AsgInvalidPrecisionTimestamp", QT_TR_NOOP("Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6!")}, + {"AsgNotAllocatedColumn", QT_TR_NOOP("Assignment of a not allocated column to object `%1' (%2)!")}, + {"RefColumnInvalidIndex", QT_TR_NOOP("Reference to a column which index is out of the capacity of the column list!")}, + {"AsgNotAllocattedObject", QT_TR_NOOP("Assignment of not allocated object!")}, + {"AsgNotAllocatedSchema", QT_TR_NOOP("Assignment of a not allocated schema to object `%1' (%2)!")}, + {"AsgObjectInvalidDefinition", QT_TR_NOOP("The object `%1' (%2) has inconsistent SQL or XML definition!")}, + {"AsgDuplicatedObject", QT_TR_NOOP("The object `%1' (%2) already exists on `%3' (%4)!")}, + {"AsgDuplicatedObjectContainer", QT_TR_NOOP("The object `%1' (%2) cannot be assigned because there is already exists in the container object `%3'!")}, + {"AsgObjectInvalidType", QT_TR_NOOP("Assigning object of an invalid type!")}, + {"RemObjectInvalidType", QT_TR_NOOP("Removing an object of an invalid type!")}, + {"ObtObjectInvalidType", QT_TR_NOOP("Obtaining an object of an invalid type!")}, + {"AsgEmptyNameTableReturnType", QT_TR_NOOP("Assignment of empty name to table return type!")}, + {"AsgDuplicatedParameterFunction", QT_TR_NOOP("The insertion of the parameter `%1' will not be possible because there is another parameter with same name in the function `%2'!")}, + {"InsDuplicatedTableReturnType", QT_TR_NOOP("The insertion of the table return type `%1' will not be possible because there is another return type with the same name in the `%2'!")}, + {"RefParameterInvalidIndex", QT_TR_NOOP("Reference to a parameter which index is out of the parameter list bounds!")}, + {"RefInvalidTriggerEvent", QT_TR_NOOP("Reference to an event which does not belongs to trigger!")}, + {"AsgInvalidColumnTrigger", QT_TR_NOOP("The column `%1' cannot be assigned to the trigger `%2' because they belongs to different parent tables!")}, + {"AsgNotAllocatedFunction", QT_TR_NOOP("Assignment of a not allocated function to object `%1' (%2)!")}, + {"AsgInvalidTriggerFunction", QT_TR_NOOP("Assignment of a function which return type is different from `%1'!")}, + {"AsgFunctionInvalidParamCount", QT_TR_NOOP("Assignment of a function which parameter count is invalid to the object `%1' (%2)!")}, + {"AsgFunctionInvalidLanguage", QT_TR_NOOP("Assignment of a function which language is invalid!")}, + {"AsgEventTriggerFuncInvalidLang", QT_TR_NOOP("Event trigger function must be coded in any language other than SQL!")}, + {"AsgNotAllocatedTable", QT_TR_NOOP("Assignment of not allocated table to object `%1' (%2)!")}, + {"RefArgumentInvalidIndex", QT_TR_NOOP("Reference to an argument which index is out of argument list bounds!")}, + {"AsgEmptyNameObject", QT_TR_NOOP("Assignment of empty name to an object!")}, + {"AsgInvalidNameObject", QT_TR_NOOP("Assignment of a name which contains invalid characters!")}, + {"AsgLongNameObject", QT_TR_NOOP("Assignment of a name which length exceeds the maximum of 63 characters!")}, + {"AsgInvalidSchemaObject", QT_TR_NOOP("Assignment of schema object which type is invalid!")}, + {"AsgInvalidTablespaceObject", QT_TR_NOOP("Assignment of tablespace object with invalid type!")}, + {"AsgTablespaceInvalidObject", QT_TR_NOOP("Assignment of tablespace to an invalid object!")}, + {"AsgTablespaceInvalidConstraintType", QT_TR_NOOP("Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique!")}, + {"AsgInvalidRoleObject", QT_TR_NOOP("Assignment of owner object which type is invalid!")}, + {"AsgRoleObjectInvalidType", QT_TR_NOOP("Assignment of owner to an invalid object!")}, + {"AsgCustomSQLObjectInvalidType", QT_TR_NOOP("Assignment of appended or prepended SQL to an invalid object!")}, + {"RefFunctionInvalidType", QT_TR_NOOP("Reference to a function with invalid type!")}, + {"RefOperatorArgumentInvalidType", QT_TR_NOOP("Reference to an argument of the operator with invalid type!")}, + {"RefOperatorInvalidType", QT_TR_NOOP("Reference to an operator with invalid type!")}, + {"AsgValueInvalidRoleOptionType", QT_TR_NOOP("Assignment of value to an invalid option type on role!")}, + {"RefInvalidRoleType", QT_TR_NOOP("Reference to an invalid role type!")}, + {"InsDuplicatedRole", QT_TR_NOOP("The insertion of the role `%1' is not possible because this is already being referenced by role `%2'!")}, + {"AsgRoleReferenceRedundancy", QT_TR_NOOP("Reference redundancy detected by having the role `%1' referencing the role `%2'!")}, + {"AsgRoleMemberItself", QT_TR_NOOP("The role `%1' can not be listed as a member of itself!")}, + {"RefRoleInvalidIndex", QT_TR_NOOP("Reference to a role which index is out of role list bounds!")}, + {"InsEmptyRuleCommand", QT_TR_NOOP("Insertion of empty command to the rule!")}, + {"RefRuleCommandInvalidIndex", QT_TR_NOOP("Reference to a command which index is out of the command list bounds!")}, + {"InvInheritCopyPartRelationship", QT_TR_NOOP("It's not possible to create a self generalization/copy/partition relationship! The table can not inherit or copy its own attributes or be a partition of itself!")}, + {"AsgObjectBelongsAnotherTable", QT_TR_NOOP("Assignment of an object that already belongs to another table!")}, + {"AsgSchemaSequenceDiffersTableSchema", QT_TR_NOOP("Assignment of a schema to the sequence which differs from the schema of the owner table!")}, + {"//AsgInvalidValueSequenceAttributes", QT_TR_NOOP("Assignment of an invalid value to one of the sequence attributes!")}, + {"AsgInvalidSequenceMinValue", QT_TR_NOOP("Assignment of a minimum value to the sequence which is greater than the maximum value!")}, + {"AsgInvalidSequenceStartValue", QT_TR_NOOP("Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values!")}, + {"AsgInvalidSequenceIncrementValue", QT_TR_NOOP("Assignment of a null increment value to the sequence!")}, + {"AsgInvalidSequenceCacheValue", QT_TR_NOOP("Assignment of null cache value to the sequence!")}, + {"AsgSeqOwnerTableDifferentSchema", QT_TR_NOOP("Assignment of owner table which is not in the same schema as the sequence `%1'!")}, + {"AsgSeqOwnerTableDifferentRole", QT_TR_NOOP("Assignment of owner table which does not belong to the same owner of the sequence `%1'!")}, + {"AsgInexistentSeqOwnerColumn", QT_TR_NOOP("Assignment of a nonexistent owner column to the sequence `%1'!")}, + {"AsgInvalidSeqOwnerColumn", QT_TR_NOOP("Assignment of an owner column to the sequence `%1' that is not related to any table!")}, + {"RefLabelInvalidIndex", QT_TR_NOOP("Reference to a label which index is out of labels list bounds!")}, + {"AllocationObjectInvalidType", QT_TR_NOOP("Allocation of object with invalid type!")}, + {"AsgFunctionInvalidReturnType", QT_TR_NOOP("Assignment of a function with invalid return type to object `%1' (%2)!")}, + {"AsgFunctionInvalidParameters", QT_TR_NOOP("Assignment of a function with invalid parameter(s) type(s) to object `%1' (%2)!")}, + {"AsgNotAllocatedLanguage", QT_TR_NOOP("Assignment of not allocated language!")}, + {"AsgInvalidLanguageObject", QT_TR_NOOP("Assignment of language object which type is invalid!")}, + {"RefTypeInvalidIndex", QT_TR_NOOP("Reference to data type with an index outside the capacity of data types list!")}, + {"AsgNullTypeObject", QT_TR_NOOP("Assignment of a null type to object `%1' (%2)!")}, + {"AsgInvalidTypeObject", QT_TR_NOOP("Assignment of invalid type to the object!")}, + {"AsgEmptyDirectoryName", QT_TR_NOOP("Assignment of an empty directory to object `%1' (%2)!")}, + {"ObtTypesInvalidQuantity", QT_TR_NOOP("Obtaining types with invalid quantity!")}, + {"InsDuplicatedItems", QT_TR_NOOP("Insertion of item which already exists in the attributes list of the type!")}, + {"InsInvalidTypeAttribute", QT_TR_NOOP("Insertion of invalid item in the attributes list of the type!")}, + {"InsDuplicatedEnumerationItem", QT_TR_NOOP("Insertion of item which already exists in the enumarations list of the type!")}, + {"InsInvalidEnumerationItem", QT_TR_NOOP("Insertion of invalid item in the enumerations list of the type!")}, + {"RefAttributeInvalidIndex", QT_TR_NOOP("Reference to an attribute which index is out of the attributes list bounds!")}, + {"RefEnumerationInvalidIndex", QT_TR_NOOP("Reference to an enumeration which index is out of the enumerations list bounds!")}, + {"AsgInvalidTypeConfiguration", QT_TR_NOOP("Assignment of invalid configuration to the type!")}, + {"AsgInvalidOperatorArguments", QT_TR_NOOP("Assignment of an operator which input type count is invalid to aggregate function!")}, + {"AsgInvalidOperatorTypes", QT_TR_NOOP("Assignment of an operator which types of arguments is invalid!")}, + {"AsgReservedName", QT_TR_NOOP("Assignment of system reserved name to the object `%1' (%2)!")}, + {"AsgFunctionInvalidConfiguration", QT_TR_NOOP("One function with invalid configuration is been used by the object `%1' (%2)!")}, + {"AsgInvalidSupportStrategyNumber", QT_TR_NOOP("Assignment of an invalid strategy/support number to an operator class element!")}, + {"InsDuplicatedElement", QT_TR_NOOP("Insertion of element which already exists in the element list!")}, + {"RefElementInvalidIndex", QT_TR_NOOP("Reference to an element which index is out of element list bounds!")}, + {"RefObjectInvalidIndex", QT_TR_NOOP("Reference to an object which index is out of object list bounds!")}, + {"RemNotAllocatedObject", QT_TR_NOOP("Removal of an object not allocated!")}, + {"RemDirectReference", QT_TR_NOOP("The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4)!")}, + {"RemInderectReference", QT_TR_NOOP("The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4) that belongs to `%5' (%6)!")}, + {"OprObjectInvalidType", QT_TR_NOOP("Operation with object(s) which type(s) is invalid!")}, + {"RefObjectInvalidType", QT_TR_NOOP("Reference to object with invalid type!")}, + {"OprNotAllocatedObject", QT_TR_NOOP("Operation with object not allocated!")}, + {"InvLinkTablesNoPrimaryKey", QT_TR_NOOP("The creation of the relationship `%1' between the table `%2' and `%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys!")}, + {"NotImplementedRelationshipType", QT_TR_NOOP("The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user!")}, + {"AsgInvalidExpressionObject", QT_TR_NOOP("Assignment of an invalid expression to the object!")}, + {"AsgExistingPrimaryKeyTable", QT_TR_NOOP("Assignment of a primary key to a table which already has one!")}, + {"InvIdentifierRelationship", QT_TR_NOOP("Identifier relationship can not be created for a self relationship, relationships of the type n-n, copy or generalization!")}, + {"InvCopyRelationshipDuplicCols", QT_TR_NOOP("Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'!")}, + {"InvInheritRelationshipIncompCols", QT_TR_NOOP("Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types!")}, + {"InvInheritRelationshipIncompConstrs", QT_TR_NOOP("Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition!")}, + {"AsgObjectInvalidRelationshipType", QT_TR_NOOP("An attribute can not be added to a copy, generalization or partitioning relationship!")}, + {"AsgForeignKeyRelationship", QT_TR_NOOP("A foreign key can not be added to a relationship because is created automatically when this is connected!")}, + {"RefObjectInexistsModel", QT_TR_NOOP("The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model!")}, + {"RefUserTypeInexistsModel", QT_TR_NOOP("Reference to an user-defined data type that not exists in the model!")}, + {"AsgInvalidMaxSizeOpList", QT_TR_NOOP("Assignment of invalid maximum size to operation list!")}, + {"FileDirectoryNotWritten", QT_TR_NOOP("Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it!")}, + {"FileNotWrittenInvalidDefinition", QT_TR_NOOP("Unable to write the file `%1' due to one or more errors in the definition generation process!")}, + {"InsDuplicatedRelationship", QT_TR_NOOP("There is already a relationship between `%1' (%2) and `%3' (%4) in the model! When using relationships of the type generalization, copy and one-to-one there can't be other relationships linked to the pair of tables.")}, + {"InsRelationshipRedundancy", QT_TR_NOOP("The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent!")}, + {"RemInvalidatedObjects", QT_TR_NOOP("One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns!")}, + {"InvPrimaryKeyAllocation", QT_TR_NOOP("The primary key `%1' can only be allocated if declared within a block of code that defines a table or relationship!")}, + {"RefInvalidPrivilegeType", QT_TR_NOOP("Reference to an invalid privilege type!")}, + {"InsDuplicatedRolePermission", QT_TR_NOOP("Insertion of a role which already exists in the role list of the permission!")}, + {"AsgInvalidPrivilegeObject", QT_TR_NOOP("Assignment of privilege incompatible with the type of object referenced by permission!")}, + {"AsgDuplicatedPermission", QT_TR_NOOP("There is already a permission on object `%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object!")}, + {"PermissionRefInexistObject", QT_TR_NOOP("A permission is referencing the object `%1' (%2) which was not found in the model!")}, + {"InvObjectAllocationNoSchema", QT_TR_NOOP("The object `%1' (%2) can not be created because its not being assigned to any schema!")}, + {"AsgTablespaceDuplicatedDirectory", QT_TR_NOOP("The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'!")}, + {"AsgInvalidDomainArray", QT_TR_NOOP("It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature!")}, + {"AsgSourceCodeFuncCLanguage", QT_TR_NOOP("The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead!")}, + {"AsgRefLibraryFuncLanguageNotC", QT_TR_NOOP("The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS!")}, + {"AsgInvalidCommutatorOperator", QT_TR_NOOP("The operator `%1' can not be assigned as a commutator of operator `%2' because it has incompatible settings!")}, + {"AsgInvalidNegatorOperator", QT_TR_NOOP("The operator `%1' can not be assigned as negator of operator `%2' because it has incompatible settings!")}, + {"InvUserTypeSelfReference", QT_TR_NOOP("The type `%1' can not self refer in the attributes `element' or `copy type' or be used as a data type of an attribute in the configuration of a composite type!")}, + {"AsgInvalidElementType", QT_TR_NOOP("Assignment of invalid element to type `%1'!")}, + {"AsgInvalidAlignmentType", QT_TR_NOOP("Assignment of invalid alignment to type `%1'!")}, + {"AsgInvalidNameTableRelNN", QT_TR_NOOP("Assignment of invalid name to the table generated from N-N relationship!")}, + {"InvUseSpecialPrimaryKey", QT_TR_NOOP("The relationship `%1' can not make use of the special primary key because it is marked as identifier or it is a self relationship!")}, + {"OprRelationshipAddedObject", QT_TR_NOOP("The object `%1' (%2) can not be edited or deleted because it was automatically included through a relationship! If the object is an attribute or constraint the modifications must be done on the relationship editing form.")}, + {"RemProtectedObject", QT_TR_NOOP("The object `%1' (%2) can not be deleted because it is protected!")}, + {"InvRedeclarationGroup", QT_TR_NOOP("The group `%1' has already been declared earlier!")}, + {"InvGroupDeclaration", QT_TR_NOOP("The group `%1' can not be built in the groups declaration block (%2)!")}, + {"DefNotDeclaredGroup", QT_TR_NOOP("The group `%1' was built but not declared in the groups declaration block (%2)!")}, + {"DefEmptyGroup", QT_TR_NOOP("The group `%1' can not be built without possessing child elements!")}, + {"DefDuplicatedGroup", QT_TR_NOOP("The group `%1' can not be built once more because this was done in previous blocks!")}, + {"InvGroupDeclarationNotDefined", QT_TR_NOOP("The group `%1' has been declared but not built!")}, + {"RefColObjectTabInvalidIndex", QT_TR_NOOP("Reference to a column of the objects table with invalid index!")}, + {"RefRowObjectTabInvalidIndex", QT_TR_NOOP("Reference to a row of the objects table with invalid index!")}, + {"OprReservedObject", QT_TR_NOOP("The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference!")}, + {"InvFuncConfigInvalidatesObject", QT_TR_NOOP("The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect!")}, + {"InvSQLScopeViewReference", QT_TR_NOOP("A view reference should be used in at least one of these SQL scopes: View Definition, SELECT, FROM, WHERE or GROUP/HAVING!")}, + {"InvConstratintNoColumns", QT_TR_NOOP("Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns!")}, + {"ConfigurationNotLoaded", QT_TR_NOOP("Unable to load the configuration file `%1'! Please check if file exists in its folder and/or if it is not corrupted!")}, + {"DefaultConfigNotRestored", QT_TR_NOOP("Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again!")}, + {"//ExportFailure", QT_TR_NOOP("The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack!\n\n** Executed SQL command: **\n\n%1")}, + {"PluginNotLoaded", QT_TR_NOOP("Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3'")}, + {"PluginsNotLoaded", QT_TR_NOOP("One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details.")}, + {"InvalidSyntax", QT_TR_NOOP("Invalid syntax in file `%1', line %2, column %3!")}, + {"InvalidInstruction", QT_TR_NOOP("Invalid instruction `%1' on file `%2', line %3, column %4!")}, + {"UnkownAttribute", QT_TR_NOOP("Unknown attribute `%1' in file `%2', line %3, column %4!")}, + {"InvalidMetacharacter", QT_TR_NOOP("Invalid metacharacter `%1' in file `%2', line %3, column %4!")}, + {"InvalidOperatorInExpression", QT_TR_NOOP("Invalid operator `%1' in comparison expression, file `%2', line %3, column %4!")}, + {"UndefinedAttributeValue", QT_TR_NOOP("Attribute `%1' with an undefined value in file `%2', line %3, column %4!")}, + {"InvalidAttribute", QT_TR_NOOP("Attribute `%1' with an invalid name in file `%2', line %3, column %4!")}, + {"AsgEmptyXMLBuffer", QT_TR_NOOP("Assignment of empty XML buffer to parser!")}, + {"FileDirectoryNotAccessed", QT_TR_NOOP("Could not access the file or directory `%1'! Make sure that it exists or if the user has access permissions on it!")}, + {"AsgEmptyDTDFile", QT_TR_NOOP("Assignment of empty DTD file name!")}, + {"AsgEmptyDTDName", QT_TR_NOOP("Assignment of empty name to the DTD declaration!")}, + {"LibXMLError", QT_TR_NOOP("Error while interpreting XML buffer at line %1 column %2.\nMessage generated by the parser: %3. %4")}, + {"OprNotAllocatedElementTree", QT_TR_NOOP("Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated!")}, + {"InvModelFileNotLoaded", QT_TR_NOOP("Could not load file `%1'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing!")}, + {"OprNotAllocatedElement", QT_TR_NOOP("Operation with unallocated tree element!")}, + {"OprInexistentElement", QT_TR_NOOP("Operation with element which does not exists in the element tree currently loaded!")}, + {"AsgInvalidConnParameter", QT_TR_NOOP("Assignment of a value to an invalid connection parameter!")}, + {"OprNotAllocatedConnection", QT_TR_NOOP("Operation on connection not established!")}, + {"ConnectionNotConfigured", QT_TR_NOOP("Attempt to connect without define configuration parameters!")}, + {"ConnectionAlreadyStablished", QT_TR_NOOP("Attempt to start a connection already stablished!")}, + {"ConnectionNotStablished", QT_TR_NOOP("Could not connect to the database.\nMessage returned: `%1'")}, + {"AsgNotAllocatedSQLResult", QT_TR_NOOP("Assignment of not allocated SQL command result!")}, + {"IncomprehensibleDBMSResponse", QT_TR_NOOP("Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client!")}, + {"DBMSFatalError", QT_TR_NOOP("Unable to allocate command result for the SQL because the server has generated a fatal error!\nMessage returned by the DBMS: `%1'")}, + {"RefTupleColumnInvalidIndex", QT_TR_NOOP("Reference to a column of tuple with invalid index!")}, + {"RefTupleColumnInvalidName", QT_TR_NOOP("Reference to a column of tuple with invalid name!")}, + {"RefInvalidTuple", QT_TR_NOOP("Reference to a tuple with an invalid index or the result is empty (no tuples)!")}, + {"RefInvalidTupleColumn", QT_TR_NOOP("Reference to a column of a tuple which was not yet initialized (tuple navigation not started)!")}, + {"SQLCommandNotExecuted", QT_TR_NOOP("Could not execute the SQL command.\n Message returned: `%1'")}, + {"AsgInvalidViewDefExpression", QT_TR_NOOP("Invalid use of a view reference as whole SQL definition! The assigned reference must be an expression!")}, + {"AsgSecondViewDefExpression", QT_TR_NOOP("Assignment of a second definition expression to the view!")}, + {"MixingViewDefExprsReferences", QT_TR_NOOP("It is not possible mix ordinary references (SELECT-FROM, FROM-WHERE, After WHERE) with references used as view SQL definition!")}, + {"AsgInvalidCollationObject", QT_TR_NOOP("Assignment of collation object which type is invalid!")}, + {"UnsupportedPKColsAddedByRel", QT_TR_NOOP("At the moment pgModeler does not support the creation of primary keys which some columns were generated by relationship connection. To create primary keys with this feature you can use the field `Identifier' or the tab `Primary key' on relationship editing form!")}, + {"EmptyLCCollationAttributes", QT_TR_NOOP("Collations must be created at least with attributes LC_COLLATE and LC_CTYPE defined!")}, + {"ObjectReferencingItself", QT_TR_NOOP("The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object!")}, + {"AsgInvalidOpFamilyOpClassElem", QT_TR_NOOP("Only operator families which uses `btree' as indexing method are accepted by operator class elements!")}, + {"RefInvalidLikeOptionType", QT_TR_NOOP("Reference to an invalid copy table option!")}, + {"InvCopyRelTableDefined", QT_TR_NOOP("The copy relationship between the tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table!")}, + {"InvPartRelPartitionedDefined", QT_TR_NOOP("The paritioning relationship between the tables `%1' and `%2' cannot be done because the first one is already a partition of the table `%3'! Partition tables can be participating of only one partition hierarchy at a time!")}, + {"InvRelTypeForPatitionTables", QT_TR_NOOP("The relationship between the tables `%1' and `%2' can't be created because the first entity is part of a partitioning hierachy! The table `%3' can't be used in `generalization', `copy' and `one-to-one' relationships. In `one-to-many' and `many-to-many' relationships the mentioned table can't be referenced by the generated foreign key(s).")}, + {"InvTableTriggerInsteadOfFiring", QT_TR_NOOP("The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers!")}, + {"InvUsageTruncateOnTrigger", QT_TR_NOOP("The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table!")}, + {"InvUsageInsteadOfOnTrigger", QT_TR_NOOP("The INSTEAD OF mode cannot be used on view triggers that executes for each statement!")}, + {"InvConstrTriggerNotAfterRow", QT_TR_NOOP("Constraint triggers can only be executed on AFTER events and for each row!")}, + {"InvUsageAfterBeforeViewTrigger", QT_TR_NOOP("A view trigger cannot be AFTER/BEFORE when it executes for each row!")}, + {"InvUsageInsteadOfUpdateTrigger", QT_TR_NOOP("A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event!")}, + {"AsgColumnNoParent", QT_TR_NOOP("Assignment of a column which has no parent table to the object `%1' (%2)!")}, + {"InvUseConstraintTriggerAttribs", QT_TR_NOOP("Only constraint triggers can be deferrable or reference another table!")}, + {"RefInvalidFunctionIdTypeConfig", QT_TR_NOOP("Reference to a function id which is incompatible with the user define type configuration!")}, + {"AsgInvalidOpClassObject", QT_TR_NOOP("The operator class assigned to the object `%1' (%2) must use `btree' as indexing method!")}, + {"InvPostgreSQLVersion", QT_TR_NOOP("Unsupported PostgreSQL version (%1) detected! Valid versions are between %2 and %3.")}, + {"//ValidationFailure", QT_TR_NOOP("The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack!")}, + {"ExtensionHandlingTypeImmutable", QT_TR_NOOP("The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified!")}, + {"InvAllocationFKRelationship", QT_TR_NOOP("The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'!")}, + {"AsgInvalidNamePattern", QT_TR_NOOP("Assignement of an invalid object name pattern to the relationship `%1'!")}, + {"RefInvalidNamePatternId", QT_TR_NOOP("Reference to an invalid object name pattern id on the relationship `%1'!")}, + {"InvUsageVariadicParamMode", QT_TR_NOOP("Invalid use of variadic parameter mode! This mode can be used only with an array or \"any\" data type!")}, + {"MixingIncompExportOptions", QT_TR_NOOP("Mixing incompatibles DBMS export modes: `ignore object duplications', `drop database' or `drop objects' cannot be used with `simulate export'!")}, + {"MixingIncompDropOptions", QT_TR_NOOP("Mixing incompatibles DROP options: `drop database' and `drop objects' cannot be used at the same time!")}, + {"InvIdSwapSameObject", QT_TR_NOOP("Invalid object id swapping operation! The objects involved are the same!")}, + {"InvIdSwapInvalidObjectType", QT_TR_NOOP("Invalid object id swapping operation! The database itself, tablespaces or roles cannot have the ids swapped!")}, + {"AsgWidgetAlreadyHasParent", QT_TR_NOOP("The widget already has a parent and cannot be assigned to a different object!")}, + {"ObjectNotImported", QT_TR_NOOP("The object `%1' (%2), oid `%3', could not be imported due to one or more errors! Check the exception stack for more details. `HINT:' if the object somehow references objects in `pg_catalog' or `information_schema' consider enable the importing of system objects.")}, + {"ModelFileNotLoaded", QT_TR_NOOP("Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case.")}, + {"InvColumnTableType", QT_TR_NOOP("The column `%1' cannot reference it's parent table `%2' as data type!")}, + {"OprInvalidElementId", QT_TR_NOOP("Operation with an invalid element id `%1'!")}, + {"RefInvalidElementColorId", QT_TR_NOOP("Reference to an invalid color id `%1' for element `%2'!")}, + {"AsgInvalidObjectType", QT_TR_NOOP("Assignment of an invalid object to `%1' (%2)! The assigned object must be of type `%3'.")}, + {"IncompColumnTypeForSequence", QT_TR_NOOP("The sequence `%1' can't be assigned to the column `%2' because the data type of the latter is incompatible. The type used must be an integer one!")}, + {"InvUsageTempNamesExportOption", QT_TR_NOOP("The option to generate temporary object names can only be used in simulation mode!")}, + {"InvConversionIntegerToSerial", QT_TR_NOOP("It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function or a sequence object must be directly assigned to the column!")}, + {"AsgInvalidEventTriggerVariable", QT_TR_NOOP("Could not assign the variable `%1' to event trigger's filter. Currently, PostgreSQL supports only the `TAG' variable!")}, + {"RowDataNotManipulated", QT_TR_NOOP("Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. \n\n ** Returned error ** \n\n%4")}, + {"MalformedUnescapedValue", QT_TR_NOOP("Malformed unescaped value on row `%1' column `%2'!")}, + {"UndoRedoOperationInvalidObject", QT_TR_NOOP("Trying to undo/redo an invalid operation over an object that does not exists anymore or can't be handled! The operation history will be cleaned up.")}, + {"RequiredFieldsNotFilled", QT_TR_NOOP("The object `%1' (%2) can't be handled because some needed fields are not set! Please, make sure to fill at least the requires fields in order to properly create or update the object.")}, + {"InvRelationshipIdSwap", QT_TR_NOOP("A relationship can only be swapped by other object of the same kind!")}, + {"InvInheritParentTableNotFound", QT_TR_NOOP("A parent table of `%1' which OID is `%2' was not found in the set of imported objects!")}, + {"AsgEnumInvalidChars", QT_TR_NOOP("The enumeration `%1' can't be assigned to the type `%2' because contains invalid characters!")}, + {"AsgEnumLongName", QT_TR_NOOP("The enumeration `%1' can't be assigned to the type `%2' because is too long!")}, + {"ConnectionTimeout", QT_TR_NOOP("The connection was idle for too long and was automatically closed!")}, + {"ConnectionBroken", QT_TR_NOOP("The connection was unexpectedly closed by the database server `%1' at port `%2'!")}, + {"DropCurrentDBDefault", QT_TR_NOOP("Failed to drop the database `%1' because it is defined as the default database for the connection `%2'!")}, + {"NullPrimaryKeyColumn", QT_TR_NOOP("The column `%1' must be `NOT NULL' because it composes the primary key of the table `%2'. You need to remove the column from the mentioned contraint in order to disable the `NOT NULL' on it!")}, + {"InvalidIdentityColumn", QT_TR_NOOP("The identity column `%1' has an invalid data type! The data type must be `smallint', `integer' or `bigint'.")}, + {"RefInvalidAffectedCommand", QT_TR_NOOP("Reference to an invalid affected command in policy `%1'!")}, + {"RefInvalidSpecialRole", QT_TR_NOOP("Reference to an invalid special role in policy `%1'!")}, + {"InvColumnCountPartRel", QT_TR_NOOP("Unable to create a partition relationship because the partion table `%1' is not empty or has columns that are not present on the partitioned table `%2'!")}, + {"InvPartitioningTypePartRel", QT_TR_NOOP("Unable to create a partition relationship between the tables `%1' (partition) and `%2' (partitioned) because no partitioning type is defined on the latter!")}, + {"InvPartitionKeyCount", QT_TR_NOOP("Invalid amount of partition keys being assinged to the table `%1'! Multiples partition keys are allowed only on `HASH' and `RANGE' partitioning strategies.")}, + {"PartKeyObjectInexistsModel", QT_TR_NOOP("A partition key of the table `%1' is referencing the object `%3' (%4) which was not found in the model!")}, + {"AsgInvalidColumnPartitionKey", QT_TR_NOOP("The column `%1' can't be assigned to a partition key because it was created by a relatinship and this kind of operation is not yet supported! HINT: create the column manually on the table and then create the partition key using it.")}, + {"RemColumnRefByPartitionKey", QT_TR_NOOP("The column `%1' on the table `%2' can't be removed because it is being referenced by one or more patition keys!")}, }; Exception::Exception(void) { - configureException(QString(),ERR_CUSTOM,QString(),QString(),-1,QString()); + configureException(QString(),ErrorType::Custom,QString(),QString(),-1,QString()); } Exception::Exception(const QString &msg, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) { - configureException(msg,ERR_CUSTOM, method, file, line, extra_info); + configureException(msg,ErrorType::Custom, method, file, line, extra_info); if(exception) addException(*exception); } @@ -279,8 +278,8 @@ Exception::Exception(ErrorType error_type, const QString &method, const QString /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - configureException(QApplication::translate("Exception",messages[error_type][ERROR_MESSAGE].toStdString().c_str(),"", -1), - error_type, method, file, line, extra_info); + configureException(QApplication::translate("Exception",messages[static_cast(error_type)][ErrorMessage].toStdString().c_str(),"", -1), + error_type, method, file, line, extra_info); if(exception) addException(*exception); } @@ -298,8 +297,8 @@ Exception::Exception(ErrorType error_type, const QString &method, const QString /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - configureException(QApplication::translate("Exception",messages[error_type][ERROR_MESSAGE].toStdString().c_str(),"",-1), - error_type, method, file, line, extra_info); + configureException(QApplication::translate("Exception",messages[static_cast(error_type)][ErrorMessage].toStdString().c_str(),"",-1), + error_type, method, file, line, extra_info); itr=exceptions.begin(); itr_end=exceptions.end(); @@ -314,7 +313,7 @@ Exception::Exception(const QString &msg, const QString &method, const QString &f { vector::iterator itr, itr_end; - configureException(msg,ERR_CUSTOM, method, file, line, extra_info); + configureException(msg,ErrorType::Custom, method, file, line, extra_info); itr=exceptions.begin(); itr_end=exceptions.end(); @@ -355,19 +354,19 @@ QString Exception::getErrorMessage(void) QString Exception::getErrorMessage(ErrorType error_type) { - if(error_type < ERROR_COUNT) + if(static_cast(error_type) < ErrorCount) /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - return(QApplication::translate("Exception",messages[error_type][ERROR_MESSAGE].toStdString().c_str(),"", -1)); + return(QApplication::translate("Exception", messages[static_cast(error_type)][ErrorMessage].toStdString().c_str(), "", -1)); else return(QString()); } QString Exception::getErrorCode(ErrorType error_type) { - if(error_type < ERROR_COUNT) - return(messages[error_type][ERROR_CODE]); + if(static_cast(error_type) < ErrorCount) + return(messages[static_cast(error_type)][ErrorCode]); else return(QString()); } diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 0967dcca5f..0c5d59c144 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -34,276 +34,263 @@ using namespace std; -/* - ErrorType enum format: ERR_[[OPERATION_CODE][ERROR_CODE]] where: - - OPERATION_CODE is composed as: - INS=Insertion - ASG=Assignment - REF=Reference - REM=Removing - RES=Restoration - OBT=Obtaining -*/ - enum ErrorType { - ERR_CUSTOM, - ERR_ASG_PSDTYPE_COLUMN, - ERR_ASG_INV_PRECISION, - ERR_ASG_INV_PREC_TIMESTAMP, - ERR_ASG_NOT_ALOC_COLUMN, - ERR_REF_COLUMN_INV_INDEX, - ERR_ASG_NOT_ALOC_OBJECT, - ERR_ASG_NOT_ALOC_SCHEMA, - ERR_ASG_OBJ_INV_DEFINITION, - ERR_ASG_DUPLIC_OBJECT, - ERR_ASG_DUPL_OBJ_CONTAINER, - ERR_ASG_OBJECT_INV_TYPE, - ERR_REM_OBJ_INVALID_TYPE, - ERR_OBT_OBJ_INVALID_TYPE, - ERR_ASG_EMPTY_NAME_RET_TABLE, - ERR_ASG_DUPLIC_PARAM_FUNCTION, - ERR_INS_DUPLIC_RET_TAB_TYPE, - ERR_REF_PARAM_INV_INDEX, - ERR_REF_INV_TRIGGER_EVENT, - ERR_ASG_INV_COLUMN_TRIGGER, - ERR_ASG_NOT_ALOC_FUNCTION, - ERR_ASG_INV_TRIGGER_FUNCTION, - ERR_ASG_FUNC_INV_PARAM_COUNT, - ERR_ASG_FUNC_INV_LANGUAGE, - ERR_ASG_EVNT_TRIG_FUNC_INV_LANG, - ERR_ASG_NOT_ALOC_TABLE, - ERR_REF_ARG_INV_INDEX, - ERR_ASG_EMPTY_NAME_OBJECT, - ERR_ASG_INV_NAME_OBJECT, - ERR_ASG_LONG_NAME_OBJECT, - ERR_ASG_INV_SCHEMA_OBJECT, - ERR_ASG_INV_TABLESPACE_OBJECT, - ERR_ASG_TABSPC_INV_OBJECT, - ERR_ASG_TABSPC_INV_CONSTR_TYPE, - ERR_ASG_INV_ROLE_OBJECT, - ERR_ASG_ROLE_OBJECT_INV_TYPE, - ERR_ASG_APPSQL_OBJECT_INV_TYPE, - ERR_REF_FUNCTION_INV_TYPE, - ERR_REF_OPER_ARG_INV_TYPE, - ERR_REF_OPER_INV_TYPE, - ERR_ASG_VAL_INV_ROLE_OPT_TYPE, - ERR_REF_INV_ROLE_TYPE, - ERR_INS_DUPLIC_ROLE, - ERR_ROLE_REF_REDUNDANCY, - ERR_ROLE_MEMBER_ITSELF, - ERR_REF_ROLE_INV_INDEX, - ERR_INS_EMPTY_RULE_COMMAND, - ERR_REF_RULE_CMD_INV_INDEX, - ERR_INV_INH_COPY_PART_RELATIONSHIP, - ERR_ASG_OBJ_BELONGS_OTHER_TABLE, - ERR_ASG_SEQ_DIF_TABLE_SCHEMA, - ERR_ASG_INV_VALUE_SEQ_ATTRIBS, - ERR_ASG_INV_SEQ_MIN_VALUE, - ERR_ASG_INV_SEQ_START_VALUE, - ERR_ASG_INV_SEQ_INCR_VALUE, - ERR_ASG_INV_SEQ_CACHE_VALUE, - ERR_ASG_TAB_DIF_SEQ_SCHEMA, - ERR_ASG_SEQ_OWNER_DIF_TABLE, - ERR_ASG_INEXIST_OWNER_COL_SEQ, - ERR_ASG_INV_OWNER_COL_SEQ, - ERR_REF_LABEL_INV_INDEX, - ERR_ALOC_OBJECT_INV_TYPE, - ERR_ASG_FUNCTION_INV_RET_TYPE, - ERR_ASG_FUNCTION_INV_PARAMS, - ERR_ASG_NOT_ALOC_LANGUAGE, - ERR_ASG_INV_LANGUAGE_OBJECT, - ERR_REF_TYPE_INV_INDEX, - ERR_ASG_NULL_TYPE_OBJECT, - ERR_ASG_INV_TYPE_OBJECT, - ERR_ASG_EMPTY_DIR_NAME, - ERR_OBT_TYPES_INV_QUANTITY, - ERR_INS_DUPLIC_ITEMS, - ERR_INS_INV_TYPE_ATTRIB, - ERR_INS_DUPLIC_ENUM_ITEM, - ERR_INS_INV_TYPE_ENUM_ITEM, - ERR_REF_ATTRIB_INV_INDEX, - ERR_REF_ENUM_INV_INDEX, - ERR_ASG_INV_TYPE_CONFIG, - ERR_ASG_INV_OPER_ARGS, - ERR_ASG_INV_OPERATOR_TYPES, - ERR_ASG_RESERVED_NAME, - ERR_USING_INV_FUNC_CONFIG, - ERR_ASG_INV_SUPSTG_NUMBER, - ERR_INS_DUPLIC_ELEMENT, - ERR_REF_ELEM_INV_INDEX, - ERR_REF_OBJ_INV_INDEX, - ERR_REM_NOT_ALOC_OBJECT, - ERR_REM_DIRECT_REFERENCE, - ERR_REM_INDIRECT_REFERENCE, - ERR_OPR_OBJ_INV_TYPE, - ERR_REF_OBJ_INV_TYPE, - ERR_OPR_NOT_ALOC_OBJECT, - ERR_LINK_TABLES_NO_PK, - ERR_NOT_IMPL_REL_TYPE, - ERR_ASG_INV_EXPR_OBJECT, - ERR_ASG_EXISTING_PK_TABLE, - ERR_INV_IDENT_RELATIOSHIP, - ERR_DUPLIC_COLS_COPY_REL, - ERR_INCOMP_COLS_INHERIT_REL, - ERR_INCOMP_CONSTRS_INHERIT_REL, - ERR_ASG_OBJ_INV_REL_TYPE, - ERR_ASG_FOREIGN_KEY_REL, - ERR_REF_OBJ_INEXISTS_MODEL, - ERR_REF_INEXIST_USER_TYPE, - ERR_ASG_INV_MAX_SIZE_OP_LIST, - ERR_FILE_DIR_NOT_WRITTEN, - ERR_FILE_NOT_WRITTER_INV_DEF, - ERR_DUPLIC_RELATIONSHIP, - ERR_INS_REL_GENS_REDUNDACY, - ERR_INVALIDATED_OBJECTS, - ERR_INV_PRIM_KEY_ALOCATION, - ERR_REF_INV_PRIVILEGE_TYPE, - ERR_INS_DUP_ROLE_PERMISSION, - ERR_ASG_INCOMP_PRIV_OBJECT, - ERR_ASG_DUPLIC_PERMISSION, - ERR_PERM_REF_INEXIST_OBJECT, - ERR_ALOC_OBJECT_NO_SCHEMA, - ERR_ASG_DUP_TABLESPACE_DIR, - ERR_ASG_INV_DOMAIN_ARRAY, - ERR_ASG_CODE_FUNC_C_LANGUAGE, - ERR_ASG_FUNC_REFLIB_LANG_NOT_C, - ERR_ASG_INV_COM_OPEERATOR, - ERR_ASG_INV_NEG_OPERATOR, - ERR_USER_TYPE_SELF_REFERENCE, - ERR_ASG_INV_ELEMENT_TYPE, - ERR_ASG_INV_ALIGNMENT_TYPE, - ERR_ASG_INV_NAME_TABLE_RELNN, - ERR_INV_USE_ESPECIAL_PK, - ERR_OPR_REL_INCL_OBJECT, - ERR_REM_PROTECTED_OBJECT, - ERR_REDECL_HL_GROUP, - ERR_DEF_INV_GROUP_DECL, - ERR_DEF_NOT_DECL_GROUP, - ERR_DEF_EMPTY_GROUP, - ERR_DEF_DUPLIC_GROUP, - ERR_GROUP_DECL_NOT_DEFINED, - ERR_REF_COL_OBJTAB_INV_INDEX, - ERR_REF_LIN_OBJTAB_INV_INDEX, - ERR_OPR_RESERVED_OBJECT, - ERR_FUNC_CONFIG_INV_OBJECT, - ERR_SQL_SCOPE_INV_VIEW_REF, - ERR_CONSTR_NO_COLUMNS, - ERR_CONFIG_NOT_LOADED, - ERR_DEFAULT_CONFIG_NOT_REST, - ERR_EXPORT_FAILURE, - ERR_PLUGIN_NOT_LOADED, - ERR_PLUGINS_NOT_LOADED, - ERR_INV_SYNTAX, - ERR_INV_INSTRUCTION, - ERR_UNK_ATTRIBUTE, - ERR_INV_METACHARACTER, - ERR_INV_OPERATOR_IN_EXPR, - ERR_UNDEF_ATTRIB_VALUE, - ERR_INV_ATTRIBUTE, - ERR_ASG_EMPTY_XML_BUFFER, - ERR_FILE_DIR_NOT_ACCESSED, - ERR_ASG_EMPTY_DTD_FILE, - ERR_ASG_EMPTY_DTD_NAME, - ERR_LIBXMLERR, - ERR_OPR_NOT_ALOC_ELEM_TREE, - ERR_LOAD_INV_MODEL_FILE, - ERR_OPR_NOT_ALOC_ELEMENT, - ERR_OPR_INEXIST_ELEMENT, - ERR_ASG_INV_CONN_PARAM, - ERR_OPR_NOT_ALOC_CONN, - ERR_CONNECTION_NOT_CONFIGURED, - ERR_CONNECTION_ALREADY_STABLISHED, - ERR_CONNECTION_NOT_STABLISHED, - ERR_ASG_SQL_RESULT_NOT_ALOC, - ERR_INCOMPREHENSIBLE_DBMS_RESP, - ERR_DBMS_FATAL_ERROR, - ERR_REF_TUPLE_COL_INV_INDEX, - ERR_REF_TUPLE_COL_INV_NAME, - ERR_REF_TUPLE_INEXISTENT, - ERR_REF_INV_TUPLE_COLUMN, - ERR_CMD_SQL_NOT_EXECUTED, - ERR_INV_VIEW_DEF_EXPRESSION, - ERR_ASG_SEC_VIEW_DEF_EXPRESSION, - ERR_MIX_VIEW_DEF_EXPR_REFS, - ERR_ASG_INV_COLLATION_OBJECT, - ERR_PK_USING_COLS_ADDED_BY_REL, - ERR_EMPTY_LOCAL_ATTRIB_COLLATION, - ERR_OBJECT_REFERENCING_ITSELF, - ERR_ASG_INV_OPFAM_OPCLSELEM, - ERR_REF_INV_LIKE_OP_TYPE, - ERR_COPY_REL_TAB_DEFINED, - ERR_PART_REL_PATITIONED_DEFINED, - ERR_INV_REL_TYPE_FOR_PART_TABLES, - ERR_TABLE_TRIG_INSTEADOF_FIRING, - ERR_TRIGGER_INV_TRUNCATE_USAGE, - ERR_TRIGGER_INV_INSTEADOF_USAGE, - ERR_CONST_TRIG_NOT_AFTER_ROW, - ERR_VIEW_TRIG_INV_AFTBFR_USAGE, - ERR_TRIGGER_INV_INSTEADOF_UPDATE, - ERR_ASG_COLUMN_NO_PARENT, - ERR_TRIG_USING_CONSTRIG_ATRIBS, - ERR_REF_FUNCTION_INV_TYPE_CONF, - ERR_ASG_INV_OPCLASS_OBJ, - ERR_INV_POSTGRESQL_VERSION, - ERR_VALIDATION_FAILURE, - ERR_REG_EXT_NOT_HANDLING_TYPE, - ERR_ALOC_INV_FK_RELATIONSHIP, - ERR_ASG_INV_NAME_PATTERN, - ERR_REF_INV_NAME_PATTERN_ID, - ERR_INV_USE_VARIADIC_PARAM_MODE, - ERR_MIX_INCOMP_EXPORT_OPTS, - ERR_MIX_INCOMP_DROP_OPTS, - ERR_INV_ID_SWAP_SAME_OBJECT, - ERR_INV_ID_SWAP_INV_OBJ_TYPE, - ERR_ASG_WGT_ALREADY_HAS_PARENT, - ERR_OBJECT_NOT_IMPORTED, - ERR_MODEL_FILE_NOT_LOADED, - ERR_INV_COLUMN_TABLE_TYPE, - ERR_OPR_INV_ELEMENT_ID, - ERR_REF_ELEMENT_COLOR_ID, - ERR_ASG_INV_OBJECT_TYPE, - ERR_INCOMP_COL_TYPE_FOR_SEQ, - ERR_INV_USE_TMPNAMES_EXPORT_OPT, - ERR_INV_CONV_INTEGER_TO_SERIAL, - ERR_ASG_INV_EVENT_TRIGGER_VARIABLE, - ERR_ROW_DATA_NOT_MANIPULATED, - ERR_MALFORMED_UNESCAPED_VALUE, - ERR_UNDO_REDO_OPR_INV_OBJECT, - ERR_REQ_FIELDS_NOT_FILLED, - ERR_INV_REL_ID_SWAP, - ERR_INV_INH_PARENT_TAB_NOT_FOUND, - ERR_ASG_ENUM_INV_CHARS, - ERR_ASG_ENUM_LONG_NAME, - ERR_CONNECTION_TIMEOUT, - ERR_CONNECTION_BROKEN, - ERR_DROP_CURRDB_DEFAULT, - ERR_NULL_PK_COLUMN, - ERR_INV_IDENTITY_COLUMN, - ERR_REF_INV_AFFECTED_CMD, - ERR_REF_INV_SPECIAL_ROLE, - ERR_INV_COLUMN_COUNT_PART_REL, - ERR_INV_PARTITIONIG_TYPE_PART_REL, - ERR_INV_PARTITION_KEY_COUNT, - ERR_PART_KEY_REF_OBJ_INEXISTS_MODEL, - ERR_ASG_INV_COLUMN_PARTITION_KEY, - ERR_REM_COL_REF_PARTITION_KEY + Custom, + AsgPseudoTypeColumn, + AsgInvalidPrecision, + AsgInvalidPrecisionTimestamp, + AsgNotAllocatedColumn, + RefColumnInvalidIndex, + AsgNotAllocattedObject, + AsgNotAllocatedSchema, + AsgObjectInvalidDefinition, + AsgDuplicatedObject, + AsgDuplicatedObjectContainer, + AsgObjectInvalidType, + RemObjectInvalidType, + ObtObjectInvalidType, + AsgEmptyNameTableReturnType, + AsgDuplicatedParameterFunction, + InsDuplicatedTableReturnType, + RefParameterInvalidIndex, + RefInvalidTriggerEvent, + AsgInvalidColumnTrigger, + AsgNotAllocatedFunction, + AsgInvalidTriggerFunction, + AsgFunctionInvalidParamCount, + AsgFunctionInvalidLanguage, + AsgEventTriggerFuncInvalidLang, + AsgNotAllocatedTable, + RefArgumentInvalidIndex, + AsgEmptyNameObject, + AsgInvalidNameObject, + AsgLongNameObject, + AsgInvalidSchemaObject, + AsgInvalidTablespaceObject, + AsgTablespaceInvalidObject, + AsgTablespaceInvalidConstraintType, + AsgInvalidRoleObject, + AsgRoleObjectInvalidType, + AsgCustomSQLObjectInvalidType, + RefFunctionInvalidType, + RefOperatorArgumentInvalidType, + RefOperatorInvalidType, + AsgValueInvalidRoleOptionType, + RefInvalidRoleType, + InsDuplicatedRole, + AsgRoleReferenceRedundancy, + AsgRoleMemberItself, + RefRoleInvalidIndex, + InsEmptyRuleCommand, + RefRuleCommandInvalidIndex, + InvInheritCopyPartRelationship, + AsgObjectBelongsAnotherTable, + AsgSchemaSequenceDiffersTableSchema, + AsgInvalidValueSequenceAttributes, + AsgInvalidSequenceMinValue, + AsgInvalidSequenceStartValue, + AsgInvalidSequenceIncrementValue, + AsgInvalidSequenceCacheValue, + AsgSeqOwnerTableDifferentSchema, + AsgSeqOwnerTableDifferentRole, + AsgInexistentSeqOwnerColumn, + AsgInvalidSeqOwnerColumn, + RefLabelInvalidIndex, + AllocationObjectInvalidType, + AsgFunctionInvalidReturnType, + AsgFunctionInvalidParameters, + AsgNotAllocatedLanguage, + AsgInvalidLanguageObject, + RefTypeInvalidIndex, + AsgNullTypeObject, + AsgInvalidTypeObject, + AsgEmptyDirectoryName, + ObtTypesInvalidQuantity, + InsDuplicatedItems, + InsInvalidTypeAttribute, + InsDuplicatedEnumerationItem, + InsInvalidEnumerationItem, + RefAttributeInvalidIndex, + RefEnumerationInvalidIndex, + AsgInvalidTypeConfiguration, + AsgInvalidOperatorArguments, + AsgInvalidOperatorTypes, + AsgReservedName, + AsgFunctionInvalidConfiguration, + AsgInvalidSupportStrategyNumber, + InsDuplicatedElement, + RefElementInvalidIndex, + RefObjectInvalidIndex, + RemNotAllocatedObject, + RemDirectReference, + RemInderectReference, + OprObjectInvalidType, + RefObjectInvalidType, + OprNotAllocatedObject, + InvLinkTablesNoPrimaryKey, + NotImplementedRelationshipType, + AsgInvalidExpressionObject, + AsgExistingPrimaryKeyTable, + InvIdentifierRelationship, + InvCopyRelationshipDuplicCols, + InvInheritRelationshipIncompCols, + InvInheritRelationshipIncompConstrs, + AsgObjectInvalidRelationshipType, + AsgForeignKeyRelationship, + RefObjectInexistsModel, + RefUserTypeInexistsModel, + AsgInvalidMaxSizeOpList, + FileDirectoryNotWritten, + FileNotWrittenInvalidDefinition, + InsDuplicatedRelationship, + InsRelationshipRedundancy, + RemInvalidatedObjects, + InvPrimaryKeyAllocation, + RefInvalidPrivilegeType, + InsDuplicatedRolePermission, + AsgInvalidPrivilegeObject, + AsgDuplicatedPermission, + PermissionRefInexistObject, + InvObjectAllocationNoSchema, + AsgTablespaceDuplicatedDirectory, + AsgInvalidDomainArray, + AsgSourceCodeFuncCLanguage, + AsgRefLibraryFuncLanguageNotC, + AsgInvalidCommutatorOperator, + AsgInvalidNegatorOperator, + InvUserTypeSelfReference, + AsgInvalidElementType, + AsgInvalidAlignmentType, + AsgInvalidNameTableRelNN, + InvUseSpecialPrimaryKey, + OprRelationshipAddedObject, + RemProtectedObject, + InvRedeclarationGroup, + InvGroupDeclaration, + DefNotDeclaredGroup, + DefEmptyGroup, + DefDuplicatedGroup, + InvGroupDeclarationNotDefined, + RefColObjectTabInvalidIndex, + RefRowObjectTabInvalidIndex, + OprReservedObject, + InvFuncConfigInvalidatesObject, + InvSQLScopeViewReference, + InvConstratintNoColumns, + ConfigurationNotLoaded, + DefaultConfigNotRestored, + ExportFailure, + PluginNotLoaded, + PluginsNotLoaded, + InvalidSyntax, + InvalidInstruction, + UnkownAttribute, + InvalidMetacharacter, + InvalidOperatorInExpression, + UndefinedAttributeValue, + InvalidAttribute, + AsgEmptyXMLBuffer, + FileDirectoryNotAccessed, + AsgEmptyDTDFile, + AsgEmptyDTDName, + LibXMLError, + OprNotAllocatedElementTree, + InvModelFileNotLoaded, + OprNotAllocatedElement, + OprInexistentElement, + AsgInvalidConnParameter, + OprNotAllocatedConnection, + ConnectionNotConfigured, + ConnectionAlreadyStablished, + ConnectionNotStablished, + AsgNotAllocatedSQLResult, + IncomprehensibleDBMSResponse, + DBMSFatalError, + RefTupleColumnInvalidIndex, + RefTupleColumnInvalidName, + RefInvalidTuple, + RefInvalidTupleColumn, + SQLCommandNotExecuted, + AsgInvalidViewDefExpression, + AsgSecondViewDefExpression, + MixingViewDefExprsReferences, + AsgInvalidCollationObject, + UnsupportedPKColsAddedByRel, + EmptyLCCollationAttributes, + ObjectReferencingItself, + AsgInvalidOpFamilyOpClassElem, + RefInvalidLikeOptionType, + InvCopyRelTableDefined, + InvPartRelPartitionedDefined, + InvRelTypeForPatitionTables, + InvTableTriggerInsteadOfFiring, + InvUsageTruncateOnTrigger, + InvUsageInsteadOfOnTrigger, + InvConstrTriggerNotAfterRow, + InvUsageAfterBeforeViewTrigger, + InvUsageInsteadOfUpdateTrigger, + AsgColumnNoParent, + InvUseConstraintTriggerAttribs, + RefInvalidFunctionIdTypeConfig, + AsgInvalidOpClassObject, + InvPostgreSQLVersion, + ValidationFailure, + ExtensionHandlingTypeImmutable, + InvAllocationFKRelationship, + AsgInvalidNamePattern, + RefInvalidNamePatternId, + InvUsageVariadicParamMode, + MixingIncompExportOptions, + MixingIncompDropOptions, + InvIdSwapSameObject, + InvIdSwapInvalidObjectType, + AsgWidgetAlreadyHasParent, + ObjectNotImported, + ModelFileNotLoaded, + InvColumnTableType, + OprInvalidElementId, + RefInvalidElementColorId, + AsgInvalidObjectType, + IncompColumnTypeForSequence, + InvUsageTempNamesExportOption, + InvConversionIntegerToSerial, + AsgInvalidEventTriggerVariable, + RowDataNotManipulated, + MalformedUnescapedValue, + UndoRedoOperationInvalidObject, + RequiredFieldsNotFilled, + InvRelationshipIdSwap, + InvInheritParentTableNotFound, + AsgEnumInvalidChars, + AsgEnumLongName, + ConnectionTimeout, + ConnectionBroken, + DropCurrentDBDefault, + NullPrimaryKeyColumn, + InvalidIdentityColumn, + RefInvalidAffectedCommand, + RefInvalidSpecialRole, + InvColumnCountPartRel, + InvPartitioningTypePartRel, + InvPartitionKeyCount, + PartKeyObjectInexistsModel, + AsgInvalidColumnPartitionKey, + RemColumnRefByPartitionKey }; class Exception { private: - static const int ERROR_COUNT=241; + static constexpr int ErrorCount=241; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ vector exceptions; //! \brief Stores the error messages and codes (names of errors) in string format - static QString messages[ERROR_COUNT][2]; + static QString messages[ErrorCount][2]; //! \brief Constants used to access the error details - static const unsigned ERROR_CODE=0, - ERROR_MESSAGE=1; + static constexpr unsigned ErrorCode=0, ErrorMessage=1; //! \brief Error type related to the exception ErrorType error_type; diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index 3e62d69063..e815eec4bb 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -22,118 +22,118 @@ namespace GlobalAttributes { const QString - PGMODELER_APP_NAME=QString("pgmodeler"), - PGMODELER_URI=QString("pgmodeler.io"), + PgModelerAppName=QString("pgmodeler"), + PgModelerURI=QString("pgmodeler.io"), PGMODELER_REVERSE_URI=QString("io.pgmodeler"), - PGMODELER_VERSION=QString("0.9.2-alpha1"), - PGMODELER_BUILD_NUMBER=QString(BUILDNUM), - PGMODELER_SITE=QString("https://pgmodeler.io"), - PGMODELER_SUPPORT=QString("https://pgmodeler.io/support/docs"), - PGMODELER_SRC_URL=QString("https://github.com/pgmodeler/pgmodeler/releases"), - PGMODELER_DOWNLOAD_URL=QString("%1/download").arg(PGMODELER_SITE), - PGMODELER_DONATE_URL=QString("%1/#donationForm").arg(PGMODELER_SITE), - PGMODELER_UPD_CHECK_URL=QString("%1/checkupdate?version=").arg(PGMODELER_SITE), - - BUG_REPORT_EMAIL=QString("bug@pgmodeler.io"), - BUG_REPORT_FILE=QString("pgmodeler%1.bug"), - STACKTRACE_FILE=QString(".stacktrace"), - - DIR_SEPARATOR=QString("/"), - DEFAULT_CONFS_DIR=QString("defaults"), - CONFS_BACKUPS_DIR=QString("backups"), - SCHEMAS_DIR=QString("schemas"), - SQL_SCHEMA_DIR=QString("sql"), - XML_SCHEMA_DIR=QString("xml"), - ALTER_SCHEMA_DIR=QString("alter"), - SCHEMA_EXT=QString(".sch"), - OBJECT_DTD_DIR=QString("dtd"), - OBJECT_DTD_EXT=QString(".dtd"), - ROOT_DTD=QString("dbmodel"), - METADATA_DTD=QString("metadata"), - CONFIGURATION_EXT=QString(".conf"), - HIGHLIGHT_FILE_SUF=QString("-highlight"), - - CODE_HIGHLIGHT_CONF=QString("source-code-highlight"), - OBJECTS_STYLE_CONF=QString("objects-style"), - GENERAL_CONF=QString("pgmodeler"), - CONNECTIONS_CONF=QString("connections"), - RELATIONSHIPS_CONF=QString("relationships"), - SNIPPETS_CONF=QString("snippets"), - SQL_HISTORY_CONF=QString("sql-history"), - - SQL_HIGHLIGHT_CONF=QString("sql-highlight"), - XML_HIGHLIGHT_CONF=QString("xml-highlight"), - PATTERN_HIGHLIGHT_CONF=QString("pattern-highlight"), - - EXAMPLE_MODEL=QString("example.dbm"), - UI_STYLE_CONF=QString("ui-style"), - - DEFAULT_QT_STYLE=QString("Fusion"), - UI_STYLE_OPT=QString("-style"), - - SCHEMAS_ROOT_DIR=getPathFromEnv(QString("PGMODELER_SCHEMAS_DIR"), QString(SCHEMASDIR), QString("./schemas")), - LANGUAGES_DIR=getPathFromEnv(QString("PGMODELER_LANG_DIR"), QString(LANGDIR), QString("./lang")), - SAMPLES_DIR=getPathFromEnv(QString("PGMODELER_SAMPLES_DIR"), QString(SAMPLESDIR), QString("./samples")), - TMPL_CONFIGURATIONS_DIR=getPathFromEnv(QString("PGMODELER_TMPL_CONF_DIR"), QString(CONFDIR), QString("./conf")), + PgModelerVersion=QString("0.9.2-alpha1"), + PgModelerBuildNumber=QString(BUILDNUM), + PgModelerSite=QString("https://pgmodeler.io"), + PgModelerSupport=QString("https://pgmodeler.io/support/docs"), + PgModelerSourceURL=QString("https://github.com/pgmodeler/pgmodeler/releases"), + PgModelerDownloadURL=QString("%1/download").arg(PgModelerSite), + PgModelerDonateURL=QString("%1/#donationForm").arg(PgModelerSite), + PgModelerUpdateCheckURL=QString("%1/checkupdate?version=").arg(PgModelerSite), + + BugReportEmail=QString("bug@pgmodeler.io"), + BugReportFile=QString("pgmodeler%1.bug"), + StacktraceFile=QString(".stacktrace"), + + DirSeparator=QString("/"), + DefaultConfsDir=QString("defaults"), + ConfsBackupsDir=QString("backups"), + SchemasDir=QString("schemas"), + SQLSchemaDir=QString("sql"), + XMLSchemaDir=QString("xml"), + AlterSchemaDir=QString("alter"), + SchemaExt=QString(".sch"), + ObjectDTDDir=QString("dtd"), + ObjectDTDExt=QString(".dtd"), + RootDTD=QString("dbmodel"), + MetadataDTD=QString("metadata"), + ConfigurationExt=QString(".conf"), + HighlightFileSuffix=QString("-highlight"), + + CodeHighlightConf=QString("source-code-highlight"), + ObjectsStyleConf=QString("objects-style"), + GeneralConf=QString("pgmodeler"), + ConnectionsConf=QString("connections"), + RelationshipsConf=QString("relationships"), + SnippetsConf=QString("snippets"), + SQLHistoryConf=QString("sql-history"), + + SQLHighlightConf=QString("sql-highlight"), + XMLHighlightConf=QString("xml-highlight"), + PatternHighlightConf=QString("pattern-highlight"), + + ExampleModel=QString("example.dbm"), + UiStyleConf=QString("ui-style"), + + DefaultQtStyle=QString("Fusion"), + UiStyleOption=QString("-style"), + + SchemasRootDir=getPathFromEnv(QString("PGMODELER_SCHEMAS_DIR"), QString(SCHEMASDIR), QString("./schemas")), + LanguagesDir=getPathFromEnv(QString("PGMODELER_LANG_DIR"), QString(LANGDIR), QString("./lang")), + SamplesDir=getPathFromEnv(QString("PGMODELER_SAMPLES_DIR"), QString(SAMPLESDIR), QString("./samples")), + TmplConfigurationDir=getPathFromEnv(QString("PGMODELER_TMPL_CONF_DIR"), QString(CONFDIR), QString("./conf")), //Currently, plugins folder is auto-created when missing so it can't be resolved by getPathFromEnv() - PLUGINS_DIR=getenv("PGMODELER_PLUGINS_DIR") ? QString(getenv("PGMODELER_PLUGINS_DIR")).replace('\\','/') : QString(PLUGINSDIR), + PluginsDir=getenv("PGMODELER_PLUGINS_DIR") ? QString(getenv("PGMODELER_PLUGINS_DIR")).replace('\\','/') : QString(PLUGINSDIR), #if defined(Q_OS_MAC) - CONFIGURATIONS_DIR=getPathFromEnv(QString("PGMODELER_CONF_DIR"), + ConfigurationsDir=getPathFromEnv(QString("PGMODELER_CONF_DIR"), QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1").arg(PGMODELER_REVERSE_URI)), - TEMPORARY_DIR=getPathFromEnv(QString("PGMODELER_TMP_DIR"), + TemporaryDir=getPathFromEnv(QString("PGMODELER_TMP_DIR"), QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1/tmp").arg(PGMODELER_REVERSE_URI)), #elif defined(Q_OS_LINUX) - CONFIGURATIONS_DIR=getPathFromEnv(QString("PGMODELER_CONF_DIR"), - QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1").arg(PGMODELER_APP_NAME)), + ConfigurationsDir=getPathFromEnv(QString("PGMODELER_CONF_DIR"), + QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1").arg(PgModelerAppName)), - TEMPORARY_DIR=getPathFromEnv(QString("PGMODELER_TMP_DIR"), - QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1/tmp").arg(PGMODELER_APP_NAME)), + TemporaryDir=getPathFromEnv(QString("PGMODELER_TMP_DIR"), + QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1/tmp").arg(PgModelerAppName)), #else - CONFIGURATIONS_DIR=getPathFromEnv(QString("PGMODELER_CONF_DIR"), + ConfigurationsDir=getPathFromEnv(QString("PGMODELER_CONF_DIR"), QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QString("/%1").arg(PGMODELER_APP_NAME)), - TEMPORARY_DIR=getPathFromEnv(QString("PGMODELER_TMP_DIR"), + TemporaryDir=getPathFromEnv(QString("PGMODELER_TMP_DIR"), QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QString("/%1/tmp").arg(PGMODELER_APP_NAME)), #endif - SQL_HIGHLIGHT_CONF_PATH=CONFIGURATIONS_DIR + DIR_SEPARATOR + SQL_HIGHLIGHT_CONF + CONFIGURATION_EXT, - XML_HIGHLIGHT_CONF_PATH=CONFIGURATIONS_DIR + DIR_SEPARATOR + XML_HIGHLIGHT_CONF + CONFIGURATION_EXT, + SQLHighlightConfPath=ConfigurationsDir + DirSeparator + SQLHighlightConf + ConfigurationExt, + XMLHighlightConfPath=ConfigurationsDir + DirSeparator + XMLHighlightConf + ConfigurationExt, #if defined(Q_OS_UNIX) #if defined(Q_OS_MAC) //For MacOSX the crash handler path is fixed (inside bundle) - PGMODELER_CHANDLER_PATH=getPathFromEnv(QString("PGMODELER_CHANDLER_PATH"), + PgModelerCHandlerPath=getPathFromEnv(QString("PGMODELER_CHANDLER_PATH"), QString(BINDIR) + QString("/pgmodeler-ch"), QString("./pgmodeler-ch")), #else - PGMODELER_CHANDLER_PATH=getPathFromEnv(QString("PGMODELER_CHANDLER_PATH"), + PgModelerCHandlerPath=getPathFromEnv(QString("PGMODELER_CHANDLER_PATH"), QString(PRIVATEBINDIR) + QString("/pgmodeler-ch"), QString("./pgmodeler-ch")), #endif - PGMODELER_CLI_PATH=getPathFromEnv(QString("PGMODELER_CLI_PATH"), + PgModelerCLIPath=getPathFromEnv(QString("PGMODELER_CLI_PATH"), QString(BINDIR) + QString("/pgmodeler-cli"), QString("./pgmodeler-cli")), - PGMODELER_APP_PATH=getPathFromEnv(QString("PGMODELER_APP_PATH"), + PgModelerAppPath=getPathFromEnv(QString("PGMODELER_APP_PATH"), QString(BINDIR) + QString("/pgmodeler"), QString("./pgmodeler")); #else - PGMODELER_CHANDLER_PATH=getPathFromEnv(QString("PGMODELER_CHANDLER_PATH"), + PgModelerCHandlerPath=getPathFromEnv(QString("PGMODELER_CHANDLER_PATH"), QString(PRIVATEBINDIR) + QString("\\pgmodeler-ch.exe"), QString(".\\pgmodeler-ch.exe")), - PGMODELER_CLI_PATH=getPathFromEnv(QString("PGMODELER_CLI_PATH"), + PgModelerCLIPath=getPathFromEnv(QString("PGMODELER_CLI_PATH"), QString(PRIVATEBINDIR) + QString("\\pgmodeler-cli.exe"), QString(".\\pgmodeler-cli.exe")), - PGMODELER_APP_PATH=getPathFromEnv(QString("PGMODELER_APP_PATH"), + PgModelerAppPath=getPathFromEnv(QString("PGMODELER_APP_PATH"), QString(BINDIR) + QString("\\pgmodeler.exe"), QString(".\\pgmodeler.exe")); @@ -141,7 +141,7 @@ namespace GlobalAttributes { #ifdef DEMO_VERSION //Maximum object creation counter for demo version - const unsigned MAX_OBJECT_COUNT=15; + const unsigned MaxObjectCount=15; #endif diff --git a/libutils/src/globalattributes.h b/libutils/src/globalattributes.h index 3127fc6c63..2349e4f272 100644 --- a/libutils/src/globalattributes.h +++ b/libutils/src/globalattributes.h @@ -38,58 +38,58 @@ namespace GlobalAttributes { extern const QString - PGMODELER_APP_NAME, - PGMODELER_URI, - PGMODELER_VERSION, - PGMODELER_BUILD_NUMBER, - PGMODELER_SITE, - PGMODELER_SUPPORT, - PGMODELER_SRC_URL, - PGMODELER_DOWNLOAD_URL, - PGMODELER_DONATE_URL, - PGMODELER_UPD_CHECK_URL, - - BUG_REPORT_EMAIL, - BUG_REPORT_FILE, - STACKTRACE_FILE, - - DIR_SEPARATOR, - DEFAULT_CONFS_DIR, //! \brief Directory name which holds the default pgModeler configuration - CONFS_BACKUPS_DIR, //! \brief Directory name which holds the pgModeler configuration backups - SCHEMAS_DIR, //! \brief Default name for the schemas directory - SQL_SCHEMA_DIR, //! \brief Default name for the sql schemas directory - XML_SCHEMA_DIR, //! \brief Default name for the xml schemas directory - ALTER_SCHEMA_DIR, //! \brief Default name for the alter schemas directory - SCHEMA_EXT, //! \brief Default extension for schema files - OBJECT_DTD_DIR, //! \brief Default directory for dtd files - OBJECT_DTD_EXT, //! \brief Default extension for dtd files - ROOT_DTD, //! \brief Root DTD of model xml files - METADATA_DTD, //! \brief Root DTD of objects metadata xml files - CONFIGURATION_EXT, //! \brief Default extension for configuration files - HIGHLIGHT_FILE_SUF, //! \brief Suffix of language highlight configuration files - - CODE_HIGHLIGHT_CONF, //! \brief Default name for the language highlight dtd - OBJECTS_STYLE_CONF, //! \brief Default name for the object style configuration file - GENERAL_CONF, //! \brief Default name for the general pgModeler configuration - CONNECTIONS_CONF, //! \brief Default name for the DBMS connection configuration file - RELATIONSHIPS_CONF, //! \brief Default name for the relationships configuration file - SNIPPETS_CONF, //! \brief Default name for the code snippets configuration file - - SQL_HIGHLIGHT_CONF, //! \brief Configuration file for SQL language highlight - XML_HIGHLIGHT_CONF, //! \brief Configuration file for XML language highlight - PATTERN_HIGHLIGHT_CONF, //! \brief Configuration file for name patterns highlight (relationship editing form) - SQL_HISTORY_CONF, //! \brief Default name for the SQL commands history configuration file - - EXAMPLE_MODEL, //! \brief Default name for the sample model loaded on appearence configuration form - UI_STYLE_CONF, //! \brief Configuration file ui style + PgModelerAppName, + PgModelerURI, + PgModelerVersion, + PgModelerBuildNumber, + PgModelerSite, + PgModelerSupport, + PgModelerSourceURL, + PgModelerDownloadURL, + PgModelerDonateURL, + PgModelerUpdateCheckURL, + + BugReportEmail, + BugReportFile, + StacktraceFile, + + DirSeparator, + DefaultConfsDir, //! \brief Directory name which holds the default pgModeler configuration + ConfsBackupsDir, //! \brief Directory name which holds the pgModeler configuration backups + SchemasDir, //! \brief Default name for the schemas directory + SQLSchemaDir, //! \brief Default name for the sql schemas directory + XMLSchemaDir, //! \brief Default name for the xml schemas directory + AlterSchemaDir, //! \brief Default name for the alter schemas directory + SchemaExt, //! \brief Default extension for schema files + ObjectDTDDir, //! \brief Default directory for dtd files + ObjectDTDExt, //! \brief Default extension for dtd files + RootDTD, //! \brief Root DTD of model xml files + MetadataDTD, //! \brief Root DTD of objects metadata xml files + ConfigurationExt, //! \brief Default extension for configuration files + HighlightFileSuffix, //! \brief Suffix of language highlight configuration files + + CodeHighlightConf, //! \brief Default name for the language highlight dtd + ObjectsStyleConf, //! \brief Default name for the object style configuration file + GeneralConf, //! \brief Default name for the general pgModeler configuration + ConnectionsConf, //! \brief Default name for the DBMS connection configuration file + RelationshipsConf, //! \brief Default name for the relationships configuration file + SnippetsConf, //! \brief Default name for the code snippets configuration file + + SQLHighlightConf, //! \brief Configuration file for SQL language highlight + XMLHighlightConf, //! \brief Configuration file for XML language highlight + PatternHighlightConf, //! \brief Configuration file for name patterns highlight (relationship editing form) + SQLHistoryConf, //! \brief Default name for the SQL commands history configuration file + + ExampleModel, //! \brief Default name for the sample model loaded on appearence configuration form + UiStyleConf, //! \brief Configuration file ui style /*! \brief Fusion is the default widget style for pgModeler. User can change this by calling the executable using -style option. This same style is applied to crash handler. */ - DEFAULT_QT_STYLE, - UI_STYLE_OPT; + DefaultQtStyle, + UiStyleOption; - /*! \brief Variables used to reference the pgModeler directories. + /*! \brief Environment variables used to reference the pgModeler directories. PGMODELER_SCHEMAS_DIR --> "schemas" folder (SQL/XML generation schema files) PGMODELER_CONF_DIR --> "conf" folder (user's own settings for pgModeler) @@ -107,22 +107,22 @@ namespace GlobalAttributes { PGMDOELER_APP_PATH --> Full path to pgmodeler executable */ extern const QString - SCHEMAS_ROOT_DIR, - LANGUAGES_DIR, - PLUGINS_DIR, - TEMPORARY_DIR, - SAMPLES_DIR, - TMPL_CONFIGURATIONS_DIR, - CONFIGURATIONS_DIR, - SQL_HIGHLIGHT_CONF_PATH, - XML_HIGHLIGHT_CONF_PATH, - PGMODELER_CHANDLER_PATH, - PGMODELER_CLI_PATH, - PGMODELER_APP_PATH; + SchemasRootDir, + LanguagesDir, + PluginsDir, + TemporaryDir, + SamplesDir, + TmplConfigurationDir, + ConfigurationsDir, + SQLHighlightConfPath, + XMLHighlightConfPath, + PgModelerCHandlerPath, + PgModelerCLIPath, + PgModelerAppPath; #ifdef DEMO_VERSION //Maximum object creation counter for demo version - extern const unsigned MAX_OBJECT_COUNT; + extern const unsigned MaxObjectCount; #endif /*! \brief Returns the current value for an environment variable. If the current value is a path and the same does not diff --git a/libutils/src/pgsqlversions.cpp b/libutils/src/pgsqlversions.cpp index 167da71b57..4620acecdc 100644 --- a/libutils/src/pgsqlversions.cpp +++ b/libutils/src/pgsqlversions.cpp @@ -20,22 +20,22 @@ namespace PgSQLVersions { const QString - PGSQL_VERSION_90=QString("9.0"), - PGSQL_VERSION_91=QString("9.1"), - PGSQL_VERSION_92=QString("9.2"), - PGSQL_VERSION_93=QString("9.3"), - PGSQL_VERSION_94=QString("9.4"), - PGSQL_VERSION_95=QString("9.5"), - PGSQL_VERSION_96=QString("9.6"), - PGSQL_VERSION_100=QString("10.0"), - PGSQL_VERSION_110=QString("11.0"), - DEFAULT_VERSION=PGSQL_VERSION_110; + PgSQLVersion90=QString("9.0"), + PgSQLVersion91=QString("9.1"), + PgSQLVersion92=QString("9.2"), + PgSQLVersion93=QString("9.3"), + PgSQLVersion94=QString("9.4"), + PgSQLVersion95=QString("9.5"), + PgSQLVersion96=QString("9.6"), + PgSQLVersion100=QString("10.0"), + PgSQLVersion110=QString("11.0"), + DefaulVersion=PgSQLVersion110; const QStringList - ALL_VERSIONS={ - PGSQL_VERSION_110, PGSQL_VERSION_100, - PGSQL_VERSION_96, PGSQL_VERSION_95, - PGSQL_VERSION_94, PGSQL_VERSION_93, - PGSQL_VERSION_92, PGSQL_VERSION_91, - PGSQL_VERSION_90 }; + AllVersions={ + PgSQLVersion110, PgSQLVersion100, + PgSQLVersion96, PgSQLVersion95, + PgSQLVersion94, PgSQLVersion93, + PgSQLVersion92, PgSQLVersion91, + PgSQLVersion90 }; } diff --git a/libutils/src/pgsqlversions.h b/libutils/src/pgsqlversions.h index 694c00dd02..1dafacd0bf 100644 --- a/libutils/src/pgsqlversions.h +++ b/libutils/src/pgsqlversions.h @@ -30,18 +30,18 @@ namespace PgSQLVersions { extern const QString - PGSQL_VERSION_90, - PGSQL_VERSION_91, - PGSQL_VERSION_92, - PGSQL_VERSION_93, - PGSQL_VERSION_94, - PGSQL_VERSION_95, - PGSQL_VERSION_96, - PGSQL_VERSION_100, - PGSQL_VERSION_110, - DEFAULT_VERSION; + PgSQLVersion90, + PgSQLVersion91, + PgSQLVersion92, + PgSQLVersion93, + PgSQLVersion94, + PgSQLVersion95, + PgSQLVersion96, + PgSQLVersion100, + PgSQLVersion110, + DefaulVersion; - extern const QStringList ALL_VERSIONS; + extern const QStringList AllVersions; } #endif diff --git a/main-cli/src/main.cpp b/main-cli/src/main.cpp index ba1d6185ba..983d6fd34b 100644 --- a/main-cli/src/main.cpp +++ b/main-cli/src/main.cpp @@ -36,7 +36,7 @@ int main(int argc, char **argv) PgModelerCLI pgmodeler_cli(argc, argv); //Tries to load the ui translation according to the system's locale - translator.load(QLocale::system().name(), GlobalAttributes::LANGUAGES_DIR); + translator.load(QLocale::system().name(), GlobalAttributes::LanguagesDir); //Installs the translator on the application pgmodeler_cli.installTranslator(&translator); @@ -49,7 +49,7 @@ int main(int argc, char **argv) out << endl; out << e.getExceptionsText(); out << QString("** pgmodeler-cli aborted due to critical error(s). **") << endl << endl; - return(e.getErrorType()==ERR_CUSTOM ? -1 : e.getErrorType()); + return(e.getErrorType()==Custom ? -1 : e.getErrorType()); } #endif } diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 9b22b109ff..c4cf12dcaa 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -122,13 +122,13 @@ PgModelerCLI::PgModelerCLI(int argc, char **argv) : QApplication(argc, argv) //Raises an error if the option is not recognized if(!isOptionRecognized(op, accepts_val)) - throw Exception(trUtf8("Unrecognized option '%1'.").arg(op), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Unrecognized option '%1'.").arg(op), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the value is empty and the option accepts a value if(accepts_val && value.isEmpty()) - throw Exception(trUtf8("Value not specified for option '%1'.").arg(op), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Value not specified for option '%1'.").arg(op), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!accepts_val && !value.isEmpty()) - throw Exception(trUtf8("Option '%1' does not accept values.").arg(op), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Option '%1' does not accept values.").arg(op), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); opts[op]=value; } @@ -218,7 +218,7 @@ void PgModelerCLI::configureConnection(bool extra_conn) { if(!connections.count(parsed_opts[CONN_ALIAS + chr])) throw Exception(trUtf8("Connection aliased as '%1' was not found in the configuration file.").arg(parsed_opts[CONN_ALIAS + chr]), - ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Make a copy of the named connection *conn = (*connections[parsed_opts[CONN_ALIAS + chr]]); @@ -366,7 +366,7 @@ bool PgModelerCLI::isOptionRecognized(QString &op, bool &accepts_val) void PgModelerCLI::showMenu(void) { out << endl; - out << QString("pgModeler ") << GlobalAttributes::PGMODELER_VERSION << trUtf8(" command line interface.") << endl; + out << QString("pgModeler ") << GlobalAttributes::PgModelerVersion << trUtf8(" command line interface.") << endl; out << trUtf8("PostgreSQL Database Modeler Project - pgmodeler.io") << endl; out << trUtf8("Copyright 2006-2018 Raphael A. Silva ") << endl; out << endl; @@ -390,7 +390,7 @@ void PgModelerCLI::showMenu(void) out << trUtf8(" %1, %2\t\t\t Show this help menu.").arg(short_opts[HELP]).arg(HELP) << endl; out << endl; out << trUtf8("Connection options: ") << endl; - out << trUtf8(" %1, %2\t\t List available connections in file %3.").arg(short_opts[LIST_CONNS]).arg(LIST_CONNS).arg(GlobalAttributes::CONNECTIONS_CONF + GlobalAttributes::CONFIGURATION_EXT) << endl; + out << trUtf8(" %1, %2\t\t List available connections in file %3.").arg(short_opts[LIST_CONNS]).arg(LIST_CONNS).arg(GlobalAttributes::ConnectionsConf + GlobalAttributes::ConfigurationExt) << endl; out << trUtf8(" %1, %2 [ALIAS]\t Connection configuration alias to be used.").arg(short_opts[CONN_ALIAS]).arg(CONN_ALIAS) << endl; out << trUtf8(" %1, %2 [HOST]\t\t PostgreSQL host in which a task will operate.").arg(short_opts[HOST]).arg(HOST) << endl; out << trUtf8(" %1, %2 [PORT]\t\t PostgreSQL host listening port.").arg(short_opts[PORT]).arg(PORT) << endl; @@ -510,54 +510,54 @@ void PgModelerCLI::parseOptions(attribs_map &opts) zoom=opts[ZOOM_FACTOR].toDouble()/static_cast(100); if(other_modes_cnt==0 && mode_cnt==0) - throw Exception(trUtf8("No operation mode was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No operation mode was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if((mode_cnt > 0 && (fix_model || upd_mime || import_db || diff)) || (mode_cnt==0 && other_modes_cnt > 1)) - throw Exception(trUtf8("Export, fix model, import database, diff and update mime operations can't be used at the same time!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Export, fix model, import database, diff and update mime operations can't be used at the same time!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!fix_model && !upd_mime && mode_cnt > 1) - throw Exception(trUtf8("Multiple export mode was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Multiple export mode was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!upd_mime && !import_db && !diff && opts[INPUT].isEmpty()) - throw Exception(trUtf8("No input file was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No input file was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(import_db && opts[INPUT_DB].isEmpty()) - throw Exception(trUtf8("No input database was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No input database was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts.count(EXPORT_TO_DBMS) && !upd_mime && !diff && opts[OUTPUT].isEmpty()) - throw Exception(trUtf8("No output file was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No output file was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts.count(EXPORT_TO_DBMS) && !upd_mime && !import_db && !opts[INPUT].isEmpty() && !opts[OUTPUT].isEmpty() && QFileInfo(opts[INPUT]).absoluteFilePath() == QFileInfo(opts[OUTPUT]).absoluteFilePath()) - throw Exception(trUtf8("Input file must be different from output!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Input file must be different from output!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opts.count(EXPORT_TO_DBMS) && !opts.count(CONN_ALIAS) && (!opts.count(HOST) || !opts.count(USER) || !opts.count(PASSWD) || !opts.count(INITIAL_DB)) ) - throw Exception(trUtf8("Incomplete connection information!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Incomplete connection information!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opts.count(EXPORT_TO_PNG) && (zoom < ModelWidget::MINIMUM_ZOOM || zoom > ModelWidget::MAXIMUM_ZOOM)) - throw Exception(trUtf8("Invalid zoom specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Invalid zoom specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(upd_mime && opts[DBM_MIME_TYPE]!=INSTALL && opts[DBM_MIME_TYPE]!=UNINSTALL) - throw Exception(trUtf8("Invalid action specified to update mime option!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Invalid action specified to update mime option!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opts.count(DIFF)) { if(opts[INPUT].isEmpty() && opts[INPUT_DB].isEmpty()) - throw Exception(trUtf8("No input file or database was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No input file or database was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts[INPUT].isEmpty() && !opts[INPUT_DB].isEmpty()) - throw Exception(trUtf8("The input file and database can't be used at the same time!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("The input file and database can't be used at the same time!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts.count(COMPARE_TO)) - throw Exception(trUtf8("No database to be compared was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No database to be compared was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts.count(SAVE_DIFF) && !opts.count(APPLY_DIFF)) - throw Exception(trUtf8("No diff action (save or apply) was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No diff action (save or apply) was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opts.count(SAVE_DIFF) && opts[OUTPUT].isEmpty()) - throw Exception(trUtf8("No output file for the diff code was specified!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No output file for the diff code was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Converting input and output files to absolute paths to avoid that they are read/written on the app's working dir @@ -577,7 +577,7 @@ int PgModelerCLI::exec(void) { if(!parsed_opts.empty()) { - printMessage(QString("\npgModeler %1 %2").arg(GlobalAttributes::PGMODELER_VERSION).arg(trUtf8(" command line interface."))); + printMessage(QString("\npgModeler %1 %2").arg(GlobalAttributes::PgModelerVersion).arg(trUtf8(" command line interface."))); if(parsed_opts.count(FIX_MODEL)) fixModel(); @@ -695,8 +695,8 @@ void PgModelerCLI::extractObjectXML(void) input.open(QFile::ReadOnly); if(!input.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(parsed_opts[INPUT]), - ERR_FILE_DIR_NOT_ACCESSED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(parsed_opts[INPUT]), + FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf.append(input.readAll()); input.close(); @@ -705,7 +705,7 @@ void PgModelerCLI::extractObjectXML(void) start=regexp.indexIn(buf); if(start < 0) - throw Exception(trUtf8("Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted!"), ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { //Remove the header entry from buffer @@ -1368,8 +1368,8 @@ void PgModelerCLI::diffModelDatabase(void) output.setFileName(parsed_opts[OUTPUT]); if(!output.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(parsed_opts[OUTPUT]), - ERR_FILE_DIR_NOT_WRITTEN, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(parsed_opts[OUTPUT]), + FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__); output.write(diff_hlp.getDiffDefinition().toUtf8()); output.close(); } @@ -1522,12 +1522,12 @@ void PgModelerCLI::handleMimeDatabase(bool uninstall) QString str_aux, //Configures the path to the application logo - exec_icon=QDir(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + QString("pgmodeler_logo.png")).absolutePath(), + exec_icon=QDir(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + QString("pgmodeler_logo.png")).absolutePath(), //Configures the path to the document logo - dbm_icon=QDir(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + QString("pgmodeler_dbm.png")).absolutePath(), + dbm_icon=QDir(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + QString("pgmodeler_dbm.png")).absolutePath(), //Path to directory that register mime types mime_db_dir=QDir::homePath() + QString("/.local/share/mime"), @@ -1535,35 +1535,35 @@ void PgModelerCLI::handleMimeDatabase(bool uninstall) //Path to the file that associates apps to mimetypes mimeapps=QDir::homePath() + QString("/.local/share/applications/mimeapps.list"), - base_conf_dir=GlobalAttributes::TMPL_CONFIGURATIONS_DIR + GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::SCHEMAS_DIR + GlobalAttributes::DIR_SEPARATOR, + base_conf_dir=GlobalAttributes::TmplConfigurationDir + GlobalAttributes::DirSeparator + + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator, //Files generated after update file association (application-dbm.xml and pgModeler.desktop) files[] = { QDir::homePath() + QString("/.local/share/applications/pgModeler.desktop"), mime_db_dir + QString("/packages/application-dbm.xml") }, - schemas[] = { base_conf_dir + QString("desktop") + GlobalAttributes::SCHEMA_EXT, - base_conf_dir + QString("application-dbm") + GlobalAttributes::SCHEMA_EXT }; + schemas[] = { base_conf_dir + QString("desktop") + GlobalAttributes::SchemaExt, + base_conf_dir + QString("application-dbm") + GlobalAttributes::SchemaExt }; QByteArray buf, buf_aux; QFile out; //When installing, check if the necessary file exists. If exists, raises an error and abort. if(!uninstall && (QFileInfo(files[0]).exists() || QFileInfo(files[1]).exists())) { - throw Exception(msg_file_associated, ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg_file_associated, Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(uninstall && (!QFileInfo(files[0]).exists() && !QFileInfo(files[1]).exists())) { - throw Exception(msg_no_association, ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg_no_association, Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!uninstall) { QString startup_script=QString("%1/start-pgmodeler.sh") - .arg(QFileInfo(GlobalAttributes::PGMODELER_APP_PATH).absolutePath()); + .arg(QFileInfo(GlobalAttributes::PgModelerAppPath).absolutePath()); attribs[ParsersAttributes::WORKING_DIR]=QStandardPaths::writableLocation(QStandardPaths::HomeLocation); attribs[ParsersAttributes::APPLICATION]=(QFileInfo(startup_script).exists() ? - startup_script : GlobalAttributes::PGMODELER_APP_PATH); + startup_script : GlobalAttributes::PgModelerAppPath); attribs[ParsersAttributes::ICON]=exec_icon; } @@ -1575,7 +1575,7 @@ void PgModelerCLI::handleMimeDatabase(bool uninstall) { if(!QFile(files[i]).remove()) throw Exception(trUtf8("Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists.").arg(files[i]), - ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -1587,8 +1587,8 @@ void PgModelerCLI::handleMimeDatabase(bool uninstall) out.open(QFile::WriteOnly); if(!out.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(files[i]), - ERR_FILE_DIR_NOT_WRITTEN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(files[i]), + FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); out.write(buf.data(), buf.size()); out.close(); @@ -1612,8 +1612,8 @@ void PgModelerCLI::handleMimeDatabase(bool uninstall) out.open(QFile::ReadOnly); if(!out.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(mimeapps), - ERR_FILE_DIR_NOT_WRITTEN,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(mimeapps), + FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Opens the mimeapps.list to add a entry linking pgModeler to .dbm files buf=out.readAll(); diff --git a/main/src/application.cpp b/main/src/application.cpp index 014e3eb64e..5b0785a995 100644 --- a/main/src/application.cpp +++ b/main/src/application.cpp @@ -23,10 +23,10 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) { QTranslator *main_translator=nullptr, *plugin_translator=nullptr; - QFile ui_style(GlobalAttributes::TMPL_CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::UI_STYLE_CONF + - GlobalAttributes::CONFIGURATION_EXT); + QFile ui_style(GlobalAttributes::TmplConfigurationDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::UiStyleConf + + GlobalAttributes::ConfigurationExt); QString plugin_name, plug_lang_dir, plug_lang_file; QStringList dir_list; QDir dir; @@ -41,25 +41,25 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) this->addLibraryPath(this->applicationDirPath()); //If pgModeler bundles plugins, add the root plugins path to lib search paths - if(dir.exists(GlobalAttributes::PLUGINS_DIR)) - this->addLibraryPath(GlobalAttributes::PLUGINS_DIR); + if(dir.exists(GlobalAttributes::PluginsDir)) + this->addLibraryPath(GlobalAttributes::PluginsDir); //Check if the temporary dir exists, if not, creates it. - if(!dir.exists(GlobalAttributes::TEMPORARY_DIR)) + if(!dir.exists(GlobalAttributes::TemporaryDir)) { - if(!dir.mkdir(GlobalAttributes::TEMPORARY_DIR)) + if(!dir.mkdir(GlobalAttributes::TemporaryDir)) { Messagebox msg; - msg.show(Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(GlobalAttributes::TEMPORARY_DIR), - ERR_FILE_DIR_NOT_WRITTEN, __PRETTY_FUNCTION__,__FILE__,__LINE__)); + msg.show(Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(GlobalAttributes::TemporaryDir), + FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__)); } } //Trying to identify if the user defined a custom UI language in the pgmodeler.conf file - QString conf_file = GlobalAttributes::CONFIGURATIONS_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::GENERAL_CONF + - GlobalAttributes::CONFIGURATION_EXT; + QString conf_file = GlobalAttributes::ConfigurationsDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::GeneralConf + + GlobalAttributes::ConfigurationExt; QFile input; QString lang_id = QLocale::system().name(); @@ -79,12 +79,12 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) //Tries to load the main ui translation according to the system's locale main_translator=new QTranslator(this); - main_translator->load(lang_id, GlobalAttributes::LANGUAGES_DIR); + main_translator->load(lang_id, GlobalAttributes::LanguagesDir); this->installTranslator(main_translator); //Trying to load plugins translations - dir_list=QDir(GlobalAttributes::PLUGINS_DIR + - GlobalAttributes::DIR_SEPARATOR, + dir_list=QDir(GlobalAttributes::PluginsDir + + GlobalAttributes::DirSeparator, QString("*"), QDir::Name, QDir::AllDirs | QDir::NoDotAndDotDot).entryList(); while(!dir_list.isEmpty()) @@ -93,10 +93,10 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) dir_list.pop_front(); //Configure the path to "lang" subdir at current plugin directory - plug_lang_dir=GlobalAttributes::PLUGINS_DIR + - GlobalAttributes::DIR_SEPARATOR + plugin_name + - GlobalAttributes::DIR_SEPARATOR + QString("lang") + - GlobalAttributes::DIR_SEPARATOR; + plug_lang_dir=GlobalAttributes::PluginsDir + + GlobalAttributes::DirSeparator + plugin_name + + GlobalAttributes::DirSeparator + QString("lang") + + GlobalAttributes::DirSeparator; plug_lang_file=plugin_name + QString(".") + lang_id; @@ -116,8 +116,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) if(!ui_style.isOpen()) { Messagebox msg; - msg.show(Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(ui_style.fileName()), - ERR_FILE_DIR_NOT_ACCESSED,__PRETTY_FUNCTION__,__FILE__,__LINE__)); + msg.show(Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(ui_style.fileName()), + FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__)); } else this->setStyleSheet(ui_style.readAll()); @@ -145,20 +145,20 @@ bool Application::notify(QObject *receiver, QEvent *event) void Application::createUserConfiguration(void) { - QDir config_dir(GlobalAttributes::CONFIGURATIONS_DIR); + QDir config_dir(GlobalAttributes::ConfigurationsDir); try { //If the directory not exists or is empty if(!config_dir.exists() || - config_dir.entryList({QString("*%1").arg(GlobalAttributes::CONFIGURATION_EXT)}, + config_dir.entryList({QString("*%1").arg(GlobalAttributes::ConfigurationExt)}, QDir::Files | QDir::NoDotAndDotDot).isEmpty()) - copyFilesRecursively(GlobalAttributes::TMPL_CONFIGURATIONS_DIR, GlobalAttributes::CONFIGURATIONS_DIR); + copyFilesRecursively(GlobalAttributes::TmplConfigurationDir, GlobalAttributes::ConfigurationsDir); } catch(Exception &e) { Messagebox msg_box; - msg_box.show(e, trUtf8("Failed to create initial configuration in `%1'! Check if the current user has write permission over that path and at least read permission over `%2'.").arg(GlobalAttributes::CONFIGURATIONS_DIR, CONFDIR)); + msg_box.show(e, trUtf8("Failed to create initial configuration in `%1'! Check if the current user has write permission over that path and at least read permission over `%2'.").arg(GlobalAttributes::ConfigurationsDir, CONFDIR)); throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -168,7 +168,7 @@ void Application::copyFilesRecursively(const QString &src_path, const QString &d QFileInfo src_file(src_path); if(!src_file.exists()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(src_path), + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(src_path), __PRETTY_FUNCTION__,__FILE__,__LINE__); if(src_file.isDir()) @@ -179,16 +179,16 @@ void Application::copyFilesRecursively(const QString &src_path, const QString &d src_dir(src_path); if(!dst_dir.exists() && !dst_dir.mkpath(dst_path)) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(dst_path), + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(dst_path), __PRETTY_FUNCTION__,__FILE__,__LINE__); - filenames = src_dir.entryList({QString("*%1").arg(GlobalAttributes::CONFIGURATION_EXT)}, + filenames = src_dir.entryList({QString("*%1").arg(GlobalAttributes::ConfigurationExt)}, QDir::Files | QDir::NoDotAndDotDot); for(QString filename : filenames) { //Avoiding the copy of ui-style.conf file - if(!filename.contains(GlobalAttributes::UI_STYLE_CONF)) + if(!filename.contains(GlobalAttributes::UiStyleConf)) { new_src_path = src_path + src_dir.separator() + filename; new_dst_path = dst_path + dst_dir.separator() + filename; @@ -198,7 +198,7 @@ void Application::copyFilesRecursively(const QString &src_path, const QString &d } else if(!QFile::exists(dst_path) && !QFile::copy(src_path, dst_path)) { - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_WRITTEN).arg(dst_path), + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(dst_path), __PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/main/src/main.cpp b/main/src/main.cpp index 4ba4d22762..d26f72ec9d 100644 --- a/main/src/main.cpp +++ b/main/src/main.cpp @@ -38,12 +38,12 @@ void startCrashHandler(int signal) symbols = backtrace_symbols(stack, stack_size); #endif - cmd=QString("\"%1\"").arg(GlobalAttributes::PGMODELER_CHANDLER_PATH) + QString(" -style ") + GlobalAttributes::DEFAULT_QT_STYLE; + cmd=QString("\"%1\"").arg(GlobalAttributes::PgModelerCHandlerPath) + QString(" -style ") + GlobalAttributes::DefaultQtStyle; //Creates the stacktrace file - output.setFileName(GlobalAttributes::TEMPORARY_DIR + - GlobalAttributes::DIR_SEPARATOR + - GlobalAttributes::STACKTRACE_FILE); + output.setFileName(GlobalAttributes::TemporaryDir + + GlobalAttributes::DirSeparator + + GlobalAttributes::StacktraceFile); output.open(QFile::WriteOnly); if(output.isOpen()) @@ -51,8 +51,8 @@ void startCrashHandler(int signal) lin=QString("** pgModeler crashed after receive signal: %1 **\n\nDate/Time: %2 \nVersion: %3 \nBuild: %4 \n") .arg(signal) .arg(QDateTime::currentDateTime().toString(QString("yyyy-MM-dd hh:mm:ss"))) - .arg(GlobalAttributes::PGMODELER_VERSION) - .arg(GlobalAttributes::PGMODELER_BUILD_NUMBER); + .arg(GlobalAttributes::PgModelerVersion) + .arg(GlobalAttributes::PgModelerBuildNumber); lin+=QString("Compilation Qt version: %1\nRunning Qt version: %2\n\n") .arg(QT_VERSION_STR) @@ -116,7 +116,7 @@ int main(int argc, char **argv) //If no custom style is specified we force the usage of Fusion (the default for Qt and pgModeler) if(!using_style) - app.setStyle(GlobalAttributes::DEFAULT_QT_STYLE); + app.setStyle(GlobalAttributes::DefaultQtStyle); //Loading the application splash screen QSplashScreen splash; diff --git a/plugins/dummy/src/dummy.cpp b/plugins/dummy/src/dummy.cpp index e74b5980fd..b42391b490 100644 --- a/plugins/dummy/src/dummy.cpp +++ b/plugins/dummy/src/dummy.cpp @@ -27,10 +27,10 @@ Dummy::Dummy(void) getPluginAuthor(), getPluginDescription(), - GlobalAttributes::PLUGINS_DIR + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::PluginsDir + + GlobalAttributes::DirSeparator + QString("dummy") + - GlobalAttributes::DIR_SEPARATOR + QString("dummy.png")); + GlobalAttributes::DirSeparator + QString("dummy.png")); } QString Dummy::getPluginTitle(void) diff --git a/plugins/xml2object/src/xml2object.cpp b/plugins/xml2object/src/xml2object.cpp index 1b8d722c71..f9c2a5d298 100644 --- a/plugins/xml2object/src/xml2object.cpp +++ b/plugins/xml2object/src/xml2object.cpp @@ -27,10 +27,10 @@ Xml2Object::Xml2Object(void) getPluginAuthor(), getPluginDescription(), - GlobalAttributes::PLUGINS_DIR + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::PluginsDir + + GlobalAttributes::DirSeparator + QString("xml2object") + - GlobalAttributes::DIR_SEPARATOR + QString("xml2object.png")); + GlobalAttributes::DirSeparator + QString("xml2object.png")); } QString Xml2Object::getPluginTitle(void) @@ -61,7 +61,7 @@ void Xml2Object::showPluginInfo(void) void Xml2Object::executePlugin(ModelWidget *model) { if(!model) - throw Exception(trUtf8("This plugin must be executed with at least one model opened!"),ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("This plugin must be executed with at least one model opened!"),Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); xml2obj_wgt.show(model->getDatabaseModel(), model->getOperationList()); } diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index 8af39d604a..479b7aebcb 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -5,7 +5,7 @@ Xml2ObjectWidget::Xml2ObjectWidget(QWidget *parent, Qt::WindowFlags f) : QDialog setupUi(this); code_hl=new SyntaxHighlighter(code_txt); - code_hl->loadConfiguration(GlobalAttributes::XML_HIGHLIGHT_CONF_PATH); + code_hl->loadConfiguration(GlobalAttributes::XMLHighlightConfPath); connect(close_btn, SIGNAL(clicked(void)), this, SLOT(close(void))); connect(clear_btn, SIGNAL(clicked(void)), this, SLOT(clearSource(void))); @@ -34,8 +34,8 @@ void Xml2ObjectWidget::loadXML(void) f.open(QFile::ReadOnly); if(!f.isOpen()) - throw Exception(Exception::getErrorMessage(ERR_FILE_DIR_NOT_ACCESSED).arg(file_dlg.selectedFiles().at(0)), - ERR_FILE_DIR_NOT_ACCESSED,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(file_dlg.selectedFiles().at(0)), + FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); code_txt->setPlainText(QString::fromUtf8(f.readAll())); diff --git a/tests/src/databasemodeltest/databasemodeltest.cpp b/tests/src/databasemodeltest/databasemodeltest.cpp index d6f319ae85..61e1f1c009 100644 --- a/tests/src/databasemodeltest/databasemodeltest.cpp +++ b/tests/src/databasemodeltest/databasemodeltest.cpp @@ -32,8 +32,8 @@ void DatabaseModelTest::saveObjectsMetadata(void) { DatabaseModel dbmodel; QTextStream out(stdout); - QString output=QFileInfo(BINDIR).absolutePath() + GlobalAttributes::DIR_SEPARATOR + QString("demo.omf"), - input=SAMPLESDIR + GlobalAttributes::DIR_SEPARATOR + QString("demo.dbm"); + QString output=QFileInfo(BINDIR).absolutePath() + GlobalAttributes::DirSeparator + QString("demo.omf"), + input=SAMPLESDIR + GlobalAttributes::DirSeparator + QString("demo.dbm"); try { @@ -55,9 +55,9 @@ void DatabaseModelTest::loadObjectsMetadata(void) { DatabaseModel dbmodel; QTextStream out(stdout); - QString input_opf=QFileInfo(BINDIR).absolutePath() + GlobalAttributes::DIR_SEPARATOR + QString("demo.omf"), - input_dbm=SAMPLESDIR + GlobalAttributes::DIR_SEPARATOR + QString("demo.dbm"), - output=QFileInfo(BINDIR).absolutePath() + GlobalAttributes::DIR_SEPARATOR + QString("demo_changed.dbm"); + QString input_opf=QFileInfo(BINDIR).absolutePath() + GlobalAttributes::DirSeparator + QString("demo.omf"), + input_dbm=SAMPLESDIR + GlobalAttributes::DirSeparator + QString("demo.dbm"), + output=QFileInfo(BINDIR).absolutePath() + GlobalAttributes::DirSeparator + QString("demo_changed.dbm"); try { diff --git a/tests/src/partrelationshiptest/partrelationshiptest.cpp b/tests/src/partrelationshiptest/partrelationshiptest.cpp index 24defa128b..303e70924b 100644 --- a/tests/src/partrelationshiptest/partrelationshiptest.cpp +++ b/tests/src/partrelationshiptest/partrelationshiptest.cpp @@ -162,7 +162,7 @@ void PartRelationhipTest::connRelTablePartionHasMoreColsThanPartitionedTableShou } catch(Exception &e) { - QVERIFY(e.getErrorType() == ERR_INV_COLUMN_COUNT_PART_REL); + QVERIFY(e.getErrorType() == InvColumnCountPartRel); } } @@ -209,7 +209,7 @@ void PartRelationhipTest::connRelTablePartionHasDifferentColsThanPartitionedTabl } catch(Exception &e) { - QVERIFY(e.getErrorType() == ERR_INV_COLUMN_COUNT_PART_REL); + QVERIFY(e.getErrorType() == InvColumnCountPartRel); } } diff --git a/tests/src/syntaxhighlightertest/syntaxhighlightertest.cpp b/tests/src/syntaxhighlightertest/syntaxhighlightertest.cpp index cd6abe6421..d49ec3b726 100644 --- a/tests/src/syntaxhighlightertest/syntaxhighlightertest.cpp +++ b/tests/src/syntaxhighlightertest/syntaxhighlightertest.cpp @@ -35,7 +35,7 @@ void SyntaxHighlighterTest::handleMultiLineComment(void) SyntaxHighlighter *sql_hl=nullptr; sql_hl=new SyntaxHighlighter(edt, false); - sql_hl->loadConfiguration(GlobalAttributes::SQL_HIGHLIGHT_CONF_PATH); + sql_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); layout->addWidget(edt); dlg->exec(); From e5c27abcebb813ab50902827033f9806ed578205 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 15:22:02 -0300 Subject: [PATCH 158/425] Constant attributes refactoring checkpoint --- crashhandler/src/crashhandlerform.cpp | 2 +- crashhandler/src/crashhandlerform.h | 2 +- crashhandler/src/main.cpp | 2 +- libobjrenderer/src/baseobjectview.cpp | 18 +- libobjrenderer/src/baseobjectview.h | 10 +- libobjrenderer/src/basetableview.cpp | 42 +-- libobjrenderer/src/basetableview.h | 4 +- libobjrenderer/src/graphicalview.cpp | 12 +- libobjrenderer/src/objectsscene.cpp | 22 +- libobjrenderer/src/objectsscene.h | 6 +- libobjrenderer/src/relationshipview.cpp | 124 +++---- libobjrenderer/src/relationshipview.h | 10 +- libobjrenderer/src/roundedrectitem.cpp | 20 +- libobjrenderer/src/roundedrectitem.h | 12 +- libobjrenderer/src/schemaview.cpp | 12 +- libobjrenderer/src/styledtextboxview.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 112 +++---- libobjrenderer/src/tableobjectview.h | 20 +- libobjrenderer/src/tabletitleview.cpp | 18 +- libobjrenderer/src/tableview.cpp | 14 +- libobjrenderer/src/textboxview.cpp | 12 +- libparsers/src/schemaparser.cpp | 314 +++++++++--------- libparsers/src/schemaparser.h | 77 +++-- libpgmodeler_ui/src/modelexporthelper.cpp | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 10 +- libpgmodeler_ui/src/modelwidget.cpp | 12 +- .../src/relationshipconfigwidget.cpp | 6 +- libpgmodeler_ui/src/tablewidget.cpp | 14 +- 28 files changed, 455 insertions(+), 456 deletions(-) diff --git a/crashhandler/src/crashhandlerform.cpp b/crashhandler/src/crashhandlerform.cpp index e149b2b68d..2bfa66fe84 100644 --- a/crashhandler/src/crashhandlerform.cpp +++ b/crashhandler/src/crashhandlerform.cpp @@ -20,7 +20,7 @@ #include "messagebox.h" #include "pgmodeleruins.h" -const QString CrashHandlerForm::ANALYSIS_MODE=QString("-analysis-mode"); +const QString CrashHandlerForm::AnalysisMode=QString("-analysis-mode"); CrashHandlerForm::CrashHandlerForm(bool analysis_mode, QWidget *parent, Qt::WindowFlags f) : BugReportForm(parent, f) { diff --git a/crashhandler/src/crashhandlerform.h b/crashhandler/src/crashhandlerform.h index db037f6183..456c2ec5e8 100644 --- a/crashhandler/src/crashhandlerform.h +++ b/crashhandler/src/crashhandlerform.h @@ -59,7 +59,7 @@ class CrashHandlerForm: public BugReportForm { public: //! \brief Analysis mode argument - static const QString ANALYSIS_MODE; + static const QString AnalysisMode; CrashHandlerForm(bool analysis_mode=false, QWidget * parent = 0, Qt::WindowFlags f = 0); diff --git a/crashhandler/src/main.cpp b/crashhandler/src/main.cpp index f39eeb5354..a36306c10d 100644 --- a/crashhandler/src/main.cpp +++ b/crashhandler/src/main.cpp @@ -33,7 +33,7 @@ int main(int argc, char **argv) translator.load(QLocale::system().name(), GlobalAttributes::LanguagesDir); app.installTranslator(&translator); - CrashHandlerForm crashhandler(args.size() > 1 && args[1]==CrashHandlerForm::ANALYSIS_MODE); + CrashHandlerForm crashhandler(args.size() > 1 && args[1]==CrashHandlerForm::AnalysisMode); PgModelerUiNS::resizeDialog(&crashhandler); crashhandler.show(); app.exec(); diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index ce4ea29840..3d6f98e8de 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -345,8 +345,8 @@ QLinearGradient BaseObjectView::getFillStyle(const QString &id) { if(id==ParsersAttributes::OBJ_SELECTION || id==ParsersAttributes::PLACEHOLDER) { - colors[0].setAlpha(OBJ_ALPHA_CHANNEL); - colors[1].setAlpha(OBJ_ALPHA_CHANNEL); + colors[0].setAlpha(ObjectAlphaChannel); + colors[1].setAlpha(ObjectAlphaChannel); } grad.setCoordinateMode(QGradient::ObjectBoundingMode); @@ -370,9 +370,9 @@ QPen BaseObjectView::getBorderStyle(const QString &id) if(!colors.empty()) { if(id==ParsersAttributes::OBJ_SELECTION) - colors[2].setAlpha(OBJ_ALPHA_CHANNEL); + colors[2].setAlpha(ObjectAlphaChannel); - pen.setWidthF(OBJ_BORDER_WIDTH); + pen.setWidthF(ObjectBorderWidth); pen.setColor(colors[2]); } } @@ -497,14 +497,14 @@ void BaseObjectView::configureSQLDisabledInfo(void) sql_disabled_txt->setText(trUtf8("SQL off")); sql_disabled_txt->setBrush(char_fmt.foreground()); - sql_disabled_box->setRect(QRectF(QPointF(0,0), sql_disabled_txt->boundingRect().size() + QSizeF(1.5 * HORIZ_SPACING, 1.5 * VERT_SPACING))); + sql_disabled_box->setRect(QRectF(QPointF(0,0), sql_disabled_txt->boundingRect().size() + QSizeF(1.5 * HorizSpacing, 1.5 * VertSpacing))); sql_disabled_box->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::POSITION_INFO)); sql_disabled_box->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::POSITION_INFO)); - px=bounding_rect.width() - sql_disabled_box->boundingRect().width() + (1.5 * HORIZ_SPACING), + px=bounding_rect.width() - sql_disabled_box->boundingRect().width() + (1.5 * HorizSpacing), py=-(sql_disabled_box->boundingRect().height()/2); - sql_disabled_txt->setPos(px + (HORIZ_SPACING * 0.75), py + (VERT_SPACING * 0.75)); + sql_disabled_txt->setPos(px + (HorizSpacing * 0.75), py + (VertSpacing * 0.75)); sql_disabled_box->setPos(px, py); } } @@ -546,7 +546,7 @@ void BaseObjectView::configureProtectedIcon(void) double factor; //Calculates the factor used to resize the protection icon accordding the font size - factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DEFAULT_FONT_SIZE; + factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize; pol.append(QPointF(2,5)); pol.append(QPointF(2,2)); pol.append(QPointF(3,1)); pol.append(QPointF(4,0)); @@ -644,7 +644,7 @@ void BaseObjectView::togglePlaceholder(bool visible) double BaseObjectView::getFontFactor(void) { - return(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DEFAULT_FONT_SIZE); + return(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize); } double BaseObjectView::getScreenDpiFactor(void) diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 64ac2ce6c8..3bf705b87e 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -116,12 +116,12 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { void setSelectionOrder(bool selected); public: - static constexpr double VERT_SPACING=2.0f, - HORIZ_SPACING=2.0f, - DEFAULT_FONT_SIZE=9.0f, - OBJ_BORDER_WIDTH=0.85f; + static constexpr double VertSpacing=2.0f, + HorizSpacing=2.0f, + DefaultFontSize=9.0f, + ObjectBorderWidth=0.85f; - static constexpr int OBJ_ALPHA_CHANNEL=128; + static constexpr int ObjectAlphaChannel=128; BaseObjectView(BaseObject *object=nullptr); virtual ~BaseObjectView(void); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 1c355f60f0..48301fc0a7 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -27,15 +27,15 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) throw Exception(AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); body=new RoundedRectItem; - body->setRoundedCorners(RoundedRectItem::BOTTOMLEFT_CORNER | RoundedRectItem::BOTTOMRIGHT_CORNER); + body->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); title=new TableTitleView; ext_attribs_body=new RoundedRectItem; - ext_attribs_body->setRoundedCorners(RoundedRectItem::NO_CORNERS); + ext_attribs_body->setRoundedCorners(RoundedRectItem::NoCorners); ext_attribs_toggler=new RoundedRectItem; - ext_attribs_toggler->setRoundedCorners(RoundedRectItem::BOTTOMLEFT_CORNER | RoundedRectItem::BOTTOMRIGHT_CORNER); + ext_attribs_toggler->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); ext_attribs_toggler->setZValue(-1); ext_attribs=new QGraphicsItemGroup; @@ -222,13 +222,13 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { dynamic_cast(obj_selection)->setBorderRadius(2); dynamic_cast(obj_selection)->setRect(QRectF(0,0, - title->boundingRect().width() - (2.5 * HORIZ_SPACING), + title->boundingRect().width() - (2.5 * HorizSpacing), ext_attribs_toggler->boundingRect().height() * 0.65f)); //Sets the selection position as same as item's position rect1=this->mapRectToItem(ext_attribs_toggler, ext_attribs_toggler->boundingRect()); obj_selection->setVisible(true); - obj_selection->setPos(QPointF(title->pos().x() + HORIZ_SPACING, -rect1.top() + 1.5f)); + obj_selection->setPos(QPointF(title->pos().x() + HorizSpacing, -rect1.top() + 1.5f)); this->setToolTip(trUtf8("Toggles the extended attributes display")); } //If the index is invalid clears the selection @@ -247,14 +247,14 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { dynamic_cast(obj_selection)->setBorderRadius(2); dynamic_cast(obj_selection)->setRect(QRectF(0,0, - title->boundingRect().width() - (2.5 * HORIZ_SPACING), + title->boundingRect().width() - (2.5 * HorizSpacing), item->boundingRect().height())); } //Sets the selection position as same as item's position rect1=this->mapRectToItem(item, item->boundingRect()); obj_selection->setVisible(true); - obj_selection->setPos(QPointF(title->pos().x() + HORIZ_SPACING,-rect1.top())); + obj_selection->setPos(QPointF(title->pos().x() + HorizSpacing,-rect1.top())); //Stores the selected child object sel_child_obj=dynamic_cast(item->getSourceObject()); @@ -331,12 +331,12 @@ void BaseTableView::configureTag(void) p2=tag_name->boundingRect().bottomRight(); bottom=this->boundingRect().bottom(); - pol.append(QPointF(p1.x()-BaseObjectView::HORIZ_SPACING, p1.y() - BaseObjectView::VERT_SPACING)); - pol.append(QPointF(p2.x(), p1.y() - BaseObjectView::VERT_SPACING)); - pol.append(QPointF(p2.x() + BaseObjectView::HORIZ_SPACING + 5, p2.y()/2)); - pol.append(QPointF(p2.x(), p2.y() + BaseObjectView::VERT_SPACING)); - pol.append(QPointF(p1.x(), p2.y() + BaseObjectView::VERT_SPACING)); - pol.append(QPointF(p1.x()-BaseObjectView::HORIZ_SPACING, p2.y() + BaseObjectView::VERT_SPACING)); + pol.append(QPointF(p1.x()-BaseObjectView::HorizSpacing, p1.y() - BaseObjectView::VertSpacing)); + pol.append(QPointF(p2.x(), p1.y() - BaseObjectView::VertSpacing)); + pol.append(QPointF(p2.x() + BaseObjectView::HorizSpacing + 5, p2.y()/2)); + pol.append(QPointF(p2.x(), p2.y() + BaseObjectView::VertSpacing)); + pol.append(QPointF(p1.x(), p2.y() + BaseObjectView::VertSpacing)); + pol.append(QPointF(p1.x()-BaseObjectView::HorizSpacing, p2.y() + BaseObjectView::VertSpacing)); tag_body->setPolygon(pol); tag_body->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::TAG)); @@ -369,7 +369,7 @@ void BaseTableView::__configureObject(float width) { py = title->boundingRect().height() + body->boundingRect().height() + - ext_attribs_body->boundingRect().height() - VERT_SPACING - 1; + ext_attribs_body->boundingRect().height() - VertSpacing - 1; } else { @@ -414,7 +414,7 @@ void BaseTableView::__configureObject(float width) } //Set the protected icon position to the top-right on the title - protected_icon->setPos(title->pos().x() + title->boundingRect().width() * 0.90f, 2 * VERT_SPACING); + protected_icon->setPos(title->pos().x() + title->boundingRect().width() * 0.90f, 2 * VertSpacing); this->bounding_rect.setTopLeft(title->boundingRect().topLeft()); this->bounding_rect.setWidth(title->boundingRect().width()); @@ -423,7 +423,7 @@ void BaseTableView::__configureObject(float width) { this->bounding_rect.setHeight(title->boundingRect().height() + body->boundingRect().height() - 1); - body->setRoundedCorners(RoundedRectItem::BOTTOMLEFT_CORNER | RoundedRectItem::BOTTOMRIGHT_CORNER); + body->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); } else { @@ -433,9 +433,9 @@ void BaseTableView::__configureObject(float width) this->bounding_rect.setHeight(title->boundingRect().height() + body->boundingRect().height() + (!tab->isExtAttribsHidden() ? ext_attribs_body->boundingRect().height() : 0) + - ext_attribs_toggler->boundingRect().height() - VERT_SPACING - 1); + ext_attribs_toggler->boundingRect().height() - VertSpacing - 1); - body->setRoundedCorners(RoundedRectItem::NO_CORNERS); + body->setRoundedCorners(RoundedRectItem::NoCorners); } this->table_tooltip=this->getSourceObject()->getName(true) + @@ -454,15 +454,15 @@ float BaseTableView::calculateWidth(void) (columns->boundingRect().width() > title->boundingRect().width() && (hide_ext_attribs || dynamic_cast(this->getSourceObject())->isExtAttribsHidden() || (columns->boundingRect().width() > ext_attribs->boundingRect().width())))) - return(columns->boundingRect().width() + (2 * HORIZ_SPACING)); + return(columns->boundingRect().width() + (2 * HorizSpacing)); if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && !dynamic_cast(this->getSourceObject())->isExtAttribsHidden() && (ext_attribs->boundingRect().width() > title->boundingRect().width() && ext_attribs->boundingRect().width() > columns->boundingRect().width())) - return(ext_attribs->boundingRect().width() + (2 * HORIZ_SPACING)); + return(ext_attribs->boundingRect().width() + (2 * HorizSpacing)); - return(title->boundingRect().width() + (2 * HORIZ_SPACING)); + return(title->boundingRect().width() + (2 * HorizSpacing)); } int BaseTableView::getConnectRelsCount(void) diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 494b1cbd87..1dc1ddb9d6 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -88,8 +88,8 @@ class BaseTableView: public BaseObjectView { float calculateWidth(void); public: - static constexpr unsigned LEFT_CONN_POINT=0, - RIGHT_CONN_POINT=1; + static constexpr unsigned LeftConnPoint=0, + RightConnPoint=1; BaseTableView(BaseTable *base_tab); virtual ~BaseTableView(void); diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 83bb53022b..93d329a1a9 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -83,7 +83,7 @@ void GraphicalView::configureObject(void) columns->removeFromGroup(graph_ref); graph_ref->configureObject(ref); - graph_ref->moveBy(HORIZ_SPACING, (i * graph_ref->boundingRect().height()) + VERT_SPACING); + graph_ref->moveBy(HorizSpacing, (i * graph_ref->boundingRect().height()) + VertSpacing); columns->addToGroup(graph_ref); } @@ -135,17 +135,17 @@ void GraphicalView::configureObject(void) //Configures the item and set its position col_item->configureObject(); - col_item->moveBy(HORIZ_SPACING, (i * col_item->boundingRect().height()) + VERT_SPACING); + col_item->moveBy(HorizSpacing, (i * col_item->boundingRect().height()) + VertSpacing); /* Calculates the width of the name + type of the object. This is used to align all the constraint labels on table */ width=col_item->getChildObject(0)->boundingRect().width() + - col_item->getChildObject(1)->boundingRect().width() + (3 * HORIZ_SPACING); + col_item->getChildObject(1)->boundingRect().width() + (3 * HorizSpacing); if(px < width) px=width; //Gets the maximum width of the column type label to align all at same horizontal position if(type_width < col_item->getChildObject(2)->boundingRect().width()) - type_width=col_item->getChildObject(2)->boundingRect().width() + (3 * HORIZ_SPACING); + type_width=col_item->getChildObject(2)->boundingRect().width() + (3 * HorizSpacing); col_items.push_back(col_item); } @@ -184,7 +184,7 @@ void GraphicalView::configureObject(void) //Resizes the columns/extended attributes using the new width for(int idx=0; idx < 2; idx++) { - bodies[idx]->setRect(QRectF(0,0, width, groups[idx]->boundingRect().height() + (2 * VERT_SPACING))); + bodies[idx]->setRect(QRectF(0,0, width, groups[idx]->boundingRect().height() + (2 * VertSpacing))); pen=this->getBorderStyle(attribs[idx]); pen.setStyle(Qt::DashLine); @@ -213,7 +213,7 @@ void GraphicalView::configureObject(void) col_item=dynamic_cast(subitems.front()); subitems.pop_front(); col_item->setChildObjectXPos(3, width - - col_item->boundingRect().width() - (2 * HORIZ_SPACING) - 1); + col_item->boundingRect().width() - (2 * HorizSpacing) - 1); } } diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 4d36393b26..1ef56dfd86 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -62,9 +62,9 @@ ObjectsScene::ObjectsScene(void) object_move_timer.stop(); }); - scene_move_timer.setInterval(SCENE_MOVE_TIMEOUT); - corner_hover_timer.setInterval(SCENE_MOVE_TIMEOUT * 10); - object_move_timer.setInterval(SCENE_MOVE_TIMEOUT * 10); + scene_move_timer.setInterval(SceneMoveTimeout); + corner_hover_timer.setInterval(SceneMoveTimeout * 10); + object_move_timer.setInterval(SceneMoveTimeout * 10); } ObjectsScene::~ObjectsScene(void) @@ -577,17 +577,17 @@ bool ObjectsScene::mouseIsAtCorner(void) if(rect.contains(pos)) { - if(pos.x() <= SCENE_MOVE_THRESHOLD) - scene_move_dx=-SCENE_MOVE_STEP; - else if(pos.x() >= (view->width() - view->verticalScrollBar()->width() - SCENE_MOVE_THRESHOLD)) - scene_move_dx=SCENE_MOVE_STEP; + if(pos.x() <= SceneMoveThreshold) + scene_move_dx=-SceneMoveStep; + else if(pos.x() >= (view->width() - view->verticalScrollBar()->width() - SceneMoveThreshold)) + scene_move_dx=SceneMoveStep; else scene_move_dx=0; - if(pos.y() <= SCENE_MOVE_THRESHOLD) - scene_move_dy=-SCENE_MOVE_STEP; - else if(pos.y() >= (view->height() - view->horizontalScrollBar()->height() - SCENE_MOVE_THRESHOLD)) - scene_move_dy=SCENE_MOVE_STEP; + if(pos.y() <= SceneMoveThreshold) + scene_move_dy=-SceneMoveStep; + else if(pos.y() >= (view->height() - view->horizontalScrollBar()->height() - SceneMoveThreshold)) + scene_move_dy=SceneMoveStep; else scene_move_dy=0; diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 1d93538de2..3c15598299 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -49,9 +49,9 @@ class ObjectsScene: public QGraphicsScene { //! \brief Indicates if the scene need to be moved bool move_scene; - static constexpr int SCENE_MOVE_STEP=20, - SCENE_MOVE_TIMEOUT=50, - SCENE_MOVE_THRESHOLD=30; + static constexpr int SceneMoveStep=20, + SceneMoveTimeout=50, + SceneMoveThreshold=30; //! \brief Timer responsible to move the scene QTimer scene_move_timer, diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 8b0f1af11a..8a2cb34bc7 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -21,7 +21,7 @@ bool RelationshipView::hide_name_label=false; bool RelationshipView::use_curved_lines=true; bool RelationshipView::use_crows_foot=false; -unsigned RelationshipView::line_conn_mode=RelationshipView::CONNECT_FK_TO_PK; +unsigned RelationshipView::line_conn_mode=RelationshipView::ConnectFkToPk; RelationshipView::RelationshipView(BaseRelationship *rel) : BaseObjectView(rel) { @@ -67,7 +67,7 @@ RelationshipView::RelationshipView(BaseRelationship *rel) : BaseObjectView(rel) cf_descriptors[i] = nullptr; line_circles[i]=new QGraphicsEllipseItem; - line_circles[i]->setRect(QRectF(0,0,GRAPHIC_PNT_RADIUS,GRAPHIC_PNT_RADIUS)); + line_circles[i]->setRect(QRectF(0,0,GraphicPointRadius,GraphicPointRadius)); line_circles[i]->setZValue(0); line_circles[i]->setVisible(false); this->addToGroup(line_circles[i]); @@ -170,7 +170,7 @@ void RelationshipView::setCrowsFoot(bool value) use_crows_foot = value; if(value) - line_conn_mode=RelationshipView::CONNECT_TABLE_EGDES; + line_conn_mode=RelationshipView::ConnectTableEdges; } bool RelationshipView::isCrowsFoot(void) @@ -181,11 +181,11 @@ bool RelationshipView::isCrowsFoot(void) void RelationshipView::setLineConnectionMode(unsigned mode) { if(use_crows_foot) - line_conn_mode=CONNECT_TABLE_EGDES; + line_conn_mode=ConnectTableEdges; else { - if(mode > CONNECT_TABLE_EGDES) - mode=CONNECT_TABLE_EGDES; + if(mode > ConnectTableEdges) + mode=ConnectTableEdges; line_conn_mode=mode; } @@ -606,7 +606,7 @@ void RelationshipView::configureLine(void) if(base_rel->isSelfRelationship()) { - double fnt_factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DEFAULT_FONT_SIZE, + double fnt_factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize, pos_factor = 0, offset = 0; unsigned rel_cnt = tables[0]->getConnectedRelsCount(base_rel->getTable(BaseRelationship::SRC_TABLE), base_rel->getTable(BaseRelationship::DST_TABLE)); @@ -666,7 +666,7 @@ void RelationshipView::configureLine(void) tables[1]=dynamic_cast(rel->getReceiverTable()->getReceiverObject()); } - if(line_conn_mode==CONNECT_CENTER_PNTS || line_conn_mode==CONNECT_TABLE_EGDES || !rel_1n) + if(line_conn_mode==ConnectCenterPoints || line_conn_mode==ConnectTableEdges || !rel_1n) { vector *> ref_lines={ &fk_lines, &pk_lines }; @@ -685,7 +685,7 @@ void RelationshipView::configureLine(void) } } } - else if(line_conn_mode==CONNECT_FK_TO_PK && rel_1n) + else if(line_conn_mode==ConnectFkToPk && rel_1n) { QPointF pnt; QRectF rec_tab_rect, ref_tab_rect; @@ -723,22 +723,22 @@ void RelationshipView::configureLine(void) conn_same_sides = true; if(rec_tab_rect.center().x() >= ref_tab_rect.center().x()) - pk_pnt_type=fk_pnt_type=BaseTableView::LEFT_CONN_POINT; + pk_pnt_type=fk_pnt_type=BaseTableView::LeftConnPoint; else if(rec_tab_rect.center().x() < ref_tab_rect.center().x()) - pk_pnt_type=fk_pnt_type=BaseTableView::RIGHT_CONN_POINT; + pk_pnt_type=fk_pnt_type=BaseTableView::RightConnPoint; } else { //Connecting the relationship on the opposite sides depending on the tables' position if(ref_tab_rect.right() <= rec_tab_rect.left()) { - pk_pnt_type=BaseTableView::RIGHT_CONN_POINT; - fk_pnt_type=BaseTableView::LEFT_CONN_POINT; + pk_pnt_type=BaseTableView::RightConnPoint; + fk_pnt_type=BaseTableView::LeftConnPoint; } else { - pk_pnt_type=BaseTableView::LEFT_CONN_POINT; - fk_pnt_type=BaseTableView::RIGHT_CONN_POINT; + pk_pnt_type=BaseTableView::LeftConnPoint; + fk_pnt_type=BaseTableView::RightConnPoint; } } @@ -762,8 +762,8 @@ void RelationshipView::configureLine(void) if(!fks.empty()) { - double pk_dx=(pk_pnt_type==BaseTableView::LEFT_CONN_POINT ? -CONN_LINE_LENGTH : CONN_LINE_LENGTH), - fk_dx=(fk_pnt_type==BaseTableView::LEFT_CONN_POINT ? -CONN_LINE_LENGTH : CONN_LINE_LENGTH); + double pk_dx=(pk_pnt_type==BaseTableView::LeftConnPoint ? -ConnLineLength : ConnLineLength), + fk_dx=(fk_pnt_type==BaseTableView::LeftConnPoint ? -ConnLineLength : ConnLineLength); pk_pnt=this->mapFromItem(ref_tab_view, QPointF(pk_px + pk_dx, pk_py/pk_points.size())); fk_pnt=this->mapFromItem(rec_tab_view, QPointF(fk_px + fk_dx, fk_py/fk_points.size())); @@ -820,7 +820,7 @@ void RelationshipView::configureLine(void) pol=graph_points[i]; pol->setPos(points[i]); - pol->moveBy(-GRAPHIC_PNT_RADIUS/2, -GRAPHIC_PNT_RADIUS/2); + pol->moveBy(-GraphicPointRadius/2, -GraphicPointRadius/2); pol->setVisible(this->isSelected()); } @@ -836,7 +836,7 @@ void RelationshipView::configureLine(void) } } - if(base_rel->isSelfRelationship() || line_conn_mode != CONNECT_TABLE_EGDES) + if(base_rel->isSelfRelationship() || line_conn_mode != ConnectTableEdges) { conn_points[0]=p_central[0]; conn_points[1]=p_central[1]; @@ -844,15 +844,15 @@ void RelationshipView::configureLine(void) points.insert(points.begin(),p_central[0]); points.push_back(p_central[1]); } - else if(line_conn_mode == CONNECT_TABLE_EGDES) + else if(line_conn_mode == ConnectTableEdges) { QRectF brect; QPolygonF pol; QLineF edge, line = QLineF(tables[0]->getCenter(), tables[1]->getCenter()); QPointF pi, center, p_aux[2]; - double font_factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DEFAULT_FONT_SIZE) * BaseObjectView::getScreenDpiFactor(), + double font_factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(), size_factor = 1, - border_factor = CONN_LINE_LENGTH * 0.30, + border_factor = ConnLineLength * 0.30, min_lim = 0, max_lim = 0, conn_rels_factors[2] = { 0, 0 }; unsigned conn_rels_cnt[2] = { 0, 0 }; @@ -890,9 +890,9 @@ void RelationshipView::configureLine(void) rel_type == BaseRelationship::RELATIONSHIP_11 || (tab_idx == 0 && rel_type == BaseRelationship::RELATIONSHIP_1N) || (tab_idx == 1 && rel_type == BaseRelationship::RELATIONSHIP_FK)) - border_factor = CONN_LINE_LENGTH * 0.30; + border_factor = ConnLineLength * 0.30; else - border_factor = CONN_LINE_LENGTH * 0.75; + border_factor = ConnLineLength * 0.75; } else size_factor = 0.65 * font_factor; @@ -961,18 +961,18 @@ void RelationshipView::configureLine(void) if(edge.dx() == 0) { if(pi.x() < center.x()) - pi.setX(pi.x() - CONN_LINE_LENGTH * size_factor); + pi.setX(pi.x() - ConnLineLength * size_factor); else - pi.setX(pi.x() + CONN_LINE_LENGTH * size_factor); + pi.setX(pi.x() + ConnLineLength * size_factor); conn_vert_sides[tab_idx] = true; } else { if(pi.y() < center.y()) - pi.setY(pi.y() - CONN_LINE_LENGTH * size_factor); + pi.setY(pi.y() - ConnLineLength * size_factor); else - pi.setY(pi.y() + CONN_LINE_LENGTH * size_factor); + pi.setY(pi.y() + ConnLineLength * size_factor); conn_horiz_sides[tab_idx] = true; } @@ -1034,7 +1034,7 @@ void RelationshipView::configureLine(void) points.insert(points.begin() + idx_lin_desc, p_int); } - if(line_conn_mode==CONNECT_FK_TO_PK) + if(line_conn_mode==ConnectFkToPk) { vector ref_points={ fk_pnt, pk_pnt }; vector *> ref_pnt_vects={ &fk_points, &pk_points }; @@ -1062,9 +1062,9 @@ void RelationshipView::configureLine(void) //If the relationship is identifier or bidirectional, the line has its thickness modified if(rel && (rel->isIdentifier() && vet_idx==0)) - pen.setWidthF(OBJ_BORDER_WIDTH * 1.90f); + pen.setWidthF(ObjectBorderWidth * 1.90f); else - pen.setWidthF(OBJ_BORDER_WIDTH * 1.45f); + pen.setWidthF(ObjectBorderWidth * 1.45f); lin->setLine(QLineF(ref_pnt->at(i), ref_points[vet_idx])); lin->setPen(pen); @@ -1099,9 +1099,9 @@ void RelationshipView::configureLine(void) //If the relationship is identifier or bidirectional, the line has its thickness modified if(rel && (rel->isIdentifier() && i >= idx_lin_desc)) - pen.setWidthF(OBJ_BORDER_WIDTH * 1.90f); + pen.setWidthF(ObjectBorderWidth * 1.90f); else - pen.setWidthF(OBJ_BORDER_WIDTH * 1.45f); + pen.setWidthF(ObjectBorderWidth * 1.45f); lin->setLine(QLineF(points[i], points[i+1])); lin->setPen(pen); @@ -1123,19 +1123,19 @@ void RelationshipView::configureLine(void) } //Exposing the line ending circles - if((!base_rel->isSelfRelationship() && line_conn_mode==CONNECT_CENTER_PNTS && !use_crows_foot) || + if((!base_rel->isSelfRelationship() && line_conn_mode==ConnectCenterPoints && !use_crows_foot) || (!base_rel->isSelfRelationship() && - ((line_conn_mode != CONNECT_TABLE_EGDES && rel_type==BaseRelationship::RELATIONSHIP_DEP) || - (line_conn_mode != CONNECT_TABLE_EGDES && rel_type==BaseRelationship::RELATIONSHIP_GEN) || - (line_conn_mode != CONNECT_TABLE_EGDES && rel_type==BaseRelationship::RELATIONSHIP_PART) || - (line_conn_mode != CONNECT_TABLE_EGDES && rel_type==BaseRelationship::RELATIONSHIP_NN && !use_crows_foot)))) + ((line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RELATIONSHIP_DEP) || + (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RELATIONSHIP_GEN) || + (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RELATIONSHIP_PART) || + (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RELATIONSHIP_NN && !use_crows_foot)))) { for(i=0; i < 2; i++) { line_circles[i]->setVisible(true); line_circles[i]->setPen(pen); line_circles[i]->setBrush(pen.color()); - line_circles[i]->setPos(p_central[i]-QPointF(GRAPHIC_PNT_RADIUS/2, GRAPHIC_PNT_RADIUS/2)); + line_circles[i]->setPos(p_central[i]-QPointF(GraphicPointRadius/2, GraphicPointRadius/2)); } } else @@ -1232,9 +1232,9 @@ void RelationshipView::configureLine(void) QString(" (") + base_rel->getTypeName() + QString(")"); tool_tip += QString("\nId: %1\n").arg(base_rel->getObjectId()) + - TableObjectView::CONSTR_DELIM_START + + TableObjectView::ConstrDelimStart + QString(" %1 ").arg(base_rel->getRelationshipTypeName()) + - TableObjectView::CONSTR_DELIM_END; + TableObjectView::ConstrDelimEnd; if(!base_rel->getAlias().isEmpty()) tool_tip += QString("\nAlias: %1").arg(base_rel->getAlias()); @@ -1271,7 +1271,7 @@ void RelationshipView::configureDescriptor(void) Relationship *rel=dynamic_cast(base_rel); unsigned rel_type=base_rel->getRelationshipType(); double x, y, x1, y1, angle = 0, - factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DEFAULT_FONT_SIZE) * BaseObjectView::getScreenDpiFactor(); + factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); QPen pen; QPointF pnt; vector points=base_rel->getPoints(); @@ -1402,10 +1402,10 @@ void RelationshipView::configureDescriptor(void) y + ((pol.boundingRect().height()/2.0f) * 0.55f)); configureSQLDisabledInfo(); - x1+=6 * HORIZ_SPACING; - y1-=3 * VERT_SPACING; + x1+=6 * HorizSpacing; + y1-=3 * VertSpacing; sql_disabled_box->setPos(x1, y1); - sql_disabled_txt->setPos(x1 + HORIZ_SPACING, y1 + VERT_SPACING); + sql_disabled_txt->setPos(x1 + HorizSpacing, y1 + VertSpacing); descriptor->setPolygon(pol); descriptor->setTransformOriginPoint(descriptor->boundingRect().center()); @@ -1468,7 +1468,7 @@ void RelationshipView::configureCrowsFootDescriptors(void) QGraphicsLineItem *line_item = nullptr; QGraphicsEllipseItem *circle_item = nullptr; unsigned rel_type = base_rel->getRelationshipType(); - double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DEFAULT_FONT_SIZE) * BaseObjectView::getScreenDpiFactor(); + double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); int signal = 1; BaseTableView *tables[2] = { nullptr, nullptr }; bool mandatory[2] = { false, false }; @@ -1621,7 +1621,7 @@ void RelationshipView::configureCrowsFootDescriptors(void) circle_item = round_cf_descriptors[tab_id]; cf_descriptors[tab_id]->addToGroup(circle_item); circle_item->setVisible(true); - circle_item->setRect(QRectF(0, 0, GRAPHIC_PNT_RADIUS * 2.20 * factor, GRAPHIC_PNT_RADIUS * 2.20 * factor)); + circle_item->setRect(QRectF(0, 0, GraphicPointRadius * 2.20 * factor, GraphicPointRadius * 2.20 * factor)); py = -(circle_item->boundingRect().height()/2.20); @@ -1715,7 +1715,7 @@ void RelationshipView::configureAttributes(void) QRectF rect; QPolygonF pol; double py, px, - factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DEFAULT_FONT_SIZE; + factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize; fmt=font_config[ParsersAttributes::ATTRIBUTE]; font=fmt.font(); @@ -1727,7 +1727,7 @@ void RelationshipView::configureAttributes(void) //Calculates the first attribute position based upon the attribute count and descriptor size count=rel->getAttributeCount(); - px=descriptor->pos().x() + descriptor->boundingRect().width() + ((3 * HORIZ_SPACING) * factor); + px=descriptor->pos().x() + descriptor->boundingRect().width() + ((3 * HorizSpacing) * factor); py=descriptor->pos().y() - (count * rect.height()/(4.0f * factor)); for(i=0; i < count; i++) @@ -1783,13 +1783,13 @@ void RelationshipView::configureAttributes(void) attrib->setPos(px, py); text->setText(compact_view && !col->getAlias().isEmpty() ? col->getAlias() : col->getName()); - text->setPos(QPointF(desc->pos().x() + desc->boundingRect().width() + (HORIZ_SPACING * factor), 0)); - desc->setPos(0, VERT_SPACING * factor); + text->setPos(QPointF(desc->pos().x() + desc->boundingRect().width() + (HorizSpacing * factor), 0)); + desc->setPos(0, VertSpacing * factor); pol.clear(); pol.append(text->boundingRect().topLeft()); - pol.append(text->boundingRect().topRight() + QPointF(desc->boundingRect().width() + (HORIZ_SPACING * factor), 0)); - pol.append(text->boundingRect().bottomRight() + QPointF(desc->boundingRect().width() + (HORIZ_SPACING * factor), 0)); + pol.append(text->boundingRect().topRight() + QPointF(desc->boundingRect().width() + (HorizSpacing * factor), 0)); + pol.append(text->boundingRect().bottomRight() + QPointF(desc->boundingRect().width() + (HorizSpacing * factor), 0)); pol.append(text->boundingRect().bottomLeft()); sel_attrib->setPolygon(pol); @@ -1797,7 +1797,7 @@ void RelationshipView::configureAttributes(void) descriptor->pos().y() + (descriptor->boundingRect().height()/2.0f)); lin->setLine(QLineF(p_aux, desc->boundingRect().center())); - py+=desc->boundingRect().height() + (2 * VERT_SPACING); + py+=desc->boundingRect().height() + (2 * VertSpacing); } i=attributes.size()-1; @@ -1828,9 +1828,9 @@ void RelationshipView::configureLabels(void) descriptor->boundingRect().width())/2.0f); if(base_rel->isSelfRelationship()) - y=pnt.y() - labels[BaseRelationship::REL_NAME_LABEL]->boundingRect().height() - (2 * VERT_SPACING); + y=pnt.y() - labels[BaseRelationship::REL_NAME_LABEL]->boundingRect().height() - (2 * VertSpacing); else - y=pnt.y() + descriptor->boundingRect().height() + VERT_SPACING; + y=pnt.y() + descriptor->boundingRect().height() + VertSpacing; labels[BaseRelationship::REL_NAME_LABEL]->setVisible(!hide_name_label); configureLabelPosition(BaseRelationship::REL_NAME_LABEL, x, y); @@ -1865,14 +1865,14 @@ void RelationshipView::configureLabels(void) { QPointF pi, pf, p_int, pos; unsigned idx, i1; - double dl, da, factor, v_space=VERT_SPACING * 2.5, h_space=HORIZ_SPACING * 2.5; + double dl, da, factor, v_space=VertSpacing * 2.5, h_space=HorizSpacing * 2.5; QLineF lins[2], borders[2][4]; QRectF tab_rect, rect; unsigned label_ids[2]={ BaseRelationship::SRC_CARD_LABEL, BaseRelationship::DST_CARD_LABEL }; if(!base_rel->isSelfRelationship() && - line_conn_mode==CONNECT_FK_TO_PK && rel_type!=BaseRelationship::RELATIONSHIP_NN) + line_conn_mode==ConnectFkToPk && rel_type!=BaseRelationship::RELATIONSHIP_NN) { for(idx=0; idx < 2; idx++) { @@ -2032,10 +2032,10 @@ QRectF RelationshipView::__boundingRect(void) for(i=0; i < count; i++) { p=points[i]; - if(x1 > p.x()) x1=p.x() - GRAPHIC_PNT_RADIUS; - if(y1 > p.y()) y1=p.y() - GRAPHIC_PNT_RADIUS; - if(x2 < p.x()) x2=p.x() + GRAPHIC_PNT_RADIUS; - if(y2 < p.y()) y2=p.y() + GRAPHIC_PNT_RADIUS; + if(x1 > p.x()) x1=p.x() - GraphicPointRadius; + if(y1 > p.y()) y1=p.y() - GraphicPointRadius; + if(x2 < p.x()) x2=p.x() + GraphicPointRadius; + if(y2 < p.y()) y2=p.y() + GraphicPointRadius; } //Checks if some label is out of reference dimension diff --git a/libobjrenderer/src/relationshipview.h b/libobjrenderer/src/relationshipview.h index aa1a51e819..00eac1de83 100644 --- a/libobjrenderer/src/relationshipview.h +++ b/libobjrenderer/src/relationshipview.h @@ -35,10 +35,10 @@ class RelationshipView: public BaseObjectView { Q_OBJECT //! \brief Graphical point radius - static constexpr double GRAPHIC_PNT_RADIUS=6.0f; + static constexpr double GraphicPointRadius=6.0f; //! \brief Length of the lines linked to fk/pk columns - static constexpr double CONN_LINE_LENGTH=20.0f; + static constexpr double ConnLineLength=20.0f; //! \brief Indicates that the relationship labels must be hidden static bool hide_name_label; @@ -158,9 +158,9 @@ class RelationshipView: public BaseObjectView { void configureObject(void); public: - static constexpr unsigned CONNECT_CENTER_PNTS=0, - CONNECT_FK_TO_PK=1, - CONNECT_TABLE_EGDES=2; + static constexpr unsigned ConnectCenterPoints=0, + ConnectFkToPk=1, + ConnectTableEdges=2; RelationshipView(BaseRelationship *rel); ~RelationshipView(void); diff --git a/libobjrenderer/src/roundedrectitem.cpp b/libobjrenderer/src/roundedrectitem.cpp index 538527b758..be8524eb6c 100644 --- a/libobjrenderer/src/roundedrectitem.cpp +++ b/libobjrenderer/src/roundedrectitem.cpp @@ -21,7 +21,7 @@ RoundedRectItem::RoundedRectItem(QGraphicsItem *parent) : QGraphicsRectItem(parent) { radius=5; - corners=ALL_CORNERS; + corners=AllCorners; } void RoundedRectItem::setBorderRadius(double radius) @@ -37,8 +37,8 @@ double RoundedRectItem::getBorderRadius(void) void RoundedRectItem::setRoundedCorners(unsigned corners) { - if(corners > ALL_CORNERS) - corners=ALL_CORNERS; + if(corners > AllCorners) + corners=AllCorners; this->corners=corners; createPolygon(); @@ -65,9 +65,9 @@ void RoundedRectItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, painter->setPen(this->pen()); painter->setBrush(this->brush()); - if(corners==NO_CORNERS) + if(corners==NoCorners) painter->drawRect(this->rect()); - else if(corners==ALL_CORNERS) + else if(corners==AllCorners) painter->drawRoundedRect(this->rect(), radius, radius); else painter->drawPolygon(polygon); @@ -77,26 +77,26 @@ void RoundedRectItem::createPolygon(void) { polygon.clear(); - if(corners!=NO_CORNERS && corners!=ALL_CORNERS && this->rect().isValid()) + if(corners!=NoCorners && corners!=AllCorners && this->rect().isValid()) { QRectF rect=this->rect(); - if(isCornerRounded(TOPLEFT_CORNER)) + if(isCornerRounded(TopLeftCorner)) polygon << calculatePoints(rect.topLeft() + QPointF(radius, radius), 180, 90); else polygon.append(this->rect().topLeft()); - if(isCornerRounded(TOPRIGHT_CORNER)) + if(isCornerRounded(TopRightCorner)) polygon << calculatePoints(this->rect().topRight() + QPointF(-radius, radius), 90, 0); else polygon.append(this->rect().topRight()); - if(isCornerRounded(BOTTOMRIGHT_CORNER)) + if(isCornerRounded(BottomRightCorner)) polygon << calculatePoints(this->rect().bottomRight() + QPointF(-radius, -radius), 360, 270); else polygon.append(this->rect().bottomRight()); - if(isCornerRounded(BOTTOMLEFT_CORNER)) + if(isCornerRounded(BottomLeftCorner)) polygon << calculatePoints(this->rect().bottomLeft() + QPointF(radius, -radius), 270, 180); else polygon.append(this->rect().bottomLeft()); diff --git a/libobjrenderer/src/roundedrectitem.h b/libobjrenderer/src/roundedrectitem.h index b1d0ddc294..43dd5eb5d2 100644 --- a/libobjrenderer/src/roundedrectitem.h +++ b/libobjrenderer/src/roundedrectitem.h @@ -51,22 +51,22 @@ class RoundedRectItem: public QGraphicsRectItem { public: //! \brief Implies a normal rectangle (no rounded corner) - static constexpr unsigned NO_CORNERS=0, + static constexpr unsigned NoCorners=0, //! \brief The top-left corner will be rounded - TOPLEFT_CORNER=2, + TopLeftCorner=2, //! \brief The top-right corner will be rounded - TOPRIGHT_CORNER=4, + TopRightCorner=4, //! \brief The Bottom-left corner will be rounded - BOTTOMLEFT_CORNER=8, + BottomLeftCorner=8, //! \brief The Bottom-right corner will be rounded - BOTTOMRIGHT_CORNER=16, + BottomRightCorner=16, //! \brief All corners will be rounded - ALL_CORNERS=32; + AllCorners=32; explicit RoundedRectItem(QGraphicsItem *parent = 0); diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index 72dd6c3597..d1322986de 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -207,12 +207,12 @@ void SchemaView::configureObject(void) font.setPointSizeF(font.pointSizeF() * 1.3f); sch_name->setFont(font); - sch_name->setPos(HORIZ_SPACING, VERT_SPACING); - txt_h=sch_name->boundingRect().height() + (2 * VERT_SPACING); + sch_name->setPos(HorizSpacing, VertSpacing); + txt_h=sch_name->boundingRect().height() + (2 * VertSpacing); //Configures the box with the points calculated above - sp_h=(3 * HORIZ_SPACING); - sp_v=(3 * VERT_SPACING) + txt_h; + sp_h=(3 * HorizSpacing); + sp_v=(3 * VertSpacing) + txt_h; width=(x2-x1) + 1; @@ -233,7 +233,7 @@ void SchemaView::configureObject(void) this->setFlag(ItemSendsGeometryChanges, true); color=schema->getFillColor(); - color.setAlpha(OBJ_ALPHA_CHANNEL * 0.80); + color.setAlpha(ObjectAlphaChannel * 0.80); box->setBrush(color); color=QColor(color.red()/3,color.green()/3,color.blue()/3, 80); @@ -248,7 +248,7 @@ void SchemaView::configureObject(void) sch_name->setToolTip(this->toolTip()); this->protected_icon->setPos(QPointF( sch_name->boundingRect().width() + sp_h, - sch_name->pos().y() + VERT_SPACING )); + sch_name->pos().y() + VertSpacing )); this->configureObjectSelection(); this->configureProtectedIcon(); diff --git a/libobjrenderer/src/styledtextboxview.cpp b/libobjrenderer/src/styledtextboxview.cpp index 5bc60051ac..c37f0f9efc 100644 --- a/libobjrenderer/src/styledtextboxview.cpp +++ b/libobjrenderer/src/styledtextboxview.cpp @@ -35,7 +35,7 @@ void StyledTextboxView::configureObject(void) pol=box->polygon(); if(rect.height() < fold->boundingRect().height()) - rect.setHeight(fold->boundingRect().height() + (2 * VERT_SPACING)); + rect.setHeight(fold->boundingRect().height() + (2 * VertSpacing)); this->resizePolygon(pol, rect.width() + fold->boundingRect().width(), rect.height()); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index cde7869a76..129ac2aa16 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -18,16 +18,16 @@ #include "tableobjectview.h" -const QString TableObjectView::TYPE_SEPARATOR=QString(" "); -const QString TableObjectView::CONSTR_SEPARATOR=QString(" "); -const QString TableObjectView::TXT_UNIQUE=QString("uq"); -const QString TableObjectView::TXT_EXCLUDE=QString("ex"); -const QString TableObjectView::TXT_CHECK=QString("ck"); -const QString TableObjectView::TXT_PRIMARY_KEY=QString("pk"); -const QString TableObjectView::TXT_FOREIGN_KEY=QString("fk"); -const QString TableObjectView::TXT_NOT_NULL=QString("nn"); -const QString TableObjectView::CONSTR_DELIM_START=QString("«"); -const QString TableObjectView::CONSTR_DELIM_END=QString("»"); +const QString TableObjectView::TypeSeparator=QString(" "); +const QString TableObjectView::ConstrSeparator=QString(" "); +const QString TableObjectView::TextUnique=QString("uq"); +const QString TableObjectView::TextExclude=QString("ex"); +const QString TableObjectView::TextCheck=QString("ck"); +const QString TableObjectView::TextPrimaryKey=QString("pk"); +const QString TableObjectView::TextForeignKey=QString("fk"); +const QString TableObjectView::TextNotNull=QString("nn"); +const QString TableObjectView::ConstrDelimStart=QString("«"); +const QString TableObjectView::ConstrDelimEnd=QString("»"); TableObjectView::TableObjectView(TableObject *object) : BaseObjectView(object) { @@ -57,7 +57,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) ObjectType obj_type=BASE_OBJECT; Column *column=dynamic_cast(this->getSourceObject()); bool ellipse_desc=false; - double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DEFAULT_FONT_SIZE) * BaseObjectView::getScreenDpiFactor(); + double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); QPen pen; //Based upon the source object type the descriptor is allocated @@ -105,7 +105,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setBrush(this->getFillStyle(attrib)); pen = this->getBorderStyle(attrib); - pen.setWidthF(OBJ_BORDER_WIDTH * 1.15f); + pen.setWidthF(ObjectBorderWidth * 1.15f); desc->setPen(pen); } else @@ -146,7 +146,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setBrush(this->getFillStyle(attrib)); pen = this->getBorderStyle(attrib); - pen.setWidthF(OBJ_BORDER_WIDTH * 1.15f); + pen.setWidthF(ObjectBorderWidth * 1.15f); desc->setPen(pen); } } @@ -168,7 +168,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setBrush(this->getFillStyle(tab_obj->getSchemaName())); pen = this->getBorderStyle(tab_obj->getSchemaName()); - pen.setWidthF(OBJ_BORDER_WIDTH * 1.15f); + pen.setWidthF(ObjectBorderWidth * 1.15f); desc->setPen(pen); } else @@ -179,7 +179,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setBrush(this->getFillStyle(ParsersAttributes::REFERENCE)); pen = this->getBorderStyle(ParsersAttributes::REFERENCE); - pen.setWidthF(OBJ_BORDER_WIDTH * 1.15f); + pen.setWidthF(ObjectBorderWidth * 1.15f); desc->setPen(pen); } } @@ -207,22 +207,22 @@ void TableObjectView::configureObject(void) str_constr=this->getConstraintString(column); - if(str_constr.indexOf(TXT_PRIMARY_KEY)>=0) + if(str_constr.indexOf(TextPrimaryKey)>=0) { fmt=font_config[ParsersAttributes::PK_COLUMN]; constr_type=ConstraintType::primary_key; } - else if(str_constr.indexOf(TXT_FOREIGN_KEY)>=0) + else if(str_constr.indexOf(TextForeignKey)>=0) { fmt=font_config[ParsersAttributes::FK_COLUMN]; constr_type=ConstraintType::foreign_key; } - else if(str_constr.indexOf(TXT_UNIQUE)>=0) + else if(str_constr.indexOf(TextUnique)>=0) { fmt=font_config[ParsersAttributes::UQ_COLUMN]; constr_type=ConstraintType::unique; } - else if(str_constr.indexOf(TXT_NOT_NULL)>=0) + else if(str_constr.indexOf(TextNotNull)>=0) fmt=font_config[ParsersAttributes::NN_COLUMN]; else fmt=font_config[ParsersAttributes::COLUMN]; @@ -232,19 +232,19 @@ void TableObjectView::configureObject(void) else if(column->isProtected()) fmt=font_config[ParsersAttributes::PROT_COLUMN]; - if(str_constr.indexOf(TXT_PRIMARY_KEY)>=0) + if(str_constr.indexOf(TextPrimaryKey)>=0) atribs_tip+=(~ConstraintType(ConstraintType::primary_key)).toLower() + QString(", "); - if(str_constr.indexOf(TXT_FOREIGN_KEY)>=0) + if(str_constr.indexOf(TextForeignKey)>=0) atribs_tip+=(~ConstraintType(ConstraintType::foreign_key)).toLower() + QString(", "); - if(str_constr.indexOf(TXT_UNIQUE)>=0) + if(str_constr.indexOf(TextUnique)>=0) atribs_tip+=(~ConstraintType(ConstraintType::unique)).toLower() + QString(", "); - if(str_constr.indexOf(TXT_EXCLUDE)>=0) + if(str_constr.indexOf(TextExclude)>=0) atribs_tip+=(~ConstraintType(ConstraintType::exclude)).toLower() + QString(", "); - if(str_constr.indexOf(TXT_NOT_NULL)>=0) + if(str_constr.indexOf(TextNotNull)>=0) atribs_tip+=QString("not null"); } else @@ -260,8 +260,8 @@ void TableObjectView::configureObject(void) configureDescriptor(constr_type); //Set the descriptor position as the first item on the view - descriptor->setPos(HORIZ_SPACING, 1); - px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HORIZ_SPACING); + descriptor->setPos(HorizSpacing, 1); + px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HorizSpacing); //Configuring the labels as follow: [object name] [type] [constraints] lables[0]->setText(compact_view && !tab_obj->getAlias().isEmpty() ? tab_obj->getAlias() : tab_obj->getName()); @@ -284,15 +284,15 @@ void TableObjectView::configureObject(void) else { if(column) - lables[1]->setText(TYPE_SEPARATOR + (*column->getType())); + lables[1]->setText(TypeSeparator + (*column->getType())); else - lables[1]->setText(TYPE_SEPARATOR + tab_obj->getSchemaName()); + lables[1]->setText(TypeSeparator + tab_obj->getSchemaName()); } lables[1]->setFont(fmt.font()); lables[1]->setBrush(fmt.foreground()); lables[1]->setPos(px, 0); - px+=lables[1]->boundingRect().width() + (3 * HORIZ_SPACING); + px+=lables[1]->boundingRect().width() + (3 * HorizSpacing); //Configuring the constraints label fmt=font_config[ParsersAttributes::CONSTRAINTS]; @@ -313,7 +313,7 @@ void TableObjectView::configureObject(void) str_constr+=(~rule->getExecutionType()).mid(0,1); atribs_tip+=(~rule->getExecutionType()).toLower() + QString(", "); - str_constr+=CONSTR_SEPARATOR; + str_constr+=ConstrSeparator; str_constr+=(~rule->getEventType()).mid(3,1); atribs_tip+=(~rule->getEventType()).toLower(); @@ -322,7 +322,7 @@ void TableObjectView::configureObject(void) else if(trigger) { str_constr+=(~trigger->getFiringType()).mid(0,1); - str_constr+=CONSTR_SEPARATOR; + str_constr+=ConstrSeparator; atribs_tip+=(~trigger->getFiringType()).toLower() + QString(", "); @@ -367,15 +367,15 @@ void TableObjectView::configureObject(void) ConstraintType type = constr->getConstraintType(); if(type == ConstraintType::primary_key) - str_constr = TXT_PRIMARY_KEY; + str_constr = TextPrimaryKey; else if(type == ConstraintType::foreign_key) - str_constr = TXT_FOREIGN_KEY; + str_constr = TextForeignKey; else if(type == ConstraintType::unique) - str_constr = TXT_UNIQUE; + str_constr = TextUnique; else if(type == ConstraintType::exclude) - str_constr = TXT_EXCLUDE; + str_constr = TextExclude; else if(type == ConstraintType::check) - str_constr = TXT_CHECK; + str_constr = TextCheck; atribs_tip = (~type).toLower(); } @@ -398,9 +398,9 @@ void TableObjectView::configureObject(void) } if(!str_constr.isEmpty()) - lables[2]->setText(CONSTR_DELIM_START + QString(" ") + + lables[2]->setText(ConstrDelimStart + QString(" ") + str_constr + QString(" ") + - CONSTR_DELIM_END); + ConstrDelimEnd); } if(!atribs_tip.isEmpty()) @@ -408,8 +408,8 @@ void TableObjectView::configureObject(void) if(atribs_tip.at(atribs_tip.length()-1)==' ') atribs_tip.remove(atribs_tip.length()-2, 2); - atribs_tip=QString("\n") + CONSTR_DELIM_START + - QString(" ") + atribs_tip + QString(" ") + CONSTR_DELIM_END; + atribs_tip=QString("\n") + ConstrDelimStart + + QString(" ") + atribs_tip + QString(" ") + ConstrDelimEnd; } @@ -421,7 +421,7 @@ void TableObjectView::configureObject(void) lables[2]->setPos(px, 0); //Calculating the object bounding rect that is composed by the join of the all object's child dimensions - descriptor->setPos(HORIZ_SPACING, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); + descriptor->setPos(HorizSpacing, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); bounding_rect.setTopLeft(QPointF(descriptor->boundingRect().left(), lables[0]->boundingRect().top())); //Special case: when the constraint label has no text use the type label dimension @@ -441,8 +441,8 @@ void TableObjectView::configureObject(Reference reference) QString str_aux; configureDescriptor(); - descriptor->setPos(HORIZ_SPACING, 1); - px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HORIZ_SPACING); + descriptor->setPos(HorizSpacing, 1); + px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HorizSpacing); if(reference.getReferenceType()==Reference::REFER_COLUMN) { @@ -515,7 +515,7 @@ void TableObjectView::configureObject(Reference reference) else lables[2]->setText(QString()); - descriptor->setPos(HORIZ_SPACING, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); + descriptor->setPos(HorizSpacing, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); bounding_rect.setTopLeft(QPointF(descriptor->pos().x(), lables[0]->pos().y())); if(lables[2]->text().isEmpty()) @@ -571,26 +571,26 @@ QString TableObjectView::getConstraintString(Column *column) constr_type=constr->getConstraintType(); if(constr_type==ConstraintType::primary_key) - str_constr=TXT_PRIMARY_KEY + CONSTR_SEPARATOR + str_constr; + str_constr=TextPrimaryKey + ConstrSeparator + str_constr; - if(constr_type==ConstraintType::foreign_key && str_constr.indexOf(TXT_FOREIGN_KEY) < 0) - str_constr+=TXT_FOREIGN_KEY + CONSTR_SEPARATOR; + if(constr_type==ConstraintType::foreign_key && str_constr.indexOf(TextForeignKey) < 0) + str_constr+=TextForeignKey + ConstrSeparator; - if(constr_type==ConstraintType::unique && str_constr.indexOf(TXT_UNIQUE) < 0) - str_constr+=TXT_UNIQUE + CONSTR_SEPARATOR; + if(constr_type==ConstraintType::unique && str_constr.indexOf(TextUnique) < 0) + str_constr+=TextUnique + ConstrSeparator; - if(constr_type==ConstraintType::exclude && str_constr.indexOf(TXT_EXCLUDE) < 0) - str_constr+=TXT_EXCLUDE + CONSTR_SEPARATOR; + if(constr_type==ConstraintType::exclude && str_constr.indexOf(TextExclude) < 0) + str_constr+=TextExclude + ConstrSeparator; } } - if(column->isNotNull() && !str_constr.contains(TXT_PRIMARY_KEY)) - str_constr+=TXT_NOT_NULL + CONSTR_SEPARATOR; + if(column->isNotNull() && !str_constr.contains(TextPrimaryKey)) + str_constr+=TextNotNull + ConstrSeparator; if(!str_constr.isEmpty()) - str_constr= CONSTR_DELIM_START + - CONSTR_SEPARATOR + str_constr + - CONSTR_DELIM_END; + str_constr= ConstrDelimStart + + ConstrSeparator + str_constr + + ConstrDelimEnd; return(str_constr); } diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index c4838a520f..2f1bdb5a2a 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -52,16 +52,16 @@ class TableObjectView: public BaseObjectView } public: - static const QString CONSTR_DELIM_END, - CONSTR_DELIM_START, - TYPE_SEPARATOR, - CONSTR_SEPARATOR, - TXT_FOREIGN_KEY, - TXT_NOT_NULL, - TXT_PRIMARY_KEY, - TXT_UNIQUE, - TXT_CHECK, - TXT_EXCLUDE; + static const QString ConstrDelimEnd, + ConstrDelimStart, + TypeSeparator, + ConstrSeparator, + TextForeignKey, + TextNotNull, + TextPrimaryKey, + TextUnique, + TextCheck, + TextExclude; TableObjectView(TableObject *object=nullptr); ~TableObjectView(void); diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 294667cd53..3e6c43aee3 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -28,7 +28,7 @@ TableTitleView::TableTitleView(void) : BaseObjectView(nullptr) //box=new QGraphicsPolygonItem; box=new RoundedRectItem; - box->setRoundedCorners(RoundedRectItem::TOPLEFT_CORNER | RoundedRectItem::TOPRIGHT_CORNER); + box->setRoundedCorners(RoundedRectItem::TopLeftCorner | RoundedRectItem::TopRightCorner); box->setZValue(0); this->addToGroup(box); @@ -129,11 +129,11 @@ void TableTitleView::configureObject(BaseGraphicObject *object) box->setPen(pen); if(schema->isRectVisible()) - this->resizeTitle(obj_name->boundingRect().width() + (2 * HORIZ_SPACING), - obj_name->boundingRect().height() + (2 * VERT_SPACING)); + this->resizeTitle(obj_name->boundingRect().width() + (2 * HorizSpacing), + obj_name->boundingRect().height() + (2 * VertSpacing)); else - this->resizeTitle(obj_name->boundingRect().width() + schema_name->boundingRect().width() + (2 * HORIZ_SPACING), - schema_name->boundingRect().height() + (2 * VERT_SPACING)); + this->resizeTitle(obj_name->boundingRect().width() + schema_name->boundingRect().width() + (2 * HorizSpacing), + schema_name->boundingRect().height() + (2 * VertSpacing)); } void TableTitleView::resizeTitle(double width, double height) @@ -141,12 +141,12 @@ void TableTitleView::resizeTitle(double width, double height) box->setRect(QRectF(0,0, width, height)); if(schema_name->text()==QString(" ")) - obj_name->setPos((box->boundingRect().width() - obj_name->boundingRect().width())/2.0f, VERT_SPACING); + obj_name->setPos((box->boundingRect().width() - obj_name->boundingRect().width())/2.0f, VertSpacing); else { - schema_name->setPos((box->boundingRect().width() - (schema_name->boundingRect().width() + obj_name->boundingRect().width()))/2.0f, VERT_SPACING); - obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), VERT_SPACING); - obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), VERT_SPACING); + schema_name->setPos((box->boundingRect().width() - (schema_name->boundingRect().width() + obj_name->boundingRect().width()))/2.0f, VertSpacing); + obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), VertSpacing); + obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), VertSpacing); } this->bounding_rect.setTopLeft(this->pos()); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index c321c59124..0befcc3876 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -106,12 +106,12 @@ void TableView::configureObject(void) //Configures the item and set its position col_item->configureObject(); - col_item->moveBy(HORIZ_SPACING, (i * col_item->boundingRect().height()) + VERT_SPACING); + col_item->moveBy(HorizSpacing, (i * col_item->boundingRect().height()) + VertSpacing); /* Calculates the width of the name + type of the object. This is used to align all the constraint labels on table */ width=col_item->getChildObject(0)->boundingRect().width() + - col_item->getChildObject(1)->boundingRect().width() + (6 * HORIZ_SPACING); + col_item->getChildObject(1)->boundingRect().width() + (6 * HorizSpacing); if(px < width) px=width; @@ -156,7 +156,7 @@ void TableView::configureObject(void) //Resizes the columns/extended attributes using the new width for(obj_idx=0; obj_idx < 2; obj_idx++) { - bodies[obj_idx]->setRect(QRectF(0,0, width, groups[obj_idx]->boundingRect().height() + (2 * VERT_SPACING))); + bodies[obj_idx]->setRect(QRectF(0,0, width, groups[obj_idx]->boundingRect().height() + (2 * VertSpacing))); pen=this->getBorderStyle(atribs[obj_idx]); if(table->isPartition()) @@ -186,7 +186,7 @@ void TableView::configureObject(void) col_item=dynamic_cast(subitems.front()); subitems.pop_front(); col_item->setChildObjectXPos(3, width - - col_item->boundingRect().width() - (2 * HORIZ_SPACING) - 1); + col_item->boundingRect().width() - (2 * HorizSpacing) - 1); //Generating the connection points of the columns @@ -195,8 +195,8 @@ void TableView::configureObject(void) tab_obj=dynamic_cast(col_item->getSourceObject()); cy=title->boundingRect().height() + col_item->pos().y() + (col_item->boundingRect().height()/2); conn_points[tab_obj].resize(2); - conn_points[tab_obj][LEFT_CONN_POINT]=QPointF(col_item->pos().x() - 1.5f, cy); - conn_points[tab_obj][RIGHT_CONN_POINT]=QPointF(col_item->pos().x() + width - 1.5f , cy); + conn_points[tab_obj][LeftConnPoint]=QPointF(col_item->pos().x() - 1.5f, cy); + conn_points[tab_obj][RightConnPoint]=QPointF(col_item->pos().x() + width - 1.5f , cy); } } } @@ -232,7 +232,7 @@ QPointF TableView::getConnectionPoints(TableObject *tab_obj, unsigned pnt_type) { if(!tab_obj) throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(pnt_type > RIGHT_CONN_POINT) + else if(pnt_type > RightConnPoint) throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(conn_points.count(tab_obj)==0) //Returns the center point in case of the connection point of the table object wasn't calculated already diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 3883d62073..1388cfe7a4 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -105,18 +105,18 @@ void TextboxView::__configureObject(void) text->setText(txtbox->getComment()); if(text->font().italic()) - text->setPos(HORIZ_SPACING * 1.5, VERT_SPACING * 0.90); + text->setPos(HorizSpacing * 1.5, VertSpacing * 0.90); else - text->setPos(HORIZ_SPACING, VERT_SPACING); + text->setPos(HorizSpacing, VertSpacing); - this->resizePolygon(polygon, roundf(text->boundingRect().width() + (2.5 * HORIZ_SPACING)), - roundf(text->boundingRect().height() + (1.5 * VERT_SPACING))); + this->resizePolygon(polygon, roundf(text->boundingRect().width() + (2.5 * HorizSpacing)), + roundf(text->boundingRect().height() + (1.5 * VertSpacing))); box->setPos(0,0); box->setPolygon(polygon); - protected_icon->setPos(box->boundingRect().right() - (protected_icon->boundingRect().width() + 2 * HORIZ_SPACING), - box->boundingRect().bottom()- (protected_icon->boundingRect().height() + 2 * VERT_SPACING)); + protected_icon->setPos(box->boundingRect().right() - (protected_icon->boundingRect().width() + 2 * HorizSpacing), + box->boundingRect().bottom()- (protected_icon->boundingRect().height() + 2 * VertSpacing)); this->bounding_rect.setTopLeft(box->boundingRect().topLeft()); this->bounding_rect.setBottomRight(box->boundingRect().bottomRight()); diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 42d22a43a5..97608f9517 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -19,47 +19,47 @@ #include "schemaparser.h" #include "parsersattributes.h" -const char SchemaParser::CHR_COMMENT='#'; -const char SchemaParser::CHR_LINE_END='\n'; -const char SchemaParser::CHR_TABULATION='\t'; -const char SchemaParser::CHR_SPACE=' '; -const char SchemaParser::CHR_INI_ATTRIB='{'; -const char SchemaParser::CHR_END_ATTRIB='}'; -const char SchemaParser::CHR_INI_CONDITIONAL='%'; -const char SchemaParser::CHR_INI_METACHAR='$'; -const char SchemaParser::CHR_INI_PURETEXT='['; -const char SchemaParser::CHR_END_PURETEXT=']'; -const char SchemaParser::CHR_INI_CEXPR='('; -const char SchemaParser::CHR_END_CEXPR=')'; -const char SchemaParser::CHR_VAL_DELIM='"'; -const char SchemaParser::CHR_VALUE_OF='@'; - -const QString SchemaParser::TOKEN_IF=QString("if"); -const QString SchemaParser::TOKEN_THEN=QString("then"); -const QString SchemaParser::TOKEN_ELSE=QString("else"); -const QString SchemaParser::TOKEN_END=QString("end"); -const QString SchemaParser::TOKEN_OR=QString("or"); -const QString SchemaParser::TOKEN_AND=QString("and"); -const QString SchemaParser::TOKEN_NOT=QString("not"); -const QString SchemaParser::TOKEN_SET=QString("set"); -const QString SchemaParser::TOKEN_UNSET=QString("unset"); - -const QString SchemaParser::TOKEN_META_SP=QString("sp"); -const QString SchemaParser::TOKEN_META_BR=QString("br"); -const QString SchemaParser::TOKEN_META_TB=QString("tb"); -const QString SchemaParser::TOKEN_META_OB=QString("ob"); -const QString SchemaParser::TOKEN_META_CB=QString("cb"); -const QString SchemaParser::TOKEN_META_OC=QString("oc"); -const QString SchemaParser::TOKEN_META_CC=QString("cc"); - -const QString SchemaParser::TOKEN_EQ_OP=QString("=="); -const QString SchemaParser::TOKEN_NE_OP=QString("!="); -const QString SchemaParser::TOKEN_GT_OP=QString(">"); -const QString SchemaParser::TOKEN_LT_OP=QString("<"); -const QString SchemaParser::TOKEN_GT_EQ_OP=QString(">="); -const QString SchemaParser::TOKEN_LT_EQ_OP=QString("<="); - -const QRegExp SchemaParser::ATTR_REGEXP=QRegExp("^([a-z])([a-z]*|(\\d)*|(\\-)*|(_)*)+", Qt::CaseInsensitive); +const char SchemaParser::CharComment='#'; +const char SchemaParser::CharLineEnd='\n'; +const char SchemaParser::CharTabulation='\t'; +const char SchemaParser::CharSpace=' '; +const char SchemaParser::CharIniAttribute='{'; +const char SchemaParser::CharEndAttribute='}'; +const char SchemaParser::CharIniConditional='%'; +const char SchemaParser::CharIniMetachar='$'; +const char SchemaParser::CharIniPlainText='['; +const char SchemaParser::CharEndPlainText=']'; +const char SchemaParser::CharIniCompExpr='('; +const char SchemaParser::CharEndCompExpr=')'; +const char SchemaParser::CharValueDelim='"'; +const char SchemaParser::CharValueOf='@'; + +const QString SchemaParser::TokenIf=QString("if"); +const QString SchemaParser::TokenThen=QString("then"); +const QString SchemaParser::TokenElse=QString("else"); +const QString SchemaParser::TokenEnd=QString("end"); +const QString SchemaParser::TokenOr=QString("or"); +const QString SchemaParser::TokenAnd=QString("and"); +const QString SchemaParser::TokenNot=QString("not"); +const QString SchemaParser::TokenSet=QString("set"); +const QString SchemaParser::TokenUnset=QString("unset"); + +const QString SchemaParser::TokenMetaSp=QString("sp"); +const QString SchemaParser::TokenMetaBr=QString("br"); +const QString SchemaParser::TokenMetaTb=QString("tb"); +const QString SchemaParser::TokenMetaOb=QString("ob"); +const QString SchemaParser::TokenMetaCb=QString("cb"); +const QString SchemaParser::TokenMetaOc=QString("oc"); +const QString SchemaParser::TokenMetaCc=QString("cc"); + +const QString SchemaParser::TokenEqOper=QString("=="); +const QString SchemaParser::TokenNeOper=QString("!="); +const QString SchemaParser::TokenGtOper=QString(">"); +const QString SchemaParser::TokenLtOper=QString("<"); +const QString SchemaParser::TokenGtEqOper=QString(">="); +const QString SchemaParser::TokenLtEqOper=QString("<="); + +const QRegExp SchemaParser::AttribRegExp=QRegExp("^([a-z])([a-z]*|(\\d)*|(\\-)*|(_)*)+", Qt::CaseInsensitive); SchemaParser::SchemaParser(void) { @@ -100,17 +100,17 @@ QStringList SchemaParser::extractAttributes(void) for(QString line : buffer) { //Find the first occurrence of '{' in the line - start=line.indexOf(CHR_INI_ATTRIB, start); + start=line.indexOf(CharIniAttribute, start); while(start >= 0 && start < line.size()) { - end=line.indexOf(CHR_END_ATTRIB, start); + end=line.indexOf(CharEndAttribute, start); if(end >= 0) { //Extract the name between {} and push it into the list attribs.push_back(line.mid(start + 1, end - start -1)); //Start searching new attribute start now from the last position - start=line.indexOf(CHR_INI_ATTRIB, end); + start=line.indexOf(CharIniAttribute, end); } else break; @@ -151,13 +151,13 @@ void SchemaParser::loadBuffer(const QString &buf) /* Since the method getline discards the \n when the line was just a line break its needed to treat it in order to not lost it */ - if(lin.isEmpty()) lin+=CHR_LINE_END; + if(lin.isEmpty()) lin+=CharLineEnd; //If the entire line is commented out increases the comment lines counter - if(lin[0]==CHR_COMMENT) comment_count++; + if(lin[0]==CharComment) comment_count++; //Looking for the position of other comment characters for deletion - pos=lin.indexOf(CHR_COMMENT); + pos=lin.indexOf(CharComment); //Removes the characters from the found position if(pos >= 0) @@ -166,8 +166,8 @@ void SchemaParser::loadBuffer(const QString &buf) if(!lin.isEmpty()) { //Add a line break in case the last character is not - if(lin[lin.size()-1]!=CHR_LINE_END) - lin+=CHR_LINE_END; + if(lin[lin.size()-1]!=CharLineEnd) + lin+=CharLineEnd; //Add the treated line in the buffer buffer.push_back(lin); @@ -209,7 +209,7 @@ QString SchemaParser::getAttribute(void) /* Only start extracting an attribute if it starts with a { even if the current character is an attribute delimiter */ - if(current_line[column]!=CHR_INI_ATTRIB) + if(current_line[column]!=CharIniAttribute) error=true; else { @@ -223,14 +223,14 @@ QString SchemaParser::getAttribute(void) /* Attempt to extract an attribute until a space, end of line or attribute is encountered */ - while(current_line[column]!=CHR_LINE_END && - current_line[column]!=CHR_SPACE && - current_line[column]!=CHR_TABULATION && + while(current_line[column]!=CharLineEnd && + current_line[column]!=CharSpace && + current_line[column]!=CharTabulation && !end_attrib && !error) { - if(current_line[column]!=CHR_END_ATTRIB) + if(current_line[column]!=CharEndAttribute) atrib+=current_line[column]; - else if(current_line[column]==CHR_END_ATTRIB && !atrib.isEmpty()) + else if(current_line[column]==CharEndAttribute && !atrib.isEmpty()) end_attrib=true; else error=true; @@ -249,7 +249,7 @@ QString SchemaParser::getAttribute(void) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(!ATTR_REGEXP.exactMatch(atrib)) + else if(!AttribRegExp.exactMatch(atrib)) { throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) .arg(atrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), @@ -272,10 +272,10 @@ QString SchemaParser::getWord(void) { /* Extract the word while it is not end of line, space or special character */ - while(current_line[column]!=CHR_LINE_END && + while(current_line[column]!=CharLineEnd && !isSpecialCharacter(current_line[column].toLatin1()) && - current_line[column]!=CHR_SPACE && - current_line[column]!=CHR_TABULATION) + current_line[column]!=CharSpace && + current_line[column]!=CharTabulation) { word+=current_line[column]; column++; @@ -293,23 +293,23 @@ QString SchemaParser::getPureText(void) current_line=buffer[line]; //Attempt to extract a pure text if the first character is a [ - if(current_line[column]==CHR_INI_PURETEXT) + if(current_line[column]==CharIniPlainText) { //Moves to the next character that contains the beginning of the text column++; /* Extracts the text while the end of pure text (]), end of buffer or beginning of other pure text ([) is reached */ - while(current_line[column]!=CHR_END_PURETEXT && + while(current_line[column]!=CharEndPlainText && line < buffer.size() && - current_line[column]!=CHR_INI_PURETEXT) + current_line[column]!=CharIniPlainText) { text+=current_line[column]; /* Special case to end of line. Unlike other elements of language, a pure text can be extracted until the end of the buffer, thus, this method also controls the lines transitions */ - if(current_line[column]==CHR_LINE_END) + if(current_line[column]==CharLineEnd) { //Step to the next line line++; @@ -321,7 +321,7 @@ QString SchemaParser::getPureText(void) else column++; } - if(current_line[column]==CHR_END_PURETEXT) + if(current_line[column]==CharEndPlainText) column++; else error=true; @@ -346,7 +346,7 @@ QString SchemaParser::getConditional(void) current_line=buffer[line]; //Will initiate extraction if a % is found - if(current_line[column]==CHR_INI_CONDITIONAL) + if(current_line[column]==CharIniConditional) { /* Passa para o próximo caractere que é o início do do nome da palavra condicional */ @@ -354,9 +354,9 @@ QString SchemaParser::getConditional(void) /* Moves to the next character that is the beginning of the name of the conditional word */ - while(current_line[column]!=CHR_LINE_END && - current_line[column]!=CHR_SPACE && - current_line[column]!=CHR_TABULATION) + while(current_line[column]!=CharLineEnd && + current_line[column]!=CharSpace && + current_line[column]!=CharTabulation) { conditional+=current_line[column]; column++; @@ -385,15 +385,15 @@ QString SchemaParser::getMetaCharacter(void) current_line=buffer[line]; //Begins the extraction in case of a $ is found - if(current_line[column]==CHR_INI_METACHAR) + if(current_line[column]==CharIniMetachar) { //Moves to the next character that is the beginning of the metacharacter column++; //Extracts the metacharacter until doesn't finds a space or end of line - while(current_line[column]!=CHR_LINE_END && - current_line[column]!=CHR_SPACE && - current_line[column]!=CHR_TABULATION) + while(current_line[column]!=CharLineEnd && + current_line[column]!=CharSpace && + current_line[column]!=CharTabulation) { meta+=current_line[column]; column++; @@ -416,17 +416,17 @@ QString SchemaParser::getMetaCharacter(void) bool SchemaParser::isSpecialCharacter(char chr) { - return(chr==CHR_INI_ATTRIB || chr==CHR_END_ATTRIB || - chr==CHR_INI_CONDITIONAL || chr==CHR_INI_METACHAR || - chr==CHR_INI_PURETEXT || chr==CHR_END_PURETEXT); + return(chr==CharIniAttribute || chr==CharEndAttribute || + chr==CharIniConditional || chr==CharIniMetachar || + chr==CharIniPlainText || chr==CharEndPlainText); } bool SchemaParser::evaluateComparisonExpr(void) { QString curr_line, attrib, value, oper, valid_op_chrs="=!<>fi"; bool error=false, end_eval=false, expr_is_true=true; - static QStringList opers = { TOKEN_EQ_OP, TOKEN_NE_OP, TOKEN_GT_OP, - TOKEN_LT_OP, TOKEN_GT_EQ_OP, TOKEN_LT_EQ_OP }; + static QStringList opers = { TokenEqOper, TokenNeOper, TokenGtOper, + TokenLtOper, TokenGtEqOper, TokenLtEqOper }; try { @@ -439,12 +439,12 @@ bool SchemaParser::evaluateComparisonExpr(void) /* If the scan reached the end of the line and the expression was not closed raises an syntax error Comparison expr must start and end in the same line */ - if(curr_line[column]==CHR_LINE_END && !end_eval) + if(curr_line[column]==CharLineEnd && !end_eval) error=true; switch(curr_line[column].toLatin1()) { - case CHR_INI_ATTRIB: + case CharIniAttribute: /* Extract the attribute (the first element in the expression) only if the comparison operator and values aren't extracted */ if(attrib.isEmpty() && oper.isEmpty() && value.isEmpty()) @@ -453,7 +453,7 @@ bool SchemaParser::evaluateComparisonExpr(void) error=true; break; - case CHR_VAL_DELIM: + case CharValueDelim: /* Extract the value (the last element in the expression) only if the attribute and operator were extracted */ if(value.isEmpty() && !attrib.isEmpty() && !oper.isEmpty()) @@ -464,9 +464,9 @@ bool SchemaParser::evaluateComparisonExpr(void) { value+=curr_line[column++]; - if(curr_line[column]==CHR_VAL_DELIM) + if(curr_line[column]==CharValueDelim) { - value+=CHR_VAL_DELIM; + value+=CharValueDelim; column++; break; } @@ -477,7 +477,7 @@ bool SchemaParser::evaluateComparisonExpr(void) break; - case CHR_END_CEXPR: + case CharEndCompExpr: column++; //If one of the elements are missing, raise an syntax error @@ -498,7 +498,7 @@ bool SchemaParser::evaluateComparisonExpr(void) else { QVariant left_val, right_val; - value.remove(CHR_VAL_DELIM); + value.remove(CharValueDelim); //Evaluating the attribute value against the one captured on the expression without casting if(oper.endsWith('f')) @@ -519,12 +519,12 @@ bool SchemaParser::evaluateComparisonExpr(void) right_val = QVariant(value); } - expr_is_true=((oper==TOKEN_EQ_OP && (left_val == right_val)) || - (oper==TOKEN_NE_OP && (left_val != right_val)) || - (oper==TOKEN_GT_OP && (left_val > right_val)) || - (oper==TOKEN_LT_OP && (left_val < right_val)) || - (oper==TOKEN_GT_EQ_OP && (left_val >= right_val)) || - (oper==TOKEN_LT_EQ_OP && (left_val <= right_val))); + expr_is_true=((oper==TokenEqOper && (left_val == right_val)) || + (oper==TokenNeOper && (left_val != right_val)) || + (oper==TokenGtOper && (left_val > right_val)) || + (oper==TokenLtOper && (left_val < right_val)) || + (oper==TokenGtEqOper && (left_val >= right_val)) || + (oper==TokenLtEqOper && (left_val <= right_val))); end_eval=true; } @@ -576,11 +576,11 @@ void SchemaParser::defineAttribute(void) switch(curr_line[column].toLatin1()) { - case CHR_LINE_END: + case CharLineEnd: end_def=true; break; - case CHR_VALUE_OF: + case CharValueOf: if(!use_val_as_name) { use_val_as_name=true; @@ -591,11 +591,11 @@ void SchemaParser::defineAttribute(void) error=true; break; - case CHR_INI_CONDITIONAL: + case CharIniConditional: error=true; break; - case CHR_INI_ATTRIB: + case CharIniAttribute: if(new_attrib.isEmpty()) new_attrib=getAttribute(); else @@ -614,11 +614,11 @@ void SchemaParser::defineAttribute(void) } break; - case CHR_INI_PURETEXT: + case CharIniPlainText: value+=getPureText(); break; - case CHR_INI_METACHAR: + case CharIniMetachar: value+=translateMetaCharacter(getMetaCharacter()); break; @@ -642,7 +642,7 @@ void SchemaParser::defineAttribute(void) attrib=(use_val_as_name ? attributes[new_attrib] : new_attrib); //Checking if the attribute has a valid name - if(!ATTR_REGEXP.exactMatch(attrib)) + if(!AttribRegExp.exactMatch(attrib)) { throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) .arg(attrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), @@ -675,11 +675,11 @@ void SchemaParser::unsetAttribute(void) switch(curr_line[column].toLatin1()) { - case CHR_LINE_END: + case CharLineEnd: end_def=true; break; - case CHR_INI_ATTRIB: + case CharIniAttribute: attrib=getAttribute(); if(attributes.count(attrib)==0 && !ignore_unk_atribs) @@ -688,7 +688,7 @@ void SchemaParser::unsetAttribute(void) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(!ATTR_REGEXP.exactMatch(attrib)) + else if(!AttribRegExp.exactMatch(attrib)) { throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) .arg(attrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), @@ -725,7 +725,7 @@ bool SchemaParser::evaluateExpression(void) { ignoreBlankChars(current_line); - if(current_line[column]==CHR_LINE_END) + if(current_line[column]==CharLineEnd) { line++; if(line < buffer.size()) @@ -741,20 +741,20 @@ bool SchemaParser::evaluateExpression(void) switch(current_line[column].toLatin1()) { //Extract the next conditional token - case CHR_INI_CONDITIONAL: + case CharIniConditional: prev_cond=cond; cond=getConditional(); //Error 1: %if {a} %or %or %then error=(cond==prev_cond || //Error 2: %if {a} %and %or %then - (cond==TOKEN_AND && prev_cond==TOKEN_OR) || + (cond==TokenAnd && prev_cond==TokenOr) || //Error 3: %if {a} %or %and %then - (cond==TOKEN_OR && prev_cond==TOKEN_AND) || + (cond==TokenOr && prev_cond==TokenAnd) || //Error 4: %if %and {a} %then - (attrib_count==0 && (cond==TOKEN_AND || cond==TOKEN_OR))); + (attrib_count==0 && (cond==TokenAnd || cond==TokenOr))); - if(cond==TOKEN_THEN) + if(cond==TokenThen) { /* Returns the parser to the token %then because additional operations is done whe this token is found */ @@ -762,17 +762,17 @@ bool SchemaParser::evaluateExpression(void) end_eval=true; //Error 1: %if {a} %not %then - error=(prev_cond==TOKEN_NOT || + error=(prev_cond==TokenNot || //Error 2: %if %then attrib_count==0 || //Error 3: %if {a} %and %then (and_or_count!=attrib_count-1)); } - else if(cond==TOKEN_OR || cond==TOKEN_AND) + else if(cond==TokenOr || cond==TokenAnd) and_or_count++; break; - case CHR_INI_ATTRIB: + case CharIniAttribute: attrib=getAttribute(); //Raises an error if the attribute does is unknown @@ -784,9 +784,9 @@ bool SchemaParser::evaluateExpression(void) } //Error 1: A conditional token other than %or %not %and if found on conditional expression - error=(!cond.isEmpty() && cond!=TOKEN_OR && cond!=TOKEN_AND && cond!=TOKEN_NOT) || + error=(!cond.isEmpty() && cond!=TokenOr && cond!=TokenAnd && cond!=TokenNot) || //Error 2: A %not token if found after an attribute: %if {a} %not %then - (attrib_count > 0 && cond==TOKEN_NOT && prev_cond.isEmpty()) || + (attrib_count > 0 && cond==TokenNot && prev_cond.isEmpty()) || //Error 3: Two attributes not separated by any conditional token: %if {a} {b} %then (attrib_count > 0 && cond.isEmpty()); @@ -796,12 +796,12 @@ bool SchemaParser::evaluateExpression(void) if(!error) { //Appliyng the NOT operator if found - attrib_true=(cond==TOKEN_NOT ? attributes[attrib].isEmpty() : !attributes[attrib].isEmpty()); + attrib_true=(cond==TokenNot ? attributes[attrib].isEmpty() : !attributes[attrib].isEmpty()); //Executing the AND operation if the token is found - if(cond==TOKEN_AND || prev_cond==TOKEN_AND) + if(cond==TokenAnd || prev_cond==TokenAnd) expr_is_true=(expr_is_true && attrib_true); - else if(cond==TOKEN_OR || prev_cond==TOKEN_OR) + else if(cond==TokenOr || prev_cond==TokenOr) expr_is_true=(expr_is_true || attrib_true); else expr_is_true=attrib_true; @@ -811,16 +811,16 @@ bool SchemaParser::evaluateExpression(void) } break; - case CHR_INI_CEXPR: + case CharIniCompExpr: comp_true=evaluateComparisonExpr(); //Appliyng the NOT operator if found - if(cond==TOKEN_NOT) comp_true=!comp_true; + if(cond==TokenNot) comp_true=!comp_true; //Executing the AND operation if the token is found - if(cond==TOKEN_AND || prev_cond==TOKEN_AND) + if(cond==TokenAnd || prev_cond==TokenAnd) expr_is_true=(expr_is_true && comp_true); - else if(cond==TOKEN_OR || prev_cond==TOKEN_OR) + else if(cond==TokenOr || prev_cond==TokenOr) expr_is_true=(expr_is_true || comp_true); else expr_is_true=comp_true; @@ -855,19 +855,19 @@ bool SchemaParser::evaluateExpression(void) void SchemaParser::ignoreBlankChars(const QString &line) { while(column < line.size() && - (line[column]==CHR_SPACE || - line[column]==CHR_TABULATION)) column++; + (line[column]==CharSpace || + line[column]==CharTabulation)) column++; } char SchemaParser::translateMetaCharacter(const QString &meta) { - static map metas={{ TOKEN_META_SP, CHR_SPACE }, - { TOKEN_META_TB, CHR_TABULATION }, - { TOKEN_META_BR, CHR_LINE_END }, - { TOKEN_META_OB, CHR_INI_PURETEXT }, - { TOKEN_META_CB, CHR_END_PURETEXT }, - { TOKEN_META_OC, CHR_INI_ATTRIB }, - { TOKEN_META_CC, CHR_END_ATTRIB }}; + static map metas={{ TokenMetaSp, CharSpace }, + { TokenMetaTb, CharTabulation }, + { TokenMetaBr, CharLineEnd }, + { TokenMetaOb, CharIniPlainText }, + { TokenMetaCb, CharEndPlainText }, + { TokenMetaOc, CharIniAttribute }, + { TokenMetaCc, CharEndAttribute }}; if(metas.count(meta)==0) { @@ -1043,20 +1043,20 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) { /* Increments the number of rows causing the parser to get the next line buffer for analysis */ - case CHR_LINE_END: + case CharLineEnd: line++; column=0; break; - case CHR_TABULATION: - case CHR_SPACE: + case CharTabulation: + case CharSpace: //The parser will ignore the spaces that are not within pure texts - while(buffer[line][column]==CHR_SPACE || - buffer[line][column]==CHR_TABULATION) column++; + while(buffer[line][column]==CharSpace || + buffer[line][column]==CharTabulation) column++; break; //Metacharacter extraction - case CHR_INI_METACHAR: + case CharIniMetachar: meta=getMetaCharacter(); //Checks whether the metacharacter is part of the 'if' expression (this is an error) @@ -1097,8 +1097,8 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) break; //Attribute extraction - case CHR_INI_ATTRIB: - case CHR_END_ATTRIB: + case CharIniAttribute: + case CharEndAttribute: atrib=getAttribute(); //Checks if the attribute extracted belongs to the passed list of attributes @@ -1122,9 +1122,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) { word=atrib; atrib=QString(); - atrib+=CHR_INI_ATTRIB; + atrib+=CharIniAttribute; atrib+=word; - atrib+=CHR_END_ATTRIB; + atrib+=CharEndAttribute; //If the parser is in the 'if' section if(vet_tk_if[if_level] && @@ -1155,22 +1155,22 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) break; //Conditional instruction extraction - case CHR_INI_CONDITIONAL: + case CharIniConditional: prev_cond=cond; cond=getConditional(); //Checks whether the extracted token is a valid conditional - if(cond!=TOKEN_IF && cond!=TOKEN_ELSE && - cond!=TOKEN_THEN && cond!=TOKEN_END && - cond!=TOKEN_OR && cond!=TOKEN_NOT && - cond!=TOKEN_AND && cond!=TOKEN_SET && - cond!=TOKEN_UNSET) + if(cond!=TokenIf && cond!=TokenElse && + cond!=TokenThen && cond!=TokenEnd && + cond!=TokenOr && cond!=TokenNot && + cond!=TokenAnd && cond!=TokenSet && + cond!=TokenUnset) { throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidInstruction)) .arg(cond).arg(filename).arg(line + comment_count +1).arg(column+1), ErrorType::InvalidInstruction,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(cond==TOKEN_SET || cond==TOKEN_UNSET) + else if(cond==TokenSet || cond==TokenUnset) { bool extract=false; @@ -1182,9 +1182,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) if(!extract && if_level >= 0) { //If in 'else' the related 'if' is false, extracts the attribute - if(prev_cond == TOKEN_ELSE && !vet_expif[if_level]) + if(prev_cond == TokenElse && !vet_expif[if_level]) extract=true; - else if(prev_cond != TOKEN_ELSE) + else if(prev_cond != TokenElse) { //If in the 'if' part all the previous ifs until the current must be true extract=true; @@ -1198,7 +1198,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) if(extract) { - if(cond==TOKEN_SET) + if(cond==TokenSet) defineAttribute(); else unsetAttribute(); @@ -1212,7 +1212,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) else { //If the toke is an 'if' - if(cond==TOKEN_IF) + if(cond==TokenIf) { //Evaluates the if expression storing the result on the vector if_expr=true; @@ -1235,7 +1235,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) if_cnt++; } //If the parser is in 'if / else' and one 'then' token is found - else if(cond==TOKEN_THEN && if_level>=0) + else if(cond==TokenThen && if_level>=0) { //Marks the then token flag of the current 'if' vet_tk_then[if_level]=true; @@ -1246,11 +1246,11 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) if_expr=false; } //If the parser is in 'if / else' and a 'else' token is found - else if(cond==TOKEN_ELSE && if_level>=0) + else if(cond==TokenElse && if_level>=0) //Mark the o flag do token else do if atual vet_tk_else[if_level]=true; //Case the parser is in 'if/else' and a 'end' token was found - else if(cond==TOKEN_END && if_level>=0) + else if(cond==TokenEnd && if_level>=0) { //Increments the number of 'end' tokes found end_cnt++; @@ -1307,7 +1307,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) word=(*itr); //Check if the word is not an attribute - if(!word.isEmpty() && word.startsWith(CHR_INI_ATTRIB) && word.endsWith(CHR_END_ATTRIB)) + if(!word.isEmpty() && word.startsWith(CharIniAttribute) && word.endsWith(CharEndAttribute)) { //If its an attribute, extracts the name between { } and checks if the same has empty value atrib=word.mid(1, word.size()-2); @@ -1359,9 +1359,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) /* Verifying that the conditional words appear in a valid order if not the parser generates an error. Correct order means IF before THEN, ELSE after IF and before END */ - if((prev_cond==TOKEN_IF && cond!=TOKEN_THEN) || - (prev_cond==TOKEN_ELSE && cond!=TOKEN_IF && cond!=TOKEN_END) || - (prev_cond==TOKEN_THEN && cond==TOKEN_THEN)) + if((prev_cond==TokenIf && cond!=TokenThen) || + (prev_cond==TokenElse && cond!=TokenIf && cond!=TokenEnd) || + (prev_cond==TokenThen && cond==TokenThen)) error=true; } @@ -1376,8 +1376,8 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) //Extraction of pure text or simple words default: - if(chr==CHR_INI_PURETEXT || - chr==CHR_END_PURETEXT) + if(chr==CharIniPlainText || + chr==CharEndPlainText) word=getPureText(); else word=getWord(); diff --git a/libparsers/src/schemaparser.h b/libparsers/src/schemaparser.h index 06962822c0..390e4a65ca 100644 --- a/libparsers/src/schemaparser.h +++ b/libparsers/src/schemaparser.h @@ -45,53 +45,52 @@ class SchemaParser { attributes avoiding raising exceptions */ bool ignore_empty_atribs; - static const char CHR_COMMENT, //! \brief Character that starts a comment - CHR_LINE_END, //! \brief Character that indicates end of line - CHR_SPACE, //! \brief Character that indicates spacing - CHR_TABULATION, //! \brief Character that indicates tabulation - CHR_INI_ATTRIB, //! \brief Character that indicates a reference to an attribute - CHR_END_ATTRIB, //! \brief Character that delimits on the right the attribute name - CHR_INI_CONDITIONAL,//! \brief Character that starts a conditional instruction - CHR_INI_METACHAR, //! \brief Character that starts a metacharacter - CHR_INI_PURETEXT, //! \brief Character that starts a puretext - CHR_END_PURETEXT, //! \brief Character that ends a puretext - CHR_INI_CEXPR, //! \brief Character that starts a comparison expression - CHR_END_CEXPR, //! \brief Character that ends a comparison expression - CHR_VAL_DELIM, //! \brief Character that delimiters a value (string) - CHR_VALUE_OF; /*! \brief Character that is used on %set instructions to - create an attribute name based upon another attribute value */ + static const char CharComment, //! \brief Character that starts a comment + CharLineEnd, //! \brief Character that indicates end of line + CharSpace, //! \brief Character that indicates spacing + CharTabulation, //! \brief Character that indicates tabulation + CharIniAttribute, //! \brief Character that indicates a reference to an attribute + CharEndAttribute, //! \brief Character that delimits on the right the attribute name + CharIniConditional, //! \brief Character that starts a conditional instruction + CharIniMetachar, //! \brief Character that starts a metacharacter + CharIniPlainText, //! \brief Character that starts a plain text + CharEndPlainText, //! \brief Character that ends a plain text + CharIniCompExpr, //! \brief Character that starts a comparison expression + CharEndCompExpr, //! \brief Character that ends a comparison expression + CharValueDelim, //! \brief Character that delimiters a value (string) + CharValueOf; /*! \brief Character that is used on %set instructions to + create an attribute name based upon another attribute value */ //! \brief Tokens related to conditional instructions and operators - static const QString TOKEN_IF, // %if - TOKEN_THEN,// %then - TOKEN_ELSE,// %else - TOKEN_END, // %end - TOKEN_OR, // %or - TOKEN_NOT, // %not - TOKEN_AND, // %and - TOKEN_SET, //%set - TOKEN_UNSET; //%unset - + static const QString TokenIf, // %if + TokenThen,// %then + TokenElse,// %else + TokenEnd, // %end + TokenOr, // %or + TokenNot, // %not + TokenAnd, // %and + TokenSet, //%set + TokenUnset; //%unset //! \brief Tokens related to metacharacters - static const QString TOKEN_META_SP,// $sp (space) - TOKEN_META_BR,// $br (line break) - TOKEN_META_TB,// $tb (tabulation) - TOKEN_META_OB,// $ob (open square bracket '[') - TOKEN_META_CB,// $cb (close square bracket ']') - TOKEN_META_OC,// $ob (open curly bracket '{') - TOKEN_META_CC;// $cb (close curly bracket '}') + static const QString TokenMetaSp,// $sp (space) + TokenMetaBr,// $br (line break) + TokenMetaTb,// $tb (tabulation) + TokenMetaOb,// $ob (open square bracket '[') + TokenMetaCb,// $cb (close square bracket ']') + TokenMetaOc,// $ob (open curly bracket '{') + TokenMetaCc;// $cb (close curly bracket '}') //! \brief Tokens related to comparison expressions - static const QString TOKEN_EQ_OP,// == (equal) - TOKEN_NE_OP,// != (not equal) - TOKEN_GT_OP,// > (greater than) - TOKEN_LT_OP,// < (less than) - TOKEN_GT_EQ_OP,// >= (greater or equal to) - TOKEN_LT_EQ_OP;// <= (less or equal to) + static const QString TokenEqOper,// == (equal) + TokenNeOper,// != (not equal) + TokenGtOper,// > (greater than) + TokenLtOper,// < (less than) + TokenGtEqOper,// >= (greater or equal to) + TokenLtEqOper;// <= (less or equal to) //! \brief RegExp used to validate attribute names - static const QRegExp ATTR_REGEXP; + static const QRegExp AttribRegExp; //! \brief Get an attribute name from the buffer on the current position QString getAttribute(void); diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 63fd7e94ef..38f71a3a3a 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -153,7 +153,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename QRectF rect=scene->itemsBoundingRect(true); //Give some margin to the resulting image - QSizeF margin=QSizeF(5 * BaseObjectView::HORIZ_SPACING, 5 * BaseObjectView::VERT_SPACING); + QSizeF margin=QSizeF(5 * BaseObjectView::HorizSpacing, 5 * BaseObjectView::VertSpacing); rect.setTopLeft(rect.topLeft() - QPointF(margin.width(), margin.height())); rect.setSize(rect.size() + margin); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index a49400db91..8625ee6848 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -306,15 +306,15 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr constr_type=dynamic_cast(object)->getConstraintType(); if(constr_type==ConstraintType::primary_key) - str_aux=QString("_%1").arg(TableObjectView::TXT_PRIMARY_KEY); + str_aux=QString("_%1").arg(TableObjectView::TextPrimaryKey); else if(constr_type==ConstraintType::foreign_key) - str_aux=QString("_%1").arg(TableObjectView::TXT_FOREIGN_KEY); + str_aux=QString("_%1").arg(TableObjectView::TextForeignKey); else if(constr_type==ConstraintType::check) - str_aux=QString("_%1").arg(TableObjectView::TXT_CHECK); + str_aux=QString("_%1").arg(TableObjectView::TextCheck); else if(constr_type==ConstraintType::unique) - str_aux=QString("_%1").arg(TableObjectView::TXT_UNIQUE); + str_aux=QString("_%1").arg(TableObjectView::TextUnique); else if(constr_type==ConstraintType::exclude) - str_aux=QString("_%1").arg(TableObjectView::TXT_EXCLUDE); + str_aux=QString("_%1").arg(TableObjectView::TextExclude); } item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(obj_type) + str_aux))); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 915e7e9a7d..9123554965 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1917,7 +1917,7 @@ void ModelWidget::moveToSchema(void) if(dst_schema && dst_schema->isVisible()) { p.setX(dst_schema->pos().x()); - p.setY(dst_schema->pos().y() + dst_schema->boundingRect().height() + BaseObjectView::VERT_SPACING); + p.setY(dst_schema->pos().y() + dst_schema->boundingRect().height() + BaseObjectView::VertSpacing); dynamic_cast(obj_graph->getReceiverObject())->setPos(p); } } @@ -3883,11 +3883,11 @@ void ModelWidget::configurePopupMenu(const vector &objects) { switch(!constr->getConstraintType()) { - case ConstraintType::primary_key: str_aux=QString("_%1").arg(TableObjectView::TXT_PRIMARY_KEY); break; - case ConstraintType::foreign_key: str_aux=QString("_%1").arg(TableObjectView::TXT_FOREIGN_KEY); break; - case ConstraintType::check: str_aux=QString("_%1").arg(TableObjectView::TXT_CHECK); break; - case ConstraintType::unique: str_aux=QString("_%1").arg(TableObjectView::TXT_UNIQUE); break; - case ConstraintType::exclude: str_aux=QString("_%1").arg(TableObjectView::TXT_EXCLUDE); break; + case ConstraintType::primary_key: str_aux=QString("_%1").arg(TableObjectView::TextPrimaryKey); break; + case ConstraintType::foreign_key: str_aux=QString("_%1").arg(TableObjectView::TextForeignKey); break; + case ConstraintType::check: str_aux=QString("_%1").arg(TableObjectView::TextCheck); break; + case ConstraintType::unique: str_aux=QString("_%1").arg(TableObjectView::TextUnique); break; + case ConstraintType::exclude: str_aux=QString("_%1").arg(TableObjectView::TextExclude); break; } //For each constaint is created a menu with the edit, source code, protect/unprotect and delete actions diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 9ea1294ce6..bf6c43ad24 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -183,11 +183,11 @@ void RelationshipConfigWidget::applyConfiguration(void) if(!crows_foot_rb->isChecked()) { if(fk_to_pk_rb->isChecked()) - RelationshipView::setLineConnectionMode(RelationshipView::CONNECT_FK_TO_PK); + RelationshipView::setLineConnectionMode(RelationshipView::ConnectFkToPk); else if(tab_edges_rb->isChecked()) - RelationshipView::setLineConnectionMode(RelationshipView::CONNECT_TABLE_EGDES); + RelationshipView::setLineConnectionMode(RelationshipView::ConnectTableEdges); else - RelationshipView::setLineConnectionMode(RelationshipView::CONNECT_CENTER_PNTS); + RelationshipView::setLineConnectionMode(RelationshipView::ConnectCenterPoints); } } diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 17a8220e22..5356ad1486 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -434,11 +434,11 @@ void TableWidget::showObjectData(TableObject *object, int row) QStringList contr_types={ ~ConstraintType(ConstraintType::primary_key), ~ConstraintType(ConstraintType::foreign_key), ~ConstraintType(ConstraintType::check), ~ConstraintType(ConstraintType::unique), QString("NOT NULL") }, - constr_codes={ TableObjectView::TXT_PRIMARY_KEY, - TableObjectView::TXT_FOREIGN_KEY, - TableObjectView::TXT_CHECK, - TableObjectView::TXT_UNIQUE, - TableObjectView::TXT_NOT_NULL}; + constr_codes={ TableObjectView::TextPrimaryKey, + TableObjectView::TextForeignKey, + TableObjectView::TextCheck, + TableObjectView::TextUnique, + TableObjectView::TextNotNull}; QFont font; unsigned i; @@ -490,7 +490,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(str_aux1,row,4); - if(str_aux.indexOf(TableObjectView::TXT_PRIMARY_KEY) >= 0) + if(str_aux.indexOf(TableObjectView::TextPrimaryKey) >= 0) tab->setCellCheckState(row, 0, Qt::Checked); else tab->setCellCheckState(row, 0, Qt::Unchecked); @@ -920,7 +920,7 @@ void TableWidget::applyConfiguration(void) op_list->finishOperationChain(); finishConfiguration(); - if(RelationshipView::getLineConnectinMode()==RelationshipView::CONNECT_FK_TO_PK) + if(RelationshipView::getLineConnectinMode()==RelationshipView::ConnectFkToPk) { /* Forcing the update of relationships connected to the table in order to reconfigure the line in case of the relationship is using the CONNECT_FK_TO_PK line mode */ From 82ff0c70487775b6d6c8314e0147280f6bbf246e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 17:18:59 -0300 Subject: [PATCH 159/425] Refactored the itens in the enum ObjectType --- libobjrenderer/src/baseobjectview.cpp | 2 +- libobjrenderer/src/graphicalview.cpp | 12 +- libobjrenderer/src/objectsscene.cpp | 32 +- libobjrenderer/src/relationshipview.cpp | 2 +- libobjrenderer/src/schemaview.cpp | 4 +- libobjrenderer/src/tableobjectview.cpp | 8 +- libobjrenderer/src/tabletitleview.cpp | 8 +- libobjrenderer/src/tableview.cpp | 24 +- libobjrenderer/src/textboxview.cpp | 4 +- libpgconnector/src/catalog.cpp | 70 +- libpgmodeler/src/aggregate.cpp | 4 +- libpgmodeler/src/basegraphicobject.cpp | 4 +- libpgmodeler/src/baseobject.cpp | 168 +-- libpgmodeler/src/baseobject.h | 76 +- libpgmodeler/src/baserelationship.cpp | 8 +- libpgmodeler/src/basetable.cpp | 2 +- libpgmodeler/src/cast.cpp | 12 +- libpgmodeler/src/collation.cpp | 2 +- libpgmodeler/src/column.cpp | 8 +- libpgmodeler/src/constraint.cpp | 4 +- libpgmodeler/src/conversion.cpp | 12 +- libpgmodeler/src/databasemodel.cpp | 1116 ++++++++--------- libpgmodeler/src/databasemodel.h | 2 +- libpgmodeler/src/domain.cpp | 4 +- libpgmodeler/src/eventtrigger.cpp | 6 +- libpgmodeler/src/extension.cpp | 2 +- libpgmodeler/src/function.cpp | 4 +- libpgmodeler/src/genericsql.cpp | 2 +- libpgmodeler/src/index.cpp | 2 +- libpgmodeler/src/language.cpp | 6 +- libpgmodeler/src/operationlist.cpp | 88 +- libpgmodeler/src/operator.cpp | 8 +- libpgmodeler/src/operatorclass.cpp | 2 +- libpgmodeler/src/operatorfamily.cpp | 2 +- libpgmodeler/src/parameter.cpp | 2 +- libpgmodeler/src/permission.cpp | 36 +- libpgmodeler/src/pgmodelerns.cpp | 60 +- libpgmodeler/src/pgmodelerns.h | 10 +- libpgmodeler/src/policy.cpp | 6 +- libpgmodeler/src/relationship.cpp | 62 +- libpgmodeler/src/role.cpp | 2 +- libpgmodeler/src/rule.cpp | 2 +- libpgmodeler/src/schema.cpp | 4 +- libpgmodeler/src/sequence.cpp | 2 +- libpgmodeler/src/table.cpp | 172 +-- libpgmodeler/src/table.h | 2 +- libpgmodeler/src/tableobject.cpp | 4 +- libpgmodeler/src/tablespace.cpp | 4 +- libpgmodeler/src/tag.cpp | 2 +- libpgmodeler/src/textbox.cpp | 2 +- libpgmodeler/src/trigger.cpp | 16 +- libpgmodeler/src/type.cpp | 8 +- libpgmodeler/src/typeattribute.cpp | 2 +- libpgmodeler/src/view.cpp | 30 +- libpgmodeler_ui/src/aggregatewidget.cpp | 10 +- .../src/appearanceconfigwidget.cpp | 36 +- libpgmodeler_ui/src/baseform.cpp | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 80 +- libpgmodeler_ui/src/baseobjectwidget.h | 6 +- libpgmodeler_ui/src/castwidget.cpp | 6 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 24 +- libpgmodeler_ui/src/collationwidget.cpp | 4 +- libpgmodeler_ui/src/columnwidget.cpp | 8 +- libpgmodeler_ui/src/constraintwidget.cpp | 8 +- libpgmodeler_ui/src/conversionwidget.cpp | 6 +- libpgmodeler_ui/src/customsqlwidget.cpp | 14 +- .../src/databaseexplorerwidget.cpp | 266 ++-- libpgmodeler_ui/src/databaseimportform.cpp | 46 +- libpgmodeler_ui/src/databaseimportform.h | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 348 ++--- libpgmodeler_ui/src/databaseimporthelper.h | 2 +- libpgmodeler_ui/src/databasewidget.cpp | 28 +- libpgmodeler_ui/src/datamanipulationform.cpp | 56 +- libpgmodeler_ui/src/domainwidget.cpp | 4 +- libpgmodeler_ui/src/elementwidget.cpp | 22 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 6 +- libpgmodeler_ui/src/extensionwidget.cpp | 4 +- libpgmodeler_ui/src/functionwidget.cpp | 24 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 4 +- libpgmodeler_ui/src/indexwidget.cpp | 4 +- libpgmodeler_ui/src/languagewidget.cpp | 10 +- libpgmodeler_ui/src/mainwindow.cpp | 6 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 2 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 8 +- libpgmodeler_ui/src/modelexportform.cpp | 2 +- libpgmodeler_ui/src/modelexporthelper.cpp | 76 +- libpgmodeler_ui/src/modelexporthelper.h | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 104 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 66 +- libpgmodeler_ui/src/modelsdiffhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 38 +- libpgmodeler_ui/src/modelvalidationhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationwidget.cpp | 4 +- libpgmodeler_ui/src/modelwidget.cpp | 426 +++---- .../src/newobjectoverlaywidget.cpp | 88 +- libpgmodeler_ui/src/objectdepsrefswidget.cpp | 4 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 12 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 16 +- libpgmodeler_ui/src/objectsdiffinfo.cpp | 6 +- libpgmodeler_ui/src/objectselectorwidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 2 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 14 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 4 +- libpgmodeler_ui/src/operatorwidget.cpp | 8 +- libpgmodeler_ui/src/parameterwidget.cpp | 4 +- libpgmodeler_ui/src/permissionwidget.cpp | 10 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 10 +- libpgmodeler_ui/src/policywidget.cpp | 8 +- libpgmodeler_ui/src/referencewidget.cpp | 2 +- libpgmodeler_ui/src/relationshipwidget.cpp | 76 +- libpgmodeler_ui/src/resultsetmodel.cpp | 2 +- libpgmodeler_ui/src/rolewidget.cpp | 6 +- libpgmodeler_ui/src/rulewidget.cpp | 4 +- libpgmodeler_ui/src/schemawidget.cpp | 4 +- libpgmodeler_ui/src/sequencewidget.cpp | 6 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 12 +- libpgmodeler_ui/src/snippetsconfigwidget.h | 2 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 20 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 12 +- libpgmodeler_ui/src/tabledatawidget.cpp | 10 +- libpgmodeler_ui/src/tablespacewidget.cpp | 4 +- libpgmodeler_ui/src/tablewidget.cpp | 190 +-- libpgmodeler_ui/src/tagwidget.cpp | 4 +- libpgmodeler_ui/src/textboxwidget.cpp | 4 +- libpgmodeler_ui/src/triggerwidget.cpp | 16 +- libpgmodeler_ui/src/typewidget.cpp | 12 +- libpgmodeler_ui/src/viewwidget.cpp | 72 +- main-cli/src/pgmodelercli.cpp | 78 +- main-cli/src/pgmodelercli.h | 2 +- plugins/xml2object/src/xml2objectwidget.cpp | 2 +- 131 files changed, 2318 insertions(+), 2318 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 3d6f98e8de..bb752dde47 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -161,7 +161,7 @@ void BaseObjectView::setSourceObject(BaseObject *object) this->addToGroup(pos_info_txt); } - if(!sql_disabled_box && object->getObjectType()!=OBJ_TEXTBOX) + if(!sql_disabled_box && object->getObjectType()!=ObjTextbox) { sql_disabled_txt=new QGraphicsSimpleTextItem; sql_disabled_box=new QGraphicsRectItem; diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 93d329a1a9..751d9b2e67 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -97,14 +97,14 @@ void GraphicalView::configureObject(void) i--; } - tab_objs.assign(view->getObjectList(OBJ_RULE)->begin(), - view->getObjectList(OBJ_RULE)->end()); + tab_objs.assign(view->getObjectList(ObjRule)->begin(), + view->getObjectList(ObjRule)->end()); tab_objs.insert(tab_objs.end(), - view->getObjectList(OBJ_TRIGGER)->begin(), - view->getObjectList(OBJ_TRIGGER)->end()); + view->getObjectList(ObjTrigger)->begin(), + view->getObjectList(ObjTrigger)->end()); tab_objs.insert(tab_objs.end(), - view->getObjectList(OBJ_INDEX)->begin(), - view->getObjectList(OBJ_INDEX)->end()); + view->getObjectList(ObjIndex)->begin(), + view->getObjectList(ObjIndex)->end()); ext_attribs->setVisible(!tab_objs.empty() && !hide_ext_attribs); ext_attribs_body->setVisible(!tab_objs.empty() && !hide_ext_attribs); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 1ef56dfd86..3aa4cbd89a 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -71,8 +71,8 @@ ObjectsScene::~ObjectsScene(void) { QGraphicsItemGroup *item=nullptr; QList items; - ObjectType obj_types[]={ OBJ_RELATIONSHIP, OBJ_TEXTBOX, - OBJ_VIEW, OBJ_TABLE, OBJ_SCHEMA }; + ObjectType obj_types[]={ ObjRelationship, ObjTextbox, + ObjView, ObjTable, ObjSchema }; unsigned i, count=sizeof(obj_types)/sizeof(ObjectType); this->removeItem(selection_rect); @@ -95,12 +95,12 @@ ObjectsScene::~ObjectsScene(void) /* Case the object is converted to a item group and can be converted to database objects, indicates that the object can be removed from the scene */ if(item && !item->parentItem() && - ((dynamic_cast(item) && obj_types[i]==OBJ_RELATIONSHIP) || - (dynamic_cast(item) && obj_types[i]==OBJ_TEXTBOX) || - (dynamic_cast(item) && obj_types[i]==OBJ_TEXTBOX) || - (dynamic_cast(item) && obj_types[i]==OBJ_VIEW) || - (dynamic_cast(item) && obj_types[i]==OBJ_TABLE) || - (dynamic_cast(item) && obj_types[i]==OBJ_SCHEMA))) + ((dynamic_cast(item) && obj_types[i]==ObjRelationship) || + (dynamic_cast(item) && obj_types[i]==ObjTextbox) || + (dynamic_cast(item) && obj_types[i]==ObjTextbox) || + (dynamic_cast(item) && obj_types[i]==ObjView) || + (dynamic_cast(item) && obj_types[i]==ObjTable) || + (dynamic_cast(item) && obj_types[i]==ObjSchema))) { this->removeItem(item); @@ -173,8 +173,8 @@ QRectF ObjectsScene::itemsBoundingRect(bool seek_only_db_objs, bool selected_onl if(graph_obj) { - if(graph_obj->getObjectType()!=OBJ_RELATIONSHIP && - graph_obj->getObjectType()!=BASE_RELATIONSHIP) + if(graph_obj->getObjectType()!=ObjRelationship && + graph_obj->getObjectType()!=ObjBaseRelationship) pnt=graph_obj->getPosition(); else pnt=dynamic_cast(obj_view)->__boundingRect().topLeft(); @@ -187,8 +187,8 @@ QRectF ObjectsScene::itemsBoundingRect(bool seek_only_db_objs, bool selected_onl if(selected_only) { - if(graph_obj->getObjectType()!=OBJ_RELATIONSHIP && - graph_obj->getObjectType()!=BASE_RELATIONSHIP) + if(graph_obj->getObjectType()!=ObjRelationship && + graph_obj->getObjectType()!=ObjBaseRelationship) pnt = pnt + dynamic_cast(obj_view)->boundingRect().bottomRight(); else pnt = pnt + dynamic_cast(obj_view)->__boundingRect().bottomRight(); @@ -291,8 +291,8 @@ void ObjectsScene::showRelationshipLine(bool value, const QPointF &p_start) base_obj=dynamic_cast(object->getSourceObject()); if(!value && base_obj && - base_obj->getObjectType()!=OBJ_RELATIONSHIP && - base_obj->getObjectType()!=BASE_RELATIONSHIP && + base_obj->getObjectType()!=ObjRelationship && + base_obj->getObjectType()!=ObjBaseRelationship && !base_obj->isProtected()) flags=QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | @@ -907,8 +907,8 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) if(!schema->isProtected()) { //Get the table-table and table-view relationships - rels=dynamic_cast(schema->getDatabase())->getObjects(OBJ_RELATIONSHIP, schema); - base_rels=dynamic_cast(schema->getDatabase())->getObjects(BASE_RELATIONSHIP, schema); + rels=dynamic_cast(schema->getDatabase())->getObjects(ObjRelationship, schema); + base_rels=dynamic_cast(schema->getDatabase())->getObjects(ObjBaseRelationship, schema); rels.insert(rels.end(), base_rels.begin(), base_rels.end()); for(auto &rel : rels) diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 8a2cb34bc7..f51f8a71b6 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1226,7 +1226,7 @@ void RelationshipView::configureLine(void) for semantics purposes shows the type of this relationship as "Relationship" unlike "Link" */ if(rel_type==BaseRelationship::RELATIONSHIP_FK) tool_tip=base_rel->getName(true) + - QString(" (") + BaseObject::getTypeName(OBJ_RELATIONSHIP) + QString(")"); + QString(" (") + BaseObject::getTypeName(ObjRelationship) + QString(")"); else tool_tip=base_rel->getName(true) + QString(" (") + base_rel->getTypeName() + QString(")"); diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index d1322986de..faa9e94605 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -77,8 +77,8 @@ void SchemaView::fetchChildren(void) vector objs, objs1; //Gets all tables and views that belongs to the schema - objs=model->getObjects(OBJ_TABLE, schema); - objs1=model->getObjects(OBJ_VIEW, schema); + objs=model->getObjects(ObjTable, schema); + objs1=model->getObjects(ObjView, schema); objs.insert(objs.end(), objs1.begin(), objs1.end()); children.clear(); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 129ac2aa16..c5f71d39b5 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -54,7 +54,7 @@ TableObjectView::~TableObjectView(void) void TableObjectView::configureDescriptor(ConstraintType constr_type) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; Column *column=dynamic_cast(this->getSourceObject()); bool ellipse_desc=false; double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); @@ -150,7 +150,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setPen(pen); } } - else if(obj_type != BASE_OBJECT) + else if(obj_type != ObjBaseObject) { TableObject *tab_obj=dynamic_cast(this->getSourceObject()); QGraphicsPolygonItem *desc=dynamic_cast(descriptor); @@ -556,8 +556,8 @@ QString TableObjectView::getConstraintString(Column *column) vector::iterator itr,itr_end; ConstraintType constr_type; - itr=table->getObjectList(OBJ_CONSTRAINT)->begin(); - itr_end=table->getObjectList(OBJ_CONSTRAINT)->end(); + itr=table->getObjectList(ObjConstraint)->begin(); + itr_end=table->getObjectList(ObjConstraint)->end(); while(itr!=itr_end) { diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 3e6c43aee3..ff95b84ff3 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -60,14 +60,14 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(!object) throw Exception(OprNotAllocatedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Raises an error if the object is invalid - else if(object->getObjectType()!=OBJ_TABLE && - object->getObjectType()!=OBJ_VIEW) + else if(object->getObjectType()!=ObjTable && + object->getObjectType()!=ObjView) throw Exception(OprObjectInvalidType, __PRETTY_FUNCTION__, __FILE__, __LINE__); schema=dynamic_cast(object->getSchema()); tag=dynamic_cast(object)->getTag(); - if(object->getObjectType()==OBJ_VIEW && !tag) + if(object->getObjectType()==ObjView && !tag) { name_attrib=ParsersAttributes::VIEW_NAME; schema_name_attrib=ParsersAttributes::VIEW_SCHEMA_NAME; @@ -122,7 +122,7 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(tag) pen.setColor(tag->getElementColor(title_color_attrib, Tag::BORDER_COLOR)); - if(object->getObjectType()==OBJ_VIEW || + if(object->getObjectType()==ObjView || (table && table->isPartition())) pen.setStyle(Qt::DashLine); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 0befcc3876..1982687867 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -54,25 +54,25 @@ void TableView::configureObject(void) if(obj_idx==0) { - tab_objs.assign(table->getObjectList(OBJ_COLUMN)->begin(), - table->getObjectList(OBJ_COLUMN)->end()); + tab_objs.assign(table->getObjectList(ObjColumn)->begin(), + table->getObjectList(ObjColumn)->end()); } else { - tab_objs.assign(table->getObjectList(OBJ_CONSTRAINT)->begin(), - table->getObjectList(OBJ_CONSTRAINT)->end()); + tab_objs.assign(table->getObjectList(ObjConstraint)->begin(), + table->getObjectList(ObjConstraint)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(OBJ_TRIGGER)->begin(), - table->getObjectList(OBJ_TRIGGER)->end()); + table->getObjectList(ObjTrigger)->begin(), + table->getObjectList(ObjTrigger)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(OBJ_INDEX)->begin(), - table->getObjectList(OBJ_INDEX)->end()); + table->getObjectList(ObjIndex)->begin(), + table->getObjectList(ObjIndex)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(OBJ_RULE)->begin(), - table->getObjectList(OBJ_RULE)->end()); + table->getObjectList(ObjRule)->begin(), + table->getObjectList(ObjRule)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(OBJ_POLICY)->begin(), - table->getObjectList(OBJ_POLICY)->end()); + table->getObjectList(ObjPolicy)->begin(), + table->getObjectList(ObjPolicy)->end()); } //Gets the subitems of the current group diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 1388cfe7a4..fdc25d7599 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -89,8 +89,8 @@ void TextboxView::__configureObject(void) if(!override_style) { QFont font; - box->setBrush(this->getFillStyle(BaseObject::getSchemaName(OBJ_TEXTBOX))); - box->setPen(this->getBorderStyle(BaseObject::getSchemaName(OBJ_TEXTBOX))); + box->setBrush(this->getFillStyle(BaseObject::getSchemaName(ObjTextbox))); + box->setPen(this->getBorderStyle(BaseObject::getSchemaName(ObjTextbox))); font=fmt.font(); font.setItalic(txtbox->getTextAttribute(Textbox::ITALIC_TXT)); diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 04a3bfa855..c54847f10f 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -30,35 +30,35 @@ const QString Catalog::PGMODELER_TEMP_DB_OBJ=QString("__pgmodeler_tmp"); attribs_map Catalog::catalog_queries; map Catalog::oid_fields= -{ {OBJ_DATABASE, "oid"}, {OBJ_ROLE, "oid"}, {OBJ_SCHEMA,"oid"}, - {OBJ_LANGUAGE, "oid"}, {OBJ_TABLESPACE, "oid"}, {OBJ_EXTENSION, "ex.oid"}, - {OBJ_FUNCTION, "pr.oid"}, {OBJ_AGGREGATE, "pr.oid"}, {OBJ_OPERATOR, "op.oid"}, - {OBJ_OPCLASS, "op.oid"}, {OBJ_OPFAMILY, "op.oid"}, {OBJ_COLLATION, "cl.oid"}, - {OBJ_CONVERSION, "cn.oid"}, {OBJ_CAST, "cs.oid"}, {OBJ_VIEW, "vw.oid"}, - {OBJ_SEQUENCE, "sq.oid"}, {OBJ_DOMAIN, "dm.oid"}, {OBJ_TYPE, "tp.oid"}, - {OBJ_TABLE, "tb.oid"}, {OBJ_COLUMN, "cl.oid"}, {OBJ_CONSTRAINT, "cs.oid"}, - {OBJ_RULE, "rl.oid"}, {OBJ_TRIGGER, "tg.oid"}, {OBJ_INDEX, "id.indexrelid"}, - {OBJ_EVENT_TRIGGER, "et.oid"}, {OBJ_POLICY, "pl.oid"} +{ {ObjDatabase, "oid"}, {ObjRole, "oid"}, {ObjSchema,"oid"}, + {ObjLanguage, "oid"}, {ObjTablespace, "oid"}, {ObjExtension, "ex.oid"}, + {ObjFunction, "pr.oid"}, {ObjAggregate, "pr.oid"}, {ObjOperator, "op.oid"}, + {ObjOpClass, "op.oid"}, {ObjOpFamily, "op.oid"}, {ObjCollation, "cl.oid"}, + {ObjConversion, "cn.oid"}, {ObjCast, "cs.oid"}, {ObjView, "vw.oid"}, + {ObjSequence, "sq.oid"}, {ObjDomain, "dm.oid"}, {ObjType, "tp.oid"}, + {ObjTable, "tb.oid"}, {ObjColumn, "cl.oid"}, {ObjConstraint, "cs.oid"}, + {ObjRule, "rl.oid"}, {ObjTrigger, "tg.oid"}, {ObjIndex, "id.indexrelid"}, + {ObjEventTrigger, "et.oid"}, {ObjPolicy, "pl.oid"} }; map Catalog::ext_oid_fields={ - {OBJ_CONSTRAINT, "cs.conrelid"}, - {OBJ_INDEX, "id.indexrelid"}, - {OBJ_TRIGGER, "tg.tgrelid"}, - {OBJ_RULE, "rl.ev_class"}, - {OBJ_POLICY, "pl.polrelid"} + {ObjConstraint, "cs.conrelid"}, + {ObjIndex, "id.indexrelid"}, + {ObjTrigger, "tg.tgrelid"}, + {ObjRule, "rl.ev_class"}, + {ObjPolicy, "pl.polrelid"} }; map Catalog::name_fields= -{ {OBJ_DATABASE, "datname"}, {OBJ_ROLE, "rolname"}, {OBJ_SCHEMA,"nspname"}, - {OBJ_LANGUAGE, "lanname"}, {OBJ_TABLESPACE, "spcname"}, {OBJ_EXTENSION, "extname"}, - {OBJ_FUNCTION, "proname"}, {OBJ_AGGREGATE, "proname"}, {OBJ_OPERATOR, "oprname"}, - {OBJ_OPCLASS, "opcname"}, {OBJ_OPFAMILY, "opfname"}, {OBJ_COLLATION, "collname"}, - {OBJ_CONVERSION, "conname"}, {OBJ_CAST, ""}, {OBJ_VIEW, "relname"}, - {OBJ_SEQUENCE, "relname"}, {OBJ_DOMAIN, "typname"}, {OBJ_TYPE, "typname"}, - {OBJ_TABLE, "relname"}, {OBJ_COLUMN, "attname"}, {OBJ_CONSTRAINT, "conname"}, - {OBJ_RULE, "rulename"}, {OBJ_TRIGGER, "tgname"}, {OBJ_INDEX, "relname"}, - {OBJ_EVENT_TRIGGER, "evtname"}, {OBJ_POLICY, "polname"} +{ {ObjDatabase, "datname"}, {ObjRole, "rolname"}, {ObjSchema,"nspname"}, + {ObjLanguage, "lanname"}, {ObjTablespace, "spcname"}, {ObjExtension, "extname"}, + {ObjFunction, "proname"}, {ObjAggregate, "proname"}, {ObjOperator, "oprname"}, + {ObjOpClass, "opcname"}, {ObjOpFamily, "opfname"}, {ObjCollation, "collname"}, + {ObjConversion, "conname"}, {ObjCast, ""}, {ObjView, "relname"}, + {ObjSequence, "relname"}, {ObjDomain, "typname"}, {ObjType, "typname"}, + {ObjTable, "relname"}, {ObjColumn, "attname"}, {ObjConstraint, "conname"}, + {ObjRule, "rulename"}, {ObjTrigger, "tgname"}, {ObjIndex, "relname"}, + {ObjEventTrigger, "evtname"}, {ObjPolicy, "polname"} }; Catalog::Catalog(void) @@ -84,7 +84,7 @@ void Catalog::setConnection(Connection &conn) connection.connect(); //Retrieving the last system oid - executeCatalogQuery(QUERY_LIST, OBJ_DATABASE, res, true, + executeCatalogQuery(QUERY_LIST, ObjDatabase, res, true, {{ParsersAttributes::NAME, conn.getConnectionParam(Connection::PARAM_DB_NAME)}}); if(res.accessTuple(ResultSet::FIRST_TUPLE)) @@ -197,7 +197,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b else attribs[ParsersAttributes::OID_FILTER_OP]=QString(">"); - if(obj_type==OBJ_TYPE && exclude_array_types) + if(obj_type==ObjType && exclude_array_types) attribs[ParsersAttributes::EXC_BUILTIN_ARRAYS]=ParsersAttributes::_TRUE_; //Checking if the custom filter expression is present @@ -207,7 +207,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b attribs.erase(ParsersAttributes::CUSTOM_FILTER); } - if(exclude_ext_objs && obj_type!=OBJ_DATABASE && obj_type!=OBJ_ROLE && obj_type!=OBJ_TABLESPACE && obj_type!=OBJ_EXTENSION) + if(exclude_ext_objs && obj_type!=ObjDatabase && obj_type!=ObjRole && obj_type!=ObjTablespace && obj_type!=ObjExtension) { if(ext_oid_fields.count(obj_type)==0) attribs[ParsersAttributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(oid_fields[obj_type]); @@ -287,9 +287,9 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map types=BaseObject::getObjectTypes(true, { OBJ_DATABASE, OBJ_RELATIONSHIP, BASE_RELATIONSHIP, - OBJ_TEXTBOX, OBJ_TAG, OBJ_COLUMN, OBJ_PERMISSION, - OBJ_GENERIC_SQL }); + vector types=BaseObject::getObjectTypes(true, { ObjDatabase, ObjRelationship, ObjBaseRelationship, + ObjTextbox, ObjTag, ObjColumn, ObjPermission, + ObjGenericSQL }); attribs_map attribs, col_attribs, sch_names; vector tab_attribs; unsigned tab_oid=0; @@ -303,16 +303,16 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map Catalog::getObjectsAttributes(ObjectType obj_type, const QSt { try { - bool is_shared_obj=(obj_type==OBJ_DATABASE || obj_type==OBJ_ROLE || obj_type==OBJ_TABLESPACE || - obj_type==OBJ_LANGUAGE || obj_type==OBJ_CAST); + bool is_shared_obj=(obj_type==ObjDatabase || obj_type==ObjRole || obj_type==ObjTablespace || + obj_type==ObjLanguage || obj_type==ObjCast); extra_attribs[ParsersAttributes::SCHEMA]=schema; extra_attribs[ParsersAttributes::TABLE]=table; @@ -600,7 +600,7 @@ vector Catalog::getObjectsAttributes(ObjectType obj_type, const QSt extra_attribs[ParsersAttributes::FILTER_OIDS]=createOidFilter(filter_oids); //Retrieve the comment catalog query. Only columns need to retreive comments in their own catalog query file - if(obj_type != OBJ_COLUMN) + if(obj_type != ObjColumn) extra_attribs[ParsersAttributes::COMMENT]=getCommentQuery(oid_fields[obj_type], is_shared_obj); return(getMultipleAttributes(obj_type, extra_attribs)); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 1582754cae..7cfd5b2dde 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -20,7 +20,7 @@ Aggregate::Aggregate(void) { - obj_type=OBJ_AGGREGATE; + obj_type=ObjAggregate; functions[0]=functions[1]=nullptr; sort_operator=nullptr; attributes[ParsersAttributes::TYPES]=QString(); @@ -42,7 +42,7 @@ void Aggregate::setFunction(unsigned func_idx, Function *func) if(!isValidFunction(func_idx, func)) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidConfiguration) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_AGGREGATE)), + .arg(BaseObject::getTypeName(ObjAggregate)), AsgFunctionInvalidConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(functions[func_idx]!=func); diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index ca626a5a38..8b38285531 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -118,6 +118,6 @@ QObject *BaseGraphicObject::getReceiverObject(void) bool BaseGraphicObject::isGraphicObject(ObjectType type) { - return(type==OBJ_TABLE || type==OBJ_VIEW || type==OBJ_RELATIONSHIP || - type==BASE_RELATIONSHIP || type==OBJ_TEXTBOX || type==OBJ_SCHEMA); + return(type==ObjTable || type==ObjView || type==ObjRelationship || + type==ObjBaseRelationship || type==ObjTextbox || type==ObjSchema); } diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 7ae98d7007..8d4cc51ce1 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -76,7 +76,7 @@ BaseObject::BaseObject(void) object_id=BaseObject::global_id++; is_protected=system_obj=sql_disabled=false; code_invalidated=true; - obj_type=BASE_OBJECT; + obj_type=ObjBaseObject; schema=nullptr; owner=nullptr; tablespace=nullptr; @@ -105,7 +105,7 @@ unsigned BaseObject::getGlobalId(void) QString BaseObject::getTypeName(ObjectType obj_type) { - if(obj_type!=BASE_OBJECT) + if(obj_type!=ObjBaseObject) /* Due to the class BaseObject not be derived from QObject the function tr() is inefficient to translate the type names thus the method called to do the translation is from the application specifying the context (BaseObject) in the ts file and the text to be translated */ @@ -121,7 +121,7 @@ QString BaseObject::getTypeName(const QString &type_str) ObjectType BaseObject::getObjectType(const QString &type_name) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; for(int i=0; i < BaseObject::OBJECT_TYPE_COUNT; i++) { @@ -324,7 +324,7 @@ bool BaseObject::isValidName(const QString &name) void BaseObject::setDatabase(BaseObject *db) { - if((db && db->getObjectType()==OBJ_DATABASE) || !db) + if((db && db->getObjectType()==ObjDatabase) || !db) this->database=db; } @@ -378,13 +378,13 @@ void BaseObject::setComment(const QString &comment) bool BaseObject::acceptsSchema(ObjectType obj_type) { - return(obj_type==OBJ_FUNCTION || obj_type==OBJ_TABLE || - obj_type==OBJ_VIEW || obj_type==OBJ_DOMAIN || - obj_type==OBJ_AGGREGATE || obj_type==OBJ_OPERATOR || - obj_type==OBJ_SEQUENCE || obj_type==OBJ_CONVERSION || - obj_type==OBJ_TYPE || obj_type==OBJ_OPCLASS || - obj_type==OBJ_OPFAMILY || obj_type==OBJ_COLLATION || - obj_type==OBJ_EXTENSION); + return(obj_type==ObjFunction || obj_type==ObjTable || + obj_type==ObjView || obj_type==ObjDomain || + obj_type==ObjAggregate || obj_type==ObjOperator || + obj_type==ObjSequence || obj_type==ObjConversion || + obj_type==ObjType || obj_type==ObjOpClass || + obj_type==ObjOpFamily || obj_type==ObjCollation || + obj_type==ObjExtension); } bool BaseObject::acceptsSchema(void) @@ -394,15 +394,15 @@ bool BaseObject::acceptsSchema(void) bool BaseObject::acceptsOwner(ObjectType obj_type) { - return(obj_type==OBJ_FUNCTION || obj_type==OBJ_TABLE || - obj_type==OBJ_DOMAIN || obj_type==OBJ_SCHEMA || - obj_type==OBJ_AGGREGATE || obj_type==OBJ_OPERATOR || - obj_type==OBJ_CONVERSION || obj_type==OBJ_SEQUENCE || - obj_type==OBJ_LANGUAGE || obj_type==OBJ_TYPE || - obj_type==OBJ_TABLESPACE || obj_type==OBJ_DATABASE || - obj_type==OBJ_OPCLASS || obj_type==OBJ_OPFAMILY || - obj_type==OBJ_COLLATION || obj_type==OBJ_VIEW || - obj_type==OBJ_EVENT_TRIGGER); + return(obj_type==ObjFunction || obj_type==ObjTable || + obj_type==ObjDomain || obj_type==ObjSchema || + obj_type==ObjAggregate || obj_type==ObjOperator || + obj_type==ObjConversion || obj_type==ObjSequence || + obj_type==ObjLanguage || obj_type==ObjType || + obj_type==ObjTablespace || obj_type==ObjDatabase || + obj_type==ObjOpClass || obj_type==ObjOpFamily || + obj_type==ObjCollation || obj_type==ObjView || + obj_type==ObjEventTrigger); } bool BaseObject::acceptsOwner(void) @@ -412,11 +412,11 @@ bool BaseObject::acceptsOwner(void) bool BaseObject::acceptsTablespace(ObjectType obj_type) { - return(obj_type==OBJ_INDEX || - obj_type==OBJ_TABLE || - obj_type==OBJ_VIEW || - obj_type==OBJ_CONSTRAINT || - obj_type==OBJ_DATABASE); + return(obj_type==ObjIndex || + obj_type==ObjTable || + obj_type==ObjView || + obj_type==ObjConstraint || + obj_type==ObjDatabase); } bool BaseObject::acceptsTablespace(void) @@ -426,9 +426,9 @@ bool BaseObject::acceptsTablespace(void) bool BaseObject::acceptsCollation(ObjectType obj_type) { - return(obj_type==OBJ_DOMAIN || obj_type==OBJ_COLUMN || - obj_type==OBJ_COLLATION || obj_type==OBJ_TYPE || - obj_type==OBJ_TYPE_ATTRIBUTE); + return(obj_type==ObjDomain || obj_type==ObjColumn || + obj_type==ObjCollation || obj_type==ObjType || + obj_type==ObjTypeAttribute); } bool BaseObject::acceptsCollation(void) @@ -438,40 +438,40 @@ bool BaseObject::acceptsCollation(void) bool BaseObject::acceptsCustomSQL(ObjectType obj_type) { - return(obj_type!=OBJ_COLUMN && obj_type!=OBJ_CONSTRAINT && - obj_type!=OBJ_RELATIONSHIP && obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_PARAMETER && - obj_type!=OBJ_TYPE_ATTRIBUTE && obj_type!=BASE_RELATIONSHIP && - obj_type!=BASE_OBJECT && obj_type!=BASE_TABLE && obj_type!=OBJ_PERMISSION && - obj_type!=OBJ_TAG && obj_type!=OBJ_GENERIC_SQL); + return(obj_type!=ObjColumn && obj_type!=ObjConstraint && + obj_type!=ObjRelationship && obj_type!=ObjTextbox && obj_type!=ObjParameter && + obj_type!=ObjTypeAttribute && obj_type!=ObjBaseRelationship && + obj_type!=ObjBaseObject && obj_type!=ObjBaseTable && obj_type!=ObjPermission && + obj_type!=ObjTag && obj_type!=ObjGenericSQL); } bool BaseObject::acceptsAlterCommand(ObjectType obj_type) { - return(obj_type==OBJ_COLLATION || obj_type==OBJ_COLUMN || - obj_type==OBJ_DOMAIN || obj_type==OBJ_EVENT_TRIGGER || - obj_type==OBJ_EXTENSION || obj_type==OBJ_FUNCTION || - obj_type==OBJ_INDEX || obj_type==OBJ_ROLE || - obj_type==OBJ_SCHEMA || obj_type==OBJ_SEQUENCE || - obj_type==OBJ_TABLE || obj_type==OBJ_TABLESPACE || - obj_type==OBJ_TYPE || obj_type==OBJ_POLICY); + return(obj_type==ObjCollation || obj_type==ObjColumn || + obj_type==ObjDomain || obj_type==ObjEventTrigger || + obj_type==ObjExtension || obj_type==ObjFunction || + obj_type==ObjIndex || obj_type==ObjRole || + obj_type==ObjSchema || obj_type==ObjSequence || + obj_type==ObjTable || obj_type==ObjTablespace || + obj_type==ObjType || obj_type==ObjPolicy); } bool BaseObject::acceptsDropCommand(ObjectType obj_type) { - return(obj_type!=OBJ_PERMISSION && obj_type!=OBJ_RELATIONSHIP && - obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_TYPE_ATTRIBUTE && - obj_type!=OBJ_PARAMETER && obj_type!=BASE_OBJECT && - obj_type!=OBJ_TAG && obj_type!=BASE_RELATIONSHIP && - obj_type!=BASE_TABLE); + return(obj_type!=ObjPermission && obj_type!=ObjRelationship && + obj_type!=ObjTextbox && obj_type!=ObjTypeAttribute && + obj_type!=ObjParameter && obj_type!=ObjBaseObject && + obj_type!=ObjTag && obj_type!=ObjBaseRelationship && + obj_type!=ObjBaseTable); } bool BaseObject::acceptsAlias(ObjectType obj_type) { - return(obj_type==OBJ_RELATIONSHIP || obj_type==BASE_RELATIONSHIP || - obj_type==OBJ_TABLE || obj_type==OBJ_SCHEMA || obj_type==OBJ_VIEW || - obj_type == OBJ_COLUMN || obj_type == OBJ_CONSTRAINT || - obj_type == OBJ_INDEX || obj_type == OBJ_RULE || - obj_type == OBJ_TRIGGER || obj_type == OBJ_POLICY); + return(obj_type==ObjRelationship || obj_type==ObjBaseRelationship || + obj_type==ObjTable || obj_type==ObjSchema || obj_type==ObjView || + obj_type == ObjColumn || obj_type == ObjConstraint || + obj_type == ObjIndex || obj_type == ObjRule || + obj_type == ObjTrigger || obj_type == ObjPolicy); } bool BaseObject::acceptsCustomSQL(void) @@ -496,7 +496,7 @@ void BaseObject::setSchema(BaseObject *schema) .arg(this->obj_name) .arg(this->getTypeName()), AsgNotAllocatedSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(schema && schema->getObjectType()!=OBJ_SCHEMA) + else if(schema && schema->getObjectType()!=ObjSchema) throw Exception(AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsSchema()) throw Exception(AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -507,7 +507,7 @@ void BaseObject::setSchema(BaseObject *schema) void BaseObject::setOwner(BaseObject *owner) { - if(owner && owner->getObjectType()!=OBJ_ROLE) + if(owner && owner->getObjectType()!=ObjRole) throw Exception(AsgInvalidRoleObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsOwner()) throw Exception(AsgRoleObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -518,7 +518,7 @@ void BaseObject::setOwner(BaseObject *owner) void BaseObject::setTablespace(BaseObject *tablespace) { - if(tablespace && tablespace->getObjectType()!=OBJ_TABLESPACE) + if(tablespace && tablespace->getObjectType()!=ObjTablespace) throw Exception(AsgInvalidTablespaceObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsTablespace()) throw Exception(AsgTablespaceInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -531,7 +531,7 @@ void BaseObject::setCollation(BaseObject *collation) { if(collation && !acceptsCollation()) throw Exception(AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(collation && collation->getObjectType()!=OBJ_COLLATION) + if(collation && collation->getObjectType()!=ObjCollation) throw Exception(AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->collation != collation); @@ -561,7 +561,7 @@ QString BaseObject::getName(bool format, bool prepend_schema) if(format) { QString aux_name; - aux_name=formatName(this->obj_name, (obj_type==OBJ_OPERATOR)); + aux_name=formatName(this->obj_name, (obj_type==ObjOperator)); if(this->schema && prepend_schema) aux_name=formatName(this->schema->getName(format)) + QString(".") + aux_name; @@ -697,11 +697,11 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) QString code_def; if((def_type==SchemaParser::SQL_DEFINITION && - obj_type!=BASE_OBJECT && obj_type!=BASE_RELATIONSHIP && - obj_type!=BASE_TABLE && obj_type!=OBJ_TEXTBOX) || + obj_type!=ObjBaseObject && obj_type!=ObjBaseRelationship && + obj_type!=ObjBaseTable && obj_type!=ObjTextbox) || (def_type==SchemaParser::XML_DEFINITION && - obj_type!=BASE_OBJECT && obj_type!=BASE_TABLE)) + obj_type!=ObjBaseObject && obj_type!=ObjBaseTable)) { bool format=false; @@ -711,7 +711,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) //Formats the object's name in case the SQL definition is being generated format=((def_type==SchemaParser::SQL_DEFINITION) || (def_type==SchemaParser::XML_DEFINITION && reduced_form && - obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_RELATIONSHIP)); + obj_type!=ObjTextbox && obj_type!=ObjRelationship)); setBasicAttributes(format); @@ -751,7 +751,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) /** Only tablespaces and database do not have an ALTER OWNER SET because the rule says that PostgreSQL tablespaces and database should be created with just a command line isolated from the others **/ - if(obj_type!=OBJ_TABLESPACE && obj_type!=OBJ_DATABASE) + if(obj_type!=ObjTablespace && obj_type!=ObjDatabase) { SchemaParser sch_parser; QString filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + @@ -840,7 +840,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) clearAttributes(); //Database object doesn't handles cached code. - if(use_cached_code && obj_type!=OBJ_DATABASE) + if(use_cached_code && obj_type!=ObjDatabase) { if(def_type==SchemaParser::SQL_DEFINITION || (!reduced_form && def_type==SchemaParser::XML_DEFINITION)) @@ -909,8 +909,8 @@ void BaseObject::swapObjectsIds(BaseObject *obj1, BaseObject *obj2, bool enable_ OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the object is object is cluster level and the swap of these types isn't enabled else if(!enable_cl_obj_swap && - (obj1->getObjectType()==OBJ_DATABASE || obj1->getObjectType()==OBJ_TABLESPACE || obj1->getObjectType()==OBJ_ROLE || - obj2->getObjectType()==OBJ_DATABASE || obj2->getObjectType()==OBJ_TABLESPACE || obj2->getObjectType()==OBJ_ROLE)) + (obj1->getObjectType()==ObjDatabase || obj1->getObjectType()==ObjTablespace || obj1->getObjectType()==ObjRole || + obj2->getObjectType()==ObjDatabase || obj2->getObjectType()==ObjTablespace || obj2->getObjectType()==ObjRole)) throw Exception(InvIdSwapInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -936,22 +936,22 @@ void BaseObject::updateObjectId(BaseObject *obj) vector BaseObject::getObjectTypes(bool inc_table_objs, vector exclude_types) { - vector vet_types={ BASE_RELATIONSHIP, OBJ_AGGREGATE, OBJ_CAST, OBJ_COLLATION, - OBJ_CONVERSION, OBJ_DATABASE, OBJ_DOMAIN, OBJ_EXTENSION, OBJ_EVENT_TRIGGER, - OBJ_TAG, OBJ_FUNCTION, OBJ_LANGUAGE, OBJ_OPCLASS, OBJ_OPERATOR, - OBJ_OPFAMILY, OBJ_RELATIONSHIP, OBJ_ROLE, OBJ_SCHEMA, - OBJ_SEQUENCE, OBJ_TABLE, OBJ_TABLESPACE, OBJ_TEXTBOX, - OBJ_TYPE, OBJ_VIEW, OBJ_PERMISSION, OBJ_GENERIC_SQL }; + vector vet_types={ ObjBaseRelationship, ObjAggregate, ObjCast, ObjCollation, + ObjConversion, ObjDatabase, ObjDomain, ObjExtension, ObjEventTrigger, + ObjTag, ObjFunction, ObjLanguage, ObjOpClass, ObjOperator, + ObjOpFamily, ObjRelationship, ObjRole, ObjSchema, + ObjSequence, ObjTable, ObjTablespace, ObjTextbox, + ObjType, ObjView, ObjPermission, ObjGenericSQL }; vector::iterator itr; if(inc_table_objs) { - vet_types.push_back(OBJ_COLUMN); - vet_types.push_back(OBJ_CONSTRAINT); - vet_types.push_back(OBJ_TRIGGER); - vet_types.push_back(OBJ_RULE); - vet_types.push_back(OBJ_INDEX); - vet_types.push_back(OBJ_POLICY); + vet_types.push_back(ObjColumn); + vet_types.push_back(ObjConstraint); + vet_types.push_back(ObjTrigger); + vet_types.push_back(ObjRule); + vet_types.push_back(ObjIndex); + vet_types.push_back(ObjPolicy); } for(ObjectType type : exclude_types) @@ -966,15 +966,15 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector BaseObject::getChildObjectTypes(ObjectType obj_type) { - if(obj_type==OBJ_DATABASE) - return(vector()={OBJ_CAST, OBJ_ROLE, OBJ_LANGUAGE, OBJ_TABLESPACE, OBJ_SCHEMA, OBJ_EXTENSION, OBJ_EVENT_TRIGGER}); - else if(obj_type==OBJ_SCHEMA) - return(vector()={OBJ_AGGREGATE, OBJ_CONVERSION, OBJ_COLLATION, OBJ_DOMAIN, OBJ_FUNCTION, - OBJ_OPCLASS, OBJ_OPERATOR, OBJ_OPFAMILY, OBJ_SEQUENCE, OBJ_TYPE, OBJ_TABLE, OBJ_VIEW}); - else if(obj_type==OBJ_TABLE) - return(vector()={OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_RULE, OBJ_TRIGGER, OBJ_INDEX, OBJ_POLICY}); - else if(obj_type==OBJ_VIEW) - return(vector()={OBJ_RULE, OBJ_TRIGGER, OBJ_INDEX}); + if(obj_type==ObjDatabase) + return(vector()={ObjCast, ObjRole, ObjLanguage, ObjTablespace, ObjSchema, ObjExtension, ObjEventTrigger}); + else if(obj_type==ObjSchema) + return(vector()={ObjAggregate, ObjConversion, ObjCollation, ObjDomain, ObjFunction, + ObjOpClass, ObjOperator, ObjOpFamily, ObjSequence, ObjType, ObjTable, ObjView}); + else if(obj_type==ObjTable) + return(vector()={ObjColumn, ObjConstraint, ObjRule, ObjTrigger, ObjIndex, ObjPolicy}); + else if(obj_type==ObjView) + return(vector()={ObjRule, ObjTrigger, ObjIndex}); else return(vector()={}); } diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 2e0c77cc46..ac0c32b84a 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -36,42 +36,42 @@ #include enum ObjectType { - OBJ_COLUMN, - OBJ_CONSTRAINT, - OBJ_FUNCTION, - OBJ_TRIGGER, - OBJ_INDEX, - OBJ_RULE, - OBJ_TABLE, - OBJ_VIEW, - OBJ_DOMAIN, - OBJ_SCHEMA, - OBJ_AGGREGATE, - OBJ_OPERATOR, - OBJ_SEQUENCE, - OBJ_ROLE, - OBJ_CONVERSION, - OBJ_CAST, - OBJ_LANGUAGE, - OBJ_TYPE, - OBJ_TABLESPACE, - OBJ_OPFAMILY, - OBJ_OPCLASS, - OBJ_DATABASE, - OBJ_COLLATION, - OBJ_EXTENSION, - OBJ_EVENT_TRIGGER, - OBJ_POLICY, - OBJ_RELATIONSHIP, - OBJ_TEXTBOX, - OBJ_PERMISSION, - OBJ_PARAMETER, - OBJ_TYPE_ATTRIBUTE, - OBJ_TAG, - OBJ_GENERIC_SQL, - BASE_RELATIONSHIP, - BASE_OBJECT, - BASE_TABLE + ObjColumn, + ObjConstraint, + ObjFunction, + ObjTrigger, + ObjIndex, + ObjRule, + ObjTable, + ObjView, + ObjDomain, + ObjSchema, + ObjAggregate, + ObjOperator, + ObjSequence, + ObjRole, + ObjConversion, + ObjCast, + ObjLanguage, + ObjType, + ObjTablespace, + ObjOpFamily, + ObjOpClass, + ObjDatabase, + ObjCollation, + ObjExtension, + ObjEventTrigger, + ObjPolicy, + ObjRelationship, + ObjTextbox, + ObjPermission, + ObjParameter, + ObjTypeAttribute, + ObjTag, + ObjGenericSQL, + ObjBaseRelationship, + ObjBaseObject, + ObjBaseTable }; class BaseObject { @@ -470,7 +470,7 @@ class BaseObject { static void enableCachedCode(bool value); /*! \brief Returns the valid object types in a vector. The types - BASE_OBJECT, TYPE_ATTRIBUTE and BASE_TABLE aren't included in return vector. + ObjBaseObject, TYPE_ATTRIBUTE and ObjBaseTable aren't included in return vector. By default table objects (columns, trigger, constraints, etc) are included. To avoid the insertion of these types set the boolean param to false. */ static vector getObjectTypes(bool inc_table_objs=true, vector exclude_types={}); @@ -478,7 +478,7 @@ class BaseObject { /*! \brief Returns the valid object types that are child or grouped under the specified type. This method works a litte different from getObjectTypes() since this latter returns all valid types and this one returns only the valid types for the current specified type. For now the only accepted - types are OBJ_DATABASE, OBJ_SCHEMA and OBJ_TABLE */ + types are ObjDatabase, ObjSchema and ObjTable */ static vector getChildObjectTypes(ObjectType obj_type); /*! \brief Sets the default version when generating the SQL code. This affects all instances of classes that diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 88b4a04e31..54d4d8cb2e 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -75,7 +75,7 @@ BaseRelationship::BaseRelationship(unsigned rel_type, BaseTable *src_tab, BaseTa void BaseRelationship::configureRelationship(void) { - obj_type=BASE_RELATIONSHIP; + obj_type=ObjBaseRelationship; attributes[ParsersAttributes::TYPE]=QString(); attributes[ParsersAttributes::SRC_REQUIRED]=QString(); @@ -125,7 +125,7 @@ void BaseRelationship::configureRelationship(void) if(!src_table || !dst_table) throw Exception(Exception::getErrorMessage(AsgNotAllocatedTable) .arg(this->getName()) - .arg(BaseObject::getTypeName(BASE_RELATIONSHIP)), + .arg(BaseObject::getTypeName(ObjBaseRelationship)), AsgNotAllocatedTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the relationship type is generalization or dependency @@ -512,7 +512,7 @@ QString BaseRelationship::getRelTypeAttribute(void) case RELATIONSHIP_PART: return(ParsersAttributes::RELATIONSHIP_PART); break; case RELATIONSHIP_FK: return(ParsersAttributes::RELATIONSHIP_FK); break; default: - if(src_table->getObjectType()==OBJ_VIEW) + if(src_table->getObjectType()==ObjView) return(ParsersAttributes::RELATION_TAB_VIEW); else return(ParsersAttributes::RELATIONSHIP_DEP); @@ -541,7 +541,7 @@ QString BaseRelationship::getRelationshipTypeName(unsigned rel_type, bool is_vie QString BaseRelationship::getRelationshipTypeName(void) { - return(getRelationshipTypeName(rel_type, src_table->getObjectType()==OBJ_VIEW)); + return(getRelationshipTypeName(rel_type, src_table->getObjectType()==ObjView)); } void BaseRelationship::setCodeInvalidated(bool value) diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index a94c9f508e..ae8af5fd2b 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -21,7 +21,7 @@ BaseTable::BaseTable(void) { tag=nullptr; - obj_type=BASE_TABLE; + obj_type=ObjBaseTable; attributes[ParsersAttributes::TAG]=QString(); attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=QString(); attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString(); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 917b250c6f..cc31948643 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -20,7 +20,7 @@ Cast::Cast(void) { - obj_type=OBJ_CAST; + obj_type=ObjCast; cast_function=nullptr; cast_type=EXPLICIT; is_in_out=false; @@ -40,7 +40,7 @@ void Cast::setDataType(unsigned type_idx, PgSQLType type) if((*type).isEmpty()) throw Exception(Exception::getErrorMessage(AsgNullTypeObject) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_CAST)), + .arg(BaseObject::getTypeName(ObjCast)), AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->types[type_idx] != type); @@ -79,7 +79,7 @@ void Cast::setCastFunction(Function *cast_func) if(!cast_func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_CAST)), + .arg(BaseObject::getTypeName(ObjCast)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Retrieve the cast function parameter count for specific validations @@ -89,7 +89,7 @@ void Cast::setCastFunction(Function *cast_func) if(param_count==0 || param_count > 3) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_CAST)), + .arg(BaseObject::getTypeName(ObjCast)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -112,7 +112,7 @@ void Cast::setCastFunction(Function *cast_func) if(error) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_CAST)), + .arg(BaseObject::getTypeName(ObjCast)), AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -123,7 +123,7 @@ void Cast::setCastFunction(Function *cast_func) if(ret_type!=this->types[DST_TYPE] && !ret_type.canCastTo(this->types[DST_TYPE])) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_CAST)), + .arg(BaseObject::getTypeName(ObjCast)), AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(cast_function != cast_func); diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index f7358bb97e..2c5113a0b7 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -20,7 +20,7 @@ Collation::Collation(void) { - obj_type=OBJ_COLLATION; + obj_type=ObjCollation; encoding=BaseType::null; attributes[ParsersAttributes::_LC_CTYPE_]=QString(); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index ef5cdf849a..4f993f51e6 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -20,7 +20,7 @@ Column::Column(void) { - obj_type=OBJ_COLUMN; + obj_type=ObjColumn; not_null=seq_cycle=false; attributes[ParsersAttributes::TYPE]=QString(); attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); @@ -152,7 +152,7 @@ QString Column::getOldName(bool format) void Column::setParentRelationship(BaseObject *parent_rel) { - if(parent_rel && parent_rel->getObjectType()!=OBJ_RELATIONSHIP) + if(parent_rel && parent_rel->getObjectType()!=ObjRelationship) throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->parent_rel=parent_rel; @@ -167,11 +167,11 @@ void Column::setSequence(BaseObject *seq) { if(seq) { - if(seq->getObjectType()!=OBJ_SEQUENCE) + if(seq->getObjectType()!=ObjSequence) throw Exception(Exception::getErrorMessage(AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) - .arg(BaseObject::getTypeName(OBJ_SEQUENCE)), + .arg(BaseObject::getTypeName(ObjSequence)), AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!type.isIntegerType()) throw Exception(Exception::getErrorMessage(IncompColumnTypeForSequence) diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 657de43014..24b8c1a372 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -21,7 +21,7 @@ Constraint::Constraint(void) { ref_table=nullptr; - obj_type=OBJ_CONSTRAINT; + obj_type=ObjConstraint; deferrable=false; no_inherit=false; fill_factor=0; @@ -149,7 +149,7 @@ void Constraint::addColumn(Column *column, unsigned col_type) if(!column) throw Exception(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_CONSTRAINT)), + .arg(BaseObject::getTypeName(ObjConstraint)), ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(constr_type!=ConstraintType::check) { diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index bd082276ab..057ee3ceb4 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -20,7 +20,7 @@ Conversion::Conversion(void) { - obj_type=OBJ_CONVERSION; + obj_type=ObjConversion; conversion_func=nullptr; is_default=false; attributes[ParsersAttributes::DEFAULT]=QString(); @@ -38,7 +38,7 @@ void Conversion::setEncoding(unsigned encoding_idx, EncodingType encoding_type) if((~encoding_type).isEmpty()) throw Exception(Exception::getErrorMessage(AsgNullTypeObject) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_CONVERSION)), + .arg(BaseObject::getTypeName(ObjConversion)), AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Assigns the encoding to the conversion in the specified index @@ -55,14 +55,14 @@ void Conversion::setConversionFunction(Function *conv_func) if(!conv_func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(OBJ_CONVERSION)), + .arg(BaseObject::getTypeName(ObjConversion)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* The conversion function must have 5 parameters if it's not the case raises an error. */ else if(conv_func->getParameterCount()!=5) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(OBJ_CONVERSION)), + .arg(BaseObject::getTypeName(ObjConversion)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the function parameters does not following the type order: interger, integer, cstring, internal, integer */ @@ -73,13 +73,13 @@ void Conversion::setConversionFunction(Function *conv_func) conv_func->getParameter(4).getType()!=QString("integer")) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(OBJ_CONVERSION)), + .arg(BaseObject::getTypeName(ObjConversion)), AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the conversion function return type is not 'void' else if(conv_func->getReturnType()!=QString("void")) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(OBJ_CONVERSION)), + .arg(BaseObject::getTypeName(ObjConversion)), AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(conversion_func != conv_func); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 936d039886..46b24775f0 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -25,7 +25,7 @@ DatabaseModel::DatabaseModel(void) { this->model_wgt=nullptr; object_id=DatabaseModel::dbmodel_id++; - obj_type=OBJ_DATABASE; + obj_type=ObjDatabase; is_template = false; allow_conns = true; @@ -33,10 +33,10 @@ DatabaseModel::DatabaseModel(void) encoding=BaseType::null; BaseObject::setName(QObject::trUtf8("new_database").toUtf8()); - default_objs[OBJ_SCHEMA]=nullptr; - default_objs[OBJ_ROLE]=nullptr; - default_objs[OBJ_TABLESPACE]=nullptr; - default_objs[OBJ_COLLATION]=nullptr; + default_objs[ObjSchema]=nullptr; + default_objs[ObjRole]=nullptr; + default_objs[ObjTablespace]=nullptr; + default_objs[ObjCollation]=nullptr; conn_limit=-1; last_zoom=1; @@ -102,55 +102,55 @@ void DatabaseModel::setAuthor(const QString &author) vector *DatabaseModel::getObjectList(ObjectType obj_type) { - if(obj_type==OBJ_TEXTBOX) + if(obj_type==ObjTextbox) return(&textboxes); - else if(obj_type==OBJ_TABLE) + else if(obj_type==ObjTable) return(&tables); - else if(obj_type==OBJ_FUNCTION) + else if(obj_type==ObjFunction) return(&functions); - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) return(&aggregates); - else if(obj_type==OBJ_SCHEMA) + else if(obj_type==ObjSchema) return(&schemas); - else if(obj_type==OBJ_VIEW) + else if(obj_type==ObjView) return(&views); - else if(obj_type==OBJ_TYPE) + else if(obj_type==ObjType) return(&types); - else if(obj_type==OBJ_ROLE) + else if(obj_type==ObjRole) return(&roles); - else if(obj_type==OBJ_TABLESPACE) + else if(obj_type==ObjTablespace) return(&tablespaces); - else if(obj_type==OBJ_LANGUAGE) + else if(obj_type==ObjLanguage) return(&languages); - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) return(&casts); - else if(obj_type==OBJ_CONVERSION) + else if(obj_type==ObjConversion) return(&conversions); - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) return(&operators); - else if(obj_type==OBJ_OPCLASS) + else if(obj_type==ObjOpClass) return(&op_classes); - else if(obj_type==OBJ_OPFAMILY) + else if(obj_type==ObjOpFamily) return(&op_families); - else if(obj_type==OBJ_DOMAIN) + else if(obj_type==ObjDomain) return(&domains); - else if(obj_type==OBJ_SEQUENCE) + else if(obj_type==ObjSequence) return(&sequences); - else if(obj_type==BASE_RELATIONSHIP) + else if(obj_type==ObjBaseRelationship) return(&base_relationships); - else if(obj_type==OBJ_RELATIONSHIP) + else if(obj_type==ObjRelationship) return(&relationships); - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) return(&permissions); - else if(obj_type==OBJ_COLLATION) + else if(obj_type==ObjCollation) return(&collations); - else if(obj_type==OBJ_EXTENSION) + else if(obj_type==ObjExtension) return(&extensions); - else if(obj_type==OBJ_TAG) + else if(obj_type==ObjTag) return(&tags); - else if(obj_type==OBJ_EVENT_TRIGGER) + else if(obj_type==ObjEventTrigger) return(&eventtriggers); - else if(obj_type==OBJ_GENERIC_SQL) + else if(obj_type==ObjGenericSQL) return(&genericsqls); else return(nullptr); @@ -166,54 +166,54 @@ void DatabaseModel::addObject(BaseObject *object, int obj_idx) { obj_type=object->getObjectType(); - if(obj_type==OBJ_RELATIONSHIP || - obj_type==BASE_RELATIONSHIP) + if(obj_type==ObjRelationship || + obj_type==ObjBaseRelationship) addRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TEXTBOX) + else if(obj_type==ObjTextbox) addTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TABLE) + else if(obj_type==ObjTable) addTable(dynamic_cast
(object), obj_idx); - else if(obj_type==OBJ_FUNCTION) + else if(obj_type==ObjFunction) addFunction(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) addAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_SCHEMA) + else if(obj_type==ObjSchema) addSchema(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_VIEW) + else if(obj_type==ObjView) addView(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TYPE) + else if(obj_type==ObjType) addType(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_ROLE) + else if(obj_type==ObjRole) addRole(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TABLESPACE) + else if(obj_type==ObjTablespace) addTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_LANGUAGE) + else if(obj_type==ObjLanguage) addLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) addCast(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_CONVERSION) + else if(obj_type==ObjConversion) addConversion(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) addOperator(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPCLASS) + else if(obj_type==ObjOpClass) addOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPFAMILY) + else if(obj_type==ObjOpFamily) addOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_DOMAIN) + else if(obj_type==ObjDomain) addDomain(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_SEQUENCE) + else if(obj_type==ObjSequence) addSequence(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_COLLATION) + else if(obj_type==ObjCollation) addCollation(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_EXTENSION) + else if(obj_type==ObjExtension) addExtension(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TAG) + else if(obj_type==ObjTag) addTag(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) addPermission(dynamic_cast(object)); - else if(obj_type==OBJ_EVENT_TRIGGER) + else if(obj_type==ObjEventTrigger) addEventTrigger(dynamic_cast(object)); - else if(obj_type==OBJ_GENERIC_SQL) + else if(obj_type==ObjGenericSQL) addGenericSQL(dynamic_cast(object)); } catch(Exception &e) @@ -234,54 +234,54 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) { obj_type=object->getObjectType(); - if(obj_type==OBJ_RELATIONSHIP || - obj_type==BASE_RELATIONSHIP) + if(obj_type==ObjRelationship || + obj_type==ObjBaseRelationship) removeRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TEXTBOX) + else if(obj_type==ObjTextbox) removeTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TABLE) + else if(obj_type==ObjTable) removeTable(dynamic_cast
(object), obj_idx); - else if(obj_type==OBJ_FUNCTION) + else if(obj_type==ObjFunction) removeFunction(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) removeAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_SCHEMA) + else if(obj_type==ObjSchema) removeSchema(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_VIEW) + else if(obj_type==ObjView) removeView(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TYPE) + else if(obj_type==ObjType) removeType(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_ROLE) + else if(obj_type==ObjRole) removeRole(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TABLESPACE) + else if(obj_type==ObjTablespace) removeTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_LANGUAGE) + else if(obj_type==ObjLanguage) removeLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) removeCast(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_CONVERSION) + else if(obj_type==ObjConversion) removeConversion(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) removeOperator(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPCLASS) + else if(obj_type==ObjOpClass) removeOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPFAMILY) + else if(obj_type==ObjOpFamily) removeOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_DOMAIN) + else if(obj_type==ObjDomain) removeDomain(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_SEQUENCE) + else if(obj_type==ObjSequence) removeSequence(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_COLLATION) + else if(obj_type==ObjCollation) removeCollation(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_EXTENSION) + else if(obj_type==ObjExtension) removeExtension(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TAG) + else if(obj_type==ObjTag) removeTag(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) removePermission(dynamic_cast(object)); - else if(obj_type==OBJ_EVENT_TRIGGER) + else if(obj_type==ObjEventTrigger) removeEventTrigger(dynamic_cast(object)); - else if(obj_type==OBJ_GENERIC_SQL) + else if(obj_type==ObjGenericSQL) removeGenericSQL(dynamic_cast(object)); } catch(Exception &e) @@ -294,8 +294,8 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) { if(TableObject::isTableObject(obj_type) || - obj_type==BASE_OBJECT || obj_type==BASE_RELATIONSHIP || - obj_type==OBJ_DATABASE) + obj_type==ObjBaseObject || obj_type==ObjBaseRelationship || + obj_type==ObjDatabase) throw Exception(RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else @@ -308,49 +308,49 @@ void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); object=(*obj_list)[obj_idx]; - if(obj_type==OBJ_TEXTBOX) + if(obj_type==ObjTextbox) removeTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TABLE) + else if(obj_type==ObjTable) removeTable(dynamic_cast
(object), obj_idx); - else if(obj_type==OBJ_FUNCTION) + else if(obj_type==ObjFunction) removeFunction(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) removeAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_SCHEMA) + else if(obj_type==ObjSchema) removeSchema(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_VIEW) + else if(obj_type==ObjView) removeView(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TYPE) + else if(obj_type==ObjType) removeType(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_ROLE) + else if(obj_type==ObjRole) removeRole(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_TABLESPACE) + else if(obj_type==ObjTablespace) removeTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_LANGUAGE) + else if(obj_type==ObjLanguage) removeLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) removeCast(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_CONVERSION) + else if(obj_type==ObjConversion) removeConversion(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) removeOperator(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPCLASS) + else if(obj_type==ObjOpClass) removeOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_OPFAMILY) + else if(obj_type==ObjOpFamily) removeOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_DOMAIN) + else if(obj_type==ObjDomain) removeDomain(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_SEQUENCE) + else if(obj_type==ObjSequence) removeSequence(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_COLLATION) + else if(obj_type==ObjCollation) removeCollation(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_RELATIONSHIP || obj_type==BASE_RELATIONSHIP) + else if(obj_type==ObjRelationship || obj_type==ObjBaseRelationship) removeRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) removePermission(dynamic_cast(object)); - else if(obj_type==OBJ_EVENT_TRIGGER) + else if(obj_type==ObjEventTrigger) removeEventTrigger(dynamic_cast(object), obj_idx); - else if(obj_type==OBJ_GENERIC_SQL) + else if(obj_type==ObjGenericSQL) removeGenericSQL(dynamic_cast(object), obj_idx); } } @@ -379,7 +379,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) #endif - if(obj_type==OBJ_TABLESPACE) + if(obj_type==ObjTablespace) { Tablespace *tabspc=nullptr, *aux_tabspc=nullptr; @@ -409,17 +409,17 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) /* Raises an error if there is an object with the same name. Special cases are for: functions/operator that are search by signature and views that are search on tables and views list */ - if((obj_type==OBJ_VIEW && (getObject(object->getName(true), obj_type, idx) || - getObject(object->getName(true), OBJ_TABLE, idx))) || - (obj_type==OBJ_TABLE && (getObject(object->getName(true), obj_type, idx) || - getObject(object->getName(true), OBJ_VIEW, idx))) || - (obj_type==OBJ_EXTENSION && (getObject(object->getName(false), obj_type, idx))) || + if((obj_type==ObjView && (getObject(object->getName(true), obj_type, idx) || + getObject(object->getName(true), ObjTable, idx))) || + (obj_type==ObjTable && (getObject(object->getName(true), obj_type, idx) || + getObject(object->getName(true), ObjView, idx))) || + (obj_type==ObjExtension && (getObject(object->getName(false), obj_type, idx))) || (getObject(object->getSignature(), obj_type, idx))) { QString str_aux; str_aux=QString(Exception::getErrorMessage(AsgDuplicatedObject)) - .arg(object->getName(obj_type != OBJ_EXTENSION)) + .arg(object->getName(obj_type != ObjExtension)) .arg(object->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); @@ -429,7 +429,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) try { - if(obj_type==OBJ_TEXTBOX || obj_type==BASE_RELATIONSHIP) + if(obj_type==ObjTextbox || obj_type==ObjBaseRelationship) object->getCodeDefinition(SchemaParser::XML_DEFINITION); else object->getCodeDefinition(SchemaParser::SQL_DEFINITION); @@ -565,9 +565,9 @@ vector DatabaseModel::getObjects(BaseObject *schema) { vector *obj_list=nullptr, sel_list; vector::iterator itr, itr_end; - ObjectType types[]={ OBJ_FUNCTION, OBJ_TABLE, OBJ_VIEW, OBJ_DOMAIN, - OBJ_AGGREGATE, OBJ_OPERATOR, OBJ_SEQUENCE, OBJ_CONVERSION, - OBJ_TYPE, OBJ_OPCLASS, OBJ_OPFAMILY, OBJ_COLLATION }; + ObjectType types[]={ ObjFunction, ObjTable, ObjView, ObjDomain, + ObjAggregate, ObjOperator, ObjSequence, ObjConversion, + ObjType, ObjOpClass, ObjOpFamily, ObjCollation }; unsigned i, count=sizeof(types)/sizeof(ObjectType); for(i=0; i < count; i++) @@ -654,7 +654,7 @@ unsigned DatabaseModel::getObjectCount(ObjectType obj_type) unsigned DatabaseModel::getMaxObjectCount(void) { - vector types = getObjectTypes(false, {OBJ_DATABASE}); + vector types = getObjectTypes(false, {ObjDatabase}); unsigned count = 0, max = 0; for(auto &type : types) @@ -668,7 +668,7 @@ unsigned DatabaseModel::getMaxObjectCount(void) unsigned DatabaseModel::getObjectCount(void) { - vector types= getObjectTypes(false, {OBJ_DATABASE}); + vector types= getObjectTypes(false, {ObjDatabase}); unsigned count=0; for(auto &type : types) @@ -716,14 +716,14 @@ QString DatabaseModel::getAuthor(void) void DatabaseModel::setProtected(bool value) { vector types = { - BASE_RELATIONSHIP,OBJ_RELATIONSHIP, OBJ_TABLE, OBJ_VIEW, - OBJ_AGGREGATE, OBJ_OPERATOR, - OBJ_SEQUENCE, OBJ_CONVERSION, - OBJ_CAST, OBJ_OPFAMILY, OBJ_OPCLASS, - BASE_RELATIONSHIP, OBJ_TEXTBOX, - OBJ_DOMAIN, OBJ_TYPE, OBJ_FUNCTION, - OBJ_LANGUAGE, OBJ_TABLESPACE, OBJ_ROLE, OBJ_COLLATION, - OBJ_EXTENSION, OBJ_SCHEMA, OBJ_PERMISSION, OBJ_TAG, OBJ_GENERIC_SQL + ObjBaseRelationship,ObjRelationship, ObjTable, ObjView, + ObjAggregate, ObjOperator, + ObjSequence, ObjConversion, + ObjCast, ObjOpFamily, ObjOpClass, + ObjBaseRelationship, ObjTextbox, + ObjDomain, ObjType, ObjFunction, + ObjLanguage, ObjTablespace, ObjRole, ObjCollation, + ObjExtension, ObjSchema, ObjPermission, ObjTag, ObjGenericSQL }; for(auto &type : types) @@ -739,7 +739,7 @@ void DatabaseModel::setProtected(bool value) void DatabaseModel::destroyObjects(void) { - ObjectType graph_types[]={ OBJ_SCHEMA, BASE_RELATIONSHIP, OBJ_RELATIONSHIP, OBJ_TABLE, OBJ_VIEW }; + ObjectType graph_types[]={ ObjSchema, ObjBaseRelationship, ObjRelationship, ObjTable, ObjView }; BaseObject *object=nullptr; map objects; map::reverse_iterator ritr, ritr_end; @@ -780,7 +780,7 @@ void DatabaseModel::destroyObjects(void) ritr++; // We ignore the database itself as well table children objects - if(object->getObjectType() == OBJ_DATABASE || + if(object->getObjectType() == ObjDatabase || TableObject::isTableObject(object->getObjectType())) continue; @@ -794,7 +794,7 @@ void DatabaseModel::destroyObjects(void) { __removeObject(object,-1,false); - if(object->getObjectType()==OBJ_RELATIONSHIP) + if(object->getObjectType()==ObjRelationship) dynamic_cast(object)->destroyObjects(); } @@ -835,12 +835,12 @@ void DatabaseModel::addTable(Table *table, int obj_idx) Table *DatabaseModel::getTable(unsigned obj_idx) { - return(dynamic_cast
(getObject(obj_idx, OBJ_TABLE))); + return(dynamic_cast
(getObject(obj_idx, ObjTable))); } Table *DatabaseModel::getTable(const QString &name) { - return(dynamic_cast
(getObject(name, OBJ_TABLE))); + return(dynamic_cast
(getObject(name, ObjTable))); } void DatabaseModel::removeTable(Table *table, int obj_idx) @@ -872,12 +872,12 @@ void DatabaseModel::addSequence(Sequence *sequence, int obj_idx) Sequence *DatabaseModel::getSequence(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_SEQUENCE))); + return(dynamic_cast(getObject(obj_idx, ObjSequence))); } Sequence *DatabaseModel::getSequence(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_SEQUENCE))); + return(dynamic_cast(getObject(name, ObjSequence))); } void DatabaseModel::removeSequence(Sequence *sequence, int obj_idx) @@ -906,12 +906,12 @@ void DatabaseModel::addCollation(Collation *collation, int obj_idx) Collation *DatabaseModel::getCollation(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_COLLATION))); + return(dynamic_cast(getObject(obj_idx, ObjCollation))); } Collation *DatabaseModel::getCollation(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_COLLATION))); + return(dynamic_cast(getObject(name, ObjCollation))); } void DatabaseModel::removeCollation(Collation *collation, int obj_idx) @@ -943,12 +943,12 @@ void DatabaseModel::addExtension(Extension *extension, int obj_idx) Extension *DatabaseModel::getExtension(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_COLLATION))); + return(dynamic_cast(getObject(obj_idx, ObjCollation))); } Extension *DatabaseModel::getExtension(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_EXTENSION))); + return(dynamic_cast(getObject(name, ObjExtension))); } void DatabaseModel::addTag(Tag *tag, int obj_idx) @@ -977,12 +977,12 @@ void DatabaseModel::removeTag(Tag *tag, int obj_idx) Tag *DatabaseModel::getTag(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_TAG))); + return(dynamic_cast(getObject(obj_idx, ObjTag))); } Tag *DatabaseModel::getTag(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_TAG))); + return(dynamic_cast(getObject(name, ObjTag))); } void DatabaseModel::addEventTrigger(EventTrigger *evnttrig, int obj_idx) @@ -1011,12 +1011,12 @@ void DatabaseModel::removeEventTrigger(EventTrigger *evnttrig, int obj_idx) EventTrigger *DatabaseModel::getEventTrigger(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_EVENT_TRIGGER))); + return(dynamic_cast(getObject(obj_idx, ObjEventTrigger))); } EventTrigger *DatabaseModel::getEventTrigger(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_EVENT_TRIGGER))); + return(dynamic_cast(getObject(name, ObjEventTrigger))); } void DatabaseModel::addGenericSQL(GenericSQL *genericsql, int obj_idx) @@ -1045,12 +1045,12 @@ void DatabaseModel::removeGenericSQL(GenericSQL *genericsql, int obj_idx) GenericSQL *DatabaseModel::getGenericSQL(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_GENERIC_SQL))); + return(dynamic_cast(getObject(obj_idx, ObjGenericSQL))); } GenericSQL *DatabaseModel::getGenericSQL(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_GENERIC_SQL))); + return(dynamic_cast(getObject(name, ObjGenericSQL))); } void DatabaseModel::removeExtension(Extension *extension, int obj_idx) @@ -1086,12 +1086,12 @@ void DatabaseModel::addView(View *view, int obj_idx) View *DatabaseModel::getView(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_VIEW))); + return(dynamic_cast(getObject(obj_idx, ObjView))); } View *DatabaseModel::getView(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_VIEW))); + return(dynamic_cast(getObject(name, ObjView))); } void DatabaseModel::removeView(View *view, int obj_idx) @@ -1186,7 +1186,7 @@ void DatabaseModel::updateTableFKRelationships(Table *table) /* Workaround: In some cases the combination of the two tablenames can generate a duplicated relationship name so it`s necessary to check if a relationship with the same name already exists. If exists changes the name of the new one */ - if(getObjectIndex(rel->getName(), BASE_RELATIONSHIP) >= 0) + if(getObjectIndex(rel->getName(), ObjBaseRelationship) >= 0) rel->setName(PgModelerNS::generateUniqueName(rel, base_relationships)); addRelationship(rel); @@ -1255,7 +1255,7 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) if(rel->getTable(BaseRelationship::SRC_TABLE)==view || rel->getTable(BaseRelationship::DST_TABLE)==view) { - if(rel->getTable(BaseRelationship::SRC_TABLE)->getObjectType()==OBJ_TABLE) + if(rel->getTable(BaseRelationship::SRC_TABLE)->getObjectType()==ObjTable) tab=dynamic_cast
(rel->getTable(BaseRelationship::SRC_TABLE)); else tab=dynamic_cast
(rel->getTable(BaseRelationship::DST_TABLE)); @@ -1314,7 +1314,7 @@ void DatabaseModel::disconnectRelationships(void) ritr_rel++; base_rel->blockSignals(loading_model); - if(base_rel->getObjectType()==OBJ_RELATIONSHIP) + if(base_rel->getObjectType()==ObjRelationship) { rel=dynamic_cast(base_rel); rel->disconnectRelationship(); @@ -1382,7 +1382,7 @@ void DatabaseModel::validateRelationships(void) itr++; //Validates only table-table relationships - if(base_rel->getObjectType()==OBJ_RELATIONSHIP) + if(base_rel->getObjectType()==ObjRelationship) { //Makes a cast to the correct object class rel=dynamic_cast(base_rel); @@ -1674,7 +1674,7 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) base_rel=dynamic_cast(*itr); itr++; - if(base_rel->getObjectType()==OBJ_RELATIONSHIP) + if(base_rel->getObjectType()==ObjRelationship) { rel_aux=dynamic_cast(base_rel); aux_rel_type=rel_aux->getRelationshipType(); @@ -1740,7 +1740,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) View *view=nullptr; BaseRelationship *rel=nullptr; Reference ref; - ObjectType tab_obj_type[3]={ OBJ_CONSTRAINT, OBJ_TRIGGER, OBJ_INDEX }; + ObjectType tab_obj_type[3]={ ObjConstraint, ObjTrigger, ObjIndex }; bool found=false; vector objects, rem_objects, upd_tables_rels; @@ -1766,7 +1766,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) tab_obj=dynamic_cast(table->getObject(i, tab_obj_type[type_id])); found=false; - if(tab_obj_type[type_id]==OBJ_CONSTRAINT) + if(tab_obj_type[type_id]==ObjConstraint) { constr=dynamic_cast(tab_obj); @@ -1781,7 +1781,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) if(found) xml_special_objs[constr->getObjectId()]=constr->getCodeDefinition(SchemaParser::XML_DEFINITION, true); } - else if(tab_obj_type[type_id]==OBJ_TRIGGER) + else if(tab_obj_type[type_id]==ObjTrigger) { trigger=dynamic_cast(tab_obj); found=trigger->isReferRelationshipAddedColumn(); @@ -1944,16 +1944,16 @@ void DatabaseModel::createSpecialObject(const QString &xml_def, unsigned obj_id) //Identifies the object type through the start element on xml buffer obj_type=BaseObject::getObjectType(xmlparser.getElementName()); - if(obj_type==OBJ_SEQUENCE) + if(obj_type==ObjSequence) object=createSequence(true); else object=createObject(obj_type); - if(obj_type==OBJ_SEQUENCE) + if(obj_type==ObjSequence) addSequence(dynamic_cast(object)); - else if(obj_type==OBJ_VIEW) + else if(obj_type==ObjView) addView(dynamic_cast(object)); - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) addPermission(createPermission()); /* When the special object is recreated it receive a new id but to maintain @@ -1996,13 +1996,13 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) } //Before add the relationship, checks if a redundancy can occur case the relationship is added - if(rel->getObjectType()==OBJ_RELATIONSHIP) + if(rel->getObjectType()==ObjRelationship) checkRelationshipRedundancy(dynamic_cast(rel)); rel->blockSignals(loading_model); __addObject(rel, obj_idx); - if(rel->getObjectType()==OBJ_RELATIONSHIP) + if(rel->getObjectType()==ObjRelationship) { dynamic_cast(rel)->connectRelationship(); validateRelationships(); @@ -2026,7 +2026,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) { Table *recv_tab=nullptr; - if(rel->getObjectType()==OBJ_RELATIONSHIP) + if(rel->getObjectType()==ObjRelationship) { /* If the relationship is not a many-to-many we store the receiver table in order to update the fk relationships (if there are any) */ @@ -2036,7 +2036,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) storeSpecialObjectsXML(); disconnectRelationships(); } - else if(rel->getObjectType()==BASE_RELATIONSHIP) + else if(rel->getObjectType()==ObjBaseRelationship) { rel->blockSignals(loading_model); rel->disconnectRelationship(); @@ -2045,7 +2045,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) __removeObject(rel, obj_idx); - if(rel->getObjectType()==OBJ_RELATIONSHIP) + if(rel->getObjectType()==ObjRelationship) { validateRelationships(); } @@ -2064,7 +2064,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) BaseRelationship *DatabaseModel::getRelationship(unsigned obj_idx, ObjectType rel_type) { //Raises an error if the object type used to get a relationship is invalid - if(rel_type!=OBJ_RELATIONSHIP && rel_type!=BASE_RELATIONSHIP) + if(rel_type!=ObjRelationship && rel_type!=ObjBaseRelationship) throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(getObject(obj_idx, rel_type))); @@ -2072,10 +2072,10 @@ BaseRelationship *DatabaseModel::getRelationship(unsigned obj_idx, ObjectType re BaseRelationship *DatabaseModel::getRelationship(const QString &name) { - BaseRelationship *rel=dynamic_cast(getObject(name, BASE_RELATIONSHIP)); + BaseRelationship *rel=dynamic_cast(getObject(name, ObjBaseRelationship)); if(!rel) - rel=dynamic_cast(getObject(name, OBJ_RELATIONSHIP)); + rel=dynamic_cast(getObject(name, ObjRelationship)); return(rel); } @@ -2096,7 +2096,7 @@ BaseRelationship *DatabaseModel::getRelationship(BaseTable *src_tab, BaseTable * search_uniq_tab=true; } - if(ref_fk || src_tab->getObjectType()==OBJ_VIEW || dst_tab->getObjectType()==OBJ_VIEW) + if(ref_fk || src_tab->getObjectType()==ObjView || dst_tab->getObjectType()==ObjView) { itr=base_relationships.begin(); itr_end=base_relationships.end(); @@ -2175,12 +2175,12 @@ void DatabaseModel::removeTextbox(Textbox *txtbox, int obj_idx) Textbox *DatabaseModel::getTextbox(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_TEXTBOX))); + return(dynamic_cast(getObject(obj_idx, ObjTextbox))); } Textbox *DatabaseModel::getTextbox(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_TEXTBOX))); + return(dynamic_cast(getObject(name, ObjTextbox))); } void DatabaseModel::addSchema(Schema *schema, int obj_idx) @@ -2197,12 +2197,12 @@ void DatabaseModel::addSchema(Schema *schema, int obj_idx) Schema *DatabaseModel::getSchema(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_SCHEMA))); + return(dynamic_cast(getObject(obj_idx, ObjSchema))); } Schema *DatabaseModel::getSchema(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_SCHEMA))); + return(dynamic_cast(getObject(name, ObjSchema))); } void DatabaseModel::removeSchema(Schema *schema, int obj_idx) @@ -2231,12 +2231,12 @@ void DatabaseModel::addRole(Role *role, int obj_idx) Role *DatabaseModel::getRole(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_ROLE))); + return(dynamic_cast(getObject(obj_idx, ObjRole))); } Role *DatabaseModel::getRole(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_ROLE))); + return(dynamic_cast(getObject(name, ObjRole))); } void DatabaseModel::removeRole(Role *role, int obj_idx) @@ -2265,12 +2265,12 @@ void DatabaseModel::addTablespace(Tablespace *tabspc, int obj_idx) Tablespace *DatabaseModel::getTablespace(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_TABLESPACE))); + return(dynamic_cast(getObject(obj_idx, ObjTablespace))); } Tablespace *DatabaseModel::getTablespace(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_TABLESPACE))); + return(dynamic_cast(getObject(name, ObjTablespace))); } void DatabaseModel::removeTablespace(Tablespace *tabspc, int obj_idx) @@ -2311,12 +2311,12 @@ void DatabaseModel::removeCast(Cast *cast, int obj_idx) Cast *DatabaseModel::getCast(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_CAST))); + return(dynamic_cast(getObject(obj_idx, ObjCast))); } Cast *DatabaseModel::getCast(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_CAST))); + return(dynamic_cast(getObject(name, ObjCast))); } void DatabaseModel::addConversion(Conversion *conv, int obj_idx) @@ -2346,12 +2346,12 @@ void DatabaseModel::removeConversion(Conversion *conv, int obj_idx) Conversion *DatabaseModel::getConversion(unsigned obj_idx) { return(dynamic_cast(getObject(obj_idx, - OBJ_CONVERSION))); + ObjConversion))); } Conversion *DatabaseModel::getConversion(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_CONVERSION))); + return(dynamic_cast(getObject(name, ObjConversion))); } void DatabaseModel::addLanguage(Language *lang, int obj_idx) @@ -2368,12 +2368,12 @@ void DatabaseModel::addLanguage(Language *lang, int obj_idx) Language *DatabaseModel::getLanguage(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_LANGUAGE))); + return(dynamic_cast(getObject(obj_idx, ObjLanguage))); } Language *DatabaseModel::getLanguage(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_LANGUAGE))); + return(dynamic_cast(getObject(name, ObjLanguage))); } void DatabaseModel::removeLanguage(Language *lang, int obj_idx) @@ -2402,12 +2402,12 @@ void DatabaseModel::addFunction(Function *func, int obj_idx) Function *DatabaseModel::getFunction(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_FUNCTION))); + return(dynamic_cast(getObject(obj_idx, ObjFunction))); } Function *DatabaseModel::getFunction(const QString &signature) { - return(dynamic_cast(getObject(signature, OBJ_FUNCTION))); + return(dynamic_cast(getObject(signature, ObjFunction))); } void DatabaseModel::removeFunction(Function *func, int obj_idx) @@ -2436,12 +2436,12 @@ void DatabaseModel::addAggregate(Aggregate *aggreg, int obj_idx) Aggregate *DatabaseModel::getAggregate(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_AGGREGATE))); + return(dynamic_cast(getObject(obj_idx, ObjAggregate))); } Aggregate *DatabaseModel::getAggregate(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_AGGREGATE))); + return(dynamic_cast(getObject(name, ObjAggregate))); } void DatabaseModel::removeAggregate(Aggregate *aggreg, int obj_idx) @@ -2513,12 +2513,12 @@ void DatabaseModel::removeDomain(Domain *domain, int obj_idx) Domain *DatabaseModel::getDomain(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_DOMAIN))); + return(dynamic_cast(getObject(obj_idx, ObjDomain))); } Domain *DatabaseModel::getDomain(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_DOMAIN))); + return(dynamic_cast(getObject(name, ObjDomain))); } void DatabaseModel::addOperatorFamily(OperatorFamily *op_family, int obj_idx) @@ -2535,12 +2535,12 @@ void DatabaseModel::addOperatorFamily(OperatorFamily *op_family, int obj_idx) OperatorFamily *DatabaseModel::getOperatorFamily(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_OPFAMILY))); + return(dynamic_cast(getObject(obj_idx, ObjOpFamily))); } OperatorFamily *DatabaseModel::getOperatorFamily(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_OPFAMILY))); + return(dynamic_cast(getObject(name, ObjOpFamily))); } void DatabaseModel::removeOperatorFamily(OperatorFamily *op_family, int obj_idx) @@ -2581,12 +2581,12 @@ void DatabaseModel::removeOperatorClass(OperatorClass *op_class, int obj_idx) OperatorClass *DatabaseModel::getOperatorClass(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_OPCLASS))); + return(dynamic_cast(getObject(obj_idx, ObjOpClass))); } OperatorClass *DatabaseModel::getOperatorClass(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_OPCLASS))); + return(dynamic_cast(getObject(name, ObjOpClass))); } void DatabaseModel::addOperator(Operator *oper, int obj_idx) @@ -2615,12 +2615,12 @@ void DatabaseModel::removeOperator(Operator *oper, int obj_idx) Operator *DatabaseModel::getOperator(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_OPERATOR))); + return(dynamic_cast(getObject(obj_idx, ObjOperator))); } Operator *DatabaseModel::getOperator(const QString &signature) { - return(dynamic_cast(getObject(signature, OBJ_OPERATOR))); + return(dynamic_cast(getObject(signature, ObjOperator))); } void DatabaseModel::addType(Type *type, int obj_idx) @@ -2679,12 +2679,12 @@ void DatabaseModel::removeType(Type *type, int obj_idx) Type *DatabaseModel::getType(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, OBJ_TYPE))); + return(dynamic_cast(getObject(obj_idx, ObjType))); } Type *DatabaseModel::getType(const QString &name) { - return(dynamic_cast(getObject(name, OBJ_TYPE))); + return(dynamic_cast(getObject(name, ObjType))); } void DatabaseModel::removeUserType(BaseObject *object, int obj_idx) @@ -3026,10 +3026,10 @@ void DatabaseModel::loadModel(const QString &filename) protected_model=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_); - def_objs[OBJ_SCHEMA]=attribs[ParsersAttributes::DEFAULT_SCHEMA]; - def_objs[OBJ_ROLE]=attribs[ParsersAttributes::DEFAULT_OWNER]; - def_objs[OBJ_COLLATION]=attribs[ParsersAttributes::DEFAULT_COLLATION]; - def_objs[OBJ_TABLESPACE]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; + def_objs[ObjSchema]=attribs[ParsersAttributes::DEFAULT_SCHEMA]; + def_objs[ObjRole]=attribs[ParsersAttributes::DEFAULT_OWNER]; + def_objs[ObjCollation]=attribs[ParsersAttributes::DEFAULT_COLLATION]; + def_objs[ObjTablespace]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) { @@ -3042,7 +3042,7 @@ void DatabaseModel::loadModel(const QString &filename) //Indentifies the object type to be load according to the current element on the parser obj_type=getObjectType(elem_name); - if(obj_type==OBJ_DATABASE) + if(obj_type==ObjDatabase) { xmlparser.getElementAttributes(attribs); configureDatabase(attribs); @@ -3057,12 +3057,12 @@ void DatabaseModel::loadModel(const QString &filename) if(object) { - if(!dynamic_cast(object) && obj_type!=OBJ_RELATIONSHIP && obj_type!=BASE_RELATIONSHIP) + if(!dynamic_cast(object) && obj_type!=ObjRelationship && obj_type!=ObjBaseRelationship) addObject(object); /* If there is at least one inheritance relationship we need to flag this situation in order to do an addtional rel. validation in the end of loading */ - if(!found_inh_rel && object->getObjectType()==OBJ_RELATIONSHIP && + if(!found_inh_rel && object->getObjectType()==ObjRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN) found_inh_rel=true; @@ -3114,7 +3114,7 @@ void DatabaseModel::loadModel(const QString &filename) //If there are relationship make a relationship validation to recreate any special object left behind if(!relationships.empty()) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), OBJ_RELATIONSHIP); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjRelationship); storeSpecialObjectsXML(); disconnectRelationships(); validateRelationships(); @@ -3122,13 +3122,13 @@ void DatabaseModel::loadModel(const QString &filename) this->setInvalidated(false); - emit s_objectLoaded(100, trUtf8("Validating relationships..."), OBJ_RELATIONSHIP); - this->setObjectsModified({OBJ_RELATIONSHIP, BASE_RELATIONSHIP}); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjRelationship); + this->setObjectsModified({ObjRelationship, ObjBaseRelationship}); //Doing another relationship validation when there are inheritances to avoid incomplete tables if(found_inh_rel) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), OBJ_RELATIONSHIP); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjRelationship); validateRelationships(); updateTablesFKRelationships(); } @@ -3156,68 +3156,68 @@ BaseObject *DatabaseModel::createObject(ObjectType obj_type) { BaseObject *object=nullptr; - if(obj_type!=BASE_OBJECT) + if(obj_type!=ObjBaseObject) { - if(obj_type==OBJ_ROLE) + if(obj_type==ObjRole) object=createRole(); - else if(obj_type==OBJ_TABLESPACE) + else if(obj_type==ObjTablespace) object=createTablespace(); - else if(obj_type==OBJ_SCHEMA) + else if(obj_type==ObjSchema) object=createSchema(); - else if(obj_type==OBJ_LANGUAGE) + else if(obj_type==ObjLanguage) object=createLanguage(); - else if(obj_type==OBJ_FUNCTION) + else if(obj_type==ObjFunction) object=createFunction(); - else if(obj_type==OBJ_TYPE) + else if(obj_type==ObjType) object=createType(); - else if(obj_type==OBJ_DOMAIN) + else if(obj_type==ObjDomain) object=createDomain(); - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) object=createCast(); - else if(obj_type==OBJ_CONVERSION) + else if(obj_type==ObjConversion) object=createConversion(); - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) object=createOperator(); - else if(obj_type==OBJ_OPFAMILY) + else if(obj_type==ObjOpFamily) object=createOperatorFamily(); - else if(obj_type==OBJ_OPCLASS) + else if(obj_type==ObjOpClass) object=createOperatorClass(); - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) object=createAggregate(); - else if(obj_type==OBJ_TABLE) + else if(obj_type==ObjTable) object=createTable(); - else if(obj_type==OBJ_SEQUENCE) + else if(obj_type==ObjSequence) object=createSequence(); - else if(obj_type==OBJ_VIEW) + else if(obj_type==ObjView) object=createView(); - else if(obj_type==OBJ_TEXTBOX) + else if(obj_type==ObjTextbox) object=createTextbox(); - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) object=createConstraint(nullptr); - else if(obj_type==OBJ_TRIGGER) + else if(obj_type==ObjTrigger) object=createTrigger(); - else if(obj_type==OBJ_INDEX) + else if(obj_type==ObjIndex) object=createIndex(); - else if(obj_type==OBJ_COLUMN) + else if(obj_type==ObjColumn) object=createColumn(); - else if(obj_type==OBJ_RULE) + else if(obj_type==ObjRule) object=createRule(); - else if(obj_type==OBJ_RELATIONSHIP || - obj_type==BASE_RELATIONSHIP) + else if(obj_type==ObjRelationship || + obj_type==ObjBaseRelationship) object=createRelationship(); - else if(obj_type==OBJ_COLLATION) + else if(obj_type==ObjCollation) object=createCollation(); - else if(obj_type==OBJ_EXTENSION) + else if(obj_type==ObjExtension) object=createExtension(); - else if(obj_type==OBJ_TAG) + else if(obj_type==ObjTag) object=createTag(); - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) object=createPermission(); - else if(obj_type==OBJ_EVENT_TRIGGER) + else if(obj_type==ObjEventTrigger) object=createEventTrigger(); - else if(obj_type==OBJ_GENERIC_SQL) + else if(obj_type==ObjGenericSQL) object=createGenericSQL(); - else if(obj_type==OBJ_POLICY) + else if(obj_type==ObjPolicy) object=createPolicy(); } @@ -3230,7 +3230,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) QString elem_name; BaseObject *tabspc=nullptr, *owner=nullptr, *collation=nullptr; Schema *schema=nullptr; - ObjectType obj_type=BASE_OBJECT, obj_type_aux; + ObjectType obj_type=ObjBaseObject, obj_type_aux; bool has_error=false, protected_obj=false, sql_disabled=false; if(!object) @@ -3240,7 +3240,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) obj_type_aux=object->getObjectType(); - if(obj_type_aux!=OBJ_CAST) + if(obj_type_aux!=ObjCast) object->setName(attribs[ParsersAttributes::NAME]); if(BaseObject::acceptsAlias(obj_type_aux)) @@ -3270,7 +3270,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's schema else if(elem_name==ParsersAttributes::SCHEMA) { - obj_type=OBJ_SCHEMA; + obj_type=ObjSchema; xmlparser.getElementAttributes(attribs_aux); schema=dynamic_cast(getObject(attribs_aux[ParsersAttributes::NAME], obj_type)); object->setSchema(schema); @@ -3279,7 +3279,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's tablespace else if(elem_name==ParsersAttributes::TABLESPACE) { - obj_type=OBJ_TABLESPACE; + obj_type=ObjTablespace; xmlparser.getElementAttributes(attribs_aux); tabspc=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setTablespace(tabspc); @@ -3288,7 +3288,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's owner else if(elem_name==ParsersAttributes::ROLE) { - obj_type=OBJ_ROLE; + obj_type=ObjRole; xmlparser.getElementAttributes(attribs_aux); owner=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setOwner(owner); @@ -3297,7 +3297,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's schema else if(elem_name==ParsersAttributes::COLLATION) { - obj_type=OBJ_COLLATION; + obj_type=ObjCollation; xmlparser.getElementAttributes(attribs_aux); collation=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setCollation(collation); @@ -3323,8 +3323,8 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.getElementAttributes(attribs); if(elem_name==ParsersAttributes::POSITION && - (obj_type_aux!=OBJ_RELATIONSHIP && - obj_type_aux!=BASE_RELATIONSHIP)) + (obj_type_aux!=ObjRelationship && + obj_type_aux!=ObjBaseRelationship)) { dynamic_cast(object)->setPosition(QPointF(attribs[ParsersAttributes::X_POS].toDouble(), attribs[ParsersAttributes::Y_POS].toDouble())); @@ -3351,12 +3351,12 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!object->getSchema() && - (obj_type_aux==OBJ_FUNCTION || obj_type_aux==OBJ_TABLE || - obj_type_aux==OBJ_VIEW || obj_type_aux==OBJ_DOMAIN || - obj_type_aux==OBJ_AGGREGATE || obj_type_aux==OBJ_OPERATOR || - obj_type_aux==OBJ_SEQUENCE || obj_type_aux==OBJ_CONVERSION || - obj_type_aux==OBJ_TYPE || obj_type_aux==OBJ_OPFAMILY || - obj_type_aux==OBJ_OPCLASS)) + (obj_type_aux==ObjFunction || obj_type_aux==ObjTable || + obj_type_aux==ObjView || obj_type_aux==ObjDomain || + obj_type_aux==ObjAggregate || obj_type_aux==ObjOperator || + obj_type_aux==ObjSequence || obj_type_aux==ObjConversion || + obj_type_aux==ObjType || obj_type_aux==ObjOpFamily || + obj_type_aux==ObjOpClass)) { throw Exception(Exception::getErrorMessage(InvObjectAllocationNoSchema) .arg(object->getName()) @@ -3508,16 +3508,16 @@ Role *DatabaseModel::createRole(void) for(i=0; i < len; i++) { //Gets the role using the name from the model using the name from the list - ref_role=dynamic_cast(getObject(list[i].trimmed(),OBJ_ROLE)); + ref_role=dynamic_cast(getObject(list[i].trimmed(),ObjRole)); //Raises an error if the roles doesn't exists if(!ref_role) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(role->getName()) - .arg(BaseObject::getTypeName(OBJ_ROLE)) + .arg(BaseObject::getTypeName(ObjRole)) .arg(list[i]) - .arg(BaseObject::getTypeName(OBJ_ROLE)), + .arg(BaseObject::getTypeName(ObjRole)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -3606,7 +3606,7 @@ Language *DatabaseModel::createLanguage(void) { obj_type=BaseObject::getObjectType(xmlparser.getElementName()); - if(obj_type==OBJ_FUNCTION) + if(obj_type==ObjFunction) { xmlparser.getElementAttributes(attribs); @@ -3620,7 +3620,7 @@ Language *DatabaseModel::createLanguage(void) { //Gets the function signature and tries to retrieve it from the model signature=attribs[ParsersAttributes::SIGNATURE]; - func=getObject(signature, OBJ_FUNCTION); + func=getObject(signature, ObjFunction); //Raises an error if the function doesn't exists if(!func) @@ -3628,7 +3628,7 @@ Language *DatabaseModel::createLanguage(void) .arg(lang->getName()) .arg(lang->getTypeName()) .arg(signature) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)), + .arg(BaseObject::getTypeName(ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(ref_type==ParsersAttributes::VALIDATOR_FUNC) @@ -3748,7 +3748,7 @@ Function *DatabaseModel::createFunction(void) } } //Gets the function language - else if(obj_type==OBJ_LANGUAGE) + else if(obj_type==ObjLanguage) { xmlparser.getElementAttributes(attribs); object=getObject(attribs[ParsersAttributes::NAME], obj_type); @@ -3759,7 +3759,7 @@ Function *DatabaseModel::createFunction(void) .arg(func->getName()) .arg(func->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_LANGUAGE)), + .arg(BaseObject::getTypeName(ObjLanguage)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); func->setLanguage(dynamic_cast(object)); @@ -3802,7 +3802,7 @@ Function *DatabaseModel::createFunction(void) if(e.getErrorType()==RefUserTypeInexistsModel) throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) .arg(str_aux) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)), + .arg(BaseObject::getTypeName(ObjFunction)), AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); @@ -3888,7 +3888,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[ParsersAttributes::NAME], OBJ_COLLATION); + collation=getObject(attribs[ParsersAttributes::NAME], ObjCollation); //Raises an error if the operator class doesn't exists if(!collation) @@ -3897,7 +3897,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) .arg(tpattrib.getName()) .arg(tpattrib.getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLLATION)), + .arg(BaseObject::getTypeName(ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4080,7 +4080,7 @@ Type *DatabaseModel::createType(void) else if(elem==ParsersAttributes::COLLATION) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[ParsersAttributes::NAME], OBJ_COLLATION); + collation=getObject(attribs[ParsersAttributes::NAME], ObjCollation); //Raises an error if the operator class doesn't exists if(!collation) @@ -4089,7 +4089,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLLATION)), + .arg(BaseObject::getTypeName(ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4098,7 +4098,7 @@ Type *DatabaseModel::createType(void) if(elem==ParsersAttributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], OBJ_OPCLASS)); + op_class=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjOpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -4107,7 +4107,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_OPCLASS)), + .arg(BaseObject::getTypeName(ObjOpClass)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4119,7 +4119,7 @@ Type *DatabaseModel::createType(void) xmlparser.getElementAttributes(attribs); //Tries to get the function from the model - func=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_FUNCTION); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4127,7 +4127,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)), + .arg(BaseObject::getTypeName(ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the function type is invalid else if(func_types.count(attribs[ParsersAttributes::REF_TYPE])==0) @@ -4259,7 +4259,7 @@ Cast *DatabaseModel::createCast(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_FUNCTION); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4267,7 +4267,7 @@ Cast *DatabaseModel::createCast(void) .arg(cast->getName()) .arg(cast->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)), + .arg(BaseObject::getTypeName(ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); cast->setCastFunction(dynamic_cast(func)); @@ -4318,7 +4318,7 @@ Conversion *DatabaseModel::createConversion(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_FUNCTION); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4326,7 +4326,7 @@ Conversion *DatabaseModel::createConversion(void) .arg(conv->getName()) .arg(conv->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)), + .arg(BaseObject::getTypeName(ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); conv->setConversionFunction(dynamic_cast(func)); @@ -4380,10 +4380,10 @@ Operator *DatabaseModel::createOperator(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[OBJ_OPERATOR]) + if(elem==objs_schemas[ObjOperator]) { xmlparser.getElementAttributes(attribs); - oper_aux=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_OPERATOR); + oper_aux=getObject(attribs[ParsersAttributes::SIGNATURE], ObjOperator); //Raises an error if the auxiliary operator doesn't exists if(!oper_aux && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4391,7 +4391,7 @@ Operator *DatabaseModel::createOperator(void) .arg(oper->getSignature(true)) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_OPERATOR)), + .arg(BaseObject::getTypeName(ObjOperator)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setOperator(dynamic_cast(oper_aux), @@ -4412,7 +4412,7 @@ Operator *DatabaseModel::createOperator(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_FUNCTION); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4420,7 +4420,7 @@ Operator *DatabaseModel::createOperator(void) .arg(oper->getName()) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)), + .arg(BaseObject::getTypeName(ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setFunction(dynamic_cast(func), @@ -4472,10 +4472,10 @@ OperatorClass *DatabaseModel::createOperatorClass(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[OBJ_OPFAMILY]) + if(elem==objs_schemas[ObjOpFamily]) { xmlparser.getElementAttributes(attribs); - object=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_OPFAMILY); + object=getObject(attribs[ParsersAttributes::SIGNATURE], ObjOpFamily); //Raises an error if the operator family doesn't exists if(!object) @@ -4483,7 +4483,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_OPFAMILY)), + .arg(BaseObject::getTypeName(ObjOpFamily)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); op_class->setFamily(dynamic_cast(object)); @@ -4512,12 +4512,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) } else if(elem_type==OperatorClassElement::FUNCTION_ELEM) { - object=getObject(attribs[ParsersAttributes::SIGNATURE],OBJ_FUNCTION); + object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjFunction); class_elem.setFunction(dynamic_cast(object),stg_number); } else if(elem_type==OperatorClassElement::OPERATOR_ELEM) { - object=getObject(attribs[ParsersAttributes::SIGNATURE],OBJ_OPERATOR); + object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjOperator); class_elem.setOperator(dynamic_cast(object),stg_number); if(xmlparser.hasElement(XMLParser::NEXT_ELEMENT)) @@ -4526,14 +4526,14 @@ OperatorClass *DatabaseModel::createOperatorClass(void) xmlparser.accessElement(XMLParser::NEXT_ELEMENT); xmlparser.getElementAttributes(attribs_aux); - object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],OBJ_OPFAMILY); + object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjOpFamily); if(!object && !attribs_aux[ParsersAttributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs_aux[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_OPFAMILY)), + .arg(BaseObject::getTypeName(ObjOpFamily)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); class_elem.setOperatorFamily(dynamic_cast(object)); @@ -4616,7 +4616,7 @@ Aggregate *DatabaseModel::createAggregate(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_FUNCTION); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4624,7 +4624,7 @@ Aggregate *DatabaseModel::createAggregate(void) .arg(aggreg->getName()) .arg(aggreg->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)), + .arg(BaseObject::getTypeName(ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::TRANSITION_FUNC) @@ -4686,22 +4686,22 @@ Table *DatabaseModel::createTable(void) xmlparser.savePosition(); object=nullptr; - if(elem==BaseObject::objs_schemas[OBJ_COLUMN]) + if(elem==BaseObject::objs_schemas[ObjColumn]) object=createColumn(); - else if(elem==BaseObject::objs_schemas[OBJ_CONSTRAINT]) + else if(elem==BaseObject::objs_schemas[ObjConstraint]) object=createConstraint(table); - else if(elem==BaseObject::objs_schemas[OBJ_TAG]) + else if(elem==BaseObject::objs_schemas[ObjTag]) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME] ,OBJ_TAG); + tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjTag); if(!tag) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_TABLE)) + .arg(BaseObject::getTypeName(ObjTable)) .arg(aux_attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(OBJ_TAG)) + .arg(BaseObject::getTypeName(ObjTag)) , RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4820,14 +4820,14 @@ Column *DatabaseModel::createColumn(void) if(!attribs[ParsersAttributes::SEQUENCE].isEmpty()) { - seq=getObject(attribs[ParsersAttributes::SEQUENCE], OBJ_SEQUENCE); + seq=getObject(attribs[ParsersAttributes::SEQUENCE], ObjSequence); if(!seq) throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLUMN)) + .arg(BaseObject::getTypeName(ObjColumn)) .arg(attribs[ParsersAttributes::SEQUENCE]) - .arg(BaseObject::getTypeName(OBJ_SEQUENCE)), + .arg(BaseObject::getTypeName(ObjSequence)), PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4887,9 +4887,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) obj_type=parent_obj->getObjectType(); //Identifies the correct parent type - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) table=dynamic_cast
(parent_obj); - else if(obj_type==OBJ_RELATIONSHIP) + else if(obj_type==ObjRelationship) rel=dynamic_cast(parent_obj); else //Raises an error if the user tries to create a constraint in a invalid parent @@ -4897,8 +4897,8 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) } else { - obj_type=OBJ_TABLE; - table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE)); + obj_type=ObjTable; + table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); parent_obj=table; ins_constr_table=true; @@ -4907,9 +4907,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_CONSTRAINT)) + .arg(BaseObject::getTypeName(ObjConstraint)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(OBJ_TABLE)); + .arg(BaseObject::getTypeName(ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4960,7 +4960,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(!attribs[ParsersAttributes::UPD_ACTION].isEmpty()) constr->setActionType(attribs[ParsersAttributes::UPD_ACTION], Constraint::UPDATE_ACTION); - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], OBJ_TABLE); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjTable); if(!ref_table && table->getName(true)==attribs[ParsersAttributes::REF_TABLE]) ref_table=table; @@ -4972,7 +4972,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) .arg(constr->getName()) .arg(constr->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) - .arg(BaseObject::getTypeName(OBJ_TABLE)); + .arg(BaseObject::getTypeName(ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5026,7 +5026,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { if(col_type==Constraint::SOURCE_COLS) { - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) { column=table->getColumn(col_list[i]); @@ -5035,7 +5035,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) column=table->getColumn(col_list[i], true); } else - column=dynamic_cast(rel->getObject(col_list[i], OBJ_COLUMN)); + column=dynamic_cast(rel->getObject(col_list[i], ObjColumn)); } else { @@ -5112,7 +5112,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec if(xml_elem==ParsersAttributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_OPCLASS)); + op_class=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjOpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -5123,7 +5123,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_OPCLASS)), + .arg(BaseObject::getTypeName(ObjOpClass)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5131,7 +5131,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_OPCLASS)), + .arg(BaseObject::getTypeName(ObjOpClass)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5142,7 +5142,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==ParsersAttributes::OPERATOR) { xmlparser.getElementAttributes(attribs); - oper=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_OPERATOR)); + oper=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjOperator)); //Raises an error if the operator doesn't exists if(!oper) @@ -5151,7 +5151,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_OPERATOR)), + .arg(BaseObject::getTypeName(ObjOperator)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5160,7 +5160,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==ParsersAttributes::COLLATION) { xmlparser.getElementAttributes(attribs); - collation=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], OBJ_COLLATION)); + collation=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjCollation)); //Raises an error if the operator class doesn't exists if(!collation) @@ -5171,7 +5171,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLLATION)), + .arg(BaseObject::getTypeName(ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5179,7 +5179,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLLATION)), + .arg(BaseObject::getTypeName(ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5190,7 +5190,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { xmlparser.getElementAttributes(attribs); - if(parent_obj->getObjectType()==OBJ_TABLE) + if(parent_obj->getObjectType()==ObjTable) { column=dynamic_cast
(parent_obj)->getColumn(attribs[ParsersAttributes::NAME]); @@ -5199,7 +5199,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec } else { - column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[ParsersAttributes::NAME], OBJ_COLUMN)); + column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[ParsersAttributes::NAME], ObjColumn)); } //Raises an error if the column doesn't exists @@ -5211,7 +5211,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLUMN)), + .arg(BaseObject::getTypeName(ObjColumn)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5219,7 +5219,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_COLUMN)), + .arg(BaseObject::getTypeName(ObjColumn)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5293,19 +5293,19 @@ Index *DatabaseModel::createIndex(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_VIEW)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjView)); //Raises an error if the parent table doesn't exists if(!table) { str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_INDEX)) + .arg(BaseObject::getTypeName(ObjIndex)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(OBJ_TABLE)); + .arg(BaseObject::getTypeName(ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5374,17 +5374,17 @@ Rule *DatabaseModel::createRule(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_VIEW)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjView)); if(!table) throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_RULE)) + .arg(BaseObject::getTypeName(ObjRule)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(OBJ_TABLE)), + .arg(BaseObject::getTypeName(ObjTable)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5453,17 +5453,17 @@ Trigger *DatabaseModel::createTrigger(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_VIEW)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjView)); if(!table) throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_TRIGGER)) + .arg(BaseObject::getTypeName(ObjTrigger)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(OBJ_TABLE)), + .arg(BaseObject::getTypeName(ObjTable)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5508,10 +5508,10 @@ Trigger *DatabaseModel::createTrigger(void) if(!attribs[ParsersAttributes::REF_TABLE].isEmpty()) { - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], OBJ_TABLE); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjTable); if(!ref_table) - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], OBJ_VIEW); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjView); //Raises an error if the trigger is referencing a inexistent table if(!ref_table) @@ -5520,7 +5520,7 @@ Trigger *DatabaseModel::createTrigger(void) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) - .arg(BaseObject::getTypeName(OBJ_TABLE)), + .arg(BaseObject::getTypeName(ObjTable)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5538,7 +5538,7 @@ Trigger *DatabaseModel::createTrigger(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_FUNCTION); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -5547,7 +5547,7 @@ Trigger *DatabaseModel::createTrigger(void) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)); + .arg(BaseObject::getTypeName(ObjFunction)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5571,7 +5571,7 @@ Trigger *DatabaseModel::createTrigger(void) for(i=0; i < count; i++) { - column=dynamic_cast(table->getObject(list_aux[i].trimmed(), OBJ_COLUMN)); + column=dynamic_cast(table->getObject(list_aux[i].trimmed(), ObjColumn)); if(!column && dynamic_cast
(table)) column=dynamic_cast
(table)->getColumn(list_aux[i].trimmed(), true); @@ -5610,14 +5610,14 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); if(!table) throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_POLICY)) + .arg(BaseObject::getTypeName(ObjPolicy)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(OBJ_TABLE)), + .arg(BaseObject::getTypeName(ObjTable)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::_TRUE_); @@ -5655,7 +5655,7 @@ Policy *DatabaseModel::createPolicy(void) for(auto &name : rol_names) { - role=dynamic_cast(getObject(name.trimmed(), OBJ_ROLE)); + role=dynamic_cast(getObject(name.trimmed(), ObjRole)); //Raises an error if the referenced role doesn't exists if(!role) @@ -5664,7 +5664,7 @@ Policy *DatabaseModel::createPolicy(void) .arg(policy->getName()) .arg(policy->getTypeName()) .arg(name) - .arg(BaseObject::getTypeName(OBJ_ROLE)), + .arg(BaseObject::getTypeName(ObjRole)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5713,7 +5713,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], OBJ_FUNCTION); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -5722,7 +5722,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) .arg(event_trig->getName()) .arg(event_trig->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(OBJ_FUNCTION)), + .arg(BaseObject::getTypeName(ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5817,16 +5817,16 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) col_name=elem_list[1]; } - table=getObject(tab_name, OBJ_TABLE); + table=getObject(tab_name, ObjTable); //Raises an error if the column parent table doesn't exists if(!table) { str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(sequence->getName()) - .arg(BaseObject::getTypeName(OBJ_SEQUENCE)) + .arg(BaseObject::getTypeName(ObjSequence)) .arg(tab_name) - .arg(BaseObject::getTypeName(OBJ_TABLE)); + .arg(BaseObject::getTypeName(ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5898,16 +5898,16 @@ View *DatabaseModel::createView(void) if(!attribs[ParsersAttributes::TABLE].isEmpty()) { column=nullptr; - table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE)); + table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); //Raises an error if the table doesn't exists if(!table) { str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(view->getName()) - .arg(BaseObject::getTypeName(OBJ_VIEW)) + .arg(BaseObject::getTypeName(ObjView)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(OBJ_TABLE)); + .arg(BaseObject::getTypeName(ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5924,10 +5924,10 @@ View *DatabaseModel::createView(void) { str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(view->getName()) - .arg(BaseObject::getTypeName(OBJ_VIEW)) + .arg(BaseObject::getTypeName(ObjView)) .arg(attribs[ParsersAttributes::TABLE] + QString(".") + attribs[ParsersAttributes::COLUMN]) - .arg(BaseObject::getTypeName(OBJ_COLUMN)); + .arg(BaseObject::getTypeName(ObjColumn)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5990,18 +5990,18 @@ View *DatabaseModel::createView(void) xmlparser.restorePosition(); } - else if(elem==BaseObject::getSchemaName(OBJ_TAG)) + else if(elem==BaseObject::getSchemaName(ObjTag)) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME] ,OBJ_TAG); + tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjTag); if(!tag) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_TABLE)) + .arg(BaseObject::getTypeName(ObjTable)) .arg(aux_attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(OBJ_TAG)) + .arg(BaseObject::getTypeName(ObjTag)) , RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6066,16 +6066,16 @@ Collation *DatabaseModel::createCollation(void) //Creating a collation from another collation else if(!attribs[ParsersAttributes::COLLATION].isEmpty()) { - copy_coll=this->getObject(attribs[ParsersAttributes::COLLATION], OBJ_COLLATION); + copy_coll=this->getObject(attribs[ParsersAttributes::COLLATION], ObjCollation); //Raises an error if the copy collation doesn't exists if(!copy_coll) { throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) .arg(collation->getName()) - .arg(BaseObject::getTypeName(OBJ_COLLATION)) + .arg(BaseObject::getTypeName(ObjCollation)) .arg(attribs[ParsersAttributes::COLLATION]) - .arg(BaseObject::getTypeName(OBJ_COLLATION)), + .arg(BaseObject::getTypeName(ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6203,7 +6203,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) DeferralType defer_type; ActionType del_action, upd_action; unsigned rel_type=0, i; - ObjectType table_types[2]={OBJ_VIEW, OBJ_TABLE}, obj_rel_type; + ObjectType table_types[2]={ObjView, ObjTable}, obj_rel_type; QString str_aux, elem, tab_attribs[2]={ ParsersAttributes::SRC_TABLE, ParsersAttributes::DST_TABLE }; @@ -6226,15 +6226,15 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(attribs[ParsersAttributes::TYPE]!=ParsersAttributes::RELATION_TAB_VIEW && attribs[ParsersAttributes::TYPE]!=ParsersAttributes::RELATIONSHIP_FK) { - table_types[0]=OBJ_TABLE; - obj_rel_type=OBJ_RELATIONSHIP; + table_types[0]=ObjTable; + obj_rel_type=ObjRelationship; } else { if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_FK) - table_types[0]=OBJ_TABLE; + table_types[0]=ObjTable; - obj_rel_type=BASE_RELATIONSHIP; + obj_rel_type=ObjBaseRelationship; } //Gets the participant tables @@ -6255,7 +6255,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } } - if(obj_rel_type==BASE_RELATIONSHIP) + if(obj_rel_type==ObjBaseRelationship) { base_rel=getRelationship(tables[0], tables[1]); @@ -6306,7 +6306,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) .arg(this->getName()) .arg(this->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(BASE_RELATIONSHIP)), + .arg(BaseObject::getTypeName(ObjBaseRelationship)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); base_rel->blockSignals(loading_model); @@ -6466,7 +6466,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } catch(Exception &e) { - if(base_rel && base_rel->getObjectType()==OBJ_RELATIONSHIP) + if(base_rel && base_rel->getObjectType()==ObjRelationship) delete(base_rel); throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); @@ -6484,7 +6484,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) /* If the FK relationship does not reference a foreign key (models generated in older versions) * we need to assign them to the respective relationships */ - if(base_rel && base_rel->getObjectType()==BASE_RELATIONSHIP) + if(base_rel && base_rel->getObjectType()==ObjBaseRelationship) { base_rel->blockSignals(loading_model); base_rel->connectRelationship(); @@ -6523,14 +6523,14 @@ Permission *DatabaseModel::createPermission(void) parent_name=attribs[ParsersAttributes::PARENT]; //If the object is a column its needed to get the parent table - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { - parent_table=dynamic_cast
(getObject(parent_name, OBJ_TABLE)); + parent_table=dynamic_cast
(getObject(parent_name, ObjTable)); if(parent_table) object=parent_table->getColumn(obj_name); } - else if(obj_type==OBJ_DATABASE) + else if(obj_type==ObjDatabase) { object=this; } @@ -6559,14 +6559,14 @@ Permission *DatabaseModel::createPermission(void) for(i=0; i < len; i++) { - role=dynamic_cast(getObject(list[i].trimmed(),OBJ_ROLE)); + role=dynamic_cast(getObject(list[i].trimmed(),ObjRole)); //Raises an error if the referenced role doesn't exists if(!role) { throw Exception(Exception::getErrorMessage(PermissionRefInexistObject) .arg(list[i]) - .arg(BaseObject::getTypeName(OBJ_ROLE)), + .arg(BaseObject::getTypeName(ObjRole)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6667,15 +6667,15 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab > Case the object is a column and its reference by the parent table primary key > Case the parent table is a partition and a column is being removed > Case the object is a constraint and its a table primary key */ - revalidate_rels=((obj_type==OBJ_COLUMN && + revalidate_rels=((obj_type==ObjColumn && (parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::primary_key) || parent_tab->isPartition() || parent_tab->isPartitioned())) || - (obj_type==OBJ_CONSTRAINT && + (obj_type==ObjConstraint && dynamic_cast(object)->getConstraintType()==ConstraintType::primary_key)); /* Additional validation for columns: checks if the parent table participates on a generalization/copy as destination table */ - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { itr=relationships.begin(); itr_end=relationships.end(); @@ -6823,7 +6823,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) object=obj_itr.second; obj_type=object->getObjectType(); - if(obj_type==OBJ_TYPE && def_type==SchemaParser::SQL_DEFINITION) + if(obj_type==ObjType && def_type==SchemaParser::SQL_DEFINITION) { usr_type=dynamic_cast(object); @@ -6833,7 +6833,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) else attribs_aux[attrib]+=usr_type->getCodeDefinition(def_type); } - else if(obj_type==OBJ_DATABASE) + else if(obj_type==ObjDatabase) { if(def_type==SchemaParser::SQL_DEFINITION) { @@ -6853,15 +6853,15 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) else attribs_aux[attrib]+=this->__getCodeDefinition(def_type); } - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) { attribs_aux[ParsersAttributes::PERMISSION]+=dynamic_cast(object)->getCodeDefinition(def_type); } - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) { attribs_aux[attrib]+=dynamic_cast(object)->getCodeDefinition(def_type, true); } - else if(obj_type==OBJ_ROLE || obj_type==OBJ_TABLESPACE || obj_type==OBJ_SCHEMA) + else if(obj_type==ObjRole || obj_type==ObjTablespace || obj_type==ObjSchema) { //The "public" schema does not have the SQL code definition generated if(def_type==SchemaParser::SQL_DEFINITION) @@ -6871,7 +6871,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) /* The Tablespace has the SQL code definition disabled when generating the code of the entire model because this object cannot be created from a multiline sql command */ - if(obj_type==OBJ_TABLESPACE && !object->isSystemObject() && def_type==SchemaParser::SQL_DEFINITION) + if(obj_type==ObjTablespace && !object->isSystemObject() && def_type==SchemaParser::SQL_DEFINITION) { //Saving the sql disabled state sql_disabled=object->isSQLDisabled(); @@ -6884,12 +6884,12 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) object->setSQLDisabled(sql_disabled); } //System object doesn't has the XML generated (the only exception is for public schema) - else if((obj_type!=OBJ_SCHEMA && !object->isSystemObject()) || - (obj_type==OBJ_SCHEMA && + else if((obj_type!=ObjSchema && !object->isSystemObject()) || + (obj_type==ObjSchema && ((object->getName()==QString("public") && def_type==SchemaParser::XML_DEFINITION) || (object->getName()!=QString("public") && object->getName()!=QString("pg_catalog"))))) { - if(object->getObjectType()==OBJ_SCHEMA) + if(object->getObjectType()==ObjSchema) search_path+=QString(",") + object->getName(true); //Generates the code definition and concatenates to the others @@ -6927,10 +6927,10 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[ParsersAttributes::PROTECTED]=(this->is_protected ? ParsersAttributes::_TRUE_ : QString()); attribs_aux[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs_aux[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); - attribs_aux[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[OBJ_SCHEMA] ? default_objs[OBJ_SCHEMA]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_OWNER]=(default_objs[OBJ_ROLE] ? default_objs[OBJ_ROLE]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[OBJ_TABLESPACE] ? default_objs[OBJ_TABLESPACE]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[OBJ_COLLATION] ? default_objs[OBJ_COLLATION]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjSchema] ? default_objs[ObjSchema]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjRole] ? default_objs[ObjRole]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjTablespace] ? default_objs[ObjTablespace]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjCollation] ? default_objs[ObjCollation]->getName(true) : QString()); } else { @@ -6986,18 +6986,18 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b Constraint *constr=nullptr; View *view=nullptr; Relationship *rel=nullptr; - ObjectType aux_obj_types[]={ OBJ_ROLE, OBJ_TABLESPACE, OBJ_SCHEMA, OBJ_TAG }, - obj_types[]={ OBJ_EVENT_TRIGGER, OBJ_COLLATION, OBJ_LANGUAGE, OBJ_FUNCTION, OBJ_TYPE, - OBJ_CAST, OBJ_CONVERSION, OBJ_EXTENSION, - OBJ_OPERATOR, OBJ_OPFAMILY, OBJ_OPCLASS, - OBJ_AGGREGATE, OBJ_DOMAIN, OBJ_TEXTBOX, BASE_RELATIONSHIP, - OBJ_RELATIONSHIP, OBJ_TABLE, OBJ_VIEW, OBJ_SEQUENCE, OBJ_GENERIC_SQL }; + ObjectType aux_obj_types[]={ ObjRole, ObjTablespace, ObjSchema, ObjTag }, + obj_types[]={ ObjEventTrigger, ObjCollation, ObjLanguage, ObjFunction, ObjType, + ObjCast, ObjConversion, ObjExtension, + ObjOperator, ObjOpFamily, ObjOpClass, + ObjAggregate, ObjDomain, ObjTextbox, ObjBaseRelationship, + ObjRelationship, ObjTable, ObjView, ObjSequence, ObjGenericSQL }; unsigned i=0, aux_obj_cnt=sizeof(aux_obj_types)/sizeof(ObjectType), count=sizeof(obj_types)/sizeof(ObjectType); //The first objects on the map will be roles, tablespaces, schemas and tags for(i=0; i < aux_obj_cnt; i++) { - if(aux_obj_types[i]!=OBJ_TAG || def_type==SchemaParser::XML_DEFINITION) + if(aux_obj_types[i]!=ObjTag || def_type==SchemaParser::XML_DEFINITION) { obj_list=getObjectList(aux_obj_types[i]); @@ -7013,7 +7013,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b { //For SQL definition, only the textbox and base relationship does not enters to the code generation list if(def_type==SchemaParser::SQL_DEFINITION && - (obj_types[i]==OBJ_TEXTBOX || obj_types[i]==BASE_RELATIONSHIP)) + (obj_types[i]==ObjTextbox || obj_types[i]==ObjBaseRelationship)) obj_list=nullptr; else obj_list=getObjectList(obj_types[i]); @@ -7024,7 +7024,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b { /* If the object is a FK relationship it's stored in a separeted list in order to have the code generated at end of whole definition (after foreign keys definition) */ - if(object->getObjectType()==BASE_RELATIONSHIP && + if(object->getObjectType()==ObjBaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) { fk_rels.push_back(object); @@ -7106,7 +7106,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b object=(*itr); itr++; - if(object->getObjectType()==OBJ_RELATIONSHIP) + if(object->getObjectType()==ObjRelationship) { rel=dynamic_cast(object); objs[0]=rel->getTable(Relationship::SRC_TABLE); @@ -7122,7 +7122,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b table=rel->getGeneratedTable(); objs[2]=table; - for(BaseObject *tab_obj : *table->getObjectList(OBJ_CONSTRAINT)) + for(BaseObject *tab_obj : *table->getObjectList(ObjConstraint)) { constr=dynamic_cast(tab_obj); @@ -7186,7 +7186,7 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vector dep_objs, chld_objs; Table *table=dynamic_cast
(object); - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; if(!object) return; @@ -7213,11 +7213,11 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vector::iterator end; - if(obj_type==OBJ_SCHEMA) + if(obj_type==ObjSchema) { //Retrieve all objects that belongs to the schema chld_objs=getObjects(object); @@ -7242,7 +7242,7 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vectorgetObjectType()!=OBJ_COLUMN) || + if((!constr && child->getObjectType()!=ObjColumn) || (constr && ((constr->getConstraintType()==ConstraintType::foreign_key) || (constr->getConstraintType()!=ConstraintType::foreign_key && @@ -7284,7 +7284,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on /* Include tables generated by many-to-many relationships if their schemas are the same as the 'object' when this one is a schema too */ - if(obj_type==OBJ_SCHEMA) + if(obj_type==ObjSchema) { if(only_children) { @@ -7326,7 +7326,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on { constr=dynamic_cast(child); - if((!constr && child->getObjectType()!=OBJ_COLUMN) || + if((!constr && child->getObjectType()!=ObjColumn) || (constr && ((constr->getConstraintType()==ConstraintType::foreign_key) || (constr->getConstraintType()!=ConstraintType::foreign_key && @@ -7354,7 +7354,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on if(table) { - for(BaseObject *col : *table->getObjectList(OBJ_COLUMN)) + for(BaseObject *col : *table->getObjectList(ObjColumn)) { getPermissions(col, perms_aux); perms.insert(perms.end(), perms_aux.begin(), perms_aux.end()); @@ -7445,7 +7445,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetCollation(), deps, inc_indirect_deps); //** Getting the dependecies for operator class ** - if(obj_type==OBJ_OPCLASS) + if(obj_type==ObjOpClass) { OperatorClass *opclass=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(opclass->getDataType()); @@ -7481,7 +7481,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object)->getType()); @@ -7489,13 +7489,13 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object)->getConversionFunction(); getObjectDependecies(func, deps, inc_indirect_deps); } //** Getting the dependecies for cast ** - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) { Cast *cast=dynamic_cast(object); BaseObject *usr_type=nullptr; @@ -7511,12 +7511,12 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetCastFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for event trigger ** - else if(obj_type==OBJ_EVENT_TRIGGER) + else if(obj_type==ObjEventTrigger) { getObjectDependecies(dynamic_cast(object)->getFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for function ** - else if(obj_type==OBJ_FUNCTION) + else if(obj_type==ObjFunction) { Function *func=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(func->getReturnType()); @@ -7547,7 +7547,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7574,7 +7574,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7585,7 +7585,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7612,7 +7612,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); unsigned i, i1, count, @@ -7626,7 +7626,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7655,14 +7655,14 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); if(seq->getOwnerColumn()) getObjectDependecies(seq->getOwnerColumn()->getParentTable(), deps, inc_indirect_deps); } //** Getting the dependecies for column ** - else if(obj_type==OBJ_COLUMN) + else if(obj_type==ObjColumn) { Column *col=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(col->getType()), @@ -7675,7 +7675,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7686,7 +7686,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for index ** - else if(obj_type==OBJ_INDEX) + else if(obj_type==ObjIndex) { Index *index=dynamic_cast(object); BaseObject *usr_type=nullptr; @@ -7709,7 +7709,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetIndexElement(i).getCollation(), deps, inc_indirect_deps); } } - else if(obj_type==OBJ_POLICY) + else if(obj_type==ObjPolicy) { Policy *pol=dynamic_cast(object); @@ -7717,7 +7717,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr, *seq=nullptr; @@ -7814,7 +7814,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *aux_type=nullptr; @@ -7843,7 +7843,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); unsigned i, count; @@ -7865,7 +7865,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7911,14 +7911,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector refs.push_back(this); } - if(obj_type==OBJ_VIEW && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjView && (!exclusion_mode || (exclusion_mode && !refer))) { View *view=dynamic_cast(object); vector tab_objs=view->getObjects(); refs.insert(refs.end(), tab_objs.begin(), tab_objs.end()); } - if(obj_type==OBJ_TABLE && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjTable && (!exclusion_mode || (exclusion_mode && !refer))) { Table *table=dynamic_cast
(object); Sequence *seq=nullptr; @@ -7930,7 +7930,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector vector::iterator itr, itr_end; vector *tab_objs; unsigned i, count; - ObjectType tab_obj_types[4]={ OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_POLICY }; + ObjectType tab_obj_types[4]={ ObjTrigger, ObjRule, ObjIndex, ObjPolicy }; for(i=0; i < 4; i++) { @@ -8055,14 +8055,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_FUNCTION && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjFunction && (!exclusion_mode || (exclusion_mode && !refer))) { Function *func=dynamic_cast(object); vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={OBJ_CAST, OBJ_EVENT_TRIGGER, OBJ_CONVERSION, - OBJ_AGGREGATE, OBJ_OPERATOR, OBJ_OPCLASS, - OBJ_TABLE, OBJ_TYPE, OBJ_LANGUAGE }; + ObjectType obj_types[]={ObjCast, ObjEventTrigger, ObjConversion, + ObjAggregate, ObjOperator, ObjOpClass, + ObjTable, ObjType, ObjLanguage }; unsigned i, i1, count, cnt=sizeof(obj_types)/sizeof(ObjectType); Table *tab=nullptr; Aggregate *aggreg=nullptr; @@ -8078,7 +8078,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==OBJ_CAST) + if(obj_types[i]==ObjCast) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8090,7 +8090,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==OBJ_EVENT_TRIGGER) + else if(obj_types[i]==ObjEventTrigger) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8102,7 +8102,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==OBJ_CONVERSION) + else if(obj_types[i]==ObjConversion) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8114,7 +8114,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==OBJ_AGGREGATE) + else if(obj_types[i]==ObjAggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8129,7 +8129,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==OBJ_OPERATOR) + else if(obj_types[i]==ObjOperator) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8145,7 +8145,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==OBJ_OPCLASS) + else if(obj_types[i]==ObjOpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8163,7 +8163,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==OBJ_TABLE) + else if(obj_types[i]==ObjTable) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8183,7 +8183,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_TYPE) + else if(obj_types[i]==ObjType) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8200,7 +8200,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_LANGUAGE) + else if(obj_types[i]==ObjLanguage) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8219,14 +8219,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_SCHEMA && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjSchema && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[11]={OBJ_FUNCTION, OBJ_TABLE, OBJ_VIEW, - OBJ_DOMAIN, OBJ_AGGREGATE, OBJ_OPERATOR, - OBJ_SEQUENCE, OBJ_CONVERSION, - OBJ_TYPE, OBJ_OPFAMILY, OBJ_OPCLASS}; + ObjectType obj_types[11]={ObjFunction, ObjTable, ObjView, + ObjDomain, ObjAggregate, ObjOperator, + ObjSequence, ObjConversion, + ObjType, ObjOpFamily, ObjOpClass}; unsigned i; for(i=0; i < 11 && (!exclusion_mode || (exclusion_mode && !refer)); i++) @@ -8247,15 +8247,15 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if((obj_type==OBJ_TYPE || obj_type==OBJ_DOMAIN || obj_type==OBJ_SEQUENCE || - obj_type==OBJ_TABLE || obj_type==OBJ_EXTENSION || obj_type==OBJ_VIEW) + if((obj_type==ObjType || obj_type==ObjDomain || obj_type==ObjSequence || + obj_type==ObjTable || obj_type==ObjExtension || obj_type==ObjView) && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={OBJ_TABLE, OBJ_OPCLASS, OBJ_CAST, - OBJ_DOMAIN, OBJ_FUNCTION, OBJ_AGGREGATE, - OBJ_OPERATOR, OBJ_TYPE, OBJ_RELATIONSHIP }; + ObjectType obj_types[]={ObjTable, ObjOpClass, ObjCast, + ObjDomain, ObjFunction, ObjAggregate, + ObjOperator, ObjType, ObjRelationship }; unsigned i, i1, count, tp_count = sizeof(obj_types)/sizeof(ObjectType); OperatorClass *op_class=nullptr; OperatorClassElement elem; @@ -8272,13 +8272,13 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector switch(obj_type) { - case OBJ_TYPE: ptr_pgsqltype=dynamic_cast(object); break; - case OBJ_DOMAIN: + case ObjType: ptr_pgsqltype=dynamic_cast(object); break; + case ObjDomain: ptr_pgsqltype=dynamic_cast(object); break; - case OBJ_SEQUENCE: ptr_pgsqltype=dynamic_cast(object); break; - case OBJ_EXTENSION: ptr_pgsqltype=dynamic_cast(object); break; - case OBJ_VIEW: ptr_pgsqltype=dynamic_cast(object); break; + case ObjSequence: ptr_pgsqltype=dynamic_cast(object); break; + case ObjExtension: ptr_pgsqltype=dynamic_cast(object); break; + case ObjView: ptr_pgsqltype=dynamic_cast(object); break; default: ptr_pgsqltype=dynamic_cast(object); break; } @@ -8288,7 +8288,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==OBJ_RELATIONSHIP) + if(obj_types[i]==ObjRelationship) { bool added; @@ -8311,7 +8311,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_TABLE) + else if(obj_types[i]==ObjTable) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8326,7 +8326,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector if(!col->isAddedByRelationship() && (col->getType()==ptr_pgsqltype || //Special case for postgis extension - (obj_type == OBJ_EXTENSION && object->getName() == QString("postgis") && col->getType().isGiSType()))) + (obj_type == ObjExtension && object->getName() == QString("postgis") && col->getType().isGiSType()))) { refer=true; refs.push_back(col); @@ -8334,7 +8334,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_OPCLASS) + else if(obj_types[i]==ObjOpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8358,7 +8358,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_DOMAIN) + else if(obj_types[i]==ObjDomain) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8372,7 +8372,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_TYPE) + else if(obj_types[i]==ObjType) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8389,7 +8389,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_AGGREGATE) + else if(obj_types[i]==ObjAggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8407,7 +8407,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_FUNCTION) + else if(obj_types[i]==ObjFunction) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8433,7 +8433,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_OPERATOR) + else if(obj_types[i]==ObjOperator) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8448,7 +8448,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_CAST) + else if(obj_types[i]==ObjCast) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8466,15 +8466,15 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_ROLE && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjRole && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[13]={OBJ_FUNCTION, OBJ_TABLE, OBJ_DOMAIN, - OBJ_AGGREGATE, OBJ_SCHEMA, OBJ_OPERATOR, - OBJ_SEQUENCE, OBJ_CONVERSION, - OBJ_LANGUAGE, OBJ_TABLESPACE, - OBJ_TYPE, OBJ_OPFAMILY, OBJ_OPCLASS}; + ObjectType obj_types[13]={ObjFunction, ObjTable, ObjDomain, + ObjAggregate, ObjSchema, ObjOperator, + ObjSequence, ObjConversion, + ObjLanguage, ObjTablespace, + ObjType, ObjOpFamily, ObjOpClass}; unsigned i,i1, count; Role *role_aux=nullptr; Role *role=dynamic_cast(object); @@ -8532,9 +8532,9 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector refs.push_back(*itr); } - if((*itr)->getObjectType() == OBJ_TABLE) + if((*itr)->getObjectType() == ObjTable) { - for(auto obj : *(dynamic_cast
(*itr))->getObjectList(OBJ_POLICY)) + for(auto obj : *(dynamic_cast
(*itr))->getObjectList(ObjPolicy)) { if(dynamic_cast(obj)->isRoleExists(role)) { @@ -8556,7 +8556,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_TABLESPACE && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjTablespace && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; unsigned i, count; @@ -8609,7 +8609,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_LANGUAGE && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjLanguage && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; Function *func=nullptr; @@ -8629,7 +8629,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_OPCLASS && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjOpClass && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; Type *usertype=nullptr; @@ -8707,14 +8707,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_OPERATOR && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjOperator && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={OBJ_OPCLASS, - OBJ_AGGREGATE, - OBJ_OPERATOR, - OBJ_TABLE }; + ObjectType obj_types[]={ObjOpClass, + ObjAggregate, + ObjOperator, + ObjTable }; unsigned i, i1, count; OperatorClass *op_class=nullptr; Operator *oper_aux=nullptr, *oper=dynamic_cast(object); @@ -8727,7 +8727,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==OBJ_OPCLASS) + if(obj_types[i]==ObjOpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8745,7 +8745,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==OBJ_AGGREGATE) + else if(obj_types[i]==ObjAggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8757,7 +8757,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==OBJ_OPERATOR) + else if(obj_types[i]==ObjOperator) { while(itr!=itr_end && !refer) { @@ -8805,7 +8805,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_OPFAMILY && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjOpFamily && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; OperatorFamily *op_family=dynamic_cast(object); @@ -8824,10 +8824,10 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_COLLATION && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjCollation && (!exclusion_mode || (exclusion_mode && !refer))) { - ObjectType obj_types[]={ OBJ_DOMAIN, OBJ_COLLATION, OBJ_TYPE }, - tab_obj_types[]={ OBJ_COLUMN, OBJ_INDEX }; + ObjectType obj_types[]={ ObjDomain, ObjCollation, ObjType }, + tab_obj_types[]={ ObjColumn, ObjIndex }; unsigned i, count; vector *obj_list=nullptr; vector::iterator itr, itr_end; @@ -8856,7 +8856,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } count=sizeof(tab_obj_types)/sizeof(ObjectType); - obj_list=getObjectList(OBJ_TABLE); + obj_list=getObjectList(ObjTable); itr=obj_list->begin(); itr_end=obj_list->end(); @@ -8873,8 +8873,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(tab_itr!=tab_itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { tab_obj=(*tab_itr); - if((tab_obj->getObjectType()==OBJ_COLUMN && tab_obj->getCollation()==object) || - (tab_obj->getObjectType()==OBJ_INDEX && + if((tab_obj->getObjectType()==ObjColumn && tab_obj->getCollation()==object) || + (tab_obj->getObjectType()==ObjIndex && dynamic_cast(tab_obj)->isReferCollation(dynamic_cast(object)))) { refer=true; @@ -8899,12 +8899,12 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_COLUMN && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjColumn && (!exclusion_mode || (exclusion_mode && !refer))) { Column *column=dynamic_cast(object); vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ OBJ_SEQUENCE, OBJ_VIEW, OBJ_TABLE, OBJ_RELATIONSHIP }; + ObjectType obj_types[]={ ObjSequence, ObjView, ObjTable, ObjRelationship }; unsigned i, count=sizeof(obj_types)/sizeof(ObjectType); for(i=0; i < count && (!exclusion_mode || (exclusion_mode && !refer)); i++) @@ -8915,13 +8915,13 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { - if((obj_types[i]==OBJ_SEQUENCE && dynamic_cast(*itr)->getOwnerColumn()==column) || - (obj_types[i]==OBJ_VIEW && dynamic_cast(*itr)->isReferencingColumn(column))) + if((obj_types[i]==ObjSequence && dynamic_cast(*itr)->getOwnerColumn()==column) || + (obj_types[i]==ObjView && dynamic_cast(*itr)->isReferencingColumn(column))) { refer=true; refs.push_back(*itr); } - else if(obj_types[i]==OBJ_TABLE) + else if(obj_types[i]==ObjTable) { Table *tab=dynamic_cast
(*itr); unsigned count, idx, count1, i1; @@ -8980,7 +8980,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - else if(obj_types[i]==OBJ_RELATIONSHIP) + else if(obj_types[i]==ObjRelationship) { Relationship *rel=dynamic_cast(*itr); unsigned constr_cnt, idx; @@ -9002,7 +9002,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } - if(obj_type==OBJ_TAG && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjTag && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; vector list; @@ -9025,7 +9025,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==OBJ_SEQUENCE && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjSequence && (!exclusion_mode || (exclusion_mode && !refer))) { Table *table=nullptr; vector *cols=nullptr; @@ -9035,7 +9035,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector for(i=0; i < cnt && (!exclusion_mode || (exclusion_mode && !refer)); i++) { table=dynamic_cast
(tables[i]); - cols=table->getObjectList(OBJ_COLUMN); + cols=table->getObjectList(ObjColumn); itr=cols->begin(); itr_end=cols->end(); @@ -9083,9 +9083,9 @@ void DatabaseModel::setObjectsModified(vector &objects) void DatabaseModel::setObjectsModified(vector types) { - ObjectType obj_types[]={OBJ_TABLE, OBJ_VIEW, - OBJ_RELATIONSHIP, BASE_RELATIONSHIP, - OBJ_TEXTBOX, OBJ_SCHEMA }; + ObjectType obj_types[]={ObjTable, ObjView, + ObjRelationship, ObjBaseRelationship, + ObjTextbox, ObjSchema }; vector::iterator itr, itr_end; vector *obj_list=nullptr; Textbox *label=nullptr; @@ -9105,7 +9105,7 @@ void DatabaseModel::setObjectsModified(vector types) dynamic_cast(*itr)->setModified(true); //For relationships is needed to set the labels as modified too - if(obj_types[i]==OBJ_RELATIONSHIP || obj_types[i]==BASE_RELATIONSHIP) + if(obj_types[i]==ObjRelationship || obj_types[i]==ObjBaseRelationship) { rel=dynamic_cast(*itr); for(i1=0; i1 < 3; i1++) @@ -9130,8 +9130,8 @@ void DatabaseModel::setCodesInvalidated(vector types) sel_types=BaseObject::getObjectTypes(false); else { - ObjectType tab_obj_types[]={OBJ_COLUMN, OBJ_CONSTRAINT, - OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_POLICY}; + ObjectType tab_obj_types[]={ObjColumn, ObjConstraint, + ObjTrigger, ObjRule, ObjIndex, ObjPolicy}; for(unsigned i=0; i < 6; i++) sel_types.erase(std::find(sel_types.begin(), sel_types.end(), tab_obj_types[i])); @@ -9156,27 +9156,27 @@ BaseObject *DatabaseModel::getObjectPgSQLType(PgSQLType type) switch(type.getUserTypeConfig()) { case UserTypeConfig::BASE_TYPE: - return(this->getObject(*type, OBJ_TYPE)); + return(this->getObject(*type, ObjType)); break; case UserTypeConfig::DOMAIN_TYPE: - return(this->getObject(*type, OBJ_DOMAIN)); + return(this->getObject(*type, ObjDomain)); break; case UserTypeConfig::TABLE_TYPE: - return(this->getObject(*type, OBJ_TABLE)); + return(this->getObject(*type, ObjTable)); break; case UserTypeConfig::VIEW_TYPE: - return(this->getObject(*type, OBJ_VIEW)); + return(this->getObject(*type, ObjView)); break; case UserTypeConfig::SEQUENCE_TYPE: - return(this->getObject(*type, OBJ_SEQUENCE)); + return(this->getObject(*type, ObjSequence)); break; case UserTypeConfig::EXTENSION_TYPE: - return(this->getObject(*type, OBJ_EXTENSION)); + return(this->getObject(*type, ObjExtension)); break; default: @@ -9187,7 +9187,7 @@ BaseObject *DatabaseModel::getObjectPgSQLType(PgSQLType type) void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_sch_name) { - ObjectType types[]={ OBJ_TABLE, OBJ_VIEW, OBJ_DOMAIN, OBJ_TYPE, OBJ_SEQUENCE }; + ObjectType types[]={ ObjTable, ObjView, ObjDomain, ObjType, ObjSequence }; vector list, vet; BaseObject *obj=nullptr; QString prev_name; @@ -9208,7 +9208,7 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s obj=list.back(); //For objects that is not a Views is needed to rename the pgsql type represented by the object - if(obj->getObjectType()!=OBJ_VIEW) + if(obj->getObjectType()!=ObjView) { //Configures the previous type name prev_name=BaseObject::formatName(prev_sch_name) + QString(".") + @@ -9216,14 +9216,14 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s /* Special case for tables. Need to make a dynamic_cast before the reinterpret_cast to get the correct reference to table */ - if(obj->getObjectType()==OBJ_TABLE) + if(obj->getObjectType()==ObjTable) PgSQLType::renameUserType(prev_name, reinterpret_cast(dynamic_cast
(obj)), obj->getName(true)); else PgSQLType::renameUserType(prev_name, reinterpret_cast(obj), obj->getName(true)); } //For graphical objects set them as modified to redraw them - if(obj->getObjectType()==OBJ_TABLE || obj->getObjectType()==OBJ_VIEW) + if(obj->getObjectType()==ObjTable || obj->getObjectType()==ObjView) dynamic_cast(obj)->setModified(true); list.pop_back(); @@ -9243,7 +9243,7 @@ void DatabaseModel::createSystemObjects(bool create_public) /* The particular case is for public schema that is created only when the flag is set. This because the public schema is written on model file even being a system object. This strategy permits the user controls the schema rectangle behavior */ - if(create_public && getObjectIndex(QString("public"), OBJ_SCHEMA) < 0) + if(create_public && getObjectIndex(QString("public"), ObjSchema) < 0) { public_sch=new Schema; public_sch->setName(QString("public")); @@ -9271,7 +9271,7 @@ void DatabaseModel::createSystemObjects(bool create_public) for(unsigned i=0; i < sizeof(lang_types)/sizeof(LanguageType); i++) { - if(getObjectIndex(~LanguageType(lang_types[i]), OBJ_LANGUAGE) < 0) + if(getObjectIndex(~LanguageType(lang_types[i]), ObjLanguage) < 0) { lang=new Language; lang->BaseObject::setName(~LanguageType(lang_types[i])); @@ -9299,7 +9299,7 @@ void DatabaseModel::createSystemObjects(bool create_public) addRole(postgres); setDefaultObject(postgres); - setDefaultObject(getObject(QString("public"), OBJ_SCHEMA), OBJ_SCHEMA); + setDefaultObject(getObject(QString("public"), ObjSchema), ObjSchema); } vector DatabaseModel::findObjects(const QString &pattern, vector types, bool format_obj_names, bool case_sensitive, bool is_regexp, bool exact_match) @@ -9329,13 +9329,13 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorbegin(), getObjectList(OBJ_TABLE)->end()); + tables.insert(tables.end(), getObjectList(ObjTable)->begin(), getObjectList(ObjTable)->end()); inc_tabs=true; } - if(!inc_views && ((*itr_tp)==OBJ_RULE || (*itr_tp)==OBJ_TRIGGER)) + if(!inc_views && ((*itr_tp)==ObjRule || (*itr_tp)==ObjTrigger)) { - tables.insert(tables.end(), getObjectList(OBJ_VIEW)->begin(), getObjectList(OBJ_VIEW)->end()); + tables.insert(tables.end(), getObjectList(ObjView)->begin(), getObjectList(ObjView)->end()); inc_views=true; } @@ -9349,7 +9349,7 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorbegin(), getObjectList(obj_type)->end()); @@ -9365,10 +9365,10 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorgetObjectType()==OBJ_TABLE) + if(tab->getObjectType()==ObjTable) tab_objs=dynamic_cast
(tab)->getObjectList(obj_type); - else if(tab->getObjectType()==OBJ_VIEW && - (obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE)) + else if(tab->getObjectType()==ObjView && + (obj_type==ObjTrigger || obj_type==ObjRule)) tab_objs=dynamic_cast(tab)->getObjectList(obj_type); if(tab_objs) @@ -9583,15 +9583,15 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_objs_prot || save_objs_sqldis) { - vector types=getChildObjectTypes(OBJ_DATABASE), sch_types=getChildObjectTypes(OBJ_SCHEMA); + vector types=getChildObjectTypes(ObjDatabase), sch_types=getChildObjectTypes(ObjSchema); types.insert(types.end(), sch_types.begin(), sch_types.end()); //Removing the types for schema, table and view to avoid retrieving the objects twice if(save_objs_pos) { - types.erase(std::find(types.begin(), types.end(), OBJ_SCHEMA)); - types.erase(std::find(types.begin(), types.end(), OBJ_TABLE)); - types.erase(std::find(types.begin(), types.end(), OBJ_VIEW)); + types.erase(std::find(types.begin(), types.end(), ObjSchema)); + types.erase(std::find(types.begin(), types.end(), ObjTable)); + types.erase(std::find(types.begin(), types.end(), ObjView)); } //Append the other objects to the list of selected entities @@ -9604,7 +9604,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option obj_type=object->getObjectType(); //When handling a tag , textbox or generic sql we just extract their XML code - if(obj_type==OBJ_TEXTBOX || obj_type==OBJ_TAG || obj_type == OBJ_GENERIC_SQL) + if(obj_type==ObjTextbox || obj_type==ObjTag || obj_type == ObjGenericSQL) { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving object `%1' (%2)") @@ -9638,7 +9638,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::TABLE]=base_tab->getSignature(); } - if(save_custom_sql && obj_type==OBJ_DATABASE) + if(save_custom_sql && obj_type==ObjDatabase) { attribs[ParsersAttributes::APPEND_AT_EOD]=(this->isAppendAtEOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); attribs[ParsersAttributes::PREPEND_AT_BOD]=(this->isPrependedAtBOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); @@ -9650,20 +9650,20 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::MODEL_AUTHOR]=this->getAuthor(); attribs[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); - attribs[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[OBJ_COLLATION] ? default_objs[OBJ_COLLATION]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[OBJ_SCHEMA] ? default_objs[OBJ_SCHEMA]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[OBJ_TABLESPACE] ? default_objs[OBJ_TABLESPACE]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_OWNER]=(default_objs[OBJ_ROLE] ? default_objs[OBJ_ROLE]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjCollation] ? default_objs[ObjCollation]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjSchema] ? default_objs[ObjSchema]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjTablespace] ? default_objs[ObjTablespace]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjRole] ? default_objs[ObjRole]->getSignature() : QString()); } //If the object is a graphic one and we need to save positions and colors if((save_objs_pos || save_custom_colors) && graph_obj) { - if(obj_type!=BASE_RELATIONSHIP && obj_type!=OBJ_RELATIONSHIP) + if(obj_type!=ObjBaseRelationship && obj_type!=ObjRelationship) { pnt=graph_obj->getPosition(); - if(obj_type==OBJ_SCHEMA) + if(obj_type==ObjSchema) { schema=dynamic_cast(object); @@ -9682,7 +9682,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::Y_POS]=QString::number(pnt.y()); } - if(obj_type!=OBJ_SCHEMA || !attribs[ParsersAttributes::X_POS].isEmpty()) + if(obj_type!=ObjSchema || !attribs[ParsersAttributes::X_POS].isEmpty()) { schparser.ignoreUnkownAttributes(true); attribs[ParsersAttributes::POSITION]= @@ -9756,9 +9756,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option /* The object's metadata code will be generated only if one of the key attributes for each option were filled previously. */ - if((save_db_attribs && obj_type==OBJ_DATABASE) || + if((save_db_attribs && obj_type==ObjDatabase) || (save_custom_colors && - ((obj_type==OBJ_RELATIONSHIP || obj_type==BASE_RELATIONSHIP) || + ((obj_type==ObjRelationship || obj_type==ObjBaseRelationship) || (!attribs[ParsersAttributes::CUSTOM_COLOR].isEmpty()))) || (save_objs_pos && (!attribs[ParsersAttributes::POSITION].isEmpty() || @@ -9797,10 +9797,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option ParsersAttributes::METADATA + GlobalAttributes::SchemaExt, attribs)); output.write(buf.data(),buf.size()); - emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), BASE_OBJECT); + emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ObjBaseObject); } else - emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), BASE_OBJECT); + emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), ObjBaseObject); output.close(); } @@ -9872,9 +9872,9 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { elem_name=xmlparser.getElementName(); - if((elem_name==BaseObject::getSchemaName(OBJ_TAG) && load_tags) || - (elem_name==BaseObject::getSchemaName(OBJ_TEXTBOX) && load_textboxes) || - (elem_name==BaseObject::getSchemaName(OBJ_GENERIC_SQL) && load_genericsqls)) + if((elem_name==BaseObject::getSchemaName(ObjTag) && load_tags) || + (elem_name==BaseObject::getSchemaName(ObjTextbox) && load_textboxes) || + (elem_name==BaseObject::getSchemaName(ObjGenericSQL) && load_genericsqls)) { xmlparser.savePosition(); obj_type=BaseObject::getObjectType(elem_name); @@ -9889,7 +9889,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) already exists. Ignoring.") - .arg(new_object->getName()).arg(new_object->getTypeName()), BASE_OBJECT); + .arg(new_object->getName()).arg(new_object->getTypeName()), ObjBaseObject); delete(new_object); } @@ -9905,16 +9905,16 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option obj_type=BaseObject::getObjectType(attribs[ParsersAttributes::TYPE]); progress=xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()) * 100; - if(obj_type==OBJ_DATABASE) + if(obj_type==ObjDatabase) { if(load_db_attribs) { QStringList pos=attribs[ParsersAttributes::LAST_POSITION].split(','); - default_objs[OBJ_SCHEMA]=getSchema(attribs[ParsersAttributes::DEFAULT_SCHEMA]); - default_objs[OBJ_ROLE]=getRole(attribs[ParsersAttributes::DEFAULT_OWNER]); - default_objs[OBJ_COLLATION]=getCollation(attribs[ParsersAttributes::DEFAULT_COLLATION]); - default_objs[OBJ_TABLESPACE]=getTablespace(attribs[ParsersAttributes::DEFAULT_TABLESPACE]); + default_objs[ObjSchema]=getSchema(attribs[ParsersAttributes::DEFAULT_SCHEMA]); + default_objs[ObjRole]=getRole(attribs[ParsersAttributes::DEFAULT_OWNER]); + default_objs[ObjCollation]=getCollation(attribs[ParsersAttributes::DEFAULT_COLLATION]); + default_objs[ObjTablespace]=getTablespace(attribs[ParsersAttributes::DEFAULT_TABLESPACE]); author=attribs[ParsersAttributes::MODEL_AUTHOR]; last_zoom=attribs[ParsersAttributes::LAST_ZOOM].toFloat(); @@ -9928,7 +9928,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { base_tab = getTable(attribs[ParsersAttributes::TABLE]); - if(!base_tab && (obj_type == OBJ_RULE || obj_type == OBJ_INDEX || obj_type == OBJ_TRIGGER)) + if(!base_tab && (obj_type == ObjRule || obj_type == ObjIndex || obj_type == ObjTrigger)) base_tab = getView(attribs[ParsersAttributes::TABLE]); if(base_tab) @@ -9943,7 +9943,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option /* If the object does not exists but it is a relationship, we try to get the relationship involving the tables in paramenters src-table and dst-table */ - if(!object && obj_type==OBJ_RELATIONSHIP) + if(!object && obj_type==ObjRelationship) { src_tab=dynamic_cast(getObject(attribs[ParsersAttributes::SRC_TABLE], BaseObject::getObjectType(attribs[ParsersAttributes::SRC_TYPE]))); @@ -9967,14 +9967,14 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(!attribs[ParsersAttributes::SQL_DISABLED].isEmpty()) object->setSQLDisabled(attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_); } - else if((obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) && load_tags && !attribs[ParsersAttributes::TAG].isEmpty()) + else if((obj_type==ObjTable || obj_type==ObjView) && load_tags && !attribs[ParsersAttributes::TAG].isEmpty()) { tag=getTag(attribs[ParsersAttributes::TAG]); if(tag) dynamic_cast(object)->setTag(tag); } - else if(obj_type==OBJ_DATABASE && load_custom_sql) + else if(obj_type==ObjDatabase && load_custom_sql) { if(!attribs[ParsersAttributes::APPEND_AT_EOD].isEmpty()) this->setAppendAtEOD(attribs[ParsersAttributes::APPEND_AT_EOD]==ParsersAttributes::_TRUE_); @@ -10084,7 +10084,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else if(!object) { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) not found. Ignoring metadata.") - .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), BASE_OBJECT); + .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), ObjBaseObject); } xmlparser.restorePosition(); @@ -10095,7 +10095,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); } - emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), BASE_OBJECT); + emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ObjBaseObject); setObjectsModified(); } catch(Exception &e) diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 0f3502faae..5934e3b305 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -270,7 +270,7 @@ class DatabaseModel: public QObject, public BaseObject { //! \brief Sets the sql prepeding at beginning of entire model definition void setPrependAtBOD(bool value); - void setDefaultObject(BaseObject *object, ObjectType obj_type=BASE_OBJECT); + void setDefaultObject(BaseObject *object, ObjectType obj_type=ObjBaseObject); void setIsTemplate(bool value); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 6cde10f77b..247595f311 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -20,7 +20,7 @@ Domain::Domain(void) { - obj_type=OBJ_DOMAIN; + obj_type=ObjDomain; not_null=false; attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); attributes[ParsersAttributes::NOT_NULL]=QString(); @@ -41,7 +41,7 @@ void Domain::addCheckConstraint(const QString &name, const QString &expr) { throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) .arg(name) - .arg(BaseObject::getTypeName(OBJ_CONSTRAINT)) + .arg(BaseObject::getTypeName(ObjConstraint)) .arg(this->getName(true)) .arg(this->getTypeName()), AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index e72fec9c2c..e6b8cf93f6 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -20,7 +20,7 @@ EventTrigger::EventTrigger(void) { - obj_type=OBJ_EVENT_TRIGGER; + obj_type=ObjEventTrigger; function=nullptr; attributes[ParsersAttributes::EVENT]=QString(); attributes[ParsersAttributes::FILTER]=QString(); @@ -38,7 +38,7 @@ void EventTrigger::setFunction(Function *func) if(!func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_EVENT_TRIGGER)), + .arg(BaseObject::getTypeName(ObjEventTrigger)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions with return type other that event_trigger are not accepted else if(func->getReturnType()!=QString("event_trigger")) @@ -47,7 +47,7 @@ void EventTrigger::setFunction(Function *func) else if(func->getParameterCount()!=0) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_EVENT_TRIGGER)), + .arg(BaseObject::getTypeName(ObjEventTrigger)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions coded in SQL lang. is not accepted by event triggers else if(func->getLanguage()->getName()==~LanguageType(LanguageType::sql)) diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 0c948dbc4f..9c630298cb 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -2,7 +2,7 @@ Extension::Extension(void) { - obj_type=OBJ_EXTENSION; + obj_type=ObjExtension; handles_type=false; attributes[ParsersAttributes::HANDLES_TYPE]=QString(); attributes[ParsersAttributes::CUR_VERSION]=QString(); diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 8ec97ecef0..ac5ae5163c 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -25,7 +25,7 @@ Function::Function(void) returns_setof=false; is_wnd_function=false; is_leakproof=false; - obj_type=OBJ_FUNCTION; + obj_type=ObjFunction; execution_cost=100; row_amount=1000; @@ -211,7 +211,7 @@ void Function::setLanguage(BaseObject *language) if(!language) throw Exception(AsgNotAllocatedLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the language object is invalid - else if(language->getObjectType()!=OBJ_LANGUAGE) + else if(language->getObjectType()!=ObjLanguage) throw Exception(AsgInvalidLanguageObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->language != language); diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index bdff78407b..604ab98a64 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -20,7 +20,7 @@ GenericSQL::GenericSQL(void) { - obj_type=OBJ_GENERIC_SQL; + obj_type=ObjGenericSQL; attributes[ParsersAttributes::DEFINITION] = QString(); } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 8d083e8fca..d7abd54462 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -20,7 +20,7 @@ Index::Index(void) { - obj_type=OBJ_INDEX; + obj_type=ObjIndex; index_attribs[UNIQUE]=index_attribs[CONCURRENT]= index_attribs[FAST_UPDATE]=index_attribs[BUFFERING]=false; fill_factor=90; diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index f435891a7f..ce0e6fd35f 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -20,7 +20,7 @@ Language::Language(void) { - obj_type=OBJ_LANGUAGE; + obj_type=ObjLanguage; is_trusted=false; for(unsigned i=VALIDATOR_FUNC; i <= INLINE_FUNC; i++) @@ -38,7 +38,7 @@ void Language::setName(const QString &name) if(name.toLower()==~LanguageType("c") || name.toLower()==~LanguageType("sql")) throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_LANGUAGE)), + .arg(BaseObject::getTypeName(ObjLanguage)), AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); @@ -85,7 +85,7 @@ void Language::setFunction(Function *func, unsigned func_type) ((func_type==VALIDATOR_FUNC || func_type==INLINE_FUNC) && func->getReturnType()!=QString("void"))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(OBJ_LANGUAGE)), + .arg(BaseObject::getTypeName(ObjLanguage)), AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else //Raises an error in case the function has invalid parameters (count and types) diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index e91fb5e6f9..54adac8d98 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -164,7 +164,7 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) { BaseObject *copy_obj=nullptr; - if(obj_type!=BASE_OBJECT && obj_type!=OBJ_DATABASE) + if(obj_type!=ObjBaseObject && obj_type!=ObjDatabase) PgModelerNS::copyObject(©_obj, object, obj_type); else throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -228,7 +228,7 @@ void OperationList::removeOperations(void) if(unallocated_objs.count(object)==0 && (!tab_obj && model->getObjectIndex(object) < 0)) { - if(object->getObjectType()==OBJ_TABLE) + if(object->getObjectType()==ObjTable) { vector list=dynamic_cast
(object)->getObjects(); @@ -355,10 +355,10 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(parent_obj && - (((obj_type==OBJ_COLUMN || obj_type==OBJ_CONSTRAINT) && - (parent_obj->getObjectType()!=OBJ_RELATIONSHIP && parent_obj->getObjectType()!=OBJ_TABLE)) || + (((obj_type==ObjColumn || obj_type==ObjConstraint) && + (parent_obj->getObjectType()!=ObjRelationship && parent_obj->getObjectType()!=ObjTable)) || - ((obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE || obj_type==OBJ_INDEX) && !dynamic_cast(parent_obj)))) + ((obj_type==ObjTrigger || obj_type==ObjRule || obj_type==ObjIndex) && !dynamic_cast(parent_obj)))) throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the operations list is full makes the automatic cleaning before inserting a new operation @@ -414,19 +414,19 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje in the list on the parent object */ if(tab_obj) { - if(parent_obj->getObjectType()==OBJ_RELATIONSHIP) + if(parent_obj->getObjectType()==ObjRelationship) parent_rel=dynamic_cast(parent_obj); else parent_tab=dynamic_cast(parent_obj); - if(((obj_type==OBJ_TRIGGER && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || - (obj_type==OBJ_INDEX && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || - (obj_type==OBJ_CONSTRAINT && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()))) + if(((obj_type==ObjTrigger && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || + (obj_type==ObjIndex && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || + (obj_type==ObjConstraint && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()))) { if(op_type==Operation::OBJECT_REMOVED) tab_obj->setParentTable(parent_tab); - if(tab_obj->getObjectType()==OBJ_CONSTRAINT) + if(tab_obj->getObjectType()==ObjConstraint) operation->setXMLDefinition(dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::XML_DEFINITION, true)); else operation->setXMLDefinition(tab_obj->getCodeDefinition(SchemaParser::XML_DEFINITION)); @@ -436,7 +436,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje /* If there is a parent relationship will get the index of the object. Only columns and constraints are handled case the parent is a relationship */ - if(parent_rel && (obj_type==OBJ_COLUMN || obj_type==OBJ_CONSTRAINT)) + if(parent_rel && (obj_type==ObjColumn || obj_type==ObjConstraint)) { //Case a specific index wasn't specified if(object_idx < 0) @@ -461,8 +461,8 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje } else { - if((obj_type==OBJ_SEQUENCE && dynamic_cast(object)->isReferRelationshipAddedColumn()) || - (obj_type==OBJ_VIEW && dynamic_cast(object)->isReferRelationshipAddedColumn())) + if((obj_type==ObjSequence && dynamic_cast(object)->isReferRelationshipAddedColumn()) || + (obj_type==ObjView && dynamic_cast(object)->isReferRelationshipAddedColumn())) operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XML_DEFINITION)); //Case a specific index wasn't specified @@ -474,7 +474,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje obj_idx=object_idx; } - if(obj_type==OBJ_COLUMN && dynamic_cast(object)->getType().isUserType()) + if(obj_type==ObjColumn && dynamic_cast(object)->getType().isUserType()) operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XML_DEFINITION)); operation->setObjectIndex(obj_idx); @@ -517,7 +517,7 @@ void OperationList::getOperationData(unsigned oper_idx, unsigned &oper_type, QSt } else { - obj_type=BASE_OBJECT; + obj_type=ObjBaseObject; obj_name=trUtf8("(invalid object)"); } } @@ -698,13 +698,13 @@ void OperationList::executeOperation(Operation *oper, bool redo) obj_idx=oper->getObjectIndex(); /* Converting the parent object, if any, to the correct class according - to the type of the parent object. If OBJ_TABLE|OBJ_VIEW, the pointer + to the type of the parent object. If ObjTable|ObjView, the pointer 'parent_tab' get the reference to table/view and will be used as referential in the operations below. If the parent object is a relationship, the pointer 'parent_rel' get the reference to the relationship */ if(parent_obj) { - if(parent_obj->getObjectType()==OBJ_RELATIONSHIP) + if(parent_obj->getObjectType()==ObjRelationship) parent_rel=dynamic_cast(parent_obj); else parent_tab=dynamic_cast(parent_obj); @@ -722,17 +722,17 @@ void OperationList::executeOperation(Operation *oper, bool redo) xmlparser->restartParser(); xmlparser->loadXMLBuffer(xml_def); - if(obj_type==OBJ_TRIGGER) + if(obj_type==ObjTrigger) aux_obj=model->createTrigger(); - else if(obj_type==OBJ_INDEX) + else if(obj_type==ObjIndex) aux_obj=model->createIndex(); - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) aux_obj=model->createConstraint(parent_obj); - else if(obj_type==OBJ_SEQUENCE) + else if(obj_type==ObjSequence) aux_obj=model->createSequence(); - else if(obj_type==OBJ_VIEW) + else if(obj_type==ObjView) aux_obj=model->createView(); - else if(obj_type==OBJ_COLUMN) + else if(obj_type==ObjColumn) aux_obj=model->createColumn(); } @@ -741,7 +741,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) if(op_type==Operation::OBJECT_MODIFIED || op_type==Operation::OBJECT_MOVED) { - if(obj_type==OBJ_RELATIONSHIP) + if(obj_type==ObjRelationship) { /* Due to the complexity of the class Relationship and the strong link between all relationships of the model it is necessary to store XML for special objects and @@ -764,7 +764,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) //For pk constraint, before restore the previous configuration, uncheck the not-null flag of the source columns - if(obj_type==OBJ_CONSTRAINT) + if(obj_type==ObjConstraint) dynamic_cast(orig_obj)->setColumnsNotNull(false); /* The original object (obtained from the table, relationship or model) will have its @@ -780,7 +780,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) PgModelerNS::copyObject(reinterpret_cast(&object), aux_obj, obj_type); //For pk constraint, after restore the previous configuration, check the not-null flag of the new source columns - if(obj_type==OBJ_CONSTRAINT) + if(obj_type==ObjConstraint) dynamic_cast(orig_obj)->setColumnsNotNull(true); } @@ -798,13 +798,13 @@ void OperationList::executeOperation(Operation *oper, bool redo) { parent_tab->addObject(dynamic_cast(object), obj_idx); - if(object->getObjectType()==OBJ_CONSTRAINT && + if(object->getObjectType()==ObjConstraint && dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); } else if(parent_rel) parent_rel->addObject(dynamic_cast(object), obj_idx); - else if(object->getObjectType()==OBJ_TABLE) + else if(object->getObjectType()==ObjTable) dynamic_cast
(object)->getCodeDefinition(SchemaParser::SQL_DEFINITION); model->addObject(object, obj_idx); @@ -838,12 +838,12 @@ void OperationList::executeOperation(Operation *oper, bool redo) if(parent_tab->getSchema()) dynamic_cast(parent_tab->getSchema())->setModified(true); - if(object->getObjectType()==OBJ_COLUMN || - object->getObjectType()==OBJ_CONSTRAINT) + if(object->getObjectType()==ObjColumn || + object->getObjectType()==ObjConstraint) { model->validateRelationships(dynamic_cast(object), dynamic_cast
(parent_tab)); - if(object->getObjectType()==OBJ_CONSTRAINT && + if(object->getObjectType()==ObjConstraint && dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); } @@ -858,9 +858,9 @@ void OperationList::executeOperation(Operation *oper, bool redo) /* If the object in question is graphical it has the modified flag marked to force the redraw at the time of its restoration */ - else if(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW || - obj_type==BASE_RELATIONSHIP || obj_type==OBJ_RELATIONSHIP || - obj_type==OBJ_TEXTBOX || obj_type==OBJ_SCHEMA) + else if(obj_type==ObjTable || obj_type==ObjView || + obj_type==ObjBaseRelationship || obj_type==ObjRelationship || + obj_type==ObjTextbox || obj_type==ObjSchema) { BaseGraphicObject *graph_obj=dynamic_cast(object); @@ -869,15 +869,15 @@ void OperationList::executeOperation(Operation *oper, bool redo) graph_obj->setModified(true); //Case the object is a view is necessary to update the table-view relationships on the model - if(obj_type==OBJ_VIEW && op_type==Operation::OBJECT_MODIFIED) + if(obj_type==ObjView && op_type==Operation::OBJECT_MODIFIED) model->updateViewRelationships(dynamic_cast(graph_obj)); - else if((obj_type==OBJ_RELATIONSHIP || - (obj_type==OBJ_TABLE && model->getRelationship(dynamic_cast(object), nullptr))) && + else if((obj_type==ObjRelationship || + (obj_type==ObjTable && model->getRelationship(dynamic_cast(object), nullptr))) && op_type==Operation::OBJECT_MODIFIED) model->validateRelationships(); //If a object had its schema restored is necessary to update the envolved schemas - if((obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) && + if((obj_type==ObjTable || obj_type==ObjView) && ((bkp_obj && graph_obj->getSchema()!=bkp_obj->getSchema() && op_type==Operation::OBJECT_MODIFIED) || op_type==Operation::OBJECT_MOVED)) { @@ -889,12 +889,12 @@ void OperationList::executeOperation(Operation *oper, bool redo) } else if(op_type==Operation::OBJECT_MODIFIED) { - if(obj_type==OBJ_SCHEMA) + if(obj_type==ObjSchema) { model->validateSchemaRenaming(dynamic_cast(object), bkp_obj->getName()); dynamic_cast(object)->setModified(true); } - else if(obj_type==OBJ_TAG) + else if(obj_type==ObjTag) { vector refs; model->getObjectReferences(object, refs); @@ -909,16 +909,16 @@ void OperationList::executeOperation(Operation *oper, bool redo) //Case the object is a type update the tables that are referencing it if(op_type==Operation::OBJECT_MODIFIED && - (object->getObjectType()==OBJ_TYPE || object->getObjectType()==OBJ_DOMAIN || - object->getObjectType()==OBJ_TABLE || object->getObjectType()==OBJ_VIEW || - object->getObjectType()==OBJ_EXTENSION)) + (object->getObjectType()==ObjType || object->getObjectType()==ObjDomain || + object->getObjectType()==ObjTable || object->getObjectType()==ObjView || + object->getObjectType()==ObjExtension)) { vector ref_objs; model->getObjectReferences(object, ref_objs); for(auto &obj : ref_objs) { - if(obj->getObjectType()==OBJ_COLUMN) + if(obj->getObjectType()==ObjColumn) dynamic_cast(obj)->getParentTable()->setModified(true); } } diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index b0d86d5a31..281b28b76b 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -22,7 +22,7 @@ Operator::Operator(void) { unsigned i; - obj_type=OBJ_OPERATOR; + obj_type=ObjOperator; for(i=FUNC_OPERATOR; i <= FUNC_RESTRICT; i++) functions[i]=nullptr; @@ -100,14 +100,14 @@ void Operator::setFunction(Function *func, unsigned func_type) if(!func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(OBJ_OPERATOR)), + .arg(BaseObject::getTypeName(ObjOperator)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the parameter count is invalid. To be used by the operator the function must own 1 or 2 parameters */ else if(func->getParameterCount()==0 || func->getParameterCount() > 2) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_OPERATOR)), + .arg(BaseObject::getTypeName(ObjOperator)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -142,7 +142,7 @@ void Operator::setFunction(Function *func, unsigned func_type) (argument_types[1]!=QString("\"any\"") && argument_types[1]!=param_type1)))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_OPERATOR)), + .arg(BaseObject::getTypeName(ObjOperator)), AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index e58c51f7c8..7f70031543 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -20,7 +20,7 @@ OperatorClass::OperatorClass(void) { - obj_type=OBJ_OPCLASS; + obj_type=ObjOpClass; family=nullptr; is_default=false; attributes[ParsersAttributes::FAMILY]=QString(); diff --git a/libpgmodeler/src/operatorfamily.cpp b/libpgmodeler/src/operatorfamily.cpp index 3a3cbde953..35b2595c79 100644 --- a/libpgmodeler/src/operatorfamily.cpp +++ b/libpgmodeler/src/operatorfamily.cpp @@ -20,7 +20,7 @@ OperatorFamily::OperatorFamily(void) { - obj_type=OBJ_OPFAMILY; + obj_type=ObjOpFamily; attributes[ParsersAttributes::INDEX_TYPE]=QString(); } diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 7f8b080fb0..54cd1abad6 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -20,7 +20,7 @@ Parameter::Parameter(void) { - obj_type=OBJ_PARAMETER; + obj_type=ObjParameter; is_in=is_out=is_variadic=false; } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index d2d94530cf..55eea1d73b 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -38,7 +38,7 @@ Permission::Permission(BaseObject *obj) throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->object=obj; - this->obj_type=OBJ_PERMISSION; + this->obj_type=ObjPermission; revoke=cascade=false; attributes[ParsersAttributes::OBJECT]=QString(); @@ -56,10 +56,10 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) bool result=false; unsigned priv_id=static_cast(privilege); - result=(obj_type==OBJ_TABLE || obj_type==OBJ_COLUMN || obj_type==OBJ_VIEW || - obj_type==OBJ_SEQUENCE || obj_type==OBJ_DATABASE || obj_type==OBJ_FUNCTION || - obj_type==OBJ_AGGREGATE || obj_type==OBJ_LANGUAGE || obj_type==OBJ_SCHEMA || - obj_type==OBJ_TABLESPACE || obj_type==OBJ_DOMAIN || obj_type==OBJ_TYPE); + result=(obj_type==ObjTable || obj_type==ObjColumn || obj_type==ObjView || + obj_type==ObjSequence || obj_type==ObjDatabase || obj_type==ObjFunction || + obj_type==ObjAggregate || obj_type==ObjLanguage || obj_type==ObjSchema || + obj_type==ObjTablespace || obj_type==ObjDomain || obj_type==ObjType); //Validating privilege @@ -84,30 +84,30 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) View: SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER */ result=result && - (((obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) && + (((obj_type==ObjTable || obj_type==ObjView) && (priv_id==PRIV_SELECT || priv_id==PRIV_INSERT || priv_id==PRIV_UPDATE || priv_id==PRIV_DELETE || priv_id==PRIV_REFERENCES || priv_id==PRIV_TRIGGER)) || - ((obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) && priv_id==PRIV_TRUNCATE) || + ((obj_type==ObjTable || obj_type==ObjView) && priv_id==PRIV_TRUNCATE) || - (obj_type==OBJ_COLUMN && + (obj_type==ObjColumn && (priv_id==PRIV_SELECT ||priv_id==PRIV_INSERT || priv_id==PRIV_UPDATE || priv_id==PRIV_REFERENCES)) || - (obj_type==OBJ_SEQUENCE && + (obj_type==ObjSequence && (priv_id==PRIV_USAGE || priv_id==PRIV_SELECT || priv_id==PRIV_UPDATE)) || - (obj_type==OBJ_DATABASE && + (obj_type==ObjDatabase && (priv_id==PRIV_CREATE || priv_id==PRIV_CONNECT || priv_id==PRIV_TEMPORARY)) || - ((obj_type==OBJ_FUNCTION || obj_type==OBJ_AGGREGATE) && priv_id==PRIV_EXECUTE) || + ((obj_type==ObjFunction || obj_type==ObjAggregate) && priv_id==PRIV_EXECUTE) || - ((obj_type==OBJ_LANGUAGE || obj_type==OBJ_TYPE || obj_type==OBJ_DOMAIN) && priv_id==PRIV_USAGE) || + ((obj_type==ObjLanguage || obj_type==ObjType || obj_type==ObjDomain) && priv_id==PRIV_USAGE) || - (obj_type==OBJ_SCHEMA && (priv_id==PRIV_USAGE || priv_id==PRIV_CREATE)) || + (obj_type==ObjSchema && (priv_id==PRIV_USAGE || priv_id==PRIV_CREATE)) || - (obj_type==OBJ_TABLESPACE && priv_id==PRIV_CREATE)); + (obj_type==ObjTablespace && priv_id==PRIV_CREATE)); } return(result); @@ -427,12 +427,12 @@ QString Permission::getCodeDefinition(unsigned def_type) { //Views and Tables uses the same key word when setting permission (TABLE) attributes[ParsersAttributes::TYPE]= - (object->getObjectType()==OBJ_VIEW ? BaseObject::getSQLName(OBJ_TABLE): BaseObject::getSQLName(object->getObjectType())); + (object->getObjectType()==ObjView ? BaseObject::getSQLName(ObjTable): BaseObject::getSQLName(object->getObjectType())); } else attributes[ParsersAttributes::TYPE]=BaseObject::getSchemaName(object->getObjectType()); - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { attributes[ParsersAttributes::OBJECT]=object->getName(true); attributes[ParsersAttributes::PARENT]=dynamic_cast(object)->getParentTable()->getName(true); @@ -459,9 +459,9 @@ QString Permission::getCodeDefinition(unsigned def_type) for(i=0; i < 12; i++) { if(privileges[i] && !grant_option[i]) - priv_list.push_back(object->getObjectType() == OBJ_COLUMN ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); + priv_list.push_back(object->getObjectType() == ObjColumn ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); else if(grant_option[i]) - gop_priv_list.push_back(object->getObjectType() == OBJ_COLUMN ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); + gop_priv_list.push_back(object->getObjectType() == ObjColumn ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); } attributes[ParsersAttributes::PRIVILEGES] = priv_list.join(QChar(',')); diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index b2949fd138..ed66883554 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -50,7 +50,7 @@ namespace PgModelerNS { { switch(obj_type) { - case OBJ_RELATIONSHIP: + case ObjRelationship: Relationship *rel1; rel1=new Relationship(dynamic_cast(copy_obj)); if(!(*psrc_obj)) @@ -58,7 +58,7 @@ namespace PgModelerNS { else (*(dynamic_cast(*psrc_obj)))=(*rel1); break; - case BASE_RELATIONSHIP: + case ObjBaseRelationship: BaseRelationship *rel; rel=new BaseRelationship(dynamic_cast(copy_obj)); if(!(*psrc_obj)) @@ -66,88 +66,88 @@ namespace PgModelerNS { else (*(dynamic_cast(*psrc_obj)))=(*rel); break; - case OBJ_COLUMN: + case ObjColumn: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_CONSTRAINT: + case ObjConstraint: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_TRIGGER: + case ObjTrigger: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_RULE: + case ObjRule: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_INDEX: + case ObjIndex: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_POLICY: + case ObjPolicy: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_TABLE: + case ObjTable: copyObject(psrc_obj, dynamic_cast
(copy_obj)); break; - case OBJ_TEXTBOX: + case ObjTextbox: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_OPCLASS: + case ObjOpClass: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_CONVERSION: + case ObjConversion: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_CAST: + case ObjCast: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_DOMAIN: + case ObjDomain: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_TABLESPACE: + case ObjTablespace: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_SCHEMA: + case ObjSchema: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_OPFAMILY: + case ObjOpFamily: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_FUNCTION: + case ObjFunction: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_AGGREGATE: + case ObjAggregate: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_LANGUAGE: + case ObjLanguage: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_OPERATOR: + case ObjOperator: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_ROLE: + case ObjRole: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_SEQUENCE: + case ObjSequence: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_TYPE: + case ObjType: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_VIEW: + case ObjView: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_COLLATION: + case ObjCollation: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_EXTENSION: + case ObjExtension: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_TAG: + case ObjTag: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_EVENT_TRIGGER: + case ObjEventTrigger: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case OBJ_GENERIC_SQL: + case ObjGenericSQL: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; default: diff --git a/libpgmodeler/src/pgmodelerns.h b/libpgmodeler/src/pgmodelerns.h index 8f1226ae63..d8a9c4bf6f 100644 --- a/libpgmodeler/src/pgmodelerns.h +++ b/libpgmodeler/src/pgmodelerns.h @@ -65,16 +65,16 @@ namespace PgModelerNS { if(!obj) return(""); //Cast objects will not have the name changed since their name are automatically generated - else if(obj->getObjectType()==OBJ_CAST || obj->getObjectType()==OBJ_DATABASE) + else if(obj->getObjectType()==ObjCast || obj->getObjectType()==ObjDatabase) return(obj->getName()); obj_name=obj->getName(fmt_name); obj_type=obj->getObjectType(); - if(!use_suf_on_conflict && obj_type!=OBJ_OPERATOR) + if(!use_suf_on_conflict && obj_type!=ObjOperator) obj_name += suffix; - counter = (use_suf_on_conflict && obj_type!= OBJ_OPERATOR? 0 : 1); + counter = (use_suf_on_conflict && obj_type!= ObjOperator? 0 : 1); id=QString::number(obj->getObjectId()); len=obj_name.size() + id.size(); @@ -85,7 +85,7 @@ namespace PgModelerNS { obj_name.chop(id.size() + 3); //Append the id of the object on its name (this is not applied to operators) - if(obj_type!=OBJ_OPERATOR) + if(obj_type!=ObjOperator) obj_name+=QString("_") + id; } @@ -101,7 +101,7 @@ namespace PgModelerNS { if(/*aux_obj!=obj &&*/ aux_obj->getName(fmt_name)==aux_name) { //For operators is appended a '?' on the name - if(obj_type==OBJ_OPERATOR) + if(obj_type==ObjOperator) aux_name=QString("%1%2").arg(obj_name).arg(QString("").leftJustified(counter++, oper_uniq_chr)); else { diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index ef43721ba4..f182050356 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -19,7 +19,7 @@ Policy::Policy(void) : TableObject() { - obj_type=OBJ_POLICY; + obj_type=ObjPolicy; permissive = false; policy_cmd = PolicyCmdType::all; @@ -32,12 +32,12 @@ Policy::Policy(void) : TableObject() void Policy::setParentTable(BaseTable *table) { - if(table && table->getObjectType() != OBJ_TABLE) + if(table && table->getObjectType() != ObjTable) { throw Exception(Exception::getErrorMessage(AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) - .arg(BaseObject::getTypeName(OBJ_TABLE)), + .arg(BaseObject::getTypeName(ObjTable)), AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 251c5f213f..835cce1dca 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -50,7 +50,7 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, { try { - obj_type=OBJ_RELATIONSHIP; + obj_type=ObjRelationship; QString str_aux; /* Raises an error if the user tries to create a relationship which some @@ -437,9 +437,9 @@ int Relationship::getObjectIndex(TableObject *object) //Selecting the correct list using the object type obj_type=object->getObjectType(); - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) list=&rel_attributes; - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) @@ -496,7 +496,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) rel_type==RELATIONSHIP_PART) && !(tab_obj->isAddedByRelationship() && tab_obj->isProtected() && - tab_obj->getObjectType()==OBJ_CONSTRAINT)) + tab_obj->getObjectType()==ObjConstraint)) throw Exception(AsgObjectInvalidRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try @@ -507,9 +507,9 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) { //Gets the object list according the object type obj_type=tab_obj->getObjectType(); - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) obj_list=&rel_attributes; - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) obj_list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) @@ -519,7 +519,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) tab_obj->setParentTable(src_table); //Generates the code for the object only for validation - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::SQL_DEFINITION); else { @@ -590,9 +590,9 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) TableObject *tab_obj=nullptr; Table *recv_table=nullptr; - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) obj_list=&rel_attributes; - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) obj_list=&rel_constraints; else throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -604,7 +604,7 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) tab_obj=obj_list->at(obj_id); recv_table=this->getReceiverTable(); - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { Column *col=nullptr; Constraint *constr=nullptr; @@ -670,12 +670,12 @@ void Relationship::removeObject(TableObject *object) void Relationship::removeAttribute(unsigned attrib_idx) { - removeObject(attrib_idx, OBJ_COLUMN); + removeObject(attrib_idx, ObjColumn); } void Relationship::removeConstraint(unsigned constr_idx) { - removeObject(constr_idx, OBJ_CONSTRAINT); + removeObject(constr_idx, ObjConstraint); } vector Relationship::getGeneratedColumns(void) @@ -708,9 +708,9 @@ TableObject *Relationship::getObject(unsigned obj_idx, ObjectType obj_type) { vector *list=nullptr; - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) list=&rel_attributes; - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) list=&rel_constraints; else throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -728,9 +728,9 @@ TableObject *Relationship::getObject(const QString &name, ObjectType obj_type) TableObject *obj_aux=nullptr; bool found=false; - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) list=&rel_attributes; - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) list=&rel_constraints; else throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -762,7 +762,7 @@ Column *Relationship::getAttribute(unsigned attrib_idx) Column *Relationship::getAttribute(const QString &name) { - return(dynamic_cast(getObject(name,OBJ_COLUMN))); + return(dynamic_cast(getObject(name,ObjColumn))); } vector Relationship::getAttributes(void) @@ -781,7 +781,7 @@ Constraint *Relationship::getConstraint(unsigned constr_idx) Constraint *Relationship::getConstraint(const QString &name) { - return(dynamic_cast(getObject(name,OBJ_CONSTRAINT))); + return(dynamic_cast(getObject(name,ObjConstraint))); } vector Relationship::getConstraints(void) @@ -801,9 +801,9 @@ unsigned Relationship::getConstraintCount(void) unsigned Relationship::getObjectCount(ObjectType obj_type) { - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) return(rel_attributes.size()); - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) return(rel_constraints.size()); else throw Exception(RefObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -829,7 +829,7 @@ void Relationship::addConstraints(Table *recv_tab) if(constr->getConstraintType()!=ConstraintType::primary_key) { - constr->setName(PgModelerNS::generateUniqueName(constr, (*recv_tab->getObjectList(OBJ_CONSTRAINT)))); + constr->setName(PgModelerNS::generateUniqueName(constr, (*recv_tab->getObjectList(ObjConstraint)))); recv_tab->addConstraint(constr); } else @@ -885,7 +885,7 @@ void Relationship::addColumnsRelGenPart(void) i, i1, i2, id_tab, idx, tab_count; vector columns; - ObjectType types[2]={OBJ_TABLE, BASE_TABLE}; + ObjectType types[2]={ObjTable, ObjBaseTable}; ErrorType err_type=Custom; bool duplic=false, cond=false, /* 0 -> Column created by inheritance relationship @@ -979,12 +979,12 @@ void Relationship::addColumnsRelGenPart(void) for(i2=0; i2 < 2; i2++) { //Checking if the column came from a generalization relationship - if(types[i2]==OBJ_TABLE) + if(types[i2]==ObjTable) { - tab_count=aux_tab->getObjectCount(OBJ_TABLE); + tab_count=aux_tab->getObjectCount(ObjTable); for(idx=0; idx < tab_count; idx++) { - parent_tab=dynamic_cast
(aux_tab->getObject(idx, OBJ_TABLE)); + parent_tab=dynamic_cast
(aux_tab->getObject(idx, ObjTable)); cond=(aux_col->getParentTable()==parent_tab && aux_col->isAddedByGeneralization()); } @@ -1141,7 +1141,7 @@ void Relationship::addConstraintsRelGenPart(void) { Table *parent_tab=dynamic_cast
(getReferenceTable()), *child_tab=dynamic_cast
(getReceiverTable()); - vector *constrs=parent_tab->getObjectList(OBJ_CONSTRAINT); + vector *constrs=parent_tab->getObjectList(ObjConstraint); Constraint *ck_constr=nullptr, *constr=nullptr, *aux_constr=nullptr; try @@ -1152,7 +1152,7 @@ void Relationship::addConstraintsRelGenPart(void) if(constr->getConstraintType()==ConstraintType::check && !constr->isNoInherit()) { - aux_constr=dynamic_cast(child_tab->getObject(constr->getName(), OBJ_CONSTRAINT)); + aux_constr=dynamic_cast(child_tab->getObject(constr->getName(), ObjConstraint)); if(!aux_constr) { @@ -1354,7 +1354,7 @@ void Relationship::addUniqueKey(Table *recv_tab) uq->setName(generateObjectName(UQ_PATTERN)); uq->setAlias(generateObjectName(UQ_PATTERN, nullptr, true)); - uq->setName(PgModelerNS::generateUniqueName(uq, (*recv_tab->getObjectList(OBJ_CONSTRAINT)))); + uq->setName(PgModelerNS::generateUniqueName(uq, (*recv_tab->getObjectList(ObjConstraint)))); recv_tab->addConstraint(uq); } catch(Exception &e) @@ -1482,7 +1482,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del fk->setName(name); fk->setAlias(fk_alias); - fk->setName(PgModelerNS::generateUniqueName(fk, (*recv_tab->getObjectList(OBJ_CONSTRAINT)))); + fk->setName(PgModelerNS::generateUniqueName(fk, (*recv_tab->getObjectList(ObjConstraint)))); recv_tab->addConstraint(fk); } catch(Exception &e) @@ -1516,7 +1516,7 @@ void Relationship::addAttributes(Table *recv_tab) if(column->getParentTable()) break; - column->setName(PgModelerNS::generateUniqueName(column, (*recv_tab->getObjectList(OBJ_COLUMN)))); + column->setName(PgModelerNS::generateUniqueName(column, (*recv_tab->getObjectList(ObjColumn)))); column->setAddedByLinking(true); column->setParentRelationship(this); recv_tab->addColumn(column); @@ -1615,7 +1615,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b column->setType(PgSQLType(QString("smallint"))); column->setName(name); - name=PgModelerNS::generateUniqueName(column, (*recv_tab->getObjectList(OBJ_COLUMN))); + name=PgModelerNS::generateUniqueName(column, (*recv_tab->getObjectList(ObjColumn))); column->setName(name); if(!prev_name.isEmpty()) diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 7992974d0d..d93d44d5fe 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -22,7 +22,7 @@ unsigned Role::role_id=0; Role::Role(void) { - obj_type=OBJ_ROLE; + obj_type=ObjRole; object_id=Role::role_id++; for(unsigned i=0; i <= OP_BYPASSRLS; i++) diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index 372d77837d..2927541d1e 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -21,7 +21,7 @@ Rule::Rule(void) { execution_type=BaseType::null; - obj_type=OBJ_RULE; + obj_type=ObjRule; attributes[ParsersAttributes::EVENT_TYPE]=QString(); attributes[ParsersAttributes::TABLE]=QString(); attributes[ParsersAttributes::CONDITION]=QString(); diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index daf2f9ea6d..b14f82ae6b 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -20,7 +20,7 @@ Schema::Schema(void) { - obj_type=OBJ_SCHEMA; + obj_type=ObjSchema; fill_color=QColor(225,225,225, 80); rect_visible=false; attributes[ParsersAttributes::FILL_COLOR]=QString(); @@ -34,7 +34,7 @@ void Schema::setName(const QString &name) if(name.mid(0,3)==QString("pg_")) throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_SCHEMA)), + .arg(BaseObject::getTypeName(ObjSchema)), AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 582048f2dc..df1652dd50 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -27,7 +27,7 @@ const QString Sequence::MAX_BIG_NEGATIVE_VALUE=QString("-9223372036854775808"); Sequence::Sequence(void) { - obj_type=OBJ_SEQUENCE; + obj_type=ObjSequence; cycle=false; setDefaultValues(PgSQLType(QString("serial"))); owner_col=nullptr; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index cac290c9db..547f656af4 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -24,7 +24,7 @@ const QString Table::DATA_LINE_BREAK = QString("%1%2").arg("⸣").arg('\n'); Table::Table(void) : BaseTable() { - obj_type=OBJ_TABLE; + obj_type=ObjTable; with_oid=gen_alter_cmds=unlogged=rls_enabled=rls_forced=false; attributes[ParsersAttributes::COLUMNS]=QString(); attributes[ParsersAttributes::INH_COLUMNS]=QString(); @@ -122,8 +122,8 @@ Table *Table::getPartitionedTable(void) void Table::setProtected(bool value) { - ObjectType obj_types[]={ OBJ_COLUMN, OBJ_CONSTRAINT, - OBJ_INDEX, OBJ_RULE, OBJ_TRIGGER }; + ObjectType obj_types[]={ ObjColumn, ObjConstraint, + ObjIndex, ObjRule, ObjTrigger }; unsigned i; vector::iterator itr, itr_end; vector *list=nullptr; @@ -161,8 +161,8 @@ void Table::setCommentAttribute(TableObject *tab_obj) attribs[ParsersAttributes::SIGNATURE]=tab_obj->getSignature(); attribs[ParsersAttributes::SQL_OBJECT]=tab_obj->getSQLName(); - attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==OBJ_COLUMN ? ParsersAttributes::_TRUE_ : QString()); - attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==OBJ_CONSTRAINT ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==ObjColumn ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==ObjConstraint ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::TABLE]=this->getName(true); attribs[ParsersAttributes::NAME]=tab_obj->getName(true); attribs[ParsersAttributes::COMMENT]=QString(tab_obj->getComment()).replace(QString("'"), QString("''"));; @@ -190,18 +190,18 @@ void Table::setAncestorTableAttribute(void) void Table::setRelObjectsIndexesAttribute(void) { attribs_map aux_attribs; - vector *> obj_indexes={ &col_indexes, &constr_indexes }; + vector *> ObjIndexes={ &col_indexes, &constr_indexes }; QString attribs[]={ ParsersAttributes::COL_INDEXES, ParsersAttributes::CONSTR_INDEXES }; - ObjectType obj_types[]={ OBJ_COLUMN, OBJ_CONSTRAINT }; - unsigned idx=0, size=obj_indexes.size(); + ObjectType obj_types[]={ ObjColumn, ObjConstraint }; + unsigned idx=0, size=ObjIndexes.size(); for(idx=0; idx < size; idx++) { attributes[attribs[idx]]=QString(); - if(!obj_indexes[idx]->empty()) + if(!ObjIndexes[idx]->empty()) { - for(auto &obj_idx : (*obj_indexes[idx])) + for(auto &obj_idx : (*ObjIndexes[idx])) { aux_attribs[ParsersAttributes::NAME]=obj_idx.first; aux_attribs[ParsersAttributes::INDEX]=QString::number(obj_idx.second); @@ -331,17 +331,17 @@ void Table::setConstraintsAttribute(unsigned def_type) vector *Table::getObjectList(ObjectType obj_type) { - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) return(&columns); - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) return(&constraints); - else if(obj_type==OBJ_RULE) + else if(obj_type==ObjRule) return(&rules); - else if(obj_type==OBJ_TRIGGER) + else if(obj_type==ObjTrigger) return(&triggers); - else if(obj_type==OBJ_INDEX) + else if(obj_type==ObjIndex) return(&indexes); - else if(obj_type==OBJ_POLICY) + else if(obj_type==ObjPolicy) return(&policies); else throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -360,10 +360,10 @@ void Table::addObject(BaseObject *obj, int obj_idx) #ifdef DEMO_VERSION #warning "DEMO VERSION: table children objects creation limit." - vector *obj_list=(obj_type!=OBJ_TABLE ? getObjectList(obj_type) : nullptr); + vector *obj_list=(obj_type!=ObjTable ? getObjectList(obj_type) : nullptr); if((obj_list && obj_list->size() >= GlobalAttributes::MaxObjectCount) || - (obj_type==OBJ_TABLE && ancestor_tables.size() >= GlobalAttributes::MaxObjectCount)) + (obj_type==ObjTable && ancestor_tables.size() >= GlobalAttributes::MaxObjectCount)) throw Exception(trUtf8("In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2'") .arg(GlobalAttributes::MaxObjectCount) .arg(BaseObject::getTypeName(obj_type)), @@ -385,17 +385,17 @@ void Table::addObject(BaseObject *obj, int obj_idx) } //Raises an error if the user try to set the table as ancestor/copy of itself - else if((obj_type==OBJ_TABLE || obj_type==BASE_TABLE) && obj==this) + else if((obj_type==ObjTable || obj_type==ObjBaseTable) && obj==this) throw Exception(InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); switch(obj_type) { - case OBJ_COLUMN: - case OBJ_CONSTRAINT: - case OBJ_TRIGGER: - case OBJ_INDEX: - case OBJ_RULE: - case OBJ_POLICY: + case ObjColumn: + case ObjConstraint: + case ObjTrigger: + case ObjIndex: + case ObjRule: + case ObjPolicy: TableObject *tab_obj; vector *obj_list; Column *col; @@ -420,14 +420,14 @@ void Table::addObject(BaseObject *obj, int obj_idx) .arg(this->getName()), InvColumnTableType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) { //Raises a error if the user try to add a second primary key on the table if(dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::primary_key && this->getPrimaryKey()) throw Exception(AsgExistingPrimaryKeyTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(obj_type==OBJ_TRIGGER) + else if(obj_type==ObjTrigger) dynamic_cast(tab_obj)->validateTrigger(); obj_list=getObjectList(obj_type); @@ -444,16 +444,16 @@ void Table::addObject(BaseObject *obj, int obj_idx) obj_list->push_back(tab_obj); } - if(obj_type==OBJ_COLUMN || obj_type==OBJ_CONSTRAINT) + if(obj_type==ObjColumn || obj_type==ObjConstraint) { updateAlterCmdsStatus(); - if(obj_type==OBJ_CONSTRAINT) + if(obj_type==ObjConstraint) dynamic_cast(tab_obj)->setColumnsNotNull(true); } break; - case OBJ_TABLE: + case ObjTable: Table *tab; tab=dynamic_cast
(obj); if(obj_idx < 0 || obj_idx >= static_cast(ancestor_tables.size())) @@ -719,7 +719,7 @@ void Table::removeObject(BaseObject *obj) if(tab_obj) removeObject(getObjectIndex(tab_obj), obj->getObjectType()); else - removeObject(obj->getName(true), OBJ_TABLE); + removeObject(obj->getName(true), ObjTable); } } catch(Exception &e) @@ -743,10 +743,10 @@ void Table::removeObject(const QString &name, ObjectType obj_type) void Table::removeObject(unsigned obj_idx, ObjectType obj_type) { //Raises an error if the user try to remove a object with invalid type - if(!TableObject::isTableObject(obj_type) && obj_type!=OBJ_TABLE) + if(!TableObject::isTableObject(obj_type) && obj_type!=ObjTable) throw Exception(RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(obj_type==OBJ_TABLE && obj_idx < ancestor_tables.size()) + else if(obj_type==ObjTable && obj_idx < ancestor_tables.size()) { vector
::iterator itr; Table *tab=nullptr; @@ -766,7 +766,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) } } } - else if(obj_type!=OBJ_TABLE && obj_type!=BASE_TABLE) + else if(obj_type!=ObjTable && obj_type!=ObjBaseTable) { vector *obj_list=nullptr; vector::iterator itr; @@ -777,7 +777,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) if(obj_idx >= obj_list->size()) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type!=OBJ_COLUMN) + if(obj_type!=ObjColumn) { itr=obj_list->begin() + obj_idx; TableObject *tab_obj=(*itr); @@ -833,7 +833,7 @@ void Table::removeColumn(const QString &name) { try { - removeObject(name,OBJ_COLUMN); + removeObject(name,ObjColumn); } catch(Exception &e) { @@ -845,7 +845,7 @@ void Table::removeColumn(unsigned idx) { try { - removeObject(idx,OBJ_COLUMN); + removeObject(idx,ObjColumn); } catch(Exception &e) { @@ -857,7 +857,7 @@ void Table::removeTrigger(const QString &name) { try { - removeObject(name,OBJ_TRIGGER); + removeObject(name,ObjTrigger); } catch(Exception &e) { @@ -869,7 +869,7 @@ void Table::removeTrigger(unsigned idx) { try { - removeObject(idx,OBJ_TRIGGER); + removeObject(idx,ObjTrigger); } catch(Exception &e) { @@ -881,7 +881,7 @@ void Table::removeIndex(const QString &name) { try { - removeObject(name,OBJ_INDEX); + removeObject(name,ObjIndex); } catch(Exception &e) { @@ -893,7 +893,7 @@ void Table::removeIndex(unsigned idx) { try { - removeObject(idx,OBJ_INDEX); + removeObject(idx,ObjIndex); } catch(Exception &e) { @@ -905,7 +905,7 @@ void Table::removeRule(const QString &name) { try { - removeObject(name,OBJ_RULE); + removeObject(name,ObjRule); } catch(Exception &e) { @@ -917,7 +917,7 @@ void Table::removeRule(unsigned idx) { try { - removeObject(idx,OBJ_RULE); + removeObject(idx,ObjRule); } catch(Exception &e) { @@ -929,7 +929,7 @@ void Table::removePolicy(const QString &name) { try { - removeObject(name, OBJ_POLICY); + removeObject(name, ObjPolicy); } catch(Exception &e) { @@ -941,7 +941,7 @@ void Table::removePolicy(unsigned idx) { try { - removeObject(idx, OBJ_POLICY); + removeObject(idx, ObjPolicy); } catch(Exception &e) { @@ -953,7 +953,7 @@ void Table::removeConstraint(const QString &name) { try { - removeObject(name,OBJ_CONSTRAINT); + removeObject(name,ObjConstraint); } catch(Exception &e) { @@ -965,7 +965,7 @@ void Table::removeConstraint(unsigned idx) { try { - removeObject(idx,OBJ_CONSTRAINT); + removeObject(idx,ObjConstraint); } catch(Exception &e) { @@ -977,7 +977,7 @@ void Table::removeAncestorTable(const QString &name) { try { - removeObject(name,OBJ_TABLE); + removeObject(name,ObjTable); } catch(Exception &e) { @@ -989,7 +989,7 @@ void Table::removeAncestorTable(unsigned idx) { try { - removeObject(idx,OBJ_TABLE); + removeObject(idx,ObjTable); } catch(Exception &e) { @@ -1071,7 +1071,7 @@ BaseObject *Table::getObject(const QString &name, ObjectType obj_type, int &obj_ } else obj_idx=-1; } - else if(obj_type==OBJ_TABLE) + else if(obj_type==ObjTable) { vector
::iterator itr_tab, itr_end_tab; QString tab_name, aux_name=name; @@ -1108,7 +1108,7 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) { vector *obj_list=nullptr; - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) { //Raises an error if the object index is out of bound if(obj_idx >= ancestor_tables.size()) @@ -1130,12 +1130,12 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) Table *Table::getAncestorTable(const QString &name) { int idx; - return(dynamic_cast
(getObject(name,OBJ_TABLE,idx))); + return(dynamic_cast
(getObject(name,ObjTable,idx))); } Table *Table::getAncestorTable(unsigned idx) { - return(dynamic_cast
(getObject(idx,OBJ_TABLE))); + return(dynamic_cast
(getObject(idx,ObjTable))); } Column *Table::getColumn(const QString &name, bool ref_old_name) @@ -1143,7 +1143,7 @@ Column *Table::getColumn(const QString &name, bool ref_old_name) if(!ref_old_name) { int idx; - return(dynamic_cast(getObject(name,OBJ_COLUMN,idx))); + return(dynamic_cast(getObject(name,ObjColumn,idx))); } else { @@ -1170,62 +1170,62 @@ Column *Table::getColumn(const QString &name, bool ref_old_name) Column *Table::getColumn(unsigned idx) { - return(dynamic_cast(getObject(idx,OBJ_COLUMN))); + return(dynamic_cast(getObject(idx,ObjColumn))); } Trigger *Table::getTrigger(const QString &name) { int idx; - return(dynamic_cast(getObject(name,OBJ_TRIGGER,idx))); + return(dynamic_cast(getObject(name,ObjTrigger,idx))); } Trigger *Table::getTrigger(unsigned idx) { - return(dynamic_cast(getObject(idx,OBJ_TRIGGER))); + return(dynamic_cast(getObject(idx,ObjTrigger))); } Constraint *Table::getConstraint(const QString &name) { int idx; - return(dynamic_cast(getObject(name,OBJ_CONSTRAINT,idx))); + return(dynamic_cast(getObject(name,ObjConstraint,idx))); } Constraint *Table::getConstraint(unsigned idx) { - return(dynamic_cast(getObject(idx,OBJ_CONSTRAINT))); + return(dynamic_cast(getObject(idx,ObjConstraint))); } Index *Table::getIndex(const QString &name) { int idx; - return(dynamic_cast(getObject(name,OBJ_INDEX,idx))); + return(dynamic_cast(getObject(name,ObjIndex,idx))); } Index *Table::getIndex(unsigned idx) { - return(dynamic_cast(getObject(idx,OBJ_INDEX))); + return(dynamic_cast(getObject(idx,ObjIndex))); } Rule *Table::getRule(const QString &name) { int idx; - return(dynamic_cast(getObject(name,OBJ_RULE,idx))); + return(dynamic_cast(getObject(name,ObjRule,idx))); } Rule *Table::getRule(unsigned idx) { - return(dynamic_cast(getObject(idx,OBJ_RULE))); + return(dynamic_cast(getObject(idx,ObjRule))); } Policy *Table::getPolicy(const QString &name) { int idx; - return(dynamic_cast(getObject(name, OBJ_POLICY,idx))); + return(dynamic_cast(getObject(name, ObjPolicy,idx))); } Policy *Table::getPolicy(unsigned idx) { - return(dynamic_cast(getObject(idx, OBJ_POLICY))); + return(dynamic_cast(getObject(idx, ObjPolicy))); } unsigned Table::getColumnCount(void) @@ -1265,9 +1265,9 @@ unsigned Table::getAncestorTableCount(void) unsigned Table::getObjectCount(ObjectType obj_type, bool inc_added_by_rel) { - if(TableObject::isTableObject(obj_type) || obj_type==OBJ_TABLE) + if(TableObject::isTableObject(obj_type) || obj_type==ObjTable) { - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) { return(ancestor_tables.size()); } @@ -1377,9 +1377,9 @@ void Table::setRelObjectsIndexes(const vector &obj_names, const vector< map *obj_idxs_map=nullptr; unsigned idx=0, size=obj_names.size(); - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) obj_idxs_map=&col_indexes; - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) obj_idxs_map=&constr_indexes; else throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1394,12 +1394,12 @@ void Table::saveRelObjectsIndexes(ObjectType obj_type) map *obj_idxs_map=nullptr; vector *list=nullptr; - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { obj_idxs_map=&col_indexes; list=&columns; } - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) { obj_idxs_map=&constr_indexes; list=&constraints; @@ -1424,14 +1424,14 @@ void Table::saveRelObjectsIndexes(ObjectType obj_type) void Table::saveRelObjectsIndexes(void) { - saveRelObjectsIndexes(OBJ_COLUMN); - saveRelObjectsIndexes(OBJ_CONSTRAINT); + saveRelObjectsIndexes(ObjColumn); + saveRelObjectsIndexes(ObjConstraint); } void Table::restoreRelObjectsIndexes(void) { - restoreRelObjectsIndexes(OBJ_COLUMN); - restoreRelObjectsIndexes(OBJ_CONSTRAINT); + restoreRelObjectsIndexes(ObjColumn); + restoreRelObjectsIndexes(ObjConstraint); if(!col_indexes.empty() || !constr_indexes.empty()) { @@ -1444,7 +1444,7 @@ void Table::restoreRelObjectsIndexes(ObjectType obj_type) { map *obj_idxs=nullptr; - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) obj_idxs=&col_indexes; else obj_idxs=&constr_indexes; @@ -1672,7 +1672,7 @@ void Table::operator = (Table &tab) bool Table::isReferRelationshipAddedObject(void) { vector::iterator itr, itr_end; - ObjectType types[]={ OBJ_COLUMN, OBJ_CONSTRAINT }; + ObjectType types[]={ ObjColumn, ObjConstraint }; bool found=false; for(unsigned i=0; i < 2 && !found; i++) @@ -1743,7 +1743,7 @@ void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2 (*itr2)=aux_obj; } - if(obj_type!=OBJ_COLUMN && obj_type!=OBJ_CONSTRAINT) + if(obj_type!=ObjColumn && obj_type!=ObjConstraint) BaseObject::swapObjectsIds(aux_obj, aux_obj1, false); setCodeInvalidated(true); @@ -1831,12 +1831,12 @@ void Table::getColumnReferences(Column *column, vector &refs, boo vector Table::getObjects(bool excl_cols_constr) { vector list; - vector types={ OBJ_COLUMN, OBJ_CONSTRAINT, - OBJ_TRIGGER, OBJ_INDEX, OBJ_RULE, OBJ_POLICY }; + vector types={ ObjColumn, ObjConstraint, + ObjTrigger, ObjIndex, ObjRule, ObjPolicy }; for(auto type : types) { - if(excl_cols_constr && (type == OBJ_COLUMN || type == OBJ_CONSTRAINT)) + if(excl_cols_constr && (type == ObjColumn || type == ObjConstraint)) continue; list.insert(list.end(), getObjectList(type)->begin(), getObjectList(type)->end()) ; @@ -1857,8 +1857,8 @@ vector Table::getPartitionKeys(void) void Table::setCodeInvalidated(bool value) { - vector types={ OBJ_COLUMN, OBJ_CONSTRAINT, - OBJ_TRIGGER, OBJ_INDEX, OBJ_RULE, OBJ_POLICY }; + vector types={ ObjColumn, ObjConstraint, + ObjTrigger, ObjIndex, ObjRule, ObjPolicy }; for(auto type : types) { @@ -1954,7 +1954,7 @@ QString Table::getInitialDataCommands(void) //Separating valid columns (selected) from the invalids (ignored) for(QString col_name : col_names) { - if(getObjectIndex(col_name, OBJ_COLUMN) >= 0) + if(getObjectIndex(col_name, ObjColumn) >= 0) selected_cols.append(col_name); else ignored_cols.append(curr_col); @@ -2055,8 +2055,8 @@ void Table::setObjectListsCapacity(unsigned capacity) unsigned Table::getMaxObjectCount(void) { unsigned count = 0, max = 0; - vector types = { OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_INDEX, - OBJ_RULE, OBJ_TRIGGER, OBJ_POLICY }; + vector types = { ObjColumn, ObjConstraint, ObjIndex, + ObjRule, ObjTrigger, ObjPolicy }; for(auto type : types) { diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index dcf1abdefb..2295c45e73 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -96,7 +96,7 @@ class Table: public BaseTable { //! \brief The partitioning mode/type used by the table PartitioningType partitioning_type; - /*! \brief Gets one table ancestor (OBJ_TABLE) or copy (BASE_TABLE) using its name and stores + /*! \brief Gets one table ancestor (ObjTable) or copy (ObjBaseTable) using its name and stores the index of the found object on parameter 'obj_idx' */ BaseObject *getObject(const QString &name, ObjectType obj_type, int &obj_idx); diff --git a/libpgmodeler/src/tableobject.cpp b/libpgmodeler/src/tableobject.cpp index 0b4b6f500c..da62b1dc79 100644 --- a/libpgmodeler/src/tableobject.cpp +++ b/libpgmodeler/src/tableobject.cpp @@ -89,8 +89,8 @@ bool TableObject::isDeclaredInTable(void) bool TableObject::isTableObject(ObjectType type) { - return(type==OBJ_COLUMN || type==OBJ_CONSTRAINT || type==OBJ_TRIGGER || - type==OBJ_RULE || type==OBJ_INDEX || type==OBJ_POLICY); + return(type==ObjColumn || type==ObjConstraint || type==ObjTrigger || + type==ObjRule || type==ObjIndex || type==ObjPolicy); } void TableObject::operator = (TableObject &object) diff --git a/libpgmodeler/src/tablespace.cpp b/libpgmodeler/src/tablespace.cpp index e37c3e9bd8..00d85ea0d9 100644 --- a/libpgmodeler/src/tablespace.cpp +++ b/libpgmodeler/src/tablespace.cpp @@ -22,7 +22,7 @@ unsigned Tablespace::tabspace_id=1000; Tablespace::Tablespace(void) { - obj_type=OBJ_TABLESPACE; + obj_type=ObjTablespace; attributes[ParsersAttributes::DIRECTORY]=QString(); object_id=Tablespace::tabspace_id++; } @@ -34,7 +34,7 @@ void Tablespace::setName(const QString &name) if(name.mid(0,3)==QString("pg_")) throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_TABLESPACE)), + .arg(BaseObject::getTypeName(ObjTablespace)), AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 400af833eb..7effc70d3a 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -26,7 +26,7 @@ Tag::Tag(void) ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, ParsersAttributes::TABLE_EXT_BODY }; - obj_type=OBJ_TAG; + obj_type=ObjTag; object_id=Tag::tag_id++; attributes[ParsersAttributes::STYLES]=QString(); diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index c5c5367038..9ea28cc727 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -20,7 +20,7 @@ Textbox::Textbox(void) { - obj_type=OBJ_TEXTBOX; + obj_type=ObjTextbox; font_size=9.0f; text_attributes[0]=text_attributes[1]=text_attributes[2]=false; attributes[ParsersAttributes::ITALIC]=QString(); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 1beb29edd4..1bee5313be 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -26,7 +26,7 @@ Trigger::Trigger(void) function=nullptr; is_exec_per_row=is_constraint=is_deferrable=false; - obj_type=OBJ_TRIGGER; + obj_type=ObjTrigger; referenced_table=nullptr; for(i=0; i < 4; i++) @@ -98,7 +98,7 @@ void Trigger::setFunction(Function *func) if(!func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_TRIGGER)), + .arg(BaseObject::getTypeName(ObjTrigger)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -109,7 +109,7 @@ void Trigger::setFunction(Function *func) else if(func->getParameterCount()!=0) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_TRIGGER)), + .arg(BaseObject::getTypeName(ObjTrigger)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(function != func); @@ -249,7 +249,7 @@ void Trigger::removeColumns(void) void Trigger::setReferecendTable(BaseTable *ref_table) { //If the referenced table isn't valid raises an error - if(ref_table && ref_table->getObjectType()!=OBJ_TABLE) + if(ref_table && ref_table->getObjectType()!=ObjTable) throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(referenced_table != ref_table); @@ -445,11 +445,11 @@ void Trigger::validateTrigger(void) if(!is_constraint) { //The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers - if(firing_type==FiringType::instead_of && parent_type==OBJ_TABLE) + if(firing_type==FiringType::instead_of && parent_type==ObjTable) throw Exception(InvTableTriggerInsteadOfFiring,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The INSTEAD OF mode cannot be used on view triggers that executes for each statement - else if(firing_type==FiringType::instead_of && parent_type==OBJ_VIEW && !is_exec_per_row) + else if(firing_type==FiringType::instead_of && parent_type==ObjView && !is_exec_per_row) throw Exception(InvUsageInsteadOfOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event @@ -457,11 +457,11 @@ void Trigger::validateTrigger(void) throw Exception(InvUsageInsteadOfUpdateTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table - else if(events[EventType::on_truncate] && (is_exec_per_row || parent_type==OBJ_VIEW)) + else if(events[EventType::on_truncate] && (is_exec_per_row || parent_type==ObjView)) throw Exception(InvUsageTruncateOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A view trigger cannot be AFTER/BEFORE when it executes for each row - else if(parent_type==OBJ_VIEW && is_exec_per_row && (firing_type==FiringType::after || firing_type==FiringType::before)) + else if(parent_type==ObjView && is_exec_per_row && (firing_type==FiringType::after || firing_type==FiringType::before)) throw Exception(InvUsageAfterBeforeViewTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Only constraint triggers can be deferrable or reference another table diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 467a861728..ddbe90d3bb 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -20,7 +20,7 @@ Type::Type(void) { - obj_type=OBJ_TYPE; + obj_type=ObjType; setConfiguration(ENUMERATION_TYPE); attributes[ParsersAttributes::BASE_TYPE]=QString(); @@ -231,7 +231,7 @@ void Type::setFunction(unsigned func_id, Function *func) else if(!func && (func_id==INPUT_FUNC || func_id==OUTPUT_FUNC)) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(OBJ_TYPE)), + .arg(BaseObject::getTypeName(ObjType)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(func) @@ -254,7 +254,7 @@ void Type::setFunction(unsigned func_id, Function *func) func_id==ANALYZE_FUNC || func_id==CANONICAL_FUNC))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_TYPE)), + .arg(BaseObject::getTypeName(ObjType)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Checking the return types of function in relation to type. INPUT, RECV and CANONICAL functions must return the data type that is being defined according to the @@ -274,7 +274,7 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==SUBTYPE_DIFF_FUNC && func->getReturnType()!=QString("double precision"))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName()) - .arg(BaseObject::getTypeName(OBJ_TYPE)), + .arg(BaseObject::getTypeName(ObjType)), AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Validating the parameter types of function in relation to the type configuration. diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index d5add59c47..6bfe02f7ce 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -20,7 +20,7 @@ TypeAttribute::TypeAttribute(void) { - obj_type=OBJ_TYPE_ATTRIBUTE; + obj_type=ObjTypeAttribute; } void TypeAttribute::setType(PgSQLType type) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 4ef864cfb1..618bf4b9d7 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -20,7 +20,7 @@ View::View(void) : BaseTable() { - obj_type=OBJ_VIEW; + obj_type=ObjView; materialized=recursive=with_no_data=false; attributes[ParsersAttributes::DEFINITION]=QString(); attributes[ParsersAttributes::REFERENCES]=QString(); @@ -37,7 +37,7 @@ View::View(void) : BaseTable() View::~View(void) { - ObjectType types[]={ OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX }; + ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex }; vector *list=nullptr; for(unsigned i=0; i < 3; i++) @@ -67,7 +67,7 @@ void View::setSchema(BaseObject *schema) void View::setProtected(bool value) { - ObjectType obj_types[]={ OBJ_RULE, OBJ_TRIGGER }; + ObjectType obj_types[]={ ObjRule, ObjTrigger }; unsigned i; vector::iterator itr, itr_end; vector *list=nullptr; @@ -605,7 +605,7 @@ QString View::getCodeDefinition(unsigned def_type) void View::setSQLObjectAttribute(void) { if(materialized) - attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(OBJ_VIEW); + attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjView); } void View::setObjectListsCapacity(unsigned capacity) @@ -622,7 +622,7 @@ void View::setObjectListsCapacity(unsigned capacity) unsigned View::getMaxObjectCount(void) { unsigned count = 0, max = references.size(); - vector types = { OBJ_INDEX, OBJ_RULE, OBJ_TRIGGER }; + vector types = { ObjIndex, ObjRule, ObjTrigger }; for(auto type : types) { @@ -721,7 +721,7 @@ void View::addObject(BaseObject *obj, int obj_idx) tab_obj->getCodeDefinition(SchemaParser::SQL_DEFINITION); //Make a additional validation if the object is a trigger - if(tab_obj->getObjectType()==OBJ_TRIGGER) + if(tab_obj->getObjectType()==ObjTrigger) dynamic_cast(tab_obj)->validateTrigger(); //Inserts the object at specified position @@ -824,7 +824,7 @@ void View::removeTrigger(unsigned idx) { try { - removeObject(idx, OBJ_TRIGGER); + removeObject(idx, ObjTrigger); } catch(Exception &e) { @@ -836,7 +836,7 @@ void View::removeRule(unsigned idx) { try { - removeObject(idx, OBJ_RULE); + removeObject(idx, ObjRule); } catch(Exception &e) { @@ -848,7 +848,7 @@ void View::removeIndex(unsigned idx) { try { - removeObject(idx, OBJ_INDEX); + removeObject(idx, ObjIndex); } catch(Exception &e) { @@ -889,7 +889,7 @@ Trigger *View::getTrigger(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, OBJ_TRIGGER))); + return(dynamic_cast(getObject(obj_idx, ObjTrigger))); } catch(Exception &e) { @@ -901,7 +901,7 @@ Rule *View::getRule(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, OBJ_RULE))); + return(dynamic_cast(getObject(obj_idx, ObjRule))); } catch(Exception &e) { @@ -913,7 +913,7 @@ Index *View::getIndex(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, OBJ_INDEX))); + return(dynamic_cast(getObject(obj_idx, ObjIndex))); } catch(Exception &e) { @@ -950,11 +950,11 @@ unsigned View::getIndexCount() vector *View::getObjectList(ObjectType obj_type) { - if(obj_type==OBJ_TRIGGER) + if(obj_type==ObjTrigger) return(&triggers); - else if(obj_type==OBJ_RULE) + else if(obj_type==ObjRule) return(&rules); - else if(obj_type==OBJ_INDEX) + else if(obj_type==ObjIndex) return(&indexes); else throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index 1754d56722..45857e3d5c 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -18,7 +18,7 @@ #include "aggregatewidget.h" -AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_AGGREGATE) +AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, ObjAggregate) { try { @@ -30,9 +30,9 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_ initial_cond_hl=new SyntaxHighlighter(initial_cond_txt); initial_cond_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - final_func_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); - transition_func_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); - sort_op_sel=new ObjectSelectorWidget(OBJ_OPERATOR, true, this); + final_func_sel=new ObjectSelectorWidget(ObjFunction, true, this); + transition_func_sel=new ObjectSelectorWidget(ObjFunction, true, this); + sort_op_sel=new ObjectSelectorWidget(ObjOperator, true, this); input_type=new PgSQLTypeWidget(this, trUtf8("Input Data Type")); state_type=new PgSQLTypeWidget(this, trUtf8("State Data Type")); @@ -66,7 +66,7 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_ funcaoagregacao_grid->addWidget(frame, funcaoagregacao_grid->count()+1, 0, 1, 2); frame->setParent(this); - configureFormLayout(funcaoagregacao_grid, OBJ_AGGREGATE); + configureFormLayout(funcaoagregacao_grid, ObjAggregate); setRequiredField(state_type); setRequiredField(input_type); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index dc9318fa59..96c1cb837e 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -38,16 +38,16 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid ParsersAttributes::TABLE_BODY, //10 ParsersAttributes::TABLE_EXT_BODY, //11 ParsersAttributes::TABLE_TITLE, //12 - BaseObject::getSchemaName(OBJ_RULE), //13 - BaseObject::getSchemaName(OBJ_RULE), //14 - BaseObject::getSchemaName(OBJ_INDEX), //15 - BaseObject::getSchemaName(OBJ_INDEX), //16 - BaseObject::getSchemaName(OBJ_TRIGGER), //17 - BaseObject::getSchemaName(OBJ_TRIGGER), //18 - BaseObject::getSchemaName(OBJ_CONSTRAINT), //19 - BaseObject::getSchemaName(OBJ_CONSTRAINT), //20 - BaseObject::getSchemaName(OBJ_POLICY), //21 - BaseObject::getSchemaName(OBJ_POLICY), //22 + BaseObject::getSchemaName(ObjRule), //13 + BaseObject::getSchemaName(ObjRule), //14 + BaseObject::getSchemaName(ObjIndex), //15 + BaseObject::getSchemaName(ObjIndex), //16 + BaseObject::getSchemaName(ObjTrigger), //17 + BaseObject::getSchemaName(ObjTrigger), //18 + BaseObject::getSchemaName(ObjConstraint), //19 + BaseObject::getSchemaName(ObjConstraint), //20 + BaseObject::getSchemaName(ObjPolicy), //21 + BaseObject::getSchemaName(ObjPolicy), //22 ParsersAttributes::VIEW_SCHEMA_NAME, //21 -> 23 ParsersAttributes::VIEW_NAME, //22 ParsersAttributes::VIEW_BODY, //23 @@ -57,7 +57,7 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid ParsersAttributes::REF_COLUMN, //27 ParsersAttributes::REF_TABLE, //28 ParsersAttributes::REFERENCE, //29 - BaseObject::getSchemaName(OBJ_TEXTBOX), //30 + BaseObject::getSchemaName(ObjTextbox), //30 ParsersAttributes::COLUMN, //31 ParsersAttributes::COLUMN, //32 ParsersAttributes::INH_COLUMN, //33 @@ -161,7 +161,7 @@ void AppearanceConfigWidget::loadExampleModel(void) GlobalAttributes::DirSeparator + GlobalAttributes::ExampleModel); - count=model->getObjectCount(OBJ_TABLE); + count=model->getObjectCount(ObjTable); for(i=0; i < count; i++) { tab=new TableView(model->getTable(i)); @@ -169,28 +169,28 @@ void AppearanceConfigWidget::loadExampleModel(void) scene->addItem(tab); } - count=model->getObjectCount(OBJ_VIEW); + count=model->getObjectCount(ObjView); for(i=0; i < count; i++) { view=new GraphicalView(model->getView(i)); scene->addItem(view); } - count=model->getObjectCount(OBJ_RELATIONSHIP); + count=model->getObjectCount(ObjRelationship); for(i=0; i < count; i++) { - rel=new RelationshipView(model->getRelationship(i, OBJ_RELATIONSHIP)); + rel=new RelationshipView(model->getRelationship(i, ObjRelationship)); scene->addItem(rel); } - count=model->getObjectCount(BASE_RELATIONSHIP); + count=model->getObjectCount(ObjBaseRelationship); for(i=0; i < count; i++) { - rel=new RelationshipView(model->getRelationship(i, BASE_RELATIONSHIP)); + rel=new RelationshipView(model->getRelationship(i, ObjBaseRelationship)); scene->addItem(rel); } - count=model->getObjectCount(OBJ_TEXTBOX); + count=model->getObjectCount(ObjTextbox); for(i=0; i < count; i++) { txtbox=new StyledTextboxView(model->getTextbox(i)); diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp index 2618f48cd7..9151f55a51 100644 --- a/libpgmodeler_ui/src/baseform.cpp +++ b/libpgmodeler_ui/src/baseform.cpp @@ -127,7 +127,7 @@ void BaseForm::setMainWidget(BaseObjectWidget *widget) { if(!widget) return; - if(widget->getHandledObjectType()!=BASE_OBJECT && widget->windowTitle().isEmpty()) + if(widget->getHandledObjectType()!=ObjBaseObject && widget->windowTitle().isEmpty()) setWindowTitle(trUtf8("%1 properties").arg(BaseObject::getTypeName(widget->getHandledObjectType()))); else setWindowTitle(widget->windowTitle()); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 8385addd9a..8bd18e5a3a 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -57,10 +57,10 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge connect(edt_perms_tb, SIGNAL(clicked(bool)),this, SLOT(editPermissions(void))); connect(append_sql_tb, SIGNAL(clicked(bool)),this, SLOT(editCustomSQL(void))); - schema_sel=new ObjectSelectorWidget(OBJ_SCHEMA, true, this); - collation_sel=new ObjectSelectorWidget(OBJ_COLLATION, true, this); - tablespace_sel=new ObjectSelectorWidget(OBJ_TABLESPACE, true, this); - owner_sel=new ObjectSelectorWidget(OBJ_ROLE, true, this); + schema_sel=new ObjectSelectorWidget(ObjSchema, true, this); + collation_sel=new ObjectSelectorWidget(ObjCollation, true, this); + tablespace_sel=new ObjectSelectorWidget(ObjTablespace, true, this); + owner_sel=new ObjectSelectorWidget(ObjRole, true, this); alias_ht=new HintTextWidget(alias_hint, this); alias_ht->setText(alias_edt->statusTip()); @@ -287,7 +287,7 @@ void BaseObjectWidget::cancelChainedOperation(void) void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *object, BaseObject *parent_obj, double obj_px, double obj_py, bool uses_op_list) { - ObjectType obj_type, parent_type=BASE_OBJECT; + ObjectType obj_type, parent_type=ObjBaseObject; /* Reseting the objects attributes in order to force them to be redefined every time this method is called */ @@ -309,11 +309,11 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis { parent_type=parent_obj->getObjectType(); - if(parent_type==OBJ_TABLE || parent_type==OBJ_VIEW) + if(parent_type==ObjTable || parent_type==ObjView) this->table=dynamic_cast(parent_obj); - else if(parent_type==OBJ_RELATIONSHIP) + else if(parent_type==ObjRelationship) this->relationship=dynamic_cast(parent_obj); - else if(parent_type!=OBJ_DATABASE && parent_type!=OBJ_SCHEMA) + else if(parent_type!=ObjDatabase && parent_type!=ObjSchema) throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -350,23 +350,23 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis append_sql_tb->setEnabled(object!=nullptr && !new_object); owner_sel->setModel(model); - owner_sel->setSelectedObject(model->getDefaultObject(OBJ_ROLE)); + owner_sel->setSelectedObject(model->getDefaultObject(ObjRole)); schema_sel->setModel(model); - schema_sel->setSelectedObject(model->getDefaultObject(OBJ_SCHEMA)); + schema_sel->setSelectedObject(model->getDefaultObject(ObjSchema)); tablespace_sel->setModel(model); - tablespace_sel->setSelectedObject(model->getDefaultObject(OBJ_TABLESPACE)); + tablespace_sel->setSelectedObject(model->getDefaultObject(ObjTablespace)); collation_sel->setModel(model); - collation_sel->setSelectedObject(model->getDefaultObject(OBJ_COLLATION)); + collation_sel->setSelectedObject(model->getDefaultObject(ObjCollation)); if(object) { obj_id_lbl->setVisible(true); obj_id_lbl->setText(QString("ID: %1").arg(object->getObjectId())); - if(handled_obj_type != BASE_OBJECT) + if(handled_obj_type != ObjBaseObject) name_edt->setText(object->getName()); else name_edt->setText(object->getSignature()); @@ -390,9 +390,9 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis schema_sel->setSelectedObject(object->getSchema()); obj_type=object->getObjectType(); - object_protected=(parent_type!=OBJ_RELATIONSHIP && + object_protected=(parent_type!=ObjRelationship && (object->isProtected() || - ((obj_type==OBJ_COLUMN || obj_type==OBJ_CONSTRAINT) && + ((obj_type==ObjColumn || obj_type==ObjConstraint) && dynamic_cast(object)->isAddedByRelationship()))); protected_obj_frm->setVisible(object_protected); disable_sql_chk->setChecked(object->isSQLDisabled()); @@ -403,7 +403,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis obj_id_lbl->setVisible(false); protected_obj_frm->setVisible(false); - if(parent_obj && parent_obj->getObjectType()==OBJ_SCHEMA) + if(parent_obj && parent_obj->getObjectType()==ObjSchema) schema_sel->setSelectedObject(parent_obj); } } @@ -446,9 +446,9 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ this->setLayout(baseobject_grid); baseobject_grid->setContentsMargins(4, 4, 4, 4); - disable_sql_chk->setVisible(obj_type!=BASE_OBJECT && obj_type!=OBJ_PERMISSION && - obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_TAG && - obj_type!=OBJ_PARAMETER); + disable_sql_chk->setVisible(obj_type!=ObjBaseObject && obj_type!=ObjPermission && + obj_type!=ObjTextbox && obj_type!=ObjTag && + obj_type!=ObjParameter); alias_edt->setVisible(BaseObject::acceptsAlias(obj_type)); alias_hint_wgt->setVisible(BaseObject::acceptsAlias(obj_type)); @@ -469,22 +469,22 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ collation_lbl->setVisible(BaseObject::acceptsCollation(obj_type)); collation_sel->setVisible(BaseObject::acceptsCollation(obj_type)); - show_comment=obj_type!=OBJ_RELATIONSHIP && obj_type!=OBJ_TEXTBOX && obj_type!=OBJ_PARAMETER; + show_comment=obj_type!=ObjRelationship && obj_type!=ObjTextbox && obj_type!=ObjParameter; comment_lbl->setVisible(show_comment); comment_edt->setVisible(show_comment); - if(obj_type!=BASE_OBJECT) + if(obj_type!=ObjBaseObject) { obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(obj_type))); obj_icon_lbl->setToolTip(BaseObject::getTypeName(obj_type)); - if(obj_type!=OBJ_PERMISSION && obj_type!=OBJ_CAST) + if(obj_type!=ObjPermission && obj_type!=ObjCast) { setRequiredField(name_lbl); setRequiredField(name_edt); } - if(obj_type!=OBJ_EXTENSION) + if(obj_type!=ObjExtension) { setRequiredField(schema_lbl); setRequiredField(schema_sel); @@ -702,13 +702,13 @@ void BaseObjectWidget::applyConfiguration(void) QString obj_name; QApplication::setOverrideCursor(Qt::WaitCursor); - obj_name=BaseObject::formatName(name_edt->text().toUtf8(), obj_type==OBJ_OPERATOR); + obj_name=BaseObject::formatName(name_edt->text().toUtf8(), obj_type==ObjOperator); if(this->object->acceptsSchema() && schema_sel->getSelectedObject()) obj_name=schema_sel->getSelectedObject()->getName(true) + "." + obj_name; //Checking the object duplicity - if(obj_type!=OBJ_DATABASE && obj_type!=OBJ_PERMISSION && obj_type!=OBJ_PARAMETER) + if(obj_type!=ObjDatabase && obj_type!=ObjPermission && obj_type!=ObjParameter) { if(table) { @@ -736,10 +736,10 @@ void BaseObjectWidget::applyConfiguration(void) checking on table list when the configured object is a view or a checking on view list when the configured object is a table, this because PostgreSQL does not accepts tables and views have the same name on the same schema */ - if(!aux_obj && obj_type==OBJ_TABLE) - aux_obj=model->getObject(obj_name, OBJ_VIEW); - else if(!aux_obj && obj_type==OBJ_VIEW) - aux_obj=model->getObject(obj_name, OBJ_TABLE); + if(!aux_obj && obj_type==ObjTable) + aux_obj=model->getObject(obj_name, ObjView); + else if(!aux_obj && obj_type==ObjView) + aux_obj=model->getObject(obj_name, ObjTable); aux_obj1=model->getObject(object->getSignature(), obj_type); new_obj=(!aux_obj && !aux_obj1); @@ -758,7 +758,7 @@ void BaseObjectWidget::applyConfiguration(void) } //Renames the object (only cast object aren't renamed) - if(obj_type!=OBJ_CAST) + if(obj_type!=ObjCast) { prev_name=object->getName(); object->setName(name_edt->text().trimmed().toUtf8()); @@ -819,10 +819,10 @@ void BaseObjectWidget::finishConfiguration(void) if(table && TableObject::isTableObject(obj_type)) table->addObject(this->object); //Adding the object on the relationship, if specified - else if(relationship && (obj_type==OBJ_COLUMN || obj_type==OBJ_CONSTRAINT)) + else if(relationship && (obj_type==ObjColumn || obj_type==ObjConstraint)) relationship->addObject(dynamic_cast(this->object)); //Adding the object on the model - else if(obj_type!=OBJ_PARAMETER) + else if(obj_type!=ObjParameter) model->addObject(this->object); registerNewObject(); @@ -831,7 +831,7 @@ void BaseObjectWidget::finishConfiguration(void) else { //If the object is being updated, validates its SQL definition - if(obj_type==BASE_RELATIONSHIP || obj_type==OBJ_TEXTBOX || obj_type==OBJ_TAG) + if(obj_type==ObjBaseRelationship || obj_type==ObjTextbox || obj_type==ObjTag) this->object->getCodeDefinition(SchemaParser::XML_DEFINITION); else this->object->getCodeDefinition(SchemaParser::SQL_DEFINITION); @@ -842,7 +842,7 @@ void BaseObjectWidget::finishConfiguration(void) { obj->setCodeInvalidated(true); - if(obj->getObjectType()==OBJ_COLUMN) + if(obj->getObjectType()==ObjColumn) dynamic_cast(obj)->getParentTable()->setModified(true); } @@ -851,7 +851,7 @@ void BaseObjectWidget::finishConfiguration(void) //If the object is graphical (or a table object), updates it (or its parent) on the scene if(graph_obj || tab_obj) { - if(!graph_obj && tab_obj && tab_obj->getObjectType()!=OBJ_PARAMETER) + if(!graph_obj && tab_obj && tab_obj->getObjectType()!=ObjParameter) { if(this->table) graph_obj=dynamic_cast(this->table); @@ -920,9 +920,9 @@ void BaseObjectWidget::cancelConfiguration(void) else if(relationship && relationship->getObjectIndex(tab_obj) >= 0) relationship->removeObject(tab_obj); - if(obj_type!=OBJ_TABLE && - obj_type!=OBJ_VIEW && - obj_type!=OBJ_RELATIONSHIP) + if(obj_type!=ObjTable && + obj_type!=ObjView && + obj_type!=ObjRelationship) { if(!op_list->isObjectRegistered(this->object, Operation::OBJECT_CREATED)) delete(this->object); @@ -933,8 +933,8 @@ void BaseObjectWidget::cancelConfiguration(void) //If the object is not a new one, restore its previous state if(op_list && - ((!new_object && obj_type!=OBJ_DATABASE && obj_type!=OBJ_PERMISSION && operation_count != op_list->getCurrentSize()) || - (new_object && (obj_type==OBJ_TABLE || obj_type==OBJ_VIEW || obj_type==OBJ_RELATIONSHIP)))) + ((!new_object && obj_type!=ObjDatabase && obj_type!=ObjPermission && operation_count != op_list->getCurrentSize()) || + (new_object && (obj_type==ObjTable || obj_type==ObjView || obj_type==ObjRelationship)))) { try { diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index fdb44c178e..c79a68a290 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -105,7 +105,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { /*! \brief Merges the specified grid layout with the 'baseobject_grid' creating a single form. The obj_type parameter must be specified to show the object type icon */ - void configureFormLayout(QGridLayout *grid=nullptr, ObjectType obj_type=BASE_OBJECT); + void configureFormLayout(QGridLayout *grid=nullptr, ObjectType obj_type=ObjBaseObject); /*! \brief Starts a object configuration, alocating a new one if necessary, registering the object on the operation list. This method doens't applies to database model edition */ @@ -143,7 +143,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { VERSIONS_INTERVAL=1, AFTER_VERSION=2; - BaseObjectWidget(QWidget * parent = 0, ObjectType obj_type=BASE_OBJECT); + BaseObjectWidget(QWidget * parent = 0, ObjectType obj_type=ObjBaseObject); virtual ~BaseObjectWidget(void); @@ -206,7 +206,7 @@ void BaseObjectWidget::startConfiguration(void) //! \brief If the object is already allocated if(this->object && op_list && - this->object->getObjectType()!=OBJ_DATABASE) + this->object->getObjectType()!=ObjDatabase) { if(this->table) op_list->registerObject(this->object, Operation::OBJECT_MODIFIED, -1, this->table); diff --git a/libpgmodeler_ui/src/castwidget.cpp b/libpgmodeler_ui/src/castwidget.cpp index 4e383e5f18..05bf13a2ef 100644 --- a/libpgmodeler_ui/src/castwidget.cpp +++ b/libpgmodeler_ui/src/castwidget.cpp @@ -18,7 +18,7 @@ #include "castwidget.h" -CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_CAST) +CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjCast) { try { @@ -30,13 +30,13 @@ CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_CAST) src_datatype=new PgSQLTypeWidget(this, trUtf8("Source data type")); trg_datatype=new PgSQLTypeWidget(this, trUtf8("Target data type")); - conv_func_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + conv_func_sel=new ObjectSelectorWidget(ObjFunction, true, this); cast_grid->addWidget(conv_func_sel,1,1,1,4); cast_grid->addWidget(src_datatype,2,0,1,5); cast_grid->addWidget(trg_datatype,3,0,1,5); - configureFormLayout(cast_grid, OBJ_CAST); + configureFormLayout(cast_grid, ObjCast); name_edt->setReadOnly(true); font=name_edt->font(); diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 6b88cbdccd..df4d4f8679 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -282,12 +282,12 @@ void CodeCompletionWidget::populateNameList(vector &objects, QStri obj_name.clear(); //Formatting the object name according to the object type - if(obj_type==OBJ_FUNCTION) + if(obj_type==ObjFunction) { dynamic_cast(objects[i])->createSignature(false); obj_name=dynamic_cast(objects[i])->getSignature(); } - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) obj_name=dynamic_cast(objects[i])->getSignature(false); else obj_name+=objects[i]->getName(false, false); @@ -319,10 +319,10 @@ void CodeCompletionWidget::setQualifyingLevel(BaseObject *obj) { if(!obj) qualifying_level=-1; - else if(obj->getObjectType()==OBJ_SCHEMA) + else if(obj->getObjectType()==ObjSchema) qualifying_level=0; - else if(obj->getObjectType()==OBJ_TABLE || - obj->getObjectType()==OBJ_VIEW) + else if(obj->getObjectType()==ObjTable || + obj->getObjectType()==ObjView) qualifying_level=1; else qualifying_level=2; @@ -344,7 +344,7 @@ void CodeCompletionWidget::updateList(void) QString pattern; QStringList list; vector objects; - vector types=BaseObject::getObjectTypes(false, { OBJ_TEXTBOX, OBJ_RELATIONSHIP, BASE_RELATIONSHIP }); + vector types=BaseObject::getObjectTypes(false, { ObjTextbox, ObjRelationship, ObjBaseRelationship }); QTextCursor tc; name_list->clear(); @@ -373,7 +373,7 @@ void CodeCompletionWidget::updateList(void) word.remove(completion_trigger); word.remove('"'); - objects=db_model->findObjects(word, { OBJ_SCHEMA, OBJ_TABLE, OBJ_VIEW }, false, false, false, true); + objects=db_model->findObjects(word, { ObjSchema, ObjTable, ObjView }, false, false, false, true); if(objects.size()==1) setQualifyingLevel(objects[0]); @@ -587,9 +587,9 @@ void CodeCompletionWidget::insertObjectName(BaseObject *obj) if(modify_name && - (obj_type==OBJ_TABLE || TableObject::isTableObject(obj_type))) + (obj_type==ObjTable || TableObject::isTableObject(obj_type))) { - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) { Table *tab=dynamic_cast
(obj); @@ -611,17 +611,17 @@ void CodeCompletionWidget::insertObjectName(BaseObject *obj) code_field_txt->setTextCursor(lvl_cur); } } - else if(obj_type==OBJ_FUNCTION) + else if(obj_type==ObjFunction) { Function *func=dynamic_cast(obj); func->createSignature(true, sch_qualified); name=func->getSignature(); } - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) { name.replace(',', QLatin1String(" AS ")); } - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) { Aggregate *agg; agg=dynamic_cast(obj); diff --git a/libpgmodeler_ui/src/collationwidget.cpp b/libpgmodeler_ui/src/collationwidget.cpp index ceec9a4bb9..d9b7f4d903 100644 --- a/libpgmodeler_ui/src/collationwidget.cpp +++ b/libpgmodeler_ui/src/collationwidget.cpp @@ -18,7 +18,7 @@ #include "collationwidget.h" -CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLLATION) +CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, ObjCollation) { try { @@ -32,7 +32,7 @@ CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_ collation_grid->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum,QSizePolicy::Expanding), collation_grid->count()+1, 0, 1, 0); collation_grid->addWidget(frame, collation_grid->count()+1, 0, 1, 0); frame->setParent(this); - configureFormLayout(collation_grid, OBJ_COLLATION); + configureFormLayout(collation_grid, ObjCollation); //Configures the encoding combobox EncodingType::getTypes(encodings); diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index ebccbb8ab3..53f274d582 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -21,7 +21,7 @@ #include "baseform.h" #include "generalconfigwidget.h" -ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN) +ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjColumn) { try { @@ -41,7 +41,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN hl_default_value=new SyntaxHighlighter(def_value_txt, true); hl_default_value->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - sequence_sel=new ObjectSelectorWidget(OBJ_SEQUENCE, true, this); + sequence_sel=new ObjectSelectorWidget(ObjSequence, true, this); sequence_sel->setEnabled(false); column_grid->addWidget(data_type,0,0,1,0); @@ -50,7 +50,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_COLUMN column_grid->addItem(spacer,column_grid->count(),0); dynamic_cast(default_value_grp->layout())->addWidget(sequence_sel, 1, 1, 1, 6); - configureFormLayout(column_grid, OBJ_COLUMN); + configureFormLayout(column_grid, ObjColumn); configureTabOrder({ data_type }); map > fields_map; @@ -148,7 +148,7 @@ void ColumnWidget::editSequenceAttributes(void) schema = this->model->getSchema("public"); ident_col_seq.setName(QString("%1_%2_seq").arg(table ? table->getName() : QString()).arg(col ? col->getName() : QString("new_column"))); - ident_col_seq.setName(PgModelerNS::generateUniqueName(&ident_col_seq, *model->getObjectList(OBJ_SEQUENCE), false)); + ident_col_seq.setName(PgModelerNS::generateUniqueName(&ident_col_seq, *model->getObjectList(ObjSequence), false)); ident_col_seq.setSchema(schema); if(col) diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index dfb4371595..73517220ee 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -18,7 +18,7 @@ #include "constraintwidget.h" -ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_CONSTRAINT) +ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, ObjConstraint) { try { @@ -48,7 +48,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, OB ObjectsTableWidget::UPDATE_BUTTON | ObjectsTableWidget::DUPLICATE_BUTTON), true, this); - ref_table_sel=new ObjectSelectorWidget(OBJ_TABLE, true, this); + ref_table_sel=new ObjectSelectorWidget(ObjTable, true, this); columns_tab->setColumnCount(2); columns_tab->setHeaderLabel(trUtf8("Column"), 0); @@ -67,7 +67,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, OB dynamic_cast(columns_tbw->widget(1)->layout())->addWidget(ref_table_sel, 0,1,1,2); dynamic_cast(columns_tbw->widget(1)->layout())->addWidget(ref_columns_tab, 3,0,1,3); - configureFormLayout(constraint_grid, OBJ_CONSTRAINT); + configureFormLayout(constraint_grid, ObjConstraint); ConstraintType::getTypes(list); constr_type_cmb->addItems(list); @@ -359,7 +359,7 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=parent_obj->getObjectType(); - if(obj_type!=OBJ_TABLE && obj_type!=OBJ_RELATIONSHIP) + if(obj_type!=ObjTable && obj_type!=ObjRelationship) throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, constr, parent_obj); diff --git a/libpgmodeler_ui/src/conversionwidget.cpp b/libpgmodeler_ui/src/conversionwidget.cpp index cefaa18f0f..755a8b5f73 100644 --- a/libpgmodeler_ui/src/conversionwidget.cpp +++ b/libpgmodeler_ui/src/conversionwidget.cpp @@ -18,7 +18,7 @@ #include "conversionwidget.h" -ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_CONVERSION) +ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, ObjConversion) { try { @@ -28,7 +28,7 @@ ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, OB Ui_ConversionWidget::setupUi(this); conv_func_sel=nullptr; - conv_func_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + conv_func_sel=new ObjectSelectorWidget(ObjFunction, true, this); convcod_grid->addWidget(conv_func_sel,1,1,1,3); setRequiredField(src_encoding_lbl); @@ -36,7 +36,7 @@ ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, OB setRequiredField(conv_func_lbl); setRequiredField(conv_func_sel); - configureFormLayout(convcod_grid, OBJ_CONVERSION); + configureFormLayout(convcod_grid, ObjConversion); frame=generateInformationFrame(trUtf8("The function to be assigned to an encoding conversion must have the following signature: void function(integer, integer, cstring, internal, integer).")); convcod_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), convcod_grid->count()+1, 0, 1, 0); convcod_grid->addWidget(frame, convcod_grid->count()+1, 0, 1, 0); diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index 671511fb8d..9ecccf6bf6 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -26,7 +26,7 @@ CustomSQLWidget::CustomSQLWidget(QWidget *parent) : BaseObjectWidget(parent) QFont font; Ui_CustomSQLWidget::setupUi(this); - configureFormLayout(sqlappend_grid, BASE_OBJECT); + configureFormLayout(sqlappend_grid, ObjBaseObject); append_sql_txt=PgModelerUiNS::createNumberedTextEditor(append_sql_wgt, true); prepend_sql_txt=PgModelerUiNS::createNumberedTextEditor(prepend_sql_wgt, true); @@ -106,9 +106,9 @@ void CustomSQLWidget::configureMenus(void) for(int i=0; i < count; i++) btns[i]->setMenu(nullptr); - if(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) + if(obj_type==ObjTable || obj_type==ObjView) { - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) { insert_tb->setMenu(&insert_menu); delete_tb->setMenu(&delete_menu); @@ -132,7 +132,7 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) name_edt->setText(QString("%1 (%2)").arg(object->getSignature()).arg(object->getTypeName())); - if(object->getObjectType()==OBJ_DATABASE) + if(object->getObjectType()==ObjDatabase) end_of_model_chk->setChecked(dynamic_cast(object)->isAppendAtEOD()); append_sql_txt->setFocus(); @@ -145,8 +145,8 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) prepend_sql_cp->configureCompletion(model, prepend_sql_hl); prepend_sql_txt->moveCursor(QTextCursor::End); - end_of_model_chk->setVisible(object->getObjectType()==OBJ_DATABASE); - begin_of_model_chk->setVisible(object->getObjectType()==OBJ_DATABASE); + end_of_model_chk->setVisible(object->getObjectType()==ObjDatabase); + begin_of_model_chk->setVisible(object->getObjectType()==ObjDatabase); protected_obj_frm->setVisible(false); obj_id_lbl->setVisible(false); @@ -164,7 +164,7 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) void CustomSQLWidget::applyConfiguration(void) { - if(this->object->getObjectType()==OBJ_DATABASE) + if(this->object->getObjectType()==ObjDatabase) { dynamic_cast(this->object)->setAppendAtEOD(end_of_model_chk->isChecked()); dynamic_cast(this->object)->setPrependAtBOD(begin_of_model_chk->isChecked()); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 1d4b721091..f882b03170 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -195,7 +195,7 @@ DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); unsigned oid=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); - if((obj_type==OBJ_SCHEMA || obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) && oid > 0 && item->childCount() <= 1) + if((obj_type==ObjSchema || obj_type==ObjTable || obj_type==ObjView) && oid > 0 && item->childCount() <= 1) { updateItem(item); } @@ -236,17 +236,17 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) if(k_event->key()==Qt::Key_Space) { QTreeWidgetItem *item=objects_trw->currentItem(); - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; if(item) { unsigned oid=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); - if(oid!=0 && (obj_type==OBJ_TABLE || obj_type==OBJ_VIEW)) + if(oid!=0 && (obj_type==ObjTable || obj_type==ObjView)) { openDataGrid(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString(), - item->text(0), obj_type!=OBJ_VIEW); + item->text(0), obj_type!=ObjView); } } } @@ -274,15 +274,15 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; attribs_map fmt_attribs; QString attr_name, attr_value; QRegExp oid_regexp=QRegExp(QString("^[0-9]+")); - map dep_types={{ParsersAttributes::OWNER, OBJ_ROLE}, - {ParsersAttributes::SCHEMA, OBJ_SCHEMA}, - {ParsersAttributes::TABLESPACE, OBJ_TABLESPACE}, - {ParsersAttributes::COLLATION, OBJ_COLLATION}, - {ParsersAttributes::TABLE, OBJ_TABLE}}; + map dep_types={{ParsersAttributes::OWNER, ObjRole}, + {ParsersAttributes::SCHEMA, ObjSchema}, + {ParsersAttributes::TABLESPACE, ObjTablespace}, + {ParsersAttributes::COLLATION, ObjCollation}, + {ParsersAttributes::TABLE, ObjTable}}; if(attribs.count(ParsersAttributes::OBJECT_TYPE)!=0) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); @@ -291,27 +291,27 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) { switch(obj_type) { - case OBJ_CAST: formatCastAttribs(attribs); break; - case OBJ_EVENT_TRIGGER: formatEventTriggerAttribs(attribs); break; - case OBJ_LANGUAGE: formatLanguageAttribs(attribs); break; - case OBJ_ROLE: formatRoleAttribs(attribs); break; - case OBJ_AGGREGATE: formatAggregateAttribs(attribs); break; - case OBJ_CONVERSION: formatConversionAttribs(attribs); break; - case OBJ_DOMAIN: formatDomainAttribs(attribs); break; - case OBJ_EXTENSION: formatExtensionAttribs(attribs); break; - case OBJ_FUNCTION: formatFunctionAttribs(attribs); break; - case OBJ_OPERATOR: formatOperatorAttribs(attribs); break; - case OBJ_OPCLASS: formatOperatorClassAttribs(attribs); break; - case OBJ_TABLE: formatTableAttribs(attribs); break; - case OBJ_SEQUENCE: formatSequenceAttribs(attribs); break; - case OBJ_TYPE: formatTypeAttribs(attribs); break; - case OBJ_VIEW: formatViewAttribs(attribs); break; - case OBJ_TRIGGER: formatTriggerAttribs(attribs); break; - case OBJ_RULE: formatRuleAttribs(attribs); break; - case OBJ_COLUMN: formatColumnAttribs(attribs); break; - case OBJ_CONSTRAINT: formatConstraintAttribs(attribs); break; - case OBJ_INDEX: formatIndexAttribs(attribs); break; - case OBJ_POLICY: formatPolicyAttribs(attribs); break; + case ObjCast: formatCastAttribs(attribs); break; + case ObjEventTrigger: formatEventTriggerAttribs(attribs); break; + case ObjLanguage: formatLanguageAttribs(attribs); break; + case ObjRole: formatRoleAttribs(attribs); break; + case ObjAggregate: formatAggregateAttribs(attribs); break; + case ObjConversion: formatConversionAttribs(attribs); break; + case ObjDomain: formatDomainAttribs(attribs); break; + case ObjExtension: formatExtensionAttribs(attribs); break; + case ObjFunction: formatFunctionAttribs(attribs); break; + case ObjOperator: formatOperatorAttribs(attribs); break; + case ObjOpClass: formatOperatorClassAttribs(attribs); break; + case ObjTable: formatTableAttribs(attribs); break; + case ObjSequence: formatSequenceAttribs(attribs); break; + case ObjType: formatTypeAttribs(attribs); break; + case ObjView: formatViewAttribs(attribs); break; + case ObjTrigger: formatTriggerAttribs(attribs); break; + case ObjRule: formatRuleAttribs(attribs); break; + case ObjColumn: formatColumnAttribs(attribs); break; + case ObjConstraint: formatConstraintAttribs(attribs); break; + case ObjIndex: formatIndexAttribs(attribs); break; + case ObjPolicy: formatPolicyAttribs(attribs); break; default: break; } } @@ -408,29 +408,29 @@ void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { ParsersAttributes::IO_CAST }); formatOidAttribs(attribs, { ParsersAttributes::DEST_TYPE, - ParsersAttributes::SOURCE_TYPE }, OBJ_TYPE, false); + ParsersAttributes::SOURCE_TYPE }, ObjType, false); - attribs[ParsersAttributes::FUNCTION]=getObjectName(OBJ_FUNCTION, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjFunction, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatEventTriggerAttribs(attribs_map &attribs) { attribs[ParsersAttributes::VALUES]=Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES]).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::FUNCTION]=getObjectName(OBJ_FUNCTION, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjFunction, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { ParsersAttributes::FINAL_FUNC, - ParsersAttributes::TRANSITION_FUNC }, OBJ_FUNCTION, false); + ParsersAttributes::TRANSITION_FUNC }, ObjFunction, false); - formatOidAttribs(attribs, { ParsersAttributes::TYPES }, OBJ_TYPE, true); + formatOidAttribs(attribs, { ParsersAttributes::TYPES }, ObjType, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) .arg(attribs[ParsersAttributes::TYPES])).replace(ELEM_SEPARATOR, QString(",")); - attribs[ParsersAttributes::STATE_TYPE]=getObjectName(OBJ_TYPE, attribs[ParsersAttributes::STATE_TYPE]); - attribs[ParsersAttributes::SORT_OP]=getObjectName(OBJ_OPERATOR, attribs[ParsersAttributes::SORT_OP]); + attribs[ParsersAttributes::STATE_TYPE]=getObjectName(ObjType, attribs[ParsersAttributes::STATE_TYPE]); + attribs[ParsersAttributes::SORT_OP]=getObjectName(ObjOperator, attribs[ParsersAttributes::SORT_OP]); attribs[ParsersAttributes::INITIAL_COND]=Catalog::parseArrayValues(attribs[ParsersAttributes::INITIAL_COND]).join(ELEM_SEPARATOR); } @@ -440,14 +440,14 @@ void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) formatOidAttribs(attribs, { ParsersAttributes::VALIDATOR_FUNC, ParsersAttributes::HANDLER_FUNC, - ParsersAttributes::INLINE_FUNC }, OBJ_FUNCTION, false); + ParsersAttributes::INLINE_FUNC }, ObjFunction, false); } void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { ParsersAttributes::ADMIN_ROLES, ParsersAttributes::MEMBER_ROLES, - ParsersAttributes::REF_ROLES }, OBJ_ROLE, true); + ParsersAttributes::REF_ROLES }, ObjRole, true); formatBooleanAttribs(attribs, { ParsersAttributes::SUPERUSER, ParsersAttributes::INHERIT, ParsersAttributes::CREATEROLE, ParsersAttributes::CREATEDB, @@ -458,13 +458,13 @@ void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { ParsersAttributes::DEFAULT }); - attribs[ParsersAttributes::FUNCTION]=getObjectName(OBJ_FUNCTION, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjFunction, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { ParsersAttributes::NOT_NULL }); - attribs[ParsersAttributes::TYPE]=getObjectName(OBJ_TYPE, attribs[ParsersAttributes::TYPE]); + attribs[ParsersAttributes::TYPE]=getObjectName(ObjType, attribs[ParsersAttributes::TYPE]); } void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) @@ -474,13 +474,13 @@ void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::LANGUAGE]=getObjectName(OBJ_LANGUAGE, attribs[ParsersAttributes::LANGUAGE]); - attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(OBJ_TYPE, attribs[ParsersAttributes::RETURN_TYPE]); + attribs[ParsersAttributes::LANGUAGE]=getObjectName(ObjLanguage, attribs[ParsersAttributes::LANGUAGE]); + attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(ObjType, attribs[ParsersAttributes::RETURN_TYPE]); attribs[ParsersAttributes::ARG_NAMES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_NAMES]).join(ELEM_SEPARATOR); attribs[ParsersAttributes::ARG_MODES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_MODES]).join(ELEM_SEPARATOR); attribs[ParsersAttributes::ARG_DEFAULTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_DEFAULTS]).join(ELEM_SEPARATOR); - formatOidAttribs(attribs, { ParsersAttributes::ARG_TYPES }, OBJ_TYPE, true); + formatOidAttribs(attribs, { ParsersAttributes::ARG_TYPES }, ObjType, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) .arg(attribs[ParsersAttributes::ARG_TYPES])).replace(ELEM_SEPARATOR, QString(",")); @@ -496,14 +496,14 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) ParsersAttributes::MERGES }); formatOidAttribs(attribs, { ParsersAttributes::LEFT_TYPE, - ParsersAttributes::RIGHT_TYPE}, OBJ_TYPE, false); + ParsersAttributes::RIGHT_TYPE}, ObjType, false); formatOidAttribs(attribs, { ParsersAttributes::COMMUTATOR_OP, - ParsersAttributes::NEGATOR_OP}, OBJ_OPERATOR, false); + ParsersAttributes::NEGATOR_OP}, ObjOperator, false); formatOidAttribs(attribs, { ParsersAttributes::OPERATOR_FUNC, ParsersAttributes::RESTRICTION_FUNC, - ParsersAttributes::JOIN_FUNC }, OBJ_FUNCTION, false); + ParsersAttributes::JOIN_FUNC }, ObjFunction, false); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2,%3)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME], true)) @@ -520,12 +520,12 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) ParsersAttributes::RLS_ENABLED, ParsersAttributes::RLS_FORCED}); - formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, OBJ_TABLE, true); - formatOidAttribs(attribs, { ParsersAttributes::PARTITIONED_TABLE }, OBJ_TABLE, false); + formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, ObjTable, true); + formatOidAttribs(attribs, { ParsersAttributes::PARTITIONED_TABLE }, ObjTable, false); - part_keys.push_back(getObjectsNames(OBJ_COLUMN, + part_keys.push_back(getObjectsNames(ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]), - getObjectName(OBJ_SCHEMA, attribs[ParsersAttributes::SCHEMA]), + getObjectName(ObjSchema, attribs[ParsersAttributes::SCHEMA]), attribs[ParsersAttributes::NAME]).join(ELEM_SEPARATOR)); part_keys.push_back(Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ELEM_SEPARATOR)); @@ -545,7 +545,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) seq_attrs={ ParsersAttributes::START, ParsersAttributes::MIN_VALUE, ParsersAttributes::MAX_VALUE, ParsersAttributes::INCREMENT, ParsersAttributes::CACHE, ParsersAttributes::CYCLE }; - QString sch_name=getObjectName(OBJ_SCHEMA, attribs[ParsersAttributes::SCHEMA]); + QString sch_name=getObjectName(ObjSchema, attribs[ParsersAttributes::SCHEMA]); attribs.erase(ParsersAttributes::ATTRIBUTE); for(int i=0; i < seq_values.size(); i++) @@ -556,8 +556,8 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) owner_col=attribs[ParsersAttributes::OWNER_COLUMN].split(':'); if(owner_col.size()==2) { - QStringList names=getObjectName(OBJ_TABLE, owner_col[0]).split('.'); - vector col_attribs=catalog.getObjectsAttributes(OBJ_COLUMN, names[0], names[1], { owner_col[1].toUInt() }); + QStringList names=getObjectName(ObjTable, owner_col[0]).split('.'); + vector col_attribs=catalog.getObjectsAttributes(ObjColumn, names[0], names[1], { owner_col[1].toUInt() }); if(!col_attribs.empty()) attribs[ParsersAttributes::OWNER_COLUMN]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(ParsersAttributes::NAME)); @@ -602,8 +602,8 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) ParsersAttributes::RECV_FUNC, ParsersAttributes::SEND_FUNC, ParsersAttributes::TPMOD_IN_FUNC, - ParsersAttributes::TPMOD_OUT_FUNC }, OBJ_FUNCTION, false); - attribs[ParsersAttributes::ELEMENT]=getObjectName(OBJ_TYPE, attribs[ParsersAttributes::ELEMENT]); + ParsersAttributes::TPMOD_OUT_FUNC }, ObjFunction, false); + attribs[ParsersAttributes::ELEMENT]=getObjectName(ObjType, attribs[ParsersAttributes::ELEMENT]); if(attribs[ParsersAttributes::ENUMERATIONS].isEmpty()) attribs.erase(ParsersAttributes::ENUMERATIONS); @@ -613,11 +613,11 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) attribs.erase(ParsersAttributes::RANGE_ATTRIBS); if(!range_attr.isEmpty()) { - attribs[ParsersAttributes::SUBTYPE]=getObjectName(OBJ_TYPE, range_attr[0]); - attribs[ParsersAttributes::COLLATION]=getObjectName(OBJ_COLLATION, range_attr[1]); - attribs[ParsersAttributes::OP_CLASS]=getObjectName(OBJ_OPCLASS, range_attr[2]); - attribs[ParsersAttributes::CANONICAL_FUNC]=getObjectName(OBJ_FUNCTION, range_attr[3]); - attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getObjectName(OBJ_FUNCTION, range_attr[4]); + attribs[ParsersAttributes::SUBTYPE]=getObjectName(ObjType, range_attr[0]); + attribs[ParsersAttributes::COLLATION]=getObjectName(ObjCollation, range_attr[1]); + attribs[ParsersAttributes::OP_CLASS]=getObjectName(ObjOpClass, range_attr[2]); + attribs[ParsersAttributes::CANONICAL_FUNC]=getObjectName(ObjFunction, range_attr[3]); + attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjFunction, range_attr[4]); } if(!type_attr.isEmpty()) @@ -641,10 +641,10 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) { QStringList list, array_vals, elems; - attribs[ParsersAttributes::FAMILY]=getObjectName(OBJ_OPFAMILY, attribs[ParsersAttributes::FAMILY]); + attribs[ParsersAttributes::FAMILY]=getObjectName(ObjOpFamily, attribs[ParsersAttributes::FAMILY]); formatBooleanAttribs(attribs, { ParsersAttributes::DEFAULT }); formatOidAttribs(attribs, { ParsersAttributes::STORAGE, - ParsersAttributes::TYPE }, OBJ_TYPE, false); + ParsersAttributes::TYPE }, ObjType, false); array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::FUNCTION]); @@ -653,7 +653,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) for(int i=0; i < array_vals.size(); i++) { list=array_vals[i].split(':'); - elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(OBJ_FUNCTION, list[1]))); + elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(ObjFunction, list[1]))); } attribs[ParsersAttributes::FUNCTION]=elems.join(ELEM_SEPARATOR); @@ -669,8 +669,8 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) list=array_vals[i].split(':'); elems.push_back(QString("[%1] [%2] [%3]") .arg(list[0], - getObjectName(OBJ_OPERATOR, list[1]), - getObjectName(OBJ_OPERATOR, list[2]))); + getObjectName(ObjOperator, list[1]), + getObjectName(ObjOperator, list[2]))); } attribs[ParsersAttributes::OPERATOR]=elems.join(ELEM_SEPARATOR); @@ -688,7 +688,7 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) ParsersAttributes::UPD_EVENT, ParsersAttributes::TRUNC_EVENT }); - attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(OBJ_FUNCTION, attribs[ParsersAttributes::TRIGGER_FUNC]); + attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(ObjFunction, attribs[ParsersAttributes::TRIGGER_FUNC]); attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS]).join(ELEM_SEPARATOR); attribs[ParsersAttributes::COLUMNS]=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]).join(ELEM_SEPARATOR); } @@ -716,22 +716,22 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) {ParsersAttributes::EX_CONSTR, ConstraintType(ConstraintType::exclude)}}; ConstraintType constr_type=types[attribs[ParsersAttributes::TYPE]]; - QStringList names=getObjectName(OBJ_TABLE, attribs[ParsersAttributes::TABLE]).split('.'); + QStringList names=getObjectName(ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); formatBooleanAttribs(attribs, { ParsersAttributes::DEFERRABLE, ParsersAttributes::NO_INHERIT }); attribs[ParsersAttributes::TYPE]=~types[attribs[ParsersAttributes::TYPE]]; - attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(OBJ_OPCLASS, + attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjOpClass, Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::SRC_COLUMNS]=getObjectsNames(OBJ_COLUMN, + attribs[ParsersAttributes::SRC_COLUMNS]=getObjectsNames(ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::SRC_COLUMNS]), names[0], names[1]).join(ELEM_SEPARATOR); if(constr_type==ConstraintType::foreign_key) { - attribs[ParsersAttributes::REF_TABLE]=getObjectName(OBJ_TABLE, attribs[ParsersAttributes::REF_TABLE]); + attribs[ParsersAttributes::REF_TABLE]=getObjectName(ObjTable, attribs[ParsersAttributes::REF_TABLE]); names=attribs[ParsersAttributes::REF_TABLE].split('.'); - attribs[ParsersAttributes::DST_COLUMNS]=getObjectsNames(OBJ_COLUMN, + attribs[ParsersAttributes::DST_COLUMNS]=getObjectsNames(ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::DST_COLUMNS]), names[0], names[1]).join(ELEM_SEPARATOR); } @@ -755,7 +755,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) if(constr_type==ConstraintType::exclude) { attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::OPERATORS]=getObjectsNames(OBJ_OPERATOR, + attribs[ParsersAttributes::OPERATORS]=getObjectsNames(ObjOperator, Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATORS])).join(ELEM_SEPARATOR); } else @@ -768,28 +768,28 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) { - QStringList names=getObjectName(OBJ_TABLE, attribs[ParsersAttributes::TABLE]).split('.'); + QStringList names=getObjectName(ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); if(names.isEmpty() || names.size() == 1) - names=getObjectName(OBJ_VIEW, attribs[ParsersAttributes::TABLE]).split('.'); + names=getObjectName(ObjView, attribs[ParsersAttributes::TABLE]).split('.'); formatBooleanAttribs(attribs, { ParsersAttributes::UNIQUE }); attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::COLLATIONS]=getObjectsNames(OBJ_COLLATION, + attribs[ParsersAttributes::COLLATIONS]=getObjectsNames(ObjCollation, Catalog::parseArrayValues(attribs[ParsersAttributes::COLLATIONS])).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(OBJ_OPCLASS, + attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjOpClass, Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::COLUMNS]=getObjectsNames(OBJ_COLUMN, + attribs[ParsersAttributes::COLUMNS]=getObjectsNames(ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]), names[0], names[1]).join(ELEM_SEPARATOR); } void DatabaseExplorerWidget::formatPolicyAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::ROLES] = getObjectsNames(OBJ_ROLE, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::ROLES] = getObjectsNames(ObjRole, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ELEM_SEPARATOR); } QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) @@ -808,8 +808,8 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) QString oid=attribs[ParsersAttributes::OID], obj_name=DEP_NOT_FOUND.arg(oid), sch_name; - if(obj_type!=OBJ_TYPE) - obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME], obj_type==OBJ_OPERATOR); + if(obj_type!=ObjType) + obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME], obj_type==ObjOperator); else obj_name=attribs[ParsersAttributes::NAME]; @@ -817,7 +817,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) if(!attribs[ParsersAttributes::SCHEMA].isEmpty() && attribs[ParsersAttributes::SCHEMA]!=QString("0")) { - aux_attribs=catalog.getObjectAttributes(OBJ_SCHEMA, attribs[ParsersAttributes::SCHEMA].toUInt()); + aux_attribs=catalog.getObjectAttributes(ObjSchema, attribs[ParsersAttributes::SCHEMA].toUInt()); sch_name=BaseObject::formatName(aux_attribs[ParsersAttributes::NAME], false); if(!sch_name.isEmpty()) @@ -825,20 +825,20 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) } //Formatting paramenter types for function - if(obj_type==OBJ_FUNCTION) + if(obj_type==ObjFunction) { QStringList names, arg_types=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_TYPES]); for(int idx=0; idx < arg_types.size(); idx++) { - names=getObjectName(OBJ_TYPE, arg_types[idx]).split('.'); + names=getObjectName(ObjType, arg_types[idx]).split('.'); arg_types[idx]=names[names.size()-1]; } obj_name+=QString("(%1)").arg(arg_types.join(',')); } //Formatting paramenter types for operator - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) { QStringList arg_types, names; QString type_name; @@ -846,7 +846,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) for(QString attr : attrib_ids) { - names=getObjectName(OBJ_TYPE, attribs[attr]).split('.'); + names=getObjectName(ObjType, attribs[attr]).split('.'); type_name=names[names.size()-1]; if(type_name.isEmpty()) type_name=QString("-"); @@ -962,7 +962,7 @@ void DatabaseExplorerWidget::listObjects(void) root->setText(0, connection.getConnectionId(true)); root->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("server"))); root->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, -1); - root->setData(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole, BASE_OBJECT); + root->setData(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole, ObjBaseObject); root->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); root->addChild(curr_root); objects_trw->addTopLevelItem(root); @@ -1011,7 +1011,7 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); unsigned obj_id=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); - SnippetsConfigWidget::configureSnippetsMenu(&snippets_menu, { obj_type, BASE_OBJECT }); + SnippetsConfigWidget::configureSnippetsMenu(&snippets_menu, { obj_type, ObjBaseObject }); for(auto &act : handle_menu.actions()) handle_menu.removeAction(act); @@ -1020,24 +1020,24 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) if(obj_id > 0) { - if(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) + if(obj_type==ObjTable || obj_type==ObjView) handle_menu.addAction(show_data_action); handle_menu.addAction(properties_action); handle_menu.addAction(source_action); - if(obj_type!=OBJ_CAST && obj_type!=OBJ_DATABASE) + if(obj_type!=ObjCast && obj_type!=ObjDatabase) handle_menu.addAction(rename_action); - if(obj_type!=OBJ_DATABASE) + if(obj_type!=ObjDatabase) { handle_menu.addSeparator(); handle_menu.addAction(drop_action); - if(obj_type!=OBJ_ROLE && obj_type!=OBJ_TABLESPACE) + if(obj_type!=ObjRole && obj_type!=ObjTablespace) handle_menu.addAction(drop_cascade_action); - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) { handle_menu.addAction(truncate_action); handle_menu.addAction(trunc_cascade_action); @@ -1066,7 +1066,7 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) { openDataGrid(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString(), item->text(0), - item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()!=OBJ_VIEW); + item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()!=ObjView); } else if(exec_action) handleSelectedSnippet(exec_action->text()); @@ -1098,7 +1098,7 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) { QString obj_name; - if(obj_type!=OBJ_OPERATOR) + if(obj_type!=ObjOperator) obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME]); else obj_name=attribs[ParsersAttributes::NAME]; @@ -1137,7 +1137,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i attribs[BaseObject::getSchemaName(obj_type)]=ParsersAttributes::_TRUE_; //For cast, operator and function is needed to extract the name and the params types - if(obj_type==OBJ_OPERATOR || obj_type==OBJ_FUNCTION || obj_type==OBJ_CAST) + if(obj_type==ObjOperator || obj_type==ObjFunction || obj_type==ObjCast) { idx=obj_name.indexOf('('); idx1=obj_name.indexOf(')'); @@ -1145,26 +1145,26 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i types.removeAll(QString("-")); obj_name.remove(idx, obj_name.size()); } - else if(obj_type==OBJ_OPFAMILY || obj_type==OBJ_OPCLASS) + else if(obj_type==ObjOpFamily || obj_type==ObjOpClass) obj_name.remove(QRegExp("( )+(\\[)(.)+(\\])")); //Formatting the names - attribs[ParsersAttributes::NAME]=BaseObject::formatName(obj_name, obj_type==OBJ_OPERATOR); + attribs[ParsersAttributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjOperator); attribs[ParsersAttributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::OBJECT_TABLE, Qt::UserRole).toString()); attribs[ParsersAttributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString()); //For table objects the "table" attribute must be schema qualified - if(obj_type!=OBJ_INDEX && TableObject::isTableObject(obj_type)) + if(obj_type!=ObjIndex && TableObject::isTableObject(obj_type)) { attribs[ParsersAttributes::TABLE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::TABLE]; attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::NAME] + QString(" ON %1").arg(attribs[ParsersAttributes::TABLE]); } //For operators and functions there must exist the signature attribute - else if(obj_type==OBJ_OPERATOR || obj_type==OBJ_FUNCTION) + else if(obj_type==ObjOperator || obj_type==ObjFunction) attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::NAME] + QString("(%1)").arg(types.join(ELEM_SEPARATOR)); - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) attribs[ParsersAttributes::SIGNATURE]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); - else if(obj_type==OBJ_OPFAMILY || obj_type==OBJ_OPCLASS) + else if(obj_type==ObjOpFamily || obj_type==ObjOpClass) { attribs_map aux_attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).value(); attribs[ParsersAttributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[ParsersAttributes::NAME]).arg(aux_attribs[ParsersAttributes::INDEX_TYPE]); @@ -1173,7 +1173,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { /* If we are handling a view we need to append the MATERIALIZED keyword in the sql-object in order * to construct DDL commands correctly for this kind of object */ - if(obj_type==OBJ_VIEW) + if(obj_type==ObjView) { attribs_map aux_attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).value(); @@ -1181,7 +1181,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { attribs[ParsersAttributes::SQL_OBJECT] = QString("%1 %2").arg(ParsersAttributes::MATERIALIZED.toUpper()) - .arg(BaseObject::getSQLName(OBJ_VIEW)); + .arg(BaseObject::getSQLName(ObjView)); } } @@ -1208,7 +1208,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) QString obj_name=item->data(DatabaseImportForm::OBJECT_NAME, Qt::UserRole).toString(); //Roles and tablespaces can't be removed in cascade mode - if(cascade && (obj_type==OBJ_ROLE || obj_type==OBJ_TABLESPACE)) + if(cascade && (obj_type==ObjRole || obj_type==ObjTablespace)) return; if(!cascade) @@ -1229,7 +1229,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) attribs=extractAttributesFromItem(item); - if(obj_type==OBJ_OPERATOR || obj_type==OBJ_FUNCTION) + if(obj_type==ObjOperator || obj_type==ObjFunction) attribs[ParsersAttributes::SIGNATURE].replace(ELEM_SEPARATOR, QChar(',')); //Generate the drop command @@ -1294,7 +1294,7 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin Connection conn; SchemaParser schparser; - attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(OBJ_TABLE); + attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(ObjTable); attribs[ParsersAttributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : ""); attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::_TRUE_ : ""); @@ -1352,7 +1352,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) QApplication::setOverrideCursor(Qt::WaitCursor); - if(obj_type==OBJ_DATABASE) + if(obj_type==ObjDatabase) listObjects(); else { @@ -1370,12 +1370,12 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) } else { - if(obj_type==OBJ_SCHEMA || obj_type==OBJ_TABLE || obj_type == OBJ_VIEW) + if(obj_type==ObjSchema || obj_type==ObjTable || obj_type == ObjView) { root=item; root->takeChildren(); - if(obj_type == OBJ_SCHEMA) + if(obj_type == ObjSchema) sch_name=item->text(0); else tab_name=item->text(0); @@ -1391,7 +1391,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) configureImportHelper(); //Updates the group type only - if(obj_id==0 || (obj_type!=OBJ_TABLE && obj_type!=OBJ_VIEW && obj_type!=OBJ_SCHEMA)) + if(obj_id==0 || (obj_type!=ObjTable && obj_type!=ObjView && obj_type!=ObjSchema)) gen_items=DatabaseImportForm::updateObjectsTree(import_helper, objects_trw, { obj_type }, false, false, root, sch_name, tab_name, sort_column); else //Updates all child objcts when the selected object is a schema or table or view @@ -1399,7 +1399,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) BaseObject::getChildObjectTypes(obj_type), false, false, root, sch_name, tab_name, sort_column); //Creating dummy items for schemas and tables - if(obj_type==OBJ_SCHEMA || obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) + if(obj_type==ObjSchema || obj_type==ObjTable || obj_type==ObjView) { for(auto &item : gen_items) { @@ -1413,7 +1413,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) objects_trw->sortItems(sort_column, Qt::AscendingOrder); objects_trw->setCurrentItem(nullptr); - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) { objects_trw->blockSignals(true); objects_trw->setCurrentItem(item); @@ -1452,22 +1452,22 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) if(item == objects_trw->topLevelItem(0)) orig_attribs=catalog.getServerAttributes(); //Retrieve them from the catalog - else if(obj_type!=OBJ_COLUMN) + else if(obj_type!=ObjColumn) { orig_attribs=catalog.getObjectAttributes(obj_type, oid); - if(obj_type == OBJ_TABLE) + if(obj_type == ObjTable) { vector ref_fks; attribs_map ref_table, ref_schema; QStringList tab_list; - ref_fks = catalog.getObjectsAttributes(OBJ_CONSTRAINT, QString(), QString(), {}, {{ ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[ParsersAttributes::OID])}}); + ref_fks = catalog.getObjectsAttributes(ObjConstraint, QString(), QString(), {}, {{ ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[ParsersAttributes::OID])}}); for(auto &fk : ref_fks) { - ref_table = catalog.getObjectAttributes(OBJ_TABLE, fk[ParsersAttributes::TABLE].toUInt()); - ref_schema = catalog.getObjectAttributes(OBJ_SCHEMA, ref_table[ParsersAttributes::SCHEMA].toUInt()); + ref_table = catalog.getObjectAttributes(ObjTable, fk[ParsersAttributes::TABLE].toUInt()); + ref_schema = catalog.getObjectAttributes(ObjSchema, ref_table[ParsersAttributes::SCHEMA].toUInt()); tab_list.push_back(QString("%1.%2").arg(ref_schema[ParsersAttributes::NAME]).arg(ref_table[ParsersAttributes::NAME])); } @@ -1575,7 +1575,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) cached_attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA,Qt::UserRole).value(); - if(cached_attribs[ParsersAttributes::OBJECT_TYPE]==BaseObject::getSchemaName(OBJ_CONSTRAINT) && item->childCount()==0) + if(cached_attribs[ParsersAttributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjConstraint) && item->childCount()==0) { QTreeWidgetItem *fk_item=nullptr, *src_item=nullptr; @@ -1622,7 +1622,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } } } - else if(cached_attribs[ParsersAttributes::OBJECT_TYPE] == BaseObject::getSchemaName(OBJ_TABLE) && + else if(cached_attribs[ParsersAttributes::OBJECT_TYPE] == BaseObject::getSchemaName(ObjTable) && !cached_attribs[ParsersAttributes::REFERRERS].isEmpty() && item->childCount() == 5) { QTreeWidgetItem *refs_item=nullptr, *tab_item=nullptr; @@ -1672,7 +1672,7 @@ void DatabaseExplorerWidget::startObjectRename(QTreeWidgetItem *item) { ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); - if(obj_type!=OBJ_CAST && obj_type!=OBJ_DATABASE) + if(obj_type!=ObjCast && obj_type!=ObjDatabase) { item->setFlags(item->flags() | Qt::ItemIsEditable); objects_trw->openPersistentEditor(item); @@ -1696,7 +1696,7 @@ void DatabaseExplorerWidget::finishObjectRename(void) ObjectType obj_type=static_cast(rename_item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); objects_trw->closePersistentEditor(rename_item); - attribs[ParsersAttributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==OBJ_OPERATOR); + attribs[ParsersAttributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjOperator); //Generate the drop command schparser.ignoreEmptyAttributes(true); @@ -1772,7 +1772,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) tab_name=item->data(DatabaseImportForm::OBJECT_TABLE, Qt::UserRole).toString(); name=item->data(DatabaseImportForm::OBJECT_NAME, Qt::UserRole).toString(); - if(!sch_name.isEmpty() && obj_type!=OBJ_EXTENSION) + if(!sch_name.isEmpty() && obj_type!=ObjExtension) { if(tab_name.isEmpty()) name.prepend(sch_name + QChar('.')); @@ -1781,11 +1781,11 @@ void DatabaseExplorerWidget::loadObjectSource(void) } //Special case for columns. We will retrieve the table from database and then generate the code for the column - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { oid=item->parent()->parent()->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); is_column=true; - obj_type=OBJ_TABLE; + obj_type=ObjTable; } //Importing the object and its dependencies @@ -1796,12 +1796,12 @@ void DatabaseExplorerWidget::loadObjectSource(void) toggle_disp_menu.actions().at(1)->isChecked(), true, false, false, false, false); - import_hlp.setSelectedOIDs(&dbmodel, {{OBJ_DATABASE, {db_oid}}, {obj_type,{oid}}}, {}); + import_hlp.setSelectedOIDs(&dbmodel, {{ObjDatabase, {db_oid}}, {obj_type,{oid}}}, {}); sys_oid=import_hlp.getLastSystemOID(); //Currently pgModeler does not support the visualization of base types and built-in ones - if(obj_type==OBJ_TYPE && + if(obj_type==ObjType && (oid <= sys_oid || attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BASE_TYPE)) { source=trUtf8("-- Source code genaration for buil-in and base types currently unavailable --"); @@ -1811,13 +1811,13 @@ void DatabaseExplorerWidget::loadObjectSource(void) { import_hlp.importDatabase(); - if(obj_type==OBJ_DATABASE) + if(obj_type==ObjDatabase) source=getObjectSource(&dbmodel, &dbmodel); else { /* Fixing the signature of opclasses and opfamilies. The name is in form "name [index type]", so we change it to "name USING [index type]" */ - if(obj_type==OBJ_OPCLASS || obj_type==OBJ_OPFAMILY) + if(obj_type==ObjOpClass || obj_type==ObjOpFamily) { QString idx_type=item->text(0); @@ -1831,7 +1831,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) if(TableObject::isTableObject(obj_type) || is_column) { Table *table=nullptr; - table=dynamic_cast
(dbmodel.getObject(tab_name, OBJ_TABLE)); + table=dynamic_cast
(dbmodel.getObject(tab_name, ObjTable)); QTreeWidgetItem *table_item=nullptr; //If the table was imported then the source code of it will be placed on the respective item @@ -1846,7 +1846,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) //Generate the code of table children objects as ALTER commands table->setGenerateAlterCmds(true); - object=table->getObject(name, (is_column ? OBJ_COLUMN : obj_type)); + object=table->getObject(name, (is_column ? ObjColumn : obj_type)); } } else @@ -1870,7 +1870,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) sch_item->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, getObjectSource(schema, &dbmodel)); } - if(obj_type != OBJ_DATABASE) + if(obj_type != ObjDatabase) { //Generating the code for the database itself and storing it in the first child of the root item in the tree objects_trw->setCurrentItem(objects_trw->topLevelItem(0)); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 018371b899..3561290ba2 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -145,7 +145,7 @@ void DatabaseImportForm::updateProgress(int progress, QString msg, ObjectType ob progress_lbl->setText(msg); progress_pb->setValue(progress); - if(obj_type!=BASE_OBJECT) + if(obj_type!=ObjBaseObject) ico=QPixmap(PgModelerUiNS::getIconPath(obj_type)); else ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_info")); @@ -203,7 +203,7 @@ void DatabaseImportForm::importDatabase(void) settings_tbw->setCurrentIndex(1); getCheckedItems(obj_oids, col_oids); - obj_oids[OBJ_DATABASE].push_back(database_cmb->itemData(database_cmb->currentIndex()).value()); + obj_oids[ObjDatabase].push_back(database_cmb->itemData(database_cmb->currentIndex()).value()); if(create_model) { @@ -283,7 +283,7 @@ void DatabaseImportForm::getCheckedItems(map> &obj_ obj_type=static_cast((*itr)->data(OBJECT_TYPE, Qt::UserRole).value()); //If the object is not a column store it on general object list - if(obj_type!=OBJ_COLUMN) + if(obj_type!=ObjColumn) obj_oids[obj_type].push_back((*itr)->data(OBJECT_ID, Qt::UserRole).value()); //If its a column else @@ -588,7 +588,7 @@ void DatabaseImportForm::listDatabases(DatabaseImportHelper &import_helper, QCom QStringList list; map oids; - db_attribs=import_helper.getObjects(OBJ_DATABASE); + db_attribs=import_helper.getObjects(ObjDatabase); dbcombo->blockSignals(true); dbcombo->clear(); @@ -609,7 +609,7 @@ void DatabaseImportForm::listDatabases(DatabaseImportHelper &import_helper, QCom for(int i=0; i < list.count(); i++) { - dbcombo->setItemIcon(i, QPixmap(PgModelerUiNS::getIconPath(OBJ_DATABASE))); + dbcombo->setItemIcon(i, QPixmap(PgModelerUiNS::getIconPath(ObjDatabase))); dbcombo->setItemData(i, oids[list[i]]); } @@ -643,7 +643,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { task_prog_wgt.setWindowTitle(trUtf8("Retrieving objects from database...")); task_prog_wgt.show(); - task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), OBJ_DATABASE); + task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), ObjDatabase); } tree_wgt->clear(); @@ -657,19 +657,19 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW //Creating database item db_item=new QTreeWidgetItem; db_item->setText(0, import_helper.getCurrentDatabase()); - db_item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath(OBJ_DATABASE))); - attribs=catalog.getObjectsAttributes(OBJ_DATABASE, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); + db_item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath(ObjDatabase))); + attribs=catalog.getObjectsAttributes(ObjDatabase, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); db_item->setData(OBJECT_ID, Qt::UserRole, attribs[0].at(ParsersAttributes::OID).toUInt()); - db_item->setData(OBJECT_TYPE, Qt::UserRole, OBJ_DATABASE); - db_item->setData(OBJECT_TYPE, Qt::UserRole, OBJ_DATABASE); + db_item->setData(OBJECT_TYPE, Qt::UserRole, ObjDatabase); + db_item->setData(OBJECT_TYPE, Qt::UserRole, ObjDatabase); db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(ParsersAttributes::OID))); tree_wgt->addTopLevelItem(db_item); } //Retrieving and listing the cluster scoped objects sch_items=DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, - BaseObject::getChildObjectTypes(OBJ_DATABASE), + BaseObject::getChildObjectTypes(ObjDatabase), checkable_items, disable_empty_grps, db_item); if(create_dummy_item) @@ -684,17 +684,17 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW } else { - ObjectType obj_type = BASE_OBJECT; + ObjectType obj_type = ObjBaseObject; aux_prog=task_prog_wgt.progress_pb->value(); inc=40/static_cast(sch_items.size()); while(!sch_items.empty()) { - task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), OBJ_SCHEMA); + task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), ObjSchema); //Retrieving and listing the schema scoped objects tab_items=DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, - BaseObject::getChildObjectTypes(OBJ_SCHEMA), + BaseObject::getChildObjectTypes(ObjSchema), checkable_items, disable_empty_grps, sch_items.back(), sch_items.back()->text(0)); inc1=(60/static_cast(tab_items.size()))/static_cast(sch_items.size()); @@ -799,7 +799,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe label=name=attribs[ParsersAttributes::NAME]; //Removing the trailing type string from op. families or op. classes names - if(obj_type==OBJ_OPFAMILY || obj_type==OBJ_OPCLASS) + if(obj_type==ObjOpFamily || obj_type==ObjOpClass) { start=name.indexOf(QChar('[')); end=name.lastIndexOf(QChar(']')); @@ -817,8 +817,8 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe if(checkable_items) { if((oid > import_helper.getLastSystemOID()) || - (obj_type==OBJ_SCHEMA && name==QString("public")) || - (obj_type==OBJ_COLUMN && root && root->data(0, Qt::UserRole).toUInt() > import_helper.getLastSystemOID())) + (obj_type==ObjSchema && name==QString("public")) || + (obj_type==ObjColumn && root && root->data(0, Qt::UserRole).toUInt() > import_helper.getLastSystemOID())) { item->setCheckState(0, Qt::Checked); child_checked=true; @@ -827,16 +827,16 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setCheckState(0, Qt::Unchecked); //Disabling items that refers to PostgreSQL's built-in data types - if(obj_type==OBJ_TYPE && oid <= import_helper.getLastSystemOID()) + if(obj_type==ObjType && oid <= import_helper.getLastSystemOID()) { item->setDisabled(true); item->setToolTip(0, trUtf8("This is a PostgreSQL built-in data type and cannot be imported.")); } //Disabling items that refers to pgModeler's built-in system objects - else if((obj_type==OBJ_TABLESPACE && (name==QString("pg_default") || name==QString("pg_global"))) || - (obj_type==OBJ_ROLE && (name==QString("postgres"))) || - (obj_type==OBJ_SCHEMA && (name==QString("pg_catalog") || name==QString("public"))) || - (obj_type==OBJ_LANGUAGE && (name==~LanguageType(LanguageType::c) || + else if((obj_type==ObjTablespace && (name==QString("pg_default") || name==QString("pg_global"))) || + (obj_type==ObjRole && (name==QString("postgres"))) || + (obj_type==ObjSchema && (name==QString("pg_catalog") || name==QString("public"))) || + (obj_type==ObjLanguage && (name==~LanguageType(LanguageType::c) || name==~LanguageType(LanguageType::sql) || name==~LanguageType(LanguageType::plpgsql)))) { @@ -861,7 +861,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setData(OBJECT_SCHEMA, Qt::UserRole, schema); item->setData(OBJECT_TABLE, Qt::UserRole, table); - if(obj_type==OBJ_SCHEMA || obj_type == OBJ_TABLE || obj_type == OBJ_VIEW) + if(obj_type==ObjSchema || obj_type == ObjTable || obj_type == ObjView) items_vect.push_back(item); } diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index 1525fa5569..ada092e406 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -116,7 +116,7 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { /*! \brief Retrieve the specified objects from the database and insert them onto the tree view. The "root" parameter is used to associate the group of objects as child of it. The "schema" and "table" parameter are used to filter objects by schema and/or table. - This method automatically returns a list of QTreeWidgetItem when the vector "types" contains OBJ_SCHEMA or OBJ_TABLE or OBJ_VIEW */ + This method automatically returns a list of QTreeWidgetItem when the vector "types" contains ObjSchema or ObjTable or ObjView */ static vector updateObjectsTree(DatabaseImportHelper &import_helper, QTreeWidget *tree_wgt, vector types, bool checkable_items=false, bool disable_empty_grps=true, QTreeWidgetItem *root=nullptr, const QString &schema=QString(), const QString &table=QString(), unsigned sort_by = 0); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index c9acb9e742..65f196db16 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -159,8 +159,8 @@ void DatabaseImportHelper::swapSequencesTablesIds(void) itr=seq_tab_swap.begin(); while(itr!=seq_tab_swap.end()) { - sequence=dbmodel->getObject(getObjectName(itr->first), OBJ_SEQUENCE); - table=dbmodel->getObject(getObjectName(itr->second), OBJ_TABLE); + sequence=dbmodel->getObject(getObjectName(itr->first), ObjSequence); + table=dbmodel->getObject(getObjectName(itr->second), ObjTable); if(sequence && table) BaseObject::swapObjectsIds(sequence, table, false); itr++; @@ -173,8 +173,8 @@ void DatabaseImportHelper::retrieveSystemObjects(void) vector::iterator itr; map *obj_map=nullptr; vector objects; - ObjectType sys_objs[]={ OBJ_SCHEMA, OBJ_ROLE, OBJ_TABLESPACE, - OBJ_LANGUAGE, /* OBJ_COLLATION,*/ OBJ_TYPE }; + ObjectType sys_objs[]={ ObjSchema, ObjRole, ObjTablespace, + ObjLanguage, /* ObjCollation,*/ ObjType }; unsigned i=0, oid=0, cnt=sizeof(sys_objs)/sizeof(ObjectType); for(i=0; i < cnt && !import_canceled; i++) @@ -183,11 +183,11 @@ void DatabaseImportHelper::retrieveSystemObjects(void) trUtf8("Retrieving system objects... `%1'").arg(BaseObject::getTypeName(sys_objs[i])), sys_objs[i]); - if(sys_objs[i]!=OBJ_TYPE) + if(sys_objs[i]!=ObjType) { obj_map=&system_objs; - if(sys_objs[i]!=OBJ_LANGUAGE) + if(sys_objs[i]!=ObjLanguage) catalog.setFilter(Catalog::LIST_ONLY_SYS_OBJS); else catalog.setFilter(Catalog::LIST_ALL_OBJS); @@ -254,8 +254,8 @@ void DatabaseImportHelper::retrieveUserObjects(void) while(col_itr!=column_oids.end()) { emit s_progressUpdated(progress, - trUtf8("Retrieving objects... `%1'").arg(BaseObject::getTypeName(OBJ_COLUMN)), - OBJ_COLUMN); + trUtf8("Retrieving objects... `%1'").arg(BaseObject::getTypeName(ObjColumn)), + ObjColumn); names=getObjectName(QString::number(col_itr->first)).split("."); @@ -274,7 +274,7 @@ void DatabaseImportHelper::retrieveTableColumns(const QString &sch_name, const Q vector cols; unsigned tab_oid=0, col_oid; - cols=catalog.getObjectsAttributes(OBJ_COLUMN, sch_name, tab_name, col_ids); + cols=catalog.getObjectsAttributes(ObjColumn, sch_name, tab_name, col_ids); for(auto &itr : cols) { @@ -309,7 +309,7 @@ void DatabaseImportHelper::createObjects(void) { /* Constraints are ignored in these phase being pushed into an auxiliary list in order to be created later */ - if(obj_type!=OBJ_CONSTRAINT) + if(obj_type!=ObjConstraint) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2), oid `%3'...") .arg(attribs[ParsersAttributes::NAME]) @@ -386,7 +386,7 @@ void DatabaseImportHelper::createObjects(void) if(tries >= max_tries) emit s_progressUpdated(progress, trUtf8("Import failed to recreate some objects in `%1' tries.").arg(max_tries), - BASE_OBJECT); + ObjBaseObject); if(!import_canceled) { @@ -427,8 +427,8 @@ void DatabaseImportHelper::createConstraints(void) emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2)...") .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(OBJ_CONSTRAINT)), - OBJ_CONSTRAINT); + .arg(BaseObject::getTypeName(ObjConstraint)), + ObjConstraint); createObject(attribs); } @@ -464,7 +464,7 @@ void DatabaseImportHelper::createPermissions(void) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); emit s_progressUpdated(progress, msg.arg(getObjectName(attribs[ParsersAttributes::OID])) - .arg(BaseObject::getTypeName(obj_type)), OBJ_PERMISSION); + .arg(BaseObject::getTypeName(obj_type)), ObjPermission); createPermission(attribs); itr_obj++; @@ -472,7 +472,7 @@ void DatabaseImportHelper::createPermissions(void) progress=((i++)/static_cast(obj_perms.size())) * 100; } - emit s_progressUpdated(progress, trUtf8("Creating columns permissions..."), OBJ_PERMISSION); + emit s_progressUpdated(progress, trUtf8("Creating columns permissions..."), ObjPermission); //Create the column level permission i=0; while(itr_cols!=col_perms.end() && !import_canceled) @@ -485,7 +485,7 @@ void DatabaseImportHelper::createPermissions(void) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); emit s_progressUpdated(progress, msg.arg(getObjectName(attribs[ParsersAttributes::OID])) - .arg(BaseObject::getTypeName(obj_type)), OBJ_PERMISSION); + .arg(BaseObject::getTypeName(obj_type)), ObjPermission); createPermission(attribs); itr++; @@ -511,9 +511,9 @@ void DatabaseImportHelper::updateFKRelationships(void) unsigned i=0, count=0; Table *tab=nullptr; - itr_tab=dbmodel->getObjectList(OBJ_TABLE)->begin(); - itr_tab_end=dbmodel->getObjectList(OBJ_TABLE)->end(); - count=dbmodel->getObjectList(OBJ_TABLE)->size(); + itr_tab=dbmodel->getObjectList(ObjTable)->begin(); + itr_tab_end=dbmodel->getObjectList(ObjTable)->end(); + count=dbmodel->getObjectList(ObjTable)->size(); i=0; try @@ -525,8 +525,8 @@ void DatabaseImportHelper::updateFKRelationships(void) emit s_progressUpdated(progress, trUtf8("Updating relationships of `%1' (%2)...") .arg(tab->getName()) - .arg(BaseObject::getTypeName(OBJ_TABLE)), - OBJ_TABLE); + .arg(BaseObject::getTypeName(ObjTable)), + ObjTable); dbmodel->updateTableFKRelationships(tab); @@ -564,7 +564,7 @@ void DatabaseImportHelper::importDatabase(void) if(!inherited_cols.empty()) { - emit s_progressUpdated(100, trUtf8("Validating relationships..."), OBJ_RELATIONSHIP); + emit s_progressUpdated(100, trUtf8("Validating relationships..."), ObjRelationship); dbmodel->validateRelationships(); } @@ -611,7 +611,7 @@ void DatabaseImportHelper::importDatabase(void) vector *rels=nullptr; vector::iterator itr, itr_end; std::uniform_int_distribution dist(0,255); - ObjectType rel_type[]={ OBJ_RELATIONSHIP, BASE_RELATIONSHIP }; + ObjectType rel_type[]={ ObjRelationship, ObjBaseRelationship }; BaseRelationship *rel=nullptr; for(unsigned i=0; i < 2; i++) @@ -633,7 +633,7 @@ void DatabaseImportHelper::importDatabase(void) } //Forcing the update of tables and views in order to correctly draw their titles without the schema's name - dbmodel->setObjectsModified({ OBJ_TABLE, OBJ_VIEW }); + dbmodel->setObjectsModified({ ObjTable, ObjView }); } resetImportParameters(); @@ -661,7 +661,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) { unsigned oid=attribs[ParsersAttributes::OID].toUInt(); ObjectType obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); - QString obj_name=getObjectName(attribs[ParsersAttributes::OID], (obj_type==OBJ_FUNCTION || obj_type==OBJ_OPERATOR)); + QString obj_name=getObjectName(attribs[ParsersAttributes::OID], (obj_type==ObjFunction || obj_type==ObjOperator)); //Avoiding the creation of pgModeler's temp objects created in database during the catalog reading if(obj_name.contains(Catalog::PGMODELER_TEMP_DB_OBJ)) @@ -670,7 +670,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) try { if(!import_canceled && - (obj_type==OBJ_DATABASE || TableObject::isTableObject(obj_type) || + (obj_type==ObjDatabase || TableObject::isTableObject(obj_type) || //If the object does not exists on both model and created objects vector ((std::find(created_objs.begin(), created_objs.end(), oid)==created_objs.end()) && @@ -684,13 +684,13 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) attribs[ParsersAttributes::COMMENT]=getComment(attribs); if(attribs.count(ParsersAttributes::OWNER)) - attribs[ParsersAttributes::OWNER]=getDependencyObject(attribs[ParsersAttributes::OWNER], OBJ_ROLE, false, auto_resolve_deps); + attribs[ParsersAttributes::OWNER]=getDependencyObject(attribs[ParsersAttributes::OWNER], ObjRole, false, auto_resolve_deps); if(attribs.count(ParsersAttributes::TABLESPACE)) - attribs[ParsersAttributes::TABLESPACE]=getDependencyObject(attribs[ParsersAttributes::TABLESPACE], OBJ_TABLESPACE, false, auto_resolve_deps); + attribs[ParsersAttributes::TABLESPACE]=getDependencyObject(attribs[ParsersAttributes::TABLESPACE], ObjTablespace, false, auto_resolve_deps); if(attribs.count(ParsersAttributes::SCHEMA)) - attribs[ParsersAttributes::SCHEMA]=getDependencyObject(attribs[ParsersAttributes::SCHEMA], OBJ_SCHEMA, false, auto_resolve_deps); + attribs[ParsersAttributes::SCHEMA]=getDependencyObject(attribs[ParsersAttributes::SCHEMA], ObjSchema, false, auto_resolve_deps); /* Due to the object recreation mechanism there are some situations when pgModeler fails to recreate them due to the duplication of permissions. So, to avoid this problem we need to check if the OID of the @@ -707,31 +707,31 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) switch(obj_type) { - case OBJ_DATABASE: configureDatabase(attribs); break; - case OBJ_TABLESPACE: createTablespace(attribs); break; - case OBJ_SCHEMA: createSchema(attribs); break; - case OBJ_ROLE: createRole(attribs); break; - case OBJ_DOMAIN: createDomain(attribs); break; - case OBJ_EXTENSION: createExtension(attribs); break; - case OBJ_FUNCTION: createFunction(attribs); break; - case OBJ_LANGUAGE: createLanguage(attribs); break; - case OBJ_OPFAMILY: createOperatorFamily(attribs); break; - case OBJ_OPCLASS: createOperatorClass(attribs); break; - case OBJ_OPERATOR: createOperator(attribs); break; - case OBJ_COLLATION: createCollation(attribs); break; - case OBJ_CAST: createCast(attribs); break; - case OBJ_CONVERSION: createConversion(attribs); break; - case OBJ_SEQUENCE: createSequence(attribs); break; - case OBJ_AGGREGATE: createAggregate(attribs); break; - case OBJ_TYPE: createType(attribs); break; - case OBJ_TABLE: createTable(attribs); break; - case OBJ_VIEW: createView(attribs); break; - case OBJ_RULE: createRule(attribs); break; - case OBJ_TRIGGER: createTrigger(attribs); break; - case OBJ_INDEX: createIndex(attribs); break; - case OBJ_CONSTRAINT: createConstraint(attribs); break; - case OBJ_POLICY: createPolicy(attribs); break; - case OBJ_EVENT_TRIGGER: createEventTrigger(attribs); break; + case ObjDatabase: configureDatabase(attribs); break; + case ObjTablespace: createTablespace(attribs); break; + case ObjSchema: createSchema(attribs); break; + case ObjRole: createRole(attribs); break; + case ObjDomain: createDomain(attribs); break; + case ObjExtension: createExtension(attribs); break; + case ObjFunction: createFunction(attribs); break; + case ObjLanguage: createLanguage(attribs); break; + case ObjOpFamily: createOperatorFamily(attribs); break; + case ObjOpClass: createOperatorClass(attribs); break; + case ObjOperator: createOperator(attribs); break; + case ObjCollation: createCollation(attribs); break; + case ObjCast: createCast(attribs); break; + case ObjConversion: createConversion(attribs); break; + case ObjSequence: createSequence(attribs); break; + case ObjAggregate: createAggregate(attribs); break; + case ObjType: createType(attribs); break; + case ObjTable: createTable(attribs); break; + case ObjView: createView(attribs); break; + case ObjRule: createRule(attribs); break; + case ObjTrigger: createTrigger(attribs); break; + case ObjIndex: createIndex(attribs); break; + case ObjConstraint: createConstraint(attribs); break; + case ObjPolicy: createPolicy(attribs); break; + case ObjEventTrigger: createEventTrigger(attribs); break; default: if(debug_mode) @@ -822,7 +822,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType /* If the attributes of the dependency exists but it was not created on the model yet, pgModeler will create it and it's dependencies recursively */ if(recursive_dep_res && !TableObject::isTableObject(obj_type) && - obj_type!=OBJ_DATABASE && dbmodel->getObjectIndex(obj_attr[ParsersAttributes::NAME], obj_type) < 0) + obj_type!=ObjDatabase && dbmodel->getObjectIndex(obj_attr[ParsersAttributes::NAME], obj_type) < 0) createObject(obj_attr); if(use_signature) @@ -927,7 +927,7 @@ void DatabaseImportHelper::createTablespace(attribs_map &attribs) try { - loadObjectXML(OBJ_TABLESPACE, attribs); + loadObjectXML(ObjTablespace, attribs); tabspc=dbmodel->createTablespace(); dbmodel->addObject(tabspc); } @@ -949,7 +949,7 @@ void DatabaseImportHelper::createSchema(attribs_map &attribs) attribs[ParsersAttributes::FILL_COLOR]=QColor(dist(rand_num_engine), dist(rand_num_engine), dist(rand_num_engine)).name(); - loadObjectXML(OBJ_SCHEMA, attribs); + loadObjectXML(ObjSchema, attribs); schema=dbmodel->createSchema(); dbmodel->addObject(schema); @@ -975,7 +975,7 @@ void DatabaseImportHelper::createRole(attribs_map &attribs) for(unsigned i=0; i < 3; i++) attribs[role_types[i]]=getObjectNames(attribs[role_types[i]]).join(','); - loadObjectXML(OBJ_ROLE, attribs); + loadObjectXML(ObjRole, attribs); role=dbmodel->createRole(); dbmodel->addObject(role); } @@ -1016,8 +1016,8 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) } attribs[ParsersAttributes::TYPE]=getType(attribs[ParsersAttributes::TYPE], true, attribs); - attribs[ParsersAttributes::COLLATION]=getDependencyObject(attribs[ParsersAttributes::COLLATION], OBJ_COLLATION); - loadObjectXML(OBJ_DOMAIN, attribs); + attribs[ParsersAttributes::COLLATION]=getDependencyObject(attribs[ParsersAttributes::COLLATION], ObjCollation); + loadObjectXML(ObjDomain, attribs); dom=dbmodel->createDomain(); dbmodel->addDomain(dom); } @@ -1035,7 +1035,7 @@ void DatabaseImportHelper::createExtension(attribs_map &attribs) try { - loadObjectXML(OBJ_EXTENSION, attribs); + loadObjectXML(ObjExtension, attribs); ext=dbmodel->createExtension(); dbmodel->addExtension(ext); } @@ -1148,7 +1148,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) } //Get the language reference code - attribs[ParsersAttributes::LANGUAGE]=getDependencyObject(attribs[ParsersAttributes::LANGUAGE], OBJ_LANGUAGE); + attribs[ParsersAttributes::LANGUAGE]=getDependencyObject(attribs[ParsersAttributes::LANGUAGE], ObjLanguage); //Get the return type if there is no return table configured if(attribs[ParsersAttributes::RETURN_TABLE].isEmpty()) @@ -1163,7 +1163,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) attribs[ParsersAttributes::RETURN_TYPE]=getType(attribs[ParsersAttributes::RETURN_TYPE], true); } - loadObjectXML(OBJ_FUNCTION, attribs); + loadObjectXML(ObjFunction, attribs); func=dbmodel->createFunction(); dbmodel->addFunction(func); } @@ -1195,12 +1195,12 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) function is defined after the language pgModeler will raise errors so in order to continue the import these fuctions are simply ignored */ if(func_oid < lang_oid) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], OBJ_FUNCTION, true , true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjFunction, true , true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); else attribs[func_types[i]]=QString(); } - loadObjectXML(OBJ_LANGUAGE, attribs); + loadObjectXML(ObjLanguage, attribs); lang=dbmodel->createLanguage(); dbmodel->addLanguage(lang); } @@ -1218,7 +1218,7 @@ void DatabaseImportHelper::createOperatorFamily(attribs_map &attribs) try { - loadObjectXML(OBJ_OPFAMILY, attribs); + loadObjectXML(ObjOpFamily, attribs); opfam=dbmodel->createOperatorFamily(); dbmodel->addOperatorFamily(opfam); } @@ -1269,7 +1269,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) { list=array_vals[i].split(':'); elem_attr[ParsersAttributes::STRATEGY_NUM]=list[0]; - elem_attr[ParsersAttributes::DEFINITION]=getDependencyObject(list[1], OBJ_FUNCTION, true); + elem_attr[ParsersAttributes::DEFINITION]=getDependencyObject(list[1], ObjFunction, true); elems.push_back(elem_attr); } } @@ -1286,8 +1286,8 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) list=array_vals[i].split(':'); elem_attr[ParsersAttributes::DEFINITION]=""; elem_attr[ParsersAttributes::STRATEGY_NUM]=list[0]; - elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[1], OBJ_OPERATOR, true); - elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[2], OBJ_OPFAMILY, true); + elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[1], ObjOperator, true); + elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[2], ObjOpFamily, true); elems.push_back(elem_attr); } } @@ -1300,7 +1300,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) schparser.ignoreUnkownAttributes(false); } - loadObjectXML(OBJ_OPCLASS, attribs); + loadObjectXML(ObjOpClass, attribs); opclass=dbmodel->createOperatorClass(); dbmodel->addOperatorClass(opclass); } @@ -1333,7 +1333,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) ParsersAttributes::NEGATOR_OP }; for(unsigned i=0; i < 3; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], OBJ_FUNCTION, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjFunction, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); for(unsigned i=0; i < 2; i++) attribs[arg_types[i]]=getType(attribs[arg_types[i]], true, {{ParsersAttributes::REF_TYPE, arg_types[i]}}); @@ -1341,7 +1341,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) regexp.setPattern(ParsersAttributes::SIGNATURE + QString("(=)(\")")); for(unsigned i=0; i < 2; i++) { - attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], OBJ_OPERATOR, true, false, true, {{ParsersAttributes::REF_TYPE, op_types[i]}}); + attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjOperator, true, false, true, {{ParsersAttributes::REF_TYPE, op_types[i]}}); if(!attribs[op_types[i]].isEmpty()) { @@ -1354,12 +1354,12 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) op_signature=attribs[op_types[i]].mid(pos, (attribs[op_types[i]].indexOf('"',pos) - pos)); //If the operator is not defined clear up the reference to it - if(dbmodel->getObjectIndex(op_signature, OBJ_OPERATOR) < 0) + if(dbmodel->getObjectIndex(op_signature, ObjOperator) < 0) attribs[op_types[i]].clear(); } } - loadObjectXML(OBJ_OPERATOR, attribs); + loadObjectXML(ObjOperator, attribs); oper=dbmodel->createOperator(); dbmodel->addOperator(oper); } @@ -1377,7 +1377,7 @@ void DatabaseImportHelper::createCollation(attribs_map &attribs) try { - loadObjectXML(OBJ_COLLATION, attribs); + loadObjectXML(ObjCollation, attribs); coll=dbmodel->createCollation(); dbmodel->addCollation(coll); } @@ -1395,10 +1395,10 @@ void DatabaseImportHelper::createCast(attribs_map &attribs) try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], OBJ_FUNCTION, true); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjFunction, true); attribs[ParsersAttributes::SOURCE_TYPE]=getType(attribs[ParsersAttributes::SOURCE_TYPE], true); attribs[ParsersAttributes::DEST_TYPE]=getType(attribs[ParsersAttributes::DEST_TYPE], true); - loadObjectXML(OBJ_CAST, attribs); + loadObjectXML(ObjCast, attribs); cast=dbmodel->createCast(); dbmodel->addCast(cast); } @@ -1416,8 +1416,8 @@ void DatabaseImportHelper::createConversion(attribs_map &attribs) try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], OBJ_FUNCTION, true, auto_resolve_deps); - loadObjectXML(OBJ_CONVERSION, attribs); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjFunction, true, auto_resolve_deps); + loadObjectXML(ObjConversion, attribs); conv=dbmodel->createConversion(); dbmodel->addConversion(conv); } @@ -1460,7 +1460,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) /* Get the table and the owner column instances so the sequence code can be disabled if the column is an identity one */ - tab_name = getDependencyObject(owner_col[0], OBJ_TABLE, true, auto_resolve_deps, false, + tab_name = getDependencyObject(owner_col[0], ObjTable, true, auto_resolve_deps, false, {{ ParsersAttributes::POSITION, schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XML_DEFINITION)}}); @@ -1474,7 +1474,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) for(int i=0; i < seq_attribs.size(); i++) attribs[attr[i]]=seq_attribs[i]; - loadObjectXML(OBJ_SEQUENCE, attribs); + loadObjectXML(ObjSequence, attribs); seq=dbmodel->createSequence(); dbmodel->addSequence(seq); @@ -1506,7 +1506,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) sch_name; for(unsigned i=0; i < 2; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], OBJ_FUNCTION, true, auto_resolve_deps, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjFunction, true, auto_resolve_deps, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); types=getTypes(attribs[ParsersAttributes::TYPES], true); attribs[ParsersAttributes::TYPES]=QString(); @@ -1519,9 +1519,9 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) attribs[ParsersAttributes::STATE_TYPE]=getType(attribs[ParsersAttributes::STATE_TYPE], true, {{ParsersAttributes::REF_TYPE, ParsersAttributes::STATE_TYPE}}); - attribs[ParsersAttributes::SORT_OP]=getDependencyObject(attribs[ParsersAttributes::SORT_OP], OBJ_OPERATOR, true); + attribs[ParsersAttributes::SORT_OP]=getDependencyObject(attribs[ParsersAttributes::SORT_OP], ObjOperator, true); - loadObjectXML(OBJ_AGGREGATE, attribs); + loadObjectXML(ObjAggregate, attribs); agg=dbmodel->createAggregate(); dbmodel->addAggregate(agg); @@ -1570,7 +1570,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { type_attrib.setName(values[0].remove('"')); type_attrib.setType(PgSQLType::parseString(values[1].remove('\\'))); - type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), OBJ_COLLATION)); + type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjCollation)); attribs[ParsersAttributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XML_DEFINITION); } } @@ -1580,10 +1580,10 @@ void DatabaseImportHelper::createType(attribs_map &attribs) QStringList range_attr=Catalog::parseArrayValues(attribs[ParsersAttributes::RANGE_ATTRIBS]); attribs[ParsersAttributes::SUBTYPE]=getType(range_attr[0], true); - attribs[ParsersAttributes::COLLATION]=getDependencyObject(range_attr[1], OBJ_COLLATION, true); - attribs[ParsersAttributes::OP_CLASS]=getDependencyObject(range_attr[2], OBJ_OPCLASS, true); - attribs[ParsersAttributes::CANONICAL_FUNC]=getDependencyObject(range_attr[3], OBJ_FUNCTION, true); - attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], OBJ_FUNCTION, true); + attribs[ParsersAttributes::COLLATION]=getDependencyObject(range_attr[1], ObjCollation, true); + attribs[ParsersAttributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjOpClass, true); + attribs[ParsersAttributes::CANONICAL_FUNC]=getDependencyObject(range_attr[3], ObjFunction, true); + attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjFunction, true); } else { @@ -1605,7 +1605,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { for(i=0; i < count; i++) { - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], OBJ_FUNCTION, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjFunction, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); /* Since pgModeler requires that type functions refers to the constructing type as "any" it's necessary to replace the function parameter types names */ @@ -1614,7 +1614,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) } } - loadObjectXML(OBJ_TYPE, attribs); + loadObjectXML(ObjType, attribs); type=dbmodel->createType(); dbmodel->addType(type); } @@ -1709,13 +1709,13 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) the non-array type, this way, if the original type is created there is no need to create the array form */ if(auto_resolve_deps && !is_type_registered && !type_name.contains(QString("[]"))) { - type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], OBJ_TYPE); + type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjType); unknown_obj_xml=UNKNOWN_OBJECT_OID_XML.arg(type_oid); /* If the type still doesn't exists means that the column maybe is referencing a domain this way pgModeler will try to retrieve the mentionend object */ if(type_def==unknown_obj_xml) - type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], OBJ_DOMAIN); + type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjDomain); } col.setIdentityType(BaseType::null); @@ -1759,15 +1759,15 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) //Checking if the collation used by the column exists, if not it'll be created when auto_resolve_deps is checked if(auto_resolve_deps && !itr->second[ParsersAttributes::COLLATION].isEmpty()) - getDependencyObject(itr->second[ParsersAttributes::COLLATION], OBJ_COLLATION); + getDependencyObject(itr->second[ParsersAttributes::COLLATION], ObjCollation); - col.setCollation(dbmodel->getObject(getObjectName(itr->second[ParsersAttributes::COLLATION]),OBJ_COLLATION)); + col.setCollation(dbmodel->getObject(getObjectName(itr->second[ParsersAttributes::COLLATION]),ObjCollation)); attribs[ParsersAttributes::COLUMNS]+=col.getCodeDefinition(SchemaParser::XML_DEFINITION); itr++; col_idx++; } - loadObjectXML(OBJ_TABLE, attribs); + loadObjectXML(ObjTable, attribs); table=dbmodel->createTable(); for(unsigned col_idx : inh_cols) @@ -1782,7 +1782,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) Table *partitioned_tab = nullptr; attribs[ParsersAttributes::PARTITIONED_TABLE] = - getDependencyObject(attribs[ParsersAttributes::PARTITIONED_TABLE], OBJ_TABLE, true, auto_resolve_deps, false); + getDependencyObject(attribs[ParsersAttributes::PARTITIONED_TABLE], ObjTable, true, auto_resolve_deps, false); partitioned_tab = dbmodel->getTable(attribs[ParsersAttributes::PARTITIONED_TABLE]); table->setPartionedTable(partitioned_tab); @@ -1790,8 +1790,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(!partitioned_tab) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(OBJ_TABLE)) - .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(OBJ_TABLE)), + .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjTable)) + .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjTable)), RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1831,8 +1831,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) // Retriving the collation for the partion key if(i < collations.size() && collations[i] != QString("0")) { - coll_name = getDependencyObject(collations[i], OBJ_COLLATION, false, true, false); - coll = dynamic_cast(dbmodel->getObject(coll_name, OBJ_COLLATION)); + coll_name = getDependencyObject(collations[i], ObjCollation, false, true, false); + coll = dynamic_cast(dbmodel->getObject(coll_name, ObjCollation)); //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" if(coll && (!coll->isSystemObject() || @@ -1843,8 +1843,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) // Retriving the operator class for the partion key if(i < opclasses.size() && opclasses[i] != QString("0")) { - opc_name = getDependencyObject(opclasses[i], OBJ_OPCLASS, true, true, false); - opclass = dynamic_cast(dbmodel->getObject(opc_name, OBJ_OPCLASS)); + opc_name = getDependencyObject(opclasses[i], ObjOpClass, true, true, false); + opclass = dynamic_cast(dbmodel->getObject(opc_name, ObjOpClass)); if(opclass) part_key.setOperatorClass(opclass); @@ -1883,7 +1883,7 @@ void DatabaseImportHelper::createView(attribs_map &attribs) ref.setDefinitionExpression(true); attribs[ParsersAttributes::REFERENCES]=ref.getXMLDefinition(); - loadObjectXML(OBJ_VIEW, attribs); + loadObjectXML(ObjView, attribs); view=dbmodel->createView(); dbmodel->addView(view); @@ -1903,7 +1903,7 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) QString cmds=attribs[ParsersAttributes::COMMANDS]; int start=-1; QRegExp cond_regexp(QString("(WHERE)(.)+(DO)")); - ObjectType table_type=OBJ_TABLE; + ObjectType table_type=ObjTable; try { @@ -1916,12 +1916,12 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) attribs[ParsersAttributes::COMMANDS]=Catalog::parseRuleCommands(attribs[ParsersAttributes::COMMANDS]).join(';'); - if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(OBJ_VIEW)) - table_type=OBJ_VIEW; + if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjView)) + table_type=ObjView; attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); - loadObjectXML(OBJ_RULE, attribs); + loadObjectXML(ObjRule, attribs); rule=dbmodel->createRule(); } catch(Exception &e) @@ -1936,16 +1936,16 @@ void DatabaseImportHelper::createTrigger(attribs_map &attribs) { try { - ObjectType table_type=OBJ_TABLE; + ObjectType table_type=ObjTable; - if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(OBJ_VIEW)) - table_type=OBJ_VIEW; + if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjView)) + table_type=ObjView; attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); - attribs[ParsersAttributes::TRIGGER_FUNC]=getDependencyObject(attribs[ParsersAttributes::TRIGGER_FUNC], OBJ_FUNCTION, true, true); + attribs[ParsersAttributes::TRIGGER_FUNC]=getDependencyObject(attribs[ParsersAttributes::TRIGGER_FUNC], ObjFunction, true, true); attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS].remove(QString(",\"\""))).join(','); - loadObjectXML(OBJ_TRIGGER, attribs); + loadObjectXML(ObjTrigger, attribs); dbmodel->createTrigger(); } catch(Exception &e) @@ -2011,18 +2011,18 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) int i; attribs[ParsersAttributes::FACTOR]=QString("90"); - tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE, true, auto_resolve_deps, false); - parent_tab=dynamic_cast(dbmodel->getObject(tab_name, OBJ_TABLE)); + tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjTable, true, auto_resolve_deps, false); + parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjTable)); if(!parent_tab) { - tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], OBJ_VIEW, true, auto_resolve_deps, false); - parent_tab=dynamic_cast(dbmodel->getObject(tab_name, OBJ_VIEW)); + tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjView, true, auto_resolve_deps, false); + parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjView)); if(!parent_tab) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(OBJ_INDEX)) - .arg(tab_name).arg(BaseObject::getTypeName(OBJ_TABLE)), + .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjIndex)) + .arg(tab_name).arg(BaseObject::getTypeName(ObjTable)), RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -2037,7 +2037,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(cols[i]!=QString("0")) { - if(parent_tab->getObjectType() == OBJ_TABLE) + if(parent_tab->getObjectType() == ObjTable) elem.setColumn(dynamic_cast
(parent_tab)->getColumn(getColumnName(attribs[ParsersAttributes::TABLE], cols[i]))); else elem.setExpression(getColumnName(attribs[ParsersAttributes::TABLE], cols[i])); @@ -2050,8 +2050,8 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(i < collations.size() && collations[i]!=QString("0")) { - coll_name=getDependencyObject(collations[i], OBJ_COLLATION, false, true, false); - coll=dynamic_cast(dbmodel->getObject(coll_name, OBJ_COLLATION)); + coll_name=getDependencyObject(collations[i], ObjCollation, false, true, false); + coll=dynamic_cast(dbmodel->getObject(coll_name, ObjCollation)); //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" if(coll && (!coll->isSystemObject() || @@ -2061,8 +2061,8 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(i < opclasses.size() && opclasses[i]!=QString("0")) { - opc_name=getDependencyObject(opclasses[i], OBJ_OPCLASS, true, true, false); - opclass=dynamic_cast(dbmodel->getObject(opc_name, OBJ_OPCLASS)); + opc_name=getDependencyObject(opclasses[i], ObjOpClass, true, true, false); + opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjOpClass)); if(opclass) elem.setOperatorClass(opclass); @@ -2073,7 +2073,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) } attribs[ParsersAttributes::TABLE]=tab_name; - loadObjectXML(OBJ_INDEX, attribs); + loadObjectXML(ObjIndex, attribs); dbmodel->createIndex(); } catch(Exception &e) @@ -2100,13 +2100,13 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) QStringList factor=Catalog::parseArrayValues(attribs[ParsersAttributes::FACTOR]); //Retrieving the table is it was not imported yet and auto_resolve_deps is true - tab_name=getDependencyObject(table_oid, OBJ_TABLE, true, auto_resolve_deps, false); + tab_name=getDependencyObject(table_oid, ObjTable, true, auto_resolve_deps, false); if(!factor.isEmpty() && factor[0].startsWith(QString("fillfactor="))) attribs[ParsersAttributes::FACTOR]=factor[0].remove(QString("fillfactor=")); attribs[attribs[ParsersAttributes::TYPE]]=ParsersAttributes::_TRUE_; - table=dynamic_cast
(dbmodel->getObject(tab_name, OBJ_TABLE)); + table=dynamic_cast
(dbmodel->getObject(tab_name, ObjTable)); if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::EX_CONSTR) { @@ -2147,8 +2147,8 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) if(i < opclasses.size() && opclasses[i]!=QString("0")) { - opc_name=getDependencyObject(opclasses[i], OBJ_OPCLASS, true, true, false); - opclass=dynamic_cast(dbmodel->getObject(opc_name, OBJ_OPCLASS)); + opc_name=getDependencyObject(opclasses[i], ObjOpClass, true, true, false); + opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjOpClass)); if(opclass) elem.setOperatorClass(opclass); @@ -2156,8 +2156,8 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) if(i < opers.size() && opers[i]!=QString("0")) { - op_name=getDependencyObject(opers[i], OBJ_OPERATOR, true, true, false); - oper=dynamic_cast(dbmodel->getObject(op_name, OBJ_OPERATOR)); + op_name=getDependencyObject(opers[i], ObjOperator, true, true, false); + oper=dynamic_cast(dbmodel->getObject(op_name, ObjOperator)); if(oper) elem.setOperator(oper); @@ -2175,11 +2175,11 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) attribs[ParsersAttributes::SRC_COLUMNS]=getColumnNames(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::SRC_COLUMNS]).join(','); } - attribs[ParsersAttributes::REF_TABLE]=getDependencyObject(ref_tab_oid, OBJ_TABLE, false, true, false); + attribs[ParsersAttributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjTable, false, true, false); attribs[ParsersAttributes::DST_COLUMNS]=getColumnNames(ref_tab_oid, attribs[ParsersAttributes::DST_COLUMNS]).join(','); attribs[ParsersAttributes::TABLE]=tab_name; - loadObjectXML(OBJ_CONSTRAINT, attribs); + loadObjectXML(ObjConstraint, attribs); constr=dbmodel->createConstraint(nullptr); if(table && constr->getConstraintType()==ConstraintType::primary_key) @@ -2200,9 +2200,9 @@ void DatabaseImportHelper::createPolicy(attribs_map &attribs) { try { - attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], OBJ_TABLE, true, auto_resolve_deps, false); + attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjTable, true, auto_resolve_deps, false); attribs[ParsersAttributes::ROLES]=getObjectNames(attribs[ParsersAttributes::ROLES]).join(','); - loadObjectXML(OBJ_POLICY, attribs); + loadObjectXML(ObjPolicy, attribs); dbmodel->createPolicy(); } catch(Exception &e) @@ -2216,14 +2216,14 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) { try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], OBJ_FUNCTION, true, true); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjFunction, true, true); attribs[ParsersAttributes::FILTER]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") .arg(ParsersAttributes::FILTER) .arg(ParsersAttributes::VARIABLE).arg(ParsersAttributes::TAG.toUpper()) .arg(ParsersAttributes::VALUES) .arg(Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES].remove('"')).join(',')); - loadObjectXML(OBJ_EVENT_TRIGGER, attribs); + loadObjectXML(ObjEventTrigger, attribs); dbmodel->addEventTrigger(dbmodel->createEventTrigger()); } catch(Exception &e) @@ -2253,9 +2253,9 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) if(!perm_list.isEmpty()) { - if(obj_type!=OBJ_COLUMN) + if(obj_type!=ObjColumn) { - if(obj_type==OBJ_DATABASE) + if(obj_type==ObjDatabase) object=dbmodel; else { @@ -2266,8 +2266,8 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) else { //If the object is column it's necessary to retrive the parent table to get the valid reference to column - table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[ParsersAttributes::TABLE]), OBJ_TABLE)); - object=table->getObject(getColumnName(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::OID]), OBJ_COLUMN); + table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[ParsersAttributes::TABLE]), ObjTable)); + object=table->getObject(getColumnName(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::OID]), ObjColumn); } } @@ -2281,21 +2281,21 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) if(!privs.empty() || gop_privs.empty()) { - role=dynamic_cast(dbmodel->getObject(role_name, OBJ_ROLE)); + role=dynamic_cast(dbmodel->getObject(role_name, ObjRole)); if(auto_resolve_deps && !role_name.isEmpty() && !role) { - QString oid = catalog.getObjectOID(role_name, OBJ_ROLE); - getDependencyObject(oid, OBJ_ROLE); - role=dynamic_cast(dbmodel->getObject(role_name, OBJ_ROLE)); + QString oid = catalog.getObjectOID(role_name, ObjRole); + getDependencyObject(oid, ObjRole); + role=dynamic_cast(dbmodel->getObject(role_name, ObjRole)); } /* If the role doesn't exists and there is a name defined, throws an error because the roles wasn't found on the model */ if(!role && !role_name.isEmpty()) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) - .arg(QString("permission_%1").arg(perm_list[i])).arg(BaseObject::getTypeName(OBJ_PERMISSION)) - .arg(role_name).arg(BaseObject::getTypeName(OBJ_ROLE)) + .arg(QString("permission_%1").arg(perm_list[i])).arg(BaseObject::getTypeName(ObjPermission)) + .arg(role_name).arg(BaseObject::getTypeName(ObjRole)) ,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -2341,13 +2341,13 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) void DatabaseImportHelper::createTableInheritances(void) { //Creating table inheiritances - if(dbmodel->getObjectCount(OBJ_TABLE) > 0 && !import_canceled) + if(dbmodel->getObjectCount(ObjTable) > 0 && !import_canceled) { try { emit s_progressUpdated(90, trUtf8("Creating table inheritances..."), - OBJ_RELATIONSHIP); + ObjRelationship); __createTableInheritances(); } catch(Exception &e) @@ -2373,7 +2373,7 @@ void DatabaseImportHelper::createTablePartitionings(void) emit s_progressUpdated(95, trUtf8("Creating table partitionings..."), - OBJ_RELATIONSHIP); + ObjRelationship); // Creating the paritioning relationships for(auto &itr : imported_tables) @@ -2414,7 +2414,7 @@ void DatabaseImportHelper::destroyDetachedColumns(void) emit s_progressUpdated(100, trUtf8("Destroying unused detached columns..."), - OBJ_COLUMN); + ObjColumn); //Destroying detached columns before create inheritances for(Column *col : inherited_cols) @@ -2451,13 +2451,13 @@ void DatabaseImportHelper::assignSequencesToColumns(void) Column *col=nullptr; emit s_progressUpdated(100, trUtf8("Assigning sequences to columns..."), - OBJ_SEQUENCE); + ObjSequence); - for(auto &object : *dbmodel->getObjectList(OBJ_TABLE)) + for(auto &object : *dbmodel->getObjectList(ObjTable)) { table=dynamic_cast
(object); - for(auto &tab_obj : *table->getObjectList(OBJ_COLUMN)) + for(auto &tab_obj : *table->getObjectList(ObjColumn)) { col=dynamic_cast(tab_obj); @@ -2500,8 +2500,8 @@ void DatabaseImportHelper::__createTableInheritances(void) QStringList inh_list; unsigned oid; - itr=object_oids[OBJ_TABLE].begin(); - itr_end=object_oids[OBJ_TABLE].end(); + itr=object_oids[ObjTable].begin(); + itr_end=object_oids[ObjTable].end(); while(itr!=itr_end) { @@ -2513,19 +2513,19 @@ void DatabaseImportHelper::__createTableInheritances(void) if(!inh_list.isEmpty()) { //Get the child table resolving it's name from the oid - child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][ParsersAttributes::OID]), OBJ_TABLE)); + child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][ParsersAttributes::OID]), ObjTable)); while(!inh_list.isEmpty()) { //Get the parent table resolving it's name from the oid - parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), OBJ_TABLE)); + parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjTable)); try { if(!parent_tab && auto_resolve_deps) { - getDependencyObject(inh_list.front(), OBJ_TABLE); - parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), OBJ_TABLE)); + getDependencyObject(inh_list.front(), ObjTable); + parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjTable)); } if(!parent_tab) @@ -2536,7 +2536,7 @@ void DatabaseImportHelper::__createTableInheritances(void) //Create the inheritance relationship rel=new Relationship(Relationship::RELATIONSHIP_GEN, child_tab, parent_tab); - rel->setName(PgModelerNS::generateUniqueName(rel, (*dbmodel->getObjectList(OBJ_RELATIONSHIP)))); + rel->setName(PgModelerNS::generateUniqueName(rel, (*dbmodel->getObjectList(ObjRelationship)))); dbmodel->addRelationship(rel); rel=nullptr; @@ -2560,7 +2560,7 @@ void DatabaseImportHelper::configureDatabase(attribs_map &attribs) try { attribs[ParsersAttributes::APPEND_AT_EOD]=QString(); - loadObjectXML(OBJ_DATABASE, attribs); + loadObjectXML(ObjDatabase, attribs); dbmodel->configureDatabase(attribs); } catch(Exception &e) @@ -2602,11 +2602,11 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f obj_name.prepend(sch_name + QString(".")); //Formatting the name in form of signature (only for functions and operators) - if(signature_form && (obj_type==OBJ_FUNCTION || obj_type==OBJ_OPERATOR || obj_type==OBJ_AGGREGATE || obj_type==OBJ_OPFAMILY || obj_type==OBJ_OPCLASS)) + if(signature_form && (obj_type==ObjFunction || obj_type==ObjOperator || obj_type==ObjAggregate || obj_type==ObjOpFamily || obj_type==ObjOpClass)) { QStringList params; - if(obj_type==OBJ_FUNCTION) + if(obj_type==ObjFunction) { QStringList arg_types=getTypes(obj_attr[ParsersAttributes::ARG_TYPES], false), arg_modes=Catalog::parseArrayValues(obj_attr[ParsersAttributes::ARG_MODES]); @@ -2626,14 +2626,14 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f } } } - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) { QStringList params=getTypes(obj_attr[ParsersAttributes::TYPES], false); if(params.isEmpty()) params.push_back(QString("*")); } - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) { if(obj_attr[ParsersAttributes::LEFT_TYPE].toUInt() > 0) params.push_back(getType(obj_attr[ParsersAttributes::LEFT_TYPE], false)); @@ -2650,7 +2650,7 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f obj_name += QString(" USING %1").arg(obj_attr[ParsersAttributes::INDEX_TYPE]); } - if(obj_type != OBJ_OPFAMILY && obj_type != OBJ_OPCLASS) + if(obj_type != ObjOpFamily && obj_type != ObjOpClass) obj_name+=QString("(") + params.join(',') + QString(")"); } @@ -2751,14 +2751,14 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, { ObjectType obj_type; - if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(OBJ_TABLE)) - obj_type=OBJ_TABLE; - else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(OBJ_VIEW)) - obj_type=OBJ_VIEW; - else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(OBJ_DOMAIN)) - obj_type=OBJ_DOMAIN; + if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjTable)) + obj_type=ObjTable; + else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjView)) + obj_type=ObjView; + else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjDomain)) + obj_type=ObjDomain; else - obj_type=OBJ_SEQUENCE; + obj_type=ObjSequence; is_derivated_from_obj = true; getDependencyObject(type_attr[ParsersAttributes::OBJECT_ID], obj_type, true, true, false); diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index fc924ef003..b05cef8882 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -272,7 +272,7 @@ class DatabaseImportHelper: public QObject { signals: //! \brief This singal is emitted whenever the export progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=BASE_OBJECT); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjBaseObject); //! \brief This signal is emited when the import has finished void s_importFinished(Exception e=Exception()); diff --git a/libpgmodeler_ui/src/databasewidget.cpp b/libpgmodeler_ui/src/databasewidget.cpp index 2c8fbb2ac0..03c02a9785 100644 --- a/libpgmodeler_ui/src/databasewidget.cpp +++ b/libpgmodeler_ui/src/databasewidget.cpp @@ -18,7 +18,7 @@ #include "databasewidget.h" -DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_DATABASE) +DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, ObjDatabase) { try { @@ -27,12 +27,12 @@ DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_DA QGridLayout *grid=nullptr; Ui_DatabaseWidget::setupUi(this); - configureFormLayout(database_grid, OBJ_DATABASE); + configureFormLayout(database_grid, ObjDatabase); - def_schema_sel=new ObjectSelectorWidget(OBJ_SCHEMA, true, this); - def_collation_sel=new ObjectSelectorWidget(OBJ_COLLATION, true, this); - def_owner_sel=new ObjectSelectorWidget(OBJ_ROLE, true, this); - def_tablespace_sel=new ObjectSelectorWidget(OBJ_TABLESPACE, true, this); + def_schema_sel=new ObjectSelectorWidget(ObjSchema, true, this); + def_collation_sel=new ObjectSelectorWidget(ObjCollation, true, this); + def_owner_sel=new ObjectSelectorWidget(ObjRole, true, this); + def_tablespace_sel=new ObjectSelectorWidget(ObjTablespace, true, this); frame=generateInformationFrame(trUtf8("The fields LC_COLLATE and LC_CTYPE have pre-configured values based upon the running system. You can freely modify those values if you intend to export the model to another host.")); grid=dynamic_cast(attributes_twg->widget(0)->layout()); @@ -98,16 +98,16 @@ void DatabaseWidget::setAttributes(DatabaseModel *model) lcctype_cmb->setCurrentText(model->getLocalization(Collation::_LC_CTYPE)); def_schema_sel->setModel(model); - def_schema_sel->setSelectedObject(model->getDefaultObject(OBJ_SCHEMA)); + def_schema_sel->setSelectedObject(model->getDefaultObject(ObjSchema)); def_collation_sel->setModel(model); - def_collation_sel->setSelectedObject(model->getDefaultObject(OBJ_COLLATION)); + def_collation_sel->setSelectedObject(model->getDefaultObject(ObjCollation)); def_owner_sel->setModel(model); - def_owner_sel->setSelectedObject(model->getDefaultObject(OBJ_ROLE)); + def_owner_sel->setSelectedObject(model->getDefaultObject(ObjRole)); def_tablespace_sel->setModel(model); - def_tablespace_sel->setSelectedObject(model->getDefaultObject(OBJ_TABLESPACE)); + def_tablespace_sel->setSelectedObject(model->getDefaultObject(ObjTablespace)); allow_conn_chk->setChecked(model->isAllowConnections()); is_template_chk->setChecked(model->isTemplate()); @@ -142,10 +142,10 @@ void DatabaseWidget::applyConfiguration(void) else model->setLocalization(Collation::_LC_CTYPE, QString()); - model->setDefaultObject(def_schema_sel->getSelectedObject(), OBJ_SCHEMA); - model->setDefaultObject(def_owner_sel->getSelectedObject(), OBJ_ROLE); - model->setDefaultObject(def_collation_sel->getSelectedObject(), OBJ_COLLATION); - model->setDefaultObject(def_tablespace_sel->getSelectedObject(), OBJ_TABLESPACE); + model->setDefaultObject(def_schema_sel->getSelectedObject(), ObjSchema); + model->setDefaultObject(def_owner_sel->getSelectedObject(), ObjRole); + model->setDefaultObject(def_collation_sel->getSelectedObject(), ObjCollation); + model->setDefaultObject(def_tablespace_sel->getSelectedObject(), ObjTablespace); model->setIsTemplate(is_template_chk->isChecked()); model->setAllowConnections(allow_conn_chk->isChecked()); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 34397210ae..725d7c7842 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -177,9 +177,9 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): act = item_menu.addAction(QIcon(PgModelerUiNS::getIconPath("colar")), trUtf8("Pase items")); act->setShortcut(paste_tb->shortcut()); connect(act, SIGNAL(triggered(bool)), paste_tb, SLOT(click())); - act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == OBJ_TABLE); + act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == ObjTable); - if(obj_type == OBJ_TABLE) + if(obj_type == ObjTable) { item_menu.addSeparator(); act = item_menu.addAction(browse_tabs_tb->icon(), trUtf8("Browse tables")); @@ -226,7 +226,7 @@ void DataManipulationForm::setAttributes(Connection conn, const QString curr_sch this->setWindowTitle(this->windowTitle() + QString(" - ") + db_name); schema_cmb->clear(); - listObjects(schema_cmb, { OBJ_SCHEMA }); + listObjects(schema_cmb, { ObjSchema }); disableControlButtons(); schema_cmb->setCurrentText(curr_schema); @@ -270,9 +270,9 @@ void DataManipulationForm::listTables(void) if(schema_cmb->currentIndex() > 0) { if(hide_views_chk->isChecked()) - listObjects(table_cmb, { OBJ_TABLE }, schema_cmb->currentText()); + listObjects(table_cmb, { ObjTable }, schema_cmb->currentText()); else - listObjects(table_cmb, { OBJ_TABLE, OBJ_VIEW }, schema_cmb->currentText()); + listObjects(table_cmb, { ObjTable, ObjView }, schema_cmb->currentText()); } table_lbl->setEnabled(table_cmb->count() > 0); @@ -296,7 +296,7 @@ void DataManipulationForm::listColumns(void) vector cols; catalog.setConnection(conn); - cols=catalog.getObjectsAttributes(OBJ_COLUMN, schema_cmb->currentText(), table_cmb->currentText()); + cols=catalog.getObjectsAttributes(ObjColumn, schema_cmb->currentText(), table_cmb->currentText()); for(auto &col : cols) { @@ -388,12 +388,12 @@ void DataManipulationForm::retrieveData(void) clearChangedRows(); //If the table is empty automatically creates a new row - if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()==OBJ_TABLE) + if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()==ObjTable) addRow(); else results_tbw->setFocus(); - if(table_cmb->currentData(Qt::UserRole).toUInt()==OBJ_TABLE) + if(table_cmb->currentData(Qt::UserRole).toUInt()==ObjTable) csv_load_tb->setEnabled(!col_names.isEmpty()); else { @@ -407,15 +407,15 @@ void DataManipulationForm::retrieveData(void) QApplication::restoreOverrideCursor(); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == OBJ_TABLE && + table_cmb->currentData().toUInt() == ObjTable && !col_names.isEmpty()); - truncate_tb->setEnabled(table_cmb->currentData().toUInt() == OBJ_TABLE && + truncate_tb->setEnabled(table_cmb->currentData().toUInt() == ObjTable && res.getTupleCount() > 0 && !col_names.isEmpty()); code_compl_wgt->clearCustomItems(); - code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), OBJ_COLUMN); + code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), ObjColumn); columns_lst->clear(); QListWidgetItem *item = nullptr; @@ -476,7 +476,7 @@ void DataManipulationForm::enableRowControlButtons(void) duplicate_tb->setEnabled(cols_selected); copy_tb->setEnabled(sel_ranges.count() != 0); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == OBJ_TABLE && + table_cmb->currentData().toUInt() == ObjTable && !col_names.isEmpty()); browse_tabs_tb->setEnabled((!fk_infos.empty() || !ref_fk_infos.empty()) && sel_ranges.count() == 1 && sel_ranges.at(0).rowCount() == 1); bulkedit_tb->setEnabled(sel_ranges.count() != 0); @@ -726,7 +726,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin table_oid = 0; - if(obj_type==OBJ_VIEW) + if(obj_type==ObjView) { warning_frm->setVisible(true); warning_lbl->setText(trUtf8("Views can't have their data handled through this grid, this way, all operations are disabled.")); @@ -735,7 +735,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin { catalog.setConnection(conn); //Retrieving the constraints from catalog using a custom filter to select only primary keys (contype=p) - pks=catalog.getObjectsAttributes(OBJ_CONSTRAINT, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='p'")}}); + pks=catalog.getObjectsAttributes(ObjConstraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='p'")}}); warning_frm->setVisible(pks.empty()); @@ -745,8 +745,8 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin table_oid = pks[0][ParsersAttributes::TABLE].toUInt(); } - hint_frm->setVisible(obj_type==OBJ_TABLE); - add_tb->setEnabled(obj_type==OBJ_TABLE && !col_names.empty()); + hint_frm->setVisible(obj_type==ObjTable); + add_tb->setEnabled(obj_type==ObjTable && !col_names.empty()); pk_col_names.clear(); if(!pks.empty()) @@ -757,7 +757,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin for(QString id : col_str_ids) col_ids.push_back(id.toUInt()); - columns=catalog.getObjectsAttributes(OBJ_COLUMN, schema, table, col_ids); + columns=catalog.getObjectsAttributes(ObjColumn, schema, table, col_ids); for(auto &col : columns) pk_col_names.push_back(col[ParsersAttributes::NAME]); @@ -766,7 +766,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin catalog.closeConnection(); //For tables, even if there is no pk the user can manipulate data - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) results_tbw->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::AnyKeyPressed); else results_tbw->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -794,14 +794,14 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin ref_fk_infos.clear(); fk_infos.clear(); - if(obj_type==OBJ_VIEW) + if(obj_type==ObjView) return; catalog.setConnection(conn); //Retrieving the constraints from catalog using a custom filter to select only foreign keys (contype=f) - fks=catalog.getObjectsAttributes(OBJ_CONSTRAINT, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f'")}}); - ref_fks=catalog.getObjectsAttributes(OBJ_CONSTRAINT, QString(), QString(), {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(table_oid)}}); + fks=catalog.getObjectsAttributes(ObjConstraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f'")}}); + ref_fks=catalog.getObjectsAttributes(ObjConstraint, QString(), QString(), {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(table_oid)}}); if(!fks.empty() || !ref_fks.empty()) { @@ -819,8 +819,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &fk : fks) { - aux_table = catalog.getObjectAttributes(OBJ_TABLE, fk[ParsersAttributes::REF_TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(OBJ_SCHEMA, aux_table[ParsersAttributes::SCHEMA].toUInt()); + aux_table = catalog.getObjectAttributes(ObjTable, fk[ParsersAttributes::REF_TABLE].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjSchema, aux_table[ParsersAttributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[ParsersAttributes::NAME]) .arg(aux_table[ParsersAttributes::NAME]) @@ -842,7 +842,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(OBJ_COLUMN, schema, table, col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjColumn, schema, table, col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DATA_SEPARATOR); @@ -854,7 +854,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::DST_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(OBJ_COLUMN, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); fk_infos[fk_name][ParsersAttributes::DST_COLUMNS] = name_list.join(Table::DATA_SEPARATOR); @@ -871,8 +871,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin col_ids.clear(); name_list.clear(); - aux_table = catalog.getObjectAttributes(OBJ_TABLE, fk[ParsersAttributes::TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(OBJ_SCHEMA, aux_table[ParsersAttributes::SCHEMA].toUInt()); + aux_table = catalog.getObjectAttributes(ObjTable, fk[ParsersAttributes::TABLE].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjSchema, aux_table[ParsersAttributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[ParsersAttributes::NAME]) .arg(aux_table[ParsersAttributes::NAME]) @@ -882,7 +882,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(OBJ_COLUMN, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); action = submenu->addAction(QPixmap(PgModelerUiNS::getIconPath("table")), diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index c57e148aa8..3629597286 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -19,7 +19,7 @@ #include "domainwidget.h" #include "numberedtexteditor.h" -DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_DOMAIN) +DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjDomain) { try { @@ -52,7 +52,7 @@ DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_DOMAIN connect(constr_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(handleConstraint(int))); connect(constr_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editConstraint(int))); - configureFormLayout(domain_grid, OBJ_DOMAIN); + configureFormLayout(domain_grid, ObjDomain); setRequiredField(data_type); configureTabOrder({ def_value_edt, not_null_chk, data_type, constr_name_edt, check_expr_txt }); diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index 64e1167366..d5517d7eed 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -32,9 +32,9 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) elem_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); parent_obj=nullptr; - op_class_sel=new ObjectSelectorWidget(OBJ_OPCLASS, true, this); - collation_sel=new ObjectSelectorWidget(OBJ_COLLATION, true, this); - operator_sel=new ObjectSelectorWidget(OBJ_OPERATOR, true, this); + op_class_sel=new ObjectSelectorWidget(ObjOpClass, true, this); + collation_sel=new ObjectSelectorWidget(ObjCollation, true, this); + operator_sel=new ObjectSelectorWidget(ObjOperator, true, this); element_grid->addWidget(collation_sel, 3,1,1,2); element_grid->addWidget(op_class_sel, 4,1,1,2); @@ -102,7 +102,7 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, else setPartitionKey(part_key); - if(parent_obj->getObjectType() == OBJ_TABLE && + if(parent_obj->getObjectType() == ObjTable && (column || (!column && elem->getExpression().isEmpty()))) { column_rb->setChecked(true); @@ -136,9 +136,9 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) this->setEnabled(false); throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(parent_obj->getObjectType()!=OBJ_TABLE && - parent_obj->getObjectType()!=OBJ_VIEW && - parent_obj->getObjectType()!=OBJ_RELATIONSHIP) + else if(parent_obj->getObjectType()!=ObjTable && + parent_obj->getObjectType()!=ObjView && + parent_obj->getObjectType()!=ObjRelationship) throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setEnabled(true); @@ -148,11 +148,11 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) collation_sel->setModel(model); operator_sel->setModel(model); - cols_combo_parent->setVisible(parent_obj->getObjectType() == OBJ_TABLE); - column_rb->setVisible(parent_obj->getObjectType() == OBJ_TABLE); - expression_rb->setChecked(parent_obj->getObjectType() == OBJ_VIEW); + cols_combo_parent->setVisible(parent_obj->getObjectType() == ObjTable); + column_rb->setVisible(parent_obj->getObjectType() == ObjTable); + expression_rb->setChecked(parent_obj->getObjectType() == ObjView); - if(parent_obj->getObjectType() == OBJ_TABLE) + if(parent_obj->getObjectType() == ObjTable) updateColumnsCombo(); } diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 6c36de5aaa..32837a9277 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -18,7 +18,7 @@ #include "eventtriggerwidget.h" -EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_EVENT_TRIGGER) +EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjEventTrigger) { map > fields_map; map > values_map; @@ -26,7 +26,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent Ui_EventTriggerWidget::setupUi(this); - function_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + function_sel=new ObjectSelectorWidget(ObjFunction, true, this); filter_tab=new ObjectsTableWidget(ObjectsTableWidget::ADD_BUTTON | ObjectsTableWidget::EDIT_BUTTON | ObjectsTableWidget::UPDATE_BUTTON | @@ -39,7 +39,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent eventtrigger_grid->addWidget(function_sel, 1, 1); filter_layout->addWidget(filter_tab); - configureFormLayout(eventtrigger_grid, OBJ_EVENT_TRIGGER); + configureFormLayout(eventtrigger_grid, ObjEventTrigger); setRequiredField(function_lbl); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(event_lbl); diff --git a/libpgmodeler_ui/src/extensionwidget.cpp b/libpgmodeler_ui/src/extensionwidget.cpp index 80de47971c..2b5f2d33f8 100644 --- a/libpgmodeler_ui/src/extensionwidget.cpp +++ b/libpgmodeler_ui/src/extensionwidget.cpp @@ -1,9 +1,9 @@ #include "extensionwidget.h" -ExtensionWidget::ExtensionWidget(QWidget * parent) : BaseObjectWidget(parent, OBJ_EXTENSION) +ExtensionWidget::ExtensionWidget(QWidget * parent) : BaseObjectWidget(parent, ObjExtension) { Ui_ExtensionWidget::setupUi(this); - configureFormLayout(extension_grid, OBJ_EXTENSION); + configureFormLayout(extension_grid, ObjExtension); extension_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), extension_grid->count()+1, 0, 1, 0); configureTabOrder({ cur_ver_edt, old_ver_edt, handles_type_chk }); diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index d30d5bdb50..74bed50a87 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -19,7 +19,7 @@ #include "functionwidget.h" #include "baseform.h" -FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_FUNCTION) +FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjFunction) { try { @@ -34,7 +34,7 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_FU Ui_FunctionWidget::setupUi(this); - configureFormLayout(function_grid, OBJ_FUNCTION); + configureFormLayout(function_grid, ObjFunction); source_code_txt=new NumberedTextEditor(this, true); dynamic_cast(source_code_frm->layout())->addWidget(source_code_txt, 1, 0, 1, 2); @@ -268,7 +268,7 @@ void FunctionWidget::setAttributes(DatabaseModel *model, OperationList *op_list, PgSQLType aux_type; BaseObjectWidget::setAttributes(model, op_list, func, schema); - languages=model->getObjects(OBJ_LANGUAGE); + languages=model->getObjects(ObjLanguage); while(!languages.empty()) { @@ -420,19 +420,19 @@ void FunctionWidget::validateConfiguredFunction(void) If the function is invalid the instances raises exceptions accusing the error that is enough to check the validity of the function in relation to objects that reference it. */ - if(obj_type==OBJ_CONVERSION) + if(obj_type==ObjConversion) { conv=dynamic_cast(object); if(conv->getConversionFunction()==func) conv->setConversionFunction(func); } - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) { cast=dynamic_cast(object); if(cast->getCastFunction()==func) cast->setCastFunction(func); } - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) { aggr=dynamic_cast(object); if(aggr->getFunction(Aggregate::FINAL_FUNC)==func) @@ -440,11 +440,11 @@ void FunctionWidget::validateConfiguredFunction(void) else if(aggr->getFunction(Aggregate::TRANSITION_FUNC)==func) aggr->setFunction(Aggregate::TRANSITION_FUNC, func); } - else if(obj_type==OBJ_TRIGGER) + else if(obj_type==ObjTrigger) { dynamic_cast(object)->setFunction(func); } - else if(obj_type==OBJ_LANGUAGE) + else if(obj_type==ObjLanguage) { lang=dynamic_cast(object); @@ -454,7 +454,7 @@ void FunctionWidget::validateConfiguredFunction(void) lang->setFunction(func, i1); } } - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) { oper=dynamic_cast(object); for(i1=Operator::FUNC_OPERATOR; i1 <= Operator::FUNC_RESTRICT; i1++) @@ -463,7 +463,7 @@ void FunctionWidget::validateConfiguredFunction(void) oper->setFunction(func, i1); } } - else if(obj_type==OBJ_TYPE) + else if(obj_type==ObjType) { type=dynamic_cast(object); if(type->getConfiguration()==Type::BASE_TYPE) @@ -475,7 +475,7 @@ void FunctionWidget::validateConfiguredFunction(void) } } } - else if(obj_type==OBJ_EVENT_TRIGGER) + else if(obj_type==ObjEventTrigger) { dynamic_cast(object)->setFunction(func); } @@ -504,7 +504,7 @@ void FunctionWidget::applyConfiguration(void) startConfiguration(); func=dynamic_cast(this->object); - func->setLanguage(model->getObject(language_cmb->currentText(), OBJ_LANGUAGE)); + func->setLanguage(model->getObject(language_cmb->currentText(), ObjLanguage)); func->setFunctionType(func_type_cmb->currentText()); func->setWindowFunction(window_func_chk->isChecked()); func->setLeakProof(leakproof_chk->isChecked()); diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 1889d7eae8..c44f6b2b7d 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -18,10 +18,10 @@ #include "genericsqlwidget.h" -GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_GENERIC_SQL) +GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, ObjGenericSQL) { Ui_GenericSQLWidget::setupUi(this); - configureFormLayout(genericsql_grid, OBJ_GENERIC_SQL); + configureFormLayout(genericsql_grid, ObjGenericSQL); definition_txt = PgModelerUiNS::createNumberedTextEditor(sqlcode_grp, true); definition_hl = new SyntaxHighlighter(definition_txt); diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index aa1f0d8b7f..bc2d8b2d0a 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -18,7 +18,7 @@ #include "indexwidget.h" -IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_INDEX) +IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjIndex) { try { @@ -40,7 +40,7 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_INDEX) grid->addWidget(elements_tab,0,0); tabWidget->widget(1)->setLayout(grid); - configureFormLayout(index_grid, OBJ_INDEX); + configureFormLayout(index_grid, ObjIndex); IndexingType::getTypes(list); indexing_cmb->addItems(list); diff --git a/libpgmodeler_ui/src/languagewidget.cpp b/libpgmodeler_ui/src/languagewidget.cpp index 146fa04c13..c872620aa4 100644 --- a/libpgmodeler_ui/src/languagewidget.cpp +++ b/libpgmodeler_ui/src/languagewidget.cpp @@ -18,7 +18,7 @@ #include "languagewidget.h" -LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_LANGUAGE) +LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, ObjLanguage) { try { @@ -29,15 +29,15 @@ LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_LA func_validator_sel=nullptr; func_inline_sel=nullptr; - func_handler_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); - func_validator_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); - func_inline_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + func_handler_sel=new ObjectSelectorWidget(ObjFunction, true, this); + func_validator_sel=new ObjectSelectorWidget(ObjFunction, true, this); + func_inline_sel=new ObjectSelectorWidget(ObjFunction, true, this); language_grid->addWidget(func_handler_sel,1,1,1,2); language_grid->addWidget(func_validator_sel,2,1,1,2); language_grid->addWidget(func_inline_sel,3,1,1,2); - configureFormLayout(language_grid, OBJ_LANGUAGE); + configureFormLayout(language_grid, ObjLanguage); frame=generateInformationFrame(trUtf8("The functions to be assigned to the language should have, respectively, the following signatures:

Handler Function: language_handler function()
Validator Function: void function(oid)
Inline Function: void function(internal)")); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index d3e050ba3e..507e576fcc 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -898,7 +898,7 @@ void MainWindow::addModel(const QString &filename) models_tbw->setTabToolTip(models_tbw->currentIndex(), filename); //Get the "public" schema and set as system object - public_sch=dynamic_cast(model_tab->db_model->getObject(QString("public"), OBJ_SCHEMA)); + public_sch=dynamic_cast(model_tab->db_model->getObject(QString("public"), ObjSchema)); if(public_sch) public_sch->setSystemObject(true); model_tab->db_model->setInvalidated(false); @@ -1158,7 +1158,7 @@ void MainWindow::setGridOptions(void) current_model->scene->alignObjectsToGrid(); //Forcing the relationship updating to fit the new position of the tables - current_model->getDatabaseModel()->setObjectsModified({ OBJ_RELATIONSHIP, BASE_RELATIONSHIP }); + current_model->getDatabaseModel()->setObjectsModified({ ObjRelationship, ObjBaseRelationship }); } //Redraw the scene to apply the new grid options @@ -2042,7 +2042,7 @@ void MainWindow::toggleCompactView(void) { model_wgt = dynamic_cast(models_tbw->widget(idx)); model_wgt->toggleAllExtendedAttributes(action_compact_view->isChecked()); - model_wgt->getDatabaseModel()->setObjectsModified({ OBJ_TABLE, OBJ_VIEW, OBJ_RELATIONSHIP, BASE_RELATIONSHIP, OBJ_SCHEMA}); + model_wgt->getDatabaseModel()->setObjectsModified({ ObjTable, ObjView, ObjRelationship, ObjBaseRelationship, ObjSchema}); } QApplication::restoreOverrideCursor(); diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 3a23fc8559..0a2901d8bd 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -307,7 +307,7 @@ void MetadataHandlingForm::updateProgress(int progress, QString msg, unsigned in QString fmt_msg=PgModelerUiNS::formatMessage(msg); QPixmap icon; - if(obj_type==BASE_OBJECT) + if(obj_type==ObjBaseObject) { if(progress==100) icon=QPixmap(PgModelerUiNS::getIconPath("msgbox_info")); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 6d5f23c08c..b47cacfc8f 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -466,7 +466,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) catalog.setFilter(Catalog::LIST_ALL_OBJS | Catalog::EXCL_BUILTIN_ARRAY_TYPES | Catalog::EXCL_EXTENSION_OBJS | Catalog::EXCL_SYSTEM_OBJS); catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); - obj_oids[OBJ_DATABASE].push_back(db_cmb->currentData().value()); + obj_oids[ObjDatabase].push_back(db_cmb->currentData().value()); if(thread_id == SRC_IMPORT_THREAD) { @@ -807,7 +807,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType } else if(diff_thread && diff_thread->isRunning()) { - if((progress == 0 || progress == 100) && obj_type==BASE_OBJECT) + if((progress == 0 || progress == 100) && obj_type==ObjBaseObject) { PgModelerUiNS::createOutputTreeItem(output_trw, msg, QPixmap(PgModelerUiNS::getIconPath("msgbox_info")), @@ -823,7 +823,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_aux = diff_progress + (progress/3); - if(obj_type==BASE_OBJECT) + if(obj_type==ObjBaseObject) ico=QPixmap(PgModelerUiNS::getIconPath("codigosql")); else ico=QPixmap(PgModelerUiNS::getIconPath(obj_type)); @@ -840,7 +840,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_lbl->setText(msg); progress_pb->setValue(progress); - if(obj_type!=BASE_OBJECT) + if(obj_type!=ObjBaseObject) progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(obj_type))); else progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index 583e4c100d..c41d280742 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -141,7 +141,7 @@ void ModelExportForm::updateProgress(int progress, QString msg, ObjectType obj_t progress_lbl->setText(text); progress_pb->setValue(progress); - if(obj_type!=BASE_OBJECT) + if(obj_type!=ObjBaseObject) ico=QPixmap(PgModelerUiNS::getIconPath(obj_type)); else if(!cmd.isEmpty()) ico=QPixmap(PgModelerUiNS::getIconPath("codigosql")); diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 38f71a3a3a..056fc54855 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -11,7 +11,7 @@ void ModelExportHelper::resetExportParams(void) sql_gen_progress=progress=0; db_created=ignore_dup=drop_db=drop_objs=export_canceled=false; simulate=use_tmp_names=db_sql_reenabled=false; - created_objs[OBJ_ROLE]=created_objs[OBJ_TABLESPACE]=-1; + created_objs[ObjRole]=created_objs[ObjTablespace]=-1; db_model=nullptr; connection=nullptr; scene=nullptr; @@ -72,11 +72,11 @@ void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &file BaseObject::setPgSQLVersion(pgsql_ver); emit s_progressUpdated(progress, trUtf8("Generating SQL code for PostgreSQL `%1'").arg(BaseObject::getPgSQLVersion()), - BASE_OBJECT); + ObjBaseObject); progress=1; db_model->saveModel(filename, SchemaParser::SQL_DEFINITION); - emit s_progressUpdated(100, trUtf8("Output SQL file `%1' successfully written.").arg(filename), BASE_OBJECT); + emit s_progressUpdated(100, trUtf8("Output SQL file `%1' successfully written.").arg(filename), ObjBaseObject); emit s_exportFinished(); } catch(Exception &e) @@ -198,7 +198,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename painter.setRenderHint(QPainter::SmoothPixmapTransform, true); emit s_progressUpdated((page_idx/static_cast(pages.size())) * 90, - trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), BASE_OBJECT); + trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), ObjBaseObject); //Render the entire viewport onto the pixmap view->render(&painter, QRectF(QPointF(0,0), pix.size()), retv); @@ -225,7 +225,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename if(!export_canceled) { - emit s_progressUpdated(100, trUtf8("Output image `%1' successfully written.").arg(filename), BASE_OBJECT); + emit s_progressUpdated(100, trUtf8("Output image `%1' successfully written.").arg(filename), ObjBaseObject); emit s_exportFinished(); } else @@ -304,7 +304,7 @@ void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename svg_file.close(); } - emit s_progressUpdated(100, trUtf8("Output file `%1' successfully written.").arg(filename), BASE_OBJECT); + emit s_progressUpdated(100, trUtf8("Output file `%1' successfully written.").arg(filename), ObjBaseObject); emit s_exportFinished(); } @@ -314,7 +314,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c QString version, sql_cmd, buf, sql_cmd_comment; Connection new_db_conn; unsigned i, count; - ObjectType types[]={OBJ_ROLE, OBJ_TABLESPACE}; + ObjectType types[]={ObjRole, ObjTablespace}; BaseObject *object=nullptr; QString tmpl_comm_regexp = QString("(COMMENT)( )+(ON)( )+(%1)(.)+(\n)(") + ParsersAttributes::DDL_END_TOKEN + QString(")"); QRegExp comm_regexp; @@ -337,7 +337,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c export_canceled=false; db_created=false; progress=sql_gen_progress=0; - created_objs[OBJ_ROLE]=created_objs[OBJ_TABLESPACE]=-1; + created_objs[ObjRole]=created_objs[ObjTablespace]=-1; errors.clear(); //Retrive the DBMS version in order to generate the correct code @@ -429,7 +429,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c sql_cmd=object->getCodeDefinition(SchemaParser::SQL_DEFINITION); - if(types[type_id] == OBJ_TABLESPACE) + if(types[type_id] == ObjTablespace) { comm_regexp = QRegExp(tmpl_comm_regexp.arg(object->getSQLName())); pos = comm_regexp.indexIn(sql_cmd); @@ -469,7 +469,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c emit s_progressUpdated(progress, trUtf8("Creating database `%1'") .arg(db_model->getName()), - OBJ_DATABASE); + ObjDatabase); sql_cmd=db_model->__getCodeDefinition(SchemaParser::SQL_DEFINITION); pos = comm_regexp.indexIn(sql_cmd); @@ -582,12 +582,12 @@ void ModelExportHelper::saveGenAtlerCmdsStatus(DatabaseModel *db_model) Table *tab=nullptr; Relationship *rel=nullptr; - objects.insert(objects.end(), db_model->getObjectList(OBJ_TABLE)->begin(), - db_model->getObjectList(OBJ_TABLE)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjTable)->begin(), + db_model->getObjectList(ObjTable)->end()); //Store the relationship on the auxiliary vector but only many-to-many are considered - objects.insert(objects.end(), db_model->getObjectList(OBJ_RELATIONSHIP)->begin(), - db_model->getObjectList(OBJ_RELATIONSHIP)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjRelationship)->begin(), + db_model->getObjectList(ObjRelationship)->end()); alter_cmds_status.clear(); @@ -630,12 +630,12 @@ void ModelExportHelper::restoreGenAtlerCmdsStatus(void) void ModelExportHelper::undoDBMSExport(DatabaseModel *db_model, Connection &conn, bool use_tmp_names) { QString drop_cmd=QString("DROP %1 %2;"); - ObjectType types[]={OBJ_ROLE, OBJ_TABLESPACE}; + ObjectType types[]={ObjRole, ObjTablespace}; int type_id; BaseObject *object=nullptr; //In case of error during the export all created object are removed - if(db_created || created_objs[OBJ_ROLE] >= 0 || created_objs[OBJ_TABLESPACE] >= 0) + if(db_created || created_objs[ObjRole] >= 0 || created_objs[ObjTablespace] >= 0) { emit s_progressUpdated(99, trUtf8("Destroying objects created on the server.")); @@ -681,20 +681,20 @@ void ModelExportHelper::generateTempObjectNames(DatabaseModel *db_model) QTextStream stream(&tmp_name); QDateTime dt=QDateTime::currentDateTime(); QCryptographicHash hash(QCryptographicHash::Md5); - map obj_suffixes={ { OBJ_DATABASE, QString("db_") }, - { OBJ_ROLE, QString("rl_")}, - { OBJ_TABLESPACE, QString("tb_")} }; + map obj_suffixes={ { ObjDatabase, QString("db_") }, + { ObjRole, QString("rl_")}, + { ObjTablespace, QString("tb_")} }; orig_obj_names.clear(); orig_obj_names[db_model]=db_model->getName(); - for(auto &role : *db_model->getObjectList(OBJ_ROLE)) + for(auto &role : *db_model->getObjectList(ObjRole)) { if(!role->isSystemObject()) orig_obj_names[role]=role->getName(); } - for(auto &tabspc : *db_model->getObjectList(OBJ_TABLESPACE)) + for(auto &tabspc : *db_model->getObjectList(ObjTablespace)) { if(!tabspc->isSystemObject()) orig_obj_names[tabspc]=tabspc->getName(); @@ -763,7 +763,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co alter_tab=QString("ALTER TABLE"); vector db_sql_cmds; QTextStream ts; - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; bool ddl_tk_found=false, is_create=false, is_drop=false; unsigned aux_prog=0, curr_size=0, buf_size=sql_buf.size(), factor=(db_name.isEmpty() ? 70 : 90); @@ -776,13 +776,13 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co drop_tab_obj_reg(QString("^((\\-\\-)+( )*)+(%1)(.)+(DROP)(.)+").arg(alter_tab)), reg_aux; - vector obj_types={ OBJ_ROLE, OBJ_FUNCTION, OBJ_TRIGGER, OBJ_INDEX, OBJ_POLICY, - OBJ_RULE, OBJ_TABLE, OBJ_VIEW, OBJ_DOMAIN, - OBJ_SCHEMA, OBJ_AGGREGATE, OBJ_OPFAMILY, - OBJ_OPCLASS, OBJ_OPERATOR, OBJ_SEQUENCE, - OBJ_CONVERSION, OBJ_CAST, OBJ_LANGUAGE, - OBJ_COLLATION, OBJ_EXTENSION, OBJ_TYPE, - OBJ_EVENT_TRIGGER, OBJ_DATABASE }; + vector obj_types={ ObjRole, ObjFunction, ObjTrigger, ObjIndex, ObjPolicy, + ObjRule, ObjTable, ObjView, ObjDomain, + ObjSchema, ObjAggregate, ObjOpFamily, + ObjOpClass, ObjOperator, ObjSequence, + ObjConversion, ObjCast, ObjLanguage, + ObjCollation, ObjExtension, ObjType, + ObjEventTrigger, ObjDatabase }; /* Extract each SQL command from the buffer and execute them separately. This is done @@ -845,7 +845,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co { aux_cmd.remove('"'); aux_cmd.remove(QString("IF EXISTS ")); - obj_type=(aux_cmd.contains(QString("COLUMN")) ? OBJ_COLUMN : OBJ_CONSTRAINT); + obj_type=(aux_cmd.contains(QString("COLUMN")) ? ObjColumn : ObjConstraint); reg_aux=QRegExp(QString("(COLUMN|CONSTRAINT)( )+")); //Extracting the table name @@ -893,21 +893,21 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co //Appeding special tokens when the object is an index or view if(lin.startsWith(QString("CREATE")) || lin.startsWith(QString("ALTER"))) { - if(obj_tp==OBJ_INDEX) + if(obj_tp==ObjIndex) { lin.remove(QString("UNIQUE")); lin.remove(QString("CONCURRENTLY")); } - else if(obj_tp==OBJ_VIEW) + else if(obj_tp==ObjView) { lin.remove(QString("MATERIALIZED")); lin.remove(QString("RECURSIVE")); } - else if(obj_tp==OBJ_TABLE) + else if(obj_tp==ObjTable) { lin.remove(QString("UNLOGGED")); } - else if(obj_tp==OBJ_FUNCTION) + else if(obj_tp==ObjFunction) { lin.remove(QString("OR REPLACE")); } @@ -933,12 +933,12 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co lin=lin.mid(reg_aux.matchedLength(), sql_cmd.indexOf('\n')).simplified(); lin.remove('"'); - if(obj_tp!=OBJ_CAST) + if(obj_tp!=ObjCast) { int spc_idx=lin.indexOf(' '); obj_name=lin.mid(0, (spc_idx >= 0 ? spc_idx + 1 : lin.size())); - if(obj_tp!=OBJ_FUNCTION) + if(obj_tp!=ObjFunction) { obj_name=obj_name.remove('(').simplified(); obj_name=obj_name.remove(')').simplified(); @@ -971,13 +971,13 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co else if(!sql_cmd.trimmed().isEmpty()) { //General commands like grant, revoke or set aren't explicitly shown - emit s_progressUpdated(aux_prog, trUtf8("Running auxiliary command."), BASE_OBJECT, sql_cmd); + emit s_progressUpdated(aux_prog, trUtf8("Running auxiliary command."), ObjBaseObject, sql_cmd); } //Executes the extracted SQL command if(!sql_cmd.isEmpty()) { - if(obj_type!=OBJ_DATABASE) + if(obj_type!=ObjDatabase) conn.executeDDLCommand(sql_cmd); else db_sql_cmds.push_back(sql_cmd); diff --git a/libpgmodeler_ui/src/modelexporthelper.h b/libpgmodeler_ui/src/modelexporthelper.h index 2ad9382f0c..550049aff1 100644 --- a/libpgmodeler_ui/src/modelexporthelper.h +++ b/libpgmodeler_ui/src/modelexporthelper.h @@ -189,7 +189,7 @@ class ModelExportHelper: public QObject { signals: //! \brief This singal is emitted whenever the export progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=BASE_OBJECT, QString cmd=QString(), bool is_code_gen=false); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjBaseObject, QString cmd=QString(), bool is_code_gen=false); //! \brief This signal is emited when the export has finished void s_exportFinished(void); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 8625ee6848..59cd571c38 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -120,8 +120,8 @@ void ModelObjectsWidget::editObject(void) { //If the user double-clicked the item "Permission (n)" on tree view if(sender()==objectstree_tw && objectstree_tw->currentItem() && - objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt()==OBJ_PERMISSION) - model_wgt->showObjectForm(OBJ_PERMISSION, reinterpret_cast(objectstree_tw->currentItem()->data(0, Qt::UserRole).value())); + objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt()==ObjPermission) + model_wgt->showObjectForm(ObjPermission, reinterpret_cast(objectstree_tw->currentItem()->data(0, Qt::UserRole).value())); //If the user double-clicked a permission on list view else if(sender()==objectslist_tbw && objectslist_tbw->currentRow() >= 0) { @@ -129,7 +129,7 @@ void ModelObjectsWidget::editObject(void) Permission *perm=dynamic_cast(obj); if(perm) - model_wgt->showObjectForm(OBJ_PERMISSION,perm->getObject()); + model_wgt->showObjectForm(ObjPermission,perm->getObject()); else model_wgt->editObject(); } @@ -140,7 +140,7 @@ void ModelObjectsWidget::editObject(void) void ModelObjectsWidget::selectObject(void) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; ModelWidget *model_wgt=nullptr; if(!simplified_view && this->model_wgt) @@ -161,15 +161,15 @@ void ModelObjectsWidget::selectObject(void) //If user select a group item popups a "New [OBJECT]" menu if((!simplified_view || (simplified_view && enable_obj_creation)) && !selected_object && QApplication::mouseButtons()==Qt::RightButton && - obj_type!=OBJ_COLUMN && obj_type!=OBJ_CONSTRAINT && obj_type!=OBJ_RULE && - obj_type!=OBJ_INDEX && obj_type!=OBJ_TRIGGER && obj_type!=OBJ_PERMISSION) + obj_type!=ObjColumn && obj_type!=ObjConstraint && obj_type!=ObjRule && + obj_type!=ObjIndex && obj_type!=ObjTrigger && obj_type!=ObjPermission) { QAction act(QPixmap(PgModelerUiNS::getIconPath(obj_type)), trUtf8("New") + QString(" ") + BaseObject::getTypeName(obj_type), nullptr); QMenu popup; //If not a relationship, connect the action to the addNewObject method of the model wiget - if(obj_type!=OBJ_RELATIONSHIP) + if(obj_type!=ObjRelationship) { act.setData(QVariant(obj_type)); connect(&act, SIGNAL(triggered()), model_wgt, SLOT(addNewObject())); @@ -198,7 +198,7 @@ void ModelObjectsWidget::selectObject(void) } } - if(obj_type!=OBJ_PERMISSION && selected_object && !simplified_view) + if(obj_type!=ObjPermission && selected_object && !simplified_view) { model_wgt->scene->clearSelection(); model_wgt->configureObjectMenu(selected_object); @@ -229,7 +229,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr tab_obj=dynamic_cast(object); item=new QTreeWidgetItem(root); - if(obj_type==OBJ_FUNCTION) + if(obj_type==ObjFunction) { Function *func=dynamic_cast(object); func->createSignature(false); @@ -237,13 +237,13 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr obj_name=func->getSignature(); func->createSignature(true); } - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) { Operator *oper=dynamic_cast(object); item->setText(0, oper->getSignature(false)); obj_name=oper->getSignature(false); } - else if(obj_type==OBJ_OPCLASS || obj_type == OBJ_OPFAMILY) + else if(obj_type==ObjOpClass || obj_type == ObjOpFamily) { obj_name=object->getSignature(false); obj_name.replace(QRegExp("( )+(USING)( )+"), QString(" [")); @@ -279,11 +279,11 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr item->setFont(0,font); - if(obj_type==BASE_RELATIONSHIP || obj_type==OBJ_RELATIONSHIP) + if(obj_type==ObjBaseRelationship || obj_type==ObjRelationship) { rel_type=dynamic_cast(object)->getRelationshipType(); - if(obj_type==BASE_RELATIONSHIP) + if(obj_type==ObjBaseRelationship) { if(rel_type==BaseRelationship::RELATIONSHIP_FK) str_aux=QString("fk"); @@ -301,7 +301,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr else if(rel_type==BaseRelationship::RELATIONSHIP_GEN) str_aux=QString("gen"); } - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) { constr_type=dynamic_cast(object)->getConstraintType(); @@ -324,19 +324,19 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr void ModelObjectsWidget::setObjectVisible(ObjectType obj_type, bool visible) { - if(obj_type!=BASE_OBJECT && obj_type!=BASE_TABLE) + if(obj_type!=ObjBaseObject && obj_type!=ObjBaseTable) visible_objs_map[obj_type]=visible; if(visible && simplified_view) { - if(obj_type!=OBJ_DATABASE) - visible_objs_map[OBJ_DATABASE]=true; + if(obj_type!=ObjDatabase) + visible_objs_map[ObjDatabase]=true; if(TableObject::isTableObject(obj_type)) - visible_objs_map[OBJ_TABLE]=visible_objs_map[OBJ_SCHEMA]=true; + visible_objs_map[ObjTable]=visible_objs_map[ObjSchema]=true; if(BaseObject::acceptsSchema(obj_type)) - visible_objs_map[OBJ_SCHEMA]=true; + visible_objs_map[ObjSchema]=true; } } @@ -461,28 +461,28 @@ void ModelObjectsWidget::updateObjectsList(void) void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) { - if(db_model && visible_objs_map[OBJ_SCHEMA]) + if(db_model && visible_objs_map[ObjSchema]) { BaseObject *schema=nullptr; vector obj_list; QFont font; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr, *item3=nullptr; - vector types = BaseObject::getChildObjectTypes(OBJ_SCHEMA); + vector types = BaseObject::getChildObjectTypes(ObjSchema); int count, count2, i; - QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(QString(BaseObject::getSchemaName(OBJ_SCHEMA)) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(QString(BaseObject::getSchemaName(ObjSchema)) + QString("_grp"))); - //Removing the OBJ_TABLE and OBJ_VIEW types since they are handled separetedly - types.erase(std::find(types.begin(), types.end(), OBJ_TABLE)); - types.erase(std::find(types.begin(), types.end(), OBJ_VIEW)); + //Removing the ObjTable and ObjView types since they are handled separetedly + types.erase(std::find(types.begin(), types.end(), ObjTable)); + types.erase(std::find(types.begin(), types.end(), ObjView)); //Get the current schema count on database - count=(db_model->getObjectCount(OBJ_SCHEMA)); + count=(db_model->getObjectCount(ObjSchema)); item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setData(1, Qt::UserRole, QVariant::fromValue(OBJ_SCHEMA)); + item->setData(1, Qt::UserRole, QVariant::fromValue(ObjSchema)); //Create the schema group item - item->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(OBJ_SCHEMA)).arg(count)); + item->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(ObjSchema)).arg(count)); font=item->font(0); font.setItalic(true); item->setFont(0, font); @@ -500,7 +500,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) } else { - schema=db_model->getObject(i, OBJ_SCHEMA); + schema=db_model->getObject(i, ObjSchema); item2=createItemForObject(schema, item); } @@ -544,26 +544,26 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *schema) { - if(db_model && visible_objs_map[OBJ_TABLE]) + if(db_model && visible_objs_map[ObjTable]) { vector obj_list; Table *table=nullptr; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr; QFont font; - vector types = BaseObject::getChildObjectTypes(OBJ_TABLE); - QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(OBJ_TABLE) + QString("_grp"))); + vector types = BaseObject::getChildObjectTypes(ObjTable); + QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(ObjTable) + QString("_grp"))); try { //Get all tables that belongs to the specified schema - obj_list=db_model->getObjects(OBJ_TABLE, schema); + obj_list=db_model->getObjects(ObjTable, schema); //Create a table group item item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setText(0,BaseObject::getTypeName(OBJ_TABLE) + + item->setText(0,BaseObject::getTypeName(ObjTable) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant::fromValue(OBJ_TABLE)); + item->setData(1, Qt::UserRole, QVariant::fromValue(ObjTable)); font=item->font(0); font.setItalic(true); @@ -602,28 +602,28 @@ void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *sche void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schema) { - if(db_model && visible_objs_map[OBJ_VIEW]) + if(db_model && visible_objs_map[ObjView]) { BaseObject *object=nullptr; vector obj_list; View *view=nullptr; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr; QFont font; - ObjectType types[]={ OBJ_RULE, OBJ_TRIGGER, OBJ_INDEX }; + ObjectType types[]={ ObjRule, ObjTrigger, ObjIndex }; int count, count1, type_cnt=sizeof(types)/sizeof(ObjectType), i, i1, i2; - QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(QString(BaseObject::getSchemaName(OBJ_VIEW)) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(QString(BaseObject::getSchemaName(ObjView)) + QString("_grp"))); try { //Get all views that belongs to the specified schema - obj_list=db_model->getObjects(OBJ_VIEW, schema); + obj_list=db_model->getObjects(ObjView, schema); //Create a table group item item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setText(0,BaseObject::getTypeName(OBJ_VIEW) + + item->setText(0,BaseObject::getTypeName(ObjView) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant::fromValue(OBJ_VIEW)); + item->setData(1, Qt::UserRole, QVariant::fromValue(ObjView)); font=item->font(0); font.setItalic(true); @@ -670,7 +670,7 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject { try { - if(db_model && visible_objs_map[OBJ_PERMISSION] && + if(db_model && visible_objs_map[ObjPermission] && Permission::acceptsPermission(object->getObjectType())) { vector perms; @@ -683,11 +683,11 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject font.setItalic(true); item->setFont(0, font); item->setText(0, QString("%1 (%2)") - .arg(BaseObject::getTypeName(OBJ_PERMISSION)) + .arg(BaseObject::getTypeName(ObjPermission)) .arg(perms.size())); item->setData(0, Qt::UserRole, generateItemValue(object)); - item->setData(1, Qt::UserRole, static_cast(OBJ_PERMISSION)); + item->setData(1, Qt::UserRole, static_cast(ObjPermission)); } } catch(Exception &e) @@ -707,10 +707,10 @@ void ModelObjectsWidget::updateDatabaseTree(void) QTreeWidgetItem *root=nullptr,*item1=nullptr, *item2=nullptr; QFont font; vector ref_list, tree_state, obj_list; - ObjectType types[]={ OBJ_ROLE, OBJ_TABLESPACE, - OBJ_LANGUAGE, OBJ_CAST, OBJ_TEXTBOX, - OBJ_RELATIONSHIP, OBJ_EVENT_TRIGGER, - OBJ_TAG, OBJ_GENERIC_SQL, OBJ_EXTENSION }; + ObjectType types[]={ ObjRole, ObjTablespace, + ObjLanguage, ObjCast, ObjTextbox, + ObjRelationship, ObjEventTrigger, + ObjTag, ObjGenericSQL, ObjExtension }; unsigned count, i, i1, type_cnt=sizeof(types)/sizeof(ObjectType); try @@ -721,7 +721,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) objectstree_tw->setUpdatesEnabled(false); objectstree_tw->clear(); - if(visible_objs_map[OBJ_DATABASE]) + if(visible_objs_map[ObjDatabase]) { root=createItemForObject(db_model); objectstree_tw->insertTopLevelItem(0,root); @@ -741,10 +741,10 @@ void ModelObjectsWidget::updateDatabaseTree(void) obj_list=(*db_model->getObjectList(types[i])); //Special case for relationship, merging the base relationship list to the relationship list - if(types[i]==OBJ_RELATIONSHIP) + if(types[i]==ObjRelationship) { vector obj_list_aux; - obj_list_aux=(*db_model->getObjectList(BASE_RELATIONSHIP)); + obj_list_aux=(*db_model->getObjectList(ObjBaseRelationship)); obj_list.insert(obj_list.end(), obj_list_aux.begin(), obj_list_aux.end()); } @@ -760,7 +760,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) object=obj_list.at(i1); item2=createItemForObject(object, item1); - if(types[i]==OBJ_TAG) + if(types[i]==ObjTag) { db_model->getObjectReferences(object, ref_list); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index cc2469406b..d50b40a265 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -123,7 +123,7 @@ void ModelsDiffHelper::cancelDiff(void) void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned diff_type) { - ObjectType types[2]={ OBJ_COLUMN, OBJ_CONSTRAINT }; + ObjectType types[2]={ ObjColumn, ObjConstraint }; vector *tab_objs=nullptr; Constraint *constr=nullptr; Table *ref_tab=nullptr, *comp_tab=nullptr; @@ -168,7 +168,7 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d at diffModels() */ if(aux_obj && diff_type!=ObjectsDiffInfo::DROP_OBJECT && ((tab_obj->isAddedByGeneralization() || !tab_obj->isAddedByLinking() || - (aux_obj->getObjectType()==OBJ_COLUMN && tab_obj->isAddedByLinking())) || + (aux_obj->getObjectType()==ObjColumn && tab_obj->isAddedByLinking())) || (constr && constr->getConstraintType()!=ConstraintType::foreign_key))) { //If there are some differences on the XML code of the objects @@ -237,12 +237,12 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) idx++; /* If this checking the following objects are discarded: - 1) BASE_RELATIONSHIP objects + 1) ObjBaseRelationship objects 2) Objects which SQL code is disabled or system objects 3) Cluster objects such as roles and tablespaces (when the operatoin is DROP and keep_cluster_objs is true) */ - if(obj_type!=BASE_RELATIONSHIP && + if(obj_type!=ObjBaseRelationship && !object->isSystemObject() && !object->isSQLDisabled() && - ((diff_type==ObjectsDiffInfo::DROP_OBJECT && (!diff_opts[OPT_KEEP_CLUSTER_OBJS] || (diff_opts[OPT_KEEP_CLUSTER_OBJS] && obj_type!=OBJ_ROLE && obj_type!=OBJ_TABLESPACE))) || + ((diff_type==ObjectsDiffInfo::DROP_OBJECT && (!diff_opts[OPT_KEEP_CLUSTER_OBJS] || (diff_opts[OPT_KEEP_CLUSTER_OBJS] && obj_type!=ObjRole && obj_type!=ObjTablespace))) || (diff_type!=ObjectsDiffInfo::DROP_OBJECT))) { emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), @@ -250,11 +250,11 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) object->getObjectType()); //Processing objects that are not database, table child object (they are processed further) - if(obj_type!=OBJ_DATABASE && !TableObject::isTableObject(obj_type)) + if(obj_type!=ObjDatabase && !TableObject::isTableObject(obj_type)) { /* Processing permissions. If the operation is DROP and keep_obj_perms is true the the permission is ignored */ - if(obj_type==OBJ_PERMISSION && + if(obj_type==ObjPermission && ((diff_type==ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OPT_KEEP_OBJ_PERMS]) || @@ -265,7 +265,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) generateDiffInfo(diff_type, object); //Processing relationship (in this case only generalization and patitioning ones are considered) - else if(obj_type==OBJ_RELATIONSHIP) + else if(obj_type==ObjRelationship) { Table *ref_tab=nullptr, *rec_tab=nullptr; Relationship *rel=dynamic_cast(object); @@ -299,14 +299,14 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) } } } - else if(obj_type!=OBJ_PERMISSION) + else if(obj_type!=ObjPermission) { //Get the object from the database obj_name=object->getSignature(); aux_object=aux_model->getObject(obj_name, obj_type); //Special case for many-to-many relationships - if(obj_type==OBJ_TABLE && !aux_object) + if(obj_type==ObjTable && !aux_object) aux_object=getRelNNTable(obj_name, aux_model); if(diff_type != ObjectsDiffInfo::DROP_OBJECT && aux_object) @@ -339,7 +339,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) generateDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, object, aux_object); //If the object is a table, do additional comparision between their child objects - if((!diff_opts[OPT_FORCE_RECREATION] || diff_opts[OPT_RECREATE_UNCHANGEBLE]) && object->getObjectType()==OBJ_TABLE) + if((!diff_opts[OPT_FORCE_RECREATION] || diff_opts[OPT_RECREATE_UNCHANGEBLE]) && object->getObjectType()==ObjTable) { Table *tab=dynamic_cast
(object), *aux_tab=dynamic_cast
(aux_object); diffTables(tab, aux_tab, ObjectsDiffInfo::DROP_OBJECT); @@ -421,7 +421,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) if(aux_base_tab) { - if(obj_type==OBJ_CONSTRAINT) + if(obj_type==ObjConstraint) { Table *aux_table=dynamic_cast
(aux_base_tab); aux_tab_obj=aux_table->getObject(obj_name, obj_type); @@ -444,7 +444,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) BaseObject *ModelsDiffHelper::getRelNNTable(const QString &obj_name, DatabaseModel *model) { - vector *rels=model->getObjectList(OBJ_RELATIONSHIP); + vector *rels=model->getObjectList(ObjRelationship); Relationship *rel=nullptr; BaseObject *tab=nullptr; @@ -528,7 +528,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, emit s_objectsDiffInfoGenerated(diff_info); } - if(!diff_opts[OPT_REUSE_SEQUENCES] || imported_model->getObjectIndex(seq->getSignature(), OBJ_SEQUENCE) < 0) + if(!diff_opts[OPT_REUSE_SEQUENCES] || imported_model->getObjectIndex(seq->getSignature(), ObjSequence) < 0) { //Creates a CREATE info with the sequence diff_info=ObjectsDiffInfo(ObjectsDiffInfo::CREATE_OBJECT, seq, nullptr); @@ -545,7 +545,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, while(itr!=itr_end) { if(itr->getDiffType()==ObjectsDiffInfo::DROP_OBJECT && - itr->getObject()->getObjectType()==OBJ_SEQUENCE && + itr->getObject()->getObjectType()==ObjSequence && itr->getObject()->getSignature()==seq->getSignature()) { diff_infos.erase(itr); @@ -584,8 +584,8 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, /* Avoiding columns to be dropped when a sequence linked to them is dropped too. This because a column can be a reference to a sequence so to avoid drop and recreate that column this one will not be erased, unless the column does not exists in the model anymore */ - if((obj_type==OBJ_SEQUENCE && obj->getObjectType()!=OBJ_COLUMN) && - (obj_type!=OBJ_SEQUENCE && obj->getObjectType()!=BASE_RELATIONSHIP)) + if((obj_type==ObjSequence && obj->getObjectType()!=ObjColumn) && + (obj_type!=ObjSequence && obj->getObjectType()!=ObjBaseRelationship)) generateDiffInfo(diff_type, obj); if(diff_canceled) @@ -651,7 +651,7 @@ void ModelsDiffHelper::processDiffInfos(void) emit s_progressUpdated(0, trUtf8("Processing diff infos...")); //Reuniting the schema names to inject a SET search_path command - for(auto &schema : *imported_model->getObjectList(OBJ_SCHEMA)) + for(auto &schema : *imported_model->getObjectList(ObjSchema)) sch_names.push_back(schema->getName(true)); //Separating the base types @@ -718,13 +718,13 @@ void ModelsDiffHelper::processDiffInfos(void) //Undoing inheritances no_inherit_def+=rel->getAlterRelationshipDefinition(true); } - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) //Unsetting permissions unset_perms+=object->getDropDefinition(diff_opts[OPT_CASCADE_MODE]); else { //Ordinary drop commands for any object except columns - if(obj_type!=OBJ_COLUMN) + if(obj_type!=ObjColumn) drop_objs[object->getObjectId()]=getCodeDefinition(object, true); else { @@ -745,14 +745,14 @@ void ModelsDiffHelper::processDiffInfos(void) //Creating inheritances inherit_def+=rel->getAlterRelationshipDefinition(false); } - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) //Setting permissions set_perms+=object->getCodeDefinition(SchemaParser::SQL_DEFINITION); else { /* Special case for constaints: the creation commands for these objects are appended at the very end of create commands secion. Primary keys, unique keys, check constraints and exclude constraints are created after foreign keys */ - if(object->getObjectType()==OBJ_CONSTRAINT) + if(object->getObjectType()==ObjConstraint) { if(dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) create_fks[object->getObjectId()]=getCodeDefinition(object, false); @@ -763,7 +763,7 @@ void ModelsDiffHelper::processDiffInfos(void) { create_objs[object->getObjectId()]=getCodeDefinition(object, false); - if(obj_type==OBJ_SCHEMA) + if(obj_type==ObjSchema) sch_names.push_back(object->getName(true)); } } @@ -772,7 +772,7 @@ void ModelsDiffHelper::processDiffInfos(void) else if(diff_type==ObjectsDiffInfo::ALTER_OBJECT) { //Recreating the object instead of generating an ALTER command for it - if((diff_opts[OPT_FORCE_RECREATION] && obj_type!=OBJ_DATABASE) && + if((diff_opts[OPT_FORCE_RECREATION] && obj_type!=ObjDatabase) && (!diff_opts[OPT_RECREATE_UNCHANGEBLE] || (diff_opts[OPT_RECREATE_UNCHANGEBLE] && !object->acceptsAlterCommand() && diff.getObject()->getCodeDefinition(SchemaParser::SQL_DEFINITION).simplified()!= @@ -792,7 +792,7 @@ void ModelsDiffHelper::processDiffInfos(void) { /* Special case for constraints, their code will be appeded to a separated variable in order to create them at the end of diff buffer */ - if(obj->getObjectType()==OBJ_CONSTRAINT) + if(obj->getObjectType()==ObjConstraint) { if(dynamic_cast(obj)->getConstraintType()==ConstraintType::foreign_key) create_fks[obj->getObjectId()]=getCodeDefinition(obj, false); @@ -812,7 +812,7 @@ void ModelsDiffHelper::processDiffInfos(void) if(diff.getOldObject()) alter_def=diff.getOldObject()->getAlterDefinition(object); - if(obj_type == OBJ_DATABASE && diff_opts[OPT_PRESERVE_DB_NAME]) + if(obj_type == ObjDatabase && diff_opts[OPT_PRESERVE_DB_NAME]) alter_def.remove(QRegExp(QString("(ALTER)( )+(DATABASE)( )+(%1)( )+(RENAME)( )+(TO)(.)*(\\n)").arg(diff.getOldObject()->getSignature()))); if(!alter_def.isEmpty()) @@ -821,7 +821,7 @@ void ModelsDiffHelper::processDiffInfos(void) /* If the object is a column checks if the types of the columns are differents, generating a TRUNCATE TABLE for the parent table */ - if(obj_type==OBJ_COLUMN && diff_opts[OPT_TRUCANTE_TABLES]) + if(obj_type==ObjColumn && diff_opts[OPT_TRUCANTE_TABLES]) { Column *src_col=dynamic_cast(object), *old_col=dynamic_cast(diff.getOldObject()); @@ -887,7 +887,7 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[ParsersAttributes::FK_DEFS]=QString(); attribs[ParsersAttributes::UNSET_PERMS]=unset_perms; attribs[ParsersAttributes::SET_PERMS]=set_perms; - attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(OBJ_FUNCTION)!=0 ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjFunction)!=0 ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::SEARCH_PATH]=(has_diffs ? sch_names.join(',') : QString()); ritr=drop_objs.rbegin(); @@ -956,7 +956,7 @@ QString ModelsDiffHelper::getCodeDefinition(BaseObject *object, bool drop_cmd) /* For columns and constraints it is needed to force the generation of ALTER commands on the parent table */ - if(tab_obj && (tab_obj->getObjectType()==OBJ_COLUMN || tab_obj->getObjectType()==OBJ_CONSTRAINT)) + if(tab_obj && (tab_obj->getObjectType()==ObjColumn || tab_obj->getObjectType()==ObjConstraint)) { bool gen_alter=false; Table *table=dynamic_cast
(tab_obj->getParentTable()); @@ -1004,9 +1004,9 @@ void ModelsDiffHelper::destroyTempObjects(void) void ModelsDiffHelper::recreateObject(BaseObject *object, vector &drop_objs, vector &create_objs) { if(object && - object->getObjectType()!=BASE_RELATIONSHIP && - object->getObjectType()!=OBJ_RELATIONSHIP && - object->getObjectType()!=OBJ_DATABASE) + object->getObjectType()!=ObjBaseRelationship && + object->getObjectType()!=ObjRelationship && + object->getObjectType()!=ObjDatabase) { vector ref_objs; BaseObject *aux_obj=nullptr; @@ -1034,7 +1034,7 @@ void ModelsDiffHelper::recreateObject(BaseObject *object, vector & /* If the to-be recreate object is a constraint check if it's a pk, if so, the fk's linked to it need to be recreated as well */ - if(aux_obj->getObjectType()==OBJ_CONSTRAINT) + if(aux_obj->getObjectType()==ObjConstraint) { Constraint *constr=dynamic_cast(aux_obj); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.h b/libpgmodeler_ui/src/modelsdiffhelper.h index e24e588057..98aa34b08e 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.h +++ b/libpgmodeler_ui/src/modelsdiffhelper.h @@ -164,7 +164,7 @@ class ModelsDiffHelper: public QObject { signals: //! \brief This singal is emitted whenever the diff progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=BASE_OBJECT); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjBaseObject); //! \brief This signal is emited when the diff has finished void s_diffFinished(void); diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index ef3d6ddab1..e08cbddfa6 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -106,7 +106,7 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) } } - if(aux_obj && (aux_obj->getObjectType()==OBJ_VIEW || aux_obj->getObjectType()==OBJ_TABLE)) + if(aux_obj && (aux_obj->getObjectType()==ObjView || aux_obj->getObjectType()==ObjTable)) { vector base_rels=db_model->getRelationships(dynamic_cast(aux_obj)); for(auto &rel : base_rels) @@ -143,8 +143,8 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) /* If the last element of the referrer objects is a table or view the info object itself need to be renamed since tables and views will not be renamed */ - bool rename_obj=(refs.back()->getObjectType()==OBJ_TABLE || - refs.back()->getObjectType()==OBJ_VIEW); + bool rename_obj=(refs.back()->getObjectType()==ObjTable || + refs.back()->getObjectType()==ObjView); if(rename_obj) { @@ -263,11 +263,11 @@ void ModelValidationHelper::validateModel(void) try { - ObjectType types[]={ OBJ_ROLE, OBJ_TABLESPACE, OBJ_SCHEMA, OBJ_LANGUAGE, OBJ_FUNCTION, - OBJ_TYPE, OBJ_DOMAIN, OBJ_SEQUENCE, OBJ_OPERATOR, OBJ_OPFAMILY, - OBJ_OPCLASS, OBJ_COLLATION, OBJ_TABLE, OBJ_EXTENSION, OBJ_VIEW, OBJ_RELATIONSHIP }, - aux_types[]={ OBJ_TABLE, OBJ_VIEW }, - tab_obj_types[]={ OBJ_CONSTRAINT, OBJ_INDEX }, + ObjectType types[]={ ObjRole, ObjTablespace, ObjSchema, ObjLanguage, ObjFunction, + ObjType, ObjDomain, ObjSequence, ObjOperator, ObjOpFamily, + ObjOpClass, ObjCollation, ObjTable, ObjExtension, ObjView, ObjRelationship }, + aux_types[]={ ObjTable, ObjView }, + tab_obj_types[]={ ObjConstraint, ObjIndex }, obj_type; unsigned i, i1, cnt, aux_cnt=sizeof(aux_types)/sizeof(ObjectType), count=sizeof(types)/sizeof(ObjectType), count1=sizeof(tab_obj_types)/sizeof(ObjectType); @@ -282,7 +282,7 @@ void ModelValidationHelper::validateModel(void) map > dup_objects; map >::iterator mitr; QString name, signal_msg=QString("`%1' (%2)"); - bool postgis_exists = db_model->getObjectIndex(QString("postgis"), OBJ_EXTENSION) >= 0; + bool postgis_exists = db_model->getObjectIndex(QString("postgis"), ObjExtension) >= 0; warn_count=error_count=progress=0; val_infos.clear(); @@ -309,7 +309,7 @@ void ModelValidationHelper::validateModel(void) /* Special validation case: For generalization and copy relationships validates the ids of participant tables. * Reference table cannot own an id greater thant receiver table */ - if(obj_type==OBJ_RELATIONSHIP) + if(obj_type==ObjRelationship) { rel=dynamic_cast(object); if(rel->getRelationshipType()==Relationship::RELATIONSHIP_GEN || @@ -362,9 +362,9 @@ void ModelValidationHelper::validateModel(void) /* Validating a special object. The validation made here is to check if the special object (constraint/index/trigger/view) references a column added by a relationship and that relationship is being created after the creation of the special object */ - if(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW /* || obj_type==OBJ_SEQUENCE */) + if(obj_type==ObjTable || obj_type==ObjView /* || obj_type==ObjSequence */) { - vector tab_aux_types={ OBJ_CONSTRAINT, OBJ_TRIGGER, OBJ_INDEX }; + vector tab_aux_types={ ObjConstraint, ObjTrigger, ObjIndex }; vector *tab_objs; vector ref_cols; vector rels; @@ -391,14 +391,14 @@ void ModelValidationHelper::validateModel(void) if(!tab_obj->isAddedByRelationship()) { - if(obj_tp==OBJ_CONSTRAINT) + if(obj_tp==ObjConstraint) { constr=dynamic_cast(tab_obj); if(constr->getConstraintType()!=ConstraintType::primary_key) ref_cols=constr->getRelationshipAddedColumns(); } - else if(obj_tp==OBJ_TRIGGER) + else if(obj_tp==ObjTrigger) ref_cols=dynamic_cast(tab_obj)->getRelationshipAddedColumns(); else ref_cols=dynamic_cast(tab_obj)->getRelationshipAddedColumns(); @@ -445,7 +445,7 @@ void ModelValidationHelper::validateModel(void) /* Step 2: Validating name conflitcs between primary keys, unique keys, exclude constraints and indexs of all tables/views. The table and view names are checked too. */ - obj_list=db_model->getObjectList(OBJ_TABLE); + obj_list=db_model->getObjectList(ObjTable); itr=obj_list->begin(); //Searching the model's tables and gathering all the constraints and index @@ -520,7 +520,7 @@ void ModelValidationHelper::validateModel(void) // Step 3: Checking if columns of any table is using GiS data types and the postgis extension is not created. if(!postgis_exists) { - obj_list=db_model->getObjectList(OBJ_TABLE); + obj_list=db_model->getObjectList(ObjTable); itr=obj_list->begin(); i=0; @@ -529,7 +529,7 @@ void ModelValidationHelper::validateModel(void) table = dynamic_cast
(*itr); itr++; - for(auto &obj : *table->getObjectList(OBJ_COLUMN)) + for(auto &obj : *table->getObjectList(ObjColumn)) { col = dynamic_cast(obj); @@ -547,8 +547,8 @@ void ModelValidationHelper::validateModel(void) only when there is no validation infos generated because for each broken relationship there is the need to do a revalidation of all relationships */ if(val_infos.empty()) { - obj_list=db_model->getObjectList(OBJ_RELATIONSHIP); - itr=db_model->getObjectList(OBJ_RELATIONSHIP)->begin(); + obj_list=db_model->getObjectList(ObjRelationship); + itr=db_model->getObjectList(ObjRelationship)->begin(); while(itr!=obj_list->end() && !valid_canceled) { diff --git a/libpgmodeler_ui/src/modelvalidationhelper.h b/libpgmodeler_ui/src/modelvalidationhelper.h index abde765d10..a0a15e8e10 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.h +++ b/libpgmodeler_ui/src/modelvalidationhelper.h @@ -113,7 +113,7 @@ class ModelValidationHelper: public QObject { void s_validationInfoGenerated(ValidationInfo val_info); //! \brief This signal is emitted when the validation progress changes - void s_progressUpdated(int prog, QString msg, ObjectType obj_type=BASE_OBJECT, QString cmd=QString(), bool is_code_gen=false); + void s_progressUpdated(int prog, QString msg, ObjectType obj_type=ObjBaseObject, QString cmd=QString(), bool is_code_gen=false); //! \brief This signal is emitted when the object is processed by the validator void s_objectProcessed(QString obj_name, ObjectType obj_type); diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index a95b444bd2..716db355a4 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -273,7 +273,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) label->setText(trUtf8("The column %1 on %2 (%3) is referencing the geospatial data type %4 but the postgis extension is not present in the model!") .arg(col->getName()) .arg(col->getParentTable()->getSignature(true)) - .arg(BaseObject::getTypeName(OBJ_TABLE)) + .arg(BaseObject::getTypeName(ObjTable)) .arg(~col->getType())); } else @@ -450,7 +450,7 @@ void ModelValidationWidget::updateProgress(int prog, QString msg, ObjectType obj msg=PgModelerUiNS::formatMessage(msg); - if(obj_type!=BASE_OBJECT) + if(obj_type!=ObjBaseObject) ico=QPixmap(PgModelerUiNS::getIconPath(obj_type)); else if(!cmd.isEmpty()) ico=QPixmap(PgModelerUiNS::getIconPath("sqlcmd")); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 9123554965..1facfefd04 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -81,14 +81,14 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) QAction *action=nullptr; QString str_ico; QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen"), QString("part") }; - ObjectType types[]={ OBJ_TABLE, OBJ_VIEW, OBJ_TEXTBOX, OBJ_RELATIONSHIP, - OBJ_CAST, OBJ_CONVERSION, OBJ_DOMAIN, - OBJ_FUNCTION, OBJ_AGGREGATE, OBJ_LANGUAGE, - OBJ_OPCLASS, OBJ_OPERATOR, OBJ_OPFAMILY, - OBJ_ROLE, OBJ_SCHEMA, OBJ_SEQUENCE, OBJ_TYPE, - OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_RULE, OBJ_TRIGGER, OBJ_INDEX, OBJ_POLICY, - OBJ_TABLESPACE, OBJ_COLLATION, OBJ_EXTENSION, OBJ_EVENT_TRIGGER, OBJ_TAG, - OBJ_GENERIC_SQL }; + ObjectType types[]={ ObjTable, ObjView, ObjTextbox, ObjRelationship, + ObjCast, ObjConversion, ObjDomain, + ObjFunction, ObjAggregate, ObjLanguage, + ObjOpClass, ObjOperator, ObjOpFamily, + ObjRole, ObjSchema, ObjSequence, ObjType, + ObjColumn, ObjConstraint, ObjRule, ObjTrigger, ObjIndex, ObjPolicy, + ObjTablespace, ObjCollation, ObjExtension, ObjEventTrigger, ObjTag, + ObjGenericSQL }; unsigned i, obj_cnt=sizeof(types)/sizeof(ObjectType), rel_types_id[]={ BaseRelationship::RELATIONSHIP_11, BaseRelationship::RELATIONSHIP_1N, BaseRelationship::RELATIONSHIP_NN, BaseRelationship::RELATIONSHIP_DEP, @@ -96,7 +96,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) current_zoom=1; modified=panning_mode=false; - new_obj_type=BASE_OBJECT; + new_obj_type=ObjBaseObject; //Generating a temporary file name for the model QTemporaryFile tmp_file; @@ -368,17 +368,17 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) //Creating the relationship submenu rels_menu=new QMenu(this); - actions_new_objects[OBJ_RELATIONSHIP]->setMenu(rels_menu); + actions_new_objects[ObjRelationship]->setMenu(rels_menu); for(int i=0; i < rel_types_cod.size(); i++) { - str_ico=BaseObject::getSchemaName(OBJ_RELATIONSHIP) + rel_types_cod[i]; + str_ico=BaseObject::getSchemaName(ObjRelationship) + rel_types_cod[i]; action=new QAction(QIcon(PgModelerUiNS::getIconPath(str_ico)), BaseRelationship::getRelationshipTypeName(rel_types_id[i], false), this); //Storing a unique identifier for the relationship type - action->setData(QVariant(OBJ_RELATIONSHIP + rel_types_id[i])); + action->setData(QVariant(ObjRelationship + rel_types_id[i])); connect(action, SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); rels_menu->addAction(action); @@ -388,13 +388,13 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) new_obj_overlay_wgt->setObjectName(QString("new_obj_overlay_wgt")); new_obj_overlay_wgt->setVisible(false); - vector graph_types = { BASE_OBJECT, OBJ_SCHEMA, OBJ_TABLE, OBJ_VIEW, OBJ_RELATIONSHIP, OBJ_TEXTBOX }; + vector graph_types = { ObjBaseObject, ObjSchema, ObjTable, ObjView, ObjRelationship, ObjTextbox }; QStringList labels = { trUtf8("All objects"), trUtf8("Schemas"), trUtf8("Tables"), trUtf8("Views"), trUtf8("Relationships"), trUtf8("Textboxes") }; i=0; for(auto &obj_type : graph_types) { - if(obj_type == BASE_OBJECT) + if(obj_type == ObjBaseObject) { action=new QAction(labels[i++], this); action->setShortcut(QKeySequence(trUtf8("Ctrl+A"))); @@ -666,7 +666,7 @@ void ModelWidget::mousePressEvent(QMouseEvent *event) { /* If the user is adding a graphical object, the left click will set the initial position and show the editing form related to the object type */ - if(!simple_obj_creation && (new_obj_type==OBJ_TABLE || new_obj_type==OBJ_TEXTBOX || new_obj_type==OBJ_VIEW)) + if(!simple_obj_creation && (new_obj_type==ObjTable || new_obj_type==ObjTextbox || new_obj_type==ObjView)) { this->scene->enableRangeSelection(false); this->showObjectForm(new_obj_type, nullptr, nullptr, viewport->mapToScene(event->pos())); @@ -760,20 +760,20 @@ void ModelWidget::handleObjectAddition(BaseObject *object) switch(obj_type) { - case OBJ_TABLE: + case ObjTable: item=new TableView(dynamic_cast
(graph_obj)); break; - case OBJ_VIEW: + case ObjView: item=new GraphicalView(dynamic_cast(graph_obj)); break; - case OBJ_RELATIONSHIP: - case BASE_RELATIONSHIP: + case ObjRelationship: + case ObjBaseRelationship: item=new RelationshipView(dynamic_cast(graph_obj)); break; break; - case OBJ_SCHEMA: + case ObjSchema: if(!graph_obj->isSystemObject() || (graph_obj->isSystemObject() && graph_obj->getName()==QString("public"))) { @@ -808,11 +808,11 @@ void ModelWidget::addNewObject(void) these types after select a table or schema, respectively */ if(selected_objects.size()==1 && (TableObject::isTableObject(obj_type) || - selected_objects[0]->getObjectType()==OBJ_SCHEMA)) + selected_objects[0]->getObjectType()==ObjSchema)) parent_obj=selected_objects[0]; //Creating a table or view inside a schema - if(parent_obj && parent_obj->getObjectType()==OBJ_SCHEMA && (obj_type==OBJ_TABLE || obj_type==OBJ_VIEW)) + if(parent_obj && parent_obj->getObjectType()==ObjSchema && (obj_type==ObjTable || obj_type==ObjView)) { BaseObjectView *sch_graph=dynamic_cast(dynamic_cast(parent_obj)->getReceiverObject()); QSizeF size = sch_graph->boundingRect().size(); @@ -829,17 +829,17 @@ void ModelWidget::addNewObject(void) this->showObjectForm(obj_type, nullptr, parent_obj, pos); } - else if(obj_type!=OBJ_TABLE && obj_type!=OBJ_VIEW && - obj_type!=OBJ_TEXTBOX && obj_type <= BASE_TABLE) + else if(obj_type!=ObjTable && obj_type!=ObjView && + obj_type!=ObjTextbox && obj_type <= ObjBaseTable) this->showObjectForm(obj_type, nullptr, parent_obj); else { /* A small checking to enable the overlay widget to create relationships and other graphical objects without the user click on the canvas area */ - if((obj_type > BASE_OBJECT && + if((obj_type > ObjBaseObject && selected_objects.size()==2 && - selected_objects.at(0)->getObjectType()==OBJ_TABLE && - selected_objects.at(1)->getObjectType()==OBJ_TABLE)) + selected_objects.at(0)->getObjectType()==ObjTable && + selected_objects.at(1)->getObjectType()==ObjTable)) { this->showObjectForm(obj_type); } @@ -847,7 +847,7 @@ void ModelWidget::addNewObject(void) { //Simple table|view|textbox creation if(simple_obj_creation && - (obj_type==OBJ_TABLE || obj_type==OBJ_VIEW || obj_type==OBJ_TEXTBOX)) + (obj_type==ObjTable || obj_type==ObjView || obj_type==ObjTextbox)) this->showObjectForm(obj_type, nullptr, parent_obj, viewport->mapToScene(viewport->rect().center())); else { @@ -860,7 +860,7 @@ void ModelWidget::addNewObject(void) * we force the enabling of the relationship creation steps. This will automatically selects the current table * as source table of the relationship */ if(selected_objects.size() == 1 && - selected_objects[0]->getObjectType() == OBJ_TABLE && new_obj_type > BASE_TABLE) + selected_objects[0]->getObjectType() == ObjTable && new_obj_type > ObjBaseTable) configureObjectSelection(); } } @@ -878,7 +878,7 @@ void ModelWidget::handleObjectRemoval(BaseObject *object) //Updates the parent schema if the removed object were a table or view if(graph_obj->getSchema() && - (graph_obj->getObjectType()==OBJ_TABLE || graph_obj->getObjectType()==OBJ_VIEW)) + (graph_obj->getObjectType()==ObjTable || graph_obj->getObjectType()==ObjView)) dynamic_cast(graph_obj->getSchema())->setModified(true); } @@ -890,7 +890,7 @@ void ModelWidget::handleObjectDoubleClick(BaseGraphicObject *object) if(object) this->showObjectForm(object->getObjectType(), object, nullptr, object->getPosition()); else - this->showObjectForm(OBJ_DATABASE, db_model); + this->showObjectForm(ObjDatabase, db_model); } void ModelWidget::handleObjectsMovement(bool end_moviment) @@ -945,7 +945,7 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) obj=dynamic_cast(*itr); itr++; - if(obj->getObjectType()==OBJ_TABLE || obj->getObjectType()==OBJ_VIEW) + if(obj->getObjectType()==ObjTable || obj->getObjectType()==ObjView) { Schema *schema=dynamic_cast(dynamic_cast(obj)->getSchema()); @@ -1023,9 +1023,9 @@ void ModelWidget::configureObjectSelection(void) itr++; } - /* Case the new_obj_type is a value greater the BASE_TABLE indicates that the user + /* Case the new_obj_type is a value greater the ObjBaseTable indicates that the user (un)selected a object using some "Relationship" action */ - if(new_obj_type > BASE_TABLE) + if(new_obj_type > ObjBaseTable) { unsigned count=selected_objects.size(); ObjectType obj_type1, obj_type2; @@ -1037,11 +1037,11 @@ void ModelWidget::configureObjectSelection(void) { //Get the selected objects types obj_type1=selected_objects[0]->getObjectType(); - obj_type2=(count==2 ? selected_objects[1]->getObjectType() : BASE_OBJECT); + obj_type2=(count==2 ? selected_objects[1]->getObjectType() : ObjBaseObject); //If there is only one selected object and this is a table, activates the relationship creation if(!scene->isRelationshipLineVisible() && - count==1 && obj_type1==OBJ_TABLE && new_obj_type > BASE_TABLE && QApplication::keyboardModifiers()==0) + count==1 && obj_type1==ObjTable && new_obj_type > ObjBaseTable && QApplication::keyboardModifiers()==0) { BaseGraphicObject *graph_obj=dynamic_cast(selected_objects[0]); BaseObjectView *object=dynamic_cast(graph_obj->getReceiverObject()); @@ -1051,15 +1051,15 @@ void ModelWidget::configureObjectSelection(void) object->scenePos().y() + object->boundingRect().height()/2)); } //If the user has selected object that are not tables, cancel the operation - else if(obj_type1!=OBJ_TABLE || (obj_type2!=OBJ_TABLE && obj_type2!=BASE_OBJECT)) + else if(obj_type1!=ObjTable || (obj_type2!=ObjTable && obj_type2!=ObjBaseObject)) { this->cancelObjectAddition(); } /* Case there is only one selected object (table) and the SHIFT key is pressed too, creates a self-relationship. Case there is two selected objects, create a relationship between them */ - else if((count==1 && obj_type1==OBJ_TABLE && QApplication::keyboardModifiers()==Qt::ShiftModifier) || - (count==2 && obj_type1==OBJ_TABLE && obj_type2==OBJ_TABLE)) + else if((count==1 && obj_type1==ObjTable && QApplication::keyboardModifiers()==Qt::ShiftModifier) || + (count==2 && obj_type1==ObjTable && obj_type2==ObjTable)) { /* Forcing no signals to be emitted by the scene while the relationship is being configured to avoid this * method to be called unecessarily */ @@ -1088,7 +1088,7 @@ void ModelWidget::selectAllObjects(void) ObjectType obj_type = static_cast(act->data().toUInt()); - if(obj_type == BASE_OBJECT) + if(obj_type == ObjBaseObject) { QPainterPath pth; pth.addRect(scene->sceneRect()); @@ -1102,8 +1102,8 @@ void ModelWidget::selectAllObjects(void) BaseObjectView *obj_view = nullptr; vector objs = *db_model->getObjectList(obj_type); - if(obj_type == OBJ_RELATIONSHIP) - objs.insert(objs.end(), db_model->getObjectList(BASE_RELATIONSHIP)->begin(), db_model->getObjectList(BASE_RELATIONSHIP)->end()); + if(obj_type == ObjRelationship) + objs.insert(objs.end(), db_model->getObjectList(ObjBaseRelationship)->begin(), db_model->getObjectList(ObjBaseRelationship)->end()); for(auto &obj : objs) { @@ -1257,7 +1257,7 @@ void ModelWidget::convertRelationshipNN(void) //Renames the table if there is other with the same name on the model avoiding conflicts tab->setName(tab_name); - tab->setName(PgModelerNS::generateUniqueName(tab, *db_model->getObjectList(OBJ_TABLE))); + tab->setName(PgModelerNS::generateUniqueName(tab, *db_model->getObjectList(ObjTable))); op_list->startOperationChain(); @@ -1293,7 +1293,7 @@ void ModelWidget::convertRelationshipNN(void) for(QString pk_col : pk_cols) aux_constr->addColumn(tab->getColumn(pk_col), Constraint::SOURCE_COLS); - aux_constr->setName(PgModelerNS::generateUniqueName(tab, *tab->getObjectList(OBJ_CONSTRAINT), false, QString("_pk"))); + aux_constr->setName(PgModelerNS::generateUniqueName(tab, *tab->getObjectList(ObjConstraint), false, QString("_pk"))); tab->addConstraint(aux_constr); op_list->registerObject(aux_constr, Operation::OBJECT_CREATED, -1, tab); @@ -1393,7 +1393,7 @@ void ModelWidget::adjustSceneSize(void) if(align_objs) { scene->alignObjectsToGrid(); - db_model->setObjectsModified({ OBJ_RELATIONSHIP, BASE_RELATIONSHIP }); + db_model->setObjectsModified({ ObjRelationship, ObjBaseRelationship }); } emit s_sceneInteracted(scene_rect.size()); @@ -1657,17 +1657,17 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb Schema *sel_schema=dynamic_cast(parent_obj); QPointF obj_pos=pos; - /* Case the obj_type is greater than BASE_TABLE indicates that the object type is a + /* Case the obj_type is greater than ObjBaseTable indicates that the object type is a relationship. To get the specific relationship id (1-1, 1-n, n-n, gen, dep) is necessary - to subtract the OBJ_RELATIONSHIP from the obj_type parameter, the result will point + to subtract the ObjRelationship from the obj_type parameter, the result will point to the BaseRelationship::RELATIONSHIP_??? constant. */ - if(obj_type > BASE_TABLE) + if(obj_type > ObjBaseTable) { - rel_type=obj_type - OBJ_RELATIONSHIP; - obj_type=OBJ_RELATIONSHIP; + rel_type=obj_type - ObjRelationship; + obj_type=ObjRelationship; } - if(obj_type!=OBJ_PERMISSION) + if(obj_type!=ObjPermission) { if(object && obj_type!=object->getObjectType()) throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1682,83 +1682,83 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb /* Raises an error if the user try to edit a reserverd object. The only exception is for "public" schema that can be edited only on its fill color an rectangle attributes */ if(object && object->isSystemObject() && - (object->getObjectType()!=OBJ_SCHEMA || object->getName()!="public")) + (object->getObjectType()!=ObjSchema || object->getName()!="public")) throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(object->getName()).arg(object->getTypeName()), OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type==OBJ_SCHEMA) + if(obj_type==ObjSchema) res=openEditingForm(object); - else if(obj_type==OBJ_ROLE) + else if(obj_type==ObjRole) res=openEditingForm(object); - else if(obj_type==OBJ_TABLESPACE) + else if(obj_type==ObjTablespace) res=openEditingForm(object); - else if(obj_type==OBJ_LANGUAGE) + else if(obj_type==ObjLanguage) res=openEditingForm(object); - else if(obj_type==OBJ_CAST) + else if(obj_type==ObjCast) res=openEditingForm(object); - else if(obj_type==OBJ_TAG) + else if(obj_type==ObjTag) res=openEditingForm(object); - else if(obj_type== OBJ_EVENT_TRIGGER) + else if(obj_type== ObjEventTrigger) res=openEditingForm(object); - else if(obj_type==OBJ_FUNCTION) + else if(obj_type==ObjFunction) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_CONVERSION) + else if(obj_type==ObjConversion) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_DOMAIN) + else if(obj_type==ObjDomain) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_AGGREGATE) + else if(obj_type==ObjAggregate) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_SEQUENCE) + else if(obj_type==ObjSequence) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_OPFAMILY) + else if(obj_type==ObjOpFamily) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_OPCLASS) + else if(obj_type==ObjOpClass) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_TYPE) + else if(obj_type==ObjType) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_COLLATION) + else if(obj_type==ObjCollation) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_EXTENSION) + else if(obj_type==ObjExtension) res=openEditingForm(object, sel_schema); - else if(obj_type==OBJ_TABLE) + else if(obj_type==ObjTable) res=openEditingForm(object, sel_schema, obj_pos); - else if(obj_type==OBJ_VIEW) + else if(obj_type==ObjView) res=openEditingForm(object, sel_schema, obj_pos); - else if(obj_type==OBJ_RULE) + else if(obj_type==ObjRule) res=openEditingForm(object, parent_obj); - else if(obj_type== OBJ_TRIGGER) + else if(obj_type== ObjTrigger) res=openEditingForm(object, parent_obj); - else if(obj_type== OBJ_INDEX) + else if(obj_type== ObjIndex) res=openEditingForm(object, parent_obj); - else if(obj_type== OBJ_POLICY) + else if(obj_type== ObjPolicy) res=openEditingForm(object, parent_obj); - else if(obj_type==OBJ_COLUMN || obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjColumn || obj_type==ObjConstraint) { TableObject *tab_obj=dynamic_cast(object); - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) res=openEditingForm(object, parent_obj); else res=openEditingForm(object, parent_obj); if(res==QDialog::Accepted) { - if(tab_obj && parent_obj->getObjectType()==OBJ_TABLE) + if(tab_obj && parent_obj->getObjectType()==ObjTable) db_model->validateRelationships(tab_obj, dynamic_cast
(parent_obj)); else db_model->validateRelationships(); } } - else if(obj_type==BASE_RELATIONSHIP || obj_type==OBJ_RELATIONSHIP) + else if(obj_type==ObjBaseRelationship || obj_type==ObjRelationship) { RelationshipWidget *relationship_wgt=new RelationshipWidget; if(!object && rel_type > 0 && selected_objects.size() > 0 && - selected_objects[0]->getObjectType()==OBJ_TABLE) + selected_objects[0]->getObjectType()==ObjTable) { Table *tab1=dynamic_cast
(selected_objects[0]), *tab2=(selected_objects.size()==2 ? @@ -1771,20 +1771,20 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb res=openEditingForm(relationship_wgt); scene->clearSelection(); } - else if(obj_type==OBJ_TEXTBOX) + else if(obj_type==ObjTextbox) { TextboxWidget *textbox_wgt=new TextboxWidget; textbox_wgt->setAttributes(db_model, op_list, dynamic_cast(object), obj_pos.x(), obj_pos.y()); res=openEditingForm(textbox_wgt); } - else if(obj_type==OBJ_PERMISSION) + else if(obj_type==ObjPermission) { PermissionWidget *permission_wgt=new PermissionWidget; Permission *perm=dynamic_cast(object); permission_wgt->setAttributes(db_model, nullptr, (perm ? perm->getObject() : object)); res=openEditingForm(permission_wgt, Messagebox::OK_BUTTON); } - else if(obj_type==OBJ_GENERIC_SQL) + else if(obj_type==ObjGenericSQL) { GenericSQLWidget *genericsql_wgt=new GenericSQLWidget; genericsql_wgt->setAttributes(db_model, op_list, dynamic_cast(object)); @@ -1852,7 +1852,7 @@ void ModelWidget::showSourceCode(void) void ModelWidget::cancelObjectAddition(void) { //Reset the new object type to a invalid one forcing the user to select a correct type again - new_obj_type=BASE_OBJECT; + new_obj_type=ObjBaseObject; //Restore the cursor icon viewport->setCursor(QCursor(Qt::ArrowCursor)); @@ -1976,7 +1976,7 @@ void ModelWidget::changeOwner(void) OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Register an operation only if the object is not the database itself - if(obj->getObjectType()!=OBJ_DATABASE) + if(obj->getObjectType()!=ObjDatabase) op_id=op_list->registerObject(obj, Operation::OBJECT_MODIFIED, -1); obj->setOwner(owner); @@ -2122,7 +2122,7 @@ void ModelWidget::protectObject(void) { bool protect=!graph_obj->isProtected(); - if(graph_obj->getObjectType()==OBJ_SCHEMA) + if(graph_obj->getObjectType()==ObjSchema) { Messagebox msgbox; msgbox.show(QString(QT_TR_NOOP("Do you want to %1 the selected schema's children too?")).arg(protect ? QT_TR_NOOP("protect") : QT_TR_NOOP("unprotect")), @@ -2172,7 +2172,7 @@ void ModelWidget::protectObject(void) obj_type=object->getObjectType(); - if(obj_type==OBJ_COLUMN || obj_type==OBJ_CONSTRAINT) + if(obj_type==ObjColumn || obj_type==ObjConstraint) { tab_obj=dynamic_cast(object); @@ -2222,7 +2222,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) TableObject *tab_obj=nullptr; BaseTable *table=nullptr; Constraint *constr=nullptr; - ObjectType types[]={ OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_CONSTRAINT, OBJ_POLICY }; + ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex, ObjConstraint, ObjPolicy }; unsigned i, type_id, count; Messagebox msg_box; @@ -2255,7 +2255,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) object=(*itr); //Table-view relationships and FK relationship aren't copied since they are created automatically when pasting the tables/views - if(object->getObjectType()!=BASE_RELATIONSHIP) + if(object->getObjectType()!=ObjBaseRelationship) { if(msg_box.result()==QDialog::Accepted) db_model->getObjectDependecies(object, deps, true); @@ -2264,7 +2264,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) /* Copying the special objects (which references columns added by relationship) in order to be correclty created when pasted */ - if(object->getObjectType()==OBJ_TABLE || object->getObjectType() == OBJ_VIEW) + if(object->getObjectType()==ObjTable || object->getObjectType() == ObjView) { table=dynamic_cast(object); @@ -2291,7 +2291,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) deps.push_back(tab_obj); } - if(object->getObjectType() == OBJ_VIEW && type_id >= 2) + if(object->getObjectType() == ObjView && type_id >= 2) break; } } @@ -2376,7 +2376,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) /* The first validation is to check if the object to be pasted does not conflict with any other object of the same type on the model */ - if(obj_type==OBJ_FUNCTION) + if(obj_type==ObjFunction) dynamic_cast(object)->createSignature(true); else if(tab_obj) aux_name=tab_obj->getName(true); @@ -2388,7 +2388,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) aux_object=db_model->getObject(aux_name, obj_type); else { - if(sel_view && (obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE || obj_type==OBJ_INDEX)) + if(sel_view && (obj_type==ObjTrigger || obj_type==ObjRule || obj_type==ObjIndex)) aux_object=sel_view->getObject(aux_name, obj_type); else if(sel_table) aux_object=sel_table->getObject(aux_name, obj_type); @@ -2407,7 +2407,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) object->getCodeDefinition(SchemaParser::SchemaParser::XML_DEFINITION))))) { //Resolving name conflicts - if(obj_type!=OBJ_CAST) + if(obj_type!=ObjCast) { func=nullptr; oper=nullptr; @@ -2417,17 +2417,17 @@ void ModelWidget::pasteObjects(bool duplicate_mode) /* For each object type as follow configures the name and the suffix and store them on the 'copy_obj_name' variable. This string is used to check if there are objects with the same name on model. While the 'copy_obj_name' conflicts with other objects (of same type) this validation is made */ - if(obj_type==OBJ_FUNCTION) + if(obj_type==ObjFunction) { func=dynamic_cast(object); - func->setName(PgModelerNS::generateUniqueName(func, (*db_model->getObjectList(OBJ_FUNCTION)), false, QString("_cp"))); + func->setName(PgModelerNS::generateUniqueName(func, (*db_model->getObjectList(ObjFunction)), false, QString("_cp"))); copy_obj_name=func->getName(); func->setName(orig_obj_names[object]); } - else if(obj_type==OBJ_OPERATOR) + else if(obj_type==ObjOperator) { oper=dynamic_cast(object); - oper->setName(PgModelerNS::generateUniqueName(oper, (*db_model->getObjectList(OBJ_OPERATOR)))); + oper->setName(PgModelerNS::generateUniqueName(oper, (*db_model->getObjectList(ObjOperator)))); copy_obj_name=oper->getName(); oper->setName(orig_obj_names[object]); } @@ -2499,9 +2499,9 @@ void ModelWidget::pasteObjects(bool duplicate_mode) * is a table or is a view and the current object is a trigger, index, or rule (because * view's only accepts this two types) */ if(sel_table || - (sel_view && (tab_obj->getObjectType()==OBJ_TRIGGER || - tab_obj->getObjectType()==OBJ_RULE || - tab_obj->getObjectType()==OBJ_INDEX))) + (sel_view && (tab_obj->getObjectType()==ObjTrigger || + tab_obj->getObjectType()==ObjRule || + tab_obj->getObjectType()==ObjIndex))) { //Backups the original parent table orig_parent_tab=tab_obj->getParentTable(); @@ -2548,7 +2548,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) object=(*itr); itr++; - if(orig_obj_names[object].count() && obj_type!=OBJ_CAST) + if(orig_obj_names[object].count() && obj_type!=ObjCast) object->setName(orig_obj_names[object]); } @@ -2595,7 +2595,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) //Special case for table objects if(tab_obj) { - if(sel_table && tab_obj->getObjectType()==OBJ_COLUMN) + if(sel_table && tab_obj->getObjectType()==ObjColumn) { sel_table->addObject(tab_obj); sel_table->setModified(true); @@ -2687,7 +2687,7 @@ void ModelWidget::duplicateObject(void) table = dynamic_cast(object)->getParentTable(); PgModelerNS::copyObject(&dup_object, object, obj_type); - if(table->getObjectType() == OBJ_TABLE) + if(table->getObjectType() == ObjTable) dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); else dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); @@ -2696,9 +2696,9 @@ void ModelWidget::duplicateObject(void) table->addObject(dup_object); table->setModified(true); - if(obj_type == OBJ_COLUMN) + if(obj_type == ObjColumn) db_model->validateRelationships(); - else if(obj_type == OBJ_CONSTRAINT && + else if(obj_type == ObjConstraint && dynamic_cast(object)->getConstraintType() == ConstraintType::foreign_key) db_model->updateTableFKRelationships(dynamic_cast
(table)); @@ -2728,7 +2728,7 @@ void ModelWidget::removeObjects(bool cascade) BaseTable *table=nullptr, *src_table=nullptr, *dst_table=nullptr; BaseRelationship *rel=nullptr; TableObject *tab_obj=nullptr; - ObjectType obj_type=BASE_OBJECT, parent_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject, parent_type=ObjBaseObject; BaseObject *object=nullptr, *aux_obj=nullptr; vector sel_objs, aux_sel_objs; @@ -2770,7 +2770,7 @@ void ModelWidget::removeObjects(bool cascade) } else { - if(sel_objs[0]->getObjectType()==OBJ_RELATIONSHIP) + if(sel_objs[0]->getObjectType()==ObjRelationship) msg_box.show(trUtf8("CAUTION: Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed?"), Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); else @@ -2800,7 +2800,7 @@ void ModelWidget::removeObjects(bool cascade) tab_obj=dynamic_cast(ref_obj); //Store the base relationships in a auxiliary list to be processed ahead - if(ref_obj->getObjectType()==BASE_RELATIONSHIP) + if(ref_obj->getObjectType()==ObjBaseRelationship) { aux_sel_objs.push_back(ref_obj); } @@ -2808,7 +2808,7 @@ void ModelWidget::removeObjects(bool cascade) else if(objs_map.count(obj_id)==0 && (!tab_obj || (tab_obj && !tab_obj->isAddedByRelationship()))) { - parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : OBJ_DATABASE); + parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjDatabase); parent_name=(tab_obj ? tab_obj->getParentTable()->getName(true) : QString()); obj_name=(tab_obj ? tab_obj->getName() : ref_obj->getSignature()); @@ -2830,7 +2830,7 @@ void ModelWidget::removeObjects(bool cascade) obj_id=object->getObjectId(); //If the object is as FK relationship remove the foreign keys that generates it - if(obj_type==BASE_RELATIONSHIP) + if(obj_type==ObjBaseRelationship) { rel = dynamic_cast(object); @@ -2845,7 +2845,7 @@ void ModelWidget::removeObjects(bool cascade) tab_obj->getName(true), tab_obj->getObjectType(), tab_obj->getParentTable()->getName(true), - OBJ_TABLE); + ObjTable); } } @@ -2856,7 +2856,7 @@ void ModelWidget::removeObjects(bool cascade) obj_name=(tab_obj ? object->getName(true) : object->getSignature()); parent_name=(tab_obj ? tab_obj->getParentTable()->getName(true) : QString()); - parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : OBJ_DATABASE); + parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjDatabase); objs_map[object->getObjectId()]=std::make_tuple(object, obj_name, @@ -2882,9 +2882,9 @@ void ModelWidget::removeObjects(bool cascade) parent_type=std::get<4>(ritr->second); ritr++; - if(obj_type==BASE_RELATIONSHIP) + if(obj_type==ObjBaseRelationship) continue; - else if(parent_type!=OBJ_DATABASE) + else if(parent_type!=ObjDatabase) { /* If the parent table does not exist on the model of the object to be removed * does not exists in parent table, it'll not be processed */ @@ -2925,7 +2925,7 @@ void ModelWidget::removeObjects(bool cascade) try { //If the object is a column validates the column removal before remove it - if(!cascade && obj_type==OBJ_COLUMN) + if(!cascade && obj_type==ObjColumn) db_model->validateColumnRemoval(dynamic_cast(tab_obj)); //Register the removed object on the operation list @@ -2936,7 +2936,7 @@ void ModelWidget::removeObjects(bool cascade) aux_table=dynamic_cast
(table); - if(aux_table && obj_type==OBJ_CONSTRAINT && + if(aux_table && obj_type==ObjConstraint && dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::foreign_key) db_model->updateTableFKRelationships(aux_table); @@ -2964,7 +2964,7 @@ void ModelWidget::removeObjects(bool cascade) if(obj_idx >=0 ) { - if(obj_type==OBJ_RELATIONSHIP) + if(obj_type==ObjRelationship) { rel=dynamic_cast(object); src_table=rel->getTable(BaseRelationship::SRC_TABLE); @@ -3115,7 +3115,7 @@ void ModelWidget::enableModelActions(bool value) void ModelWidget::configureSubmenu(BaseObject *object) { vector sel_objs; - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; bool tab_or_view=false, accepts_owner=false, accepts_schema=false; if(object) @@ -3130,7 +3130,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) obj_type=obj->getObjectType(); if(!tab_or_view) - tab_or_view=(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); + tab_or_view=(obj_type==ObjTable || obj_type==ObjView); if(!accepts_owner) accepts_owner=obj->acceptsOwner(); @@ -3151,16 +3151,16 @@ void ModelWidget::configureSubmenu(BaseObject *object) map act_map; QStringList name_list; QMenu *menus[]={ &schemas_menu, &owners_menu, &tags_menu }; - ObjectType types[]={ OBJ_SCHEMA, OBJ_ROLE, OBJ_TAG }; + ObjectType types[]={ ObjSchema, ObjRole, ObjTag }; for(unsigned i=0; i < 3; i++) { menus[i]->clear(); //Configuring actions "Move to schema", "Change Owner" and "Set tag" - if((types[i] == OBJ_SCHEMA && accepts_schema) || - (types[i] == OBJ_ROLE && accepts_owner) || - (types[i]==OBJ_TAG && tab_or_view)) + if((types[i] == ObjSchema && accepts_schema) || + (types[i] == ObjRole && accepts_owner) || + (types[i]==ObjTag && tab_or_view)) { obj_list=db_model->getObjects(types[i]); @@ -3171,7 +3171,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } else { - if(types[i] == OBJ_TAG) + if(types[i] == ObjTag) { menus[i]->addAction(trUtf8("None"), this, SLOT(setTag())); menus[i]->addSeparator(); @@ -3219,7 +3219,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } //Display the quick rename action is a single object is selected - if(object && obj_type!=OBJ_CAST) + if(object && obj_type!=ObjCast) { quick_actions_menu.addAction(action_rename); action_rename->setData(QVariant::fromValue(object)); @@ -3240,7 +3240,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) action_edit_perms->setData(QVariant::fromValue(object)); } - if(object && obj_type == OBJ_TABLE) + if(object && obj_type == ObjTable) quick_actions_menu.addAction(action_edit_data); if(object && BaseObject::acceptsCustomSQL(obj_type)) @@ -3250,7 +3250,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } if(object && - ((!TableObject::isTableObject(obj_type) && obj_type!=OBJ_TEXTBOX && obj_type!=BASE_RELATIONSHIP) || + ((!TableObject::isTableObject(obj_type) && obj_type!=ObjTextbox && obj_type!=ObjBaseRelationship) || (TableObject::isTableObject(obj_type) && !dynamic_cast(object)->isAddedByRelationship()))) { action_enable_sql->setData(QVariant::fromValue(object)); @@ -3271,7 +3271,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) void ModelWidget::configureFadeMenu(void) { bool is_db_selected = (selected_objects.empty() || - (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == OBJ_DATABASE)); + (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjDatabase)); fade_menu.clear(); fade_in_menu.clear(); fade_out_menu.clear(); @@ -3286,7 +3286,7 @@ void ModelWidget::configureFadeMenu(void) if(is_db_selected) { QAction *action = nullptr; - vector types = { OBJ_SCHEMA, OBJ_TABLE, OBJ_VIEW, OBJ_RELATIONSHIP, OBJ_TEXTBOX }; + vector types = { ObjSchema, ObjTable, ObjView, ObjRelationship, ObjTextbox }; QStringList labels = { trUtf8("Schemas"), trUtf8("Tables"), trUtf8("Views"), trUtf8("Relationships"), trUtf8("Textboxes") }; unsigned id = 0; @@ -3308,13 +3308,13 @@ void ModelWidget::configureFadeMenu(void) } action = new QAction(trUtf8("All objects"), &fade_in_menu); - action->setData(BASE_OBJECT); + action->setData(ObjBaseObject); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); fade_in_menu.addSeparator(); fade_in_menu.addAction(action); action = new QAction(trUtf8("All objects"), &fade_out_menu); - action->setData(BASE_OBJECT); + action->setData(ObjBaseObject); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); fade_out_menu.addSeparator(); fade_out_menu.addAction(action); @@ -3329,7 +3329,7 @@ void ModelWidget::configureFadeMenu(void) { ObjectType obj_type = selected_objects[0]->getObjectType(); - if(obj_type == OBJ_TAG) + if(obj_type == ObjTag) { fade_menu.addAction(action_fade_in); fade_menu.addAction(action_fade_out); @@ -3354,7 +3354,7 @@ void ModelWidget::configureFadeMenu(void) } } - if(obj_type == OBJ_TABLE || obj_type == OBJ_VIEW) + if(obj_type == ObjTable || obj_type == ObjView) { fade_menu.addAction(action_fade_rels); action_fade_rels->setText(trUtf8("Table && Relationships")); @@ -3402,15 +3402,15 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) vector list; //If the database object is selected or there is no object select - if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == OBJ_DATABASE)) + if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjDatabase)) { ObjectType obj_type = static_cast(action->data().toUInt()); - //If the action contains a data of type BASE_OBJECT means that the user wants to fade all objects - if(obj_type == BASE_OBJECT) + //If the action contains a data of type ObjBaseObject means that the user wants to fade all objects + if(obj_type == ObjBaseObject) { - vector types = { OBJ_SCHEMA, OBJ_TABLE, OBJ_VIEW, - OBJ_RELATIONSHIP, BASE_RELATIONSHIP, OBJ_TEXTBOX}; + vector types = { ObjSchema, ObjTable, ObjView, + ObjRelationship, ObjBaseRelationship, ObjTextbox}; for(ObjectType type : types) { @@ -3424,18 +3424,18 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) //Fading objects of a certain type list = *db_model->getObjectList(obj_type); - if(obj_type == OBJ_RELATIONSHIP) + if(obj_type == ObjRelationship) { list.insert(list.end(), - db_model->getObjectList(BASE_RELATIONSHIP)->begin(), - db_model->getObjectList(BASE_RELATIONSHIP)->end()); + db_model->getObjectList(ObjBaseRelationship)->begin(), + db_model->getObjectList(ObjBaseRelationship)->end()); } } } else { //For tag object the fade is applied in the tables/views related to it - if(selected_objects.size() == 1 && selected_objects[0]->getObjectType() == OBJ_TAG) + if(selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjTag) db_model->getObjectReferences(selected_objects[0], list); else { @@ -3482,8 +3482,8 @@ void ModelWidget::toggleAllExtendedAttributes(bool value) vector objects; this->scene->clearSelection(); - objects.assign(db_model->getObjectList(OBJ_TABLE)->begin(), db_model->getObjectList(OBJ_TABLE)->end()); - objects.insert(objects.end(), db_model->getObjectList(OBJ_VIEW)->begin(), db_model->getObjectList(OBJ_VIEW)->end()); + objects.assign(db_model->getObjectList(ObjTable)->begin(), db_model->getObjectList(ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjView)->begin(), db_model->getObjectList(ObjView)->end()); for(auto obj : objects) { @@ -3504,8 +3504,8 @@ void ModelWidget::toggleExtendedAttributes(void) if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0] == db_model)) { - objects.assign(db_model->getObjectList(OBJ_TABLE)->begin(), db_model->getObjectList(OBJ_TABLE)->end()); - objects.insert(objects.end(), db_model->getObjectList(OBJ_VIEW)->begin(), db_model->getObjectList(OBJ_VIEW)->end()); + objects.assign(db_model->getObjectList(ObjTable)->begin(), db_model->getObjectList(ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjView)->begin(), db_model->getObjectList(ObjView)->end()); } else objects = selected_objects; @@ -3521,7 +3521,7 @@ void ModelWidget::toggleExtendedAttributes(void) } } - db_model->setObjectsModified({ OBJ_SCHEMA }); + db_model->setObjectsModified({ ObjSchema }); this->setModified(true); } @@ -3530,7 +3530,7 @@ void ModelWidget::toggleSchemasRectangles(void) bool visible = sender() == action_show_schemas_rects; Schema *schema = nullptr; - for(auto obj : *db_model->getObjectList(OBJ_SCHEMA)) + for(auto obj : *db_model->getObjectList(ObjSchema)) { schema = dynamic_cast(obj); @@ -3546,8 +3546,8 @@ void ModelWidget::toggleSchemasRectangles(void) void ModelWidget::updateObjectsOpacity(void) { - vector types = { OBJ_SCHEMA, OBJ_TABLE, OBJ_VIEW, - OBJ_RELATIONSHIP, BASE_RELATIONSHIP, OBJ_TEXTBOX}; + vector types = { ObjSchema, ObjTable, ObjView, + ObjRelationship, ObjBaseRelationship, ObjTextbox}; BaseObjectView *obj_view = nullptr; BaseGraphicObject *base_obj = nullptr; @@ -3594,10 +3594,10 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Case there is no selected object or the selected object is the database model if(objects.empty() || (objects.size()==1 && objects[0]==db_model)) { - ObjectType types[]={ OBJ_AGGREGATE, OBJ_CAST, OBJ_EVENT_TRIGGER, OBJ_COLLATION, OBJ_CONVERSION, OBJ_DOMAIN, - OBJ_EXTENSION, OBJ_FUNCTION, OBJ_GENERIC_SQL, OBJ_LANGUAGE, OBJ_OPCLASS, OBJ_OPERATOR, - OBJ_OPFAMILY, OBJ_RELATIONSHIP, OBJ_ROLE, OBJ_SCHEMA, OBJ_SEQUENCE, - OBJ_TABLE, OBJ_TABLESPACE, OBJ_TEXTBOX, OBJ_TYPE, OBJ_VIEW, OBJ_TAG }; + ObjectType types[]={ ObjAggregate, ObjCast, ObjEventTrigger, ObjCollation, ObjConversion, ObjDomain, + ObjExtension, ObjFunction, ObjGenericSQL, ObjLanguage, ObjOpClass, ObjOperator, + ObjOpFamily, ObjRelationship, ObjRole, ObjSchema, ObjSequence, + ObjTable, ObjTablespace, ObjTextbox, ObjType, ObjView, ObjTag }; unsigned cnt = sizeof(types)/sizeof(ObjectType); //Configures the "New object" menu with the types at database level @@ -3634,28 +3634,28 @@ void ModelWidget::configurePopupMenu(const vector &objects) configureSubmenu(obj); popup_menu.addAction(action_edit); - if((obj_type==OBJ_SCHEMA && obj->isSystemObject()) || - (!obj->isProtected() && (obj_type==OBJ_TABLE || obj_type==BASE_RELATIONSHIP || - obj_type==OBJ_RELATIONSHIP || obj_type==OBJ_SCHEMA || - obj_type == OBJ_TAG || obj_type==OBJ_VIEW))) + if((obj_type==ObjSchema && obj->isSystemObject()) || + (!obj->isProtected() && (obj_type==ObjTable || obj_type==ObjBaseRelationship || + obj_type==ObjRelationship || obj_type==ObjSchema || + obj_type == ObjTag || obj_type==ObjView))) { - if(obj_type==OBJ_TABLE || obj_type == OBJ_VIEW) + if(obj_type==ObjTable || obj_type == ObjView) { for(auto type : BaseObject::getChildObjectTypes(obj_type)) new_object_menu.addAction(actions_new_objects[type]); - if(obj_type==OBJ_TABLE) - new_object_menu.addAction(actions_new_objects[OBJ_RELATIONSHIP]); + if(obj_type==ObjTable) + new_object_menu.addAction(actions_new_objects[ObjRelationship]); action_new_object->setMenu(&new_object_menu); popup_menu.insertAction(action_quick_actions, action_new_object); } - else if(obj_type==OBJ_RELATIONSHIP || obj_type==BASE_RELATIONSHIP) + else if(obj_type==ObjRelationship || obj_type==ObjBaseRelationship) { - if(obj_type==OBJ_RELATIONSHIP) + if(obj_type==ObjRelationship) { - new_object_menu.addAction(actions_new_objects[OBJ_COLUMN]); - new_object_menu.addAction(actions_new_objects[OBJ_CONSTRAINT]); + new_object_menu.addAction(actions_new_objects[ObjColumn]); + new_object_menu.addAction(actions_new_objects[ObjConstraint]); action_new_object->setMenu(&new_object_menu); popup_menu.insertAction(action_quick_actions, action_new_object); @@ -3692,9 +3692,9 @@ void ModelWidget::configurePopupMenu(const vector &objects) action->setData(QVariant::fromValue(reinterpret_cast(rel->getTable(BaseRelationship::DST_TABLE)))); } } - else if(obj_type == OBJ_SCHEMA) + else if(obj_type == ObjSchema) { - for(auto type : BaseObject::getChildObjectTypes(OBJ_SCHEMA)) + for(auto type : BaseObject::getChildObjectTypes(ObjSchema)) new_object_menu.addAction(actions_new_objects[type]); action_new_object->setMenu(&new_object_menu); @@ -3703,7 +3703,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) popup_menu.addAction(action_sel_sch_children); action_sel_sch_children->setData(QVariant::fromValue(obj)); } - else if(obj_type == OBJ_TAG) + else if(obj_type == ObjTag) { popup_menu.addAction(action_sel_tagged_tabs); action_sel_tagged_tabs->setData(QVariant::fromValue(obj)); @@ -3724,7 +3724,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) action_deps_refs->setData(QVariant::fromValue(obj)); tab_obj=dynamic_cast(obj); - if(tab_obj && tab_obj->getObjectType()==OBJ_COLUMN) + if(tab_obj && tab_obj->getObjectType()==ObjColumn) { Column *col=dynamic_cast(tab_obj); @@ -3763,7 +3763,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) for(auto &obj : objects) { - rem_points = obj->getObjectType() == OBJ_RELATIONSHIP || obj->getObjectType() == BASE_RELATIONSHIP; + rem_points = obj->getObjectType() == ObjRelationship || obj->getObjectType() == ObjBaseRelationship; if(!rem_points) break; } @@ -3783,7 +3783,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) /* Special case for systema objects: The actions protect/unprotect will be displayed only for system schemas. The rest of system objects those actions aren't available */ if(!objects[0]->isSystemObject() || - (objects[0]->isSystemObject() && objects[0]->getObjectType()==OBJ_SCHEMA)) + (objects[0]->isSystemObject() && objects[0]->getObjectType()==ObjSchema)) { if(!objects[0]->isProtected()) popup_menu.addAction(action_protect); @@ -3794,10 +3794,10 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Adding the extended attributes action (only for table/view/database) if(objects.size() > 1 || - (objects.empty() && (db_model->getObjectCount(OBJ_TABLE) > 0 || db_model->getObjectCount(OBJ_VIEW) > 0)) || - (objects.size() == 1 && (objects[0]->getObjectType() == OBJ_TABLE || - objects[0]->getObjectType() == OBJ_VIEW || - objects[0]->getObjectType() == OBJ_DATABASE))) + (objects.empty() && (db_model->getObjectCount(ObjTable) > 0 || db_model->getObjectCount(ObjView) > 0)) || + (objects.size() == 1 && (objects[0]->getObjectType() == ObjTable || + objects[0]->getObjectType() == ObjView || + objects[0]->getObjectType() == ObjDatabase))) { bool tab_or_view = false; @@ -3805,7 +3805,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { if(!tab_or_view) { - tab_or_view=(obj->getObjectType()==OBJ_TABLE || obj->getObjectType()==OBJ_VIEW); + tab_or_view=(obj->getObjectType()==ObjTable || obj->getObjectType()==ObjView); break; } } @@ -3813,14 +3813,14 @@ void ModelWidget::configurePopupMenu(const vector &objects) if(tab_or_view || objects.empty() || objects.size() == 1) popup_menu.addAction(action_extended_attribs); - if(objects.empty() || (objects.size() == 1 && objects[0]->getObjectType() == OBJ_DATABASE)) + if(objects.empty() || (objects.size() == 1 && objects[0]->getObjectType() == ObjDatabase)) popup_menu.addAction(action_schemas_rects); } if(!tab_obj && (objects.empty() || objects.size() > 1 || - (objects.size() == 1 && (objects[0]->getObjectType() == OBJ_DATABASE || - objects[0]->getObjectType() == OBJ_TAG || + (objects.size() == 1 && (objects[0]->getObjectType() == ObjDatabase || + objects[0]->getObjectType() == ObjTag || BaseGraphicObject::isGraphicObject(objects[0]->getObjectType()))))) { //Adding fade inout action only for graphical objects or when there is no objects selected or many objects seleted @@ -3831,7 +3831,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Adding the copy and paste if there is selected objects if(!model_protected && - !(objects.size()==1 && (objects[0]==db_model || objects[0]->getObjectType()==BASE_RELATIONSHIP)) && + !(objects.size()==1 && (objects[0]==db_model || objects[0]->getObjectType()==ObjBaseRelationship)) && !objects.empty()) { popup_menu.addAction(action_copy); @@ -3858,8 +3858,8 @@ void ModelWidget::configurePopupMenu(const vector &objects) 4) The object is a base relationship (table-view) */ if((tab_obj && !tab_obj->isAddedByRelationship() && !tab_obj->isProtected()) || (objects.size()==1 && objects[0]->isProtected()) || - (!tab_obj && objects.size()==1 && objects[0]!=db_model && objects[0]->getObjectType()!=BASE_RELATIONSHIP) || - (objects.size()==1 && objects[0]->getObjectType()==BASE_RELATIONSHIP && + (!tab_obj && objects.size()==1 && objects[0]!=db_model && objects[0]->getObjectType()!=ObjBaseRelationship) || + (objects.size()==1 && objects[0]->getObjectType()==ObjBaseRelationship && dynamic_cast(objects[0])->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) || objects.size() > 1) { @@ -3872,7 +3872,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { table=dynamic_cast
(tab_obj->getParentTable()); - if(tab_obj->getObjectType()==OBJ_COLUMN) + if(tab_obj->getObjectType()==ObjColumn) { count=table->getConstraintCount(); @@ -3892,7 +3892,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) //For each constaint is created a menu with the edit, source code, protect/unprotect and delete actions submenu=new QMenu(&popup_menu); - submenu->setIcon(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(OBJ_CONSTRAINT) + str_aux))); + submenu->setIcon(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(ObjConstraint) + str_aux))); submenu->setTitle(constr->getName()); action=new QAction(dynamic_cast(submenu)); @@ -3953,7 +3953,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { submenu=new QMenu(&popup_menu); submenu->setTitle(trUtf8("Constraints")); - submenu->setIcon(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(OBJ_CONSTRAINT) + QString("_grp")))); + submenu->setIcon(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(ObjConstraint) + QString("_grp")))); count=submenus.size(); for(i=0; i < count; i++) submenu->addMenu(submenus[i]); @@ -4041,7 +4041,7 @@ void ModelWidget::highlightObject(void) void ModelWidget::toggleNewObjectOverlay(void) { if(new_obj_overlay_wgt->isHidden() && - (selected_objects.empty() || selected_objects[0]->getObjectType()!=BASE_RELATIONSHIP)) + (selected_objects.empty() || selected_objects[0]->getObjectType()!=ObjBaseRelationship)) { new_obj_overlay_wgt->raise(); new_obj_overlay_wgt->show(); @@ -4088,7 +4088,7 @@ void ModelWidget::createSequenceFromColumn(void) //Creates a sequence which name is like the ones auto generated by PostgreSQL seq=new Sequence; seq->setName(BaseObject::formatName(tab->getName() + QString("_") + col->getName() + QString("_seq"))); - seq->setName(PgModelerNS::generateUniqueName(seq, *db_model->getObjectList(OBJ_SEQUENCE), false)); + seq->setName(PgModelerNS::generateUniqueName(seq, *db_model->getObjectList(ObjSequence), false)); seq->setSchema(tab->getSchema()); seq->setDefaultValues(col->getType()); @@ -4231,8 +4231,8 @@ void ModelWidget::removeRelationshipPoints(void) { vector rels; - rels = *db_model->getObjectList(BASE_RELATIONSHIP); - rels.insert(rels.end(), db_model->getObjectList(OBJ_RELATIONSHIP)->begin(), db_model->getObjectList(OBJ_RELATIONSHIP)->end()); + rels = *db_model->getObjectList(ObjBaseRelationship); + rels.insert(rels.end(), db_model->getObjectList(ObjRelationship)->begin(), db_model->getObjectList(ObjRelationship)->end()); op_list->startOperationChain(); for(auto &obj : rels) @@ -4273,7 +4273,7 @@ void ModelWidget::rearrangeSchemasInGrid(QPointF origin, unsigned tabs_per_row, unsigned sch_id=0; double x=origin.x(), y=origin.y(), max_y=-1, cy=0; - objects=db_model->getObjectList(OBJ_SCHEMA); + objects=db_model->getObjectList(ObjSchema); for(BaseObject *obj : *objects) { @@ -4316,13 +4316,13 @@ void ModelWidget::rearrangeSchemasInGrid(QPointF origin, unsigned tabs_per_row, } } - objects=db_model->getObjectList(OBJ_RELATIONSHIP); + objects=db_model->getObjectList(ObjRelationship); for(BaseObject *obj : *objects) { dynamic_cast(obj)->setModified(true); } - objects=db_model->getObjectList(BASE_RELATIONSHIP); + objects=db_model->getObjectList(ObjBaseRelationship); for(BaseObject *obj : *objects) { dynamic_cast(obj)->setModified(true); @@ -4344,8 +4344,8 @@ void ModelWidget::rearrangeTablesInGrid(Schema *schema, QPointF origin, unsigned double max_y=-1, x=origin.x(), y=origin.y(), cy=0; //Get the tables and views for the specified schema - tables=db_model->getObjects(OBJ_TABLE, schema); - views=db_model->getObjects(OBJ_VIEW, schema); + tables=db_model->getObjects(ObjTable, schema); + views=db_model->getObjects(ObjView, schema); tables.insert(tables.end(), views.begin(), views.end()); itr=tables.begin(); @@ -4431,8 +4431,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) scene->clearSelection(); - objects.assign(db_model->getObjectList(OBJ_TABLE)->begin(), db_model->getObjectList(OBJ_TABLE)->end()); - objects.insert(objects.end(), db_model->getObjectList(OBJ_VIEW)->begin(), db_model->getObjectList(OBJ_VIEW)->end()); + objects.assign(db_model->getObjectList(ObjTable)->begin(), db_model->getObjectList(ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjView)->begin(), db_model->getObjectList(ObjView)->end()); //We determine the root by searching the table/view which contains the more amount of relationships connected for(auto obj : objects) @@ -4464,8 +4464,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) max_w = items_rect.width(); objects.clear(); - objects.assign(db_model->getObjectList(OBJ_TABLE)->begin(), db_model->getObjectList(OBJ_TABLE)->end()); - objects.insert(objects.end(), db_model->getObjectList(OBJ_VIEW)->begin(), db_model->getObjectList(OBJ_VIEW)->end()); + objects.assign(db_model->getObjectList(ObjTable)->begin(), db_model->getObjectList(ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjView)->begin(), db_model->getObjectList(ObjView)->end()); //Retrieving the rest of tables/views that were not evaluated in the previous iteration std::sort(objects.begin(), objects.end()); @@ -4519,7 +4519,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) //Repositioning remaining tables (without relationships) and textboxes objects.clear(); objects.assign(not_linked_tabs.begin(), not_linked_tabs.end()); - objects.insert(objects.end(), db_model->getObjectList(OBJ_TEXTBOX)->begin(), db_model->getObjectList(OBJ_TEXTBOX)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjTextbox)->begin(), db_model->getObjectList(ObjTextbox)->end()); px = 50; py = items_rect.bottom() + 100; @@ -4542,8 +4542,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) } objects.clear(); - objects.assign(db_model->getObjectList(OBJ_RELATIONSHIP)->begin(), db_model->getObjectList(OBJ_RELATIONSHIP)->end()); - objects.insert(objects.end(), db_model->getObjectList(BASE_RELATIONSHIP)->begin(), db_model->getObjectList(BASE_RELATIONSHIP)->end()); + objects.assign(db_model->getObjectList(ObjRelationship)->begin(), db_model->getObjectList(ObjRelationship)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjBaseRelationship)->begin(), db_model->getObjectList(ObjBaseRelationship)->end()); for(auto obj : objects) { @@ -4557,7 +4557,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) breakRelationshipLine(dynamic_cast(obj), ModelWidget::BREAK_VERT_2NINETY_DEGREES); } - db_model->setObjectsModified({ OBJ_TABLE, OBJ_VIEW, OBJ_SCHEMA, OBJ_RELATIONSHIP, BASE_RELATIONSHIP }); + db_model->setObjectsModified({ ObjTable, ObjView, ObjSchema, ObjRelationship, ObjBaseRelationship }); } else { @@ -4650,8 +4650,8 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) if(!schema) return; - tables = db_model->getObjects(OBJ_TABLE, schema); - views = db_model->getObjects(OBJ_VIEW, schema); + tables = db_model->getObjects(ObjTable, schema); + views = db_model->getObjects(ObjView, schema); tables.insert(tables.end(), views.begin(), views.end()); if(!tables.empty()) @@ -4774,13 +4774,13 @@ void ModelWidget::rearrangeTablesInSchemas(void) random_device rand_seed; default_random_engine rand_num_engine; double max_w = 1000, max_h = 1000; - vector schemas = *db_model->getObjectList(OBJ_SCHEMA), rels; + vector schemas = *db_model->getObjectList(ObjSchema), rels; bool has_collision = false; uniform_int_distribution dist_x(0, max_w), dist_y(0, max_h); unsigned tries = 0, - max_tries = (db_model->getObjectCount(OBJ_TABLE) + - db_model->getObjectCount(OBJ_VIEW) + - db_model->getObjectCount(OBJ_SCHEMA)) * 100; + max_tries = (db_model->getObjectCount(ObjTable) + + db_model->getObjectCount(ObjView) + + db_model->getObjectCount(ObjSchema)) * 100; rand_num_engine.seed(rand_seed()); @@ -4849,8 +4849,8 @@ void ModelWidget::rearrangeTablesInSchemas(void) } //Removing all custom points from relationships - rels.assign(db_model->getObjectList(OBJ_RELATIONSHIP)->begin(), db_model->getObjectList(OBJ_RELATIONSHIP)->end()); - rels.insert(rels.end(), db_model->getObjectList(BASE_RELATIONSHIP)->begin(), db_model->getObjectList(BASE_RELATIONSHIP)->end()); + rels.assign(db_model->getObjectList(ObjRelationship)->begin(), db_model->getObjectList(ObjRelationship)->end()); + rels.insert(rels.end(), db_model->getObjectList(ObjBaseRelationship)->begin(), db_model->getObjectList(ObjBaseRelationship)->end()); for(auto &rel : rels) { @@ -4859,7 +4859,7 @@ void ModelWidget::rearrangeTablesInSchemas(void) base_rel->resetLabelsDistance(); } - db_model->setObjectsModified({ OBJ_TABLE, OBJ_VIEW, OBJ_SCHEMA, OBJ_RELATIONSHIP, BASE_RELATIONSHIP }); + db_model->setObjectsModified({ ObjTable, ObjView, ObjSchema, ObjRelationship, ObjBaseRelationship }); adjustSceneSize(); viewport->updateScene({ scene->sceneRect() }); } diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index 5d91e85ae9..b45ceff92d 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -29,34 +29,34 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par int action_idx=0; QList rel_actions=parent->rels_menu->actions(); map> obj_shortcuts={ - { aggregate_tb, std::make_tuple(trUtf8("A"), OBJ_AGGREGATE) }, - { cast_tb, std::make_tuple(trUtf8("G"), OBJ_CAST) }, - { eventtrigger_tb, std::make_tuple(trUtf8("K"), OBJ_EVENT_TRIGGER)}, - { collation_tb, std::make_tuple(trUtf8("H"), OBJ_COLLATION) }, - { conversion_tb, std::make_tuple(trUtf8("J"), OBJ_CONVERSION) }, - { domain_tb, std::make_tuple(trUtf8("D"), OBJ_DOMAIN) }, - { extension_tb, std::make_tuple(trUtf8("E"), OBJ_EXTENSION) }, - { function_tb, std::make_tuple(trUtf8("F"), OBJ_FUNCTION) }, - { language_tb, std::make_tuple(trUtf8("L"), OBJ_LANGUAGE) }, - { opclass_tb, std::make_tuple(trUtf8("O"), OBJ_OPCLASS) }, - { operator_tb, std::make_tuple(trUtf8("U"), OBJ_OPERATOR) }, - { opfamily_tb, std::make_tuple(trUtf8("I"), OBJ_OPFAMILY) }, - { role_tb, std::make_tuple(trUtf8("R"), OBJ_ROLE) }, - { schema_tb, std::make_tuple(trUtf8("S"), OBJ_SCHEMA) }, - { sequence_tb, std::make_tuple(trUtf8("Q"), OBJ_SEQUENCE) }, - { table_tb, std::make_tuple(trUtf8("T"), OBJ_TABLE) }, - { tablespace_tb, std::make_tuple(trUtf8("P"), OBJ_TABLESPACE) }, - { textbox_tb, std::make_tuple(trUtf8("M"), OBJ_TEXTBOX) }, - { type_tb, std::make_tuple(trUtf8("Y"), OBJ_TYPE) }, - { view_tb, std::make_tuple(trUtf8("W"), OBJ_VIEW) }, - { tag_tb, std::make_tuple(trUtf8("9"), OBJ_TAG) }, - { constraint_tb, std::make_tuple(trUtf8("Z"), OBJ_CONSTRAINT) }, - { index_tb, std::make_tuple(trUtf8("X"), OBJ_INDEX) }, - { column_tb, std::make_tuple(trUtf8("C"), OBJ_COLUMN) }, - { rule_tb, std::make_tuple(trUtf8("V"), OBJ_RULE) }, - { trigger_tb, std::make_tuple(trUtf8("B"), OBJ_TRIGGER) }, - { policy_tb, std::make_tuple(trUtf8("9"), OBJ_POLICY) }, - { genericsql_tb, std::make_tuple(trUtf8("8"), OBJ_GENERIC_SQL) } }; + { aggregate_tb, std::make_tuple(trUtf8("A"), ObjAggregate) }, + { cast_tb, std::make_tuple(trUtf8("G"), ObjCast) }, + { eventtrigger_tb, std::make_tuple(trUtf8("K"), ObjEventTrigger)}, + { collation_tb, std::make_tuple(trUtf8("H"), ObjCollation) }, + { conversion_tb, std::make_tuple(trUtf8("J"), ObjConversion) }, + { domain_tb, std::make_tuple(trUtf8("D"), ObjDomain) }, + { extension_tb, std::make_tuple(trUtf8("E"), ObjExtension) }, + { function_tb, std::make_tuple(trUtf8("F"), ObjFunction) }, + { language_tb, std::make_tuple(trUtf8("L"), ObjLanguage) }, + { opclass_tb, std::make_tuple(trUtf8("O"), ObjOpClass) }, + { operator_tb, std::make_tuple(trUtf8("U"), ObjOperator) }, + { opfamily_tb, std::make_tuple(trUtf8("I"), ObjOpFamily) }, + { role_tb, std::make_tuple(trUtf8("R"), ObjRole) }, + { schema_tb, std::make_tuple(trUtf8("S"), ObjSchema) }, + { sequence_tb, std::make_tuple(trUtf8("Q"), ObjSequence) }, + { table_tb, std::make_tuple(trUtf8("T"), ObjTable) }, + { tablespace_tb, std::make_tuple(trUtf8("P"), ObjTablespace) }, + { textbox_tb, std::make_tuple(trUtf8("M"), ObjTextbox) }, + { type_tb, std::make_tuple(trUtf8("Y"), ObjType) }, + { view_tb, std::make_tuple(trUtf8("W"), ObjView) }, + { tag_tb, std::make_tuple(trUtf8("9"), ObjTag) }, + { constraint_tb, std::make_tuple(trUtf8("Z"), ObjConstraint) }, + { index_tb, std::make_tuple(trUtf8("X"), ObjIndex) }, + { column_tb, std::make_tuple(trUtf8("C"), ObjColumn) }, + { rule_tb, std::make_tuple(trUtf8("V"), ObjRule) }, + { trigger_tb, std::make_tuple(trUtf8("B"), ObjTrigger) }, + { policy_tb, std::make_tuple(trUtf8("9"), ObjPolicy) }, + { genericsql_tb, std::make_tuple(trUtf8("8"), ObjGenericSQL) } }; map> rel_shortcuts={ { rel11_tb, std::make_tuple(trUtf8("1"), 0) }, { rel1n_tb, std::make_tuple(trUtf8("2"), 1) }, @@ -107,26 +107,26 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par void NewObjectOverlayWidget::setSelectedObjects(vector &sel_objs) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; if(sel_objs.size()==1) obj_type=sel_objs.at(0)->getObjectType(); else if(sel_objs.empty()) - obj_type=OBJ_DATABASE; - - db_objs_grp->setVisible(obj_type==OBJ_DATABASE); - sch_objs_grp->setVisible(obj_type==OBJ_DATABASE || obj_type==OBJ_SCHEMA); - - tab_objs_grp->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW || obj_type==OBJ_RELATIONSHIP); - column_tb->setDisabled(obj_type==OBJ_VIEW); - constraint_tb->setDisabled(obj_type==OBJ_VIEW); - index_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); - rule_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); - trigger_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); - policy_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); - tab_perms_tb->setVisible(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW); - rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==OBJ_TABLE) || - (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==OBJ_TABLE && sel_objs.at(1)->getObjectType()==OBJ_TABLE)); + obj_type=ObjDatabase; + + db_objs_grp->setVisible(obj_type==ObjDatabase); + sch_objs_grp->setVisible(obj_type==ObjDatabase || obj_type==ObjSchema); + + tab_objs_grp->setVisible(obj_type==ObjTable || obj_type==ObjView || obj_type==ObjRelationship); + column_tb->setDisabled(obj_type==ObjView); + constraint_tb->setDisabled(obj_type==ObjView); + index_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); + rule_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); + trigger_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); + policy_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); + tab_perms_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); + rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==ObjTable) || + (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==ObjTable && sel_objs.at(1)->getObjectType()==ObjTable)); overlay_frm->adjustSize(); this->adjustSize(); diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index ab410b6610..1b94189182 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -22,7 +22,7 @@ ObjectDepsRefsWidget::ObjectDepsRefsWidget(QWidget *parent): BaseObjectWidget(parent) { Ui_ObjectDepsRefsWidget::setupUi(this); - configureFormLayout(objectdepsrefs_grid, BASE_OBJECT); + configureFormLayout(objectdepsrefs_grid, ObjBaseObject); PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); @@ -116,7 +116,7 @@ void ObjectDepsRefsWidget::handleItemSelection(QTableWidgetItem *item) { parent=dynamic_cast(this->object)->getParentTable(); - if(parent->getObjectType()==OBJ_TABLE) + if(parent->getObjectType()==ObjTable) parent_tab=dynamic_cast
(parent); else parent_view=dynamic_cast(parent); diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 8608f64dfd..9463b9ecba 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -104,7 +104,7 @@ void ObjectFinderWidget::fadeObjects(void) vector objects, other_objs; bool fade_listed = false; - for(auto obj_type : {OBJ_TABLE, OBJ_VIEW, OBJ_TEXTBOX, OBJ_RELATIONSHIP, BASE_RELATIONSHIP, OBJ_SCHEMA}) + for(auto obj_type : {ObjTable, ObjView, ObjTextbox, ObjRelationship, ObjBaseRelationship, ObjSchema}) { objects.insert(objects.end(), model_wgt->getDatabaseModel()->getObjectList(obj_type)->begin(), @@ -137,7 +137,7 @@ void ObjectFinderWidget::selectObjects(void) BaseGraphicObject *graph_obj = nullptr; bool sel_listed = false; - for(auto obj_type : {OBJ_TABLE, OBJ_VIEW, OBJ_TEXTBOX, OBJ_RELATIONSHIP, BASE_RELATIONSHIP, OBJ_SCHEMA}) + for(auto obj_type : {ObjTable, ObjView, ObjTextbox, ObjRelationship, ObjBaseRelationship, ObjSchema}) { objects.insert(objects.end(), model_wgt->getDatabaseModel()->getObjectList(obj_type)->begin(), @@ -291,8 +291,8 @@ void ObjectFinderWidget::editObject(void) { if(selected_obj) { - if(selected_obj->getObjectType()==OBJ_PERMISSION) - model_wgt->showObjectForm(OBJ_PERMISSION, dynamic_cast(selected_obj)->getObject()); + if(selected_obj->getObjectType()==ObjPermission) + model_wgt->showObjectForm(ObjPermission, dynamic_cast(selected_obj)->getObject()); else { vector vect; @@ -330,7 +330,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorgetObjectType()==BASE_RELATIONSHIP) + if(objs[i]->getObjectType()==ObjBaseRelationship) str_aux=QString("tv"); else str_aux.clear(); @@ -466,7 +466,7 @@ void ObjectFinderWidget::updateObjectTypeList(QListWidget *list_wgt) { item=new QListWidgetItem; - if(types[type_id]==BASE_RELATIONSHIP) + if(types[type_id]==ObjBaseRelationship) str_aux=QString(BaseObject::getSchemaName(types[type_id])) + QString("tv"); else str_aux=QString(BaseObject::getSchemaName(types[type_id])); diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index bddd60e33d..104b95eaa4 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -76,7 +76,7 @@ void ObjectRenameWidget::hideEvent(QHideEvent *) void ObjectRenameWidget::applyRenaming(void) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; try { @@ -92,13 +92,13 @@ void ObjectRenameWidget::applyRenaming(void) obj_type=object->getObjectType(); - if(obj_type!=OBJ_DATABASE) + if(obj_type!=ObjDatabase) { //Register the object on operations list before the modification op_list->registerObject(object, Operation::OBJECT_MODIFIED, -1, (tab_obj ? tab_obj->getParentTable() : nullptr)); //Format the object name to check if it will have a conflicting name - fmt_name=BaseObject::formatName(new_name_edt->text().toUtf8(), obj_type==OBJ_OPERATOR); + fmt_name=BaseObject::formatName(new_name_edt->text().toUtf8(), obj_type==ObjOperator); if(object->getSchema()) fmt_name=object->getSchema()->getName(true) + QString(".") + fmt_name; @@ -135,8 +135,8 @@ void ObjectRenameWidget::applyRenaming(void) { obj_graph->setModified(true); - if(obj_graph->getObjectType()==OBJ_TABLE || - obj_graph->getObjectType()==OBJ_VIEW) + if(obj_graph->getObjectType()==ObjTable || + obj_graph->getObjectType()==ObjView) { dynamic_cast(obj_graph->getSchema())->setModified(true); } @@ -155,7 +155,7 @@ void ObjectRenameWidget::applyRenaming(void) tab->setCodeInvalidated(true); dynamic_cast(tab->getSchema())->setModified(true); } - else if(object->getObjectType()==OBJ_SCHEMA) + else if(object->getObjectType()==ObjSchema) { model->validateSchemaRenaming(dynamic_cast(object), obj_name_lbl->text().toUtf8()); dynamic_cast(object)->setModified(true); @@ -166,7 +166,7 @@ void ObjectRenameWidget::applyRenaming(void) for(auto &obj : ref_objs) { - if(obj->getObjectType()==OBJ_COLUMN) + if(obj->getObjectType()==ObjColumn) { col=dynamic_cast(obj); col->getParentTable()->setModified(true); @@ -184,7 +184,7 @@ void ObjectRenameWidget::applyRenaming(void) { Messagebox msg_box; - if(obj_type!=OBJ_DATABASE) + if(obj_type!=ObjDatabase) op_list->removeLastOperation(); msg_box.show(e); diff --git a/libpgmodeler_ui/src/objectsdiffinfo.cpp b/libpgmodeler_ui/src/objectsdiffinfo.cpp index 54d253c147..2fba281b00 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.cpp +++ b/libpgmodeler_ui/src/objectsdiffinfo.cpp @@ -46,7 +46,7 @@ QString ObjectsDiffInfo::getInfoMessage(void) { QString msg=QString("%1 `%2' (%3)"), obj_name; BaseObject *ref_obj=nullptr; - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; if(diff_type==ALTER_OBJECT && old_object) ref_obj=old_object; @@ -58,9 +58,9 @@ QString ObjectsDiffInfo::getInfoMessage(void) /* Forcing the usage of BaseObject::getSignature for the following object, since the custom getSignature for those types return some undesired SQL keywords for this context */ - if(obj_type==OBJ_CONSTRAINT || obj_type==OBJ_TRIGGER || obj_type==OBJ_RULE) + if(obj_type==ObjConstraint || obj_type==ObjTrigger || obj_type==ObjRule) obj_name=dynamic_cast(ref_obj)->TableObject::getSignature(); - else if(obj_type==OBJ_OPCLASS || obj_type==OBJ_OPFAMILY) + else if(obj_type==ObjOpClass || obj_type==ObjOpFamily) obj_name=ref_obj->BaseObject::getSignature(); else obj_name=ref_obj->getSignature(); diff --git a/libpgmodeler_ui/src/objectselectorwidget.cpp b/libpgmodeler_ui/src/objectselectorwidget.cpp index d6a394d762..6b5866d278 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.cpp +++ b/libpgmodeler_ui/src/objectselectorwidget.cpp @@ -129,7 +129,7 @@ void ObjectSelectorWidget::setSelectedObject(BaseObject *object) rem_object_tb->setEnabled(object); this->selected_obj=object; - if(object->getObjectType()!=OBJ_CONSTRAINT) + if(object->getObjectType()!=ObjConstraint) obj_name_txt->setPlainText(selected_obj->getSignature()); else obj_name_txt->setPlainText(QString("%1.%2") diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index c2206beb46..3750556da6 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -95,7 +95,7 @@ void OperationListWidget::updateOperationList(void) str_aux=QString(BaseObject::getSchemaName(obj_type)); item->setData(0, Qt::UserRole, QVariant(obj_type)); - if(obj_type==BASE_RELATIONSHIP) + if(obj_type==ObjBaseRelationship) str_aux+=QString("tv"); item->setIcon(0,QPixmap(PgModelerUiNS::getIconPath(str_aux))); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 4f09729f69..4596ab0a10 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -18,7 +18,7 @@ #include "operatorclasswidget.h" -OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_OPCLASS) +OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(parent, ObjOpClass) { try { @@ -30,11 +30,11 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare Ui_OperatorClassWidget::setupUi(this); - family_sel=new ObjectSelectorWidget(OBJ_OPFAMILY, true, this); + family_sel=new ObjectSelectorWidget(ObjOpFamily, true, this); data_type=new PgSQLTypeWidget(this); - operator_sel=new ObjectSelectorWidget(OBJ_OPERATOR, true, this); - elem_family_sel=new ObjectSelectorWidget(OBJ_OPFAMILY, true, this); - function_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + operator_sel=new ObjectSelectorWidget(ObjOperator, true, this); + elem_family_sel=new ObjectSelectorWidget(ObjOpFamily, true, this); + function_sel=new ObjectSelectorWidget(ObjFunction, true, this); storage_type=new PgSQLTypeWidget(this, trUtf8("Storage Type")); elements_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); @@ -60,7 +60,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare grid->addWidget(data_type,4,0,1,5); grid->addWidget(elements_grp,5,0,1,5); this->setLayout(grid); - configureFormLayout(grid, OBJ_OPCLASS); + configureFormLayout(grid, ObjOpClass); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); @@ -150,7 +150,7 @@ void OperatorClassWidget::showElementData(OperatorClassElement elem, int lin_idx else { elements_tab->setCellText(*elem.getStorage(), lin_idx, 0); - elements_tab->setCellText(BaseObject::getTypeName(OBJ_TYPE), lin_idx, 1); + elements_tab->setCellText(BaseObject::getTypeName(ObjType), lin_idx, 1); } if(elem_type!=OperatorClassElement::STORAGE_ELEM) diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index ab0b88edf0..e7f8e548b4 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -18,7 +18,7 @@ #include "operatorfamilywidget.h" -OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_OPFAMILY) +OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(parent, ObjOpFamily) { QStringList types; map > fields_map; @@ -26,7 +26,7 @@ OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(pa QFrame *frame=nullptr; Ui_OperatorFamilyWidget::setupUi(this); - configureFormLayout(opfamily_grid, OBJ_OPFAMILY); + configureFormLayout(opfamily_grid, ObjOpFamily); IndexingType::getTypes(types); indexing_cmb->addItems(types); diff --git a/libpgmodeler_ui/src/operatorwidget.cpp b/libpgmodeler_ui/src/operatorwidget.cpp index c0c8fbb21f..b1ff890737 100644 --- a/libpgmodeler_ui/src/operatorwidget.cpp +++ b/libpgmodeler_ui/src/operatorwidget.cpp @@ -18,7 +18,7 @@ #include "operatorwidget.h" -OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_OPERATOR) +OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, ObjOperator) { try { @@ -50,7 +50,7 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_OP for(i=Operator::FUNC_OPERATOR; i <= Operator::FUNC_RESTRICT; i++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjFunction, true, this); if(i!=Operator::FUNC_OPERATOR) grid->addWidget(functions_sel[i],i,1,1,1); @@ -59,12 +59,12 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_OP for(i=Operator::OPER_COMMUTATOR, i1=3; i <= Operator::OPER_NEGATOR; i++,i1++) { operators_sel[i]=nullptr; - operators_sel[i]=new ObjectSelectorWidget(OBJ_OPERATOR, true, this); + operators_sel[i]=new ObjectSelectorWidget(ObjOperator, true, this); grid->addWidget(operators_sel[i],i1,1,1,1); } operator_grid->addWidget(functions_sel[0],0,1,1,3); - configureFormLayout(operator_grid, OBJ_OPERATOR); + configureFormLayout(operator_grid, ObjOperator); setRequiredField(operator_func_lbl); setRequiredField(functions_sel[0]); diff --git a/libpgmodeler_ui/src/parameterwidget.cpp b/libpgmodeler_ui/src/parameterwidget.cpp index 6da42e3405..988cd5ee39 100644 --- a/libpgmodeler_ui/src/parameterwidget.cpp +++ b/libpgmodeler_ui/src/parameterwidget.cpp @@ -18,7 +18,7 @@ #include "parameterwidget.h" -ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_PARAMETER) +ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, ObjParameter) { try { @@ -41,7 +41,7 @@ ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_ parameter_grid->addWidget(data_type,2, 0, 1, 4); parameter_grid->addItem(spacer, parameter_grid->count()+1,0); - configureFormLayout(parameter_grid, OBJ_PARAMETER); + configureFormLayout(parameter_grid, ObjParameter); connect(param_variadic_chk, SIGNAL(toggled(bool)), param_in_chk, SLOT(setDisabled(bool))); connect(param_variadic_chk, SIGNAL(toggled(bool)), param_out_chk, SLOT(setDisabled(bool))); connect(param_in_chk, SIGNAL(toggled(bool)), this, SLOT(enableVariadic(void))); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 1b05f4ff75..d5644cf6ec 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -18,7 +18,7 @@ #include "permissionwidget.h" -PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_PERMISSION) +PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, ObjPermission) { QGridLayout *grid=nullptr; QFrame *frame=nullptr; @@ -39,7 +39,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, OB object_selection_wgt=new ModelObjectsWidget(true); permission=nullptr; - configureFormLayout(permission_grid, OBJ_PERMISSION); + configureFormLayout(permission_grid, ObjPermission); name_edt->setReadOnly(true); comment_edt->setVisible(false); @@ -89,7 +89,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, OB } frame=generateInformationFrame(trUtf8("Leave the Roles grid empty in order to create a %1 applicable to PUBLIC.") - .arg(BaseObject::getTypeName(OBJ_PERMISSION).toLower())); + .arg(BaseObject::getTypeName(ObjPermission).toLower())); permission_grid->addWidget(frame, permission_grid->count()+1, 0, 1, 0); frame->setParent(this); @@ -163,7 +163,7 @@ void PermissionWidget::setAttributes(DatabaseModel *model, BaseObject *parent_ob void PermissionWidget::selectRole(void) { - object_selection_wgt->setObjectVisible(OBJ_ROLE, true); + object_selection_wgt->setObjectVisible(ObjRole, true); object_selection_wgt->setModel(this->model); object_selection_wgt->show(); } @@ -317,7 +317,7 @@ void PermissionWidget::updatePermission(void) //Checking if the permission already exists on model perm_idx=model->getPermissionIndex(perm, false); - if(perm_idx < 0 || (perm_idx >=0 && model->getObject(perm_idx,OBJ_PERMISSION)==permission)) + if(perm_idx < 0 || (perm_idx >=0 && model->getObject(perm_idx,ObjPermission)==permission)) { (*permission)=(*perm); listPermissions(); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 444cfa6866..4580dc1195 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -90,7 +90,7 @@ namespace PgModelerUiNS { void disableObjectSQL(BaseObject *object, bool disable) { - if(object && object->getObjectType()!=BASE_RELATIONSHIP) + if(object && object->getObjectType()!=ObjBaseRelationship) { Messagebox msgbox; ObjectType obj_type=object->getObjectType(); @@ -104,7 +104,7 @@ namespace PgModelerUiNS { object->setSQLDisabled(disable); - if(obj_type!=OBJ_DATABASE && curr_val!=disable) + if(obj_type!=ObjDatabase && curr_val!=disable) { msgbox.show(QString(QT_TR_NOOP("Do you want to apply the SQL %1 status to the object's references too? This will avoid problems when exporting or validating the model.")).arg(disable ? QT_TR_NOOP("disabling") : QT_TR_NOOP("enabling")), Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); @@ -115,10 +115,10 @@ namespace PgModelerUiNS { /* Special case for tables. When disable the code there is the need to disable constraints codes when the code of parent table is disabled too in order to avoid export errors */ - if(object->getObjectType()==OBJ_TABLE) + if(object->getObjectType()==ObjTable) { Constraint *constr = nullptr; - vector *objects=dynamic_cast
(object)->getObjectList(OBJ_CONSTRAINT); + vector *objects=dynamic_cast
(object)->getObjectList(ObjConstraint); for(auto &obj : (*objects)) { @@ -150,7 +150,7 @@ namespace PgModelerUiNS { tab_obj=dynamic_cast(refs.back()); //If the object is a relationship added does not do anything since the relationship itself will be disabled - if(refs.back()->getObjectType()!=BASE_RELATIONSHIP && + if(refs.back()->getObjectType()!=ObjBaseRelationship && (!tab_obj || (tab_obj && !tab_obj->isAddedByRelationship()))) { refs.back()->setSQLDisabled(object->isSQLDisabled()); diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index 94b1c3a0b7..a012b83730 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -18,14 +18,14 @@ #include "policywidget.h" -PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_POLICY) +PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjPolicy) { try { Ui_PolicyWidget::setupUi(this); model_objs_wgt = new ModelObjectsWidget(true, this); - model_objs_wgt->setObjectVisible(OBJ_ROLE, true); + model_objs_wgt->setObjectVisible(ObjRole, true); using_edt = PgModelerUiNS::createNumberedTextEditor(using_wgt); using_edt->setTabChangesFocus(true); @@ -49,7 +49,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_POLICY vbox->addWidget(roles_tab); QFrame *frame=generateInformationFrame(trUtf8("Leave the Roles grid empty in order to create a %1 applicable to PUBLIC.") - .arg(BaseObject::getTypeName(OBJ_POLICY).toLower())); + .arg(BaseObject::getTypeName(ObjPolicy).toLower())); vbox->addWidget(frame); frame->setParent(this); vbox->setContentsMargins(4,4,4,4); @@ -59,7 +59,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_POLICY PolicyCmdType::getTypes(cmds); command_cmb->addItems(cmds); - configureFormLayout(policy_grid, OBJ_POLICY); + configureFormLayout(policy_grid, ObjPolicy); configureTabOrder({ basics_grp, attribs_tbw }); connect(roles_tab, SIGNAL(s_rowAdded(int)), model_objs_wgt, SLOT(show())); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 7374297730..c56516471f 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -37,7 +37,7 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) expression_hl=new SyntaxHighlighter(expression_txt, false, true); expression_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - ref_object_sel=new ObjectSelectorWidget({ OBJ_TABLE, OBJ_COLUMN }, true, this); + ref_object_sel=new ObjectSelectorWidget({ ObjTable, ObjColumn }, true, this); ref_object_sel->enableObjectCreation(false); expression_cp=new CodeCompletionWidget(expression_txt, true); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 6ad34aa29d..7ab37f611b 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -24,7 +24,7 @@ #include "relationshipconfigwidget.h" #include "generalconfigwidget.h" -RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_RELATIONSHIP) +RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent, ObjRelationship) { try { @@ -131,7 +131,7 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent grid=dynamic_cast(rel_attribs_tbw->widget(GENERAL_TAB)->layout()); grid->addWidget(color_picker, 0, 1); - configureFormLayout(relationship_grid, OBJ_RELATIONSHIP); + configureFormLayout(relationship_grid, ObjRelationship); DeferralType::getTypes(list); deferral_cmb->addItems(list); @@ -260,7 +260,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l aux_rel=dynamic_cast(base_rel); - if(base_rel->getObjectType()==BASE_RELATIONSHIP) + if(base_rel->getObjectType()==ObjBaseRelationship) { if(base_rel->getRelationshipType()!=BaseRelationship::RELATIONSHIP_FK) { @@ -321,7 +321,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } } - disable_sql_chk->setVisible(base_rel->getObjectType()==OBJ_RELATIONSHIP); + disable_sql_chk->setVisible(base_rel->getObjectType()==ObjRelationship); table1_mand_chk->setText(base_rel->getTable(BaseRelationship::SRC_TABLE)->getName() + trUtf8(" is required")); table2_mand_chk->setText(base_rel->getTable(BaseRelationship::DST_TABLE)->getName() + trUtf8(" is required")); @@ -336,10 +336,10 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l constraints_tab->setButtonsEnabled(ObjectsTableWidget::ALL_BUTTONS, !aux_rel->isProtected()); //Lists the relationship attributes - listObjects(OBJ_COLUMN); + listObjects(ObjColumn); //Lists the relationship constraints - listObjects(OBJ_CONSTRAINT); + listObjects(ObjConstraint); listSpecialPkColumns(); @@ -381,7 +381,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l rel_type==BaseRelationship::RELATIONSHIP_FK); use_name_patterns=(rel1n || relnn || - (relgen_dep && base_rel->getObjectType()==OBJ_RELATIONSHIP)); + (relgen_dep && base_rel->getObjectType()==ObjRelationship)); name_patterns_grp->setVisible(use_name_patterns); @@ -423,15 +423,15 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l for(i=SETTINGS_TAB; i <= SPECIAL_PK_TAB; i++) rel_attribs_tbw->addTab(tabs[i], tab_labels[i]); } - else if(relgen_dep && base_rel->getObjectType()==OBJ_RELATIONSHIP) + else if(relgen_dep && base_rel->getObjectType()==ObjRelationship) rel_attribs_tbw->addTab(tabs[SPECIAL_PK_TAB], tab_labels[SPECIAL_PK_TAB]); - if(base_rel->getObjectType()==OBJ_RELATIONSHIP || - (base_rel->getObjectType()==BASE_RELATIONSHIP && + if(base_rel->getObjectType()==ObjRelationship || + (base_rel->getObjectType()==ObjBaseRelationship && base_rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK)) rel_attribs_tbw->addTab(tabs[ADVANCED_TAB], tab_labels[ADVANCED_TAB]); - copy_options_grp->setVisible(base_rel->getObjectType()==OBJ_RELATIONSHIP && + copy_options_grp->setVisible(base_rel->getObjectType()==ObjRelationship && base_rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_DEP); custom_color_chk->setChecked(base_rel->getCustomColor()!=Qt::transparent); @@ -463,7 +463,7 @@ QSize RelationshipWidget::getIdealSize(void) rel_type = dynamic_cast(this->object)->getRelationshipType(); if(rel_type == BaseRelationship::RELATIONSHIP_FK || - (BaseRelationship::RELATIONSHIP_DEP && this->object && this->object->getObjectType()==BASE_RELATIONSHIP)) + (BaseRelationship::RELATIONSHIP_DEP && this->object && this->object->getObjectType()==ObjBaseRelationship)) return(QSize(640, 320)); else if(BaseRelationship::RELATIONSHIP_GEN) return(QSize(640, 520)); @@ -564,7 +564,7 @@ void RelationshipWidget::listObjects(ObjectType obj_type) try { - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) tab=attributes_tab; else tab=constraints_tab; @@ -683,13 +683,13 @@ void RelationshipWidget::showAdvancedObject(int row) ObjectType obj_type=object->getObjectType(); bool is_protected = false; - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { col=dynamic_cast(object); is_protected = col->isProtected(); openEditingForm(col, col->getParentTable()); } - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) { constr=dynamic_cast(object); @@ -733,7 +733,7 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) BaseObject *parent_aux = nullptr; int res = 0; - if(this->object->getObjectType() == BASE_RELATIONSHIP) + if(this->object->getObjectType() == ObjBaseRelationship) parent_aux = dynamic_cast(this->object)->getTable(BaseRelationship::SRC_TABLE); else parent_aux = !parent ? this->object : parent; @@ -750,22 +750,22 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) void RelationshipWidget::addObject(void) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; try { if(sender()==attributes_tab) { - obj_type=OBJ_COLUMN; + obj_type=ObjColumn; tab=attributes_tab; } else { - obj_type=OBJ_CONSTRAINT; + obj_type=ObjConstraint; tab=constraints_tab; } - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) openEditingForm(nullptr); else openEditingForm(nullptr); @@ -781,7 +781,7 @@ void RelationshipWidget::addObject(void) void RelationshipWidget::duplicateObject(int curr_row, int new_row) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; BaseObject *object = nullptr, *dup_object = nullptr; Relationship *rel = dynamic_cast(this->object); vector obj_list; @@ -795,13 +795,13 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) { if(sender()==attributes_tab) { - obj_type=OBJ_COLUMN; + obj_type=ObjColumn; tab=attributes_tab; obj_list = rel->getAttributes(); } else { - obj_type=OBJ_CONSTRAINT; + obj_type=ObjConstraint; tab=constraints_tab; obj_list = rel->getConstraints(); } @@ -835,7 +835,7 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) void RelationshipWidget::editObject(int row) { - ObjectType obj_type=OBJ_COLUMN; + ObjectType obj_type=ObjColumn; TableObject *tab_obj=nullptr; try @@ -844,13 +844,13 @@ void RelationshipWidget::editObject(int row) if(sender()==attributes_tab) { - obj_type=OBJ_COLUMN; + obj_type=ObjColumn; tab_obj=reinterpret_cast(attributes_tab->getRowData(row).value()); openEditingForm(tab_obj); } else { - obj_type=OBJ_CONSTRAINT; + obj_type=ObjConstraint; tab_obj=reinterpret_cast(constraints_tab->getRowData(row).value()); openEditingForm(tab_obj); } @@ -870,7 +870,7 @@ void RelationshipWidget::showObjectData(TableObject *object, int row) { ObjectsTableWidget *tab=nullptr; - if(object->getObjectType()==OBJ_COLUMN) + if(object->getObjectType()==ObjColumn) { tab=attributes_tab; attributes_tab->setCellText(*dynamic_cast(object)->getType(),row,1); @@ -888,7 +888,7 @@ void RelationshipWidget::showObjectData(TableObject *object, int row) void RelationshipWidget::removeObjects(void) { Relationship *rel=nullptr; - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; unsigned count, op_count=0, i; TableObject *object=nullptr; @@ -898,12 +898,12 @@ void RelationshipWidget::removeObjects(void) if(sender()==attributes_tab) { - obj_type=OBJ_COLUMN; + obj_type=ObjColumn; count=rel->getAttributeCount(); } else { - obj_type=OBJ_CONSTRAINT; + obj_type=ObjConstraint; count=rel->getConstraintCount(); } @@ -917,7 +917,7 @@ void RelationshipWidget::removeObjects(void) rel->removeObject(object); } - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) listSpecialPkColumns(); } catch(Exception &e) @@ -944,7 +944,7 @@ void RelationshipWidget::removeObjects(void) void RelationshipWidget::removeObject(int row) { Relationship *rel=nullptr; - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; TableObject *object=nullptr; int op_id=-1; @@ -953,15 +953,15 @@ void RelationshipWidget::removeObject(int row) rel=dynamic_cast(this->object); if(sender()==attributes_tab) - obj_type=OBJ_COLUMN; + obj_type=ObjColumn; else - obj_type=OBJ_CONSTRAINT; + obj_type=ObjConstraint; object=rel->getObject(row, obj_type); op_id=op_list->registerObject(object, Operation::OBJECT_REMOVED, 0, rel); rel->removeObject(object); - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) listSpecialPkColumns(); } catch(Exception &e) @@ -1058,13 +1058,13 @@ void RelationshipWidget::applyConfiguration(void) /* Due to the complexity of the Relationship class and the strong link between all the relationships on the model is necessary to store the XML of the special objects and disconnect all relationships, edit the relationshi and revalidate all the relationships again */ - if(this->object->getObjectType()==OBJ_RELATIONSHIP) + if(this->object->getObjectType()==ObjRelationship) { model->storeSpecialObjectsXML(); model->disconnectRelationships(); } - if(!this->new_object && this->object->getObjectType()==OBJ_RELATIONSHIP) + if(!this->new_object && this->object->getObjectType()==ObjRelationship) op_list->registerObject(this->object, Operation::OBJECT_MODIFIED); else registerNewObject(); @@ -1076,7 +1076,7 @@ void RelationshipWidget::applyConfiguration(void) else base_rel->setCustomColor(Qt::transparent); - if(this->object->getObjectType()==OBJ_RELATIONSHIP) + if(this->object->getObjectType()==ObjRelationship) { QPlainTextEdit *pattern_fields[]={ src_col_pattern_txt, dst_col_pattern_txt, src_fk_pattern_txt, dst_fk_pattern_txt, diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index 79c763b401..642eff9dd8 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -61,7 +61,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent end=std::unique(type_ids.begin(), type_ids.end()); type_ids.erase(end, type_ids.end()); - types = aux_cat.getObjectsAttributes(OBJ_TYPE, QString(), QString(), type_ids); + types = aux_cat.getObjectsAttributes(ObjType, QString(), QString(), type_ids); col = 0; for(auto &tp : types) diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index 88b5a1bf33..069bdd5e10 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -19,7 +19,7 @@ #include "rolewidget.h" #include "modelobjectswidget.h" -RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_ROLE) +RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRole) { ObjectsTableWidget *obj_tab=nullptr; QGridLayout *grid=nullptr; @@ -28,7 +28,7 @@ RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_ROLE) unsigned i; Ui_RoleWidget::setupUi(this); - configureFormLayout(role_grid, OBJ_ROLE); + configureFormLayout(role_grid, ObjRole); object_selection_wgt=new ModelObjectsWidget(true); @@ -102,7 +102,7 @@ void RoleWidget::configureRoleSelection(void) void RoleWidget::selectMemberRole(void) { - object_selection_wgt->setObjectVisible(OBJ_ROLE, true); + object_selection_wgt->setObjectVisible(ObjRole, true); object_selection_wgt->setModel(this->model); object_selection_wgt->show(); } diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index e86f5ce86c..12f376a139 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -18,7 +18,7 @@ #include "rulewidget.h" -RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_RULE) +RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRule) { try { @@ -43,7 +43,7 @@ RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_RULE) rule_grid->addWidget(frame, rule_grid->count()+1, 0, 1, 0); frame->setParent(this); - configureFormLayout(rule_grid, OBJ_RULE); + configureFormLayout(rule_grid, ObjRule); EventType::getTypes(list); event_cmb->addItems(list); diff --git a/libpgmodeler_ui/src/schemawidget.cpp b/libpgmodeler_ui/src/schemawidget.cpp index 7ddac2b952..a716d2dab3 100644 --- a/libpgmodeler_ui/src/schemawidget.cpp +++ b/libpgmodeler_ui/src/schemawidget.cpp @@ -18,12 +18,12 @@ #include "schemawidget.h" -SchemaWidget::SchemaWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_SCHEMA) +SchemaWidget::SchemaWidget(QWidget *parent): BaseObjectWidget(parent, ObjSchema) { Ui_SchemaWidget::setupUi(this); QHBoxLayout *hbox=nullptr; - configureFormLayout(nullptr, OBJ_SCHEMA); + configureFormLayout(nullptr, ObjSchema); color_picker=new ColorPickerWidget(1, this); diff --git a/libpgmodeler_ui/src/sequencewidget.cpp b/libpgmodeler_ui/src/sequencewidget.cpp index 6f6b131129..3e95ec997b 100644 --- a/libpgmodeler_ui/src/sequencewidget.cpp +++ b/libpgmodeler_ui/src/sequencewidget.cpp @@ -18,17 +18,17 @@ #include "sequencewidget.h" -SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_SEQUENCE) +SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, ObjSequence) { try { Ui_SequenceWidget::setupUi(this); column_sel=nullptr; - column_sel=new ObjectSelectorWidget(OBJ_COLUMN, true, this); + column_sel=new ObjectSelectorWidget(ObjColumn, true, this); sequence_grid->addWidget(column_sel, 4, 1, 1, 3); - configureFormLayout(sequence_grid, OBJ_SEQUENCE); + configureFormLayout(sequence_grid, ObjSequence); sequence_grid->addItem(new QSpacerItem(10,0,QSizePolicy::Minimum,QSizePolicy::Expanding), sequence_grid->count(), 0); configureTabOrder(); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 71f2330c29..6e67df90a7 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -30,8 +30,8 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( QPixmap ico; QString gen_purpose=trUtf8("General purpose"); map types_map; - vector types=BaseObject::getObjectTypes(true, {OBJ_RELATIONSHIP, OBJ_TAG, OBJ_TEXTBOX, - OBJ_PERMISSION, BASE_RELATIONSHIP }); + vector types=BaseObject::getObjectTypes(true, {ObjRelationship, ObjTag, ObjTextbox, + ObjPermission, ObjBaseRelationship }); setupUi(this); @@ -46,10 +46,10 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( filter_cmb->addItem(ico, itr.first, itr.second); } - applies_to_cmb->insertItem(0, gen_purpose, BASE_OBJECT); + applies_to_cmb->insertItem(0, gen_purpose, ObjBaseObject); applies_to_cmb->setCurrentIndex(0); - filter_cmb->insertItem(0, gen_purpose, BASE_OBJECT); + filter_cmb->insertItem(0, gen_purpose, ObjBaseObject); filter_cmb->insertItem(0, trUtf8("All snippets")); filter_cmb->setCurrentIndex(0); @@ -106,7 +106,7 @@ attribs_map SnippetsConfigWidget::getSnippetById(const QString &snip_id) QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) { QStringList ids; - QString type_name=(obj_type==BASE_OBJECT ? + QString type_name=(obj_type==ObjBaseObject ? ParsersAttributes::GENERAL : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) @@ -121,7 +121,7 @@ QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) vector SnippetsConfigWidget::getSnippetsByObject(ObjectType obj_type) { vector snippets; - QString type_name=(obj_type==BASE_OBJECT ? + QString type_name=(obj_type==ObjBaseObject ? ParsersAttributes::GENERAL : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.h b/libpgmodeler_ui/src/snippetsconfigwidget.h index b3d9f7dd84..ee60576ee8 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.h +++ b/libpgmodeler_ui/src/snippetsconfigwidget.h @@ -79,7 +79,7 @@ class SnippetsConfigWidget: public BaseConfigWidget, public Ui::SnippetsConfigWi static QStringList getSnippetsIdsByObject(ObjectType obj_type); /*! \brief Returns a vector of snippets' attributes filtering by the object type in which they apply. - There's a special group for general purpose snippets that can be retrieved using BASE_OBJECT type. + There's a special group for general purpose snippets that can be retrieved using ObjBaseObject type. If there is no snippets related to the type an empty vector is returned. */ static vector getSnippetsByObject(ObjectType obj_type); diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index 376a2177b7..c13e29e706 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -25,7 +25,7 @@ SourceCodeWidget::SourceCodeWidget(QWidget *parent): BaseObjectWidget(parent) try { Ui_SourceCodeWidget::setupUi(this); - configureFormLayout(codigofonte_grid, BASE_OBJECT); + configureFormLayout(codigofonte_grid, ObjBaseObject); comment_lbl->setVisible(false); comment_edt->setVisible(false); @@ -76,9 +76,9 @@ void SourceCodeWidget::setSourceCodeTab(int) code_icon=QString("codigoxml"); enabled=(sourcecode_twg->currentIndex()==0 && - ((obj_type==BASE_RELATIONSHIP && + ((obj_type==ObjBaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) - || (obj_type!=BASE_RELATIONSHIP && obj_type!=OBJ_TEXTBOX))); + || (obj_type!=ObjBaseRelationship && obj_type!=ObjTextbox))); icone=QPixmap(PgModelerUiNS::getIconPath(code_icon)); icon_lbl->setPixmap(icone); @@ -130,14 +130,14 @@ void SourceCodeWidget::generateSourceCode(int) xmlcode_txt->clear(); obj_type=object->getObjectType(); - if(obj_type!=OBJ_TEXTBOX || - (obj_type==BASE_RELATIONSHIP && + if(obj_type!=ObjTextbox || + (obj_type==ObjBaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK)) { QString aux_def; BaseObject::setPgSQLVersion(version_cmb->currentText()); - if(obj_type==OBJ_DATABASE) + if(obj_type==ObjDatabase) { task_prog_wgt=new TaskProgressWidget; task_prog_wgt->setWindowTitle(trUtf8("Generating source code...")); @@ -229,10 +229,10 @@ void SourceCodeWidget::setAttributes(DatabaseModel *model, BaseObject *object) this->name_edt->setText(QString("%1 (%2)").arg(object->getSignature()).arg(object->getTypeName())); this->protected_obj_frm->setVisible(false); this->obj_id_lbl->setVisible(false); - this->code_options_cmb->setEnabled(obj_type!=OBJ_DATABASE && - obj_type!=OBJ_TEXTBOX && - obj_type!=BASE_RELATIONSHIP && - obj_type!=OBJ_RELATIONSHIP); + this->code_options_cmb->setEnabled(obj_type!=ObjDatabase && + obj_type!=ObjTextbox && + obj_type!=ObjBaseRelationship && + obj_type!=ObjRelationship); #ifdef DEMO_VERSION #warning "DEMO VERSION: SQL code display options disabled." diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 6bcc3a00d0..d0047e4bd8 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -268,7 +268,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab end=std::unique(type_ids.begin(), type_ids.end()); type_ids.erase(end, type_ids.end()); - types=catalog.getObjectsAttributes(OBJ_TYPE, QString(), QString(), type_ids); + types=catalog.getObjectsAttributes(ObjType, QString(), QString(), type_ids); for(auto &tp : types) type_names[tp[ParsersAttributes::OID].toUInt()]=tp[ParsersAttributes::NAME]; diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index 109e4a2afe..fae3db479a 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -8,8 +8,8 @@ SwapObjectsIdsWidget::SwapObjectsIdsWidget(QWidget *parent, Qt::WindowFlags f) : try { QGridLayout *swap_objs_grid=new QGridLayout(this); - vector types=BaseObject::getObjectTypes(true, {OBJ_PERMISSION, OBJ_ROLE, OBJ_TEXTBOX, - OBJ_COLUMN, OBJ_CONSTRAINT }); + vector types=BaseObject::getObjectTypes(true, {ObjPermission, ObjRole, ObjTextbox, + ObjColumn, ObjConstraint }); setupUi(this); PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); @@ -125,7 +125,7 @@ void SwapObjectsIdsWidget::fillCreationOrderGrid(void) //Using an stl function to extract all the values (objects) from the map and put them into a list std::for_each(creation_order.begin(), creation_order.end(), [&](const std::pair &itr) { - if(itr.second->getObjectType() != OBJ_CONSTRAINT) { + if(itr.second->getObjectType() != ObjConstraint) { objects.push_back(itr.second); } }); @@ -185,7 +185,7 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) if(!src_obj && !dst_obj) throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raise an exception if the user try to swap an id of relationship by other object of different kind - else if((src_obj->getObjectType()==OBJ_RELATIONSHIP || dst_obj->getObjectType()==OBJ_RELATIONSHIP) && + else if((src_obj->getObjectType()==ObjRelationship || dst_obj->getObjectType()==ObjRelationship) && (src_obj->getObjectType() != dst_obj->getObjectType())) throw Exception(InvRelationshipIdSwap,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -194,10 +194,10 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) BaseObject::swapObjectsIds(src_obj, dst_obj, false); //Special id swap for relationship - if(src_obj->getObjectType()==OBJ_RELATIONSHIP) + if(src_obj->getObjectType()==ObjRelationship) { vector::iterator itr, itr1; - vector *list=model->getObjectList(OBJ_RELATIONSHIP); + vector *list=model->getObjectList(ObjRelationship); //Find the relationships in the list and swap the memory position too itr=std::find(list->begin(), list->end(), src_obj); diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 7cec58e5e2..4ea8bed101 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -23,12 +23,12 @@ const QString TableDataWidget::PLACEHOLDER_COLUMN=QString("$placeholder$"); -TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, BASE_OBJECT) +TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjBaseObject) { Ui_TableDataWidget::setupUi(this); - configureFormLayout(tabledata_grid, BASE_OBJECT); + configureFormLayout(tabledata_grid, ObjBaseObject); - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(OBJ_TABLE))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(ObjTable))); comment_lbl->setVisible(false); comment_edt->setVisible(false); @@ -355,7 +355,7 @@ void TableDataWidget::populateDataGrid(const QString &data) } else { - for(auto object : *table->getObjectList(OBJ_COLUMN)) + for(auto object : *table->getObjectList(ObjColumn)) columns.push_back(object->getName()); } @@ -434,7 +434,7 @@ void TableDataWidget::configureColumnNamesMenu(void) col_names_menu.clear(); - for(auto object : *table->getObjectList(OBJ_COLUMN)) + for(auto object : *table->getObjectList(ObjColumn)) col_names.push_back(object->getName()); for(int col = 0; col < data_tbw->columnCount(); col++) diff --git a/libpgmodeler_ui/src/tablespacewidget.cpp b/libpgmodeler_ui/src/tablespacewidget.cpp index 4933de221b..4df7dfce2e 100644 --- a/libpgmodeler_ui/src/tablespacewidget.cpp +++ b/libpgmodeler_ui/src/tablespacewidget.cpp @@ -18,10 +18,10 @@ #include "tablespacewidget.h" -TablespaceWidget::TablespaceWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLESPACE) +TablespaceWidget::TablespaceWidget(QWidget *parent): BaseObjectWidget(parent, ObjTablespace) { Ui_TablespaceWidget::setupUi(this); - configureFormLayout(tablespace_grid, OBJ_TABLESPACE); + configureFormLayout(tablespace_grid, ObjTablespace); tablespace_grid->addItem(new QSpacerItem(10,0,QSizePolicy::Minimum,QSizePolicy::Expanding), tablespace_grid->count(), 0); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 5356ad1486..958d6c7a54 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -27,12 +27,12 @@ #include "policywidget.h" #include "generalconfigwidget.h" -TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) +TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) { QGridLayout *grid=nullptr; QVBoxLayout *vbox=nullptr; ObjectsTableWidget *tab=nullptr; - ObjectType types[]={ OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_POLICY }; + ObjectType types[]={ ObjColumn, ObjConstraint, ObjTrigger, ObjRule, ObjIndex, ObjPolicy }; map > fields_map; QFrame *frame=nullptr; QPushButton *edt_data_tb=nullptr; @@ -68,7 +68,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) parent_tables->setHeaderLabel(trUtf8("Type"), 2); parent_tables->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),2); - tag_sel = new ObjectSelectorWidget(OBJ_TAG, false, this); + tag_sel = new ObjectSelectorWidget(ObjTag, false, this); vbox = new QVBoxLayout(tag_sel_parent); vbox->addWidget(tag_sel); vbox->setContentsMargins(0,0,0,0); @@ -99,19 +99,19 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) connect(tab, SIGNAL(s_rowsMoved(int,int)), this, SLOT(swapObjects(int,int))); } - objects_tab_map[OBJ_COLUMN]->setColumnCount(6); - objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("PK"), 0); - objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Name"), 1); - objects_tab_map[OBJ_COLUMN]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),1); - objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Type"), 2); - objects_tab_map[OBJ_COLUMN]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),2); - objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Default Value"), 3); - objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Attribute(s)"), 4); - objects_tab_map[OBJ_COLUMN]->setHeaderLabel(trUtf8("Alias"), 5); - objects_tab_map[OBJ_COLUMN]->adjustColumnToContents(0); - - connect(objects_tab_map[OBJ_COLUMN], &ObjectsTableWidget::s_cellClicked, [&](int row, int col){ - if(col == 0 && objects_tab_map[OBJ_COLUMN]->isCellDisabled(static_cast(row), static_cast(col))) + objects_tab_map[ObjColumn]->setColumnCount(6); + objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("PK"), 0); + objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Name"), 1); + objects_tab_map[ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),1); + objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Type"), 2); + objects_tab_map[ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),2); + objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Default Value"), 3); + objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Attribute(s)"), 4); + objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Alias"), 5); + objects_tab_map[ObjColumn]->adjustColumnToContents(0); + + connect(objects_tab_map[ObjColumn], &ObjectsTableWidget::s_cellClicked, [&](int row, int col){ + if(col == 0 && objects_tab_map[ObjColumn]->isCellDisabled(static_cast(row), static_cast(col))) { Messagebox msg_box; Table *table = dynamic_cast
(this->object); @@ -124,49 +124,49 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) } }); - objects_tab_map[OBJ_CONSTRAINT]->setColumnCount(5); - objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[OBJ_CONSTRAINT]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); - objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("Type"), 1); - objects_tab_map[OBJ_CONSTRAINT]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); - objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("ON DELETE"), 2); - objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("ON UPDATE"), 3); - objects_tab_map[OBJ_CONSTRAINT]->setHeaderLabel(trUtf8("Alias"), 4); - - objects_tab_map[OBJ_TRIGGER]->setColumnCount(5); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[OBJ_TRIGGER]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Refer. Table"), 1); - objects_tab_map[OBJ_TRIGGER]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("table")),1); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Firing"), 2); - objects_tab_map[OBJ_TRIGGER]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("trigger")),2); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Events"), 3); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Alias"), 4); - - objects_tab_map[OBJ_RULE]->setColumnCount(4); - objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[OBJ_RULE]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); - objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Execution"), 1); - objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Event"), 2); - objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Alias"), 3); - - objects_tab_map[OBJ_INDEX]->setColumnCount(3); - objects_tab_map[OBJ_INDEX]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[OBJ_INDEX]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); - objects_tab_map[OBJ_INDEX]->setHeaderLabel(trUtf8("Indexing"), 1); - objects_tab_map[OBJ_INDEX]->setHeaderLabel(trUtf8("Alias"), 2); - - objects_tab_map[OBJ_POLICY]->setColumnCount(7); - objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[OBJ_POLICY]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); - objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Command"), 1); - objects_tab_map[OBJ_POLICY]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("keyword")),1); - objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Permissive"), 2); - objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("USING expression"), 3); - objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("CHECK expression"), 4); - objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Roles"), 5); - objects_tab_map[OBJ_POLICY]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),5); - objects_tab_map[OBJ_POLICY]->setHeaderLabel(trUtf8("Alias"), 6); + objects_tab_map[ObjConstraint]->setColumnCount(5); + objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Type"), 1); + objects_tab_map[ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("ON DELETE"), 2); + objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("ON UPDATE"), 3); + objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Alias"), 4); + + objects_tab_map[ObjTrigger]->setColumnCount(5); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("table")),1); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("trigger")),2); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Alias"), 4); + + objects_tab_map[ObjRule]->setColumnCount(4); + objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); + objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Event"), 2); + objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Alias"), 3); + + objects_tab_map[ObjIndex]->setColumnCount(3); + objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); + objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Alias"), 2); + + objects_tab_map[ObjPolicy]->setColumnCount(7); + objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Command"), 1); + objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("keyword")),1); + objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Permissive"), 2); + objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("USING expression"), 3); + objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("CHECK expression"), 4); + objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Roles"), 5); + objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),5); + objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Alias"), 6); partition_keys_tab = new ElementsTableWidget; partition_keys_tab->setEnabled(false); @@ -181,7 +181,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TABLE) partition_keys_tab->setEnabled(partitioning_type_cmb->currentIndex() != 0); }); - configureFormLayout(table_grid, OBJ_TABLE); + configureFormLayout(table_grid, ObjTable); configureTabOrder({ tag_sel }); setMinimumSize(660, 620); } @@ -214,7 +214,7 @@ ObjectsTableWidget *TableWidget::getObjectTable(ObjectType obj_type) ObjectType TableWidget::getObjectType(QObject *sender) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; if(sender) { @@ -223,7 +223,7 @@ ObjectType TableWidget::getObjectType(QObject *sender) itr=objects_tab_map.begin(); itr_end=objects_tab_map.end(); - while(itr!=itr_end && obj_type==BASE_OBJECT) + while(itr!=itr_end && obj_type==ObjBaseObject) { if(itr->second==sender) obj_type=itr->first; @@ -241,7 +241,7 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc { unsigned i, count; Table *aux_tab=nullptr; - ObjectType types[]={ OBJ_COLUMN, OBJ_CONSTRAINT, OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX, OBJ_POLICY }; + ObjectType types[]={ ObjColumn, ObjConstraint, ObjTrigger, ObjRule, ObjIndex, ObjPolicy }; vector part_keys; if(!table) @@ -361,14 +361,14 @@ void TableWidget::listObjects(ObjectType obj_type) tab->blockSignals(false); //Enables the add button on the constraints, triggers and index tab only when there is columns created - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { - objects_tab_map[OBJ_CONSTRAINT]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, - objects_tab_map[OBJ_COLUMN]->getRowCount() > 0); - objects_tab_map[OBJ_TRIGGER]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, - objects_tab_map[OBJ_COLUMN]->getRowCount() > 0); - objects_tab_map[OBJ_INDEX]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, - objects_tab_map[OBJ_COLUMN]->getRowCount() > 0); + objects_tab_map[ObjConstraint]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, + objects_tab_map[ObjColumn]->getRowCount() > 0); + objects_tab_map[ObjTrigger]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, + objects_tab_map[ObjColumn]->getRowCount() > 0); + objects_tab_map[ObjIndex]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, + objects_tab_map[ObjColumn]->getRowCount() > 0); } } catch(Exception &e) @@ -379,7 +379,7 @@ void TableWidget::listObjects(ObjectType obj_type) void TableWidget::handleObject(void) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; TableObject *object=nullptr; ObjectsTableWidget *obj_table=nullptr; @@ -394,23 +394,23 @@ void TableWidget::handleObject(void) if(obj_table->getSelectedRow()>=0) object=reinterpret_cast(obj_table->getRowData(obj_table->getSelectedRow()).value()); - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) openEditingForm(object); - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) openEditingForm(object); - else if(obj_type==OBJ_TRIGGER) + else if(obj_type==ObjTrigger) openEditingForm(object); - else if(obj_type==OBJ_INDEX) + else if(obj_type==ObjIndex) openEditingForm(object); - else if(obj_type==OBJ_RULE) + else if(obj_type==ObjRule) openEditingForm(object); else openEditingForm(object); listObjects(obj_type); - if(obj_type == OBJ_CONSTRAINT) - listObjects(OBJ_COLUMN); + if(obj_type == ObjConstraint) + listObjects(ObjColumn); } catch(Exception &e) { @@ -449,13 +449,13 @@ void TableWidget::showObjectData(TableObject *object, int row) tab=objects_tab_map[obj_type]; - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) tab->setCellText(object->getName(),row,1); else tab->setCellText(object->getName(),row,0); //For each object type there is a use for the columns from 1 to 3 - if(obj_type==OBJ_COLUMN) + if(obj_type==ObjColumn) { Table *table = dynamic_cast
(this->object); Constraint *pk = table->getPrimaryKey(); @@ -501,7 +501,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(column->getAlias(), row, 5); tab->adjustColumnToContents(0); } - else if(obj_type==OBJ_CONSTRAINT) + else if(obj_type==ObjConstraint) { constr=dynamic_cast(object); @@ -524,7 +524,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(constr->getAlias(), row, 4); } - else if(obj_type==OBJ_TRIGGER) + else if(obj_type==ObjTrigger) { trigger=dynamic_cast(object); @@ -546,7 +546,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(str_aux ,row,3); tab->setCellText(trigger->getAlias(), row, 4); } - else if(obj_type==OBJ_RULE) + else if(obj_type==ObjRule) { rule=dynamic_cast(object); @@ -558,7 +558,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(rule->getAlias(), row, 3); } - else if(obj_type==OBJ_INDEX) + else if(obj_type==ObjIndex) { index=dynamic_cast(object); @@ -567,7 +567,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(index->getAlias(), row, 2); } - else if(obj_type==OBJ_POLICY) + else if(obj_type==ObjPolicy) { QStringList rol_names; @@ -614,7 +614,7 @@ void TableWidget::removeObjects(void) Table *table=nullptr; unsigned count, op_count=0, i; BaseObject *object=nullptr; - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; try { @@ -641,8 +641,8 @@ void TableWidget::removeObjects(void) RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - if(obj_type == OBJ_CONSTRAINT) - listObjects(OBJ_COLUMN); + if(obj_type == ObjConstraint) + listObjects(ObjColumn); } catch(Exception &e) { @@ -670,7 +670,7 @@ void TableWidget::removeObject(int row) { Table *table=nullptr; BaseObject *object=nullptr; - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; int op_id=-1; try @@ -693,8 +693,8 @@ void TableWidget::removeObject(int row) .arg(object->getTypeName()), RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type == OBJ_CONSTRAINT) - listObjects(OBJ_COLUMN); + if(obj_type == ObjConstraint) + listObjects(ObjColumn); } catch(Exception &e) { @@ -713,7 +713,7 @@ void TableWidget::removeObject(int row) void TableWidget::duplicateObject(int sel_row, int new_row) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; BaseObject *object=nullptr, *dup_object=nullptr; ObjectsTableWidget *obj_table=nullptr; Table *table = dynamic_cast
(this->object); @@ -756,7 +756,7 @@ void TableWidget::duplicateObject(int sel_row, int new_row) void TableWidget::TableWidget::swapObjects(int idx1, int idx2) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; Table *table=nullptr; int count; @@ -810,7 +810,7 @@ void TableWidget::applyConfiguration(void) vector rels; vector pk_cols; vector part_keys; - ObjectsTableWidget *col_tab = objects_tab_map[OBJ_COLUMN]; + ObjectsTableWidget *col_tab = objects_tab_map[ObjColumn]; PartitioningType part_type; if(!this->new_object) @@ -861,7 +861,7 @@ void TableWidget::applyConfiguration(void) pk = new Constraint; pk->setName(pk_name); - pk->setName(PgModelerNS::generateUniqueName(pk, *table->getObjectList(OBJ_CONSTRAINT))); + pk->setName(PgModelerNS::generateUniqueName(pk, *table->getObjectList(ObjConstraint))); for(Column *col : pk_cols) pk->addColumn(col, Constraint::SOURCE_COLS); diff --git a/libpgmodeler_ui/src/tagwidget.cpp b/libpgmodeler_ui/src/tagwidget.cpp index dacae2328e..696edd33e9 100644 --- a/libpgmodeler_ui/src/tagwidget.cpp +++ b/libpgmodeler_ui/src/tagwidget.cpp @@ -18,10 +18,10 @@ #include "tagwidget.h" -TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TAG) +TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjTag) { Ui_TagWidget::setupUi(this); - configureFormLayout(tag_grid, OBJ_TAG); + configureFormLayout(tag_grid, ObjTag); QStringList attribs={ ParsersAttributes::TABLE_NAME, ParsersAttributes::TABLE_SCHEMA_NAME, ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, diff --git a/libpgmodeler_ui/src/textboxwidget.cpp b/libpgmodeler_ui/src/textboxwidget.cpp index 2adfc67460..ba5a9b9c93 100644 --- a/libpgmodeler_ui/src/textboxwidget.cpp +++ b/libpgmodeler_ui/src/textboxwidget.cpp @@ -18,10 +18,10 @@ #include "textboxwidget.h" -TextboxWidget::TextboxWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TEXTBOX) +TextboxWidget::TextboxWidget(QWidget *parent): BaseObjectWidget(parent, ObjTextbox) { Ui_TextboxWidget::setupUi(this); - configureFormLayout(textbox_grid, OBJ_TEXTBOX); + configureFormLayout(textbox_grid, ObjTextbox); text_txt->removeEventFilter(this); connect(color_select_tb, SIGNAL(clicked(void)), this, SLOT(selectTextColor(void))); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index dba70d04d3..8b5e59d8c6 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -18,7 +18,7 @@ #include "triggerwidget.h" -TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TRIGGER) +TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjTrigger) { try { @@ -36,8 +36,8 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TRIG arguments_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); - ref_table_sel=new ObjectSelectorWidget(OBJ_TABLE, true, this); - function_sel=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + ref_table_sel=new ObjectSelectorWidget(ObjTable, true, this); + function_sel=new ObjectSelectorWidget(ObjFunction, true, this); ref_table_sel->setEnabled(false); trigger_grid->addWidget(function_sel, 3, 1, 1, 5); @@ -58,7 +58,7 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TRIG FiringType::getTypes(list); firing_mode_cmb->addItems(list); - configureFormLayout(trigger_grid, OBJ_TRIGGER); + configureFormLayout(trigger_grid, ObjTrigger); connect(deferrable_chk, SIGNAL(toggled(bool)), deferral_type_cmb, SLOT(setEnabled(bool))); connect(columns_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addColumn(int))); @@ -97,7 +97,7 @@ void TriggerWidget::selectUpdateEvent(void) /* Disable the columns tab when the trigger belongs to a view. pgModeler does not support triggers reference view columns (yet) */ arg_cols_tbw->widget(1)->setEnabled(update_chk->isChecked() && - table->getObjectType()==OBJ_TABLE); + table->getObjectType()==ObjTable); } void TriggerWidget::setConstraintTrigger(bool value) @@ -173,14 +173,14 @@ void TriggerWidget::updateColumnsCombo(void) try { - if(this->table->getObjectType()==OBJ_TABLE) + if(this->table->getObjectType()==ObjTable) { - col_count=table->getObjectCount(OBJ_COLUMN); + col_count=table->getObjectCount(ObjColumn); column_cmb->clear(); for(i=0; i < col_count; i++) { - column=dynamic_cast(table->getObject(i, OBJ_COLUMN)); + column=dynamic_cast(table->getObject(i, ObjColumn)); if(columns_tab->getRowIndex(QVariant::fromValue(column)) < 0) { diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index 08a03f3a51..a4cd83f46f 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -18,7 +18,7 @@ #include "typewidget.h" -TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TYPE) +TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) { try { @@ -28,7 +28,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TYPE) unsigned i,i1; Ui_TypeWidget::setupUi(this); - configureFormLayout(type_grid, OBJ_TYPE); + configureFormLayout(type_grid, ObjType); like_type=new PgSQLTypeWidget(this, trUtf8("Like Type")); element_type=new PgSQLTypeWidget(this, trUtf8("Element Type")); @@ -43,7 +43,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TYPE) for(i=Type::INPUT_FUNC; i <= Type::ANALYZE_FUNC; i++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjFunction, true, this); grid->addWidget(functions_sel[i],i,1,1,1); } @@ -64,7 +64,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TYPE) grid=dynamic_cast(attributes_gb->layout()); - attrib_collation_sel=new ObjectSelectorWidget(OBJ_COLLATION, true, this); + attrib_collation_sel=new ObjectSelectorWidget(ObjCollation, true, this); grid->addWidget(attrib_collation_sel, 1,1,1,2); attrib_type_wgt=new PgSQLTypeWidget(this); @@ -81,13 +81,13 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_TYPE) frame->setParent(base_attribs_twg->widget(0)); grid=dynamic_cast(range_attribs_gb->layout()); - opclass_sel=new ObjectSelectorWidget(OBJ_OPCLASS, true, this); + opclass_sel=new ObjectSelectorWidget(ObjOpClass, true, this); grid->addWidget(opclass_sel,0,1,1,1); for(i1=1, i=Type::CANONICAL_FUNC; i <= Type::SUBTYPE_DIFF_FUNC; i++,i1++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(OBJ_FUNCTION, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjFunction, true, this); grid->addWidget(functions_sel[i],i1,1,1,1); } diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 0bbe0740e6..784179524b 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -23,12 +23,12 @@ #include "baseform.h" #include "referencewidget.h" -ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) +ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjView) { try { ObjectsTableWidget *tab=nullptr; - ObjectType types[]={ OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX }; + ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex }; QGridLayout *grid=nullptr; QVBoxLayout *vbox=nullptr; @@ -52,7 +52,7 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) vbox->setContentsMargins(4,4,4,4); vbox->addWidget(cte_expression_txt); - tag_sel=new ObjectSelectorWidget(OBJ_TAG, false, this); + tag_sel=new ObjectSelectorWidget(ObjTag, false, this); dynamic_cast(options_gb->layout())->addWidget(tag_sel, 0, 1, 1, 4); references_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::UPDATE_BUTTON, true, this); @@ -89,29 +89,29 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, OBJ_VIEW) connect(tab, SIGNAL(s_rowDuplicated(int,int)), this, SLOT(duplicateObject(int,int))); } - objects_tab_map[OBJ_TRIGGER]->setColumnCount(4); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[OBJ_TRIGGER]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Refer. Table"), 1); - objects_tab_map[OBJ_TRIGGER]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("table")),1); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Firing"), 2); - objects_tab_map[OBJ_TRIGGER]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("trigger")),2); - objects_tab_map[OBJ_TRIGGER]->setHeaderLabel(trUtf8("Events"), 3); - - objects_tab_map[OBJ_INDEX]->setColumnCount(2); - objects_tab_map[OBJ_INDEX]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[OBJ_INDEX]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); - objects_tab_map[OBJ_INDEX]->setHeaderLabel(trUtf8("Indexing"), 1); - - objects_tab_map[OBJ_RULE]->setColumnCount(3); - objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[OBJ_RULE]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); - objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Execution"), 1); - objects_tab_map[OBJ_RULE]->setHeaderLabel(trUtf8("Event"), 2); + objects_tab_map[ObjTrigger]->setColumnCount(4); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("table")),1); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("trigger")),2); + objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); + + objects_tab_map[ObjIndex]->setColumnCount(2); + objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); + + objects_tab_map[ObjRule]->setColumnCount(3); + objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); + objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Event"), 2); tablespace_sel->setEnabled(false); tablespace_lbl->setEnabled(false); - configureFormLayout(view_grid, OBJ_VIEW); + configureFormLayout(view_grid, ObjView); fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion93)].push_back(recursive_rb); fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion93)].push_back(materialized_rb); @@ -169,7 +169,7 @@ int ViewWidget::openEditingForm(TableObject *object) void ViewWidget::handleObject(void) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; TableObject *object=nullptr; ObjectsTableWidget *obj_table=nullptr; @@ -181,9 +181,9 @@ void ViewWidget::handleObject(void) if(obj_table->getSelectedRow()>=0) object=reinterpret_cast(obj_table->getRowData(obj_table->getSelectedRow()).value()); - if(obj_type==OBJ_TRIGGER) + if(obj_type==ObjTrigger) openEditingForm(object); - else if(obj_type==OBJ_INDEX) + else if(obj_type==ObjIndex) openEditingForm(object); else openEditingForm(object); @@ -199,7 +199,7 @@ void ViewWidget::handleObject(void) void ViewWidget::duplicateObject(int curr_row, int new_row) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; BaseObject *object=nullptr, *dup_object=nullptr; ObjectsTableWidget *obj_table=nullptr; View *view = dynamic_cast(this->object); @@ -313,7 +313,7 @@ void ViewWidget::removeObject(int row) ObjectType ViewWidget::getObjectType(QObject *sender) { - ObjectType obj_type=BASE_OBJECT; + ObjectType obj_type=ObjBaseObject; if(sender) { @@ -322,7 +322,7 @@ ObjectType ViewWidget::getObjectType(QObject *sender) itr=objects_tab_map.begin(); itr_end=objects_tab_map.end(); - while(itr!=itr_end && obj_type==BASE_OBJECT) + while(itr!=itr_end && obj_type==ObjBaseObject) { if(itr->second==sender) obj_type=itr->first; @@ -352,7 +352,7 @@ void ViewWidget::showObjectData(TableObject *object, int row) //Column 0: Object name tab->setCellText(object->getName(),row,0); - if(obj_type==OBJ_TRIGGER) + if(obj_type==ObjTrigger) { trigger=dynamic_cast(object); @@ -374,7 +374,7 @@ void ViewWidget::showObjectData(TableObject *object, int row) str_aux.remove(str_aux.size()-2, 2); tab->setCellText(str_aux ,row,3); } - else if(obj_type==OBJ_RULE) + else if(obj_type==ObjRule) { rule=dynamic_cast(object); @@ -583,7 +583,7 @@ void ViewWidget::updateCodePreview(void) //Make a copy of each view objects (rule/trigger) to the auxiliary view for(i=0; i < count; i++) { - if(itr->first==OBJ_TRIGGER) + if(itr->first==ObjTrigger) { tab_obj=new Trigger; (*dynamic_cast(tab_obj))= @@ -677,9 +677,9 @@ void ViewWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch references_tab->blockSignals(false); references_tab->clearSelection(); - listObjects(OBJ_TRIGGER); - listObjects(OBJ_RULE); - listObjects(OBJ_INDEX); + listObjects(ObjTrigger); + listObjects(ObjRule); + listObjects(ObjIndex); } void ViewWidget::applyConfiguration(void) @@ -687,7 +687,7 @@ void ViewWidget::applyConfiguration(void) try { View *view=nullptr; - ObjectType types[]={ OBJ_TRIGGER, OBJ_RULE, OBJ_INDEX }; + ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex }; unsigned expr_type[]={ Reference::SQL_REFER_SELECT, Reference::SQL_REFER_FROM, Reference::SQL_REFER_WHERE, diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index c4cf12dcaa..3024ca2f2d 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -627,20 +627,20 @@ void PgModelerCLI::handleObjectAddition(BaseObject *object) switch(obj_type) { - case OBJ_TABLE: + case ObjTable: item=new TableView(dynamic_cast
(graph_obj)); break; - case OBJ_VIEW: + case ObjView: item=new GraphicalView(dynamic_cast(graph_obj)); break; - case OBJ_RELATIONSHIP: - case BASE_RELATIONSHIP: + case ObjRelationship: + case ObjBaseRelationship: item=new RelationshipView(dynamic_cast(graph_obj)); break; break; - case OBJ_SCHEMA: + case ObjSchema: item=new SchemaView(dynamic_cast(graph_obj)); break; break; @@ -651,7 +651,7 @@ void PgModelerCLI::handleObjectAddition(BaseObject *object) scene->addItem(item); - if(obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) + if(obj_type==ObjTable || obj_type==ObjView) dynamic_cast(graph_obj->getSchema())->setModified(true); } } @@ -667,7 +667,7 @@ void PgModelerCLI::handleObjectRemoval(BaseObject *object) //Updates the parent schema if the removed object were a table or view if(graph_obj->getSchema() && - (graph_obj->getObjectType()==OBJ_TABLE || graph_obj->getObjectType()==OBJ_VIEW)) + (graph_obj->getObjectType()==ObjTable || graph_obj->getObjectType()==ObjView)) dynamic_cast(graph_obj->getSchema())->setModified(true); } } @@ -722,12 +722,12 @@ void PgModelerCLI::extractObjectXML(void) /* Special case for empty tags like , they will be converted to in order to be correctly extracted further. Currently only language has this behaviour, so additional object may be added in the future. */ - if(lin.contains(QString("<%1").arg(BaseObject::getSchemaName(OBJ_LANGUAGE)))) + if(lin.contains(QString("<%1").arg(BaseObject::getSchemaName(ObjLanguage)))) { lin=lin.simplified(); if(lin.contains(QString("/>"))) - lin.replace(QString("/>"), QString(">").arg(BaseObject::getSchemaName(OBJ_LANGUAGE))); + lin.replace(QString("/>"), QString(">").arg(BaseObject::getSchemaName(ObjLanguage))); } /* Special case for function signatures. In previous releases, the function's signature was wrongly including OUT parameters and according to docs they are not part of the signature, so it is needed @@ -820,8 +820,8 @@ void PgModelerCLI::recreateObjects(void) QStringList fail_objs, constr, list; QString xml_def, aux_def, start_tag="<%1", end_tag="", aux_tag; BaseObject *object=nullptr; - ObjectType obj_type=BASE_OBJECT; - vector types={ OBJ_INDEX, OBJ_TRIGGER, OBJ_RULE }; + ObjectType obj_type=ObjBaseObject; + vector types={ ObjIndex, ObjTrigger, ObjRule }; attribs_map attribs; bool use_fail_obj=false; unsigned tries=0, max_tries=parsed_opts[FIX_TRIES].toUInt(); @@ -858,11 +858,11 @@ void PgModelerCLI::recreateObjects(void) xmlparser->getElementAttributes(attribs); - if(obj_type==OBJ_DATABASE) + if(obj_type==ObjDatabase) model->configureDatabase(attribs); else { - if(obj_type==OBJ_TABLE) + if(obj_type==ObjTable) { //Before create a table extract it's foreign keys list=extractForeignKeys(xml_def); @@ -878,14 +878,14 @@ void PgModelerCLI::recreateObjects(void) } //Discarding fk relationships - if(obj_type!=OBJ_RELATIONSHIP || - (obj_type==OBJ_RELATIONSHIP && !xml_def.contains(QString("\"%1\"").arg(ParsersAttributes::RELATIONSHIP_FK)))) + if(obj_type!=ObjRelationship || + (obj_type==ObjRelationship && !xml_def.contains(QString("\"%1\"").arg(ParsersAttributes::RELATIONSHIP_FK)))) { object=model->createObject(obj_type); if(object) { - if(!dynamic_cast(object) && obj_type!=OBJ_RELATIONSHIP && obj_type!=BASE_RELATIONSHIP) + if(!dynamic_cast(object) && obj_type!=ObjRelationship && obj_type!=ObjBaseRelationship) model->addObject(object); } @@ -895,7 +895,7 @@ void PgModelerCLI::recreateObjects(void) /* Additional step to extract indexes/triggers/rules from within tables/views and putting their xml on the list of object to be created */ - if((obj_type==OBJ_TABLE || obj_type==OBJ_VIEW) && + if((obj_type==ObjTable || obj_type==ObjView) && xml_def.contains(QRegExp("(<)(index|trigger|rule)"))) { for(ObjectType type : types) @@ -933,7 +933,7 @@ void PgModelerCLI::recreateObjects(void) } catch(Exception &e) { - if(obj_type!=OBJ_DATABASE) + if(obj_type!=ObjDatabase) fail_objs.push_back(xml_def); else throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); @@ -972,14 +972,14 @@ void PgModelerCLI::recreateObjects(void) void PgModelerCLI::fixObjectAttributes(QString &obj_xml) { //Placing objects , , outside of
- if(!obj_xml.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_TABLESPACE))) && - obj_xml.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_TABLE)))) + if(!obj_xml.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(ObjTablespace))) && + obj_xml.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(ObjTable)))) { int start_idx=-1, end_idx=-1, len=0; - ObjectType obj_types[3]={ OBJ_RULE, OBJ_TRIGGER, OBJ_INDEX }; + ObjectType obj_types[3]={ ObjRule, ObjTrigger, ObjIndex }; QString curr_tag, curr_end_tag, def, tab_name, sch_name, name_attr=QString("name=\""), - sch_name_attr=TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_SCHEMA)) + QString(" ") + name_attr; + sch_name_attr=TAG_EXPR.arg(BaseObject::getSchemaName(ObjSchema)) + QString(" ") + name_attr; //Extracting the table's name start_idx=obj_xml.indexOf(name_attr); @@ -1008,7 +1008,7 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) obj_xml.remove(start_idx, len); //If the object is a rule include the table attribute - if(def.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_RULE)))) + if(def.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(ObjRule)))) { start_idx=def.indexOf('>'); def.replace(start_idx, 1, QString(" ") + tab_name + QString(">")); @@ -1028,7 +1028,7 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("recheck")))); //Remove values greater-op, less-op, sort-op or sort2-op from ref-type attribute from tags. - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_OPERATOR)))) + if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjOperator)))) { obj_xml.remove(QString("greater-op")); obj_xml.remove(QString("less-op")); @@ -1037,11 +1037,11 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) } //Replacing attribute owner by onwer-col for sequences - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_SEQUENCE)))) + if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjSequence)))) obj_xml.replace(ParsersAttributes::OWNER, ParsersAttributes::OWNER_COLUMN); //Remove sysid attribute from tags. - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_ROLE)))) + if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjRole)))) obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("sysid")))); //Replace tag by on tags. @@ -1051,7 +1051,7 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) obj_xml.replace(END_TAG_EXPR.arg(ParsersAttributes::PARAMETER), END_TAG_EXPR.arg(ParsersAttributes::TYPE_ATTRIBUTE)); } - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_RELATIONSHIP)))) + if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjRelationship)))) { //Remove auto-sufix, src-sufix, dst-sufix, col-indexes, constr-indexes, attrib-indexes from tags. obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("auto-sufix")))); @@ -1065,25 +1065,25 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) } //Renaming the tag to on indexes - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_INDEX)))) + if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjIndex)))) { obj_xml.replace(TAG_EXPR.arg(ParsersAttributes::CONDITION), TAG_EXPR.arg(ParsersAttributes::PREDICATE)); obj_xml.replace(END_TAG_EXPR.arg(ParsersAttributes::CONDITION), END_TAG_EXPR.arg(ParsersAttributes::PREDICATE)); } //Renaming the attribute default to default-value on domain - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_DOMAIN)))) + if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjDomain)))) obj_xml.replace(ParsersAttributes::DEFAULT, ParsersAttributes::DEFAULT_VALUE); //Renaming the tag to if(obj_xml.contains(TAG_EXPR.arg(QString("grant")))) { - obj_xml.replace(TAG_EXPR.arg(QString("grant")), TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_PERMISSION))); - obj_xml.replace(END_TAG_EXPR.arg(QString("grant")), END_TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_PERMISSION))); + obj_xml.replace(TAG_EXPR.arg(QString("grant")), TAG_EXPR.arg(BaseObject::getSchemaName(ObjPermission))); + obj_xml.replace(END_TAG_EXPR.arg(QString("grant")), END_TAG_EXPR.arg(BaseObject::getSchemaName(ObjPermission))); } //Replace the constraint attribute and tag expression by constraint tag in . - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_DOMAIN))) && + if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjDomain))) && obj_xml.contains(TAG_EXPR.arg(ParsersAttributes::EXPRESSION))) { int start_idx=-1, end_idx=-1; @@ -1112,13 +1112,13 @@ void PgModelerCLI::fixOpClassesFamiliesReferences(QString &obj_xml) { ObjectType ref_obj_type; - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_INDEX))) || + if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjIndex))) || obj_xml.contains(QRegExp(QString("(%1)(.)+(type=)(\")(%2)(\")") - .arg(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_CONSTRAINT))) + .arg(TAG_EXPR.arg(BaseObject::getSchemaName(ObjConstraint))) .arg(ParsersAttributes::EX_CONSTR)))) - ref_obj_type=OBJ_OPCLASS; - else if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(OBJ_OPCLASS)))) - ref_obj_type=OBJ_OPFAMILY; + ref_obj_type=ObjOpClass; + else if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjOpClass)))) + ref_obj_type=ObjOpFamily; else return; @@ -1278,8 +1278,8 @@ void PgModelerCLI::importDatabase(DatabaseModel *model, Connection conn) catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); - db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::PARAM_DB_NAME), OBJ_DATABASE); - obj_oids[OBJ_DATABASE].push_back(db_oid.toUInt()); + db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::PARAM_DB_NAME), ObjDatabase); + obj_oids[ObjDatabase].push_back(db_oid.toUInt()); catalog.closeConnection(); diff --git a/main-cli/src/pgmodelercli.h b/main-cli/src/pgmodelercli.h index ab240d1c4a..0b4ebb577e 100644 --- a/main-cli/src/pgmodelercli.h +++ b/main-cli/src/pgmodelercli.h @@ -218,7 +218,7 @@ class PgModelerCLI: public QApplication { private slots: void handleObjectAddition(BaseObject *); - void updateProgress(int progress, QString msg, ObjectType = BASE_OBJECT); + void updateProgress(int progress, QString msg, ObjectType = ObjBaseObject); void printIgnoredError(QString err_cod, QString err_msg, QString cmd); void handleObjectRemoval(BaseObject *object); }; diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index 479b7aebcb..3a5650e2b6 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -81,7 +81,7 @@ void Xml2ObjectWidget::generateObject(void) object=model->createObject(obj_type); if(object && !dynamic_cast(object) && - obj_type!=OBJ_RELATIONSHIP && obj_type!=BASE_RELATIONSHIP) + obj_type!=ObjRelationship && obj_type!=ObjBaseRelationship) { model->addObject(object); op_list->registerObject(object, Operation::OBJECT_CREATED, -1, model); From dd38e672cbbeb78732ec794c3b379666e6aa5100 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 17:28:03 -0300 Subject: [PATCH 160/425] Refactored static const attributes of BaseObject --- libpgmodeler/src/baseobject.cpp | 14 +++++++------- libpgmodeler/src/baseobject.h | 12 ++++++------ libpgmodeler/src/baserelationship.cpp | 4 ++-- libpgmodeler/src/databasemodel.cpp | 6 +++--- libpgmodeler/src/operator.cpp | 2 +- libpgmodeler/src/pgmodelerns.h | 2 +- libpgmodeler/src/reference.cpp | 2 +- libpgmodeler/src/relationship.cpp | 12 ++++++------ libpgmodeler/src/table.cpp | 4 ++-- libpgmodeler/src/tag.cpp | 2 +- libpgmodeler/src/type.cpp | 2 +- libpgmodeler/src/view.cpp | 4 ++-- libpgmodeler_ui/src/modelsdiffhelper.cpp | 4 ++-- 13 files changed, 35 insertions(+), 35 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 8d4cc51ce1..7f8022d92b 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -25,7 +25,7 @@ const QByteArray BaseObject::special_chars = QByteArray("'_-.@ $:()/<>+*\\=~!#%^ /* CAUTION: If both amount and order of the enumerations are modified then the order and amount of the elements of this vector must also be modified */ -QString BaseObject::objs_schemas[OBJECT_TYPE_COUNT]={ +const QString BaseObject::objs_schemas[BaseObject::ObjectTypeCount]={ "column", "constraint", "function", "trigger", "index", "rule", "table", "view", "domain", "schema", "aggregate", "operator", @@ -37,7 +37,7 @@ QString BaseObject::objs_schemas[OBJECT_TYPE_COUNT]={ "tag", "genericsql", "relationship" }; -QString BaseObject::obj_type_names[OBJECT_TYPE_COUNT]={ +const QString BaseObject::obj_type_names[BaseObject::ObjectTypeCount]={ QT_TR_NOOP("Column"), QT_TR_NOOP("Constraint"), QT_TR_NOOP("Function"), QT_TR_NOOP("Trigger"), QT_TR_NOOP("Index"), QT_TR_NOOP("Rule"), QT_TR_NOOP("Table"), QT_TR_NOOP("View"), QT_TR_NOOP("Domain"), @@ -51,7 +51,7 @@ QString BaseObject::obj_type_names[OBJECT_TYPE_COUNT]={ QT_TR_NOOP("Tag"), QT_TR_NOOP("Generic SQL"), QT_TR_NOOP("Basic Relationship") }; -QString BaseObject::objs_sql[OBJECT_TYPE_COUNT]={ +const QString BaseObject::objs_sql[BaseObject::ObjectTypeCount]={ QString("COLUMN"), QString("CONSTRAINT"), QString("FUNCTION"), QString("TRIGGER"), QString("INDEX"), QString("RULE"), QString("TABLE"), QString("VIEW"), QString("DOMAIN"), QString("SCHEMA"), QString("AGGREGATE"), @@ -123,7 +123,7 @@ ObjectType BaseObject::getObjectType(const QString &type_name) { ObjectType obj_type=ObjBaseObject; - for(int i=0; i < BaseObject::OBJECT_TYPE_COUNT; i++) + for(int i=0; i < BaseObject::ObjectTypeCount; i++) { if(objs_schemas[i]==type_name) { @@ -240,7 +240,7 @@ bool BaseObject::isValidName(const QString &name) by PostgreSQL (currently 63 bytes) the name is invalid. In this case the starting and ending quotes are discarded from the name in order to validate the length. */ - if(name.isEmpty() || aux_name.size() > OBJECT_NAME_MAX_LENGTH) + if(name.isEmpty() || aux_name.size() > ObjectNameMaxLength) return(false); else { @@ -350,7 +350,7 @@ void BaseObject::setName(const QString &name) if(aux_name.isEmpty()) throw Exception(AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the name is quoted we add 2 bytes to the maximum in order to check if it exceeds the limit - else if(aux_name.size() > (OBJECT_NAME_MAX_LENGTH + (is_quoted ? 2 : 0))) + else if(aux_name.size() > (ObjectNameMaxLength + (is_quoted ? 2 : 0))) throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -363,7 +363,7 @@ void BaseObject::setName(const QString &name) void BaseObject::setAlias(const QString &alias) { - if(alias.size() > OBJECT_NAME_MAX_LENGTH) + if(alias.size() > ObjectNameMaxLength) throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->alias = alias; diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index ac0c32b84a..34bc26c2cc 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -105,7 +105,7 @@ class BaseObject { unsigned object_id; //! \brief Objects type count declared on enum ObjectType - static constexpr int OBJECT_TYPE_COUNT=37; + static constexpr int ObjectTypeCount=37; /*! \brief Indicates whether the object is protected or not. A protected object indicates that it can not suffer changes in position @@ -136,15 +136,15 @@ class BaseObject { /*! \brief This map stores the name of each object type associated to a schema file that generates the object's code definition */ - static QString objs_schemas[OBJECT_TYPE_COUNT]; + static const QString objs_schemas[ObjectTypeCount]; /*! \brief This map associates the object type to a keyword on SQL language that represents the object */ - static QString objs_sql[OBJECT_TYPE_COUNT]; + static const QString objs_sql[ObjectTypeCount]; /*! \brief Stores the name of the type of objects to be used in error messages formatting and others operations that envolves object type name */ - static QString obj_type_names[OBJECT_TYPE_COUNT]; + static const QString obj_type_names[ObjectTypeCount]; /*! \brief Role that is owner of the object. Some objects cannot be associated to a role so if one is assigned to the object an error will be raised */ @@ -232,12 +232,12 @@ class BaseObject { public: //! \brief Maximum number of characters that an object name on PostgreSQL can have - static constexpr int OBJECT_NAME_MAX_LENGTH=63; + static constexpr int ObjectNameMaxLength=63; /*! \brief The default number of objects supposed to be stored in objects list. * This values is just a reference (hint) and is used to preallocate (reserve) space on vectors which handle objects * to avoid excessive allocation/deallocation by resizing the vectors due to insert operation */ - static constexpr unsigned DEF_MAX_OBJ_COUNT=20; + static constexpr unsigned DefMaxObjectCount=20; BaseObject(void); BaseObject(bool system_obj); diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 54d4d8cb2e..ae2fd657b3 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -62,8 +62,8 @@ BaseRelationship::BaseRelationship(unsigned rel_type, BaseTable *src_tab, BaseTa str_aux=QApplication::translate("BaseRelationship","rel_%1_%2","") .arg(src_tab->getName()).arg(dst_tab->getName()); - if(str_aux.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) - str_aux.resize(BaseObject::OBJECT_NAME_MAX_LENGTH); + if(str_aux.size() > BaseObject::ObjectNameMaxLength) + str_aux.resize(BaseObject::ObjectNameMaxLength); setName(str_aux); } diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 46b24775f0..4dd1262b0f 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3385,9 +3385,9 @@ void DatabaseModel::setLoadingModel(bool value) void DatabaseModel::setObjectListsCapacity(unsigned capacity) { - if(capacity < BaseObject::DEF_MAX_OBJ_COUNT || - capacity > (BaseObject::DEF_MAX_OBJ_COUNT * 1000)) - capacity = BaseObject::DEF_MAX_OBJ_COUNT; + if(capacity < BaseObject::DefMaxObjectCount || + capacity > (BaseObject::DefMaxObjectCount * 1000)) + capacity = BaseObject::DefMaxObjectCount; unsigned half_cap = capacity/2, one_fourth_cap = capacity/4; diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 281b28b76b..e3e69726a2 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -55,7 +55,7 @@ bool Operator::isValidName(const QString &name) bool valid=true; //Checks if the size of the name is valid - valid=(name.size() <= static_cast(OBJECT_NAME_MAX_LENGTH)); + valid=(name.size() <= static_cast(ObjectNameMaxLength)); /* Checking if the name is valid according the conditions: 1) The name has only the chars defined in 'valid_chars' */ diff --git a/libpgmodeler/src/pgmodelerns.h b/libpgmodeler/src/pgmodelerns.h index d8a9c4bf6f..5b5c1e7156 100644 --- a/libpgmodeler/src/pgmodelerns.h +++ b/libpgmodeler/src/pgmodelerns.h @@ -79,7 +79,7 @@ namespace PgModelerNS { len=obj_name.size() + id.size(); //If the name length exceeds the maximum size - if(len > BaseObject::OBJECT_NAME_MAX_LENGTH) + if(len > BaseObject::ObjectNameMaxLength) { //Remove the last chars in the count of 3 + length of id obj_name.chop(id.size() + 3); diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index da232a4526..8b74d6429e 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -108,7 +108,7 @@ unsigned Reference::getReferenceType(void) void Reference::setReferenceAlias(const QString &alias) { - if(alias.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) + if(alias.size() > BaseObject::ObjectNameMaxLength) throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); ref_alias = alias; diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 835cce1dca..29523e2187 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -142,16 +142,16 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, str_aux=str_aux.arg(this->getReceiverTable()->getName()) .arg(this->getReferenceTable()->getName()); - if(str_aux.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) - str_aux.resize(BaseObject::OBJECT_NAME_MAX_LENGTH); + if(str_aux.size() > BaseObject::ObjectNameMaxLength) + str_aux.resize(BaseObject::ObjectNameMaxLength); setName(str_aux); if(rel_type==RELATIONSHIP_NN) { tab_name_relnn=this->obj_name; - if(tab_name_relnn.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) - tab_name_relnn.resize(BaseObject::OBJECT_NAME_MAX_LENGTH); + if(tab_name_relnn.size() > BaseObject::ObjectNameMaxLength) + tab_name_relnn.resize(BaseObject::ObjectNameMaxLength); setNamePattern(PK_PATTERN, GEN_TAB_TOKEN + SUFFIX_SEPARATOR + QString("pk")); setNamePattern(SRC_FK_PATTERN, SRC_TAB_TOKEN + SUFFIX_SEPARATOR + QString("fk")); @@ -243,8 +243,8 @@ QString Relationship::generateObjectName(unsigned pat_id, Column *id_col, bool u name.replace(SRC_COL_TOKEN, aux_name); - if(name.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) - name.remove(BaseObject::OBJECT_NAME_MAX_LENGTH, name.size()); + if(name.size() > BaseObject::ObjectNameMaxLength) + name.remove(BaseObject::ObjectNameMaxLength, name.size()); return(name); } diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 547f656af4..f02e6bd1e0 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -2041,8 +2041,8 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi void Table::setObjectListsCapacity(unsigned capacity) { - if(capacity < DEF_MAX_OBJ_COUNT || capacity > DEF_MAX_OBJ_COUNT * 10) - capacity = DEF_MAX_OBJ_COUNT; + if(capacity < DefMaxObjectCount || capacity > DefMaxObjectCount * 10) + capacity = DefMaxObjectCount; columns.reserve(capacity); constraints.reserve(capacity/2); diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 7effc70d3a..20e84660ca 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -43,7 +43,7 @@ void Tag::setName(const QString &name) { if(name.isEmpty()) throw Exception(AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(name.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) + else if(name.size() > BaseObject::ObjectNameMaxLength) throw Exception(AsgLongNameObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->obj_name=name; diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index ddbe90d3bb..bc0ad67a6d 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -150,7 +150,7 @@ void Type::addEnumeration(const QString &enum_name) if(enum_name.isEmpty()) throw Exception(InsInvalidEnumerationItem,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the enumeration name is invalid (exceeds the maximum length) - else if(enum_name.size() > BaseObject::OBJECT_NAME_MAX_LENGTH) + else if(enum_name.size() > BaseObject::ObjectNameMaxLength) throw Exception(Exception::getErrorMessage(AsgEnumLongName).arg(enum_name).arg(this->getName(true)), AsgEnumLongName,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(enum_name.contains(QChar(','))) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 618bf4b9d7..ae762a5160 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -610,8 +610,8 @@ void View::setSQLObjectAttribute(void) void View::setObjectListsCapacity(unsigned capacity) { - if(capacity < DEF_MAX_OBJ_COUNT || capacity > DEF_MAX_OBJ_COUNT * 10) - capacity = DEF_MAX_OBJ_COUNT; + if(capacity < DefMaxObjectCount || capacity > DefMaxObjectCount * 10) + capacity = DefMaxObjectCount; references.reserve(capacity); indexes.reserve(capacity/2); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index d50b40a265..f5025951d4 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -499,8 +499,8 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, BaseTable *tab=col->getParentTable(); QString seq_name=QString("%1_%2_seq").arg(tab->getName()).arg(col->getName()); - if(seq_name.length() > BaseObject::OBJECT_NAME_MAX_LENGTH) - seq_name.chop(seq_name.length() - BaseObject::OBJECT_NAME_MAX_LENGTH); + if(seq_name.length() > BaseObject::ObjectNameMaxLength) + seq_name.chop(seq_name.length() - BaseObject::ObjectNameMaxLength); seq->setName(seq_name); seq->setOwner(tab->getOwner()); From 356625fbc4bee2d307b9fa051cd8a69a558cc910 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 18:35:05 -0300 Subject: [PATCH 161/425] Renamed the enum ErrorType to ErrorCode --- libparsers/src/schemaparser.cpp | 90 +++++++++++++++--------------- libparsers/src/xmlparser.cpp | 38 ++++++------- libpgmodeler/src/column.cpp | 10 ++-- libpgmodeler/src/constraint.cpp | 8 +-- libpgmodeler/src/databasemodel.cpp | 2 +- libpgmodeler/src/index.cpp | 4 +- libpgmodeler/src/pgsqltypes.cpp | 4 +- libpgmodeler/src/relationship.cpp | 2 +- libpgmodeler/src/trigger.cpp | 12 ++-- libutils/src/exception.cpp | 24 ++++---- libutils/src/exception.h | 22 ++++---- 11 files changed, 108 insertions(+), 108 deletions(-) diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 97608f9517..0ed86e483e 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -75,7 +75,7 @@ void SchemaParser::setPgSQLVersion(const QString &pgsql_ver) default_ver = QString(PgSQLVersions::DefaulVersion).remove('.').toUInt(); if(curr_ver != 0 && (curr_ver < version90)) - throw Exception(Exception::getErrorMessage(ErrorType::InvPostgreSQLVersion) + throw Exception(Exception::getErrorMessage(ErrorCode::InvPostgreSQLVersion) .arg(pgsql_ver) .arg(PgSQLVersions::PgSQLVersion90) .arg(PgSQLVersions::DefaulVersion), @@ -187,8 +187,8 @@ void SchemaParser::loadFile(const QString &filename) input.open(QFile::ReadOnly); if(!input.isOpen()) - throw Exception(Exception::getErrorMessage(ErrorType::FileDirectoryNotAccessed).arg(filename), - ErrorType::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(filename), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf=input.readAll(); input.close(); @@ -245,15 +245,15 @@ QString SchemaParser::getAttribute(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!AttribRegExp.exactMatch(atrib)) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidAttribute)) .arg(atrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(atrib); @@ -330,9 +330,9 @@ QString SchemaParser::getPureText(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(text); @@ -369,9 +369,9 @@ QString SchemaParser::getConditional(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg(line + comment_count + 1).arg(column+1), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(conditional); @@ -406,9 +406,9 @@ QString SchemaParser::getMetaCharacter(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg(line + comment_count + 1).arg(column+1), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(meta); @@ -485,15 +485,15 @@ bool SchemaParser::evaluateComparisonExpr(void) error=true; else if(!opers.contains(QString(oper).remove('f').remove('i'))) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidOperatorInExpression)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidOperatorInExpression)) .arg(oper).arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidOperatorInExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidOperatorInExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(attributes.count(attrib)==0 && !ignore_unk_atribs) { - throw Exception(Exception::getErrorMessage(ErrorType::UnkownAttribute) + throw Exception(Exception::getErrorMessage(ErrorCode::UnkownAttribute) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -554,9 +554,9 @@ bool SchemaParser::evaluateComparisonExpr(void) } if(error) - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(expr_is_true); } @@ -605,9 +605,9 @@ void SchemaParser::defineAttribute(void) if(attributes.count(attrib)==0 && !ignore_unk_atribs) { - throw Exception(Exception::getErrorMessage(ErrorType::UnkownAttribute) + throw Exception(Exception::getErrorMessage(ErrorCode::UnkownAttribute) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } value+=attributes[attrib]; @@ -644,9 +644,9 @@ void SchemaParser::defineAttribute(void) //Checking if the attribute has a valid name if(!AttribRegExp.exactMatch(attrib)) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidAttribute)) .arg(attrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } /* Creates the attribute in the attribute map of the schema, making the attribute @@ -655,9 +655,9 @@ void SchemaParser::defineAttribute(void) attributes[attrib]=value; } else - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void SchemaParser::unsetAttribute(void) @@ -684,24 +684,24 @@ void SchemaParser::unsetAttribute(void) if(attributes.count(attrib)==0 && !ignore_unk_atribs) { - throw Exception(Exception::getErrorMessage(ErrorType::UnkownAttribute) + throw Exception(Exception::getErrorMessage(ErrorCode::UnkownAttribute) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!AttribRegExp.exactMatch(attrib)) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidAttribute)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidAttribute)) .arg(attrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } attributes[attrib]=QString(); break; default: - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } } @@ -778,9 +778,9 @@ bool SchemaParser::evaluateExpression(void) //Raises an error if the attribute does is unknown if(attributes.count(attrib)==0 && !ignore_unk_atribs) { - throw Exception(Exception::getErrorMessage(ErrorType::UnkownAttribute) + throw Exception(Exception::getErrorMessage(ErrorCode::UnkownAttribute) .arg(attrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Error 1: A conditional token other than %or %not %and if found on conditional expression @@ -844,9 +844,9 @@ bool SchemaParser::evaluateExpression(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(expr_is_true); @@ -871,9 +871,9 @@ char SchemaParser::translateMetaCharacter(const QString &meta) if(metas.count(meta)==0) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidMetacharacter)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidMetacharacter)) .arg(meta).arg(filename).arg(line + comment_count +1).arg(column+1), - ErrorType::InvalidMetacharacter,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidMetacharacter,__PRETTY_FUNCTION__,__FILE__,__LINE__); } return(metas.at(meta)); @@ -1062,9 +1062,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) //Checks whether the metacharacter is part of the 'if' expression (this is an error) if(if_level>=0 && vet_tk_if[if_level] && !vet_tk_then[if_level]) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidSyntax)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) .arg(filename).arg(line + comment_count +1).arg(column+1), - ErrorType::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -1106,9 +1106,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) { if(!ignore_unk_atribs) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::UnkownAttribute)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::UnkownAttribute)) .arg(atrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), - ErrorType::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else attributes[atrib]=QString(); @@ -1143,9 +1143,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) raises an exception */ if(attributes[atrib].isEmpty() && !ignore_empty_atribs) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::UndefinedAttributeValue)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::UndefinedAttributeValue)) .arg(atrib).arg(filename).arg(line + comment_count +1).arg(column+1), - ErrorType::UndefinedAttributeValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::UndefinedAttributeValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); } /* If the parser is not in an if / else, concatenates the value of the attribute @@ -1166,9 +1166,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) cond!=TokenAnd && cond!=TokenSet && cond!=TokenUnset) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::InvalidInstruction)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidInstruction)) .arg(cond).arg(filename).arg(line + comment_count +1).arg(column+1), - ErrorType::InvalidInstruction,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidInstruction,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(cond==TokenSet || cond==TokenUnset) { diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index 7e673a82cf..a4326cf386 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -75,8 +75,8 @@ void XMLParser::loadXMLFile(const QString &filename) //Case the file opening was not sucessful if(!input.isOpen()) { - throw Exception(QString(Exception::getErrorMessage(ErrorType::FileDirectoryNotAccessed)).arg(filename), - ErrorType::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(QString(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed)).arg(filename), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); } buffer=input.readAll(); @@ -99,7 +99,7 @@ void XMLParser::loadXMLBuffer(const QString &xml_buf) int pos1=-1, pos2=-1, tam=0; if(xml_buf.isEmpty()) - throw Exception(ErrorType::AsgEmptyXMLBuffer,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEmptyXMLBuffer,__PRETTY_FUNCTION__,__FILE__,__LINE__); pos1=xml_buf.indexOf(QLatin1String("")); @@ -128,10 +128,10 @@ void XMLParser::setDTDFile(const QString &dtd_file, const QString &dtd_name) QString fmt_dtd_file; if(dtd_file.isEmpty()) - throw Exception(ErrorType::AsgEmptyDTDFile,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEmptyDTDFile,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(dtd_name.isEmpty()) - throw Exception(ErrorType::AsgEmptyDTDName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEmptyDTDName,__PRETTY_FUNCTION__,__FILE__,__LINE__); #ifndef Q_OS_WIN fmt_dtd_file=QString("file://"); @@ -193,9 +193,9 @@ void XMLParser::readBuffer(void) if(xml_doc) restartParser(); //Raise an exception with the error massege from the parser xml - throw Exception(QString(Exception::getErrorMessage(ErrorType::LibXMLError)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::LibXMLError)) .arg(xml_error->line).arg(xml_error->int2).arg(msg).arg(file), - ErrorType::LibXMLError,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::LibXMLError,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Gets the referênce to the root element on the document @@ -206,7 +206,7 @@ void XMLParser::readBuffer(void) void XMLParser::savePosition(void) { if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); elems_stack.push(curr_elem); } @@ -214,7 +214,7 @@ void XMLParser::savePosition(void) void XMLParser::restorePosition(void) { if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(elems_stack.empty()) curr_elem=root_elem; @@ -228,9 +228,9 @@ void XMLParser::restorePosition(void) void XMLParser::restorePosition(const xmlNode *elem) { if(!elem) - throw Exception(ErrorType::OprNotAllocatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(elem->doc!=xml_doc) - throw Exception(ErrorType::OprInexistentElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprInexistentElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); restartNavigation(); curr_elem=const_cast(elem); @@ -239,7 +239,7 @@ void XMLParser::restorePosition(const xmlNode *elem) void XMLParser::restartNavigation(void) { if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); curr_elem=root_elem; @@ -271,7 +271,7 @@ bool XMLParser::accessElement(unsigned elem_type) xmlNode *elems[4]; if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); elems[ROOT_ELEMENT]=curr_elem->parent; elems[CHILD_ELEMENT]=curr_elem->children; @@ -293,7 +293,7 @@ bool XMLParser::accessElement(unsigned elem_type) bool XMLParser::hasElement(unsigned elem_type, xmlElementType xml_node_type) { if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(elem_type==ROOT_ELEMENT) /* Returns the verification if the current element has a parent. @@ -318,7 +318,7 @@ bool XMLParser::hasElement(unsigned elem_type, xmlElementType xml_node_type) bool XMLParser::hasAttributes(void) { if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(curr_elem->properties!=nullptr); } @@ -326,7 +326,7 @@ bool XMLParser::hasAttributes(void) QString XMLParser::getElementContent(void) { if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* If the current element has node returns the content of the CDATA instead of return the content of the element itself */ @@ -340,7 +340,7 @@ QString XMLParser::getElementContent(void) QString XMLParser::getElementName(void) { if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(QString(reinterpret_cast(curr_elem->name))); } @@ -348,7 +348,7 @@ QString XMLParser::getElementName(void) xmlElementType XMLParser::getElementType(void) { if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(curr_elem->type); } @@ -364,7 +364,7 @@ void XMLParser::getElementAttributes(attribs_map &attributes) QString attrib, value; if(!root_elem) - throw Exception(ErrorType::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Always clears the passed attributes maps attributes.clear(); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 4f993f51e6..45606df292 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -66,11 +66,11 @@ void Column::setType(PgSQLType type) { //An error is raised if the column receive a pseudo-type as data type. if(type.isPseudoType()) - throw Exception(ErrorType::AsgPseudoTypeColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgPseudoTypeColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(this->identity_type != BaseType::null && !type.isIntegerType()) { - throw Exception(Exception::getErrorMessage(ErrorType::InvalidIdentityColumn).arg(getSignature()), - ErrorType::InvalidIdentityColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidIdentityColumn).arg(getSignature()), + ErrorCode::InvalidIdentityColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); } setCodeInvalidated(this->type != type); @@ -81,8 +81,8 @@ void Column::setIdentityType(IdentityType id_type) { if(id_type != BaseType::null && !type.isIntegerType()) { - throw Exception(Exception::getErrorMessage(ErrorType::InvalidIdentityColumn).arg(getSignature()), - ErrorType::InvalidIdentityColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidIdentityColumn).arg(getSignature()), + ErrorCode::InvalidIdentityColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); } setCodeInvalidated(identity_type != id_type); diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 24b8c1a372..800f6e1df0 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -147,10 +147,10 @@ void Constraint::addColumn(Column *column, unsigned col_type) { //Raises an error if the column is not allocated if(!column) - throw Exception(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedColumn) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjConstraint)), - ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(constr_type!=ConstraintType::check) { //Adds the column only if the column doesn't exists on the internal list @@ -552,10 +552,10 @@ void Constraint::addExcludeElement(Column *column, Operator *oper, OperatorClass //Case the column is not allocated raises an error if(!column) - throw Exception(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedColumn) .arg(this->getName()) .arg(this->getTypeName()), - ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the element elem.setColumn(column); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 4dd1262b0f..973c309182 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -486,7 +486,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r //If there are objects referencing the table if(!refs.empty()) { - ErrorType err_type; + ErrorCode err_type; //Raises an error indicating the object that is referencing the table if(!dynamic_cast(refs[0])) diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index d7abd54462..0bdcfbdb67 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -122,10 +122,10 @@ void Index::addIndexElement(Column *column, Collation *coll, OperatorClass *op_c //Case the column is not allocated raises an error if(!column) - throw Exception(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedColumn) .arg(this->getName()) .arg(this->getTypeName()), - ErrorType::AsgNotAllocatedColumn, __PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedColumn, __PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the element elem.setColumn(column); diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 7cb343f2fe..c24906a5a3 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1553,12 +1553,12 @@ void PgSQLType::setPrecision(int prec) //Raises an error if the user tries to specify a precision > length if(((BaseType::type_list[type_idx]==QString("numeric") || BaseType::type_list[type_idx]==QString("decimal")) && prec > static_cast(length))) - throw Exception(ErrorType::AsgInvalidPrecision,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidPrecision,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the precision is greater thant 6 else if(((BaseType::type_list[type_idx]==QString("time") || BaseType::type_list[type_idx]==QString("timestamp") || BaseType::type_list[type_idx]==QString("interval")) && prec > 6)) - throw Exception(ErrorType::AsgInvalidPrecisionTimestamp,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(AsgInvalidPrecisionTimestamp,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->precision=prec; } diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 29523e2187..62e38d1a99 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -886,7 +886,7 @@ void Relationship::addColumnsRelGenPart(void) idx, tab_count; vector columns; ObjectType types[2]={ObjTable, ObjBaseTable}; - ErrorType err_type=Custom; + ErrorCode err_type=Custom; bool duplic=false, cond=false, /* 0 -> Column created by inheritance relationship 1 -> Column created by copy relationship */ diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 1bee5313be..03201bb286 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -126,21 +126,21 @@ void Trigger::setCondition(const QString &cond) void Trigger::addColumn(Column *column) { if(!column) - throw Exception(QString(Exception::getErrorMessage(ErrorType::AsgNotAllocatedColumn)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedColumn)) .arg(this->getName(true)) .arg(this->getTypeName()), - ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!column->getParentTable()) - throw Exception(QString(Exception::getErrorMessage(ErrorType::AsgColumnNoParent)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::AsgColumnNoParent)) .arg(this->getName(true)) .arg(this->getTypeName()), - ErrorType::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(this->getParentTable() && column->getParentTable() != this->getParentTable()) - throw Exception(QString(Exception::getErrorMessage(ErrorType::AsgInvalidColumnTrigger)) + throw Exception(QString(Exception::getErrorMessage(ErrorCode::AsgInvalidColumnTrigger)) .arg(column->getName(true)) .arg(this->getName(true)), - ErrorType::AsgInvalidColumnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgInvalidColumnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); upd_columns.push_back(column); setCodeInvalidated(true); diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index b39533b00b..5632a8cce4 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -264,16 +264,16 @@ QString Exception::messages[Exception::ErrorCount][2]={ Exception::Exception(void) { - configureException(QString(),ErrorType::Custom,QString(),QString(),-1,QString()); + configureException(QString(),ErrorCode::Custom,QString(),QString(),-1,QString()); } Exception::Exception(const QString &msg, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) { - configureException(msg,ErrorType::Custom, method, file, line, extra_info); + configureException(msg,ErrorCode::Custom, method, file, line, extra_info); if(exception) addException(*exception); } -Exception::Exception(ErrorType error_type, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) +Exception::Exception(ErrorCode error_type, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) { /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the @@ -284,13 +284,13 @@ Exception::Exception(ErrorType error_type, const QString &method, const QString if(exception) addException(*exception); } -Exception::Exception(const QString &msg, ErrorType error_type, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) +Exception::Exception(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) { configureException(msg,error_type, method, file, line, extra_info); if(exception) addException(*exception); } -Exception::Exception(ErrorType error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info) +Exception::Exception(ErrorCode error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info) { vector::iterator itr, itr_end; @@ -313,7 +313,7 @@ Exception::Exception(const QString &msg, const QString &method, const QString &f { vector::iterator itr, itr_end; - configureException(msg,ErrorType::Custom, method, file, line, extra_info); + configureException(msg,ErrorCode::Custom, method, file, line, extra_info); itr=exceptions.begin(); itr_end=exceptions.end(); @@ -324,7 +324,7 @@ Exception::Exception(const QString &msg, const QString &method, const QString &f } } -Exception::Exception(const QString &msg, ErrorType error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info) +Exception::Exception(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info) { vector::iterator itr=exceptions.begin(); @@ -337,7 +337,7 @@ Exception::Exception(const QString &msg, ErrorType error_type, const QString &me } } -void Exception::configureException(const QString &msg, ErrorType error_type, const QString &method, const QString &file, int line, const QString &extra_info) +void Exception::configureException(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, const QString &extra_info) { this->error_type=error_type; this->error_msg=msg; @@ -352,7 +352,7 @@ QString Exception::getErrorMessage(void) return(error_msg); } -QString Exception::getErrorMessage(ErrorType error_type) +QString Exception::getErrorMessage(ErrorCode error_type) { if(static_cast(error_type) < ErrorCount) /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages @@ -363,10 +363,10 @@ QString Exception::getErrorMessage(ErrorType error_type) return(QString()); } -QString Exception::getErrorCode(ErrorType error_type) +QString Exception::getErrorCode(ErrorCode error_type) { if(static_cast(error_type) < ErrorCount) - return(messages[static_cast(error_type)][ErrorCode]); + return(messages[static_cast(error_type)][ErrorCodeId]); else return(QString()); } @@ -386,7 +386,7 @@ QString Exception::getLine(void) return(QString("%1").arg(line)); } -ErrorType Exception::getErrorType(void) +ErrorCode Exception::getErrorType(void) { return(error_type); } diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 0c5d59c144..783f9602c2 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -34,7 +34,7 @@ using namespace std; -enum ErrorType { +enum ErrorCode { Custom, AsgPseudoTypeColumn, AsgInvalidPrecision, @@ -290,10 +290,10 @@ class Exception { static QString messages[ErrorCount][2]; //! \brief Constants used to access the error details - static constexpr unsigned ErrorCode=0, ErrorMessage=1; + static constexpr unsigned ErrorCodeId=0, ErrorMessage=1; //! \brief Error type related to the exception - ErrorType error_type; + ErrorCode error_type; //! \brief Formated error message QString error_msg, @@ -314,7 +314,7 @@ class Exception { int line; //! \brief Configures the basic attributes of exception - void configureException(const QString &msg, ErrorType error_type, const QString &method, const QString &file, int line, const QString &extra_info); + void configureException(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, const QString &extra_info); //! \brief Adds a exception to the list of exceptions void addException(Exception &exception); @@ -323,19 +323,19 @@ class Exception { Exception(void); Exception(const QString &msg, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); Exception(const QString &msg, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); - Exception(const QString &msg, ErrorType error_type, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); - Exception(const QString &msg, ErrorType error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); - Exception(ErrorType error_type, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); - Exception(ErrorType error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); + Exception(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); + Exception(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); + Exception(ErrorCode error_type, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); + Exception(ErrorCode error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); ~Exception(void){} QString getErrorMessage(void); - static QString getErrorMessage(ErrorType error_type); - static QString getErrorCode(ErrorType error_type); + static QString getErrorMessage(ErrorCode error_type); + static QString getErrorCode(ErrorCode error_type); QString getMethod(void); QString getFile(void); QString getLine(void); - ErrorType getErrorType(void); + ErrorCode getErrorType(void); QString getExtraInfo(void); //! \brief Gets the full exception stack From 29559301a08d53dc3fdca453d87a77c9dea904cb Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 18:40:12 -0300 Subject: [PATCH 162/425] Minor variables refactor (err_type -> err_code) --- libpgmodeler/src/databasemodel.cpp | 14 +++++----- libpgmodeler/src/relationship.cpp | 22 +++++++-------- libutils/src/exception.cpp | 44 +++++++++++++++--------------- libutils/src/exception.h | 16 +++++------ 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 973c309182..8c7729b7f1 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -486,32 +486,32 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r //If there are objects referencing the table if(!refs.empty()) { - ErrorCode err_type; + ErrorCode err_code; //Raises an error indicating the object that is referencing the table if(!dynamic_cast(refs[0])) { - err_type=RemDirectReference; - throw Exception(QString(Exception::getErrorMessage(err_type)) + err_code=RemDirectReference; + throw Exception(QString(Exception::getErrorMessage(err_code)) .arg(object->getName(true)) .arg(object->getTypeName()) .arg(refs[0]->getName(true)) .arg(refs[0]->getTypeName()), - err_type,__PRETTY_FUNCTION__,__FILE__,__LINE__); + err_code,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { BaseObject *ref_obj_parent=dynamic_cast(refs[0])->getParentTable(); - err_type=RemInderectReference; - throw Exception(QString(Exception::getErrorMessage(err_type)) + err_code=RemInderectReference; + throw Exception(QString(Exception::getErrorMessage(err_code)) .arg(object->getName(true)) .arg(object->getTypeName()) .arg(refs[0]->getName(true)) .arg(refs[0]->getTypeName()) .arg(ref_obj_parent->getName(true)) .arg(ref_obj_parent->getTypeName()), - err_type,__PRETTY_FUNCTION__,__FILE__,__LINE__); + err_code,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 62e38d1a99..f4ca98a6be 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -886,7 +886,7 @@ void Relationship::addColumnsRelGenPart(void) idx, tab_count; vector columns; ObjectType types[2]={ObjTable, ObjBaseTable}; - ErrorCode err_type=Custom; + ErrorCode err_code=Custom; bool duplic=false, cond=false, /* 0 -> Column created by inheritance relationship 1 -> Column created by copy relationship */ @@ -915,7 +915,7 @@ void Relationship::addColumnsRelGenPart(void) /* This for compares the columns of the receiver table with the columns of the reference table in order to resolve the conflicting names */ - for(i=0; i < dst_count && err_type==Custom; i++) + for(i=0; i < dst_count && err_code==Custom; i++) { //Gets the column from the receiver (destination) table dst_col=dst_tab->getColumn(i); @@ -1016,17 +1016,17 @@ void Relationship::addColumnsRelGenPart(void) ((!dst_flags[0] && !dst_flags[1]) || (!dst_flags[0] && dst_flags[1]))) { - err_type=InvCopyRelationshipDuplicCols; + err_code=InvCopyRelationshipDuplicCols; } /* Error condition 2: The relationship type is generalization and the column * types is incompatible */ else if((rel_type == RELATIONSHIP_GEN || rel_type==RELATIONSHIP_PART) && src_type != dst_type) - err_type=InvInheritRelationshipIncompCols; + err_code=InvInheritRelationshipIncompCols; } } //In case that no error was detected (ERR_CUSTOM) - if(err_type==Custom) + if(err_code==Custom) { //In case there is no column duplicity if(!duplic) @@ -1065,10 +1065,10 @@ void Relationship::addColumnsRelGenPart(void) } if((src_tab->getColumnCount() + columns.size()) != dst_tab->getColumnCount() && rel_type == RELATIONSHIP_PART) - err_type = InvColumnCountPartRel; + err_code = InvColumnCountPartRel; //In case that no duplicity error is detected - if(err_type==Custom) + if(err_code==Custom) { vector::iterator itr, itr_end; @@ -1094,16 +1094,16 @@ void Relationship::addColumnsRelGenPart(void) columns.pop_back(); } - str_aux=Exception::getErrorMessage(err_type); + str_aux=Exception::getErrorMessage(err_code); - if(err_type==InvCopyRelationshipDuplicCols) + if(err_code==InvCopyRelationshipDuplicCols) { msg=QString(str_aux) .arg(dst_col->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getName(true)); } - else if(err_type==InvColumnCountPartRel) + else if(err_code==InvColumnCountPartRel) { msg=QString(str_aux) .arg(src_tab->getName(true)) @@ -1118,7 +1118,7 @@ void Relationship::addColumnsRelGenPart(void) .arg(src_tab->getName(true)); } - throw Exception(msg, err_type,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg, err_code,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Creates the special primary key if exists diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 5632a8cce4..c1dd5d8e71 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -273,32 +273,32 @@ Exception::Exception(const QString &msg, const QString &method, const QString &f if(exception) addException(*exception); } -Exception::Exception(ErrorCode error_type, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) +Exception::Exception(ErrorCode error_code, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) { /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - configureException(QApplication::translate("Exception",messages[static_cast(error_type)][ErrorMessage].toStdString().c_str(),"", -1), - error_type, method, file, line, extra_info); + configureException(QApplication::translate("Exception",messages[static_cast(error_code)][ErrorMessage].toStdString().c_str(),"", -1), + error_code, method, file, line, extra_info); if(exception) addException(*exception); } -Exception::Exception(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) +Exception::Exception(const QString &msg, ErrorCode error_code, const QString &method, const QString &file, int line, Exception *exception, const QString &extra_info) { - configureException(msg,error_type, method, file, line, extra_info); + configureException(msg,error_code, method, file, line, extra_info); if(exception) addException(*exception); } -Exception::Exception(ErrorCode error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info) +Exception::Exception(ErrorCode error_code, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info) { vector::iterator itr, itr_end; /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - configureException(QApplication::translate("Exception",messages[static_cast(error_type)][ErrorMessage].toStdString().c_str(),"",-1), - error_type, method, file, line, extra_info); + configureException(QApplication::translate("Exception",messages[static_cast(error_code)][ErrorMessage].toStdString().c_str(),"",-1), + error_code, method, file, line, extra_info); itr=exceptions.begin(); itr_end=exceptions.end(); @@ -324,11 +324,11 @@ Exception::Exception(const QString &msg, const QString &method, const QString &f } } -Exception::Exception(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info) +Exception::Exception(const QString &msg, ErrorCode error_code, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info) { vector::iterator itr=exceptions.begin(); - configureException(msg,error_type, method, file, line, extra_info); + configureException(msg,error_code, method, file, line, extra_info); while(itr!=exceptions.end()) { @@ -337,9 +337,9 @@ Exception::Exception(const QString &msg, ErrorCode error_type, const QString &me } } -void Exception::configureException(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, const QString &extra_info) +void Exception::configureException(const QString &msg, ErrorCode error_code, const QString &method, const QString &file, int line, const QString &extra_info) { - this->error_type=error_type; + this->error_code=error_code; this->error_msg=msg; this->method=method; this->file=file; @@ -352,21 +352,21 @@ QString Exception::getErrorMessage(void) return(error_msg); } -QString Exception::getErrorMessage(ErrorCode error_type) +QString Exception::getErrorMessage(ErrorCode error_code) { - if(static_cast(error_type) < ErrorCount) + if(static_cast(error_code) < ErrorCount) /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - return(QApplication::translate("Exception", messages[static_cast(error_type)][ErrorMessage].toStdString().c_str(), "", -1)); + return(QApplication::translate("Exception", messages[static_cast(error_code)][ErrorMessage].toStdString().c_str(), "", -1)); else return(QString()); } -QString Exception::getErrorCode(ErrorCode error_type) +QString Exception::getErrorCode(ErrorCode error_code) { - if(static_cast(error_type) < ErrorCount) - return(messages[static_cast(error_type)][ErrorCodeId]); + if(static_cast(error_code) < ErrorCount) + return(messages[static_cast(error_code)][ErrorCodeId]); else return(QString()); } @@ -388,7 +388,7 @@ QString Exception::getLine(void) ErrorCode Exception::getErrorType(void) { - return(error_type); + return(error_code); } QString Exception::getExtraInfo(void) @@ -405,19 +405,19 @@ void Exception::addException(Exception &exception) while(itr!=itr_end) { - this->exceptions.push_back(Exception(itr->error_msg,itr->error_type, + this->exceptions.push_back(Exception(itr->error_msg,itr->error_code, itr->method,itr->file,itr->line,nullptr,itr->extra_info)); itr++; } exception.exceptions.clear(); - this->exceptions.push_back(Exception(exception.error_msg,exception.error_type, + this->exceptions.push_back(Exception(exception.error_msg,exception.error_code, exception.method,exception.file,exception.line,nullptr,exception.extra_info)); } void Exception::getExceptionsList(vector &list) { list.assign(this->exceptions.begin(), this->exceptions.end()); - list.push_back(Exception(this->error_msg,this->error_type, + list.push_back(Exception(this->error_msg,this->error_code, this->method,this->file,this->line,nullptr,this->extra_info)); } diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 783f9602c2..363e4255f6 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -293,7 +293,7 @@ class Exception { static constexpr unsigned ErrorCodeId=0, ErrorMessage=1; //! \brief Error type related to the exception - ErrorCode error_type; + ErrorCode error_code; //! \brief Formated error message QString error_msg, @@ -314,7 +314,7 @@ class Exception { int line; //! \brief Configures the basic attributes of exception - void configureException(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, const QString &extra_info); + void configureException(const QString &msg, ErrorCode error_code, const QString &method, const QString &file, int line, const QString &extra_info); //! \brief Adds a exception to the list of exceptions void addException(Exception &exception); @@ -323,15 +323,15 @@ class Exception { Exception(void); Exception(const QString &msg, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); Exception(const QString &msg, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); - Exception(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); - Exception(const QString &msg, ErrorCode error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); - Exception(ErrorCode error_type, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); - Exception(ErrorCode error_type, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); + Exception(const QString &msg, ErrorCode error_code, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); + Exception(const QString &msg, ErrorCode error_code, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); + Exception(ErrorCode error_code, const QString &method, const QString &file, int line, Exception *exception=nullptr, const QString &extra_info=QString()); + Exception(ErrorCode error_code, const QString &method, const QString &file, int line, vector &exceptions, const QString &extra_info=QString()); ~Exception(void){} QString getErrorMessage(void); - static QString getErrorMessage(ErrorCode error_type); - static QString getErrorCode(ErrorCode error_type); + static QString getErrorMessage(ErrorCode error_code); + static QString getErrorCode(ErrorCode error_code); QString getMethod(void); QString getFile(void); QString getLine(void); From 6fe6422f098e96d1c5909b09e28a86e951676c38 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 21:25:00 -0300 Subject: [PATCH 163/425] Removing uneeded temp QString instance created from Exception::getErroMessage call before throwing execptions. --- lang/fr_FR.qm.old | Bin 0 -> 246373 bytes lang/fr_FR.qm.old1 | Bin 0 -> 224921 bytes lang/fr_FR.ts.old | 11006 +++++++++++++++++++ libparsers/src/schemaparser.cpp | 42 +- libparsers/src/xmlparser.cpp | 4 +- libpgconnector/src/connection.cpp | 6 +- libpgconnector/src/resultset.cpp | 2 +- libpgmodeler/src/databasemodel.cpp | 60 +- libpgmodeler/src/domain.cpp | 2 +- libpgmodeler/src/relationship.cpp | 2 +- libpgmodeler/src/table.cpp | 2 +- libpgmodeler/src/trigger.cpp | 6 +- libpgmodeler/src/view.cpp | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 4 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 2 +- schemas/xml/sanepredial.omf | 11 + 17 files changed, 11085 insertions(+), 68 deletions(-) create mode 100755 lang/fr_FR.qm.old create mode 100755 lang/fr_FR.qm.old1 create mode 100755 lang/fr_FR.ts.old create mode 100755 schemas/xml/sanepredial.omf diff --git a/lang/fr_FR.qm.old b/lang/fr_FR.qm.old new file mode 100755 index 0000000000000000000000000000000000000000..22f2cc7d1b87298eddac1a53ff1dfb9a1b96b13a GIT binary patch literal 246373 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 z zA+HfQ!jq`jc)2p5F~Nd!Ft+@`)t zHSQ_{Ae_j?X>g_SjGyp%^c46ld!|T?{aY{ZP(?GkLbM?OcH{tZ07Cl?$Z2=b7N=YT zZt+8n=a*u+@N2P5;hP!71EHueNVbj!8n=|~p#?gs{6;d#ayuA%Ph>Vp0_uzeCu1ck zR6JJlLH41I4D>oRVAm@kXYaN!IpS7Of0k2EZNiav*zl}=Y{d6f9muwvRq2z6%uVs? z=+2c;B?roL(iszl9s7;;zPhcd6Hno+v=GsK=TCBap@FT-A@&*y+NzZFd8JNF#wMYQrJeqK<8pJuxaEGZ0O<(L&rvoIPt9DN^{d{kVX~E# z@TP_{RtP}YgJY|sZscQdNrj;TKn1Yp*}|nIfcx1uFfA4X8dOO)P(Iti^$ds?@?Hg* z(ugtQ>rGEEN~%SA^ysa`({r#~GO0UxT16Rh;6NnqVFyNt+}NF-ZghDiJqO*uv}~E4 z%%C5Axc;w%xnQIik;2Q@&MCXBys^c-vL({5x3%le^yB0F-eB! zWwb3{n8G70w^VGZ@tUUFNL!7(F47J*IHz4T;;XWOc%>tWgU+Py9FjiuY0#!W8C!9K zUWAaG{xl=+>?n4%->a>UN6uiMPulw8fcO~%RSHF3@D2senoDr!eob)#G#wjw-0Go! zXP)?!hDLp5=lD(;yFkik0<))p;}2D~6cQL8d>Uy`_ruHj{C>@4O#&oJ+r6>(Yzw>s zEg*JV`l#Ka!m4Xep>hHqi&AT(@0Di-mDsw!{fe9lpe zf3@64v_E^P975t}X>nMK7(LgA5#4ElQbI(UD^O{t^#P&QEohC5#Mwim?jFMYglnyzJl~3n&J`Se=TWB+aOF5RqWWmcV$WGy|%8+Z%EHe#vO1b1m7ZoUat1(z@t z&UR{x0V`6=o9&llsd6Z{4pf4{*-gO!FxF58ZXgd2-7U2v%!JJKu+==4`9>{IaaM)} zWOiCOF|k(7nBEU_Mr%xoH>onr!Z-OO)y+a;F6;pMa#M2rzBP`IxH4s=Z~yGc5!fVLGPy(^ORd~!nx_9i?S#J zp8yX}s{t(>ka6Ac(|22JXd4|nA|I^4Czk!f_ThBqYydyKoXuU4AX7dFkO=YhDlw$+ z<4P{2LNi&}TH27rkUUfBx+foTU^1DzEo|foS9g#&vkVIQq!}NiMi+9NC%~kf61$<} zGBgFoWa4xMaOYtoSp_(P^k28ege$-sy(=3UB>fhKYQf#;P==WW6+qmuGeN13%2ua9 zaOuwwrtXHEUWf0o-H$GF3HR^QOFh%}>dK-k|fc( zlbmEEZS)+|$nR>)quR&bnq#|e%=m*gvZ?kpzP++TvI26Y9pK>_p30&h_ZhM{vbE*K z#CnT(#2Uj+`Nl(IauJ@v9s2ZDr%+HHq33tNNJgYJ)6u~c_9?S6+svP}}@mjt&9 z+rKE&@|Nx3n!&U>3jER-CUV;nS`&nrPnFIucy8$lI=fR0+fJ-J;wejOzY&x?pdQb_ zq8z1z)pM(M)<$Il0d#2=1_)Dqps4A^dM9)QGbv6aCz=AjQzqr(_lG~d)#~Tf{7VaK ze`zuy)l?`e=q5<|`(yu$9492j7AY>3=6YYtV>rLn=zYE3?d($^3=n4(Ooj82DpQD{ zZouQIwoR$p9IsZ+v3Pu2ol-jfci4XEvqnp-AbqSWURcy??dNuo)MmzEf1yO2G(Q1Y0lTVE|0QL%GGsxN~A}p~6Q+&yPBFx09RwBZEdny~xOEPywQe z^K&>DonG!klh`3Wh>ZIfw72X@FCrhAynlxFJKmr45pwIivMH|itPc>XXDP8HO(EsM zCkgn(=b5LkThIWzAPeXL9&(oz4HH98l4rUdzHpRUf+=PiZ)zI0zp#nr>p(kk9Bb&4&w;nT~jn@by8iLFi-Mcn}2LWxUG+GZ9G_AKwFH&=4+}eL{MZ3Yq;(kZjIAk4~UGR?6-

GO^i6pn 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 Z9V*Zy(eD0AfOb`o{QE$y7hXK^{{jmTS~CCu literal 0 HcmV?d00001 diff --git a/lang/fr_FR.qm.old1 b/lang/fr_FR.qm.old1 new file mode 100755 index 0000000000000000000000000000000000000000..7b1f0ecfd4496306b88ed58dc09713d7396eb7e5 GIT binary patch literal 224921 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 literal 0 HcmV?d00001 diff --git a/lang/fr_FR.ts.old b/lang/fr_FR.ts.old new file mode 100755 index 0000000000..c10f2c124d --- /dev/null +++ b/lang/fr_FR.ts.old @@ -0,0 +1,11006 @@ + + + + + AboutWidget + + About pgModeler + À propos de pgModeler + + + PostgreSQL Database Modeler + PostgreSQL Database Modeler + + + Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. + Outil de modéliation entité-association pour PostgreSQL. Plus aucun ordre LDD à saisir à la main, laissez PgModeler le faire pour vous ! Ce logiciel fusionne le concept de modélisation entité-association et toutes les fonctionnalités étendues que propose PostgreSQL en plus des standards SQL. + + + Design, configure, deploy + Concevoir, configurer, déployer + + + <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" font-size:11pt; font-style:italic; text-decoration: underline; color:#0057ae;">http://pgmodeler.com.br</span></a></p></body></html> + <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" font-size:11pt; font-style:italic; text-decoration: underline; color:#0057ae;">http://pgmodeler.com.br</span></a></p></body></html> + + + pgModeler is proudly a brazilian software! + pgModeler est un logiciel brésilien et fier de l'être! + + + <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> + <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> + + + Contributors + Contributeurs + + + <html><head/><body><p>This page is dedicated to all contributors who gave a bit of their time in make pgModeler a better software somehow. The complete list of people that helped pgModeler can be found at <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>If you have a great idea to improve pgModeler please submit it <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">here</span></a>. No ideas for now but want to help? Why not donate a few bucks <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">here</span></a>!?</p></body></html> + <html><head/><body><p>Cette page est dédiée à tous les contributeurs qui ont donné un peu de leur temps afin de rendre ce logiciel meilleur d'une manière ou d'une autre. La liste complète des personnes est disponible sur <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>Si vous avez une idée géniable afin d'améliorer pgModeler n'hésitez pas à la soumettre <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">ici</span></a>. Vous n'avez pas d'idée mais vous voulez aider ? Pourquoi ne pas un don <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">ici</span></a> !?</p></body></html> + + + 1 + 1 + + + 2 + 2 + + + 3 + 3 + + + 4 + 4 + + + 5 + 5 + + + 6 + 6 + + + Name + Nom + + + Country + Pays + + + Contribution + Contribution + + + Damien Degois + Damien Degois + + + France + France + + + French UI translation and several improvements in auxiliary scripts. + Francisation IHM et amélioration de scripts. + + + Ji Bin + Ji Bin + + + China + Chine + + + Chinese UI translation and small fixes. + Traduction en lagnue chinoise et quelques corrections. + + + Pierre-Samuel LE STANG + Pierre-Samuel LE STANG + + + French UI translation. + Francisation IHM. + + + Lisandro Damián Nicanor + Lisandro Damián Nicanor + + + Argentina + Argentine + + + Russia + Russie + + + N/A + Inconnu + + + Hide this widget + Cacher ce widget + + + ... + ... + + + 0.0.0.0 + 0.0.0.0 + + + License + Licence + + + Build: + Build: + + + (CODE_NAME) + + + + (BUILD_NUM) + + + + Improvements on build scripts enabling the custom packaging in Linux distros; Per-user settings; pgModeler's package maintainer in Debian Linux. + + + + Pavel Alexeev + + + + Additional work for packaging in Linux distros; pgModeler's package maintainer in Fedora Linux. + + + + Mariusz Fik + + + + Poland + + + + Custom packaging first ideas. Tester of first version of custom packaging patch. + + + + <a href="http://pgmodeler.com.br">http://pgmodeler.com.br</a> + + + + <html><head/><body><p>Copyright 2006-2016 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> + <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> {2006-2016 ?} {0057a?} + + + 7 + 7 + + + 8 + 8 + + + Jonathan DUPRE + + + + Gilberto Castillo + + + + Cuba + + + + Spanish UI translation. + + + + + AggregateWidget + + Form + Formulaire + + + Final Function: + Fonction finale: + + + Sort Operator: + Opérateur de tri: + + + Initial Condition: + Condition initiale: + + + Funtion Inputs + Entrées de la fonction + + + Function State + État de la fonction + + + Transition Func.: + Fonction de transition: + + + Input Data Type + Type de donnée en entrée + + + State Data Type + Type de donnée d'état + + + An aggregate function that accepts the types <em><strong>typeA</strong></em> and <em><strong>typeB</strong></em> as input types and which type of state is <em><strong>state_type</strong></em>, must obey the following rules: <br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Final Function:</strong> <em>void final_function(<strong>state_type</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Transition Function:</strong> <em><strong>state_type</strong> transition_function(<strong>state_type</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> + Une fonction d'agrégation qui accepte les types <em><strong>typeA</strong></em> et <em><strong>typeB</strong></em> comme types d'entrées et dont le type d'état est <em><strong>type_etat</strong></em>, doit obéir aux règles suivantes:<br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Fonction Finale:</strong> <em>void fonction_finale(<strong>type_etat</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Fonction de Transition,:</strong> <em><strong>type_etat</strong> fonction_transition(<strong>type_etat</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> + + + + AppearanceConfigWidget + + Form + Formulaire + + + Element: + Élement: + + + Global: Font style + Global: Style de police + + + Global: Constraints descriptor + Global: Marqueurs de contraintes + + + Global: Object selection + Global: Selection d'objet + + + Global: Position hint text + Global: Texte de la boite de coordonées + + + Global: Position hint box + Global: Fond de la boite de coordonées + + + Global: Objects type + Global: Type de colonne + + + Global: Lock arc + Global: Cadenas (objet vérouillé, couleur de l'arceau) + + + Global: Lock body + Global: Cadenas (objet vérouillé, couleur du corps) + + + Table: Schema name + Table: Nom du schema + + + Table: Table name + Table: Nom de la table + + + Table: Columns box + Table: Zone des colonnes + + + Table: Extended attributes box + Table: Zone d'attributs étendus + + + Table: Title box + Table: Zone de titre + + + Rule: Name + Règle: Nom + + + Rule: Descriptor + Règle: Couleur de l'icône + + + Index: Name + Index: Nom + + + Index: Descriptor + Index: Couleur de l'icône + + + Trigger: Name + Déclencheur: Nom + + + Trigger: Descriptor + Déclencheur: Couleur de l'icône + + + View: Schema name + Vue: Nom du schema + + + View: View name + Vue: Nom de la vue + + + View: References box + Vue: Couleur d'arriere plan + + + View: Extended attributes box + Vue: Dialogue des attributs étendus + + + View: Title box + Vue: Couleur d'arriere plan de la barre de titre + + + View: Table / columns alias + Vue: Alias de table / colonne + + + View: Referenced column + Vue: Colonne référencée + + + View: Referenced table + Vue: Table référencée + + + View: Reference descriptor + Vue: Couleur de l'icône des références + + + Textbox: Body + Zone de texte: Corps + + + Column: Column name + Colonne: Nom de la colonne + + + Column: Descriptor + Colonne: Couleur de l'icône + + + Column: Included / Inherited by relationship + Colonne: Incluses / Héritées par associations + + + Column: Protected + Colonne: Protégée + + + Column (pk): Column name + Colonne (pk): Nom de la colonne + + + Column (pk): Descriptor + Colonne (pk): Couleur de l'icône + + + Column (fk): Column name + Colonne (fk): Nom de la colonne + + + Column (fk): Descriptor + Colonne (fk): Couleur de l'icône + + + Column (uq): Column name + Colonne (uq): Nom de la colonne + + + Column (uq): Descriptor + Colonne (uq): Couleur de l'icône + + + Column (nn): Column name + Colonne (nn): Nom de la colonne + + + Column (nn): Descriptor + Colnne (nn): Couleur de l'icône + + + Relationship: Descriptor + Associations: Couleur de l'icône + + + Relationship: Label text + Associations: Texte de l'étiquette + + + Relationship: Label box + Relations: Arrière plan de l'étiquette + + + Relationship: Attribute text + Relations: Texte des attributs + + + Relationship: Attribute descriptor + Relations: Couleur de l'icône des attributs + + + Tag: Name + Nom + + + Tag: Body + Corps + + + Font: + Police: + + + pt + pt + + + Bold + Gras + + + Italic + Italique + + + Colors: + Couleur: + + + Underline + Souligné + + + Placeholder: Body + + + + + Application + + Unknown exception caught! + Exception inconnue générée! + + + Failed to create initial configuration in `%1'! Check if the current user has write permission over that path and at least read permission over `%2'. + Impossible de créer les fichiers de configuration initiale dans `%1'! Vérifiez si vous avez la permission d'écriture dans ce dossier. Vérifiez l'existence et d'avoir les droits en lecture sur le dossier `%2'. + + + + BaseForm + + Dialog + Dialogue + + + &Apply + &Appliquer + + + &Cancel + A&nnuler + + + &Ok + &Ok + + + %1 properties + + + + + BaseObject + + Column + Colonne + + + Constraint + Contrainte + + + Function + Fonction + + + Trigger + Déclencheur + + + Index + Index + + + Rule + Règle + + + Table + Table + + + View + Vue + + + Domain + Domaine + + + Schema + Schéma + + + Aggregate + Fonction d'agrégat + + + Operator + Opérateur + + + Sequence + Séquence + + + Role + Rôle + + + Conversion + Convertion + + + Cast + Convertion de type + + + Language + Langage + + + Type + Type + + + Operator Family + Famille d'opérateurs + + + Operator Class + Classe d'opérateurs + + + Database + Base de données + + + Extension + Extension + + + Relationship + Relation + + + Collation + Collation + + + Textbox + Zone de texte + + + Event Trigger + Déclencheur sur évènement + + + Permission + Permission + + + Parameter + Paramètre + + + Type Attribute + Attribut de type + + + Basic Relationship + Relation simple + + + Tag + Tag + + + new_object + IMPOSSIBLE ! PROBLEME AU LANCEMENT SI %N EST PRESENT + + nouvel_objet + nouveaux_objets + + + + Tablespace + Intuitif + Tablespace + + + + BaseObjectView + + SQL off + SQL désactivé + + + + BaseObjectWidget + + Form + Formulaire + + + Name: + Nom: + + + ID: + Identifiant: + + + icone + icône + + + Comment: + Commentaire: + + + Tablespace: + Tablespace: + + + Edit object's permissions + Editer les permissions de l'objet + + + Disables the generated SQL code using comment tokens (--). +This will disable the code of all child and referrer objects. + Désactivez le SQL généré en utilisant les marqueurs de commentaire (--). +Ceci désactivera le SQL pour les objets enfants dont cet objet est le parent. + + + Append or prepend a set of SQL commands to the object's definition. + Doutes + Ajouter des commandes SQL avant ou après la définition de cet objet. + + + Custom SQL + Code SQL Libre + + + Owner: + Propriétaire: + + + Schema: + Schéma: + + + Disable SQL code + Désactiver le code SQL + + + Collation: + Collation: + + + Edit permissions + Editer les permissions + + + This object is protected thus no change in form will be applied to it. + L'objet est vérouillé, par conséquent aucun changement dans le formulaire ne lui sera appliqué. + + + Create / Edit: + Créer / Éditer: + + + Required field. Leaving this empty will raise errors! + Champ requis. Laisser ce champ vide génèrera une erreur! + + + Value(s) + Valeur(s) + + + Version + Version + + + The <em style='color: %1'><strong>highlighted</strong></em> fields on the form are available only on specific PostgreSQL versions. When generating SQL code for versions other than those specified on fields' tooltips pgModeler will ignore their values. + Les champs en <em style='color: %1'><strong>surbrillance</strong></em> dans le formulaire sont disponibles pour certaines versions de PostgreSQL uniquement. Ils seront ignorés s'il est demandé un export SQL pour une version de PostgreSQL non spécifiée dans l'infobulle du champ. + + + The <em style='color: %1'><strong>highlighted</strong></em> fields in the form or one of their values are available only on specific PostgreSQL versions. Generating SQL code for versions other than those specified in the fields' tooltips may create incompatible code. + + + + + BaseRelationship + + rel_%1_%2 + rel_%1_%2 + + + + BugReportForm + + Bug Report + Signaler un bug + + + Bug report + Signaler un bug + + + Create + Créer + + + &Cancel + A&nnuler + + + Use the form below to generate a complete bug report. Please, try to be as clear as possible when describing the actions that can reproduce the bug. Additionally, it's important to attach a sample database model so that the bug can be quickly discovered and fixed! + Utilisez le formulaire ci-dessous pour générer un rapport d'erreur complet. Merci d'être le plus clair possible dans la description de vos actions afin que le bug puisse être reproduit. De plus, il est important de joindre un modèle de base dans lequel le bug puisse être rapidement découvert, et par la même occasion rapidement corrigé ! + + + Report + Rapport + + + Issue details + Détails du problème + + + Output: + Sortie : + + + Select the report's output folder + Sélectionnez un dossier de sortie pour écrire le rapport d'erreur + + + ... + ... + + + <html><head/><body><p>If you prefer it's possible to report this issue anytime on pgModeler's project repository at <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#0057ae;">GitHub</span></a>. </p></body></html> + <html><head/><body><p>Il vous est également possible de signaler un bug à tout moment via le dépôt du projet pgModeler sur <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#0057ae;">GitHub</span></a>. </p></body></html> + + + Database Model + Modèle de base + + + In none occasion the models sent within the report will be published. They are kept safe and are used only for debug purpose. + Les modèles de base de données joints avec les rapports d'erreur NE SONT EN AUCUN CAS publiés. Ils ne sont utilisés qu'à des fins de debogage. + + + Attach the below database model file to be debugged. + Joindre le fichier modèle ci-dessous pour débogage. + + + Attach a different database model + Joindre un autre modèle de base + + + Bug report successfuly generated! Please, send the file <strong>%1</strong> to <em>%2</em> in order be analyzed. Thank you for the collaboration! + Le rapport de bug a été généré avec succès ! S'il vous plait, veuillez envoyer le fichier <strong>%1</strong> à <em>%2</em> pour expertise. Merci de votre collaboration ! + + + Load model + Sélectionner un modèle + + + Database model (*.dbm);;All files (*.*) + Modèle de base de données (*.dbm);; Tous les fichiers (*.*) + + + Select report output folder + Sélection du dossier de sortie + + + + CastWidget + + Form + Formulaire + + + Conversion Func.: + Fonction de conversion: + + + Cast Type: + Conversion de type: + + + Explicit + Explicite + + + Implicit + Implicite + + + Assignment + Affectation + + + Input / Output + Entrée / Sortie + + + Source data type + Type de donnée source + + + Target data type + Type de donnée cible + + + The function to be assigned to a cast from <em><strong>typeA</strong></em> to <em><strong>typeB</strong></em> must have the following signature: <em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. + La fonction à affecter à une convertion de <em><strong>typeA</strong></em> vers <em><strong>typeB</strong></em> doit avoir la signature suivante: <em><strong>typeB</strong> fonction(<strong>typeA</strong>, integer, boolean)</em>. + + + I&mplicit + + + + E&xplicit + + + + + Catalog + + Object type: %1 + ? + + Type d'objet: %1 + Types d'objets: %1 + + + + + CentralWidget + + Form + Formulaire + + + New model + Nouveau modèle + + + Open model + Ouvrir modèle + + + Sample models + Modèles de démo + + + Recent models + Modèles récents + + + Last session + Dernière session + + + + CodeCompletionWidget + + Make persistent + Rentre persistant + + + Makes the widget closable only by ESC key or mouse click on other controls. + Rendre ce widget refermable uniquement par la touche Échap ou par un clic sur les autres contrôles. + + + SQL Keyword + Mot-clé SQL + + + (no items found.) + (aucun élément trouvé.) + + + + CollationWidget + + Form + Formulaire + + + Locale: + Locale: + + + Encoding: + Encodage: + + + LC_COLLATE: + LC_COLLATE: + + + LC_CTYPE: + LC_CTYPE: + + + The fields <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong>, <strong><em>LC_COLLATE & LC_CTYPE</em></strong> are mutually exclusive, so you have to set only one of them in order to properly handle a collation. + Les champs <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong> et <strong><em>LC_COLLATE & LC_CTYPE</em></strong> sont mutuellement exclusifs, vous ne devez en définir qu'un de manière à gérer correctement la collation. + + + Not defined + Non défini + + + + ColorPickerWidget + + Form + Formulaire + + + Generate random color(s) + Génération aléatoire de couleur(s) + + + Alt+R + Alt+R + + + Select color + Sélectionner une couleur + + + + ColumnWidget + + Form + Formulaire + + + Default Value: + Valeur par défaut: + + + Expression: + Expression: + + + NOT NULL + Non-Null + + + Sequence: + Séquence: + + + E&xpression: + + + + &NOT NULL + + + + Se&quence: + + + + + ConfigurationForm + + pgModeler Configuration + Paramètres de pgModeler + + + Relationships + Associations + + + Appearance + Apparence + + + Connections + Connexions + + + Snippets + Snippets + + + &Apply + &Appliquer + + + &Cancel + A&nnuler + + + Defaults + Défauts + + + General + Général + + + Plug-ins + Extensions + + + Any modification made until now in the current section will be lost! Do you really want to restore default settings? + Toutes les modifications réalisées jusqu'à présent dans la section actuelle seront perdues! Souhaitez vous réellement restaurer les paramètres par défaut? + + + + Connection + + ERROR: trying to open an already stablished connection. + ERREUR: impossible de démarrer une connection déjà établie. + + + + ConnectionsConfigWidget + + Form + Formulaire + + + Connections: + Connexions: + + + Create new connection + Créer une nouvelle connexion + + + Cancel edition + Annuler l'édition + + + Duplicate the selected connection + Dupliquer la connexion sélectionnée + + + Edit selected connection + Editer la connexion sélectionnée + + + Delete selected connection + Supprimer la connexion sélectionnée + + + Connection Alias: + Alias de la connexion: + + + Connection DB: + Nom de la base: + + + Host/Port: + Hôte/Port: + + + User: + Utilisateur: + + + Password: + Mot de passe: + + + Timeout: + Délai d'expiration: + + + second(s) + seconde(s) + + + SSL Mode: + Mode SSL: + + + Disable + Désactivé + + + Allow + Autorisé + + + Require + Requis + + + AC verification + Vérification des AC + + + Full verification + Vérification complète + + + Client Certificate: + Certificat Client: + + + ~/.postgresql/postgresql.crt + ~/.postgresql/postgresql.crt + + + Automatically browses the named database when using this connection to manage databases on <strong>Manage</strong> view. + Parcourir et afficher automatiquement le contenu de la base de données indiquée ci-contre lors de l'utilisation de cette connexion dans le <strong>Manager</strong>. + + + Auto browse + Toujours montrer + + + Client Key: + Clef client: + + + ~/.postgresql/postgresql.key + ~/.postgresql/postgresql.key + + + Root Certificate: + Certificat racine: + + + ~/.postgresql/root.crt + ~/.postgresql/root.crt + + + Revoked Certs.: + Liste de révocations: + + + ~/.postgresql/root.crl + ~/.postgresql/root.crl + + + Kerberus Server: + Serveur Kerberos: + + + Force GSSAPI + Forcer GSSAPI + + + Options: + Options: + + + Add + Ajouter + + + Update + Mettre à jour + + + Test + Tester + + + Success + Succès + + + Connection successfuly stablished! + +Server details: + +PID: `%1' +Protocol: `%2' +Version: `%3' + Connexion établie avec succès! + +Détails du serveur : + +PID: `%1' +Protocole: `%2' +Version: `%3' + + + There is an unsaved connection! Want to save it? + Le paramétrage de la connexion n'a pas été sauvegardé! Voulez-vous enregistrer les changements? + + + Edit database connections + + + + General + Général + + + Other params: + + + + Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. + + + + Default for: + + + + Diff + Différencier + + + Export + Exporter + + + Import + Importer + + + Validation + + + + Security + + + + Kerberos Server: + + + + Indicates in which operations (diff, export, import or validation) the connection is used if none is explicitly specified by the user. + + + + There is a connection being created or edited! Do you want to save it? + + + + Found %1 connection(s) + + + + No connections found + + + + Edit connections + + + + + ConstraintWidget + + Form + Formulaire + + + Constraint Type: + Type de contrainte: + + + Fill Factor: + Taux de remplissage: + + + Match: + Comparaison: + + + This attribute cannot be changed once the object is created. + Cet attribut ne peut pas être modifié une fois l'objet créé. + + + Expression: + Expression: + + + Deferrable: + Différable: + + + Deferral: + Report: + + + ON DELETE: + ON DELETE: + + + ON UPDATE: + ON UPDATE: + + + Columns + Colonnes + + + Column: + Colonne: + + + Referenced Columns + Colonnes référencées + + + Table: + Table: + + + Indexing: + Indexation: + + + Exclude Elements + Élements exclus + + + No inherit: + Pas d'héritage: + + + Column + Colonne + + + Type + Type + + + Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they can raise errors. To create primary key using columns included by relationship use the following options: identifier field, attributes & constraints tab or primary key tab on the relationship form. + Les colonnes inclues dans la relation de peuvent être ajoutées/retirés manuellement de la clef primaire sous peine d’erreur. Pour créer une clef primaire utilisant des colonnes contenues dans une relation, veuillez utiliser une des options suivantes: champ identifiant, l'onglet attributs et contraintes ou l'onglet clef primaire du formulaire de la relation. + + + + ConversionWidget + + Form + Formulaire + + + Source Encoding: + Encodage de la source: + + + Target Encoding: + Encodage de la destination: + + + Conversion Func.: + Fonction de conversion: + + + Default Conversion: + Convertion par défaut: + + + The function to be assigned to an encoding conversion must have the following signature: <em>void function(integer, integer, cstring, internal, integer)</em>. + La fonction à affecter à une convertion d'encodage doit avoir la signature suivante: <em>void function(integer, integer, cstring, internal, integer)</em>. + + + + CrashHandlerForm + + Crash Handler + Gestionnaire d'incident + + + Stack trace + Piles d'exécution + + + Input: + Entrée: + + + Load report file for analysis + Ouvrir un rapport d'erreur pour analyse + + + Save the attached model file on the filesystem + Sauvegarder le modèle joint sur le système de fichiers + + + pgModeler bug report (*.bug);;All files (*.*) + Rapport de bug pgModeler (*.bug);;Tous les fichiers (*.*) + + + Load report + Ouvrir un rapport d'erreur + + + Save model + Enregistrer le modèle + + + Database model (*.dbm);;All files (*.*) + Modèle de base de données (*.dbm);; Tous les fichiers (*.*) + + + Crash handler + Gestionnaire d'incident + + + Bug report analysis mode activated. + Mode d'analyse de rapport d'erreur activé. + + + Oops! pgModeler just crashed! + Oh oh! pgModeler s'est planté ! + + + We apologize for what happened! It is clear that a nasty bug caused that. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. + Nous vous prions de nous excuser pour ce qui vient de se passer ! Il est clair qu'un vilain bug soit à l'origine de tout cela. Veuillez renseigner le formulaire ci-dessous en décrivant les actions qui vous avez faites avant que pgModeler ne sombre de manière inopinée. Ceci nous aidera à exterminer ce bug et ainsi améliorer le logiciel. + + + + CustomSQLWidget + + Form + Formulaire + + + SQL code + Code SQL + + + Puts an SELECT command template at current cursor position. + Insère une commande SELECT à la position courante du curseur. + + + &SELECT + &SELECT + + + Puts an INSERT command template at current cursor position. + Insère une commande INSERT à la position courante du curseur. + + + &INSERT + &INSERT + + + Puts an UPDATE command template at current cursor position. + Insère une commande UPDATE à la position courante du curseur. + + + Puts an DELETE command template at current cursor position. + Insère une commande DELETE à la position courante du curseur. + + + &DELETE + &DELETE + + + &Clear + E&ffacer + + + Append SQL + Code SQL suffixé + + + Append the SQL code at the very end of model definition. +Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE command. + Ajouter le code SQL à la toute fin de la définition du modèle +Sinon (décoché) pgModeler ajoutera ce code après la commande SQL CREATE DATABASE. + + + Append at end of model definition. + Suffixer à la fin de la définition du modèle. + + + Prepend SQL + Code SQL préfixé + + + Prepend at beginning of model definition. + Préfixer au tout début de la définition du modèle. + + + <html><head/><body><p>Use custom commands with extreme caution because you can change the semantics of the entire model when running SQL validation or export processes. Additionally, depending on the amount of commands, those processes can have their performance sensibly degradated.</p></body></html> + <html><head/><body><p>Utilisez cet espace pour y inscrire vos commandes SQL personnalisées avec précaution. Vous pourriez créer des incohérences qui peuvent interférer avec les fonctionnalités de validation et d'export du modèle. De plus, selon la nature des commandes entrées ces fonctionnalités peuvent être ralenties.</p></body></html> + + + Append / Prepend SQL code + Code SQL préfixé/suffixé + + + Type: + Type: + + + Generic INSERT + INSERT générique + + + Include serial columns + Inclure les colonnes de type "serial" + + + Exclude serial columns + Exclure les colonnes de type "serial" + + + Generic SELECT + SELECT générique + + + Table SELECT + Table SELECT + + + Generic UPDATE + UPDATE générique + + + Table UPDATE + Table UPDATE + + + Generic DELETE + DELETE générique + + + Table DELETE + Table DELETE + + + &UPDATE + &UPDATE + + + Add custom SQL code + + + + + DataManipulationForm + + Data Manipulation + Édition des données + + + &Close + &Fermer + + + Rows returned: + Lignes retournées: + + + 0 + 0 + + + Maximum limit of listed rows + Nombre maximum de lignes en retour de résulat + + + (Limit: 0) + (Limit: 0) + + + Empty values are assumed as <strong>DEFAULT</strong>. To use special values like <strong>NULL</strong>, a function call like <strong>now()</strong> or a specific data escaping, enclose values in <strong>&lt;&gt;</strong>. To use <strong>&lt;</strong> or <strong>&gt;</strong> as part of the value prepend the backslash character, e.g., <strong>\&lt;</strong> or <strong>\&gt;</strong>. + Les valeurs vides sont affichées en tant que <strong>DEFAULT</strong>. Pour utiliser les valeurs spéciales telles que <strong>NULL</strong>, un appel à une fonction comme <strong>now()</strong> ou toute autre fonction d'échappement spécifique, entourez ces valeurs/fonctions avec <strong>&lt;&gt;</strong>. Pour utiliser <strong>&lt;</strong> ou <strong>&gt;</strong> en tant que caractères à part entière, protégez-les avec un antislash : <strong>\&lt;</strong> ou <strong>\&gt;</strong>. + + + Refresh listing + Actualiser la liste + + + Refresh + Actualiser + + + F5 + F5 + + + Save changes + Enregistrer les changements + + + Save + Enregistrer + + + Ctrl+S + Ctrl+S + + + Copy the selection as CSV buffer + Copier la sélection avec un formatage de type CSV + + + Copy + Copier + + + Ctrl+C + Ctrl+C + + + Export results to CSV file + Exporter les résultats vers un fichier CSV + + + Export + Exporter + + + Ctrl+X + Ctrl+X + + + Undo modifications + Annuler les modifications + + + Undo + Annuler + + + Ctrl+Z + Ctrl+Z + + + Add data + Ajouter une ligne + + + Add + Ajouter + + + Ins + Ins + + + Mark the selected rows to be deleted + Marquer les lignes sélectionner pour suppression + + + Delete + Supprimer + + + Del + Suppr + + + Filter the result set + Filtrer les résultats + + + Table: + Table: + + + Schema: + Schéma: + + + in + dans + + + Hide views + Masquer les vues + + + Filter expression + Expression pour filtrer + + + Order && Limit + Order && Limit + + + Column: + Colonne: + + + Limit in: + Limit : + + + 000000 + 000000 + + + 100 + 100 + + + results + lignes + + + Add Item + Ajouter un élément + + + Remove Item + Supprimer un élément + + + Clear the order by columns list + Effacer la liste + + + Move selected item up + Déplacer vers le haut + + + Move selected item down + Déplacer vers le bas + + + <em>(Limit: <strong>%1</strong>)</em> + <em>(Limit: <strong>%1</strong>)</em> + + + No objects found + Aucun objet trouvé + + + Found %1 object(s) + %1 objets trouvés + + + Views can't have their data handled through this grid, this way, all operations are disabled. + Les données des vues ne sont pas modifiables par le biais de cette grille de résultats, de ce fait, aucune opération de modification n'est permise. + + + The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. <strong>WARNING:</strong> those operations can affect more than one row. + La table sélectionnée ne comporte pas de clé primaire ! Les mises à jour et les suppressions seront réalisées en considérant que l'ensemble des colonnes constitue une clé primaire. <strong>ATTENTION:</strong> ces opérations peuvent affecter plus d'une ligne. + + + This row is marked to be %1 + Cette ligne est estampillée pour être %1 + + + deleted + supprimée + + + updated + mise à jour + + + inserted + insérée + + + [binary data] + [données binaires] + + + <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving? + <strong>ATTENTION:</strong> Une fois validés (Commit), il ne sera plus possible d'annuler les changements ! Sauvegarder les changements ? + + + update + update + + + insert + insert + + + ASC + Intuitif + ASC + + + DESC + Intuitif + DESC + + + delete + delete + + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> + + + + Add empty rows + + + + Duplicate the selected rows + + + + Duplicate + + + + Ctrl+D + + + + results (Use <strong>0</strong> for no limit) + + + + <strong>WARNING: </strong> There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now? + + + + Rows returned: <strong>%1</strong>&nbsp;&nbsp;&nbsp; + + + + none + + + + + DatabaseExplorerWidget + + Form + Formulaire + + + Toggles the display of system objects. + Basculer l'affichage des objets système. + + + Sys. objects + Objets syst. + + + Toggles the display of extension objects + Basculer l'affichage des objets issus des extensions + + + Ext. objects + Objets ext. + + + Open the grid to visualize or edit data. + Ouvre l'éditeur de données. + + + Data &Grid + &Grille des données + + + Alt+G + Alt+G + + + Open a new SQL execution pane. + Ouvre un nouvel onglet d'exécution SQL. + + + ... + ... + + + Ctrl+F5 + Ctrl+F5 + + + Update the objects tree. + Actualiser l'arbre des objets. + + + Expands all items + Ouvre tous les nœuds de l'arborescence + + + Collapses all items + Ferme tous les nœuds de l'arborescence + + + Filter: + Filtrer: + + + By OID + Par OID + + + Attribute + Attribut + + + Value + Valeur + + + Show raw attributes names + Afficher le nom réel des attributs + + + (not found, OID: %1) + (inconnu, OID: %1) + + + By value + Par valeur + + + Collatable + Collatable + + + Collation + Collation + + + Constraint + Contrainte + + + Default + Défaut + + + Definition + Définition + + + Dimension + Dimension + + + Element + Élement + + + Encrypted + Encrypté + + + Enumerations + Énumérations + + + Expression + Expression + + + Function + Fonction + + + Language + Langage + + + Length + Longueur + + + Library + Bibliothèque + + + Materialized + Matérialisée + + + Name + Nom + + + Permissions + Permissions + + + Precision + Précision + + + Preferred + Préféré + + + Schema + Schéma + + + Storage + Stockage + + + Superuser + Super utilisateur + + + Tablespace + Espace de stockage logique + + + Type + Type + + + Unlogged + Unlogged + + + Validity + Validité + + + Subtype + Sous-type + + + Arguments + Arguments + + + Table + Table + + + Columns + Colonnes + + + Event + Evènement + + + Unique + Unique + + + Snippets + Snippets + + + Drop object + Supprimer l'objet + + + Drop cascade + Supprimer en cascade + + + Truncate + Truncate + + + Trunc. cascade + Trunc. cascade + + + Show data + Afficher les données + + + Reload properties + Recharger les propriétés + + + Update + Mettre à jour + + + Do you really want to drop the object <strong>%1</strong> <em>(%2)</em>? + Voulez-vous vraiment supprimer l'objet <strong>%1</strong> <em>(%2)</em> ? + + + Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it? + Voulez-vous vraiment supprimer EN CASCADE l'objet <strong>%1</strong> <em>(%2)</em>? Cette action sera susceptible de supprimer en plus d'autres objets qui en dépendent. + + + Do you really want to truncate the table <strong>%1</strong>? + Voulez-vous vraiment vider la table <strong>%1</strong> ? + + + Do you really want to <strong>cascade</strong> truncate the table <strong>%1</strong>? This action will truncate all the tables that depends on it? + Voulez-vous vraiment vider EN CASCADE la table <strong>%1</strong> <em>(%2)</em>? Cette action sera susceptible de supprimer d'autres lignes dans les tables qui en dépendent. + + + Admin. roles + + + + Alignment + + + + Analyze func. + + + + Arg. count + + + + Arg. default count + + + + Arg. defaults + + + + Arg. modes + + + + Arg. names + + + + Arg. types + + + + Behavior type + + + + Cast type + + + + Category + + + + Comment + + + + Commutator Op. + + + + Configuration + + + + Conn. limit + + + + Create DB + + + + Create role + + + + Curr. version + + + + Default value + + + + Delimiter + + + + Dest. type + + + + Directory + + + + Dest. encoding + + + + Encoding + + + + Exec. cost + + + + Op. family + + + + Final func. + + + + Func. type + + + + Handler func. + + + + Handles type + + + + Hashes + + + + Index type + + + + Inherit + + + + Ini. condition + + + + Inline func. + + + + Input func. + + + + Internal length + + + + Interval type + + + + I/O cast + + + + Join func. + + + + LC COLLATE + + + + LC CTYPE + + + + Leak proof + + + + Left type + + + + Can login + + + + Member roles + + + + Merges + + + + Negator op. + + + + Not null + + + + Object type + + + + OID + + + + With OIDs + + + + Old version + + + + Operator + + + + Operator func. + + + + Output func. + + + + Owner + + + + Owner column + + + + Parents + + + + Password + + + + Range attributes + + + + Receive func. + + + + Ref. roles + + + + Replication + + + + Restriction func. + + + + Return type + + + + Returns SETOF + + + + Right type + + + + Rows amount + + + + Security type + + + + Send func. + + + + Sort op. + + + + Source type + + + + Src. encoding + + + + State type + + + + Type mod. in func. + + + + Type mod. out func. + + + + Transition func. + + + + Trusted + + + + Type attribute + + + + Types + + + + Validator func. + + + + Windows func. + + + + false + + + + true + + + + Cache value + + + + Cycle + + + + Increment + + + + Max. value + + + + Min. value + + + + Start value + + + + Last value + + + + Op. class + + + + Canonical func. + + + + Subtype diff func. + + + + Deferrable + + + + For each row + + + + Firing + + + + On insert + + + + On delete + + + + On update + + + + On truncate + + + + Trigger func. + + + + Condition + + + + Deferment + + + + Execution mode + + + + Commands + Commandes + + + Position + + + + Comparison type + + + + Ref. columns + + + + Expressions + + + + Fill factor + + + + No inherit + + + + Op. classes + + + + Operators + + + + Ref. table + + + + Predicate + + + + Collations + + + + Inherited + + + + System + + + + Extension + Extension + + + Open the grid to visualize or edit data + + + + Open a new SQL execution pane + + + + Ctrl+F6 + Ctrl+F6 + + + Update the objects tree + + + + Ctrl+S + Ctrl+S + + + Drop this database + + + + Filters the currently loaded items in the tree by using a pattern and matching their names. If <strong>By OID</strong> is checked the pattern is interpreted as an integer value that represents the object id (OID). <br><br/><strong>HINT:</strong> if you need to search the entire database use the full refresh (<strong>Ctrl+F5</strong>) prior the filtering. + + + + Show raw attributes + + + + -- Source code not generated! Hit F7 or middle-click the item to load it. -- + + + + Rename + Renommer + + + Source code + Code source + + + Quick refresh + + + + Full refresh + + + + Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it. + + + + Src. table: %1 +Src. column(s): %2 + + + + Ref. table: %1 +Ref. column(s): %2 + + + + -- Source code genaration for buil-in and base types currently unavailable -- + + + + -- Source code unavailable for the object %1 (%2). -- + + + + + DatabaseImportForm + + Database Import + Import d'une base de données + + + &Import + &Importer + + + &Close + &Fermer + + + Options + Options + + + Starting point where objects will be put. + Point d'origine à partir duquel les objets seront créés sur le schéma. + + + Spacing: + Espacement: + + + Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. + Active l'importation des objets créés par les extensions. Généralement il n'y a pas lieu d'activer cette option sauf si des objets en base référencent directement ce type d'objet. + + + Import extension objects + Importer les objets des extensions + + + Connection: + Connexion: + + + Ignore import errors + Ignorer les erreurs + + + pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. + pgModeler ignorera les erreurs qui pourront survenir lors de l'importation et essayera de créer autant d'objets qui lui sera possible. En activant cette fonction le processus d'importation ne sera pas interrompu, toutefois vous pourrez vous retrouver avec un modèle incomplet. Cette option active la génération d'un fichier log dans le dossier temporaire de pgModeler. + + + Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. + Active l'importation des objets système. Il est recommandé d'utiliser ce mode uniquement lorsque le reste du modèle y fait directement référence (afin de conserver une intégrité). ATTENTION : Ceci va entrainer la création de beaucoup d'élements qui peuvent rendre difficile la lecture du schéma, voir même provoquer un plantage de pgModeler en cas de saturation mémoire ou CPU. + + + Import system objects + Importer les objets système + + + Automatically resolve dependencies + Résoudre automatiquement les dépendances + + + Resolve some of the object's dependencies by query the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types and extensions. + Résoudre certaines dépendances entre les objets en interrogeant le catalogue lorsqu'un objet n'existe pas dans la base à importer. Dans certains cas il vous sera nécessaire de combiner cette option avec celles ci-dessous. Cette option ne s'applique pas aux objets situés au niveau du cluster tels que les rôles, les tablespaces, les langues, les types de données ou encore les extentions. + + + Origin point: + Point d'origine: + + + Connect and list available databases + Connecter et lister les bases de données disponibles + + + ... + ... + + + Debug mode + Activer le mode debug + + + All catalog queries as well the created objects' source code are printed to standard outupt (stdout). + Toutes les requêtes effectuées sur le catalogue ainsi que le code source de tous les objets créés sera affiché sur la sortie standard (stdout). + + + Spacing between objects + Espacement inter-objets + + + Schemas per row + Nombre maximal de schémas pouvant être placés sur une seule ligne (en longueur) + + + Tables per row: + Tables sur une ligne: + + + Schemas per row: + Schémas sur une ligne: + + + Tables per row + Nombre maximal de tables pouvant être placées sur une seule ligne (en longueur) + + + Database import + Importation d'une base (Base existante vers modèle) + + + Settings + Paramètres + + + Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. + Coloriser les associations de manière aléatoire afin de faciliter l'identification des liens entre les tables, cela peut être utile sur de grands modèles. + + + Random colors for relationships + Coloriser les associations de manière aléatoire + + + Database + Base de données + + + Select all objects + Tout cocher + + + Clear object selection + Tout décocher + + + Expands all items + Développer tous les éléments + + + Collapses all items + Replier tous les éléments + + + Filter: + Filtrer: + + + Filter object by it's OID + Filtrer un objet par son OID + + + By OID + Par OID + + + Output + Sortie + + + Progress label... + Indicateur de progression... + + + Cancel + Annuler + + + Retrieving objects from database... + Récupération des objets à partir de la base de données... + + + Importing process aborted! + Processus d'importation en erreur ! + + + Importing process canceled by user! + Processus d'importation interrompu par l'utilisateur ! + + + Importing process sucessfuly ended! + Processus d'importation terminé avec succès ! + + + No databases found + Aucune base de données trouvée + + + Found %1 database(s) + %1 base(s) de données trouvée(s) + + + Retrieving cluster level objects... + Récupération des objets du cluster... + + + Retrieving objects of schema `%1'... + Récupération des objets du schéma `%1'... + + + Retrieving objects of table `%1'... + Récupération des objets de la table `%1'... + + + This is a PostgreSQL built-in data type and cannot be imported. + Ce type de données est déjà intégré nativement dans PostgreSQL. Il ne peut être importé. + + + This is a pgModeler's built-in object. It will be ignored if checked by user. + Cet objet fait partie intégrante de pgModeler. Il sera ignoré même si vous le cochez. + + + Create all imported objects in the current working model instead of create a new one. + + + + Import objects to the working model + + + + <strong>ATTENTION:</strong> You are about to import objects to the current working model! This action will cause irreversible changes to it even in case of critical errors during the process. Do you want to proceed? + + + + Schemas per row + + + + Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. + + + + All catalog queries as well the created objects' source code are printed to standard output (stdout). + + + + + DatabaseImportHelper + + Retrieving system objects... `%1' + Récupération des objets système... `%1' + + + Retrieving objects... `%1' + Récupération des objets... `%1' + + + Creating table inheritances... + Création des tables héritées... + + + Creating objects permissions... + Création des permissions... + + + Creating object `%1' (%2)... + Création de l'objet `%1' (%2)... + + + Trying to recreate object `%1' (%2)... + Tentative de recréation de l'objet `%1' (%2)... + + + Creating columns permissions... + Création des permissions sur les champs... + + + Update relationships of `%1' (%2)... + Mise à jour des associations de `%1' (%2)... + + + Destroying unused detached columns... + Suppression des colonnes détachées de la table parent (héritage)... + + + The database import ended but some errors were generated and saved into the log file `%1'. This file will last until pgModeler quit. + L'import de la base a échoué mais les erreurs rencontrées ont été sauvegardées dans le fichier journal `%1'. Ce fichier sera disponible jusqu'à la fermeture de pgModeler. + + + Import failed to recreate some objects in `%1' tries. + + + + Creating permissions for object `%1' (%2)... + + + + Updating relationships of `%1' (%2)... + + + + Validating relationships... + + + + Assigning sequences to columns... + + + + + DatabaseModel + + The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2' + Cette version de démonstration peut créer seulement `%1' instances pour chaque type d'objet ! Cette limite a été atteinte pour les objets de type : `%2' + + + Loading: `%1' (%2) + Chargement: `%1' (%2) + + + Generating %1 of the object `%2' (%3) + Génération %1 de l'objet `%2' (%3) + + + Validating relationships... + + + + Saving object `%1' (%2) + + + + Saving metadata of the object `%1' (%2) + + + + Metadata file successfully saved! + + + + Process successfully ended but no metadata was saved! + + + + Creating object `%1' (%2) + + + + Object `%1' (%2) already exists. Ignoring. + + + + Loading metadata for object `%1' (%2) + + + + Object `%1' (%2) not found. Ignoring metadata. + + + + Metadata file successfully loaded! + + + + + DatabaseWidget + + Form + Formulaire + + + Attributes + Attributs + + + Template DB: + Modèle de BDD: + + + Model Author: + Auteur du modèle: + + + Encoding: + Encodage: + + + Default Objects + Attributs par défaut des objets + + + Tablespace: + Tablespace: + + + Schema: + Schéma: + + + Collation: + Collation: + + + Owner: + Propriétaire: + + + LC_COLLATE: + LC_COLLATE: + + + Connections: + Connexions: + + + LC_CTYPE: + LC_CTYPE: + + + The fields <strong>LC_COLLATE</strong> and <strong>LC_CTYPE</strong> have pre-configured values based upon the running system. You can freely modify those values if you intend to export the model to another host. + Les champs <strong>LC_COLLATE</strong> et <strong>LC_CTYPE</strong> ont déjà des valeur pré-configurées basées sur le système. Vous pouvez librement les modifier si vous deviez exporter le modèle pour une autre machine hôte. + + + Use the above fields to specify the default attributes assigned to new objects created on the database model. Leaving a field empty will cause PostgreSQL to use the default values when exporting the model. + Utilisez les champs ci-dessus pour spécifier les attributs par défaut à assigner aux futurs objets qui seront créés dans le modèle. Laisser ces champs vides fera en sorte que PostgreSQL utilise ses valeurs par défaut lors de l'exportation du modèle. + + + Default + Défaut + + + + DomainWidget + + Form + Formulaire + + + Constraint + Contrainte + + + Name: + Nom: + + + Not Null: + Non Null: + + + Check Expr.: + Expr. de vérif.: + + + Default Value: + Valeur par défaut: + + + + DonateWidget + + Form + Formulaire + + + Donate to pgModeler + + + + Hide this widget + + + + ... + ... + + + <html><head/><body><p>pgModeler is brought to you thanks to a <span style=" font-style:italic;">great effort to create and distribute a quality product</span>. This project is reaching out levels of maturity never imagined. All this is the result of a joint work between its author and the <span style=" font-weight:600;">Open Source community</span>. <br/><br/>This software has a long way to go yet and with your help we'll keep maintaining the good job and bringing new improvements on each release. If you did like pgModeler and thinks it deserves a contribution please make a donation!</p></body></html> + + + + I want to help! + + + + + ElementsWidget + + Form + Formulaire + + + Column: + Colonne: + + + Expression: + Expression: + + + Collation: + Collation: + + + Operator Class: + Classe d'opérateurs: + + + Operator: + Opérateur: + + + Sorting: + Tri: + + + Ascending + Ascendant + + + Descending + Descendant + + + Nulls first + Null en premier + + + Element + Élement + + + Type + Type + + + Operator Class + Classe d'opérateur + + + Sorting + Tri + + + Nulls First + Null en premier + + + Collation + Collation + + + Operator + Operateur + + + Expression + Expression + + + Yes + Oui + + + No + Non + + + + EventTriggerWidget + + Form + Formulaire + + + Event: + Evènement: + + + Function: + Fonction: + + + Filter + Filtrer + + + Tag: + Tag: + + + Tag command + Commande de déclenchement + + + + Exception + + Assignment of a pseudo-type to the type of the column! + Utilisation d'un pseudo-type comme type de la colonne! + + + Zero length assignment! + Affectation de longueur nulle! + + + Assignment of a precision greater than the length of the type! + Utilisation d'une précision est plus grande que la longueur du type! + + + Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6! + Utilisation d'une précision de type time, timestamp ou interval invalide. La précision de ces types doit être inférieure ou égale à 6! + + + Reference to a column which index is out of the capacity of the column list! + Référence à une colonne dont l'index dépasse la capacité de la liste des colonnes! + + + Assignment of not allocated object! + Indefini ? + Utilisation d'un objet non référencé! + + + Assigning object of an invalid type! + Assignation d'un objet dont le type est invalide! + + + Removing an object of an invalid type! + Suppression d'un objet dont le type est invalide! + + + Obtaining an object of an invalid type! + L'objet obtenu est de type invalide! + + + Assignment of empty name to table return type! + Affectation d'un nom vide au type retourné par la table! + + + Reference to an event which does not belongs to trigger! + Qui ne provient ? + Référence à un évènement qui n'appartient pas au déclencheur! + + + Assignment of a function which language is invalid! + Définition d'une fonction dont le langage est invalide! + + + Assignment of empty name to an object! + Affectation d'un nom vide à l'objet! + + + Assignment of schema object which type is invalid! + Affectation d'un schema dont le type est invalide! + + + Assignment of tablespace object with invalid type! + Utilisation d'un tablespace dont le type est invalide! + + + Assignment of tablespace to an invalid object! + Affectation d'un tablespace à un objet invalide! + + + Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique! + Affectation d'un tablespace à une contrainte dont le type est invalide! Pour appartenir à un tablespace une contrainte doit être une clef primaire ou unique! + + + Assignment of owner object which type is invalid! + Affectation d'un propiétaire dont le type est invalide! + + + Assignment of owner to an invalid object! + Affectation d'un propriétaire à un objet invalide! + + + Reference to a function with invalid type! + Référence à une fonction dont le type est invalide! + + + Reference to an argument of the operator with invalid type! + Référence à un argument de l'opérateur dont le type est invalide! + + + Reference to an operator with invalid type! + Référence à un opérateur dont le type est invalide! + + + Assignment of value to an invalid option type on role! + Utilisation d'un attribut invalide pour un rôle! + + + Reference to an invalid role type! + Référence à un type de rôle invalide! + + + Insertion of empty command to the rule! + Ajout d'une commande vide dans cette règle! + + + Is not possible to create a self generalization/copy relationship! The table can not inherit or copy their own attributes! + Impossible de créer une association de généralisation/copie avec elle même! Une table ne peut hériter ou copier ses propres attributs! + + + Assignment of an object that already belongs to another table! + Utilisation d'un objet appartenant déjà à une autre table! + + + Assignment of a schema to the sequence which differs from the schema of the owner table! + Affectation d'un schéma à la séquence diffèrent du schéma de la table! + + + Assignment of an invalid value to one of the sequence attributes! + Utilisation d'une valeur invalide comme attribut de séquence! + + + Assignment of a minimum value to the sequence which is greater than the maximum value! + La valeur minimale de la séquence est supérieure à la valeur maximale! + + + Assignment of a null increment value to the sequence! + La valeur de l'incrément de la séquence est nulle! + + + Assignment of null cache value to the sequence! + La valeur cache de la séquence est nul! + + + Allocation of object with invalid type! + Le type de l'objet alloué est invalide! + + + Assignment of not allocated language! + Indéfini ? + Utilisation d'un langage inconnu! + + + Assignment of language object which type is invalid! + Définition d'un objet langage dont le type est invalide! + + + Reference to data type with an index outside the capacity of data types list! + Référence à un type de donnée dont l'index est en dehors de la capacité de la liste des types de données! + + + Assignment of invalid type to the object! + Affectation d'un type invalide à l'objet! + + + Obtaining types with invalid quantity! + Utilisation d'une quantité de types invalide! + + + Insertion of item which already exists in the attributes list of the type! + Ajout d'un attribut déjà présent dans la définition de ce type! + + + Insertion of invalid item in the attributes list of the type! + Ajout d'un attribut invalide à la liste des attributs de ce type! + + + Insertion of item which already exists in the enumarations list of the type! + Ajout d'un élément déjà existant dans l'énumeration! + + + Insertion of invalid item in the enumerations list of the type! + Ajout d'un élément invlaide dans l'énumeration! + + + Assignment of invalid configuration to the type! + La configuration assigné au type est invalide! + + + Assignment of an operator which input type count is invalid to aggregate function! + Utilisation d'un opérateur dont le nombre d'argument est invalide avec une fonction d'agrégation (un et seulement un)! + + + Assignment of an operator which types of arguments is invalid! + Utilisation d'un opérateur dont le type des arguments est invalide! + + + A view reference must be used in at least one these SQL scopes: View Definition, SELECT-FROM, FROM-WHERE or After WHERE! + Lors de la définition d'une vue, une référence doit utiliser au moins une des options suivantes:SELECT-FROM, FROM-WHERE ou Après WHERE! + + + Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again! + Impossible de trouver le fichier des préférences par défaut `%1' ! Pour restaurer les préférences par défaut veuillez vérifier l'existance de ce fichier et réessayez ! + + + Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3' + Impossible de charger l'extension `%1' depuis la bibliothèque`%2' ! Message retourné par le gestionnaire d'extension : `%3' + + + Unknown attribute `%1' in file %2, line %3, column %4! + Attribut `%1' incconu dans le fichier %2, ligne %3, colonne %4 ! + + + Invalid use of a view referece as whole SQL definition! The assigned reference must be an expression! + À contrôler + Utilisation invalide d'une vue en tant que définition SQL! La référence doit être une expression! + + + Assignment of a second definition expression to the view! + Assignation d'une seconde expression à la vue! + + + Assignment of collation object which type is invalid! + À contrôler + Utilisation d'un objet collation invlaide! + + + Collations must be created at least with attributes LC_COLLATE and LC_CTYPE defined! + Les collations doivent être définies avec les attributs LC_COLLATE et LC_CTYPE renseignés! + + + Reference to an invalid copy table option! + Référence à une option invalide de copie de table! + + + The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers! + Le mode AU LIEU DE (INSTEAD OF) ne peut être utilisé comme trigger de table! Ce n'est valable que pour les triggers de vue! + + + The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table! + L'événement TRUNCATE ne peut être utilisé que lors d'un trigger sur chaque ligne et qu'il appartient à une table! + + + The INSTEAD OF mode cannot be used on view triggers that executes for each statement! + Le mode AU LIEU DE (INSTEAD OF) ne peut être utilisé avec triggeurs de vues qui s’exécutent à chaque requête! + + + Constraint triggers can only be executed on AFTER events and for each row! + Les triggeurs de contraintes ne peuvent être exécutés qu'après (AFTER) et pour chaque lignes! + + + A view trigger cannot be AFTER/BEFORE when it executes for each row! + Les triggeurs de vues ne peuvent être AFTER/BEFORE quand il sont configuré pour une exécution sur chaque ligne! + + + A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event! + Un triggeur ne peut faire référence aux colonnes quand il est utilisé en mode INSTEAD OF sur un événement de type UPDATE! + + + Only constraint triggers can be deferrable or reference another table! + Seuls les déclencheurs de contraintes peuvent être déférés ou référencer une autre table! + + + Reference to a function id which is incompatible whit the user define type configuration! + Doutes + Référence faite à un identifiant de fonction incompatible avec le type configuré! + + + The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack! + La procédure de validation a échouée à cause d'une erreur levée par l'assistant de validation. Pour de plus amples informations, referez vous à la pile des exceptions! + + + Assignment of an invalid strategy/support number to an operator class element! + Hum ... numéro de stratégie/support ? + Affectation d'un numéro de stratégie/support invalide à un élément de la classe 'operator'! + + + Insertion of element which already exists in the element list! + Insertion d'un élément déjà existant dans la liste des éléments! + + + Reference to a parameter which index is out of the parameter list bounds! + Référence un paramètre dont l'index est hors des limites de la liste de ces derniers! + + + Reference to an argument which index is out of argument list bounds! + Référence un argument dont l'index est hors des limites de la liste de ces derniers! + + + Assignment of a name which contains invalid characters! + Utilisation de caractères invalides dans le nom! + + + Assignment of a name which length exceeds the maximum of 63 characters! + Utilisation de plus de 63 caractères dans le nom! + + + Reference to a role which index is out of role list bounds! + Référence un rôle dont l'index est hors des limites de la liste de ces derniers! + + + Reference to a command which index is out of the command list bounds! + Référence une commande dont l'index est hors des limites de la liste de ces dernières! + + + Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values! + À contrôler. + Affectation de la valeur de départ de la séquence en dehors des limites de cette dernière (min et max)! + + + Reference to a label which index is out of labels list bounds! + Référence un label dont l'index est hors des limites de la liste de ces derniers! + + + Reference to an attribute which index is out of the attributes list bounds! + Référence un attribut dont l'index est hors des limites de la liste de ces derniers! + + + Reference to an enumeration which index is out of the enumerations list bounds! + Référence une énumération dont l'index est hors des limites de la liste de ces dernières! + + + Reference to an element which index is out of element list bounds! + Référence un élément dont l'index est hors des limites de la liste de ces derniers! + + + Reference to an object which index is out of object list bounds! + Référence un objet dont l'index est hors des limites de la liste de ces derniers! + + + Removal of an object not allocated! + Suppression d'un objet non alloué! + + + The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference! + L'objet `%1' (%2) ne peut être modifié car il est est réservé à PostgreSQL! Cet objet apparaît dans le modèle uniquement comme référence! + + + Unsupported PostgreSQL version (%1) detected! Valid versions are: %2 + Une version non supportée de PostgreSQL (%1) a été détectée! Les versions supportées sont: %2 + + + Operation with object(s) which type(s) is invalid! + Opérations sur des objet(s) dont le(s) type(s) sont invalides! + + + Reference to object with invalid type! + Référence à un objet ayant un type invalide! + + + Operation with object not allocated! + Opération sur des objets non alloués! + + + The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user! + Une association de type 1-1, quand les deux tables sont obligatoires, n'est pas implémentée car celà requiert la fusion des tables, ce qui casse le modèle réalisé par l'utilisateur! + + + Assignment of an invalid expression to the object! + Affectation d'une expression invalide à l'objet! + + + Assignment of a primary key to a table which already has one! + Impossible de définir une clef primaire à une table qui en possède déjà une! + + + Identifier relationship can not be created for a self relationship, relationships of the type n-n, copy or generalization! + Review needed ! Doutes ... + Seules des associations de type 1:1 ou 1:n peuvents être utilisé comme identifiant. En aucun cas les autoassociations, associations n:n, généralisations ou copies ne le peuvent! + + + An attribute can not be added to a copy or generalization relationship! + Un attribut ne peut être ajouté à une relation copie ou généralisation! + + + A foreign key can not be added to a relationship because is created automatically when this is connected! + Une clef étrangère ne peut être ajoutée à une relation car elle est créée automatiquement lors de la mise en relation! + + + Reference to an user-defined data type that not exists in the model! + Référence à un type de donné défini par l'utilisateur qui n'existe pas dans le modèle! + + + Assignment of invalid maximum size to operation list! + La taille maximum affectée à la liste d'opérations est invalide! + + + One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! + Un ou plusieurs objets ont été invalidés et automatiquement supprimés car ils référençaient des colonnes qui étaient incluses dans des relations et qui n'existaient plus du fait de la suppression de relation ou d'exclusion de ces colonnes! + + + Reference to an invalid privilege type! + Référence à un type de privilège invalide! + + + Insertion of a role which already exists in the role list of the permission! + Ajout d'un rôle déjà existant dans la liste de cette permission! + + + Assignment of privilege incompatible with the type of object referenced by permission! + Utilisation d'un privilège incompatible avec le type d'objet référencé par la permission! + + + It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature! + Il est impossible de créer des tableaux de domaines ou séquences (dimension >= 1)! PostgreSQL n'inplémente pas encore cette fonctionnalité! + + + Assignment of invalid name to the table generated from N-N relationship! + Le nom de la table générée par la relation N-N est invalide! + + + Reference to a column of the objects table with invalid index! + Référence à une colonne de la table ayant un index invalide! + + + Reference to a row of the objects table with invalid index! + Référence à une ligne de la table ayant un index invalide! + + + Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns! + Les contraintes telles que clef primaire, clef étrangère ou l'unicité doivent avoir au moins une colonne associée! Pour les clefs étrangères, les colonnes référencées doivent également être sélectionnées! + + + Unable to load one or more configuration files! Please check if files exists in the configuration folder and if they are not corrupted to preventing this error to occur again on the next startup! + Impossible de charger un ou plusieurs fichiers de configuration! Veuillez vérifier que les fichiers existent bien dans le dossier de configuration et qu'ils ne soient pas corrompus pour éviter que l'erreur ne se produise à nouveau au prochain lancement! + + + The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack! + +** Executed SQL command: ** + +%1 + Le process d'exportation a échoué suite à une erreur déclenchée par le serveur PostgreSQL lors de la tentative d'exécution d'une commande SQL. Pour plus de détails concernant l'erreur vérifiez la pile d'exceptions! + +** Commande SQL exécutée: ** + +%1 + + + One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details. + Une ou plusieurs extensions n'ont pas été activée(s) car des erreurs sont apparues lors du processus de chargment. Pour plus de détails, consultez la pile d'exceptions. + + + Invalid syntax in file %1, line %2, column %3! + Syntaxe invalide dans le fichier %1, ligne %2, colonne %3! + + + Assignment of empty XML buffer to parser! + Passage d'un tampon XML vide au parseur! + + + Could not access the file or directory %1! Make sure that it exists or if the user has access permissions on it! + Impossible d'accéder au fichier ou dossier %1! Assurez vous qu'il existe et que l'utilisateur a le droit d'y accéder! + + + Assignment of empty DTD file name! + Le nom du fichier DTD est vide! + + + Assignment of empty name to the DTD declaration! + Le nom de la DTD est vide! + + + Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated! + Opération sur un élément de l'arbre XML non initialisé! Il est nécessaire de remplir le tampon de l'analyseur XML et de lancer l'interprétation pour que l'arbre soit généré! + + + Could not load file %1. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! + Impossible de charger le fichier %1. Le fichier semble incohérent ou une de ses dépendances (fichiers DTD) contient des erreurs ou est manquantes! + + + Operation with unallocated tree element! + Opération sur un élément non alloué de l'arbre! + + + Operation with element which does not exists in the element tree currently loaded! + Opération sur un élément inexistant dans l'arbre des élément actullement chargé! + + + Assignment of a value to an invalid connection parameter! + Affectation d'une valeur à un paramètre de connexion invalide! + + + Operation on connection not established! + Opération sur une connexion non établie! + + + Attempt to connect without define configuration parameters! + Tentative de connexion sans paramètre de configuration défini! + + + Assignment of not allocated SQL command result! + indéfini ? + Affectation d'un résultat de commande SQL non alloué! + + + Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client! + Impossible de retourner le résultat de la commande SQL car la réponse du SGBD n'a pas été comprise par le client! + + + Reference to a column of tuple with invalid index! + Référence à une colonne de tuple dont l'index est invalide! + + + Reference to a column of tuple with invalid name! + Référence à une colonne de tuple dont le nom est invalide! + + + Reference to a tuple with index invalid or the result is empty (no tuples)! + Référence à un tuple avec un index invalide ou le résultat est vide (pas de tuple)! + + + Assignment of a not allocated column to object `%1' (%2)! + + + + Assignment of a not allocated schema to object `%1' (%2)! + + + + The object `%1' (%2) has inconsistent SQL or XML definition! + + + + The object `%1' (%2) already exists on `%3' (%4)! + + + + The object `%1' (%2) cannot be assigned because there is already exists in the container object `%3'! + + + + The insertion of the parameter `%1' will not be possible because there is another parameter with same name in the function `%2'! + + + + The insertion of the table return type `%1' will not be possible because there is another return type with the same name in the `%2'! + + + + The column `%1' cannot be assigned to the trigger `%2' because they belongs to different parent tables! + + + + Assignment of a not allocated function to object `%1' (%2)! + + + + Assignment of a function which return type is different from `%1'! + + + + Assignment of a function which parameter count is invalid to the object `%1' (%2)! + + + + Event trigger function must be coded in any language other than SQL! + + + + Assignment of not allocated table to object `%1' (%2)! + + + + Assignment of appended or prepended SQL to an invalid object! + + + + The insertion of the role `%1' is not possible because this is already being referenced by role `%2'! + + + + Reference redundancy detected by having the role `%1' referencing the role `%2'! + + + + The role `%1' can not be listed as a member of itself! + + + + Assignment of owner table which is not in the same schema as the sequence `%1'! + + + + Assignment of owner table which does not belong to the same owner of the sequence `%1'! + + + + Assignment of a nonexistent owner column to the sequence `%1'! + + + + Assignment of an owner column to the sequence `%1' that is not related to any table! + + + + Assignment of a function with invalid return type to object `%1' (%2)! + + + + Assignment of a function with invalid parameter(s) type(s) to object `%1' (%2)! + + + + Assignment of an empty directory to object `%1' (%2)! + + + + Assignment of system reserved name to the object `%1' (%2)! + + + + One function with invalid configuration is been used by the object `%1' (%2)! + + + + The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4)! + + + + The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4) that belongs to `%5' (%6)! + + + + The creation of the relationship `%1' between the table `%2' and `%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! + + + + Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'! + + + + Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types! + + + + The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model! + + + + Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it! + + + + There is already a relationship between `%1' (%2) and `%3' (%4) in the model! + + + + The primary key `%1' can only be allocated if declared within a block of code that defines a table or relationship! + + + + There is already a permission on object `%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! + + + + A permission is referencing the object `%1' (%2) which was not found in the model! + + + + The object `%1' (%2) can not be created because its not being assigned to any schema! + + + + The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'! + + + + The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! + + + + The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! + + + + The operator `%1' can not be assigned as a comutator of operator `%2' because it has incompatible settings! + + + + The operator `%1' can not be assigned as negator of operator `%2' because it has incompatible settings! + + + + The type `%1' can not self refer in the attributes `element' or `copy type' or be used as a data type of an attribute in the configuration of a composite type! + + + + Assignment of invalid element to type `%1'! + + + + Assignment of invalid alignment to type `%1'! + + + + The relationship `%1' can not make use of the special primary key because it is marked as identifier or it is a self relationship! + + + + The object `%1' (%2) can not be edited or deleted because it was automatically included through a relationship! If the object is an attribute or constraint the modifications must be done on the relationship editing form. + + + + The object `%1' (%2) can not be deleted because it is protected! + + + + The group `%1' has already been declared earlier! + + + + The group `%1' can not be built in the groups declaration block (%2)! + + + + The group `%1' was built but not declared in the groups declaration block (%2)! + + + + The group `%1' can not be built without possessing child elements! + + + + The group `%1' can not be built once more because this was done in previous blocks! + + + + The group `%1' has been declared but not built! + + + + The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect! + + + + Invalid instruction `%1' on file %2, line %3, column %4! + + + + Invalid metacharacter `%1' in file %2, line %3, column %4! + + + + Invalid operator `%1' in comparison expression, file %2, line %3, column %4! + + + + Attribute `%1' with an undefined value in file %2, line %3, column %4! + + + + Attribute `%1' with an invalid name in file %2, line %3, column %4! + + + + Error while interpreting XML buffer at line %1 column %2. +Message generated by the parser: %3. %4 + + + + Attempt to start a connection already stablished! + + + + Could not connect to the database. +Message returned: `%1' + + + + Unable to allocate command result for the SQL because the server has generated a fatal error! +Message returned by the DBMS: `%1' + + + + Reference to a column of a tuple which was not yet initialized (tuple navigation not started)! + + + + Could not execute the SQL command. + Message returned: `%1' + + + + It is not possible mix ordinary references (SELECT-FROM, FROM-WHERE, After WHERE) with references used as view SQL definition! + + + + The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object! + + + + Only operator families which uses `btree' as indexing method are accepted by operator class elements! + + + + Copy relationship between tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table! + + + + Assignment of a column which has no parent table to the object `%1' (%2)! + + + + The operator class assigned to the object `%1' (%2) must use `btree' as indexing method! + + + + The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified! + + + + The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'! + + + + Assignement of an invalid object name pattern to the relationship `%1'! + + + + Reference to an invalid object name pattern id on the relationship `%1'! + + + + Mixing incompatibles DBMS export modes: `ignore object duplications', `drop database' or `drop objects' cannot be used with `simulate export'! + + + + Mixing incompatibles DROP options: `drop database' and `drop objects' cannot be used at the same time! + + + + Invalid object id swapping operation! The objects involved are the same! + + + + Invalid object id swapping operation! The database itself, tablespaces or roles cannot have the ids swapped! + + + + The widget already has a parent and cannot be assigned to a different object! + + + + The object `%1' (%2) could not be imported due to one or more errors! Check the exception stack for more details. + + + + Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case. + + + + The column `%1' cannot reference it's parent table `%2' as data type! + + + + Operation with an invalid element id `%1'! + + + + Reference to an invalid color id `%1' for element `%2'! + + + + The sequence `%1' can't be assigned to the column `%2' because the data type of the latter is incompatible. The type used must be an integer one! + + + + The option to generate temporary object names can only be used in simulation mode! + + + + Could not assign the variable `%1' to event trigger's filter. Currently, PostgreSQL supports only the `TAG' variable! + + + + Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. + + ** Returned error ** + +%4 + + + + Malformed unescaped value on row `%1' column `%2'! + + + + The object `%1' (%2) can't be handled because some needed fields are not set! Please, make sure to fill at least the requires fields in order to properly create or update the object. + + + + A relationship can only be swapped by other object of the same kind! + + + + Assignment of a null type to object `%1' (%2)! + + + + Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition! + + + + Unable to write the file `%1' due to one or more errors in the definition generation process! + + + + The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent! + + + + Reference to a tuple with an invalid index or the result is empty (no tuples)! + + + + Invalid use of a view reference as whole SQL definition! The assigned reference must be an expression! + + + + At the moment pgModeler does not support the creation of primary keys which some columns were generated by relationship connection. To create primary keys with this feature you can use the field `Identifier' or the tab `Primary key' on relationship editing form! + + + + Reference to a function id which is incompatible with the user define type configuration! + + + + Invalid use of variadic parameter mode! This mode can be used only with an array or "any" data type! + + + + Assignment of an invalid object to `%1' (%2)! The assigned object must be of type `%3'. + + + + It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function or a sequence object must be directly assigned to the column! + + + + Trying to undo/redo an invalid operation over an object that does not exists anymore or can't be handled! The operation history will be cleaned up. + + + + A parent table of `%1' which OID is `%2' was not found in the set of imported objects! + + + + The enumeration `%1' can't be assigned to the type `%2' because contains invalid characters! + + + + The enumeration `%1' can't be assigned to the type `%2' because is too long! + + + + The connection was idle for too long and was automatically closed! + + + + The connection was unexpectedly closed by the database server `%1' at port `%2'! + + + + + ExtensionWidget + + Form + Formulaire + + + Version: + Version: + + + Old Version: + Ancienne version: + + + This attribute cannot be changed once the object is created. + Cet attribut ne peut être modifié une fois l'objet créé. + + + Handles data type + Prendre en charge les types de données + + + + FindReplaceWidget + + Form + Formulaire + + + Replace one occurrence + Remplace une occurrence + + + Replace + Remplacer + + + Replace all occurrences + Remplace toutes les occurrences + + + Replace All + Remplacer tout + + + Replace the selection and find the next one + Remplacer l'occurrence courante et trouver le suivant + + + Replace && Find + Remplacer && Suivant + + + Replace: + Remplacer par: + + + Find: + Recherche: + + + Find previous + Précédent + + + Shift+F3 + Shift+F3 + + + Find next + Suivant + + + F3 + F3 + + + Case sensitive + Respecter la casse + + + Regular expression + Expression régulière + + + Whole words + Mots entier + + + + FunctionWidget + + Form + Formulaire + + + Attributes + Attributs + + + Langague: + Langage: + + + Function Type: + Type de fonction: + + + Execution Cost: + Coût d'exécution: + + + Rows Returned: + Lignes retournées: + + + Behavior: + Comportement: + + + Security: + Sécurité: + + + Return Method: + Type de retour: + + + Simple + Simple + + + Set + Multiple + + + Table + Table + + + Return Table + Table de retour + + + Windown Func. + Fonct. fenêtrage + + + Leakproof + Leakproof + + + Parameters + Arguments + + + Definition + Définition + + + Dynamic Library: + Bibliotèque dynamique: + + + Symbol: + Symbole: + + + Library: + Bibliotèque: + + + Source code: + Code source: + + + Column + Colonne + + + Type + Type + + + Name + Nom + + + Mode + Mode + + + Default Value + Valeur par défaut + + + Si&mple + + + + Tab&le + + + + + GeneralConfigWidget + + Form + Formulaire + + + Milimeters + Millimètres + + + Pixels + Pixels + + + Inches + Pouces + + + Centimeter + Centimètres + + + A0 (841 x 1189 mm) + A0 (841 x 1189 mm) + + + General && Design + Général && modélisation + + + The opened models will be saved periodically + Les modèles ouverts seront sauvegardés à interval régulier + + + Check if there is a new version on server + Vérifier la présence d'une nouvelle version au lancement + + + Design + Modélisation + + + Graphical objects (table, views and textboxes) will be created in a single step without the need to click on canvas + Les nouveaux objets graphiques (tables, vues, zones de textes) seront ajoutés au modèle sans avoir besoin d'effectuer un second clic sur le caneva pour les positionner + + + Simplify creation of graphical objects + Créer les nouveaux objets en un clic + + + After loading the model the last zoom and position on canvas will be restored + Restaure la dernière position ainsi que le zoom sur le caneva à l'écran lors de l'ouverture d'un modèle + + + Save and restore last position and zoom + Sauvegarder la position et le zoom + + + Disable antialiasing for lines and texts improving performance on huge models (requires restart) + Désactive l'anticrénelage pour les lignes et les textes afin d'améliorer la réactivité de l'application sur des modèles très etoffés (nécessite un redémarrage) + + + Disable render smoothness + Désactiver l'anticrénelage + + + Hide the object that represents the relationship name + Masque l'étiquette indiquant le nom de chaque association + + + Operations like save, export and diff will be executed without asking user to validate the model + Certaines opérations comme l'enregistrement du fichier, l'export ou encore le différenetiel seront lancées sans demander à l'utilisateur de valider le modèle avant + + + Validate before save, export or diff + Validation du modèle toujours requise + + + Hide the object which represents the tag assigned to the table + Masque l'étiquette indiquant le tag associé à chaque table + + + Hide the portion of table which represent triggers, indexes and rules + Masque les règles, les déclencheurs et les index dans l'affichage des tables + + + Swap panning and range selection triggers + Inverser le comportement du clic gauche + + + Toggles the code completion in all fields that accepts the input of SQL commads. + Active la complétion du code SQL dans les zones de texte prévues à cet effet. + + + Enable SQL code completion + Activer la complétion du code SQL + + + Printing && Code + Impression && édition + + + A1 (594 x 841 mm) + A1 (594 x 841 mm) + + + A2 (420 x 594 mm) + A2 (420 x 594 mm) + + + A3 (297 x 420 mm) + A3 (297 x 420 mm) + + + A4 (210 x 297 mm) + A4 (210 x 297 mm) + + + A5 (148 x 210 mm) + A5 (148 x 210 mm) + + + A6 (105 x 148 mm) + A6 (105 x 148 mm) + + + A7 (74 x 105 mm) + A7 (74 x 105 mm) + + + A8 (52 x 74 mm) + A8 (52 x 74 mm) + + + A9 (37 x 52 mm) + A9 (37 x 52 mm) + + + B0 (1030 x 1456 mm) + B0 (1030 x 1456 mm) + + + B1 (728 x 1030 mm) + B1 (728 x 1030 mm) + + + B10 (32 x 45 mm) + B10 (32 x 45 mm) + + + B2 (515 x 728 mm) + B2 (515 x 728 mm) + + + B3 (364 x 515 mm) + B3 (364 x 515 mm) + + + B4 (257 x 364 mm) + B4 (257 x 364 mm) + + + B5 (182 x 257 mm) + B5 (182 x 257 mm) + + + B6 (128 x 182 mm) + B6 (128 x 182 mm) + + + B7 (91 x 128 mm) + B7 (91 x 128 mm) + + + B8 (64 x 91 mm) + B8 (64 x 91 mm) + + + B9 (45 x 64 mm) + B9 (45 x 64 mm) + + + C5E (163 x 229 mm) + C5E (163 x 229 mm) + + + Comm10E (105 x 241 mm) + Comm10E (105 x 241 mm) + + + DLE (110 x 220 mm) + DLE (110 x 220 mm) + + + Executive (191 x 254 mm) + Executive (191 x 254 mm) + + + Folio (210 x 330 mm) + Folio (210 x 330 mm) + + + Ledger (432 x 279 mm) + Ledger (432 x 279 mm) + + + Legal (216 x 356 mm) + Legal (216 x 356 mm) + + + Letter (216 x 279 mm) + Lettre (216 x 279 mm) + + + Tabloid (279 x 432 mm) + Tabloid (279 x 432 mm) + + + Code font style + Style de police pour le code SQL + + + Size: + Taille: + + + pt + pt + + + Font: + Police: + + + Hide relationship name + Masquer le nom des associations + + + Hide table extended attributes + Masquer les attributs étendus des tables + + + Paper: + Papier: + + + Orientation: + Orientation: + + + Autosave interval: + Interval d'auto-enregistrement: + + + Grid size: + Taille de la grille: + + + General + Général + + + Check for updates at startup + Vérifier MAJ au démarrage + + + Operation history: + Historique des opérations: + + + By default panning mode is triggered with left click and range selection with Shift + left click. + Par défaut : le clic gauche permet de déplacer le canevas (glisser-déplacer), la sélection multiple (rectangle) s'effectue par Shift + clic gauche. + + + Hide table tags + Masquer le tag des tables + + + Printing + Impression + + + Options: + Options: + + + Print grid + Imprimer la grille + + + Custom + Personalisé + + + Unity: + Unité: + + + Custom Size: + Taille papier: + + + Width: + Largeur: + + + Height: + Hauteur: + + + Page Margins: + Marges de la page: + + + Left: + Gauche: + + + Left margin + Marge gauche + + + Top: + Haut: + + + Top margin + Marge haute + + + Right: + Droite: + + + Right margin + Marge droite + + + Bottom: + Bas: + + + Bottom margin + Marge basse + + + Landscape + Paysage + + + Portrait + Portrait + + + Print page numbers + Imprimer les numéros de page + + + minute(s) + minute(s) + + + items + entrées + + + pixels + pixels + + + Start move the canvas when the cursor is on the canvas edges + + + + Move canvas by keep mouse on corners + + + + Disable antialiasing for lines and texts improving performance when handling huge models. + + + + Triggers a dialog asking the user to validate the model before a save, export or diff operation. + + + + When enabled this option creates a placeholder object at the previous table's position when starting to move it. This will cause graphical updates on relationship lines to be performed only when the drag & drop action is done improving the performance. Disabling placeholders will cause those updates to be executed every time the table's position changes a single pixel (classical behavior). + + + + Use placeholders when moving tables + + + + Toggles the code completion in all fields that accepts the input of SQL commands. + + + + Code style + + + + Colors: + Couleur: + + + Display line numbers + + + + Highlight lines at cursor's position + + + + Custom tab width: + + + + Line numbers' font color + + + + Line numbers' background color + + + + Highlighted line color + + + + The little brown fox jumps over the lazy dog + + + + + GraphicalView + + Connected rels: %1 + Associations : %1 + + + + HintTextWidget + + Form + Formulaire + + + + IndexWidget + + Form + Formulaire + + + Attributes + Attributs + + + Indexing: + Indexation: + + + Fill Factor: + Taux de remplissage: + + + Options: + Options: + + + Concurrent + Concurrent + + + Unique + Unique + + + Fast update + Mise à jour rapide + + + Elements + Élements + + + Buffering + + + + Predicate: + + + + + LanguageWidget + + Form + Formulaire + + + Trusted: + De confiance: + + + The functions to be assigned to the language should have, respectively, the following signatures:<br/><br/> <strong>Handler Function:</strong> <em>language_handler function()</em><br/> <strong>Validator Function:</strong> <em>void function(oid)</em><br/> <strong>Inline Function:</strong> <em>void function(internal)</em> + Les fonctions attribuées au langage doivent avoir espectivement les signatures suivantes:<br/><br/> <strong>Fonction de management:</strong> <em>language_handler fonction()</em><br/> <strong>Fonction de validation:</strong> <em>void fonction(oid)</em><br/> <strong>Fonction Inline:</strong> <em>void fonction(internal)</em> + + + Validator Func.: + + + + Handler Func.: + + + + Inline Func.: + + + + + MainWindow + + pgModeler - PostgreSQL Database Modeler + pgModeler - PostgreSQL Database Modeler + + + &File + &Fichier + + + &Edit + Édit&ion + + + &Show + &Affichage + + + &Plugins + E&xtensions + + + Plugins + Extensions + + + New + Nouveau + + + Controls + Contrôles + + + General + Général + + + Ctrl+N + Ctrl+N + + + Save + Enregistrer + + + Ctrl+S + Ctrl+S + + + Zoom in + Zoom + + + + Ctrl+= + Ctrl+= + + + Zoom out + Zoom - + + + Zoom - + Zoom - + + + Ctrl+- + Ctrl+- + + + Load + Ouvrir + + + Ctrl+O + Ctrl+O + + + Next + Suivant + + + Ctrl+Right + Ctrl+Right + + + Previous + Précédent + + + Ctrl+Left + Ctrl+Left + + + Save as + Enregistrer sous + + + Exit + Quitter + + + Ctrl+Q + Ctrl+Q + + + About pgModeler + À propos de pgModeler + + + Export the current opened model in different modes + Exporter le modèle courant sous différentes formes + + + Close + Fermer + + + Close current model + Fermer le modèle courant + + + Ctrl+H + Ctrl+H + + + Settings + Paramètres + + + Edit pgModeler settings + Configurer pgModeler + + + F10 + F10 + + + Wiki + Wiki + + + Access the wiki pages + Visiter le wiki (site) + + + CSS + CSS + + + Access the list of loaded plugins + Accéder a la liste des extensions chargées + + + Recent Models + Modèles récents + + + Load recently opened model + Charger des modèles ouverts récemment + + + Import + Importer + + + Import existing database to new model (reverse engineering) + Importer une base de données existante vers un modèle (reverse engineering) + + + Ctrl+Shift+I + Ctrl+Shift+I + + + Restore Session + Restaurer la session + + + Fix a model + Réparer un modèle + + + New version found! + Nouvelle version disponible! + + + Update for the current version is available on project's site + Une mise à jour pour votre version est disponible sur le site de pgModeler + + + Check for update + Vérifier les mises à jour + + + Main menu + Menu principal + + + Show expanded + Afficher la barre de menus + + + Hide main menu + Cacher la barre de menus + + + Hides the main menu bar and put the action on a separated action + Masque la barre de menu (le menu reste accessible via un bouton dans la barre d'outils) + + + Ctrl+Shift+H + Ctrl+Shift+H + + + Diff + Différencier + + + Determine the changes between model and database + Déterminer les modifications apportées entre un modèle et une base existante + + + Welcome + Accueil + + + Welcome screen + Écran d'accueil + + + Design + Modéliser + + + Design datase models + Modéliser une base de données + + + Manage + Administrer + + + Manage existent databases + Administrer des bases existantes + + + Bug report + Rapporter un bug + + + F1 + F1 + + + O&bjects + O&bjets + + + Alt+B + Alt+B + + + &Validation + &Validation + + + Alt+V + Alt+V + + + &Operations + &Opérations + + + Alt+O + Alt+O + + + Find Object + Chercher un objet + + + Ctrl+F + Ctrl+F + + + msg + message + + + Help + Aide + + + F4 + F4 + + + Print + Imprimer + + + Ctrl+P + Ctrl+P + + + Undo + Annuler + + + Ctrl+Z + Ctrl+Z + + + Redo + Rétablir + + + Ctrl+Y + Ctrl+Y + + + Export + Exporter + + + Ctrl+Shift+S + Ctrl+Shift+S + + + Show grid + Afficher la grille + + + Ctrl+G + Ctrl+G + + + Ctrl+W + Ctrl+W + + + Normal zoom + Zoom normal + + + Ctrl+0 + Ctrl+0 + + + Align to grid + Aligner sur la grille + + + Align objects position to grid + Aligner les objets sur la grille + + + Show delimiters + Afficher les délimiteurs + + + Show the page delimiters + Afficher les délimiteurs de page + + + Ctrl+L + Ctrl+L + + + Save all + Tout enregistrer + + + Overview + Vue d'ensemble + + + Show the model overview + Afficher la vue d'ensemble du modèle + + + Save all models + Enregistrer tous les modèles + + + Clear Menu + Vider cette liste des modèles récents + + + The demonstration version can create only `one' instance of database model! + La version de démonstration ne peut gérer qu'un seul modèle de base à la fois ! + + + Save model + Enregistrer le modèle + + + Warning + Avertissement + + + Save '%1' as... + Enregistrer '%1' sous... + + + Database model (*.dbm);;All files (*.*) + Modèle de base de données (*.dbm);; Tous les fichiers (*.*) + + + Database model printing + Impression du modèle de base de données + + + Confirmation + Confirmation + + + Some models were modified! Do you really want to quit pgModeler without save them? + Des modifications n'ont pas été enregistrées ! Êtes-vous sûr de vouloir QUITTER pgModeler SANS SAUVEGARDER ? + + + The model was modified! Do you really want to close without save it? + Le modèle a été modifié. +Voulez-vous vraiment le FERMER SANS le SAUVEGARDER? + + + Save anyway + Sauvegarder quand même + + + Validate + Valider + + + Changes were detected in the definitions of paper/margin of the model which may cause the incorrect print of the objects. Do you want to continue printing using the new settings? To use the default settings click 'No' or 'Cancel' to abort printing. + Des modifications ont été détectées dans les définitions du papier ou des marges du modèle ce qui pourrait causer une mauvaise impression des objets. Souhaitez vous continuer l'impression avec les nouveaux paramètres? Pour utiliser les paramètres par défaut cliquez sur 'Non' ou 'Annuler' pour interrompre l'impression. + + + Load model + Charger un modèle + + + Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again. + Impossible de charger le modèle `%1'. Consultez la pile d'appel pour plus de détails. Essayez de réparer le modèle pour tenter de l'ouvrir à nouveau. + + + Fix model + Réparer un modèle + + + Cancel + Annuler + + + Open Wiki pages + Accèder au Wiki + + + This action will open a web browser window! Want to proceed? + Cette action ouvrira votre navigateur web! Souhaitez vous continuer? + + + Toggle the model objects widget + + + + Toogle the model validation widgets + + + + Toggle the operation history widget + + + + Toggle the object finder + + + + action_main_menu + + + + Expands the main menu bar in classical mode + + + + (Demo) + + + + Saving temp. models + + + + You're running a demonstration version! The model saving feature is available only in the full version! + + + + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! It's recommended to validate it before save in order to create a consistent model otherwise the generated file will be broken demanding manual fixes to be loadable again! + <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de l'enregistrer il est recommandé de le valider afin de créer un modèle cohérent, sinon il peut en résulter un fichier mal formé nécessitant une édition manuelle pour pouvoir être chargé à nouveau dans l'application par la suite ! + + + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the export process it's recommended to validate in order to correctly create the objects on database server! + <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de procéder à un export il est recommandé de valider le modèle afin s'assurer de créer correctement les objets en base ! + + + Export anyway + Exporter quand même + + + <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the diff process it's recommended to validate in order to correctly analyze and generate the difference between the model and a database! + <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de procéder à un différentiel il est recommandé de valider le modèle afin s'assurer que l'analyse entre celui-ci de la base de donnée se fasse correctement ! + + + Diff anyway + Différencier quand même + + + (no samples found) + + + + save + + + + export + + + + diff + + + + Executing pending <strong>%1</strong> operation... + + + + He&lp + + + + Pl&ugins + + + + &New + + + + New model + Nouveau modèle + + + &Save + E&nregistrer + + + &Zoom in + + + + Zoo&m out + + + + &Load + O&uvrir + + + Sa&ve as + + + + E&xit + + + + Exit pgModeler + + + + &About pgModeler + + + + &Print + + + + Print model + + + + &Undo + + + + Undo operation + + + + &Redo + + + + Redo operation + + + + &Export + &Exporter + + + Ctrl+Shift+E + + + + &Show grid + + + + &Close + &Fermer + + + &Normal zoom + + + + &Align to grid + + + + Show &delimiters + + + + &Settings + + + + F12 + F12 + + + &Overview + + + + &Support + + + + Access the support page + + + + New object + + + + &Recent Models + + + + &Import + &Importer + + + Rest&ore Session + + + + &Fix a model + + + + &Check for update + + + + &Diff + + + + Ctrl+Shift+D + + + + Shift+W + + + + Design database models + + + + Shift+D + + + + Shift+M + + + + &Bug report + + + + Report a bug + + + + Donate + + + + Help pgModeler by donating! + + + + Objects me&tadata + + + + Objects metadata + + + + Save modified model(s) + + + + The following models were modified but not saved: %1. Do you really want to quit pgModeler? + + + + The model <strong>%1</strong> was modified! Do you really want to close without save it? + + + + Access support page + + + + You're running a demonstration version! Note that you'll be able to create only <strong>%1</strong> instances of each type of object and some key features will be disabled or limited!<br/><br/>You can purchase a full binary copy or get the source code at <a href='http://pgmodeler.com.br'>pgmodeler.com.br</a>. <strong>NOTE:</strong> pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and cover all development costs.<br/><br/> <strong>HINT:</strong> in order to test all features it's recommended to use the <strong>demo.dbm</strong> model located in </strong>Sample models</strong> at <strong>Welcome</strong> view.<br/><br/><br/><br/> + + + + + Messagebox + + Dialog + Boîte de dialogue + + + msg + message + + + Exceptions + Exceptions + + + Show/hide exceptions stack. + Afficher/cacher la pile d'exceptions. + + + ... + ... + + + &Yes + &Oui + + + &No + &Non + + + Cancel + Annuler + + + Error + Erreur + + + Alert + Alerte + + + Information + Information + + + Confirmation + Confirmation + + + &Ok + &Ok + + + &Cancel + A&nnuler + + + Show raw text errors or information. + + + + + MetadataHandlingForm + + Handle metadata + + + + &Apply + &Appliquer + + + &Cancel + A&nnuler + + + Handle objects metadata + + + + Settings + Paramètres + + + Extract from: + + + + Loading a metadata file to the current model is an irreversible operation so be sure to specify a backup file before proceed. + + + + Options + Options + + + Handles the following database model attributes in the metadata file: author, zoom factor, last position and default objects. + + + + Database model metadata + + + + Handles the objects' positioning in the metadata file. + + + + Objects' positioning + + + + Handles the objects' custom colors in the metadata file. Currently available only for relationships and schemas. + + + + Custom object's colors + + + + Handles the objects' protection status in the metadata file. + + + + Objects' protection status + + + + Handles the objects' SQL disabled status in the metadata file. + + + + Objects' SQL disabled status + + + + Handles the objects' custom SQL commands in the metadata file. + + + + Custom SQL commands + + + + Save textboxes to the output file when extracting metadata. When loading the file textboxes are recreated and duplicated ones are ignored. + + + + Textbox objects + + + + Save tags to the output file when extracting metadata. When loading the file tags are recreated and duplicated ones are ignored. + + + + Tag objects + + + + Backup file: + + + + Select file + + + + ... + ... + + + Apply to: + + + + Operation: + + + + Extracts the objects metadata from one of the loaded models and apply to the current model. + + + + Extract from a &model + + + + Reads the objects metadata from a previously saved backup file and apply to the current model. + + + + Restore a bac&kup file + + + + Output + + + + Progress label... + Indicateur de progression... + + + model not saved yet + + + + The backup file cannot be the same as the input model! + + + + Extracting metadata to file `%1' + + + + Saving backup metadata to file `%1' + + + + Applying metadata from file `%1' + + + + Metadata processing aborted! + + + + Objects metadata file (*.omf);;All files (*.*) + + + + + ModelDatabaseDiffForm + + Settings + Paramètres + + + Connection: + Connexion: + + + Connect and list available databases + Connecter et lister les bases de données disponibles + + + ... + ... + + + Ignore import errors + Ignorer les erreurs + + + Import system objects + Importer les objets système + + + Import extension objects + Importer les objets des extensions + + + File: + Fichier: + + + Select output file + Sélectionner un fichier de sortie + + + Cancel + Annuler + + + Progress label... + Indicateur de progression... + + + 0 + 0 + + + &Close + &Fermer + + + Waiting process to start... + En attente... + + + Confirmation + Confirmation + + + SQL code (*.sql);;All files (*.*) + Code SQL (*.sql);;Tous les fichiers (*.*) + + + Database model diff + + + + Generate diff from model + + + + Input database + + + + Database: + + + + Options + + + + Trucate tables before alter columns + + + + For DROP command, the objects that depends on an object to be dropped will be deleted as well. For TRUNCATE command, tables that are linked to a table to be truncated will be truncate too. <strong>NOTE:</strong> this option can affect more objects than listed in the output or diff preview. + + + + Drop or truncate in cascade mode + + + + Permissions already set on database objects will be kept.The ones configured on the model will be applied to the database. + + + + Keep object's permissions + + + + Database cluster level objects like roles and tablespaces will not be dropped. + + + + Keep cluster objects + + + + Recreate only unmodifiable objects + + + + Force recreation of objects + + + + Ignores errors generated by duplicated objects when exporting the diff to database. + + + + Ignore duplicity errors + + + + Serial columns are converted to integer and having the default value changed to <strong>nextval(sequence)</strong> function call. By default, a new sequence is created for each serial column but checking this option sequences matching the name on column's default value will be reused and will not be dropped. + + + + Reuse sequences on serial columns + + + + Diff mode + + + + Override the PostgreSQL version when generating the diff. The default is to use the same version as the input database. + + + + Use PostgreSQL: + + + + Compares the model and the input database storing the diff in a SQL file for later usage. + + + + Compares the model and the input database generating a diff and applying it directly to the latter. <strong>WARNING:</strong> this mode causes irreversible changes on the database and in case of failure the original structure is not restored, so make sure to have a backup before proceed. + + + + Output + + + + Changes: + + + + Step label... + + + + <html><head/><body><p>Objects marked with an <span style=" font-weight:600;">ALTER</span> may not be effectively changed unless that the differences detected are in attributes that can be modified through ALTER commands otherwise no operationwill be performed or, if the force recreation is checked, the object will be dropped and created again.</p></body></html> + + + + Objects to be created + + + + Objects to be dropped + + + + Possible objects to be changed + + + + Ignored objects (system ones or with sql disabled) + + + + Diff Preview + + + + &Apply diff + + + + &Generate + + + + Importing database <strong>%1</strong>... + + + + Comparing the model <strong>%1</strong> and database <strong>%2</strong>... + + + + <strong>WARNING:</strong> The generated diff is ready to be exported! Once started this process will cause irreversible changes on the database. Do you really want to proceed? + + + + Apply diff + + + + Preview diff + + + + Exporting diff to database <strong>%1</strong>... + + + + Diff process paused. Waiting user action... + + + + Saving diff to file <strong>%1</strong> + + + + Diff process sucessfully ended! + + + + No operations left. + + + + Operation cancelled by the user. + + + + Process aborted due to errors! + + + + -- No differences were detected between model and database. -- + + + + Error code <strong>%1</strong> found and ignored. Proceeding with export. + Code erreur <strong>%1</strong> reçu et ignoré. Poursuite de l'export. + + + Save diff as... + + + + Ignores as many as possible errors on import step. This option generates an incomplete diff. + + + + Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. + + + + Import system (built-in) objects. Use this if the import step is returning errors related to missing objects. + + + + Import objects created by extensions. Use this if the import step is returning errors even importing built in ones. + + + + Instead of use an ALTER command to modify certain kind of objects a DROP and CREATE will be used in order to do a full modification. This option does not affects the database object. + + + + No command to rename the destination database will be generated even the model's name differ from database name. + + + + Preserve database name + + + + Avoid the generation of DROP commands for objects that exists in database but not in the model. This is useful when diff a partial model against the complete database. + + + + Do not drop missing objects + + + + Store in S&QL file + + + + Appl&y on server + + + + + +-- SQL code purposely truncated at this point in demo version! + + + + + ModelExportForm + + Model Export + Export du modèle + + + File: + Fichier: + + + Select target file + Sélectionner le fichier cible + + + ... + ... + + + Zoom: + Zoom: + + + Export model + Exportation d'un modèle + + + Settings + Paramètres + + + Database server + Serveur de base de données + + + pgModeler ignores errors generated by duplicated objects and creates only that ones which does not exists in the database. This option may be used when an object was created after a previous model export. + pgModeler ignorera les erreurs générées en raison d'objets dupliqués et ne créera uniquement ceux qui n'existent pas déjà en base. Cette option peut être utile lorsqu'un objet est créé après un précédent export. + + + PostgreSQL version in which the SQL code should be generated. It is recommended to select this option only when the version of the DBMS, somehow, is not identifiable or if you need to generate a specific version of SQL code for test purposes. + Version de PostgreSQL pour laquelle le code SQL sera généré. Il est recommandé d'activer cette option uniquement si la version du SGBD n'est pas identifiable ou pour une raison spécifique par exemple pour des essais. + + + If <strong>DB</strong> is checked pgModeler will destroy the database if already exists on the server. When <strong>Objects</strong> is checked pgModeler will execute the DROP command attached to SQL-enabled objects. <strong>WARNING:</strong> this option leads to data loss so make sure to have a backup first. + Si <strong>BDD</strong> est coché pgModeler procèdera à la suppression complète de la base de données si elle existe déjà. Lorsque <strong>Objets</strong> est coché pgModeler effectuera la commande DROP rattachée à l'objet (si la génération du code SQL pour cet objet n'a pas été désactivée dans ses propriétés) <strong>AVERTISSEMENT:</strong> cette option engendre la perte de données, pensez à faire une sauvegarde avant. + + + Drop: + Ordre SQL intuitif + Drop: + + + DB + BDD + + + Objects + Objets + + + PNG Image + Image PNG + + + Show delimiters + Afficher les délimiteurs de page + + + Exporting the model page by page will generate files with a <strong>_p[n]</strong> suffix where <strong>n</strong> is the page id. Check if the current user has write permission on output folder. + Exporter le modèle page par page génèrera des fichiers avec un suffixe de type <strong>_p[n]</strong> où <strong>n</strong> est le numéro de la page. Vérifiez que vous avez bien le droit d'écriture dans le dossier de sortie. + + + Page by page + Une image par page + + + PostgreSQL: + PostgreSQL: + + + PostgreSQL version in which the SQL code should be generated + Version de PostgreSQL pour laquelle le code SQL doit être généré + + + Cancel + Annuler + + + pgModeler will destroy the database if already exists on the server. Make sure to have a backup before use this option because all data will be lost. + pgModeler détruira la base de données si elle existe déjà sur le serveur. Assurez-vous d'avoir une sauvegarde si besoin avant car les données seront définitivement perdues. + + + Image: + Image: + + + Show grid + Afficher la grille + + + Connection: + Connexion: + + + Ignore object duplicity + Ignorer les objets dupliqués + + + SQL file + Fichier texte SQL + + + Output + Progression + + + Progress label... + Indicateur de progression... + + + &Export + &Exporter + + + &Close + &Fermer + + + Initializing model export... + Initialisation de l'exportation du modèle... + + + Saving file '%1' + Enregistrement du fichier '%1' + + + Exporting process aborted! + Processus d'exportation terminé en erreur! + + + Exporting process canceled by user! + Processus d'exportation annulé par l'utilisateur! + + + Exporting process sucessfuly ended! + Processus d'exportation terminé avec succès! + + + Export model as... + Exporter le modèle sous... + + + Error code <strong>%1</strong> found and ignored. Proceeding with export. + Code erreur <strong>%1</strong> reçu et ignoré. Poursuite de l'export. + + + SQL code (*.sql);;All files (*.*) + Fichiers SQL (*.sql);;Tous les fichiers (*.*) + + + PNG image (*.png);;All files (*.*) + Image PNG (*.png);;Tous les fichiers (*.*) + + + Ob&jects + + + + Graphics file + + + + Image (PNG) + + + + Type: + Type: + + + Vectorial (SVG) + + + + SQL script (*.sql);;All files (*.*) + + + + Portable Network Graphics (*.png);;All files (*.*) + + + + Scalable Vector Graphics (*.svg);;All files (*.*) + + + + + ModelExportHelper + + Generating SQL code for PostgreSQL `%1' + + + + Output SQL file `%1' successfully written. + + + + Rendering objects to page %1/%2. + + + + Output image `%1' successfully written. + + + + Starting export to DBMS. + + + + PostgreSQL version detection overridden. Using version `%1'. + + + + PostgreSQL `%1' server detected. + + + + Generating temporary names for database, roles and tablespaces. + + + + Enabling the SQL code for database `%1' to avoid errors. + + + + Ignoring object duplication errors. + + + + Ignoring the following error code(s): `%1'. + + + + Trying to drop database `%1'. + + + + Simulation mode activated. + + + + Generating SQL for `%1' objects... + + + + Destroying objects created on the server. + + + + Restoring original names of database, roles and tablespaces. + + + + Creating object `%1' (%2) + + + + Dropping object `%1' (%2) + + + + Changing object `%1' (%2) + + + + Running auxiliary command. + + + + Exporting model to SVG file. + + + + SVG representation of database model + + + + SVG file generated by pgModeler + + + + Output file `%1' successfully written. + + + + Creating database `%1' + + + + Connecting to database `%1' + + + + Renaming `%1' (%2) to `%3' + + + + + ModelFixForm + + Model file fix + Réparer un fichier modèle + + + &Fix + &Réparer + + + &Close + &Fermer + + + Fix model file + Réparer un modèle + + + <html><head/><body><p>[pgmodeler-cli not found error]</p></body></html> + <html><head/><body><p>[pgmodeler-cli not found error]</p></body></html> + + + pgmodeler-cli: + pgmodeler-cli: + + + Browse for pgmodeler-cli tool + Rechercher l'outil pgmodeler-cli + + + ... + ... + + + The specified file is not the pgModeler command line tool (pgmodeler-cli). + Ce fichier n'est pas l'outil en ligne de commande de pgModeler (pgmodeler-cli). + + + Input file: + Fichier source: + + + Output file: + Fichier cible: + + + Fix tries: + Tentatives: + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Waiting process to start...</p></body></html> + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">En attente...</p></body></html> + + + Select input file + Sélectionner le modèle à réparer + + + Select output file + Sélectionner un fichier de sortie + + + Load fixed model when finish + Charger le modèle réparé une fois l'opération terminée + + + In some cases the fix process will fail to restore all objects within the model demanding manual fixes by changing the file on a text editor. <strong>NOTE:</strong> relationships may lost their graphical configuration like custom points and line color. + Dans certains cas, le processus de réparation peut échouer à restaurer et récupérer tous les objets du modèle, ce qui peut réclamer des modifications manuelles dans le fichier à partir d'un éditeur de texte. <strong>REMARQUE:</strong> les associations peuvent perdre leur configuration graphique tels que des points placés manuellement par l'utilisateur ou la couleur. + + + Waiting process to start... + En attente... + + + Could not locate <strong>%1</strong> tool on <strong>%2</strong>. The fix process can't continue! Please check pgModeler installation or try to manually specify the command below. + Impossible de localiser l'outil <strong>%1</strong> dans <strong>%2</strong>. Impossible de continuer ! Veuillez vérifier votre installation de pgModeler ou alors spécifiez l'emplacement de l'outil. + + + pgModeler command line tool (%1) + Outil en ligne de commande de pgModeler (%1) + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Monospace'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Waiting process to start...</span></p></body></html> + + + + + ModelNavigationWidget + + Form + Formulaire + + + Previous model + Modèle précédent + + + Ctrl+Up + Ctrl+Haut + + + Next model + Modèle suivant + + + Ctrl+Down + Ctrl+Bas + + + Close model + Fermer + + + ... + ... + + + (model not saved yet) + (modèle pas encore sauvegardé) + + + Ctrl+Left + Ctrl+Left + + + Ctrl+Right + Ctrl+Right + + + Alt+C + + + + + ModelObjectsWidget + + Model Objects + Objets du modèle + + + Hide this widget + Cacher ce widget + + + 1 + 1 + + + Object + Objet + + + Type + Type + + + Parent Object + Objet parent + + + Parent Type + Type parent + + + Visible Object Types + Afficher les objets des types suivants + + + Select All + Tout sélect. + + + Clear All + Tout effacer + + + Select + Sélectionner + + + Return + Retour + + + Cancel + Annuler + + + Esc + Échap. + + + Objects view configuration + Filtres d'affichage des objets + + + Expands all items + Développer tous les éléments + + + Collapses all items + Replier tous les éléments + + + Filter: + Filtrer: + + + ... + ... + + + Tree view + Vue en arbre + + + List view + Vue en liste + + + New + Nouveau + + + ID + ID + + + By ID + + + + + ModelOverviewWidget + + Model overview + Vue générale du modèle + + + + ModelRestorationForm + + Model restoration + Restauration de modèle + + + &Restore + &Restaurer + + + &Cancel + A&nnuler + + + Modified: %1 + Modifié: %1 + + + pgModeler was not closed properly in a previous execution and some models were still being edited. Click <strong>Restore</strong> to reopen the models or <strong>Cancel</strong> to abort the restoration. + + + + pgModeler will try to recover the selected models but will not destroy them in case of loading failure. This option serves as a last resort in order to try to recover the database model. Temporary models will last until the application is closed so the user must try to manually recover the files before exit pgModeler. + + + + Keep temporary models in case of restoration failure + + + + Database + Base de données + + + File + + + + Modified + + + + Size + + + + + ModelValidationHelper + + There are pending errors! SQL validation will not be executed. + + + + Operation canceled by the user. + + + + + ModelValidationWidget + + Form + Formulaire + + + 0 + 0 + + + Try to apply a fix on the selected validation info. + Essayer d'appliquer le correctif sur l’élément sélectionné. + + + Clear validation results + Effacer le résultat de la validation + + + Va&lidate + Va&lider + + + Warnings: does not prevents model to be saved. + Avertissements: n'empêche de pouvoir sauvegarder le modèle. + + + Errors: model will not be saved while there are validation errors. + Erreurs: le modèle ne peut être sauvegardé tant que des erreurs de validation subsistent. + + + Use unique temporary names for database, role and tablespace objects + Utiliser des noms uniques et temporaires pour la base, les rôles et les tablespaces + + + SQL Validation: + Validation SQL: + + + Connection alias + Alias de la connexion + + + PostgreSQL version + Version de PostgreSQL + + + SQL validation, if enabled, will occur only on the last step or when there are no warnings. + Validation SQL, si activée, ne sera déclenchée qu'à la fin ou uniquement s'il n'y a pas d'avertissements. + + + Using temporary names will avoid object duplication errors when running the SQL validation. + Utiliser des noms temporaires évite les erreurs dues aux objets dupliqués lors de la validation SQL. + + + Try to resolve the reported issues. + Essayer de résoudre les problèmes rencontrés. + + + Ctrl+S + Ctrl+S + + + Clear + Effacer + + + Options + Options + + + Cancel the SQL validation in progress. + Annuler le processus de validation SQL en cours. + + + Cancel + Annuler + + + Esc + Échap + + + Change the creation order for two objects by swapping their ids + Modifie l'ordre de création de deux objets en échangeant leurs numéros d'identification + + + Swap Ids + Echanger identifiants + + + Enable validation of SQL code on DBMS (requires connection) + Activer la validation SQL sur le serveur (requiert une connexion) + + + Apply Fix + Appliquer le correctif + + + Hide this widget + Fermer ce widget + + + ... + ... + + + The object <strong>%1</strong> <em>(%2)</em> [id: %3] is being referenced by <strong>%4</strong> object(s) before its creation. + L'objet <strong>%1</strong> <em>(%2)</em> [id: %3] est référencé par <strong>%4</strong> objet(s) avant sa création. + + + Autodetect + Auto détection + + + The object <strong>%1</strong> <em>(%2)</em> [id: %3]%4 is referencing columns created by <strong>%5</strong> relationship(s) but is created before them. + L'objet <strong>%1</strong> <em>(%2)</em> [id: %3]%4 a pour référence des colonnes créées par <strong>%5</strong> association(s) but is created before them. + + + The object <strong>%1</strong> <em>(%2)</em> has a name that conflicts with <strong>%3</strong> object's name(s). + Le nom de l'objet <strong>%1</strong> <em>(%2)</em> entre en conflit avec l'objet<strong>%3</strong>. + + + Database model sucessfully validated. + Modèle de données validé avec succès. + + + Running SQL validation... + Validation SQL en cours... + + + Processing object: %1 + Traitement de l'objet: %1 + + + Conflicting object: <strong>%1</strong> <em>(%2)</em>. + Objet en conflit: <strong>%1</strong> <em>(%2)</em>. + + + Referrer object: <strong>%1</strong> <em>(%2)</em> [id: %3]. + Seconde lecture ? + Objet réferent: <strong>%1</strong> <em>(%2)</em> [id: %3]. + + + SQL validation failed due to error(s) below. <strong>NOTE:</strong><em> These errors does not invalidates the model but may affect operations like <strong>export</strong> and <strong>diff</strong>.</em> + + + + <em>The above object was created by a relationship. Change the name pattern on it's generator relationship. Fix will not be applied!</em> + + + + Relationship: <strong>%1</strong> [id: %2]. + + + + Running SQL commands on server... + Execution des commandes SQL sur le serveur... + + + Enables the validation of SQL code in DBMS. This process requires the use of a pre-configured connection. SQL validation will occur only in the last step (when all objects were validated) or when there are no warnings. + + + + Connection to be used in the SQL validation + + + + pgModeler will generate unique and temporary names for database, role and tablespace objects. This option avoids object duplication errors when running the SQL validation. + + + + Use unique temporary names for cluster level objects + + + + The relationship <strong>%1</strong> [id: %2] is in a permanent invalidation state and needs to be relocated. + + + + <strong>HINT:</strong> try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process. + + + + SQL validation not executed! No connection defined. + + + + Database model successfully validated. + + + + + ModelWidget + + Copy + Copier + + + Generalization + Généralisation + + + Convert + Convertir + + + New + Nouveau + + + Quick + Act. rapides + + + Source code + Code source + + + Show object source code + Afficher le code source de l'objet + + + Source + Source + + + Properties + Propriétés + + + Space + Espace + + + Edit the object properties + Editer les propriétés de l'objet + + + Protect + Vérrouiller + + + Unprotect + Déverrouiller + + + Protects object(s) from modifications + Empêcher l(es)'objet(s) d'être modifiés + + + Delete + Supprimer + + + Shift+Del + Shift+Suppr + + + Select all + Tout sélect. + + + Selects all the graphical objects in the model + Sélectionner tous les objets graphiques du modèle + + + Paste + Coller + + + Cut + Couper + + + Deps && Referrers + Dép. && Rèf. + + + Add a new object in the model + Ajouter un nouvel objet dans le modèle + + + Rename + Renommer + + + Quick rename the object + Renommage rapide de l'objet + + + Move to schema + Déplacer vers le schema + + + Edit permissions + Editer les permissions + + + Change owner + Changer le propriétaire + + + Select children + Sélectionnez les éléments + + + Highlight + Mettre en avant + + + Del + Suppr + + + Ctrl+A + Ctrl+A + + + F2 + F2 + + + Custom SQL + Code SQL Libre + + + Alt+Q + Alt+Q + + + Loading database model + Ouverture du modèle de base de données + + + Saving database model + Enregistrement du modèle de base de données + + + Also copy all dependencies of selected objects? This minimizes the breakdown of references when copied objects are pasted into another model. + Copier également les dépendences des objets sélectionnés? Ceci minimise la perte des références lorsque les objets copiés sont collés dans un autre modèle. + + + Pasting objects... + Collage des objets... + + + Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details! + Tous les objets n'ont pas été collés dans le modèle à cause d'erreurs retournés durant le processus! Se référer à la pile d'erreurs pour plus de détails! + + + Do you really want to delete the selected object? + Souhaitez vous réellement supprimer l'objet sélectionné? + + + (no objects) + (aucun objet) + + + Constraints + Contraintes + + + One to One (1-1) + + + + One to Many (1-n) + + + + Many to Many (n-n) + + + + <strong>ATTENTION:</strong> The database model is protected! Operations that could modify it are disabled! + + + + Alt+S + + + + Del. cascade + Supprimer en cascade + + + Ctrl+C + Ctrl+C + + + Ctrl+V + Ctrl+V + + + Ctrl+X + Ctrl+X + + + Quick action for the selected object + Actions rapides sur l'objet sélectionné + + + Set tag + Affecter un tag + + + Ctrl+E + Ctrl+E + + + Open relationship + + + + Convert to sequence + + + + Convert to serial + + + + Break line + + + + Remove points + + + + Enable SQL + + + + Disable SQL + + + + 90° (vertical) + + + + 90° (horizontal) + + + + 90° + 90° (vertical) + + + + 90° + 90° (horizontal) + + + + Zoom: %1% + + + + Do you really want to convert the relationship into an intermediate table? + + + + Validating object: `%1' (%2) + + + + Generating XML for: `%1' (%2) + + + + Pasting object: `%1' (%2) + + + + <strong>CAUTION:</strong> You are about to delete objects in cascade mode which means more objects than the selected will be dropped too. Do you really want to proceed? + + + + <strong>CAUTION:</strong> Remove multiple objects at once can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? + + + + <strong>CAUTION:</strong> Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? + + + + The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details. + + + + Inheritance + + + + Do you want to %1 the selected schema's children too? + + + + protect + + + + unprotect + + + + + ModelsDiffHelper + + Processing object `%1' (%2)... + + + + Skipping object `%1' (%2)... + + + + Processing diff infos... + + + + Processing `%1' info for object `%2' (%3)... + + + + No differences between the model and database. + + + + Preparing diff code... + + + + + NewObjectOverlayWidget + + Form + Formulaire + + + Role + Rôle + + + Tag + Tag + + + Cast + Convertion de type + + + Language + Langage + + + Textbox + Zone de texte + + + Event Trigger + Déclencheur sur évènement + + + Tablespace + Tablespace + + + Schema + Schéma + + + Domain + Domaine + + + Conversion + Convertion + + + Aggregate + Fonction d'agrégat + + + Collation + Collation + + + Table + Table + + + Type + Type + + + Sequence + Séquence + + + Extension + Extension + + + Function + Fonction + + + View + Vue + + + Permissions + Permissions + + + Rule + Règle + + + Index + Index + + + Column + Colonne + + + Constraint + Contrainte + + + Trigger + Déclencheur + + + Copy + Copie + + + M + M + + + 9 + 9 + + + Z + Z + + + 1 + 1 + + + 2 + 2 + + + 3 + 3 + + + 5 + 5 + + + 4 + 4 + + + 0 + 0 + + + A + + + + Op. Family + + + + Op. Class + + + + Operator + + + + Many-to-many + + + + One-to-many + + + + One-to-one + + + + Inheritance + + + + G + + + + K + + + + H + + + + J + + + + D + + + + E + + + + F + + + + L + + + + O + + + + U + + + + I + + + + R + + + + S + + + + Q + + + + T + + + + P + + + + Y + + + + W + + + + X + + + + C + + + + V + + + + B + + + + + NumberedTextEditor + + Upper case + + + + Lower case + + + + Ident right + + + + Ident left + + + + + ObjectDepsRefsWidget + + Form + Formulaire + + + Dependencies + Dépendances + + + Object + Objet + + + Type + Type + + + Parent Object + Objet parent + + + Parent Type + Type parent + + + References + Références + + + ID + Intuitif + ID + + + Exclude indirect dependencies + Exclure les dépendances indirectes + + + Include indirect references + Inclure les références indirectes + + + This object does not exists anymore. The dependencies and references listing are disabled. + Cet objet n'existe plus. L'affichage de ses dépendances et références est désactivé. + + + Object's dependencies & references + Dépendances et références d'un objet + + + + ObjectFinderWidget + + Form + Formulaire + + + Pattern: + Motif: + + + Hide this widget + Cacher ce widget + + + ... + ... + + + Highlight + Mettre en avant + + + Find + Chercher + + + Clears the search results + Éffacer les résultats + + + Clear + Effacer + + + Regular Expression + Expression régulières + + + Exact Match + Correspondance exacte + + + Select All + Tout sélect. + + + Clear All + Tout effacer + + + Case Sensitive + Sensible à la casse + + + Object + Objet + + + Type + Type + + + Parent Object + Objet parent + + + Parent Type + Type parent + + + Defines the search filter + Défini le filtre de recherche + + + Filter + Filtrer + + + Found <strong>%1</strong> object(s). + <strong>%1</strong> objet(s) trouvé(s). + + + No objects found. + Aucun objet trouvé. + + + Highlight graphical objects when selecting them or their children on the result list + + + + ID + ID + + + + ObjectRenameWidget + + Form + Formulaire + + + .... + .... + + + to: + en: + + + Rename + Renommer + + + Cancel + Annuler + + + + ObjectSelectorWidget + + Form + Formulaire + + + Clear field + Effeacer le champs + + + Select Object + Sélectionner un objet + + + Select %1 + + + + + ObjectTableWidget + + Form + Formulaire + + + Add Item + Ajouter un élément + + + Ins + Ins + + + Remove Item + Supprimer un élément + + + Del + Suppr. + + + Update Item + Actualiser les éléments + + + Alt+R + Alt+R + + + Remove All + Tout supprimer + + + Shift+Del + Shift+Del + + + Edit Item + Editer l'élément + + + Space + Space + + + Move Up + Déplacer vers le haut + + + Ctrl+Up + Ctrl+Haut + + + Move Down + Déplacer vers le bas + + + Ctrl+Down + Ctrl+Bas + + + Move to start + Déplacer au début + + + Ctrl+Home + Ctrl+début + + + Move to end + Déplacer à la fin + + + Ctrl+End, Ctrl+S + Ctrl+Fin, Ctrl+S + + + Confirmação + Confirmation + + + Do you really want to remove the selected item? + Souhaitez vous réellement supprimer l'élément sélectionné? + + + Do you really want to remove the all items? + Souhaitez vous réellement supprimer tous les éléments? + + + Confirmation + Confirmation + + + + OperationList + + (invalid object) + + + + + OperationListWidget + + Executed Operations + Opérations exécutées + + + Hide this widget + Cacher ce widget + + + ... + ... + + + 1 + 1 + + + Operations: + Opérations: + + + 0 + 0 + + + Position: + Position: + + + Delete operation history + Supprimer l'historique des opérations + + + Undo + Annuler + + + Redo + Rétablir + + + Object: %1 + Objet: %1 + + + Name: %1 + Nom: %1 + + + created + créé + + + removed + supprimé + + + modified + modifié + + + moved + déplacé + + + Operation: %1 + Opération: %1 + + + Undoing operations... + Annulation des opérations... + + + Redoing operations... + Rétablissement des opérations... + + + Operation history exclusion + ?? À controler dans le contexte ?? + Exclure l'historique des opérations + + + Delete the executed operations history is an irreversible action, do you want to continue? + Supprimer l'historique des opérations exécutées est une action irréversible, souhaitez vous continuer? + + + + OperatorClassWidget + + Form + Formulaire + + + Default Class: + Classe par défaut: + + + Indexing: + Indexation: + + + Elements + Élements + + + Element Type: + Type d'élement: + + + Operator + Operateur + + + Function + Fonction + + + Storage + Stockage + + + Function: + Fonction: + + + Operator: + Opérateur: + + + Support/Strategy: + Support/Stratégie: + + + Op. Family: + Famille d'opérateurs: + + + Storage Type + Type de Stockage + + + Object + Objet + + + Type + Type + + + Support/Strategy + Support/Stratégie + + + Operator Family + Famille d'opérateurs + + + + OperatorFamilyWidget + + Form + Formulaire + + + Indexing: + Indexation: + + + + OperatorWidget + + Form + Formulaire + + + Options: + Options: + + + MERGES + MERGES + + + HASHES + HASHES + + + Arguments + Arguments + + + Advanced + Avancé + + + Restrict: + Restriction: + + + Commutator: + Commutateur: + + + Negator: + Négateur: + + + Operator Func.: + Fonction de l'opérateur: + + + Join: + Jointure: + + + Right Argument Type + Type argument à droite + + + Left Argument Type + Type d'argument à gauche + + + To create a unary operator it is necessary to specify as <strong><em>'any'</em></strong> one of its arguments. Additionally, the function that defines the operator must have only one parameter and this, in turn, must have the same data type of the the argument of unary operator. + Pour créer un opérateur unaire il est nécessaire de spécifier <strong><em>'any'</em></strong> comme l'un de ses arguments. De plus, la fonction qui définit l'opérateur doit avoir seulement un paramètre et celui-ci doit avoir le même type de donnée que l'argument de l'opérateur unaire. + + + + ParameterWidget + + Form + Formulaire + + + Default Value: + Valeur par défaut: + + + Mode: + Mode: + + + IN + IN + + + OUT + OUT + + + VARIADIC + VARIADIC + + + + PermissionWidget + + Form + Formulaire + + + Roles + Rôles + + + ID: + Identifiant: + + + Permissions + Permissions + + + Add Permission + Ajouter permission + + + Update Permission + Actualiser permission + + + Cancel Operation + Annuler l'opération + + + Privileges + Privilèges + + + Disable SQL code + Désactiver le code SQL + + + Grant + Grant + + + Revoke + Revoke + + + Cascade + Cascade + + + Privilege + Privilège + + + GRANT OPTION + GRANT OPTION + + + Code Preview + Prévisualisation du code + + + Type: + Type: + + + Role + Rôle + + + Id + Identifiant + + + Leave the <em><strong>Roles</strong></em> empty to create a permission applicable to <strong><em>PUBLIC</em></strong>. + Laissez le champ <em><strong>Rôles</strong></em> vide pour créer une permission applicable à <strong><em>PUBLIC</em></strong>. + + + -- No permissions defined for the specified object! + -- Aucune permission définie pour cet objet! + + + /* Could not generate the SQL code preview for permissions! + /* Impossible de générer la prévisualisation du code SQL pour les permissions! + + + Edit permissions + Editer les permissions + + + &Grant + + + + Re&voke + + + + + PgModelerCLI + + Unrecognized option '%1'. + Option '%1' non reconnue. + + + Value not specified for option '%1'. + Valeur pour l'option '%1' manquante. + + + Option '%1' does not accept values. + L'option '%1' n'accepte pas de valeur. + + + Connection aliased as '%1' was not found on configuration file. + La connexion nommé '%1' n'existe pas dans le fichier de configuration. + + + Usage: pgmodeler-cli [OPTIONS] + Utilisation: pgmodeler-cli [OPTIONS] + + + command line interface. + interface en ligne de commande + + + PostgreSQL Database Modeler Project - pgmodeler.com.br + PostgreSQL Database Modeler Project - pgmodeler.com.br + + + General options: + Options générales: + + + %1, %2 Export to a sql script file. + %1, %2 Export vers un fichier SQL. + + + %1, %2 Export to a png image. + %1, %2 Export en image PNG. + + + %1, %2 Export directly to a PostgreSQL server. + %1, %2 Exporter directement dans un serveur PostgreSQL. + + + %1, %2 List available connections on %3 file. + %1, %2 Lister les connexions disponnibles dans le fichier %3. + + + %1, %2 Version of generated SQL code. Only for file or dbms export. + %1, %2 Version de PostgreSQL pour laquelle doit être généré l'export. Uniquement pour les exports fichier SQL et en direct dans le serveur. + + + %1, %2 Silent execution. Only critical errors are shown during process. + %1, %2 Exécution silencieuse. Seuls les avertissements et erreurs seront affichés pendant le traitement. + + + %1, %2 Show this help menu. + %1, %2 Affiche ce menu. + + + PNG export options: + Option d'export PNG: + + + %1, %2 Draws the grid on the exported png image. + %1, %2 Dessiner la grille. + + + %1, %2 Draws the page delimiters on the exported png image. + %1, %2 Dessiner les limites de pages. + + + DBMS export options: + Option d'exportation directe dans un serveur: + + + %1, %2 Ignores errors related to duplicated objects that eventually exists on server side. + %1, %2 Ignorer les erreurs relatives à d'éventuels objets dupliqués déjà existant sur le serveur. + + + %1, %2=[ALIAS] Connection configuration alias to be used. + %1, %2=[ALIAS] Alias de connexion à utiliser. + + + %1, %2=[HOST] PostgreSQL host which export will operate. + %1, %2=[HOST] Hôte du serveur PostgreSQL. + + + %1, %2=[PORT] PostgreSQL host listening port. + %1, %2=[PORT] Port du serveur PostgreSQL. + + + %1, %2=[USER] PosrgreSQL username. + %1, %2=[USER] Nom d'utilisateur. + + + %1, %2=[PASSWORD] PosrgreSQL user password. + %1, %2=[PASSWORD] Mot de passe. + + + %1, %2=[DBNAME] Connection's initial database. + %1, %2=[DBNAME] Base de données initiale de connexion. + + + Available connections (alias : conn. string) + Connexions disponibles (alias : chaîne de conn.) + + + No export mode specified! + Pas de mode d'export spécifié! + + + Multiple export mode especified! + Multiples mode d'exportation spécifiés! + + + No input file specified! + Pas de fichier source! + + + No output file specified! + Pas de fichier de sortie! + + + Input file must be different from output! + Le fichier source doit être différent du fichier de sortie! + + + Incomplete connection information! + Les information de connexion sont incomplètes! + + + Starting model export... + Début de l'export du modèle... + + + Loading input file: + Chargement du fichier source: + + + Export to PNG image: + Export en image PNG: + + + Export to SQL script file: + Export en fichier SQL: + + + Export to DBMS: + Export directement en base: + + + Export successfully ended! + Export complété avec succès! + + + Copyright 2006-2015 Raphael A. Silva <raphael@pgmodeler.com.br> + + + + This CLI tool provides the operations to export pgModeler's database models without +the need to load them on graphical interface as well to fix model files to the most recent +accepted structure. All available options are described below. + Cet outil en ligne de commande permet d'exporter des modèles de base pgModeler sans avoir besoin de les ouvrir via l'interface graphique. Il permet aussi de réparer des fichiers de modèle vers un format de structure le plus récent. Toutes les options disponibles sont décrites ci-dessous. + + + %1, %2=[FILE] Input model file (.dbm). Mandatory use when fixing a model or exporting it. + + + + %1, %2=[FILE] Output file. Mandatory use when fixing model or export to file or png. + + + + %1, %2 Try to fix the structure of the input model file in order to make it loadable again. + + + + %1, %2 Model fix tries. When reaching the maximum count the invalid objects will be discard. + + + + %1, %2 Drop the database before execute a export process. + + + + %1, %2 Runs the DROP commands attached to SQL-enabled objects. + + + + %1, %2 Simulates a export process. Actually executes all steps but undoing any modification. + + + + %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. + + + + Miscellaneous options: + + + + %1, %2=[ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. + + + + There are no connections configured. + + + + Export, fix model and update mime operations can't be used at the same time! + + + + Invalid zoom specified! + + + + Invalid action specified to update mime option! + + + + Starting model fixing... + + + + Starting mime update... + + + + Fixed model file: + + + + Model successfully fixed! + + + + Extracting objects' XML... + + + + Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! + + + + Recreating objects... + + + + +** Object(s) that couldn't fixed: + + + + WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) + + + + Database model files (.dbm) are already associated to pgModeler! + + + + There is no file association related to pgModeler and .dbm files! + + + + Mime database operation: %1 + + + + Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. + + + + Running update-mime-database command... + + + + This CLI tool provides the operations to export pgModeler's database models without + the need to load them on graphical interface as well to fix model files to the most recent + accepted structure. All available options are described below. + + + + %1, %2 Export to a svg file. + + + + PNG and SVG export options: + + + + %1, %2 Each page will be exported on a separated png image. (Only for PNG) + + + + %1, %2=[FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG) + + + + %1, %2=[USER] PostgreSQL username. + + + + %1, %2=[PASSWORD] PostgreSQL user password. + + + + Multiple export mode specified! + + + + Mime database successfully updated. + + + + Export to SVG file: + + + + + PgModelerPlugin + + Plugin Information + Information de l'extension + + + Version: %1 + Version: %1 + + + Author: %1 + Auteur: %1 + + + + PgModelerUiNS + + Do you want to apply the <strong>SQL %1 status</strong> to the object's references too? This will avoid problems when exporting or validating the model. + Souhaitez-vous appliquer <strong>SQL %1 status</strong> aux références de l'objet également ? Cela permet d'éviter des porlbèmes lors de l'exportation ou la validation du modèle. + + + disabling + + + + enabling + + + + + PgSQLTypeWidget + + Form + Formulaire + + + Data Type + Type de donnée + + + SRID: + SRID: + + + Variation: + Variation: + + + Z + Z + + + M + M + + + Precision + Précision + + + Spatial: + Spatial: + + + Dimension + Dimension + + + Format: + Format: + + + Timezone: + Fuseau horaire: + + + Type: + Type: + + + P: + P: + + + Length + Taille ? + Longueur + + + L: + L: + + + Interval: + Intervalle: + + + [ ]: + [ ]: + + + NONE + AUCUN + + + + PluginsConfigWidget + + Form + Formulaire + + + Plug-ins root directory: + Répertoire racine des extentions: + + + Open in file manager + Ouvrir dans le getionnaire de fichier + + + Loaded plug-ins + Extensions chargées + + + Plugin + Extension + + + Version + Version + + + Library + Bibliothèque + + + + QObject + + new_database + nouvelle_base + + + %1 (line: %2) + %1 (ligne: %2) + + + + Relationship + + %1_has_one_%2 + Traduction approprié ? + %1_has_one_%2 + + + %1_has_many_%2 + Traduction approprié ? + %1_has_many_%2 + + + many_%1_has_many_%2 + Traduction approprié ? + many_%1_has_many_%2 + + + %1_inherits_%2 + Traduction approprié ? + %1_inherits_%2 + + + %1_copies_%2 + Traduction approprié ? + %1_copies_%2 + + + + RelationshipConfigWidget + + Form + Formulaire + + + Connect FK to PK columns + Relier les associations avec chacune des colonnes des clés étrangères/primaires concernées + + + Connect tables' center points + Relier les associations aux tables en un point central + + + Foreign key settings + Clés étrangères + + + Deferral: + Report: + + + Deferrable: + Différable: + + + ON DELETE: + ON DELETE: + + + ON UPDATE: + ON UPDATE: + + + Name patterns + Règles de nommage + + + Relationship type: + Type d'association: + + + Foreign Key (Target): + Clé étrangère (Cible): + + + Unique Key Name: + Nom contrainte unique: + + + Primary Key Name: + Nom contrainte clé primaire: + + + Primary Key Column: + Nom colonne clé primaire: + + + Column (Target): + Colonne (Cible): + + + Foreign Key (Source): + Clé étrangère (Source): + + + Column (Source): + Colonne (Source): + + + One to one (1:1) + Un à un (1:1) + + + Connection Mode + Affichage + + + FK Settings && Patterns + Clès étrangères && nommage + + + One to many (1:n) + Un à plusieurs (1:n) + + + Many to many (n:n) + Plusieurs à plusieurs (n:n) + + + Generalization + Généralisation + + + Copy + Copie + + + Default + Défaut + + + This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. + Ce mode d'affichage est disponible uniquement pour les associations de type <strong>un à un</strong>, <strong>un à plusieurs</strong> et <strong>les associations à clé étrangère</strong>. Il permet une meilleure sémantique pour relier les tables en traçant les lignes sur chacunes des colonnes concernées par l'assocation. + + + This mode is the classical one. It connects the relationship to tables through their central points. + Ceci est le mode classique. L'association est reliée aux tables en un seul trait central. + + + Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). + Motif pour les noms de clés étrangères générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). + + + Pattern for columns generated based upon target table's pk (n-n). + Motif pour les noms de colonnes générées qui sont basées sur la clé primaire de la table cible (n:n). + + + Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). + Motif pour les noms de colonnes générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). + + + Pattern for foreign key generated based upon target table's pk (n-n). + Motif pour les noms de clés étrangères générées qui sont basées sur une clé primaire de la table cible (n:n). + + + Pattern for unique key generated by the relationship. + Motif pour les noms de clés uniques qui sont générées par une association. + + + Pattern for primary key generated by identifier relationship. + Motif pour les noms de clés primaires qui sont générées par une association. + + + + RelationshipWidget + + Form + Formulaire + + + General + Général + + + One to one relationship + Association un à un + + + 1-1 + 1-1 + + + One to many relationship + Association un à plusieurs + + + 1-n + 1-n + + + Many to many relationship + Association plusieurs à plusieurs + + + n-n + n-n + + + Generalization relationship (inheritance) + Association de généralisation (héritage) + + + gen + gen + + + Dependency / Copy relationship + Relation de dépendance / copie + + + dep + dep + + + Relationship generated via foreign key + Relation générée par une clef étrangère + + + fk + fk + + + Identifier + Identifiant + + + Rel. Type: + Type de relation: + + + Table 1: + Table n°1: + + + Table 2: + Table n°2: + + + Foreign key Settings + Propriétés par défaut des clés étrangères + + + Use the values defined on settings dialogs for the fields below + Utiliser les paramètres de pgModeler pour les champs ci-dessous + + + Use global settings for these fields + Utiliser les paramètres globaux de pgModeler + + + ON DELETE: + Intuitif + ON DELETE: + + + ON UPDATE: + Intuitif + ON UPDATE: + + + Name Patterns + Règles de nommage + + + Column (Source): + Colonne (Source): + + + Column (Target): + Colonne (Cible): + + + Foreign Key (Source): + Clé étrangère (Source): + + + Foreign Key (Target): + Clé étrangère (Cible): + + + Cardinality: + Cardinalité: + + + [SRC] is required + [SRC] est requis + + + [DST] is required + [DST] est requis + + + Name of the table generated from many to many relationship + Nom de la table générée par une relation plusieurs à plusieurs + + + Deferrable: + Différable: + + + Deferral: + Report: + + + Copy Options + Options de copie + + + INDEXES + INDEXES + + + COMMENTS + COMMENTAIRES + + + INCLUDING + INCLURE + + + DEFAULTS + DEFAUTS + + + EXCLUDING + EXCLURE + + + CONSTRAINTS + CONTRAINTES + + + Use defaults + Utiliser les valeurs par défauts + + + ALL + TOUT + + + STORAGE + STOCKAGE + + + Gen. Table Name: + Nom nouvelle table: + + + Attributes + Attributs + + + Constraints + Contraintes + + + Primary key + Clef primaire + + + Advanced + Avancé + + + Attribute + Attribut + + + Type + Type + + + Constraint + Contrainte + + + Name + Nom + + + This advanced tab shows the objects (columns or table) auto created by the relationship's connection as well the foreign keys that represents the link between the participant tables. + Cet onglet avancé montre les objets (colonnes ou tables) générés automatiquement par la relation ainsi que les clefs étrangères qui forment le(s) lien(s) entre les tables. + + + is required + est requis + + + Reference Table: + Table de référence: + + + Default + Défaut + + + Receiver Table: + Table de destination: + + + Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). + Motif pour les noms de colonnes générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). + + + Pattern for columns generated based upon target table's pk (n-n). + Motif pour les noms de colonnes générées qui sont basées sur la clé primaire de la table cible (n:n). + + + Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). + Motif pour les noms de clés étrangères générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). + + + Pattern for foreign key generated based upon target table's pk (n-n). + Motif pour les noms de clés étrangères générées qui sont basées sur une clé primaire de la table cible (n:n). + + + Pattern for primary key generated by identifier relationship. + Motif pour les noms de clés primaires qui sont générées par une association. + + + Primary Key Name: + Nom contrainte clé primaire: + + + Pattern for unique key generated by the relationship. + Motif pour les noms de clés uniques qui sont générées par une association. + + + Unique Key Name: + Nom contrainte unique: + + + Primay Key Column: + + + + The receiver's primary key will be composed by the generated foreign key columns. + + + + Instead of create a multi-valued primary key with the generated foreign keys columns a single column is created and used as primary key. + + + + Single PK column + + + + Custom Color: + + + + Use the special primary key if you want to include a primary key containing generated columns to the receiver table. <strong>Important:</strong> if this is a new relationship there is a need to finish its creation and reopen this dialog to create the special primary key. + + + + Referer View: + + + + Referer view references one or more columns of a table to construct it's own columns. + + + + Referenced table has its columns referenced by a view in order to construct the columns of this latter. + + + + Referer Table: + + + + Referer table references one or more columns of a table through foreign keys. This is the (n) side of relationship. + + + + Referenced table has its columns referenced by a table's foreign key. This is the (1) side of relationship. + + + + Referenced Table: + + + + Reference table has the columns from its primary key will copied to the receiver table in order to represent the linking between them. This is the (1) side of relationship. + + + + Receiver (or referer) table will receive the generated columns and the foreign key in order to represent the linking between them. This is the (n) side of relationship. + + + + In many-to-many relationships both tables are used as reference to generate the table that represents the linking. Columns from both tables are copied to the resultant table and two foreign keys are created as well in order to reference each participant table. + + + + &1-1 + + + + &gen + + + + E&XCLUDING + + + + Available tokens to define name patterns:<br/> <strong>%1</strong> = Reference (source) primary key column name. <em>(Ignored on constraint patterns)</em><br/> <strong>%2</strong> = Reference (source) table name.<br/> <strong>%3</strong> = Receiver (destination) table name.<br/> <strong>%4</strong> = Generated table name. <em>(Only for n:n relationships)</em> + + + + + RoleWidget + + Form + Formulaire + + + Password: + Mot de passe: + + + Connections: + Connexions: + + + Attributes + Attributs + + + Superuser + Super utilisateur + + + Inherit Permissions + Hériter des permissions + + + Can create Database + Peut créer des bases de données + + + Can create Role + Peut créer des rôles + + + Can use Replication + Peut utiliser la réplication + + + Encrypted + Encrypté + + + Can Login + Peut s'authentifier + + + Members + Membres + + + Member of + Membre de + + + Members (Admin.) + Membres (Admin.) + + + Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. + Definir <strong><em>Connexions</em></strong> à <strong><em>-1</em></strong> créé le rôle sans limite de connexion.<br/> Décocher <strong><em>Validité</em></strong> créé un rôle qui n'expire jamais. + + + Role + Rôle + + + Validity + Validité + + + yyyy-MMM-dd hh:mm:ss + + + + Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. + + + + + RuleWidget + + Form + Formulaire + + + Event: + Evènement: + + + Execution Type: + Type d'exécution: + + + Conditional Expr.: + Expr. conditionnelle: + + + Commands + Commandes + + + SQL Command: + Commandes SQL: + + + SQL command + Commande SQL + + + To create a rule that does not perform any action (<strong>DO NOTHING</strong>) simply do not specify commands in the SQL commands table. + Pour créer une règle qui n'éxécute aucune action (<strong>DO NOTHING</strong>), ne spécifiez aucune commandes dans le champs des commandes SQL. + + + + SQLExecutionWidget + + Form + Formulaire + + + Load SQL script + Ouvrir un script SQL + + + &Load + O&uvrir + + + Save SQL commands + Sauvegarder commandes SQL + + + &Save + E&nregistrer + + + &Find + &Rechercher + + + Alt+F + Alt+F + + + Run the specified SQL command + Exécute la commande SQL entrée + + + Run SQL + Exécuter SQL + + + F6 + F6 + + + Clear sql input field and results + Effacer le code SQL et la grille de résultat + + + Clear All + Effacer + + + Export results to a CSV file + Exporter les résultats dans un fichier CSV + + + Snippe&ts + Snippe&ts + + + E&xport + E&xporter + + + Shows the command history + Afficher l'historique des commandes + + + &History + &Historique + + + Alt+H + Alt+H + + + Command History + Historique des commandes + + + Clear sql input field and results. + Effacer les résultats et le code SQL saisi. + + + Clear + Effacer + + + ... + ... + + + 0 + 0 + + + Rows returned: + Lignes retournées: + + + SQL file (*.sql);;All files (*.*) + Fichier SQL (*.sql);;Tous les fichiers (*.*) + + + [binary data] + [données binaires] + + + Save CSV file + Sauvegarder fichier CSV + + + Comma-separated values file (*.csv);;All files (*.*) + Fichiers CSV, champs séparés par des points-virgules (*.csv);;Tous les fichiers (*.*) + + + The SQL input field and the results grid will be cleared! Want to proceed? + Tout le code SQL ainsi que la grille des résultats vont être purgés! Continuer? + + + Load SQL commands + + + + Copy selection + + + + Search in SQL code + + + + Toggles the output pane + + + + &Output + + + + Alt+O + Alt+O + + + Results + + + + Messages + + + + History + + + + No results retrieved or changes done due to the error above. + + + + Messages (%1) + + + + Results (%1) + + + + [%1]: SQL command successfully executed. <em>%2 <strong>%3</strong></em> + + + + Rows affected + + + + Rows retrieved + + + + Clear history + + + + + SQLToolWidget + + Form + Formulaire + + + Database explorer + Explorateur de bases de données + + + Connect to server + Démarrer la connexion + + + Disconnect from server + Se déconnecter + + + Browse selected database. + Charger les informations de la base sélectionnée + + + Drop the selected database + Supprimer la base de données sélectionnée + + + Shift+Del + Shift+Del + + + Update the database list. + Actualiser la liste des bases de données. + + + SQL execution + Exécuteur SQL + + + ... + ... + + + Warning + Avertissement + + + <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? + <strong>ATTENTION:</strong> Vous êtes sur le point de supprimer l'intégralité de la base de données <strong>%1</strong>! Toutes les données seront définitivement supprimées. Détruire la base ? + + + You're running a demonstration version! The data manipulation feature is available only in the full version! + Vous utilisez la version de démonstration ! Cette fonctionnalité est disponible uniquement sur la version complète ! + + + Disconnect from all databases + + + + Update the database list + + + + Toggle the object's attributes grid + + + + Attributes + Attributs + + + Alt+R + Alt+R + + + Toggle the display of source code pane + + + + Source code + Code source + + + <strong>ATTENTION:</strong> Disconnect from all databases will close any opened tab in this view! Do you really want to proceed? + + + + + SchemaWidget + + Form + Formulaire + + + Show rectangle + Afficher le rectangle + + + Fill color: + Couleur de remplissage: + + + + SequenceWidget + + Form + Formulaire + + + Cyclic: + Cyclique: + + + Start: + Début: + + + Maximum: + Maximum: + + + Minimum: + Minimum: + + + Increment: + Incrément: + + + Cache: + Cache: + + + Owner Col.: + Pas mieux + Owner Col.: + + + + SnippetsConfigWidget + + Form + Formulaire + + + Create new connection + Créer une nouvelle connexion + + + Cancel edition + Annuler l'édition + + + Edit selected connection + Editer la connexion sélectionnée + + + Delete selected connection + Supprimer la connexion sélectionnée + + + Remove All + Tout supprimer + + + Shift+Del + Shift+Del + + + Filter: + Filtrer: + + + ID: + Identifiant: + + + Add + Ajouter + + + Update + Mettre à jour + + + General + Général + + + Label: + + + + Applies to: + + + + Parsable or dynamic snippets are written in the <strong>schema micro language</strong> syntax. When using a parsable snippet the attributes surrounded in <strong>{}</strong> will be replaced by the selected object's matching attributes. + + + + Parsable + + + + When handling parsable snippets empty attributes will be replaced by a value in the format <strong>{attribute}</strong>. Note that this option can affect the semantics of the resulting snippet. + + + + Placeholders + + + + Parse the snippet in order to check if there are syntax errors. + + + + Parse + + + + Snippets: + + + + General purpose + + + + All snippets + + + + /* Error parsing the snippet '%1': + + %2 */ + + + + Duplicated snippet id <strong>%1</strong> detected. Please, specify a different one! + + + + Invalid ID pattern detected <strong>%1</strong>. This one must start with at leat one letter and be composed by letters, numbers and/or underscore! + + + + Empty label for snippet <strong>%1</strong>. Please, specify a value for it! + + + + Empty code for snippet <strong>%1</strong>. Please, specify a value for it! + + + + The dynamic snippet contains syntax error(s). Additional info: <br/><em>%1</em> + + + + Do you really want to remove all snippets? + + + + No syntax errors found in the snippet. + + + + + SourceCodeWidget + + Form + Formulaire + + + Version: + Version: + + + PostgreSQL + PostgreSQL + + + iconecodigo + icone + + + SQL + SQL + + + XML + XML + + + Type: + Type: + + + Source code visualization + Visualisation du code source + + + SQL code (*.sql);;All files (*.*) + Code SQL (*.sql);;Tous les fichiers (*.*) + + + Generating source code... + Génération du code source... + + + -- SQL code unavailable for this type of object -- + -- Code SQL non disponible pour ce type d'objet. -- + + + Code display: + + + + Original + + + + Original + depedencies' SQL + + + + Original + children's SQL + + + + Save the SQL code to a file. + + + + Save SQL + + + + Save SQL code as... + + + + -- NOTE: the code below contains the SQL for the selected object +-- as well for its dependencies and children (if applicable). +-- +-- This feature is only a convinience in order to permit you to test +-- the whole object's SQL definition at once. +-- +-- When exporting or generating the SQL for the whole database model +-- all objects will be placed at their original positions. + + + + + + + <!-- XML code preview disabled in demonstration version --> + + + + <strong>Original:</strong> displays only the original object's SQL code.<br/><br/> <strong>Dependencies:</strong> displays the original code including all dependencies needed to properly create the selected object.<br/><br/> <strong>Children:</strong> displays the original code including all object's children SQL code. This option is used only by schemas, tables and views. + + + + + +-- SQL code purposely truncated at this point in demo version! + + + + + SwapObjectsIdsWidget + + Form + Formulaire + + + Create: + Créer: + + + ID: + Identifiant: + + + Before: + Avant: + + + It's recommended to use this feature only when the SQL validation fails in cases when a object is being referenced in portions where the ordinary validation couldn't reach, e.g., inside of a rule command or check constraint expression. + Il est recommandé d'utiliser cette fonctionnalité seulement lorsque la validation SQL échoue. C'est souvent le cas lorsque des objets possèdent des références vers d'autres objets que vous avez créé ultérieurement dans le modèle . Echanger les ID débloque la situation. + + + Swap the values of the fields + Procède à l'échange + + + Swap values + Échanger + + + Change objects creation order + + + + + Table + + new_table + nouvelle_table + + + In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2' + + + + + TableDataWidget + + Edit table data + + + + Add empty rows + + + + Add + Ajouter + + + Ins + Ins + + + Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. + + + + Add an empty column + + + + Remove all rows from the grid preserving columns + + + + Clear + Effacer + + + Shift+Del + + + + Delete the selected rows + + + + Delete + Supprimer + + + Del + + + + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> + + + + Duplicate the selected rows + + + + Duplicate + + + + Ctrl+D + + + + Delete the selected columns + + + + Remove all columns (and rows) from the grid + + + + Ctrl+Shift+Del + + + + Delete columns is an irreversible action! Do you really want to proceed? + + + + Remove all rows is an irreversible action! Do you really want to proceed? + + + + Remove all columns is an irreversible action! Do you really want to proceed? + + + + Unknown column + + + + Duplicated column + + + + (no columns) + + + + + TableObjectView + + +Relationship: %1 + + + + + TableView + + Connected rels: %1 + Associations: %1 + + + + TableWidget + + Form + Formulaire + + + Options + Options + + + Tag: + Tag: + + + With OID + Avec OID + + + Generate ALTER for columns/constraints + Utiliser ALTER pour les colonnes/contraintes + + + Unlogged + Unlogged + + + Columns + Colonnes + + + Constraints + Contraintes + + + Triggers + Déclencheur + + + Rules + Règles + + + Indexes + Indexes + + + Tables + Tables + + + Name + Nom + + + Schema + Schéma + + + Type + Type + + + Default Value + Valeur par défaut + + + Attribute + Attribut + + + ON DELETE + ON DELETE + + + ON UPDATE + ON UPDATE + + + Refer. Table + Table référ. + + + Firing + Déclencheur + + + Events + Evènements + + + Execution + Exécution + + + Event + Evènement + + + Indexing + Indexation + + + Parent + Parent + + + Copy + Copie + + + &Columns + + + + Co&nstraints + + + + Tri&ggers + + + + &Rules + + + + &Indexes + + + + &Tables + + + + Edit data + + + + Define initial data for the table + + + + + TablespaceWidget + + Form + Formulaire + + + Directory: + Dossier: + + + + TagWidget + + Form + Formulaire + + + Colors + Couleurs + + + Extended body: + Corps étendu: + + + Body: + Corps: + + + Title: + Titre: + + + Schema name: + Nom du schéma: + + + Table name: + Nom de la table: + + + + TaskProgressWidget + + Executing tasks + Exécution des tâches + + + Waiting task to start... + En attente du démarrage de la tâche ... + + + + TextboxWidget + + Form + Formulaire + + + Font: + Police: + + + Text + Texte + + + pt + pt + + + Color: + Couleur: + + + Bold + Gras + + + Italic + Italique + + + Underline + Souligné + + + Select text color + Sélection de la couleur de texte + + + + TriggerWidget + + Form + Formulaire + + + Event: + Evènement: + + + INSERT + INSERT + + + DELETE + DELETE + + + UPDATE + UPDATE + + + TRUNCATE + TRUNCATE + + + Deferrable: + Différable: + + + Columns + Colonnes + + + Column: + Colonne: + + + Arguments + Arguments + + + Constraint + Contrainte + + + FOR EACH ROW + Pour chaque ligne + + + Refer. Table: + Table référ.: + + + Condition: + Condition: + + + Argument: + Argument: + + + Function: + Fonction: + + + Options: + Options: + + + Excution: + Excution: + + + Column + Colonne + + + Type + Type + + + + TypeWidget + + Form + Formulaire + + + Configuration: + Configuration: + + + Base Type + Type de base + + + Enumeration + Enumération + + + Composite + Composite + + + Enumerations + Énumérations + + + Enumeration: + Énumeration: + + + Attributes + Attributs + + + Internal Length: + Long. interne: + + + Storage: + Stockage: + + + Category: + Catégorie: + + + Delimiter: + Délimiteur: + + + Alignment: + Alignement: + + + char + char + + + smallint + smallint + + + integer + integer + + + double precision + double precision + + + Default Value: + Valeur par défaut: + + + Range + Interval + + + Options: + Options: + + + By value + Par valeur + + + Preferred + Préféré + + + Collatable + Collatable + + + Functions + Fonctions + + + INPUT: + INPUT: + + + OUTPUT: + OUTPUT: + + + RECV: + RECV: + + + SEND: + SEND: + + + TPMOD_IN: + TPMOD_IN: + + + TPMOD_OUT: + TPMOD_OUT: + + + ANALYZE: + ANALYZE: + + + Name: + Nom: + + + Collation: + Collation: + + + Subtype Diff Func.: + Fonction de différence du sous-type: + + + Operator Class: + Classe d'opérateurs: + + + Canonical Func.: + Fonction canonique: + + + Like Type + Type de Like + + + Element Type + Type d'élement + + + Subtype + Sous-type + + + Name + Nom + + + Type + Type + + + Collation + Collation + + + The functions to be assigned to a type should be written in C language and possess, respectively, the following signatures:<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any function(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring function(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta function(any)</em></td> <td><strong>RECV:</strong> <em>any function(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer function(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring function(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean function(internal)</em></td> <tr> </table> + La fonction assignée à un type devrait être écrite en langage C et possèder, les signatures respective suivantes:<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any fonction(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring fonction(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta fonction(any)</em></td> <td><strong>RECV:</strong> <em>any fonction(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer fonction(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring fonction(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean fonction(internal)</em></td> <tr> </table> + + + The functions to be assigned to a range type should have the following signatures:<br/><br/><strong>Canonical:</strong> <em>any function(any)</em> <br/><strong>Subtype Diff:</strong> <em>double precision function(subtype, subtype)</em> + Les fonction assignables au type interval (RANGE) doivent avoir la signature suivante:<br/><br/><strong>Canonique:</strong> <em>any function(any)</em> <br/><strong>Subtype Diff:</strong> <em>double precision function(subtype, subtype)</em> + + + Co&mposite + + + + + UpdateNotifierWidget + + Update Notifier + Vérificateur de mise à jour + + + New update found! + Nouvelle mise à jour disponible! + + + Hide this widget + Cacher ce widget + + + ... + ... + + + Released in: + Date de sortie: + + + mmm dd, yyyy + dd mmm yyyy + + + Version: + Version: + + + 0.0.0 + 0.0.0 + + + Changelog + Journal des modifications + + + Redirects to purchase page. + Redirige vers la page web pour acheter. + + + Get binary package + Télécharger l'application compilée + + + Redirects to GitHub source repository. + Redirige vers la page web du dépôt GitHub. + + + Get source code + Télécharger le code source + + + <strong>Note:</strong> Both actions below will open a new web browser window + <strong>Remarque:</strong> Ces boutons entraînent l'ouverture de votre navigateur web + + + Purchase a new package + Acheter un nouveau paquet + + + Failed to check updates + Impossible de vérifier la présence de mise à jour + + + The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <strong>%1</strong>. + Le vérificateur de mise à jour n'a pas pu vérifier la présence de nouvelles versions ! Vérifiez votre connexion à Internet et réessayez ! Code d'erreur retourné : <strong>%1</strong>. + + + No updates found + Aucune mise à jour disponible + + + You are running the most recent pgModeler version! No update needed. + Vous utilisez déjà la version de pgModeler la plus récente ! Aucune mise à jour requise. + + + The update notifier failed to check for new versions! A HTTP status code was returned: <strong>%1</strong> + Le vérificateur de mise à jour n'a pas pu vérifier la présence de nouvelles versions ! Code retour HTTP reçu : <strong>%1</strong> + + + Recover a package + + + + Update found! + + + + New version: + + + + + ViewWidget + + Form + Formulaire + + + References + Références + + + Column + Colonne + + + Expression + Expression + + + Used in: + Utilisé dans: + + + Reference Type: + Type de référence: + + + SELECT-FROM + SELECT-FROM + + + FROM-WHERE + FROM-WHERE + + + After WHERE + Après WHERE + + + View Definition + Définition de la vue + + + Options + Options + + + Tag: + Tag: + + + Mode: + Mode: + + + Ordinary + Ordinaire + + + Recursive + Récursif + + + Materialized + Matérialisée + + + With no data + With no data + + + Table: + Table: + + + Table Alias: + Alias table: + + + Column: + Colonne: + + + Column Alias: + Alias colonne: + + + Expression: + Expression: + + + Expression Alias: + Alias expression: + + + Triggers + Déclencheur + + + Rules + Règles + + + Table Expression + CTE + + + Code Preview + Prévisualisation du code + + + Col./Expr. + Col./Expr. + + + Alias + Alias + + + Alias Col. + Alias col. + + + Flags: SF FW AW VD + Flags: SF FW AW VD + + + Name + Nom + + + Refer. Table + Table référ. + + + Firing + Déclenche + + + Events + Evènements + + + Execution + Exécution + + + Event + Evènement + + + /* Could not generate the SQL code. Make sure all attributes are correctly filled! + /* Le code SQL ne peut être généré. Vérifiez que les champs sont correctement remplis! + + + To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[tablel].*</strong></em> + Pour référencer toutes les colonnes dans une table (*) ne remplissez pas le champs <strong>Colonne</strong>, ceci revient à écrire <em><strong>[schéma].[table].*</strong></em> + + + Recursi&ve + + + + &Materialized + + + + + WelcomeWidget + + Form + Formulaire + + + New model + Nouveau modèle + + + Open model + Ouvrir modèle + + + Sample models + Modèles de démo + + + Recent models + Modèles récents + + + Last session + Dernière session + + + + Xml2Object + + Xml2Object + Xml2Object + + + + Xml2ObjectWidget + + XML2Object + XML2Object + + + Load XML + Charger XML + + + Clear + Effacer + + + Generate + Générer + + + Close + Fermer + + + Database model (*.dbm);;XML file (*.xml);;All files (*.*) + Modèle de base de données (*.dbm);;Fichier XML (*.xml);;Tous les fichiers (*.*) + + + Load file + Charger un fichier + + + diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 0ed86e483e..59ee163f59 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -245,13 +245,13 @@ QString SchemaParser::getAttribute(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!AttribRegExp.exactMatch(atrib)) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidAttribute)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidAttribute) .arg(atrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -330,7 +330,7 @@ QString SchemaParser::getPureText(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -369,7 +369,7 @@ QString SchemaParser::getConditional(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg(line + comment_count + 1).arg(column+1), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -406,7 +406,7 @@ QString SchemaParser::getMetaCharacter(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg(line + comment_count + 1).arg(column+1), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -485,7 +485,7 @@ bool SchemaParser::evaluateComparisonExpr(void) error=true; else if(!opers.contains(QString(oper).remove('f').remove('i'))) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidOperatorInExpression)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidOperatorInExpression) .arg(oper).arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidOperatorInExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -554,7 +554,7 @@ bool SchemaParser::evaluateComparisonExpr(void) } if(error) - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -644,7 +644,7 @@ void SchemaParser::defineAttribute(void) //Checking if the attribute has a valid name if(!AttribRegExp.exactMatch(attrib)) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidAttribute)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidAttribute) .arg(attrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -655,7 +655,7 @@ void SchemaParser::defineAttribute(void) attributes[attrib]=value; } else - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -690,7 +690,7 @@ void SchemaParser::unsetAttribute(void) } else if(!AttribRegExp.exactMatch(attrib)) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidAttribute)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidAttribute) .arg(attrib).arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -699,7 +699,7 @@ void SchemaParser::unsetAttribute(void) break; default: - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; @@ -844,7 +844,7 @@ bool SchemaParser::evaluateExpression(void) if(error) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -871,7 +871,7 @@ char SchemaParser::translateMetaCharacter(const QString &meta) if(metas.count(meta)==0) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidMetacharacter)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidMetacharacter) .arg(meta).arg(filename).arg(line + comment_count +1).arg(column+1), ErrorCode::InvalidMetacharacter,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1062,7 +1062,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) //Checks whether the metacharacter is part of the 'if' expression (this is an error) if(if_level>=0 && vet_tk_if[if_level] && !vet_tk_then[if_level]) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidSyntax)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg(line + comment_count +1).arg(column+1), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1106,7 +1106,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) { if(!ignore_unk_atribs) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::UnkownAttribute)) + throw Exception(Exception::getErrorMessage(ErrorCode::UnkownAttribute) .arg(atrib).arg(filename).arg((line + comment_count +1)).arg((column+1)), ErrorCode::UnkownAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1143,7 +1143,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) raises an exception */ if(attributes[atrib].isEmpty() && !ignore_empty_atribs) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::UndefinedAttributeValue)) + throw Exception(Exception::getErrorMessage(ErrorCode::UndefinedAttributeValue) .arg(atrib).arg(filename).arg(line + comment_count +1).arg(column+1), ErrorCode::UndefinedAttributeValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1166,7 +1166,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) cond!=TokenAnd && cond!=TokenSet && cond!=TokenUnset) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::InvalidInstruction)) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidInstruction) .arg(cond).arg(filename).arg(line + comment_count +1).arg(column+1), ErrorCode::InvalidInstruction,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1317,7 +1317,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) raises an exception */ if(word.isEmpty() && !ignore_empty_atribs) { - throw Exception(QString(Exception::getErrorMessage(UndefinedAttributeValue)) + throw Exception(Exception::getErrorMessage(UndefinedAttributeValue) .arg(atrib).arg(filename).arg(line + comment_count +1).arg(column+1), UndefinedAttributeValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1367,7 +1367,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) if(error) { - throw Exception(QString(Exception::getErrorMessage(InvalidSyntax)) + throw Exception(Exception::getErrorMessage(InvalidSyntax) .arg(filename).arg(line + comment_count +1).arg(column+1), InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1389,7 +1389,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) because only an attribute must be on the 'if' expression */ if(vet_tk_if[if_level] && !vet_tk_then[if_level]) { - throw Exception(QString(Exception::getErrorMessage(InvalidSyntax)) + throw Exception(Exception::getErrorMessage(InvalidSyntax) .arg(filename).arg(line + comment_count +1).arg(column+1), InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1414,7 +1414,7 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) was not closed thus the parser returns an error */ if(if_cnt!=end_cnt) { - throw Exception(QString(Exception::getErrorMessage(InvalidSyntax)) + throw Exception(Exception::getErrorMessage(InvalidSyntax) .arg(filename).arg(line + comment_count +1).arg(column+1), InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index a4326cf386..e190a3b7de 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -75,7 +75,7 @@ void XMLParser::loadXMLFile(const QString &filename) //Case the file opening was not sucessful if(!input.isOpen()) { - throw Exception(QString(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed)).arg(filename), + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(filename), ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -193,7 +193,7 @@ void XMLParser::readBuffer(void) if(xml_doc) restartParser(); //Raise an exception with the error massege from the parser xml - throw Exception(QString(Exception::getErrorMessage(ErrorCode::LibXMLError)) + throw Exception(Exception::getErrorMessage(ErrorCode::LibXMLError) .arg(xml_error->line).arg(xml_error->int2).arg(msg).arg(file), ErrorCode::LibXMLError,__PRETTY_FUNCTION__,__FILE__,__LINE__); } diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index 149ba66550..47f44498c3 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -240,7 +240,7 @@ void Connection::connect(void) if(connection==nullptr || PQstatus(connection)==CONNECTION_BAD) { //Raise the error generated by the DBMS - throw Exception(QString(Exception::getErrorMessage(ConnectionNotStablished)) + throw Exception(Exception::getErrorMessage(ConnectionNotStablished) .arg(PQerrorMessage(connection)), ConnectionNotStablished, __PRETTY_FUNCTION__, __FILE__, __LINE__); } @@ -410,7 +410,7 @@ void Connection::executeDMLCommand(const QString &sql, ResultSet &result) //Raise an error in case the command sql execution is not sucessful if(strlen(PQerrorMessage(connection))>0) { - throw Exception(QString(Exception::getErrorMessage(SQLCommandNotExecuted)) + throw Exception(Exception::getErrorMessage(SQLCommandNotExecuted) .arg(PQerrorMessage(connection)), SQLCommandNotExecuted, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, QString(PQresultErrorField(sql_res, PG_DIAG_SQLSTATE))); @@ -453,7 +453,7 @@ void Connection::executeDDLCommand(const QString &sql) PQclear(sql_res); - throw Exception(QString(Exception::getErrorMessage(SQLCommandNotExecuted)) + throw Exception(Exception::getErrorMessage(SQLCommandNotExecuted) .arg(PQerrorMessage(connection)), SQLCommandNotExecuted, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, field); } diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index aab2632c4d..6393936baf 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -47,7 +47,7 @@ ResultSet::ResultSet(PGresult *sql_result) //Generating an error in case the server returns a fatal error case PGRES_FATAL_ERROR: - str_aux=QString(Exception::getErrorMessage(DBMSFatalError)) + str_aux=Exception::getErrorMessage(DBMSFatalError) .arg(PQresultErrorMessage(sql_result)); throw Exception(str_aux,DBMSFatalError, __PRETTY_FUNCTION__, __FILE__, __LINE__); break; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 8c7729b7f1..db11cffb3a 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -418,7 +418,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) { QString str_aux; - str_aux=QString(Exception::getErrorMessage(AsgDuplicatedObject)) + str_aux=Exception::getErrorMessage(AsgDuplicatedObject) .arg(object->getName(obj_type != ObjExtension)) .arg(object->getTypeName()) .arg(this->getName(true)) @@ -492,7 +492,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r if(!dynamic_cast(refs[0])) { err_code=RemDirectReference; - throw Exception(QString(Exception::getErrorMessage(err_code)) + throw Exception(Exception::getErrorMessage(err_code) .arg(object->getName(true)) .arg(object->getTypeName()) .arg(refs[0]->getName(true)) @@ -504,7 +504,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r BaseObject *ref_obj_parent=dynamic_cast(refs[0])->getParentTable(); err_code=RemInderectReference; - throw Exception(QString(Exception::getErrorMessage(err_code)) + throw Exception(Exception::getErrorMessage(err_code) .arg(object->getName(true)) .arg(object->getTypeName()) .arg(refs[0]->getName(true)) @@ -2477,7 +2477,7 @@ void DatabaseModel::addDomain(Domain *domain, int obj_idx) //Raises an error if found a type with the same name as the domain if(found) { - str_aux=QString(Exception::getErrorMessage(AsgDuplicatedObject)) + str_aux=Exception::getErrorMessage(AsgDuplicatedObject) .arg(domain->getName(true)) .arg(domain->getTypeName()) .arg(this->getName(true)) @@ -2643,7 +2643,7 @@ void DatabaseModel::addType(Type *type, int obj_idx) if(found) { - str_aux=QString(Exception::getErrorMessage(AsgDuplicatedObject)) + str_aux=Exception::getErrorMessage(AsgDuplicatedObject) .arg(type->getName(true)) .arg(type->getTypeName()) .arg(this->getName(true)) @@ -3143,7 +3143,7 @@ void DatabaseModel::loadModel(const QString &filename) if(e.getErrorType()>=InvalidSyntax) { - str_aux=QString(Exception::getErrorMessage(InvModelFileNotLoaded)).arg(filename); + str_aux=Exception::getErrorMessage(InvModelFileNotLoaded).arg(filename); throw Exception(str_aux,InvModelFileNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } else @@ -3893,7 +3893,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) //Raises an error if the operator class doesn't exists if(!collation) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(tpattrib.getName()) .arg(tpattrib.getTypeName()) .arg(attribs[ParsersAttributes::NAME]) @@ -4085,7 +4085,7 @@ Type *DatabaseModel::createType(void) //Raises an error if the operator class doesn't exists if(!collation) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) @@ -4103,7 +4103,7 @@ Type *DatabaseModel::createType(void) //Raises an error if the operator class doesn't exists if(!op_class) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) @@ -4823,7 +4823,7 @@ Column *DatabaseModel::createColumn(void) seq=getObject(attribs[ParsersAttributes::SEQUENCE], ObjSequence); if(!seq) - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjColumn)) .arg(attribs[ParsersAttributes::SEQUENCE]) @@ -4905,7 +4905,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Raises an error if the parent table doesn't exists if(!table) { - str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) + str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjConstraint)) .arg(attribs[ParsersAttributes::TABLE]) @@ -4968,7 +4968,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Raises an error if the referenced table doesn't exists if(!ref_table) { - str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) + str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(constr->getName()) .arg(constr->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) @@ -5119,7 +5119,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) @@ -5128,7 +5128,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec } else { - throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjOpClass)), @@ -5147,7 +5147,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec //Raises an error if the operator doesn't exists if(!oper) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) @@ -5167,7 +5167,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) @@ -5176,7 +5176,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec } else { - throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjCollation)), @@ -5207,7 +5207,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) @@ -5216,7 +5216,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec } else { - throw Exception(QString(Exception::getErrorMessage(PartKeyObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjColumn)), @@ -5301,7 +5301,7 @@ Index *DatabaseModel::createIndex(void) //Raises an error if the parent table doesn't exists if(!table) { - str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) + str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjIndex)) .arg(attribs[ParsersAttributes::TABLE]) @@ -5380,7 +5380,7 @@ Rule *DatabaseModel::createRule(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjView)); if(!table) - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjRule)) .arg(attribs[ParsersAttributes::TABLE]) @@ -5459,7 +5459,7 @@ Trigger *DatabaseModel::createTrigger(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjView)); if(!table) - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjTrigger)) .arg(attribs[ParsersAttributes::TABLE]) @@ -5543,7 +5543,7 @@ Trigger *DatabaseModel::createTrigger(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) { - str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) + str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) @@ -5613,7 +5613,7 @@ Policy *DatabaseModel::createPolicy(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); if(!table) - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjPolicy)) .arg(attribs[ParsersAttributes::TABLE]) @@ -5718,7 +5718,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(event_trig->getName()) .arg(event_trig->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) @@ -5822,7 +5822,7 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) //Raises an error if the column parent table doesn't exists if(!table) { - str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) + str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(sequence->getName()) .arg(BaseObject::getTypeName(ObjSequence)) .arg(tab_name) @@ -5903,7 +5903,7 @@ View *DatabaseModel::createView(void) //Raises an error if the table doesn't exists if(!table) { - str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) + str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(view->getName()) .arg(BaseObject::getTypeName(ObjView)) .arg(attribs[ParsersAttributes::TABLE]) @@ -5922,7 +5922,7 @@ View *DatabaseModel::createView(void) //Raises an error if the view references an inexistant column if(!column) { - str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) + str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(view->getName()) .arg(BaseObject::getTypeName(ObjView)) .arg(attribs[ParsersAttributes::TABLE] + QString(".") + @@ -6071,7 +6071,7 @@ Collation *DatabaseModel::createCollation(void) //Raises an error if the copy collation doesn't exists if(!copy_coll) { - throw Exception(QString(Exception::getErrorMessage(RefObjectInexistsModel)) + throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(collation->getName()) .arg(BaseObject::getTypeName(ObjCollation)) .arg(attribs[ParsersAttributes::COLLATION]) @@ -6245,7 +6245,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) //Raises an error if some table doesn't exists if(!tables[i]) { - str_aux=QString(Exception::getErrorMessage(RefObjectInexistsModel)) + str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(obj_rel_type)) .arg(attribs[tab_attribs[i]]) diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 247595f311..4ddc032f05 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -39,7 +39,7 @@ void Domain::addCheckConstraint(const QString &name, const QString &expr) if(chk_constrs.count(name)) { - throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) + throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) .arg(name) .arg(BaseObject::getTypeName(ObjConstraint)) .arg(this->getName(true)) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index f4ca98a6be..f58313431b 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -550,7 +550,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) this->invalidated=true; } else - throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) + throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) .arg(tab_obj->getName(true)) .arg(tab_obj->getTypeName()) .arg(this->getName(true)) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index f02e6bd1e0..bd02ce3d20 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -376,7 +376,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) //Raises an error if already exists a object with the same name and type if(getObject(obj->getName(),obj_type,idx)) { - throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) + throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) .arg(obj->getName(true)) .arg(obj->getTypeName()) .arg(this->getName(true)) diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 03201bb286..dcc9c55137 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -126,18 +126,18 @@ void Trigger::setCondition(const QString &cond) void Trigger::addColumn(Column *column) { if(!column) - throw Exception(QString(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedColumn)) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedColumn) .arg(this->getName(true)) .arg(this->getTypeName()), ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!column->getParentTable()) - throw Exception(QString(Exception::getErrorMessage(ErrorCode::AsgColumnNoParent)) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgColumnNoParent) .arg(this->getName(true)) .arg(this->getTypeName()), ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(this->getParentTable() && column->getParentTable() != this->getParentTable()) - throw Exception(QString(Exception::getErrorMessage(ErrorCode::AsgInvalidColumnTrigger)) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidColumnTrigger) .arg(column->getName(true)) .arg(this->getName(true)), ErrorCode::AsgInvalidColumnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index ae762a5160..c2d806f0d9 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -708,7 +708,7 @@ void View::addObject(BaseObject *obj, int obj_idx) //Raises an error if already exists a object with the same name and type if(getObjectIndex(obj->getName(), tab_obj->getObjectType()) >= 0) { - throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) + throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) .arg(obj->getName(true)) .arg(obj->getTypeName()) .arg(this->getName(true)) diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 8bd18e5a3a..e935852bed 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -748,7 +748,7 @@ void BaseObjectWidget::applyConfiguration(void) //Raises an error if another object is found with the same name as the editing object if(!new_obj && aux_obj && aux_obj!=object) { - throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) + throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) .arg(obj_name) .arg(BaseObject::getTypeName(obj_type)) .arg(parent_obj->getName(true)) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 1facfefd04..e9b2af2928 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2178,7 +2178,7 @@ void ModelWidget::protectObject(void) if(tab_obj->isAddedByRelationship()) { - throw Exception(QString(Exception::getErrorMessage(OprRelationshipAddedObject)) + throw Exception(Exception::getErrorMessage(OprRelationshipAddedObject) .arg(object->getName()).arg(object->getTypeName()), OprRelationshipAddedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -2908,7 +2908,7 @@ void ModelWidget::removeObjects(bool cascade) //Raises an error if the user try to remove a protected object else if(object->isProtected()) { - throw Exception(QString(Exception::getErrorMessage(RemProtectedObject)) + throw Exception(Exception::getErrorMessage(RemProtectedObject) .arg(object->getName(true)) .arg(object->getTypeName()), RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index 104b95eaa4..c4c3bd4ae1 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -119,7 +119,7 @@ void ObjectRenameWidget::applyRenaming(void) //Raises a error if another object is found if(aux_obj && aux_obj!=object) { - throw Exception(QString(Exception::getErrorMessage(AsgDuplicatedObject)) + throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) .arg(fmt_name) .arg(object->getTypeName()) .arg(parent_obj->getName(true)) diff --git a/schemas/xml/sanepredial.omf b/schemas/xml/sanepredial.omf new file mode 100755 index 0000000000..a15f3e6fd2 --- /dev/null +++ b/schemas/xml/sanepredial.omf @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file From 2f599237cb0acf732c48bb522c58f5641924239e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 21:57:38 -0300 Subject: [PATCH 164/425] More static const attributes refactoring --- libobjrenderer/src/baseobjectview.cpp | 4 +- libparsers/src/schemaparser.cpp | 18 +- libparsers/src/schemaparser.h | 4 +- libparsers/src/xmlparser.cpp | 24 +- libparsers/src/xmlparser.h | 20 +- libpgconnector/src/catalog.cpp | 58 ++-- libpgconnector/src/catalog.h | 28 +- libpgconnector/src/connection.cpp | 114 ++++---- libpgconnector/src/connection.h | 60 ++--- libpgmodeler/src/aggregate.cpp | 20 +- libpgmodeler/src/basegraphicobject.cpp | 2 +- libpgmodeler/src/baseobject.cpp | 46 ++-- libpgmodeler/src/baserelationship.cpp | 16 +- libpgmodeler/src/cast.cpp | 6 +- libpgmodeler/src/collation.cpp | 4 +- libpgmodeler/src/column.cpp | 4 +- libpgmodeler/src/constraint.cpp | 12 +- libpgmodeler/src/conversion.cpp | 2 +- libpgmodeler/src/databasemodel.cpp | 252 +++++++++--------- libpgmodeler/src/domain.cpp | 2 +- libpgmodeler/src/element.cpp | 2 +- libpgmodeler/src/eventtrigger.cpp | 2 +- libpgmodeler/src/excludeelement.cpp | 2 +- libpgmodeler/src/extension.cpp | 2 +- libpgmodeler/src/function.cpp | 10 +- libpgmodeler/src/index.cpp | 6 +- libpgmodeler/src/indexelement.cpp | 2 +- libpgmodeler/src/language.cpp | 4 +- libpgmodeler/src/operationlist.cpp | 12 +- libpgmodeler/src/operator.cpp | 8 +- libpgmodeler/src/operatorclass.cpp | 6 +- libpgmodeler/src/operatorclasselement.cpp | 8 +- libpgmodeler/src/parameter.cpp | 2 +- libpgmodeler/src/partitionkey.cpp | 2 +- libpgmodeler/src/permission.cpp | 6 +- libpgmodeler/src/pgsqltypes.cpp | 2 +- libpgmodeler/src/reference.cpp | 2 +- libpgmodeler/src/relationship.cpp | 16 +- libpgmodeler/src/table.cpp | 42 +-- libpgmodeler/src/tag.cpp | 4 +- libpgmodeler/src/textbox.cpp | 4 +- libpgmodeler/src/trigger.cpp | 8 +- libpgmodeler/src/type.cpp | 22 +- libpgmodeler/src/typeattribute.cpp | 4 +- libpgmodeler/src/view.cpp | 6 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 14 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 10 +- .../src/connectionsconfigwidget.cpp | 160 +++++------ libpgmodeler_ui/src/connectionsconfigwidget.h | 2 +- .../src/databaseexplorerwidget.cpp | 22 +- libpgmodeler_ui/src/databaseimportform.cpp | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 54 ++-- libpgmodeler_ui/src/datamanipulationform.cpp | 10 +- libpgmodeler_ui/src/mainwindow.cpp | 4 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 6 +- libpgmodeler_ui/src/modelexportform.cpp | 2 +- libpgmodeler_ui/src/modelexporthelper.cpp | 16 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 18 +- libpgmodeler_ui/src/modelwidget.cpp | 22 +- libpgmodeler_ui/src/permissionwidget.cpp | 2 +- libpgmodeler_ui/src/resultsetmodel.cpp | 2 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 8 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 16 +- libpgmodeler_ui/src/sqltoolwidget.cpp | 10 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 2 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 16 +- libpgmodeler_ui/src/viewwidget.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 28 +- plugins/xml2object/src/xml2objectwidget.cpp | 4 +- .../databasemodeltest/databasemodeltest.cpp | 2 +- 70 files changed, 657 insertions(+), 657 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index bb752dde47..a2f3b768e2 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -223,7 +223,7 @@ void BaseObjectView::loadObjectsStyle(void) GlobalAttributes::ObjectDTDExt, GlobalAttributes::ObjectsStyleConf); xmlparser.loadXMLFile(config_file); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -266,7 +266,7 @@ void BaseObjectView::loadObjectsStyle(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 59ee163f59..72dbe2fac9 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -885,7 +885,7 @@ QString SchemaParser::getCodeDefinition(const QString & obj_name, attribs_map &a { QString filename; - if(def_type==SQL_DEFINITION) + if(def_type==SqlDefinition) { //Formats the filename filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + @@ -979,14 +979,14 @@ QString SchemaParser::convertCharsToXMLEntities(QString buf) if(str_aux.contains(QRegExp("(&|\\<|\\>|\")"))) { //Replaces the char by the XML entities - if(!str_aux.contains(XMLParser::CHAR_QUOT) && !str_aux.contains(XMLParser::CHAR_LT) && - !str_aux.contains(XMLParser::CHAR_GT) && !str_aux.contains(XMLParser::CHAR_AMP) && - !str_aux.contains(XMLParser::CHAR_APOS) && str_aux.contains('&')) - str_aux.replace('&', XMLParser::CHAR_AMP); - - str_aux.replace('"',XMLParser::CHAR_QUOT); - str_aux.replace('<',XMLParser::CHAR_LT); - str_aux.replace('>',XMLParser::CHAR_GT); + if(!str_aux.contains(XMLParser::CharQuot) && !str_aux.contains(XMLParser::CharLt) && + !str_aux.contains(XMLParser::CharGt) && !str_aux.contains(XMLParser::CharAmp) && + !str_aux.contains(XMLParser::CharApos) && str_aux.contains('&')) + str_aux.replace('&', XMLParser::CharAmp); + + str_aux.replace('"',XMLParser::CharQuot); + str_aux.replace('<',XMLParser::CharLt); + str_aux.replace('>',XMLParser::CharGt); //Puts on the original XML definition the modified string lin.replace(attr_start, count, str_aux); diff --git a/libparsers/src/schemaparser.h b/libparsers/src/schemaparser.h index 390e4a65ca..e92324058c 100644 --- a/libparsers/src/schemaparser.h +++ b/libparsers/src/schemaparser.h @@ -186,8 +186,8 @@ class SchemaParser { public: //! \brief Constants used to get a specific object definition - static constexpr unsigned SQL_DEFINITION=0, - XML_DEFINITION=1; + static constexpr unsigned SqlDefinition=0, + XmlDefinition=1; SchemaParser(void); diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index e190a3b7de..be5b2f02b1 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -19,11 +19,11 @@ #include "xmlparser.h" #include -const QString XMLParser::CHAR_AMP=QString("&"); -const QString XMLParser::CHAR_LT=QString("<"); -const QString XMLParser::CHAR_GT=QString(">"); -const QString XMLParser::CHAR_QUOT=QString("""); -const QString XMLParser::CHAR_APOS=QString("'"); +const QString XMLParser::CharAmp=QString("&"); +const QString XMLParser::CharLt=QString("<"); +const QString XMLParser::CharGt=QString(">"); +const QString XMLParser::CharQuot=QString("""); +const QString XMLParser::CharApos=QString("'"); XMLParser::XMLParser(void) { @@ -273,10 +273,10 @@ bool XMLParser::accessElement(unsigned elem_type) if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); - elems[ROOT_ELEMENT]=curr_elem->parent; - elems[CHILD_ELEMENT]=curr_elem->children; - elems[NEXT_ELEMENT]=curr_elem->next; - elems[PREVIOUS_ELEMENT]=curr_elem->prev; + elems[RootElement]=curr_elem->parent; + elems[ChildElement]=curr_elem->children; + elems[NextElement]=curr_elem->next; + elems[PreviousElement]=curr_elem->prev; /* Checks whether the current element has the element that is to be accessed. The flag 'has_elem' is also used @@ -295,17 +295,17 @@ bool XMLParser::hasElement(unsigned elem_type, xmlElementType xml_node_type) if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(elem_type==ROOT_ELEMENT) + if(elem_type==RootElement) /* Returns the verification if the current element has a parent. The element must be different from the root, because the root element is not connected to a parent */ return(curr_elem!=root_elem && curr_elem->parent!=nullptr && (xml_node_type==0 || (xml_node_type!=0 && curr_elem->parent->type==xml_node_type))); - else if(elem_type==CHILD_ELEMENT) + else if(elem_type==ChildElement) //Returns the verification if the current element has children return(curr_elem->children!=nullptr && (xml_node_type==0 || (xml_node_type!=0 && curr_elem->children->type==xml_node_type))); - else if(elem_type==NEXT_ELEMENT) + else if(elem_type==NextElement) return(curr_elem->next!=nullptr && (xml_node_type==0 || (xml_node_type!=0 && curr_elem->next->type==xml_node_type))); else diff --git a/libparsers/src/xmlparser.h b/libparsers/src/xmlparser.h index 4485d30a04..794f21b032 100644 --- a/libparsers/src/xmlparser.h +++ b/libparsers/src/xmlparser.h @@ -74,16 +74,16 @@ class XMLParser { public: //! \brief Constants used to referência the elements on the element tree - static constexpr unsigned ROOT_ELEMENT=0, - CHILD_ELEMENT=1, - NEXT_ELEMENT=2, - PREVIOUS_ELEMENT=3; - - static const QString CHAR_AMP; //! \brief & = & - static const QString CHAR_LT; //! \brief < = < - static const QString CHAR_GT; //! \brief < = > - static const QString CHAR_QUOT; //! \brief < = " - static const QString CHAR_APOS; //! \brief < = ' + static constexpr unsigned RootElement=0, + ChildElement=1, + NextElement=2, + PreviousElement=3; + + static const QString CharAmp, //! \brief & = & + CharLt, //! \brief < = < + CharGt, //! \brief < = > + CharQuot, //! \brief < = " + CharApos; //! \brief < = ' XMLParser(void); ~XMLParser(void); diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index c54847f10f..d1a4a075f3 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -17,15 +17,15 @@ */ #include "catalog.h" -const QString Catalog::QUERY_LIST=QString("list"); -const QString Catalog::QUERY_ATTRIBS=QString("attribs"); -const QString Catalog::CATALOG_SCH_DIR=QString("catalog"); -const QString Catalog::PGSQL_TRUE=QString("t"); -const QString Catalog::PGSQL_FALSE=QString("f"); -const QString Catalog::BOOL_FIELD=QString("_bool"); -const QString Catalog::ARRAY_PATTERN=QString("((\\[)[0-9]+(\\:)[0-9]+(\\])=)?(\\{)((.)+(,)*)*(\\})$"); -const QString Catalog::GET_EXT_OBJS_SQL=QString("SELECT objid AS oid FROM pg_depend WHERE objid > 0 AND refobjid > 0 AND deptype='e'"); -const QString Catalog::PGMODELER_TEMP_DB_OBJ=QString("__pgmodeler_tmp"); +const QString Catalog::QueryList=QString("list"); +const QString Catalog::QueryAttribs=QString("attribs"); +const QString Catalog::CatalogSchemasDir=QString("catalog"); +const QString Catalog::PgSqlTrue=QString("t"); +const QString Catalog::PgSqlFalse=QString("f"); +const QString Catalog::BoolField=QString("_bool"); +const QString Catalog::ArrayPattern=QString("((\\[)[0-9]+(\\:)[0-9]+(\\])=)?(\\{)((.)+(,)*)*(\\})$"); +const QString Catalog::GetExtensionObjsSql=QString("SELECT objid AS oid FROM pg_depend WHERE objid > 0 AND refobjid > 0 AND deptype='e'"); +const QString Catalog::PgModelerTempDbObj=QString("__pgmodeler_tmp"); attribs_map Catalog::catalog_queries; @@ -64,7 +64,7 @@ map Catalog::name_fields= Catalog::Catalog(void) { last_sys_oid=0; - setFilter(EXCL_EXTENSION_OBJS | EXCL_SYSTEM_OBJS); + setFilter(ExclExtensionObjs | ExclSystemObjs); } Catalog::Catalog(const Catalog &catalog) @@ -84,8 +84,8 @@ void Catalog::setConnection(Connection &conn) connection.connect(); //Retrieving the last system oid - executeCatalogQuery(QUERY_LIST, ObjDatabase, res, true, - {{ParsersAttributes::NAME, conn.getConnectionParam(Connection::PARAM_DB_NAME)}}); + executeCatalogQuery(QueryList, ObjDatabase, res, true, + {{ParsersAttributes::NAME, conn.getConnectionParam(Connection::ParamDbName)}}); if(res.accessTuple(ResultSet::FIRST_TUPLE)) { @@ -94,7 +94,7 @@ void Catalog::setConnection(Connection &conn) } //Retrieving the list of objects created by extensions - this->connection.executeDMLCommand(GET_EXT_OBJS_SQL, res); + this->connection.executeDMLCommand(GetExtensionObjsSql, res); if(res.accessTuple(ResultSet::FIRST_TUPLE)) { do @@ -119,17 +119,17 @@ void Catalog::closeConnection(void) void Catalog::setFilter(unsigned filter) { - bool list_all=(LIST_ALL_OBJS & filter) == LIST_ALL_OBJS; + bool list_all=(ListAllObjects & filter) == ListAllObjects; this->filter=filter; list_only_sys_objs=false; - exclude_array_types=(EXCL_BUILTIN_ARRAY_TYPES & filter) == EXCL_BUILTIN_ARRAY_TYPES; - exclude_ext_objs=(EXCL_EXTENSION_OBJS & filter) == EXCL_EXTENSION_OBJS; - exclude_sys_objs=(EXCL_SYSTEM_OBJS & filter) == EXCL_SYSTEM_OBJS; + exclude_array_types=(ExclBuiltinArrayTypes & filter) == ExclBuiltinArrayTypes; + exclude_ext_objs=(ExclExtensionObjs & filter) == ExclExtensionObjs; + exclude_sys_objs=(ExclSystemObjs & filter) == ExclSystemObjs; if(!list_all) { - list_only_sys_objs=(LIST_ONLY_SYS_OBJS & filter) == LIST_ONLY_SYS_OBJS; + list_only_sys_objs=(ListOnlySystemObjs & filter) == ListOnlySystemObjs; if(list_only_sys_objs) { @@ -160,7 +160,7 @@ void Catalog::loadCatalogQuery(const QString &qry_id) { QFile input; input.setFileName(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + - CATALOG_SCH_DIR + GlobalAttributes::DirSeparator + + CatalogSchemasDir + GlobalAttributes::DirSeparator + qry_id + GlobalAttributes::SchemaExt); if(!input.open(QFile::ReadOnly)) @@ -268,7 +268,7 @@ unsigned Catalog::getObjectCount(ObjectType obj_type, const QString &sch_name, c extra_attribs[ParsersAttributes::SCHEMA]=sch_name; extra_attribs[ParsersAttributes::TABLE]=tab_name; - executeCatalogQuery(QUERY_LIST, obj_type, res, false, extra_attribs); + executeCatalogQuery(QueryList, obj_type, res, false, extra_attribs); res.accessTuple(ResultSet::FIRST_TUPLE); return(res.getTupleCount()); } @@ -335,7 +335,7 @@ attribs_map Catalog::getObjectsNames(ObjectType obj_type, const QString &sch_nam extra_attribs[ParsersAttributes::SCHEMA]=sch_name; extra_attribs[ParsersAttributes::TABLE]=tab_name; - executeCatalogQuery(QUERY_LIST, obj_type, res, false, extra_attribs); + executeCatalogQuery(QueryList, obj_type, res, false, extra_attribs); if(res.accessTuple(ResultSet::FIRST_TUPLE)) { @@ -370,7 +370,7 @@ vector Catalog::getObjectsNames(vector obj_types, const for(ObjectType obj_type : obj_types) { //Build the catalog query for the specified object type - sql=getCatalogQuery(QUERY_LIST, obj_type, false, extra_attribs); + sql=getCatalogQuery(QueryList, obj_type, false, extra_attribs); /* For certain objects the catalog query will be empty due to the absence of that kind of element in the version of the database. @@ -424,7 +424,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, //Add the name of the object as extra attrib in order to retrieve the data only for it extra_attribs[ParsersAttributes::NAME]=obj_name; - executeCatalogQuery(QUERY_ATTRIBS, obj_type, res, true, extra_attribs); + executeCatalogQuery(QueryAttribs, obj_type, res, true, extra_attribs); if(res.accessTuple(ResultSet::FIRST_TUPLE)) obj_attribs=changeAttributeNames(res.getTupleValues()); @@ -449,7 +449,7 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ attribs_map tuple; vector obj_attribs; - executeCatalogQuery(QUERY_ATTRIBS, obj_type, res, false, extra_attribs); + executeCatalogQuery(QueryAttribs, obj_type, res, false, extra_attribs); if(res.accessTuple(ResultSet::FIRST_TUPLE)) { do @@ -558,10 +558,10 @@ attribs_map Catalog::changeAttributeNames(const attribs_map &attribs) attr_name=itr->first; value=itr->second; - if(attr_name.endsWith(BOOL_FIELD)) + if(attr_name.endsWith(BoolField)) { - attr_name.remove(BOOL_FIELD); - if(value==PGSQL_FALSE) value.clear(); + attr_name.remove(BoolField); + if(value==PgSqlFalse) value.clear(); else value=ParsersAttributes::_TRUE_; } @@ -636,7 +636,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS attribs[ParsersAttributes::CUSTOM_FILTER] = QString("%1 = E'%2'").arg(name_fields[obj_type]).arg(name); attribs[ParsersAttributes::SCHEMA] = schema; attribs[ParsersAttributes::TABLE] = table; - executeCatalogQuery(QUERY_LIST, obj_type, res, false, attribs); + executeCatalogQuery(QueryList, obj_type, res, false, attribs); if(res.getTupleCount() > 1) throw Exception(QApplication::translate("Catalog","The catalog query returned more than one OID!","", -1), @@ -702,7 +702,7 @@ QStringList Catalog::parseArrayValues(const QString &array_val) { QStringList list; - if(QRegExp(ARRAY_PATTERN).exactMatch(array_val)) + if(QRegExp(ArrayPattern).exactMatch(array_val)) { //Detecting the position of { and } int start=array_val.indexOf('{')+1, diff --git a/libpgconnector/src/catalog.h b/libpgconnector/src/catalog.h index a2cdae91e8..333131aabd 100644 --- a/libpgconnector/src/catalog.h +++ b/libpgconnector/src/catalog.h @@ -36,18 +36,18 @@ class Catalog { private: SchemaParser schparser; - static const QString QUERY_LIST, //! \brief Executes a list command on catalog - QUERY_ATTRIBS, //! \brief Executes a attribute retrieving command on catalog - CATALOG_SCH_DIR, //! \brief Default catalog schemas directory - PGSQL_TRUE, //! \brief Replacement for true 't' boolean value - PGSQL_FALSE, //! \brief Replacement for false 'f' boolean value - BOOL_FIELD, //! \brief Suffix for boolean fields. + static const QString QueryList, //! \brief Executes a list command on catalog + QueryAttribs, //! \brief Executes a attribute retrieving command on catalog + CatalogSchemasDir, //! \brief Default catalog schemas directory + PgSqlTrue, //! \brief Replacement for true 't' boolean value + PgSqlFalse, //! \brief Replacement for false 'f' boolean value + BoolField, //! \brief Suffix for boolean fields. //! \brief Query used to retrieve extension objects. - GET_EXT_OBJS_SQL, + GetExtensionObjsSql, //! \brief This pattern matches the PostgreSQL array values in format [n:n]={a,b,c,d,...} or {a,b,c,d,...} - ARRAY_PATTERN; + ArrayPattern; /*! \brief Stores in comma seperated way the oids of all objects created by extensions. This attribute is use when filtering objects that are created by extensions */ @@ -126,23 +126,23 @@ class Catalog { Catalog(const Catalog &catalog); //! \brief Stores the prefix of any temp object (in pg_temp) created during catalog reading by pgModeler - static const QString PGMODELER_TEMP_DB_OBJ; + static const QString PgModelerTempDbObj; //! \brief Excludes the system objects from listing - static constexpr unsigned EXCL_SYSTEM_OBJS=1, + static constexpr unsigned ExclSystemObjs=1, //! \brief Excludes the extension generated objects from listing - EXCL_EXTENSION_OBJS=2, + ExclExtensionObjs=2, //! \brief Excludes the builtin array types. - EXCL_BUILTIN_ARRAY_TYPES=4, + ExclBuiltinArrayTypes=4, /*! \brief Shows only system objects. Using this filter will disable the other two filters. Using this filter implies the listing of extension objects */ - LIST_ONLY_SYS_OBJS=8, + ListOnlySystemObjs=8, //! \brief Shows all objects including system objects and extension object. - LIST_ALL_OBJS=16; + ListAllObjects=16; //! \brief Changes the current connection used by the catalog void setConnection(Connection &conn); diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index 47f44498c3..3f823c84c8 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -21,32 +21,32 @@ #include #include "parsersattributes.h" -const QString Connection::SSL_DESABLE=QString("disable"); -const QString Connection::SSL_ALLOW=QString("allow"); -const QString Connection::SSL_PREFER=QString("prefer"); -const QString Connection::SSL_REQUIRE=QString("require"); -const QString Connection::SSL_CA_VERIF=QString("verify-ca"); -const QString Connection::SSL_FULL_VERIF=QString("verify-full"); -const QString Connection::PARAM_ALIAS=QString("alias"); -const QString Connection::PARAM_SERVER_FQDN=QString("host"); -const QString Connection::PARAM_SERVER_IP=QString("hostaddr"); -const QString Connection::PARAM_PORT=QString("port"); -const QString Connection::PARAM_DB_NAME=QString("dbname"); -const QString Connection::PARAM_USER=QString("user"); -const QString Connection::PARAM_PASSWORD=QString("password"); -const QString Connection::PARAM_CONN_TIMEOUT=QString("connect_timeout"); -const QString Connection::PARAM_OTHERS=QString("options"); -const QString Connection::PARAM_SSL_MODE=QString("sslmode"); -const QString Connection::PARAM_SSL_CERT=QString("sslcert"); -const QString Connection::PARAM_SSL_KEY=QString("sslkey"); -const QString Connection::PARAM_SSL_ROOT_CERT=QString("sslrootcert"); -const QString Connection::PARAM_SSL_CRL=QString("sslcrl"); -const QString Connection::PARAM_KERBEROS_SERVER=QString("krbsrvname"); -const QString Connection::PARAM_LIB_GSSAPI=QString("gsslib"); - -const QString Connection::SERVER_PID=QString("server-pid"); -const QString Connection::SERVER_PROTOCOL=QString("server-protocol"); -const QString Connection::SERVER_VERSION=QString("server-version"); +const QString Connection::SslDisable=QString("disable"); +const QString Connection::SslAllow=QString("allow"); +const QString Connection::SslPrefer=QString("prefer"); +const QString Connection::SslRequire=QString("require"); +const QString Connection::SslCaVerify=QString("verify-ca"); +const QString Connection::SslFullVerify=QString("verify-full"); +const QString Connection::ParamAlias=QString("alias"); +const QString Connection::ParamServerFqdn=QString("host"); +const QString Connection::ParamServerIp=QString("hostaddr"); +const QString Connection::ParamPort=QString("port"); +const QString Connection::ParamDbName=QString("dbname"); +const QString Connection::ParamUser=QString("user"); +const QString Connection::ParamPassword=QString("password"); +const QString Connection::ParamConnTimeout=QString("connect_timeout"); +const QString Connection::ParamOthers=QString("options"); +const QString Connection::ParamSslMode=QString("sslmode"); +const QString Connection::ParamSslCert=QString("sslcert"); +const QString Connection::ParamSslKey=QString("sslkey"); +const QString Connection::ParamSslRootCert=QString("sslrootcert"); +const QString Connection::ParamSslCrl=QString("sslcrl"); +const QString Connection::ParamKerberosServer=QString("krbsrvname"); +const QString Connection::ParamLibGssapi=QString("gsslib"); + +const QString Connection::ServerPid=QString("server-pid"); +const QString Connection::ServerProtocol=QString("server-protocol"); +const QString Connection::ServerVersion=QString("server-version"); bool Connection::notice_enabled=false; bool Connection::print_sql=false; @@ -59,7 +59,7 @@ Connection::Connection(void) auto_browse_db=false; cmd_exec_timeout=0; - for(unsigned idx=OP_VALIDATION; idx <= OP_DIFF; idx++) + for(unsigned idx=OpValidation; idx <= OpDiff; idx++) default_for_oper[idx]=false; } @@ -95,10 +95,10 @@ void Connection::setConnectionParam(const QString ¶m, const QString &value) One special case is treated here, if user use the parameter SERVER_FQDN and the value is a IP address, the method will assign the value to the SERVER_IP parameter */ - if(param==PARAM_SERVER_FQDN && ip_regexp.exactMatch(value)) + if(param==ParamServerFqdn && ip_regexp.exactMatch(value)) { - connection_params[Connection::PARAM_SERVER_IP]=value; - connection_params[Connection::PARAM_SERVER_FQDN]=QString(); + connection_params[Connection::ParamServerIp]=value; + connection_params[Connection::ParamServerFqdn]=QString(); } else connection_params[param]=value; @@ -127,21 +127,21 @@ void Connection::generateConnectionString(void) for(auto &itr : connection_params) { - if(itr.first!=PARAM_ALIAS) + if(itr.first!=ParamAlias) { value=itr.second; value.replace("\\","\\\\"); value.replace("'","\\'"); - if(itr.first==PARAM_PASSWORD && (value.contains(' ') || value.isEmpty())) + if(itr.first==ParamPassword && (value.contains(' ') || value.isEmpty())) value=QString("'%1'").arg(value); if(!value.isEmpty()) { - if(itr.first==PARAM_DB_NAME) + if(itr.first==ParamDbName) connection_str.prepend(param_str.arg(itr.first).arg(value)); - else if(itr.first!=PARAM_OTHERS) + else if(itr.first!=ParamOthers) connection_str+=param_str.arg(itr.first).arg(value); else connection_str+=value; @@ -149,9 +149,9 @@ void Connection::generateConnectionString(void) } } - if(!connection_str.contains(PARAM_DB_NAME) || - (!connection_str.contains(PARAM_SERVER_FQDN) && - !connection_str.contains(PARAM_SERVER_IP))) + if(!connection_str.contains(ParamDbName) || + (!connection_str.contains(ParamServerFqdn) && + !connection_str.contains(ParamServerIp))) connection_str.clear(); } @@ -176,8 +176,8 @@ void Connection::validateConnectionStatus(void) if(PQstatus(connection)==CONNECTION_BAD) throw Exception(Exception::getErrorMessage(ConnectionBroken) - .arg(connection_params[PARAM_SERVER_FQDN].isEmpty() ? connection_params[PARAM_SERVER_IP] : connection_params[PARAM_SERVER_FQDN]) - .arg(connection_params[PARAM_PORT]), + .arg(connection_params[ParamServerFqdn].isEmpty() ? connection_params[ParamServerIp] : connection_params[ParamServerFqdn]) + .arg(connection_params[ParamPort]), ConnectionBroken, __PRETTY_FUNCTION__, __FILE__, __LINE__); } @@ -295,9 +295,9 @@ attribs_map Connection::getServerInfo(void) if(!connection) throw Exception(OprNotAllocatedConnection,__PRETTY_FUNCTION__,__FILE__,__LINE__); - info[SERVER_PID]=QString::number(PQbackendPID(connection)); - info[SERVER_VERSION]=getPgSQLVersion(); - info[SERVER_PROTOCOL]=QString::number(PQprotocolVersion(connection)); + info[ServerPid]=QString::number(PQbackendPID(connection)); + info[ServerVersion]=getPgSQLVersion(); + info[ServerProtocol]=QString::number(PQprotocolVersion(connection)); return(info); } @@ -314,21 +314,21 @@ QString Connection::getConnectionId(bool host_port_only, bool incl_db_name) if(!isConfigured()) return(QString()); - if(!connection_params[PARAM_SERVER_FQDN].isEmpty()) - addr=connection_params[PARAM_SERVER_FQDN]; + if(!connection_params[ParamServerFqdn].isEmpty()) + addr=connection_params[ParamServerFqdn]; else - addr=connection_params[PARAM_SERVER_IP]; + addr=connection_params[ParamServerIp]; - if(!connection_params[PARAM_PORT].isEmpty()) - port = QString(":%1").arg(connection_params[PARAM_PORT]); + if(!connection_params[ParamPort].isEmpty()) + port = QString(":%1").arg(connection_params[ParamPort]); if(incl_db_name) - db_name = QString("%1@").arg(connection_params[PARAM_DB_NAME]); + db_name = QString("%1@").arg(connection_params[ParamDbName]); if(host_port_only) return(QString("%1%2%3").arg(db_name, addr, port)); else - return(QString("%1%2 (%3%4)").arg(db_name, connection_params[PARAM_ALIAS], addr, port)); + return(QString("%1%2 (%3%4)").arg(db_name, connection_params[ParamAlias], addr, port)); } bool Connection::isStablished(void) @@ -463,17 +463,17 @@ void Connection::executeDDLCommand(const QString &sql) void Connection::setDefaultForOperation(unsigned op_id, bool value) { - if(op_id > OP_NONE) + if(op_id > OpNone) throw Exception(RefElementInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); - else if(op_id!=OP_NONE) + else if(op_id!=OpNone) default_for_oper[op_id]=value; } bool Connection::isDefaultForOperation(unsigned op_id) { - if(op_id > OP_NONE) + if(op_id > OpNone) throw Exception(RefElementInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); - else if(op_id==OP_NONE) + else if(op_id==OpNone) return(false); return(default_for_oper[op_id]); @@ -481,7 +481,7 @@ bool Connection::isDefaultForOperation(unsigned op_id) void Connection::switchToDatabase(const QString &dbname) { - QString prev_dbname=connection_params[PARAM_DB_NAME]; + QString prev_dbname=connection_params[ParamDbName]; try { @@ -490,7 +490,7 @@ void Connection::switchToDatabase(const QString &dbname) close(); //Change the database name and reconfigure the connection string - connection_params[PARAM_DB_NAME]=dbname; + connection_params[ParamDbName]=dbname; generateConnectionString(); //Reopen connection @@ -498,7 +498,7 @@ void Connection::switchToDatabase(const QString &dbname) } catch(Exception &e) { - connection_params[PARAM_DB_NAME]=prev_dbname; + connection_params[ParamDbName]=prev_dbname; connect(); throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); @@ -515,7 +515,7 @@ void Connection::operator = (const Connection &conn) this->connection_str=conn.connection_str; this->connection=nullptr; - for(unsigned idx=OP_VALIDATION; idx <= OP_DIFF; idx++) + for(unsigned idx=OpValidation; idx <= OpDiff; idx++) default_for_oper[idx]=conn.default_for_oper[idx]; } diff --git a/libpgconnector/src/connection.h b/libpgconnector/src/connection.h index 892ef13452..610982a918 100644 --- a/libpgconnector/src/connection.h +++ b/libpgconnector/src/connection.h @@ -95,40 +95,40 @@ class Connection { public: //! \brief Constants used to reference the connections parameters - static const QString PARAM_ALIAS, - PARAM_SERVER_FQDN, - PARAM_SERVER_IP, - PARAM_PORT, - PARAM_DB_NAME, - PARAM_USER, - PARAM_PASSWORD, - PARAM_CONN_TIMEOUT, - PARAM_OTHERS, - PARAM_SSL_MODE, - PARAM_SSL_CERT, - PARAM_SSL_KEY, - PARAM_SSL_ROOT_CERT, - PARAM_SSL_CRL, - PARAM_KERBEROS_SERVER, - PARAM_LIB_GSSAPI, - SSL_DESABLE, - SSL_ALLOW, - SSL_PREFER, - SSL_REQUIRE, - SSL_CA_VERIF, - SSL_FULL_VERIF; + static const QString ParamAlias, + ParamServerFqdn, + ParamServerIp, + ParamPort, + ParamDbName, + ParamUser, + ParamPassword, + ParamConnTimeout, + ParamOthers, + ParamSslMode, + ParamSslCert, + ParamSslKey, + ParamSslRootCert, + ParamSslCrl, + ParamKerberosServer, + ParamLibGssapi, + SslDisable, + SslAllow, + SslPrefer, + SslRequire, + SslCaVerify, + SslFullVerify; //! \brief Constants used to reference the server info details (see getServerInfo()) - static const QString SERVER_VERSION, - SERVER_PROTOCOL, - SERVER_PID; + static const QString ServerVersion, + ServerProtocol, + ServerPid; //! \brief Constants used to reference the default usage in model operations (see setDefaultForOperation()) - static constexpr unsigned OP_VALIDATION=0, - OP_EXPORT=1, - OP_IMPORT=2, - OP_DIFF=3, - OP_NONE=4; + static constexpr unsigned OpValidation=0, + OpExport=1, + OpImport=2, + OpDiff=3, + OpNone=4; Connection(void); Connection(const attribs_map ¶ms); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 7cfd5b2dde..ed580c2bc7 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -143,9 +143,9 @@ void Aggregate::setTypesAttribute(unsigned def_type) count=data_types.size(); for(i=0; i < count; i++) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { - str_types+=data_types[i].getCodeDefinition(SchemaParser::SQL_DEFINITION); + str_types+=data_types[i].getCodeDefinition(SchemaParser::SqlDefinition); if(i < (count-1)) str_types+=','; } else str_types+=data_types[i].getCodeDefinition(def_type); @@ -153,7 +153,7 @@ void Aggregate::setTypesAttribute(unsigned def_type) /* Case none data type is specified for the aggregate creates an aggregate that accepts any possible data '*' e.g. function(*) */ - if(def_type == SchemaParser::SQL_DEFINITION && str_types.isEmpty()) str_types='*'; + if(def_type == SchemaParser::SqlDefinition && str_types.isEmpty()) str_types='*'; attributes[ParsersAttributes::TYPES]=str_types; } @@ -228,7 +228,7 @@ QString Aggregate::getCodeDefinition(unsigned def_type) if(functions[TRANSITION_FUNC]) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::TRANSITION_FUNC]=functions[TRANSITION_FUNC]->getSignature(); else { @@ -240,7 +240,7 @@ QString Aggregate::getCodeDefinition(unsigned def_type) if(functions[FINAL_FUNC]) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::FINAL_FUNC]=functions[FINAL_FUNC]->getSignature(); else { @@ -252,7 +252,7 @@ QString Aggregate::getCodeDefinition(unsigned def_type) if(sort_operator) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::SORT_OP]=sort_operator->getName(true); else attributes[ParsersAttributes::SORT_OP]=sort_operator->getCodeDefinition(def_type,true); @@ -261,7 +261,7 @@ QString Aggregate::getCodeDefinition(unsigned def_type) if(!initial_condition.isEmpty()) attributes[ParsersAttributes::INITIAL_COND]=initial_condition; - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::STATE_TYPE]=*(state_type); else attributes[ParsersAttributes::STATE_TYPE]=state_type.getCodeDefinition(def_type,ParsersAttributes::STATE_TYPE); @@ -271,7 +271,7 @@ QString Aggregate::getCodeDefinition(unsigned def_type) QString Aggregate::getDropDefinition(bool cascade) { - setTypesAttribute(SchemaParser::SQL_DEFINITION); + setTypesAttribute(SchemaParser::SqlDefinition); return(BaseObject::getDropDefinition(cascade)); } @@ -279,7 +279,7 @@ QString Aggregate::getAlterDefinition(BaseObject *object) { try { - setTypesAttribute(SchemaParser::SQL_DEFINITION); + setTypesAttribute(SchemaParser::SqlDefinition); return(BaseObject::getAlterDefinition(object)); } catch(Exception &e) @@ -297,7 +297,7 @@ QString Aggregate::getSignature(bool format) else { for(auto &tp : data_types) - types.push_back(tp.getCodeDefinition(SchemaParser::SQL_DEFINITION)); + types.push_back(tp.getCodeDefinition(SchemaParser::SqlDefinition)); } return(BaseObject::getSignature(format) + QString("(%1)").arg(types.join(','))); diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 8b38285531..20a24ab3e5 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -83,7 +83,7 @@ void BaseGraphicObject::setPositionAttribute(void) { attributes[ParsersAttributes::X_POS]=QString("%1").arg(position.x()); attributes[ParsersAttributes::Y_POS]=QString("%1").arg(position.y()); - attributes[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XML_DEFINITION); + attributes[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XmlDefinition); } void BaseGraphicObject::setPosition(QPointF pos) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 7f8022d92b..cfb2766425 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -696,11 +696,11 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) { QString code_def; - if((def_type==SchemaParser::SQL_DEFINITION && + if((def_type==SchemaParser::SqlDefinition && obj_type!=ObjBaseObject && obj_type!=ObjBaseRelationship && obj_type!=ObjBaseTable && obj_type!=ObjTextbox) || - (def_type==SchemaParser::XML_DEFINITION && + (def_type==SchemaParser::XmlDefinition && obj_type!=ObjBaseObject && obj_type!=ObjBaseTable)) { bool format=false; @@ -709,26 +709,26 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[ParsersAttributes::SQL_DISABLED]=(sql_disabled ? ParsersAttributes::_TRUE_ : QString()); //Formats the object's name in case the SQL definition is being generated - format=((def_type==SchemaParser::SQL_DEFINITION) || - (def_type==SchemaParser::XML_DEFINITION && reduced_form && + format=((def_type==SchemaParser::SqlDefinition) || + (def_type==SchemaParser::XmlDefinition && reduced_form && obj_type!=ObjTextbox && obj_type!=ObjRelationship)); setBasicAttributes(format); if(schema) { - if(def_type==SchemaParser::XML_DEFINITION) + if(def_type==SchemaParser::XmlDefinition) attributes[ParsersAttributes::SCHEMA]=schema->getCodeDefinition(def_type, true); else attributes[ParsersAttributes::SCHEMA]=schema->getName(format); } - if(def_type==SchemaParser::XML_DEFINITION) + if(def_type==SchemaParser::XmlDefinition) attributes[ParsersAttributes::PROTECTED]=(is_protected ? ParsersAttributes::_TRUE_ : QString()); if(tablespace) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::TABLESPACE]=tablespace->getName(format); else attributes[ParsersAttributes::TABLESPACE]=tablespace->getCodeDefinition(def_type, true); @@ -736,7 +736,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(collation && attributes[ParsersAttributes::COLLATION].isEmpty()) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::COLLATION]=collation->getName(format); else attributes[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); @@ -744,7 +744,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(owner) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { attributes[ParsersAttributes::OWNER]=owner->getName(format); @@ -768,7 +768,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(!comment.isEmpty()) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::COMMENT]=QString(comment).replace(QString("'"), QString("''")); else attributes[ParsersAttributes::COMMENT]=comment; @@ -783,7 +783,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[ParsersAttributes::APPENDED_SQL]=appended_sql; - if(def_type==SchemaParser::XML_DEFINITION) + if(def_type==SchemaParser::XmlDefinition) { schparser.ignoreUnkownAttributes(true); attributes[ParsersAttributes::APPENDED_SQL]= @@ -799,7 +799,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[ParsersAttributes::PREPENDED_SQL]=prepended_sql; - if(def_type==SchemaParser::XML_DEFINITION) + if(def_type==SchemaParser::XmlDefinition) { schparser.ignoreUnkownAttributes(true); attributes[ParsersAttributes::PREPENDED_SQL]= @@ -811,7 +811,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) } } - if(def_type==SchemaParser::SQL_DEFINITION && this->acceptsDropCommand()) + if(def_type==SchemaParser::SqlDefinition && this->acceptsDropCommand()) { attributes[ParsersAttributes::DROP]=getDropDefinition(true); attributes[ParsersAttributes::DROP].remove(ParsersAttributes::DDL_END_TOKEN + '\n'); @@ -824,7 +824,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) code_def+=schparser.getCodeDefinition(objs_schemas[obj_type], attributes, def_type); //Internally disabling the SQL definition - if(sql_disabled && def_type==SchemaParser::SQL_DEFINITION) + if(sql_disabled && def_type==SchemaParser::SqlDefinition) { //Creates a text stream and insert an comment start token on each line QTextStream ts(&code_def); @@ -842,8 +842,8 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) //Database object doesn't handles cached code. if(use_cached_code && obj_type!=ObjDatabase) { - if(def_type==SchemaParser::SQL_DEFINITION || - (!reduced_form && def_type==SchemaParser::XML_DEFINITION)) + if(def_type==SchemaParser::SqlDefinition || + (!reduced_form && def_type==SchemaParser::XmlDefinition)) cached_code[def_type]=code_def; else if(reduced_form) cached_reduced_code=code_def; @@ -1081,8 +1081,8 @@ bool BaseObject::isCodeDiffersFrom(BaseObject *object, const vector &ig try { - return(BaseObject::isCodeDiffersFrom(this->getCodeDefinition(SchemaParser::XML_DEFINITION), - object->getCodeDefinition(SchemaParser::XML_DEFINITION), + return(BaseObject::isCodeDiffersFrom(this->getCodeDefinition(SchemaParser::XmlDefinition), + object->getCodeDefinition(SchemaParser::XmlDefinition), ignored_attribs, ignored_tags)); } catch(Exception &e) @@ -1093,14 +1093,14 @@ bool BaseObject::isCodeDiffersFrom(BaseObject *object, const vector &ig QString BaseObject::getCachedCode(unsigned def_type, bool reduced_form) { - if(use_cached_code && def_type==SchemaParser::SQL_DEFINITION && schparser.getPgSQLVersion()!=BaseObject::pgsql_ver) + if(use_cached_code && def_type==SchemaParser::SqlDefinition && schparser.getPgSQLVersion()!=BaseObject::pgsql_ver) code_invalidated=true; if(!code_invalidated && ((!reduced_form && !cached_code[def_type].isEmpty()) || - (def_type==SchemaParser::XML_DEFINITION && reduced_form && !cached_reduced_code.isEmpty()))) + (def_type==SchemaParser::XmlDefinition && reduced_form && !cached_reduced_code.isEmpty()))) { - if(def_type==SchemaParser::XML_DEFINITION && reduced_form) + if(def_type==SchemaParser::XmlDefinition && reduced_form) return(cached_reduced_code); else return(cached_code[def_type]); @@ -1131,7 +1131,7 @@ QString BaseObject::getDropDefinition(bool cascade) attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : QString()); - return(schparser.getCodeDefinition(ParsersAttributes::DROP, attribs, SchemaParser::SQL_DEFINITION)); + return(schparser.getCodeDefinition(ParsersAttributes::DROP, attribs, SchemaParser::SqlDefinition)); } else return(QString()); @@ -1239,7 +1239,7 @@ QString BaseObject::getAlterCommentDefinition(BaseObject *object, attribs_map at schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - return(schparser.getCodeDefinition(ParsersAttributes::COMMENT, attributes, SchemaParser::SQL_DEFINITION)); + return(schparser.getCodeDefinition(ParsersAttributes::COMMENT, attributes, SchemaParser::SqlDefinition)); } return(QString()); diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index ae2fd657b3..ded6fd2a01 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -349,7 +349,7 @@ void BaseRelationship::setRelationshipAttributes(void) { attributes[ParsersAttributes::X_POS]=QString("%1").arg(points[i].x()); attributes[ParsersAttributes::Y_POS]=QString("%1").arg(points[i].y()); - str_aux+=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XML_DEFINITION); + str_aux+=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XmlDefinition); } attributes[ParsersAttributes::POINTS]=str_aux; @@ -360,9 +360,9 @@ void BaseRelationship::setRelationshipAttributes(void) { attributes[ParsersAttributes::X_POS]=QString("%1").arg(lables_dist[i].x()); attributes[ParsersAttributes::Y_POS]=QString("%1").arg(lables_dist[i].y()); - attributes[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XML_DEFINITION); + attributes[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XmlDefinition); attributes[ParsersAttributes::REF_TYPE]=label_attribs[i]; - str_aux+=schparser.getCodeDefinition(ParsersAttributes::LABEL, attributes, SchemaParser::XML_DEFINITION); + str_aux+=schparser.getCodeDefinition(ParsersAttributes::LABEL, attributes, SchemaParser::XmlDefinition); } } @@ -376,9 +376,9 @@ QString BaseRelationship::getCachedCode(unsigned def_type) { if(!code_invalidated && ((!cached_code[def_type].isEmpty()) || - (def_type==SchemaParser::XML_DEFINITION && !cached_reduced_code.isEmpty()))) + (def_type==SchemaParser::XmlDefinition && !cached_reduced_code.isEmpty()))) { - if(def_type==SchemaParser::XML_DEFINITION && !cached_reduced_code.isEmpty()) + if(def_type==SchemaParser::XmlDefinition && !cached_reduced_code.isEmpty()) return(cached_reduced_code); else return(cached_code[def_type]); @@ -405,13 +405,13 @@ QString BaseRelationship::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type); if(!code_def.isEmpty()) return(code_def); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { if(rel_type!=RELATIONSHIP_FK) return(QString()); else { - cached_code[def_type] = reference_fk->getCodeDefinition(SchemaParser::SQL_DEFINITION); + cached_code[def_type] = reference_fk->getCodeDefinition(SchemaParser::SqlDefinition); return(cached_code[def_type]); } } @@ -425,7 +425,7 @@ QString BaseRelationship::getCodeDefinition(unsigned def_type) if(!reduced_form) cached_reduced_code.clear(); - return(BaseObject::getCodeDefinition(SchemaParser::XML_DEFINITION,reduced_form)); + return(BaseObject::getCodeDefinition(SchemaParser::XmlDefinition,reduced_form)); } } diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index cc31948643..00341adb7a 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -164,7 +164,7 @@ QString Cast::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { attributes[ParsersAttributes::SOURCE_TYPE]=(*types[SRC_TYPE]); attributes[ParsersAttributes::DEST_TYPE]=(*types[DST_TYPE]); @@ -177,7 +177,7 @@ QString Cast::getCodeDefinition(unsigned def_type) if(!is_in_out && cast_function) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::FUNCTION]=cast_function->getSignature(); else attributes[ParsersAttributes::FUNCTION]=cast_function->getCodeDefinition(def_type, true); @@ -192,7 +192,7 @@ QString Cast::getCodeDefinition(unsigned def_type) else attributes[ParsersAttributes::CAST_TYPE]=QString(); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::CAST_TYPE]=attributes[ParsersAttributes::CAST_TYPE].toUpper(); return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index 2c5113a0b7..f8a2c37068 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -104,7 +104,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[ParsersAttributes::LOCALE]=locale; - if(def_type==SchemaParser::SQL_DEFINITION && encoding!=BaseType::null) + if(def_type==SchemaParser::SqlDefinition && encoding!=BaseType::null) attributes[ParsersAttributes::LOCALE]=locale + "." + (~encoding).toLower(); } else if(collation) @@ -120,7 +120,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[lc_attribs[i]]=getLocalization(i); - if(def_type==SchemaParser::SQL_DEFINITION && encoding!=BaseType::null && + if(def_type==SchemaParser::SqlDefinition && encoding!=BaseType::null && !attributes[lc_attribs[i]].isEmpty()) attributes[lc_attribs[i]]+="." + (~encoding).toLower(); } diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 45606df292..c697360e96 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -261,7 +261,7 @@ QString Column::getCodeDefinition(unsigned def_type) else { //Configuring the default value of the column to get the next value of the sequence - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::DEFAULT_VALUE]=QString("nextval('%1'::regclass)").arg(sequence->getSignature()); attributes[ParsersAttributes::SEQUENCE]=sequence->getName(true); @@ -296,7 +296,7 @@ QString Column::getAlterDefinition(BaseObject *object) (this->type.isEquivalentTo(col->type) && ((this->type.hasVariableLength() && (this->type.getLength()!=col->type.getLength())) || (this->type.acceptsPrecision() && (this->type.getPrecision()!=col->type.getPrecision()))))) - attribs[ParsersAttributes::TYPE]=col->type.getCodeDefinition(SchemaParser::SQL_DEFINITION); + attribs[ParsersAttributes::TYPE]=col->type.getCodeDefinition(SchemaParser::SqlDefinition); if(col->sequence) def_val=QString("nextval('%1'::regclass)").arg(col->sequence->getSignature()); diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 800f6e1df0..2598bb8676 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -192,7 +192,7 @@ void Constraint::setColumnsAttribute(unsigned col_type, unsigned def_type, bool Column *col=nullptr; QString str_cols, attrib; unsigned i, count; - bool format=(def_type==SchemaParser::SQL_DEFINITION); + bool format=(def_type==SchemaParser::SqlDefinition); if(col_type==REFERENCED_COLS) { @@ -214,8 +214,8 @@ void Constraint::setColumnsAttribute(unsigned col_type, unsigned def_type, bool through relationship can not be included because they are inserted to the restriction on the time of creation of the relationship from its XML so the parameter 'inc_addedbyrel' can be used to solve this case. */ - if((def_type==SchemaParser::SQL_DEFINITION) || - ((def_type==SchemaParser::XML_DEFINITION) && + if((def_type==SchemaParser::SqlDefinition) || + ((def_type==SchemaParser::XmlDefinition) && ((inc_addedbyrel && col->isAddedByRelationship()) || (inc_addedbyrel && !col->isAddedByRelationship()) || (!inc_addedbyrel && !col->isAddedByRelationship())))) @@ -626,7 +626,7 @@ void Constraint::setExcludeElementsAttribute(unsigned def_type) for(i=0; i < count; i++) { str_elem+=excl_elements[i].getCodeDefinition(def_type); - if(i < (count-1) && def_type==SchemaParser::SQL_DEFINITION) str_elem+=','; + if(i < (count-1) && def_type==SchemaParser::SqlDefinition) str_elem+=','; } attributes[ParsersAttributes::ELEMENTS]=str_elem; @@ -752,8 +752,8 @@ bool Constraint::isCodeDiffersFrom(BaseObject *object, const vector &ig try { - return(BaseObject::isCodeDiffersFrom(this->getCodeDefinition(SchemaParser::XML_DEFINITION, true), - object->getCodeDefinition(SchemaParser::XML_DEFINITION, true), + return(BaseObject::isCodeDiffersFrom(this->getCodeDefinition(SchemaParser::XmlDefinition, true), + object->getCodeDefinition(SchemaParser::XmlDefinition, true), ignored_attribs, ignored_tags)); } catch(Exception &e) diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index 057ee3ceb4..e94c6bed92 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -121,7 +121,7 @@ QString Conversion::getCodeDefinition(unsigned def_type) if(conversion_func) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::FUNCTION]=conversion_func->getName(true); else attributes[ParsersAttributes::FUNCTION]=conversion_func->getCodeDefinition(def_type, true); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index db11cffb3a..9443dd636e 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -430,9 +430,9 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) try { if(obj_type==ObjTextbox || obj_type==ObjBaseRelationship) - object->getCodeDefinition(SchemaParser::XML_DEFINITION); + object->getCodeDefinition(SchemaParser::XmlDefinition); else - object->getCodeDefinition(SchemaParser::SQL_DEFINITION); + object->getCodeDefinition(SchemaParser::SqlDefinition); } catch(Exception &e) { @@ -770,7 +770,7 @@ void DatabaseModel::destroyObjects(void) out << e.getExceptionsText() << endl; } - objects = getCreationOrder(SchemaParser::XML_DEFINITION, true); + objects = getCreationOrder(SchemaParser::XmlDefinition, true); ritr = objects.rbegin(), ritr_end = objects.rend(); @@ -1779,7 +1779,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) //When found some special object, stores is xml definition if(found) - xml_special_objs[constr->getObjectId()]=constr->getCodeDefinition(SchemaParser::XML_DEFINITION, true); + xml_special_objs[constr->getObjectId()]=constr->getCodeDefinition(SchemaParser::XmlDefinition, true); } else if(tab_obj_type[type_id]==ObjTrigger) { @@ -1787,7 +1787,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) found=trigger->isReferRelationshipAddedColumn(); if(found) - xml_special_objs[trigger->getObjectId()]=trigger->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_special_objs[trigger->getObjectId()]=trigger->getCodeDefinition(SchemaParser::XmlDefinition); } else { @@ -1795,7 +1795,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) found=index->isReferRelationshipAddedColumn(); if(found) - xml_special_objs[index->getObjectId()]=index->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_special_objs[index->getObjectId()]=index->getCodeDefinition(SchemaParser::XmlDefinition); } if(found) @@ -1846,7 +1846,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) if(sequence->isReferRelationshipAddedColumn()) { - xml_special_objs[sequence->getObjectId()]=sequence->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_special_objs[sequence->getObjectId()]=sequence->getCodeDefinition(SchemaParser::XmlDefinition); removeSequence(sequence); delete(sequence); } @@ -1864,7 +1864,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) if(view->isReferRelationshipAddedColumn()) { - xml_special_objs[view->getObjectId()]=view->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_special_objs[view->getObjectId()]=view->getCodeDefinition(SchemaParser::XmlDefinition); /* Relationships linking the view and the referenced tables are considered as special objects in this case only to be recreated more easely latter */ @@ -1883,7 +1883,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) if(rel) { - xml_special_objs[rel->getObjectId()]=rel->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_special_objs[rel->getObjectId()]=rel->getCodeDefinition(SchemaParser::XmlDefinition); removeRelationship(rel); delete(rel); } @@ -1895,7 +1895,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) objects=view->getObjects(); for(auto &obj : objects) { - xml_special_objs[obj->getObjectId()]=obj->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_special_objs[obj->getObjectId()]=obj->getCodeDefinition(SchemaParser::XmlDefinition); view->removeObject(obj); delete(obj); } @@ -1918,7 +1918,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) if(tab_obj) { - xml_special_objs[permission->getObjectId()]=permission->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_special_objs[permission->getObjectId()]=permission->getCodeDefinition(SchemaParser::XmlDefinition); removePermission(permission); delete(permission); } @@ -3031,7 +3031,7 @@ void DatabaseModel::loadModel(const QString &filename) def_objs[ObjCollation]=attribs[ParsersAttributes::DEFAULT_COLLATION]; def_objs[ObjTablespace]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -3083,7 +3083,7 @@ void DatabaseModel::loadModel(const QString &filename) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } this->BaseObject::setProtected(protected_model); @@ -3251,7 +3251,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -3263,7 +3263,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) if(elem_name==ParsersAttributes::COMMENT) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); object->setComment(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -3306,14 +3306,14 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) else if(elem_name==ParsersAttributes::APPENDED_SQL) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); object->setAppendedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } else if(elem_name==ParsersAttributes::PREPENDED_SQL) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); object->setPrependedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -3334,7 +3334,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) } } } - while(!has_error && xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(!has_error && xmlparser.accessElement(XMLParser::NextElement)); } xmlparser.restorePosition(); @@ -3479,7 +3479,7 @@ Role *DatabaseModel::createRole(void) role->setOption(op_vect[i], marked); } - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -3526,7 +3526,7 @@ Role *DatabaseModel::createRole(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -3598,7 +3598,7 @@ Language *DatabaseModel::createLanguage(void) lang->setTrusted(attribs[ParsersAttributes::TRUSTED]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -3645,7 +3645,7 @@ Language *DatabaseModel::createLanguage(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } @@ -3701,7 +3701,7 @@ Function *DatabaseModel::createFunction(void) if(!attribs[ParsersAttributes::ROW_AMOUNT].isEmpty()) func->setRowAmount(attribs[ParsersAttributes::ROW_AMOUNT].toInt()); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -3717,7 +3717,7 @@ Function *DatabaseModel::createFunction(void) try { - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); do { @@ -3737,7 +3737,7 @@ Function *DatabaseModel::createFunction(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); xmlparser.restorePosition(); } @@ -3781,14 +3781,14 @@ Function *DatabaseModel::createFunction(void) func->setLibrary(attribs_aux[ParsersAttributes::LIBRARY]); func->setSymbol(attribs_aux[ParsersAttributes::SYMBOL]); } - else if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + else if(xmlparser.accessElement(XMLParser::ChildElement)) func->setSourceCode(xmlparser.getElementContent()); xmlparser.restorePosition(); } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -3825,7 +3825,7 @@ Parameter DatabaseModel::createParameter(void) param.setName(attribs[ParsersAttributes::NAME]); param.setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -3839,7 +3839,7 @@ Parameter DatabaseModel::createParameter(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } param.setIn(attribs[ParsersAttributes::PARAM_IN]==ParsersAttributes::_TRUE_); @@ -3872,7 +3872,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) tpattrib.setName(attribs[ParsersAttributes::NAME]); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -3905,7 +3905,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } xmlparser.restorePosition(); @@ -4044,7 +4044,7 @@ Type *DatabaseModel::createType(void) func_types[ParsersAttributes::SUBTYPE_DIFF_FUNC]=Type::SUBTYPE_DIFF_FUNC; } - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4137,7 +4137,7 @@ Type *DatabaseModel::createType(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -4177,7 +4177,7 @@ Domain *DatabaseModel::createDomain(void) domain->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4194,14 +4194,14 @@ Domain *DatabaseModel::createDomain(void) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XMLParser::ChildElement); domain->addCheckConstraint(attribs[ParsersAttributes::NAME], xmlparser.getElementContent()); xmlparser.restorePosition(); } } } - while(xmlparser.accessElement(xmlparser.NEXT_ELEMENT)); + while(xmlparser.accessElement(xmlparser.NextElement)); } } catch(Exception &e) @@ -4237,7 +4237,7 @@ Cast *DatabaseModel::createCast(void) cast->setInOut(attribs[ParsersAttributes::IO_CAST]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4274,7 +4274,7 @@ Cast *DatabaseModel::createCast(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -4307,7 +4307,7 @@ Conversion *DatabaseModel::createConversion(void) conv->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4333,7 +4333,7 @@ Conversion *DatabaseModel::createConversion(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -4372,7 +4372,7 @@ Operator *DatabaseModel::createOperator(void) oper_types[ParsersAttributes::COMMUTATOR_OP]=Operator::OPER_COMMUTATOR; oper_types[ParsersAttributes::NEGATOR_OP]=Operator::OPER_NEGATOR; - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4428,7 +4428,7 @@ Operator *DatabaseModel::createOperator(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -4464,7 +4464,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) elem_types[ParsersAttributes::OPERATOR]=OperatorClassElement::OPERATOR_ELEM; elem_types[ParsersAttributes::STORAGE]=OperatorClassElement::STORAGE_ELEM; - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4502,7 +4502,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) elem_type=elem_types[attribs[ParsersAttributes::TYPE]]; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); xmlparser.getElementAttributes(attribs); if(elem_type==OperatorClassElement::STORAGE_ELEM) @@ -4520,10 +4520,10 @@ OperatorClass *DatabaseModel::createOperatorClass(void) object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjOperator); class_elem.setOperator(dynamic_cast(object),stg_number); - if(xmlparser.hasElement(XMLParser::NEXT_ELEMENT)) + if(xmlparser.hasElement(XMLParser::NextElement)) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::NEXT_ELEMENT); + xmlparser.accessElement(XMLParser::NextElement); xmlparser.getElementAttributes(attribs_aux); object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjOpFamily); @@ -4546,7 +4546,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -4595,7 +4595,7 @@ Aggregate *DatabaseModel::createAggregate(void) aggreg->setInitialCondition(attribs[ParsersAttributes::INITIAL_COND]); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4636,7 +4636,7 @@ Aggregate *DatabaseModel::createAggregate(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -4676,7 +4676,7 @@ Table *DatabaseModel::createTable(void) table->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); table->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4715,7 +4715,7 @@ Table *DatabaseModel::createTable(void) xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4732,7 +4732,7 @@ Table *DatabaseModel::createTable(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); table->setRelObjectsIndexes(names, idxs, obj_type); names.clear(); @@ -4747,7 +4747,7 @@ Table *DatabaseModel::createTable(void) table->setPartitioningType(aux_attribs[ParsersAttributes::TYPE]); xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4758,7 +4758,7 @@ Table *DatabaseModel::createTable(void) partition_keys.push_back(part_key); } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); table->addPartitionKeys(partition_keys); } @@ -4769,7 +4769,7 @@ Table *DatabaseModel::createTable(void) else if(elem==ParsersAttributes::INITIAL_DATA) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); table->setInitialData(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -4780,7 +4780,7 @@ Table *DatabaseModel::createTable(void) xmlparser.restorePosition(); } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } table->setProtected(table->isProtected()); @@ -4834,7 +4834,7 @@ Column *DatabaseModel::createColumn(void) column->setSequence(seq); } - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -4848,7 +4848,7 @@ Column *DatabaseModel::createColumn(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -4988,7 +4988,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setIndexType(attribs[ParsersAttributes::INDEX_TYPE]); } - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -5004,7 +5004,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) else if(elem==ParsersAttributes::EXPRESSION) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); constr->setExpression(xmlparser.getElementContent()); @@ -5052,7 +5052,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } if(ins_constr_table) @@ -5101,7 +5101,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setSortingEnabled(attribs[ParsersAttributes::USE_SORTING]!=ParsersAttributes::_FALSE_); xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); do { @@ -5229,13 +5229,13 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==ParsersAttributes::EXPRESSION) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); elem.setExpression(xmlparser.getElementContent()); xmlparser.restorePosition(); } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); xmlparser.restorePosition(); } @@ -5320,7 +5320,7 @@ Index *DatabaseModel::createIndex(void) index->setIndexingType(attribs[ParsersAttributes::INDEX_TYPE]); index->setFillFactor(attribs[ParsersAttributes::FACTOR].toUInt()); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -5336,14 +5336,14 @@ Index *DatabaseModel::createIndex(void) else if(elem==ParsersAttributes::PREDICATE) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); str_aux=xmlparser.getElementContent(); xmlparser.restorePosition(); index->setPredicate(str_aux); } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } table->addObject(index); @@ -5391,7 +5391,7 @@ Rule *DatabaseModel::createRule(void) rule->setExecutionType(attribs[ParsersAttributes::EXEC_TYPE]); rule->setEventType(attribs[ParsersAttributes::EVENT_TYPE]); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -5403,7 +5403,7 @@ Rule *DatabaseModel::createRule(void) elem==ParsersAttributes::CONDITION) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); str_aux=xmlparser.getElementContent(); xmlparser.restorePosition(); @@ -5423,7 +5423,7 @@ Rule *DatabaseModel::createRule(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } table->addObject(rule); @@ -5527,7 +5527,7 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setReferecendTable(dynamic_cast(ref_table)); } - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -5557,7 +5557,7 @@ Trigger *DatabaseModel::createTrigger(void) else if(elem==ParsersAttributes::CONDITION) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); str_aux=xmlparser.getElementContent(); xmlparser.restorePosition(); trigger->setCondition(str_aux); @@ -5581,7 +5581,7 @@ Trigger *DatabaseModel::createTrigger(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } table->addObject(trigger); @@ -5623,7 +5623,7 @@ Policy *DatabaseModel::createPolicy(void) policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::_TRUE_); policy->setPolicyCommand(PolicyCmdType(attribs[ParsersAttributes::COMMAND])); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -5635,7 +5635,7 @@ Policy *DatabaseModel::createPolicy(void) { xmlparser.getElementAttributes(attribs); xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); if(attribs[ParsersAttributes::TYPE] == ParsersAttributes::USING_EXP) policy->setUsingExpression(xmlparser.getElementContent()); @@ -5673,7 +5673,7 @@ Policy *DatabaseModel::createPolicy(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } table->addObject(policy); @@ -5702,7 +5702,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) xmlparser.getElementAttributes(attribs); event_trig->setEvent(EventTriggerType(attribs[ParsersAttributes::EVENT])); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -5735,7 +5735,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } @@ -5758,11 +5758,11 @@ GenericSQL *DatabaseModel::createGenericSQL(void) genericsql=new GenericSQL; setBasicAttributes(genericsql); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { if(xmlparser.getElementType()==XML_ELEMENT_NODE && xmlparser.getElementName() == ParsersAttributes::DEFINITION) { - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); genericsql->setDefinition(xmlparser.getElementContent()); } } @@ -5882,7 +5882,7 @@ View *DatabaseModel::createView(void) view->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); view->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -5945,8 +5945,8 @@ View *DatabaseModel::createView(void) xmlparser.savePosition(); str_aux=attribs[ParsersAttributes::ALIAS]; - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XMLParser::ChildElement); reference = Reference(xmlparser.getElementContent(),str_aux); reference.setReferenceAlias(attribs[ParsersAttributes::REF_ALIAS]); @@ -5959,7 +5959,7 @@ View *DatabaseModel::createView(void) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::CTE_EXPRESSION) view->setCommomTableExpression(xmlparser.getElementContent()); @@ -6009,7 +6009,7 @@ View *DatabaseModel::createView(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } /** Special case for refereces used as view definition ** @@ -6132,7 +6132,7 @@ Tag *DatabaseModel::createTag(void) tag=new Tag; setBasicAttributes(tag); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -6147,7 +6147,7 @@ Tag *DatabaseModel::createTag(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } return(tag); @@ -6372,7 +6372,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) rel->setNamePattern(pattern_id[i], attribs[pat_attrib[i]]); } - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -6383,7 +6383,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(elem == ParsersAttributes::EXPRESSION && rel) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); rel->setPartitionBoundingExpr(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -6417,7 +6417,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) { vector points; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); do { @@ -6425,7 +6425,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) points.push_back(QPointF(attribs[ParsersAttributes::X_POS].toDouble(), attribs[ParsersAttributes::Y_POS].toDouble())); } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); base_rel->setPoints(points); xmlparser.restorePosition(); @@ -6436,7 +6436,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) str_aux=attribs[ParsersAttributes::REF_TYPE]; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); xmlparser.getElementAttributes(attribs); xmlparser.restorePosition(); @@ -6461,7 +6461,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -6515,7 +6515,7 @@ Permission *DatabaseModel::createPermission(void) cascade=priv_attribs[ParsersAttributes::CASCADE]==ParsersAttributes::_TRUE_; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); xmlparser.getElementAttributes(attribs); obj_type=BaseObject::getObjectType(attribs[ParsersAttributes::TYPE]); @@ -6619,7 +6619,7 @@ Permission *DatabaseModel::createPermission(void) } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); xmlparser.restorePosition(); } @@ -6714,7 +6714,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) if(conn_limit >= 0) attributes[ParsersAttributes::CONN_LIMIT]=QString("%1").arg(conn_limit); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { QString loc_attribs[]={ ParsersAttributes::_LC_CTYPE_, ParsersAttributes::_LC_COLLATE_ }; @@ -6742,13 +6742,13 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::ALLOW_CONNS]=(allow_conns ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); attributes[ParsersAttributes::TEMPLATE_DB]=template_db; - if(def_type==SchemaParser::SQL_DEFINITION && append_at_eod) + if(def_type==SchemaParser::SqlDefinition && append_at_eod) { bkp_appended_sql=this->appended_sql; this->appended_sql.clear(); } - if(def_type==SchemaParser::SQL_DEFINITION && prepend_at_bod) + if(def_type==SchemaParser::SqlDefinition && prepend_at_bod) { bkp_prepended_sql=this->prepended_sql; this->prepended_sql.clear(); @@ -6758,10 +6758,10 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) { def=this->BaseObject::__getCodeDefinition(def_type); - if(def_type==SchemaParser::SQL_DEFINITION && append_at_eod) + if(def_type==SchemaParser::SqlDefinition && append_at_eod) this->appended_sql=bkp_appended_sql; - if(def_type==SchemaParser::SQL_DEFINITION && prepend_at_bod) + if(def_type==SchemaParser::SqlDefinition && prepend_at_bod) this->prepended_sql=bkp_prepended_sql; return(def); @@ -6788,7 +6788,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) QString def, search_path=QString("pg_catalog,public"), msg=trUtf8("Generating %1 code: `%2' (%3)"), attrib=ParsersAttributes::OBJECTS, attrib_aux, - def_type_str=(def_type==SchemaParser::SQL_DEFINITION ? QString("SQL") : QString("XML")); + def_type_str=(def_type==SchemaParser::SqlDefinition ? QString("SQL") : QString("XML")); Type *usr_type=nullptr; map objects_map; ObjectType obj_type; @@ -6805,7 +6805,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[ParsersAttributes::TABLESPACE]=QString(); attribs_aux[ParsersAttributes::ROLE]=QString(); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { attribs_aux[ParsersAttributes::FUNCTION]=(!functions.empty() ? ParsersAttributes::_TRUE_ : QString()); @@ -6823,7 +6823,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) object=obj_itr.second; obj_type=object->getObjectType(); - if(obj_type==ObjType && def_type==SchemaParser::SQL_DEFINITION) + if(obj_type==ObjType && def_type==SchemaParser::SqlDefinition) { usr_type=dynamic_cast(object); @@ -6835,7 +6835,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } else if(obj_type==ObjDatabase) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { /* The Database has the SQL code definition disabled when generating the code of the entire model because this object cannot be created from a multiline sql command */ @@ -6864,14 +6864,14 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) else if(obj_type==ObjRole || obj_type==ObjTablespace || obj_type==ObjSchema) { //The "public" schema does not have the SQL code definition generated - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attrib_aux=BaseObject::getSchemaName(obj_type); else attrib_aux=attrib; /* The Tablespace has the SQL code definition disabled when generating the code of the entire model because this object cannot be created from a multiline sql command */ - if(obj_type==ObjTablespace && !object->isSystemObject() && def_type==SchemaParser::SQL_DEFINITION) + if(obj_type==ObjTablespace && !object->isSystemObject() && def_type==SchemaParser::SqlDefinition) { //Saving the sql disabled state sql_disabled=object->isSQLDisabled(); @@ -6886,7 +6886,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) //System object doesn't has the XML generated (the only exception is for public schema) else if((obj_type!=ObjSchema && !object->isSystemObject()) || (obj_type==ObjSchema && - ((object->getName()==QString("public") && def_type==SchemaParser::XML_DEFINITION) || + ((object->getName()==QString("public") && def_type==SchemaParser::XmlDefinition) || (object->getName()!=QString("public") && object->getName()!=QString("pg_catalog"))))) { if(object->getObjectType()==ObjSchema) @@ -6906,8 +6906,8 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) gen_defs_count++; - if((def_type==SchemaParser::SQL_DEFINITION && !object->isSQLDisabled()) || - (def_type==SchemaParser::XML_DEFINITION && !object->isSystemObject())) + if((def_type==SchemaParser::SqlDefinition && !object->isSQLDisabled()) || + (def_type==SchemaParser::XmlDefinition && !object->isSystemObject())) { emit s_objectLoaded((gen_defs_count/static_cast(general_obj_cnt)) * 100, msg.arg(def_type_str) @@ -6921,7 +6921,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[ParsersAttributes::MODEL_AUTHOR]=author; attribs_aux[ParsersAttributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; - if(def_type==SchemaParser::XML_DEFINITION) + if(def_type==SchemaParser::XmlDefinition) { attribs_aux[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); attribs_aux[ParsersAttributes::PROTECTED]=(this->is_protected ? ParsersAttributes::_TRUE_ : QString()); @@ -6947,7 +6947,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } catch(Exception &e) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { for(auto &type : types) { @@ -6965,10 +6965,10 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[ParsersAttributes::EXPORT_TO_FILE]=(export_file ? ParsersAttributes::_TRUE_ : QString()); def=schparser.getCodeDefinition(ParsersAttributes::DB_MODEL, attribs_aux, def_type); - if(prepend_at_bod && def_type==SchemaParser::SQL_DEFINITION) + if(prepend_at_bod && def_type==SchemaParser::SqlDefinition) def=QString("-- Prepended SQL commands --\n") + this->prepended_sql + QString("\n---\n\n") + def; - if(append_at_eod && def_type==SchemaParser::SQL_DEFINITION) + if(append_at_eod && def_type==SchemaParser::SqlDefinition) def+=QString("-- Appended SQL commands --\n") + this->appended_sql + QString("\n---\n"); return(def); @@ -6997,7 +6997,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b //The first objects on the map will be roles, tablespaces, schemas and tags for(i=0; i < aux_obj_cnt; i++) { - if(aux_obj_types[i]!=ObjTag || def_type==SchemaParser::XML_DEFINITION) + if(aux_obj_types[i]!=ObjTag || def_type==SchemaParser::XmlDefinition) { obj_list=getObjectList(aux_obj_types[i]); @@ -7012,7 +7012,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b for(i=0; i < count; i++) { //For SQL definition, only the textbox and base relationship does not enters to the code generation list - if(def_type==SchemaParser::SQL_DEFINITION && + if(def_type==SchemaParser::SqlDefinition && (obj_types[i]==ObjTextbox || obj_types[i]==ObjBaseRelationship)) obj_list=nullptr; else @@ -7031,7 +7031,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b } else { - if(def_type==SchemaParser::XML_DEFINITION || !incl_relnn_objs) + if(def_type==SchemaParser::XmlDefinition || !incl_relnn_objs) objects_map[object->getObjectId()]=object; else { @@ -7089,7 +7089,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b 2) Other tables came after the objects on the step 1. 3) The sequences must have their code generated after the tables 4) View are the last objects in the list avoiding table/column reference breaking */ - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { BaseObject *objs[3]={nullptr, nullptr, nullptr}; vector vet_aux, rel_constrs; @@ -9610,7 +9610,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option trUtf8("Saving object `%1' (%2)") .arg(object->getName()).arg(object->getTypeName()), obj_type); - objs_def+=object->getCodeDefinition(SchemaParser::XML_DEFINITION); + objs_def+=object->getCodeDefinition(SchemaParser::XmlDefinition); continue; } //Discarding the relationship added table objects (when extracting aliases) @@ -9864,7 +9864,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option xmlparser.loadXMLFile(filename); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -9986,7 +9986,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(load_objs_aliases && !attribs[ParsersAttributes::ALIAS].isEmpty()) object->setAlias(attribs[ParsersAttributes::ALIAS]); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -10005,7 +10005,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option ref_type=aux_attrib[ParsersAttributes::REF_TYPE]; xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { xmlparser.getElementAttributes(aux_attrib); labels_pos[labels_attrs[ref_type]]=QPointF(aux_attrib[ParsersAttributes::X_POS].toFloat(), @@ -10018,7 +10018,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::APPENDED_SQL].isEmpty()) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); object->setAppendedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -10026,12 +10026,12 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::PREPENDED_SQL].isEmpty()) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); object->setPrependedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } if(BaseGraphicObject::isGraphicObject(obj_type)) @@ -10092,7 +10092,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ObjBaseObject); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 4ddc032f05..890a035329 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -136,7 +136,7 @@ QString Domain::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::CONSTRAINTS]+=schparser.getCodeDefinition(ParsersAttributes::DOM_CONSTRAINT, aux_attribs, def_type); } - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::TYPE]=(*type); else attributes[ParsersAttributes::TYPE]=type.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index d35f225679..062dbd04b1 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -108,7 +108,7 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) if(operator_class) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::OP_CLASS]=operator_class->getName(true); else attributes[ParsersAttributes::OP_CLASS]=operator_class->getCodeDefinition(def_type, true); diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index e6b8cf93f6..a9f2d61a2f 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -111,7 +111,7 @@ QString EventTrigger::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::EVENT]=~event; - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { QStringList str_list; diff --git a/libpgmodeler/src/excludeelement.cpp b/libpgmodeler/src/excludeelement.cpp index 5234f20c02..fd19da9473 100644 --- a/libpgmodeler/src/excludeelement.cpp +++ b/libpgmodeler/src/excludeelement.cpp @@ -25,7 +25,7 @@ QString ExcludeElement::getCodeDefinition(unsigned def_type) if(_operator) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::OPERATOR]=_operator->getName(true); else attributes[ParsersAttributes::OPERATOR]=_operator->getCodeDefinition(def_type, true); diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 9c630298cb..340d824c31 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -85,7 +85,7 @@ QString Extension::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::NAME]=this->getName(def_type==SchemaParser::SQL_DEFINITION, false); + attributes[ParsersAttributes::NAME]=this->getName(def_type==SchemaParser::SqlDefinition, false); attributes[ParsersAttributes::HANDLES_TYPE]=(handles_type ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::CUR_VERSION]=versions[CUR_VERSION]; attributes[ParsersAttributes::OLD_VERSION]=versions[OLD_VERSION]; diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index ac5ae5163c..037ff55783 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -136,7 +136,7 @@ void Function::setParametersAttribute(unsigned def_type) str_param+=parameters[i].getCodeDefinition(def_type); } - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) str_param.remove(str_param.size()-2,2); attributes[ParsersAttributes::PARAMETERS]=str_param; @@ -153,7 +153,7 @@ void Function::setTableReturnTypeAttribute(unsigned def_type) str_type+=ret_table_columns[i].getCodeDefinition(def_type); } - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) str_type.remove(str_type.size()-2,2); attributes[ParsersAttributes::RETURN_TABLE]=str_type; @@ -433,7 +433,7 @@ void Function::createSignature(bool format, bool prepend_schema) (parameters[i].isIn() && parameters[i].isOut()) || (parameters[i].isIn() && !parameters[i].isOut())) { - str_param+=parameters[i].getCodeDefinition(SchemaParser::SQL_DEFINITION, true).trimmed(); + str_param+=parameters[i].getCodeDefinition(SchemaParser::SqlDefinition, true).trimmed(); parameters[i].setCodeInvalidated(true); } } @@ -463,7 +463,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) if(language) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { attributes[ParsersAttributes::LANGUAGE]=language->getName(false); attributes[ParsersAttributes::RETURN_TYPE]=(*return_type); @@ -511,7 +511,7 @@ QString Function::getAlterDefinition(BaseObject *object) this->library!=func->library || this->symbol!=func->symbol) { - attribs[ParsersAttributes::DEFINITION]=func->getCodeDefinition(SchemaParser::SQL_DEFINITION); + attribs[ParsersAttributes::DEFINITION]=func->getCodeDefinition(SchemaParser::SqlDefinition); attribs[ParsersAttributes::DEFINITION].replace(QString("CREATE FUNCTION"), QString("CREATE OR REPLACE FUNCTION")); } else diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 0bdcfbdb67..d028ee3822 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -51,7 +51,7 @@ void Index::setIndexElementsAttribute(unsigned def_type) for(i=0; i < count; i++) { str_elem+=idx_elements[i].getCodeDefinition(def_type); - if(i < (count-1) && def_type==SchemaParser::SQL_DEFINITION) str_elem+=','; + if(i < (count-1) && def_type==SchemaParser::SqlDefinition) str_elem+=','; } attributes[ParsersAttributes::ELEMENTS]=str_elem; @@ -341,7 +341,7 @@ QString Index::getCodeDefinition(unsigned def_type) { attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); - if(def_type==SchemaParser::SQL_DEFINITION && getParentTable()->getSchema()) + if(def_type==SchemaParser::SqlDefinition && getParentTable()->getSchema()) attributes[ParsersAttributes::SCHEMA]=getParentTable()->getSchema()->getName(true); } @@ -356,7 +356,7 @@ QString Index::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::FACTOR]=QString("%1").arg(fill_factor); attributes[ParsersAttributes::STORAGE_PARAMS]=ParsersAttributes::_TRUE_; } - else if(def_type==SchemaParser::XML_DEFINITION) + else if(def_type==SchemaParser::XmlDefinition) attributes[ParsersAttributes::FACTOR]=QString("0"); /* Case the index doesn't referece some column added by relationship it will be declared diff --git a/libpgmodeler/src/indexelement.cpp b/libpgmodeler/src/indexelement.cpp index 95a93d0970..75e562a746 100644 --- a/libpgmodeler/src/indexelement.cpp +++ b/libpgmodeler/src/indexelement.cpp @@ -43,7 +43,7 @@ QString IndexElement::getCodeDefinition(unsigned def_type) if(collation) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::COLLATION]=collation->getName(true); else attributes[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index ce0e6fd35f..09e7e65928 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -122,14 +122,14 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[ParsersAttributes::TRUSTED]=(is_trusted ? ParsersAttributes::_TRUE_ : QString()); - if(!reduced_form && def_type==SchemaParser::XML_DEFINITION) + if(!reduced_form && def_type==SchemaParser::XmlDefinition) reduced_form=(!functions[VALIDATOR_FUNC] && !functions[HANDLER_FUNC] && !functions[INLINE_FUNC] && !this->getOwner()); for(i=0; i < 3; i++) { if(functions[i]) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[attribs_func[i]]=functions[i]->getName(true); else { diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 54adac8d98..e57b05dd1b 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -427,9 +427,9 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje tab_obj->setParentTable(parent_tab); if(tab_obj->getObjectType()==ObjConstraint) - operation->setXMLDefinition(dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::XML_DEFINITION, true)); + operation->setXMLDefinition(dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::XmlDefinition, true)); else - operation->setXMLDefinition(tab_obj->getCodeDefinition(SchemaParser::XML_DEFINITION)); + operation->setXMLDefinition(tab_obj->getCodeDefinition(SchemaParser::XmlDefinition)); } operation->setParentObject(parent_obj); @@ -463,7 +463,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje { if((obj_type==ObjSequence && dynamic_cast(object)->isReferRelationshipAddedColumn()) || (obj_type==ObjView && dynamic_cast(object)->isReferRelationshipAddedColumn())) - operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XML_DEFINITION)); + operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XmlDefinition)); //Case a specific index wasn't specified if(object_idx < 0) @@ -475,7 +475,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje } if(obj_type==ObjColumn && dynamic_cast(object)->getType().isUserType()) - operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XML_DEFINITION)); + operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XmlDefinition)); operation->setObjectIndex(obj_idx); operations.push_back(operation); @@ -760,7 +760,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) orig_obj=model->getObject(obj_idx, obj_type); if(aux_obj) - oper->setXMLDefinition(orig_obj->getCodeDefinition(SchemaParser::XML_DEFINITION)); + oper->setXMLDefinition(orig_obj->getCodeDefinition(SchemaParser::XmlDefinition)); //For pk constraint, before restore the previous configuration, uncheck the not-null flag of the source columns @@ -805,7 +805,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) else if(parent_rel) parent_rel->addObject(dynamic_cast(object), obj_idx); else if(object->getObjectType()==ObjTable) - dynamic_cast

(object)->getCodeDefinition(SchemaParser::SQL_DEFINITION); + dynamic_cast
(object)->getCodeDefinition(SchemaParser::SqlDefinition); model->addObject(object, obj_idx); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index e3e69726a2..ccab9a30ac 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -290,7 +290,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) for(i=Operator::LEFT_ARG; i <= Operator::RIGHT_ARG; i++) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { if(argument_types[i]!=QString("\"any\"")) attributes[type_attribs[i]]=~argument_types[i]; @@ -298,7 +298,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) else { attributes[type_attribs[i]]=argument_types[i]. - getCodeDefinition(SchemaParser::XML_DEFINITION,type_attribs[i]); + getCodeDefinition(SchemaParser::XmlDefinition,type_attribs[i]); } } @@ -306,7 +306,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) { if(operators[i]) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[op_attribs[i]]=operators[i]->getName(true); else { @@ -320,7 +320,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) { if(functions[i]) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[func_attribs[i]]=functions[i]->getName(true); else { diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index 7f70031543..35332c0e9a 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -74,7 +74,7 @@ void OperatorClass::setElementsAttribute(unsigned def_type) for(i=0; i < count; i++) { str_elems+=elements[i].getCodeDefinition(def_type); - if(def_type==SchemaParser::SQL_DEFINITION && + if(def_type==SchemaParser::SqlDefinition && i < count-1) str_elems+=QString(",\n"); } @@ -175,14 +175,14 @@ QString OperatorClass::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[ParsersAttributes::INDEX_TYPE]=(~indexing_type); attributes[ParsersAttributes::DEFAULT]=(is_default ? ParsersAttributes::_TRUE_ : QString()); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::TYPE]=(*data_type); else attributes[ParsersAttributes::TYPE]=data_type.getCodeDefinition(def_type); if(family) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::FAMILY]=family->getName(true); else attributes[ParsersAttributes::FAMILY]=family->getSignature(); diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 4e86eb375c..064374c2cc 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -140,7 +140,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::FUNCTION]=ParsersAttributes::_TRUE_; attributes[ParsersAttributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::SIGNATURE]=function->getSignature(); else attributes[ParsersAttributes::DEFINITION]=function->getCodeDefinition(def_type,true); @@ -151,14 +151,14 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::OPERATOR]=ParsersAttributes::_TRUE_; attributes[ParsersAttributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::SIGNATURE]=_operator->getSignature(); else attributes[ParsersAttributes::DEFINITION]=_operator->getCodeDefinition(def_type,true); if(op_family) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::OP_FAMILY]=op_family->getName(true); else attributes[ParsersAttributes::DEFINITION]+=op_family->getCodeDefinition(def_type,true); @@ -169,7 +169,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) //STORAGE storage_type attributes[ParsersAttributes::STORAGE]=ParsersAttributes::_TRUE_; - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::TYPE]=(*storage); else attributes[ParsersAttributes::DEFINITION]=storage.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 54cd1abad6..04fd21bee1 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -93,7 +93,7 @@ QString Parameter::getCodeDefinition(unsigned def_type) QString Parameter::getCodeDefinition(unsigned def_type, bool reduced_form) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::NAME]=BaseObject::formatName(obj_name); else attributes[ParsersAttributes::NAME]=obj_name; diff --git a/libpgmodeler/src/partitionkey.cpp b/libpgmodeler/src/partitionkey.cpp index 43d520a53e..a83d87b632 100644 --- a/libpgmodeler/src/partitionkey.cpp +++ b/libpgmodeler/src/partitionkey.cpp @@ -43,7 +43,7 @@ QString PartitionKey::getCodeDefinition(unsigned def_type) if(collation) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attribs[ParsersAttributes::COLLATION]=collation->getName(true); else attribs[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 55eea1d73b..49271ba1f6 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -423,7 +423,7 @@ QString Permission::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::REVOKE]=(revoke ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : QString()); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { //Views and Tables uses the same key word when setting permission (TABLE) attributes[ParsersAttributes::TYPE]= @@ -440,7 +440,7 @@ QString Permission::getCodeDefinition(unsigned def_type) else attributes[ParsersAttributes::OBJECT]=object->getSignature(); - if(def_type==SchemaParser::XML_DEFINITION) + if(def_type==SchemaParser::XmlDefinition) { for(i=0; i < 12; i++) { @@ -507,7 +507,7 @@ QString Permission::getDropDefinition(bool cascade) this->setRevoke(!revoke); this->setCascade(cascade); - def=this->getCodeDefinition(SchemaParser::SQL_DEFINITION); + def=this->getCodeDefinition(SchemaParser::SqlDefinition); this->setRevoke(revoke); this->setCascade(this->cascade); diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index c24906a5a3..bac8fed3c0 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1581,7 +1581,7 @@ int PgSQLType::getPrecision(void) QString PgSQLType::getCodeDefinition(unsigned def_type,QString ref_type) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) return(*(*this)); else { diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 8b74d6429e..0ba2d19316 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -231,7 +231,7 @@ QString Reference::getXMLDefinition(void) attribs[ParsersAttributes::ALIAS]=alias; attribs[ParsersAttributes::COLUMN_ALIAS]=column_alias; - return(schparser.getCodeDefinition(ParsersAttributes::REFERENCE, attribs, SchemaParser::XML_DEFINITION)); + return(schparser.getCodeDefinition(ParsersAttributes::REFERENCE, attribs, SchemaParser::XmlDefinition)); } bool Reference::operator == (Reference &refer) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index f58313431b..631e08bccc 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -520,7 +520,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) //Generates the code for the object only for validation if(obj_type==ObjColumn) - dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::SQL_DEFINITION); + dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::SqlDefinition); else { Constraint *rest=nullptr; @@ -530,7 +530,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) if(rest->getConstraintType()==ConstraintType::foreign_key) throw Exception(AsgForeignKeyRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); - rest->getCodeDefinition(SchemaParser::SQL_DEFINITION); + rest->getCodeDefinition(SchemaParser::SqlDefinition); } //Switch back to null the object parent @@ -2555,7 +2555,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type); if(!code_def.isEmpty()) return(code_def); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { if(fk_rel1n && (rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N)) { @@ -2598,7 +2598,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); } - return(this->BaseObject::__getCodeDefinition(SchemaParser::SQL_DEFINITION)); + return(this->BaseObject::__getCodeDefinition(SchemaParser::SqlDefinition)); } else { @@ -2633,7 +2633,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) for(i=0; i < count; i++) { attributes[ParsersAttributes::COLUMNS]+=dynamic_cast(rel_attributes[i])-> - getCodeDefinition(SchemaParser::XML_DEFINITION); + getCodeDefinition(SchemaParser::XmlDefinition); } attributes[ParsersAttributes::CONSTRAINTS]=QString(); @@ -2642,13 +2642,13 @@ QString Relationship::getCodeDefinition(unsigned def_type) { if(!rel_constraints[i]->isProtected()) attributes[ParsersAttributes::CONSTRAINTS]+=dynamic_cast(rel_constraints[i])-> - getCodeDefinition(SchemaParser::XML_DEFINITION, true); + getCodeDefinition(SchemaParser::XmlDefinition, true); } if(pk_original) { pk_original->setParentTable(getReceiverTable()); - attributes[ParsersAttributes::ORIGINAL_PK]=pk_original->getCodeDefinition(SchemaParser::XML_DEFINITION); + attributes[ParsersAttributes::ORIGINAL_PK]=pk_original->getCodeDefinition(SchemaParser::XmlDefinition); pk_original->setParentTable(nullptr); } @@ -2678,7 +2678,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) if(!reduced_form) cached_reduced_code.clear(); - return(this->BaseObject::getCodeDefinition(SchemaParser::XML_DEFINITION, reduced_form)); + return(this->BaseObject::getCodeDefinition(SchemaParser::XmlDefinition, reduced_form)); } } diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index bd02ce3d20..f04a34bebf 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -171,7 +171,7 @@ void Table::setCommentAttribute(TableObject *tab_obj) if(tab_obj->isSQLDisabled()) attributes[ParsersAttributes::COLS_COMMENT]+=QString("-- "); - attributes[ParsersAttributes::COLS_COMMENT]+=schparser.getCodeDefinition(ParsersAttributes::COMMENT, attribs, SchemaParser::SQL_DEFINITION); + attributes[ParsersAttributes::COLS_COMMENT]+=schparser.getCodeDefinition(ParsersAttributes::COMMENT, attribs, SchemaParser::SqlDefinition); schparser.ignoreUnkownAttributes(false); } } @@ -205,11 +205,11 @@ void Table::setRelObjectsIndexesAttribute(void) { aux_attribs[ParsersAttributes::NAME]=obj_idx.first; aux_attribs[ParsersAttributes::INDEX]=QString::number(obj_idx.second); - aux_attribs[ParsersAttributes::OBJECTS]+=schparser.getCodeDefinition(ParsersAttributes::OBJECT, aux_attribs, SchemaParser::XML_DEFINITION); + aux_attribs[ParsersAttributes::OBJECTS]+=schparser.getCodeDefinition(ParsersAttributes::OBJECT, aux_attribs, SchemaParser::XmlDefinition); } aux_attribs[ParsersAttributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_types[idx]); - attributes[attribs[idx]]=schparser.getCodeDefinition(ParsersAttributes::CUSTOMIDXS, aux_attribs, SchemaParser::XML_DEFINITION); + attributes[attribs[idx]]=schparser.getCodeDefinition(ParsersAttributes::CUSTOMIDXS, aux_attribs, SchemaParser::XmlDefinition); aux_attribs.clear(); } } @@ -225,22 +225,22 @@ void Table::setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols) { /* Do not generates the column code definition when it is not included by relatoinship, in case of XML definition. */ - if((def_type==SchemaParser::SQL_DEFINITION && !columns[i]->isAddedByCopy() && !columns[i]->isAddedByGeneralization()) || - (def_type==SchemaParser::SQL_DEFINITION && columns[i]->isAddedByCopy() && this->isPartition()) || - (def_type==SchemaParser::XML_DEFINITION && (!columns[i]->isAddedByRelationship() || (incl_rel_added_cols && columns[i]->isAddedByRelationship())))) + if((def_type==SchemaParser::SqlDefinition && !columns[i]->isAddedByCopy() && !columns[i]->isAddedByGeneralization()) || + (def_type==SchemaParser::SqlDefinition && columns[i]->isAddedByCopy() && this->isPartition()) || + (def_type==SchemaParser::XmlDefinition && (!columns[i]->isAddedByRelationship() || (incl_rel_added_cols && columns[i]->isAddedByRelationship())))) { str_cols+=columns[i]->getCodeDefinition(def_type); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) setCommentAttribute(columns[i]); } - else if(def_type==SchemaParser::SQL_DEFINITION && columns[i]->isAddedByGeneralization() && !gen_alter_cmds) + else if(def_type==SchemaParser::SqlDefinition && columns[i]->isAddedByGeneralization() && !gen_alter_cmds) { inh_cols+=QString("-- ") + columns[i]->getCodeDefinition(def_type); } } - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) { if(!str_cols.isEmpty()) { @@ -270,29 +270,29 @@ void Table::setConstraintsAttribute(unsigned def_type) if(constr->getConstraintType()!=ConstraintType::foreign_key && - ((def_type==SchemaParser::SQL_DEFINITION && + ((def_type==SchemaParser::SqlDefinition && ((!constr->isReferRelationshipAddedColumn() && constr->getConstraintType()!=ConstraintType::check) || (constr->getConstraintType()==ConstraintType::check && !constr->isAddedByGeneralization()) || constr->getConstraintType()==ConstraintType::primary_key)) || - (def_type==SchemaParser::XML_DEFINITION && !constr->isAddedByRelationship() && + (def_type==SchemaParser::XmlDefinition && !constr->isAddedByRelationship() && ((constr->getConstraintType()!=ConstraintType::primary_key && !constr->isReferRelationshipAddedColumn()) || (constr->getConstraintType()==ConstraintType::primary_key))))) { - inc_added_by_rel=(def_type==SchemaParser::SQL_DEFINITION); + inc_added_by_rel=(def_type==SchemaParser::SqlDefinition); - if(def_type==SchemaParser::XML_DEFINITION) + if(def_type==SchemaParser::XmlDefinition) str_constr+=constr->getCodeDefinition(def_type,inc_added_by_rel); else //For sql definition the generated constraints are stored in a vector to be treated below lines.push_back(constr->getCodeDefinition(def_type,inc_added_by_rel)); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) setCommentAttribute(constr); } } - if(def_type==SchemaParser::SQL_DEFINITION && !lines.empty()) + if(def_type==SchemaParser::SqlDefinition && !lines.empty()) { /* When the coistraints are being generated in form of ALTER commands simply concatenates all the lines */ @@ -411,7 +411,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) throw Exception(AsgObjectBelongsAnotherTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Validates the object SQL code befor insert on table - obj->getCodeDefinition(SchemaParser::SQL_DEFINITION); + obj->getCodeDefinition(SchemaParser::SqlDefinition); if(col && col->getType()==this) { @@ -1609,18 +1609,18 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); - if(def_type == SchemaParser::SQL_DEFINITION) + if(def_type == SchemaParser::SqlDefinition) attributes[ParsersAttributes::PARTITION_KEY]=part_keys_code.join(','); else attributes[ParsersAttributes::PARTITION_KEY]=part_keys_code.join(' '); - if(def_type==SchemaParser::SQL_DEFINITION && copy_table) + if(def_type==SchemaParser::SqlDefinition && copy_table) attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); - if(def_type==SchemaParser::SQL_DEFINITION && partitioned_table) + if(def_type==SchemaParser::SqlDefinition && partitioned_table) attributes[ParsersAttributes::PARTITIONED_TABLE]=partitioned_table->getName(true); - if(tag && def_type==SchemaParser::XML_DEFINITION) + if(tag && def_type==SchemaParser::XmlDefinition) attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); (copy_table ? copy_table->getName(true) : QString()); @@ -1629,7 +1629,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) setConstraintsAttribute(def_type); setAncestorTableAttribute(); - if(def_type==SchemaParser::XML_DEFINITION) + if(def_type==SchemaParser::XmlDefinition) { setRelObjectsIndexesAttribute(); setPositionAttribute(); diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 20e84660ca..7d877d74fd 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -141,7 +141,7 @@ QString Tag::getCodeDefinition(unsigned def_type) QString Tag::getCodeDefinition(unsigned def_type, bool reduced_form) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) return(QString()); else { @@ -163,7 +163,7 @@ QString Tag::getCodeDefinition(unsigned def_type, bool reduced_form) attribs[ParsersAttributes::COLORS]=itr.second[FILL_COLOR1].name() + QString(",") + itr.second[FILL_COLOR2].name() + QString(",") + itr.second[BORDER_COLOR].name(); - attributes[ParsersAttributes::STYLES]+=schparser.getCodeDefinition(ParsersAttributes::STYLE, attribs, SchemaParser::XML_DEFINITION); + attributes[ParsersAttributes::STYLES]+=schparser.getCodeDefinition(ParsersAttributes::STYLE, attribs, SchemaParser::XmlDefinition); } } catch(Exception &e) diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index 9ea28cc727..c7f8ef2a57 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -32,7 +32,7 @@ Textbox::Textbox(void) QString Textbox::getCodeDefinition(unsigned def_type) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) return(QString()); else { @@ -56,7 +56,7 @@ QString Textbox::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::FONT_SIZE]=QString("%1").arg(font_size); - return(this->BaseObject::__getCodeDefinition(SchemaParser::XML_DEFINITION)); + return(this->BaseObject::__getCodeDefinition(SchemaParser::XmlDefinition)); } } diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index dcc9c55137..982df40aa9 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -66,7 +66,7 @@ void Trigger::setArgumentAttribute(unsigned def_type) count=arguments.size(); for(i=0; i < count; i++) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) str_args+=QString("'") + arguments[i] + QString("'"); else str_args+=arguments[i]; @@ -379,14 +379,14 @@ void Trigger::setBasicAttributes(unsigned def_type) if(!str_aux.isEmpty()) str_aux.remove(str_aux.size()-3,3); - if(def_type==SchemaParser::SQL_DEFINITION && !attributes[ParsersAttributes::COLUMNS].isEmpty()) + if(def_type==SchemaParser::SqlDefinition && !attributes[ParsersAttributes::COLUMNS].isEmpty()) str_aux+=QString(" OF ") + attributes[ParsersAttributes::COLUMNS]; attributes[ParsersAttributes::EVENTS]=str_aux; if(function) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::TRIGGER_FUNC]=function->getName(true); else attributes[ParsersAttributes::TRIGGER_FUNC]=function->getCodeDefinition(def_type, true); @@ -422,7 +422,7 @@ QString Trigger::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::DEFERRABLE]=(is_deferrable ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::DEFER_TYPE]=(~deferral_type); - if(def_type == SchemaParser::XML_DEFINITION) + if(def_type == SchemaParser::XmlDefinition) { attributes[ParsersAttributes::OLD_TABLE_NAME]=transition_tabs_names[OLD_TABLE_NAME]; attributes[ParsersAttributes::NEW_TABLE_NAME]=transition_tabs_names[NEW_TABLE_NAME]; diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index bc0ad67a6d..cd547a7aa6 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -426,7 +426,7 @@ void Type::setElementsAttribute(unsigned def_type) for(i=0; i < count; i++) str_elem+=type_attribs[i].getCodeDefinition(def_type); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) str_elem.remove(str_elem.lastIndexOf(','), str_elem.size()); attributes[ParsersAttributes::TYPE_ATTRIBUTE]=str_elem; @@ -440,7 +440,7 @@ void Type::setEnumerationsAttribute(unsigned def_type) count=enumerations.size(); for(i=0; i < count; i++) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) str_enum+=QString("'") + enumerations[i] + QString("'"); else str_enum+=enumerations[i]; @@ -629,14 +629,14 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[ParsersAttributes::RANGE_TYPE]=ParsersAttributes::_TRUE_; - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::SUBTYPE]=(*subtype); else - attributes[ParsersAttributes::SUBTYPE]=subtype.getCodeDefinition(SchemaParser::XML_DEFINITION); + attributes[ParsersAttributes::SUBTYPE]=subtype.getCodeDefinition(SchemaParser::XmlDefinition); if(subtype_opclass) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::OP_CLASS]=subtype_opclass->getName(true); else attributes[ParsersAttributes::OP_CLASS]=subtype_opclass->getCodeDefinition(def_type, true); @@ -646,7 +646,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[ParsersAttributes::BASE_TYPE]=ParsersAttributes::_TRUE_; - if(internal_len==0 && def_type==SchemaParser::SQL_DEFINITION) + if(internal_len==0 && def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::INTERNAL_LENGTH]=QString("VARIABLE"); else attributes[ParsersAttributes::INTERNAL_LENGTH]=QString("%1").arg(internal_len); @@ -669,10 +669,10 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) if(like_type!=QString("\"any\"")) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::LIKE_TYPE]=(*like_type); else - attributes[ParsersAttributes::LIKE_TYPE]=like_type.getCodeDefinition(SchemaParser::XML_DEFINITION); + attributes[ParsersAttributes::LIKE_TYPE]=like_type.getCodeDefinition(SchemaParser::XmlDefinition); } } @@ -693,7 +693,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) { if(functions[i]) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[func_attrib[i]]=functions[i]->getName(); else { @@ -771,7 +771,7 @@ QString Type::getAlterDefinition(BaseObject *object) if(attrib_idx < 0) { attribs[ParsersAttributes::ATTRIBUTE]=attrib.getName(true); - attribs[ParsersAttributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SQL_DEFINITION); + attribs[ParsersAttributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); attribs[ParsersAttributes::COLLATION]=QString(); if(attrib.getCollation()) @@ -788,7 +788,7 @@ QString Type::getAlterDefinition(BaseObject *object) if(!type_attribs[attrib_idx].getType().isEquivalentTo(attrib.getType())) { attribs[ParsersAttributes::ATTRIBUTE]=attrib.getName(true); - attribs[ParsersAttributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SQL_DEFINITION); + attribs[ParsersAttributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); } copyAttributes(attribs); diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index 6bfe02f7ce..429114b68b 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -39,7 +39,7 @@ QString TypeAttribute::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::NAME]=BaseObject::formatName(obj_name); else attributes[ParsersAttributes::NAME]=obj_name; @@ -48,7 +48,7 @@ QString TypeAttribute::getCodeDefinition(unsigned def_type) if(collation) { - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::COLLATION]=collation->getName(true); else attributes[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index c2d806f0d9..9e97296932 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -586,10 +586,10 @@ QString View::getCodeDefinition(unsigned def_type) if(recursive) attributes[ParsersAttributes::COLUMNS]=getColumnsList().join(','); - if(tag && def_type==SchemaParser::XML_DEFINITION) + if(tag && def_type==SchemaParser::XmlDefinition) attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); - if(def_type==SchemaParser::SQL_DEFINITION) + if(def_type==SchemaParser::SqlDefinition) setDefinitionAttribute(); else { @@ -718,7 +718,7 @@ void View::addObject(BaseObject *obj, int obj_idx) //Validates the object definition tab_obj->setParentTable(this); - tab_obj->getCodeDefinition(SchemaParser::SQL_DEFINITION); + tab_obj->getCodeDefinition(SchemaParser::SqlDefinition); //Make a additional validation if the object is a trigger if(tab_obj->getObjectType()==ObjTrigger) diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index 69b7f9521e..fbe35e4222 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -165,7 +165,7 @@ void BaseConfigWidget::loadConfiguration(const QString &conf_id, mapgetConfigurationParams(config_params, key_attribs); - if(xmlparser.hasElement(XMLParser::CHILD_ELEMENT, XML_ELEMENT_NODE)) + if(xmlparser.hasElement(XMLParser::ChildElement, XML_ELEMENT_NODE)) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); if(xmlparser.getElementType()!=XML_TEXT_NODE) { @@ -184,14 +184,14 @@ void BaseConfigWidget::loadConfiguration(const QString &conf_id, mapgetConfigurationParams(config_params, key_attribs); } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } xmlparser.restorePosition(); } } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) @@ -223,10 +223,10 @@ void BaseConfigWidget::getConfigurationParams(map &config_ key=xmlparser.getElementName(); //Extract the contents of the child element and create a special element on map called "_contents_" - if(xmlparser.hasElement(XMLParser::CHILD_ELEMENT, XML_TEXT_NODE)) + if(xmlparser.hasElement(XMLParser::ChildElement, XML_TEXT_NODE)) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); aux_attribs[ParsersAttributes::CONTENTS]=xmlparser.getElementContent(); xmlparser.restorePosition(); } diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index e935852bed..65d41e16a5 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -520,11 +520,11 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ QString BaseObjectWidget::generateVersionsInterval(unsigned ver_interv_id, const QString &ini_ver, const QString &end_ver) { if(ver_interv_id==UNTIL_VERSION && !ini_ver.isEmpty()) - return(XMLParser::CHAR_LT + QString("= ") + ini_ver); + return(XMLParser::CharLt + QString("= ") + ini_ver); else if(ver_interv_id==VERSIONS_INTERVAL && !ini_ver.isEmpty() && !end_ver.isEmpty()) - return(XMLParser::CHAR_GT + QString("= ") + ini_ver + XMLParser::CHAR_AMP + XMLParser::CHAR_LT + QString("= ") + end_ver); + return(XMLParser::CharGt + QString("= ") + ini_ver + XMLParser::CharAmp + XMLParser::CharLt + QString("= ") + end_ver); else if(ver_interv_id==AFTER_VERSION && !ini_ver.isEmpty()) - return(XMLParser::CHAR_GT + QString("= ") + ini_ver); + return(XMLParser::CharGt + QString("= ") + ini_ver); else return(QString()); } @@ -832,9 +832,9 @@ void BaseObjectWidget::finishConfiguration(void) { //If the object is being updated, validates its SQL definition if(obj_type==ObjBaseRelationship || obj_type==ObjTextbox || obj_type==ObjTag) - this->object->getCodeDefinition(SchemaParser::XML_DEFINITION); + this->object->getCodeDefinition(SchemaParser::XmlDefinition); else - this->object->getCodeDefinition(SchemaParser::SQL_DEFINITION); + this->object->getCodeDefinition(SchemaParser::SqlDefinition); } model->getObjectReferences(object, ref_objs); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index e92db3a26f..57bb16b9d7 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -134,27 +134,27 @@ void ConnectionsConfigWidget::loadConfiguration(void) { conn=new Connection; - conn->setConnectionParam(Connection::PARAM_ALIAS, itr->second[ParsersAttributes::ALIAS]); - conn->setConnectionParam(Connection::PARAM_SERVER_FQDN, itr->second[Connection::PARAM_SERVER_FQDN]); - conn->setConnectionParam(Connection::PARAM_PORT, itr->second[Connection::PARAM_PORT]); - conn->setConnectionParam(Connection::PARAM_USER, itr->second[Connection::PARAM_USER]); - conn->setConnectionParam(Connection::PARAM_PASSWORD,itr->second[Connection::PARAM_PASSWORD]); - conn->setConnectionParam(Connection::PARAM_DB_NAME, itr->second[Connection::PARAM_DB_NAME]); - conn->setConnectionParam(Connection::PARAM_CONN_TIMEOUT, itr->second[ParsersAttributes::CONNECTION_TIMEOUT]); - conn->setConnectionParam(Connection::PARAM_SSL_MODE, itr->second[Connection::PARAM_SSL_MODE]); - conn->setConnectionParam(Connection::PARAM_SSL_ROOT_CERT, itr->second[Connection::PARAM_SSL_ROOT_CERT]); - conn->setConnectionParam(Connection::PARAM_SSL_CERT, itr->second[Connection::PARAM_SSL_CERT]); - conn->setConnectionParam(Connection::PARAM_SSL_KEY, itr->second[Connection::PARAM_SSL_KEY]); - conn->setConnectionParam(Connection::PARAM_SSL_CRL, itr->second[Connection::PARAM_SSL_CRL]); - conn->setConnectionParam(Connection::PARAM_LIB_GSSAPI, itr->second[Connection::PARAM_LIB_GSSAPI]); - conn->setConnectionParam(Connection::PARAM_KERBEROS_SERVER, itr->second[Connection::PARAM_KERBEROS_SERVER]); - conn->setConnectionParam(Connection::PARAM_OTHERS, itr->second[Connection::PARAM_OTHERS]); + conn->setConnectionParam(Connection::ParamAlias, itr->second[ParsersAttributes::ALIAS]); + conn->setConnectionParam(Connection::ParamServerFqdn, itr->second[Connection::ParamServerFqdn]); + conn->setConnectionParam(Connection::ParamPort, itr->second[Connection::ParamPort]); + conn->setConnectionParam(Connection::ParamUser, itr->second[Connection::ParamUser]); + conn->setConnectionParam(Connection::ParamPassword,itr->second[Connection::ParamPassword]); + conn->setConnectionParam(Connection::ParamDbName, itr->second[Connection::ParamDbName]); + conn->setConnectionParam(Connection::ParamConnTimeout, itr->second[ParsersAttributes::CONNECTION_TIMEOUT]); + conn->setConnectionParam(Connection::ParamSslMode, itr->second[Connection::ParamSslMode]); + conn->setConnectionParam(Connection::ParamSslRootCert, itr->second[Connection::ParamSslRootCert]); + conn->setConnectionParam(Connection::ParamSslCert, itr->second[Connection::ParamSslCert]); + conn->setConnectionParam(Connection::ParamSslKey, itr->second[Connection::ParamSslKey]); + conn->setConnectionParam(Connection::ParamSslCrl, itr->second[Connection::ParamSslCrl]); + conn->setConnectionParam(Connection::ParamLibGssapi, itr->second[Connection::ParamLibGssapi]); + conn->setConnectionParam(Connection::ParamKerberosServer, itr->second[Connection::ParamKerberosServer]); + conn->setConnectionParam(Connection::ParamOthers, itr->second[Connection::ParamOthers]); conn->setAutoBrowseDB(itr->second[ParsersAttributes::AUTO_BROWSE_DB]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OP_DIFF, itr->second[DEFAULT_FOR.arg(ParsersAttributes::DIFF)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OP_EXPORT, itr->second[DEFAULT_FOR.arg(ParsersAttributes::EXPORT)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OP_IMPORT, itr->second[DEFAULT_FOR.arg(ParsersAttributes::IMPORT)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OP_VALIDATION, itr->second[DEFAULT_FOR.arg(ParsersAttributes::VALIDATION)]==ParsersAttributes::_TRUE_); + conn->setDefaultForOperation(Connection::OpDiff, itr->second[DEFAULT_FOR.arg(ParsersAttributes::DIFF)]==ParsersAttributes::_TRUE_); + conn->setDefaultForOperation(Connection::OpExport, itr->second[DEFAULT_FOR.arg(ParsersAttributes::EXPORT)]==ParsersAttributes::_TRUE_); + conn->setDefaultForOperation(Connection::OpImport, itr->second[DEFAULT_FOR.arg(ParsersAttributes::IMPORT)]==ParsersAttributes::_TRUE_); + conn->setDefaultForOperation(Connection::OpValidation, itr->second[DEFAULT_FOR.arg(ParsersAttributes::VALIDATION)]==ParsersAttributes::_TRUE_); connections.push_back(conn); itr++; @@ -243,7 +243,7 @@ void ConnectionsConfigWidget::duplicateConnection(void) (*new_conn)=(*conn); connections.push_back(new_conn); - new_conn->setConnectionParam(Connection::PARAM_ALIAS, QString("cp_%1").arg(conn->getConnectionParam(Connection::PARAM_ALIAS))); + new_conn->setConnectionParam(Connection::ParamAlias, QString("cp_%1").arg(conn->getConnectionParam(Connection::ParamAlias))); connections_cmb->addItem(QIcon(QString(":icones/icones/server.png")), new_conn->getConnectionId()); connections_cmb->setCurrentIndex(connections_cmb->count()-1); setConfigurationChanged(true); @@ -312,46 +312,46 @@ void ConnectionsConfigWidget::editConnection(void) Connection *conn=nullptr; conn=connections.at(connections_cmb->currentIndex()); - alias_edt->setText(conn->getConnectionParam(Connection::PARAM_ALIAS)); + alias_edt->setText(conn->getConnectionParam(Connection::ParamAlias)); auto_browse_chk->setChecked(conn->isAutoBrowseDB()); - diff_chk->setChecked(conn->isDefaultForOperation(Connection::OP_DIFF)); - export_chk->setChecked(conn->isDefaultForOperation(Connection::OP_EXPORT)); - import_chk->setChecked(conn->isDefaultForOperation(Connection::OP_IMPORT)); - validation_chk->setChecked(conn->isDefaultForOperation(Connection::OP_VALIDATION)); + diff_chk->setChecked(conn->isDefaultForOperation(Connection::OpDiff)); + export_chk->setChecked(conn->isDefaultForOperation(Connection::OpExport)); + import_chk->setChecked(conn->isDefaultForOperation(Connection::OpImport)); + validation_chk->setChecked(conn->isDefaultForOperation(Connection::OpValidation)); - if(!conn->getConnectionParam(Connection::PARAM_SERVER_FQDN).isEmpty()) - host_edt->setText(conn->getConnectionParam(Connection::PARAM_SERVER_FQDN)); + if(!conn->getConnectionParam(Connection::ParamServerFqdn).isEmpty()) + host_edt->setText(conn->getConnectionParam(Connection::ParamServerFqdn)); else - host_edt->setText(conn->getConnectionParam(Connection::PARAM_SERVER_IP)); + host_edt->setText(conn->getConnectionParam(Connection::ParamServerIp)); - conn_db_edt->setText(conn->getConnectionParam(Connection::PARAM_DB_NAME)); - user_edt->setText(conn->getConnectionParam(Connection::PARAM_USER)); - passwd_edt->setText(conn->getConnectionParam(Connection::PARAM_PASSWORD)); - port_sbp->setValue(conn->getConnectionParam(Connection::PARAM_PORT).toInt()); - timeout_sbp->setValue(conn->getConnectionParam(Connection::PARAM_CONN_TIMEOUT).toInt()); + conn_db_edt->setText(conn->getConnectionParam(Connection::ParamDbName)); + user_edt->setText(conn->getConnectionParam(Connection::ParamUser)); + passwd_edt->setText(conn->getConnectionParam(Connection::ParamPassword)); + port_sbp->setValue(conn->getConnectionParam(Connection::ParamPort).toInt()); + timeout_sbp->setValue(conn->getConnectionParam(Connection::ParamConnTimeout).toInt()); - krb_server_edt->setText(conn->getConnectionParam(Connection::PARAM_KERBEROS_SERVER)); - gssapi_auth_chk->setChecked(conn->getConnectionParam(Connection::PARAM_LIB_GSSAPI)==QString("gssapi")); - other_params_edt->setText(conn->getConnectionParam(Connection::PARAM_OTHERS)); + krb_server_edt->setText(conn->getConnectionParam(Connection::ParamKerberosServer)); + gssapi_auth_chk->setChecked(conn->getConnectionParam(Connection::ParamLibGssapi)==QString("gssapi")); + other_params_edt->setText(conn->getConnectionParam(Connection::ParamOthers)); - if(conn->getConnectionParam(Connection::PARAM_SSL_MODE)==Connection::SSL_DESABLE) + if(conn->getConnectionParam(Connection::ParamSslMode)==Connection::SslDisable) ssl_mode_cmb->setCurrentIndex(0); - else if(conn->getConnectionParam(Connection::PARAM_SSL_MODE)==Connection::SSL_ALLOW) + else if(conn->getConnectionParam(Connection::ParamSslMode)==Connection::SslAllow) ssl_mode_cmb->setCurrentIndex(1); - else if(conn->getConnectionParam(Connection::PARAM_SSL_MODE)==Connection::SSL_REQUIRE) + else if(conn->getConnectionParam(Connection::ParamSslMode)==Connection::SslRequire) ssl_mode_cmb->setCurrentIndex(2); - else if(conn->getConnectionParam(Connection::PARAM_SSL_MODE)==Connection::SSL_CA_VERIF) + else if(conn->getConnectionParam(Connection::ParamSslMode)==Connection::SslCaVerify) ssl_mode_cmb->setCurrentIndex(3); else ssl_mode_cmb->setCurrentIndex(4); if(ssl_mode_cmb->currentIndex() > 0) { - client_cert_edt->setText(conn->getConnectionParam(Connection::PARAM_SSL_CERT)); - root_cert_edt->setText(conn->getConnectionParam(Connection::PARAM_SSL_ROOT_CERT)); - client_key_edt->setText(conn->getConnectionParam(Connection::PARAM_SSL_KEY)); - crl_edt->setText(conn->getConnectionParam(Connection::PARAM_SSL_CRL)); + client_cert_edt->setText(conn->getConnectionParam(Connection::ParamSslCert)); + root_cert_edt->setText(conn->getConnectionParam(Connection::ParamSslRootCert)); + client_key_edt->setText(conn->getConnectionParam(Connection::ParamSslKey)); + crl_edt->setText(conn->getConnectionParam(Connection::ParamSslCrl)); } update_tb->setVisible(true); @@ -370,56 +370,56 @@ void ConnectionsConfigWidget::configureConnection(Connection *conn) if(conn) { conn->setAutoBrowseDB(auto_browse_chk->isChecked()); - conn->setConnectionParam(Connection::PARAM_ALIAS, alias_edt->text()); - conn->setConnectionParam(Connection::PARAM_SERVER_IP, QString()); - conn->setConnectionParam(Connection::PARAM_SERVER_FQDN, host_edt->text()); - conn->setConnectionParam(Connection::PARAM_PORT, QString("%1").arg(port_sbp->value())); - conn->setConnectionParam(Connection::PARAM_USER, user_edt->text()); - conn->setConnectionParam(Connection::PARAM_PASSWORD, passwd_edt->text()); - conn->setConnectionParam(Connection::PARAM_DB_NAME, conn_db_edt->text()); - conn->setConnectionParam(Connection::PARAM_CONN_TIMEOUT, QString("%1").arg(timeout_sbp->value())); - - conn->setDefaultForOperation(Connection::OP_DIFF, diff_chk->isChecked()); - conn->setDefaultForOperation(Connection::OP_EXPORT, export_chk->isChecked()); - conn->setDefaultForOperation(Connection::OP_IMPORT, import_chk->isChecked()); - conn->setDefaultForOperation(Connection::OP_VALIDATION, validation_chk->isChecked()); + conn->setConnectionParam(Connection::ParamAlias, alias_edt->text()); + conn->setConnectionParam(Connection::ParamServerIp, QString()); + conn->setConnectionParam(Connection::ParamServerFqdn, host_edt->text()); + conn->setConnectionParam(Connection::ParamPort, QString("%1").arg(port_sbp->value())); + conn->setConnectionParam(Connection::ParamUser, user_edt->text()); + conn->setConnectionParam(Connection::ParamPassword, passwd_edt->text()); + conn->setConnectionParam(Connection::ParamDbName, conn_db_edt->text()); + conn->setConnectionParam(Connection::ParamConnTimeout, QString("%1").arg(timeout_sbp->value())); + + conn->setDefaultForOperation(Connection::OpDiff, diff_chk->isChecked()); + conn->setDefaultForOperation(Connection::OpExport, export_chk->isChecked()); + conn->setDefaultForOperation(Connection::OpImport, import_chk->isChecked()); + conn->setDefaultForOperation(Connection::OpValidation, validation_chk->isChecked()); switch(ssl_mode_cmb->currentIndex()) { case 1: - conn->setConnectionParam(Connection::PARAM_SSL_MODE, Connection::SSL_ALLOW); + conn->setConnectionParam(Connection::ParamSslMode, Connection::SslAllow); break; case 2: - conn->setConnectionParam(Connection::PARAM_SSL_MODE, Connection::SSL_REQUIRE); + conn->setConnectionParam(Connection::ParamSslMode, Connection::SslRequire); break; case 3: - conn->setConnectionParam(Connection::PARAM_SSL_MODE, Connection::SSL_CA_VERIF); + conn->setConnectionParam(Connection::ParamSslMode, Connection::SslCaVerify); break; case 4: - conn->setConnectionParam(Connection::PARAM_SSL_MODE, Connection::SSL_FULL_VERIF); + conn->setConnectionParam(Connection::ParamSslMode, Connection::SslFullVerify); break; default: case 0: - conn->setConnectionParam(Connection::PARAM_SSL_MODE, Connection::SSL_DESABLE); + conn->setConnectionParam(Connection::ParamSslMode, Connection::SslDisable); break; } if(ssl_mode_cmb->currentIndex()!=0) { - conn->setConnectionParam(Connection::PARAM_SSL_ROOT_CERT, root_cert_edt->text()); - conn->setConnectionParam(Connection::PARAM_SSL_CERT, client_cert_edt->text()); - conn->setConnectionParam(Connection::PARAM_SSL_KEY, client_key_edt->text()); - conn->setConnectionParam(Connection::PARAM_SSL_CRL, crl_edt->text()); + conn->setConnectionParam(Connection::ParamSslRootCert, root_cert_edt->text()); + conn->setConnectionParam(Connection::ParamSslCert, client_cert_edt->text()); + conn->setConnectionParam(Connection::ParamSslKey, client_key_edt->text()); + conn->setConnectionParam(Connection::ParamSslCrl, crl_edt->text()); } if(gssapi_auth_chk->isChecked()) - conn->setConnectionParam(Connection::PARAM_LIB_GSSAPI, QString("gssapi")); + conn->setConnectionParam(Connection::ParamLibGssapi, QString("gssapi")); if(!krb_server_edt->text().isEmpty()) - conn->setConnectionParam(Connection::PARAM_KERBEROS_SERVER, krb_server_edt->text()); + conn->setConnectionParam(Connection::ParamKerberosServer, krb_server_edt->text()); if(!other_params_edt->text().isEmpty()) - conn->setConnectionParam(Connection::PARAM_OTHERS, other_params_edt->text()); + conn->setConnectionParam(Connection::ParamOthers, other_params_edt->text()); } } @@ -436,9 +436,9 @@ void ConnectionsConfigWidget::testConnection(void) srv_info=conn.getServerInfo(); msg_box.show(trUtf8("Success"), PgModelerUiNS::formatMessage(trUtf8("Connection successfully established!\n\nServer details:\n\nPID: `%1'\nProtocol: `%2'\nVersion: `%3'")) - .arg(srv_info[Connection::SERVER_PID]) - .arg(srv_info[Connection::SERVER_PROTOCOL]) - .arg(srv_info[Connection::SERVER_VERSION]), Messagebox::INFO_ICON); + .arg(srv_info[Connection::ServerPid]) + .arg(srv_info[Connection::ServerProtocol]) + .arg(srv_info[Connection::ServerVersion]), Messagebox::INFO_ICON); } catch(Exception &e) { @@ -501,17 +501,17 @@ void ConnectionsConfigWidget::saveConfiguration(void) { attribs=conn->getConnectionParams(); - if(attribs[Connection::PARAM_SERVER_FQDN].isEmpty()) - attribs[Connection::PARAM_SERVER_FQDN]=attribs[Connection::PARAM_SERVER_IP]; + if(attribs[Connection::ParamServerFqdn].isEmpty()) + attribs[Connection::ParamServerFqdn]=attribs[Connection::ParamServerIp]; - attribs[ParsersAttributes::ALIAS]=attribs[Connection::PARAM_ALIAS]; + attribs[ParsersAttributes::ALIAS]=attribs[Connection::ParamAlias]; attribs[ParsersAttributes::AUTO_BROWSE_DB]=(conn->isAutoBrowseDB() ? ParsersAttributes::_TRUE_ : QString()); - attribs[ParsersAttributes::CONNECTION_TIMEOUT]=attribs[Connection::PARAM_CONN_TIMEOUT]; + attribs[ParsersAttributes::CONNECTION_TIMEOUT]=attribs[Connection::ParamConnTimeout]; - attribs[DEFAULT_FOR.arg(ParsersAttributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OP_EXPORT) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DEFAULT_FOR.arg(ParsersAttributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OP_IMPORT) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DEFAULT_FOR.arg(ParsersAttributes::DIFF)]=(conn->isDefaultForOperation(Connection::OP_DIFF) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DEFAULT_FOR.arg(ParsersAttributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OP_VALIDATION) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DEFAULT_FOR.arg(ParsersAttributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DEFAULT_FOR.arg(ParsersAttributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DEFAULT_FOR.arg(ParsersAttributes::DIFF)]=(conn->isDefaultForOperation(Connection::OpDiff) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DEFAULT_FOR.arg(ParsersAttributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? ParsersAttributes::_TRUE_ : QString()); schparser.ignoreUnkownAttributes(true); config_params[GlobalAttributes::ConnectionsConf][ParsersAttributes::CONNECTIONS]+= diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.h b/libpgmodeler_ui/src/connectionsconfigwidget.h index 4b82293019..5827560db6 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.h +++ b/libpgmodeler_ui/src/connectionsconfigwidget.h @@ -66,7 +66,7 @@ class ConnectionsConfigWidget: public BaseConfigWidget, public Ui::ConnectionsCo static void getConnections(map &conns, bool inc_hosts=true); //! \brief Fills the passed combobox with all the loaded connections - static void fillConnectionsComboBox(QComboBox *combo, bool incl_placeholder, unsigned check_def_for=Connection::OP_NONE); + static void fillConnectionsComboBox(QComboBox *combo, bool incl_placeholder, unsigned check_def_for=Connection::OpNone); //! \brief Opens a local instance of connection config dialog to permit user configures connections on-the-fly static bool openConnectionsConfiguration(QComboBox *combo, bool incl_placeholder); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index f882b03170..41043728d3 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -986,13 +986,13 @@ void DatabaseExplorerWidget::listObjects(void) void DatabaseExplorerWidget::configureImportHelper(void) { import_helper.setConnection(connection); - import_helper.setCurrentDatabase(connection.getConnectionParam(Connection::PARAM_DB_NAME)); + import_helper.setCurrentDatabase(connection.getConnectionParam(Connection::ParamDbName)); import_helper.setImportOptions(show_sys_objs->isChecked(), show_ext_objs->isChecked(), false, false, false, false, false); catalog.closeConnection(); - catalog.setFilter(Catalog::LIST_ALL_OBJS); + catalog.setFilter(Catalog::ListAllObjects); catalog.setConnection(connection); } @@ -1235,7 +1235,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) //Generate the drop command schparser.ignoreEmptyAttributes(true); schparser.ignoreUnkownAttributes(true); - drop_cmd=schparser.getCodeDefinition(ParsersAttributes::DROP, attribs, SchemaParser::SQL_DEFINITION); + drop_cmd=schparser.getCodeDefinition(ParsersAttributes::DROP, attribs, SchemaParser::SqlDefinition); if(cascade) drop_cmd.replace(';', QString(" CASCADE;")); @@ -1791,7 +1791,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) //Importing the object and its dependencies dbmodel.createSystemObjects(false); import_hlp.setConnection(connection); - import_hlp.setCurrentDatabase(connection.getConnectionParam(Connection::PARAM_DB_NAME)); + import_hlp.setCurrentDatabase(connection.getConnectionParam(Connection::ParamDbName)); import_hlp.setImportOptions(toggle_disp_menu.actions().at(0)->isChecked(), toggle_disp_menu.actions().at(1)->isChecked(), true, false, false, false, false); @@ -1917,12 +1917,12 @@ QString DatabaseExplorerWidget::getObjectSource(BaseObject *object, DatabaseMode object->setCodeInvalidated(true); if(object!=dbmodel) - source=object->getCodeDefinition(SchemaParser::SQL_DEFINITION); + source=object->getCodeDefinition(SchemaParser::SqlDefinition); else - source=dbmodel->__getCodeDefinition(SchemaParser::SQL_DEFINITION); + source=dbmodel->__getCodeDefinition(SchemaParser::SqlDefinition); for(auto &perm : perms) - source+=perm->getCodeDefinition(SchemaParser::SQL_DEFINITION); + source+=perm->getCodeDefinition(SchemaParser::SqlDefinition); return(source); } @@ -1945,7 +1945,7 @@ void DatabaseExplorerWidget::openDataGrid(const QString &schema, const QString & void DatabaseExplorerWidget::dropDatabase(void) { Messagebox msg_box; - QString dbname = connection.getConnectionParam(Connection::PARAM_DB_NAME); + QString dbname = connection.getConnectionParam(Connection::ParamDbName); msg_box.show(trUtf8("Warning"), trUtf8("CAUTION: You are about to drop the entire database %1 from the server %2! All data will be completely wiped out. Do you really want to proceed?") @@ -1957,7 +1957,7 @@ void DatabaseExplorerWidget::dropDatabase(void) try { Connection conn=Connection(connection.getConnectionParams()); - conn.setConnectionParam(Connection::PARAM_DB_NAME, default_db); + conn.setConnectionParam(Connection::ParamDbName, default_db); conn.connect(); conn.executeDDLCommand(QString("DROP DATABASE \"%1\";").arg(dbname)); conn.close(); @@ -1966,9 +1966,9 @@ void DatabaseExplorerWidget::dropDatabase(void) } catch(Exception &e) { - if(connection.getConnectionParam(Connection::PARAM_DB_NAME) == default_db) + if(connection.getConnectionParam(Connection::ParamDbName) == default_db) throw Exception(Exception::getErrorMessage(DropCurrentDBDefault) - .arg(dbname).arg(connection.getConnectionParam(Connection::PARAM_ALIAS)), + .arg(dbname).arg(connection.getConnectionParam(Connection::ParamAlias)), DropCurrentDBDefault,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 3561290ba2..cd02de1b59 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -562,7 +562,7 @@ void DatabaseImportForm::finishImport(const QString &msg) void DatabaseImportForm::showEvent(QShowEvent *) { - ConnectionsConfigWidget::fillConnectionsComboBox(connections_cmb, true, Connection::OP_IMPORT); + ConnectionsConfigWidget::fillConnectionsComboBox(connections_cmb, true, Connection::OpImport); createThread(); if(connections_cmb->currentIndex() > 0) diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 65f196db16..ab21735ea0 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -27,7 +27,7 @@ DatabaseImportHelper::DatabaseImportHelper(QObject *parent) : QObject(parent) import_canceled=ignore_errors=import_sys_objs=import_ext_objs=rand_rel_colors=update_fk_rels=false; auto_resolve_deps=true; - import_filter=Catalog::LIST_ALL_OBJS | Catalog::EXCL_EXTENSION_OBJS | Catalog::EXCL_SYSTEM_OBJS; + import_filter=Catalog::ListAllObjects | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs; xmlparser=nullptr; dbmodel=nullptr; } @@ -100,13 +100,13 @@ void DatabaseImportHelper::setImportOptions(bool import_sys_objs, bool import_ex Connection::setPrintSQL(debug_mode); if(!import_sys_objs && import_ext_objs) - import_filter=Catalog::LIST_ALL_OBJS | Catalog::EXCL_BUILTIN_ARRAY_TYPES | Catalog::EXCL_SYSTEM_OBJS; + import_filter=Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclSystemObjs; else if(import_sys_objs && !import_ext_objs) - import_filter=Catalog::LIST_ALL_OBJS | Catalog::EXCL_BUILTIN_ARRAY_TYPES | Catalog::EXCL_EXTENSION_OBJS; + import_filter=Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs; else if(import_sys_objs && import_ext_objs) - import_filter=Catalog::LIST_ALL_OBJS | Catalog::EXCL_BUILTIN_ARRAY_TYPES; + import_filter=Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes; else - import_filter=Catalog::LIST_ALL_OBJS | Catalog::EXCL_BUILTIN_ARRAY_TYPES | Catalog::EXCL_EXTENSION_OBJS | Catalog::EXCL_SYSTEM_OBJS; + import_filter=Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs; } unsigned DatabaseImportHelper::getLastSystemOID(void) @@ -116,7 +116,7 @@ unsigned DatabaseImportHelper::getLastSystemOID(void) QString DatabaseImportHelper::getCurrentDatabase(void) { - return(connection.getConnectionParam(Connection::PARAM_DB_NAME)); + return(connection.getConnectionParam(Connection::ParamDbName)); } Catalog DatabaseImportHelper::getCatalog(void) @@ -188,14 +188,14 @@ void DatabaseImportHelper::retrieveSystemObjects(void) obj_map=&system_objs; if(sys_objs[i]!=ObjLanguage) - catalog.setFilter(Catalog::LIST_ONLY_SYS_OBJS); + catalog.setFilter(Catalog::ListOnlySystemObjs); else - catalog.setFilter(Catalog::LIST_ALL_OBJS); + catalog.setFilter(Catalog::ListAllObjects); } else { obj_map=&types; - catalog.setFilter(Catalog::LIST_ALL_OBJS); + catalog.setFilter(Catalog::ListAllObjects); } //Query the objects on the catalog and put them on the map @@ -664,7 +664,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) QString obj_name=getObjectName(attribs[ParsersAttributes::OID], (obj_type==ObjFunction || obj_type==ObjOperator)); //Avoiding the creation of pgModeler's temp objects created in database during the catalog reading - if(obj_name.contains(Catalog::PGMODELER_TEMP_DB_OBJ)) + if(obj_name.contains(Catalog::PgModelerTempDbObj)) return; try @@ -761,7 +761,7 @@ QString DatabaseImportHelper::getComment(attribs_map &attribs) QString xml_def; if(!attribs[ParsersAttributes::COMMENT].isEmpty()) - xml_def=schparser.getCodeDefinition(ParsersAttributes::COMMENT, attribs, SchemaParser::XML_DEFINITION); + xml_def=schparser.getCodeDefinition(ParsersAttributes::COMMENT, attribs, SchemaParser::XmlDefinition); return(xml_def); } @@ -795,7 +795,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType (import_sys_objs && obj_oid <= catalog.getLastSysObjectOID()) || (obj_oid > catalog.getLastSysObjectOID() && !catalog.isExtensionObject(obj_oid)))) { - catalog.setFilter(Catalog::LIST_ALL_OBJS); + catalog.setFilter(Catalog::ListAllObjects); vector attribs_vect=catalog.getObjectsAttributes(obj_type,QString(),QString(), { obj_oid }); if(!attribs_vect.empty()) @@ -834,7 +834,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType { obj_attr[ParsersAttributes::REDUCED_FORM]=ParsersAttributes::_TRUE_; schparser.ignoreUnkownAttributes(true); - xml_def=schparser.getCodeDefinition(BaseObject::getSchemaName(obj_type), obj_attr, SchemaParser::XML_DEFINITION); + xml_def=schparser.getCodeDefinition(BaseObject::getSchemaName(obj_type), obj_attr, SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); } else @@ -861,7 +861,7 @@ void DatabaseImportHelper::loadObjectXML(ObjectType obj_type, attribs_map &attri try { schparser.ignoreUnkownAttributes(true); - xml_buf=schparser.getCodeDefinition(BaseObject::getSchemaName(obj_type), attribs, SchemaParser::XML_DEFINITION); + xml_buf=schparser.getCodeDefinition(BaseObject::getSchemaName(obj_type), attribs, SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); xmlparser->restartParser(); @@ -1012,7 +1012,7 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) expr.remove(expr.length() - 1,1); aux_attribs[ParsersAttributes::EXPRESSION] = expr; - attribs[ParsersAttributes::CONSTRAINTS]+= schparser.getCodeDefinition(ParsersAttributes::DOM_CONSTRAINT, aux_attribs, SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::CONSTRAINTS]+= schparser.getCodeDefinition(ParsersAttributes::DOM_CONSTRAINT, aux_attribs, SchemaParser::XmlDefinition); } attribs[ParsersAttributes::TYPE]=getType(attribs[ParsersAttributes::TYPE], true, attribs); @@ -1110,7 +1110,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) //If the mode is 't' indicates that the current parameter will be used as a return table colum if(!param_modes.isEmpty() && param_modes[i]==QString("t")) - attribs[ParsersAttributes::RETURN_TABLE]+=param.getCodeDefinition(SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::RETURN_TABLE]+=param.getCodeDefinition(SchemaParser::XmlDefinition); else parameters.push_back(param); } @@ -1134,7 +1134,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) param_def_vals.pop_back(); } - param_xmls.push_front(param.getCodeDefinition(SchemaParser::XML_DEFINITION)); + param_xmls.push_front(param.getCodeDefinition(SchemaParser::XmlDefinition)); } attribs[ParsersAttributes::PARAMETERS]+=param_xmls.join(QChar('\n')); @@ -1158,7 +1158,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::INPUT_FUNC || attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::RECV_FUNC || attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CANONICAL_FUNC) - attribs[ParsersAttributes::RETURN_TYPE]=PgSQLType(QString("\"any\"")).getCodeDefinition(SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::RETURN_TYPE]=PgSQLType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); else attribs[ParsersAttributes::RETURN_TYPE]=getType(attribs[ParsersAttributes::RETURN_TYPE], true); } @@ -1296,7 +1296,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) for(unsigned i=0; i < elems.size(); i++) { schparser.ignoreUnkownAttributes(true); - attribs[ParsersAttributes::ELEMENTS]+=schparser.getCodeDefinition(ParsersAttributes::ELEMENT, elems[i], SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::ELEMENTS]+=schparser.getCodeDefinition(ParsersAttributes::ELEMENT, elems[i], SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); } @@ -1462,7 +1462,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) column is an identity one */ tab_name = getDependencyObject(owner_col[0], ObjTable, true, auto_resolve_deps, false, {{ ParsersAttributes::POSITION, - schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XML_DEFINITION)}}); + schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XmlDefinition)}}); col_name=getColumnName(owner_col[0], owner_col[1]); tab = dbmodel->getTable(tab_name); @@ -1571,7 +1571,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) type_attrib.setName(values[0].remove('"')); type_attrib.setType(PgSQLType::parseString(values[1].remove('\\'))); type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjCollation)); - attribs[ParsersAttributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XmlDefinition); } } } @@ -1643,7 +1643,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) { ParsersAttributes::Y_POS, QString("0") }}; attribs[ParsersAttributes::COLUMNS]=QString(); - attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); //Retrieving columns if they were not retrieved yet if(columns[attribs[ParsersAttributes::OID].toUInt()].empty() && auto_resolve_deps) @@ -1762,7 +1762,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) getDependencyObject(itr->second[ParsersAttributes::COLLATION], ObjCollation); col.setCollation(dbmodel->getObject(getObjectName(itr->second[ParsersAttributes::COLLATION]),ObjCollation)); - attribs[ParsersAttributes::COLUMNS]+=col.getCodeDefinition(SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::COLUMNS]+=col.getCodeDefinition(SchemaParser::XmlDefinition); itr++; col_idx++; } @@ -1877,7 +1877,7 @@ void DatabaseImportHelper::createView(attribs_map &attribs) attribs_map pos_attrib={{ ParsersAttributes::X_POS, QString("0") }, { ParsersAttributes::Y_POS, QString("0") }}; - attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); ref=Reference(attribs[ParsersAttributes::DEFINITION], QString()); ref.setDefinitionExpression(true); @@ -2069,7 +2069,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) } if(elem.getColumn() || !elem.getExpression().isEmpty()) - attribs[ParsersAttributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); } attribs[ParsersAttributes::TABLE]=tab_name; @@ -2163,7 +2163,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) elem.setOperator(oper); } - attribs[ParsersAttributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XML_DEFINITION); + attribs[ParsersAttributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); } } else @@ -2801,7 +2801,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, extra_attribs[ParsersAttributes::DIMENSION]=(dimension > 0 ? QString::number(dimension) : QString()); schparser.ignoreUnkownAttributes(true); - xml_def=schparser.getCodeDefinition(ParsersAttributes::PGSQL_BASE_TYPE, extra_attribs, SchemaParser::XML_DEFINITION); + xml_def=schparser.getCodeDefinition(ParsersAttributes::PGSQL_BASE_TYPE, extra_attribs, SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); } else diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 725d7c7842..709fd9e7cf 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -216,10 +216,10 @@ void DataManipulationForm::setAttributes(Connection conn, const QString curr_sch QString db_name; tmpl_conn_params=conn.getConnectionParams(); - db_name=QString("%1@%2:%3").arg(conn.getConnectionParam(Connection::PARAM_DB_NAME)) - .arg(conn.getConnectionParam(Connection::PARAM_SERVER_IP).isEmpty() ? - conn.getConnectionParam(Connection::PARAM_SERVER_FQDN) : conn.getConnectionParam(Connection::PARAM_SERVER_IP)) - .arg(conn.getConnectionParam(Connection::PARAM_PORT)); + db_name=QString("%1@%2:%3").arg(conn.getConnectionParam(Connection::ParamDbName)) + .arg(conn.getConnectionParam(Connection::ParamServerIp).isEmpty() ? + conn.getConnectionParam(Connection::ParamServerFqdn) : conn.getConnectionParam(Connection::ParamServerIp)) + .arg(conn.getConnectionParam(Connection::ParamPort)); db_name_lbl->setText(db_name); db_name.remove(QRegExp("<(/)?(strong|em)>")); @@ -671,7 +671,7 @@ void DataManipulationForm::listObjects(QComboBox *combo, vector obj_ QApplication::setOverrideCursor(Qt::WaitCursor); catalog.setConnection(conn); - catalog.setFilter(Catalog::LIST_ALL_OBJS); + catalog.setFilter(Catalog::ListAllObjects); combo->blockSignals(true); combo->clear(); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 507e576fcc..9a2e810ebc 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -744,7 +744,7 @@ void MainWindow::updateConnections(bool force) } if(sender()!=model_valid_wgt) - ConnectionsConfigWidget::fillConnectionsComboBox(model_valid_wgt->connections_cmb, true, Connection::OP_VALIDATION); + ConnectionsConfigWidget::fillConnectionsComboBox(model_valid_wgt->connections_cmb, true, Connection::OpValidation); } } @@ -772,7 +772,7 @@ void MainWindow::saveTemporaryModels(void) bg_saving_pb->setValue(((i+1)/static_cast(count)) * 100); if(model->isModified()) - model->getDatabaseModel()->saveModel(model->getTempFilename(), SchemaParser::XML_DEFINITION); + model->getDatabaseModel()->saveModel(model->getTempFilename(), SchemaParser::XmlDefinition); } bg_saving_pb->setValue(100); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index b47cacfc8f..386f600959 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -179,7 +179,7 @@ void ModelDatabaseDiffForm::resetForm(void) src_connections_cmb->setEnabled(src_connections_cmb->count() > 0); src_connection_lbl->setEnabled(src_connections_cmb->isEnabled()); - ConnectionsConfigWidget::fillConnectionsComboBox(connections_cmb, true, Connection::OP_DIFF); + ConnectionsConfigWidget::fillConnectionsComboBox(connections_cmb, true, Connection::OpDiff); connections_cmb->setEnabled(connections_cmb->count() > 0); connection_lbl->setEnabled(connections_cmb->isEnabled()); @@ -463,8 +463,8 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) catalog.setConnection(conn); //The import process will exclude built-in array array types, system and extension objects - catalog.setFilter(Catalog::LIST_ALL_OBJS | Catalog::EXCL_BUILTIN_ARRAY_TYPES | - Catalog::EXCL_EXTENSION_OBJS | Catalog::EXCL_SYSTEM_OBJS); + catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | + Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); obj_oids[ObjDatabase].push_back(db_cmb->currentData().value()); diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index c41d280742..70b2037d37 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -113,7 +113,7 @@ void ModelExportForm::exec(ModelWidget *model) if(model) { this->model=model; - ConnectionsConfigWidget::fillConnectionsComboBox(connections_cmb, true, Connection::OP_EXPORT); + ConnectionsConfigWidget::fillConnectionsComboBox(connections_cmb, true, Connection::OpExport); selectExportMode(); QDialog::exec(); } diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 056fc54855..c277b63b88 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -74,7 +74,7 @@ void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &file trUtf8("Generating SQL code for PostgreSQL `%1'").arg(BaseObject::getPgSQLVersion()), ObjBaseObject); progress=1; - db_model->saveModel(filename, SchemaParser::SQL_DEFINITION); + db_model->saveModel(filename, SchemaParser::SqlDefinition); emit s_progressUpdated(100, trUtf8("Output SQL file `%1' successfully written.").arg(filename), ObjBaseObject); emit s_exportFinished(); @@ -427,7 +427,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c .arg(object->getTypeName()), object->getObjectType()); - sql_cmd=object->getCodeDefinition(SchemaParser::SQL_DEFINITION); + sql_cmd=object->getCodeDefinition(SchemaParser::SqlDefinition); if(types[type_id] == ObjTablespace) { @@ -471,7 +471,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c .arg(db_model->getName()), ObjDatabase); - sql_cmd=db_model->__getCodeDefinition(SchemaParser::SQL_DEFINITION); + sql_cmd=db_model->__getCodeDefinition(SchemaParser::SqlDefinition); pos = comm_regexp.indexIn(sql_cmd); /* If we find a comment on statment we should strip it from the DB definition in @@ -499,7 +499,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c //Connects to the new created database to create the other objects progress=20; new_db_conn=conn; - new_db_conn.setConnectionParam(Connection::PARAM_DB_NAME, db_model->getName()); + new_db_conn.setConnectionParam(Connection::ParamDbName, db_model->getName()); emit s_progressUpdated(progress, trUtf8("Connecting to database `%1'") .arg(db_model->getName())); @@ -511,7 +511,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c emit s_progressUpdated(progress, trUtf8("Generating SQL for `%1' objects...").arg(db_model->getObjectCount())); //Exporting the database model definition using the opened connection - buf=db_model->getCodeDefinition(SchemaParser::SQL_DEFINITION, false); + buf=db_model->getCodeDefinition(SchemaParser::SqlDefinition, false); progress=40; exportBufferToDBMS(buf, new_db_conn, drop_objs); } @@ -791,10 +791,10 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co if(!conn.isStablished()) { - orig_conn_db_name = conn.getConnectionParam(Connection::PARAM_DB_NAME); + orig_conn_db_name = conn.getConnectionParam(Connection::ParamDbName); if(!db_name.isEmpty()) - conn.setConnectionParam(Connection::PARAM_DB_NAME, db_name); + conn.setConnectionParam(Connection::ParamDbName, db_name); conn.connect(); } @@ -991,7 +991,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co { conn.close(); aux_conn=conn; - aux_conn.setConnectionParam(Connection::PARAM_DB_NAME, orig_conn_db_name); + aux_conn.setConnectionParam(Connection::ParamDbName, orig_conn_db_name); aux_conn.connect(); for(QString cmd : db_sql_cmds) aux_conn.executeDDLCommand(cmd); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index f5025951d4..507b31024f 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -215,7 +215,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) /* For DROP detection, we must gather the objects from the database in order to check if they exists on the model. The object drop order here is the inverse of the creation order on the database */ - obj_order=imported_model->getCreationOrder(SchemaParser::SQL_DEFINITION, true); + obj_order=imported_model->getCreationOrder(SchemaParser::SqlDefinition, true); aux_model=source_model; factor=25; } @@ -224,7 +224,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) { /* For creation or modification of objects the order followed is the same as the creation order on the source model */ - obj_order=source_model->getCreationOrder(SchemaParser::SQL_DEFINITION, true, true); + obj_order=source_model->getCreationOrder(SchemaParser::SqlDefinition, true, true); aux_model=imported_model; factor=50; prog=50; @@ -747,7 +747,7 @@ void ModelsDiffHelper::processDiffInfos(void) } else if(obj_type==ObjPermission) //Setting permissions - set_perms+=object->getCodeDefinition(SchemaParser::SQL_DEFINITION); + set_perms+=object->getCodeDefinition(SchemaParser::SqlDefinition); else { /* Special case for constaints: the creation commands for these objects are appended at the very end of create commands secion. @@ -775,8 +775,8 @@ void ModelsDiffHelper::processDiffInfos(void) if((diff_opts[OPT_FORCE_RECREATION] && obj_type!=ObjDatabase) && (!diff_opts[OPT_RECREATE_UNCHANGEBLE] || (diff_opts[OPT_RECREATE_UNCHANGEBLE] && !object->acceptsAlterCommand() && - diff.getObject()->getCodeDefinition(SchemaParser::SQL_DEFINITION).simplified()!= - diff.getOldObject()->getCodeDefinition(SchemaParser::SQL_DEFINITION).simplified()))) + diff.getObject()->getCodeDefinition(SchemaParser::SqlDefinition).simplified()!= + diff.getOldObject()->getCodeDefinition(SchemaParser::SqlDefinition).simplified()))) { recreateObject(object, drop_vect, create_vect); @@ -845,9 +845,9 @@ void ModelsDiffHelper::processDiffInfos(void) schema_id=type->getSchema()->getObjectId(); if(create_objs.count(schema_id)!=0) - create_objs[schema_id]+=type->getCodeDefinition(SchemaParser::SQL_DEFINITION, true); + create_objs[schema_id]+=type->getCodeDefinition(SchemaParser::SqlDefinition, true); else - attribs[ParsersAttributes::CREATE_CMDS]+=type->getCodeDefinition(SchemaParser::SQL_DEFINITION, true); + attribs[ParsersAttributes::CREATE_CMDS]+=type->getCodeDefinition(SchemaParser::SqlDefinition, true); type->convertFunctionParameters(true); } @@ -967,7 +967,7 @@ QString ModelsDiffHelper::getCodeDefinition(BaseObject *object, bool drop_cmd) if(drop_cmd) cmd=tab_obj->getDropDefinition(diff_opts[OPT_CASCADE_MODE]); else - cmd=tab_obj->getCodeDefinition(SchemaParser::SQL_DEFINITION); + cmd=tab_obj->getCodeDefinition(SchemaParser::SqlDefinition); table->setGenerateAlterCmds(gen_alter); } @@ -976,7 +976,7 @@ QString ModelsDiffHelper::getCodeDefinition(BaseObject *object, bool drop_cmd) if(drop_cmd) cmd=object->getDropDefinition(diff_opts[OPT_CASCADE_MODE]); else - cmd=object->getCodeDefinition(SchemaParser::SQL_DEFINITION); + cmd=object->getCodeDefinition(SchemaParser::SqlDefinition); } return(cmd); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index e9b2af2928..49b99ee019 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1175,7 +1175,7 @@ void ModelWidget::convertRelationshipNN(void) } } - xml_buf=tab_nn->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_buf=tab_nn->getCodeDefinition(SchemaParser::XmlDefinition); //Creates the table from the xml code xmlparser->restartParser(); @@ -1210,7 +1210,7 @@ void ModelWidget::convertRelationshipNN(void) count=tab_nn->getConstraintCount(); for(idx=0; idx < count; idx++) { - xml_buf=tab_nn->getConstraint(idx)->getCodeDefinition(SchemaParser::XML_DEFINITION,true); + xml_buf=tab_nn->getConstraint(idx)->getCodeDefinition(SchemaParser::XmlDefinition,true); xmlparser->restartParser(); xmlparser->loadXMLBuffer(xml_buf); @@ -1572,7 +1572,7 @@ void ModelWidget::saveModel(const QString &filename) task_prog_wgt.show(); saveLastCanvasPosition(); - db_model->saveModel(filename, SchemaParser::XML_DEFINITION); + db_model->saveModel(filename, SchemaParser::XmlDefinition); this->filename=filename; @@ -2403,8 +2403,8 @@ void ModelWidget::pasteObjects(bool duplicate_mode) (aux_object && (dynamic_cast(object) || (aux_object->getDatabase()==object->getDatabase()) || - (aux_object->getCodeDefinition(SchemaParser::SchemaParser::XML_DEFINITION) != - object->getCodeDefinition(SchemaParser::SchemaParser::XML_DEFINITION))))) + (aux_object->getCodeDefinition(SchemaParser::SchemaParser::XmlDefinition) != + object->getCodeDefinition(SchemaParser::SchemaParser::XmlDefinition))))) { //Resolving name conflicts if(obj_type!=ObjCast) @@ -2480,11 +2480,11 @@ void ModelWidget::pasteObjects(bool duplicate_mode) //Stores the XML definition on a xml buffer map if(duplicate_mode && aux_table) { - xml_objs[object] = aux_table->__getCodeDefinition(SchemaParser::XML_DEFINITION, true); + xml_objs[object] = aux_table->__getCodeDefinition(SchemaParser::XmlDefinition, true); object->setCodeInvalidated(true); } else - xml_objs[object]=object->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_objs[object]=object->getCodeDefinition(SchemaParser::XmlDefinition); } //Store the original parent table of the object @@ -2514,11 +2514,11 @@ void ModelWidget::pasteObjects(bool duplicate_mode) //Generates the XML code with the new parent table if(constr) { - xml_objs[object]=constr->getCodeDefinition(SchemaParser::XML_DEFINITION, duplicate_mode); + xml_objs[object]=constr->getCodeDefinition(SchemaParser::XmlDefinition, duplicate_mode); tab_obj->setCodeInvalidated(true); } else - xml_objs[object]=object->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_objs[object]=object->getCodeDefinition(SchemaParser::XmlDefinition); //Restore the original parent table tab_obj->setParentTable(orig_parent_tab); @@ -2531,11 +2531,11 @@ void ModelWidget::pasteObjects(bool duplicate_mode) if(constr) { - xml_objs[object]=constr->getCodeDefinition(SchemaParser::XML_DEFINITION, duplicate_mode); + xml_objs[object]=constr->getCodeDefinition(SchemaParser::XmlDefinition, duplicate_mode); tab_obj->setCodeInvalidated(true); } else - xml_objs[object]=tab_obj->getCodeDefinition(SchemaParser::XML_DEFINITION); + xml_objs[object]=tab_obj->getCodeDefinition(SchemaParser::XmlDefinition); } } diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index d5644cf6ec..2cf556099f 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -520,7 +520,7 @@ void PermissionWidget::updateCodePreview(void) cnt=perms.size(); for(i=0; i < cnt; i++) - code+=perms[i]->getCodeDefinition(SchemaParser::SQL_DEFINITION); + code+=perms[i]->getCodeDefinition(SchemaParser::SqlDefinition); if(code.isEmpty()) code=trUtf8("-- No permissions defined for the specified object!"); diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index 642eff9dd8..2972ed41a9 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -56,7 +56,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent while(res.accessTuple(ResultSet::NEXT_TUPLE)); } - aux_cat.setFilter(Catalog::LIST_ALL_OBJS); + aux_cat.setFilter(Catalog::ListAllObjects); std::sort(type_ids.begin(), type_ids.end()); end=std::unique(type_ids.begin(), type_ids.end()); type_ids.erase(end, type_ids.end()); diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index c13e29e706..790fb0cc66 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -143,18 +143,18 @@ void SourceCodeWidget::generateSourceCode(int) task_prog_wgt->setWindowTitle(trUtf8("Generating source code...")); task_prog_wgt->show(); connect(this->model, SIGNAL(s_objectLoaded(int,QString,unsigned)), task_prog_wgt, SLOT(updateProgress(int,QString,unsigned))); - sqlcode_txt->setPlainText(object->getCodeDefinition(SchemaParser::SQL_DEFINITION)); + sqlcode_txt->setPlainText(object->getCodeDefinition(SchemaParser::SqlDefinition)); } else { if(code_options_cmb->currentIndex()==ORIGINAL_SQL) - sqlcode_txt->setPlainText(object->getCodeDefinition(SchemaParser::SQL_DEFINITION)); + sqlcode_txt->setPlainText(object->getCodeDefinition(SchemaParser::SqlDefinition)); else { vector objs=model->getCreationOrder(object, code_options_cmb->currentIndex()==CHILDREN_SQL); for(BaseObject *obj : objs) - aux_def+=obj->getCodeDefinition(SchemaParser::SQL_DEFINITION); + aux_def+=obj->getCodeDefinition(SchemaParser::SqlDefinition); } if(!aux_def.isEmpty()) @@ -193,7 +193,7 @@ void SourceCodeWidget::generateSourceCode(int) #warning "DEMO VERSION: XML code preview disabled." xmlcode_txt->setPlainText(trUtf8("")); #else - xmlcode_txt->setPlainText(object->getCodeDefinition(SchemaParser::XML_DEFINITION)); + xmlcode_txt->setPlainText(object->getCodeDefinition(SchemaParser::XmlDefinition)); #endif setSourceCodeTab(); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index d0047e4bd8..d0b6751208 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -187,10 +187,10 @@ void SQLExecutionWidget::setConnection(Connection conn) sql_cmd_conn = conn; db_name_lbl->setText(QString("%1@%2:%3") - .arg(conn.getConnectionParam(Connection::PARAM_DB_NAME)) - .arg(conn.getConnectionParam(Connection::PARAM_SERVER_IP).isEmpty() ? - conn.getConnectionParam(Connection::PARAM_SERVER_FQDN) : conn.getConnectionParam(Connection::PARAM_SERVER_IP)) - .arg(conn.getConnectionParam(Connection::PARAM_PORT))); + .arg(conn.getConnectionParam(Connection::ParamDbName)) + .arg(conn.getConnectionParam(Connection::ParamServerIp).isEmpty() ? + conn.getConnectionParam(Connection::ParamServerFqdn) : conn.getConnectionParam(Connection::ParamServerIp)) + .arg(conn.getConnectionParam(Connection::ParamPort))); } void SQLExecutionWidget::enableCommandButtons(void) @@ -263,7 +263,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab } //Retrieving the data type names for each column - catalog.setFilter(Catalog::LIST_ALL_OBJS); + catalog.setFilter(Catalog::ListAllObjects); std::sort(type_ids.begin(), type_ids.end()); end=std::unique(type_ids.begin(), type_ids.end()); type_ids.erase(end, type_ids.end()); @@ -892,7 +892,7 @@ void SQLExecutionWidget::loadSQLHistory(void) cmd_history.clear(); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -901,13 +901,13 @@ void SQLExecutionWidget::loadSQLHistory(void) xmlparser.getElementAttributes(attribs); xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) cmd_history[attribs[ParsersAttributes::CONNECTION]].append(xmlparser.getElementContent()); xmlparser.restorePosition(); } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } } catch(Exception &e) diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 3b21aefa91..f0450dd9ba 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -81,7 +81,7 @@ SQLToolWidget::SQLToolWidget(QWidget * parent) : QWidget(parent) else { for(auto &wgt : itr.value()) - sql_exec_tbw->addTab(wgt, dbexplorer->getConnection().getConnectionParam(Connection::PARAM_DB_NAME)); + sql_exec_tbw->addTab(wgt, dbexplorer->getConnection().getConnectionParam(Connection::ParamDbName)); } itr++; @@ -172,7 +172,7 @@ void SQLToolWidget::connectToServer(void) if(sender()==connections_cmb && conn->isAutoBrowseDB()) { - database_cmb->setCurrentText(conn->getConnectionParam(Connection::PARAM_DB_NAME)); + database_cmb->setCurrentText(conn->getConnectionParam(Connection::ParamDbName)); browseDatabase(); } } @@ -251,11 +251,11 @@ void SQLToolWidget::browseDatabase(void) if(database_cmb->currentIndex() > 0) { Connection conn=(*reinterpret_cast(connections_cmb->itemData(connections_cmb->currentIndex()).value())); - QString maintainance_db=conn.getConnectionParam(Connection::PARAM_DB_NAME); + QString maintainance_db=conn.getConnectionParam(Connection::ParamDbName); DatabaseExplorerWidget *db_explorer_wgt=new DatabaseExplorerWidget; db_explorer_wgt->setObjectName(database_cmb->currentText()); - conn.setConnectionParam(Connection::PARAM_DB_NAME, database_cmb->currentText()); + conn.setConnectionParam(Connection::ParamDbName, database_cmb->currentText()); db_explorer_wgt->setConnection(conn, maintainance_db); db_explorer_wgt->listObjects(); @@ -294,7 +294,7 @@ void SQLToolWidget::addSQLExecutionTab(void) conn = db_explorer_wgt->getConnection(); sql_exec_wgt->setConnection(conn); - sql_exec_tbw->addTab(sql_exec_wgt, conn.getConnectionParam(Connection::PARAM_DB_NAME)); + sql_exec_tbw->addTab(sql_exec_wgt, conn.getConnectionParam(Connection::ParamDbName)); sql_exec_tbw->setCurrentWidget(sql_exec_wgt); sql_exec_tbw->currentWidget()->layout()->setContentsMargins(4,4,4,4); sql_exec_wgts[db_explorer_wgt].push_back(sql_exec_wgt); diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index fae3db479a..e5b331a13c 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -120,7 +120,7 @@ void SwapObjectsIdsWidget::fillCreationOrderGrid(void) if(!model) return; - map creation_order = model->getCreationOrder(SchemaParser::SQL_DEFINITION); + map creation_order = model->getCreationOrder(SchemaParser::SqlDefinition); vector objects; //Using an stl function to extract all the values (objects) from the map and put them into a list diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index dbc0030505..17c0eca4dd 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -382,7 +382,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) xmlparser.loadXMLFile(filename); - if(xmlparser.accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser.accessElement(XMLParser::ChildElement)) { do { @@ -423,7 +423,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) //Marks a flag indication that groups are being declared groups_decl=true; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); elem=xmlparser.getElementName(); } @@ -443,7 +443,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group is being declared and build at the declaration statment (not permitted) - else if(attribs.size() > 1 || xmlparser.hasElement(XMLParser::CHILD_ELEMENT)) + else if(attribs.size() > 1 || xmlparser.hasElement(XMLParser::ChildElement)) { throw Exception(Exception::getErrorMessage(InvGroupDeclaration) .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), @@ -469,7 +469,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) DefNotDeclaredGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group does not have children element - else if(!xmlparser.hasElement(XMLParser::CHILD_ELEMENT)) + else if(!xmlparser.hasElement(XMLParser::ChildElement)) { throw Exception(Exception::getErrorMessage(DefEmptyGroup).arg(group), DefEmptyGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -507,7 +507,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::CHILD_ELEMENT); + xmlparser.accessElement(XMLParser::ChildElement); if(chr_sensitive) regexp.setCaseSensitivity(Qt::CaseSensitive); @@ -539,7 +539,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) final_exprs[group].push_back(regexp); } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); xmlparser.restorePosition(); } } @@ -547,14 +547,14 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) /* Check if there are some other groups to be declared, if not, continues to reading to the other part of configuration */ - if(groups_decl && !xmlparser.hasElement(XMLParser::NEXT_ELEMENT)) + if(groups_decl && !xmlparser.hasElement(XMLParser::NextElement)) { groups_decl=false; xmlparser.restorePosition(); } } - while(xmlparser.accessElement(XMLParser::NEXT_ELEMENT)); + while(xmlparser.accessElement(XMLParser::NextElement)); } itr=groups_order.begin(); diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 784179524b..50563faa49 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -600,7 +600,7 @@ void ViewWidget::updateCodePreview(void) itr++; } - code_txt->setPlainText(aux_view.getCodeDefinition(SchemaParser::SQL_DEFINITION)); + code_txt->setPlainText(aux_view.getCodeDefinition(SchemaParser::SqlDefinition)); } } catch(Exception &e) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 3024ca2f2d..ff50d6e098 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -169,7 +169,7 @@ PgModelerCLI::PgModelerCLI(int argc, char **argv) : QApplication(argc, argv) //Replacing the initial db parameter for the input database when reverse engineering if((parsed_opts.count(IMPORT_DB) || parsed_opts.count(DIFF)) && !parsed_opts[INPUT_DB].isEmpty()) - connection.setConnectionParam(Connection::PARAM_DB_NAME, parsed_opts[INPUT_DB]); + connection.setConnectionParam(Connection::ParamDbName, parsed_opts[INPUT_DB]); } if(parsed_opts.count(DIFF)) @@ -179,7 +179,7 @@ PgModelerCLI::PgModelerCLI(int argc, char **argv) : QApplication(argc, argv) if(!extra_connection.isConfigured()) extra_connection = connection; - extra_connection.setConnectionParam(Connection::PARAM_DB_NAME, parsed_opts[COMPARE_TO]); + extra_connection.setConnectionParam(Connection::ParamDbName, parsed_opts[COMPARE_TO]); } if(!silent_mode) @@ -225,11 +225,11 @@ void PgModelerCLI::configureConnection(bool extra_conn) } else { - conn->setConnectionParam(Connection::PARAM_SERVER_FQDN, parsed_opts[HOST + chr]); - conn->setConnectionParam(Connection::PARAM_USER, parsed_opts[USER + chr]); - conn->setConnectionParam(Connection::PARAM_PORT, parsed_opts[PORT + chr]); - conn->setConnectionParam(Connection::PARAM_PASSWORD, parsed_opts[PASSWD + chr]); - conn->setConnectionParam(Connection::PARAM_DB_NAME, parsed_opts[INITIAL_DB + chr]); + conn->setConnectionParam(Connection::ParamServerFqdn, parsed_opts[HOST + chr]); + conn->setConnectionParam(Connection::ParamUser, parsed_opts[USER + chr]); + conn->setConnectionParam(Connection::ParamPort, parsed_opts[PORT + chr]); + conn->setConnectionParam(Connection::ParamPassword, parsed_opts[PASSWD + chr]); + conn->setConnectionParam(Connection::ParamDbName, parsed_opts[INITIAL_DB + chr]); } } @@ -1150,7 +1150,7 @@ void PgModelerCLI::fixOpClassesFamiliesReferences(QString &obj_xml) obj_name.remove('"'); //Transforming xml entity for quote into the char - obj_name.replace(XMLParser::CHAR_QUOT, QString("\"")); + obj_name.replace(XMLParser::CharQuot, QString("\"")); for(QString idx_type : index_types) { @@ -1160,7 +1160,7 @@ void PgModelerCLI::fixOpClassesFamiliesReferences(QString &obj_xml) if(model->getObjectIndex(aux_obj_name, ref_obj_type) >= 0) { //Replacing the old signature with the corrected form - aux_obj_name.replace(QString("\""), XMLParser::CHAR_QUOT); + aux_obj_name.replace(QString("\""), XMLParser::CharQuot); obj_xml.replace(pos, sign_regexp.matchedLength(), QString("signature=\"%1\"").arg(aux_obj_name)); break; } @@ -1181,7 +1181,7 @@ void PgModelerCLI::fixModel(void) extractObjectXML(); recreateObjects(); model->updateTablesFKRelationships(); - model->saveModel(parsed_opts[OUTPUT], SchemaParser::XML_DEFINITION); + model->saveModel(parsed_opts[OUTPUT], SchemaParser::XmlDefinition); printMessage(trUtf8("Model successfully fixed!")); } @@ -1254,7 +1254,7 @@ void PgModelerCLI::importDatabase(void) printMessage(trUtf8("Saving the imported database to file...")); - model_wgt->getDatabaseModel()->saveModel(parsed_opts[OUTPUT], SchemaParser::XML_DEFINITION); + model_wgt->getDatabaseModel()->saveModel(parsed_opts[OUTPUT], SchemaParser::XmlDefinition); printMessage(trUtf8("Import successfully ended!\n")); @@ -1273,12 +1273,12 @@ void PgModelerCLI::importDatabase(DatabaseModel *model, Connection conn) catalog.setConnection(conn); //For diff we don't need the oids of all system objects - catalog.setFilter(Catalog::LIST_ALL_OBJS | Catalog::EXCL_BUILTIN_ARRAY_TYPES | - Catalog::EXCL_EXTENSION_OBJS | Catalog::EXCL_SYSTEM_OBJS); + catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | + Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); - db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::PARAM_DB_NAME), ObjDatabase); + db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::ParamDbName), ObjDatabase); obj_oids[ObjDatabase].push_back(db_oid.toUInt()); catalog.closeConnection(); diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index 3a5650e2b6..78f7082de8 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -67,7 +67,7 @@ void Xml2ObjectWidget::generateObject(void) xmlparser->restartParser(); xmlparser->loadXMLBuffer(code_txt->toPlainText().toUtf8()); - if(xmlparser->accessElement(XMLParser::CHILD_ELEMENT)) + if(xmlparser->accessElement(XMLParser::ChildElement)) { do { @@ -90,7 +90,7 @@ void Xml2ObjectWidget::generateObject(void) xmlparser->restorePosition(); } } - while(xmlparser->accessElement(xmlparser->NEXT_ELEMENT)); + while(xmlparser->accessElement(xmlparser->NextElement)); } op_list->finishOperationChain(); diff --git a/tests/src/databasemodeltest/databasemodeltest.cpp b/tests/src/databasemodeltest/databasemodeltest.cpp index 61e1f1c009..79a283c752 100644 --- a/tests/src/databasemodeltest/databasemodeltest.cpp +++ b/tests/src/databasemodeltest/databasemodeltest.cpp @@ -64,7 +64,7 @@ void DatabaseModelTest::loadObjectsMetadata(void) dbmodel.createSystemObjects(false); dbmodel.loadModel(input_dbm); dbmodel.loadObjectsMetadata(input_opf); - dbmodel.saveModel(output, SchemaParser::XML_DEFINITION); + dbmodel.saveModel(output, SchemaParser::XmlDefinition); QCOMPARE(true, true); } catch (Exception &e) From 02af6748baaf823c047d10025218a2650a89ac3a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Oct 2018 22:24:06 -0300 Subject: [PATCH 165/425] Renamed PgModelerNS to PgModelerNs Renamed PgModelerUiNs to PgModelerUiNs Renamed XMLParser to XmlParser Several static const attributes refactoring --- crashhandler/src/crashhandlerform.cpp | 4 +- crashhandler/src/main.cpp | 2 +- libobjrenderer/src/baseobjectview.cpp | 6 +- libobjrenderer/src/basetableview.cpp | 12 +- libobjrenderer/src/objectsscene.cpp | 4 +- libobjrenderer/src/relationshipview.cpp | 218 +++++----- libobjrenderer/src/tableobjectview.cpp | 2 +- libparsers/src/schemaparser.cpp | 28 +- libparsers/src/xmlparser.cpp | 58 +-- libparsers/src/xmlparser.h | 6 +- libpgconnector/src/catalog.cpp | 32 +- libpgconnector/src/resultset.cpp | 10 +- libpgconnector/src/resultset.h | 8 +- libpgmodeler/src/aggregate.cpp | 22 +- libpgmodeler/src/aggregate.h | 4 +- libpgmodeler/src/baseobject.cpp | 4 +- libpgmodeler/src/baserelationship.cpp | 104 ++--- libpgmodeler/src/baserelationship.h | 24 +- libpgmodeler/src/cast.cpp | 28 +- libpgmodeler/src/cast.h | 12 +- libpgmodeler/src/collation.cpp | 12 +- libpgmodeler/src/collation.h | 4 +- libpgmodeler/src/constraint.cpp | 28 +- libpgmodeler/src/constraint.h | 8 +- libpgmodeler/src/copyoptions.cpp | 4 +- libpgmodeler/src/databasemodel.cpp | 396 +++++++++--------- libpgmodeler/src/databasemodel.h | 4 +- libpgmodeler/src/operationlist.cpp | 12 +- libpgmodeler/src/operationlist.h | 2 +- libpgmodeler/src/pgmodelerns.cpp | 2 +- libpgmodeler/src/pgmodelerns.h | 2 +- libpgmodeler/src/relationship.cpp | 278 ++++++------ libpgmodeler/src/table.cpp | 6 +- libpgmodeler_ui/src/aboutwidget.cpp | 8 +- libpgmodeler_ui/src/aggregatewidget.cpp | 8 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 14 +- libpgmodeler_ui/src/baseconfigwidget.h | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 22 +- libpgmodeler_ui/src/bugreportform.cpp | 2 +- libpgmodeler_ui/src/castwidget.cpp | 20 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 10 +- libpgmodeler_ui/src/collationwidget.cpp | 8 +- libpgmodeler_ui/src/columnwidget.cpp | 4 +- libpgmodeler_ui/src/configurationform.cpp | 2 +- .../src/connectionsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/constraintwidget.cpp | 58 +-- libpgmodeler_ui/src/customsqlwidget.cpp | 8 +- .../src/databaseexplorerwidget.cpp | 18 +- libpgmodeler_ui/src/databaseimportform.cpp | 28 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 6 +- libpgmodeler_ui/src/databaseimporthelper.h | 2 +- libpgmodeler_ui/src/databasewidget.cpp | 16 +- libpgmodeler_ui/src/datamanipulationform.cpp | 40 +- libpgmodeler_ui/src/domainwidget.cpp | 4 +- libpgmodeler_ui/src/donatewidget.cpp | 2 +- libpgmodeler_ui/src/elementstablewidget.cpp | 10 +- libpgmodeler_ui/src/elementwidget.cpp | 2 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 2 +- libpgmodeler_ui/src/functionwidget.cpp | 18 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 2 +- libpgmodeler_ui/src/hinttextwidget.cpp | 4 +- libpgmodeler_ui/src/indexwidget.cpp | 4 +- libpgmodeler_ui/src/mainwindow.cpp | 32 +- libpgmodeler_ui/src/messagebox.cpp | 18 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 34 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 88 ++-- libpgmodeler_ui/src/modelexportform.cpp | 42 +- libpgmodeler_ui/src/modelfixform.cpp | 6 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 32 +- libpgmodeler_ui/src/modelrestorationform.cpp | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 22 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 4 +- libpgmodeler_ui/src/modelvalidationwidget.cpp | 42 +- libpgmodeler_ui/src/modelwidget.cpp | 214 +++++----- libpgmodeler_ui/src/modelwidget.h | 2 +- libpgmodeler_ui/src/numberedtexteditor.cpp | 12 +- libpgmodeler_ui/src/objectdepsrefswidget.cpp | 4 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 6 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 6 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 8 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 2 +- libpgmodeler_ui/src/permissionwidget.cpp | 8 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 2 +- libpgmodeler_ui/src/pgmodeleruins.h | 2 +- libpgmodeler_ui/src/pluginsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/policywidget.cpp | 6 +- .../src/relationshipconfigwidget.cpp | 6 +- libpgmodeler_ui/src/relationshipwidget.cpp | 124 +++--- libpgmodeler_ui/src/resultsetmodel.cpp | 8 +- libpgmodeler_ui/src/rolewidget.cpp | 14 +- libpgmodeler_ui/src/rulewidget.cpp | 2 +- libpgmodeler_ui/src/sceneinfowidget.cpp | 6 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 8 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 14 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 54 +-- libpgmodeler_ui/src/sqltoolwidget.cpp | 2 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 4 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 16 +- libpgmodeler_ui/src/syntaxhighlighter.h | 2 +- libpgmodeler_ui/src/tabledatawidget.cpp | 10 +- libpgmodeler_ui/src/tablewidget.cpp | 60 +-- libpgmodeler_ui/src/taskprogresswidget.cpp | 6 +- libpgmodeler_ui/src/triggerwidget.cpp | 4 +- libpgmodeler_ui/src/typewidget.cpp | 6 +- libpgmodeler_ui/src/updatenotifierwidget.cpp | 6 +- libpgmodeler_ui/src/viewwidget.cpp | 20 +- libpgmodeler_ui/src/welcomewidget.cpp | 2 +- libutils/src/pgsqlversions.cpp | 32 +- libutils/src/pgsqlversions.h | 20 +- main-cli/src/pgmodelercli.cpp | 4 +- main-cli/src/pgmodelercli.h | 2 +- plugins/xml2object/src/xml2objectwidget.cpp | 4 +- .../partrelationshiptest.cpp | 10 +- 114 files changed, 1359 insertions(+), 1357 deletions(-) diff --git a/crashhandler/src/crashhandlerform.cpp b/crashhandler/src/crashhandlerform.cpp index 2bfa66fe84..4321323c63 100644 --- a/crashhandler/src/crashhandlerform.cpp +++ b/crashhandler/src/crashhandlerform.cpp @@ -82,7 +82,7 @@ CrashHandlerForm::CrashHandlerForm(bool analysis_mode, QWidget *parent, Qt::Wind layout->addWidget(input_edt); load_tb=new QToolButton(input_wgt); - load_tb->setIcon(QPixmap(PgModelerUiNS::getIconPath("abrir"))); + load_tb->setIcon(QPixmap(PgModelerUiNs::getIconPath("abrir"))); load_tb->setSizePolicy(output_tb->sizePolicy()); load_tb->setToolButtonStyle(output_tb->toolButtonStyle()); load_tb->setIconSize(output_tb->iconSize()); @@ -90,7 +90,7 @@ CrashHandlerForm::CrashHandlerForm(bool analysis_mode, QWidget *parent, Qt::Wind layout->addWidget(load_tb); save_tb=new QToolButton(input_wgt); - save_tb->setIcon(QPixmap(PgModelerUiNS::getIconPath("salvar"))); + save_tb->setIcon(QPixmap(PgModelerUiNs::getIconPath("salvar"))); save_tb->setSizePolicy(output_tb->sizePolicy()); save_tb->setToolButtonStyle(output_tb->toolButtonStyle()); save_tb->setIconSize(output_tb->iconSize()); diff --git a/crashhandler/src/main.cpp b/crashhandler/src/main.cpp index a36306c10d..77b91ef7da 100644 --- a/crashhandler/src/main.cpp +++ b/crashhandler/src/main.cpp @@ -34,7 +34,7 @@ int main(int argc, char **argv) app.installTranslator(&translator); CrashHandlerForm crashhandler(args.size() > 1 && args[1]==CrashHandlerForm::AnalysisMode); - PgModelerUiNS::resizeDialog(&crashhandler); + PgModelerUiNs::resizeDialog(&crashhandler); crashhandler.show(); app.exec(); diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index a2f3b768e2..32b8195626 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -210,7 +210,7 @@ void BaseObjectView::loadObjectsStyle(void) QString elem, config_file=GlobalAttributes::ConfigurationsDir + GlobalAttributes::DirSeparator + GlobalAttributes::ObjectsStyleConf + GlobalAttributes::ConfigurationExt; - XMLParser xmlparser; + XmlParser xmlparser; try { @@ -223,7 +223,7 @@ void BaseObjectView::loadObjectsStyle(void) GlobalAttributes::ObjectDTDExt, GlobalAttributes::ObjectsStyleConf); xmlparser.loadXMLFile(config_file); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -266,7 +266,7 @@ void BaseObjectView::loadObjectsStyle(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 48301fc0a7..f88728b37e 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -269,8 +269,8 @@ void BaseTableView::addConnectedRelationship(BaseRelationship *base_rel) if(!base_rel || (base_rel && - base_rel->getTable(BaseRelationship::SRC_TABLE) != tab && - base_rel->getTable(BaseRelationship::DST_TABLE) != tab)) + base_rel->getTable(BaseRelationship::SrcTable) != tab && + base_rel->getTable(BaseRelationship::DstTable) != tab)) return; connected_rels.push_back(base_rel); @@ -297,10 +297,10 @@ unsigned BaseTableView::getConnectedRelsCount(BaseTable *src_tab, BaseTable *dst for(auto &rel : connected_rels) { - if((rel->getTable(BaseRelationship::SRC_TABLE) == src_tab && - rel->getTable(BaseRelationship::DST_TABLE) == dst_tab) || - (rel->getTable(BaseRelationship::SRC_TABLE) == dst_tab && - rel->getTable(BaseRelationship::DST_TABLE) == src_tab)) + if((rel->getTable(BaseRelationship::SrcTable) == src_tab && + rel->getTable(BaseRelationship::DstTable) == dst_tab) || + (rel->getTable(BaseRelationship::SrcTable) == dst_tab && + rel->getTable(BaseRelationship::DstTable) == src_tab)) count++; } diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 3aa4cbd89a..960cc05920 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -1068,8 +1068,8 @@ void ObjectsScene::alignObjectsToGrid(void) } //Align the labels - for(i1=BaseRelationship::SRC_CARD_LABEL; - i1<=BaseRelationship::REL_NAME_LABEL; i1++) + for(i1=BaseRelationship::SrcCardLabel; + i1<=BaseRelationship::RelNameLabel; i1++) { lab=rel->getLabel(i1); if(lab) diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index f51f8a71b6..90f2031ea0 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -28,13 +28,13 @@ RelationshipView::RelationshipView(BaseRelationship *rel) : BaseObjectView(rel) if(!rel) throw Exception(AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); - for(unsigned i=BaseRelationship::SRC_CARD_LABEL; - i <= BaseRelationship::REL_NAME_LABEL; i++) + for(unsigned i=BaseRelationship::SrcCardLabel; + i <= BaseRelationship::RelNameLabel; i++) { if(rel->getLabel(i)) { labels[i]=new TextboxView(rel->getLabel(i), true); - labels[i]->setZValue(i==BaseRelationship::REL_NAME_LABEL ? 1 : 2); + labels[i]->setZValue(i==BaseRelationship::RelNameLabel ? 1 : 2); this->addToGroup(labels[i]); } else @@ -211,7 +211,7 @@ BaseRelationship *RelationshipView::getSourceObject(void) TextboxView *RelationshipView::getLabel(unsigned lab_idx) { - if(lab_idx > BaseRelationship::REL_NAME_LABEL) + if(lab_idx > BaseRelationship::RelNameLabel) return(nullptr); else return(labels[lab_idx]); @@ -321,7 +321,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant else round_cf_descriptors[idx]->setBrush(descriptor->brush()); - if(this->getSourceObject()->getRelationshipType() == BaseRelationship::RELATIONSHIP_FK) + if(this->getSourceObject()->getRelationshipType() == BaseRelationship::RelationshipFk) pen.setStyle(Qt::DashLine); round_cf_descriptors[idx]->setPen(pen); @@ -549,8 +549,8 @@ void RelationshipView::configureObject(void) { BaseRelationship *rel_base=this->getSourceObject(); - tables[0]=dynamic_cast(rel_base->getTable(BaseRelationship::SRC_TABLE)->getReceiverObject()); - tables[1]=dynamic_cast(rel_base->getTable(BaseRelationship::DST_TABLE)->getReceiverObject()); + tables[0]=dynamic_cast(rel_base->getTable(BaseRelationship::SrcTable)->getReceiverObject()); + tables[1]=dynamic_cast(rel_base->getTable(BaseRelationship::DstTable)->getReceiverObject()); tables[0]->addConnectedRelationship(rel_base); @@ -608,8 +608,8 @@ void RelationshipView::configureLine(void) { double fnt_factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize, pos_factor = 0, offset = 0; - unsigned rel_cnt = tables[0]->getConnectedRelsCount(base_rel->getTable(BaseRelationship::SRC_TABLE), - base_rel->getTable(BaseRelationship::DST_TABLE)); + unsigned rel_cnt = tables[0]->getConnectedRelsCount(base_rel->getTable(BaseRelationship::SrcTable), + base_rel->getTable(BaseRelationship::DstTable)); /* Sefl-relationshihp line format: @@ -654,12 +654,12 @@ void RelationshipView::configureLine(void) else { Relationship *rel=dynamic_cast(base_rel); - bool rel_1n= (rel_type==Relationship::RELATIONSHIP_11 || - rel_type==Relationship::RELATIONSHIP_1N || - rel_type==Relationship::RELATIONSHIP_FK); + bool rel_1n= (rel_type==Relationship::Relationship11 || + rel_type==Relationship::Relationship1n || + rel_type==Relationship::RelationshipFk); if(rel && - rel->getRelationshipType()==Relationship::RELATIONSHIP_11 && + rel->getRelationshipType()==Relationship::Relationship11 && rel->isIdentifier()) { tables[0]=dynamic_cast(rel->getReferenceTable()->getReceiverObject()); @@ -697,8 +697,8 @@ void RelationshipView::configureLine(void) if(!rel) { - ref_tab=dynamic_cast
(base_rel->getTable(BaseRelationship::DST_TABLE)); - rec_tab=dynamic_cast
(base_rel->getTable(BaseRelationship::SRC_TABLE)); + ref_tab=dynamic_cast
(base_rel->getTable(BaseRelationship::DstTable)); + rec_tab=dynamic_cast
(base_rel->getTable(BaseRelationship::SrcTable)); } else { @@ -744,16 +744,16 @@ void RelationshipView::configureLine(void) for(auto &constr : fks) { - cnt=constr->getColumnCount(Constraint::SOURCE_COLS); + cnt=constr->getColumnCount(Constraint::SourceCols); for(i=0; i < cnt; i++) { - pnt=rec_tab_view->getConnectionPoints(constr->getColumn(i, Constraint::SOURCE_COLS), fk_pnt_type); + pnt=rec_tab_view->getConnectionPoints(constr->getColumn(i, Constraint::SourceCols), fk_pnt_type); fk_py+=pnt.y(); fk_px=pnt.x(); fk_points.push_back(this->mapFromItem(rec_tab_view, pnt)); - pnt=ref_tab_view->getConnectionPoints(constr->getColumn(i, Constraint::REFERENCED_COLS), pk_pnt_type); + pnt=ref_tab_view->getConnectionPoints(constr->getColumn(i, Constraint::ReferencedCols), pk_pnt_type); pk_py+=pnt.y(); pk_px=pnt.x(); pk_points.push_back(this->mapFromItem(ref_tab_view, pnt)); @@ -768,7 +768,7 @@ void RelationshipView::configureLine(void) pk_pnt=this->mapFromItem(ref_tab_view, QPointF(pk_px + pk_dx, pk_py/pk_points.size())); fk_pnt=this->mapFromItem(rec_tab_view, QPointF(fk_px + fk_dx, fk_py/fk_points.size())); - if(rel_type==Relationship::RELATIONSHIP_FK) + if(rel_type==Relationship::RelationshipFk) { p_central[1]=pk_pnt; p_central[0]=fk_pnt; @@ -786,7 +786,7 @@ void RelationshipView::configureLine(void) * This situation may happen when the relationship is being validated and the needed fks was not * created yet. In a second interaction of the rel. validation they are created * and the relationship is properly configured */ - if(rel_type==Relationship::RELATIONSHIP_FK) + if(rel_type==Relationship::RelationshipFk) { p_central[1]=pk_pnt=ref_tab_view->getCenter(); p_central[0]=fk_pnt=rec_tab_view->getCenter(); @@ -859,8 +859,8 @@ void RelationshipView::configureLine(void) for(int tab_idx = 0; tab_idx < 2; tab_idx++) { - conn_rels_cnt[tab_idx] = tables[tab_idx]->getConnectedRelsCount(base_rel->getTable(BaseRelationship::SRC_TABLE), - base_rel->getTable(BaseRelationship::DST_TABLE)); + conn_rels_cnt[tab_idx] = tables[tab_idx]->getConnectedRelsCount(base_rel->getTable(BaseRelationship::SrcTable), + base_rel->getTable(BaseRelationship::DstTable)); conn_rels_factors[tab_idx] = conn_rels_cnt[tab_idx] == 1 ? 1 : 0.08f * (tables[tab_idx]->getConnectedRelationshipIndex(base_rel)); if(!points.empty()) @@ -871,25 +871,25 @@ void RelationshipView::configureLine(void) line = QLineF(tables[1]->getCenter(), points[points.size() - 1]); } - if(rel_type==BaseRelationship::RELATIONSHIP_GEN || rel_type==BaseRelationship::RELATIONSHIP_DEP || rel_type==BaseRelationship::RELATIONSHIP_PART) + if(rel_type==BaseRelationship::RelationshipGen || rel_type==BaseRelationship::RelationshipDep || rel_type==BaseRelationship::RelationshipPart) size_factor = 0.40; else if(use_crows_foot) { - if(rel_type==BaseRelationship::RELATIONSHIP_NN || - (tab_idx == 1 && rel_type==BaseRelationship::RELATIONSHIP_FK) || - (tab_idx == 0 && rel_type==BaseRelationship::RELATIONSHIP_1N && base_rel->isTableMandatory(BaseRelationship::SRC_TABLE)) || - (tab_idx == 0 && rel_type==BaseRelationship::RELATIONSHIP_11 && base_rel->isTableMandatory(BaseRelationship::SRC_TABLE)) || - (tab_idx == 1 && rel_type==BaseRelationship::RELATIONSHIP_11 && base_rel->isTableMandatory(BaseRelationship::DST_TABLE))) + if(rel_type==BaseRelationship::RelationshipNn || + (tab_idx == 1 && rel_type==BaseRelationship::RelationshipFk) || + (tab_idx == 0 && rel_type==BaseRelationship::Relationship1n && base_rel->isTableMandatory(BaseRelationship::SrcTable)) || + (tab_idx == 0 && rel_type==BaseRelationship::Relationship11 && base_rel->isTableMandatory(BaseRelationship::SrcTable)) || + (tab_idx == 1 && rel_type==BaseRelationship::Relationship11 && base_rel->isTableMandatory(BaseRelationship::DstTable))) size_factor = 1 * font_factor; else size_factor = 1.5 * font_factor; - if(rel_type == BaseRelationship::RELATIONSHIP_PART || - rel_type == BaseRelationship::RELATIONSHIP_GEN || - rel_type == BaseRelationship::RELATIONSHIP_DEP || - rel_type == BaseRelationship::RELATIONSHIP_11 || - (tab_idx == 0 && rel_type == BaseRelationship::RELATIONSHIP_1N) || - (tab_idx == 1 && rel_type == BaseRelationship::RELATIONSHIP_FK)) + if(rel_type == BaseRelationship::RelationshipPart || + rel_type == BaseRelationship::RelationshipGen || + rel_type == BaseRelationship::RelationshipDep || + rel_type == BaseRelationship::Relationship11 || + (tab_idx == 0 && rel_type == BaseRelationship::Relationship1n) || + (tab_idx == 1 && rel_type == BaseRelationship::RelationshipFk)) border_factor = ConnLineLength * 0.30; else border_factor = ConnLineLength * 0.75; @@ -1009,8 +1009,8 @@ void RelationshipView::configureLine(void) } //For dependency/partition relationships the line is dashed - if(rel_type==BaseRelationship::RELATIONSHIP_DEP || - rel_type == BaseRelationship::RELATIONSHIP_PART) + if(rel_type==BaseRelationship::RelationshipDep || + rel_type == BaseRelationship::RelationshipPart) pen.setStyle(Qt::DashLine); /* For identifier relationships an additional point is created on the center of the @@ -1125,10 +1125,10 @@ void RelationshipView::configureLine(void) //Exposing the line ending circles if((!base_rel->isSelfRelationship() && line_conn_mode==ConnectCenterPoints && !use_crows_foot) || (!base_rel->isSelfRelationship() && - ((line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RELATIONSHIP_DEP) || - (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RELATIONSHIP_GEN) || - (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RELATIONSHIP_PART) || - (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RELATIONSHIP_NN && !use_crows_foot)))) + ((line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RelationshipDep) || + (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RelationshipGen) || + (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RelationshipPart) || + (line_conn_mode != ConnectTableEdges && rel_type==BaseRelationship::RelationshipNn && !use_crows_foot)))) { for(i=0; i < 2; i++) { @@ -1224,7 +1224,7 @@ void RelationshipView::configureLine(void) /* Making a little tweak on the foreign key type name. Despite being of class BaseRelationship, for semantics purposes shows the type of this relationship as "Relationship" unlike "Link" */ - if(rel_type==BaseRelationship::RELATIONSHIP_FK) + if(rel_type==BaseRelationship::RelationshipFk) tool_tip=base_rel->getName(true) + QString(" (") + BaseObject::getTypeName(ObjRelationship) + QString(")"); else @@ -1286,8 +1286,8 @@ void RelationshipView::configureDescriptor(void) //Using the default color pen=BaseObjectView::getBorderStyle(ParsersAttributes::RELATIONSHIP); - if(rel_type==BaseRelationship::RELATIONSHIP_DEP || - rel_type == BaseRelationship::RELATIONSHIP_PART) + if(rel_type==BaseRelationship::RelationshipDep || + rel_type == BaseRelationship::RelationshipPart) pen.setStyle(Qt::DashLine); descriptor->setPen(pen); @@ -1312,13 +1312,13 @@ void RelationshipView::configureDescriptor(void) else descriptor->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::RELATIONSHIP)); - if(rel_type==BaseRelationship::RELATIONSHIP_DEP || - rel_type==BaseRelationship::RELATIONSHIP_GEN) + if(rel_type==BaseRelationship::RelationshipDep || + rel_type==BaseRelationship::RelationshipGen) { pol.append(QPointF(0,0)); pol.append(QPointF(18,10)); pol.append(QPointF(0,20)); pol.append(QPointF(0,10)); } - else if(rel_type==BaseRelationship::RELATIONSHIP_PART) + else if(rel_type==BaseRelationship::RelationshipPart) { pol.append(QPointF(0,4)); pol.append(QPointF(4,0)); pol.append(QPointF(18,12)); pol.append(QPointF(4,24)); @@ -1358,9 +1358,9 @@ void RelationshipView::configureDescriptor(void) /* Workaround to avoid the inheritance / dependency relationship to get the descriptor rotated to the wrong side * We create and auxiliary line with points from the position at 65% of the curve to the 45% and use the * angle of that line instead of the angle at 50% of the curve */ - if((rel_type == BaseRelationship::RELATIONSHIP_DEP || - rel_type == BaseRelationship::RELATIONSHIP_GEN || - rel_type == BaseRelationship::RELATIONSHIP_PART) && + if((rel_type == BaseRelationship::RelationshipDep || + rel_type == BaseRelationship::RelationshipGen || + rel_type == BaseRelationship::RelationshipPart) && curve->isControlPointsInverted() && !curve->isSimpleCurve() && !curve->isStraightLine()) { QLineF lin_aux = QLineF(path.pointAtPercent(0.65), path.pointAtPercent(0.45)); @@ -1433,9 +1433,9 @@ void RelationshipView::configureDescriptor(void) * relationships the descriptor is still displayed. */ descriptor->setVisible(!use_crows_foot || (use_crows_foot && ( - rel_type == BaseRelationship::RELATIONSHIP_DEP || - rel_type == BaseRelationship::RELATIONSHIP_GEN || - rel_type == BaseRelationship::RELATIONSHIP_PART))); + rel_type == BaseRelationship::RelationshipDep || + rel_type == BaseRelationship::RelationshipGen || + rel_type == BaseRelationship::RelationshipPart))); obj_shadow->setVisible(descriptor->isVisible()); } @@ -1445,9 +1445,9 @@ void RelationshipView::configureCrowsFootDescriptors(void) Relationship *rel=dynamic_cast(base_rel); //Hiding all descriptors related to crow's foot when the notation is not being used - if(!use_crows_foot && cf_descriptors[BaseRelationship::SRC_TABLE]) + if(!use_crows_foot && cf_descriptors[BaseRelationship::SrcTable]) { - for(unsigned tab_id = BaseRelationship::SRC_TABLE; tab_id <= BaseRelationship::DST_TABLE; tab_id++) + for(unsigned tab_id = BaseRelationship::SrcTable; tab_id <= BaseRelationship::DstTable; tab_id++) { for(auto &item : cf_descriptors[tab_id]->childItems()) { @@ -1460,10 +1460,10 @@ void RelationshipView::configureCrowsFootDescriptors(void) } } else if(use_crows_foot && base_rel && - (base_rel->getRelationshipType() == BaseRelationship::RELATIONSHIP_11 || - base_rel->getRelationshipType() == BaseRelationship::RELATIONSHIP_1N || - base_rel->getRelationshipType() == BaseRelationship::RELATIONSHIP_NN || - base_rel->getRelationshipType() == BaseRelationship::RELATIONSHIP_FK)) + (base_rel->getRelationshipType() == BaseRelationship::Relationship11 || + base_rel->getRelationshipType() == BaseRelationship::Relationship1n || + base_rel->getRelationshipType() == BaseRelationship::RelationshipNn || + base_rel->getRelationshipType() == BaseRelationship::RelationshipFk)) { QGraphicsLineItem *line_item = nullptr; QGraphicsEllipseItem *circle_item = nullptr; @@ -1473,32 +1473,32 @@ void RelationshipView::configureCrowsFootDescriptors(void) BaseTableView *tables[2] = { nullptr, nullptr }; bool mandatory[2] = { false, false }; - if(rel_type == BaseRelationship::RELATIONSHIP_NN || rel_type == BaseRelationship::RELATIONSHIP_FK) + if(rel_type == BaseRelationship::RelationshipNn || rel_type == BaseRelationship::RelationshipFk) { - tables[BaseRelationship::SRC_TABLE] = dynamic_cast(base_rel->getTable(BaseRelationship::SRC_TABLE)->getReceiverObject()); - tables[BaseRelationship::DST_TABLE] = dynamic_cast(base_rel->getTable(BaseRelationship::DST_TABLE)->getReceiverObject()); - mandatory[BaseRelationship::SRC_TABLE] = base_rel->isTableMandatory(BaseRelationship::SRC_TABLE); - mandatory[BaseRelationship::DST_TABLE] = base_rel->isTableMandatory(BaseRelationship::DST_TABLE); + tables[BaseRelationship::SrcTable] = dynamic_cast(base_rel->getTable(BaseRelationship::SrcTable)->getReceiverObject()); + tables[BaseRelationship::DstTable] = dynamic_cast(base_rel->getTable(BaseRelationship::DstTable)->getReceiverObject()); + mandatory[BaseRelationship::SrcTable] = base_rel->isTableMandatory(BaseRelationship::SrcTable); + mandatory[BaseRelationship::DstTable] = base_rel->isTableMandatory(BaseRelationship::DstTable); } else { - tables[BaseRelationship::SRC_TABLE] = dynamic_cast(rel->getReferenceTable()->getReceiverObject()); - tables[BaseRelationship::DST_TABLE] = dynamic_cast(rel->getReceiverTable()->getReceiverObject()); - mandatory[BaseRelationship::SRC_TABLE] = rel->isReferenceTableMandatory(); - mandatory[BaseRelationship::DST_TABLE] = rel->isReceiverTableMandatory(); + tables[BaseRelationship::SrcTable] = dynamic_cast(rel->getReferenceTable()->getReceiverObject()); + tables[BaseRelationship::DstTable] = dynamic_cast(rel->getReceiverTable()->getReceiverObject()); + mandatory[BaseRelationship::SrcTable] = rel->isReferenceTableMandatory(); + mandatory[BaseRelationship::DstTable] = rel->isReceiverTableMandatory(); /* There's a special case for one-to-one relationships that will cause the crow's foot * descriptors to be positioned in the oposite sides when compared to other relationships. * This because pgModeler switches automatically the receiver table to be the destination one * when the mandatory table of the relationship is the destination. So we use and auxiliary (signal inverter) * variable to alter the descriptors position */ - if(mandatory[BaseRelationship::SRC_TABLE] && rel_type == BaseRelationship::RELATIONSHIP_11 && - rel->getTable(BaseRelationship::DST_TABLE) == rel->getReferenceTable()) + if(mandatory[BaseRelationship::SrcTable] && rel_type == BaseRelationship::Relationship11 && + rel->getTable(BaseRelationship::DstTable) == rel->getReferenceTable()) signal = -1; } //Allocatting all objects related to the crow's foot descriptors - if(cf_descriptors[BaseRelationship::SRC_TABLE] == nullptr) + if(cf_descriptors[BaseRelationship::SrcTable] == nullptr) { int src_zvalue = lines.front()->zValue() + 1, dst_zvalue = lines.back()->zValue() + 1; @@ -1515,17 +1515,17 @@ void RelationshipView::configureCrowsFootDescriptors(void) { line_item = new QGraphicsLineItem; src_cf_lines.push_back(line_item); - cf_descriptors[BaseRelationship::SRC_TABLE]->setZValue(src_zvalue); + cf_descriptors[BaseRelationship::SrcTable]->setZValue(src_zvalue); line_item = new QGraphicsLineItem; dst_cf_lines.push_back(line_item); - cf_descriptors[BaseRelationship::DST_TABLE]->setZValue(dst_zvalue); + cf_descriptors[BaseRelationship::DstTable]->setZValue(dst_zvalue); } } else { - cf_descriptors[BaseRelationship::SRC_TABLE]->setVisible(true); - cf_descriptors[BaseRelationship::DST_TABLE]->setVisible(true); + cf_descriptors[BaseRelationship::SrcTable]->setVisible(true); + cf_descriptors[BaseRelationship::DstTable]->setVisible(true); } QPointF pi; @@ -1538,7 +1538,7 @@ void RelationshipView::configureCrowsFootDescriptors(void) unsigned lin_idx = 0; double px = 0, py = 0, min_x = 0, max_x = 0, min_y = 0, max_y = 0; - for(unsigned tab_id = BaseRelationship::SRC_TABLE; tab_id <= BaseRelationship::DST_TABLE; tab_id++) + for(unsigned tab_id = BaseRelationship::SrcTable; tab_id <= BaseRelationship::DstTable; tab_id++) { cf_descriptors[tab_id]->setRotation(0); @@ -1550,11 +1550,11 @@ void RelationshipView::configureCrowsFootDescriptors(void) } //Configuring the minimum cardinality descriptor - if((tab_id == BaseRelationship::SRC_TABLE && - rel_type != BaseRelationship::RELATIONSHIP_NN && rel_type != BaseRelationship::RELATIONSHIP_FK) || + if((tab_id == BaseRelationship::SrcTable && + rel_type != BaseRelationship::RelationshipNn && rel_type != BaseRelationship::RelationshipFk) || - (tab_id == BaseRelationship::DST_TABLE && - (rel_type == BaseRelationship::RELATIONSHIP_11 || rel_type == BaseRelationship::RELATIONSHIP_FK))) + (tab_id == BaseRelationship::DstTable && + (rel_type == BaseRelationship::Relationship11 || rel_type == BaseRelationship::RelationshipFk))) { line_item = cf_lines[tab_id]->at(lin_idx++); @@ -1562,14 +1562,14 @@ void RelationshipView::configureCrowsFootDescriptors(void) line_item->setVisible(true); line_item->setLine(QLineF(QPointF(0, -8 * factor), QPointF(0, 8 * factor))); - line_item->setPos((10 * signal) * (tab_id == BaseRelationship::DST_TABLE ? -1 : 1), 0); + line_item->setPos((10 * signal) * (tab_id == BaseRelationship::DstTable ? -1 : 1), 0); line_item->setPen(pens[tab_id]); } else { //Configuring the crow's foot descriptor - if(tab_id == BaseRelationship::SRC_TABLE) + if(tab_id == BaseRelationship::SrcTable) { px = 0; line = QLineF(QPointF(14, 0), QPointF(0, - 10 * factor)); @@ -1603,19 +1603,19 @@ void RelationshipView::configureCrowsFootDescriptors(void) round_cf_descriptors[tab_id]->setVisible(false); //Configuring the maximum cardinality descriptor - if((tab_id == BaseRelationship::SRC_TABLE && mandatory[tab_id]) || rel_type == BaseRelationship::RELATIONSHIP_NN) + if((tab_id == BaseRelationship::SrcTable && mandatory[tab_id]) || rel_type == BaseRelationship::RelationshipNn) { line_item = cf_lines[tab_id]->at(lin_idx++); cf_descriptors[tab_id]->addToGroup(line_item); line_item->setVisible(true); line_item->setLine(QLineF(QPointF(0, -8 * factor), QPointF(0, 8 * factor))); - line_item->setPos(15 * signal * (tab_id == BaseRelationship::DST_TABLE ? -1 : 1), 0); + line_item->setPos(15 * signal * (tab_id == BaseRelationship::DstTable ? -1 : 1), 0); line_item->setPen(pens[tab_id]); } else if(!mandatory[tab_id] && - ((rel_type != BaseRelationship::RELATIONSHIP_FK) || - (tab_id == BaseRelationship::SRC_TABLE && rel_type == BaseRelationship::RELATIONSHIP_FK))) + ((rel_type != BaseRelationship::RelationshipFk) || + (tab_id == BaseRelationship::SrcTable && rel_type == BaseRelationship::RelationshipFk))) { //Configuring the circle which describes the optional cardinality circle_item = round_cf_descriptors[tab_id]; @@ -1625,16 +1625,16 @@ void RelationshipView::configureCrowsFootDescriptors(void) py = -(circle_item->boundingRect().height()/2.20); - if(tab_id == BaseRelationship::SRC_TABLE) + if(tab_id == BaseRelationship::SrcTable) { - if(base_rel->isSelfRelationship() || rel_type != BaseRelationship::RELATIONSHIP_NN) + if(base_rel->isSelfRelationship() || rel_type != BaseRelationship::RelationshipNn) px = 15; else px = 11; } else { - if(rel_type == BaseRelationship::RELATIONSHIP_11) + if(rel_type == BaseRelationship::Relationship11) { if(signal < 0) px = 15; @@ -1647,7 +1647,7 @@ void RelationshipView::configureCrowsFootDescriptors(void) pen = pens[tab_id]; - if(rel_type == BaseRelationship::RELATIONSHIP_FK) + if(rel_type == BaseRelationship::RelationshipFk) pen.setStyle(Qt::DashLine); circle_item->setPos(px, py); @@ -1820,24 +1820,24 @@ void RelationshipView::configureLabels(void) unsigned rel_type=base_rel->getRelationshipType(); QPointF label_dist; - label_dist=base_rel->getLabelDistance(BaseRelationship::REL_NAME_LABEL); + label_dist=base_rel->getLabelDistance(BaseRelationship::RelNameLabel); pnt=descriptor->pos(); x=pnt.x() - - ((labels[BaseRelationship::REL_NAME_LABEL]->boundingRect().width() - + ((labels[BaseRelationship::RelNameLabel]->boundingRect().width() - descriptor->boundingRect().width())/2.0f); if(base_rel->isSelfRelationship()) - y=pnt.y() - labels[BaseRelationship::REL_NAME_LABEL]->boundingRect().height() - (2 * VertSpacing); + y=pnt.y() - labels[BaseRelationship::RelNameLabel]->boundingRect().height() - (2 * VertSpacing); else y=pnt.y() + descriptor->boundingRect().height() + VertSpacing; - labels[BaseRelationship::REL_NAME_LABEL]->setVisible(!hide_name_label); - configureLabelPosition(BaseRelationship::REL_NAME_LABEL, x, y); + labels[BaseRelationship::RelNameLabel]->setVisible(!hide_name_label); + configureLabelPosition(BaseRelationship::RelNameLabel, x, y); if(!hide_name_label) { - Textbox *txtbox = dynamic_cast(labels[BaseRelationship::REL_NAME_LABEL]->getSourceObject()); + Textbox *txtbox = dynamic_cast(labels[BaseRelationship::RelNameLabel]->getSourceObject()); if(compact_view && !base_rel->getAlias().isEmpty()) { @@ -1852,42 +1852,42 @@ void RelationshipView::configureLabels(void) } //Hides the cardinality labels when crow's feet is enabled - if(labels[BaseRelationship::SRC_CARD_LABEL] && labels[BaseRelationship::DST_CARD_LABEL]) + if(labels[BaseRelationship::SrcCardLabel] && labels[BaseRelationship::DstCardLabel]) { - labels[BaseRelationship::SRC_CARD_LABEL]->setVisible(!use_crows_foot); - labels[BaseRelationship::DST_CARD_LABEL]->setVisible(!use_crows_foot); + labels[BaseRelationship::SrcCardLabel]->setVisible(!use_crows_foot); + labels[BaseRelationship::DstCardLabel]->setVisible(!use_crows_foot); } if(!use_crows_foot && - rel_type!=BaseRelationship::RELATIONSHIP_GEN && - rel_type!=BaseRelationship::RELATIONSHIP_DEP && - rel_type!=BaseRelationship::RELATIONSHIP_PART) + rel_type!=BaseRelationship::RelationshipGen && + rel_type!=BaseRelationship::RelationshipDep && + rel_type!=BaseRelationship::RelationshipPart) { QPointF pi, pf, p_int, pos; unsigned idx, i1; double dl, da, factor, v_space=VertSpacing * 2.5, h_space=HorizSpacing * 2.5; QLineF lins[2], borders[2][4]; QRectF tab_rect, rect; - unsigned label_ids[2]={ BaseRelationship::SRC_CARD_LABEL, - BaseRelationship::DST_CARD_LABEL }; + unsigned label_ids[2]={ BaseRelationship::SrcCardLabel, + BaseRelationship::DstCardLabel }; if(!base_rel->isSelfRelationship() && - line_conn_mode==ConnectFkToPk && rel_type!=BaseRelationship::RELATIONSHIP_NN) + line_conn_mode==ConnectFkToPk && rel_type!=BaseRelationship::RelationshipNn) { for(idx=0; idx < 2; idx++) { pos=conn_points[idx]; da=labels[idx]->boundingRect().height()/2.0f; - if((rel_type!=BaseRelationship::RELATIONSHIP_FK && pos.x() < tables[idx]->pos().x()) || - (rel_type==BaseRelationship::RELATIONSHIP_FK && pos.x() >= tables[idx]->pos().x())) + if((rel_type!=BaseRelationship::RelationshipFk && pos.x() < tables[idx]->pos().x()) || + (rel_type==BaseRelationship::RelationshipFk && pos.x() >= tables[idx]->pos().x())) { - factor=(rel_type==BaseRelationship::RELATIONSHIP_FK ? 0.80 : 0.55); + factor=(rel_type==BaseRelationship::RelationshipFk ? 0.80 : 0.55); x=pos.x() - (labels[idx]->boundingRect().width() * factor); } else { - factor=(rel_type==BaseRelationship::RELATIONSHIP_FK ? 0.05 : 0.45); + factor=(rel_type==BaseRelationship::RelationshipFk ? 0.05 : 0.45); x=pos.x() - (labels[idx]->boundingRect().width() * factor); } @@ -1983,7 +1983,7 @@ void RelationshipView::configureLabels(void) void RelationshipView::configureLabelPosition(unsigned label_id, double x, double y) { - if(label_id > BaseRelationship::REL_NAME_LABEL) + if(label_id > BaseRelationship::RelNameLabel) throw Exception(RefObjectInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(labels[label_id]) diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index c5f71d39b5..5e9bb02209 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -565,7 +565,7 @@ QString TableObjectView::getConstraintString(Column *column) itr++; //Check if the column is referecend by the constraint - if((constr->getConstraintType()!=ConstraintType::exclude && constr->isColumnExists(column, Constraint::SOURCE_COLS)) || + if((constr->getConstraintType()!=ConstraintType::exclude && constr->isColumnExists(column, Constraint::SourceCols)) || (constr->getConstraintType()==ConstraintType::exclude && constr->isColumnReferenced(column, false))) { constr_type=constr->getConstraintType(); diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 72dbe2fac9..9f06eb5378 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -65,26 +65,26 @@ SchemaParser::SchemaParser(void) { line=column=comment_count=0; ignore_unk_atribs=ignore_empty_atribs=false; - pgsql_version=PgSQLVersions::DefaulVersion; + pgsql_version=PgSqlVersions::DefaulVersion; } void SchemaParser::setPgSQLVersion(const QString &pgsql_ver) { unsigned curr_ver = QString(pgsql_ver).remove('.').toUInt(), - version90 = QString(PgSQLVersions::PgSQLVersion90).remove('.').toUInt(), - default_ver = QString(PgSQLVersions::DefaulVersion).remove('.').toUInt(); + version90 = QString(PgSqlVersions::PgSqlVersion90).remove('.').toUInt(), + default_ver = QString(PgSqlVersions::DefaulVersion).remove('.').toUInt(); if(curr_ver != 0 && (curr_ver < version90)) throw Exception(Exception::getErrorMessage(ErrorCode::InvPostgreSQLVersion) .arg(pgsql_ver) - .arg(PgSQLVersions::PgSQLVersion90) - .arg(PgSQLVersions::DefaulVersion), + .arg(PgSqlVersions::PgSqlVersion90) + .arg(PgSqlVersions::DefaulVersion), InvPostgreSQLVersion,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(curr_ver > 0 && curr_ver <= default_ver) pgsql_version=pgsql_ver; else - pgsql_version=PgSQLVersions::DefaulVersion; + pgsql_version=PgSqlVersions::DefaulVersion; } QString SchemaParser::getPgSQLVersion(void) @@ -979,14 +979,14 @@ QString SchemaParser::convertCharsToXMLEntities(QString buf) if(str_aux.contains(QRegExp("(&|\\<|\\>|\")"))) { //Replaces the char by the XML entities - if(!str_aux.contains(XMLParser::CharQuot) && !str_aux.contains(XMLParser::CharLt) && - !str_aux.contains(XMLParser::CharGt) && !str_aux.contains(XMLParser::CharAmp) && - !str_aux.contains(XMLParser::CharApos) && str_aux.contains('&')) - str_aux.replace('&', XMLParser::CharAmp); - - str_aux.replace('"',XMLParser::CharQuot); - str_aux.replace('<',XMLParser::CharLt); - str_aux.replace('>',XMLParser::CharGt); + if(!str_aux.contains(XmlParser::CharQuot) && !str_aux.contains(XmlParser::CharLt) && + !str_aux.contains(XmlParser::CharGt) && !str_aux.contains(XmlParser::CharAmp) && + !str_aux.contains(XmlParser::CharApos) && str_aux.contains('&')) + str_aux.replace('&', XmlParser::CharAmp); + + str_aux.replace('"',XmlParser::CharQuot); + str_aux.replace('<',XmlParser::CharLt); + str_aux.replace('>',XmlParser::CharGt); //Puts on the original XML definition the modified string lin.replace(attr_start, count, str_aux); diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index be5b2f02b1..511317a1a7 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -19,13 +19,13 @@ #include "xmlparser.h" #include -const QString XMLParser::CharAmp=QString("&"); -const QString XMLParser::CharLt=QString("<"); -const QString XMLParser::CharGt=QString(">"); -const QString XMLParser::CharQuot=QString("""); -const QString XMLParser::CharApos=QString("'"); +const QString XmlParser::CharAmp=QString("&"); +const QString XmlParser::CharLt=QString("<"); +const QString XmlParser::CharGt=QString(">"); +const QString XmlParser::CharQuot=QString("""); +const QString XmlParser::CharApos=QString("'"); -XMLParser::XMLParser(void) +XmlParser::XmlParser(void) { root_elem=nullptr; curr_elem=nullptr; @@ -33,13 +33,13 @@ XMLParser::XMLParser(void) xmlInitParser(); } -XMLParser::~XMLParser(void) +XmlParser::~XmlParser(void) { restartParser(); xmlCleanupParser(); } -void XMLParser::removeDTD(void) +void XmlParser::removeDTD(void) { int pos1=-1, pos2=-1, pos3=-1, len; @@ -59,7 +59,7 @@ void XMLParser::removeDTD(void) } } -void XMLParser::loadXMLFile(const QString &filename) +void XmlParser::loadXMLFile(const QString &filename) { try { @@ -92,7 +92,7 @@ void XMLParser::loadXMLFile(const QString &filename) } } -void XMLParser::loadXMLBuffer(const QString &xml_buf) +void XmlParser::loadXMLBuffer(const QString &xml_buf) { try { @@ -123,7 +123,7 @@ void XMLParser::loadXMLBuffer(const QString &xml_buf) } } -void XMLParser::setDTDFile(const QString &dtd_file, const QString &dtd_name) +void XmlParser::setDTDFile(const QString &dtd_file, const QString &dtd_name) { QString fmt_dtd_file; @@ -147,7 +147,7 @@ void XMLParser::setDTDFile(const QString &dtd_file, const QString &dtd_name) fmt_dtd_file + QString("\">\n"); } -void XMLParser::readBuffer(void) +void XmlParser::readBuffer(void) { QByteArray buffer; QString msg, file; @@ -203,7 +203,7 @@ void XMLParser::readBuffer(void) } } -void XMLParser::savePosition(void) +void XmlParser::savePosition(void) { if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -211,7 +211,7 @@ void XMLParser::savePosition(void) elems_stack.push(curr_elem); } -void XMLParser::restorePosition(void) +void XmlParser::restorePosition(void) { if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -225,7 +225,7 @@ void XMLParser::restorePosition(void) } } -void XMLParser::restorePosition(const xmlNode *elem) +void XmlParser::restorePosition(const xmlNode *elem) { if(!elem) throw Exception(ErrorCode::OprNotAllocatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -236,7 +236,7 @@ void XMLParser::restorePosition(const xmlNode *elem) curr_elem=const_cast(elem); } -void XMLParser::restartNavigation(void) +void XmlParser::restartNavigation(void) { if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -247,7 +247,7 @@ void XMLParser::restartNavigation(void) elems_stack.pop(); } -void XMLParser::restartParser(void) +void XmlParser::restartParser(void) { root_elem=curr_elem=nullptr; @@ -265,7 +265,7 @@ void XMLParser::restartParser(void) xmlResetLastError(); } -bool XMLParser::accessElement(unsigned elem_type) +bool XmlParser::accessElement(unsigned elem_type) { bool has_elem; xmlNode *elems[4]; @@ -290,7 +290,7 @@ bool XMLParser::accessElement(unsigned elem_type) return(has_elem); } -bool XMLParser::hasElement(unsigned elem_type, xmlElementType xml_node_type) +bool XmlParser::hasElement(unsigned elem_type, xmlElementType xml_node_type) { if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -315,7 +315,7 @@ bool XMLParser::hasElement(unsigned elem_type, xmlElementType xml_node_type) (xml_node_type==0 || (xml_node_type!=0 && curr_elem->prev->type==xml_node_type))); } -bool XMLParser::hasAttributes(void) +bool XmlParser::hasAttributes(void) { if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -323,7 +323,7 @@ bool XMLParser::hasAttributes(void) return(curr_elem->properties!=nullptr); } -QString XMLParser::getElementContent(void) +QString XmlParser::getElementContent(void) { if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -337,7 +337,7 @@ QString XMLParser::getElementContent(void) return(QString(reinterpret_cast(curr_elem->content))); } -QString XMLParser::getElementName(void) +QString XmlParser::getElementName(void) { if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -345,7 +345,7 @@ QString XMLParser::getElementName(void) return(QString(reinterpret_cast(curr_elem->name))); } -xmlElementType XMLParser::getElementType(void) +xmlElementType XmlParser::getElementType(void) { if(!root_elem) throw Exception(ErrorCode::OprNotAllocatedElementTree,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -353,12 +353,12 @@ xmlElementType XMLParser::getElementType(void) return(curr_elem->type); } -const xmlNode *XMLParser::getCurrentElement(void) +const xmlNode *XmlParser::getCurrentElement(void) { return(curr_elem); } -void XMLParser::getElementAttributes(attribs_map &attributes) +void XmlParser::getElementAttributes(attribs_map &attributes) { xmlAttr *elem_attribs=nullptr; QString attrib, value; @@ -388,17 +388,17 @@ void XMLParser::getElementAttributes(attribs_map &attributes) } } -QString XMLParser::getLoadedFilename(void) +QString XmlParser::getLoadedFilename(void) { return(xml_doc_filename); } -QString XMLParser::getXMLBuffer(void) +QString XmlParser::getXMLBuffer(void) { return(xml_buffer); } -int XMLParser::getCurrentBufferLine(void) +int XmlParser::getCurrentBufferLine(void) { if(curr_elem) return(curr_elem->line); @@ -406,7 +406,7 @@ int XMLParser::getCurrentBufferLine(void) return(0); } -int XMLParser::getBufferLineCount(void) +int XmlParser::getBufferLineCount(void) { if(xml_doc) /* To get the very last line of the document is necessary to call diff --git a/libparsers/src/xmlparser.h b/libparsers/src/xmlparser.h index 794f21b032..4c18d1756f 100644 --- a/libparsers/src/xmlparser.h +++ b/libparsers/src/xmlparser.h @@ -34,7 +34,7 @@ #include #include "attribsmap.h" -class XMLParser { +class XmlParser { private: /*! \brief Stores the name of the file that generated the xml buffer when loadXMLFile() method is called */ @@ -85,8 +85,8 @@ class XMLParser { CharQuot, //! \brief < = " CharApos; //! \brief < = ' - XMLParser(void); - ~XMLParser(void); + XmlParser(void); + ~XmlParser(void); //! \brief Loads the XML buffer from a file void loadXMLFile(const QString &filename); diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index d1a4a075f3..6d5197d34c 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -87,7 +87,7 @@ void Catalog::setConnection(Connection &conn) executeCatalogQuery(QueryList, ObjDatabase, res, true, {{ParsersAttributes::NAME, conn.getConnectionParam(Connection::ParamDbName)}}); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { attribs_map attribs=changeAttributeNames(res.getTupleValues()); last_sys_oid=attribs[ParsersAttributes::LAST_SYS_OID].toUInt(); @@ -95,13 +95,13 @@ void Catalog::setConnection(Connection &conn) //Retrieving the list of objects created by extensions this->connection.executeDMLCommand(GetExtensionObjsSql, res); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { do { ext_obj.push_back(res.getColumnValue(QString("oid"))); } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); ext_obj_oids=ext_obj.join(','); } @@ -269,7 +269,7 @@ unsigned Catalog::getObjectCount(ObjectType obj_type, const QString &sch_name, c extra_attribs[ParsersAttributes::TABLE]=tab_name; executeCatalogQuery(QueryList, obj_type, res, false, extra_attribs); - res.accessTuple(ResultSet::FIRST_TUPLE); + res.accessTuple(ResultSet::FirstTuple); return(res.getTupleCount()); } catch(Exception &e) @@ -337,13 +337,13 @@ attribs_map Catalog::getObjectsNames(ObjectType obj_type, const QString &sch_nam extra_attribs[ParsersAttributes::TABLE]=tab_name; executeCatalogQuery(QueryList, obj_type, res, false, extra_attribs); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { do { objects[res.getColumnValue(ParsersAttributes::OID)]=res.getColumnValue(ParsersAttributes::NAME); } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); } return(objects); @@ -394,7 +394,7 @@ vector Catalog::getObjectsNames(vector obj_types, const connection.executeDMLCommand(sql, res); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { do { @@ -404,7 +404,7 @@ vector Catalog::getObjectsNames(vector obj_types, const objects.push_back(attribs); attribs.clear(); } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); } return(objects); @@ -426,7 +426,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, extra_attribs[ParsersAttributes::NAME]=obj_name; executeCatalogQuery(QueryAttribs, obj_type, res, true, extra_attribs); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) obj_attribs=changeAttributeNames(res.getTupleValues()); /* Insert the object type as an attribute of the query result to facilitate the @@ -450,7 +450,7 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ vector obj_attribs; executeCatalogQuery(QueryAttribs, obj_type, res, false, extra_attribs); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { do { @@ -463,7 +463,7 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ obj_attribs.push_back(tuple); tuple.clear(); } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); } return(obj_attribs); @@ -489,7 +489,7 @@ vector Catalog::getMultipleAttributes(const QString &catalog_sch, a attribs[ParsersAttributes::PGSQL_VERSION]=schparser.getPgSQLVersion(); connection.executeDMLCommand(schparser.getCodeDefinition(attribs).simplified(), res); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { do { @@ -497,7 +497,7 @@ vector Catalog::getMultipleAttributes(const QString &catalog_sch, a obj_attribs.push_back(tuple); tuple.clear(); } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); } return(obj_attribs); @@ -646,7 +646,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS return("0"); else { - res.accessTuple(ResultSet::FIRST_TUPLE); + res.accessTuple(ResultSet::FirstTuple); return(res.getColumnValue(ParsersAttributes::OID)); } } @@ -673,7 +673,7 @@ attribs_map Catalog::getServerAttributes(void) sql = schparser.getCodeDefinition(attribs).simplified(); connection.executeDMLCommand(sql, res); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { do { @@ -682,7 +682,7 @@ attribs_map Catalog::getServerAttributes(void) attr_name.replace('_','-'); attribs[attr_name]=tuple[ParsersAttributes::VALUE]; } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); attribs[ParsersAttributes::CONNECTION] = connection.getConnectionId(); attribs_aux = connection.getServerInfo(); diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index 6393936baf..0083357a58 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -278,7 +278,7 @@ bool ResultSet::accessTuple(unsigned tuple_type) is derived from a command which affects only rows or The tuple type to be accessed is invalid, out of set defined by the class */ - if(empty_result || tuple_type > NEXT_TUPLE) + if(empty_result || tuple_type > NextTuple) throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); if(tuple_count==0) @@ -289,20 +289,20 @@ bool ResultSet::accessTuple(unsigned tuple_type) switch(tuple_type) { - case FIRST_TUPLE: + case FirstTuple: current_tuple=0; break; - case LAST_TUPLE: + case LastTuple: current_tuple=tuple_count-1; break; - case PREVIOUS_TUPLE: + case PreviousTuple: accessed=(current_tuple > 0); if(accessed) current_tuple--; break; - case NEXT_TUPLE: + case NextTuple: accessed=(current_tuple < (tuple_count-1)); if(accessed) current_tuple++; break; diff --git a/libpgconnector/src/resultset.h b/libpgconnector/src/resultset.h index 746ce2d2a4..63ed0c387c 100644 --- a/libpgconnector/src/resultset.h +++ b/libpgconnector/src/resultset.h @@ -67,10 +67,10 @@ class ResultSet { public: //! \brief Constants used to navigate through the resultset - static constexpr unsigned FIRST_TUPLE=0, - LAST_TUPLE=1, - PREVIOUS_TUPLE=2, - NEXT_TUPLE=3; + static constexpr unsigned FirstTuple=0, + LastTuple=1, + PreviousTuple=2, + NextTuple=3; ResultSet(void); ~ResultSet(void); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index ed580c2bc7..982289afe6 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -35,7 +35,7 @@ Aggregate::Aggregate(void) void Aggregate::setFunction(unsigned func_idx, Function *func) { //Case the function index is invalid raises an error - if(func_idx!=FINAL_FUNC && func_idx!=TRANSITION_FUNC) + if(func_idx!=FinalFunc && func_idx!=TransitionFunc) throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Checks if the function is valid, if not the case raises an error @@ -53,7 +53,7 @@ bool Aggregate::isValidFunction(unsigned func_idx, Function *func) { if(func) { - if(func_idx==FINAL_FUNC) + if(func_idx==FinalFunc) { /* According to docs the final function to be valid must have 1 parameter which type is the same as the state_type attribute. BUT when importing system aggregates some functions has @@ -189,7 +189,7 @@ unsigned Aggregate::getDataTypeCount(void) Function *Aggregate::getFunction(unsigned func_idx) { //Raises an exception if the function index is invalid - if(func_idx!=FINAL_FUNC && func_idx!=TRANSITION_FUNC) + if(func_idx!=FinalFunc && func_idx!=TransitionFunc) throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_idx]); @@ -226,27 +226,27 @@ QString Aggregate::getCodeDefinition(unsigned def_type) setTypesAttribute(def_type); - if(functions[TRANSITION_FUNC]) + if(functions[TransitionFunc]) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::TRANSITION_FUNC]=functions[TRANSITION_FUNC]->getSignature(); + attributes[ParsersAttributes::TRANSITION_FUNC]=functions[TransitionFunc]->getSignature(); else { - functions[TRANSITION_FUNC]->setAttribute(ParsersAttributes::REF_TYPE, + functions[TransitionFunc]->setAttribute(ParsersAttributes::REF_TYPE, ParsersAttributes::TRANSITION_FUNC); - attributes[ParsersAttributes::TRANSITION_FUNC]=functions[TRANSITION_FUNC]->getCodeDefinition(def_type,true); + attributes[ParsersAttributes::TRANSITION_FUNC]=functions[TransitionFunc]->getCodeDefinition(def_type,true); } } - if(functions[FINAL_FUNC]) + if(functions[FinalFunc]) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::FINAL_FUNC]=functions[FINAL_FUNC]->getSignature(); + attributes[ParsersAttributes::FINAL_FUNC]=functions[FinalFunc]->getSignature(); else { - functions[FINAL_FUNC]->setAttribute(ParsersAttributes::REF_TYPE, + functions[FinalFunc]->setAttribute(ParsersAttributes::REF_TYPE, ParsersAttributes::FINAL_FUNC); - attributes[ParsersAttributes::FINAL_FUNC]=functions[FINAL_FUNC]->getCodeDefinition(def_type,true); + attributes[ParsersAttributes::FINAL_FUNC]=functions[FinalFunc]->getCodeDefinition(def_type,true); } } diff --git a/libpgmodeler/src/aggregate.h b/libpgmodeler/src/aggregate.h index fa28b5a72f..2f609c1ed1 100644 --- a/libpgmodeler/src/aggregate.h +++ b/libpgmodeler/src/aggregate.h @@ -65,8 +65,8 @@ class Aggregate: public BaseObject { public: //! \brief Constants used to reference the functions used by the aggregate - static constexpr unsigned FINAL_FUNC=0, - TRANSITION_FUNC=1; + static constexpr unsigned FinalFunc=0, + TransitionFunc=1; Aggregate(void); diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index cfb2766425..41f8d11db6 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -68,7 +68,7 @@ const QString BaseObject::objs_sql[BaseObject::ObjectTypeCount]={ DatabaseModel, Tag */ unsigned BaseObject::global_id=4000; -QString BaseObject::pgsql_ver=PgSQLVersions::DefaulVersion; +QString BaseObject::pgsql_ver=PgSqlVersions::DefaulVersion; bool BaseObject::use_cached_code=true; BaseObject::BaseObject(void) @@ -215,7 +215,7 @@ QString BaseObject::formatName(const QString &name, bool is_operator) } - if(needs_fmt || PgModelerNS::isReservedKeyword(name)) + if(needs_fmt || PgModelerNs::isReservedKeyword(name)) frmt_name=QString("\"%1\"").arg(name); else frmt_name=name; diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index ded6fd2a01..db19f618fd 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -119,7 +119,7 @@ void BaseRelationship::configureRelationship(void) attributes[ParsersAttributes::ORIGINAL_PK]=QString(); //Check if the relationship type is valid - if(rel_type <= RELATIONSHIP_FK) + if(rel_type <= RelationshipFk) { //Raises an error if one of the tables is not allocated if(!src_table || !dst_table) @@ -130,26 +130,26 @@ void BaseRelationship::configureRelationship(void) /* Raises an error if the relationship type is generalization or dependency and the source and destination table are the same. */ - if((rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_DEP || rel_type==RELATIONSHIP_PART) && src_table==dst_table) + if((rel_type==RelationshipGen || rel_type==RelationshipDep || rel_type==RelationshipPart) && src_table==dst_table) throw Exception(InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Allocates the textbox for the name label - lables[REL_NAME_LABEL]=new Textbox; - lables[REL_NAME_LABEL]->setTextAttribute(Textbox::ITALIC_TXT, true); + lables[RelNameLabel]=new Textbox; + lables[RelNameLabel]->setTextAttribute(Textbox::ITALIC_TXT, true); //Allocates the cardinality labels only when the relationship is not generalization or dependency (copy) - if(rel_type!=RELATIONSHIP_GEN && - rel_type!=RELATIONSHIP_DEP && - rel_type!=RELATIONSHIP_PART) + if(rel_type!=RelationshipGen && + rel_type!=RelationshipDep && + rel_type!=RelationshipPart) { - lables[SRC_CARD_LABEL]=new Textbox; - lables[DST_CARD_LABEL]=new Textbox; - lables[SRC_CARD_LABEL]->setTextAttribute(Textbox::ITALIC_TXT, true); - lables[DST_CARD_LABEL]->setTextAttribute(Textbox::ITALIC_TXT, true); + lables[SrcCardLabel]=new Textbox; + lables[DstCardLabel]=new Textbox; + lables[SrcCardLabel]->setTextAttribute(Textbox::ITALIC_TXT, true); + lables[DstCardLabel]->setTextAttribute(Textbox::ITALIC_TXT, true); //Configures the mandatory participation for both tables - setMandatoryTable(SRC_TABLE,src_mandatory); - setMandatoryTable(DST_TABLE,dst_mandatory); + setMandatoryTable(SrcTable,src_mandatory); + setMandatoryTable(DstTable,dst_mandatory); } } else @@ -172,8 +172,8 @@ void BaseRelationship::setName(const QString &name) { BaseObject::setName(name); - if(lables[REL_NAME_LABEL]) - lables[REL_NAME_LABEL]->setComment(name); + if(lables[RelNameLabel]) + lables[RelNameLabel]->setComment(name); } catch(Exception &e) { @@ -190,21 +190,21 @@ void BaseRelationship::setMandatoryTable(unsigned table_id, bool value) One to One where both tables are mandatory partitipation (1,1)-<>-(1,1). This type of relationship is not implemented because it requires the table fusion. */ - if(rel_type==RELATIONSHIP_11 && - ((table_id==SRC_TABLE && value && dst_mandatory) || - (table_id==DST_TABLE && value && src_mandatory))) + if(rel_type==Relationship11 && + ((table_id==SrcTable && value && dst_mandatory) || + (table_id==DstTable && value && src_mandatory))) throw Exception(NotImplementedRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Case the source table is mandatory - if(table_id==SRC_TABLE) + if(table_id==SrcTable) { src_mandatory=value; //Indicates that the source cardinality label will be configured - label_id=SRC_CARD_LABEL; + label_id=SrcCardLabel; } else { - if(rel_type!=RELATIONSHIP_1N) + if(rel_type!=Relationship1n) dst_mandatory=value; else /* For One to many (1-n) relationship the entity on the "many" side @@ -212,7 +212,7 @@ void BaseRelationship::setMandatoryTable(unsigned table_id, bool value) dst_mandatory=false; //Indicates that the destination cardinality label will be configured - label_id=DST_CARD_LABEL; + label_id=DstCardLabel; } if(!value) cmin=QString("0"); @@ -220,24 +220,24 @@ void BaseRelationship::setMandatoryTable(unsigned table_id, bool value) if(lables[label_id]) { - if(rel_type==RELATIONSHIP_11) + if(rel_type==Relationship11) lables[label_id]->setComment(cmin + QString(":1")); - else if(rel_type==RELATIONSHIP_1N) + else if(rel_type==Relationship1n) { - aux=(table_id==SRC_TABLE ? QString("1") : QString("n")); + aux=(table_id==SrcTable ? QString("1") : QString("n")); lables[label_id]->setComment(cmin + QString(":") + aux); } - else if(rel_type==RELATIONSHIP_FK) + else if(rel_type==RelationshipFk) { - if((table_id==SRC_TABLE && dynamic_cast
(src_table)->isReferTableOnForeignKey(dynamic_cast
(dst_table))) || - (!isSelfRelationship() && table_id==DST_TABLE && dynamic_cast
(dst_table)->isReferTableOnForeignKey(dynamic_cast
(src_table)))) + if((table_id==SrcTable && dynamic_cast
(src_table)->isReferTableOnForeignKey(dynamic_cast
(dst_table))) || + (!isSelfRelationship() && table_id==DstTable && dynamic_cast
(dst_table)->isReferTableOnForeignKey(dynamic_cast
(src_table)))) aux=QString("n"); else aux=QString("1"); lables[label_id]->setComment(aux); } - else if(rel_type==RELATIONSHIP_NN) + else if(rel_type==RelationshipNn) lables[label_id]->setComment(QString("n")); lables[label_id]->setModified(true); @@ -246,9 +246,9 @@ void BaseRelationship::setMandatoryTable(unsigned table_id, bool value) BaseTable *BaseRelationship::getTable(unsigned table_id) { - if(table_id==SRC_TABLE) + if(table_id==SrcTable) return(src_table); - else if(table_id==DST_TABLE) + else if(table_id==DstTable) return(dst_table); else return(nullptr); @@ -256,7 +256,7 @@ BaseTable *BaseRelationship::getTable(unsigned table_id) bool BaseRelationship::isTableMandatory(unsigned table_id) { - if(table_id==SRC_TABLE) + if(table_id==SrcTable) return(src_mandatory); else return(dst_mandatory); @@ -302,7 +302,7 @@ void BaseRelationship::connectRelationship(void) Textbox *BaseRelationship::getLabel(unsigned label_id) { - if(label_id<=REL_NAME_LABEL) + if(label_id<=RelNameLabel) return(lables[label_id]); else //Raises an error when the label id is invalid @@ -407,7 +407,7 @@ QString BaseRelationship::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { - if(rel_type!=RELATIONSHIP_FK) + if(rel_type!=RelationshipFk) return(QString()); else { @@ -437,7 +437,7 @@ void BaseRelationship::setPoints(const vector &points) void BaseRelationship::setLabelDistance(unsigned label_id, QPointF label_dist) { - if(label_id > REL_NAME_LABEL) + if(label_id > RelNameLabel) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->lables_dist[label_id]=label_dist; @@ -446,7 +446,7 @@ void BaseRelationship::setLabelDistance(unsigned label_id, QPointF label_dist) QPointF BaseRelationship::getLabelDistance(unsigned label_id) { - if(label_id > REL_NAME_LABEL) + if(label_id > RelNameLabel) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->lables_dist[label_id]); @@ -494,23 +494,23 @@ void BaseRelationship::operator = (BaseRelationship &rel) this->lables_dist[i]=rel.lables_dist[i]; } - this->setMandatoryTable(SRC_TABLE, false); - this->setMandatoryTable(DST_TABLE, false); + this->setMandatoryTable(SrcTable, false); + this->setMandatoryTable(DstTable, false); - this->setMandatoryTable(SRC_TABLE, rel.src_mandatory); - this->setMandatoryTable(DST_TABLE, rel.dst_mandatory); + this->setMandatoryTable(SrcTable, rel.src_mandatory); + this->setMandatoryTable(DstTable, rel.dst_mandatory); } QString BaseRelationship::getRelTypeAttribute(void) { switch(rel_type) { - case RELATIONSHIP_11: return(ParsersAttributes::RELATIONSHIP_11); break; - case RELATIONSHIP_1N: return(ParsersAttributes::RELATIONSHIP_1N); break; - case RELATIONSHIP_NN: return(ParsersAttributes::RELATIONSHIP_NN); break; - case RELATIONSHIP_GEN: return(ParsersAttributes::RELATIONSHIP_GEN); break; - case RELATIONSHIP_PART: return(ParsersAttributes::RELATIONSHIP_PART); break; - case RELATIONSHIP_FK: return(ParsersAttributes::RELATIONSHIP_FK); break; + case Relationship11: return(ParsersAttributes::RELATIONSHIP_11); break; + case Relationship1n: return(ParsersAttributes::RELATIONSHIP_1N); break; + case RelationshipNn: return(ParsersAttributes::RELATIONSHIP_NN); break; + case RelationshipGen: return(ParsersAttributes::RELATIONSHIP_GEN); break; + case RelationshipPart: return(ParsersAttributes::RELATIONSHIP_PART); break; + case RelationshipFk: return(ParsersAttributes::RELATIONSHIP_FK); break; default: if(src_table->getObjectType()==ObjView) return(ParsersAttributes::RELATION_TAB_VIEW); @@ -524,12 +524,12 @@ QString BaseRelationship::getRelationshipTypeName(unsigned rel_type, bool is_vie { switch(rel_type) { - case RELATIONSHIP_11: return(trUtf8("One-to-one")); break; - case RELATIONSHIP_1N: return(trUtf8("One-to-many")); break; - case RELATIONSHIP_NN: return(trUtf8("Many-to-many")); break; - case RELATIONSHIP_GEN: return(trUtf8("Inheritance")); break; - case RELATIONSHIP_PART: return(trUtf8("Partitioning")); break; - case RELATIONSHIP_FK: return(trUtf8("FK relationship")); break; + case Relationship11: return(trUtf8("One-to-one")); break; + case Relationship1n: return(trUtf8("One-to-many")); break; + case RelationshipNn: return(trUtf8("Many-to-many")); break; + case RelationshipGen: return(trUtf8("Inheritance")); break; + case RelationshipPart: return(trUtf8("Partitioning")); break; + case RelationshipFk: return(trUtf8("FK relationship")); break; default: if(is_view) return(trUtf8("Dependency")); diff --git a/libpgmodeler/src/baserelationship.h b/libpgmodeler/src/baserelationship.h index 0b1053a2d3..1857743ed8 100644 --- a/libpgmodeler/src/baserelationship.h +++ b/libpgmodeler/src/baserelationship.h @@ -94,22 +94,22 @@ class BaseRelationship: public BaseGraphicObject { public: //! \brief Constants used to assign the type to relationship - static constexpr unsigned RELATIONSHIP_11=10, //! \brief One to one - RELATIONSHIP_1N=11, //! \brief One to many - RELATIONSHIP_NN=12, //! \brief Many to many - RELATIONSHIP_GEN=13, //! \brief Generalization (Inheritance) - RELATIONSHIP_DEP=14, //! \brief Dependency (table-view) / Copy (table-table) - RELATIONSHIP_PART=15,//! \brief Partitioning relationship - RELATIONSHIP_FK=16; //! \brief Relationship generated by creating a foreign key manually on a table + static constexpr unsigned Relationship11=10, //! \brief One to one + Relationship1n=11, //! \brief One to many + RelationshipNn=12, //! \brief Many to many + RelationshipGen=13, //! \brief Generalization (Inheritance) + RelationshipDep=14, //! \brief Dependency (table-view) / Copy (table-table) + RelationshipPart=15,//! \brief Partitioning relationship + RelationshipFk=16; //! \brief Relationship generated by creating a foreign key manually on a table //! \brief Constats used to reference the relationship labels - static constexpr unsigned SRC_CARD_LABEL=0, - DST_CARD_LABEL=1, - REL_NAME_LABEL=2; + static constexpr unsigned SrcCardLabel=0, + DstCardLabel=1, + RelNameLabel=2; //! \brief Constants used to reference the source and destination tables - static constexpr unsigned SRC_TABLE=0, - DST_TABLE=1; + static constexpr unsigned SrcTable=0, + DstTable=1; BaseRelationship(BaseRelationship *rel); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 00341adb7a..18a8001cab 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -22,7 +22,7 @@ Cast::Cast(void) { obj_type=ObjCast; cast_function=nullptr; - cast_type=EXPLICIT; + cast_type=Explicit; is_in_out=false; attributes[ParsersAttributes::SOURCE_TYPE]=QString(); attributes[ParsersAttributes::DEST_TYPE]=QString(); @@ -34,7 +34,7 @@ Cast::Cast(void) void Cast::setDataType(unsigned type_idx, PgSQLType type) { //Check if the type index is valid - if(type_idx<=DST_TYPE) + if(type_idx<=DstType) { //Raises an error if the passed data type is null if((*type).isEmpty()) @@ -51,13 +51,13 @@ void Cast::setDataType(unsigned type_idx, PgSQLType type) throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the cast name (in form of signature: cast(src_type, dst_type) ) - this->obj_name=QString("cast(%1,%2)").arg(~types[SRC_TYPE]).arg(~types[DST_TYPE]); + this->obj_name=QString("cast(%1,%2)").arg(~types[SrcType]).arg(~types[DstType]); } void Cast::setCastType(unsigned cast_type) { //Raises an error if the user tries to assign an invalid cast type - if(cast_type > IMPLICIT) + if(cast_type > Implicit) throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->cast_type != cast_type); @@ -95,8 +95,8 @@ void Cast::setCastFunction(Function *cast_func) { /* Error condition 1: Check if the first function parameter data type differs from cast source data type */ - error=(cast_func->getParameter(0).getType()!=this->types[SRC_TYPE] && - !cast_func->getParameter(0).getType().canCastTo(this->types[SRC_TYPE])); + error=(cast_func->getParameter(0).getType()!=this->types[SrcType] && + !cast_func->getParameter(0).getType().canCastTo(this->types[SrcType])); /* Error condition 2: Check if the second function parameter data type is different from 'integer' */ @@ -120,7 +120,7 @@ void Cast::setCastFunction(Function *cast_func) If the types can be casted between them no error is returned */ ret_type=cast_func->getReturnType(); - if(ret_type!=this->types[DST_TYPE] && !ret_type.canCastTo(this->types[DST_TYPE])) + if(ret_type!=this->types[DstType] && !ret_type.canCastTo(this->types[DstType])) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjCast)), @@ -132,7 +132,7 @@ void Cast::setCastFunction(Function *cast_func) PgSQLType Cast::getDataType(unsigned type_idx) { - if(type_idx > DST_TYPE) + if(type_idx > DstType) throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->types[type_idx]); @@ -166,13 +166,13 @@ QString Cast::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { - attributes[ParsersAttributes::SOURCE_TYPE]=(*types[SRC_TYPE]); - attributes[ParsersAttributes::DEST_TYPE]=(*types[DST_TYPE]); + attributes[ParsersAttributes::SOURCE_TYPE]=(*types[SrcType]); + attributes[ParsersAttributes::DEST_TYPE]=(*types[DstType]); } else { - attributes[ParsersAttributes::SOURCE_TYPE]=types[SRC_TYPE].getCodeDefinition(def_type); - attributes[ParsersAttributes::DEST_TYPE]=types[DST_TYPE].getCodeDefinition(def_type); + attributes[ParsersAttributes::SOURCE_TYPE]=types[SrcType].getCodeDefinition(def_type); + attributes[ParsersAttributes::DEST_TYPE]=types[DstType].getCodeDefinition(def_type); } if(!is_in_out && cast_function) @@ -185,9 +185,9 @@ QString Cast::getCodeDefinition(unsigned def_type) else attributes[ParsersAttributes::IO_CAST]=(is_in_out ? ParsersAttributes::_TRUE_ : QString()); - if(cast_type==ASSIGNMENT) + if(cast_type==Assignment) attributes[ParsersAttributes::CAST_TYPE]=ParsersAttributes::ASSIGNMENT; - else if(cast_type==IMPLICIT) + else if(cast_type==Implicit) attributes[ParsersAttributes::CAST_TYPE]=ParsersAttributes::IMPLICIT; else attributes[ParsersAttributes::CAST_TYPE]=QString(); diff --git a/libpgmodeler/src/cast.h b/libpgmodeler/src/cast.h index 052da97e24..dfad8127d3 100644 --- a/libpgmodeler/src/cast.h +++ b/libpgmodeler/src/cast.h @@ -49,12 +49,14 @@ class Cast: public BaseObject { public: //! \brief Constants used to access the data types envolved in the cast - static constexpr unsigned SRC_TYPE=0, - DST_TYPE=1, + static constexpr unsigned SrcType=0, + DstType=1, + //! \brief Constants used to define the cast type - EXPLICIT=0, - ASSIGNMENT=1, - IMPLICIT=2; + Explicit=0, + Assignment=1, + Implicit=2; + Cast(void); /*! \brief Defines one of the data types envolved on the cast diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index f8a2c37068..438302e677 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -31,8 +31,8 @@ Collation::Collation(void) void Collation::setLocale(const QString &locale) { - setLocalization(_LC_CTYPE, locale); - setLocalization(_LC_COLLATE, locale); + setLocalization(LcCtype, locale); + setLocalization(LcCollate, locale); this->locale=locale; } @@ -40,7 +40,7 @@ void Collation::setLocalization(unsigned lc_id, QString lc_name) { if(locale.isEmpty()) { - if(lc_id > _LC_COLLATE) + if(lc_id > LcCollate) throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Removes encoding specification from localization e.g 'aa_BB.ENC' will @@ -79,7 +79,7 @@ QString Collation::getLocale(void) QString Collation::getLocalization(unsigned lc_id) { - if(lc_id > _LC_COLLATE) + if(lc_id > LcCollate) throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(localization[lc_id]); @@ -113,10 +113,10 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) { QString lc_attribs[2]={ ParsersAttributes::_LC_CTYPE_, ParsersAttributes::_LC_COLLATE_ }; - if(localization[_LC_CTYPE].isEmpty() && localization[_LC_COLLATE].isEmpty()) + if(localization[LcCtype].isEmpty() && localization[LcCollate].isEmpty()) throw Exception(EmptyLCCollationAttributes,__PRETTY_FUNCTION__,__FILE__,__LINE__); - for(unsigned int i=_LC_CTYPE; i <= _LC_COLLATE; i++) + for(unsigned int i=LcCtype; i <= LcCollate; i++) { attributes[lc_attribs[i]]=getLocalization(i); diff --git a/libpgmodeler/src/collation.h b/libpgmodeler/src/collation.h index 6ce3ae7055..8cd7d2a363 100644 --- a/libpgmodeler/src/collation.h +++ b/libpgmodeler/src/collation.h @@ -48,8 +48,8 @@ class Collation : public BaseObject { locale; public: - static constexpr unsigned _LC_CTYPE=0, - _LC_COLLATE=1; + static constexpr unsigned LcCtype=0, + LcCollate=1; Collation(void); diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 2598bb8676..fae71c2a86 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -63,7 +63,7 @@ void Constraint::setConstraintType(ConstraintType constr_type) void Constraint::setActionType(ActionType action_type, unsigned act_id) { - if(act_id==DELETE_ACTION) + if(act_id==DeleteAction) { setCodeInvalidated(this->del_action != action_type); this->del_action=action_type; @@ -91,7 +91,7 @@ bool Constraint::isColumnExists(Column *column, unsigned col_type) throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Gets the iterators from the specified internal list - if(col_type==SOURCE_COLS) + if(col_type==SourceCols) { itr=columns.begin(); itr_end=columns.end(); @@ -122,10 +122,10 @@ bool Constraint::isColumnReferenced(Column *column, bool search_only_ref_cols) constr_type == ConstraintType::foreign_key) { if(!search_only_ref_cols) - found=isColumnExists(column, SOURCE_COLS); + found=isColumnExists(column, SourceCols); if(!found && constr_type==ConstraintType::foreign_key) - found=isColumnExists(column, REFERENCED_COLS); + found=isColumnExists(column, ReferencedCols); } else if(constr_type==ConstraintType::exclude) { @@ -156,7 +156,7 @@ void Constraint::addColumn(Column *column, unsigned col_type) //Adds the column only if the column doesn't exists on the internal list if(!isColumnExists(column,col_type)) { - if(col_type==REFERENCED_COLS) + if(col_type==ReferencedCols) ref_columns.push_back(column); else { @@ -194,7 +194,7 @@ void Constraint::setColumnsAttribute(unsigned col_type, unsigned def_type, bool unsigned i, count; bool format=(def_type==SchemaParser::SqlDefinition); - if(col_type==REFERENCED_COLS) + if(col_type==ReferencedCols) { col_vector=&ref_columns; attrib=ParsersAttributes::DST_COLUMNS; @@ -273,7 +273,7 @@ ConstraintType Constraint::getConstraintType(void) ActionType Constraint::getActionType(unsigned act_id) { - if(act_id==DELETE_ACTION) + if(act_id==DeleteAction) return(del_action); else return(upd_action); @@ -281,7 +281,7 @@ ActionType Constraint::getActionType(unsigned act_id) vector Constraint::getColumns(unsigned col_type) { - return(col_type==SOURCE_COLS ? columns : ref_columns); + return(col_type==SourceCols ? columns : ref_columns); } QString Constraint::getExpression(void) @@ -293,7 +293,7 @@ Column *Constraint::getColumn(unsigned col_idx, unsigned col_type) { vector *col_list=nullptr; - col_list=(col_type==SOURCE_COLS ? &columns : &ref_columns); + col_list=(col_type==SourceCols ? &columns : &ref_columns); //Raises an error if the column index is invalid (out of bound) if(col_idx>=col_list->size()) @@ -308,7 +308,7 @@ Column *Constraint::getColumn(const QString &name, unsigned col_type) vector *col_list=nullptr; vector::iterator itr_col, itr_end_col; - col_list=(col_type==SOURCE_COLS? &columns : &ref_columns); + col_list=(col_type==SourceCols? &columns : &ref_columns); itr_col=col_list->begin(); itr_end_col=col_list->end(); @@ -331,7 +331,7 @@ BaseTable *Constraint::getReferencedTable(void) unsigned Constraint::getColumnCount(unsigned col_type) { - if(col_type==REFERENCED_COLS) + if(col_type==ReferencedCols) return(ref_columns.size()); else return(columns.size()); @@ -352,7 +352,7 @@ void Constraint::removeColumn(const QString &name, unsigned col_type) Column *col=nullptr; //Gets the column list using the specified internal list type - if(col_type==REFERENCED_COLS) + if(col_type==ReferencedCols) cols=&ref_columns; else cols=&columns; @@ -696,7 +696,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) if(constr_type!=ConstraintType::check) { if(constr_type!=ConstraintType::exclude) - setColumnsAttribute(SOURCE_COLS, def_type, inc_addedbyrel); + setColumnsAttribute(SourceCols, def_type, inc_addedbyrel); else setExcludeElementsAttribute(def_type); @@ -706,7 +706,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) the attribute forcing the schema parser to return an error because the foreign key is misconfigured. */ if(constr_type==ConstraintType::foreign_key && columns.size() == ref_columns.size()) - setColumnsAttribute(REFERENCED_COLS, def_type, inc_addedbyrel); + setColumnsAttribute(ReferencedCols, def_type, inc_addedbyrel); } attributes[ParsersAttributes::REF_TABLE]=(ref_table ? ref_table->getName(true) : QString()); diff --git a/libpgmodeler/src/constraint.h b/libpgmodeler/src/constraint.h index ef3b5131aa..88e2533d6c 100644 --- a/libpgmodeler/src/constraint.h +++ b/libpgmodeler/src/constraint.h @@ -86,14 +86,14 @@ class Constraint: public TableObject{ public: /*! \brief Access the source columns that means the columns that constrais is applied (from the constraint's parent table) */ - static constexpr unsigned SOURCE_COLS=0, + static constexpr unsigned SourceCols=0, /*! \brief Access the referenced columns that means the columns from the referenced table primary key (only for foreign keys) */ - REFERENCED_COLS=1; + ReferencedCols=1; - static constexpr unsigned DELETE_ACTION=0, - UPDATE_ACTION=1; + static constexpr unsigned DeleteAction=0, + UpdateAction=1; Constraint(void); ~Constraint(void); diff --git a/libpgmodeler/src/copyoptions.cpp b/libpgmodeler/src/copyoptions.cpp index 846615a880..569a1c691a 100644 --- a/libpgmodeler/src/copyoptions.cpp +++ b/libpgmodeler/src/copyoptions.cpp @@ -84,8 +84,8 @@ QString CopyOptions::getSQLDefinition(void) case INDEXES: op_name=QString(" INDEXES"); break; case STORAGE: op_name=QString(" STORAGE"); break; case COMMENTS: op_name=QString(" COMMENTS"); break; - case IDENTITY: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSQLVersions::PgSQLVersion96.toFloat() ? QString(" IDENTITY") : QString()); break; - case STATISTICS: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSQLVersions::PgSQLVersion96.toFloat() ? QString(" STATISTICS") : QString()); break; + case IDENTITY: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSqlVersions::PgSqlVersion96.toFloat() ? QString(" IDENTITY") : QString()); break; + case STATISTICS: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSqlVersions::PgSqlVersion96.toFloat() ? QString(" STATISTICS") : QString()); break; } if(!op_name.isEmpty()) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 9443dd636e..fe4ef71235 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -75,7 +75,7 @@ void DatabaseModel::setEncoding(EncodingType encod) void DatabaseModel::setLocalization(unsigned localiz_id, const QString &value) { - if(localiz_id > Collation::_LC_COLLATE) + if(localiz_id > Collation::LcCollate) throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); localizations[localiz_id]=value; @@ -551,8 +551,8 @@ vector DatabaseModel::getObjects(ObjectType obj_type, BaseObject * rel=dynamic_cast(*itr); if((!rel && (*itr)->getSchema()==schema) || - (rel && (rel->getTable(BaseRelationship::SRC_TABLE)->getSchema()==schema || - rel->getTable(BaseRelationship::DST_TABLE)->getSchema()==schema))) + (rel && (rel->getTable(BaseRelationship::SrcTable)->getSchema()==schema || + rel->getTable(BaseRelationship::DstTable)->getSchema()==schema))) sel_list.push_back(*itr); itr++; @@ -679,7 +679,7 @@ unsigned DatabaseModel::getObjectCount(void) QString DatabaseModel::getLocalization(unsigned localiz_id) { - if(localiz_id > Collation::_LC_COLLATE) + if(localiz_id > Collation::LcCollate) throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(localizations[localiz_id]); @@ -1138,15 +1138,15 @@ void DatabaseModel::updateTableFKRelationships(Table *table) { rel=dynamic_cast(*itr1); - if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK && - (rel->getTable(BaseRelationship::SRC_TABLE)==table || - rel->getTable(BaseRelationship::DST_TABLE)==table)) + if(rel->getRelationshipType()==BaseRelationship::RelationshipFk && + (rel->getTable(BaseRelationship::SrcTable)==table || + rel->getTable(BaseRelationship::DstTable)==table)) { Constraint *fk = rel->getReferenceForeignKey(); - if(rel->getTable(BaseRelationship::SRC_TABLE)==table) - ref_tab=dynamic_cast
(rel->getTable(BaseRelationship::DST_TABLE)); + if(rel->getTable(BaseRelationship::SrcTable)==table) + ref_tab=dynamic_cast
(rel->getTable(BaseRelationship::DstTable)); else - ref_tab=dynamic_cast
(rel->getTable(BaseRelationship::SRC_TABLE)); + ref_tab=dynamic_cast
(rel->getTable(BaseRelationship::SrcTable)); //Removes the relationship if the table does'nt references the 'ref_tab' if(fk->getReferencedTable() == ref_tab && table->getObjectIndex(fk) < 0) @@ -1179,7 +1179,7 @@ void DatabaseModel::updateTableFKRelationships(Table *table) if(!rel && ref_tab->getDatabase()==this) { - rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_FK, table, ref_tab, false, false); + rel=new BaseRelationship(BaseRelationship::RelationshipFk, table, ref_tab, false, false); rel->setReferenceForeignKey(fk); rel->setCustomColor(Qt::transparent); @@ -1187,7 +1187,7 @@ void DatabaseModel::updateTableFKRelationships(Table *table) name so it`s necessary to check if a relationship with the same name already exists. If exists changes the name of the new one */ if(getObjectIndex(rel->getName(), ObjBaseRelationship) >= 0) - rel->setName(PgModelerNS::generateUniqueName(rel, base_relationships)); + rel->setName(PgModelerNs::generateUniqueName(rel, base_relationships)); addRelationship(rel); } @@ -1227,8 +1227,8 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) { rel=dynamic_cast(*itr); - if(rel->getTable(BaseRelationship::SRC_TABLE)==view || - rel->getTable(BaseRelationship::DST_TABLE)==view) + if(rel->getTable(BaseRelationship::SrcTable)==view || + rel->getTable(BaseRelationship::DstTable)==view) { removeRelationship(rel); itr=base_relationships.begin() + idx; @@ -1252,13 +1252,13 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) { rel=dynamic_cast(*itr); - if(rel->getTable(BaseRelationship::SRC_TABLE)==view || - rel->getTable(BaseRelationship::DST_TABLE)==view) + if(rel->getTable(BaseRelationship::SrcTable)==view || + rel->getTable(BaseRelationship::DstTable)==view) { - if(rel->getTable(BaseRelationship::SRC_TABLE)->getObjectType()==ObjTable) - tab=dynamic_cast
(rel->getTable(BaseRelationship::SRC_TABLE)); + if(rel->getTable(BaseRelationship::SrcTable)->getObjectType()==ObjTable) + tab=dynamic_cast
(rel->getTable(BaseRelationship::SrcTable)); else - tab=dynamic_cast
(rel->getTable(BaseRelationship::DST_TABLE)); + tab=dynamic_cast
(rel->getTable(BaseRelationship::DstTable)); if(!view->isReferencingTable(tab)) { @@ -1288,8 +1288,8 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) rel=getRelationship(view,tab); if(tab && !rel) { - rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_DEP, view, tab, false, false); - rel->setName(PgModelerNS::generateUniqueName(rel, base_relationships)); + rel=new BaseRelationship(BaseRelationship::RelationshipDep, view, tab, false, false); + rel->setName(PgModelerNs::generateUniqueName(rel, base_relationships)); addRelationship(rel); } } @@ -1361,8 +1361,8 @@ void DatabaseModel::validateRelationships(void) itr++; if(rel && - (rel->getRelationshipType()==Relationship::RELATIONSHIP_11 || - rel->getRelationshipType()==Relationship::RELATIONSHIP_1N) && + (rel->getRelationshipType()==Relationship::Relationship11 || + rel->getRelationshipType()==Relationship::Relationship1n) && rel->getReferenceTable()->getPrimaryKey() && rel->getReferenceTable()->getPrimaryKey()->isAddedByRelationship()) rels_gen_pk++; @@ -1440,8 +1440,8 @@ void DatabaseModel::validateRelationships(void) rel->connectRelationship(); //Storing the schemas on a auxiliary vector to update them later - tab1=rel->getTable(BaseRelationship::SRC_TABLE); - tab2=rel->getTable(BaseRelationship::DST_TABLE); + tab1=rel->getTable(BaseRelationship::SrcTable); + tab2=rel->getTable(BaseRelationship::DstTable); if(std::find(schemas.begin(), schemas.end(), tab1->getSchema())==schemas.end()) schemas.push_back(dynamic_cast(tab1->getSchema())); @@ -1493,7 +1493,7 @@ void DatabaseModel::validateRelationships(void) there is only one relationship to be validated */ else if(e.getErrorType()==InvLinkTablesNoPrimaryKey && (conn_tries[rel] > rels.size() || - rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_NN)) + rel->getRelationshipType()==BaseRelationship::RelationshipNn)) { fail_rels.push_back(rel); rels.erase(itr_ant); @@ -1607,8 +1607,8 @@ void DatabaseModel::validateRelationships(void) { base_rel=dynamic_cast(*itr); - if(base_rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) - this->updateTableFKRelationships(dynamic_cast
(base_rel->getTable(BaseRelationship::SRC_TABLE))); + if(base_rel->getRelationshipType()==BaseRelationship::RelationshipFk) + this->updateTableFKRelationships(dynamic_cast
(base_rel->getTable(BaseRelationship::SrcTable))); itr++; } @@ -1646,9 +1646,9 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) if((!rel->isSelfRelationship() && (rel->isIdentifier() || rel->hasIndentifierAttribute())) || - (rel_type==Relationship::RELATIONSHIP_GEN || - rel_type==Relationship::RELATIONSHIP_DEP || - rel_type==Relationship::RELATIONSHIP_PART)) + (rel_type==Relationship::RelationshipGen || + rel_type==Relationship::RelationshipDep || + rel_type==Relationship::RelationshipPart)) { BaseTable *ref_table=nullptr, *src_table=nullptr; Table *recv_table=nullptr; @@ -1689,9 +1689,9 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) ((!rel_aux->isSelfRelationship() && (rel_aux->isIdentifier() || rel_aux->hasIndentifierAttribute())) || - (aux_rel_type==Relationship::RELATIONSHIP_GEN || - aux_rel_type==Relationship::RELATIONSHIP_DEP || - aux_rel_type==Relationship::RELATIONSHIP_PART))) + (aux_rel_type==Relationship::RelationshipGen || + aux_rel_type==Relationship::RelationshipDep || + aux_rel_type==Relationship::RelationshipPart))) { //The receiver table will be the receiver from the current relationship @@ -1977,13 +1977,13 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) if(rel) { - tab1=rel->getTable(BaseRelationship::SRC_TABLE); - tab2=rel->getTable(BaseRelationship::DST_TABLE); + tab1=rel->getTable(BaseRelationship::SrcTable); + tab2=rel->getTable(BaseRelationship::DstTable); //Raises an error if already exists an relationship between the tables - if(rel->getRelationshipType() != Relationship::RELATIONSHIP_1N && - rel->getRelationshipType() != Relationship::RELATIONSHIP_NN && - rel->getRelationshipType() != Relationship::RELATIONSHIP_FK && + if(rel->getRelationshipType() != Relationship::Relationship1n && + rel->getRelationshipType() != Relationship::RelationshipNn && + rel->getRelationshipType() != Relationship::RelationshipFk && getRelationship(tab1,tab2)) { msg=Exception::getErrorMessage(InsDuplicatedRelationship) @@ -2030,7 +2030,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) { /* If the relationship is not a many-to-many we store the receiver table in order to update the fk relationships (if there are any) */ - if(rel->getRelationshipType()!=Relationship::RELATIONSHIP_NN) + if(rel->getRelationshipType()!=Relationship::RelationshipNn) recv_tab=dynamic_cast(rel)->getReceiverTable(); storeSpecialObjectsXML(); @@ -2112,8 +2112,8 @@ BaseRelationship *DatabaseModel::getRelationship(BaseTable *src_tab, BaseTable * while(itr!=itr_end && !found) { rel=dynamic_cast(*itr); - tab1=rel->getTable(BaseRelationship::SRC_TABLE); - tab2=rel->getTable(BaseRelationship::DST_TABLE); + tab1=rel->getTable(BaseRelationship::SrcTable); + tab2=rel->getTable(BaseRelationship::DstTable); found=((!ref_fk || (ref_fk && rel->getReferenceForeignKey() == ref_fk)) && ((tab1==src_tab && tab2==dst_tab) || @@ -2141,8 +2141,8 @@ vector DatabaseModel::getRelationships(BaseTable *tab) { base_rel=dynamic_cast(obj); - if(base_rel->getTable(BaseRelationship::SRC_TABLE)==tab || - base_rel->getTable(BaseRelationship::DST_TABLE)==tab) + if(base_rel->getTable(BaseRelationship::SrcTable)==tab || + base_rel->getTable(BaseRelationship::DstTable)==tab) aux_rels.push_back(base_rel); } @@ -3031,7 +3031,7 @@ void DatabaseModel::loadModel(const QString &filename) def_objs[ObjCollation]=attribs[ParsersAttributes::DEFAULT_COLLATION]; def_objs[ObjTablespace]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -3063,7 +3063,7 @@ void DatabaseModel::loadModel(const QString &filename) /* If there is at least one inheritance relationship we need to flag this situation in order to do an addtional rel. validation in the end of loading */ if(!found_inh_rel && object->getObjectType()==ObjRelationship && - dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN) + dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipGen) found_inh_rel=true; emit s_objectLoaded((xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()))*100, @@ -3083,7 +3083,7 @@ void DatabaseModel::loadModel(const QString &filename) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } this->BaseObject::setProtected(protected_model); @@ -3251,7 +3251,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -3263,7 +3263,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) if(elem_name==ParsersAttributes::COMMENT) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); object->setComment(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -3306,14 +3306,14 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) else if(elem_name==ParsersAttributes::APPENDED_SQL) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); object->setAppendedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } else if(elem_name==ParsersAttributes::PREPENDED_SQL) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); object->setPrependedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -3334,7 +3334,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) } } } - while(!has_error && xmlparser.accessElement(XMLParser::NextElement)); + while(!has_error && xmlparser.accessElement(XmlParser::NextElement)); } xmlparser.restorePosition(); @@ -3479,7 +3479,7 @@ Role *DatabaseModel::createRole(void) role->setOption(op_vect[i], marked); } - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -3526,7 +3526,7 @@ Role *DatabaseModel::createRole(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -3598,7 +3598,7 @@ Language *DatabaseModel::createLanguage(void) lang->setTrusted(attribs[ParsersAttributes::TRUSTED]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -3645,7 +3645,7 @@ Language *DatabaseModel::createLanguage(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } @@ -3701,7 +3701,7 @@ Function *DatabaseModel::createFunction(void) if(!attribs[ParsersAttributes::ROW_AMOUNT].isEmpty()) func->setRowAmount(attribs[ParsersAttributes::ROW_AMOUNT].toInt()); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -3717,7 +3717,7 @@ Function *DatabaseModel::createFunction(void) try { - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); do { @@ -3737,7 +3737,7 @@ Function *DatabaseModel::createFunction(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); xmlparser.restorePosition(); } @@ -3781,14 +3781,14 @@ Function *DatabaseModel::createFunction(void) func->setLibrary(attribs_aux[ParsersAttributes::LIBRARY]); func->setSymbol(attribs_aux[ParsersAttributes::SYMBOL]); } - else if(xmlparser.accessElement(XMLParser::ChildElement)) + else if(xmlparser.accessElement(XmlParser::ChildElement)) func->setSourceCode(xmlparser.getElementContent()); xmlparser.restorePosition(); } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -3825,7 +3825,7 @@ Parameter DatabaseModel::createParameter(void) param.setName(attribs[ParsersAttributes::NAME]); param.setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -3839,7 +3839,7 @@ Parameter DatabaseModel::createParameter(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } param.setIn(attribs[ParsersAttributes::PARAM_IN]==ParsersAttributes::_TRUE_); @@ -3872,7 +3872,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) tpattrib.setName(attribs[ParsersAttributes::NAME]); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -3905,7 +3905,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } xmlparser.restorePosition(); @@ -4044,7 +4044,7 @@ Type *DatabaseModel::createType(void) func_types[ParsersAttributes::SUBTYPE_DIFF_FUNC]=Type::SUBTYPE_DIFF_FUNC; } - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4137,7 +4137,7 @@ Type *DatabaseModel::createType(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -4177,7 +4177,7 @@ Domain *DatabaseModel::createDomain(void) domain->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4194,8 +4194,8 @@ Domain *DatabaseModel::createDomain(void) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); - xmlparser.accessElement(XMLParser::ChildElement); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); domain->addCheckConstraint(attribs[ParsersAttributes::NAME], xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -4229,15 +4229,15 @@ Cast *DatabaseModel::createCast(void) xmlparser.getElementAttributes(attribs); if(attribs[ParsersAttributes::CAST_TYPE]==ParsersAttributes::IMPLICIT) - cast->setCastType(Cast::IMPLICIT); + cast->setCastType(Cast::Implicit); else if(attribs[ParsersAttributes::CAST_TYPE]==ParsersAttributes::ASSIGNMENT) - cast->setCastType(Cast::ASSIGNMENT); + cast->setCastType(Cast::Assignment); else - cast->setCastType(Cast::EXPLICIT); + cast->setCastType(Cast::Explicit); cast->setInOut(attribs[ParsersAttributes::IO_CAST]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4250,9 +4250,9 @@ Cast *DatabaseModel::createCast(void) { type=createPgSQLType(); if(type_idx==0) - cast->setDataType(Cast::SRC_TYPE, type); + cast->setDataType(Cast::SrcType, type); else - cast->setDataType(Cast::DST_TYPE, type); + cast->setDataType(Cast::DstType, type); type_idx++; } //Extracts the conversion function @@ -4274,7 +4274,7 @@ Cast *DatabaseModel::createCast(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -4307,7 +4307,7 @@ Conversion *DatabaseModel::createConversion(void) conv->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4333,7 +4333,7 @@ Conversion *DatabaseModel::createConversion(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -4372,7 +4372,7 @@ Operator *DatabaseModel::createOperator(void) oper_types[ParsersAttributes::COMMUTATOR_OP]=Operator::OPER_COMMUTATOR; oper_types[ParsersAttributes::NEGATOR_OP]=Operator::OPER_NEGATOR; - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4428,7 +4428,7 @@ Operator *DatabaseModel::createOperator(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -4464,7 +4464,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) elem_types[ParsersAttributes::OPERATOR]=OperatorClassElement::OPERATOR_ELEM; elem_types[ParsersAttributes::STORAGE]=OperatorClassElement::STORAGE_ELEM; - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4502,7 +4502,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) elem_type=elem_types[attribs[ParsersAttributes::TYPE]]; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); xmlparser.getElementAttributes(attribs); if(elem_type==OperatorClassElement::STORAGE_ELEM) @@ -4520,10 +4520,10 @@ OperatorClass *DatabaseModel::createOperatorClass(void) object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjOperator); class_elem.setOperator(dynamic_cast(object),stg_number); - if(xmlparser.hasElement(XMLParser::NextElement)) + if(xmlparser.hasElement(XmlParser::NextElement)) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::NextElement); + xmlparser.accessElement(XmlParser::NextElement); xmlparser.getElementAttributes(attribs_aux); object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjOpFamily); @@ -4546,7 +4546,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -4595,7 +4595,7 @@ Aggregate *DatabaseModel::createAggregate(void) aggreg->setInitialCondition(attribs[ParsersAttributes::INITIAL_COND]); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4628,15 +4628,15 @@ Aggregate *DatabaseModel::createAggregate(void) RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::TRANSITION_FUNC) - aggreg->setFunction(Aggregate::TRANSITION_FUNC, + aggreg->setFunction(Aggregate::TransitionFunc, dynamic_cast(func)); else - aggreg->setFunction(Aggregate::FINAL_FUNC, + aggreg->setFunction(Aggregate::FinalFunc, dynamic_cast(func)); } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -4676,7 +4676,7 @@ Table *DatabaseModel::createTable(void) table->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); table->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4715,7 +4715,7 @@ Table *DatabaseModel::createTable(void) xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4732,7 +4732,7 @@ Table *DatabaseModel::createTable(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); table->setRelObjectsIndexes(names, idxs, obj_type); names.clear(); @@ -4747,7 +4747,7 @@ Table *DatabaseModel::createTable(void) table->setPartitioningType(aux_attribs[ParsersAttributes::TYPE]); xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4758,7 +4758,7 @@ Table *DatabaseModel::createTable(void) partition_keys.push_back(part_key); } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); table->addPartitionKeys(partition_keys); } @@ -4769,7 +4769,7 @@ Table *DatabaseModel::createTable(void) else if(elem==ParsersAttributes::INITIAL_DATA) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); table->setInitialData(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -4780,7 +4780,7 @@ Table *DatabaseModel::createTable(void) xmlparser.restorePosition(); } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } table->setProtected(table->isProtected()); @@ -4834,7 +4834,7 @@ Column *DatabaseModel::createColumn(void) column->setSequence(seq); } - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -4848,7 +4848,7 @@ Column *DatabaseModel::createColumn(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -4955,10 +4955,10 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setMatchType(attribs[ParsersAttributes::COMPARISON_TYPE]); if(!attribs[ParsersAttributes::DEL_ACTION].isEmpty()) - constr->setActionType(attribs[ParsersAttributes::DEL_ACTION], Constraint::DELETE_ACTION); + constr->setActionType(attribs[ParsersAttributes::DEL_ACTION], Constraint::DeleteAction); if(!attribs[ParsersAttributes::UPD_ACTION].isEmpty()) - constr->setActionType(attribs[ParsersAttributes::UPD_ACTION], Constraint::UPDATE_ACTION); + constr->setActionType(attribs[ParsersAttributes::UPD_ACTION], Constraint::UpdateAction); ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjTable); @@ -4988,7 +4988,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setIndexType(attribs[ParsersAttributes::INDEX_TYPE]); } - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -5004,7 +5004,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) else if(elem==ParsersAttributes::EXPRESSION) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); constr->setExpression(xmlparser.getElementContent()); @@ -5018,13 +5018,13 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) count=col_list.count(); if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::SRC_COLUMNS) - col_type=Constraint::SOURCE_COLS; + col_type=Constraint::SourceCols; else - col_type=Constraint::REFERENCED_COLS; + col_type=Constraint::ReferencedCols; for(i=0; i < count; i++) { - if(col_type==Constraint::SOURCE_COLS) + if(col_type==Constraint::SourceCols) { if(obj_type==ObjTable) { @@ -5052,7 +5052,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } if(ins_constr_table) @@ -5101,7 +5101,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setSortingEnabled(attribs[ParsersAttributes::USE_SORTING]!=ParsersAttributes::_FALSE_); xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); do { @@ -5229,19 +5229,19 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==ParsersAttributes::EXPRESSION) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); elem.setExpression(xmlparser.getElementContent()); xmlparser.restorePosition(); } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); xmlparser.restorePosition(); } } -XMLParser *DatabaseModel::getXMLParser(void) +XmlParser *DatabaseModel::getXMLParser(void) { return(&xmlparser); } @@ -5320,7 +5320,7 @@ Index *DatabaseModel::createIndex(void) index->setIndexingType(attribs[ParsersAttributes::INDEX_TYPE]); index->setFillFactor(attribs[ParsersAttributes::FACTOR].toUInt()); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -5336,14 +5336,14 @@ Index *DatabaseModel::createIndex(void) else if(elem==ParsersAttributes::PREDICATE) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); str_aux=xmlparser.getElementContent(); xmlparser.restorePosition(); index->setPredicate(str_aux); } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } table->addObject(index); @@ -5391,7 +5391,7 @@ Rule *DatabaseModel::createRule(void) rule->setExecutionType(attribs[ParsersAttributes::EXEC_TYPE]); rule->setEventType(attribs[ParsersAttributes::EVENT_TYPE]); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -5403,7 +5403,7 @@ Rule *DatabaseModel::createRule(void) elem==ParsersAttributes::CONDITION) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); str_aux=xmlparser.getElementContent(); xmlparser.restorePosition(); @@ -5423,7 +5423,7 @@ Rule *DatabaseModel::createRule(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } table->addObject(rule); @@ -5527,7 +5527,7 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setReferecendTable(dynamic_cast(ref_table)); } - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -5557,7 +5557,7 @@ Trigger *DatabaseModel::createTrigger(void) else if(elem==ParsersAttributes::CONDITION) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); str_aux=xmlparser.getElementContent(); xmlparser.restorePosition(); trigger->setCondition(str_aux); @@ -5581,7 +5581,7 @@ Trigger *DatabaseModel::createTrigger(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } table->addObject(trigger); @@ -5623,7 +5623,7 @@ Policy *DatabaseModel::createPolicy(void) policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::_TRUE_); policy->setPolicyCommand(PolicyCmdType(attribs[ParsersAttributes::COMMAND])); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -5635,7 +5635,7 @@ Policy *DatabaseModel::createPolicy(void) { xmlparser.getElementAttributes(attribs); xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); if(attribs[ParsersAttributes::TYPE] == ParsersAttributes::USING_EXP) policy->setUsingExpression(xmlparser.getElementContent()); @@ -5673,7 +5673,7 @@ Policy *DatabaseModel::createPolicy(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } table->addObject(policy); @@ -5702,7 +5702,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) xmlparser.getElementAttributes(attribs); event_trig->setEvent(EventTriggerType(attribs[ParsersAttributes::EVENT])); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -5735,7 +5735,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } @@ -5758,11 +5758,11 @@ GenericSQL *DatabaseModel::createGenericSQL(void) genericsql=new GenericSQL; setBasicAttributes(genericsql); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { if(xmlparser.getElementType()==XML_ELEMENT_NODE && xmlparser.getElementName() == ParsersAttributes::DEFINITION) { - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); genericsql->setDefinition(xmlparser.getElementContent()); } } @@ -5882,7 +5882,7 @@ View *DatabaseModel::createView(void) view->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); view->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -5945,8 +5945,8 @@ View *DatabaseModel::createView(void) xmlparser.savePosition(); str_aux=attribs[ParsersAttributes::ALIAS]; - xmlparser.accessElement(XMLParser::ChildElement); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); reference = Reference(xmlparser.getElementContent(),str_aux); reference.setReferenceAlias(attribs[ParsersAttributes::REF_ALIAS]); @@ -5959,7 +5959,7 @@ View *DatabaseModel::createView(void) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::CTE_EXPRESSION) view->setCommomTableExpression(xmlparser.getElementContent()); @@ -6009,7 +6009,7 @@ View *DatabaseModel::createView(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } /** Special case for refereces used as view definition ** @@ -6084,8 +6084,8 @@ Collation *DatabaseModel::createCollation(void) //Creating a collation using LC_COLLATE and LC_CTYPE params else { - collation->setLocalization(Collation::_LC_COLLATE, attribs[ParsersAttributes::_LC_COLLATE_]); - collation->setLocalization(Collation::_LC_CTYPE, attribs[ParsersAttributes::_LC_CTYPE_]); + collation->setLocalization(Collation::LcCollate, attribs[ParsersAttributes::_LC_COLLATE_]); + collation->setLocalization(Collation::LcCtype, attribs[ParsersAttributes::_LC_CTYPE_]); } } catch(Exception &e) @@ -6132,7 +6132,7 @@ Tag *DatabaseModel::createTag(void) tag=new Tag; setBasicAttributes(tag); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -6147,7 +6147,7 @@ Tag *DatabaseModel::createTag(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } return(tag); @@ -6212,9 +6212,9 @@ BaseRelationship *DatabaseModel::createRelationship(void) try { - labels_id[ParsersAttributes::NAME_LABEL]=BaseRelationship::REL_NAME_LABEL; - labels_id[ParsersAttributes::SRC_LABEL]=BaseRelationship::SRC_CARD_LABEL; - labels_id[ParsersAttributes::DST_LABEL]=BaseRelationship::DST_CARD_LABEL; + labels_id[ParsersAttributes::NAME_LABEL]=BaseRelationship::RelNameLabel; + labels_id[ParsersAttributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; + labels_id[ParsersAttributes::DST_LABEL]=BaseRelationship::DstCardLabel; xmlparser.getElementAttributes(attribs); protect=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_); @@ -6263,18 +6263,18 @@ BaseRelationship *DatabaseModel::createRelationship(void) added to the table after its creation. */ if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_FK) { - base_rel=new BaseRelationship(BaseRelationship::RELATIONSHIP_FK, tables[0], tables[1], false, false); + base_rel=new BaseRelationship(BaseRelationship::RelationshipFk, tables[0], tables[1], false, false); base_rel->setName(attribs[ParsersAttributes::NAME]); base_rel->setAlias(attribs[ParsersAttributes::ALIAS]); addRelationship(base_rel); /* If the source table doesn't have any fk that references the destination table indicates that the relationship is being created before the fk that represents it or the fk is invalid (inconsistence!). In this case an error is raised. */ - if(base_rel->getRelationshipType() == BaseRelationship::RELATIONSHIP_FK && + if(base_rel->getRelationshipType() == BaseRelationship::RelationshipFk && !base_rel->getReferenceForeignKey()) { - Table *src_tab = dynamic_cast
(base_rel->getTable(BaseRelationship::SRC_TABLE)), - *dst_tab = dynamic_cast
(base_rel->getTable(BaseRelationship::DST_TABLE)); + Table *src_tab = dynamic_cast
(base_rel->getTable(BaseRelationship::SrcTable)), + *dst_tab = dynamic_cast
(base_rel->getTable(BaseRelationship::DstTable)); vector fks; src_tab->getForeignKeys(fks, false, dst_tab); @@ -6337,17 +6337,17 @@ BaseRelationship *DatabaseModel::createRelationship(void) single_pk_col=(attribs[ParsersAttributes::SINGLE_PK_COLUMN]==ParsersAttributes::_TRUE_); if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_11) - rel_type=BaseRelationship::RELATIONSHIP_11; + rel_type=BaseRelationship::Relationship11; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_1N) - rel_type=BaseRelationship::RELATIONSHIP_1N; + rel_type=BaseRelationship::Relationship1n; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_NN) - rel_type=BaseRelationship::RELATIONSHIP_NN; + rel_type=BaseRelationship::RelationshipNn; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_GEN) - rel_type=BaseRelationship::RELATIONSHIP_GEN; + rel_type=BaseRelationship::RelationshipGen; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_DEP) - rel_type=BaseRelationship::RELATIONSHIP_DEP; + rel_type=BaseRelationship::RelationshipDep; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_PART) - rel_type=BaseRelationship::RELATIONSHIP_PART; + rel_type=BaseRelationship::RelationshipPart; rel=new Relationship(rel_type, dynamic_cast
(tables[0]), @@ -6372,7 +6372,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) rel->setNamePattern(pattern_id[i], attribs[pat_attrib[i]]); } - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -6383,7 +6383,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(elem == ParsersAttributes::EXPRESSION && rel) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); rel->setPartitionBoundingExpr(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -6417,7 +6417,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) { vector points; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); do { @@ -6425,7 +6425,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) points.push_back(QPointF(attribs[ParsersAttributes::X_POS].toDouble(), attribs[ParsersAttributes::Y_POS].toDouble())); } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); base_rel->setPoints(points); xmlparser.restorePosition(); @@ -6436,7 +6436,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) str_aux=attribs[ParsersAttributes::REF_TYPE]; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); xmlparser.getElementAttributes(attribs); xmlparser.restorePosition(); @@ -6461,7 +6461,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -6515,7 +6515,7 @@ Permission *DatabaseModel::createPermission(void) cascade=priv_attribs[ParsersAttributes::CASCADE]==ParsersAttributes::_TRUE_; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); xmlparser.getElementAttributes(attribs); obj_type=BaseObject::getObjectType(attribs[ParsersAttributes::TYPE]); @@ -6619,7 +6619,7 @@ Permission *DatabaseModel::createPermission(void) } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); xmlparser.restorePosition(); } @@ -6684,7 +6684,7 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab { rel=dynamic_cast(*itr); itr++; - ref_tab_inheritance=(rel->getRelationshipType()==Relationship::RELATIONSHIP_GEN && + ref_tab_inheritance=(rel->getRelationshipType()==Relationship::RelationshipGen && rel->getReferenceTable()==parent_tab); } } @@ -7025,7 +7025,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b /* If the object is a FK relationship it's stored in a separeted list in order to have the code generated at end of whole definition (after foreign keys definition) */ if(object->getObjectType()==ObjBaseRelationship && - dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) + dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk) { fk_rels.push_back(object); } @@ -7040,7 +7040,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b /* Avoiding many-to-many relationships to be included in the map. They are treated in a separated way below, because on the diff process (ModelsDiffHelper) the generated table need to be compared to other tables not the relationship itself */ - if(!incl_relnn_objs || !rel || (rel && rel->getRelationshipType()!=BaseRelationship::RELATIONSHIP_NN)) + if(!incl_relnn_objs || !rel || (rel && rel->getRelationshipType()!=BaseRelationship::RelationshipNn)) objects_map[object->getObjectId()]=object; } } @@ -7109,14 +7109,14 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b if(object->getObjectType()==ObjRelationship) { rel=dynamic_cast(object); - objs[0]=rel->getTable(Relationship::SRC_TABLE); - objs[1]=rel->getTable(Relationship::DST_TABLE); + objs[0]=rel->getTable(Relationship::SrcTable); + objs[1]=rel->getTable(Relationship::DstTable); /* For many-to-many relationship, the generated table and the foreign keys that represents the link are included on the creation order map instead of the relationship itself. This is done to permit the table to be accessed and compared on the diff process */ if(incl_relnn_objs && - rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_NN && + rel->getRelationshipType()==BaseRelationship::RelationshipNn && rel->getGeneratedTable()) { table=rel->getGeneratedTable(); @@ -7296,7 +7296,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on { rel=dynamic_cast(obj); - if(rel->getRelationshipType()==Relationship::RELATIONSHIP_NN && + if(rel->getRelationshipType()==Relationship::RelationshipNn && rel->getGeneratedTable() && rel->getGeneratedTable()->getSchema()==object) { @@ -7500,7 +7500,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; - for(unsigned i=Cast::SRC_TYPE; i <= Cast::DST_TYPE; i++) + for(unsigned i=Cast::SrcType; i <= Cast::DstType; i++) { usr_type=getObjectPgSQLType(cast->getDataType(i)); @@ -7553,7 +7553,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetFunction(i), deps, inc_indirect_deps); usr_type=getObjectPgSQLType(aggreg->getStateType()); @@ -7633,8 +7633,8 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetTable(Relationship::SRC_TABLE), deps, inc_indirect_deps); - getObjectDependecies(rel->getTable(Relationship::DST_TABLE), deps, inc_indirect_deps); + getObjectDependecies(rel->getTable(Relationship::SrcTable), deps, inc_indirect_deps); + getObjectDependecies(rel->getTable(Relationship::DstTable), deps, inc_indirect_deps); count=rel->getAttributeCount(); for(i=0; i < count; i++) @@ -7944,8 +7944,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { base_rel=dynamic_cast(*itr); - if(base_rel->getTable(BaseRelationship::SRC_TABLE)==table || - base_rel->getTable(BaseRelationship::DST_TABLE)==table) + if(base_rel->getTable(BaseRelationship::SrcTable)==table || + base_rel->getTable(BaseRelationship::DstTable)==table) { refer=true; refs.push_back(base_rel); @@ -7959,9 +7959,9 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { base_rel=dynamic_cast(*itr); - if(base_rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK && - (base_rel->getTable(BaseRelationship::SRC_TABLE)==table || - base_rel->getTable(BaseRelationship::DST_TABLE)==table)) + if(base_rel->getRelationshipType()==BaseRelationship::RelationshipFk && + (base_rel->getTable(BaseRelationship::SrcTable)==table || + base_rel->getTable(BaseRelationship::DstTable)==table)) { refer=true; refs.push_back(base_rel); @@ -8045,8 +8045,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector { base_rel=dynamic_cast(*itr); - if(base_rel->getTable(BaseRelationship::SRC_TABLE)==table || - base_rel->getTable(BaseRelationship::DST_TABLE)==table) + if(base_rel->getTable(BaseRelationship::SrcTable)==table || + base_rel->getTable(BaseRelationship::DstTable)==table) { refer=true; refs.push_back(base_rel); @@ -8120,8 +8120,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector { aggreg=dynamic_cast(*itr); - if(aggreg->getFunction(Aggregate::FINAL_FUNC)==func || - aggreg->getFunction(Aggregate::TRANSITION_FUNC)==func) + if(aggreg->getFunction(Aggregate::FinalFunc)==func || + aggreg->getFunction(Aggregate::TransitionFunc)==func) { refer=true; refs.push_back(aggreg); @@ -8455,8 +8455,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector cast=dynamic_cast(*itr); itr++; - if(cast->getDataType(Cast::SRC_TYPE)==ptr_pgsqltype || - cast->getDataType(Cast::DST_TYPE)==ptr_pgsqltype) + if(cast->getDataType(Cast::SrcType)==ptr_pgsqltype || + cast->getDataType(Cast::DstType)==ptr_pgsqltype) { refer=true; refs.push_back(cast); @@ -9549,11 +9549,11 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { rel=dynamic_cast(object); - if(save_objs_pos && rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_NN && rel->getReceiverTable()) + if(save_objs_pos && rel->getRelationshipType()==BaseRelationship::RelationshipNn && rel->getReceiverTable()) { tab_nn=rel->getReceiverTable(); - src_tab=rel->getTable(BaseRelationship::SRC_TABLE); - dst_tab=rel->getTable(BaseRelationship::DST_TABLE); + src_tab=rel->getTable(BaseRelationship::SrcTable); + dst_tab=rel->getTable(BaseRelationship::DstTable); //Since the generated table does not have a position we create one based upon the source tables positions pnt.setX((src_tab->getPosition().x() + dst_tab->getPosition().x())/2.0f); @@ -9700,11 +9700,11 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::CUSTOM_COLOR]=(save_custom_colors && rel->getCustomColor()!=Qt::transparent ? rel->getCustomColor().name() : ParsersAttributes::NONE); - attribs[ParsersAttributes::SRC_TABLE]=rel->getTable(BaseRelationship::SRC_TABLE)->getSignature(); - attribs[ParsersAttributes::SRC_TYPE]=rel->getTable(BaseRelationship::SRC_TABLE)->getSchemaName(); + attribs[ParsersAttributes::SRC_TABLE]=rel->getTable(BaseRelationship::SrcTable)->getSignature(); + attribs[ParsersAttributes::SRC_TYPE]=rel->getTable(BaseRelationship::SrcTable)->getSchemaName(); - attribs[ParsersAttributes::DST_TABLE]=rel->getTable(BaseRelationship::DST_TABLE)->getSignature(); - attribs[ParsersAttributes::DST_TYPE]=rel->getTable(BaseRelationship::DST_TABLE)->getSchemaName(); + attribs[ParsersAttributes::DST_TABLE]=rel->getTable(BaseRelationship::DstTable)->getSignature(); + attribs[ParsersAttributes::DST_TYPE]=rel->getTable(BaseRelationship::DstTable)->getSchemaName(); for(QPointF pnt : points) { @@ -9719,7 +9719,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option } //Saving the labels' custom positions - for(unsigned id=BaseRelationship::SRC_CARD_LABEL; id <= BaseRelationship::REL_NAME_LABEL; id++) + for(unsigned id=BaseRelationship::SrcCardLabel; id <= BaseRelationship::RelNameLabel; id++) { pnt=rel->getLabelDistance(id); if(!std::isnan(pnt.x()) && !std::isnan(pnt.y())) @@ -9852,9 +9852,9 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option try { - labels_attrs[ParsersAttributes::SRC_LABEL]=BaseRelationship::SRC_CARD_LABEL; - labels_attrs[ParsersAttributes::DST_LABEL]=BaseRelationship::DST_CARD_LABEL; - labels_attrs[ParsersAttributes::NAME_LABEL]=BaseRelationship::REL_NAME_LABEL; + labels_attrs[ParsersAttributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; + labels_attrs[ParsersAttributes::DST_LABEL]=BaseRelationship::DstCardLabel; + labels_attrs[ParsersAttributes::NAME_LABEL]=BaseRelationship::RelNameLabel; xmlparser.restartParser(); @@ -9864,7 +9864,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option xmlparser.loadXMLFile(filename); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -9986,7 +9986,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(load_objs_aliases && !attribs[ParsersAttributes::ALIAS].isEmpty()) object->setAlias(attribs[ParsersAttributes::ALIAS]); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -10005,7 +10005,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option ref_type=aux_attrib[ParsersAttributes::REF_TYPE]; xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { xmlparser.getElementAttributes(aux_attrib); labels_pos[labels_attrs[ref_type]]=QPointF(aux_attrib[ParsersAttributes::X_POS].toFloat(), @@ -10018,7 +10018,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::APPENDED_SQL].isEmpty()) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); object->setAppendedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } @@ -10026,12 +10026,12 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::PREPENDED_SQL].isEmpty()) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); object->setPrependedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } if(BaseGraphicObject::isGraphicObject(obj_type)) @@ -10056,7 +10056,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { rel->setPoints(points); - for(unsigned id=BaseRelationship::SRC_CARD_LABEL; id <= BaseRelationship::REL_NAME_LABEL; id++) + for(unsigned id=BaseRelationship::SrcCardLabel; id <= BaseRelationship::RelNameLabel; id++) { rel->setLabelDistance(id, labels_pos[id]); labels_pos[id]=QPointF(NAN,NAN); @@ -10092,7 +10092,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ObjBaseObject); diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 5934e3b305..ff165e1a6d 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -65,7 +65,7 @@ class DatabaseModel: public QObject, public BaseObject { static unsigned dbmodel_id; - XMLParser xmlparser; + XmlParser xmlparser; //! \brief Stores the model widget that is managing this database model instance ModelWidget *model_wgt; @@ -610,7 +610,7 @@ class DatabaseModel: public QObject, public BaseObject { the create* method. \note: This is not the better approach and certainly will be changed in future releases */ - XMLParser *getXMLParser(void); + XmlParser *getXMLParser(void); //! \brief Returns the ALTER definition between the current model and the provided one virtual QString getAlterDefinition(BaseObject *object) final; diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index e57b05dd1b..69a3b68042 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -165,7 +165,7 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) BaseObject *copy_obj=nullptr; if(obj_type!=ObjBaseObject && obj_type!=ObjDatabase) - PgModelerNS::copyObject(©_obj, object, obj_type); + PgModelerNs::copyObject(©_obj, object, obj_type); else throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -771,13 +771,13 @@ void OperationList::executeOperation(Operation *oper, bool redo) previous values restored with the existing copy on the pool. After restoring the object on the pool will have the same attributes as the object before being restored to enable redo operations */ - PgModelerNS::copyObject(reinterpret_cast(&bkp_obj), orig_obj, obj_type); - PgModelerNS::copyObject(reinterpret_cast(&orig_obj), object, obj_type); - PgModelerNS::copyObject(reinterpret_cast(&object), bkp_obj, obj_type); + PgModelerNs::copyObject(reinterpret_cast(&bkp_obj), orig_obj, obj_type); + PgModelerNs::copyObject(reinterpret_cast(&orig_obj), object, obj_type); + PgModelerNs::copyObject(reinterpret_cast(&object), bkp_obj, obj_type); object=orig_obj; if(aux_obj) - PgModelerNS::copyObject(reinterpret_cast(&object), aux_obj, obj_type); + PgModelerNs::copyObject(reinterpret_cast(&object), aux_obj, obj_type); //For pk constraint, after restore the previous configuration, check the not-null flag of the new source columns if(obj_type==ObjConstraint) @@ -792,7 +792,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) (op_type==Operation::OBJECT_CREATED && redo)) { if(aux_obj) - PgModelerNS::copyObject(reinterpret_cast(&object), aux_obj, obj_type); + PgModelerNs::copyObject(reinterpret_cast(&object), aux_obj, obj_type); if(parent_tab) { diff --git a/libpgmodeler/src/operationlist.h b/libpgmodeler/src/operationlist.h index 3896d65edf..b71291d6ec 100644 --- a/libpgmodeler/src/operationlist.h +++ b/libpgmodeler/src/operationlist.h @@ -39,7 +39,7 @@ class OperationList: public QObject { //! \brief Inidcates that operation chaining is ignored temporarily bool ignore_chain; - XMLParser *xmlparser; + XmlParser *xmlparser; //! \brief List of objects that were removed / modified on the model vector object_pool; diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index ed66883554..00ecd0d051 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -21,7 +21,7 @@ #include #include -namespace PgModelerNS { +namespace PgModelerNs { template void copyObject(BaseObject **psrc_obj, Class *copy_obj) diff --git a/libpgmodeler/src/pgmodelerns.h b/libpgmodeler/src/pgmodelerns.h index 5b5c1e7156..3eacde7588 100644 --- a/libpgmodeler/src/pgmodelerns.h +++ b/libpgmodeler/src/pgmodelerns.h @@ -27,7 +27,7 @@ #include "baseobject.h" -namespace PgModelerNS { +namespace PgModelerNs { //! \brief Default char used as unescaped value start delimiter static const QChar UNESC_VALUE_START='/'; diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 631e08bccc..d35429697a 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -55,9 +55,9 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, /* Raises an error if the user tries to create a relationship which some table doesn't has a primary key */ - if(((rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N) && + if(((rel_type==Relationship11 || rel_type==Relationship1n) && !this->getReferenceTable()->getPrimaryKey()) || - (rel_type==RELATIONSHIP_NN && (!src_tab->getPrimaryKey() || !dst_tab->getPrimaryKey()))) + (rel_type==RelationshipNn && (!src_tab->getPrimaryKey() || !dst_tab->getPrimaryKey()))) throw Exception(Exception::getErrorMessage(InvLinkTablesNoPrimaryKey) .arg(obj_name) .arg(src_tab->getName(true)) @@ -65,7 +65,7 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, InvLinkTablesNoPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); // Raises an error if the user tries to create another copy relationship if the table already copies another table - if(rel_type==RELATIONSHIP_DEP && src_tab->getCopyTable()) + if(rel_type==RelationshipDep && src_tab->getCopyTable()) throw Exception(Exception::getErrorMessage(InvCopyRelTableDefined) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) @@ -74,13 +74,13 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, /* If the relationship is partitioning the destination table (partitioned) shoud have * a partitioning type defined otherwise and error is raised */ - if(rel_type == RELATIONSHIP_PART && !dst_tab->isPartitioned()) + if(rel_type == RelationshipPart && !dst_tab->isPartitioned()) throw Exception(Exception::getErrorMessage(InvPartitioningTypePartRel) .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), InvPartitioningTypePartRel, __PRETTY_FUNCTION__,__FILE__,__LINE__); // Raises an error if the user tries to create a partitioning relationship where one of the tables are already a partition table - if(rel_type==RELATIONSHIP_PART && src_tab->getPartitionedTable()) + if(rel_type==RelationshipPart && src_tab->getPartitionedTable()) throw Exception(Exception::getErrorMessage(InvPartRelPartitionedDefined) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) @@ -98,9 +98,9 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, * * 3) Generalization, copy relationship or one-to-many in which one of the tables is part of a partitioning hierarchy. */ - if((rel_type == RELATIONSHIP_NN && (src_tab->isPartitioned() || dst_tab->isPartitioned())) || - (rel_type == RELATIONSHIP_1N && getReferenceTable()->isPartitioned() && !getReceiverTable()->isPartitioned()) || - ((rel_type == RELATIONSHIP_GEN || rel_type == RELATIONSHIP_DEP || rel_type == RELATIONSHIP_11) && + if((rel_type == RelationshipNn && (src_tab->isPartitioned() || dst_tab->isPartitioned())) || + (rel_type == Relationship1n && getReferenceTable()->isPartitioned() && !getReceiverTable()->isPartitioned()) || + ((rel_type == RelationshipGen || rel_type == RelationshipDep || rel_type == Relationship11) && (src_tab->isPartition() || src_tab->isPartitioned() || dst_tab->isPartition() || dst_tab->isPartitioned()))) throw Exception(Exception::getErrorMessage(InvRelTypeForPatitionTables) .arg(src_tab->getName(true)) @@ -119,23 +119,23 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, this->invalidated=true; this->single_pk_column=false; - if(rel_type==RELATIONSHIP_11) + if(rel_type==Relationship11) str_aux=QApplication::translate("Relationship","%1_has_one_%2",""); - else if(rel_type==RELATIONSHIP_1N) + else if(rel_type==Relationship1n) str_aux=QApplication::translate("Relationship","%1_has_many_%2",""); - else if(rel_type==RELATIONSHIP_NN) + else if(rel_type==RelationshipNn) str_aux=QApplication::translate("Relationship","many_%1_has_many_%2",""); - else if(rel_type==RELATIONSHIP_GEN) + else if(rel_type==RelationshipGen) str_aux=QApplication::translate("Relationship","%1_inherits_%2",""); - else if(rel_type==RELATIONSHIP_PART) + else if(rel_type==RelationshipPart) str_aux=QApplication::translate("Relationship","%1_is_partition_of_%2",""); else str_aux=QApplication::translate("Relationship","%1_copies_%2",""); - if(rel_type==RELATIONSHIP_NN) + if(rel_type==RelationshipNn) str_aux=str_aux.arg(this->src_table->getName()) .arg(this->dst_table->getName()); - else if(rel_type==RELATIONSHIP_1N) + else if(rel_type==Relationship1n) str_aux=str_aux.arg(this->getReferenceTable()->getName()) .arg(this->getReceiverTable()->getName()); else @@ -147,7 +147,7 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, setName(str_aux); - if(rel_type==RELATIONSHIP_NN) + if(rel_type==RelationshipNn) { tab_name_relnn=this->obj_name; if(tab_name_relnn.size() > BaseObject::ObjectNameMaxLength) @@ -161,7 +161,7 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, setNamePattern(DST_COL_PATTERN, SRC_COL_TOKEN + SUFFIX_SEPARATOR + DST_TAB_TOKEN); setNamePattern(PK_COL_PATTERN, QString("id")); } - else if(rel_type==RELATIONSHIP_DEP || rel_type==RELATIONSHIP_GEN) + else if(rel_type==RelationshipDep || rel_type==RelationshipGen) setNamePattern(PK_PATTERN, DST_TAB_TOKEN + SUFFIX_SEPARATOR + QString("pk")); else { @@ -217,9 +217,9 @@ QString Relationship::generateObjectName(unsigned pat_id, Column *id_col, bool u QString name, aux_name; name=name_patterns[pat_id]; - name.replace(GEN_TAB_TOKEN, (rel_type==RELATIONSHIP_NN ? tab_name_relnn : QString())); + name.replace(GEN_TAB_TOKEN, (rel_type==RelationshipNn ? tab_name_relnn : QString())); - if(rel_type==RELATIONSHIP_NN) + if(rel_type==RelationshipNn) { aux_name = use_alias && !src_table->getAlias().isEmpty() ? src_table->getAlias() : src_table->getName(); name.replace(SRC_TAB_TOKEN, aux_name); @@ -273,9 +273,9 @@ void Relationship::setIdentifier(bool value) set as identifier. */ if(value && (src_table==dst_table || - (rel_type==RELATIONSHIP_NN || - rel_type==RELATIONSHIP_GEN || - rel_type==RELATIONSHIP_DEP))) + (rel_type==RelationshipNn || + rel_type==RelationshipGen || + rel_type==RelationshipDep))) throw Exception(InvIdentifierRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); identifier=value; @@ -328,11 +328,11 @@ void Relationship::createSpecialPrimaryKey(void) pk_special->setTablespace(dynamic_cast(getReceiverTable()->getTablespace())); //For generalization relationships generates the primary key in form of ALTER command - pk_special->setDeclaredInTable(this->getRelationshipType()!=RELATIONSHIP_GEN); + pk_special->setDeclaredInTable(this->getRelationshipType()!=RelationshipGen); // Adding the collumns of the original primary key to the special one - for(i=0; pk_original && i < pk_original->getColumnCount(Constraint::SOURCE_COLS); i++) - pk_special->addColumn(pk_original->getColumn(i, Constraint::SOURCE_COLS), Constraint::SOURCE_COLS); + for(i=0; pk_original && i < pk_original->getColumnCount(Constraint::SourceCols); i++) + pk_special->addColumn(pk_original->getColumn(i, Constraint::SourceCols), Constraint::SourceCols); gen_cols=gen_columns; for(auto &attrib : rel_attributes) @@ -343,8 +343,8 @@ void Relationship::createSpecialPrimaryKey(void) for(i=0; i < count; i++) { if(column_ids_pk_rel[i] < gen_cols.size() && - !pk_special->isColumnExists(gen_cols[column_ids_pk_rel[i]], Constraint::SOURCE_COLS)) - pk_special->addColumn(gen_cols[column_ids_pk_rel[i]], Constraint::SOURCE_COLS); + !pk_special->isColumnExists(gen_cols[column_ids_pk_rel[i]], Constraint::SourceCols)) + pk_special->addColumn(gen_cols[column_ids_pk_rel[i]], Constraint::SourceCols); } try @@ -362,7 +362,7 @@ void Relationship::createSpecialPrimaryKey(void) void Relationship::setTableNameRelNN(const QString &name) { - if(rel_type==RELATIONSHIP_NN) + if(rel_type==RelationshipNn) { if(!BaseObject::isValidName(name)) throw Exception(AsgInvalidNameTableRelNN, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -407,7 +407,7 @@ DeferralType Relationship::getDeferralType(void) void Relationship::setActionType(ActionType act_type, unsigned act_id) { - if(act_id==Constraint::DELETE_ACTION) + if(act_id==Constraint::DeleteAction) this->del_action=act_type; else this->upd_action=act_type; @@ -417,7 +417,7 @@ void Relationship::setActionType(ActionType act_type, unsigned act_id) ActionType Relationship::getActionType(unsigned act_id) { - if(act_id==Constraint::DELETE_ACTION) + if(act_id==Constraint::DeleteAction) return(del_action); else return(upd_action); @@ -491,9 +491,9 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) /* Raises an error if the user try to add manually a special primary key on the relationship and the relationship type is not generalization or copy */ - if((rel_type==RELATIONSHIP_GEN || - rel_type==RELATIONSHIP_DEP || - rel_type==RELATIONSHIP_PART) && + if((rel_type==RelationshipGen || + rel_type==RelationshipDep || + rel_type==RelationshipPart) && !(tab_obj->isAddedByRelationship() && tab_obj->isProtected() && tab_obj->getObjectType()==ObjConstraint)) @@ -621,8 +621,8 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) { constr=dynamic_cast(*itr); //Check is the column is referenced by one relationship constraints - refer=(constr->getColumn(col->getName(), Constraint::SOURCE_COLS) || - constr->getColumn(col->getName(), Constraint::REFERENCED_COLS)); + refer=(constr->getColumn(col->getName(), Constraint::SourceCols) || + constr->getColumn(col->getName(), Constraint::ReferencedCols)); itr++; } @@ -829,7 +829,7 @@ void Relationship::addConstraints(Table *recv_tab) if(constr->getConstraintType()!=ConstraintType::primary_key) { - constr->setName(PgModelerNS::generateUniqueName(constr, (*recv_tab->getObjectList(ObjConstraint)))); + constr->setName(PgModelerNs::generateUniqueName(constr, (*recv_tab->getObjectList(ObjConstraint)))); recv_tab->addConstraint(constr); } else @@ -842,12 +842,12 @@ void Relationship::addConstraints(Table *recv_tab) if(pk) { - count=constr->getColumnCount(Constraint::SOURCE_COLS); + count=constr->getColumnCount(Constraint::SourceCols); for(i=0; i < count; i++) //Adds the colums from the constraint into the table's primary key - pk->addColumn(constr->getColumn(i, Constraint::SOURCE_COLS), - Constraint::SOURCE_COLS); + pk->addColumn(constr->getColumn(i, Constraint::SourceCols), + Constraint::SourceCols); } else //Case the table doens't has a primary key the constraint will the be it @@ -907,7 +907,7 @@ void Relationship::addColumnsRelGenPart(void) /* If the relationship is partitioning the destination table (partitioned) shoud have * a partitioning type defined otherwise and error is raised */ - if(rel_type == RELATIONSHIP_PART && !dst_tab->isPartitioned()) + if(rel_type == RelationshipPart && !dst_tab->isPartitioned()) throw Exception(Exception::getErrorMessage(InvPartitioningTypePartRel) .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), InvPartitioningTypePartRel, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -993,7 +993,7 @@ void Relationship::addColumnsRelGenPart(void) else { parent_tab=aux_tab->getCopyTable(); - cond=(parent_tab && rel_type == RELATIONSHIP_DEP && + cond=(parent_tab && rel_type == RelationshipDep && aux_col->getParentTable()==parent_tab && aux_col->isAddedByCopy()); } @@ -1008,7 +1008,7 @@ void Relationship::addColumnsRelGenPart(void) column is from the table itself or it came from a copy table and the destination column is from the destination table or came from a copy table of the destination table itself */ - if((rel_type==RELATIONSHIP_DEP) && + if((rel_type==RelationshipDep) && ((!src_flags[0] && !src_flags[1]) || (!src_flags[0] && src_flags[1])) && @@ -1020,7 +1020,7 @@ void Relationship::addColumnsRelGenPart(void) } /* Error condition 2: The relationship type is generalization and the column * types is incompatible */ - else if((rel_type == RELATIONSHIP_GEN || rel_type==RELATIONSHIP_PART) && src_type != dst_type) + else if((rel_type == RelationshipGen || rel_type==RelationshipPart) && src_type != dst_type) err_code=InvInheritRelationshipIncompCols; } } @@ -1036,7 +1036,7 @@ void Relationship::addColumnsRelGenPart(void) (*column)=(*dst_col); - if(rel_type==RELATIONSHIP_GEN) + if(rel_type==RelationshipGen) column->setAddedByGeneralization(true); else column->setAddedByCopy(true); @@ -1064,7 +1064,7 @@ void Relationship::addColumnsRelGenPart(void) } } - if((src_tab->getColumnCount() + columns.size()) != dst_tab->getColumnCount() && rel_type == RELATIONSHIP_PART) + if((src_tab->getColumnCount() + columns.size()) != dst_tab->getColumnCount() && rel_type == RelationshipPart) err_code = InvColumnCountPartRel; //In case that no duplicity error is detected @@ -1184,7 +1184,7 @@ void Relationship::connectRelationship(void) { if(!connected) { - if(rel_type==RELATIONSHIP_GEN) + if(rel_type==RelationshipGen) { //Copying the CHECK constraints before adding custom constraints like special pk addConstraintsRelGenPart(); @@ -1195,7 +1195,7 @@ void Relationship::connectRelationship(void) //The reference table is added as parent table on the receiver getReceiverTable()->addAncestorTable(dynamic_cast
(getReferenceTable())); } - else if(rel_type==RELATIONSHIP_DEP) + else if(rel_type==RelationshipDep) { //Creates the columns on the receiver table following the rules for copy rules addColumnsRelGenPart(); @@ -1204,7 +1204,7 @@ void Relationship::connectRelationship(void) getReceiverTable()->setCopyTable(dynamic_cast
(getReferenceTable())); getReceiverTable()->setCopyTableOptions(this->copy_options); } - else if(rel_type == RELATIONSHIP_PART) + else if(rel_type == RelationshipPart) { //Copying the CHECK constraints before adding custom constraints like special pk addConstraintsRelGenPart(); @@ -1214,15 +1214,15 @@ void Relationship::connectRelationship(void) getReceiverTable()->setPartionedTable(dynamic_cast
(getReferenceTable())); getReceiverTable()->setPartitionBoundingExpr(part_bounding_expr); } - else if(rel_type==RELATIONSHIP_11 || - rel_type==RELATIONSHIP_1N) + else if(rel_type==Relationship11 || + rel_type==Relationship1n) { - if(rel_type==RELATIONSHIP_11) + if(rel_type==Relationship11) addColumnsRel11(); else addColumnsRel1n(); } - else if(rel_type==RELATIONSHIP_NN) + else if(rel_type==RelationshipNn) { if(!table_relnn) //Allocates the table that represents the Many-to-Many relationship @@ -1297,7 +1297,7 @@ void Relationship::configureIndentifierRel(Table *recv_tab) //Adds the columns from the strong entity primary key on the weak entity primary key count=gen_columns.size(); for(i=0; i < count; i++) - pk->addColumn(gen_columns[i], Constraint::SOURCE_COLS); + pk->addColumn(gen_columns[i], Constraint::SourceCols); //Inserts the configured primary key on the receiver table (if there is no pk on it) if(new_pk) @@ -1317,7 +1317,7 @@ void Relationship::configureIndentifierRel(Table *recv_tab) pk=recv_tab->getPrimaryKey(); count=gen_columns.size(); for(i=0; i < count; i++) - pk->removeColumn(gen_columns[i]->getName(), Constraint::SOURCE_COLS); + pk->removeColumn(gen_columns[i]->getName(), Constraint::SourceCols); } pk_relident=nullptr; @@ -1350,11 +1350,11 @@ void Relationship::addUniqueKey(Table *recv_tab) i=0; while(i < count) - uq->addColumn(gen_columns[i++], Constraint::SOURCE_COLS); + uq->addColumn(gen_columns[i++], Constraint::SourceCols); uq->setName(generateObjectName(UQ_PATTERN)); uq->setAlias(generateObjectName(UQ_PATTERN, nullptr, true)); - uq->setName(PgModelerNS::generateUniqueName(uq, (*recv_tab->getObjectList(ObjConstraint)))); + uq->setName(PgModelerNs::generateUniqueName(uq, (*recv_tab->getObjectList(ObjConstraint)))); recv_tab->addConstraint(uq); } catch(Exception &e) @@ -1380,8 +1380,8 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del try { //Alocates the foreign key - if((rel_type==RELATIONSHIP_NN) || - (!fk_rel1n && (rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N))) + if((rel_type==RelationshipNn) || + (!fk_rel1n && (rel_type==Relationship11 || rel_type==Relationship1n))) { fk=new Constraint; fk->setDeferrable(this->deferrable); @@ -1394,13 +1394,13 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del /* The configured fk is assigned to the relatioship attibute in order to be manipulated more easily */ - if(rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N) + if(rel_type==Relationship11 || rel_type==Relationship1n) fk_rel1n=fk; } //Sets the ON DELETE and ON UPDATE actions for the foreign key - fk->setActionType(del_act, Constraint::DELETE_ACTION); - fk->setActionType(upd_act, Constraint::UPDATE_ACTION); + fk->setActionType(del_act, Constraint::DeleteAction); + fk->setActionType(upd_act, Constraint::UpdateAction); /* Gets the primary key from the reference table in order to reference its columns on the primary key */ @@ -1425,7 +1425,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del of the target table. The first column related to the destination table column list always has its index starting at the existant columns count on the primary key on the source table because they is always inserted after this position. */ - if(rel_type==RELATIONSHIP_NN) + if(rel_type==RelationshipNn) { vector fks; @@ -1438,30 +1438,30 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del if((!isSelfRelationship() && ref_tab==src_table) || //Condition to create the first fk on the self relationship (isSelfRelationship() && fks.size()==0)) - qty-=dynamic_cast
(dst_table)->getPrimaryKey()->getColumnCount(Constraint::SOURCE_COLS); + qty-=dynamic_cast
(dst_table)->getPrimaryKey()->getColumnCount(Constraint::SourceCols); //Case 2: shifiting the scan index else if(ref_tab==dst_table) { pk_aux=dynamic_cast
(src_table)->getPrimaryKey(); - i=pk_aux->getColumnCount(Constraint::SOURCE_COLS); + i=pk_aux->getColumnCount(Constraint::SourceCols); } } while(i < qty) { column=gen_columns[i]; - column_aux=pk->getColumn(i1, Constraint::SOURCE_COLS); + column_aux=pk->getColumn(i1, Constraint::SourceCols); //Link the two columns on the foreign key - fk->addColumn(column, Constraint::SOURCE_COLS); - fk->addColumn(column_aux, Constraint::REFERENCED_COLS); + fk->addColumn(column, Constraint::SourceCols); + fk->addColumn(column_aux, Constraint::ReferencedCols); i++; i1++; } //Configures the foreign key name aux.clear(); - if(rel_type!=RELATIONSHIP_NN) + if(rel_type!=RelationshipNn) { name=generateObjectName(SRC_FK_PATTERN); fk_alias=generateObjectName(SRC_FK_PATTERN, nullptr, true); @@ -1482,7 +1482,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del fk->setName(name); fk->setAlias(fk_alias); - fk->setName(PgModelerNS::generateUniqueName(fk, (*recv_tab->getObjectList(ObjConstraint)))); + fk->setName(PgModelerNs::generateUniqueName(fk, (*recv_tab->getObjectList(ObjConstraint)))); recv_tab->addConstraint(fk); } catch(Exception &e) @@ -1516,7 +1516,7 @@ void Relationship::addAttributes(Table *recv_tab) if(column->getParentTable()) break; - column->setName(PgModelerNS::generateUniqueName(column, (*recv_tab->getObjectList(ObjColumn)))); + column->setName(PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjColumn)))); column->setAddedByLinking(true); column->setParentRelationship(this); recv_tab->addColumn(column); @@ -1550,15 +1550,15 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b /* Raises an error if some table doesn't has a primary key if the relationship is 1-1, 1-n or n-n */ - if((!src_pk && (rel_type==RELATIONSHIP_1N || rel_type==RELATIONSHIP_11)) || - (!src_pk && !dst_pk && rel_type==RELATIONSHIP_NN)) + if((!src_pk && (rel_type==Relationship1n || rel_type==Relationship11)) || + (!src_pk && !dst_pk && rel_type==RelationshipNn)) throw Exception(Exception::getErrorMessage(InvLinkTablesNoPrimaryKey) .arg(this->obj_name) .arg(ref_tab->getName(true)) .arg(recv_tab->getName(true)), InvLinkTablesNoPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); - count=pk->getColumnCount(Constraint::SOURCE_COLS); + count=pk->getColumnCount(Constraint::SourceCols); /* Scans the primary key columns adding them to the referenced column list of the relationship */ @@ -1568,7 +1568,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b gen_columns.push_back(column); //Add the current primary key source column on the list - column_aux=pk->getColumn(i, Constraint::SOURCE_COLS); + column_aux=pk->getColumn(i, Constraint::SourceCols); pk_columns.push_back(column_aux); (*column)=(*column_aux); @@ -1578,7 +1578,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b prev_name=prev_ref_col_names[column_aux->getObjectId()]; - if(rel_type!=RELATIONSHIP_NN) + if(rel_type!=RelationshipNn) { name=generateObjectName(SRC_COL_PATTERN, column_aux); col_alias=generateObjectName(SRC_COL_PATTERN, column_aux, true); @@ -1615,7 +1615,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b column->setType(PgSQLType(QString("smallint"))); column->setName(name); - name=PgModelerNS::generateUniqueName(column, (*recv_tab->getObjectList(ObjColumn))); + name=PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjColumn))); column->setName(name); if(!prev_name.isEmpty()) @@ -1631,7 +1631,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b by the relationship. This operation is only performed for relationships 1-1, 1-n relationships to the n-n relationships columns are always recreated without the need to keep the history because the user can not reference the columns created by n-n relationships. */ - if(prev_name!=name && (rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N)) + if(prev_name!=name && (rel_type==Relationship11 || rel_type==Relationship1n)) prev_ref_col_names[column_aux->getObjectId()]=column->getName(); recv_tab->addColumn(column); @@ -1676,8 +1676,8 @@ void Relationship::addColumnsRel11(void) else { //Case the reference table is mandatory participation set as RESTRICT the delete action on the foreign key - if((ref_tab==this->src_table && this->isTableMandatory(SRC_TABLE)) || - (ref_tab==this->dst_table && this->isTableMandatory(DST_TABLE))) + if((ref_tab==this->src_table && this->isTableMandatory(SrcTable)) || + (ref_tab==this->dst_table && this->isTableMandatory(DstTable))) del_action=ActionType::restrict; else del_action=ActionType::set_null; @@ -1694,19 +1694,19 @@ void Relationship::addColumnsRel11(void) } else { - copyColumns(ref_tab, recv_tab, (!identifier && (this->isTableMandatory(SRC_TABLE) || this->isTableMandatory(DST_TABLE)))); + copyColumns(ref_tab, recv_tab, (!identifier && (this->isTableMandatory(SrcTable) || this->isTableMandatory(DstTable)))); if(identifier) { /* When the relationship is identifier, the cardinalities are ignored because the strong entity always is of mandatory participation. */ - this->setMandatoryTable(DST_TABLE, false); - this->setMandatoryTable(SRC_TABLE, false); + this->setMandatoryTable(DstTable, false); + this->setMandatoryTable(SrcTable, false); if(ref_tab==this->src_table) - this->setMandatoryTable(SRC_TABLE, true); + this->setMandatoryTable(SrcTable, true); else - this->setMandatoryTable(DST_TABLE, true); + this->setMandatoryTable(DstTable, true); configureIndentifierRel(recv_tab); } @@ -1786,8 +1786,8 @@ void Relationship::addColumnsRel1n(void) if(identifier) { - this->setMandatoryTable(SRC_TABLE, true); - this->setMandatoryTable(DST_TABLE, false); + this->setMandatoryTable(SrcTable, true); + this->setMandatoryTable(DstTable, false); configureIndentifierRel(recv_tab); } else @@ -1860,12 +1860,12 @@ void Relationship::addColumnsRelNn(void) for(auto &col : gen_columns) { col->setNotNull(true); - pk_tabnn->addColumn(col, Constraint::SOURCE_COLS); + pk_tabnn->addColumn(col, Constraint::SourceCols); } } else { - pk_tabnn->addColumn(pk_col, Constraint::SOURCE_COLS); + pk_tabnn->addColumn(pk_col, Constraint::SourceCols); for(auto &col : gen_columns) col->setNotNull(true); @@ -1874,7 +1874,7 @@ void Relationship::addColumnsRelNn(void) for(unsigned i : column_ids_pk_rel) { if(i < rel_attributes.size()) - pk_tabnn->addColumn(dynamic_cast(rel_attributes[i]), Constraint::SOURCE_COLS); + pk_tabnn->addColumn(dynamic_cast(rel_attributes[i]), Constraint::SourceCols); } table_relnn->addConstraint(pk_tabnn); @@ -1902,7 +1902,7 @@ Table *Relationship::getReferenceTable(void) { /* Many to Many relationships doesn't has only one reference table so is returned nullptr */ - if(rel_type==RELATIONSHIP_NN) + if(rel_type==RelationshipNn) return(nullptr); else { @@ -1915,7 +1915,7 @@ Table *Relationship::getReferenceTable(void) void Relationship::setSiglePKColumn(bool value) { - if(rel_type==RELATIONSHIP_NN) + if(rel_type==RelationshipNn) { single_pk_column=value; this->invalidated=(single_pk_column!=value); @@ -1929,7 +1929,7 @@ bool Relationship::isSiglePKColumn(void) Table *Relationship::getReceiverTable(void) { - if(rel_type==RELATIONSHIP_11) + if(rel_type==Relationship11) { /* Case 1: (0,1) ---<>--- (0,1) Case 2: (1,1) ---<>--- (0,1) */ @@ -1947,13 +1947,13 @@ Table *Relationship::getReceiverTable(void) } /* For 1-n relationships, the table order is unchagned this means that the columns are always included in the destination table */ - else if(rel_type==RELATIONSHIP_1N) + else if(rel_type==Relationship1n) return(dynamic_cast
(dst_table)); /* For generalization / copy relationships the columns are always added in the source table */ - else if(rel_type==RELATIONSHIP_GEN || - rel_type==RELATIONSHIP_DEP || - rel_type==RELATIONSHIP_PART) + else if(rel_type==RelationshipGen || + rel_type==RelationshipDep || + rel_type==RelationshipPart) return(dynamic_cast
(src_table)); //For n-n relationships, the columns are added in the table that represents the relationship (table_relnn) else @@ -2026,18 +2026,18 @@ void Relationship::removeColumnsFromTablePK(Table *table) if(pk) { - count=pk->getColumnCount(Constraint::SOURCE_COLS); + count=pk->getColumnCount(Constraint::SourceCols); for(i=0; i < count; i++) { - column=pk->getColumn(i, Constraint::SOURCE_COLS); + column=pk->getColumn(i, Constraint::SourceCols); //Case the column was added by relationship and it belongs to the relationship if(column->isAddedByRelationship() && (isColumnExists(column) || getObjectIndex(column) >= 0)) { //Removes the column from primary key - pk->removeColumn(column->getName(), Constraint::SOURCE_COLS); + pk->removeColumn(column->getName(), Constraint::SourceCols); i--; count--; } } @@ -2056,13 +2056,13 @@ void Relationship::removeColumnFromTablePK(Table *table, Column *column) if(pk) { - count=pk->getColumnCount(Constraint::SOURCE_COLS); + count=pk->getColumnCount(Constraint::SourceCols); for(i=0; i < count; i++) { - if(column==pk->getColumn(i, Constraint::SOURCE_COLS)) + if(column==pk->getColumn(i, Constraint::SourceCols)) { - pk->removeColumn(column->getName(), Constraint::SOURCE_COLS); + pk->removeColumn(column->getName(), Constraint::SourceCols); break; } } @@ -2090,7 +2090,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) vector::iterator itr_atrib, itr_atrib_end; TableObject *tab_obj=nullptr; - if(rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_DEP || rel_type== RELATIONSHIP_PART) + if(rel_type==RelationshipGen || rel_type==RelationshipDep || rel_type== RelationshipPart) { table=getReceiverTable(); @@ -2109,7 +2109,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) table->addObject(pk_original); } - if(rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_PART) + if(rel_type==RelationshipGen || rel_type==RelationshipPart) { while(!ck_constraints.empty()) { @@ -2119,9 +2119,9 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) } } - if(rel_type==RELATIONSHIP_GEN) + if(rel_type==RelationshipGen) table->removeObject(getReferenceTable()); - else if(rel_type == RELATIONSHIP_PART) + else if(rel_type == RelationshipPart) table->setPartionedTable(nullptr); else table->setCopyTable(nullptr); @@ -2134,7 +2134,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) /* In case of relationship 1-1 and 1-n is necessary remove the foreign key that represents the relationship furthermore columns added to primary key (in case of a identifier relationship) must be removed */ - if(fk_rel1n && (rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N)) + if(fk_rel1n && (rel_type==Relationship11 || rel_type==Relationship1n)) { table=getReceiverTable(); @@ -2196,7 +2196,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) table->addObject(pk_original); } } - else if(rel_type==RELATIONSHIP_NN) + else if(rel_type==RelationshipNn) { //In case of n-n relationship destroy the added constraints count=table_relnn->getConstraintCount(); @@ -2353,7 +2353,7 @@ bool Relationship::isInvalidated(void) { /* Checking if the tables were renamed. For 1:1, 1:n and n:n this situation may cause the renaming of all generated objects */ - if((rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N || rel_type==RELATIONSHIP_NN) && + if((rel_type==Relationship11 || rel_type==Relationship1n || rel_type==RelationshipNn) && (src_tab_prev_name!=src_table->getName() || dst_tab_prev_name!=dst_table->getName())) return(true); @@ -2361,12 +2361,12 @@ bool Relationship::isInvalidated(void) invalidation of the relationship is based on the comparison of amount of foreign key columns and the number of columns of primary key from the source table */ - if(rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N) + if(rel_type==Relationship11 || rel_type==Relationship1n) { table=getReferenceTable(); //Gets the source columns from the foreign key that represents the relationship - rel_cols_count=fk_rel1n->getColumnCount(Constraint::SOURCE_COLS); + rel_cols_count=fk_rel1n->getColumnCount(Constraint::SourceCols); //The relationship is invalidated if the reference table doesn't has a primary key pk=table->getPrimaryKey(); @@ -2374,7 +2374,7 @@ bool Relationship::isInvalidated(void) if(pk) { //Gets the amount of columns from the primary key - tab_cols_count=pk->getColumnCount(Constraint::SOURCE_COLS); + tab_cols_count=pk->getColumnCount(Constraint::SourceCols); //Compares the column quantity valid=(rel_cols_count==tab_cols_count); @@ -2390,7 +2390,7 @@ bool Relationship::isInvalidated(void) /* This third columns is get from the table primary key and will be checked if the columns addresses is the same. If not the relationship is invalidated */ - pk_col=pk->getColumn(i, Constraint::SOURCE_COLS); + pk_col=pk->getColumn(i, Constraint::SourceCols); /* To validate the columns with each other the following rules are followed: @@ -2416,7 +2416,7 @@ bool Relationship::isInvalidated(void) /* For copy / generalization relationships, is obtained the number of columns created when connecting it and comparing with the number of columns of the source table */ - else if(rel_type==RELATIONSHIP_DEP || rel_type==RELATIONSHIP_GEN || rel_type==RELATIONSHIP_PART) + else if(rel_type==RelationshipDep || rel_type==RelationshipGen || rel_type==RelationshipPart) { table=getReferenceTable(); table1=getReceiverTable(); @@ -2442,7 +2442,7 @@ bool Relationship::isInvalidated(void) } // Specific for partition relatoinship: check if all the columns on the source table (partition) exist on the partitioned table - if(rel_type==RELATIONSHIP_PART) + if(rel_type==RelationshipPart) { count = table1->getColumnCount(); valid = table->isPartitioned(); @@ -2486,7 +2486,7 @@ bool Relationship::isInvalidated(void) 2) It is necessary to validate if the names of the table columns generated matches the column names of the originating tables */ - else if(rel_type==RELATIONSHIP_NN) + else if(rel_type==RelationshipNn) { table=dynamic_cast
(src_table); table1=dynamic_cast
(dst_table); @@ -2510,35 +2510,35 @@ bool Relationship::isInvalidated(void) /* The number of columns of relationship is calculated by summing quantities of foreign key columns obtained */ - rel_cols_count=fk->getColumnCount(Constraint::REFERENCED_COLS) + fk1->getColumnCount(Constraint::REFERENCED_COLS); + rel_cols_count=fk->getColumnCount(Constraint::ReferencedCols) + fk1->getColumnCount(Constraint::ReferencedCols); /* The number of columns in the table is obtained by summing the amount of primary keys columns involved in the relationship */ - tab_cols_count=table->getPrimaryKey()->getColumnCount(Constraint::SOURCE_COLS) + - table1->getPrimaryKey()->getColumnCount(Constraint::SOURCE_COLS); + tab_cols_count=table->getPrimaryKey()->getColumnCount(Constraint::SourceCols) + + table1->getPrimaryKey()->getColumnCount(Constraint::SourceCols); valid=(rel_cols_count == tab_cols_count); // Checking if the columns created with the connection still exists in reference table - count=fk->getColumnCount(Constraint::SOURCE_COLS); + count=fk->getColumnCount(Constraint::SourceCols); pk=table->getPrimaryKey(); for(i=0; i < count && valid; i++) { - gen_col=fk->getColumn(i, Constraint::SOURCE_COLS); - pk_col=pk->getColumn(i, Constraint::SOURCE_COLS); + gen_col=fk->getColumn(i, Constraint::SourceCols); + pk_col=pk->getColumn(i, Constraint::SourceCols); valid=(gen_col->getName()==generateObjectName(SRC_COL_PATTERN, pk_col) || gen_col->getName().contains(pk_col->getName())); } // Checking if the columns created with the connection still exists in receiver table - count=fk1->getColumnCount(Constraint::SOURCE_COLS); + count=fk1->getColumnCount(Constraint::SourceCols); pk=table1->getPrimaryKey(); for(i=0; i < count && valid; i++) { - gen_col=fk1->getColumn(i, Constraint::SOURCE_COLS); - pk_col=pk->getColumn(i, Constraint::SOURCE_COLS); + gen_col=fk1->getColumn(i, Constraint::SourceCols); + pk_col=pk->getColumn(i, Constraint::SourceCols); valid=(gen_col->getName()==generateObjectName(DST_COL_PATTERN, pk_col) || gen_col->getName().contains(pk_col->getName())); } @@ -2557,7 +2557,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { - if(fk_rel1n && (rel_type==RELATIONSHIP_11 || rel_type==RELATIONSHIP_1N)) + if(fk_rel1n && (rel_type==Relationship11 || rel_type==Relationship1n)) { unsigned count, i; @@ -2577,7 +2577,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); } - else if(table_relnn && rel_type==RELATIONSHIP_NN) + else if(table_relnn && rel_type==RelationshipNn) { unsigned count, i; @@ -2592,7 +2592,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::CONSTRAINTS]+=table_relnn->getConstraint(i)->getCodeDefinition(def_type, true); } } - else if(rel_type==RELATIONSHIP_GEN) + else if(rel_type==RelationshipGen) { attributes[ParsersAttributes::RELATIONSHIP_GEN]=ParsersAttributes::_TRUE_; attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); @@ -2614,9 +2614,9 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::DEL_ACTION]=~del_action; attributes[ParsersAttributes::TABLE_NAME]=tab_name_relnn; - attributes[ParsersAttributes::RELATIONSHIP_GEN]=(rel_type==RELATIONSHIP_GEN ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RELATIONSHIP_DEP]=(rel_type==RELATIONSHIP_DEP ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RELATIONSHIP_PART]=(rel_type==RELATIONSHIP_PART ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RELATIONSHIP_GEN]=(rel_type==RelationshipGen ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RELATIONSHIP_DEP]=(rel_type==RelationshipDep ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RELATIONSHIP_PART]=(rel_type==RelationshipPart ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::SRC_COL_PATTERN]=name_patterns[SRC_COL_PATTERN]; attributes[ParsersAttributes::DST_COL_PATTERN]=name_patterns[DST_COL_PATTERN]; @@ -2707,7 +2707,7 @@ void Relationship::operator = (Relationship &rel) QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) { - if(rel_type != RELATIONSHIP_GEN && rel_type != RELATIONSHIP_PART) + if(rel_type != RelationshipGen && rel_type != RelationshipPart) return(QString()); attributes[ParsersAttributes::INHERIT]=QString(); @@ -2715,7 +2715,7 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) attributes[ParsersAttributes::PARTITIONED_TABLE]=QString(); attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); - if(rel_type == RELATIONSHIP_GEN) + if(rel_type == RelationshipGen) { attributes[ParsersAttributes::INHERIT]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::_TRUE_); attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); @@ -2735,18 +2735,18 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) bool Relationship::isReferenceTableMandatory(void) { - if(rel_type == BaseRelationship::RELATIONSHIP_11 && getReferenceTable() == dst_table && !src_mandatory) + if(rel_type == BaseRelationship::Relationship11 && getReferenceTable() == dst_table && !src_mandatory) return(dst_mandatory); else - return((getReferenceTable() == src_table && isTableMandatory(SRC_TABLE)) || - (getReferenceTable() == dst_table && isTableMandatory(DST_TABLE))); + return((getReferenceTable() == src_table && isTableMandatory(SrcTable)) || + (getReferenceTable() == dst_table && isTableMandatory(DstTable))); } bool Relationship::isReceiverTableMandatory(void) { - if(rel_type == BaseRelationship::RELATIONSHIP_11 && getReferenceTable() == dst_table && !src_mandatory) + if(rel_type == BaseRelationship::Relationship11 && getReferenceTable() == dst_table && !src_mandatory) return(false); else - return((getReceiverTable() == src_table && isTableMandatory(SRC_TABLE)) || - (getReceiverTable() == dst_table && isTableMandatory(DST_TABLE))); + return((getReceiverTable() == src_table && isTableMandatory(SrcTable)) || + (getReceiverTable() == dst_table && isTableMandatory(DstTable))); } diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index f04a34bebf..69acaac961 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -2002,7 +2002,7 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi value=QString("DEFAULT"); } //Unescaped values will not be enclosed in quotes - else if(value.startsWith(PgModelerNS::UNESC_VALUE_START) && value.endsWith(PgModelerNS::UNESC_VALUE_END)) + else if(value.startsWith(PgModelerNs::UNESC_VALUE_START) && value.endsWith(PgModelerNs::UNESC_VALUE_END)) { value.remove(0,1); value.remove(value.length()-1, 1); @@ -2010,8 +2010,8 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi //Quoting value else { - value.replace(QString("\\") + PgModelerNS::UNESC_VALUE_START, PgModelerNS::UNESC_VALUE_START); - value.replace(QString("\\") + PgModelerNS::UNESC_VALUE_END, PgModelerNS::UNESC_VALUE_END); + value.replace(QString("\\") + PgModelerNs::UNESC_VALUE_START, PgModelerNs::UNESC_VALUE_START); + value.replace(QString("\\") + PgModelerNs::UNESC_VALUE_END, PgModelerNs::UNESC_VALUE_END); value.replace(QString("\'"), QString("''")); value.replace(QChar(QChar::LineFeed), QString("\\n")); value=QString("E'") + value + QString("'"); diff --git a/libpgmodeler_ui/src/aboutwidget.cpp b/libpgmodeler_ui/src/aboutwidget.cpp index 51c7340de8..9eb5bb9045 100644 --- a/libpgmodeler_ui/src/aboutwidget.cpp +++ b/libpgmodeler_ui/src/aboutwidget.cpp @@ -31,10 +31,10 @@ AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent) drop_shadow->setBlurRadius(30); this->setGraphicsEffect(drop_shadow); - PgModelerUiNS::configureWidgetFont(title_lbl, PgModelerUiNS::HUGE_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNS::HUGE_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(build_lbl, PgModelerUiNS::BIG_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(build_num_lbl, PgModelerUiNS::BIG_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::HUGE_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNs::HUGE_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(build_lbl, PgModelerUiNs::BIG_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(build_num_lbl, PgModelerUiNs::BIG_FONT_FACTOR); pgmodeler_ver_lbl->setText(QString("v%1 ").arg(GlobalAttributes::PgModelerVersion)); build_num_lbl->setText(QString("%1 Qt %2").arg(GlobalAttributes::PgModelerBuildNumber).arg(QT_VERSION_STR)); diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index 45857e3d5c..c55d52bffc 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -98,8 +98,8 @@ void AggregateWidget::setAttributes(DatabaseModel *model, OperationList *op_list if(aggregate) { - final_func_sel->setSelectedObject(aggregate->getFunction(Aggregate::FINAL_FUNC)); - transition_func_sel->setSelectedObject(aggregate->getFunction(Aggregate::TRANSITION_FUNC)); + final_func_sel->setSelectedObject(aggregate->getFunction(Aggregate::FinalFunc)); + transition_func_sel->setSelectedObject(aggregate->getFunction(Aggregate::TransitionFunc)); sort_op_sel->setSelectedObject(aggregate->getSortOperator()); initial_cond_txt->setPlainText(aggregate->getInitialCondition()); @@ -158,8 +158,8 @@ void AggregateWidget::applyConfiguration(void) for(i=0; i < count; i++) aggregate->addDataType(input_types_tab->getRowData(i).value()); - aggregate->setFunction(Aggregate::TRANSITION_FUNC, dynamic_cast(transition_func_sel->getSelectedObject())); - aggregate->setFunction(Aggregate::FINAL_FUNC, dynamic_cast(final_func_sel->getSelectedObject())); + aggregate->setFunction(Aggregate::TransitionFunc, dynamic_cast(transition_func_sel->getSelectedObject())); + aggregate->setFunction(Aggregate::FinalFunc, dynamic_cast(final_func_sel->getSelectedObject())); aggregate->setSortOperator(dynamic_cast(sort_op_sel->getSelectedObject())); BaseObjectWidget::applyConfiguration(); diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index fbe35e4222..8e70e967ba 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -165,7 +165,7 @@ void BaseConfigWidget::loadConfiguration(const QString &conf_id, mapgetConfigurationParams(config_params, key_attribs); - if(xmlparser.hasElement(XMLParser::ChildElement, XML_ELEMENT_NODE)) + if(xmlparser.hasElement(XmlParser::ChildElement, XML_ELEMENT_NODE)) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); if(xmlparser.getElementType()!=XML_TEXT_NODE) { @@ -184,14 +184,14 @@ void BaseConfigWidget::loadConfiguration(const QString &conf_id, mapgetConfigurationParams(config_params, key_attribs); } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } xmlparser.restorePosition(); } } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -223,10 +223,10 @@ void BaseConfigWidget::getConfigurationParams(map &config_ key=xmlparser.getElementName(); //Extract the contents of the child element and create a special element on map called "_contents_" - if(xmlparser.hasElement(XMLParser::ChildElement, XML_TEXT_NODE)) + if(xmlparser.hasElement(XmlParser::ChildElement, XML_TEXT_NODE)) { xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); aux_attribs[ParsersAttributes::CONTENTS]=xmlparser.getElementContent(); xmlparser.restorePosition(); } diff --git a/libpgmodeler_ui/src/baseconfigwidget.h b/libpgmodeler_ui/src/baseconfigwidget.h index 9225a529ba..a7cb87e899 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.h +++ b/libpgmodeler_ui/src/baseconfigwidget.h @@ -40,7 +40,7 @@ class BaseConfigWidget: public QWidget { bool config_changed; protected: - XMLParser xmlparser; + XmlParser xmlparser; SchemaParser schparser; /*! \brief Saves the configuration params on file. The conf_id param indicates the type of diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 65d41e16a5..d55d4499ac 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -52,7 +52,7 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge tablespace_sel=nullptr; object_protected = false; - PgModelerUiNS::configureWidgetFont(protected_obj_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(protected_obj_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); connect(edt_perms_tb, SIGNAL(clicked(bool)),this, SLOT(editPermissions(void))); connect(append_sql_tb, SIGNAL(clicked(bool)),this, SLOT(editCustomSQL(void))); @@ -475,7 +475,7 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ if(obj_type!=ObjBaseObject) { - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(obj_type))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(obj_type))); obj_icon_lbl->setToolTip(BaseObject::getTypeName(obj_type)); if(obj_type!=ObjPermission && obj_type!=ObjCast) @@ -495,7 +495,7 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ { QFrame *frame=nullptr; map > fields_map; - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion91)].push_back(collation_lbl); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion91)].push_back(collation_lbl); frame=generateVersionWarningFrame(fields_map); baseobject_grid->addWidget(frame, baseobject_grid->count()+1, 0, 1, 0); frame->setParent(this); @@ -520,11 +520,11 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ QString BaseObjectWidget::generateVersionsInterval(unsigned ver_interv_id, const QString &ini_ver, const QString &end_ver) { if(ver_interv_id==UNTIL_VERSION && !ini_ver.isEmpty()) - return(XMLParser::CharLt + QString("= ") + ini_ver); + return(XmlParser::CharLt + QString("= ") + ini_ver); else if(ver_interv_id==VERSIONS_INTERVAL && !ini_ver.isEmpty() && !end_ver.isEmpty()) - return(XMLParser::CharGt + QString("= ") + ini_ver + XMLParser::CharAmp + XMLParser::CharLt + QString("= ") + end_ver); + return(XmlParser::CharGt + QString("= ") + ini_ver + XmlParser::CharAmp + XmlParser::CharLt + QString("= ") + end_ver); else if(ver_interv_id==AFTER_VERSION && !ini_ver.isEmpty()) - return(XMLParser::CharGt + QString("= ") + ini_ver); + return(XmlParser::CharGt + QString("= ") + ini_ver); else return(QString()); } @@ -542,7 +542,7 @@ QFrame *BaseObjectWidget::generateInformationFrame(const QString &msg) font.setBold(false); info_frm->setFont(font); - PgModelerUiNS::configureWidgetFont(info_frm, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(info_frm, PgModelerUiNs::MEDIUM_FONT_FACTOR); info_frm->setObjectName("info_frm"); info_frm->setFrameShape(QFrame::StyledPanel); @@ -558,7 +558,7 @@ QFrame *BaseObjectWidget::generateInformationFrame(const QString &msg) ico_lbl->setMinimumSize(QSize(24, 24)); ico_lbl->setMaximumSize(QSize(24, 24)); ico_lbl->setScaledContents(true); - ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); ico_lbl->setAlignment(Qt::AlignLeft|Qt::AlignTop); grid->addWidget(ico_lbl, 0, 0, 1, 1); @@ -623,7 +623,7 @@ QFrame *BaseObjectWidget::generateVersionWarningFrame(mapsetObjectName("alerta_frm"); alert_frm->setFrameShape(QFrame::StyledPanel); @@ -638,7 +638,7 @@ QFrame *BaseObjectWidget::generateVersionWarningFrame(mapsetMinimumSize(QSize(24, 24)); ico_lbl->setMaximumSize(QSize(24, 24)); ico_lbl->setScaledContents(true); - ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); ico_lbl->setAlignment(Qt::AlignLeft|Qt::AlignTop); grid->addWidget(ico_lbl, 0, 0, 1, 1); @@ -792,7 +792,7 @@ void BaseObjectWidget::applyConfiguration(void) } if(!object->isProtected() && !object->isSystemObject()) - PgModelerUiNS::disableObjectSQL(object, disable_sql_chk->isChecked()); + PgModelerUiNs::disableObjectSQL(object, disable_sql_chk->isChecked()); } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/bugreportform.cpp b/libpgmodeler_ui/src/bugreportform.cpp index 51477f2079..9cb68822a2 100644 --- a/libpgmodeler_ui/src/bugreportform.cpp +++ b/libpgmodeler_ui/src/bugreportform.cpp @@ -30,7 +30,7 @@ BugReportForm::BugReportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(paren Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); - PgModelerUiNS::configureWidgetFont(hint_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(hint_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); connect(cancel_btn, SIGNAL(clicked(void)), this, SLOT(close(void))); connect(create_btn, SIGNAL(clicked(void)), this, SLOT(generateReport(void))); diff --git a/libpgmodeler_ui/src/castwidget.cpp b/libpgmodeler_ui/src/castwidget.cpp index 05bf13a2ef..7b92a7a117 100644 --- a/libpgmodeler_ui/src/castwidget.cpp +++ b/libpgmodeler_ui/src/castwidget.cpp @@ -71,14 +71,14 @@ void CastWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Cas if(cast) { - src_type=cast->getDataType(Cast::SRC_TYPE); - trg_type=cast->getDataType(Cast::DST_TYPE); + src_type=cast->getDataType(Cast::SrcType); + trg_type=cast->getDataType(Cast::DstType); conv_func_sel->setSelectedObject(cast->getCastFunction()); input_output_chk->setChecked(cast->isInOut()); - explicit_rb->setChecked(cast->getCastType()==Cast::EXPLICIT); - implicit_rb->setChecked(cast->getCastType()==Cast::IMPLICIT); - assignment_rb->setChecked(cast->getCastType()==Cast::ASSIGNMENT); + explicit_rb->setChecked(cast->getCastType()==Cast::Explicit); + implicit_rb->setChecked(cast->getCastType()==Cast::Implicit); + assignment_rb->setChecked(cast->getCastType()==Cast::Assignment); } src_datatype->setAttributes(src_type,model); @@ -94,16 +94,16 @@ void CastWidget::applyConfiguration(void) startConfiguration(); cast=dynamic_cast(this->object); - cast->setDataType(Cast::SRC_TYPE, src_datatype->getPgSQLType()); - cast->setDataType(Cast::DST_TYPE, trg_datatype->getPgSQLType()); + cast->setDataType(Cast::SrcType, src_datatype->getPgSQLType()); + cast->setDataType(Cast::DstType, trg_datatype->getPgSQLType()); cast->setInOut(input_output_chk->isChecked()); if(implicit_rb->isChecked()) - cast->setCastType(Cast::IMPLICIT); + cast->setCastType(Cast::Implicit); else if(assignment_rb->isChecked()) - cast->setCastType(Cast::ASSIGNMENT); + cast->setCastType(Cast::Assignment); else - cast->setCastType(Cast::EXPLICIT); + cast->setCastType(Cast::Explicit); cast->setCastFunction(dynamic_cast(conv_func_sel->getSelectedObject())); diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index df4d4f8679..c792aabd15 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -49,7 +49,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool vbox->setSpacing(6); completion_wgt->setLayout(vbox); - PgModelerUiNS::configureWidgetFont(name_list, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(name_list, PgModelerUiNs::MEDIUM_FONT_FACTOR); this->code_field_txt=code_field_txt; auto_triggered=false; @@ -228,7 +228,7 @@ void CodeCompletionWidget::configureCompletion(DatabaseModel *db_model, SyntaxHi clearCustomItems(); insertCustomItems(SnippetsConfigWidget::getAllSnippetsAttribute(ParsersAttributes::ID), SnippetsConfigWidget::getAllSnippetsAttribute(ParsersAttributes::LABEL), - QPixmap(PgModelerUiNS::getIconPath("codesnippet"))); + QPixmap(PgModelerUiNs::getIconPath("codesnippet"))); } } else @@ -259,7 +259,7 @@ void CodeCompletionWidget::insertCustomItems(const QStringList &names, const QSt void CodeCompletionWidget::insertCustomItems(const QStringList &names, const QString &tooltip, ObjectType obj_type) { for(auto &name : names) - insertCustomItem(name, tooltip, QPixmap(PgModelerUiNS::getIconPath(obj_type))); + insertCustomItem(name, tooltip, QPixmap(PgModelerUiNs::getIconPath(obj_type))); } void CodeCompletionWidget::clearCustomItems(void) @@ -295,7 +295,7 @@ void CodeCompletionWidget::populateNameList(vector &objects, QStri //The object will be inserted if its name matches the filter or there is no filter set if(filter.isEmpty() || regexp.exactMatch(obj_name)) { - item=new QListWidgetItem(QPixmap(PgModelerUiNS::getIconPath(objects[i]->getSchemaName())), obj_name); + item=new QListWidgetItem(QPixmap(PgModelerUiNs::getIconPath(objects[i]->getSchemaName())), obj_name); item->setToolTip(QString("%1 (%2)").arg(objects[i]->getName(true)).arg(objects[i]->getTypeName())); item->setData(Qt::UserRole, QVariant::fromValue(objects[i])); item->setToolTip(BaseObject::getTypeName(obj_type)); @@ -447,7 +447,7 @@ void CodeCompletionWidget::updateList(void) list=keywords.filter(regexp); for(int i=0; i < list.size(); i++) { - item=new QListWidgetItem(QPixmap(PgModelerUiNS::getIconPath("keyword")), list[i]); + item=new QListWidgetItem(QPixmap(PgModelerUiNs::getIconPath("keyword")), list[i]); item->setToolTip(trUtf8("SQL Keyword")); name_list->addItem(item); } diff --git a/libpgmodeler_ui/src/collationwidget.cpp b/libpgmodeler_ui/src/collationwidget.cpp index d9b7f4d903..78a28d6438 100644 --- a/libpgmodeler_ui/src/collationwidget.cpp +++ b/libpgmodeler_ui/src/collationwidget.cpp @@ -88,10 +88,10 @@ void CollationWidget::setAttributes(DatabaseModel *model, OperationList *op_list if(locale_cmb->currentIndex()==0) { - idx=lcctype_cmb->findText(collation->getLocalization(Collation::_LC_CTYPE)); + idx=lcctype_cmb->findText(collation->getLocalization(Collation::LcCtype)); lcctype_cmb->setCurrentIndex(idx < 0 ? 0 : idx); - idx=lccollate_cmb->findText(collation->getLocalization(Collation::_LC_COLLATE)); + idx=lccollate_cmb->findText(collation->getLocalization(Collation::LcCollate)); lccollate_cmb->setCurrentIndex(idx < 0 ? 0 : idx); } } @@ -160,10 +160,10 @@ void CollationWidget::applyConfiguration(void) collation->setLocale(locale_cmb->currentText()); if(lccollate_cmb->currentIndex() > 0) - collation->setLocalization(Collation::_LC_COLLATE, lccollate_cmb->currentText()); + collation->setLocalization(Collation::LcCollate, lccollate_cmb->currentText()); if(lcctype_cmb->currentIndex() > 0) - collation->setLocalization(Collation::_LC_CTYPE, lcctype_cmb->currentText()); + collation->setLocalization(Collation::LcCtype, lcctype_cmb->currentText()); finishConfiguration(); } diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 53f274d582..f26bc096b9 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -54,7 +54,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjColumn) configureTabOrder({ data_type }); map > fields_map; - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion100)].push_back(identity_rb); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion100)].push_back(identity_rb); highlightVersionSpecificFields(fields_map); connect(sequence_rb, &QRadioButton::clicked, @@ -148,7 +148,7 @@ void ColumnWidget::editSequenceAttributes(void) schema = this->model->getSchema("public"); ident_col_seq.setName(QString("%1_%2_seq").arg(table ? table->getName() : QString()).arg(col ? col->getName() : QString("new_column"))); - ident_col_seq.setName(PgModelerNS::generateUniqueName(&ident_col_seq, *model->getObjectList(ObjSequence), false)); + ident_col_seq.setName(PgModelerNs::generateUniqueName(&ident_col_seq, *model->getObjectList(ObjSequence), false)); ident_col_seq.setSchema(schema); if(col) diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index ca3698e784..d727ad78f2 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -123,7 +123,7 @@ void ConfigurationForm::loadConfiguration(void) { Exception ex = Exception(Exception::getErrorMessage(ConfigurationNotLoaded).arg(e.getExtraInfo()),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); msg_box.show(ex, QString("%1 %2").arg(ex.getErrorMessage()).arg(trUtf8("In some cases restore the default settings related to it may solve the problem. Would like to do that?")), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS, trUtf8("Restore"), QString(), QString(), PgModelerUiNS::getIconPath("atualizar")); + Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS, trUtf8("Restore"), QString(), QString(), PgModelerUiNs::getIconPath("atualizar")); if(msg_box.result() == QDialog::Accepted) config_wgt->restoreDefaults(); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 57bb16b9d7..91ddce9f48 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -435,7 +435,7 @@ void ConnectionsConfigWidget::testConnection(void) conn.connect(); srv_info=conn.getServerInfo(); msg_box.show(trUtf8("Success"), - PgModelerUiNS::formatMessage(trUtf8("Connection successfully established!\n\nServer details:\n\nPID: `%1'\nProtocol: `%2'\nVersion: `%3'")) + PgModelerUiNs::formatMessage(trUtf8("Connection successfully established!\n\nServer details:\n\nPID: `%1'\nProtocol: `%2'\nVersion: `%3'")) .arg(srv_info[Connection::ServerPid]) .arg(srv_info[Connection::ServerProtocol]) .arg(srv_info[Connection::ServerVersion]), Messagebox::INFO_ICON); diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 73517220ee..45be31d3df 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -52,16 +52,16 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob columns_tab->setColumnCount(2); columns_tab->setHeaderLabel(trUtf8("Column"), 0); - columns_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + columns_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("column")),0); columns_tab->setHeaderLabel(trUtf8("Type"), 1); - columns_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + columns_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); ref_columns_tab->setEnabled(false); ref_columns_tab->setColumnCount(2); ref_columns_tab->setHeaderLabel(trUtf8("Column"), 0); - ref_columns_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + ref_columns_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("column")),0); ref_columns_tab->setHeaderLabel(trUtf8("Type"), 1); - ref_columns_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + ref_columns_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); dynamic_cast(columns_tbw->widget(0)->layout())->addWidget(columns_tab, 1,0,1,3); dynamic_cast(columns_tbw->widget(1)->layout())->addWidget(ref_table_sel, 0,1,1,2); @@ -89,8 +89,8 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob constraint_grid->addWidget(info_frm, constraint_grid->count()+1, 0, 1, 0); info_frm->setParent(this); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion92)].push_back(no_inherit_lbl); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion92)].push_back(no_inherit_lbl); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_chk); values_map[indexing_chk].push_back(~IndexingType(IndexingType::brin)); warn_frm=generateVersionWarningFrame(fields_map, &values_map); @@ -137,13 +137,13 @@ void ConstraintWidget::addColumn(int row) { aux_col_tab=columns_tab; combo=column_cmb; - col_id=Constraint::SOURCE_COLS; + col_id=Constraint::SourceCols; } else { aux_col_tab=ref_columns_tab; combo=ref_column_cmb; - col_id=Constraint::REFERENCED_COLS; + col_id=Constraint::ReferencedCols; } //Gets the reference to the selected column @@ -168,17 +168,17 @@ void ConstraintWidget::addColumn(int row) void ConstraintWidget::removeColumn(int) { if(sender()==columns_tab) - updateColumnsCombo(Constraint::SOURCE_COLS); + updateColumnsCombo(Constraint::SourceCols); else - updateColumnsCombo(Constraint::REFERENCED_COLS); + updateColumnsCombo(Constraint::ReferencedCols); } void ConstraintWidget::removeColumns(void) { if(sender()==columns_tab) - updateColumnsCombo(Constraint::SOURCE_COLS); + updateColumnsCombo(Constraint::SourceCols); else - updateColumnsCombo(Constraint::REFERENCED_COLS); + updateColumnsCombo(Constraint::ReferencedCols); } void ConstraintWidget::addColumn(Column *column, unsigned col_id, int row) @@ -187,7 +187,7 @@ void ConstraintWidget::addColumn(Column *column, unsigned col_id, int row) if(column && row >= 0) { - if(col_id==Constraint::SOURCE_COLS) + if(col_id==Constraint::SourceCols) table_wgt=columns_tab; else table_wgt=ref_columns_tab; @@ -222,7 +222,7 @@ void ConstraintWidget::updateColumnsCombo(unsigned col_id) try { - if(col_id==Constraint::SOURCE_COLS) + if(col_id==Constraint::SourceCols) { combo=column_cmb; aux_col_tab=columns_tab; @@ -290,7 +290,7 @@ void ConstraintWidget::selectReferencedTable(void) else { ref_columns_tab->setEnabled(true); - updateColumnsCombo(Constraint::REFERENCED_COLS); + updateColumnsCombo(Constraint::ReferencedCols); } } @@ -372,15 +372,15 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis if(constr) { row = 0; - for(auto column : constr->getColumns(Constraint::SOURCE_COLS)) + for(auto column : constr->getColumns(Constraint::SourceCols)) { columns_tab->addRow(); - addColumn(column, Constraint::SOURCE_COLS, row); + addColumn(column, Constraint::SourceCols, row); row++; } } - updateColumnsCombo(Constraint::SOURCE_COLS); + updateColumnsCombo(Constraint::SourceCols); columns_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (column_cmb->count()!=0)); columns_tab->blockSignals(false); @@ -400,8 +400,8 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis deferrable_chk->setChecked(constr->isDeferrable()); deferral_cmb->setCurrentIndex(deferral_cmb->findText(~constr->getDeferralType())); match_cmb->setCurrentIndex(match_cmb->findText(~constr->getMatchType())); - on_delete_cmb->setCurrentIndex(on_delete_cmb->findText(~constr->getActionType(Constraint::DELETE_ACTION))); - on_update_cmb->setCurrentIndex(on_update_cmb->findText(~constr->getActionType(Constraint::UPDATE_ACTION))); + on_delete_cmb->setCurrentIndex(on_delete_cmb->findText(~constr->getActionType(Constraint::DeleteAction))); + on_update_cmb->setCurrentIndex(on_update_cmb->findText(~constr->getActionType(Constraint::UpdateAction))); fill_factor_chk->setChecked(constr->getFillFactor()!=0); if(fill_factor_chk->isChecked()) @@ -414,14 +414,14 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis ref_table_sel->setSelectedObject(ref_table); row = 0; - for(auto column : constr->getColumns(Constraint::REFERENCED_COLS)) + for(auto column : constr->getColumns(Constraint::ReferencedCols)) { ref_columns_tab->addRow(); - addColumn(column, Constraint::REFERENCED_COLS, row); + addColumn(column, Constraint::ReferencedCols, row); row++; } - updateColumnsCombo(Constraint::REFERENCED_COLS); + updateColumnsCombo(Constraint::ReferencedCols); ref_columns_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (column_cmb->count()!=0)); ref_columns_tab->blockSignals(false); } @@ -455,8 +455,8 @@ void ConstraintWidget::applyConfiguration(void) constr->setMatchType(MatchType(match_cmb->currentText())); constr->setDeferrable(deferrable_chk->isChecked()); constr->setDeferralType(DeferralType(deferral_cmb->currentText())); - constr->setActionType(ActionType(on_delete_cmb->currentText()),Constraint::DELETE_ACTION); - constr->setActionType(ActionType(on_update_cmb->currentText()),Constraint::UPDATE_ACTION); + constr->setActionType(ActionType(on_delete_cmb->currentText()),Constraint::DeleteAction); + constr->setActionType(ActionType(on_update_cmb->currentText()),Constraint::UpdateAction); constr->setNoInherit(no_inherit_chk->isChecked()); if(indexing_chk->isChecked()) @@ -468,9 +468,9 @@ void ConstraintWidget::applyConfiguration(void) constr->setReferencedTable(dynamic_cast(ref_table_sel->getSelectedObject())); constr->removeColumns(); - for(col_id=Constraint::SOURCE_COLS; col_id <= Constraint::REFERENCED_COLS; col_id++) + for(col_id=Constraint::SourceCols; col_id <= Constraint::ReferencedCols; col_id++) { - aux_col_tab=(col_id==Constraint::SOURCE_COLS ? columns_tab : ref_columns_tab); + aux_col_tab=(col_id==Constraint::SourceCols ? columns_tab : ref_columns_tab); count=aux_col_tab->getRowCount(); for(i=0; i < count; i++) @@ -494,9 +494,9 @@ void ConstraintWidget::applyConfiguration(void) there is no columns configured on the form */ if(((constr->getConstraintType()==ConstraintType::foreign_key || constr->getConstraintType()==ConstraintType::primary_key) && - constr->getColumnCount(Constraint::SOURCE_COLS)==0) || + constr->getColumnCount(Constraint::SourceCols)==0) || (constr->getConstraintType()==ConstraintType::foreign_key && - constr->getColumnCount(Constraint::REFERENCED_COLS)==0)) + constr->getColumnCount(Constraint::ReferencedCols)==0)) throw Exception(InvConstratintNoColumns,__PRETTY_FUNCTION__,__FILE__,__LINE__); finishConfiguration(); diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index 9ecccf6bf6..d357e39912 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -28,8 +28,8 @@ CustomSQLWidget::CustomSQLWidget(QWidget *parent) : BaseObjectWidget(parent) Ui_CustomSQLWidget::setupUi(this); configureFormLayout(sqlappend_grid, ObjBaseObject); - append_sql_txt=PgModelerUiNS::createNumberedTextEditor(append_sql_wgt, true); - prepend_sql_txt=PgModelerUiNS::createNumberedTextEditor(prepend_sql_wgt, true); + append_sql_txt=PgModelerUiNs::createNumberedTextEditor(append_sql_wgt, true); + prepend_sql_txt=PgModelerUiNs::createNumberedTextEditor(prepend_sql_wgt, true); append_sql_hl=new SyntaxHighlighter(append_sql_txt); append_sql_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); @@ -43,7 +43,7 @@ CustomSQLWidget::CustomSQLWidget(QWidget *parent) : BaseObjectWidget(parent) comment_edt->setVisible(false); comment_lbl->setVisible(false); - PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); action_gen_insert=new QAction(trUtf8("Generic INSERT"), this); action_gen_insert->setObjectName(QString("action_gen_insert")); @@ -151,7 +151,7 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) protected_obj_frm->setVisible(false); obj_id_lbl->setVisible(false); - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(object->getObjectType()))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(object->getObjectType()))); configureMenus(); } diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 41043728d3..4264049143 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -572,7 +572,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) conn.connect(); conn.executeDMLCommand(QString("SELECT last_value FROM \"%1\".\"%2\"").arg(sch_name).arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])), res); - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) attribs[ParsersAttributes::LAST_VALUE]=res.getColumnValue(QString("last_value")); conn.close(); @@ -960,7 +960,7 @@ void DatabaseExplorerWidget::listObjects(void) curr_root = objects_trw->topLevelItem(0); objects_trw->takeTopLevelItem(0); root->setText(0, connection.getConnectionId(true)); - root->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("server"))); + root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("server"))); root->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, -1); root->setData(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole, ObjBaseObject); root->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); @@ -1547,7 +1547,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) font.setItalic(true); tab_item->setText(attrib.first); tab_item->setFont(font); - tab_item->setIcon(QPixmap(PgModelerUiNS::getIconPath("attribute"))); + tab_item->setIcon(QPixmap(PgModelerUiNs::getIconPath("attribute"))); properties_tbw->setItem(row, 0, tab_item); values=attrib.second.split(ELEM_SEPARATOR); @@ -1587,7 +1587,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) src_item=new QTreeWidgetItem(item); src_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); - src_item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("column"))); + src_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("column"))); src_item->setText(0, QString("%1(%2)") .arg(cached_attribs[ParsersAttributes::TABLE]) .arg(cached_attribs[ParsersAttributes::SRC_COLUMNS])); @@ -1598,7 +1598,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) fk_item=new QTreeWidgetItem(item); fk_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); - fk_item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("referenced"))); + fk_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referenced"))); fk_item->setText(0, QString("%1(%2)") .arg(cached_attribs[ParsersAttributes::REF_TABLE]) .arg(cached_attribs[ParsersAttributes::DST_COLUMNS])); @@ -1616,7 +1616,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) { src_item=new QTreeWidgetItem(item); src_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); - src_item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("column"))); + src_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("column"))); src_item->setText(0, col); src_item->setFlags(Qt::ItemIsEnabled); } @@ -1635,7 +1635,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) refs_item->setFont(0, font); refs_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); - refs_item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("referrer"))); + refs_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referrer"))); refs_item->setText(0, QString("%1 (%2)") .arg(attribs_i18n.at(ParsersAttributes::REFERRERS)) .arg(ref_tab_names.length())); @@ -1644,7 +1644,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) { tab_item=new QTreeWidgetItem(refs_item); tab_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); - tab_item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("table"))); + tab_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("table"))); tab_item->setText(0, tab_name); tab_item->setFlags(Qt::ItemIsEnabled); } @@ -1937,7 +1937,7 @@ void DatabaseExplorerWidget::openDataGrid(const QString &schema, const QString & data_manip->hide_views_chk->setChecked(hide_views); data_manip->setAttributes(conn, schema, table); - PgModelerUiNS::resizeDialog(data_manip); + PgModelerUiNs::resizeDialog(data_manip); GeneralConfigWidget::restoreWidgetGeometry(data_manip); data_manip->show(); } diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index cd02de1b59..d76b19cd38 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -141,17 +141,17 @@ void DatabaseImportForm::updateProgress(int progress, QString msg, ObjectType ob { QPixmap ico; - msg=PgModelerUiNS::formatMessage(msg); + msg=PgModelerUiNs::formatMessage(msg); progress_lbl->setText(msg); progress_pb->setValue(progress); if(obj_type!=ObjBaseObject) - ico=QPixmap(PgModelerUiNS::getIconPath(obj_type)); + ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else - ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_info")); + ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); ico_lbl->setPixmap(ico); - PgModelerUiNS::createOutputTreeItem(output_trw, msg, ico); + PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico); } void DatabaseImportForm::setItemCheckState(QTreeWidgetItem *item, int) @@ -396,11 +396,11 @@ void DatabaseImportForm::captureThreadError(Exception e) destroyModelWidget(); finishImport(trUtf8("Importing process aborted!")); - ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_erro")); + ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_erro")); ico_lbl->setPixmap(ico); - item=PgModelerUiNS::createOutputTreeItem(output_trw, PgModelerUiNS::formatMessage(e.getErrorMessage()), ico, nullptr, false, true); - PgModelerUiNS::createExceptionsTree(output_trw, e, item); + item=PgModelerUiNs::createOutputTreeItem(output_trw, PgModelerUiNs::formatMessage(e.getErrorMessage()), ico, nullptr, false, true); + PgModelerUiNs::createExceptionsTree(output_trw, e, item); //Destroy the current import thread and helper to avoid reuse destroyThread(); @@ -504,7 +504,7 @@ void DatabaseImportForm::destroyModelWidget(void) void DatabaseImportForm::handleImportCanceled(void) { - QPixmap ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")); + QPixmap ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")); QString msg=trUtf8("Importing process canceled by user!"); if(!create_model) @@ -514,7 +514,7 @@ void DatabaseImportForm::handleImportCanceled(void) finishImport(msg); ico_lbl->setPixmap(ico); - PgModelerUiNS::createOutputTreeItem(output_trw, msg, ico); + PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico); } void DatabaseImportForm::handleImportFinished(Exception e) @@ -530,7 +530,7 @@ void DatabaseImportForm::handleImportFinished(Exception e) model_wgt->getDatabaseModel()->setInvalidated(false); finishImport(trUtf8("Importing process sucessfuly ended!")); - ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); import_helper->closeConnection(); import_thread->quit(); @@ -609,7 +609,7 @@ void DatabaseImportForm::listDatabases(DatabaseImportHelper &import_helper, QCom for(int i=0; i < list.count(); i++) { - dbcombo->setItemIcon(i, QPixmap(PgModelerUiNS::getIconPath(ObjDatabase))); + dbcombo->setItemIcon(i, QPixmap(PgModelerUiNs::getIconPath(ObjDatabase))); dbcombo->setItemData(i, oids[list[i]]); } @@ -657,7 +657,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW //Creating database item db_item=new QTreeWidgetItem; db_item->setText(0, import_helper.getCurrentDatabase()); - db_item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath(ObjDatabase))); + db_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ObjDatabase))); attribs=catalog.getObjectsAttributes(ObjDatabase, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); db_item->setData(OBJECT_ID, Qt::UserRole, attribs[0].at(ParsersAttributes::OID).toUInt()); @@ -769,7 +769,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe { //Create a group item for the current type group=new QTreeWidgetItem(root); - group->setIcon(0, QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(grp_type) + QString("_grp")))); + group->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(grp_type) + QString("_grp")))); group->setFont(0, grp_fnt); //Group items does contains a zero valued id to indicate that is not a valide object @@ -808,7 +808,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe } item=new QTreeWidgetItem(group); - item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath(obj_type))); + item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(obj_type))); item->setText(0, label); item->setText(OBJECT_ID, attribs[ParsersAttributes::OID].rightJustified(10, '0')); item->setData(OBJECT_ID, Qt::UserRole, attribs[ParsersAttributes::OID].toUInt()); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index ab21735ea0..7b1519e987 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -2390,7 +2390,7 @@ void DatabaseImportHelper::createTablePartitionings(void) table->setPartionedTable(nullptr); table->setPartitionBoundingExpr(QString()); - rel_part = new Relationship(BaseRelationship::RELATIONSHIP_PART, table, part_table); + rel_part = new Relationship(BaseRelationship::RelationshipPart, table, part_table); rel_part->setPartitionBoundingExpr(part_bound_expr); dbmodel->addRelationship(rel_part); } @@ -2535,8 +2535,8 @@ void DatabaseImportHelper::__createTableInheritances(void) inh_list.pop_front(); //Create the inheritance relationship - rel=new Relationship(Relationship::RELATIONSHIP_GEN, child_tab, parent_tab); - rel->setName(PgModelerNS::generateUniqueName(rel, (*dbmodel->getObjectList(ObjRelationship)))); + rel=new Relationship(Relationship::RelationshipGen, child_tab, parent_tab); + rel->setName(PgModelerNs::generateUniqueName(rel, (*dbmodel->getObjectList(ObjRelationship)))); dbmodel->addRelationship(rel); rel=nullptr; diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index b05cef8882..02441acae5 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -129,7 +129,7 @@ class DatabaseImportHelper: public QObject { //! \brief Stored the table created (value) from the oid (key) so the partitioning hierarchy (if existent) can be reconstructed map imported_tables; - XMLParser *xmlparser; + XmlParser *xmlparser; SchemaParser schparser; diff --git a/libpgmodeler_ui/src/databasewidget.cpp b/libpgmodeler_ui/src/databasewidget.cpp index 03c02a9785..e26f1062d2 100644 --- a/libpgmodeler_ui/src/databasewidget.cpp +++ b/libpgmodeler_ui/src/databasewidget.cpp @@ -91,11 +91,11 @@ void DatabaseWidget::setAttributes(DatabaseModel *model) if(idx < 0) idx=0; encoding_cmb->setCurrentIndex(idx); - if(!model->getLocalization(Collation::_LC_COLLATE).isEmpty()) - lccollate_cmb->setCurrentText(model->getLocalization(Collation::_LC_COLLATE)); + if(!model->getLocalization(Collation::LcCollate).isEmpty()) + lccollate_cmb->setCurrentText(model->getLocalization(Collation::LcCollate)); - if(!model->getLocalization(Collation::_LC_CTYPE).isEmpty()) - lcctype_cmb->setCurrentText(model->getLocalization(Collation::_LC_CTYPE)); + if(!model->getLocalization(Collation::LcCtype).isEmpty()) + lcctype_cmb->setCurrentText(model->getLocalization(Collation::LcCtype)); def_schema_sel->setModel(model); def_schema_sel->setSelectedObject(model->getDefaultObject(ObjSchema)); @@ -133,14 +133,14 @@ void DatabaseWidget::applyConfiguration(void) model->setEncoding(EncodingType(BaseType::null)); if(lccollate_cmb->currentText()!=trUtf8("Default")) - model->setLocalization(Collation::_LC_COLLATE, lccollate_cmb->currentText()); + model->setLocalization(Collation::LcCollate, lccollate_cmb->currentText()); else - model->setLocalization(Collation::_LC_COLLATE, QString()); + model->setLocalization(Collation::LcCollate, QString()); if(lcctype_cmb->currentText()!=trUtf8("Default")) - model->setLocalization(Collation::_LC_CTYPE, lcctype_cmb->currentText()); + model->setLocalization(Collation::LcCtype, lcctype_cmb->currentText()); else - model->setLocalization(Collation::_LC_CTYPE, QString()); + model->setLocalization(Collation::LcCtype, QString()); model->setDefaultObject(def_schema_sel->getSelectedObject(), ObjSchema); model->setDefaultObject(def_owner_sel->getSelectedObject(), ObjRole); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 709fd9e7cf..2fda04baca 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -42,8 +42,8 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): table_oid=0; - PgModelerUiNS::configureWidgetFont(hint_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(warning_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(hint_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(warning_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); filter_hl=new SyntaxHighlighter(filter_txt); filter_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); @@ -71,8 +71,8 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): }); truncate_tb->setMenu(&truncate_menu); - truncate_menu.addAction(QIcon(PgModelerUiNS::getIconPath("truncate")), trUtf8("Truncate"), this, SLOT(truncateTable()))->setData(QVariant::fromValue(false)); - truncate_menu.addAction(QIcon(PgModelerUiNS::getIconPath("trunccascade")), trUtf8("Truncate cascade"), this, SLOT(truncateTable()))->setData(QVariant::fromValue(true)); + truncate_menu.addAction(QIcon(PgModelerUiNs::getIconPath("truncate")), trUtf8("Truncate"), this, SLOT(truncateTable()))->setData(QVariant::fromValue(false)); + truncate_menu.addAction(QIcon(PgModelerUiNs::getIconPath("trunccascade")), trUtf8("Truncate cascade"), this, SLOT(truncateTable()))->setData(QVariant::fromValue(true)); copy_tb->setMenu(©_menu); refresh_tb->setToolTip(refresh_tb->toolTip() + QString(" (%1)").arg(refresh_tb->shortcut().toString())); @@ -148,7 +148,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): connect(truncate_tb, SIGNAL(clicked(bool)), this, SLOT(truncateTable())); connect(bulkedit_tb, &QToolButton::clicked, [&](){ - PgModelerUiNS::bulkDataEdit(results_tbw); + PgModelerUiNs::bulkDataEdit(results_tbw); }); connect(filter_tb, &QToolButton::toggled, @@ -171,10 +171,10 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): QAction *act = nullptr; ObjectType obj_type=static_cast(table_cmb->currentData().toUInt()); - act = item_menu.addAction(QIcon(PgModelerUiNS::getIconPath("copiar")), trUtf8("Copy items")); + act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("copiar")), trUtf8("Copy items")); act->setMenu(©_menu); - act = item_menu.addAction(QIcon(PgModelerUiNS::getIconPath("colar")), trUtf8("Pase items")); + act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("colar")), trUtf8("Pase items")); act->setShortcut(paste_tb->shortcut()); connect(act, SIGNAL(triggered(bool)), paste_tb, SLOT(click())); act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == ObjTable); @@ -302,7 +302,7 @@ void DataManipulationForm::listColumns(void) { col_names.push_back(col[ParsersAttributes::NAME]); code_compl_wgt->insertCustomItem(col[ParsersAttributes::NAME], {}, - QPixmap(PgModelerUiNS::getIconPath("column"))); + QPixmap(PgModelerUiNs::getIconPath("column"))); } ord_column_cmb->addItems(col_names); @@ -689,7 +689,7 @@ void DataManipulationForm::listObjects(QComboBox *combo, vector obj_ for(; idx < count; idx++) { - combo->setItemIcon(idx, QPixmap(PgModelerUiNS::getIconPath(obj_type))); + combo->setItemIcon(idx, QPixmap(PgModelerUiNs::getIconPath(obj_type))); combo->setItemData(idx, obj_type); } @@ -812,7 +812,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin QStringList name_list; submenu = new QMenu(this); - fks_menu.addAction(QPixmap(PgModelerUiNS::getIconPath("referenced")), trUtf8("Referenced tables"))->setMenu(submenu); + fks_menu.addAction(QPixmap(PgModelerUiNs::getIconPath("referenced")), trUtf8("Referenced tables"))->setMenu(submenu); if(fks.empty()) submenu->addAction(trUtf8("(none)"))->setEnabled(false); @@ -829,7 +829,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin //Store the referenced schema and table names fk_infos[fk_name][ParsersAttributes::REF_TABLE] = aux_table[ParsersAttributes::NAME]; fk_infos[fk_name][ParsersAttributes::SCHEMA] = aux_schema[ParsersAttributes::NAME]; - action = submenu->addAction(QPixmap(PgModelerUiNS::getIconPath("table")), + action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), QString("%1.%2 (%3)").arg(aux_schema[ParsersAttributes::NAME]) .arg(aux_table[ParsersAttributes::NAME]) .arg(fk[ParsersAttributes::NAME]), this, SLOT(browseReferencedTable())); @@ -861,7 +861,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin } submenu = new QMenu(this); - fks_menu.addAction(QPixmap(PgModelerUiNS::getIconPath("referrer")), trUtf8("Referrer tables"))->setMenu(submenu); + fks_menu.addAction(QPixmap(PgModelerUiNs::getIconPath("referrer")), trUtf8("Referrer tables"))->setMenu(submenu); if(ref_fks.empty()) submenu->addAction(trUtf8("(none)"))->setEnabled(false); @@ -885,7 +885,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &col : catalog.getObjectsAttributes(ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); - action = submenu->addAction(QPixmap(PgModelerUiNS::getIconPath("table")), + action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), QString("%1.%2 (%3)").arg(aux_schema[ParsersAttributes::NAME]) .arg(aux_table[ParsersAttributes::NAME]) .arg(fk[ParsersAttributes::NAME]), this, SLOT(browseReferrerTable())); @@ -1175,7 +1175,7 @@ void DataManipulationForm::browseTable(const QString &fk_name, bool browse_ref_t data_manip->setAttribute(Qt::WA_DeleteOnClose, true); data_manip->setAttributes(conn, schema, table, filter.join(QString("AND"))); - PgModelerUiNS::resizeDialog(data_manip); + PgModelerUiNs::resizeDialog(data_manip); data_manip->show(); } @@ -1387,9 +1387,9 @@ QString DataManipulationForm::getDMLCommand(int row) if(op_type==OP_INSERT || (op_type==OP_UPDATE && value!=item->data(Qt::UserRole))) { //Checking if the value is a malformed unescaped value, e.g., {value, value}, {value\} - if((value.startsWith(PgModelerNS::UNESC_VALUE_START) && value.endsWith(QString("\\") + PgModelerNS::UNESC_VALUE_END)) || - (value.startsWith(PgModelerNS::UNESC_VALUE_START) && !value.endsWith(PgModelerNS::UNESC_VALUE_END)) || - (!value.startsWith(PgModelerNS::UNESC_VALUE_START) && !value.endsWith(QString("\\") + PgModelerNS::UNESC_VALUE_END) && value.endsWith(PgModelerNS::UNESC_VALUE_END))) + if((value.startsWith(PgModelerNs::UNESC_VALUE_START) && value.endsWith(QString("\\") + PgModelerNs::UNESC_VALUE_END)) || + (value.startsWith(PgModelerNs::UNESC_VALUE_START) && !value.endsWith(PgModelerNs::UNESC_VALUE_END)) || + (!value.startsWith(PgModelerNs::UNESC_VALUE_START) && !value.endsWith(QString("\\") + PgModelerNs::UNESC_VALUE_END) && value.endsWith(PgModelerNs::UNESC_VALUE_END))) throw Exception(Exception::getErrorMessage(MalformedUnescapedValue) .arg(row + 1).arg(col_name), MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1402,7 +1402,7 @@ QString DataManipulationForm::getDMLCommand(int row) value=QString("DEFAULT"); } //Unescaped values will not be enclosed in quotes - else if(value.startsWith(PgModelerNS::UNESC_VALUE_START) && value.endsWith(PgModelerNS::UNESC_VALUE_END)) + else if(value.startsWith(PgModelerNs::UNESC_VALUE_START) && value.endsWith(PgModelerNs::UNESC_VALUE_END)) { value.remove(0,1); value.remove(value.length()-1, 1); @@ -1410,8 +1410,8 @@ QString DataManipulationForm::getDMLCommand(int row) //Quoting value else { - value.replace(QString("\\") + PgModelerNS::UNESC_VALUE_START, PgModelerNS::UNESC_VALUE_START); - value.replace(QString("\\") + PgModelerNS::UNESC_VALUE_END, PgModelerNS::UNESC_VALUE_END); + value.replace(QString("\\") + PgModelerNs::UNESC_VALUE_START, PgModelerNs::UNESC_VALUE_START); + value.replace(QString("\\") + PgModelerNs::UNESC_VALUE_END, PgModelerNs::UNESC_VALUE_END); value.replace("\'","''"); value=QString("E'") + value + QString("'"); } diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index 3629597286..614bbc25ed 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -40,10 +40,10 @@ DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjDomain) constr_tab->setColumnCount(2); constr_tab->setHeaderLabel(trUtf8("Name"), 0); - constr_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("constraint_ck")), 0); + constr_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("constraint_ck")), 0); constr_tab->setHeaderLabel(trUtf8("Expression"), 1); - constr_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("codigofonte")), 1); + constr_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("codigofonte")), 1); grid = dynamic_cast(dom_attribs_tbw->widget(1)->layout()); grid->addWidget(constr_tab, 2, 0, 1, 2); diff --git a/libpgmodeler_ui/src/donatewidget.cpp b/libpgmodeler_ui/src/donatewidget.cpp index 09c0b1979c..f421abbada 100644 --- a/libpgmodeler_ui/src/donatewidget.cpp +++ b/libpgmodeler_ui/src/donatewidget.cpp @@ -45,6 +45,6 @@ DonateWidget::DonateWidget(QWidget *parent) : QWidget(parent) emit s_visibilityChanged(false); }); - PgModelerUiNS::configureWidgetFont(title_lbl, PgModelerUiNS::BIG_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::BIG_FONT_FACTOR); this->adjustSize(); } diff --git a/libpgmodeler_ui/src/elementstablewidget.cpp b/libpgmodeler_ui/src/elementstablewidget.cpp index e16fb0e057..aff21c3abb 100644 --- a/libpgmodeler_ui/src/elementstablewidget.cpp +++ b/libpgmodeler_ui/src/elementstablewidget.cpp @@ -38,15 +38,15 @@ ElementsTableWidget::ElementsTableWidget(QWidget *parent) : QWidget(parent) elements_tab->setColumnCount(7); elements_tab->setHeaderLabel(trUtf8("Element"), 0); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("column")),0); elements_tab->setHeaderLabel(trUtf8("Type"), 1); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); elements_tab->setHeaderLabel(trUtf8("Operator"), 2); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("operator")),2); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("operator")),2); elements_tab->setHeaderLabel(trUtf8("Operator Class"), 3); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("opclass")),3); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("opclass")),3); elements_tab->setHeaderLabel(trUtf8("Collation"), 4); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("collation")),4); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("collation")),4); elements_tab->setHeaderLabel(trUtf8("Sorting"), 5); elements_tab->setHeaderLabel(trUtf8("Nulls First"), 6); diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index d5517d7eed..6ae3d31ca4 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -40,7 +40,7 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) element_grid->addWidget(op_class_sel, 4,1,1,2); element_grid->addWidget(operator_sel, 5,1,1,2); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion91)].push_back(collation_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion91)].push_back(collation_lbl); warning_frame=BaseObjectWidget::generateVersionWarningFrame(fields_map); element_grid->addWidget(warning_frame, element_grid->count()+1, 0, 1, 3); warning_frame->setParent(this); diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 32837a9277..4d43707a89 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -42,7 +42,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent configureFormLayout(eventtrigger_grid, ObjEventTrigger); setRequiredField(function_lbl); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(event_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(event_lbl); values_map[event_lbl].push_back(~EventTriggerType(EventTriggerType::table_rewrite)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index 74bed50a87..bdff969296 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -51,17 +51,17 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjFun ObjectsTableWidget::UPDATE_BUTTON, true, this); return_tab->setColumnCount(2); return_tab->setHeaderLabel(trUtf8("Column"), 0); - return_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + return_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("column")),0); return_tab->setHeaderLabel(trUtf8("Type"), 1); - return_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + return_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); parameters_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::UPDATE_BUTTON, true, this); parameters_tab->setColumnCount(4); parameters_tab->setHeaderLabel(trUtf8("Name"),0); - parameters_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("parameter")),0); + parameters_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("parameter")),0); parameters_tab->setHeaderLabel(trUtf8("Type"),1); - parameters_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + parameters_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); parameters_tab->setHeaderLabel(trUtf8("Mode"),2); parameters_tab->setHeaderLabel(trUtf8("Default Value"),3); @@ -80,7 +80,7 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjFun ret_table_gb->setLayout(grid1); ret_table_gb->setVisible(false); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion92)].push_back(leakproof_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion92)].push_back(leakproof_chk); frame=generateVersionWarningFrame(fields_map, &value_map); grid->addWidget(frame, grid->count()+1, 0, 1, 5); frame->setParent(func_config_twg->widget(0)); @@ -435,10 +435,10 @@ void FunctionWidget::validateConfiguredFunction(void) else if(obj_type==ObjAggregate) { aggr=dynamic_cast(object); - if(aggr->getFunction(Aggregate::FINAL_FUNC)==func) - aggr->setFunction(Aggregate::FINAL_FUNC, func); - else if(aggr->getFunction(Aggregate::TRANSITION_FUNC)==func) - aggr->setFunction(Aggregate::TRANSITION_FUNC, func); + if(aggr->getFunction(Aggregate::FinalFunc)==func) + aggr->setFunction(Aggregate::FinalFunc, func); + else if(aggr->getFunction(Aggregate::TransitionFunc)==func) + aggr->setFunction(Aggregate::TransitionFunc, func); } else if(obj_type==ObjTrigger) { diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index c44f6b2b7d..78396f0319 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -23,7 +23,7 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob Ui_GenericSQLWidget::setupUi(this); configureFormLayout(genericsql_grid, ObjGenericSQL); - definition_txt = PgModelerUiNS::createNumberedTextEditor(sqlcode_grp, true); + definition_txt = PgModelerUiNs::createNumberedTextEditor(sqlcode_grp, true); definition_hl = new SyntaxHighlighter(definition_txt); definition_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); diff --git a/libpgmodeler_ui/src/hinttextwidget.cpp b/libpgmodeler_ui/src/hinttextwidget.cpp index a827afc2a4..9879f3d1eb 100644 --- a/libpgmodeler_ui/src/hinttextwidget.cpp +++ b/libpgmodeler_ui/src/hinttextwidget.cpp @@ -36,7 +36,7 @@ HintTextWidget::HintTextWidget(QWidget *btn_parent, QWidget *parent): QWidget(pa hint_tb=new QToolButton(this); hint_tb->setCheckable(true); hint_tb->setToolButtonStyle(Qt::ToolButtonIconOnly); - hint_tb->setIcon(QPixmap(PgModelerUiNS::getIconPath("help"))); + hint_tb->setIcon(QPixmap(PgModelerUiNs::getIconPath("help"))); shadow=new QGraphicsDropShadowEffect(this); shadow->setOffset(5,5); @@ -49,7 +49,7 @@ HintTextWidget::HintTextWidget(QWidget *btn_parent, QWidget *parent): QWidget(pa this->setVisible(false); text_lbl->installEventFilter(this); - PgModelerUiNS::configureWidgetFont(text_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(text_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); parent->installEventFilter(this); diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index bc2d8b2d0a..28aeff1443 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -45,8 +45,8 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjIndex) IndexingType::getTypes(list); indexing_cmb->addItems(list); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion92)].push_back(buffering_chk); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion92)].push_back(buffering_chk); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 9a2e810ebc..8ee9dbc7cc 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -74,7 +74,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par views_stw->widget(MANAGE_VIEW)->setLayout(grid); configuration_form=new ConfigurationForm(nullptr, Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); - PgModelerUiNS::resizeDialog(configuration_form); + PgModelerUiNs::resizeDialog(configuration_form); configuration_form->loadConfiguration(); plugins_conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::PLUGINS_CONF_WGT)); @@ -352,7 +352,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par if(btn) { - PgModelerUiNS::configureWidgetFont(btn, static_cast(PgModelerUiNS::MEDIUM_FONT_FACTOR)); + PgModelerUiNs::configureWidgetFont(btn, static_cast(PgModelerUiNs::MEDIUM_FONT_FACTOR)); font = btn->font(); font.setBold(true); btn->setFont(font); @@ -463,7 +463,7 @@ MainWindow::~MainWindow(void) void MainWindow::restoreTemporaryModels(void) { - PgModelerUiNS::resizeDialog(restoration_form); + PgModelerUiNs::resizeDialog(restoration_form); //Restore temporary models (if exists) if(restoration_form->hasTemporaryModels()) @@ -574,7 +574,7 @@ void MainWindow::fixModel(const QString &filename) model_fix_form.output_file_edt->setText(fi.absolutePath() + GlobalAttributes::DirSeparator + fi.baseName() + QString("_fixed.") + fi.suffix()); } - PgModelerUiNS::resizeDialog(&model_fix_form); + PgModelerUiNs::resizeDialog(&model_fix_form); GeneralConfigWidget::restoreWidgetGeometry(&model_fix_form); model_fix_form.exec(); GeneralConfigWidget::saveWidgetGeometry(&model_fix_form); @@ -1068,7 +1068,7 @@ void MainWindow::setCurrentModel(void) for(QToolButton *btn : btns) { - PgModelerUiNS::configureWidgetFont(btn, static_cast(PgModelerUiNS::MEDIUM_FONT_FACTOR)); + PgModelerUiNs::configureWidgetFont(btn, static_cast(PgModelerUiNs::MEDIUM_FONT_FACTOR)); font = btn->font(); font.setBold(true); btn->setFont(font); @@ -1361,7 +1361,7 @@ void MainWindow::saveModel(ModelWidget *model) trUtf8(" WARNING: The model %1 is invalidated! It's recommended to validate it before save in order to create a consistent model otherwise the generated file will be broken demanding manual fixes to be loadable again!").arg(db_model->getName()), Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS, trUtf8("Validate"), trUtf8("Save anyway"), QString(), - PgModelerUiNS::getIconPath("validation"), PgModelerUiNS::getIconPath("salvar")); + PgModelerUiNs::getIconPath("validation"), PgModelerUiNs::getIconPath("salvar")); //If the user cancel the saving force the stopping of autosave timer to give user the chance to validate the model if(msg_box.isCancelled()) @@ -1439,7 +1439,7 @@ void MainWindow::exportModel(void) trUtf8(" WARNING: The model %1 is invalidated! Before run the export process it's recommended to validate in order to correctly create the objects on database server!").arg(db_model->getName()), Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS, trUtf8("Validate"), trUtf8("Export anyway"), QString(), - PgModelerUiNS::getIconPath("validation"), PgModelerUiNS::getIconPath("exportar")); + PgModelerUiNs::getIconPath("validation"), PgModelerUiNs::getIconPath("exportar")); if(msg_box.result()==QDialog::Accepted) { @@ -1455,7 +1455,7 @@ void MainWindow::exportModel(void) stopTimers(true); connect(&model_export_form, &ModelExportForm::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); - PgModelerUiNS::resizeDialog(&model_export_form); + PgModelerUiNs::resizeDialog(&model_export_form); GeneralConfigWidget::restoreWidgetGeometry(&model_export_form); model_export_form.exec(current_model); GeneralConfigWidget::saveWidgetGeometry(&model_export_form); @@ -1472,7 +1472,7 @@ void MainWindow::importDatabase(void) connect(&db_import_form, &DatabaseImportForm::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); db_import_form.setModelWidget(current_model); - PgModelerUiNS::resizeDialog(&db_import_form); + PgModelerUiNs::resizeDialog(&db_import_form); GeneralConfigWidget::restoreWidgetGeometry(&db_import_form); db_import_form.exec(); GeneralConfigWidget::saveWidgetGeometry(&db_import_form); @@ -1499,7 +1499,7 @@ void MainWindow::diffModelDatabase(void) trUtf8(" WARNING: The model %1 is invalidated! Before run the diff process it's recommended to validate in order to correctly analyze and generate the difference between the model and a database!").arg(db_model->getName()), Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS, trUtf8("Validate"), trUtf8("Diff anyway"), QString(), - PgModelerUiNS::getIconPath("validation"), PgModelerUiNS::getIconPath("diff")); + PgModelerUiNs::getIconPath("validation"), PgModelerUiNs::getIconPath("diff")); if(msg_box.result()==QDialog::Accepted) { @@ -1517,7 +1517,7 @@ void MainWindow::diffModelDatabase(void) stopTimers(true); connect(&modeldb_diff_frm, &ModelDatabaseDiffForm::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); - PgModelerUiNS::resizeDialog(&modeldb_diff_frm); + PgModelerUiNs::resizeDialog(&modeldb_diff_frm); GeneralConfigWidget::restoreWidgetGeometry(&modeldb_diff_frm); modeldb_diff_frm.exec(); GeneralConfigWidget::saveWidgetGeometry(&modeldb_diff_frm); @@ -1589,7 +1589,7 @@ void MainWindow::loadModel(void) try { file_dlg.setNameFilter(trUtf8("Database model (*.dbm);;All files (*.*)")); - file_dlg.setWindowIcon(QPixmap(PgModelerUiNS::getIconPath("pgsqlModeler48x48"))); + file_dlg.setWindowIcon(QPixmap(PgModelerUiNs::getIconPath("pgsqlModeler48x48"))); file_dlg.setWindowTitle(trUtf8("Load model")); file_dlg.setFileMode(QFileDialog::ExistingFiles); file_dlg.setAcceptMode(QFileDialog::AcceptOpen); @@ -1642,7 +1642,7 @@ void MainWindow::showFixMessage(Exception &e, const QString &filename) trUtf8("Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again.").arg(filename), Messagebox::ERROR_ICON, Messagebox::YES_NO_BUTTONS, trUtf8("Fix model"), trUtf8("Cancel"), QString(), - PgModelerUiNS::getIconPath("fixobject"), PgModelerUiNS::getIconPath("msgbox_erro")); + PgModelerUiNs::getIconPath("fixobject"), PgModelerUiNs::getIconPath("msgbox_erro")); if(msg_box.result()==QDialog::Accepted) fixModel(filename); @@ -1902,7 +1902,7 @@ void MainWindow::executePendingOperation(bool valid_error) static const QString op_names[]={ QString(), QT_TR_NOOP("save"), QT_TR_NOOP("save"), QT_TR_NOOP("export"), QT_TR_NOOP("diff") }; - PgModelerUiNS::createOutputTreeItem(model_valid_wgt->output_trw, + PgModelerUiNs::createOutputTreeItem(model_valid_wgt->output_trw, trUtf8("Executing pending %1 operation...").arg(op_names[pending_op])); if(pending_op==PENDING_SAVE_OPER || pending_op==PENDING_SAVE_AS_OPER) @@ -1979,7 +1979,7 @@ void MainWindow::changeCurrentView(bool checked) void MainWindow::reportBug(void) { BugReportForm bugrep_frm; - PgModelerUiNS::resizeDialog(&bugrep_frm); + PgModelerUiNs::resizeDialog(&bugrep_frm); GeneralConfigWidget::restoreWidgetGeometry(&bugrep_frm); bugrep_frm.exec(); GeneralConfigWidget::saveWidgetGeometry(&bugrep_frm); @@ -2002,7 +2002,7 @@ void MainWindow::handleObjectsMetadata(void) objs_meta_frm.setModelWidgets(model_nav_wgt->getModelWidgets()); connect(&objs_meta_frm, SIGNAL(s_metadataHandled()), model_objs_wgt, SLOT(updateObjectsView())); - PgModelerUiNS::resizeDialog(&objs_meta_frm); + PgModelerUiNs::resizeDialog(&objs_meta_frm); GeneralConfigWidget::restoreWidgetGeometry(&objs_meta_frm); objs_meta_frm.exec(); GeneralConfigWidget::saveWidgetGeometry(&objs_meta_frm); diff --git a/libpgmodeler_ui/src/messagebox.cpp b/libpgmodeler_ui/src/messagebox.cpp index 4120492e6a..774ef91dad 100644 --- a/libpgmodeler_ui/src/messagebox.cpp +++ b/libpgmodeler_ui/src/messagebox.cpp @@ -79,7 +79,7 @@ void Messagebox::showExceptionList(void) { if(show_errors_tb->isChecked()) { - show_errors_tb->setIcon(QPixmap(PgModelerUiNS::getIconPath("desfazer"))); + show_errors_tb->setIcon(QPixmap(PgModelerUiNs::getIconPath("desfazer"))); if(show_raw_info_tb->isChecked()) objs_group_wgt->setCurrentIndex(2); @@ -92,7 +92,7 @@ void Messagebox::showExceptionList(void) } else { - show_errors_tb->setIcon(QPixmap(PgModelerUiNS::getIconPath("refazer"))); + show_errors_tb->setIcon(QPixmap(PgModelerUiNs::getIconPath("refazer"))); objs_group_wgt->setCurrentIndex(0); } } @@ -107,14 +107,14 @@ void Messagebox::show(Exception e, const QString &msg, unsigned icon_type, unsig show_raw_info_tb->blockSignals(false); raw_info_txt->setPlainText(e.getExceptionsText()); - PgModelerUiNS::createExceptionsTree(exceptions_trw, e, nullptr); + PgModelerUiNs::createExceptionsTree(exceptions_trw, e, nullptr); exceptions_trw->expandAll(); exceptions_trw->scrollToTop(); if(msg.isEmpty()) - str_aux=PgModelerUiNS::formatMessage(e.getErrorMessage()); + str_aux=PgModelerUiNs::formatMessage(e.getErrorMessage()); else - str_aux=PgModelerUiNS::formatMessage(msg); + str_aux=PgModelerUiNs::formatMessage(msg); this->show(title, str_aux, icon_type, buttons, yes_lbl, no_lbl, cancel_lbl, yes_ico, no_ico, cancel_ico); } @@ -134,13 +134,13 @@ void Messagebox::show(const QString &title, const QString &msg, unsigned icon_ty else yes_ok_btn->setText(buttons==OK_BUTTON ? trUtf8("&Ok") : trUtf8("&Yes")); - yes_ok_btn->setIcon(!yes_ico.isEmpty() ? QIcon(yes_ico) : QPixmap(PgModelerUiNS::getIconPath("confirmar"))); + yes_ok_btn->setIcon(!yes_ico.isEmpty() ? QIcon(yes_ico) : QPixmap(PgModelerUiNs::getIconPath("confirmar"))); no_btn->setText(!no_lbl.isEmpty() ? no_lbl : trUtf8("&No")); - no_btn->setIcon(!no_ico.isEmpty() ? QIcon(no_ico) : QPixmap(PgModelerUiNS::getIconPath("fechar1"))); + no_btn->setIcon(!no_ico.isEmpty() ? QIcon(no_ico) : QPixmap(PgModelerUiNs::getIconPath("fechar1"))); cancel_btn->setText(!cancel_lbl.isEmpty() ? cancel_lbl : trUtf8("&Cancel")); - cancel_btn->setIcon(!cancel_ico.isEmpty() ? QIcon(cancel_ico) : QPixmap(PgModelerUiNS::getIconPath("cancelar"))); + cancel_btn->setIcon(!cancel_ico.isEmpty() ? QIcon(cancel_ico) : QPixmap(PgModelerUiNs::getIconPath("cancelar"))); no_btn->setVisible(buttons==YES_NO_BUTTONS || buttons==ALL_BUTTONS); cancel_btn->setVisible(buttons==OK_CANCEL_BUTTONS || buttons==ALL_BUTTONS); @@ -194,7 +194,7 @@ void Messagebox::show(const QString &title, const QString &msg, unsigned icon_ty icon_lbl->setVisible(!icon_name.isEmpty()); if(!icon_name.isEmpty()) - icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(icon_name))); + icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(icon_name))); msg_lbl->setText(msg); diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 0a2901d8bd..735f8d580c 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -201,18 +201,18 @@ void MetadataHandlingForm::handleObjectsMetada(void) connect(extract_model, SIGNAL(s_objectLoaded(int,QString,unsigned)), this, SLOT(updateProgress(int,QString,unsigned)), Qt::UniqueConnection); - root_item=PgModelerUiNS::createOutputTreeItem(output_trw, - PgModelerUiNS::formatMessage(trUtf8("Extracting metadata to file `%1'").arg(metadata_file)), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info")), nullptr); + root_item=PgModelerUiNs::createOutputTreeItem(output_trw, + PgModelerUiNs::formatMessage(trUtf8("Extracting metadata to file `%1'").arg(metadata_file)), + QPixmap(PgModelerUiNs::getIconPath("msgbox_info")), nullptr); extract_model->saveObjectsMetadata(metadata_file, options); if(extract_restore_rb->isChecked() && !backup_file_edt->text().isEmpty()) { root_item->setExpanded(false); - root_item=PgModelerUiNS::createOutputTreeItem(output_trw, - PgModelerUiNS::formatMessage(trUtf8("Saving backup metadata to file `%1'").arg(backup_file_edt->text())), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info")), nullptr); + root_item=PgModelerUiNs::createOutputTreeItem(output_trw, + PgModelerUiNs::formatMessage(trUtf8("Saving backup metadata to file `%1'").arg(backup_file_edt->text())), + QPixmap(PgModelerUiNs::getIconPath("msgbox_info")), nullptr); model_wgt->getDatabaseModel()->saveObjectsMetadata(backup_file_edt->text()); } @@ -227,9 +227,9 @@ void MetadataHandlingForm::handleObjectsMetada(void) if(!extract_only_rb->isChecked()) { - root_item=PgModelerUiNS::createOutputTreeItem(output_trw, - PgModelerUiNS::formatMessage(trUtf8("Applying metadata from file `%1'").arg(metadata_file)), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info")), nullptr); + root_item=PgModelerUiNs::createOutputTreeItem(output_trw, + PgModelerUiNs::formatMessage(trUtf8("Applying metadata from file `%1'").arg(metadata_file)), + QPixmap(PgModelerUiNs::getIconPath("msgbox_info")), nullptr); model_wgt->setUpdatesEnabled(false); model_wgt->getDatabaseModel()->loadObjectsMetadata(metadata_file, options); @@ -249,15 +249,15 @@ void MetadataHandlingForm::handleObjectsMetada(void) } catch(Exception &e) { - QPixmap icon=QPixmap(PgModelerUiNS::getIconPath("msgbox_erro")); + QPixmap icon=QPixmap(PgModelerUiNs::getIconPath("msgbox_erro")); disconnect(model_wgt->getDatabaseModel(), nullptr, this, nullptr); if(extract_model) disconnect(extract_model, nullptr, this, nullptr); - PgModelerUiNS::createOutputTreeItem(output_trw, - PgModelerUiNS::formatMessage(e.getErrorMessage()), + PgModelerUiNs::createOutputTreeItem(output_trw, + PgModelerUiNs::formatMessage(e.getErrorMessage()), icon, nullptr); ico_lbl->setPixmap(icon); @@ -304,20 +304,20 @@ void MetadataHandlingForm::selectFile(bool is_output) void MetadataHandlingForm::updateProgress(int progress, QString msg, unsigned int type_id) { ObjectType obj_type=static_cast(type_id); - QString fmt_msg=PgModelerUiNS::formatMessage(msg); + QString fmt_msg=PgModelerUiNs::formatMessage(msg); QPixmap icon; if(obj_type==ObjBaseObject) { if(progress==100) - icon=QPixmap(PgModelerUiNS::getIconPath("msgbox_info")); + icon=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); else - icon=QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")); + icon=QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")); } else - icon=QPixmap(PgModelerUiNS::getIconPath(obj_type)); + icon=QPixmap(PgModelerUiNs::getIconPath(obj_type)); - PgModelerUiNS::createOutputTreeItem(output_trw, fmt_msg, icon, root_item); + PgModelerUiNs::createOutputTreeItem(output_trw, fmt_msg, icon, root_item); progress_lbl->setText(fmt_msg); ico_lbl->setPixmap(icon); progress_pb->setValue(progress); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 386f600959..1784e3fab4 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -26,7 +26,7 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) try { setupUi(this); - sqlcode_txt=PgModelerUiNS::createNumberedTextEditor(sqlcode_wgt); + sqlcode_txt=PgModelerUiNs::createNumberedTextEditor(sqlcode_wgt); sqlcode_txt->setReadOnly(true); htmlitem_del=new HtmlItemDelegate(this); @@ -100,9 +100,9 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) sqlcode_hl=new SyntaxHighlighter(sqlcode_txt); sqlcode_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - pgsql_ver_cmb->addItems(PgSQLVersions::AllVersions); + pgsql_ver_cmb->addItems(PgSqlVersions::AllVersions); - PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); connect(cancel_btn, &QToolButton::clicked, [&](){ cancelOperation(true); }); connect(pgsql_ver_chk, SIGNAL(toggled(bool)), pgsql_ver_cmb, SLOT(setEnabled(bool))); @@ -450,12 +450,12 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) .arg(total_steps) .arg(db_cmb->currentText())); - step_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("import"))); + step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("import"))); if(thread_id == SRC_IMPORT_THREAD) - src_import_item=PgModelerUiNS::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); + src_import_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); else - import_item=PgModelerUiNS::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); + import_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); conn.switchToDatabase(db_cmb->currentText()); pgsql_ver=conn.getPgSQLVersion(true); @@ -503,12 +503,12 @@ void ModelDatabaseDiffForm::diffModels(void) .arg(total_steps) .arg(source_model->getName()) .arg(imported_model->getName())); - step_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("diff"))); + step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("diff"))); output_trw->collapseItem(import_item); diff_progress=step_pb->value(); - diff_item=PgModelerUiNS::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); + diff_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); diff_helper->setDiffOption(ModelsDiffHelper::OPT_KEEP_CLUSTER_OBJS, keep_cluster_objs_chk->isChecked()); diff_helper->setDiffOption(ModelsDiffHelper::OPT_CASCADE_MODE, cascade_mode_chk->isChecked()); @@ -542,7 +542,7 @@ void ModelDatabaseDiffForm::exportDiff(bool confirm) trUtf8(" WARNING: The generated diff is ready to be exported! Once started this process will cause irreversible changes on the database. Do you really want to proceed?"), Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS, trUtf8("Apply diff"), trUtf8("Preview diff"), QString(), - PgModelerUiNS::getIconPath("diff"), PgModelerUiNS::getIconPath("codigosql")); + PgModelerUiNs::getIconPath("diff"), PgModelerUiNs::getIconPath("codigosql")); if(!confirm || msg_box.result()==QDialog::Accepted) { @@ -553,11 +553,11 @@ void ModelDatabaseDiffForm::exportDiff(bool confirm) .arg(curr_step) .arg(total_steps) .arg(imported_model->getName())); - step_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("exportar"))); + step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("exportar"))); output_trw->collapseItem(diff_item); diff_progress=step_pb->value(); - export_item=PgModelerUiNS::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); + export_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); export_conn=new Connection; *export_conn=*reinterpret_cast(connections_cmb->itemData(connections_cmb->currentIndex()).value()); @@ -576,9 +576,9 @@ void ModelDatabaseDiffForm::exportDiff(bool confirm) settings_tbw->setCurrentIndex(2); apply_on_server_btn->setVisible(true); output_trw->collapseItem(diff_item); - PgModelerUiNS::createOutputTreeItem(output_trw, + PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("Diff process paused. Waiting user action..."), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), nullptr); + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), nullptr); } } @@ -613,8 +613,8 @@ void ModelDatabaseDiffForm::saveDiffToFile(void) QFile output; step_lbl->setText(trUtf8("Saving diff to file %1").arg(file_edt->text())); - step_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("salvar"))); - import_item=PgModelerUiNS::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); + step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("salvar"))); + import_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); step_pb->setValue(90); progress_pb->setValue(100); @@ -638,10 +638,10 @@ void ModelDatabaseDiffForm::finishDiff(void) step_lbl->setText(trUtf8("Diff process sucessfully ended!")); progress_lbl->setText(trUtf8("No operations left.")); - step_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); - progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); + progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); - import_item=PgModelerUiNS::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); + import_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); step_pb->setValue(100); progress_pb->setValue(100); } @@ -653,10 +653,10 @@ void ModelDatabaseDiffForm::cancelOperation(bool cancel_by_user) step_lbl->setText(trUtf8("Operation cancelled by the user.")); progress_lbl->setText(trUtf8("No operations left.")); - step_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); - progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); + progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); - PgModelerUiNS::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); + PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); } if(src_import_helper && src_import_thread->isRunning()) @@ -693,10 +693,10 @@ void ModelDatabaseDiffForm::captureThreadError(Exception e) cancelOperation(false); progress_lbl->setText(trUtf8("Process aborted due to errors!")); - progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_erro"))); + progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_erro"))); - item=PgModelerUiNS::createOutputTreeItem(output_trw, PgModelerUiNS::formatMessage(e.getErrorMessage()), *progress_ico_lbl->pixmap(), nullptr, false, true); - PgModelerUiNS::createExceptionsTree(output_trw, e, item); + item=PgModelerUiNs::createOutputTreeItem(output_trw, PgModelerUiNs::formatMessage(e.getErrorMessage()), *progress_ico_lbl->pixmap(), nullptr, false, true); + PgModelerUiNs::createExceptionsTree(output_trw, e, item); throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } @@ -766,15 +766,15 @@ void ModelDatabaseDiffForm::handleErrorIgnored(QString err_code, QString err_msg { QTreeWidgetItem *item=nullptr; - item=PgModelerUiNS::createOutputTreeItem(output_trw, trUtf8("Error code %1 found and ignored. Proceeding with export.").arg(err_code), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), + item=PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("Error code %1 found and ignored. Proceeding with export.").arg(err_code), + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), export_item, false); - PgModelerUiNS::createOutputTreeItem(output_trw, PgModelerUiNS::formatMessage(err_msg), + PgModelerUiNs::createOutputTreeItem(output_trw, PgModelerUiNs::formatMessage(err_msg), QPixmap(QString("msgbox_alerta")), item, false); - PgModelerUiNS::createOutputTreeItem(output_trw, cmd, + PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); } @@ -783,15 +783,15 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType { int progress_aux = 0; - msg=PgModelerUiNS::formatMessage(msg); + msg=PgModelerUiNs::formatMessage(msg); if(src_import_thread && src_import_thread->isRunning()) { progress_aux = progress/5; - PgModelerUiNS::createOutputTreeItem(output_trw, msg, - QPixmap(PgModelerUiNS::getIconPath(obj_type)), + PgModelerUiNs::createOutputTreeItem(output_trw, msg, + QPixmap(PgModelerUiNs::getIconPath(obj_type)), src_import_item); } else if(import_thread && import_thread->isRunning()) @@ -801,16 +801,16 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType else progress_aux = 20 + (progress/5); - PgModelerUiNS::createOutputTreeItem(output_trw, msg, - QPixmap(PgModelerUiNS::getIconPath(obj_type)), + PgModelerUiNs::createOutputTreeItem(output_trw, msg, + QPixmap(PgModelerUiNs::getIconPath(obj_type)), import_item); } else if(diff_thread && diff_thread->isRunning()) { if((progress == 0 || progress == 100) && obj_type==ObjBaseObject) { - PgModelerUiNS::createOutputTreeItem(output_trw, msg, - QPixmap(PgModelerUiNS::getIconPath("msgbox_info")), + PgModelerUiNs::createOutputTreeItem(output_trw, msg, + QPixmap(PgModelerUiNs::getIconPath("msgbox_info")), diff_item); } @@ -824,14 +824,14 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_aux = diff_progress + (progress/3); if(obj_type==ObjBaseObject) - ico=QPixmap(PgModelerUiNS::getIconPath("codigosql")); + ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); else - ico=QPixmap(PgModelerUiNS::getIconPath(obj_type)); + ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); - item=PgModelerUiNS::createOutputTreeItem(output_trw, msg, ico, export_item, false); + item=PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico, export_item, false); if(!cmd.isEmpty()) - PgModelerUiNS::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); + PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); } if(progress_aux > step_pb->value()) @@ -841,9 +841,9 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_pb->setValue(progress); if(obj_type!=ObjBaseObject) - progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(obj_type))); + progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(obj_type))); else - progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); this->repaint(); } @@ -859,9 +859,9 @@ void ModelDatabaseDiffForm::updateDiffInfo(ObjectsDiffInfo diff_info) QToolButton *btn=buttons[diff_type]; QTreeWidgetItem *item=nullptr; - item=PgModelerUiNS::createOutputTreeItem(output_trw, - PgModelerUiNS::formatMessage(diff_info.getInfoMessage()), - QPixmap(PgModelerUiNS::getIconPath(diff_info.getObject()->getSchemaName())), diff_item); + item=PgModelerUiNs::createOutputTreeItem(output_trw, + PgModelerUiNs::formatMessage(diff_info.getInfoMessage()), + QPixmap(PgModelerUiNs::getIconPath(diff_info.getObject()->getSchemaName())), diff_item); item->setData(0, Qt::UserRole, diff_info.getDiffType()); if(diff_helper) diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index 70b2037d37..e0c95687fc 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -93,8 +93,8 @@ ModelExportForm::ModelExportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(p connect(svg_rb, SIGNAL(toggled(bool)), page_by_page_chk, SLOT(setDisabled(bool))); connect(ignore_error_codes_chk, SIGNAL(toggled(bool)), error_codes_edt, SLOT(setEnabled(bool))); - pgsqlvers_cmb->addItems(PgSQLVersions::AllVersions); - pgsqlvers1_cmb->addItems(PgSQLVersions::AllVersions); + pgsqlvers_cmb->addItems(PgSqlVersions::AllVersions); + pgsqlvers1_cmb->addItems(PgSqlVersions::AllVersions); double values[]={ ModelWidget::MINIMUM_ZOOM, 0.10f, 0.25f, 0.5f, 0.75f, 1, 1.25f, 1.50f, 1.75f, 2, 2.25, 2.50, 2.75, 3, 3.25, 3.50, 3.75, ModelWidget::MAXIMUM_ZOOM }; @@ -123,39 +123,39 @@ void ModelExportForm::handleErrorIgnored(QString err_code, QString err_msg, QStr { QTreeWidgetItem *item=nullptr; - item=PgModelerUiNS::createOutputTreeItem(output_trw, trUtf8("Error code %1 found and ignored. Proceeding with export.").arg(err_code), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), nullptr, false); + item=PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("Error code %1 found and ignored. Proceeding with export.").arg(err_code), + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), nullptr, false); - PgModelerUiNS::createOutputTreeItem(output_trw, PgModelerUiNS::formatMessage(err_msg), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), item, false); + PgModelerUiNs::createOutputTreeItem(output_trw, PgModelerUiNs::formatMessage(err_msg), + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), item, false); - PgModelerUiNS::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); + PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); } void ModelExportForm::updateProgress(int progress, QString msg, ObjectType obj_type, QString cmd, bool is_code_gen) { QTreeWidgetItem *item=nullptr; - QString text=PgModelerUiNS::formatMessage(msg); + QString text=PgModelerUiNs::formatMessage(msg); QPixmap ico; progress_lbl->setText(text); progress_pb->setValue(progress); if(obj_type!=ObjBaseObject) - ico=QPixmap(PgModelerUiNS::getIconPath(obj_type)); + ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else if(!cmd.isEmpty()) - ico=QPixmap(PgModelerUiNS::getIconPath("codigosql")); + ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); else - ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_info")); + ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); ico_lbl->setPixmap(ico); if(!is_code_gen) { - item=PgModelerUiNS::createOutputTreeItem(output_trw, text, ico, nullptr, false); + item=PgModelerUiNs::createOutputTreeItem(output_trw, text, ico, nullptr, false); if(!cmd.isEmpty()) - PgModelerUiNS::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); + PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); } } @@ -294,12 +294,12 @@ void ModelExportForm::selectOutputFile(void) void ModelExportForm::captureThreadError(Exception e) { - QTreeWidgetItem *item=PgModelerUiNS::createOutputTreeItem(output_trw, PgModelerUiNS::formatMessage(e.getErrorMessage()), - QPixmap(PgModelerUiNS::getIconPath("msgbox_erro")), nullptr, false, true); + QTreeWidgetItem *item=PgModelerUiNs::createOutputTreeItem(output_trw, PgModelerUiNs::formatMessage(e.getErrorMessage()), + QPixmap(PgModelerUiNs::getIconPath("msgbox_erro")), nullptr, false, true); - PgModelerUiNS::createExceptionsTree(output_trw, e, item); + PgModelerUiNs::createExceptionsTree(output_trw, e, item); - ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_erro"))); + ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_erro"))); finishExport(trUtf8("Exporting process aborted!")); throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); @@ -313,22 +313,22 @@ void ModelExportForm::cancelExport(void) void ModelExportForm::handleExportCanceled(void) { - QPixmap ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")); + QPixmap ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")); QString msg=trUtf8("Exporting process canceled by user!"); finishExport(msg); ico_lbl->setPixmap(ico); - PgModelerUiNS::createOutputTreeItem(output_trw, msg, ico); + PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico); } void ModelExportForm::handleExportFinished(void) { - QPixmap ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_info")); + QPixmap ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); QString msg=trUtf8("Exporting process sucessfuly ended!"); finishExport(msg); ico_lbl->setPixmap(ico); - PgModelerUiNS::createOutputTreeItem(output_trw, msg, ico); + PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico); } void ModelExportForm::finishExport(const QString &msg) diff --git a/libpgmodeler_ui/src/modelfixform.cpp b/libpgmodeler_ui/src/modelfixform.cpp index e573a67226..eabb428b64 100644 --- a/libpgmodeler_ui/src/modelfixform.cpp +++ b/libpgmodeler_ui/src/modelfixform.cpp @@ -30,9 +30,9 @@ ModelFixForm::ModelFixForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, setupUi(this); hideEvent(nullptr); - PgModelerUiNS::configureWidgetFont(invalid_cli_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(not_found_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(invalid_cli_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(not_found_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); //Configuring font style for output widget if(!confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT].isEmpty()) diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 59cd571c38..b04a4b8bf0 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -164,7 +164,7 @@ void ModelObjectsWidget::selectObject(void) obj_type!=ObjColumn && obj_type!=ObjConstraint && obj_type!=ObjRule && obj_type!=ObjIndex && obj_type!=ObjTrigger && obj_type!=ObjPermission) { - QAction act(QPixmap(PgModelerUiNS::getIconPath(obj_type)), + QAction act(QPixmap(PgModelerUiNs::getIconPath(obj_type)), trUtf8("New") + QString(" ") + BaseObject::getTypeName(obj_type), nullptr); QMenu popup; @@ -285,20 +285,20 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr if(obj_type==ObjBaseRelationship) { - if(rel_type==BaseRelationship::RELATIONSHIP_FK) + if(rel_type==BaseRelationship::RelationshipFk) str_aux=QString("fk"); else str_aux=QString("tv"); } - else if(rel_type==BaseRelationship::RELATIONSHIP_11) + else if(rel_type==BaseRelationship::Relationship11) str_aux=QString("11"); - else if(rel_type==BaseRelationship::RELATIONSHIP_1N) + else if(rel_type==BaseRelationship::Relationship1n) str_aux=QString("1n"); - else if(rel_type==BaseRelationship::RELATIONSHIP_NN) + else if(rel_type==BaseRelationship::RelationshipNn) str_aux=QString("nn"); - else if(rel_type==BaseRelationship::RELATIONSHIP_DEP) + else if(rel_type==BaseRelationship::RelationshipDep) str_aux=QString("dep"); - else if(rel_type==BaseRelationship::RELATIONSHIP_GEN) + else if(rel_type==BaseRelationship::RelationshipGen) str_aux=QString("gen"); } else if(obj_type==ObjConstraint) @@ -317,7 +317,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr str_aux=QString("_%1").arg(TableObjectView::TextExclude); } - item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(obj_type) + str_aux))); + item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(obj_type) + str_aux))); return(item); } @@ -469,7 +469,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr, *item3=nullptr; vector types = BaseObject::getChildObjectTypes(ObjSchema); int count, count2, i; - QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(QString(BaseObject::getSchemaName(ObjSchema)) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjSchema)) + QString("_grp"))); //Removing the ObjTable and ObjView types since they are handled separetedly types.erase(std::find(types.begin(), types.end(), ObjTable)); @@ -516,7 +516,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) if(visible_objs_map[type]) { item3=new QTreeWidgetItem(item2); - item3->setIcon(0,QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(type) + QString("_grp")))); + item3->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp")))); //Get the objects that belongs to the current schema obj_list=db_model->getObjects(type, schema); @@ -551,7 +551,7 @@ void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *sche QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr; QFont font; vector types = BaseObject::getChildObjectTypes(ObjTable); - QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(ObjTable) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjTable) + QString("_grp"))); try { @@ -580,7 +580,7 @@ void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *sche if(visible_objs_map[type]) { item2=new QTreeWidgetItem(item1); - item2->setIcon(0,QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(type) + QString("_grp")))); + item2->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp")))); font=item2->font(0); font.setItalic(true); item2->setFont(0, font); @@ -611,7 +611,7 @@ void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schem QFont font; ObjectType types[]={ ObjRule, ObjTrigger, ObjIndex }; int count, count1, type_cnt=sizeof(types)/sizeof(ObjectType), i, i1, i2; - QPixmap group_icon=QPixmap(PgModelerUiNS::getIconPath(QString(BaseObject::getSchemaName(ObjView)) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjView)) + QString("_grp"))); try { @@ -641,7 +641,7 @@ void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schem if(visible_objs_map[types[i1]]) { item2=new QTreeWidgetItem(item1); - item2->setIcon(0,QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(types[i1]) + QString("_grp")))); + item2->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(types[i1]) + QString("_grp")))); font=item2->font(0); font.setItalic(true); item2->setFont(0, font); @@ -678,7 +678,7 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject QFont font=item->font(0); db_model->getPermissions(object, perms); - item->setIcon(0,QPixmap(PgModelerUiNS::getIconPath("permission_grp"))); + item->setIcon(0,QPixmap(PgModelerUiNs::getIconPath("permission_grp"))); font.setItalic(true); item->setFont(0, font); @@ -735,7 +735,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) item1=new QTreeWidgetItem(root); str_aux=QString(BaseObject::getSchemaName(types[i])); - item1->setIcon(0,QPixmap(PgModelerUiNS::getIconPath(str_aux + QString("_grp")))); + item1->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(str_aux + QString("_grp")))); item1->setData(1, Qt::UserRole, QVariant::fromValue(types[i])); obj_list=(*db_model->getObjectList(types[i])); diff --git a/libpgmodeler_ui/src/modelrestorationform.cpp b/libpgmodeler_ui/src/modelrestorationform.cpp index c474b22c55..df3a14c152 100644 --- a/libpgmodeler_ui/src/modelrestorationform.cpp +++ b/libpgmodeler_ui/src/modelrestorationform.cpp @@ -23,7 +23,7 @@ ModelRestorationForm::ModelRestorationForm(QWidget *parent, Qt::WindowFlags f) : { setupUi(this); - PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); keep_models_ht=new HintTextWidget(keep_models_hint, this); keep_models_ht->setText(keep_models_chk->statusTip()); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 507b31024f..88bef6c018 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -23,7 +23,7 @@ ModelsDiffHelper::ModelsDiffHelper(void) { diff_canceled=false; - pgsql_version=PgSQLVersions::DefaulVersion; + pgsql_version=PgSqlVersions::DefaulVersion; source_model=imported_model=nullptr; resetDiffCounter(); @@ -272,8 +272,8 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) rec_tab=aux_model->getTable(rel->getReceiverTable()->getName(true)); - if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN || - rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART) + if(rel->getRelationshipType()==BaseRelationship::RelationshipGen || + rel->getRelationshipType()==BaseRelationship::RelationshipPart) { Relationship *aux_rel = nullptr; @@ -288,7 +288,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) /* Special case for partitioning: we detach (drop) and reattach (create) the partition * if the partition bound expression differs from a model to another. This is done only * if the receiver table (partition) exists in the imported model. */ - else if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART && + else if(rel->getRelationshipType()==BaseRelationship::RelationshipPart && rec_tab && aux_model == imported_model && aux_rel && rel->getPartitionBoundingExpr().simplified() != @@ -451,7 +451,7 @@ BaseObject *ModelsDiffHelper::getRelNNTable(const QString &obj_name, DatabaseMod for(auto &obj : *rels) { rel=dynamic_cast(obj); - if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_NN && + if(rel->getRelationshipType()==BaseRelationship::RelationshipNn && rel->getGeneratedTable() && rel->getGeneratedTable()->getSignature()==obj_name) { tab=rel->getGeneratedTable(); @@ -712,8 +712,8 @@ void ModelsDiffHelper::processDiffInfos(void) //Generating the DROP commands if(diff_type==ObjectsDiffInfo::DROP_OBJECT) { - if(rel && (rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN || - rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART)) + if(rel && (rel->getRelationshipType()==BaseRelationship::RelationshipGen || + rel->getRelationshipType()==BaseRelationship::RelationshipPart)) { //Undoing inheritances no_inherit_def+=rel->getAlterRelationshipDefinition(true); @@ -739,8 +739,8 @@ void ModelsDiffHelper::processDiffInfos(void) //Generating the CREATE commands else if(diff_type==ObjectsDiffInfo::CREATE_OBJECT) { - if(rel && (rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_GEN || - rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_PART)) + if(rel && (rel->getRelationshipType()==BaseRelationship::RelationshipGen || + rel->getRelationshipType()==BaseRelationship::RelationshipPart)) { //Creating inheritances inherit_def+=rel->getAlterRelationshipDefinition(false); @@ -1040,14 +1040,14 @@ void ModelsDiffHelper::recreateObject(BaseObject *object, vector & if(constr->getConstraintType()==ConstraintType::primary_key) { - unsigned i=0, col_cnt=constr->getColumnCount(Constraint::SOURCE_COLS); + unsigned i=0, col_cnt=constr->getColumnCount(Constraint::SourceCols); vector ref_aux; Constraint *aux_constr=nullptr; for(i=0; i < col_cnt; i++) { //Get the objects referencing the source columns of the pk - imported_model->getObjectReferences(constr->getColumn(i, Constraint::SOURCE_COLS), ref_aux, false, true); + imported_model->getObjectReferences(constr->getColumn(i, Constraint::SourceCols), ref_aux, false, true); //Selecting only fks from the references list for(BaseObject *obj : ref_aux) diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index e08cbddfa6..23d2d5f811 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -312,8 +312,8 @@ void ModelValidationHelper::validateModel(void) if(obj_type==ObjRelationship) { rel=dynamic_cast(object); - if(rel->getRelationshipType()==Relationship::RELATIONSHIP_GEN || - rel->getRelationshipType()==Relationship::RELATIONSHIP_DEP) + if(rel->getRelationshipType()==Relationship::RelationshipGen || + rel->getRelationshipType()==Relationship::RelationshipDep) { recv_tab=rel->getReceiverTable(); ref_tab=rel->getReferenceTable(); diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 716db355a4..97456acc28 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -30,7 +30,7 @@ ModelValidationWidget::ModelValidationWidget(QWidget *parent): QWidget(parent) output_trw->setItemDelegateForColumn(0, htmlitem_del); version_cmb->addItem(trUtf8("Autodetect")); - version_cmb->addItems(PgSQLVersions::AllVersions); + version_cmb->addItems(PgSqlVersions::AllVersions); options_frm->setVisible(false); curr_step=0; @@ -284,7 +284,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) val_info.getValidationType()==ValidationInfo::VALIDATION_ABORTED) { QStringList errors=val_info.getErrors(); - item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); validation_prog_pb->setValue(validation_prog_pb->maximum()); reenableValidation(); @@ -305,17 +305,17 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) } else { - item->setIcon(0, QPixmap(PgModelerUiNS::getIconPath("msgbox_erro"))); + item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("msgbox_erro"))); if(val_info.getValidationType()==ValidationInfo::BROKEN_REL_CONFIG) { - PgModelerUiNS::createOutputTreeItem(output_trw, trUtf8("HINT: try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process."), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), item); + PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("HINT: try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process."), + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), item); } else if(val_info.getValidationType()==ValidationInfo::MISSING_EXTENSION) { - PgModelerUiNS::createOutputTreeItem(output_trw, trUtf8("HINT: Create the extension in the model or let it be created by applying the needed fixes."), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), item); + PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("HINT: Create the extension in the model or let it be created by applying the needed fixes."), + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), item); } else { @@ -326,7 +326,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) item1=new QTreeWidgetItem(item); label1=new QLabel; label1->setTextInteractionFlags(Qt::TextSelectableByMouse); - item1->setIcon(0, QPixmap(PgModelerUiNS::getIconPath(refs.back()->getSchemaName()))); + item1->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(refs.back()->getSchemaName()))); tab_obj=dynamic_cast(refs.back()); ref_name=refs.back()->getName(true); @@ -431,16 +431,16 @@ void ModelValidationWidget::updateProgress(int prog, QString msg, ObjectType obj if(sql_validation_chk->isChecked() && connections_cmb->currentIndex() <= 0) { warn_count_lbl->setText(QString::number(1)); - PgModelerUiNS::createOutputTreeItem(output_trw, + PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("SQL validation not executed! No connection defined."), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); } else warn_count_lbl->setText(QString::number(0)); - PgModelerUiNS::createOutputTreeItem(output_trw, + PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("Database model successfully validated."), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); emit s_validationFinished(validation_helper->getErrorCount() != 0); } @@ -448,14 +448,14 @@ void ModelValidationWidget::updateProgress(int prog, QString msg, ObjectType obj { QPixmap ico; - msg=PgModelerUiNS::formatMessage(msg); + msg=PgModelerUiNs::formatMessage(msg); if(obj_type!=ObjBaseObject) - ico=QPixmap(PgModelerUiNS::getIconPath(obj_type)); + ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else if(!cmd.isEmpty()) - ico=QPixmap(PgModelerUiNS::getIconPath("sqlcmd")); + ico=QPixmap(PgModelerUiNs::getIconPath("sqlcmd")); else - ico=QPixmap(PgModelerUiNS::getIconPath("msgbox_info")); + ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); if(is_code_gen) { @@ -464,21 +464,21 @@ void ModelValidationWidget::updateProgress(int prog, QString msg, ObjectType obj } else { - ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("codigosql"))); + ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("codigosql"))); object_lbl->setText(trUtf8("Running SQL commands on server...")); - item=PgModelerUiNS::createOutputTreeItem(output_trw, msg, ico, nullptr, false); + item=PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico, nullptr, false); if(!cmd.isEmpty()) - PgModelerUiNS::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); + PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); } } } void ModelValidationWidget::updateObjectName(QString obj_name, ObjectType obj_type) { - object_lbl->setText(trUtf8("Processing object: %1").arg(PgModelerUiNS::formatMessage(obj_name))); - ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(obj_type))); + object_lbl->setText(trUtf8("Processing object: %1").arg(PgModelerUiNs::formatMessage(obj_name))); + ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(obj_type))); } void ModelValidationWidget::configureValidation(void) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 49b99ee019..73aa99a3e3 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -90,9 +90,9 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) ObjTablespace, ObjCollation, ObjExtension, ObjEventTrigger, ObjTag, ObjGenericSQL }; unsigned i, obj_cnt=sizeof(types)/sizeof(ObjectType), - rel_types_id[]={ BaseRelationship::RELATIONSHIP_11, BaseRelationship::RELATIONSHIP_1N, - BaseRelationship::RELATIONSHIP_NN, BaseRelationship::RELATIONSHIP_DEP, - BaseRelationship::RELATIONSHIP_GEN, BaseRelationship::RELATIONSHIP_PART}; + rel_types_id[]={ BaseRelationship::Relationship11, BaseRelationship::Relationship1n, + BaseRelationship::RelationshipNn, BaseRelationship::RelationshipDep, + BaseRelationship::RelationshipGen, BaseRelationship::RelationshipPart}; current_zoom=1; modified=panning_mode=false; @@ -119,7 +119,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) label->setMinimumSize(QSize(20, 20)); label->setMaximumSize(QSize(20, 20)); label->setScaledContents(true); - label->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + label->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); grid=new QGridLayout; grid->addWidget(label, 0, 0, 1, 1); @@ -135,7 +135,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) label->setFont(font); label->setWordWrap(true); label->setText(trUtf8("ATTENTION: The database model is protected! Operations that could modify it are disabled!")); - PgModelerUiNS::configureWidgetFont(label, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(label, PgModelerUiNs::MEDIUM_FONT_FACTOR); grid->addWidget(label, 0, 1, 1, 1); protected_model_frm->setLayout(grid); @@ -209,149 +209,149 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) zoom_info_lbl->setVisible(false); zoom_info_timer.setInterval(3000); - action_edit_data=new QAction(QIcon(PgModelerUiNS::getIconPath("editdata")), trUtf8("Edit data"), this); + action_edit_data=new QAction(QIcon(PgModelerUiNs::getIconPath("editdata")), trUtf8("Edit data"), this); - action_source_code=new QAction(QIcon(PgModelerUiNS::getIconPath("codigosql")), trUtf8("Source"), this); + action_source_code=new QAction(QIcon(PgModelerUiNs::getIconPath("codigosql")), trUtf8("Source"), this); action_source_code->setShortcut(QKeySequence(trUtf8("Alt+S"))); action_source_code->setToolTip(trUtf8("Show object source code")); - action_edit=new QAction(QIcon(PgModelerUiNS::getIconPath("editar")), trUtf8("Properties"), this); + action_edit=new QAction(QIcon(PgModelerUiNs::getIconPath("editar")), trUtf8("Properties"), this); action_edit->setShortcut(QKeySequence(trUtf8("Space"))); action_edit->setToolTip(trUtf8("Edit the object properties")); - action_protect=new QAction(QIcon(PgModelerUiNS::getIconPath("bloqobjeto")), trUtf8("Protect"), this); - action_unprotect=new QAction(QIcon(PgModelerUiNS::getIconPath("desbloqobjeto")), trUtf8("Unprotect"), this); + action_protect=new QAction(QIcon(PgModelerUiNs::getIconPath("bloqobjeto")), trUtf8("Protect"), this); + action_unprotect=new QAction(QIcon(PgModelerUiNs::getIconPath("desbloqobjeto")), trUtf8("Unprotect"), this); action_protect->setToolTip(trUtf8("Protects object(s) from modifications")); - action_remove=new QAction(QIcon(PgModelerUiNS::getIconPath("excluir")), trUtf8("Delete"), this); + action_remove=new QAction(QIcon(PgModelerUiNs::getIconPath("excluir")), trUtf8("Delete"), this); action_remove->setShortcut(QKeySequence(trUtf8("Del"))); action_remove->setMenuRole(QAction::NoRole); - action_cascade_del=new QAction(QIcon(PgModelerUiNS::getIconPath("delcascade")), trUtf8("Del. cascade"), this); + action_cascade_del=new QAction(QIcon(PgModelerUiNs::getIconPath("delcascade")), trUtf8("Del. cascade"), this); action_cascade_del->setShortcut(QKeySequence(trUtf8("Shift+Del"))); action_cascade_del->setMenuRole(QAction::NoRole); - action_select_all=new QAction(QIcon(PgModelerUiNS::getIconPath("seltodos")), trUtf8("Select all"), this); + action_select_all=new QAction(QIcon(PgModelerUiNs::getIconPath("seltodos")), trUtf8("Select all"), this); action_select_all->setToolTip(trUtf8("Selects all the graphical objects in the model")); action_select_all->setMenu(&select_all_menu); - action_convert_relnn=new QAction(QIcon(PgModelerUiNS::getIconPath("convrelnn")), trUtf8("Convert"), this); + action_convert_relnn=new QAction(QIcon(PgModelerUiNs::getIconPath("convrelnn")), trUtf8("Convert"), this); - action_copy=new QAction(QIcon(PgModelerUiNS::getIconPath("copiar")), trUtf8("Copy"), this); + action_copy=new QAction(QIcon(PgModelerUiNs::getIconPath("copiar")), trUtf8("Copy"), this); action_copy->setShortcut(QKeySequence(trUtf8("Ctrl+C"))); action_copy->setMenuRole(QAction::NoRole); - action_paste=new QAction(QIcon(PgModelerUiNS::getIconPath("colar")), trUtf8("Paste"), this); + action_paste=new QAction(QIcon(PgModelerUiNs::getIconPath("colar")), trUtf8("Paste"), this); action_paste->setShortcut(QKeySequence(trUtf8("Ctrl+V"))); action_paste->setMenuRole(QAction::NoRole); - action_cut=new QAction(QIcon(PgModelerUiNS::getIconPath("recortar")), trUtf8("Cut"), this); + action_cut=new QAction(QIcon(PgModelerUiNs::getIconPath("recortar")), trUtf8("Cut"), this); action_cut->setShortcut(QKeySequence(trUtf8("Ctrl+X"))); action_cut->setMenuRole(QAction::NoRole); - action_deps_refs=new QAction(QIcon(PgModelerUiNS::getIconPath("depsrefs")), trUtf8("Deps && Referrers"), this); + action_deps_refs=new QAction(QIcon(PgModelerUiNs::getIconPath("depsrefs")), trUtf8("Deps && Referrers"), this); - action_new_object=new QAction(QIcon(PgModelerUiNS::getIconPath("novoobjeto")), trUtf8("New"), this); + action_new_object=new QAction(QIcon(PgModelerUiNs::getIconPath("novoobjeto")), trUtf8("New"), this); action_new_object->setToolTip(trUtf8("Add a new object in the model")); - action_quick_actions=new QAction(QIcon(PgModelerUiNS::getIconPath("quickactions")), trUtf8("Quick"), this); + action_quick_actions=new QAction(QIcon(PgModelerUiNs::getIconPath("quickactions")), trUtf8("Quick"), this); action_quick_actions->setToolTip(trUtf8("Quick action for the selected object")); action_quick_actions->setMenu(&quick_actions_menu); - action_rename=new QAction(QIcon(PgModelerUiNS::getIconPath("rename")), trUtf8("Rename"), this); + action_rename=new QAction(QIcon(PgModelerUiNs::getIconPath("rename")), trUtf8("Rename"), this); action_rename->setShortcut(QKeySequence(trUtf8("F2"))); action_rename->setToolTip(trUtf8("Quick rename the object")); - action_moveto_schema=new QAction(QIcon(PgModelerUiNS::getIconPath("movetoschema")), trUtf8("Move to schema"), this); + action_moveto_schema=new QAction(QIcon(PgModelerUiNs::getIconPath("movetoschema")), trUtf8("Move to schema"), this); action_moveto_schema->setMenu(&schemas_menu); - action_set_tag=new QAction(QIcon(PgModelerUiNS::getIconPath("tag")), trUtf8("Set tag"), this); + action_set_tag=new QAction(QIcon(PgModelerUiNs::getIconPath("tag")), trUtf8("Set tag"), this); action_set_tag->setMenu(&tags_menu); - action_edit_perms=new QAction(QIcon(PgModelerUiNS::getIconPath("permission")), trUtf8("Edit permissions"), this); + action_edit_perms=new QAction(QIcon(PgModelerUiNs::getIconPath("permission")), trUtf8("Edit permissions"), this); action_edit_perms->setShortcut(QKeySequence(trUtf8("Ctrl+E"))); - action_change_owner=new QAction(QIcon(PgModelerUiNS::getIconPath("changeowner")), trUtf8("Change owner"), this); + action_change_owner=new QAction(QIcon(PgModelerUiNs::getIconPath("changeowner")), trUtf8("Change owner"), this); action_change_owner->setMenu(&owners_menu); - action_sel_sch_children=new QAction(QIcon(PgModelerUiNS::getIconPath("seltodos")), trUtf8("Select children"), this); - action_sel_tagged_tabs=new QAction(QIcon(PgModelerUiNS::getIconPath("seltodos")), trUtf8("Select tagged"), this); + action_sel_sch_children=new QAction(QIcon(PgModelerUiNs::getIconPath("seltodos")), trUtf8("Select children"), this); + action_sel_tagged_tabs=new QAction(QIcon(PgModelerUiNs::getIconPath("seltodos")), trUtf8("Select tagged"), this); - action_select_object=new QAction(QIcon(PgModelerUiNS::getIconPath("movimentado")), trUtf8("Select"), this); - action_parent_rel=new QAction(QIcon(PgModelerUiNS::getIconPath("relationship")), trUtf8("Open relationship"), this); + action_select_object=new QAction(QIcon(PgModelerUiNs::getIconPath("movimentado")), trUtf8("Select"), this); + action_parent_rel=new QAction(QIcon(PgModelerUiNs::getIconPath("relationship")), trUtf8("Open relationship"), this); - action_append_sql=new QAction(QIcon(PgModelerUiNS::getIconPath("sqlappend")), trUtf8("Custom SQL"), this); + action_append_sql=new QAction(QIcon(PgModelerUiNs::getIconPath("sqlappend")), trUtf8("Custom SQL"), this); action_append_sql->setShortcut(QKeySequence(trUtf8("Alt+Q"))); - action_create_seq_col=new QAction(QIcon(PgModelerUiNS::getIconPath("sequence")), trUtf8("Convert to sequence"), this); - action_conv_int_serial=new QAction(QIcon(PgModelerUiNS::getIconPath("sequence")), trUtf8("Convert to serial"), this); + action_create_seq_col=new QAction(QIcon(PgModelerUiNs::getIconPath("sequence")), trUtf8("Convert to sequence"), this); + action_conv_int_serial=new QAction(QIcon(PgModelerUiNs::getIconPath("sequence")), trUtf8("Convert to serial"), this); - action_break_rel_line=new QAction(QIcon(PgModelerUiNS::getIconPath("breakrelline")), trUtf8("Break line"), this); + action_break_rel_line=new QAction(QIcon(PgModelerUiNs::getIconPath("breakrelline")), trUtf8("Break line"), this); - action_remove_rel_points=new QAction(QIcon(PgModelerUiNS::getIconPath("removepoints")), trUtf8("Remove points"), this); + action_remove_rel_points=new QAction(QIcon(PgModelerUiNs::getIconPath("removepoints")), trUtf8("Remove points"), this); - action_enable_sql=new QAction(QIcon(PgModelerUiNS::getIconPath("codigosql")), trUtf8("Enable SQL"), this); - action_disable_sql=new QAction(QIcon(PgModelerUiNS::getIconPath("disablesql")), trUtf8("Disable SQL"), this); + action_enable_sql=new QAction(QIcon(PgModelerUiNs::getIconPath("codigosql")), trUtf8("Enable SQL"), this); + action_disable_sql=new QAction(QIcon(PgModelerUiNs::getIconPath("disablesql")), trUtf8("Disable SQL"), this); - action_duplicate=new QAction(QIcon(PgModelerUiNS::getIconPath("duplicate")), trUtf8("Duplicate"), this); + action_duplicate=new QAction(QIcon(PgModelerUiNs::getIconPath("duplicate")), trUtf8("Duplicate"), this); action_duplicate->setShortcut(QKeySequence(trUtf8("Ctrl+D"))); action_duplicate->setMenuRole(QAction::NoRole); - action_extended_attribs=new QAction(QIcon(PgModelerUiNS::getIconPath("toggleattribs")), trUtf8("Extended attributes"), this); + action_extended_attribs=new QAction(QIcon(PgModelerUiNs::getIconPath("toggleattribs")), trUtf8("Extended attributes"), this); action_show_ext_attribs=new QAction(trUtf8("Show"), this); action_hide_ext_attribs=new QAction(trUtf8("Hide"), this); - action_jump_to_table=new QAction(QIcon(PgModelerUiNS::getIconPath("jumptotable")), trUtf8("Jump to table"), this); + action_jump_to_table=new QAction(QIcon(PgModelerUiNs::getIconPath("jumptotable")), trUtf8("Jump to table"), this); action_jump_to_table->setMenu(&jump_to_tab_menu); toggle_attrs_menu.addAction(action_show_ext_attribs); toggle_attrs_menu.addAction(action_hide_ext_attribs); action_extended_attribs->setMenu(&toggle_attrs_menu); - action_schemas_rects=new QAction(QIcon(PgModelerUiNS::getIconPath("schemarect")), trUtf8("Schemas rectangles"), this); + action_schemas_rects=new QAction(QIcon(PgModelerUiNs::getIconPath("schemarect")), trUtf8("Schemas rectangles"), this); action_show_schemas_rects=new QAction(trUtf8("Show"), this); action_hide_schemas_rects=new QAction(trUtf8("Hide"), this); toggle_sch_rects_menu.addAction(action_show_schemas_rects); toggle_sch_rects_menu.addAction(action_hide_schemas_rects); action_schemas_rects->setMenu(&toggle_sch_rects_menu); - action_fade=new QAction(QIcon(PgModelerUiNS::getIconPath("fade")), trUtf8("Fade in/out"), this); - action_fade_in=new QAction(QIcon(PgModelerUiNS::getIconPath("fadein")), trUtf8("Fade in"), this); - action_fade_out=new QAction(QIcon(PgModelerUiNS::getIconPath("fadeout")), trUtf8("Fade out"), this); + action_fade=new QAction(QIcon(PgModelerUiNs::getIconPath("fade")), trUtf8("Fade in/out"), this); + action_fade_in=new QAction(QIcon(PgModelerUiNs::getIconPath("fadein")), trUtf8("Fade in"), this); + action_fade_out=new QAction(QIcon(PgModelerUiNs::getIconPath("fadeout")), trUtf8("Fade out"), this); - action_fade_rels_in=new QAction(QIcon(PgModelerUiNS::getIconPath("fadein")), trUtf8("Fade in"), this); - action_fade_rels_out=new QAction(QIcon(PgModelerUiNS::getIconPath("fadeout")), trUtf8("Fade out"), this); + action_fade_rels_in=new QAction(QIcon(PgModelerUiNs::getIconPath("fadein")), trUtf8("Fade in"), this); + action_fade_rels_out=new QAction(QIcon(PgModelerUiNs::getIconPath("fadeout")), trUtf8("Fade out"), this); fade_rels_menu.addAction(action_fade_rels_in); fade_rels_menu.addAction(action_fade_rels_out); - action_fade_rels=new QAction(QIcon(PgModelerUiNS::getIconPath("relationship_grp")), trUtf8("Relationships"), this); + action_fade_rels=new QAction(QIcon(PgModelerUiNs::getIconPath("relationship_grp")), trUtf8("Relationships"), this); action_fade_rels->setMenu(&fade_rels_menu); action_fade->setMenu(&fade_menu); action_fade_in->setMenu(&fade_in_menu); action_fade_out->setMenu(&fade_out_menu); - action_edit_creation_order=new QAction(QIcon(PgModelerUiNS::getIconPath("swapobjs")), trUtf8("Swap ids"), this); + action_edit_creation_order=new QAction(QIcon(PgModelerUiNs::getIconPath("swapobjs")), trUtf8("Swap ids"), this); action_edit_creation_order->setToolTip(trUtf8("Edit the objects creation order by swapping their ids")); connect(action_edit_creation_order, SIGNAL(triggered(bool)), this, SLOT(editCreationOrder())); - action=new QAction(QIcon(PgModelerUiNS::getIconPath("breakline_90dv")), trUtf8("90° (vertical)"), this); + action=new QAction(QIcon(PgModelerUiNs::getIconPath("breakline_90dv")), trUtf8("90° (vertical)"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(breakRelationshipLine(void))); action->setData(QVariant::fromValue(BREAK_VERT_NINETY_DEGREES)); break_rel_menu.addAction(action); - action=new QAction(QIcon(PgModelerUiNS::getIconPath("breakline_90dh")), trUtf8("90° (horizontal)"), this); + action=new QAction(QIcon(PgModelerUiNs::getIconPath("breakline_90dh")), trUtf8("90° (horizontal)"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(breakRelationshipLine(void))); action->setData(QVariant::fromValue(BREAK_HORIZ_NINETY_DEGREES)); break_rel_menu.addAction(action); - action=new QAction(QIcon(PgModelerUiNS::getIconPath("breakline_290dv")), trUtf8("90° + 90° (vertical)"), this); + action=new QAction(QIcon(PgModelerUiNs::getIconPath("breakline_290dv")), trUtf8("90° + 90° (vertical)"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(breakRelationshipLine(void))); action->setData(QVariant::fromValue(BREAK_VERT_2NINETY_DEGREES)); break_rel_menu.addAction(action); - action=new QAction(QIcon(PgModelerUiNS::getIconPath("breakline_290dh")), trUtf8("90° + 90° (horizontal)"), this); + action=new QAction(QIcon(PgModelerUiNs::getIconPath("breakline_290dh")), trUtf8("90° + 90° (horizontal)"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(breakRelationshipLine(void))); action->setData(QVariant::fromValue(BREAK_HORIZ_2NINETY_DEGREES)); break_rel_menu.addAction(action); @@ -361,7 +361,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) //Alocatting the object creation actions for(i=0; i < obj_cnt; i++) { - actions_new_objects[types[i]]=new QAction(QIcon(PgModelerUiNS::getIconPath(types[i])), BaseObject::getTypeName(types[i]), this); + actions_new_objects[types[i]]=new QAction(QIcon(PgModelerUiNs::getIconPath(types[i])), BaseObject::getTypeName(types[i]), this); actions_new_objects[types[i]]->setData(QVariant(types[i])); connect(actions_new_objects[types[i]], SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); } @@ -374,7 +374,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) { str_ico=BaseObject::getSchemaName(ObjRelationship) + rel_types_cod[i]; - action=new QAction(QIcon(PgModelerUiNS::getIconPath(str_ico)), + action=new QAction(QIcon(PgModelerUiNs::getIconPath(str_ico)), BaseRelationship::getRelationshipTypeName(rel_types_id[i], false), this); //Storing a unique identifier for the relationship type @@ -403,7 +403,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) } else { - action=new QAction(QIcon(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(obj_type) + QString("_grp"))), labels[i++], this); + action=new QAction(QIcon(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(obj_type) + QString("_grp"))), labels[i++], this); select_all_menu.addAction(action); } @@ -1128,7 +1128,7 @@ void ModelWidget::convertRelationshipNN(void) if(rel) { //Converts only Many-to-Many relationship - if(rel->getRelationshipType()==Relationship::RELATIONSHIP_NN) + if(rel->getRelationshipType()==Relationship::RelationshipNn) { Messagebox msg_box; msg_box.show(trUtf8("Do you really want to convert the relationship into an intermediate table?"), @@ -1142,8 +1142,8 @@ void ModelWidget::convertRelationshipNN(void) { Relationship *rel1=nullptr, *rel2=nullptr; Table *tab=nullptr, *tab_nn=nullptr, - *src_tab=dynamic_cast
(rel->getTable(Relationship::SRC_TABLE)), - *dst_tab=dynamic_cast
(rel->getTable(Relationship::DST_TABLE)); + *src_tab=dynamic_cast
(rel->getTable(Relationship::SrcTable)), + *dst_tab=dynamic_cast
(rel->getTable(Relationship::DstTable)); Constraint *constr=nullptr, *aux_constr=nullptr, *pk=nullptr; Column *col=nullptr; bool src_mand=true, dst_mand=true; @@ -1164,10 +1164,10 @@ void ModelWidget::convertRelationshipNN(void) { /* Checking if there is some attribute that is a pk too. If so, store their names in a list in order to create the pk further in this method */ - count=pk->getColumnCount(Constraint::SOURCE_COLS); + count=pk->getColumnCount(Constraint::SourceCols); for(i=0; i < count; i++) { - col=pk->getColumn(i, Constraint::SOURCE_COLS); + col=pk->getColumn(i, Constraint::SourceCols); attr_idx=rel->getObjectIndex(col); if(attr_idx >= 0) @@ -1187,7 +1187,7 @@ void ModelWidget::convertRelationshipNN(void) if(rel->isSiglePKColumn()) { col=new Column; - (*col)=(*pk->getColumn(0, Constraint::SOURCE_COLS)); + (*col)=(*pk->getColumn(0, Constraint::SourceCols)); col->setParentTable(nullptr); tab->addColumn(col); pk_cols.push_back(col->getName()); @@ -1242,7 +1242,7 @@ void ModelWidget::convertRelationshipNN(void) constr->removeColumns(); constr->setParentTable(nullptr); - for(x=Constraint::SOURCE_COLS; x <= Constraint::REFERENCED_COLS; x++) + for(x=Constraint::SourceCols; x <= Constraint::ReferencedCols; x++) { count1=aux_constr->getColumnCount(x); for(idx1=0; idx1 < count1; idx1++) @@ -1257,7 +1257,7 @@ void ModelWidget::convertRelationshipNN(void) //Renames the table if there is other with the same name on the model avoiding conflicts tab->setName(tab_name); - tab->setName(PgModelerNS::generateUniqueName(tab, *db_model->getObjectList(ObjTable))); + tab->setName(PgModelerNs::generateUniqueName(tab, *db_model->getObjectList(ObjTable))); op_list->startOperationChain(); @@ -1291,9 +1291,9 @@ void ModelWidget::convertRelationshipNN(void) aux_constr=new Constraint; for(QString pk_col : pk_cols) - aux_constr->addColumn(tab->getColumn(pk_col), Constraint::SOURCE_COLS); + aux_constr->addColumn(tab->getColumn(pk_col), Constraint::SourceCols); - aux_constr->setName(PgModelerNS::generateUniqueName(tab, *tab->getObjectList(ObjConstraint), false, QString("_pk"))); + aux_constr->setName(PgModelerNs::generateUniqueName(tab, *tab->getObjectList(ObjConstraint), false, QString("_pk"))); tab->addConstraint(aux_constr); op_list->registerObject(aux_constr, Operation::OBJECT_CREATED, -1, tab); @@ -1301,14 +1301,14 @@ void ModelWidget::convertRelationshipNN(void) /* Creates a one-to-many relationship that links the source table of the many-to-many rel. to the created table The relationship will be identifier if the single pk column attribute of the original relationship is false */ - rel1=new Relationship(Relationship::RELATIONSHIP_1N, + rel1=new Relationship(Relationship::Relationship1n, src_tab, tab, src_mand, false, !rel->isSiglePKColumn()); db_model->addRelationship(rel1); op_list->registerObject(rel1, Operation::OBJECT_CREATED); /*Creates a one-to-many relationship that links the destination table of the many-to-many rel. to the created table The relationship will be identifier if the single pk column attribute of the original relationship is false */ - rel2=new Relationship(Relationship::RELATIONSHIP_1N, + rel2=new Relationship(Relationship::Relationship1n, dst_tab, tab, dst_mand, false, !rel->isSiglePKColumn()); db_model->addRelationship(rel2); op_list->registerObject(rel2, Operation::OBJECT_CREATED); @@ -2420,14 +2420,14 @@ void ModelWidget::pasteObjects(bool duplicate_mode) if(obj_type==ObjFunction) { func=dynamic_cast(object); - func->setName(PgModelerNS::generateUniqueName(func, (*db_model->getObjectList(ObjFunction)), false, QString("_cp"))); + func->setName(PgModelerNs::generateUniqueName(func, (*db_model->getObjectList(ObjFunction)), false, QString("_cp"))); copy_obj_name=func->getName(); func->setName(orig_obj_names[object]); } else if(obj_type==ObjOperator) { oper=dynamic_cast(object); - oper->setName(PgModelerNS::generateUniqueName(oper, (*db_model->getObjectList(ObjOperator)))); + oper->setName(PgModelerNs::generateUniqueName(oper, (*db_model->getObjectList(ObjOperator)))); copy_obj_name=oper->getName(); oper->setName(orig_obj_names[object]); } @@ -2436,12 +2436,12 @@ void ModelWidget::pasteObjects(bool duplicate_mode) if(tab_obj) { if(sel_table) - tab_obj->setName(PgModelerNS::generateUniqueName(tab_obj, (*sel_table->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true)); + tab_obj->setName(PgModelerNs::generateUniqueName(tab_obj, (*sel_table->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true)); else - tab_obj->setName(PgModelerNS::generateUniqueName(tab_obj, (*sel_view->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true)); + tab_obj->setName(PgModelerNs::generateUniqueName(tab_obj, (*sel_view->getObjectList(tab_obj->getObjectType())), false, QString("_cp"), true)); } else - object->setName(PgModelerNS::generateUniqueName(object, (*db_model->getObjectList(object->getObjectType())), false, QString("_cp"), true)); + object->setName(PgModelerNs::generateUniqueName(object, (*db_model->getObjectList(object->getObjectType())), false, QString("_cp"), true)); copy_obj_name=object->getName(); object->setName(orig_obj_names[object]); @@ -2587,7 +2587,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) if(object && !tab_obj && !dynamic_cast(object)) { if(db_model->getObjectIndex(object->getSignature(), object->getObjectType()) >= 0) - object->setName(PgModelerNS::generateUniqueName(object, *db_model->getObjectList(object->getObjectType()), false, QString("_cp"))); + object->setName(PgModelerNs::generateUniqueName(object, *db_model->getObjectList(object->getObjectType()), false, QString("_cp"))); db_model->addObject(object); } @@ -2685,12 +2685,12 @@ void ModelWidget::duplicateObject(void) ObjectType obj_type = object->getObjectType(); table = dynamic_cast(object)->getParentTable(); - PgModelerNS::copyObject(&dup_object, object, obj_type); + PgModelerNs::copyObject(&dup_object, object, obj_type); if(table->getObjectType() == ObjTable) - dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); + dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); else - dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); + dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, -1, table); table->addObject(dup_object); @@ -2834,7 +2834,7 @@ void ModelWidget::removeObjects(bool cascade) { rel = dynamic_cast(object); - if(rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) + if(rel->getRelationshipType()==BaseRelationship::RelationshipFk) { tab_obj=rel->getReferenceForeignKey(); obj_id=tab_obj->getObjectId(); @@ -2967,8 +2967,8 @@ void ModelWidget::removeObjects(bool cascade) if(obj_type==ObjRelationship) { rel=dynamic_cast(object); - src_table=rel->getTable(BaseRelationship::SRC_TABLE); - dst_table=rel->getTable(BaseRelationship::DST_TABLE); + src_table=rel->getTable(BaseRelationship::SrcTable); + dst_table=rel->getTable(BaseRelationship::DstTable); } try @@ -3180,7 +3180,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) while(!obj_list.empty()) { act=new QAction(obj_list.back()->getName(), menus[i]); - act->setIcon(QPixmap(PgModelerUiNS::getIconPath(types[i]))); + act->setIcon(QPixmap(PgModelerUiNs::getIconPath(types[i]))); /* Check the current action only if there is only one selected object and the object representing the action is assigned to the selected object */ @@ -3292,13 +3292,13 @@ void ModelWidget::configureFadeMenu(void) for(ObjectType type : types) { - action = new QAction(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(type) + QString("_grp"))), + action = new QAction(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp"))), labels[id], &fade_in_menu); action->setData(type); fade_in_menu.addAction(action); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); - action = new QAction(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(type) + QString("_grp"))), + action = new QAction(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp"))), labels[id], &fade_out_menu); action->setData(type); fade_out_menu.addAction(action); @@ -3447,8 +3447,8 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) for(auto rel : rel_list) { list.push_back(rel); - list.push_back(rel->getTable(BaseRelationship::SRC_TABLE)); - list.push_back(rel->getTable(BaseRelationship::DST_TABLE)); + list.push_back(rel->getTable(BaseRelationship::SrcTable)); + list.push_back(rel->getTable(BaseRelationship::DstTable)); } vector::iterator end; @@ -3661,7 +3661,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) popup_menu.insertAction(action_quick_actions, action_new_object); } - if(rel->getRelationshipType()==Relationship::RELATIONSHIP_NN) + if(rel->getRelationshipType()==Relationship::RelationshipNn) { action_convert_relnn->setData(QVariant::fromValue(rel)); popup_menu.addAction(action_convert_relnn); @@ -3683,13 +3683,13 @@ void ModelWidget::configurePopupMenu(const vector &objects) popup_menu.addAction(action_jump_to_table); jump_to_tab_menu.clear(); - action = jump_to_tab_menu.addAction(QIcon(PgModelerUiNS::getIconPath(rel->getTable(BaseRelationship::SRC_TABLE)->getObjectType())), - rel->getTable(BaseRelationship::SRC_TABLE)->getSignature(), this, SLOT(jumpToTable())); - action->setData(QVariant::fromValue(reinterpret_cast(rel->getTable(BaseRelationship::SRC_TABLE)))); + action = jump_to_tab_menu.addAction(QIcon(PgModelerUiNs::getIconPath(rel->getTable(BaseRelationship::SrcTable)->getObjectType())), + rel->getTable(BaseRelationship::SrcTable)->getSignature(), this, SLOT(jumpToTable())); + action->setData(QVariant::fromValue(reinterpret_cast(rel->getTable(BaseRelationship::SrcTable)))); - action = jump_to_tab_menu.addAction(QIcon(PgModelerUiNS::getIconPath(rel->getTable(BaseRelationship::DST_TABLE)->getObjectType())), - rel->getTable(BaseRelationship::DST_TABLE)->getSignature(), this, SLOT(jumpToTable())); - action->setData(QVariant::fromValue(reinterpret_cast(rel->getTable(BaseRelationship::DST_TABLE)))); + action = jump_to_tab_menu.addAction(QIcon(PgModelerUiNs::getIconPath(rel->getTable(BaseRelationship::DstTable)->getObjectType())), + rel->getTable(BaseRelationship::DstTable)->getSignature(), this, SLOT(jumpToTable())); + action->setData(QVariant::fromValue(reinterpret_cast(rel->getTable(BaseRelationship::DstTable)))); } } else if(obj_type == ObjSchema) @@ -3860,7 +3860,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) (objects.size()==1 && objects[0]->isProtected()) || (!tab_obj && objects.size()==1 && objects[0]!=db_model && objects[0]->getObjectType()!=ObjBaseRelationship) || (objects.size()==1 && objects[0]->getObjectType()==ObjBaseRelationship && - dynamic_cast(objects[0])->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) || + dynamic_cast(objects[0])->getRelationshipType()==BaseRelationship::RelationshipFk) || objects.size() > 1) { popup_menu.addAction(action_remove); @@ -3892,18 +3892,18 @@ void ModelWidget::configurePopupMenu(const vector &objects) //For each constaint is created a menu with the edit, source code, protect/unprotect and delete actions submenu=new QMenu(&popup_menu); - submenu->setIcon(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(ObjConstraint) + str_aux))); + submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjConstraint) + str_aux))); submenu->setTitle(constr->getName()); action=new QAction(dynamic_cast(submenu)); - action->setIcon(QPixmap(PgModelerUiNS::getIconPath("editar"))); + action->setIcon(QPixmap(PgModelerUiNs::getIconPath("editar"))); action->setText(trUtf8("Properties")); action->setData(QVariant::fromValue(dynamic_cast(constr))); connect(action, SIGNAL(triggered(bool)), this, SLOT(editObject(void))); submenu->addAction(action); action=new QAction(dynamic_cast(submenu)); - action->setIcon(QPixmap(PgModelerUiNS::getIconPath("codigosql"))); + action->setIcon(QPixmap(PgModelerUiNs::getIconPath("codigosql"))); action->setText(trUtf8("Source code")); action->setData(QVariant::fromValue(dynamic_cast(constr))); connect(action, SIGNAL(triggered(bool)), this, SLOT(showSourceCode(void))); @@ -3920,25 +3920,25 @@ void ModelWidget::configurePopupMenu(const vector &objects) if(constr->isProtected()) { - action->setIcon(QPixmap(PgModelerUiNS::getIconPath("desbloqobjeto"))); + action->setIcon(QPixmap(PgModelerUiNs::getIconPath("desbloqobjeto"))); action->setText(trUtf8("Unprotect")); } else { - action->setIcon(QPixmap(PgModelerUiNS::getIconPath("bloqobjeto"))); + action->setIcon(QPixmap(PgModelerUiNs::getIconPath("bloqobjeto"))); action->setText(trUtf8("Protect")); } } action=new QAction(dynamic_cast(submenu)); - action->setIcon(QPixmap(PgModelerUiNS::getIconPath("excluir"))); + action->setIcon(QPixmap(PgModelerUiNs::getIconPath("excluir"))); action->setData(QVariant::fromValue(dynamic_cast(constr))); action->setText(trUtf8("Delete")); submenu->addAction(action); connect(action, SIGNAL(triggered()), this, SLOT(removeObjects())); action=new QAction(dynamic_cast(submenu)); - action->setIcon(QPixmap(PgModelerUiNS::getIconPath("delcascade"))); + action->setIcon(QPixmap(PgModelerUiNs::getIconPath("delcascade"))); action->setData(QVariant::fromValue(dynamic_cast(constr))); action->setText(trUtf8("Del. cascade")); submenu->addAction(action); @@ -3953,7 +3953,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { submenu=new QMenu(&popup_menu); submenu->setTitle(trUtf8("Constraints")); - submenu->setIcon(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(ObjConstraint) + QString("_grp")))); + submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjConstraint) + QString("_grp")))); count=submenus.size(); for(i=0; i < count; i++) submenu->addMenu(submenus[i]); @@ -4068,7 +4068,7 @@ void ModelWidget::toggleObjectSQL(void) if(action) { BaseObject *object=reinterpret_cast(action->data().value()); - PgModelerUiNS::disableObjectSQL(object, !object->isSQLDisabled()); + PgModelerUiNs::disableObjectSQL(object, !object->isSQLDisabled()); this->modified=true; emit s_objectModified(); } @@ -4088,7 +4088,7 @@ void ModelWidget::createSequenceFromColumn(void) //Creates a sequence which name is like the ones auto generated by PostgreSQL seq=new Sequence; seq->setName(BaseObject::formatName(tab->getName() + QString("_") + col->getName() + QString("_seq"))); - seq->setName(PgModelerNS::generateUniqueName(seq, *db_model->getObjectList(ObjSequence), false)); + seq->setName(PgModelerNs::generateUniqueName(seq, *db_model->getObjectList(ObjSequence), false)); seq->setSchema(tab->getSchema()); seq->setDefaultValues(col->getType()); @@ -4189,8 +4189,8 @@ void ModelWidget::breakRelationshipLine(BaseRelationship *rel, unsigned break_ty double dx, dy; QPointF src_pnt, dst_pnt; - src_pnt=rel_view->getConnectionPoint(BaseRelationship::SRC_TABLE); - dst_pnt=rel_view->getConnectionPoint(BaseRelationship::DST_TABLE); + src_pnt=rel_view->getConnectionPoint(BaseRelationship::SrcTable); + dst_pnt=rel_view->getConnectionPoint(BaseRelationship::DstTable); if(break_type==BREAK_VERT_NINETY_DEGREES) rel->setPoints({ QPointF(src_pnt.x(), dst_pnt.y()) }); @@ -4552,8 +4552,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) rel->resetLabelsDistance(); if(!RelationshipView::isCurvedLines() && - rel->getTable(BaseRelationship::SRC_TABLE)->getPosition().y() != - rel->getTable(BaseRelationship::DST_TABLE)->getPosition().y()) + rel->getTable(BaseRelationship::SrcTable)->getPosition().y() != + rel->getTable(BaseRelationship::DstTable)->getPosition().y()) breakRelationshipLine(dynamic_cast(obj), ModelWidget::BREAK_VERT_2NINETY_DEGREES); } @@ -4591,8 +4591,8 @@ QRectF ModelWidget::rearrangeTablesHierarchically(BaseTableView *root, vectorisSelfRelationship()) continue; - src_tab = rel->getTable(BaseRelationship::SRC_TABLE); - dst_tab = rel->getTable(BaseRelationship::DST_TABLE); + src_tab = rel->getTable(BaseRelationship::SrcTable); + dst_tab = rel->getTable(BaseRelationship::DstTable); if(src_tab != base_tab) curr_tab = src_tab; diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index f97255ee63..65f6d067d7 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -37,7 +37,7 @@ class ModelWidget: public QWidget { private: Q_OBJECT - XMLParser *xmlparser; + XmlParser *xmlparser; NewObjectOverlayWidget *new_obj_overlay_wgt; diff --git a/libpgmodeler_ui/src/numberedtexteditor.cpp b/libpgmodeler_ui/src/numberedtexteditor.cpp index a8430aae1b..965be06e15 100644 --- a/libpgmodeler_ui/src/numberedtexteditor.cpp +++ b/libpgmodeler_ui/src/numberedtexteditor.cpp @@ -63,7 +63,7 @@ NumberedTextEditor::NumberedTextEditor(QWidget * parent, bool handle_ext_files) msg_lbl->setTextInteractionFlags(Qt::TextSelectableByMouse); ico->setMaximumSize(22,22); - ico->setPixmap(QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta"))); + ico->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); ico->setScaledContents(true); editor_alert_wgt = new QWidget(this); @@ -77,7 +77,7 @@ NumberedTextEditor::NumberedTextEditor(QWidget * parent, bool handle_ext_files) hbox->addSpacerItem(new QSpacerItem(10,10, QSizePolicy::Expanding)); load_file_btn = new QToolButton(top_widget); - load_file_btn->setIcon(QPixmap(PgModelerUiNS::getIconPath("abrir"))); + load_file_btn->setIcon(QPixmap(PgModelerUiNs::getIconPath("abrir"))); load_file_btn->setIconSize(QSize(16,16)); load_file_btn->setAutoRaise(true); load_file_btn->setText(trUtf8("Load")); @@ -88,7 +88,7 @@ NumberedTextEditor::NumberedTextEditor(QWidget * parent, bool handle_ext_files) connect(load_file_btn, SIGNAL(clicked(bool)), this, SLOT(loadFile())); edit_src_btn = new QToolButton(top_widget); - edit_src_btn->setIcon(QPixmap(PgModelerUiNS::getIconPath("editar"))); + edit_src_btn->setIcon(QPixmap(PgModelerUiNs::getIconPath("editar"))); edit_src_btn->setIconSize(QSize(16,16)); edit_src_btn->setAutoRaise(true); edit_src_btn->setText(trUtf8("Edit")); @@ -99,7 +99,7 @@ NumberedTextEditor::NumberedTextEditor(QWidget * parent, bool handle_ext_files) connect(edit_src_btn, SIGNAL(clicked(bool)), this, SLOT(editSource())); clear_btn = new QToolButton(top_widget); - clear_btn->setIcon(QPixmap(PgModelerUiNS::getIconPath("limpartexto"))); + clear_btn->setIcon(QPixmap(PgModelerUiNs::getIconPath("limpartexto"))); clear_btn->setIconSize(QSize(16,16)); clear_btn->setAutoRaise(true); clear_btn->setText(trUtf8("Clear")); @@ -382,7 +382,7 @@ void NumberedTextEditor::editSource(void) src_editor_proc.waitForStarted(); if(src_editor_proc.state() == QProcess::Running) { - msg_lbl->setText(PgModelerUiNS::formatMessage(trUtf8("The source editor `%1' is running on `pid: %2'.") + msg_lbl->setText(PgModelerUiNs::formatMessage(trUtf8("The source editor `%1' is running on `pid: %2'.") .arg(src_editor_proc.program()).arg(src_editor_proc.processId()))); editor_alert_wgt->setVisible(true); load_file_btn->setEnabled(false); @@ -415,7 +415,7 @@ void NumberedTextEditor::updateSource(void) void NumberedTextEditor::handleProcessError(void) { Messagebox msg_box; - msg_box.show(PgModelerUiNS::formatMessage(trUtf8("Could not start the source code editor application `%1'! Make to sure that the source editor path defined in the general settings points to a valid executable and the current user has permission to run the application. Error message returned: `%2'") + msg_box.show(PgModelerUiNs::formatMessage(trUtf8("Could not start the source code editor application `%1'! Make to sure that the source editor path defined in the general settings points to a valid executable and the current user has permission to run the application. Error message returned: `%2'") .arg(src_editor_proc.program()).arg(src_editor_proc.errorString())), Messagebox::ERROR_ICON); } diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index 1b94189182..eef407c366 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -24,7 +24,7 @@ ObjectDepsRefsWidget::ObjectDepsRefsWidget(QWidget *parent): BaseObjectWidget(pa Ui_ObjectDepsRefsWidget::setupUi(this); configureFormLayout(objectdepsrefs_grid, ObjBaseObject); - PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); model_wgt=nullptr; alert_frm->setVisible(false); @@ -46,7 +46,7 @@ void ObjectDepsRefsWidget::setAttributes(DatabaseModel *model, BaseObject *objec this->comment_edt->setVisible(false); this->comment_lbl->setVisible(false); - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(object->getObjectType()))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(object->getObjectType()))); updateObjectTables(); } diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 9463b9ecba..1348526381 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -357,7 +357,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorfont(); tab_item->setText(objs[i]->getName()); - tab_item->setIcon(QPixmap(PgModelerUiNS::getIconPath(BaseObject::getSchemaName(objs[i]->getObjectType()) + str_aux))); + tab_item->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(objs[i]->getObjectType()) + str_aux))); if(new_row) tab_wgt->setItem(lin_idx, 1, tab_item); if(objs[i]->isProtected() || objs[i]->isSystemObject()) @@ -425,7 +425,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorsetFont(fnt); - tab_item->setIcon(QPixmap(PgModelerUiNS::getIconPath(parent_obj->getObjectType()))); + tab_item->setIcon(QPixmap(PgModelerUiNs::getIconPath(parent_obj->getObjectType()))); } } @@ -471,7 +471,7 @@ void ObjectFinderWidget::updateObjectTypeList(QListWidget *list_wgt) else str_aux=QString(BaseObject::getSchemaName(types[type_id])); - icon=QPixmap(PgModelerUiNS::getIconPath(str_aux)); + icon=QPixmap(PgModelerUiNs::getIconPath(str_aux)); item->setText(BaseObject::getTypeName(types[type_id])); item->setIcon(icon); diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index c4c3bd4ae1..6671b1eecd 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -50,7 +50,7 @@ void ObjectRenameWidget::setAttributes(BaseObject *object, DatabaseModel *model, this->op_list=op_list; this->model=model; - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(object->getSchemaName()))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(object->getSchemaName()))); obj_icon_lbl->setToolTip(object->getTypeName()); obj_name_lbl->setText(object->getName()); diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 3750556da6..9164607cc3 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -98,14 +98,14 @@ void OperationListWidget::updateOperationList(void) if(obj_type==ObjBaseRelationship) str_aux+=QString("tv"); - item->setIcon(0,QPixmap(PgModelerUiNS::getIconPath(str_aux))); + item->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(str_aux))); operations_tw->insertTopLevelItem(i,item); item->setFont(0,font); item->setText(0,trUtf8("Object: %1").arg(BaseObject::getTypeName(obj_type))); item2=new QTreeWidgetItem(item); - item2->setIcon(0,QPixmap(PgModelerUiNS::getIconPath("uid"))); + item2->setIcon(0,QPixmap(PgModelerUiNs::getIconPath("uid"))); item2->setFont(0,font); item2->setText(0,trUtf8("Name: %1").arg(obj_name)); @@ -131,7 +131,7 @@ void OperationListWidget::updateOperationList(void) } item1=new QTreeWidgetItem(item); - item1->setIcon(0,QPixmap(PgModelerUiNS::getIconPath(op_icon))); + item1->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(op_icon))); item1->setFont(0,font); item1->setText(0,trUtf8("Operation: %1").arg(op_name)); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 4596ab0a10..50d6b1f726 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -40,14 +40,14 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare elements_tab->setColumnCount(4); elements_tab->setHeaderLabel(trUtf8("Object"),0); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("table")),0); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),0); elements_tab->setHeaderLabel(trUtf8("Type"),1); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); elements_tab->setHeaderLabel(trUtf8("Support/Strategy"),2); elements_tab->setHeaderLabel(trUtf8("Operator Family"),3); - elements_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("opfamily")),3); + elements_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("opfamily")),3); grid=new QGridLayout; grid->setContentsMargins(0,0,0,0); @@ -62,7 +62,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare this->setLayout(grid); configureFormLayout(grid, ObjOpClass); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index e7f8e548b4..9604d3b6ca 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -32,7 +32,7 @@ OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(pa indexing_cmb->addItems(types); setRequiredField(indexing_lbl); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); opfamily_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), opfamily_grid->count()+1, 0, 1, 0); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 2cf556099f..9880091d39 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -50,7 +50,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob ObjectsTableWidget::EDIT_BUTTON, false, this); roles_tab->setColumnCount(1); roles_tab->setHeaderLabel(trUtf8("Name"),0); - roles_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + roles_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); grid=new QGridLayout; grid->addWidget(roles_tab,0,0,1,1); @@ -62,11 +62,11 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob ObjectsTableWidget::REMOVE_ALL_BUTTON, true, this); permissions_tab->setColumnCount(3); permissions_tab->setHeaderLabel(trUtf8("Id"),0); - permissions_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + permissions_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); permissions_tab->setHeaderLabel(trUtf8("Roles"),1); - permissions_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),1); + permissions_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),1); permissions_tab->setHeaderLabel(trUtf8("Privileges"),2); - permissions_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("grant")),2); + permissions_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("grant")),2); grid=new QGridLayout; grid->addWidget(permissions_tab,0,0,1,1); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 4580dc1195..6a14e4dbbf 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -8,7 +8,7 @@ #include "baseform.h" #include "bulkdataeditwidget.h" -namespace PgModelerUiNS { +namespace PgModelerUiNs { NumberedTextEditor *createNumberedTextEditor(QWidget *parent, bool handle_ext_files) { diff --git a/libpgmodeler_ui/src/pgmodeleruins.h b/libpgmodeler_ui/src/pgmodeleruins.h index 3f90d70960..3d797fc8af 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.h +++ b/libpgmodeler_ui/src/pgmodeleruins.h @@ -32,7 +32,7 @@ #include "baseobject.h" #include "numberedtexteditor.h" -namespace PgModelerUiNS { +namespace PgModelerUiNs { static constexpr unsigned SMALL_FONT_FACTOR = 0, MEDIUM_FONT_FACTOR = 1, BIG_FONT_FACTOR = 2, diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.cpp b/libpgmodeler_ui/src/pluginsconfigwidget.cpp index e480149414..02347cccf7 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.cpp +++ b/libpgmodeler_ui/src/pluginsconfigwidget.cpp @@ -30,7 +30,7 @@ PluginsConfigWidget::PluginsConfigWidget(QWidget *parent) : BaseConfigWidget(par plugins_tab=new ObjectsTableWidget(ObjectsTableWidget::EDIT_BUTTON, false, this); plugins_tab->setColumnCount(3); plugins_tab->setHeaderLabel(trUtf8("Plugin"),0); - plugins_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("plugins")),0); + plugins_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("plugins")),0); plugins_tab->setHeaderLabel(trUtf8("Version"),1); plugins_tab->setHeaderLabel(trUtf8("Library"),2); diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index a012b83730..dbb2429ed7 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -27,12 +27,12 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjPolicy) model_objs_wgt = new ModelObjectsWidget(true, this); model_objs_wgt->setObjectVisible(ObjRole, true); - using_edt = PgModelerUiNS::createNumberedTextEditor(using_wgt); + using_edt = PgModelerUiNs::createNumberedTextEditor(using_wgt); using_edt->setTabChangesFocus(true); using_hl = new SyntaxHighlighter(using_edt); using_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - check_edt = PgModelerUiNS::createNumberedTextEditor(check_wgt); + check_edt = PgModelerUiNs::createNumberedTextEditor(check_wgt); check_edt->setTabChangesFocus(true); check_hl = new SyntaxHighlighter(check_edt); check_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); @@ -43,7 +43,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjPolicy) ObjectsTableWidget::EDIT_BUTTON), true, this); roles_tab->setColumnCount(1); roles_tab->setHeaderLabel(trUtf8("Name"), 0); - roles_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")), 0); + roles_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")), 0); QVBoxLayout *vbox = new QVBoxLayout; vbox->addWidget(roles_tab); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index bf6c43ad24..bac40e063c 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -25,9 +25,9 @@ RelationshipConfigWidget::RelationshipConfigWidget(QWidget * parent) : BaseConfi QStringList list, rel_types={ ParsersAttributes::RELATIONSHIP_11, ParsersAttributes::RELATIONSHIP_1N, ParsersAttributes::RELATIONSHIP_NN, ParsersAttributes::RELATIONSHIP_GEN, ParsersAttributes::RELATIONSHIP_DEP, ParsersAttributes::RELATIONSHIP_PART }; - unsigned rel_types_id[]={ BaseRelationship::RELATIONSHIP_11, BaseRelationship::RELATIONSHIP_1N, - BaseRelationship::RELATIONSHIP_NN, BaseRelationship::RELATIONSHIP_GEN, - BaseRelationship::RELATIONSHIP_DEP, BaseRelationship::RELATIONSHIP_PART}; + unsigned rel_types_id[]={ BaseRelationship::Relationship11, BaseRelationship::Relationship1n, + BaseRelationship::RelationshipNn, BaseRelationship::RelationshipGen, + BaseRelationship::RelationshipDep, BaseRelationship::RelationshipPart}; Ui_RelationshipConfigWidget::setupUi(this); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 7ab37f611b..b54ea3cbab 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -82,21 +82,21 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent attributes_tab->setColumnCount(2); attributes_tab->setHeaderLabel(trUtf8("Attribute"), 0); - attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("column")),0); attributes_tab->setHeaderLabel(trUtf8("Type"), 1); - attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); constraints_tab->setColumnCount(2); constraints_tab->setHeaderLabel(trUtf8("Constraint"), 0); - constraints_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("constraint")),0); + constraints_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("constraint")),0); constraints_tab->setHeaderLabel(trUtf8("Type"), 1); - constraints_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + constraints_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); advanced_objs_tab->setColumnCount(2); advanced_objs_tab->setHeaderLabel(trUtf8("Name"), 0); - advanced_objs_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + advanced_objs_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("column")),0); advanced_objs_tab->setHeaderLabel(trUtf8("Type"), 1); - advanced_objs_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + advanced_objs_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); connect(advanced_objs_tab, SIGNAL(s_rowEdited(int)), this, SLOT(showAdvancedObject(int))); @@ -173,7 +173,7 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent table1_mand_chk->setDisabled(identifier_chk->isChecked()); table2_mand_chk->setEnabled(!identifier_chk->isChecked() && this->object && - dynamic_cast(this->object)->getRelationshipType() != BaseRelationship::RELATIONSHIP_1N); + dynamic_cast(this->object)->getRelationshipType() != BaseRelationship::Relationship1n); }); connect(attributes_tab, SIGNAL(s_rowsRemoved(void)), this, SLOT(removeObjects(void))); @@ -256,13 +256,13 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l rel_type=base_rel->getRelationshipType(); rel_type_name_lbl->setText(base_rel->getRelationshipTypeName()); - rel_icon_lbl->setPixmap(PgModelerUiNS::getIconPath(base_rel->getRelTypeAttribute().replace("rel", "relationship"))); + rel_icon_lbl->setPixmap(PgModelerUiNs::getIconPath(base_rel->getRelTypeAttribute().replace("rel", "relationship"))); aux_rel=dynamic_cast(base_rel); if(base_rel->getObjectType()==ObjBaseRelationship) { - if(base_rel->getRelationshipType()!=BaseRelationship::RELATIONSHIP_FK) + if(base_rel->getRelationshipType()!=BaseRelationship::RelationshipFk) { ref_table_lbl->setText(trUtf8("Referer View:")); ref_table_ht->setText(trUtf8("Referer view references one or more columns of a table to construct it's own columns.")); @@ -277,12 +277,12 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l recv_table_lbl->setText(trUtf8("Referenced Table:")); - ref_table_txt->setPlainText(base_rel->getTable(BaseRelationship::SRC_TABLE)->getName(true)); - recv_table_txt->setPlainText(base_rel->getTable(BaseRelationship::DST_TABLE)->getName(true)); + ref_table_txt->setPlainText(base_rel->getTable(BaseRelationship::SrcTable)->getName(true)); + recv_table_txt->setPlainText(base_rel->getTable(BaseRelationship::DstTable)->getName(true)); } else if(aux_rel) { - if(rel_type == BaseRelationship::RELATIONSHIP_PART) + if(rel_type == BaseRelationship::RelationshipPart) { ref_table_lbl->setText(trUtf8("Partitioned Table:")); ref_table_ht->setText(trUtf8("Partitioned table is the one which is splitted into smaller pieces (partitions). This table is where the partitioning strategy or type is defined.")); @@ -293,7 +293,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l ref_table_txt->setPlainText(aux_rel->getReferenceTable()->getName(true)); recv_table_txt->setPlainText(aux_rel->getReceiverTable()->getName(true)); } - else if(rel_type!=BaseRelationship::RELATIONSHIP_NN) + else if(rel_type!=BaseRelationship::RelationshipNn) { ref_table_lbl->setText(trUtf8("Reference Table:")); ref_table_ht->setText(trUtf8("Reference table has the columns from its primary key will copied to the receiver table in order to represent the linking between them. This is the (1) side of relationship.")); @@ -310,11 +310,11 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l ref_table_ht->setText(trUtf8("In many-to-many relationships both tables are used as reference to generate the table that represents the linking. Columns from both tables are copied to the resultant table and two foreign keys are created as well in order to reference each participant table.")); recv_table_lbl->setText(trUtf8("Reference Table:")); recv_table_ht->setText(ref_table_ht->getText()); - ref_table_txt->setPlainText(base_rel->getTable(BaseRelationship::SRC_TABLE)->getName(true)); - recv_table_txt->setPlainText(base_rel->getTable(BaseRelationship::DST_TABLE)->getName(true)); + ref_table_txt->setPlainText(base_rel->getTable(BaseRelationship::SrcTable)->getName(true)); + recv_table_txt->setPlainText(base_rel->getTable(BaseRelationship::DstTable)->getName(true)); } - if(rel_type == BaseRelationship::RELATIONSHIP_PART) + if(rel_type == BaseRelationship::RelationshipPart) { part_type_lbl->setText(~aux_rel->getReferenceTable()->getPartitioningType()); default_part_chk->setChecked(aux_rel->getPartitionBoundingExpr().isEmpty()); @@ -322,14 +322,14 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } disable_sql_chk->setVisible(base_rel->getObjectType()==ObjRelationship); - table1_mand_chk->setText(base_rel->getTable(BaseRelationship::SRC_TABLE)->getName() + trUtf8(" is required")); - table2_mand_chk->setText(base_rel->getTable(BaseRelationship::DST_TABLE)->getName() + trUtf8(" is required")); + table1_mand_chk->setText(base_rel->getTable(BaseRelationship::SrcTable)->getName() + trUtf8(" is required")); + table2_mand_chk->setText(base_rel->getTable(BaseRelationship::DstTable)->getName() + trUtf8(" is required")); if(aux_rel) { single_pk_chk->setChecked(aux_rel->isSiglePKColumn()); - table1_mand_chk->setChecked(aux_rel->isTableMandatory(BaseRelationship::SRC_TABLE)); - table2_mand_chk->setChecked(aux_rel->isTableMandatory(BaseRelationship::DST_TABLE)); + table1_mand_chk->setChecked(aux_rel->isTableMandatory(BaseRelationship::SrcTable)); + table2_mand_chk->setChecked(aux_rel->isTableMandatory(BaseRelationship::DstTable)); identifier_chk->setChecked(aux_rel->isIdentifier()); relnn_tab_name_edt->setText(aux_rel->getTableNameRelNN()); attributes_tab->setButtonsEnabled(ObjectsTableWidget::ALL_BUTTONS, !aux_rel->isProtected()); @@ -343,9 +343,9 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l listSpecialPkColumns(); - if(rel_type!=BaseRelationship::RELATIONSHIP_NN) + if(rel_type!=BaseRelationship::RelationshipNn) { - if(rel_type==BaseRelationship::RELATIONSHIP_DEP) + if(rel_type==BaseRelationship::RelationshipDep) { CopyOptions copy_op=aux_rel->getCopyOptions(); @@ -360,7 +360,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l identity_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::IDENTITY)); statistics_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::STATISTICS)); } - else if(rel_type == BaseRelationship::RELATIONSHIP_PART) + else if(rel_type == BaseRelationship::RelationshipPart) { if(this->new_object) generateBoundingExpr(); @@ -370,15 +370,15 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } } - rel1n=(rel_type==BaseRelationship::RELATIONSHIP_11 || - rel_type==BaseRelationship::RELATIONSHIP_1N); + rel1n=(rel_type==BaseRelationship::Relationship11 || + rel_type==BaseRelationship::Relationship1n); - relnn=(rel_type==BaseRelationship::RELATIONSHIP_NN); + relnn=(rel_type==BaseRelationship::RelationshipNn); - relgen_dep=(rel_type==BaseRelationship::RELATIONSHIP_DEP || - rel_type==BaseRelationship::RELATIONSHIP_GEN || - rel_type==BaseRelationship::RELATIONSHIP_PART || - rel_type==BaseRelationship::RELATIONSHIP_FK); + relgen_dep=(rel_type==BaseRelationship::RelationshipDep || + rel_type==BaseRelationship::RelationshipGen || + rel_type==BaseRelationship::RelationshipPart || + rel_type==BaseRelationship::RelationshipFk); use_name_patterns=(rel1n || relnn || (relgen_dep && base_rel->getObjectType()==ObjRelationship)); @@ -402,7 +402,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l card_lbl->setVisible(rel1n); table1_mand_chk->setEnabled(rel1n); table1_mand_chk->setVisible(rel1n); - table2_mand_chk->setEnabled(rel_type==BaseRelationship::RELATIONSHIP_11); + table2_mand_chk->setEnabled(rel_type==BaseRelationship::Relationship11); table2_mand_chk->setVisible(rel1n); identifier_wgt->setVisible(rel1n && !base_rel->isSelfRelationship()); @@ -413,7 +413,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l relnn_tab_name_edt->setVisible(relnn); gen_tab_name_hint->setVisible(relnn); - part_bound_expr_gb->setVisible(rel_type==BaseRelationship::RELATIONSHIP_PART); + part_bound_expr_gb->setVisible(rel_type==BaseRelationship::RelationshipPart); for(i=SETTINGS_TAB; i <= ADVANCED_TAB; i++) rel_attribs_tbw->removeTab(1); @@ -428,11 +428,11 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l if(base_rel->getObjectType()==ObjRelationship || (base_rel->getObjectType()==ObjBaseRelationship && - base_rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK)) + base_rel->getRelationshipType()==BaseRelationship::RelationshipFk)) rel_attribs_tbw->addTab(tabs[ADVANCED_TAB], tab_labels[ADVANCED_TAB]); copy_options_grp->setVisible(base_rel->getObjectType()==ObjRelationship && - base_rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_DEP); + base_rel->getRelationshipType()==BaseRelationship::RelationshipDep); custom_color_chk->setChecked(base_rel->getCustomColor()!=Qt::transparent); color_picker->setColor(0, base_rel->getCustomColor()); @@ -462,10 +462,10 @@ QSize RelationshipWidget::getIdealSize(void) if(this->object) rel_type = dynamic_cast(this->object)->getRelationshipType(); - if(rel_type == BaseRelationship::RELATIONSHIP_FK || - (BaseRelationship::RELATIONSHIP_DEP && this->object && this->object->getObjectType()==ObjBaseRelationship)) + if(rel_type == BaseRelationship::RelationshipFk || + (BaseRelationship::RelationshipDep && this->object && this->object->getObjectType()==ObjBaseRelationship)) return(QSize(640, 320)); - else if(BaseRelationship::RELATIONSHIP_GEN) + else if(BaseRelationship::RelationshipGen) return(QSize(640, 520)); else return(QSize(640, 680)); @@ -495,10 +495,10 @@ void RelationshipWidget::useFKGlobalSettings(bool value) idx=deferral_cmb->findText(~rel->getDeferralType()); deferral_cmb->setCurrentIndex(idx < 0 ? 0 : idx); - idx=del_action_cmb->findText(~rel->getActionType(Constraint::DELETE_ACTION)); + idx=del_action_cmb->findText(~rel->getActionType(Constraint::DeleteAction)); del_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); - idx=upd_action_cmb->findText(~rel->getActionType(Constraint::UPDATE_ACTION)); + idx=upd_action_cmb->findText(~rel->getActionType(Constraint::UpdateAction)); upd_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); } } @@ -611,7 +611,7 @@ void RelationshipWidget::listAdvancedObjects(void) if(rel) { - if(rel->getRelationshipType()!=BaseRelationship::RELATIONSHIP_NN) + if(rel->getRelationshipType()!=BaseRelationship::RelationshipNn) { cols=rel->getGeneratedColumns(); count=cols.size(); @@ -647,7 +647,7 @@ void RelationshipWidget::listAdvancedObjects(void) } } } - else if(base_rel->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) + else if(base_rel->getRelationshipType()==BaseRelationship::RelationshipFk) { Constraint *fk = base_rel->getReferenceForeignKey(); @@ -734,7 +734,7 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) int res = 0; if(this->object->getObjectType() == ObjBaseRelationship) - parent_aux = dynamic_cast(this->object)->getTable(BaseRelationship::SRC_TABLE); + parent_aux = dynamic_cast(this->object)->getTable(BaseRelationship::SrcTable); else parent_aux = !parent ? this->object : parent; @@ -810,8 +810,8 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) if(curr_row >= 0) object = reinterpret_cast(tab->getRowData(curr_row).value()); - PgModelerNS::copyObject(&dup_object, object, obj_type); - dup_object->setName(PgModelerNS::generateUniqueName(dup_object, obj_list, false, QString("_cp"))); + PgModelerNs::copyObject(&dup_object, object, obj_type); + dup_object->setName(PgModelerNs::generateUniqueName(dup_object, obj_list, false, QString("_cp"))); op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, new_row, rel); @@ -1019,7 +1019,7 @@ void RelationshipWidget::listSpecialPkColumns(void) rel_columns_lst->clear(); - if(aux_rel->getRelationshipType()!=BaseRelationship::RELATIONSHIP_NN) + if(aux_rel->getRelationshipType()!=BaseRelationship::RelationshipNn) cols=aux_rel->getGeneratedColumns(); for(auto &attrib : aux_rel->getAttributes()) @@ -1117,31 +1117,31 @@ void RelationshipWidget::applyConfiguration(void) } rel->setCopyOptions(CopyOptions(copy_mode, copy_ops)); - rel->setMandatoryTable(BaseRelationship::SRC_TABLE, false); - rel->setMandatoryTable(BaseRelationship::DST_TABLE, false); + rel->setMandatoryTable(BaseRelationship::SrcTable, false); + rel->setMandatoryTable(BaseRelationship::DstTable, false); if(table1_mand_chk->isEnabled()) - rel->setMandatoryTable(BaseRelationship::SRC_TABLE, table1_mand_chk->isChecked()); + rel->setMandatoryTable(BaseRelationship::SrcTable, table1_mand_chk->isChecked()); if(table2_mand_chk->isEnabled()) - rel->setMandatoryTable(BaseRelationship::DST_TABLE, table2_mand_chk->isChecked()); + rel->setMandatoryTable(BaseRelationship::DstTable, table2_mand_chk->isChecked()); - if(rel_type==BaseRelationship::RELATIONSHIP_1N || - rel_type==BaseRelationship::RELATIONSHIP_11) + if(rel_type==BaseRelationship::Relationship1n || + rel_type==BaseRelationship::Relationship11) rel->setIdentifier(identifier_chk->isChecked()); - else if(rel_type==BaseRelationship::RELATIONSHIP_NN) + else if(rel_type==BaseRelationship::RelationshipNn) rel->setTableNameRelNN(relnn_tab_name_edt->text()); - if(rel_type==BaseRelationship::RELATIONSHIP_1N || - rel_type==BaseRelationship::RELATIONSHIP_11 || - rel_type==BaseRelationship::RELATIONSHIP_NN) + if(rel_type==BaseRelationship::Relationship1n || + rel_type==BaseRelationship::Relationship11 || + rel_type==BaseRelationship::RelationshipNn) { rel->setDeferrable(deferrable_chk->isChecked()); rel->setDeferralType(DeferralType(deferral_cmb->currentText())); - rel->setActionType((del_action_cmb->currentIndex()!=0 ? ActionType(del_action_cmb->currentText()) : ActionType::null), Constraint::DELETE_ACTION); - rel->setActionType((upd_action_cmb->currentIndex()!=0 ? ActionType(upd_action_cmb->currentText()) : ActionType::null), Constraint::UPDATE_ACTION); + rel->setActionType((del_action_cmb->currentIndex()!=0 ? ActionType(del_action_cmb->currentText()) : ActionType::null), Constraint::DeleteAction); + rel->setActionType((upd_action_cmb->currentIndex()!=0 ? ActionType(upd_action_cmb->currentText()) : ActionType::null), Constraint::UpdateAction); - if(rel_type==BaseRelationship::RELATIONSHIP_NN) + if(rel_type==BaseRelationship::RelationshipNn) rel->setSiglePKColumn(single_pk_chk->isChecked()); } @@ -1157,13 +1157,13 @@ void RelationshipWidget::applyConfiguration(void) try { //Checking if there is relationship redundancy - if(rel_type==BaseRelationship::RELATIONSHIP_DEP || - rel_type==BaseRelationship::RELATIONSHIP_GEN || - rel_type==BaseRelationship::RELATIONSHIP_PART || + if(rel_type==BaseRelationship::RelationshipDep || + rel_type==BaseRelationship::RelationshipGen || + rel_type==BaseRelationship::RelationshipPart || rel->isIdentifier()) model->checkRelationshipRedundancy(rel); - if(rel_type!=BaseRelationship::RELATIONSHIP_FK) + if(rel_type!=BaseRelationship::RelationshipFk) model->validateRelationships(); rel->blockSignals(false); diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index 2972ed41a9..6aec7e42bd 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -40,7 +40,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent type_ids.push_back(res.getColumnTypeId(col)); } - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { do { @@ -53,7 +53,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent item_data.push_back(res.getColumnValue(col)); } } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); } aux_cat.setFilter(Catalog::ListAllObjects); @@ -141,7 +141,7 @@ void ResultSetModel::append(ResultSet &res) { if(res.isValid() && !res.isEmpty()) { - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { do { @@ -160,7 +160,7 @@ void ResultSetModel::append(ResultSet &res) } } } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); } row_count += res.getTupleCount(); diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index 069bdd5e10..b50e4ec618 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -38,8 +38,8 @@ RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRole) role_grid->addWidget(frame, role_grid->count()+1, 0, 1, 4); frame->setParent(this); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion91)].push_back(can_replicate_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(bypass_rls_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion91)].push_back(can_replicate_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(bypass_rls_chk); frame=generateVersionWarningFrame(fields_map); role_grid->addWidget(frame, role_grid->count()+1, 0, 1, 0); frame->setParent(this); @@ -57,19 +57,19 @@ RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRole) obj_tab->setColumnCount(5); obj_tab->setHeaderLabel(trUtf8("Role"),0); - obj_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),0); + obj_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),0); obj_tab->setHeaderLabel(trUtf8("Validity"),1); - obj_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("validade")),1); + obj_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("validade")),1); obj_tab->setHeaderLabel(trUtf8("Member of"),2); - obj_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),2); + obj_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),2); obj_tab->setHeaderLabel(trUtf8("Members"),3); - obj_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),3); + obj_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),3); obj_tab->setHeaderLabel(trUtf8("Members (Admin.)"),4); - obj_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),4); + obj_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),4); grid=new QGridLayout; grid->addWidget(obj_tab,0,0,1,1); diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index 12f376a139..52f6f5a471 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -36,7 +36,7 @@ RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRule) commands_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); commands_tab->setHeaderLabel(trUtf8("SQL command"),0); - commands_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("codigosql")),0); + commands_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("codigosql")),0); dynamic_cast(commands_gb->layout())->addWidget(commands_tab, 1, 0, 1, 2); frame=generateInformationFrame(trUtf8("To create a rule that does not perform any action (DO NOTHING) simply do not specify commands in the SQL commands table.")); diff --git a/libpgmodeler_ui/src/sceneinfowidget.cpp b/libpgmodeler_ui/src/sceneinfowidget.cpp index 487fd382a1..6283b62153 100644 --- a/libpgmodeler_ui/src/sceneinfowidget.cpp +++ b/libpgmodeler_ui/src/sceneinfowidget.cpp @@ -38,7 +38,7 @@ void SceneInfoWidget::updateSelectedObject(BaseObjectView *object) { if(!object) { - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("fechar1"))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("fechar1"))); obj_name_lbl->setText(trUtf8("No selection")); obj_pos_info_lbl->setText(trUtf8("N/A")); } @@ -51,7 +51,7 @@ void SceneInfoWidget::updateSelectedObject(BaseObjectView *object) object->boundingRect().width(), object->boundingRect().height()); - obj_icon_lbl->setPixmap(PgModelerUiNS::getIconPath(object->getSourceObject()->getSchemaName())); + obj_icon_lbl->setPixmap(PgModelerUiNs::getIconPath(object->getSourceObject()->getSchemaName())); obj_name_lbl->setText(QString("%1 (%2)").arg(object->getSourceObject()->getSignature()).arg(object->getSourceObject()->getTypeName())); obj_pos_info_lbl->setText(QString("(%1, %2) [w: %3, h: %4]") .arg(roundf(rect.left())) @@ -65,7 +65,7 @@ void SceneInfoWidget::updateSelectedObjects(int obj_count, const QRectF &objs_re { QRect rect = objs_rect.toRect(); - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath("seltodos"))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("seltodos"))); obj_name_lbl->setText(trUtf8("Sel. objects: %1").arg(obj_count)); obj_pos_info_lbl->setText(QString("(%1, %2) [w: %3, h: %4]") .arg(rect.left()) diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 6e67df90a7..87733009b8 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -41,7 +41,7 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( //Creates a combo with the accepted object type for(auto &itr : types_map) { - ico.load(PgModelerUiNS::getIconPath(itr.second)); + ico.load(PgModelerUiNs::getIconPath(itr.second)); applies_to_cmb->addItem(ico, itr.first, itr.second); filter_cmb->addItem(ico, itr.first, itr.second); } @@ -59,7 +59,7 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( placeholders_ht=new HintTextWidget(placeholders_hint, this); placeholders_ht->setText(placeholders_chk->statusTip()); - snippet_txt=PgModelerUiNS::createNumberedTextEditor(snippet_wgt); + snippet_txt=PgModelerUiNs::createNumberedTextEditor(snippet_wgt); try { @@ -534,7 +534,7 @@ void SnippetsConfigWidget::configureSnippetsMenu(QMenu *snip_menu, vectorsetIcon(ico); @@ -548,7 +548,7 @@ void SnippetsConfigWidget::configureSnippetsMenu(QMenu *snip_menu, vectorsetToolTip(snip[ParsersAttributes::LABEL]); submenus[object]->addAction(act); } diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index 790fb0cc66..27f016946c 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -32,14 +32,14 @@ SourceCodeWidget::SourceCodeWidget(QWidget *parent): BaseObjectWidget(parent) hl_sqlcode=nullptr; hl_xmlcode=nullptr; - sqlcode_txt=PgModelerUiNS::createNumberedTextEditor(sqlcode_wgt); + sqlcode_txt=PgModelerUiNs::createNumberedTextEditor(sqlcode_wgt); sqlcode_txt->setReadOnly(true); - xmlcode_txt=PgModelerUiNS::createNumberedTextEditor(xmlcode_wgt); + xmlcode_txt=PgModelerUiNs::createNumberedTextEditor(xmlcode_wgt); xmlcode_txt->setReadOnly(true); name_edt->setReadOnly(true); - version_cmb->addItems(PgSQLVersions::AllVersions); + version_cmb->addItems(PgSqlVersions::AllVersions); code_options_ht=new HintTextWidget(code_options_hint, this); code_options_ht->setText( @@ -77,10 +77,10 @@ void SourceCodeWidget::setSourceCodeTab(int) enabled=(sourcecode_twg->currentIndex()==0 && ((obj_type==ObjBaseRelationship && - dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK) + dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk) || (obj_type!=ObjBaseRelationship && obj_type!=ObjTextbox))); - icone=QPixmap(PgModelerUiNS::getIconPath(code_icon)); + icone=QPixmap(PgModelerUiNs::getIconPath(code_icon)); icon_lbl->setPixmap(icone); version_cmb->setEnabled(enabled); pgsql_lbl->setEnabled(enabled); @@ -132,7 +132,7 @@ void SourceCodeWidget::generateSourceCode(int) obj_type=object->getObjectType(); if(obj_type!=ObjTextbox || (obj_type==ObjBaseRelationship && - dynamic_cast(object)->getRelationshipType()==BaseRelationship::RELATIONSHIP_FK)) + dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk)) { QString aux_def; BaseObject::setPgSQLVersion(version_cmb->currentText()); @@ -239,7 +239,7 @@ void SourceCodeWidget::setAttributes(DatabaseModel *model, BaseObject *object) code_options_cmb->setEnabled(false); #endif - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(object->getObjectType()))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(object->getObjectType()))); if(!hl_sqlcode->isConfigurationLoaded()) hl_sqlcode->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index d0b6751208..0326ac2262 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -33,8 +33,8 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) { setupUi(this); - sql_cmd_txt=PgModelerUiNS::createNumberedTextEditor(sql_cmd_wgt); - cmd_history_txt=PgModelerUiNS::createNumberedTextEditor(cmd_history_parent); + sql_cmd_txt=PgModelerUiNs::createNumberedTextEditor(sql_cmd_wgt); + cmd_history_txt=PgModelerUiNs::createNumberedTextEditor(cmd_history_parent); cmd_history_txt->setCustomContextMenuEnabled(false); cmd_history_txt->setTabStopWidth(sql_cmd_txt->getTabWidth()); @@ -85,9 +85,9 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) results_tbw->setItemDelegate(new PlainTextItemDelegate(this, true)); - action_load=new QAction(QIcon(PgModelerUiNS::getIconPath("abrir")), trUtf8("Load"), this); - action_save=new QAction(QIcon(PgModelerUiNS::getIconPath("salvar")), trUtf8("Save"), this); - action_save_as=new QAction(QIcon(PgModelerUiNS::getIconPath("salvar_como")), trUtf8("Save as"), this); + action_load=new QAction(QIcon(PgModelerUiNs::getIconPath("abrir")), trUtf8("Load"), this); + action_save=new QAction(QIcon(PgModelerUiNs::getIconPath("salvar")), trUtf8("Save"), this); + action_save_as=new QAction(QIcon(PgModelerUiNs::getIconPath("salvar_como")), trUtf8("Save as"), this); file_menu.addAction(action_load); file_menu.addAction(action_save); @@ -283,7 +283,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab item->setData(Qt::UserRole, type_names[res.getColumnTypeId(col)]); } - if(res.accessTuple(ResultSet::FIRST_TUPLE)) + if(res.accessTuple(ResultSet::FirstTuple)) { results_tbw->setRowCount(res.getTupleCount()); @@ -317,7 +317,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab results_tbw->setVerticalHeaderItem(row, new QTableWidgetItem(QString::number(row + 1))); row++; } - while(res.accessTuple(ResultSet::NEXT_TUPLE)); + while(res.accessTuple(ResultSet::NextTuple)); } results_tbw->setUpdatesEnabled(true); @@ -338,16 +338,16 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) switchToExecutionMode(false); msgoutput_lst->clear(); - PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNs::createOutputListItem(msgoutput_lst, QString("%1 %2").arg(time_str).arg(e.getErrorMessage()), - QPixmap(PgModelerUiNS::getIconPath("msgbox_erro")), false); + QPixmap(PgModelerUiNs::getIconPath("msgbox_erro")), false); if(e.getErrorType()==ConnectionTimeout || e.getErrorType()==ConnectionBroken) { - PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNs::createOutputListItem(msgoutput_lst, QString("%1 %2").arg(time_str).arg(trUtf8("No results retrieved or changes done due to the error above! Run the command again.")), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), false); + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), false); } msgoutput_lst->setVisible(true); @@ -405,18 +405,18 @@ void SQLExecutionWidget::finishExecution(int rows_affected) for(QString notice : sql_exec_hlp.getNotices()) { - PgModelerUiNS::createOutputListItem(msgoutput_lst, + PgModelerUiNs::createOutputListItem(msgoutput_lst, QString("[%1]: %2").arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))).arg(notice.trimmed()), - QPixmap(PgModelerUiNS::getIconPath("msgbox_alerta")), false); + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), false); } - PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command successfully executed in %2. %3 %4") + PgModelerUiNs::createOutputListItem(msgoutput_lst, + PgModelerUiNs::formatMessage(trUtf8("[%1]: SQL command successfully executed in %2. %3 %4") .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))) .arg(total_exec >= 1000 ? QString("%1 s").arg(total_exec/1000) : QString("%1 ms").arg(total_exec)) .arg(!res_model ? trUtf8("Rows affected") : trUtf8("Rows retrieved")) .arg(rows_affected)), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); output_tbw->setTabText(1, trUtf8("Messages (%1)").arg(msgoutput_lst->count())); } @@ -544,10 +544,10 @@ void SQLExecutionWidget::runSQLCommand(void) output_tbw->setTabEnabled(0, false); output_tbw->setTabText(0, trUtf8("Results")); output_tbw->setCurrentIndex(1); - PgModelerUiNS::createOutputListItem(msgoutput_lst, - PgModelerUiNS::formatMessage(trUtf8("[%1]: SQL command is running...") + PgModelerUiNs::createOutputListItem(msgoutput_lst, + PgModelerUiNs::formatMessage(trUtf8("[%1]: SQL command is running...") .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz")))), - QPixmap(PgModelerUiNS::getIconPath("msgbox_info"))); + QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); } void SQLExecutionWidget::saveCommands(void) @@ -874,7 +874,7 @@ void SQLExecutionWidget::loadSQLHistory(void) { try { - XMLParser xmlparser; + XmlParser xmlparser; attribs_map attribs; xmlparser.setDTDFile(GlobalAttributes::TmplConfigurationDir + @@ -892,7 +892,7 @@ void SQLExecutionWidget::loadSQLHistory(void) cmd_history.clear(); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -901,13 +901,13 @@ void SQLExecutionWidget::loadSQLHistory(void) xmlparser.getElementAttributes(attribs); xmlparser.savePosition(); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) cmd_history[attribs[ParsersAttributes::CONNECTION]].append(xmlparser.getElementContent()); xmlparser.restorePosition(); } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -967,14 +967,14 @@ void SQLExecutionWidget::enableSQLExecution(bool enable) void SQLExecutionWidget::showHistoryContextMenu(void) { QMenu *ctx_menu=cmd_history_txt->createStandardContextMenu(); - QAction *action_clear = new QAction(QPixmap(PgModelerUiNS::getIconPath("limpartexto")), trUtf8("Clear history"), ctx_menu), - *action_save = new QAction(QPixmap(PgModelerUiNS::getIconPath("salvar")), trUtf8("Save history"), ctx_menu), - *action_reload = new QAction(QPixmap(PgModelerUiNS::getIconPath("atualizar")), trUtf8("Reload history"), ctx_menu), + QAction *action_clear = new QAction(QPixmap(PgModelerUiNs::getIconPath("limpartexto")), trUtf8("Clear history"), ctx_menu), + *action_save = new QAction(QPixmap(PgModelerUiNs::getIconPath("salvar")), trUtf8("Save history"), ctx_menu), + *action_reload = new QAction(QPixmap(PgModelerUiNs::getIconPath("atualizar")), trUtf8("Reload history"), ctx_menu), *action_toggle_find = nullptr, *exec_act = nullptr; if(!find_history_parent->isVisible()) - action_toggle_find = new QAction(QPixmap(PgModelerUiNS::getIconPath("buscar")), trUtf8("Find in history"), ctx_menu); + action_toggle_find = new QAction(QPixmap(PgModelerUiNs::getIconPath("buscar")), trUtf8("Find in history"), ctx_menu); else action_toggle_find = new QAction(trUtf8("Hide find tool"), ctx_menu); diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index f0450dd9ba..027bce5c4b 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -33,7 +33,7 @@ SQLToolWidget::SQLToolWidget(QWidget * parent) : QWidget(parent) v_splitter->setSizes({1000, 400}); sql_exec_corner_btn = new QToolButton; - sql_exec_corner_btn->setIcon(QPixmap(PgModelerUiNS::getIconPath("newtab"))); + sql_exec_corner_btn->setIcon(QPixmap(PgModelerUiNs::getIconPath("newtab"))); sql_exec_corner_btn->setIconSize(QSize(18, 18)); sql_exec_corner_btn->setStyleSheet("QToolButton { margin-left: 4px; margin-bottom: 4px; padding: 2px; }"); sql_exec_corner_btn->setShortcut(QKeySequence("Ctrl+T")); diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index e5b331a13c..a17a848b9a 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -12,7 +12,7 @@ SwapObjectsIdsWidget::SwapObjectsIdsWidget(QWidget *parent, Qt::WindowFlags f) : ObjColumn, ObjConstraint }); setupUi(this); - PgModelerUiNS::configureWidgetFont(message_lbl, PgModelerUiNS::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); src_object_sel=nullptr; dst_object_sel=nullptr; @@ -156,7 +156,7 @@ void SwapObjectsIdsWidget::showObjectId(void) if(sel_obj) { id_lbl->setText(ID_LABEL.arg(sel_obj->getObjectId())); - ico_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(sel_obj->getObjectType()))); + ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(sel_obj->getObjectType()))); ico_lbl->setToolTip(sel_obj->getTypeName()); id_lbl->setVisible(true); diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 17c0eca4dd..666c46591b 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -382,7 +382,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) xmlparser.loadXMLFile(filename); - if(xmlparser.accessElement(XMLParser::ChildElement)) + if(xmlparser.accessElement(XmlParser::ChildElement)) { do { @@ -423,7 +423,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) //Marks a flag indication that groups are being declared groups_decl=true; xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); elem=xmlparser.getElementName(); } @@ -443,7 +443,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group is being declared and build at the declaration statment (not permitted) - else if(attribs.size() > 1 || xmlparser.hasElement(XMLParser::ChildElement)) + else if(attribs.size() > 1 || xmlparser.hasElement(XmlParser::ChildElement)) { throw Exception(Exception::getErrorMessage(InvGroupDeclaration) .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), @@ -469,7 +469,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) DefNotDeclaredGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group does not have children element - else if(!xmlparser.hasElement(XMLParser::ChildElement)) + else if(!xmlparser.hasElement(XmlParser::ChildElement)) { throw Exception(Exception::getErrorMessage(DefEmptyGroup).arg(group), DefEmptyGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -507,7 +507,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) xmlparser.savePosition(); - xmlparser.accessElement(XMLParser::ChildElement); + xmlparser.accessElement(XmlParser::ChildElement); if(chr_sensitive) regexp.setCaseSensitivity(Qt::CaseSensitive); @@ -539,7 +539,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) final_exprs[group].push_back(regexp); } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); xmlparser.restorePosition(); } } @@ -547,14 +547,14 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) /* Check if there are some other groups to be declared, if not, continues to reading to the other part of configuration */ - if(groups_decl && !xmlparser.hasElement(XMLParser::NextElement)) + if(groups_decl && !xmlparser.hasElement(XmlParser::NextElement)) { groups_decl=false; xmlparser.restorePosition(); } } - while(xmlparser.accessElement(XMLParser::NextElement)); + while(xmlparser.accessElement(XmlParser::NextElement)); } itr=groups_order.begin(); diff --git a/libpgmodeler_ui/src/syntaxhighlighter.h b/libpgmodeler_ui/src/syntaxhighlighter.h index a3300c0d08..9267318ce1 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.h +++ b/libpgmodeler_ui/src/syntaxhighlighter.h @@ -58,7 +58,7 @@ class SyntaxHighlighter: public QSyntaxHighlighter { }; //! \brief XML parser used to parse configuration files - XMLParser xmlparser; + XmlParser xmlparser; //! \brief Default font configuratoin for all instances os syntax highlighter static QFont default_font; diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 4ea8bed101..7d89d03909 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -28,7 +28,7 @@ TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjB Ui_TableDataWidget::setupUi(this); configureFormLayout(tabledata_grid, ObjBaseObject); - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNS::getIconPath(ObjTable))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(ObjTable))); comment_lbl->setVisible(false); comment_edt->setVisible(false); @@ -84,7 +84,7 @@ TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjB }); connect(bulkedit_tb, &QToolButton::clicked, [&](){ - PgModelerUiNS::bulkDataEdit(data_tbw); + PgModelerUiNs::bulkDataEdit(data_tbw); }); connect(copy_tb, &QToolButton::clicked, [&](){ @@ -491,9 +491,9 @@ QString TableDataWidget::generateDataBuffer(void) value = data_tbw->item(row, col)->text(); //Checking if the value is a malformed unescaped value, e.g., {value, value}, {value\} - if((value.startsWith(PgModelerNS::UNESC_VALUE_START) && value.endsWith(QString("\\") + PgModelerNS::UNESC_VALUE_END)) || - (value.startsWith(PgModelerNS::UNESC_VALUE_START) && !value.endsWith(PgModelerNS::UNESC_VALUE_END)) || - (!value.startsWith(PgModelerNS::UNESC_VALUE_START) && !value.endsWith(QString("\\") + PgModelerNS::UNESC_VALUE_END) && value.endsWith(PgModelerNS::UNESC_VALUE_END))) + if((value.startsWith(PgModelerNs::UNESC_VALUE_START) && value.endsWith(QString("\\") + PgModelerNs::UNESC_VALUE_END)) || + (value.startsWith(PgModelerNs::UNESC_VALUE_START) && !value.endsWith(PgModelerNs::UNESC_VALUE_END)) || + (!value.startsWith(PgModelerNs::UNESC_VALUE_START) && !value.endsWith(QString("\\") + PgModelerNs::UNESC_VALUE_END) && value.endsWith(PgModelerNs::UNESC_VALUE_END))) throw Exception(Exception::getErrorMessage(MalformedUnescapedValue) .arg(row + 1).arg(col_names[col]), MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 958d6c7a54..aeb6204f06 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -41,7 +41,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) Ui_TableWidget::setupUi(this); edt_data_tb=new QPushButton(this); - QPixmap icon=QPixmap(PgModelerUiNS::getIconPath("editdata")); + QPixmap icon=QPixmap(PgModelerUiNs::getIconPath("editdata")); edt_data_tb->setMinimumSize(edt_perms_tb->minimumSize()); edt_data_tb->setText(trUtf8("Edit data")); edt_data_tb->setToolTip(trUtf8("Define initial data for the table")); @@ -51,10 +51,10 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) connect(edt_data_tb, SIGNAL(clicked(bool)), this, SLOT(editData())); misc_btns_lt->insertWidget(1, edt_data_tb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion91)].push_back(unlogged_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(enable_rls_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion95)].push_back(force_rls_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion100)].push_back(partitioning_type_lbl); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion91)].push_back(unlogged_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(enable_rls_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(force_rls_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion100)].push_back(partitioning_type_lbl); frame=generateVersionWarningFrame(fields_map); table_grid->addWidget(frame, table_grid->count()+1, 0, 1, 2); frame->setParent(this); @@ -62,11 +62,11 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) parent_tables = new ObjectsTableWidget(ObjectsTableWidget::NO_BUTTONS, true, this); parent_tables->setColumnCount(3); parent_tables->setHeaderLabel(trUtf8("Name"), 0); - parent_tables->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + parent_tables->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); parent_tables->setHeaderLabel(trUtf8("Schema"), 1); - parent_tables->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("schema")),1); + parent_tables->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("schema")),1); parent_tables->setHeaderLabel(trUtf8("Type"), 2); - parent_tables->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),2); + parent_tables->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),2); tag_sel = new ObjectSelectorWidget(ObjTag, false, this); vbox = new QVBoxLayout(tag_sel_parent); @@ -102,9 +102,9 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) objects_tab_map[ObjColumn]->setColumnCount(6); objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("PK"), 0); objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Name"), 1); - objects_tab_map[ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),1); + objects_tab_map[ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),1); objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Type"), 2); - objects_tab_map[ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),2); + objects_tab_map[ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),2); objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Default Value"), 3); objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Attribute(s)"), 4); objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Alias"), 5); @@ -126,46 +126,46 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) objects_tab_map[ObjConstraint]->setColumnCount(5); objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Type"), 1); - objects_tab_map[ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + objects_tab_map[ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("ON DELETE"), 2); objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("ON UPDATE"), 3); objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Alias"), 4); objects_tab_map[ObjTrigger]->setColumnCount(5); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("table")),1); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("trigger")),2); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Alias"), 4); objects_tab_map[ObjRule]->setColumnCount(4); objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Event"), 2); objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Alias"), 3); objects_tab_map[ObjIndex]->setColumnCount(3); objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Alias"), 2); objects_tab_map[ObjPolicy]->setColumnCount(7); objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Command"), 1); - objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("keyword")),1); + objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("keyword")),1); objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Permissive"), 2); objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("USING expression"), 3); objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("CHECK expression"), 4); objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Roles"), 5); - objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("role")),5); + objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),5); objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Alias"), 6); partition_keys_tab = new ElementsTableWidget; @@ -730,8 +730,8 @@ void TableWidget::duplicateObject(int sel_row, int new_row) if(sel_row >= 0) object = reinterpret_cast(obj_table->getRowData(sel_row).value()); - PgModelerNS::copyObject(&dup_object, object, obj_type); - dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *table->getObjectList(obj_type), false, QString("_cp"))); + PgModelerNs::copyObject(&dup_object, object, obj_type); + dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *table->getObjectList(obj_type), false, QString("_cp"))); op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, new_row, this->object); @@ -861,17 +861,17 @@ void TableWidget::applyConfiguration(void) pk = new Constraint; pk->setName(pk_name); - pk->setName(PgModelerNS::generateUniqueName(pk, *table->getObjectList(ObjConstraint))); + pk->setName(PgModelerNs::generateUniqueName(pk, *table->getObjectList(ObjConstraint))); for(Column *col : pk_cols) - pk->addColumn(col, Constraint::SOURCE_COLS); + pk->addColumn(col, Constraint::SourceCols); table->addConstraint(pk); op_list->registerObject(pk, Operation::OBJECT_CREATED, -1, table); } else if(!pk->isAddedByRelationship()) { - vector orig_pk_cols = pk->getColumns(Constraint::SOURCE_COLS); + vector orig_pk_cols = pk->getColumns(Constraint::SourceCols); //If the table owns a pk we only update the columns op_list->registerObject(pk, Operation::OBJECT_MODIFIED, -1, table); @@ -882,13 +882,13 @@ void TableWidget::applyConfiguration(void) for(auto col : orig_pk_cols) { if(std::find(pk_cols.begin(), pk_cols.end(), col) != pk_cols.end()) - pk->addColumn(col, Constraint::SOURCE_COLS); + pk->addColumn(col, Constraint::SourceCols); } /* Adding the other columns selected in the grid as pk columns. * Duplicated columns are discarded by the method Constraint::addColumn */ for(Column *col : pk_cols) - pk->addColumn(col, Constraint::SOURCE_COLS); + pk->addColumn(col, Constraint::SourceCols); } } else if(pk_cols.empty() && pk && !pk->isAddedByRelationship()) @@ -927,9 +927,9 @@ void TableWidget::applyConfiguration(void) rels=model->getRelationships(table); for(auto &rel : rels) { - if(rel->getRelationshipType()==Relationship::RELATIONSHIP_11 || - rel->getRelationshipType()==Relationship::RELATIONSHIP_1N || - rel->getRelationshipType()==Relationship::RELATIONSHIP_FK) + if(rel->getRelationshipType()==Relationship::Relationship11 || + rel->getRelationshipType()==Relationship::Relationship1n || + rel->getRelationshipType()==Relationship::RelationshipFk) rel->setModified(true); } } diff --git a/libpgmodeler_ui/src/taskprogresswidget.cpp b/libpgmodeler_ui/src/taskprogresswidget.cpp index 930d7cd739..207a58d1d0 100644 --- a/libpgmodeler_ui/src/taskprogresswidget.cpp +++ b/libpgmodeler_ui/src/taskprogresswidget.cpp @@ -28,7 +28,7 @@ TaskProgressWidget::TaskProgressWidget(QWidget *parent, Qt::WindowFlags f) : QDi this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); for(auto &obj_tp : obj_types) - addIcon(obj_tp, QIcon(PgModelerUiNS::getIconPath(obj_tp))); + addIcon(obj_tp, QIcon(PgModelerUiNs::getIconPath(obj_tp))); } void TaskProgressWidget::addIcon(unsigned id, const QIcon &ico) @@ -43,7 +43,7 @@ void TaskProgressWidget::show(void) isn't used the task is not shown properly and sometimes stay only on taskbar not poping up to the user. */ QEventLoop eventLoop; - PgModelerUiNS::resizeDialog(this); + PgModelerUiNs::resizeDialog(this); QDialog::show(); QTimer t; @@ -66,7 +66,7 @@ void TaskProgressWidget::updateProgress(int progress, QString text, unsigned ico progress_pb->setValue(progress); if(!text.isEmpty()) - text_lbl->setText(PgModelerUiNS::formatMessage(text)); + text_lbl->setText(PgModelerUiNs::formatMessage(text)); if(icons.count(icon_id)) icon_lbl->setPixmap(icons[icon_id].pixmap(QSize(32,32))); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index 8b5e59d8c6..f7679144c7 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -44,9 +44,9 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjTrigg columns_tab->setColumnCount(2); columns_tab->setHeaderLabel(trUtf8("Column"), 0); - columns_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("column")),0); + columns_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("column")),0); columns_tab->setHeaderLabel(trUtf8("Type"), 1); - columns_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + columns_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); dynamic_cast(arg_cols_tbw->widget(1)->layout())->addWidget(columns_tab, 1,0,1,3); dynamic_cast(arg_cols_tbw->widget(0)->layout())->addWidget(arguments_tab, 1,0,1,3); diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index a4cd83f46f..f0980887f4 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -56,11 +56,11 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) attributes_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); attributes_tab->setColumnCount(3); attributes_tab->setHeaderLabel(trUtf8("Name"),0); - attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); attributes_tab->setHeaderLabel(trUtf8("Type"),1); - attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("usertype")),1); + attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); attributes_tab->setHeaderLabel(trUtf8("Collation"),2); - attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("collation")),2); + attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("collation")),2); grid=dynamic_cast(attributes_gb->layout()); diff --git a/libpgmodeler_ui/src/updatenotifierwidget.cpp b/libpgmodeler_ui/src/updatenotifierwidget.cpp index 3eb74267ae..ad28e34800 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.cpp +++ b/libpgmodeler_ui/src/updatenotifierwidget.cpp @@ -47,9 +47,9 @@ UpdateNotifierWidget::UpdateNotifierWidget(QWidget *parent) : QWidget(parent) emit s_visibilityChanged(false); }); - PgModelerUiNS::configureWidgetFont(changelog_txt, PgModelerUiNS::MEDIUM_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(ver_num_lbl, PgModelerUiNS::BIG_FONT_FACTOR); - PgModelerUiNS::configureWidgetFont(title_lbl, PgModelerUiNS::BIG_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(changelog_txt, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(ver_num_lbl, PgModelerUiNs::BIG_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::BIG_FONT_FACTOR); this->adjustSize(); } diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 50563faa49..471467cb50 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -91,21 +91,21 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjView) objects_tab_map[ObjTrigger]->setColumnCount(4); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("table")),1); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("trigger")),2); + objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); objects_tab_map[ObjIndex]->setColumnCount(2); objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); objects_tab_map[ObjRule]->setColumnCount(3); objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNS::getIconPath("uid")),0); + objects_tab_map[ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Event"), 2); @@ -113,9 +113,9 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjView) tablespace_lbl->setEnabled(false); configureFormLayout(view_grid, ObjView); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion93)].push_back(recursive_rb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion93)].push_back(materialized_rb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSQLVersions::PgSQLVersion93)].push_back(with_no_data_chk); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(recursive_rb); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(materialized_rb); + fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(with_no_data_chk); frame=generateVersionWarningFrame(fields_map); view_grid->addWidget(frame, view_grid->count()+1, 0, 1,3); frame->setParent(this); @@ -216,8 +216,8 @@ void ViewWidget::duplicateObject(int curr_row, int new_row) if(curr_row >= 0) object = reinterpret_cast(obj_table->getRowData(curr_row).value()); - PgModelerNS::copyObject(&dup_object, object, obj_type); - dup_object->setName(PgModelerNS::generateUniqueName(dup_object, *view->getObjectList(obj_type), false, QString("_cp"))); + PgModelerNs::copyObject(&dup_object, object, obj_type); + dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *view->getObjectList(obj_type), false, QString("_cp"))); op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, new_row, this->object); diff --git a/libpgmodeler_ui/src/welcomewidget.cpp b/libpgmodeler_ui/src/welcomewidget.cpp index bc9424d49e..fcd92d93fa 100644 --- a/libpgmodeler_ui/src/welcomewidget.cpp +++ b/libpgmodeler_ui/src/welcomewidget.cpp @@ -36,7 +36,7 @@ WelcomeWidget::WelcomeWidget(QWidget *parent): QWidget(parent) btn->setGraphicsEffect(shadow); #ifdef Q_OS_LINUX - PgModelerUiNS::__configureWidgetFont(btn, 1.20f); + PgModelerUiNs::__configureWidgetFont(btn, 1.20f); #else PgModelerUiNS::__configureWidgetFont(btn, 1.50f); #endif diff --git a/libutils/src/pgsqlversions.cpp b/libutils/src/pgsqlversions.cpp index 4620acecdc..509c822699 100644 --- a/libutils/src/pgsqlversions.cpp +++ b/libutils/src/pgsqlversions.cpp @@ -18,24 +18,24 @@ #include "pgsqlversions.h" -namespace PgSQLVersions { +namespace PgSqlVersions { const QString - PgSQLVersion90=QString("9.0"), - PgSQLVersion91=QString("9.1"), - PgSQLVersion92=QString("9.2"), - PgSQLVersion93=QString("9.3"), - PgSQLVersion94=QString("9.4"), - PgSQLVersion95=QString("9.5"), - PgSQLVersion96=QString("9.6"), - PgSQLVersion100=QString("10.0"), - PgSQLVersion110=QString("11.0"), - DefaulVersion=PgSQLVersion110; + PgSqlVersion90=QString("9.0"), + PgSqlVersion91=QString("9.1"), + PgSqlVersion92=QString("9.2"), + PgSqlVersion93=QString("9.3"), + PgSqlVersion94=QString("9.4"), + PgSqlVersion95=QString("9.5"), + PgSqlVersion96=QString("9.6"), + PgSqlVersion100=QString("10.0"), + PgSqlVersion110=QString("11.0"), + DefaulVersion=PgSqlVersion110; const QStringList AllVersions={ - PgSQLVersion110, PgSQLVersion100, - PgSQLVersion96, PgSQLVersion95, - PgSQLVersion94, PgSQLVersion93, - PgSQLVersion92, PgSQLVersion91, - PgSQLVersion90 }; + PgSqlVersion110, PgSqlVersion100, + PgSqlVersion96, PgSqlVersion95, + PgSqlVersion94, PgSqlVersion93, + PgSqlVersion92, PgSqlVersion91, + PgSqlVersion90 }; } diff --git a/libutils/src/pgsqlversions.h b/libutils/src/pgsqlversions.h index 1dafacd0bf..48e5e7264c 100644 --- a/libutils/src/pgsqlversions.h +++ b/libutils/src/pgsqlversions.h @@ -28,17 +28,17 @@ #include -namespace PgSQLVersions { +namespace PgSqlVersions { extern const QString - PgSQLVersion90, - PgSQLVersion91, - PgSQLVersion92, - PgSQLVersion93, - PgSQLVersion94, - PgSQLVersion95, - PgSQLVersion96, - PgSQLVersion100, - PgSQLVersion110, + PgSqlVersion90, + PgSqlVersion91, + PgSqlVersion92, + PgSqlVersion93, + PgSqlVersion94, + PgSqlVersion95, + PgSqlVersion96, + PgSqlVersion100, + PgSqlVersion110, DefaulVersion; extern const QStringList AllVersions; diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index ff50d6e098..a1cf505ca3 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1150,7 +1150,7 @@ void PgModelerCLI::fixOpClassesFamiliesReferences(QString &obj_xml) obj_name.remove('"'); //Transforming xml entity for quote into the char - obj_name.replace(XMLParser::CharQuot, QString("\"")); + obj_name.replace(XmlParser::CharQuot, QString("\"")); for(QString idx_type : index_types) { @@ -1160,7 +1160,7 @@ void PgModelerCLI::fixOpClassesFamiliesReferences(QString &obj_xml) if(model->getObjectIndex(aux_obj_name, ref_obj_type) >= 0) { //Replacing the old signature with the corrected form - aux_obj_name.replace(QString("\""), XMLParser::CharQuot); + aux_obj_name.replace(QString("\""), XmlParser::CharQuot); obj_xml.replace(pos, sign_regexp.matchedLength(), QString("signature=\"%1\"").arg(aux_obj_name)); break; } diff --git a/main-cli/src/pgmodelercli.h b/main-cli/src/pgmodelercli.h index 0b4ebb577e..ab84d2e495 100644 --- a/main-cli/src/pgmodelercli.h +++ b/main-cli/src/pgmodelercli.h @@ -43,7 +43,7 @@ class PgModelerCLI: public QApplication { private: Q_OBJECT - XMLParser *xmlparser; + XmlParser *xmlparser; //! \brief Export helper object ModelExportHelper export_hlp; diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index 78f7082de8..3baa69dd31 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -59,7 +59,7 @@ void Xml2ObjectWidget::generateObject(void) BaseObject *object=nullptr; ObjectType obj_type; QString elem_name; - XMLParser *xmlparser=model->getXMLParser(); + XmlParser *xmlparser=model->getXMLParser(); if(!op_list->isOperationChainStarted()) op_list->startOperationChain(); @@ -67,7 +67,7 @@ void Xml2ObjectWidget::generateObject(void) xmlparser->restartParser(); xmlparser->loadXMLBuffer(code_txt->toPlainText().toUtf8()); - if(xmlparser->accessElement(XMLParser::ChildElement)) + if(xmlparser->accessElement(XmlParser::ChildElement)) { do { diff --git a/tests/src/partrelationshiptest/partrelationshiptest.cpp b/tests/src/partrelationshiptest/partrelationshiptest.cpp index 303e70924b..c2533c1671 100644 --- a/tests/src/partrelationshiptest/partrelationshiptest.cpp +++ b/tests/src/partrelationshiptest/partrelationshiptest.cpp @@ -57,7 +57,7 @@ void PartRelationhipTest::connRelTableNoColumnsAndTableTwoColumns(void) partitioned->addColumn(col); partitioned->addColumn(col1); - part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel = new Relationship(BaseRelationship::RelationshipPart, partition, partitioned); part_rel->connectRelationship(); QVERIFY(partitioned->getColumnCount() == partition->getColumnCount()); @@ -104,7 +104,7 @@ void PartRelationhipTest::connRelTablesTwoColumnsSameNameShouldNotRaiseError(voi partition->addColumn(col); partition->addColumn(col1); - part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel = new Relationship(BaseRelationship::RelationshipPart, partition, partitioned); part_rel->connectRelationship(); QVERIFY(partitioned->getColumnCount() == partition->getColumnCount()); @@ -155,7 +155,7 @@ void PartRelationhipTest::connRelTablePartionHasMoreColsThanPartitionedTableShou partition->addColumn(col1); partition->addColumn(col2); - part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel = new Relationship(BaseRelationship::RelationshipPart, partition, partitioned); part_rel->connectRelationship(); QFAIL("Should return exception because tables have different column count!"); @@ -202,7 +202,7 @@ void PartRelationhipTest::connRelTablePartionHasDifferentColsThanPartitionedTabl partition->addColumn(col); partition->addColumn(col1); - part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel = new Relationship(BaseRelationship::RelationshipPart, partition, partitioned); part_rel->connectRelationship(); QFAIL("Should return exception because tables have different columns names!"); @@ -249,7 +249,7 @@ void PartRelationhipTest::connRelShouldInvalidateIfPartitionedColumnChanges(void partition->addColumn(col); partition->addColumn(col1); - part_rel = new Relationship(BaseRelationship::RELATIONSHIP_PART, partition, partitioned); + part_rel = new Relationship(BaseRelationship::RelationshipPart, partition, partitioned); part_rel->connectRelationship(); partitioned->getColumn(0)->setName("new_id"); From ea10b42283c0004bf7aabc7e8269ffcfa84c2f6e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 08:25:09 -0300 Subject: [PATCH 166/425] Static const attributes refactoring checkpoint --- libpgmodeler/src/conversion.cpp | 8 +-- libpgmodeler/src/conversion.h | 4 +- libpgmodeler/src/copyoptions.cpp | 32 ++++++------ libpgmodeler/src/copyoptions.h | 20 ++++---- libpgmodeler/src/databasemodel.cpp | 52 ++++++++++---------- libpgmodeler/src/databasemodel.h | 30 +++++------ libpgmodeler_ui/src/conversionwidget.cpp | 8 +-- libpgmodeler_ui/src/metadatahandlingform.cpp | 24 ++++----- libpgmodeler_ui/src/relationshipwidget.cpp | 38 +++++++------- 9 files changed, 108 insertions(+), 108 deletions(-) diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index e94c6bed92..e6f6ffc284 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -32,7 +32,7 @@ Conversion::Conversion(void) void Conversion::setEncoding(unsigned encoding_idx, EncodingType encoding_type) { //Checks if the encoding index is valid - if(encoding_idx<=DST_ENCODING) + if(encoding_idx<=DstEncoding) { //If the passed enconding type is null an error is raised if((~encoding_type).isEmpty()) @@ -94,7 +94,7 @@ void Conversion::setDefault(bool value) EncodingType Conversion::getEncoding(unsigned encoding_idx) { - if(encoding_idx > DST_ENCODING) + if(encoding_idx > DstEncoding) throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->encodings[encoding_idx]); @@ -116,8 +116,8 @@ QString Conversion::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); attributes[ParsersAttributes::DEFAULT]=(is_default ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::SRC_ENCODING]=(~encodings[SRC_ENCODING]); - attributes[ParsersAttributes::DST_ENCODING]=(~encodings[DST_ENCODING]); + attributes[ParsersAttributes::SRC_ENCODING]=(~encodings[SrcEncoding]); + attributes[ParsersAttributes::DST_ENCODING]=(~encodings[DstEncoding]); if(conversion_func) { diff --git a/libpgmodeler/src/conversion.h b/libpgmodeler/src/conversion.h index 7a59408fb2..a0f7f1a4b9 100644 --- a/libpgmodeler/src/conversion.h +++ b/libpgmodeler/src/conversion.h @@ -45,8 +45,8 @@ class Conversion: public BaseObject { public: //! \brief Constants used to access the conversion encodings - static constexpr unsigned SRC_ENCODING=0, - DST_ENCODING=1; + static constexpr unsigned SrcEncoding=0, + DstEncoding=1; Conversion(void); diff --git a/libpgmodeler/src/copyoptions.cpp b/libpgmodeler/src/copyoptions.cpp index 569a1c691a..9501a62e6f 100644 --- a/libpgmodeler/src/copyoptions.cpp +++ b/libpgmodeler/src/copyoptions.cpp @@ -26,7 +26,7 @@ CopyOptions::CopyOptions(void) CopyOptions::CopyOptions(unsigned copy_mode, unsigned copy_op_ids) { - if((copy_mode!=0 && copy_mode!=INCLUDING && copy_mode!=EXCLUDING) || copy_op_ids > ALL) + if((copy_mode!=0 && copy_mode!=Including && copy_mode!=Excluding) || copy_op_ids > All) throw Exception(RefInvalidLikeOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->copy_mode = copy_mode; @@ -40,7 +40,7 @@ unsigned CopyOptions::getCopyMode(void) bool CopyOptions::isOptionSet(unsigned op) { - if(op > ALL) + if(op > All) throw Exception(RefInvalidLikeOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return((copy_op_ids & op) == op); @@ -48,12 +48,12 @@ bool CopyOptions::isOptionSet(unsigned op) bool CopyOptions::isIncluding(void) { - return(copy_mode & INCLUDING); + return(copy_mode & Including); } bool CopyOptions::isExcluding(void) { - return(copy_mode & EXCLUDING); + return(copy_mode & Excluding); } unsigned CopyOptions::getCopyOptionsIds(void) @@ -65,11 +65,11 @@ QString CopyOptions::getSQLDefinition(void) { QString def, mode, op_name; unsigned op_id, - ids[]={ALL, DEFAULTS, CONSTRAINTS, INDEXES, - STORAGE, COMMENTS, IDENTITY, STATISTICS }, + ids[]={All, Defaults, Constraints, Indexes, + Storage, Comments, Identity, Statistics }, cnt = sizeof(ids) / sizeof(unsigned); - mode = (copy_mode == INCLUDING ? QString(" INCLUDING") : QString(" EXCLUDING")); + mode = (copy_mode == Including ? QString(" INCLUDING") : QString(" EXCLUDING")); if(copy_mode!=0 && copy_op_ids!=0) { for(unsigned i=0; i < cnt; i++) @@ -78,14 +78,14 @@ QString CopyOptions::getSQLDefinition(void) switch(op_id) { - case ALL: op_name=QString(" ALL"); break; - case DEFAULTS: op_name=QString(" DEFAULTS"); break; - case CONSTRAINTS: op_name=QString(" CONSTRAINTS"); break; - case INDEXES: op_name=QString(" INDEXES"); break; - case STORAGE: op_name=QString(" STORAGE"); break; - case COMMENTS: op_name=QString(" COMMENTS"); break; - case IDENTITY: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSqlVersions::PgSqlVersion96.toFloat() ? QString(" IDENTITY") : QString()); break; - case STATISTICS: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSqlVersions::PgSqlVersion96.toFloat() ? QString(" STATISTICS") : QString()); break; + case All: op_name=QString(" ALL"); break; + case Defaults: op_name=QString(" DEFAULTS"); break; + case Constraints: op_name=QString(" CONSTRAINTS"); break; + case Indexes: op_name=QString(" INDEXES"); break; + case Storage: op_name=QString(" STORAGE"); break; + case Comments: op_name=QString(" COMMENTS"); break; + case Identity: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSqlVersions::PgSqlVersion96.toFloat() ? QString(" IDENTITY") : QString()); break; + case Statistics: op_name=(BaseObject::getPgSQLVersion().toFloat() > PgSqlVersions::PgSqlVersion96.toFloat() ? QString(" STATISTICS") : QString()); break; } if(!op_name.isEmpty()) @@ -94,7 +94,7 @@ QString CopyOptions::getSQLDefinition(void) op_name.clear(); } - if(op_id==ALL) break; + if(op_id==All) break; } } diff --git a/libpgmodeler/src/copyoptions.h b/libpgmodeler/src/copyoptions.h index d1f1581bda..84aff471e7 100644 --- a/libpgmodeler/src/copyoptions.h +++ b/libpgmodeler/src/copyoptions.h @@ -33,16 +33,16 @@ class CopyOptions { unsigned copy_mode, copy_op_ids; public: - static constexpr unsigned DEFAULTS=1, - CONSTRAINTS=2, - INDEXES=4, - STORAGE=8, - COMMENTS=16, - IDENTITY=32, - STATISTICS=64, - ALL=127, - INCLUDING=256, - EXCLUDING=512; + static constexpr unsigned Defaults=1, + Constraints=2, + Indexes=4, + Storage=8, + Comments=16, + Identity=32, + Statistics=64, + All=127, + Including=256, + Excluding=512; CopyOptions(void); CopyOptions(unsigned copy_mode, unsigned copy_op_ids); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index fe4ef71235..86be735030 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4299,10 +4299,10 @@ Conversion *DatabaseModel::createConversion(void) setBasicAttributes(conv); xmlparser.getElementAttributes(attribs); - conv->setEncoding(Conversion::SRC_ENCODING, + conv->setEncoding(Conversion::SrcEncoding, EncodingType(attribs[ParsersAttributes::SRC_ENCODING])); - conv->setEncoding(Conversion::DST_ENCODING, + conv->setEncoding(Conversion::DstEncoding, EncodingType(attribs[ParsersAttributes::DST_ENCODING])); conv->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::_TRUE_); @@ -9500,18 +9500,18 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option ParsersAttributes::DST_LABEL, ParsersAttributes::NAME_LABEL }; - save_db_attribs=(META_DB_ATTRIBUTES & options) == META_DB_ATTRIBUTES; - save_objs_pos=(META_OBJS_POSITIONING & options) == META_OBJS_POSITIONING; - save_objs_prot=(META_OBJS_PROTECTION & options) == META_OBJS_PROTECTION; - save_objs_sqldis=(META_OBJS_SQLDISABLED & options) == META_OBJS_SQLDISABLED; - save_textboxes=(META_TEXTBOX_OBJS & options) == META_TEXTBOX_OBJS; - save_tags=(META_TAG_OBJS & options) == META_TAG_OBJS; - save_custom_sql=(META_OBJS_CUSTOMSQL & options) == META_OBJS_CUSTOMSQL; - save_custom_colors=(META_OBJS_CUSTOMCOLORS & options) == META_OBJS_CUSTOMCOLORS; - save_fadeout=(META_OBJS_FADEDOUT & options) == META_OBJS_FADEDOUT; - save_extattribs=(META_OBJS_EXTATTRIBS & options) == META_OBJS_EXTATTRIBS; - save_genericsqls=(META_GENERIC_SQL_OBJS & options) == META_GENERIC_SQL_OBJS; - save_objs_aliases=(META_OBJS_ALIASES & options) == META_OBJS_ALIASES; + save_db_attribs=(MetaDbAttributes & options) == MetaDbAttributes; + save_objs_pos=(MetaObjsPositioning & options) == MetaObjsPositioning; + save_objs_prot=(MetaObjsProtection & options) == MetaObjsProtection; + save_objs_sqldis=(MetaObjsSqlDisabled & options) == MetaObjsSqlDisabled; + save_textboxes=(MetaTextboxObjs & options) == MetaTextboxObjs; + save_tags=(MetaTagObjs & options) == MetaTagObjs; + save_custom_sql=(MetaObjsCustomSql & options) == MetaObjsCustomSql; + save_custom_colors=(MetaObjsCustomColors & options) == MetaObjsCustomColors; + save_fadeout=(MetaObjsFadeOut & options) == MetaObjsFadeOut; + save_extattribs=(MetaObjsExtAttribs & options) == MetaObjsExtAttribs; + save_genericsqls=(MetaGenericSqlObjs & options) == MetaGenericSqlObjs; + save_objs_aliases=(MetaObjsAliases & options) == MetaObjsAliases; output.open(QFile::WriteOnly); @@ -9837,18 +9837,18 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option load_custom_sql=false, load_custom_colors=false, load_fadeout=false, load_extattribs=false, load_genericsqls=false, load_objs_aliases=false; - load_db_attribs=(META_DB_ATTRIBUTES & options) == META_DB_ATTRIBUTES; - load_objs_pos=(META_OBJS_POSITIONING & options) == META_OBJS_POSITIONING; - load_objs_prot=(META_OBJS_PROTECTION & options) == META_OBJS_PROTECTION; - load_objs_sqldis=(META_OBJS_SQLDISABLED & options) == META_OBJS_SQLDISABLED; - load_textboxes=(META_TEXTBOX_OBJS & options) == META_TEXTBOX_OBJS; - load_tags=(META_TAG_OBJS & options) == META_TAG_OBJS; - load_custom_sql=(META_OBJS_CUSTOMSQL & options) == META_OBJS_CUSTOMSQL; - load_custom_colors=(META_OBJS_CUSTOMCOLORS & options) == META_OBJS_CUSTOMCOLORS; - load_fadeout=(META_OBJS_FADEDOUT & options) == META_OBJS_FADEDOUT; - load_extattribs=(META_OBJS_EXTATTRIBS & options) == META_OBJS_EXTATTRIBS; - load_genericsqls=(META_GENERIC_SQL_OBJS & options) == META_GENERIC_SQL_OBJS; - load_objs_aliases=(META_OBJS_ALIASES & options) == META_OBJS_ALIASES; + load_db_attribs=(MetaDbAttributes & options) == MetaDbAttributes; + load_objs_pos=(MetaObjsPositioning & options) == MetaObjsPositioning; + load_objs_prot=(MetaObjsProtection & options) == MetaObjsProtection; + load_objs_sqldis=(MetaObjsSqlDisabled & options) == MetaObjsSqlDisabled; + load_textboxes=(MetaTextboxObjs & options) == MetaTextboxObjs; + load_tags=(MetaTagObjs & options) == MetaTagObjs; + load_custom_sql=(MetaObjsCustomSql & options) == MetaObjsCustomSql; + load_custom_colors=(MetaObjsCustomColors & options) == MetaObjsCustomColors; + load_fadeout=(MetaObjsFadeOut & options) == MetaObjsFadeOut; + load_extattribs=(MetaObjsExtAttribs & options) == MetaObjsExtAttribs; + load_genericsqls=(MetaGenericSqlObjs & options) == MetaGenericSqlObjs; + load_objs_aliases=(MetaObjsAliases & options) == MetaObjsAliases; try { diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index ff165e1a6d..cdc74c2e37 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -180,19 +180,19 @@ class DatabaseModel: public QObject, public BaseObject { void setObjectListsCapacity(unsigned capacity); public: - static constexpr unsigned META_DB_ATTRIBUTES=1, //! \brief Handle database model attribute when save/load metadata file - META_OBJS_POSITIONING=2, //! \brief Handle objects' positioning when save/load metadata file - META_OBJS_PROTECTION=4, //! \brief Handle objects' protection status when save/load metadata file - META_OBJS_SQLDISABLED=8, //! \brief Handle objects' sql disabled status when save/load metadata file - META_OBJS_CUSTOMSQL=16, //! \brief Handle object's custom sql when save/load metadata file - META_OBJS_CUSTOMCOLORS=32, //! \brief Handle object's custom colors when save/load metadata file - META_OBJS_FADEDOUT=64, //! \brief Handle graphical object's fade out status when save/load metadata file - META_OBJS_EXTATTRIBS=128, //! \brief Handle tables and views extended attributes display when save/load metadata file - META_TEXTBOX_OBJS=256, //! \brief Handle textboxes object when save/load metadata file - META_TAG_OBJS=512, //! \brief Handle tags object when save/load metadata file - META_GENERIC_SQL_OBJS=1024, //! \brief Handle generic sql object when save/load metadata file - META_OBJS_ALIASES=2048, //! \brief Handle the object's aliases (graphical objects and table children objects) when save/load metadata file - META_ALL_INFO=4095; //! \brief Handle all metadata information about objects when save/load metadata file + static constexpr unsigned MetaDbAttributes=1, //! \brief Handle database model attribute when save/load metadata file + MetaObjsPositioning=2, //! \brief Handle objects' positioning when save/load metadata file + MetaObjsProtection=4, //! \brief Handle objects' protection status when save/load metadata file + MetaObjsSqlDisabled=8, //! \brief Handle objects' sql disabled status when save/load metadata file + MetaObjsCustomSql=16, //! \brief Handle object's custom sql when save/load metadata file + MetaObjsCustomColors=32, //! \brief Handle object's custom colors when save/load metadata file + MetaObjsFadeOut=64, //! \brief Handle graphical object's fade out status when save/load metadata file + MetaObjsExtAttribs=128, //! \brief Handle tables and views extended attributes display when save/load metadata file + MetaTextboxObjs=256, //! \brief Handle textboxes object when save/load metadata file + MetaTagObjs=512, //! \brief Handle tags object when save/load metadata file + MetaGenericSqlObjs=1024, //! \brief Handle generic sql object when save/load metadata file + MetaObjsAliases=2048, //! \brief Handle the object's aliases (graphical objects and table children objects) when save/load metadata file + MetaAllInfo=4095; //! \brief Handle all metadata information about objects when save/load metadata file DatabaseModel(void); @@ -617,10 +617,10 @@ class DatabaseModel: public QObject, public BaseObject { /*! \brief Save the graphical objects positions, custom colors and custom points (for relationship lines) to an special file that can be loaded by another model in order to change their objects position */ - void saveObjectsMetadata(const QString &filename, unsigned options=META_ALL_INFO); + void saveObjectsMetadata(const QString &filename, unsigned options=MetaAllInfo); //! \brief Load the file containing the objects positioning to be applied to the model - void loadObjectsMetadata(const QString &filename, unsigned options=META_ALL_INFO); + void loadObjectsMetadata(const QString &filename, unsigned options=MetaAllInfo); signals: //! \brief Signal emitted when a new object is added to the model diff --git a/libpgmodeler_ui/src/conversionwidget.cpp b/libpgmodeler_ui/src/conversionwidget.cpp index 755a8b5f73..df32622281 100644 --- a/libpgmodeler_ui/src/conversionwidget.cpp +++ b/libpgmodeler_ui/src/conversionwidget.cpp @@ -65,8 +65,8 @@ void ConversionWidget::setAttributes(DatabaseModel *model, OperationList *op_lis { conv_func_sel->setSelectedObject(conv->getConversionFunction()); default_conv_chk->setChecked(conv->isDefault()); - src_encoding_cmb->setCurrentIndex(trg_encoding_cmb->findText(~(conv->getEncoding(Conversion::SRC_ENCODING)))); - trg_encoding_cmb->setCurrentIndex(trg_encoding_cmb->findText(~(conv->getEncoding(Conversion::DST_ENCODING)))); + src_encoding_cmb->setCurrentIndex(trg_encoding_cmb->findText(~(conv->getEncoding(Conversion::SrcEncoding)))); + trg_encoding_cmb->setCurrentIndex(trg_encoding_cmb->findText(~(conv->getEncoding(Conversion::DstEncoding)))); } } @@ -81,8 +81,8 @@ void ConversionWidget::applyConfiguration(void) BaseObjectWidget::applyConfiguration(); - conv->setEncoding(Conversion::SRC_ENCODING, src_encoding_cmb->currentText()); - conv->setEncoding(Conversion::DST_ENCODING, trg_encoding_cmb->currentText()); + conv->setEncoding(Conversion::SrcEncoding, src_encoding_cmb->currentText()); + conv->setEncoding(Conversion::DstEncoding, trg_encoding_cmb->currentText()); conv->setDefault(default_conv_chk->isChecked()); conv->setConversionFunction(dynamic_cast(conv_func_sel->getSelectedObject())); diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 735f8d580c..6d99f17ecc 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -166,18 +166,18 @@ void MetadataHandlingForm::handleObjectsMetada(void) settings_tbw->setTabEnabled(1, true); settings_tbw->setCurrentIndex(1); - options+=(db_metadata_chk->isChecked() ? DatabaseModel::META_DB_ATTRIBUTES : 0); - options+=(custom_colors_chk->isChecked() ? DatabaseModel::META_OBJS_CUSTOMCOLORS : 0); - options+=(custom_sql_chk->isChecked() ? DatabaseModel::META_OBJS_CUSTOMSQL : 0); - options+=(objs_positioning_chk->isChecked() ? DatabaseModel::META_OBJS_POSITIONING : 0); - options+=(objs_protection_chk->isChecked() ? DatabaseModel::META_OBJS_PROTECTION : 0); - options+=(objs_sql_disabled_chk->isChecked() ? DatabaseModel::META_OBJS_SQLDISABLED : 0); - options+=(tag_objs_chk->isChecked() ? DatabaseModel::META_TAG_OBJS : 0); - options+=(textbox_objs_chk->isChecked() ? DatabaseModel::META_TEXTBOX_OBJS : 0); - options+=(objs_fadedout_chk->isChecked() ? DatabaseModel::META_OBJS_FADEDOUT : 0); - options+=(objs_extattribs_chk->isChecked() ? DatabaseModel::META_OBJS_EXTATTRIBS : 0); - options+=(generic_sql_objs_chk->isChecked() ? DatabaseModel::META_GENERIC_SQL_OBJS : 0); - options+=(objs_aliases_chk->isChecked() ? DatabaseModel::META_OBJS_ALIASES : 0); + options+=(db_metadata_chk->isChecked() ? DatabaseModel::MetaDbAttributes : 0); + options+=(custom_colors_chk->isChecked() ? DatabaseModel::MetaObjsCustomColors : 0); + options+=(custom_sql_chk->isChecked() ? DatabaseModel::MetaObjsCustomSql : 0); + options+=(objs_positioning_chk->isChecked() ? DatabaseModel::MetaObjsPositioning : 0); + options+=(objs_protection_chk->isChecked() ? DatabaseModel::MetaObjsProtection : 0); + options+=(objs_sql_disabled_chk->isChecked() ? DatabaseModel::MetaObjsSqlDisabled : 0); + options+=(tag_objs_chk->isChecked() ? DatabaseModel::MetaTagObjs : 0); + options+=(textbox_objs_chk->isChecked() ? DatabaseModel::MetaTextboxObjs : 0); + options+=(objs_fadedout_chk->isChecked() ? DatabaseModel::MetaObjsFadeOut : 0); + options+=(objs_extattribs_chk->isChecked() ? DatabaseModel::MetaObjsExtAttribs : 0); + options+=(generic_sql_objs_chk->isChecked() ? DatabaseModel::MetaGenericSqlObjs : 0); + options+=(objs_aliases_chk->isChecked() ? DatabaseModel::MetaObjsAliases : 0); connect(model_wgt->getDatabaseModel(), SIGNAL(s_objectLoaded(int,QString,unsigned)), this, SLOT(updateProgress(int,QString,unsigned)), Qt::UniqueConnection); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index b54ea3cbab..483f9e476f 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -351,14 +351,14 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l including_rb->setChecked(copy_op.isIncluding()); excluding_rb->setChecked(copy_op.isExcluding()); - all_chk->setChecked(copy_op.isOptionSet(CopyOptions::ALL)); - defaults_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::DEFAULTS)); - constraints_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::CONSTRAINTS)); - storage_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::STORAGE)); - comments_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::COMMENTS)); - indexes_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::INDEXES)); - identity_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::IDENTITY)); - statistics_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::STATISTICS)); + all_chk->setChecked(copy_op.isOptionSet(CopyOptions::All)); + defaults_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::Defaults)); + constraints_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::Constraints)); + storage_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::Storage)); + comments_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::Comments)); + indexes_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::Indexes)); + identity_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::Identity)); + statistics_chk->setChecked(!all_chk->isChecked() && copy_op.isOptionSet(CopyOptions::Statistics)); } else if(rel_type == BaseRelationship::RelationshipPart) { @@ -1102,18 +1102,18 @@ void RelationshipWidget::applyConfiguration(void) if(!defaults_rb->isChecked()) { if(including_rb->isChecked()) - copy_mode=CopyOptions::INCLUDING; + copy_mode=CopyOptions::Including; else - copy_mode=CopyOptions::EXCLUDING; - - copy_ops+=(all_chk->isChecked() ? CopyOptions::ALL : 0); - copy_ops+=(defaults_chk->isChecked() ? CopyOptions::DEFAULTS : 0); - copy_ops+=(constraints_chk->isChecked() ? CopyOptions::CONSTRAINTS : 0); - copy_ops+=(comments_chk->isChecked() ? CopyOptions::COMMENTS : 0); - copy_ops+=(indexes_chk->isChecked() ? CopyOptions::INDEXES : 0); - copy_ops+=(storage_chk->isChecked() ? CopyOptions::STORAGE : 0); - copy_ops+=(identity_chk->isChecked() ? CopyOptions::IDENTITY : 0); - copy_ops+=(statistics_chk->isChecked() ? CopyOptions::STATISTICS : 0); + copy_mode=CopyOptions::Excluding; + + copy_ops+=(all_chk->isChecked() ? CopyOptions::All : 0); + copy_ops+=(defaults_chk->isChecked() ? CopyOptions::Defaults : 0); + copy_ops+=(constraints_chk->isChecked() ? CopyOptions::Constraints : 0); + copy_ops+=(comments_chk->isChecked() ? CopyOptions::Comments : 0); + copy_ops+=(indexes_chk->isChecked() ? CopyOptions::Indexes : 0); + copy_ops+=(storage_chk->isChecked() ? CopyOptions::Storage : 0); + copy_ops+=(identity_chk->isChecked() ? CopyOptions::Identity : 0); + copy_ops+=(statistics_chk->isChecked() ? CopyOptions::Statistics : 0); } rel->setCopyOptions(CopyOptions(copy_mode, copy_ops)); From d08c42278636f89ffae96c0ca1bfc3a08252331b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 08:53:56 -0300 Subject: [PATCH 167/425] Static const attributes refactoring checkpoint --- libobjrenderer/src/graphicalview.cpp | 10 +- libobjrenderer/src/tableobjectview.cpp | 14 +- libobjrenderer/src/tabletitleview.cpp | 6 +- libobjrenderer/src/tableview.cpp | 2 +- libobjrenderer/src/textboxview.cpp | 6 +- libpgmodeler/src/baserelationship.cpp | 6 +- libpgmodeler/src/constraint.cpp | 8 +- libpgmodeler/src/databasemodel.cpp | 168 +++++++++--------- libpgmodeler/src/element.cpp | 16 +- libpgmodeler/src/element.h | 4 +- libpgmodeler/src/extension.cpp | 18 +- libpgmodeler/src/extension.h | 4 +- libpgmodeler/src/index.cpp | 32 ++-- libpgmodeler/src/index.h | 8 +- libpgmodeler/src/language.cpp | 16 +- libpgmodeler/src/language.h | 6 +- libpgmodeler/src/operation.cpp | 8 +- libpgmodeler/src/operation.h | 18 +- libpgmodeler/src/operationlist.cpp | 112 ++++++------ libpgmodeler/src/operatorclasselement.cpp | 16 +- libpgmodeler/src/operatorclasselement.h | 6 +- libpgmodeler/src/permission.cpp | 34 ++-- libpgmodeler/src/permission.h | 24 +-- libpgmodeler/src/pgmodelerns.h | 4 +- libpgmodeler/src/reference.cpp | 18 +- libpgmodeler/src/reference.h | 14 +- libpgmodeler/src/relationship.cpp | 134 +++++++------- libpgmodeler/src/relationship.h | 24 +-- libpgmodeler/src/role.cpp | 84 ++++----- libpgmodeler/src/role.h | 22 +-- libpgmodeler/src/sequence.cpp | 26 +-- libpgmodeler/src/sequence.h | 12 +- libpgmodeler/src/table.cpp | 16 +- libpgmodeler/src/table.h | 4 +- libpgmodeler/src/tag.cpp | 14 +- libpgmodeler/src/tag.h | 8 +- libpgmodeler/src/textbox.cpp | 10 +- libpgmodeler/src/textbox.h | 6 +- libpgmodeler/src/trigger.cpp | 12 +- libpgmodeler/src/trigger.h | 2 +- libpgmodeler/src/type.cpp | 74 ++++---- libpgmodeler/src/type.h | 28 +-- libpgmodeler/src/view.cpp | 34 ++-- libpgmodeler_ui/src/baseobjectwidget.cpp | 10 +- libpgmodeler_ui/src/baseobjectwidget.h | 4 +- .../src/databaseexplorerwidget.cpp | 4 +- libpgmodeler_ui/src/datamanipulationform.cpp | 24 +-- libpgmodeler_ui/src/elementstablewidget.cpp | 4 +- libpgmodeler_ui/src/elementwidget.cpp | 8 +- libpgmodeler_ui/src/extensionwidget.cpp | 8 +- libpgmodeler_ui/src/functionwidget.cpp | 6 +- libpgmodeler_ui/src/indexwidget.cpp | 16 +- libpgmodeler_ui/src/languagewidget.cpp | 12 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 46 ++--- libpgmodeler_ui/src/objectrenamewidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 8 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 30 ++-- libpgmodeler_ui/src/permissionwidget.cpp | 16 +- libpgmodeler_ui/src/referencewidget.cpp | 26 +-- libpgmodeler_ui/src/relationshipwidget.cpp | 36 ++-- libpgmodeler_ui/src/rolewidget.cpp | 38 ++-- libpgmodeler_ui/src/sequencewidget.cpp | 8 +- libpgmodeler_ui/src/tabledatawidget.cpp | 22 +-- libpgmodeler_ui/src/tablewidget.cpp | 14 +- libpgmodeler_ui/src/tagwidget.cpp | 10 +- libpgmodeler_ui/src/textboxwidget.cpp | 12 +- libpgmodeler_ui/src/triggerwidget.cpp | 8 +- libpgmodeler_ui/src/typewidget.cpp | 38 ++-- libpgmodeler_ui/src/viewwidget.cpp | 70 ++++---- plugins/xml2object/src/xml2objectwidget.cpp | 2 +- tests/src/roletest/roletest.cpp | 8 +- 72 files changed, 790 insertions(+), 790 deletions(-) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 751d9b2e67..7d01a66583 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -52,10 +52,10 @@ void GraphicalView::configureObject(void) title->configureObject(view); //Gets the reference count on SELECT part of the SQL definition - count=view->getReferenceCount(Reference::SQL_REFER_SELECT); + count=view->getReferenceCount(Reference::SqlReferSelect); if(count==0) - count=count1=view->getReferenceCount(Reference::SQL_VIEW_DEFINITION); + count=count1=view->getReferenceCount(Reference::SqlViewDefinition); //Moves the references group to the origin to be moved latter columns->moveBy(-columns->scenePos().x(), -columns->scenePos().y()); @@ -65,9 +65,9 @@ void GraphicalView::configureObject(void) for(i=0; i < count; i++) { if(count1==0) - ref=view->getReference(i, Reference::SQL_REFER_SELECT); + ref=view->getReference(i, Reference::SqlReferSelect); else - ref=view->getReference(i, Reference::SQL_VIEW_DEFINITION); + ref=view->getReference(i, Reference::SqlViewDefinition); //Reuses the subitem if it was allocated before if(!subitems.isEmpty() && i < subitems.size()) @@ -194,7 +194,7 @@ void GraphicalView::configureObject(void) else { bodies[idx]->setBrush(tag->getFillStyle(tag_attribs[idx])); - pen.setColor(tag->getElementColor(tag_attribs[idx], Tag::BORDER_COLOR)); + pen.setColor(tag->getElementColor(tag_attribs[idx], Tag::BorderColor)); } bodies[idx]->setPen(pen); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 5e9bb02209..e135a04e6c 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -338,25 +338,25 @@ void TableObjectView::configureObject(void) } else if(index) { - if(index->getIndexAttribute(Index::UNIQUE)) + if(index->getIndexAttribute(Index::Unique)) { str_constr+=QString("u"); atribs_tip += QString("unique") + QString(", "); } - if(index->getIndexAttribute(Index::CONCURRENT)) + if(index->getIndexAttribute(Index::Concurrent)) { str_constr+=QString("c"); atribs_tip += QString("concurrent") + QString(", "); } - if(index->getIndexAttribute(Index::FAST_UPDATE)) + if(index->getIndexAttribute(Index::FastUpdate)) { str_constr+=QString("f"); atribs_tip += QString("fast updated"); } - if(index->getIndexAttribute(Index::BUFFERING)) + if(index->getIndexAttribute(Index::Buffering)) { str_constr+=QString("b"); atribs_tip += QString("buffering"); @@ -444,7 +444,7 @@ void TableObjectView::configureObject(Reference reference) descriptor->setPos(HorizSpacing, 1); px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HorizSpacing); - if(reference.getReferenceType()==Reference::REFER_COLUMN) + if(reference.getReferenceType()==Reference::ReferColumn) { //Configures the name label as: [table].[column] fmt=font_config[ParsersAttributes::REF_TABLE]; @@ -498,9 +498,9 @@ void TableObjectView::configureObject(Reference reference) //Configures a label for the alias (if there is one) if(!compact_view && ((reference.getColumn() && !reference.getColumnAlias().isEmpty()) || - (!reference.getAlias().isEmpty() && reference.getReferenceType()==Reference::REFER_EXPRESSION))) + (!reference.getAlias().isEmpty() && reference.getReferenceType()==Reference::ReferExpression))) { - if(reference.getReferenceType()==Reference::REFER_EXPRESSION) + if(reference.getReferenceType()==Reference::ReferExpression) str_aux=reference.getAlias(); else str_aux=reference.getColumnAlias(); diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index ff95b84ff3..29a3a7f54d 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -88,7 +88,7 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(!tag) schema_name->setBrush(fmt.foreground()); else - schema_name->setBrush(tag->getElementColor(schema_name_attrib, Tag::FILL_COLOR1)); + schema_name->setBrush(tag->getElementColor(schema_name_attrib, Tag::FillColor1)); if(schema->isRectVisible()) schema_name->setText(QString(" ")); @@ -113,14 +113,14 @@ void TableTitleView::configureObject(BaseGraphicObject *object) } else { - obj_name->setBrush(tag->getElementColor(name_attrib, Tag::FILL_COLOR1)); + obj_name->setBrush(tag->getElementColor(name_attrib, Tag::FillColor1)); box->setBrush(tag->getFillStyle(title_color_attrib)); } pen=this->getBorderStyle(title_color_attrib); if(tag) - pen.setColor(tag->getElementColor(title_color_attrib, Tag::BORDER_COLOR)); + pen.setColor(tag->getElementColor(title_color_attrib, Tag::BorderColor)); if(object->getObjectType()==ObjView || (table && table->isPartition())) diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 1982687867..6566e08e4b 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -166,7 +166,7 @@ void TableView::configureObject(void) bodies[obj_idx]->setBrush(this->getFillStyle(atribs[obj_idx])); else { - pen.setColor(tag->getElementColor(atribs[obj_idx], Tag::BORDER_COLOR)); + pen.setColor(tag->getElementColor(atribs[obj_idx], Tag::BorderColor)); bodies[obj_idx]->setBrush(tag->getFillStyle(atribs[obj_idx])); } diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index fdc25d7599..278cb463b3 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -93,9 +93,9 @@ void TextboxView::__configureObject(void) box->setPen(this->getBorderStyle(BaseObject::getSchemaName(ObjTextbox))); font=fmt.font(); - font.setItalic(txtbox->getTextAttribute(Textbox::ITALIC_TXT)); - font.setBold(txtbox->getTextAttribute(Textbox::BOLD_TXT)); - font.setUnderline(txtbox->getTextAttribute(Textbox::UNDERLINE_TXT)); + font.setItalic(txtbox->getTextAttribute(Textbox::ItalicText)); + font.setBold(txtbox->getTextAttribute(Textbox::BoldText)); + font.setUnderline(txtbox->getTextAttribute(Textbox::UnderlineText)); font.setPointSizeF(txtbox->getFontSize()); text->setFont(font); diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index db19f618fd..38e6a0dafd 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -135,7 +135,7 @@ void BaseRelationship::configureRelationship(void) //Allocates the textbox for the name label lables[RelNameLabel]=new Textbox; - lables[RelNameLabel]->setTextAttribute(Textbox::ITALIC_TXT, true); + lables[RelNameLabel]->setTextAttribute(Textbox::ItalicText, true); //Allocates the cardinality labels only when the relationship is not generalization or dependency (copy) if(rel_type!=RelationshipGen && @@ -144,8 +144,8 @@ void BaseRelationship::configureRelationship(void) { lables[SrcCardLabel]=new Textbox; lables[DstCardLabel]=new Textbox; - lables[SrcCardLabel]->setTextAttribute(Textbox::ITALIC_TXT, true); - lables[DstCardLabel]->setTextAttribute(Textbox::ITALIC_TXT, true); + lables[SrcCardLabel]->setTextAttribute(Textbox::ItalicText, true); + lables[DstCardLabel]->setTextAttribute(Textbox::ItalicText, true); //Configures the mandatory participation for both tables setMandatoryTable(SrcTable,src_mandatory); diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index fae71c2a86..bf9850d183 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -529,8 +529,8 @@ void Constraint::addExcludeElement(const QString &expr, Operator *oper, Operator elem.setOperatorClass(op_class); elem.setOperator(oper); elem.setSortingEnabled(use_sorting); - elem.setSortingAttribute(ExcludeElement::NULLS_FIRST, nulls_first); - elem.setSortingAttribute(ExcludeElement::ASC_ORDER, asc_order); + elem.setSortingAttribute(ExcludeElement::NullsFirst, nulls_first); + elem.setSortingAttribute(ExcludeElement::AscOrder, asc_order); if(getExcludeElementIndex(elem) >= 0) throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -562,8 +562,8 @@ void Constraint::addExcludeElement(Column *column, Operator *oper, OperatorClass elem.setOperatorClass(op_class); elem.setOperator(oper); elem.setSortingEnabled(use_sorting); - elem.setSortingAttribute(ExcludeElement::NULLS_FIRST, nulls_first); - elem.setSortingAttribute(ExcludeElement::ASC_ORDER, asc_order); + elem.setSortingAttribute(ExcludeElement::NullsFirst, nulls_first); + elem.setSortingAttribute(ExcludeElement::AscOrder, asc_order); if(getExcludeElementIndex(elem) >= 0) throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 86be735030..cade9eb691 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1278,11 +1278,11 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) } //Creates the relationships from the view references - ref_count=view->getReferenceCount(Reference::SQL_REFER_SELECT); + ref_count=view->getReferenceCount(Reference::SqlReferSelect); for(i=0; i < ref_count; i++) { - ref = view->getReference(i, Reference::SQL_REFER_SELECT); + ref = view->getReference(i, Reference::SqlReferSelect); tab = ref.getTable(); rel=getRelationship(view,tab); @@ -1869,11 +1869,11 @@ void DatabaseModel::storeSpecialObjectsXML(void) /* Relationships linking the view and the referenced tables are considered as special objects in this case only to be recreated more easely latter */ - count=view->getReferenceCount(Reference::SQL_REFER_SELECT); + count=view->getReferenceCount(Reference::SqlReferSelect); for(i=0; i < count; i++) { - ref=view->getReference(i, Reference::SQL_REFER_SELECT); + ref=view->getReference(i, Reference::SqlReferSelect); table=ref.getTable(); if(table) @@ -3453,10 +3453,10 @@ Role *DatabaseModel::createRole(void) ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, ParsersAttributes::REPLICATION, ParsersAttributes::BYPASSRLS }; - unsigned op_vect[]={ Role::OP_SUPERUSER, Role::OP_CREATEDB, - Role::OP_CREATEROLE, Role::OP_INHERIT, - Role::OP_LOGIN, Role::OP_ENCRYPTED, - Role::OP_REPLICATION, Role::OP_BYPASSRLS }; + unsigned op_vect[]={ Role::OpSuperuser, Role::OpCreateDb, + Role::OpCreateRole, Role::OpInherit, + Role::OpLogin, Role::OpEncrypted, + Role::OpReplication, Role::OpBypassRls }; try { @@ -3499,11 +3499,11 @@ Role *DatabaseModel::createRole(void) //Identifying the member role type if(attribs_aux[ParsersAttributes::ROLE_TYPE]==ParsersAttributes::REFER) - role_type=Role::REF_ROLE; + role_type=Role::RefRole; else if(attribs_aux[ParsersAttributes::ROLE_TYPE]==ParsersAttributes::MEMBER) - role_type=Role::MEMBER_ROLE; + role_type=Role::MemberRole; else - role_type=Role::ADMIN_ROLE; + role_type=Role::AdminRole; for(i=0; i < len; i++) { @@ -3632,11 +3632,11 @@ Language *DatabaseModel::createLanguage(void) RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(ref_type==ParsersAttributes::VALIDATOR_FUNC) - lang->setFunction(dynamic_cast(func), Language::VALIDATOR_FUNC); + lang->setFunction(dynamic_cast(func), Language::ValidatorFunc); else if(ref_type==ParsersAttributes::HANDLER_FUNC) - lang->setFunction(dynamic_cast(func), Language::HANDLER_FUNC); + lang->setFunction(dynamic_cast(func), Language::HandlerFunc); else - lang->setFunction(dynamic_cast(func), Language::INLINE_FUNC); + lang->setFunction(dynamic_cast(func), Language::InlineFunc); } else @@ -3997,7 +3997,7 @@ Type *DatabaseModel::createType(void) if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BASE_TYPE) { - type->setConfiguration(Type::BASE_TYPE); + type->setConfiguration(Type::BaseType); type->setByValue(attribs[ParsersAttributes::BY_VALUE]==ParsersAttributes::_TRUE_); if(!attribs[ParsersAttributes::INTERNAL_LENGTH].isEmpty()) @@ -4025,23 +4025,23 @@ Type *DatabaseModel::createType(void) type->setPreferred(attribs[ParsersAttributes::PREFERRED]==ParsersAttributes::_TRUE_); //Configuring an auxiliary map used to reference the functions used by base type - func_types[ParsersAttributes::INPUT_FUNC]=Type::INPUT_FUNC; - func_types[ParsersAttributes::OUTPUT_FUNC]=Type::OUTPUT_FUNC; - func_types[ParsersAttributes::SEND_FUNC]=Type::SEND_FUNC; - func_types[ParsersAttributes::RECV_FUNC]=Type::RECV_FUNC; - func_types[ParsersAttributes::TPMOD_IN_FUNC]=Type::TPMOD_IN_FUNC; - func_types[ParsersAttributes::TPMOD_OUT_FUNC]=Type::TPMOD_OUT_FUNC; - func_types[ParsersAttributes::ANALYZE_FUNC]=Type::ANALYZE_FUNC; + func_types[ParsersAttributes::INPUT_FUNC]=Type::InputFunc; + func_types[ParsersAttributes::OUTPUT_FUNC]=Type::OutputFunc; + func_types[ParsersAttributes::SEND_FUNC]=Type::SendFunc; + func_types[ParsersAttributes::RECV_FUNC]=Type::RecvFunc; + func_types[ParsersAttributes::TPMOD_IN_FUNC]=Type::TpmodInFunc; + func_types[ParsersAttributes::TPMOD_OUT_FUNC]=Type::TpmodOutFunc; + func_types[ParsersAttributes::ANALYZE_FUNC]=Type::AnalyzeFunc; } else if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::COMPOSITE_TYPE) - type->setConfiguration(Type::COMPOSITE_TYPE); + type->setConfiguration(Type::CompositeType); else if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::ENUM_TYPE) - type->setConfiguration(Type::ENUMERATION_TYPE); + type->setConfiguration(Type::EnumerationType); else { - type->setConfiguration(Type::RANGE_TYPE); - func_types[ParsersAttributes::CANONICAL_FUNC]=Type::CANONICAL_FUNC; - func_types[ParsersAttributes::SUBTYPE_DIFF_FUNC]=Type::SUBTYPE_DIFF_FUNC; + type->setConfiguration(Type::RangeType); + func_types[ParsersAttributes::CANONICAL_FUNC]=Type::CanonicalFunc; + func_types[ParsersAttributes::SUBTYPE_DIFF_FUNC]=Type::SubtypeDiffFunc; } if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -4072,7 +4072,7 @@ Type *DatabaseModel::createType(void) { aux_type=createPgSQLType(); - if(type->getConfiguration()==Type::RANGE_TYPE) + if(type->getConfiguration()==Type::RangeType) type->setSubtype(aux_type); else type->setLikeType(aux_type); @@ -4460,9 +4460,9 @@ OperatorClass *DatabaseModel::createOperatorClass(void) op_class->setIndexingType(IndexingType(attribs[ParsersAttributes::INDEX_TYPE])); op_class->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::_TRUE_); - elem_types[ParsersAttributes::FUNCTION]=OperatorClassElement::FUNCTION_ELEM; - elem_types[ParsersAttributes::OPERATOR]=OperatorClassElement::OPERATOR_ELEM; - elem_types[ParsersAttributes::STORAGE]=OperatorClassElement::STORAGE_ELEM; + elem_types[ParsersAttributes::FUNCTION]=OperatorClassElement::FunctionElem; + elem_types[ParsersAttributes::OPERATOR]=OperatorClassElement::OperatorElem; + elem_types[ParsersAttributes::STORAGE]=OperatorClassElement::StorageElem; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4505,17 +4505,17 @@ OperatorClass *DatabaseModel::createOperatorClass(void) xmlparser.accessElement(XmlParser::ChildElement); xmlparser.getElementAttributes(attribs); - if(elem_type==OperatorClassElement::STORAGE_ELEM) + if(elem_type==OperatorClassElement::StorageElem) { type=createPgSQLType(); class_elem.setStorage(type); } - else if(elem_type==OperatorClassElement::FUNCTION_ELEM) + else if(elem_type==OperatorClassElement::FunctionElem) { object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjFunction); class_elem.setFunction(dynamic_cast(object),stg_number); } - else if(elem_type==OperatorClassElement::OPERATOR_ELEM) + else if(elem_type==OperatorClassElement::OperatorElem) { object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjOperator); class_elem.setOperator(dynamic_cast(object),stg_number); @@ -5096,8 +5096,8 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setOperator(nullptr); elem.setOperatorClass(nullptr); - elem.setSortingAttribute(Element::ASC_ORDER, attribs[ParsersAttributes::ASC_ORDER]==ParsersAttributes::_TRUE_); - elem.setSortingAttribute(Element::NULLS_FIRST, attribs[ParsersAttributes::NULLS_FIRST]==ParsersAttributes::_TRUE_); + elem.setSortingAttribute(Element::AscOrder, attribs[ParsersAttributes::ASC_ORDER]==ParsersAttributes::_TRUE_); + elem.setSortingAttribute(Element::NullsFirst, attribs[ParsersAttributes::NULLS_FIRST]==ParsersAttributes::_TRUE_); elem.setSortingEnabled(attribs[ParsersAttributes::USE_SORTING]!=ParsersAttributes::_FALSE_); xmlparser.savePosition(); @@ -5313,10 +5313,10 @@ Index *DatabaseModel::createIndex(void) index=new Index; setBasicAttributes(index); index->setParentTable(table); - index->setIndexAttribute(Index::CONCURRENT, attribs[ParsersAttributes::CONCURRENT]==ParsersAttributes::_TRUE_); - index->setIndexAttribute(Index::UNIQUE, attribs[ParsersAttributes::UNIQUE]==ParsersAttributes::_TRUE_); - index->setIndexAttribute(Index::FAST_UPDATE, attribs[ParsersAttributes::FAST_UPDATE]==ParsersAttributes::_TRUE_); - index->setIndexAttribute(Index::BUFFERING, attribs[ParsersAttributes::BUFFERING]==ParsersAttributes::_TRUE_); + index->setIndexAttribute(Index::Concurrent, attribs[ParsersAttributes::CONCURRENT]==ParsersAttributes::_TRUE_); + index->setIndexAttribute(Index::Unique, attribs[ParsersAttributes::UNIQUE]==ParsersAttributes::_TRUE_); + index->setIndexAttribute(Index::FastUpdate, attribs[ParsersAttributes::FAST_UPDATE]==ParsersAttributes::_TRUE_); + index->setIndexAttribute(Index::Buffering, attribs[ParsersAttributes::BUFFERING]==ParsersAttributes::_TRUE_); index->setIndexingType(attribs[ParsersAttributes::INDEX_TYPE]); index->setFillFactor(attribs[ParsersAttributes::FACTOR].toUInt()); @@ -5490,8 +5490,8 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setFiringType(FiringType(attribs[ParsersAttributes::FIRING_TYPE])); - trigger->setTransitionTableName(Trigger::OLD_TABLE_NAME, attribs[ParsersAttributes::OLD_TABLE_NAME]); - trigger->setTransitionTableName(Trigger::NEW_TABLE_NAME, attribs[ParsersAttributes::NEW_TABLE_NAME]); + trigger->setTransitionTableName(Trigger::OldTableName, attribs[ParsersAttributes::OLD_TABLE_NAME]); + trigger->setTransitionTableName(Trigger::NewTableName, attribs[ParsersAttributes::NEW_TABLE_NAME]); list_aux=attribs[ParsersAttributes::ARGUMENTS].split(','); count=list_aux.count(); @@ -5966,13 +5966,13 @@ View *DatabaseModel::createView(void) else { if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::SELECT_EXP) - type=Reference::SQL_REFER_SELECT; + type=Reference::SqlReferSelect; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::FROM_EXP) - type=Reference::SQL_REFER_FROM; + type=Reference::SqlReferFrom; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::SIMPLE_EXP) - type=Reference::SQL_REFER_WHERE; + type=Reference::SqlReferWhere; else - type=Reference::SQL_REFER_END_EXPR; + type=Reference::SqlReferEndExpr; list_aux=xmlparser.getElementContent().split(','); count=list_aux.size(); @@ -6029,7 +6029,7 @@ View *DatabaseModel::createView(void) itr=refs.begin(); while(itr!=refs.end()) { - view->addReference(*itr, Reference::SQL_VIEW_DEFINITION); + view->addReference(*itr, Reference::SqlViewDefinition); itr++; } } @@ -6109,8 +6109,8 @@ Extension *DatabaseModel::createExtension(void) setBasicAttributes(extension); extension->setHandlesType(attribs[ParsersAttributes::HANDLES_TYPE]==ParsersAttributes::_TRUE_); - extension->setVersion(Extension::CUR_VERSION, attribs[ParsersAttributes::CUR_VERSION]); - extension->setVersion(Extension::OLD_VERSION, attribs[ParsersAttributes::OLD_VERSION]); + extension->setVersion(Extension::CurVersion, attribs[ParsersAttributes::CUR_VERSION]); + extension->setVersion(Extension::OldVersion, attribs[ParsersAttributes::OLD_VERSION]); } catch(Exception &e) { @@ -6172,9 +6172,9 @@ Textbox *DatabaseModel::createTextbox(void) xmlparser.getElementAttributes(attribs); txtbox->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); - txtbox->setTextAttribute(Textbox::ITALIC_TXT, attribs[ParsersAttributes::ITALIC]==ParsersAttributes::_TRUE_); - txtbox->setTextAttribute(Textbox::BOLD_TXT, attribs[ParsersAttributes::BOLD]==ParsersAttributes::_TRUE_); - txtbox->setTextAttribute(Textbox::UNDERLINE_TXT, attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::_TRUE_); + txtbox->setTextAttribute(Textbox::ItalicText, attribs[ParsersAttributes::ITALIC]==ParsersAttributes::_TRUE_); + txtbox->setTextAttribute(Textbox::BoldText, attribs[ParsersAttributes::BOLD]==ParsersAttributes::_TRUE_); + txtbox->setTextAttribute(Textbox::UnderlineText, attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::_TRUE_); if(!attribs[ParsersAttributes::COLOR].isEmpty()) txtbox->setTextColor(QColor(attribs[ParsersAttributes::COLOR])); @@ -6320,10 +6320,10 @@ BaseRelationship *DatabaseModel::createRelationship(void) ParsersAttributes::PK_PATTERN, ParsersAttributes::UQ_PATTERN, ParsersAttributes::PK_COL_PATTERN }; - unsigned pattern_id[]= { Relationship::SRC_COL_PATTERN, Relationship::DST_COL_PATTERN, - Relationship::SRC_FK_PATTERN, Relationship::DST_FK_PATTERN, - Relationship::PK_PATTERN, Relationship::UQ_PATTERN, - Relationship::PK_COL_PATTERN }, + unsigned pattern_id[]= { Relationship::SrcColPattern, Relationship::DstColPattern, + Relationship::SrcFkPattern, Relationship::DstFkPattern, + Relationship::PkPattern, Relationship::UqPattern, + Relationship::PkColPattern }, pat_count=sizeof(pattern_id)/sizeof(unsigned); sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_; @@ -6505,7 +6505,7 @@ Permission *DatabaseModel::createPermission(void) ObjectType obj_type; QString parent_name, obj_name; QStringList list; - unsigned i, len, priv_type=Permission::PRIV_SELECT; + unsigned i, len, priv_type=Permission::PrivSelect; bool priv_value, grant_op, revoke, cascade; try @@ -6589,29 +6589,29 @@ Permission *DatabaseModel::createPermission(void) grant_op=(itr->second==ParsersAttributes::GRANT_OP); if(itr->first==ParsersAttributes::CONNECT_PRIV) - priv_type=Permission::PRIV_CONNECT; + priv_type=Permission::PrivConnect; else if(itr->first==ParsersAttributes::CREATE_PRIV) - priv_type=Permission::PRIV_CREATE; + priv_type=Permission::PrivCreate; else if(itr->first==ParsersAttributes::DELETE_PRIV) - priv_type=Permission::PRIV_DELETE; + priv_type=Permission::PrivDelete; else if(itr->first==ParsersAttributes::EXECUTE_PRIV) - priv_type=Permission::PRIV_EXECUTE; + priv_type=Permission::PrivExecute; else if(itr->first==ParsersAttributes::INSERT_PRIV) - priv_type=Permission::PRIV_INSERT; + priv_type=Permission::PrivInsert; else if(itr->first==ParsersAttributes::REFERENCES_PRIV) - priv_type=Permission::PRIV_REFERENCES; + priv_type=Permission::PrivReferences; else if(itr->first==ParsersAttributes::SELECT_PRIV) - priv_type=Permission::PRIV_SELECT; + priv_type=Permission::PrivSelect; else if(itr->first==ParsersAttributes::TEMPORARY_PRIV) - priv_type=Permission::PRIV_TEMPORARY; + priv_type=Permission::PrivTemporary; else if(itr->first==ParsersAttributes::TRIGGER_PRIV) - priv_type=Permission::PRIV_TRIGGER; + priv_type=Permission::PrivTrigger; else if(itr->first==ParsersAttributes::TRUNCATE_PRIV) - priv_type=Permission::PRIV_TRUNCATE; + priv_type=Permission::PrivTruncate; else if(itr->first==ParsersAttributes::UPDATE_PRIV) - priv_type=Permission::PRIV_UPDATE; + priv_type=Permission::PrivUpdate; else if(itr->first==ParsersAttributes::USAGE_PRIV) - priv_type=Permission::PRIV_USAGE; + priv_type=Permission::PrivUsage; perm->setPrivilege(priv_type, (priv_value || grant_op), grant_op); } @@ -6813,7 +6813,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) { usr_type=dynamic_cast(type); - if(usr_type->getConfiguration()==Type::BASE_TYPE) + if(usr_type->getConfiguration()==Type::BaseType) usr_type->convertFunctionParameters(); } } @@ -6828,7 +6828,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) usr_type=dynamic_cast(object); //Generating the shell type declaration (only for base types) - if(usr_type->getConfiguration()==Type::BASE_TYPE) + if(usr_type->getConfiguration()==Type::BaseType) attribs_aux[ParsersAttributes::SHELL_TYPES]+=usr_type->getCodeDefinition(def_type, true); else attribs_aux[attrib]+=usr_type->getCodeDefinition(def_type); @@ -6937,7 +6937,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) for(auto &type : types) { usr_type=dynamic_cast(type); - if(usr_type->getConfiguration()==Type::BASE_TYPE) + if(usr_type->getConfiguration()==Type::BaseType) { attribs_aux[attrib]+=usr_type->getCodeDefinition(def_type); usr_type->convertFunctionParameters(true); @@ -6952,7 +6952,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) for(auto &type : types) { usr_type=dynamic_cast(type); - if(usr_type->getConfiguration()==Type::BASE_TYPE) + if(usr_type->getConfiguration()==Type::BaseType) { attribs_aux[attrib]+=usr_type->getCodeDefinition(def_type); usr_type->convertFunctionParameters(true); @@ -7578,7 +7578,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); - for(unsigned i=Language::VALIDATOR_FUNC; i <= Language::INLINE_FUNC; i++) + for(unsigned i=Language::ValidatorFunc; i <= Language::InlineFunc; i++) { if(lang->getFunction(i)) getObjectDependecies(lang->getFunction(i), deps, inc_indirect_deps); @@ -7616,7 +7616,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); unsigned i, i1, count, - role_types[3]={ Role::REF_ROLE, Role::MEMBER_ROLE, Role::ADMIN_ROLE }; + role_types[3]={ Role::RefRole, Role::MemberRole, Role::AdminRole }; for(i=0; i < 3; i++) { @@ -7820,17 +7820,17 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetConfiguration()==Type::BASE_TYPE) + if(usr_type->getConfiguration()==Type::BaseType) { aux_type=getObjectPgSQLType(usr_type->getLikeType()); if(aux_type) getObjectDependecies(aux_type, deps, inc_indirect_deps); - for(i=Type::INPUT_FUNC; i <= Type::ANALYZE_FUNC; i++) + for(i=Type::InputFunc; i <= Type::AnalyzeFunc; i++) getObjectDependecies(usr_type->getFunction(i), deps, inc_indirect_deps); } - else if(usr_type->getConfiguration()==Type::COMPOSITE_TYPE) + else if(usr_type->getConfiguration()==Type::CompositeType) { count=usr_type->getAttributeCount(); for(i=0; i < count; i++) @@ -8190,7 +8190,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector type=dynamic_cast(*itr); itr++; - for(i1=Type::INPUT_FUNC; i1 <= Type::ANALYZE_FUNC && (!exclusion_mode || (exclusion_mode && !refer)); i1++) + for(i1=Type::InputFunc; i1 <= Type::AnalyzeFunc && (!exclusion_mode || (exclusion_mode && !refer)); i1++) { if(type->getFunction(i1)==func) { @@ -8207,9 +8207,9 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector lang=dynamic_cast(*itr); itr++; - if(lang->getFunction(Language::HANDLER_FUNC)==func || - lang->getFunction(Language::VALIDATOR_FUNC)==func || - lang->getFunction(Language::INLINE_FUNC)==func) + if(lang->getFunction(Language::HandlerFunc)==func || + lang->getFunction(Language::ValidatorFunc)==func || + lang->getFunction(Language::InlineFunc)==func) { refer=true; refs.push_back(lang); @@ -8478,7 +8478,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector unsigned i,i1, count; Role *role_aux=nullptr; Role *role=dynamic_cast(object); - unsigned role_types[3]={Role::REF_ROLE, Role::MEMBER_ROLE, Role::ADMIN_ROLE}; + unsigned role_types[3]={Role::RefRole, Role::MemberRole, Role::AdminRole}; Permission *perm=nullptr; //Check if the role is being referencend by permissions @@ -9294,7 +9294,7 @@ void DatabaseModel::createSystemObjects(bool create_public) postgres=new Role; postgres->setName(QString("postgres")); - postgres->setOption(Role::OP_SUPERUSER, true); + postgres->setOption(Role::OpSuperuser, true); postgres->setSystemObject(true); addRole(postgres); diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 062dbd04b1..8948e16af9 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -22,8 +22,8 @@ Element::Element(void) { column=nullptr; operator_class=nullptr; - sorting_attibs[NULLS_FIRST]=false; - sorting_attibs[ASC_ORDER]=true; + sorting_attibs[NullsFirst]=false; + sorting_attibs[AscOrder]=true; sorting_enabled=false; } @@ -52,7 +52,7 @@ void Element::setOperatorClass(OperatorClass *oper_class) void Element::setSortingAttribute(unsigned attrib, bool value) { - if(attrib > NULLS_FIRST) + if(attrib > NullsFirst) throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); sorting_attibs[attrib]=value; @@ -70,7 +70,7 @@ bool Element::isSortingEnabled(void) bool Element::getSortingAttribute(unsigned attrib) { - if(attrib > NULLS_FIRST) + if(attrib > NullsFirst) throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(sorting_attibs[attrib]); @@ -97,8 +97,8 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) attributes[ParsersAttributes::EXPRESSION]=QString(); attributes[ParsersAttributes::OP_CLASS]=QString(); attributes[ParsersAttributes::USE_SORTING]=(this->sorting_enabled ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::NULLS_FIRST]=(this->sorting_enabled && this->sorting_attibs[NULLS_FIRST] ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::ASC_ORDER]=(this->sorting_enabled && this->sorting_attibs[ASC_ORDER] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::NULLS_FIRST]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::ASC_ORDER]=(this->sorting_enabled && this->sorting_attibs[AscOrder] ? ParsersAttributes::_TRUE_ : QString()); if(column) @@ -121,8 +121,8 @@ bool Element::isEqualsTo(Element &elem) this->expression == elem.expression && this->operator_class == elem.operator_class && this->sorting_enabled == elem.sorting_enabled && - this->sorting_attibs[ASC_ORDER] == elem.sorting_attibs[ASC_ORDER] && - this->sorting_attibs[NULLS_FIRST] == elem.sorting_attibs[NULLS_FIRST]); + this->sorting_attibs[AscOrder] == elem.sorting_attibs[AscOrder] && + this->sorting_attibs[NullsFirst] == elem.sorting_attibs[NullsFirst]); } bool Element::operator == (Element &elem) diff --git a/libpgmodeler/src/element.h b/libpgmodeler/src/element.h index da71411473..36bc396c4c 100644 --- a/libpgmodeler/src/element.h +++ b/libpgmodeler/src/element.h @@ -60,8 +60,8 @@ class Element { public: //! \brief Constants used to reference the sorting method of the element - static constexpr unsigned ASC_ORDER=0, - NULLS_FIRST=1; + static constexpr unsigned AscOrder=0, + NullsFirst=1; Element(void); virtual ~Element(void) {} diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 340d824c31..39063a9907 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -60,7 +60,7 @@ void Extension::setHandlesType(bool value) void Extension::setVersion(unsigned ver, const QString &value) { - if(ver > OLD_VERSION) + if(ver > OldVersion) throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(versions[ver] != value); @@ -74,7 +74,7 @@ bool Extension::handlesType(void) QString Extension::getVersion(unsigned ver) { - if(ver > OLD_VERSION) + if(ver > OldVersion) throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(versions[ver]); @@ -87,8 +87,8 @@ QString Extension::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::NAME]=this->getName(def_type==SchemaParser::SqlDefinition, false); attributes[ParsersAttributes::HANDLES_TYPE]=(handles_type ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::CUR_VERSION]=versions[CUR_VERSION]; - attributes[ParsersAttributes::OLD_VERSION]=versions[OLD_VERSION]; + attributes[ParsersAttributes::CUR_VERSION]=versions[CurVersion]; + attributes[ParsersAttributes::OLD_VERSION]=versions[OldVersion]; return(BaseObject::__getCodeDefinition(def_type)); } @@ -105,9 +105,9 @@ QString Extension::getAlterDefinition(BaseObject *object) attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object); attributes[ParsersAttributes::NEW_VERSION]=QString(); - if(!this->versions[CUR_VERSION].isEmpty() && !ext->versions[CUR_VERSION].isEmpty() && - this->versions[CUR_VERSION].isEmpty() < ext->versions[CUR_VERSION].isEmpty()) - attributes[ParsersAttributes::NEW_VERSION]=ext->versions[CUR_VERSION]; + if(!this->versions[CurVersion].isEmpty() && !ext->versions[CurVersion].isEmpty() && + this->versions[CurVersion].isEmpty() < ext->versions[CurVersion].isEmpty()) + attributes[ParsersAttributes::NEW_VERSION]=ext->versions[CurVersion]; return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); } @@ -138,8 +138,8 @@ void Extension::operator = (Extension &ext) QString prev_name=this->getName(true); *(dynamic_cast(this))=dynamic_cast(ext); - this->versions[CUR_VERSION]=ext.versions[CUR_VERSION]; - this->versions[OLD_VERSION]=ext.versions[OLD_VERSION]; + this->versions[CurVersion]=ext.versions[CurVersion]; + this->versions[OldVersion]=ext.versions[OldVersion]; this->handles_type=ext.handles_type; if(this->handles_type) diff --git a/libpgmodeler/src/extension.h b/libpgmodeler/src/extension.h index 4a55c47341..a2dd9d742d 100644 --- a/libpgmodeler/src/extension.h +++ b/libpgmodeler/src/extension.h @@ -40,8 +40,8 @@ class Extension: public BaseObject { QString versions[2]; public: - static constexpr unsigned CUR_VERSION=0, - OLD_VERSION=1; + static constexpr unsigned CurVersion=0, + OldVersion=1; Extension(void); void setName(const QString &name); diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index d028ee3822..b414512bff 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -21,8 +21,8 @@ Index::Index(void) { obj_type=ObjIndex; - index_attribs[UNIQUE]=index_attribs[CONCURRENT]= - index_attribs[FAST_UPDATE]=index_attribs[BUFFERING]=false; + index_attribs[Unique]=index_attribs[Concurrent]= + index_attribs[FastUpdate]=index_attribs[Buffering]=false; fill_factor=90; attributes[ParsersAttributes::UNIQUE]=QString(); attributes[ParsersAttributes::CONCURRENT]=QString(); @@ -98,8 +98,8 @@ void Index::addIndexElement(const QString &expr, Collation *coll, OperatorClass elem.setOperatorClass(op_class); elem.setCollation(coll); elem.setSortingEnabled(use_sorting); - elem.setSortingAttribute(IndexElement::NULLS_FIRST, nulls_first); - elem.setSortingAttribute(IndexElement::ASC_ORDER, asc_order); + elem.setSortingAttribute(IndexElement::NullsFirst, nulls_first); + elem.setSortingAttribute(IndexElement::AscOrder, asc_order); if(getElementIndex(elem) >= 0) throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -132,8 +132,8 @@ void Index::addIndexElement(Column *column, Collation *coll, OperatorClass *op_c elem.setOperatorClass(op_class); elem.setCollation(coll); elem.setSortingEnabled(use_sorting); - elem.setSortingAttribute(IndexElement::NULLS_FIRST, nulls_first); - elem.setSortingAttribute(IndexElement::ASC_ORDER, asc_order); + elem.setSortingAttribute(IndexElement::NullsFirst, nulls_first); + elem.setSortingAttribute(IndexElement::AscOrder, asc_order); if(getElementIndex(elem) >= 0) throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -201,7 +201,7 @@ unsigned Index::getIndexElementCount(void) void Index::setIndexAttribute(unsigned attrib_id, bool value) { - if(attrib_id > BUFFERING) + if(attrib_id > Buffering) throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(index_attribs[attrib_id] != value); @@ -234,7 +234,7 @@ unsigned Index::getFillFactor(void) bool Index::getIndexAttribute(unsigned attrib_id) { - if(attrib_id > BUFFERING) + if(attrib_id > Buffering) throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(index_attribs[attrib_id]); @@ -331,8 +331,8 @@ QString Index::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); setIndexElementsAttribute(def_type); - attributes[ParsersAttributes::UNIQUE]=(index_attribs[UNIQUE] ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::CONCURRENT]=(index_attribs[CONCURRENT] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::UNIQUE]=(index_attribs[Unique] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::CONCURRENT]=(index_attribs[Concurrent] ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::INDEX_TYPE]=(~indexing_type); attributes[ParsersAttributes::PREDICATE]=predicate; attributes[ParsersAttributes::STORAGE_PARAMS]=QString(); @@ -346,10 +346,10 @@ QString Index::getCodeDefinition(unsigned def_type) } if(this->indexing_type==IndexingType::gin) - attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::FAST_UPDATE]=(index_attribs[FAST_UPDATE] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::FAST_UPDATE]=(index_attribs[FastUpdate] ? ParsersAttributes::_TRUE_ : QString()); if(this->indexing_type==IndexingType::gist) - attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::BUFFERING]=(index_attribs[BUFFERING] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::BUFFERING]=(index_attribs[Buffering] ? ParsersAttributes::_TRUE_ : QString()); if(/*this->indexing_type==IndexingType::btree && */fill_factor >= 10) { @@ -393,12 +393,12 @@ QString Index::getAlterDefinition(BaseObject *object) attribs[ParsersAttributes::FACTOR]=QString::number(index->fill_factor); if(this->indexing_type==IndexingType::gin && - this->index_attribs[FAST_UPDATE] != index->index_attribs[FAST_UPDATE]) - attribs[ParsersAttributes::FAST_UPDATE]=(index->index_attribs[FAST_UPDATE] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + this->index_attribs[FastUpdate] != index->index_attribs[FastUpdate]) + attribs[ParsersAttributes::FAST_UPDATE]=(index->index_attribs[FastUpdate] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); if(this->indexing_type==IndexingType::gist && - this->index_attribs[BUFFERING] != index->index_attribs[BUFFERING]) - attribs[ParsersAttributes::BUFFERING]=(index->index_attribs[BUFFERING] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + this->index_attribs[Buffering] != index->index_attribs[Buffering]) + attribs[ParsersAttributes::BUFFERING]=(index->index_attribs[Buffering] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); } copyAttributes(attribs); diff --git a/libpgmodeler/src/index.h b/libpgmodeler/src/index.h index 5bdbb019a4..656f91f095 100644 --- a/libpgmodeler/src/index.h +++ b/libpgmodeler/src/index.h @@ -54,10 +54,10 @@ class Index: public TableObject{ void validateElements(void); public: - static constexpr unsigned UNIQUE=0, - CONCURRENT=1, - FAST_UPDATE=2, - BUFFERING=3; + static constexpr unsigned Unique=0, + Concurrent=1, + FastUpdate=2, + Buffering=3; Index(void); diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 09e7e65928..20504f0978 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -23,7 +23,7 @@ Language::Language(void) obj_type=ObjLanguage; is_trusted=false; - for(unsigned i=VALIDATOR_FUNC; i <= INLINE_FUNC; i++) + for(unsigned i=ValidatorFunc; i <= InlineFunc; i++) functions[i]=nullptr; attributes[ParsersAttributes::TRUSTED]=QString(); @@ -58,20 +58,20 @@ void Language::setFunction(Function *func, unsigned func_type) (func && /* The handler function must be written in C and have 'language_handler' as return type */ - ((func_type==HANDLER_FUNC && + ((func_type==HandlerFunc && func->getReturnType()==QString("language_handler") && func->getParameterCount()==0 && func->getLanguage()->getName()==(~lang)) || /* The validator function must be written in C and return 'void' also must have only one parameter of the type 'oid' */ - (func_type==VALIDATOR_FUNC && + (func_type==ValidatorFunc && func->getReturnType()==QString("void") && func->getParameterCount()==1 && func->getParameter(0).getType() == QString("oid") && func->getLanguage()->getName()==(~lang)) || /* The inline function must be written in C and return 'void' also must have only one parameter of the type 'internal' */ - (func_type==INLINE_FUNC && + (func_type==InlineFunc && func->getReturnType()==QString("void") && func->getParameterCount()==1 && func->getParameter(0).getType() == QString("internal") && @@ -81,8 +81,8 @@ void Language::setFunction(Function *func, unsigned func_type) this->functions[func_type]=func; } //Raises an error in case the function return type doesn't matches the required by each rule - else if((func_type==HANDLER_FUNC && func->getReturnType()!=QString("language_handler")) || - ((func_type==VALIDATOR_FUNC || func_type==INLINE_FUNC) && func->getReturnType()!=QString("void"))) + else if((func_type==HandlerFunc && func->getReturnType()!=QString("language_handler")) || + ((func_type==ValidatorFunc || func_type==InlineFunc) && func->getReturnType()!=QString("void"))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjLanguage)), @@ -94,7 +94,7 @@ void Language::setFunction(Function *func, unsigned func_type) Function * Language::getFunction(unsigned func_type) { - if(func_type > INLINE_FUNC) + if(func_type > InlineFunc) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_type]); @@ -123,7 +123,7 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[ParsersAttributes::TRUSTED]=(is_trusted ? ParsersAttributes::_TRUE_ : QString()); if(!reduced_form && def_type==SchemaParser::XmlDefinition) - reduced_form=(!functions[VALIDATOR_FUNC] && !functions[HANDLER_FUNC] && !functions[INLINE_FUNC] && !this->getOwner()); + reduced_form=(!functions[ValidatorFunc] && !functions[HandlerFunc] && !functions[InlineFunc] && !this->getOwner()); for(i=0; i < 3; i++) { diff --git a/libpgmodeler/src/language.h b/libpgmodeler/src/language.h index c24804d8d8..c075140450 100644 --- a/libpgmodeler/src/language.h +++ b/libpgmodeler/src/language.h @@ -45,9 +45,9 @@ class Language: public BaseObject{ > VALIDATOR: Function that validates the code written in the language's syntax > HANDLER: Function that executes the functions written in the language's syntax > INLINE: Function that executes inline instructions (DO's) (only on PostgreSQL 9.x) */ - static constexpr unsigned VALIDATOR_FUNC=0, - HANDLER_FUNC=1, - INLINE_FUNC=2; + static constexpr unsigned ValidatorFunc=0, + HandlerFunc=1, + InlineFunc=2; Language(void); diff --git a/libpgmodeler/src/operation.cpp b/libpgmodeler/src/operation.cpp index 21bc64a67a..d5f645a649 100644 --- a/libpgmodeler/src/operation.cpp +++ b/libpgmodeler/src/operation.cpp @@ -24,8 +24,8 @@ Operation::Operation(void) pool_obj=nullptr; original_obj=nullptr; object_idx=-1; - chain_type=NO_CHAIN; - op_type=NO_OPERATION; + chain_type=NoChain; + op_type=NoOperation; } QString Operation::generateOperationId(void) @@ -51,12 +51,12 @@ void Operation::setObjectIndex(int idx) void Operation::setChainType(unsigned type) { - chain_type=(type > CHAIN_END ? NO_CHAIN : type); + chain_type=(type > ChainEnd ? NoChain : type); } void Operation::setOperationType(unsigned type) { - op_type=(type > OBJECT_MOVED ? NO_OPERATION : type); + op_type=(type > ObjectMoved ? NoOperation : type); } void Operation::setOriginalObject(BaseObject *object) diff --git a/libpgmodeler/src/operation.h b/libpgmodeler/src/operation.h index 64334cadcd..4444fe7858 100644 --- a/libpgmodeler/src/operation.h +++ b/libpgmodeler/src/operation.h @@ -70,21 +70,21 @@ class Operation { public: //! \brief Constants used to reference the type of operations - static constexpr unsigned NO_OPERATION=0, - OBJECT_MODIFIED=1, - OBJECT_CREATED=2, - OBJECT_REMOVED=3, + static constexpr unsigned NoOperation=0, + ObjectModified=1, + ObjectCreated=2, + ObjectRemoved=3, /*! \brief This type of operation has the same effect of operation OBJECT_MODIFIED except that it not (re)validate relationships as happens with operations. This type of operation (OBJECT_MOVED) is useful to undo position changes of graphical objects without executing unnecessary revalidations of relationships */ - OBJECT_MOVED=4; + ObjectMoved=4; //! \brief Operation chain types - static constexpr unsigned NO_CHAIN=0, //! \brief The operation is not part of a chain - CHAIN_START=1, //! \brief The operation is the head of the chain - CHAIN_MIDDLE=2, //! \brief The operation is in the middle of the chain - CHAIN_END=3; //! \brief The operation is the last on the chain + static constexpr unsigned NoChain=0, //! \brief The operation is not part of a chain + ChainStart=1, //! \brief The operation is the head of the chain + ChainMiddle=2, //! \brief The operation is in the middle of the chain + ChainEnd=3; //! \brief The operation is the last on the chain Operation(void); diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 69a3b68042..573b05d058 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -30,7 +30,7 @@ OperationList::OperationList(DatabaseModel *model) this->model=model; xmlparser=model->getXMLParser(); current_index=0; - next_op_chain=Operation::NO_CHAIN; + next_op_chain=Operation::NoChain; ignore_chain=false; operations.reserve(max_size); } @@ -59,12 +59,12 @@ void OperationList::startOperationChain(void) { /* If the chaining is started and the user try it initializes again, the earlier chaining is finished */ - if(next_op_chain!=Operation::NO_CHAIN) + if(next_op_chain!=Operation::NoChain) finishOperationChain(); /* The next operation inserted on the list will be the start of the chaining */ - next_op_chain=Operation::CHAIN_START; + next_op_chain=Operation::ChainStart; } void OperationList::finishOperationChain(void) @@ -72,11 +72,11 @@ void OperationList::finishOperationChain(void) /* If the chain is not ignored indicates that the next element of the list no longer will be part of chaining */ if(!ignore_chain) - next_op_chain=Operation::NO_CHAIN; + next_op_chain=Operation::NoChain; else if(ignore_chain) /* If the chain is canceled indicates that the next element of the list still part of the chaining */ - next_op_chain=Operation::CHAIN_MIDDLE; + next_op_chain=Operation::ChainMiddle; if(operations.size() > 0 && !ignore_chain) { @@ -84,15 +84,15 @@ void OperationList::finishOperationChain(void) /* Marks the last operatin as being the end of chaining in case it is on the middle of chain */ - if(operations[idx]->getChainType()==Operation::CHAIN_MIDDLE) - operations[idx]->setChainType(Operation::CHAIN_END); + if(operations[idx]->getChainType()==Operation::ChainMiddle) + operations[idx]->setChainType(Operation::ChainEnd); /* If the last operation is marked as CHAIN_START indicates that the chaining was open but only one operation is recorded and thus the operation is marked as NO_CHAIN because as it is only one operation there is no need to treat it as chaining */ - else if(operations[idx]->getChainType()==Operation::CHAIN_START) - operations[idx]->setChainType(Operation::NO_CHAIN); + else if(operations[idx]->getChainType()==Operation::ChainStart) + operations[idx]->setChainType(Operation::NoChain); } } @@ -103,8 +103,8 @@ void OperationList::ignoreOperationChain(bool value) bool OperationList::isOperationChainStarted(void) { - return(next_op_chain==Operation::CHAIN_START || - next_op_chain==Operation::CHAIN_MIDDLE); + return(next_op_chain==Operation::ChainStart || + next_op_chain==Operation::ChainMiddle); } bool OperationList::isObjectRegistered(BaseObject *object, unsigned op_type) @@ -159,8 +159,8 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) obj_type=object->getObjectType(); //Stores a copy of the object if its about to be moved or modified - if(op_type==Operation::OBJECT_MODIFIED || - op_type==Operation::OBJECT_MOVED) + if(op_type==Operation::ObjectModified || + op_type==Operation::ObjectMoved) { BaseObject *copy_obj=nullptr; @@ -398,15 +398,15 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje operation->setPoolObject(object_pool.back()); //Stores the object's permission befor its removal - if(op_type==Operation::OBJECT_REMOVED) + if(op_type==Operation::ObjectRemoved) { vector perms; model->getPermissions(object, perms); operation->setPermissions(perms); } - if(next_op_chain==Operation::CHAIN_START) - next_op_chain=Operation::CHAIN_MIDDLE; + if(next_op_chain==Operation::ChainStart) + next_op_chain=Operation::ChainMiddle; /* Performing specific operations according to the type of object. If the object has a parent object, it must be discovered @@ -423,7 +423,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje (obj_type==ObjIndex && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || (obj_type==ObjConstraint && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()))) { - if(op_type==Operation::OBJECT_REMOVED) + if(op_type==Operation::ObjectRemoved) tab_obj->setParentTable(parent_tab); if(tab_obj->getObjectType()==ObjConstraint) @@ -532,21 +532,21 @@ unsigned OperationList::getChainSize(void) //Checks if the current operations is chained if(!operations.empty() && - operations[i]->getChainType()!=Operation::NO_CHAIN) + operations[i]->getChainType()!=Operation::NoChain) { - unsigned chain_type=Operation::NO_CHAIN; + unsigned chain_type=Operation::NoChain; int inc=0; //Case the operation is the end of a chain runs the list in reverse order (from end to start) - if(operations[i]->getChainType()==Operation::CHAIN_END) + if(operations[i]->getChainType()==Operation::ChainEnd) { - chain_type=Operation::CHAIN_START; + chain_type=Operation::ChainStart; inc=-1; } //Case the operation is the start of a chain runs the list in normal order (from start to end) - else if(operations[i]->getChainType()==Operation::CHAIN_START) + else if(operations[i]->getChainType()==Operation::ChainStart) { - chain_type=Operation::CHAIN_END; + chain_type=Operation::ChainEnd; inc=1; } @@ -586,14 +586,14 @@ void OperationList::undoOperation(void) and active chaining flag is cleared marks the flag to start the execution several operations at once */ if(!ignore_chain && !chain_active && - operation->getChainType()!=Operation::NO_CHAIN) + operation->getChainType()!=Operation::NoChain) chain_active=true; /* If the chaining is active and the current operation is not part of chain, aborts execution of the operation */ else if(chain_active && - (operation->getChainType()==Operation::CHAIN_END || - operation->getChainType()==Operation::NO_CHAIN)) + (operation->getChainType()==Operation::ChainEnd || + operation->getChainType()==Operation::NoChain)) break; try @@ -615,7 +615,7 @@ void OperationList::undoOperation(void) /* Performs the operations while the current operation is part of chain or the undo option is available */ while(!ignore_chain && isUndoAvailable() && - operation->getChainType()!=Operation::NO_CHAIN); + operation->getChainType()!=Operation::NoChain); if(error.getErrorType()!=Custom) throw Exception(UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); @@ -642,14 +642,14 @@ void OperationList::redoOperation(void) and active chaining flag is cleared marks the flag to start the execution several operations at once */ if(!ignore_chain && !chain_active && - operation->getChainType()!=Operation::NO_CHAIN) + operation->getChainType()!=Operation::NoChain) chain_active=true; /* If the chaining is active and the current operation is not part of chain or it is at the start of chain, aborts execution of the operation */ else if(chain_active && - (operation->getChainType()==Operation::CHAIN_START || - operation->getChainType()==Operation::NO_CHAIN)) + (operation->getChainType()==Operation::ChainStart || + operation->getChainType()==Operation::NoChain)) break; try @@ -670,7 +670,7 @@ void OperationList::redoOperation(void) /* Performs the operations while the current operation is part of chain or the redo option is available */ while(!ignore_chain && isRedoAvailable() && - operation->getChainType()!=Operation::NO_CHAIN); + operation->getChainType()!=Operation::NoChain); if(error.getErrorType()!=Custom) throw Exception(UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); @@ -687,7 +687,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) BaseTable *parent_tab=nullptr; Relationship *parent_rel=nullptr; QString xml_def; - unsigned op_type=Operation::NO_OPERATION; + unsigned op_type=Operation::NoOperation; int obj_idx=-1; object=oper->getPoolObject(); @@ -713,10 +713,10 @@ void OperationList::executeOperation(Operation *oper, bool redo) /* If the XML definition of object is set indicates that it is referencing a column included by relationship (special object) */ if(!xml_def.isEmpty() && - ((op_type==Operation::OBJECT_REMOVED && !redo) || - (op_type==Operation::OBJECT_CREATED && redo) || - (op_type==Operation::OBJECT_MODIFIED || - op_type==Operation::OBJECT_MOVED))) + ((op_type==Operation::ObjectRemoved && !redo) || + (op_type==Operation::ObjectCreated && redo) || + (op_type==Operation::ObjectModified || + op_type==Operation::ObjectMoved))) { //Resets the XML parser and loads the buffer xml from the operation xmlparser->restartParser(); @@ -738,8 +738,8 @@ void OperationList::executeOperation(Operation *oper, bool redo) /* If the operation is a modified/moved object, the object copy stored in the pool will be restored */ - if(op_type==Operation::OBJECT_MODIFIED || - op_type==Operation::OBJECT_MOVED) + if(op_type==Operation::ObjectModified || + op_type==Operation::ObjectMoved) { if(obj_type==ObjRelationship) { @@ -788,8 +788,8 @@ void OperationList::executeOperation(Operation *oper, bool redo) if the object was previously created and wants to redo the operation the existing pool object will be inserted into table or in your relationship on its original index */ - else if((op_type==Operation::OBJECT_REMOVED && !redo) || - (op_type==Operation::OBJECT_CREATED && redo)) + else if((op_type==Operation::ObjectRemoved && !redo) || + (op_type==Operation::ObjectCreated && redo)) { if(aux_obj) PgModelerNs::copyObject(reinterpret_cast(&object), aux_obj, obj_type); @@ -809,14 +809,14 @@ void OperationList::executeOperation(Operation *oper, bool redo) model->addObject(object, obj_idx); - if(op_type==Operation::OBJECT_REMOVED) + if(op_type==Operation::ObjectRemoved) model->addPermissions(oper->getPermissions()); } /* If the operation is a previously created object or if the object was removed and wants to redo the operation it'll be excluded from the table or relationship */ - else if((op_type==Operation::OBJECT_CREATED && !redo) || - (op_type==Operation::OBJECT_REMOVED && redo)) + else if((op_type==Operation::ObjectCreated && !redo) || + (op_type==Operation::ObjectRemoved && redo)) { if(parent_tab) parent_tab->removeObject(object); @@ -864,30 +864,30 @@ void OperationList::executeOperation(Operation *oper, bool redo) { BaseGraphicObject *graph_obj=dynamic_cast(object); - if(op_type==Operation::OBJECT_MODIFIED || - op_type==Operation::OBJECT_MOVED) + if(op_type==Operation::ObjectModified || + op_type==Operation::ObjectMoved) graph_obj->setModified(true); //Case the object is a view is necessary to update the table-view relationships on the model - if(obj_type==ObjView && op_type==Operation::OBJECT_MODIFIED) + if(obj_type==ObjView && op_type==Operation::ObjectModified) model->updateViewRelationships(dynamic_cast(graph_obj)); else if((obj_type==ObjRelationship || (obj_type==ObjTable && model->getRelationship(dynamic_cast(object), nullptr))) && - op_type==Operation::OBJECT_MODIFIED) + op_type==Operation::ObjectModified) model->validateRelationships(); //If a object had its schema restored is necessary to update the envolved schemas if((obj_type==ObjTable || obj_type==ObjView) && - ((bkp_obj && graph_obj->getSchema()!=bkp_obj->getSchema() && op_type==Operation::OBJECT_MODIFIED) || - op_type==Operation::OBJECT_MOVED)) + ((bkp_obj && graph_obj->getSchema()!=bkp_obj->getSchema() && op_type==Operation::ObjectModified) || + op_type==Operation::ObjectMoved)) { dynamic_cast(graph_obj->getSchema())->setModified(true); if(bkp_obj) - dynamic_cast(bkp_obj->getSchema())->setModified(op_type==Operation::OBJECT_MODIFIED); + dynamic_cast(bkp_obj->getSchema())->setModified(op_type==Operation::ObjectModified); } } - else if(op_type==Operation::OBJECT_MODIFIED) + else if(op_type==Operation::ObjectModified) { if(obj_type==ObjSchema) { @@ -908,7 +908,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) } //Case the object is a type update the tables that are referencing it - if(op_type==Operation::OBJECT_MODIFIED && + if(op_type==Operation::ObjectModified && (object->getObjectType()==ObjType || object->getObjectType()==ObjDomain || object->getObjectType()==ObjTable || object->getObjectType()==ObjView || object->getObjectType()==ObjExtension)) @@ -952,8 +952,8 @@ void OperationList::removeLastOperation(void) is removed the iteration is stopped.*/ end=(ignore_chain || (!ignore_chain && - (oper->getChainType()==Operation::NO_CHAIN || - oper->getChainType()==Operation::CHAIN_START))); + (oper->getChainType()==Operation::NoChain || + oper->getChainType()==Operation::ChainStart))); itr++; oper_idx--; } @@ -961,8 +961,8 @@ void OperationList::removeLastOperation(void) /* If the head of chaining is removed (CHAIN_START) marks that the next element in the list is the new start of chain */ - if(oper && oper->getChainType()==Operation::CHAIN_START) - next_op_chain=Operation::CHAIN_START; + if(oper && oper->getChainType()==Operation::ChainStart) + next_op_chain=Operation::ChainStart; //Erasing the excluded operations for(int i=operations.size()-1; i > oper_idx ; i--) diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 064374c2cc..086fc7f0a2 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -20,7 +20,7 @@ OperatorClassElement::OperatorClassElement(void) { - element_type=OPERATOR_ELEM; + element_type=OperatorElem; function=nullptr; _operator=nullptr; strategy_number=0; @@ -44,7 +44,7 @@ void OperatorClassElement::setFunction(Function *func, unsigned stg_number) //Configure the attributes that belongs to the element type this->function=func; this->strategy_number=stg_number; - this->element_type=FUNCTION_ELEM; + this->element_type=FunctionElem; } void OperatorClassElement::setOperator(Operator *oper, unsigned stg_number) @@ -63,12 +63,12 @@ void OperatorClassElement::setOperator(Operator *oper, unsigned stg_number) //Configure the attributes that belongs to the element type this->_operator=oper; this->strategy_number=stg_number; - this->element_type=OPERATOR_ELEM; + this->element_type=OperatorElem; } void OperatorClassElement::setOperatorFamily(OperatorFamily *op_family) { - if(this->element_type==OPERATOR_ELEM) + if(this->element_type==OperatorElem) { if(op_family && op_family->getIndexingType()!=IndexingType::btree) throw Exception(AsgInvalidOpFamilyOpClassElem,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -87,7 +87,7 @@ void OperatorClassElement::setStorage(PgSQLType storage) //Configure the attributes that belongs to the element type this->storage=storage; - this->element_type=STORAGE_ELEM; + this->element_type=StorageElem; } unsigned OperatorClassElement::getElementType(void) @@ -134,7 +134,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::OP_FAMILY]=QString(); attributes[ParsersAttributes::DEFINITION]=QString(); - if(element_type==FUNCTION_ELEM && function && strategy_number > 0) + if(element_type==FunctionElem && function && strategy_number > 0) { //FUNCTION support_number [ ( op_type [ , op_type ] ) ] funcname ( argument_type [, ...] ) attributes[ParsersAttributes::FUNCTION]=ParsersAttributes::_TRUE_; @@ -145,7 +145,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) else attributes[ParsersAttributes::DEFINITION]=function->getCodeDefinition(def_type,true); } - else if(element_type==OPERATOR_ELEM && _operator && strategy_number > 0) + else if(element_type==OperatorElem && _operator && strategy_number > 0) { //OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] [ FOR SEARCH | FOR ORDER BY sort_family_name ] attributes[ParsersAttributes::OPERATOR]=ParsersAttributes::_TRUE_; @@ -164,7 +164,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::DEFINITION]+=op_family->getCodeDefinition(def_type,true); } } - else if(element_type==STORAGE_ELEM && storage!=PgSQLType::null) + else if(element_type==StorageElem && storage!=PgSQLType::null) { //STORAGE storage_type attributes[ParsersAttributes::STORAGE]=ParsersAttributes::_TRUE_; diff --git a/libpgmodeler/src/operatorclasselement.h b/libpgmodeler/src/operatorclasselement.h index 3c21b9e4c1..e64fd8756a 100644 --- a/libpgmodeler/src/operatorclasselement.h +++ b/libpgmodeler/src/operatorclasselement.h @@ -60,9 +60,9 @@ class OperatorClassElement { public: //! \brief Constants used to reference the element types - static constexpr unsigned OPERATOR_ELEM=0, - FUNCTION_ELEM=1, - STORAGE_ELEM=2; + static constexpr unsigned OperatorElem=0, + FunctionElem=1, + StorageElem=2; OperatorClassElement(void); virtual ~OperatorClassElement(void){} diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 49271ba1f6..bbb828d0f1 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -25,7 +25,7 @@ Permission::Permission(BaseObject *obj) unsigned priv_id; //Initializes all the privileges as unchecked - for(priv_id=PRIV_SELECT; priv_id<=PRIV_USAGE; priv_id++) + for(priv_id=PrivSelect; priv_id<=PrivUsage; priv_id++) privileges[priv_id]=grant_option[priv_id]=false; //Raises an error if the object associated to the permission is no allocated @@ -63,7 +63,7 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) //Validating privilege - if(result && priv_id <= PRIV_USAGE) + if(result && priv_id <= PrivUsage) { /* Some privileges are valid only for certain types @@ -85,29 +85,29 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) result=result && (((obj_type==ObjTable || obj_type==ObjView) && - (priv_id==PRIV_SELECT || priv_id==PRIV_INSERT || - priv_id==PRIV_UPDATE || priv_id==PRIV_DELETE || - priv_id==PRIV_REFERENCES || priv_id==PRIV_TRIGGER)) || + (priv_id==PrivSelect || priv_id==PrivInsert || + priv_id==PrivUpdate || priv_id==PrivDelete || + priv_id==PrivReferences || priv_id==PrivTrigger)) || - ((obj_type==ObjTable || obj_type==ObjView) && priv_id==PRIV_TRUNCATE) || + ((obj_type==ObjTable || obj_type==ObjView) && priv_id==PrivTruncate) || (obj_type==ObjColumn && - (priv_id==PRIV_SELECT ||priv_id==PRIV_INSERT || - priv_id==PRIV_UPDATE || priv_id==PRIV_REFERENCES)) || + (priv_id==PrivSelect ||priv_id==PrivInsert || + priv_id==PrivUpdate || priv_id==PrivReferences)) || (obj_type==ObjSequence && - (priv_id==PRIV_USAGE || priv_id==PRIV_SELECT || priv_id==PRIV_UPDATE)) || + (priv_id==PrivUsage || priv_id==PrivSelect || priv_id==PrivUpdate)) || (obj_type==ObjDatabase && - (priv_id==PRIV_CREATE || priv_id==PRIV_CONNECT || priv_id==PRIV_TEMPORARY)) || + (priv_id==PrivCreate || priv_id==PrivConnect || priv_id==PrivTemporary)) || - ((obj_type==ObjFunction || obj_type==ObjAggregate) && priv_id==PRIV_EXECUTE) || + ((obj_type==ObjFunction || obj_type==ObjAggregate) && priv_id==PrivExecute) || - ((obj_type==ObjLanguage || obj_type==ObjType || obj_type==ObjDomain) && priv_id==PRIV_USAGE) || + ((obj_type==ObjLanguage || obj_type==ObjType || obj_type==ObjDomain) && priv_id==PrivUsage) || - (obj_type==ObjSchema && (priv_id==PRIV_USAGE || priv_id==PRIV_CREATE)) || + (obj_type==ObjSchema && (priv_id==PrivUsage || priv_id==PrivCreate)) || - (obj_type==ObjTablespace && priv_id==PRIV_CREATE)); + (obj_type==ObjTablespace && priv_id==PrivCreate)); } return(result); @@ -139,7 +139,7 @@ void Permission::addRole(Role *role) void Permission::setPrivilege(unsigned priv_id, bool value, bool grant_op) { //Caso o tipo de privilégio sejá inválido dispara uma exceção - if(priv_id > PRIV_USAGE) + if(priv_id > PrivUsage) throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!acceptsPermission(object->getObjectType(), priv_id)) @@ -245,7 +245,7 @@ BaseObject *Permission::getObject(void) bool Permission::getPrivilege(unsigned priv_id) { //Raises an error if the privilege is invalid - if(priv_id > PRIV_USAGE) + if(priv_id > PrivUsage) throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(privileges[priv_id]); @@ -254,7 +254,7 @@ bool Permission::getPrivilege(unsigned priv_id) bool Permission::getGrantOption(unsigned priv_id) { //Raises an error if the privilege is invalid - if(priv_id > PRIV_USAGE) + if(priv_id > PrivUsage) throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(grant_option[priv_id]); diff --git a/libpgmodeler/src/permission.h b/libpgmodeler/src/permission.h index c792328f52..1152605127 100644 --- a/libpgmodeler/src/permission.h +++ b/libpgmodeler/src/permission.h @@ -84,18 +84,18 @@ class Permission: public BaseObject { public: //! \brief Constants used to reference the privileges - static constexpr unsigned PRIV_SELECT=0, - PRIV_INSERT=1, - PRIV_UPDATE=2, - PRIV_DELETE=3, - PRIV_TRUNCATE=4, - PRIV_REFERENCES=5, - PRIV_TRIGGER=6, - PRIV_CREATE=7, - PRIV_CONNECT=8, - PRIV_TEMPORARY=9, - PRIV_EXECUTE=10, - PRIV_USAGE=11; + static constexpr unsigned PrivSelect=0, + PrivInsert=1, + PrivUpdate=2, + PrivDelete=3, + PrivTruncate=4, + PrivReferences=5, + PrivTrigger=6, + PrivCreate=7, + PrivConnect=8, + PrivTemporary=9, + PrivExecute=10, + PrivUsage=11; /*! \brief In the constructor is required to specify which object will receive the permissions this can not be changed after the object instance of diff --git a/libpgmodeler/src/pgmodelerns.h b/libpgmodeler/src/pgmodelerns.h index 3eacde7588..0a0f94fb38 100644 --- a/libpgmodeler/src/pgmodelerns.h +++ b/libpgmodeler/src/pgmodelerns.h @@ -29,10 +29,10 @@ namespace PgModelerNs { //! \brief Default char used as unescaped value start delimiter - static const QChar UNESC_VALUE_START='/'; + static const QChar UnescValueStart='/'; //! \brief Default char used as unescaped value end delimiter - static const QChar UNESC_VALUE_END='/'; + static const QChar UnescValueEnd='/'; /*! \brief Template function that makes a copy from 'copy_obj' to 'psrc_obj' doing the cast to the correct object type. If the source object (psrc_obj) is not allocated the function allocates the attributes diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 0ba2d19316..84d9f65184 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -101,9 +101,9 @@ QString Reference::getExpression(void) unsigned Reference::getReferenceType(void) { if(expression.isEmpty()) - return(REFER_COLUMN); + return(ReferColumn); else - return(REFER_EXPRESSION); + return(ReferExpression); } void Reference::setReferenceAlias(const QString &alias) @@ -127,10 +127,10 @@ QString Reference::getSQLDefinition(unsigned sql_type) refer_type=getReferenceType(); //Case the reference is between the SELECT-FROM keywords - if(sql_type==SQL_REFER_SELECT) + if(sql_type==SqlReferSelect) { //Case the reference is linked to a column - if(refer_type==REFER_COLUMN) + if(refer_type==ReferColumn) { /* Generated SQL definition: [TABLE_ALIAS.]{COLUMN_NAME | *} [AS COLUMN_ALIAS] */ @@ -166,14 +166,14 @@ QString Reference::getSQLDefinition(unsigned sql_type) sql_def+=QString(",\n"); } //Case the reference is between the FROM-[JOIN | WHERE] keywords - else if(sql_type==SQL_REFER_FROM) + else if(sql_type==SqlReferFrom) { /* Case the reference is linked to a column only the table name is used. For expression the complete code is used thus the generated code is: ... FROM {TABLE_NAME} [AS ALIAS] or ... FROM {EXPRESSION} */ - if(refer_type==REFER_COLUMN) + if(refer_type==ReferColumn) { sql_def+=table->getName(true); @@ -189,7 +189,7 @@ QString Reference::getSQLDefinition(unsigned sql_type) else { //Case the column is allocated - if(refer_type==REFER_COLUMN && column) + if(refer_type==ReferColumn && column) { /* Generated SQL definition: ... WHERE {TABLE_NAME | ALIAS}.{COLUMN_NAME} */ @@ -204,7 +204,7 @@ QString Reference::getSQLDefinition(unsigned sql_type) if(column) sql_def+=column->getName(true); } - else if(refer_type==REFER_EXPRESSION) + else if(refer_type==ReferExpression) sql_def=expression; } @@ -242,7 +242,7 @@ bool Reference::operator == (Reference &refer) if(ref_type==refer.getReferenceType()) { - if(ref_type==REFER_COLUMN) + if(ref_type==ReferColumn) { return(this->table==refer.table && this->column==refer.column && diff --git a/libpgmodeler/src/reference.h b/libpgmodeler/src/reference.h index 9fd5821eac..3b2ff88f4a 100644 --- a/libpgmodeler/src/reference.h +++ b/libpgmodeler/src/reference.h @@ -54,15 +54,15 @@ class Reference { public: //! \brief Constants used to define the reference type - static constexpr unsigned REFER_COLUMN=0, //! \brief The reference is based on a table column - REFER_EXPRESSION=1; //! \brief The reference is based on an expression + static constexpr unsigned ReferColumn=0, //! \brief The reference is based on a table column + ReferExpression=1; //! \brief The reference is based on an expression //! \brief Constants used on the view code generation - static constexpr unsigned SQL_REFER_WHERE=1, - SQL_REFER_SELECT=2, - SQL_REFER_FROM=4, - SQL_REFER_END_EXPR=8, - SQL_VIEW_DEFINITION=16; + static constexpr unsigned SqlReferWhere=1, + SqlReferSelect=2, + SqlReferFrom=4, + SqlReferEndExpr=8, + SqlViewDefinition=16; Reference(void); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index d35429697a..572f580205 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -20,19 +20,19 @@ #include "pgmodelerns.h" #include -const QString Relationship::SUFFIX_SEPARATOR=QString("_"); -const QString Relationship::SRC_TAB_TOKEN=QString("{st}"); -const QString Relationship::DST_TAB_TOKEN=QString("{dt}"); -const QString Relationship::GEN_TAB_TOKEN=QString("{gt}"); -const QString Relationship::SRC_COL_TOKEN=QString("{sc}"); - -constexpr unsigned Relationship::SRC_COL_PATTERN; -constexpr unsigned Relationship::DST_COL_PATTERN; -constexpr unsigned Relationship::PK_PATTERN; -constexpr unsigned Relationship::UQ_PATTERN; -constexpr unsigned Relationship::SRC_FK_PATTERN; -constexpr unsigned Relationship::DST_FK_PATTERN; -constexpr unsigned Relationship::PK_COL_PATTERN; +const QString Relationship::SuffixSeparator=QString("_"); +const QString Relationship::SrcTabToken=QString("{st}"); +const QString Relationship::DstTabToken=QString("{dt}"); +const QString Relationship::GenTabToken=QString("{gt}"); +const QString Relationship::SrcColToken=QString("{sc}"); + +constexpr unsigned Relationship::SrcColPattern; +constexpr unsigned Relationship::DstColPattern; +constexpr unsigned Relationship::PkPattern; +constexpr unsigned Relationship::UqPattern; +constexpr unsigned Relationship::SrcFkPattern; +constexpr unsigned Relationship::DstFkPattern; +constexpr unsigned Relationship::PkColPattern; Relationship::Relationship(Relationship *rel) : BaseRelationship(rel) { @@ -153,22 +153,22 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, if(tab_name_relnn.size() > BaseObject::ObjectNameMaxLength) tab_name_relnn.resize(BaseObject::ObjectNameMaxLength); - setNamePattern(PK_PATTERN, GEN_TAB_TOKEN + SUFFIX_SEPARATOR + QString("pk")); - setNamePattern(SRC_FK_PATTERN, SRC_TAB_TOKEN + SUFFIX_SEPARATOR + QString("fk")); - setNamePattern(DST_FK_PATTERN, DST_TAB_TOKEN + SUFFIX_SEPARATOR + QString("fk")); - setNamePattern(UQ_PATTERN, GEN_TAB_TOKEN + SUFFIX_SEPARATOR + QString("uq")); - setNamePattern(SRC_COL_PATTERN, SRC_COL_TOKEN + SUFFIX_SEPARATOR + SRC_TAB_TOKEN); - setNamePattern(DST_COL_PATTERN, SRC_COL_TOKEN + SUFFIX_SEPARATOR + DST_TAB_TOKEN); - setNamePattern(PK_COL_PATTERN, QString("id")); + setNamePattern(PkPattern, GenTabToken + SuffixSeparator + QString("pk")); + setNamePattern(SrcFkPattern, SrcTabToken + SuffixSeparator + QString("fk")); + setNamePattern(DstFkPattern, DstTabToken + SuffixSeparator + QString("fk")); + setNamePattern(UqPattern, GenTabToken + SuffixSeparator + QString("uq")); + setNamePattern(SrcColPattern, SrcColToken + SuffixSeparator + SrcTabToken); + setNamePattern(DstColPattern, SrcColToken + SuffixSeparator + DstTabToken); + setNamePattern(PkColPattern, QString("id")); } else if(rel_type==RelationshipDep || rel_type==RelationshipGen) - setNamePattern(PK_PATTERN, DST_TAB_TOKEN + SUFFIX_SEPARATOR + QString("pk")); + setNamePattern(PkPattern, DstTabToken + SuffixSeparator + QString("pk")); else { - setNamePattern(PK_PATTERN, DST_TAB_TOKEN + SUFFIX_SEPARATOR + QString("pk")); - setNamePattern(SRC_FK_PATTERN, SRC_TAB_TOKEN + SUFFIX_SEPARATOR + QString("fk")); - setNamePattern(UQ_PATTERN, DST_TAB_TOKEN + SUFFIX_SEPARATOR + QString("uq")); - setNamePattern(SRC_COL_PATTERN, SRC_COL_TOKEN + SUFFIX_SEPARATOR + SRC_TAB_TOKEN); + setNamePattern(PkPattern, DstTabToken + SuffixSeparator + QString("pk")); + setNamePattern(SrcFkPattern, SrcTabToken + SuffixSeparator + QString("fk")); + setNamePattern(UqPattern, DstTabToken + SuffixSeparator + QString("uq")); + setNamePattern(SrcColPattern, SrcColToken + SuffixSeparator + SrcTabToken); } rejected_col_count=0; @@ -185,14 +185,14 @@ void Relationship::setNamePattern(unsigned pat_id, const QString &pattern) if(!pattern.isEmpty()) { QString aux_name=pattern, - pat_tokens[]={ SRC_TAB_TOKEN, DST_TAB_TOKEN, - GEN_TAB_TOKEN, SRC_COL_TOKEN }; + pat_tokens[]={ SrcTabToken, DstTabToken, + GenTabToken, SrcColToken }; unsigned i, count=sizeof(pat_tokens)/sizeof(QString); for(i=0; i < count; i++) aux_name.replace(pat_tokens[i], QString("%1").arg(static_cast('a' + i))); - if(pat_id > PK_COL_PATTERN) + if(pat_id > PkColPattern) throw Exception(Exception::getErrorMessage(RefInvalidNamePatternId) .arg(this->getName()),__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!BaseObject::isValidName(aux_name)) @@ -206,7 +206,7 @@ void Relationship::setNamePattern(unsigned pat_id, const QString &pattern) QString Relationship::getNamePattern(unsigned pat_id) { - if(pat_id > PK_COL_PATTERN) + if(pat_id > PkColPattern) throw Exception(RefInvalidNamePatternId,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(name_patterns[pat_id]); @@ -217,23 +217,23 @@ QString Relationship::generateObjectName(unsigned pat_id, Column *id_col, bool u QString name, aux_name; name=name_patterns[pat_id]; - name.replace(GEN_TAB_TOKEN, (rel_type==RelationshipNn ? tab_name_relnn : QString())); + name.replace(GenTabToken, (rel_type==RelationshipNn ? tab_name_relnn : QString())); if(rel_type==RelationshipNn) { aux_name = use_alias && !src_table->getAlias().isEmpty() ? src_table->getAlias() : src_table->getName(); - name.replace(SRC_TAB_TOKEN, aux_name); + name.replace(SrcTabToken, aux_name); aux_name = use_alias && !dst_table->getAlias().isEmpty() ? dst_table->getAlias() : dst_table->getName(); - name.replace(DST_TAB_TOKEN, aux_name); + name.replace(DstTabToken, aux_name); } else { aux_name = use_alias && !getReferenceTable()->getAlias().isEmpty() ? getReferenceTable()->getAlias() : getReferenceTable()->getName(); - name.replace(SRC_TAB_TOKEN, aux_name); + name.replace(SrcTabToken, aux_name); aux_name = use_alias && !getReceiverTable()->getAlias().isEmpty() ? getReceiverTable()->getAlias() : getReceiverTable()->getName(); - name.replace(DST_TAB_TOKEN, aux_name); + name.replace(DstTabToken, aux_name); } aux_name.clear(); @@ -241,7 +241,7 @@ QString Relationship::generateObjectName(unsigned pat_id, Column *id_col, bool u if(id_col) aux_name = use_alias && !id_col->getAlias().isEmpty() ? id_col->getAlias() : id_col->getName(); - name.replace(SRC_COL_TOKEN, aux_name); + name.replace(SrcColToken, aux_name); if(name.size() > BaseObject::ObjectNameMaxLength) name.remove(BaseObject::ObjectNameMaxLength, name.size()); @@ -320,8 +320,8 @@ void Relationship::createSpecialPrimaryKey(void) 2) Use the same tablespace as the receiver table */ pk_special=new Constraint; - pk_special->setName(generateObjectName(PK_PATTERN)); - pk_special->setAlias(generateObjectName(PK_PATTERN, nullptr, true)); + pk_special->setName(generateObjectName(PkPattern)); + pk_special->setAlias(generateObjectName(PkPattern, nullptr, true)); pk_special->setConstraintType(ConstraintType::primary_key); pk_special->setAddedByLinking(true); pk_special->setProtected(true); @@ -1290,8 +1290,8 @@ void Relationship::configureIndentifierRel(Table *recv_tab) pk=this->pk_relident; new_pk=true; - pk->setName(generateObjectName(PK_PATTERN)); - pk->setAlias(generateObjectName(PK_PATTERN, nullptr, true)); + pk->setName(generateObjectName(PkPattern)); + pk->setAlias(generateObjectName(PkPattern, nullptr, true)); } //Adds the columns from the strong entity primary key on the weak entity primary key @@ -1352,8 +1352,8 @@ void Relationship::addUniqueKey(Table *recv_tab) while(i < count) uq->addColumn(gen_columns[i++], Constraint::SourceCols); - uq->setName(generateObjectName(UQ_PATTERN)); - uq->setAlias(generateObjectName(UQ_PATTERN, nullptr, true)); + uq->setName(generateObjectName(UqPattern)); + uq->setAlias(generateObjectName(UqPattern, nullptr, true)); uq->setName(PgModelerNs::generateUniqueName(uq, (*recv_tab->getObjectList(ObjConstraint)))); recv_tab->addConstraint(uq); } @@ -1463,20 +1463,20 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del if(rel_type!=RelationshipNn) { - name=generateObjectName(SRC_FK_PATTERN); - fk_alias=generateObjectName(SRC_FK_PATTERN, nullptr, true); + name=generateObjectName(SrcFkPattern); + fk_alias=generateObjectName(SrcFkPattern, nullptr, true); } else { if(ref_tab==src_table) { - name=generateObjectName(SRC_FK_PATTERN); - fk_alias=generateObjectName(SRC_FK_PATTERN, nullptr, true); + name=generateObjectName(SrcFkPattern); + fk_alias=generateObjectName(SrcFkPattern, nullptr, true); } else { - name=generateObjectName(DST_FK_PATTERN); - fk_alias=generateObjectName(DST_FK_PATTERN, nullptr, true); + name=generateObjectName(DstFkPattern); + fk_alias=generateObjectName(DstFkPattern, nullptr, true); } } @@ -1580,20 +1580,20 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b if(rel_type!=RelationshipNn) { - name=generateObjectName(SRC_COL_PATTERN, column_aux); - col_alias=generateObjectName(SRC_COL_PATTERN, column_aux, true); + name=generateObjectName(SrcColPattern, column_aux); + col_alias=generateObjectName(SrcColPattern, column_aux, true); } else { if(ref_tab==src_table && (!isSelfRelationship() || (isSelfRelationship() && !is_dst_table))) { - name=generateObjectName(SRC_COL_PATTERN, column_aux); - col_alias=generateObjectName(SRC_COL_PATTERN, column_aux, true); + name=generateObjectName(SrcColPattern, column_aux); + col_alias=generateObjectName(SrcColPattern, column_aux, true); } else { - name=generateObjectName(DST_COL_PATTERN, column_aux); - col_alias=generateObjectName(DST_COL_PATTERN, column_aux, true); + name=generateObjectName(DstColPattern, column_aux); + col_alias=generateObjectName(DstColPattern, column_aux, true); } } @@ -1841,8 +1841,8 @@ void Relationship::addColumnsRelNn(void) if(single_pk_column) { pk_col=new Column; - pk_col->setName(generateObjectName(PK_COL_PATTERN)); - pk_col->setAlias(generateObjectName(PK_COL_PATTERN, nullptr, true)); + pk_col->setName(generateObjectName(PkColPattern)); + pk_col->setAlias(generateObjectName(PkColPattern, nullptr, true)); pk_col->setType(PgSQLType(QString("serial"))); pk_col->setAddedByLinking(true); table_relnn->addColumn(pk_col); @@ -1850,8 +1850,8 @@ void Relationship::addColumnsRelNn(void) //Creates the primary key for the n-n relationship table pk_tabnn=new Constraint; - pk_tabnn->setName(generateObjectName(PK_PATTERN)); - pk_tabnn->setAlias(generateObjectName(PK_PATTERN, nullptr, true)); + pk_tabnn->setName(generateObjectName(PkPattern)); + pk_tabnn->setAlias(generateObjectName(PkPattern, nullptr, true)); pk_tabnn->setConstraintType(ConstraintType::primary_key); pk_tabnn->setAddedByLinking(true); @@ -2403,7 +2403,7 @@ bool Relationship::isInvalidated(void) 3) Check if the column (address) from the vector pk_columns is equal to the column obtained directly from the primary key */ - col_name=generateObjectName(SRC_COL_PATTERN, rel_pk_col); + col_name=generateObjectName(SrcColPattern, rel_pk_col); valid=(rel_pk_col==pk_col && (gen_col->getName()==col_name ||gen_col->getName().contains(pk_col->getName())) && (rel_pk_col->getType()==gen_col->getType() || @@ -2527,7 +2527,7 @@ bool Relationship::isInvalidated(void) { gen_col=fk->getColumn(i, Constraint::SourceCols); pk_col=pk->getColumn(i, Constraint::SourceCols); - valid=(gen_col->getName()==generateObjectName(SRC_COL_PATTERN, pk_col) || + valid=(gen_col->getName()==generateObjectName(SrcColPattern, pk_col) || gen_col->getName().contains(pk_col->getName())); } @@ -2539,7 +2539,7 @@ bool Relationship::isInvalidated(void) { gen_col=fk1->getColumn(i, Constraint::SourceCols); pk_col=pk->getColumn(i, Constraint::SourceCols); - valid=(gen_col->getName()==generateObjectName(DST_COL_PATTERN, pk_col) || + valid=(gen_col->getName()==generateObjectName(DstColPattern, pk_col) || gen_col->getName().contains(pk_col->getName())); } } @@ -2618,13 +2618,13 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::RELATIONSHIP_DEP]=(rel_type==RelationshipDep ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::RELATIONSHIP_PART]=(rel_type==RelationshipPart ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::SRC_COL_PATTERN]=name_patterns[SRC_COL_PATTERN]; - attributes[ParsersAttributes::DST_COL_PATTERN]=name_patterns[DST_COL_PATTERN]; - attributes[ParsersAttributes::PK_PATTERN]=name_patterns[PK_PATTERN]; - attributes[ParsersAttributes::UQ_PATTERN]=name_patterns[UQ_PATTERN]; - attributes[ParsersAttributes::SRC_FK_PATTERN]=name_patterns[SRC_FK_PATTERN]; - attributes[ParsersAttributes::DST_FK_PATTERN]=name_patterns[DST_FK_PATTERN]; - attributes[ParsersAttributes::PK_COL_PATTERN]=name_patterns[PK_COL_PATTERN]; + attributes[ParsersAttributes::SRC_COL_PATTERN]=name_patterns[SrcColPattern]; + attributes[ParsersAttributes::DST_COL_PATTERN]=name_patterns[DstColPattern]; + attributes[ParsersAttributes::PK_PATTERN]=name_patterns[PkPattern]; + attributes[ParsersAttributes::UQ_PATTERN]=name_patterns[UqPattern]; + attributes[ParsersAttributes::SRC_FK_PATTERN]=name_patterns[SrcFkPattern]; + attributes[ParsersAttributes::DST_FK_PATTERN]=name_patterns[DstFkPattern]; + attributes[ParsersAttributes::PK_COL_PATTERN]=name_patterns[PkColPattern]; attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=part_bounding_expr; diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index cc93d07082..70030479f6 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -294,20 +294,20 @@ class Relationship: public BaseRelationship { public: //! \brief String used as the name suffix separator. Default '_' - static const QString SUFFIX_SEPARATOR, - SRC_TAB_TOKEN, //{st} - DST_TAB_TOKEN, //{dt} - GEN_TAB_TOKEN, //{gt} - SRC_COL_TOKEN; //{sc} + static const QString SuffixSeparator, + SrcTabToken, //{st} + DstTabToken, //{dt} + GenTabToken, //{gt} + SrcColToken; //{sc} //! \brief Patterns ids - static constexpr unsigned SRC_COL_PATTERN=0, - DST_COL_PATTERN=1, - PK_PATTERN=2, - UQ_PATTERN=3, - SRC_FK_PATTERN=4, - DST_FK_PATTERN=5, - PK_COL_PATTERN=6; + static constexpr unsigned SrcColPattern=0, + DstColPattern=1, + PkPattern=2, + UqPattern=3, + SrcFkPattern=4, + DstFkPattern=5, + PkColPattern=6; Relationship(Relationship *rel); diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index d93d44d5fe..95264bde0d 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -25,7 +25,7 @@ Role::Role(void) obj_type=ObjRole; object_id=Role::role_id++; - for(unsigned i=0; i <= OP_BYPASSRLS; i++) + for(unsigned i=0; i <= OpBypassRls; i++) options[i]=false; conn_limit=-1; @@ -49,7 +49,7 @@ Role::Role(void) void Role::setOption(unsigned op_type, bool value) { - if(op_type > OP_BYPASSRLS) + if(op_type > OpBypassRls) //Raises an error if the option type is invalid throw Exception(AsgValueInvalidRoleOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -73,20 +73,20 @@ void Role::addRole(unsigned role_type, Role *role) role_ref1, role_mem1, role_adm1; //Check if the role to be added already exists in one of the internal role list - role_ref=this->isRoleExists(REF_ROLE, role); - role_mem=this->isRoleExists(MEMBER_ROLE, role); - role_adm=this->isRoleExists(ADMIN_ROLE, role); + role_ref=this->isRoleExists(RefRole, role); + role_mem=this->isRoleExists(MemberRole, role); + role_adm=this->isRoleExists(AdminRole, role); /* Check if the role 'this' is referenced in one of the internal role list of the role to be added */ - role_ref1=role->isRoleExists(REF_ROLE, this); - role_mem1=role->isRoleExists(MEMBER_ROLE, this); - role_adm1=role->isRoleExists(ADMIN_ROLE, this); + role_ref1=role->isRoleExists(RefRole, this); + role_mem1=role->isRoleExists(MemberRole, this); + role_adm1=role->isRoleExists(AdminRole, this); //Raises an error if the role already exists in one of the internal list - if((role_type==REF_ROLE && role_ref) || - (role_type==MEMBER_ROLE && (role_mem || role_adm)) || - (role_type==ADMIN_ROLE && (role_adm || role_mem))) + if((role_type==RefRole && role_ref) || + (role_type==MemberRole && (role_mem || role_adm)) || + (role_type==AdminRole && (role_adm || role_mem))) throw Exception(Exception::getErrorMessage(InsDuplicatedRole) .arg(role->getName()) .arg(this->getName()), @@ -114,9 +114,9 @@ void Role::addRole(unsigned role_type, Role *role) 5) The role 'role' (from parameter) is already part of the 'ref_roles' list of role 'this' and the user try to add the object 'role' as an element of the 'member_roles' list of the role 'this' */ - else if((role_type==REF_ROLE && ((role_mem || role_adm) || role_ref1)) || - (role_type==MEMBER_ROLE && ((role_mem1 || role_adm1) || role_ref)) || - (role_type==ADMIN_ROLE && ((role_mem1 || role_adm1) || role_ref))) + else if((role_type==RefRole && ((role_mem || role_adm) || role_ref1)) || + (role_type==MemberRole && ((role_mem1 || role_adm1) || role_ref)) || + (role_type==AdminRole && ((role_mem1 || role_adm1) || role_ref))) throw Exception(Exception::getErrorMessage(AsgRoleReferenceRedundancy) .arg(this->getName()) .arg(role->getName()), @@ -125,9 +125,9 @@ void Role::addRole(unsigned role_type, Role *role) { switch(role_type) { - case MEMBER_ROLE: member_roles.push_back(role); break; - case ADMIN_ROLE: admin_roles.push_back(role); break; - case REF_ROLE: + case MemberRole: member_roles.push_back(role); break; + case AdminRole: admin_roles.push_back(role); break; + case RefRole: default: ref_roles.push_back(role); break; @@ -164,15 +164,15 @@ void Role::setRoleAttribute(unsigned role_type) switch(role_type) { - case MEMBER_ROLE: + case MemberRole: roles_vect=&member_roles; attrib=ParsersAttributes::MEMBER_ROLES; break; - case ADMIN_ROLE: + case AdminRole: roles_vect=&admin_roles; attrib=ParsersAttributes::ADMIN_ROLES; break; - case REF_ROLE: + case RefRole: default: roles_vect=&ref_roles; attrib=ParsersAttributes::REF_ROLES; @@ -196,9 +196,9 @@ void Role::removeRole(unsigned role_type, unsigned role_idx) switch(role_type) { - case REF_ROLE: list=&ref_roles; break; - case MEMBER_ROLE: list=&member_roles; break; - case ADMIN_ROLE: list=&admin_roles; break; + case RefRole: list=&ref_roles; break; + case MemberRole: list=&member_roles; break; + case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -219,9 +219,9 @@ void Role::removeRoles(unsigned role_type) switch(role_type) { - case REF_ROLE: list=&ref_roles; break; - case MEMBER_ROLE: list=&member_roles; break; - case ADMIN_ROLE: list=&admin_roles; break; + case RefRole: list=&ref_roles; break; + case MemberRole: list=&member_roles; break; + case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -240,9 +240,9 @@ bool Role::isRoleExists(unsigned role_type, Role *role) switch(role_type) { - case REF_ROLE: list=&ref_roles; break; - case MEMBER_ROLE: list=&member_roles; break; - case ADMIN_ROLE: list=&admin_roles; break; + case RefRole: list=&ref_roles; break; + case MemberRole: list=&member_roles; break; + case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -262,7 +262,7 @@ bool Role::isRoleExists(unsigned role_type, Role *role) bool Role::getOption(unsigned op_type) { - if(op_type > OP_BYPASSRLS) + if(op_type > OpBypassRls) throw Exception(AsgValueInvalidRoleOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(options[op_type]); @@ -274,9 +274,9 @@ Role *Role::getRole(unsigned role_type, unsigned role_idx) switch(role_type) { - case REF_ROLE: list=&ref_roles; break; - case MEMBER_ROLE: list=&member_roles; break; - case ADMIN_ROLE: list=&admin_roles; break; + case RefRole: list=&ref_roles; break; + case MemberRole: list=&member_roles; break; + case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -296,9 +296,9 @@ unsigned Role::getRoleCount(unsigned role_type) switch(role_type) { - case REF_ROLE: list=&ref_roles; break; - case MEMBER_ROLE: list=&member_roles; break; - case ADMIN_ROLE: list=&admin_roles; break; + case RefRole: list=&ref_roles; break; + case MemberRole: list=&member_roles; break; + case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -334,11 +334,11 @@ QString Role::getCodeDefinition(unsigned def_type) ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, ParsersAttributes::REPLICATION, ParsersAttributes::BYPASSRLS }; - setRoleAttribute(REF_ROLE); - setRoleAttribute(MEMBER_ROLE); - setRoleAttribute(ADMIN_ROLE); + setRoleAttribute(RefRole); + setRoleAttribute(MemberRole); + setRoleAttribute(AdminRole); - for(i=0; i <= OP_BYPASSRLS; i++) + for(i=0; i <= OpBypassRls; i++) attributes[op_attribs[i]]=(options[i] ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::PASSWORD]=password; @@ -373,9 +373,9 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) if(this->validity!=role->validity) attribs[ParsersAttributes::VALIDITY]=role->validity; - for(unsigned i=0; i <= OP_BYPASSRLS; i++) + for(unsigned i=0; i <= OpBypassRls; i++) { - if((attribs.count(ParsersAttributes::PASSWORD) && i==OP_ENCRYPTED) || + if((attribs.count(ParsersAttributes::PASSWORD) && i==OpEncrypted) || this->options[i]!=role->options[i]) attribs[op_attribs[i]]=(role->options[i] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); } diff --git a/libpgmodeler/src/role.h b/libpgmodeler/src/role.h index b456916b52..f15d8f70db 100644 --- a/libpgmodeler/src/role.h +++ b/libpgmodeler/src/role.h @@ -59,19 +59,19 @@ class Role: public BaseObject { public: //! \brief Constants used to reference the available options for the role - static constexpr unsigned OP_SUPERUSER=0, - OP_CREATEDB=1, - OP_CREATEROLE=2, - OP_INHERIT=3, - OP_LOGIN=4, - OP_ENCRYPTED=5, - OP_REPLICATION=6, - OP_BYPASSRLS=7; + static constexpr unsigned OpSuperuser=0, + OpCreateDb=1, + OpCreateRole=2, + OpInherit=3, + OpLogin=4, + OpEncrypted=5, + OpReplication=6, + OpBypassRls=7; //! \brief Constants used to reference the internal role lists of the class - static constexpr unsigned REF_ROLE=10, - MEMBER_ROLE=20, - ADMIN_ROLE=30; + static constexpr unsigned RefRole=10, + MemberRole=20, + AdminRole=30; Role(void); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index df1652dd50..97b2a90ef3 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -18,12 +18,12 @@ #include "sequence.h" -const QString Sequence::MAX_POSITIVE_VALUE=QString("+2147483647"); -const QString Sequence::MAX_NEGATIVE_VALUE=QString("-2147483648"); -const QString Sequence::MAX_SMALL_POSITIVE_VALUE=QString("+32767"); -const QString Sequence::MAX_SMALL_NEGATIVE_VALUE=QString("-32768"); -const QString Sequence::MAX_BIG_POSITIVE_VALUE=QString("+9223372036854775807"); -const QString Sequence::MAX_BIG_NEGATIVE_VALUE=QString("-9223372036854775808"); +const QString Sequence::MaxPositiveValue=QString("+2147483647"); +const QString Sequence::MaxNegativeValue=QString("-2147483648"); +const QString Sequence::MaxSmallPositiveValue=QString("+32767"); +const QString Sequence::MaxSmallNegativeValue=QString("-32768"); +const QString Sequence::MaxBigPositiveValue=QString("+9223372036854775807"); +const QString Sequence::MaxBigNegativeValue=QString("-9223372036854775808"); Sequence::Sequence(void) { @@ -72,7 +72,7 @@ bool Sequence::isValidValue(const QString &value) /* To be valid the value can be start with + or -, have only numbers and it's length must not exceed the MAX_POSITIVE_VALUE length */ - if(value.size() > MAX_BIG_POSITIVE_VALUE.size()) + if(value.size() > MaxBigPositiveValue.size()) return(false); else { @@ -185,19 +185,19 @@ void Sequence::setDefaultValues(PgSQLType serial_type) if(serial_type==QString("smallserial") || serial_type.isEquivalentTo(QString("smallint"))) { - min=MAX_SMALL_NEGATIVE_VALUE; - max=MAX_SMALL_POSITIVE_VALUE; + min=MaxSmallNegativeValue; + max=MaxSmallPositiveValue; } else if(serial_type==QString("bigserial") || serial_type.isEquivalentTo(QString("bigint"))) { - min=MAX_BIG_NEGATIVE_VALUE; - max=MAX_BIG_POSITIVE_VALUE; + min=MaxBigNegativeValue; + max=MaxBigPositiveValue; } else { - min=MAX_NEGATIVE_VALUE; - max=MAX_POSITIVE_VALUE; + min=MaxNegativeValue; + max=MaxPositiveValue; } setValues(min, max, QString("1"), QString("1"), QString("1")); diff --git a/libpgmodeler/src/sequence.h b/libpgmodeler/src/sequence.h index a95dd699ff..a341a37811 100644 --- a/libpgmodeler/src/sequence.h +++ b/libpgmodeler/src/sequence.h @@ -67,14 +67,14 @@ class Sequence: public BaseObject { public: //! \brief Constants that indicates the maximum and minimum values accepted by sequence static const QString //For serial sequences - MAX_POSITIVE_VALUE, - MAX_NEGATIVE_VALUE, + MaxPositiveValue, + MaxNegativeValue, //For smallserial sequences - MAX_SMALL_POSITIVE_VALUE, - MAX_SMALL_NEGATIVE_VALUE, + MaxSmallPositiveValue, + MaxSmallNegativeValue, //For bigserial sequences - MAX_BIG_POSITIVE_VALUE, - MAX_BIG_NEGATIVE_VALUE; + MaxBigPositiveValue, + MaxBigNegativeValue; Sequence(void); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 69acaac961..a488ade08f 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -19,8 +19,8 @@ #include "table.h" #include "pgmodelerns.h" -const QString Table::DATA_SEPARATOR = QString("•"); -const QString Table::DATA_LINE_BREAK = QString("%1%2").arg("⸣").arg('\n'); +const QString Table::DataSeparator = QString("•"); +const QString Table::DataLineBreak = QString("%1%2").arg("⸣").arg('\n'); Table::Table(void) : BaseTable() { @@ -1939,7 +1939,7 @@ QString Table::getInitialData(void) QString Table::getInitialDataCommands(void) { - QStringList buffer=initial_data.split(DATA_LINE_BREAK); + QStringList buffer=initial_data.split(DataLineBreak); if(!buffer.isEmpty() && !buffer.at(0).isEmpty()) { @@ -1947,7 +1947,7 @@ QString Table::getInitialDataCommands(void) int curr_col=0; QList ignored_cols; - col_names=(buffer.at(0)).split(DATA_SEPARATOR); + col_names=(buffer.at(0)).split(DataSeparator); col_names.removeDuplicates(); buffer.removeFirst(); @@ -1967,7 +1967,7 @@ QString Table::getInitialDataCommands(void) curr_col=0; //Filtering the invalid columns' values - for(QString value : buf_row.split(DATA_SEPARATOR)) + for(QString value : buf_row.split(DataSeparator)) { if(ignored_cols.contains(curr_col)) continue; @@ -2002,7 +2002,7 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi value=QString("DEFAULT"); } //Unescaped values will not be enclosed in quotes - else if(value.startsWith(PgModelerNs::UNESC_VALUE_START) && value.endsWith(PgModelerNs::UNESC_VALUE_END)) + else if(value.startsWith(PgModelerNs::UnescValueStart) && value.endsWith(PgModelerNs::UnescValueEnd)) { value.remove(0,1); value.remove(value.length()-1, 1); @@ -2010,8 +2010,8 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi //Quoting value else { - value.replace(QString("\\") + PgModelerNs::UNESC_VALUE_START, PgModelerNs::UNESC_VALUE_START); - value.replace(QString("\\") + PgModelerNs::UNESC_VALUE_END, PgModelerNs::UNESC_VALUE_END); + value.replace(QString("\\") + PgModelerNs::UnescValueStart, PgModelerNs::UnescValueStart); + value.replace(QString("\\") + PgModelerNs::UnescValueEnd, PgModelerNs::UnescValueEnd); value.replace(QString("\'"), QString("''")); value.replace(QChar(QChar::LineFeed), QString("\\n")); value=QString("E'") + value + QString("'"); diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 2295c45e73..650183d93b 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -140,10 +140,10 @@ class Table: public BaseTable { public: //! \brief Default char for data separator in initial-data tag - static const QString DATA_SEPARATOR, + static const QString DataSeparator, //! \brief Default char for data line break in initial-data tag - DATA_LINE_BREAK; + DataLineBreak; Table(void); ~Table(void); diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 7d877d74fd..1f4d327424 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -73,7 +73,7 @@ void Tag::setElementColors(const QString &elem_id, const QString &colors) try { QStringList color_lst=colors.split(','); - unsigned color_id=FILL_COLOR1; + unsigned color_id=FillColor1; for(auto &color : color_lst) { @@ -108,7 +108,7 @@ void Tag::validateElementId(const QString &id, unsigned color_id) if(color_config.count(id) == 0) throw Exception(Exception::getErrorMessage(OprInvalidElementId).arg(id), OprInvalidElementId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if((color_id > COLOR_COUNT) || + else if((color_id > ColorCount) || (color_id > 0 && (id==ParsersAttributes::TABLE_NAME || id==ParsersAttributes::TABLE_SCHEMA_NAME))) throw Exception(Exception::getErrorMessage(RefInvalidElementColorId).arg(id).arg(color_id), @@ -123,8 +123,8 @@ QLinearGradient Tag::getFillStyle(const QString &elem_id) QLinearGradient grad(QPointF(0,0),QPointF(0,1)); grad.setCoordinateMode(QGradient::ObjectBoundingMode); - grad.setColorAt(0, color_config[elem_id][FILL_COLOR1]); - grad.setColorAt(1, color_config[elem_id][FILL_COLOR2]); + grad.setColorAt(0, color_config[elem_id][FillColor1]); + grad.setColorAt(1, color_config[elem_id][FillColor2]); return(grad); } @@ -158,10 +158,10 @@ QString Tag::getCodeDefinition(unsigned def_type, bool reduced_form) attribs[ParsersAttributes::COLORS]=QString(); if(itr.first==ParsersAttributes::TABLE_NAME || itr.first==ParsersAttributes::TABLE_SCHEMA_NAME) - attribs[ParsersAttributes::COLORS]=itr.second[FILL_COLOR1].name(); + attribs[ParsersAttributes::COLORS]=itr.second[FillColor1].name(); else - attribs[ParsersAttributes::COLORS]=itr.second[FILL_COLOR1].name() + QString(",") + - itr.second[FILL_COLOR2].name() + QString(",") + itr.second[BORDER_COLOR].name(); + attribs[ParsersAttributes::COLORS]=itr.second[FillColor1].name() + QString(",") + + itr.second[FillColor2].name() + QString(",") + itr.second[BorderColor].name(); attributes[ParsersAttributes::STYLES]+=schparser.getCodeDefinition(ParsersAttributes::STYLE, attribs, SchemaParser::XmlDefinition); } diff --git a/libpgmodeler/src/tag.h b/libpgmodeler/src/tag.h index 0bd69fb147..15559eb6af 100644 --- a/libpgmodeler/src/tag.h +++ b/libpgmodeler/src/tag.h @@ -43,10 +43,10 @@ class Tag: public BaseObject { void validateElementId(const QString &elem_id, unsigned color_id); public: - static constexpr unsigned FILL_COLOR1=0, - FILL_COLOR2=1, - BORDER_COLOR=2, - COLOR_COUNT=3; + static constexpr unsigned FillColor1=0, + FillColor2=1, + BorderColor=2, + ColorCount=3; Tag(void); diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index c7f8ef2a57..3ea3982db9 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -42,13 +42,13 @@ QString Textbox::getCodeDefinition(unsigned def_type) setPositionAttribute(); setFadedOutAttribute(); - if(text_attributes[ITALIC_TXT]) + if(text_attributes[ItalicText]) attributes[ParsersAttributes::ITALIC]=ParsersAttributes::_TRUE_; - if(text_attributes[BOLD_TXT]) + if(text_attributes[BoldText]) attributes[ParsersAttributes::BOLD]=ParsersAttributes::_TRUE_; - if(text_attributes[UNDERLINE_TXT]) + if(text_attributes[UnderlineText]) attributes[ParsersAttributes::UNDERLINE]=ParsersAttributes::_TRUE_; if(text_color.name()!=QString("#000000")) @@ -73,7 +73,7 @@ void Textbox::operator = (Textbox &txtbox) void Textbox::setTextAttribute(unsigned attrib, bool value) { - if(attrib > UNDERLINE_TXT) + if(attrib > UnderlineText) throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); text_attributes[attrib]=value; @@ -91,7 +91,7 @@ QColor Textbox::getTextColor(void) bool Textbox::getTextAttribute(unsigned attrib) { - if(attrib > UNDERLINE_TXT) + if(attrib > UnderlineText) throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(text_attributes[attrib]); diff --git a/libpgmodeler/src/textbox.h b/libpgmodeler/src/textbox.h index c1fdd14f2e..18319e1ce8 100644 --- a/libpgmodeler/src/textbox.h +++ b/libpgmodeler/src/textbox.h @@ -42,9 +42,9 @@ class Textbox: public BaseGraphicObject{ public: //! \brief Constants used to configure the text attributes - static constexpr unsigned ITALIC_TXT=0, - BOLD_TXT=1, - UNDERLINE_TXT=2; + static constexpr unsigned ItalicText=0, + BoldText=1, + UnderlineText=2; /*! \brief To define the content of the textboxes the method setComment() must be used and the getComment() diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 982df40aa9..8f9e8502a2 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -291,7 +291,7 @@ void Trigger::setConstraint(bool value) void Trigger::setTransitionTableName(unsigned tab_idx, const QString &name) { - if(tab_idx > NEW_TABLE_NAME) + if(tab_idx > NewTableName) throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(transition_tabs_names[tab_idx] != name); @@ -300,7 +300,7 @@ void Trigger::setTransitionTableName(unsigned tab_idx, const QString &name) QString Trigger::getTransitionTableName(unsigned tab_idx) { - if(tab_idx > NEW_TABLE_NAME) + if(tab_idx > NewTableName) throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(transition_tabs_names[tab_idx]); @@ -424,13 +424,13 @@ QString Trigger::getCodeDefinition(unsigned def_type) if(def_type == SchemaParser::XmlDefinition) { - attributes[ParsersAttributes::OLD_TABLE_NAME]=transition_tabs_names[OLD_TABLE_NAME]; - attributes[ParsersAttributes::NEW_TABLE_NAME]=transition_tabs_names[NEW_TABLE_NAME]; + attributes[ParsersAttributes::OLD_TABLE_NAME]=transition_tabs_names[OldTableName]; + attributes[ParsersAttributes::NEW_TABLE_NAME]=transition_tabs_names[NewTableName]; } else { - attributes[ParsersAttributes::OLD_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[OLD_TABLE_NAME]); - attributes[ParsersAttributes::NEW_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[NEW_TABLE_NAME]); + attributes[ParsersAttributes::OLD_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[OldTableName]); + attributes[ParsersAttributes::NEW_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[NewTableName]); } return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/trigger.h b/libpgmodeler/src/trigger.h index 4a0fdd05ec..3e5eb93424 100644 --- a/libpgmodeler/src/trigger.h +++ b/libpgmodeler/src/trigger.h @@ -76,7 +76,7 @@ class Trigger: public TableObject{ void setArgumentAttribute(unsigned tipo_def); public: - static constexpr unsigned OLD_TABLE_NAME=0, NEW_TABLE_NAME=1; + static constexpr unsigned OldTableName=0, NewTableName=1; Trigger(void); diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index cd547a7aa6..7194c08e67 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -21,7 +21,7 @@ Type::Type(void) { obj_type=ObjType; - setConfiguration(ENUMERATION_TYPE); + setConfiguration(EnumerationType); attributes[ParsersAttributes::BASE_TYPE]=QString(); attributes[ParsersAttributes::COMPOSITE_TYPE]=QString(); @@ -182,7 +182,7 @@ void Type::removeEnumerations(void) void Type::setConfiguration(unsigned conf) { //Raises an error if the configuration type is invalid - if(conf < BASE_TYPE || conf > RANGE_TYPE) + if(conf < BaseType || conf > RangeType) throw Exception(AsgInvalidTypeConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_attribs.clear(); @@ -223,12 +223,12 @@ void Type::setFunction(unsigned func_id, Function *func) /* Raises an error if the user try to reference a function id which is incompatible according to the type's configuraiton */ - if((config==BASE_TYPE && func_id >= CANONICAL_FUNC) || - (config==RANGE_TYPE && func_id <= ANALYZE_FUNC)) + if((config==BaseType && func_id >= CanonicalFunc) || + (config==RangeType && func_id <= AnalyzeFunc)) throw Exception(RefInvalidFunctionIdTypeConfig,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the function isn't defined and the function id is INPUT or OUTPUT, because this function is mandatory for base types */ - else if(!func && (func_id==INPUT_FUNC || func_id==OUTPUT_FUNC)) + else if(!func && (func_id==InputFunc || func_id==OutputFunc)) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjType)), @@ -238,7 +238,7 @@ void Type::setFunction(unsigned func_id, Function *func) { /* Raises an error if the function language is not C. Functions assigned to base type must be written in C */ - if((func_id!=CANONICAL_FUNC && func_id!=SUBTYPE_DIFF_FUNC) && + if((func_id!=CanonicalFunc && func_id!=SubtypeDiffFunc) && func->getLanguage()->getName()!=~LanguageType(LanguageType::c) && func->getLanguage()->getName()!=~LanguageType(LanguageType::internal)) throw Exception(AsgFunctionInvalidLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -246,12 +246,12 @@ void Type::setFunction(unsigned func_id, Function *func) /* Raises an error if the parameter count for INPUT and RECV functions is different from 1 or 3. */ else if((param_count!=1 && param_count!=3 && - (func_id==INPUT_FUNC || func_id==RECV_FUNC)) || - (param_count!=2 && func_id==SUBTYPE_DIFF_FUNC) || + (func_id==InputFunc || func_id==RecvFunc)) || + (param_count!=2 && func_id==SubtypeDiffFunc) || (param_count!=1 && - (func_id==OUTPUT_FUNC || func_id==SEND_FUNC || - func_id==TPMOD_IN_FUNC || func_id==TPMOD_OUT_FUNC || - func_id==ANALYZE_FUNC || func_id==CANONICAL_FUNC))) + (func_id==OutputFunc || func_id==SendFunc || + func_id==TpmodInFunc || func_id==TpmodOutFunc || + func_id==AnalyzeFunc || func_id==CanonicalFunc))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjType)), @@ -263,15 +263,15 @@ void Type::setFunction(unsigned func_id, Function *func) OUTPUT and TPMOD_OUT should return cstring. The other functions SEND, TPMOD_IN and ANALYZE should return bytea, integer and boolean, respectively. Raises an error if some of conditions above is not satisfied. */ - else if((func_id==INPUT_FUNC && func->getReturnType()!=QString("\"any\"")) || - (func_id==OUTPUT_FUNC && func->getReturnType()!=QString("cstring")) || - (func_id==RECV_FUNC && func->getReturnType()!=QString("\"any\"")) || - (func_id==SEND_FUNC && func->getReturnType()!=QString("bytea")) || - (func_id==TPMOD_IN_FUNC && func->getReturnType()!=QString("integer")) || - (func_id==TPMOD_OUT_FUNC && func->getReturnType()!=QString("cstring")) || - (func_id==ANALYZE_FUNC && func->getReturnType()!=QString("boolean")) || - (func_id==CANONICAL_FUNC && func->getReturnType()!=QString("\"any\"")) || - (func_id==SUBTYPE_DIFF_FUNC && func->getReturnType()!=QString("double precision"))) + else if((func_id==InputFunc && func->getReturnType()!=QString("\"any\"")) || + (func_id==OutputFunc && func->getReturnType()!=QString("cstring")) || + (func_id==RecvFunc && func->getReturnType()!=QString("\"any\"")) || + (func_id==SendFunc && func->getReturnType()!=QString("bytea")) || + (func_id==TpmodInFunc && func->getReturnType()!=QString("integer")) || + (func_id==TpmodOutFunc && func->getReturnType()!=QString("cstring")) || + (func_id==AnalyzeFunc && func->getReturnType()!=QString("boolean")) || + (func_id==CanonicalFunc && func->getReturnType()!=QString("\"any\"")) || + (func_id==SubtypeDiffFunc && func->getReturnType()!=QString("double precision"))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjType)), @@ -286,21 +286,21 @@ void Type::setFunction(unsigned func_id, Function *func) TPMOD_OUT function must have a parameter of type (integer). The ANALYZE function must have a parameter of type (internal). Raises an error if some of above conditions is not satisfied.*/ - else if((func_id==INPUT_FUNC && + else if((func_id==InputFunc && (func->getParameter(0).getType()!=QString("cstring") || (param_count==3 && (func->getParameter(1).getType()!=QString("oid") || func->getParameter(2).getType()!=QString("integer"))))) || - (func_id==RECV_FUNC && + (func_id==RecvFunc && (func->getParameter(0).getType()!=QString("internal") || (param_count==3 && (func->getParameter(1).getType()!=QString("oid") || func->getParameter(2).getType()!=QString("integer"))))) || - ((func_id==SEND_FUNC || func_id==CANONICAL_FUNC || func_id==OUTPUT_FUNC) && func->getParameter(0).getType()!=QString("\"any\"")) || - (func_id==TPMOD_IN_FUNC && *(func->getParameter(0).getType())!=QString("cstring[]")) || - (func_id==TPMOD_OUT_FUNC && func->getParameter(0).getType()!=QString("integer")) || - (func_id==ANALYZE_FUNC && func->getParameter(0).getType()!=QString("internal")) || - (func_id==SUBTYPE_DIFF_FUNC && + ((func_id==SendFunc || func_id==CanonicalFunc || func_id==OutputFunc) && func->getParameter(0).getType()!=QString("\"any\"")) || + (func_id==TpmodInFunc && *(func->getParameter(0).getType())!=QString("cstring[]")) || + (func_id==TpmodOutFunc && func->getParameter(0).getType()!=QString("integer")) || + (func_id==AnalyzeFunc && func->getParameter(0).getType()!=QString("internal")) || + (func_id==SubtypeDiffFunc && (func->getParameter(0).getType()!=this->subtype || func->getParameter(1).getType()!=this->subtype))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) @@ -317,8 +317,8 @@ void Type::setFunction(unsigned func_id, Function *func) void Type::convertFunctionParameters(bool inverse_conv) { - unsigned i, conf_funcs[]={ INPUT_FUNC, RECV_FUNC, - OUTPUT_FUNC, SEND_FUNC }; + unsigned i, conf_funcs[]={ InputFunc, RecvFunc, + OutputFunc, SendFunc }; Parameter param; Function *func=nullptr; @@ -328,7 +328,7 @@ void Type::convertFunctionParameters(bool inverse_conv) if(func) { - if(conf_funcs[i]==OUTPUT_FUNC || conf_funcs[i]==SEND_FUNC) + if(conf_funcs[i]==OutputFunc || conf_funcs[i]==SendFunc) { param=func->getParameter(0); func->removeParameter(0); @@ -344,7 +344,7 @@ void Type::convertFunctionParameters(bool inverse_conv) func->addParameter(param); } } - else if(conf_funcs[i]==INPUT_FUNC || conf_funcs[i]==RECV_FUNC) + else if(conf_funcs[i]==InputFunc || conf_funcs[i]==RecvFunc) { if(!inverse_conv) func->setReturnType(PgSQLType(this)); @@ -615,17 +615,17 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) QString code_def=getCachedCode(def_type, reduced_form); if(!code_def.isEmpty()) return(code_def); - if(config==ENUMERATION_TYPE) + if(config==EnumerationType) { attributes[ParsersAttributes::ENUM_TYPE]=ParsersAttributes::_TRUE_; setEnumerationsAttribute(def_type); } - else if(config==COMPOSITE_TYPE) + else if(config==CompositeType) { attributes[ParsersAttributes::COMPOSITE_TYPE]=ParsersAttributes::_TRUE_; setElementsAttribute(def_type); } - else if(config==RANGE_TYPE) + else if(config==RangeType) { attributes[ParsersAttributes::RANGE_TYPE]=ParsersAttributes::_TRUE_; @@ -676,7 +676,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) } } - if(config==BASE_TYPE || config==RANGE_TYPE) + if(config==BaseType || config==RangeType) { unsigned i; QString func_attrib[]={ParsersAttributes::INPUT_FUNC, @@ -724,7 +724,7 @@ QString Type::getAlterDefinition(BaseObject *object) if(this->config==type->config) { - if(config==ENUMERATION_TYPE) + if(config==EnumerationType) { for(QString enum_val : type->enumerations) { @@ -747,7 +747,7 @@ QString Type::getAlterDefinition(BaseObject *object) prev_val=enum_val; } } - else if(config==COMPOSITE_TYPE) + else if(config==CompositeType) { //Removing type attributes for(TypeAttribute attrib : this->type_attribs) diff --git a/libpgmodeler/src/type.h b/libpgmodeler/src/type.h index 98b9607dfe..b188a5afa7 100644 --- a/libpgmodeler/src/type.h +++ b/libpgmodeler/src/type.h @@ -106,20 +106,20 @@ class Type: public BaseObject { void convertFunctionParameters(bool inverse_conv=false); public: - static constexpr unsigned BASE_TYPE=10, - ENUMERATION_TYPE=11, - COMPOSITE_TYPE=12, - RANGE_TYPE=13; - - static constexpr unsigned INPUT_FUNC=0, - OUTPUT_FUNC=1, - RECV_FUNC=2, - SEND_FUNC=3, - TPMOD_IN_FUNC=4, - TPMOD_OUT_FUNC=5, - ANALYZE_FUNC=6, - CANONICAL_FUNC=7, - SUBTYPE_DIFF_FUNC=8; + static constexpr unsigned BaseType=10, + EnumerationType=11, + CompositeType=12, + RangeType=13; + + static constexpr unsigned InputFunc=0, + OutputFunc=1, + RecvFunc=2, + SendFunc=3, + TpmodInFunc=4, + TpmodOutFunc=5, + AnalyzeFunc=6, + CanonicalFunc=7, + SubtypeDiffFunc=8; Type(void); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 9e97296932..62500a5dcd 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -173,13 +173,13 @@ int View::getReferenceIndex(Reference &refer) vector *View::getExpressionList(unsigned sql_type) { - if(sql_type==Reference::SQL_REFER_SELECT) + if(sql_type==Reference::SqlReferSelect) return(&exp_select); - else if(sql_type==Reference::SQL_REFER_FROM) + else if(sql_type==Reference::SqlReferFrom) return(&exp_from); - else if(sql_type==Reference::SQL_REFER_WHERE) + else if(sql_type==Reference::SqlReferWhere) return(&exp_where); - else if(sql_type==Reference::SQL_REFER_END_EXPR) + else if(sql_type==Reference::SqlReferEndExpr) return(&exp_end); else return(nullptr); @@ -222,7 +222,7 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) Column *col=nullptr; //Specific tests for expressions used as view definition - if(sql_type==Reference::SQL_VIEW_DEFINITION) + if(sql_type==Reference::SqlViewDefinition) { //Raises an error if the expression is empty if(refer.getExpression().isEmpty()) @@ -245,12 +245,12 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) if(idx < 0) { //Inserts the reference on the view - refer.setDefinitionExpression(sql_type==Reference::SQL_VIEW_DEFINITION); + refer.setDefinitionExpression(sql_type==Reference::SqlViewDefinition); references.push_back(refer); idx=references.size()-1; } - if(sql_type!=Reference::SQL_VIEW_DEFINITION) + if(sql_type!=Reference::SqlViewDefinition) { //Gets the expression list expr_list=getExpressionList(sql_type); @@ -288,7 +288,7 @@ unsigned View::getReferenceCount(unsigned sql_type, int ref_type) if(!vect_idref) { - if(sql_type==Reference::SQL_VIEW_DEFINITION) + if(sql_type==Reference::SqlViewDefinition) return(references.size()); else return(0); @@ -333,7 +333,7 @@ Reference View::getReference(unsigned ref_id, unsigned sql_type) if(ref_id >= references.size()) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(sql_type==Reference::SQL_VIEW_DEFINITION || vect_idref) + if(sql_type==Reference::SqlViewDefinition || vect_idref) return(references[ref_id]); else return(references[vect_idref->at(ref_id)]); @@ -399,10 +399,10 @@ int View::getReferenceIndex(Reference &ref, unsigned sql_type) idx_ref=getReferenceIndex(ref); - if(sql_type==Reference::SQL_VIEW_DEFINITION && + if(sql_type==Reference::SqlViewDefinition && idx_ref >=0 && ref.isDefinitionExpression()) return(idx_ref); - else if(sql_type!=Reference::SQL_VIEW_DEFINITION) + else if(sql_type!=Reference::SqlViewDefinition) { itr=vet_idref->begin(); itr_end=vet_idref->end(); @@ -437,10 +437,10 @@ void View::setDefinitionAttribute(void) vector *refs_vect[4]={&exp_select, &exp_from, &exp_where, &exp_end}; vector::iterator itr, itr_end; QString keywords[4]={"SELECT\n", "\nFROM\n", "\nWHERE\n", "\n"}; - unsigned i, cnt, idx, sql_type[4]={ Reference::SQL_REFER_SELECT, - Reference::SQL_REFER_FROM, - Reference::SQL_REFER_WHERE, - Reference::SQL_REFER_END_EXPR }; + unsigned i, cnt, idx, sql_type[4]={ Reference::SqlReferSelect, + Reference::SqlReferFrom, + Reference::SqlReferWhere, + Reference::SqlReferEndExpr }; for(i=0; i < 4; i++) { @@ -457,8 +457,8 @@ void View::setDefinitionAttribute(void) itr++; } - if(sql_type[i]==Reference::SQL_REFER_SELECT || - sql_type[i]==Reference::SQL_REFER_FROM) + if(sql_type[i]==Reference::SqlReferSelect || + sql_type[i]==Reference::SqlReferFrom) { //Removing the final comma from SELECT / FROM declarations cnt=decl.size(); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index d55d4499ac..78d3b48b35 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -924,7 +924,7 @@ void BaseObjectWidget::cancelConfiguration(void) obj_type!=ObjView && obj_type!=ObjRelationship) { - if(!op_list->isObjectRegistered(this->object, Operation::OBJECT_CREATED)) + if(!op_list->isObjectRegistered(this->object, Operation::ObjectCreated)) delete(this->object); this->object=nullptr; @@ -952,15 +952,15 @@ void BaseObjectWidget::registerNewObject(void) { try { - if(this->new_object && op_list && !op_list->isObjectRegistered(this->object, Operation::OBJECT_CREATED)) + if(this->new_object && op_list && !op_list->isObjectRegistered(this->object, Operation::ObjectCreated)) { //If the object is a new one is necessary register it on the operation list if(this->table) - op_list->registerObject(this->object, Operation::OBJECT_CREATED, -1, this->table); + op_list->registerObject(this->object, Operation::ObjectCreated, -1, this->table); else if(this->relationship) - op_list->registerObject(this->object, Operation::OBJECT_CREATED, -1, this->relationship); + op_list->registerObject(this->object, Operation::ObjectCreated, -1, this->relationship); else - op_list->registerObject(this->object, Operation::OBJECT_CREATED); + op_list->registerObject(this->object, Operation::ObjectCreated); } } catch(Exception &e) diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index c79a68a290..df78a52117 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -209,9 +209,9 @@ void BaseObjectWidget::startConfiguration(void) this->object->getObjectType()!=ObjDatabase) { if(this->table) - op_list->registerObject(this->object, Operation::OBJECT_MODIFIED, -1, this->table); + op_list->registerObject(this->object, Operation::ObjectModified, -1, this->table); else - op_list->registerObject(this->object, Operation::OBJECT_MODIFIED, -1, this->relationship); + op_list->registerObject(this->object, Operation::ObjectModified, -1, this->relationship); new_object=false; } //! \brief If there is need to allocate the object diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 4264049143..38b1b16061 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1472,7 +1472,7 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) } if(!tab_list.isEmpty()) - orig_attribs[ParsersAttributes::REFERRERS] = tab_list.join(Table::DATA_SEPARATOR); + orig_attribs[ParsersAttributes::REFERRERS] = tab_list.join(Table::DataSeparator); } } else @@ -1626,7 +1626,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) !cached_attribs[ParsersAttributes::REFERRERS].isEmpty() && item->childCount() == 5) { QTreeWidgetItem *refs_item=nullptr, *tab_item=nullptr; - QStringList ref_tab_names = cached_attribs[ParsersAttributes::REFERRERS].split(Table::DATA_SEPARATOR); + QStringList ref_tab_names = cached_attribs[ParsersAttributes::REFERRERS].split(Table::DataSeparator); QFont font; refs_item=new QTreeWidgetItem(item); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 2fda04baca..e77c81fe0d 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -845,7 +845,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &col : catalog.getObjectsAttributes(ObjColumn, schema, table, col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); - fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DATA_SEPARATOR); + fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); col_ids.clear(); name_list.clear(); @@ -857,7 +857,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &col : catalog.getObjectsAttributes(ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); - fk_infos[fk_name][ParsersAttributes::DST_COLUMNS] = name_list.join(Table::DATA_SEPARATOR); + fk_infos[fk_name][ParsersAttributes::DST_COLUMNS] = name_list.join(Table::DataSeparator); } submenu = new QMenu(this); @@ -891,7 +891,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin .arg(fk[ParsersAttributes::NAME]), this, SLOT(browseReferrerTable())); action->setData(fk_name); - ref_fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DATA_SEPARATOR); + ref_fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); ref_fk_infos[fk_name][ParsersAttributes::TABLE] = aux_table[ParsersAttributes::NAME]; ref_fk_infos[fk_name][ParsersAttributes::SCHEMA] = aux_schema[ParsersAttributes::NAME]; } @@ -1147,14 +1147,14 @@ void DataManipulationForm::browseTable(const QString &fk_name, bool browse_ref_t if(browse_ref_tab) { src_cols = pk_col_names; - ref_cols = ref_fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS].split(Table::DATA_SEPARATOR); + ref_cols = ref_fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS].split(Table::DataSeparator); schema = ref_fk_infos[fk_name][ParsersAttributes::SCHEMA]; table = ref_fk_infos[fk_name][ParsersAttributes::TABLE]; } else { - src_cols = fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS].split(Table::DATA_SEPARATOR); - ref_cols = fk_infos[fk_name][ParsersAttributes::DST_COLUMNS].split(Table::DATA_SEPARATOR); + src_cols = fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS].split(Table::DataSeparator); + ref_cols = fk_infos[fk_name][ParsersAttributes::DST_COLUMNS].split(Table::DataSeparator); schema = fk_infos[fk_name][ParsersAttributes::SCHEMA]; table = fk_infos[fk_name][ParsersAttributes::REF_TABLE]; } @@ -1387,9 +1387,9 @@ QString DataManipulationForm::getDMLCommand(int row) if(op_type==OP_INSERT || (op_type==OP_UPDATE && value!=item->data(Qt::UserRole))) { //Checking if the value is a malformed unescaped value, e.g., {value, value}, {value\} - if((value.startsWith(PgModelerNs::UNESC_VALUE_START) && value.endsWith(QString("\\") + PgModelerNs::UNESC_VALUE_END)) || - (value.startsWith(PgModelerNs::UNESC_VALUE_START) && !value.endsWith(PgModelerNs::UNESC_VALUE_END)) || - (!value.startsWith(PgModelerNs::UNESC_VALUE_START) && !value.endsWith(QString("\\") + PgModelerNs::UNESC_VALUE_END) && value.endsWith(PgModelerNs::UNESC_VALUE_END))) + if((value.startsWith(PgModelerNs::UnescValueStart) && value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd)) || + (value.startsWith(PgModelerNs::UnescValueStart) && !value.endsWith(PgModelerNs::UnescValueEnd)) || + (!value.startsWith(PgModelerNs::UnescValueStart) && !value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd) && value.endsWith(PgModelerNs::UnescValueEnd))) throw Exception(Exception::getErrorMessage(MalformedUnescapedValue) .arg(row + 1).arg(col_name), MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1402,7 +1402,7 @@ QString DataManipulationForm::getDMLCommand(int row) value=QString("DEFAULT"); } //Unescaped values will not be enclosed in quotes - else if(value.startsWith(PgModelerNs::UNESC_VALUE_START) && value.endsWith(PgModelerNs::UNESC_VALUE_END)) + else if(value.startsWith(PgModelerNs::UnescValueStart) && value.endsWith(PgModelerNs::UnescValueEnd)) { value.remove(0,1); value.remove(value.length()-1, 1); @@ -1410,8 +1410,8 @@ QString DataManipulationForm::getDMLCommand(int row) //Quoting value else { - value.replace(QString("\\") + PgModelerNs::UNESC_VALUE_START, PgModelerNs::UNESC_VALUE_START); - value.replace(QString("\\") + PgModelerNs::UNESC_VALUE_END, PgModelerNs::UNESC_VALUE_END); + value.replace(QString("\\") + PgModelerNs::UnescValueStart, PgModelerNs::UnescValueStart); + value.replace(QString("\\") + PgModelerNs::UnescValueEnd, PgModelerNs::UnescValueEnd); value.replace("\'","''"); value=QString("E'") + value + QString("'"); } diff --git a/libpgmodeler_ui/src/elementstablewidget.cpp b/libpgmodeler_ui/src/elementstablewidget.cpp index aff21c3abb..14eae42b12 100644 --- a/libpgmodeler_ui/src/elementstablewidget.cpp +++ b/libpgmodeler_ui/src/elementstablewidget.cpp @@ -98,12 +98,12 @@ void ElementsTableWidget::showElementData(Element *elem, int elem_idx) if(elem->isSortingEnabled()) { - if(elem->getSortingAttribute(IndexElement::ASC_ORDER)) + if(elem->getSortingAttribute(IndexElement::AscOrder)) elements_tab->setCellText(trUtf8("Ascending"), elem_idx, 5); else elements_tab->setCellText(trUtf8("Descending"), elem_idx, 5); - if(elem->getSortingAttribute(IndexElement::NULLS_FIRST)) + if(elem->getSortingAttribute(IndexElement::NullsFirst)) elements_tab->setCellText(trUtf8("Yes"), elem_idx, 6); else elements_tab->setCellText(trUtf8("No"), elem_idx, 6); diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index 6ae3d31ca4..d8dfe85003 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -116,12 +116,12 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, elem_expr_txt->setPlainText(elem->getExpression()); } - if(elem->getSortingAttribute(IndexElement::ASC_ORDER)) + if(elem->getSortingAttribute(IndexElement::AscOrder)) ascending_rb->setChecked(true); else descending_rb->setChecked(true); - nulls_first_chk->setChecked(elem->getSortingAttribute(IndexElement::NULLS_FIRST)); + nulls_first_chk->setChecked(elem->getSortingAttribute(IndexElement::NullsFirst)); sorting_chk->setChecked(elem->isSortingEnabled()); op_class_sel->setSelectedObject(elem->getOperatorClass()); collation_sel->setSelectedObject(elem->getCollation()); @@ -195,8 +195,8 @@ Element *ElementWidget::getElement(void) void ElementWidget::applyConfiguration(void) { element->setSortingEnabled(sorting_chk->isChecked()); - element->setSortingAttribute(IndexElement::NULLS_FIRST, nulls_first_chk->isChecked()); - element->setSortingAttribute(IndexElement::ASC_ORDER, ascending_rb->isChecked()); + element->setSortingAttribute(IndexElement::NullsFirst, nulls_first_chk->isChecked()); + element->setSortingAttribute(IndexElement::AscOrder, ascending_rb->isChecked()); element->setOperatorClass(dynamic_cast(op_class_sel->getSelectedObject())); element->setCollation(dynamic_cast(collation_sel->getSelectedObject())); element->setOperator(dynamic_cast(operator_sel->getSelectedObject())); diff --git a/libpgmodeler_ui/src/extensionwidget.cpp b/libpgmodeler_ui/src/extensionwidget.cpp index 2b5f2d33f8..f35f3a823f 100644 --- a/libpgmodeler_ui/src/extensionwidget.cpp +++ b/libpgmodeler_ui/src/extensionwidget.cpp @@ -17,8 +17,8 @@ void ExtensionWidget::setAttributes(DatabaseModel *model, OperationList *op_list if(ext) { - cur_ver_edt->setText(ext->getVersion(Extension::CUR_VERSION)); - old_ver_edt->setText(ext->getVersion(Extension::OLD_VERSION)); + cur_ver_edt->setText(ext->getVersion(Extension::CurVersion)); + old_ver_edt->setText(ext->getVersion(Extension::OldVersion)); handles_type_chk->setEnabled(false); handles_type_chk->setChecked(ext->handlesType()); @@ -35,8 +35,8 @@ void ExtensionWidget::applyConfiguration(void) extension=dynamic_cast(this->object); BaseObjectWidget::applyConfiguration(); extension->setHandlesType(handles_type_chk->isChecked()); - extension->setVersion(Extension::CUR_VERSION, cur_ver_edt->text()); - extension->setVersion(Extension::OLD_VERSION, old_ver_edt->text()); + extension->setVersion(Extension::CurVersion, cur_ver_edt->text()); + extension->setVersion(Extension::OldVersion, old_ver_edt->text()); finishConfiguration(); } diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index bdff969296..688031a886 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -448,7 +448,7 @@ void FunctionWidget::validateConfiguredFunction(void) { lang=dynamic_cast(object); - for(i1=Language::VALIDATOR_FUNC; i1 <= Language::INLINE_FUNC; i1++) + for(i1=Language::ValidatorFunc; i1 <= Language::InlineFunc; i1++) { if(lang->getFunction(i1)==func) lang->setFunction(func, i1); @@ -466,9 +466,9 @@ void FunctionWidget::validateConfiguredFunction(void) else if(obj_type==ObjType) { type=dynamic_cast(object); - if(type->getConfiguration()==Type::BASE_TYPE) + if(type->getConfiguration()==Type::BaseType) { - for(i1=Type::INPUT_FUNC; i1 <=Type::ANALYZE_FUNC; i1++) + for(i1=Type::InputFunc; i1 <=Type::AnalyzeFunc; i1++) { if(type->getFunction(i1)==func) type->setFunction(i1, func); diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index 28aeff1443..3b93f132af 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -113,10 +113,10 @@ void IndexWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Ba else fill_factor_sb->setValue(90); - concurrent_chk->setChecked(index->getIndexAttribute(Index::CONCURRENT)); - fast_update_chk->setChecked(index->getIndexAttribute(Index::FAST_UPDATE)); - unique_chk->setChecked(index->getIndexAttribute(Index::UNIQUE)); - buffering_chk->setChecked(index->getIndexAttribute(Index::BUFFERING)); + concurrent_chk->setChecked(index->getIndexAttribute(Index::Concurrent)); + fast_update_chk->setChecked(index->getIndexAttribute(Index::FastUpdate)); + unique_chk->setChecked(index->getIndexAttribute(Index::Unique)); + buffering_chk->setChecked(index->getIndexAttribute(Index::Buffering)); predicate_txt->setPlainText(index->getPredicate()); selectIndexingType(); @@ -139,10 +139,10 @@ void IndexWidget::applyConfiguration(void) BaseObjectWidget::applyConfiguration(); - index->setIndexAttribute(Index::FAST_UPDATE, fast_update_chk->isChecked()); - index->setIndexAttribute(Index::CONCURRENT, concurrent_chk->isChecked()); - index->setIndexAttribute(Index::UNIQUE, unique_chk->isChecked()); - index->setIndexAttribute(Index::BUFFERING, buffering_chk->isChecked()); + index->setIndexAttribute(Index::FastUpdate, fast_update_chk->isChecked()); + index->setIndexAttribute(Index::Concurrent, concurrent_chk->isChecked()); + index->setIndexAttribute(Index::Unique, unique_chk->isChecked()); + index->setIndexAttribute(Index::Buffering, buffering_chk->isChecked()); index->setPredicate(predicate_txt->toPlainText().toUtf8()); index->setIndexingType(IndexingType(indexing_cmb->currentText())); diff --git a/libpgmodeler_ui/src/languagewidget.cpp b/libpgmodeler_ui/src/languagewidget.cpp index c872620aa4..22cfb7d515 100644 --- a/libpgmodeler_ui/src/languagewidget.cpp +++ b/libpgmodeler_ui/src/languagewidget.cpp @@ -66,9 +66,9 @@ void LanguageWidget::setAttributes(DatabaseModel *model, OperationList *op_list, if(language) { trusted_chk->setChecked(language->isTrusted()); - func_handler_sel->setSelectedObject(language->getFunction(Language::HANDLER_FUNC)); - func_validator_sel->setSelectedObject(language->getFunction(Language::VALIDATOR_FUNC)); - func_inline_sel->setSelectedObject(language->getFunction(Language::INLINE_FUNC)); + func_handler_sel->setSelectedObject(language->getFunction(Language::HandlerFunc)); + func_validator_sel->setSelectedObject(language->getFunction(Language::ValidatorFunc)); + func_inline_sel->setSelectedObject(language->getFunction(Language::InlineFunc)); } } @@ -83,9 +83,9 @@ void LanguageWidget::applyConfiguration(void) language=dynamic_cast(this->object); language->setTrusted(trusted_chk->isChecked()); - language->setFunction(dynamic_cast(func_handler_sel->getSelectedObject()), Language::HANDLER_FUNC); - language->setFunction(dynamic_cast(func_validator_sel->getSelectedObject()), Language::VALIDATOR_FUNC); - language->setFunction(dynamic_cast(func_inline_sel->getSelectedObject()), Language::INLINE_FUNC); + language->setFunction(dynamic_cast(func_handler_sel->getSelectedObject()), Language::HandlerFunc); + language->setFunction(dynamic_cast(func_validator_sel->getSelectedObject()), Language::ValidatorFunc); + language->setFunction(dynamic_cast(func_inline_sel->getSelectedObject()), Language::InlineFunc); BaseObjectWidget::applyConfiguration(); finishConfiguration(); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 88bef6c018..ff0f8cc4de 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -659,7 +659,7 @@ void ModelsDiffHelper::processDiffInfos(void) { type=dynamic_cast(diff.getObject()); - if(type && type->getConfiguration()==Type::BASE_TYPE) + if(type && type->getConfiguration()==Type::BaseType) { type->convertFunctionParameters(); types.push_back(type); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 73aa99a3e3..43dc7a43df 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -918,14 +918,14 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) //Register the object if it is not a schema or a table already registered if(!schema && std::find(reg_tables.begin(), reg_tables.end(), obj)==reg_tables.end()) - op_list->registerObject(obj, Operation::OBJECT_MOVED); + op_list->registerObject(obj, Operation::ObjectMoved); else if(schema) { //For schemas, when they are moved, the original position of tables are registered instead of the position of schema itself tables=dynamic_cast(schema->getReceiverObject())->getChildren(); for(auto &tab : tables) { - op_list->registerObject(tab->getSourceObject(), Operation::OBJECT_MOVED); + op_list->registerObject(tab->getSourceObject(), Operation::ObjectMoved); //Registers the table on a auxiliary list to avoid multiple registration on operation history reg_tables.push_back(tab->getSourceObject()); @@ -969,7 +969,7 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) void ModelWidget::handleObjectModification(BaseGraphicObject *object) { - op_list->registerObject(object, Operation::OBJECT_MODIFIED); + op_list->registerObject(object, Operation::ObjectModified); this->modified=true; if(object->getSchema()) @@ -1262,7 +1262,7 @@ void ModelWidget::convertRelationshipNN(void) op_list->startOperationChain(); //Removes the many-to-many relationship from the model - op_list->registerObject(rel, Operation::OBJECT_REMOVED); + op_list->registerObject(rel, Operation::ObjectRemoved); //The default position for the table will be the middle point between the relationship participant tables pnt.setX((src_tab->getPosition().x() + dst_tab->getPosition().x())/2.0f); @@ -1271,14 +1271,14 @@ void ModelWidget::convertRelationshipNN(void) //Adds the new table to the model db_model->addObject(tab); - op_list->registerObject(tab, Operation::OBJECT_CREATED); + op_list->registerObject(tab, Operation::ObjectCreated); if(rel->isSelfRelationship()) { //For self relationships register the created foreign keys on the operation list while(!fks.empty()) { - op_list->registerObject(fks.back(), Operation::OBJECT_CREATED, -1, fks.back()->getParentTable()); + op_list->registerObject(fks.back(), Operation::ObjectCreated, -1, fks.back()->getParentTable()); fks.pop_back(); } } @@ -1296,7 +1296,7 @@ void ModelWidget::convertRelationshipNN(void) aux_constr->setName(PgModelerNs::generateUniqueName(tab, *tab->getObjectList(ObjConstraint), false, QString("_pk"))); tab->addConstraint(aux_constr); - op_list->registerObject(aux_constr, Operation::OBJECT_CREATED, -1, tab); + op_list->registerObject(aux_constr, Operation::ObjectCreated, -1, tab); } /* Creates a one-to-many relationship that links the source table of the many-to-many rel. to the created table @@ -1304,14 +1304,14 @@ void ModelWidget::convertRelationshipNN(void) rel1=new Relationship(Relationship::Relationship1n, src_tab, tab, src_mand, false, !rel->isSiglePKColumn()); db_model->addRelationship(rel1); - op_list->registerObject(rel1, Operation::OBJECT_CREATED); + op_list->registerObject(rel1, Operation::ObjectCreated); /*Creates a one-to-many relationship that links the destination table of the many-to-many rel. to the created table The relationship will be identifier if the single pk column attribute of the original relationship is false */ rel2=new Relationship(Relationship::Relationship1n, dst_tab, tab, dst_mand, false, !rel->isSiglePKColumn()); db_model->addRelationship(rel2); - op_list->registerObject(rel2, Operation::OBJECT_CREATED); + op_list->registerObject(rel2, Operation::ObjectCreated); } op_list->finishOperationChain(); @@ -1903,7 +1903,7 @@ void ModelWidget::moveToSchema(void) //Change the object's schema only if the new schema is different from the current if(obj->acceptsSchema() && obj->getSchema()!=schema) { - op_id=op_list->registerObject(obj, Operation::OBJECT_MODIFIED, -1); + op_id=op_list->registerObject(obj, Operation::ObjectModified, -1); obj->setSchema(schema); obj_graph=dynamic_cast(obj); @@ -1977,7 +1977,7 @@ void ModelWidget::changeOwner(void) //Register an operation only if the object is not the database itself if(obj->getObjectType()!=ObjDatabase) - op_id=op_list->registerObject(obj, Operation::OBJECT_MODIFIED, -1); + op_id=op_list->registerObject(obj, Operation::ObjectModified, -1); obj->setOwner(owner); } @@ -2012,7 +2012,7 @@ void ModelWidget::setTag(void) if(tab) { - op_id=op_list->registerObject(obj, Operation::OBJECT_MODIFIED, -1); + op_id=op_list->registerObject(obj, Operation::ObjectModified, -1); tab->setTag(dynamic_cast(tag)); } } @@ -2612,10 +2612,10 @@ void ModelWidget::pasteObjects(bool duplicate_mode) if(constr && constr->getConstraintType()==ConstraintType::foreign_key) db_model->updateTableFKRelationships(dynamic_cast
(tab_obj->getParentTable())); - op_list->registerObject(tab_obj, Operation::OBJECT_CREATED, -1, tab_obj->getParentTable()); + op_list->registerObject(tab_obj, Operation::ObjectCreated, -1, tab_obj->getParentTable()); } else - op_list->registerObject(object, Operation::OBJECT_CREATED); + op_list->registerObject(object, Operation::ObjectCreated); } catch(Exception &e) { @@ -2692,7 +2692,7 @@ void ModelWidget::duplicateObject(void) else dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); - op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, -1, table); + op_id=op_list->registerObject(dup_object, Operation::ObjectCreated, -1, table); table->addObject(dup_object); table->setModified(true); @@ -2930,7 +2930,7 @@ void ModelWidget::removeObjects(bool cascade) //Register the removed object on the operation list table->removeObject(obj_idx, obj_type); - op_list->registerObject(tab_obj, Operation::OBJECT_REMOVED, obj_idx, table); + op_list->registerObject(tab_obj, Operation::ObjectRemoved, obj_idx, table); db_model->removePermissions(tab_obj); @@ -2974,7 +2974,7 @@ void ModelWidget::removeObjects(bool cascade) try { db_model->removeObject(object, obj_idx); - op_list->registerObject(object, Operation::OBJECT_REMOVED, obj_idx); + op_list->registerObject(object, Operation::ObjectRemoved, obj_idx); } catch(Exception &e) { @@ -4093,12 +4093,12 @@ void ModelWidget::createSequenceFromColumn(void) seq->setSchema(tab->getSchema()); seq->setDefaultValues(col->getType()); - op_list->registerObject(seq, Operation::OBJECT_CREATED); + op_list->registerObject(seq, Operation::ObjectCreated); db_model->addSequence(seq); BaseObject::swapObjectsIds(tab, seq, false); - op_list->registerObject(col, Operation::OBJECT_MODIFIED, -1, tab); + op_list->registerObject(col, Operation::ObjectModified, -1, tab); //Changes the column type to the alias for serial type col->setType(col->getType().getAliasType()); col->setSequence(seq); @@ -4134,7 +4134,7 @@ void ModelWidget::convertIntegerToSerial(void) throw Exception(Exception::getErrorMessage(InvConversionIntegerToSerial).arg(col->getName()), InvConversionIntegerToSerial ,__PRETTY_FUNCTION__,__FILE__,__LINE__); - op_list->registerObject(col, Operation::OBJECT_MODIFIED, -1, tab); + op_list->registerObject(col, Operation::ObjectModified, -1, tab); if(col_type==QString("integer") || col_type==QString("int4")) serial_tp=QString("serial"); @@ -4166,7 +4166,7 @@ void ModelWidget::breakRelationshipLine(void) QAction *action=dynamic_cast(sender()); BaseRelationship *rel=dynamic_cast(selected_objects[0]); - op_list->registerObject(rel, Operation::OBJECT_MODIFIED); + op_list->registerObject(rel, Operation::ObjectModified); breakRelationshipLine(rel, action->data().toUInt()); rel->setModified(true); this->setModified(true); @@ -4241,7 +4241,7 @@ void ModelWidget::removeRelationshipPoints(void) if(!rel->isProtected()) { - op_list->registerObject(rel, Operation::OBJECT_MODIFIED); + op_list->registerObject(rel, Operation::ObjectModified); rel->setPoints({}); rel->setModified(true); } @@ -4250,7 +4250,7 @@ void ModelWidget::removeRelationshipPoints(void) } else { - op_list->registerObject(rel, Operation::OBJECT_MODIFIED); + op_list->registerObject(rel, Operation::ObjectModified); rel->setPoints({}); rel->setModified(true); } diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index 6671b1eecd..cbf627eddf 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -95,7 +95,7 @@ void ObjectRenameWidget::applyRenaming(void) if(obj_type!=ObjDatabase) { //Register the object on operations list before the modification - op_list->registerObject(object, Operation::OBJECT_MODIFIED, -1, (tab_obj ? tab_obj->getParentTable() : nullptr)); + op_list->registerObject(object, Operation::ObjectModified, -1, (tab_obj ? tab_obj->getParentTable() : nullptr)); //Format the object name to check if it will have a conflicting name fmt_name=BaseObject::formatName(new_name_edt->text().toUtf8(), obj_type==ObjOperator); diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 9164607cc3..1b34d7cc10 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -109,22 +109,22 @@ void OperationListWidget::updateOperationList(void) item2->setFont(0,font); item2->setText(0,trUtf8("Name: %1").arg(obj_name)); - if(op_type==Operation::OBJECT_CREATED) + if(op_type==Operation::ObjectCreated) { op_icon=QString("criado"); op_name=trUtf8("created"); } - else if(op_type==Operation::OBJECT_REMOVED) + else if(op_type==Operation::ObjectRemoved) { op_icon=QString("removido"); op_name=trUtf8("removed"); } - else if(op_type==Operation::OBJECT_MODIFIED) + else if(op_type==Operation::ObjectModified) { op_icon=QString("modificado"); op_name=trUtf8("modified"); } - else if(op_type==Operation::OBJECT_MOVED) + else if(op_type==Operation::ObjectMoved) { op_icon=QString("movimentado"); op_name=trUtf8("moved"); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 50d6b1f726..a2dc06d0f0 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -102,17 +102,17 @@ void OperatorClassWidget::selectElementType(int elem_type) { unsigned sel_idx=static_cast(elem_type); - function_lbl->setVisible(sel_idx==OperatorClassElement::FUNCTION_ELEM); - function_sel->setVisible(sel_idx==OperatorClassElement::FUNCTION_ELEM); + function_lbl->setVisible(sel_idx==OperatorClassElement::FunctionElem); + function_sel->setVisible(sel_idx==OperatorClassElement::FunctionElem); - operator_lbl->setVisible(sel_idx==OperatorClassElement::OPERATOR_ELEM); - operator_sel->setVisible(sel_idx==OperatorClassElement::OPERATOR_ELEM); - elem_family_lbl->setVisible(sel_idx==OperatorClassElement::OPERATOR_ELEM); - elem_family_sel->setVisible(sel_idx==OperatorClassElement::OPERATOR_ELEM); + operator_lbl->setVisible(sel_idx==OperatorClassElement::OperatorElem); + operator_sel->setVisible(sel_idx==OperatorClassElement::OperatorElem); + elem_family_lbl->setVisible(sel_idx==OperatorClassElement::OperatorElem); + elem_family_sel->setVisible(sel_idx==OperatorClassElement::OperatorElem); - storage_type->setVisible(sel_idx==OperatorClassElement::STORAGE_ELEM); - stg_num_lbl->setVisible(sel_idx!=OperatorClassElement::STORAGE_ELEM); - stg_num_sb->setVisible(sel_idx!=OperatorClassElement::STORAGE_ELEM); + storage_type->setVisible(sel_idx==OperatorClassElement::StorageElem); + stg_num_lbl->setVisible(sel_idx!=OperatorClassElement::StorageElem); + stg_num_sb->setVisible(sel_idx!=OperatorClassElement::StorageElem); } void OperatorClassWidget::editElement(int lin_idx) @@ -137,12 +137,12 @@ void OperatorClassWidget::showElementData(OperatorClassElement elem, int lin_idx elem_type=elem.getElementType(); - if(elem_type==OperatorClassElement::FUNCTION_ELEM) + if(elem_type==OperatorClassElement::FunctionElem) { elements_tab->setCellText(elem.getFunction()->getSignature(), lin_idx, 0); elements_tab->setCellText(elem.getFunction()->getTypeName(), lin_idx, 1); } - else if(elem_type==OperatorClassElement::OPERATOR_ELEM) + else if(elem_type==OperatorClassElement::OperatorElem) { elements_tab->setCellText(elem.getOperator()->getSignature(), lin_idx, 0); elements_tab->setCellText(elem.getOperator()->getTypeName(), lin_idx, 1); @@ -153,12 +153,12 @@ void OperatorClassWidget::showElementData(OperatorClassElement elem, int lin_idx elements_tab->setCellText(BaseObject::getTypeName(ObjType), lin_idx, 1); } - if(elem_type!=OperatorClassElement::STORAGE_ELEM) + if(elem_type!=OperatorClassElement::StorageElem) elements_tab->setCellText(QString("%1").arg(elem.getStrategyNumber()), lin_idx, 2); else elements_tab->setCellText(QString(" "), lin_idx, 2); - if(elem_type==OperatorClassElement::OPERATOR_ELEM && elem.getOperatorFamily()) + if(elem_type==OperatorClassElement::OperatorElem && elem.getOperatorFamily()) elements_tab->setCellText(elem.getOperatorFamily()->getName(true), lin_idx, 3); else elements_tab->clearCellText(lin_idx, 3); @@ -176,9 +176,9 @@ void OperatorClassWidget::handleElement(int lin_idx) try { - if(elem_type==OperatorClassElement::FUNCTION_ELEM) + if(elem_type==OperatorClassElement::FunctionElem) elem.setFunction(dynamic_cast(function_sel->getSelectedObject()), stg_num_sb->value()); - else if(elem_type==OperatorClassElement::OPERATOR_ELEM) + else if(elem_type==OperatorClassElement::OperatorElem) { elem.setOperator(dynamic_cast(operator_sel->getSelectedObject()), stg_num_sb->value()); elem.setOperatorFamily(dynamic_cast(elem_family_sel->getSelectedObject())); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 9880091d39..ef2820736f 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -73,7 +73,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob grid->setContentsMargins(2,2,2,2); permissions_gb->setLayout(grid); - for(i=Permission::PRIV_SELECT; i<=Permission::PRIV_USAGE; i++) + for(i=Permission::PrivSelect; i<=Permission::PrivUsage; i++) { check=new QCheckBox; check->setText(privs[i].toUpper()); @@ -140,7 +140,7 @@ void PermissionWidget::setAttributes(DatabaseModel *model, BaseObject *parent_ob name_edt->setText(QString("%1 (%2)").arg(object->getSignature()).arg(object->getTypeName())); - for(priv=Permission::PRIV_SELECT; priv<=Permission::PRIV_USAGE; priv++) + for(priv=Permission::PrivSelect; priv<=Permission::PrivUsage; priv++) { //Gets the checkboxes that represents the privilege and the GRANT OPTION chk=dynamic_cast(privileges_tbw->cellWidget(priv,0)); @@ -180,7 +180,7 @@ void PermissionWidget::disableGrantOptions(void) { QCheckBox *check=nullptr; - for(unsigned i=Permission::PRIV_SELECT; i<=Permission::PRIV_USAGE; i++) + for(unsigned i=Permission::PrivSelect; i<=Permission::PrivUsage; i++) { check=dynamic_cast(privileges_tbw->cellWidget(i,1)); check->setEnabled(roles_tab->getRowCount() > 0); @@ -375,7 +375,7 @@ void PermissionWidget::editPermission(void) roles_tab->blockSignals(false); - for(priv=Permission::PRIV_SELECT; priv<=Permission::PRIV_USAGE; priv++) + for(priv=Permission::PrivSelect; priv<=Permission::PrivUsage; priv++) { chk=dynamic_cast(privileges_tbw->cellWidget(priv,0)); chk1=dynamic_cast(privileges_tbw->cellWidget(priv,1)); @@ -423,7 +423,7 @@ void PermissionWidget::configurePermission(Permission *perm) for(i=0; i < count; i++) perm->addRole(reinterpret_cast(roles_tab->getRowData(i).value())); - for(priv=Permission::PRIV_SELECT; priv <= Permission::PRIV_USAGE; priv++) + for(priv=Permission::PrivSelect; priv <= Permission::PrivUsage; priv++) { if(!privileges_tbw->isRowHidden(priv)) { @@ -442,7 +442,7 @@ void PermissionWidget::cancelOperation(void) permission=nullptr; - for(priv=Permission::PRIV_SELECT; priv<=Permission::PRIV_USAGE; priv++) + for(priv=Permission::PrivSelect; priv<=Permission::PrivUsage; priv++) { chk=dynamic_cast(privileges_tbw->cellWidget(priv,0)); chk->setChecked(false); @@ -469,7 +469,7 @@ void PermissionWidget::checkPrivilege(void) chk=dynamic_cast(obj_sender); - for(priv=Permission::PRIV_SELECT; priv<=Permission::PRIV_USAGE; priv++) + for(priv=Permission::PrivSelect; priv<=Permission::PrivUsage; priv++) { chk_priv=dynamic_cast(privileges_tbw->cellWidget(priv,0)); chk_gop=dynamic_cast(privileges_tbw->cellWidget(priv,1)); @@ -496,7 +496,7 @@ void PermissionWidget::enableEditButtons(void) unsigned priv; QCheckBox *chk=nullptr, *chk1=nullptr; - for(priv=Permission::PRIV_SELECT; priv<=Permission::PRIV_USAGE && !checked_privs; priv++) + for(priv=Permission::PrivSelect; priv<=Permission::PrivUsage && !checked_privs; priv++) { chk=dynamic_cast(privileges_tbw->cellWidget(priv,0)); chk1=dynamic_cast(privileges_tbw->cellWidget(priv,1)); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index c56516471f..c472772e33 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -73,7 +73,7 @@ void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseM ref_type_cmb->setCurrentIndex(ref.getReferenceType()); ref_alias_edt->setText(ref.getReferenceAlias()); - if(ref.getReferenceType()==Reference::REFER_COLUMN) + if(ref.getReferenceType()==Reference::ReferColumn) { if(ref.getColumn()) ref_object_sel->setSelectedObject(ref.getColumn()); @@ -89,14 +89,14 @@ void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseM expr_alias_edt->setText(ref.getAlias()); } - if(ref_flags == Reference::SQL_VIEW_DEFINITION) + if(ref_flags == Reference::SqlViewDefinition) view_def_chk->setChecked(true); else { - select_from_chk->setChecked((ref_flags & Reference::SQL_REFER_SELECT) == Reference::SQL_REFER_SELECT); - from_where_chk->setChecked((ref_flags & Reference::SQL_REFER_FROM) == Reference::SQL_REFER_FROM); - after_where_chk->setChecked((ref_flags & Reference::SQL_REFER_WHERE) == Reference::SQL_REFER_WHERE); - end_expr_chk->setChecked((ref_flags & Reference::SQL_REFER_END_EXPR) == Reference::SQL_REFER_END_EXPR); + select_from_chk->setChecked((ref_flags & Reference::SqlReferSelect) == Reference::SqlReferSelect); + from_where_chk->setChecked((ref_flags & Reference::SqlReferFrom) == Reference::SqlReferFrom); + after_where_chk->setChecked((ref_flags & Reference::SqlReferWhere) == Reference::SqlReferWhere); + end_expr_chk->setChecked((ref_flags & Reference::SqlReferEndExpr) == Reference::SqlReferEndExpr); } } @@ -115,7 +115,7 @@ void ReferenceWidget::applyConfiguration(void) try { //Creating a reference to a column - if(static_cast(ref_type_cmb->currentIndex())==Reference::REFER_COLUMN) + if(static_cast(ref_type_cmb->currentIndex())==Reference::ReferColumn) { Column *column = dynamic_cast(ref_object_sel->getSelectedObject()); Table *table = (column ? dynamic_cast
(column->getParentTable()) : @@ -138,19 +138,19 @@ void ReferenceWidget::applyConfiguration(void) ref_flags = 0; if(view_def_chk->isChecked()) - ref_flags = Reference::SQL_VIEW_DEFINITION; + ref_flags = Reference::SqlViewDefinition; if(select_from_chk->isChecked()) - ref_flags |= Reference::SQL_REFER_SELECT; + ref_flags |= Reference::SqlReferSelect; if(from_where_chk->isChecked()) - ref_flags |= Reference::SQL_REFER_FROM; + ref_flags |= Reference::SqlReferFrom; if(after_where_chk->isChecked()) - ref_flags |= Reference::SQL_REFER_WHERE; + ref_flags |= Reference::SqlReferWhere; if(end_expr_chk->isChecked()) - ref_flags |= Reference::SQL_REFER_END_EXPR; + ref_flags |= Reference::SqlReferEndExpr; emit s_closeRequested(); } @@ -163,7 +163,7 @@ void ReferenceWidget::applyConfiguration(void) void ReferenceWidget::selectReferenceType(void) { //Marks if the select reference type treats a reference to an object - bool ref_obj=(ref_type_cmb->currentIndex()==static_cast(Reference::REFER_COLUMN)); + bool ref_obj=(ref_type_cmb->currentIndex()==static_cast(Reference::ReferColumn)); ref_object_sel->setEnabled(ref_obj); tab_alias_edt->setEnabled(ref_obj); col_alias_edt->setEnabled(ref_obj); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 483f9e476f..9619de696f 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -141,10 +141,10 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent %2 = Reference (source) table name.
\ %3 = Receiver (destination) table name.
\ %4 = Generated table name. (Only for n:n relationships)") - .arg(Relationship::SRC_COL_TOKEN) - .arg(Relationship::SRC_TAB_TOKEN) - .arg(Relationship::DST_TAB_TOKEN) - .arg(Relationship::GEN_TAB_TOKEN)); + .arg(Relationship::SrcColToken) + .arg(Relationship::SrcTabToken) + .arg(Relationship::DstTabToken) + .arg(Relationship::GenTabToken)); vlayout=dynamic_cast(name_patterns_grp->layout()); vlayout->addWidget(frame); @@ -528,13 +528,13 @@ void RelationshipWidget::usePatternGlobalSettings(bool value) else { //Using the settings of the relatinship itself - pk_pattern_txt->setPlainText(rel->getNamePattern(Relationship::PK_PATTERN)); - src_fk_pattern_txt->setPlainText(rel->getNamePattern(Relationship::SRC_FK_PATTERN)); - dst_fk_pattern_txt->setPlainText(rel->getNamePattern(Relationship::DST_FK_PATTERN)); - uq_pattern_txt->setPlainText(rel->getNamePattern(Relationship::UQ_PATTERN)); - src_col_pattern_txt->setPlainText(rel->getNamePattern(Relationship::SRC_COL_PATTERN)); - dst_col_pattern_txt->setPlainText(rel->getNamePattern(Relationship::DST_COL_PATTERN)); - pk_col_pattern_txt->setPlainText(rel->getNamePattern(Relationship::PK_COL_PATTERN)); + pk_pattern_txt->setPlainText(rel->getNamePattern(Relationship::PkPattern)); + src_fk_pattern_txt->setPlainText(rel->getNamePattern(Relationship::SrcFkPattern)); + dst_fk_pattern_txt->setPlainText(rel->getNamePattern(Relationship::DstFkPattern)); + uq_pattern_txt->setPlainText(rel->getNamePattern(Relationship::UqPattern)); + src_col_pattern_txt->setPlainText(rel->getNamePattern(Relationship::SrcColPattern)); + dst_col_pattern_txt->setPlainText(rel->getNamePattern(Relationship::DstColPattern)); + pk_col_pattern_txt->setPlainText(rel->getNamePattern(Relationship::PkColPattern)); } } } @@ -813,7 +813,7 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) PgModelerNs::copyObject(&dup_object, object, obj_type); dup_object->setName(PgModelerNs::generateUniqueName(dup_object, obj_list, false, QString("_cp"))); - op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, new_row, rel); + op_id=op_list->registerObject(dup_object, Operation::ObjectCreated, new_row, rel); rel->addObject(dynamic_cast(dup_object)); listObjects(obj_type); @@ -913,7 +913,7 @@ void RelationshipWidget::removeObjects(void) for(i=0; i < count; i++) { object=rel->getObject(0, obj_type); - op_list->registerObject(object, Operation::OBJECT_REMOVED, 0, rel); + op_list->registerObject(object, Operation::ObjectRemoved, 0, rel); rel->removeObject(object); } @@ -958,7 +958,7 @@ void RelationshipWidget::removeObject(int row) obj_type=ObjConstraint; object=rel->getObject(row, obj_type); - op_id=op_list->registerObject(object, Operation::OBJECT_REMOVED, 0, rel); + op_id=op_list->registerObject(object, Operation::ObjectRemoved, 0, rel); rel->removeObject(object); if(obj_type==ObjColumn) @@ -1065,7 +1065,7 @@ void RelationshipWidget::applyConfiguration(void) } if(!this->new_object && this->object->getObjectType()==ObjRelationship) - op_list->registerObject(this->object, Operation::OBJECT_MODIFIED); + op_list->registerObject(this->object, Operation::ObjectModified); else registerNewObject(); @@ -1081,9 +1081,9 @@ void RelationshipWidget::applyConfiguration(void) QPlainTextEdit *pattern_fields[]={ src_col_pattern_txt, dst_col_pattern_txt, src_fk_pattern_txt, dst_fk_pattern_txt, pk_pattern_txt, uq_pattern_txt, pk_col_pattern_txt }; - unsigned pattern_ids[]= { Relationship::SRC_COL_PATTERN, Relationship::DST_COL_PATTERN, - Relationship::SRC_FK_PATTERN, Relationship::DST_FK_PATTERN, - Relationship::PK_PATTERN, Relationship::UQ_PATTERN, Relationship::PK_COL_PATTERN }; + unsigned pattern_ids[]= { Relationship::SrcColPattern, Relationship::DstColPattern, + Relationship::SrcFkPattern, Relationship::DstFkPattern, + Relationship::PkPattern, Relationship::UqPattern, Relationship::PkColPattern }; rel=dynamic_cast(base_rel); diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index b50e4ec618..2b0dac3f76 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -117,14 +117,14 @@ void RoleWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Rol validity_chk->setChecked(!role->getValidity().isEmpty()); validity_dte->setDateTime(QDateTime::fromString(role->getValidity(), QString("yyyy-MM-dd hh:mm:ss"))); - superusr_chk->setChecked(role->getOption(Role::OP_SUPERUSER)); - create_db_chk->setChecked(role->getOption(Role::OP_CREATEDB)); - create_role_chk->setChecked(role->getOption(Role::OP_CREATEROLE)); - encrypt_pass_chk->setChecked(role->getOption(Role::OP_ENCRYPTED)); - inh_perm_chk->setChecked(role->getOption(Role::OP_INHERIT)); - can_login_chk->setChecked(role->getOption(Role::OP_LOGIN)); - can_replicate_chk->setChecked(role->getOption(Role::OP_REPLICATION)); - bypass_rls_chk->setChecked(role->getOption(Role::OP_BYPASSRLS)); + superusr_chk->setChecked(role->getOption(Role::OpSuperuser)); + create_db_chk->setChecked(role->getOption(Role::OpCreateDb)); + create_role_chk->setChecked(role->getOption(Role::OpCreateRole)); + encrypt_pass_chk->setChecked(role->getOption(Role::OpEncrypted)); + inh_perm_chk->setChecked(role->getOption(Role::OpInherit)); + can_login_chk->setChecked(role->getOption(Role::OpLogin)); + can_replicate_chk->setChecked(role->getOption(Role::OpReplication)); + bypass_rls_chk->setChecked(role->getOption(Role::OpBypassRls)); } BaseObjectWidget::setAttributes(model, op_list, role); @@ -140,7 +140,7 @@ void RoleWidget::showRoleData(Role *role, unsigned table_id, unsigned row) QString str_aux; Role *aux_role=nullptr; unsigned count, i, type_id, - role_types[3]={ Role::REF_ROLE, Role::MEMBER_ROLE, Role::ADMIN_ROLE }; + role_types[3]={ Role::RefRole, Role::MemberRole, Role::AdminRole }; if(table_id > 3) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -172,7 +172,7 @@ void RoleWidget::fillMembersTable(void) { Role *aux_role=nullptr, *role=nullptr; unsigned count, i, type_id, - role_types[3]={ Role::REF_ROLE, Role::MEMBER_ROLE, Role::ADMIN_ROLE }; + role_types[3]={ Role::RefRole, Role::MemberRole, Role::AdminRole }; role=dynamic_cast(this->object); @@ -249,7 +249,7 @@ void RoleWidget::applyConfiguration(void) { Role *role=nullptr, *aux_role=nullptr; unsigned count, i, type_id, - role_types[3]={ Role::REF_ROLE, Role::MEMBER_ROLE, Role::ADMIN_ROLE }; + role_types[3]={ Role::RefRole, Role::MemberRole, Role::AdminRole }; try { @@ -264,14 +264,14 @@ void RoleWidget::applyConfiguration(void) else role->setValidity(QString()); - role->setOption(Role::OP_SUPERUSER, superusr_chk->isChecked()); - role->setOption(Role::OP_CREATEDB, create_db_chk->isChecked()); - role->setOption(Role::OP_CREATEROLE, create_role_chk->isChecked()); - role->setOption(Role::OP_ENCRYPTED, encrypt_pass_chk->isChecked()); - role->setOption(Role::OP_INHERIT, inh_perm_chk->isChecked()); - role->setOption(Role::OP_LOGIN, can_login_chk->isChecked()); - role->setOption(Role::OP_REPLICATION, can_replicate_chk->isChecked()); - role->setOption(Role::OP_BYPASSRLS, bypass_rls_chk->isChecked()); + role->setOption(Role::OpSuperuser, superusr_chk->isChecked()); + role->setOption(Role::OpCreateDb, create_db_chk->isChecked()); + role->setOption(Role::OpCreateRole, create_role_chk->isChecked()); + role->setOption(Role::OpEncrypted, encrypt_pass_chk->isChecked()); + role->setOption(Role::OpInherit, inh_perm_chk->isChecked()); + role->setOption(Role::OpLogin, can_login_chk->isChecked()); + role->setOption(Role::OpReplication, can_replicate_chk->isChecked()); + role->setOption(Role::OpBypassRls, bypass_rls_chk->isChecked()); for(type_id=0; type_id < 3; type_id++) { diff --git a/libpgmodeler_ui/src/sequencewidget.cpp b/libpgmodeler_ui/src/sequencewidget.cpp index 3e95ec997b..3b2d3bd349 100644 --- a/libpgmodeler_ui/src/sequencewidget.cpp +++ b/libpgmodeler_ui/src/sequencewidget.cpp @@ -88,7 +88,7 @@ void SequenceWidget::setAttributes(DatabaseModel *model, Sequence *sequence) { cyclic_chk->setChecked(false); start_edt->setText(QString("1")); - maximum_edt->setText(Sequence::MAX_POSITIVE_VALUE); + maximum_edt->setText(Sequence::MaxPositiveValue); minimum_edt->setText(QString("0")); cache_edt->setText(QString("1")); increment_edt->setText(QString("1")); @@ -133,12 +133,12 @@ void SequenceWidget::setDefaultValues(void) } else { - QString min = "0", max = Sequence::MAX_POSITIVE_VALUE; + QString min = "0", max = Sequence::MaxPositiveValue; if(def_values_cmb->currentText() == "smallserial") - max = Sequence::MAX_SMALL_POSITIVE_VALUE; + max = Sequence::MaxSmallPositiveValue; else if(def_values_cmb->currentText() == "bigserial") - max = Sequence::MAX_BIG_POSITIVE_VALUE; + max = Sequence::MaxBigPositiveValue; start_edt->setText("1"); cache_edt->setText("1"); diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 7d89d03909..0b1fdc7504 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -73,12 +73,12 @@ TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjB connect(csv_load_tb, SIGNAL(toggled(bool)), csv_load_parent, SLOT(setVisible(bool))); connect(csv_load_wgt, &CsvLoadWidget::s_csvFileLoaded, [&](){ - populateDataGrid(csv_load_wgt->getCsvBuffer(Table::DATA_SEPARATOR, Table::DATA_LINE_BREAK)); + populateDataGrid(csv_load_wgt->getCsvBuffer(Table::DataSeparator, Table::DataLineBreak)); }); connect(paste_tb, &QToolButton::clicked, [&](){ csv_load_wgt->loadCsvBuffer(qApp->clipboard()->text(), QString(";"), QString("\""), true); - populateDataGrid(csv_load_wgt->getCsvBuffer(Table::DATA_SEPARATOR, Table::DATA_LINE_BREAK)); + populateDataGrid(csv_load_wgt->getCsvBuffer(Table::DataSeparator, Table::DataLineBreak)); qApp->clipboard()->clear(); paste_tb->setEnabled(false); }); @@ -347,11 +347,11 @@ void TableDataWidget::populateDataGrid(const QString &data) there have priority over the current table's columns */ if(!ini_data.isEmpty()) { - buffer=ini_data.split(Table::DATA_LINE_BREAK); + buffer=ini_data.split(Table::DataLineBreak); //The first line of the buffer always has the column names if(!buffer.isEmpty() && !buffer[0].isEmpty()) - columns.append(buffer[0].split(Table::DATA_SEPARATOR)); + columns.append(buffer[0].split(Table::DataSeparator)); } else { @@ -392,7 +392,7 @@ void TableDataWidget::populateDataGrid(const QString &data) for(QString buf_row : buffer) { addRow(); - values = buf_row.split(Table::DATA_SEPARATOR); + values = buf_row.split(Table::DataSeparator); col = 0; for(QString val : values) @@ -482,7 +482,7 @@ QString TableDataWidget::generateDataBuffer(void) col_names.push_back(data_tbw->horizontalHeaderItem(col)->text()); //The first line of the buffer consists in the column names - buffer.push_back(col_names.join(Table::DATA_SEPARATOR)); + buffer.push_back(col_names.join(Table::DataSeparator)); for(int row = 0; row < data_tbw->rowCount(); row++) { @@ -491,9 +491,9 @@ QString TableDataWidget::generateDataBuffer(void) value = data_tbw->item(row, col)->text(); //Checking if the value is a malformed unescaped value, e.g., {value, value}, {value\} - if((value.startsWith(PgModelerNs::UNESC_VALUE_START) && value.endsWith(QString("\\") + PgModelerNs::UNESC_VALUE_END)) || - (value.startsWith(PgModelerNs::UNESC_VALUE_START) && !value.endsWith(PgModelerNs::UNESC_VALUE_END)) || - (!value.startsWith(PgModelerNs::UNESC_VALUE_START) && !value.endsWith(QString("\\") + PgModelerNs::UNESC_VALUE_END) && value.endsWith(PgModelerNs::UNESC_VALUE_END))) + if((value.startsWith(PgModelerNs::UnescValueStart) && value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd)) || + (value.startsWith(PgModelerNs::UnescValueStart) && !value.endsWith(PgModelerNs::UnescValueEnd)) || + (!value.startsWith(PgModelerNs::UnescValueStart) && !value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd) && value.endsWith(PgModelerNs::UnescValueEnd))) throw Exception(Exception::getErrorMessage(MalformedUnescapedValue) .arg(row + 1).arg(col_names[col]), MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -501,14 +501,14 @@ QString TableDataWidget::generateDataBuffer(void) val_list.push_back(value); } - buffer.push_back(val_list.join(Table::DATA_SEPARATOR)); + buffer.push_back(val_list.join(Table::DataSeparator)); val_list.clear(); } if(buffer.size() <= 1) return(QString()); - return(buffer.join(Table::DATA_LINE_BREAK)); + return(buffer.join(Table::DataLineBreak)); } void TableDataWidget::enterEvent(QEvent *) diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index aeb6204f06..0d7beba47d 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -631,7 +631,7 @@ void TableWidget::removeObjects(void) if(!object->isProtected() && !dynamic_cast(object)->isAddedByRelationship()) { - op_list->registerObject(object, Operation::OBJECT_REMOVED, 0, this->object); + op_list->registerObject(object, Operation::ObjectRemoved, 0, this->object); table->removeObject(object); } else @@ -683,7 +683,7 @@ void TableWidget::removeObject(int row) if(!object->isProtected() && !dynamic_cast(object)->isAddedByRelationship()) { - op_id=op_list->registerObject(object, Operation::OBJECT_REMOVED, row, this->object); + op_id=op_list->registerObject(object, Operation::ObjectRemoved, row, this->object); table->removeObject(object); table->setModified(true); } @@ -733,7 +733,7 @@ void TableWidget::duplicateObject(int sel_row, int new_row) PgModelerNs::copyObject(&dup_object, object, obj_type); dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *table->getObjectList(obj_type), false, QString("_cp"))); - op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, new_row, this->object); + op_id=op_list->registerObject(dup_object, Operation::ObjectCreated, new_row, this->object); table->addObject(dup_object); table->setModified(true); @@ -814,7 +814,7 @@ void TableWidget::applyConfiguration(void) PartitioningType part_type; if(!this->new_object) - op_list->registerObject(this->object, Operation::OBJECT_MODIFIED); + op_list->registerObject(this->object, Operation::ObjectModified); else registerNewObject(); @@ -867,14 +867,14 @@ void TableWidget::applyConfiguration(void) pk->addColumn(col, Constraint::SourceCols); table->addConstraint(pk); - op_list->registerObject(pk, Operation::OBJECT_CREATED, -1, table); + op_list->registerObject(pk, Operation::ObjectCreated, -1, table); } else if(!pk->isAddedByRelationship()) { vector orig_pk_cols = pk->getColumns(Constraint::SourceCols); //If the table owns a pk we only update the columns - op_list->registerObject(pk, Operation::OBJECT_MODIFIED, -1, table); + op_list->registerObject(pk, Operation::ObjectModified, -1, table); pk->removeColumns(); /* Adding the original primary key columns if they also exists in the @@ -894,7 +894,7 @@ void TableWidget::applyConfiguration(void) else if(pk_cols.empty() && pk && !pk->isAddedByRelationship()) { //Removing the primary key from the table when no column is checked as pk - op_list->registerObject(pk, Operation::OBJECT_REMOVED, -1, table); + op_list->registerObject(pk, Operation::ObjectRemoved, -1, table); table->removeObject(pk); } diff --git a/libpgmodeler_ui/src/tagwidget.cpp b/libpgmodeler_ui/src/tagwidget.cpp index 696edd33e9..0aec4068a6 100644 --- a/libpgmodeler_ui/src/tagwidget.cpp +++ b/libpgmodeler_ui/src/tagwidget.cpp @@ -81,16 +81,16 @@ void TagWidget::applyConfiguration(void) BaseObjectWidget::applyConfiguration(); - tag->setElementColor(ParsersAttributes::TABLE_NAME, color_pickers[ParsersAttributes::TABLE_NAME]->getColor(0), Tag::FILL_COLOR1); - tag->setElementColor(ParsersAttributes::TABLE_SCHEMA_NAME, color_pickers[ParsersAttributes::TABLE_SCHEMA_NAME]->getColor(0), Tag::FILL_COLOR1); + tag->setElementColor(ParsersAttributes::TABLE_NAME, color_pickers[ParsersAttributes::TABLE_NAME]->getColor(0), Tag::FillColor1); + tag->setElementColor(ParsersAttributes::TABLE_SCHEMA_NAME, color_pickers[ParsersAttributes::TABLE_SCHEMA_NAME]->getColor(0), Tag::FillColor1); for(auto &attr : attribs) { tag->setElementColors(attr, QString("%1,%2,%3") - .arg(color_pickers[attr]->getColor(Tag::FILL_COLOR1).name()) - .arg(color_pickers[attr]->getColor(Tag::FILL_COLOR2).name()) - .arg(color_pickers[attr]->getColor(Tag::BORDER_COLOR).name())); + .arg(color_pickers[attr]->getColor(Tag::FillColor1).name()) + .arg(color_pickers[attr]->getColor(Tag::FillColor2).name()) + .arg(color_pickers[attr]->getColor(Tag::BorderColor).name())); } model->getObjectReferences(tag, tagged_tabs); diff --git a/libpgmodeler_ui/src/textboxwidget.cpp b/libpgmodeler_ui/src/textboxwidget.cpp index ba5a9b9c93..e71a76b444 100644 --- a/libpgmodeler_ui/src/textboxwidget.cpp +++ b/libpgmodeler_ui/src/textboxwidget.cpp @@ -38,9 +38,9 @@ void TextboxWidget::setAttributes(DatabaseModel *model, OperationList *op_list, color_select_tb->setPalette(palette); text_txt->setPlainText(txtbox->getComment()); - bold_chk->setChecked(txtbox->getTextAttribute(Textbox::BOLD_TXT)); - italic_chk->setChecked(txtbox->getTextAttribute(Textbox::ITALIC_TXT)); - underline_chk->setChecked(txtbox->getTextAttribute(Textbox::UNDERLINE_TXT)); + bold_chk->setChecked(txtbox->getTextAttribute(Textbox::BoldText)); + italic_chk->setChecked(txtbox->getTextAttribute(Textbox::ItalicText)); + underline_chk->setChecked(txtbox->getTextAttribute(Textbox::UnderlineText)); font_size_sb->setValue(txtbox->getFontSize()); } @@ -73,9 +73,9 @@ void TextboxWidget::applyConfiguration(void) txtbox=dynamic_cast(this->object); txtbox->setComment(text_txt->toPlainText().toUtf8()); - txtbox->setTextAttribute(Textbox::ITALIC_TXT, italic_chk->isChecked()); - txtbox->setTextAttribute(Textbox::BOLD_TXT, bold_chk->isChecked()); - txtbox->setTextAttribute(Textbox::UNDERLINE_TXT, underline_chk->isChecked()); + txtbox->setTextAttribute(Textbox::ItalicText, italic_chk->isChecked()); + txtbox->setTextAttribute(Textbox::BoldText, bold_chk->isChecked()); + txtbox->setTextAttribute(Textbox::UnderlineText, underline_chk->isChecked()); txtbox->setTextColor(color_select_tb->palette().color(QPalette::Button)); txtbox->setFontSize(font_size_sb->value()); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index f7679144c7..17d3cef945 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -266,8 +266,8 @@ void TriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, arguments_tab->blockSignals(false); columns_tab->blockSignals(false); - old_table_edt->setText(trigger->getTransitionTableName(Trigger::OLD_TABLE_NAME)); - new_table_edt->setText(trigger->getTransitionTableName(Trigger::NEW_TABLE_NAME)); + old_table_edt->setText(trigger->getTransitionTableName(Trigger::OldTableName)); + new_table_edt->setText(trigger->getTransitionTableName(Trigger::NewTableName)); } updateColumnsCombo(); @@ -296,8 +296,8 @@ void TriggerWidget::applyConfiguration(void) trigger->setEvent(EventType::on_update, update_chk->isChecked()); trigger->setEvent(EventType::on_delete, delete_chk->isChecked()); trigger->setEvent(EventType::on_truncate, truncate_chk->isChecked()); - trigger->setTransitionTableName(Trigger::OLD_TABLE_NAME, old_table_edt->isEnabled() ? old_table_edt->text() : QString()); - trigger->setTransitionTableName(Trigger::NEW_TABLE_NAME, new_table_edt->isEnabled() ? new_table_edt->text() : QString()); + trigger->setTransitionTableName(Trigger::OldTableName, old_table_edt->isEnabled() ? old_table_edt->text() : QString()); + trigger->setTransitionTableName(Trigger::NewTableName, new_table_edt->isEnabled() ? new_table_edt->text() : QString()); trigger->removeArguments(); trigger->removeColumns(); diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index f0980887f4..cf5705bb6a 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -40,7 +40,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) grid->addItem(new QSpacerItem(20, 1, QSizePolicy::Minimum, QSizePolicy::Expanding),8,0); grid=dynamic_cast(base_attribs_twg->widget(0)->layout()); - for(i=Type::INPUT_FUNC; i <= Type::ANALYZE_FUNC; i++) + for(i=Type::InputFunc; i <= Type::AnalyzeFunc; i++) { functions_sel[i]=nullptr; functions_sel[i]=new ObjectSelectorWidget(ObjFunction, true, this); @@ -84,7 +84,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) opclass_sel=new ObjectSelectorWidget(ObjOpClass, true, this); grid->addWidget(opclass_sel,0,1,1,1); - for(i1=1, i=Type::CANONICAL_FUNC; i <= Type::SUBTYPE_DIFF_FUNC; i++,i1++) + for(i1=1, i=Type::CanonicalFunc; i <= Type::SubtypeDiffFunc; i++,i1++) { functions_sel[i]=nullptr; functions_sel[i]=new ObjectSelectorWidget(ObjFunction, true, this); @@ -117,14 +117,14 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) setRequiredField(range_subtype); setRequiredField(input_lbl); setRequiredField(output_lbl); - setRequiredField(functions_sel[Type::INPUT_FUNC]); - setRequiredField(functions_sel[Type::OUTPUT_FUNC]); + setRequiredField(functions_sel[Type::InputFunc]); + setRequiredField(functions_sel[Type::OutputFunc]); setRequiredField(enumerations_gb); setRequiredField(attributes_gb); configureTabOrder({base_type_rb, enumeration_rb, composite_rb, range_rb, enum_name_edt, attrib_name_edt, attrib_collation_sel, attrib_type_wgt, - opclass_sel, functions_sel[Type::CANONICAL_FUNC], functions_sel[Type::SUBTYPE_DIFF_FUNC], + opclass_sel, functions_sel[Type::CanonicalFunc], functions_sel[Type::SubtypeDiffFunc], base_attribs_twg}); setMinimumSize(620, 750); @@ -217,14 +217,14 @@ void TypeWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch opclass_sel->setModel(model); - for(i=Type::INPUT_FUNC; i <= Type::SUBTYPE_DIFF_FUNC; i++) + for(i=Type::InputFunc; i <= Type::SubtypeDiffFunc; i++) functions_sel[i]->setModel(model); if(type) { type_conf=type->getConfiguration(); - if(type_conf==Type::COMPOSITE_TYPE) + if(type_conf==Type::CompositeType) { composite_rb->setChecked(true); attributes_tab->blockSignals(true); @@ -239,7 +239,7 @@ void TypeWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch attributes_tab->blockSignals(false); attributes_tab->clearSelection(); } - else if(type_conf==Type::ENUMERATION_TYPE) + else if(type_conf==Type::EnumerationType) { enumeration_rb->setChecked(true); enumerations_tab->blockSignals(true); @@ -254,13 +254,13 @@ void TypeWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch enumerations_tab->blockSignals(false); enumerations_tab->clearSelection(); } - else if(type_conf==Type::RANGE_TYPE) + else if(type_conf==Type::RangeType) { range_rb->setChecked(true); opclass_sel->setSelectedObject(type->getSubtypeOpClass()); range_subtype->setAttributes(type->getSubtype(), model); - functions_sel[Type::CANONICAL_FUNC]->setSelectedObject(type->getFunction(Type::CANONICAL_FUNC)); - functions_sel[Type::SUBTYPE_DIFF_FUNC]->setSelectedObject(type->getFunction(Type::SUBTYPE_DIFF_FUNC)); + functions_sel[Type::CanonicalFunc]->setSelectedObject(type->getFunction(Type::CanonicalFunc)); + functions_sel[Type::SubtypeDiffFunc]->setSelectedObject(type->getFunction(Type::SubtypeDiffFunc)); } else { @@ -279,7 +279,7 @@ void TypeWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch storage_cmb->setCurrentIndex(storage_cmb->findText(~type->getStorage())); alignment_cmb->setCurrentIndex(alignment_cmb->findText(~type->getAlignment())); - for(i=Type::INPUT_FUNC; i <= Type::ANALYZE_FUNC; i++) + for(i=Type::InputFunc; i <= Type::AnalyzeFunc; i++) functions_sel[i]->setSelectedObject(type->getFunction(i)); } } @@ -305,7 +305,7 @@ void TypeWidget::applyConfiguration(void) //Configuring an enumaration type if(enumeration_rb->isChecked()) { - type->setConfiguration(Type::ENUMERATION_TYPE); + type->setConfiguration(Type::EnumerationType); count=enumerations_tab->getRowCount(); for(i=0; i < count; i++) @@ -314,7 +314,7 @@ void TypeWidget::applyConfiguration(void) //Configuration a composite type else if(composite_rb->isChecked()) { - type->setConfiguration(Type::COMPOSITE_TYPE); + type->setConfiguration(Type::CompositeType); count=attributes_tab->getRowCount(); for(i=0; i < count; i++) @@ -323,17 +323,17 @@ void TypeWidget::applyConfiguration(void) //Configuration a range type else if(range_rb->isChecked()) { - type->setConfiguration(Type::RANGE_TYPE); + type->setConfiguration(Type::RangeType); type->setCollation(collation_sel->getSelectedObject()); type->setSubtype(range_subtype->getPgSQLType()); type->setSubtypeOpClass(dynamic_cast(opclass_sel->getSelectedObject())); - type->setFunction(Type::CANONICAL_FUNC, dynamic_cast(functions_sel[Type::CANONICAL_FUNC]->getSelectedObject())); - type->setFunction(Type::SUBTYPE_DIFF_FUNC, dynamic_cast(functions_sel[Type::SUBTYPE_DIFF_FUNC]->getSelectedObject())); + type->setFunction(Type::CanonicalFunc, dynamic_cast(functions_sel[Type::CanonicalFunc]->getSelectedObject())); + type->setFunction(Type::SubtypeDiffFunc, dynamic_cast(functions_sel[Type::SubtypeDiffFunc]->getSelectedObject())); } //Configuring a base type else { - type->setConfiguration(Type::BASE_TYPE); + type->setConfiguration(Type::BaseType); type->setLikeType(like_type->getPgSQLType()); type->setElement(element_type->getPgSQLType()); type->setInternalLength(internal_len_sb->value()); @@ -349,7 +349,7 @@ void TypeWidget::applyConfiguration(void) type->setAlignment(PgSQLType(alignment_cmb->currentText())); type->setStorage(StorageType(storage_cmb->currentText())); - for(i=Type::INPUT_FUNC; i <= Type::ANALYZE_FUNC; i++) + for(i=Type::InputFunc; i <= Type::AnalyzeFunc; i++) type->setFunction(i, dynamic_cast(functions_sel[i]->getSelectedObject())); } diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 471467cb50..eaa6cbdfa2 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -219,7 +219,7 @@ void ViewWidget::duplicateObject(int curr_row, int new_row) PgModelerNs::copyObject(&dup_object, object, obj_type); dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *view->getObjectList(obj_type), false, QString("_cp"))); - op_id=op_list->registerObject(dup_object, Operation::OBJECT_CREATED, new_row, this->object); + op_id=op_list->registerObject(dup_object, Operation::ObjectCreated, new_row, this->object); view->addObject(dup_object); view->setModified(true); @@ -256,7 +256,7 @@ void ViewWidget::removeObjects(void) { object=view->getObject(0, obj_type); view->removeObject(object); - op_list->registerObject(object, Operation::OBJECT_REMOVED, 0, this->object); + op_list->registerObject(object, Operation::ObjectRemoved, 0, this->object); } } catch(Exception &e) @@ -302,7 +302,7 @@ void ViewWidget::removeObject(int row) view=dynamic_cast(this->object); object=view->getObject(row, obj_type); view->removeObject(object); - op_list->registerObject(object, Operation::OBJECT_REMOVED, row, this->object); + op_list->registerObject(object, Operation::ObjectRemoved, row, this->object); } catch(Exception &e) { @@ -456,20 +456,20 @@ unsigned ViewWidget::getReferenceFlag(int row) unsigned ref_flags = 0; if(flags_str[4] == '1') - ref_flags = Reference::SQL_VIEW_DEFINITION; + ref_flags = Reference::SqlViewDefinition; else { if(flags_str[0] == '1') - ref_flags |= Reference::SQL_REFER_SELECT; + ref_flags |= Reference::SqlReferSelect; if(flags_str[1] == '1') - ref_flags |= Reference::SQL_REFER_FROM; + ref_flags |= Reference::SqlReferFrom; if(flags_str[2] == '1') - ref_flags |= Reference::SQL_REFER_WHERE; + ref_flags |= Reference::SqlReferWhere; if(flags_str[3] == '1') - ref_flags |= Reference::SQL_REFER_END_EXPR; + ref_flags |= Reference::SqlReferEndExpr; } return(ref_flags); @@ -485,13 +485,13 @@ void ViewWidget::showReferenceData(Reference refer, unsigned ref_flags, unsigned Table *tab=nullptr; Column *col=nullptr; QString str_aux; - bool selec_from = (ref_flags & Reference::SQL_REFER_SELECT) == Reference::SQL_REFER_SELECT, - from_where = (ref_flags & Reference::SQL_REFER_FROM) == Reference::SQL_REFER_FROM, - after_where = (ref_flags & Reference::SQL_REFER_WHERE) == Reference::SQL_REFER_WHERE, - end_expr = (ref_flags & Reference::SQL_REFER_END_EXPR) == Reference::SQL_REFER_END_EXPR, - view_def = (ref_flags & Reference::SQL_VIEW_DEFINITION) == Reference::SQL_VIEW_DEFINITION; + bool selec_from = (ref_flags & Reference::SqlReferSelect) == Reference::SqlReferSelect, + from_where = (ref_flags & Reference::SqlReferFrom) == Reference::SqlReferFrom, + after_where = (ref_flags & Reference::SqlReferWhere) == Reference::SqlReferWhere, + end_expr = (ref_flags & Reference::SqlReferEndExpr) == Reference::SqlReferEndExpr, + view_def = (ref_flags & Reference::SqlViewDefinition) == Reference::SqlViewDefinition; - if(refer.getReferenceType()==Reference::REFER_COLUMN) + if(refer.getReferenceType()==Reference::ReferColumn) { tab=refer.getTable(); col=refer.getColumn(); @@ -542,11 +542,11 @@ void ViewWidget::updateCodePreview(void) TableObject *tab_obj=nullptr; map::iterator itr, itr_end; unsigned i, count, i1, expr_type[]={ - Reference::SQL_REFER_SELECT, - Reference::SQL_REFER_FROM, - Reference::SQL_REFER_WHERE, - Reference::SQL_REFER_END_EXPR, - Reference::SQL_VIEW_DEFINITION}; + Reference::SqlReferSelect, + Reference::SqlReferFrom, + Reference::SqlReferWhere, + Reference::SqlReferEndExpr, + Reference::SqlViewDefinition}; aux_view.BaseObject::setName(name_edt->text().toUtf8()); aux_view.BaseObject::setSchema(schema_sel->getSelectedObject()); @@ -656,20 +656,20 @@ void ViewWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch ref_flags = 0; refer=view->getReference(i); - if(view->getReferenceIndex(refer, Reference::SQL_VIEW_DEFINITION) >= 0) - ref_flags = Reference::SQL_VIEW_DEFINITION; + if(view->getReferenceIndex(refer, Reference::SqlViewDefinition) >= 0) + ref_flags = Reference::SqlViewDefinition; - if(view->getReferenceIndex(refer, Reference::SQL_REFER_SELECT) >= 0) - ref_flags |= Reference::SQL_REFER_SELECT; + if(view->getReferenceIndex(refer, Reference::SqlReferSelect) >= 0) + ref_flags |= Reference::SqlReferSelect; - if(view->getReferenceIndex(refer, Reference::SQL_REFER_FROM) >= 0) - ref_flags |= Reference::SQL_REFER_FROM; + if(view->getReferenceIndex(refer, Reference::SqlReferFrom) >= 0) + ref_flags |= Reference::SqlReferFrom; - if(view->getReferenceIndex(refer, Reference::SQL_REFER_WHERE) >= 0) - ref_flags |= Reference::SQL_REFER_WHERE; + if(view->getReferenceIndex(refer, Reference::SqlReferWhere) >= 0) + ref_flags |= Reference::SqlReferWhere; - if(view->getReferenceIndex(refer, Reference::SQL_REFER_END_EXPR) >= 0) - ref_flags |= Reference::SQL_REFER_END_EXPR; + if(view->getReferenceIndex(refer, Reference::SqlReferEndExpr) >= 0) + ref_flags |= Reference::SqlReferEndExpr; showReferenceData(refer, ref_flags, i); } @@ -688,16 +688,16 @@ void ViewWidget::applyConfiguration(void) { View *view=nullptr; ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex }; - unsigned expr_type[]={ Reference::SQL_REFER_SELECT, - Reference::SQL_REFER_FROM, - Reference::SQL_REFER_WHERE, - Reference::SQL_REFER_END_EXPR, - Reference::SQL_VIEW_DEFINITION}; + unsigned expr_type[]={ Reference::SqlReferSelect, + Reference::SqlReferFrom, + Reference::SqlReferWhere, + Reference::SqlReferEndExpr, + Reference::SqlViewDefinition}; Reference refer; QString str_aux; if(!this->new_object) - op_list->registerObject(this->object, Operation::OBJECT_MODIFIED); + op_list->registerObject(this->object, Operation::ObjectModified); else registerNewObject(); diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index 3baa69dd31..7e860139f4 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -84,7 +84,7 @@ void Xml2ObjectWidget::generateObject(void) obj_type!=ObjRelationship && obj_type!=ObjBaseRelationship) { model->addObject(object); - op_list->registerObject(object, Operation::OBJECT_CREATED, -1, model); + op_list->registerObject(object, Operation::ObjectCreated, -1, model); } xmlparser->restorePosition(); diff --git a/tests/src/roletest/roletest.cpp b/tests/src/roletest/roletest.cpp index d3d5824721..c0ab037a9b 100644 --- a/tests/src/roletest/roletest.cpp +++ b/tests/src/roletest/roletest.cpp @@ -34,12 +34,12 @@ void RoleTest::alterCommandEndsWithSemiColon(void) QString alter_cmd; role1.setName("role1"); - role1.setOption(Role::OP_SUPERUSER, true); + role1.setOption(Role::OpSuperuser, true); role2.setName("role2"); - role2.setOption(Role::OP_CREATEDB, false); - role2.setOption(Role::OP_CREATEROLE, false); - role2.setOption(Role::OP_LOGIN, false); + role2.setOption(Role::OpCreateDb, false); + role2.setOption(Role::OpCreateRole, false); + role2.setOption(Role::OpLogin, false); alter_cmd=role1.getAlterDefinition(&role2); alter_cmd.remove(QString("\n%1\n").arg(ParsersAttributes::DDL_END_TOKEN)); From 5b9a9cef08a9cbd96eab8513ae937cac0183e6ee Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 09:16:06 -0300 Subject: [PATCH 168/425] Static const attributes refactoring checkpoint --- crashhandler/src/crashhandlerform.cpp | 4 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 8 +- libpgmodeler_ui/src/baseobjectwidget.h | 11 +- libpgmodeler_ui/src/bugreportform.cpp | 4 +- libpgmodeler_ui/src/bugreportform.h | 2 +- libpgmodeler_ui/src/colorpickerwidget.cpp | 4 +- libpgmodeler_ui/src/colorpickerwidget.h | 2 +- libpgmodeler_ui/src/configurationform.cpp | 10 +- libpgmodeler_ui/src/configurationform.h | 12 +- .../src/connectionsconfigwidget.cpp | 18 +- libpgmodeler_ui/src/connectionsconfigwidget.h | 2 +- libpgmodeler_ui/src/constraintwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 244 +++++++++--------- libpgmodeler_ui/src/databaseexplorerwidget.h | 8 +- libpgmodeler_ui/src/databaseimportform.cpp | 58 ++--- libpgmodeler_ui/src/databaseimportform.h | 18 +- libpgmodeler_ui/src/mainwindow.cpp | 18 +- libpgmodeler_ui/src/sqltoolwidget.cpp | 2 +- libpgmodeler_ui/src/tablewidget.cpp | 4 +- 19 files changed, 217 insertions(+), 216 deletions(-) diff --git a/crashhandler/src/crashhandlerform.cpp b/crashhandler/src/crashhandlerform.cpp index 4321323c63..a8a57a5666 100644 --- a/crashhandler/src/crashhandlerform.cpp +++ b/crashhandler/src/crashhandlerform.cpp @@ -153,7 +153,7 @@ void CrashHandlerForm::loadReport(const QString &filename) //Showing the sections of the uncompressed buffer on the respective widgets while(i < buf_aux.size() && idx <= 2) { - if(buf_aux.at(i).toLatin1()!=CHR_DELIMITER) + if(buf_aux.at(i).toLatin1()!=CharDelimiter) str_aux.append(buf_aux.at(i)); else { @@ -251,7 +251,7 @@ QByteArray CrashHandlerForm::generateReportBuffer(void) { QByteArray buf=BugReportForm::generateReportBuffer(); buf.append(stack_txt->toPlainText().toUtf8()); - buf.append(CHR_DELIMITER); + buf.append(CharDelimiter); return(buf); } diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 78d3b48b35..160289c832 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -22,10 +22,10 @@ #include "baseform.h" #include "generalconfigwidget.h" -const QColor BaseObjectWidget::PROT_LINE_BGCOLOR=QColor(255,180,180); -const QColor BaseObjectWidget::PROT_LINE_FGCOLOR=QColor(80,80,80); -const QColor BaseObjectWidget::RELINC_LINE_BGCOLOR=QColor(164,249,176); -const QColor BaseObjectWidget::RELINC_LINE_FGCOLOR=QColor(80,80,80); +const QColor BaseObjectWidget::ProtRowBgColor=QColor(255,180,180); +const QColor BaseObjectWidget::ProtRowFgColor=QColor(80,80,80); +const QColor BaseObjectWidget::RelAddedRowBgColor=QColor(164,249,176); +const QColor BaseObjectWidget::RelAddedRowFgColor=QColor(80,80,80); BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidget(parent) { diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index df78a52117..e9e210b2ef 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -45,11 +45,12 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { Q_OBJECT protected: - static constexpr int MAX_OBJECT_SIZE=16777215; - static const QColor PROT_LINE_BGCOLOR, - PROT_LINE_FGCOLOR, - RELINC_LINE_BGCOLOR, - RELINC_LINE_FGCOLOR; + static constexpr int MaxObjectSize=16777215; + + static const QColor ProtRowBgColor, + ProtRowFgColor, + RelAddedRowBgColor, + RelAddedRowFgColor; bool object_protected; diff --git a/libpgmodeler_ui/src/bugreportform.cpp b/libpgmodeler_ui/src/bugreportform.cpp index 9cb68822a2..0cfa9b997c 100644 --- a/libpgmodeler_ui/src/bugreportform.cpp +++ b/libpgmodeler_ui/src/bugreportform.cpp @@ -69,11 +69,11 @@ QByteArray BugReportForm::generateReportBuffer(void) QByteArray buf; buf.append(actions_txt->toPlainText().toUtf8()); - buf.append(CHR_DELIMITER); + buf.append(CharDelimiter); if(attach_mod_chk->isChecked()) buf.append(model_txt->toPlainText().toUtf8()); - buf.append(CHR_DELIMITER); + buf.append(CharDelimiter); return(buf); } diff --git a/libpgmodeler_ui/src/bugreportform.h b/libpgmodeler_ui/src/bugreportform.h index e806cb5304..0b218f5552 100644 --- a/libpgmodeler_ui/src/bugreportform.h +++ b/libpgmodeler_ui/src/bugreportform.h @@ -38,7 +38,7 @@ class BugReportForm : public QDialog, public Ui::BugReportForm { protected: //! \brief Delimiter character which separates the sections of the compressed file - static constexpr char CHR_DELIMITER = static_cast(3); + static constexpr char CharDelimiter = static_cast(3); //! \brief Generates an uncompressed buffer based upon the data in fields virtual QByteArray generateReportBuffer(void); diff --git a/libpgmodeler_ui/src/colorpickerwidget.cpp b/libpgmodeler_ui/src/colorpickerwidget.cpp index c5b8a2769d..4ccdf52764 100644 --- a/libpgmodeler_ui/src/colorpickerwidget.cpp +++ b/libpgmodeler_ui/src/colorpickerwidget.cpp @@ -32,8 +32,8 @@ ColorPickerWidget::ColorPickerWidget(int color_count, QWidget * parent) : QWidge if(color_count==0) color_count=1; - else if(color_count > MAX_COLOR_BUTTONS) - color_count=MAX_COLOR_BUTTONS; + else if(color_count > MaxColorButtons) + color_count=MaxColorButtons; hbox=new QHBoxLayout(this); hbox->setContentsMargins(0,0,0,0); diff --git a/libpgmodeler_ui/src/colorpickerwidget.h b/libpgmodeler_ui/src/colorpickerwidget.h index 18f0e7e28d..a90cc84d6f 100644 --- a/libpgmodeler_ui/src/colorpickerwidget.h +++ b/libpgmodeler_ui/src/colorpickerwidget.h @@ -53,7 +53,7 @@ class ColorPickerWidget: public QWidget, public Ui::ColorPickerWidget { bool eventFilter(QObject *object, QEvent *event); public: - static constexpr int MAX_COLOR_BUTTONS=20; + static constexpr int MaxColorButtons=20; explicit ColorPickerWidget(int color_count, QWidget * parent = 0); diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index d727ad78f2..af23fd0375 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -33,7 +33,7 @@ ConfigurationForm::ConfigurationForm(QWidget *parent, Qt::WindowFlags f) : QDial appearance_conf, connections_conf, snippets_conf, plugins_conf}; - for(int i=GENERAL_CONF_WGT; i <= PLUGINS_CONF_WGT; i++) + for(int i=GeneralConfWgt; i <= PluginsConfWgt; i++) confs_stw->addWidget(wgt_list[i]); connect(icons_lst, SIGNAL(currentRowChanged(int)), confs_stw, SLOT(setCurrentIndex(int))); @@ -41,7 +41,7 @@ ConfigurationForm::ConfigurationForm(QWidget *parent, Qt::WindowFlags f) : QDial connect(apply_btn, SIGNAL(clicked(void)), this, SLOT(applyConfiguration(void))); connect(defaults_btn, SIGNAL(clicked(void)), this, SLOT(restoreDefaults(void))); - icons_lst->setCurrentRow(GENERAL_CONF_WGT); + icons_lst->setCurrentRow(GeneralConfWgt); } ConfigurationForm::~ConfigurationForm(void) @@ -51,7 +51,7 @@ ConfigurationForm::~ConfigurationForm(void) void ConfigurationForm::hideEvent(QHideEvent *) { - icons_lst->setCurrentRow(GENERAL_CONF_WGT); + icons_lst->setCurrentRow(GeneralConfWgt); } void ConfigurationForm::showEvent(QShowEvent *) @@ -87,7 +87,7 @@ void ConfigurationForm::applyConfiguration(void) { BaseConfigWidget *conf_wgt=nullptr; - for(int i=GENERAL_CONF_WGT; i <= SNIPPETS_CONF_WGT; i++) + for(int i=GeneralConfWgt; i <= SnippetsConfWgt; i++) { conf_wgt=qobject_cast(confs_stw->widget(i)); @@ -104,7 +104,7 @@ void ConfigurationForm::loadConfiguration(void) { BaseConfigWidget *config_wgt = nullptr; - for(int i=GENERAL_CONF_WGT; i <= PLUGINS_CONF_WGT; i++) + for(int i=GeneralConfWgt; i <= PluginsConfWgt; i++) { try { diff --git a/libpgmodeler_ui/src/configurationform.h b/libpgmodeler_ui/src/configurationform.h index b92bc46187..b81345ddb9 100644 --- a/libpgmodeler_ui/src/configurationform.h +++ b/libpgmodeler_ui/src/configurationform.h @@ -48,12 +48,12 @@ class ConfigurationForm: public QDialog, public Ui::ConfigurationForm { void showEvent(QShowEvent *); public: - static constexpr int GENERAL_CONF_WGT=0, - RELATIONSHIPS_CONF_WGT=1, - APPEARANCE_CONF_WGT=2, - CONNECTIONS_CONF_WGT=3, - SNIPPETS_CONF_WGT=4, - PLUGINS_CONF_WGT=5; + static constexpr int GeneralConfWgt=0, + RelationshipsConfWgt=1, + AppearanceConfWgt=2, + ConnectionsConfWgt=3, + SnippetsConfWgt=4, + PluginsConfWgt=5; ConfigurationForm(QWidget * parent = 0, Qt::WindowFlags f = 0); ~ConfigurationForm(void); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 91ddce9f48..3e5beb0357 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -22,7 +22,7 @@ vector ConnectionsConfigWidget::connections; map ConnectionsConfigWidget::config_params; -const QString ConnectionsConfigWidget::DEFAULT_FOR=QString("default-for-%1"); +const QString ConnectionsConfigWidget::DefaultFor=QString("default-for-%1"); ConnectionsConfigWidget::ConnectionsConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { @@ -151,10 +151,10 @@ void ConnectionsConfigWidget::loadConfiguration(void) conn->setConnectionParam(Connection::ParamOthers, itr->second[Connection::ParamOthers]); conn->setAutoBrowseDB(itr->second[ParsersAttributes::AUTO_BROWSE_DB]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OpDiff, itr->second[DEFAULT_FOR.arg(ParsersAttributes::DIFF)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OpExport, itr->second[DEFAULT_FOR.arg(ParsersAttributes::EXPORT)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OpImport, itr->second[DEFAULT_FOR.arg(ParsersAttributes::IMPORT)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OpValidation, itr->second[DEFAULT_FOR.arg(ParsersAttributes::VALIDATION)]==ParsersAttributes::_TRUE_); + conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(ParsersAttributes::DIFF)]==ParsersAttributes::_TRUE_); + conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(ParsersAttributes::EXPORT)]==ParsersAttributes::_TRUE_); + conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(ParsersAttributes::IMPORT)]==ParsersAttributes::_TRUE_); + conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(ParsersAttributes::VALIDATION)]==ParsersAttributes::_TRUE_); connections.push_back(conn); itr++; @@ -508,10 +508,10 @@ void ConnectionsConfigWidget::saveConfiguration(void) attribs[ParsersAttributes::AUTO_BROWSE_DB]=(conn->isAutoBrowseDB() ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::CONNECTION_TIMEOUT]=attribs[Connection::ParamConnTimeout]; - attribs[DEFAULT_FOR.arg(ParsersAttributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DEFAULT_FOR.arg(ParsersAttributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DEFAULT_FOR.arg(ParsersAttributes::DIFF)]=(conn->isDefaultForOperation(Connection::OpDiff) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DEFAULT_FOR.arg(ParsersAttributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DefaultFor.arg(ParsersAttributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DefaultFor.arg(ParsersAttributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DefaultFor.arg(ParsersAttributes::DIFF)]=(conn->isDefaultForOperation(Connection::OpDiff) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DefaultFor.arg(ParsersAttributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? ParsersAttributes::_TRUE_ : QString()); schparser.ignoreUnkownAttributes(true); config_params[GlobalAttributes::ConnectionsConf][ParsersAttributes::CONNECTIONS]+= diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.h b/libpgmodeler_ui/src/connectionsconfigwidget.h index 5827560db6..c371dedcd8 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.h +++ b/libpgmodeler_ui/src/connectionsconfigwidget.h @@ -37,7 +37,7 @@ class ConnectionsConfigWidget: public BaseConfigWidget, public Ui::ConnectionsCo HintTextWidget *auto_browse_ht, *default_for_ops_ht, *other_params_ht; - static const QString DEFAULT_FOR; + static const QString DefaultFor; //! \brief Stores the connections created by the user static vector connections; diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 45be31d3df..32eadbd5cf 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -204,9 +204,9 @@ void ConstraintWidget::addColumn(Column *column, unsigned col_id, int row) fonte.setItalic(true); if(column->isProtected()) - table_wgt->setRowFont(row, fonte, PROT_LINE_FGCOLOR, PROT_LINE_BGCOLOR); + table_wgt->setRowFont(row, fonte, ProtRowFgColor, ProtRowBgColor); else - table_wgt->setRowFont(row, fonte, RELINC_LINE_FGCOLOR, RELINC_LINE_BGCOLOR); + table_wgt->setRowFont(row, fonte, RelAddedRowFgColor, RelAddedRowBgColor); } } } diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 38b1b16061..47d1ef78c0 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -27,10 +27,10 @@ using namespace ParsersAttributes; -const QString DatabaseExplorerWidget::DEP_NOT_DEFINED=QString(); -const QString DatabaseExplorerWidget::DEP_NOT_FOUND=QT_TR_NOOP("(not found, OID: %1)"); -const QString DatabaseExplorerWidget::ELEM_SEPARATOR=QString("•"); -const QString DatabaseExplorerWidget::DEFAULT_SOURCE_CODE=QT_TR_NOOP("-- Source code not generated! Hit F7 or middle-click the item to load it. --"); +const QString DatabaseExplorerWidget::DepNotDefined=QString(); +const QString DatabaseExplorerWidget::DepNotFound=QT_TR_NOOP("(not found, OID: %1)"); +const QString DatabaseExplorerWidget::ElemSeparator=QString("•"); +const QString DatabaseExplorerWidget::DefaultSourceCode=QT_TR_NOOP("-- Source code not generated! Hit F7 or middle-click the item to load it. --"); const attribs_map DatabaseExplorerWidget::attribs_i18n { {ADMIN_ROLES, QT_TR_NOOP("Admin. roles")}, {ALIGNMENT, QT_TR_NOOP("Alignment")}, {ANALYZE_FUNC, QT_TR_NOOP("Analyze func.")}, @@ -192,8 +192,8 @@ DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) connect(objects_trw, &QTreeWidget::itemExpanded, [&](QTreeWidgetItem *item){ - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); - unsigned oid=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); + unsigned oid=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); if((obj_type==ObjSchema || obj_type==ObjTable || obj_type==ObjView) && oid > 0 && item->childCount() <= 1) { @@ -203,7 +203,7 @@ DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) connect(sort_by_name_tb, &QToolButton::clicked, [&]() { - sort_column = sort_by_name_tb->isChecked() ? 0 : DatabaseImportForm::OBJECT_ID; + sort_column = sort_by_name_tb->isChecked() ? 0 : DatabaseImportForm::ObjectId; objects_trw->sortByColumn(sort_column); }); @@ -240,12 +240,12 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) if(item) { - unsigned oid=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); - obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + unsigned oid=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); + obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); if(oid!=0 && (obj_type==ObjTable || obj_type==ObjView)) { - openDataGrid(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString(), + openDataGrid(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), item->text(0), obj_type!=ObjView); } } @@ -323,7 +323,7 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) if(attribs.count(ParsersAttributes::PERMISSION)!=0) - attribs[ParsersAttributes::PERMISSION]=Catalog::parseArrayValues(attribs[ParsersAttributes::PERMISSION]).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::PERMISSION]=Catalog::parseArrayValues(attribs[ParsersAttributes::PERMISSION]).join(ElemSeparator); //Removing system schemas from object's name if(attribs.count(ParsersAttributes::NAME)!=0 && @@ -393,7 +393,7 @@ void DatabaseExplorerWidget::formatOidAttribs(attribs_map &attribs, QStringList for(QString attr : oid_attrs) { names=getObjectsNames(obj_type, Catalog::parseArrayValues(attribs[attr])); - attribs[attr]=names.join(ELEM_SEPARATOR); + attribs[attr]=names.join(ElemSeparator); } } } @@ -415,7 +415,7 @@ void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatEventTriggerAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::VALUES]=Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES]).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::VALUES]=Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES]).join(ElemSeparator); attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjFunction, attribs[ParsersAttributes::FUNCTION]); } @@ -427,11 +427,11 @@ void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) formatOidAttribs(attribs, { ParsersAttributes::TYPES }, ObjType, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) - .arg(attribs[ParsersAttributes::TYPES])).replace(ELEM_SEPARATOR, QString(",")); + .arg(attribs[ParsersAttributes::TYPES])).replace(ElemSeparator, QString(",")); attribs[ParsersAttributes::STATE_TYPE]=getObjectName(ObjType, attribs[ParsersAttributes::STATE_TYPE]); attribs[ParsersAttributes::SORT_OP]=getObjectName(ObjOperator, attribs[ParsersAttributes::SORT_OP]); - attribs[ParsersAttributes::INITIAL_COND]=Catalog::parseArrayValues(attribs[ParsersAttributes::INITIAL_COND]).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::INITIAL_COND]=Catalog::parseArrayValues(attribs[ParsersAttributes::INITIAL_COND]).join(ElemSeparator); } void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) @@ -476,14 +476,14 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) { attribs[ParsersAttributes::LANGUAGE]=getObjectName(ObjLanguage, attribs[ParsersAttributes::LANGUAGE]); attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(ObjType, attribs[ParsersAttributes::RETURN_TYPE]); - attribs[ParsersAttributes::ARG_NAMES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_NAMES]).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::ARG_MODES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_MODES]).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::ARG_DEFAULTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_DEFAULTS]).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::ARG_NAMES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_NAMES]).join(ElemSeparator); + attribs[ParsersAttributes::ARG_MODES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_MODES]).join(ElemSeparator); + attribs[ParsersAttributes::ARG_DEFAULTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_DEFAULTS]).join(ElemSeparator); formatOidAttribs(attribs, { ParsersAttributes::ARG_TYPES }, ObjType, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) - .arg(attribs[ParsersAttributes::ARG_TYPES])).replace(ELEM_SEPARATOR, QString(",")); + .arg(attribs[ParsersAttributes::ARG_TYPES])).replace(ElemSeparator, QString(",")); formatBooleanAttribs(attribs, { ParsersAttributes::WINDOW_FUNC, ParsersAttributes::LEAKPROOF, @@ -508,7 +508,7 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2,%3)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME], true)) .arg(attribs[ParsersAttributes::LEFT_TYPE]) - .arg(attribs[ParsersAttributes::RIGHT_TYPE])).replace(ELEM_SEPARATOR, QString(",")); + .arg(attribs[ParsersAttributes::RIGHT_TYPE])).replace(ElemSeparator, QString(",")); } void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) @@ -526,12 +526,12 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) part_keys.push_back(getObjectsNames(ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]), getObjectName(ObjSchema, attribs[ParsersAttributes::SCHEMA]), - attribs[ParsersAttributes::NAME]).join(ELEM_SEPARATOR)); + attribs[ParsersAttributes::NAME]).join(ElemSeparator)); - part_keys.push_back(Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ELEM_SEPARATOR)); + part_keys.push_back(Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator)); part_keys.removeAll(QString()); - attribs[ParsersAttributes::PARTITION_KEY] = part_keys.join(ELEM_SEPARATOR); + attribs[ParsersAttributes::PARTITION_KEY] = part_keys.join(ElemSeparator); attribs.erase(ParsersAttributes::PART_KEY_COLLS); attribs.erase(ParsersAttributes::PART_KEY_OPCLS); attribs.erase(ParsersAttributes::PART_KEY_EXPRS); @@ -608,7 +608,7 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) if(attribs[ParsersAttributes::ENUMERATIONS].isEmpty()) attribs.erase(ParsersAttributes::ENUMERATIONS); else - attribs[ParsersAttributes::ENUMERATIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ENUMERATIONS]).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::ENUMERATIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ENUMERATIONS]).join(ElemSeparator); attribs.erase(ParsersAttributes::RANGE_ATTRIBS); if(!range_attr.isEmpty()) @@ -631,7 +631,7 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) fmt_attribs.push_back(list.join(QLatin1String(" "))); } - attribs[ParsersAttributes::TYPE_ATTRIBUTE]=fmt_attribs.join(ELEM_SEPARATOR); + attribs[ParsersAttributes::TYPE_ATTRIBUTE]=fmt_attribs.join(ElemSeparator); } else attribs.erase(ParsersAttributes::TYPE_ATTRIBUTE); @@ -656,7 +656,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(ObjFunction, list[1]))); } - attribs[ParsersAttributes::FUNCTION]=elems.join(ELEM_SEPARATOR); + attribs[ParsersAttributes::FUNCTION]=elems.join(ElemSeparator); elems.clear(); } @@ -673,7 +673,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) getObjectName(ObjOperator, list[2]))); } - attribs[ParsersAttributes::OPERATOR]=elems.join(ELEM_SEPARATOR); + attribs[ParsersAttributes::OPERATOR]=elems.join(ElemSeparator); elems.clear(); } } @@ -689,8 +689,8 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) ParsersAttributes::TRUNC_EVENT }); attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(ObjFunction, attribs[ParsersAttributes::TRIGGER_FUNC]); - attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS]).join(ELEM_SEPARATOR); - attribs[ParsersAttributes::COLUMNS]=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS]).join(ElemSeparator); + attribs[ParsersAttributes::COLUMNS]=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]).join(ElemSeparator); } void DatabaseExplorerWidget::formatRuleAttribs(attribs_map &attribs) @@ -722,10 +722,10 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) ParsersAttributes::NO_INHERIT }); attribs[ParsersAttributes::TYPE]=~types[attribs[ParsersAttributes::TYPE]]; attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjOpClass, - Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ELEM_SEPARATOR); + Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ElemSeparator); attribs[ParsersAttributes::SRC_COLUMNS]=getObjectsNames(ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::SRC_COLUMNS]), - names[0], names[1]).join(ELEM_SEPARATOR); + names[0], names[1]).join(ElemSeparator); if(constr_type==ConstraintType::foreign_key) { @@ -733,7 +733,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) names=attribs[ParsersAttributes::REF_TABLE].split('.'); attribs[ParsersAttributes::DST_COLUMNS]=getObjectsNames(ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::DST_COLUMNS]), - names[0], names[1]).join(ELEM_SEPARATOR); + names[0], names[1]).join(ElemSeparator); } else { @@ -754,9 +754,9 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) if(constr_type==ConstraintType::exclude) { - attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); attribs[ParsersAttributes::OPERATORS]=getObjectsNames(ObjOperator, - Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATORS])).join(ELEM_SEPARATOR); + Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATORS])).join(ElemSeparator); } else { @@ -775,21 +775,21 @@ void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { ParsersAttributes::UNIQUE }); - attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); attribs[ParsersAttributes::COLLATIONS]=getObjectsNames(ObjCollation, - Catalog::parseArrayValues(attribs[ParsersAttributes::COLLATIONS])).join(ELEM_SEPARATOR); + Catalog::parseArrayValues(attribs[ParsersAttributes::COLLATIONS])).join(ElemSeparator); attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjOpClass, - Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ELEM_SEPARATOR); + Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ElemSeparator); attribs[ParsersAttributes::COLUMNS]=getObjectsNames(ObjColumn, - Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]), names[0], names[1]).join(ELEM_SEPARATOR); + Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]), names[0], names[1]).join(ElemSeparator); } void DatabaseExplorerWidget::formatPolicyAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::ROLES] = getObjectsNames(ObjRole, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ELEM_SEPARATOR); + attribs[ParsersAttributes::ROLES] = getObjectsNames(ObjRole, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ElemSeparator); } QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) @@ -800,13 +800,13 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) attribs[ParsersAttributes::OID].isEmpty() || attribs[ParsersAttributes::OID]==QString("0") || attribs[ParsersAttributes::NAME].isEmpty()) - return(DEP_NOT_DEFINED); + return(DepNotDefined); else { ObjectType obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); attribs_map aux_attribs; QString oid=attribs[ParsersAttributes::OID], - obj_name=DEP_NOT_FOUND.arg(oid), sch_name; + obj_name=DepNotFound.arg(oid), sch_name; if(obj_type!=ObjType) obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME], obj_type==ObjOperator); @@ -870,7 +870,7 @@ QStringList DatabaseExplorerWidget::getObjectsNames(ObjectType obj_type, const Q try { if(oids.isEmpty()) - return(QStringList{ DEP_NOT_DEFINED }); + return(QStringList{ DepNotDefined }); else { vector attribs_vect; @@ -905,7 +905,7 @@ QString DatabaseExplorerWidget::getObjectName(ObjectType obj_type, const QString try { if(oid==QString("0") || oid.isEmpty()) - return(DEP_NOT_DEFINED); + return(DepNotDefined); else { attribs_map attribs=catalog.getObjectAttributes(obj_type, oid.toUInt(), sch_name, tab_name); @@ -961,9 +961,9 @@ void DatabaseExplorerWidget::listObjects(void) objects_trw->takeTopLevelItem(0); root->setText(0, connection.getConnectionId(true)); root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("server"))); - root->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, -1); - root->setData(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole, ObjBaseObject); - root->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); + root->setData(DatabaseImportForm::ObjectId, Qt::UserRole, -1); + root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, ObjBaseObject); + root->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); root->addChild(curr_root); objects_trw->addTopLevelItem(root); root->setExpanded(true); @@ -998,18 +998,18 @@ void DatabaseExplorerWidget::configureImportHelper(void) void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) { - if(item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).toInt() < 0) + if(item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).toInt() < 0) { updateItem(item->parent()); } - else if(QApplication::mouseButtons()==Qt::MiddleButton && item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toInt() >= 0) + else if(QApplication::mouseButtons()==Qt::MiddleButton && item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toInt() >= 0) { loadObjectSource(); } - else if(QApplication::mouseButtons()==Qt::RightButton && item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toInt() >= 0) + else if(QApplication::mouseButtons()==Qt::RightButton && item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toInt() >= 0) { - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); - unsigned obj_id=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); + unsigned obj_id=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); SnippetsConfigWidget::configureSnippetsMenu(&snippets_menu, { obj_type, ObjBaseObject }); @@ -1064,9 +1064,9 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) loadObjectSource(); else if(exec_action==show_data_action) { - openDataGrid(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString(), + openDataGrid(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), item->text(0), - item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()!=ObjView); + item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()!=ObjView); } else if(exec_action) handleSelectedSnippet(exec_action->text()); @@ -1077,15 +1077,15 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) { attribs_map attribs; QTreeWidgetItem *item=objects_trw->currentItem(); - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); loadObjectProperties(); - attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).value(); + attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); if(attribs.empty()) { - QString sch_name=item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString(), - tab_name=item->data(DatabaseImportForm::OBJECT_TABLE, Qt::UserRole).toString(); + QString sch_name=item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), + tab_name=item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString(); //Formatting a schema qualified "table" attribute for table children objects if(TableObject::isTableObject(obj_type) && !sch_name.isEmpty() && !tab_name.isEmpty()) @@ -1114,8 +1114,8 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) for(auto &attr : attribs) { - if(attr.second.contains(ELEM_SEPARATOR)) - attribs[attr.first]=attr.second.replace(ELEM_SEPARATOR,QString(",")); + if(attr.second.contains(ElemSeparator)) + attribs[attr.first]=attr.second.replace(ElemSeparator,QString(",")); } emit s_snippetShowRequested(SnippetsConfigWidget::getParsedSnippet(snip_id, attribs)); @@ -1126,7 +1126,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i if(!item) throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); QString obj_name=item->text(0); int idx=0, idx1=0; attribs_map attribs; @@ -1150,8 +1150,8 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i //Formatting the names attribs[ParsersAttributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjOperator); - attribs[ParsersAttributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::OBJECT_TABLE, Qt::UserRole).toString()); - attribs[ParsersAttributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString()); + attribs[ParsersAttributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); + attribs[ParsersAttributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); //For table objects the "table" attribute must be schema qualified if(obj_type!=ObjIndex && TableObject::isTableObject(obj_type)) @@ -1161,12 +1161,12 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i } //For operators and functions there must exist the signature attribute else if(obj_type==ObjOperator || obj_type==ObjFunction) - attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::NAME] + QString("(%1)").arg(types.join(ELEM_SEPARATOR)); + attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::NAME] + QString("(%1)").arg(types.join(ElemSeparator)); else if(obj_type==ObjCast) attribs[ParsersAttributes::SIGNATURE]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); else if(obj_type==ObjOpFamily || obj_type==ObjOpClass) { - attribs_map aux_attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).value(); + attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); attribs[ParsersAttributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[ParsersAttributes::NAME]).arg(aux_attribs[ParsersAttributes::INDEX_TYPE]); } else @@ -1175,7 +1175,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i * to construct DDL commands correctly for this kind of object */ if(obj_type==ObjView) { - attribs_map aux_attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).value(); + attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); if(aux_attribs[ParsersAttributes::MATERIALIZED] == ParsersAttributes::_TRUE_) { @@ -1201,11 +1201,11 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) try { - if(item && static_cast(item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt()) > 0) + if(item && static_cast(item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()) > 0) { - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); QString msg; - QString obj_name=item->data(DatabaseImportForm::OBJECT_NAME, Qt::UserRole).toString(); + QString obj_name=item->data(DatabaseImportForm::ObjectName, Qt::UserRole).toString(); //Roles and tablespaces can't be removed in cascade mode if(cascade && (obj_type==ObjRole || obj_type==ObjTablespace)) @@ -1230,7 +1230,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) attribs=extractAttributesFromItem(item); if(obj_type==ObjOperator || obj_type==ObjFunction) - attribs[ParsersAttributes::SIGNATURE].replace(ELEM_SEPARATOR, QChar(',')); + attribs[ParsersAttributes::SIGNATURE].replace(ElemSeparator, QChar(',')); //Generate the drop command schparser.ignoreEmptyAttributes(true); @@ -1247,14 +1247,14 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) //Updates the object count on the parent item parent=item->parent(); - if(parent && parent->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt()==0) + if(parent && parent->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()==0) { - unsigned cnt=parent->data(DatabaseImportForm::OBJECT_COUNT, Qt::UserRole).toUInt(); - ObjectType parent_type=static_cast(parent->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + unsigned cnt=parent->data(DatabaseImportForm::ObjectCount, Qt::UserRole).toUInt(); + ObjectType parent_type=static_cast(parent->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); cnt--; parent->setText(0, BaseObject::getTypeName(parent_type) + QString(" (%1)").arg(cnt)); - parent->setData(DatabaseImportForm::OBJECT_COUNT, Qt::UserRole, QVariant::fromValue(cnt)); + parent->setData(DatabaseImportForm::ObjectCount, Qt::UserRole, QVariant::fromValue(cnt)); } if(parent) @@ -1325,11 +1325,11 @@ void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade) { try { - if(item && static_cast(item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt()) > 0) + if(item && static_cast(item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()) > 0) { QString obj_name, sch_name; - obj_name=item->data(DatabaseImportForm::OBJECT_NAME, Qt::UserRole).toString(); - sch_name=BaseObject::formatName(item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString()); + obj_name=item->data(DatabaseImportForm::ObjectName, Qt::UserRole).toString(); + sch_name=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); truncateTable(sch_name, obj_name, cascade, connection); } } @@ -1342,11 +1342,11 @@ void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade) void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) { - if(item && item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toInt() >= 0) + if(item && item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toInt() >= 0) { QTreeWidgetItem *root=nullptr, *parent=nullptr, *aux_item=nullptr; - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); - unsigned obj_id=static_cast(item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt()); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); + unsigned obj_id=static_cast(item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()); QString sch_name, tab_name; vector gen_items; @@ -1358,8 +1358,8 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) { clearObjectProperties(); parent=item->parent(); - sch_name=item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString(); - tab_name=item->data(DatabaseImportForm::OBJECT_TABLE, Qt::UserRole).toString(); + sch_name=item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(); + tab_name=item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString(); if(parent) { @@ -1405,7 +1405,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) { aux_item=new QTreeWidgetItem(item); aux_item->setText(0, QString("...")); - aux_item->setData(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole, QVariant::fromValue(-1)); + aux_item->setData(DatabaseImportForm::ObjectOtherData, Qt::UserRole, QVariant::fromValue(-1)); } } @@ -1432,15 +1432,15 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) try { QTreeWidgetItem *item=objects_trw->currentItem(); - unsigned oid=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); + unsigned oid=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); if(oid != 0 || (item == objects_trw->topLevelItem(0))) { - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); attribs_map orig_attribs, fmt_attribs; //First, retrieve the attributes stored on the item as a result of a previous properties listing - orig_attribs=item->data(DatabaseImportForm::OBJECT_ATTRIBS, Qt::UserRole).value(); + orig_attribs=item->data(DatabaseImportForm::ObjectAttribs, Qt::UserRole).value(); //In case of the cached attributes are empty if(orig_attribs.empty() || force_reload) @@ -1477,8 +1477,8 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) } else { - QString tab_name=item->data(DatabaseImportForm::OBJECT_TABLE, Qt::UserRole).toString(), - sch_name=item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString(); + QString tab_name=item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString(), + sch_name=item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(); vector vect_attribs=catalog.getObjectsAttributes(obj_type, sch_name, tab_name, { oid }); if(!vect_attribs.empty()) @@ -1490,13 +1490,13 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) fmt_attribs.erase(ParsersAttributes::SIGNATURE); //Store the original attributes on the item to permit value replacements when using code snippets - item->setData(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole, QVariant::fromValue(orig_attribs)); + item->setData(DatabaseImportForm::ObjectOtherData, Qt::UserRole, QVariant::fromValue(orig_attribs)); //Store the attributes on the item to avoid repeatedly query the database - item->setData(DatabaseImportForm::OBJECT_ATTRIBS, Qt::UserRole, QVariant::fromValue(fmt_attribs)); + item->setData(DatabaseImportForm::ObjectAttribs, Qt::UserRole, QVariant::fromValue(fmt_attribs)); if(item != objects_trw->topLevelItem(0)) - item->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, DEFAULT_SOURCE_CODE); + item->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, DefaultSourceCode); catalog.closeConnection(); QApplication::restoreOverrideCursor(); @@ -1518,7 +1518,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) clearObjectProperties(); if(item && - ((item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toInt() >= 0) || + ((item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toInt() >= 0) || (item == objects_trw->topLevelItem(0)))) { attribs_map cached_attribs; @@ -1529,7 +1529,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) loadObjectProperties(force_reload); cached_attribs=item->data((raw_attrib_names_chk->isChecked() ? - DatabaseImportForm::OBJECT_OTHER_DATA : DatabaseImportForm::OBJECT_ATTRIBS), + DatabaseImportForm::ObjectOtherData : DatabaseImportForm::ObjectAttribs), Qt::UserRole).value(); properties_tbw->setSortingEnabled(false); @@ -1550,7 +1550,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) tab_item->setIcon(QPixmap(PgModelerUiNs::getIconPath("attribute"))); properties_tbw->setItem(row, 0, tab_item); - values=attrib.second.split(ELEM_SEPARATOR); + values=attrib.second.split(ElemSeparator); //Creating the value item if(values.size() >= 2) @@ -1573,7 +1573,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } } - cached_attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA,Qt::UserRole).value(); + cached_attribs=item->data(DatabaseImportForm::ObjectOtherData,Qt::UserRole).value(); if(cached_attribs[ParsersAttributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjConstraint) && item->childCount()==0) { @@ -1586,7 +1586,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) right-click them. */ src_item=new QTreeWidgetItem(item); - src_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); + src_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); src_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("column"))); src_item->setText(0, QString("%1(%2)") .arg(cached_attribs[ParsersAttributes::TABLE]) @@ -1597,7 +1597,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) src_item->setFlags(Qt::ItemIsEnabled); fk_item=new QTreeWidgetItem(item); - fk_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); + fk_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); fk_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referenced"))); fk_item->setText(0, QString("%1(%2)") .arg(cached_attribs[ParsersAttributes::REF_TABLE]) @@ -1610,12 +1610,12 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) else if(cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::unique) || cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::primary_key)) { - QStringList columns=cached_attribs[ParsersAttributes::SRC_COLUMNS].split(ELEM_SEPARATOR); + QStringList columns=cached_attribs[ParsersAttributes::SRC_COLUMNS].split(ElemSeparator); for(auto &col : columns) { src_item=new QTreeWidgetItem(item); - src_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); + src_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); src_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("column"))); src_item->setText(0, col); src_item->setFlags(Qt::ItemIsEnabled); @@ -1634,7 +1634,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) font.setItalic(true); refs_item->setFont(0, font); - refs_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); + refs_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); refs_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referrer"))); refs_item->setText(0, QString("%1 (%2)") .arg(attribs_i18n.at(ParsersAttributes::REFERRERS)) @@ -1643,7 +1643,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) for(QString tab_name : ref_tab_names) { tab_item=new QTreeWidgetItem(refs_item); - tab_item->setData(DatabaseImportForm::OBJECT_ID, Qt::UserRole, QVariant::fromValue(-1)); + tab_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); tab_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("table"))); tab_item->setText(0, tab_name); tab_item->setFlags(Qt::ItemIsEnabled); @@ -1651,7 +1651,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } } - emit s_sourceCodeShowRequested(item->data(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole).toString()); + emit s_sourceCodeShowRequested(item->data(DatabaseImportForm::ObjectSource, Qt::UserRole).toString()); properties_tbw->setSortingEnabled(true); properties_tbw->sortByColumn(0, Qt::AscendingOrder); @@ -1668,16 +1668,16 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) void DatabaseExplorerWidget::startObjectRename(QTreeWidgetItem *item) { - if(item && static_cast(item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt()) > 0) + if(item && static_cast(item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()) > 0) { - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); if(obj_type!=ObjCast && obj_type!=ObjDatabase) { item->setFlags(item->flags() | Qt::ItemIsEditable); objects_trw->openPersistentEditor(item); rename_item=item; - rename_item->setData(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole, rename_item->text(0)); + rename_item->setData(DatabaseImportForm::ObjectOtherData, Qt::UserRole, rename_item->text(0)); } } } @@ -1693,7 +1693,7 @@ void DatabaseExplorerWidget::finishObjectRename(void) QString rename_cmd; Connection conn=connection; attribs_map attribs=extractAttributesFromItem(rename_item); - ObjectType obj_type=static_cast(rename_item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + ObjectType obj_type=static_cast(rename_item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); objects_trw->closePersistentEditor(rename_item); attribs[ParsersAttributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjOperator); @@ -1727,7 +1727,7 @@ void DatabaseExplorerWidget::cancelObjectRename(void) { objects_trw->closePersistentEditor(rename_item); rename_item->setFlags(rename_item->flags() ^ Qt::ItemIsEditable); - rename_item->setText(0, rename_item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).toString()); + rename_item->setText(0, rename_item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).toString()); rename_item=nullptr; } } @@ -1741,13 +1741,13 @@ void DatabaseExplorerWidget::loadObjectSource(void) if(item == objects_trw->topLevelItem(0)) { QString n = item->text(0); - emit s_sourceCodeShowRequested(item->data(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole).toString()); + emit s_sourceCodeShowRequested(item->data(DatabaseImportForm::ObjectSource, Qt::UserRole).toString()); } else if(item) { - QString source=item->data(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole).toString(); + QString source=item->data(DatabaseImportForm::ObjectSource, Qt::UserRole).toString(); - if(source!=DEFAULT_SOURCE_CODE) + if(source!=DefaultSourceCode) { emit s_sourceCodeShowRequested(source); } @@ -1755,22 +1755,22 @@ void DatabaseExplorerWidget::loadObjectSource(void) { DatabaseModel dbmodel; DatabaseImportHelper import_hlp; - ObjectType obj_type=static_cast(item->data(DatabaseImportForm::OBJECT_TYPE, Qt::UserRole).toUInt()); + ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); QString sch_name, tab_name, name; QTreeWidgetItem *sch_item=nullptr; BaseObject *object=nullptr; BaseObject *schema=nullptr; - attribs_map attribs=item->data(DatabaseImportForm::OBJECT_OTHER_DATA, Qt::UserRole).value(); + attribs_map attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); bool is_column=false; - unsigned oid=item->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(), - db_oid=objects_trw->topLevelItem(0)->child(0)->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(), + unsigned oid=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(), + db_oid=objects_trw->topLevelItem(0)->child(0)->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(), sys_oid=0; int sbar_value=(objects_trw->verticalScrollBar() ? objects_trw->verticalScrollBar()->value() : 0); QApplication::setOverrideCursor(Qt::WaitCursor); - sch_name=item->data(DatabaseImportForm::OBJECT_SCHEMA, Qt::UserRole).toString(); - tab_name=item->data(DatabaseImportForm::OBJECT_TABLE, Qt::UserRole).toString(); - name=item->data(DatabaseImportForm::OBJECT_NAME, Qt::UserRole).toString(); + sch_name=item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(); + tab_name=item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString(); + name=item->data(DatabaseImportForm::ObjectName, Qt::UserRole).toString(); if(!sch_name.isEmpty() && obj_type!=ObjExtension) { @@ -1783,7 +1783,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) //Special case for columns. We will retrieve the table from database and then generate the code for the column if(obj_type==ObjColumn) { - oid=item->parent()->parent()->data(DatabaseImportForm::OBJECT_ID, Qt::UserRole).toUInt(); + oid=item->parent()->parent()->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); is_column=true; obj_type=ObjTable; } @@ -1839,7 +1839,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) { table_item=item->parent()->parent(); objects_trw->setCurrentItem(item->parent()->parent()); - table_item->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, getObjectSource(table, &dbmodel)); + table_item->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, getObjectSource(table, &dbmodel)); sch_item=table_item->parent()->parent(); schema=table->getSchema(); @@ -1867,17 +1867,17 @@ void DatabaseExplorerWidget::loadObjectSource(void) { if(!sch_item) sch_item=item->parent()->parent(); objects_trw->setCurrentItem(sch_item); - sch_item->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, getObjectSource(schema, &dbmodel)); + sch_item->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, getObjectSource(schema, &dbmodel)); } if(obj_type != ObjDatabase) { //Generating the code for the database itself and storing it in the first child of the root item in the tree objects_trw->setCurrentItem(objects_trw->topLevelItem(0)); - objects_trw->topLevelItem(0)->child(0)->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, getObjectSource(&dbmodel, &dbmodel)); + objects_trw->topLevelItem(0)->child(0)->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, getObjectSource(&dbmodel, &dbmodel)); } - item->setData(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole, source); + item->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, source); objects_trw->setCurrentItem(item); /* Restore the position of the scrollbar in the tree because the usage of setCurrentItem in previous lines @@ -1900,7 +1900,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) void DatabaseExplorerWidget::filterObjects(void) { DatabaseImportForm::filterObjects(objects_trw, filter_edt->text(), - (by_oid_chk->isChecked() ? DatabaseImportForm::OBJECT_ID : 0), false); + (by_oid_chk->isChecked() ? DatabaseImportForm::ObjectId : 0), false); } QString DatabaseExplorerWidget::getObjectSource(BaseObject *object, DatabaseModel *dbmodel) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.h b/libpgmodeler_ui/src/databaseexplorerwidget.h index b9ae5037b7..2eafb93f78 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.h +++ b/libpgmodeler_ui/src/databaseexplorerwidget.h @@ -34,10 +34,10 @@ class DatabaseExplorerWidget: public QWidget, public Ui::DatabaseExplorerWidget private: Q_OBJECT - static const QString DEP_NOT_DEFINED, - DEP_NOT_FOUND, - ELEM_SEPARATOR, - DEFAULT_SOURCE_CODE; + static const QString DepNotDefined, + DepNotFound, + ElemSeparator, + DefaultSourceCode; //! \brief Stores the translations of all used attributes at properties panel static const attribs_map attribs_i18n; diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index d76b19cd38..b1644cd2b4 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -259,7 +259,7 @@ bool DatabaseImportForm::hasCheckedItems(void) while(*itr && !selected) { //Only valid items (OID > 0) and with Checked state are considered as selected - selected=((*itr)->checkState(0)==Qt::Checked && (*itr)->data(OBJECT_ID, Qt::UserRole).value() > 0); + selected=((*itr)->checkState(0)==Qt::Checked && (*itr)->data(ObjectId, Qt::UserRole).value() > 0); ++itr; } @@ -278,21 +278,21 @@ void DatabaseImportForm::getCheckedItems(map> &obj_ while(*itr) { //If the item is checked and its OID is valid - if((*itr)->checkState(0)==Qt::Checked && (*itr)->data(OBJECT_ID, Qt::UserRole).value() > 0) + if((*itr)->checkState(0)==Qt::Checked && (*itr)->data(ObjectId, Qt::UserRole).value() > 0) { - obj_type=static_cast((*itr)->data(OBJECT_TYPE, Qt::UserRole).value()); + obj_type=static_cast((*itr)->data(ObjectTypeId, Qt::UserRole).value()); //If the object is not a column store it on general object list if(obj_type!=ObjColumn) - obj_oids[obj_type].push_back((*itr)->data(OBJECT_ID, Qt::UserRole).value()); + obj_oids[obj_type].push_back((*itr)->data(ObjectId, Qt::UserRole).value()); //If its a column else { //Get the table's oid from the parent item - tab_oid=(*itr)->parent()->parent()->data(OBJECT_ID, Qt::UserRole).value(); + tab_oid=(*itr)->parent()->parent()->data(ObjectId, Qt::UserRole).value(); //Store the column oid on the selected colums map using the table oid as key - col_oids[tab_oid].push_back((*itr)->data(OBJECT_ID, Qt::UserRole).value()); + col_oids[tab_oid].push_back((*itr)->data(ObjectId, Qt::UserRole).value()); } } @@ -416,7 +416,7 @@ void DatabaseImportForm::filterObjects(void) { DatabaseImportForm::filterObjects(db_objects_tw, filter_edt->text(), - (by_oid_chk->isChecked() ? OBJECT_ID : 0), false); + (by_oid_chk->isChecked() ? ObjectId : 0), false); } void DatabaseImportForm::filterObjects(QTreeWidget *tree_wgt, const QString &pattern, int search_column, bool sel_single_leaf) @@ -427,7 +427,7 @@ void DatabaseImportForm::filterObjects(QTreeWidget *tree_wgt, const QString &pat QList items; QTreeWidgetItemIterator itr(tree_wgt); - if(search_column == DatabaseImportForm::OBJECT_ID) + if(search_column == DatabaseImportForm::ObjectId) items = tree_wgt->findItems(QString("^(0)*(%1)(.)*").arg(pattern), Qt::MatchRegExp | Qt::MatchRecursive, search_column); else items = tree_wgt->findItems(pattern, Qt::MatchStartsWith | Qt::MatchRecursive, search_column); @@ -660,9 +660,9 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW db_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ObjDatabase))); attribs=catalog.getObjectsAttributes(ObjDatabase, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); - db_item->setData(OBJECT_ID, Qt::UserRole, attribs[0].at(ParsersAttributes::OID).toUInt()); - db_item->setData(OBJECT_TYPE, Qt::UserRole, ObjDatabase); - db_item->setData(OBJECT_TYPE, Qt::UserRole, ObjDatabase); + db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(ParsersAttributes::OID).toUInt()); + db_item->setData(ObjectTypeId, Qt::UserRole, ObjDatabase); + db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(ParsersAttributes::OID))); tree_wgt->addTopLevelItem(db_item); } @@ -678,7 +678,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { item=new QTreeWidgetItem(sch_items.back()); item->setText(0, QString("...")); - item->setData(OBJECT_OTHER_DATA, Qt::UserRole, QVariant::fromValue(-1)); + item->setData(ObjectOtherData, Qt::UserRole, QVariant::fromValue(-1)); sch_items.pop_back(); } } @@ -703,7 +703,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW aux_prog+=inc1; if(aux_prog > 99) aux_prog=99; - obj_type = static_cast(tab_items.back()->data(OBJECT_TYPE, Qt::UserRole).toUInt()); + obj_type = static_cast(tab_items.back()->data(ObjectTypeId, Qt::UserRole).toUInt()); task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of `%1' (%2)...").arg(tab_items.back()->text(0)).arg(BaseObject::getTypeName(obj_type)), obj_type); DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, BaseObject::getChildObjectTypes(obj_type), checkable_items, disable_empty_grps, @@ -773,11 +773,11 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe group->setFont(0, grp_fnt); //Group items does contains a zero valued id to indicate that is not a valide object - group->setData(OBJECT_ID, Qt::UserRole, 0); - group->setData(OBJECT_TYPE, Qt::UserRole, grp_type); - group->setData(OBJECT_COUNT, Qt::UserRole, 0); - group->setData(OBJECT_SCHEMA, Qt::UserRole, schema); - group->setData(OBJECT_TABLE, Qt::UserRole, table); + group->setData(ObjectId, Qt::UserRole, 0); + group->setData(ObjectTypeId, Qt::UserRole, grp_type); + group->setData(ObjectCount, Qt::UserRole, 0); + group->setData(ObjectSchema, Qt::UserRole, schema); + group->setData(ObjectTable, Qt::UserRole, table); gen_groups[grp_type]=group; groups_list.push_back(group); @@ -789,8 +789,8 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe { obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); group=gen_groups[obj_type]; - group->setData(OBJECT_COUNT, Qt::UserRole, - group->data(OBJECT_COUNT, Qt::UserRole).toUInt() + 1); + group->setData(ObjectCount, Qt::UserRole, + group->data(ObjectCount, Qt::UserRole).toUInt() + 1); //Creates individual items for each object of the current type oid=attribs[ParsersAttributes::OID].toUInt(); @@ -810,9 +810,9 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item=new QTreeWidgetItem(group); item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(obj_type))); item->setText(0, label); - item->setText(OBJECT_ID, attribs[ParsersAttributes::OID].rightJustified(10, '0')); - item->setData(OBJECT_ID, Qt::UserRole, attribs[ParsersAttributes::OID].toUInt()); - item->setData(OBJECT_NAME, Qt::UserRole, name); + item->setText(ObjectId, attribs[ParsersAttributes::OID].rightJustified(10, '0')); + item->setData(ObjectId, Qt::UserRole, attribs[ParsersAttributes::OID].toUInt()); + item->setData(ObjectName, Qt::UserRole, name); if(checkable_items) { @@ -847,7 +847,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe } //Stores the object's OID as the first data of the item - item->setData(OBJECT_ID, Qt::UserRole, oid); + item->setData(ObjectId, Qt::UserRole, oid); if(!item->toolTip(0).isEmpty()) item->setToolTip(0,item->toolTip(0) + QString("\n") + tooltip.arg(oid)); @@ -855,11 +855,11 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setToolTip(0,tooltip.arg(oid)); //Stores the object's type as the second data of the item - item->setData(OBJECT_TYPE, Qt::UserRole, obj_type); + item->setData(ObjectTypeId, Qt::UserRole, obj_type); //Stores the schema and the table's name of the object - item->setData(OBJECT_SCHEMA, Qt::UserRole, schema); - item->setData(OBJECT_TABLE, Qt::UserRole, table); + item->setData(ObjectSchema, Qt::UserRole, schema); + item->setData(ObjectTable, Qt::UserRole, table); if(obj_type==ObjSchema || obj_type == ObjTable || obj_type == ObjView) items_vect.push_back(item); @@ -869,8 +869,8 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe for(ObjectType grp_type : types) { group=gen_groups[grp_type]; - group->setDisabled(disable_empty_grps && group->data(OBJECT_COUNT, Qt::UserRole).toUInt() == 0); - group->setText(0, BaseObject::getTypeName(grp_type) + QString(" (%1)").arg(group->data(OBJECT_COUNT, Qt::UserRole).toUInt())); + group->setDisabled(disable_empty_grps && group->data(ObjectCount, Qt::UserRole).toUInt() == 0); + group->setText(0, BaseObject::getTypeName(grp_type) + QString(" (%1)").arg(group->data(ObjectCount, Qt::UserRole).toUInt())); if(checkable_items) { diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index ada092e406..108a79d98f 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -80,15 +80,15 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { public: //! \brief Constants used to access the tree widget items data - static constexpr unsigned OBJECT_ID=1, - OBJECT_TYPE=2, - OBJECT_NAME=3, - OBJECT_SCHEMA=4, - OBJECT_TABLE=5, - OBJECT_ATTRIBS=6, //Stores the object's attributes returned by catalog query - OBJECT_OTHER_DATA=7, //General purpose usage - OBJECT_COUNT=8, - OBJECT_SOURCE=9; //Only for gropus + static constexpr unsigned ObjectId=1, + ObjectTypeId=2, + ObjectName=3, + ObjectSchema=4, + ObjectTable=5, + ObjectAttribs=6, //Stores the object's attributes returned by catalog query + ObjectOtherData=7, //General purpose usage + ObjectCount=8, + ObjectSource=9; //Only for gropus DatabaseImportForm(QWidget * parent = 0, Qt::WindowFlags f = 0); ~DatabaseImportForm(void); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 8ee9dbc7cc..b20a8a103f 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -77,7 +77,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par PgModelerUiNs::resizeDialog(configuration_form); configuration_form->loadConfiguration(); - plugins_conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::PLUGINS_CONF_WGT)); + plugins_conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::PluginsConfWgt)); plugins_conf_wgt->installPluginsActions(nullptr, plugins_menu, this, SLOT(executePlugin(void))); plugins_menu->setEnabled(!plugins_menu->isEmpty()); action_plugins->setEnabled(!plugins_menu->isEmpty()); @@ -333,7 +333,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par showRightWidgetsBar(); showBottomWidgetsBar(); - GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GENERAL_CONF_WGT)); + GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); confs=conf_wgt->getConfigurationParams(); //If a previous session was restored save the temp models @@ -654,7 +654,7 @@ void MainWindow::closeEvent(QCloseEvent *event) attribs_map attribs; this->overview_wgt->close(); - conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GENERAL_CONF_WGT)); + conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); confs=conf_wgt->getConfigurationParams(); attribs[ParsersAttributes::COMPACT_VIEW]=action_compact_view->isChecked() ? ParsersAttributes::_TRUE_ : QString(); @@ -731,7 +731,7 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::updateConnections(bool force) { ConnectionsConfigWidget *conn_cfg_wgt= - dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::CONNECTIONS_CONF_WGT)); + dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::ConnectionsConfWgt)); if(force || (!force && (conn_cfg_wgt->isConfigurationChanged() || model_valid_wgt->connections_cmb->count()==0 || @@ -1138,7 +1138,7 @@ void MainWindow::setCurrentModel(void) void MainWindow::setGridOptions(void) { - GeneralConfigWidget *conf_wgt = dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GENERAL_CONF_WGT)); + GeneralConfigWidget *conf_wgt = dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); map attribs = conf_wgt->getConfigurationParams(); //Configures the global settings for the scene grid @@ -1285,7 +1285,7 @@ void MainWindow::applyConfigurations(void) int count, i; ModelWidget *model=nullptr; - conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GENERAL_CONF_WGT)); + conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); //Disable the auto save if the option is not checked if(!conf_wgt->autosave_interv_chk->isChecked()) @@ -1536,7 +1536,7 @@ void MainWindow::printModel(void) QRectF margins; QSizeF custom_size; qreal ml,mt,mr,mb, ml1, mt1, mr1, mb1; - GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GENERAL_CONF_WGT)); + GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); print_dlg.setOption(QAbstractPrintDialog::PrintCurrentPage, false); print_dlg.setWindowTitle(trUtf8("Database model printing")); @@ -1828,7 +1828,7 @@ void MainWindow::configureSamplesMenu(void) void MainWindow::storeDockWidgetsSettings(void) { - GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GENERAL_CONF_WGT)); + GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); attribs_map params; params[ParsersAttributes::VALIDATOR]=ParsersAttributes::_TRUE_; @@ -1856,7 +1856,7 @@ void MainWindow::storeDockWidgetsSettings(void) void MainWindow::restoreDockWidgetsSettings(void) { - GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GENERAL_CONF_WGT)); + GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); map confs=conf_wgt->getConfigurationParams(); if(confs.count(ParsersAttributes::VALIDATOR)) diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 027bce5c4b..7a16ec3654 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -69,7 +69,7 @@ SQLToolWidget::SQLToolWidget(QWidget * parent) : QWidget(parent) if(dbexplorer && dbexplorer->objects_trw->currentItem()) sourcecode_txt->setPlainText(dbexplorer->objects_trw->currentItem()-> - data(DatabaseImportForm::OBJECT_SOURCE, Qt::UserRole).toString()); + data(DatabaseImportForm::ObjectSource, Qt::UserRole).toString()); while(itr != sql_exec_wgts.end()) { diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 0d7beba47d..696a1ab288 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -601,9 +601,9 @@ void TableWidget::showObjectData(TableObject *object, int row) font.setItalic(true); if(object->isAddedByRelationship()) - tab->setRowFont(row, font, RELINC_LINE_FGCOLOR, RELINC_LINE_BGCOLOR); + tab->setRowFont(row, font, RelAddedRowFgColor, RelAddedRowBgColor); else - tab->setRowFont(row, font, PROT_LINE_FGCOLOR, PROT_LINE_BGCOLOR); + tab->setRowFont(row, font, ProtRowFgColor, ProtRowBgColor); } tab->setRowData(QVariant::fromValue(object), row); From 7b63e436ba877974c9e3cf2bb8c1b273d0efd28f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 09:44:26 -0300 Subject: [PATCH 169/425] Static const attributes refactoring checkpoint --- crashhandler/src/crashhandlerform.cpp | 2 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 2 +- libpgmodeler_ui/src/baseform.cpp | 6 +- libpgmodeler_ui/src/baseform.h | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 2 +- libpgmodeler_ui/src/bugreportform.cpp | 4 +- libpgmodeler_ui/src/configurationform.cpp | 6 +- .../src/connectionsconfigwidget.cpp | 6 +- .../src/databaseexplorerwidget.cpp | 6 +- libpgmodeler_ui/src/databaseimportform.cpp | 4 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 6 +- libpgmodeler_ui/src/databaseimporthelper.h | 2 +- libpgmodeler_ui/src/datamanipulationform.cpp | 80 +++++++++---------- libpgmodeler_ui/src/datamanipulationform.h | 10 +-- libpgmodeler_ui/src/generalconfigwidget.cpp | 8 +- libpgmodeler_ui/src/generalconfigwidget.h | 8 +- libpgmodeler_ui/src/hinttextwidget.cpp | 8 +- libpgmodeler_ui/src/hinttextwidget.h | 6 +- libpgmodeler_ui/src/mainwindow.cpp | 54 ++++++------- libpgmodeler_ui/src/mainwindow.h | 20 ++--- libpgmodeler_ui/src/messagebox.cpp | 22 ++--- libpgmodeler_ui/src/messagebox.h | 24 +++--- libpgmodeler_ui/src/modeldatabasediffform.cpp | 72 ++++++++--------- libpgmodeler_ui/src/modeldatabasediffform.h | 8 +- libpgmodeler_ui/src/modelfixform.cpp | 8 +- libpgmodeler_ui/src/modelfixform.h | 2 +- libpgmodeler_ui/src/modeloverviewwidget.cpp | 10 +-- libpgmodeler_ui/src/modeloverviewwidget.h | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 72 ++++++++--------- libpgmodeler_ui/src/modelsdiffhelper.h | 20 ++--- libpgmodeler_ui/src/modelwidget.cpp | 26 +++--- libpgmodeler_ui/src/modelwidget.h | 2 +- libpgmodeler_ui/src/numberedtexteditor.cpp | 2 +- libpgmodeler_ui/src/objectstablewidget.cpp | 4 +- libpgmodeler_ui/src/operationlistwidget.cpp | 8 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 4 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 6 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 6 +- libpgmodeler_ui/src/sqltoolwidget.cpp | 2 +- libpgmodeler_ui/src/tabledatawidget.cpp | 6 +- libpgmodeler_ui/src/tablewidget.cpp | 6 +- libpgmodeler_ui/src/updatenotifierwidget.cpp | 6 +- libpgmodeler_ui/src/viewwidget.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 20 ++--- main/src/application.cpp | 2 +- plugins/dummy/src/dummy.cpp | 2 +- 46 files changed, 293 insertions(+), 293 deletions(-) diff --git a/crashhandler/src/crashhandlerform.cpp b/crashhandler/src/crashhandlerform.cpp index a8a57a5666..997e9be705 100644 --- a/crashhandler/src/crashhandlerform.cpp +++ b/crashhandler/src/crashhandlerform.cpp @@ -125,7 +125,7 @@ void CrashHandlerForm::loadReport(const QString &filename) //Raises an error if the file could not be opened if(!input.isOpen()) - msgbox.show(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(filename), Messagebox::ERROR_ICON); + msgbox.show(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(filename), Messagebox::ErrorIcon); else { QByteArray uncomp_buf; diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index 8e70e967ba..6c83267d6d 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -137,7 +137,7 @@ void BaseConfigWidget::restoreDefaults(const QString &conf_id, bool silent) if(bkp_saved && !silent) { Messagebox msg_box; - msg_box.show(trUtf8("A backup of the previous settings was saved into %1!").arg(bkp_filename), Messagebox::INFO_ICON); + msg_box.show(trUtf8("A backup of the previous settings was saved into %1!").arg(bkp_filename), Messagebox::InfoIcon); } } } diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp index 9151f55a51..cfdc8a822a 100644 --- a/libpgmodeler_ui/src/baseform.cpp +++ b/libpgmodeler_ui/src/baseform.cpp @@ -26,7 +26,7 @@ BaseForm::BaseForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) void BaseForm::setButtonConfiguration(unsigned button_conf) { - if(button_conf==Messagebox::OK_CANCEL_BUTTONS) + if(button_conf==Messagebox::OkCancelButtons) { apply_ok_btn->setText(trUtf8("&Apply")); cancel_btn->setVisible(true); @@ -134,7 +134,7 @@ void BaseForm::setMainWidget(BaseObjectWidget *widget) apply_ok_btn->setDisabled(widget->isHandledObjectProtected()); resizeForm(widget); - setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + setButtonConfiguration(Messagebox::OkCancelButtons); connect(cancel_btn, SIGNAL(clicked(bool)), widget, SLOT(cancelConfiguration())); connect(cancel_btn, SIGNAL(clicked(bool)), this, SLOT(reject())); @@ -148,7 +148,7 @@ void BaseForm::setMainWidget(QWidget *widget) setWindowTitle(widget->windowTitle()); resizeForm(widget); - setButtonConfiguration(Messagebox::OK_BUTTON); + setButtonConfiguration(Messagebox::OkButton); connect(cancel_btn, SIGNAL(clicked(bool)), this, SLOT(reject())); connect(apply_ok_btn, SIGNAL(clicked(bool)), this, SLOT(accept())); diff --git a/libpgmodeler_ui/src/baseform.h b/libpgmodeler_ui/src/baseform.h index 488fc17071..9b94696bc0 100644 --- a/libpgmodeler_ui/src/baseform.h +++ b/libpgmodeler_ui/src/baseform.h @@ -47,7 +47,7 @@ class BaseForm: public QDialog, public Ui::BaseForm { public: BaseForm(QWidget * parent = 0, Qt::WindowFlags f = 0); - void setButtonConfiguration(unsigned button_conf=Messagebox::OK_CANCEL_BUTTONS); + void setButtonConfiguration(unsigned button_conf=Messagebox::OkCancelButtons); /*! \brief Injects the specified object into the form and turns it the main widget. The widget is reparented to the stack widget within the form */ diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 160289c832..bae88b7438 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -670,7 +670,7 @@ void BaseObjectWidget::editPermissions(void) permission_wgt->setAttributes(this->model, parent_obj, this->object); parent_form.setMainWidget(permission_wgt); - parent_form.setButtonConfiguration(Messagebox::OK_BUTTON); + parent_form.setButtonConfiguration(Messagebox::OkButton); GeneralConfigWidget::restoreWidgetGeometry(&parent_form, permission_wgt->metaObject()->className()); parent_form.exec(); diff --git a/libpgmodeler_ui/src/bugreportform.cpp b/libpgmodeler_ui/src/bugreportform.cpp index 0cfa9b997c..5d21da9201 100644 --- a/libpgmodeler_ui/src/bugreportform.cpp +++ b/libpgmodeler_ui/src/bugreportform.cpp @@ -103,7 +103,7 @@ void BugReportForm::generateReport(const QByteArray &buf) output.open(QFile::WriteOnly); if(!output.isOpen()) - msgbox.show(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), Messagebox::ERROR_ICON); + msgbox.show(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), Messagebox::ErrorIcon); else { QByteArray comp_buf; @@ -116,7 +116,7 @@ void BugReportForm::generateReport(const QByteArray &buf) output.close(); msgbox.show(trUtf8("Bug report successfuly generated! Please, send the file %1 to %2 in order be analyzed. Thank you for the collaboration!").arg(filename).arg(GlobalAttributes::BugReportEmail), - Messagebox::INFO_ICON); + Messagebox::InfoIcon); } } diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index af23fd0375..46a3caffb7 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -123,7 +123,7 @@ void ConfigurationForm::loadConfiguration(void) { Exception ex = Exception(Exception::getErrorMessage(ConfigurationNotLoaded).arg(e.getExtraInfo()),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); msg_box.show(ex, QString("%1 %2").arg(ex.getErrorMessage()).arg(trUtf8("In some cases restore the default settings related to it may solve the problem. Would like to do that?")), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS, trUtf8("Restore"), QString(), QString(), PgModelerUiNs::getIconPath("atualizar")); + Messagebox::AlertIcon, Messagebox::YesNoButtons, trUtf8("Restore"), QString(), QString(), PgModelerUiNs::getIconPath("atualizar")); if(msg_box.result() == QDialog::Accepted) config_wgt->restoreDefaults(); @@ -136,8 +136,8 @@ void ConfigurationForm::restoreDefaults(void) { Messagebox msg_box; msg_box.show(trUtf8("Any modification made until now in the current section will be lost! Do you really want to restore default settings?"), - Messagebox::CONFIRM_ICON, - Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, + Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) qobject_cast(confs_stw->currentWidget())->restoreDefaults(); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 3e5beb0357..4241e6200d 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -438,7 +438,7 @@ void ConnectionsConfigWidget::testConnection(void) PgModelerUiNs::formatMessage(trUtf8("Connection successfully established!\n\nServer details:\n\nPID: `%1'\nProtocol: `%2'\nVersion: `%3'")) .arg(srv_info[Connection::ServerPid]) .arg(srv_info[Connection::ServerProtocol]) - .arg(srv_info[Connection::ServerVersion]), Messagebox::INFO_ICON); + .arg(srv_info[Connection::ServerVersion]), Messagebox::InfoIcon); } catch(Exception &e) { @@ -483,7 +483,7 @@ void ConnectionsConfigWidget::saveConfiguration(void) Messagebox msg_box; msg_box.show(trUtf8("There is a connection being created or edited! Do you want to save it?"), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) handleConnection(); @@ -612,7 +612,7 @@ bool ConnectionsConfigWidget::openConnectionsConfiguration(QComboBox *combo, boo conn_cfg_wgt.frame->layout()->setContentsMargins(2,2,2,2); parent_form.setMainWidget(&conn_cfg_wgt); - parent_form.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + parent_form.setButtonConfiguration(Messagebox::OkCancelButtons); parent_form.exec(); if(parent_form.result()==QDialog::Accepted) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 47d1ef78c0..7968058dfa 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1218,7 +1218,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) msg=trUtf8("Do you really want to cascade drop the object %1 (%2)? This action will drop all the other objects that depends on it.") .arg(obj_name).arg(BaseObject::getTypeName(obj_type)); - msg_box.show(msg, Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + msg_box.show(msg, Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { @@ -1285,7 +1285,7 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin msg=trUtf8("Do you really want to truncate in cascade mode the table %1.%2? This action will truncate all the tables that depends on it?").arg(sch_name).arg(obj_name); msg_box.setCustomOptionText(trUtf8("Also restart sequences")); - msg_box.show(msg, Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + msg_box.show(msg, Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { @@ -1950,7 +1950,7 @@ void DatabaseExplorerWidget::dropDatabase(void) msg_box.show(trUtf8("Warning"), trUtf8("CAUTION: You are about to drop the entire database %1 from the server %2! All data will be completely wiped out. Do you really want to proceed?") .arg(dbname).arg(connection.getConnectionId(true)), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index b1644cd2b4..b2059ec691 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -192,7 +192,7 @@ void DatabaseImportForm::importDatabase(void) if(import_to_model_chk->isChecked()) { msg_box.show(trUtf8("ATTENTION: You are about to import objects to the current working model! This action will cause irreversible changes to it even in case of critical errors during the process. Do you want to proceed?"), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Rejected) return; @@ -522,7 +522,7 @@ void DatabaseImportForm::handleImportFinished(Exception e) if(!e.getErrorMessage().isEmpty()) { Messagebox msgbox; - msgbox.show(e, e.getErrorMessage(), Messagebox::ALERT_ICON); + msgbox.show(e, e.getErrorMessage(), Messagebox::AlertIcon); } model_wgt->rearrangeSchemasInGrid(); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 7b1519e987..499c452074 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -18,7 +18,7 @@ #include "databaseimporthelper.h" -const QString DatabaseImportHelper::UNKNOWN_OBJECT_OID_XML=QString("\t\n"); +const QString DatabaseImportHelper::UnkownObjectOidXml=QString("\t\n"); DatabaseImportHelper::DatabaseImportHelper(QObject *parent) : QObject(parent) { @@ -843,7 +843,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType else /* If the object oid is valid but there is no attribute set to it creates a xml definition containing an alert indicating that the object is unknown */ - xml_def=QString(UNKNOWN_OBJECT_OID_XML).arg(oid); + xml_def=QString(UnkownObjectOidXml).arg(oid); } return(xml_def); @@ -1710,7 +1710,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(auto_resolve_deps && !is_type_registered && !type_name.contains(QString("[]"))) { type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjType); - unknown_obj_xml=UNKNOWN_OBJECT_OID_XML.arg(type_oid); + unknown_obj_xml=UnkownObjectOidXml.arg(type_oid); /* If the type still doesn't exists means that the column maybe is referencing a domain this way pgModeler will try to retrieve the mentionend object */ diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 02441acae5..09ab313c06 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -38,7 +38,7 @@ class DatabaseImportHelper: public QObject { //! \brief Random number generator engine used to generate random colors for imported schemas default_random_engine rand_num_engine; - static const QString UNKNOWN_OBJECT_OID_XML; + static const QString UnkownObjectOidXml; /*! \brief File handle to log the import process. This file is opened for writing only when the 'ignore_errors' is true */ diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index e77c81fe0d..a644c32728 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -26,13 +26,13 @@ #include "databaseexplorerwidget.h" #include "generalconfigwidget.h" -const QColor DataManipulationForm::ROW_COLORS[3]={ QColor(QString("#C0FFC0")), QColor(QString("#FFFFC0")), QColor(QString("#FFC0C0")) }; +const QColor DataManipulationForm::RowColors[3]={ QColor(QString("#C0FFC0")), QColor(QString("#FFFFC0")), QColor(QString("#FFC0C0")) }; bool DataManipulationForm::has_csv_clipboard=false; -constexpr unsigned DataManipulationForm::NO_OPERATION; -constexpr unsigned DataManipulationForm::OP_INSERT; -constexpr unsigned DataManipulationForm::OP_UPDATE; -constexpr unsigned DataManipulationForm::OP_DELETE; +constexpr unsigned DataManipulationForm::NoOperation; +constexpr unsigned DataManipulationForm::OpInsert; +constexpr unsigned DataManipulationForm::OpUpdate; +constexpr unsigned DataManipulationForm::OpDelete; DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): QDialog(parent, f) { @@ -334,7 +334,7 @@ void DataManipulationForm::retrieveData(void) if(!changed_rows.empty()) { msg_box.show(trUtf8("WARNING: There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now?"), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Rejected) return; @@ -909,18 +909,18 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin void DataManipulationForm::markOperationOnRow(unsigned operation, int row) { if(row < results_tbw->rowCount() && - (operation==NO_OPERATION || results_tbw->verticalHeaderItem(row)->data(Qt::UserRole)!=OP_INSERT)) + (operation==NoOperation || results_tbw->verticalHeaderItem(row)->data(Qt::UserRole)!=OpInsert)) { QTableWidgetItem *item=nullptr, *header_item=results_tbw->verticalHeaderItem(row); QString tooltip=trUtf8("This row is marked to be %1"); QFont fnt=results_tbw->font(); int marked_cols=0; - if(operation==OP_DELETE) + if(operation==OpDelete) tooltip=tooltip.arg(trUtf8("deleted")); - else if(operation==OP_UPDATE) + else if(operation==OpUpdate) tooltip=tooltip.arg(trUtf8("updated")); - else if(operation==OP_INSERT) + else if(operation==OpInsert) tooltip=tooltip.arg(trUtf8("inserted")); else tooltip.clear(); @@ -936,24 +936,24 @@ void DataManipulationForm::markOperationOnRow(unsigned operation, int row) item->setToolTip(tooltip); //Restore the item's font and text when the operation is delete or none - if(operation==NO_OPERATION || operation==OP_DELETE) + if(operation==NoOperation || operation==OpDelete) { item->setFont(fnt); item->setText(item->data(Qt::UserRole).toString()); } - if(operation==NO_OPERATION) + if(operation==NoOperation) //Restore the item's background item->setBackground(prev_row_colors[row]); else { //Saves the item's background if it isn't already marked - if(header_item->data(Qt::UserRole)!=OP_DELETE && - header_item->data(Qt::UserRole)!=OP_UPDATE) + if(header_item->data(Qt::UserRole)!=OpDelete && + header_item->data(Qt::UserRole)!=OpUpdate) prev_row_colors[row]=item->background(); //Changes the item's background according to the operation - item->setBackground(ROW_COLORS[operation - 1]); + item->setBackground(RowColors[operation - 1]); } marked_cols++; @@ -964,12 +964,12 @@ void DataManipulationForm::markOperationOnRow(unsigned operation, int row) { auto itr=std::find(changed_rows.begin(), changed_rows.end(), row); - if(operation==NO_OPERATION && itr!=changed_rows.end()) + if(operation==NoOperation && itr!=changed_rows.end()) { changed_rows.erase(std::find(changed_rows.begin(), changed_rows.end(), row)); prev_row_colors.erase(row); } - else if(operation!=NO_OPERATION && itr==changed_rows.end()) + else if(operation!=NoOperation && itr==changed_rows.end()) changed_rows.push_back(row); header_item->setData(Qt::UserRole, operation); @@ -984,7 +984,7 @@ void DataManipulationForm::markOperationOnRow(unsigned operation, int row) void DataManipulationForm::markUpdateOnRow(QTableWidgetItem *item) { - if(results_tbw->verticalHeaderItem(item->row())->data(Qt::UserRole)!=OP_INSERT) + if(results_tbw->verticalHeaderItem(item->row())->data(Qt::UserRole)!=OpInsert) { bool items_changed=false; QTableWidgetItem *aux_item=nullptr; @@ -1003,7 +1003,7 @@ void DataManipulationForm::markUpdateOnRow(QTableWidgetItem *item) fnt.setBold(items_changed); item->setFont(fnt); - markOperationOnRow((items_changed ? OP_UPDATE : NO_OPERATION), item->row()); + markOperationOnRow((items_changed ? OpUpdate : NoOperation), item->row()); } } @@ -1019,10 +1019,10 @@ void DataManipulationForm::markDeleteOnRows(void) { item=results_tbw->verticalHeaderItem(row); - if(item->data(Qt::UserRole)==OP_INSERT) + if(item->data(Qt::UserRole)==OpInsert) ins_rows.push_back(row); else - markOperationOnRow(OP_DELETE, row); + markOperationOnRow(OpDelete, row); } } @@ -1057,7 +1057,7 @@ void DataManipulationForm::addRow(bool focus_new_row) results_tbw->setVerticalHeaderItem(row, new QTableWidgetItem(QString::number(row + 1))); results_tbw->blockSignals(false); - markOperationOnRow(OP_INSERT, row); + markOperationOnRow(OpInsert, row); item=results_tbw->item(row, 0); hint_frm->setVisible(true); @@ -1103,7 +1103,7 @@ void DataManipulationForm::removeNewRows(const vector &ins_rows) //Mark the rows as no-op to remove their indexes from changed rows set for(idx=0; idx < cnt; idx++) - markOperationOnRow(NO_OPERATION, ins_rows[idx]); + markOperationOnRow(NoOperation, ins_rows[idx]); //Remove the rows for(idx=0; idx < cnt; idx++) @@ -1199,7 +1199,7 @@ void DataManipulationForm::undoOperations(void) { for(int row=sel_range[0].topRow(); row <= sel_range[0].bottomRow(); row++) { - if(results_tbw->verticalHeaderItem(row)->data(Qt::UserRole).toUInt()==OP_INSERT) + if(results_tbw->verticalHeaderItem(row)->data(Qt::UserRole).toUInt()==OpInsert) ins_rows.push_back(row); else rows.push_back(row); @@ -1215,22 +1215,22 @@ void DataManipulationForm::undoOperations(void) for(auto &row : rows) { item=results_tbw->verticalHeaderItem(row); - if(item->data(Qt::UserRole).toUInt()!=OP_INSERT) - markOperationOnRow(NO_OPERATION, row); + if(item->data(Qt::UserRole).toUInt()!=OpInsert) + markOperationOnRow(NoOperation, row); } //If there is no selection, remove all new rows if(sel_range.isEmpty()) { if(results_tbw->rowCount() > 0 && - results_tbw->verticalHeaderItem(results_tbw->rowCount()-1)->data(Qt::UserRole)==OP_INSERT) + results_tbw->verticalHeaderItem(results_tbw->rowCount()-1)->data(Qt::UserRole)==OpInsert) { do { results_tbw->removeRow(results_tbw->rowCount()-1); item=results_tbw->verticalHeaderItem(results_tbw->rowCount()-1); } - while(item && item->data(Qt::UserRole)==OP_INSERT); + while(item && item->data(Qt::UserRole)==OpInsert); } clearChangedRows(); @@ -1270,8 +1270,8 @@ void DataManipulationForm::saveChanges(void) Messagebox msg_box; msg_box.show(trUtf8("WARNING: Once commited its not possible to undo the changes! Proceed with saving?"), - Messagebox::ALERT_ICON, - Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, + Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { @@ -1300,9 +1300,9 @@ void DataManipulationForm::saveChanges(void) } catch(Exception &e) { - map op_names={{ OP_DELETE, trUtf8("delete") }, - { OP_UPDATE, trUtf8("update") }, - { OP_INSERT, trUtf8("insert") }}; + map op_names={{ OpDelete, trUtf8("delete") }, + { OpUpdate, trUtf8("update") }, + { OpInsert, trUtf8("insert") }}; QString tab_name=QString("%1.%2") .arg(schema_cmb->currentText()) @@ -1342,7 +1342,7 @@ QString DataManipulationForm::getDMLCommand(int row) QString col_name, value; QVariant data; - if(op_type==OP_DELETE || op_type==OP_UPDATE) + if(op_type==OpDelete || op_type==OpUpdate) { if(pk_col_names.isEmpty()) { @@ -1366,13 +1366,13 @@ QString DataManipulationForm::getDMLCommand(int row) } } - if(op_type==OP_DELETE) + if(op_type==OpDelete) { fmt_cmd=QString(del_cmd).arg(tab_name).arg(flt_list.join(QString(" AND "))); } - else if(op_type==OP_UPDATE || op_type==OP_INSERT) + else if(op_type==OpUpdate || op_type==OpInsert) { - fmt_cmd=(op_type==OP_UPDATE ? upd_cmd : ins_cmd); + fmt_cmd=(op_type==OpUpdate ? upd_cmd : ins_cmd); for(int col=0; col < results_tbw->columnCount(); col++) { @@ -1384,7 +1384,7 @@ QString DataManipulationForm::getDMLCommand(int row) value=item->text(); col_name=results_tbw->horizontalHeaderItem(col)->text(); - if(op_type==OP_INSERT || (op_type==OP_UPDATE && value!=item->data(Qt::UserRole))) + if(op_type==OpInsert || (op_type==OpUpdate && value!=item->data(Qt::UserRole))) { //Checking if the value is a malformed unescaped value, e.g., {value, value}, {value\} if((value.startsWith(PgModelerNs::UnescValueStart) && value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd)) || @@ -1416,7 +1416,7 @@ QString DataManipulationForm::getDMLCommand(int row) value=QString("E'") + value + QString("'"); } - if(op_type==OP_INSERT) + if(op_type==OpInsert) val_list.push_back(value); else val_list.push_back(QString("\"%1\"=%2").arg(col_name).arg(value)); @@ -1428,7 +1428,7 @@ QString DataManipulationForm::getDMLCommand(int row) return(QString()); else { - if(op_type==OP_UPDATE) + if(op_type==OpUpdate) fmt_cmd=fmt_cmd.arg(tab_name).arg(val_list.join(QString(", "))).arg(flt_list.join(QString(" AND "))); else fmt_cmd=fmt_cmd.arg(tab_name).arg(col_list.join(QString(", "))).arg(val_list.join(QString(", "))); diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index a3213fed0b..e0dbdf674e 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -36,13 +36,13 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { Q_OBJECT //! \brief Constants used to mark the type of operation performed on rows - static constexpr unsigned NO_OPERATION=0, - OP_INSERT=1, - OP_UPDATE=2, - OP_DELETE=3; + static constexpr unsigned NoOperation=0, + OpInsert=1, + OpUpdate=2, + OpDelete=3; //! \brief Default row colors for each operation type - static const QColor ROW_COLORS[3]; + static const QColor RowColors[3]; static bool has_csv_clipboard; diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 5a764ca3be..3a756de6fc 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -490,7 +490,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]=(show_delim ? ParsersAttributes::_TRUE_ : QString()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::ALIGN_OBJS_TO_GRID]=(align_grid ? ParsersAttributes::_TRUE_ : QString()); - unity_cmb->setCurrentIndex(UNIT_MILIMETERS); + unity_cmb->setCurrentIndex(UnitMilimeters); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_MARGIN]=QString("%1,%2,%3,%4").arg(left_marg->value()) .arg(top_marg->value()) .arg(right_marg->value()) @@ -601,7 +601,7 @@ void GeneralConfigWidget::applyConfiguration(void) if(!save_restore_geometry_chk->isChecked()) widgets_geom.clear(); - unity_cmb->setCurrentIndex(UNIT_POINT); + unity_cmb->setCurrentIndex(UnitPoint); ObjectsScene::setPaperConfiguration(static_cast(paper_cmb->itemData(paper_cmb->currentIndex()).toInt()), (portrait_rb->isChecked() ? QPrinter::Portrait : QPrinter::Landscape), QRectF(left_marg->value(), top_marg->value(), right_marg->value(), bottom_marg->value()), @@ -661,7 +661,7 @@ void GeneralConfigWidget::restoreDefaults(void) void GeneralConfigWidget::convertMarginUnity(void) { - static int prev_unity=UNIT_MILIMETERS; + static int prev_unity=UnitMilimeters; double conv_factor[]={1.0f, 2.83f, 0.04f, 0.1f}, left, right, top, bottom, width, height; @@ -735,7 +735,7 @@ void GeneralConfigWidget::resetDialogsSizes(void) { Messagebox msg_box; msg_box.show(trUtf8("This action will reset all dialogs to their default size and positions on the screen! Do you really want to proceed?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result() == QDialog::Accepted) widgets_geom.clear(); diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index f8492057c7..4579b08dfb 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -54,10 +54,10 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg static map config_params; - static constexpr unsigned UNIT_MILIMETERS=0, - UNIT_POINT=1, - UNIT_INCHS=2, - UNIT_CENTIMETERS=3; + static constexpr unsigned UnitMilimeters=0, + UnitPoint=1, + UnitInches=2, + UnitCentimeters=3; HintTextWidget *simp_obj_creation_ht, *confirm_validation_ht, *corner_move_ht, *save_last_pos_ht, *invert_rangesel_ht, *disable_smooth_ht, diff --git a/libpgmodeler_ui/src/hinttextwidget.cpp b/libpgmodeler_ui/src/hinttextwidget.cpp index 9879f3d1eb..bfa1fc9610 100644 --- a/libpgmodeler_ui/src/hinttextwidget.cpp +++ b/libpgmodeler_ui/src/hinttextwidget.cpp @@ -53,7 +53,7 @@ HintTextWidget::HintTextWidget(QWidget *btn_parent, QWidget *parent): QWidget(pa parent->installEventFilter(this); - setIconSize(SMALL_ICON); + setIconSize(SmallIcon); connect(hint_tb, SIGNAL(toggled(bool)), this, SLOT(setVisible(bool))); } @@ -116,9 +116,9 @@ void HintTextWidget::setText(const QString &text) void HintTextWidget::setIconSize(unsigned icon_sz) { if(icon_sz==0) - icon_sz=SMALL_ICON; - else if(icon_sz > LARGE_ICON) - icon_sz=LARGE_ICON; + icon_sz=SmallIcon; + else if(icon_sz > LargeIcon) + icon_sz=LargeIcon; hint_tb->setMaximumSize(icon_sz + 8, icon_sz + 8); hint_tb->setIconSize(QSize(icon_sz, icon_sz)); diff --git a/libpgmodeler_ui/src/hinttextwidget.h b/libpgmodeler_ui/src/hinttextwidget.h index e0921d138e..75306602da 100644 --- a/libpgmodeler_ui/src/hinttextwidget.h +++ b/libpgmodeler_ui/src/hinttextwidget.h @@ -44,9 +44,9 @@ class HintTextWidget: public QWidget, public Ui::HintTextWidget { void showEvent(QShowEvent *); public: - static constexpr unsigned SMALL_ICON=16, - MEDIUM_ICON=24, - LARGE_ICON=32; + static constexpr unsigned SmallIcon=16, + MediumIcon=24, + LargeIcon=32; HintTextWidget(QWidget *btn_parent, QWidget *parent); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index b20a8a103f..7bba6b0171 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -34,7 +34,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par PluginsConfigWidget *plugins_conf_wgt=nullptr; QGridLayout *grid=nullptr; - pending_op=NO_PENDING_OPER; + pending_op=NoPendingOp; central_wgt=nullptr; canvas_info_wgt = new SceneInfoWidget(this); @@ -60,18 +60,18 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par grid->setContentsMargins(0,0,0,0); grid->setSpacing(0); grid->addWidget(central_wgt, 0, 0); - views_stw->widget(WELCOME_VIEW)->setLayout(grid); + views_stw->widget(WelcomeView)->setLayout(grid); - action_welcome->setData(WELCOME_VIEW); - action_design->setData(DESIGN_VIEW); - action_manage->setData(MANAGE_VIEW); + action_welcome->setData(WelcomeView); + action_design->setData(DesignView); + action_manage->setData(ManageView); sql_tool_wgt=new SQLToolWidget; grid=new QGridLayout; grid->setContentsMargins(0,0,0,0); grid->setSpacing(0); grid->addWidget(sql_tool_wgt, 0, 0); - views_stw->widget(MANAGE_VIEW)->setLayout(grid); + views_stw->widget(ManageView)->setLayout(grid); configuration_form=new ConfigurationForm(nullptr, Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); PgModelerUiNs::resizeDialog(configuration_form); @@ -318,7 +318,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(model_valid_wgt, SIGNAL(s_validationInProgress(bool)), models_tbw, SLOT(setDisabled(bool))); connect(model_valid_wgt, SIGNAL(s_validationInProgress(bool)), this, SLOT(stopTimers(bool))); - connect(model_valid_wgt, &ModelValidationWidget::s_validationCanceled, [&](){ pending_op=NO_PENDING_OPER; }); + connect(model_valid_wgt, &ModelValidationWidget::s_validationCanceled, [&](){ pending_op=NoPendingOp; }); connect(model_valid_wgt, SIGNAL(s_validationFinished(bool)), this, SLOT(executePendingOperation(bool))); connect(model_valid_wgt, SIGNAL(s_fixApplied()), this, SLOT(removeOperations()), Qt::QueuedConnection); connect(model_valid_wgt, SIGNAL(s_graphicalObjectsUpdated()), model_objs_wgt, SLOT(updateObjectsView()), Qt::QueuedConnection); @@ -636,7 +636,7 @@ void MainWindow::closeEvent(QCloseEvent *event) msg_box.show(trUtf8("Save modified model(s)"), trUtf8("The following models were modified but not saved: %1. Do you really want to quit pgModeler?").arg(model_names.join(", ")), - Messagebox::CONFIRM_ICON,Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon,Messagebox::YesNoButtons); /* If the user rejects the message box the close event will be aborted causing pgModeler not to be finished */ @@ -799,7 +799,7 @@ void MainWindow::updateRecentModelsMenu(void) recent_mdls_menu.clear(); recent_models.removeDuplicates(); - for(int i=0; i < recent_models.size() && i < MAX_RECENT_MODELS; i++) + for(int i=0; i < recent_models.size() && i < MaxRecentModels; i++) { act=recent_mdls_menu.addAction(QFileInfo(recent_models[i]).fileName(),this,SLOT(loadModelFromAction(void))); act->setToolTip(recent_models[i]); @@ -1190,7 +1190,7 @@ void MainWindow::removeModelActions(void) QList act_list; act_list=general_tb->actions(); - while(act_list.size() > GENERAL_ACTIONS_COUNT) + while(act_list.size() > GeneralActionsCount) { general_tb->removeAction(act_list.back()); act_list.pop_back(); @@ -1221,7 +1221,7 @@ void MainWindow::closeModel(int model_id) { msg_box.show(trUtf8("Save model"), trUtf8("The model %1 was modified! Do you really want to close without save it?").arg(model->getDatabaseModel()->getName()), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); } #endif @@ -1359,7 +1359,7 @@ void MainWindow::saveModel(ModelWidget *model) { msg_box.show(trUtf8("Confirmation"), trUtf8(" WARNING: The model %1 is invalidated! It's recommended to validate it before save in order to create a consistent model otherwise the generated file will be broken demanding manual fixes to be loadable again!").arg(db_model->getName()), - Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS, + Messagebox::AlertIcon, Messagebox::AllButtons, trUtf8("Validate"), trUtf8("Save anyway"), QString(), PgModelerUiNs::getIconPath("validation"), PgModelerUiNs::getIconPath("salvar")); @@ -1374,7 +1374,7 @@ void MainWindow::saveModel(ModelWidget *model) else if(msg_box.result()==QDialog::Accepted) { validation_btn->setChecked(true); - this->pending_op=(sender()==action_save_as ? PENDING_SAVE_AS_OPER : PENDING_SAVE_OPER); + this->pending_op=(sender()==action_save_as ? PendingSaveAsOp : PendingSaveOp); action_design->setChecked(true); model_valid_wgt->validateModel(); } @@ -1388,7 +1388,7 @@ void MainWindow::saveModel(ModelWidget *model) && (model->isModified() || sender()==action_save_as)) { //If the action that calls the slot were the 'save as' or the model filename isn't set - if(sender()==action_save_as || model->filename.isEmpty() || pending_op==PENDING_SAVE_AS_OPER) + if(sender()==action_save_as || model->filename.isEmpty() || pending_op==PendingSaveAsOp) { QFileDialog file_dlg; @@ -1437,14 +1437,14 @@ void MainWindow::exportModel(void) { msg_box.show(trUtf8("Confirmation"), trUtf8(" WARNING: The model %1 is invalidated! Before run the export process it's recommended to validate in order to correctly create the objects on database server!").arg(db_model->getName()), - Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS, + Messagebox::AlertIcon, Messagebox::AllButtons, trUtf8("Validate"), trUtf8("Export anyway"), QString(), PgModelerUiNs::getIconPath("validation"), PgModelerUiNs::getIconPath("exportar")); if(msg_box.result()==QDialog::Accepted) { validation_btn->setChecked(true); - this->pending_op=PENDING_EXPORT_OPER; + this->pending_op=PendingExportOp; model_valid_wgt->validateModel(); } } @@ -1497,14 +1497,14 @@ void MainWindow::diffModelDatabase(void) { msg_box.show(trUtf8("Confirmation"), trUtf8(" WARNING: The model %1 is invalidated! Before run the diff process it's recommended to validate in order to correctly analyze and generate the difference between the model and a database!").arg(db_model->getName()), - Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS, + Messagebox::AlertIcon, Messagebox::AllButtons, trUtf8("Validate"), trUtf8("Diff anyway"), QString(), PgModelerUiNs::getIconPath("validation"), PgModelerUiNs::getIconPath("diff")); if(msg_box.result()==QDialog::Accepted) { validation_btn->setChecked(true); - this->pending_op=PENDING_DIFF_OPER; + this->pending_op=PendingDiffOp; model_valid_wgt->validateModel(); } } @@ -1568,7 +1568,7 @@ void MainWindow::printModel(void) orientation!=curr_orientation || curr_paper_size!=paper_size) { msg_box.show(trUtf8("Changes were detected in the definitions of paper/margin of the model which may cause the incorrect print of the objects. Do you want to continue printing using the new settings? To use the default settings click 'No' or 'Cancel' to abort printing."), - Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS); + Messagebox::AlertIcon, Messagebox::AllButtons); } if(!msg_box.isCancelled()) @@ -1640,7 +1640,7 @@ void MainWindow::showFixMessage(Exception &e, const QString &filename) msg_box.show(Exception(Exception::getErrorMessage(ModelFileNotLoaded).arg(filename), ModelFileNotLoaded ,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e), trUtf8("Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again.").arg(filename), - Messagebox::ERROR_ICON, Messagebox::YES_NO_BUTTONS, + Messagebox::ErrorIcon, Messagebox::YesNoButtons, trUtf8("Fix model"), trUtf8("Cancel"), QString(), PgModelerUiNs::getIconPath("fixobject"), PgModelerUiNs::getIconPath("msgbox_erro")); @@ -1897,7 +1897,7 @@ void MainWindow::showDemoVersionWarning(void) void MainWindow::executePendingOperation(bool valid_error) { - if(!valid_error && pending_op!=NO_PENDING_OPER) + if(!valid_error && pending_op!=NoPendingOp) { static const QString op_names[]={ QString(), QT_TR_NOOP("save"), QT_TR_NOOP("save"), QT_TR_NOOP("export"), QT_TR_NOOP("diff") }; @@ -1905,14 +1905,14 @@ void MainWindow::executePendingOperation(bool valid_error) PgModelerUiNs::createOutputTreeItem(model_valid_wgt->output_trw, trUtf8("Executing pending %1 operation...").arg(op_names[pending_op])); - if(pending_op==PENDING_SAVE_OPER || pending_op==PENDING_SAVE_AS_OPER) + if(pending_op==PendingSaveOp || pending_op==PendingSaveAsOp) saveModel(); - else if(pending_op==PENDING_EXPORT_OPER) + else if(pending_op==PendingExportOp) exportModel(); - else if(pending_op==PENDING_DIFF_OPER) + else if(pending_op==PendingDiffOp) diffModelDatabase(); - pending_op=NO_PENDING_OPER; + pending_op=NoPendingOp; } } @@ -1941,7 +1941,7 @@ void MainWindow::changeCurrentView(bool checked) action_design->blockSignals(false); actions=general_tb->actions(); - for(int i=GENERAL_ACTIONS_COUNT; i < actions.count(); i++) + for(int i=GeneralActionsCount; i < actions.count(); i++) { actions[i]->setEnabled(enable); @@ -2014,7 +2014,7 @@ void MainWindow::arrangeObjects(void) return; Messagebox msgbox; - msgbox.show(trUtf8("Rearrange objects over the canvas is an irreversible operation! Would like to proceed?"), Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + msgbox.show(trUtf8("Rearrange objects over the canvas is an irreversible operation! Would like to proceed?"), Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msgbox.result() == QDialog::Accepted) { diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index d3187ce847..93f9c97827 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -56,22 +56,22 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { Q_OBJECT //! \brief Maximum number of files listed on recent models menu - static constexpr int MAX_RECENT_MODELS=15; + static constexpr int MaxRecentModels=15; - static constexpr int GENERAL_ACTIONS_COUNT=8; + static constexpr int GeneralActionsCount=8; - static constexpr int WELCOME_VIEW=0, - DESIGN_VIEW=1, - MANAGE_VIEW=2; + static constexpr int WelcomeView=0, + DesignView=1, + ManageView=2; static bool confirm_validation; //! \brief Constants used to mark a pending operation to be executed after validate model - static constexpr unsigned NO_PENDING_OPER=0, - PENDING_SAVE_OPER=1, - PENDING_SAVE_AS_OPER=2, - PENDING_EXPORT_OPER=3, - PENDING_DIFF_OPER=4; + static constexpr unsigned NoPendingOp=0, + PendingSaveOp=1, + PendingSaveAsOp=2, + PendingExportOp=3, + PendingDiffOp=4; unsigned pending_op; diff --git a/libpgmodeler_ui/src/messagebox.cpp b/libpgmodeler_ui/src/messagebox.cpp index 774ef91dad..b6aef37062 100644 --- a/libpgmodeler_ui/src/messagebox.cpp +++ b/libpgmodeler_ui/src/messagebox.cpp @@ -132,7 +132,7 @@ void Messagebox::show(const QString &title, const QString &msg, unsigned icon_ty if(!yes_lbl.isEmpty()) yes_ok_btn->setText(yes_lbl); else - yes_ok_btn->setText(buttons==OK_BUTTON ? trUtf8("&Ok") : trUtf8("&Yes")); + yes_ok_btn->setText(buttons==OkButton ? trUtf8("&Ok") : trUtf8("&Yes")); yes_ok_btn->setIcon(!yes_ico.isEmpty() ? QIcon(yes_ico) : QPixmap(PgModelerUiNs::getIconPath("confirmar"))); @@ -142,26 +142,26 @@ void Messagebox::show(const QString &title, const QString &msg, unsigned icon_ty cancel_btn->setText(!cancel_lbl.isEmpty() ? cancel_lbl : trUtf8("&Cancel")); cancel_btn->setIcon(!cancel_ico.isEmpty() ? QIcon(cancel_ico) : QPixmap(PgModelerUiNs::getIconPath("cancelar"))); - no_btn->setVisible(buttons==YES_NO_BUTTONS || buttons==ALL_BUTTONS); - cancel_btn->setVisible(buttons==OK_CANCEL_BUTTONS || buttons==ALL_BUTTONS); + no_btn->setVisible(buttons==YesNoButtons || buttons==AllButtons); + cancel_btn->setVisible(buttons==OkCancelButtons || buttons==AllButtons); if(title.isEmpty()) { switch(icon_type) { - case ERROR_ICON: + case ErrorIcon: aux_title=trUtf8("Error"); break; - case ALERT_ICON: + case AlertIcon: aux_title=trUtf8("Alert"); break; - case INFO_ICON: + case InfoIcon: aux_title=trUtf8("Information"); break; - case CONFIRM_ICON: + case ConfirmIcon: aux_title=trUtf8("Confirmation"); break; } @@ -169,19 +169,19 @@ void Messagebox::show(const QString &title, const QString &msg, unsigned icon_ty switch(icon_type) { - case ERROR_ICON: + case ErrorIcon: icon_name=QString("msgbox_erro"); break; - case INFO_ICON: + case InfoIcon: icon_name=QString("msgbox_info"); break; - case ALERT_ICON: + case AlertIcon: icon_name=QString("msgbox_alerta"); break; - case CONFIRM_ICON: + case ConfirmIcon: icon_name=QString("msgbox_quest"); break; diff --git a/libpgmodeler_ui/src/messagebox.h b/libpgmodeler_ui/src/messagebox.h index c97add8176..51552e1515 100644 --- a/libpgmodeler_ui/src/messagebox.h +++ b/libpgmodeler_ui/src/messagebox.h @@ -36,34 +36,34 @@ class Messagebox: public QDialog, public Ui::Messagebox { public: //! \brief Constants used to define the message icon - static constexpr unsigned NO_ICON=10, - ERROR_ICON=11, - INFO_ICON=12, - ALERT_ICON=13, - CONFIRM_ICON=14; + static constexpr unsigned NoIcon=10, + ErrorIcon=11, + InfoIcon=12, + AlertIcon=13, + ConfirmIcon=14; //! \brief Constants used to configure the visible buttons - static constexpr unsigned YES_NO_BUTTONS=0, - OK_CANCEL_BUTTONS=1, - OK_BUTTON=2, - ALL_BUTTONS=3; + static constexpr unsigned YesNoButtons=0, + OkCancelButtons=1, + OkButton=2, + AllButtons=3; Messagebox(QWidget * parent = 0, Qt::WindowFlags f = 0); /*! \brief Shows the message box defining the icons and available buttons. User can specify custom button labels as well custom icons. The icons can be a path to a local file or a Qt resource icon ':/path/icon' and will be enabled only specifing custom labels for the respective button. */ - void show(const QString &title, const QString &msg, unsigned icon_type=NO_ICON, unsigned buttons=OK_BUTTON, + void show(const QString &title, const QString &msg, unsigned icon_type=NoIcon, unsigned buttons=OkButton, const QString &yes_lbl=QString(), const QString &no_lbl=QString(), const QString &cancel_lbl=QString(), const QString &yes_ico=QString(), const QString &no_ico=QString(), const QString &cancel_ico=QString()); //! \brief Shows the message box using an excpetion as message - void show(Exception e, const QString &msg=QString(), unsigned icon_type=ERROR_ICON, unsigned buttons=OK_BUTTON, + void show(Exception e, const QString &msg=QString(), unsigned icon_type=ErrorIcon, unsigned buttons=OkButton, const QString &yes_lbl=QString(), const QString &no_lbl=QString(), const QString &cancel_lbl=QString(), const QString &yes_ico=QString(), const QString &no_ico=QString(), const QString &cancel_ico=QString()); //! \brief Shows a simple message box with the title automatically defined by the icon type - void show(const QString &msg, unsigned icon_type=NO_ICON, unsigned buttons=OK_BUTTON); + void show(const QString &msg, unsigned icon_type=NoIcon, unsigned buttons=OkButton); bool isCancelled(void); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 1784e3fab4..dad7bb1c2d 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -150,9 +150,9 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) ModelDatabaseDiffForm::~ModelDatabaseDiffForm(void) { - destroyThread(IMPORT_THREAD); - destroyThread(DIFF_THREAD); - destroyThread(EXPORT_THREAD); + destroyThread(ImportThread); + destroyThread(DiffThread); + destroyThread(ExportThread); destroyModel(); } @@ -208,7 +208,7 @@ void ModelDatabaseDiffForm::showEvent(QShowEvent *) void ModelDatabaseDiffForm::createThread(unsigned thread_id) { - if(thread_id==SRC_IMPORT_THREAD) + if(thread_id==SrcImportThread) { src_import_thread=new QThread; src_import_helper=new DatabaseImportHelper; @@ -221,7 +221,7 @@ void ModelDatabaseDiffForm::createThread(unsigned thread_id) connect(src_import_helper, SIGNAL(s_importFinished(Exception)), this, SLOT(handleImportFinished(Exception))); connect(src_import_helper, SIGNAL(s_importAborted(Exception)), this, SLOT(captureThreadError(Exception))); } - else if(thread_id==IMPORT_THREAD) + else if(thread_id==ImportThread) { import_thread=new QThread; import_helper=new DatabaseImportHelper; @@ -234,7 +234,7 @@ void ModelDatabaseDiffForm::createThread(unsigned thread_id) connect(import_helper, SIGNAL(s_importFinished(Exception)), this, SLOT(handleImportFinished(Exception))); connect(import_helper, SIGNAL(s_importAborted(Exception)), this, SLOT(captureThreadError(Exception))); } - else if(thread_id==DIFF_THREAD) + else if(thread_id==DiffThread) { diff_thread=new QThread; diff_helper=new ModelsDiffHelper; @@ -275,21 +275,21 @@ void ModelDatabaseDiffForm::createThread(unsigned thread_id) void ModelDatabaseDiffForm::destroyThread(unsigned thread_id) { - if(thread_id==SRC_IMPORT_THREAD && src_import_thread) + if(thread_id==SrcImportThread && src_import_thread) { delete(src_import_thread); delete(src_import_helper); src_import_thread=nullptr; src_import_helper=nullptr; } - else if(thread_id==IMPORT_THREAD && import_thread) + else if(thread_id==ImportThread && import_thread) { delete(import_thread); delete(import_helper); import_thread=nullptr; import_helper=nullptr; } - else if(thread_id==DIFF_THREAD && diff_thread) + else if(thread_id==DiffThread && diff_thread) { diff_thread=nullptr; diff_helper=nullptr; @@ -397,10 +397,10 @@ void ModelDatabaseDiffForm::generateDiff(void) { //Destroy previously allocated threads and helper before start over. destroyModel(); - destroyThread(SRC_IMPORT_THREAD); - destroyThread(IMPORT_THREAD); - destroyThread(DIFF_THREAD); - destroyThread(EXPORT_THREAD); + destroyThread(SrcImportThread); + destroyThread(ImportThread); + destroyThread(DiffThread); + destroyThread(ExportThread); clearOutput(); curr_step = 1; @@ -413,7 +413,7 @@ void ModelDatabaseDiffForm::generateDiff(void) else total_steps=4; - importDatabase(src_database_rb->isChecked() ? SRC_IMPORT_THREAD : IMPORT_THREAD); + importDatabase(src_database_rb->isChecked() ? SrcImportThread : ImportThread); buttons_wgt->setEnabled(false); cancel_btn->setEnabled(true); @@ -429,15 +429,15 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) { try { - if(thread_id != SRC_IMPORT_THREAD && thread_id != IMPORT_THREAD) + if(thread_id != SrcImportThread && thread_id != ImportThread) throw Exception(AllocationObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); createThread(thread_id); - QThread *thread = (thread_id == SRC_IMPORT_THREAD ? src_import_thread : import_thread); - DatabaseImportHelper *import_hlp = (thread_id == SRC_IMPORT_THREAD ? src_import_helper : import_helper); - QComboBox *conn_cmb = (thread_id == SRC_IMPORT_THREAD ? src_connections_cmb : connections_cmb), - *db_cmb = (thread_id == SRC_IMPORT_THREAD ? src_database_cmb : database_cmb); + QThread *thread = (thread_id == SrcImportThread ? src_import_thread : import_thread); + DatabaseImportHelper *import_hlp = (thread_id == SrcImportThread ? src_import_helper : import_helper); + QComboBox *conn_cmb = (thread_id == SrcImportThread ? src_connections_cmb : connections_cmb), + *db_cmb = (thread_id == SrcImportThread ? src_database_cmb : database_cmb); Connection conn=(*reinterpret_cast(conn_cmb->itemData(conn_cmb->currentIndex()).value())), conn1; map> obj_oids; map> col_oids; @@ -452,7 +452,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("import"))); - if(thread_id == SRC_IMPORT_THREAD) + if(thread_id == SrcImportThread) src_import_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); else import_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); @@ -468,7 +468,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); obj_oids[ObjDatabase].push_back(db_cmb->currentData().value()); - if(thread_id == SRC_IMPORT_THREAD) + if(thread_id == SrcImportThread) { source_model=new DatabaseModel; source_model->createSystemObjects(true); @@ -496,7 +496,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) void ModelDatabaseDiffForm::diffModels(void) { - createThread(DIFF_THREAD); + createThread(DiffThread); step_lbl->setText(trUtf8("Step %1/%2: Comparing %3 and %4...") .arg(curr_step) @@ -510,16 +510,16 @@ void ModelDatabaseDiffForm::diffModels(void) diff_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_KEEP_CLUSTER_OBJS, keep_cluster_objs_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_CASCADE_MODE, cascade_mode_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_TRUCANTE_TABLES, trunc_tables_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_FORCE_RECREATION, force_recreation_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_RECREATE_UNCHANGEBLE, recreate_unmod_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_KEEP_OBJ_PERMS, keep_obj_perms_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_REUSE_SEQUENCES, reuse_sequences_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_PRESERVE_DB_NAME, preserve_db_name_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_DONT_DROP_MISSING_OBJS, dont_drop_missing_objs_chk->isChecked()); - diff_helper->setDiffOption(ModelsDiffHelper::OPT_DROP_MISSING_COLS_CONSTR, drop_missing_cols_constr_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptKeepClusterObjs, keep_cluster_objs_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptCascadeMode, cascade_mode_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptTruncateTables, trunc_tables_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptForceRecreation, force_recreation_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptRecreateUnchangeble, recreate_unmod_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptKeepObjectPerms, keep_obj_perms_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptReuseSequences, reuse_sequences_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptPreserveDbName, preserve_db_name_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptDontDropMissingObjs, dont_drop_missing_objs_chk->isChecked()); + diff_helper->setDiffOption(ModelsDiffHelper::OptDropMissingColsConstr, drop_missing_cols_constr_chk->isChecked()); diff_helper->setModels(source_model, imported_model); @@ -533,14 +533,14 @@ void ModelDatabaseDiffForm::diffModels(void) void ModelDatabaseDiffForm::exportDiff(bool confirm) { - createThread(EXPORT_THREAD); + createThread(ExportThread); Messagebox msg_box; if(confirm) msg_box.show(trUtf8("Confirmation"), trUtf8(" WARNING: The generated diff is ready to be exported! Once started this process will cause irreversible changes on the database. Do you really want to proceed?"), - Messagebox::ALERT_ICON, Messagebox::ALL_BUTTONS, + Messagebox::AlertIcon, Messagebox::AllButtons, trUtf8("Apply diff"), trUtf8("Preview diff"), QString(), PgModelerUiNs::getIconPath("diff"), PgModelerUiNs::getIconPath("codigosql")); @@ -706,7 +706,7 @@ void ModelDatabaseDiffForm::handleImportFinished(Exception e) if(!e.getErrorMessage().isEmpty()) { Messagebox msgbox; - msgbox.show(e, e.getErrorMessage(), Messagebox::ALERT_ICON); + msgbox.show(e, e.getErrorMessage(), Messagebox::AlertIcon); } curr_step++; @@ -715,7 +715,7 @@ void ModelDatabaseDiffForm::handleImportFinished(Exception e) { src_import_thread->quit(); src_import_item->setExpanded(false); - importDatabase(IMPORT_THREAD); + importDatabase(ImportThread); } else { diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index 18a4580e73..491dafa83c 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -110,10 +110,10 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { void finishDiff(void); //! \brief Constants used to reference the thread/helper to be handled in createThread() and destroyThread() - static constexpr unsigned SRC_IMPORT_THREAD=0, - IMPORT_THREAD=1, - DIFF_THREAD=2, - EXPORT_THREAD=3; + static constexpr unsigned SrcImportThread=0, + ImportThread=1, + DiffThread=2, + ExportThread=3; public: ModelDatabaseDiffForm(QWidget * parent = 0, Qt::WindowFlags f = 0); diff --git a/libpgmodeler_ui/src/modelfixform.cpp b/libpgmodeler_ui/src/modelfixform.cpp index eabb428b64..48fbb723db 100644 --- a/libpgmodeler_ui/src/modelfixform.cpp +++ b/libpgmodeler_ui/src/modelfixform.cpp @@ -21,7 +21,7 @@ #include #include "pgmodeleruins.h" -const QString ModelFixForm::PGMODELER_CLI=QString("pgmodeler-cli"); +const QString ModelFixForm::PgModelerCli=QString("pgmodeler-cli"); ModelFixForm::ModelFixForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { @@ -78,7 +78,7 @@ int ModelFixForm::exec(void) if(!fi.exists()) { not_found_lbl->setText(trUtf8("Could not locate %1 tool on %2. The fix process can't continue! Please check pgModeler installation or try to manually specify the command below.") - .arg(PGMODELER_CLI).arg(fi.absoluteDir().absolutePath())); + .arg(PgModelerCli).arg(fi.absoluteDir().absolutePath())); message_frm->setVisible(true); pgmodeler_cli_lbl->setVisible(true); pgmodeler_cli_edt->setVisible(true); @@ -95,7 +95,7 @@ void ModelFixForm::enableFix(void) if(!pgmodeler_cli_edt->text().isEmpty()) { QFileInfo fi(pgmodeler_cli_edt->text()); - bool visible=!fi.exists() || fi.baseName()!=PGMODELER_CLI; + bool visible=!fi.exists() || fi.baseName()!=PgModelerCli; invalid_cli_lbl->setVisible(visible); message_frm->setVisible(visible); @@ -139,7 +139,7 @@ void ModelFixForm::selectFile(void) if(sender_obj==sel_cli_exe_tb) { - QString cli_cmd=PGMODELER_CLI; + QString cli_cmd=PgModelerCli; txt=pgmodeler_cli_edt; #ifdef Q_OS_WIN diff --git a/libpgmodeler_ui/src/modelfixform.h b/libpgmodeler_ui/src/modelfixform.h index c492617932..7387179942 100644 --- a/libpgmodeler_ui/src/modelfixform.h +++ b/libpgmodeler_ui/src/modelfixform.h @@ -33,7 +33,7 @@ class ModelFixForm: public QDialog, public Ui::ModelFixForm { private: Q_OBJECT - static const QString PGMODELER_CLI; + static const QString PgModelerCli; //! \brief Process used to execute pgmodeler-cli QProcess pgmodeler_cli_proc; diff --git a/libpgmodeler_ui/src/modeloverviewwidget.cpp b/libpgmodeler_ui/src/modeloverviewwidget.cpp index 6753f8828e..aeb75899a8 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.cpp +++ b/libpgmodeler_ui/src/modeloverviewwidget.cpp @@ -26,7 +26,7 @@ ModelOverviewWidget::ModelOverviewWidget(QWidget *parent) : QWidget(parent, Qt:: scrollarea = nullptr; this->model=nullptr; zoom_factor=1; - curr_resize_factor=RESIZE_FACTOR; + curr_resize_factor=ResizeFactor; this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); QVBoxLayout *vbox = new QVBoxLayout; @@ -203,8 +203,8 @@ void ModelOverviewWidget::resizeOverview(void) //Make an initial calculation of the overview window size scene_rect=this->model->scene->sceneRect(); curr_size=scene_rect.size(); - curr_size.setWidth(curr_size.width() * RESIZE_FACTOR); - curr_size.setHeight(curr_size.height() * RESIZE_FACTOR); + curr_size.setWidth(curr_size.width() * ResizeFactor); + curr_size.setHeight(curr_size.height() * ResizeFactor); //If the size exceeds the screen's width or height in 90% if(curr_size.width() > screen_rect.width() * 0.90f || @@ -221,7 +221,7 @@ void ModelOverviewWidget::resizeOverview(void) } else { - curr_resize_factor=RESIZE_FACTOR/2; + curr_resize_factor=ResizeFactor/2; pixmap_size=scene_rect.size().toSize(); } @@ -231,7 +231,7 @@ void ModelOverviewWidget::resizeOverview(void) } else { - curr_resize_factor=RESIZE_FACTOR; + curr_resize_factor=ResizeFactor; pixmap_size=scene_rect.size().toSize(); } diff --git a/libpgmodeler_ui/src/modeloverviewwidget.h b/libpgmodeler_ui/src/modeloverviewwidget.h index b69b495724..1c32853560 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.h +++ b/libpgmodeler_ui/src/modeloverviewwidget.h @@ -54,7 +54,7 @@ class ModelOverviewWidget: public QWidget, public Ui::ModelOverviewWidget { QSize pixmap_size; //! \brief Resize factor applied to overview widgets (default: 20% of the scene original size) - static constexpr double RESIZE_FACTOR=0.20f; + static constexpr double ResizeFactor=0.20f; void mouseDoubleClickEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *event); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index ff0f8cc4de..2b4f862026 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -27,16 +27,16 @@ ModelsDiffHelper::ModelsDiffHelper(void) source_model=imported_model=nullptr; resetDiffCounter(); - diff_opts[OPT_KEEP_CLUSTER_OBJS]=true; - diff_opts[OPT_CASCADE_MODE]=true; - diff_opts[OPT_TRUCANTE_TABLES]=false; - diff_opts[OPT_FORCE_RECREATION]=true; - diff_opts[OPT_RECREATE_UNCHANGEBLE]=true; - diff_opts[OPT_KEEP_OBJ_PERMS]=true; - diff_opts[OPT_REUSE_SEQUENCES]=true; - diff_opts[OPT_PRESERVE_DB_NAME]=true; - diff_opts[OPT_DONT_DROP_MISSING_OBJS]=false; - diff_opts[OPT_DROP_MISSING_COLS_CONSTR]=false; + diff_opts[OptKeepClusterObjs]=true; + diff_opts[OptCascadeMode]=true; + diff_opts[OptTruncateTables]=false; + diff_opts[OptForceRecreation]=true; + diff_opts[OptRecreateUnchangeble]=true; + diff_opts[OptKeepObjectPerms]=true; + diff_opts[OptReuseSequences]=true; + diff_opts[OptPreserveDbName]=true; + diff_opts[OptDontDropMissingObjs]=false; + diff_opts[OptDropMissingColsConstr]=false; } ModelsDiffHelper::~ModelsDiffHelper(void) @@ -46,11 +46,11 @@ ModelsDiffHelper::~ModelsDiffHelper(void) void ModelsDiffHelper::setDiffOption(unsigned opt_id, bool value) { - if(opt_id > OPT_DROP_MISSING_COLS_CONSTR) + if(opt_id > OptDropMissingColsConstr) throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(opt_id == OPT_DROP_MISSING_COLS_CONSTR) - diff_opts[opt_id]=value & !diff_opts[OPT_DROP_MISSING_COLS_CONSTR]; + if(opt_id == OptDropMissingColsConstr) + diff_opts[opt_id]=value & !diff_opts[OptDropMissingColsConstr]; else diff_opts[opt_id]=value; } @@ -181,8 +181,8 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d else if(!aux_obj && !tab_obj->isAddedByGeneralization() && !tab_obj->isAddedByCopy()) { if(diff_type!=ObjectsDiffInfo::DROP_OBJECT || - (diff_type==ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OPT_DONT_DROP_MISSING_OBJS]) || - (diff_type==ObjectsDiffInfo::DROP_OBJECT && diff_opts[OPT_DROP_MISSING_COLS_CONSTR])) + (diff_type==ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OptDontDropMissingObjs]) || + (diff_type==ObjectsDiffInfo::DROP_OBJECT && diff_opts[OptDropMissingColsConstr])) generateDiffInfo(diff_type, tab_obj); else generateDiffInfo(ObjectsDiffInfo::IGNORE_OBJECT, tab_obj); @@ -242,7 +242,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) 3) Cluster objects such as roles and tablespaces (when the operatoin is DROP and keep_cluster_objs is true) */ if(obj_type!=ObjBaseRelationship && !object->isSystemObject() && !object->isSQLDisabled() && - ((diff_type==ObjectsDiffInfo::DROP_OBJECT && (!diff_opts[OPT_KEEP_CLUSTER_OBJS] || (diff_opts[OPT_KEEP_CLUSTER_OBJS] && obj_type!=ObjRole && obj_type!=ObjTablespace))) || + ((diff_type==ObjectsDiffInfo::DROP_OBJECT && (!diff_opts[OptKeepClusterObjs] || (diff_opts[OptKeepClusterObjs] && obj_type!=ObjRole && obj_type!=ObjTablespace))) || (diff_type!=ObjectsDiffInfo::DROP_OBJECT))) { emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), @@ -257,11 +257,11 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) if(obj_type==ObjPermission && ((diff_type==ObjectsDiffInfo::DROP_OBJECT && - !diff_opts[OPT_KEEP_OBJ_PERMS]) || + !diff_opts[OptKeepObjectPerms]) || (diff_type==ObjectsDiffInfo::CREATE_OBJECT && (aux_model->getPermissionIndex(dynamic_cast(object), true) < 0 || - !diff_opts[OPT_KEEP_OBJ_PERMS])))) + !diff_opts[OptKeepObjectPerms])))) generateDiffInfo(diff_type, object); //Processing relationship (in this case only generalization and patitioning ones are considered) @@ -339,7 +339,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) generateDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, object, aux_object); //If the object is a table, do additional comparision between their child objects - if((!diff_opts[OPT_FORCE_RECREATION] || diff_opts[OPT_RECREATE_UNCHANGEBLE]) && object->getObjectType()==ObjTable) + if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && object->getObjectType()==ObjTable) { Table *tab=dynamic_cast
(object), *aux_tab=dynamic_cast
(aux_object); diffTables(tab, aux_tab, ObjectsDiffInfo::DROP_OBJECT); @@ -352,7 +352,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) else if(!aux_object) { if(diff_type != ObjectsDiffInfo::DROP_OBJECT || - (diff_type == ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OPT_DONT_DROP_MISSING_OBJS])) + (diff_type == ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OptDontDropMissingObjs])) generateDiffInfo(diff_type, object); else generateDiffInfo(ObjectsDiffInfo::IGNORE_OBJECT, object); @@ -433,7 +433,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) if(!aux_tab_obj) { if(diff_type!=ObjectsDiffInfo::DROP_OBJECT || - (diff_type==ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OPT_DONT_DROP_MISSING_OBJS])) + (diff_type==ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OptDontDropMissingObjs])) generateDiffInfo(diff_type, tab_obj); else generateDiffInfo(ObjectsDiffInfo::IGNORE_OBJECT, tab_obj); @@ -472,7 +472,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, /* If the info is for ALTER and there is a DROP info on the list, * the object will be recreated instead of modified */ - if((!diff_opts[OPT_FORCE_RECREATION] || diff_opts[OPT_RECREATE_UNCHANGEBLE]) && + if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && diff_type==ObjectsDiffInfo::ALTER_OBJECT && isDiffInfoExists(ObjectsDiffInfo::DROP_OBJECT, old_object, nullptr) && !isDiffInfoExists(ObjectsDiffInfo::CREATE_OBJECT, object, nullptr)) @@ -517,8 +517,8 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, /* Creates a new ALTER info with the created column onlly if we don't need to reuse sequences * or if the sequence reusing is enabled but the type of the columns aren't equivalent or even * the types are equivalent but the sequences used by each columns aren't the same */ - if(!diff_opts[OPT_REUSE_SEQUENCES] || - (diff_opts[OPT_REUSE_SEQUENCES] && + if(!diff_opts[OptReuseSequences] || + (diff_opts[OptReuseSequences] && (!col->getType().getAliasType().isEquivalentTo(old_col->getType()) || (old_col->getSequence() && old_col->getSequence()->getSignature() != seq->getSignature())))) { @@ -528,7 +528,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, emit s_objectsDiffInfoGenerated(diff_info); } - if(!diff_opts[OPT_REUSE_SEQUENCES] || imported_model->getObjectIndex(seq->getSignature(), ObjSequence) < 0) + if(!diff_opts[OptReuseSequences] || imported_model->getObjectIndex(seq->getSignature(), ObjSequence) < 0) { //Creates a CREATE info with the sequence diff_info=ObjectsDiffInfo(ObjectsDiffInfo::CREATE_OBJECT, seq, nullptr); @@ -536,7 +536,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, diffs_counter[ObjectsDiffInfo::CREATE_OBJECT]++; emit s_objectsDiffInfoGenerated(diff_info); } - else if(diff_opts[OPT_REUSE_SEQUENCES]) + else if(diff_opts[OptReuseSequences]) { //Removing DROP infos related to the sequence that will be reused vector::iterator itr=diff_infos.begin(), @@ -571,7 +571,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, /* If the info is for DROP, generate the drop for referer objects of the one marked to be dropped */ - if((!diff_opts[OPT_FORCE_RECREATION] || diff_opts[OPT_RECREATE_UNCHANGEBLE]) && + if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && diff_type==ObjectsDiffInfo::DROP_OBJECT) { vector ref_objs; @@ -720,7 +720,7 @@ void ModelsDiffHelper::processDiffInfos(void) } else if(obj_type==ObjPermission) //Unsetting permissions - unset_perms+=object->getDropDefinition(diff_opts[OPT_CASCADE_MODE]); + unset_perms+=object->getDropDefinition(diff_opts[OptCascadeMode]); else { //Ordinary drop commands for any object except columns @@ -772,9 +772,9 @@ void ModelsDiffHelper::processDiffInfos(void) else if(diff_type==ObjectsDiffInfo::ALTER_OBJECT) { //Recreating the object instead of generating an ALTER command for it - if((diff_opts[OPT_FORCE_RECREATION] && obj_type!=ObjDatabase) && - (!diff_opts[OPT_RECREATE_UNCHANGEBLE] || - (diff_opts[OPT_RECREATE_UNCHANGEBLE] && !object->acceptsAlterCommand() && + if((diff_opts[OptForceRecreation] && obj_type!=ObjDatabase) && + (!diff_opts[OptRecreateUnchangeble] || + (diff_opts[OptRecreateUnchangeble] && !object->acceptsAlterCommand() && diff.getObject()->getCodeDefinition(SchemaParser::SqlDefinition).simplified()!= diff.getOldObject()->getCodeDefinition(SchemaParser::SqlDefinition).simplified()))) { @@ -812,7 +812,7 @@ void ModelsDiffHelper::processDiffInfos(void) if(diff.getOldObject()) alter_def=diff.getOldObject()->getAlterDefinition(object); - if(obj_type == ObjDatabase && diff_opts[OPT_PRESERVE_DB_NAME]) + if(obj_type == ObjDatabase && diff_opts[OptPreserveDbName]) alter_def.remove(QRegExp(QString("(ALTER)( )+(DATABASE)( )+(%1)( )+(RENAME)( )+(TO)(.)*(\\n)").arg(diff.getOldObject()->getSignature()))); if(!alter_def.isEmpty()) @@ -821,7 +821,7 @@ void ModelsDiffHelper::processDiffInfos(void) /* If the object is a column checks if the types of the columns are differents, generating a TRUNCATE TABLE for the parent table */ - if(obj_type==ObjColumn && diff_opts[OPT_TRUCANTE_TABLES]) + if(obj_type==ObjColumn && diff_opts[OptTruncateTables]) { Column *src_col=dynamic_cast(object), *old_col=dynamic_cast(diff.getOldObject()); @@ -831,7 +831,7 @@ void ModelsDiffHelper::processDiffInfos(void) (!old_col->getType().isSerialType() && !src_col->getType().isEquivalentTo(old_col->getType()))) && truncate_tabs.count(tab->getObjectId())==0) { - truncate_tabs[tab->getObjectId()]=tab->getTruncateDefinition(diff_opts[OPT_CASCADE_MODE]); + truncate_tabs[tab->getObjectId()]=tab->getTruncateDefinition(diff_opts[OptCascadeMode]); } } } @@ -965,7 +965,7 @@ QString ModelsDiffHelper::getCodeDefinition(BaseObject *object, bool drop_cmd) table->setGenerateAlterCmds(true); if(drop_cmd) - cmd=tab_obj->getDropDefinition(diff_opts[OPT_CASCADE_MODE]); + cmd=tab_obj->getDropDefinition(diff_opts[OptCascadeMode]); else cmd=tab_obj->getCodeDefinition(SchemaParser::SqlDefinition); @@ -974,7 +974,7 @@ QString ModelsDiffHelper::getCodeDefinition(BaseObject *object, bool drop_cmd) else { if(drop_cmd) - cmd=object->getDropDefinition(diff_opts[OPT_CASCADE_MODE]); + cmd=object->getDropDefinition(diff_opts[OptCascadeMode]); else cmd=object->getCodeDefinition(SchemaParser::SqlDefinition); } diff --git a/libpgmodeler_ui/src/modelsdiffhelper.h b/libpgmodeler_ui/src/modelsdiffhelper.h index 98aa34b08e..0cfc364b01 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.h +++ b/libpgmodeler_ui/src/modelsdiffhelper.h @@ -99,41 +99,41 @@ class ModelsDiffHelper: public QObject { BaseObject *getRelNNTable(const QString &obj_name, DatabaseModel *model); public: - static constexpr unsigned OPT_KEEP_CLUSTER_OBJS=0, + static constexpr unsigned OptKeepClusterObjs=0, //! \brief Indicates if any DROP/TRUNCATE generated must be in cascade mode - OPT_CASCADE_MODE=1, + OptCascadeMode=1, //! \brief Forces the recreation of any object maked as ALTER in the output - OPT_FORCE_RECREATION=2, + OptForceRecreation=2, //! \brief Recreates only objects that can't be modified using ALTER commands - OPT_RECREATE_UNCHANGEBLE=3, + OptRecreateUnchangeble=3, //! \brief Generate a TRUNCATE command for every table which columns was modified in their data types - OPT_TRUCANTE_TABLES=4, + OptTruncateTables=4, //! \brief Indicates if permissions must be preserved on database - OPT_KEEP_OBJ_PERMS=5, + OptKeepObjectPerms=5, /*! \brief Indicates that existing sequences must be reused in serial columns. Since serial columns are converted into integer and a new sequence created and assigned as nextval(sequence) default value for those columns, if reuse is enabled, new sequences will not be created instead the ones which name matches the column's default value will be reused */ - OPT_REUSE_SEQUENCES=6, + OptReuseSequences=6, //! \brief Indicates to not generate and execute commands to rename the destination database - OPT_PRESERVE_DB_NAME=7, + OptPreserveDbName=7, /*! \brief Indicates to not generate and execute commands to drop missing objects. For instance, if user try to diff a partial model against the original database DROP commands will be generated, this option will avoid this situation and preserve the missing (not imported) objects. */ - OPT_DONT_DROP_MISSING_OBJS=8, + OptDontDropMissingObjs=8, /*! \brief Indicates to generate and execute commands to drop missing columns and constraints. For instance, if user try to diff a partial model against the original database and the OPT_DONT_DROP_MISSING_OBJS is set, DROP commands will not be generated, except for columns and constraints. This option is only considered in the process when OPT_DONT_DROP_MISSING_OBJS is enabled. */ - OPT_DROP_MISSING_COLS_CONSTR=9; + OptDropMissingColsConstr=9; ModelsDiffHelper(void); ~ModelsDiffHelper(void); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 43dc7a43df..291cebeca8 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1132,7 +1132,7 @@ void ModelWidget::convertRelationshipNN(void) { Messagebox msg_box; msg_box.show(trUtf8("Do you really want to convert the relationship into an intermediate table?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { @@ -1782,7 +1782,7 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb PermissionWidget *permission_wgt=new PermissionWidget; Permission *perm=dynamic_cast(object); permission_wgt->setAttributes(db_model, nullptr, (perm ? perm->getObject() : object)); - res=openEditingForm(permission_wgt, Messagebox::OK_BUTTON); + res=openEditingForm(permission_wgt, Messagebox::OkButton); } else if(obj_type==ObjGenericSQL) { @@ -1827,7 +1827,7 @@ void ModelWidget::showDependenciesReferences(void) { ObjectDepsRefsWidget *deps_refs_wgt=new ObjectDepsRefsWidget; deps_refs_wgt->setAttributes(this, object); - openEditingForm(deps_refs_wgt, Messagebox::OK_BUTTON); + openEditingForm(deps_refs_wgt, Messagebox::OkButton); } } } @@ -1844,7 +1844,7 @@ void ModelWidget::showSourceCode(void) { SourceCodeWidget *sourcecode_wgt=new SourceCodeWidget; sourcecode_wgt->setAttributes(this->db_model, object); - openEditingForm(sourcecode_wgt, Messagebox::OK_BUTTON); + openEditingForm(sourcecode_wgt, Messagebox::OkButton); } } } @@ -2039,7 +2039,7 @@ void ModelWidget::editPermissions(void) BaseObject *obj=reinterpret_cast(act->data().value()); permission_wgt->setAttributes(this->db_model, nullptr, obj); - openEditingForm(permission_wgt, Messagebox::OK_BUTTON); + openEditingForm(permission_wgt, Messagebox::OkButton); this->setModified(true); emit s_objectManipulated(); @@ -2126,7 +2126,7 @@ void ModelWidget::protectObject(void) { Messagebox msgbox; msgbox.show(QString(QT_TR_NOOP("Do you want to %1 the selected schema's children too?")).arg(protect ? QT_TR_NOOP("protect") : QT_TR_NOOP("unprotect")), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msgbox.result()==QDialog::Accepted) { @@ -2239,7 +2239,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) { //Ask for confirmation to copy the dependencies of the object(s) msg_box.show(trUtf8("Also copy all dependencies of selected objects? This minimizes the breakdown of references when copied objects are pasted into another model."), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); } /* When in cut operation is necessary to store the selected objects in a separeted list @@ -2637,7 +2637,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) Messagebox msg_box; msg_box.show(Exception(trUtf8("Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors), QString(), - Messagebox::ALERT_ICON); + Messagebox::AlertIcon); } if(!ModelWidget::cut_operation) @@ -2762,20 +2762,20 @@ void ModelWidget::removeObjects(bool cascade) { if(cascade) msg_box.show(trUtf8("CAUTION: You are about to delete objects in cascade mode which means more objects than the selected will be dropped too. Do you really want to proceed?"), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, Messagebox::YesNoButtons); else if(sel_objs.size() > 1) { msg_box.show(trUtf8("CAUTION: Remove multiple objects at once can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed?"), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, Messagebox::YesNoButtons); } else { if(sel_objs[0]->getObjectType()==ObjRelationship) msg_box.show(trUtf8("CAUTION: Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed?"), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, Messagebox::YesNoButtons); else msg_box.show(trUtf8("Do you really want to delete the selected object?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); } } @@ -3011,7 +3011,7 @@ void ModelWidget::removeObjects(bool cascade) { msg_box.show(Exception(RemInvalidatedObjects, __PRETTY_FUNCTION__,__FILE__,__LINE__, errors), trUtf8("The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details."), - Messagebox::ALERT_ICON); + Messagebox::AlertIcon); } } catch(Exception &e) diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index 65f6d067d7..e1af9ade08 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -150,7 +150,7 @@ class ModelWidget: public QWidget { QTimer zoom_info_timer; //! \brief Creates a BaseForm instance and insert the widget into it. A custom configuration for dialog buttons can be passed - int openEditingForm(QWidget *widget, unsigned button_conf = Messagebox::OK_CANCEL_BUTTONS); + int openEditingForm(QWidget *widget, unsigned button_conf = Messagebox::OkCancelButtons); //! \brief Opens a editing form for objects at database level template diff --git a/libpgmodeler_ui/src/numberedtexteditor.cpp b/libpgmodeler_ui/src/numberedtexteditor.cpp index 965be06e15..2ba5122fb5 100644 --- a/libpgmodeler_ui/src/numberedtexteditor.cpp +++ b/libpgmodeler_ui/src/numberedtexteditor.cpp @@ -416,7 +416,7 @@ void NumberedTextEditor::handleProcessError(void) { Messagebox msg_box; msg_box.show(PgModelerUiNs::formatMessage(trUtf8("Could not start the source code editor application `%1'! Make to sure that the source editor path defined in the general settings points to a valid executable and the current user has permission to run the application. Error message returned: `%2'") - .arg(src_editor_proc.program()).arg(src_editor_proc.errorString())), Messagebox::ERROR_ICON); + .arg(src_editor_proc.program()).arg(src_editor_proc.errorString())), Messagebox::ErrorIcon); } void NumberedTextEditor::setReadOnly(bool ro) diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 996291c2c8..14582b45eb 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -400,7 +400,7 @@ void ObjectsTableWidget::removeRow(void) { if(conf_exclusion) msg_box.show(trUtf8("Confirmation"),trUtf8("Do you really want to remove the selected item?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(!conf_exclusion || (conf_exclusion && msg_box.result()==QDialog::Accepted)) { @@ -449,7 +449,7 @@ void ObjectsTableWidget::removeRows(void) activating the 'remove_all_tb' button */ if(conf_exclusion && sender_obj==remove_all_tb) msg_box.show(trUtf8("Confirmation"),trUtf8("Do you really want to remove all the items?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(!conf_exclusion || (conf_exclusion && sender_obj!=remove_all_tb) || (conf_exclusion && sender_obj==remove_all_tb && msg_box.result()==QDialog::Accepted)) diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 1b34d7cc10..67c53f7fcb 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -172,7 +172,7 @@ void OperationListWidget::undoOperation(void) if(e.getErrorType()==UndoRedoOperationInvalidObject) { Messagebox msg_box; - msg_box.show(e, "", Messagebox::ALERT_ICON); + msg_box.show(e, "", Messagebox::AlertIcon); } else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); @@ -196,7 +196,7 @@ void OperationListWidget::redoOperation(void) if(e.getErrorType()==UndoRedoOperationInvalidObject) { Messagebox msg_box; - msg_box.show(e, "", Messagebox::ALERT_ICON); + msg_box.show(e, "", Messagebox::AlertIcon); } else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); @@ -209,8 +209,8 @@ void OperationListWidget::removeOperations(void) msg_box.show(trUtf8("Operation history exclusion"), trUtf8("Delete the executed operations history is an irreversible action, do you want to continue?"), - Messagebox::CONFIRM_ICON, - Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, + Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 6a14e4dbbf..85c7960f1f 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -107,7 +107,7 @@ namespace PgModelerUiNs { if(obj_type!=ObjDatabase && curr_val!=disable) { msgbox.show(QString(QT_TR_NOOP("Do you want to apply the SQL %1 status to the object's references too? This will avoid problems when exporting or validating the model.")).arg(disable ? QT_TR_NOOP("disabling") : QT_TR_NOOP("enabling")), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msgbox.result()==QDialog::Accepted) disableReferencesSQL(object); @@ -345,7 +345,7 @@ namespace PgModelerUiNs { BulkDataEditWidget *bulkedit_wgt = new BulkDataEditWidget; base_frm.setMainWidget(bulkedit_wgt); - base_frm.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + base_frm.setButtonConfiguration(Messagebox::OkCancelButtons); if(base_frm.exec() == QDialog::Accepted) { diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 87733009b8..be8182cc9e 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -251,7 +251,7 @@ bool SnippetsConfigWidget::isSnippetValid(attribs_map &attribs, const QString &o if(!err_msg.isEmpty()) { - msg_box.show(err_msg, Messagebox::ERROR_ICON, Messagebox::OK_BUTTON); + msg_box.show(err_msg, Messagebox::ErrorIcon, Messagebox::OkButton); return(false); } else @@ -364,7 +364,7 @@ void SnippetsConfigWidget::removeAllSnippets(void) Messagebox msg_box; msg_box.show(trUtf8("Do you really want to remove all snippets?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { @@ -433,7 +433,7 @@ void SnippetsConfigWidget::parseSnippet(void) try { parseSnippet(getSnippetAttributes(), attribs_map()); - msg_box.show(trUtf8("No syntax errors found in the snippet."), Messagebox::INFO_ICON); + msg_box.show(trUtf8("No syntax errors found in the snippet."), Messagebox::InfoIcon); } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 0326ac2262..0ce63fad6d 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -656,7 +656,7 @@ int SQLExecutionWidget::clearAll(void) int res = 0; msg_box.show(trUtf8("The SQL input field and the results grid will be cleared! Want to proceed?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); res = msg_box.result(); @@ -921,7 +921,7 @@ void SQLExecutionWidget::destroySQLHistory(void) Messagebox msg_box; msg_box.show(trUtf8("This action will wipe out all the SQL commands history for all connections! Do you really want to proceed?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result() == QDialog::Accepted) { @@ -992,7 +992,7 @@ void SQLExecutionWidget::showHistoryContextMenu(void) Messagebox msg_box; msg_box.show(trUtf8("This action will wipe out all the SQL commands history for the current connection! Do you really want to proceed?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result() == QDialog::Accepted) { diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 7a16ec3654..f6b4c9a347 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -195,7 +195,7 @@ void SQLToolWidget::disconnectFromDatabases(void) msg_box.show(trUtf8("Warning"), trUtf8("ATTENTION: Disconnect from all databases will close any opened tab in this view! Do you really want to proceed?"), - Messagebox::ALERT_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::AlertIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 0b1fdc7504..787968870c 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -173,7 +173,7 @@ void TableDataWidget::deleteColumns(void) Messagebox msg_box; msg_box.show(trUtf8("Delete columns is an irreversible action! Do you really want to proceed?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { @@ -208,7 +208,7 @@ void TableDataWidget::clearRows(bool confirm) if(confirm) msg_box.show(trUtf8("Remove all rows is an irreversible action! Do you really want to proceed?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(!confirm || msg_box.result()==QDialog::Accepted) { @@ -223,7 +223,7 @@ void TableDataWidget::clearColumns(void) Messagebox msg_box; msg_box.show(trUtf8("Remove all columns is an irreversible action! Do you really want to proceed?"), - Messagebox::CONFIRM_ICON, Messagebox::YES_NO_BUTTONS); + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); if(msg_box.result()==QDialog::Accepted) { diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 696a1ab288..718f5f9265 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -118,9 +118,9 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) Constraint *pk = table->getPrimaryKey(); if(pk && pk->isAddedByRelationship()) - msg_box.show(trUtf8("It is not possible to mark a column as primary key when the table already has a primary key which was created by a relationship! This action should be done in the section Primary key of the relationship's editing form."), Messagebox::ALERT_ICON); + msg_box.show(trUtf8("It is not possible to mark a column as primary key when the table already has a primary key which was created by a relationship! This action should be done in the section Primary key of the relationship's editing form."), Messagebox::AlertIcon); else - msg_box.show(trUtf8("It is not possible to mark a column created by a relationship as primary key! This action should be done in the section Primary key of the relationship's editing form."), Messagebox::ALERT_ICON); + msg_box.show(trUtf8("It is not possible to mark a column created by a relationship as primary key! This action should be done in the section Primary key of the relationship's editing form."), Messagebox::AlertIcon); } }); @@ -794,7 +794,7 @@ void TableWidget::editData(void) tab_data_wgt->setAttributes(this->model, dynamic_cast
(this->object)); base_form.setMainWidget(tab_data_wgt); - base_form.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + base_form.setButtonConfiguration(Messagebox::OkCancelButtons); GeneralConfigWidget::restoreWidgetGeometry(&base_form, tab_data_wgt->metaObject()->className()); base_form.exec(); diff --git a/libpgmodeler_ui/src/updatenotifierwidget.cpp b/libpgmodeler_ui/src/updatenotifierwidget.cpp index ad28e34800..7ce57aca6d 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.cpp +++ b/libpgmodeler_ui/src/updatenotifierwidget.cpp @@ -114,7 +114,7 @@ void UpdateNotifierWidget::handleUpdateChecked(QNetworkReply *reply) { msg_box.show(trUtf8("Failed to check updates"), trUtf8("The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: %1 - %2.").arg(http_status).arg(reply->errorString()), - Messagebox::ERROR_ICON, Messagebox::OK_BUTTON); + Messagebox::ErrorIcon, Messagebox::OkButton); } else { @@ -152,7 +152,7 @@ void UpdateNotifierWidget::handleUpdateChecked(QNetworkReply *reply) { msg_box.show(trUtf8("No updates found"), trUtf8("You are running the most recent pgModeler version! No update needed."), - Messagebox::INFO_ICON, Messagebox::OK_BUTTON); + Messagebox::InfoIcon, Messagebox::OkButton); } emit s_updateAvailable(upd_found); @@ -161,7 +161,7 @@ void UpdateNotifierWidget::handleUpdateChecked(QNetworkReply *reply) { msg_box.show(trUtf8("Failed to check updates"), trUtf8("The update notifier failed to check for new versions! A HTTP status code was returned: %1").arg(http_status), - Messagebox::ERROR_ICON, Messagebox::OK_BUTTON); + Messagebox::ErrorIcon, Messagebox::OkButton); } delete(update_chk_reply); diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index eaa6cbdfa2..acc8b68cae 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -432,7 +432,7 @@ int ViewWidget::openReferenceForm(Reference ref, int row, bool update) int result = 0; editing_form.setMainWidget(ref_wgt); - editing_form.setButtonConfiguration(Messagebox::OK_CANCEL_BUTTONS); + editing_form.setButtonConfiguration(Messagebox::OkCancelButtons); disconnect(editing_form.apply_ok_btn, SIGNAL(clicked(bool)), &editing_form, SLOT(accept())); connect(editing_form.apply_ok_btn, SIGNAL(clicked(bool)), ref_wgt, SLOT(applyConfiguration())); diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index a1cf505ca3..9585560d32 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1333,16 +1333,16 @@ void PgModelerCLI::diffModelDatabase(void) importDatabase(model_aux, extra_connection); diff_hlp.setModels(model, model_aux); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_KEEP_CLUSTER_OBJS, !parsed_opts.count(DROP_CLUSTER_OBJS)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_CASCADE_MODE, !parsed_opts.count(NO_CASCADE_DROP_TRUNC)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_TRUCANTE_TABLES, parsed_opts.count(TRUNC_ON_COLS_TYPE_CHANGE)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_FORCE_RECREATION, !parsed_opts.count(NO_FORCE_OBJ_RECREATION)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_RECREATE_UNCHANGEBLE, !parsed_opts.count(NO_UNMOD_OBJ_RECREATION)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_KEEP_OBJ_PERMS, !parsed_opts.count(REVOKE_PERMISSIONS)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_REUSE_SEQUENCES, !parsed_opts.count(NO_SEQUENCE_REUSE)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_PRESERVE_DB_NAME, !parsed_opts.count(RENAME_DB)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_DONT_DROP_MISSING_OBJS, !parsed_opts.count(DROP_MISSING_OBJS)); - diff_hlp.setDiffOption(ModelsDiffHelper::OPT_DROP_MISSING_COLS_CONSTR, !parsed_opts.count(FORCE_DROP_COLS_CONSTRS)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptKeepClusterObjs, !parsed_opts.count(DROP_CLUSTER_OBJS)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptCascadeMode, !parsed_opts.count(NO_CASCADE_DROP_TRUNC)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptTruncateTables, parsed_opts.count(TRUNC_ON_COLS_TYPE_CHANGE)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptForceRecreation, !parsed_opts.count(NO_FORCE_OBJ_RECREATION)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptRecreateUnchangeble, !parsed_opts.count(NO_UNMOD_OBJ_RECREATION)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptKeepObjectPerms, !parsed_opts.count(REVOKE_PERMISSIONS)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptReuseSequences, !parsed_opts.count(NO_SEQUENCE_REUSE)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptPreserveDbName, !parsed_opts.count(RENAME_DB)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptDontDropMissingObjs, !parsed_opts.count(DROP_MISSING_OBJS)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptDropMissingColsConstr, !parsed_opts.count(FORCE_DROP_COLS_CONSTRS)); if(!parsed_opts[PGSQL_VER].isEmpty()) diff_hlp.setPgSQLVersion(parsed_opts[PGSQL_VER]); diff --git a/main/src/application.cpp b/main/src/application.cpp index 5b0785a995..bd459bc1e9 100644 --- a/main/src/application.cpp +++ b/main/src/application.cpp @@ -138,7 +138,7 @@ bool Application::notify(QObject *receiver, QEvent *event) catch(...) { Messagebox msg_box; - msg_box.show(trUtf8("Unknown exception caught!"), Messagebox::ERROR_ICON); + msg_box.show(trUtf8("Unknown exception caught!"), Messagebox::ErrorIcon); return(false); } } diff --git a/plugins/dummy/src/dummy.cpp b/plugins/dummy/src/dummy.cpp index b42391b490..bb6177f7bb 100644 --- a/plugins/dummy/src/dummy.cpp +++ b/plugins/dummy/src/dummy.cpp @@ -64,7 +64,7 @@ void Dummy::executePlugin(ModelWidget *) Messagebox msgbox; msgbox.show(trUtf8("Plugin successfully loaded!"), trUtf8("Plugin successfully loaded! Check the plugins wiki page to know how to create your own plugins."), - Messagebox::INFO_ICON); + Messagebox::InfoIcon); } QKeySequence Dummy::getPluginShortcut(void) From 91f1fdc49c28c6d9e1bc416059ce89c491f7935d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 10:05:45 -0300 Subject: [PATCH 170/425] Static const attributes refactoring checkpoint --- libpgmodeler_ui/src/aboutwidget.cpp | 8 +- libpgmodeler_ui/src/aggregatewidget.cpp | 4 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 6 +- libpgmodeler_ui/src/bugreportform.cpp | 2 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 2 +- libpgmodeler_ui/src/constraintwidget.cpp | 24 ++-- libpgmodeler_ui/src/customsqlwidget.cpp | 2 +- libpgmodeler_ui/src/datamanipulationform.cpp | 6 +- libpgmodeler_ui/src/domainwidget.cpp | 2 +- libpgmodeler_ui/src/donatewidget.cpp | 2 +- libpgmodeler_ui/src/elementstablewidget.cpp | 4 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 22 ++-- libpgmodeler_ui/src/functionwidget.cpp | 8 +- libpgmodeler_ui/src/hinttextwidget.cpp | 2 +- libpgmodeler_ui/src/mainwindow.cpp | 16 +-- libpgmodeler_ui/src/modeldatabasediffform.cpp | 18 +-- libpgmodeler_ui/src/modelexportform.cpp | 4 +- libpgmodeler_ui/src/modelfixform.cpp | 6 +- libpgmodeler_ui/src/modeloverviewwidget.cpp | 4 +- libpgmodeler_ui/src/modelrestorationform.cpp | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 124 +++++++++--------- libpgmodeler_ui/src/modelvalidationhelper.cpp | 40 +++--- libpgmodeler_ui/src/modelvalidationwidget.cpp | 30 ++--- libpgmodeler_ui/src/modelwidget.cpp | 38 +++--- libpgmodeler_ui/src/modelwidget.h | 14 +- libpgmodeler_ui/src/objectdepsrefswidget.cpp | 2 +- libpgmodeler_ui/src/objectsdiffinfo.cpp | 32 ++--- libpgmodeler_ui/src/objectsdiffinfo.h | 10 +- libpgmodeler_ui/src/objectstablewidget.cpp | 34 ++--- libpgmodeler_ui/src/objectstablewidget.h | 24 ++-- libpgmodeler_ui/src/operatorclasswidget.cpp | 2 +- libpgmodeler_ui/src/permissionwidget.cpp | 12 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 8 +- libpgmodeler_ui/src/pgmodeleruins.h | 8 +- libpgmodeler_ui/src/pgsqltypewidget.cpp | 6 +- libpgmodeler_ui/src/pgsqltypewidget.h | 2 +- libpgmodeler_ui/src/pluginsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/policywidget.cpp | 8 +- libpgmodeler_ui/src/relationshipwidget.cpp | 52 ++++---- libpgmodeler_ui/src/relationshipwidget.h | 12 +- libpgmodeler_ui/src/rolewidget.cpp | 4 +- libpgmodeler_ui/src/rulewidget.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 4 +- libpgmodeler_ui/src/snippetsconfigwidget.h | 2 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 4 +- libpgmodeler_ui/src/sourcecodewidget.h | 6 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 4 +- libpgmodeler_ui/src/sqlexecutionwidget.h | 2 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 10 +- libpgmodeler_ui/src/swapobjectsidswidget.h | 2 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 12 +- libpgmodeler_ui/src/syntaxhighlighter.h | 4 +- libpgmodeler_ui/src/tabledatawidget.cpp | 8 +- libpgmodeler_ui/src/tabledatawidget.h | 2 +- libpgmodeler_ui/src/tablewidget.cpp | 16 +-- libpgmodeler_ui/src/triggerwidget.cpp | 16 +-- libpgmodeler_ui/src/typewidget.cpp | 6 +- libpgmodeler_ui/src/updatenotifierwidget.cpp | 6 +- libpgmodeler_ui/src/validationinfo.cpp | 14 +- libpgmodeler_ui/src/validationinfo.h | 14 +- libpgmodeler_ui/src/viewwidget.cpp | 6 +- main-cli/src/pgmodelercli.cpp | 4 +- 62 files changed, 376 insertions(+), 376 deletions(-) diff --git a/libpgmodeler_ui/src/aboutwidget.cpp b/libpgmodeler_ui/src/aboutwidget.cpp index 9eb5bb9045..813ecb2a91 100644 --- a/libpgmodeler_ui/src/aboutwidget.cpp +++ b/libpgmodeler_ui/src/aboutwidget.cpp @@ -31,10 +31,10 @@ AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent) drop_shadow->setBlurRadius(30); this->setGraphicsEffect(drop_shadow); - PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::HUGE_FONT_FACTOR); - PgModelerUiNs::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNs::HUGE_FONT_FACTOR); - PgModelerUiNs::configureWidgetFont(build_lbl, PgModelerUiNs::BIG_FONT_FACTOR); - PgModelerUiNs::configureWidgetFont(build_num_lbl, PgModelerUiNs::BIG_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::HugeFontFactor); + PgModelerUiNs::configureWidgetFont(pgmodeler_ver_lbl, PgModelerUiNs::HugeFontFactor); + PgModelerUiNs::configureWidgetFont(build_lbl, PgModelerUiNs::BigFontFactor); + PgModelerUiNs::configureWidgetFont(build_num_lbl, PgModelerUiNs::BigFontFactor); pgmodeler_ver_lbl->setText(QString("v%1 ").arg(GlobalAttributes::PgModelerVersion)); build_num_lbl->setText(QString("%1 Qt %2").arg(GlobalAttributes::PgModelerBuildNumber).arg(QT_VERSION_STR)); diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index c55d52bffc..1990c19173 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -37,8 +37,8 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, ObjA input_type=new PgSQLTypeWidget(this, trUtf8("Input Data Type")); state_type=new PgSQLTypeWidget(this, trUtf8("State Data Type")); - input_types_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - ObjectsTableWidget::EDIT_BUTTON, true, this); + input_types_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + ObjectsTableWidget::EditButton, true, this); input_types_tab->setColumnCount(1); funcaoagregacao_grid->addWidget(final_func_sel,0,1,1,1); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index bae88b7438..32bfd24083 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -52,7 +52,7 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge tablespace_sel=nullptr; object_protected = false; - PgModelerUiNs::configureWidgetFont(protected_obj_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(protected_obj_lbl, PgModelerUiNs::MediumFontFactor); connect(edt_perms_tb, SIGNAL(clicked(bool)),this, SLOT(editPermissions(void))); connect(append_sql_tb, SIGNAL(clicked(bool)),this, SLOT(editCustomSQL(void))); @@ -542,7 +542,7 @@ QFrame *BaseObjectWidget::generateInformationFrame(const QString &msg) font.setBold(false); info_frm->setFont(font); - PgModelerUiNs::configureWidgetFont(info_frm, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(info_frm, PgModelerUiNs::MediumFontFactor); info_frm->setObjectName("info_frm"); info_frm->setFrameShape(QFrame::StyledPanel); @@ -623,7 +623,7 @@ QFrame *BaseObjectWidget::generateVersionWarningFrame(mapsetObjectName("alerta_frm"); alert_frm->setFrameShape(QFrame::StyledPanel); diff --git a/libpgmodeler_ui/src/bugreportform.cpp b/libpgmodeler_ui/src/bugreportform.cpp index 5d21da9201..aa5974f3bc 100644 --- a/libpgmodeler_ui/src/bugreportform.cpp +++ b/libpgmodeler_ui/src/bugreportform.cpp @@ -30,7 +30,7 @@ BugReportForm::BugReportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(paren Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); - PgModelerUiNs::configureWidgetFont(hint_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(hint_lbl, PgModelerUiNs::MediumFontFactor); connect(cancel_btn, SIGNAL(clicked(void)), this, SLOT(close(void))); connect(create_btn, SIGNAL(clicked(void)), this, SLOT(generateReport(void))); diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index c792aabd15..0a77814ec0 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -49,7 +49,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool vbox->setSpacing(6); completion_wgt->setLayout(vbox); - PgModelerUiNs::configureWidgetFont(name_list, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(name_list, PgModelerUiNs::MediumFontFactor); this->code_field_txt=code_field_txt; auto_triggered=false; diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 32eadbd5cf..9c60727b14 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -38,15 +38,15 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob expression_hl=new SyntaxHighlighter(expression_txt, false, true); expression_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - columns_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::EDIT_BUTTON | - ObjectsTableWidget::UPDATE_BUTTON | - ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + columns_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::EditButton | + ObjectsTableWidget::UpdateButton | + ObjectsTableWidget::DuplicateButton), true, this); - ref_columns_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::EDIT_BUTTON | - ObjectsTableWidget::UPDATE_BUTTON | - ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + ref_columns_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::EditButton | + ObjectsTableWidget::UpdateButton | + ObjectsTableWidget::DuplicateButton), true, this); ref_table_sel=new ObjectSelectorWidget(ObjTable, true, this); @@ -156,7 +156,7 @@ void ConstraintWidget::addColumn(int row) addColumn(column, col_id, row); //When there is no items con the combo the insert button of the table is disabled - aux_col_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (combo->count()!=0)); + aux_col_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, (combo->count()!=0)); } catch(Exception &e) { @@ -267,7 +267,7 @@ void ConstraintWidget::updateColumnsCombo(unsigned col_id) QString(")"), QVariant::fromValue(column)); } - aux_col_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (combo->count()!=0)); + aux_col_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, (combo->count()!=0)); } catch(Exception &e) { @@ -381,7 +381,7 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis } updateColumnsCombo(Constraint::SourceCols); - columns_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (column_cmb->count()!=0)); + columns_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, (column_cmb->count()!=0)); columns_tab->blockSignals(false); if(constr) @@ -422,7 +422,7 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis } updateColumnsCombo(Constraint::ReferencedCols); - ref_columns_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (column_cmb->count()!=0)); + ref_columns_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, (column_cmb->count()!=0)); ref_columns_tab->blockSignals(false); } } diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index d357e39912..c533f3a5b7 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -43,7 +43,7 @@ CustomSQLWidget::CustomSQLWidget(QWidget *parent) : BaseObjectWidget(parent) comment_edt->setVisible(false); comment_lbl->setVisible(false); - PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); action_gen_insert=new QAction(trUtf8("Generic INSERT"), this); action_gen_insert->setObjectName(QString("action_gen_insert")); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index a644c32728..8d5264486f 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -42,8 +42,8 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): table_oid=0; - PgModelerUiNs::configureWidgetFont(hint_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); - PgModelerUiNs::configureWidgetFont(warning_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(hint_lbl, PgModelerUiNs::MediumFontFactor); + PgModelerUiNs::configureWidgetFont(warning_lbl, PgModelerUiNs::MediumFontFactor); filter_hl=new SyntaxHighlighter(filter_txt); filter_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); @@ -1359,7 +1359,7 @@ QString DataManipulationForm::getDMLCommand(int row) { data = results_tbw->item(row, col_names.indexOf(pk_col))->data(Qt::UserRole); - if(data.toString() == SQLExecutionWidget::COLUMN_NULL_VALUE) + if(data.toString() == SQLExecutionWidget::ColumnNullValue) flt_list.push_back(QString("\"%1\" IS NULL").arg(pk_col)); else flt_list.push_back(QString("\"%1\"='%2'").arg(pk_col).arg(data.toString().replace("\'","''"))); diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index 614bbc25ed..b405d38004 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -36,7 +36,7 @@ DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjDomain) grid->addWidget(data_type, 1, 0, 1, 2); grid->addItem(new QSpacerItem(10, 1, QSizePolicy::Fixed,QSizePolicy::Expanding), 2, 0, 1, 1); - constr_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ (ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + constr_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ (ObjectsTableWidget::DuplicateButton), true, this); constr_tab->setColumnCount(2); constr_tab->setHeaderLabel(trUtf8("Name"), 0); diff --git a/libpgmodeler_ui/src/donatewidget.cpp b/libpgmodeler_ui/src/donatewidget.cpp index f421abbada..fbfa9853a9 100644 --- a/libpgmodeler_ui/src/donatewidget.cpp +++ b/libpgmodeler_ui/src/donatewidget.cpp @@ -45,6 +45,6 @@ DonateWidget::DonateWidget(QWidget *parent) : QWidget(parent) emit s_visibilityChanged(false); }); - PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::BIG_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::BigFontFactor); this->adjustSize(); } diff --git a/libpgmodeler_ui/src/elementstablewidget.cpp b/libpgmodeler_ui/src/elementstablewidget.cpp index 14eae42b12..fec169792d 100644 --- a/libpgmodeler_ui/src/elementstablewidget.cpp +++ b/libpgmodeler_ui/src/elementstablewidget.cpp @@ -33,8 +33,8 @@ ElementsTableWidget::ElementsTableWidget(QWidget *parent) : QWidget(parent) connect(&element_form, SIGNAL(accepted()), element_wgt, SLOT(applyConfiguration())); QVBoxLayout *vbox = new QVBoxLayout(this); - elements_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::UPDATE_BUTTON | ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + elements_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::UpdateButton | ObjectsTableWidget::DuplicateButton), true, this); elements_tab->setColumnCount(7); elements_tab->setHeaderLabel(trUtf8("Element"), 0); diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 4d43707a89..51cb8d4365 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -27,12 +27,12 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent Ui_EventTriggerWidget::setupUi(this); function_sel=new ObjectSelectorWidget(ObjFunction, true, this); - filter_tab=new ObjectsTableWidget(ObjectsTableWidget::ADD_BUTTON | - ObjectsTableWidget::EDIT_BUTTON | - ObjectsTableWidget::UPDATE_BUTTON | - ObjectsTableWidget::REMOVE_BUTTON | - ObjectsTableWidget::REMOVE_ALL_BUTTON | - ObjectsTableWidget::MOVE_BUTTONS, false, this); + filter_tab=new ObjectsTableWidget(ObjectsTableWidget::AddButton | + ObjectsTableWidget::EditButton | + ObjectsTableWidget::UpdateButton | + ObjectsTableWidget::RemoveButton | + ObjectsTableWidget::RemoveAllButton | + ObjectsTableWidget::MoveButtons, false, this); filter_tab->setColumnCount(1); filter_tab->setHeaderLabel(trUtf8("Tag command"), 0); @@ -59,15 +59,15 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent connect(filter_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(handleTagValue(int))); connect(filter_tab, &ObjectsTableWidget::s_rowsRemoved, - [&](){ filter_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, false); }); + [&](){ filter_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, false); }); connect(filter_tab, &ObjectsTableWidget::s_rowEdited, [&](int row){ tag_edt->setText(filter_tab->getCellText(row, 0)); }); connect(tag_edt, &QLineEdit::textChanged, [&](){ - filter_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, !tag_edt->text().isEmpty()); - filter_tab->setButtonsEnabled(ObjectsTableWidget::UPDATE_BUTTON, !tag_edt->text().isEmpty()); + filter_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, !tag_edt->text().isEmpty()); + filter_tab->setButtonsEnabled(ObjectsTableWidget::UpdateButton, !tag_edt->text().isEmpty()); }); setMinimumSize(500, 440); @@ -100,7 +100,7 @@ void EventTriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_l filter_tab->clearSelection(); } - filter_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, false); + filter_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, false); } void EventTriggerWidget::applyConfiguration(void) @@ -136,7 +136,7 @@ void EventTriggerWidget::handleTagValue(int row) filter_tab->setCellText(tag_edt->text().simplified(), row, 0); tag_edt->clear(); filter_tab->clearSelection(); - filter_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, false); + filter_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, false); } else if(filter_tab->getCellText(row, 0).isEmpty()) filter_tab->removeRow(row); diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index 688031a886..e7b5eedb63 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -47,16 +47,16 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjFun vlayout->addWidget(ret_type); vlayout->addSpacerItem(spacer); - return_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - ObjectsTableWidget::UPDATE_BUTTON, true, this); + return_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + ObjectsTableWidget::UpdateButton, true, this); return_tab->setColumnCount(2); return_tab->setHeaderLabel(trUtf8("Column"), 0); return_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("column")),0); return_tab->setHeaderLabel(trUtf8("Type"), 1); return_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); - parameters_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - ObjectsTableWidget::UPDATE_BUTTON, true, this); + parameters_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + ObjectsTableWidget::UpdateButton, true, this); parameters_tab->setColumnCount(4); parameters_tab->setHeaderLabel(trUtf8("Name"),0); parameters_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("parameter")),0); diff --git a/libpgmodeler_ui/src/hinttextwidget.cpp b/libpgmodeler_ui/src/hinttextwidget.cpp index bfa1fc9610..d2184384c8 100644 --- a/libpgmodeler_ui/src/hinttextwidget.cpp +++ b/libpgmodeler_ui/src/hinttextwidget.cpp @@ -49,7 +49,7 @@ HintTextWidget::HintTextWidget(QWidget *btn_parent, QWidget *parent): QWidget(pa this->setVisible(false); text_lbl->installEventFilter(this); - PgModelerUiNs::configureWidgetFont(text_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(text_lbl, PgModelerUiNs::MediumFontFactor); parent->installEventFilter(this); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 7bba6b0171..7aa952c7e9 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -352,7 +352,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par if(btn) { - PgModelerUiNs::configureWidgetFont(btn, static_cast(PgModelerUiNs::MEDIUM_FONT_FACTOR)); + PgModelerUiNs::configureWidgetFont(btn, static_cast(PgModelerUiNs::MediumFontFactor)); font = btn->font(); font.setBold(true); btn->setFont(font); @@ -1068,7 +1068,7 @@ void MainWindow::setCurrentModel(void) for(QToolButton *btn : btns) { - PgModelerUiNs::configureWidgetFont(btn, static_cast(PgModelerUiNs::MEDIUM_FONT_FACTOR)); + PgModelerUiNs::configureWidgetFont(btn, static_cast(PgModelerUiNs::MediumFontFactor)); font = btn->font(); font.setBold(true); btn->setFont(font); @@ -1176,10 +1176,10 @@ void MainWindow::applyZoom(void) if(sender()==action_normal_zoom) zoom=1; - else if(sender()==action_inc_zoom && zoom < ModelWidget::MAXIMUM_ZOOM) - zoom+=ModelWidget::ZOOM_INCREMENT; - else if(sender()==action_dec_zoom && zoom > ModelWidget::MINIMUM_ZOOM) - zoom-=ModelWidget::ZOOM_INCREMENT; + else if(sender()==action_inc_zoom && zoom < ModelWidget::MaximumZoom) + zoom+=ModelWidget::ZoomIncrement; + else if(sender()==action_dec_zoom && zoom > ModelWidget::MinimumZoom) + zoom-=ModelWidget::ZoomIncrement; current_model->applyZoom(zoom); } @@ -1687,9 +1687,9 @@ void MainWindow::updateToolsState(bool model_closed) action_undo->setEnabled(current_model->op_list->isUndoAvailable()); action_redo->setEnabled(current_model->op_list->isRedoAvailable()); - action_inc_zoom->setEnabled(current_model->getCurrentZoom() <= (ModelWidget::MAXIMUM_ZOOM - ModelWidget::ZOOM_INCREMENT)); + action_inc_zoom->setEnabled(current_model->getCurrentZoom() <= (ModelWidget::MaximumZoom - ModelWidget::ZoomIncrement)); action_normal_zoom->setEnabled(current_model->getCurrentZoom()!=0); - action_dec_zoom->setEnabled(current_model->getCurrentZoom() >= ModelWidget::MINIMUM_ZOOM); + action_dec_zoom->setEnabled(current_model->getCurrentZoom() >= ModelWidget::MinimumZoom); } } diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index dad7bb1c2d..d8dfe04d0c 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -102,7 +102,7 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) pgsql_ver_cmb->addItems(PgSqlVersions::AllVersions); - PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); connect(cancel_btn, &QToolButton::clicked, [&](){ cancelOperation(true); }); connect(pgsql_ver_chk, SIGNAL(toggled(bool)), pgsql_ver_cmb, SLOT(setEnabled(bool))); @@ -585,10 +585,10 @@ void ModelDatabaseDiffForm::exportDiff(bool confirm) void ModelDatabaseDiffForm::filterDiffInfos(void) { QToolButton *btn=dynamic_cast(sender()); - map diff_types={ {create_tb, ObjectsDiffInfo::CREATE_OBJECT}, - {drop_tb, ObjectsDiffInfo::DROP_OBJECT}, - {alter_tb, ObjectsDiffInfo::ALTER_OBJECT}, - {ignore_tb, ObjectsDiffInfo::IGNORE_OBJECT}}; + map diff_types={ {create_tb, ObjectsDiffInfo::CreateObject}, + {drop_tb, ObjectsDiffInfo::DropObject}, + {alter_tb, ObjectsDiffInfo::AlterObject}, + {ignore_tb, ObjectsDiffInfo::IgnoreObject}}; for(int i=0; i < diff_item->childCount(); i++) { @@ -850,10 +850,10 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType void ModelDatabaseDiffForm::updateDiffInfo(ObjectsDiffInfo diff_info) { - map buttons={ {ObjectsDiffInfo::CREATE_OBJECT, create_tb}, - {ObjectsDiffInfo::DROP_OBJECT, drop_tb}, - {ObjectsDiffInfo::ALTER_OBJECT, alter_tb}, - {ObjectsDiffInfo::IGNORE_OBJECT, ignore_tb} }; + map buttons={ {ObjectsDiffInfo::CreateObject, create_tb}, + {ObjectsDiffInfo::DropObject, drop_tb}, + {ObjectsDiffInfo::AlterObject, alter_tb}, + {ObjectsDiffInfo::IgnoreObject, ignore_tb} }; unsigned diff_type=diff_info.getDiffType(); QToolButton *btn=buttons[diff_type]; diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index e0c95687fc..b84730a3a1 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -96,8 +96,8 @@ ModelExportForm::ModelExportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(p pgsqlvers_cmb->addItems(PgSqlVersions::AllVersions); pgsqlvers1_cmb->addItems(PgSqlVersions::AllVersions); - double values[]={ ModelWidget::MINIMUM_ZOOM, 0.10f, 0.25f, 0.5f, 0.75f, 1, 1.25f, 1.50f, 1.75f, 2, - 2.25, 2.50, 2.75, 3, 3.25, 3.50, 3.75, ModelWidget::MAXIMUM_ZOOM }; + double values[]={ ModelWidget::MinimumZoom, 0.10f, 0.25f, 0.5f, 0.75f, 1, 1.25f, 1.50f, 1.75f, 2, + 2.25, 2.50, 2.75, 3, 3.25, 3.50, 3.75, ModelWidget::MaximumZoom }; unsigned cnt=sizeof(values)/sizeof(double); for(unsigned i=0; i < cnt; i++) diff --git a/libpgmodeler_ui/src/modelfixform.cpp b/libpgmodeler_ui/src/modelfixform.cpp index 48fbb723db..00bf60f9bf 100644 --- a/libpgmodeler_ui/src/modelfixform.cpp +++ b/libpgmodeler_ui/src/modelfixform.cpp @@ -30,9 +30,9 @@ ModelFixForm::ModelFixForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, setupUi(this); hideEvent(nullptr); - PgModelerUiNs::configureWidgetFont(invalid_cli_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); - PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); - PgModelerUiNs::configureWidgetFont(not_found_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(invalid_cli_lbl, PgModelerUiNs::MediumFontFactor); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); + PgModelerUiNs::configureWidgetFont(not_found_lbl, PgModelerUiNs::MediumFontFactor); //Configuring font style for output widget if(!confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT].isEmpty()) diff --git a/libpgmodeler_ui/src/modeloverviewwidget.cpp b/libpgmodeler_ui/src/modeloverviewwidget.cpp index aeb75899a8..04ccd326ac 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.cpp +++ b/libpgmodeler_ui/src/modeloverviewwidget.cpp @@ -106,9 +106,9 @@ bool ModelOverviewWidget::eventFilter(QObject *object, QEvent *event) QPoint dt_angle = w_event->angleDelta(); if(dt_angle.y() < 0) - model->applyZoom(model->getCurrentZoom() - ModelWidget::ZOOM_INCREMENT); + model->applyZoom(model->getCurrentZoom() - ModelWidget::ZoomIncrement); else - model->applyZoom(model->getCurrentZoom() + ModelWidget::ZOOM_INCREMENT); + model->applyZoom(model->getCurrentZoom() + ModelWidget::ZoomIncrement); return(false); } diff --git a/libpgmodeler_ui/src/modelrestorationform.cpp b/libpgmodeler_ui/src/modelrestorationform.cpp index df3a14c152..7c0dacabf0 100644 --- a/libpgmodeler_ui/src/modelrestorationform.cpp +++ b/libpgmodeler_ui/src/modelrestorationform.cpp @@ -23,7 +23,7 @@ ModelRestorationForm::ModelRestorationForm(QWidget *parent, Qt::WindowFlags f) : { setupUi(this); - PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); keep_models_ht=new HintTextWidget(keep_models_hint, this); keep_models_ht->setText(keep_models_chk->statusTip()); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 2b4f862026..01e0e3663f 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -62,10 +62,10 @@ void ModelsDiffHelper::setPgSQLVersion(const QString pgsql_ver) void ModelsDiffHelper::resetDiffCounter(void) { - diffs_counter[ObjectsDiffInfo::ALTER_OBJECT]=0; - diffs_counter[ObjectsDiffInfo::DROP_OBJECT]=0; - diffs_counter[ObjectsDiffInfo::CREATE_OBJECT]=0; - diffs_counter[ObjectsDiffInfo::IGNORE_OBJECT]=0; + diffs_counter[ObjectsDiffInfo::AlterObject]=0; + diffs_counter[ObjectsDiffInfo::DropObject]=0; + diffs_counter[ObjectsDiffInfo::CreateObject]=0; + diffs_counter[ObjectsDiffInfo::IgnoreObject]=0; } QString ModelsDiffHelper::getDiffDefinition(void) @@ -81,7 +81,7 @@ void ModelsDiffHelper::setModels(DatabaseModel *src_model, DatabaseModel *imp_mo unsigned ModelsDiffHelper::getDiffTypeCount(unsigned diff_type) { - if(diff_type >= ObjectsDiffInfo::NO_DIFFERENCE) + if(diff_type >= ObjectsDiffInfo::NoDifference) throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(diffs_counter[diff_type]); @@ -95,9 +95,9 @@ void ModelsDiffHelper::diffModels(void) throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); //First, we need to detect the objects to be dropped - diffModels(ObjectsDiffInfo::DROP_OBJECT); + diffModels(ObjectsDiffInfo::DropObject); //Second, we will check the objects to be created or modified - diffModels(ObjectsDiffInfo::CREATE_OBJECT); + diffModels(ObjectsDiffInfo::CreateObject); if(diff_canceled) emit s_diffCanceled(); @@ -129,15 +129,15 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d Table *ref_tab=nullptr, *comp_tab=nullptr; BaseObject *aux_obj=nullptr; - if(diff_type==ObjectsDiffInfo::DROP_OBJECT) + if(diff_type==ObjectsDiffInfo::DropObject) { /* In case of DROP, the reference table is the one from the database and the compared table is the one from model */ ref_tab=imp_table; comp_tab=src_table; } - else if(diff_type==ObjectsDiffInfo::CREATE_OBJECT || - diff_type==ObjectsDiffInfo::ALTER_OBJECT) + else if(diff_type==ObjectsDiffInfo::CreateObject || + diff_type==ObjectsDiffInfo::AlterObject) { ref_tab=src_table; comp_tab=imp_table; @@ -158,7 +158,7 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d (constr && constr->isAddedByGeneralization() && constr->getConstraintType()==ConstraintType::check)) { - generateDiffInfo(ObjectsDiffInfo::IGNORE_OBJECT, tab_obj); + generateDiffInfo(ObjectsDiffInfo::IgnoreObject, tab_obj); } else { @@ -166,26 +166,26 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d columns created by common relationships will be considered on the comparison. Also, foreign keys are discarded here, since they will be compared on the main comparison at diffModels() */ - if(aux_obj && diff_type!=ObjectsDiffInfo::DROP_OBJECT && + if(aux_obj && diff_type!=ObjectsDiffInfo::DropObject && ((tab_obj->isAddedByGeneralization() || !tab_obj->isAddedByLinking() || (aux_obj->getObjectType()==ObjColumn && tab_obj->isAddedByLinking())) || (constr && constr->getConstraintType()!=ConstraintType::foreign_key))) { //If there are some differences on the XML code of the objects if(tab_obj->isCodeDiffersFrom(aux_obj)) - generateDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, tab_obj, aux_obj); + generateDiffInfo(ObjectsDiffInfo::AlterObject, tab_obj, aux_obj); } /* If the object does not exists it will generate a drop info and the original one (tab_obj) was not included by generalization or partitioning (to avoid drop inherited/copied columns) */ else if(!aux_obj && !tab_obj->isAddedByGeneralization() && !tab_obj->isAddedByCopy()) { - if(diff_type!=ObjectsDiffInfo::DROP_OBJECT || - (diff_type==ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OptDontDropMissingObjs]) || - (diff_type==ObjectsDiffInfo::DROP_OBJECT && diff_opts[OptDropMissingColsConstr])) + if(diff_type!=ObjectsDiffInfo::DropObject || + (diff_type==ObjectsDiffInfo::DropObject && !diff_opts[OptDontDropMissingObjs]) || + (diff_type==ObjectsDiffInfo::DropObject && diff_opts[OptDropMissingColsConstr])) generateDiffInfo(diff_type, tab_obj); else - generateDiffInfo(ObjectsDiffInfo::IGNORE_OBJECT, tab_obj); + generateDiffInfo(ObjectsDiffInfo::IgnoreObject, tab_obj); } } @@ -210,7 +210,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) DatabaseModel *aux_model=nullptr; bool objs_differs=false, xml_differs=false; - if(diff_type==ObjectsDiffInfo::DROP_OBJECT) + if(diff_type==ObjectsDiffInfo::DropObject) { /* For DROP detection, we must gather the objects from the database in order to check if they exists on the model. The object drop order here is the inverse of the creation order @@ -219,8 +219,8 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) aux_model=source_model; factor=25; } - else if(diff_type==ObjectsDiffInfo::CREATE_OBJECT || - diff_type==ObjectsDiffInfo::ALTER_OBJECT) + else if(diff_type==ObjectsDiffInfo::CreateObject || + diff_type==ObjectsDiffInfo::AlterObject) { /* For creation or modification of objects the order followed is the same as the creation order on the source model */ @@ -242,8 +242,8 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) 3) Cluster objects such as roles and tablespaces (when the operatoin is DROP and keep_cluster_objs is true) */ if(obj_type!=ObjBaseRelationship && !object->isSystemObject() && !object->isSQLDisabled() && - ((diff_type==ObjectsDiffInfo::DROP_OBJECT && (!diff_opts[OptKeepClusterObjs] || (diff_opts[OptKeepClusterObjs] && obj_type!=ObjRole && obj_type!=ObjTablespace))) || - (diff_type!=ObjectsDiffInfo::DROP_OBJECT))) + ((diff_type==ObjectsDiffInfo::DropObject && (!diff_opts[OptKeepClusterObjs] || (diff_opts[OptKeepClusterObjs] && obj_type!=ObjRole && obj_type!=ObjTablespace))) || + (diff_type!=ObjectsDiffInfo::DropObject))) { emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), trUtf8("Processing object `%1' (%2)...").arg(object->getSignature()).arg(object->getTypeName()), @@ -256,10 +256,10 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) the permission is ignored */ if(obj_type==ObjPermission && - ((diff_type==ObjectsDiffInfo::DROP_OBJECT && + ((diff_type==ObjectsDiffInfo::DropObject && !diff_opts[OptKeepObjectPerms]) || - (diff_type==ObjectsDiffInfo::CREATE_OBJECT && + (diff_type==ObjectsDiffInfo::CreateObject && (aux_model->getPermissionIndex(dynamic_cast(object), true) < 0 || !diff_opts[OptKeepObjectPerms])))) generateDiffInfo(diff_type, object); @@ -294,8 +294,8 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) aux_rel && rel->getPartitionBoundingExpr().simplified() != aux_rel->getPartitionBoundingExpr().simplified()) { - generateDiffInfo(ObjectsDiffInfo::DROP_OBJECT, rel); - generateDiffInfo(ObjectsDiffInfo::CREATE_OBJECT, rel); + generateDiffInfo(ObjectsDiffInfo::DropObject, rel); + generateDiffInfo(ObjectsDiffInfo::CreateObject, rel); } } } @@ -309,7 +309,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) if(obj_type==ObjTable && !aux_object) aux_object=getRelNNTable(obj_name, aux_model); - if(diff_type != ObjectsDiffInfo::DROP_OBJECT && aux_object) + if(diff_type != ObjectsDiffInfo::DropObject && aux_object) { /* Try to get a diff from the retrieve object and the current object, comparing only basic attributes like schema, tablespace and owner @@ -336,14 +336,14 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) //If a difference was detected between the objects if(objs_differs || xml_differs) { - generateDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, object, aux_object); + generateDiffInfo(ObjectsDiffInfo::AlterObject, object, aux_object); //If the object is a table, do additional comparision between their child objects if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && object->getObjectType()==ObjTable) { Table *tab=dynamic_cast
(object), *aux_tab=dynamic_cast
(aux_object); - diffTables(tab, aux_tab, ObjectsDiffInfo::DROP_OBJECT); - diffTables(tab, aux_tab, ObjectsDiffInfo::CREATE_OBJECT); + diffTables(tab, aux_tab, ObjectsDiffInfo::DropObject); + diffTables(tab, aux_tab, ObjectsDiffInfo::CreateObject); } objs_differs=xml_differs=false; @@ -351,11 +351,11 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) } else if(!aux_object) { - if(diff_type != ObjectsDiffInfo::DROP_OBJECT || - (diff_type == ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OptDontDropMissingObjs])) + if(diff_type != ObjectsDiffInfo::DropObject || + (diff_type == ObjectsDiffInfo::DropObject && !diff_opts[OptDontDropMissingObjs])) generateDiffInfo(diff_type, object); else - generateDiffInfo(ObjectsDiffInfo::IGNORE_OBJECT, object); + generateDiffInfo(ObjectsDiffInfo::IgnoreObject, object); } } } @@ -363,10 +363,10 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) else if(TableObject::isTableObject(obj_type)) diffTableObject(dynamic_cast(object), diff_type); //Comparison between model db and the imported db - else if(diff_type==ObjectsDiffInfo::CREATE_OBJECT) + else if(diff_type==ObjectsDiffInfo::CreateObject) { if(!source_model->getAlterDefinition(imported_model).isEmpty()) - generateDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, source_model, imported_model); + generateDiffInfo(ObjectsDiffInfo::AlterObject, source_model, imported_model); } if(diff_canceled) @@ -374,7 +374,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) } else { - generateDiffInfo(ObjectsDiffInfo::IGNORE_OBJECT, object); + generateDiffInfo(ObjectsDiffInfo::IgnoreObject, object); emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), trUtf8("Skipping object `%1' (%2)...").arg(object->getSignature()).arg(object->getTypeName()), object->getObjectType()); @@ -402,7 +402,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) tab_name=base_tab->getSignature(); //If the operation is a DROP, try to get the table from the source mode - if(diff_type==ObjectsDiffInfo::DROP_OBJECT) + if(diff_type==ObjectsDiffInfo::DropObject) { aux_base_tab=dynamic_cast(source_model->getObject(tab_name, base_tab->getObjectType())); @@ -410,7 +410,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) if(!aux_base_tab) aux_base_tab=dynamic_cast(getRelNNTable(tab_name, source_model)); } - else if(diff_type==ObjectsDiffInfo::CREATE_OBJECT || diff_type==ObjectsDiffInfo::ALTER_OBJECT) + else if(diff_type==ObjectsDiffInfo::CreateObject || diff_type==ObjectsDiffInfo::AlterObject) { aux_base_tab=dynamic_cast(imported_model->getObject(tab_name, base_tab->getObjectType())); @@ -432,14 +432,14 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) if(!aux_tab_obj) { - if(diff_type!=ObjectsDiffInfo::DROP_OBJECT || - (diff_type==ObjectsDiffInfo::DROP_OBJECT && !diff_opts[OptDontDropMissingObjs])) + if(diff_type!=ObjectsDiffInfo::DropObject || + (diff_type==ObjectsDiffInfo::DropObject && !diff_opts[OptDontDropMissingObjs])) generateDiffInfo(diff_type, tab_obj); else - generateDiffInfo(ObjectsDiffInfo::IGNORE_OBJECT, tab_obj); + generateDiffInfo(ObjectsDiffInfo::IgnoreObject, tab_obj); } - else if(diff_type!=ObjectsDiffInfo::DROP_OBJECT && tab_obj->isCodeDiffersFrom(aux_tab_obj)) - generateDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, tab_obj, aux_tab_obj); + else if(diff_type!=ObjectsDiffInfo::DropObject && tab_obj->isCodeDiffersFrom(aux_tab_obj)) + generateDiffInfo(ObjectsDiffInfo::AlterObject, tab_obj, aux_tab_obj); } BaseObject *ModelsDiffHelper::getRelNNTable(const QString &obj_name, DatabaseModel *model) @@ -473,13 +473,13 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, /* If the info is for ALTER and there is a DROP info on the list, * the object will be recreated instead of modified */ if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && - diff_type==ObjectsDiffInfo::ALTER_OBJECT && - isDiffInfoExists(ObjectsDiffInfo::DROP_OBJECT, old_object, nullptr) && - !isDiffInfoExists(ObjectsDiffInfo::CREATE_OBJECT, object, nullptr)) + diff_type==ObjectsDiffInfo::AlterObject && + isDiffInfoExists(ObjectsDiffInfo::DropObject, old_object, nullptr) && + !isDiffInfoExists(ObjectsDiffInfo::CreateObject, object, nullptr)) { - diff_info=ObjectsDiffInfo(ObjectsDiffInfo::CREATE_OBJECT, object, nullptr); + diff_info=ObjectsDiffInfo(ObjectsDiffInfo::CreateObject, object, nullptr); diff_infos.push_back(diff_info); - diffs_counter[ObjectsDiffInfo::CREATE_OBJECT]++; + diffs_counter[ObjectsDiffInfo::CreateObject]++; emit s_objectsDiffInfoGenerated(diff_info); } else if(!isDiffInfoExists(diff_type, object, old_object)) @@ -491,7 +491,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, * If the type of them is "serial" or similar then a sequence will be created and the * type of the column changed to "integer" or similar, this because the ALTER command * for columns don't accept the type "serial" */ - if(diff_type==ObjectsDiffInfo::ALTER_OBJECT && col && old_col && + if(diff_type==ObjectsDiffInfo::AlterObject && col && old_col && (col->getType()!=old_col->getType() && col->getType().isSerialType())) { Column *aux_col=new Column; @@ -522,18 +522,18 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, (!col->getType().getAliasType().isEquivalentTo(old_col->getType()) || (old_col->getSequence() && old_col->getSequence()->getSignature() != seq->getSignature())))) { - diff_info=ObjectsDiffInfo(ObjectsDiffInfo::ALTER_OBJECT, aux_col, col); + diff_info=ObjectsDiffInfo(ObjectsDiffInfo::AlterObject, aux_col, col); diff_infos.push_back(diff_info); - diffs_counter[ObjectsDiffInfo::ALTER_OBJECT]++; + diffs_counter[ObjectsDiffInfo::AlterObject]++; emit s_objectsDiffInfoGenerated(diff_info); } if(!diff_opts[OptReuseSequences] || imported_model->getObjectIndex(seq->getSignature(), ObjSequence) < 0) { //Creates a CREATE info with the sequence - diff_info=ObjectsDiffInfo(ObjectsDiffInfo::CREATE_OBJECT, seq, nullptr); + diff_info=ObjectsDiffInfo(ObjectsDiffInfo::CreateObject, seq, nullptr); diff_infos.push_back(diff_info); - diffs_counter[ObjectsDiffInfo::CREATE_OBJECT]++; + diffs_counter[ObjectsDiffInfo::CreateObject]++; emit s_objectsDiffInfoGenerated(diff_info); } else if(diff_opts[OptReuseSequences]) @@ -544,7 +544,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, while(itr!=itr_end) { - if(itr->getDiffType()==ObjectsDiffInfo::DROP_OBJECT && + if(itr->getDiffType()==ObjectsDiffInfo::DropObject && itr->getObject()->getObjectType()==ObjSequence && itr->getObject()->getSignature()==seq->getSignature()) { @@ -572,7 +572,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, /* If the info is for DROP, generate the drop for referer objects of the one marked to be dropped */ if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && - diff_type==ObjectsDiffInfo::DROP_OBJECT) + diff_type==ObjectsDiffInfo::DropObject) { vector ref_objs; ObjectType obj_type=object->getObjectType(); @@ -710,7 +710,7 @@ void ModelsDiffHelper::processDiffInfos(void) } //Generating the DROP commands - if(diff_type==ObjectsDiffInfo::DROP_OBJECT) + if(diff_type==ObjectsDiffInfo::DropObject) { if(rel && (rel->getRelationshipType()==BaseRelationship::RelationshipGen || rel->getRelationshipType()==BaseRelationship::RelationshipPart)) @@ -737,7 +737,7 @@ void ModelsDiffHelper::processDiffInfos(void) } } //Generating the CREATE commands - else if(diff_type==ObjectsDiffInfo::CREATE_OBJECT) + else if(diff_type==ObjectsDiffInfo::CreateObject) { if(rel && (rel->getRelationshipType()==BaseRelationship::RelationshipGen || rel->getRelationshipType()==BaseRelationship::RelationshipPart)) @@ -769,7 +769,7 @@ void ModelsDiffHelper::processDiffInfos(void) } } //Generating the ALTER commands - else if(diff_type==ObjectsDiffInfo::ALTER_OBJECT) + else if(diff_type==ObjectsDiffInfo::AlterObject) { //Recreating the object instead of generating an ALTER command for it if((diff_opts[OptForceRecreation] && obj_type!=ObjDatabase) && @@ -788,7 +788,7 @@ void ModelsDiffHelper::processDiffInfos(void) for(auto &obj : create_vect) { //The there is no ALTER info registered for an object's reference - if(!isDiffInfoExists(ObjectsDiffInfo::ALTER_OBJECT, nullptr, obj, false)) + if(!isDiffInfoExists(ObjectsDiffInfo::AlterObject, nullptr, obj, false)) { /* Special case for constraints, their code will be appeded to a separated variable in order to create them at the end of diff buffer */ @@ -1062,13 +1062,13 @@ void ModelsDiffHelper::recreateObject(BaseObject *object, vector & /* Register a drop info for the object only if there is no drop registered previously, avoiding multiple drop statments for the same object */ - if(aux_obj && !isDiffInfoExists(ObjectsDiffInfo::DROP_OBJECT, aux_obj, nullptr)) + if(aux_obj && !isDiffInfoExists(ObjectsDiffInfo::DropObject, aux_obj, nullptr)) drop_objs.push_back(aux_obj); /* Register a create info for the object only if there is no drop or create registered previously, avoiding wrongly recreating the object */ - if(!isDiffInfoExists(ObjectsDiffInfo::DROP_OBJECT, aux_obj, nullptr) && - !isDiffInfoExists(ObjectsDiffInfo::CREATE_OBJECT, aux_obj, nullptr)) + if(!isDiffInfoExists(ObjectsDiffInfo::DropObject, aux_obj, nullptr) && + !isDiffInfoExists(ObjectsDiffInfo::CreateObject, aux_obj, nullptr)) create_objs.push_back(object); //Executing the recreation of the object's references diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index 23d2d5f811..0bad6d7897 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -46,8 +46,8 @@ ModelValidationHelper::~ModelValidationHelper(void) void ModelValidationHelper::generateValidationInfo(unsigned val_type, BaseObject *object, vector refs) { if(!refs.empty() || - val_type==ValidationInfo::MISSING_EXTENSION || - (val_type==ValidationInfo::BROKEN_REL_CONFIG && + val_type==ValidationInfo::MissingExtension || + (val_type==ValidationInfo::BrokenRelConfig && std::find(inv_rels.begin(), inv_rels.end(), object)==inv_rels.end())) { //Configures a validation info @@ -55,7 +55,7 @@ void ModelValidationHelper::generateValidationInfo(unsigned val_type, BaseObject error_count++; val_infos.push_back(info); - if(val_type==ValidationInfo::BROKEN_REL_CONFIG) + if(val_type==ValidationInfo::BrokenRelConfig) inv_rels.push_back(object); //Emit the signal containing the info @@ -71,13 +71,13 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) BaseObject *obj=nullptr; //Resolving broken references by swaping the object ids - if(info.getValidationType()==ValidationInfo::BROKEN_REFERENCE || - info.getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE) + if(info.getValidationType()==ValidationInfo::BrokenReference || + info.getValidationType()==ValidationInfo::SpObjBrokenReference) { BaseObject *info_obj=info.getObject(), *aux_obj=nullptr; unsigned obj_id=info_obj->getObjectId(); - if(info.getValidationType()==ValidationInfo::BROKEN_REFERENCE) + if(info.getValidationType()==ValidationInfo::BrokenReference) { //Search for the object with the minor id while(!refs.empty() && !valid_canceled) @@ -132,7 +132,7 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) emit s_objectIdChanged(info_obj); } //Resolving no unique name by renaming the constraints/indexes - else if(info.getValidationType()==ValidationInfo::NO_UNIQUE_NAME) + else if(info.getValidationType()==ValidationInfo::NoUniqueName) { unsigned suffix=1; QString new_name; @@ -192,7 +192,7 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) } } //Resolving the absence of postgis extension - else if(info.getValidationType()==ValidationInfo::MISSING_EXTENSION && !db_model->getExtension(QString("postgis"))) + else if(info.getValidationType()==ValidationInfo::MissingExtension && !db_model->getExtension(QString("postgis"))) { Extension *extension = new Extension(); extension->setName(QString("postgis")); @@ -412,7 +412,7 @@ void ModelValidationHelper::validateModel(void) rels.push_back(rel); } - generateValidationInfo(ValidationInfo::SP_OBJ_BROKEN_REFERENCE, tab_obj, rels); + generateValidationInfo(ValidationInfo::SpObjBrokenReference, tab_obj, rels); } } } @@ -428,12 +428,12 @@ void ModelValidationHelper::validateModel(void) rels.push_back(rel); } - generateValidationInfo(ValidationInfo::SP_OBJ_BROKEN_REFERENCE, object, rels); + generateValidationInfo(ValidationInfo::SpObjBrokenReference, object, rels); } } } - generateValidationInfo(ValidationInfo::BROKEN_REFERENCE, object, refs_aux); + generateValidationInfo(ValidationInfo::BrokenReference, object, refs_aux); } } @@ -506,7 +506,7 @@ void ModelValidationHelper::validateModel(void) if(mitr->second.size() > 1) { refs.assign(mitr->second.begin() + 1, mitr->second.end()); - generateValidationInfo(ValidationInfo::NO_UNIQUE_NAME, mitr->second.front(), refs); + generateValidationInfo(ValidationInfo::NoUniqueName, mitr->second.front(), refs); refs.clear(); } @@ -534,7 +534,7 @@ void ModelValidationHelper::validateModel(void) col = dynamic_cast(obj); if(col->getType().isGiSType()) - generateValidationInfo(ValidationInfo::MISSING_EXTENSION, col, {}); + generateValidationInfo(ValidationInfo::MissingExtension, col, {}); } progress=30 + ((i/static_cast(obj_list->size()))*20); @@ -555,7 +555,7 @@ void ModelValidationHelper::validateModel(void) progress=40 + ((i/static_cast(obj_list->size()))*20); if(dynamic_cast(*itr)->isInvalidated()) - generateValidationInfo(ValidationInfo::BROKEN_REL_CONFIG, *itr, {}); + generateValidationInfo(ValidationInfo::BrokenRelConfig, *itr, {}); itr++; } @@ -605,15 +605,15 @@ void ModelValidationHelper::applyFixes(void) for(unsigned i=0; i < val_infos.size() && !valid_canceled; i++) { if(!validate_rels) - validate_rels=(val_infos[i].getValidationType()==ValidationInfo::BROKEN_REFERENCE || - val_infos[i].getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE || - val_infos[i].getValidationType()==ValidationInfo::NO_UNIQUE_NAME || - val_infos[i].getValidationType()==ValidationInfo::MISSING_EXTENSION); + validate_rels=(val_infos[i].getValidationType()==ValidationInfo::BrokenReference || + val_infos[i].getValidationType()==ValidationInfo::SpObjBrokenReference || + val_infos[i].getValidationType()==ValidationInfo::NoUniqueName || + val_infos[i].getValidationType()==ValidationInfo::MissingExtension); /* Checking if a broken relatinship is found, when this is the case all the pending validation info will not be analyzed until no broken relationship is found */ if(!found_broken_rels) - found_broken_rels=(val_infos[i].getValidationType()==ValidationInfo::BROKEN_REL_CONFIG); + found_broken_rels=(val_infos[i].getValidationType()==ValidationInfo::BrokenRelConfig); if(!valid_canceled) resolveConflict(val_infos[i]); @@ -658,7 +658,7 @@ void ModelValidationHelper::captureThreadError(Exception e) emit s_validationInfoGenerated(val_info); - if(val_info.getValidationType()==ValidationInfo::SQL_VALIDATION_ERR) + if(val_info.getValidationType()==ValidationInfo::SqlValidationError) emit s_validationFinished(); } diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 97456acc28..e500d862d3 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -206,7 +206,7 @@ bool ModelValidationWidget::isValidationRunning(void) void ModelValidationWidget::updateValidation(ValidationInfo val_info) { if(validation_thread && - val_info.getValidationType()!=ValidationInfo::VALIDATION_ABORTED && + val_info.getValidationType()!=ValidationInfo::ValidationAborted && !validation_thread->isRunning() && validation_helper->isValidationCanceled()) return; @@ -219,13 +219,13 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) QString ref_name; label->setTextInteractionFlags(Qt::TextSelectableByMouse); - if(val_info.getValidationType()==ValidationInfo::BROKEN_REFERENCE) + if(val_info.getValidationType()==ValidationInfo::BrokenReference) label->setText(trUtf8("The object %1 (%2) [id: %3] is being referenced by %4 object(s) before its creation.") .arg(val_info.getObject()->getName(true).remove('"')) .arg(val_info.getObject()->getTypeName()) .arg(val_info.getObject()->getObjectId()) .arg(val_info.getReferences().size())); - else if(val_info.getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE) + else if(val_info.getValidationType()==ValidationInfo::SpObjBrokenReference) { QString str_aux; @@ -242,7 +242,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) .arg(str_aux) .arg(val_info.getReferences().size())); } - else if(val_info.getValidationType()==ValidationInfo::NO_UNIQUE_NAME) + else if(val_info.getValidationType()==ValidationInfo::NoUniqueName) { tab_obj=dynamic_cast(val_info.getObject()); @@ -260,13 +260,13 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) .arg(val_info.getReferences().size())); } - else if(val_info.getValidationType()==ValidationInfo::BROKEN_REL_CONFIG) + else if(val_info.getValidationType()==ValidationInfo::BrokenRelConfig) label->setText(trUtf8("The relationship %1 [id: %2] is in a permanent invalidation state and needs to be relocated.") .arg(val_info.getObject()->getName(true).remove('"')) .arg(val_info.getObject()->getObjectId())); - else if(val_info.getValidationType()==ValidationInfo::SQL_VALIDATION_ERR) + else if(val_info.getValidationType()==ValidationInfo::SqlValidationError) label->setText(trUtf8("SQL validation failed due to error(s) below. NOTE: These errors does not invalidates the model but may affect operations like export and diff.")); - else if(val_info.getValidationType() == ValidationInfo::MISSING_EXTENSION) + else if(val_info.getValidationType() == ValidationInfo::MissingExtension) { Column *col = dynamic_cast(val_info.getObject()); @@ -280,15 +280,15 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) label->setText(val_info.getErrors().at(0)); - if(val_info.getValidationType()==ValidationInfo::SQL_VALIDATION_ERR || - val_info.getValidationType()==ValidationInfo::VALIDATION_ABORTED) + if(val_info.getValidationType()==ValidationInfo::SqlValidationError || + val_info.getValidationType()==ValidationInfo::ValidationAborted) { QStringList errors=val_info.getErrors(); item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); validation_prog_pb->setValue(validation_prog_pb->maximum()); reenableValidation(); - if(val_info.getValidationType()==ValidationInfo::SQL_VALIDATION_ERR) + if(val_info.getValidationType()==ValidationInfo::SqlValidationError) { //Adding all the sql errors into the output pane while(!errors.isEmpty()) @@ -307,12 +307,12 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) { item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("msgbox_erro"))); - if(val_info.getValidationType()==ValidationInfo::BROKEN_REL_CONFIG) + if(val_info.getValidationType()==ValidationInfo::BrokenRelConfig) { PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("HINT: try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process."), QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), item); } - else if(val_info.getValidationType()==ValidationInfo::MISSING_EXTENSION) + else if(val_info.getValidationType()==ValidationInfo::MissingExtension) { PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("HINT: Create the extension in the model or let it be created by applying the needed fixes."), QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), item); @@ -334,7 +334,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) if(tab_obj) ref_name=dynamic_cast(refs.back())->getParentTable()->getName(true) + QString(".") + ref_name; - if(val_info.getValidationType()==ValidationInfo::NO_UNIQUE_NAME) + if(val_info.getValidationType()==ValidationInfo::NoUniqueName) { //If the referrer object is a table object, concatenates the parent table name if(tab_obj) @@ -359,7 +359,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) } else { - if(val_info.getValidationType()==ValidationInfo::SP_OBJ_BROKEN_REFERENCE) + if(val_info.getValidationType()==ValidationInfo::SpObjBrokenReference) label1->setText(trUtf8("Relationship: %1 [id: %2].") .arg(ref_name.remove('"')) .arg(refs.back()->getObjectId())); @@ -389,7 +389,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) output_trw->setItemHidden(item, false); output_trw->scrollToBottom(); - if(val_info.getValidationType()==ValidationInfo::SQL_VALIDATION_ERR) + if(val_info.getValidationType()==ValidationInfo::SqlValidationError) emit s_validationFinished(validation_helper->getErrorCount() != 0); } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 291cebeca8..4b54bbd3d7 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -68,10 +68,10 @@ bool ModelWidget::simple_obj_creation=true; ModelWidget *ModelWidget::src_model=nullptr; float ModelWidget::min_object_opacity=0.10f; -constexpr unsigned ModelWidget::BREAK_VERT_NINETY_DEGREES; -constexpr unsigned ModelWidget::BREAK_HORIZ_NINETY_DEGREES; -constexpr unsigned ModelWidget::BREAK_VERT_2NINETY_DEGREES; -constexpr unsigned ModelWidget::BREAK_HORIZ_2NINETY_DEGREES; +constexpr unsigned ModelWidget::BreakVertNinetyDegrees; +constexpr unsigned ModelWidget::BreakHorizNinetyDegrees; +constexpr unsigned ModelWidget::BreakVert2NinetyDegrees; +constexpr unsigned ModelWidget::BreakHoriz2NinetyDegrees; ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) { @@ -135,7 +135,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) label->setFont(font); label->setWordWrap(true); label->setText(trUtf8("ATTENTION: The database model is protected! Operations that could modify it are disabled!")); - PgModelerUiNs::configureWidgetFont(label, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(label, PgModelerUiNs::MediumFontFactor); grid->addWidget(label, 0, 1, 1, 1); protected_model_frm->setLayout(grid); @@ -338,22 +338,22 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) action=new QAction(QIcon(PgModelerUiNs::getIconPath("breakline_90dv")), trUtf8("90° (vertical)"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(breakRelationshipLine(void))); - action->setData(QVariant::fromValue(BREAK_VERT_NINETY_DEGREES)); + action->setData(QVariant::fromValue(BreakVertNinetyDegrees)); break_rel_menu.addAction(action); action=new QAction(QIcon(PgModelerUiNs::getIconPath("breakline_90dh")), trUtf8("90° (horizontal)"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(breakRelationshipLine(void))); - action->setData(QVariant::fromValue(BREAK_HORIZ_NINETY_DEGREES)); + action->setData(QVariant::fromValue(BreakHorizNinetyDegrees)); break_rel_menu.addAction(action); action=new QAction(QIcon(PgModelerUiNs::getIconPath("breakline_290dv")), trUtf8("90° + 90° (vertical)"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(breakRelationshipLine(void))); - action->setData(QVariant::fromValue(BREAK_VERT_2NINETY_DEGREES)); + action->setData(QVariant::fromValue(BreakVert2NinetyDegrees)); break_rel_menu.addAction(action); action=new QAction(QIcon(PgModelerUiNs::getIconPath("breakline_290dh")), trUtf8("90° + 90° (horizontal)"), this); connect(action, SIGNAL(triggered(bool)), this, SLOT(breakRelationshipLine(void))); - action->setData(QVariant::fromValue(BREAK_HORIZ_2NINETY_DEGREES)); + action->setData(QVariant::fromValue(BreakHoriz2NinetyDegrees)); break_rel_menu.addAction(action); action_break_rel_line->setMenu(&break_rel_menu); @@ -538,9 +538,9 @@ bool ModelWidget::eventFilter(QObject *object, QEvent *event) && event->type() == QEvent::Wheel && w_event->modifiers()==Qt::ControlModifier) { if(w_event->angleDelta().y() < 0) - this->applyZoom(this->current_zoom - ZOOM_INCREMENT); + this->applyZoom(this->current_zoom - ZoomIncrement); else - this->applyZoom(this->current_zoom + ZOOM_INCREMENT); + this->applyZoom(this->current_zoom + ZoomIncrement); return(true); } @@ -728,10 +728,10 @@ void ModelWidget::restoreLastCanvasPosition(void) void ModelWidget::applyZoom(double zoom) { - if(zoom < MINIMUM_ZOOM) - zoom = MINIMUM_ZOOM; - else if(zoom > MAXIMUM_ZOOM) - zoom = MAXIMUM_ZOOM; + if(zoom < MinimumZoom) + zoom = MinimumZoom; + else if(zoom > MaximumZoom) + zoom = MaximumZoom; viewport->resetTransform(); viewport->scale(zoom, zoom); @@ -4192,11 +4192,11 @@ void ModelWidget::breakRelationshipLine(BaseRelationship *rel, unsigned break_ty src_pnt=rel_view->getConnectionPoint(BaseRelationship::SrcTable); dst_pnt=rel_view->getConnectionPoint(BaseRelationship::DstTable); - if(break_type==BREAK_VERT_NINETY_DEGREES) + if(break_type==BreakVertNinetyDegrees) rel->setPoints({ QPointF(src_pnt.x(), dst_pnt.y()) }); - else if(break_type==BREAK_HORIZ_NINETY_DEGREES) + else if(break_type==BreakHorizNinetyDegrees) rel->setPoints({ QPointF(dst_pnt.x(), src_pnt.y()) }); - else if(break_type==BREAK_HORIZ_2NINETY_DEGREES) + else if(break_type==BreakHoriz2NinetyDegrees) { //Calculates the midle vertical point between the tables centers dy=(src_pnt.y() + dst_pnt.y())/2; @@ -4554,7 +4554,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) if(!RelationshipView::isCurvedLines() && rel->getTable(BaseRelationship::SrcTable)->getPosition().y() != rel->getTable(BaseRelationship::DstTable)->getPosition().y()) - breakRelationshipLine(dynamic_cast(obj), ModelWidget::BREAK_VERT_2NINETY_DEGREES); + breakRelationshipLine(dynamic_cast(obj), ModelWidget::BreakVert2NinetyDegrees); } db_model->setObjectsModified({ ObjTable, ObjView, ObjSchema, ObjRelationship, ObjBaseRelationship }); diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index e1af9ade08..a41d9961c8 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -194,10 +194,10 @@ class ModelWidget: public QWidget { void showMagnifierArea(bool show); protected: - static constexpr unsigned BREAK_VERT_NINETY_DEGREES=0, //Break vertically the line in one 90° angle - BREAK_HORIZ_NINETY_DEGREES=1, //Break horizontally the line in one 90° angle - BREAK_VERT_2NINETY_DEGREES=2, //Break vertically the line in two 90° angles - BREAK_HORIZ_2NINETY_DEGREES=3;//Break horizontally the line in two 90° angles + static constexpr unsigned BreakVertNinetyDegrees=0, //Break vertically the line in one 90° angle + BreakHorizNinetyDegrees=1, //Break horizontally the line in one 90° angle + BreakVert2NinetyDegrees=2, //Break vertically the line in two 90° angles + BreakHoriz2NinetyDegrees=3;//Break horizontally the line in two 90° angles QAction *action_source_code, *action_edit, @@ -277,9 +277,9 @@ class ModelWidget: public QWidget { void toggleAllExtendedAttributes(bool value); public: - static constexpr double MINIMUM_ZOOM=0.050000, - MAXIMUM_ZOOM=5.000001, - ZOOM_INCREMENT=0.050000; + static constexpr double MinimumZoom=0.050000, + MaximumZoom=5.000001, + ZoomIncrement=0.050000; ModelWidget(QWidget *parent = 0); ~ModelWidget(void); diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index eef407c366..d7a4ac750e 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -24,7 +24,7 @@ ObjectDepsRefsWidget::ObjectDepsRefsWidget(QWidget *parent): BaseObjectWidget(pa Ui_ObjectDepsRefsWidget::setupUi(this); configureFormLayout(objectdepsrefs_grid, ObjBaseObject); - PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); model_wgt=nullptr; alert_frm->setVisible(false); diff --git a/libpgmodeler_ui/src/objectsdiffinfo.cpp b/libpgmodeler_ui/src/objectsdiffinfo.cpp index 2fba281b00..37129f8a25 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.cpp +++ b/libpgmodeler_ui/src/objectsdiffinfo.cpp @@ -18,16 +18,16 @@ #include "objectsdiffinfo.h" -constexpr unsigned ObjectsDiffInfo::CREATE_OBJECT; -constexpr unsigned ObjectsDiffInfo::DROP_OBJECT; -constexpr unsigned ObjectsDiffInfo::ALTER_OBJECT; -constexpr unsigned ObjectsDiffInfo::IGNORE_OBJECT; -constexpr unsigned ObjectsDiffInfo::NO_DIFFERENCE; +constexpr unsigned ObjectsDiffInfo::CreateObject; +constexpr unsigned ObjectsDiffInfo::DropObject; +constexpr unsigned ObjectsDiffInfo::AlterObject; +constexpr unsigned ObjectsDiffInfo::IgnoreObject; +constexpr unsigned ObjectsDiffInfo::NoDifference; ObjectsDiffInfo::ObjectsDiffInfo(void) { object=old_object=nullptr; - diff_type=NO_DIFFERENCE; + diff_type=NoDifference; } ObjectsDiffInfo::ObjectsDiffInfo(unsigned diff_type, BaseObject *object, BaseObject *new_object) @@ -48,7 +48,7 @@ QString ObjectsDiffInfo::getInfoMessage(void) BaseObject *ref_obj=nullptr; ObjectType obj_type=ObjBaseObject; - if(diff_type==ALTER_OBJECT && old_object) + if(diff_type==AlterObject && old_object) ref_obj=old_object; else ref_obj=object; @@ -65,28 +65,28 @@ QString ObjectsDiffInfo::getInfoMessage(void) else obj_name=ref_obj->getSignature(); - if(diff_type==NO_DIFFERENCE) + if(diff_type==NoDifference) return(QString()); - else if(diff_type==DROP_OBJECT) + else if(diff_type==DropObject) { msg=msg.arg(QString("DROP")) .arg(obj_name) .arg(ref_obj->getTypeName()); } - else if(diff_type==CREATE_OBJECT) + else if(diff_type==CreateObject) { msg=msg.arg(QString("CREATE")) .arg(obj_name) .arg(ref_obj->getTypeName()); } - else if(diff_type==ALTER_OBJECT) + else if(diff_type==AlterObject) { msg=msg.arg(QString("ALTER")) .arg(obj_name) .arg(ref_obj->getTypeName()); } - else if(diff_type==IGNORE_OBJECT) + else if(diff_type==IgnoreObject) { msg=msg.arg(QString("IGNORE")) .arg(obj_name) @@ -99,13 +99,13 @@ QString ObjectsDiffInfo::getInfoMessage(void) QString ObjectsDiffInfo::getDiffTypeString(void) { - if(diff_type==NO_DIFFERENCE) + if(diff_type==NoDifference) return(QString()); - else if(diff_type==DROP_OBJECT) + else if(diff_type==DropObject) return(QString("DROP")); - else if(diff_type==CREATE_OBJECT) + else if(diff_type==CreateObject) return(QString("CREATE")); - else if(diff_type==ALTER_OBJECT) + else if(diff_type==AlterObject) return(QString("ALTER")); else return(QString("IGNORE")); diff --git a/libpgmodeler_ui/src/objectsdiffinfo.h b/libpgmodeler_ui/src/objectsdiffinfo.h index 2452a62a5c..bbc9e5356a 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.h +++ b/libpgmodeler_ui/src/objectsdiffinfo.h @@ -36,11 +36,11 @@ class ObjectsDiffInfo { BaseObject *object, *old_object; public: - static constexpr unsigned CREATE_OBJECT=0, - DROP_OBJECT=1, - ALTER_OBJECT=2, - IGNORE_OBJECT=3, - NO_DIFFERENCE=4; + static constexpr unsigned CreateObject=0, + DropObject=1, + AlterObject=2, + IgnoreObject=3, + NoDifference=4; ObjectsDiffInfo(void); ObjectsDiffInfo(unsigned diff_type, BaseObject *ref_object, BaseObject *old_object); diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 14582b45eb..f285151667 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -69,23 +69,23 @@ void ObjectsTableWidget::setButtonConfiguration(unsigned button_conf) bool move_btn = false; //Checking via bitwise operation the buttons available on the 'button_conf' - move_btn=(button_conf & MOVE_BUTTONS) == MOVE_BUTTONS; + move_btn=(button_conf & MoveButtons) == MoveButtons; move_down_tb->setVisible(move_btn); move_up_tb->setVisible(move_btn); move_first_tb->setVisible(move_btn); move_last_tb->setVisible(move_btn); - edit_tb->setVisible((button_conf & EDIT_BUTTON) == EDIT_BUTTON); - remove_all_tb->setVisible((button_conf & REMOVE_ALL_BUTTON) == REMOVE_ALL_BUTTON); + edit_tb->setVisible((button_conf & EditButton) == EditButton); + remove_all_tb->setVisible((button_conf & RemoveAllButton) == RemoveAllButton); - add_tb->setVisible((button_conf & ADD_BUTTON) == ADD_BUTTON); - remove_tb->setVisible((button_conf & REMOVE_BUTTON) == REMOVE_BUTTON); - update_tb->setVisible((button_conf & UPDATE_BUTTON) == UPDATE_BUTTON); - duplicate_tb->setVisible((button_conf & DUPLICATE_BUTTON) == DUPLICATE_BUTTON); + add_tb->setVisible((button_conf & AddButton) == AddButton); + remove_tb->setVisible((button_conf & RemoveButton) == RemoveButton); + update_tb->setVisible((button_conf & UpdateButton) == UpdateButton); + duplicate_tb->setVisible((button_conf & DuplicateButton) == DuplicateButton); //Disabling the horizontal spacers when no buttons are visible - if(button_conf==NO_BUTTONS) + if(button_conf==NoButtons) { left_spc->changeSize(0,0,QSizePolicy::Ignored,QSizePolicy::Ignored); right_spc->changeSize(0,0,QSizePolicy::Ignored,QSizePolicy::Ignored); @@ -584,7 +584,7 @@ void ObjectsTableWidget::setButtonsEnabled(unsigned button_conf, bool value) if(item) lin=item->row(); - if((button_conf & MOVE_BUTTONS) == MOVE_BUTTONS) + if((button_conf & MoveButtons) == MoveButtons) { move_up_tb->setEnabled(value && lin > 0); move_down_tb->setEnabled(value && lin >= 0 && lin < table_tbw->rowCount()-1); @@ -592,31 +592,31 @@ void ObjectsTableWidget::setButtonsEnabled(unsigned button_conf, bool value) move_last_tb->setEnabled(value && lin >=0 && lin < table_tbw->rowCount()-1); } - if((button_conf & EDIT_BUTTON) == EDIT_BUTTON) + if((button_conf & EditButton) == EditButton) edit_tb->setEnabled(value && lin >= 0); - if((button_conf & ADD_BUTTON) == ADD_BUTTON) + if((button_conf & AddButton) == AddButton) add_tb->setEnabled(value); - if((button_conf & REMOVE_BUTTON) == REMOVE_BUTTON) + if((button_conf & RemoveButton) == RemoveButton) remove_tb->setEnabled(value && lin >= 0); - if((button_conf & REMOVE_ALL_BUTTON) == REMOVE_ALL_BUTTON) + if((button_conf & RemoveAllButton) == RemoveAllButton) remove_all_tb->setEnabled(value && table_tbw->rowCount() > 0); - if((button_conf & UPDATE_BUTTON) == UPDATE_BUTTON) + if((button_conf & UpdateButton) == UpdateButton) update_tb->setEnabled(value && lin >= 0); - if((button_conf & DUPLICATE_BUTTON) == DUPLICATE_BUTTON) + if((button_conf & DuplicateButton) == DuplicateButton) duplicate_tb->setEnabled(value && lin >= 0); - if((button_conf & RESIZE_COLS_BUTTON) == RESIZE_COLS_BUTTON) + if((button_conf & ResizeColsButton) == ResizeColsButton) resize_cols_tb->setEnabled(value && table_tbw->rowCount() > 0); } void ObjectsTableWidget::setButtonsEnabled(void) { - setButtonsEnabled(ALL_BUTTONS, true); + setButtonsEnabled(AllButtons, true); } void ObjectsTableWidget::emitRowSelected(void) diff --git a/libpgmodeler_ui/src/objectstablewidget.h b/libpgmodeler_ui/src/objectstablewidget.h index a12ab917af..bca07c44cc 100644 --- a/libpgmodeler_ui/src/objectstablewidget.h +++ b/libpgmodeler_ui/src/objectstablewidget.h @@ -44,18 +44,18 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { public: //! \brief Constants used to configure the table buttons - static constexpr unsigned ADD_BUTTON=1, - REMOVE_BUTTON=2, - UPDATE_BUTTON=4, - MOVE_BUTTONS=8, - EDIT_BUTTON=16, - DUPLICATE_BUTTON=32, - REMOVE_ALL_BUTTON=64, - RESIZE_COLS_BUTTON=128, - ALL_BUTTONS=255, - NO_BUTTONS=0; - - ObjectsTableWidget(unsigned button_conf=ALL_BUTTONS, bool conf_exclusion=false, QWidget * parent = 0); + static constexpr unsigned AddButton=1, + RemoveButton=2, + UpdateButton=4, + MoveButtons=8, + EditButton=16, + DuplicateButton=32, + RemoveAllButton=64, + ResizeColsButton=128, + AllButtons=255, + NoButtons=0; + + ObjectsTableWidget(unsigned button_conf=AllButtons, bool conf_exclusion=false, QWidget * parent = 0); //! \brief Sets the table's column count void setColumnCount(unsigned col_count); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index a2dc06d0f0..00e391dfea 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -36,7 +36,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare elem_family_sel=new ObjectSelectorWidget(ObjOpFamily, true, this); function_sel=new ObjectSelectorWidget(ObjFunction, true, this); storage_type=new PgSQLTypeWidget(this, trUtf8("Storage Type")); - elements_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); + elements_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::DuplicateButton, true, this); elements_tab->setColumnCount(4); elements_tab->setHeaderLabel(trUtf8("Object"),0); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index ef2820736f..08f72c8bdf 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -45,9 +45,9 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob comment_edt->setVisible(false); comment_lbl->setVisible(false); - roles_tab=new ObjectsTableWidget(ObjectsTableWidget::ADD_BUTTON | - ObjectsTableWidget::REMOVE_BUTTON | - ObjectsTableWidget::EDIT_BUTTON, false, this); + roles_tab=new ObjectsTableWidget(ObjectsTableWidget::AddButton | + ObjectsTableWidget::RemoveButton | + ObjectsTableWidget::EditButton, false, this); roles_tab->setColumnCount(1); roles_tab->setHeaderLabel(trUtf8("Name"),0); roles_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); @@ -57,9 +57,9 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob grid->setContentsMargins(2,2,2,2); roles_gb->setLayout(grid); - permissions_tab=new ObjectsTableWidget(ObjectsTableWidget::REMOVE_BUTTON | - ObjectsTableWidget::EDIT_BUTTON | - ObjectsTableWidget::REMOVE_ALL_BUTTON, true, this); + permissions_tab=new ObjectsTableWidget(ObjectsTableWidget::RemoveButton | + ObjectsTableWidget::EditButton | + ObjectsTableWidget::RemoveAllButton, true, this); permissions_tab->setColumnCount(3); permissions_tab->setHeaderLabel(trUtf8("Id"),0); permissions_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 85c7960f1f..59e3fac25c 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -211,16 +211,16 @@ namespace PgModelerUiNs { switch(factor_id) { - case SMALL_FONT_FACTOR: + case SmallFontFactor: factor=0.80f; break; - case MEDIUM_FONT_FACTOR: + case MediumFontFactor: factor=0.90f; break; - case BIG_FONT_FACTOR: + case BigFontFactor: factor=1.10f; break; - case HUGE_FONT_FACTOR: + case HugeFontFactor: default: factor=1.40f; break; diff --git a/libpgmodeler_ui/src/pgmodeleruins.h b/libpgmodeler_ui/src/pgmodeleruins.h index 3d797fc8af..066011a9e5 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.h +++ b/libpgmodeler_ui/src/pgmodeleruins.h @@ -33,10 +33,10 @@ #include "numberedtexteditor.h" namespace PgModelerUiNs { - static constexpr unsigned SMALL_FONT_FACTOR = 0, - MEDIUM_FONT_FACTOR = 1, - BIG_FONT_FACTOR = 2, - HUGE_FONT_FACTOR = 3; + static constexpr unsigned SmallFontFactor = 0, + MediumFontFactor = 1, + BigFontFactor = 2, + HugeFontFactor = 3; extern void configureWidgetFont(QWidget *widget, unsigned factor_id); extern void __configureWidgetFont(QWidget *widget, float factor); diff --git a/libpgmodeler_ui/src/pgsqltypewidget.cpp b/libpgmodeler_ui/src/pgsqltypewidget.cpp index 657016b53d..5d0e539e09 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.cpp +++ b/libpgmodeler_ui/src/pgsqltypewidget.cpp @@ -18,7 +18,7 @@ #include "pgsqltypewidget.h" -const QString PgSQLTypeWidget::INVALID_TYPE = QString("invalid_type"); +const QString PgSQLTypeWidget::InvalidType = QString("invalid_type"); PgSQLTypeWidget::PgSQLTypeWidget(QWidget *parent, const QString &label) : QWidget(parent) { @@ -76,7 +76,7 @@ bool PgSQLTypeWidget::eventFilter(QObject *object, QEvent *event) } catch(Exception &) { - format_txt->setPlainText(INVALID_TYPE); + format_txt->setPlainText(InvalidType); } } @@ -212,7 +212,7 @@ void PgSQLTypeWidget::setAttributes(PgSQLType type, DatabaseModel *model, unsig PgSQLType PgSQLTypeWidget::getPgSQLType(void) { - if(format_txt->toPlainText() == INVALID_TYPE) + if(format_txt->toPlainText() == InvalidType) throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type); diff --git a/libpgmodeler_ui/src/pgsqltypewidget.h b/libpgmodeler_ui/src/pgsqltypewidget.h index f8933195d4..84432fdeaa 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.h +++ b/libpgmodeler_ui/src/pgsqltypewidget.h @@ -44,7 +44,7 @@ class PgSQLTypeWidget: public QWidget, public Ui::PgSQLTypeWidget { bool eventFilter(QObject *watched, QEvent *event); - static const QString INVALID_TYPE; + static const QString InvalidType; public: PgSQLTypeWidget(QWidget * parent = 0, const QString &label=QString()); diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.cpp b/libpgmodeler_ui/src/pluginsconfigwidget.cpp index 02347cccf7..01c29efaf6 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.cpp +++ b/libpgmodeler_ui/src/pluginsconfigwidget.cpp @@ -27,7 +27,7 @@ PluginsConfigWidget::PluginsConfigWidget(QWidget *parent) : BaseConfigWidget(par root_dir_edt->setText(dir.absolutePath()); - plugins_tab=new ObjectsTableWidget(ObjectsTableWidget::EDIT_BUTTON, false, this); + plugins_tab=new ObjectsTableWidget(ObjectsTableWidget::EditButton, false, this); plugins_tab->setColumnCount(3); plugins_tab->setHeaderLabel(trUtf8("Plugin"),0); plugins_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("plugins")),0); diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index dbb2429ed7..6646390444 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -37,10 +37,10 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjPolicy) check_hl = new SyntaxHighlighter(check_edt); check_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - roles_tab = new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::DUPLICATE_BUTTON | - ObjectsTableWidget::UPDATE_BUTTON | - ObjectsTableWidget::EDIT_BUTTON), true, this); + roles_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::DuplicateButton | + ObjectsTableWidget::UpdateButton | + ObjectsTableWidget::EditButton), true, this); roles_tab->setColumnCount(1); roles_tab->setHeaderLabel(trUtf8("Name"), 0); roles_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")), 0); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 9619de696f..5b416d07c6 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -70,15 +70,15 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent GlobalAttributes::ConfigurationExt); } - attributes_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::UPDATE_BUTTON | - ObjectsTableWidget::MOVE_BUTTONS), true, this); + attributes_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::UpdateButton | + ObjectsTableWidget::MoveButtons), true, this); - constraints_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::UPDATE_BUTTON | - ObjectsTableWidget::MOVE_BUTTONS), true, this); + constraints_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::UpdateButton | + ObjectsTableWidget::MoveButtons), true, this); - advanced_objs_tab=new ObjectsTableWidget(ObjectsTableWidget::EDIT_BUTTON, true, this); + advanced_objs_tab=new ObjectsTableWidget(ObjectsTableWidget::EditButton, true, this); attributes_tab->setColumnCount(2); attributes_tab->setHeaderLabel(trUtf8("Attribute"), 0); @@ -103,18 +103,18 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent grid=new QGridLayout; grid->addWidget(attributes_tab, 0,0,1,1); grid->setContentsMargins(4,4,4,4); - rel_attribs_tbw->widget(ATTRIBUTES_TAB)->setLayout(grid); + rel_attribs_tbw->widget(AttributesTab)->setLayout(grid); grid=new QGridLayout; grid->addWidget(constraints_tab, 0,0,1,1); grid->setContentsMargins(4,4,4,4); - rel_attribs_tbw->widget(CONSTRAINTS_TAB)->setLayout(grid); + rel_attribs_tbw->widget(ConstraintsTab)->setLayout(grid); - grid=dynamic_cast(rel_attribs_tbw->widget(SPECIAL_PK_TAB)->layout()); + grid=dynamic_cast(rel_attribs_tbw->widget(SpecialPkTab)->layout()); frame=generateInformationFrame(trUtf8("Use the special primary key if you want to include a primary key containing generated columns to the receiver table. Important: if this is a new relationship there is a need to finish its creation and reopen this dialog to create the special primary key.")); grid->addWidget(frame, 1, 0, 1, 1); - frame->setParent(rel_attribs_tbw->widget(SPECIAL_PK_TAB)); + frame->setParent(rel_attribs_tbw->widget(SpecialPkTab)); grid=new QGridLayout; grid->setContentsMargins(4,4,4,4); @@ -124,11 +124,11 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent frame=generateInformationFrame(trUtf8("This advanced tab shows the objects (columns or table) auto created by the relationship's connection as well the foreign keys that represents the link between the participant tables.")); grid->addWidget(frame, 1, 0, 1, 1); - rel_attribs_tbw->widget(ADVANCED_TAB)->setLayout(grid); + rel_attribs_tbw->widget(AdvancedTab)->setLayout(grid); color_picker=new ColorPickerWidget(1,this); color_picker->setEnabled(false); - grid=dynamic_cast(rel_attribs_tbw->widget(GENERAL_TAB)->layout()); + grid=dynamic_cast(rel_attribs_tbw->widget(GeneralTab)->layout()); grid->addWidget(color_picker, 0, 1); configureFormLayout(relationship_grid, ObjRelationship); @@ -153,13 +153,13 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent del_action_cmb->addItems(list); upd_action_cmb->addItems(list); - tabs={ nullptr, rel_attribs_tbw->widget(SETTINGS_TAB), - rel_attribs_tbw->widget(ATTRIBUTES_TAB), rel_attribs_tbw->widget(CONSTRAINTS_TAB), - rel_attribs_tbw->widget(SPECIAL_PK_TAB), rel_attribs_tbw->widget(ADVANCED_TAB) }; + tabs={ nullptr, rel_attribs_tbw->widget(SettingsTab), + rel_attribs_tbw->widget(AttributesTab), rel_attribs_tbw->widget(ConstraintsTab), + rel_attribs_tbw->widget(SpecialPkTab), rel_attribs_tbw->widget(AdvancedTab) }; - tab_labels=QStringList{ QString(), rel_attribs_tbw->tabText(SETTINGS_TAB), - rel_attribs_tbw->tabText(ATTRIBUTES_TAB), rel_attribs_tbw->tabText(CONSTRAINTS_TAB), - rel_attribs_tbw->tabText(SPECIAL_PK_TAB), rel_attribs_tbw->tabText(ADVANCED_TAB)}; + tab_labels=QStringList{ QString(), rel_attribs_tbw->tabText(SettingsTab), + rel_attribs_tbw->tabText(AttributesTab), rel_attribs_tbw->tabText(ConstraintsTab), + rel_attribs_tbw->tabText(SpecialPkTab), rel_attribs_tbw->tabText(AdvancedTab)}; part_bound_expr_txt=new NumberedTextEditor(this, true); part_bound_expr_hl=new SyntaxHighlighter(part_bound_expr_txt); @@ -332,8 +332,8 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l table2_mand_chk->setChecked(aux_rel->isTableMandatory(BaseRelationship::DstTable)); identifier_chk->setChecked(aux_rel->isIdentifier()); relnn_tab_name_edt->setText(aux_rel->getTableNameRelNN()); - attributes_tab->setButtonsEnabled(ObjectsTableWidget::ALL_BUTTONS, !aux_rel->isProtected()); - constraints_tab->setButtonsEnabled(ObjectsTableWidget::ALL_BUTTONS, !aux_rel->isProtected()); + attributes_tab->setButtonsEnabled(ObjectsTableWidget::AllButtons, !aux_rel->isProtected()); + constraints_tab->setButtonsEnabled(ObjectsTableWidget::AllButtons, !aux_rel->isProtected()); //Lists the relationship attributes listObjects(ObjColumn); @@ -415,21 +415,21 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l part_bound_expr_gb->setVisible(rel_type==BaseRelationship::RelationshipPart); - for(i=SETTINGS_TAB; i <= ADVANCED_TAB; i++) + for(i=SettingsTab; i <= AdvancedTab; i++) rel_attribs_tbw->removeTab(1); if(!relgen_dep) { - for(i=SETTINGS_TAB; i <= SPECIAL_PK_TAB; i++) + for(i=SettingsTab; i <= SpecialPkTab; i++) rel_attribs_tbw->addTab(tabs[i], tab_labels[i]); } else if(relgen_dep && base_rel->getObjectType()==ObjRelationship) - rel_attribs_tbw->addTab(tabs[SPECIAL_PK_TAB], tab_labels[SPECIAL_PK_TAB]); + rel_attribs_tbw->addTab(tabs[SpecialPkTab], tab_labels[SpecialPkTab]); if(base_rel->getObjectType()==ObjRelationship || (base_rel->getObjectType()==ObjBaseRelationship && base_rel->getRelationshipType()==BaseRelationship::RelationshipFk)) - rel_attribs_tbw->addTab(tabs[ADVANCED_TAB], tab_labels[ADVANCED_TAB]); + rel_attribs_tbw->addTab(tabs[AdvancedTab], tab_labels[AdvancedTab]); copy_options_grp->setVisible(base_rel->getObjectType()==ObjRelationship && base_rel->getRelationshipType()==BaseRelationship::RelationshipDep); @@ -583,7 +583,7 @@ void RelationshipWidget::listObjects(ObjectType obj_type) tab->clearSelection(); tab->blockSignals(false); - constraints_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, + constraints_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, attributes_tab->getRowCount() > 0); } catch(Exception &e) diff --git a/libpgmodeler_ui/src/relationshipwidget.h b/libpgmodeler_ui/src/relationshipwidget.h index 837d0b508c..e3c4e03825 100644 --- a/libpgmodeler_ui/src/relationshipwidget.h +++ b/libpgmodeler_ui/src/relationshipwidget.h @@ -35,12 +35,12 @@ class RelationshipWidget: public BaseObjectWidget, public Ui::RelationshipWidget private: Q_OBJECT - static constexpr unsigned GENERAL_TAB=0, - SETTINGS_TAB=1, - ATTRIBUTES_TAB=2, - CONSTRAINTS_TAB=3, - SPECIAL_PK_TAB=4, - ADVANCED_TAB=5; + static constexpr unsigned GeneralTab=0, + SettingsTab=1, + AttributesTab=2, + ConstraintsTab=3, + SpecialPkTab=4, + AdvancedTab=5; HintTextWidget *gen_tab_name_ht, *ref_table_ht, *recv_table_ht, *identifier_ht, *single_pk_ht, *default_part_ht; diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index 2b0dac3f76..8a2a3990e5 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -50,8 +50,8 @@ RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRole) //Alocation of the member role tables for(i=0; i < 3; i++) { - obj_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::UPDATE_BUTTON | ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + obj_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::UpdateButton | ObjectsTableWidget::DuplicateButton), true, this); members_tab[i]=obj_tab; obj_tab->setColumnCount(5); diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index 52f6f5a471..a975031159 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -34,7 +34,7 @@ RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRule) command_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); command_cp=new CodeCompletionWidget(comando_txt); - commands_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); + commands_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::DuplicateButton, true, this); commands_tab->setHeaderLabel(trUtf8("SQL command"),0); commands_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("codigosql")),0); dynamic_cast(commands_gb->layout())->addWidget(commands_tab, 1, 0, 1, 2); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index be8182cc9e..6895eaea2d 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -23,7 +23,7 @@ map SnippetsConfigWidget::config_params; -const QRegExp SnippetsConfigWidget::ID_FORMAT_REGEXP=QRegExp(QString("^([a-z])([a-z]*|(\\d)*|(_)*)+"), Qt::CaseInsensitive); +const QRegExp SnippetsConfigWidget::IdFormatRegExp=QRegExp(QString("^([a-z])([a-z]*|(\\d)*|(_)*)+"), Qt::CaseInsensitive); SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { @@ -224,7 +224,7 @@ bool SnippetsConfigWidget::isSnippetValid(attribs_map &attribs, const QString &o if(!orig_id.isEmpty() && snip_id!=orig_id && config_params.count(snip_id)!=0) err_msg=trUtf8("Duplicated snippet id %1 detected. Please, specify a different one!").arg(snip_id); - else if(!ID_FORMAT_REGEXP.exactMatch(snip_id)) + else if(!IdFormatRegExp.exactMatch(snip_id)) err_msg=trUtf8("Invalid ID pattern detected %1. This one must start with at leat one letter and be composed by letters, numbers and/or underscore!").arg(snip_id); else if(attribs[ParsersAttributes::LABEL].isEmpty()) err_msg=trUtf8("Empty label for snippet %1. Please, specify a value for it!").arg(snip_id); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.h b/libpgmodeler_ui/src/snippetsconfigwidget.h index ee60576ee8..7b2a222bdf 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.h +++ b/libpgmodeler_ui/src/snippetsconfigwidget.h @@ -40,7 +40,7 @@ class SnippetsConfigWidget: public BaseConfigWidget, public Ui::SnippetsConfigWi static map config_params; //! \brief The regular expression the defines a valid id for a snippet - static const QRegExp ID_FORMAT_REGEXP; + static const QRegExp IdFormatRegExp; NumberedTextEditor *snippet_txt; diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index 27f016946c..efbfa2e0b1 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -147,11 +147,11 @@ void SourceCodeWidget::generateSourceCode(int) } else { - if(code_options_cmb->currentIndex()==ORIGINAL_SQL) + if(code_options_cmb->currentIndex()==OriginalSql) sqlcode_txt->setPlainText(object->getCodeDefinition(SchemaParser::SqlDefinition)); else { - vector objs=model->getCreationOrder(object, code_options_cmb->currentIndex()==CHILDREN_SQL); + vector objs=model->getCreationOrder(object, code_options_cmb->currentIndex()==ChildrenSql); for(BaseObject *obj : objs) aux_def+=obj->getCodeDefinition(SchemaParser::SqlDefinition); diff --git a/libpgmodeler_ui/src/sourcecodewidget.h b/libpgmodeler_ui/src/sourcecodewidget.h index e1ef1e9b33..e263747b8a 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.h +++ b/libpgmodeler_ui/src/sourcecodewidget.h @@ -34,9 +34,9 @@ class SourceCodeWidget: public BaseObjectWidget, public Ui::SourceCodeWidget { private: Q_OBJECT - static constexpr int ORIGINAL_SQL=0, - DEPENDENCIES_SQL=1, - CHILDREN_SQL=2; + static constexpr int OriginalSql=0, + DependenciesSql=1, + ChildrenSql=2; NumberedTextEditor *sqlcode_txt, *xmlcode_txt; diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 0ce63fad6d..fe22863c08 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -27,7 +27,7 @@ map SQLExecutionWidget::cmd_history; int SQLExecutionWidget::cmd_history_max_len = 1000; -const QString SQLExecutionWidget::COLUMN_NULL_VALUE = QString("␀"); +const QString SQLExecutionWidget::ColumnNullValue = QString("␀"); SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) { @@ -307,7 +307,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab /* When storing column values in the QTableWidget items we need distinguish empty from null values * Since it may affect the generation of SQL like delete when the field value is used somehow (see DataManipulationForm::getDMLCommand) */ if(store_data) - item->setData(Qt::UserRole, res.isColumnValueNull(col) ? COLUMN_NULL_VALUE : item->text()); + item->setData(Qt::UserRole, res.isColumnValueNull(col) ? ColumnNullValue : item->text()); } results_tbw->setItem(row, col, item); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index aaab858171..fb797fac81 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -102,7 +102,7 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { bool eventFilter(QObject *object, QEvent *event); public: - static const QString COLUMN_NULL_VALUE; + static const QString ColumnNullValue; SQLExecutionWidget(QWidget * parent = 0); ~SQLExecutionWidget(void); diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index a17a848b9a..4d9310602a 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -1,7 +1,7 @@ #include "swapobjectsidswidget.h" #include "pgmodeleruins.h" -const QString SwapObjectsIdsWidget::ID_LABEL = QString("ID: %1"); +const QString SwapObjectsIdsWidget::IdLabel = QString("ID: %1"); SwapObjectsIdsWidget::SwapObjectsIdsWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) { @@ -12,7 +12,7 @@ SwapObjectsIdsWidget::SwapObjectsIdsWidget(QWidget *parent, Qt::WindowFlags f) : ObjColumn, ObjConstraint }); setupUi(this); - PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MEDIUM_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); src_object_sel=nullptr; dst_object_sel=nullptr; @@ -155,7 +155,7 @@ void SwapObjectsIdsWidget::showObjectId(void) id_lbl->clear(); if(sel_obj) { - id_lbl->setText(ID_LABEL.arg(sel_obj->getObjectId())); + id_lbl->setText(IdLabel.arg(sel_obj->getObjectId())); ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(sel_obj->getObjectType()))); ico_lbl->setToolTip(sel_obj->getTypeName()); @@ -219,8 +219,8 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) model->setInvalidated(true); fillCreationOrderGrid(); - src_id_lbl->setText(ID_LABEL.arg(src_object_sel->getSelectedObject()->getObjectId())); - dst_id_lbl->setText(ID_LABEL.arg(dst_object_sel->getSelectedObject()->getObjectId())); + src_id_lbl->setText(IdLabel.arg(src_object_sel->getSelectedObject()->getObjectId())); + dst_id_lbl->setText(IdLabel.arg(dst_object_sel->getSelectedObject()->getObjectId())); emit s_objectsIdsSwapped(); } diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.h b/libpgmodeler_ui/src/swapobjectsidswidget.h index af414541fb..e42712657b 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.h +++ b/libpgmodeler_ui/src/swapobjectsidswidget.h @@ -33,7 +33,7 @@ class SwapObjectsIdsWidget: public QWidget, public Ui::SwapObjectsIdsWidget { private: Q_OBJECT - static const QString ID_LABEL; + static const QString IdLabel; //! \brief Reference database model DatabaseModel *model; diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 666c46591b..e10f1db6f6 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -100,18 +100,18 @@ void SyntaxHighlighter::highlightBlock(const QString &txt) //Reset the block's info to permit the rehighlighting info=dynamic_cast(currentBlockUserData()); info->resetBlockInfo(); - setCurrentBlockState(SIMPLE_BLOCK); + setCurrentBlockState(SimpleBlock); } /* If the previous block info is a open multiline expression the current block will inherit this settings to force the same text formatting */ - if(prev_info && currentBlock().previous().userState()==OPEN_EXPR_BLOCK && - currentBlockState() == OPEN_EXPR_BLOCK) + if(prev_info && currentBlock().previous().userState()==OpenExprBlock && + currentBlockState() == OpenExprBlock) { info->group=prev_info->group; info->has_exprs=prev_info->has_exprs; info->is_expr_closed=false; - setCurrentBlockState(OPEN_EXPR_BLOCK); + setCurrentBlockState(OpenExprBlock); } if(!txt.isEmpty()) @@ -220,9 +220,9 @@ void SyntaxHighlighter::highlightBlock(const QString &txt) } if(info->has_exprs && !info->is_expr_closed && hasInitialAndFinalExprs(group)) - setCurrentBlockState(OPEN_EXPR_BLOCK); + setCurrentBlockState(OpenExprBlock); else - setCurrentBlockState(SIMPLE_BLOCK); + setCurrentBlockState(SimpleBlock); aux_len=(match_idx + match_len); if(match_idx >=0 && aux_len != word.length()) diff --git a/libpgmodeler_ui/src/syntaxhighlighter.h b/libpgmodeler_ui/src/syntaxhighlighter.h index 9267318ce1..8cf4890aa1 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.h +++ b/libpgmodeler_ui/src/syntaxhighlighter.h @@ -64,12 +64,12 @@ class SyntaxHighlighter: public QSyntaxHighlighter { static QFont default_font; //! \brief Indicates that the current block has no special meaning - static constexpr int SIMPLE_BLOCK=-1, + static constexpr int SimpleBlock=-1, /*! \brief Indicates that the current block has an open (but still to close) expression (e.g. multline comments) When the highlighter finds this const it'll do special operation like highlight next blocks with the same configuration as the current one */ - OPEN_EXPR_BLOCK=0; + OpenExprBlock=0; /*! \brief Stores the regexp used to identify keywords, identifiers, strings, numbers. Also stores initial regexps used to identify a multiline group */ diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 787968870c..0d8c33fcc0 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -21,7 +21,7 @@ #include "bulkdataeditwidget.h" #include "sqlexecutionwidget.h" -const QString TableDataWidget::PLACEHOLDER_COLUMN=QString("$placeholder$"); +const QString TableDataWidget::PlaceholderColumn=QString("$placeholder$"); TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjBaseObject) { @@ -255,7 +255,7 @@ void TableDataWidget::changeColumnName(int col_idx) item->setText(col_name); - if(act->text()==PLACEHOLDER_COLUMN) + if(act->text()==PlaceholderColumn) { item->setFlags(Qt::NoItemFlags); item->setForeground(QColor(Qt::red)); @@ -274,7 +274,7 @@ void TableDataWidget::changeColumnName(int col_idx) { item=data_tbw->item(row, col_idx); - if(col_name==PLACEHOLDER_COLUMN) + if(col_name==PlaceholderColumn) setItemInvalid(item); else { @@ -449,7 +449,7 @@ void TableDataWidget::configureColumnNamesMenu(void) } col_names_menu.addSeparator(); - col_names_menu.addAction(PLACEHOLDER_COLUMN); + col_names_menu.addAction(PlaceholderColumn); } void TableDataWidget::toggleWarningFrame(void) diff --git a/libpgmodeler_ui/src/tabledatawidget.h b/libpgmodeler_ui/src/tabledatawidget.h index f82a91ce66..db0069edd0 100644 --- a/libpgmodeler_ui/src/tabledatawidget.h +++ b/libpgmodeler_ui/src/tabledatawidget.h @@ -59,7 +59,7 @@ class TableDataWidget: public BaseObjectWidget, public Ui::TableDataWidget { void enterEvent(QEvent *); public: - static const QString PLACEHOLDER_COLUMN; + static const QString PlaceholderColumn; TableDataWidget(QWidget * parent = 0); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 718f5f9265..b98d6c8d64 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -59,7 +59,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) table_grid->addWidget(frame, table_grid->count()+1, 0, 1, 2); frame->setParent(this); - parent_tables = new ObjectsTableWidget(ObjectsTableWidget::NO_BUTTONS, true, this); + parent_tables = new ObjectsTableWidget(ObjectsTableWidget::NoButtons, true, this); parent_tables->setColumnCount(3); parent_tables->setHeaderLabel(trUtf8("Name"), 0); parent_tables->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); @@ -81,8 +81,8 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) //Configuring the table objects that stores the columns, triggers, constraints, rules and indexes for(unsigned i=0; i <= 5; i++) { - tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::UPDATE_BUTTON), true, this); + tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::UpdateButton), true, this); objects_tab_map[types[i]]=tab; @@ -266,8 +266,8 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc for(i=0; i < 6; i++) { listObjects(types[i]); - objects_tab_map[types[i]]->setButtonConfiguration(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::UPDATE_BUTTON)); + objects_tab_map[types[i]]->setButtonConfiguration(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::UpdateButton)); } //Listing the ancestor tables @@ -363,11 +363,11 @@ void TableWidget::listObjects(ObjectType obj_type) //Enables the add button on the constraints, triggers and index tab only when there is columns created if(obj_type==ObjColumn) { - objects_tab_map[ObjConstraint]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, + objects_tab_map[ObjConstraint]->setButtonsEnabled(ObjectsTableWidget::AddButton, objects_tab_map[ObjColumn]->getRowCount() > 0); - objects_tab_map[ObjTrigger]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, + objects_tab_map[ObjTrigger]->setButtonsEnabled(ObjectsTableWidget::AddButton, objects_tab_map[ObjColumn]->getRowCount() > 0); - objects_tab_map[ObjIndex]->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, + objects_tab_map[ObjIndex]->setButtonsEnabled(ObjectsTableWidget::AddButton, objects_tab_map[ObjColumn]->getRowCount() > 0); } } diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index 17d3cef945..e9883dcfc0 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -29,12 +29,12 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjTrigg cond_expr_hl=new SyntaxHighlighter(cond_expr_txt, false, true); cond_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - columns_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::EDIT_BUTTON | - ObjectsTableWidget::UPDATE_BUTTON | - ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + columns_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::EditButton | + ObjectsTableWidget::UpdateButton | + ObjectsTableWidget::DuplicateButton), true, this); - arguments_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); + arguments_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::DuplicateButton, true, this); ref_table_sel=new ObjectSelectorWidget(ObjTable, true, this); function_sel=new ObjectSelectorWidget(ObjFunction, true, this); @@ -147,7 +147,7 @@ void TriggerWidget::addColumn(int lin_idx) column=reinterpret_cast(column_cmb->itemData(column_cmb->currentIndex(),Qt::UserRole).value()); column_cmb->removeItem(column_cmb->currentIndex()); addColumn(column, lin_idx); - columns_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (column_cmb->count()!=0)); + columns_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, (column_cmb->count()!=0)); } catch(Exception &e) { @@ -190,7 +190,7 @@ void TriggerWidget::updateColumnsCombo(void) } } - columns_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (column_cmb->count()!=0)); + columns_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, (column_cmb->count()!=0)); } } catch(Exception &e) @@ -262,7 +262,7 @@ void TriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, arguments_tab->setCellText(trigger->getArgument(i), i, 0); } - columns_tab->setButtonsEnabled(ObjectsTableWidget::ADD_BUTTON, (column_cmb->count()!=0)); + columns_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, (column_cmb->count()!=0)); arguments_tab->blockSignals(false); columns_tab->blockSignals(false); diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index cf5705bb6a..0d8e0bf24d 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -47,13 +47,13 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) grid->addWidget(functions_sel[i],i,1,1,1); } - enumerations_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::EDIT_BUTTON | ObjectsTableWidget::DUPLICATE_BUTTON), true, this); + enumerations_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::EditButton | ObjectsTableWidget::DuplicateButton), true, this); grid=dynamic_cast(enumerations_gb->layout()); grid->addWidget(enumerations_tab,1,0,1,2); enumerations_gb->setVisible(false); - attributes_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::DUPLICATE_BUTTON, true, this); + attributes_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::DuplicateButton, true, this); attributes_tab->setColumnCount(3); attributes_tab->setHeaderLabel(trUtf8("Name"),0); attributes_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); diff --git a/libpgmodeler_ui/src/updatenotifierwidget.cpp b/libpgmodeler_ui/src/updatenotifierwidget.cpp index 7ce57aca6d..8bb4b7ce37 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.cpp +++ b/libpgmodeler_ui/src/updatenotifierwidget.cpp @@ -47,9 +47,9 @@ UpdateNotifierWidget::UpdateNotifierWidget(QWidget *parent) : QWidget(parent) emit s_visibilityChanged(false); }); - PgModelerUiNs::configureWidgetFont(changelog_txt, PgModelerUiNs::MEDIUM_FONT_FACTOR); - PgModelerUiNs::configureWidgetFont(ver_num_lbl, PgModelerUiNs::BIG_FONT_FACTOR); - PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::BIG_FONT_FACTOR); + PgModelerUiNs::configureWidgetFont(changelog_txt, PgModelerUiNs::MediumFontFactor); + PgModelerUiNs::configureWidgetFont(ver_num_lbl, PgModelerUiNs::BigFontFactor); + PgModelerUiNs::configureWidgetFont(title_lbl, PgModelerUiNs::BigFontFactor); this->adjustSize(); } diff --git a/libpgmodeler_ui/src/validationinfo.cpp b/libpgmodeler_ui/src/validationinfo.cpp index d08f056256..82081fe1fb 100644 --- a/libpgmodeler_ui/src/validationinfo.cpp +++ b/libpgmodeler_ui/src/validationinfo.cpp @@ -21,14 +21,14 @@ ValidationInfo::ValidationInfo(void) { object=nullptr; - val_type=VALIDATION_ABORTED; + val_type=ValidationAborted; } ValidationInfo::ValidationInfo(unsigned val_type, BaseObject *object, vector references) { - if(val_type >= SQL_VALIDATION_ERR) + if(val_type >= SqlValidationError) throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if((val_type==NO_UNIQUE_NAME || val_type==BROKEN_REFERENCE) && + else if((val_type==NoUniqueName || val_type==BrokenReference) && (!object || references.empty())) throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -41,7 +41,7 @@ ValidationInfo::ValidationInfo(Exception e) { vector err_list; - val_type=SQL_VALIDATION_ERR; + val_type=SqlValidationError; e.getExceptionsList(err_list); while(!err_list.empty()) @@ -55,7 +55,7 @@ ValidationInfo::ValidationInfo(Exception e) ValidationInfo::ValidationInfo(const QString &msg) { - val_type=VALIDATION_ABORTED; + val_type=ValidationAborted; errors.push_back(msg); } @@ -81,6 +81,6 @@ QStringList ValidationInfo::getErrors(void) bool ValidationInfo::isValid(void) { - return(((val_type==NO_UNIQUE_NAME || val_type==BROKEN_REFERENCE) && object) || - (val_type==SQL_VALIDATION_ERR && !errors.empty())); + return(((val_type==NoUniqueName || val_type==BrokenReference) && object) || + (val_type==SqlValidationError && !errors.empty())); } diff --git a/libpgmodeler_ui/src/validationinfo.h b/libpgmodeler_ui/src/validationinfo.h index 6409c1ee66..5240c64514 100644 --- a/libpgmodeler_ui/src/validationinfo.h +++ b/libpgmodeler_ui/src/validationinfo.h @@ -46,13 +46,13 @@ class ValidationInfo { QStringList errors; public: - static constexpr unsigned NO_UNIQUE_NAME=0, - BROKEN_REFERENCE=1, - SP_OBJ_BROKEN_REFERENCE=2, - BROKEN_REL_CONFIG=3, - MISSING_EXTENSION=4, - SQL_VALIDATION_ERR=5, - VALIDATION_ABORTED=6; + static constexpr unsigned NoUniqueName=0, + BrokenReference=1, + SpObjBrokenReference=2, + BrokenRelConfig=3, + MissingExtension=4, + SqlValidationError=5, + ValidationAborted=6; ValidationInfo(void); ValidationInfo(unsigned val_type, BaseObject *object, vector references); diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index acc8b68cae..3bcb83ad57 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -55,7 +55,7 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjView) tag_sel=new ObjectSelectorWidget(ObjTag, false, this); dynamic_cast(options_gb->layout())->addWidget(tag_sel, 0, 1, 1, 4); - references_tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ ObjectsTableWidget::UPDATE_BUTTON, true, this); + references_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::UpdateButton, true, this); references_tab->setColumnCount(5); references_tab->setHeaderLabel(trUtf8("Col./Expr."), 0); references_tab->setHeaderLabel(trUtf8("Table alias"), 1); @@ -72,8 +72,8 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjView) //Configuring the table objects that stores the triggers and rules for(unsigned i=0, tab_id=1; i < sizeof(types)/sizeof(ObjectType); i++, tab_id++) { - tab=new ObjectsTableWidget(ObjectsTableWidget::ALL_BUTTONS ^ - (ObjectsTableWidget::UPDATE_BUTTON | ObjectsTableWidget::MOVE_BUTTONS), true, this); + tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::UpdateButton | ObjectsTableWidget::MoveButtons), true, this); objects_tab_map[types[i]]=tab; diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 9585560d32..ff45459376 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -402,7 +402,7 @@ void PgModelerCLI::showMenu(void) out << trUtf8(" %1, %2\t\t Draws the grid in the exported image.").arg(short_opts[SHOW_GRID]).arg(SHOW_GRID) << endl; out << trUtf8(" %1, %2\t Draws the page delimiters in the exported image.").arg(short_opts[SHOW_DELIMITERS]).arg(SHOW_DELIMITERS) << endl; out << trUtf8(" %1, %2\t\t Each page will be exported in a separated png image. (Only for PNG images)").arg(short_opts[PAGE_BY_PAGE]).arg(PAGE_BY_PAGE) << endl; - out << trUtf8(" %1, %2 [FACTOR]\t\t Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images)").arg(short_opts[ZOOM_FACTOR]).arg(ZOOM_FACTOR).arg(ModelWidget::MINIMUM_ZOOM*100).arg(ModelWidget::MAXIMUM_ZOOM*100) << endl; + out << trUtf8(" %1, %2 [FACTOR]\t\t Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images)").arg(short_opts[ZOOM_FACTOR]).arg(ZOOM_FACTOR).arg(ModelWidget::MinimumZoom*100).arg(ModelWidget::MaximumZoom*100) << endl; out << endl; out << trUtf8("DBMS export options: ") << endl; out << trUtf8(" %1, %2\t Ignores errors related to duplicated objects that eventually exist in the server.").arg(short_opts[IGNORE_DUPLICATES]).arg(IGNORE_DUPLICATES) << endl; @@ -536,7 +536,7 @@ void PgModelerCLI::parseOptions(attribs_map &opts) (!opts.count(HOST) || !opts.count(USER) || !opts.count(PASSWD) || !opts.count(INITIAL_DB)) ) throw Exception(trUtf8("Incomplete connection information!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(opts.count(EXPORT_TO_PNG) && (zoom < ModelWidget::MINIMUM_ZOOM || zoom > ModelWidget::MAXIMUM_ZOOM)) + if(opts.count(EXPORT_TO_PNG) && (zoom < ModelWidget::MinimumZoom || zoom > ModelWidget::MaximumZoom)) throw Exception(trUtf8("Invalid zoom specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(upd_mime && opts[DBM_MIME_TYPE]!=INSTALL && opts[DBM_MIME_TYPE]!=UNINSTALL) From 46da198691819ae7eab47eb5e7879719140725ec Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 10:41:33 -0300 Subject: [PATCH 171/425] Static const attributes refactoring checkpoint --- main-cli/src/main.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 806 +++++++++++++++++----------------- main-cli/src/pgmodelercli.h | 128 +++--- 3 files changed, 468 insertions(+), 468 deletions(-) diff --git a/main-cli/src/main.cpp b/main-cli/src/main.cpp index 983d6fd34b..5bf8990e0b 100644 --- a/main-cli/src/main.cpp +++ b/main-cli/src/main.cpp @@ -33,7 +33,7 @@ int main(int argc, char **argv) try { QTranslator translator; - PgModelerCLI pgmodeler_cli(argc, argv); + PgModelerCli pgmodeler_cli(argc, argv); //Tries to load the ui translation according to the system's locale translator.load(QLocale::system().name(), GlobalAttributes::LanguagesDir); diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index ff45459376..f13f5a2e3d 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -18,69 +18,69 @@ #include "pgmodelercli.h" -QTextStream PgModelerCLI::out(stdout); - -const QRegExp PgModelerCLI::PASSWORD_REGEXP=QRegExp("(password)(=)(.)*( )"); -const QString PgModelerCLI::PASSWORD_PLACEHOLDER=QString("password=******"); - -const QString PgModelerCLI::INPUT=QString("--input"); -const QString PgModelerCLI::OUTPUT=QString("--output"); -const QString PgModelerCLI::INPUT_DB=QString("--input-db"); -const QString PgModelerCLI::EXPORT_TO_FILE=QString("--export-to-file"); -const QString PgModelerCLI::EXPORT_TO_PNG=QString("--export-to-png"); -const QString PgModelerCLI::EXPORT_TO_SVG=QString("--export-to-svg"); -const QString PgModelerCLI::EXPORT_TO_DBMS=QString("--export-to-dbms"); -const QString PgModelerCLI::IMPORT_DB=QString("--import-db"); -const QString PgModelerCLI::DIFF=QString("--diff"); -const QString PgModelerCLI::DROP_DATABASE=QString("--drop-database"); -const QString PgModelerCLI::DROP_OBJECTS=QString("--drop-objects"); -const QString PgModelerCLI::PGSQL_VER=QString("--pgsql-ver"); -const QString PgModelerCLI::HELP=QString("--help"); -const QString PgModelerCLI::SHOW_GRID=QString("--show-grid"); -const QString PgModelerCLI::SHOW_DELIMITERS=QString("--show-delimiters"); -const QString PgModelerCLI::PAGE_BY_PAGE=QString("--page-by-page"); -const QString PgModelerCLI::IGNORE_DUPLICATES=QString("--ignore-duplicates"); -const QString PgModelerCLI::IGNORE_ERROR_CODES=QString("--ignore-error-codes"); -const QString PgModelerCLI::CONN_ALIAS=QString("--conn-alias"); -const QString PgModelerCLI::HOST=QString("--host"); -const QString PgModelerCLI::PORT=QString("--port"); -const QString PgModelerCLI::USER=QString("--user"); -const QString PgModelerCLI::PASSWD=QString("--passwd"); -const QString PgModelerCLI::INITIAL_DB=QString("--initial-db"); -const QString PgModelerCLI::SILENT=QString("--silent"); -const QString PgModelerCLI::LIST_CONNS=QString("--list-conns"); -const QString PgModelerCLI::SIMULATE=QString("--simulate"); -const QString PgModelerCLI::FIX_MODEL=QString("--fix-model"); -const QString PgModelerCLI::FIX_TRIES=QString("--fix-tries"); -const QString PgModelerCLI::ZOOM_FACTOR=QString("--zoom"); -const QString PgModelerCLI::USE_TMP_NAMES=QString("--use-tmp-names"); -const QString PgModelerCLI::DBM_MIME_TYPE=QString("--dbm-mime-type"); -const QString PgModelerCLI::INSTALL=QString("install"); -const QString PgModelerCLI::UNINSTALL=QString("uninstall"); -const QString PgModelerCLI::IGNORE_IMPORT_ERRORS=QString("--ignore-errors"); -const QString PgModelerCLI::IMPORT_SYSTEM_OBJS=QString("--import-sys-objs"); -const QString PgModelerCLI::IMPORT_EXTENSION_OBJS=QString("--import-ext-objs"); -const QString PgModelerCLI::DEBUG_MODE=QString("--debug-mode"); -const QString PgModelerCLI::COMPARE_TO=QString("--compare-to"); -const QString PgModelerCLI::SAVE_DIFF=QString("--save-diff"); -const QString PgModelerCLI::APPLY_DIFF=QString("--apply-diff"); -const QString PgModelerCLI::NO_DIFF_PREVIEW=QString("--no-diff-preview"); -const QString PgModelerCLI::DROP_CLUSTER_OBJS=QString("--drop-cluster-objs"); -const QString PgModelerCLI::REVOKE_PERMISSIONS=QString("--revoke-perms"); -const QString PgModelerCLI::DROP_MISSING_OBJS=QString("--drop-missing"); -const QString PgModelerCLI::FORCE_DROP_COLS_CONSTRS=QString("--force-drop-cols"); -const QString PgModelerCLI::RENAME_DB=QString("--rename-db"); -const QString PgModelerCLI::TRUNC_ON_COLS_TYPE_CHANGE=QString("--trunc-type-change"); -const QString PgModelerCLI::NO_SEQUENCE_REUSE=QString("--no-sequence-reuse"); -const QString PgModelerCLI::NO_CASCADE_DROP_TRUNC=QString("--no-cascade"); -const QString PgModelerCLI::NO_FORCE_OBJ_RECREATION=QString("--no-force-recreation"); -const QString PgModelerCLI::NO_UNMOD_OBJ_RECREATION=QString("--no-unmod-recreation"); - -const QString PgModelerCLI::TAG_EXPR=QString("<%1"); -const QString PgModelerCLI::END_TAG_EXPR=QString("getXMLParser(); - silent_mode=(parsed_opts.count(SILENT)); + silent_mode=(parsed_opts.count(Silent)); //If the export is to png or svg loads additional configurations - if(parsed_opts.count(EXPORT_TO_PNG) || parsed_opts.count(EXPORT_TO_SVG) || parsed_opts.count(IMPORT_DB)) + if(parsed_opts.count(ExportToPng) || parsed_opts.count(ExportToSvg) || parsed_opts.count(ImportDb)) { connect(model, SIGNAL(s_objectAdded(BaseObject*)), this, SLOT(handleObjectAddition(BaseObject *))); connect(model, SIGNAL(s_objectRemoved(BaseObject*)), this, SLOT(handleObjectRemoval(BaseObject *))); @@ -163,23 +163,23 @@ PgModelerCLI::PgModelerCLI(int argc, char **argv) : QApplication(argc, argv) BaseObjectView::loadObjectsStyle(); } - if(parsed_opts.count(EXPORT_TO_DBMS) || parsed_opts.count(IMPORT_DB) || parsed_opts.count(DIFF)) + if(parsed_opts.count(ExportToDbms) || parsed_opts.count(ImportDb) || parsed_opts.count(Diff)) { configureConnection(false); //Replacing the initial db parameter for the input database when reverse engineering - if((parsed_opts.count(IMPORT_DB) || parsed_opts.count(DIFF)) && !parsed_opts[INPUT_DB].isEmpty()) - connection.setConnectionParam(Connection::ParamDbName, parsed_opts[INPUT_DB]); + if((parsed_opts.count(ImportDb) || parsed_opts.count(Diff)) && !parsed_opts[InputDb].isEmpty()) + connection.setConnectionParam(Connection::ParamDbName, parsed_opts[InputDb]); } - if(parsed_opts.count(DIFF)) + if(parsed_opts.count(Diff)) { configureConnection(true); if(!extra_connection.isConfigured()) extra_connection = connection; - extra_connection.setConnectionParam(Connection::ParamDbName, parsed_opts[COMPARE_TO]); + extra_connection.setConnectionParam(Connection::ParamDbName, parsed_opts[CompareTo]); } if(!silent_mode) @@ -197,147 +197,147 @@ PgModelerCLI::PgModelerCLI(int argc, char **argv) : QApplication(argc, argv) } } -PgModelerCLI::~PgModelerCLI(void) +PgModelerCli::~PgModelerCli(void) { if(scene) delete(scene); delete(model); } -void PgModelerCLI::printMessage(const QString &msg) +void PgModelerCli::printMessage(const QString &msg) { if(!silent_mode) out << msg << endl; } -void PgModelerCLI::configureConnection(bool extra_conn) +void PgModelerCli::configureConnection(bool extra_conn) { QString chr = (extra_conn ? "1" : ""); Connection *conn = (extra_conn ? &extra_connection : &connection); //Getting the connection using its alias - if(parsed_opts.count(CONN_ALIAS + chr)) + if(parsed_opts.count(ConnAlias + chr)) { - if(!connections.count(parsed_opts[CONN_ALIAS + chr])) - throw Exception(trUtf8("Connection aliased as '%1' was not found in the configuration file.").arg(parsed_opts[CONN_ALIAS + chr]), + if(!connections.count(parsed_opts[ConnAlias + chr])) + throw Exception(trUtf8("Connection aliased as '%1' was not found in the configuration file.").arg(parsed_opts[ConnAlias + chr]), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Make a copy of the named connection - *conn = (*connections[parsed_opts[CONN_ALIAS + chr]]); + *conn = (*connections[parsed_opts[ConnAlias + chr]]); } else { - conn->setConnectionParam(Connection::ParamServerFqdn, parsed_opts[HOST + chr]); - conn->setConnectionParam(Connection::ParamUser, parsed_opts[USER + chr]); - conn->setConnectionParam(Connection::ParamPort, parsed_opts[PORT + chr]); - conn->setConnectionParam(Connection::ParamPassword, parsed_opts[PASSWD + chr]); - conn->setConnectionParam(Connection::ParamDbName, parsed_opts[INITIAL_DB + chr]); + conn->setConnectionParam(Connection::ParamServerFqdn, parsed_opts[Host + chr]); + conn->setConnectionParam(Connection::ParamUser, parsed_opts[User + chr]); + conn->setConnectionParam(Connection::ParamPort, parsed_opts[Port + chr]); + conn->setConnectionParam(Connection::ParamPassword, parsed_opts[Passwd + chr]); + conn->setConnectionParam(Connection::ParamDbName, parsed_opts[InitialDb + chr]); } } -void PgModelerCLI::initializeOptions(void) +void PgModelerCli::initializeOptions(void) { - long_opts[INPUT]=true; - long_opts[OUTPUT]=true; - long_opts[INPUT_DB]=true; - long_opts[EXPORT_TO_FILE]=false; - long_opts[EXPORT_TO_PNG]=false; - long_opts[EXPORT_TO_SVG]=false; - long_opts[EXPORT_TO_DBMS]=false; - long_opts[IMPORT_DB]=false; - long_opts[DIFF]=false; - long_opts[DROP_DATABASE]=false; - long_opts[DROP_OBJECTS]=false; - long_opts[PGSQL_VER]=true; - long_opts[HELP]=false; - long_opts[SHOW_GRID]=false; - long_opts[SHOW_DELIMITERS]=false; - long_opts[PAGE_BY_PAGE]=false; - long_opts[IGNORE_DUPLICATES]=false; - long_opts[IGNORE_ERROR_CODES]=true; - long_opts[CONN_ALIAS]=true; - long_opts[HOST]=true; - long_opts[PORT]=true; - long_opts[USER]=true; - long_opts[PASSWD]=true; - long_opts[INITIAL_DB]=true; - long_opts[LIST_CONNS]=false; - long_opts[SIMULATE]=false; - long_opts[FIX_MODEL]=false; - long_opts[FIX_TRIES]=true; - long_opts[ZOOM_FACTOR]=true; - long_opts[USE_TMP_NAMES]=false; - long_opts[DBM_MIME_TYPE]=true; - long_opts[IGNORE_IMPORT_ERRORS]=false; - long_opts[IMPORT_SYSTEM_OBJS]=false; - long_opts[IMPORT_EXTENSION_OBJS]=false; - long_opts[DEBUG_MODE]=false; - long_opts[COMPARE_TO]=true; - long_opts[SAVE_DIFF]=false; - long_opts[APPLY_DIFF]=false; - long_opts[NO_DIFF_PREVIEW]=false; - long_opts[DROP_CLUSTER_OBJS]=false; - long_opts[REVOKE_PERMISSIONS]=false; - long_opts[DROP_MISSING_OBJS]=false; - long_opts[FORCE_DROP_COLS_CONSTRS]=false; - long_opts[RENAME_DB]=false; - long_opts[TRUNC_ON_COLS_TYPE_CHANGE]=false; - long_opts[NO_SEQUENCE_REUSE]=false; - long_opts[NO_CASCADE_DROP_TRUNC]=false; - long_opts[NO_FORCE_OBJ_RECREATION]=false; - long_opts[NO_UNMOD_OBJ_RECREATION]=false; - - short_opts[INPUT]=QString("-if"); - short_opts[OUTPUT]=QString("-of"); - short_opts[INPUT_DB]=QString("-id"); - short_opts[EXPORT_TO_FILE]=QString("-ef"); - short_opts[EXPORT_TO_PNG]=QString("-ep"); - short_opts[EXPORT_TO_SVG]=QString("-es"); - short_opts[EXPORT_TO_DBMS]=QString("-ed"); - short_opts[IMPORT_DB]=QString("-im"); - short_opts[DIFF]=QString("-df"); - short_opts[DROP_DATABASE]=QString("-dd"); - short_opts[DROP_OBJECTS]=QString("-do"); - short_opts[PGSQL_VER]=QString("-v"); - short_opts[HELP]=QString("-h"); - short_opts[SHOW_GRID]=QString("-sg"); - short_opts[SHOW_DELIMITERS]=QString("-sl"); - short_opts[PAGE_BY_PAGE]=QString("-pp"); - short_opts[IGNORE_DUPLICATES]=QString("-ir"); - short_opts[IGNORE_ERROR_CODES]=QString("-ic"); - short_opts[CONN_ALIAS]=QString("-ca"); - short_opts[HOST]=QString("-H"); - short_opts[PORT]=QString("-p"); - short_opts[USER]=QString("-u"); - short_opts[PASSWD]=QString("-w"); - short_opts[INITIAL_DB]=QString("-D"); - short_opts[SILENT]=QString("-s"); - short_opts[LIST_CONNS]=QString("-lc"); - short_opts[SIMULATE]=QString("-sm"); - short_opts[FIX_MODEL]=QString("-fm"); - short_opts[FIX_TRIES]=QString("-ft"); - short_opts[ZOOM_FACTOR]=QString("-zf"); - short_opts[USE_TMP_NAMES]=QString("-tn"); - short_opts[DBM_MIME_TYPE]=QString("-mt"); - short_opts[IGNORE_IMPORT_ERRORS]=QString("-ie"); - short_opts[IMPORT_SYSTEM_OBJS]=QString("-is"); - short_opts[IMPORT_EXTENSION_OBJS]=QString("-ix"); - short_opts[DEBUG_MODE]=QString("-d"); - short_opts[COMPARE_TO]=QString("-ct"); - short_opts[SAVE_DIFF]=QString("-sd"); - short_opts[APPLY_DIFF]=QString("-ad"); - short_opts[NO_DIFF_PREVIEW]=QString("-np"); - short_opts[DROP_CLUSTER_OBJS]=QString("-dc"); - short_opts[REVOKE_PERMISSIONS]=QString("-rv"); - short_opts[DROP_MISSING_OBJS]=QString("-dm"); - short_opts[FORCE_DROP_COLS_CONSTRS]=QString("-fd"); - short_opts[RENAME_DB]=QString("-rn"); - short_opts[TRUNC_ON_COLS_TYPE_CHANGE]=QString("-tt"); - short_opts[NO_SEQUENCE_REUSE]=QString("-ns"); - short_opts[NO_CASCADE_DROP_TRUNC]=QString("-nd"); - short_opts[NO_FORCE_OBJ_RECREATION]=QString("-nf"); - short_opts[NO_UNMOD_OBJ_RECREATION]=QString("-nu"); + long_opts[Input]=true; + long_opts[Output]=true; + long_opts[InputDb]=true; + long_opts[ExportToFile]=false; + long_opts[ExportToPng]=false; + long_opts[ExportToSvg]=false; + long_opts[ExportToDbms]=false; + long_opts[ImportDb]=false; + long_opts[Diff]=false; + long_opts[DropDatabase]=false; + long_opts[DropObjects]=false; + long_opts[PgSqlVer]=true; + long_opts[Help]=false; + long_opts[ShowGrid]=false; + long_opts[ShowDelimiters]=false; + long_opts[PageByPage]=false; + long_opts[IgnoreDuplicates]=false; + long_opts[IgnoreErrorCodes]=true; + long_opts[ConnAlias]=true; + long_opts[Host]=true; + long_opts[Port]=true; + long_opts[User]=true; + long_opts[Passwd]=true; + long_opts[InitialDb]=true; + long_opts[ListConns]=false; + long_opts[Simulate]=false; + long_opts[FixModel]=false; + long_opts[FixTries]=true; + long_opts[ZoomFactor]=true; + long_opts[UseTmpNames]=false; + long_opts[DbmMimeType]=true; + long_opts[IgnoreImportErrors]=false; + long_opts[ImportSystemObjs]=false; + long_opts[ImportExtensionObjs]=false; + long_opts[DebugMode]=false; + long_opts[CompareTo]=true; + long_opts[SaveDiff]=false; + long_opts[ApplyDiff]=false; + long_opts[NoDiffPreview]=false; + long_opts[DropClusterObjs]=false; + long_opts[RevokePermissions]=false; + long_opts[DropMissingObjs]=false; + long_opts[ForceDropColsConstrs]=false; + long_opts[RenameDb]=false; + long_opts[TruncOnColsTypeChange]=false; + long_opts[NoSequenceReuse]=false; + long_opts[NoCascadeDropTrunc]=false; + long_opts[NoForceObjRecreation]=false; + long_opts[NoUnmodObjRecreation]=false; + + short_opts[Input]=QString("-if"); + short_opts[Output]=QString("-of"); + short_opts[InputDb]=QString("-id"); + short_opts[ExportToFile]=QString("-ef"); + short_opts[ExportToPng]=QString("-ep"); + short_opts[ExportToSvg]=QString("-es"); + short_opts[ExportToDbms]=QString("-ed"); + short_opts[ImportDb]=QString("-im"); + short_opts[Diff]=QString("-df"); + short_opts[DropDatabase]=QString("-dd"); + short_opts[DropObjects]=QString("-do"); + short_opts[PgSqlVer]=QString("-v"); + short_opts[Help]=QString("-h"); + short_opts[ShowGrid]=QString("-sg"); + short_opts[ShowDelimiters]=QString("-sl"); + short_opts[PageByPage]=QString("-pp"); + short_opts[IgnoreDuplicates]=QString("-ir"); + short_opts[IgnoreErrorCodes]=QString("-ic"); + short_opts[ConnAlias]=QString("-ca"); + short_opts[Host]=QString("-H"); + short_opts[Port]=QString("-p"); + short_opts[User]=QString("-u"); + short_opts[Passwd]=QString("-w"); + short_opts[InitialDb]=QString("-D"); + short_opts[Silent]=QString("-s"); + short_opts[ListConns]=QString("-lc"); + short_opts[Simulate]=QString("-sm"); + short_opts[FixModel]=QString("-fm"); + short_opts[FixTries]=QString("-ft"); + short_opts[ZoomFactor]=QString("-zf"); + short_opts[UseTmpNames]=QString("-tn"); + short_opts[DbmMimeType]=QString("-mt"); + short_opts[IgnoreImportErrors]=QString("-ie"); + short_opts[ImportSystemObjs]=QString("-is"); + short_opts[ImportExtensionObjs]=QString("-ix"); + short_opts[DebugMode]=QString("-d"); + short_opts[CompareTo]=QString("-ct"); + short_opts[SaveDiff]=QString("-sd"); + short_opts[ApplyDiff]=QString("-ad"); + short_opts[NoDiffPreview]=QString("-np"); + short_opts[DropClusterObjs]=QString("-dc"); + short_opts[RevokePermissions]=QString("-rv"); + short_opts[DropMissingObjs]=QString("-dm"); + short_opts[ForceDropColsConstrs]=QString("-fd"); + short_opts[RenameDb]=QString("-rn"); + short_opts[TruncOnColsTypeChange]=QString("-tt"); + short_opts[NoSequenceReuse]=QString("-ns"); + short_opts[NoCascadeDropTrunc]=QString("-nd"); + short_opts[NoForceObjRecreation]=QString("-nf"); + short_opts[NoUnmodObjRecreation]=QString("-nu"); } -bool PgModelerCLI::isOptionRecognized(QString &op, bool &accepts_val) +bool PgModelerCli::isOptionRecognized(QString &op, bool &accepts_val) { bool found=false, append_chr = false; @@ -363,7 +363,7 @@ bool PgModelerCLI::isOptionRecognized(QString &op, bool &accepts_val) return(found); } -void PgModelerCLI::showMenu(void) +void PgModelerCli::showMenu(void) { out << endl; out << QString("pgModeler ") << GlobalAttributes::PgModelerVersion << trUtf8(" command line interface.") << endl; @@ -374,101 +374,101 @@ void PgModelerCLI::showMenu(void) out << trUtf8("This CLI tool provides several operations over models and databases without the need to perform them\nin pgModeler's graphical interface. All available options are described below.") << endl; out << endl; out << trUtf8("General options: ") << endl; - out << trUtf8(" %1, %2 [FILE]\t\t Input model file (.dbm). This is mandatory for fix, export operations.").arg(short_opts[INPUT]).arg(INPUT) << endl; - out << trUtf8(" %1, %2 [DBNAME]\t Input database name. This is mandatory for import operation.").arg(short_opts[INPUT_DB]).arg(INPUT_DB) << endl; - out << trUtf8(" %1, %2 [FILE]\t\t Output file. This is mandatory for fixing model or exporting to file, png or svg.").arg(short_opts[OUTPUT]).arg(OUTPUT) << endl; - out << trUtf8(" %1, %2\t\t Try to fix the structure of the input model file in order to make it loadable again.").arg(short_opts[FIX_MODEL]).arg(FIX_MODEL) << endl; - out << trUtf8(" %1, %2 [NUMBER]\t Model fix tries. When reaching the maximum count the invalid objects will be discarded.").arg(short_opts[FIX_TRIES]).arg(FIX_TRIES) << endl; - out << trUtf8(" %1, %2\t\t Export the input model to a sql script file.").arg(short_opts[EXPORT_TO_FILE]).arg(EXPORT_TO_FILE)<< endl; - out << trUtf8(" %1, %2\t\t Export the input model to a png image.").arg(short_opts[EXPORT_TO_PNG]).arg(EXPORT_TO_PNG) << endl; - out << trUtf8(" %1, %2\t\t Export the input model to a svg file.").arg(short_opts[EXPORT_TO_SVG]).arg(EXPORT_TO_SVG) << endl; - out << trUtf8(" %1, %2\t\t Export the input model directly to a PostgreSQL server.").arg(short_opts[EXPORT_TO_DBMS]).arg(EXPORT_TO_DBMS) << endl; - out << trUtf8(" %1, %2\t\t Import a database to an output file.").arg(short_opts[IMPORT_DB]).arg(IMPORT_DB) << endl; - out << trUtf8(" %1, %2\t\t\t Compares a model and a database or two databases generating the SQL script to synch the latter in relation to the first.").arg(short_opts[DIFF]).arg(DIFF) << endl; - out << trUtf8(" %1, %2\t\t Force the PostgreSQL version of generated SQL code.").arg(short_opts[PGSQL_VER]).arg(PGSQL_VER) << endl; - out << trUtf8(" %1, %2\t\t\t Silent execution. Only critical messages and errors are shown during process.").arg(short_opts[SILENT]).arg(SILENT) << endl; - out << trUtf8(" %1, %2\t\t\t Show this help menu.").arg(short_opts[HELP]).arg(HELP) << endl; + out << trUtf8(" %1, %2 [FILE]\t\t Input model file (.dbm). This is mandatory for fix, export operations.").arg(short_opts[Input]).arg(Input) << endl; + out << trUtf8(" %1, %2 [DBNAME]\t Input database name. This is mandatory for import operation.").arg(short_opts[InputDb]).arg(InputDb) << endl; + out << trUtf8(" %1, %2 [FILE]\t\t Output file. This is mandatory for fixing model or exporting to file, png or svg.").arg(short_opts[Output]).arg(Output) << endl; + out << trUtf8(" %1, %2\t\t Try to fix the structure of the input model file in order to make it loadable again.").arg(short_opts[FixModel]).arg(FixModel) << endl; + out << trUtf8(" %1, %2 [NUMBER]\t Model fix tries. When reaching the maximum count the invalid objects will be discarded.").arg(short_opts[FixTries]).arg(FixTries) << endl; + out << trUtf8(" %1, %2\t\t Export the input model to a sql script file.").arg(short_opts[ExportToFile]).arg(ExportToFile)<< endl; + out << trUtf8(" %1, %2\t\t Export the input model to a png image.").arg(short_opts[ExportToPng]).arg(ExportToPng) << endl; + out << trUtf8(" %1, %2\t\t Export the input model to a svg file.").arg(short_opts[ExportToSvg]).arg(ExportToSvg) << endl; + out << trUtf8(" %1, %2\t\t Export the input model directly to a PostgreSQL server.").arg(short_opts[ExportToDbms]).arg(ExportToDbms) << endl; + out << trUtf8(" %1, %2\t\t Import a database to an output file.").arg(short_opts[ImportDb]).arg(ImportDb) << endl; + out << trUtf8(" %1, %2\t\t\t Compares a model and a database or two databases generating the SQL script to synch the latter in relation to the first.").arg(short_opts[Diff]).arg(Diff) << endl; + out << trUtf8(" %1, %2\t\t Force the PostgreSQL version of generated SQL code.").arg(short_opts[PgSqlVer]).arg(PgSqlVer) << endl; + out << trUtf8(" %1, %2\t\t\t Silent execution. Only critical messages and errors are shown during process.").arg(short_opts[Silent]).arg(Silent) << endl; + out << trUtf8(" %1, %2\t\t\t Show this help menu.").arg(short_opts[Help]).arg(Help) << endl; out << endl; out << trUtf8("Connection options: ") << endl; - out << trUtf8(" %1, %2\t\t List available connections in file %3.").arg(short_opts[LIST_CONNS]).arg(LIST_CONNS).arg(GlobalAttributes::ConnectionsConf + GlobalAttributes::ConfigurationExt) << endl; - out << trUtf8(" %1, %2 [ALIAS]\t Connection configuration alias to be used.").arg(short_opts[CONN_ALIAS]).arg(CONN_ALIAS) << endl; - out << trUtf8(" %1, %2 [HOST]\t\t PostgreSQL host in which a task will operate.").arg(short_opts[HOST]).arg(HOST) << endl; - out << trUtf8(" %1, %2 [PORT]\t\t PostgreSQL host listening port.").arg(short_opts[PORT]).arg(PORT) << endl; - out << trUtf8(" %1, %2 [USER]\t\t PostgreSQL username.").arg(short_opts[USER]).arg(USER) << endl; - out << trUtf8(" %1, %2 [PASSWORD]\t PostgreSQL user password.").arg(short_opts[PASSWD]).arg(PASSWD) << endl; - out << trUtf8(" %1, %2 [DBNAME]\t Connection's initial database.").arg(short_opts[INITIAL_DB]).arg(INITIAL_DB) << endl; + out << trUtf8(" %1, %2\t\t List available connections in file %3.").arg(short_opts[ListConns]).arg(ListConns).arg(GlobalAttributes::ConnectionsConf + GlobalAttributes::ConfigurationExt) << endl; + out << trUtf8(" %1, %2 [ALIAS]\t Connection configuration alias to be used.").arg(short_opts[ConnAlias]).arg(ConnAlias) << endl; + out << trUtf8(" %1, %2 [HOST]\t\t PostgreSQL host in which a task will operate.").arg(short_opts[Host]).arg(Host) << endl; + out << trUtf8(" %1, %2 [PORT]\t\t PostgreSQL host listening port.").arg(short_opts[Port]).arg(Port) << endl; + out << trUtf8(" %1, %2 [USER]\t\t PostgreSQL username.").arg(short_opts[User]).arg(User) << endl; + out << trUtf8(" %1, %2 [PASSWORD]\t PostgreSQL user password.").arg(short_opts[Passwd]).arg(Passwd) << endl; + out << trUtf8(" %1, %2 [DBNAME]\t Connection's initial database.").arg(short_opts[InitialDb]).arg(InitialDb) << endl; out << endl; out << trUtf8("PNG and SVG export options: ") << endl; - out << trUtf8(" %1, %2\t\t Draws the grid in the exported image.").arg(short_opts[SHOW_GRID]).arg(SHOW_GRID) << endl; - out << trUtf8(" %1, %2\t Draws the page delimiters in the exported image.").arg(short_opts[SHOW_DELIMITERS]).arg(SHOW_DELIMITERS) << endl; - out << trUtf8(" %1, %2\t\t Each page will be exported in a separated png image. (Only for PNG images)").arg(short_opts[PAGE_BY_PAGE]).arg(PAGE_BY_PAGE) << endl; - out << trUtf8(" %1, %2 [FACTOR]\t\t Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images)").arg(short_opts[ZOOM_FACTOR]).arg(ZOOM_FACTOR).arg(ModelWidget::MinimumZoom*100).arg(ModelWidget::MaximumZoom*100) << endl; + out << trUtf8(" %1, %2\t\t Draws the grid in the exported image.").arg(short_opts[ShowGrid]).arg(ShowGrid) << endl; + out << trUtf8(" %1, %2\t Draws the page delimiters in the exported image.").arg(short_opts[ShowDelimiters]).arg(ShowDelimiters) << endl; + out << trUtf8(" %1, %2\t\t Each page will be exported in a separated png image. (Only for PNG images)").arg(short_opts[PageByPage]).arg(PageByPage) << endl; + out << trUtf8(" %1, %2 [FACTOR]\t\t Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG images)").arg(short_opts[ZoomFactor]).arg(ZoomFactor).arg(ModelWidget::MinimumZoom*100).arg(ModelWidget::MaximumZoom*100) << endl; out << endl; out << trUtf8("DBMS export options: ") << endl; - out << trUtf8(" %1, %2\t Ignores errors related to duplicated objects that eventually exist in the server.").arg(short_opts[IGNORE_DUPLICATES]).arg(IGNORE_DUPLICATES) << endl; - out << trUtf8(" %1, %2 [CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided.").arg(short_opts[IGNORE_ERROR_CODES]).arg(IGNORE_ERROR_CODES) << endl; - out << trUtf8(" %1, %2\t\t Drop the database before execute a export process.").arg(short_opts[DROP_DATABASE]).arg(DROP_DATABASE) << endl; - out << trUtf8(" %1, %2\t\t Runs the DROP commands attached to SQL-enabled objects.").arg(short_opts[DROP_OBJECTS]).arg(DROP_OBJECTS) << endl; - out << trUtf8(" %1, %2\t\t Simulates an export process by executing all steps but undoing any modification in the end.").arg(short_opts[SIMULATE]).arg(SIMULATE) << endl; - out << trUtf8(" %1, %2\t\t Generates temporary names for database, roles and tablespaces when in simulation mode.").arg(short_opts[USE_TMP_NAMES]).arg(USE_TMP_NAMES) << endl; + out << trUtf8(" %1, %2\t Ignores errors related to duplicated objects that eventually exist in the server.").arg(short_opts[IgnoreDuplicates]).arg(IgnoreDuplicates) << endl; + out << trUtf8(" %1, %2 [CODES] Ignores additional errors by their codes. A comma-separated list of alphanumeric codes should be provided.").arg(short_opts[IgnoreErrorCodes]).arg(IgnoreErrorCodes) << endl; + out << trUtf8(" %1, %2\t\t Drop the database before execute a export process.").arg(short_opts[DropDatabase]).arg(DropDatabase) << endl; + out << trUtf8(" %1, %2\t\t Runs the DROP commands attached to SQL-enabled objects.").arg(short_opts[DropObjects]).arg(DropObjects) << endl; + out << trUtf8(" %1, %2\t\t Simulates an export process by executing all steps but undoing any modification in the end.").arg(short_opts[Simulate]).arg(Simulate) << endl; + out << trUtf8(" %1, %2\t\t Generates temporary names for database, roles and tablespaces when in simulation mode.").arg(short_opts[UseTmpNames]).arg(UseTmpNames) << endl; out << endl; out << trUtf8("Database import options: ") << endl; - out << trUtf8(" %1, %2\t\t Ignore all errors and try to create as many as possible objects.").arg(short_opts[IGNORE_IMPORT_ERRORS]).arg(IGNORE_IMPORT_ERRORS) << endl; - out << trUtf8(" %1, %2\t Import system built-in objects. This option causes the model bloating due to the importing of unneeded objects.").arg(short_opts[IMPORT_SYSTEM_OBJS]).arg(IMPORT_SYSTEM_OBJS) << endl; - out << trUtf8(" %1, %2\t Import extension objects. This option causes the model bloating due to the importing of unneeded objects.").arg(short_opts[IMPORT_EXTENSION_OBJS]).arg(IMPORT_EXTENSION_OBJS) << endl; - out << trUtf8(" %1, %2\t\t Run import in debug mode printing all queries executed in the server.").arg(short_opts[DEBUG_MODE]).arg(DEBUG_MODE) << endl; + out << trUtf8(" %1, %2\t\t Ignore all errors and try to create as many as possible objects.").arg(short_opts[IgnoreImportErrors]).arg(IgnoreImportErrors) << endl; + out << trUtf8(" %1, %2\t Import system built-in objects. This option causes the model bloating due to the importing of unneeded objects.").arg(short_opts[ImportSystemObjs]).arg(ImportSystemObjs) << endl; + out << trUtf8(" %1, %2\t Import extension objects. This option causes the model bloating due to the importing of unneeded objects.").arg(short_opts[ImportExtensionObjs]).arg(ImportExtensionObjs) << endl; + out << trUtf8(" %1, %2\t\t Run import in debug mode printing all queries executed in the server.").arg(short_opts[DebugMode]).arg(DebugMode) << endl; out << endl; out << trUtf8("Diff options: ") << endl; - out << trUtf8(" %1, %2 [DBNAME]\t The database used in the comparison. All the SQL code generated is applied to it.").arg(short_opts[COMPARE_TO]).arg(COMPARE_TO) << endl; - out << trUtf8(" %1, %2\t\t Save the generated diff code to output file.").arg(short_opts[SAVE_DIFF]).arg(SAVE_DIFF) << endl; - out << trUtf8(" %1, %2\t\t Apply the generated diff code on the database server.").arg(short_opts[APPLY_DIFF]).arg(APPLY_DIFF) << endl; - out << trUtf8(" %1, %2\t Don't preview the generated diff code when applying it to the server.").arg(short_opts[NO_DIFF_PREVIEW]).arg(NO_DIFF_PREVIEW) << endl; - out << trUtf8(" %1, %2\t Drop cluster level objects like roles and tablespaces.").arg(short_opts[DROP_CLUSTER_OBJS]).arg(DROP_CLUSTER_OBJS) << endl; - out << trUtf8(" %1, %2\t\t Revoke permissions already set on the database. New permissions configured in the input model are still applied.").arg(short_opts[REVOKE_PERMISSIONS]).arg(REVOKE_PERMISSIONS) << endl; - out << trUtf8(" %1, %2\t\t Drop missing objects. Generates DROP commands for objects that are present in the input model but not in the compared database.").arg(short_opts[DROP_MISSING_OBJS]).arg(DROP_MISSING_OBJS) << endl; - out << trUtf8(" %1, %2\t Force the drop of missing columns and constraints. Causes only columns and constraints to be dropped, other missing objects aren't removed.").arg(short_opts[FORCE_DROP_COLS_CONSTRS]).arg(FORCE_DROP_COLS_CONSTRS) << endl; - out << trUtf8(" %1, %2\t\t Rename the destination database when the names of the involved databases are different.").arg(short_opts[RENAME_DB]).arg(RENAME_DB) << endl; - out << trUtf8(" %1, %2\t\t Don't drop or truncate objects in cascade mode.").arg(short_opts[NO_CASCADE_DROP_TRUNC]).arg(NO_CASCADE_DROP_TRUNC) << endl; - out << trUtf8(" %1, %2\t Truncate tables prior to alter columns. Avoids errors related to type casting when the new type of a column isn't compatible to the old one.").arg(short_opts[TRUNC_ON_COLS_TYPE_CHANGE]).arg(TRUNC_ON_COLS_TYPE_CHANGE) << endl; - out << trUtf8(" %1, %2\t Don't reuse sequences on serial columns. Drop the old sequence assigned to a serial column and creates a new one.").arg(short_opts[NO_SEQUENCE_REUSE]).arg(NO_SEQUENCE_REUSE) << endl; - out << trUtf8(" %1, %2\t Don't force the recreation of objects. Avoids the usage of a DROP and CREATE commands to create a new version of the objects.").arg(short_opts[NO_FORCE_OBJ_RECREATION]).arg(NO_FORCE_OBJ_RECREATION) << endl; - out << trUtf8(" %1, %2\t Don't recreate the unmodifiable objects. These objects are the ones which can't be changed via ALTER command.").arg(short_opts[NO_UNMOD_OBJ_RECREATION]).arg(NO_UNMOD_OBJ_RECREATION) << endl; + out << trUtf8(" %1, %2 [DBNAME]\t The database used in the comparison. All the SQL code generated is applied to it.").arg(short_opts[CompareTo]).arg(CompareTo) << endl; + out << trUtf8(" %1, %2\t\t Save the generated diff code to output file.").arg(short_opts[SaveDiff]).arg(SaveDiff) << endl; + out << trUtf8(" %1, %2\t\t Apply the generated diff code on the database server.").arg(short_opts[ApplyDiff]).arg(ApplyDiff) << endl; + out << trUtf8(" %1, %2\t Don't preview the generated diff code when applying it to the server.").arg(short_opts[NoDiffPreview]).arg(NoDiffPreview) << endl; + out << trUtf8(" %1, %2\t Drop cluster level objects like roles and tablespaces.").arg(short_opts[DropClusterObjs]).arg(DropClusterObjs) << endl; + out << trUtf8(" %1, %2\t\t Revoke permissions already set on the database. New permissions configured in the input model are still applied.").arg(short_opts[RevokePermissions]).arg(RevokePermissions) << endl; + out << trUtf8(" %1, %2\t\t Drop missing objects. Generates DROP commands for objects that are present in the input model but not in the compared database.").arg(short_opts[DropMissingObjs]).arg(DropMissingObjs) << endl; + out << trUtf8(" %1, %2\t Force the drop of missing columns and constraints. Causes only columns and constraints to be dropped, other missing objects aren't removed.").arg(short_opts[ForceDropColsConstrs]).arg(ForceDropColsConstrs) << endl; + out << trUtf8(" %1, %2\t\t Rename the destination database when the names of the involved databases are different.").arg(short_opts[RenameDb]).arg(RenameDb) << endl; + out << trUtf8(" %1, %2\t\t Don't drop or truncate objects in cascade mode.").arg(short_opts[NoCascadeDropTrunc]).arg(NoCascadeDropTrunc) << endl; + out << trUtf8(" %1, %2\t Truncate tables prior to alter columns. Avoids errors related to type casting when the new type of a column isn't compatible to the old one.").arg(short_opts[TruncOnColsTypeChange]).arg(TruncOnColsTypeChange) << endl; + out << trUtf8(" %1, %2\t Don't reuse sequences on serial columns. Drop the old sequence assigned to a serial column and creates a new one.").arg(short_opts[NoSequenceReuse]).arg(NoSequenceReuse) << endl; + out << trUtf8(" %1, %2\t Don't force the recreation of objects. Avoids the usage of a DROP and CREATE commands to create a new version of the objects.").arg(short_opts[NoForceObjRecreation]).arg(NoForceObjRecreation) << endl; + out << trUtf8(" %1, %2\t Don't recreate the unmodifiable objects. These objects are the ones which can't be changed via ALTER command.").arg(short_opts[NoUnmodObjRecreation]).arg(NoUnmodObjRecreation) << endl; out << endl; #ifndef Q_OS_MAC out << trUtf8("Miscellaneous options: ") << endl; - out << trUtf8(" %1, %2 [ACTION]\t Handles the file association to .dbm files. The ACTION can be [%3 | %4].").arg(short_opts[DBM_MIME_TYPE]).arg(DBM_MIME_TYPE).arg(INSTALL).arg(UNINSTALL) << endl; + out << trUtf8(" %1, %2 [ACTION]\t Handles the file association to .dbm files. The ACTION can be [%3 | %4].").arg(short_opts[DbmMimeType]).arg(DbmMimeType).arg(Install).arg(Uninstall) << endl; out << endl; #endif out << trUtf8("** The diff process allows the usage of the following options related to import and export operations: ") << endl; - out << " " << QStringList({ trUtf8("* Export: "), IGNORE_DUPLICATES, IGNORE_ERROR_CODES, "\n ", trUtf8("* Import: "), IMPORT_SYSTEM_OBJS, IMPORT_EXTENSION_OBJS, IGNORE_IMPORT_ERRORS, DEBUG_MODE }).join(" ") << endl; + out << " " << QStringList({ trUtf8("* Export: "), IgnoreDuplicates, IgnoreErrorCodes, "\n ", trUtf8("* Import: "), ImportSystemObjs, ImportExtensionObjs, IgnoreImportErrors, DebugMode }).join(" ") << endl; out << endl; - out << trUtf8("** When running the diff using two databases (%1 and %2) there's the need to specify two connections/aliases. ").arg(INPUT_DB).arg(COMPARE_TO) << endl; + out << trUtf8("** When running the diff using two databases (%1 and %2) there's the need to specify two connections/aliases. ").arg(InputDb).arg(CompareTo) << endl; out << trUtf8(" If only one connection is set it will be used to import the input database as well to retrieve database used in the comparison.") << endl; out << trUtf8(" A second connection can be specified by appending a 1 on any connection configuration parameter listed above.") << endl; out << endl; } -void PgModelerCLI::parseOptions(attribs_map &opts) +void PgModelerCli::parseOptions(attribs_map &opts) { //Loading connections - if(opts.count(LIST_CONNS) || opts.count(EXPORT_TO_DBMS) || opts.count(IMPORT_DB) || opts.count(DIFF)) + if(opts.count(ListConns) || opts.count(ExportToDbms) || opts.count(ImportDb) || opts.count(Diff)) { conn_conf.loadConfiguration(); conn_conf.getConnections(connections, false); } //Loading general and relationship settings when exporting to image formats - else if(opts.count(EXPORT_TO_PNG) || opts.count(EXPORT_TO_SVG)) + else if(opts.count(ExportToPng) || opts.count(ExportToSvg)) { general_conf.loadConfiguration(); rel_conf.loadConfiguration(); } - if(opts.empty() || opts.count(HELP)) + if(opts.empty() || opts.count(Help)) showMenu(); //Listing connections - else if(opts.count(LIST_CONNS)) + else if(opts.count(ListConns)) { map::iterator itr=connections.begin(); @@ -482,7 +482,7 @@ void PgModelerCLI::parseOptions(attribs_map &opts) while(itr != connections.end()) { out << QString("[") << id++ << QString("] ") << itr->first << QString(" : ") << - itr->second->getConnectionString().replace(PASSWORD_REGEXP, PASSWORD_PLACEHOLDER) << endl; + itr->second->getConnectionString().replace(PasswordRegExp, PasswordPlaceholder) << endl; itr++; } @@ -492,22 +492,22 @@ void PgModelerCLI::parseOptions(attribs_map &opts) else { int mode_cnt=0, other_modes_cnt=0; - bool fix_model=(opts.count(FIX_MODEL) > 0), upd_mime=(opts.count(DBM_MIME_TYPE) > 0), - import_db=(opts.count(IMPORT_DB) > 0), diff=(opts.count(DIFF) > 0); + bool fix_model=(opts.count(FixModel) > 0), upd_mime=(opts.count(DbmMimeType) > 0), + import_db=(opts.count(ImportDb) > 0), diff=(opts.count(Diff) > 0); //Checking if multiples export modes were specified - mode_cnt+=opts.count(EXPORT_TO_FILE); - mode_cnt+=opts.count(EXPORT_TO_PNG); - mode_cnt+=opts.count(EXPORT_TO_SVG); - mode_cnt+=opts.count(EXPORT_TO_DBMS); + mode_cnt+=opts.count(ExportToFile); + mode_cnt+=opts.count(ExportToPng); + mode_cnt+=opts.count(ExportToSvg); + mode_cnt+=opts.count(ExportToDbms); - other_modes_cnt+=opts.count(FIX_MODEL); - other_modes_cnt+=opts.count(IMPORT_DB); - other_modes_cnt+=opts.count(DIFF); - other_modes_cnt+=opts.count(DBM_MIME_TYPE); + other_modes_cnt+=opts.count(FixModel); + other_modes_cnt+=opts.count(ImportDb); + other_modes_cnt+=opts.count(Diff); + other_modes_cnt+=opts.count(DbmMimeType); - if(opts.count(ZOOM_FACTOR)) - zoom=opts[ZOOM_FACTOR].toDouble()/static_cast(100); + if(opts.count(ZoomFactor)) + zoom=opts[ZoomFactor].toDouble()/static_cast(100); if(other_modes_cnt==0 && mode_cnt==0) throw Exception(trUtf8("No operation mode was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -518,60 +518,60 @@ void PgModelerCLI::parseOptions(attribs_map &opts) if(!fix_model && !upd_mime && mode_cnt > 1) throw Exception(trUtf8("Multiple export mode was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!upd_mime && !import_db && !diff && opts[INPUT].isEmpty()) + if(!upd_mime && !import_db && !diff && opts[Input].isEmpty()) throw Exception(trUtf8("No input file was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(import_db && opts[INPUT_DB].isEmpty()) + if(import_db && opts[InputDb].isEmpty()) throw Exception(trUtf8("No input database was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!opts.count(EXPORT_TO_DBMS) && !upd_mime && !diff && opts[OUTPUT].isEmpty()) + if(!opts.count(ExportToDbms) && !upd_mime && !diff && opts[Output].isEmpty()) throw Exception(trUtf8("No output file was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!opts.count(EXPORT_TO_DBMS) && !upd_mime && !import_db && - !opts[INPUT].isEmpty() && !opts[OUTPUT].isEmpty() && - QFileInfo(opts[INPUT]).absoluteFilePath() == QFileInfo(opts[OUTPUT]).absoluteFilePath()) + if(!opts.count(ExportToDbms) && !upd_mime && !import_db && + !opts[Input].isEmpty() && !opts[Output].isEmpty() && + QFileInfo(opts[Input]).absoluteFilePath() == QFileInfo(opts[Output]).absoluteFilePath()) throw Exception(trUtf8("Input file must be different from output!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(opts.count(EXPORT_TO_DBMS) && !opts.count(CONN_ALIAS) && - (!opts.count(HOST) || !opts.count(USER) || !opts.count(PASSWD) || !opts.count(INITIAL_DB)) ) + if(opts.count(ExportToDbms) && !opts.count(ConnAlias) && + (!opts.count(Host) || !opts.count(User) || !opts.count(Passwd) || !opts.count(InitialDb)) ) throw Exception(trUtf8("Incomplete connection information!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(opts.count(EXPORT_TO_PNG) && (zoom < ModelWidget::MinimumZoom || zoom > ModelWidget::MaximumZoom)) + if(opts.count(ExportToPng) && (zoom < ModelWidget::MinimumZoom || zoom > ModelWidget::MaximumZoom)) throw Exception(trUtf8("Invalid zoom specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(upd_mime && opts[DBM_MIME_TYPE]!=INSTALL && opts[DBM_MIME_TYPE]!=UNINSTALL) + if(upd_mime && opts[DbmMimeType]!=Install && opts[DbmMimeType]!=Uninstall) throw Exception(trUtf8("Invalid action specified to update mime option!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(opts.count(DIFF)) + if(opts.count(Diff)) { - if(opts[INPUT].isEmpty() && opts[INPUT_DB].isEmpty()) + if(opts[Input].isEmpty() && opts[InputDb].isEmpty()) throw Exception(trUtf8("No input file or database was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!opts[INPUT].isEmpty() && !opts[INPUT_DB].isEmpty()) + if(!opts[Input].isEmpty() && !opts[InputDb].isEmpty()) throw Exception(trUtf8("The input file and database can't be used at the same time!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!opts.count(COMPARE_TO)) + if(!opts.count(CompareTo)) throw Exception(trUtf8("No database to be compared was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!opts.count(SAVE_DIFF) && !opts.count(APPLY_DIFF)) + if(!opts.count(SaveDiff) && !opts.count(ApplyDiff)) throw Exception(trUtf8("No diff action (save or apply) was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(opts.count(SAVE_DIFF) && opts[OUTPUT].isEmpty()) + if(opts.count(SaveDiff) && opts[Output].isEmpty()) throw Exception(trUtf8("No output file for the diff code was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Converting input and output files to absolute paths to avoid that they are read/written on the app's working dir - if(!opts[INPUT].isEmpty()) - opts[INPUT]=QFileInfo(opts[INPUT]).absoluteFilePath(); + if(!opts[Input].isEmpty()) + opts[Input]=QFileInfo(opts[Input]).absoluteFilePath(); - if(!opts[OUTPUT].isEmpty()) - opts[OUTPUT]=QFileInfo(opts[OUTPUT]).absoluteFilePath(); + if(!opts[Output].isEmpty()) + opts[Output]=QFileInfo(opts[Output]).absoluteFilePath(); parsed_opts=opts; } } -int PgModelerCLI::exec(void) +int PgModelerCli::exec(void) { try { @@ -579,13 +579,13 @@ int PgModelerCLI::exec(void) { printMessage(QString("\npgModeler %1 %2").arg(GlobalAttributes::PgModelerVersion).arg(trUtf8(" command line interface."))); - if(parsed_opts.count(FIX_MODEL)) + if(parsed_opts.count(FixModel)) fixModel(); - else if(parsed_opts.count(DBM_MIME_TYPE)) + else if(parsed_opts.count(DbmMimeType)) updateMimeType(); - else if(parsed_opts.count(IMPORT_DB)) + else if(parsed_opts.count(ImportDb)) importDatabase(); - else if(parsed_opts.count(DIFF)) + else if(parsed_opts.count(Diff)) diffModelDatabase(); else exportModel(); @@ -599,7 +599,7 @@ int PgModelerCLI::exec(void) } } -void PgModelerCLI::updateProgress(int progress, QString msg, ObjectType) +void PgModelerCli::updateProgress(int progress, QString msg, ObjectType) { if(progress > 0) out << QString("[%1%] ").arg(progress > 100 ? 100 : progress) << msg << endl; @@ -607,7 +607,7 @@ void PgModelerCLI::updateProgress(int progress, QString msg, ObjectType) out << msg << endl; } -void PgModelerCLI::printIgnoredError(QString err_cod, QString err_msg, QString cmd) +void PgModelerCli::printIgnoredError(QString err_cod, QString err_msg, QString cmd) { out << endl; out << trUtf8("** Error code `%1' found and ignored. Proceeding with export.").arg(err_cod) << endl; @@ -616,7 +616,7 @@ void PgModelerCLI::printIgnoredError(QString err_cod, QString err_msg, QString c out << endl; } -void PgModelerCLI::handleObjectAddition(BaseObject *object) +void PgModelerCli::handleObjectAddition(BaseObject *object) { BaseGraphicObject *graph_obj=dynamic_cast(object); @@ -657,7 +657,7 @@ void PgModelerCLI::handleObjectAddition(BaseObject *object) } -void PgModelerCLI::handleObjectRemoval(BaseObject *object) +void PgModelerCli::handleObjectRemoval(BaseObject *object) { BaseGraphicObject *graph_obj=dynamic_cast(object); @@ -673,7 +673,7 @@ void PgModelerCLI::handleObjectRemoval(BaseObject *object) } -void PgModelerCLI::extractObjectXML(void) +void PgModelerCli::extractObjectXML(void) { QFile input; QString buf, lin, def_xml, end_tag; @@ -691,11 +691,11 @@ void PgModelerCLI::extractObjectXML(void) printMessage(trUtf8("Extracting objects' XML...")); - input.setFileName(parsed_opts[INPUT]); + input.setFileName(parsed_opts[Input]); input.open(QFile::ReadOnly); if(!input.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(parsed_opts[INPUT]), + throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(parsed_opts[Input]), FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf.append(input.readAll()); @@ -815,7 +815,7 @@ void PgModelerCLI::extractObjectXML(void) } } -void PgModelerCLI::recreateObjects(void) +void PgModelerCli::recreateObjects(void) { QStringList fail_objs, constr, list; QString xml_def, aux_def, start_tag="<%1", end_tag="", aux_tag; @@ -824,7 +824,7 @@ void PgModelerCLI::recreateObjects(void) vector types={ ObjIndex, ObjTrigger, ObjRule }; attribs_map attribs; bool use_fail_obj=false; - unsigned tries=0, max_tries=parsed_opts[FIX_TRIES].toUInt(); + unsigned tries=0, max_tries=parsed_opts[FixTries].toUInt(); int start_pos=-1, end_pos=-1, len=0; printMessage(trUtf8("Recreating objects...")); @@ -969,17 +969,17 @@ void PgModelerCLI::recreateObjects(void) } } -void PgModelerCLI::fixObjectAttributes(QString &obj_xml) +void PgModelerCli::fixObjectAttributes(QString &obj_xml) { //Placing objects , , outside of
- if(!obj_xml.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(ObjTablespace))) && - obj_xml.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(ObjTable)))) + if(!obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjTablespace))) && + obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjTable)))) { int start_idx=-1, end_idx=-1, len=0; ObjectType obj_types[3]={ ObjRule, ObjTrigger, ObjIndex }; QString curr_tag, curr_end_tag, def, tab_name, sch_name, name_attr=QString("name=\""), - sch_name_attr=TAG_EXPR.arg(BaseObject::getSchemaName(ObjSchema)) + QString(" ") + name_attr; + sch_name_attr=TagExpr.arg(BaseObject::getSchemaName(ObjSchema)) + QString(" ") + name_attr; //Extracting the table's name start_idx=obj_xml.indexOf(name_attr); @@ -996,8 +996,8 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) for(unsigned idx=0; idx < 3; idx++) { - curr_tag=TAG_EXPR.arg(BaseObject::getSchemaName(obj_types[idx])); - curr_end_tag=END_TAG_EXPR.arg(BaseObject::getSchemaName(obj_types[idx])) + QString(">"); + curr_tag=TagExpr.arg(BaseObject::getSchemaName(obj_types[idx])); + curr_end_tag=EndTagExpr.arg(BaseObject::getSchemaName(obj_types[idx])) + QString(">"); start_idx=obj_xml.indexOf(curr_tag); while(start_idx >=0) @@ -1008,7 +1008,7 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) obj_xml.remove(start_idx, len); //If the object is a rule include the table attribute - if(def.startsWith(TAG_EXPR.arg(BaseObject::getSchemaName(ObjRule)))) + if(def.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjRule)))) { start_idx=def.indexOf('>'); def.replace(start_idx, 1, QString(" ") + tab_name + QString(">")); @@ -1024,11 +1024,11 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) } //Remove recheck attribute from tags. - if(obj_xml.contains(TAG_EXPR.arg(ParsersAttributes::ELEMENT))) - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("recheck")))); + if(obj_xml.contains(TagExpr.arg(ParsersAttributes::ELEMENT))) + obj_xml.remove(QRegExp(AttributeExpr.arg(QString("recheck")))); //Remove values greater-op, less-op, sort-op or sort2-op from ref-type attribute from tags. - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjOperator)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjOperator)))) { obj_xml.remove(QString("greater-op")); obj_xml.remove(QString("less-op")); @@ -1037,57 +1037,57 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) } //Replacing attribute owner by onwer-col for sequences - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjSequence)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjSequence)))) obj_xml.replace(ParsersAttributes::OWNER, ParsersAttributes::OWNER_COLUMN); //Remove sysid attribute from tags. - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjRole)))) - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("sysid")))); + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjRole)))) + obj_xml.remove(QRegExp(AttributeExpr.arg(QString("sysid")))); //Replace tag by on tags. - if(obj_xml.contains(TAG_EXPR.arg(QString("usertype")))) + if(obj_xml.contains(TagExpr.arg(QString("usertype")))) { - obj_xml.replace(TAG_EXPR.arg(ParsersAttributes::PARAMETER), TAG_EXPR.arg(ParsersAttributes::TYPE_ATTRIBUTE)); - obj_xml.replace(END_TAG_EXPR.arg(ParsersAttributes::PARAMETER), END_TAG_EXPR.arg(ParsersAttributes::TYPE_ATTRIBUTE)); + obj_xml.replace(TagExpr.arg(ParsersAttributes::PARAMETER), TagExpr.arg(ParsersAttributes::TYPE_ATTRIBUTE)); + obj_xml.replace(EndTagExpr.arg(ParsersAttributes::PARAMETER), EndTagExpr.arg(ParsersAttributes::TYPE_ATTRIBUTE)); } - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjRelationship)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjRelationship)))) { //Remove auto-sufix, src-sufix, dst-sufix, col-indexes, constr-indexes, attrib-indexes from tags. - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("auto-sufix")))); - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("src-sufix")))); - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("dst-sufix")))); - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("col-indexes")))); - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("constr-indexes")))); - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(QString("attrib-indexes")))); + obj_xml.remove(QRegExp(AttributeExpr.arg(QString("auto-sufix")))); + obj_xml.remove(QRegExp(AttributeExpr.arg(QString("src-sufix")))); + obj_xml.remove(QRegExp(AttributeExpr.arg(QString("dst-sufix")))); + obj_xml.remove(QRegExp(AttributeExpr.arg(QString("col-indexes")))); + obj_xml.remove(QRegExp(AttributeExpr.arg(QString("constr-indexes")))); + obj_xml.remove(QRegExp(AttributeExpr.arg(QString("attrib-indexes")))); obj_xml.replace(QString("line-color"), ParsersAttributes::CUSTOM_COLOR); } //Renaming the tag to on indexes - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjIndex)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjIndex)))) { - obj_xml.replace(TAG_EXPR.arg(ParsersAttributes::CONDITION), TAG_EXPR.arg(ParsersAttributes::PREDICATE)); - obj_xml.replace(END_TAG_EXPR.arg(ParsersAttributes::CONDITION), END_TAG_EXPR.arg(ParsersAttributes::PREDICATE)); + obj_xml.replace(TagExpr.arg(ParsersAttributes::CONDITION), TagExpr.arg(ParsersAttributes::PREDICATE)); + obj_xml.replace(EndTagExpr.arg(ParsersAttributes::CONDITION), EndTagExpr.arg(ParsersAttributes::PREDICATE)); } //Renaming the attribute default to default-value on domain - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjDomain)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjDomain)))) obj_xml.replace(ParsersAttributes::DEFAULT, ParsersAttributes::DEFAULT_VALUE); //Renaming the tag to - if(obj_xml.contains(TAG_EXPR.arg(QString("grant")))) + if(obj_xml.contains(TagExpr.arg(QString("grant")))) { - obj_xml.replace(TAG_EXPR.arg(QString("grant")), TAG_EXPR.arg(BaseObject::getSchemaName(ObjPermission))); - obj_xml.replace(END_TAG_EXPR.arg(QString("grant")), END_TAG_EXPR.arg(BaseObject::getSchemaName(ObjPermission))); + obj_xml.replace(TagExpr.arg(QString("grant")), TagExpr.arg(BaseObject::getSchemaName(ObjPermission))); + obj_xml.replace(EndTagExpr.arg(QString("grant")), EndTagExpr.arg(BaseObject::getSchemaName(ObjPermission))); } //Replace the constraint attribute and tag expression by constraint tag in . - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjDomain))) && - obj_xml.contains(TAG_EXPR.arg(ParsersAttributes::EXPRESSION))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjDomain))) && + obj_xml.contains(TagExpr.arg(ParsersAttributes::EXPRESSION))) { int start_idx=-1, end_idx=-1; - QRegExp regexp = QRegExp(ATTRIBUTE_EXPR.arg(ParsersAttributes::CONSTRAINT)); + QRegExp regexp = QRegExp(AttributeExpr.arg(ParsersAttributes::CONSTRAINT)); QString constr_name; regexp.indexIn(obj_xml); @@ -1095,44 +1095,44 @@ void PgModelerCLI::fixObjectAttributes(QString &obj_xml) constr_name.remove(QString("%1=\"").arg(ParsersAttributes::CONSTRAINT)); constr_name.remove(constr_name.length() - 1, 1); - obj_xml.remove(QRegExp(ATTRIBUTE_EXPR.arg(ParsersAttributes::CONSTRAINT))); + obj_xml.remove(QRegExp(AttributeExpr.arg(ParsersAttributes::CONSTRAINT))); - start_idx = obj_xml.indexOf(TAG_EXPR.arg(ParsersAttributes::EXPRESSION)); + start_idx = obj_xml.indexOf(TagExpr.arg(ParsersAttributes::EXPRESSION)); obj_xml.insert(start_idx, QString("\n\t\n\t\t").arg(constr_name)); - end_idx = obj_xml.indexOf(END_TAG_EXPR.arg(ParsersAttributes::EXPRESSION)); - obj_xml.insert(end_idx + END_TAG_EXPR.arg(ParsersAttributes::EXPRESSION).length() + 1, QString("\n\t\n")); + end_idx = obj_xml.indexOf(EndTagExpr.arg(ParsersAttributes::EXPRESSION)); + obj_xml.insert(end_idx + EndTagExpr.arg(ParsersAttributes::EXPRESSION).length() + 1, QString("\n\t\n")); } //Fix the references to op. classes and families if needed fixOpClassesFamiliesReferences(obj_xml); } -void PgModelerCLI::fixOpClassesFamiliesReferences(QString &obj_xml) +void PgModelerCli::fixOpClassesFamiliesReferences(QString &obj_xml) { ObjectType ref_obj_type; - if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjIndex))) || + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjIndex))) || obj_xml.contains(QRegExp(QString("(%1)(.)+(type=)(\")(%2)(\")") - .arg(TAG_EXPR.arg(BaseObject::getSchemaName(ObjConstraint))) + .arg(TagExpr.arg(BaseObject::getSchemaName(ObjConstraint))) .arg(ParsersAttributes::EX_CONSTR)))) ref_obj_type=ObjOpClass; - else if(obj_xml.contains(TAG_EXPR.arg(BaseObject::getSchemaName(ObjOpClass)))) + else if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjOpClass)))) ref_obj_type=ObjOpFamily; else return; QString ref_obj_name=BaseObject::getSchemaName(ref_obj_type); - if(!obj_xml.contains(TAG_EXPR.arg(ref_obj_name))) + if(!obj_xml.contains(TagExpr.arg(ref_obj_name))) return; QString obj_name, aux_obj_name, signature=QString("%1 USING %2"); - QRegExp sign_regexp=QRegExp(ATTRIBUTE_EXPR.arg(QString("signature"))); + QRegExp sign_regexp=QRegExp(AttributeExpr.arg(QString("signature"))); QStringList index_types; int pos=0; - obj_xml.replace(TAG_EXPR.arg(ref_obj_name) + QString(" name="), - TAG_EXPR.arg(ref_obj_name) + QString(" signature=")); + obj_xml.replace(TagExpr.arg(ref_obj_name) + QString(" name="), + TagExpr.arg(ref_obj_name) + QString(" signature=")); IndexingType::getTypes(index_types); @@ -1172,77 +1172,77 @@ void PgModelerCLI::fixOpClassesFamiliesReferences(QString &obj_xml) while(pos >= 0); } -void PgModelerCLI::fixModel(void) +void PgModelerCli::fixModel(void) { printMessage(trUtf8("Starting model fixing...")); - printMessage(trUtf8("Loading input file: %1").arg(parsed_opts[INPUT])); - printMessage(trUtf8("Fixed model file: %1").arg(parsed_opts[OUTPUT])); + printMessage(trUtf8("Loading input file: %1").arg(parsed_opts[Input])); + printMessage(trUtf8("Fixed model file: %1").arg(parsed_opts[Output])); extractObjectXML(); recreateObjects(); model->updateTablesFKRelationships(); - model->saveModel(parsed_opts[OUTPUT], SchemaParser::XmlDefinition); + model->saveModel(parsed_opts[Output], SchemaParser::XmlDefinition); printMessage(trUtf8("Model successfully fixed!")); } -void PgModelerCLI::exportModel(void) +void PgModelerCli::exportModel(void) { printMessage(trUtf8("Starting model export...")); - printMessage(trUtf8("Loading input file: %1").arg(parsed_opts[INPUT])); + printMessage(trUtf8("Loading input file: %1").arg(parsed_opts[Input])); //Create the systems objects on model before loading it model->createSystemObjects(false); //Load the model file - model->loadModel(parsed_opts[INPUT]); + model->loadModel(parsed_opts[Input]); //Export to PNG - if(parsed_opts.count(EXPORT_TO_PNG)) + if(parsed_opts.count(ExportToPng)) { - printMessage(trUtf8("Export to PNG image: %1").arg(parsed_opts[OUTPUT])); + printMessage(trUtf8("Export to PNG image: %1").arg(parsed_opts[Output])); - export_hlp.exportToPNG(scene, parsed_opts[OUTPUT], zoom, - parsed_opts.count(SHOW_GRID) > 0, - parsed_opts.count(SHOW_DELIMITERS) > 0, - parsed_opts.count(PAGE_BY_PAGE) > 0); + export_hlp.exportToPNG(scene, parsed_opts[Output], zoom, + parsed_opts.count(ShowGrid) > 0, + parsed_opts.count(ShowDelimiters) > 0, + parsed_opts.count(PageByPage) > 0); } //Export to SVG - else if(parsed_opts.count(EXPORT_TO_SVG)) + else if(parsed_opts.count(ExportToSvg)) { - printMessage(trUtf8("Export to SVG file: %1").arg(parsed_opts[OUTPUT])); + printMessage(trUtf8("Export to SVG file: %1").arg(parsed_opts[Output])); - export_hlp.exportToSVG(scene, parsed_opts[OUTPUT], - parsed_opts.count(SHOW_GRID) > 0, - parsed_opts.count(SHOW_DELIMITERS) > 0); + export_hlp.exportToSVG(scene, parsed_opts[Output], + parsed_opts.count(ShowGrid) > 0, + parsed_opts.count(ShowDelimiters) > 0); } //Export to SQL file - else if(parsed_opts.count(EXPORT_TO_FILE)) + else if(parsed_opts.count(ExportToFile)) { - printMessage(trUtf8("Export to SQL script file: %1").arg(parsed_opts[OUTPUT])); + printMessage(trUtf8("Export to SQL script file: %1").arg(parsed_opts[Output])); - export_hlp.exportToSQL(model, parsed_opts[OUTPUT], parsed_opts[PGSQL_VER]); + export_hlp.exportToSQL(model, parsed_opts[Output], parsed_opts[PgSqlVer]); } //Export to DBMS else { - printMessage(trUtf8("Export to DBMS: %1").arg(connection.getConnectionString().replace(PASSWORD_REGEXP, PASSWORD_PLACEHOLDER))); + printMessage(trUtf8("Export to DBMS: %1").arg(connection.getConnectionString().replace(PasswordRegExp, PasswordPlaceholder))); - if(parsed_opts.count(IGNORE_ERROR_CODES)) - export_hlp.setIgnoredErrors(parsed_opts[IGNORE_ERROR_CODES].split(',')); + if(parsed_opts.count(IgnoreErrorCodes)) + export_hlp.setIgnoredErrors(parsed_opts[IgnoreErrorCodes].split(',')); - export_hlp.exportToDBMS(model, connection, parsed_opts[PGSQL_VER], - parsed_opts.count(IGNORE_DUPLICATES) > 0, - parsed_opts.count(DROP_DATABASE) > 0, - parsed_opts.count(DROP_OBJECTS) > 0, - parsed_opts.count(SIMULATE) > 0, - parsed_opts.count(USE_TMP_NAMES) > 0); + export_hlp.exportToDBMS(model, connection, parsed_opts[PgSqlVer], + parsed_opts.count(IgnoreDuplicates) > 0, + parsed_opts.count(DropDatabase) > 0, + parsed_opts.count(DropObjects) > 0, + parsed_opts.count(Simulate) > 0, + parsed_opts.count(UseTmpNames) > 0); } printMessage(trUtf8("Export successfully ended!\n")); } -void PgModelerCLI::importDatabase(void) +void PgModelerCli::importDatabase(void) { printMessage(trUtf8("Starting database import...")); printMessage(trUtf8("Input database: %1").arg(connection.getConnectionId(true, true))); @@ -1254,14 +1254,14 @@ void PgModelerCLI::importDatabase(void) printMessage(trUtf8("Saving the imported database to file...")); - model_wgt->getDatabaseModel()->saveModel(parsed_opts[OUTPUT], SchemaParser::XmlDefinition); + model_wgt->getDatabaseModel()->saveModel(parsed_opts[Output], SchemaParser::XmlDefinition); printMessage(trUtf8("Import successfully ended!\n")); delete(model_wgt); } -void PgModelerCLI::importDatabase(DatabaseModel *model, Connection conn) +void PgModelerCli::importDatabase(DatabaseModel *model, Connection conn) { try { @@ -1284,12 +1284,12 @@ void PgModelerCLI::importDatabase(DatabaseModel *model, Connection conn) catalog.closeConnection(); import_hlp.setConnection(conn); - import_hlp.setImportOptions(parsed_opts.count(IMPORT_SYSTEM_OBJS) > 0, - parsed_opts.count(IMPORT_EXTENSION_OBJS) > 0, + import_hlp.setImportOptions(parsed_opts.count(ImportSystemObjs) > 0, + parsed_opts.count(ImportExtensionObjs) > 0, true, - parsed_opts.count(IGNORE_IMPORT_ERRORS) > 0, - parsed_opts.count(DEBUG_MODE) > 0, - !parsed_opts.count(DIFF), !parsed_opts.count(DIFF)); + parsed_opts.count(IgnoreImportErrors) > 0, + parsed_opts.count(DebugMode) > 0, + !parsed_opts.count(Diff), !parsed_opts.count(Diff)); model->createSystemObjects(true); import_hlp.setSelectedOIDs(model, obj_oids, col_oids); @@ -1302,26 +1302,26 @@ void PgModelerCLI::importDatabase(DatabaseModel *model, Connection conn) } } -void PgModelerCLI::diffModelDatabase(void) +void PgModelerCli::diffModelDatabase(void) { DatabaseModel *model_aux = new DatabaseModel(); QString dbname; printMessage(trUtf8("Starting diff process...")); - if(!parsed_opts[INPUT].isEmpty()) - printMessage(trUtf8("Input model: %1").arg(parsed_opts[INPUT])); + if(!parsed_opts[Input].isEmpty()) + printMessage(trUtf8("Input model: %1").arg(parsed_opts[Input])); else printMessage(trUtf8("Input database: %1").arg(connection.getConnectionId(true, true))); dbname = extra_connection.getConnectionId(true, true); printMessage(trUtf8("Compare to: %1").arg(dbname)); - if(!parsed_opts[INPUT].isEmpty()) + if(!parsed_opts[Input].isEmpty()) { printMessage(trUtf8("Loading input model...")); model->createSystemObjects(false); - model->loadModel(parsed_opts[INPUT]); + model->loadModel(parsed_opts[Input]); } else { @@ -1333,19 +1333,19 @@ void PgModelerCLI::diffModelDatabase(void) importDatabase(model_aux, extra_connection); diff_hlp.setModels(model, model_aux); - diff_hlp.setDiffOption(ModelsDiffHelper::OptKeepClusterObjs, !parsed_opts.count(DROP_CLUSTER_OBJS)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptCascadeMode, !parsed_opts.count(NO_CASCADE_DROP_TRUNC)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptTruncateTables, parsed_opts.count(TRUNC_ON_COLS_TYPE_CHANGE)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptForceRecreation, !parsed_opts.count(NO_FORCE_OBJ_RECREATION)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptRecreateUnchangeble, !parsed_opts.count(NO_UNMOD_OBJ_RECREATION)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptKeepObjectPerms, !parsed_opts.count(REVOKE_PERMISSIONS)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptReuseSequences, !parsed_opts.count(NO_SEQUENCE_REUSE)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptPreserveDbName, !parsed_opts.count(RENAME_DB)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptDontDropMissingObjs, !parsed_opts.count(DROP_MISSING_OBJS)); - diff_hlp.setDiffOption(ModelsDiffHelper::OptDropMissingColsConstr, !parsed_opts.count(FORCE_DROP_COLS_CONSTRS)); - - if(!parsed_opts[PGSQL_VER].isEmpty()) - diff_hlp.setPgSQLVersion(parsed_opts[PGSQL_VER]); + diff_hlp.setDiffOption(ModelsDiffHelper::OptKeepClusterObjs, !parsed_opts.count(DropClusterObjs)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptCascadeMode, !parsed_opts.count(NoCascadeDropTrunc)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptTruncateTables, parsed_opts.count(TruncOnColsTypeChange)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptForceRecreation, !parsed_opts.count(NoForceObjRecreation)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptRecreateUnchangeble, !parsed_opts.count(NoUnmodObjRecreation)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptKeepObjectPerms, !parsed_opts.count(RevokePermissions)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptReuseSequences, !parsed_opts.count(NoSequenceReuse)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptPreserveDbName, !parsed_opts.count(RenameDb)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptDontDropMissingObjs, !parsed_opts.count(DropMissingObjs)); + diff_hlp.setDiffOption(ModelsDiffHelper::OptDropMissingColsConstr, !parsed_opts.count(ForceDropColsConstrs)); + + if(!parsed_opts[PgSqlVer].isEmpty()) + diff_hlp.setPgSQLVersion(parsed_opts[PgSqlVer]); else { extra_connection.connect(); @@ -1360,15 +1360,15 @@ void PgModelerCLI::diffModelDatabase(void) printMessage(trUtf8("No differences were detected.")); else { - if(parsed_opts.count(SAVE_DIFF)) + if(parsed_opts.count(SaveDiff)) { QFile output; - printMessage(trUtf8("Saving diff to file `%1'").arg(parsed_opts[OUTPUT])); - output.setFileName(parsed_opts[OUTPUT]); + printMessage(trUtf8("Saving diff to file `%1'").arg(parsed_opts[Output])); + output.setFileName(parsed_opts[Output]); if(!output.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(parsed_opts[OUTPUT]), + throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(parsed_opts[Output]), FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__); output.write(diff_hlp.getDiffDefinition().toUtf8()); output.close(); @@ -1377,7 +1377,7 @@ void PgModelerCLI::diffModelDatabase(void) { bool apply_diff = true; - if(!parsed_opts.count(NO_DIFF_PREVIEW)) + if(!parsed_opts.count(NoDiffPreview)) { QString res, buff, line; QTextStream in(stdin), preview; @@ -1430,10 +1430,10 @@ void PgModelerCLI::diffModelDatabase(void) printMessage(trUtf8("Applying diff to the database `%1'...").arg(dbname)); export_hlp.setExportToDBMSParams(diff_hlp.getDiffDefinition(), &extra_connection, - parsed_opts[COMPARE_TO], parsed_opts.count(IGNORE_DUPLICATES)); + parsed_opts[CompareTo], parsed_opts.count(IgnoreDuplicates)); - if(parsed_opts.count(IGNORE_ERROR_CODES)) - export_hlp.setIgnoredErrors(parsed_opts[IGNORE_ERROR_CODES].split(',')); + if(parsed_opts.count(IgnoreErrorCodes)) + export_hlp.setIgnoredErrors(parsed_opts[IgnoreErrorCodes].split(',')); export_hlp.exportToDBMS(); } @@ -1443,18 +1443,18 @@ void PgModelerCLI::diffModelDatabase(void) printMessage(trUtf8("Diff successfully ended!\n")); } -void PgModelerCLI::updateMimeType(void) +void PgModelerCli::updateMimeType(void) { #ifndef Q_OS_MAC printMessage(trUtf8("Starting mime update...")); - handleMimeDatabase(parsed_opts[DBM_MIME_TYPE]==UNINSTALL); + handleMimeDatabase(parsed_opts[DbmMimeType]==Uninstall); printMessage(trUtf8("Mime database successfully updated!\n")); #endif } -QStringList PgModelerCLI::extractForeignKeys(QString &obj_xml) +QStringList PgModelerCli::extractForeignKeys(QString &obj_xml) { QStringList constr_lst; int start=0, end=0, pos=0, count=0; @@ -1489,7 +1489,7 @@ QStringList PgModelerCLI::extractForeignKeys(QString &obj_xml) return(constr_lst); } -bool PgModelerCLI::containsRelAttributes(const QString &str) +bool PgModelerCli::containsRelAttributes(const QString &str) { bool found=false; static vector attribs={ ParsersAttributes::RELATIONSHIP, @@ -1509,7 +1509,7 @@ bool PgModelerCLI::containsRelAttributes(const QString &str) return(found); } -void PgModelerCLI::handleMimeDatabase(bool uninstall) +void PgModelerCli::handleMimeDatabase(bool uninstall) { SchemaParser schparser; QString msg_file_associated=trUtf8("Database model files (.dbm) are already associated to pgModeler!"), diff --git a/main-cli/src/pgmodelercli.h b/main-cli/src/pgmodelercli.h index ab84d2e495..4fa3065d48 100644 --- a/main-cli/src/pgmodelercli.h +++ b/main-cli/src/pgmodelercli.h @@ -18,7 +18,7 @@ /** \ingroup pgmodeler-cli -\class PgModelerCLI +\class PgModelerCli \brief Implements the operations export models whitout use the graphical interface */ @@ -39,7 +39,7 @@ #include "databaseimporthelper.h" #include "modelsdiffhelper.h" -class PgModelerCLI: public QApplication { +class PgModelerCli: public QApplication { private: Q_OBJECT @@ -98,69 +98,69 @@ class PgModelerCLI: public QApplication { //! \brief Zoom to be applied onto the png export double zoom; - static const QRegExp PASSWORD_REGEXP; + static const QRegExp PasswordRegExp; - static const QString PASSWORD_PLACEHOLDER; + static const QString PasswordPlaceholder; //! \brief Option names constants - static const QString INPUT, - OUTPUT, - INPUT_DB, - EXPORT_TO_FILE, - EXPORT_TO_PNG, - EXPORT_TO_SVG, - EXPORT_TO_DBMS, - IMPORT_DB, - DIFF, - DROP_DATABASE, - DROP_OBJECTS, - PGSQL_VER, - HELP, - SHOW_GRID, - SHOW_DELIMITERS, - PAGE_BY_PAGE, - IGNORE_DUPLICATES, - IGNORE_ERROR_CODES, - CONN_ALIAS, - HOST, - PORT, - USER, - PASSWD, - INITIAL_DB, - SILENT, - LIST_CONNS, - SIMULATE, - FIX_MODEL, - FIX_TRIES, - ZOOM_FACTOR, - USE_TMP_NAMES, - DBM_MIME_TYPE, - INSTALL, - UNINSTALL, - - IGNORE_IMPORT_ERRORS, - IMPORT_SYSTEM_OBJS, - IMPORT_EXTENSION_OBJS, - DEBUG_MODE, - - COMPARE_TO, - SAVE_DIFF, - APPLY_DIFF, - NO_DIFF_PREVIEW, - DROP_CLUSTER_OBJS, - REVOKE_PERMISSIONS, - DROP_MISSING_OBJS, - FORCE_DROP_COLS_CONSTRS, - RENAME_DB, - TRUNC_ON_COLS_TYPE_CHANGE, - NO_SEQUENCE_REUSE, - NO_CASCADE_DROP_TRUNC, - NO_FORCE_OBJ_RECREATION, - NO_UNMOD_OBJ_RECREATION, - - TAG_EXPR, - END_TAG_EXPR, - ATTRIBUTE_EXPR; + static const QString Input, + Output, + InputDb, + ExportToFile, + ExportToPng, + ExportToSvg, + ExportToDbms, + ImportDb, + Diff, + DropDatabase, + DropObjects, + PgSqlVer, + Help, + ShowGrid, + ShowDelimiters, + PageByPage, + IgnoreDuplicates, + IgnoreErrorCodes, + ConnAlias, + Host, + Port, + User, + Passwd, + InitialDb, + Silent, + ListConns, + Simulate, + FixModel, + FixTries, + ZoomFactor, + UseTmpNames, + DbmMimeType, + Install, + Uninstall, + + IgnoreImportErrors, + ImportSystemObjs, + ImportExtensionObjs, + DebugMode, + + CompareTo, + SaveDiff, + ApplyDiff, + NoDiffPreview, + DropClusterObjs, + RevokePermissions, + DropMissingObjs, + ForceDropColsConstrs, + RenameDb, + TruncOnColsTypeChange, + NoSequenceReuse, + NoCascadeDropTrunc, + NoForceObjRecreation, + NoUnmodObjRecreation, + + TagExpr, + EndTagExpr, + AttributeExpr; //! \brief Parsers the options and executes the action specified by them void parseOptions(attribs_map &parsed_opts); @@ -212,8 +212,8 @@ class PgModelerCLI: public QApplication { void printMessage(const QString &msg); public: - PgModelerCLI(int argc, char **argv); - ~PgModelerCLI(void); + PgModelerCli(int argc, char **argv); + ~PgModelerCli(void); int exec(void); private slots: From 26c518d425e2faa991968ebbf1e369be0f2fbf2b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 11:32:42 -0300 Subject: [PATCH 172/425] ObjectType is now a scoped enum --- libobjrenderer/src/baseobjectview.cpp | 2 +- libobjrenderer/src/graphicalview.cpp | 12 +- libobjrenderer/src/objectsscene.cpp | 32 +- libobjrenderer/src/relationshipview.cpp | 2 +- libobjrenderer/src/schemaview.cpp | 4 +- libobjrenderer/src/tableobjectview.cpp | 8 +- libobjrenderer/src/tabletitleview.cpp | 8 +- libobjrenderer/src/tableview.cpp | 24 +- libobjrenderer/src/textboxview.cpp | 4 +- libpgconnector/src/catalog.cpp | 70 +- libpgmodeler/src/aggregate.cpp | 4 +- libpgmodeler/src/basegraphicobject.cpp | 4 +- libpgmodeler/src/baseobject.cpp | 168 +-- libpgmodeler/src/baseobject.h | 4 +- libpgmodeler/src/baserelationship.cpp | 8 +- libpgmodeler/src/basetable.cpp | 2 +- libpgmodeler/src/cast.cpp | 12 +- libpgmodeler/src/collation.cpp | 2 +- libpgmodeler/src/column.cpp | 8 +- libpgmodeler/src/constraint.cpp | 4 +- libpgmodeler/src/conversion.cpp | 12 +- libpgmodeler/src/databasemodel.cpp | 1116 ++++++++--------- libpgmodeler/src/databasemodel.h | 2 +- libpgmodeler/src/domain.cpp | 4 +- libpgmodeler/src/eventtrigger.cpp | 6 +- libpgmodeler/src/extension.cpp | 2 +- libpgmodeler/src/function.cpp | 4 +- libpgmodeler/src/genericsql.cpp | 2 +- libpgmodeler/src/index.cpp | 2 +- libpgmodeler/src/language.cpp | 6 +- libpgmodeler/src/operationlist.cpp | 88 +- libpgmodeler/src/operator.cpp | 8 +- libpgmodeler/src/operatorclass.cpp | 2 +- libpgmodeler/src/operatorfamily.cpp | 2 +- libpgmodeler/src/parameter.cpp | 2 +- libpgmodeler/src/permission.cpp | 36 +- libpgmodeler/src/pgmodelerns.cpp | 60 +- libpgmodeler/src/pgmodelerns.h | 10 +- libpgmodeler/src/policy.cpp | 6 +- libpgmodeler/src/relationship.cpp | 62 +- libpgmodeler/src/role.cpp | 2 +- libpgmodeler/src/rule.cpp | 2 +- libpgmodeler/src/schema.cpp | 4 +- libpgmodeler/src/sequence.cpp | 2 +- libpgmodeler/src/table.cpp | 172 +-- libpgmodeler/src/table.h | 2 +- libpgmodeler/src/tableobject.cpp | 4 +- libpgmodeler/src/tablespace.cpp | 4 +- libpgmodeler/src/tag.cpp | 2 +- libpgmodeler/src/textbox.cpp | 2 +- libpgmodeler/src/trigger.cpp | 16 +- libpgmodeler/src/type.cpp | 8 +- libpgmodeler/src/typeattribute.cpp | 2 +- libpgmodeler/src/view.cpp | 30 +- libpgmodeler_ui/src/aggregatewidget.cpp | 10 +- .../src/appearanceconfigwidget.cpp | 36 +- libpgmodeler_ui/src/baseform.cpp | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 80 +- libpgmodeler_ui/src/baseobjectwidget.h | 6 +- libpgmodeler_ui/src/castwidget.cpp | 6 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 24 +- libpgmodeler_ui/src/collationwidget.cpp | 4 +- libpgmodeler_ui/src/columnwidget.cpp | 8 +- libpgmodeler_ui/src/constraintwidget.cpp | 8 +- libpgmodeler_ui/src/conversionwidget.cpp | 6 +- libpgmodeler_ui/src/customsqlwidget.cpp | 14 +- .../src/databaseexplorerwidget.cpp | 266 ++-- libpgmodeler_ui/src/databaseimportform.cpp | 44 +- libpgmodeler_ui/src/databaseimportform.h | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 348 ++--- libpgmodeler_ui/src/databaseimporthelper.h | 2 +- libpgmodeler_ui/src/databasewidget.cpp | 28 +- libpgmodeler_ui/src/datamanipulationform.cpp | 56 +- libpgmodeler_ui/src/domainwidget.cpp | 4 +- libpgmodeler_ui/src/elementwidget.cpp | 22 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 6 +- libpgmodeler_ui/src/extensionwidget.cpp | 4 +- libpgmodeler_ui/src/functionwidget.cpp | 24 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 4 +- libpgmodeler_ui/src/indexwidget.cpp | 4 +- libpgmodeler_ui/src/languagewidget.cpp | 10 +- libpgmodeler_ui/src/mainwindow.cpp | 6 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 2 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 8 +- libpgmodeler_ui/src/modelexportform.cpp | 2 +- libpgmodeler_ui/src/modelexporthelper.cpp | 76 +- libpgmodeler_ui/src/modelexporthelper.h | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 104 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 66 +- libpgmodeler_ui/src/modelsdiffhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 38 +- libpgmodeler_ui/src/modelvalidationhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationwidget.cpp | 4 +- libpgmodeler_ui/src/modelwidget.cpp | 426 +++---- .../src/newobjectoverlaywidget.cpp | 88 +- libpgmodeler_ui/src/objectdepsrefswidget.cpp | 4 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 12 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 16 +- libpgmodeler_ui/src/objectsdiffinfo.cpp | 6 +- libpgmodeler_ui/src/objectselectorwidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 2 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 14 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 4 +- libpgmodeler_ui/src/operatorwidget.cpp | 8 +- libpgmodeler_ui/src/parameterwidget.cpp | 4 +- libpgmodeler_ui/src/permissionwidget.cpp | 10 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 10 +- libpgmodeler_ui/src/policywidget.cpp | 8 +- libpgmodeler_ui/src/referencewidget.cpp | 2 +- libpgmodeler_ui/src/relationshipwidget.cpp | 76 +- libpgmodeler_ui/src/resultsetmodel.cpp | 2 +- libpgmodeler_ui/src/rolewidget.cpp | 6 +- libpgmodeler_ui/src/rulewidget.cpp | 4 +- libpgmodeler_ui/src/schemawidget.cpp | 4 +- libpgmodeler_ui/src/sequencewidget.cpp | 6 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 12 +- libpgmodeler_ui/src/snippetsconfigwidget.h | 2 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 20 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 12 +- libpgmodeler_ui/src/tabledatawidget.cpp | 10 +- libpgmodeler_ui/src/tablespacewidget.cpp | 4 +- libpgmodeler_ui/src/tablewidget.cpp | 190 +-- libpgmodeler_ui/src/tagwidget.cpp | 4 +- libpgmodeler_ui/src/textboxwidget.cpp | 4 +- libpgmodeler_ui/src/triggerwidget.cpp | 16 +- libpgmodeler_ui/src/typewidget.cpp | 12 +- libpgmodeler_ui/src/viewwidget.cpp | 72 +- main-cli/src/pgmodelercli.cpp | 78 +- main-cli/src/pgmodelercli.h | 2 +- plugins/xml2object/src/xml2objectwidget.cpp | 2 +- 131 files changed, 2281 insertions(+), 2281 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 32b8195626..787176d6f3 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -161,7 +161,7 @@ void BaseObjectView::setSourceObject(BaseObject *object) this->addToGroup(pos_info_txt); } - if(!sql_disabled_box && object->getObjectType()!=ObjTextbox) + if(!sql_disabled_box && object->getObjectType()!=ObjectType::ObjTextbox) { sql_disabled_txt=new QGraphicsSimpleTextItem; sql_disabled_box=new QGraphicsRectItem; diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 7d01a66583..f13bc61fc8 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -97,14 +97,14 @@ void GraphicalView::configureObject(void) i--; } - tab_objs.assign(view->getObjectList(ObjRule)->begin(), - view->getObjectList(ObjRule)->end()); + tab_objs.assign(view->getObjectList(ObjectType::ObjRule)->begin(), + view->getObjectList(ObjectType::ObjRule)->end()); tab_objs.insert(tab_objs.end(), - view->getObjectList(ObjTrigger)->begin(), - view->getObjectList(ObjTrigger)->end()); + view->getObjectList(ObjectType::ObjTrigger)->begin(), + view->getObjectList(ObjectType::ObjTrigger)->end()); tab_objs.insert(tab_objs.end(), - view->getObjectList(ObjIndex)->begin(), - view->getObjectList(ObjIndex)->end()); + view->getObjectList(ObjectType::ObjIndex)->begin(), + view->getObjectList(ObjectType::ObjIndex)->end()); ext_attribs->setVisible(!tab_objs.empty() && !hide_ext_attribs); ext_attribs_body->setVisible(!tab_objs.empty() && !hide_ext_attribs); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 960cc05920..2d6fc54d95 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -71,8 +71,8 @@ ObjectsScene::~ObjectsScene(void) { QGraphicsItemGroup *item=nullptr; QList items; - ObjectType obj_types[]={ ObjRelationship, ObjTextbox, - ObjView, ObjTable, ObjSchema }; + ObjectType obj_types[]={ ObjectType::ObjRelationship, ObjectType::ObjTextbox, + ObjectType::ObjView, ObjectType::ObjTable, ObjectType::ObjSchema }; unsigned i, count=sizeof(obj_types)/sizeof(ObjectType); this->removeItem(selection_rect); @@ -95,12 +95,12 @@ ObjectsScene::~ObjectsScene(void) /* Case the object is converted to a item group and can be converted to database objects, indicates that the object can be removed from the scene */ if(item && !item->parentItem() && - ((dynamic_cast(item) && obj_types[i]==ObjRelationship) || - (dynamic_cast(item) && obj_types[i]==ObjTextbox) || - (dynamic_cast(item) && obj_types[i]==ObjTextbox) || - (dynamic_cast(item) && obj_types[i]==ObjView) || - (dynamic_cast(item) && obj_types[i]==ObjTable) || - (dynamic_cast(item) && obj_types[i]==ObjSchema))) + ((dynamic_cast(item) && obj_types[i]==ObjectType::ObjRelationship) || + (dynamic_cast(item) && obj_types[i]==ObjectType::ObjTextbox) || + (dynamic_cast(item) && obj_types[i]==ObjectType::ObjTextbox) || + (dynamic_cast(item) && obj_types[i]==ObjectType::ObjView) || + (dynamic_cast(item) && obj_types[i]==ObjectType::ObjTable) || + (dynamic_cast(item) && obj_types[i]==ObjectType::ObjSchema))) { this->removeItem(item); @@ -173,8 +173,8 @@ QRectF ObjectsScene::itemsBoundingRect(bool seek_only_db_objs, bool selected_onl if(graph_obj) { - if(graph_obj->getObjectType()!=ObjRelationship && - graph_obj->getObjectType()!=ObjBaseRelationship) + if(graph_obj->getObjectType()!=ObjectType::ObjRelationship && + graph_obj->getObjectType()!=ObjectType::ObjBaseRelationship) pnt=graph_obj->getPosition(); else pnt=dynamic_cast(obj_view)->__boundingRect().topLeft(); @@ -187,8 +187,8 @@ QRectF ObjectsScene::itemsBoundingRect(bool seek_only_db_objs, bool selected_onl if(selected_only) { - if(graph_obj->getObjectType()!=ObjRelationship && - graph_obj->getObjectType()!=ObjBaseRelationship) + if(graph_obj->getObjectType()!=ObjectType::ObjRelationship && + graph_obj->getObjectType()!=ObjectType::ObjBaseRelationship) pnt = pnt + dynamic_cast(obj_view)->boundingRect().bottomRight(); else pnt = pnt + dynamic_cast(obj_view)->__boundingRect().bottomRight(); @@ -291,8 +291,8 @@ void ObjectsScene::showRelationshipLine(bool value, const QPointF &p_start) base_obj=dynamic_cast(object->getSourceObject()); if(!value && base_obj && - base_obj->getObjectType()!=ObjRelationship && - base_obj->getObjectType()!=ObjBaseRelationship && + base_obj->getObjectType()!=ObjectType::ObjRelationship && + base_obj->getObjectType()!=ObjectType::ObjBaseRelationship && !base_obj->isProtected()) flags=QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | @@ -907,8 +907,8 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) if(!schema->isProtected()) { //Get the table-table and table-view relationships - rels=dynamic_cast(schema->getDatabase())->getObjects(ObjRelationship, schema); - base_rels=dynamic_cast(schema->getDatabase())->getObjects(ObjBaseRelationship, schema); + rels=dynamic_cast(schema->getDatabase())->getObjects(ObjectType::ObjRelationship, schema); + base_rels=dynamic_cast(schema->getDatabase())->getObjects(ObjectType::ObjBaseRelationship, schema); rels.insert(rels.end(), base_rels.begin(), base_rels.end()); for(auto &rel : rels) diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 90f2031ea0..da8f9c6c93 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1226,7 +1226,7 @@ void RelationshipView::configureLine(void) for semantics purposes shows the type of this relationship as "Relationship" unlike "Link" */ if(rel_type==BaseRelationship::RelationshipFk) tool_tip=base_rel->getName(true) + - QString(" (") + BaseObject::getTypeName(ObjRelationship) + QString(")"); + QString(" (") + BaseObject::getTypeName(ObjectType::ObjRelationship) + QString(")"); else tool_tip=base_rel->getName(true) + QString(" (") + base_rel->getTypeName() + QString(")"); diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index faa9e94605..40fdd47fb5 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -77,8 +77,8 @@ void SchemaView::fetchChildren(void) vector objs, objs1; //Gets all tables and views that belongs to the schema - objs=model->getObjects(ObjTable, schema); - objs1=model->getObjects(ObjView, schema); + objs=model->getObjects(ObjectType::ObjTable, schema); + objs1=model->getObjects(ObjectType::ObjView, schema); objs.insert(objs.end(), objs1.begin(), objs1.end()); children.clear(); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index e135a04e6c..28e729446a 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -54,7 +54,7 @@ TableObjectView::~TableObjectView(void) void TableObjectView::configureDescriptor(ConstraintType constr_type) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; Column *column=dynamic_cast(this->getSourceObject()); bool ellipse_desc=false; double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); @@ -150,7 +150,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setPen(pen); } } - else if(obj_type != ObjBaseObject) + else if(obj_type != ObjectType::ObjBaseObject) { TableObject *tab_obj=dynamic_cast(this->getSourceObject()); QGraphicsPolygonItem *desc=dynamic_cast(descriptor); @@ -556,8 +556,8 @@ QString TableObjectView::getConstraintString(Column *column) vector::iterator itr,itr_end; ConstraintType constr_type; - itr=table->getObjectList(ObjConstraint)->begin(); - itr_end=table->getObjectList(ObjConstraint)->end(); + itr=table->getObjectList(ObjectType::ObjConstraint)->begin(); + itr_end=table->getObjectList(ObjectType::ObjConstraint)->end(); while(itr!=itr_end) { diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 29a3a7f54d..16a0c45a33 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -60,14 +60,14 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(!object) throw Exception(OprNotAllocatedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Raises an error if the object is invalid - else if(object->getObjectType()!=ObjTable && - object->getObjectType()!=ObjView) + else if(object->getObjectType()!=ObjectType::ObjTable && + object->getObjectType()!=ObjectType::ObjView) throw Exception(OprObjectInvalidType, __PRETTY_FUNCTION__, __FILE__, __LINE__); schema=dynamic_cast(object->getSchema()); tag=dynamic_cast(object)->getTag(); - if(object->getObjectType()==ObjView && !tag) + if(object->getObjectType()==ObjectType::ObjView && !tag) { name_attrib=ParsersAttributes::VIEW_NAME; schema_name_attrib=ParsersAttributes::VIEW_SCHEMA_NAME; @@ -122,7 +122,7 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(tag) pen.setColor(tag->getElementColor(title_color_attrib, Tag::BorderColor)); - if(object->getObjectType()==ObjView || + if(object->getObjectType()==ObjectType::ObjView || (table && table->isPartition())) pen.setStyle(Qt::DashLine); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 6566e08e4b..4c63dd0a4e 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -54,25 +54,25 @@ void TableView::configureObject(void) if(obj_idx==0) { - tab_objs.assign(table->getObjectList(ObjColumn)->begin(), - table->getObjectList(ObjColumn)->end()); + tab_objs.assign(table->getObjectList(ObjectType::ObjColumn)->begin(), + table->getObjectList(ObjectType::ObjColumn)->end()); } else { - tab_objs.assign(table->getObjectList(ObjConstraint)->begin(), - table->getObjectList(ObjConstraint)->end()); + tab_objs.assign(table->getObjectList(ObjectType::ObjConstraint)->begin(), + table->getObjectList(ObjectType::ObjConstraint)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjTrigger)->begin(), - table->getObjectList(ObjTrigger)->end()); + table->getObjectList(ObjectType::ObjTrigger)->begin(), + table->getObjectList(ObjectType::ObjTrigger)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjIndex)->begin(), - table->getObjectList(ObjIndex)->end()); + table->getObjectList(ObjectType::ObjIndex)->begin(), + table->getObjectList(ObjectType::ObjIndex)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjRule)->begin(), - table->getObjectList(ObjRule)->end()); + table->getObjectList(ObjectType::ObjRule)->begin(), + table->getObjectList(ObjectType::ObjRule)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjPolicy)->begin(), - table->getObjectList(ObjPolicy)->end()); + table->getObjectList(ObjectType::ObjPolicy)->begin(), + table->getObjectList(ObjectType::ObjPolicy)->end()); } //Gets the subitems of the current group diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 278cb463b3..d1843a5fdb 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -89,8 +89,8 @@ void TextboxView::__configureObject(void) if(!override_style) { QFont font; - box->setBrush(this->getFillStyle(BaseObject::getSchemaName(ObjTextbox))); - box->setPen(this->getBorderStyle(BaseObject::getSchemaName(ObjTextbox))); + box->setBrush(this->getFillStyle(BaseObject::getSchemaName(ObjectType::ObjTextbox))); + box->setPen(this->getBorderStyle(BaseObject::getSchemaName(ObjectType::ObjTextbox))); font=fmt.font(); font.setItalic(txtbox->getTextAttribute(Textbox::ItalicText)); diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 6d5197d34c..ed242e3efc 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -30,35 +30,35 @@ const QString Catalog::PgModelerTempDbObj=QString("__pgmodeler_tmp"); attribs_map Catalog::catalog_queries; map Catalog::oid_fields= -{ {ObjDatabase, "oid"}, {ObjRole, "oid"}, {ObjSchema,"oid"}, - {ObjLanguage, "oid"}, {ObjTablespace, "oid"}, {ObjExtension, "ex.oid"}, - {ObjFunction, "pr.oid"}, {ObjAggregate, "pr.oid"}, {ObjOperator, "op.oid"}, - {ObjOpClass, "op.oid"}, {ObjOpFamily, "op.oid"}, {ObjCollation, "cl.oid"}, - {ObjConversion, "cn.oid"}, {ObjCast, "cs.oid"}, {ObjView, "vw.oid"}, - {ObjSequence, "sq.oid"}, {ObjDomain, "dm.oid"}, {ObjType, "tp.oid"}, - {ObjTable, "tb.oid"}, {ObjColumn, "cl.oid"}, {ObjConstraint, "cs.oid"}, - {ObjRule, "rl.oid"}, {ObjTrigger, "tg.oid"}, {ObjIndex, "id.indexrelid"}, - {ObjEventTrigger, "et.oid"}, {ObjPolicy, "pl.oid"} +{ {ObjectType::ObjDatabase, "oid"}, {ObjectType::ObjRole, "oid"}, {ObjectType::ObjSchema,"oid"}, + {ObjectType::ObjLanguage, "oid"}, {ObjectType::ObjTablespace, "oid"}, {ObjectType::ObjExtension, "ex.oid"}, + {ObjectType::ObjFunction, "pr.oid"}, {ObjectType::ObjAggregate, "pr.oid"}, {ObjectType::ObjOperator, "op.oid"}, + {ObjectType::ObjOpClass, "op.oid"}, {ObjectType::ObjOpFamily, "op.oid"}, {ObjectType::ObjCollation, "cl.oid"}, + {ObjectType::ObjConversion, "cn.oid"}, {ObjectType::ObjCast, "cs.oid"}, {ObjectType::ObjView, "vw.oid"}, + {ObjectType::ObjSequence, "sq.oid"}, {ObjectType::ObjDomain, "dm.oid"}, {ObjectType::ObjType, "tp.oid"}, + {ObjectType::ObjTable, "tb.oid"}, {ObjectType::ObjColumn, "cl.oid"}, {ObjectType::ObjConstraint, "cs.oid"}, + {ObjectType::ObjRule, "rl.oid"}, {ObjectType::ObjTrigger, "tg.oid"}, {ObjectType::ObjIndex, "id.indexrelid"}, + {ObjectType::ObjEventTrigger, "et.oid"}, {ObjectType::ObjPolicy, "pl.oid"} }; map Catalog::ext_oid_fields={ - {ObjConstraint, "cs.conrelid"}, - {ObjIndex, "id.indexrelid"}, - {ObjTrigger, "tg.tgrelid"}, - {ObjRule, "rl.ev_class"}, - {ObjPolicy, "pl.polrelid"} + {ObjectType::ObjConstraint, "cs.conrelid"}, + {ObjectType::ObjIndex, "id.indexrelid"}, + {ObjectType::ObjTrigger, "tg.tgrelid"}, + {ObjectType::ObjRule, "rl.ev_class"}, + {ObjectType::ObjPolicy, "pl.polrelid"} }; map Catalog::name_fields= -{ {ObjDatabase, "datname"}, {ObjRole, "rolname"}, {ObjSchema,"nspname"}, - {ObjLanguage, "lanname"}, {ObjTablespace, "spcname"}, {ObjExtension, "extname"}, - {ObjFunction, "proname"}, {ObjAggregate, "proname"}, {ObjOperator, "oprname"}, - {ObjOpClass, "opcname"}, {ObjOpFamily, "opfname"}, {ObjCollation, "collname"}, - {ObjConversion, "conname"}, {ObjCast, ""}, {ObjView, "relname"}, - {ObjSequence, "relname"}, {ObjDomain, "typname"}, {ObjType, "typname"}, - {ObjTable, "relname"}, {ObjColumn, "attname"}, {ObjConstraint, "conname"}, - {ObjRule, "rulename"}, {ObjTrigger, "tgname"}, {ObjIndex, "relname"}, - {ObjEventTrigger, "evtname"}, {ObjPolicy, "polname"} +{ {ObjectType::ObjDatabase, "datname"}, {ObjectType::ObjRole, "rolname"}, {ObjectType::ObjSchema,"nspname"}, + {ObjectType::ObjLanguage, "lanname"}, {ObjectType::ObjTablespace, "spcname"}, {ObjectType::ObjExtension, "extname"}, + {ObjectType::ObjFunction, "proname"}, {ObjectType::ObjAggregate, "proname"}, {ObjectType::ObjOperator, "oprname"}, + {ObjectType::ObjOpClass, "opcname"}, {ObjectType::ObjOpFamily, "opfname"}, {ObjectType::ObjCollation, "collname"}, + {ObjectType::ObjConversion, "conname"}, {ObjectType::ObjCast, ""}, {ObjectType::ObjView, "relname"}, + {ObjectType::ObjSequence, "relname"}, {ObjectType::ObjDomain, "typname"}, {ObjectType::ObjType, "typname"}, + {ObjectType::ObjTable, "relname"}, {ObjectType::ObjColumn, "attname"}, {ObjectType::ObjConstraint, "conname"}, + {ObjectType::ObjRule, "rulename"}, {ObjectType::ObjTrigger, "tgname"}, {ObjectType::ObjIndex, "relname"}, + {ObjectType::ObjEventTrigger, "evtname"}, {ObjectType::ObjPolicy, "polname"} }; Catalog::Catalog(void) @@ -84,7 +84,7 @@ void Catalog::setConnection(Connection &conn) connection.connect(); //Retrieving the last system oid - executeCatalogQuery(QueryList, ObjDatabase, res, true, + executeCatalogQuery(QueryList, ObjectType::ObjDatabase, res, true, {{ParsersAttributes::NAME, conn.getConnectionParam(Connection::ParamDbName)}}); if(res.accessTuple(ResultSet::FirstTuple)) @@ -197,7 +197,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b else attribs[ParsersAttributes::OID_FILTER_OP]=QString(">"); - if(obj_type==ObjType && exclude_array_types) + if(obj_type==ObjectType::ObjType && exclude_array_types) attribs[ParsersAttributes::EXC_BUILTIN_ARRAYS]=ParsersAttributes::_TRUE_; //Checking if the custom filter expression is present @@ -207,7 +207,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b attribs.erase(ParsersAttributes::CUSTOM_FILTER); } - if(exclude_ext_objs && obj_type!=ObjDatabase && obj_type!=ObjRole && obj_type!=ObjTablespace && obj_type!=ObjExtension) + if(exclude_ext_objs && obj_type!=ObjectType::ObjDatabase && obj_type!=ObjectType::ObjRole && obj_type!=ObjectType::ObjTablespace && obj_type!=ObjectType::ObjExtension) { if(ext_oid_fields.count(obj_type)==0) attribs[ParsersAttributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(oid_fields[obj_type]); @@ -287,9 +287,9 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map types=BaseObject::getObjectTypes(true, { ObjDatabase, ObjRelationship, ObjBaseRelationship, - ObjTextbox, ObjTag, ObjColumn, ObjPermission, - ObjGenericSQL }); + vector types=BaseObject::getObjectTypes(true, { ObjectType::ObjDatabase, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, + ObjectType::ObjTextbox, ObjectType::ObjTag, ObjectType::ObjColumn, ObjectType::ObjPermission, + ObjectType::ObjGenericSQL }); attribs_map attribs, col_attribs, sch_names; vector tab_attribs; unsigned tab_oid=0; @@ -303,16 +303,16 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map Catalog::getObjectsAttributes(ObjectType obj_type, const QSt { try { - bool is_shared_obj=(obj_type==ObjDatabase || obj_type==ObjRole || obj_type==ObjTablespace || - obj_type==ObjLanguage || obj_type==ObjCast); + bool is_shared_obj=(obj_type==ObjectType::ObjDatabase || obj_type==ObjectType::ObjRole || obj_type==ObjectType::ObjTablespace || + obj_type==ObjectType::ObjLanguage || obj_type==ObjectType::ObjCast); extra_attribs[ParsersAttributes::SCHEMA]=schema; extra_attribs[ParsersAttributes::TABLE]=table; @@ -600,7 +600,7 @@ vector Catalog::getObjectsAttributes(ObjectType obj_type, const QSt extra_attribs[ParsersAttributes::FILTER_OIDS]=createOidFilter(filter_oids); //Retrieve the comment catalog query. Only columns need to retreive comments in their own catalog query file - if(obj_type != ObjColumn) + if(obj_type != ObjectType::ObjColumn) extra_attribs[ParsersAttributes::COMMENT]=getCommentQuery(oid_fields[obj_type], is_shared_obj); return(getMultipleAttributes(obj_type, extra_attribs)); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 982289afe6..f03a91abbb 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -20,7 +20,7 @@ Aggregate::Aggregate(void) { - obj_type=ObjAggregate; + obj_type=ObjectType::ObjAggregate; functions[0]=functions[1]=nullptr; sort_operator=nullptr; attributes[ParsersAttributes::TYPES]=QString(); @@ -42,7 +42,7 @@ void Aggregate::setFunction(unsigned func_idx, Function *func) if(!isValidFunction(func_idx, func)) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidConfiguration) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjAggregate)), + .arg(BaseObject::getTypeName(ObjectType::ObjAggregate)), AsgFunctionInvalidConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(functions[func_idx]!=func); diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 20a24ab3e5..75607f0bc7 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -118,6 +118,6 @@ QObject *BaseGraphicObject::getReceiverObject(void) bool BaseGraphicObject::isGraphicObject(ObjectType type) { - return(type==ObjTable || type==ObjView || type==ObjRelationship || - type==ObjBaseRelationship || type==ObjTextbox || type==ObjSchema); + return(type==ObjectType::ObjTable || type==ObjectType::ObjView || type==ObjectType::ObjRelationship || + type==ObjectType::ObjBaseRelationship || type==ObjectType::ObjTextbox || type==ObjectType::ObjSchema); } diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 41f8d11db6..73ad648fdc 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -76,7 +76,7 @@ BaseObject::BaseObject(void) object_id=BaseObject::global_id++; is_protected=system_obj=sql_disabled=false; code_invalidated=true; - obj_type=ObjBaseObject; + obj_type=ObjectType::ObjBaseObject; schema=nullptr; owner=nullptr; tablespace=nullptr; @@ -105,7 +105,7 @@ unsigned BaseObject::getGlobalId(void) QString BaseObject::getTypeName(ObjectType obj_type) { - if(obj_type!=ObjBaseObject) + if(obj_type!=ObjectType::ObjBaseObject) /* Due to the class BaseObject not be derived from QObject the function tr() is inefficient to translate the type names thus the method called to do the translation is from the application specifying the context (BaseObject) in the ts file and the text to be translated */ @@ -121,7 +121,7 @@ QString BaseObject::getTypeName(const QString &type_str) ObjectType BaseObject::getObjectType(const QString &type_name) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; for(int i=0; i < BaseObject::ObjectTypeCount; i++) { @@ -324,7 +324,7 @@ bool BaseObject::isValidName(const QString &name) void BaseObject::setDatabase(BaseObject *db) { - if((db && db->getObjectType()==ObjDatabase) || !db) + if((db && db->getObjectType()==ObjectType::ObjDatabase) || !db) this->database=db; } @@ -378,13 +378,13 @@ void BaseObject::setComment(const QString &comment) bool BaseObject::acceptsSchema(ObjectType obj_type) { - return(obj_type==ObjFunction || obj_type==ObjTable || - obj_type==ObjView || obj_type==ObjDomain || - obj_type==ObjAggregate || obj_type==ObjOperator || - obj_type==ObjSequence || obj_type==ObjConversion || - obj_type==ObjType || obj_type==ObjOpClass || - obj_type==ObjOpFamily || obj_type==ObjCollation || - obj_type==ObjExtension); + return(obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjTable || + obj_type==ObjectType::ObjView || obj_type==ObjectType::ObjDomain || + obj_type==ObjectType::ObjAggregate || obj_type==ObjectType::ObjOperator || + obj_type==ObjectType::ObjSequence || obj_type==ObjectType::ObjConversion || + obj_type==ObjectType::ObjType || obj_type==ObjectType::ObjOpClass || + obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjCollation || + obj_type==ObjectType::ObjExtension); } bool BaseObject::acceptsSchema(void) @@ -394,15 +394,15 @@ bool BaseObject::acceptsSchema(void) bool BaseObject::acceptsOwner(ObjectType obj_type) { - return(obj_type==ObjFunction || obj_type==ObjTable || - obj_type==ObjDomain || obj_type==ObjSchema || - obj_type==ObjAggregate || obj_type==ObjOperator || - obj_type==ObjConversion || obj_type==ObjSequence || - obj_type==ObjLanguage || obj_type==ObjType || - obj_type==ObjTablespace || obj_type==ObjDatabase || - obj_type==ObjOpClass || obj_type==ObjOpFamily || - obj_type==ObjCollation || obj_type==ObjView || - obj_type==ObjEventTrigger); + return(obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjTable || + obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjSchema || + obj_type==ObjectType::ObjAggregate || obj_type==ObjectType::ObjOperator || + obj_type==ObjectType::ObjConversion || obj_type==ObjectType::ObjSequence || + obj_type==ObjectType::ObjLanguage || obj_type==ObjectType::ObjType || + obj_type==ObjectType::ObjTablespace || obj_type==ObjectType::ObjDatabase || + obj_type==ObjectType::ObjOpClass || obj_type==ObjectType::ObjOpFamily || + obj_type==ObjectType::ObjCollation || obj_type==ObjectType::ObjView || + obj_type==ObjectType::ObjEventTrigger); } bool BaseObject::acceptsOwner(void) @@ -412,11 +412,11 @@ bool BaseObject::acceptsOwner(void) bool BaseObject::acceptsTablespace(ObjectType obj_type) { - return(obj_type==ObjIndex || - obj_type==ObjTable || - obj_type==ObjView || - obj_type==ObjConstraint || - obj_type==ObjDatabase); + return(obj_type==ObjectType::ObjIndex || + obj_type==ObjectType::ObjTable || + obj_type==ObjectType::ObjView || + obj_type==ObjectType::ObjConstraint || + obj_type==ObjectType::ObjDatabase); } bool BaseObject::acceptsTablespace(void) @@ -426,9 +426,9 @@ bool BaseObject::acceptsTablespace(void) bool BaseObject::acceptsCollation(ObjectType obj_type) { - return(obj_type==ObjDomain || obj_type==ObjColumn || - obj_type==ObjCollation || obj_type==ObjType || - obj_type==ObjTypeAttribute); + return(obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjColumn || + obj_type==ObjectType::ObjCollation || obj_type==ObjectType::ObjType || + obj_type==ObjectType::ObjTypeAttribute); } bool BaseObject::acceptsCollation(void) @@ -438,40 +438,40 @@ bool BaseObject::acceptsCollation(void) bool BaseObject::acceptsCustomSQL(ObjectType obj_type) { - return(obj_type!=ObjColumn && obj_type!=ObjConstraint && - obj_type!=ObjRelationship && obj_type!=ObjTextbox && obj_type!=ObjParameter && - obj_type!=ObjTypeAttribute && obj_type!=ObjBaseRelationship && - obj_type!=ObjBaseObject && obj_type!=ObjBaseTable && obj_type!=ObjPermission && - obj_type!=ObjTag && obj_type!=ObjGenericSQL); + return(obj_type!=ObjectType::ObjColumn && obj_type!=ObjectType::ObjConstraint && + obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjParameter && + obj_type!=ObjectType::ObjTypeAttribute && obj_type!=ObjectType::ObjBaseRelationship && + obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjBaseTable && obj_type!=ObjectType::ObjPermission && + obj_type!=ObjectType::ObjTag && obj_type!=ObjectType::ObjGenericSQL); } bool BaseObject::acceptsAlterCommand(ObjectType obj_type) { - return(obj_type==ObjCollation || obj_type==ObjColumn || - obj_type==ObjDomain || obj_type==ObjEventTrigger || - obj_type==ObjExtension || obj_type==ObjFunction || - obj_type==ObjIndex || obj_type==ObjRole || - obj_type==ObjSchema || obj_type==ObjSequence || - obj_type==ObjTable || obj_type==ObjTablespace || - obj_type==ObjType || obj_type==ObjPolicy); + return(obj_type==ObjectType::ObjCollation || obj_type==ObjectType::ObjColumn || + obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjEventTrigger || + obj_type==ObjectType::ObjExtension || obj_type==ObjectType::ObjFunction || + obj_type==ObjectType::ObjIndex || obj_type==ObjectType::ObjRole || + obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjSequence || + obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjTablespace || + obj_type==ObjectType::ObjType || obj_type==ObjectType::ObjPolicy); } bool BaseObject::acceptsDropCommand(ObjectType obj_type) { - return(obj_type!=ObjPermission && obj_type!=ObjRelationship && - obj_type!=ObjTextbox && obj_type!=ObjTypeAttribute && - obj_type!=ObjParameter && obj_type!=ObjBaseObject && - obj_type!=ObjTag && obj_type!=ObjBaseRelationship && - obj_type!=ObjBaseTable); + return(obj_type!=ObjectType::ObjPermission && obj_type!=ObjectType::ObjRelationship && + obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjTypeAttribute && + obj_type!=ObjectType::ObjParameter && obj_type!=ObjectType::ObjBaseObject && + obj_type!=ObjectType::ObjTag && obj_type!=ObjectType::ObjBaseRelationship && + obj_type!=ObjectType::ObjBaseTable); } bool BaseObject::acceptsAlias(ObjectType obj_type) { - return(obj_type==ObjRelationship || obj_type==ObjBaseRelationship || - obj_type==ObjTable || obj_type==ObjSchema || obj_type==ObjView || - obj_type == ObjColumn || obj_type == ObjConstraint || - obj_type == ObjIndex || obj_type == ObjRule || - obj_type == ObjTrigger || obj_type == ObjPolicy); + return(obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjBaseRelationship || + obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjView || + obj_type == ObjectType::ObjColumn || obj_type == ObjectType::ObjConstraint || + obj_type == ObjectType::ObjIndex || obj_type == ObjectType::ObjRule || + obj_type == ObjectType::ObjTrigger || obj_type == ObjectType::ObjPolicy); } bool BaseObject::acceptsCustomSQL(void) @@ -496,7 +496,7 @@ void BaseObject::setSchema(BaseObject *schema) .arg(this->obj_name) .arg(this->getTypeName()), AsgNotAllocatedSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(schema && schema->getObjectType()!=ObjSchema) + else if(schema && schema->getObjectType()!=ObjectType::ObjSchema) throw Exception(AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsSchema()) throw Exception(AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -507,7 +507,7 @@ void BaseObject::setSchema(BaseObject *schema) void BaseObject::setOwner(BaseObject *owner) { - if(owner && owner->getObjectType()!=ObjRole) + if(owner && owner->getObjectType()!=ObjectType::ObjRole) throw Exception(AsgInvalidRoleObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsOwner()) throw Exception(AsgRoleObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -518,7 +518,7 @@ void BaseObject::setOwner(BaseObject *owner) void BaseObject::setTablespace(BaseObject *tablespace) { - if(tablespace && tablespace->getObjectType()!=ObjTablespace) + if(tablespace && tablespace->getObjectType()!=ObjectType::ObjTablespace) throw Exception(AsgInvalidTablespaceObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsTablespace()) throw Exception(AsgTablespaceInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -531,7 +531,7 @@ void BaseObject::setCollation(BaseObject *collation) { if(collation && !acceptsCollation()) throw Exception(AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(collation && collation->getObjectType()!=ObjCollation) + if(collation && collation->getObjectType()!=ObjectType::ObjCollation) throw Exception(AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->collation != collation); @@ -561,7 +561,7 @@ QString BaseObject::getName(bool format, bool prepend_schema) if(format) { QString aux_name; - aux_name=formatName(this->obj_name, (obj_type==ObjOperator)); + aux_name=formatName(this->obj_name, (obj_type==ObjectType::ObjOperator)); if(this->schema && prepend_schema) aux_name=formatName(this->schema->getName(format)) + QString(".") + aux_name; @@ -697,11 +697,11 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) QString code_def; if((def_type==SchemaParser::SqlDefinition && - obj_type!=ObjBaseObject && obj_type!=ObjBaseRelationship && - obj_type!=ObjBaseTable && obj_type!=ObjTextbox) || + obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjBaseRelationship && + obj_type!=ObjectType::ObjBaseTable && obj_type!=ObjectType::ObjTextbox) || (def_type==SchemaParser::XmlDefinition && - obj_type!=ObjBaseObject && obj_type!=ObjBaseTable)) + obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjBaseTable)) { bool format=false; @@ -711,7 +711,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) //Formats the object's name in case the SQL definition is being generated format=((def_type==SchemaParser::SqlDefinition) || (def_type==SchemaParser::XmlDefinition && reduced_form && - obj_type!=ObjTextbox && obj_type!=ObjRelationship)); + obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjRelationship)); setBasicAttributes(format); @@ -751,7 +751,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) /** Only tablespaces and database do not have an ALTER OWNER SET because the rule says that PostgreSQL tablespaces and database should be created with just a command line isolated from the others **/ - if(obj_type!=ObjTablespace && obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjTablespace && obj_type!=ObjectType::ObjDatabase) { SchemaParser sch_parser; QString filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + @@ -840,7 +840,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) clearAttributes(); //Database object doesn't handles cached code. - if(use_cached_code && obj_type!=ObjDatabase) + if(use_cached_code && obj_type!=ObjectType::ObjDatabase) { if(def_type==SchemaParser::SqlDefinition || (!reduced_form && def_type==SchemaParser::XmlDefinition)) @@ -909,8 +909,8 @@ void BaseObject::swapObjectsIds(BaseObject *obj1, BaseObject *obj2, bool enable_ OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the object is object is cluster level and the swap of these types isn't enabled else if(!enable_cl_obj_swap && - (obj1->getObjectType()==ObjDatabase || obj1->getObjectType()==ObjTablespace || obj1->getObjectType()==ObjRole || - obj2->getObjectType()==ObjDatabase || obj2->getObjectType()==ObjTablespace || obj2->getObjectType()==ObjRole)) + (obj1->getObjectType()==ObjectType::ObjDatabase || obj1->getObjectType()==ObjectType::ObjTablespace || obj1->getObjectType()==ObjectType::ObjRole || + obj2->getObjectType()==ObjectType::ObjDatabase || obj2->getObjectType()==ObjectType::ObjTablespace || obj2->getObjectType()==ObjectType::ObjRole)) throw Exception(InvIdSwapInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -936,22 +936,22 @@ void BaseObject::updateObjectId(BaseObject *obj) vector BaseObject::getObjectTypes(bool inc_table_objs, vector exclude_types) { - vector vet_types={ ObjBaseRelationship, ObjAggregate, ObjCast, ObjCollation, - ObjConversion, ObjDatabase, ObjDomain, ObjExtension, ObjEventTrigger, - ObjTag, ObjFunction, ObjLanguage, ObjOpClass, ObjOperator, - ObjOpFamily, ObjRelationship, ObjRole, ObjSchema, - ObjSequence, ObjTable, ObjTablespace, ObjTextbox, - ObjType, ObjView, ObjPermission, ObjGenericSQL }; + vector vet_types={ ObjectType::ObjBaseRelationship, ObjectType::ObjAggregate, ObjectType::ObjCast, ObjectType::ObjCollation, + ObjectType::ObjConversion, ObjectType::ObjDatabase, ObjectType::ObjDomain, ObjectType::ObjExtension, ObjectType::ObjEventTrigger, + ObjectType::ObjTag, ObjectType::ObjFunction, ObjectType::ObjLanguage, ObjectType::ObjOpClass, ObjectType::ObjOperator, + ObjectType::ObjOpFamily, ObjectType::ObjRelationship, ObjectType::ObjRole, ObjectType::ObjSchema, + ObjectType::ObjSequence, ObjectType::ObjTable, ObjectType::ObjTablespace, ObjectType::ObjTextbox, + ObjectType::ObjType, ObjectType::ObjView, ObjectType::ObjPermission, ObjectType::ObjGenericSQL }; vector::iterator itr; if(inc_table_objs) { - vet_types.push_back(ObjColumn); - vet_types.push_back(ObjConstraint); - vet_types.push_back(ObjTrigger); - vet_types.push_back(ObjRule); - vet_types.push_back(ObjIndex); - vet_types.push_back(ObjPolicy); + vet_types.push_back(ObjectType::ObjColumn); + vet_types.push_back(ObjectType::ObjConstraint); + vet_types.push_back(ObjectType::ObjTrigger); + vet_types.push_back(ObjectType::ObjRule); + vet_types.push_back(ObjectType::ObjIndex); + vet_types.push_back(ObjectType::ObjPolicy); } for(ObjectType type : exclude_types) @@ -966,15 +966,15 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector BaseObject::getChildObjectTypes(ObjectType obj_type) { - if(obj_type==ObjDatabase) - return(vector()={ObjCast, ObjRole, ObjLanguage, ObjTablespace, ObjSchema, ObjExtension, ObjEventTrigger}); - else if(obj_type==ObjSchema) - return(vector()={ObjAggregate, ObjConversion, ObjCollation, ObjDomain, ObjFunction, - ObjOpClass, ObjOperator, ObjOpFamily, ObjSequence, ObjType, ObjTable, ObjView}); - else if(obj_type==ObjTable) - return(vector()={ObjColumn, ObjConstraint, ObjRule, ObjTrigger, ObjIndex, ObjPolicy}); - else if(obj_type==ObjView) - return(vector()={ObjRule, ObjTrigger, ObjIndex}); + if(obj_type==ObjectType::ObjDatabase) + return(vector()={ObjectType::ObjCast, ObjectType::ObjRole, ObjectType::ObjLanguage, ObjectType::ObjTablespace, ObjectType::ObjSchema, ObjectType::ObjExtension, ObjectType::ObjEventTrigger}); + else if(obj_type==ObjectType::ObjSchema) + return(vector()={ObjectType::ObjAggregate, ObjectType::ObjConversion, ObjectType::ObjCollation, ObjectType::ObjDomain, ObjectType::ObjFunction, + ObjectType::ObjOpClass, ObjectType::ObjOperator, ObjectType::ObjOpFamily, ObjectType::ObjSequence, ObjectType::ObjType, ObjectType::ObjTable, ObjectType::ObjView}); + else if(obj_type==ObjectType::ObjTable) + return(vector()={ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjPolicy}); + else if(obj_type==ObjectType::ObjView) + return(vector()={ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex}); else return(vector()={}); } diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 34bc26c2cc..683d80c0c9 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -470,7 +470,7 @@ class BaseObject { static void enableCachedCode(bool value); /*! \brief Returns the valid object types in a vector. The types - ObjBaseObject, TYPE_ATTRIBUTE and ObjBaseTable aren't included in return vector. + ObjectType::ObjBaseObject, TYPE_ATTRIBUTE and ObjectType::ObjBaseTable aren't included in return vector. By default table objects (columns, trigger, constraints, etc) are included. To avoid the insertion of these types set the boolean param to false. */ static vector getObjectTypes(bool inc_table_objs=true, vector exclude_types={}); @@ -478,7 +478,7 @@ class BaseObject { /*! \brief Returns the valid object types that are child or grouped under the specified type. This method works a litte different from getObjectTypes() since this latter returns all valid types and this one returns only the valid types for the current specified type. For now the only accepted - types are ObjDatabase, ObjSchema and ObjTable */ + types are ObjectType::ObjDatabase, ObjectType::ObjSchema and ObjectType::ObjTable */ static vector getChildObjectTypes(ObjectType obj_type); /*! \brief Sets the default version when generating the SQL code. This affects all instances of classes that diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 38e6a0dafd..82324c3cd2 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -75,7 +75,7 @@ BaseRelationship::BaseRelationship(unsigned rel_type, BaseTable *src_tab, BaseTa void BaseRelationship::configureRelationship(void) { - obj_type=ObjBaseRelationship; + obj_type=ObjectType::ObjBaseRelationship; attributes[ParsersAttributes::TYPE]=QString(); attributes[ParsersAttributes::SRC_REQUIRED]=QString(); @@ -125,7 +125,7 @@ void BaseRelationship::configureRelationship(void) if(!src_table || !dst_table) throw Exception(Exception::getErrorMessage(AsgNotAllocatedTable) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjBaseRelationship)), + .arg(BaseObject::getTypeName(ObjectType::ObjBaseRelationship)), AsgNotAllocatedTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the relationship type is generalization or dependency @@ -512,7 +512,7 @@ QString BaseRelationship::getRelTypeAttribute(void) case RelationshipPart: return(ParsersAttributes::RELATIONSHIP_PART); break; case RelationshipFk: return(ParsersAttributes::RELATIONSHIP_FK); break; default: - if(src_table->getObjectType()==ObjView) + if(src_table->getObjectType()==ObjectType::ObjView) return(ParsersAttributes::RELATION_TAB_VIEW); else return(ParsersAttributes::RELATIONSHIP_DEP); @@ -541,7 +541,7 @@ QString BaseRelationship::getRelationshipTypeName(unsigned rel_type, bool is_vie QString BaseRelationship::getRelationshipTypeName(void) { - return(getRelationshipTypeName(rel_type, src_table->getObjectType()==ObjView)); + return(getRelationshipTypeName(rel_type, src_table->getObjectType()==ObjectType::ObjView)); } void BaseRelationship::setCodeInvalidated(bool value) diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index ae8af5fd2b..3f6e09e891 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -21,7 +21,7 @@ BaseTable::BaseTable(void) { tag=nullptr; - obj_type=ObjBaseTable; + obj_type=ObjectType::ObjBaseTable; attributes[ParsersAttributes::TAG]=QString(); attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=QString(); attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString(); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 18a8001cab..993ec7ac7d 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -20,7 +20,7 @@ Cast::Cast(void) { - obj_type=ObjCast; + obj_type=ObjectType::ObjCast; cast_function=nullptr; cast_type=Explicit; is_in_out=false; @@ -40,7 +40,7 @@ void Cast::setDataType(unsigned type_idx, PgSQLType type) if((*type).isEmpty()) throw Exception(Exception::getErrorMessage(AsgNullTypeObject) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::ObjCast)), AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->types[type_idx] != type); @@ -79,7 +79,7 @@ void Cast::setCastFunction(Function *cast_func) if(!cast_func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::ObjCast)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Retrieve the cast function parameter count for specific validations @@ -89,7 +89,7 @@ void Cast::setCastFunction(Function *cast_func) if(param_count==0 || param_count > 3) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::ObjCast)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -112,7 +112,7 @@ void Cast::setCastFunction(Function *cast_func) if(error) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::ObjCast)), AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -123,7 +123,7 @@ void Cast::setCastFunction(Function *cast_func) if(ret_type!=this->types[DstType] && !ret_type.canCastTo(this->types[DstType])) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::ObjCast)), AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(cast_function != cast_func); diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index 438302e677..3edb30ee75 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -20,7 +20,7 @@ Collation::Collation(void) { - obj_type=ObjCollation; + obj_type=ObjectType::ObjCollation; encoding=BaseType::null; attributes[ParsersAttributes::_LC_CTYPE_]=QString(); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index c697360e96..1d1fafb797 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -20,7 +20,7 @@ Column::Column(void) { - obj_type=ObjColumn; + obj_type=ObjectType::ObjColumn; not_null=seq_cycle=false; attributes[ParsersAttributes::TYPE]=QString(); attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); @@ -152,7 +152,7 @@ QString Column::getOldName(bool format) void Column::setParentRelationship(BaseObject *parent_rel) { - if(parent_rel && parent_rel->getObjectType()!=ObjRelationship) + if(parent_rel && parent_rel->getObjectType()!=ObjectType::ObjRelationship) throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->parent_rel=parent_rel; @@ -167,11 +167,11 @@ void Column::setSequence(BaseObject *seq) { if(seq) { - if(seq->getObjectType()!=ObjSequence) + if(seq->getObjectType()!=ObjectType::ObjSequence) throw Exception(Exception::getErrorMessage(AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) - .arg(BaseObject::getTypeName(ObjSequence)), + .arg(BaseObject::getTypeName(ObjectType::ObjSequence)), AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!type.isIntegerType()) throw Exception(Exception::getErrorMessage(IncompColumnTypeForSequence) diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index bf9850d183..5a8c94ef6a 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -21,7 +21,7 @@ Constraint::Constraint(void) { ref_table=nullptr; - obj_type=ObjConstraint; + obj_type=ObjectType::ObjConstraint; deferrable=false; no_inherit=false; fill_factor=0; @@ -149,7 +149,7 @@ void Constraint::addColumn(Column *column, unsigned col_type) if(!column) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedColumn) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjConstraint)), + .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)), ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(constr_type!=ConstraintType::check) { diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index e6f6ffc284..8eaf9b6b6b 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -20,7 +20,7 @@ Conversion::Conversion(void) { - obj_type=ObjConversion; + obj_type=ObjectType::ObjConversion; conversion_func=nullptr; is_default=false; attributes[ParsersAttributes::DEFAULT]=QString(); @@ -38,7 +38,7 @@ void Conversion::setEncoding(unsigned encoding_idx, EncodingType encoding_type) if((~encoding_type).isEmpty()) throw Exception(Exception::getErrorMessage(AsgNullTypeObject) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Assigns the encoding to the conversion in the specified index @@ -55,14 +55,14 @@ void Conversion::setConversionFunction(Function *conv_func) if(!conv_func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* The conversion function must have 5 parameters if it's not the case raises an error. */ else if(conv_func->getParameterCount()!=5) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the function parameters does not following the type order: interger, integer, cstring, internal, integer */ @@ -73,13 +73,13 @@ void Conversion::setConversionFunction(Function *conv_func) conv_func->getParameter(4).getType()!=QString("integer")) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the conversion function return type is not 'void' else if(conv_func->getReturnType()!=QString("void")) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(conversion_func != conv_func); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index cade9eb691..7367ce9ad3 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -25,7 +25,7 @@ DatabaseModel::DatabaseModel(void) { this->model_wgt=nullptr; object_id=DatabaseModel::dbmodel_id++; - obj_type=ObjDatabase; + obj_type=ObjectType::ObjDatabase; is_template = false; allow_conns = true; @@ -33,10 +33,10 @@ DatabaseModel::DatabaseModel(void) encoding=BaseType::null; BaseObject::setName(QObject::trUtf8("new_database").toUtf8()); - default_objs[ObjSchema]=nullptr; - default_objs[ObjRole]=nullptr; - default_objs[ObjTablespace]=nullptr; - default_objs[ObjCollation]=nullptr; + default_objs[ObjectType::ObjSchema]=nullptr; + default_objs[ObjectType::ObjRole]=nullptr; + default_objs[ObjectType::ObjTablespace]=nullptr; + default_objs[ObjectType::ObjCollation]=nullptr; conn_limit=-1; last_zoom=1; @@ -102,55 +102,55 @@ void DatabaseModel::setAuthor(const QString &author) vector *DatabaseModel::getObjectList(ObjectType obj_type) { - if(obj_type==ObjTextbox) + if(obj_type==ObjectType::ObjTextbox) return(&textboxes); - else if(obj_type==ObjTable) + else if(obj_type==ObjectType::ObjTable) return(&tables); - else if(obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjFunction) return(&functions); - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) return(&aggregates); - else if(obj_type==ObjSchema) + else if(obj_type==ObjectType::ObjSchema) return(&schemas); - else if(obj_type==ObjView) + else if(obj_type==ObjectType::ObjView) return(&views); - else if(obj_type==ObjType) + else if(obj_type==ObjectType::ObjType) return(&types); - else if(obj_type==ObjRole) + else if(obj_type==ObjectType::ObjRole) return(&roles); - else if(obj_type==ObjTablespace) + else if(obj_type==ObjectType::ObjTablespace) return(&tablespaces); - else if(obj_type==ObjLanguage) + else if(obj_type==ObjectType::ObjLanguage) return(&languages); - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) return(&casts); - else if(obj_type==ObjConversion) + else if(obj_type==ObjectType::ObjConversion) return(&conversions); - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) return(&operators); - else if(obj_type==ObjOpClass) + else if(obj_type==ObjectType::ObjOpClass) return(&op_classes); - else if(obj_type==ObjOpFamily) + else if(obj_type==ObjectType::ObjOpFamily) return(&op_families); - else if(obj_type==ObjDomain) + else if(obj_type==ObjectType::ObjDomain) return(&domains); - else if(obj_type==ObjSequence) + else if(obj_type==ObjectType::ObjSequence) return(&sequences); - else if(obj_type==ObjBaseRelationship) + else if(obj_type==ObjectType::ObjBaseRelationship) return(&base_relationships); - else if(obj_type==ObjRelationship) + else if(obj_type==ObjectType::ObjRelationship) return(&relationships); - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) return(&permissions); - else if(obj_type==ObjCollation) + else if(obj_type==ObjectType::ObjCollation) return(&collations); - else if(obj_type==ObjExtension) + else if(obj_type==ObjectType::ObjExtension) return(&extensions); - else if(obj_type==ObjTag) + else if(obj_type==ObjectType::ObjTag) return(&tags); - else if(obj_type==ObjEventTrigger) + else if(obj_type==ObjectType::ObjEventTrigger) return(&eventtriggers); - else if(obj_type==ObjGenericSQL) + else if(obj_type==ObjectType::ObjGenericSQL) return(&genericsqls); else return(nullptr); @@ -166,54 +166,54 @@ void DatabaseModel::addObject(BaseObject *object, int obj_idx) { obj_type=object->getObjectType(); - if(obj_type==ObjRelationship || - obj_type==ObjBaseRelationship) + if(obj_type==ObjectType::ObjRelationship || + obj_type==ObjectType::ObjBaseRelationship) addRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTextbox) + else if(obj_type==ObjectType::ObjTextbox) addTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTable) + else if(obj_type==ObjectType::ObjTable) addTable(dynamic_cast
(object), obj_idx); - else if(obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjFunction) addFunction(dynamic_cast(object), obj_idx); - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) addAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==ObjSchema) + else if(obj_type==ObjectType::ObjSchema) addSchema(dynamic_cast(object), obj_idx); - else if(obj_type==ObjView) + else if(obj_type==ObjectType::ObjView) addView(dynamic_cast(object), obj_idx); - else if(obj_type==ObjType) + else if(obj_type==ObjectType::ObjType) addType(dynamic_cast(object), obj_idx); - else if(obj_type==ObjRole) + else if(obj_type==ObjectType::ObjRole) addRole(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTablespace) + else if(obj_type==ObjectType::ObjTablespace) addTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==ObjLanguage) + else if(obj_type==ObjectType::ObjLanguage) addLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) addCast(dynamic_cast(object), obj_idx); - else if(obj_type==ObjConversion) + else if(obj_type==ObjectType::ObjConversion) addConversion(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) addOperator(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOpClass) + else if(obj_type==ObjectType::ObjOpClass) addOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOpFamily) + else if(obj_type==ObjectType::ObjOpFamily) addOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==ObjDomain) + else if(obj_type==ObjectType::ObjDomain) addDomain(dynamic_cast(object), obj_idx); - else if(obj_type==ObjSequence) + else if(obj_type==ObjectType::ObjSequence) addSequence(dynamic_cast(object), obj_idx); - else if(obj_type==ObjCollation) + else if(obj_type==ObjectType::ObjCollation) addCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjExtension) + else if(obj_type==ObjectType::ObjExtension) addExtension(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTag) + else if(obj_type==ObjectType::ObjTag) addTag(dynamic_cast(object), obj_idx); - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) addPermission(dynamic_cast(object)); - else if(obj_type==ObjEventTrigger) + else if(obj_type==ObjectType::ObjEventTrigger) addEventTrigger(dynamic_cast(object)); - else if(obj_type==ObjGenericSQL) + else if(obj_type==ObjectType::ObjGenericSQL) addGenericSQL(dynamic_cast(object)); } catch(Exception &e) @@ -234,54 +234,54 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) { obj_type=object->getObjectType(); - if(obj_type==ObjRelationship || - obj_type==ObjBaseRelationship) + if(obj_type==ObjectType::ObjRelationship || + obj_type==ObjectType::ObjBaseRelationship) removeRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTextbox) + else if(obj_type==ObjectType::ObjTextbox) removeTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTable) + else if(obj_type==ObjectType::ObjTable) removeTable(dynamic_cast
(object), obj_idx); - else if(obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjFunction) removeFunction(dynamic_cast(object), obj_idx); - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) removeAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==ObjSchema) + else if(obj_type==ObjectType::ObjSchema) removeSchema(dynamic_cast(object), obj_idx); - else if(obj_type==ObjView) + else if(obj_type==ObjectType::ObjView) removeView(dynamic_cast(object), obj_idx); - else if(obj_type==ObjType) + else if(obj_type==ObjectType::ObjType) removeType(dynamic_cast(object), obj_idx); - else if(obj_type==ObjRole) + else if(obj_type==ObjectType::ObjRole) removeRole(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTablespace) + else if(obj_type==ObjectType::ObjTablespace) removeTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==ObjLanguage) + else if(obj_type==ObjectType::ObjLanguage) removeLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) removeCast(dynamic_cast(object), obj_idx); - else if(obj_type==ObjConversion) + else if(obj_type==ObjectType::ObjConversion) removeConversion(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) removeOperator(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOpClass) + else if(obj_type==ObjectType::ObjOpClass) removeOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOpFamily) + else if(obj_type==ObjectType::ObjOpFamily) removeOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==ObjDomain) + else if(obj_type==ObjectType::ObjDomain) removeDomain(dynamic_cast(object), obj_idx); - else if(obj_type==ObjSequence) + else if(obj_type==ObjectType::ObjSequence) removeSequence(dynamic_cast(object), obj_idx); - else if(obj_type==ObjCollation) + else if(obj_type==ObjectType::ObjCollation) removeCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjExtension) + else if(obj_type==ObjectType::ObjExtension) removeExtension(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTag) + else if(obj_type==ObjectType::ObjTag) removeTag(dynamic_cast(object), obj_idx); - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) removePermission(dynamic_cast(object)); - else if(obj_type==ObjEventTrigger) + else if(obj_type==ObjectType::ObjEventTrigger) removeEventTrigger(dynamic_cast(object)); - else if(obj_type==ObjGenericSQL) + else if(obj_type==ObjectType::ObjGenericSQL) removeGenericSQL(dynamic_cast(object)); } catch(Exception &e) @@ -294,8 +294,8 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) { if(TableObject::isTableObject(obj_type) || - obj_type==ObjBaseObject || obj_type==ObjBaseRelationship || - obj_type==ObjDatabase) + obj_type==ObjectType::ObjBaseObject || obj_type==ObjectType::ObjBaseRelationship || + obj_type==ObjectType::ObjDatabase) throw Exception(RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else @@ -308,49 +308,49 @@ void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); object=(*obj_list)[obj_idx]; - if(obj_type==ObjTextbox) + if(obj_type==ObjectType::ObjTextbox) removeTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTable) + else if(obj_type==ObjectType::ObjTable) removeTable(dynamic_cast
(object), obj_idx); - else if(obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjFunction) removeFunction(dynamic_cast(object), obj_idx); - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) removeAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==ObjSchema) + else if(obj_type==ObjectType::ObjSchema) removeSchema(dynamic_cast(object), obj_idx); - else if(obj_type==ObjView) + else if(obj_type==ObjectType::ObjView) removeView(dynamic_cast(object), obj_idx); - else if(obj_type==ObjType) + else if(obj_type==ObjectType::ObjType) removeType(dynamic_cast(object), obj_idx); - else if(obj_type==ObjRole) + else if(obj_type==ObjectType::ObjRole) removeRole(dynamic_cast(object), obj_idx); - else if(obj_type==ObjTablespace) + else if(obj_type==ObjectType::ObjTablespace) removeTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==ObjLanguage) + else if(obj_type==ObjectType::ObjLanguage) removeLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) removeCast(dynamic_cast(object), obj_idx); - else if(obj_type==ObjConversion) + else if(obj_type==ObjectType::ObjConversion) removeConversion(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) removeOperator(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOpClass) + else if(obj_type==ObjectType::ObjOpClass) removeOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==ObjOpFamily) + else if(obj_type==ObjectType::ObjOpFamily) removeOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==ObjDomain) + else if(obj_type==ObjectType::ObjDomain) removeDomain(dynamic_cast(object), obj_idx); - else if(obj_type==ObjSequence) + else if(obj_type==ObjectType::ObjSequence) removeSequence(dynamic_cast(object), obj_idx); - else if(obj_type==ObjCollation) + else if(obj_type==ObjectType::ObjCollation) removeCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjRelationship || obj_type==ObjBaseRelationship) + else if(obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjBaseRelationship) removeRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) removePermission(dynamic_cast(object)); - else if(obj_type==ObjEventTrigger) + else if(obj_type==ObjectType::ObjEventTrigger) removeEventTrigger(dynamic_cast(object), obj_idx); - else if(obj_type==ObjGenericSQL) + else if(obj_type==ObjectType::ObjGenericSQL) removeGenericSQL(dynamic_cast(object), obj_idx); } } @@ -379,7 +379,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) #endif - if(obj_type==ObjTablespace) + if(obj_type==ObjectType::ObjTablespace) { Tablespace *tabspc=nullptr, *aux_tabspc=nullptr; @@ -409,17 +409,17 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) /* Raises an error if there is an object with the same name. Special cases are for: functions/operator that are search by signature and views that are search on tables and views list */ - if((obj_type==ObjView && (getObject(object->getName(true), obj_type, idx) || - getObject(object->getName(true), ObjTable, idx))) || - (obj_type==ObjTable && (getObject(object->getName(true), obj_type, idx) || - getObject(object->getName(true), ObjView, idx))) || - (obj_type==ObjExtension && (getObject(object->getName(false), obj_type, idx))) || + if((obj_type==ObjectType::ObjView && (getObject(object->getName(true), obj_type, idx) || + getObject(object->getName(true), ObjectType::ObjTable, idx))) || + (obj_type==ObjectType::ObjTable && (getObject(object->getName(true), obj_type, idx) || + getObject(object->getName(true), ObjectType::ObjView, idx))) || + (obj_type==ObjectType::ObjExtension && (getObject(object->getName(false), obj_type, idx))) || (getObject(object->getSignature(), obj_type, idx))) { QString str_aux; str_aux=Exception::getErrorMessage(AsgDuplicatedObject) - .arg(object->getName(obj_type != ObjExtension)) + .arg(object->getName(obj_type != ObjectType::ObjExtension)) .arg(object->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); @@ -429,7 +429,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) try { - if(obj_type==ObjTextbox || obj_type==ObjBaseRelationship) + if(obj_type==ObjectType::ObjTextbox || obj_type==ObjectType::ObjBaseRelationship) object->getCodeDefinition(SchemaParser::XmlDefinition); else object->getCodeDefinition(SchemaParser::SqlDefinition); @@ -565,9 +565,9 @@ vector DatabaseModel::getObjects(BaseObject *schema) { vector *obj_list=nullptr, sel_list; vector::iterator itr, itr_end; - ObjectType types[]={ ObjFunction, ObjTable, ObjView, ObjDomain, - ObjAggregate, ObjOperator, ObjSequence, ObjConversion, - ObjType, ObjOpClass, ObjOpFamily, ObjCollation }; + ObjectType types[]={ ObjectType::ObjFunction, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjDomain, + ObjectType::ObjAggregate, ObjectType::ObjOperator, ObjectType::ObjSequence, ObjectType::ObjConversion, + ObjectType::ObjType, ObjectType::ObjOpClass, ObjectType::ObjOpFamily, ObjectType::ObjCollation }; unsigned i, count=sizeof(types)/sizeof(ObjectType); for(i=0; i < count; i++) @@ -654,7 +654,7 @@ unsigned DatabaseModel::getObjectCount(ObjectType obj_type) unsigned DatabaseModel::getMaxObjectCount(void) { - vector types = getObjectTypes(false, {ObjDatabase}); + vector types = getObjectTypes(false, {ObjectType::ObjDatabase}); unsigned count = 0, max = 0; for(auto &type : types) @@ -668,7 +668,7 @@ unsigned DatabaseModel::getMaxObjectCount(void) unsigned DatabaseModel::getObjectCount(void) { - vector types= getObjectTypes(false, {ObjDatabase}); + vector types= getObjectTypes(false, {ObjectType::ObjDatabase}); unsigned count=0; for(auto &type : types) @@ -716,14 +716,14 @@ QString DatabaseModel::getAuthor(void) void DatabaseModel::setProtected(bool value) { vector types = { - ObjBaseRelationship,ObjRelationship, ObjTable, ObjView, - ObjAggregate, ObjOperator, - ObjSequence, ObjConversion, - ObjCast, ObjOpFamily, ObjOpClass, - ObjBaseRelationship, ObjTextbox, - ObjDomain, ObjType, ObjFunction, - ObjLanguage, ObjTablespace, ObjRole, ObjCollation, - ObjExtension, ObjSchema, ObjPermission, ObjTag, ObjGenericSQL + ObjectType::ObjBaseRelationship,ObjectType::ObjRelationship, ObjectType::ObjTable, ObjectType::ObjView, + ObjectType::ObjAggregate, ObjectType::ObjOperator, + ObjectType::ObjSequence, ObjectType::ObjConversion, + ObjectType::ObjCast, ObjectType::ObjOpFamily, ObjectType::ObjOpClass, + ObjectType::ObjBaseRelationship, ObjectType::ObjTextbox, + ObjectType::ObjDomain, ObjectType::ObjType, ObjectType::ObjFunction, + ObjectType::ObjLanguage, ObjectType::ObjTablespace, ObjectType::ObjRole, ObjectType::ObjCollation, + ObjectType::ObjExtension, ObjectType::ObjSchema, ObjectType::ObjPermission, ObjectType::ObjTag, ObjectType::ObjGenericSQL }; for(auto &type : types) @@ -739,7 +739,7 @@ void DatabaseModel::setProtected(bool value) void DatabaseModel::destroyObjects(void) { - ObjectType graph_types[]={ ObjSchema, ObjBaseRelationship, ObjRelationship, ObjTable, ObjView }; + ObjectType graph_types[]={ ObjectType::ObjSchema, ObjectType::ObjBaseRelationship, ObjectType::ObjRelationship, ObjectType::ObjTable, ObjectType::ObjView }; BaseObject *object=nullptr; map objects; map::reverse_iterator ritr, ritr_end; @@ -780,7 +780,7 @@ void DatabaseModel::destroyObjects(void) ritr++; // We ignore the database itself as well table children objects - if(object->getObjectType() == ObjDatabase || + if(object->getObjectType() == ObjectType::ObjDatabase || TableObject::isTableObject(object->getObjectType())) continue; @@ -794,7 +794,7 @@ void DatabaseModel::destroyObjects(void) { __removeObject(object,-1,false); - if(object->getObjectType()==ObjRelationship) + if(object->getObjectType()==ObjectType::ObjRelationship) dynamic_cast(object)->destroyObjects(); } @@ -835,12 +835,12 @@ void DatabaseModel::addTable(Table *table, int obj_idx) Table *DatabaseModel::getTable(unsigned obj_idx) { - return(dynamic_cast
(getObject(obj_idx, ObjTable))); + return(dynamic_cast
(getObject(obj_idx, ObjectType::ObjTable))); } Table *DatabaseModel::getTable(const QString &name) { - return(dynamic_cast
(getObject(name, ObjTable))); + return(dynamic_cast
(getObject(name, ObjectType::ObjTable))); } void DatabaseModel::removeTable(Table *table, int obj_idx) @@ -872,12 +872,12 @@ void DatabaseModel::addSequence(Sequence *sequence, int obj_idx) Sequence *DatabaseModel::getSequence(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjSequence))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjSequence))); } Sequence *DatabaseModel::getSequence(const QString &name) { - return(dynamic_cast(getObject(name, ObjSequence))); + return(dynamic_cast(getObject(name, ObjectType::ObjSequence))); } void DatabaseModel::removeSequence(Sequence *sequence, int obj_idx) @@ -906,12 +906,12 @@ void DatabaseModel::addCollation(Collation *collation, int obj_idx) Collation *DatabaseModel::getCollation(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjCollation))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjCollation))); } Collation *DatabaseModel::getCollation(const QString &name) { - return(dynamic_cast(getObject(name, ObjCollation))); + return(dynamic_cast(getObject(name, ObjectType::ObjCollation))); } void DatabaseModel::removeCollation(Collation *collation, int obj_idx) @@ -943,12 +943,12 @@ void DatabaseModel::addExtension(Extension *extension, int obj_idx) Extension *DatabaseModel::getExtension(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjCollation))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjCollation))); } Extension *DatabaseModel::getExtension(const QString &name) { - return(dynamic_cast(getObject(name, ObjExtension))); + return(dynamic_cast(getObject(name, ObjectType::ObjExtension))); } void DatabaseModel::addTag(Tag *tag, int obj_idx) @@ -977,12 +977,12 @@ void DatabaseModel::removeTag(Tag *tag, int obj_idx) Tag *DatabaseModel::getTag(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjTag))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjTag))); } Tag *DatabaseModel::getTag(const QString &name) { - return(dynamic_cast(getObject(name, ObjTag))); + return(dynamic_cast(getObject(name, ObjectType::ObjTag))); } void DatabaseModel::addEventTrigger(EventTrigger *evnttrig, int obj_idx) @@ -1011,12 +1011,12 @@ void DatabaseModel::removeEventTrigger(EventTrigger *evnttrig, int obj_idx) EventTrigger *DatabaseModel::getEventTrigger(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjEventTrigger))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjEventTrigger))); } EventTrigger *DatabaseModel::getEventTrigger(const QString &name) { - return(dynamic_cast(getObject(name, ObjEventTrigger))); + return(dynamic_cast(getObject(name, ObjectType::ObjEventTrigger))); } void DatabaseModel::addGenericSQL(GenericSQL *genericsql, int obj_idx) @@ -1045,12 +1045,12 @@ void DatabaseModel::removeGenericSQL(GenericSQL *genericsql, int obj_idx) GenericSQL *DatabaseModel::getGenericSQL(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjGenericSQL))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjGenericSQL))); } GenericSQL *DatabaseModel::getGenericSQL(const QString &name) { - return(dynamic_cast(getObject(name, ObjGenericSQL))); + return(dynamic_cast(getObject(name, ObjectType::ObjGenericSQL))); } void DatabaseModel::removeExtension(Extension *extension, int obj_idx) @@ -1086,12 +1086,12 @@ void DatabaseModel::addView(View *view, int obj_idx) View *DatabaseModel::getView(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjView))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjView))); } View *DatabaseModel::getView(const QString &name) { - return(dynamic_cast(getObject(name, ObjView))); + return(dynamic_cast(getObject(name, ObjectType::ObjView))); } void DatabaseModel::removeView(View *view, int obj_idx) @@ -1186,7 +1186,7 @@ void DatabaseModel::updateTableFKRelationships(Table *table) /* Workaround: In some cases the combination of the two tablenames can generate a duplicated relationship name so it`s necessary to check if a relationship with the same name already exists. If exists changes the name of the new one */ - if(getObjectIndex(rel->getName(), ObjBaseRelationship) >= 0) + if(getObjectIndex(rel->getName(), ObjectType::ObjBaseRelationship) >= 0) rel->setName(PgModelerNs::generateUniqueName(rel, base_relationships)); addRelationship(rel); @@ -1255,7 +1255,7 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) if(rel->getTable(BaseRelationship::SrcTable)==view || rel->getTable(BaseRelationship::DstTable)==view) { - if(rel->getTable(BaseRelationship::SrcTable)->getObjectType()==ObjTable) + if(rel->getTable(BaseRelationship::SrcTable)->getObjectType()==ObjectType::ObjTable) tab=dynamic_cast
(rel->getTable(BaseRelationship::SrcTable)); else tab=dynamic_cast
(rel->getTable(BaseRelationship::DstTable)); @@ -1314,7 +1314,7 @@ void DatabaseModel::disconnectRelationships(void) ritr_rel++; base_rel->blockSignals(loading_model); - if(base_rel->getObjectType()==ObjRelationship) + if(base_rel->getObjectType()==ObjectType::ObjRelationship) { rel=dynamic_cast(base_rel); rel->disconnectRelationship(); @@ -1382,7 +1382,7 @@ void DatabaseModel::validateRelationships(void) itr++; //Validates only table-table relationships - if(base_rel->getObjectType()==ObjRelationship) + if(base_rel->getObjectType()==ObjectType::ObjRelationship) { //Makes a cast to the correct object class rel=dynamic_cast(base_rel); @@ -1674,7 +1674,7 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) base_rel=dynamic_cast(*itr); itr++; - if(base_rel->getObjectType()==ObjRelationship) + if(base_rel->getObjectType()==ObjectType::ObjRelationship) { rel_aux=dynamic_cast(base_rel); aux_rel_type=rel_aux->getRelationshipType(); @@ -1740,7 +1740,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) View *view=nullptr; BaseRelationship *rel=nullptr; Reference ref; - ObjectType tab_obj_type[3]={ ObjConstraint, ObjTrigger, ObjIndex }; + ObjectType tab_obj_type[3]={ ObjectType::ObjConstraint, ObjectType::ObjTrigger, ObjectType::ObjIndex }; bool found=false; vector objects, rem_objects, upd_tables_rels; @@ -1766,7 +1766,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) tab_obj=dynamic_cast(table->getObject(i, tab_obj_type[type_id])); found=false; - if(tab_obj_type[type_id]==ObjConstraint) + if(tab_obj_type[type_id]==ObjectType::ObjConstraint) { constr=dynamic_cast(tab_obj); @@ -1781,7 +1781,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) if(found) xml_special_objs[constr->getObjectId()]=constr->getCodeDefinition(SchemaParser::XmlDefinition, true); } - else if(tab_obj_type[type_id]==ObjTrigger) + else if(tab_obj_type[type_id]==ObjectType::ObjTrigger) { trigger=dynamic_cast(tab_obj); found=trigger->isReferRelationshipAddedColumn(); @@ -1944,16 +1944,16 @@ void DatabaseModel::createSpecialObject(const QString &xml_def, unsigned obj_id) //Identifies the object type through the start element on xml buffer obj_type=BaseObject::getObjectType(xmlparser.getElementName()); - if(obj_type==ObjSequence) + if(obj_type==ObjectType::ObjSequence) object=createSequence(true); else object=createObject(obj_type); - if(obj_type==ObjSequence) + if(obj_type==ObjectType::ObjSequence) addSequence(dynamic_cast(object)); - else if(obj_type==ObjView) + else if(obj_type==ObjectType::ObjView) addView(dynamic_cast(object)); - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) addPermission(createPermission()); /* When the special object is recreated it receive a new id but to maintain @@ -1996,13 +1996,13 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) } //Before add the relationship, checks if a redundancy can occur case the relationship is added - if(rel->getObjectType()==ObjRelationship) + if(rel->getObjectType()==ObjectType::ObjRelationship) checkRelationshipRedundancy(dynamic_cast(rel)); rel->blockSignals(loading_model); __addObject(rel, obj_idx); - if(rel->getObjectType()==ObjRelationship) + if(rel->getObjectType()==ObjectType::ObjRelationship) { dynamic_cast(rel)->connectRelationship(); validateRelationships(); @@ -2026,7 +2026,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) { Table *recv_tab=nullptr; - if(rel->getObjectType()==ObjRelationship) + if(rel->getObjectType()==ObjectType::ObjRelationship) { /* If the relationship is not a many-to-many we store the receiver table in order to update the fk relationships (if there are any) */ @@ -2036,7 +2036,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) storeSpecialObjectsXML(); disconnectRelationships(); } - else if(rel->getObjectType()==ObjBaseRelationship) + else if(rel->getObjectType()==ObjectType::ObjBaseRelationship) { rel->blockSignals(loading_model); rel->disconnectRelationship(); @@ -2045,7 +2045,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) __removeObject(rel, obj_idx); - if(rel->getObjectType()==ObjRelationship) + if(rel->getObjectType()==ObjectType::ObjRelationship) { validateRelationships(); } @@ -2064,7 +2064,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) BaseRelationship *DatabaseModel::getRelationship(unsigned obj_idx, ObjectType rel_type) { //Raises an error if the object type used to get a relationship is invalid - if(rel_type!=ObjRelationship && rel_type!=ObjBaseRelationship) + if(rel_type!=ObjectType::ObjRelationship && rel_type!=ObjectType::ObjBaseRelationship) throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(getObject(obj_idx, rel_type))); @@ -2072,10 +2072,10 @@ BaseRelationship *DatabaseModel::getRelationship(unsigned obj_idx, ObjectType re BaseRelationship *DatabaseModel::getRelationship(const QString &name) { - BaseRelationship *rel=dynamic_cast(getObject(name, ObjBaseRelationship)); + BaseRelationship *rel=dynamic_cast(getObject(name, ObjectType::ObjBaseRelationship)); if(!rel) - rel=dynamic_cast(getObject(name, ObjRelationship)); + rel=dynamic_cast(getObject(name, ObjectType::ObjRelationship)); return(rel); } @@ -2096,7 +2096,7 @@ BaseRelationship *DatabaseModel::getRelationship(BaseTable *src_tab, BaseTable * search_uniq_tab=true; } - if(ref_fk || src_tab->getObjectType()==ObjView || dst_tab->getObjectType()==ObjView) + if(ref_fk || src_tab->getObjectType()==ObjectType::ObjView || dst_tab->getObjectType()==ObjectType::ObjView) { itr=base_relationships.begin(); itr_end=base_relationships.end(); @@ -2175,12 +2175,12 @@ void DatabaseModel::removeTextbox(Textbox *txtbox, int obj_idx) Textbox *DatabaseModel::getTextbox(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjTextbox))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjTextbox))); } Textbox *DatabaseModel::getTextbox(const QString &name) { - return(dynamic_cast(getObject(name, ObjTextbox))); + return(dynamic_cast(getObject(name, ObjectType::ObjTextbox))); } void DatabaseModel::addSchema(Schema *schema, int obj_idx) @@ -2197,12 +2197,12 @@ void DatabaseModel::addSchema(Schema *schema, int obj_idx) Schema *DatabaseModel::getSchema(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjSchema))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjSchema))); } Schema *DatabaseModel::getSchema(const QString &name) { - return(dynamic_cast(getObject(name, ObjSchema))); + return(dynamic_cast(getObject(name, ObjectType::ObjSchema))); } void DatabaseModel::removeSchema(Schema *schema, int obj_idx) @@ -2231,12 +2231,12 @@ void DatabaseModel::addRole(Role *role, int obj_idx) Role *DatabaseModel::getRole(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjRole))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjRole))); } Role *DatabaseModel::getRole(const QString &name) { - return(dynamic_cast(getObject(name, ObjRole))); + return(dynamic_cast(getObject(name, ObjectType::ObjRole))); } void DatabaseModel::removeRole(Role *role, int obj_idx) @@ -2265,12 +2265,12 @@ void DatabaseModel::addTablespace(Tablespace *tabspc, int obj_idx) Tablespace *DatabaseModel::getTablespace(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjTablespace))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjTablespace))); } Tablespace *DatabaseModel::getTablespace(const QString &name) { - return(dynamic_cast(getObject(name, ObjTablespace))); + return(dynamic_cast(getObject(name, ObjectType::ObjTablespace))); } void DatabaseModel::removeTablespace(Tablespace *tabspc, int obj_idx) @@ -2311,12 +2311,12 @@ void DatabaseModel::removeCast(Cast *cast, int obj_idx) Cast *DatabaseModel::getCast(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjCast))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjCast))); } Cast *DatabaseModel::getCast(const QString &name) { - return(dynamic_cast(getObject(name, ObjCast))); + return(dynamic_cast(getObject(name, ObjectType::ObjCast))); } void DatabaseModel::addConversion(Conversion *conv, int obj_idx) @@ -2346,12 +2346,12 @@ void DatabaseModel::removeConversion(Conversion *conv, int obj_idx) Conversion *DatabaseModel::getConversion(unsigned obj_idx) { return(dynamic_cast(getObject(obj_idx, - ObjConversion))); + ObjectType::ObjConversion))); } Conversion *DatabaseModel::getConversion(const QString &name) { - return(dynamic_cast(getObject(name, ObjConversion))); + return(dynamic_cast(getObject(name, ObjectType::ObjConversion))); } void DatabaseModel::addLanguage(Language *lang, int obj_idx) @@ -2368,12 +2368,12 @@ void DatabaseModel::addLanguage(Language *lang, int obj_idx) Language *DatabaseModel::getLanguage(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjLanguage))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjLanguage))); } Language *DatabaseModel::getLanguage(const QString &name) { - return(dynamic_cast(getObject(name, ObjLanguage))); + return(dynamic_cast(getObject(name, ObjectType::ObjLanguage))); } void DatabaseModel::removeLanguage(Language *lang, int obj_idx) @@ -2402,12 +2402,12 @@ void DatabaseModel::addFunction(Function *func, int obj_idx) Function *DatabaseModel::getFunction(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjFunction))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjFunction))); } Function *DatabaseModel::getFunction(const QString &signature) { - return(dynamic_cast(getObject(signature, ObjFunction))); + return(dynamic_cast(getObject(signature, ObjectType::ObjFunction))); } void DatabaseModel::removeFunction(Function *func, int obj_idx) @@ -2436,12 +2436,12 @@ void DatabaseModel::addAggregate(Aggregate *aggreg, int obj_idx) Aggregate *DatabaseModel::getAggregate(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjAggregate))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjAggregate))); } Aggregate *DatabaseModel::getAggregate(const QString &name) { - return(dynamic_cast(getObject(name, ObjAggregate))); + return(dynamic_cast(getObject(name, ObjectType::ObjAggregate))); } void DatabaseModel::removeAggregate(Aggregate *aggreg, int obj_idx) @@ -2513,12 +2513,12 @@ void DatabaseModel::removeDomain(Domain *domain, int obj_idx) Domain *DatabaseModel::getDomain(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjDomain))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjDomain))); } Domain *DatabaseModel::getDomain(const QString &name) { - return(dynamic_cast(getObject(name, ObjDomain))); + return(dynamic_cast(getObject(name, ObjectType::ObjDomain))); } void DatabaseModel::addOperatorFamily(OperatorFamily *op_family, int obj_idx) @@ -2535,12 +2535,12 @@ void DatabaseModel::addOperatorFamily(OperatorFamily *op_family, int obj_idx) OperatorFamily *DatabaseModel::getOperatorFamily(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjOpFamily))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjOpFamily))); } OperatorFamily *DatabaseModel::getOperatorFamily(const QString &name) { - return(dynamic_cast(getObject(name, ObjOpFamily))); + return(dynamic_cast(getObject(name, ObjectType::ObjOpFamily))); } void DatabaseModel::removeOperatorFamily(OperatorFamily *op_family, int obj_idx) @@ -2581,12 +2581,12 @@ void DatabaseModel::removeOperatorClass(OperatorClass *op_class, int obj_idx) OperatorClass *DatabaseModel::getOperatorClass(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjOpClass))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjOpClass))); } OperatorClass *DatabaseModel::getOperatorClass(const QString &name) { - return(dynamic_cast(getObject(name, ObjOpClass))); + return(dynamic_cast(getObject(name, ObjectType::ObjOpClass))); } void DatabaseModel::addOperator(Operator *oper, int obj_idx) @@ -2615,12 +2615,12 @@ void DatabaseModel::removeOperator(Operator *oper, int obj_idx) Operator *DatabaseModel::getOperator(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjOperator))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjOperator))); } Operator *DatabaseModel::getOperator(const QString &signature) { - return(dynamic_cast(getObject(signature, ObjOperator))); + return(dynamic_cast(getObject(signature, ObjectType::ObjOperator))); } void DatabaseModel::addType(Type *type, int obj_idx) @@ -2679,12 +2679,12 @@ void DatabaseModel::removeType(Type *type, int obj_idx) Type *DatabaseModel::getType(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjType))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjType))); } Type *DatabaseModel::getType(const QString &name) { - return(dynamic_cast(getObject(name, ObjType))); + return(dynamic_cast(getObject(name, ObjectType::ObjType))); } void DatabaseModel::removeUserType(BaseObject *object, int obj_idx) @@ -3026,10 +3026,10 @@ void DatabaseModel::loadModel(const QString &filename) protected_model=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_); - def_objs[ObjSchema]=attribs[ParsersAttributes::DEFAULT_SCHEMA]; - def_objs[ObjRole]=attribs[ParsersAttributes::DEFAULT_OWNER]; - def_objs[ObjCollation]=attribs[ParsersAttributes::DEFAULT_COLLATION]; - def_objs[ObjTablespace]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; + def_objs[ObjectType::ObjSchema]=attribs[ParsersAttributes::DEFAULT_SCHEMA]; + def_objs[ObjectType::ObjRole]=attribs[ParsersAttributes::DEFAULT_OWNER]; + def_objs[ObjectType::ObjCollation]=attribs[ParsersAttributes::DEFAULT_COLLATION]; + def_objs[ObjectType::ObjTablespace]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3042,7 +3042,7 @@ void DatabaseModel::loadModel(const QString &filename) //Indentifies the object type to be load according to the current element on the parser obj_type=getObjectType(elem_name); - if(obj_type==ObjDatabase) + if(obj_type==ObjectType::ObjDatabase) { xmlparser.getElementAttributes(attribs); configureDatabase(attribs); @@ -3057,12 +3057,12 @@ void DatabaseModel::loadModel(const QString &filename) if(object) { - if(!dynamic_cast(object) && obj_type!=ObjRelationship && obj_type!=ObjBaseRelationship) + if(!dynamic_cast(object) && obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjBaseRelationship) addObject(object); /* If there is at least one inheritance relationship we need to flag this situation in order to do an addtional rel. validation in the end of loading */ - if(!found_inh_rel && object->getObjectType()==ObjRelationship && + if(!found_inh_rel && object->getObjectType()==ObjectType::ObjRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipGen) found_inh_rel=true; @@ -3114,7 +3114,7 @@ void DatabaseModel::loadModel(const QString &filename) //If there are relationship make a relationship validation to recreate any special object left behind if(!relationships.empty()) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjRelationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjectType::ObjRelationship); storeSpecialObjectsXML(); disconnectRelationships(); validateRelationships(); @@ -3122,13 +3122,13 @@ void DatabaseModel::loadModel(const QString &filename) this->setInvalidated(false); - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjRelationship); - this->setObjectsModified({ObjRelationship, ObjBaseRelationship}); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjectType::ObjRelationship); + this->setObjectsModified({ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship}); //Doing another relationship validation when there are inheritances to avoid incomplete tables if(found_inh_rel) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjRelationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjectType::ObjRelationship); validateRelationships(); updateTablesFKRelationships(); } @@ -3156,68 +3156,68 @@ BaseObject *DatabaseModel::createObject(ObjectType obj_type) { BaseObject *object=nullptr; - if(obj_type!=ObjBaseObject) + if(obj_type!=ObjectType::ObjBaseObject) { - if(obj_type==ObjRole) + if(obj_type==ObjectType::ObjRole) object=createRole(); - else if(obj_type==ObjTablespace) + else if(obj_type==ObjectType::ObjTablespace) object=createTablespace(); - else if(obj_type==ObjSchema) + else if(obj_type==ObjectType::ObjSchema) object=createSchema(); - else if(obj_type==ObjLanguage) + else if(obj_type==ObjectType::ObjLanguage) object=createLanguage(); - else if(obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjFunction) object=createFunction(); - else if(obj_type==ObjType) + else if(obj_type==ObjectType::ObjType) object=createType(); - else if(obj_type==ObjDomain) + else if(obj_type==ObjectType::ObjDomain) object=createDomain(); - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) object=createCast(); - else if(obj_type==ObjConversion) + else if(obj_type==ObjectType::ObjConversion) object=createConversion(); - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) object=createOperator(); - else if(obj_type==ObjOpFamily) + else if(obj_type==ObjectType::ObjOpFamily) object=createOperatorFamily(); - else if(obj_type==ObjOpClass) + else if(obj_type==ObjectType::ObjOpClass) object=createOperatorClass(); - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) object=createAggregate(); - else if(obj_type==ObjTable) + else if(obj_type==ObjectType::ObjTable) object=createTable(); - else if(obj_type==ObjSequence) + else if(obj_type==ObjectType::ObjSequence) object=createSequence(); - else if(obj_type==ObjView) + else if(obj_type==ObjectType::ObjView) object=createView(); - else if(obj_type==ObjTextbox) + else if(obj_type==ObjectType::ObjTextbox) object=createTextbox(); - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) object=createConstraint(nullptr); - else if(obj_type==ObjTrigger) + else if(obj_type==ObjectType::ObjTrigger) object=createTrigger(); - else if(obj_type==ObjIndex) + else if(obj_type==ObjectType::ObjIndex) object=createIndex(); - else if(obj_type==ObjColumn) + else if(obj_type==ObjectType::ObjColumn) object=createColumn(); - else if(obj_type==ObjRule) + else if(obj_type==ObjectType::ObjRule) object=createRule(); - else if(obj_type==ObjRelationship || - obj_type==ObjBaseRelationship) + else if(obj_type==ObjectType::ObjRelationship || + obj_type==ObjectType::ObjBaseRelationship) object=createRelationship(); - else if(obj_type==ObjCollation) + else if(obj_type==ObjectType::ObjCollation) object=createCollation(); - else if(obj_type==ObjExtension) + else if(obj_type==ObjectType::ObjExtension) object=createExtension(); - else if(obj_type==ObjTag) + else if(obj_type==ObjectType::ObjTag) object=createTag(); - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) object=createPermission(); - else if(obj_type==ObjEventTrigger) + else if(obj_type==ObjectType::ObjEventTrigger) object=createEventTrigger(); - else if(obj_type==ObjGenericSQL) + else if(obj_type==ObjectType::ObjGenericSQL) object=createGenericSQL(); - else if(obj_type==ObjPolicy) + else if(obj_type==ObjectType::ObjPolicy) object=createPolicy(); } @@ -3230,7 +3230,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) QString elem_name; BaseObject *tabspc=nullptr, *owner=nullptr, *collation=nullptr; Schema *schema=nullptr; - ObjectType obj_type=ObjBaseObject, obj_type_aux; + ObjectType obj_type=ObjectType::ObjBaseObject, obj_type_aux; bool has_error=false, protected_obj=false, sql_disabled=false; if(!object) @@ -3240,7 +3240,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) obj_type_aux=object->getObjectType(); - if(obj_type_aux!=ObjCast) + if(obj_type_aux!=ObjectType::ObjCast) object->setName(attribs[ParsersAttributes::NAME]); if(BaseObject::acceptsAlias(obj_type_aux)) @@ -3270,7 +3270,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's schema else if(elem_name==ParsersAttributes::SCHEMA) { - obj_type=ObjSchema; + obj_type=ObjectType::ObjSchema; xmlparser.getElementAttributes(attribs_aux); schema=dynamic_cast(getObject(attribs_aux[ParsersAttributes::NAME], obj_type)); object->setSchema(schema); @@ -3279,7 +3279,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's tablespace else if(elem_name==ParsersAttributes::TABLESPACE) { - obj_type=ObjTablespace; + obj_type=ObjectType::ObjTablespace; xmlparser.getElementAttributes(attribs_aux); tabspc=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setTablespace(tabspc); @@ -3288,7 +3288,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's owner else if(elem_name==ParsersAttributes::ROLE) { - obj_type=ObjRole; + obj_type=ObjectType::ObjRole; xmlparser.getElementAttributes(attribs_aux); owner=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setOwner(owner); @@ -3297,7 +3297,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's schema else if(elem_name==ParsersAttributes::COLLATION) { - obj_type=ObjCollation; + obj_type=ObjectType::ObjCollation; xmlparser.getElementAttributes(attribs_aux); collation=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setCollation(collation); @@ -3323,8 +3323,8 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.getElementAttributes(attribs); if(elem_name==ParsersAttributes::POSITION && - (obj_type_aux!=ObjRelationship && - obj_type_aux!=ObjBaseRelationship)) + (obj_type_aux!=ObjectType::ObjRelationship && + obj_type_aux!=ObjectType::ObjBaseRelationship)) { dynamic_cast(object)->setPosition(QPointF(attribs[ParsersAttributes::X_POS].toDouble(), attribs[ParsersAttributes::Y_POS].toDouble())); @@ -3351,12 +3351,12 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!object->getSchema() && - (obj_type_aux==ObjFunction || obj_type_aux==ObjTable || - obj_type_aux==ObjView || obj_type_aux==ObjDomain || - obj_type_aux==ObjAggregate || obj_type_aux==ObjOperator || - obj_type_aux==ObjSequence || obj_type_aux==ObjConversion || - obj_type_aux==ObjType || obj_type_aux==ObjOpFamily || - obj_type_aux==ObjOpClass)) + (obj_type_aux==ObjectType::ObjFunction || obj_type_aux==ObjectType::ObjTable || + obj_type_aux==ObjectType::ObjView || obj_type_aux==ObjectType::ObjDomain || + obj_type_aux==ObjectType::ObjAggregate || obj_type_aux==ObjectType::ObjOperator || + obj_type_aux==ObjectType::ObjSequence || obj_type_aux==ObjectType::ObjConversion || + obj_type_aux==ObjectType::ObjType || obj_type_aux==ObjectType::ObjOpFamily || + obj_type_aux==ObjectType::ObjOpClass)) { throw Exception(Exception::getErrorMessage(InvObjectAllocationNoSchema) .arg(object->getName()) @@ -3508,16 +3508,16 @@ Role *DatabaseModel::createRole(void) for(i=0; i < len; i++) { //Gets the role using the name from the model using the name from the list - ref_role=dynamic_cast(getObject(list[i].trimmed(),ObjRole)); + ref_role=dynamic_cast(getObject(list[i].trimmed(),ObjectType::ObjRole)); //Raises an error if the roles doesn't exists if(!ref_role) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(role->getName()) - .arg(BaseObject::getTypeName(ObjRole)) + .arg(BaseObject::getTypeName(ObjectType::ObjRole)) .arg(list[i]) - .arg(BaseObject::getTypeName(ObjRole)), + .arg(BaseObject::getTypeName(ObjectType::ObjRole)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -3606,7 +3606,7 @@ Language *DatabaseModel::createLanguage(void) { obj_type=BaseObject::getObjectType(xmlparser.getElementName()); - if(obj_type==ObjFunction) + if(obj_type==ObjectType::ObjFunction) { xmlparser.getElementAttributes(attribs); @@ -3620,7 +3620,7 @@ Language *DatabaseModel::createLanguage(void) { //Gets the function signature and tries to retrieve it from the model signature=attribs[ParsersAttributes::SIGNATURE]; - func=getObject(signature, ObjFunction); + func=getObject(signature, ObjectType::ObjFunction); //Raises an error if the function doesn't exists if(!func) @@ -3628,7 +3628,7 @@ Language *DatabaseModel::createLanguage(void) .arg(lang->getName()) .arg(lang->getTypeName()) .arg(signature) - .arg(BaseObject::getTypeName(ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(ref_type==ParsersAttributes::VALIDATOR_FUNC) @@ -3748,7 +3748,7 @@ Function *DatabaseModel::createFunction(void) } } //Gets the function language - else if(obj_type==ObjLanguage) + else if(obj_type==ObjectType::ObjLanguage) { xmlparser.getElementAttributes(attribs); object=getObject(attribs[ParsersAttributes::NAME], obj_type); @@ -3759,7 +3759,7 @@ Function *DatabaseModel::createFunction(void) .arg(func->getName()) .arg(func->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjLanguage)), + .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); func->setLanguage(dynamic_cast(object)); @@ -3802,7 +3802,7 @@ Function *DatabaseModel::createFunction(void) if(e.getErrorType()==RefUserTypeInexistsModel) throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) .arg(str_aux) - .arg(BaseObject::getTypeName(ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); @@ -3888,7 +3888,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[ParsersAttributes::NAME], ObjCollation); + collation=getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjCollation); //Raises an error if the operator class doesn't exists if(!collation) @@ -3897,7 +3897,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) .arg(tpattrib.getName()) .arg(tpattrib.getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4080,7 +4080,7 @@ Type *DatabaseModel::createType(void) else if(elem==ParsersAttributes::COLLATION) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[ParsersAttributes::NAME], ObjCollation); + collation=getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjCollation); //Raises an error if the operator class doesn't exists if(!collation) @@ -4089,7 +4089,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4098,7 +4098,7 @@ Type *DatabaseModel::createType(void) if(elem==ParsersAttributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjOpClass)); + op_class=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjOpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -4107,7 +4107,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjOpClass)), + .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4119,7 +4119,7 @@ Type *DatabaseModel::createType(void) xmlparser.getElementAttributes(attribs); //Tries to get the function from the model - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4127,7 +4127,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the function type is invalid else if(func_types.count(attribs[ParsersAttributes::REF_TYPE])==0) @@ -4259,7 +4259,7 @@ Cast *DatabaseModel::createCast(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4267,7 +4267,7 @@ Cast *DatabaseModel::createCast(void) .arg(cast->getName()) .arg(cast->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); cast->setCastFunction(dynamic_cast(func)); @@ -4318,7 +4318,7 @@ Conversion *DatabaseModel::createConversion(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4326,7 +4326,7 @@ Conversion *DatabaseModel::createConversion(void) .arg(conv->getName()) .arg(conv->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); conv->setConversionFunction(dynamic_cast(func)); @@ -4380,10 +4380,10 @@ Operator *DatabaseModel::createOperator(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[ObjOperator]) + if(elem==objs_schemas[ObjectType::ObjOperator]) { xmlparser.getElementAttributes(attribs); - oper_aux=getObject(attribs[ParsersAttributes::SIGNATURE], ObjOperator); + oper_aux=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOperator); //Raises an error if the auxiliary operator doesn't exists if(!oper_aux && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4391,7 +4391,7 @@ Operator *DatabaseModel::createOperator(void) .arg(oper->getSignature(true)) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setOperator(dynamic_cast(oper_aux), @@ -4412,7 +4412,7 @@ Operator *DatabaseModel::createOperator(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4420,7 +4420,7 @@ Operator *DatabaseModel::createOperator(void) .arg(oper->getName()) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setFunction(dynamic_cast(func), @@ -4472,10 +4472,10 @@ OperatorClass *DatabaseModel::createOperatorClass(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[ObjOpFamily]) + if(elem==objs_schemas[ObjectType::ObjOpFamily]) { xmlparser.getElementAttributes(attribs); - object=getObject(attribs[ParsersAttributes::SIGNATURE], ObjOpFamily); + object=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOpFamily); //Raises an error if the operator family doesn't exists if(!object) @@ -4483,7 +4483,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjOpFamily)), + .arg(BaseObject::getTypeName(ObjectType::ObjOpFamily)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); op_class->setFamily(dynamic_cast(object)); @@ -4512,12 +4512,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) } else if(elem_type==OperatorClassElement::FunctionElem) { - object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjFunction); + object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjectType::ObjFunction); class_elem.setFunction(dynamic_cast(object),stg_number); } else if(elem_type==OperatorClassElement::OperatorElem) { - object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjOperator); + object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjectType::ObjOperator); class_elem.setOperator(dynamic_cast(object),stg_number); if(xmlparser.hasElement(XmlParser::NextElement)) @@ -4526,14 +4526,14 @@ OperatorClass *DatabaseModel::createOperatorClass(void) xmlparser.accessElement(XmlParser::NextElement); xmlparser.getElementAttributes(attribs_aux); - object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjOpFamily); + object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjectType::ObjOpFamily); if(!object && !attribs_aux[ParsersAttributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs_aux[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjOpFamily)), + .arg(BaseObject::getTypeName(ObjectType::ObjOpFamily)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); class_elem.setOperatorFamily(dynamic_cast(object)); @@ -4616,7 +4616,7 @@ Aggregate *DatabaseModel::createAggregate(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4624,7 +4624,7 @@ Aggregate *DatabaseModel::createAggregate(void) .arg(aggreg->getName()) .arg(aggreg->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::TRANSITION_FUNC) @@ -4686,22 +4686,22 @@ Table *DatabaseModel::createTable(void) xmlparser.savePosition(); object=nullptr; - if(elem==BaseObject::objs_schemas[ObjColumn]) + if(elem==BaseObject::objs_schemas[ObjectType::ObjColumn]) object=createColumn(); - else if(elem==BaseObject::objs_schemas[ObjConstraint]) + else if(elem==BaseObject::objs_schemas[ObjectType::ObjConstraint]) object=createConstraint(table); - else if(elem==BaseObject::objs_schemas[ObjTag]) + else if(elem==BaseObject::objs_schemas[ObjectType::ObjTag]) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjTag); + tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjectType::ObjTag); if(!tag) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjTable)) + .arg(BaseObject::getTypeName(ObjectType::ObjTable)) .arg(aux_attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjTag)) + .arg(BaseObject::getTypeName(ObjectType::ObjTag)) , RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4820,14 +4820,14 @@ Column *DatabaseModel::createColumn(void) if(!attribs[ParsersAttributes::SEQUENCE].isEmpty()) { - seq=getObject(attribs[ParsersAttributes::SEQUENCE], ObjSequence); + seq=getObject(attribs[ParsersAttributes::SEQUENCE], ObjectType::ObjSequence); if(!seq) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjColumn)) + .arg(BaseObject::getTypeName(ObjectType::ObjColumn)) .arg(attribs[ParsersAttributes::SEQUENCE]) - .arg(BaseObject::getTypeName(ObjSequence)), + .arg(BaseObject::getTypeName(ObjectType::ObjSequence)), PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4887,9 +4887,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) obj_type=parent_obj->getObjectType(); //Identifies the correct parent type - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) table=dynamic_cast
(parent_obj); - else if(obj_type==ObjRelationship) + else if(obj_type==ObjectType::ObjRelationship) rel=dynamic_cast(parent_obj); else //Raises an error if the user tries to create a constraint in a invalid parent @@ -4897,8 +4897,8 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) } else { - obj_type=ObjTable; - table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); + obj_type=ObjectType::ObjTable; + table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); parent_obj=table; ins_constr_table=true; @@ -4907,9 +4907,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjConstraint)) + .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4960,7 +4960,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(!attribs[ParsersAttributes::UPD_ACTION].isEmpty()) constr->setActionType(attribs[ParsersAttributes::UPD_ACTION], Constraint::UpdateAction); - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjTable); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::ObjTable); if(!ref_table && table->getName(true)==attribs[ParsersAttributes::REF_TABLE]) ref_table=table; @@ -4972,7 +4972,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) .arg(constr->getName()) .arg(constr->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) - .arg(BaseObject::getTypeName(ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5026,7 +5026,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { if(col_type==Constraint::SourceCols) { - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) { column=table->getColumn(col_list[i]); @@ -5035,7 +5035,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) column=table->getColumn(col_list[i], true); } else - column=dynamic_cast(rel->getObject(col_list[i], ObjColumn)); + column=dynamic_cast(rel->getObject(col_list[i], ObjectType::ObjColumn)); } else { @@ -5112,7 +5112,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec if(xml_elem==ParsersAttributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjOpClass)); + op_class=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -5123,7 +5123,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjOpClass)), + .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5131,7 +5131,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjOpClass)), + .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5142,7 +5142,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==ParsersAttributes::OPERATOR) { xmlparser.getElementAttributes(attribs); - oper=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjOperator)); + oper=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOperator)); //Raises an error if the operator doesn't exists if(!oper) @@ -5151,7 +5151,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5160,7 +5160,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==ParsersAttributes::COLLATION) { xmlparser.getElementAttributes(attribs); - collation=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjCollation)); + collation=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjCollation)); //Raises an error if the operator class doesn't exists if(!collation) @@ -5171,7 +5171,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5179,7 +5179,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5190,7 +5190,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { xmlparser.getElementAttributes(attribs); - if(parent_obj->getObjectType()==ObjTable) + if(parent_obj->getObjectType()==ObjectType::ObjTable) { column=dynamic_cast
(parent_obj)->getColumn(attribs[ParsersAttributes::NAME]); @@ -5199,7 +5199,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec } else { - column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[ParsersAttributes::NAME], ObjColumn)); + column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjColumn)); } //Raises an error if the column doesn't exists @@ -5211,7 +5211,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjColumn)), + .arg(BaseObject::getTypeName(ObjectType::ObjColumn)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5219,7 +5219,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjColumn)), + .arg(BaseObject::getTypeName(ObjectType::ObjColumn)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5293,19 +5293,19 @@ Index *DatabaseModel::createIndex(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjView)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView)); //Raises an error if the parent table doesn't exists if(!table) { str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjIndex)) + .arg(BaseObject::getTypeName(ObjectType::ObjIndex)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5374,17 +5374,17 @@ Rule *DatabaseModel::createRule(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjView)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView)); if(!table) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjRule)) + .arg(BaseObject::getTypeName(ObjectType::ObjRule)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::ObjTable)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5453,17 +5453,17 @@ Trigger *DatabaseModel::createTrigger(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjView)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView)); if(!table) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjTrigger)) + .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::ObjTable)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5508,10 +5508,10 @@ Trigger *DatabaseModel::createTrigger(void) if(!attribs[ParsersAttributes::REF_TABLE].isEmpty()) { - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjTable); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::ObjTable); if(!ref_table) - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjView); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::ObjView); //Raises an error if the trigger is referencing a inexistent table if(!ref_table) @@ -5520,7 +5520,7 @@ Trigger *DatabaseModel::createTrigger(void) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) - .arg(BaseObject::getTypeName(ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::ObjTable)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5538,7 +5538,7 @@ Trigger *DatabaseModel::createTrigger(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -5547,7 +5547,7 @@ Trigger *DatabaseModel::createTrigger(void) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjFunction)); + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5571,7 +5571,7 @@ Trigger *DatabaseModel::createTrigger(void) for(i=0; i < count; i++) { - column=dynamic_cast(table->getObject(list_aux[i].trimmed(), ObjColumn)); + column=dynamic_cast(table->getObject(list_aux[i].trimmed(), ObjectType::ObjColumn)); if(!column && dynamic_cast
(table)) column=dynamic_cast
(table)->getColumn(list_aux[i].trimmed(), true); @@ -5610,14 +5610,14 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); if(!table) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjPolicy)) + .arg(BaseObject::getTypeName(ObjectType::ObjPolicy)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::ObjTable)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::_TRUE_); @@ -5655,7 +5655,7 @@ Policy *DatabaseModel::createPolicy(void) for(auto &name : rol_names) { - role=dynamic_cast(getObject(name.trimmed(), ObjRole)); + role=dynamic_cast(getObject(name.trimmed(), ObjectType::ObjRole)); //Raises an error if the referenced role doesn't exists if(!role) @@ -5664,7 +5664,7 @@ Policy *DatabaseModel::createPolicy(void) .arg(policy->getName()) .arg(policy->getTypeName()) .arg(name) - .arg(BaseObject::getTypeName(ObjRole)), + .arg(BaseObject::getTypeName(ObjectType::ObjRole)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5713,7 +5713,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -5722,7 +5722,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) .arg(event_trig->getName()) .arg(event_trig->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5817,16 +5817,16 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) col_name=elem_list[1]; } - table=getObject(tab_name, ObjTable); + table=getObject(tab_name, ObjectType::ObjTable); //Raises an error if the column parent table doesn't exists if(!table) { str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(sequence->getName()) - .arg(BaseObject::getTypeName(ObjSequence)) + .arg(BaseObject::getTypeName(ObjectType::ObjSequence)) .arg(tab_name) - .arg(BaseObject::getTypeName(ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5898,16 +5898,16 @@ View *DatabaseModel::createView(void) if(!attribs[ParsersAttributes::TABLE].isEmpty()) { column=nullptr; - table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjTable)); + table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); //Raises an error if the table doesn't exists if(!table) { str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(view->getName()) - .arg(BaseObject::getTypeName(ObjView)) + .arg(BaseObject::getTypeName(ObjectType::ObjView)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::ObjTable)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5924,10 +5924,10 @@ View *DatabaseModel::createView(void) { str_aux=Exception::getErrorMessage(RefObjectInexistsModel) .arg(view->getName()) - .arg(BaseObject::getTypeName(ObjView)) + .arg(BaseObject::getTypeName(ObjectType::ObjView)) .arg(attribs[ParsersAttributes::TABLE] + QString(".") + attribs[ParsersAttributes::COLUMN]) - .arg(BaseObject::getTypeName(ObjColumn)); + .arg(BaseObject::getTypeName(ObjectType::ObjColumn)); throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5990,18 +5990,18 @@ View *DatabaseModel::createView(void) xmlparser.restorePosition(); } - else if(elem==BaseObject::getSchemaName(ObjTag)) + else if(elem==BaseObject::getSchemaName(ObjectType::ObjTag)) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjTag); + tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjectType::ObjTag); if(!tag) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjTable)) + .arg(BaseObject::getTypeName(ObjectType::ObjTable)) .arg(aux_attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjTag)) + .arg(BaseObject::getTypeName(ObjectType::ObjTag)) , RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6066,16 +6066,16 @@ Collation *DatabaseModel::createCollation(void) //Creating a collation from another collation else if(!attribs[ParsersAttributes::COLLATION].isEmpty()) { - copy_coll=this->getObject(attribs[ParsersAttributes::COLLATION], ObjCollation); + copy_coll=this->getObject(attribs[ParsersAttributes::COLLATION], ObjectType::ObjCollation); //Raises an error if the copy collation doesn't exists if(!copy_coll) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) .arg(collation->getName()) - .arg(BaseObject::getTypeName(ObjCollation)) + .arg(BaseObject::getTypeName(ObjectType::ObjCollation)) .arg(attribs[ParsersAttributes::COLLATION]) - .arg(BaseObject::getTypeName(ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6203,7 +6203,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) DeferralType defer_type; ActionType del_action, upd_action; unsigned rel_type=0, i; - ObjectType table_types[2]={ObjView, ObjTable}, obj_rel_type; + ObjectType table_types[2]={ObjectType::ObjView, ObjectType::ObjTable}, obj_rel_type; QString str_aux, elem, tab_attribs[2]={ ParsersAttributes::SRC_TABLE, ParsersAttributes::DST_TABLE }; @@ -6226,15 +6226,15 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(attribs[ParsersAttributes::TYPE]!=ParsersAttributes::RELATION_TAB_VIEW && attribs[ParsersAttributes::TYPE]!=ParsersAttributes::RELATIONSHIP_FK) { - table_types[0]=ObjTable; - obj_rel_type=ObjRelationship; + table_types[0]=ObjectType::ObjTable; + obj_rel_type=ObjectType::ObjRelationship; } else { if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_FK) - table_types[0]=ObjTable; + table_types[0]=ObjectType::ObjTable; - obj_rel_type=ObjBaseRelationship; + obj_rel_type=ObjectType::ObjBaseRelationship; } //Gets the participant tables @@ -6255,7 +6255,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } } - if(obj_rel_type==ObjBaseRelationship) + if(obj_rel_type==ObjectType::ObjBaseRelationship) { base_rel=getRelationship(tables[0], tables[1]); @@ -6306,7 +6306,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) .arg(this->getName()) .arg(this->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjBaseRelationship)), + .arg(BaseObject::getTypeName(ObjectType::ObjBaseRelationship)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); base_rel->blockSignals(loading_model); @@ -6466,7 +6466,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } catch(Exception &e) { - if(base_rel && base_rel->getObjectType()==ObjRelationship) + if(base_rel && base_rel->getObjectType()==ObjectType::ObjRelationship) delete(base_rel); throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); @@ -6484,7 +6484,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) /* If the FK relationship does not reference a foreign key (models generated in older versions) * we need to assign them to the respective relationships */ - if(base_rel && base_rel->getObjectType()==ObjBaseRelationship) + if(base_rel && base_rel->getObjectType()==ObjectType::ObjBaseRelationship) { base_rel->blockSignals(loading_model); base_rel->connectRelationship(); @@ -6523,14 +6523,14 @@ Permission *DatabaseModel::createPermission(void) parent_name=attribs[ParsersAttributes::PARENT]; //If the object is a column its needed to get the parent table - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { - parent_table=dynamic_cast
(getObject(parent_name, ObjTable)); + parent_table=dynamic_cast
(getObject(parent_name, ObjectType::ObjTable)); if(parent_table) object=parent_table->getColumn(obj_name); } - else if(obj_type==ObjDatabase) + else if(obj_type==ObjectType::ObjDatabase) { object=this; } @@ -6559,14 +6559,14 @@ Permission *DatabaseModel::createPermission(void) for(i=0; i < len; i++) { - role=dynamic_cast(getObject(list[i].trimmed(),ObjRole)); + role=dynamic_cast(getObject(list[i].trimmed(),ObjectType::ObjRole)); //Raises an error if the referenced role doesn't exists if(!role) { throw Exception(Exception::getErrorMessage(PermissionRefInexistObject) .arg(list[i]) - .arg(BaseObject::getTypeName(ObjRole)), + .arg(BaseObject::getTypeName(ObjectType::ObjRole)), RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6667,15 +6667,15 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab > Case the object is a column and its reference by the parent table primary key > Case the parent table is a partition and a column is being removed > Case the object is a constraint and its a table primary key */ - revalidate_rels=((obj_type==ObjColumn && + revalidate_rels=((obj_type==ObjectType::ObjColumn && (parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::primary_key) || parent_tab->isPartition() || parent_tab->isPartitioned())) || - (obj_type==ObjConstraint && + (obj_type==ObjectType::ObjConstraint && dynamic_cast(object)->getConstraintType()==ConstraintType::primary_key)); /* Additional validation for columns: checks if the parent table participates on a generalization/copy as destination table */ - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { itr=relationships.begin(); itr_end=relationships.end(); @@ -6823,7 +6823,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) object=obj_itr.second; obj_type=object->getObjectType(); - if(obj_type==ObjType && def_type==SchemaParser::SqlDefinition) + if(obj_type==ObjectType::ObjType && def_type==SchemaParser::SqlDefinition) { usr_type=dynamic_cast(object); @@ -6833,7 +6833,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) else attribs_aux[attrib]+=usr_type->getCodeDefinition(def_type); } - else if(obj_type==ObjDatabase) + else if(obj_type==ObjectType::ObjDatabase) { if(def_type==SchemaParser::SqlDefinition) { @@ -6853,15 +6853,15 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) else attribs_aux[attrib]+=this->__getCodeDefinition(def_type); } - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) { attribs_aux[ParsersAttributes::PERMISSION]+=dynamic_cast(object)->getCodeDefinition(def_type); } - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) { attribs_aux[attrib]+=dynamic_cast(object)->getCodeDefinition(def_type, true); } - else if(obj_type==ObjRole || obj_type==ObjTablespace || obj_type==ObjSchema) + else if(obj_type==ObjectType::ObjRole || obj_type==ObjectType::ObjTablespace || obj_type==ObjectType::ObjSchema) { //The "public" schema does not have the SQL code definition generated if(def_type==SchemaParser::SqlDefinition) @@ -6871,7 +6871,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) /* The Tablespace has the SQL code definition disabled when generating the code of the entire model because this object cannot be created from a multiline sql command */ - if(obj_type==ObjTablespace && !object->isSystemObject() && def_type==SchemaParser::SqlDefinition) + if(obj_type==ObjectType::ObjTablespace && !object->isSystemObject() && def_type==SchemaParser::SqlDefinition) { //Saving the sql disabled state sql_disabled=object->isSQLDisabled(); @@ -6884,12 +6884,12 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) object->setSQLDisabled(sql_disabled); } //System object doesn't has the XML generated (the only exception is for public schema) - else if((obj_type!=ObjSchema && !object->isSystemObject()) || - (obj_type==ObjSchema && + else if((obj_type!=ObjectType::ObjSchema && !object->isSystemObject()) || + (obj_type==ObjectType::ObjSchema && ((object->getName()==QString("public") && def_type==SchemaParser::XmlDefinition) || (object->getName()!=QString("public") && object->getName()!=QString("pg_catalog"))))) { - if(object->getObjectType()==ObjSchema) + if(object->getObjectType()==ObjectType::ObjSchema) search_path+=QString(",") + object->getName(true); //Generates the code definition and concatenates to the others @@ -6927,10 +6927,10 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[ParsersAttributes::PROTECTED]=(this->is_protected ? ParsersAttributes::_TRUE_ : QString()); attribs_aux[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs_aux[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); - attribs_aux[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjSchema] ? default_objs[ObjSchema]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjRole] ? default_objs[ObjRole]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjTablespace] ? default_objs[ObjTablespace]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjCollation] ? default_objs[ObjCollation]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::ObjSchema] ? default_objs[ObjectType::ObjSchema]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjectType::ObjRole] ? default_objs[ObjectType::ObjRole]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::ObjTablespace] ? default_objs[ObjectType::ObjTablespace]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjectType::ObjCollation] ? default_objs[ObjectType::ObjCollation]->getName(true) : QString()); } else { @@ -6986,18 +6986,18 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b Constraint *constr=nullptr; View *view=nullptr; Relationship *rel=nullptr; - ObjectType aux_obj_types[]={ ObjRole, ObjTablespace, ObjSchema, ObjTag }, - obj_types[]={ ObjEventTrigger, ObjCollation, ObjLanguage, ObjFunction, ObjType, - ObjCast, ObjConversion, ObjExtension, - ObjOperator, ObjOpFamily, ObjOpClass, - ObjAggregate, ObjDomain, ObjTextbox, ObjBaseRelationship, - ObjRelationship, ObjTable, ObjView, ObjSequence, ObjGenericSQL }; + ObjectType aux_obj_types[]={ ObjectType::ObjRole, ObjectType::ObjTablespace, ObjectType::ObjSchema, ObjectType::ObjTag }, + obj_types[]={ ObjectType::ObjEventTrigger, ObjectType::ObjCollation, ObjectType::ObjLanguage, ObjectType::ObjFunction, ObjectType::ObjType, + ObjectType::ObjCast, ObjectType::ObjConversion, ObjectType::ObjExtension, + ObjectType::ObjOperator, ObjectType::ObjOpFamily, ObjectType::ObjOpClass, + ObjectType::ObjAggregate, ObjectType::ObjDomain, ObjectType::ObjTextbox, ObjectType::ObjBaseRelationship, + ObjectType::ObjRelationship, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjSequence, ObjectType::ObjGenericSQL }; unsigned i=0, aux_obj_cnt=sizeof(aux_obj_types)/sizeof(ObjectType), count=sizeof(obj_types)/sizeof(ObjectType); //The first objects on the map will be roles, tablespaces, schemas and tags for(i=0; i < aux_obj_cnt; i++) { - if(aux_obj_types[i]!=ObjTag || def_type==SchemaParser::XmlDefinition) + if(aux_obj_types[i]!=ObjectType::ObjTag || def_type==SchemaParser::XmlDefinition) { obj_list=getObjectList(aux_obj_types[i]); @@ -7013,7 +7013,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b { //For SQL definition, only the textbox and base relationship does not enters to the code generation list if(def_type==SchemaParser::SqlDefinition && - (obj_types[i]==ObjTextbox || obj_types[i]==ObjBaseRelationship)) + (obj_types[i]==ObjectType::ObjTextbox || obj_types[i]==ObjectType::ObjBaseRelationship)) obj_list=nullptr; else obj_list=getObjectList(obj_types[i]); @@ -7024,7 +7024,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b { /* If the object is a FK relationship it's stored in a separeted list in order to have the code generated at end of whole definition (after foreign keys definition) */ - if(object->getObjectType()==ObjBaseRelationship && + if(object->getObjectType()==ObjectType::ObjBaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk) { fk_rels.push_back(object); @@ -7106,7 +7106,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b object=(*itr); itr++; - if(object->getObjectType()==ObjRelationship) + if(object->getObjectType()==ObjectType::ObjRelationship) { rel=dynamic_cast(object); objs[0]=rel->getTable(Relationship::SrcTable); @@ -7122,7 +7122,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b table=rel->getGeneratedTable(); objs[2]=table; - for(BaseObject *tab_obj : *table->getObjectList(ObjConstraint)) + for(BaseObject *tab_obj : *table->getObjectList(ObjectType::ObjConstraint)) { constr=dynamic_cast(tab_obj); @@ -7186,7 +7186,7 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vector dep_objs, chld_objs; Table *table=dynamic_cast
(object); - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; if(!object) return; @@ -7213,11 +7213,11 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vector::iterator end; - if(obj_type==ObjSchema) + if(obj_type==ObjectType::ObjSchema) { //Retrieve all objects that belongs to the schema chld_objs=getObjects(object); @@ -7242,7 +7242,7 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vectorgetObjectType()!=ObjColumn) || + if((!constr && child->getObjectType()!=ObjectType::ObjColumn) || (constr && ((constr->getConstraintType()==ConstraintType::foreign_key) || (constr->getConstraintType()!=ConstraintType::foreign_key && @@ -7284,7 +7284,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on /* Include tables generated by many-to-many relationships if their schemas are the same as the 'object' when this one is a schema too */ - if(obj_type==ObjSchema) + if(obj_type==ObjectType::ObjSchema) { if(only_children) { @@ -7326,7 +7326,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on { constr=dynamic_cast(child); - if((!constr && child->getObjectType()!=ObjColumn) || + if((!constr && child->getObjectType()!=ObjectType::ObjColumn) || (constr && ((constr->getConstraintType()==ConstraintType::foreign_key) || (constr->getConstraintType()!=ConstraintType::foreign_key && @@ -7354,7 +7354,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on if(table) { - for(BaseObject *col : *table->getObjectList(ObjColumn)) + for(BaseObject *col : *table->getObjectList(ObjectType::ObjColumn)) { getPermissions(col, perms_aux); perms.insert(perms.end(), perms_aux.begin(), perms_aux.end()); @@ -7445,7 +7445,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetCollation(), deps, inc_indirect_deps); //** Getting the dependecies for operator class ** - if(obj_type==ObjOpClass) + if(obj_type==ObjectType::ObjOpClass) { OperatorClass *opclass=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(opclass->getDataType()); @@ -7481,7 +7481,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object)->getType()); @@ -7489,13 +7489,13 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object)->getConversionFunction(); getObjectDependecies(func, deps, inc_indirect_deps); } //** Getting the dependecies for cast ** - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) { Cast *cast=dynamic_cast(object); BaseObject *usr_type=nullptr; @@ -7511,12 +7511,12 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetCastFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for event trigger ** - else if(obj_type==ObjEventTrigger) + else if(obj_type==ObjectType::ObjEventTrigger) { getObjectDependecies(dynamic_cast(object)->getFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for function ** - else if(obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjFunction) { Function *func=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(func->getReturnType()); @@ -7547,7 +7547,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7574,7 +7574,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7585,7 +7585,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7612,7 +7612,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); unsigned i, i1, count, @@ -7626,7 +7626,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7655,14 +7655,14 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); if(seq->getOwnerColumn()) getObjectDependecies(seq->getOwnerColumn()->getParentTable(), deps, inc_indirect_deps); } //** Getting the dependecies for column ** - else if(obj_type==ObjColumn) + else if(obj_type==ObjectType::ObjColumn) { Column *col=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(col->getType()), @@ -7675,7 +7675,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7686,7 +7686,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for index ** - else if(obj_type==ObjIndex) + else if(obj_type==ObjectType::ObjIndex) { Index *index=dynamic_cast(object); BaseObject *usr_type=nullptr; @@ -7709,7 +7709,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetIndexElement(i).getCollation(), deps, inc_indirect_deps); } } - else if(obj_type==ObjPolicy) + else if(obj_type==ObjectType::ObjPolicy) { Policy *pol=dynamic_cast(object); @@ -7717,7 +7717,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr, *seq=nullptr; @@ -7814,7 +7814,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *aux_type=nullptr; @@ -7843,7 +7843,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); unsigned i, count; @@ -7865,7 +7865,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7911,14 +7911,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector refs.push_back(this); } - if(obj_type==ObjView && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjView && (!exclusion_mode || (exclusion_mode && !refer))) { View *view=dynamic_cast(object); vector tab_objs=view->getObjects(); refs.insert(refs.end(), tab_objs.begin(), tab_objs.end()); } - if(obj_type==ObjTable && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjTable && (!exclusion_mode || (exclusion_mode && !refer))) { Table *table=dynamic_cast
(object); Sequence *seq=nullptr; @@ -7930,7 +7930,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector vector::iterator itr, itr_end; vector *tab_objs; unsigned i, count; - ObjectType tab_obj_types[4]={ ObjTrigger, ObjRule, ObjIndex, ObjPolicy }; + ObjectType tab_obj_types[4]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjPolicy }; for(i=0; i < 4; i++) { @@ -8055,14 +8055,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjFunction && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjFunction && (!exclusion_mode || (exclusion_mode && !refer))) { Function *func=dynamic_cast(object); vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ObjCast, ObjEventTrigger, ObjConversion, - ObjAggregate, ObjOperator, ObjOpClass, - ObjTable, ObjType, ObjLanguage }; + ObjectType obj_types[]={ObjectType::ObjCast, ObjectType::ObjEventTrigger, ObjectType::ObjConversion, + ObjectType::ObjAggregate, ObjectType::ObjOperator, ObjectType::ObjOpClass, + ObjectType::ObjTable, ObjectType::ObjType, ObjectType::ObjLanguage }; unsigned i, i1, count, cnt=sizeof(obj_types)/sizeof(ObjectType); Table *tab=nullptr; Aggregate *aggreg=nullptr; @@ -8078,7 +8078,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==ObjCast) + if(obj_types[i]==ObjectType::ObjCast) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8090,7 +8090,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjEventTrigger) + else if(obj_types[i]==ObjectType::ObjEventTrigger) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8102,7 +8102,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjConversion) + else if(obj_types[i]==ObjectType::ObjConversion) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8114,7 +8114,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjAggregate) + else if(obj_types[i]==ObjectType::ObjAggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8129,7 +8129,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjOperator) + else if(obj_types[i]==ObjectType::ObjOperator) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8145,7 +8145,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjOpClass) + else if(obj_types[i]==ObjectType::ObjOpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8163,7 +8163,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjTable) + else if(obj_types[i]==ObjectType::ObjTable) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8183,7 +8183,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjType) + else if(obj_types[i]==ObjectType::ObjType) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8200,7 +8200,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjLanguage) + else if(obj_types[i]==ObjectType::ObjLanguage) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8219,14 +8219,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjSchema && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjSchema && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[11]={ObjFunction, ObjTable, ObjView, - ObjDomain, ObjAggregate, ObjOperator, - ObjSequence, ObjConversion, - ObjType, ObjOpFamily, ObjOpClass}; + ObjectType obj_types[11]={ObjectType::ObjFunction, ObjectType::ObjTable, ObjectType::ObjView, + ObjectType::ObjDomain, ObjectType::ObjAggregate, ObjectType::ObjOperator, + ObjectType::ObjSequence, ObjectType::ObjConversion, + ObjectType::ObjType, ObjectType::ObjOpFamily, ObjectType::ObjOpClass}; unsigned i; for(i=0; i < 11 && (!exclusion_mode || (exclusion_mode && !refer)); i++) @@ -8247,15 +8247,15 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if((obj_type==ObjType || obj_type==ObjDomain || obj_type==ObjSequence || - obj_type==ObjTable || obj_type==ObjExtension || obj_type==ObjView) + if((obj_type==ObjectType::ObjType || obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjSequence || + obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjExtension || obj_type==ObjectType::ObjView) && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ObjTable, ObjOpClass, ObjCast, - ObjDomain, ObjFunction, ObjAggregate, - ObjOperator, ObjType, ObjRelationship }; + ObjectType obj_types[]={ObjectType::ObjTable, ObjectType::ObjOpClass, ObjectType::ObjCast, + ObjectType::ObjDomain, ObjectType::ObjFunction, ObjectType::ObjAggregate, + ObjectType::ObjOperator, ObjectType::ObjType, ObjectType::ObjRelationship }; unsigned i, i1, count, tp_count = sizeof(obj_types)/sizeof(ObjectType); OperatorClass *op_class=nullptr; OperatorClassElement elem; @@ -8272,13 +8272,13 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector switch(obj_type) { - case ObjType: ptr_pgsqltype=dynamic_cast(object); break; - case ObjDomain: + case ObjectType::ObjType: ptr_pgsqltype=dynamic_cast(object); break; + case ObjectType::ObjDomain: ptr_pgsqltype=dynamic_cast(object); break; - case ObjSequence: ptr_pgsqltype=dynamic_cast(object); break; - case ObjExtension: ptr_pgsqltype=dynamic_cast(object); break; - case ObjView: ptr_pgsqltype=dynamic_cast(object); break; + case ObjectType::ObjSequence: ptr_pgsqltype=dynamic_cast(object); break; + case ObjectType::ObjExtension: ptr_pgsqltype=dynamic_cast(object); break; + case ObjectType::ObjView: ptr_pgsqltype=dynamic_cast(object); break; default: ptr_pgsqltype=dynamic_cast(object); break; } @@ -8288,7 +8288,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==ObjRelationship) + if(obj_types[i]==ObjectType::ObjRelationship) { bool added; @@ -8311,7 +8311,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjTable) + else if(obj_types[i]==ObjectType::ObjTable) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8326,7 +8326,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector if(!col->isAddedByRelationship() && (col->getType()==ptr_pgsqltype || //Special case for postgis extension - (obj_type == ObjExtension && object->getName() == QString("postgis") && col->getType().isGiSType()))) + (obj_type == ObjectType::ObjExtension && object->getName() == QString("postgis") && col->getType().isGiSType()))) { refer=true; refs.push_back(col); @@ -8334,7 +8334,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjOpClass) + else if(obj_types[i]==ObjectType::ObjOpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8358,7 +8358,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjDomain) + else if(obj_types[i]==ObjectType::ObjDomain) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8372,7 +8372,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjType) + else if(obj_types[i]==ObjectType::ObjType) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8389,7 +8389,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjAggregate) + else if(obj_types[i]==ObjectType::ObjAggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8407,7 +8407,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjFunction) + else if(obj_types[i]==ObjectType::ObjFunction) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8433,7 +8433,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjOperator) + else if(obj_types[i]==ObjectType::ObjOperator) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8448,7 +8448,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjCast) + else if(obj_types[i]==ObjectType::ObjCast) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8466,15 +8466,15 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjRole && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjRole && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[13]={ObjFunction, ObjTable, ObjDomain, - ObjAggregate, ObjSchema, ObjOperator, - ObjSequence, ObjConversion, - ObjLanguage, ObjTablespace, - ObjType, ObjOpFamily, ObjOpClass}; + ObjectType obj_types[13]={ObjectType::ObjFunction, ObjectType::ObjTable, ObjectType::ObjDomain, + ObjectType::ObjAggregate, ObjectType::ObjSchema, ObjectType::ObjOperator, + ObjectType::ObjSequence, ObjectType::ObjConversion, + ObjectType::ObjLanguage, ObjectType::ObjTablespace, + ObjectType::ObjType, ObjectType::ObjOpFamily, ObjectType::ObjOpClass}; unsigned i,i1, count; Role *role_aux=nullptr; Role *role=dynamic_cast(object); @@ -8532,9 +8532,9 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector refs.push_back(*itr); } - if((*itr)->getObjectType() == ObjTable) + if((*itr)->getObjectType() == ObjectType::ObjTable) { - for(auto obj : *(dynamic_cast
(*itr))->getObjectList(ObjPolicy)) + for(auto obj : *(dynamic_cast
(*itr))->getObjectList(ObjectType::ObjPolicy)) { if(dynamic_cast(obj)->isRoleExists(role)) { @@ -8556,7 +8556,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjTablespace && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjTablespace && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; unsigned i, count; @@ -8609,7 +8609,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjLanguage && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjLanguage && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; Function *func=nullptr; @@ -8629,7 +8629,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjOpClass && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjOpClass && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; Type *usertype=nullptr; @@ -8707,14 +8707,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjOperator && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjOperator && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ObjOpClass, - ObjAggregate, - ObjOperator, - ObjTable }; + ObjectType obj_types[]={ObjectType::ObjOpClass, + ObjectType::ObjAggregate, + ObjectType::ObjOperator, + ObjectType::ObjTable }; unsigned i, i1, count; OperatorClass *op_class=nullptr; Operator *oper_aux=nullptr, *oper=dynamic_cast(object); @@ -8727,7 +8727,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==ObjOpClass) + if(obj_types[i]==ObjectType::ObjOpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8745,7 +8745,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjAggregate) + else if(obj_types[i]==ObjectType::ObjAggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8757,7 +8757,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjOperator) + else if(obj_types[i]==ObjectType::ObjOperator) { while(itr!=itr_end && !refer) { @@ -8805,7 +8805,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjOpFamily && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjOpFamily && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; OperatorFamily *op_family=dynamic_cast(object); @@ -8824,10 +8824,10 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjCollation && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjCollation && (!exclusion_mode || (exclusion_mode && !refer))) { - ObjectType obj_types[]={ ObjDomain, ObjCollation, ObjType }, - tab_obj_types[]={ ObjColumn, ObjIndex }; + ObjectType obj_types[]={ ObjectType::ObjDomain, ObjectType::ObjCollation, ObjectType::ObjType }, + tab_obj_types[]={ ObjectType::ObjColumn, ObjectType::ObjIndex }; unsigned i, count; vector *obj_list=nullptr; vector::iterator itr, itr_end; @@ -8856,7 +8856,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } count=sizeof(tab_obj_types)/sizeof(ObjectType); - obj_list=getObjectList(ObjTable); + obj_list=getObjectList(ObjectType::ObjTable); itr=obj_list->begin(); itr_end=obj_list->end(); @@ -8873,8 +8873,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(tab_itr!=tab_itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { tab_obj=(*tab_itr); - if((tab_obj->getObjectType()==ObjColumn && tab_obj->getCollation()==object) || - (tab_obj->getObjectType()==ObjIndex && + if((tab_obj->getObjectType()==ObjectType::ObjColumn && tab_obj->getCollation()==object) || + (tab_obj->getObjectType()==ObjectType::ObjIndex && dynamic_cast(tab_obj)->isReferCollation(dynamic_cast(object)))) { refer=true; @@ -8899,12 +8899,12 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjColumn && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjColumn && (!exclusion_mode || (exclusion_mode && !refer))) { Column *column=dynamic_cast(object); vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ ObjSequence, ObjView, ObjTable, ObjRelationship }; + ObjectType obj_types[]={ ObjectType::ObjSequence, ObjectType::ObjView, ObjectType::ObjTable, ObjectType::ObjRelationship }; unsigned i, count=sizeof(obj_types)/sizeof(ObjectType); for(i=0; i < count && (!exclusion_mode || (exclusion_mode && !refer)); i++) @@ -8915,13 +8915,13 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { - if((obj_types[i]==ObjSequence && dynamic_cast(*itr)->getOwnerColumn()==column) || - (obj_types[i]==ObjView && dynamic_cast(*itr)->isReferencingColumn(column))) + if((obj_types[i]==ObjectType::ObjSequence && dynamic_cast(*itr)->getOwnerColumn()==column) || + (obj_types[i]==ObjectType::ObjView && dynamic_cast(*itr)->isReferencingColumn(column))) { refer=true; refs.push_back(*itr); } - else if(obj_types[i]==ObjTable) + else if(obj_types[i]==ObjectType::ObjTable) { Table *tab=dynamic_cast
(*itr); unsigned count, idx, count1, i1; @@ -8980,7 +8980,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - else if(obj_types[i]==ObjRelationship) + else if(obj_types[i]==ObjectType::ObjRelationship) { Relationship *rel=dynamic_cast(*itr); unsigned constr_cnt, idx; @@ -9002,7 +9002,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } - if(obj_type==ObjTag && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjTag && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; vector list; @@ -9025,7 +9025,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjSequence && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::ObjSequence && (!exclusion_mode || (exclusion_mode && !refer))) { Table *table=nullptr; vector *cols=nullptr; @@ -9035,7 +9035,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector for(i=0; i < cnt && (!exclusion_mode || (exclusion_mode && !refer)); i++) { table=dynamic_cast
(tables[i]); - cols=table->getObjectList(ObjColumn); + cols=table->getObjectList(ObjectType::ObjColumn); itr=cols->begin(); itr_end=cols->end(); @@ -9083,9 +9083,9 @@ void DatabaseModel::setObjectsModified(vector &objects) void DatabaseModel::setObjectsModified(vector types) { - ObjectType obj_types[]={ObjTable, ObjView, - ObjRelationship, ObjBaseRelationship, - ObjTextbox, ObjSchema }; + ObjectType obj_types[]={ObjectType::ObjTable, ObjectType::ObjView, + ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, + ObjectType::ObjTextbox, ObjectType::ObjSchema }; vector::iterator itr, itr_end; vector *obj_list=nullptr; Textbox *label=nullptr; @@ -9105,7 +9105,7 @@ void DatabaseModel::setObjectsModified(vector types) dynamic_cast(*itr)->setModified(true); //For relationships is needed to set the labels as modified too - if(obj_types[i]==ObjRelationship || obj_types[i]==ObjBaseRelationship) + if(obj_types[i]==ObjectType::ObjRelationship || obj_types[i]==ObjectType::ObjBaseRelationship) { rel=dynamic_cast(*itr); for(i1=0; i1 < 3; i1++) @@ -9130,8 +9130,8 @@ void DatabaseModel::setCodesInvalidated(vector types) sel_types=BaseObject::getObjectTypes(false); else { - ObjectType tab_obj_types[]={ObjColumn, ObjConstraint, - ObjTrigger, ObjRule, ObjIndex, ObjPolicy}; + ObjectType tab_obj_types[]={ObjectType::ObjColumn, ObjectType::ObjConstraint, + ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjPolicy}; for(unsigned i=0; i < 6; i++) sel_types.erase(std::find(sel_types.begin(), sel_types.end(), tab_obj_types[i])); @@ -9156,27 +9156,27 @@ BaseObject *DatabaseModel::getObjectPgSQLType(PgSQLType type) switch(type.getUserTypeConfig()) { case UserTypeConfig::BASE_TYPE: - return(this->getObject(*type, ObjType)); + return(this->getObject(*type, ObjectType::ObjType)); break; case UserTypeConfig::DOMAIN_TYPE: - return(this->getObject(*type, ObjDomain)); + return(this->getObject(*type, ObjectType::ObjDomain)); break; case UserTypeConfig::TABLE_TYPE: - return(this->getObject(*type, ObjTable)); + return(this->getObject(*type, ObjectType::ObjTable)); break; case UserTypeConfig::VIEW_TYPE: - return(this->getObject(*type, ObjView)); + return(this->getObject(*type, ObjectType::ObjView)); break; case UserTypeConfig::SEQUENCE_TYPE: - return(this->getObject(*type, ObjSequence)); + return(this->getObject(*type, ObjectType::ObjSequence)); break; case UserTypeConfig::EXTENSION_TYPE: - return(this->getObject(*type, ObjExtension)); + return(this->getObject(*type, ObjectType::ObjExtension)); break; default: @@ -9187,7 +9187,7 @@ BaseObject *DatabaseModel::getObjectPgSQLType(PgSQLType type) void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_sch_name) { - ObjectType types[]={ ObjTable, ObjView, ObjDomain, ObjType, ObjSequence }; + ObjectType types[]={ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjDomain, ObjectType::ObjType, ObjectType::ObjSequence }; vector list, vet; BaseObject *obj=nullptr; QString prev_name; @@ -9208,7 +9208,7 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s obj=list.back(); //For objects that is not a Views is needed to rename the pgsql type represented by the object - if(obj->getObjectType()!=ObjView) + if(obj->getObjectType()!=ObjectType::ObjView) { //Configures the previous type name prev_name=BaseObject::formatName(prev_sch_name) + QString(".") + @@ -9216,14 +9216,14 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s /* Special case for tables. Need to make a dynamic_cast before the reinterpret_cast to get the correct reference to table */ - if(obj->getObjectType()==ObjTable) + if(obj->getObjectType()==ObjectType::ObjTable) PgSQLType::renameUserType(prev_name, reinterpret_cast(dynamic_cast
(obj)), obj->getName(true)); else PgSQLType::renameUserType(prev_name, reinterpret_cast(obj), obj->getName(true)); } //For graphical objects set them as modified to redraw them - if(obj->getObjectType()==ObjTable || obj->getObjectType()==ObjView) + if(obj->getObjectType()==ObjectType::ObjTable || obj->getObjectType()==ObjectType::ObjView) dynamic_cast(obj)->setModified(true); list.pop_back(); @@ -9243,7 +9243,7 @@ void DatabaseModel::createSystemObjects(bool create_public) /* The particular case is for public schema that is created only when the flag is set. This because the public schema is written on model file even being a system object. This strategy permits the user controls the schema rectangle behavior */ - if(create_public && getObjectIndex(QString("public"), ObjSchema) < 0) + if(create_public && getObjectIndex(QString("public"), ObjectType::ObjSchema) < 0) { public_sch=new Schema; public_sch->setName(QString("public")); @@ -9271,7 +9271,7 @@ void DatabaseModel::createSystemObjects(bool create_public) for(unsigned i=0; i < sizeof(lang_types)/sizeof(LanguageType); i++) { - if(getObjectIndex(~LanguageType(lang_types[i]), ObjLanguage) < 0) + if(getObjectIndex(~LanguageType(lang_types[i]), ObjectType::ObjLanguage) < 0) { lang=new Language; lang->BaseObject::setName(~LanguageType(lang_types[i])); @@ -9299,7 +9299,7 @@ void DatabaseModel::createSystemObjects(bool create_public) addRole(postgres); setDefaultObject(postgres); - setDefaultObject(getObject(QString("public"), ObjSchema), ObjSchema); + setDefaultObject(getObject(QString("public"), ObjectType::ObjSchema), ObjectType::ObjSchema); } vector DatabaseModel::findObjects(const QString &pattern, vector types, bool format_obj_names, bool case_sensitive, bool is_regexp, bool exact_match) @@ -9329,13 +9329,13 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorbegin(), getObjectList(ObjTable)->end()); + tables.insert(tables.end(), getObjectList(ObjectType::ObjTable)->begin(), getObjectList(ObjectType::ObjTable)->end()); inc_tabs=true; } - if(!inc_views && ((*itr_tp)==ObjRule || (*itr_tp)==ObjTrigger)) + if(!inc_views && ((*itr_tp)==ObjectType::ObjRule || (*itr_tp)==ObjectType::ObjTrigger)) { - tables.insert(tables.end(), getObjectList(ObjView)->begin(), getObjectList(ObjView)->end()); + tables.insert(tables.end(), getObjectList(ObjectType::ObjView)->begin(), getObjectList(ObjectType::ObjView)->end()); inc_views=true; } @@ -9349,7 +9349,7 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorbegin(), getObjectList(obj_type)->end()); @@ -9365,10 +9365,10 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorgetObjectType()==ObjTable) + if(tab->getObjectType()==ObjectType::ObjTable) tab_objs=dynamic_cast
(tab)->getObjectList(obj_type); - else if(tab->getObjectType()==ObjView && - (obj_type==ObjTrigger || obj_type==ObjRule)) + else if(tab->getObjectType()==ObjectType::ObjView && + (obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule)) tab_objs=dynamic_cast(tab)->getObjectList(obj_type); if(tab_objs) @@ -9583,15 +9583,15 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_objs_prot || save_objs_sqldis) { - vector types=getChildObjectTypes(ObjDatabase), sch_types=getChildObjectTypes(ObjSchema); + vector types=getChildObjectTypes(ObjectType::ObjDatabase), sch_types=getChildObjectTypes(ObjectType::ObjSchema); types.insert(types.end(), sch_types.begin(), sch_types.end()); //Removing the types for schema, table and view to avoid retrieving the objects twice if(save_objs_pos) { - types.erase(std::find(types.begin(), types.end(), ObjSchema)); - types.erase(std::find(types.begin(), types.end(), ObjTable)); - types.erase(std::find(types.begin(), types.end(), ObjView)); + types.erase(std::find(types.begin(), types.end(), ObjectType::ObjSchema)); + types.erase(std::find(types.begin(), types.end(), ObjectType::ObjTable)); + types.erase(std::find(types.begin(), types.end(), ObjectType::ObjView)); } //Append the other objects to the list of selected entities @@ -9604,7 +9604,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option obj_type=object->getObjectType(); //When handling a tag , textbox or generic sql we just extract their XML code - if(obj_type==ObjTextbox || obj_type==ObjTag || obj_type == ObjGenericSQL) + if(obj_type==ObjectType::ObjTextbox || obj_type==ObjectType::ObjTag || obj_type == ObjectType::ObjGenericSQL) { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving object `%1' (%2)") @@ -9638,7 +9638,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::TABLE]=base_tab->getSignature(); } - if(save_custom_sql && obj_type==ObjDatabase) + if(save_custom_sql && obj_type==ObjectType::ObjDatabase) { attribs[ParsersAttributes::APPEND_AT_EOD]=(this->isAppendAtEOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); attribs[ParsersAttributes::PREPEND_AT_BOD]=(this->isPrependedAtBOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); @@ -9650,20 +9650,20 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::MODEL_AUTHOR]=this->getAuthor(); attribs[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); - attribs[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjCollation] ? default_objs[ObjCollation]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjSchema] ? default_objs[ObjSchema]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjTablespace] ? default_objs[ObjTablespace]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjRole] ? default_objs[ObjRole]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjectType::ObjCollation] ? default_objs[ObjectType::ObjCollation]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::ObjSchema] ? default_objs[ObjectType::ObjSchema]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::ObjTablespace] ? default_objs[ObjectType::ObjTablespace]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjectType::ObjRole] ? default_objs[ObjectType::ObjRole]->getSignature() : QString()); } //If the object is a graphic one and we need to save positions and colors if((save_objs_pos || save_custom_colors) && graph_obj) { - if(obj_type!=ObjBaseRelationship && obj_type!=ObjRelationship) + if(obj_type!=ObjectType::ObjBaseRelationship && obj_type!=ObjectType::ObjRelationship) { pnt=graph_obj->getPosition(); - if(obj_type==ObjSchema) + if(obj_type==ObjectType::ObjSchema) { schema=dynamic_cast(object); @@ -9682,7 +9682,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::Y_POS]=QString::number(pnt.y()); } - if(obj_type!=ObjSchema || !attribs[ParsersAttributes::X_POS].isEmpty()) + if(obj_type!=ObjectType::ObjSchema || !attribs[ParsersAttributes::X_POS].isEmpty()) { schparser.ignoreUnkownAttributes(true); attribs[ParsersAttributes::POSITION]= @@ -9756,9 +9756,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option /* The object's metadata code will be generated only if one of the key attributes for each option were filled previously. */ - if((save_db_attribs && obj_type==ObjDatabase) || + if((save_db_attribs && obj_type==ObjectType::ObjDatabase) || (save_custom_colors && - ((obj_type==ObjRelationship || obj_type==ObjBaseRelationship) || + ((obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjBaseRelationship) || (!attribs[ParsersAttributes::CUSTOM_COLOR].isEmpty()))) || (save_objs_pos && (!attribs[ParsersAttributes::POSITION].isEmpty() || @@ -9797,10 +9797,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option ParsersAttributes::METADATA + GlobalAttributes::SchemaExt, attribs)); output.write(buf.data(),buf.size()); - emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ObjectType::ObjBaseObject); } else - emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), ObjectType::ObjBaseObject); output.close(); } @@ -9872,9 +9872,9 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { elem_name=xmlparser.getElementName(); - if((elem_name==BaseObject::getSchemaName(ObjTag) && load_tags) || - (elem_name==BaseObject::getSchemaName(ObjTextbox) && load_textboxes) || - (elem_name==BaseObject::getSchemaName(ObjGenericSQL) && load_genericsqls)) + if((elem_name==BaseObject::getSchemaName(ObjectType::ObjTag) && load_tags) || + (elem_name==BaseObject::getSchemaName(ObjectType::ObjTextbox) && load_textboxes) || + (elem_name==BaseObject::getSchemaName(ObjectType::ObjGenericSQL) && load_genericsqls)) { xmlparser.savePosition(); obj_type=BaseObject::getObjectType(elem_name); @@ -9889,7 +9889,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) already exists. Ignoring.") - .arg(new_object->getName()).arg(new_object->getTypeName()), ObjBaseObject); + .arg(new_object->getName()).arg(new_object->getTypeName()), ObjectType::ObjBaseObject); delete(new_object); } @@ -9905,16 +9905,16 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option obj_type=BaseObject::getObjectType(attribs[ParsersAttributes::TYPE]); progress=xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()) * 100; - if(obj_type==ObjDatabase) + if(obj_type==ObjectType::ObjDatabase) { if(load_db_attribs) { QStringList pos=attribs[ParsersAttributes::LAST_POSITION].split(','); - default_objs[ObjSchema]=getSchema(attribs[ParsersAttributes::DEFAULT_SCHEMA]); - default_objs[ObjRole]=getRole(attribs[ParsersAttributes::DEFAULT_OWNER]); - default_objs[ObjCollation]=getCollation(attribs[ParsersAttributes::DEFAULT_COLLATION]); - default_objs[ObjTablespace]=getTablespace(attribs[ParsersAttributes::DEFAULT_TABLESPACE]); + default_objs[ObjectType::ObjSchema]=getSchema(attribs[ParsersAttributes::DEFAULT_SCHEMA]); + default_objs[ObjectType::ObjRole]=getRole(attribs[ParsersAttributes::DEFAULT_OWNER]); + default_objs[ObjectType::ObjCollation]=getCollation(attribs[ParsersAttributes::DEFAULT_COLLATION]); + default_objs[ObjectType::ObjTablespace]=getTablespace(attribs[ParsersAttributes::DEFAULT_TABLESPACE]); author=attribs[ParsersAttributes::MODEL_AUTHOR]; last_zoom=attribs[ParsersAttributes::LAST_ZOOM].toFloat(); @@ -9928,7 +9928,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { base_tab = getTable(attribs[ParsersAttributes::TABLE]); - if(!base_tab && (obj_type == ObjRule || obj_type == ObjIndex || obj_type == ObjTrigger)) + if(!base_tab && (obj_type == ObjectType::ObjRule || obj_type == ObjectType::ObjIndex || obj_type == ObjectType::ObjTrigger)) base_tab = getView(attribs[ParsersAttributes::TABLE]); if(base_tab) @@ -9943,7 +9943,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option /* If the object does not exists but it is a relationship, we try to get the relationship involving the tables in paramenters src-table and dst-table */ - if(!object && obj_type==ObjRelationship) + if(!object && obj_type==ObjectType::ObjRelationship) { src_tab=dynamic_cast(getObject(attribs[ParsersAttributes::SRC_TABLE], BaseObject::getObjectType(attribs[ParsersAttributes::SRC_TYPE]))); @@ -9967,14 +9967,14 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(!attribs[ParsersAttributes::SQL_DISABLED].isEmpty()) object->setSQLDisabled(attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_); } - else if((obj_type==ObjTable || obj_type==ObjView) && load_tags && !attribs[ParsersAttributes::TAG].isEmpty()) + else if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && load_tags && !attribs[ParsersAttributes::TAG].isEmpty()) { tag=getTag(attribs[ParsersAttributes::TAG]); if(tag) dynamic_cast(object)->setTag(tag); } - else if(obj_type==ObjDatabase && load_custom_sql) + else if(obj_type==ObjectType::ObjDatabase && load_custom_sql) { if(!attribs[ParsersAttributes::APPEND_AT_EOD].isEmpty()) this->setAppendAtEOD(attribs[ParsersAttributes::APPEND_AT_EOD]==ParsersAttributes::_TRUE_); @@ -10084,7 +10084,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else if(!object) { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) not found. Ignoring metadata.") - .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), ObjBaseObject); + .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), ObjectType::ObjBaseObject); } xmlparser.restorePosition(); @@ -10095,7 +10095,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option while(xmlparser.accessElement(XmlParser::NextElement)); } - emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ObjectType::ObjBaseObject); setObjectsModified(); } catch(Exception &e) diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index cdc74c2e37..5cd2787f69 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -270,7 +270,7 @@ class DatabaseModel: public QObject, public BaseObject { //! \brief Sets the sql prepeding at beginning of entire model definition void setPrependAtBOD(bool value); - void setDefaultObject(BaseObject *object, ObjectType obj_type=ObjBaseObject); + void setDefaultObject(BaseObject *object, ObjectType obj_type=ObjectType::ObjBaseObject); void setIsTemplate(bool value); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 890a035329..fc5e19a9c1 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -20,7 +20,7 @@ Domain::Domain(void) { - obj_type=ObjDomain; + obj_type=ObjectType::ObjDomain; not_null=false; attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); attributes[ParsersAttributes::NOT_NULL]=QString(); @@ -41,7 +41,7 @@ void Domain::addCheckConstraint(const QString &name, const QString &expr) { throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) .arg(name) - .arg(BaseObject::getTypeName(ObjConstraint)) + .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)) .arg(this->getName(true)) .arg(this->getTypeName()), AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index a9f2d61a2f..d62f53422d 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -20,7 +20,7 @@ EventTrigger::EventTrigger(void) { - obj_type=ObjEventTrigger; + obj_type=ObjectType::ObjEventTrigger; function=nullptr; attributes[ParsersAttributes::EVENT]=QString(); attributes[ParsersAttributes::FILTER]=QString(); @@ -38,7 +38,7 @@ void EventTrigger::setFunction(Function *func) if(!func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjEventTrigger)), + .arg(BaseObject::getTypeName(ObjectType::ObjEventTrigger)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions with return type other that event_trigger are not accepted else if(func->getReturnType()!=QString("event_trigger")) @@ -47,7 +47,7 @@ void EventTrigger::setFunction(Function *func) else if(func->getParameterCount()!=0) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjEventTrigger)), + .arg(BaseObject::getTypeName(ObjectType::ObjEventTrigger)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions coded in SQL lang. is not accepted by event triggers else if(func->getLanguage()->getName()==~LanguageType(LanguageType::sql)) diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 39063a9907..e032a20695 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -2,7 +2,7 @@ Extension::Extension(void) { - obj_type=ObjExtension; + obj_type=ObjectType::ObjExtension; handles_type=false; attributes[ParsersAttributes::HANDLES_TYPE]=QString(); attributes[ParsersAttributes::CUR_VERSION]=QString(); diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 037ff55783..0df055df8c 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -25,7 +25,7 @@ Function::Function(void) returns_setof=false; is_wnd_function=false; is_leakproof=false; - obj_type=ObjFunction; + obj_type=ObjectType::ObjFunction; execution_cost=100; row_amount=1000; @@ -211,7 +211,7 @@ void Function::setLanguage(BaseObject *language) if(!language) throw Exception(AsgNotAllocatedLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the language object is invalid - else if(language->getObjectType()!=ObjLanguage) + else if(language->getObjectType()!=ObjectType::ObjLanguage) throw Exception(AsgInvalidLanguageObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->language != language); diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 604ab98a64..4df0073120 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -20,7 +20,7 @@ GenericSQL::GenericSQL(void) { - obj_type=ObjGenericSQL; + obj_type=ObjectType::ObjGenericSQL; attributes[ParsersAttributes::DEFINITION] = QString(); } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index b414512bff..bcbdc51fdb 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -20,7 +20,7 @@ Index::Index(void) { - obj_type=ObjIndex; + obj_type=ObjectType::ObjIndex; index_attribs[Unique]=index_attribs[Concurrent]= index_attribs[FastUpdate]=index_attribs[Buffering]=false; fill_factor=90; diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 20504f0978..6b887ed3fa 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -20,7 +20,7 @@ Language::Language(void) { - obj_type=ObjLanguage; + obj_type=ObjectType::ObjLanguage; is_trusted=false; for(unsigned i=ValidatorFunc; i <= InlineFunc; i++) @@ -38,7 +38,7 @@ void Language::setName(const QString &name) if(name.toLower()==~LanguageType("c") || name.toLower()==~LanguageType("sql")) throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjLanguage)), + .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); @@ -85,7 +85,7 @@ void Language::setFunction(Function *func, unsigned func_type) ((func_type==ValidatorFunc || func_type==InlineFunc) && func->getReturnType()!=QString("void"))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjLanguage)), + .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else //Raises an error in case the function has invalid parameters (count and types) diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 573b05d058..1a82123706 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -164,7 +164,7 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) { BaseObject *copy_obj=nullptr; - if(obj_type!=ObjBaseObject && obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjDatabase) PgModelerNs::copyObject(©_obj, object, obj_type); else throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -228,7 +228,7 @@ void OperationList::removeOperations(void) if(unallocated_objs.count(object)==0 && (!tab_obj && model->getObjectIndex(object) < 0)) { - if(object->getObjectType()==ObjTable) + if(object->getObjectType()==ObjectType::ObjTable) { vector list=dynamic_cast
(object)->getObjects(); @@ -355,10 +355,10 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(parent_obj && - (((obj_type==ObjColumn || obj_type==ObjConstraint) && - (parent_obj->getObjectType()!=ObjRelationship && parent_obj->getObjectType()!=ObjTable)) || + (((obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) && + (parent_obj->getObjectType()!=ObjectType::ObjRelationship && parent_obj->getObjectType()!=ObjectType::ObjTable)) || - ((obj_type==ObjTrigger || obj_type==ObjRule || obj_type==ObjIndex) && !dynamic_cast(parent_obj)))) + ((obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule || obj_type==ObjectType::ObjIndex) && !dynamic_cast(parent_obj)))) throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the operations list is full makes the automatic cleaning before inserting a new operation @@ -414,19 +414,19 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje in the list on the parent object */ if(tab_obj) { - if(parent_obj->getObjectType()==ObjRelationship) + if(parent_obj->getObjectType()==ObjectType::ObjRelationship) parent_rel=dynamic_cast(parent_obj); else parent_tab=dynamic_cast(parent_obj); - if(((obj_type==ObjTrigger && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || - (obj_type==ObjIndex && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || - (obj_type==ObjConstraint && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()))) + if(((obj_type==ObjectType::ObjTrigger && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || + (obj_type==ObjectType::ObjIndex && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || + (obj_type==ObjectType::ObjConstraint && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()))) { if(op_type==Operation::ObjectRemoved) tab_obj->setParentTable(parent_tab); - if(tab_obj->getObjectType()==ObjConstraint) + if(tab_obj->getObjectType()==ObjectType::ObjConstraint) operation->setXMLDefinition(dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::XmlDefinition, true)); else operation->setXMLDefinition(tab_obj->getCodeDefinition(SchemaParser::XmlDefinition)); @@ -436,7 +436,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje /* If there is a parent relationship will get the index of the object. Only columns and constraints are handled case the parent is a relationship */ - if(parent_rel && (obj_type==ObjColumn || obj_type==ObjConstraint)) + if(parent_rel && (obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint)) { //Case a specific index wasn't specified if(object_idx < 0) @@ -461,8 +461,8 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje } else { - if((obj_type==ObjSequence && dynamic_cast(object)->isReferRelationshipAddedColumn()) || - (obj_type==ObjView && dynamic_cast(object)->isReferRelationshipAddedColumn())) + if((obj_type==ObjectType::ObjSequence && dynamic_cast(object)->isReferRelationshipAddedColumn()) || + (obj_type==ObjectType::ObjView && dynamic_cast(object)->isReferRelationshipAddedColumn())) operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XmlDefinition)); //Case a specific index wasn't specified @@ -474,7 +474,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje obj_idx=object_idx; } - if(obj_type==ObjColumn && dynamic_cast(object)->getType().isUserType()) + if(obj_type==ObjectType::ObjColumn && dynamic_cast(object)->getType().isUserType()) operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XmlDefinition)); operation->setObjectIndex(obj_idx); @@ -517,7 +517,7 @@ void OperationList::getOperationData(unsigned oper_idx, unsigned &oper_type, QSt } else { - obj_type=ObjBaseObject; + obj_type=ObjectType::ObjBaseObject; obj_name=trUtf8("(invalid object)"); } } @@ -698,13 +698,13 @@ void OperationList::executeOperation(Operation *oper, bool redo) obj_idx=oper->getObjectIndex(); /* Converting the parent object, if any, to the correct class according - to the type of the parent object. If ObjTable|ObjView, the pointer + to the type of the parent object. If ObjectType::ObjTable|ObjectType::ObjView, the pointer 'parent_tab' get the reference to table/view and will be used as referential in the operations below. If the parent object is a relationship, the pointer 'parent_rel' get the reference to the relationship */ if(parent_obj) { - if(parent_obj->getObjectType()==ObjRelationship) + if(parent_obj->getObjectType()==ObjectType::ObjRelationship) parent_rel=dynamic_cast(parent_obj); else parent_tab=dynamic_cast(parent_obj); @@ -722,17 +722,17 @@ void OperationList::executeOperation(Operation *oper, bool redo) xmlparser->restartParser(); xmlparser->loadXMLBuffer(xml_def); - if(obj_type==ObjTrigger) + if(obj_type==ObjectType::ObjTrigger) aux_obj=model->createTrigger(); - else if(obj_type==ObjIndex) + else if(obj_type==ObjectType::ObjIndex) aux_obj=model->createIndex(); - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) aux_obj=model->createConstraint(parent_obj); - else if(obj_type==ObjSequence) + else if(obj_type==ObjectType::ObjSequence) aux_obj=model->createSequence(); - else if(obj_type==ObjView) + else if(obj_type==ObjectType::ObjView) aux_obj=model->createView(); - else if(obj_type==ObjColumn) + else if(obj_type==ObjectType::ObjColumn) aux_obj=model->createColumn(); } @@ -741,7 +741,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) if(op_type==Operation::ObjectModified || op_type==Operation::ObjectMoved) { - if(obj_type==ObjRelationship) + if(obj_type==ObjectType::ObjRelationship) { /* Due to the complexity of the class Relationship and the strong link between all relationships of the model it is necessary to store XML for special objects and @@ -764,7 +764,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) //For pk constraint, before restore the previous configuration, uncheck the not-null flag of the source columns - if(obj_type==ObjConstraint) + if(obj_type==ObjectType::ObjConstraint) dynamic_cast(orig_obj)->setColumnsNotNull(false); /* The original object (obtained from the table, relationship or model) will have its @@ -780,7 +780,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) PgModelerNs::copyObject(reinterpret_cast(&object), aux_obj, obj_type); //For pk constraint, after restore the previous configuration, check the not-null flag of the new source columns - if(obj_type==ObjConstraint) + if(obj_type==ObjectType::ObjConstraint) dynamic_cast(orig_obj)->setColumnsNotNull(true); } @@ -798,13 +798,13 @@ void OperationList::executeOperation(Operation *oper, bool redo) { parent_tab->addObject(dynamic_cast(object), obj_idx); - if(object->getObjectType()==ObjConstraint && + if(object->getObjectType()==ObjectType::ObjConstraint && dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); } else if(parent_rel) parent_rel->addObject(dynamic_cast(object), obj_idx); - else if(object->getObjectType()==ObjTable) + else if(object->getObjectType()==ObjectType::ObjTable) dynamic_cast
(object)->getCodeDefinition(SchemaParser::SqlDefinition); model->addObject(object, obj_idx); @@ -838,12 +838,12 @@ void OperationList::executeOperation(Operation *oper, bool redo) if(parent_tab->getSchema()) dynamic_cast(parent_tab->getSchema())->setModified(true); - if(object->getObjectType()==ObjColumn || - object->getObjectType()==ObjConstraint) + if(object->getObjectType()==ObjectType::ObjColumn || + object->getObjectType()==ObjectType::ObjConstraint) { model->validateRelationships(dynamic_cast(object), dynamic_cast
(parent_tab)); - if(object->getObjectType()==ObjConstraint && + if(object->getObjectType()==ObjectType::ObjConstraint && dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); } @@ -858,9 +858,9 @@ void OperationList::executeOperation(Operation *oper, bool redo) /* If the object in question is graphical it has the modified flag marked to force the redraw at the time of its restoration */ - else if(obj_type==ObjTable || obj_type==ObjView || - obj_type==ObjBaseRelationship || obj_type==ObjRelationship || - obj_type==ObjTextbox || obj_type==ObjSchema) + else if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView || + obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjRelationship || + obj_type==ObjectType::ObjTextbox || obj_type==ObjectType::ObjSchema) { BaseGraphicObject *graph_obj=dynamic_cast(object); @@ -869,15 +869,15 @@ void OperationList::executeOperation(Operation *oper, bool redo) graph_obj->setModified(true); //Case the object is a view is necessary to update the table-view relationships on the model - if(obj_type==ObjView && op_type==Operation::ObjectModified) + if(obj_type==ObjectType::ObjView && op_type==Operation::ObjectModified) model->updateViewRelationships(dynamic_cast(graph_obj)); - else if((obj_type==ObjRelationship || - (obj_type==ObjTable && model->getRelationship(dynamic_cast(object), nullptr))) && + else if((obj_type==ObjectType::ObjRelationship || + (obj_type==ObjectType::ObjTable && model->getRelationship(dynamic_cast(object), nullptr))) && op_type==Operation::ObjectModified) model->validateRelationships(); //If a object had its schema restored is necessary to update the envolved schemas - if((obj_type==ObjTable || obj_type==ObjView) && + if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && ((bkp_obj && graph_obj->getSchema()!=bkp_obj->getSchema() && op_type==Operation::ObjectModified) || op_type==Operation::ObjectMoved)) { @@ -889,12 +889,12 @@ void OperationList::executeOperation(Operation *oper, bool redo) } else if(op_type==Operation::ObjectModified) { - if(obj_type==ObjSchema) + if(obj_type==ObjectType::ObjSchema) { model->validateSchemaRenaming(dynamic_cast(object), bkp_obj->getName()); dynamic_cast(object)->setModified(true); } - else if(obj_type==ObjTag) + else if(obj_type==ObjectType::ObjTag) { vector refs; model->getObjectReferences(object, refs); @@ -909,16 +909,16 @@ void OperationList::executeOperation(Operation *oper, bool redo) //Case the object is a type update the tables that are referencing it if(op_type==Operation::ObjectModified && - (object->getObjectType()==ObjType || object->getObjectType()==ObjDomain || - object->getObjectType()==ObjTable || object->getObjectType()==ObjView || - object->getObjectType()==ObjExtension)) + (object->getObjectType()==ObjectType::ObjType || object->getObjectType()==ObjectType::ObjDomain || + object->getObjectType()==ObjectType::ObjTable || object->getObjectType()==ObjectType::ObjView || + object->getObjectType()==ObjectType::ObjExtension)) { vector ref_objs; model->getObjectReferences(object, ref_objs); for(auto &obj : ref_objs) { - if(obj->getObjectType()==ObjColumn) + if(obj->getObjectType()==ObjectType::ObjColumn) dynamic_cast(obj)->getParentTable()->setModified(true); } } diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index ccab9a30ac..1fb982a28c 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -22,7 +22,7 @@ Operator::Operator(void) { unsigned i; - obj_type=ObjOperator; + obj_type=ObjectType::ObjOperator; for(i=FUNC_OPERATOR; i <= FUNC_RESTRICT; i++) functions[i]=nullptr; @@ -100,14 +100,14 @@ void Operator::setFunction(Function *func, unsigned func_type) if(!func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the parameter count is invalid. To be used by the operator the function must own 1 or 2 parameters */ else if(func->getParameterCount()==0 || func->getParameterCount() > 2) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -142,7 +142,7 @@ void Operator::setFunction(Function *func, unsigned func_type) (argument_types[1]!=QString("\"any\"") && argument_types[1]!=param_type1)))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index 35332c0e9a..fdeffbd3ad 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -20,7 +20,7 @@ OperatorClass::OperatorClass(void) { - obj_type=ObjOpClass; + obj_type=ObjectType::ObjOpClass; family=nullptr; is_default=false; attributes[ParsersAttributes::FAMILY]=QString(); diff --git a/libpgmodeler/src/operatorfamily.cpp b/libpgmodeler/src/operatorfamily.cpp index 35b2595c79..9e128ae719 100644 --- a/libpgmodeler/src/operatorfamily.cpp +++ b/libpgmodeler/src/operatorfamily.cpp @@ -20,7 +20,7 @@ OperatorFamily::OperatorFamily(void) { - obj_type=ObjOpFamily; + obj_type=ObjectType::ObjOpFamily; attributes[ParsersAttributes::INDEX_TYPE]=QString(); } diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 04fd21bee1..e4e55049e4 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -20,7 +20,7 @@ Parameter::Parameter(void) { - obj_type=ObjParameter; + obj_type=ObjectType::ObjParameter; is_in=is_out=is_variadic=false; } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index bbb828d0f1..809a6f1a4e 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -38,7 +38,7 @@ Permission::Permission(BaseObject *obj) throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->object=obj; - this->obj_type=ObjPermission; + this->obj_type=ObjectType::ObjPermission; revoke=cascade=false; attributes[ParsersAttributes::OBJECT]=QString(); @@ -56,10 +56,10 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) bool result=false; unsigned priv_id=static_cast(privilege); - result=(obj_type==ObjTable || obj_type==ObjColumn || obj_type==ObjView || - obj_type==ObjSequence || obj_type==ObjDatabase || obj_type==ObjFunction || - obj_type==ObjAggregate || obj_type==ObjLanguage || obj_type==ObjSchema || - obj_type==ObjTablespace || obj_type==ObjDomain || obj_type==ObjType); + result=(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjView || + obj_type==ObjectType::ObjSequence || obj_type==ObjectType::ObjDatabase || obj_type==ObjectType::ObjFunction || + obj_type==ObjectType::ObjAggregate || obj_type==ObjectType::ObjLanguage || obj_type==ObjectType::ObjSchema || + obj_type==ObjectType::ObjTablespace || obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjType); //Validating privilege @@ -84,30 +84,30 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) View: SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER */ result=result && - (((obj_type==ObjTable || obj_type==ObjView) && + (((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && (priv_id==PrivSelect || priv_id==PrivInsert || priv_id==PrivUpdate || priv_id==PrivDelete || priv_id==PrivReferences || priv_id==PrivTrigger)) || - ((obj_type==ObjTable || obj_type==ObjView) && priv_id==PrivTruncate) || + ((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && priv_id==PrivTruncate) || - (obj_type==ObjColumn && + (obj_type==ObjectType::ObjColumn && (priv_id==PrivSelect ||priv_id==PrivInsert || priv_id==PrivUpdate || priv_id==PrivReferences)) || - (obj_type==ObjSequence && + (obj_type==ObjectType::ObjSequence && (priv_id==PrivUsage || priv_id==PrivSelect || priv_id==PrivUpdate)) || - (obj_type==ObjDatabase && + (obj_type==ObjectType::ObjDatabase && (priv_id==PrivCreate || priv_id==PrivConnect || priv_id==PrivTemporary)) || - ((obj_type==ObjFunction || obj_type==ObjAggregate) && priv_id==PrivExecute) || + ((obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjAggregate) && priv_id==PrivExecute) || - ((obj_type==ObjLanguage || obj_type==ObjType || obj_type==ObjDomain) && priv_id==PrivUsage) || + ((obj_type==ObjectType::ObjLanguage || obj_type==ObjectType::ObjType || obj_type==ObjectType::ObjDomain) && priv_id==PrivUsage) || - (obj_type==ObjSchema && (priv_id==PrivUsage || priv_id==PrivCreate)) || + (obj_type==ObjectType::ObjSchema && (priv_id==PrivUsage || priv_id==PrivCreate)) || - (obj_type==ObjTablespace && priv_id==PrivCreate)); + (obj_type==ObjectType::ObjTablespace && priv_id==PrivCreate)); } return(result); @@ -427,12 +427,12 @@ QString Permission::getCodeDefinition(unsigned def_type) { //Views and Tables uses the same key word when setting permission (TABLE) attributes[ParsersAttributes::TYPE]= - (object->getObjectType()==ObjView ? BaseObject::getSQLName(ObjTable): BaseObject::getSQLName(object->getObjectType())); + (object->getObjectType()==ObjectType::ObjView ? BaseObject::getSQLName(ObjectType::ObjTable): BaseObject::getSQLName(object->getObjectType())); } else attributes[ParsersAttributes::TYPE]=BaseObject::getSchemaName(object->getObjectType()); - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { attributes[ParsersAttributes::OBJECT]=object->getName(true); attributes[ParsersAttributes::PARENT]=dynamic_cast(object)->getParentTable()->getName(true); @@ -459,9 +459,9 @@ QString Permission::getCodeDefinition(unsigned def_type) for(i=0; i < 12; i++) { if(privileges[i] && !grant_option[i]) - priv_list.push_back(object->getObjectType() == ObjColumn ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); + priv_list.push_back(object->getObjectType() == ObjectType::ObjColumn ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); else if(grant_option[i]) - gop_priv_list.push_back(object->getObjectType() == ObjColumn ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); + gop_priv_list.push_back(object->getObjectType() == ObjectType::ObjColumn ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); } attributes[ParsersAttributes::PRIVILEGES] = priv_list.join(QChar(',')); diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index 00ecd0d051..50a3b8dfdd 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -50,7 +50,7 @@ namespace PgModelerNs { { switch(obj_type) { - case ObjRelationship: + case ObjectType::ObjRelationship: Relationship *rel1; rel1=new Relationship(dynamic_cast(copy_obj)); if(!(*psrc_obj)) @@ -58,7 +58,7 @@ namespace PgModelerNs { else (*(dynamic_cast(*psrc_obj)))=(*rel1); break; - case ObjBaseRelationship: + case ObjectType::ObjBaseRelationship: BaseRelationship *rel; rel=new BaseRelationship(dynamic_cast(copy_obj)); if(!(*psrc_obj)) @@ -66,88 +66,88 @@ namespace PgModelerNs { else (*(dynamic_cast(*psrc_obj)))=(*rel); break; - case ObjColumn: + case ObjectType::ObjColumn: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjConstraint: + case ObjectType::ObjConstraint: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjTrigger: + case ObjectType::ObjTrigger: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjRule: + case ObjectType::ObjRule: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjIndex: + case ObjectType::ObjIndex: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjPolicy: + case ObjectType::ObjPolicy: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjTable: + case ObjectType::ObjTable: copyObject(psrc_obj, dynamic_cast
(copy_obj)); break; - case ObjTextbox: + case ObjectType::ObjTextbox: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjOpClass: + case ObjectType::ObjOpClass: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjConversion: + case ObjectType::ObjConversion: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjCast: + case ObjectType::ObjCast: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjDomain: + case ObjectType::ObjDomain: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjTablespace: + case ObjectType::ObjTablespace: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjSchema: + case ObjectType::ObjSchema: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjOpFamily: + case ObjectType::ObjOpFamily: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjFunction: + case ObjectType::ObjFunction: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjAggregate: + case ObjectType::ObjAggregate: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjLanguage: + case ObjectType::ObjLanguage: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjOperator: + case ObjectType::ObjOperator: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjRole: + case ObjectType::ObjRole: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjSequence: + case ObjectType::ObjSequence: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjType: + case ObjectType::ObjType: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjView: + case ObjectType::ObjView: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjCollation: + case ObjectType::ObjCollation: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjExtension: + case ObjectType::ObjExtension: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjTag: + case ObjectType::ObjTag: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjEventTrigger: + case ObjectType::ObjEventTrigger: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjGenericSQL: + case ObjectType::ObjGenericSQL: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; default: diff --git a/libpgmodeler/src/pgmodelerns.h b/libpgmodeler/src/pgmodelerns.h index 0a0f94fb38..bfd034db8e 100644 --- a/libpgmodeler/src/pgmodelerns.h +++ b/libpgmodeler/src/pgmodelerns.h @@ -65,16 +65,16 @@ namespace PgModelerNs { if(!obj) return(""); //Cast objects will not have the name changed since their name are automatically generated - else if(obj->getObjectType()==ObjCast || obj->getObjectType()==ObjDatabase) + else if(obj->getObjectType()==ObjectType::ObjCast || obj->getObjectType()==ObjectType::ObjDatabase) return(obj->getName()); obj_name=obj->getName(fmt_name); obj_type=obj->getObjectType(); - if(!use_suf_on_conflict && obj_type!=ObjOperator) + if(!use_suf_on_conflict && obj_type!=ObjectType::ObjOperator) obj_name += suffix; - counter = (use_suf_on_conflict && obj_type!= ObjOperator? 0 : 1); + counter = (use_suf_on_conflict && obj_type!= ObjectType::ObjOperator? 0 : 1); id=QString::number(obj->getObjectId()); len=obj_name.size() + id.size(); @@ -85,7 +85,7 @@ namespace PgModelerNs { obj_name.chop(id.size() + 3); //Append the id of the object on its name (this is not applied to operators) - if(obj_type!=ObjOperator) + if(obj_type!=ObjectType::ObjOperator) obj_name+=QString("_") + id; } @@ -101,7 +101,7 @@ namespace PgModelerNs { if(/*aux_obj!=obj &&*/ aux_obj->getName(fmt_name)==aux_name) { //For operators is appended a '?' on the name - if(obj_type==ObjOperator) + if(obj_type==ObjectType::ObjOperator) aux_name=QString("%1%2").arg(obj_name).arg(QString("").leftJustified(counter++, oper_uniq_chr)); else { diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index f182050356..52718d2ee7 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -19,7 +19,7 @@ Policy::Policy(void) : TableObject() { - obj_type=ObjPolicy; + obj_type=ObjectType::ObjPolicy; permissive = false; policy_cmd = PolicyCmdType::all; @@ -32,12 +32,12 @@ Policy::Policy(void) : TableObject() void Policy::setParentTable(BaseTable *table) { - if(table && table->getObjectType() != ObjTable) + if(table && table->getObjectType() != ObjectType::ObjTable) { throw Exception(Exception::getErrorMessage(AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) - .arg(BaseObject::getTypeName(ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::ObjTable)), AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 572f580205..dd78fb9192 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -50,7 +50,7 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, { try { - obj_type=ObjRelationship; + obj_type=ObjectType::ObjRelationship; QString str_aux; /* Raises an error if the user tries to create a relationship which some @@ -437,9 +437,9 @@ int Relationship::getObjectIndex(TableObject *object) //Selecting the correct list using the object type obj_type=object->getObjectType(); - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) list=&rel_attributes; - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) @@ -496,7 +496,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) rel_type==RelationshipPart) && !(tab_obj->isAddedByRelationship() && tab_obj->isProtected() && - tab_obj->getObjectType()==ObjConstraint)) + tab_obj->getObjectType()==ObjectType::ObjConstraint)) throw Exception(AsgObjectInvalidRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try @@ -507,9 +507,9 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) { //Gets the object list according the object type obj_type=tab_obj->getObjectType(); - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) obj_list=&rel_attributes; - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) obj_list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) @@ -519,7 +519,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) tab_obj->setParentTable(src_table); //Generates the code for the object only for validation - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::SqlDefinition); else { @@ -590,9 +590,9 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) TableObject *tab_obj=nullptr; Table *recv_table=nullptr; - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) obj_list=&rel_attributes; - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) obj_list=&rel_constraints; else throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -604,7 +604,7 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) tab_obj=obj_list->at(obj_id); recv_table=this->getReceiverTable(); - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { Column *col=nullptr; Constraint *constr=nullptr; @@ -670,12 +670,12 @@ void Relationship::removeObject(TableObject *object) void Relationship::removeAttribute(unsigned attrib_idx) { - removeObject(attrib_idx, ObjColumn); + removeObject(attrib_idx, ObjectType::ObjColumn); } void Relationship::removeConstraint(unsigned constr_idx) { - removeObject(constr_idx, ObjConstraint); + removeObject(constr_idx, ObjectType::ObjConstraint); } vector Relationship::getGeneratedColumns(void) @@ -708,9 +708,9 @@ TableObject *Relationship::getObject(unsigned obj_idx, ObjectType obj_type) { vector *list=nullptr; - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) list=&rel_attributes; - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) list=&rel_constraints; else throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -728,9 +728,9 @@ TableObject *Relationship::getObject(const QString &name, ObjectType obj_type) TableObject *obj_aux=nullptr; bool found=false; - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) list=&rel_attributes; - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) list=&rel_constraints; else throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -762,7 +762,7 @@ Column *Relationship::getAttribute(unsigned attrib_idx) Column *Relationship::getAttribute(const QString &name) { - return(dynamic_cast(getObject(name,ObjColumn))); + return(dynamic_cast(getObject(name,ObjectType::ObjColumn))); } vector Relationship::getAttributes(void) @@ -781,7 +781,7 @@ Constraint *Relationship::getConstraint(unsigned constr_idx) Constraint *Relationship::getConstraint(const QString &name) { - return(dynamic_cast(getObject(name,ObjConstraint))); + return(dynamic_cast(getObject(name,ObjectType::ObjConstraint))); } vector Relationship::getConstraints(void) @@ -801,9 +801,9 @@ unsigned Relationship::getConstraintCount(void) unsigned Relationship::getObjectCount(ObjectType obj_type) { - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) return(rel_attributes.size()); - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) return(rel_constraints.size()); else throw Exception(RefObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -829,7 +829,7 @@ void Relationship::addConstraints(Table *recv_tab) if(constr->getConstraintType()!=ConstraintType::primary_key) { - constr->setName(PgModelerNs::generateUniqueName(constr, (*recv_tab->getObjectList(ObjConstraint)))); + constr->setName(PgModelerNs::generateUniqueName(constr, (*recv_tab->getObjectList(ObjectType::ObjConstraint)))); recv_tab->addConstraint(constr); } else @@ -885,7 +885,7 @@ void Relationship::addColumnsRelGenPart(void) i, i1, i2, id_tab, idx, tab_count; vector columns; - ObjectType types[2]={ObjTable, ObjBaseTable}; + ObjectType types[2]={ObjectType::ObjTable, ObjectType::ObjBaseTable}; ErrorCode err_code=Custom; bool duplic=false, cond=false, /* 0 -> Column created by inheritance relationship @@ -979,12 +979,12 @@ void Relationship::addColumnsRelGenPart(void) for(i2=0; i2 < 2; i2++) { //Checking if the column came from a generalization relationship - if(types[i2]==ObjTable) + if(types[i2]==ObjectType::ObjTable) { - tab_count=aux_tab->getObjectCount(ObjTable); + tab_count=aux_tab->getObjectCount(ObjectType::ObjTable); for(idx=0; idx < tab_count; idx++) { - parent_tab=dynamic_cast
(aux_tab->getObject(idx, ObjTable)); + parent_tab=dynamic_cast
(aux_tab->getObject(idx, ObjectType::ObjTable)); cond=(aux_col->getParentTable()==parent_tab && aux_col->isAddedByGeneralization()); } @@ -1141,7 +1141,7 @@ void Relationship::addConstraintsRelGenPart(void) { Table *parent_tab=dynamic_cast
(getReferenceTable()), *child_tab=dynamic_cast
(getReceiverTable()); - vector *constrs=parent_tab->getObjectList(ObjConstraint); + vector *constrs=parent_tab->getObjectList(ObjectType::ObjConstraint); Constraint *ck_constr=nullptr, *constr=nullptr, *aux_constr=nullptr; try @@ -1152,7 +1152,7 @@ void Relationship::addConstraintsRelGenPart(void) if(constr->getConstraintType()==ConstraintType::check && !constr->isNoInherit()) { - aux_constr=dynamic_cast(child_tab->getObject(constr->getName(), ObjConstraint)); + aux_constr=dynamic_cast(child_tab->getObject(constr->getName(), ObjectType::ObjConstraint)); if(!aux_constr) { @@ -1354,7 +1354,7 @@ void Relationship::addUniqueKey(Table *recv_tab) uq->setName(generateObjectName(UqPattern)); uq->setAlias(generateObjectName(UqPattern, nullptr, true)); - uq->setName(PgModelerNs::generateUniqueName(uq, (*recv_tab->getObjectList(ObjConstraint)))); + uq->setName(PgModelerNs::generateUniqueName(uq, (*recv_tab->getObjectList(ObjectType::ObjConstraint)))); recv_tab->addConstraint(uq); } catch(Exception &e) @@ -1482,7 +1482,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del fk->setName(name); fk->setAlias(fk_alias); - fk->setName(PgModelerNs::generateUniqueName(fk, (*recv_tab->getObjectList(ObjConstraint)))); + fk->setName(PgModelerNs::generateUniqueName(fk, (*recv_tab->getObjectList(ObjectType::ObjConstraint)))); recv_tab->addConstraint(fk); } catch(Exception &e) @@ -1516,7 +1516,7 @@ void Relationship::addAttributes(Table *recv_tab) if(column->getParentTable()) break; - column->setName(PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjColumn)))); + column->setName(PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjectType::ObjColumn)))); column->setAddedByLinking(true); column->setParentRelationship(this); recv_tab->addColumn(column); @@ -1615,7 +1615,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b column->setType(PgSQLType(QString("smallint"))); column->setName(name); - name=PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjColumn))); + name=PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjectType::ObjColumn))); column->setName(name); if(!prev_name.isEmpty()) diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 95264bde0d..717efcd39a 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -22,7 +22,7 @@ unsigned Role::role_id=0; Role::Role(void) { - obj_type=ObjRole; + obj_type=ObjectType::ObjRole; object_id=Role::role_id++; for(unsigned i=0; i <= OpBypassRls; i++) diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index 2927541d1e..14e97174b2 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -21,7 +21,7 @@ Rule::Rule(void) { execution_type=BaseType::null; - obj_type=ObjRule; + obj_type=ObjectType::ObjRule; attributes[ParsersAttributes::EVENT_TYPE]=QString(); attributes[ParsersAttributes::TABLE]=QString(); attributes[ParsersAttributes::CONDITION]=QString(); diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index b14f82ae6b..b3447cccda 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -20,7 +20,7 @@ Schema::Schema(void) { - obj_type=ObjSchema; + obj_type=ObjectType::ObjSchema; fill_color=QColor(225,225,225, 80); rect_visible=false; attributes[ParsersAttributes::FILL_COLOR]=QString(); @@ -34,7 +34,7 @@ void Schema::setName(const QString &name) if(name.mid(0,3)==QString("pg_")) throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjSchema)), + .arg(BaseObject::getTypeName(ObjectType::ObjSchema)), AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 97b2a90ef3..1efcf3b226 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -27,7 +27,7 @@ const QString Sequence::MaxBigNegativeValue=QString("-9223372036854775808"); Sequence::Sequence(void) { - obj_type=ObjSequence; + obj_type=ObjectType::ObjSequence; cycle=false; setDefaultValues(PgSQLType(QString("serial"))); owner_col=nullptr; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index a488ade08f..c615a361a2 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -24,7 +24,7 @@ const QString Table::DataLineBreak = QString("%1%2").arg("⸣").arg('\n'); Table::Table(void) : BaseTable() { - obj_type=ObjTable; + obj_type=ObjectType::ObjTable; with_oid=gen_alter_cmds=unlogged=rls_enabled=rls_forced=false; attributes[ParsersAttributes::COLUMNS]=QString(); attributes[ParsersAttributes::INH_COLUMNS]=QString(); @@ -122,8 +122,8 @@ Table *Table::getPartitionedTable(void) void Table::setProtected(bool value) { - ObjectType obj_types[]={ ObjColumn, ObjConstraint, - ObjIndex, ObjRule, ObjTrigger }; + ObjectType obj_types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint, + ObjectType::ObjIndex, ObjectType::ObjRule, ObjectType::ObjTrigger }; unsigned i; vector::iterator itr, itr_end; vector *list=nullptr; @@ -161,8 +161,8 @@ void Table::setCommentAttribute(TableObject *tab_obj) attribs[ParsersAttributes::SIGNATURE]=tab_obj->getSignature(); attribs[ParsersAttributes::SQL_OBJECT]=tab_obj->getSQLName(); - attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==ObjColumn ? ParsersAttributes::_TRUE_ : QString()); - attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==ObjConstraint ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==ObjectType::ObjColumn ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==ObjectType::ObjConstraint ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::TABLE]=this->getName(true); attribs[ParsersAttributes::NAME]=tab_obj->getName(true); attribs[ParsersAttributes::COMMENT]=QString(tab_obj->getComment()).replace(QString("'"), QString("''"));; @@ -190,18 +190,18 @@ void Table::setAncestorTableAttribute(void) void Table::setRelObjectsIndexesAttribute(void) { attribs_map aux_attribs; - vector *> ObjIndexes={ &col_indexes, &constr_indexes }; + vector *> obj_indexes={ &col_indexes, &constr_indexes }; QString attribs[]={ ParsersAttributes::COL_INDEXES, ParsersAttributes::CONSTR_INDEXES }; - ObjectType obj_types[]={ ObjColumn, ObjConstraint }; - unsigned idx=0, size=ObjIndexes.size(); + ObjectType obj_types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint }; + unsigned idx=0, size=obj_indexes.size(); for(idx=0; idx < size; idx++) { attributes[attribs[idx]]=QString(); - if(!ObjIndexes[idx]->empty()) + if(!obj_indexes[idx]->empty()) { - for(auto &obj_idx : (*ObjIndexes[idx])) + for(auto &obj_idx : (*obj_indexes[idx])) { aux_attribs[ParsersAttributes::NAME]=obj_idx.first; aux_attribs[ParsersAttributes::INDEX]=QString::number(obj_idx.second); @@ -331,17 +331,17 @@ void Table::setConstraintsAttribute(unsigned def_type) vector *Table::getObjectList(ObjectType obj_type) { - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) return(&columns); - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) return(&constraints); - else if(obj_type==ObjRule) + else if(obj_type==ObjectType::ObjRule) return(&rules); - else if(obj_type==ObjTrigger) + else if(obj_type==ObjectType::ObjTrigger) return(&triggers); - else if(obj_type==ObjIndex) + else if(obj_type==ObjectType::ObjIndex) return(&indexes); - else if(obj_type==ObjPolicy) + else if(obj_type==ObjectType::ObjPolicy) return(&policies); else throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -360,10 +360,10 @@ void Table::addObject(BaseObject *obj, int obj_idx) #ifdef DEMO_VERSION #warning "DEMO VERSION: table children objects creation limit." - vector *obj_list=(obj_type!=ObjTable ? getObjectList(obj_type) : nullptr); + vector *obj_list=(obj_type!=ObjectType::ObjTable ? getObjectList(obj_type) : nullptr); if((obj_list && obj_list->size() >= GlobalAttributes::MaxObjectCount) || - (obj_type==ObjTable && ancestor_tables.size() >= GlobalAttributes::MaxObjectCount)) + (obj_type==ObjectType::ObjTable && ancestor_tables.size() >= GlobalAttributes::MaxObjectCount)) throw Exception(trUtf8("In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2'") .arg(GlobalAttributes::MaxObjectCount) .arg(BaseObject::getTypeName(obj_type)), @@ -385,17 +385,17 @@ void Table::addObject(BaseObject *obj, int obj_idx) } //Raises an error if the user try to set the table as ancestor/copy of itself - else if((obj_type==ObjTable || obj_type==ObjBaseTable) && obj==this) + else if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjBaseTable) && obj==this) throw Exception(InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); switch(obj_type) { - case ObjColumn: - case ObjConstraint: - case ObjTrigger: - case ObjIndex: - case ObjRule: - case ObjPolicy: + case ObjectType::ObjColumn: + case ObjectType::ObjConstraint: + case ObjectType::ObjTrigger: + case ObjectType::ObjIndex: + case ObjectType::ObjRule: + case ObjectType::ObjPolicy: TableObject *tab_obj; vector *obj_list; Column *col; @@ -420,14 +420,14 @@ void Table::addObject(BaseObject *obj, int obj_idx) .arg(this->getName()), InvColumnTableType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) { //Raises a error if the user try to add a second primary key on the table if(dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::primary_key && this->getPrimaryKey()) throw Exception(AsgExistingPrimaryKeyTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(obj_type==ObjTrigger) + else if(obj_type==ObjectType::ObjTrigger) dynamic_cast(tab_obj)->validateTrigger(); obj_list=getObjectList(obj_type); @@ -444,16 +444,16 @@ void Table::addObject(BaseObject *obj, int obj_idx) obj_list->push_back(tab_obj); } - if(obj_type==ObjColumn || obj_type==ObjConstraint) + if(obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) { updateAlterCmdsStatus(); - if(obj_type==ObjConstraint) + if(obj_type==ObjectType::ObjConstraint) dynamic_cast(tab_obj)->setColumnsNotNull(true); } break; - case ObjTable: + case ObjectType::ObjTable: Table *tab; tab=dynamic_cast
(obj); if(obj_idx < 0 || obj_idx >= static_cast(ancestor_tables.size())) @@ -719,7 +719,7 @@ void Table::removeObject(BaseObject *obj) if(tab_obj) removeObject(getObjectIndex(tab_obj), obj->getObjectType()); else - removeObject(obj->getName(true), ObjTable); + removeObject(obj->getName(true), ObjectType::ObjTable); } } catch(Exception &e) @@ -743,10 +743,10 @@ void Table::removeObject(const QString &name, ObjectType obj_type) void Table::removeObject(unsigned obj_idx, ObjectType obj_type) { //Raises an error if the user try to remove a object with invalid type - if(!TableObject::isTableObject(obj_type) && obj_type!=ObjTable) + if(!TableObject::isTableObject(obj_type) && obj_type!=ObjectType::ObjTable) throw Exception(RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(obj_type==ObjTable && obj_idx < ancestor_tables.size()) + else if(obj_type==ObjectType::ObjTable && obj_idx < ancestor_tables.size()) { vector
::iterator itr; Table *tab=nullptr; @@ -766,7 +766,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) } } } - else if(obj_type!=ObjTable && obj_type!=ObjBaseTable) + else if(obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjBaseTable) { vector *obj_list=nullptr; vector::iterator itr; @@ -777,7 +777,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) if(obj_idx >= obj_list->size()) throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type!=ObjColumn) + if(obj_type!=ObjectType::ObjColumn) { itr=obj_list->begin() + obj_idx; TableObject *tab_obj=(*itr); @@ -833,7 +833,7 @@ void Table::removeColumn(const QString &name) { try { - removeObject(name,ObjColumn); + removeObject(name,ObjectType::ObjColumn); } catch(Exception &e) { @@ -845,7 +845,7 @@ void Table::removeColumn(unsigned idx) { try { - removeObject(idx,ObjColumn); + removeObject(idx,ObjectType::ObjColumn); } catch(Exception &e) { @@ -857,7 +857,7 @@ void Table::removeTrigger(const QString &name) { try { - removeObject(name,ObjTrigger); + removeObject(name,ObjectType::ObjTrigger); } catch(Exception &e) { @@ -869,7 +869,7 @@ void Table::removeTrigger(unsigned idx) { try { - removeObject(idx,ObjTrigger); + removeObject(idx,ObjectType::ObjTrigger); } catch(Exception &e) { @@ -881,7 +881,7 @@ void Table::removeIndex(const QString &name) { try { - removeObject(name,ObjIndex); + removeObject(name,ObjectType::ObjIndex); } catch(Exception &e) { @@ -893,7 +893,7 @@ void Table::removeIndex(unsigned idx) { try { - removeObject(idx,ObjIndex); + removeObject(idx,ObjectType::ObjIndex); } catch(Exception &e) { @@ -905,7 +905,7 @@ void Table::removeRule(const QString &name) { try { - removeObject(name,ObjRule); + removeObject(name,ObjectType::ObjRule); } catch(Exception &e) { @@ -917,7 +917,7 @@ void Table::removeRule(unsigned idx) { try { - removeObject(idx,ObjRule); + removeObject(idx,ObjectType::ObjRule); } catch(Exception &e) { @@ -929,7 +929,7 @@ void Table::removePolicy(const QString &name) { try { - removeObject(name, ObjPolicy); + removeObject(name, ObjectType::ObjPolicy); } catch(Exception &e) { @@ -941,7 +941,7 @@ void Table::removePolicy(unsigned idx) { try { - removeObject(idx, ObjPolicy); + removeObject(idx, ObjectType::ObjPolicy); } catch(Exception &e) { @@ -953,7 +953,7 @@ void Table::removeConstraint(const QString &name) { try { - removeObject(name,ObjConstraint); + removeObject(name,ObjectType::ObjConstraint); } catch(Exception &e) { @@ -965,7 +965,7 @@ void Table::removeConstraint(unsigned idx) { try { - removeObject(idx,ObjConstraint); + removeObject(idx,ObjectType::ObjConstraint); } catch(Exception &e) { @@ -977,7 +977,7 @@ void Table::removeAncestorTable(const QString &name) { try { - removeObject(name,ObjTable); + removeObject(name,ObjectType::ObjTable); } catch(Exception &e) { @@ -989,7 +989,7 @@ void Table::removeAncestorTable(unsigned idx) { try { - removeObject(idx,ObjTable); + removeObject(idx,ObjectType::ObjTable); } catch(Exception &e) { @@ -1071,7 +1071,7 @@ BaseObject *Table::getObject(const QString &name, ObjectType obj_type, int &obj_ } else obj_idx=-1; } - else if(obj_type==ObjTable) + else if(obj_type==ObjectType::ObjTable) { vector
::iterator itr_tab, itr_end_tab; QString tab_name, aux_name=name; @@ -1108,7 +1108,7 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) { vector *obj_list=nullptr; - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) { //Raises an error if the object index is out of bound if(obj_idx >= ancestor_tables.size()) @@ -1130,12 +1130,12 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) Table *Table::getAncestorTable(const QString &name) { int idx; - return(dynamic_cast
(getObject(name,ObjTable,idx))); + return(dynamic_cast
(getObject(name,ObjectType::ObjTable,idx))); } Table *Table::getAncestorTable(unsigned idx) { - return(dynamic_cast
(getObject(idx,ObjTable))); + return(dynamic_cast
(getObject(idx,ObjectType::ObjTable))); } Column *Table::getColumn(const QString &name, bool ref_old_name) @@ -1143,7 +1143,7 @@ Column *Table::getColumn(const QString &name, bool ref_old_name) if(!ref_old_name) { int idx; - return(dynamic_cast(getObject(name,ObjColumn,idx))); + return(dynamic_cast(getObject(name,ObjectType::ObjColumn,idx))); } else { @@ -1170,62 +1170,62 @@ Column *Table::getColumn(const QString &name, bool ref_old_name) Column *Table::getColumn(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjColumn))); + return(dynamic_cast(getObject(idx,ObjectType::ObjColumn))); } Trigger *Table::getTrigger(const QString &name) { int idx; - return(dynamic_cast(getObject(name,ObjTrigger,idx))); + return(dynamic_cast(getObject(name,ObjectType::ObjTrigger,idx))); } Trigger *Table::getTrigger(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjTrigger))); + return(dynamic_cast(getObject(idx,ObjectType::ObjTrigger))); } Constraint *Table::getConstraint(const QString &name) { int idx; - return(dynamic_cast(getObject(name,ObjConstraint,idx))); + return(dynamic_cast(getObject(name,ObjectType::ObjConstraint,idx))); } Constraint *Table::getConstraint(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjConstraint))); + return(dynamic_cast(getObject(idx,ObjectType::ObjConstraint))); } Index *Table::getIndex(const QString &name) { int idx; - return(dynamic_cast(getObject(name,ObjIndex,idx))); + return(dynamic_cast(getObject(name,ObjectType::ObjIndex,idx))); } Index *Table::getIndex(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjIndex))); + return(dynamic_cast(getObject(idx,ObjectType::ObjIndex))); } Rule *Table::getRule(const QString &name) { int idx; - return(dynamic_cast(getObject(name,ObjRule,idx))); + return(dynamic_cast(getObject(name,ObjectType::ObjRule,idx))); } Rule *Table::getRule(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjRule))); + return(dynamic_cast(getObject(idx,ObjectType::ObjRule))); } Policy *Table::getPolicy(const QString &name) { int idx; - return(dynamic_cast(getObject(name, ObjPolicy,idx))); + return(dynamic_cast(getObject(name, ObjectType::ObjPolicy,idx))); } Policy *Table::getPolicy(unsigned idx) { - return(dynamic_cast(getObject(idx, ObjPolicy))); + return(dynamic_cast(getObject(idx, ObjectType::ObjPolicy))); } unsigned Table::getColumnCount(void) @@ -1265,9 +1265,9 @@ unsigned Table::getAncestorTableCount(void) unsigned Table::getObjectCount(ObjectType obj_type, bool inc_added_by_rel) { - if(TableObject::isTableObject(obj_type) || obj_type==ObjTable) + if(TableObject::isTableObject(obj_type) || obj_type==ObjectType::ObjTable) { - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) { return(ancestor_tables.size()); } @@ -1377,9 +1377,9 @@ void Table::setRelObjectsIndexes(const vector &obj_names, const vector< map *obj_idxs_map=nullptr; unsigned idx=0, size=obj_names.size(); - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) obj_idxs_map=&col_indexes; - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) obj_idxs_map=&constr_indexes; else throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1394,12 +1394,12 @@ void Table::saveRelObjectsIndexes(ObjectType obj_type) map *obj_idxs_map=nullptr; vector *list=nullptr; - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { obj_idxs_map=&col_indexes; list=&columns; } - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) { obj_idxs_map=&constr_indexes; list=&constraints; @@ -1424,14 +1424,14 @@ void Table::saveRelObjectsIndexes(ObjectType obj_type) void Table::saveRelObjectsIndexes(void) { - saveRelObjectsIndexes(ObjColumn); - saveRelObjectsIndexes(ObjConstraint); + saveRelObjectsIndexes(ObjectType::ObjColumn); + saveRelObjectsIndexes(ObjectType::ObjConstraint); } void Table::restoreRelObjectsIndexes(void) { - restoreRelObjectsIndexes(ObjColumn); - restoreRelObjectsIndexes(ObjConstraint); + restoreRelObjectsIndexes(ObjectType::ObjColumn); + restoreRelObjectsIndexes(ObjectType::ObjConstraint); if(!col_indexes.empty() || !constr_indexes.empty()) { @@ -1444,7 +1444,7 @@ void Table::restoreRelObjectsIndexes(ObjectType obj_type) { map *obj_idxs=nullptr; - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) obj_idxs=&col_indexes; else obj_idxs=&constr_indexes; @@ -1672,7 +1672,7 @@ void Table::operator = (Table &tab) bool Table::isReferRelationshipAddedObject(void) { vector::iterator itr, itr_end; - ObjectType types[]={ ObjColumn, ObjConstraint }; + ObjectType types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint }; bool found=false; for(unsigned i=0; i < 2 && !found; i++) @@ -1743,7 +1743,7 @@ void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2 (*itr2)=aux_obj; } - if(obj_type!=ObjColumn && obj_type!=ObjConstraint) + if(obj_type!=ObjectType::ObjColumn && obj_type!=ObjectType::ObjConstraint) BaseObject::swapObjectsIds(aux_obj, aux_obj1, false); setCodeInvalidated(true); @@ -1831,12 +1831,12 @@ void Table::getColumnReferences(Column *column, vector &refs, boo vector Table::getObjects(bool excl_cols_constr) { vector list; - vector types={ ObjColumn, ObjConstraint, - ObjTrigger, ObjIndex, ObjRule, ObjPolicy }; + vector types={ ObjectType::ObjColumn, ObjectType::ObjConstraint, + ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjRule, ObjectType::ObjPolicy }; for(auto type : types) { - if(excl_cols_constr && (type == ObjColumn || type == ObjConstraint)) + if(excl_cols_constr && (type == ObjectType::ObjColumn || type == ObjectType::ObjConstraint)) continue; list.insert(list.end(), getObjectList(type)->begin(), getObjectList(type)->end()) ; @@ -1857,8 +1857,8 @@ vector Table::getPartitionKeys(void) void Table::setCodeInvalidated(bool value) { - vector types={ ObjColumn, ObjConstraint, - ObjTrigger, ObjIndex, ObjRule, ObjPolicy }; + vector types={ ObjectType::ObjColumn, ObjectType::ObjConstraint, + ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjRule, ObjectType::ObjPolicy }; for(auto type : types) { @@ -1954,7 +1954,7 @@ QString Table::getInitialDataCommands(void) //Separating valid columns (selected) from the invalids (ignored) for(QString col_name : col_names) { - if(getObjectIndex(col_name, ObjColumn) >= 0) + if(getObjectIndex(col_name, ObjectType::ObjColumn) >= 0) selected_cols.append(col_name); else ignored_cols.append(curr_col); @@ -2055,8 +2055,8 @@ void Table::setObjectListsCapacity(unsigned capacity) unsigned Table::getMaxObjectCount(void) { unsigned count = 0, max = 0; - vector types = { ObjColumn, ObjConstraint, ObjIndex, - ObjRule, ObjTrigger, ObjPolicy }; + vector types = { ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjIndex, + ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjPolicy }; for(auto type : types) { diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 650183d93b..4a9c54ebe6 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -96,7 +96,7 @@ class Table: public BaseTable { //! \brief The partitioning mode/type used by the table PartitioningType partitioning_type; - /*! \brief Gets one table ancestor (ObjTable) or copy (ObjBaseTable) using its name and stores + /*! \brief Gets one table ancestor (ObjectType::ObjTable) or copy (ObjectType::ObjBaseTable) using its name and stores the index of the found object on parameter 'obj_idx' */ BaseObject *getObject(const QString &name, ObjectType obj_type, int &obj_idx); diff --git a/libpgmodeler/src/tableobject.cpp b/libpgmodeler/src/tableobject.cpp index da62b1dc79..7e10fd4b5f 100644 --- a/libpgmodeler/src/tableobject.cpp +++ b/libpgmodeler/src/tableobject.cpp @@ -89,8 +89,8 @@ bool TableObject::isDeclaredInTable(void) bool TableObject::isTableObject(ObjectType type) { - return(type==ObjColumn || type==ObjConstraint || type==ObjTrigger || - type==ObjRule || type==ObjIndex || type==ObjPolicy); + return(type==ObjectType::ObjColumn || type==ObjectType::ObjConstraint || type==ObjectType::ObjTrigger || + type==ObjectType::ObjRule || type==ObjectType::ObjIndex || type==ObjectType::ObjPolicy); } void TableObject::operator = (TableObject &object) diff --git a/libpgmodeler/src/tablespace.cpp b/libpgmodeler/src/tablespace.cpp index 00d85ea0d9..bab88deb13 100644 --- a/libpgmodeler/src/tablespace.cpp +++ b/libpgmodeler/src/tablespace.cpp @@ -22,7 +22,7 @@ unsigned Tablespace::tabspace_id=1000; Tablespace::Tablespace(void) { - obj_type=ObjTablespace; + obj_type=ObjectType::ObjTablespace; attributes[ParsersAttributes::DIRECTORY]=QString(); object_id=Tablespace::tabspace_id++; } @@ -34,7 +34,7 @@ void Tablespace::setName(const QString &name) if(name.mid(0,3)==QString("pg_")) throw Exception(Exception::getErrorMessage(AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjTablespace)), + .arg(BaseObject::getTypeName(ObjectType::ObjTablespace)), AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 1f4d327424..76eec3b73c 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -26,7 +26,7 @@ Tag::Tag(void) ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, ParsersAttributes::TABLE_EXT_BODY }; - obj_type=ObjTag; + obj_type=ObjectType::ObjTag; object_id=Tag::tag_id++; attributes[ParsersAttributes::STYLES]=QString(); diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index 3ea3982db9..312c1a6197 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -20,7 +20,7 @@ Textbox::Textbox(void) { - obj_type=ObjTextbox; + obj_type=ObjectType::ObjTextbox; font_size=9.0f; text_attributes[0]=text_attributes[1]=text_attributes[2]=false; attributes[ParsersAttributes::ITALIC]=QString(); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 8f9e8502a2..6132702ea2 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -26,7 +26,7 @@ Trigger::Trigger(void) function=nullptr; is_exec_per_row=is_constraint=is_deferrable=false; - obj_type=ObjTrigger; + obj_type=ObjectType::ObjTrigger; referenced_table=nullptr; for(i=0; i < 4; i++) @@ -98,7 +98,7 @@ void Trigger::setFunction(Function *func) if(!func) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjTrigger)), + .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -109,7 +109,7 @@ void Trigger::setFunction(Function *func) else if(func->getParameterCount()!=0) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjTrigger)), + .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(function != func); @@ -249,7 +249,7 @@ void Trigger::removeColumns(void) void Trigger::setReferecendTable(BaseTable *ref_table) { //If the referenced table isn't valid raises an error - if(ref_table && ref_table->getObjectType()!=ObjTable) + if(ref_table && ref_table->getObjectType()!=ObjectType::ObjTable) throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(referenced_table != ref_table); @@ -445,11 +445,11 @@ void Trigger::validateTrigger(void) if(!is_constraint) { //The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers - if(firing_type==FiringType::instead_of && parent_type==ObjTable) + if(firing_type==FiringType::instead_of && parent_type==ObjectType::ObjTable) throw Exception(InvTableTriggerInsteadOfFiring,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The INSTEAD OF mode cannot be used on view triggers that executes for each statement - else if(firing_type==FiringType::instead_of && parent_type==ObjView && !is_exec_per_row) + else if(firing_type==FiringType::instead_of && parent_type==ObjectType::ObjView && !is_exec_per_row) throw Exception(InvUsageInsteadOfOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event @@ -457,11 +457,11 @@ void Trigger::validateTrigger(void) throw Exception(InvUsageInsteadOfUpdateTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table - else if(events[EventType::on_truncate] && (is_exec_per_row || parent_type==ObjView)) + else if(events[EventType::on_truncate] && (is_exec_per_row || parent_type==ObjectType::ObjView)) throw Exception(InvUsageTruncateOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A view trigger cannot be AFTER/BEFORE when it executes for each row - else if(parent_type==ObjView && is_exec_per_row && (firing_type==FiringType::after || firing_type==FiringType::before)) + else if(parent_type==ObjectType::ObjView && is_exec_per_row && (firing_type==FiringType::after || firing_type==FiringType::before)) throw Exception(InvUsageAfterBeforeViewTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Only constraint triggers can be deferrable or reference another table diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 7194c08e67..471547a77a 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -20,7 +20,7 @@ Type::Type(void) { - obj_type=ObjType; + obj_type=ObjectType::ObjType; setConfiguration(EnumerationType); attributes[ParsersAttributes::BASE_TYPE]=QString(); @@ -231,7 +231,7 @@ void Type::setFunction(unsigned func_id, Function *func) else if(!func && (func_id==InputFunc || func_id==OutputFunc)) throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjType)), + .arg(BaseObject::getTypeName(ObjectType::ObjType)), AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(func) @@ -254,7 +254,7 @@ void Type::setFunction(unsigned func_id, Function *func) func_id==AnalyzeFunc || func_id==CanonicalFunc))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjType)), + .arg(BaseObject::getTypeName(ObjectType::ObjType)), AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Checking the return types of function in relation to type. INPUT, RECV and CANONICAL functions must return the data type that is being defined according to the @@ -274,7 +274,7 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==SubtypeDiffFunc && func->getReturnType()!=QString("double precision"))) throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjType)), + .arg(BaseObject::getTypeName(ObjectType::ObjType)), AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Validating the parameter types of function in relation to the type configuration. diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index 429114b68b..2e797f5877 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -20,7 +20,7 @@ TypeAttribute::TypeAttribute(void) { - obj_type=ObjTypeAttribute; + obj_type=ObjectType::ObjTypeAttribute; } void TypeAttribute::setType(PgSQLType type) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 62500a5dcd..5e783fe089 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -20,7 +20,7 @@ View::View(void) : BaseTable() { - obj_type=ObjView; + obj_type=ObjectType::ObjView; materialized=recursive=with_no_data=false; attributes[ParsersAttributes::DEFINITION]=QString(); attributes[ParsersAttributes::REFERENCES]=QString(); @@ -37,7 +37,7 @@ View::View(void) : BaseTable() View::~View(void) { - ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex }; + ObjectType types[]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex }; vector *list=nullptr; for(unsigned i=0; i < 3; i++) @@ -67,7 +67,7 @@ void View::setSchema(BaseObject *schema) void View::setProtected(bool value) { - ObjectType obj_types[]={ ObjRule, ObjTrigger }; + ObjectType obj_types[]={ ObjectType::ObjRule, ObjectType::ObjTrigger }; unsigned i; vector::iterator itr, itr_end; vector *list=nullptr; @@ -605,7 +605,7 @@ QString View::getCodeDefinition(unsigned def_type) void View::setSQLObjectAttribute(void) { if(materialized) - attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjView); + attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::ObjView); } void View::setObjectListsCapacity(unsigned capacity) @@ -622,7 +622,7 @@ void View::setObjectListsCapacity(unsigned capacity) unsigned View::getMaxObjectCount(void) { unsigned count = 0, max = references.size(); - vector types = { ObjIndex, ObjRule, ObjTrigger }; + vector types = { ObjectType::ObjIndex, ObjectType::ObjRule, ObjectType::ObjTrigger }; for(auto type : types) { @@ -721,7 +721,7 @@ void View::addObject(BaseObject *obj, int obj_idx) tab_obj->getCodeDefinition(SchemaParser::SqlDefinition); //Make a additional validation if the object is a trigger - if(tab_obj->getObjectType()==ObjTrigger) + if(tab_obj->getObjectType()==ObjectType::ObjTrigger) dynamic_cast(tab_obj)->validateTrigger(); //Inserts the object at specified position @@ -824,7 +824,7 @@ void View::removeTrigger(unsigned idx) { try { - removeObject(idx, ObjTrigger); + removeObject(idx, ObjectType::ObjTrigger); } catch(Exception &e) { @@ -836,7 +836,7 @@ void View::removeRule(unsigned idx) { try { - removeObject(idx, ObjRule); + removeObject(idx, ObjectType::ObjRule); } catch(Exception &e) { @@ -848,7 +848,7 @@ void View::removeIndex(unsigned idx) { try { - removeObject(idx, ObjIndex); + removeObject(idx, ObjectType::ObjIndex); } catch(Exception &e) { @@ -889,7 +889,7 @@ Trigger *View::getTrigger(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, ObjTrigger))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjTrigger))); } catch(Exception &e) { @@ -901,7 +901,7 @@ Rule *View::getRule(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, ObjRule))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjRule))); } catch(Exception &e) { @@ -913,7 +913,7 @@ Index *View::getIndex(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, ObjIndex))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ObjIndex))); } catch(Exception &e) { @@ -950,11 +950,11 @@ unsigned View::getIndexCount() vector *View::getObjectList(ObjectType obj_type) { - if(obj_type==ObjTrigger) + if(obj_type==ObjectType::ObjTrigger) return(&triggers); - else if(obj_type==ObjRule) + else if(obj_type==ObjectType::ObjRule) return(&rules); - else if(obj_type==ObjIndex) + else if(obj_type==ObjectType::ObjIndex) return(&indexes); else throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index 1990c19173..85a56f2a3f 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -18,7 +18,7 @@ #include "aggregatewidget.h" -AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, ObjAggregate) +AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjAggregate) { try { @@ -30,9 +30,9 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, ObjA initial_cond_hl=new SyntaxHighlighter(initial_cond_txt); initial_cond_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - final_func_sel=new ObjectSelectorWidget(ObjFunction, true, this); - transition_func_sel=new ObjectSelectorWidget(ObjFunction, true, this); - sort_op_sel=new ObjectSelectorWidget(ObjOperator, true, this); + final_func_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + transition_func_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + sort_op_sel=new ObjectSelectorWidget(ObjectType::ObjOperator, true, this); input_type=new PgSQLTypeWidget(this, trUtf8("Input Data Type")); state_type=new PgSQLTypeWidget(this, trUtf8("State Data Type")); @@ -66,7 +66,7 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, ObjA funcaoagregacao_grid->addWidget(frame, funcaoagregacao_grid->count()+1, 0, 1, 2); frame->setParent(this); - configureFormLayout(funcaoagregacao_grid, ObjAggregate); + configureFormLayout(funcaoagregacao_grid, ObjectType::ObjAggregate); setRequiredField(state_type); setRequiredField(input_type); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 96c1cb837e..5948b26ae1 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -38,16 +38,16 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid ParsersAttributes::TABLE_BODY, //10 ParsersAttributes::TABLE_EXT_BODY, //11 ParsersAttributes::TABLE_TITLE, //12 - BaseObject::getSchemaName(ObjRule), //13 - BaseObject::getSchemaName(ObjRule), //14 - BaseObject::getSchemaName(ObjIndex), //15 - BaseObject::getSchemaName(ObjIndex), //16 - BaseObject::getSchemaName(ObjTrigger), //17 - BaseObject::getSchemaName(ObjTrigger), //18 - BaseObject::getSchemaName(ObjConstraint), //19 - BaseObject::getSchemaName(ObjConstraint), //20 - BaseObject::getSchemaName(ObjPolicy), //21 - BaseObject::getSchemaName(ObjPolicy), //22 + BaseObject::getSchemaName(ObjectType::ObjRule), //13 + BaseObject::getSchemaName(ObjectType::ObjRule), //14 + BaseObject::getSchemaName(ObjectType::ObjIndex), //15 + BaseObject::getSchemaName(ObjectType::ObjIndex), //16 + BaseObject::getSchemaName(ObjectType::ObjTrigger), //17 + BaseObject::getSchemaName(ObjectType::ObjTrigger), //18 + BaseObject::getSchemaName(ObjectType::ObjConstraint), //19 + BaseObject::getSchemaName(ObjectType::ObjConstraint), //20 + BaseObject::getSchemaName(ObjectType::ObjPolicy), //21 + BaseObject::getSchemaName(ObjectType::ObjPolicy), //22 ParsersAttributes::VIEW_SCHEMA_NAME, //21 -> 23 ParsersAttributes::VIEW_NAME, //22 ParsersAttributes::VIEW_BODY, //23 @@ -57,7 +57,7 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid ParsersAttributes::REF_COLUMN, //27 ParsersAttributes::REF_TABLE, //28 ParsersAttributes::REFERENCE, //29 - BaseObject::getSchemaName(ObjTextbox), //30 + BaseObject::getSchemaName(ObjectType::ObjTextbox), //30 ParsersAttributes::COLUMN, //31 ParsersAttributes::COLUMN, //32 ParsersAttributes::INH_COLUMN, //33 @@ -161,7 +161,7 @@ void AppearanceConfigWidget::loadExampleModel(void) GlobalAttributes::DirSeparator + GlobalAttributes::ExampleModel); - count=model->getObjectCount(ObjTable); + count=model->getObjectCount(ObjectType::ObjTable); for(i=0; i < count; i++) { tab=new TableView(model->getTable(i)); @@ -169,28 +169,28 @@ void AppearanceConfigWidget::loadExampleModel(void) scene->addItem(tab); } - count=model->getObjectCount(ObjView); + count=model->getObjectCount(ObjectType::ObjView); for(i=0; i < count; i++) { view=new GraphicalView(model->getView(i)); scene->addItem(view); } - count=model->getObjectCount(ObjRelationship); + count=model->getObjectCount(ObjectType::ObjRelationship); for(i=0; i < count; i++) { - rel=new RelationshipView(model->getRelationship(i, ObjRelationship)); + rel=new RelationshipView(model->getRelationship(i, ObjectType::ObjRelationship)); scene->addItem(rel); } - count=model->getObjectCount(ObjBaseRelationship); + count=model->getObjectCount(ObjectType::ObjBaseRelationship); for(i=0; i < count; i++) { - rel=new RelationshipView(model->getRelationship(i, ObjBaseRelationship)); + rel=new RelationshipView(model->getRelationship(i, ObjectType::ObjBaseRelationship)); scene->addItem(rel); } - count=model->getObjectCount(ObjTextbox); + count=model->getObjectCount(ObjectType::ObjTextbox); for(i=0; i < count; i++) { txtbox=new StyledTextboxView(model->getTextbox(i)); diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp index cfdc8a822a..6e290d178f 100644 --- a/libpgmodeler_ui/src/baseform.cpp +++ b/libpgmodeler_ui/src/baseform.cpp @@ -127,7 +127,7 @@ void BaseForm::setMainWidget(BaseObjectWidget *widget) { if(!widget) return; - if(widget->getHandledObjectType()!=ObjBaseObject && widget->windowTitle().isEmpty()) + if(widget->getHandledObjectType()!=ObjectType::ObjBaseObject && widget->windowTitle().isEmpty()) setWindowTitle(trUtf8("%1 properties").arg(BaseObject::getTypeName(widget->getHandledObjectType()))); else setWindowTitle(widget->windowTitle()); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 32bfd24083..41b2c8bcb5 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -57,10 +57,10 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge connect(edt_perms_tb, SIGNAL(clicked(bool)),this, SLOT(editPermissions(void))); connect(append_sql_tb, SIGNAL(clicked(bool)),this, SLOT(editCustomSQL(void))); - schema_sel=new ObjectSelectorWidget(ObjSchema, true, this); - collation_sel=new ObjectSelectorWidget(ObjCollation, true, this); - tablespace_sel=new ObjectSelectorWidget(ObjTablespace, true, this); - owner_sel=new ObjectSelectorWidget(ObjRole, true, this); + schema_sel=new ObjectSelectorWidget(ObjectType::ObjSchema, true, this); + collation_sel=new ObjectSelectorWidget(ObjectType::ObjCollation, true, this); + tablespace_sel=new ObjectSelectorWidget(ObjectType::ObjTablespace, true, this); + owner_sel=new ObjectSelectorWidget(ObjectType::ObjRole, true, this); alias_ht=new HintTextWidget(alias_hint, this); alias_ht->setText(alias_edt->statusTip()); @@ -287,7 +287,7 @@ void BaseObjectWidget::cancelChainedOperation(void) void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *object, BaseObject *parent_obj, double obj_px, double obj_py, bool uses_op_list) { - ObjectType obj_type, parent_type=ObjBaseObject; + ObjectType obj_type, parent_type=ObjectType::ObjBaseObject; /* Reseting the objects attributes in order to force them to be redefined every time this method is called */ @@ -309,11 +309,11 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis { parent_type=parent_obj->getObjectType(); - if(parent_type==ObjTable || parent_type==ObjView) + if(parent_type==ObjectType::ObjTable || parent_type==ObjectType::ObjView) this->table=dynamic_cast(parent_obj); - else if(parent_type==ObjRelationship) + else if(parent_type==ObjectType::ObjRelationship) this->relationship=dynamic_cast(parent_obj); - else if(parent_type!=ObjDatabase && parent_type!=ObjSchema) + else if(parent_type!=ObjectType::ObjDatabase && parent_type!=ObjectType::ObjSchema) throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -350,23 +350,23 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis append_sql_tb->setEnabled(object!=nullptr && !new_object); owner_sel->setModel(model); - owner_sel->setSelectedObject(model->getDefaultObject(ObjRole)); + owner_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjRole)); schema_sel->setModel(model); - schema_sel->setSelectedObject(model->getDefaultObject(ObjSchema)); + schema_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjSchema)); tablespace_sel->setModel(model); - tablespace_sel->setSelectedObject(model->getDefaultObject(ObjTablespace)); + tablespace_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjTablespace)); collation_sel->setModel(model); - collation_sel->setSelectedObject(model->getDefaultObject(ObjCollation)); + collation_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjCollation)); if(object) { obj_id_lbl->setVisible(true); obj_id_lbl->setText(QString("ID: %1").arg(object->getObjectId())); - if(handled_obj_type != ObjBaseObject) + if(handled_obj_type != ObjectType::ObjBaseObject) name_edt->setText(object->getName()); else name_edt->setText(object->getSignature()); @@ -390,9 +390,9 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis schema_sel->setSelectedObject(object->getSchema()); obj_type=object->getObjectType(); - object_protected=(parent_type!=ObjRelationship && + object_protected=(parent_type!=ObjectType::ObjRelationship && (object->isProtected() || - ((obj_type==ObjColumn || obj_type==ObjConstraint) && + ((obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) && dynamic_cast(object)->isAddedByRelationship()))); protected_obj_frm->setVisible(object_protected); disable_sql_chk->setChecked(object->isSQLDisabled()); @@ -403,7 +403,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis obj_id_lbl->setVisible(false); protected_obj_frm->setVisible(false); - if(parent_obj && parent_obj->getObjectType()==ObjSchema) + if(parent_obj && parent_obj->getObjectType()==ObjectType::ObjSchema) schema_sel->setSelectedObject(parent_obj); } } @@ -446,9 +446,9 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ this->setLayout(baseobject_grid); baseobject_grid->setContentsMargins(4, 4, 4, 4); - disable_sql_chk->setVisible(obj_type!=ObjBaseObject && obj_type!=ObjPermission && - obj_type!=ObjTextbox && obj_type!=ObjTag && - obj_type!=ObjParameter); + disable_sql_chk->setVisible(obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjPermission && + obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjTag && + obj_type!=ObjectType::ObjParameter); alias_edt->setVisible(BaseObject::acceptsAlias(obj_type)); alias_hint_wgt->setVisible(BaseObject::acceptsAlias(obj_type)); @@ -469,22 +469,22 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ collation_lbl->setVisible(BaseObject::acceptsCollation(obj_type)); collation_sel->setVisible(BaseObject::acceptsCollation(obj_type)); - show_comment=obj_type!=ObjRelationship && obj_type!=ObjTextbox && obj_type!=ObjParameter; + show_comment=obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjParameter; comment_lbl->setVisible(show_comment); comment_edt->setVisible(show_comment); - if(obj_type!=ObjBaseObject) + if(obj_type!=ObjectType::ObjBaseObject) { obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(obj_type))); obj_icon_lbl->setToolTip(BaseObject::getTypeName(obj_type)); - if(obj_type!=ObjPermission && obj_type!=ObjCast) + if(obj_type!=ObjectType::ObjPermission && obj_type!=ObjectType::ObjCast) { setRequiredField(name_lbl); setRequiredField(name_edt); } - if(obj_type!=ObjExtension) + if(obj_type!=ObjectType::ObjExtension) { setRequiredField(schema_lbl); setRequiredField(schema_sel); @@ -702,13 +702,13 @@ void BaseObjectWidget::applyConfiguration(void) QString obj_name; QApplication::setOverrideCursor(Qt::WaitCursor); - obj_name=BaseObject::formatName(name_edt->text().toUtf8(), obj_type==ObjOperator); + obj_name=BaseObject::formatName(name_edt->text().toUtf8(), obj_type==ObjectType::ObjOperator); if(this->object->acceptsSchema() && schema_sel->getSelectedObject()) obj_name=schema_sel->getSelectedObject()->getName(true) + "." + obj_name; //Checking the object duplicity - if(obj_type!=ObjDatabase && obj_type!=ObjPermission && obj_type!=ObjParameter) + if(obj_type!=ObjectType::ObjDatabase && obj_type!=ObjectType::ObjPermission && obj_type!=ObjectType::ObjParameter) { if(table) { @@ -736,10 +736,10 @@ void BaseObjectWidget::applyConfiguration(void) checking on table list when the configured object is a view or a checking on view list when the configured object is a table, this because PostgreSQL does not accepts tables and views have the same name on the same schema */ - if(!aux_obj && obj_type==ObjTable) - aux_obj=model->getObject(obj_name, ObjView); - else if(!aux_obj && obj_type==ObjView) - aux_obj=model->getObject(obj_name, ObjTable); + if(!aux_obj && obj_type==ObjectType::ObjTable) + aux_obj=model->getObject(obj_name, ObjectType::ObjView); + else if(!aux_obj && obj_type==ObjectType::ObjView) + aux_obj=model->getObject(obj_name, ObjectType::ObjTable); aux_obj1=model->getObject(object->getSignature(), obj_type); new_obj=(!aux_obj && !aux_obj1); @@ -758,7 +758,7 @@ void BaseObjectWidget::applyConfiguration(void) } //Renames the object (only cast object aren't renamed) - if(obj_type!=ObjCast) + if(obj_type!=ObjectType::ObjCast) { prev_name=object->getName(); object->setName(name_edt->text().trimmed().toUtf8()); @@ -819,10 +819,10 @@ void BaseObjectWidget::finishConfiguration(void) if(table && TableObject::isTableObject(obj_type)) table->addObject(this->object); //Adding the object on the relationship, if specified - else if(relationship && (obj_type==ObjColumn || obj_type==ObjConstraint)) + else if(relationship && (obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint)) relationship->addObject(dynamic_cast(this->object)); //Adding the object on the model - else if(obj_type!=ObjParameter) + else if(obj_type!=ObjectType::ObjParameter) model->addObject(this->object); registerNewObject(); @@ -831,7 +831,7 @@ void BaseObjectWidget::finishConfiguration(void) else { //If the object is being updated, validates its SQL definition - if(obj_type==ObjBaseRelationship || obj_type==ObjTextbox || obj_type==ObjTag) + if(obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjTextbox || obj_type==ObjectType::ObjTag) this->object->getCodeDefinition(SchemaParser::XmlDefinition); else this->object->getCodeDefinition(SchemaParser::SqlDefinition); @@ -842,7 +842,7 @@ void BaseObjectWidget::finishConfiguration(void) { obj->setCodeInvalidated(true); - if(obj->getObjectType()==ObjColumn) + if(obj->getObjectType()==ObjectType::ObjColumn) dynamic_cast(obj)->getParentTable()->setModified(true); } @@ -851,7 +851,7 @@ void BaseObjectWidget::finishConfiguration(void) //If the object is graphical (or a table object), updates it (or its parent) on the scene if(graph_obj || tab_obj) { - if(!graph_obj && tab_obj && tab_obj->getObjectType()!=ObjParameter) + if(!graph_obj && tab_obj && tab_obj->getObjectType()!=ObjectType::ObjParameter) { if(this->table) graph_obj=dynamic_cast(this->table); @@ -920,9 +920,9 @@ void BaseObjectWidget::cancelConfiguration(void) else if(relationship && relationship->getObjectIndex(tab_obj) >= 0) relationship->removeObject(tab_obj); - if(obj_type!=ObjTable && - obj_type!=ObjView && - obj_type!=ObjRelationship) + if(obj_type!=ObjectType::ObjTable && + obj_type!=ObjectType::ObjView && + obj_type!=ObjectType::ObjRelationship) { if(!op_list->isObjectRegistered(this->object, Operation::ObjectCreated)) delete(this->object); @@ -933,8 +933,8 @@ void BaseObjectWidget::cancelConfiguration(void) //If the object is not a new one, restore its previous state if(op_list && - ((!new_object && obj_type!=ObjDatabase && obj_type!=ObjPermission && operation_count != op_list->getCurrentSize()) || - (new_object && (obj_type==ObjTable || obj_type==ObjView || obj_type==ObjRelationship)))) + ((!new_object && obj_type!=ObjectType::ObjDatabase && obj_type!=ObjectType::ObjPermission && operation_count != op_list->getCurrentSize()) || + (new_object && (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView || obj_type==ObjectType::ObjRelationship)))) { try { diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index e9e210b2ef..2505089e34 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -106,7 +106,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { /*! \brief Merges the specified grid layout with the 'baseobject_grid' creating a single form. The obj_type parameter must be specified to show the object type icon */ - void configureFormLayout(QGridLayout *grid=nullptr, ObjectType obj_type=ObjBaseObject); + void configureFormLayout(QGridLayout *grid=nullptr, ObjectType obj_type=ObjectType::ObjBaseObject); /*! \brief Starts a object configuration, alocating a new one if necessary, registering the object on the operation list. This method doens't applies to database model edition */ @@ -144,7 +144,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { VERSIONS_INTERVAL=1, AFTER_VERSION=2; - BaseObjectWidget(QWidget * parent = 0, ObjectType obj_type=ObjBaseObject); + BaseObjectWidget(QWidget * parent = 0, ObjectType obj_type=ObjectType::ObjBaseObject); virtual ~BaseObjectWidget(void); @@ -207,7 +207,7 @@ void BaseObjectWidget::startConfiguration(void) //! \brief If the object is already allocated if(this->object && op_list && - this->object->getObjectType()!=ObjDatabase) + this->object->getObjectType()!=ObjectType::ObjDatabase) { if(this->table) op_list->registerObject(this->object, Operation::ObjectModified, -1, this->table); diff --git a/libpgmodeler_ui/src/castwidget.cpp b/libpgmodeler_ui/src/castwidget.cpp index 7b92a7a117..97d6d9a135 100644 --- a/libpgmodeler_ui/src/castwidget.cpp +++ b/libpgmodeler_ui/src/castwidget.cpp @@ -18,7 +18,7 @@ #include "castwidget.h" -CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjCast) +CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjCast) { try { @@ -30,13 +30,13 @@ CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjCast) src_datatype=new PgSQLTypeWidget(this, trUtf8("Source data type")); trg_datatype=new PgSQLTypeWidget(this, trUtf8("Target data type")); - conv_func_sel=new ObjectSelectorWidget(ObjFunction, true, this); + conv_func_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); cast_grid->addWidget(conv_func_sel,1,1,1,4); cast_grid->addWidget(src_datatype,2,0,1,5); cast_grid->addWidget(trg_datatype,3,0,1,5); - configureFormLayout(cast_grid, ObjCast); + configureFormLayout(cast_grid, ObjectType::ObjCast); name_edt->setReadOnly(true); font=name_edt->font(); diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 0a77814ec0..692e65e533 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -282,12 +282,12 @@ void CodeCompletionWidget::populateNameList(vector &objects, QStri obj_name.clear(); //Formatting the object name according to the object type - if(obj_type==ObjFunction) + if(obj_type==ObjectType::ObjFunction) { dynamic_cast(objects[i])->createSignature(false); obj_name=dynamic_cast(objects[i])->getSignature(); } - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) obj_name=dynamic_cast(objects[i])->getSignature(false); else obj_name+=objects[i]->getName(false, false); @@ -319,10 +319,10 @@ void CodeCompletionWidget::setQualifyingLevel(BaseObject *obj) { if(!obj) qualifying_level=-1; - else if(obj->getObjectType()==ObjSchema) + else if(obj->getObjectType()==ObjectType::ObjSchema) qualifying_level=0; - else if(obj->getObjectType()==ObjTable || - obj->getObjectType()==ObjView) + else if(obj->getObjectType()==ObjectType::ObjTable || + obj->getObjectType()==ObjectType::ObjView) qualifying_level=1; else qualifying_level=2; @@ -344,7 +344,7 @@ void CodeCompletionWidget::updateList(void) QString pattern; QStringList list; vector objects; - vector types=BaseObject::getObjectTypes(false, { ObjTextbox, ObjRelationship, ObjBaseRelationship }); + vector types=BaseObject::getObjectTypes(false, { ObjectType::ObjTextbox, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); QTextCursor tc; name_list->clear(); @@ -373,7 +373,7 @@ void CodeCompletionWidget::updateList(void) word.remove(completion_trigger); word.remove('"'); - objects=db_model->findObjects(word, { ObjSchema, ObjTable, ObjView }, false, false, false, true); + objects=db_model->findObjects(word, { ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView }, false, false, false, true); if(objects.size()==1) setQualifyingLevel(objects[0]); @@ -587,9 +587,9 @@ void CodeCompletionWidget::insertObjectName(BaseObject *obj) if(modify_name && - (obj_type==ObjTable || TableObject::isTableObject(obj_type))) + (obj_type==ObjectType::ObjTable || TableObject::isTableObject(obj_type))) { - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) { Table *tab=dynamic_cast
(obj); @@ -611,17 +611,17 @@ void CodeCompletionWidget::insertObjectName(BaseObject *obj) code_field_txt->setTextCursor(lvl_cur); } } - else if(obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjFunction) { Function *func=dynamic_cast(obj); func->createSignature(true, sch_qualified); name=func->getSignature(); } - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) { name.replace(',', QLatin1String(" AS ")); } - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) { Aggregate *agg; agg=dynamic_cast(obj); diff --git a/libpgmodeler_ui/src/collationwidget.cpp b/libpgmodeler_ui/src/collationwidget.cpp index 78a28d6438..c6629e1489 100644 --- a/libpgmodeler_ui/src/collationwidget.cpp +++ b/libpgmodeler_ui/src/collationwidget.cpp @@ -18,7 +18,7 @@ #include "collationwidget.h" -CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, ObjCollation) +CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjCollation) { try { @@ -32,7 +32,7 @@ CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, ObjC collation_grid->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum,QSizePolicy::Expanding), collation_grid->count()+1, 0, 1, 0); collation_grid->addWidget(frame, collation_grid->count()+1, 0, 1, 0); frame->setParent(this); - configureFormLayout(collation_grid, ObjCollation); + configureFormLayout(collation_grid, ObjectType::ObjCollation); //Configures the encoding combobox EncodingType::getTypes(encodings); diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index f26bc096b9..4c7aaa33f6 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -21,7 +21,7 @@ #include "baseform.h" #include "generalconfigwidget.h" -ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjColumn) +ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjColumn) { try { @@ -41,7 +41,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjColumn) hl_default_value=new SyntaxHighlighter(def_value_txt, true); hl_default_value->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - sequence_sel=new ObjectSelectorWidget(ObjSequence, true, this); + sequence_sel=new ObjectSelectorWidget(ObjectType::ObjSequence, true, this); sequence_sel->setEnabled(false); column_grid->addWidget(data_type,0,0,1,0); @@ -50,7 +50,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjColumn) column_grid->addItem(spacer,column_grid->count(),0); dynamic_cast(default_value_grp->layout())->addWidget(sequence_sel, 1, 1, 1, 6); - configureFormLayout(column_grid, ObjColumn); + configureFormLayout(column_grid, ObjectType::ObjColumn); configureTabOrder({ data_type }); map > fields_map; @@ -148,7 +148,7 @@ void ColumnWidget::editSequenceAttributes(void) schema = this->model->getSchema("public"); ident_col_seq.setName(QString("%1_%2_seq").arg(table ? table->getName() : QString()).arg(col ? col->getName() : QString("new_column"))); - ident_col_seq.setName(PgModelerNs::generateUniqueName(&ident_col_seq, *model->getObjectList(ObjSequence), false)); + ident_col_seq.setName(PgModelerNs::generateUniqueName(&ident_col_seq, *model->getObjectList(ObjectType::ObjSequence), false)); ident_col_seq.setSchema(schema); if(col) diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 9c60727b14..852f90f3a6 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -18,7 +18,7 @@ #include "constraintwidget.h" -ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, ObjConstraint) +ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjConstraint) { try { @@ -48,7 +48,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob ObjectsTableWidget::UpdateButton | ObjectsTableWidget::DuplicateButton), true, this); - ref_table_sel=new ObjectSelectorWidget(ObjTable, true, this); + ref_table_sel=new ObjectSelectorWidget(ObjectType::ObjTable, true, this); columns_tab->setColumnCount(2); columns_tab->setHeaderLabel(trUtf8("Column"), 0); @@ -67,7 +67,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob dynamic_cast(columns_tbw->widget(1)->layout())->addWidget(ref_table_sel, 0,1,1,2); dynamic_cast(columns_tbw->widget(1)->layout())->addWidget(ref_columns_tab, 3,0,1,3); - configureFormLayout(constraint_grid, ObjConstraint); + configureFormLayout(constraint_grid, ObjectType::ObjConstraint); ConstraintType::getTypes(list); constr_type_cmb->addItems(list); @@ -359,7 +359,7 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=parent_obj->getObjectType(); - if(obj_type!=ObjTable && obj_type!=ObjRelationship) + if(obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjRelationship) throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, constr, parent_obj); diff --git a/libpgmodeler_ui/src/conversionwidget.cpp b/libpgmodeler_ui/src/conversionwidget.cpp index df32622281..ba41fbd38e 100644 --- a/libpgmodeler_ui/src/conversionwidget.cpp +++ b/libpgmodeler_ui/src/conversionwidget.cpp @@ -18,7 +18,7 @@ #include "conversionwidget.h" -ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, ObjConversion) +ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjConversion) { try { @@ -28,7 +28,7 @@ ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, Ob Ui_ConversionWidget::setupUi(this); conv_func_sel=nullptr; - conv_func_sel=new ObjectSelectorWidget(ObjFunction, true, this); + conv_func_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); convcod_grid->addWidget(conv_func_sel,1,1,1,3); setRequiredField(src_encoding_lbl); @@ -36,7 +36,7 @@ ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, Ob setRequiredField(conv_func_lbl); setRequiredField(conv_func_sel); - configureFormLayout(convcod_grid, ObjConversion); + configureFormLayout(convcod_grid, ObjectType::ObjConversion); frame=generateInformationFrame(trUtf8("The function to be assigned to an encoding conversion must have the following signature: void function(integer, integer, cstring, internal, integer).")); convcod_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), convcod_grid->count()+1, 0, 1, 0); convcod_grid->addWidget(frame, convcod_grid->count()+1, 0, 1, 0); diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index c533f3a5b7..c0852dee1c 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -26,7 +26,7 @@ CustomSQLWidget::CustomSQLWidget(QWidget *parent) : BaseObjectWidget(parent) QFont font; Ui_CustomSQLWidget::setupUi(this); - configureFormLayout(sqlappend_grid, ObjBaseObject); + configureFormLayout(sqlappend_grid, ObjectType::ObjBaseObject); append_sql_txt=PgModelerUiNs::createNumberedTextEditor(append_sql_wgt, true); prepend_sql_txt=PgModelerUiNs::createNumberedTextEditor(prepend_sql_wgt, true); @@ -106,9 +106,9 @@ void CustomSQLWidget::configureMenus(void) for(int i=0; i < count; i++) btns[i]->setMenu(nullptr); - if(obj_type==ObjTable || obj_type==ObjView) + if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) { - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) { insert_tb->setMenu(&insert_menu); delete_tb->setMenu(&delete_menu); @@ -132,7 +132,7 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) name_edt->setText(QString("%1 (%2)").arg(object->getSignature()).arg(object->getTypeName())); - if(object->getObjectType()==ObjDatabase) + if(object->getObjectType()==ObjectType::ObjDatabase) end_of_model_chk->setChecked(dynamic_cast(object)->isAppendAtEOD()); append_sql_txt->setFocus(); @@ -145,8 +145,8 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) prepend_sql_cp->configureCompletion(model, prepend_sql_hl); prepend_sql_txt->moveCursor(QTextCursor::End); - end_of_model_chk->setVisible(object->getObjectType()==ObjDatabase); - begin_of_model_chk->setVisible(object->getObjectType()==ObjDatabase); + end_of_model_chk->setVisible(object->getObjectType()==ObjectType::ObjDatabase); + begin_of_model_chk->setVisible(object->getObjectType()==ObjectType::ObjDatabase); protected_obj_frm->setVisible(false); obj_id_lbl->setVisible(false); @@ -164,7 +164,7 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) void CustomSQLWidget::applyConfiguration(void) { - if(this->object->getObjectType()==ObjDatabase) + if(this->object->getObjectType()==ObjectType::ObjDatabase) { dynamic_cast(this->object)->setAppendAtEOD(end_of_model_chk->isChecked()); dynamic_cast(this->object)->setPrependAtBOD(begin_of_model_chk->isChecked()); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 7968058dfa..41106bad57 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -195,7 +195,7 @@ DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); unsigned oid=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); - if((obj_type==ObjSchema || obj_type==ObjTable || obj_type==ObjView) && oid > 0 && item->childCount() <= 1) + if((obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && oid > 0 && item->childCount() <= 1) { updateItem(item); } @@ -236,17 +236,17 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) if(k_event->key()==Qt::Key_Space) { QTreeWidgetItem *item=objects_trw->currentItem(); - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; if(item) { unsigned oid=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); - if(oid!=0 && (obj_type==ObjTable || obj_type==ObjView)) + if(oid!=0 && (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView)) { openDataGrid(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), - item->text(0), obj_type!=ObjView); + item->text(0), obj_type!=ObjectType::ObjView); } } } @@ -274,15 +274,15 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; attribs_map fmt_attribs; QString attr_name, attr_value; QRegExp oid_regexp=QRegExp(QString("^[0-9]+")); - map dep_types={{ParsersAttributes::OWNER, ObjRole}, - {ParsersAttributes::SCHEMA, ObjSchema}, - {ParsersAttributes::TABLESPACE, ObjTablespace}, - {ParsersAttributes::COLLATION, ObjCollation}, - {ParsersAttributes::TABLE, ObjTable}}; + map dep_types={{ParsersAttributes::OWNER, ObjectType::ObjRole}, + {ParsersAttributes::SCHEMA, ObjectType::ObjSchema}, + {ParsersAttributes::TABLESPACE, ObjectType::ObjTablespace}, + {ParsersAttributes::COLLATION, ObjectType::ObjCollation}, + {ParsersAttributes::TABLE, ObjectType::ObjTable}}; if(attribs.count(ParsersAttributes::OBJECT_TYPE)!=0) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); @@ -291,27 +291,27 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) { switch(obj_type) { - case ObjCast: formatCastAttribs(attribs); break; - case ObjEventTrigger: formatEventTriggerAttribs(attribs); break; - case ObjLanguage: formatLanguageAttribs(attribs); break; - case ObjRole: formatRoleAttribs(attribs); break; - case ObjAggregate: formatAggregateAttribs(attribs); break; - case ObjConversion: formatConversionAttribs(attribs); break; - case ObjDomain: formatDomainAttribs(attribs); break; - case ObjExtension: formatExtensionAttribs(attribs); break; - case ObjFunction: formatFunctionAttribs(attribs); break; - case ObjOperator: formatOperatorAttribs(attribs); break; - case ObjOpClass: formatOperatorClassAttribs(attribs); break; - case ObjTable: formatTableAttribs(attribs); break; - case ObjSequence: formatSequenceAttribs(attribs); break; - case ObjType: formatTypeAttribs(attribs); break; - case ObjView: formatViewAttribs(attribs); break; - case ObjTrigger: formatTriggerAttribs(attribs); break; - case ObjRule: formatRuleAttribs(attribs); break; - case ObjColumn: formatColumnAttribs(attribs); break; - case ObjConstraint: formatConstraintAttribs(attribs); break; - case ObjIndex: formatIndexAttribs(attribs); break; - case ObjPolicy: formatPolicyAttribs(attribs); break; + case ObjectType::ObjCast: formatCastAttribs(attribs); break; + case ObjectType::ObjEventTrigger: formatEventTriggerAttribs(attribs); break; + case ObjectType::ObjLanguage: formatLanguageAttribs(attribs); break; + case ObjectType::ObjRole: formatRoleAttribs(attribs); break; + case ObjectType::ObjAggregate: formatAggregateAttribs(attribs); break; + case ObjectType::ObjConversion: formatConversionAttribs(attribs); break; + case ObjectType::ObjDomain: formatDomainAttribs(attribs); break; + case ObjectType::ObjExtension: formatExtensionAttribs(attribs); break; + case ObjectType::ObjFunction: formatFunctionAttribs(attribs); break; + case ObjectType::ObjOperator: formatOperatorAttribs(attribs); break; + case ObjectType::ObjOpClass: formatOperatorClassAttribs(attribs); break; + case ObjectType::ObjTable: formatTableAttribs(attribs); break; + case ObjectType::ObjSequence: formatSequenceAttribs(attribs); break; + case ObjectType::ObjType: formatTypeAttribs(attribs); break; + case ObjectType::ObjView: formatViewAttribs(attribs); break; + case ObjectType::ObjTrigger: formatTriggerAttribs(attribs); break; + case ObjectType::ObjRule: formatRuleAttribs(attribs); break; + case ObjectType::ObjColumn: formatColumnAttribs(attribs); break; + case ObjectType::ObjConstraint: formatConstraintAttribs(attribs); break; + case ObjectType::ObjIndex: formatIndexAttribs(attribs); break; + case ObjectType::ObjPolicy: formatPolicyAttribs(attribs); break; default: break; } } @@ -408,29 +408,29 @@ void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { ParsersAttributes::IO_CAST }); formatOidAttribs(attribs, { ParsersAttributes::DEST_TYPE, - ParsersAttributes::SOURCE_TYPE }, ObjType, false); + ParsersAttributes::SOURCE_TYPE }, ObjectType::ObjType, false); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjFunction, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::ObjFunction, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatEventTriggerAttribs(attribs_map &attribs) { attribs[ParsersAttributes::VALUES]=Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES]).join(ElemSeparator); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjFunction, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::ObjFunction, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { ParsersAttributes::FINAL_FUNC, - ParsersAttributes::TRANSITION_FUNC }, ObjFunction, false); + ParsersAttributes::TRANSITION_FUNC }, ObjectType::ObjFunction, false); - formatOidAttribs(attribs, { ParsersAttributes::TYPES }, ObjType, true); + formatOidAttribs(attribs, { ParsersAttributes::TYPES }, ObjectType::ObjType, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) .arg(attribs[ParsersAttributes::TYPES])).replace(ElemSeparator, QString(",")); - attribs[ParsersAttributes::STATE_TYPE]=getObjectName(ObjType, attribs[ParsersAttributes::STATE_TYPE]); - attribs[ParsersAttributes::SORT_OP]=getObjectName(ObjOperator, attribs[ParsersAttributes::SORT_OP]); + attribs[ParsersAttributes::STATE_TYPE]=getObjectName(ObjectType::ObjType, attribs[ParsersAttributes::STATE_TYPE]); + attribs[ParsersAttributes::SORT_OP]=getObjectName(ObjectType::ObjOperator, attribs[ParsersAttributes::SORT_OP]); attribs[ParsersAttributes::INITIAL_COND]=Catalog::parseArrayValues(attribs[ParsersAttributes::INITIAL_COND]).join(ElemSeparator); } @@ -440,14 +440,14 @@ void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) formatOidAttribs(attribs, { ParsersAttributes::VALIDATOR_FUNC, ParsersAttributes::HANDLER_FUNC, - ParsersAttributes::INLINE_FUNC }, ObjFunction, false); + ParsersAttributes::INLINE_FUNC }, ObjectType::ObjFunction, false); } void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { ParsersAttributes::ADMIN_ROLES, ParsersAttributes::MEMBER_ROLES, - ParsersAttributes::REF_ROLES }, ObjRole, true); + ParsersAttributes::REF_ROLES }, ObjectType::ObjRole, true); formatBooleanAttribs(attribs, { ParsersAttributes::SUPERUSER, ParsersAttributes::INHERIT, ParsersAttributes::CREATEROLE, ParsersAttributes::CREATEDB, @@ -458,13 +458,13 @@ void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { ParsersAttributes::DEFAULT }); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjFunction, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::ObjFunction, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { ParsersAttributes::NOT_NULL }); - attribs[ParsersAttributes::TYPE]=getObjectName(ObjType, attribs[ParsersAttributes::TYPE]); + attribs[ParsersAttributes::TYPE]=getObjectName(ObjectType::ObjType, attribs[ParsersAttributes::TYPE]); } void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) @@ -474,13 +474,13 @@ void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::LANGUAGE]=getObjectName(ObjLanguage, attribs[ParsersAttributes::LANGUAGE]); - attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(ObjType, attribs[ParsersAttributes::RETURN_TYPE]); + attribs[ParsersAttributes::LANGUAGE]=getObjectName(ObjectType::ObjLanguage, attribs[ParsersAttributes::LANGUAGE]); + attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(ObjectType::ObjType, attribs[ParsersAttributes::RETURN_TYPE]); attribs[ParsersAttributes::ARG_NAMES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_NAMES]).join(ElemSeparator); attribs[ParsersAttributes::ARG_MODES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_MODES]).join(ElemSeparator); attribs[ParsersAttributes::ARG_DEFAULTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_DEFAULTS]).join(ElemSeparator); - formatOidAttribs(attribs, { ParsersAttributes::ARG_TYPES }, ObjType, true); + formatOidAttribs(attribs, { ParsersAttributes::ARG_TYPES }, ObjectType::ObjType, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) .arg(attribs[ParsersAttributes::ARG_TYPES])).replace(ElemSeparator, QString(",")); @@ -496,14 +496,14 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) ParsersAttributes::MERGES }); formatOidAttribs(attribs, { ParsersAttributes::LEFT_TYPE, - ParsersAttributes::RIGHT_TYPE}, ObjType, false); + ParsersAttributes::RIGHT_TYPE}, ObjectType::ObjType, false); formatOidAttribs(attribs, { ParsersAttributes::COMMUTATOR_OP, - ParsersAttributes::NEGATOR_OP}, ObjOperator, false); + ParsersAttributes::NEGATOR_OP}, ObjectType::ObjOperator, false); formatOidAttribs(attribs, { ParsersAttributes::OPERATOR_FUNC, ParsersAttributes::RESTRICTION_FUNC, - ParsersAttributes::JOIN_FUNC }, ObjFunction, false); + ParsersAttributes::JOIN_FUNC }, ObjectType::ObjFunction, false); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2,%3)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME], true)) @@ -520,12 +520,12 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) ParsersAttributes::RLS_ENABLED, ParsersAttributes::RLS_FORCED}); - formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, ObjTable, true); - formatOidAttribs(attribs, { ParsersAttributes::PARTITIONED_TABLE }, ObjTable, false); + formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, ObjectType::ObjTable, true); + formatOidAttribs(attribs, { ParsersAttributes::PARTITIONED_TABLE }, ObjectType::ObjTable, false); - part_keys.push_back(getObjectsNames(ObjColumn, + part_keys.push_back(getObjectsNames(ObjectType::ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]), - getObjectName(ObjSchema, attribs[ParsersAttributes::SCHEMA]), + getObjectName(ObjectType::ObjSchema, attribs[ParsersAttributes::SCHEMA]), attribs[ParsersAttributes::NAME]).join(ElemSeparator)); part_keys.push_back(Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator)); @@ -545,7 +545,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) seq_attrs={ ParsersAttributes::START, ParsersAttributes::MIN_VALUE, ParsersAttributes::MAX_VALUE, ParsersAttributes::INCREMENT, ParsersAttributes::CACHE, ParsersAttributes::CYCLE }; - QString sch_name=getObjectName(ObjSchema, attribs[ParsersAttributes::SCHEMA]); + QString sch_name=getObjectName(ObjectType::ObjSchema, attribs[ParsersAttributes::SCHEMA]); attribs.erase(ParsersAttributes::ATTRIBUTE); for(int i=0; i < seq_values.size(); i++) @@ -556,8 +556,8 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) owner_col=attribs[ParsersAttributes::OWNER_COLUMN].split(':'); if(owner_col.size()==2) { - QStringList names=getObjectName(ObjTable, owner_col[0]).split('.'); - vector col_attribs=catalog.getObjectsAttributes(ObjColumn, names[0], names[1], { owner_col[1].toUInt() }); + QStringList names=getObjectName(ObjectType::ObjTable, owner_col[0]).split('.'); + vector col_attribs=catalog.getObjectsAttributes(ObjectType::ObjColumn, names[0], names[1], { owner_col[1].toUInt() }); if(!col_attribs.empty()) attribs[ParsersAttributes::OWNER_COLUMN]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(ParsersAttributes::NAME)); @@ -602,8 +602,8 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) ParsersAttributes::RECV_FUNC, ParsersAttributes::SEND_FUNC, ParsersAttributes::TPMOD_IN_FUNC, - ParsersAttributes::TPMOD_OUT_FUNC }, ObjFunction, false); - attribs[ParsersAttributes::ELEMENT]=getObjectName(ObjType, attribs[ParsersAttributes::ELEMENT]); + ParsersAttributes::TPMOD_OUT_FUNC }, ObjectType::ObjFunction, false); + attribs[ParsersAttributes::ELEMENT]=getObjectName(ObjectType::ObjType, attribs[ParsersAttributes::ELEMENT]); if(attribs[ParsersAttributes::ENUMERATIONS].isEmpty()) attribs.erase(ParsersAttributes::ENUMERATIONS); @@ -613,11 +613,11 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) attribs.erase(ParsersAttributes::RANGE_ATTRIBS); if(!range_attr.isEmpty()) { - attribs[ParsersAttributes::SUBTYPE]=getObjectName(ObjType, range_attr[0]); - attribs[ParsersAttributes::COLLATION]=getObjectName(ObjCollation, range_attr[1]); - attribs[ParsersAttributes::OP_CLASS]=getObjectName(ObjOpClass, range_attr[2]); - attribs[ParsersAttributes::CANONICAL_FUNC]=getObjectName(ObjFunction, range_attr[3]); - attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjFunction, range_attr[4]); + attribs[ParsersAttributes::SUBTYPE]=getObjectName(ObjectType::ObjType, range_attr[0]); + attribs[ParsersAttributes::COLLATION]=getObjectName(ObjectType::ObjCollation, range_attr[1]); + attribs[ParsersAttributes::OP_CLASS]=getObjectName(ObjectType::ObjOpClass, range_attr[2]); + attribs[ParsersAttributes::CANONICAL_FUNC]=getObjectName(ObjectType::ObjFunction, range_attr[3]); + attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjectType::ObjFunction, range_attr[4]); } if(!type_attr.isEmpty()) @@ -641,10 +641,10 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) { QStringList list, array_vals, elems; - attribs[ParsersAttributes::FAMILY]=getObjectName(ObjOpFamily, attribs[ParsersAttributes::FAMILY]); + attribs[ParsersAttributes::FAMILY]=getObjectName(ObjectType::ObjOpFamily, attribs[ParsersAttributes::FAMILY]); formatBooleanAttribs(attribs, { ParsersAttributes::DEFAULT }); formatOidAttribs(attribs, { ParsersAttributes::STORAGE, - ParsersAttributes::TYPE }, ObjType, false); + ParsersAttributes::TYPE }, ObjectType::ObjType, false); array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::FUNCTION]); @@ -653,7 +653,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) for(int i=0; i < array_vals.size(); i++) { list=array_vals[i].split(':'); - elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(ObjFunction, list[1]))); + elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(ObjectType::ObjFunction, list[1]))); } attribs[ParsersAttributes::FUNCTION]=elems.join(ElemSeparator); @@ -669,8 +669,8 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) list=array_vals[i].split(':'); elems.push_back(QString("[%1] [%2] [%3]") .arg(list[0], - getObjectName(ObjOperator, list[1]), - getObjectName(ObjOperator, list[2]))); + getObjectName(ObjectType::ObjOperator, list[1]), + getObjectName(ObjectType::ObjOperator, list[2]))); } attribs[ParsersAttributes::OPERATOR]=elems.join(ElemSeparator); @@ -688,7 +688,7 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) ParsersAttributes::UPD_EVENT, ParsersAttributes::TRUNC_EVENT }); - attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(ObjFunction, attribs[ParsersAttributes::TRIGGER_FUNC]); + attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(ObjectType::ObjFunction, attribs[ParsersAttributes::TRIGGER_FUNC]); attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS]).join(ElemSeparator); attribs[ParsersAttributes::COLUMNS]=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]).join(ElemSeparator); } @@ -716,22 +716,22 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) {ParsersAttributes::EX_CONSTR, ConstraintType(ConstraintType::exclude)}}; ConstraintType constr_type=types[attribs[ParsersAttributes::TYPE]]; - QStringList names=getObjectName(ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); + QStringList names=getObjectName(ObjectType::ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); formatBooleanAttribs(attribs, { ParsersAttributes::DEFERRABLE, ParsersAttributes::NO_INHERIT }); attribs[ParsersAttributes::TYPE]=~types[attribs[ParsersAttributes::TYPE]]; - attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjOpClass, + attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjectType::ObjOpClass, Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ElemSeparator); - attribs[ParsersAttributes::SRC_COLUMNS]=getObjectsNames(ObjColumn, + attribs[ParsersAttributes::SRC_COLUMNS]=getObjectsNames(ObjectType::ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::SRC_COLUMNS]), names[0], names[1]).join(ElemSeparator); if(constr_type==ConstraintType::foreign_key) { - attribs[ParsersAttributes::REF_TABLE]=getObjectName(ObjTable, attribs[ParsersAttributes::REF_TABLE]); + attribs[ParsersAttributes::REF_TABLE]=getObjectName(ObjectType::ObjTable, attribs[ParsersAttributes::REF_TABLE]); names=attribs[ParsersAttributes::REF_TABLE].split('.'); - attribs[ParsersAttributes::DST_COLUMNS]=getObjectsNames(ObjColumn, + attribs[ParsersAttributes::DST_COLUMNS]=getObjectsNames(ObjectType::ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::DST_COLUMNS]), names[0], names[1]).join(ElemSeparator); } @@ -755,7 +755,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) if(constr_type==ConstraintType::exclude) { attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); - attribs[ParsersAttributes::OPERATORS]=getObjectsNames(ObjOperator, + attribs[ParsersAttributes::OPERATORS]=getObjectsNames(ObjectType::ObjOperator, Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATORS])).join(ElemSeparator); } else @@ -768,28 +768,28 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) { - QStringList names=getObjectName(ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); + QStringList names=getObjectName(ObjectType::ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); if(names.isEmpty() || names.size() == 1) - names=getObjectName(ObjView, attribs[ParsersAttributes::TABLE]).split('.'); + names=getObjectName(ObjectType::ObjView, attribs[ParsersAttributes::TABLE]).split('.'); formatBooleanAttribs(attribs, { ParsersAttributes::UNIQUE }); attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); - attribs[ParsersAttributes::COLLATIONS]=getObjectsNames(ObjCollation, + attribs[ParsersAttributes::COLLATIONS]=getObjectsNames(ObjectType::ObjCollation, Catalog::parseArrayValues(attribs[ParsersAttributes::COLLATIONS])).join(ElemSeparator); - attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjOpClass, + attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjectType::ObjOpClass, Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ElemSeparator); - attribs[ParsersAttributes::COLUMNS]=getObjectsNames(ObjColumn, + attribs[ParsersAttributes::COLUMNS]=getObjectsNames(ObjectType::ObjColumn, Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]), names[0], names[1]).join(ElemSeparator); } void DatabaseExplorerWidget::formatPolicyAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::ROLES] = getObjectsNames(ObjRole, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ElemSeparator); + attribs[ParsersAttributes::ROLES] = getObjectsNames(ObjectType::ObjRole, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ElemSeparator); } QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) @@ -808,8 +808,8 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) QString oid=attribs[ParsersAttributes::OID], obj_name=DepNotFound.arg(oid), sch_name; - if(obj_type!=ObjType) - obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME], obj_type==ObjOperator); + if(obj_type!=ObjectType::ObjType) + obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME], obj_type==ObjectType::ObjOperator); else obj_name=attribs[ParsersAttributes::NAME]; @@ -817,7 +817,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) if(!attribs[ParsersAttributes::SCHEMA].isEmpty() && attribs[ParsersAttributes::SCHEMA]!=QString("0")) { - aux_attribs=catalog.getObjectAttributes(ObjSchema, attribs[ParsersAttributes::SCHEMA].toUInt()); + aux_attribs=catalog.getObjectAttributes(ObjectType::ObjSchema, attribs[ParsersAttributes::SCHEMA].toUInt()); sch_name=BaseObject::formatName(aux_attribs[ParsersAttributes::NAME], false); if(!sch_name.isEmpty()) @@ -825,20 +825,20 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) } //Formatting paramenter types for function - if(obj_type==ObjFunction) + if(obj_type==ObjectType::ObjFunction) { QStringList names, arg_types=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_TYPES]); for(int idx=0; idx < arg_types.size(); idx++) { - names=getObjectName(ObjType, arg_types[idx]).split('.'); + names=getObjectName(ObjectType::ObjType, arg_types[idx]).split('.'); arg_types[idx]=names[names.size()-1]; } obj_name+=QString("(%1)").arg(arg_types.join(',')); } //Formatting paramenter types for operator - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) { QStringList arg_types, names; QString type_name; @@ -846,7 +846,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) for(QString attr : attrib_ids) { - names=getObjectName(ObjType, attribs[attr]).split('.'); + names=getObjectName(ObjectType::ObjType, attribs[attr]).split('.'); type_name=names[names.size()-1]; if(type_name.isEmpty()) type_name=QString("-"); @@ -962,7 +962,7 @@ void DatabaseExplorerWidget::listObjects(void) root->setText(0, connection.getConnectionId(true)); root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("server"))); root->setData(DatabaseImportForm::ObjectId, Qt::UserRole, -1); - root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, ObjBaseObject); + root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, ObjectType::ObjBaseObject); root->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); root->addChild(curr_root); objects_trw->addTopLevelItem(root); @@ -1011,7 +1011,7 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); unsigned obj_id=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); - SnippetsConfigWidget::configureSnippetsMenu(&snippets_menu, { obj_type, ObjBaseObject }); + SnippetsConfigWidget::configureSnippetsMenu(&snippets_menu, { obj_type, ObjectType::ObjBaseObject }); for(auto &act : handle_menu.actions()) handle_menu.removeAction(act); @@ -1020,24 +1020,24 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) if(obj_id > 0) { - if(obj_type==ObjTable || obj_type==ObjView) + if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) handle_menu.addAction(show_data_action); handle_menu.addAction(properties_action); handle_menu.addAction(source_action); - if(obj_type!=ObjCast && obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjCast && obj_type!=ObjectType::ObjDatabase) handle_menu.addAction(rename_action); - if(obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjDatabase) { handle_menu.addSeparator(); handle_menu.addAction(drop_action); - if(obj_type!=ObjRole && obj_type!=ObjTablespace) + if(obj_type!=ObjectType::ObjRole && obj_type!=ObjectType::ObjTablespace) handle_menu.addAction(drop_cascade_action); - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) { handle_menu.addAction(truncate_action); handle_menu.addAction(trunc_cascade_action); @@ -1066,7 +1066,7 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) { openDataGrid(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), item->text(0), - item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()!=ObjView); + item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()!=ObjectType::ObjView); } else if(exec_action) handleSelectedSnippet(exec_action->text()); @@ -1098,7 +1098,7 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) { QString obj_name; - if(obj_type!=ObjOperator) + if(obj_type!=ObjectType::ObjOperator) obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME]); else obj_name=attribs[ParsersAttributes::NAME]; @@ -1137,7 +1137,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i attribs[BaseObject::getSchemaName(obj_type)]=ParsersAttributes::_TRUE_; //For cast, operator and function is needed to extract the name and the params types - if(obj_type==ObjOperator || obj_type==ObjFunction || obj_type==ObjCast) + if(obj_type==ObjectType::ObjOperator || obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjCast) { idx=obj_name.indexOf('('); idx1=obj_name.indexOf(')'); @@ -1145,26 +1145,26 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i types.removeAll(QString("-")); obj_name.remove(idx, obj_name.size()); } - else if(obj_type==ObjOpFamily || obj_type==ObjOpClass) + else if(obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjOpClass) obj_name.remove(QRegExp("( )+(\\[)(.)+(\\])")); //Formatting the names - attribs[ParsersAttributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjOperator); + attribs[ParsersAttributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjectType::ObjOperator); attribs[ParsersAttributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); attribs[ParsersAttributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); //For table objects the "table" attribute must be schema qualified - if(obj_type!=ObjIndex && TableObject::isTableObject(obj_type)) + if(obj_type!=ObjectType::ObjIndex && TableObject::isTableObject(obj_type)) { attribs[ParsersAttributes::TABLE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::TABLE]; attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::NAME] + QString(" ON %1").arg(attribs[ParsersAttributes::TABLE]); } //For operators and functions there must exist the signature attribute - else if(obj_type==ObjOperator || obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjOperator || obj_type==ObjectType::ObjFunction) attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::NAME] + QString("(%1)").arg(types.join(ElemSeparator)); - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) attribs[ParsersAttributes::SIGNATURE]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); - else if(obj_type==ObjOpFamily || obj_type==ObjOpClass) + else if(obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjOpClass) { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); attribs[ParsersAttributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[ParsersAttributes::NAME]).arg(aux_attribs[ParsersAttributes::INDEX_TYPE]); @@ -1173,7 +1173,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { /* If we are handling a view we need to append the MATERIALIZED keyword in the sql-object in order * to construct DDL commands correctly for this kind of object */ - if(obj_type==ObjView) + if(obj_type==ObjectType::ObjView) { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); @@ -1181,7 +1181,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { attribs[ParsersAttributes::SQL_OBJECT] = QString("%1 %2").arg(ParsersAttributes::MATERIALIZED.toUpper()) - .arg(BaseObject::getSQLName(ObjView)); + .arg(BaseObject::getSQLName(ObjectType::ObjView)); } } @@ -1208,7 +1208,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) QString obj_name=item->data(DatabaseImportForm::ObjectName, Qt::UserRole).toString(); //Roles and tablespaces can't be removed in cascade mode - if(cascade && (obj_type==ObjRole || obj_type==ObjTablespace)) + if(cascade && (obj_type==ObjectType::ObjRole || obj_type==ObjectType::ObjTablespace)) return; if(!cascade) @@ -1229,7 +1229,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) attribs=extractAttributesFromItem(item); - if(obj_type==ObjOperator || obj_type==ObjFunction) + if(obj_type==ObjectType::ObjOperator || obj_type==ObjectType::ObjFunction) attribs[ParsersAttributes::SIGNATURE].replace(ElemSeparator, QChar(',')); //Generate the drop command @@ -1294,7 +1294,7 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin Connection conn; SchemaParser schparser; - attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(ObjTable); + attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(ObjectType::ObjTable); attribs[ParsersAttributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : ""); attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::_TRUE_ : ""); @@ -1352,7 +1352,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) QApplication::setOverrideCursor(Qt::WaitCursor); - if(obj_type==ObjDatabase) + if(obj_type==ObjectType::ObjDatabase) listObjects(); else { @@ -1370,12 +1370,12 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) } else { - if(obj_type==ObjSchema || obj_type==ObjTable || obj_type == ObjView) + if(obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjTable || obj_type == ObjectType::ObjView) { root=item; root->takeChildren(); - if(obj_type == ObjSchema) + if(obj_type == ObjectType::ObjSchema) sch_name=item->text(0); else tab_name=item->text(0); @@ -1391,7 +1391,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) configureImportHelper(); //Updates the group type only - if(obj_id==0 || (obj_type!=ObjTable && obj_type!=ObjView && obj_type!=ObjSchema)) + if(obj_id==0 || (obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjView && obj_type!=ObjectType::ObjSchema)) gen_items=DatabaseImportForm::updateObjectsTree(import_helper, objects_trw, { obj_type }, false, false, root, sch_name, tab_name, sort_column); else //Updates all child objcts when the selected object is a schema or table or view @@ -1399,7 +1399,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) BaseObject::getChildObjectTypes(obj_type), false, false, root, sch_name, tab_name, sort_column); //Creating dummy items for schemas and tables - if(obj_type==ObjSchema || obj_type==ObjTable || obj_type==ObjView) + if(obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) { for(auto &item : gen_items) { @@ -1413,7 +1413,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) objects_trw->sortItems(sort_column, Qt::AscendingOrder); objects_trw->setCurrentItem(nullptr); - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) { objects_trw->blockSignals(true); objects_trw->setCurrentItem(item); @@ -1452,22 +1452,22 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) if(item == objects_trw->topLevelItem(0)) orig_attribs=catalog.getServerAttributes(); //Retrieve them from the catalog - else if(obj_type!=ObjColumn) + else if(obj_type!=ObjectType::ObjColumn) { orig_attribs=catalog.getObjectAttributes(obj_type, oid); - if(obj_type == ObjTable) + if(obj_type == ObjectType::ObjTable) { vector ref_fks; attribs_map ref_table, ref_schema; QStringList tab_list; - ref_fks = catalog.getObjectsAttributes(ObjConstraint, QString(), QString(), {}, {{ ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[ParsersAttributes::OID])}}); + ref_fks = catalog.getObjectsAttributes(ObjectType::ObjConstraint, QString(), QString(), {}, {{ ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[ParsersAttributes::OID])}}); for(auto &fk : ref_fks) { - ref_table = catalog.getObjectAttributes(ObjTable, fk[ParsersAttributes::TABLE].toUInt()); - ref_schema = catalog.getObjectAttributes(ObjSchema, ref_table[ParsersAttributes::SCHEMA].toUInt()); + ref_table = catalog.getObjectAttributes(ObjectType::ObjTable, fk[ParsersAttributes::TABLE].toUInt()); + ref_schema = catalog.getObjectAttributes(ObjectType::ObjSchema, ref_table[ParsersAttributes::SCHEMA].toUInt()); tab_list.push_back(QString("%1.%2").arg(ref_schema[ParsersAttributes::NAME]).arg(ref_table[ParsersAttributes::NAME])); } @@ -1575,7 +1575,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) cached_attribs=item->data(DatabaseImportForm::ObjectOtherData,Qt::UserRole).value(); - if(cached_attribs[ParsersAttributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjConstraint) && item->childCount()==0) + if(cached_attribs[ParsersAttributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjectType::ObjConstraint) && item->childCount()==0) { QTreeWidgetItem *fk_item=nullptr, *src_item=nullptr; @@ -1622,7 +1622,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } } } - else if(cached_attribs[ParsersAttributes::OBJECT_TYPE] == BaseObject::getSchemaName(ObjTable) && + else if(cached_attribs[ParsersAttributes::OBJECT_TYPE] == BaseObject::getSchemaName(ObjectType::ObjTable) && !cached_attribs[ParsersAttributes::REFERRERS].isEmpty() && item->childCount() == 5) { QTreeWidgetItem *refs_item=nullptr, *tab_item=nullptr; @@ -1672,7 +1672,7 @@ void DatabaseExplorerWidget::startObjectRename(QTreeWidgetItem *item) { ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); - if(obj_type!=ObjCast && obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjCast && obj_type!=ObjectType::ObjDatabase) { item->setFlags(item->flags() | Qt::ItemIsEditable); objects_trw->openPersistentEditor(item); @@ -1696,7 +1696,7 @@ void DatabaseExplorerWidget::finishObjectRename(void) ObjectType obj_type=static_cast(rename_item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); objects_trw->closePersistentEditor(rename_item); - attribs[ParsersAttributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjOperator); + attribs[ParsersAttributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjectType::ObjOperator); //Generate the drop command schparser.ignoreEmptyAttributes(true); @@ -1772,7 +1772,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) tab_name=item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString(); name=item->data(DatabaseImportForm::ObjectName, Qt::UserRole).toString(); - if(!sch_name.isEmpty() && obj_type!=ObjExtension) + if(!sch_name.isEmpty() && obj_type!=ObjectType::ObjExtension) { if(tab_name.isEmpty()) name.prepend(sch_name + QChar('.')); @@ -1781,11 +1781,11 @@ void DatabaseExplorerWidget::loadObjectSource(void) } //Special case for columns. We will retrieve the table from database and then generate the code for the column - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { oid=item->parent()->parent()->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); is_column=true; - obj_type=ObjTable; + obj_type=ObjectType::ObjTable; } //Importing the object and its dependencies @@ -1796,12 +1796,12 @@ void DatabaseExplorerWidget::loadObjectSource(void) toggle_disp_menu.actions().at(1)->isChecked(), true, false, false, false, false); - import_hlp.setSelectedOIDs(&dbmodel, {{ObjDatabase, {db_oid}}, {obj_type,{oid}}}, {}); + import_hlp.setSelectedOIDs(&dbmodel, {{ObjectType::ObjDatabase, {db_oid}}, {obj_type,{oid}}}, {}); sys_oid=import_hlp.getLastSystemOID(); //Currently pgModeler does not support the visualization of base types and built-in ones - if(obj_type==ObjType && + if(obj_type==ObjectType::ObjType && (oid <= sys_oid || attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BASE_TYPE)) { source=trUtf8("-- Source code genaration for buil-in and base types currently unavailable --"); @@ -1811,13 +1811,13 @@ void DatabaseExplorerWidget::loadObjectSource(void) { import_hlp.importDatabase(); - if(obj_type==ObjDatabase) + if(obj_type==ObjectType::ObjDatabase) source=getObjectSource(&dbmodel, &dbmodel); else { /* Fixing the signature of opclasses and opfamilies. The name is in form "name [index type]", so we change it to "name USING [index type]" */ - if(obj_type==ObjOpClass || obj_type==ObjOpFamily) + if(obj_type==ObjectType::ObjOpClass || obj_type==ObjectType::ObjOpFamily) { QString idx_type=item->text(0); @@ -1831,7 +1831,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) if(TableObject::isTableObject(obj_type) || is_column) { Table *table=nullptr; - table=dynamic_cast
(dbmodel.getObject(tab_name, ObjTable)); + table=dynamic_cast
(dbmodel.getObject(tab_name, ObjectType::ObjTable)); QTreeWidgetItem *table_item=nullptr; //If the table was imported then the source code of it will be placed on the respective item @@ -1846,7 +1846,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) //Generate the code of table children objects as ALTER commands table->setGenerateAlterCmds(true); - object=table->getObject(name, (is_column ? ObjColumn : obj_type)); + object=table->getObject(name, (is_column ? ObjectType::ObjColumn : obj_type)); } } else @@ -1870,7 +1870,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) sch_item->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, getObjectSource(schema, &dbmodel)); } - if(obj_type != ObjDatabase) + if(obj_type != ObjectType::ObjDatabase) { //Generating the code for the database itself and storing it in the first child of the root item in the tree objects_trw->setCurrentItem(objects_trw->topLevelItem(0)); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index b2059ec691..1cc5f21938 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -145,7 +145,7 @@ void DatabaseImportForm::updateProgress(int progress, QString msg, ObjectType ob progress_lbl->setText(msg); progress_pb->setValue(progress); - if(obj_type!=ObjBaseObject) + if(obj_type!=ObjectType::ObjBaseObject) ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); @@ -203,7 +203,7 @@ void DatabaseImportForm::importDatabase(void) settings_tbw->setCurrentIndex(1); getCheckedItems(obj_oids, col_oids); - obj_oids[ObjDatabase].push_back(database_cmb->itemData(database_cmb->currentIndex()).value()); + obj_oids[ObjectType::ObjDatabase].push_back(database_cmb->itemData(database_cmb->currentIndex()).value()); if(create_model) { @@ -283,7 +283,7 @@ void DatabaseImportForm::getCheckedItems(map> &obj_ obj_type=static_cast((*itr)->data(ObjectTypeId, Qt::UserRole).value()); //If the object is not a column store it on general object list - if(obj_type!=ObjColumn) + if(obj_type!=ObjectType::ObjColumn) obj_oids[obj_type].push_back((*itr)->data(ObjectId, Qt::UserRole).value()); //If its a column else @@ -588,7 +588,7 @@ void DatabaseImportForm::listDatabases(DatabaseImportHelper &import_helper, QCom QStringList list; map oids; - db_attribs=import_helper.getObjects(ObjDatabase); + db_attribs=import_helper.getObjects(ObjectType::ObjDatabase); dbcombo->blockSignals(true); dbcombo->clear(); @@ -609,7 +609,7 @@ void DatabaseImportForm::listDatabases(DatabaseImportHelper &import_helper, QCom for(int i=0; i < list.count(); i++) { - dbcombo->setItemIcon(i, QPixmap(PgModelerUiNs::getIconPath(ObjDatabase))); + dbcombo->setItemIcon(i, QPixmap(PgModelerUiNs::getIconPath(ObjectType::ObjDatabase))); dbcombo->setItemData(i, oids[list[i]]); } @@ -643,7 +643,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { task_prog_wgt.setWindowTitle(trUtf8("Retrieving objects from database...")); task_prog_wgt.show(); - task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), ObjDatabase); + task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), ObjectType::ObjDatabase); } tree_wgt->clear(); @@ -657,11 +657,11 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW //Creating database item db_item=new QTreeWidgetItem; db_item->setText(0, import_helper.getCurrentDatabase()); - db_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ObjDatabase))); - attribs=catalog.getObjectsAttributes(ObjDatabase, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); + db_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ObjectType::ObjDatabase))); + attribs=catalog.getObjectsAttributes(ObjectType::ObjDatabase, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(ParsersAttributes::OID).toUInt()); - db_item->setData(ObjectTypeId, Qt::UserRole, ObjDatabase); + db_item->setData(ObjectTypeId, Qt::UserRole, ObjectType::ObjDatabase); db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(ParsersAttributes::OID))); tree_wgt->addTopLevelItem(db_item); @@ -669,7 +669,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW //Retrieving and listing the cluster scoped objects sch_items=DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, - BaseObject::getChildObjectTypes(ObjDatabase), + BaseObject::getChildObjectTypes(ObjectType::ObjDatabase), checkable_items, disable_empty_grps, db_item); if(create_dummy_item) @@ -684,17 +684,17 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW } else { - ObjectType obj_type = ObjBaseObject; + ObjectType obj_type = ObjectType::ObjBaseObject; aux_prog=task_prog_wgt.progress_pb->value(); inc=40/static_cast(sch_items.size()); while(!sch_items.empty()) { - task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), ObjSchema); + task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), ObjectType::ObjSchema); //Retrieving and listing the schema scoped objects tab_items=DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, - BaseObject::getChildObjectTypes(ObjSchema), + BaseObject::getChildObjectTypes(ObjectType::ObjSchema), checkable_items, disable_empty_grps, sch_items.back(), sch_items.back()->text(0)); inc1=(60/static_cast(tab_items.size()))/static_cast(sch_items.size()); @@ -799,7 +799,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe label=name=attribs[ParsersAttributes::NAME]; //Removing the trailing type string from op. families or op. classes names - if(obj_type==ObjOpFamily || obj_type==ObjOpClass) + if(obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjOpClass) { start=name.indexOf(QChar('[')); end=name.lastIndexOf(QChar(']')); @@ -817,8 +817,8 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe if(checkable_items) { if((oid > import_helper.getLastSystemOID()) || - (obj_type==ObjSchema && name==QString("public")) || - (obj_type==ObjColumn && root && root->data(0, Qt::UserRole).toUInt() > import_helper.getLastSystemOID())) + (obj_type==ObjectType::ObjSchema && name==QString("public")) || + (obj_type==ObjectType::ObjColumn && root && root->data(0, Qt::UserRole).toUInt() > import_helper.getLastSystemOID())) { item->setCheckState(0, Qt::Checked); child_checked=true; @@ -827,16 +827,16 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setCheckState(0, Qt::Unchecked); //Disabling items that refers to PostgreSQL's built-in data types - if(obj_type==ObjType && oid <= import_helper.getLastSystemOID()) + if(obj_type==ObjectType::ObjType && oid <= import_helper.getLastSystemOID()) { item->setDisabled(true); item->setToolTip(0, trUtf8("This is a PostgreSQL built-in data type and cannot be imported.")); } //Disabling items that refers to pgModeler's built-in system objects - else if((obj_type==ObjTablespace && (name==QString("pg_default") || name==QString("pg_global"))) || - (obj_type==ObjRole && (name==QString("postgres"))) || - (obj_type==ObjSchema && (name==QString("pg_catalog") || name==QString("public"))) || - (obj_type==ObjLanguage && (name==~LanguageType(LanguageType::c) || + else if((obj_type==ObjectType::ObjTablespace && (name==QString("pg_default") || name==QString("pg_global"))) || + (obj_type==ObjectType::ObjRole && (name==QString("postgres"))) || + (obj_type==ObjectType::ObjSchema && (name==QString("pg_catalog") || name==QString("public"))) || + (obj_type==ObjectType::ObjLanguage && (name==~LanguageType(LanguageType::c) || name==~LanguageType(LanguageType::sql) || name==~LanguageType(LanguageType::plpgsql)))) { @@ -861,7 +861,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setData(ObjectSchema, Qt::UserRole, schema); item->setData(ObjectTable, Qt::UserRole, table); - if(obj_type==ObjSchema || obj_type == ObjTable || obj_type == ObjView) + if(obj_type==ObjectType::ObjSchema || obj_type == ObjectType::ObjTable || obj_type == ObjectType::ObjView) items_vect.push_back(item); } diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index 108a79d98f..cc890bab14 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -116,7 +116,7 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { /*! \brief Retrieve the specified objects from the database and insert them onto the tree view. The "root" parameter is used to associate the group of objects as child of it. The "schema" and "table" parameter are used to filter objects by schema and/or table. - This method automatically returns a list of QTreeWidgetItem when the vector "types" contains ObjSchema or ObjTable or ObjView */ + This method automatically returns a list of QTreeWidgetItem when the vector "types" contains ObjectType::ObjSchema or ObjectType::ObjTable or ObjectType::ObjView */ static vector updateObjectsTree(DatabaseImportHelper &import_helper, QTreeWidget *tree_wgt, vector types, bool checkable_items=false, bool disable_empty_grps=true, QTreeWidgetItem *root=nullptr, const QString &schema=QString(), const QString &table=QString(), unsigned sort_by = 0); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 499c452074..fbd7244dab 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -159,8 +159,8 @@ void DatabaseImportHelper::swapSequencesTablesIds(void) itr=seq_tab_swap.begin(); while(itr!=seq_tab_swap.end()) { - sequence=dbmodel->getObject(getObjectName(itr->first), ObjSequence); - table=dbmodel->getObject(getObjectName(itr->second), ObjTable); + sequence=dbmodel->getObject(getObjectName(itr->first), ObjectType::ObjSequence); + table=dbmodel->getObject(getObjectName(itr->second), ObjectType::ObjTable); if(sequence && table) BaseObject::swapObjectsIds(sequence, table, false); itr++; @@ -173,8 +173,8 @@ void DatabaseImportHelper::retrieveSystemObjects(void) vector::iterator itr; map *obj_map=nullptr; vector objects; - ObjectType sys_objs[]={ ObjSchema, ObjRole, ObjTablespace, - ObjLanguage, /* ObjCollation,*/ ObjType }; + ObjectType sys_objs[]={ ObjectType::ObjSchema, ObjectType::ObjRole, ObjectType::ObjTablespace, + ObjectType::ObjLanguage, /* ObjectType::ObjCollation,*/ ObjectType::ObjType }; unsigned i=0, oid=0, cnt=sizeof(sys_objs)/sizeof(ObjectType); for(i=0; i < cnt && !import_canceled; i++) @@ -183,11 +183,11 @@ void DatabaseImportHelper::retrieveSystemObjects(void) trUtf8("Retrieving system objects... `%1'").arg(BaseObject::getTypeName(sys_objs[i])), sys_objs[i]); - if(sys_objs[i]!=ObjType) + if(sys_objs[i]!=ObjectType::ObjType) { obj_map=&system_objs; - if(sys_objs[i]!=ObjLanguage) + if(sys_objs[i]!=ObjectType::ObjLanguage) catalog.setFilter(Catalog::ListOnlySystemObjs); else catalog.setFilter(Catalog::ListAllObjects); @@ -254,8 +254,8 @@ void DatabaseImportHelper::retrieveUserObjects(void) while(col_itr!=column_oids.end()) { emit s_progressUpdated(progress, - trUtf8("Retrieving objects... `%1'").arg(BaseObject::getTypeName(ObjColumn)), - ObjColumn); + trUtf8("Retrieving objects... `%1'").arg(BaseObject::getTypeName(ObjectType::ObjColumn)), + ObjectType::ObjColumn); names=getObjectName(QString::number(col_itr->first)).split("."); @@ -274,7 +274,7 @@ void DatabaseImportHelper::retrieveTableColumns(const QString &sch_name, const Q vector cols; unsigned tab_oid=0, col_oid; - cols=catalog.getObjectsAttributes(ObjColumn, sch_name, tab_name, col_ids); + cols=catalog.getObjectsAttributes(ObjectType::ObjColumn, sch_name, tab_name, col_ids); for(auto &itr : cols) { @@ -309,7 +309,7 @@ void DatabaseImportHelper::createObjects(void) { /* Constraints are ignored in these phase being pushed into an auxiliary list in order to be created later */ - if(obj_type!=ObjConstraint) + if(obj_type!=ObjectType::ObjConstraint) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2), oid `%3'...") .arg(attribs[ParsersAttributes::NAME]) @@ -386,7 +386,7 @@ void DatabaseImportHelper::createObjects(void) if(tries >= max_tries) emit s_progressUpdated(progress, trUtf8("Import failed to recreate some objects in `%1' tries.").arg(max_tries), - ObjBaseObject); + ObjectType::ObjBaseObject); if(!import_canceled) { @@ -427,8 +427,8 @@ void DatabaseImportHelper::createConstraints(void) emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2)...") .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjConstraint)), - ObjConstraint); + .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)), + ObjectType::ObjConstraint); createObject(attribs); } @@ -464,7 +464,7 @@ void DatabaseImportHelper::createPermissions(void) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); emit s_progressUpdated(progress, msg.arg(getObjectName(attribs[ParsersAttributes::OID])) - .arg(BaseObject::getTypeName(obj_type)), ObjPermission); + .arg(BaseObject::getTypeName(obj_type)), ObjectType::ObjPermission); createPermission(attribs); itr_obj++; @@ -472,7 +472,7 @@ void DatabaseImportHelper::createPermissions(void) progress=((i++)/static_cast(obj_perms.size())) * 100; } - emit s_progressUpdated(progress, trUtf8("Creating columns permissions..."), ObjPermission); + emit s_progressUpdated(progress, trUtf8("Creating columns permissions..."), ObjectType::ObjPermission); //Create the column level permission i=0; while(itr_cols!=col_perms.end() && !import_canceled) @@ -485,7 +485,7 @@ void DatabaseImportHelper::createPermissions(void) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); emit s_progressUpdated(progress, msg.arg(getObjectName(attribs[ParsersAttributes::OID])) - .arg(BaseObject::getTypeName(obj_type)), ObjPermission); + .arg(BaseObject::getTypeName(obj_type)), ObjectType::ObjPermission); createPermission(attribs); itr++; @@ -511,9 +511,9 @@ void DatabaseImportHelper::updateFKRelationships(void) unsigned i=0, count=0; Table *tab=nullptr; - itr_tab=dbmodel->getObjectList(ObjTable)->begin(); - itr_tab_end=dbmodel->getObjectList(ObjTable)->end(); - count=dbmodel->getObjectList(ObjTable)->size(); + itr_tab=dbmodel->getObjectList(ObjectType::ObjTable)->begin(); + itr_tab_end=dbmodel->getObjectList(ObjectType::ObjTable)->end(); + count=dbmodel->getObjectList(ObjectType::ObjTable)->size(); i=0; try @@ -525,8 +525,8 @@ void DatabaseImportHelper::updateFKRelationships(void) emit s_progressUpdated(progress, trUtf8("Updating relationships of `%1' (%2)...") .arg(tab->getName()) - .arg(BaseObject::getTypeName(ObjTable)), - ObjTable); + .arg(BaseObject::getTypeName(ObjectType::ObjTable)), + ObjectType::ObjTable); dbmodel->updateTableFKRelationships(tab); @@ -564,7 +564,7 @@ void DatabaseImportHelper::importDatabase(void) if(!inherited_cols.empty()) { - emit s_progressUpdated(100, trUtf8("Validating relationships..."), ObjRelationship); + emit s_progressUpdated(100, trUtf8("Validating relationships..."), ObjectType::ObjRelationship); dbmodel->validateRelationships(); } @@ -611,7 +611,7 @@ void DatabaseImportHelper::importDatabase(void) vector *rels=nullptr; vector::iterator itr, itr_end; std::uniform_int_distribution dist(0,255); - ObjectType rel_type[]={ ObjRelationship, ObjBaseRelationship }; + ObjectType rel_type[]={ ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }; BaseRelationship *rel=nullptr; for(unsigned i=0; i < 2; i++) @@ -633,7 +633,7 @@ void DatabaseImportHelper::importDatabase(void) } //Forcing the update of tables and views in order to correctly draw their titles without the schema's name - dbmodel->setObjectsModified({ ObjTable, ObjView }); + dbmodel->setObjectsModified({ ObjectType::ObjTable, ObjectType::ObjView }); } resetImportParameters(); @@ -661,7 +661,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) { unsigned oid=attribs[ParsersAttributes::OID].toUInt(); ObjectType obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); - QString obj_name=getObjectName(attribs[ParsersAttributes::OID], (obj_type==ObjFunction || obj_type==ObjOperator)); + QString obj_name=getObjectName(attribs[ParsersAttributes::OID], (obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjOperator)); //Avoiding the creation of pgModeler's temp objects created in database during the catalog reading if(obj_name.contains(Catalog::PgModelerTempDbObj)) @@ -670,7 +670,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) try { if(!import_canceled && - (obj_type==ObjDatabase || TableObject::isTableObject(obj_type) || + (obj_type==ObjectType::ObjDatabase || TableObject::isTableObject(obj_type) || //If the object does not exists on both model and created objects vector ((std::find(created_objs.begin(), created_objs.end(), oid)==created_objs.end()) && @@ -684,13 +684,13 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) attribs[ParsersAttributes::COMMENT]=getComment(attribs); if(attribs.count(ParsersAttributes::OWNER)) - attribs[ParsersAttributes::OWNER]=getDependencyObject(attribs[ParsersAttributes::OWNER], ObjRole, false, auto_resolve_deps); + attribs[ParsersAttributes::OWNER]=getDependencyObject(attribs[ParsersAttributes::OWNER], ObjectType::ObjRole, false, auto_resolve_deps); if(attribs.count(ParsersAttributes::TABLESPACE)) - attribs[ParsersAttributes::TABLESPACE]=getDependencyObject(attribs[ParsersAttributes::TABLESPACE], ObjTablespace, false, auto_resolve_deps); + attribs[ParsersAttributes::TABLESPACE]=getDependencyObject(attribs[ParsersAttributes::TABLESPACE], ObjectType::ObjTablespace, false, auto_resolve_deps); if(attribs.count(ParsersAttributes::SCHEMA)) - attribs[ParsersAttributes::SCHEMA]=getDependencyObject(attribs[ParsersAttributes::SCHEMA], ObjSchema, false, auto_resolve_deps); + attribs[ParsersAttributes::SCHEMA]=getDependencyObject(attribs[ParsersAttributes::SCHEMA], ObjectType::ObjSchema, false, auto_resolve_deps); /* Due to the object recreation mechanism there are some situations when pgModeler fails to recreate them due to the duplication of permissions. So, to avoid this problem we need to check if the OID of the @@ -707,31 +707,31 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) switch(obj_type) { - case ObjDatabase: configureDatabase(attribs); break; - case ObjTablespace: createTablespace(attribs); break; - case ObjSchema: createSchema(attribs); break; - case ObjRole: createRole(attribs); break; - case ObjDomain: createDomain(attribs); break; - case ObjExtension: createExtension(attribs); break; - case ObjFunction: createFunction(attribs); break; - case ObjLanguage: createLanguage(attribs); break; - case ObjOpFamily: createOperatorFamily(attribs); break; - case ObjOpClass: createOperatorClass(attribs); break; - case ObjOperator: createOperator(attribs); break; - case ObjCollation: createCollation(attribs); break; - case ObjCast: createCast(attribs); break; - case ObjConversion: createConversion(attribs); break; - case ObjSequence: createSequence(attribs); break; - case ObjAggregate: createAggregate(attribs); break; - case ObjType: createType(attribs); break; - case ObjTable: createTable(attribs); break; - case ObjView: createView(attribs); break; - case ObjRule: createRule(attribs); break; - case ObjTrigger: createTrigger(attribs); break; - case ObjIndex: createIndex(attribs); break; - case ObjConstraint: createConstraint(attribs); break; - case ObjPolicy: createPolicy(attribs); break; - case ObjEventTrigger: createEventTrigger(attribs); break; + case ObjectType::ObjDatabase: configureDatabase(attribs); break; + case ObjectType::ObjTablespace: createTablespace(attribs); break; + case ObjectType::ObjSchema: createSchema(attribs); break; + case ObjectType::ObjRole: createRole(attribs); break; + case ObjectType::ObjDomain: createDomain(attribs); break; + case ObjectType::ObjExtension: createExtension(attribs); break; + case ObjectType::ObjFunction: createFunction(attribs); break; + case ObjectType::ObjLanguage: createLanguage(attribs); break; + case ObjectType::ObjOpFamily: createOperatorFamily(attribs); break; + case ObjectType::ObjOpClass: createOperatorClass(attribs); break; + case ObjectType::ObjOperator: createOperator(attribs); break; + case ObjectType::ObjCollation: createCollation(attribs); break; + case ObjectType::ObjCast: createCast(attribs); break; + case ObjectType::ObjConversion: createConversion(attribs); break; + case ObjectType::ObjSequence: createSequence(attribs); break; + case ObjectType::ObjAggregate: createAggregate(attribs); break; + case ObjectType::ObjType: createType(attribs); break; + case ObjectType::ObjTable: createTable(attribs); break; + case ObjectType::ObjView: createView(attribs); break; + case ObjectType::ObjRule: createRule(attribs); break; + case ObjectType::ObjTrigger: createTrigger(attribs); break; + case ObjectType::ObjIndex: createIndex(attribs); break; + case ObjectType::ObjConstraint: createConstraint(attribs); break; + case ObjectType::ObjPolicy: createPolicy(attribs); break; + case ObjectType::ObjEventTrigger: createEventTrigger(attribs); break; default: if(debug_mode) @@ -822,7 +822,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType /* If the attributes of the dependency exists but it was not created on the model yet, pgModeler will create it and it's dependencies recursively */ if(recursive_dep_res && !TableObject::isTableObject(obj_type) && - obj_type!=ObjDatabase && dbmodel->getObjectIndex(obj_attr[ParsersAttributes::NAME], obj_type) < 0) + obj_type!=ObjectType::ObjDatabase && dbmodel->getObjectIndex(obj_attr[ParsersAttributes::NAME], obj_type) < 0) createObject(obj_attr); if(use_signature) @@ -927,7 +927,7 @@ void DatabaseImportHelper::createTablespace(attribs_map &attribs) try { - loadObjectXML(ObjTablespace, attribs); + loadObjectXML(ObjectType::ObjTablespace, attribs); tabspc=dbmodel->createTablespace(); dbmodel->addObject(tabspc); } @@ -949,7 +949,7 @@ void DatabaseImportHelper::createSchema(attribs_map &attribs) attribs[ParsersAttributes::FILL_COLOR]=QColor(dist(rand_num_engine), dist(rand_num_engine), dist(rand_num_engine)).name(); - loadObjectXML(ObjSchema, attribs); + loadObjectXML(ObjectType::ObjSchema, attribs); schema=dbmodel->createSchema(); dbmodel->addObject(schema); @@ -975,7 +975,7 @@ void DatabaseImportHelper::createRole(attribs_map &attribs) for(unsigned i=0; i < 3; i++) attribs[role_types[i]]=getObjectNames(attribs[role_types[i]]).join(','); - loadObjectXML(ObjRole, attribs); + loadObjectXML(ObjectType::ObjRole, attribs); role=dbmodel->createRole(); dbmodel->addObject(role); } @@ -1016,8 +1016,8 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) } attribs[ParsersAttributes::TYPE]=getType(attribs[ParsersAttributes::TYPE], true, attribs); - attribs[ParsersAttributes::COLLATION]=getDependencyObject(attribs[ParsersAttributes::COLLATION], ObjCollation); - loadObjectXML(ObjDomain, attribs); + attribs[ParsersAttributes::COLLATION]=getDependencyObject(attribs[ParsersAttributes::COLLATION], ObjectType::ObjCollation); + loadObjectXML(ObjectType::ObjDomain, attribs); dom=dbmodel->createDomain(); dbmodel->addDomain(dom); } @@ -1035,7 +1035,7 @@ void DatabaseImportHelper::createExtension(attribs_map &attribs) try { - loadObjectXML(ObjExtension, attribs); + loadObjectXML(ObjectType::ObjExtension, attribs); ext=dbmodel->createExtension(); dbmodel->addExtension(ext); } @@ -1148,7 +1148,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) } //Get the language reference code - attribs[ParsersAttributes::LANGUAGE]=getDependencyObject(attribs[ParsersAttributes::LANGUAGE], ObjLanguage); + attribs[ParsersAttributes::LANGUAGE]=getDependencyObject(attribs[ParsersAttributes::LANGUAGE], ObjectType::ObjLanguage); //Get the return type if there is no return table configured if(attribs[ParsersAttributes::RETURN_TABLE].isEmpty()) @@ -1163,7 +1163,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) attribs[ParsersAttributes::RETURN_TYPE]=getType(attribs[ParsersAttributes::RETURN_TYPE], true); } - loadObjectXML(ObjFunction, attribs); + loadObjectXML(ObjectType::ObjFunction, attribs); func=dbmodel->createFunction(); dbmodel->addFunction(func); } @@ -1195,12 +1195,12 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) function is defined after the language pgModeler will raise errors so in order to continue the import these fuctions are simply ignored */ if(func_oid < lang_oid) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjFunction, true , true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::ObjFunction, true , true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); else attribs[func_types[i]]=QString(); } - loadObjectXML(ObjLanguage, attribs); + loadObjectXML(ObjectType::ObjLanguage, attribs); lang=dbmodel->createLanguage(); dbmodel->addLanguage(lang); } @@ -1218,7 +1218,7 @@ void DatabaseImportHelper::createOperatorFamily(attribs_map &attribs) try { - loadObjectXML(ObjOpFamily, attribs); + loadObjectXML(ObjectType::ObjOpFamily, attribs); opfam=dbmodel->createOperatorFamily(); dbmodel->addOperatorFamily(opfam); } @@ -1269,7 +1269,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) { list=array_vals[i].split(':'); elem_attr[ParsersAttributes::STRATEGY_NUM]=list[0]; - elem_attr[ParsersAttributes::DEFINITION]=getDependencyObject(list[1], ObjFunction, true); + elem_attr[ParsersAttributes::DEFINITION]=getDependencyObject(list[1], ObjectType::ObjFunction, true); elems.push_back(elem_attr); } } @@ -1286,8 +1286,8 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) list=array_vals[i].split(':'); elem_attr[ParsersAttributes::DEFINITION]=""; elem_attr[ParsersAttributes::STRATEGY_NUM]=list[0]; - elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[1], ObjOperator, true); - elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[2], ObjOpFamily, true); + elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[1], ObjectType::ObjOperator, true); + elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[2], ObjectType::ObjOpFamily, true); elems.push_back(elem_attr); } } @@ -1300,7 +1300,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) schparser.ignoreUnkownAttributes(false); } - loadObjectXML(ObjOpClass, attribs); + loadObjectXML(ObjectType::ObjOpClass, attribs); opclass=dbmodel->createOperatorClass(); dbmodel->addOperatorClass(opclass); } @@ -1333,7 +1333,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) ParsersAttributes::NEGATOR_OP }; for(unsigned i=0; i < 3; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjFunction, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::ObjFunction, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); for(unsigned i=0; i < 2; i++) attribs[arg_types[i]]=getType(attribs[arg_types[i]], true, {{ParsersAttributes::REF_TYPE, arg_types[i]}}); @@ -1341,7 +1341,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) regexp.setPattern(ParsersAttributes::SIGNATURE + QString("(=)(\")")); for(unsigned i=0; i < 2; i++) { - attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjOperator, true, false, true, {{ParsersAttributes::REF_TYPE, op_types[i]}}); + attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjectType::ObjOperator, true, false, true, {{ParsersAttributes::REF_TYPE, op_types[i]}}); if(!attribs[op_types[i]].isEmpty()) { @@ -1354,12 +1354,12 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) op_signature=attribs[op_types[i]].mid(pos, (attribs[op_types[i]].indexOf('"',pos) - pos)); //If the operator is not defined clear up the reference to it - if(dbmodel->getObjectIndex(op_signature, ObjOperator) < 0) + if(dbmodel->getObjectIndex(op_signature, ObjectType::ObjOperator) < 0) attribs[op_types[i]].clear(); } } - loadObjectXML(ObjOperator, attribs); + loadObjectXML(ObjectType::ObjOperator, attribs); oper=dbmodel->createOperator(); dbmodel->addOperator(oper); } @@ -1377,7 +1377,7 @@ void DatabaseImportHelper::createCollation(attribs_map &attribs) try { - loadObjectXML(ObjCollation, attribs); + loadObjectXML(ObjectType::ObjCollation, attribs); coll=dbmodel->createCollation(); dbmodel->addCollation(coll); } @@ -1395,10 +1395,10 @@ void DatabaseImportHelper::createCast(attribs_map &attribs) try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjFunction, true); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::ObjFunction, true); attribs[ParsersAttributes::SOURCE_TYPE]=getType(attribs[ParsersAttributes::SOURCE_TYPE], true); attribs[ParsersAttributes::DEST_TYPE]=getType(attribs[ParsersAttributes::DEST_TYPE], true); - loadObjectXML(ObjCast, attribs); + loadObjectXML(ObjectType::ObjCast, attribs); cast=dbmodel->createCast(); dbmodel->addCast(cast); } @@ -1416,8 +1416,8 @@ void DatabaseImportHelper::createConversion(attribs_map &attribs) try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjFunction, true, auto_resolve_deps); - loadObjectXML(ObjConversion, attribs); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::ObjFunction, true, auto_resolve_deps); + loadObjectXML(ObjectType::ObjConversion, attribs); conv=dbmodel->createConversion(); dbmodel->addConversion(conv); } @@ -1460,7 +1460,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) /* Get the table and the owner column instances so the sequence code can be disabled if the column is an identity one */ - tab_name = getDependencyObject(owner_col[0], ObjTable, true, auto_resolve_deps, false, + tab_name = getDependencyObject(owner_col[0], ObjectType::ObjTable, true, auto_resolve_deps, false, {{ ParsersAttributes::POSITION, schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XmlDefinition)}}); @@ -1474,7 +1474,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) for(int i=0; i < seq_attribs.size(); i++) attribs[attr[i]]=seq_attribs[i]; - loadObjectXML(ObjSequence, attribs); + loadObjectXML(ObjectType::ObjSequence, attribs); seq=dbmodel->createSequence(); dbmodel->addSequence(seq); @@ -1506,7 +1506,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) sch_name; for(unsigned i=0; i < 2; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjFunction, true, auto_resolve_deps, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::ObjFunction, true, auto_resolve_deps, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); types=getTypes(attribs[ParsersAttributes::TYPES], true); attribs[ParsersAttributes::TYPES]=QString(); @@ -1519,9 +1519,9 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) attribs[ParsersAttributes::STATE_TYPE]=getType(attribs[ParsersAttributes::STATE_TYPE], true, {{ParsersAttributes::REF_TYPE, ParsersAttributes::STATE_TYPE}}); - attribs[ParsersAttributes::SORT_OP]=getDependencyObject(attribs[ParsersAttributes::SORT_OP], ObjOperator, true); + attribs[ParsersAttributes::SORT_OP]=getDependencyObject(attribs[ParsersAttributes::SORT_OP], ObjectType::ObjOperator, true); - loadObjectXML(ObjAggregate, attribs); + loadObjectXML(ObjectType::ObjAggregate, attribs); agg=dbmodel->createAggregate(); dbmodel->addAggregate(agg); @@ -1570,7 +1570,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { type_attrib.setName(values[0].remove('"')); type_attrib.setType(PgSQLType::parseString(values[1].remove('\\'))); - type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjCollation)); + type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjectType::ObjCollation)); attribs[ParsersAttributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XmlDefinition); } } @@ -1580,10 +1580,10 @@ void DatabaseImportHelper::createType(attribs_map &attribs) QStringList range_attr=Catalog::parseArrayValues(attribs[ParsersAttributes::RANGE_ATTRIBS]); attribs[ParsersAttributes::SUBTYPE]=getType(range_attr[0], true); - attribs[ParsersAttributes::COLLATION]=getDependencyObject(range_attr[1], ObjCollation, true); - attribs[ParsersAttributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjOpClass, true); - attribs[ParsersAttributes::CANONICAL_FUNC]=getDependencyObject(range_attr[3], ObjFunction, true); - attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjFunction, true); + attribs[ParsersAttributes::COLLATION]=getDependencyObject(range_attr[1], ObjectType::ObjCollation, true); + attribs[ParsersAttributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjectType::ObjOpClass, true); + attribs[ParsersAttributes::CANONICAL_FUNC]=getDependencyObject(range_attr[3], ObjectType::ObjFunction, true); + attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjectType::ObjFunction, true); } else { @@ -1605,7 +1605,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { for(i=0; i < count; i++) { - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjFunction, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::ObjFunction, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); /* Since pgModeler requires that type functions refers to the constructing type as "any" it's necessary to replace the function parameter types names */ @@ -1614,7 +1614,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) } } - loadObjectXML(ObjType, attribs); + loadObjectXML(ObjectType::ObjType, attribs); type=dbmodel->createType(); dbmodel->addType(type); } @@ -1709,13 +1709,13 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) the non-array type, this way, if the original type is created there is no need to create the array form */ if(auto_resolve_deps && !is_type_registered && !type_name.contains(QString("[]"))) { - type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjType); + type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::ObjType); unknown_obj_xml=UnkownObjectOidXml.arg(type_oid); /* If the type still doesn't exists means that the column maybe is referencing a domain this way pgModeler will try to retrieve the mentionend object */ if(type_def==unknown_obj_xml) - type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjDomain); + type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::ObjDomain); } col.setIdentityType(BaseType::null); @@ -1759,15 +1759,15 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) //Checking if the collation used by the column exists, if not it'll be created when auto_resolve_deps is checked if(auto_resolve_deps && !itr->second[ParsersAttributes::COLLATION].isEmpty()) - getDependencyObject(itr->second[ParsersAttributes::COLLATION], ObjCollation); + getDependencyObject(itr->second[ParsersAttributes::COLLATION], ObjectType::ObjCollation); - col.setCollation(dbmodel->getObject(getObjectName(itr->second[ParsersAttributes::COLLATION]),ObjCollation)); + col.setCollation(dbmodel->getObject(getObjectName(itr->second[ParsersAttributes::COLLATION]),ObjectType::ObjCollation)); attribs[ParsersAttributes::COLUMNS]+=col.getCodeDefinition(SchemaParser::XmlDefinition); itr++; col_idx++; } - loadObjectXML(ObjTable, attribs); + loadObjectXML(ObjectType::ObjTable, attribs); table=dbmodel->createTable(); for(unsigned col_idx : inh_cols) @@ -1782,7 +1782,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) Table *partitioned_tab = nullptr; attribs[ParsersAttributes::PARTITIONED_TABLE] = - getDependencyObject(attribs[ParsersAttributes::PARTITIONED_TABLE], ObjTable, true, auto_resolve_deps, false); + getDependencyObject(attribs[ParsersAttributes::PARTITIONED_TABLE], ObjectType::ObjTable, true, auto_resolve_deps, false); partitioned_tab = dbmodel->getTable(attribs[ParsersAttributes::PARTITIONED_TABLE]); table->setPartionedTable(partitioned_tab); @@ -1790,8 +1790,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(!partitioned_tab) { throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjTable)) - .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjTable)), + .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::ObjTable)) + .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjectType::ObjTable)), RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1831,8 +1831,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) // Retriving the collation for the partion key if(i < collations.size() && collations[i] != QString("0")) { - coll_name = getDependencyObject(collations[i], ObjCollation, false, true, false); - coll = dynamic_cast(dbmodel->getObject(coll_name, ObjCollation)); + coll_name = getDependencyObject(collations[i], ObjectType::ObjCollation, false, true, false); + coll = dynamic_cast(dbmodel->getObject(coll_name, ObjectType::ObjCollation)); //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" if(coll && (!coll->isSystemObject() || @@ -1843,8 +1843,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) // Retriving the operator class for the partion key if(i < opclasses.size() && opclasses[i] != QString("0")) { - opc_name = getDependencyObject(opclasses[i], ObjOpClass, true, true, false); - opclass = dynamic_cast(dbmodel->getObject(opc_name, ObjOpClass)); + opc_name = getDependencyObject(opclasses[i], ObjectType::ObjOpClass, true, true, false); + opclass = dynamic_cast(dbmodel->getObject(opc_name, ObjectType::ObjOpClass)); if(opclass) part_key.setOperatorClass(opclass); @@ -1883,7 +1883,7 @@ void DatabaseImportHelper::createView(attribs_map &attribs) ref.setDefinitionExpression(true); attribs[ParsersAttributes::REFERENCES]=ref.getXMLDefinition(); - loadObjectXML(ObjView, attribs); + loadObjectXML(ObjectType::ObjView, attribs); view=dbmodel->createView(); dbmodel->addView(view); @@ -1903,7 +1903,7 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) QString cmds=attribs[ParsersAttributes::COMMANDS]; int start=-1; QRegExp cond_regexp(QString("(WHERE)(.)+(DO)")); - ObjectType table_type=ObjTable; + ObjectType table_type=ObjectType::ObjTable; try { @@ -1916,12 +1916,12 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) attribs[ParsersAttributes::COMMANDS]=Catalog::parseRuleCommands(attribs[ParsersAttributes::COMMANDS]).join(';'); - if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjView)) - table_type=ObjView; + if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::ObjView)) + table_type=ObjectType::ObjView; attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); - loadObjectXML(ObjRule, attribs); + loadObjectXML(ObjectType::ObjRule, attribs); rule=dbmodel->createRule(); } catch(Exception &e) @@ -1936,16 +1936,16 @@ void DatabaseImportHelper::createTrigger(attribs_map &attribs) { try { - ObjectType table_type=ObjTable; + ObjectType table_type=ObjectType::ObjTable; - if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjView)) - table_type=ObjView; + if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::ObjView)) + table_type=ObjectType::ObjView; attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); - attribs[ParsersAttributes::TRIGGER_FUNC]=getDependencyObject(attribs[ParsersAttributes::TRIGGER_FUNC], ObjFunction, true, true); + attribs[ParsersAttributes::TRIGGER_FUNC]=getDependencyObject(attribs[ParsersAttributes::TRIGGER_FUNC], ObjectType::ObjFunction, true, true); attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS].remove(QString(",\"\""))).join(','); - loadObjectXML(ObjTrigger, attribs); + loadObjectXML(ObjectType::ObjTrigger, attribs); dbmodel->createTrigger(); } catch(Exception &e) @@ -2011,18 +2011,18 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) int i; attribs[ParsersAttributes::FACTOR]=QString("90"); - tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjTable, true, auto_resolve_deps, false); - parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjTable)); + tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable, true, auto_resolve_deps, false); + parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::ObjTable)); if(!parent_tab) { - tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjView, true, auto_resolve_deps, false); - parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjView)); + tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView, true, auto_resolve_deps, false); + parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::ObjView)); if(!parent_tab) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjIndex)) - .arg(tab_name).arg(BaseObject::getTypeName(ObjTable)), + .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::ObjIndex)) + .arg(tab_name).arg(BaseObject::getTypeName(ObjectType::ObjTable)), RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -2037,7 +2037,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(cols[i]!=QString("0")) { - if(parent_tab->getObjectType() == ObjTable) + if(parent_tab->getObjectType() == ObjectType::ObjTable) elem.setColumn(dynamic_cast
(parent_tab)->getColumn(getColumnName(attribs[ParsersAttributes::TABLE], cols[i]))); else elem.setExpression(getColumnName(attribs[ParsersAttributes::TABLE], cols[i])); @@ -2050,8 +2050,8 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(i < collations.size() && collations[i]!=QString("0")) { - coll_name=getDependencyObject(collations[i], ObjCollation, false, true, false); - coll=dynamic_cast(dbmodel->getObject(coll_name, ObjCollation)); + coll_name=getDependencyObject(collations[i], ObjectType::ObjCollation, false, true, false); + coll=dynamic_cast(dbmodel->getObject(coll_name, ObjectType::ObjCollation)); //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" if(coll && (!coll->isSystemObject() || @@ -2061,8 +2061,8 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(i < opclasses.size() && opclasses[i]!=QString("0")) { - opc_name=getDependencyObject(opclasses[i], ObjOpClass, true, true, false); - opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjOpClass)); + opc_name=getDependencyObject(opclasses[i], ObjectType::ObjOpClass, true, true, false); + opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjectType::ObjOpClass)); if(opclass) elem.setOperatorClass(opclass); @@ -2073,7 +2073,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) } attribs[ParsersAttributes::TABLE]=tab_name; - loadObjectXML(ObjIndex, attribs); + loadObjectXML(ObjectType::ObjIndex, attribs); dbmodel->createIndex(); } catch(Exception &e) @@ -2100,13 +2100,13 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) QStringList factor=Catalog::parseArrayValues(attribs[ParsersAttributes::FACTOR]); //Retrieving the table is it was not imported yet and auto_resolve_deps is true - tab_name=getDependencyObject(table_oid, ObjTable, true, auto_resolve_deps, false); + tab_name=getDependencyObject(table_oid, ObjectType::ObjTable, true, auto_resolve_deps, false); if(!factor.isEmpty() && factor[0].startsWith(QString("fillfactor="))) attribs[ParsersAttributes::FACTOR]=factor[0].remove(QString("fillfactor=")); attribs[attribs[ParsersAttributes::TYPE]]=ParsersAttributes::_TRUE_; - table=dynamic_cast
(dbmodel->getObject(tab_name, ObjTable)); + table=dynamic_cast
(dbmodel->getObject(tab_name, ObjectType::ObjTable)); if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::EX_CONSTR) { @@ -2147,8 +2147,8 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) if(i < opclasses.size() && opclasses[i]!=QString("0")) { - opc_name=getDependencyObject(opclasses[i], ObjOpClass, true, true, false); - opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjOpClass)); + opc_name=getDependencyObject(opclasses[i], ObjectType::ObjOpClass, true, true, false); + opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjectType::ObjOpClass)); if(opclass) elem.setOperatorClass(opclass); @@ -2156,8 +2156,8 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) if(i < opers.size() && opers[i]!=QString("0")) { - op_name=getDependencyObject(opers[i], ObjOperator, true, true, false); - oper=dynamic_cast(dbmodel->getObject(op_name, ObjOperator)); + op_name=getDependencyObject(opers[i], ObjectType::ObjOperator, true, true, false); + oper=dynamic_cast(dbmodel->getObject(op_name, ObjectType::ObjOperator)); if(oper) elem.setOperator(oper); @@ -2175,11 +2175,11 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) attribs[ParsersAttributes::SRC_COLUMNS]=getColumnNames(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::SRC_COLUMNS]).join(','); } - attribs[ParsersAttributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjTable, false, true, false); + attribs[ParsersAttributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjectType::ObjTable, false, true, false); attribs[ParsersAttributes::DST_COLUMNS]=getColumnNames(ref_tab_oid, attribs[ParsersAttributes::DST_COLUMNS]).join(','); attribs[ParsersAttributes::TABLE]=tab_name; - loadObjectXML(ObjConstraint, attribs); + loadObjectXML(ObjectType::ObjConstraint, attribs); constr=dbmodel->createConstraint(nullptr); if(table && constr->getConstraintType()==ConstraintType::primary_key) @@ -2200,9 +2200,9 @@ void DatabaseImportHelper::createPolicy(attribs_map &attribs) { try { - attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjTable, true, auto_resolve_deps, false); + attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable, true, auto_resolve_deps, false); attribs[ParsersAttributes::ROLES]=getObjectNames(attribs[ParsersAttributes::ROLES]).join(','); - loadObjectXML(ObjPolicy, attribs); + loadObjectXML(ObjectType::ObjPolicy, attribs); dbmodel->createPolicy(); } catch(Exception &e) @@ -2216,14 +2216,14 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) { try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjFunction, true, true); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::ObjFunction, true, true); attribs[ParsersAttributes::FILTER]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") .arg(ParsersAttributes::FILTER) .arg(ParsersAttributes::VARIABLE).arg(ParsersAttributes::TAG.toUpper()) .arg(ParsersAttributes::VALUES) .arg(Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES].remove('"')).join(',')); - loadObjectXML(ObjEventTrigger, attribs); + loadObjectXML(ObjectType::ObjEventTrigger, attribs); dbmodel->addEventTrigger(dbmodel->createEventTrigger()); } catch(Exception &e) @@ -2253,9 +2253,9 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) if(!perm_list.isEmpty()) { - if(obj_type!=ObjColumn) + if(obj_type!=ObjectType::ObjColumn) { - if(obj_type==ObjDatabase) + if(obj_type==ObjectType::ObjDatabase) object=dbmodel; else { @@ -2266,8 +2266,8 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) else { //If the object is column it's necessary to retrive the parent table to get the valid reference to column - table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[ParsersAttributes::TABLE]), ObjTable)); - object=table->getObject(getColumnName(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::OID]), ObjColumn); + table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[ParsersAttributes::TABLE]), ObjectType::ObjTable)); + object=table->getObject(getColumnName(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::OID]), ObjectType::ObjColumn); } } @@ -2281,21 +2281,21 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) if(!privs.empty() || gop_privs.empty()) { - role=dynamic_cast(dbmodel->getObject(role_name, ObjRole)); + role=dynamic_cast(dbmodel->getObject(role_name, ObjectType::ObjRole)); if(auto_resolve_deps && !role_name.isEmpty() && !role) { - QString oid = catalog.getObjectOID(role_name, ObjRole); - getDependencyObject(oid, ObjRole); - role=dynamic_cast(dbmodel->getObject(role_name, ObjRole)); + QString oid = catalog.getObjectOID(role_name, ObjectType::ObjRole); + getDependencyObject(oid, ObjectType::ObjRole); + role=dynamic_cast(dbmodel->getObject(role_name, ObjectType::ObjRole)); } /* If the role doesn't exists and there is a name defined, throws an error because the roles wasn't found on the model */ if(!role && !role_name.isEmpty()) throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) - .arg(QString("permission_%1").arg(perm_list[i])).arg(BaseObject::getTypeName(ObjPermission)) - .arg(role_name).arg(BaseObject::getTypeName(ObjRole)) + .arg(QString("permission_%1").arg(perm_list[i])).arg(BaseObject::getTypeName(ObjectType::ObjPermission)) + .arg(role_name).arg(BaseObject::getTypeName(ObjectType::ObjRole)) ,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -2341,13 +2341,13 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) void DatabaseImportHelper::createTableInheritances(void) { //Creating table inheiritances - if(dbmodel->getObjectCount(ObjTable) > 0 && !import_canceled) + if(dbmodel->getObjectCount(ObjectType::ObjTable) > 0 && !import_canceled) { try { emit s_progressUpdated(90, trUtf8("Creating table inheritances..."), - ObjRelationship); + ObjectType::ObjRelationship); __createTableInheritances(); } catch(Exception &e) @@ -2373,7 +2373,7 @@ void DatabaseImportHelper::createTablePartitionings(void) emit s_progressUpdated(95, trUtf8("Creating table partitionings..."), - ObjRelationship); + ObjectType::ObjRelationship); // Creating the paritioning relationships for(auto &itr : imported_tables) @@ -2414,7 +2414,7 @@ void DatabaseImportHelper::destroyDetachedColumns(void) emit s_progressUpdated(100, trUtf8("Destroying unused detached columns..."), - ObjColumn); + ObjectType::ObjColumn); //Destroying detached columns before create inheritances for(Column *col : inherited_cols) @@ -2451,13 +2451,13 @@ void DatabaseImportHelper::assignSequencesToColumns(void) Column *col=nullptr; emit s_progressUpdated(100, trUtf8("Assigning sequences to columns..."), - ObjSequence); + ObjectType::ObjSequence); - for(auto &object : *dbmodel->getObjectList(ObjTable)) + for(auto &object : *dbmodel->getObjectList(ObjectType::ObjTable)) { table=dynamic_cast
(object); - for(auto &tab_obj : *table->getObjectList(ObjColumn)) + for(auto &tab_obj : *table->getObjectList(ObjectType::ObjColumn)) { col=dynamic_cast(tab_obj); @@ -2500,8 +2500,8 @@ void DatabaseImportHelper::__createTableInheritances(void) QStringList inh_list; unsigned oid; - itr=object_oids[ObjTable].begin(); - itr_end=object_oids[ObjTable].end(); + itr=object_oids[ObjectType::ObjTable].begin(); + itr_end=object_oids[ObjectType::ObjTable].end(); while(itr!=itr_end) { @@ -2513,19 +2513,19 @@ void DatabaseImportHelper::__createTableInheritances(void) if(!inh_list.isEmpty()) { //Get the child table resolving it's name from the oid - child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][ParsersAttributes::OID]), ObjTable)); + child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][ParsersAttributes::OID]), ObjectType::ObjTable)); while(!inh_list.isEmpty()) { //Get the parent table resolving it's name from the oid - parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjTable)); + parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjectType::ObjTable)); try { if(!parent_tab && auto_resolve_deps) { - getDependencyObject(inh_list.front(), ObjTable); - parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjTable)); + getDependencyObject(inh_list.front(), ObjectType::ObjTable); + parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjectType::ObjTable)); } if(!parent_tab) @@ -2536,7 +2536,7 @@ void DatabaseImportHelper::__createTableInheritances(void) //Create the inheritance relationship rel=new Relationship(Relationship::RelationshipGen, child_tab, parent_tab); - rel->setName(PgModelerNs::generateUniqueName(rel, (*dbmodel->getObjectList(ObjRelationship)))); + rel->setName(PgModelerNs::generateUniqueName(rel, (*dbmodel->getObjectList(ObjectType::ObjRelationship)))); dbmodel->addRelationship(rel); rel=nullptr; @@ -2560,7 +2560,7 @@ void DatabaseImportHelper::configureDatabase(attribs_map &attribs) try { attribs[ParsersAttributes::APPEND_AT_EOD]=QString(); - loadObjectXML(ObjDatabase, attribs); + loadObjectXML(ObjectType::ObjDatabase, attribs); dbmodel->configureDatabase(attribs); } catch(Exception &e) @@ -2602,11 +2602,11 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f obj_name.prepend(sch_name + QString(".")); //Formatting the name in form of signature (only for functions and operators) - if(signature_form && (obj_type==ObjFunction || obj_type==ObjOperator || obj_type==ObjAggregate || obj_type==ObjOpFamily || obj_type==ObjOpClass)) + if(signature_form && (obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjOperator || obj_type==ObjectType::ObjAggregate || obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjOpClass)) { QStringList params; - if(obj_type==ObjFunction) + if(obj_type==ObjectType::ObjFunction) { QStringList arg_types=getTypes(obj_attr[ParsersAttributes::ARG_TYPES], false), arg_modes=Catalog::parseArrayValues(obj_attr[ParsersAttributes::ARG_MODES]); @@ -2626,14 +2626,14 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f } } } - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) { QStringList params=getTypes(obj_attr[ParsersAttributes::TYPES], false); if(params.isEmpty()) params.push_back(QString("*")); } - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) { if(obj_attr[ParsersAttributes::LEFT_TYPE].toUInt() > 0) params.push_back(getType(obj_attr[ParsersAttributes::LEFT_TYPE], false)); @@ -2650,7 +2650,7 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f obj_name += QString(" USING %1").arg(obj_attr[ParsersAttributes::INDEX_TYPE]); } - if(obj_type != ObjOpFamily && obj_type != ObjOpClass) + if(obj_type != ObjectType::ObjOpFamily && obj_type != ObjectType::ObjOpClass) obj_name+=QString("(") + params.join(',') + QString(")"); } @@ -2751,14 +2751,14 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, { ObjectType obj_type; - if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjTable)) - obj_type=ObjTable; - else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjView)) - obj_type=ObjView; - else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjDomain)) - obj_type=ObjDomain; + if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::ObjTable)) + obj_type=ObjectType::ObjTable; + else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::ObjView)) + obj_type=ObjectType::ObjView; + else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::ObjDomain)) + obj_type=ObjectType::ObjDomain; else - obj_type=ObjSequence; + obj_type=ObjectType::ObjSequence; is_derivated_from_obj = true; getDependencyObject(type_attr[ParsersAttributes::OBJECT_ID], obj_type, true, true, false); diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 09ab313c06..3cce457e32 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -272,7 +272,7 @@ class DatabaseImportHelper: public QObject { signals: //! \brief This singal is emitted whenever the export progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjBaseObject); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::ObjBaseObject); //! \brief This signal is emited when the import has finished void s_importFinished(Exception e=Exception()); diff --git a/libpgmodeler_ui/src/databasewidget.cpp b/libpgmodeler_ui/src/databasewidget.cpp index e26f1062d2..51a11cbd83 100644 --- a/libpgmodeler_ui/src/databasewidget.cpp +++ b/libpgmodeler_ui/src/databasewidget.cpp @@ -18,7 +18,7 @@ #include "databasewidget.h" -DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, ObjDatabase) +DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjDatabase) { try { @@ -27,12 +27,12 @@ DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, ObjDat QGridLayout *grid=nullptr; Ui_DatabaseWidget::setupUi(this); - configureFormLayout(database_grid, ObjDatabase); + configureFormLayout(database_grid, ObjectType::ObjDatabase); - def_schema_sel=new ObjectSelectorWidget(ObjSchema, true, this); - def_collation_sel=new ObjectSelectorWidget(ObjCollation, true, this); - def_owner_sel=new ObjectSelectorWidget(ObjRole, true, this); - def_tablespace_sel=new ObjectSelectorWidget(ObjTablespace, true, this); + def_schema_sel=new ObjectSelectorWidget(ObjectType::ObjSchema, true, this); + def_collation_sel=new ObjectSelectorWidget(ObjectType::ObjCollation, true, this); + def_owner_sel=new ObjectSelectorWidget(ObjectType::ObjRole, true, this); + def_tablespace_sel=new ObjectSelectorWidget(ObjectType::ObjTablespace, true, this); frame=generateInformationFrame(trUtf8("The fields LC_COLLATE and LC_CTYPE have pre-configured values based upon the running system. You can freely modify those values if you intend to export the model to another host.")); grid=dynamic_cast(attributes_twg->widget(0)->layout()); @@ -98,16 +98,16 @@ void DatabaseWidget::setAttributes(DatabaseModel *model) lcctype_cmb->setCurrentText(model->getLocalization(Collation::LcCtype)); def_schema_sel->setModel(model); - def_schema_sel->setSelectedObject(model->getDefaultObject(ObjSchema)); + def_schema_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjSchema)); def_collation_sel->setModel(model); - def_collation_sel->setSelectedObject(model->getDefaultObject(ObjCollation)); + def_collation_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjCollation)); def_owner_sel->setModel(model); - def_owner_sel->setSelectedObject(model->getDefaultObject(ObjRole)); + def_owner_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjRole)); def_tablespace_sel->setModel(model); - def_tablespace_sel->setSelectedObject(model->getDefaultObject(ObjTablespace)); + def_tablespace_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjTablespace)); allow_conn_chk->setChecked(model->isAllowConnections()); is_template_chk->setChecked(model->isTemplate()); @@ -142,10 +142,10 @@ void DatabaseWidget::applyConfiguration(void) else model->setLocalization(Collation::LcCtype, QString()); - model->setDefaultObject(def_schema_sel->getSelectedObject(), ObjSchema); - model->setDefaultObject(def_owner_sel->getSelectedObject(), ObjRole); - model->setDefaultObject(def_collation_sel->getSelectedObject(), ObjCollation); - model->setDefaultObject(def_tablespace_sel->getSelectedObject(), ObjTablespace); + model->setDefaultObject(def_schema_sel->getSelectedObject(), ObjectType::ObjSchema); + model->setDefaultObject(def_owner_sel->getSelectedObject(), ObjectType::ObjRole); + model->setDefaultObject(def_collation_sel->getSelectedObject(), ObjectType::ObjCollation); + model->setDefaultObject(def_tablespace_sel->getSelectedObject(), ObjectType::ObjTablespace); model->setIsTemplate(is_template_chk->isChecked()); model->setAllowConnections(allow_conn_chk->isChecked()); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 8d5264486f..335ad3dcb6 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -177,9 +177,9 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("colar")), trUtf8("Pase items")); act->setShortcut(paste_tb->shortcut()); connect(act, SIGNAL(triggered(bool)), paste_tb, SLOT(click())); - act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == ObjTable); + act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == ObjectType::ObjTable); - if(obj_type == ObjTable) + if(obj_type == ObjectType::ObjTable) { item_menu.addSeparator(); act = item_menu.addAction(browse_tabs_tb->icon(), trUtf8("Browse tables")); @@ -226,7 +226,7 @@ void DataManipulationForm::setAttributes(Connection conn, const QString curr_sch this->setWindowTitle(this->windowTitle() + QString(" - ") + db_name); schema_cmb->clear(); - listObjects(schema_cmb, { ObjSchema }); + listObjects(schema_cmb, { ObjectType::ObjSchema }); disableControlButtons(); schema_cmb->setCurrentText(curr_schema); @@ -270,9 +270,9 @@ void DataManipulationForm::listTables(void) if(schema_cmb->currentIndex() > 0) { if(hide_views_chk->isChecked()) - listObjects(table_cmb, { ObjTable }, schema_cmb->currentText()); + listObjects(table_cmb, { ObjectType::ObjTable }, schema_cmb->currentText()); else - listObjects(table_cmb, { ObjTable, ObjView }, schema_cmb->currentText()); + listObjects(table_cmb, { ObjectType::ObjTable, ObjectType::ObjView }, schema_cmb->currentText()); } table_lbl->setEnabled(table_cmb->count() > 0); @@ -296,7 +296,7 @@ void DataManipulationForm::listColumns(void) vector cols; catalog.setConnection(conn); - cols=catalog.getObjectsAttributes(ObjColumn, schema_cmb->currentText(), table_cmb->currentText()); + cols=catalog.getObjectsAttributes(ObjectType::ObjColumn, schema_cmb->currentText(), table_cmb->currentText()); for(auto &col : cols) { @@ -388,12 +388,12 @@ void DataManipulationForm::retrieveData(void) clearChangedRows(); //If the table is empty automatically creates a new row - if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()==ObjTable) + if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()==ObjectType::ObjTable) addRow(); else results_tbw->setFocus(); - if(table_cmb->currentData(Qt::UserRole).toUInt()==ObjTable) + if(table_cmb->currentData(Qt::UserRole).toUInt()==ObjectType::ObjTable) csv_load_tb->setEnabled(!col_names.isEmpty()); else { @@ -407,15 +407,15 @@ void DataManipulationForm::retrieveData(void) QApplication::restoreOverrideCursor(); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == ObjTable && + table_cmb->currentData().toUInt() == ObjectType::ObjTable && !col_names.isEmpty()); - truncate_tb->setEnabled(table_cmb->currentData().toUInt() == ObjTable && + truncate_tb->setEnabled(table_cmb->currentData().toUInt() == ObjectType::ObjTable && res.getTupleCount() > 0 && !col_names.isEmpty()); code_compl_wgt->clearCustomItems(); - code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), ObjColumn); + code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), ObjectType::ObjColumn); columns_lst->clear(); QListWidgetItem *item = nullptr; @@ -476,7 +476,7 @@ void DataManipulationForm::enableRowControlButtons(void) duplicate_tb->setEnabled(cols_selected); copy_tb->setEnabled(sel_ranges.count() != 0); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == ObjTable && + table_cmb->currentData().toUInt() == ObjectType::ObjTable && !col_names.isEmpty()); browse_tabs_tb->setEnabled((!fk_infos.empty() || !ref_fk_infos.empty()) && sel_ranges.count() == 1 && sel_ranges.at(0).rowCount() == 1); bulkedit_tb->setEnabled(sel_ranges.count() != 0); @@ -726,7 +726,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin table_oid = 0; - if(obj_type==ObjView) + if(obj_type==ObjectType::ObjView) { warning_frm->setVisible(true); warning_lbl->setText(trUtf8("Views can't have their data handled through this grid, this way, all operations are disabled.")); @@ -735,7 +735,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin { catalog.setConnection(conn); //Retrieving the constraints from catalog using a custom filter to select only primary keys (contype=p) - pks=catalog.getObjectsAttributes(ObjConstraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='p'")}}); + pks=catalog.getObjectsAttributes(ObjectType::ObjConstraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='p'")}}); warning_frm->setVisible(pks.empty()); @@ -745,8 +745,8 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin table_oid = pks[0][ParsersAttributes::TABLE].toUInt(); } - hint_frm->setVisible(obj_type==ObjTable); - add_tb->setEnabled(obj_type==ObjTable && !col_names.empty()); + hint_frm->setVisible(obj_type==ObjectType::ObjTable); + add_tb->setEnabled(obj_type==ObjectType::ObjTable && !col_names.empty()); pk_col_names.clear(); if(!pks.empty()) @@ -757,7 +757,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin for(QString id : col_str_ids) col_ids.push_back(id.toUInt()); - columns=catalog.getObjectsAttributes(ObjColumn, schema, table, col_ids); + columns=catalog.getObjectsAttributes(ObjectType::ObjColumn, schema, table, col_ids); for(auto &col : columns) pk_col_names.push_back(col[ParsersAttributes::NAME]); @@ -766,7 +766,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin catalog.closeConnection(); //For tables, even if there is no pk the user can manipulate data - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) results_tbw->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::AnyKeyPressed); else results_tbw->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -794,14 +794,14 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin ref_fk_infos.clear(); fk_infos.clear(); - if(obj_type==ObjView) + if(obj_type==ObjectType::ObjView) return; catalog.setConnection(conn); //Retrieving the constraints from catalog using a custom filter to select only foreign keys (contype=f) - fks=catalog.getObjectsAttributes(ObjConstraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f'")}}); - ref_fks=catalog.getObjectsAttributes(ObjConstraint, QString(), QString(), {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(table_oid)}}); + fks=catalog.getObjectsAttributes(ObjectType::ObjConstraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f'")}}); + ref_fks=catalog.getObjectsAttributes(ObjectType::ObjConstraint, QString(), QString(), {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(table_oid)}}); if(!fks.empty() || !ref_fks.empty()) { @@ -819,8 +819,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &fk : fks) { - aux_table = catalog.getObjectAttributes(ObjTable, fk[ParsersAttributes::REF_TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(ObjSchema, aux_table[ParsersAttributes::SCHEMA].toUInt()); + aux_table = catalog.getObjectAttributes(ObjectType::ObjTable, fk[ParsersAttributes::REF_TABLE].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjectType::ObjSchema, aux_table[ParsersAttributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[ParsersAttributes::NAME]) .arg(aux_table[ParsersAttributes::NAME]) @@ -842,7 +842,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjColumn, schema, table, col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjectType::ObjColumn, schema, table, col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); @@ -854,7 +854,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::DST_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjectType::ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); fk_infos[fk_name][ParsersAttributes::DST_COLUMNS] = name_list.join(Table::DataSeparator); @@ -871,8 +871,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin col_ids.clear(); name_list.clear(); - aux_table = catalog.getObjectAttributes(ObjTable, fk[ParsersAttributes::TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(ObjSchema, aux_table[ParsersAttributes::SCHEMA].toUInt()); + aux_table = catalog.getObjectAttributes(ObjectType::ObjTable, fk[ParsersAttributes::TABLE].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjectType::ObjSchema, aux_table[ParsersAttributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[ParsersAttributes::NAME]) .arg(aux_table[ParsersAttributes::NAME]) @@ -882,7 +882,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjectType::ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index b405d38004..bdf5624c03 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -19,7 +19,7 @@ #include "domainwidget.h" #include "numberedtexteditor.h" -DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjDomain) +DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjDomain) { try { @@ -52,7 +52,7 @@ DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjDomain) connect(constr_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(handleConstraint(int))); connect(constr_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editConstraint(int))); - configureFormLayout(domain_grid, ObjDomain); + configureFormLayout(domain_grid, ObjectType::ObjDomain); setRequiredField(data_type); configureTabOrder({ def_value_edt, not_null_chk, data_type, constr_name_edt, check_expr_txt }); diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index d8dfe85003..87bd69a98d 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -32,9 +32,9 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) elem_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); parent_obj=nullptr; - op_class_sel=new ObjectSelectorWidget(ObjOpClass, true, this); - collation_sel=new ObjectSelectorWidget(ObjCollation, true, this); - operator_sel=new ObjectSelectorWidget(ObjOperator, true, this); + op_class_sel=new ObjectSelectorWidget(ObjectType::ObjOpClass, true, this); + collation_sel=new ObjectSelectorWidget(ObjectType::ObjCollation, true, this); + operator_sel=new ObjectSelectorWidget(ObjectType::ObjOperator, true, this); element_grid->addWidget(collation_sel, 3,1,1,2); element_grid->addWidget(op_class_sel, 4,1,1,2); @@ -102,7 +102,7 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, else setPartitionKey(part_key); - if(parent_obj->getObjectType() == ObjTable && + if(parent_obj->getObjectType() == ObjectType::ObjTable && (column || (!column && elem->getExpression().isEmpty()))) { column_rb->setChecked(true); @@ -136,9 +136,9 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) this->setEnabled(false); throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(parent_obj->getObjectType()!=ObjTable && - parent_obj->getObjectType()!=ObjView && - parent_obj->getObjectType()!=ObjRelationship) + else if(parent_obj->getObjectType()!=ObjectType::ObjTable && + parent_obj->getObjectType()!=ObjectType::ObjView && + parent_obj->getObjectType()!=ObjectType::ObjRelationship) throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setEnabled(true); @@ -148,11 +148,11 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) collation_sel->setModel(model); operator_sel->setModel(model); - cols_combo_parent->setVisible(parent_obj->getObjectType() == ObjTable); - column_rb->setVisible(parent_obj->getObjectType() == ObjTable); - expression_rb->setChecked(parent_obj->getObjectType() == ObjView); + cols_combo_parent->setVisible(parent_obj->getObjectType() == ObjectType::ObjTable); + column_rb->setVisible(parent_obj->getObjectType() == ObjectType::ObjTable); + expression_rb->setChecked(parent_obj->getObjectType() == ObjectType::ObjView); - if(parent_obj->getObjectType() == ObjTable) + if(parent_obj->getObjectType() == ObjectType::ObjTable) updateColumnsCombo(); } diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 51cb8d4365..1390e0e22b 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -18,7 +18,7 @@ #include "eventtriggerwidget.h" -EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjEventTrigger) +EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjEventTrigger) { map > fields_map; map > values_map; @@ -26,7 +26,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent Ui_EventTriggerWidget::setupUi(this); - function_sel=new ObjectSelectorWidget(ObjFunction, true, this); + function_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); filter_tab=new ObjectsTableWidget(ObjectsTableWidget::AddButton | ObjectsTableWidget::EditButton | ObjectsTableWidget::UpdateButton | @@ -39,7 +39,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent eventtrigger_grid->addWidget(function_sel, 1, 1); filter_layout->addWidget(filter_tab); - configureFormLayout(eventtrigger_grid, ObjEventTrigger); + configureFormLayout(eventtrigger_grid, ObjectType::ObjEventTrigger); setRequiredField(function_lbl); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(event_lbl); diff --git a/libpgmodeler_ui/src/extensionwidget.cpp b/libpgmodeler_ui/src/extensionwidget.cpp index f35f3a823f..38b074992f 100644 --- a/libpgmodeler_ui/src/extensionwidget.cpp +++ b/libpgmodeler_ui/src/extensionwidget.cpp @@ -1,9 +1,9 @@ #include "extensionwidget.h" -ExtensionWidget::ExtensionWidget(QWidget * parent) : BaseObjectWidget(parent, ObjExtension) +ExtensionWidget::ExtensionWidget(QWidget * parent) : BaseObjectWidget(parent, ObjectType::ObjExtension) { Ui_ExtensionWidget::setupUi(this); - configureFormLayout(extension_grid, ObjExtension); + configureFormLayout(extension_grid, ObjectType::ObjExtension); extension_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), extension_grid->count()+1, 0, 1, 0); configureTabOrder({ cur_ver_edt, old_ver_edt, handles_type_chk }); diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index e7b5eedb63..555f237e26 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -19,7 +19,7 @@ #include "functionwidget.h" #include "baseform.h" -FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjFunction) +FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjFunction) { try { @@ -34,7 +34,7 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjFun Ui_FunctionWidget::setupUi(this); - configureFormLayout(function_grid, ObjFunction); + configureFormLayout(function_grid, ObjectType::ObjFunction); source_code_txt=new NumberedTextEditor(this, true); dynamic_cast(source_code_frm->layout())->addWidget(source_code_txt, 1, 0, 1, 2); @@ -268,7 +268,7 @@ void FunctionWidget::setAttributes(DatabaseModel *model, OperationList *op_list, PgSQLType aux_type; BaseObjectWidget::setAttributes(model, op_list, func, schema); - languages=model->getObjects(ObjLanguage); + languages=model->getObjects(ObjectType::ObjLanguage); while(!languages.empty()) { @@ -420,19 +420,19 @@ void FunctionWidget::validateConfiguredFunction(void) If the function is invalid the instances raises exceptions accusing the error that is enough to check the validity of the function in relation to objects that reference it. */ - if(obj_type==ObjConversion) + if(obj_type==ObjectType::ObjConversion) { conv=dynamic_cast(object); if(conv->getConversionFunction()==func) conv->setConversionFunction(func); } - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) { cast=dynamic_cast(object); if(cast->getCastFunction()==func) cast->setCastFunction(func); } - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) { aggr=dynamic_cast(object); if(aggr->getFunction(Aggregate::FinalFunc)==func) @@ -440,11 +440,11 @@ void FunctionWidget::validateConfiguredFunction(void) else if(aggr->getFunction(Aggregate::TransitionFunc)==func) aggr->setFunction(Aggregate::TransitionFunc, func); } - else if(obj_type==ObjTrigger) + else if(obj_type==ObjectType::ObjTrigger) { dynamic_cast(object)->setFunction(func); } - else if(obj_type==ObjLanguage) + else if(obj_type==ObjectType::ObjLanguage) { lang=dynamic_cast(object); @@ -454,7 +454,7 @@ void FunctionWidget::validateConfiguredFunction(void) lang->setFunction(func, i1); } } - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) { oper=dynamic_cast(object); for(i1=Operator::FUNC_OPERATOR; i1 <= Operator::FUNC_RESTRICT; i1++) @@ -463,7 +463,7 @@ void FunctionWidget::validateConfiguredFunction(void) oper->setFunction(func, i1); } } - else if(obj_type==ObjType) + else if(obj_type==ObjectType::ObjType) { type=dynamic_cast(object); if(type->getConfiguration()==Type::BaseType) @@ -475,7 +475,7 @@ void FunctionWidget::validateConfiguredFunction(void) } } } - else if(obj_type==ObjEventTrigger) + else if(obj_type==ObjectType::ObjEventTrigger) { dynamic_cast(object)->setFunction(func); } @@ -504,7 +504,7 @@ void FunctionWidget::applyConfiguration(void) startConfiguration(); func=dynamic_cast(this->object); - func->setLanguage(model->getObject(language_cmb->currentText(), ObjLanguage)); + func->setLanguage(model->getObject(language_cmb->currentText(), ObjectType::ObjLanguage)); func->setFunctionType(func_type_cmb->currentText()); func->setWindowFunction(window_func_chk->isChecked()); func->setLeakProof(leakproof_chk->isChecked()); diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 78396f0319..6000836f80 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -18,10 +18,10 @@ #include "genericsqlwidget.h" -GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, ObjGenericSQL) +GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjGenericSQL) { Ui_GenericSQLWidget::setupUi(this); - configureFormLayout(genericsql_grid, ObjGenericSQL); + configureFormLayout(genericsql_grid, ObjectType::ObjGenericSQL); definition_txt = PgModelerUiNs::createNumberedTextEditor(sqlcode_grp, true); definition_hl = new SyntaxHighlighter(definition_txt); diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index 3b93f132af..f56f736074 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -18,7 +18,7 @@ #include "indexwidget.h" -IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjIndex) +IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjIndex) { try { @@ -40,7 +40,7 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjIndex) grid->addWidget(elements_tab,0,0); tabWidget->widget(1)->setLayout(grid); - configureFormLayout(index_grid, ObjIndex); + configureFormLayout(index_grid, ObjectType::ObjIndex); IndexingType::getTypes(list); indexing_cmb->addItems(list); diff --git a/libpgmodeler_ui/src/languagewidget.cpp b/libpgmodeler_ui/src/languagewidget.cpp index 22cfb7d515..10e199d2e3 100644 --- a/libpgmodeler_ui/src/languagewidget.cpp +++ b/libpgmodeler_ui/src/languagewidget.cpp @@ -18,7 +18,7 @@ #include "languagewidget.h" -LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, ObjLanguage) +LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjLanguage) { try { @@ -29,15 +29,15 @@ LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, ObjLan func_validator_sel=nullptr; func_inline_sel=nullptr; - func_handler_sel=new ObjectSelectorWidget(ObjFunction, true, this); - func_validator_sel=new ObjectSelectorWidget(ObjFunction, true, this); - func_inline_sel=new ObjectSelectorWidget(ObjFunction, true, this); + func_handler_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + func_validator_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + func_inline_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); language_grid->addWidget(func_handler_sel,1,1,1,2); language_grid->addWidget(func_validator_sel,2,1,1,2); language_grid->addWidget(func_inline_sel,3,1,1,2); - configureFormLayout(language_grid, ObjLanguage); + configureFormLayout(language_grid, ObjectType::ObjLanguage); frame=generateInformationFrame(trUtf8("The functions to be assigned to the language should have, respectively, the following signatures:

Handler Function: language_handler function()
Validator Function: void function(oid)
Inline Function: void function(internal)")); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 7aa952c7e9..2cee143976 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -898,7 +898,7 @@ void MainWindow::addModel(const QString &filename) models_tbw->setTabToolTip(models_tbw->currentIndex(), filename); //Get the "public" schema and set as system object - public_sch=dynamic_cast(model_tab->db_model->getObject(QString("public"), ObjSchema)); + public_sch=dynamic_cast(model_tab->db_model->getObject(QString("public"), ObjectType::ObjSchema)); if(public_sch) public_sch->setSystemObject(true); model_tab->db_model->setInvalidated(false); @@ -1158,7 +1158,7 @@ void MainWindow::setGridOptions(void) current_model->scene->alignObjectsToGrid(); //Forcing the relationship updating to fit the new position of the tables - current_model->getDatabaseModel()->setObjectsModified({ ObjRelationship, ObjBaseRelationship }); + current_model->getDatabaseModel()->setObjectsModified({ ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); } //Redraw the scene to apply the new grid options @@ -2042,7 +2042,7 @@ void MainWindow::toggleCompactView(void) { model_wgt = dynamic_cast(models_tbw->widget(idx)); model_wgt->toggleAllExtendedAttributes(action_compact_view->isChecked()); - model_wgt->getDatabaseModel()->setObjectsModified({ ObjTable, ObjView, ObjRelationship, ObjBaseRelationship, ObjSchema}); + model_wgt->getDatabaseModel()->setObjectsModified({ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjSchema}); } QApplication::restoreOverrideCursor(); diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 6d99f17ecc..898abd499b 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -307,7 +307,7 @@ void MetadataHandlingForm::updateProgress(int progress, QString msg, unsigned in QString fmt_msg=PgModelerUiNs::formatMessage(msg); QPixmap icon; - if(obj_type==ObjBaseObject) + if(obj_type==ObjectType::ObjBaseObject) { if(progress==100) icon=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index d8dfe04d0c..af24622929 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -466,7 +466,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); - obj_oids[ObjDatabase].push_back(db_cmb->currentData().value()); + obj_oids[ObjectType::ObjDatabase].push_back(db_cmb->currentData().value()); if(thread_id == SrcImportThread) { @@ -807,7 +807,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType } else if(diff_thread && diff_thread->isRunning()) { - if((progress == 0 || progress == 100) && obj_type==ObjBaseObject) + if((progress == 0 || progress == 100) && obj_type==ObjectType::ObjBaseObject) { PgModelerUiNs::createOutputTreeItem(output_trw, msg, QPixmap(PgModelerUiNs::getIconPath("msgbox_info")), @@ -823,7 +823,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_aux = diff_progress + (progress/3); - if(obj_type==ObjBaseObject) + if(obj_type==ObjectType::ObjBaseObject) ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); else ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); @@ -840,7 +840,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_lbl->setText(msg); progress_pb->setValue(progress); - if(obj_type!=ObjBaseObject) + if(obj_type!=ObjectType::ObjBaseObject) progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(obj_type))); else progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index b84730a3a1..8b0ab73ded 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -141,7 +141,7 @@ void ModelExportForm::updateProgress(int progress, QString msg, ObjectType obj_t progress_lbl->setText(text); progress_pb->setValue(progress); - if(obj_type!=ObjBaseObject) + if(obj_type!=ObjectType::ObjBaseObject) ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else if(!cmd.isEmpty()) ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index c277b63b88..11d4f12fc2 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -11,7 +11,7 @@ void ModelExportHelper::resetExportParams(void) sql_gen_progress=progress=0; db_created=ignore_dup=drop_db=drop_objs=export_canceled=false; simulate=use_tmp_names=db_sql_reenabled=false; - created_objs[ObjRole]=created_objs[ObjTablespace]=-1; + created_objs[ObjectType::ObjRole]=created_objs[ObjectType::ObjTablespace]=-1; db_model=nullptr; connection=nullptr; scene=nullptr; @@ -72,11 +72,11 @@ void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &file BaseObject::setPgSQLVersion(pgsql_ver); emit s_progressUpdated(progress, trUtf8("Generating SQL code for PostgreSQL `%1'").arg(BaseObject::getPgSQLVersion()), - ObjBaseObject); + ObjectType::ObjBaseObject); progress=1; db_model->saveModel(filename, SchemaParser::SqlDefinition); - emit s_progressUpdated(100, trUtf8("Output SQL file `%1' successfully written.").arg(filename), ObjBaseObject); + emit s_progressUpdated(100, trUtf8("Output SQL file `%1' successfully written.").arg(filename), ObjectType::ObjBaseObject); emit s_exportFinished(); } catch(Exception &e) @@ -198,7 +198,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename painter.setRenderHint(QPainter::SmoothPixmapTransform, true); emit s_progressUpdated((page_idx/static_cast(pages.size())) * 90, - trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), ObjBaseObject); + trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), ObjectType::ObjBaseObject); //Render the entire viewport onto the pixmap view->render(&painter, QRectF(QPointF(0,0), pix.size()), retv); @@ -225,7 +225,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename if(!export_canceled) { - emit s_progressUpdated(100, trUtf8("Output image `%1' successfully written.").arg(filename), ObjBaseObject); + emit s_progressUpdated(100, trUtf8("Output image `%1' successfully written.").arg(filename), ObjectType::ObjBaseObject); emit s_exportFinished(); } else @@ -304,7 +304,7 @@ void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename svg_file.close(); } - emit s_progressUpdated(100, trUtf8("Output file `%1' successfully written.").arg(filename), ObjBaseObject); + emit s_progressUpdated(100, trUtf8("Output file `%1' successfully written.").arg(filename), ObjectType::ObjBaseObject); emit s_exportFinished(); } @@ -314,7 +314,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c QString version, sql_cmd, buf, sql_cmd_comment; Connection new_db_conn; unsigned i, count; - ObjectType types[]={ObjRole, ObjTablespace}; + ObjectType types[]={ObjectType::ObjRole, ObjectType::ObjTablespace}; BaseObject *object=nullptr; QString tmpl_comm_regexp = QString("(COMMENT)( )+(ON)( )+(%1)(.)+(\n)(") + ParsersAttributes::DDL_END_TOKEN + QString(")"); QRegExp comm_regexp; @@ -337,7 +337,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c export_canceled=false; db_created=false; progress=sql_gen_progress=0; - created_objs[ObjRole]=created_objs[ObjTablespace]=-1; + created_objs[ObjectType::ObjRole]=created_objs[ObjectType::ObjTablespace]=-1; errors.clear(); //Retrive the DBMS version in order to generate the correct code @@ -429,7 +429,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c sql_cmd=object->getCodeDefinition(SchemaParser::SqlDefinition); - if(types[type_id] == ObjTablespace) + if(types[type_id] == ObjectType::ObjTablespace) { comm_regexp = QRegExp(tmpl_comm_regexp.arg(object->getSQLName())); pos = comm_regexp.indexIn(sql_cmd); @@ -469,7 +469,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c emit s_progressUpdated(progress, trUtf8("Creating database `%1'") .arg(db_model->getName()), - ObjDatabase); + ObjectType::ObjDatabase); sql_cmd=db_model->__getCodeDefinition(SchemaParser::SqlDefinition); pos = comm_regexp.indexIn(sql_cmd); @@ -582,12 +582,12 @@ void ModelExportHelper::saveGenAtlerCmdsStatus(DatabaseModel *db_model) Table *tab=nullptr; Relationship *rel=nullptr; - objects.insert(objects.end(), db_model->getObjectList(ObjTable)->begin(), - db_model->getObjectList(ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjTable)->begin(), + db_model->getObjectList(ObjectType::ObjTable)->end()); //Store the relationship on the auxiliary vector but only many-to-many are considered - objects.insert(objects.end(), db_model->getObjectList(ObjRelationship)->begin(), - db_model->getObjectList(ObjRelationship)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjRelationship)->begin(), + db_model->getObjectList(ObjectType::ObjRelationship)->end()); alter_cmds_status.clear(); @@ -630,12 +630,12 @@ void ModelExportHelper::restoreGenAtlerCmdsStatus(void) void ModelExportHelper::undoDBMSExport(DatabaseModel *db_model, Connection &conn, bool use_tmp_names) { QString drop_cmd=QString("DROP %1 %2;"); - ObjectType types[]={ObjRole, ObjTablespace}; + ObjectType types[]={ObjectType::ObjRole, ObjectType::ObjTablespace}; int type_id; BaseObject *object=nullptr; //In case of error during the export all created object are removed - if(db_created || created_objs[ObjRole] >= 0 || created_objs[ObjTablespace] >= 0) + if(db_created || created_objs[ObjectType::ObjRole] >= 0 || created_objs[ObjectType::ObjTablespace] >= 0) { emit s_progressUpdated(99, trUtf8("Destroying objects created on the server.")); @@ -681,20 +681,20 @@ void ModelExportHelper::generateTempObjectNames(DatabaseModel *db_model) QTextStream stream(&tmp_name); QDateTime dt=QDateTime::currentDateTime(); QCryptographicHash hash(QCryptographicHash::Md5); - map obj_suffixes={ { ObjDatabase, QString("db_") }, - { ObjRole, QString("rl_")}, - { ObjTablespace, QString("tb_")} }; + map obj_suffixes={ { ObjectType::ObjDatabase, QString("db_") }, + { ObjectType::ObjRole, QString("rl_")}, + { ObjectType::ObjTablespace, QString("tb_")} }; orig_obj_names.clear(); orig_obj_names[db_model]=db_model->getName(); - for(auto &role : *db_model->getObjectList(ObjRole)) + for(auto &role : *db_model->getObjectList(ObjectType::ObjRole)) { if(!role->isSystemObject()) orig_obj_names[role]=role->getName(); } - for(auto &tabspc : *db_model->getObjectList(ObjTablespace)) + for(auto &tabspc : *db_model->getObjectList(ObjectType::ObjTablespace)) { if(!tabspc->isSystemObject()) orig_obj_names[tabspc]=tabspc->getName(); @@ -763,7 +763,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co alter_tab=QString("ALTER TABLE"); vector db_sql_cmds; QTextStream ts; - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; bool ddl_tk_found=false, is_create=false, is_drop=false; unsigned aux_prog=0, curr_size=0, buf_size=sql_buf.size(), factor=(db_name.isEmpty() ? 70 : 90); @@ -776,13 +776,13 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co drop_tab_obj_reg(QString("^((\\-\\-)+( )*)+(%1)(.)+(DROP)(.)+").arg(alter_tab)), reg_aux; - vector obj_types={ ObjRole, ObjFunction, ObjTrigger, ObjIndex, ObjPolicy, - ObjRule, ObjTable, ObjView, ObjDomain, - ObjSchema, ObjAggregate, ObjOpFamily, - ObjOpClass, ObjOperator, ObjSequence, - ObjConversion, ObjCast, ObjLanguage, - ObjCollation, ObjExtension, ObjType, - ObjEventTrigger, ObjDatabase }; + vector obj_types={ ObjectType::ObjRole, ObjectType::ObjFunction, ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjPolicy, + ObjectType::ObjRule, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjDomain, + ObjectType::ObjSchema, ObjectType::ObjAggregate, ObjectType::ObjOpFamily, + ObjectType::ObjOpClass, ObjectType::ObjOperator, ObjectType::ObjSequence, + ObjectType::ObjConversion, ObjectType::ObjCast, ObjectType::ObjLanguage, + ObjectType::ObjCollation, ObjectType::ObjExtension, ObjectType::ObjType, + ObjectType::ObjEventTrigger, ObjectType::ObjDatabase }; /* Extract each SQL command from the buffer and execute them separately. This is done @@ -845,7 +845,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co { aux_cmd.remove('"'); aux_cmd.remove(QString("IF EXISTS ")); - obj_type=(aux_cmd.contains(QString("COLUMN")) ? ObjColumn : ObjConstraint); + obj_type=(aux_cmd.contains(QString("COLUMN")) ? ObjectType::ObjColumn : ObjectType::ObjConstraint); reg_aux=QRegExp(QString("(COLUMN|CONSTRAINT)( )+")); //Extracting the table name @@ -893,21 +893,21 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co //Appeding special tokens when the object is an index or view if(lin.startsWith(QString("CREATE")) || lin.startsWith(QString("ALTER"))) { - if(obj_tp==ObjIndex) + if(obj_tp==ObjectType::ObjIndex) { lin.remove(QString("UNIQUE")); lin.remove(QString("CONCURRENTLY")); } - else if(obj_tp==ObjView) + else if(obj_tp==ObjectType::ObjView) { lin.remove(QString("MATERIALIZED")); lin.remove(QString("RECURSIVE")); } - else if(obj_tp==ObjTable) + else if(obj_tp==ObjectType::ObjTable) { lin.remove(QString("UNLOGGED")); } - else if(obj_tp==ObjFunction) + else if(obj_tp==ObjectType::ObjFunction) { lin.remove(QString("OR REPLACE")); } @@ -933,12 +933,12 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co lin=lin.mid(reg_aux.matchedLength(), sql_cmd.indexOf('\n')).simplified(); lin.remove('"'); - if(obj_tp!=ObjCast) + if(obj_tp!=ObjectType::ObjCast) { int spc_idx=lin.indexOf(' '); obj_name=lin.mid(0, (spc_idx >= 0 ? spc_idx + 1 : lin.size())); - if(obj_tp!=ObjFunction) + if(obj_tp!=ObjectType::ObjFunction) { obj_name=obj_name.remove('(').simplified(); obj_name=obj_name.remove(')').simplified(); @@ -971,13 +971,13 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co else if(!sql_cmd.trimmed().isEmpty()) { //General commands like grant, revoke or set aren't explicitly shown - emit s_progressUpdated(aux_prog, trUtf8("Running auxiliary command."), ObjBaseObject, sql_cmd); + emit s_progressUpdated(aux_prog, trUtf8("Running auxiliary command."), ObjectType::ObjBaseObject, sql_cmd); } //Executes the extracted SQL command if(!sql_cmd.isEmpty()) { - if(obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjDatabase) conn.executeDDLCommand(sql_cmd); else db_sql_cmds.push_back(sql_cmd); diff --git a/libpgmodeler_ui/src/modelexporthelper.h b/libpgmodeler_ui/src/modelexporthelper.h index 550049aff1..2dc5a6e86c 100644 --- a/libpgmodeler_ui/src/modelexporthelper.h +++ b/libpgmodeler_ui/src/modelexporthelper.h @@ -189,7 +189,7 @@ class ModelExportHelper: public QObject { signals: //! \brief This singal is emitted whenever the export progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjBaseObject, QString cmd=QString(), bool is_code_gen=false); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::ObjBaseObject, QString cmd=QString(), bool is_code_gen=false); //! \brief This signal is emited when the export has finished void s_exportFinished(void); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index b04a4b8bf0..ced5960cc7 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -120,8 +120,8 @@ void ModelObjectsWidget::editObject(void) { //If the user double-clicked the item "Permission (n)" on tree view if(sender()==objectstree_tw && objectstree_tw->currentItem() && - objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt()==ObjPermission) - model_wgt->showObjectForm(ObjPermission, reinterpret_cast(objectstree_tw->currentItem()->data(0, Qt::UserRole).value())); + objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt()==ObjectType::ObjPermission) + model_wgt->showObjectForm(ObjectType::ObjPermission, reinterpret_cast(objectstree_tw->currentItem()->data(0, Qt::UserRole).value())); //If the user double-clicked a permission on list view else if(sender()==objectslist_tbw && objectslist_tbw->currentRow() >= 0) { @@ -129,7 +129,7 @@ void ModelObjectsWidget::editObject(void) Permission *perm=dynamic_cast(obj); if(perm) - model_wgt->showObjectForm(ObjPermission,perm->getObject()); + model_wgt->showObjectForm(ObjectType::ObjPermission,perm->getObject()); else model_wgt->editObject(); } @@ -140,7 +140,7 @@ void ModelObjectsWidget::editObject(void) void ModelObjectsWidget::selectObject(void) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; ModelWidget *model_wgt=nullptr; if(!simplified_view && this->model_wgt) @@ -161,15 +161,15 @@ void ModelObjectsWidget::selectObject(void) //If user select a group item popups a "New [OBJECT]" menu if((!simplified_view || (simplified_view && enable_obj_creation)) && !selected_object && QApplication::mouseButtons()==Qt::RightButton && - obj_type!=ObjColumn && obj_type!=ObjConstraint && obj_type!=ObjRule && - obj_type!=ObjIndex && obj_type!=ObjTrigger && obj_type!=ObjPermission) + obj_type!=ObjectType::ObjColumn && obj_type!=ObjectType::ObjConstraint && obj_type!=ObjectType::ObjRule && + obj_type!=ObjectType::ObjIndex && obj_type!=ObjectType::ObjTrigger && obj_type!=ObjectType::ObjPermission) { QAction act(QPixmap(PgModelerUiNs::getIconPath(obj_type)), trUtf8("New") + QString(" ") + BaseObject::getTypeName(obj_type), nullptr); QMenu popup; //If not a relationship, connect the action to the addNewObject method of the model wiget - if(obj_type!=ObjRelationship) + if(obj_type!=ObjectType::ObjRelationship) { act.setData(QVariant(obj_type)); connect(&act, SIGNAL(triggered()), model_wgt, SLOT(addNewObject())); @@ -198,7 +198,7 @@ void ModelObjectsWidget::selectObject(void) } } - if(obj_type!=ObjPermission && selected_object && !simplified_view) + if(obj_type!=ObjectType::ObjPermission && selected_object && !simplified_view) { model_wgt->scene->clearSelection(); model_wgt->configureObjectMenu(selected_object); @@ -229,7 +229,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr tab_obj=dynamic_cast(object); item=new QTreeWidgetItem(root); - if(obj_type==ObjFunction) + if(obj_type==ObjectType::ObjFunction) { Function *func=dynamic_cast(object); func->createSignature(false); @@ -237,13 +237,13 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr obj_name=func->getSignature(); func->createSignature(true); } - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) { Operator *oper=dynamic_cast(object); item->setText(0, oper->getSignature(false)); obj_name=oper->getSignature(false); } - else if(obj_type==ObjOpClass || obj_type == ObjOpFamily) + else if(obj_type==ObjectType::ObjOpClass || obj_type == ObjectType::ObjOpFamily) { obj_name=object->getSignature(false); obj_name.replace(QRegExp("( )+(USING)( )+"), QString(" [")); @@ -279,11 +279,11 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr item->setFont(0,font); - if(obj_type==ObjBaseRelationship || obj_type==ObjRelationship) + if(obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjRelationship) { rel_type=dynamic_cast(object)->getRelationshipType(); - if(obj_type==ObjBaseRelationship) + if(obj_type==ObjectType::ObjBaseRelationship) { if(rel_type==BaseRelationship::RelationshipFk) str_aux=QString("fk"); @@ -301,7 +301,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr else if(rel_type==BaseRelationship::RelationshipGen) str_aux=QString("gen"); } - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) { constr_type=dynamic_cast(object)->getConstraintType(); @@ -324,19 +324,19 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr void ModelObjectsWidget::setObjectVisible(ObjectType obj_type, bool visible) { - if(obj_type!=ObjBaseObject && obj_type!=ObjBaseTable) + if(obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjBaseTable) visible_objs_map[obj_type]=visible; if(visible && simplified_view) { - if(obj_type!=ObjDatabase) - visible_objs_map[ObjDatabase]=true; + if(obj_type!=ObjectType::ObjDatabase) + visible_objs_map[ObjectType::ObjDatabase]=true; if(TableObject::isTableObject(obj_type)) - visible_objs_map[ObjTable]=visible_objs_map[ObjSchema]=true; + visible_objs_map[ObjectType::ObjTable]=visible_objs_map[ObjectType::ObjSchema]=true; if(BaseObject::acceptsSchema(obj_type)) - visible_objs_map[ObjSchema]=true; + visible_objs_map[ObjectType::ObjSchema]=true; } } @@ -461,28 +461,28 @@ void ModelObjectsWidget::updateObjectsList(void) void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) { - if(db_model && visible_objs_map[ObjSchema]) + if(db_model && visible_objs_map[ObjectType::ObjSchema]) { BaseObject *schema=nullptr; vector obj_list; QFont font; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr, *item3=nullptr; - vector types = BaseObject::getChildObjectTypes(ObjSchema); + vector types = BaseObject::getChildObjectTypes(ObjectType::ObjSchema); int count, count2, i; - QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjSchema)) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::ObjSchema)) + QString("_grp"))); - //Removing the ObjTable and ObjView types since they are handled separetedly - types.erase(std::find(types.begin(), types.end(), ObjTable)); - types.erase(std::find(types.begin(), types.end(), ObjView)); + //Removing the ObjectType::ObjTable and ObjectType::ObjView types since they are handled separetedly + types.erase(std::find(types.begin(), types.end(), ObjectType::ObjTable)); + types.erase(std::find(types.begin(), types.end(), ObjectType::ObjView)); //Get the current schema count on database - count=(db_model->getObjectCount(ObjSchema)); + count=(db_model->getObjectCount(ObjectType::ObjSchema)); item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setData(1, Qt::UserRole, QVariant::fromValue(ObjSchema)); + item->setData(1, Qt::UserRole, QVariant::fromValue(ObjectType::ObjSchema)); //Create the schema group item - item->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(ObjSchema)).arg(count)); + item->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(ObjectType::ObjSchema)).arg(count)); font=item->font(0); font.setItalic(true); item->setFont(0, font); @@ -500,7 +500,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) } else { - schema=db_model->getObject(i, ObjSchema); + schema=db_model->getObject(i, ObjectType::ObjSchema); item2=createItemForObject(schema, item); } @@ -544,26 +544,26 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *schema) { - if(db_model && visible_objs_map[ObjTable]) + if(db_model && visible_objs_map[ObjectType::ObjTable]) { vector obj_list; Table *table=nullptr; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr; QFont font; - vector types = BaseObject::getChildObjectTypes(ObjTable); - QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjTable) + QString("_grp"))); + vector types = BaseObject::getChildObjectTypes(ObjectType::ObjTable); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::ObjTable) + QString("_grp"))); try { //Get all tables that belongs to the specified schema - obj_list=db_model->getObjects(ObjTable, schema); + obj_list=db_model->getObjects(ObjectType::ObjTable, schema); //Create a table group item item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setText(0,BaseObject::getTypeName(ObjTable) + + item->setText(0,BaseObject::getTypeName(ObjectType::ObjTable) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant::fromValue(ObjTable)); + item->setData(1, Qt::UserRole, QVariant::fromValue(ObjectType::ObjTable)); font=item->font(0); font.setItalic(true); @@ -602,28 +602,28 @@ void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *sche void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schema) { - if(db_model && visible_objs_map[ObjView]) + if(db_model && visible_objs_map[ObjectType::ObjView]) { BaseObject *object=nullptr; vector obj_list; View *view=nullptr; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr; QFont font; - ObjectType types[]={ ObjRule, ObjTrigger, ObjIndex }; + ObjectType types[]={ ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex }; int count, count1, type_cnt=sizeof(types)/sizeof(ObjectType), i, i1, i2; - QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjView)) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::ObjView)) + QString("_grp"))); try { //Get all views that belongs to the specified schema - obj_list=db_model->getObjects(ObjView, schema); + obj_list=db_model->getObjects(ObjectType::ObjView, schema); //Create a table group item item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setText(0,BaseObject::getTypeName(ObjView) + + item->setText(0,BaseObject::getTypeName(ObjectType::ObjView) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant::fromValue(ObjView)); + item->setData(1, Qt::UserRole, QVariant::fromValue(ObjectType::ObjView)); font=item->font(0); font.setItalic(true); @@ -670,7 +670,7 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject { try { - if(db_model && visible_objs_map[ObjPermission] && + if(db_model && visible_objs_map[ObjectType::ObjPermission] && Permission::acceptsPermission(object->getObjectType())) { vector perms; @@ -683,11 +683,11 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject font.setItalic(true); item->setFont(0, font); item->setText(0, QString("%1 (%2)") - .arg(BaseObject::getTypeName(ObjPermission)) + .arg(BaseObject::getTypeName(ObjectType::ObjPermission)) .arg(perms.size())); item->setData(0, Qt::UserRole, generateItemValue(object)); - item->setData(1, Qt::UserRole, static_cast(ObjPermission)); + item->setData(1, Qt::UserRole, static_cast(ObjectType::ObjPermission)); } } catch(Exception &e) @@ -707,10 +707,10 @@ void ModelObjectsWidget::updateDatabaseTree(void) QTreeWidgetItem *root=nullptr,*item1=nullptr, *item2=nullptr; QFont font; vector ref_list, tree_state, obj_list; - ObjectType types[]={ ObjRole, ObjTablespace, - ObjLanguage, ObjCast, ObjTextbox, - ObjRelationship, ObjEventTrigger, - ObjTag, ObjGenericSQL, ObjExtension }; + ObjectType types[]={ ObjectType::ObjRole, ObjectType::ObjTablespace, + ObjectType::ObjLanguage, ObjectType::ObjCast, ObjectType::ObjTextbox, + ObjectType::ObjRelationship, ObjectType::ObjEventTrigger, + ObjectType::ObjTag, ObjectType::ObjGenericSQL, ObjectType::ObjExtension }; unsigned count, i, i1, type_cnt=sizeof(types)/sizeof(ObjectType); try @@ -721,7 +721,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) objectstree_tw->setUpdatesEnabled(false); objectstree_tw->clear(); - if(visible_objs_map[ObjDatabase]) + if(visible_objs_map[ObjectType::ObjDatabase]) { root=createItemForObject(db_model); objectstree_tw->insertTopLevelItem(0,root); @@ -741,10 +741,10 @@ void ModelObjectsWidget::updateDatabaseTree(void) obj_list=(*db_model->getObjectList(types[i])); //Special case for relationship, merging the base relationship list to the relationship list - if(types[i]==ObjRelationship) + if(types[i]==ObjectType::ObjRelationship) { vector obj_list_aux; - obj_list_aux=(*db_model->getObjectList(ObjBaseRelationship)); + obj_list_aux=(*db_model->getObjectList(ObjectType::ObjBaseRelationship)); obj_list.insert(obj_list.end(), obj_list_aux.begin(), obj_list_aux.end()); } @@ -760,7 +760,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) object=obj_list.at(i1); item2=createItemForObject(object, item1); - if(types[i]==ObjTag) + if(types[i]==ObjectType::ObjTag) { db_model->getObjectReferences(object, ref_list); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 01e0e3663f..148975eec5 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -123,7 +123,7 @@ void ModelsDiffHelper::cancelDiff(void) void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned diff_type) { - ObjectType types[2]={ ObjColumn, ObjConstraint }; + ObjectType types[2]={ ObjectType::ObjColumn, ObjectType::ObjConstraint }; vector *tab_objs=nullptr; Constraint *constr=nullptr; Table *ref_tab=nullptr, *comp_tab=nullptr; @@ -168,7 +168,7 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d at diffModels() */ if(aux_obj && diff_type!=ObjectsDiffInfo::DropObject && ((tab_obj->isAddedByGeneralization() || !tab_obj->isAddedByLinking() || - (aux_obj->getObjectType()==ObjColumn && tab_obj->isAddedByLinking())) || + (aux_obj->getObjectType()==ObjectType::ObjColumn && tab_obj->isAddedByLinking())) || (constr && constr->getConstraintType()!=ConstraintType::foreign_key))) { //If there are some differences on the XML code of the objects @@ -237,12 +237,12 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) idx++; /* If this checking the following objects are discarded: - 1) ObjBaseRelationship objects + 1) ObjectType::ObjBaseRelationship objects 2) Objects which SQL code is disabled or system objects 3) Cluster objects such as roles and tablespaces (when the operatoin is DROP and keep_cluster_objs is true) */ - if(obj_type!=ObjBaseRelationship && + if(obj_type!=ObjectType::ObjBaseRelationship && !object->isSystemObject() && !object->isSQLDisabled() && - ((diff_type==ObjectsDiffInfo::DropObject && (!diff_opts[OptKeepClusterObjs] || (diff_opts[OptKeepClusterObjs] && obj_type!=ObjRole && obj_type!=ObjTablespace))) || + ((diff_type==ObjectsDiffInfo::DropObject && (!diff_opts[OptKeepClusterObjs] || (diff_opts[OptKeepClusterObjs] && obj_type!=ObjectType::ObjRole && obj_type!=ObjectType::ObjTablespace))) || (diff_type!=ObjectsDiffInfo::DropObject))) { emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), @@ -250,11 +250,11 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) object->getObjectType()); //Processing objects that are not database, table child object (they are processed further) - if(obj_type!=ObjDatabase && !TableObject::isTableObject(obj_type)) + if(obj_type!=ObjectType::ObjDatabase && !TableObject::isTableObject(obj_type)) { /* Processing permissions. If the operation is DROP and keep_obj_perms is true the the permission is ignored */ - if(obj_type==ObjPermission && + if(obj_type==ObjectType::ObjPermission && ((diff_type==ObjectsDiffInfo::DropObject && !diff_opts[OptKeepObjectPerms]) || @@ -265,7 +265,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) generateDiffInfo(diff_type, object); //Processing relationship (in this case only generalization and patitioning ones are considered) - else if(obj_type==ObjRelationship) + else if(obj_type==ObjectType::ObjRelationship) { Table *ref_tab=nullptr, *rec_tab=nullptr; Relationship *rel=dynamic_cast(object); @@ -299,14 +299,14 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) } } } - else if(obj_type!=ObjPermission) + else if(obj_type!=ObjectType::ObjPermission) { //Get the object from the database obj_name=object->getSignature(); aux_object=aux_model->getObject(obj_name, obj_type); //Special case for many-to-many relationships - if(obj_type==ObjTable && !aux_object) + if(obj_type==ObjectType::ObjTable && !aux_object) aux_object=getRelNNTable(obj_name, aux_model); if(diff_type != ObjectsDiffInfo::DropObject && aux_object) @@ -339,7 +339,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) generateDiffInfo(ObjectsDiffInfo::AlterObject, object, aux_object); //If the object is a table, do additional comparision between their child objects - if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && object->getObjectType()==ObjTable) + if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && object->getObjectType()==ObjectType::ObjTable) { Table *tab=dynamic_cast
(object), *aux_tab=dynamic_cast
(aux_object); diffTables(tab, aux_tab, ObjectsDiffInfo::DropObject); @@ -421,7 +421,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) if(aux_base_tab) { - if(obj_type==ObjConstraint) + if(obj_type==ObjectType::ObjConstraint) { Table *aux_table=dynamic_cast
(aux_base_tab); aux_tab_obj=aux_table->getObject(obj_name, obj_type); @@ -444,7 +444,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) BaseObject *ModelsDiffHelper::getRelNNTable(const QString &obj_name, DatabaseModel *model) { - vector *rels=model->getObjectList(ObjRelationship); + vector *rels=model->getObjectList(ObjectType::ObjRelationship); Relationship *rel=nullptr; BaseObject *tab=nullptr; @@ -528,7 +528,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, emit s_objectsDiffInfoGenerated(diff_info); } - if(!diff_opts[OptReuseSequences] || imported_model->getObjectIndex(seq->getSignature(), ObjSequence) < 0) + if(!diff_opts[OptReuseSequences] || imported_model->getObjectIndex(seq->getSignature(), ObjectType::ObjSequence) < 0) { //Creates a CREATE info with the sequence diff_info=ObjectsDiffInfo(ObjectsDiffInfo::CreateObject, seq, nullptr); @@ -545,7 +545,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, while(itr!=itr_end) { if(itr->getDiffType()==ObjectsDiffInfo::DropObject && - itr->getObject()->getObjectType()==ObjSequence && + itr->getObject()->getObjectType()==ObjectType::ObjSequence && itr->getObject()->getSignature()==seq->getSignature()) { diff_infos.erase(itr); @@ -584,8 +584,8 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, /* Avoiding columns to be dropped when a sequence linked to them is dropped too. This because a column can be a reference to a sequence so to avoid drop and recreate that column this one will not be erased, unless the column does not exists in the model anymore */ - if((obj_type==ObjSequence && obj->getObjectType()!=ObjColumn) && - (obj_type!=ObjSequence && obj->getObjectType()!=ObjBaseRelationship)) + if((obj_type==ObjectType::ObjSequence && obj->getObjectType()!=ObjectType::ObjColumn) && + (obj_type!=ObjectType::ObjSequence && obj->getObjectType()!=ObjectType::ObjBaseRelationship)) generateDiffInfo(diff_type, obj); if(diff_canceled) @@ -651,7 +651,7 @@ void ModelsDiffHelper::processDiffInfos(void) emit s_progressUpdated(0, trUtf8("Processing diff infos...")); //Reuniting the schema names to inject a SET search_path command - for(auto &schema : *imported_model->getObjectList(ObjSchema)) + for(auto &schema : *imported_model->getObjectList(ObjectType::ObjSchema)) sch_names.push_back(schema->getName(true)); //Separating the base types @@ -718,13 +718,13 @@ void ModelsDiffHelper::processDiffInfos(void) //Undoing inheritances no_inherit_def+=rel->getAlterRelationshipDefinition(true); } - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) //Unsetting permissions unset_perms+=object->getDropDefinition(diff_opts[OptCascadeMode]); else { //Ordinary drop commands for any object except columns - if(obj_type!=ObjColumn) + if(obj_type!=ObjectType::ObjColumn) drop_objs[object->getObjectId()]=getCodeDefinition(object, true); else { @@ -745,14 +745,14 @@ void ModelsDiffHelper::processDiffInfos(void) //Creating inheritances inherit_def+=rel->getAlterRelationshipDefinition(false); } - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) //Setting permissions set_perms+=object->getCodeDefinition(SchemaParser::SqlDefinition); else { /* Special case for constaints: the creation commands for these objects are appended at the very end of create commands secion. Primary keys, unique keys, check constraints and exclude constraints are created after foreign keys */ - if(object->getObjectType()==ObjConstraint) + if(object->getObjectType()==ObjectType::ObjConstraint) { if(dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) create_fks[object->getObjectId()]=getCodeDefinition(object, false); @@ -763,7 +763,7 @@ void ModelsDiffHelper::processDiffInfos(void) { create_objs[object->getObjectId()]=getCodeDefinition(object, false); - if(obj_type==ObjSchema) + if(obj_type==ObjectType::ObjSchema) sch_names.push_back(object->getName(true)); } } @@ -772,7 +772,7 @@ void ModelsDiffHelper::processDiffInfos(void) else if(diff_type==ObjectsDiffInfo::AlterObject) { //Recreating the object instead of generating an ALTER command for it - if((diff_opts[OptForceRecreation] && obj_type!=ObjDatabase) && + if((diff_opts[OptForceRecreation] && obj_type!=ObjectType::ObjDatabase) && (!diff_opts[OptRecreateUnchangeble] || (diff_opts[OptRecreateUnchangeble] && !object->acceptsAlterCommand() && diff.getObject()->getCodeDefinition(SchemaParser::SqlDefinition).simplified()!= @@ -792,7 +792,7 @@ void ModelsDiffHelper::processDiffInfos(void) { /* Special case for constraints, their code will be appeded to a separated variable in order to create them at the end of diff buffer */ - if(obj->getObjectType()==ObjConstraint) + if(obj->getObjectType()==ObjectType::ObjConstraint) { if(dynamic_cast(obj)->getConstraintType()==ConstraintType::foreign_key) create_fks[obj->getObjectId()]=getCodeDefinition(obj, false); @@ -812,7 +812,7 @@ void ModelsDiffHelper::processDiffInfos(void) if(diff.getOldObject()) alter_def=diff.getOldObject()->getAlterDefinition(object); - if(obj_type == ObjDatabase && diff_opts[OptPreserveDbName]) + if(obj_type == ObjectType::ObjDatabase && diff_opts[OptPreserveDbName]) alter_def.remove(QRegExp(QString("(ALTER)( )+(DATABASE)( )+(%1)( )+(RENAME)( )+(TO)(.)*(\\n)").arg(diff.getOldObject()->getSignature()))); if(!alter_def.isEmpty()) @@ -821,7 +821,7 @@ void ModelsDiffHelper::processDiffInfos(void) /* If the object is a column checks if the types of the columns are differents, generating a TRUNCATE TABLE for the parent table */ - if(obj_type==ObjColumn && diff_opts[OptTruncateTables]) + if(obj_type==ObjectType::ObjColumn && diff_opts[OptTruncateTables]) { Column *src_col=dynamic_cast(object), *old_col=dynamic_cast(diff.getOldObject()); @@ -887,7 +887,7 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[ParsersAttributes::FK_DEFS]=QString(); attribs[ParsersAttributes::UNSET_PERMS]=unset_perms; attribs[ParsersAttributes::SET_PERMS]=set_perms; - attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjFunction)!=0 ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjectType::ObjFunction)!=0 ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::SEARCH_PATH]=(has_diffs ? sch_names.join(',') : QString()); ritr=drop_objs.rbegin(); @@ -956,7 +956,7 @@ QString ModelsDiffHelper::getCodeDefinition(BaseObject *object, bool drop_cmd) /* For columns and constraints it is needed to force the generation of ALTER commands on the parent table */ - if(tab_obj && (tab_obj->getObjectType()==ObjColumn || tab_obj->getObjectType()==ObjConstraint)) + if(tab_obj && (tab_obj->getObjectType()==ObjectType::ObjColumn || tab_obj->getObjectType()==ObjectType::ObjConstraint)) { bool gen_alter=false; Table *table=dynamic_cast
(tab_obj->getParentTable()); @@ -1004,9 +1004,9 @@ void ModelsDiffHelper::destroyTempObjects(void) void ModelsDiffHelper::recreateObject(BaseObject *object, vector &drop_objs, vector &create_objs) { if(object && - object->getObjectType()!=ObjBaseRelationship && - object->getObjectType()!=ObjRelationship && - object->getObjectType()!=ObjDatabase) + object->getObjectType()!=ObjectType::ObjBaseRelationship && + object->getObjectType()!=ObjectType::ObjRelationship && + object->getObjectType()!=ObjectType::ObjDatabase) { vector ref_objs; BaseObject *aux_obj=nullptr; @@ -1034,7 +1034,7 @@ void ModelsDiffHelper::recreateObject(BaseObject *object, vector & /* If the to-be recreate object is a constraint check if it's a pk, if so, the fk's linked to it need to be recreated as well */ - if(aux_obj->getObjectType()==ObjConstraint) + if(aux_obj->getObjectType()==ObjectType::ObjConstraint) { Constraint *constr=dynamic_cast(aux_obj); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.h b/libpgmodeler_ui/src/modelsdiffhelper.h index 0cfc364b01..846b6f8b5d 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.h +++ b/libpgmodeler_ui/src/modelsdiffhelper.h @@ -164,7 +164,7 @@ class ModelsDiffHelper: public QObject { signals: //! \brief This singal is emitted whenever the diff progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjBaseObject); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::ObjBaseObject); //! \brief This signal is emited when the diff has finished void s_diffFinished(void); diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index 0bad6d7897..583a667f48 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -106,7 +106,7 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) } } - if(aux_obj && (aux_obj->getObjectType()==ObjView || aux_obj->getObjectType()==ObjTable)) + if(aux_obj && (aux_obj->getObjectType()==ObjectType::ObjView || aux_obj->getObjectType()==ObjectType::ObjTable)) { vector base_rels=db_model->getRelationships(dynamic_cast(aux_obj)); for(auto &rel : base_rels) @@ -143,8 +143,8 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) /* If the last element of the referrer objects is a table or view the info object itself need to be renamed since tables and views will not be renamed */ - bool rename_obj=(refs.back()->getObjectType()==ObjTable || - refs.back()->getObjectType()==ObjView); + bool rename_obj=(refs.back()->getObjectType()==ObjectType::ObjTable || + refs.back()->getObjectType()==ObjectType::ObjView); if(rename_obj) { @@ -263,11 +263,11 @@ void ModelValidationHelper::validateModel(void) try { - ObjectType types[]={ ObjRole, ObjTablespace, ObjSchema, ObjLanguage, ObjFunction, - ObjType, ObjDomain, ObjSequence, ObjOperator, ObjOpFamily, - ObjOpClass, ObjCollation, ObjTable, ObjExtension, ObjView, ObjRelationship }, - aux_types[]={ ObjTable, ObjView }, - tab_obj_types[]={ ObjConstraint, ObjIndex }, + ObjectType types[]={ ObjectType::ObjRole, ObjectType::ObjTablespace, ObjectType::ObjSchema, ObjectType::ObjLanguage, ObjectType::ObjFunction, + ObjectType::ObjType, ObjectType::ObjDomain, ObjectType::ObjSequence, ObjectType::ObjOperator, ObjectType::ObjOpFamily, + ObjectType::ObjOpClass, ObjectType::ObjCollation, ObjectType::ObjTable, ObjectType::ObjExtension, ObjectType::ObjView, ObjectType::ObjRelationship }, + aux_types[]={ ObjectType::ObjTable, ObjectType::ObjView }, + tab_obj_types[]={ ObjectType::ObjConstraint, ObjectType::ObjIndex }, obj_type; unsigned i, i1, cnt, aux_cnt=sizeof(aux_types)/sizeof(ObjectType), count=sizeof(types)/sizeof(ObjectType), count1=sizeof(tab_obj_types)/sizeof(ObjectType); @@ -282,7 +282,7 @@ void ModelValidationHelper::validateModel(void) map > dup_objects; map >::iterator mitr; QString name, signal_msg=QString("`%1' (%2)"); - bool postgis_exists = db_model->getObjectIndex(QString("postgis"), ObjExtension) >= 0; + bool postgis_exists = db_model->getObjectIndex(QString("postgis"), ObjectType::ObjExtension) >= 0; warn_count=error_count=progress=0; val_infos.clear(); @@ -309,7 +309,7 @@ void ModelValidationHelper::validateModel(void) /* Special validation case: For generalization and copy relationships validates the ids of participant tables. * Reference table cannot own an id greater thant receiver table */ - if(obj_type==ObjRelationship) + if(obj_type==ObjectType::ObjRelationship) { rel=dynamic_cast(object); if(rel->getRelationshipType()==Relationship::RelationshipGen || @@ -362,9 +362,9 @@ void ModelValidationHelper::validateModel(void) /* Validating a special object. The validation made here is to check if the special object (constraint/index/trigger/view) references a column added by a relationship and that relationship is being created after the creation of the special object */ - if(obj_type==ObjTable || obj_type==ObjView /* || obj_type==ObjSequence */) + if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView /* || obj_type==ObjectType::ObjSequence */) { - vector tab_aux_types={ ObjConstraint, ObjTrigger, ObjIndex }; + vector tab_aux_types={ ObjectType::ObjConstraint, ObjectType::ObjTrigger, ObjectType::ObjIndex }; vector *tab_objs; vector ref_cols; vector rels; @@ -391,14 +391,14 @@ void ModelValidationHelper::validateModel(void) if(!tab_obj->isAddedByRelationship()) { - if(obj_tp==ObjConstraint) + if(obj_tp==ObjectType::ObjConstraint) { constr=dynamic_cast(tab_obj); if(constr->getConstraintType()!=ConstraintType::primary_key) ref_cols=constr->getRelationshipAddedColumns(); } - else if(obj_tp==ObjTrigger) + else if(obj_tp==ObjectType::ObjTrigger) ref_cols=dynamic_cast(tab_obj)->getRelationshipAddedColumns(); else ref_cols=dynamic_cast(tab_obj)->getRelationshipAddedColumns(); @@ -445,7 +445,7 @@ void ModelValidationHelper::validateModel(void) /* Step 2: Validating name conflitcs between primary keys, unique keys, exclude constraints and indexs of all tables/views. The table and view names are checked too. */ - obj_list=db_model->getObjectList(ObjTable); + obj_list=db_model->getObjectList(ObjectType::ObjTable); itr=obj_list->begin(); //Searching the model's tables and gathering all the constraints and index @@ -520,7 +520,7 @@ void ModelValidationHelper::validateModel(void) // Step 3: Checking if columns of any table is using GiS data types and the postgis extension is not created. if(!postgis_exists) { - obj_list=db_model->getObjectList(ObjTable); + obj_list=db_model->getObjectList(ObjectType::ObjTable); itr=obj_list->begin(); i=0; @@ -529,7 +529,7 @@ void ModelValidationHelper::validateModel(void) table = dynamic_cast
(*itr); itr++; - for(auto &obj : *table->getObjectList(ObjColumn)) + for(auto &obj : *table->getObjectList(ObjectType::ObjColumn)) { col = dynamic_cast(obj); @@ -547,8 +547,8 @@ void ModelValidationHelper::validateModel(void) only when there is no validation infos generated because for each broken relationship there is the need to do a revalidation of all relationships */ if(val_infos.empty()) { - obj_list=db_model->getObjectList(ObjRelationship); - itr=db_model->getObjectList(ObjRelationship)->begin(); + obj_list=db_model->getObjectList(ObjectType::ObjRelationship); + itr=db_model->getObjectList(ObjectType::ObjRelationship)->begin(); while(itr!=obj_list->end() && !valid_canceled) { diff --git a/libpgmodeler_ui/src/modelvalidationhelper.h b/libpgmodeler_ui/src/modelvalidationhelper.h index a0a15e8e10..ce23799e76 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.h +++ b/libpgmodeler_ui/src/modelvalidationhelper.h @@ -113,7 +113,7 @@ class ModelValidationHelper: public QObject { void s_validationInfoGenerated(ValidationInfo val_info); //! \brief This signal is emitted when the validation progress changes - void s_progressUpdated(int prog, QString msg, ObjectType obj_type=ObjBaseObject, QString cmd=QString(), bool is_code_gen=false); + void s_progressUpdated(int prog, QString msg, ObjectType obj_type=ObjectType::ObjBaseObject, QString cmd=QString(), bool is_code_gen=false); //! \brief This signal is emitted when the object is processed by the validator void s_objectProcessed(QString obj_name, ObjectType obj_type); diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index e500d862d3..b5e1050e3e 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -273,7 +273,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) label->setText(trUtf8("The column %1 on %2 (%3) is referencing the geospatial data type %4 but the postgis extension is not present in the model!") .arg(col->getName()) .arg(col->getParentTable()->getSignature(true)) - .arg(BaseObject::getTypeName(ObjTable)) + .arg(BaseObject::getTypeName(ObjectType::ObjTable)) .arg(~col->getType())); } else @@ -450,7 +450,7 @@ void ModelValidationWidget::updateProgress(int prog, QString msg, ObjectType obj msg=PgModelerUiNs::formatMessage(msg); - if(obj_type!=ObjBaseObject) + if(obj_type!=ObjectType::ObjBaseObject) ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else if(!cmd.isEmpty()) ico=QPixmap(PgModelerUiNs::getIconPath("sqlcmd")); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 4b54bbd3d7..ced86ddcad 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -81,14 +81,14 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) QAction *action=nullptr; QString str_ico; QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen"), QString("part") }; - ObjectType types[]={ ObjTable, ObjView, ObjTextbox, ObjRelationship, - ObjCast, ObjConversion, ObjDomain, - ObjFunction, ObjAggregate, ObjLanguage, - ObjOpClass, ObjOperator, ObjOpFamily, - ObjRole, ObjSchema, ObjSequence, ObjType, - ObjColumn, ObjConstraint, ObjRule, ObjTrigger, ObjIndex, ObjPolicy, - ObjTablespace, ObjCollation, ObjExtension, ObjEventTrigger, ObjTag, - ObjGenericSQL }; + ObjectType types[]={ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjTextbox, ObjectType::ObjRelationship, + ObjectType::ObjCast, ObjectType::ObjConversion, ObjectType::ObjDomain, + ObjectType::ObjFunction, ObjectType::ObjAggregate, ObjectType::ObjLanguage, + ObjectType::ObjOpClass, ObjectType::ObjOperator, ObjectType::ObjOpFamily, + ObjectType::ObjRole, ObjectType::ObjSchema, ObjectType::ObjSequence, ObjectType::ObjType, + ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjPolicy, + ObjectType::ObjTablespace, ObjectType::ObjCollation, ObjectType::ObjExtension, ObjectType::ObjEventTrigger, ObjectType::ObjTag, + ObjectType::ObjGenericSQL }; unsigned i, obj_cnt=sizeof(types)/sizeof(ObjectType), rel_types_id[]={ BaseRelationship::Relationship11, BaseRelationship::Relationship1n, BaseRelationship::RelationshipNn, BaseRelationship::RelationshipDep, @@ -96,7 +96,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) current_zoom=1; modified=panning_mode=false; - new_obj_type=ObjBaseObject; + new_obj_type=ObjectType::ObjBaseObject; //Generating a temporary file name for the model QTemporaryFile tmp_file; @@ -368,17 +368,17 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) //Creating the relationship submenu rels_menu=new QMenu(this); - actions_new_objects[ObjRelationship]->setMenu(rels_menu); + actions_new_objects[ObjectType::ObjRelationship]->setMenu(rels_menu); for(int i=0; i < rel_types_cod.size(); i++) { - str_ico=BaseObject::getSchemaName(ObjRelationship) + rel_types_cod[i]; + str_ico=BaseObject::getSchemaName(ObjectType::ObjRelationship) + rel_types_cod[i]; action=new QAction(QIcon(PgModelerUiNs::getIconPath(str_ico)), BaseRelationship::getRelationshipTypeName(rel_types_id[i], false), this); //Storing a unique identifier for the relationship type - action->setData(QVariant(ObjRelationship + rel_types_id[i])); + action->setData(QVariant(ObjectType::ObjRelationship + rel_types_id[i])); connect(action, SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); rels_menu->addAction(action); @@ -388,13 +388,13 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) new_obj_overlay_wgt->setObjectName(QString("new_obj_overlay_wgt")); new_obj_overlay_wgt->setVisible(false); - vector graph_types = { ObjBaseObject, ObjSchema, ObjTable, ObjView, ObjRelationship, ObjTextbox }; + vector graph_types = { ObjectType::ObjBaseObject, ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjRelationship, ObjectType::ObjTextbox }; QStringList labels = { trUtf8("All objects"), trUtf8("Schemas"), trUtf8("Tables"), trUtf8("Views"), trUtf8("Relationships"), trUtf8("Textboxes") }; i=0; for(auto &obj_type : graph_types) { - if(obj_type == ObjBaseObject) + if(obj_type == ObjectType::ObjBaseObject) { action=new QAction(labels[i++], this); action->setShortcut(QKeySequence(trUtf8("Ctrl+A"))); @@ -666,7 +666,7 @@ void ModelWidget::mousePressEvent(QMouseEvent *event) { /* If the user is adding a graphical object, the left click will set the initial position and show the editing form related to the object type */ - if(!simple_obj_creation && (new_obj_type==ObjTable || new_obj_type==ObjTextbox || new_obj_type==ObjView)) + if(!simple_obj_creation && (new_obj_type==ObjectType::ObjTable || new_obj_type==ObjectType::ObjTextbox || new_obj_type==ObjectType::ObjView)) { this->scene->enableRangeSelection(false); this->showObjectForm(new_obj_type, nullptr, nullptr, viewport->mapToScene(event->pos())); @@ -760,20 +760,20 @@ void ModelWidget::handleObjectAddition(BaseObject *object) switch(obj_type) { - case ObjTable: + case ObjectType::ObjTable: item=new TableView(dynamic_cast
(graph_obj)); break; - case ObjView: + case ObjectType::ObjView: item=new GraphicalView(dynamic_cast(graph_obj)); break; - case ObjRelationship: - case ObjBaseRelationship: + case ObjectType::ObjRelationship: + case ObjectType::ObjBaseRelationship: item=new RelationshipView(dynamic_cast(graph_obj)); break; break; - case ObjSchema: + case ObjectType::ObjSchema: if(!graph_obj->isSystemObject() || (graph_obj->isSystemObject() && graph_obj->getName()==QString("public"))) { @@ -808,11 +808,11 @@ void ModelWidget::addNewObject(void) these types after select a table or schema, respectively */ if(selected_objects.size()==1 && (TableObject::isTableObject(obj_type) || - selected_objects[0]->getObjectType()==ObjSchema)) + selected_objects[0]->getObjectType()==ObjectType::ObjSchema)) parent_obj=selected_objects[0]; //Creating a table or view inside a schema - if(parent_obj && parent_obj->getObjectType()==ObjSchema && (obj_type==ObjTable || obj_type==ObjView)) + if(parent_obj && parent_obj->getObjectType()==ObjectType::ObjSchema && (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView)) { BaseObjectView *sch_graph=dynamic_cast(dynamic_cast(parent_obj)->getReceiverObject()); QSizeF size = sch_graph->boundingRect().size(); @@ -829,17 +829,17 @@ void ModelWidget::addNewObject(void) this->showObjectForm(obj_type, nullptr, parent_obj, pos); } - else if(obj_type!=ObjTable && obj_type!=ObjView && - obj_type!=ObjTextbox && obj_type <= ObjBaseTable) + else if(obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjView && + obj_type!=ObjectType::ObjTextbox && obj_type <= ObjectType::ObjBaseTable) this->showObjectForm(obj_type, nullptr, parent_obj); else { /* A small checking to enable the overlay widget to create relationships and other graphical objects without the user click on the canvas area */ - if((obj_type > ObjBaseObject && + if((obj_type > ObjectType::ObjBaseObject && selected_objects.size()==2 && - selected_objects.at(0)->getObjectType()==ObjTable && - selected_objects.at(1)->getObjectType()==ObjTable)) + selected_objects.at(0)->getObjectType()==ObjectType::ObjTable && + selected_objects.at(1)->getObjectType()==ObjectType::ObjTable)) { this->showObjectForm(obj_type); } @@ -847,7 +847,7 @@ void ModelWidget::addNewObject(void) { //Simple table|view|textbox creation if(simple_obj_creation && - (obj_type==ObjTable || obj_type==ObjView || obj_type==ObjTextbox)) + (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView || obj_type==ObjectType::ObjTextbox)) this->showObjectForm(obj_type, nullptr, parent_obj, viewport->mapToScene(viewport->rect().center())); else { @@ -860,7 +860,7 @@ void ModelWidget::addNewObject(void) * we force the enabling of the relationship creation steps. This will automatically selects the current table * as source table of the relationship */ if(selected_objects.size() == 1 && - selected_objects[0]->getObjectType() == ObjTable && new_obj_type > ObjBaseTable) + selected_objects[0]->getObjectType() == ObjectType::ObjTable && new_obj_type > ObjectType::ObjBaseTable) configureObjectSelection(); } } @@ -878,7 +878,7 @@ void ModelWidget::handleObjectRemoval(BaseObject *object) //Updates the parent schema if the removed object were a table or view if(graph_obj->getSchema() && - (graph_obj->getObjectType()==ObjTable || graph_obj->getObjectType()==ObjView)) + (graph_obj->getObjectType()==ObjectType::ObjTable || graph_obj->getObjectType()==ObjectType::ObjView)) dynamic_cast(graph_obj->getSchema())->setModified(true); } @@ -890,7 +890,7 @@ void ModelWidget::handleObjectDoubleClick(BaseGraphicObject *object) if(object) this->showObjectForm(object->getObjectType(), object, nullptr, object->getPosition()); else - this->showObjectForm(ObjDatabase, db_model); + this->showObjectForm(ObjectType::ObjDatabase, db_model); } void ModelWidget::handleObjectsMovement(bool end_moviment) @@ -945,7 +945,7 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) obj=dynamic_cast(*itr); itr++; - if(obj->getObjectType()==ObjTable || obj->getObjectType()==ObjView) + if(obj->getObjectType()==ObjectType::ObjTable || obj->getObjectType()==ObjectType::ObjView) { Schema *schema=dynamic_cast(dynamic_cast(obj)->getSchema()); @@ -1023,9 +1023,9 @@ void ModelWidget::configureObjectSelection(void) itr++; } - /* Case the new_obj_type is a value greater the ObjBaseTable indicates that the user + /* Case the new_obj_type is a value greater the ObjectType::ObjBaseTable indicates that the user (un)selected a object using some "Relationship" action */ - if(new_obj_type > ObjBaseTable) + if(new_obj_type > ObjectType::ObjBaseTable) { unsigned count=selected_objects.size(); ObjectType obj_type1, obj_type2; @@ -1037,11 +1037,11 @@ void ModelWidget::configureObjectSelection(void) { //Get the selected objects types obj_type1=selected_objects[0]->getObjectType(); - obj_type2=(count==2 ? selected_objects[1]->getObjectType() : ObjBaseObject); + obj_type2=(count==2 ? selected_objects[1]->getObjectType() : ObjectType::ObjBaseObject); //If there is only one selected object and this is a table, activates the relationship creation if(!scene->isRelationshipLineVisible() && - count==1 && obj_type1==ObjTable && new_obj_type > ObjBaseTable && QApplication::keyboardModifiers()==0) + count==1 && obj_type1==ObjectType::ObjTable && new_obj_type > ObjectType::ObjBaseTable && QApplication::keyboardModifiers()==0) { BaseGraphicObject *graph_obj=dynamic_cast(selected_objects[0]); BaseObjectView *object=dynamic_cast(graph_obj->getReceiverObject()); @@ -1051,15 +1051,15 @@ void ModelWidget::configureObjectSelection(void) object->scenePos().y() + object->boundingRect().height()/2)); } //If the user has selected object that are not tables, cancel the operation - else if(obj_type1!=ObjTable || (obj_type2!=ObjTable && obj_type2!=ObjBaseObject)) + else if(obj_type1!=ObjectType::ObjTable || (obj_type2!=ObjectType::ObjTable && obj_type2!=ObjectType::ObjBaseObject)) { this->cancelObjectAddition(); } /* Case there is only one selected object (table) and the SHIFT key is pressed too, creates a self-relationship. Case there is two selected objects, create a relationship between them */ - else if((count==1 && obj_type1==ObjTable && QApplication::keyboardModifiers()==Qt::ShiftModifier) || - (count==2 && obj_type1==ObjTable && obj_type2==ObjTable)) + else if((count==1 && obj_type1==ObjectType::ObjTable && QApplication::keyboardModifiers()==Qt::ShiftModifier) || + (count==2 && obj_type1==ObjectType::ObjTable && obj_type2==ObjectType::ObjTable)) { /* Forcing no signals to be emitted by the scene while the relationship is being configured to avoid this * method to be called unecessarily */ @@ -1088,7 +1088,7 @@ void ModelWidget::selectAllObjects(void) ObjectType obj_type = static_cast(act->data().toUInt()); - if(obj_type == ObjBaseObject) + if(obj_type == ObjectType::ObjBaseObject) { QPainterPath pth; pth.addRect(scene->sceneRect()); @@ -1102,8 +1102,8 @@ void ModelWidget::selectAllObjects(void) BaseObjectView *obj_view = nullptr; vector objs = *db_model->getObjectList(obj_type); - if(obj_type == ObjRelationship) - objs.insert(objs.end(), db_model->getObjectList(ObjBaseRelationship)->begin(), db_model->getObjectList(ObjBaseRelationship)->end()); + if(obj_type == ObjectType::ObjRelationship) + objs.insert(objs.end(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->begin(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->end()); for(auto &obj : objs) { @@ -1257,7 +1257,7 @@ void ModelWidget::convertRelationshipNN(void) //Renames the table if there is other with the same name on the model avoiding conflicts tab->setName(tab_name); - tab->setName(PgModelerNs::generateUniqueName(tab, *db_model->getObjectList(ObjTable))); + tab->setName(PgModelerNs::generateUniqueName(tab, *db_model->getObjectList(ObjectType::ObjTable))); op_list->startOperationChain(); @@ -1293,7 +1293,7 @@ void ModelWidget::convertRelationshipNN(void) for(QString pk_col : pk_cols) aux_constr->addColumn(tab->getColumn(pk_col), Constraint::SourceCols); - aux_constr->setName(PgModelerNs::generateUniqueName(tab, *tab->getObjectList(ObjConstraint), false, QString("_pk"))); + aux_constr->setName(PgModelerNs::generateUniqueName(tab, *tab->getObjectList(ObjectType::ObjConstraint), false, QString("_pk"))); tab->addConstraint(aux_constr); op_list->registerObject(aux_constr, Operation::ObjectCreated, -1, tab); @@ -1393,7 +1393,7 @@ void ModelWidget::adjustSceneSize(void) if(align_objs) { scene->alignObjectsToGrid(); - db_model->setObjectsModified({ ObjRelationship, ObjBaseRelationship }); + db_model->setObjectsModified({ ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); } emit s_sceneInteracted(scene_rect.size()); @@ -1657,17 +1657,17 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb Schema *sel_schema=dynamic_cast(parent_obj); QPointF obj_pos=pos; - /* Case the obj_type is greater than ObjBaseTable indicates that the object type is a + /* Case the obj_type is greater than ObjectType::ObjBaseTable indicates that the object type is a relationship. To get the specific relationship id (1-1, 1-n, n-n, gen, dep) is necessary - to subtract the ObjRelationship from the obj_type parameter, the result will point + to subtract the ObjectType::ObjRelationship from the obj_type parameter, the result will point to the BaseRelationship::RELATIONSHIP_??? constant. */ - if(obj_type > ObjBaseTable) + if(obj_type > ObjectType::ObjBaseTable) { - rel_type=obj_type - ObjRelationship; - obj_type=ObjRelationship; + rel_type=obj_type - ObjectType::ObjRelationship; + obj_type=ObjectType::ObjRelationship; } - if(obj_type!=ObjPermission) + if(obj_type!=ObjectType::ObjPermission) { if(object && obj_type!=object->getObjectType()) throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1682,83 +1682,83 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb /* Raises an error if the user try to edit a reserverd object. The only exception is for "public" schema that can be edited only on its fill color an rectangle attributes */ if(object && object->isSystemObject() && - (object->getObjectType()!=ObjSchema || object->getName()!="public")) + (object->getObjectType()!=ObjectType::ObjSchema || object->getName()!="public")) throw Exception(Exception::getErrorMessage(OprReservedObject) .arg(object->getName()).arg(object->getTypeName()), OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type==ObjSchema) + if(obj_type==ObjectType::ObjSchema) res=openEditingForm(object); - else if(obj_type==ObjRole) + else if(obj_type==ObjectType::ObjRole) res=openEditingForm(object); - else if(obj_type==ObjTablespace) + else if(obj_type==ObjectType::ObjTablespace) res=openEditingForm(object); - else if(obj_type==ObjLanguage) + else if(obj_type==ObjectType::ObjLanguage) res=openEditingForm(object); - else if(obj_type==ObjCast) + else if(obj_type==ObjectType::ObjCast) res=openEditingForm(object); - else if(obj_type==ObjTag) + else if(obj_type==ObjectType::ObjTag) res=openEditingForm(object); - else if(obj_type== ObjEventTrigger) + else if(obj_type== ObjectType::ObjEventTrigger) res=openEditingForm(object); - else if(obj_type==ObjFunction) + else if(obj_type==ObjectType::ObjFunction) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjConversion) + else if(obj_type==ObjectType::ObjConversion) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjDomain) + else if(obj_type==ObjectType::ObjDomain) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjAggregate) + else if(obj_type==ObjectType::ObjAggregate) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjSequence) + else if(obj_type==ObjectType::ObjSequence) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjOpFamily) + else if(obj_type==ObjectType::ObjOpFamily) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjOpClass) + else if(obj_type==ObjectType::ObjOpClass) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjType) + else if(obj_type==ObjectType::ObjType) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjCollation) + else if(obj_type==ObjectType::ObjCollation) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjExtension) + else if(obj_type==ObjectType::ObjExtension) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjTable) + else if(obj_type==ObjectType::ObjTable) res=openEditingForm(object, sel_schema, obj_pos); - else if(obj_type==ObjView) + else if(obj_type==ObjectType::ObjView) res=openEditingForm(object, sel_schema, obj_pos); - else if(obj_type==ObjRule) + else if(obj_type==ObjectType::ObjRule) res=openEditingForm(object, parent_obj); - else if(obj_type== ObjTrigger) + else if(obj_type== ObjectType::ObjTrigger) res=openEditingForm(object, parent_obj); - else if(obj_type== ObjIndex) + else if(obj_type== ObjectType::ObjIndex) res=openEditingForm(object, parent_obj); - else if(obj_type== ObjPolicy) + else if(obj_type== ObjectType::ObjPolicy) res=openEditingForm(object, parent_obj); - else if(obj_type==ObjColumn || obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) { TableObject *tab_obj=dynamic_cast(object); - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) res=openEditingForm(object, parent_obj); else res=openEditingForm(object, parent_obj); if(res==QDialog::Accepted) { - if(tab_obj && parent_obj->getObjectType()==ObjTable) + if(tab_obj && parent_obj->getObjectType()==ObjectType::ObjTable) db_model->validateRelationships(tab_obj, dynamic_cast
(parent_obj)); else db_model->validateRelationships(); } } - else if(obj_type==ObjBaseRelationship || obj_type==ObjRelationship) + else if(obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjRelationship) { RelationshipWidget *relationship_wgt=new RelationshipWidget; if(!object && rel_type > 0 && selected_objects.size() > 0 && - selected_objects[0]->getObjectType()==ObjTable) + selected_objects[0]->getObjectType()==ObjectType::ObjTable) { Table *tab1=dynamic_cast
(selected_objects[0]), *tab2=(selected_objects.size()==2 ? @@ -1771,20 +1771,20 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb res=openEditingForm(relationship_wgt); scene->clearSelection(); } - else if(obj_type==ObjTextbox) + else if(obj_type==ObjectType::ObjTextbox) { TextboxWidget *textbox_wgt=new TextboxWidget; textbox_wgt->setAttributes(db_model, op_list, dynamic_cast(object), obj_pos.x(), obj_pos.y()); res=openEditingForm(textbox_wgt); } - else if(obj_type==ObjPermission) + else if(obj_type==ObjectType::ObjPermission) { PermissionWidget *permission_wgt=new PermissionWidget; Permission *perm=dynamic_cast(object); permission_wgt->setAttributes(db_model, nullptr, (perm ? perm->getObject() : object)); res=openEditingForm(permission_wgt, Messagebox::OkButton); } - else if(obj_type==ObjGenericSQL) + else if(obj_type==ObjectType::ObjGenericSQL) { GenericSQLWidget *genericsql_wgt=new GenericSQLWidget; genericsql_wgt->setAttributes(db_model, op_list, dynamic_cast(object)); @@ -1852,7 +1852,7 @@ void ModelWidget::showSourceCode(void) void ModelWidget::cancelObjectAddition(void) { //Reset the new object type to a invalid one forcing the user to select a correct type again - new_obj_type=ObjBaseObject; + new_obj_type=ObjectType::ObjBaseObject; //Restore the cursor icon viewport->setCursor(QCursor(Qt::ArrowCursor)); @@ -1976,7 +1976,7 @@ void ModelWidget::changeOwner(void) OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Register an operation only if the object is not the database itself - if(obj->getObjectType()!=ObjDatabase) + if(obj->getObjectType()!=ObjectType::ObjDatabase) op_id=op_list->registerObject(obj, Operation::ObjectModified, -1); obj->setOwner(owner); @@ -2122,7 +2122,7 @@ void ModelWidget::protectObject(void) { bool protect=!graph_obj->isProtected(); - if(graph_obj->getObjectType()==ObjSchema) + if(graph_obj->getObjectType()==ObjectType::ObjSchema) { Messagebox msgbox; msgbox.show(QString(QT_TR_NOOP("Do you want to %1 the selected schema's children too?")).arg(protect ? QT_TR_NOOP("protect") : QT_TR_NOOP("unprotect")), @@ -2172,7 +2172,7 @@ void ModelWidget::protectObject(void) obj_type=object->getObjectType(); - if(obj_type==ObjColumn || obj_type==ObjConstraint) + if(obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) { tab_obj=dynamic_cast(object); @@ -2222,7 +2222,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) TableObject *tab_obj=nullptr; BaseTable *table=nullptr; Constraint *constr=nullptr; - ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex, ObjConstraint, ObjPolicy }; + ObjectType types[]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjConstraint, ObjectType::ObjPolicy }; unsigned i, type_id, count; Messagebox msg_box; @@ -2255,7 +2255,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) object=(*itr); //Table-view relationships and FK relationship aren't copied since they are created automatically when pasting the tables/views - if(object->getObjectType()!=ObjBaseRelationship) + if(object->getObjectType()!=ObjectType::ObjBaseRelationship) { if(msg_box.result()==QDialog::Accepted) db_model->getObjectDependecies(object, deps, true); @@ -2264,7 +2264,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) /* Copying the special objects (which references columns added by relationship) in order to be correclty created when pasted */ - if(object->getObjectType()==ObjTable || object->getObjectType() == ObjView) + if(object->getObjectType()==ObjectType::ObjTable || object->getObjectType() == ObjectType::ObjView) { table=dynamic_cast(object); @@ -2291,7 +2291,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) deps.push_back(tab_obj); } - if(object->getObjectType() == ObjView && type_id >= 2) + if(object->getObjectType() == ObjectType::ObjView && type_id >= 2) break; } } @@ -2376,7 +2376,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) /* The first validation is to check if the object to be pasted does not conflict with any other object of the same type on the model */ - if(obj_type==ObjFunction) + if(obj_type==ObjectType::ObjFunction) dynamic_cast(object)->createSignature(true); else if(tab_obj) aux_name=tab_obj->getName(true); @@ -2388,7 +2388,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) aux_object=db_model->getObject(aux_name, obj_type); else { - if(sel_view && (obj_type==ObjTrigger || obj_type==ObjRule || obj_type==ObjIndex)) + if(sel_view && (obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule || obj_type==ObjectType::ObjIndex)) aux_object=sel_view->getObject(aux_name, obj_type); else if(sel_table) aux_object=sel_table->getObject(aux_name, obj_type); @@ -2407,7 +2407,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) object->getCodeDefinition(SchemaParser::SchemaParser::XmlDefinition))))) { //Resolving name conflicts - if(obj_type!=ObjCast) + if(obj_type!=ObjectType::ObjCast) { func=nullptr; oper=nullptr; @@ -2417,17 +2417,17 @@ void ModelWidget::pasteObjects(bool duplicate_mode) /* For each object type as follow configures the name and the suffix and store them on the 'copy_obj_name' variable. This string is used to check if there are objects with the same name on model. While the 'copy_obj_name' conflicts with other objects (of same type) this validation is made */ - if(obj_type==ObjFunction) + if(obj_type==ObjectType::ObjFunction) { func=dynamic_cast(object); - func->setName(PgModelerNs::generateUniqueName(func, (*db_model->getObjectList(ObjFunction)), false, QString("_cp"))); + func->setName(PgModelerNs::generateUniqueName(func, (*db_model->getObjectList(ObjectType::ObjFunction)), false, QString("_cp"))); copy_obj_name=func->getName(); func->setName(orig_obj_names[object]); } - else if(obj_type==ObjOperator) + else if(obj_type==ObjectType::ObjOperator) { oper=dynamic_cast(object); - oper->setName(PgModelerNs::generateUniqueName(oper, (*db_model->getObjectList(ObjOperator)))); + oper->setName(PgModelerNs::generateUniqueName(oper, (*db_model->getObjectList(ObjectType::ObjOperator)))); copy_obj_name=oper->getName(); oper->setName(orig_obj_names[object]); } @@ -2499,9 +2499,9 @@ void ModelWidget::pasteObjects(bool duplicate_mode) * is a table or is a view and the current object is a trigger, index, or rule (because * view's only accepts this two types) */ if(sel_table || - (sel_view && (tab_obj->getObjectType()==ObjTrigger || - tab_obj->getObjectType()==ObjRule || - tab_obj->getObjectType()==ObjIndex))) + (sel_view && (tab_obj->getObjectType()==ObjectType::ObjTrigger || + tab_obj->getObjectType()==ObjectType::ObjRule || + tab_obj->getObjectType()==ObjectType::ObjIndex))) { //Backups the original parent table orig_parent_tab=tab_obj->getParentTable(); @@ -2548,7 +2548,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) object=(*itr); itr++; - if(orig_obj_names[object].count() && obj_type!=ObjCast) + if(orig_obj_names[object].count() && obj_type!=ObjectType::ObjCast) object->setName(orig_obj_names[object]); } @@ -2595,7 +2595,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) //Special case for table objects if(tab_obj) { - if(sel_table && tab_obj->getObjectType()==ObjColumn) + if(sel_table && tab_obj->getObjectType()==ObjectType::ObjColumn) { sel_table->addObject(tab_obj); sel_table->setModified(true); @@ -2687,7 +2687,7 @@ void ModelWidget::duplicateObject(void) table = dynamic_cast(object)->getParentTable(); PgModelerNs::copyObject(&dup_object, object, obj_type); - if(table->getObjectType() == ObjTable) + if(table->getObjectType() == ObjectType::ObjTable) dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); else dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); @@ -2696,9 +2696,9 @@ void ModelWidget::duplicateObject(void) table->addObject(dup_object); table->setModified(true); - if(obj_type == ObjColumn) + if(obj_type == ObjectType::ObjColumn) db_model->validateRelationships(); - else if(obj_type == ObjConstraint && + else if(obj_type == ObjectType::ObjConstraint && dynamic_cast(object)->getConstraintType() == ConstraintType::foreign_key) db_model->updateTableFKRelationships(dynamic_cast
(table)); @@ -2728,7 +2728,7 @@ void ModelWidget::removeObjects(bool cascade) BaseTable *table=nullptr, *src_table=nullptr, *dst_table=nullptr; BaseRelationship *rel=nullptr; TableObject *tab_obj=nullptr; - ObjectType obj_type=ObjBaseObject, parent_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject, parent_type=ObjectType::ObjBaseObject; BaseObject *object=nullptr, *aux_obj=nullptr; vector sel_objs, aux_sel_objs; @@ -2770,7 +2770,7 @@ void ModelWidget::removeObjects(bool cascade) } else { - if(sel_objs[0]->getObjectType()==ObjRelationship) + if(sel_objs[0]->getObjectType()==ObjectType::ObjRelationship) msg_box.show(trUtf8("CAUTION: Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed?"), Messagebox::AlertIcon, Messagebox::YesNoButtons); else @@ -2800,7 +2800,7 @@ void ModelWidget::removeObjects(bool cascade) tab_obj=dynamic_cast(ref_obj); //Store the base relationships in a auxiliary list to be processed ahead - if(ref_obj->getObjectType()==ObjBaseRelationship) + if(ref_obj->getObjectType()==ObjectType::ObjBaseRelationship) { aux_sel_objs.push_back(ref_obj); } @@ -2808,7 +2808,7 @@ void ModelWidget::removeObjects(bool cascade) else if(objs_map.count(obj_id)==0 && (!tab_obj || (tab_obj && !tab_obj->isAddedByRelationship()))) { - parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjDatabase); + parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjectType::ObjDatabase); parent_name=(tab_obj ? tab_obj->getParentTable()->getName(true) : QString()); obj_name=(tab_obj ? tab_obj->getName() : ref_obj->getSignature()); @@ -2830,7 +2830,7 @@ void ModelWidget::removeObjects(bool cascade) obj_id=object->getObjectId(); //If the object is as FK relationship remove the foreign keys that generates it - if(obj_type==ObjBaseRelationship) + if(obj_type==ObjectType::ObjBaseRelationship) { rel = dynamic_cast(object); @@ -2845,7 +2845,7 @@ void ModelWidget::removeObjects(bool cascade) tab_obj->getName(true), tab_obj->getObjectType(), tab_obj->getParentTable()->getName(true), - ObjTable); + ObjectType::ObjTable); } } @@ -2856,7 +2856,7 @@ void ModelWidget::removeObjects(bool cascade) obj_name=(tab_obj ? object->getName(true) : object->getSignature()); parent_name=(tab_obj ? tab_obj->getParentTable()->getName(true) : QString()); - parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjDatabase); + parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjectType::ObjDatabase); objs_map[object->getObjectId()]=std::make_tuple(object, obj_name, @@ -2882,9 +2882,9 @@ void ModelWidget::removeObjects(bool cascade) parent_type=std::get<4>(ritr->second); ritr++; - if(obj_type==ObjBaseRelationship) + if(obj_type==ObjectType::ObjBaseRelationship) continue; - else if(parent_type!=ObjDatabase) + else if(parent_type!=ObjectType::ObjDatabase) { /* If the parent table does not exist on the model of the object to be removed * does not exists in parent table, it'll not be processed */ @@ -2925,7 +2925,7 @@ void ModelWidget::removeObjects(bool cascade) try { //If the object is a column validates the column removal before remove it - if(!cascade && obj_type==ObjColumn) + if(!cascade && obj_type==ObjectType::ObjColumn) db_model->validateColumnRemoval(dynamic_cast(tab_obj)); //Register the removed object on the operation list @@ -2936,7 +2936,7 @@ void ModelWidget::removeObjects(bool cascade) aux_table=dynamic_cast
(table); - if(aux_table && obj_type==ObjConstraint && + if(aux_table && obj_type==ObjectType::ObjConstraint && dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::foreign_key) db_model->updateTableFKRelationships(aux_table); @@ -2964,7 +2964,7 @@ void ModelWidget::removeObjects(bool cascade) if(obj_idx >=0 ) { - if(obj_type==ObjRelationship) + if(obj_type==ObjectType::ObjRelationship) { rel=dynamic_cast(object); src_table=rel->getTable(BaseRelationship::SrcTable); @@ -3115,7 +3115,7 @@ void ModelWidget::enableModelActions(bool value) void ModelWidget::configureSubmenu(BaseObject *object) { vector sel_objs; - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; bool tab_or_view=false, accepts_owner=false, accepts_schema=false; if(object) @@ -3130,7 +3130,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) obj_type=obj->getObjectType(); if(!tab_or_view) - tab_or_view=(obj_type==ObjTable || obj_type==ObjView); + tab_or_view=(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); if(!accepts_owner) accepts_owner=obj->acceptsOwner(); @@ -3151,16 +3151,16 @@ void ModelWidget::configureSubmenu(BaseObject *object) map act_map; QStringList name_list; QMenu *menus[]={ &schemas_menu, &owners_menu, &tags_menu }; - ObjectType types[]={ ObjSchema, ObjRole, ObjTag }; + ObjectType types[]={ ObjectType::ObjSchema, ObjectType::ObjRole, ObjectType::ObjTag }; for(unsigned i=0; i < 3; i++) { menus[i]->clear(); //Configuring actions "Move to schema", "Change Owner" and "Set tag" - if((types[i] == ObjSchema && accepts_schema) || - (types[i] == ObjRole && accepts_owner) || - (types[i]==ObjTag && tab_or_view)) + if((types[i] == ObjectType::ObjSchema && accepts_schema) || + (types[i] == ObjectType::ObjRole && accepts_owner) || + (types[i]==ObjectType::ObjTag && tab_or_view)) { obj_list=db_model->getObjects(types[i]); @@ -3171,7 +3171,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } else { - if(types[i] == ObjTag) + if(types[i] == ObjectType::ObjTag) { menus[i]->addAction(trUtf8("None"), this, SLOT(setTag())); menus[i]->addSeparator(); @@ -3219,7 +3219,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } //Display the quick rename action is a single object is selected - if(object && obj_type!=ObjCast) + if(object && obj_type!=ObjectType::ObjCast) { quick_actions_menu.addAction(action_rename); action_rename->setData(QVariant::fromValue(object)); @@ -3240,7 +3240,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) action_edit_perms->setData(QVariant::fromValue(object)); } - if(object && obj_type == ObjTable) + if(object && obj_type == ObjectType::ObjTable) quick_actions_menu.addAction(action_edit_data); if(object && BaseObject::acceptsCustomSQL(obj_type)) @@ -3250,7 +3250,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } if(object && - ((!TableObject::isTableObject(obj_type) && obj_type!=ObjTextbox && obj_type!=ObjBaseRelationship) || + ((!TableObject::isTableObject(obj_type) && obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjBaseRelationship) || (TableObject::isTableObject(obj_type) && !dynamic_cast(object)->isAddedByRelationship()))) { action_enable_sql->setData(QVariant::fromValue(object)); @@ -3271,7 +3271,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) void ModelWidget::configureFadeMenu(void) { bool is_db_selected = (selected_objects.empty() || - (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjDatabase)); + (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::ObjDatabase)); fade_menu.clear(); fade_in_menu.clear(); fade_out_menu.clear(); @@ -3286,7 +3286,7 @@ void ModelWidget::configureFadeMenu(void) if(is_db_selected) { QAction *action = nullptr; - vector types = { ObjSchema, ObjTable, ObjView, ObjRelationship, ObjTextbox }; + vector types = { ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjRelationship, ObjectType::ObjTextbox }; QStringList labels = { trUtf8("Schemas"), trUtf8("Tables"), trUtf8("Views"), trUtf8("Relationships"), trUtf8("Textboxes") }; unsigned id = 0; @@ -3308,13 +3308,13 @@ void ModelWidget::configureFadeMenu(void) } action = new QAction(trUtf8("All objects"), &fade_in_menu); - action->setData(ObjBaseObject); + action->setData(ObjectType::ObjBaseObject); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); fade_in_menu.addSeparator(); fade_in_menu.addAction(action); action = new QAction(trUtf8("All objects"), &fade_out_menu); - action->setData(ObjBaseObject); + action->setData(ObjectType::ObjBaseObject); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); fade_out_menu.addSeparator(); fade_out_menu.addAction(action); @@ -3329,7 +3329,7 @@ void ModelWidget::configureFadeMenu(void) { ObjectType obj_type = selected_objects[0]->getObjectType(); - if(obj_type == ObjTag) + if(obj_type == ObjectType::ObjTag) { fade_menu.addAction(action_fade_in); fade_menu.addAction(action_fade_out); @@ -3354,7 +3354,7 @@ void ModelWidget::configureFadeMenu(void) } } - if(obj_type == ObjTable || obj_type == ObjView) + if(obj_type == ObjectType::ObjTable || obj_type == ObjectType::ObjView) { fade_menu.addAction(action_fade_rels); action_fade_rels->setText(trUtf8("Table && Relationships")); @@ -3402,15 +3402,15 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) vector list; //If the database object is selected or there is no object select - if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjDatabase)) + if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::ObjDatabase)) { ObjectType obj_type = static_cast(action->data().toUInt()); - //If the action contains a data of type ObjBaseObject means that the user wants to fade all objects - if(obj_type == ObjBaseObject) + //If the action contains a data of type ObjectType::ObjBaseObject means that the user wants to fade all objects + if(obj_type == ObjectType::ObjBaseObject) { - vector types = { ObjSchema, ObjTable, ObjView, - ObjRelationship, ObjBaseRelationship, ObjTextbox}; + vector types = { ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView, + ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjTextbox}; for(ObjectType type : types) { @@ -3424,18 +3424,18 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) //Fading objects of a certain type list = *db_model->getObjectList(obj_type); - if(obj_type == ObjRelationship) + if(obj_type == ObjectType::ObjRelationship) { list.insert(list.end(), - db_model->getObjectList(ObjBaseRelationship)->begin(), - db_model->getObjectList(ObjBaseRelationship)->end()); + db_model->getObjectList(ObjectType::ObjBaseRelationship)->begin(), + db_model->getObjectList(ObjectType::ObjBaseRelationship)->end()); } } } else { //For tag object the fade is applied in the tables/views related to it - if(selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjTag) + if(selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::ObjTag) db_model->getObjectReferences(selected_objects[0], list); else { @@ -3482,8 +3482,8 @@ void ModelWidget::toggleAllExtendedAttributes(bool value) vector objects; this->scene->clearSelection(); - objects.assign(db_model->getObjectList(ObjTable)->begin(), db_model->getObjectList(ObjTable)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjView)->begin(), db_model->getObjectList(ObjView)->end()); + objects.assign(db_model->getObjectList(ObjectType::ObjTable)->begin(), db_model->getObjectList(ObjectType::ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjView)->begin(), db_model->getObjectList(ObjectType::ObjView)->end()); for(auto obj : objects) { @@ -3504,8 +3504,8 @@ void ModelWidget::toggleExtendedAttributes(void) if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0] == db_model)) { - objects.assign(db_model->getObjectList(ObjTable)->begin(), db_model->getObjectList(ObjTable)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjView)->begin(), db_model->getObjectList(ObjView)->end()); + objects.assign(db_model->getObjectList(ObjectType::ObjTable)->begin(), db_model->getObjectList(ObjectType::ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjView)->begin(), db_model->getObjectList(ObjectType::ObjView)->end()); } else objects = selected_objects; @@ -3521,7 +3521,7 @@ void ModelWidget::toggleExtendedAttributes(void) } } - db_model->setObjectsModified({ ObjSchema }); + db_model->setObjectsModified({ ObjectType::ObjSchema }); this->setModified(true); } @@ -3530,7 +3530,7 @@ void ModelWidget::toggleSchemasRectangles(void) bool visible = sender() == action_show_schemas_rects; Schema *schema = nullptr; - for(auto obj : *db_model->getObjectList(ObjSchema)) + for(auto obj : *db_model->getObjectList(ObjectType::ObjSchema)) { schema = dynamic_cast(obj); @@ -3546,8 +3546,8 @@ void ModelWidget::toggleSchemasRectangles(void) void ModelWidget::updateObjectsOpacity(void) { - vector types = { ObjSchema, ObjTable, ObjView, - ObjRelationship, ObjBaseRelationship, ObjTextbox}; + vector types = { ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView, + ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjTextbox}; BaseObjectView *obj_view = nullptr; BaseGraphicObject *base_obj = nullptr; @@ -3594,10 +3594,10 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Case there is no selected object or the selected object is the database model if(objects.empty() || (objects.size()==1 && objects[0]==db_model)) { - ObjectType types[]={ ObjAggregate, ObjCast, ObjEventTrigger, ObjCollation, ObjConversion, ObjDomain, - ObjExtension, ObjFunction, ObjGenericSQL, ObjLanguage, ObjOpClass, ObjOperator, - ObjOpFamily, ObjRelationship, ObjRole, ObjSchema, ObjSequence, - ObjTable, ObjTablespace, ObjTextbox, ObjType, ObjView, ObjTag }; + ObjectType types[]={ ObjectType::ObjAggregate, ObjectType::ObjCast, ObjectType::ObjEventTrigger, ObjectType::ObjCollation, ObjectType::ObjConversion, ObjectType::ObjDomain, + ObjectType::ObjExtension, ObjectType::ObjFunction, ObjectType::ObjGenericSQL, ObjectType::ObjLanguage, ObjectType::ObjOpClass, ObjectType::ObjOperator, + ObjectType::ObjOpFamily, ObjectType::ObjRelationship, ObjectType::ObjRole, ObjectType::ObjSchema, ObjectType::ObjSequence, + ObjectType::ObjTable, ObjectType::ObjTablespace, ObjectType::ObjTextbox, ObjectType::ObjType, ObjectType::ObjView, ObjectType::ObjTag }; unsigned cnt = sizeof(types)/sizeof(ObjectType); //Configures the "New object" menu with the types at database level @@ -3634,28 +3634,28 @@ void ModelWidget::configurePopupMenu(const vector &objects) configureSubmenu(obj); popup_menu.addAction(action_edit); - if((obj_type==ObjSchema && obj->isSystemObject()) || - (!obj->isProtected() && (obj_type==ObjTable || obj_type==ObjBaseRelationship || - obj_type==ObjRelationship || obj_type==ObjSchema || - obj_type == ObjTag || obj_type==ObjView))) + if((obj_type==ObjectType::ObjSchema && obj->isSystemObject()) || + (!obj->isProtected() && (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjBaseRelationship || + obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjSchema || + obj_type == ObjectType::ObjTag || obj_type==ObjectType::ObjView))) { - if(obj_type==ObjTable || obj_type == ObjView) + if(obj_type==ObjectType::ObjTable || obj_type == ObjectType::ObjView) { for(auto type : BaseObject::getChildObjectTypes(obj_type)) new_object_menu.addAction(actions_new_objects[type]); - if(obj_type==ObjTable) - new_object_menu.addAction(actions_new_objects[ObjRelationship]); + if(obj_type==ObjectType::ObjTable) + new_object_menu.addAction(actions_new_objects[ObjectType::ObjRelationship]); action_new_object->setMenu(&new_object_menu); popup_menu.insertAction(action_quick_actions, action_new_object); } - else if(obj_type==ObjRelationship || obj_type==ObjBaseRelationship) + else if(obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjBaseRelationship) { - if(obj_type==ObjRelationship) + if(obj_type==ObjectType::ObjRelationship) { - new_object_menu.addAction(actions_new_objects[ObjColumn]); - new_object_menu.addAction(actions_new_objects[ObjConstraint]); + new_object_menu.addAction(actions_new_objects[ObjectType::ObjColumn]); + new_object_menu.addAction(actions_new_objects[ObjectType::ObjConstraint]); action_new_object->setMenu(&new_object_menu); popup_menu.insertAction(action_quick_actions, action_new_object); @@ -3692,9 +3692,9 @@ void ModelWidget::configurePopupMenu(const vector &objects) action->setData(QVariant::fromValue(reinterpret_cast(rel->getTable(BaseRelationship::DstTable)))); } } - else if(obj_type == ObjSchema) + else if(obj_type == ObjectType::ObjSchema) { - for(auto type : BaseObject::getChildObjectTypes(ObjSchema)) + for(auto type : BaseObject::getChildObjectTypes(ObjectType::ObjSchema)) new_object_menu.addAction(actions_new_objects[type]); action_new_object->setMenu(&new_object_menu); @@ -3703,7 +3703,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) popup_menu.addAction(action_sel_sch_children); action_sel_sch_children->setData(QVariant::fromValue(obj)); } - else if(obj_type == ObjTag) + else if(obj_type == ObjectType::ObjTag) { popup_menu.addAction(action_sel_tagged_tabs); action_sel_tagged_tabs->setData(QVariant::fromValue(obj)); @@ -3724,7 +3724,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) action_deps_refs->setData(QVariant::fromValue(obj)); tab_obj=dynamic_cast(obj); - if(tab_obj && tab_obj->getObjectType()==ObjColumn) + if(tab_obj && tab_obj->getObjectType()==ObjectType::ObjColumn) { Column *col=dynamic_cast(tab_obj); @@ -3763,7 +3763,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) for(auto &obj : objects) { - rem_points = obj->getObjectType() == ObjRelationship || obj->getObjectType() == ObjBaseRelationship; + rem_points = obj->getObjectType() == ObjectType::ObjRelationship || obj->getObjectType() == ObjectType::ObjBaseRelationship; if(!rem_points) break; } @@ -3783,7 +3783,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) /* Special case for systema objects: The actions protect/unprotect will be displayed only for system schemas. The rest of system objects those actions aren't available */ if(!objects[0]->isSystemObject() || - (objects[0]->isSystemObject() && objects[0]->getObjectType()==ObjSchema)) + (objects[0]->isSystemObject() && objects[0]->getObjectType()==ObjectType::ObjSchema)) { if(!objects[0]->isProtected()) popup_menu.addAction(action_protect); @@ -3794,10 +3794,10 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Adding the extended attributes action (only for table/view/database) if(objects.size() > 1 || - (objects.empty() && (db_model->getObjectCount(ObjTable) > 0 || db_model->getObjectCount(ObjView) > 0)) || - (objects.size() == 1 && (objects[0]->getObjectType() == ObjTable || - objects[0]->getObjectType() == ObjView || - objects[0]->getObjectType() == ObjDatabase))) + (objects.empty() && (db_model->getObjectCount(ObjectType::ObjTable) > 0 || db_model->getObjectCount(ObjectType::ObjView) > 0)) || + (objects.size() == 1 && (objects[0]->getObjectType() == ObjectType::ObjTable || + objects[0]->getObjectType() == ObjectType::ObjView || + objects[0]->getObjectType() == ObjectType::ObjDatabase))) { bool tab_or_view = false; @@ -3805,7 +3805,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { if(!tab_or_view) { - tab_or_view=(obj->getObjectType()==ObjTable || obj->getObjectType()==ObjView); + tab_or_view=(obj->getObjectType()==ObjectType::ObjTable || obj->getObjectType()==ObjectType::ObjView); break; } } @@ -3813,14 +3813,14 @@ void ModelWidget::configurePopupMenu(const vector &objects) if(tab_or_view || objects.empty() || objects.size() == 1) popup_menu.addAction(action_extended_attribs); - if(objects.empty() || (objects.size() == 1 && objects[0]->getObjectType() == ObjDatabase)) + if(objects.empty() || (objects.size() == 1 && objects[0]->getObjectType() == ObjectType::ObjDatabase)) popup_menu.addAction(action_schemas_rects); } if(!tab_obj && (objects.empty() || objects.size() > 1 || - (objects.size() == 1 && (objects[0]->getObjectType() == ObjDatabase || - objects[0]->getObjectType() == ObjTag || + (objects.size() == 1 && (objects[0]->getObjectType() == ObjectType::ObjDatabase || + objects[0]->getObjectType() == ObjectType::ObjTag || BaseGraphicObject::isGraphicObject(objects[0]->getObjectType()))))) { //Adding fade inout action only for graphical objects or when there is no objects selected or many objects seleted @@ -3831,7 +3831,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Adding the copy and paste if there is selected objects if(!model_protected && - !(objects.size()==1 && (objects[0]==db_model || objects[0]->getObjectType()==ObjBaseRelationship)) && + !(objects.size()==1 && (objects[0]==db_model || objects[0]->getObjectType()==ObjectType::ObjBaseRelationship)) && !objects.empty()) { popup_menu.addAction(action_copy); @@ -3858,8 +3858,8 @@ void ModelWidget::configurePopupMenu(const vector &objects) 4) The object is a base relationship (table-view) */ if((tab_obj && !tab_obj->isAddedByRelationship() && !tab_obj->isProtected()) || (objects.size()==1 && objects[0]->isProtected()) || - (!tab_obj && objects.size()==1 && objects[0]!=db_model && objects[0]->getObjectType()!=ObjBaseRelationship) || - (objects.size()==1 && objects[0]->getObjectType()==ObjBaseRelationship && + (!tab_obj && objects.size()==1 && objects[0]!=db_model && objects[0]->getObjectType()!=ObjectType::ObjBaseRelationship) || + (objects.size()==1 && objects[0]->getObjectType()==ObjectType::ObjBaseRelationship && dynamic_cast(objects[0])->getRelationshipType()==BaseRelationship::RelationshipFk) || objects.size() > 1) { @@ -3872,7 +3872,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { table=dynamic_cast
(tab_obj->getParentTable()); - if(tab_obj->getObjectType()==ObjColumn) + if(tab_obj->getObjectType()==ObjectType::ObjColumn) { count=table->getConstraintCount(); @@ -3892,7 +3892,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) //For each constaint is created a menu with the edit, source code, protect/unprotect and delete actions submenu=new QMenu(&popup_menu); - submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjConstraint) + str_aux))); + submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::ObjConstraint) + str_aux))); submenu->setTitle(constr->getName()); action=new QAction(dynamic_cast(submenu)); @@ -3953,7 +3953,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { submenu=new QMenu(&popup_menu); submenu->setTitle(trUtf8("Constraints")); - submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjConstraint) + QString("_grp")))); + submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::ObjConstraint) + QString("_grp")))); count=submenus.size(); for(i=0; i < count; i++) submenu->addMenu(submenus[i]); @@ -4041,7 +4041,7 @@ void ModelWidget::highlightObject(void) void ModelWidget::toggleNewObjectOverlay(void) { if(new_obj_overlay_wgt->isHidden() && - (selected_objects.empty() || selected_objects[0]->getObjectType()!=ObjBaseRelationship)) + (selected_objects.empty() || selected_objects[0]->getObjectType()!=ObjectType::ObjBaseRelationship)) { new_obj_overlay_wgt->raise(); new_obj_overlay_wgt->show(); @@ -4088,7 +4088,7 @@ void ModelWidget::createSequenceFromColumn(void) //Creates a sequence which name is like the ones auto generated by PostgreSQL seq=new Sequence; seq->setName(BaseObject::formatName(tab->getName() + QString("_") + col->getName() + QString("_seq"))); - seq->setName(PgModelerNs::generateUniqueName(seq, *db_model->getObjectList(ObjSequence), false)); + seq->setName(PgModelerNs::generateUniqueName(seq, *db_model->getObjectList(ObjectType::ObjSequence), false)); seq->setSchema(tab->getSchema()); seq->setDefaultValues(col->getType()); @@ -4231,8 +4231,8 @@ void ModelWidget::removeRelationshipPoints(void) { vector rels; - rels = *db_model->getObjectList(ObjBaseRelationship); - rels.insert(rels.end(), db_model->getObjectList(ObjRelationship)->begin(), db_model->getObjectList(ObjRelationship)->end()); + rels = *db_model->getObjectList(ObjectType::ObjBaseRelationship); + rels.insert(rels.end(), db_model->getObjectList(ObjectType::ObjRelationship)->begin(), db_model->getObjectList(ObjectType::ObjRelationship)->end()); op_list->startOperationChain(); for(auto &obj : rels) @@ -4273,7 +4273,7 @@ void ModelWidget::rearrangeSchemasInGrid(QPointF origin, unsigned tabs_per_row, unsigned sch_id=0; double x=origin.x(), y=origin.y(), max_y=-1, cy=0; - objects=db_model->getObjectList(ObjSchema); + objects=db_model->getObjectList(ObjectType::ObjSchema); for(BaseObject *obj : *objects) { @@ -4316,13 +4316,13 @@ void ModelWidget::rearrangeSchemasInGrid(QPointF origin, unsigned tabs_per_row, } } - objects=db_model->getObjectList(ObjRelationship); + objects=db_model->getObjectList(ObjectType::ObjRelationship); for(BaseObject *obj : *objects) { dynamic_cast(obj)->setModified(true); } - objects=db_model->getObjectList(ObjBaseRelationship); + objects=db_model->getObjectList(ObjectType::ObjBaseRelationship); for(BaseObject *obj : *objects) { dynamic_cast(obj)->setModified(true); @@ -4344,8 +4344,8 @@ void ModelWidget::rearrangeTablesInGrid(Schema *schema, QPointF origin, unsigned double max_y=-1, x=origin.x(), y=origin.y(), cy=0; //Get the tables and views for the specified schema - tables=db_model->getObjects(ObjTable, schema); - views=db_model->getObjects(ObjView, schema); + tables=db_model->getObjects(ObjectType::ObjTable, schema); + views=db_model->getObjects(ObjectType::ObjView, schema); tables.insert(tables.end(), views.begin(), views.end()); itr=tables.begin(); @@ -4431,8 +4431,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) scene->clearSelection(); - objects.assign(db_model->getObjectList(ObjTable)->begin(), db_model->getObjectList(ObjTable)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjView)->begin(), db_model->getObjectList(ObjView)->end()); + objects.assign(db_model->getObjectList(ObjectType::ObjTable)->begin(), db_model->getObjectList(ObjectType::ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjView)->begin(), db_model->getObjectList(ObjectType::ObjView)->end()); //We determine the root by searching the table/view which contains the more amount of relationships connected for(auto obj : objects) @@ -4464,8 +4464,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) max_w = items_rect.width(); objects.clear(); - objects.assign(db_model->getObjectList(ObjTable)->begin(), db_model->getObjectList(ObjTable)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjView)->begin(), db_model->getObjectList(ObjView)->end()); + objects.assign(db_model->getObjectList(ObjectType::ObjTable)->begin(), db_model->getObjectList(ObjectType::ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjView)->begin(), db_model->getObjectList(ObjectType::ObjView)->end()); //Retrieving the rest of tables/views that were not evaluated in the previous iteration std::sort(objects.begin(), objects.end()); @@ -4519,7 +4519,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) //Repositioning remaining tables (without relationships) and textboxes objects.clear(); objects.assign(not_linked_tabs.begin(), not_linked_tabs.end()); - objects.insert(objects.end(), db_model->getObjectList(ObjTextbox)->begin(), db_model->getObjectList(ObjTextbox)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjTextbox)->begin(), db_model->getObjectList(ObjectType::ObjTextbox)->end()); px = 50; py = items_rect.bottom() + 100; @@ -4542,8 +4542,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) } objects.clear(); - objects.assign(db_model->getObjectList(ObjRelationship)->begin(), db_model->getObjectList(ObjRelationship)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjBaseRelationship)->begin(), db_model->getObjectList(ObjBaseRelationship)->end()); + objects.assign(db_model->getObjectList(ObjectType::ObjRelationship)->begin(), db_model->getObjectList(ObjectType::ObjRelationship)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->begin(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->end()); for(auto obj : objects) { @@ -4557,7 +4557,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) breakRelationshipLine(dynamic_cast(obj), ModelWidget::BreakVert2NinetyDegrees); } - db_model->setObjectsModified({ ObjTable, ObjView, ObjSchema, ObjRelationship, ObjBaseRelationship }); + db_model->setObjectsModified({ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjSchema, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); } else { @@ -4650,8 +4650,8 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) if(!schema) return; - tables = db_model->getObjects(ObjTable, schema); - views = db_model->getObjects(ObjView, schema); + tables = db_model->getObjects(ObjectType::ObjTable, schema); + views = db_model->getObjects(ObjectType::ObjView, schema); tables.insert(tables.end(), views.begin(), views.end()); if(!tables.empty()) @@ -4774,13 +4774,13 @@ void ModelWidget::rearrangeTablesInSchemas(void) random_device rand_seed; default_random_engine rand_num_engine; double max_w = 1000, max_h = 1000; - vector schemas = *db_model->getObjectList(ObjSchema), rels; + vector schemas = *db_model->getObjectList(ObjectType::ObjSchema), rels; bool has_collision = false; uniform_int_distribution dist_x(0, max_w), dist_y(0, max_h); unsigned tries = 0, - max_tries = (db_model->getObjectCount(ObjTable) + - db_model->getObjectCount(ObjView) + - db_model->getObjectCount(ObjSchema)) * 100; + max_tries = (db_model->getObjectCount(ObjectType::ObjTable) + + db_model->getObjectCount(ObjectType::ObjView) + + db_model->getObjectCount(ObjectType::ObjSchema)) * 100; rand_num_engine.seed(rand_seed()); @@ -4849,8 +4849,8 @@ void ModelWidget::rearrangeTablesInSchemas(void) } //Removing all custom points from relationships - rels.assign(db_model->getObjectList(ObjRelationship)->begin(), db_model->getObjectList(ObjRelationship)->end()); - rels.insert(rels.end(), db_model->getObjectList(ObjBaseRelationship)->begin(), db_model->getObjectList(ObjBaseRelationship)->end()); + rels.assign(db_model->getObjectList(ObjectType::ObjRelationship)->begin(), db_model->getObjectList(ObjectType::ObjRelationship)->end()); + rels.insert(rels.end(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->begin(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->end()); for(auto &rel : rels) { @@ -4859,7 +4859,7 @@ void ModelWidget::rearrangeTablesInSchemas(void) base_rel->resetLabelsDistance(); } - db_model->setObjectsModified({ ObjTable, ObjView, ObjSchema, ObjRelationship, ObjBaseRelationship }); + db_model->setObjectsModified({ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjSchema, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); adjustSceneSize(); viewport->updateScene({ scene->sceneRect() }); } diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index b45ceff92d..86362da154 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -29,34 +29,34 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par int action_idx=0; QList rel_actions=parent->rels_menu->actions(); map> obj_shortcuts={ - { aggregate_tb, std::make_tuple(trUtf8("A"), ObjAggregate) }, - { cast_tb, std::make_tuple(trUtf8("G"), ObjCast) }, - { eventtrigger_tb, std::make_tuple(trUtf8("K"), ObjEventTrigger)}, - { collation_tb, std::make_tuple(trUtf8("H"), ObjCollation) }, - { conversion_tb, std::make_tuple(trUtf8("J"), ObjConversion) }, - { domain_tb, std::make_tuple(trUtf8("D"), ObjDomain) }, - { extension_tb, std::make_tuple(trUtf8("E"), ObjExtension) }, - { function_tb, std::make_tuple(trUtf8("F"), ObjFunction) }, - { language_tb, std::make_tuple(trUtf8("L"), ObjLanguage) }, - { opclass_tb, std::make_tuple(trUtf8("O"), ObjOpClass) }, - { operator_tb, std::make_tuple(trUtf8("U"), ObjOperator) }, - { opfamily_tb, std::make_tuple(trUtf8("I"), ObjOpFamily) }, - { role_tb, std::make_tuple(trUtf8("R"), ObjRole) }, - { schema_tb, std::make_tuple(trUtf8("S"), ObjSchema) }, - { sequence_tb, std::make_tuple(trUtf8("Q"), ObjSequence) }, - { table_tb, std::make_tuple(trUtf8("T"), ObjTable) }, - { tablespace_tb, std::make_tuple(trUtf8("P"), ObjTablespace) }, - { textbox_tb, std::make_tuple(trUtf8("M"), ObjTextbox) }, - { type_tb, std::make_tuple(trUtf8("Y"), ObjType) }, - { view_tb, std::make_tuple(trUtf8("W"), ObjView) }, - { tag_tb, std::make_tuple(trUtf8("9"), ObjTag) }, - { constraint_tb, std::make_tuple(trUtf8("Z"), ObjConstraint) }, - { index_tb, std::make_tuple(trUtf8("X"), ObjIndex) }, - { column_tb, std::make_tuple(trUtf8("C"), ObjColumn) }, - { rule_tb, std::make_tuple(trUtf8("V"), ObjRule) }, - { trigger_tb, std::make_tuple(trUtf8("B"), ObjTrigger) }, - { policy_tb, std::make_tuple(trUtf8("9"), ObjPolicy) }, - { genericsql_tb, std::make_tuple(trUtf8("8"), ObjGenericSQL) } }; + { aggregate_tb, std::make_tuple(trUtf8("A"), ObjectType::ObjAggregate) }, + { cast_tb, std::make_tuple(trUtf8("G"), ObjectType::ObjCast) }, + { eventtrigger_tb, std::make_tuple(trUtf8("K"), ObjectType::ObjEventTrigger)}, + { collation_tb, std::make_tuple(trUtf8("H"), ObjectType::ObjCollation) }, + { conversion_tb, std::make_tuple(trUtf8("J"), ObjectType::ObjConversion) }, + { domain_tb, std::make_tuple(trUtf8("D"), ObjectType::ObjDomain) }, + { extension_tb, std::make_tuple(trUtf8("E"), ObjectType::ObjExtension) }, + { function_tb, std::make_tuple(trUtf8("F"), ObjectType::ObjFunction) }, + { language_tb, std::make_tuple(trUtf8("L"), ObjectType::ObjLanguage) }, + { opclass_tb, std::make_tuple(trUtf8("O"), ObjectType::ObjOpClass) }, + { operator_tb, std::make_tuple(trUtf8("U"), ObjectType::ObjOperator) }, + { opfamily_tb, std::make_tuple(trUtf8("I"), ObjectType::ObjOpFamily) }, + { role_tb, std::make_tuple(trUtf8("R"), ObjectType::ObjRole) }, + { schema_tb, std::make_tuple(trUtf8("S"), ObjectType::ObjSchema) }, + { sequence_tb, std::make_tuple(trUtf8("Q"), ObjectType::ObjSequence) }, + { table_tb, std::make_tuple(trUtf8("T"), ObjectType::ObjTable) }, + { tablespace_tb, std::make_tuple(trUtf8("P"), ObjectType::ObjTablespace) }, + { textbox_tb, std::make_tuple(trUtf8("M"), ObjectType::ObjTextbox) }, + { type_tb, std::make_tuple(trUtf8("Y"), ObjectType::ObjType) }, + { view_tb, std::make_tuple(trUtf8("W"), ObjectType::ObjView) }, + { tag_tb, std::make_tuple(trUtf8("9"), ObjectType::ObjTag) }, + { constraint_tb, std::make_tuple(trUtf8("Z"), ObjectType::ObjConstraint) }, + { index_tb, std::make_tuple(trUtf8("X"), ObjectType::ObjIndex) }, + { column_tb, std::make_tuple(trUtf8("C"), ObjectType::ObjColumn) }, + { rule_tb, std::make_tuple(trUtf8("V"), ObjectType::ObjRule) }, + { trigger_tb, std::make_tuple(trUtf8("B"), ObjectType::ObjTrigger) }, + { policy_tb, std::make_tuple(trUtf8("9"), ObjectType::ObjPolicy) }, + { genericsql_tb, std::make_tuple(trUtf8("8"), ObjectType::ObjGenericSQL) } }; map> rel_shortcuts={ { rel11_tb, std::make_tuple(trUtf8("1"), 0) }, { rel1n_tb, std::make_tuple(trUtf8("2"), 1) }, @@ -107,26 +107,26 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par void NewObjectOverlayWidget::setSelectedObjects(vector &sel_objs) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; if(sel_objs.size()==1) obj_type=sel_objs.at(0)->getObjectType(); else if(sel_objs.empty()) - obj_type=ObjDatabase; - - db_objs_grp->setVisible(obj_type==ObjDatabase); - sch_objs_grp->setVisible(obj_type==ObjDatabase || obj_type==ObjSchema); - - tab_objs_grp->setVisible(obj_type==ObjTable || obj_type==ObjView || obj_type==ObjRelationship); - column_tb->setDisabled(obj_type==ObjView); - constraint_tb->setDisabled(obj_type==ObjView); - index_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); - rule_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); - trigger_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); - policy_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); - tab_perms_tb->setVisible(obj_type==ObjTable || obj_type==ObjView); - rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==ObjTable) || - (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==ObjTable && sel_objs.at(1)->getObjectType()==ObjTable)); + obj_type=ObjectType::ObjDatabase; + + db_objs_grp->setVisible(obj_type==ObjectType::ObjDatabase); + sch_objs_grp->setVisible(obj_type==ObjectType::ObjDatabase || obj_type==ObjectType::ObjSchema); + + tab_objs_grp->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView || obj_type==ObjectType::ObjRelationship); + column_tb->setDisabled(obj_type==ObjectType::ObjView); + constraint_tb->setDisabled(obj_type==ObjectType::ObjView); + index_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); + rule_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); + trigger_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); + policy_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); + tab_perms_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); + rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==ObjectType::ObjTable) || + (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==ObjectType::ObjTable && sel_objs.at(1)->getObjectType()==ObjectType::ObjTable)); overlay_frm->adjustSize(); this->adjustSize(); diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index d7a4ac750e..142b063bf0 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -22,7 +22,7 @@ ObjectDepsRefsWidget::ObjectDepsRefsWidget(QWidget *parent): BaseObjectWidget(parent) { Ui_ObjectDepsRefsWidget::setupUi(this); - configureFormLayout(objectdepsrefs_grid, ObjBaseObject); + configureFormLayout(objectdepsrefs_grid, ObjectType::ObjBaseObject); PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); @@ -116,7 +116,7 @@ void ObjectDepsRefsWidget::handleItemSelection(QTableWidgetItem *item) { parent=dynamic_cast(this->object)->getParentTable(); - if(parent->getObjectType()==ObjTable) + if(parent->getObjectType()==ObjectType::ObjTable) parent_tab=dynamic_cast
(parent); else parent_view=dynamic_cast(parent); diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 1348526381..6def0b625d 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -104,7 +104,7 @@ void ObjectFinderWidget::fadeObjects(void) vector objects, other_objs; bool fade_listed = false; - for(auto obj_type : {ObjTable, ObjView, ObjTextbox, ObjRelationship, ObjBaseRelationship, ObjSchema}) + for(auto obj_type : {ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjTextbox, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjSchema}) { objects.insert(objects.end(), model_wgt->getDatabaseModel()->getObjectList(obj_type)->begin(), @@ -137,7 +137,7 @@ void ObjectFinderWidget::selectObjects(void) BaseGraphicObject *graph_obj = nullptr; bool sel_listed = false; - for(auto obj_type : {ObjTable, ObjView, ObjTextbox, ObjRelationship, ObjBaseRelationship, ObjSchema}) + for(auto obj_type : {ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjTextbox, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjSchema}) { objects.insert(objects.end(), model_wgt->getDatabaseModel()->getObjectList(obj_type)->begin(), @@ -291,8 +291,8 @@ void ObjectFinderWidget::editObject(void) { if(selected_obj) { - if(selected_obj->getObjectType()==ObjPermission) - model_wgt->showObjectForm(ObjPermission, dynamic_cast(selected_obj)->getObject()); + if(selected_obj->getObjectType()==ObjectType::ObjPermission) + model_wgt->showObjectForm(ObjectType::ObjPermission, dynamic_cast(selected_obj)->getObject()); else { vector vect; @@ -330,7 +330,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorgetObjectType()==ObjBaseRelationship) + if(objs[i]->getObjectType()==ObjectType::ObjBaseRelationship) str_aux=QString("tv"); else str_aux.clear(); @@ -466,7 +466,7 @@ void ObjectFinderWidget::updateObjectTypeList(QListWidget *list_wgt) { item=new QListWidgetItem; - if(types[type_id]==ObjBaseRelationship) + if(types[type_id]==ObjectType::ObjBaseRelationship) str_aux=QString(BaseObject::getSchemaName(types[type_id])) + QString("tv"); else str_aux=QString(BaseObject::getSchemaName(types[type_id])); diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index cbf627eddf..2dd5f22f49 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -76,7 +76,7 @@ void ObjectRenameWidget::hideEvent(QHideEvent *) void ObjectRenameWidget::applyRenaming(void) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; try { @@ -92,13 +92,13 @@ void ObjectRenameWidget::applyRenaming(void) obj_type=object->getObjectType(); - if(obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjDatabase) { //Register the object on operations list before the modification op_list->registerObject(object, Operation::ObjectModified, -1, (tab_obj ? tab_obj->getParentTable() : nullptr)); //Format the object name to check if it will have a conflicting name - fmt_name=BaseObject::formatName(new_name_edt->text().toUtf8(), obj_type==ObjOperator); + fmt_name=BaseObject::formatName(new_name_edt->text().toUtf8(), obj_type==ObjectType::ObjOperator); if(object->getSchema()) fmt_name=object->getSchema()->getName(true) + QString(".") + fmt_name; @@ -135,8 +135,8 @@ void ObjectRenameWidget::applyRenaming(void) { obj_graph->setModified(true); - if(obj_graph->getObjectType()==ObjTable || - obj_graph->getObjectType()==ObjView) + if(obj_graph->getObjectType()==ObjectType::ObjTable || + obj_graph->getObjectType()==ObjectType::ObjView) { dynamic_cast(obj_graph->getSchema())->setModified(true); } @@ -155,7 +155,7 @@ void ObjectRenameWidget::applyRenaming(void) tab->setCodeInvalidated(true); dynamic_cast(tab->getSchema())->setModified(true); } - else if(object->getObjectType()==ObjSchema) + else if(object->getObjectType()==ObjectType::ObjSchema) { model->validateSchemaRenaming(dynamic_cast(object), obj_name_lbl->text().toUtf8()); dynamic_cast(object)->setModified(true); @@ -166,7 +166,7 @@ void ObjectRenameWidget::applyRenaming(void) for(auto &obj : ref_objs) { - if(obj->getObjectType()==ObjColumn) + if(obj->getObjectType()==ObjectType::ObjColumn) { col=dynamic_cast(obj); col->getParentTable()->setModified(true); @@ -184,7 +184,7 @@ void ObjectRenameWidget::applyRenaming(void) { Messagebox msg_box; - if(obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjDatabase) op_list->removeLastOperation(); msg_box.show(e); diff --git a/libpgmodeler_ui/src/objectsdiffinfo.cpp b/libpgmodeler_ui/src/objectsdiffinfo.cpp index 37129f8a25..9784f35b04 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.cpp +++ b/libpgmodeler_ui/src/objectsdiffinfo.cpp @@ -46,7 +46,7 @@ QString ObjectsDiffInfo::getInfoMessage(void) { QString msg=QString("%1 `%2' (%3)"), obj_name; BaseObject *ref_obj=nullptr; - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; if(diff_type==AlterObject && old_object) ref_obj=old_object; @@ -58,9 +58,9 @@ QString ObjectsDiffInfo::getInfoMessage(void) /* Forcing the usage of BaseObject::getSignature for the following object, since the custom getSignature for those types return some undesired SQL keywords for this context */ - if(obj_type==ObjConstraint || obj_type==ObjTrigger || obj_type==ObjRule) + if(obj_type==ObjectType::ObjConstraint || obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule) obj_name=dynamic_cast(ref_obj)->TableObject::getSignature(); - else if(obj_type==ObjOpClass || obj_type==ObjOpFamily) + else if(obj_type==ObjectType::ObjOpClass || obj_type==ObjectType::ObjOpFamily) obj_name=ref_obj->BaseObject::getSignature(); else obj_name=ref_obj->getSignature(); diff --git a/libpgmodeler_ui/src/objectselectorwidget.cpp b/libpgmodeler_ui/src/objectselectorwidget.cpp index 6b5866d278..8c4d382a00 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.cpp +++ b/libpgmodeler_ui/src/objectselectorwidget.cpp @@ -129,7 +129,7 @@ void ObjectSelectorWidget::setSelectedObject(BaseObject *object) rem_object_tb->setEnabled(object); this->selected_obj=object; - if(object->getObjectType()!=ObjConstraint) + if(object->getObjectType()!=ObjectType::ObjConstraint) obj_name_txt->setPlainText(selected_obj->getSignature()); else obj_name_txt->setPlainText(QString("%1.%2") diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 67c53f7fcb..13c65fa738 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -95,7 +95,7 @@ void OperationListWidget::updateOperationList(void) str_aux=QString(BaseObject::getSchemaName(obj_type)); item->setData(0, Qt::UserRole, QVariant(obj_type)); - if(obj_type==ObjBaseRelationship) + if(obj_type==ObjectType::ObjBaseRelationship) str_aux+=QString("tv"); item->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(str_aux))); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 00e391dfea..37ac2d9506 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -18,7 +18,7 @@ #include "operatorclasswidget.h" -OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(parent, ObjOpClass) +OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjOpClass) { try { @@ -30,11 +30,11 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare Ui_OperatorClassWidget::setupUi(this); - family_sel=new ObjectSelectorWidget(ObjOpFamily, true, this); + family_sel=new ObjectSelectorWidget(ObjectType::ObjOpFamily, true, this); data_type=new PgSQLTypeWidget(this); - operator_sel=new ObjectSelectorWidget(ObjOperator, true, this); - elem_family_sel=new ObjectSelectorWidget(ObjOpFamily, true, this); - function_sel=new ObjectSelectorWidget(ObjFunction, true, this); + operator_sel=new ObjectSelectorWidget(ObjectType::ObjOperator, true, this); + elem_family_sel=new ObjectSelectorWidget(ObjectType::ObjOpFamily, true, this); + function_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); storage_type=new PgSQLTypeWidget(this, trUtf8("Storage Type")); elements_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::DuplicateButton, true, this); @@ -60,7 +60,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare grid->addWidget(data_type,4,0,1,5); grid->addWidget(elements_grp,5,0,1,5); this->setLayout(grid); - configureFormLayout(grid, ObjOpClass); + configureFormLayout(grid, ObjectType::ObjOpClass); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); @@ -150,7 +150,7 @@ void OperatorClassWidget::showElementData(OperatorClassElement elem, int lin_idx else { elements_tab->setCellText(*elem.getStorage(), lin_idx, 0); - elements_tab->setCellText(BaseObject::getTypeName(ObjType), lin_idx, 1); + elements_tab->setCellText(BaseObject::getTypeName(ObjectType::ObjType), lin_idx, 1); } if(elem_type!=OperatorClassElement::StorageElem) diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index 9604d3b6ca..0c409c23ac 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -18,7 +18,7 @@ #include "operatorfamilywidget.h" -OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(parent, ObjOpFamily) +OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjOpFamily) { QStringList types; map > fields_map; @@ -26,7 +26,7 @@ OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(pa QFrame *frame=nullptr; Ui_OperatorFamilyWidget::setupUi(this); - configureFormLayout(opfamily_grid, ObjOpFamily); + configureFormLayout(opfamily_grid, ObjectType::ObjOpFamily); IndexingType::getTypes(types); indexing_cmb->addItems(types); diff --git a/libpgmodeler_ui/src/operatorwidget.cpp b/libpgmodeler_ui/src/operatorwidget.cpp index b1ff890737..dea3b393fd 100644 --- a/libpgmodeler_ui/src/operatorwidget.cpp +++ b/libpgmodeler_ui/src/operatorwidget.cpp @@ -18,7 +18,7 @@ #include "operatorwidget.h" -OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, ObjOperator) +OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjOperator) { try { @@ -50,7 +50,7 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, ObjOpe for(i=Operator::FUNC_OPERATOR; i <= Operator::FUNC_RESTRICT; i++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(ObjFunction, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); if(i!=Operator::FUNC_OPERATOR) grid->addWidget(functions_sel[i],i,1,1,1); @@ -59,12 +59,12 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, ObjOpe for(i=Operator::OPER_COMMUTATOR, i1=3; i <= Operator::OPER_NEGATOR; i++,i1++) { operators_sel[i]=nullptr; - operators_sel[i]=new ObjectSelectorWidget(ObjOperator, true, this); + operators_sel[i]=new ObjectSelectorWidget(ObjectType::ObjOperator, true, this); grid->addWidget(operators_sel[i],i1,1,1,1); } operator_grid->addWidget(functions_sel[0],0,1,1,3); - configureFormLayout(operator_grid, ObjOperator); + configureFormLayout(operator_grid, ObjectType::ObjOperator); setRequiredField(operator_func_lbl); setRequiredField(functions_sel[0]); diff --git a/libpgmodeler_ui/src/parameterwidget.cpp b/libpgmodeler_ui/src/parameterwidget.cpp index 988cd5ee39..22232dc591 100644 --- a/libpgmodeler_ui/src/parameterwidget.cpp +++ b/libpgmodeler_ui/src/parameterwidget.cpp @@ -18,7 +18,7 @@ #include "parameterwidget.h" -ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, ObjParameter) +ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjParameter) { try { @@ -41,7 +41,7 @@ ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, ObjP parameter_grid->addWidget(data_type,2, 0, 1, 4); parameter_grid->addItem(spacer, parameter_grid->count()+1,0); - configureFormLayout(parameter_grid, ObjParameter); + configureFormLayout(parameter_grid, ObjectType::ObjParameter); connect(param_variadic_chk, SIGNAL(toggled(bool)), param_in_chk, SLOT(setDisabled(bool))); connect(param_variadic_chk, SIGNAL(toggled(bool)), param_out_chk, SLOT(setDisabled(bool))); connect(param_in_chk, SIGNAL(toggled(bool)), this, SLOT(enableVariadic(void))); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 08f72c8bdf..3de8db4fa9 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -18,7 +18,7 @@ #include "permissionwidget.h" -PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, ObjPermission) +PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjPermission) { QGridLayout *grid=nullptr; QFrame *frame=nullptr; @@ -39,7 +39,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob object_selection_wgt=new ModelObjectsWidget(true); permission=nullptr; - configureFormLayout(permission_grid, ObjPermission); + configureFormLayout(permission_grid, ObjectType::ObjPermission); name_edt->setReadOnly(true); comment_edt->setVisible(false); @@ -89,7 +89,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob } frame=generateInformationFrame(trUtf8("Leave the Roles grid empty in order to create a %1 applicable to PUBLIC.") - .arg(BaseObject::getTypeName(ObjPermission).toLower())); + .arg(BaseObject::getTypeName(ObjectType::ObjPermission).toLower())); permission_grid->addWidget(frame, permission_grid->count()+1, 0, 1, 0); frame->setParent(this); @@ -163,7 +163,7 @@ void PermissionWidget::setAttributes(DatabaseModel *model, BaseObject *parent_ob void PermissionWidget::selectRole(void) { - object_selection_wgt->setObjectVisible(ObjRole, true); + object_selection_wgt->setObjectVisible(ObjectType::ObjRole, true); object_selection_wgt->setModel(this->model); object_selection_wgt->show(); } @@ -317,7 +317,7 @@ void PermissionWidget::updatePermission(void) //Checking if the permission already exists on model perm_idx=model->getPermissionIndex(perm, false); - if(perm_idx < 0 || (perm_idx >=0 && model->getObject(perm_idx,ObjPermission)==permission)) + if(perm_idx < 0 || (perm_idx >=0 && model->getObject(perm_idx,ObjectType::ObjPermission)==permission)) { (*permission)=(*perm); listPermissions(); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 59e3fac25c..10a8c2ef70 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -90,7 +90,7 @@ namespace PgModelerUiNs { void disableObjectSQL(BaseObject *object, bool disable) { - if(object && object->getObjectType()!=ObjBaseRelationship) + if(object && object->getObjectType()!=ObjectType::ObjBaseRelationship) { Messagebox msgbox; ObjectType obj_type=object->getObjectType(); @@ -104,7 +104,7 @@ namespace PgModelerUiNs { object->setSQLDisabled(disable); - if(obj_type!=ObjDatabase && curr_val!=disable) + if(obj_type!=ObjectType::ObjDatabase && curr_val!=disable) { msgbox.show(QString(QT_TR_NOOP("Do you want to apply the SQL %1 status to the object's references too? This will avoid problems when exporting or validating the model.")).arg(disable ? QT_TR_NOOP("disabling") : QT_TR_NOOP("enabling")), Messagebox::ConfirmIcon, Messagebox::YesNoButtons); @@ -115,10 +115,10 @@ namespace PgModelerUiNs { /* Special case for tables. When disable the code there is the need to disable constraints codes when the code of parent table is disabled too in order to avoid export errors */ - if(object->getObjectType()==ObjTable) + if(object->getObjectType()==ObjectType::ObjTable) { Constraint *constr = nullptr; - vector *objects=dynamic_cast
(object)->getObjectList(ObjConstraint); + vector *objects=dynamic_cast
(object)->getObjectList(ObjectType::ObjConstraint); for(auto &obj : (*objects)) { @@ -150,7 +150,7 @@ namespace PgModelerUiNs { tab_obj=dynamic_cast(refs.back()); //If the object is a relationship added does not do anything since the relationship itself will be disabled - if(refs.back()->getObjectType()!=ObjBaseRelationship && + if(refs.back()->getObjectType()!=ObjectType::ObjBaseRelationship && (!tab_obj || (tab_obj && !tab_obj->isAddedByRelationship()))) { refs.back()->setSQLDisabled(object->isSQLDisabled()); diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index 6646390444..b1e9dd935a 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -18,14 +18,14 @@ #include "policywidget.h" -PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjPolicy) +PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjPolicy) { try { Ui_PolicyWidget::setupUi(this); model_objs_wgt = new ModelObjectsWidget(true, this); - model_objs_wgt->setObjectVisible(ObjRole, true); + model_objs_wgt->setObjectVisible(ObjectType::ObjRole, true); using_edt = PgModelerUiNs::createNumberedTextEditor(using_wgt); using_edt->setTabChangesFocus(true); @@ -49,7 +49,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjPolicy) vbox->addWidget(roles_tab); QFrame *frame=generateInformationFrame(trUtf8("Leave the Roles grid empty in order to create a %1 applicable to PUBLIC.") - .arg(BaseObject::getTypeName(ObjPolicy).toLower())); + .arg(BaseObject::getTypeName(ObjectType::ObjPolicy).toLower())); vbox->addWidget(frame); frame->setParent(this); vbox->setContentsMargins(4,4,4,4); @@ -59,7 +59,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjPolicy) PolicyCmdType::getTypes(cmds); command_cmb->addItems(cmds); - configureFormLayout(policy_grid, ObjPolicy); + configureFormLayout(policy_grid, ObjectType::ObjPolicy); configureTabOrder({ basics_grp, attribs_tbw }); connect(roles_tab, SIGNAL(s_rowAdded(int)), model_objs_wgt, SLOT(show())); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index c472772e33..6fa3736592 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -37,7 +37,7 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) expression_hl=new SyntaxHighlighter(expression_txt, false, true); expression_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - ref_object_sel=new ObjectSelectorWidget({ ObjTable, ObjColumn }, true, this); + ref_object_sel=new ObjectSelectorWidget({ ObjectType::ObjTable, ObjectType::ObjColumn }, true, this); ref_object_sel->enableObjectCreation(false); expression_cp=new CodeCompletionWidget(expression_txt, true); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 5b416d07c6..d3470eda97 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -24,7 +24,7 @@ #include "relationshipconfigwidget.h" #include "generalconfigwidget.h" -RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent, ObjRelationship) +RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjRelationship) { try { @@ -131,7 +131,7 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent grid=dynamic_cast(rel_attribs_tbw->widget(GeneralTab)->layout()); grid->addWidget(color_picker, 0, 1); - configureFormLayout(relationship_grid, ObjRelationship); + configureFormLayout(relationship_grid, ObjectType::ObjRelationship); DeferralType::getTypes(list); deferral_cmb->addItems(list); @@ -260,7 +260,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l aux_rel=dynamic_cast(base_rel); - if(base_rel->getObjectType()==ObjBaseRelationship) + if(base_rel->getObjectType()==ObjectType::ObjBaseRelationship) { if(base_rel->getRelationshipType()!=BaseRelationship::RelationshipFk) { @@ -321,7 +321,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } } - disable_sql_chk->setVisible(base_rel->getObjectType()==ObjRelationship); + disable_sql_chk->setVisible(base_rel->getObjectType()==ObjectType::ObjRelationship); table1_mand_chk->setText(base_rel->getTable(BaseRelationship::SrcTable)->getName() + trUtf8(" is required")); table2_mand_chk->setText(base_rel->getTable(BaseRelationship::DstTable)->getName() + trUtf8(" is required")); @@ -336,10 +336,10 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l constraints_tab->setButtonsEnabled(ObjectsTableWidget::AllButtons, !aux_rel->isProtected()); //Lists the relationship attributes - listObjects(ObjColumn); + listObjects(ObjectType::ObjColumn); //Lists the relationship constraints - listObjects(ObjConstraint); + listObjects(ObjectType::ObjConstraint); listSpecialPkColumns(); @@ -381,7 +381,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l rel_type==BaseRelationship::RelationshipFk); use_name_patterns=(rel1n || relnn || - (relgen_dep && base_rel->getObjectType()==ObjRelationship)); + (relgen_dep && base_rel->getObjectType()==ObjectType::ObjRelationship)); name_patterns_grp->setVisible(use_name_patterns); @@ -423,15 +423,15 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l for(i=SettingsTab; i <= SpecialPkTab; i++) rel_attribs_tbw->addTab(tabs[i], tab_labels[i]); } - else if(relgen_dep && base_rel->getObjectType()==ObjRelationship) + else if(relgen_dep && base_rel->getObjectType()==ObjectType::ObjRelationship) rel_attribs_tbw->addTab(tabs[SpecialPkTab], tab_labels[SpecialPkTab]); - if(base_rel->getObjectType()==ObjRelationship || - (base_rel->getObjectType()==ObjBaseRelationship && + if(base_rel->getObjectType()==ObjectType::ObjRelationship || + (base_rel->getObjectType()==ObjectType::ObjBaseRelationship && base_rel->getRelationshipType()==BaseRelationship::RelationshipFk)) rel_attribs_tbw->addTab(tabs[AdvancedTab], tab_labels[AdvancedTab]); - copy_options_grp->setVisible(base_rel->getObjectType()==ObjRelationship && + copy_options_grp->setVisible(base_rel->getObjectType()==ObjectType::ObjRelationship && base_rel->getRelationshipType()==BaseRelationship::RelationshipDep); custom_color_chk->setChecked(base_rel->getCustomColor()!=Qt::transparent); @@ -463,7 +463,7 @@ QSize RelationshipWidget::getIdealSize(void) rel_type = dynamic_cast(this->object)->getRelationshipType(); if(rel_type == BaseRelationship::RelationshipFk || - (BaseRelationship::RelationshipDep && this->object && this->object->getObjectType()==ObjBaseRelationship)) + (BaseRelationship::RelationshipDep && this->object && this->object->getObjectType()==ObjectType::ObjBaseRelationship)) return(QSize(640, 320)); else if(BaseRelationship::RelationshipGen) return(QSize(640, 520)); @@ -564,7 +564,7 @@ void RelationshipWidget::listObjects(ObjectType obj_type) try { - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) tab=attributes_tab; else tab=constraints_tab; @@ -683,13 +683,13 @@ void RelationshipWidget::showAdvancedObject(int row) ObjectType obj_type=object->getObjectType(); bool is_protected = false; - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { col=dynamic_cast(object); is_protected = col->isProtected(); openEditingForm(col, col->getParentTable()); } - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) { constr=dynamic_cast(object); @@ -733,7 +733,7 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) BaseObject *parent_aux = nullptr; int res = 0; - if(this->object->getObjectType() == ObjBaseRelationship) + if(this->object->getObjectType() == ObjectType::ObjBaseRelationship) parent_aux = dynamic_cast(this->object)->getTable(BaseRelationship::SrcTable); else parent_aux = !parent ? this->object : parent; @@ -750,22 +750,22 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) void RelationshipWidget::addObject(void) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; try { if(sender()==attributes_tab) { - obj_type=ObjColumn; + obj_type=ObjectType::ObjColumn; tab=attributes_tab; } else { - obj_type=ObjConstraint; + obj_type=ObjectType::ObjConstraint; tab=constraints_tab; } - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) openEditingForm(nullptr); else openEditingForm(nullptr); @@ -781,7 +781,7 @@ void RelationshipWidget::addObject(void) void RelationshipWidget::duplicateObject(int curr_row, int new_row) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; BaseObject *object = nullptr, *dup_object = nullptr; Relationship *rel = dynamic_cast(this->object); vector obj_list; @@ -795,13 +795,13 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) { if(sender()==attributes_tab) { - obj_type=ObjColumn; + obj_type=ObjectType::ObjColumn; tab=attributes_tab; obj_list = rel->getAttributes(); } else { - obj_type=ObjConstraint; + obj_type=ObjectType::ObjConstraint; tab=constraints_tab; obj_list = rel->getConstraints(); } @@ -835,7 +835,7 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) void RelationshipWidget::editObject(int row) { - ObjectType obj_type=ObjColumn; + ObjectType obj_type=ObjectType::ObjColumn; TableObject *tab_obj=nullptr; try @@ -844,13 +844,13 @@ void RelationshipWidget::editObject(int row) if(sender()==attributes_tab) { - obj_type=ObjColumn; + obj_type=ObjectType::ObjColumn; tab_obj=reinterpret_cast(attributes_tab->getRowData(row).value()); openEditingForm(tab_obj); } else { - obj_type=ObjConstraint; + obj_type=ObjectType::ObjConstraint; tab_obj=reinterpret_cast(constraints_tab->getRowData(row).value()); openEditingForm(tab_obj); } @@ -870,7 +870,7 @@ void RelationshipWidget::showObjectData(TableObject *object, int row) { ObjectsTableWidget *tab=nullptr; - if(object->getObjectType()==ObjColumn) + if(object->getObjectType()==ObjectType::ObjColumn) { tab=attributes_tab; attributes_tab->setCellText(*dynamic_cast(object)->getType(),row,1); @@ -888,7 +888,7 @@ void RelationshipWidget::showObjectData(TableObject *object, int row) void RelationshipWidget::removeObjects(void) { Relationship *rel=nullptr; - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; unsigned count, op_count=0, i; TableObject *object=nullptr; @@ -898,12 +898,12 @@ void RelationshipWidget::removeObjects(void) if(sender()==attributes_tab) { - obj_type=ObjColumn; + obj_type=ObjectType::ObjColumn; count=rel->getAttributeCount(); } else { - obj_type=ObjConstraint; + obj_type=ObjectType::ObjConstraint; count=rel->getConstraintCount(); } @@ -917,7 +917,7 @@ void RelationshipWidget::removeObjects(void) rel->removeObject(object); } - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) listSpecialPkColumns(); } catch(Exception &e) @@ -944,7 +944,7 @@ void RelationshipWidget::removeObjects(void) void RelationshipWidget::removeObject(int row) { Relationship *rel=nullptr; - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; TableObject *object=nullptr; int op_id=-1; @@ -953,15 +953,15 @@ void RelationshipWidget::removeObject(int row) rel=dynamic_cast(this->object); if(sender()==attributes_tab) - obj_type=ObjColumn; + obj_type=ObjectType::ObjColumn; else - obj_type=ObjConstraint; + obj_type=ObjectType::ObjConstraint; object=rel->getObject(row, obj_type); op_id=op_list->registerObject(object, Operation::ObjectRemoved, 0, rel); rel->removeObject(object); - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) listSpecialPkColumns(); } catch(Exception &e) @@ -1058,13 +1058,13 @@ void RelationshipWidget::applyConfiguration(void) /* Due to the complexity of the Relationship class and the strong link between all the relationships on the model is necessary to store the XML of the special objects and disconnect all relationships, edit the relationshi and revalidate all the relationships again */ - if(this->object->getObjectType()==ObjRelationship) + if(this->object->getObjectType()==ObjectType::ObjRelationship) { model->storeSpecialObjectsXML(); model->disconnectRelationships(); } - if(!this->new_object && this->object->getObjectType()==ObjRelationship) + if(!this->new_object && this->object->getObjectType()==ObjectType::ObjRelationship) op_list->registerObject(this->object, Operation::ObjectModified); else registerNewObject(); @@ -1076,7 +1076,7 @@ void RelationshipWidget::applyConfiguration(void) else base_rel->setCustomColor(Qt::transparent); - if(this->object->getObjectType()==ObjRelationship) + if(this->object->getObjectType()==ObjectType::ObjRelationship) { QPlainTextEdit *pattern_fields[]={ src_col_pattern_txt, dst_col_pattern_txt, src_fk_pattern_txt, dst_fk_pattern_txt, diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index 6aec7e42bd..cf8b0a3c5d 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -61,7 +61,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent end=std::unique(type_ids.begin(), type_ids.end()); type_ids.erase(end, type_ids.end()); - types = aux_cat.getObjectsAttributes(ObjType, QString(), QString(), type_ids); + types = aux_cat.getObjectsAttributes(ObjectType::ObjType, QString(), QString(), type_ids); col = 0; for(auto &tp : types) diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index 8a2a3990e5..de5f12da44 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -19,7 +19,7 @@ #include "rolewidget.h" #include "modelobjectswidget.h" -RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRole) +RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjRole) { ObjectsTableWidget *obj_tab=nullptr; QGridLayout *grid=nullptr; @@ -28,7 +28,7 @@ RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRole) unsigned i; Ui_RoleWidget::setupUi(this); - configureFormLayout(role_grid, ObjRole); + configureFormLayout(role_grid, ObjectType::ObjRole); object_selection_wgt=new ModelObjectsWidget(true); @@ -102,7 +102,7 @@ void RoleWidget::configureRoleSelection(void) void RoleWidget::selectMemberRole(void) { - object_selection_wgt->setObjectVisible(ObjRole, true); + object_selection_wgt->setObjectVisible(ObjectType::ObjRole, true); object_selection_wgt->setModel(this->model); object_selection_wgt->show(); } diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index a975031159..5c96baa906 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -18,7 +18,7 @@ #include "rulewidget.h" -RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRule) +RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjRule) { try { @@ -43,7 +43,7 @@ RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjRule) rule_grid->addWidget(frame, rule_grid->count()+1, 0, 1, 0); frame->setParent(this); - configureFormLayout(rule_grid, ObjRule); + configureFormLayout(rule_grid, ObjectType::ObjRule); EventType::getTypes(list); event_cmb->addItems(list); diff --git a/libpgmodeler_ui/src/schemawidget.cpp b/libpgmodeler_ui/src/schemawidget.cpp index a716d2dab3..07bc045971 100644 --- a/libpgmodeler_ui/src/schemawidget.cpp +++ b/libpgmodeler_ui/src/schemawidget.cpp @@ -18,12 +18,12 @@ #include "schemawidget.h" -SchemaWidget::SchemaWidget(QWidget *parent): BaseObjectWidget(parent, ObjSchema) +SchemaWidget::SchemaWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjSchema) { Ui_SchemaWidget::setupUi(this); QHBoxLayout *hbox=nullptr; - configureFormLayout(nullptr, ObjSchema); + configureFormLayout(nullptr, ObjectType::ObjSchema); color_picker=new ColorPickerWidget(1, this); diff --git a/libpgmodeler_ui/src/sequencewidget.cpp b/libpgmodeler_ui/src/sequencewidget.cpp index 3b2d3bd349..0c22d105b2 100644 --- a/libpgmodeler_ui/src/sequencewidget.cpp +++ b/libpgmodeler_ui/src/sequencewidget.cpp @@ -18,17 +18,17 @@ #include "sequencewidget.h" -SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, ObjSequence) +SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjSequence) { try { Ui_SequenceWidget::setupUi(this); column_sel=nullptr; - column_sel=new ObjectSelectorWidget(ObjColumn, true, this); + column_sel=new ObjectSelectorWidget(ObjectType::ObjColumn, true, this); sequence_grid->addWidget(column_sel, 4, 1, 1, 3); - configureFormLayout(sequence_grid, ObjSequence); + configureFormLayout(sequence_grid, ObjectType::ObjSequence); sequence_grid->addItem(new QSpacerItem(10,0,QSizePolicy::Minimum,QSizePolicy::Expanding), sequence_grid->count(), 0); configureTabOrder(); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 6895eaea2d..2012cb291f 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -30,8 +30,8 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( QPixmap ico; QString gen_purpose=trUtf8("General purpose"); map types_map; - vector types=BaseObject::getObjectTypes(true, {ObjRelationship, ObjTag, ObjTextbox, - ObjPermission, ObjBaseRelationship }); + vector types=BaseObject::getObjectTypes(true, {ObjectType::ObjRelationship, ObjectType::ObjTag, ObjectType::ObjTextbox, + ObjectType::ObjPermission, ObjectType::ObjBaseRelationship }); setupUi(this); @@ -46,10 +46,10 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( filter_cmb->addItem(ico, itr.first, itr.second); } - applies_to_cmb->insertItem(0, gen_purpose, ObjBaseObject); + applies_to_cmb->insertItem(0, gen_purpose, ObjectType::ObjBaseObject); applies_to_cmb->setCurrentIndex(0); - filter_cmb->insertItem(0, gen_purpose, ObjBaseObject); + filter_cmb->insertItem(0, gen_purpose, ObjectType::ObjBaseObject); filter_cmb->insertItem(0, trUtf8("All snippets")); filter_cmb->setCurrentIndex(0); @@ -106,7 +106,7 @@ attribs_map SnippetsConfigWidget::getSnippetById(const QString &snip_id) QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) { QStringList ids; - QString type_name=(obj_type==ObjBaseObject ? + QString type_name=(obj_type==ObjectType::ObjBaseObject ? ParsersAttributes::GENERAL : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) @@ -121,7 +121,7 @@ QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) vector SnippetsConfigWidget::getSnippetsByObject(ObjectType obj_type) { vector snippets; - QString type_name=(obj_type==ObjBaseObject ? + QString type_name=(obj_type==ObjectType::ObjBaseObject ? ParsersAttributes::GENERAL : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.h b/libpgmodeler_ui/src/snippetsconfigwidget.h index 7b2a222bdf..77d8dcdb1c 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.h +++ b/libpgmodeler_ui/src/snippetsconfigwidget.h @@ -79,7 +79,7 @@ class SnippetsConfigWidget: public BaseConfigWidget, public Ui::SnippetsConfigWi static QStringList getSnippetsIdsByObject(ObjectType obj_type); /*! \brief Returns a vector of snippets' attributes filtering by the object type in which they apply. - There's a special group for general purpose snippets that can be retrieved using ObjBaseObject type. + There's a special group for general purpose snippets that can be retrieved using ObjectType::ObjBaseObject type. If there is no snippets related to the type an empty vector is returned. */ static vector getSnippetsByObject(ObjectType obj_type); diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index efbfa2e0b1..e55395f08a 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -25,7 +25,7 @@ SourceCodeWidget::SourceCodeWidget(QWidget *parent): BaseObjectWidget(parent) try { Ui_SourceCodeWidget::setupUi(this); - configureFormLayout(codigofonte_grid, ObjBaseObject); + configureFormLayout(codigofonte_grid, ObjectType::ObjBaseObject); comment_lbl->setVisible(false); comment_edt->setVisible(false); @@ -76,9 +76,9 @@ void SourceCodeWidget::setSourceCodeTab(int) code_icon=QString("codigoxml"); enabled=(sourcecode_twg->currentIndex()==0 && - ((obj_type==ObjBaseRelationship && + ((obj_type==ObjectType::ObjBaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk) - || (obj_type!=ObjBaseRelationship && obj_type!=ObjTextbox))); + || (obj_type!=ObjectType::ObjBaseRelationship && obj_type!=ObjectType::ObjTextbox))); icone=QPixmap(PgModelerUiNs::getIconPath(code_icon)); icon_lbl->setPixmap(icone); @@ -130,14 +130,14 @@ void SourceCodeWidget::generateSourceCode(int) xmlcode_txt->clear(); obj_type=object->getObjectType(); - if(obj_type!=ObjTextbox || - (obj_type==ObjBaseRelationship && + if(obj_type!=ObjectType::ObjTextbox || + (obj_type==ObjectType::ObjBaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk)) { QString aux_def; BaseObject::setPgSQLVersion(version_cmb->currentText()); - if(obj_type==ObjDatabase) + if(obj_type==ObjectType::ObjDatabase) { task_prog_wgt=new TaskProgressWidget; task_prog_wgt->setWindowTitle(trUtf8("Generating source code...")); @@ -229,10 +229,10 @@ void SourceCodeWidget::setAttributes(DatabaseModel *model, BaseObject *object) this->name_edt->setText(QString("%1 (%2)").arg(object->getSignature()).arg(object->getTypeName())); this->protected_obj_frm->setVisible(false); this->obj_id_lbl->setVisible(false); - this->code_options_cmb->setEnabled(obj_type!=ObjDatabase && - obj_type!=ObjTextbox && - obj_type!=ObjBaseRelationship && - obj_type!=ObjRelationship); + this->code_options_cmb->setEnabled(obj_type!=ObjectType::ObjDatabase && + obj_type!=ObjectType::ObjTextbox && + obj_type!=ObjectType::ObjBaseRelationship && + obj_type!=ObjectType::ObjRelationship); #ifdef DEMO_VERSION #warning "DEMO VERSION: SQL code display options disabled." diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index fe22863c08..ab8b84f4d4 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -268,7 +268,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab end=std::unique(type_ids.begin(), type_ids.end()); type_ids.erase(end, type_ids.end()); - types=catalog.getObjectsAttributes(ObjType, QString(), QString(), type_ids); + types=catalog.getObjectsAttributes(ObjectType::ObjType, QString(), QString(), type_ids); for(auto &tp : types) type_names[tp[ParsersAttributes::OID].toUInt()]=tp[ParsersAttributes::NAME]; diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index 4d9310602a..f0930e12f1 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -8,8 +8,8 @@ SwapObjectsIdsWidget::SwapObjectsIdsWidget(QWidget *parent, Qt::WindowFlags f) : try { QGridLayout *swap_objs_grid=new QGridLayout(this); - vector types=BaseObject::getObjectTypes(true, {ObjPermission, ObjRole, ObjTextbox, - ObjColumn, ObjConstraint }); + vector types=BaseObject::getObjectTypes(true, {ObjectType::ObjPermission, ObjectType::ObjRole, ObjectType::ObjTextbox, + ObjectType::ObjColumn, ObjectType::ObjConstraint }); setupUi(this); PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); @@ -125,7 +125,7 @@ void SwapObjectsIdsWidget::fillCreationOrderGrid(void) //Using an stl function to extract all the values (objects) from the map and put them into a list std::for_each(creation_order.begin(), creation_order.end(), [&](const std::pair &itr) { - if(itr.second->getObjectType() != ObjConstraint) { + if(itr.second->getObjectType() != ObjectType::ObjConstraint) { objects.push_back(itr.second); } }); @@ -185,7 +185,7 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) if(!src_obj && !dst_obj) throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raise an exception if the user try to swap an id of relationship by other object of different kind - else if((src_obj->getObjectType()==ObjRelationship || dst_obj->getObjectType()==ObjRelationship) && + else if((src_obj->getObjectType()==ObjectType::ObjRelationship || dst_obj->getObjectType()==ObjectType::ObjRelationship) && (src_obj->getObjectType() != dst_obj->getObjectType())) throw Exception(InvRelationshipIdSwap,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -194,10 +194,10 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) BaseObject::swapObjectsIds(src_obj, dst_obj, false); //Special id swap for relationship - if(src_obj->getObjectType()==ObjRelationship) + if(src_obj->getObjectType()==ObjectType::ObjRelationship) { vector::iterator itr, itr1; - vector *list=model->getObjectList(ObjRelationship); + vector *list=model->getObjectList(ObjectType::ObjRelationship); //Find the relationships in the list and swap the memory position too itr=std::find(list->begin(), list->end(), src_obj); diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 0d8c33fcc0..bc1fdc32fe 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -23,12 +23,12 @@ const QString TableDataWidget::PlaceholderColumn=QString("$placeholder$"); -TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjBaseObject) +TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjBaseObject) { Ui_TableDataWidget::setupUi(this); - configureFormLayout(tabledata_grid, ObjBaseObject); + configureFormLayout(tabledata_grid, ObjectType::ObjBaseObject); - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(ObjTable))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(ObjectType::ObjTable))); comment_lbl->setVisible(false); comment_edt->setVisible(false); @@ -355,7 +355,7 @@ void TableDataWidget::populateDataGrid(const QString &data) } else { - for(auto object : *table->getObjectList(ObjColumn)) + for(auto object : *table->getObjectList(ObjectType::ObjColumn)) columns.push_back(object->getName()); } @@ -434,7 +434,7 @@ void TableDataWidget::configureColumnNamesMenu(void) col_names_menu.clear(); - for(auto object : *table->getObjectList(ObjColumn)) + for(auto object : *table->getObjectList(ObjectType::ObjColumn)) col_names.push_back(object->getName()); for(int col = 0; col < data_tbw->columnCount(); col++) diff --git a/libpgmodeler_ui/src/tablespacewidget.cpp b/libpgmodeler_ui/src/tablespacewidget.cpp index 4df7dfce2e..de2b74876d 100644 --- a/libpgmodeler_ui/src/tablespacewidget.cpp +++ b/libpgmodeler_ui/src/tablespacewidget.cpp @@ -18,10 +18,10 @@ #include "tablespacewidget.h" -TablespaceWidget::TablespaceWidget(QWidget *parent): BaseObjectWidget(parent, ObjTablespace) +TablespaceWidget::TablespaceWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTablespace) { Ui_TablespaceWidget::setupUi(this); - configureFormLayout(tablespace_grid, ObjTablespace); + configureFormLayout(tablespace_grid, ObjectType::ObjTablespace); tablespace_grid->addItem(new QSpacerItem(10,0,QSizePolicy::Minimum,QSizePolicy::Expanding), tablespace_grid->count(), 0); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index b98d6c8d64..8789b75546 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -27,12 +27,12 @@ #include "policywidget.h" #include "generalconfigwidget.h" -TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) +TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTable) { QGridLayout *grid=nullptr; QVBoxLayout *vbox=nullptr; ObjectsTableWidget *tab=nullptr; - ObjectType types[]={ ObjColumn, ObjConstraint, ObjTrigger, ObjRule, ObjIndex, ObjPolicy }; + ObjectType types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjPolicy }; map > fields_map; QFrame *frame=nullptr; QPushButton *edt_data_tb=nullptr; @@ -68,7 +68,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) parent_tables->setHeaderLabel(trUtf8("Type"), 2); parent_tables->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),2); - tag_sel = new ObjectSelectorWidget(ObjTag, false, this); + tag_sel = new ObjectSelectorWidget(ObjectType::ObjTag, false, this); vbox = new QVBoxLayout(tag_sel_parent); vbox->addWidget(tag_sel); vbox->setContentsMargins(0,0,0,0); @@ -99,19 +99,19 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) connect(tab, SIGNAL(s_rowsMoved(int,int)), this, SLOT(swapObjects(int,int))); } - objects_tab_map[ObjColumn]->setColumnCount(6); - objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("PK"), 0); - objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Name"), 1); - objects_tab_map[ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),1); - objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Type"), 2); - objects_tab_map[ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),2); - objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Default Value"), 3); - objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Attribute(s)"), 4); - objects_tab_map[ObjColumn]->setHeaderLabel(trUtf8("Alias"), 5); - objects_tab_map[ObjColumn]->adjustColumnToContents(0); - - connect(objects_tab_map[ObjColumn], &ObjectsTableWidget::s_cellClicked, [&](int row, int col){ - if(col == 0 && objects_tab_map[ObjColumn]->isCellDisabled(static_cast(row), static_cast(col))) + objects_tab_map[ObjectType::ObjColumn]->setColumnCount(6); + objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("PK"), 0); + objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Name"), 1); + objects_tab_map[ObjectType::ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),1); + objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Type"), 2); + objects_tab_map[ObjectType::ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),2); + objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Default Value"), 3); + objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Attribute(s)"), 4); + objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Alias"), 5); + objects_tab_map[ObjectType::ObjColumn]->adjustColumnToContents(0); + + connect(objects_tab_map[ObjectType::ObjColumn], &ObjectsTableWidget::s_cellClicked, [&](int row, int col){ + if(col == 0 && objects_tab_map[ObjectType::ObjColumn]->isCellDisabled(static_cast(row), static_cast(col))) { Messagebox msg_box; Table *table = dynamic_cast
(this->object); @@ -124,49 +124,49 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) } }); - objects_tab_map[ObjConstraint]->setColumnCount(5); - objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Type"), 1); - objects_tab_map[ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); - objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("ON DELETE"), 2); - objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("ON UPDATE"), 3); - objects_tab_map[ObjConstraint]->setHeaderLabel(trUtf8("Alias"), 4); - - objects_tab_map[ObjTrigger]->setColumnCount(5); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Alias"), 4); - - objects_tab_map[ObjRule]->setColumnCount(4); - objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); - objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Event"), 2); - objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Alias"), 3); - - objects_tab_map[ObjIndex]->setColumnCount(3); - objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); - objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Alias"), 2); - - objects_tab_map[ObjPolicy]->setColumnCount(7); - objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Command"), 1); - objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("keyword")),1); - objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Permissive"), 2); - objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("USING expression"), 3); - objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("CHECK expression"), 4); - objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Roles"), 5); - objects_tab_map[ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),5); - objects_tab_map[ObjPolicy]->setHeaderLabel(trUtf8("Alias"), 6); + objects_tab_map[ObjectType::ObjConstraint]->setColumnCount(5); + objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("Type"), 1); + objects_tab_map[ObjectType::ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); + objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("ON DELETE"), 2); + objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("ON UPDATE"), 3); + objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("Alias"), 4); + + objects_tab_map[ObjectType::ObjTrigger]->setColumnCount(5); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Alias"), 4); + + objects_tab_map[ObjectType::ObjRule]->setColumnCount(4); + objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); + objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Event"), 2); + objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Alias"), 3); + + objects_tab_map[ObjectType::ObjIndex]->setColumnCount(3); + objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); + objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Alias"), 2); + + objects_tab_map[ObjectType::ObjPolicy]->setColumnCount(7); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Command"), 1); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("keyword")),1); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Permissive"), 2); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("USING expression"), 3); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("CHECK expression"), 4); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Roles"), 5); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),5); + objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Alias"), 6); partition_keys_tab = new ElementsTableWidget; partition_keys_tab->setEnabled(false); @@ -181,7 +181,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjTable) partition_keys_tab->setEnabled(partitioning_type_cmb->currentIndex() != 0); }); - configureFormLayout(table_grid, ObjTable); + configureFormLayout(table_grid, ObjectType::ObjTable); configureTabOrder({ tag_sel }); setMinimumSize(660, 620); } @@ -214,7 +214,7 @@ ObjectsTableWidget *TableWidget::getObjectTable(ObjectType obj_type) ObjectType TableWidget::getObjectType(QObject *sender) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; if(sender) { @@ -223,7 +223,7 @@ ObjectType TableWidget::getObjectType(QObject *sender) itr=objects_tab_map.begin(); itr_end=objects_tab_map.end(); - while(itr!=itr_end && obj_type==ObjBaseObject) + while(itr!=itr_end && obj_type==ObjectType::ObjBaseObject) { if(itr->second==sender) obj_type=itr->first; @@ -241,7 +241,7 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc { unsigned i, count; Table *aux_tab=nullptr; - ObjectType types[]={ ObjColumn, ObjConstraint, ObjTrigger, ObjRule, ObjIndex, ObjPolicy }; + ObjectType types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjPolicy }; vector part_keys; if(!table) @@ -361,14 +361,14 @@ void TableWidget::listObjects(ObjectType obj_type) tab->blockSignals(false); //Enables the add button on the constraints, triggers and index tab only when there is columns created - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { - objects_tab_map[ObjConstraint]->setButtonsEnabled(ObjectsTableWidget::AddButton, - objects_tab_map[ObjColumn]->getRowCount() > 0); - objects_tab_map[ObjTrigger]->setButtonsEnabled(ObjectsTableWidget::AddButton, - objects_tab_map[ObjColumn]->getRowCount() > 0); - objects_tab_map[ObjIndex]->setButtonsEnabled(ObjectsTableWidget::AddButton, - objects_tab_map[ObjColumn]->getRowCount() > 0); + objects_tab_map[ObjectType::ObjConstraint]->setButtonsEnabled(ObjectsTableWidget::AddButton, + objects_tab_map[ObjectType::ObjColumn]->getRowCount() > 0); + objects_tab_map[ObjectType::ObjTrigger]->setButtonsEnabled(ObjectsTableWidget::AddButton, + objects_tab_map[ObjectType::ObjColumn]->getRowCount() > 0); + objects_tab_map[ObjectType::ObjIndex]->setButtonsEnabled(ObjectsTableWidget::AddButton, + objects_tab_map[ObjectType::ObjColumn]->getRowCount() > 0); } } catch(Exception &e) @@ -379,7 +379,7 @@ void TableWidget::listObjects(ObjectType obj_type) void TableWidget::handleObject(void) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; TableObject *object=nullptr; ObjectsTableWidget *obj_table=nullptr; @@ -394,23 +394,23 @@ void TableWidget::handleObject(void) if(obj_table->getSelectedRow()>=0) object=reinterpret_cast(obj_table->getRowData(obj_table->getSelectedRow()).value()); - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) openEditingForm(object); - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) openEditingForm(object); - else if(obj_type==ObjTrigger) + else if(obj_type==ObjectType::ObjTrigger) openEditingForm(object); - else if(obj_type==ObjIndex) + else if(obj_type==ObjectType::ObjIndex) openEditingForm(object); - else if(obj_type==ObjRule) + else if(obj_type==ObjectType::ObjRule) openEditingForm(object); else openEditingForm(object); listObjects(obj_type); - if(obj_type == ObjConstraint) - listObjects(ObjColumn); + if(obj_type == ObjectType::ObjConstraint) + listObjects(ObjectType::ObjColumn); } catch(Exception &e) { @@ -449,13 +449,13 @@ void TableWidget::showObjectData(TableObject *object, int row) tab=objects_tab_map[obj_type]; - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) tab->setCellText(object->getName(),row,1); else tab->setCellText(object->getName(),row,0); //For each object type there is a use for the columns from 1 to 3 - if(obj_type==ObjColumn) + if(obj_type==ObjectType::ObjColumn) { Table *table = dynamic_cast
(this->object); Constraint *pk = table->getPrimaryKey(); @@ -501,7 +501,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(column->getAlias(), row, 5); tab->adjustColumnToContents(0); } - else if(obj_type==ObjConstraint) + else if(obj_type==ObjectType::ObjConstraint) { constr=dynamic_cast(object); @@ -524,7 +524,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(constr->getAlias(), row, 4); } - else if(obj_type==ObjTrigger) + else if(obj_type==ObjectType::ObjTrigger) { trigger=dynamic_cast(object); @@ -546,7 +546,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(str_aux ,row,3); tab->setCellText(trigger->getAlias(), row, 4); } - else if(obj_type==ObjRule) + else if(obj_type==ObjectType::ObjRule) { rule=dynamic_cast(object); @@ -558,7 +558,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(rule->getAlias(), row, 3); } - else if(obj_type==ObjIndex) + else if(obj_type==ObjectType::ObjIndex) { index=dynamic_cast(object); @@ -567,7 +567,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(index->getAlias(), row, 2); } - else if(obj_type==ObjPolicy) + else if(obj_type==ObjectType::ObjPolicy) { QStringList rol_names; @@ -614,7 +614,7 @@ void TableWidget::removeObjects(void) Table *table=nullptr; unsigned count, op_count=0, i; BaseObject *object=nullptr; - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; try { @@ -641,8 +641,8 @@ void TableWidget::removeObjects(void) RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - if(obj_type == ObjConstraint) - listObjects(ObjColumn); + if(obj_type == ObjectType::ObjConstraint) + listObjects(ObjectType::ObjColumn); } catch(Exception &e) { @@ -670,7 +670,7 @@ void TableWidget::removeObject(int row) { Table *table=nullptr; BaseObject *object=nullptr; - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; int op_id=-1; try @@ -693,8 +693,8 @@ void TableWidget::removeObject(int row) .arg(object->getTypeName()), RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type == ObjConstraint) - listObjects(ObjColumn); + if(obj_type == ObjectType::ObjConstraint) + listObjects(ObjectType::ObjColumn); } catch(Exception &e) { @@ -713,7 +713,7 @@ void TableWidget::removeObject(int row) void TableWidget::duplicateObject(int sel_row, int new_row) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; BaseObject *object=nullptr, *dup_object=nullptr; ObjectsTableWidget *obj_table=nullptr; Table *table = dynamic_cast
(this->object); @@ -756,7 +756,7 @@ void TableWidget::duplicateObject(int sel_row, int new_row) void TableWidget::TableWidget::swapObjects(int idx1, int idx2) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; Table *table=nullptr; int count; @@ -810,7 +810,7 @@ void TableWidget::applyConfiguration(void) vector rels; vector pk_cols; vector part_keys; - ObjectsTableWidget *col_tab = objects_tab_map[ObjColumn]; + ObjectsTableWidget *col_tab = objects_tab_map[ObjectType::ObjColumn]; PartitioningType part_type; if(!this->new_object) @@ -861,7 +861,7 @@ void TableWidget::applyConfiguration(void) pk = new Constraint; pk->setName(pk_name); - pk->setName(PgModelerNs::generateUniqueName(pk, *table->getObjectList(ObjConstraint))); + pk->setName(PgModelerNs::generateUniqueName(pk, *table->getObjectList(ObjectType::ObjConstraint))); for(Column *col : pk_cols) pk->addColumn(col, Constraint::SourceCols); diff --git a/libpgmodeler_ui/src/tagwidget.cpp b/libpgmodeler_ui/src/tagwidget.cpp index 0aec4068a6..08e62f6e95 100644 --- a/libpgmodeler_ui/src/tagwidget.cpp +++ b/libpgmodeler_ui/src/tagwidget.cpp @@ -18,10 +18,10 @@ #include "tagwidget.h" -TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjTag) +TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTag) { Ui_TagWidget::setupUi(this); - configureFormLayout(tag_grid, ObjTag); + configureFormLayout(tag_grid, ObjectType::ObjTag); QStringList attribs={ ParsersAttributes::TABLE_NAME, ParsersAttributes::TABLE_SCHEMA_NAME, ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, diff --git a/libpgmodeler_ui/src/textboxwidget.cpp b/libpgmodeler_ui/src/textboxwidget.cpp index e71a76b444..9834f119be 100644 --- a/libpgmodeler_ui/src/textboxwidget.cpp +++ b/libpgmodeler_ui/src/textboxwidget.cpp @@ -18,10 +18,10 @@ #include "textboxwidget.h" -TextboxWidget::TextboxWidget(QWidget *parent): BaseObjectWidget(parent, ObjTextbox) +TextboxWidget::TextboxWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTextbox) { Ui_TextboxWidget::setupUi(this); - configureFormLayout(textbox_grid, ObjTextbox); + configureFormLayout(textbox_grid, ObjectType::ObjTextbox); text_txt->removeEventFilter(this); connect(color_select_tb, SIGNAL(clicked(void)), this, SLOT(selectTextColor(void))); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index e9883dcfc0..472b1ac2a8 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -18,7 +18,7 @@ #include "triggerwidget.h" -TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjTrigger) +TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTrigger) { try { @@ -36,8 +36,8 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjTrigg arguments_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::DuplicateButton, true, this); - ref_table_sel=new ObjectSelectorWidget(ObjTable, true, this); - function_sel=new ObjectSelectorWidget(ObjFunction, true, this); + ref_table_sel=new ObjectSelectorWidget(ObjectType::ObjTable, true, this); + function_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); ref_table_sel->setEnabled(false); trigger_grid->addWidget(function_sel, 3, 1, 1, 5); @@ -58,7 +58,7 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjTrigg FiringType::getTypes(list); firing_mode_cmb->addItems(list); - configureFormLayout(trigger_grid, ObjTrigger); + configureFormLayout(trigger_grid, ObjectType::ObjTrigger); connect(deferrable_chk, SIGNAL(toggled(bool)), deferral_type_cmb, SLOT(setEnabled(bool))); connect(columns_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addColumn(int))); @@ -97,7 +97,7 @@ void TriggerWidget::selectUpdateEvent(void) /* Disable the columns tab when the trigger belongs to a view. pgModeler does not support triggers reference view columns (yet) */ arg_cols_tbw->widget(1)->setEnabled(update_chk->isChecked() && - table->getObjectType()==ObjTable); + table->getObjectType()==ObjectType::ObjTable); } void TriggerWidget::setConstraintTrigger(bool value) @@ -173,14 +173,14 @@ void TriggerWidget::updateColumnsCombo(void) try { - if(this->table->getObjectType()==ObjTable) + if(this->table->getObjectType()==ObjectType::ObjTable) { - col_count=table->getObjectCount(ObjColumn); + col_count=table->getObjectCount(ObjectType::ObjColumn); column_cmb->clear(); for(i=0; i < col_count; i++) { - column=dynamic_cast(table->getObject(i, ObjColumn)); + column=dynamic_cast(table->getObject(i, ObjectType::ObjColumn)); if(columns_tab->getRowIndex(QVariant::fromValue(column)) < 0) { diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index 0d8e0bf24d..bc31bf91a0 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -18,7 +18,7 @@ #include "typewidget.h" -TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) +TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjType) { try { @@ -28,7 +28,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) unsigned i,i1; Ui_TypeWidget::setupUi(this); - configureFormLayout(type_grid, ObjType); + configureFormLayout(type_grid, ObjectType::ObjType); like_type=new PgSQLTypeWidget(this, trUtf8("Like Type")); element_type=new PgSQLTypeWidget(this, trUtf8("Element Type")); @@ -43,7 +43,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) for(i=Type::InputFunc; i <= Type::AnalyzeFunc; i++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(ObjFunction, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); grid->addWidget(functions_sel[i],i,1,1,1); } @@ -64,7 +64,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) grid=dynamic_cast(attributes_gb->layout()); - attrib_collation_sel=new ObjectSelectorWidget(ObjCollation, true, this); + attrib_collation_sel=new ObjectSelectorWidget(ObjectType::ObjCollation, true, this); grid->addWidget(attrib_collation_sel, 1,1,1,2); attrib_type_wgt=new PgSQLTypeWidget(this); @@ -81,13 +81,13 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjType) frame->setParent(base_attribs_twg->widget(0)); grid=dynamic_cast(range_attribs_gb->layout()); - opclass_sel=new ObjectSelectorWidget(ObjOpClass, true, this); + opclass_sel=new ObjectSelectorWidget(ObjectType::ObjOpClass, true, this); grid->addWidget(opclass_sel,0,1,1,1); for(i1=1, i=Type::CanonicalFunc; i <= Type::SubtypeDiffFunc; i++,i1++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(ObjFunction, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); grid->addWidget(functions_sel[i],i1,1,1,1); } diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 3bcb83ad57..73a5a12fd4 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -23,12 +23,12 @@ #include "baseform.h" #include "referencewidget.h" -ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjView) +ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjView) { try { ObjectsTableWidget *tab=nullptr; - ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex }; + ObjectType types[]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex }; QGridLayout *grid=nullptr; QVBoxLayout *vbox=nullptr; @@ -52,7 +52,7 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjView) vbox->setContentsMargins(4,4,4,4); vbox->addWidget(cte_expression_txt); - tag_sel=new ObjectSelectorWidget(ObjTag, false, this); + tag_sel=new ObjectSelectorWidget(ObjectType::ObjTag, false, this); dynamic_cast(options_gb->layout())->addWidget(tag_sel, 0, 1, 1, 4); references_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::UpdateButton, true, this); @@ -89,29 +89,29 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjView) connect(tab, SIGNAL(s_rowDuplicated(int,int)), this, SLOT(duplicateObject(int,int))); } - objects_tab_map[ObjTrigger]->setColumnCount(4); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); - objects_tab_map[ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); - objects_tab_map[ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); - - objects_tab_map[ObjIndex]->setColumnCount(2); - objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); - - objects_tab_map[ObjRule]->setColumnCount(3); - objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); - objects_tab_map[ObjRule]->setHeaderLabel(trUtf8("Event"), 2); + objects_tab_map[ObjectType::ObjTrigger]->setColumnCount(4); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); + objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); + + objects_tab_map[ObjectType::ObjIndex]->setColumnCount(2); + objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); + + objects_tab_map[ObjectType::ObjRule]->setColumnCount(3); + objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); + objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Event"), 2); tablespace_sel->setEnabled(false); tablespace_lbl->setEnabled(false); - configureFormLayout(view_grid, ObjView); + configureFormLayout(view_grid, ObjectType::ObjView); fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(recursive_rb); fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(materialized_rb); @@ -169,7 +169,7 @@ int ViewWidget::openEditingForm(TableObject *object) void ViewWidget::handleObject(void) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; TableObject *object=nullptr; ObjectsTableWidget *obj_table=nullptr; @@ -181,9 +181,9 @@ void ViewWidget::handleObject(void) if(obj_table->getSelectedRow()>=0) object=reinterpret_cast(obj_table->getRowData(obj_table->getSelectedRow()).value()); - if(obj_type==ObjTrigger) + if(obj_type==ObjectType::ObjTrigger) openEditingForm(object); - else if(obj_type==ObjIndex) + else if(obj_type==ObjectType::ObjIndex) openEditingForm(object); else openEditingForm(object); @@ -199,7 +199,7 @@ void ViewWidget::handleObject(void) void ViewWidget::duplicateObject(int curr_row, int new_row) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; BaseObject *object=nullptr, *dup_object=nullptr; ObjectsTableWidget *obj_table=nullptr; View *view = dynamic_cast(this->object); @@ -313,7 +313,7 @@ void ViewWidget::removeObject(int row) ObjectType ViewWidget::getObjectType(QObject *sender) { - ObjectType obj_type=ObjBaseObject; + ObjectType obj_type=ObjectType::ObjBaseObject; if(sender) { @@ -322,7 +322,7 @@ ObjectType ViewWidget::getObjectType(QObject *sender) itr=objects_tab_map.begin(); itr_end=objects_tab_map.end(); - while(itr!=itr_end && obj_type==ObjBaseObject) + while(itr!=itr_end && obj_type==ObjectType::ObjBaseObject) { if(itr->second==sender) obj_type=itr->first; @@ -352,7 +352,7 @@ void ViewWidget::showObjectData(TableObject *object, int row) //Column 0: Object name tab->setCellText(object->getName(),row,0); - if(obj_type==ObjTrigger) + if(obj_type==ObjectType::ObjTrigger) { trigger=dynamic_cast(object); @@ -374,7 +374,7 @@ void ViewWidget::showObjectData(TableObject *object, int row) str_aux.remove(str_aux.size()-2, 2); tab->setCellText(str_aux ,row,3); } - else if(obj_type==ObjRule) + else if(obj_type==ObjectType::ObjRule) { rule=dynamic_cast(object); @@ -583,7 +583,7 @@ void ViewWidget::updateCodePreview(void) //Make a copy of each view objects (rule/trigger) to the auxiliary view for(i=0; i < count; i++) { - if(itr->first==ObjTrigger) + if(itr->first==ObjectType::ObjTrigger) { tab_obj=new Trigger; (*dynamic_cast(tab_obj))= @@ -677,9 +677,9 @@ void ViewWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch references_tab->blockSignals(false); references_tab->clearSelection(); - listObjects(ObjTrigger); - listObjects(ObjRule); - listObjects(ObjIndex); + listObjects(ObjectType::ObjTrigger); + listObjects(ObjectType::ObjRule); + listObjects(ObjectType::ObjIndex); } void ViewWidget::applyConfiguration(void) @@ -687,7 +687,7 @@ void ViewWidget::applyConfiguration(void) try { View *view=nullptr; - ObjectType types[]={ ObjTrigger, ObjRule, ObjIndex }; + ObjectType types[]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex }; unsigned expr_type[]={ Reference::SqlReferSelect, Reference::SqlReferFrom, Reference::SqlReferWhere, diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index f13f5a2e3d..9461a9aa02 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -627,20 +627,20 @@ void PgModelerCli::handleObjectAddition(BaseObject *object) switch(obj_type) { - case ObjTable: + case ObjectType::ObjTable: item=new TableView(dynamic_cast
(graph_obj)); break; - case ObjView: + case ObjectType::ObjView: item=new GraphicalView(dynamic_cast(graph_obj)); break; - case ObjRelationship: - case ObjBaseRelationship: + case ObjectType::ObjRelationship: + case ObjectType::ObjBaseRelationship: item=new RelationshipView(dynamic_cast(graph_obj)); break; break; - case ObjSchema: + case ObjectType::ObjSchema: item=new SchemaView(dynamic_cast(graph_obj)); break; break; @@ -651,7 +651,7 @@ void PgModelerCli::handleObjectAddition(BaseObject *object) scene->addItem(item); - if(obj_type==ObjTable || obj_type==ObjView) + if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) dynamic_cast(graph_obj->getSchema())->setModified(true); } } @@ -667,7 +667,7 @@ void PgModelerCli::handleObjectRemoval(BaseObject *object) //Updates the parent schema if the removed object were a table or view if(graph_obj->getSchema() && - (graph_obj->getObjectType()==ObjTable || graph_obj->getObjectType()==ObjView)) + (graph_obj->getObjectType()==ObjectType::ObjTable || graph_obj->getObjectType()==ObjectType::ObjView)) dynamic_cast(graph_obj->getSchema())->setModified(true); } } @@ -722,12 +722,12 @@ void PgModelerCli::extractObjectXML(void) /* Special case for empty tags like , they will be converted to in order to be correctly extracted further. Currently only language has this behaviour, so additional object may be added in the future. */ - if(lin.contains(QString("<%1").arg(BaseObject::getSchemaName(ObjLanguage)))) + if(lin.contains(QString("<%1").arg(BaseObject::getSchemaName(ObjectType::ObjLanguage)))) { lin=lin.simplified(); if(lin.contains(QString("/>"))) - lin.replace(QString("/>"), QString(">").arg(BaseObject::getSchemaName(ObjLanguage))); + lin.replace(QString("/>"), QString(">").arg(BaseObject::getSchemaName(ObjectType::ObjLanguage))); } /* Special case for function signatures. In previous releases, the function's signature was wrongly including OUT parameters and according to docs they are not part of the signature, so it is needed @@ -820,8 +820,8 @@ void PgModelerCli::recreateObjects(void) QStringList fail_objs, constr, list; QString xml_def, aux_def, start_tag="<%1", end_tag="", aux_tag; BaseObject *object=nullptr; - ObjectType obj_type=ObjBaseObject; - vector types={ ObjIndex, ObjTrigger, ObjRule }; + ObjectType obj_type=ObjectType::ObjBaseObject; + vector types={ ObjectType::ObjIndex, ObjectType::ObjTrigger, ObjectType::ObjRule }; attribs_map attribs; bool use_fail_obj=false; unsigned tries=0, max_tries=parsed_opts[FixTries].toUInt(); @@ -858,11 +858,11 @@ void PgModelerCli::recreateObjects(void) xmlparser->getElementAttributes(attribs); - if(obj_type==ObjDatabase) + if(obj_type==ObjectType::ObjDatabase) model->configureDatabase(attribs); else { - if(obj_type==ObjTable) + if(obj_type==ObjectType::ObjTable) { //Before create a table extract it's foreign keys list=extractForeignKeys(xml_def); @@ -878,14 +878,14 @@ void PgModelerCli::recreateObjects(void) } //Discarding fk relationships - if(obj_type!=ObjRelationship || - (obj_type==ObjRelationship && !xml_def.contains(QString("\"%1\"").arg(ParsersAttributes::RELATIONSHIP_FK)))) + if(obj_type!=ObjectType::ObjRelationship || + (obj_type==ObjectType::ObjRelationship && !xml_def.contains(QString("\"%1\"").arg(ParsersAttributes::RELATIONSHIP_FK)))) { object=model->createObject(obj_type); if(object) { - if(!dynamic_cast(object) && obj_type!=ObjRelationship && obj_type!=ObjBaseRelationship) + if(!dynamic_cast(object) && obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjBaseRelationship) model->addObject(object); } @@ -895,7 +895,7 @@ void PgModelerCli::recreateObjects(void) /* Additional step to extract indexes/triggers/rules from within tables/views and putting their xml on the list of object to be created */ - if((obj_type==ObjTable || obj_type==ObjView) && + if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && xml_def.contains(QRegExp("(<)(index|trigger|rule)"))) { for(ObjectType type : types) @@ -933,7 +933,7 @@ void PgModelerCli::recreateObjects(void) } catch(Exception &e) { - if(obj_type!=ObjDatabase) + if(obj_type!=ObjectType::ObjDatabase) fail_objs.push_back(xml_def); else throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); @@ -972,14 +972,14 @@ void PgModelerCli::recreateObjects(void) void PgModelerCli::fixObjectAttributes(QString &obj_xml) { //Placing objects , , outside of
- if(!obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjTablespace))) && - obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjTable)))) + if(!obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjTablespace))) && + obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjTable)))) { int start_idx=-1, end_idx=-1, len=0; - ObjectType obj_types[3]={ ObjRule, ObjTrigger, ObjIndex }; + ObjectType obj_types[3]={ ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex }; QString curr_tag, curr_end_tag, def, tab_name, sch_name, name_attr=QString("name=\""), - sch_name_attr=TagExpr.arg(BaseObject::getSchemaName(ObjSchema)) + QString(" ") + name_attr; + sch_name_attr=TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjSchema)) + QString(" ") + name_attr; //Extracting the table's name start_idx=obj_xml.indexOf(name_attr); @@ -1008,7 +1008,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.remove(start_idx, len); //If the object is a rule include the table attribute - if(def.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjRule)))) + if(def.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjRule)))) { start_idx=def.indexOf('>'); def.replace(start_idx, 1, QString(" ") + tab_name + QString(">")); @@ -1028,7 +1028,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.remove(QRegExp(AttributeExpr.arg(QString("recheck")))); //Remove values greater-op, less-op, sort-op or sort2-op from ref-type attribute from tags. - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjOperator)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjOperator)))) { obj_xml.remove(QString("greater-op")); obj_xml.remove(QString("less-op")); @@ -1037,11 +1037,11 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) } //Replacing attribute owner by onwer-col for sequences - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjSequence)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjSequence)))) obj_xml.replace(ParsersAttributes::OWNER, ParsersAttributes::OWNER_COLUMN); //Remove sysid attribute from tags. - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjRole)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjRole)))) obj_xml.remove(QRegExp(AttributeExpr.arg(QString("sysid")))); //Replace tag by on tags. @@ -1051,7 +1051,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.replace(EndTagExpr.arg(ParsersAttributes::PARAMETER), EndTagExpr.arg(ParsersAttributes::TYPE_ATTRIBUTE)); } - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjRelationship)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjRelationship)))) { //Remove auto-sufix, src-sufix, dst-sufix, col-indexes, constr-indexes, attrib-indexes from tags. obj_xml.remove(QRegExp(AttributeExpr.arg(QString("auto-sufix")))); @@ -1065,25 +1065,25 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) } //Renaming the tag to on indexes - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjIndex)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjIndex)))) { obj_xml.replace(TagExpr.arg(ParsersAttributes::CONDITION), TagExpr.arg(ParsersAttributes::PREDICATE)); obj_xml.replace(EndTagExpr.arg(ParsersAttributes::CONDITION), EndTagExpr.arg(ParsersAttributes::PREDICATE)); } //Renaming the attribute default to default-value on domain - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjDomain)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjDomain)))) obj_xml.replace(ParsersAttributes::DEFAULT, ParsersAttributes::DEFAULT_VALUE); //Renaming the tag to if(obj_xml.contains(TagExpr.arg(QString("grant")))) { - obj_xml.replace(TagExpr.arg(QString("grant")), TagExpr.arg(BaseObject::getSchemaName(ObjPermission))); - obj_xml.replace(EndTagExpr.arg(QString("grant")), EndTagExpr.arg(BaseObject::getSchemaName(ObjPermission))); + obj_xml.replace(TagExpr.arg(QString("grant")), TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjPermission))); + obj_xml.replace(EndTagExpr.arg(QString("grant")), EndTagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjPermission))); } //Replace the constraint attribute and tag expression by constraint tag in . - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjDomain))) && + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjDomain))) && obj_xml.contains(TagExpr.arg(ParsersAttributes::EXPRESSION))) { int start_idx=-1, end_idx=-1; @@ -1112,13 +1112,13 @@ void PgModelerCli::fixOpClassesFamiliesReferences(QString &obj_xml) { ObjectType ref_obj_type; - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjIndex))) || + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjIndex))) || obj_xml.contains(QRegExp(QString("(%1)(.)+(type=)(\")(%2)(\")") - .arg(TagExpr.arg(BaseObject::getSchemaName(ObjConstraint))) + .arg(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjConstraint))) .arg(ParsersAttributes::EX_CONSTR)))) - ref_obj_type=ObjOpClass; - else if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjOpClass)))) - ref_obj_type=ObjOpFamily; + ref_obj_type=ObjectType::ObjOpClass; + else if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjOpClass)))) + ref_obj_type=ObjectType::ObjOpFamily; else return; @@ -1278,8 +1278,8 @@ void PgModelerCli::importDatabase(DatabaseModel *model, Connection conn) catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); - db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::ParamDbName), ObjDatabase); - obj_oids[ObjDatabase].push_back(db_oid.toUInt()); + db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::ParamDbName), ObjectType::ObjDatabase); + obj_oids[ObjectType::ObjDatabase].push_back(db_oid.toUInt()); catalog.closeConnection(); diff --git a/main-cli/src/pgmodelercli.h b/main-cli/src/pgmodelercli.h index 4fa3065d48..73a21346c9 100644 --- a/main-cli/src/pgmodelercli.h +++ b/main-cli/src/pgmodelercli.h @@ -218,7 +218,7 @@ class PgModelerCli: public QApplication { private slots: void handleObjectAddition(BaseObject *); - void updateProgress(int progress, QString msg, ObjectType = ObjBaseObject); + void updateProgress(int progress, QString msg, ObjectType = ObjectType::ObjBaseObject); void printIgnoredError(QString err_cod, QString err_msg, QString cmd); void handleObjectRemoval(BaseObject *object); }; diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index 7e860139f4..02a55b4ddf 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -81,7 +81,7 @@ void Xml2ObjectWidget::generateObject(void) object=model->createObject(obj_type); if(object && !dynamic_cast(object) && - obj_type!=ObjRelationship && obj_type!=ObjBaseRelationship) + obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjBaseRelationship) { model->addObject(object); op_list->registerObject(object, Operation::ObjectCreated, -1, model); From 707a84f0a7389f9c4c4aa9de0e46df99644d7194 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 15:07:58 -0300 Subject: [PATCH 173/425] ErrorCode enum is now a scoped enum --- crashhandler/src/crashhandlerform.cpp | 6 +- crashhandler/src/main.cpp | 2 +- libobjrenderer/src/basetableview.cpp | 2 +- libobjrenderer/src/objectsscene.cpp | 2 +- libobjrenderer/src/relationshipview.cpp | 6 +- libobjrenderer/src/tableobjectview.cpp | 4 +- libobjrenderer/src/tabletitleview.cpp | 4 +- libobjrenderer/src/tableview.cpp | 4 +- libparsers/src/schemaparser.cpp | 18 +- libpgconnector/src/catalog.cpp | 6 +- libpgconnector/src/connection.cpp | 40 +-- libpgconnector/src/resultset.cpp | 34 +- libpgmodeler/src/aggregate.cpp | 16 +- libpgmodeler/src/baseobject.cpp | 66 ++-- libpgmodeler/src/baseobject.h | 1 + libpgmodeler/src/baserelationship.cpp | 22 +- libpgmodeler/src/cast.cpp | 26 +- libpgmodeler/src/collation.cpp | 10 +- libpgmodeler/src/column.cpp | 12 +- libpgmodeler/src/constraint.cpp | 27 +- libpgmodeler/src/conversion.cpp | 24 +- libpgmodeler/src/copyoptions.cpp | 4 +- libpgmodeler/src/databasemodel.cpp | 338 +++++++++--------- libpgmodeler/src/domain.cpp | 10 +- libpgmodeler/src/element.cpp | 4 +- libpgmodeler/src/eventtrigger.cpp | 14 +- libpgmodeler/src/extension.cpp | 10 +- libpgmodeler/src/function.cpp | 36 +- libpgmodeler/src/index.cpp | 20 +- libpgmodeler/src/language.cpp | 12 +- libpgmodeler/src/operationlist.cpp | 32 +- libpgmodeler/src/operator.cpp | 36 +- libpgmodeler/src/operatorclass.cpp | 6 +- libpgmodeler/src/operatorclasselement.cpp | 10 +- libpgmodeler/src/parameter.cpp | 4 +- libpgmodeler/src/permission.cpp | 20 +- libpgmodeler/src/pgmodelerns.cpp | 4 +- libpgmodeler/src/pgsqltypes.cpp | 22 +- libpgmodeler/src/policy.cpp | 8 +- libpgmodeler/src/reference.cpp | 12 +- libpgmodeler/src/relationship.cpp | 110 +++--- libpgmodeler/src/role.cpp | 34 +- libpgmodeler/src/rule.cpp | 6 +- libpgmodeler/src/schema.cpp | 4 +- libpgmodeler/src/sequence.cpp | 36 +- libpgmodeler/src/table.cpp | 62 ++-- libpgmodeler/src/tablespace.cpp | 6 +- libpgmodeler/src/tag.cpp | 12 +- libpgmodeler/src/textbox.cpp | 4 +- libpgmodeler/src/trigger.cpp | 42 +-- libpgmodeler/src/type.cpp | 80 ++--- libpgmodeler/src/view.cpp | 36 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 12 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 14 +- libpgmodeler_ui/src/bugreportform.cpp | 6 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 2 +- libpgmodeler_ui/src/colorpickerwidget.cpp | 10 +- libpgmodeler_ui/src/columnwidget.cpp | 6 +- libpgmodeler_ui/src/configurationform.cpp | 4 +- .../src/connectionsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/constraintwidget.cpp | 8 +- libpgmodeler_ui/src/csvloadwidget.cpp | 4 +- libpgmodeler_ui/src/customsqlwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 6 +- libpgmodeler_ui/src/databaseimportform.cpp | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 23 +- libpgmodeler_ui/src/datamanipulationform.cpp | 8 +- libpgmodeler_ui/src/elementwidget.cpp | 4 +- libpgmodeler_ui/src/findreplacewidget.cpp | 2 +- libpgmodeler_ui/src/functionwidget.cpp | 4 +- libpgmodeler_ui/src/hinttextwidget.cpp | 2 +- libpgmodeler_ui/src/indexwidget.cpp | 2 +- libpgmodeler_ui/src/linenumberswidget.cpp | 2 +- libpgmodeler_ui/src/mainwindow.cpp | 18 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 2 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 6 +- libpgmodeler_ui/src/modelexporthelper.cpp | 22 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 6 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 4 +- libpgmodeler_ui/src/modelwidget.cpp | 72 ++-- libpgmodeler_ui/src/numberedtexteditor.cpp | 18 +- libpgmodeler_ui/src/objectdepsrefswidget.cpp | 2 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 22 +- libpgmodeler_ui/src/objectstablewidget.cpp | 22 +- libpgmodeler_ui/src/operationlistwidget.cpp | 4 +- libpgmodeler_ui/src/permissionwidget.cpp | 14 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 10 +- libpgmodeler_ui/src/pgsqltypewidget.cpp | 2 +- libpgmodeler_ui/src/pluginsconfigwidget.cpp | 12 +- libpgmodeler_ui/src/policywidget.cpp | 2 +- libpgmodeler_ui/src/referencewidget.cpp | 2 +- libpgmodeler_ui/src/relationshipwidget.cpp | 4 +- libpgmodeler_ui/src/rolewidget.cpp | 18 +- libpgmodeler_ui/src/rulewidget.cpp | 2 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 4 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 32 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 4 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 30 +- libpgmodeler_ui/src/tabledatawidget.cpp | 6 +- libpgmodeler_ui/src/tablewidget.cpp | 10 +- libpgmodeler_ui/src/triggerwidget.cpp | 2 +- libpgmodeler_ui/src/validationinfo.cpp | 4 +- libutils/src/exception.h | 10 +- main-cli/src/main.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 62 ++-- main/src/application.cpp | 14 +- main/src/main.cpp | 2 +- plugins/xml2object/src/xml2object.cpp | 2 +- plugins/xml2object/src/xml2objectwidget.cpp | 4 +- .../partrelationshiptest.cpp | 4 +- 111 files changed, 981 insertions(+), 970 deletions(-) diff --git a/crashhandler/src/crashhandlerform.cpp b/crashhandler/src/crashhandlerform.cpp index 997e9be705..5bbe47ffc9 100644 --- a/crashhandler/src/crashhandlerform.cpp +++ b/crashhandler/src/crashhandlerform.cpp @@ -125,7 +125,7 @@ void CrashHandlerForm::loadReport(const QString &filename) //Raises an error if the file could not be opened if(!input.isOpen()) - msgbox.show(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(filename), Messagebox::ErrorIcon); + msgbox.show(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(filename), Messagebox::ErrorIcon); else { QByteArray uncomp_buf; @@ -210,8 +210,8 @@ void CrashHandlerForm::saveModel(void) output.open(QFile::WriteOnly); if(!output.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(file_dlg.selectedFiles().at(0)), - FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(file_dlg.selectedFiles().at(0)), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf.append(model_txt->toPlainText()); output.write(buf.data(),buf.size()); diff --git a/crashhandler/src/main.cpp b/crashhandler/src/main.cpp index 77b91ef7da..bd0fe53a2c 100644 --- a/crashhandler/src/main.cpp +++ b/crashhandler/src/main.cpp @@ -44,6 +44,6 @@ int main(int argc, char **argv) { QTextStream out(stdout); out << e.getExceptionsText(); - return(e.getErrorType()); + return(~e.getErrorType()); } } diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index f88728b37e..7637bcdea3 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -24,7 +24,7 @@ bool BaseTableView::hide_tags=false; BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) { if(!base_tab) - throw Exception(AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); body=new RoundedRectItem; body->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 2d6fc54d95..4964badf36 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -350,7 +350,7 @@ void ObjectsScene::getPaperConfiguration(QPrinter::PaperSize &paper_sz, QPrinter void ObjectsScene::configurePrinter(QPrinter *printer) { if(!printer) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(paper_size!=QPrinter::Custom) printer->setPaperSize(paper_size); diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index da8f9c6c93..8ccbf44786 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -26,7 +26,7 @@ unsigned RelationshipView::line_conn_mode=RelationshipView::ConnectFkToPk; RelationshipView::RelationshipView(BaseRelationship *rel) : BaseObjectView(rel) { if(!rel) - throw Exception(AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); for(unsigned i=BaseRelationship::SrcCardLabel; i <= BaseRelationship::RelNameLabel; i++) @@ -199,7 +199,7 @@ unsigned RelationshipView::getLineConnectinMode(void) QPointF RelationshipView::getConnectionPoint(unsigned table_idx) { if(table_idx > 2) - throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(conn_points[table_idx]); } @@ -1984,7 +1984,7 @@ void RelationshipView::configureLabels(void) void RelationshipView::configureLabelPosition(unsigned label_id, double x, double y) { if(label_id > BaseRelationship::RelNameLabel) - throw Exception(RefObjectInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(labels[label_id]) { diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 28e729446a..ac2b997354 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -527,7 +527,7 @@ void TableObjectView::configureObject(Reference reference) void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) { if(obj_idx >= 4) - throw Exception(RefObjectInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); if(obj_idx==0) descriptor->setPos(px, descriptor->pos().y()); @@ -538,7 +538,7 @@ void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) QGraphicsItem *TableObjectView::getChildObject(unsigned obj_idx) { if(obj_idx >= 4) - throw Exception(RefObjectInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); if(obj_idx==0) return(descriptor); diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 16a0c45a33..5980c17f95 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -58,11 +58,11 @@ void TableTitleView::configureObject(BaseGraphicObject *object) //Raises an error if the object related to the title is not allocated if(!object) - throw Exception(OprNotAllocatedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Raises an error if the object is invalid else if(object->getObjectType()!=ObjectType::ObjTable && object->getObjectType()!=ObjectType::ObjView) - throw Exception(OprObjectInvalidType, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::OprObjectInvalidType, __PRETTY_FUNCTION__, __FILE__, __LINE__); schema=dynamic_cast(object->getSchema()); tag=dynamic_cast(object)->getTag(); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 4c63dd0a4e..18135bc8fc 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -231,9 +231,9 @@ void TableView::configureObject(void) QPointF TableView::getConnectionPoints(TableObject *tab_obj, unsigned pnt_type) { if(!tab_obj) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(pnt_type > RightConnPoint) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(conn_points.count(tab_obj)==0) //Returns the center point in case of the connection point of the table object wasn't calculated already return(this->getCenter()); diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 9f06eb5378..39763a6515 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -79,7 +79,7 @@ void SchemaParser::setPgSQLVersion(const QString &pgsql_ver) .arg(pgsql_ver) .arg(PgSqlVersions::PgSqlVersion90) .arg(PgSqlVersions::DefaulVersion), - InvPostgreSQLVersion,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvPostgreSQLVersion,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(curr_ver > 0 && curr_ver <= default_ver) pgsql_version=pgsql_ver; @@ -1317,9 +1317,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) raises an exception */ if(word.isEmpty() && !ignore_empty_atribs) { - throw Exception(Exception::getErrorMessage(UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(ErrorCode::UndefinedAttributeValue) .arg(atrib).arg(filename).arg(line + comment_count +1).arg(column+1), - UndefinedAttributeValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::UndefinedAttributeValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1367,9 +1367,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) if(error) { - throw Exception(Exception::getErrorMessage(InvalidSyntax) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg(line + comment_count +1).arg(column+1), - InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } break; @@ -1389,9 +1389,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) because only an attribute must be on the 'if' expression */ if(vet_tk_if[if_level] && !vet_tk_then[if_level]) { - throw Exception(Exception::getErrorMessage(InvalidSyntax) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg(line + comment_count +1).arg(column+1), - InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Case the parser is in 'if' section else if(vet_tk_if[if_level] && @@ -1414,9 +1414,9 @@ QString SchemaParser::getCodeDefinition(attribs_map &attribs) was not closed thus the parser returns an error */ if(if_cnt!=end_cnt) { - throw Exception(Exception::getErrorMessage(InvalidSyntax) + throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg(line + comment_count +1).arg(column+1), - InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index ed242e3efc..e4555ad228 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -164,8 +164,8 @@ void Catalog::loadCatalogQuery(const QString &qry_id) qry_id + GlobalAttributes::SchemaExt); if(!input.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(input.fileName()), - FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(input.fileName()), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); catalog_queries[qry_id]=QString(input.readAll()); input.close(); @@ -640,7 +640,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS if(res.getTupleCount() > 1) throw Exception(QApplication::translate("Catalog","The catalog query returned more than one OID!","", -1), - Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(res.isEmpty()) return("0"); diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index 3f823c84c8..bef7340aca 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -89,7 +89,7 @@ void Connection::setConnectionParam(const QString ¶m, const QString &value) //Raise an error in case the param name is empty if(param.isEmpty()) - throw Exception(AsgInvalidConnParameter, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::AsgInvalidConnParameter, __PRETTY_FUNCTION__, __FILE__, __LINE__); /* Set the value to the specified param on the map. @@ -170,15 +170,15 @@ void Connection::validateConnectionStatus(void) if(dt >= cmd_exec_timeout) { close(); - throw Exception(ConnectionTimeout, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::ConnectionTimeout, __PRETTY_FUNCTION__, __FILE__, __LINE__); } } if(PQstatus(connection)==CONNECTION_BAD) - throw Exception(Exception::getErrorMessage(ConnectionBroken) + throw Exception(Exception::getErrorMessage(ErrorCode::ConnectionBroken) .arg(connection_params[ParamServerFqdn].isEmpty() ? connection_params[ParamServerIp] : connection_params[ParamServerFqdn]) .arg(connection_params[ParamPort]), - ConnectionBroken, __PRETTY_FUNCTION__, __FILE__, __LINE__); + ErrorCode::ConnectionBroken, __PRETTY_FUNCTION__, __FILE__, __LINE__); } void Connection::setNoticeEnabled(bool value) @@ -217,11 +217,11 @@ void Connection::connect(void) is trying to connect without configuring connection parameters, thus an error is raised */ if(connection_str.isEmpty()) - throw Exception(ConnectionNotConfigured, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::ConnectionNotConfigured, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(connection) { if(!silence_conn_err) - throw Exception(ConnectionAlreadyStablished, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::ConnectionAlreadyStablished, __PRETTY_FUNCTION__, __FILE__, __LINE__); else { QTextStream err(stderr); @@ -240,8 +240,8 @@ void Connection::connect(void) if(connection==nullptr || PQstatus(connection)==CONNECTION_BAD) { //Raise the error generated by the DBMS - throw Exception(Exception::getErrorMessage(ConnectionNotStablished) - .arg(PQerrorMessage(connection)), ConnectionNotStablished, + throw Exception(Exception::getErrorMessage(ErrorCode::ConnectionNotStablished) + .arg(PQerrorMessage(connection)), ErrorCode::ConnectionNotStablished, __PRETTY_FUNCTION__, __FILE__, __LINE__); } @@ -272,7 +272,7 @@ void Connection::reset(void) { //Raise an erro in case the user try to reset a not opened connection if(!connection) - throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Reinicia a conexão PQreset(connection); @@ -293,7 +293,7 @@ attribs_map Connection::getServerInfo(void) attribs_map info; if(!connection) - throw Exception(OprNotAllocatedConnection,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedConnection,__PRETTY_FUNCTION__,__FILE__,__LINE__); info[ServerPid]=QString::number(PQbackendPID(connection)); info[ServerVersion]=getPgSQLVersion(); @@ -351,7 +351,7 @@ QString Connection::getPgSQLVersion(bool major_only) QString raw_ver, fmt_ver; if(!connection) - throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); raw_ver=QString("%1").arg(PQserverVersion(connection)); @@ -392,7 +392,7 @@ void Connection::executeDMLCommand(const QString &sql, ResultSet &result) //Raise an error in case the user try to close a not opened connection if(!connection) - throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); validateConnectionStatus(); notices.clear(); @@ -410,9 +410,9 @@ void Connection::executeDMLCommand(const QString &sql, ResultSet &result) //Raise an error in case the command sql execution is not sucessful if(strlen(PQerrorMessage(connection))>0) { - throw Exception(Exception::getErrorMessage(SQLCommandNotExecuted) + throw Exception(Exception::getErrorMessage(ErrorCode::SQLCommandNotExecuted) .arg(PQerrorMessage(connection)), - SQLCommandNotExecuted, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, + ErrorCode::SQLCommandNotExecuted, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, QString(PQresultErrorField(sql_res, PG_DIAG_SQLSTATE))); } @@ -433,7 +433,7 @@ void Connection::executeDDLCommand(const QString &sql) //Raise an error in case the user try to close a not opened connection if(!connection) - throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); validateConnectionStatus(); notices.clear(); @@ -453,9 +453,9 @@ void Connection::executeDDLCommand(const QString &sql) PQclear(sql_res); - throw Exception(Exception::getErrorMessage(SQLCommandNotExecuted) + throw Exception(Exception::getErrorMessage(ErrorCode::SQLCommandNotExecuted) .arg(PQerrorMessage(connection)), - SQLCommandNotExecuted, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, field); + ErrorCode::SQLCommandNotExecuted, __PRETTY_FUNCTION__, __FILE__, __LINE__, nullptr, field); } PQclear(sql_res); @@ -464,7 +464,7 @@ void Connection::executeDDLCommand(const QString &sql) void Connection::setDefaultForOperation(unsigned op_id, bool value) { if(op_id > OpNone) - throw Exception(RefElementInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(op_id!=OpNone) default_for_oper[op_id]=value; } @@ -472,7 +472,7 @@ void Connection::setDefaultForOperation(unsigned op_id, bool value) bool Connection::isDefaultForOperation(unsigned op_id) { if(op_id > OpNone) - throw Exception(RefElementInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(op_id==OpNone) return(false); @@ -522,7 +522,7 @@ void Connection::operator = (const Connection &conn) void Connection::requestCancel(void) { if(!connection) - throw Exception(OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::OprNotAllocatedConnection, __PRETTY_FUNCTION__, __FILE__, __LINE__); PQrequestCancel(connection); } diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index 0083357a58..61cf5d3ad4 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -32,7 +32,7 @@ ResultSet::ResultSet(PGresult *sql_result) int res_state; if(!sql_result) - throw Exception(AsgNotAllocatedSQLResult, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::AsgNotAllocatedSQLResult, __PRETTY_FUNCTION__, __FILE__, __LINE__); this->sql_result=sql_result; res_state=PQresultStatus(this->sql_result); @@ -42,14 +42,14 @@ ResultSet::ResultSet(PGresult *sql_result) { //Generating an error in case the server returns an incomprehensible response case PGRES_BAD_RESPONSE: - throw Exception(IncomprehensibleDBMSResponse, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::IncomprehensibleDBMSResponse, __PRETTY_FUNCTION__, __FILE__, __LINE__); break; //Generating an error in case the server returns a fatal error case PGRES_FATAL_ERROR: - str_aux=Exception::getErrorMessage(DBMSFatalError) + str_aux=Exception::getErrorMessage(ErrorCode::DBMSFatalError) .arg(PQresultErrorMessage(sql_result)); - throw Exception(str_aux,DBMSFatalError, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(str_aux,ErrorCode::DBMSFatalError, __PRETTY_FUNCTION__, __FILE__, __LINE__); break; //In case of sucess states the result will be created @@ -89,7 +89,7 @@ QString ResultSet::getColumnName(int column_idx) { //Throws an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Returns the column name on the specified index return(QString(PQfname(sql_result, column_idx))); @@ -99,7 +99,7 @@ unsigned ResultSet::getColumnTypeId(int column_idx) { //Throws an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Returns the column type id on the specified index return(static_cast(PQftype(sql_result, column_idx))); @@ -115,7 +115,7 @@ int ResultSet::getColumnIndex(const QString &column_name) /* In case the index is negative indicates that the column doesn't exists in the tuple thus an error will be raised */ if(col_idx < 0) - throw Exception(RefTupleColumnInvalidName, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefTupleColumnInvalidName, __PRETTY_FUNCTION__, __FILE__, __LINE__); return(col_idx); } @@ -128,9 +128,9 @@ int ResultSet::validateColumnName(const QString &column_name) a tuple of an empty result or generated from an INSERT, DELETE, UPDATE, that is, which command do not return lines but only do updates or removal */ if(getTupleCount()==0 || empty_result) - throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(current_tuple < 0 || current_tuple >= getTupleCount()) - throw Exception(RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Get the column index through its name return (getColumnIndex(column_name)); @@ -152,14 +152,14 @@ void ResultSet::validateColumnIndex(int column_idx) { //Raise an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); /* Raises an error if the user try to get the value of a column in a tuple of an empty result or generated from an INSERT, DELETE, UPDATE, that is, which command do not return lines but only do updates or removal */ else if(getTupleCount()==0 || empty_result) - throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(current_tuple < 0 || current_tuple >= getTupleCount()) - throw Exception(RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); } char *ResultSet::getColumnValue(int column_idx) @@ -194,9 +194,9 @@ int ResultSet::getColumnSize(int column_idx) { //Raise an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); else if(current_tuple < 0 || current_tuple >= getTupleCount()) - throw Exception(RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefInvalidTupleColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Retorns the column value length on the current tuple return(PQgetlength(sql_result, current_tuple, column_idx)); @@ -207,7 +207,7 @@ attribs_map ResultSet::getTupleValues(void) attribs_map tup_vals; if(current_tuple < 0 || current_tuple >= getTupleCount()) - throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); for(int col=0; col < getColumnCount(); col++) tup_vals[getColumnName(col)]=getColumnValue(col); @@ -260,7 +260,7 @@ bool ResultSet::isColumnBinaryFormat(int column_idx) { //Raise an error in case the column index is invalid if(column_idx < 0 || column_idx >= getColumnCount()) - throw Exception(RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefTupleColumnInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); /* Returns the column format in the current tuple. According to libpq documentation, value = 0, indicates column text format, @@ -279,7 +279,7 @@ bool ResultSet::accessTuple(unsigned tuple_type) The tuple type to be accessed is invalid, out of set defined by the class */ if(empty_result || tuple_type > NextTuple) - throw Exception(RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); + throw Exception(ErrorCode::RefInvalidTuple, __PRETTY_FUNCTION__, __FILE__, __LINE__); if(tuple_count==0) return(false); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index f03a91abbb..0c60570f36 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -36,14 +36,14 @@ void Aggregate::setFunction(unsigned func_idx, Function *func) { //Case the function index is invalid raises an error if(func_idx!=FinalFunc && func_idx!=TransitionFunc) - throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Checks if the function is valid, if not the case raises an error if(!isValidFunction(func_idx, func)) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidConfiguration) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidConfiguration) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjAggregate)), - AsgFunctionInvalidConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(functions[func_idx]!=func); functions[func_idx]=func; @@ -124,11 +124,11 @@ void Aggregate::setSortOperator(Operator *sort_op) func=sort_op->getFunction(Operator::FUNC_OPERATOR); //Validating the condition 1 if(data_types.size()!=1) - throw Exception(AsgInvalidOperatorArguments,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidOperatorArguments,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Validating the condition 2 else if(func->getParameter(0).getType()!=data_types[0] || (func->getParameterCount()==2 && func->getParameter(1).getType()!=data_types[0])) - throw Exception(AsgInvalidOperatorTypes,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidOperatorTypes,__PRETTY_FUNCTION__,__FILE__,__LINE__); } setCodeInvalidated(sort_operator != sort_op); @@ -168,7 +168,7 @@ void Aggregate::removeDataType(unsigned type_idx) { //Raises an exception if the type index is out of bound if(type_idx >= data_types.size()) - throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Removes the type at the specified position data_types.erase(data_types.begin() + type_idx); @@ -190,7 +190,7 @@ Function *Aggregate::getFunction(unsigned func_idx) { //Raises an exception if the function index is invalid if(func_idx!=FinalFunc && func_idx!=TransitionFunc) - throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_idx]); } @@ -214,7 +214,7 @@ PgSQLType Aggregate::getDataType(unsigned type_idx) { //Raises an exception if the type index is out of bound if(type_idx >= data_types.size()) - throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(data_types[type_idx]); } diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 73ad648fdc..fdddd37bc2 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -348,12 +348,12 @@ void BaseObject::setName(const QString &name) if(!isValidName(aux_name)) { if(aux_name.isEmpty()) - throw Exception(AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the name is quoted we add 2 bytes to the maximum in order to check if it exceeds the limit else if(aux_name.size() > (ObjectNameMaxLength + (is_quoted ? 2 : 0))) - throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else - throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } aux_name.remove('"'); @@ -364,7 +364,7 @@ void BaseObject::setName(const QString &name) void BaseObject::setAlias(const QString &alias) { if(alias.size() > ObjectNameMaxLength) - throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->alias = alias; setCodeInvalidated(this->alias != alias); @@ -492,14 +492,14 @@ bool BaseObject::acceptsDropCommand(void) void BaseObject::setSchema(BaseObject *schema) { if(!schema) - throw Exception(Exception::getErrorMessage(AsgNotAllocatedSchema) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedSchema) .arg(this->obj_name) .arg(this->getTypeName()), - AsgNotAllocatedSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(schema && schema->getObjectType()!=ObjectType::ObjSchema) - throw Exception(AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsSchema()) - throw Exception(AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->schema != schema); this->schema=schema; @@ -508,9 +508,9 @@ void BaseObject::setSchema(BaseObject *schema) void BaseObject::setOwner(BaseObject *owner) { if(owner && owner->getObjectType()!=ObjectType::ObjRole) - throw Exception(AsgInvalidRoleObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidRoleObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsOwner()) - throw Exception(AsgRoleObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgRoleObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->owner != owner); this->owner=owner; @@ -519,9 +519,9 @@ void BaseObject::setOwner(BaseObject *owner) void BaseObject::setTablespace(BaseObject *tablespace) { if(tablespace && tablespace->getObjectType()!=ObjectType::ObjTablespace) - throw Exception(AsgInvalidTablespaceObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTablespaceObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsTablespace()) - throw Exception(AsgTablespaceInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgTablespaceInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->tablespace != tablespace); this->tablespace=tablespace; @@ -530,9 +530,9 @@ void BaseObject::setTablespace(BaseObject *tablespace) void BaseObject::setCollation(BaseObject *collation) { if(collation && !acceptsCollation()) - throw Exception(AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(collation && collation->getObjectType()!=ObjectType::ObjCollation) - throw Exception(AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->collation != collation); this->collation=collation; @@ -541,7 +541,7 @@ void BaseObject::setCollation(BaseObject *collation) void BaseObject::setAppendedSQL(const QString &sql) { if(!acceptsCustomSQL()) - throw Exception(AsgCustomSQLObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgCustomSQLObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->appended_sql != sql); this->appended_sql=sql; @@ -550,7 +550,7 @@ void BaseObject::setAppendedSQL(const QString &sql) void BaseObject::setPrependedSQL(const QString &sql) { if(!acceptsCustomSQL()) - throw Exception(AsgCustomSQLObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgCustomSQLObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->prepended_sql != sql); this->prepended_sql=sql; @@ -856,11 +856,11 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) schparser.restartParser(); clearAttributes(); - if(e.getErrorType()==UndefinedAttributeValue) - throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) + if(e.getErrorType()==ErrorCode::UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(this->getName(true)) .arg(this->getTypeName()), - AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } @@ -892,26 +892,26 @@ void BaseObject::swapObjectsIds(BaseObject *obj1, BaseObject *obj2, bool enable_ { //Raises an error if some of the objects aren't allocated if(!obj1 || !obj2) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the involved objects are the same else if(obj1==obj2) - throw Exception(InvIdSwapSameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvIdSwapSameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the some of the objects are system objects else if(obj1->isSystemObject()) - throw Exception(Exception::getErrorMessage(OprReservedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) .arg(obj1->getName()) .arg(obj1->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(obj2->isSystemObject()) - throw Exception(Exception::getErrorMessage(OprReservedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) .arg(obj2->getName()) .arg(obj2->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the object is object is cluster level and the swap of these types isn't enabled else if(!enable_cl_obj_swap && (obj1->getObjectType()==ObjectType::ObjDatabase || obj1->getObjectType()==ObjectType::ObjTablespace || obj1->getObjectType()==ObjectType::ObjRole || obj2->getObjectType()==ObjectType::ObjDatabase || obj2->getObjectType()==ObjectType::ObjTablespace || obj2->getObjectType()==ObjectType::ObjRole)) - throw Exception(InvIdSwapInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvIdSwapInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { unsigned id_bkp=obj1->object_id; @@ -924,12 +924,12 @@ void BaseObject::updateObjectId(BaseObject *obj) { //Raises an error if some of the objects aren't allocated if(!obj) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(obj->isSystemObject()) - throw Exception(Exception::getErrorMessage(OprReservedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) .arg(obj->getName()) .arg(obj->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else obj->object_id=++global_id; } @@ -1075,9 +1075,9 @@ bool BaseObject::isCodeDiffersFrom(const QString &xml_def1, const QString &xml_d bool BaseObject::isCodeDiffersFrom(BaseObject *object, const vector &ignored_attribs, const vector &ignored_tags) { if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(object->getObjectType()!=this->getObjectType()) - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -1182,12 +1182,12 @@ QString BaseObject::getAlterDefinition(BaseObject *object) QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff) { if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); QString alter; if(object->obj_type!=this->obj_type) - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setBasicAttributes(true); diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 683d80c0c9..219ed8f60b 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -34,6 +34,7 @@ #include #include #include +#include enum ObjectType { ObjColumn, diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 82324c3cd2..b38c9f20ea 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -22,7 +22,7 @@ BaseRelationship::BaseRelationship(BaseRelationship *rel) { if(!rel) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); for(unsigned i=0; i < 3; i++) lables[i]=nullptr; @@ -123,15 +123,15 @@ void BaseRelationship::configureRelationship(void) { //Raises an error if one of the tables is not allocated if(!src_table || !dst_table) - throw Exception(Exception::getErrorMessage(AsgNotAllocatedTable) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedTable) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjBaseRelationship)), - AsgNotAllocatedTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the relationship type is generalization or dependency and the source and destination table are the same. */ if((rel_type==RelationshipGen || rel_type==RelationshipDep || rel_type==RelationshipPart) && src_table==dst_table) - throw Exception(InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Allocates the textbox for the name label lables[RelNameLabel]=new Textbox; @@ -154,7 +154,7 @@ void BaseRelationship::configureRelationship(void) } else //Raises an error if the specified relationship typ is invalid - throw Exception(AllocationObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AllocationObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } BaseRelationship::~BaseRelationship(void) @@ -193,7 +193,7 @@ void BaseRelationship::setMandatoryTable(unsigned table_id, bool value) if(rel_type==Relationship11 && ((table_id==SrcTable && value && dst_mandatory) || (table_id==DstTable && value && src_mandatory))) - throw Exception(NotImplementedRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::NotImplementedRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Case the source table is mandatory if(table_id==SrcTable) @@ -304,9 +304,9 @@ Textbox *BaseRelationship::getLabel(unsigned label_id) { if(label_id<=RelNameLabel) return(lables[label_id]); - else - //Raises an error when the label id is invalid - throw Exception(RefLabelInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + //Raises an error when the label id is invalid + throw Exception(ErrorCode::RefLabelInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); } unsigned BaseRelationship::getRelationshipType(void) @@ -438,7 +438,7 @@ void BaseRelationship::setPoints(const vector &points) void BaseRelationship::setLabelDistance(unsigned label_id, QPointF label_dist) { if(label_id > RelNameLabel) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->lables_dist[label_id]=label_dist; this->setCodeInvalidated(true); @@ -447,7 +447,7 @@ void BaseRelationship::setLabelDistance(unsigned label_id, QPointF label_dist) QPointF BaseRelationship::getLabelDistance(unsigned label_id) { if(label_id > RelNameLabel) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->lables_dist[label_id]); } diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 993ec7ac7d..92354c64d5 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -38,17 +38,17 @@ void Cast::setDataType(unsigned type_idx, PgSQLType type) { //Raises an error if the passed data type is null if((*type).isEmpty()) - throw Exception(Exception::getErrorMessage(AsgNullTypeObject) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNullTypeObject) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjCast)), - AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->types[type_idx] != type); this->types[type_idx]=type; } else //Raises an error if the type index is invalid - throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the cast name (in form of signature: cast(src_type, dst_type) ) this->obj_name=QString("cast(%1,%2)").arg(~types[SrcType]).arg(~types[DstType]); @@ -58,7 +58,7 @@ void Cast::setCastType(unsigned cast_type) { //Raises an error if the user tries to assign an invalid cast type if(cast_type > Implicit) - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->cast_type != cast_type); this->cast_type=cast_type; @@ -77,20 +77,20 @@ void Cast::setCastFunction(Function *cast_func) PgSQLType ret_type; if(!cast_func) - throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjCast)), - AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Retrieve the cast function parameter count for specific validations param_count=cast_func->getParameterCount(); //Raises an error if the function don't have at least 1 parameter or a maximum of 3 if(param_count==0 || param_count > 3) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjCast)), - AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { /* Error condition 1: Check if the first function parameter data type differs @@ -110,10 +110,10 @@ void Cast::setCastFunction(Function *cast_func) //In case some error condition is reached raises an error if(error) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjCast)), - AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } /* Raises an error if the return type of the function differs from the destination data type. @@ -121,10 +121,10 @@ void Cast::setCastFunction(Function *cast_func) ret_type=cast_func->getReturnType(); if(ret_type!=this->types[DstType] && !ret_type.canCastTo(this->types[DstType])) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjCast)), - AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(cast_function != cast_func); this->cast_function=cast_func; @@ -133,7 +133,7 @@ void Cast::setCastFunction(Function *cast_func) PgSQLType Cast::getDataType(unsigned type_idx) { if(type_idx > DstType) - throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->types[type_idx]); } diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index 3edb30ee75..541670bc21 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -41,7 +41,7 @@ void Collation::setLocalization(unsigned lc_id, QString lc_name) if(locale.isEmpty()) { if(lc_id > LcCollate) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Removes encoding specification from localization e.g 'aa_BB.ENC' will turn into 'aa_BB' since the encoding is appended on code generation */ @@ -60,10 +60,10 @@ void Collation::setEncoding(EncodingType encoding) void Collation::setCollation(BaseObject *collation) { if(collation==this) - throw Exception(Exception::getErrorMessage(ObjectReferencingItself) + throw Exception(Exception::getErrorMessage(ErrorCode::ObjectReferencingItself) .arg(this->getName(true)) .arg(this->getTypeName()), - ObjectReferencingItself,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::ObjectReferencingItself,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setCollation(collation); @@ -80,7 +80,7 @@ QString Collation::getLocale(void) QString Collation::getLocalization(unsigned lc_id) { if(lc_id > LcCollate) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(localization[lc_id]); } @@ -114,7 +114,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) QString lc_attribs[2]={ ParsersAttributes::_LC_CTYPE_, ParsersAttributes::_LC_COLLATE_ }; if(localization[LcCtype].isEmpty() && localization[LcCollate].isEmpty()) - throw Exception(EmptyLCCollationAttributes,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::EmptyLCCollationAttributes,__PRETTY_FUNCTION__,__FILE__,__LINE__); for(unsigned int i=LcCtype; i <= LcCollate; i++) { diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 1d1fafb797..de9a8d9aca 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -153,7 +153,7 @@ QString Column::getOldName(bool format) void Column::setParentRelationship(BaseObject *parent_rel) { if(parent_rel && parent_rel->getObjectType()!=ObjectType::ObjRelationship) - throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->parent_rel=parent_rel; } @@ -168,16 +168,16 @@ void Column::setSequence(BaseObject *seq) if(seq) { if(seq->getObjectType()!=ObjectType::ObjSequence) - throw Exception(Exception::getErrorMessage(AsgInvalidObjectType) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) .arg(BaseObject::getTypeName(ObjectType::ObjSequence)), - AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!type.isIntegerType()) - throw Exception(Exception::getErrorMessage(IncompColumnTypeForSequence) + throw Exception(Exception::getErrorMessage(ErrorCode::IncompColumnTypeForSequence) .arg(seq->getName(true)) .arg(this->obj_name), - IncompColumnTypeForSequence,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::IncompColumnTypeForSequence,__PRETTY_FUNCTION__,__FILE__,__LINE__); default_value=QString(); identity_type=BaseType::null; @@ -279,7 +279,7 @@ QString Column::getAlterDefinition(BaseObject *object) Column *col=dynamic_cast(object); if(!col) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 5a8c94ef6a..6100a24c66 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -88,7 +88,7 @@ bool Constraint::isColumnExists(Column *column, unsigned col_type) //Raises an error if the column is not allocated if(!column) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Gets the iterators from the specified internal list if(col_type==SourceCols) @@ -176,7 +176,7 @@ void Constraint::setTablespace(BaseObject *tabspc) if(tabspc && constr_type!=ConstraintType::primary_key && constr_type!=ConstraintType::unique) - throw Exception(AsgTablespaceInvalidConstraintType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgTablespaceInvalidConstraintType,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setTablespace(tabspc); } @@ -297,7 +297,7 @@ Column *Constraint::getColumn(unsigned col_idx, unsigned col_type) //Raises an error if the column index is invalid (out of bound) if(col_idx>=col_list->size()) - throw Exception(RefColumnInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefColumnInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(col_list->at(col_idx)); } @@ -506,9 +506,10 @@ void Constraint::addExcludeElements(vector &elems) void Constraint::addExcludeElement(ExcludeElement elem) { if(getExcludeElementIndex(elem) >= 0) - throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(elem.getExpression().isEmpty() && !elem.getColumn()) - throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + if(elem.getExpression().isEmpty() && !elem.getColumn()) + throw Exception(ErrorCode::AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); excl_elements.push_back(elem); setCodeInvalidated(true); @@ -522,7 +523,7 @@ void Constraint::addExcludeElement(const QString &expr, Operator *oper, Operator //Raises an error if the expression is empty if(expr.isEmpty()) - throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the element elem.setExpression(expr); @@ -533,7 +534,7 @@ void Constraint::addExcludeElement(const QString &expr, Operator *oper, Operator elem.setSortingAttribute(ExcludeElement::AscOrder, asc_order); if(getExcludeElementIndex(elem) >= 0) - throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); excl_elements.push_back(elem); setCodeInvalidated(true); @@ -566,7 +567,7 @@ void Constraint::addExcludeElement(Column *column, Operator *oper, OperatorClass elem.setSortingAttribute(ExcludeElement::AscOrder, asc_order); if(getExcludeElementIndex(elem) >= 0) - throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); excl_elements.push_back(elem); setCodeInvalidated(true); @@ -580,7 +581,7 @@ void Constraint::addExcludeElement(Column *column, Operator *oper, OperatorClass void Constraint::removeExcludeElement(unsigned elem_idx) { if(elem_idx >= excl_elements.size()) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); excl_elements.erase(excl_elements.begin() + elem_idx); setCodeInvalidated(true); @@ -607,7 +608,7 @@ void Constraint::setColumnsNotNull(bool value) ExcludeElement Constraint::getExcludeElement(unsigned elem_idx) { if(elem_idx >= excl_elements.size()) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(excl_elements[elem_idx]); } @@ -746,9 +747,9 @@ QString Constraint::getSignature(bool format) bool Constraint::isCodeDiffersFrom(BaseObject *object, const vector &ignored_attribs, const vector &ignored_tags) { if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(object->getObjectType()!=this->getObjectType()) - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index 8eaf9b6b6b..a59c163c92 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -36,34 +36,34 @@ void Conversion::setEncoding(unsigned encoding_idx, EncodingType encoding_type) { //If the passed enconding type is null an error is raised if((~encoding_type).isEmpty()) - throw Exception(Exception::getErrorMessage(AsgNullTypeObject) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNullTypeObject) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), - AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Assigns the encoding to the conversion in the specified index this->encodings[encoding_idx]=encoding_type; } else //Raises an error if the encoding index is invalid - throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void Conversion::setConversionFunction(Function *conv_func) { //Raises an error in case the passed conversion function is null if(!conv_func) - throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), - AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* The conversion function must have 5 parameters if it's not the case raises an error. */ else if(conv_func->getParameterCount()!=5) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), - AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the function parameters does not following the type order: interger, integer, cstring, internal, integer */ else if(conv_func->getParameter(0).getType()!=QString("integer") || @@ -71,16 +71,16 @@ void Conversion::setConversionFunction(Function *conv_func) conv_func->getParameter(2).getType()!=QString("cstring") || conv_func->getParameter(3).getType()!=QString("internal") || conv_func->getParameter(4).getType()!=QString("integer")) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), - AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the conversion function return type is not 'void' else if(conv_func->getReturnType()!=QString("void")) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), - AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(conversion_func != conv_func); this->conversion_func=conv_func; @@ -95,7 +95,7 @@ void Conversion::setDefault(bool value) EncodingType Conversion::getEncoding(unsigned encoding_idx) { if(encoding_idx > DstEncoding) - throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(this->encodings[encoding_idx]); } diff --git a/libpgmodeler/src/copyoptions.cpp b/libpgmodeler/src/copyoptions.cpp index 9501a62e6f..b73aad0659 100644 --- a/libpgmodeler/src/copyoptions.cpp +++ b/libpgmodeler/src/copyoptions.cpp @@ -27,7 +27,7 @@ CopyOptions::CopyOptions(void) CopyOptions::CopyOptions(unsigned copy_mode, unsigned copy_op_ids) { if((copy_mode!=0 && copy_mode!=Including && copy_mode!=Excluding) || copy_op_ids > All) - throw Exception(RefInvalidLikeOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidLikeOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->copy_mode = copy_mode; this->copy_op_ids = copy_op_ids; @@ -41,7 +41,7 @@ unsigned CopyOptions::getCopyMode(void) bool CopyOptions::isOptionSet(unsigned op) { if(op > All) - throw Exception(RefInvalidLikeOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidLikeOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return((copy_op_ids & op) == op); } diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 7367ce9ad3..a1cecf8e32 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -76,7 +76,7 @@ void DatabaseModel::setEncoding(EncodingType encod) void DatabaseModel::setLocalization(unsigned localiz_id, const QString &value) { if(localiz_id > Collation::LcCollate) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); localizations[localiz_id]=value; } @@ -90,7 +90,7 @@ void DatabaseModel::setConnectionLimit(int conn_lim) void DatabaseModel::setTemplateDB(const QString &temp_db) { if(!temp_db.isEmpty() && !BaseObject::isValidName(temp_db)) - throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->template_db=temp_db; } @@ -296,7 +296,7 @@ void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) if(TableObject::isTableObject(obj_type) || obj_type==ObjectType::ObjBaseObject || obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjDatabase) - throw Exception(RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -305,7 +305,7 @@ void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) obj_list=getObjectList(obj_type); if(obj_idx >= obj_list->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); object=(*obj_list)[obj_idx]; if(obj_type==ObjectType::ObjTextbox) @@ -363,7 +363,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) vector::iterator itr, itr_end; if(!object) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=object->getObjectType(); @@ -396,10 +396,10 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) there is some other tablespace pointing to the same directory */ if(tabspc->getDirectory()==aux_tabspc->getDirectory()) { - throw Exception(Exception::getErrorMessage(AsgTablespaceDuplicatedDirectory) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgTablespaceDuplicatedDirectory) .arg(tabspc->getName()) .arg(aux_tabspc->getName()), - AsgTablespaceDuplicatedDirectory,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgTablespaceDuplicatedDirectory,__PRETTY_FUNCTION__,__FILE__,__LINE__); } itr++; @@ -418,13 +418,13 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) { QString str_aux; - str_aux=Exception::getErrorMessage(AsgDuplicatedObject) + str_aux=Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(object->getName(obj_type != ObjectType::ObjExtension)) .arg(object->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); - throw Exception(str_aux,AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } try @@ -464,7 +464,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_refs) { if(!object) - throw Exception(RemNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RemNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { vector *obj_list=nullptr; @@ -474,7 +474,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { vector refs; @@ -491,7 +491,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r //Raises an error indicating the object that is referencing the table if(!dynamic_cast(refs[0])) { - err_code=RemDirectReference; + err_code=ErrorCode::RemDirectReference; throw Exception(Exception::getErrorMessage(err_code) .arg(object->getName(true)) .arg(object->getTypeName()) @@ -503,7 +503,7 @@ void DatabaseModel::__removeObject(BaseObject *object, int obj_idx, bool check_r { BaseObject *ref_obj_parent=dynamic_cast(refs[0])->getParentTable(); - err_code=RemInderectReference; + err_code=ErrorCode::RemInderectReference; throw Exception(Exception::getErrorMessage(err_code) .arg(object->getName(true)) .arg(object->getTypeName()) @@ -541,7 +541,7 @@ vector DatabaseModel::getObjects(ObjectType obj_type, BaseObject * obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=obj_list->begin(); itr_end=obj_list->end(); @@ -598,7 +598,7 @@ BaseObject *DatabaseModel::getObject(const QString &name, ObjectType obj_type, i obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { QString signature; @@ -633,9 +633,9 @@ BaseObject *DatabaseModel::getObject(unsigned obj_idx, ObjectType obj_type) obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(obj_idx >= obj_list->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); else return(obj_list->at(obj_idx)); } @@ -647,7 +647,7 @@ unsigned DatabaseModel::getObjectCount(ObjectType obj_type) obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else return(obj_list->size()); } @@ -680,7 +680,7 @@ unsigned DatabaseModel::getObjectCount(void) QString DatabaseModel::getLocalization(unsigned localiz_id) { if(localiz_id > Collation::LcCollate) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(localizations[localiz_id]); } @@ -703,7 +703,7 @@ EncodingType DatabaseModel::getEncoding(void) BaseObject *DatabaseModel::getDefaultObject(ObjectType obj_type) { if(default_objs.count(obj_type)==0) - throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); return(default_objs[obj_type]); } @@ -1113,7 +1113,7 @@ void DatabaseModel::removeView(View *view, int obj_idx) void DatabaseModel::updateTableFKRelationships(Table *table) { if(!table) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(table->getDatabase()==this) { Table *ref_tab=nullptr; @@ -1215,7 +1215,7 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) vector::iterator itr, itr_end; if(!view) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(getObjectIndex(view) < 0 || force_rel_removal) { //Remove all the relationship related to the view when this latter no longer exists @@ -1475,7 +1475,7 @@ void DatabaseModel::validateRelationships(void) /* If the relationship connection failed after 'rels_gen_pk' times at the different errors or exists on the fail_rels vector (already tried to be validated) it will be deleted from model */ - if((e.getErrorType()!=InvLinkTablesNoPrimaryKey && conn_tries[rel] > rels_gen_pk) || + if((e.getErrorType() != ErrorCode::InvLinkTablesNoPrimaryKey && conn_tries[rel] > rels_gen_pk) || (std::find(fail_rels.begin(), fail_rels.end(), rel)!=fail_rels.end())) { //Removes the relationship @@ -1491,7 +1491,7 @@ void DatabaseModel::validateRelationships(void) the connection tries exceed the size of the relationship the relationship is isolated on a "failed to validate" list. This list will be appended to the main rel list when there is only one relationship to be validated */ - else if(e.getErrorType()==InvLinkTablesNoPrimaryKey && + else if(e.getErrorType()==ErrorCode::InvLinkTablesNoPrimaryKey && (conn_tries[rel] > rels.size() || rel->getRelationshipType()==BaseRelationship::RelationshipNn)) { @@ -1617,7 +1617,7 @@ void DatabaseModel::validateRelationships(void) this->setObjectsModified(); //Redirects all the errors captured on the revalidation - throw Exception(RemInvalidatedObjects,__PRETTY_FUNCTION__,__FILE__,__LINE__,errors); + throw Exception(ErrorCode::RemInvalidatedObjects,__PRETTY_FUNCTION__,__FILE__,__LINE__,errors); } if(!loading_model) @@ -1637,7 +1637,7 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) //Raises an error if the user try to check the redundancy starting from a unnallocated relationship if(!rel) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); rel_type=rel->getRelationshipType(); @@ -1713,10 +1713,10 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) if(found_cycle) { str_aux+=rel->getName(); - msg=Exception::getErrorMessage(InsRelationshipRedundancy) + msg=Exception::getErrorMessage(ErrorCode::InsRelationshipRedundancy) .arg(rel->getName()) .arg(str_aux); - throw Exception(msg,InsRelationshipRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg,ErrorCode::InsRelationshipRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -1986,12 +1986,12 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) rel->getRelationshipType() != Relationship::RelationshipFk && getRelationship(tab1,tab2)) { - msg=Exception::getErrorMessage(InsDuplicatedRelationship) + msg=Exception::getErrorMessage(ErrorCode::InsDuplicatedRelationship) .arg(tab1->getName(true)) .arg(tab1->getTypeName()) .arg(tab2->getName(true)) .arg(tab2->getTypeName()); - throw Exception(msg,InsDuplicatedRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg,ErrorCode::InsDuplicatedRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -2065,7 +2065,7 @@ BaseRelationship *DatabaseModel::getRelationship(unsigned obj_idx, ObjectType re { //Raises an error if the object type used to get a relationship is invalid if(rel_type!=ObjectType::ObjRelationship && rel_type!=ObjectType::ObjBaseRelationship) - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(getObject(obj_idx, rel_type))); } @@ -2477,12 +2477,12 @@ void DatabaseModel::addDomain(Domain *domain, int obj_idx) //Raises an error if found a type with the same name as the domain if(found) { - str_aux=Exception::getErrorMessage(AsgDuplicatedObject) + str_aux=Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(domain->getName(true)) .arg(domain->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); - throw Exception(str_aux, AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux, ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } try @@ -2643,12 +2643,12 @@ void DatabaseModel::addType(Type *type, int obj_idx) if(found) { - str_aux=Exception::getErrorMessage(AsgDuplicatedObject) + str_aux=Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(type->getName(true)) .arg(type->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); - throw Exception(str_aux, AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux, ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } try @@ -2735,39 +2735,39 @@ void DatabaseModel::addPermission(Permission *perm) try { if(!perm) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); TableObject *tab_obj=dynamic_cast(perm->getObject()); if(getPermissionIndex(perm, false) >=0) { - throw Exception(Exception::getErrorMessage(AsgDuplicatedPermission) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedPermission) .arg(perm->getObject()->getName()) .arg(perm->getObject()->getTypeName()), - AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the permission is referencing an object that does not exists on model else if(perm->getObject()!=this && ((tab_obj && (getObjectIndex(tab_obj->getParentTable()) < 0)) || (!tab_obj && (getObjectIndex(perm->getObject()) < 0)))) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(perm->getName()) .arg(perm->getObject()->getTypeName()) .arg(perm->getObject()->getName()) .arg(perm->getObject()->getTypeName()), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); permissions.push_back(perm); perm->setDatabase(this); } catch(Exception &e) { - if(e.getErrorType()==AsgDuplicatedObject) + if(e.getErrorType()==ErrorCode::AsgDuplicatedObject) throw - Exception(Exception::getErrorMessage(AsgDuplicatedPermission) + Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedPermission) .arg(perm->getObject()->getName()) .arg(perm->getObject()->getTypeName()), - AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + ErrorCode::AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); @@ -2793,7 +2793,7 @@ void DatabaseModel::removePermissions(BaseObject *object) unsigned idx=0; if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=permissions.begin(); itr_end=permissions.end(); @@ -2821,7 +2821,7 @@ void DatabaseModel::getPermissions(BaseObject *object, vector &per Permission *perm=nullptr; if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=permissions.begin(); itr_end=permissions.end(); @@ -2935,7 +2935,7 @@ int DatabaseModel::getObjectIndex(BaseObject *object) obj_list=getObjectList(obj_type); if(!obj_list) - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { itr=obj_list->begin(); @@ -3096,12 +3096,12 @@ void DatabaseModel::loadModel(const QString &filename) object=this->getObject(itr.second, itr.first); if(!object) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(this->getName()) .arg(this->getTypeName()) .arg(itr.second) .arg(BaseObject::getTypeName(itr.first)), - AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setDefaultObject(object); } @@ -3141,10 +3141,10 @@ void DatabaseModel::loadModel(const QString &filename) if(xmlparser.getCurrentElement()) extra_info=QString(QObject::trUtf8("%1 (line: %2)")).arg(xmlparser.getLoadedFilename()).arg(xmlparser.getCurrentElement()->line); - if(e.getErrorType()>=InvalidSyntax) + if(e.getErrorType()>=ErrorCode::InvalidSyntax) { - str_aux=Exception::getErrorMessage(InvModelFileNotLoaded).arg(filename); - throw Exception(str_aux,InvModelFileNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); + str_aux=Exception::getErrorMessage(ErrorCode::InvModelFileNotLoaded).arg(filename); + throw Exception(str_aux,ErrorCode::InvModelFileNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); @@ -3234,7 +3234,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) bool has_error=false, protected_obj=false, sql_disabled=false; if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); xmlparser.getElementAttributes(attribs); @@ -3343,12 +3343,12 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) if(has_error) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(object->getName()) .arg(object->getTypeName()) .arg(attribs_aux[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(obj_type)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!object->getSchema() && (obj_type_aux==ObjectType::ObjFunction || obj_type_aux==ObjectType::ObjTable || @@ -3358,10 +3358,10 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) obj_type_aux==ObjectType::ObjType || obj_type_aux==ObjectType::ObjOpFamily || obj_type_aux==ObjectType::ObjOpClass)) { - throw Exception(Exception::getErrorMessage(InvObjectAllocationNoSchema) + throw Exception(Exception::getErrorMessage(ErrorCode::InvObjectAllocationNoSchema) .arg(object->getName()) .arg(object->getTypeName()), - InvObjectAllocationNoSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvObjectAllocationNoSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -3513,12 +3513,12 @@ Role *DatabaseModel::createRole(void) //Raises an error if the roles doesn't exists if(!ref_role) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(role->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjRole)) .arg(list[i]) .arg(BaseObject::getTypeName(ObjectType::ObjRole)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } role->addRole(role_type, ref_role); @@ -3624,12 +3624,12 @@ Language *DatabaseModel::createLanguage(void) //Raises an error if the function doesn't exists if(!func) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(lang->getName()) .arg(lang->getTypeName()) .arg(signature) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(ref_type==ParsersAttributes::VALIDATOR_FUNC) lang->setFunction(dynamic_cast(func), Language::ValidatorFunc); @@ -3641,7 +3641,7 @@ Language *DatabaseModel::createLanguage(void) } else //Raises an error if the function type is invalid - throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -3755,12 +3755,12 @@ Function *DatabaseModel::createFunction(void) //Raises an error if the function doesn't exisits if(!object) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(func->getName()) .arg(func->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); func->setLanguage(dynamic_cast(object)); } @@ -3799,11 +3799,11 @@ Function *DatabaseModel::createFunction(void) delete(func); } - if(e.getErrorType()==RefUserTypeInexistsModel) - throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) + if(e.getErrorType()==ErrorCode::RefUserTypeInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(str_aux) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), - AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); + ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } @@ -3893,12 +3893,12 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) //Raises an error if the operator class doesn't exists if(!collation) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tpattrib.getName()) .arg(tpattrib.getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } tpattrib.setCollation(collation); @@ -3970,7 +3970,7 @@ PgSQLType DatabaseModel::createPgSQLType(void) { //Raises an error if the referenced type name doesn't exists if(PgSQLType::getUserTypeIndex(name,nullptr,this) == BaseType::null) - throw Exception(RefUserTypeInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefUserTypeInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_idx=PgSQLType::getUserTypeIndex(name, ptype); return(PgSQLType(type_idx,length,dimension,precision,with_timezone,interv_type,spatial_type)); @@ -4085,12 +4085,12 @@ Type *DatabaseModel::createType(void) //Raises an error if the operator class doesn't exists if(!collation) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } type->setCollation(collation); @@ -4103,12 +4103,12 @@ Type *DatabaseModel::createType(void) //Raises an error if the operator class doesn't exists if(!op_class) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } type->setSubtypeOpClass(op_class); @@ -4123,15 +4123,15 @@ Type *DatabaseModel::createType(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the function type is invalid else if(func_types.count(attribs[ParsersAttributes::REF_TYPE])==0) - throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); type->setFunction(func_types[attribs[ParsersAttributes::REF_TYPE]], dynamic_cast(func)); } @@ -4148,11 +4148,11 @@ Type *DatabaseModel::createType(void) delete(type); } - if(e.getErrorType()==RefUserTypeInexistsModel) - throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) + if(e.getErrorType()==ErrorCode::RefUserTypeInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(str_aux) .arg(type->getTypeName()), - AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); + ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } @@ -4263,12 +4263,12 @@ Cast *DatabaseModel::createCast(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(cast->getName()) .arg(cast->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); cast->setCastFunction(dynamic_cast(func)); } @@ -4322,12 +4322,12 @@ Conversion *DatabaseModel::createConversion(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(conv->getName()) .arg(conv->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); conv->setConversionFunction(dynamic_cast(func)); } @@ -4387,12 +4387,12 @@ Operator *DatabaseModel::createOperator(void) //Raises an error if the auxiliary operator doesn't exists if(!oper_aux && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(oper->getSignature(true)) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setOperator(dynamic_cast(oper_aux), oper_types[attribs[ParsersAttributes::REF_TYPE]]); @@ -4416,12 +4416,12 @@ Operator *DatabaseModel::createOperator(void) //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(oper->getName()) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setFunction(dynamic_cast(func), func_types[attribs[ParsersAttributes::REF_TYPE]]); @@ -4479,12 +4479,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) //Raises an error if the operator family doesn't exists if(!object) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjOpFamily)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); op_class->setFamily(dynamic_cast(object)); } @@ -4529,12 +4529,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjectType::ObjOpFamily); if(!object && !attribs_aux[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs_aux[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjOpFamily)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); class_elem.setOperatorFamily(dynamic_cast(object)); xmlparser.restorePosition(); @@ -4620,12 +4620,12 @@ Aggregate *DatabaseModel::createAggregate(void) //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(aggreg->getName()) .arg(aggreg->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::TRANSITION_FUNC) aggreg->setFunction(Aggregate::TransitionFunc, @@ -4697,12 +4697,12 @@ Table *DatabaseModel::createTable(void) if(!tag) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)) .arg(aux_attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTag)) - , RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + , ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } table->setTag(dynamic_cast(tag)); @@ -4823,12 +4823,12 @@ Column *DatabaseModel::createColumn(void) seq=getObject(attribs[ParsersAttributes::SEQUENCE], ObjectType::ObjSequence); if(!seq) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjColumn)) .arg(attribs[ParsersAttributes::SEQUENCE]) .arg(BaseObject::getTypeName(ObjectType::ObjSequence)), - PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); column->setSequence(seq); @@ -4893,7 +4893,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) rel=dynamic_cast(parent_obj); else //Raises an error if the user tries to create a constraint in a invalid parent - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -4905,13 +4905,13 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Raises an error if the parent table doesn't exists if(!table) { - str_aux=Exception::getErrorMessage(RefObjectInexistsModel) + str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)); - throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -4939,9 +4939,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Raises an error if the constraint is a primary key and no parent object is specified if(!parent_obj && constr_type==ConstraintType::primary_key) - throw Exception(Exception::getErrorMessage(InvPrimaryKeyAllocation) + throw Exception(Exception::getErrorMessage(ErrorCode::InvPrimaryKeyAllocation) .arg(constr->getName()), - InvPrimaryKeyAllocation,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvPrimaryKeyAllocation,__PRETTY_FUNCTION__,__FILE__,__LINE__); deferrable=(attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::_TRUE_); constr->setDeferrable(deferrable); @@ -4968,13 +4968,13 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Raises an error if the referenced table doesn't exists if(!ref_table) { - str_aux=Exception::getErrorMessage(RefObjectInexistsModel) + str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(constr->getName()) .arg(constr->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)); - throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } constr->setReferencedTable(dynamic_cast(ref_table)); @@ -5119,20 +5119,20 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { - throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5147,12 +5147,12 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec //Raises an error if the operator doesn't exists if(!oper) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } elem.setOperator(oper); @@ -5167,20 +5167,20 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { - throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5207,20 +5207,20 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { if(!is_part_key) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjColumn)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { - throw Exception(Exception::getErrorMessage(PartKeyObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjColumn)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5251,7 +5251,7 @@ QString DatabaseModel::getAlterDefinition(BaseObject *object) DatabaseModel *db_aux=dynamic_cast(object); if(!db_aux) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -5301,13 +5301,13 @@ Index *DatabaseModel::createIndex(void) //Raises an error if the parent table doesn't exists if(!table) { - str_aux=Exception::getErrorMessage(RefObjectInexistsModel) + str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjIndex)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)); - throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } index=new Index; @@ -5380,12 +5380,12 @@ Rule *DatabaseModel::createRule(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView)); if(!table) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjRule)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); rule->setExecutionType(attribs[ParsersAttributes::EXEC_TYPE]); @@ -5459,12 +5459,12 @@ Trigger *DatabaseModel::createTrigger(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView)); if(!table) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); trigger=new Trigger; @@ -5516,12 +5516,12 @@ Trigger *DatabaseModel::createTrigger(void) //Raises an error if the trigger is referencing a inexistent table if(!ref_table) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } trigger->setReferecendTable(dynamic_cast(ref_table)); @@ -5543,13 +5543,13 @@ Trigger *DatabaseModel::createTrigger(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) { - str_aux=Exception::getErrorMessage(RefObjectInexistsModel) + str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)); - throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } trigger->setFunction(dynamic_cast(func)); @@ -5613,12 +5613,12 @@ Policy *DatabaseModel::createPolicy(void) table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); if(!table) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjPolicy)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::_TRUE_); policy->setPolicyCommand(PolicyCmdType(attribs[ParsersAttributes::COMMAND])); @@ -5660,12 +5660,12 @@ Policy *DatabaseModel::createPolicy(void) //Raises an error if the referenced role doesn't exists if(!role) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(policy->getName()) .arg(policy->getTypeName()) .arg(name) .arg(BaseObject::getTypeName(ObjectType::ObjRole)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } policy->addRole(role); @@ -5718,12 +5718,12 @@ EventTrigger *DatabaseModel::createEventTrigger(void) //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(event_trig->getName()) .arg(event_trig->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } event_trig->setFunction(dynamic_cast(func)); @@ -5822,13 +5822,13 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) //Raises an error if the column parent table doesn't exists if(!table) { - str_aux=Exception::getErrorMessage(RefObjectInexistsModel) + str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(sequence->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjSequence)) .arg(tab_name) .arg(BaseObject::getTypeName(ObjectType::ObjTable)); - throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } column=dynamic_cast
(table)->getColumn(col_name); @@ -5838,9 +5838,9 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) //Raises an error if the column doesn't exists if(!column && !ignore_onwer) - throw Exception(Exception::getErrorMessage(AsgInexistentSeqOwnerColumn) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInexistentSeqOwnerColumn) .arg(sequence->getName(true)), - AsgInexistentSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgInexistentSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); sequence->setOwnerColumn(column); } @@ -5903,13 +5903,13 @@ View *DatabaseModel::createView(void) //Raises an error if the table doesn't exists if(!table) { - str_aux=Exception::getErrorMessage(RefObjectInexistsModel) + str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(view->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjView)) .arg(attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)); - throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(!attribs[ParsersAttributes::COLUMN].isEmpty()) @@ -5922,14 +5922,14 @@ View *DatabaseModel::createView(void) //Raises an error if the view references an inexistant column if(!column) { - str_aux=Exception::getErrorMessage(RefObjectInexistsModel) + str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(view->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjView)) .arg(attribs[ParsersAttributes::TABLE] + QString(".") + attribs[ParsersAttributes::COLUMN]) .arg(BaseObject::getTypeName(ObjectType::ObjColumn)); - throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5997,12 +5997,12 @@ View *DatabaseModel::createView(void) if(!tag) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjTable)) .arg(aux_attribs[ParsersAttributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::ObjTag)) - , RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + , ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } view->setTag(dynamic_cast(tag)); @@ -6071,12 +6071,12 @@ Collation *DatabaseModel::createCollation(void) //Raises an error if the copy collation doesn't exists if(!copy_coll) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(collation->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjCollation)) .arg(attribs[ParsersAttributes::COLLATION]) .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } collation->setCollation(dynamic_cast(copy_coll)); @@ -6245,13 +6245,13 @@ BaseRelationship *DatabaseModel::createRelationship(void) //Raises an error if some table doesn't exists if(!tables[i]) { - str_aux=Exception::getErrorMessage(RefObjectInexistsModel) + str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(obj_rel_type)) .arg(attribs[tab_attribs[i]]) .arg(BaseObject::getTypeName(table_types[i])); - throw Exception(str_aux,RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -6291,10 +6291,10 @@ BaseRelationship *DatabaseModel::createRelationship(void) //Throws an error if the relationship was created without a valid foreign key attached to it if(!base_rel->getReferenceForeignKey()) { - throw Exception(Exception::getErrorMessage(InvAllocationFKRelationship) + throw Exception(Exception::getErrorMessage(ErrorCode::InvAllocationFKRelationship) .arg(attribs[ParsersAttributes::NAME]) .arg(src_tab->getName(true)), - InvAllocationFKRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvAllocationFKRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -6302,12 +6302,12 @@ BaseRelationship *DatabaseModel::createRelationship(void) base_rel->setName(attribs[ParsersAttributes::NAME]); if(!base_rel) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(this->getName()) .arg(this->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::ObjBaseRelationship)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); base_rel->blockSignals(loading_model); base_rel->disconnectRelationship(); @@ -6539,10 +6539,10 @@ Permission *DatabaseModel::createPermission(void) //Raises an error if the permission references an object that does not exists if(!object) - throw Exception(Exception::getErrorMessage(PermissionRefInexistObject) + throw Exception(Exception::getErrorMessage(ErrorCode::PermissionRefInexistObject) .arg(obj_name) .arg(BaseObject::getTypeName(obj_type)), - PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); perm=new Permission(object); perm->setRevoke(revoke); @@ -6564,10 +6564,10 @@ Permission *DatabaseModel::createPermission(void) //Raises an error if the referenced role doesn't exists if(!role) { - throw Exception(Exception::getErrorMessage(PermissionRefInexistObject) + throw Exception(Exception::getErrorMessage(ErrorCode::PermissionRefInexistObject) .arg(list[i]) .arg(BaseObject::getTypeName(ObjectType::ObjRole)), - RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6641,12 +6641,12 @@ void DatabaseModel::validateColumnRemoval(Column *column) //Raises an error if there are objects referencing the column if(!refs.empty()) - throw Exception(Exception::getErrorMessage(RemDirectReference) + throw Exception(Exception::getErrorMessage(ErrorCode::RemDirectReference) .arg(column->getParentTable()->getName(true) + QString(".") + column->getName(true)) .arg(column->getTypeName()) .arg(refs[0]->getName(true)) .arg(refs[0]->getTypeName()), - RemDirectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RemDirectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -7402,8 +7402,8 @@ void DatabaseModel::saveModel(const QString &filename, unsigned def_type) output.open(QFile::WriteOnly); if(!output.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), - FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(filename), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -7414,8 +7414,8 @@ void DatabaseModel::saveModel(const QString &filename, unsigned def_type) catch(Exception &e) { if(output.isOpen()) output.close(); - throw Exception(Exception::getErrorMessage(FileNotWrittenInvalidDefinition).arg(filename), - FileNotWrittenInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(Exception::getErrorMessage(ErrorCode::FileNotWrittenInvalidDefinition).arg(filename), + ErrorCode::FileNotWrittenInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -9194,7 +9194,7 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s //Raise an error if the schema is not allocated if(!schema) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Get all the objects on the informed schema for(unsigned i=0; i < 5; i++) @@ -9439,7 +9439,7 @@ void DatabaseModel::setDefaultObject(BaseObject *object, ObjectType obj_type) { if((!object && default_objs.count(obj_type)==0) || (object && default_objs.count(object->getObjectType())==0)) - throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); if(!object) default_objs[obj_type]=nullptr; @@ -9516,8 +9516,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option output.open(QFile::WriteOnly); if(!output.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), - FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(filename), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -9807,8 +9807,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option catch(Exception &e) { if(output.isOpen()) output.close(); - throw Exception(Exception::getErrorMessage(FileNotWrittenInvalidDefinition).arg(filename), - FileNotWrittenInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(Exception::getErrorMessage(ErrorCode::FileNotWrittenInvalidDefinition).arg(filename), + ErrorCode::FileNotWrittenInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index fc5e19a9c1..95c1888ae9 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -32,19 +32,19 @@ void Domain::addCheckConstraint(const QString &name, const QString &expr) { //Raises an error if the constraint name is invalid if(!name.isEmpty() && !BaseObject::isValidName(name)) - throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(expr.isEmpty()) - throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(chk_constrs.count(name)) { - throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(name) .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)) .arg(this->getName(true)) .arg(this->getTypeName()), - AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } chk_constrs[name] = expr; @@ -161,7 +161,7 @@ QString Domain::getAlterDefinition(BaseObject *object) Domain *domain=dynamic_cast(object); if(!domain) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 8948e16af9..1f4a9df6b6 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -53,7 +53,7 @@ void Element::setOperatorClass(OperatorClass *oper_class) void Element::setSortingAttribute(unsigned attrib, bool value) { if(attrib > NullsFirst) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); sorting_attibs[attrib]=value; } @@ -71,7 +71,7 @@ bool Element::isSortingEnabled(void) bool Element::getSortingAttribute(unsigned attrib) { if(attrib > NullsFirst) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(sorting_attibs[attrib]); } diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index d62f53422d..253e377b3a 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -36,22 +36,22 @@ void EventTrigger::setEvent(EventTriggerType evnt_type) void EventTrigger::setFunction(Function *func) { if(!func) - throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjEventTrigger)), - AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions with return type other that event_trigger are not accepted else if(func->getReturnType()!=QString("event_trigger")) - throw Exception(Exception::getErrorMessage(AsgInvalidTriggerFunction).arg(QString("event_trigger")),__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidTriggerFunction).arg(QString("event_trigger")),__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions with one or more parameters are not accepted else if(func->getParameterCount()!=0) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjEventTrigger)), - AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions coded in SQL lang. is not accepted by event triggers else if(func->getLanguage()->getName()==~LanguageType(LanguageType::sql)) - throw Exception(AsgEventTriggerFuncInvalidLang,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEventTriggerFuncInvalidLang,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(function != func); function=func; @@ -60,7 +60,7 @@ void EventTrigger::setFunction(Function *func) void EventTrigger::setFilter(const QString &variable, const QStringList &values) { if(variable.toLower()!=ParsersAttributes::TAG) - throw Exception(Exception::getErrorMessage(AsgInvalidEventTriggerVariable).arg(variable),__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidEventTriggerVariable).arg(variable),__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!values.isEmpty()) { diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index e032a20695..6f1ff9d901 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -51,9 +51,9 @@ void Extension::setHandlesType(bool value) try to change the attribute value. This cannot be done to avoid cascade reference breaking on table columns/functions or any other objects that references PgSQLType */ if(!value && PgSQLType::getUserTypeIndex(this->getName(true), this) != BaseType::null) - throw Exception(Exception::getErrorMessage(ExtensionHandlingTypeImmutable) + throw Exception(Exception::getErrorMessage(ErrorCode::ExtensionHandlingTypeImmutable) .arg(this->getName(true)), - ExtensionHandlingTypeImmutable,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::ExtensionHandlingTypeImmutable,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->handles_type=value; } @@ -61,7 +61,7 @@ void Extension::setHandlesType(bool value) void Extension::setVersion(unsigned ver, const QString &value) { if(ver > OldVersion) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(versions[ver] != value); versions[ver]=value; @@ -75,7 +75,7 @@ bool Extension::handlesType(void) QString Extension::getVersion(unsigned ver) { if(ver > OldVersion) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(versions[ver]); } @@ -98,7 +98,7 @@ QString Extension::getAlterDefinition(BaseObject *object) Extension *ext=dynamic_cast(object); if(!ext) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 0df055df8c..e3e202b9b2 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -80,10 +80,10 @@ void Function::addParameter(Parameter param) //If a duplicated parameter is found an error is raised if(found) - throw Exception(Exception::getErrorMessage(AsgDuplicatedParameterFunction) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedParameterFunction) .arg(param.getName()) .arg(this->signature), - AsgDuplicatedParameterFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedParameterFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Inserts the parameter in the function parameters.push_back(param); @@ -94,7 +94,7 @@ void Function::addReturnedTableColumn(const QString &name, PgSQLType type) { //Raises an error if the column name is empty if(name.isEmpty()) - throw Exception(AsgEmptyNameTableReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEmptyNameTableReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr,itr_end; bool found=false; @@ -113,10 +113,10 @@ void Function::addReturnedTableColumn(const QString &name, PgSQLType type) //Raises an error if the column is duplicated if(found) - throw Exception(Exception::getErrorMessage(InsDuplicatedTableReturnType) + throw Exception(Exception::getErrorMessage(ErrorCode::InsDuplicatedTableReturnType) .arg(name) .arg(this->signature), - InsDuplicatedTableReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InsDuplicatedTableReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); Parameter p; p.setName(name); @@ -174,9 +174,9 @@ void Function::setRowAmount(unsigned row_amount) void Function::setLibrary(const QString &library) { if(language->getName().toLower()!=~LanguageType("c")) - throw Exception(Exception::getErrorMessage(AsgRefLibraryFuncLanguageNotC) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgRefLibraryFuncLanguageNotC) .arg(this->getSignature()), - AsgRefLibraryFuncLanguageNotC,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgRefLibraryFuncLanguageNotC,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->library != library); this->library=library; @@ -185,9 +185,9 @@ void Function::setLibrary(const QString &library) void Function::setSymbol(const QString &symbol) { if(language->getName().toLower()!=~LanguageType("c")) - throw Exception(Exception::getErrorMessage(AsgRefLibraryFuncLanguageNotC) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgRefLibraryFuncLanguageNotC) .arg(this->getSignature()), - AsgRefLibraryFuncLanguageNotC,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgRefLibraryFuncLanguageNotC,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->symbol != symbol); this->symbol=symbol; @@ -209,10 +209,10 @@ void Function::setLanguage(BaseObject *language) { //Raises an error if the language is not allocated if(!language) - throw Exception(AsgNotAllocatedLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocatedLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the language object is invalid else if(language->getObjectType()!=ObjectType::ObjLanguage) - throw Exception(AsgInvalidLanguageObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidLanguageObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->language != language); this->language=language; @@ -251,9 +251,9 @@ void Function::setBehaviorType(BehaviorType behav_type) void Function::setSourceCode(const QString &src_code) { if(language && language->getName().toLower()==~LanguageType("c")) - throw Exception(Exception::getErrorMessage(AsgSourceCodeFuncCLanguage) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgSourceCodeFuncCLanguage) .arg(this->getSignature()), - AsgSourceCodeFuncCLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgSourceCodeFuncCLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->source_code != src_code); this->source_code=src_code; @@ -323,7 +323,7 @@ Parameter Function::getParameter(unsigned param_idx) { //Raises an error if the parameter index is out of bound if(param_idx>=parameters.size()) - throw Exception(RefParameterInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefParameterInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(parameters[param_idx]); } @@ -332,7 +332,7 @@ Parameter Function::getReturnedTableColumn(unsigned column_idx) { //Raises an error if the column index is out of bound if(column_idx>=ret_table_columns.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(ret_table_columns[column_idx]); } @@ -395,7 +395,7 @@ void Function::removeParameter(unsigned param_idx) { //Raises an error if parameter index is out of bound if(param_idx>=parameters.size()) - throw Exception(RefParameterInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefParameterInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr; itr=parameters.begin()+param_idx; @@ -407,7 +407,7 @@ void Function::removeParameter(unsigned param_idx) void Function::removeReturnedTableColumn(unsigned column_idx) { if(column_idx>=ret_table_columns.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr; itr=ret_table_columns.begin()+column_idx; @@ -499,7 +499,7 @@ QString Function::getAlterDefinition(BaseObject *object) Function *func=dynamic_cast(object); if(!func) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index bcbdc51fdb..808e50b1cb 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -74,9 +74,9 @@ int Index::getElementIndex(IndexElement elem) void Index::addIndexElement(IndexElement elem) { if(getElementIndex(elem) >= 0) - throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(elem.getExpression().isEmpty() && !elem.getColumn()) - throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); idx_elements.push_back(elem); setCodeInvalidated(true); @@ -91,7 +91,7 @@ void Index::addIndexElement(const QString &expr, Collation *coll, OperatorClass //Raises an error if the expression is empty if(expr.isEmpty()) - throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Configures the element elem.setExpression(expr); @@ -102,7 +102,7 @@ void Index::addIndexElement(const QString &expr, Collation *coll, OperatorClass elem.setSortingAttribute(IndexElement::AscOrder, asc_order); if(getElementIndex(elem) >= 0) - throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); idx_elements.push_back(elem); setCodeInvalidated(true); @@ -136,7 +136,7 @@ void Index::addIndexElement(Column *column, Collation *coll, OperatorClass *op_c elem.setSortingAttribute(IndexElement::AscOrder, asc_order); if(getElementIndex(elem) >= 0) - throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); idx_elements.push_back(elem); setCodeInvalidated(true); @@ -169,7 +169,7 @@ void Index::addIndexElements(vector &elems) void Index::removeIndexElement(unsigned idx_elem) { if(idx_elem >= idx_elements.size()) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); idx_elements.erase(idx_elements.begin() + idx_elem); setCodeInvalidated(true); @@ -184,7 +184,7 @@ void Index::removeIndexElements(void) IndexElement Index::getIndexElement(unsigned elem_idx) { if(elem_idx >= idx_elements.size()) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(idx_elements[elem_idx]); } @@ -202,7 +202,7 @@ unsigned Index::getIndexElementCount(void) void Index::setIndexAttribute(unsigned attrib_id, bool value) { if(attrib_id > Buffering) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(index_attribs[attrib_id] != value); index_attribs[attrib_id]=value; @@ -235,7 +235,7 @@ unsigned Index::getFillFactor(void) bool Index::getIndexAttribute(unsigned attrib_id) { if(attrib_id > Buffering) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(index_attribs[attrib_id]); } @@ -380,7 +380,7 @@ QString Index::getAlterDefinition(BaseObject *object) Index *index=dynamic_cast(object); if(!index) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 6b887ed3fa..dfe2df317b 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -36,10 +36,10 @@ void Language::setName(const QString &name) { //Raises an error if the user try to set an system reserved language name (C, SQL) if(name.toLower()==~LanguageType("c") || name.toLower()==~LanguageType("sql")) - throw Exception(Exception::getErrorMessage(AsgReservedName) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgReservedName) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), - AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); } @@ -83,19 +83,19 @@ void Language::setFunction(Function *func, unsigned func_type) //Raises an error in case the function return type doesn't matches the required by each rule else if((func_type==HandlerFunc && func->getReturnType()!=QString("language_handler")) || ((func_type==ValidatorFunc || func_type==InlineFunc) && func->getReturnType()!=QString("void"))) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), - AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else //Raises an error in case the function has invalid parameters (count and types) - throw Exception(AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } Function * Language::getFunction(unsigned func_type) { if(func_type > InlineFunc) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_type]); } diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 1a82123706..1ffcf228f1 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -25,7 +25,7 @@ OperationList::OperationList(DatabaseModel *model) /* Raises an error if the user tries to allocate an operation list linked to to an unallocated model */ if(!model) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->model=model; xmlparser=model->getXMLParser(); @@ -140,7 +140,7 @@ void OperationList::setMaximumSize(unsigned max) { //Raises an error if a zero max size is assigned to the list if(max==0) - throw Exception(AsgInvalidMaxSizeOpList,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidMaxSizeOpList,__PRETTY_FUNCTION__,__FILE__,__LINE__); max_size=max; } @@ -154,7 +154,7 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) //Raises an error if the object to be added is not allocated if(!object) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=object->getObjectType(); @@ -167,11 +167,11 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) if(obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjDatabase) PgModelerNs::copyObject(©_obj, object, obj_type); else - throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the copy fails (returning a null object) if(!copy_obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else //Inserts the copy on the pool object_pool.push_back(copy_obj); @@ -297,7 +297,7 @@ bool OperationList::isObjectOnPool(BaseObject *object) vector::iterator itr, itr_end; if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=object_pool.begin(); itr_end=object_pool.end(); @@ -348,18 +348,18 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje { //Raises an error if the user tries to register an operation with null object if(!object) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=object->getObjectType(); if(tab_obj && !parent_obj) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(parent_obj && (((obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) && (parent_obj->getObjectType()!=ObjectType::ObjRelationship && parent_obj->getObjectType()!=ObjectType::ObjTable)) || ((obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule || obj_type==ObjectType::ObjIndex) && !dynamic_cast(parent_obj)))) - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the operations list is full makes the automatic cleaning before inserting a new operation if(current_index == static_cast(max_size-1)) @@ -457,7 +457,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje } //Raises an error if both parent table / relationship isn't allocated else - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -501,7 +501,7 @@ void OperationList::getOperationData(unsigned oper_idx, unsigned &oper_type, QSt BaseObject *pool_obj=nullptr; if(oper_idx >= operations.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); operation=operations[oper_idx]; oper_type=operation->getOperationType(); @@ -617,8 +617,8 @@ void OperationList::undoOperation(void) while(!ignore_chain && isUndoAvailable() && operation->getChainType()!=Operation::NoChain); - if(error.getErrorType()!=Custom) - throw Exception(UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); + if(error.getErrorType()!=ErrorCode::Custom) + throw Exception(ErrorCode::UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); } } @@ -672,8 +672,8 @@ void OperationList::redoOperation(void) while(!ignore_chain && isRedoAvailable() && operation->getChainType()!=Operation::NoChain); - if(error.getErrorType()!=Custom) - throw Exception(UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); + if(error.getErrorType()!=ErrorCode::Custom) + throw Exception(ErrorCode::UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); } } @@ -984,7 +984,7 @@ void OperationList::updateObjectIndex(BaseObject *object, unsigned new_idx) Operation *oper=nullptr; if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=operations.begin(); itr_end=operations.end(); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 1fb982a28c..f484b24d61 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -82,9 +82,9 @@ bool Operator::isValidName(const QString &name) void Operator::setName(const QString &name) { if(name.isEmpty()) - throw Exception(AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!isValidName(name)) - throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->obj_name=name; } @@ -93,22 +93,22 @@ void Operator::setFunction(Function *func, unsigned func_type) { //Raises an error if the function type is invalid if(func_type > FUNC_RESTRICT) - throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(func_type==FUNC_OPERATOR) { //Raises an error if the function is not allocated if(!func) - throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), - AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the parameter count is invalid. To be used by the operator the function must own 1 or 2 parameters */ else if(func->getParameterCount()==0 || func->getParameterCount() > 2) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), - AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { unsigned param_count=func->getParameterCount(); @@ -140,10 +140,10 @@ void Operator::setFunction(Function *func, unsigned func_type) (param_count==1 && ((argument_types[0]!=QString("\"any\"") && argument_types[0]!=param_type1) || (argument_types[1]!=QString("\"any\"") && argument_types[1]!=param_type1)))) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), - AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -155,7 +155,7 @@ void Operator::setArgumentType(PgSQLType arg_type, unsigned arg_id) { //Raises an error if the argument id is invalid if(arg_id > RIGHT_ARG) - throw Exception( RefOperatorArgumentInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefOperatorArgumentInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(argument_types[arg_id] != arg_type); argument_types[arg_id]=arg_type; @@ -165,7 +165,7 @@ void Operator::setOperator(Operator *oper, unsigned op_type) { //Raises an error if the operator type is invalid if(op_type > OPER_NEGATOR) - throw Exception(RefOperatorInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefOperatorInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { /* Validating the Commutator OP: According to the PostgreSQL documentation @@ -176,10 +176,10 @@ void Operator::setOperator(Operator *oper, unsigned op_type) is not satisfied. */ if(oper && op_type==OPER_COMMUTATOR && argument_types[LEFT_ARG]!=oper->argument_types[RIGHT_ARG]) { - throw Exception(Exception::getErrorMessage(AsgInvalidCommutatorOperator) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidCommutatorOperator) .arg(oper->getSignature(true)) .arg(this->getSignature(true)), - AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); } /* Validating Negator OP: According to the PostgreSQL documentation the negator operator must have its arguments as the same type of arguments from the @@ -190,10 +190,10 @@ void Operator::setOperator(Operator *oper, unsigned op_type) (argument_types[LEFT_ARG]!=oper->argument_types[LEFT_ARG] && argument_types[RIGHT_ARG]!=oper->argument_types[RIGHT_ARG])) { - throw Exception(Exception::getErrorMessage(AsgInvalidNegatorOperator) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidNegatorOperator) .arg(oper->getSignature(true)) .arg(this->getSignature(true)), - AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); } setCodeInvalidated(operators[op_type] != oper); @@ -217,7 +217,7 @@ Function *Operator::getFunction(unsigned func_type) { //Raises an error if the function type is invalid if(func_type > FUNC_RESTRICT) - throw Exception(RefOperatorInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefOperatorInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_type]); } @@ -226,7 +226,7 @@ PgSQLType Operator::getArgumentType(unsigned arg_id) { //Raises an error if the argument id is invalid if(arg_id > RIGHT_ARG) - throw Exception( RefOperatorArgumentInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefOperatorArgumentInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(argument_types[arg_id]); } @@ -234,7 +234,7 @@ Operator *Operator::getOperator(unsigned op_type) { //Raises an error if the operator type is invalid if(op_type > OPER_NEGATOR) - throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(operators[op_type]); } diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index fdeffbd3ad..a2acd6bcef 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -39,7 +39,7 @@ void OperatorClass::setDataType(PgSQLType data_type) { //A null datatype is not accepted by the operator class if(data_type==PgSQLType::null) - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->data_type != data_type); this->data_type=data_type; @@ -94,7 +94,7 @@ void OperatorClass::removeElement(unsigned elem_idx) { //Raises an error in case the element index is out of bound if(elem_idx >= elements.size()) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Removes the item from the elements list elements.erase(elements.begin() + elem_idx); @@ -111,7 +111,7 @@ OperatorClassElement OperatorClass::getElement(unsigned elem_idx) { //Raises an error in case the element index is out of bound if(elem_idx >= elements.size()) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Returns the element on the specified index return(elements[elem_idx]); diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 086fc7f0a2..84fe1bd2fc 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -31,11 +31,11 @@ void OperatorClassElement::setFunction(Function *func, unsigned stg_number) { //Raises an exception case the function is not allocated if(!func) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error case the stratagy number is zero (invalid) else if(stg_number==0) - throw Exception(AsgInvalidSupportStrategyNumber,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidSupportStrategyNumber,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Clear the attributes not related to the FUNCTION element type this->_operator=nullptr; @@ -51,11 +51,11 @@ void OperatorClassElement::setOperator(Operator *oper, unsigned stg_number) { //Raises an error in case the operator is not allocated if(!oper) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error case the stratagy number is zero (invalid) else if(stg_number==0) - throw Exception(AsgInvalidSupportStrategyNumber,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidSupportStrategyNumber,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Clear the attributes not related to the OPERATOR element type this->function=nullptr; @@ -71,7 +71,7 @@ void OperatorClassElement::setOperatorFamily(OperatorFamily *op_family) if(this->element_type==OperatorElem) { if(op_family && op_family->getIndexingType()!=IndexingType::btree) - throw Exception(AsgInvalidOpFamilyOpClassElem,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidOpFamilyOpClassElem,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->op_family=op_family; } diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index e4e55049e4..d1808f4cff 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -27,7 +27,7 @@ Parameter::Parameter(void) void Parameter::setType(PgSQLType type) { if(!type.isArrayType() && !type.isPolymorphicType() && is_variadic) - throw Exception(InvUsageVariadicParamMode ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvUsageVariadicParamMode ,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->type != type); this->type=type; @@ -50,7 +50,7 @@ void Parameter::setOut(bool value) void Parameter::setVariadic(bool value) { if(value && !type.isArrayType() && !type.isPolymorphicType()) - throw Exception(InvUsageVariadicParamMode ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvUsageVariadicParamMode ,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(is_variadic != value); is_variadic=value; diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 809a6f1a4e..eea0247a7d 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -30,12 +30,12 @@ Permission::Permission(BaseObject *obj) //Raises an error if the object associated to the permission is no allocated if(!obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the object type to be associated to the permission is invalid according to the rule (see class definition) */ if(!acceptsPermission(obj->getObjectType())) - throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->object=obj; this->obj_type=ObjectType::ObjPermission; @@ -123,11 +123,11 @@ void Permission::addRole(Role *role) { //Raises an error if the role is not allocated if(!role) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the role already exists in the permission if(isRoleExists(role)) - throw Exception(InsDuplicatedRolePermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedRolePermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); roles.push_back(role); setCodeInvalidated(true); @@ -140,11 +140,11 @@ void Permission::setPrivilege(unsigned priv_id, bool value, bool grant_op) { //Caso o tipo de privilégio sejá inválido dispara uma exceção if(priv_id > PrivUsage) - throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!acceptsPermission(object->getObjectType(), priv_id)) //Raises an error if the privilege is invalid according to the object type - throw Exception(AsgInvalidPrivilegeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidPrivilegeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated((privileges[priv_id] != value) || grant_option[priv_id] != grant_op); privileges[priv_id]=value; @@ -205,7 +205,7 @@ bool Permission::isSimilarTo(Permission *perm) void Permission::removeRole(unsigned role_idx) { if(role_idx > roles.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); roles.erase(roles.begin() + role_idx); generatePermissionId(); @@ -222,7 +222,7 @@ void Permission::removeRoles(void) Role *Permission::getRole(unsigned role_idx) { if(role_idx > roles.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(roles[role_idx]); } @@ -246,7 +246,7 @@ bool Permission::getPrivilege(unsigned priv_id) { //Raises an error if the privilege is invalid if(priv_id > PrivUsage) - throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(privileges[priv_id]); } @@ -255,7 +255,7 @@ bool Permission::getGrantOption(unsigned priv_id) { //Raises an error if the privilege is invalid if(priv_id > PrivUsage) - throw Exception(RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidPrivilegeType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(grant_option[priv_id]); } diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index 50a3b8dfdd..3b62e88d48 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -33,7 +33,7 @@ namespace PgModelerNs { //Raises an error if the copy object is not allocated if(!copy_obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Allocates the source object if its not allocated if(!orig_obj) @@ -151,7 +151,7 @@ namespace PgModelerNs { copyObject(psrc_obj, dynamic_cast(copy_obj)); break; default: - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } } diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index bac8fed3c0..a1adf2c2bc 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -258,7 +258,7 @@ BaseType::BaseType(void) QString BaseType::getTypeString(unsigned type_id) { if(type_id > types_count) - throw Exception(RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type_list[type_id]); } @@ -267,10 +267,10 @@ void BaseType::setType(unsigned type_id,unsigned offset,unsigned count) { //Raises an error if the type count is invalid if(count==0 || count > this->types_count) - throw Exception(ObtTypesInvalidQuantity,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtTypesInvalidQuantity,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the type id is invalid else if(!isTypeValid(type_id,offset,count)) - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else type_idx=type_id; } @@ -285,7 +285,7 @@ void BaseType::getTypes(QStringList &types,unsigned offset,unsigned count) { //Raises an error if the type count is invalid if(count==0 || count > BaseType::types_count) - throw Exception(ObtTypesInvalidQuantity,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtTypesInvalidQuantity,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { unsigned idx,total; @@ -940,7 +940,7 @@ unsigned PgSQLType::operator = (unsigned type_id) else if(type_id > 0) BaseType::setType(type_id,offset,types_count); else if(type_id==0) - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type_idx); } @@ -953,7 +953,7 @@ unsigned PgSQLType::operator = (const QString &type_name) usr_type_idx=getUserTypeIndex(type_name, nullptr); if(type_idx==0 && usr_type_idx==0) - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(type_idx!=0) { BaseType::setType(type_idx,offset,types_count); @@ -1121,7 +1121,7 @@ void PgSQLType::setUserType(unsigned type_id) (type_id >= lim1 && type_id < lim2)) type_idx=type_id; else - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void PgSQLType::setUserType(void *ptype) @@ -1130,7 +1130,7 @@ void PgSQLType::setUserType(void *ptype) idx=getUserTypeIndex(QString(),ptype); if(idx <= 0) - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else type_idx=idx; } @@ -1535,7 +1535,7 @@ void PgSQLType::setDimension(unsigned dim) if(static_cast(idx) < user_types.size() && (user_types[idx].type_conf==UserTypeConfig::DOMAIN_TYPE || user_types[idx].type_conf==UserTypeConfig::SEQUENCE_TYPE)) - throw Exception(AsgInvalidDomainArray,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidDomainArray,__PRETTY_FUNCTION__,__FILE__,__LINE__); } dimension=dim; @@ -1553,12 +1553,12 @@ void PgSQLType::setPrecision(int prec) //Raises an error if the user tries to specify a precision > length if(((BaseType::type_list[type_idx]==QString("numeric") || BaseType::type_list[type_idx]==QString("decimal")) && prec > static_cast(length))) - throw Exception(AsgInvalidPrecision,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidPrecision,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the precision is greater thant 6 else if(((BaseType::type_list[type_idx]==QString("time") || BaseType::type_list[type_idx]==QString("timestamp") || BaseType::type_list[type_idx]==QString("interval")) && prec > 6)) - throw Exception(AsgInvalidPrecisionTimestamp,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidPrecisionTimestamp,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->precision=prec; } diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index 52718d2ee7..9538de7b3c 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -34,11 +34,11 @@ void Policy::setParentTable(BaseTable *table) { if(table && table->getObjectType() != ObjectType::ObjTable) { - throw Exception(Exception::getErrorMessage(AsgInvalidObjectType) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) .arg(BaseObject::getTypeName(ObjectType::ObjTable)), - AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } TableObject::setParentTable(table); @@ -91,7 +91,7 @@ QString Policy::getCheckExpression(void) void Policy::addRole(Role *role) { if(!role) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(std::find(roles.begin(), roles.end(), role) == roles.end()) roles.push_back(role); @@ -144,7 +144,7 @@ QString Policy::getAlterDefinition(BaseObject *object) Policy *policy=dynamic_cast(object); if(!policy) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 84d9f65184..d5bc2e715b 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -29,16 +29,16 @@ Reference::Reference(Table *table, Column *column, const QString &tab_alias, con { //Raises an error if the table is not allocated if(!table) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the table/column alias has an invalid name else if((!tab_alias.isEmpty() && !BaseObject::isValidName(tab_alias)) || (!col_alias.isEmpty() && !BaseObject::isValidName(col_alias))) - throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the column parent table differs from the passed table else if(column && column->getParentTable()!=table) - throw Exception(AsgObjectBelongsAnotherTable ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectBelongsAnotherTable ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->table=table; this->column=column; @@ -51,10 +51,10 @@ Reference::Reference(const QString &expression, const QString &expr_alias) { //Raises an error if the user try to create an reference using an empty expression if(expression.isEmpty()) - throw Exception(AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidExpressionObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the expression alias has an invalid name else if(!expr_alias.isEmpty() && !BaseObject::isValidName(expr_alias)) - throw Exception(AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); table=nullptr; column=nullptr; @@ -109,7 +109,7 @@ unsigned Reference::getReferenceType(void) void Reference::setReferenceAlias(const QString &alias) { if(alias.size() > BaseObject::ObjectNameMaxLength) - throw Exception(AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); ref_alias = alias; } diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index dd78fb9192..fe026a29cb 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -37,7 +37,7 @@ constexpr unsigned Relationship::PkColPattern; Relationship::Relationship(Relationship *rel) : BaseRelationship(rel) { if(!rel) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); (*(this))=(*rel); } @@ -58,34 +58,34 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, if(((rel_type==Relationship11 || rel_type==Relationship1n) && !this->getReferenceTable()->getPrimaryKey()) || (rel_type==RelationshipNn && (!src_tab->getPrimaryKey() || !dst_tab->getPrimaryKey()))) - throw Exception(Exception::getErrorMessage(InvLinkTablesNoPrimaryKey) + throw Exception(Exception::getErrorMessage(ErrorCode::InvLinkTablesNoPrimaryKey) .arg(obj_name) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)), - InvLinkTablesNoPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvLinkTablesNoPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); // Raises an error if the user tries to create another copy relationship if the table already copies another table if(rel_type==RelationshipDep && src_tab->getCopyTable()) - throw Exception(Exception::getErrorMessage(InvCopyRelTableDefined) + throw Exception(Exception::getErrorMessage(ErrorCode::InvCopyRelTableDefined) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getCopyTable()->getName(true)), - InvCopyRelTableDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvCopyRelTableDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* If the relationship is partitioning the destination table (partitioned) shoud have * a partitioning type defined otherwise and error is raised */ if(rel_type == RelationshipPart && !dst_tab->isPartitioned()) - throw Exception(Exception::getErrorMessage(InvPartitioningTypePartRel) + throw Exception(Exception::getErrorMessage(ErrorCode::InvPartitioningTypePartRel) .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), - InvPartitioningTypePartRel, __PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvPartitioningTypePartRel, __PRETTY_FUNCTION__,__FILE__,__LINE__); // Raises an error if the user tries to create a partitioning relationship where one of the tables are already a partition table if(rel_type==RelationshipPart && src_tab->getPartitionedTable()) - throw Exception(Exception::getErrorMessage(InvPartRelPartitionedDefined) + throw Exception(Exception::getErrorMessage(ErrorCode::InvPartRelPartitionedDefined) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getPartitionedTable()->getName(true)), - InvPartRelPartitionedDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvPartRelPartitionedDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the user tries to create a relationship in the following configuration: * 1) Many-to-many relationship where one of the tables is a partitioned one @@ -102,11 +102,11 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, (rel_type == Relationship1n && getReferenceTable()->isPartitioned() && !getReceiverTable()->isPartitioned()) || ((rel_type == RelationshipGen || rel_type == RelationshipDep || rel_type == Relationship11) && (src_tab->isPartition() || src_tab->isPartitioned() || dst_tab->isPartition() || dst_tab->isPartitioned()))) - throw Exception(Exception::getErrorMessage(InvRelTypeForPatitionTables) + throw Exception(Exception::getErrorMessage(ErrorCode::InvRelTypeForPatitionTables) .arg(src_tab->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->isPartitioned() || src_tab->isPartition() ? src_tab->getName(true) : dst_tab->getName(true)), - InvRelTypeForPatitionTables,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvRelTypeForPatitionTables,__PRETTY_FUNCTION__,__FILE__,__LINE__); copy_options=copy_op; table_relnn=nullptr; @@ -193,10 +193,10 @@ void Relationship::setNamePattern(unsigned pat_id, const QString &pattern) aux_name.replace(pat_tokens[i], QString("%1").arg(static_cast('a' + i))); if(pat_id > PkColPattern) - throw Exception(Exception::getErrorMessage(RefInvalidNamePatternId) + throw Exception(Exception::getErrorMessage(ErrorCode::RefInvalidNamePatternId) .arg(this->getName()),__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!BaseObject::isValidName(aux_name)) - throw Exception(Exception::getErrorMessage(AsgInvalidNamePattern) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidNamePattern) .arg(this->getName()),__PRETTY_FUNCTION__,__FILE__,__LINE__); name_patterns[pat_id]=pattern; @@ -207,7 +207,7 @@ void Relationship::setNamePattern(unsigned pat_id, const QString &pattern) QString Relationship::getNamePattern(unsigned pat_id) { if(pat_id > PkColPattern) - throw Exception(RefInvalidNamePatternId,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidNamePatternId,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(name_patterns[pat_id]); } @@ -276,7 +276,7 @@ void Relationship::setIdentifier(bool value) (rel_type==RelationshipNn || rel_type==RelationshipGen || rel_type==RelationshipDep))) - throw Exception(InvIdentifierRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvIdentifierRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); identifier=value; this->invalidated=true; @@ -287,9 +287,9 @@ void Relationship::setSpecialPrimaryKeyCols(vector &cols) /* Raises an error if the user try to set columns for special primary key when the relationship type is identifier or self relationship */ if(!cols.empty() && (isSelfRelationship() || isIdentifier())) - throw Exception(Exception::getErrorMessage(InvUseSpecialPrimaryKey) + throw Exception(Exception::getErrorMessage(ErrorCode::InvUseSpecialPrimaryKey) .arg(this->getName()), - InvUseSpecialPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvUseSpecialPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->column_ids_pk_rel=cols; } @@ -365,7 +365,7 @@ void Relationship::setTableNameRelNN(const QString &name) if(rel_type==RelationshipNn) { if(!BaseObject::isValidName(name)) - throw Exception(AsgInvalidNameTableRelNN, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidNameTableRelNN, __PRETTY_FUNCTION__,__FILE__,__LINE__); tab_name_relnn=name; tab_name_relnn.remove('"'); @@ -433,7 +433,7 @@ int Relationship::getObjectIndex(TableObject *object) //Raises an error if the object is not allocated if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Selecting the correct list using the object type obj_type=object->getObjectType(); @@ -443,7 +443,7 @@ int Relationship::getObjectIndex(TableObject *object) list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) - throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); itr=list->begin(); itr_end=list->end(); @@ -469,7 +469,7 @@ bool Relationship::isColumnExists(Column *column) //Raises an error if the column is not allocated if(!column) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=gen_columns.begin(); itr_end=gen_columns.end(); @@ -497,7 +497,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) !(tab_obj->isAddedByRelationship() && tab_obj->isProtected() && tab_obj->getObjectType()==ObjectType::ObjConstraint)) - throw Exception(AsgObjectInvalidRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectInvalidRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -513,7 +513,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) obj_list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) - throw Exception(AsgObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); //Defines the parent table for the object only for validation tab_obj->setParentTable(src_table); @@ -528,7 +528,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) //Raises an error if the user try to add as foreign key to relationship if(rest->getConstraintType()==ConstraintType::foreign_key) - throw Exception(AsgForeignKeyRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgForeignKeyRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); rest->getCodeDefinition(SchemaParser::SqlDefinition); } @@ -550,20 +550,20 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) this->invalidated=true; } else - throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(tab_obj->getName(true)) .arg(tab_obj->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - AsgDuplicatedObject, __PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedObject, __PRETTY_FUNCTION__,__FILE__,__LINE__); } catch(Exception &e) { - if(e.getErrorType()==UndefinedAttributeValue) - throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) + if(e.getErrorType()==ErrorCode::UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()), - AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } @@ -595,11 +595,11 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) else if(obj_type==ObjectType::ObjConstraint) obj_list=&rel_constraints; else - throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the object index is out of bound if(obj_id >= obj_list->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); tab_obj=obj_list->at(obj_id); recv_table=this->getReceiverTable(); @@ -628,14 +628,14 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) //Raises an error if the column to be removed is referenced by a relationship constraint if(refer) - throw Exception(Exception::getErrorMessage(RemInderectReference) + throw Exception(Exception::getErrorMessage(ErrorCode::RemInderectReference) .arg(col->getName()) .arg(col->getTypeName()) .arg(constr->getName()) .arg(constr->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - RemInderectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RemInderectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Generating the column index inside the special pk column list col_idx=getObjectIndex(col) + gen_columns.size(); @@ -663,7 +663,7 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) void Relationship::removeObject(TableObject *object) { if(!object) - throw Exception(RemNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RemNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); removeObject(getObjectIndex(object),object->getObjectType()); } @@ -713,10 +713,10 @@ TableObject *Relationship::getObject(unsigned obj_idx, ObjectType obj_type) else if(obj_type==ObjectType::ObjConstraint) list=&rel_constraints; else - throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); if(obj_idx >= list->size()) - throw Exception(RefObjectInvalidIndex, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex, __PRETTY_FUNCTION__,__FILE__,__LINE__); return(list->at(obj_idx)); } @@ -733,7 +733,7 @@ TableObject *Relationship::getObject(const QString &name, ObjectType obj_type) else if(obj_type==ObjectType::ObjConstraint) list=&rel_constraints; else - throw Exception(RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); itr=list->begin(); itr_end=list->end(); @@ -755,7 +755,7 @@ Column *Relationship::getAttribute(unsigned attrib_idx) { //Raises an error if the attribute index is out of bound if(attrib_idx >= rel_attributes.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(rel_attributes[attrib_idx])); } @@ -774,7 +774,7 @@ Constraint *Relationship::getConstraint(unsigned constr_idx) { //Raises an error if the constraint index is out of bound if(constr_idx >= rel_constraints.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(rel_constraints[constr_idx])); } @@ -806,7 +806,7 @@ unsigned Relationship::getObjectCount(ObjectType obj_type) else if(obj_type==ObjectType::ObjConstraint) return(rel_constraints.size()); else - throw Exception(RefObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void Relationship::addConstraints(Table *recv_tab) @@ -886,7 +886,7 @@ void Relationship::addColumnsRelGenPart(void) idx, tab_count; vector columns; ObjectType types[2]={ObjectType::ObjTable, ObjectType::ObjBaseTable}; - ErrorCode err_code=Custom; + ErrorCode err_code=ErrorCode::Custom; bool duplic=false, cond=false, /* 0 -> Column created by inheritance relationship 1 -> Column created by copy relationship */ @@ -908,14 +908,14 @@ void Relationship::addColumnsRelGenPart(void) /* If the relationship is partitioning the destination table (partitioned) shoud have * a partitioning type defined otherwise and error is raised */ if(rel_type == RelationshipPart && !dst_tab->isPartitioned()) - throw Exception(Exception::getErrorMessage(InvPartitioningTypePartRel) + throw Exception(Exception::getErrorMessage(ErrorCode::InvPartitioningTypePartRel) .arg(src_tab->getSignature()).arg(dst_tab->getSignature()), - InvPartitioningTypePartRel, __PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvPartitioningTypePartRel, __PRETTY_FUNCTION__,__FILE__,__LINE__); /* This for compares the columns of the receiver table with the columns of the reference table in order to resolve the conflicting names */ - for(i=0; i < dst_count && err_code==Custom; i++) + for(i=0; i < dst_count && err_code==ErrorCode::Custom; i++) { //Gets the column from the receiver (destination) table dst_col=dst_tab->getColumn(i); @@ -1016,17 +1016,17 @@ void Relationship::addColumnsRelGenPart(void) ((!dst_flags[0] && !dst_flags[1]) || (!dst_flags[0] && dst_flags[1]))) { - err_code=InvCopyRelationshipDuplicCols; + err_code=ErrorCode::InvCopyRelationshipDuplicCols; } /* Error condition 2: The relationship type is generalization and the column * types is incompatible */ else if((rel_type == RelationshipGen || rel_type==RelationshipPart) && src_type != dst_type) - err_code=InvInheritRelationshipIncompCols; + err_code=ErrorCode::InvInheritRelationshipIncompCols; } } //In case that no error was detected (ERR_CUSTOM) - if(err_code==Custom) + if(err_code==ErrorCode::Custom) { //In case there is no column duplicity if(!duplic) @@ -1065,10 +1065,10 @@ void Relationship::addColumnsRelGenPart(void) } if((src_tab->getColumnCount() + columns.size()) != dst_tab->getColumnCount() && rel_type == RelationshipPart) - err_code = InvColumnCountPartRel; + err_code = ErrorCode::InvColumnCountPartRel; //In case that no duplicity error is detected - if(err_code==Custom) + if(err_code==ErrorCode::Custom) { vector::iterator itr, itr_end; @@ -1096,14 +1096,14 @@ void Relationship::addColumnsRelGenPart(void) str_aux=Exception::getErrorMessage(err_code); - if(err_code==InvCopyRelationshipDuplicCols) + if(err_code==ErrorCode::InvCopyRelationshipDuplicCols) { msg=QString(str_aux) .arg(dst_col->getName(true)) .arg(dst_tab->getName(true)) .arg(src_tab->getName(true)); } - else if(err_code==InvColumnCountPartRel) + else if(err_code==ErrorCode::InvColumnCountPartRel) { msg=QString(str_aux) .arg(src_tab->getName(true)) @@ -1165,10 +1165,10 @@ void Relationship::addConstraintsRelGenPart(void) } else if(aux_constr->getConstraintType()!=ConstraintType::check || aux_constr->getExpression().simplified()!=constr->getExpression().simplified()) - throw Exception(Exception::getErrorMessage(InvInheritRelationshipIncompConstrs) + throw Exception(Exception::getErrorMessage(ErrorCode::InvInheritRelationshipIncompConstrs) .arg(constr->getName()).arg(parent_tab->getName(false, true)) .arg(aux_constr->getName()).arg(child_tab->getName(false, true)), - InvInheritRelationshipIncompConstrs,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvInheritRelationshipIncompConstrs,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -1552,11 +1552,11 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b the relationship is 1-1, 1-n or n-n */ if((!src_pk && (rel_type==Relationship1n || rel_type==Relationship11)) || (!src_pk && !dst_pk && rel_type==RelationshipNn)) - throw Exception(Exception::getErrorMessage(InvLinkTablesNoPrimaryKey) + throw Exception(Exception::getErrorMessage(ErrorCode::InvLinkTablesNoPrimaryKey) .arg(this->obj_name) .arg(ref_tab->getName(true)) .arg(recv_tab->getName(true)), - InvLinkTablesNoPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvLinkTablesNoPrimaryKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); count=pk->getColumnCount(Constraint::SourceCols); diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 717efcd39a..0b1da8e193 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -51,7 +51,7 @@ void Role::setOption(unsigned op_type, bool value) { if(op_type > OpBypassRls) //Raises an error if the option type is invalid - throw Exception(AsgValueInvalidRoleOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgValueInvalidRoleOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(options[op_type] != value); options[op_type]=value; @@ -61,12 +61,12 @@ void Role::addRole(unsigned role_type, Role *role) { //Raises an error if the role to be added is not allocated if(!role) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the role to be added is the 'this' role else if(role && this==role) - throw Exception(Exception::getErrorMessage(AsgRoleMemberItself) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgRoleMemberItself) .arg(role->getName()), - AsgRoleMemberItself,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgRoleMemberItself,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { bool role_ref, role_mem, role_adm, @@ -87,10 +87,10 @@ void Role::addRole(unsigned role_type, Role *role) if((role_type==RefRole && role_ref) || (role_type==MemberRole && (role_mem || role_adm)) || (role_type==AdminRole && (role_adm || role_mem))) - throw Exception(Exception::getErrorMessage(InsDuplicatedRole) + throw Exception(Exception::getErrorMessage(ErrorCode::InsDuplicatedRole) .arg(role->getName()) .arg(this->getName()), - InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Checking for redundant reference between roles. A redundant reference can happen when: @@ -117,10 +117,10 @@ void Role::addRole(unsigned role_type, Role *role) else if((role_type==RefRole && ((role_mem || role_adm) || role_ref1)) || (role_type==MemberRole && ((role_mem1 || role_adm1) || role_ref)) || (role_type==AdminRole && ((role_mem1 || role_adm1) || role_ref))) - throw Exception(Exception::getErrorMessage(AsgRoleReferenceRedundancy) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgRoleReferenceRedundancy) .arg(this->getName()) .arg(role->getName()), - AsgRoleReferenceRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgRoleReferenceRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { switch(role_type) @@ -201,12 +201,12 @@ void Role::removeRole(unsigned role_type, unsigned role_idx) case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } if(role_idx >= list->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=list->begin() + role_idx; list->erase(itr); @@ -224,7 +224,7 @@ void Role::removeRoles(unsigned role_type) case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } @@ -245,7 +245,7 @@ bool Role::isRoleExists(unsigned role_type, Role *role) case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } @@ -263,7 +263,7 @@ bool Role::isRoleExists(unsigned role_type, Role *role) bool Role::getOption(unsigned op_type) { if(op_type > OpBypassRls) - throw Exception(AsgValueInvalidRoleOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgValueInvalidRoleOptionType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(options[op_type]); } @@ -279,13 +279,13 @@ Role *Role::getRole(unsigned role_type, unsigned role_idx) case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } //Raises an error if the role index is invalid (out of bound) if(role_idx > list->size()) - throw Exception(RefRoleInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefRoleInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(list->at(role_idx)); } @@ -301,7 +301,7 @@ unsigned Role::getRoleCount(unsigned role_type) case AdminRole: list=&admin_roles; break; default: //Raises an error if the role type is invalid - throw Exception(RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidRoleType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } @@ -355,7 +355,7 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) Role *role=dynamic_cast(object); if(!role) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index 14e97174b2..dcb4cdf2fe 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -66,7 +66,7 @@ void Rule::addCommand(const QString &cmd) { //Raises an error if the command is empty if(cmd.isEmpty()) - throw Exception(InsEmptyRuleCommand,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsEmptyRuleCommand,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { QString cmd_aux=cmd; @@ -95,7 +95,7 @@ QString Rule::getCommand(unsigned cmd_idx) { //Raises an error if the command index is out of bound if(cmd_idx >= commands.size()) - throw Exception(RefRuleCommandInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefRuleCommandInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(commands[cmd_idx]); } @@ -109,7 +109,7 @@ void Rule::removeCommand(unsigned cmd_idx) { //Raises an error if the command index is out of bound if(cmd_idx>=commands.size()) - throw Exception(RefRuleCommandInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefRuleCommandInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); commands.erase(commands.begin() + cmd_idx); setCodeInvalidated(true); diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index b3447cccda..663e5982a0 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -32,10 +32,10 @@ void Schema::setName(const QString &name) /* Schema names starting with pg_ is reserved to PostgreSQL if its the case raises an error */ if(name.mid(0,3)==QString("pg_")) - throw Exception(Exception::getErrorMessage(AsgReservedName) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgReservedName) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjSchema)), - AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); } diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 1efcf3b226..4b96f46c0b 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -224,7 +224,7 @@ void Sequence::setSchema(BaseObject *schema) //Raises an error when the passed schema differs from the table schema if(table && table->getSchema()!=schema) - throw Exception(AsgSchemaSequenceDiffersTableSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgSchemaSequenceDiffersTableSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); } BaseObject::setSchema(schema); @@ -246,16 +246,16 @@ void Sequence::setValues(QString minv, QString maxv, QString inc, QString start, cache=formatValue(cache); if(compareValues(minv,maxv) > 0) - throw Exception(AsgInvalidSequenceMinValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidSequenceMinValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the start value is less that min value or grater than max value else if(compareValues(start, minv) < 0 || compareValues(start, maxv) > 0) - throw Exception(AsgInvalidSequenceStartValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidSequenceStartValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the increment value is null (0) else if(isZeroValue(inc)) - throw Exception(AsgInvalidSequenceIncrementValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidSequenceIncrementValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the cache value is null (0) else if(isZeroValue(cache)) - throw Exception(AsgInvalidSequenceCacheValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidSequenceCacheValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->min_value=minv; this->max_value=maxv; @@ -274,24 +274,24 @@ void Sequence::setOwnerColumn(Table *table, const QString &col_name) { //Raises an error if the table schema differs from the sequence schema if(table->getSchema()!=this->schema) - throw Exception(Exception::getErrorMessage(AsgSeqOwnerTableDifferentSchema) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgSeqOwnerTableDifferentSchema) .arg(this->getName(true)), - AsgSeqOwnerTableDifferentSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgSeqOwnerTableDifferentSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the table owner role differs from the sequence owner if(table->getOwner()!=this->owner) - throw Exception(Exception::getErrorMessage(AsgSeqOwnerTableDifferentRole) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgSeqOwnerTableDifferentRole) .arg(this->getName(true)), - AsgSeqOwnerTableDifferentRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgSeqOwnerTableDifferentRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Gets the column with the passed name this->owner_col=table->getColumn(col_name); //Raises an error if the column doesn't exists if(!this->owner_col) - throw Exception(Exception::getErrorMessage(AsgInexistentSeqOwnerColumn) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInexistentSeqOwnerColumn) .arg(this->getName(true)), - AsgInexistentSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgInexistentSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* If the onwer column was added by relationship and the column id is greater than sequence id, change the sequence id to be greater to avoid reference errors */ @@ -315,21 +315,21 @@ void Sequence::setOwnerColumn(Column *column) //Raises an error when the column doesn't has a parent table if(!table) - throw Exception(Exception::getErrorMessage(AsgInvalidSeqOwnerColumn) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidSeqOwnerColumn) .arg(this->getName(true)), - AsgInvalidSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgInvalidSeqOwnerColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the table schema differs from the sequence schema if(table->getSchema()!=this->schema) - throw Exception(Exception::getErrorMessage(AsgSeqOwnerTableDifferentSchema) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgSeqOwnerTableDifferentSchema) .arg(this->getName(true)), - AsgSeqOwnerTableDifferentSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgSeqOwnerTableDifferentSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the table owner role differs from the sequence owner if(table->getOwner()!=this->owner) - throw Exception(Exception::getErrorMessage(AsgSeqOwnerTableDifferentRole) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgSeqOwnerTableDifferentRole) .arg(this->getName(true)), - AsgSeqOwnerTableDifferentRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgSeqOwnerTableDifferentRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->owner_col=column; @@ -417,7 +417,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) Sequence *seq=dynamic_cast(object); if(!seq) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index c615a361a2..49f22acb1c 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -344,7 +344,7 @@ vector *Table::getObjectList(ObjectType obj_type) else if(obj_type==ObjectType::ObjPolicy) return(&policies); else - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void Table::addObject(BaseObject *obj, int obj_idx) @@ -352,7 +352,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) ObjectType obj_type; if(!obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { int idx; @@ -376,17 +376,17 @@ void Table::addObject(BaseObject *obj, int obj_idx) //Raises an error if already exists a object with the same name and type if(getObject(obj->getName(),obj_type,idx)) { - throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(obj->getName(true)) .arg(obj->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the user try to set the table as ancestor/copy of itself else if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjBaseTable) && obj==this) - throw Exception(InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); switch(obj_type) { @@ -408,24 +408,24 @@ void Table::addObject(BaseObject *obj, int obj_idx) tab_obj->setParentTable(this); //Raises an error if the parent table of the table object is different from table 'this' else if(tab_obj->getParentTable()!=this) - throw Exception(AsgObjectBelongsAnotherTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectBelongsAnotherTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Validates the object SQL code befor insert on table obj->getCodeDefinition(SchemaParser::SqlDefinition); if(col && col->getType()==this) { - throw Exception(Exception::getErrorMessage(InvColumnTableType) + throw Exception(Exception::getErrorMessage(ErrorCode::InvColumnTableType) .arg(col->getName()) .arg(this->getName()), - InvColumnTableType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::InvColumnTableType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(obj_type==ObjectType::ObjConstraint) { //Raises a error if the user try to add a second primary key on the table if(dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::primary_key && this->getPrimaryKey()) - throw Exception(AsgExistingPrimaryKeyTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgExistingPrimaryKeyTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(obj_type==ObjectType::ObjTrigger) dynamic_cast(tab_obj)->validateTrigger(); @@ -467,7 +467,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) break; default: - throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); break; } @@ -475,11 +475,11 @@ void Table::addObject(BaseObject *obj, int obj_idx) } catch(Exception &e) { - if(e.getErrorType()==UndefinedAttributeValue) - throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) + if(e.getErrorType()==ErrorCode::UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(obj->getName()) .arg(obj->getTypeName()), - AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } @@ -665,8 +665,8 @@ void Table::addPartitionKeys(vector &part_keys) return; if(partitioning_type == PartitioningType::list && part_keys.size() > 1) - throw Exception(Exception::getErrorMessage(InvPartitionKeyCount).arg(this->getSignature()), - InvPartitionKeyCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvPartitionKeyCount).arg(this->getSignature()), + ErrorCode::InvPartitionKeyCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); partition_keys.clear(); @@ -675,15 +675,15 @@ void Table::addPartitionKeys(vector &part_keys) if(std::find(partition_keys.begin(), partition_keys.end(), part_key) != partition_keys.end()) { partition_keys = part_keys_bkp; - throw Exception(InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(part_key.getColumn() && part_key.getColumn()->isAddedByRelationship()) { partition_keys = part_keys_bkp; - throw Exception(Exception::getErrorMessage(AsgInvalidColumnPartitionKey) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidColumnPartitionKey) .arg(part_key.getColumn()->getSignature(true)), - AsgInvalidColumnPartitionKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgInvalidColumnPartitionKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); } partition_keys.push_back(part_key); @@ -744,7 +744,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) { //Raises an error if the user try to remove a object with invalid type if(!TableObject::isTableObject(obj_type) && obj_type!=ObjectType::ObjTable) - throw Exception(RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(obj_type==ObjectType::ObjTable && obj_idx < ancestor_tables.size()) { @@ -775,7 +775,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) //Raises an error if the object index is out of bound if(obj_idx >= obj_list->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(obj_type!=ObjectType::ObjColumn) { @@ -803,22 +803,22 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) //Case some trigger, constraint, index is referencing the column raises an error if(!refs.empty()) { - throw Exception(Exception::getErrorMessage(RemInderectReference) + throw Exception(Exception::getErrorMessage(ErrorCode::RemInderectReference) .arg(column->getName()) .arg(column->getTypeName()) .arg(refs[0]->getName()) .arg(refs[0]->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - RemInderectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RemInderectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the column is being referenced by any partition key if(isPartitionKeyRefColumn(column)) { - throw Exception(Exception::getErrorMessage(RemColumnRefByPartitionKey) + throw Exception(Exception::getErrorMessage(ErrorCode::RemColumnRefByPartitionKey) .arg(column->getName()).arg(this->getName(true)), - RemColumnRefByPartitionKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RemColumnRefByPartitionKey,__PRETTY_FUNCTION__,__FILE__,__LINE__); } column->setParentTable(nullptr); @@ -1099,7 +1099,7 @@ BaseObject *Table::getObject(const QString &name, ObjectType obj_type, int &obj_ else obj_idx=-1; } else - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(object); } @@ -1112,7 +1112,7 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) { //Raises an error if the object index is out of bound if(obj_idx >= ancestor_tables.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(ancestor_tables[obj_idx]); } @@ -1123,7 +1123,7 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) return(obj_list->at(obj_idx)); else //Raises an error if the object index is out of bound - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1296,7 +1296,7 @@ unsigned Table::getObjectCount(ObjectType obj_type, bool inc_added_by_rel) } } else - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); } Constraint *Table::getPrimaryKey(void) @@ -1382,7 +1382,7 @@ void Table::setRelObjectsIndexes(const vector &obj_names, const vector< else if(obj_type==ObjectType::ObjConstraint) obj_idxs_map=&constr_indexes; else - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); for(idx=0; idx < size; idx++) (*obj_idxs_map)[obj_names[idx]]=idxs[idx]; @@ -1714,7 +1714,7 @@ void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2 //Raises an error if both index is out of list bounds if(idx1 >= obj_list->size() && idx2 >= obj_list->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the idx1 is out of bound inserts the element idx2 at the list's begin else if(idx1 >= obj_list->size()) { @@ -1874,7 +1874,7 @@ QString Table::getAlterDefinition(BaseObject *object) Table *tab=dynamic_cast
(object); if(!tab) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/tablespace.cpp b/libpgmodeler/src/tablespace.cpp index bab88deb13..3bac283315 100644 --- a/libpgmodeler/src/tablespace.cpp +++ b/libpgmodeler/src/tablespace.cpp @@ -32,10 +32,10 @@ void Tablespace::setName(const QString &name) /* Tablespace names starting with pg_ is reserved to PostgreSQL if its the case raises an error */ if(name.mid(0,3)==QString("pg_")) - throw Exception(Exception::getErrorMessage(AsgReservedName) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgReservedName) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjTablespace)), - AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); } @@ -47,7 +47,7 @@ void Tablespace::setDirectory(const QString &dir) //Raises an error if the directory is an empty path if(dir_aux.isEmpty()) - throw Exception(AsgEmptyDirectoryName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEmptyDirectoryName,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->directory != dir_aux); this->directory=dir_aux; diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 76eec3b73c..d225f215bf 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -42,9 +42,9 @@ Tag::Tag(void) void Tag::setName(const QString &name) { if(name.isEmpty()) - throw Exception(AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(name.size() > BaseObject::ObjectNameMaxLength) - throw Exception(AsgLongNameObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgLongNameObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->obj_name=name; } @@ -106,13 +106,13 @@ QColor Tag::getElementColor(const QString &elem_id, unsigned color_id) void Tag::validateElementId(const QString &id, unsigned color_id) { if(color_config.count(id) == 0) - throw Exception(Exception::getErrorMessage(OprInvalidElementId).arg(id), - OprInvalidElementId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::OprInvalidElementId).arg(id), + ErrorCode::OprInvalidElementId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if((color_id > ColorCount) || (color_id > 0 && (id==ParsersAttributes::TABLE_NAME || id==ParsersAttributes::TABLE_SCHEMA_NAME))) - throw Exception(Exception::getErrorMessage(RefInvalidElementColorId).arg(id).arg(color_id), - RefInvalidElementColorId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::RefInvalidElementColorId).arg(id).arg(color_id), + ErrorCode::RefInvalidElementColorId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } QLinearGradient Tag::getFillStyle(const QString &elem_id) diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index 312c1a6197..94746c034e 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -74,7 +74,7 @@ void Textbox::operator = (Textbox &txtbox) void Textbox::setTextAttribute(unsigned attrib, bool value) { if(attrib > UnderlineText) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); text_attributes[attrib]=value; } @@ -92,7 +92,7 @@ QColor Textbox::getTextColor(void) bool Textbox::getTextAttribute(unsigned attrib) { if(attrib > UnderlineText) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(text_attributes[attrib]); } diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 6132702ea2..dc6f839584 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -86,7 +86,7 @@ void Trigger::setFiringType(FiringType firing_type) void Trigger::setEvent(EventType event, bool value) { if(event==EventType::on_select) - throw Exception(RefInvalidTriggerEvent,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidTriggerEvent,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(events[event] != value); events[event]=value; @@ -96,21 +96,21 @@ void Trigger::setFunction(Function *func) { //Case the function is null an error is raised if(!func) - throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)), - AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { //Case the function doesn't returns 'trigger' it cannot be used with the trigger thus raise an error if(func->getReturnType()!=QString("trigger")) - throw Exception(Exception::getErrorMessage(AsgInvalidTriggerFunction).arg(QString("trigger")),__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidTriggerFunction).arg(QString("trigger")),__PRETTY_FUNCTION__,__FILE__,__LINE__); //Case the function has some parameters raise an error else if(func->getParameterCount()!=0) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)), - AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(function != func); this->function=func; @@ -150,7 +150,7 @@ void Trigger::editArgument(unsigned arg_idx, const QString &new_arg) { //Raises an error if the argument index is invalid (out of bound) if(arg_idx>=arguments.size()) - throw Exception(RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr; @@ -169,7 +169,7 @@ void Trigger::setExecutePerRow(bool value) bool Trigger::isExecuteOnEvent(EventType event) { if(event==EventType::on_select) - throw Exception(RefInvalidTriggerEvent,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidTriggerEvent,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(events.at(!event)); } @@ -183,7 +183,7 @@ QString Trigger::getArgument(unsigned arg_idx) { //Raises an error if the argument index is invalid (out of bound) if(arg_idx>=arguments.size()) - throw Exception(RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(arguments[arg_idx]); } @@ -192,7 +192,7 @@ Column *Trigger::getColumn(unsigned col_idx) { //Raises an error if the column index is invalid (out of bound) if(col_idx>=upd_columns.size()) - throw Exception(RefColumnInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefColumnInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(upd_columns[col_idx]); } @@ -226,7 +226,7 @@ void Trigger::removeArgument(unsigned arg_idx) { //Raises an error if the argument index is invalid (out of bound) if(arg_idx>=arguments.size()) - throw Exception(RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefArgumentInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vector::iterator itr; itr=arguments.begin()+arg_idx; @@ -250,7 +250,7 @@ void Trigger::setReferecendTable(BaseTable *ref_table) { //If the referenced table isn't valid raises an error if(ref_table && ref_table->getObjectType()!=ObjectType::ObjTable) - throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(referenced_table != ref_table); this->referenced_table=ref_table; @@ -292,7 +292,7 @@ void Trigger::setConstraint(bool value) void Trigger::setTransitionTableName(unsigned tab_idx, const QString &name) { if(tab_idx > NewTableName) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(transition_tabs_names[tab_idx] != name); transition_tabs_names[tab_idx] = name; @@ -301,7 +301,7 @@ void Trigger::setTransitionTableName(unsigned tab_idx, const QString &name) QString Trigger::getTransitionTableName(unsigned tab_idx) { if(tab_idx > NewTableName) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(transition_tabs_names[tab_idx]); } @@ -446,33 +446,33 @@ void Trigger::validateTrigger(void) { //The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers if(firing_type==FiringType::instead_of && parent_type==ObjectType::ObjTable) - throw Exception(InvTableTriggerInsteadOfFiring,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvTableTriggerInsteadOfFiring,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The INSTEAD OF mode cannot be used on view triggers that executes for each statement else if(firing_type==FiringType::instead_of && parent_type==ObjectType::ObjView && !is_exec_per_row) - throw Exception(InvUsageInsteadOfOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvUsageInsteadOfOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event else if(firing_type==FiringType::instead_of && events[EventType::on_update] && !upd_columns.empty()) - throw Exception(InvUsageInsteadOfUpdateTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvUsageInsteadOfUpdateTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table else if(events[EventType::on_truncate] && (is_exec_per_row || parent_type==ObjectType::ObjView)) - throw Exception(InvUsageTruncateOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvUsageTruncateOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A view trigger cannot be AFTER/BEFORE when it executes for each row else if(parent_type==ObjectType::ObjView && is_exec_per_row && (firing_type==FiringType::after || firing_type==FiringType::before)) - throw Exception(InvUsageAfterBeforeViewTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvUsageAfterBeforeViewTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Only constraint triggers can be deferrable or reference another table else if(referenced_table || is_deferrable) - throw Exception(InvUseConstraintTriggerAttribs,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvUseConstraintTriggerAttribs,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Constraint triggers can only be executed on AFTER events and for each row else { if(firing_type!=FiringType::after && !is_exec_per_row) - throw Exception(InvConstrTriggerNotAfterRow,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvConstrTriggerNotAfterRow,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 471547a77a..a0b6ca52aa 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -98,14 +98,14 @@ void Type::addAttribute(TypeAttribute attrib) { //Raises an error if the attribute has an empty name or null type if(attrib.getName().isEmpty() || attrib.getType()==PgSQLType::null) - throw Exception(InsInvalidTypeAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsInvalidTypeAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the passed attribute has the same type as the defining type (this) else if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !attrib.getType()) - throw Exception(Exception::getErrorMessage(InvUserTypeSelfReference).arg(this->getName(true)), - InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvUserTypeSelfReference).arg(this->getName(true)), + ErrorCode::InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the attribute already exists else if(getAttributeIndex(attrib.getName()) >= 0) - throw Exception(InsDuplicatedItems,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedItems,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_attribs.push_back(attrib); setCodeInvalidated(true); @@ -115,7 +115,7 @@ void Type::removeAttribute(unsigned attrib_idx) { //Raises an error if the attribute index is out of bound if(attrib_idx >= type_attribs.size()) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_attribs.erase(type_attribs.begin() + attrib_idx); setCodeInvalidated(true); @@ -148,17 +148,17 @@ void Type::addEnumeration(const QString &enum_name) { //Raises an error if the enumaration name is empty if(enum_name.isEmpty()) - throw Exception(InsInvalidEnumerationItem,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsInvalidEnumerationItem,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the enumeration name is invalid (exceeds the maximum length) else if(enum_name.size() > BaseObject::ObjectNameMaxLength) - throw Exception(Exception::getErrorMessage(AsgEnumLongName).arg(enum_name).arg(this->getName(true)), - AsgEnumLongName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgEnumLongName).arg(enum_name).arg(this->getName(true)), + ErrorCode::AsgEnumLongName,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(enum_name.contains(QChar(','))) - throw Exception(Exception::getErrorMessage(AsgEnumInvalidChars).arg(enum_name).arg(this->getName(true)), - AsgEnumInvalidChars,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgEnumInvalidChars).arg(enum_name).arg(this->getName(true)), + ErrorCode::AsgEnumInvalidChars,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the enumeration already exists else if(isEnumerationExists(enum_name)) - throw Exception(InsDuplicatedEnumerationItem,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InsDuplicatedEnumerationItem,__PRETTY_FUNCTION__,__FILE__,__LINE__); enumerations.push_back(enum_name); setCodeInvalidated(true); @@ -167,7 +167,7 @@ void Type::addEnumeration(const QString &enum_name) void Type::removeEnumeration(unsigned enum_idx) { if(enum_idx >= enumerations.size()) - throw Exception(RefEnumerationInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefEnumerationInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); enumerations.erase(enumerations.begin() + enum_idx); setCodeInvalidated(true); @@ -183,7 +183,7 @@ void Type::setConfiguration(unsigned conf) { //Raises an error if the configuration type is invalid if(conf < BaseType || conf > RangeType) - throw Exception(AsgInvalidTypeConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_attribs.clear(); enumerations.clear(); @@ -216,7 +216,7 @@ void Type::setFunction(unsigned func_id, Function *func) //Raises an error if the function id is invalid if(func_id >= funcs_len) - throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(func) param_count=func->getParameterCount(); @@ -225,14 +225,14 @@ void Type::setFunction(unsigned func_id, Function *func) to the type's configuraiton */ if((config==BaseType && func_id >= CanonicalFunc) || (config==RangeType && func_id <= AnalyzeFunc)) - throw Exception(RefInvalidFunctionIdTypeConfig,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefInvalidFunctionIdTypeConfig,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the function isn't defined and the function id is INPUT or OUTPUT, because this function is mandatory for base types */ else if(!func && (func_id==InputFunc || func_id==OutputFunc)) - throw Exception(Exception::getErrorMessage(AsgNotAllocatedFunction) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName(true)) .arg(BaseObject::getTypeName(ObjectType::ObjType)), - AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(func) { @@ -241,7 +241,7 @@ void Type::setFunction(unsigned func_id, Function *func) if((func_id!=CanonicalFunc && func_id!=SubtypeDiffFunc) && func->getLanguage()->getName()!=~LanguageType(LanguageType::c) && func->getLanguage()->getName()!=~LanguageType(LanguageType::internal)) - throw Exception(AsgFunctionInvalidLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgFunctionInvalidLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the parameter count for INPUT and RECV functions is different from 1 or 3. */ @@ -252,10 +252,10 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==OutputFunc || func_id==SendFunc || func_id==TpmodInFunc || func_id==TpmodOutFunc || func_id==AnalyzeFunc || func_id==CanonicalFunc))) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParamCount) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjType)), - AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Checking the return types of function in relation to type. INPUT, RECV and CANONICAL functions must return the data type that is being defined according to the documentation, but to facilitate the implementation the function must return data type @@ -272,10 +272,10 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==AnalyzeFunc && func->getReturnType()!=QString("boolean")) || (func_id==CanonicalFunc && func->getReturnType()!=QString("\"any\"")) || (func_id==SubtypeDiffFunc && func->getReturnType()!=QString("double precision"))) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidReturnType) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjType)), - AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Validating the parameter types of function in relation to the type configuration. The INPUT function must have parameters with type (cstring, oid, integer). @@ -303,10 +303,10 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==SubtypeDiffFunc && (func->getParameter(0).getType()!=this->subtype || func->getParameter(1).getType()!=this->subtype))) - throw Exception(Exception::getErrorMessage(AsgFunctionInvalidParameters) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName()) .arg(this->getTypeName()), - AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); func->setProtected(false); } @@ -375,8 +375,8 @@ void Type::setAlignment(PgSQLType type) //Raises an error if the type assigned to the alignment is invalid according to the rule if(tp!=QString("char") && tp!=QString("smallint") && tp!=QString("integer") && tp!=QString("double precision")) - throw Exception(Exception::getErrorMessage(AsgInvalidAlignmentType).arg(this->getName(true)), - AsgInvalidAlignmentType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidAlignmentType).arg(this->getName(true)), + ErrorCode::AsgInvalidAlignmentType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(alignment != type); alignment=tp; @@ -399,13 +399,13 @@ void Type::setDefaultValue(const QString &value) void Type::setElement(PgSQLType elem) { if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !elem) - throw Exception(Exception::getErrorMessage(InvUserTypeSelfReference).arg(this->getName(true)), - InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvUserTypeSelfReference).arg(this->getName(true)), + ErrorCode::InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(elem!=QString("\"any\"") && (elem.isOIDType() || elem.isPseudoType() || elem.isUserType() || elem.isArrayType())) - throw Exception(Exception::getErrorMessage(AsgInvalidElementType).arg(this->getName(true)), - AsgInvalidElementType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidElementType).arg(this->getName(true)), + ErrorCode::AsgInvalidElementType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(element != elem); this->element=elem; @@ -472,8 +472,8 @@ void Type::setCollatable(bool value) void Type::setLikeType(PgSQLType like_type) { if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !like_type) - throw Exception(Exception::getErrorMessage(InvUserTypeSelfReference).arg(this->getName(true)), - InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvUserTypeSelfReference).arg(this->getName(true)), + ErrorCode::InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->like_type != like_type); this->like_type=like_type; @@ -482,8 +482,8 @@ void Type::setLikeType(PgSQLType like_type) void Type::setSubtype(PgSQLType subtype) { if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !subtype) - throw Exception(Exception::getErrorMessage(InvUserTypeSelfReference).arg(this->getName(true)), - InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvUserTypeSelfReference).arg(this->getName(true)), + ErrorCode::InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->subtype != subtype); this->subtype=subtype; @@ -492,10 +492,10 @@ void Type::setSubtype(PgSQLType subtype) void Type::setSubtypeOpClass(OperatorClass *opclass) { if(opclass && opclass->getIndexingType()!=IndexingType::btree) - throw Exception(Exception::getErrorMessage(AsgInvalidOpClassObject) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidOpClassObject) .arg(this->getName(true)) .arg(this->getTypeName()), - AsgInvalidOpClassObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgInvalidOpClassObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(subtype_opclass != opclass); subtype_opclass=opclass; @@ -504,7 +504,7 @@ void Type::setSubtypeOpClass(OperatorClass *opclass) TypeAttribute Type::getAttribute(unsigned attrib_idx) { if(attrib_idx >= type_attribs.size()) - throw Exception(RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefAttributeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type_attribs[attrib_idx]); } @@ -517,7 +517,7 @@ unsigned Type::getAttributeCount(void) QString Type::getEnumeration(unsigned idx_enum) { if(idx_enum >= enumerations.size()) - throw Exception(RefEnumerationInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefEnumerationInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(enumerations[idx_enum]); } @@ -530,7 +530,7 @@ unsigned Type::getEnumerationCount(void) Function *Type::getFunction(unsigned func_id) { if(func_id >= sizeof(functions)/sizeof(Function *)) - throw Exception(RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_id]); } @@ -712,7 +712,7 @@ QString Type::getAlterDefinition(BaseObject *object) Type *type=dynamic_cast(object); if(!type) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 5e783fe089..b2ed3b63fa 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -226,17 +226,17 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) { //Raises an error if the expression is empty if(refer.getExpression().isEmpty()) - throw Exception(AsgInvalidViewDefExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidViewDefExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if already exists a definition expression else if(hasDefinitionExpression()) - throw Exception(AsgSecondViewDefExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgSecondViewDefExpression,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the user try to add a definition expression when already exists another references else if(!references.empty()) - throw Exception(MixingViewDefExprsReferences,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::MixingViewDefExprsReferences,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the user try to add a ordinary reference when there is a reference used as definition expression else if(hasDefinitionExpression()) - throw Exception(MixingViewDefExprsReferences,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::MixingViewDefExprsReferences,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Checks if the reference already exists idx=getReferenceIndex(refer); @@ -264,7 +264,7 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) expr_list->insert(expr_list->begin() + expr_id, static_cast(idx)); //Raises an error if the expression id is invalid else if(expr_id >= 0 && expr_id >= static_cast(expr_list->size())) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); else expr_list->push_back(static_cast(idx)); @@ -320,7 +320,7 @@ Reference View::getReference(unsigned ref_id) { //Raises an error if the reference id is out of bound if(ref_id >= references.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(references[ref_id]); } @@ -331,7 +331,7 @@ Reference View::getReference(unsigned ref_id, unsigned sql_type) //Raises an error if the reference id is out of bound if(ref_id >= references.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(sql_type==Reference::SqlViewDefinition || vect_idref) return(references[ref_id]); @@ -347,7 +347,7 @@ void View::removeReference(unsigned ref_id) //Raises an error if the reference id is out of bound if(ref_id >= references.size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); for(i=0; i < 3; i++) { @@ -384,7 +384,7 @@ void View::removeReference(unsigned expr_id, unsigned sql_type) vector *vect_idref=getExpressionList(sql_type); if(expr_id >= vect_idref->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); vect_idref->erase(vect_idref->begin() + expr_id); setCodeInvalidated(true); @@ -697,7 +697,7 @@ int View::getObjectIndex(const QString &name, ObjectType obj_type) void View::addObject(BaseObject *obj, int obj_idx) { if(!obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { try @@ -708,12 +708,12 @@ void View::addObject(BaseObject *obj, int obj_idx) //Raises an error if already exists a object with the same name and type if(getObjectIndex(obj->getName(), tab_obj->getObjectType()) >= 0) { - throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(obj->getName(true)) .arg(obj->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()), - AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Validates the object definition @@ -734,11 +734,11 @@ void View::addObject(BaseObject *obj, int obj_idx) } catch(Exception &e) { - if(e.getErrorType()==UndefinedAttributeValue) - throw Exception(Exception::getErrorMessage(AsgObjectInvalidDefinition) + if(e.getErrorType()==ErrorCode::UndefinedAttributeValue) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(obj->getName()) .arg(obj->getTypeName()), - AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } @@ -788,7 +788,7 @@ void View::removeObject(unsigned obj_idx, ObjectType obj_type) //Raises an error if the object index is out of bound if(obj_idx >= obj_list->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); itr=obj_list->begin() + obj_idx; (*itr)->setParentTable(nullptr); @@ -862,7 +862,7 @@ TableObject *View::getObject(unsigned obj_idx, ObjectType obj_type) //Raises an error if the object index is out of bound if(obj_idx >= obj_list->size()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(obj_list->at(obj_idx)); } @@ -957,7 +957,7 @@ vector *View::getObjectList(ObjectType obj_type) else if(obj_type==ObjectType::ObjIndex) return(&indexes); else - throw Exception(ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void View::removeObjects(void) diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index 6c83267d6d..5815dbd55f 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -83,8 +83,8 @@ void BaseConfigWidget::saveConfiguration(const QString &conf_id, maptable=nullptr; if(!model || (uses_op_list && !op_list)) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(op_list) operation_count = op_list->getCurrentSize(); @@ -314,7 +314,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis else if(parent_type==ObjectType::ObjRelationship) this->relationship=dynamic_cast(parent_obj); else if(parent_type!=ObjectType::ObjDatabase && parent_type!=ObjectType::ObjSchema) - throw Exception(AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -748,12 +748,12 @@ void BaseObjectWidget::applyConfiguration(void) //Raises an error if another object is found with the same name as the editing object if(!new_obj && aux_obj && aux_obj!=object) { - throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(obj_name) .arg(BaseObject::getTypeName(obj_type)) .arg(parent_obj->getName(true)) .arg(parent_obj->getTypeName()), - AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -891,10 +891,10 @@ void BaseObjectWidget::finishConfiguration(void) { QApplication::restoreOverrideCursor(); - if(e.getErrorType()==AsgObjectInvalidDefinition) - throw Exception(Exception::getErrorMessage(RequiredFieldsNotFilled) + if(e.getErrorType()==ErrorCode::AsgObjectInvalidDefinition) + throw Exception(Exception::getErrorMessage(ErrorCode::RequiredFieldsNotFilled) .arg(this->object->getName()).arg(this->object->getTypeName()), - RequiredFieldsNotFilled,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + ErrorCode::RequiredFieldsNotFilled,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } diff --git a/libpgmodeler_ui/src/bugreportform.cpp b/libpgmodeler_ui/src/bugreportform.cpp index aa5974f3bc..188120de28 100644 --- a/libpgmodeler_ui/src/bugreportform.cpp +++ b/libpgmodeler_ui/src/bugreportform.cpp @@ -103,7 +103,7 @@ void BugReportForm::generateReport(const QByteArray &buf) output.open(QFile::WriteOnly); if(!output.isOpen()) - msgbox.show(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), Messagebox::ErrorIcon); + msgbox.show(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(filename), Messagebox::ErrorIcon); else { QByteArray comp_buf; @@ -140,8 +140,8 @@ void BugReportForm::attachModel(void) input.open(QFile::ReadOnly); if(!input.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(file_dlg.selectedFiles().at(0)), - FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(file_dlg.selectedFiles().at(0)), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf=input.readAll(); model_txt->setPlainText(QString(buf)); diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 692e65e533..5b02b3ff2c 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -24,7 +24,7 @@ CodeCompletionWidget::CodeCompletionWidget(QPlainTextEdit *code_field_txt, bool enable_snippets) : QWidget(dynamic_cast(code_field_txt)) { if(!code_field_txt) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->enable_snippets = enable_snippets; popup_timer.setInterval(300); diff --git a/libpgmodeler_ui/src/colorpickerwidget.cpp b/libpgmodeler_ui/src/colorpickerwidget.cpp index 4ccdf52764..3364fea826 100644 --- a/libpgmodeler_ui/src/colorpickerwidget.cpp +++ b/libpgmodeler_ui/src/colorpickerwidget.cpp @@ -80,7 +80,7 @@ void ColorPickerWidget::setColor(int color_idx, const QColor &color) QString cl_name; if(color_idx < 0 || color_idx >= colors.size()) - throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(this->isEnabled()) cl_name=color.name(); @@ -94,7 +94,7 @@ void ColorPickerWidget::setColor(int color_idx, const QColor &color) QColor ColorPickerWidget::getColor(int color_idx) { if(color_idx < 0 || color_idx >= colors.size()) - throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(colors[color_idx]); } @@ -107,7 +107,7 @@ unsigned ColorPickerWidget::getColorCount(void) bool ColorPickerWidget::isButtonVisible(unsigned idx) { if(idx >= static_cast(buttons.size())) - throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(buttons[idx]->isVisible()); } @@ -115,7 +115,7 @@ bool ColorPickerWidget::isButtonVisible(unsigned idx) void ColorPickerWidget::setButtonToolTip(unsigned button_idx, const QString &tooltip) { if(button_idx >= static_cast(buttons.size())) - throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); buttons[button_idx]->setToolTip(tooltip); } @@ -134,7 +134,7 @@ void ColorPickerWidget::setEnabled(bool value) void ColorPickerWidget::setButtonVisible(unsigned idx, bool value) { if(idx >= static_cast(buttons.size())) - throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); buttons[idx]->setVisible(value); } diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 4c7aaa33f6..52f4e2a0ef 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -100,7 +100,7 @@ void ColumnWidget::setAttributes(DatabaseModel *model, OperationList *op_list, B PgSQLType type; if(!parent_obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, column, parent_obj); sequence_sel->setModel(model); @@ -191,10 +191,10 @@ void ColumnWidget::applyConfiguration(void) { pk = dynamic_cast
(table)->getPrimaryKey(); if(pk && pk->isColumnReferenced(column) && !notnull_chk->isChecked()) - throw Exception(Exception::getErrorMessage(NullPrimaryKeyColumn) + throw Exception(Exception::getErrorMessage(ErrorCode::NullPrimaryKeyColumn) .arg(column->getName()) .arg(pk->getParentTable()->getSignature(true)), - NullPrimaryKeyColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::NullPrimaryKeyColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); } BaseObjectWidget::applyConfiguration(); diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index 46a3caffb7..adbafb7a63 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -115,13 +115,13 @@ void ConfigurationForm::loadConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==PluginsNotLoaded) + if(e.getErrorType()==ErrorCode::PluginsNotLoaded) { msg_box.show(e); } else { - Exception ex = Exception(Exception::getErrorMessage(ConfigurationNotLoaded).arg(e.getExtraInfo()),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + Exception ex = Exception(Exception::getErrorMessage(ErrorCode::ConfigurationNotLoaded).arg(e.getExtraInfo()),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); msg_box.show(ex, QString("%1 %2").arg(ex.getErrorMessage()).arg(trUtf8("In some cases restore the default settings related to it may solve the problem. Would like to do that?")), Messagebox::AlertIcon, Messagebox::YesNoButtons, trUtf8("Restore"), QString(), QString(), PgModelerUiNs::getIconPath("atualizar")); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 4241e6200d..cbc37f29c6 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -559,7 +559,7 @@ void ConnectionsConfigWidget::fillConnectionsComboBox(QComboBox *combo, bool inc Connection *def_conn=nullptr; if(!combo) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); getConnections(connections); diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 852f90f3a6..fc5d278ddc 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -356,11 +356,11 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis vector excl_elems; if(!parent_obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=parent_obj->getObjectType(); if(obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjRelationship) - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, constr, parent_obj); @@ -486,7 +486,7 @@ void ConstraintWidget::applyConfiguration(void) //Raises an error if the user try to create a primary key that has columns added by relationship (not supported) if(constr->getConstraintType()==ConstraintType::primary_key && constr->isReferRelationshipAddedColumn()) - throw Exception(UnsupportedPKColsAddedByRel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::UnsupportedPKColsAddedByRel,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::applyConfiguration(); @@ -497,7 +497,7 @@ void ConstraintWidget::applyConfiguration(void) constr->getColumnCount(Constraint::SourceCols)==0) || (constr->getConstraintType()==ConstraintType::foreign_key && constr->getColumnCount(Constraint::ReferencedCols)==0)) - throw Exception(InvConstratintNoColumns,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvConstratintNoColumns,__PRETTY_FUNCTION__,__FILE__,__LINE__); finishConfiguration(); diff --git a/libpgmodeler_ui/src/csvloadwidget.cpp b/libpgmodeler_ui/src/csvloadwidget.cpp index 3b36ddae2d..6aa8334d03 100644 --- a/libpgmodeler_ui/src/csvloadwidget.cpp +++ b/libpgmodeler_ui/src/csvloadwidget.cpp @@ -137,8 +137,8 @@ void CsvLoadWidget::loadCsvFile(void) file.setFileName(file_edt->text()); if(!file.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(file_edt->text()), - FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(file_edt->text()), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); csv_columns.clear(); csv_rows.clear(); diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index c0852dee1c..915d842eae 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -122,9 +122,9 @@ void CustomSQLWidget::configureMenus(void) void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) { if(!object) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!BaseObject::acceptsCustomSQL(object->getObjectType())) - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 41106bad57..820b1d398f 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1124,7 +1124,7 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *item) { if(!item) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); QString obj_name=item->text(0); @@ -1967,9 +1967,9 @@ void DatabaseExplorerWidget::dropDatabase(void) catch(Exception &e) { if(connection.getConnectionParam(Connection::ParamDbName) == default_db) - throw Exception(Exception::getErrorMessage(DropCurrentDBDefault) + throw Exception(Exception::getErrorMessage(ErrorCode::DropCurrentDBDefault) .arg(dbname).arg(connection.getConnectionParam(Connection::ParamAlias)), - DropCurrentDBDefault,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + ErrorCode::DropCurrentDBDefault,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 1cc5f21938..8e56304334 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -422,7 +422,7 @@ void DatabaseImportForm::filterObjects(void) void DatabaseImportForm::filterObjects(QTreeWidget *tree_wgt, const QString &pattern, int search_column, bool sel_single_leaf) { if(!tree_wgt) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); QList items; QTreeWidgetItemIterator itr(tree_wgt); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index fbd7244dab..bab3c87175 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -67,7 +67,7 @@ void DatabaseImportHelper::setCurrentDatabase(const QString &dbname) void DatabaseImportHelper::setSelectedOIDs(DatabaseModel *db_model, const map > &obj_oids, const map > &col_oids) { if(!db_model) - throw Exception(AsgNotAllocattedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); dbmodel=db_model; xmlparser=dbmodel->getXMLParser(); @@ -545,7 +545,7 @@ void DatabaseImportHelper::importDatabase(void) try { if(!dbmodel) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); dbmodel->setLoadingModel(true); dbmodel->setObjectListsCapacity(creation_order.size()); @@ -748,9 +748,9 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) } catch(Exception &e) { - throw Exception(Exception::getErrorMessage(ObjectNotImported) + throw Exception(Exception::getErrorMessage(ErrorCode::ObjectNotImported) .arg(obj_name).arg(BaseObject::getTypeName(obj_type)).arg(attribs[ParsersAttributes::OID]), - ObjectNotImported,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs)); + ErrorCode::ObjectNotImported,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs)); } } @@ -1789,10 +1789,10 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(!partitioned_tab) { - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::ObjTable)) .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjectType::ObjTable)), - RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -2020,10 +2020,10 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::ObjView)); if(!parent_tab) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::ObjIndex)) .arg(tab_name).arg(BaseObject::getTypeName(ObjectType::ObjTable)), - RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } cols=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]); @@ -2293,7 +2293,7 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) /* If the role doesn't exists and there is a name defined, throws an error because the roles wasn't found on the model */ if(!role && !role_name.isEmpty()) - throw Exception(Exception::getErrorMessage(RefObjectInexistsModel) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(QString("permission_%1").arg(perm_list[i])).arg(BaseObject::getTypeName(ObjectType::ObjPermission)) .arg(role_name).arg(BaseObject::getTypeName(ObjectType::ObjRole)) ,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -2529,8 +2529,9 @@ void DatabaseImportHelper::__createTableInheritances(void) } if(!parent_tab) - throw Exception(Exception::getErrorMessage(InvInheritParentTableNotFound).arg(child_tab->getSignature()).arg(inh_list.front()), - InvInheritParentTableNotFound,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvInheritParentTableNotFound) + .arg(child_tab->getSignature()).arg(inh_list.front()), + ErrorCode::InvInheritParentTableNotFound,__PRETTY_FUNCTION__,__FILE__,__LINE__); inh_list.pop_front(); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 335ad3dcb6..888d0bb55f 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -1319,9 +1319,9 @@ void DataManipulationForm::saveChanges(void) results_tbw->selectRow(row); results_tbw->scrollToItem(results_tbw->item(row, 0)); - throw Exception(Exception::getErrorMessage(RowDataNotManipulated) + throw Exception(Exception::getErrorMessage(ErrorCode::RowDataNotManipulated) .arg(op_names[op_type]).arg(tab_name).arg(row + 1).arg(e.getErrorMessage()), - RowDataNotManipulated,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + ErrorCode::RowDataNotManipulated,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } #endif } @@ -1390,9 +1390,9 @@ QString DataManipulationForm::getDMLCommand(int row) if((value.startsWith(PgModelerNs::UnescValueStart) && value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd)) || (value.startsWith(PgModelerNs::UnescValueStart) && !value.endsWith(PgModelerNs::UnescValueEnd)) || (!value.startsWith(PgModelerNs::UnescValueStart) && !value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd) && value.endsWith(PgModelerNs::UnescValueEnd))) - throw Exception(Exception::getErrorMessage(MalformedUnescapedValue) + throw Exception(Exception::getErrorMessage(ErrorCode::MalformedUnescapedValue) .arg(row + 1).arg(col_name), - MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); col_list.push_back(QString("\"%1\"").arg(col_name)); diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index 87bd69a98d..e970c47df4 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -134,12 +134,12 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) if(!model || !parent_obj) { this->setEnabled(false); - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(parent_obj->getObjectType()!=ObjectType::ObjTable && parent_obj->getObjectType()!=ObjectType::ObjView && parent_obj->getObjectType()!=ObjectType::ObjRelationship) - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setEnabled(true); this->parent_obj=parent_obj; diff --git a/libpgmodeler_ui/src/findreplacewidget.cpp b/libpgmodeler_ui/src/findreplacewidget.cpp index a088bd4b79..b1809845e6 100644 --- a/libpgmodeler_ui/src/findreplacewidget.cpp +++ b/libpgmodeler_ui/src/findreplacewidget.cpp @@ -21,7 +21,7 @@ FindReplaceWidget::FindReplaceWidget(QPlainTextEdit *txt_edit, QWidget *parent): QWidget(parent) { if(!txt_edit) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setupUi(this); text_edt=txt_edit; diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index 555f237e26..0df2d9cc3b 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -483,10 +483,10 @@ void FunctionWidget::validateConfiguredFunction(void) } catch(Exception &e) { - throw Exception(Exception::getErrorMessage(InvFuncConfigInvalidatesObject) + throw Exception(Exception::getErrorMessage(ErrorCode::InvFuncConfigInvalidatesObject) .arg(object->getName(true)) .arg(object->getTypeName()), - InvFuncConfigInvalidatesObject, + ErrorCode::InvFuncConfigInvalidatesObject, __PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/hinttextwidget.cpp b/libpgmodeler_ui/src/hinttextwidget.cpp index d2184384c8..ade25a1f59 100644 --- a/libpgmodeler_ui/src/hinttextwidget.cpp +++ b/libpgmodeler_ui/src/hinttextwidget.cpp @@ -24,7 +24,7 @@ HintTextWidget::HintTextWidget(QWidget *btn_parent, QWidget *parent): QWidget(parent) { if(!btn_parent) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); QHBoxLayout *layout=new QHBoxLayout(btn_parent); QGraphicsDropShadowEffect *shadow=nullptr; diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index f56f736074..585878a84b 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -96,7 +96,7 @@ void IndexWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Ba vector idx_elems; if(!parent_obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, index, parent_obj); diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index 5634b15d51..0006827a0c 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -27,7 +27,7 @@ QColor LineNumbersWidget::bg_color=Qt::black; LineNumbersWidget::LineNumbersWidget(QPlainTextEdit * parent) : QWidget(parent) { if(!parent) - throw Exception(AsgNotAllocattedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); parent_edt = qobject_cast(parent); first_line=line_count=start_sel_pos=0; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 2cee143976..7903b922e3 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -953,9 +953,9 @@ void MainWindow::addModel(ModelWidget *model_wgt) try { if(!model_wgt) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(model_wgt->parent()) - throw Exception(AsgWidgetAlreadyHasParent,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgWidgetAlreadyHasParent,__PRETTY_FUNCTION__,__FILE__,__LINE__); model_nav_wgt->addModel(model_wgt); @@ -983,7 +983,7 @@ int MainWindow::getModelCount(void) ModelWidget *MainWindow::getModel(int idx) { if(idx < 0 || idx > models_tbw->count()) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(models_tbw->widget(idx))); } @@ -1637,12 +1637,12 @@ void MainWindow::showFixMessage(Exception &e, const QString &filename) { Messagebox msg_box; - msg_box.show(Exception(Exception::getErrorMessage(ModelFileNotLoaded).arg(filename), - ModelFileNotLoaded ,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e), - trUtf8("Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again.").arg(filename), - Messagebox::ErrorIcon, Messagebox::YesNoButtons, - trUtf8("Fix model"), trUtf8("Cancel"), QString(), - PgModelerUiNs::getIconPath("fixobject"), PgModelerUiNs::getIconPath("msgbox_erro")); + msg_box.show(Exception(Exception::getErrorMessage(ErrorCode::ModelFileNotLoaded).arg(filename), + ErrorCode::ModelFileNotLoaded ,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e), + trUtf8("Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again.").arg(filename), + Messagebox::ErrorIcon, Messagebox::YesNoButtons, + trUtf8("Fix model"), trUtf8("Cancel"), QString(), + PgModelerUiNs::getIconPath("fixobject"), PgModelerUiNs::getIconPath("msgbox_erro")); if(msg_box.result()==QDialog::Accepted) fixModel(filename); diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 898abd499b..1442e4a3b9 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -152,7 +152,7 @@ void MetadataHandlingForm::handleObjectsMetada(void) if(!backup_file_edt->text().isEmpty() && backup_file_edt->text() == model_wgt->getFilename()) throw Exception(trUtf8("The backup file cannot be the same as the input model!"), - Custom, __PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::Custom, __PRETTY_FUNCTION__,__FILE__,__LINE__); QTemporaryFile tmp_file; QString metadata_file; diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index af24622929..c777d1df27 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -430,7 +430,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) try { if(thread_id != SrcImportThread && thread_id != ImportThread) - throw Exception(AllocationObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AllocationObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); createThread(thread_id); @@ -621,8 +621,8 @@ void ModelDatabaseDiffForm::saveDiffToFile(void) output.setFileName(file_edt->text()); if(!output.open(QFile::WriteOnly)) - captureThreadError(Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(file_edt->text()), - FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__)); + captureThreadError(Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(file_edt->text()), + ErrorCode::FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__)); output.write(sqlcode_txt->toPlainText().toUtf8()); output.close(); diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 11d4f12fc2..d8d3feb056 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -62,7 +62,7 @@ void ModelExportHelper::setIgnoredErrors(const QStringList &err_codes) void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &filename, const QString &pgsql_ver) { if(!db_model) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); connect(db_model, SIGNAL(s_objectLoaded(int,QString,uint)), this, SLOT(updateProgress(int,QString,uint))); @@ -91,7 +91,7 @@ void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &file void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename, double zoom, bool show_grid, bool show_delim, bool page_by_page, QGraphicsView *viewp) { if(!scene) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -214,8 +214,8 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename ObjectsScene::setGridOptions(shw_grd, align_objs, shw_dlm); scene->update(); - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(file), - FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(file), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -243,7 +243,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename, bool show_grid, bool show_delim) { if(!scene) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); bool shw_dlm=false, shw_grd=false, align_objs=false; QSvgGenerator svg_gen; @@ -273,8 +273,8 @@ void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename scene->update(); if(!fi.exists() || !fi.isWritable() || !fi.isReadable()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(filename), - FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(filename), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); QFile svg_file; svg_file.setFileName(filename); @@ -322,15 +322,15 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c try { if(!db_model) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* If the export is called using ignore duplications or drop database and simulation mode at same time an error is raised because the simulate mode (mainly used as SQL validation) cannot undo column addition (this can be changed in the future) */ if(simulate && (ignore_dup || drop_db || drop_objs)) - throw Exception(MixingIncompExportOptions,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::MixingIncompExportOptions,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(drop_db && drop_objs) - throw Exception(MixingIncompDropOptions,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::MixingIncompDropOptions,__PRETTY_FUNCTION__,__FILE__,__LINE__); connect(db_model, SIGNAL(s_objectLoaded(int,QString,uint)), this, SLOT(updateProgress(int,QString,uint)), Qt::DirectConnection); @@ -364,7 +364,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c generateTempObjectNames(db_model); } else if(use_tmp_names) - throw Exception(InvUsageTempNamesExportOption,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvUsageTempNamesExportOption,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(simulate && db_model->isSQLDisabled()) diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index ced5960cc7..f9da263af7 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -223,7 +223,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr QString obj_name; if(!object) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=object->getObjectType(); tab_obj=dynamic_cast(object); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 148975eec5..afa1c9542f 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -47,7 +47,7 @@ ModelsDiffHelper::~ModelsDiffHelper(void) void ModelsDiffHelper::setDiffOption(unsigned opt_id, bool value) { if(opt_id > OptDropMissingColsConstr) - throw Exception(RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opt_id == OptDropMissingColsConstr) diff_opts[opt_id]=value & !diff_opts[OptDropMissingColsConstr]; @@ -82,7 +82,7 @@ void ModelsDiffHelper::setModels(DatabaseModel *src_model, DatabaseModel *imp_mo unsigned ModelsDiffHelper::getDiffTypeCount(unsigned diff_type) { if(diff_type >= ObjectsDiffInfo::NoDifference) - throw Exception(RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefElementInvalidIndex ,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(diffs_counter[diff_type]); } @@ -92,7 +92,7 @@ void ModelsDiffHelper::diffModels(void) try { if(!source_model || !imported_model) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); //First, we need to detect the objects to be dropped diffModels(ObjectsDiffInfo::DropObject); diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index 583a667f48..2bffcb1a35 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -233,7 +233,7 @@ void ModelValidationHelper::redirectExportProgress(int prog, QString msg, Object void ModelValidationHelper::setValidationParams(DatabaseModel *model, Connection *conn, const QString &pgsql_ver, bool use_tmp_names) { if(!model) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); fix_mode=false; valid_canceled=false; @@ -259,7 +259,7 @@ bool ModelValidationHelper::isInFixMode() void ModelValidationHelper::validateModel(void) { if(!db_model) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index ced86ddcad..75580e7b8c 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1670,10 +1670,10 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb if(obj_type!=ObjectType::ObjPermission) { if(object && obj_type!=object->getObjectType()) - throw Exception(OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the user try to call the table object form without specify a parent object else if(!parent_obj && TableObject::isTableObject(obj_type)) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(object && dynamic_cast(object)) @@ -1683,9 +1683,9 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb that can be edited only on its fill color an rectangle attributes */ if(object && object->isSystemObject() && (object->getObjectType()!=ObjectType::ObjSchema || object->getName()!="public")) - throw Exception(Exception::getErrorMessage(OprReservedObject) - .arg(object->getName()).arg(object->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) + .arg(object->getName()).arg(object->getTypeName()), + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(obj_type==ObjectType::ObjSchema) res=openEditingForm(object); @@ -1869,9 +1869,9 @@ void ModelWidget::renameObject(void) BaseObject *obj=reinterpret_cast(act->data().value()); if(obj->isSystemObject()) - throw Exception(Exception::getErrorMessage(OprReservedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) .arg(obj->getName()).arg(obj->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); ObjectRenameWidget objectrename_wgt(this); objectrename_wgt.setAttributes(obj, this->db_model, this->op_list); @@ -1970,10 +1970,10 @@ void ModelWidget::changeOwner(void) if(obj->acceptsOwner() && obj->getOwner()!=owner) { if(obj->isSystemObject()) - throw Exception(Exception::getErrorMessage(OprReservedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) .arg(obj->getName()) .arg(obj->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Register an operation only if the object is not the database itself if(obj->getObjectType()!=ObjectType::ObjDatabase) @@ -2178,9 +2178,9 @@ void ModelWidget::protectObject(void) if(tab_obj->isAddedByRelationship()) { - throw Exception(Exception::getErrorMessage(OprRelationshipAddedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::OprRelationshipAddedObject) .arg(object->getName()).arg(object->getTypeName()), - OprRelationshipAddedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::OprRelationshipAddedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -2230,9 +2230,9 @@ void ModelWidget::copyObjects(bool duplicate_mode) { //Raise an error if the user try to copy a reserved object if(selected_objects[0]->isSystemObject()) - throw Exception(Exception::getErrorMessage(OprReservedObject) - .arg(selected_objects[0]->getName()).arg(selected_objects[0]->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) + .arg(selected_objects[0]->getName()).arg(selected_objects[0]->getTypeName()), + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(!duplicate_mode) @@ -2635,8 +2635,8 @@ void ModelWidget::pasteObjects(bool duplicate_mode) if(!errors.empty()) { Messagebox msg_box; - msg_box.show(Exception(trUtf8("Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors), - QString(), + msg_box.show(Exception(trUtf8("Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details!"), + ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors), QString(), Messagebox::AlertIcon); } @@ -2902,16 +2902,16 @@ void ModelWidget::removeObjects(bool cascade) //Raises an error if the user try to remove a reserved object if(object->isSystemObject()) - throw Exception(Exception::getErrorMessage(OprReservedObject) - .arg(object->getName()).arg(object->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) + .arg(object->getName()).arg(object->getTypeName()), + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the user try to remove a protected object else if(object->isProtected()) { - throw Exception(Exception::getErrorMessage(RemProtectedObject) - .arg(object->getName(true)) - .arg(object->getTypeName()), - RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::RemProtectedObject) + .arg(object->getName(true)) + .arg(object->getTypeName()), + ErrorCode::RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -2948,11 +2948,11 @@ void ModelWidget::removeObjects(bool cascade) } catch(Exception &e) { - if(cascade && (e.getErrorType()==RemInvalidatedObjects || - e.getErrorType()==RemDirectReference || - e.getErrorType()==RemInderectReference || - e.getErrorType()==RemProtectedObject || - e.getErrorType()==OprReservedObject)) + if(cascade && (e.getErrorType()==ErrorCode::RemInvalidatedObjects || + e.getErrorType()==ErrorCode::RemDirectReference || + e.getErrorType()==ErrorCode::RemInderectReference || + e.getErrorType()==ErrorCode::RemProtectedObject || + e.getErrorType()==ErrorCode::OprReservedObject)) errors.push_back(e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); @@ -2978,11 +2978,11 @@ void ModelWidget::removeObjects(bool cascade) } catch(Exception &e) { - if(cascade && (e.getErrorType()==RemInvalidatedObjects || - e.getErrorType()==RemDirectReference || - e.getErrorType()==RemInderectReference || - e.getErrorType()==RemProtectedObject || - e.getErrorType()==OprReservedObject)) + if(cascade && (e.getErrorType()==ErrorCode::RemInvalidatedObjects || + e.getErrorType()==ErrorCode::RemDirectReference || + e.getErrorType()==ErrorCode::RemInderectReference || + e.getErrorType()==ErrorCode::RemProtectedObject || + e.getErrorType()==ErrorCode::OprReservedObject)) errors.push_back(e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); @@ -3009,7 +3009,7 @@ void ModelWidget::removeObjects(bool cascade) if(!errors.empty()) { - msg_box.show(Exception(RemInvalidatedObjects, __PRETTY_FUNCTION__,__FILE__,__LINE__, errors), + msg_box.show(Exception(ErrorCode::RemInvalidatedObjects, __PRETTY_FUNCTION__,__FILE__,__LINE__, errors), trUtf8("The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details."), Messagebox::AlertIcon); } @@ -4131,8 +4131,8 @@ void ModelWidget::convertIntegerToSerial(void) QString serial_tp; if(!col_type.isIntegerType() || (!col->getDefaultValue().contains(regexp) && !col->getSequence())) - throw Exception(Exception::getErrorMessage(InvConversionIntegerToSerial).arg(col->getName()), - InvConversionIntegerToSerial ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvConversionIntegerToSerial).arg(col->getName()), + ErrorCode::InvConversionIntegerToSerial ,__PRETTY_FUNCTION__,__FILE__,__LINE__); op_list->registerObject(col, Operation::ObjectModified, -1, tab); diff --git a/libpgmodeler_ui/src/numberedtexteditor.cpp b/libpgmodeler_ui/src/numberedtexteditor.cpp index 2ba5122fb5..0364819a16 100644 --- a/libpgmodeler_ui/src/numberedtexteditor.cpp +++ b/libpgmodeler_ui/src/numberedtexteditor.cpp @@ -342,9 +342,9 @@ void NumberedTextEditor::loadFile(void) file.setFileName(sql_file_dlg.selectedFiles().at(0)); if(!file.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) - .arg(sql_file_dlg.selectedFiles().at(0)) - ,FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed) + .arg(sql_file_dlg.selectedFiles().at(0)), + ErrorCode::FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->clear(); this->setPlainText(file.readAll()); @@ -366,9 +366,9 @@ void NumberedTextEditor::editSource(void) input.setFileName(tmp_src_file.fileName()); if(!input.open(QFile::WriteOnly | QFile::Truncate)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) - .arg(tmp_src_file.fileName()) - ,FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed) + .arg(tmp_src_file.fileName()), + ErrorCode::FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); buffer.append(this->toPlainText()); input.write(buffer); @@ -403,9 +403,9 @@ void NumberedTextEditor::updateSource(void) this->setReadOnly(false); if(!input.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) - .arg(tmp_src_file.fileName()) - ,FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed) + .arg(tmp_src_file.fileName()), + ErrorCode::FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setPlainText(input.readAll()); input.close(); diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index 142b063bf0..e444068e2e 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -54,7 +54,7 @@ void ObjectDepsRefsWidget::setAttributes(DatabaseModel *model, BaseObject *objec void ObjectDepsRefsWidget::setAttributes(ModelWidget *model_wgt, BaseObject *object, BaseObject *parent_obj) { if(!model_wgt) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->model_wgt=model_wgt; setAttributes(model_wgt->getDatabaseModel(), object, parent_obj); diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index 2dd5f22f49..47c04d1e82 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -38,12 +38,12 @@ void ObjectRenameWidget::setAttributes(BaseObject *object, DatabaseModel *model, TableObject *tab_obj=dynamic_cast(object); if(!object || !op_list) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(tab_obj && tab_obj->isAddedByRelationship()) - throw Exception(Exception::getErrorMessage(OprRelationshipAddedObject) - .arg(tab_obj->getName()) - .arg(tab_obj->getTypeName()) - ,OprRelationshipAddedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::OprRelationshipAddedObject) + .arg(tab_obj->getName()) + .arg(tab_obj->getTypeName()), + ErrorCode::OprRelationshipAddedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->adjustSize(); this->object=object; @@ -119,12 +119,12 @@ void ObjectRenameWidget::applyRenaming(void) //Raises a error if another object is found if(aux_obj && aux_obj!=object) { - throw Exception(Exception::getErrorMessage(AsgDuplicatedObject) - .arg(fmt_name) - .arg(object->getTypeName()) - .arg(parent_obj->getName(true)) - .arg(parent_obj->getTypeName()), - AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) + .arg(fmt_name) + .arg(object->getTypeName()) + .arg(parent_obj->getName(true)) + .arg(parent_obj->getTypeName()), + ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index f285151667..6c4e45bb0b 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -101,10 +101,10 @@ void ObjectsTableWidget::setButtonConfiguration(unsigned button_conf) QTableWidgetItem *ObjectsTableWidget::getItem(unsigned row_idx, unsigned col_idx) { if(row_idx >= static_cast(table_tbw->rowCount())) - throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(table_tbw->item(row_idx, col_idx)); } @@ -139,7 +139,7 @@ void ObjectsTableWidget::setHeaderLabel(const QString &label, unsigned col_idx) QTableWidgetItem *item=nullptr; if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); item=table_tbw->horizontalHeaderItem(col_idx); item->setText(label); @@ -148,7 +148,7 @@ void ObjectsTableWidget::setHeaderLabel(const QString &label, unsigned col_idx) void ObjectsTableWidget::setHeaderVisible(unsigned col_idx, bool visible) { if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); table_tbw->horizontalHeader()->setSectionHidden(col_idx, !visible); } @@ -158,7 +158,7 @@ void ObjectsTableWidget::setHeaderIcon(const QIcon &icon, unsigned col_idx) QTableWidgetItem *item=nullptr; if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); item=table_tbw->horizontalHeaderItem(col_idx); item->setIcon(icon); @@ -192,7 +192,7 @@ void ObjectsTableWidget::setRowFont(int row_idx, const QFont &font, const QColor int col_count, i; if(row_idx >= table_tbw->rowCount()) - throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); col_count=table_tbw->columnCount(); for(i=0; i < col_count; i++) @@ -209,7 +209,7 @@ void ObjectsTableWidget::setRowData(const QVariant &data, unsigned row_idx) QTableWidgetItem *item=nullptr; if(row_idx >= static_cast(table_tbw->rowCount())) - throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Gets the vertical header of the row. This header stores the whole row data. item=table_tbw->verticalHeaderItem(row_idx); @@ -231,7 +231,7 @@ QString ObjectsTableWidget::getHeaderLabel(unsigned col_idx) QTableWidgetItem *item=nullptr; if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); item=table_tbw->horizontalHeaderItem(col_idx); return(item->text()); @@ -272,7 +272,7 @@ QVariant ObjectsTableWidget::getRowData(unsigned row_idx) QTableWidgetItem *item=nullptr; if(row_idx >= static_cast(table_tbw->rowCount())) - throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); item=table_tbw->verticalHeaderItem(row_idx); return(item->data(Qt::UserRole)); @@ -369,7 +369,7 @@ void ObjectsTableWidget::removeRow(unsigned row_idx) bool conf; if(row_idx >= static_cast(table_tbw->rowCount())) - throw Exception(RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefRowObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Before remove the row, clears the selection table_tbw->clearSelection(); @@ -465,7 +465,7 @@ void ObjectsTableWidget::removeRows(void) void ObjectsTableWidget::removeColumn(unsigned col_idx) { if(col_idx >= static_cast(table_tbw->columnCount())) - throw Exception(RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefColObjectTabInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); table_tbw->removeColumn(col_idx); table_tbw->clearSelection(); diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 13c65fa738..bd162dcf67 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -169,7 +169,7 @@ void OperationListWidget::undoOperation(void) QApplication::restoreOverrideCursor(); this->updateOperationList(); - if(e.getErrorType()==UndoRedoOperationInvalidObject) + if(e.getErrorType()==ErrorCode::UndoRedoOperationInvalidObject) { Messagebox msg_box; msg_box.show(e, "", Messagebox::AlertIcon); @@ -193,7 +193,7 @@ void OperationListWidget::redoOperation(void) { QApplication::restoreOverrideCursor(); - if(e.getErrorType()==UndoRedoOperationInvalidObject) + if(e.getErrorType()==ErrorCode::UndoRedoOperationInvalidObject) { Messagebox msg_box; msg_box.show(e, "", Messagebox::AlertIcon); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 3de8db4fa9..58e3bf76ee 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -262,11 +262,11 @@ void PermissionWidget::showSelectedRoleData(void) //Raise an error if the role already exists on selected role table if(role && row_idx >= 0) { - throw Exception(Exception::getErrorMessage(AsgDuplicatedObjectContainer) - .arg(role->getName()) - .arg(role->getTypeName()) - .arg(roles_gb->title()), - InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedObjectContainer) + .arg(role->getName()) + .arg(role->getTypeName()) + .arg(roles_gb->title()), + ErrorCode::InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } @@ -326,10 +326,10 @@ void PermissionWidget::updatePermission(void) else { //Raises an error if the configured permission already exists - throw Exception(Exception::getErrorMessage(AsgDuplicatedPermission) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedPermission) .arg(permission->getObject()->getName()) .arg(permission->getObject()->getTypeName()), - AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__); } delete(perm_bkp); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 10a8c2ef70..792c9a8970 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -27,7 +27,7 @@ namespace PgModelerUiNs { QTreeWidgetItem *createOutputTreeItem(QTreeWidget *output_trw, const QString &text, const QPixmap &ico, QTreeWidgetItem *parent, bool expand_item, bool word_wrap) { if(!output_trw) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); QTreeWidgetItem *item=nullptr; @@ -64,7 +64,7 @@ namespace PgModelerUiNs { void createOutputListItem(QListWidget *output_lst, const QString &text, const QPixmap &ico, bool is_formated) { if(!output_lst) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); QListWidgetItem *item=new QListWidgetItem; @@ -97,10 +97,10 @@ namespace PgModelerUiNs { bool curr_val=object->isSQLDisabled(); if(object->isSystemObject()) - throw Exception(Exception::getErrorMessage(OprReservedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) .arg(object->getName(true)) .arg(object->getTypeName()), - OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); object->setSQLDisabled(disable); @@ -259,7 +259,7 @@ namespace PgModelerUiNs { text=QString("%1 (%2)").arg(ex.getFile()).arg(ex.getLine()); createOutputTreeItem(exceptions_trw, text, QPixmap(getIconPath("codigofonte")), item, false, true); - text=QString("%1 (%2)").arg(Exception::getErrorCode(ex.getErrorType())).arg(ex.getErrorType()); + text=QString("%1 (%2)").arg(Exception::getErrorCode(ex.getErrorType())).arg(~ex.getErrorType()); createOutputTreeItem(exceptions_trw, text, QPixmap(getIconPath("msgbox_alerta")), item, false, true); child_item=createOutputTreeItem(exceptions_trw, ex.getErrorMessage(), QPixmap(getIconPath("msgbox_erro")), item, false, true); diff --git a/libpgmodeler_ui/src/pgsqltypewidget.cpp b/libpgmodeler_ui/src/pgsqltypewidget.cpp index 5d0e539e09..d647187cdd 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.cpp +++ b/libpgmodeler_ui/src/pgsqltypewidget.cpp @@ -213,7 +213,7 @@ void PgSQLTypeWidget::setAttributes(PgSQLType type, DatabaseModel *model, unsig PgSQLType PgSQLTypeWidget::getPgSQLType(void) { if(format_txt->toPlainText() == InvalidType) - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type); } diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.cpp b/libpgmodeler_ui/src/pluginsconfigwidget.cpp index 01c29efaf6..76e0bbb34d 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.cpp +++ b/libpgmodeler_ui/src/pluginsconfigwidget.cpp @@ -133,18 +133,18 @@ void PluginsConfigWidget::loadConfiguration(void) } else { - errors.push_back(Exception(Exception::getErrorMessage(PluginNotLoaded) - .arg(dir_list.front()) - .arg(lib) - .arg(plugin_loader.errorString()), - PluginNotLoaded, __PRETTY_FUNCTION__,__FILE__,__LINE__)); + errors.push_back(Exception(Exception::getErrorMessage(ErrorCode::PluginNotLoaded) + .arg(dir_list.front()) + .arg(lib) + .arg(plugin_loader.errorString()), + ErrorCode::PluginNotLoaded, __PRETTY_FUNCTION__,__FILE__,__LINE__)); } dir_list.pop_front(); plugins_tab->clearSelection(); } if(!errors.empty()) - throw Exception(PluginsNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors); + throw Exception(ErrorCode::PluginsNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors); } void PluginsConfigWidget::installPluginsActions(QToolBar *toolbar, QMenu *menu, QObject *recv, const char *slot) diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index b1e9dd935a..5cc23518dd 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -74,7 +74,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType void PolicyWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Policy *policy) { if(!parent_obj) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, policy, parent_obj); model_objs_wgt->setModel(model); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 6fa3736592..4889107fd9 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -133,7 +133,7 @@ void ReferenceWidget::applyConfiguration(void) if(!select_from_chk->isChecked() && !from_where_chk->isChecked() && !after_where_chk->isChecked() && !end_expr_chk->isChecked() && !view_def_chk->isChecked()) - throw Exception(InvSQLScopeViewReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvSQLScopeViewReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); ref_flags = 0; diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index d3470eda97..bf28a50632 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -244,7 +244,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l bool rel1n=false, relnn=false, relgen_dep=false, use_name_patterns=false; if(!base_rel) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, base_rel); @@ -1172,7 +1172,7 @@ void RelationshipWidget::applyConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==RemInvalidatedObjects) + if(e.getErrorType()==ErrorCode::RemInvalidatedObjects) msg_box.show(e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index de5f12da44..10f0fab6ba 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -143,7 +143,7 @@ void RoleWidget::showRoleData(Role *role, unsigned table_id, unsigned row) role_types[3]={ Role::RefRole, Role::MemberRole, Role::AdminRole }; if(table_id > 3) - throw Exception(RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); members_tab[table_id]->setRowData(QVariant::fromValue(reinterpret_cast(role)), row); members_tab[table_id]->setCellText(role->getName(), row, 0); @@ -219,10 +219,10 @@ void RoleWidget::showSelectedRoleData(void) if(!members_tab[idx_tab]->getRowData(lin).value()) members_tab[idx_tab]->removeRow(lin); - msg_box.show(Exception(Exception::getErrorMessage(AsgRoleReferenceRedundancy) - .arg(obj_sel->getName()) - .arg(name_edt->text()), - AsgRoleReferenceRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__)); + msg_box.show(Exception(Exception::getErrorMessage(ErrorCode::AsgRoleReferenceRedundancy) + .arg(obj_sel->getName()) + .arg(name_edt->text()), + ErrorCode::AsgRoleReferenceRedundancy,__PRETTY_FUNCTION__,__FILE__,__LINE__)); } //If the role does not exist on table, show its data else if(obj_sel && idx_lin < 0) @@ -237,10 +237,10 @@ void RoleWidget::showSelectedRoleData(void) //Raises an error if the role already is in the table if(obj_sel && idx_lin >= 0) { - msg_box.show( Exception(Exception::getErrorMessage(InsDuplicatedRole) - .arg(obj_sel->getName()) - .arg(name_edt->text()), - InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__)); + msg_box.show( Exception(Exception::getErrorMessage(ErrorCode::InsDuplicatedRole) + .arg(obj_sel->getName()) + .arg(name_edt->text()), + ErrorCode::InsDuplicatedRole,__PRETTY_FUNCTION__,__FILE__,__LINE__)); } } } diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index 5c96baa906..36d952daa0 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -87,7 +87,7 @@ void RuleWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Bas unsigned qtd, i; if(!parent_tab) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, rule, parent_tab); diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index e55395f08a..28452505ea 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -109,8 +109,8 @@ void SourceCodeWidget::saveSQLCode(void) out.setFileName(file_dlg.selectedFiles().at(0)); if(!out.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(file_dlg.selectedFiles().at(0)), - FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(file_dlg.selectedFiles().at(0)), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf.append(sqlcode_txt->toPlainText()); out.write(buf.data(), buf.size()); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index ab8b84f4d4..b913bd7c28 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -234,7 +234,7 @@ void SQLExecutionWidget::resizeEvent(QResizeEvent *event) void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTableWidget *results_tbw, bool store_data) { if(!results_tbw) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { @@ -342,8 +342,8 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) QString("%1 %2").arg(time_str).arg(e.getErrorMessage()), QPixmap(PgModelerUiNs::getIconPath("msgbox_erro")), false); - if(e.getErrorType()==ConnectionTimeout || - e.getErrorType()==ConnectionBroken) + if(e.getErrorType()==ErrorCode::ConnectionTimeout || + e.getErrorType()==ErrorCode::ConnectionBroken) { PgModelerUiNs::createOutputListItem(msgoutput_lst, QString("%1 %2").arg(time_str).arg(trUtf8("No results retrieved or changes done due to the error above! Run the command again.")), @@ -573,8 +573,8 @@ void SQLExecutionWidget::saveCommands(void) file.setFileName(filename); if(!file.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(filename), - FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(filename), + ErrorCode::FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); file.write(sql_cmd_txt->toPlainText().toUtf8()); file.close(); @@ -596,9 +596,9 @@ void SQLExecutionWidget::loadCommands(void) file.setFileName(sql_file_dlg.selectedFiles().at(0)); if(!file.open(QFile::ReadOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) - .arg(sql_file_dlg.selectedFiles().at(0)) - ,FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed) + .arg(sql_file_dlg.selectedFiles().at(0)), + ErrorCode::FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); sql_cmd_txt->clear(); sql_cmd_txt->setPlainText(file.readAll()); @@ -612,7 +612,7 @@ void SQLExecutionWidget::loadCommands(void) void SQLExecutionWidget::exportResults(QTableView *results_tbw) { if(!results_tbw) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); QFileDialog csv_file_dlg; @@ -631,9 +631,9 @@ void SQLExecutionWidget::exportResults(QTableView *results_tbw) file.setFileName(csv_file_dlg.selectedFiles().at(0)); if(!file.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed) - .arg(csv_file_dlg.selectedFiles().at(0)) - , FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed) + .arg(csv_file_dlg.selectedFiles().at(0)), + ErrorCode::FileDirectoryNotAccessed ,__PRETTY_FUNCTION__,__FILE__,__LINE__); QApplication::setOverrideCursor(Qt::WaitCursor); results_tbw->setUpdatesEnabled(false); @@ -685,7 +685,7 @@ QByteArray SQLExecutionWidget::generateTextBuffer(QTableView *results_tbw) QByteArray SQLExecutionWidget::generateBuffer(QTableView *results_tbw, QChar separator, bool incl_col_names, bool use_quotes) { if(!results_tbw) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!results_tbw->selectionModel()) return (QByteArray()); @@ -739,7 +739,7 @@ QByteArray SQLExecutionWidget::generateBuffer(QTableView *results_tbw, QChar sep void SQLExecutionWidget::copySelection(QTableView *results_tbw, bool use_popup, bool csv_is_default) { if(!results_tbw) - throw Exception(OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject ,__PRETTY_FUNCTION__,__FILE__,__LINE__); QItemSelectionModel *selection = results_tbw->selectionModel(); @@ -858,8 +858,8 @@ void SQLExecutionWidget::saveSQLHistory(void) GlobalAttributes::ConfigurationExt); if(!file.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(file.fileName()), - FileDirectoryNotAccessed, __PRETTY_FUNCTION__, __FILE__ ,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(file.fileName()), + ErrorCode::FileDirectoryNotAccessed, __PRETTY_FUNCTION__, __FILE__ ,__LINE__); file.write(buffer); file.close(); diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index f0930e12f1..33843331f3 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -183,11 +183,11 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) *graph_dst_obj=dynamic_cast(dst_obj); if(!src_obj && !dst_obj) - throw Exception(OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raise an exception if the user try to swap an id of relationship by other object of different kind else if((src_obj->getObjectType()==ObjectType::ObjRelationship || dst_obj->getObjectType()==ObjectType::ObjRelationship) && (src_obj->getObjectType() != dst_obj->getObjectType())) - throw Exception(InvRelationshipIdSwap,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::InvRelationshipIdSwap,__PRETTY_FUNCTION__,__FILE__,__LINE__); try { diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index e10f1db6f6..1d809a7e92 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -24,7 +24,7 @@ QFont SyntaxHighlighter::default_font=QFont(QString("Source Code Pro"), 10); SyntaxHighlighter::SyntaxHighlighter(QPlainTextEdit *parent, bool single_line_mode, bool use_custom_tab_width) : QSyntaxHighlighter(parent) { if(!parent) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setDocument(parent->document()); this->single_line_mode=single_line_mode; @@ -439,15 +439,15 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) //Raises an error if the group was declared before if(find(groups_order.begin(), groups_order.end(), group)!=groups_order.end()) { - throw Exception(Exception::getErrorMessage(InvRedeclarationGroup).arg(group), - InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvRedeclarationGroup).arg(group), + ErrorCode::InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group is being declared and build at the declaration statment (not permitted) else if(attribs.size() > 1 || xmlparser.hasElement(XmlParser::ChildElement)) { - throw Exception(Exception::getErrorMessage(InvGroupDeclaration) - .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), - InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvGroupDeclaration) + .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), + ErrorCode::InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } groups_order.push_back(group); @@ -458,21 +458,21 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) //Raises an error if the group is being constructed by a second time if(initial_exprs.count(group)!=0) { - throw Exception(Exception::getErrorMessage(DefDuplicatedGroup).arg(group), - DefDuplicatedGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::DefDuplicatedGroup).arg(group), + ErrorCode::DefDuplicatedGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group is being constructed without being declared else if(find(groups_order.begin(), groups_order.end(), group)==groups_order.end()) { - throw Exception(Exception::getErrorMessage(DefNotDeclaredGroup) - .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), - DefNotDeclaredGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::DefNotDeclaredGroup) + .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), + ErrorCode::DefNotDeclaredGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group does not have children element else if(!xmlparser.hasElement(XmlParser::ChildElement)) { - throw Exception(Exception::getErrorMessage(DefEmptyGroup).arg(group), - DefEmptyGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::DefEmptyGroup).arg(group), + ErrorCode::DefEmptyGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } chr_sensitive=(attribs[ParsersAttributes::CASE_SENSITIVE]==ParsersAttributes::_TRUE_); @@ -568,8 +568,8 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) if(initial_exprs[group].size()==0) { //Raises an error if the group was declared but not constructed - throw Exception(Exception::getErrorMessage(InvGroupDeclarationNotDefined).arg(group), - InvGroupDeclarationNotDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::InvGroupDeclarationNotDefined).arg(group), + ErrorCode::InvGroupDeclarationNotDefined,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index bc1fdc32fe..87692e7c8a 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -494,9 +494,9 @@ QString TableDataWidget::generateDataBuffer(void) if((value.startsWith(PgModelerNs::UnescValueStart) && value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd)) || (value.startsWith(PgModelerNs::UnescValueStart) && !value.endsWith(PgModelerNs::UnescValueEnd)) || (!value.startsWith(PgModelerNs::UnescValueStart) && !value.endsWith(QString("\\") + PgModelerNs::UnescValueEnd) && value.endsWith(PgModelerNs::UnescValueEnd))) - throw Exception(Exception::getErrorMessage(MalformedUnescapedValue) - .arg(row + 1).arg(col_names[col]), - MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::MalformedUnescapedValue) + .arg(row + 1).arg(col_names[col]), + ErrorCode::MalformedUnescapedValue,__PRETTY_FUNCTION__,__FILE__,__LINE__); val_list.push_back(value); } diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 8789b75546..c311a0520d 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -635,10 +635,10 @@ void TableWidget::removeObjects(void) table->removeObject(object); } else - throw Exception(Exception::getErrorMessage(RemProtectedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::RemProtectedObject) .arg(object->getName()) .arg(object->getTypeName()), - RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } if(obj_type == ObjectType::ObjConstraint) @@ -688,10 +688,10 @@ void TableWidget::removeObject(int row) table->setModified(true); } else - throw Exception(Exception::getErrorMessage(RemProtectedObject) + throw Exception(Exception::getErrorMessage(ErrorCode::RemProtectedObject) .arg(object->getName()) .arg(object->getTypeName()), - RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(obj_type == ObjectType::ObjConstraint) listObjects(ObjectType::ObjColumn); @@ -911,7 +911,7 @@ void TableWidget::applyConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==RemInvalidatedObjects) + if(e.getErrorType()==ErrorCode::RemInvalidatedObjects) msg_box.show(e); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index 472b1ac2a8..68931d1b6f 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -221,7 +221,7 @@ void TriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Column *column=nullptr; if(!parent_table) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, trigger, parent_table); ref_table_sel->setModel(model); diff --git a/libpgmodeler_ui/src/validationinfo.cpp b/libpgmodeler_ui/src/validationinfo.cpp index 82081fe1fb..dbca650ef4 100644 --- a/libpgmodeler_ui/src/validationinfo.cpp +++ b/libpgmodeler_ui/src/validationinfo.cpp @@ -27,10 +27,10 @@ ValidationInfo::ValidationInfo(void) ValidationInfo::ValidationInfo(unsigned val_type, BaseObject *object, vector references) { if(val_type >= SqlValidationError) - throw Exception(AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if((val_type==NoUniqueName || val_type==BrokenReference) && (!object || references.empty())) - throw Exception(AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->val_type=val_type; this->object=object; diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 363e4255f6..b05c29e1d5 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -31,10 +31,12 @@ #include #include #include +#include using namespace std; -enum ErrorCode { +//! \brief This enum defines the global error codes used throughout the application +enum class ErrorCode { Custom, AsgPseudoTypeColumn, AsgInvalidPrecision, @@ -278,6 +280,12 @@ enum ErrorCode { RemColumnRefByPartitionKey }; +//! \brief This unary operator overloading causes the provided enum to be converted to its underlying datatype +constexpr std::underlying_type::type operator ~ (ErrorCode err_code) noexcept +{ + return(static_cast::type>(err_code)); +} + class Exception { private: static constexpr int ErrorCount=241; diff --git a/main-cli/src/main.cpp b/main-cli/src/main.cpp index 5bf8990e0b..20c21c46d7 100644 --- a/main-cli/src/main.cpp +++ b/main-cli/src/main.cpp @@ -49,7 +49,7 @@ int main(int argc, char **argv) out << endl; out << e.getExceptionsText(); out << QString("** pgmodeler-cli aborted due to critical error(s). **") << endl << endl; - return(e.getErrorType()==Custom ? -1 : e.getErrorType()); + return(e.getErrorType()==ErrorCode::Custom ? -1 : ~e.getErrorType()); } #endif } diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 9461a9aa02..2c92a3457c 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -122,13 +122,13 @@ PgModelerCli::PgModelerCli(int argc, char **argv) : QApplication(argc, argv) //Raises an error if the option is not recognized if(!isOptionRecognized(op, accepts_val)) - throw Exception(trUtf8("Unrecognized option '%1'.").arg(op), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Unrecognized option '%1'.").arg(op), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the value is empty and the option accepts a value if(accepts_val && value.isEmpty()) - throw Exception(trUtf8("Value not specified for option '%1'.").arg(op), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Value not specified for option '%1'.").arg(op), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!accepts_val && !value.isEmpty()) - throw Exception(trUtf8("Option '%1' does not accept values.").arg(op), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Option '%1' does not accept values.").arg(op), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); opts[op]=value; } @@ -218,7 +218,7 @@ void PgModelerCli::configureConnection(bool extra_conn) { if(!connections.count(parsed_opts[ConnAlias + chr])) throw Exception(trUtf8("Connection aliased as '%1' was not found in the configuration file.").arg(parsed_opts[ConnAlias + chr]), - Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Make a copy of the named connection *conn = (*connections[parsed_opts[ConnAlias + chr]]); @@ -510,54 +510,54 @@ void PgModelerCli::parseOptions(attribs_map &opts) zoom=opts[ZoomFactor].toDouble()/static_cast(100); if(other_modes_cnt==0 && mode_cnt==0) - throw Exception(trUtf8("No operation mode was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No operation mode was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if((mode_cnt > 0 && (fix_model || upd_mime || import_db || diff)) || (mode_cnt==0 && other_modes_cnt > 1)) - throw Exception(trUtf8("Export, fix model, import database, diff and update mime operations can't be used at the same time!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Export, fix model, import database, diff and update mime operations can't be used at the same time!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!fix_model && !upd_mime && mode_cnt > 1) - throw Exception(trUtf8("Multiple export mode was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Multiple export mode was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!upd_mime && !import_db && !diff && opts[Input].isEmpty()) - throw Exception(trUtf8("No input file was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No input file was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(import_db && opts[InputDb].isEmpty()) - throw Exception(trUtf8("No input database was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No input database was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts.count(ExportToDbms) && !upd_mime && !diff && opts[Output].isEmpty()) - throw Exception(trUtf8("No output file was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No output file was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts.count(ExportToDbms) && !upd_mime && !import_db && !opts[Input].isEmpty() && !opts[Output].isEmpty() && QFileInfo(opts[Input]).absoluteFilePath() == QFileInfo(opts[Output]).absoluteFilePath()) - throw Exception(trUtf8("Input file must be different from output!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Input file must be different from output!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opts.count(ExportToDbms) && !opts.count(ConnAlias) && (!opts.count(Host) || !opts.count(User) || !opts.count(Passwd) || !opts.count(InitialDb)) ) - throw Exception(trUtf8("Incomplete connection information!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Incomplete connection information!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opts.count(ExportToPng) && (zoom < ModelWidget::MinimumZoom || zoom > ModelWidget::MaximumZoom)) - throw Exception(trUtf8("Invalid zoom specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Invalid zoom specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(upd_mime && opts[DbmMimeType]!=Install && opts[DbmMimeType]!=Uninstall) - throw Exception(trUtf8("Invalid action specified to update mime option!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Invalid action specified to update mime option!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opts.count(Diff)) { if(opts[Input].isEmpty() && opts[InputDb].isEmpty()) - throw Exception(trUtf8("No input file or database was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No input file or database was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts[Input].isEmpty() && !opts[InputDb].isEmpty()) - throw Exception(trUtf8("The input file and database can't be used at the same time!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("The input file and database can't be used at the same time!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts.count(CompareTo)) - throw Exception(trUtf8("No database to be compared was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No database to be compared was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!opts.count(SaveDiff) && !opts.count(ApplyDiff)) - throw Exception(trUtf8("No diff action (save or apply) was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No diff action (save or apply) was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(opts.count(SaveDiff) && opts[Output].isEmpty()) - throw Exception(trUtf8("No output file for the diff code was specified!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("No output file for the diff code was specified!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Converting input and output files to absolute paths to avoid that they are read/written on the app's working dir @@ -695,8 +695,8 @@ void PgModelerCli::extractObjectXML(void) input.open(QFile::ReadOnly); if(!input.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(parsed_opts[Input]), - FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(parsed_opts[Input]), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); buf.append(input.readAll()); input.close(); @@ -705,7 +705,7 @@ void PgModelerCli::extractObjectXML(void) start=regexp.indexIn(buf); if(start < 0) - throw Exception(trUtf8("Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted!"), Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { //Remove the header entry from buffer @@ -1368,8 +1368,8 @@ void PgModelerCli::diffModelDatabase(void) output.setFileName(parsed_opts[Output]); if(!output.open(QFile::WriteOnly)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(parsed_opts[Output]), - FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(parsed_opts[Output]), + ErrorCode::FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__); output.write(diff_hlp.getDiffDefinition().toUtf8()); output.close(); } @@ -1550,11 +1550,11 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) //When installing, check if the necessary file exists. If exists, raises an error and abort. if(!uninstall && (QFileInfo(files[0]).exists() || QFileInfo(files[1]).exists())) { - throw Exception(msg_file_associated, Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg_file_associated, ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(uninstall && (!QFileInfo(files[0]).exists() && !QFileInfo(files[1]).exists())) { - throw Exception(msg_no_association, Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg_no_association, ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!uninstall) { @@ -1575,7 +1575,7 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) { if(!QFile(files[i]).remove()) throw Exception(trUtf8("Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists.").arg(files[i]), - Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else { @@ -1587,8 +1587,8 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) out.open(QFile::WriteOnly); if(!out.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(files[i]), - FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(files[i]), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); out.write(buf.data(), buf.size()); out.close(); @@ -1612,8 +1612,8 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) out.open(QFile::ReadOnly); if(!out.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(mimeapps), - FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(mimeapps), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Opens the mimeapps.list to add a entry linking pgModeler to .dbm files buf=out.readAll(); diff --git a/main/src/application.cpp b/main/src/application.cpp index bd459bc1e9..fc49c9c761 100644 --- a/main/src/application.cpp +++ b/main/src/application.cpp @@ -50,8 +50,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) if(!dir.mkdir(GlobalAttributes::TemporaryDir)) { Messagebox msg; - msg.show(Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(GlobalAttributes::TemporaryDir), - FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__)); + msg.show(Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(GlobalAttributes::TemporaryDir), + ErrorCode::FileDirectoryNotWritten, __PRETTY_FUNCTION__,__FILE__,__LINE__)); } } @@ -116,8 +116,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) if(!ui_style.isOpen()) { Messagebox msg; - msg.show(Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(ui_style.fileName()), - FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__)); + msg.show(Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(ui_style.fileName()), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__)); } else this->setStyleSheet(ui_style.readAll()); @@ -168,7 +168,7 @@ void Application::copyFilesRecursively(const QString &src_path, const QString &d QFileInfo src_file(src_path); if(!src_file.exists()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(src_path), + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(src_path), __PRETTY_FUNCTION__,__FILE__,__LINE__); if(src_file.isDir()) @@ -179,7 +179,7 @@ void Application::copyFilesRecursively(const QString &src_path, const QString &d src_dir(src_path); if(!dst_dir.exists() && !dst_dir.mkpath(dst_path)) - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(dst_path), + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(dst_path), __PRETTY_FUNCTION__,__FILE__,__LINE__); filenames = src_dir.entryList({QString("*%1").arg(GlobalAttributes::ConfigurationExt)}, @@ -198,7 +198,7 @@ void Application::copyFilesRecursively(const QString &src_path, const QString &d } else if(!QFile::exists(dst_path) && !QFile::copy(src_path, dst_path)) { - throw Exception(Exception::getErrorMessage(FileDirectoryNotWritten).arg(dst_path), + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(dst_path), __PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/main/src/main.cpp b/main/src/main.cpp index d26f72ec9d..2642d6ebd4 100644 --- a/main/src/main.cpp +++ b/main/src/main.cpp @@ -150,6 +150,6 @@ int main(int argc, char **argv) { QTextStream ts(stdout); ts << e.getExceptionsText(); - return(e.getErrorType()); + return(~e.getErrorType()); } } diff --git a/plugins/xml2object/src/xml2object.cpp b/plugins/xml2object/src/xml2object.cpp index f9c2a5d298..31495c1382 100644 --- a/plugins/xml2object/src/xml2object.cpp +++ b/plugins/xml2object/src/xml2object.cpp @@ -61,7 +61,7 @@ void Xml2Object::showPluginInfo(void) void Xml2Object::executePlugin(ModelWidget *model) { if(!model) - throw Exception(trUtf8("This plugin must be executed with at least one model opened!"),Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(trUtf8("This plugin must be executed with at least one model opened!"),ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); xml2obj_wgt.show(model->getDatabaseModel(), model->getOperationList()); } diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index 02a55b4ddf..aa74bcc516 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -34,8 +34,8 @@ void Xml2ObjectWidget::loadXML(void) f.open(QFile::ReadOnly); if(!f.isOpen()) - throw Exception(Exception::getErrorMessage(FileDirectoryNotAccessed).arg(file_dlg.selectedFiles().at(0)), - FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(file_dlg.selectedFiles().at(0)), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); code_txt->setPlainText(QString::fromUtf8(f.readAll())); diff --git a/tests/src/partrelationshiptest/partrelationshiptest.cpp b/tests/src/partrelationshiptest/partrelationshiptest.cpp index c2533c1671..268ded8e53 100644 --- a/tests/src/partrelationshiptest/partrelationshiptest.cpp +++ b/tests/src/partrelationshiptest/partrelationshiptest.cpp @@ -162,7 +162,7 @@ void PartRelationhipTest::connRelTablePartionHasMoreColsThanPartitionedTableShou } catch(Exception &e) { - QVERIFY(e.getErrorType() == InvColumnCountPartRel); + QVERIFY(e.getErrorType() == ErrorCode::InvColumnCountPartRel); } } @@ -209,7 +209,7 @@ void PartRelationhipTest::connRelTablePartionHasDifferentColsThanPartitionedTabl } catch(Exception &e) { - QVERIFY(e.getErrorType() == InvColumnCountPartRel); + QVERIFY(e.getErrorType() == ErrorCode::InvColumnCountPartRel); } } From 843b442273d0dd44e9f660aaf383010aa8aa2174 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 15:45:10 -0300 Subject: [PATCH 174/425] Additional refactorings to make ObjectType a scoped enum --- libpgconnector/src/catalog.cpp | 6 +-- libpgmodeler/src/baseobject.cpp | 10 ++--- libpgmodeler/src/baseobject.h | 8 +++- libpgmodeler/src/databasemodel.cpp | 42 +++++++++---------- libpgmodeler/src/table.cpp | 2 +- .../src/databaseexplorerwidget.cpp | 12 +++--- libpgmodeler_ui/src/databaseimportform.cpp | 12 +++--- libpgmodeler_ui/src/datamanipulationform.cpp | 14 +++---- libpgmodeler_ui/src/mainwindow.cpp | 8 ++-- libpgmodeler_ui/src/modelobjectswidget.cpp | 16 +++---- libpgmodeler_ui/src/modelwidget.cpp | 22 +++++----- libpgmodeler_ui/src/objectfinderwidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 10 ++--- libpgmodeler_ui/src/taskprogresswidget.cpp | 2 +- libutils/src/exception.h | 2 +- main-cli/src/main.cpp | 2 +- 17 files changed, 89 insertions(+), 83 deletions(-) diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index e4555ad228..8f321096e7 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -379,7 +379,7 @@ vector Catalog::getObjectsNames(vector obj_types, const { //Injecting the object type integer code in order to sort the final result sql.replace(sql.indexOf(select_kw), select_kw.size(), - QString("%1 %2 AS object_type, ").arg(select_kw).arg(obj_type)); + QString("%1 %2 AS object_type, ").arg(select_kw).arg(~obj_type)); sql+=QChar('\n'); queries.push_back(sql); @@ -431,7 +431,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, /* Insert the object type as an attribute of the query result to facilitate the import process on the classes that uses the Catalog */ - obj_attribs[ParsersAttributes::OBJECT_TYPE]=QString("%1").arg(obj_type); + obj_attribs[ParsersAttributes::OBJECT_TYPE]=QString("%1").arg(~obj_type); return(obj_attribs); } @@ -458,7 +458,7 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ /* Insert the object type as an attribute of the query result to facilitate the import process on the classes that uses the Catalog */ - tuple[ParsersAttributes::OBJECT_TYPE]=QString("%1").arg(obj_type); + tuple[ParsersAttributes::OBJECT_TYPE]=QString("%1").arg(~obj_type); obj_attribs.push_back(tuple); tuple.clear(); diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index fdddd37bc2..52635dac66 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -109,7 +109,7 @@ QString BaseObject::getTypeName(ObjectType obj_type) /* Due to the class BaseObject not be derived from QObject the function tr() is inefficient to translate the type names thus the method called to do the translation is from the application specifying the context (BaseObject) in the ts file and the text to be translated */ - return(QApplication::translate("BaseObject",obj_type_names[obj_type].toStdString().c_str(),"", -1)); + return(QApplication::translate("BaseObject",obj_type_names[~obj_type].toStdString().c_str(),"", -1)); else return(QString()); } @@ -137,12 +137,12 @@ ObjectType BaseObject::getObjectType(const QString &type_name) QString BaseObject::getSchemaName(ObjectType obj_type) { - return(objs_schemas[obj_type]); + return(objs_schemas[~obj_type]); } QString BaseObject::getSQLName(ObjectType obj_type) { - return(objs_sql[obj_type]); + return(objs_sql[~obj_type]); } QString BaseObject::formatName(const QString &name, bool is_operator) @@ -684,7 +684,7 @@ void BaseObject::setBasicAttributes(bool format_name) attributes[ParsersAttributes::SIGNATURE]=this->getSignature(format_name); if(attributes[ParsersAttributes::SQL_OBJECT].isEmpty()) - attributes[ParsersAttributes::SQL_OBJECT]=objs_sql[this->obj_type]; + attributes[ParsersAttributes::SQL_OBJECT]=objs_sql[~this->obj_type]; } QString BaseObject::__getCodeDefinition(unsigned def_type) @@ -821,7 +821,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) try { - code_def+=schparser.getCodeDefinition(objs_schemas[obj_type], attributes, def_type); + code_def+=schparser.getCodeDefinition(objs_schemas[~obj_type], attributes, def_type); //Internally disabling the SQL definition if(sql_disabled && def_type==SchemaParser::SqlDefinition) diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 219ed8f60b..c98e027535 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -36,7 +36,7 @@ #include #include -enum ObjectType { +enum class ObjectType: unsigned { ObjColumn, ObjConstraint, ObjFunction, @@ -75,6 +75,12 @@ enum ObjectType { ObjBaseTable }; +//! \brief This unary operator overloading causes the provided ObjectType enum to be converted to its underlying datatype +constexpr std::underlying_type::type operator ~ (ObjectType obj_type) noexcept +{ + return(static_cast::type>(obj_type)); +} + class BaseObject { private: //! \brief Current PostgreSQL version used in SQL code generation diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index a1cecf8e32..5b55c8b5f2 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -375,7 +375,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) throw Exception(trUtf8("The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2'") .arg(GlobalAttributes::MaxObjectCount) .arg(BaseObject::getTypeName(obj_type)), - ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); #endif @@ -3070,7 +3070,7 @@ void DatabaseModel::loadModel(const QString &filename) trUtf8("Loading: `%1' (%2)") .arg(object->getName()) .arg(object->getTypeName()), - obj_type); + ~obj_type); } xmlparser.restorePosition(); @@ -3114,7 +3114,7 @@ void DatabaseModel::loadModel(const QString &filename) //If there are relationship make a relationship validation to recreate any special object left behind if(!relationships.empty()) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjectType::ObjRelationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::ObjRelationship); storeSpecialObjectsXML(); disconnectRelationships(); validateRelationships(); @@ -3122,13 +3122,13 @@ void DatabaseModel::loadModel(const QString &filename) this->setInvalidated(false); - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjectType::ObjRelationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::ObjRelationship); this->setObjectsModified({ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship}); //Doing another relationship validation when there are inheritances to avoid incomplete tables if(found_inh_rel) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ObjectType::ObjRelationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::ObjRelationship); validateRelationships(); updateTablesFKRelationships(); } @@ -4380,7 +4380,7 @@ Operator *DatabaseModel::createOperator(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[ObjectType::ObjOperator]) + if(elem==objs_schemas[~ObjectType::ObjOperator]) { xmlparser.getElementAttributes(attribs); oper_aux=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOperator); @@ -4472,7 +4472,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[ObjectType::ObjOpFamily]) + if(elem==objs_schemas[~ObjectType::ObjOpFamily]) { xmlparser.getElementAttributes(attribs); object=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOpFamily); @@ -4686,14 +4686,14 @@ Table *DatabaseModel::createTable(void) xmlparser.savePosition(); object=nullptr; - if(elem==BaseObject::objs_schemas[ObjectType::ObjColumn]) + if(elem==BaseObject::objs_schemas[~ObjectType::ObjColumn]) object=createColumn(); - else if(elem==BaseObject::objs_schemas[ObjectType::ObjConstraint]) + else if(elem==BaseObject::objs_schemas[~ObjectType::ObjConstraint]) object=createConstraint(table); - else if(elem==BaseObject::objs_schemas[ObjectType::ObjTag]) + else if(elem==BaseObject::objs_schemas[~ObjectType::ObjTag]) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjectType::ObjTag); + tag=getObject(aux_attribs[ParsersAttributes::NAME], ObjectType::ObjTag); if(!tag) { @@ -6913,7 +6913,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) msg.arg(def_type_str) .arg(object->getName()) .arg(object->getTypeName()), - object->getObjectType()); + ~object->getObjectType()); } } @@ -9608,7 +9608,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving object `%1' (%2)") - .arg(object->getName()).arg(object->getTypeName()), obj_type); + .arg(object->getName()).arg(object->getTypeName()), ~obj_type); objs_def+=object->getCodeDefinition(SchemaParser::XmlDefinition); continue; @@ -9774,7 +9774,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving metadata of the object `%1' (%2)") - .arg(object->getSignature()).arg(object->getTypeName()), obj_type); + .arg(object->getSignature()).arg(object->getTypeName()), ~obj_type); schparser.ignoreUnkownAttributes(true); objs_def+=schparser.convertCharsToXMLEntities( @@ -9797,10 +9797,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option ParsersAttributes::METADATA + GlobalAttributes::SchemaExt, attribs)); output.write(buf.data(),buf.size()); - emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ObjectType::ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ~ObjectType::ObjBaseObject); } else - emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), ObjectType::ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), ~ObjectType::ObjBaseObject); output.close(); } @@ -9883,13 +9883,13 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(getObjectIndex(new_object->getName(), obj_type) < 0) { emit s_objectLoaded(progress, trUtf8("Creating object `%1' (%2)") - .arg(new_object->getName()).arg(new_object->getTypeName()), obj_type); + .arg(new_object->getName()).arg(new_object->getTypeName()), ~obj_type); addObject(new_object); } else { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) already exists. Ignoring.") - .arg(new_object->getName()).arg(new_object->getTypeName()), ObjectType::ObjBaseObject); + .arg(new_object->getName()).arg(new_object->getTypeName()), ~ObjectType::ObjBaseObject); delete(new_object); } @@ -9955,7 +9955,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(object) { emit s_objectLoaded(progress, trUtf8("Loading metadata for object `%1' (%2)") - .arg(object->getName()).arg(object->getTypeName()), obj_type); + .arg(object->getName()).arg(object->getTypeName()), ~obj_type); if(!object->isSystemObject() && ((!attribs[ParsersAttributes::PROTECTED].isEmpty() && load_objs_prot) || @@ -10084,7 +10084,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else if(!object) { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) not found. Ignoring metadata.") - .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), ObjectType::ObjBaseObject); + .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), ~ObjectType::ObjBaseObject); } xmlparser.restorePosition(); @@ -10095,7 +10095,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option while(xmlparser.accessElement(XmlParser::NextElement)); } - emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ObjectType::ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ~ObjectType::ObjBaseObject); setObjectsModified(); } catch(Exception &e) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 49f22acb1c..6edc1ee3a8 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -367,7 +367,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) throw Exception(trUtf8("In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2'") .arg(GlobalAttributes::MaxObjectCount) .arg(BaseObject::getTypeName(obj_type)), - ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); #endif diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 820b1d398f..09141a73bb 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -962,7 +962,7 @@ void DatabaseExplorerWidget::listObjects(void) root->setText(0, connection.getConnectionId(true)); root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("server"))); root->setData(DatabaseImportForm::ObjectId, Qt::UserRole, -1); - root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, ObjectType::ObjBaseObject); + root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, ~ObjectType::ObjBaseObject); root->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); root->addChild(curr_root); objects_trw->addTopLevelItem(root); @@ -1066,7 +1066,7 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) { openDataGrid(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), item->text(0), - item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()!=ObjectType::ObjView); + item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt() != ~ObjectType::ObjView); } else if(exec_action) handleSelectedSnippet(exec_action->text()); @@ -1201,7 +1201,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) try { - if(item && static_cast(item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()) > 0) + if(item && item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt() > 0) { ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); QString msg; @@ -1325,7 +1325,7 @@ void DatabaseExplorerWidget::truncateTable(QTreeWidgetItem *item, bool cascade) { try { - if(item && static_cast(item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()) > 0) + if(item && item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt() > 0) { QString obj_name, sch_name; obj_name=item->data(DatabaseImportForm::ObjectName, Qt::UserRole).toString(); @@ -1346,7 +1346,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) { QTreeWidgetItem *root=nullptr, *parent=nullptr, *aux_item=nullptr; ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); - unsigned obj_id=static_cast(item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()); + unsigned obj_id=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); QString sch_name, tab_name; vector gen_items; @@ -1668,7 +1668,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) void DatabaseExplorerWidget::startObjectRename(QTreeWidgetItem *item) { - if(item && static_cast(item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt()) > 0) + if(item && item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt() > 0) { ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 8e56304334..9355defd73 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -643,7 +643,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { task_prog_wgt.setWindowTitle(trUtf8("Retrieving objects from database...")); task_prog_wgt.show(); - task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), ObjectType::ObjDatabase); + task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), ~ObjectType::ObjDatabase); } tree_wgt->clear(); @@ -661,7 +661,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW attribs=catalog.getObjectsAttributes(ObjectType::ObjDatabase, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(ParsersAttributes::OID).toUInt()); - db_item->setData(ObjectTypeId, Qt::UserRole, ObjectType::ObjDatabase); + db_item->setData(ObjectTypeId, Qt::UserRole, ~ObjectType::ObjDatabase); db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(ParsersAttributes::OID))); tree_wgt->addTopLevelItem(db_item); @@ -690,7 +690,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW while(!sch_items.empty()) { - task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), ObjectType::ObjSchema); + task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), ~ObjectType::ObjSchema); //Retrieving and listing the schema scoped objects tab_items=DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, @@ -704,7 +704,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW if(aux_prog > 99) aux_prog=99; obj_type = static_cast(tab_items.back()->data(ObjectTypeId, Qt::UserRole).toUInt()); - task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of `%1' (%2)...").arg(tab_items.back()->text(0)).arg(BaseObject::getTypeName(obj_type)), obj_type); + task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of `%1' (%2)...").arg(tab_items.back()->text(0)).arg(BaseObject::getTypeName(obj_type)), ~obj_type); DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, BaseObject::getChildObjectTypes(obj_type), checkable_items, disable_empty_grps, tab_items.back(), sch_items.back()->text(0), tab_items.back()->text(0)); @@ -774,7 +774,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe //Group items does contains a zero valued id to indicate that is not a valide object group->setData(ObjectId, Qt::UserRole, 0); - group->setData(ObjectTypeId, Qt::UserRole, grp_type); + group->setData(ObjectTypeId, Qt::UserRole, ~grp_type); group->setData(ObjectCount, Qt::UserRole, 0); group->setData(ObjectSchema, Qt::UserRole, schema); group->setData(ObjectTable, Qt::UserRole, table); @@ -855,7 +855,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setToolTip(0,tooltip.arg(oid)); //Stores the object's type as the second data of the item - item->setData(ObjectTypeId, Qt::UserRole, obj_type); + item->setData(ObjectTypeId, Qt::UserRole, ~obj_type); //Stores the schema and the table's name of the object item->setData(ObjectSchema, Qt::UserRole, schema); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 888d0bb55f..569a0a3b3e 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -388,12 +388,12 @@ void DataManipulationForm::retrieveData(void) clearChangedRows(); //If the table is empty automatically creates a new row - if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()==ObjectType::ObjTable) + if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()== ~ObjectType::ObjTable) addRow(); else results_tbw->setFocus(); - if(table_cmb->currentData(Qt::UserRole).toUInt()==ObjectType::ObjTable) + if(table_cmb->currentData(Qt::UserRole).toUInt()== ~ObjectType::ObjTable) csv_load_tb->setEnabled(!col_names.isEmpty()); else { @@ -407,10 +407,10 @@ void DataManipulationForm::retrieveData(void) QApplication::restoreOverrideCursor(); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == ObjectType::ObjTable && + table_cmb->currentData().toUInt() == ~ObjectType::ObjTable && !col_names.isEmpty()); - truncate_tb->setEnabled(table_cmb->currentData().toUInt() == ObjectType::ObjTable && + truncate_tb->setEnabled(table_cmb->currentData().toUInt() == ~ObjectType::ObjTable && res.getTupleCount() > 0 && !col_names.isEmpty()); @@ -476,7 +476,7 @@ void DataManipulationForm::enableRowControlButtons(void) duplicate_tb->setEnabled(cols_selected); copy_tb->setEnabled(sel_ranges.count() != 0); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == ObjectType::ObjTable && + table_cmb->currentData().toUInt() == ~ObjectType::ObjTable && !col_names.isEmpty()); browse_tabs_tb->setEnabled((!fk_infos.empty() || !ref_fk_infos.empty()) && sel_ranges.count() == 1 && sel_ranges.at(0).rowCount() == 1); bulkedit_tb->setEnabled(sel_ranges.count() != 0); @@ -690,7 +690,7 @@ void DataManipulationForm::listObjects(QComboBox *combo, vector obj_ for(; idx < count; idx++) { combo->setItemIcon(idx, QPixmap(PgModelerUiNs::getIconPath(obj_type))); - combo->setItemData(idx, obj_type); + combo->setItemData(idx, ~obj_type); } idx=count; @@ -1259,7 +1259,7 @@ void DataManipulationForm::saveChanges(void) Messagebox msg_box; msg_box.show(trUtf8("Warning"), trUtf8("You're running a demonstration version! The save feature of the data manipulation form is available only in the full version!"), - Messagebox::ALERT_ICON, Messagebox::OK_BUTTON); + Messagebox::AlertIcon, Messagebox::OkButton); #else int row=0; Connection conn=Connection(tmpl_conn_params); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 7903b922e3..eeac9eae2a 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -858,7 +858,7 @@ void MainWindow::addModel(const QString &filename) #warning "DEMO VERSION: database model creation limit." if(models_tbw->count()==1) throw Exception(trUtf8("The demonstration version can create only `one' instance of database model!"), - ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); #endif try @@ -1344,7 +1344,7 @@ void MainWindow::saveModel(ModelWidget *model) Messagebox msg_box; msg_box.show(trUtf8("Warning"), trUtf8("You're running a demonstration version! The model saving feature is available only in the full version!"), - Messagebox::ALERT_ICON, Messagebox::OK_BUTTON); + Messagebox::AlertIcon, Messagebox::OkButton); #else try { @@ -1891,7 +1891,7 @@ void MainWindow::showDemoVersionWarning(void) of each type of object and some key features will be disabled or limited!

You can purchase a full binary copy or get the source code at https://pgmodeler.io.\ NOTE: pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and keep the development alive and at full speed!

\ HINT: in order to test all features it's recommended to use the demo.dbm model located in Sample models at Welcome view.



").arg(GlobalAttributes::MaxObjectCount), - Messagebox::ALERT_ICON, Messagebox::OK_BUTTON); + Messagebox::AlertIcon, Messagebox::OkButton); #endif } @@ -1900,7 +1900,7 @@ void MainWindow::executePendingOperation(bool valid_error) if(!valid_error && pending_op!=NoPendingOp) { static const QString op_names[]={ QString(), QT_TR_NOOP("save"), QT_TR_NOOP("save"), - QT_TR_NOOP("export"), QT_TR_NOOP("diff") }; + QT_TR_NOOP("export"), QT_TR_NOOP("diff") }; PgModelerUiNs::createOutputTreeItem(model_valid_wgt->output_trw, trUtf8("Executing pending %1 operation...").arg(op_names[pending_op])); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index f9da263af7..adf537ef63 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -120,7 +120,7 @@ void ModelObjectsWidget::editObject(void) { //If the user double-clicked the item "Permission (n)" on tree view if(sender()==objectstree_tw && objectstree_tw->currentItem() && - objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt()==ObjectType::ObjPermission) + objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt() == ~ObjectType::ObjPermission) model_wgt->showObjectForm(ObjectType::ObjPermission, reinterpret_cast(objectstree_tw->currentItem()->data(0, Qt::UserRole).value())); //If the user double-clicked a permission on list view else if(sender()==objectslist_tbw && objectslist_tbw->currentRow() >= 0) @@ -129,7 +129,7 @@ void ModelObjectsWidget::editObject(void) Permission *perm=dynamic_cast(obj); if(perm) - model_wgt->showObjectForm(ObjectType::ObjPermission,perm->getObject()); + model_wgt->showObjectForm(ObjectType::ObjPermission, perm->getObject()); else model_wgt->editObject(); } @@ -171,7 +171,7 @@ void ModelObjectsWidget::selectObject(void) //If not a relationship, connect the action to the addNewObject method of the model wiget if(obj_type!=ObjectType::ObjRelationship) { - act.setData(QVariant(obj_type)); + act.setData(QVariant(~obj_type)); connect(&act, SIGNAL(triggered()), model_wgt, SLOT(addNewObject())); } //Case is a relationship, insert the relationship menu of the model wiget into the action @@ -479,7 +479,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) count=(db_model->getObjectCount(ObjectType::ObjSchema)); item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setData(1, Qt::UserRole, QVariant::fromValue(ObjectType::ObjSchema)); + item->setData(1, Qt::UserRole, QVariant(~ObjectType::ObjSchema)); //Create the schema group item item->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(ObjectType::ObjSchema)).arg(count)); @@ -523,7 +523,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) count2=obj_list.size(); item3->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(type)).arg(count2)); - item3->setData(1, Qt::UserRole, QVariant::fromValue(type)); + item3->setData(1, Qt::UserRole, QVariant(~type)); font=item3->font(0); font.setItalic(true); @@ -563,7 +563,7 @@ void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *sche item->setIcon(0,group_icon); item->setText(0,BaseObject::getTypeName(ObjectType::ObjTable) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant::fromValue(ObjectType::ObjTable)); + item->setData(1, Qt::UserRole, QVariant(~ObjectType::ObjTable)); font=item->font(0); font.setItalic(true); @@ -623,7 +623,7 @@ void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schem item->setIcon(0,group_icon); item->setText(0,BaseObject::getTypeName(ObjectType::ObjView) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant::fromValue(ObjectType::ObjView)); + item->setData(1, Qt::UserRole, QVariant(~ObjectType::ObjView)); font=item->font(0); font.setItalic(true); @@ -736,7 +736,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) str_aux=QString(BaseObject::getSchemaName(types[i])); item1->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(str_aux + QString("_grp")))); - item1->setData(1, Qt::UserRole, QVariant::fromValue(types[i])); + item1->setData(1, Qt::UserRole, QVariant(~types[i])); obj_list=(*db_model->getObjectList(types[i])); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 75580e7b8c..6e5e950577 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -362,7 +362,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) for(i=0; i < obj_cnt; i++) { actions_new_objects[types[i]]=new QAction(QIcon(PgModelerUiNs::getIconPath(types[i])), BaseObject::getTypeName(types[i]), this); - actions_new_objects[types[i]]->setData(QVariant(types[i])); + actions_new_objects[types[i]]->setData(QVariant(~types[i])); connect(actions_new_objects[types[i]], SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); } @@ -378,7 +378,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) BaseRelationship::getRelationshipTypeName(rel_types_id[i], false), this); //Storing a unique identifier for the relationship type - action->setData(QVariant(ObjectType::ObjRelationship + rel_types_id[i])); + action->setData(QVariant(~ObjectType::ObjRelationship + rel_types_id[i])); connect(action, SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); rels_menu->addAction(action); @@ -407,7 +407,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) select_all_menu.addAction(action); } - action->setData(QVariant(obj_type)); + action->setData(QVariant(~obj_type)); connect(action, SIGNAL(triggered(bool)), this, SLOT(selectAllObjects())); } @@ -1663,7 +1663,7 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb to the BaseRelationship::RELATIONSHIP_??? constant. */ if(obj_type > ObjectType::ObjBaseTable) { - rel_type=obj_type - ObjectType::ObjRelationship; + rel_type=~obj_type - ~ObjectType::ObjRelationship; obj_type=ObjectType::ObjRelationship; } @@ -2369,7 +2369,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Validating object: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), - object->getObjectType()); + ~object->getObjectType()); if(!tab_obj || ((sel_table || sel_view) && tab_obj)) { @@ -2471,7 +2471,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Generating XML for: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), - object->getObjectType()); + ~object->getObjectType()); if(!tab_obj) { @@ -2575,7 +2575,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Pasting object: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), - object->getObjectType()); + ~object->getObjectType()); //Creates the object from the XML object=db_model->createObject(BaseObject::getObjectType(xmlparser->getElementName())); @@ -3294,13 +3294,13 @@ void ModelWidget::configureFadeMenu(void) { action = new QAction(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp"))), labels[id], &fade_in_menu); - action->setData(type); + action->setData(~type); fade_in_menu.addAction(action); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); action = new QAction(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp"))), labels[id], &fade_out_menu); - action->setData(type); + action->setData(~type); fade_out_menu.addAction(action); id++; @@ -3308,13 +3308,13 @@ void ModelWidget::configureFadeMenu(void) } action = new QAction(trUtf8("All objects"), &fade_in_menu); - action->setData(ObjectType::ObjBaseObject); + action->setData(~ObjectType::ObjBaseObject); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); fade_in_menu.addSeparator(); fade_in_menu.addAction(action); action = new QAction(trUtf8("All objects"), &fade_out_menu); - action->setData(ObjectType::ObjBaseObject); + action->setData(~ObjectType::ObjBaseObject); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); fade_out_menu.addSeparator(); fade_out_menu.addAction(action); diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 6def0b625d..7c9c48454d 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -478,7 +478,7 @@ void ObjectFinderWidget::updateObjectTypeList(QListWidget *list_wgt) //By default all object types are checked item->setCheckState(Qt::Checked); - item->setData(Qt::UserRole, QVariant(types[type_id])); + item->setData(Qt::UserRole, QVariant(~types[type_id])); list_wgt->insertItem(type_id, item); } } diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index bd162dcf67..783727fb90 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -93,7 +93,7 @@ void OperationListWidget::updateOperationList(void) item=new QTreeWidgetItem; str_aux=QString(BaseObject::getSchemaName(obj_type)); - item->setData(0, Qt::UserRole, QVariant(obj_type)); + item->setData(0, Qt::UserRole, QVariant(~obj_type)); if(obj_type==ObjectType::ObjBaseRelationship) str_aux+=QString("tv"); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 2012cb291f..a8aa1165a5 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -31,7 +31,7 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( QString gen_purpose=trUtf8("General purpose"); map types_map; vector types=BaseObject::getObjectTypes(true, {ObjectType::ObjRelationship, ObjectType::ObjTag, ObjectType::ObjTextbox, - ObjectType::ObjPermission, ObjectType::ObjBaseRelationship }); + ObjectType::ObjPermission, ObjectType::ObjBaseRelationship }); setupUi(this); @@ -42,14 +42,14 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( for(auto &itr : types_map) { ico.load(PgModelerUiNs::getIconPath(itr.second)); - applies_to_cmb->addItem(ico, itr.first, itr.second); - filter_cmb->addItem(ico, itr.first, itr.second); + applies_to_cmb->addItem(ico, itr.first, ~itr.second); + filter_cmb->addItem(ico, itr.first, ~itr.second); } - applies_to_cmb->insertItem(0, gen_purpose, ObjectType::ObjBaseObject); + applies_to_cmb->insertItem(0, gen_purpose, ~ObjectType::ObjBaseObject); applies_to_cmb->setCurrentIndex(0); - filter_cmb->insertItem(0, gen_purpose, ObjectType::ObjBaseObject); + filter_cmb->insertItem(0, gen_purpose, ~ObjectType::ObjBaseObject); filter_cmb->insertItem(0, trUtf8("All snippets")); filter_cmb->setCurrentIndex(0); diff --git a/libpgmodeler_ui/src/taskprogresswidget.cpp b/libpgmodeler_ui/src/taskprogresswidget.cpp index 207a58d1d0..82678ccfb1 100644 --- a/libpgmodeler_ui/src/taskprogresswidget.cpp +++ b/libpgmodeler_ui/src/taskprogresswidget.cpp @@ -28,7 +28,7 @@ TaskProgressWidget::TaskProgressWidget(QWidget *parent, Qt::WindowFlags f) : QDi this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); for(auto &obj_tp : obj_types) - addIcon(obj_tp, QIcon(PgModelerUiNs::getIconPath(obj_tp))); + addIcon(~obj_tp, QIcon(PgModelerUiNs::getIconPath(obj_tp))); } void TaskProgressWidget::addIcon(unsigned id, const QIcon &ico) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index b05c29e1d5..2549fcb552 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -36,7 +36,7 @@ using namespace std; //! \brief This enum defines the global error codes used throughout the application -enum class ErrorCode { +enum class ErrorCode: unsigned { Custom, AsgPseudoTypeColumn, AsgInvalidPrecision, diff --git a/main-cli/src/main.cpp b/main-cli/src/main.cpp index 20c21c46d7..cb332a9bb0 100644 --- a/main-cli/src/main.cpp +++ b/main-cli/src/main.cpp @@ -25,7 +25,7 @@ int main(int argc, char **argv) #ifdef DEMO_VERSION out << endl; - out << QString("pgModeler ") << GlobalAttributes::PGMODELER_VERSION << QT_TR_NOOP(" command line interface.") << endl; + out << QString("pgModeler ") << GlobalAttributes::PgModelerVersion << QT_TR_NOOP(" command line interface.") << endl; out << QT_TR_NOOP("PostgreSQL Database Modeler Project - pgmodeler.io") << endl; out << QT_TR_NOOP("Copyright 2006-2018 Raphael A. Silva ") << endl; out << QT_TR_NOOP("\n** CLI disabled in demonstration version! **") << endl << endl; From ff3f2d4963dec9fa7b09de31e1fe0b58e115f3d3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 16:13:26 -0300 Subject: [PATCH 175/425] Refactored all static const attributes of the classes present in pgsqltypes.h --- libobjrenderer/src/tableobjectview.cpp | 50 +- libobjrenderer/src/tableobjectview.h | 2 +- libpgmodeler/src/aggregate.cpp | 8 +- libpgmodeler/src/aggregate.h | 12 +- libpgmodeler/src/cast.cpp | 6 +- libpgmodeler/src/cast.h | 6 +- libpgmodeler/src/collation.cpp | 8 +- libpgmodeler/src/column.cpp | 26 +- libpgmodeler/src/column.h | 6 +- libpgmodeler/src/constraint.cpp | 42 +- libpgmodeler/src/databasemodel.cpp | 134 ++--- libpgmodeler/src/databasemodel.h | 4 +- libpgmodeler/src/domain.cpp | 10 +- libpgmodeler/src/domain.h | 6 +- libpgmodeler/src/eventtrigger.cpp | 2 +- libpgmodeler/src/extension.cpp | 8 +- libpgmodeler/src/function.cpp | 18 +- libpgmodeler/src/function.h | 10 +- libpgmodeler/src/index.cpp | 10 +- libpgmodeler/src/language.cpp | 2 +- libpgmodeler/src/operationlist.cpp | 4 +- libpgmodeler/src/operator.cpp | 10 +- libpgmodeler/src/operator.h | 6 +- libpgmodeler/src/operatorclass.cpp | 6 +- libpgmodeler/src/operatorclass.h | 6 +- libpgmodeler/src/operatorclasselement.cpp | 8 +- libpgmodeler/src/operatorclasselement.h | 6 +- libpgmodeler/src/parameter.cpp | 2 +- libpgmodeler/src/parameter.h | 2 +- libpgmodeler/src/pgsqltypes.cpp | 516 +++++++++--------- libpgmodeler/src/pgsqltypes.h | 360 ++++++------ libpgmodeler/src/policy.cpp | 2 +- libpgmodeler/src/relationship.cpp | 86 +-- libpgmodeler/src/relationship.h | 6 +- libpgmodeler/src/rule.cpp | 2 +- libpgmodeler/src/sequence.cpp | 12 +- libpgmodeler/src/sequence.h | 2 +- libpgmodeler/src/table.cpp | 38 +- libpgmodeler/src/trigger.cpp | 26 +- libpgmodeler/src/type.cpp | 52 +- libpgmodeler/src/type.h | 20 +- libpgmodeler/src/typeattribute.cpp | 4 +- libpgmodeler/src/typeattribute.h | 6 +- libpgmodeler/src/view.cpp | 6 +- libpgmodeler_ui/src/aggregatewidget.cpp | 10 +- libpgmodeler_ui/src/baseobjectwidget.h | 2 +- libpgmodeler_ui/src/castwidget.cpp | 2 +- libpgmodeler_ui/src/columnwidget.cpp | 8 +- libpgmodeler_ui/src/constraintwidget.cpp | 78 +-- .../src/databaseexplorerwidget.cpp | 22 +- libpgmodeler_ui/src/databaseimportform.cpp | 6 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 20 +- libpgmodeler_ui/src/databasewidget.cpp | 2 +- libpgmodeler_ui/src/domainwidget.cpp | 2 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 2 +- libpgmodeler_ui/src/functionwidget.cpp | 16 +- libpgmodeler_ui/src/indexwidget.cpp | 6 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 10 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 14 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 10 +- libpgmodeler_ui/src/modelwidget.cpp | 26 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 2 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 4 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 2 +- libpgmodeler_ui/src/operatorwidget.cpp | 2 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 4 +- libpgmodeler_ui/src/pgsqltypewidget.cpp | 16 +- libpgmodeler_ui/src/pgsqltypewidget.h | 10 +- libpgmodeler_ui/src/relationshipwidget.cpp | 8 +- libpgmodeler_ui/src/tablewidget.cpp | 18 +- libpgmodeler_ui/src/triggerwidget.cpp | 22 +- libpgmodeler_ui/src/typewidget.cpp | 8 +- libpgmodeler_ui/src/viewwidget.cpp | 4 +- .../partrelationshiptest.cpp | 50 +- 74 files changed, 972 insertions(+), 972 deletions(-) diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index ac2b997354..ecca681dba 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -66,7 +66,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) /* Elliptical descriptor is used to columns (with or without not-null constraint), for other object types, polygonal descriptor is usded */ - ellipse_desc=((column && constr_type==BaseType::null) || (!TableObject::isTableObject(obj_type))); + ellipse_desc=((column && constr_type==BaseType::Null) || (!TableObject::isTableObject(obj_type))); if(descriptor && ((ellipse_desc && !dynamic_cast(descriptor)) || (!ellipse_desc && dynamic_cast(descriptor)))) @@ -91,7 +91,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) QString attrib; QPolygonF pol; - if(constr_type==BaseType::null) + if(constr_type==BaseType::Null) { QGraphicsEllipseItem *desc=dynamic_cast(descriptor); @@ -112,7 +112,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) { QGraphicsPolygonItem *desc=dynamic_cast(descriptor); - if(constr_type==ConstraintType::primary_key) + if(constr_type==ConstraintType::PrimaryKey) { attrib=ParsersAttributes::PK_COLUMN; pol.append(QPointF(2,0)); pol.append(QPointF(0,2)); pol.append(QPointF(0,7)); @@ -121,7 +121,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) pol.append(QPointF(7,5)); pol.append(QPointF(9,7)); pol.append(QPointF(9,3)); pol.append(QPointF(3,3)); pol.append(QPointF(3,1)); } - else if(constr_type==ConstraintType::foreign_key) + else if(constr_type==ConstraintType::ForeignKey) { attrib=ParsersAttributes::FK_COLUMN; pol.append(QPointF(0,3)); pol.append(QPointF(0,6)); pol.append(QPointF(4,6)); @@ -129,7 +129,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) pol.append(QPointF(9,4)); pol.append(QPointF(5,0)); pol.append(QPointF(4,0)); pol.append(QPointF(4,3)); } - else if(constr_type==ConstraintType::unique) + else if(constr_type==ConstraintType::Unique) { attrib=ParsersAttributes::UQ_COLUMN; pol.append(QPointF(4,0)); pol.append(QPointF(0,4)); pol.append(QPointF(0,5)); @@ -193,7 +193,7 @@ void TableObjectView::configureObject(void) QString str_constr, tooltip, atribs_tip; TableObject *tab_obj=dynamic_cast(this->getSourceObject()); Column *column=dynamic_cast(tab_obj); - ConstraintType constr_type=ConstraintType::null; + ConstraintType constr_type=ConstraintType::Null; bool sql_disabled=false; tooltip=tab_obj->getName() + QString(" (") + tab_obj->getTypeName() + QString(")"); @@ -210,17 +210,17 @@ void TableObjectView::configureObject(void) if(str_constr.indexOf(TextPrimaryKey)>=0) { fmt=font_config[ParsersAttributes::PK_COLUMN]; - constr_type=ConstraintType::primary_key; + constr_type=ConstraintType::PrimaryKey; } else if(str_constr.indexOf(TextForeignKey)>=0) { fmt=font_config[ParsersAttributes::FK_COLUMN]; - constr_type=ConstraintType::foreign_key; + constr_type=ConstraintType::ForeignKey; } else if(str_constr.indexOf(TextUnique)>=0) { fmt=font_config[ParsersAttributes::UQ_COLUMN]; - constr_type=ConstraintType::unique; + constr_type=ConstraintType::Unique; } else if(str_constr.indexOf(TextNotNull)>=0) fmt=font_config[ParsersAttributes::NN_COLUMN]; @@ -233,16 +233,16 @@ void TableObjectView::configureObject(void) fmt=font_config[ParsersAttributes::PROT_COLUMN]; if(str_constr.indexOf(TextPrimaryKey)>=0) - atribs_tip+=(~ConstraintType(ConstraintType::primary_key)).toLower() + QString(", "); + atribs_tip+=(~ConstraintType(ConstraintType::PrimaryKey)).toLower() + QString(", "); if(str_constr.indexOf(TextForeignKey)>=0) - atribs_tip+=(~ConstraintType(ConstraintType::foreign_key)).toLower() + QString(", "); + atribs_tip+=(~ConstraintType(ConstraintType::ForeignKey)).toLower() + QString(", "); if(str_constr.indexOf(TextUnique)>=0) - atribs_tip+=(~ConstraintType(ConstraintType::unique)).toLower() + QString(", "); + atribs_tip+=(~ConstraintType(ConstraintType::Unique)).toLower() + QString(", "); if(str_constr.indexOf(TextExclude)>=0) - atribs_tip+=(~ConstraintType(ConstraintType::exclude)).toLower() + QString(", "); + atribs_tip+=(~ConstraintType(ConstraintType::Exclude)).toLower() + QString(", "); if(str_constr.indexOf(TextNotNull)>=0) atribs_tip+=QString("not null"); @@ -326,7 +326,7 @@ void TableObjectView::configureObject(void) atribs_tip+=(~trigger->getFiringType()).toLower() + QString(", "); - for(unsigned i=EventType::on_insert; i <= EventType::on_truncate; i++) + for(unsigned i=EventType::OnInsert; i <= EventType::OnTruncate; i++) { if(trigger->isExecuteOnEvent(EventType(i))) { @@ -366,15 +366,15 @@ void TableObjectView::configureObject(void) { ConstraintType type = constr->getConstraintType(); - if(type == ConstraintType::primary_key) + if(type == ConstraintType::PrimaryKey) str_constr = TextPrimaryKey; - else if(type == ConstraintType::foreign_key) + else if(type == ConstraintType::ForeignKey) str_constr = TextForeignKey; - else if(type == ConstraintType::unique) + else if(type == ConstraintType::Unique) str_constr = TextUnique; - else if(type == ConstraintType::exclude) + else if(type == ConstraintType::Exclude) str_constr = TextExclude; - else if(type == ConstraintType::check) + else if(type == ConstraintType::Check) str_constr = TextCheck; atribs_tip = (~type).toLower(); @@ -565,21 +565,21 @@ QString TableObjectView::getConstraintString(Column *column) itr++; //Check if the column is referecend by the constraint - if((constr->getConstraintType()!=ConstraintType::exclude && constr->isColumnExists(column, Constraint::SourceCols)) || - (constr->getConstraintType()==ConstraintType::exclude && constr->isColumnReferenced(column, false))) + if((constr->getConstraintType()!=ConstraintType::Exclude && constr->isColumnExists(column, Constraint::SourceCols)) || + (constr->getConstraintType()==ConstraintType::Exclude && constr->isColumnReferenced(column, false))) { constr_type=constr->getConstraintType(); - if(constr_type==ConstraintType::primary_key) + if(constr_type==ConstraintType::PrimaryKey) str_constr=TextPrimaryKey + ConstrSeparator + str_constr; - if(constr_type==ConstraintType::foreign_key && str_constr.indexOf(TextForeignKey) < 0) + if(constr_type==ConstraintType::ForeignKey && str_constr.indexOf(TextForeignKey) < 0) str_constr+=TextForeignKey + ConstrSeparator; - if(constr_type==ConstraintType::unique && str_constr.indexOf(TextUnique) < 0) + if(constr_type==ConstraintType::Unique && str_constr.indexOf(TextUnique) < 0) str_constr+=TextUnique + ConstrSeparator; - if(constr_type==ConstraintType::exclude && str_constr.indexOf(TextExclude) < 0) + if(constr_type==ConstraintType::Exclude && str_constr.indexOf(TextExclude) < 0) str_constr+=TextExclude + ConstrSeparator; } } diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index 2f1bdb5a2a..10af2fb7cb 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -44,7 +44,7 @@ class TableObjectView: public BaseObjectView The constraint type parameter is only used when the source object is a column and is used to format the descriptor indication that the column has a constraint */ - void configureDescriptor(ConstraintType constr_type=BaseType::null); + void configureDescriptor(ConstraintType constr_type=BaseType::Null); QVariant itemChange(GraphicsItemChange, const QVariant &value) { diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 0c60570f36..35e934da04 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -97,7 +97,7 @@ bool Aggregate::isValidFunction(unsigned func_idx, Function *func) else return(true); } -void Aggregate::setStateType(PgSQLType state_type) +void Aggregate::setStateType(PgSqlType state_type) { setCodeInvalidated(this->state_type != state_type); this->state_type=state_type; @@ -158,7 +158,7 @@ void Aggregate::setTypesAttribute(unsigned def_type) attributes[ParsersAttributes::TYPES]=str_types; } -void Aggregate::addDataType(PgSQLType type) +void Aggregate::addDataType(PgSqlType type) { data_types.push_back(type); setCodeInvalidated(true); @@ -195,7 +195,7 @@ Function *Aggregate::getFunction(unsigned func_idx) return(functions[func_idx]); } -PgSQLType Aggregate::getStateType(void) +PgSqlType Aggregate::getStateType(void) { return(state_type); } @@ -210,7 +210,7 @@ Operator *Aggregate::getSortOperator(void) return(sort_operator); } -PgSQLType Aggregate::getDataType(unsigned type_idx) +PgSqlType Aggregate::getDataType(unsigned type_idx) { //Raises an exception if the type index is out of bound if(type_idx >= data_types.size()) diff --git a/libpgmodeler/src/aggregate.h b/libpgmodeler/src/aggregate.h index 2f609c1ed1..01ca7c931f 100644 --- a/libpgmodeler/src/aggregate.h +++ b/libpgmodeler/src/aggregate.h @@ -41,7 +41,7 @@ class Aggregate: public BaseObject { To declare an aggregate function which works with several types in the old syntax, the only element of the list must be of type 'any' */ - vector data_types; + vector data_types; /*! \brief Function that defines the aggregate behavior 0 -> Final function @@ -49,7 +49,7 @@ class Aggregate: public BaseObject { Function *functions[2]; //! \brief Data type used as aggregate's state - PgSQLType state_type; + PgSqlType state_type; //! \brief Initial condition for the aggregate QString initial_condition; @@ -74,7 +74,7 @@ class Aggregate: public BaseObject { void setFunction(unsigned func_idx, Function *func); //! \brief Defines the state data type of the aggregate - void setStateType(PgSQLType state_type); + void setStateType(PgSqlType state_type); //! \brief Defines the initial condition for the aggregate void setInitialCondition(const QString &cond); @@ -83,7 +83,7 @@ class Aggregate: public BaseObject { void setSortOperator(Operator *sort_op); //! \brief Adds a data type in the group that is accepted by the aggregate - void addDataType(PgSQLType type); + void addDataType(PgSqlType type); //! \brief Removes one aggregate accepted data type void removeDataType(unsigned type_idx); @@ -92,10 +92,10 @@ class Aggregate: public BaseObject { void removeDataTypes(void); Function *getFunction(unsigned func_idx); - PgSQLType getStateType(void); + PgSqlType getStateType(void); QString getInitialCondition(void); Operator *getSortOperator(void); - PgSQLType getDataType(unsigned type_idx); + PgSqlType getDataType(unsigned type_idx); unsigned getDataTypeCount(void); //! \brief Returns the SQL / XML code definition for the aggregate diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 92354c64d5..d5b2cbb04e 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -31,7 +31,7 @@ Cast::Cast(void) attributes[ParsersAttributes::FUNCTION]=QString(); } -void Cast::setDataType(unsigned type_idx, PgSQLType type) +void Cast::setDataType(unsigned type_idx, PgSqlType type) { //Check if the type index is valid if(type_idx<=DstType) @@ -74,7 +74,7 @@ void Cast::setCastFunction(Function *cast_func) { unsigned param_count; bool error=false; - PgSQLType ret_type; + PgSqlType ret_type; if(!cast_func) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) @@ -130,7 +130,7 @@ void Cast::setCastFunction(Function *cast_func) this->cast_function=cast_func; } -PgSQLType Cast::getDataType(unsigned type_idx) +PgSqlType Cast::getDataType(unsigned type_idx) { if(type_idx > DstType) throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/cast.h b/libpgmodeler/src/cast.h index dfad8127d3..e77dccac24 100644 --- a/libpgmodeler/src/cast.h +++ b/libpgmodeler/src/cast.h @@ -34,7 +34,7 @@ class Cast: public BaseObject { /*! \brief Data types used on the cast: 0 -> Source data type 1 -> Destination data type */ - PgSQLType types[2]; + PgSqlType types[2]; //! \brief Conversion type (ASSIGNMENT or IMPLICIT) unsigned cast_type; @@ -61,7 +61,7 @@ class Cast: public BaseObject { /*! \brief Defines one of the data types envolved on the cast (using constants SRC_TYPE | DST_TYPE) */ - void setDataType(unsigned type_idx, PgSQLType type); + void setDataType(unsigned type_idx, PgSqlType type); //! \brief Defines the cast type (using constants ASSINGMENT | IMPLICIT) void setCastType(unsigned cast_type); @@ -75,7 +75,7 @@ class Cast: public BaseObject { void setInOut(bool value); //! \brief Returns one of the cast envolved data types - PgSQLType getDataType(unsigned type_idx); + PgSqlType getDataType(unsigned type_idx); //! \brief Returns the cast type unsigned getCastType(void); diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index 541670bc21..1f9e578f40 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -21,7 +21,7 @@ Collation::Collation(void) { obj_type=ObjectType::ObjCollation; - encoding=BaseType::null; + encoding=BaseType::Null; attributes[ParsersAttributes::_LC_CTYPE_]=QString(); attributes[ParsersAttributes::_LC_COLLATE_]=QString(); @@ -67,7 +67,7 @@ void Collation::setCollation(BaseObject *collation) BaseObject::setCollation(collation); - encoding=BaseType::null; + encoding=BaseType::Null; locale.clear(); localization[0]=localization[1]=QString(); } @@ -104,7 +104,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[ParsersAttributes::LOCALE]=locale; - if(def_type==SchemaParser::SqlDefinition && encoding!=BaseType::null) + if(def_type==SchemaParser::SqlDefinition && encoding!=BaseType::Null) attributes[ParsersAttributes::LOCALE]=locale + "." + (~encoding).toLower(); } else if(collation) @@ -120,7 +120,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[lc_attribs[i]]=getLocalization(i); - if(def_type==SchemaParser::SqlDefinition && encoding!=BaseType::null && + if(def_type==SchemaParser::SqlDefinition && encoding!=BaseType::Null && !attributes[lc_attribs[i]].isEmpty()) attributes[lc_attribs[i]]+="." + (~encoding).toLower(); } diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index de9a8d9aca..e0ccd9afd2 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -37,7 +37,7 @@ Column::Column(void) attributes[ParsersAttributes::CYCLE]=QString(); parent_rel=sequence=nullptr; - identity_type=BaseType::null; + identity_type=BaseType::Null; } void Column::setName(const QString &name) @@ -62,12 +62,12 @@ void Column::setName(const QString &name) } } -void Column::setType(PgSQLType type) +void Column::setType(PgSqlType type) { //An error is raised if the column receive a pseudo-type as data type. if(type.isPseudoType()) throw Exception(ErrorCode::AsgPseudoTypeColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(this->identity_type != BaseType::null && !type.isIntegerType()) + else if(this->identity_type != BaseType::Null && !type.isIntegerType()) { throw Exception(Exception::getErrorMessage(ErrorCode::InvalidIdentityColumn).arg(getSignature()), ErrorCode::InvalidIdentityColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); @@ -79,7 +79,7 @@ void Column::setType(PgSQLType type) void Column::setIdentityType(IdentityType id_type) { - if(id_type != BaseType::null && !type.isIntegerType()) + if(id_type != BaseType::Null && !type.isIntegerType()) { throw Exception(Exception::getErrorMessage(ErrorCode::InvalidIdentityColumn).arg(getSignature()), ErrorCode::InvalidIdentityColumn, __PRETTY_FUNCTION__, __FILE__, __LINE__); @@ -91,7 +91,7 @@ void Column::setIdentityType(IdentityType id_type) sequence = nullptr; //Identity column implies NOT NULL constraint - if(id_type != BaseType::null) + if(id_type != BaseType::Null) setNotNull(true); } @@ -100,7 +100,7 @@ void Column::setDefaultValue(const QString &value) setCodeInvalidated(default_value != value); default_value=value.trimmed(); sequence=nullptr; - identity_type=BaseType::null; + identity_type=BaseType::Null; } void Column::setNotNull(bool value) @@ -109,7 +109,7 @@ void Column::setNotNull(bool value) not_null=value; } -PgSQLType Column::getType(void) +PgSqlType Column::getType(void) { return(type); } @@ -126,7 +126,7 @@ bool Column::isNotNull(void) bool Column::isIdentity(void) { - return(identity_type != BaseType::null); + return(identity_type != BaseType::Null); } QString Column::getTypeReference(void) @@ -180,7 +180,7 @@ void Column::setSequence(BaseObject *seq) ErrorCode::IncompColumnTypeForSequence,__PRETTY_FUNCTION__,__FILE__,__LINE__); default_value=QString(); - identity_type=BaseType::null; + identity_type=BaseType::Null; } setCodeInvalidated(sequence != seq); @@ -244,7 +244,7 @@ QString Column::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); attributes[ParsersAttributes::IDENTITY_TYPE]=QString(); - if(identity_type != BaseType::null) + if(identity_type != BaseType::Null) { attributes[ParsersAttributes::IDENTITY_TYPE] = ~identity_type; attributes[ParsersAttributes::INCREMENT]=seq_increment; @@ -311,11 +311,11 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[ParsersAttributes::NEW_IDENTITY_TYPE] = QString(); - if(this->identity_type == BaseType::null && col->identity_type != BaseType::null) + if(this->identity_type == BaseType::Null && col->identity_type != BaseType::Null) attribs[ParsersAttributes::IDENTITY_TYPE] = ~col->identity_type; - else if(this->identity_type != BaseType::null && col->identity_type == BaseType::null) + else if(this->identity_type != BaseType::Null && col->identity_type == BaseType::Null) attribs[ParsersAttributes::IDENTITY_TYPE] = ParsersAttributes::UNSET; - else if(this->identity_type != BaseType::null && col->identity_type != BaseType::null && + else if(this->identity_type != BaseType::Null && col->identity_type != BaseType::Null && this->identity_type != col->identity_type) attribs[ParsersAttributes::NEW_IDENTITY_TYPE] = ~col->identity_type; diff --git a/libpgmodeler/src/column.h b/libpgmodeler/src/column.h index 6a5fde5bd7..33d4c5907f 100644 --- a/libpgmodeler/src/column.h +++ b/libpgmodeler/src/column.h @@ -39,7 +39,7 @@ class Column: public TableObject{ bool not_null; //! \brief Data type of the column - PgSQLType type; + PgSqlType type; /*! \brief Default value of the column. Note: The user must format the default value in @@ -84,7 +84,7 @@ class Column: public TableObject{ void setNotNull(bool value); //! \brief Defines the column data type - void setType(PgSQLType type); + void setType(PgSqlType type); //! \brief Defines the identity mode of the column void setIdentityType(IdentityType id_type); @@ -105,7 +105,7 @@ class Column: public TableObject{ bool isIdentity(void); //! \brief Returns the data type of the column - PgSQLType getType(void); + PgSqlType getType(void); //! \brief Returns the identity mode of the column IdentityType getIdentityType(void); diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 6100a24c66..ce2d05d92b 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -25,7 +25,7 @@ Constraint::Constraint(void) deferrable=false; no_inherit=false; fill_factor=0; - index_type=BaseType::null; + index_type=BaseType::Null; attributes[ParsersAttributes::PK_CONSTR]=QString(); attributes[ParsersAttributes::FK_CONSTR]=QString(); @@ -117,17 +117,17 @@ bool Constraint::isColumnReferenced(Column *column, bool search_only_ref_cols) bool found=false; vector::iterator itr, itr_end; - if(constr_type == ConstraintType::primary_key || - constr_type == ConstraintType::unique || - constr_type == ConstraintType::foreign_key) + if(constr_type == ConstraintType::PrimaryKey || + constr_type == ConstraintType::Unique || + constr_type == ConstraintType::ForeignKey) { if(!search_only_ref_cols) found=isColumnExists(column, SourceCols); - if(!found && constr_type==ConstraintType::foreign_key) + if(!found && constr_type==ConstraintType::ForeignKey) found=isColumnExists(column, ReferencedCols); } - else if(constr_type==ConstraintType::exclude) + else if(constr_type==ConstraintType::Exclude) { //Iterates over the exclude elements itr=excl_elements.begin(); @@ -151,7 +151,7 @@ void Constraint::addColumn(Column *column, unsigned col_type) .arg(this->getName()) .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)), ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(constr_type!=ConstraintType::check) + else if(constr_type!=ConstraintType::Check) { //Adds the column only if the column doesn't exists on the internal list if(!isColumnExists(column,col_type)) @@ -174,8 +174,8 @@ void Constraint::setTablespace(BaseObject *tabspc) try { if(tabspc && - constr_type!=ConstraintType::primary_key && - constr_type!=ConstraintType::unique) + constr_type!=ConstraintType::PrimaryKey && + constr_type!=ConstraintType::Unique) throw Exception(ErrorCode::AsgTablespaceInvalidConstraintType,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setTablespace(tabspc); @@ -367,7 +367,7 @@ void Constraint::removeColumn(const QString &name, unsigned col_type) //Case the column is found if(col->getName()==name) { - if(constr_type==ConstraintType::primary_key) + if(constr_type==ConstraintType::PrimaryKey) col->setNotNull(false); //Remove its iterator from the list @@ -595,7 +595,7 @@ void Constraint::removeExcludeElements(void) void Constraint::setColumnsNotNull(bool value) { - if(constr_type==ConstraintType::primary_key) + if(constr_type==ConstraintType::PrimaryKey) { for(auto &col : columns) { @@ -650,9 +650,9 @@ QString Constraint::getCodeDefinition(unsigned def_type) void Constraint::setDeclInTableAttribute(void) { - if(!isDeclaredInTable() || (constr_type==ConstraintType::foreign_key && !isAddedByLinking())) + if(!isDeclaredInTable() || (constr_type==ConstraintType::ForeignKey && !isAddedByLinking())) attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); - else if(!isReferRelationshipAddedColumn() || constr_type==ConstraintType::primary_key) + else if(!isReferRelationshipAddedColumn() || constr_type==ConstraintType::PrimaryKey) attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::_TRUE_; } @@ -671,16 +671,16 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) switch(!constr_type) { - case ConstraintType::check: + case ConstraintType::Check: attrib=ParsersAttributes::CK_CONSTR; break; - case ConstraintType::primary_key: + case ConstraintType::PrimaryKey: attrib=ParsersAttributes::PK_CONSTR; break; - case ConstraintType::foreign_key: + case ConstraintType::ForeignKey: attrib=ParsersAttributes::FK_CONSTR; break; - case ConstraintType::unique: + case ConstraintType::Unique: attrib=ParsersAttributes::UQ_CONSTR; break; default: @@ -694,9 +694,9 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[ParsersAttributes::DEL_ACTION]=(~del_action); attributes[ParsersAttributes::EXPRESSION]=expression; - if(constr_type!=ConstraintType::check) + if(constr_type!=ConstraintType::Check) { - if(constr_type!=ConstraintType::exclude) + if(constr_type!=ConstraintType::Exclude) setColumnsAttribute(SourceCols, def_type, inc_addedbyrel); else setExcludeElementsAttribute(def_type); @@ -706,7 +706,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) this means the constraint is configured correctly, otherwise don't generates the attribute forcing the schema parser to return an error because the foreign key is misconfigured. */ - if(constr_type==ConstraintType::foreign_key && columns.size() == ref_columns.size()) + if(constr_type==ConstraintType::ForeignKey && columns.size() == ref_columns.size()) setColumnsAttribute(ReferencedCols, def_type, inc_addedbyrel); } @@ -722,7 +722,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) setDeclInTableAttribute(); - if(fill_factor!=0 && (constr_type==ConstraintType::primary_key || constr_type==ConstraintType::unique)) + if(fill_factor!=0 && (constr_type==ConstraintType::PrimaryKey || constr_type==ConstraintType::Unique)) attributes[ParsersAttributes::FACTOR]=QString("%1").arg(fill_factor); else attributes[ParsersAttributes::FACTOR]=QString(); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 5b55c8b5f2..a9b48f53ca 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -30,7 +30,7 @@ DatabaseModel::DatabaseModel(void) is_template = false; allow_conns = true; - encoding=BaseType::null; + encoding=BaseType::Null; BaseObject::setName(QObject::trUtf8("new_database").toUtf8()); default_objs[ObjectType::ObjSchema]=nullptr; @@ -801,7 +801,7 @@ void DatabaseModel::destroyObjects(void) delete(object); } - PgSQLType::removeUserTypes(this); + PgSqlType::removeUserTypes(this); //Cleaning out the list of removed objects to avoid segfaults while calling this method again if(!rem_obj_types.empty()) @@ -821,7 +821,7 @@ void DatabaseModel::addTable(Table *table, int obj_idx) { __addObject(table, obj_idx); - PgSQLType::addUserType(table->getName(true), table, this, UserTypeConfig::TABLE_TYPE); + PgSqlType::addUserType(table->getName(true), table, this, UserTypeConfig::TableType); updateTableFKRelationships(table); @@ -848,7 +848,7 @@ void DatabaseModel::removeTable(Table *table, int obj_idx) try { __removeObject(table, obj_idx); - PgSQLType::removeUserType(table->getName(true), table); + PgSqlType::removeUserType(table->getName(true), table); updateTableFKRelationships(table); } catch(Exception &e) @@ -862,7 +862,7 @@ void DatabaseModel::addSequence(Sequence *sequence, int obj_idx) try { __addObject(sequence, obj_idx); - PgSQLType::addUserType(sequence->getName(true), sequence, this, UserTypeConfig::SEQUENCE_TYPE); + PgSqlType::addUserType(sequence->getName(true), sequence, this, UserTypeConfig::SequenceType); } catch(Exception &e) { @@ -933,7 +933,7 @@ void DatabaseModel::addExtension(Extension *extension, int obj_idx) __addObject(extension, obj_idx); if(extension->handlesType()) - PgSQLType::addUserType(extension->getName(true), extension, this, UserTypeConfig::EXTENSION_TYPE); + PgSqlType::addUserType(extension->getName(true), extension, this, UserTypeConfig::ExtensionType); } catch(Exception &e) { @@ -1073,7 +1073,7 @@ void DatabaseModel::addView(View *view, int obj_idx) try { __addObject(view, obj_idx); - PgSQLType::addUserType(view->getName(true), view, this, UserTypeConfig::VIEW_TYPE); + PgSqlType::addUserType(view->getName(true), view, this, UserTypeConfig::ViewType); updateViewRelationships(view); dynamic_cast(view->getSchema())->setModified(true); @@ -1102,7 +1102,7 @@ void DatabaseModel::removeView(View *view, int obj_idx) updateViewRelationships(view, true); __removeObject(view, obj_idx); - PgSQLType::removeUserType(view->getName(true), view); + PgSqlType::removeUserType(view->getName(true), view); } catch(Exception &e) { @@ -1775,7 +1775,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) relationship (created manually by the user) */ found=(!constr->isAddedByRelationship() && constr->isReferRelationshipAddedColumn() && - constr->getConstraintType()!=ConstraintType::primary_key); + constr->getConstraintType()!=ConstraintType::PrimaryKey); //When found some special object, stores is xml definition if(found) @@ -1806,7 +1806,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) table->removeObject(tab_obj->getName(), tab_obj->getObjectType()); //We need to store the table which fk was referencing relationship added columns in order to update the fk relationships of that table - if(constr && constr->getConstraintType() == ConstraintType::foreign_key) + if(constr && constr->getConstraintType() == ConstraintType::ForeignKey) upd_tables_rels.push_back(table); //Removes the permission from the table object @@ -2490,7 +2490,7 @@ void DatabaseModel::addDomain(Domain *domain, int obj_idx) __addObject(domain, obj_idx); //When added to the model the domain is inserted on the pgsql base type list to be used as a column type - PgSQLType::addUserType(domain->getName(true), domain, this, UserTypeConfig::DOMAIN_TYPE); + PgSqlType::addUserType(domain->getName(true), domain, this, UserTypeConfig::DomainType); } catch(Exception &e) { @@ -2656,7 +2656,7 @@ void DatabaseModel::addType(Type *type, int obj_idx) __addObject(type, obj_idx); //When added to the model the user type is inserted on the pgsql base type list to be used as a column type - PgSQLType::addUserType(type->getName(true), type, this, UserTypeConfig::BASE_TYPE); + PgSqlType::addUserType(type->getName(true), type, this, UserTypeConfig::BaseType); } catch(Exception &e) { @@ -2694,7 +2694,7 @@ void DatabaseModel::removeUserType(BaseObject *object, int obj_idx) __removeObject(object, obj_idx); //Removes the user type from the list of base types of pgsql - PgSQLType::removeUserType(object->getName(true), object); + PgSqlType::removeUserType(object->getName(true), object); } catch(Exception &e) { @@ -3664,7 +3664,7 @@ Function *DatabaseModel::createFunction(void) Function *func=nullptr; ObjectType obj_type; BaseObject *object=nullptr; - PgSQLType type; + PgSqlType type; Parameter param; QString str_aux, elem; @@ -3920,7 +3920,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) return(tpattrib); } -PgSQLType DatabaseModel::createPgSQLType(void) +PgSqlType DatabaseModel::createPgSQLType(void) { attribs_map attribs; unsigned length=1, dimension=0, type_idx=0; @@ -3961,19 +3961,19 @@ PgSQLType DatabaseModel::createPgSQLType(void) name.remove(QString(" with time zone"), Qt::CaseInsensitive); } - type_idx=PgSQLType::getBaseTypeIndex(name); - if(type_idx!=PgSQLType::null) + type_idx=PgSqlType::getBaseTypeIndex(name); + if(type_idx!=PgSqlType::Null) { - return(PgSQLType(name,length,dimension,precision,with_timezone,interv_type, spatial_type)); + return(PgSqlType(name,length,dimension,precision,with_timezone,interv_type, spatial_type)); } else { //Raises an error if the referenced type name doesn't exists - if(PgSQLType::getUserTypeIndex(name,nullptr,this) == BaseType::null) + if(PgSqlType::getUserTypeIndex(name,nullptr,this) == BaseType::Null) throw Exception(ErrorCode::RefUserTypeInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - type_idx=PgSQLType::getUserTypeIndex(name, ptype); - return(PgSQLType(type_idx,length,dimension,precision,with_timezone,interv_type,spatial_type)); + type_idx=PgSqlType::getUserTypeIndex(name, ptype); + return(PgSqlType(type_idx,length,dimension,precision,with_timezone,interv_type,spatial_type)); } } @@ -3987,7 +3987,7 @@ Type *DatabaseModel::createType(void) QString elem, str_aux; BaseObject *func=nullptr, *collation=nullptr; OperatorClass *op_class=nullptr; - PgSQLType aux_type; + PgSqlType aux_type; try { @@ -4219,7 +4219,7 @@ Cast *DatabaseModel::createCast(void) Cast *cast=nullptr; QString elem; unsigned type_idx=0; - PgSQLType type; + PgSqlType type; BaseObject *func=nullptr; try @@ -4354,7 +4354,7 @@ Operator *DatabaseModel::createOperator(void) QString elem; BaseObject *func=nullptr,*oper_aux=nullptr; unsigned arg_type; - PgSQLType type; + PgSqlType type; try { @@ -4446,7 +4446,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) map elem_types; BaseObject *object=nullptr; QString elem; - PgSQLType type; + PgSqlType type; OperatorClass *op_class=nullptr; OperatorClassElement class_elem; unsigned stg_number, elem_type; @@ -4584,7 +4584,7 @@ Aggregate *DatabaseModel::createAggregate(void) attribs_map attribs; BaseObject *func=nullptr; QString elem; - PgSQLType type; + PgSqlType type; Aggregate *aggreg=nullptr; try @@ -4920,15 +4920,15 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Configuring the constraint type if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::CK_CONSTR) - constr_type=ConstraintType::check; + constr_type=ConstraintType::Check; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::PK_CONSTR) - constr_type=ConstraintType::primary_key; + constr_type=ConstraintType::PrimaryKey; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::FK_CONSTR) - constr_type=ConstraintType::foreign_key; + constr_type=ConstraintType::ForeignKey; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::UQ_CONSTR) - constr_type=ConstraintType::unique; + constr_type=ConstraintType::Unique; else - constr_type=ConstraintType::exclude; + constr_type=ConstraintType::Exclude; constr->setConstraintType(constr_type); @@ -4938,7 +4938,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) setBasicAttributes(constr); //Raises an error if the constraint is a primary key and no parent object is specified - if(!parent_obj && constr_type==ConstraintType::primary_key) + if(!parent_obj && constr_type==ConstraintType::PrimaryKey) throw Exception(Exception::getErrorMessage(ErrorCode::InvPrimaryKeyAllocation) .arg(constr->getName()), ErrorCode::InvPrimaryKeyAllocation,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4949,7 +4949,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(deferrable && !attribs[ParsersAttributes::DEFER_TYPE].isEmpty()) constr->setDeferralType(attribs[ParsersAttributes::DEFER_TYPE]); - if(constr_type==ConstraintType::foreign_key) + if(constr_type==ConstraintType::ForeignKey) { if(!attribs[ParsersAttributes::COMPARISON_TYPE].isEmpty()) constr->setMatchType(attribs[ParsersAttributes::COMPARISON_TYPE]); @@ -4979,11 +4979,11 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setReferencedTable(dynamic_cast(ref_table)); } - else if(constr_type==ConstraintType::check) + else if(constr_type==ConstraintType::Check) { constr->setNoInherit(attribs[ParsersAttributes::NO_INHERIT]==ParsersAttributes::_TRUE_); } - else if(constr_type==ConstraintType::exclude && !attribs[ParsersAttributes::INDEX_TYPE].isEmpty()) + else if(constr_type==ConstraintType::Exclude && !attribs[ParsersAttributes::INDEX_TYPE].isEmpty()) { constr->setIndexType(attribs[ParsersAttributes::INDEX_TYPE]); } @@ -5057,7 +5057,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(ins_constr_table) { - if(constr->getConstraintType()!=ConstraintType::primary_key) + if(constr->getConstraintType()!=ConstraintType::PrimaryKey) { table->addConstraint(constr); if(this->getObjectIndex(table) >= 0) @@ -5474,16 +5474,16 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setConstraint(attribs[ParsersAttributes::CONSTRAINT]==ParsersAttributes::_TRUE_); - trigger->setEvent(EventType::on_insert, + trigger->setEvent(EventType::OnInsert, (attribs[ParsersAttributes::INS_EVENT]==ParsersAttributes::_TRUE_)); - trigger->setEvent(EventType::on_delete, + trigger->setEvent(EventType::OnDelete, (attribs[ParsersAttributes::DEL_EVENT]==ParsersAttributes::_TRUE_)); - trigger->setEvent(EventType::on_update, + trigger->setEvent(EventType::OnUpdate, (attribs[ParsersAttributes::UPD_EVENT]==ParsersAttributes::_TRUE_)); - trigger->setEvent(EventType::on_truncate, + trigger->setEvent(EventType::OnTruncate, (attribs[ParsersAttributes::TRUNC_EVENT]==ParsersAttributes::_TRUE_)); trigger->setExecutePerRow(attribs[ParsersAttributes::PER_ROW]==ParsersAttributes::_TRUE_); @@ -6668,10 +6668,10 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab > Case the parent table is a partition and a column is being removed > Case the object is a constraint and its a table primary key */ revalidate_rels=((obj_type==ObjectType::ObjColumn && - (parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::primary_key) || + (parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::PrimaryKey) || parent_tab->isPartition() || parent_tab->isPartitioned())) || (obj_type==ObjectType::ObjConstraint && - dynamic_cast(object)->getConstraintType()==ConstraintType::primary_key)); + dynamic_cast(object)->getConstraintType()==ConstraintType::PrimaryKey)); /* Additional validation for columns: checks if the parent table participates on a generalization/copy as destination table */ @@ -6718,7 +6718,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) { QString loc_attribs[]={ ParsersAttributes::_LC_CTYPE_, ParsersAttributes::_LC_COLLATE_ }; - if(encoding!=BaseType::null) + if(encoding!=BaseType::Null) attributes[ParsersAttributes::ENCODING]=QString("'%1'").arg(~encoding); for(unsigned i=0; i < 2; i++) @@ -7061,10 +7061,10 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b /* Case the constraint is a special object stores it on the objects map. Independently to the configuration, foreign keys are discarded in this iteration because on the end of the method they have the definition generated */ - if(constr->getConstraintType()!=ConstraintType::foreign_key && !constr->isAddedByLinking() && - ((constr->getConstraintType()!=ConstraintType::primary_key && constr->isReferRelationshipAddedColumn()))) + if(constr->getConstraintType()!=ConstraintType::ForeignKey && !constr->isAddedByLinking() && + ((constr->getConstraintType()!=ConstraintType::PrimaryKey && constr->isReferRelationshipAddedColumn()))) objects_map[constr->getObjectId()]=constr; - else if(constr->getConstraintType()==ConstraintType::foreign_key && !constr->isAddedByLinking()) + else if(constr->getConstraintType()==ConstraintType::ForeignKey && !constr->isAddedByLinking()) fkeys.push_back(constr); } @@ -7126,7 +7126,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b { constr=dynamic_cast(tab_obj); - if(constr->getConstraintType()==ConstraintType::foreign_key) + if(constr->getConstraintType()==ConstraintType::ForeignKey) fkeys.push_back(constr); } } @@ -7136,7 +7136,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b for(auto &constr : constrs) { - if(constr->getConstraintType()!=ConstraintType::primary_key) + if(constr->getConstraintType()!=ConstraintType::PrimaryKey) rel_constrs.push_back(constr); } } @@ -7244,9 +7244,9 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vectorgetObjectType()!=ObjectType::ObjColumn) || (constr && - ((constr->getConstraintType()==ConstraintType::foreign_key) || - (constr->getConstraintType()!=ConstraintType::foreign_key && - constr->getConstraintType()!=ConstraintType::primary_key && + ((constr->getConstraintType()==ConstraintType::ForeignKey) || + (constr->getConstraintType()!=ConstraintType::ForeignKey && + constr->getConstraintType()!=ConstraintType::PrimaryKey && constr->isReferRelationshipAddedColumn())))) { __getObjectDependencies(child, objs); @@ -7328,9 +7328,9 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on if((!constr && child->getObjectType()!=ObjectType::ObjColumn) || (constr && - ((constr->getConstraintType()==ConstraintType::foreign_key) || - (constr->getConstraintType()!=ConstraintType::foreign_key && - constr->getConstraintType()!=ConstraintType::primary_key && + ((constr->getConstraintType()==ConstraintType::ForeignKey) || + (constr->getConstraintType()!=ConstraintType::ForeignKey && + constr->getConstraintType()!=ConstraintType::PrimaryKey && constr->isReferRelationshipAddedColumn())))) { objs_aux.push_back(child); @@ -7762,7 +7762,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorisAddedByLinking() && - constr->getConstraintType()==ConstraintType::foreign_key) + constr->getConstraintType()==ConstraintType::ForeignKey) getObjectDependecies(constr->getReferencedTable(), deps, inc_indirect_deps); if(!constr->isAddedByLinking() && constr->getTablespace()) @@ -7997,7 +7997,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector { constr=tab->getConstraint(i); //If a constraint references its own parent table it'll not be included on the references list - if(constr->getConstraintType()==ConstraintType::foreign_key && + if(constr->getConstraintType()==ConstraintType::ForeignKey && constr->getParentTable()!=constr->getReferencedTable() && constr->getReferencedTable()==table) { @@ -8787,7 +8787,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector { constr=table->getConstraint(i1); - if(constr->getConstraintType()==ConstraintType::exclude) + if(constr->getConstraintType()==ConstraintType::Exclude) { for(auto &elem : constr->getExcludeElements()) { @@ -9151,31 +9151,31 @@ void DatabaseModel::setCodesInvalidated(vector types) } } -BaseObject *DatabaseModel::getObjectPgSQLType(PgSQLType type) +BaseObject *DatabaseModel::getObjectPgSQLType(PgSqlType type) { switch(type.getUserTypeConfig()) { - case UserTypeConfig::BASE_TYPE: + case UserTypeConfig::BaseType: return(this->getObject(*type, ObjectType::ObjType)); break; - case UserTypeConfig::DOMAIN_TYPE: + case UserTypeConfig::DomainType: return(this->getObject(*type, ObjectType::ObjDomain)); break; - case UserTypeConfig::TABLE_TYPE: + case UserTypeConfig::TableType: return(this->getObject(*type, ObjectType::ObjTable)); break; - case UserTypeConfig::VIEW_TYPE: + case UserTypeConfig::ViewType: return(this->getObject(*type, ObjectType::ObjView)); break; - case UserTypeConfig::SEQUENCE_TYPE: + case UserTypeConfig::SequenceType: return(this->getObject(*type, ObjectType::ObjSequence)); break; - case UserTypeConfig::EXTENSION_TYPE: + case UserTypeConfig::ExtensionType: return(this->getObject(*type, ObjectType::ObjExtension)); break; @@ -9217,9 +9217,9 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s /* Special case for tables. Need to make a dynamic_cast before the reinterpret_cast to get the correct reference to table */ if(obj->getObjectType()==ObjectType::ObjTable) - PgSQLType::renameUserType(prev_name, reinterpret_cast(dynamic_cast
(obj)), obj->getName(true)); + PgSqlType::renameUserType(prev_name, reinterpret_cast(dynamic_cast
(obj)), obj->getName(true)); else - PgSQLType::renameUserType(prev_name, reinterpret_cast(obj), obj->getName(true)); + PgSqlType::renameUserType(prev_name, reinterpret_cast(obj), obj->getName(true)); } //For graphical objects set them as modified to redraw them @@ -9235,7 +9235,7 @@ void DatabaseModel::createSystemObjects(bool create_public) Schema *public_sch=nullptr, *pg_catalog=nullptr; Language *lang=nullptr; Tablespace *tbspace=nullptr; - LanguageType lang_types[]={ LanguageType::c, LanguageType::sql, LanguageType::plpgsql, LanguageType::internal }; + LanguageType lang_types[]={ LanguageType::C, LanguageType::Sql, LanguageType::PlPgsql, LanguageType::Internal }; Role *postgres=nullptr; Collation *collation=nullptr; QString collnames[]={ "default", "C", "POSIX" }; diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 5cd2787f69..e255a873aa 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -161,7 +161,7 @@ class DatabaseModel: public QObject, public BaseObject { /*! \brief Returns the object on the model that represents the base pgsql type. The possible returned object can be: table, sequence, domain or type */ - BaseObject *getObjectPgSQLType(PgSQLType type); + BaseObject *getObjectPgSQLType(PgSqlType type); //! \brief Creates a IndexElement or ExcludeElement from XML depending on type of the 'elem' param. void createElement(Element &elem, TableObject *tab_obj, BaseObject *parent_obj); @@ -499,7 +499,7 @@ class DatabaseModel: public QObject, public BaseObject { void setBasicAttributes(BaseObject *object); void configureDatabase(attribs_map &attribs); - PgSQLType createPgSQLType(void); + PgSqlType createPgSQLType(void); BaseObject *createObject(ObjectType obj_type); Role *createRole(void); Tablespace *createTablespace(void); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 95c1888ae9..c22ac448a3 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -70,7 +70,7 @@ void Domain::setName(const QString &name) new_name=this->getName(true); //Renames the PostgreSQL type represented by the domain - PgSQLType::renameUserType(prev_name, this, new_name); + PgSqlType::renameUserType(prev_name, this, new_name); } void Domain::setSchema(BaseObject *schema) @@ -81,7 +81,7 @@ void Domain::setSchema(BaseObject *schema) BaseObject::setSchema(schema); //Renames the PostgreSQL type represented by the domain - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } void Domain::setDefaultValue(const QString &default_val) @@ -98,7 +98,7 @@ void Domain::setNotNull(bool value) not_null=value; } -void Domain::setType(PgSQLType type) +void Domain::setType(PgSqlType type) { setCodeInvalidated(this->type != type); this->type=type; @@ -114,7 +114,7 @@ bool Domain::isNotNull(void) return(not_null); } -PgSQLType Domain::getType(void) +PgSqlType Domain::getType(void) { return(type); } @@ -153,7 +153,7 @@ void Domain::operator = (Domain &domain) this->default_value=domain.default_value; this->type=domain.type; this->chk_constrs=domain.chk_constrs; - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } QString Domain::getAlterDefinition(BaseObject *object) diff --git a/libpgmodeler/src/domain.h b/libpgmodeler/src/domain.h index 8ca4b9e3b9..b1f5038e77 100644 --- a/libpgmodeler/src/domain.h +++ b/libpgmodeler/src/domain.h @@ -38,7 +38,7 @@ class Domain: public BaseObject{ bool not_null; //! \brief Domain data type - PgSQLType type; + PgSqlType type; //! \brief Store the check constraint expressions (key:name value:expression) attribs_map chk_constrs; @@ -59,7 +59,7 @@ class Domain: public BaseObject{ void setNotNull(bool value); //! \brief Defines the domain data type - void setType(PgSQLType type); + void setType(PgSqlType type); /*! \brief Overloaded BaseObject name definition method. Updates the reference of the domain as a PostgreSQL data type */ @@ -74,7 +74,7 @@ class Domain: public BaseObject{ QString getExpression(void); QString getDefaultValue(void); bool isNotNull(void); - PgSQLType getType(void); + PgSqlType getType(void); //! \brief Returns the SQL / XML code definition for the domain virtual QString getCodeDefinition(unsigned def_type) final; diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 253e377b3a..f4d2017f7d 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -50,7 +50,7 @@ void EventTrigger::setFunction(Function *func) .arg(BaseObject::getTypeName(ObjectType::ObjEventTrigger)), ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions coded in SQL lang. is not accepted by event triggers - else if(func->getLanguage()->getName()==~LanguageType(LanguageType::sql)) + else if(func->getLanguage()->getName()==~LanguageType(LanguageType::Sql)) throw Exception(ErrorCode::AsgEventTriggerFuncInvalidLang,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(function != func); diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 6f1ff9d901..9716621e52 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -22,7 +22,7 @@ void Extension::setName(const QString &name) new_name=this->getName(true); //Renames the PostgreSQL type represented by the extension - PgSQLType::renameUserType(prev_name, this, new_name); + PgSqlType::renameUserType(prev_name, this, new_name); } } @@ -40,7 +40,7 @@ void Extension::setSchema(BaseObject *schema) prev_name=this->getName(true); //Renames the PostgreSQL type represented by the extension - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } } } @@ -50,7 +50,7 @@ void Extension::setHandlesType(bool value) /* Raises an error if the extension is already registered as a data type and the try to change the attribute value. This cannot be done to avoid cascade reference breaking on table columns/functions or any other objects that references PgSQLType */ - if(!value && PgSQLType::getUserTypeIndex(this->getName(true), this) != BaseType::null) + if(!value && PgSqlType::getUserTypeIndex(this->getName(true), this) != BaseType::Null) throw Exception(Exception::getErrorMessage(ErrorCode::ExtensionHandlingTypeImmutable) .arg(this->getName(true)), ErrorCode::ExtensionHandlingTypeImmutable,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -143,5 +143,5 @@ void Extension::operator = (Extension &ext) this->handles_type=ext.handles_type; if(this->handles_type) - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index e3e202b9b2..357f2b0391 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -20,7 +20,7 @@ Function::Function(void) { - return_type=PgSQLType(QString("void")); + return_type=PgSqlType(QString("void")); language=nullptr; returns_setof=false; is_wnd_function=false; @@ -90,7 +90,7 @@ void Function::addParameter(Parameter param) createSignature(); } -void Function::addReturnedTableColumn(const QString &name, PgSQLType type) +void Function::addReturnedTableColumn(const QString &name, PgSqlType type) { //Raises an error if the column name is empty if(name.isEmpty()) @@ -193,7 +193,7 @@ void Function::setSymbol(const QString &symbol) this->symbol=symbol; } -void Function::setReturnType(PgSQLType type) +void Function::setReturnType(PgSqlType type) { setCodeInvalidated(return_type != type); return_type=type; @@ -259,7 +259,7 @@ void Function::setSourceCode(const QString &src_code) this->source_code=src_code; } -PgSQLType Function::getReturnType(void) +PgSqlType Function::getReturnType(void) { return(return_type); } @@ -369,7 +369,7 @@ void Function::removeReturnedTableColumns(void) setCodeInvalidated(true); } -void Function::removeParameter(const QString &name, PgSQLType type) +void Function::removeParameter(const QString &name, PgSqlType type) { vector::iterator itr,itr_end; @@ -484,7 +484,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[ParsersAttributes::BEHAVIOR_TYPE]=(~behavior_type); attributes[ParsersAttributes::DEFINITION]=source_code; - if(language->getName()==~LanguageType(LanguageType::c)) + if(language->getName()==~LanguageType(LanguageType::C)) { attributes[ParsersAttributes::SYMBOL]=symbol; attributes[ParsersAttributes::LIBRARY]=library; @@ -535,9 +535,9 @@ QString Function::getAlterDefinition(BaseObject *object) attribs[ParsersAttributes::SECURITY_TYPE]=~func->security_type; if((this->behavior_type!=func->behavior_type) && - ((this->behavior_type==BehaviorType::called_on_null_input) || - ((this->behavior_type==BehaviorType::strict || this->behavior_type==BehaviorType::returns_null_on_null_input) && - func->function_type==BehaviorType::called_on_null_input))) + ((this->behavior_type==BehaviorType::CalledOnNullInput) || + ((this->behavior_type==BehaviorType::Strict || this->behavior_type==BehaviorType::ReturnsNullOnNullInput) && + func->function_type==BehaviorType::CalledOnNullInput))) attribs[ParsersAttributes::BEHAVIOR_TYPE]=~func->behavior_type; } diff --git a/libpgmodeler/src/function.h b/libpgmodeler/src/function.h index 53930e5ff1..de04b9f50d 100644 --- a/libpgmodeler/src/function.h +++ b/libpgmodeler/src/function.h @@ -65,7 +65,7 @@ class Function: public BaseObject { FunctionType function_type; //! \brief Function return type - PgSQLType return_type; + PgSqlType return_type; /*! \brief Stores the table columns returned by the clause RETURNS TABLE. This clause instead of return a specific element returns a whole table. This structure is available @@ -100,7 +100,7 @@ class Function: public BaseObject { void addParameter(Parameter param); //! \brief Adds a column to the function returned table - void addReturnedTableColumn(const QString &name, PgSQLType type); + void addReturnedTableColumn(const QString &name, PgSqlType type); //! \brief Defines the function source code (if its not use the C language) void setSourceCode(const QString &src_code); @@ -136,7 +136,7 @@ class Function: public BaseObject { void setFunctionType(FunctionType func_type); //! \brief Defines the function return type - void setReturnType(PgSQLType type); + void setReturnType(PgSqlType type); //! \brief Defines the security type of the function void setSecurityType(SecurityType sec_type); @@ -184,7 +184,7 @@ class Function: public BaseObject { FunctionType getFunctionType(void); //! \brief Returns the function returned type - PgSQLType getReturnType(void); + PgSqlType getReturnType(void); //! \brief Returns the security type used by the function SecurityType getSecurityType(void); @@ -196,7 +196,7 @@ class Function: public BaseObject { unsigned getRowAmount(void); //! \brief Removes a parameter using its name and type - void removeParameter(const QString &name, PgSQLType type); + void removeParameter(const QString &name, PgSqlType type); //! \brief Removes a parameter using its index void removeParameter(unsigned param_idx); diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 808e50b1cb..09f9b98ee5 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -345,10 +345,10 @@ QString Index::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::SCHEMA]=getParentTable()->getSchema()->getName(true); } - if(this->indexing_type==IndexingType::gin) + if(this->indexing_type==IndexingType::Gin) attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::FAST_UPDATE]=(index_attribs[FastUpdate] ? ParsersAttributes::_TRUE_ : QString()); - if(this->indexing_type==IndexingType::gist) + if(this->indexing_type==IndexingType::Gist) attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::BUFFERING]=(index_attribs[Buffering] ? ParsersAttributes::_TRUE_ : QString()); if(/*this->indexing_type==IndexingType::btree && */fill_factor >= 10) @@ -392,11 +392,11 @@ QString Index::getAlterDefinition(BaseObject *object) if(this->fill_factor!=index->fill_factor && index->fill_factor >= 10) attribs[ParsersAttributes::FACTOR]=QString::number(index->fill_factor); - if(this->indexing_type==IndexingType::gin && + if(this->indexing_type==IndexingType::Gin && this->index_attribs[FastUpdate] != index->index_attribs[FastUpdate]) attribs[ParsersAttributes::FAST_UPDATE]=(index->index_attribs[FastUpdate] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); - if(this->indexing_type==IndexingType::gist && + if(this->indexing_type==IndexingType::Gist && this->index_attribs[Buffering] != index->index_attribs[Buffering]) attribs[ParsersAttributes::BUFFERING]=(index->index_attribs[Buffering] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); } @@ -412,7 +412,7 @@ QString Index::getAlterDefinition(BaseObject *object) void Index::validateElements(void) { - if(indexing_type!=IndexingType::btree) + if(indexing_type!=IndexingType::Btree) { for(unsigned i=0; i < idx_elements.size(); i++) { diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index dfe2df317b..2db8d17886 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -52,7 +52,7 @@ void Language::setTrusted(bool value) void Language::setFunction(Function *func, unsigned func_type) { - LanguageType lang=LanguageType::c; + LanguageType lang=LanguageType::C; if(!func || (func && diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 1ffcf228f1..4115c61013 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -799,7 +799,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) parent_tab->addObject(dynamic_cast(object), obj_idx); if(object->getObjectType()==ObjectType::ObjConstraint && - dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) + dynamic_cast(object)->getConstraintType()==ConstraintType::ForeignKey) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); } else if(parent_rel) @@ -844,7 +844,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) model->validateRelationships(dynamic_cast(object), dynamic_cast
(parent_tab)); if(object->getObjectType()==ObjectType::ObjConstraint && - dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) + dynamic_cast(object)->getConstraintType()==ConstraintType::ForeignKey) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); } } diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index f484b24d61..cf4adaaf7c 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -31,8 +31,8 @@ Operator::Operator(void) operators[i]=nullptr; hashes=merges=false; - argument_types[LEFT_ARG]=PgSQLType(QString("\"any\"")); - argument_types[RIGHT_ARG]=PgSQLType(QString("\"any\"")); + argument_types[LEFT_ARG]=PgSqlType(QString("\"any\"")); + argument_types[RIGHT_ARG]=PgSqlType(QString("\"any\"")); attributes[ParsersAttributes::LEFT_TYPE]=QString(); attributes[ParsersAttributes::RIGHT_TYPE]=QString(); @@ -112,7 +112,7 @@ void Operator::setFunction(Function *func, unsigned func_type) else { unsigned param_count=func->getParameterCount(); - PgSQLType param_type1=PgSQLType(QString("\"any\"")), param_type2=PgSQLType(QString("\"any\"")); + PgSqlType param_type1=PgSqlType(QString("\"any\"")), param_type2=PgSqlType(QString("\"any\"")); //Get the function parameter to make validations param_type1=func->getParameter(0).getType(); @@ -151,7 +151,7 @@ void Operator::setFunction(Function *func, unsigned func_type) functions[func_type]=func; } -void Operator::setArgumentType(PgSQLType arg_type, unsigned arg_id) +void Operator::setArgumentType(PgSqlType arg_type, unsigned arg_id) { //Raises an error if the argument id is invalid if(arg_id > RIGHT_ARG) @@ -222,7 +222,7 @@ Function *Operator::getFunction(unsigned func_type) return(functions[func_type]); } -PgSQLType Operator::getArgumentType(unsigned arg_id) +PgSqlType Operator::getArgumentType(unsigned arg_id) { //Raises an error if the argument id is invalid if(arg_id > RIGHT_ARG) diff --git a/libpgmodeler/src/operator.h b/libpgmodeler/src/operator.h index 3807b602c2..345c797906 100644 --- a/libpgmodeler/src/operator.h +++ b/libpgmodeler/src/operator.h @@ -36,7 +36,7 @@ class Operator: public BaseObject { Function *functions[3]; //! \brief Stores the arguments types (left and right) used by the operator - PgSQLType argument_types[2]; + PgSqlType argument_types[2]; //! \brief Stores the auxiliary operators Operator *operators[2]; @@ -62,7 +62,7 @@ class Operator: public BaseObject { void setFunction(Function *func, unsigned func_type); //! \brief Defines the argument data type for operator (constants ARG_[LEFT | RIGHT]) - void setArgumentType(PgSQLType arg_type, unsigned arg_id); + void setArgumentType(PgSqlType arg_type, unsigned arg_id); //! \brief Defines the auxiliary operators (constants OPER_[COMMUTATOR | NEGATOR]) void setOperator(Operator *oper, unsigned op_type); @@ -77,7 +77,7 @@ class Operator: public BaseObject { Function *getFunction(unsigned func_type); //! \brief Returns the type of the passed argument id - PgSQLType getArgumentType(unsigned arg_id); + PgSqlType getArgumentType(unsigned arg_id); //! \brief Returns on of the auxiliary operators Operator *getOperator(unsigned op_type); diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index a2acd6bcef..858f772c41 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -35,10 +35,10 @@ OperatorClass::~OperatorClass(void) elements.clear(); } -void OperatorClass::setDataType(PgSQLType data_type) +void OperatorClass::setDataType(PgSqlType data_type) { //A null datatype is not accepted by the operator class - if(data_type==PgSQLType::null) + if(data_type==PgSqlType::Null) throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->data_type != data_type); @@ -141,7 +141,7 @@ unsigned OperatorClass::getElementCount(void) return(elements.size()); } -PgSQLType OperatorClass::getDataType(void) +PgSqlType OperatorClass::getDataType(void) { return(data_type); } diff --git a/libpgmodeler/src/operatorclass.h b/libpgmodeler/src/operatorclass.h index f2b89625dd..eb049fa0f9 100644 --- a/libpgmodeler/src/operatorclass.h +++ b/libpgmodeler/src/operatorclass.h @@ -35,7 +35,7 @@ can be used in a particular indexing method. class OperatorClass: public BaseObject { private: //! \brief Data type witch the operator class acts on - PgSQLType data_type; + PgSqlType data_type; //! \brief Operator family that the operator class is part OperatorFamily *family; @@ -59,7 +59,7 @@ class OperatorClass: public BaseObject { ~OperatorClass(void); //! \brief Sets the data type that the operator class works on - void setDataType(PgSQLType data_type); + void setDataType(PgSqlType data_type); //! \brief Sets the operator family that the operator class is part void setFamily(OperatorFamily *family); @@ -78,7 +78,7 @@ class OperatorClass: public BaseObject { void removeElements(void); //! \brief Methods used to obtain the class attributes - PgSQLType getDataType(void); + PgSqlType getDataType(void); OperatorFamily *getFamily(void); IndexingType getIndexingType(void); bool isDefault(void); diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 84fe1bd2fc..1de019ccdb 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -70,14 +70,14 @@ void OperatorClassElement::setOperatorFamily(OperatorFamily *op_family) { if(this->element_type==OperatorElem) { - if(op_family && op_family->getIndexingType()!=IndexingType::btree) + if(op_family && op_family->getIndexingType()!=IndexingType::Btree) throw Exception(ErrorCode::AsgInvalidOpFamilyOpClassElem,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->op_family=op_family; } } -void OperatorClassElement::setStorage(PgSQLType storage) +void OperatorClassElement::setStorage(PgSqlType storage) { //Clear the attributes not related to the STORAGE element type this->function=nullptr; @@ -110,7 +110,7 @@ OperatorFamily *OperatorClassElement::getOperatorFamily(void) return(op_family); } -PgSQLType OperatorClassElement::getStorage(void) +PgSqlType OperatorClassElement::getStorage(void) { return(storage); } @@ -164,7 +164,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::DEFINITION]+=op_family->getCodeDefinition(def_type,true); } } - else if(element_type==StorageElem && storage!=PgSQLType::null) + else if(element_type==StorageElem && storage!=PgSqlType::Null) { //STORAGE storage_type attributes[ParsersAttributes::STORAGE]=ParsersAttributes::_TRUE_; diff --git a/libpgmodeler/src/operatorclasselement.h b/libpgmodeler/src/operatorclasselement.h index e64fd8756a..b73ae9888f 100644 --- a/libpgmodeler/src/operatorclasselement.h +++ b/libpgmodeler/src/operatorclasselement.h @@ -52,7 +52,7 @@ class OperatorClassElement { /*! \brief PostgreSQL type used in the indexing method of operator class. (only for type STORAGE_ELEM) */ - PgSQLType storage; + PgSqlType storage; /*! \brief Strategy number (or support number for functions). This attribute must have a value greater than 0 (only for OPERATOR_ELEM and FUNCTION_ELEM) */ @@ -77,7 +77,7 @@ class OperatorClassElement { void setOperatorFamily(OperatorFamily *op_family); //! \brief Defines the element as a storage clause - void setStorage(PgSQLType storage); + void setStorage(PgSqlType storage); //! \brief Returns the element type unsigned getElementType(void); @@ -95,7 +95,7 @@ class OperatorClassElement { OperatorFamily *getOperatorFamily(void); //! \brief Storage type of the element - PgSQLType getStorage(void); + PgSqlType getStorage(void); //! \brief Returns the strategy (support) number of the element unsigned getStrategyNumber(void); diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index d1808f4cff..4e9c5378f3 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -24,7 +24,7 @@ Parameter::Parameter(void) is_in=is_out=is_variadic=false; } -void Parameter::setType(PgSQLType type) +void Parameter::setType(PgSqlType type) { if(!type.isArrayType() && !type.isPolymorphicType() && is_variadic) throw Exception(ErrorCode::InvUsageVariadicParamMode ,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/parameter.h b/libpgmodeler/src/parameter.h index 36d7e3c903..71747d598d 100644 --- a/libpgmodeler/src/parameter.h +++ b/libpgmodeler/src/parameter.h @@ -35,7 +35,7 @@ class Parameter: public Column { public: Parameter(void); - void setType(PgSQLType type); + void setType(PgSqlType type); void setIn(bool value); void setOut(bool value); void setVariadic(bool value); diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index a1adf2c2bc..00056dcd62 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -21,7 +21,7 @@ /******************** * CLASS: BaseType * ********************/ -QString BaseType::type_list[types_count]= +QString BaseType::type_list[BaseType::TypesCount]= { /* Tipo vazio, quando se instância a classe TipoBase ao usar o operador ~ este será o único tipo retornado */ @@ -252,12 +252,12 @@ QString BaseType::type_list[types_count]= BaseType::BaseType(void) { - type_idx=BaseType::null; + type_idx=BaseType::Null; } QString BaseType::getTypeString(unsigned type_id) { - if(type_id > types_count) + if(type_id > TypesCount) throw Exception(ErrorCode::RefTypeInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type_list[type_id]); @@ -266,7 +266,7 @@ QString BaseType::getTypeString(unsigned type_id) void BaseType::setType(unsigned type_id,unsigned offset,unsigned count) { //Raises an error if the type count is invalid - if(count==0 || count > this->types_count) + if(count==0 || count > this->TypesCount) throw Exception(ErrorCode::ObtTypesInvalidQuantity,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the type id is invalid else if(!isTypeValid(type_id,offset,count)) @@ -278,13 +278,13 @@ void BaseType::setType(unsigned type_id,unsigned offset,unsigned count) bool BaseType::isTypeValid(unsigned type_id,unsigned offset,unsigned count) { //Returns if the type id is valid according to the specified interval (offset-count) - return((type_id>=offset && type_id<=(offset+count-1)) || type_id==BaseType::null); + return((type_id>=offset && type_id<=(offset+count-1)) || type_id==BaseType::Null); } void BaseType::getTypes(QStringList &types,unsigned offset,unsigned count) { //Raises an error if the type count is invalid - if(count==0 || count > BaseType::types_count) + if(count==0 || count > BaseType::TypesCount) throw Exception(ErrorCode::ObtTypesInvalidQuantity,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -304,7 +304,7 @@ unsigned BaseType::getType(const QString &type_name,unsigned offset,unsigned cou bool found=false; if(type_name.isEmpty()) - return(BaseType::null); + return(BaseType::Null); else { QString aux_name, tp_name=type_name; @@ -322,7 +322,7 @@ unsigned BaseType::getType(const QString &type_name,unsigned offset,unsigned cou if(found) { idx--; return(idx); } else - return(BaseType::null); + return(BaseType::Null); } } @@ -381,17 +381,17 @@ ActionType::ActionType(const QString &type_name) ActionType::ActionType(void) { - type_idx=offset; + type_idx=Offset; } void ActionType::getTypes(QStringList &type_list) { - BaseType::getTypes(type_list,offset,types_count); + BaseType::getTypes(type_list,Offset,TypesCount); } unsigned ActionType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -399,8 +399,8 @@ unsigned ActionType::operator = (const QString &type_name) { unsigned type_idx; - type_idx=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_idx,offset,types_count); + type_idx=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_idx,Offset,TypesCount); return(type_idx); } @@ -419,17 +419,17 @@ ConstraintType::ConstraintType(const QString &type_name) ConstraintType::ConstraintType(void) { - type_idx=offset; + type_idx=Offset; } void ConstraintType::getTypes(QStringList &type_list) { - BaseType::getTypes(type_list,offset,types_count); + BaseType::getTypes(type_list,Offset,TypesCount); } unsigned ConstraintType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -437,8 +437,8 @@ unsigned ConstraintType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -447,7 +447,7 @@ unsigned ConstraintType::operator = (const QString &type_name) ********************/ EventType::EventType(void) { - type_idx=offset; + type_idx=Offset; } EventType::EventType(const QString &type_name) @@ -462,12 +462,12 @@ EventType::EventType(unsigned type_id) void EventType::getTypes(QStringList &type_list) { - BaseType::getTypes(type_list,offset,types_count); + BaseType::getTypes(type_list,Offset,TypesCount); } unsigned EventType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -475,8 +475,8 @@ unsigned EventType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -495,7 +495,7 @@ bool EventType::operator < (unsigned type_id) const ************************/ ExecutionType::ExecutionType(void) { - type_idx=offset; + type_idx=Offset; } ExecutionType::ExecutionType(unsigned type_id) @@ -510,12 +510,12 @@ ExecutionType::ExecutionType(const QString &type_name) void ExecutionType::getTypes(QStringList &type_list) { - BaseType::getTypes(type_list,offset,types_count); + BaseType::getTypes(type_list,Offset,TypesCount); } unsigned ExecutionType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -523,8 +523,8 @@ unsigned ExecutionType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -538,7 +538,7 @@ FunctionType::FunctionType(unsigned type_id) FunctionType::FunctionType(void) { - type_idx=offset; + type_idx=Offset; } FunctionType::FunctionType(const QString &type_name) @@ -548,12 +548,12 @@ FunctionType::FunctionType(const QString &type_name) void FunctionType::getTypes(QStringList &tipos) { - BaseType::getTypes(tipos,offset,types_count); + BaseType::getTypes(tipos,Offset,TypesCount); } unsigned FunctionType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -561,8 +561,8 @@ unsigned FunctionType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -576,7 +576,7 @@ IndexingType::IndexingType(unsigned type_id) IndexingType::IndexingType(void) { - type_idx=offset; + type_idx=Offset; } IndexingType::IndexingType(const QString &type_name) @@ -586,12 +586,12 @@ IndexingType::IndexingType(const QString &type_name) void IndexingType::getTypes(QStringList &type_list) { - BaseType::getTypes(type_list,offset,types_count); + BaseType::getTypes(type_list,Offset,TypesCount); } unsigned IndexingType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -599,8 +599,8 @@ unsigned IndexingType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -614,7 +614,7 @@ IntervalType::IntervalType(unsigned type_id) IntervalType::IntervalType(void) { - type_idx=BaseType::null; + type_idx=BaseType::Null; } IntervalType::IntervalType(const QString &type_name) @@ -624,12 +624,12 @@ IntervalType::IntervalType(const QString &type_name) void IntervalType::getTypes(QStringList &type_list) { - BaseType::getTypes(type_list,offset,types_count); + BaseType::getTypes(type_list,Offset,TypesCount); } unsigned IntervalType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -637,8 +637,8 @@ unsigned IntervalType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -651,44 +651,44 @@ SpatialType::SpatialType(const QString &type_name, int srid, unsigned variation_ if(name.endsWith(QString("ZM"))) { - variation_id=var_zm; + variation_id=VarZm; name.remove(QString("ZM")); } else if(name.endsWith(QString("M"))) { - variation_id=var_m; + variation_id=VarM; name.remove(QString("M")); } else if(name.endsWith(QString("Z"))) { - variation_id=var_z; + variation_id=VarZ; name.remove(QString("Z")); } - BaseType::setType(BaseType::getType(name, offset, types_count), - offset, types_count); + BaseType::setType(BaseType::getType(name, Offset, TypesCount), + Offset, TypesCount); setVariation(variation_id); setSRID(srid); } SpatialType::SpatialType(unsigned type_id, int srid, unsigned var_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); setVariation(var_id); setSRID(srid); } SpatialType::SpatialType(void) { - type_idx=BaseType::null; - variation=no_var; + type_idx=BaseType::Null; + variation=NoVar; srid=0; } void SpatialType::setVariation(unsigned var) { - if(var > var_zm) - variation=var_zm; + if(var > VarZm) + variation=VarZm; else variation=var; } @@ -700,7 +700,7 @@ unsigned SpatialType::getVariation(void) void SpatialType::getTypes(QStringList &type_list) { - BaseType::getTypes(type_list,offset,types_count); + BaseType::getTypes(type_list,Offset,TypesCount); } void SpatialType::setSRID(int srid) @@ -716,15 +716,15 @@ int SpatialType::getSRID(void) QString SpatialType::operator * (void) { - if(this->type_idx!=BaseType::null) + if(this->type_idx!=BaseType::Null) { QString var_str; switch(variation) { - case var_z: var_str+=QString("Z"); break; - case var_m: var_str+=QString("M"); break; - case var_zm: var_str+=QString("ZM"); break; + case VarZ: var_str+=QString("Z"); break; + case VarM: var_str+=QString("M"); break; + case VarZm: var_str+=QString("ZM"); break; default: var_str=QString(); break; } @@ -740,28 +740,28 @@ QString SpatialType::operator * (void) /******************** * CLASS: PgSQLType * ********************/ -vector PgSQLType::user_types; +vector PgSqlType::user_types; -PgSQLType::PgSQLType(void) +PgSqlType::PgSqlType(void) { - type_idx=offset; + type_idx=Offset; length=0; precision=-1; dimension=0; with_timezone=false; } -PgSQLType::PgSQLType(const QString &type_name) : PgSQLType() +PgSqlType::PgSqlType(const QString &type_name) : PgSqlType() { (*this)=type_name; } -PgSQLType::PgSQLType(void *ptype) : PgSQLType() +PgSqlType::PgSqlType(void *ptype) : PgSqlType() { (*this) << ptype; } -PgSQLType::PgSQLType(void *ptype, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSQLType() +PgSqlType::PgSqlType(void *ptype, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() { (*this) << ptype; setLength(length); @@ -772,7 +772,7 @@ PgSQLType::PgSQLType(void *ptype, unsigned length, unsigned dimension, int preci setSpatialType(spatial_type); } -PgSQLType::PgSQLType(const QString &type_name, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSQLType() +PgSqlType::PgSqlType(const QString &type_name, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() { (*this)=type_name; setLength(length); @@ -783,7 +783,7 @@ PgSQLType::PgSQLType(const QString &type_name, unsigned length, unsigned dimensi setSpatialType(spatial_type); } -PgSQLType::PgSQLType(unsigned type_id, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSQLType() +PgSqlType::PgSqlType(unsigned type_id, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() { (*this)=type_id; setLength(length); @@ -794,7 +794,7 @@ PgSQLType::PgSQLType(unsigned type_id, unsigned length, unsigned dimension, int setSpatialType(spatial_type); } -PgSQLType PgSQLType::parseString(const QString &str) +PgSqlType PgSqlType::parseString(const QString &str) { QString type_str=str.toLower().simplified(), sptype, interv; bool with_tz=false; @@ -802,7 +802,7 @@ PgSQLType PgSQLType::parseString(const QString &str) int prec=-1, len = -1; int start=-1, end=-1; QStringList value, intervals; - PgSQLType type; + PgSqlType type; //Checking if the string contains one of interval types IntervalType::getTypes(intervals); @@ -873,7 +873,7 @@ PgSQLType PgSQLType::parseString(const QString &str) try { //Creates the type based on the extracted values - type=PgSQLType(type_str); + type=PgSqlType(type_str); } catch(Exception &) { @@ -882,12 +882,12 @@ PgSQLType PgSQLType::parseString(const QString &str) QStringList typname=type_str.split('.'); if(typname.size()==2) - type=PgSQLType(typname[1]); + type=PgSqlType(typname[1]); else { /* One last try it to check if the type has an entry on user defined types as pg_catalog.[type name] */ - type=PgSQLType(QString("pg_catalog.") + type_str); + type=PgSqlType(QString("pg_catalog.") + type_str); } } @@ -917,35 +917,35 @@ PgSQLType PgSQLType::parseString(const QString &str) } } -void PgSQLType::getTypes(QStringList &type_list, bool oids, bool pseudos) +void PgSqlType::getTypes(QStringList &type_list, bool oids, bool pseudos) { unsigned idx,total; type_list.clear(); - total=offset+types_count; + total=Offset+TypesCount; - for(idx=offset; idx=oid_start && idx<=oid_end) || - (pseudos && idx>=pseudo_start && idx<=pseudo_end)) + if(idx=OidStart && idx<=OidEnd) || + (pseudos && idx>=PseudoStart && idx<=PseudoEnd)) type_list.push_back(BaseType::type_list[idx]); } } -unsigned PgSQLType::operator = (unsigned type_id) +unsigned PgSqlType::operator = (unsigned type_id) { - if(type_id>=offset) + if(type_id>=Offset) setUserType(type_id); else if(type_id > 0) - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); else if(type_id==0) throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(type_idx); } -unsigned PgSQLType::operator = (const QString &type_name) +unsigned PgSqlType::operator = (const QString &type_name) { unsigned type_idx, usr_type_idx; @@ -956,7 +956,7 @@ unsigned PgSQLType::operator = (const QString &type_name) throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(type_idx!=0) { - BaseType::setType(type_idx,offset,types_count); + BaseType::setType(type_idx,Offset,TypesCount); return(type_idx); } else @@ -966,28 +966,28 @@ unsigned PgSQLType::operator = (const QString &type_name) } } -void *PgSQLType::getUserTypeReference(void) +void *PgSqlType::getUserTypeReference(void) { if(this->isUserType()) - return(user_types[this->type_idx - (pseudo_end + 1)].ptype); + return(user_types[this->type_idx - (PseudoEnd + 1)].ptype); else return(nullptr); } -unsigned PgSQLType::getUserTypeConfig(void) +unsigned PgSqlType::getUserTypeConfig(void) { if(this->isUserType()) - return(user_types[this->type_idx - (pseudo_end + 1)].type_conf); + return(user_types[this->type_idx - (PseudoEnd + 1)].type_conf); else return(0); } -unsigned PgSQLType::getTypeId(void) +unsigned PgSqlType::getTypeId(void) { return(!(*this)); } -QString PgSQLType::getTypeName(bool incl_dimension) +QString PgSqlType::getTypeName(bool incl_dimension) { if(incl_dimension) { @@ -1004,32 +1004,32 @@ QString PgSQLType::getTypeName(bool incl_dimension) return(~(*this)); } -QString PgSQLType::getSQLTypeName(void) +QString PgSqlType::getSQLTypeName(void) { return(*(*this)); } -bool PgSQLType::isRegistered(const QString &type, void *pmodel) +bool PgSqlType::isRegistered(const QString &type, void *pmodel) { - if(getBaseTypeIndex(type)!=BaseType::null) + if(getBaseTypeIndex(type)!=BaseType::Null) return(true); else - return(getUserTypeIndex(type, nullptr, pmodel)!=BaseType::null); + return(getUserTypeIndex(type, nullptr, pmodel)!=BaseType::Null); } -bool PgSQLType::operator == (unsigned type_id) +bool PgSqlType::operator == (unsigned type_id) { return(this->type_idx==type_id); } -bool PgSQLType::operator == (const QString &type_name) +bool PgSqlType::operator == (const QString &type_name) { unsigned idx,total; bool found=false; - total=offset + types_count; + total=Offset + TypesCount; - for(idx=offset; idxtype_idx!=type.type_idx); } -bool PgSQLType::operator != (unsigned type_id) +bool PgSqlType::operator != (unsigned type_id) { return(this->type_idx!=type_id); } -bool PgSQLType::operator == (PgSQLType type) +bool PgSqlType::operator == (PgSqlType type) { return(this->type_idx==type.type_idx); } -bool PgSQLType::operator == (void *ptype) +bool PgSqlType::operator == (void *ptype) { int idx; idx=getUserTypeIndex(QString(),ptype); return(static_cast(type_idx) == idx); } -IntervalType PgSQLType::getIntervalType(void) +IntervalType PgSqlType::getIntervalType(void) { return(interval_type); } -SpatialType PgSQLType::getSpatialType(void) +SpatialType PgSqlType::getSpatialType(void) { return(spatial_type); } -bool PgSQLType::isWithTimezone(void) +bool PgSqlType::isWithTimezone(void) { return(with_timezone); } -bool PgSQLType::isOIDType(void) +bool PgSqlType::isOIDType(void) { - return(type_idx>=oid_start && type_idx<=oid_end); + return(type_idx>=OidStart && type_idx<=OidEnd); } -bool PgSQLType::isPseudoType(void) +bool PgSqlType::isPseudoType(void) { - return(type_idx>=pseudo_start && type_idx<=pseudo_end); + return(type_idx>=PseudoStart && type_idx<=PseudoEnd); } -unsigned PgSQLType::operator << (void *ptype) +unsigned PgSqlType::operator << (void *ptype) { setUserType(ptype); return(type_idx); } -void PgSQLType::setIntervalType(IntervalType interv_type) +void PgSqlType::setIntervalType(IntervalType interv_type) { interval_type=interv_type; } -void PgSQLType::setSpatialType(SpatialType spat_type) +void PgSqlType::setSpatialType(SpatialType spat_type) { spatial_type=spat_type; } -void PgSQLType::setWithTimezone(bool with_tz) +void PgSqlType::setWithTimezone(bool with_tz) { this->with_timezone=with_tz; } -void PgSQLType::setUserType(unsigned type_id) +void PgSqlType::setUserType(unsigned type_id) { unsigned lim1, lim2; - lim1=pseudo_end + 1; - lim2=lim1 + PgSQLType::user_types.size(); + lim1=PseudoEnd + 1; + lim2=lim1 + PgSqlType::user_types.size(); - if(PgSQLType::user_types.size() > 0 && + if(PgSqlType::user_types.size() > 0 && (type_id >= lim1 && type_id < lim2)) type_idx=type_id; else throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } -void PgSQLType::setUserType(void *ptype) +void PgSqlType::setUserType(void *ptype) { int idx; @@ -1135,15 +1135,15 @@ void PgSQLType::setUserType(void *ptype) type_idx=idx; } -void PgSQLType::addUserType(const QString &type_name, void *ptype, void *pmodel, unsigned type_conf) +void PgSqlType::addUserType(const QString &type_name, void *ptype, void *pmodel, unsigned type_conf) { if(!type_name.isEmpty() && ptype && pmodel && - (type_conf==UserTypeConfig::DOMAIN_TYPE || - type_conf==UserTypeConfig::SEQUENCE_TYPE || - type_conf==UserTypeConfig::TABLE_TYPE || - type_conf==UserTypeConfig::VIEW_TYPE || - type_conf==UserTypeConfig::EXTENSION_TYPE || - type_conf==UserTypeConfig::BASE_TYPE) && + (type_conf==UserTypeConfig::DomainType || + type_conf==UserTypeConfig::SequenceType || + type_conf==UserTypeConfig::TableType || + type_conf==UserTypeConfig::ViewType || + type_conf==UserTypeConfig::ExtensionType || + type_conf==UserTypeConfig::BaseType) && getUserTypeIndex(type_name,ptype,pmodel)==0) { UserTypeConfig cfg; @@ -1152,19 +1152,19 @@ void PgSQLType::addUserType(const QString &type_name, void *ptype, void *pmodel, cfg.ptype=ptype; cfg.pmodel=pmodel; cfg.type_conf=type_conf; - PgSQLType::user_types.push_back(cfg); + PgSqlType::user_types.push_back(cfg); } } -void PgSQLType::removeUserType(const QString &type_name, void *ptype) +void PgSqlType::removeUserType(const QString &type_name, void *ptype) { - if(PgSQLType::user_types.size() > 0 && + if(PgSqlType::user_types.size() > 0 && !type_name.isEmpty() && ptype) { vector::iterator itr, itr_end; - itr=PgSQLType::user_types.begin(); - itr_end=PgSQLType::user_types.end(); + itr=PgSqlType::user_types.begin(); + itr_end=PgSqlType::user_types.end(); while(itr!=itr_end) { @@ -1181,15 +1181,15 @@ void PgSQLType::removeUserType(const QString &type_name, void *ptype) } } -void PgSQLType::renameUserType(const QString &type_name, void *ptype,const QString &new_name) +void PgSqlType::renameUserType(const QString &type_name, void *ptype,const QString &new_name) { - if(PgSQLType::user_types.size() > 0 && + if(PgSqlType::user_types.size() > 0 && !type_name.isEmpty() && ptype && type_name!=new_name) { vector::iterator itr, itr_end; - itr=PgSQLType::user_types.begin(); - itr_end=PgSQLType::user_types.end(); + itr=PgSqlType::user_types.begin(); + itr_end=PgSqlType::user_types.end(); while(itr!=itr_end) { @@ -1203,7 +1203,7 @@ void PgSQLType::renameUserType(const QString &type_name, void *ptype,const QStri } } -void PgSQLType::removeUserTypes(void *pmodel) +void PgSqlType::removeUserTypes(void *pmodel) { if(pmodel) { @@ -1227,25 +1227,25 @@ void PgSQLType::removeUserTypes(void *pmodel) } } -unsigned PgSQLType::getBaseTypeIndex(const QString &type_name) +unsigned PgSqlType::getBaseTypeIndex(const QString &type_name) { QString aux_name=type_name; aux_name.remove(QString("[]")); aux_name.remove(QRegExp(QString("( )(with)(out)?(.)*"))); aux_name=aux_name.trimmed(); - return(getType(aux_name,offset,types_count)); + return(getType(aux_name,Offset,TypesCount)); } -unsigned PgSQLType::getUserTypeIndex(const QString &type_name, void *ptype, void *pmodel) +unsigned PgSqlType::getUserTypeIndex(const QString &type_name, void *ptype, void *pmodel) { - if(PgSQLType::user_types.size() > 0 && (!type_name.isEmpty() || ptype)) + if(PgSqlType::user_types.size() > 0 && (!type_name.isEmpty() || ptype)) { vector::iterator itr, itr_end; int idx=0; - itr=PgSQLType::user_types.begin(); - itr_end=PgSQLType::user_types.end(); + itr=PgSqlType::user_types.begin(); + itr_end=PgSqlType::user_types.end(); while(itr!=itr_end) { @@ -1259,34 +1259,34 @@ unsigned PgSQLType::getUserTypeIndex(const QString &type_name, void *ptype, void } if(itr!=itr_end) - return(pseudo_end + 1 + idx); + return(PseudoEnd + 1 + idx); else - return(BaseType::null); + return(BaseType::Null); } - else return(BaseType::null); + else return(BaseType::Null); } -QString PgSQLType::getUserTypeName(unsigned type_id) +QString PgSqlType::getUserTypeName(unsigned type_id) { unsigned lim1, lim2; - lim1=pseudo_end + 1; - lim2=lim1 + PgSQLType::user_types.size(); + lim1=PseudoEnd + 1; + lim2=lim1 + PgSqlType::user_types.size(); - if(PgSQLType::user_types.size() > 0 && + if(PgSqlType::user_types.size() > 0 && (type_id >= lim1 && type_id < lim2)) - return(PgSQLType::user_types[type_id - lim1].name); + return(PgSqlType::user_types[type_id - lim1].name); else return(QString()); } -void PgSQLType::getUserTypes(QStringList &type_list, void *pmodel, unsigned inc_usr_types) +void PgSqlType::getUserTypes(QStringList &type_list, void *pmodel, unsigned inc_usr_types) { unsigned idx,total; type_list.clear(); - total=PgSQLType::user_types.size(); + total=PgSqlType::user_types.size(); for(idx=0; idx < total; idx++) { @@ -1297,12 +1297,12 @@ void PgSQLType::getUserTypes(QStringList &type_list, void *pmodel, unsigned inc_ } } -void PgSQLType::getUserTypes(vector &ptypes, void *pmodel, unsigned inc_usr_types) +void PgSqlType::getUserTypes(vector &ptypes, void *pmodel, unsigned inc_usr_types) { unsigned idx, total; ptypes.clear(); - total=PgSQLType::user_types.size(); + total=PgSqlType::user_types.size(); for(idx=0; idx < total; idx++) { @@ -1313,10 +1313,10 @@ void PgSQLType::getUserTypes(vector &ptypes, void *pmodel, unsigned inc_ } } -QString PgSQLType::operator ~ (void) +QString PgSqlType::operator ~ (void) { - if(type_idx >= pseudo_end + 1) - return(user_types[type_idx - (pseudo_end + 1)].name); + if(type_idx >= PseudoEnd + 1) + return(user_types[type_idx - (PseudoEnd + 1)].name); else { QString name=BaseType::type_list[type_idx]; @@ -1328,17 +1328,17 @@ QString PgSQLType::operator ~ (void) } } -bool PgSQLType::isArrayType(void) +bool PgSqlType::isArrayType(void) { return(dimension > 0); } -bool PgSQLType::isUserType(void) +bool PgSqlType::isUserType(void) { - return(type_idx > pseudo_end); + return(type_idx > PseudoEnd); } -bool PgSQLType::isNetworkType(void) +bool PgSqlType::isNetworkType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1347,7 +1347,7 @@ bool PgSQLType::isNetworkType(void) curr_type==QString("inet"))); } -bool PgSQLType::isGiSType(void) +bool PgSqlType::isGiSType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1357,7 +1357,7 @@ bool PgSQLType::isGiSType(void) curr_type==QString("geometry_dump"))); } -bool PgSQLType::isRangeType(void) +bool PgSqlType::isRangeType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1367,7 +1367,7 @@ bool PgSQLType::isRangeType(void) curr_type==QString("tstzrange") || curr_type==QString("daterange"))); } -bool PgSQLType::isSerialType(void) +bool PgSqlType::isSerialType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1377,7 +1377,7 @@ bool PgSQLType::isSerialType(void) curr_type==QString("bigserial"))); } -bool PgSQLType::isDateTimeType(void) +bool PgSqlType::isDateTimeType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1387,7 +1387,7 @@ bool PgSQLType::isDateTimeType(void) curr_type==QString("timetz") || curr_type==QString("timestamptz"))); } -bool PgSQLType::isNumericType(void) +bool PgSqlType::isNumericType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1395,7 +1395,7 @@ bool PgSQLType::isNumericType(void) (curr_type==QString("numeric") || curr_type==QString("decimal"))); } -bool PgSQLType::isIntegerType(void) +bool PgSqlType::isIntegerType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1405,7 +1405,7 @@ bool PgSQLType::isIntegerType(void) curr_type==QString("int8") || curr_type==QString("int2"))); } -bool PgSQLType::hasVariableLength(void) +bool PgSqlType::hasVariableLength(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1417,7 +1417,7 @@ bool PgSQLType::hasVariableLength(void) curr_type==QString("varbit"))); } -bool PgSQLType::isCharacterType(void) +bool PgSqlType::isCharacterType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1426,7 +1426,7 @@ bool PgSQLType::isCharacterType(void) curr_type==QString("character varying") || curr_type==QString("text")); } -bool PgSQLType::isPolymorphicType(void) +bool PgSqlType::isPolymorphicType(void) { QString curr_type=(!isUserType() ? type_list[this->type_idx] : QString()); @@ -1435,13 +1435,13 @@ bool PgSQLType::isPolymorphicType(void) curr_type==QString("anyrange") || curr_type==QString("\"any\"")); } -bool PgSQLType::acceptsPrecision(void) +bool PgSqlType::acceptsPrecision(void) { return(isNumericType() || (!isUserType() && type_list[this->type_idx]!=QString("date") && isDateTimeType())); } -bool PgSQLType::canCastTo(PgSQLType type) +bool PgSqlType::canCastTo(PgSqlType type) { // If the types are the same of belongs to the same category they naturally can be casted if(this->type_idx==type.type_idx || @@ -1471,7 +1471,7 @@ bool PgSQLType::canCastTo(PgSQLType type) return(false); } -bool PgSQLType::isEquivalentTo(PgSQLType type) +bool PgSqlType::isEquivalentTo(PgSqlType type) { unsigned this_idx=0, type_idx=0; static vector types={{QString("int2"),QString("smallint")}, @@ -1510,43 +1510,43 @@ bool PgSQLType::isEquivalentTo(PgSQLType type) this->isArrayType()==type.isArrayType()); } -PgSQLType PgSQLType::getAliasType(void) +PgSqlType PgSqlType::getAliasType(void) { if(!isUserType()) { if(type_list[this->type_idx]==QString("serial")) - return(PgSQLType(QString("integer"))); + return(PgSqlType(QString("integer"))); else if(type_list[this->type_idx]==QString("smallserial")) - return(PgSQLType(QString("smallint"))); + return(PgSqlType(QString("smallint"))); else if(type_list[this->type_idx]==QString("bigserial")) - return(PgSQLType(QString("bigint"))); + return(PgSqlType(QString("bigint"))); else - return(PgSQLType(type_list[this->type_idx])); + return(PgSqlType(type_list[this->type_idx])); } else return(*this); } -void PgSQLType::setDimension(unsigned dim) +void PgSqlType::setDimension(unsigned dim) { if(dim > 0 && this->isUserType()) { - int idx=getUserTypeIndex(~(*this), nullptr) - (pseudo_end + 1); + int idx=getUserTypeIndex(~(*this), nullptr) - (PseudoEnd + 1); if(static_cast(idx) < user_types.size() && - (user_types[idx].type_conf==UserTypeConfig::DOMAIN_TYPE || - user_types[idx].type_conf==UserTypeConfig::SEQUENCE_TYPE)) + (user_types[idx].type_conf==UserTypeConfig::DomainType || + user_types[idx].type_conf==UserTypeConfig::SequenceType)) throw Exception(ErrorCode::AsgInvalidDomainArray,__PRETTY_FUNCTION__,__FILE__,__LINE__); } dimension=dim; } -void PgSQLType::setLength(unsigned len) +void PgSqlType::setLength(unsigned len) { this->length=len; } -void PgSQLType::setPrecision(int prec) +void PgSqlType::setPrecision(int prec) { if(!isUserType()) { @@ -1564,22 +1564,22 @@ void PgSQLType::setPrecision(int prec) } } -unsigned PgSQLType::getDimension(void) +unsigned PgSqlType::getDimension(void) { return(dimension); } -unsigned PgSQLType::getLength(void) +unsigned PgSqlType::getLength(void) { return(length); } -int PgSQLType::getPrecision(void) +int PgSqlType::getPrecision(void) { return(precision); } -QString PgSQLType::getCodeDefinition(unsigned def_type,QString ref_type) +QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) { if(def_type==SchemaParser::SqlDefinition) return(*(*this)); @@ -1607,7 +1607,7 @@ QString PgSQLType::getCodeDefinition(unsigned def_type,QString ref_type) if(precision >= 0) attribs[ParsersAttributes::PRECISION]=QString("%1").arg(this->precision); - if(interval_type != BaseType::null) + if(interval_type != BaseType::Null) attribs[ParsersAttributes::INTERVAL_TYPE]=(~interval_type); if(isGiSType()) @@ -1624,7 +1624,7 @@ QString PgSQLType::getCodeDefinition(unsigned def_type,QString ref_type) } } -QString PgSQLType::operator * (void) +QString PgSqlType::operator * (void) { QString fmt_type, type, aux; unsigned idx; @@ -1663,7 +1663,7 @@ QString PgSQLType::operator * (void) { aux=BaseType::type_list[type_idx]; - if(interval_type!=BaseType::null) + if(interval_type!=BaseType::Null) aux+=QString(" %1 ").arg(~interval_type); if(precision >= 0) @@ -1695,7 +1695,7 @@ BehaviorType::BehaviorType(unsigned type_id) BehaviorType::BehaviorType(void) { - type_idx=offset; + type_idx=Offset; } BehaviorType::BehaviorType(const QString &type_name) @@ -1705,12 +1705,12 @@ BehaviorType::BehaviorType(const QString &type_name) void BehaviorType::getTypes(QStringList &type_list) { - BaseType::getTypes(type_list,offset,types_count); + BaseType::getTypes(type_list,Offset,TypesCount); } unsigned BehaviorType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -1718,8 +1718,8 @@ unsigned BehaviorType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -1728,7 +1728,7 @@ unsigned BehaviorType::operator = (const QString &type_name) ***********************/ SecurityType::SecurityType(void) { - type_idx=offset; + type_idx=Offset; } SecurityType::SecurityType(const QString &type_name) @@ -1743,12 +1743,12 @@ SecurityType::SecurityType(unsigned type_id) void SecurityType::getTypes(QStringList &tipos) { - BaseType::getTypes(tipos,offset,types_count); + BaseType::getTypes(tipos,Offset,TypesCount); } unsigned SecurityType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -1756,8 +1756,8 @@ unsigned SecurityType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -1766,7 +1766,7 @@ unsigned SecurityType::operator = (const QString &type_name) ***********************/ LanguageType::LanguageType(void) { - type_idx=offset; + type_idx=Offset; } LanguageType::LanguageType(unsigned type_id) @@ -1781,12 +1781,12 @@ LanguageType::LanguageType(const QString &type_name) void LanguageType::getTypes(QStringList &tipos) { - BaseType::getTypes(tipos,offset,types_count); + BaseType::getTypes(tipos,Offset,TypesCount); } unsigned LanguageType::operator = (unsigned tipo_id) { - BaseType::setType(tipo_id,offset,types_count); + BaseType::setType(tipo_id,Offset,TypesCount); return(type_idx); } @@ -1794,8 +1794,8 @@ unsigned LanguageType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -1804,7 +1804,7 @@ unsigned LanguageType::operator = (const QString &type_name) ***********************/ EncodingType::EncodingType(void) { - type_idx=offset; + type_idx=Offset; } EncodingType::EncodingType(const QString &type) @@ -1819,12 +1819,12 @@ EncodingType::EncodingType(const unsigned type_id) void EncodingType::getTypes(QStringList &tipos) { - BaseType::getTypes(tipos,offset,types_count); + BaseType::getTypes(tipos,Offset,TypesCount); } unsigned EncodingType::operator = (unsigned type_id) { - BaseType::setType(type_id,offset,types_count); + BaseType::setType(type_id,Offset,TypesCount); return(type_idx); } @@ -1832,8 +1832,8 @@ unsigned EncodingType::operator = (const QString &type_name) { unsigned type_id; - type_id=BaseType::getType(type_name, offset, types_count); - BaseType::setType(type_id,offset,types_count); + type_id=BaseType::getType(type_name, Offset, TypesCount); + BaseType::setType(type_id,Offset,TypesCount); return(type_id); } @@ -1847,9 +1847,9 @@ bool EncodingType::operator == (const QString &type_name) unsigned idx,total; bool found=false; - total=offset + types_count; + total=Offset + TypesCount; - for(idx=offset; idx user_types; @@ -373,26 +373,26 @@ class PgSQLType: public BaseType{ void setUserType(void *ptype); public: - PgSQLType(void); + PgSqlType(void); /*! \brief Creates a type from a simple string containing the name of the type. \note This method works in different way than PgSQLType::parserString() */ - PgSQLType(const QString &type_name); + PgSqlType(const QString &type_name); //! \brief Creates a type from a pointer that references an user defined type (Type class) - PgSQLType(void *ptype); + PgSqlType(void *ptype); - PgSQLType(const QString &type_name, unsigned length, + PgSqlType(const QString &type_name, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type); - PgSQLType(void *ptipo, unsigned length, + PgSqlType(void *ptipo, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type); - PgSQLType(unsigned type_id, unsigned length, + PgSqlType(unsigned type_id, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type); @@ -401,7 +401,7 @@ class PgSQLType: public BaseType{ in SQL canonical form, e.g, varchar(255), timestamp with timezone, smallint[] and so on. If the string specifies arrays and length descriptors in wrong positions the method will try to return the correct type. The method will raise errors if the type could not be configured */ - static PgSQLType parseString(const QString &str); + static PgSqlType parseString(const QString &str); static unsigned getUserTypeIndex(const QString &type_name, void *ptype, void *pmodel=nullptr); static unsigned getBaseTypeIndex(const QString &type_name); @@ -445,15 +445,15 @@ class PgSQLType: public BaseType{ bool acceptsPrecision(void); //! \brief Indicates if the 'this' type can be casted to 'type' - bool canCastTo(PgSQLType type); + bool canCastTo(PgSqlType type); /*! \brief Returns if the "this" type is equivalent to the specified type. In order to be compatible the "this" and "type" must be an alias from each other, for instance, "varchar" is compatible with "character varying" and vice-versa, smallint is compatible with int2, and so on. */ - bool isEquivalentTo(PgSQLType type); + bool isEquivalentTo(PgSqlType type); - PgSQLType getAliasType(void); + PgSqlType getAliasType(void); QString getCodeDefinition(unsigned def_type, QString ref_type=QString()); QString operator ~ (void); @@ -464,11 +464,11 @@ class PgSQLType: public BaseType{ unsigned operator = (unsigned type_id); unsigned operator = (const QString &type_name); bool operator == (unsigned type_idx); - bool operator == (PgSQLType type); + bool operator == (PgSqlType type); bool operator == (const QString &type_name); bool operator == (void *ptype); bool operator != (const QString &type_name); - bool operator != (PgSQLType type); + bool operator != (PgSqlType type); bool operator != (unsigned type_idx); /*! \brief Returns the pointer to the user defined type which denotes the @@ -500,13 +500,13 @@ class PgSQLType: public BaseType{ class BehaviorType: public BaseType{ private: - static constexpr unsigned offset=151; - static constexpr unsigned types_count=3; + static constexpr unsigned Offset=151; + static constexpr unsigned TypesCount=3; public: - static constexpr unsigned called_on_null_input=offset; - static constexpr unsigned returns_null_on_null_input=offset+1; - static constexpr unsigned strict=offset+2; + static constexpr unsigned CalledOnNullInput=Offset; + static constexpr unsigned ReturnsNullOnNullInput=Offset+1; + static constexpr unsigned Strict=Offset+2; BehaviorType(const QString &type_name); BehaviorType(unsigned type_id); @@ -519,12 +519,12 @@ class BehaviorType: public BaseType{ class SecurityType: public BaseType{ private: - static constexpr unsigned offset=154; - static constexpr unsigned types_count=2; + static constexpr unsigned Offset=154; + static constexpr unsigned TypesCount=2; public: - static constexpr unsigned invoker=offset; - static constexpr unsigned definer=offset+1; + static constexpr unsigned Invoker=Offset; + static constexpr unsigned Definer=Offset+1; SecurityType(unsigned type_id); SecurityType(const QString &type_name); @@ -537,17 +537,17 @@ class SecurityType: public BaseType{ class LanguageType: public BaseType{ private: - static constexpr unsigned offset=156; - static constexpr unsigned types_count=7; + static constexpr unsigned Offset=156; + static constexpr unsigned TypesCount=7; public: - static constexpr unsigned sql=offset; - static constexpr unsigned c=offset+1; - static constexpr unsigned plpgsql=offset+2; - static constexpr unsigned pltcl=offset+3; - static constexpr unsigned plperl=offset+4; - static constexpr unsigned plpython=offset+5; - static constexpr unsigned internal=offset+6; + static constexpr unsigned Sql=Offset; + static constexpr unsigned C=Offset+1; + static constexpr unsigned PlPgsql=Offset+2; + static constexpr unsigned PlTcl=Offset+3; + static constexpr unsigned PlPerl=Offset+4; + static constexpr unsigned PlPython=Offset+5; + static constexpr unsigned Internal=Offset+6; LanguageType(const QString &type_name); LanguageType(unsigned type_id); @@ -560,8 +560,8 @@ class LanguageType: public BaseType{ class EncodingType: public BaseType{ private: - static constexpr unsigned offset=163; - static constexpr unsigned types_count=42; + static constexpr unsigned Offset=163; + static constexpr unsigned TypesCount=42; public: EncodingType(void); @@ -580,14 +580,14 @@ class EncodingType: public BaseType{ class StorageType: public BaseType{ private: - static constexpr unsigned offset=205; - static constexpr unsigned types_count=4; + static constexpr unsigned Offset=205; + static constexpr unsigned TypesCount=4; public: - static constexpr unsigned plain=offset; - static constexpr unsigned external=offset+1; - static constexpr unsigned extended=offset+2; - static constexpr unsigned main=offset+3; + static constexpr unsigned Plain=Offset; + static constexpr unsigned External=Offset+1; + static constexpr unsigned Extended=Offset+2; + static constexpr unsigned Main=Offset+3; StorageType(void); StorageType(const QString &type_name); @@ -603,13 +603,13 @@ class StorageType: public BaseType{ class MatchType: public BaseType{ private: - static constexpr unsigned offset=209; - static constexpr unsigned types_count=3; + static constexpr unsigned Offset=209; + static constexpr unsigned TypesCount=3; public: - static constexpr unsigned full=offset; - static constexpr unsigned partial=offset+1; - static constexpr unsigned simple=offset+2; + static constexpr unsigned Full=Offset; + static constexpr unsigned Partial=Offset+1; + static constexpr unsigned Simple=Offset+2; MatchType(unsigned type_id); MatchType(const QString &type_name); @@ -622,12 +622,12 @@ class MatchType: public BaseType{ class DeferralType: public BaseType{ private: - static constexpr unsigned offset=212; - static constexpr unsigned types_count=2; + static constexpr unsigned Offset=212; + static constexpr unsigned TypesCount=2; public: - static constexpr unsigned immediate=offset; - static constexpr unsigned deferred=offset+1; + static constexpr unsigned Immediate=Offset; + static constexpr unsigned Deferred=Offset+1; DeferralType(unsigned type_id); DeferralType(const QString &type_name); @@ -640,24 +640,24 @@ class DeferralType: public BaseType{ class CategoryType: public BaseType{ private: - static constexpr unsigned offset=214; - static constexpr unsigned types_count=14; + static constexpr unsigned Offset=214; + static constexpr unsigned TypesCount=14; public: - static constexpr unsigned userdefined=offset; - static constexpr unsigned array=offset+1; - static constexpr unsigned boolean=offset+2; - static constexpr unsigned composite=offset+3; - static constexpr unsigned datetime=offset+4; - static constexpr unsigned enumeration=offset+5; - static constexpr unsigned geometric=offset+6; - static constexpr unsigned networkaddr=offset+7; - static constexpr unsigned numeric=offset+8; - static constexpr unsigned pseudotypes=offset+9; - static constexpr unsigned stringt=offset+10; - static constexpr unsigned timespan=offset+11; - static constexpr unsigned bitstring=offset+12; - static constexpr unsigned unknown=offset+13; + static constexpr unsigned UserDefined=Offset; + static constexpr unsigned Array=Offset+1; + static constexpr unsigned Boolean=Offset+2; + static constexpr unsigned Composite=Offset+3; + static constexpr unsigned DateTime=Offset+4; + static constexpr unsigned Enumeration=Offset+5; + static constexpr unsigned Geometric=Offset+6; + static constexpr unsigned NetworkAddr=Offset+7; + static constexpr unsigned Numeric=Offset+8; + static constexpr unsigned PseudoTypes=Offset+9; + static constexpr unsigned Stringt=Offset+10; + static constexpr unsigned Timespan=Offset+11; + static constexpr unsigned BitString=Offset+12; + static constexpr unsigned Unknown=Offset+13; CategoryType(unsigned type_id); CategoryType(const QString &type_name); @@ -670,13 +670,13 @@ class CategoryType: public BaseType{ class FiringType: public BaseType{ private: - static constexpr unsigned offset=228; - static constexpr unsigned types_count=3; + static constexpr unsigned Offset=228; + static constexpr unsigned TypesCount=3; public: - static constexpr unsigned before=offset; - static constexpr unsigned after=offset+1; - static constexpr unsigned instead_of=offset+2; + static constexpr unsigned Before=Offset; + static constexpr unsigned After=Offset+1; + static constexpr unsigned InsteadOf=Offset+2; FiringType(const QString &type_name); FiringType(unsigned type_id); @@ -689,14 +689,14 @@ class FiringType: public BaseType{ class EventTriggerType: public BaseType{ private: - static constexpr unsigned offset=247; - static constexpr unsigned types_count=4; + static constexpr unsigned Offset=247; + static constexpr unsigned TypesCount=4; public: - static constexpr unsigned ddl_command_start=offset; - static constexpr unsigned ddl_command_end=offset+1; - static constexpr unsigned sql_drop=offset+2; - static constexpr unsigned table_rewrite=offset+3; + static constexpr unsigned DdlCommandStart=Offset; + static constexpr unsigned DdlCommandEnd=Offset+1; + static constexpr unsigned SqlDrop=Offset+2; + static constexpr unsigned TableRewrite=Offset+3; EventTriggerType(const QString &type_name); EventTriggerType(unsigned type_id); @@ -709,12 +709,12 @@ class EventTriggerType: public BaseType{ class IdentityType: public BaseType{ private: - static constexpr unsigned offset=251; - static constexpr unsigned types_count=2; + static constexpr unsigned Offset=251; + static constexpr unsigned TypesCount=2; public: - static constexpr unsigned always=offset; - static constexpr unsigned by_default=offset+1; + static constexpr unsigned Always=Offset; + static constexpr unsigned ByDefault=Offset+1; IdentityType(const QString &type_name); IdentityType(unsigned type_id); @@ -727,15 +727,15 @@ class IdentityType: public BaseType{ class PolicyCmdType: public BaseType { private: - static constexpr unsigned offset=253; - static constexpr unsigned types_count=5; + static constexpr unsigned Offset=253; + static constexpr unsigned TypesCount=5; public: - static constexpr unsigned all=offset; - static constexpr unsigned select=offset+1; - static constexpr unsigned insert=offset+2; - static constexpr unsigned updated=offset+3; - static constexpr unsigned delete_=offset+4; + static constexpr unsigned All=Offset; + static constexpr unsigned Select=Offset+1; + static constexpr unsigned Insert=Offset+2; + static constexpr unsigned Update=Offset+3; + static constexpr unsigned Delete=Offset+4; PolicyCmdType(const QString &type_name); PolicyCmdType(unsigned type_id); @@ -748,13 +748,13 @@ class PolicyCmdType: public BaseType { class PartitioningType: public BaseType { private: - static constexpr unsigned offset=258; - static constexpr unsigned types_count=3; + static constexpr unsigned Offset=258; + static constexpr unsigned TypesCount=3; public: - static constexpr unsigned range=offset; - static constexpr unsigned list=offset+1; - static constexpr unsigned hash=offset+2; + static constexpr unsigned Range=Offset; + static constexpr unsigned List=Offset+1; + static constexpr unsigned Hash=Offset+2; PartitioningType(const QString &type_name); PartitioningType(unsigned type_id); diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index 9538de7b3c..cd47cc1066 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -21,7 +21,7 @@ Policy::Policy(void) : TableObject() { obj_type=ObjectType::ObjPolicy; permissive = false; - policy_cmd = PolicyCmdType::all; + policy_cmd = PolicyCmdType::All; attributes[ParsersAttributes::PERMISSIVE] = QString(); attributes[ParsersAttributes::COMMAND] = QString(); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index fe026a29cb..bae33034aa 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -322,7 +322,7 @@ void Relationship::createSpecialPrimaryKey(void) pk_special=new Constraint; pk_special->setName(generateObjectName(PkPattern)); pk_special->setAlias(generateObjectName(PkPattern, nullptr, true)); - pk_special->setConstraintType(ConstraintType::primary_key); + pk_special->setConstraintType(ConstraintType::PrimaryKey); pk_special->setAddedByLinking(true); pk_special->setProtected(true); pk_special->setTablespace(dynamic_cast(getReceiverTable()->getTablespace())); @@ -527,7 +527,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) rest=dynamic_cast(tab_obj); //Raises an error if the user try to add as foreign key to relationship - if(rest->getConstraintType()==ConstraintType::foreign_key) + if(rest->getConstraintType()==ConstraintType::ForeignKey) throw Exception(ErrorCode::AsgForeignKeyRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); rest->getCodeDefinition(SchemaParser::SqlDefinition); @@ -827,7 +827,7 @@ void Relationship::addConstraints(Table *recv_tab) if(constr->getParentTable()) break; - if(constr->getConstraintType()!=ConstraintType::primary_key) + if(constr->getConstraintType()!=ConstraintType::PrimaryKey) { constr->setName(PgModelerNs::generateUniqueName(constr, (*recv_tab->getObjectList(ObjectType::ObjConstraint)))); recv_tab->addConstraint(constr); @@ -893,7 +893,7 @@ void Relationship::addColumnsRelGenPart(void) src_flags[2]={false,false}, dst_flags[2]={false,false}; QString str_aux, msg; - PgSQLType src_type, dst_type; + PgSqlType src_type, dst_type; try { @@ -1046,11 +1046,11 @@ void Relationship::addColumnsRelGenPart(void) //Converts the type if(column->getType()==QString("serial")) - column->setType(PgSQLType(QString("integer"))); + column->setType(PgSqlType(QString("integer"))); else if(column->getType()==QString("bigserial")) - column->setType(PgSQLType(QString("bigint"))); + column->setType(PgSqlType(QString("bigint"))); else if(column->getType()==QString("smallserial")) - column->setType(PgSQLType(QString("smallint"))); + column->setType(PgSqlType(QString("smallint"))); //Adds the new column to the temporary column list columns.push_back(column); @@ -1150,7 +1150,7 @@ void Relationship::addConstraintsRelGenPart(void) { constr=dynamic_cast(obj); - if(constr->getConstraintType()==ConstraintType::check && !constr->isNoInherit()) + if(constr->getConstraintType()==ConstraintType::Check && !constr->isNoInherit()) { aux_constr=dynamic_cast(child_tab->getObject(constr->getName(), ObjectType::ObjConstraint)); @@ -1163,7 +1163,7 @@ void Relationship::addConstraintsRelGenPart(void) child_tab->addConstraint(ck_constr); ck_constraints.push_back(ck_constr); } - else if(aux_constr->getConstraintType()!=ConstraintType::check || + else if(aux_constr->getConstraintType()!=ConstraintType::Check || aux_constr->getExpression().simplified()!=constr->getExpression().simplified()) throw Exception(Exception::getErrorMessage(ErrorCode::InvInheritRelationshipIncompConstrs) .arg(constr->getName()).arg(parent_tab->getName(false, true)) @@ -1280,7 +1280,7 @@ void Relationship::configureIndentifierRel(Table *recv_tab) if(!pk_relident) { pk=new Constraint; - pk->setConstraintType(ConstraintType::primary_key); + pk->setConstraintType(ConstraintType::PrimaryKey); pk->setAddedByLinking(true); pk->setDeferrable(this->deferrable); pk->setDeferralType(this->deferral_type); @@ -1340,7 +1340,7 @@ void Relationship::addUniqueKey(Table *recv_tab) uq=new Constraint; uq->setDeferrable(this->deferrable); uq->setDeferralType(this->deferral_type); - uq->setConstraintType(ConstraintType::unique); + uq->setConstraintType(ConstraintType::Unique); uq->setAddedByLinking(true); uq_rel11=uq; } @@ -1386,7 +1386,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del fk=new Constraint; fk->setDeferrable(this->deferrable); fk->setDeferralType(this->deferral_type); - fk->setConstraintType(ConstraintType::foreign_key); + fk->setConstraintType(ConstraintType::ForeignKey); fk->setAddedByLinking(true); //The reference table is the table referenced by the foreign key @@ -1608,11 +1608,11 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b //Converting the serial like types if(column->getType()==QString("serial")) - column->setType(PgSQLType(QString("integer"))); + column->setType(PgSqlType(QString("integer"))); else if(column->getType()==QString("bigserial")) - column->setType(PgSQLType(QString("bigint"))); + column->setType(PgSqlType(QString("bigint"))); else if(column->getType()==QString("smallserial")) - column->setType(PgSQLType(QString("smallint"))); + column->setType(PgSqlType(QString("smallint"))); column->setName(name); name=PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjectType::ObjColumn))); @@ -1662,25 +1662,25 @@ void Relationship::addColumnsRel11(void) ref_tab=dynamic_cast
(this->getReferenceTable()); recv_tab=dynamic_cast
(this->getReceiverTable()); - if(this->upd_action!=ActionType::null) + if(this->upd_action!=ActionType::Null) upd_action=this->upd_action; else - upd_action=ActionType::cascade; + upd_action=ActionType::Cascade; - if(this->del_action!=ActionType::null) + if(this->del_action!=ActionType::Null) del_action=this->del_action; else { if(identifier) - del_action=ActionType::cascade; + del_action=ActionType::Cascade; else { //Case the reference table is mandatory participation set as RESTRICT the delete action on the foreign key if((ref_tab==this->src_table && this->isTableMandatory(SrcTable)) || (ref_tab==this->dst_table && this->isTableMandatory(DstTable))) - del_action=ActionType::restrict; + del_action=ActionType::Restrict; else - del_action=ActionType::set_null; + del_action=ActionType::SetNull; } } @@ -1735,19 +1735,19 @@ void Relationship::addColumnsRel1n(void) { Table *ref_tab=nullptr, *recv_tab=nullptr; bool not_null=false; - ActionType del_action=ActionType::set_null, upd_action; + ActionType del_action=ActionType::SetNull, upd_action; try { recv_tab=dynamic_cast
(this->getReceiverTable()); ref_tab=dynamic_cast
(this->getReferenceTable()); - if(this->upd_action!=ActionType::null) + if(this->upd_action!=ActionType::Null) upd_action=this->upd_action; else - upd_action=ActionType::cascade; + upd_action=ActionType::Cascade; - if(this->del_action!=ActionType::null) + if(this->del_action!=ActionType::Null) del_action=this->del_action; else { @@ -1757,9 +1757,9 @@ void Relationship::addColumnsRel1n(void) if(!identifier && src_mandatory) { if(!deferrable) - del_action=ActionType::restrict; + del_action=ActionType::Restrict; else - del_action=ActionType::no_action; + del_action=ActionType::NoAction; } /* Case the relationship is identifier configures the ON DELETE anda ON UPDATE action @@ -1767,7 +1767,7 @@ void Relationship::addColumnsRel1n(void) entity also exists, this means if the strong entity tuple is removed the weak entity tuple is also removed */ else if(identifier) - del_action=ActionType::cascade; + del_action=ActionType::Cascade; } if(!identifier && src_mandatory) @@ -1814,8 +1814,8 @@ void Relationship::addColumnsRelNn(void) Table *tab=nullptr, *tab1=nullptr; Constraint *pk_tabnn=nullptr; bool src_not_null=false, dst_not_null=false; - ActionType src_del_act=ActionType::restrict, dst_del_act=ActionType::restrict, - src_upd_act=ActionType::cascade, dst_upd_act=ActionType::cascade; + ActionType src_del_act=ActionType::Restrict, dst_del_act=ActionType::Restrict, + src_upd_act=ActionType::Cascade, dst_upd_act=ActionType::Cascade; try @@ -1823,15 +1823,15 @@ void Relationship::addColumnsRelNn(void) tab=dynamic_cast
(src_table); tab1=dynamic_cast
(dst_table); - if(this->upd_action!=ActionType::null) + if(this->upd_action!=ActionType::Null) src_upd_act=dst_upd_act=this->upd_action; else - src_upd_act=dst_upd_act=ActionType::cascade; + src_upd_act=dst_upd_act=ActionType::Cascade; - if(this->del_action!=ActionType::null) + if(this->del_action!=ActionType::Null) src_del_act=dst_del_act=this->del_action; else - src_del_act=dst_del_act=ActionType::restrict; + src_del_act=dst_del_act=ActionType::Restrict; /* Copy the columns from the primary keys of the source and destination tables to the table that represents the n-n relationship */ @@ -1843,7 +1843,7 @@ void Relationship::addColumnsRelNn(void) pk_col=new Column; pk_col->setName(generateObjectName(PkColPattern)); pk_col->setAlias(generateObjectName(PkColPattern, nullptr, true)); - pk_col->setType(PgSQLType(QString("serial"))); + pk_col->setType(PgSqlType(QString("serial"))); pk_col->setAddedByLinking(true); table_relnn->addColumn(pk_col); } @@ -1852,7 +1852,7 @@ void Relationship::addColumnsRelNn(void) pk_tabnn=new Constraint; pk_tabnn->setName(generateObjectName(PkPattern)); pk_tabnn->setAlias(generateObjectName(PkPattern, nullptr, true)); - pk_tabnn->setConstraintType(ConstraintType::primary_key); + pk_tabnn->setConstraintType(ConstraintType::PrimaryKey); pk_tabnn->setAddedByLinking(true); if(!single_pk_column) @@ -2001,7 +2001,7 @@ void Relationship::removeTableObjectsRefCols(Table *table) { constr=table->getConstraint(i); if(!constr->isAddedByRelationship() && - constr->getConstraintType()!=ConstraintType::primary_key && + constr->getConstraintType()!=ConstraintType::PrimaryKey && constr->isReferRelationshipAddedColumn()) { table->removeObject(constr); @@ -2315,7 +2315,7 @@ bool Relationship::hasIndentifierAttribute(void) /* A relationship is considered to own a identifier attribute when a primary key is found among the constraints */ - found=(constr->getConstraintType()==ConstraintType::primary_key); + found=(constr->getConstraintType()==ConstraintType::PrimaryKey); itr++; } @@ -2472,7 +2472,7 @@ bool Relationship::isInvalidated(void) for(i=0; i < ck_constraints.size() && valid; i++) { constr=table->getConstraint(ck_constraints[i]->getName(true)); - valid=(constr && !constr->isNoInherit() && constr->getConstraintType()==ConstraintType::check); + valid=(constr && !constr->isNoInherit() && constr->getConstraintType()==ConstraintType::Check); } } @@ -2499,7 +2499,7 @@ bool Relationship::isInvalidated(void) for(i=0; i < count; i++) { constr=table_relnn->getConstraint(i); - if(constr->getConstraintType()==ConstraintType::foreign_key) + if(constr->getConstraintType()==ConstraintType::ForeignKey) { if(!fk && constr->getReferencedTable()==table) fk=constr; @@ -2570,7 +2570,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) count=rel_constraints.size(); for(i=0; i < count; i++) { - if(dynamic_cast(rel_constraints[i])->getConstraintType()!=ConstraintType::primary_key) + if(dynamic_cast(rel_constraints[i])->getConstraintType()!=ConstraintType::PrimaryKey) attributes[ParsersAttributes::CONSTRAINTS]+=dynamic_cast(rel_constraints[i])->getCodeDefinition(def_type, false); } @@ -2587,8 +2587,8 @@ QString Relationship::getCodeDefinition(unsigned def_type) count=table_relnn->getConstraintCount(); for(i=0; i < count; i++) { - if(table_relnn->getConstraint(i)->getConstraintType()!=ConstraintType::primary_key && - table_relnn->getConstraint(i)->getConstraintType()!=ConstraintType::check) + if(table_relnn->getConstraint(i)->getConstraintType()!=ConstraintType::PrimaryKey && + table_relnn->getConstraint(i)->getConstraintType()!=ConstraintType::Check) attributes[ParsersAttributes::CONSTRAINTS]+=table_relnn->getConstraint(i)->getCodeDefinition(def_type, true); } } diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index 70030479f6..2edff60fa9 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -315,9 +315,9 @@ class Relationship: public BaseRelationship { Table *src_tab, Table *dst_tab, bool src_mdtry=false, bool dst_mdtry=false, bool identifier=false, bool deferrable=false, - DeferralType deferral_type=DeferralType::immediate, - ActionType fk_del_act=ActionType::null, - ActionType fk_upd_act=ActionType::null, + DeferralType deferral_type=DeferralType::Immediate, + ActionType fk_del_act=ActionType::Null, + ActionType fk_upd_act=ActionType::Null, CopyOptions copy_op = CopyOptions(0,0)); //! \brief Connects the relationship making the configuration according to its type diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index dcb4cdf2fe..6f2998ef6c 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -20,7 +20,7 @@ Rule::Rule(void) { - execution_type=BaseType::null; + execution_type=BaseType::Null; obj_type=ObjectType::ObjRule; attributes[ParsersAttributes::EVENT_TYPE]=QString(); attributes[ParsersAttributes::TABLE]=QString(); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 4b96f46c0b..5d449d9dd8 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -29,7 +29,7 @@ Sequence::Sequence(void) { obj_type=ObjectType::ObjSequence; cycle=false; - setDefaultValues(PgSQLType(QString("serial"))); + setDefaultValues(PgSqlType(QString("serial"))); owner_col=nullptr; attributes[ParsersAttributes::INCREMENT]=QString(); @@ -178,7 +178,7 @@ int Sequence::compareValues(QString value1, QString value2) } } -void Sequence::setDefaultValues(PgSQLType serial_type) +void Sequence::setDefaultValues(PgSqlType serial_type) { QString min, max; @@ -209,7 +209,7 @@ void Sequence::setName(const QString &name) QString prev_name=this->getName(true); BaseObject::setName(name); - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } void Sequence::setSchema(BaseObject *schema) @@ -228,7 +228,7 @@ void Sequence::setSchema(BaseObject *schema) } BaseObject::setSchema(schema); - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } void Sequence::setCycle(bool value) @@ -400,7 +400,7 @@ QString Sequence::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::COLUMN]=(owner_col ? owner_col->getName(true) : QString()); attributes[ParsersAttributes::COL_IS_IDENTITY]= - (owner_col && owner_col->getIdentityType() != BaseType::null ? ParsersAttributes::_TRUE_ : QString()); + (owner_col && owner_col->getIdentityType() != BaseType::Null ? ParsersAttributes::_TRUE_ : QString()); attributes[ParsersAttributes::INCREMENT]=increment; attributes[ParsersAttributes::MIN_VALUE]=min_value; @@ -487,6 +487,6 @@ void Sequence::operator = (Sequence &seq) this->cache=seq.cache; this->owner_col=seq.owner_col; - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } diff --git a/libpgmodeler/src/sequence.h b/libpgmodeler/src/sequence.h index a341a37811..8c92c037f7 100644 --- a/libpgmodeler/src/sequence.h +++ b/libpgmodeler/src/sequence.h @@ -86,7 +86,7 @@ class Sequence: public BaseObject { /*! \brief Sets all values at once based on the serial type specified (smallserial, serial or bigserial). If other type the three serial types are passed the method will consider as 'serial' */ - void setDefaultValues(PgSQLType serial_type); + void setDefaultValues(PgSqlType serial_type); //! \brief Defines the owner column using a table and a column name void setOwnerColumn(Table *tabela, const QString &col_name); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 6edc1ee3a8..bdce99f119 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -47,7 +47,7 @@ Table::Table(void) : BaseTable() attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); copy_table=partitioned_table=nullptr; - partitioning_type=BaseType::null; + partitioning_type=BaseType::Null; this->setName(trUtf8("new_table").toUtf8()); } @@ -70,14 +70,14 @@ void Table::setName(const QString &name) { QString prev_name=this->getName(true); BaseObject::setName(name); - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } void Table::setSchema(BaseObject *schema) { QString prev_name=this->getName(true); BaseObject::setSchema(schema); - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } void Table::setWithOIDs(bool value) @@ -268,16 +268,16 @@ void Table::setConstraintsAttribute(unsigned def_type) { constr=dynamic_cast(constraints[i]); - if(constr->getConstraintType()!=ConstraintType::foreign_key && + if(constr->getConstraintType()!=ConstraintType::ForeignKey && ((def_type==SchemaParser::SqlDefinition && - ((!constr->isReferRelationshipAddedColumn() && constr->getConstraintType()!=ConstraintType::check) || - (constr->getConstraintType()==ConstraintType::check && !constr->isAddedByGeneralization()) || - constr->getConstraintType()==ConstraintType::primary_key)) || + ((!constr->isReferRelationshipAddedColumn() && constr->getConstraintType()!=ConstraintType::Check) || + (constr->getConstraintType()==ConstraintType::Check && !constr->isAddedByGeneralization()) || + constr->getConstraintType()==ConstraintType::PrimaryKey)) || (def_type==SchemaParser::XmlDefinition && !constr->isAddedByRelationship() && - ((constr->getConstraintType()!=ConstraintType::primary_key && !constr->isReferRelationshipAddedColumn()) || - (constr->getConstraintType()==ConstraintType::primary_key))))) + ((constr->getConstraintType()!=ConstraintType::PrimaryKey && !constr->isReferRelationshipAddedColumn()) || + (constr->getConstraintType()==ConstraintType::PrimaryKey))))) { inc_added_by_rel=(def_type==SchemaParser::SqlDefinition); @@ -423,7 +423,7 @@ void Table::addObject(BaseObject *obj, int obj_idx) else if(obj_type==ObjectType::ObjConstraint) { //Raises a error if the user try to add a second primary key on the table - if(dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::primary_key && + if(dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::PrimaryKey && this->getPrimaryKey()) throw Exception(ErrorCode::AsgExistingPrimaryKeyTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -661,10 +661,10 @@ void Table::addPartitionKeys(vector &part_keys) { vector part_keys_bkp = partition_keys; - if(partitioning_type == BaseType::null) + if(partitioning_type == BaseType::Null) return; - if(partitioning_type == PartitioningType::list && part_keys.size() > 1) + if(partitioning_type == PartitioningType::List && part_keys.size() > 1) throw Exception(Exception::getErrorMessage(ErrorCode::InvPartitionKeyCount).arg(this->getSignature()), ErrorCode::InvPartitionKeyCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -786,7 +786,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) tab_obj->setParentTable(nullptr); obj_list->erase(itr); - if(constr && constr->getConstraintType()==ConstraintType::primary_key) + if(constr && constr->getConstraintType()==ConstraintType::PrimaryKey) dynamic_cast(tab_obj)->setColumnsNotNull(false); } else @@ -1308,7 +1308,7 @@ Constraint *Table::getPrimaryKey(void) for(i=0; i < count && !pk; i++) { constr=dynamic_cast(constraints[i]); - pk=(constr->getConstraintType()==ConstraintType::primary_key ? constr : nullptr); + pk=(constr->getConstraintType()==ConstraintType::PrimaryKey ? constr : nullptr); } return(pk); @@ -1324,7 +1324,7 @@ void Table::getForeignKeys(vector &fks, bool inc_added_by_rel, Tab { constr=dynamic_cast(constraints[i]); - if(constr->getConstraintType()==ConstraintType::foreign_key && + if(constr->getConstraintType()==ConstraintType::ForeignKey && (!ref_table || (ref_table && constr->getReferencedTable()==ref_table)) && (!constr->isAddedByLinking() || (constr->isAddedByLinking() && inc_added_by_rel))) @@ -1362,7 +1362,7 @@ bool Table::isReferTableOnForeignKey(Table *ref_tab) for(i=0; i < count && !found; i++) { constr=dynamic_cast(constraints[i]); - found=(constr->getConstraintType()==ConstraintType::foreign_key && + found=(constr->getConstraintType()==ConstraintType::ForeignKey && !constr->isAddedByLinking() && constr->getReferencedTable() == ref_tab); } @@ -1587,7 +1587,7 @@ void Table::updateAlterCmdsStatus(void) //Foreign keys are aways created as ALTER form for(i=0; i < constraints.size(); i++) constraints[i]->setDeclaredInTable(!gen_alter_cmds && - dynamic_cast(constraints[i])->getConstraintType()!=ConstraintType::foreign_key); + dynamic_cast(constraints[i])->getConstraintType()!=ConstraintType::ForeignKey); } QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) @@ -1666,7 +1666,7 @@ void Table::operator = (Table &tab) this->copy_op=tab.copy_op; this->unlogged=tab.unlogged; - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } bool Table::isReferRelationshipAddedObject(void) @@ -1697,7 +1697,7 @@ bool Table::isPartition(void) bool Table::isPartitioned(void) { - return(partitioning_type != BaseType::null); + return(partitioning_type != BaseType::Null); } void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2) diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index dc6f839584..a2a987f264 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -21,8 +21,8 @@ Trigger::Trigger(void) { unsigned i; - EventType tipos[4]={EventType::on_insert, EventType::on_delete, - EventType::on_update, EventType::on_truncate}; + EventType tipos[4]={EventType::OnInsert, EventType::OnDelete, + EventType::OnUpdate, EventType::OnTruncate}; function=nullptr; is_exec_per_row=is_constraint=is_deferrable=false; @@ -85,7 +85,7 @@ void Trigger::setFiringType(FiringType firing_type) void Trigger::setEvent(EventType event, bool value) { - if(event==EventType::on_select) + if(event==EventType::OnSelect) throw Exception(ErrorCode::RefInvalidTriggerEvent,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(events[event] != value); @@ -168,7 +168,7 @@ void Trigger::setExecutePerRow(bool value) bool Trigger::isExecuteOnEvent(EventType event) { - if(event==EventType::on_select) + if(event==EventType::OnSelect) throw Exception(ErrorCode::RefInvalidTriggerEvent,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(events.at(!event)); @@ -349,8 +349,8 @@ void Trigger::setBasicAttributes(unsigned def_type) attribs[4]={ParsersAttributes::INS_EVENT, ParsersAttributes::DEL_EVENT, ParsersAttributes::TRUNC_EVENT, ParsersAttributes::UPD_EVENT }, sql_event[4]={"INSERT OR ", "DELETE OR ", "TRUNCATE OR ", "UPDATE "}; - unsigned count, i, i1, event_types[4]={EventType::on_insert, EventType::on_delete, - EventType::on_truncate, EventType::on_update}; + unsigned count, i, i1, event_types[4]={EventType::OnInsert, EventType::OnDelete, + EventType::OnTruncate, EventType::OnUpdate}; setArgumentAttribute(def_type); @@ -362,7 +362,7 @@ void Trigger::setBasicAttributes(unsigned def_type) str_aux+=sql_event[i]; attributes[attribs[i]]=ParsersAttributes::_TRUE_; - if(event_types[i]==EventType::on_update) + if(event_types[i]==EventType::OnUpdate) { count=upd_columns.size(); attributes[ParsersAttributes::COLUMNS]=QString(); @@ -445,23 +445,23 @@ void Trigger::validateTrigger(void) if(!is_constraint) { //The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers - if(firing_type==FiringType::instead_of && parent_type==ObjectType::ObjTable) + if(firing_type==FiringType::InsteadOf && parent_type==ObjectType::ObjTable) throw Exception(ErrorCode::InvTableTriggerInsteadOfFiring,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The INSTEAD OF mode cannot be used on view triggers that executes for each statement - else if(firing_type==FiringType::instead_of && parent_type==ObjectType::ObjView && !is_exec_per_row) + else if(firing_type==FiringType::InsteadOf && parent_type==ObjectType::ObjView && !is_exec_per_row) throw Exception(ErrorCode::InvUsageInsteadOfOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event - else if(firing_type==FiringType::instead_of && events[EventType::on_update] && !upd_columns.empty()) + else if(firing_type==FiringType::InsteadOf && events[EventType::OnUpdate] && !upd_columns.empty()) throw Exception(ErrorCode::InvUsageInsteadOfUpdateTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table - else if(events[EventType::on_truncate] && (is_exec_per_row || parent_type==ObjectType::ObjView)) + else if(events[EventType::OnTruncate] && (is_exec_per_row || parent_type==ObjectType::ObjView)) throw Exception(ErrorCode::InvUsageTruncateOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A view trigger cannot be AFTER/BEFORE when it executes for each row - else if(parent_type==ObjectType::ObjView && is_exec_per_row && (firing_type==FiringType::after || firing_type==FiringType::before)) + else if(parent_type==ObjectType::ObjView && is_exec_per_row && (firing_type==FiringType::After || firing_type==FiringType::Before)) throw Exception(ErrorCode::InvUsageAfterBeforeViewTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Only constraint triggers can be deferrable or reference another table @@ -471,7 +471,7 @@ void Trigger::validateTrigger(void) //Constraint triggers can only be executed on AFTER events and for each row else { - if(firing_type!=FiringType::after && !is_exec_per_row) + if(firing_type!=FiringType::After && !is_exec_per_row) throw Exception(ErrorCode::InvConstrTriggerNotAfterRow,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index a0b6ca52aa..141c341a04 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -60,7 +60,7 @@ void Type::setName(const QString &name) prev_name=this->getName(true);//this->nome; BaseObject::setName(name); - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } void Type::setSchema(BaseObject *schema) @@ -69,7 +69,7 @@ void Type::setSchema(BaseObject *schema) prev_name=this->getName(true); BaseObject::setSchema(schema); - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } int Type::getAttributeIndex(const QString &attrib_name) @@ -97,10 +97,10 @@ int Type::getAttributeIndex(const QString &attrib_name) void Type::addAttribute(TypeAttribute attrib) { //Raises an error if the attribute has an empty name or null type - if(attrib.getName().isEmpty() || attrib.getType()==PgSQLType::null) + if(attrib.getName().isEmpty() || attrib.getType()==PgSqlType::Null) throw Exception(ErrorCode::InsInvalidTypeAttribute,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the passed attribute has the same type as the defining type (this) - else if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !attrib.getType()) + else if(PgSqlType::getUserTypeIndex(this->getName(true), this) == !attrib.getType()) throw Exception(Exception::getErrorMessage(ErrorCode::InvUserTypeSelfReference).arg(this->getName(true)), ErrorCode::InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error when the attribute already exists @@ -196,10 +196,10 @@ void Type::setConfiguration(unsigned conf) alignment=QString("integer"); delimiter='\0'; - storage=StorageType::plain; + storage=StorageType::Plain; element=QString("\"any\""); internal_len=0; - category=CategoryType::userdefined; + category=CategoryType::UserDefined; preferred=collatable=by_value=false; like_type=QString("\"any\""); @@ -211,7 +211,7 @@ void Type::setFunction(unsigned func_id, Function *func) { unsigned param_count=0; LanguageType lang; - lang=LanguageType::c; + lang=LanguageType::C; unsigned funcs_len=sizeof(functions)/sizeof(Function *); //Raises an error if the function id is invalid @@ -239,8 +239,8 @@ void Type::setFunction(unsigned func_id, Function *func) /* Raises an error if the function language is not C. Functions assigned to base type must be written in C */ if((func_id!=CanonicalFunc && func_id!=SubtypeDiffFunc) && - func->getLanguage()->getName()!=~LanguageType(LanguageType::c) && - func->getLanguage()->getName()!=~LanguageType(LanguageType::internal)) + func->getLanguage()->getName()!=~LanguageType(LanguageType::C) && + func->getLanguage()->getName()!=~LanguageType(LanguageType::Internal)) throw Exception(ErrorCode::AsgFunctionInvalidLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the parameter count for INPUT and RECV functions @@ -335,21 +335,21 @@ void Type::convertFunctionParameters(bool inverse_conv) if(!inverse_conv) { - param.setType(PgSQLType(this)); + param.setType(PgSqlType(this)); func->addParameter(param); } else { - param.setType(PgSQLType(QString("\"any\""))); + param.setType(PgSqlType(QString("\"any\""))); func->addParameter(param); } } else if(conf_funcs[i]==InputFunc || conf_funcs[i]==RecvFunc) { if(!inverse_conv) - func->setReturnType(PgSQLType(this)); + func->setReturnType(PgSqlType(this)); else - func->setReturnType(PgSQLType(QString("\"any\""))); + func->setReturnType(PgSqlType(QString("\"any\""))); } } } @@ -369,7 +369,7 @@ void Type::setByValue(bool value) by_value=value; } -void Type::setAlignment(PgSQLType type) +void Type::setAlignment(PgSqlType type) { QString tp=(*type); @@ -396,9 +396,9 @@ void Type::setDefaultValue(const QString &value) this->default_value=def; } -void Type::setElement(PgSQLType elem) +void Type::setElement(PgSqlType elem) { - if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !elem) + if(PgSqlType::getUserTypeIndex(this->getName(true), this) == !elem) throw Exception(Exception::getErrorMessage(ErrorCode::InvUserTypeSelfReference).arg(this->getName(true)), ErrorCode::InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(elem!=QString("\"any\"") && @@ -469,9 +469,9 @@ void Type::setCollatable(bool value) this->collatable=value; } -void Type::setLikeType(PgSQLType like_type) +void Type::setLikeType(PgSqlType like_type) { - if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !like_type) + if(PgSqlType::getUserTypeIndex(this->getName(true), this) == !like_type) throw Exception(Exception::getErrorMessage(ErrorCode::InvUserTypeSelfReference).arg(this->getName(true)), ErrorCode::InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -479,9 +479,9 @@ void Type::setLikeType(PgSQLType like_type) this->like_type=like_type; } -void Type::setSubtype(PgSQLType subtype) +void Type::setSubtype(PgSqlType subtype) { - if(PgSQLType::getUserTypeIndex(this->getName(true), this) == !subtype) + if(PgSqlType::getUserTypeIndex(this->getName(true), this) == !subtype) throw Exception(Exception::getErrorMessage(ErrorCode::InvUserTypeSelfReference).arg(this->getName(true)), ErrorCode::InvUserTypeSelfReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -491,7 +491,7 @@ void Type::setSubtype(PgSQLType subtype) void Type::setSubtypeOpClass(OperatorClass *opclass) { - if(opclass && opclass->getIndexingType()!=IndexingType::btree) + if(opclass && opclass->getIndexingType()!=IndexingType::Btree) throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidOpClassObject) .arg(this->getName(true)) .arg(this->getTypeName()), @@ -545,7 +545,7 @@ bool Type::isByValue(void) return(by_value); } -PgSQLType Type::getAlignment(void) +PgSqlType Type::getAlignment(void) { return(alignment); } @@ -560,7 +560,7 @@ QString Type::getDefaultValue(void) return(default_value); } -PgSQLType Type::getElement(void) +PgSqlType Type::getElement(void) { return(element); } @@ -590,12 +590,12 @@ bool Type::isCollatable(void) return(collatable); } -PgSQLType Type::getLikeType(void) +PgSqlType Type::getLikeType(void) { return(like_type); } -PgSQLType Type::getSubtype(void) +PgSqlType Type::getSubtype(void) { return(subtype); } @@ -840,6 +840,6 @@ void Type::operator = (Type &type) i++; } - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } diff --git a/libpgmodeler/src/type.h b/libpgmodeler/src/type.h index b188a5afa7..21a8a93dd8 100644 --- a/libpgmodeler/src/type.h +++ b/libpgmodeler/src/type.h @@ -60,7 +60,7 @@ class Type: public BaseObject { preferred; //PREFERRED //! \brief Storage alignmnet (char, smallint (int2), integer (int4) ou double precision) - PgSQLType alignment, //ALIGNMENT + PgSqlType alignment, //ALIGNMENT element; //ELEMENT //! \brief Type's storage @@ -75,7 +75,7 @@ class Type: public BaseObject { /*! \brief Type which will have some of its attributes copied to the current type (only for base type). If like_type is 'any' means that the current type does not copy attributes of any type */ - PgSQLType like_type, //LIKE + PgSqlType like_type, //LIKE //! \brief Subtype used by a range type subtype; //SUBTYPE @@ -165,7 +165,7 @@ class Type: public BaseObject { void setCollatable(bool value); //! \brief Sets the alignment for the type (only for base type) - void setAlignment(PgSQLType type); + void setAlignment(PgSqlType type); //! \brief Sets the storage type (only for base type) void setStorage(StorageType strg); @@ -174,7 +174,7 @@ class Type: public BaseObject { void setDefaultValue(const QString &value); //! \brief Sets the element for the type (only for base type) - void setElement(PgSQLType elem); + void setElement(PgSqlType elem); //! \brief Sets the delimiter for the type (only for base type) void setDelimiter(char delim); @@ -186,15 +186,15 @@ class Type: public BaseObject { void setPreferred(bool value); //! \brief Sets the type that will be used as template (only for base type) - void setLikeType(PgSQLType like_type); + void setLikeType(PgSqlType like_type); //! \brief Sets the subtype that will be used by the range (only for range type) - void setSubtype(PgSQLType subtype); + void setSubtype(PgSqlType subtype); //! \brief Sets the subtype operator class (only for range type) void setSubtypeOpClass(OperatorClass *opclass); - PgSQLType getSubtype(void); + PgSqlType getSubtype(void); OperatorClass *getSubtypeOpClass(void); TypeAttribute getAttribute(unsigned attrib_idx); unsigned getAttributeCount(void); @@ -203,15 +203,15 @@ class Type: public BaseObject { unsigned getConfiguration(void); CategoryType getCategory(void); bool isPreferred(void); - PgSQLType getLikeType(void); + PgSqlType getLikeType(void); Function *getFunction(unsigned func_id); unsigned getInternalLength(void); bool isByValue(void); bool isCollatable(void); - PgSQLType getAlignment(void); + PgSqlType getAlignment(void); StorageType getStorage(void); QString getDefaultValue(void); - PgSQLType getElement(void); + PgSqlType getElement(void); char getDelimiter(void); /*! \brief Returns the SQL / XML definition for the type. If the boolean diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index 2e797f5877..3267b69686 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -23,13 +23,13 @@ TypeAttribute::TypeAttribute(void) obj_type=ObjectType::ObjTypeAttribute; } -void TypeAttribute::setType(PgSQLType type) +void TypeAttribute::setType(PgSqlType type) { setCodeInvalidated(this->type != type); this->type=type; } -PgSQLType TypeAttribute::getType(void) +PgSqlType TypeAttribute::getType(void) { return(type); } diff --git a/libpgmodeler/src/typeattribute.h b/libpgmodeler/src/typeattribute.h index a8385a3c19..89592783cb 100644 --- a/libpgmodeler/src/typeattribute.h +++ b/libpgmodeler/src/typeattribute.h @@ -29,15 +29,15 @@ class TypeAttribute: public BaseObject { private: - PgSQLType type; + PgSqlType type; QString getCodeDefinition(unsigned, bool){ return(""); } public: TypeAttribute(void); - void setType(PgSQLType type); - PgSQLType getType(void); + void setType(PgSqlType type); + PgSqlType getType(void); //! \brief Returns the SQL / XML code definition for the parameter virtual QString getCodeDefinition(unsigned def_type) final; diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index b2ed3b63fa..14bbcf3b43 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -55,14 +55,14 @@ void View::setName(const QString &name) { QString prev_name=this->getName(true); BaseObject::setName(name); - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } void View::setSchema(BaseObject *schema) { QString prev_name=this->getName(true); BaseObject::setSchema(schema); - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } void View::setProtected(bool value) @@ -996,7 +996,7 @@ void View::operator = (View &view) this->recursive=view.recursive; this->with_no_data=view.with_no_data; - PgSQLType::renameUserType(prev_name, this, this->getName(true)); + PgSqlType::renameUserType(prev_name, this, this->getName(true)); } vector View::getObjects(void) diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index 85a56f2a3f..527f03b4bb 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -86,7 +86,7 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, Obje void AggregateWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Aggregate *aggregate) { unsigned count, i; - PgSQLType type; + PgSqlType type; BaseObjectWidget::setAttributes(model,op_list, aggregate, schema); @@ -110,7 +110,7 @@ void AggregateWidget::setAttributes(DatabaseModel *model, OperationList *op_list { input_types_tab->addRow(); type=aggregate->getDataType(i); - input_types_tab->setRowData(QVariant::fromValue(type), i); + input_types_tab->setRowData(QVariant::fromValue(type), i); input_types_tab->setCellText(*type,i,0); } input_types_tab->blockSignals(false); @@ -124,10 +124,10 @@ void AggregateWidget::handleDataType(int row) { try { - PgSQLType type; + PgSqlType type; type=input_type->getPgSQLType(); - input_types_tab->setRowData(QVariant::fromValue(type), row); + input_types_tab->setRowData(QVariant::fromValue(type), row); input_types_tab->setCellText(*type,row,0); } catch(Exception &e) @@ -156,7 +156,7 @@ void AggregateWidget::applyConfiguration(void) count=input_types_tab->getRowCount(); for(i=0; i < count; i++) - aggregate->addDataType(input_types_tab->getRowData(i).value()); + aggregate->addDataType(input_types_tab->getRowData(i).value()); aggregate->setFunction(Aggregate::TransitionFunc, dynamic_cast(transition_func_sel->getSelectedObject())); aggregate->setFunction(Aggregate::FinalFunc, dynamic_cast(final_func_sel->getSelectedObject())); diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 2505089e34..ac8f5c36f0 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -38,7 +38,7 @@ /* Declaring the PgSQLType class as a Qt metatype in order to permit that instances of the class be used as data of QVariant and QMetaType */ #include -Q_DECLARE_METATYPE(PgSQLType) +Q_DECLARE_METATYPE(PgSqlType) class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { private: diff --git a/libpgmodeler_ui/src/castwidget.cpp b/libpgmodeler_ui/src/castwidget.cpp index 97d6d9a135..14ae5892e2 100644 --- a/libpgmodeler_ui/src/castwidget.cpp +++ b/libpgmodeler_ui/src/castwidget.cpp @@ -64,7 +64,7 @@ CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob void CastWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Cast *cast) { - PgSQLType src_type, trg_type; + PgSqlType src_type, trg_type; BaseObjectWidget::setAttributes(model, op_list, cast); conv_func_sel->setModel(model); diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 52f4e2a0ef..5421b8286c 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -97,7 +97,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType void ColumnWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Column *column) { - PgSQLType type; + PgSqlType type; if(!parent_obj) throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -120,7 +120,7 @@ void ColumnWidget::setAttributes(DatabaseModel *model, OperationList *op_list, B sequence_sel->setEnabled(true); sequence_sel->setSelectedObject(column->getSequence()); } - else if(column->getIdentityType() != BaseType::null) + else if(column->getIdentityType() != BaseType::Null) { identity_rb->click(); identity_type_cmb->setEnabled(true); @@ -130,8 +130,8 @@ void ColumnWidget::setAttributes(DatabaseModel *model, OperationList *op_list, B } data_type->setAttributes(type, model, - UserTypeConfig::BASE_TYPE | UserTypeConfig::TABLE_TYPE | UserTypeConfig::VIEW_TYPE | - UserTypeConfig::DOMAIN_TYPE | UserTypeConfig::EXTENSION_TYPE, true,false); + UserTypeConfig::BaseType | UserTypeConfig::TableType | UserTypeConfig::ViewType | + UserTypeConfig::DomainType | UserTypeConfig::ExtensionType, true,false); } void ColumnWidget::editSequenceAttributes(void) diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index fc5d278ddc..5ead7dadcb 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -91,7 +91,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion92)].push_back(no_inherit_lbl); fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_chk); - values_map[indexing_chk].push_back(~IndexingType(IndexingType::brin)); + values_map[indexing_chk].push_back(~IndexingType(IndexingType::Brin)); warn_frm=generateVersionWarningFrame(fields_map, &values_map); constraint_grid->addWidget(warn_frm, constraint_grid->count()+1, 0, 1, 0); @@ -298,45 +298,45 @@ void ConstraintWidget::selectConstraintType(void) { ConstraintType constr_type=ConstraintType(constr_type_cmb->currentText()); - tablespace_lbl->setVisible(constr_type==ConstraintType::primary_key || constr_type==ConstraintType::unique); - tablespace_sel->setVisible(constr_type==ConstraintType::primary_key || constr_type==ConstraintType::unique); + tablespace_lbl->setVisible(constr_type==ConstraintType::PrimaryKey || constr_type==ConstraintType::Unique); + tablespace_sel->setVisible(constr_type==ConstraintType::PrimaryKey || constr_type==ConstraintType::Unique); if(!tablespace_sel->isVisible()) tablespace_sel->clearSelector(); - expression_lbl->setVisible(constr_type==ConstraintType::check || constr_type==ConstraintType::exclude); - expression_txt->setVisible(constr_type==ConstraintType::check || constr_type==ConstraintType::exclude); - no_inherit_chk->setVisible(constr_type==ConstraintType::check); - no_inherit_lbl->setVisible(constr_type==ConstraintType::check); - warn_frm->setVisible(constr_type==ConstraintType::check); + expression_lbl->setVisible(constr_type==ConstraintType::Check || constr_type==ConstraintType::Exclude); + expression_txt->setVisible(constr_type==ConstraintType::Check || constr_type==ConstraintType::Exclude); + no_inherit_chk->setVisible(constr_type==ConstraintType::Check); + no_inherit_lbl->setVisible(constr_type==ConstraintType::Check); + warn_frm->setVisible(constr_type==ConstraintType::Check); - fill_factor_chk->setVisible(constr_type==ConstraintType::unique || - constr_type==ConstraintType::primary_key || - constr_type==ConstraintType::exclude); - fill_factor_sb->setVisible(constr_type==ConstraintType::unique || - constr_type==ConstraintType::primary_key || - constr_type==ConstraintType::exclude); + fill_factor_chk->setVisible(constr_type==ConstraintType::Unique || + constr_type==ConstraintType::PrimaryKey || + constr_type==ConstraintType::Exclude); + fill_factor_sb->setVisible(constr_type==ConstraintType::Unique || + constr_type==ConstraintType::PrimaryKey || + constr_type==ConstraintType::Exclude); - info_frm->setVisible(constr_type==ConstraintType::primary_key); + info_frm->setVisible(constr_type==ConstraintType::PrimaryKey); - deferrable_lbl->setVisible(constr_type!=ConstraintType::check); - deferrable_chk->setVisible(constr_type!=ConstraintType::check); - deferral_cmb->setVisible(constr_type!=ConstraintType::check); - deferral_lbl->setVisible(constr_type!=ConstraintType::check); + deferrable_lbl->setVisible(constr_type!=ConstraintType::Check); + deferrable_chk->setVisible(constr_type!=ConstraintType::Check); + deferral_cmb->setVisible(constr_type!=ConstraintType::Check); + deferral_lbl->setVisible(constr_type!=ConstraintType::Check); - match_lbl->setVisible(constr_type==ConstraintType::foreign_key); - match_cmb->setVisible(constr_type==ConstraintType::foreign_key); - on_delete_cmb->setVisible(constr_type==ConstraintType::foreign_key); - on_delete_lbl->setVisible(constr_type==ConstraintType::foreign_key); - on_update_cmb->setVisible(constr_type==ConstraintType::foreign_key); - on_update_lbl->setVisible(constr_type==ConstraintType::foreign_key); + match_lbl->setVisible(constr_type==ConstraintType::ForeignKey); + match_cmb->setVisible(constr_type==ConstraintType::ForeignKey); + on_delete_cmb->setVisible(constr_type==ConstraintType::ForeignKey); + on_delete_lbl->setVisible(constr_type==ConstraintType::ForeignKey); + on_update_cmb->setVisible(constr_type==ConstraintType::ForeignKey); + on_update_lbl->setVisible(constr_type==ConstraintType::ForeignKey); - columns_tbw->setVisible(constr_type!=ConstraintType::check && - constr_type!=ConstraintType::exclude); + columns_tbw->setVisible(constr_type!=ConstraintType::Check && + constr_type!=ConstraintType::Exclude); - indexing_chk->setVisible(constr_type==ConstraintType::exclude); - indexing_cmb->setVisible(constr_type==ConstraintType::exclude); + indexing_chk->setVisible(constr_type==ConstraintType::Exclude); + indexing_cmb->setVisible(constr_type==ConstraintType::Exclude); - if(constr_type!=ConstraintType::foreign_key) + if(constr_type!=ConstraintType::ForeignKey) { columns_tbw->setTabEnabled(1, false); columns_tbw->setCurrentIndex(0); @@ -345,7 +345,7 @@ void ConstraintWidget::selectConstraintType(void) else columns_tbw->setTabEnabled(1, true); - excl_elems_grp->setVisible(constr_type==ConstraintType::exclude); + excl_elems_grp->setVisible(constr_type==ConstraintType::Exclude); } void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Constraint *constr) @@ -388,7 +388,7 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis { excl_elems = constr->getExcludeElements(); - indexing_chk->setChecked(constr->getIndexType()!=BaseType::null); + indexing_chk->setChecked(constr->getIndexType()!=BaseType::Null); indexing_cmb->setCurrentIndex(indexing_cmb->findText(~constr->getIndexType())); constr_type_cmb->setCurrentIndex(constr_type_cmb->findText(~constr->getConstraintType())); @@ -462,9 +462,9 @@ void ConstraintWidget::applyConfiguration(void) if(indexing_chk->isChecked()) constr->setIndexType(IndexingType(indexing_cmb->currentText())); else - constr->setIndexType(BaseType::null); + constr->setIndexType(BaseType::Null); - if(constr->getConstraintType()==ConstraintType::foreign_key) + if(constr->getConstraintType()==ConstraintType::ForeignKey) constr->setReferencedTable(dynamic_cast(ref_table_sel->getSelectedObject())); constr->removeColumns(); @@ -484,7 +484,7 @@ void ConstraintWidget::applyConfiguration(void) constr->addExcludeElements(excl_elems); //Raises an error if the user try to create a primary key that has columns added by relationship (not supported) - if(constr->getConstraintType()==ConstraintType::primary_key && + if(constr->getConstraintType()==ConstraintType::PrimaryKey && constr->isReferRelationshipAddedColumn()) throw Exception(ErrorCode::UnsupportedPKColsAddedByRel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -492,17 +492,17 @@ void ConstraintWidget::applyConfiguration(void) /* Raises an error if the constraint type requires at least one column to be assinged and there is no columns configured on the form */ - if(((constr->getConstraintType()==ConstraintType::foreign_key || - constr->getConstraintType()==ConstraintType::primary_key) && + if(((constr->getConstraintType()==ConstraintType::ForeignKey || + constr->getConstraintType()==ConstraintType::PrimaryKey) && constr->getColumnCount(Constraint::SourceCols)==0) || - (constr->getConstraintType()==ConstraintType::foreign_key && + (constr->getConstraintType()==ConstraintType::ForeignKey && constr->getColumnCount(Constraint::ReferencedCols)==0)) throw Exception(ErrorCode::InvConstratintNoColumns,__PRETTY_FUNCTION__,__FILE__,__LINE__); finishConfiguration(); //For the foreign keys, updates the fk relationships on the model - if(constr->getConstraintType()==ConstraintType::foreign_key) + if(constr->getConstraintType()==ConstraintType::ForeignKey) this->model->updateTableFKRelationships(dynamic_cast
(this->table)); } catch(Exception &e) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 09141a73bb..478bf89e83 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -709,11 +709,11 @@ void DatabaseExplorerWidget::formatColumnAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) { - map types={{ParsersAttributes::PK_CONSTR, ConstraintType(ConstraintType::primary_key)}, - {ParsersAttributes::FK_CONSTR, ConstraintType(ConstraintType::foreign_key)}, - {ParsersAttributes::UQ_CONSTR, ConstraintType(ConstraintType::unique)}, - {ParsersAttributes::CK_CONSTR, ConstraintType(ConstraintType::check)}, - {ParsersAttributes::EX_CONSTR, ConstraintType(ConstraintType::exclude)}}; + map types={{ParsersAttributes::PK_CONSTR, ConstraintType(ConstraintType::PrimaryKey)}, + {ParsersAttributes::FK_CONSTR, ConstraintType(ConstraintType::ForeignKey)}, + {ParsersAttributes::UQ_CONSTR, ConstraintType(ConstraintType::Unique)}, + {ParsersAttributes::CK_CONSTR, ConstraintType(ConstraintType::Check)}, + {ParsersAttributes::EX_CONSTR, ConstraintType(ConstraintType::Exclude)}}; ConstraintType constr_type=types[attribs[ParsersAttributes::TYPE]]; QStringList names=getObjectName(ObjectType::ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); @@ -727,7 +727,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) Catalog::parseArrayValues(attribs[ParsersAttributes::SRC_COLUMNS]), names[0], names[1]).join(ElemSeparator); - if(constr_type==ConstraintType::foreign_key) + if(constr_type==ConstraintType::ForeignKey) { attribs[ParsersAttributes::REF_TABLE]=getObjectName(ObjectType::ObjTable, attribs[ParsersAttributes::REF_TABLE]); names=attribs[ParsersAttributes::REF_TABLE].split('.'); @@ -744,7 +744,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) attribs.erase(ParsersAttributes::COMPARISON_TYPE); } - if(constr_type==ConstraintType::check) + if(constr_type==ConstraintType::Check) { attribs.erase(ParsersAttributes::DEFERRABLE); attribs.erase(ParsersAttributes::DEFER_TYPE); @@ -752,7 +752,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) else attribs.erase(ParsersAttributes::EXPRESSION); - if(constr_type==ConstraintType::exclude) + if(constr_type==ConstraintType::Exclude) { attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); attribs[ParsersAttributes::OPERATORS]=getObjectsNames(ObjectType::ObjOperator, @@ -1579,7 +1579,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) { QTreeWidgetItem *fk_item=nullptr, *src_item=nullptr; - if(cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::foreign_key)) + if(cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::ForeignKey)) { /* Creates two items denoting the source columns and referenced tables. These items have a negative id indicating that no popup menu will be show if user @@ -1607,8 +1607,8 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) .arg(cached_attribs[ParsersAttributes::DST_COLUMNS])); fk_item->setFlags(Qt::ItemIsEnabled); } - else if(cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::unique) || - cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::primary_key)) + else if(cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::Unique) || + cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::PrimaryKey)) { QStringList columns=cached_attribs[ParsersAttributes::SRC_COLUMNS].split(ElemSeparator); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 9355defd73..b81449de24 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -836,9 +836,9 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe else if((obj_type==ObjectType::ObjTablespace && (name==QString("pg_default") || name==QString("pg_global"))) || (obj_type==ObjectType::ObjRole && (name==QString("postgres"))) || (obj_type==ObjectType::ObjSchema && (name==QString("pg_catalog") || name==QString("public"))) || - (obj_type==ObjectType::ObjLanguage && (name==~LanguageType(LanguageType::c) || - name==~LanguageType(LanguageType::sql) || - name==~LanguageType(LanguageType::plpgsql)))) + (obj_type==ObjectType::ObjLanguage && (name==~LanguageType(LanguageType::C) || + name==~LanguageType(LanguageType::Sql) || + name==~LanguageType(LanguageType::PlPgsql)))) { item->setFont(0, grp_fnt); item->setForeground(0, BaseObjectView::getFontStyle(ParsersAttributes::PROT_COLUMN).foreground()); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index bab3c87175..12664eb361 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1051,7 +1051,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) { Function *func=nullptr; Parameter param; - PgSQLType type; + PgSqlType type; unsigned dim=0; QStringList param_types, param_names, param_modes, param_def_vals, param_xmls; QString param_tmpl_name=QString("_param%1"); @@ -1072,7 +1072,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) (attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::SEND_FUNC || attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::OUTPUT_FUNC || attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CANONICAL_FUNC)) - type=PgSQLType(QString("\"any\"")); + type=PgSqlType(QString("\"any\"")); else { //If the type contains array descriptor [] set the dimension to 1 @@ -1080,7 +1080,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) //Create the type param_types[i].remove(QString("[]")); - type=PgSQLType::parseString(param_types[i]); + type=PgSqlType::parseString(param_types[i]); type.setDimension(dim); } @@ -1158,7 +1158,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::INPUT_FUNC || attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::RECV_FUNC || attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CANONICAL_FUNC) - attribs[ParsersAttributes::RETURN_TYPE]=PgSQLType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); + attribs[ParsersAttributes::RETURN_TYPE]=PgSqlType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); else attribs[ParsersAttributes::RETURN_TYPE]=getType(attribs[ParsersAttributes::RETURN_TYPE], true); } @@ -1569,7 +1569,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) if(values.size() >= 2) { type_attrib.setName(values[0].remove('"')); - type_attrib.setType(PgSQLType::parseString(values[1].remove('\\'))); + type_attrib.setType(PgSqlType::parseString(values[1].remove('\\'))); type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjectType::ObjCollation)); attribs[ParsersAttributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XmlDefinition); } @@ -1685,7 +1685,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) type_name=BaseObject::formatName(getObjectName(types[type_oid][ParsersAttributes::SCHEMA], true), false); type_name+=QString("."); - if(types[type_oid][ParsersAttributes::CATEGORY] == ~CategoryType(CategoryType::array)) + if(types[type_oid][ParsersAttributes::CATEGORY] == ~CategoryType(CategoryType::Array)) { int dim = types[type_oid][ParsersAttributes::NAME].count(QString("[]")); QString aux_name = types[type_oid][ParsersAttributes::NAME].remove(QString("[]")); @@ -1695,7 +1695,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) else type_name+=BaseObject::formatName(types[type_oid][ParsersAttributes::NAME], false); - is_type_registered=PgSQLType::isRegistered(type_name, dbmodel); + is_type_registered=PgSqlType::isRegistered(type_name, dbmodel); } else { @@ -1718,8 +1718,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::ObjDomain); } - col.setIdentityType(BaseType::null); - col.setType(PgSQLType::parseString(type_name)); + col.setIdentityType(BaseType::Null); + col.setType(PgSqlType::parseString(type_name)); col.setNotNull(!itr->second[ParsersAttributes::NOT_NULL].isEmpty()); col.setComment(itr->second[ParsersAttributes::COMMENT]); @@ -2182,7 +2182,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) loadObjectXML(ObjectType::ObjConstraint, attribs); constr=dbmodel->createConstraint(nullptr); - if(table && constr->getConstraintType()==ConstraintType::primary_key) + if(table && constr->getConstraintType()==ConstraintType::PrimaryKey) { table->addConstraint(constr); table->setModified(true); diff --git a/libpgmodeler_ui/src/databasewidget.cpp b/libpgmodeler_ui/src/databasewidget.cpp index 51a11cbd83..1e03edcffc 100644 --- a/libpgmodeler_ui/src/databasewidget.cpp +++ b/libpgmodeler_ui/src/databasewidget.cpp @@ -130,7 +130,7 @@ void DatabaseWidget::applyConfiguration(void) if(encoding_cmb->currentIndex() > 0) model->setEncoding(EncodingType(encoding_cmb->currentText())); else - model->setEncoding(EncodingType(BaseType::null)); + model->setEncoding(EncodingType(BaseType::Null)); if(lccollate_cmb->currentText()!=trUtf8("Default")) model->setLocalization(Collation::LcCollate, lccollate_cmb->currentText()); diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index bdf5624c03..f52ca2491a 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -66,7 +66,7 @@ DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType void DomainWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Domain *domain) { - PgSQLType type; + PgSqlType type; BaseObjectWidget::setAttributes(model, op_list, domain, schema); diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 1390e0e22b..571c87faea 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -43,7 +43,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent setRequiredField(function_lbl); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(event_lbl); - values_map[event_lbl].push_back(~EventTriggerType(EventTriggerType::table_rewrite)); + values_map[event_lbl].push_back(~EventTriggerType(EventTriggerType::TableRewrite)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); frame->setParent(this); diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index 0df2d9cc3b..a639d0445e 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -212,7 +212,7 @@ Parameter FunctionWidget::getParameter(ObjectsTableWidget *tab, unsigned row) try { param.setName(tab->getCellText(row,0)); - param.setType(tab->getRowData(row).value()); + param.setType(tab->getRowData(row).value()); if(tab==parameters_tab) { @@ -240,7 +240,7 @@ void FunctionWidget::showParameterData(Parameter param, ObjectsTableWidget *tab, tab->setCellText(param.getName(),row,0); tab->setCellText(*param.getType(),row,1); - tab->setRowData(QVariant::fromValue(param.getType()), row); + tab->setRowData(QVariant::fromValue(param.getType()), row); if(tab==parameters_tab) { @@ -265,7 +265,7 @@ void FunctionWidget::setAttributes(DatabaseModel *model, OperationList *op_list, QStringList list; unsigned count=0, i; Parameter param; - PgSQLType aux_type; + PgSqlType aux_type; BaseObjectWidget::setAttributes(model, op_list, func, schema); languages=model->getObjects(ObjectType::ObjLanguage); @@ -279,7 +279,7 @@ void FunctionWidget::setAttributes(DatabaseModel *model, OperationList *op_list, list.sort(); language_cmb->addItems(list); - language_cmb->setCurrentText(~LanguageType(LanguageType::sql)); + language_cmb->setCurrentText(~LanguageType(LanguageType::Sql)); if(func) { @@ -358,7 +358,7 @@ void FunctionWidget::selectLanguage(void) { bool c_lang; - c_lang=(language_cmb->currentText()==~LanguageType(LanguageType::c)); + c_lang=(language_cmb->currentText()==~LanguageType(LanguageType::C)); source_code_frm->setVisible(!c_lang); library_frm->setVisible(c_lang); @@ -519,7 +519,7 @@ void FunctionWidget::applyConfiguration(void) for(i=0; i < count; i++) { param.setName(parameters_tab->getCellText(i,0)); - param.setType(parameters_tab->getRowData(i).value()); + param.setType(parameters_tab->getRowData(i).value()); str_aux=parameters_tab->getCellText(i,2); param.setIn(str_aux.indexOf(QString("IN")) >= 0); @@ -532,7 +532,7 @@ void FunctionWidget::applyConfiguration(void) } - if(language_cmb->currentText()==~LanguageType(LanguageType::c)) + if(language_cmb->currentText()==~LanguageType(LanguageType::C)) { func->setLibrary(library_edt->text()); func->setSymbol(symbol_edt->text()); @@ -553,7 +553,7 @@ void FunctionWidget::applyConfiguration(void) for(i=0; iaddReturnedTableColumn(return_tab->getCellText(i,0), - return_tab->getRowData(i).value()); + return_tab->getRowData(i).value()); } } diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index 585878a84b..1bcf706a95 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -47,7 +47,7 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion92)].push_back(buffering_chk); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); - values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); + values_map[indexing_lbl].push_back(~IndexingType(IndexingType::Brin)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); frame->setParent(this); @@ -71,8 +71,8 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: void IndexWidget::selectIndexingType(void) { - fast_update_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::gin); - buffering_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::gist); + fast_update_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::Gin); + buffering_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::Gist); fill_factor_sb->setEnabled(fill_factor_chk->isChecked() && fill_factor_chk->isEnabled()); //enableSortingOptions(); } diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index adf537ef63..a292018347 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -305,15 +305,15 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr { constr_type=dynamic_cast(object)->getConstraintType(); - if(constr_type==ConstraintType::primary_key) + if(constr_type==ConstraintType::PrimaryKey) str_aux=QString("_%1").arg(TableObjectView::TextPrimaryKey); - else if(constr_type==ConstraintType::foreign_key) + else if(constr_type==ConstraintType::ForeignKey) str_aux=QString("_%1").arg(TableObjectView::TextForeignKey); - else if(constr_type==ConstraintType::check) + else if(constr_type==ConstraintType::Check) str_aux=QString("_%1").arg(TableObjectView::TextCheck); - else if(constr_type==ConstraintType::unique) + else if(constr_type==ConstraintType::Unique) str_aux=QString("_%1").arg(TableObjectView::TextUnique); - else if(constr_type==ConstraintType::exclude) + else if(constr_type==ConstraintType::Exclude) str_aux=QString("_%1").arg(TableObjectView::TextExclude); } diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index afa1c9542f..6ca096677a 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -156,7 +156,7 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d //Ignoring object with sql disabled or check constraints added by generalizations if(tab_obj->isSQLDisabled() || (constr && constr->isAddedByGeneralization() && - constr->getConstraintType()==ConstraintType::check)) + constr->getConstraintType()==ConstraintType::Check)) { generateDiffInfo(ObjectsDiffInfo::IgnoreObject, tab_obj); } @@ -169,7 +169,7 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d if(aux_obj && diff_type!=ObjectsDiffInfo::DropObject && ((tab_obj->isAddedByGeneralization() || !tab_obj->isAddedByLinking() || (aux_obj->getObjectType()==ObjectType::ObjColumn && tab_obj->isAddedByLinking())) || - (constr && constr->getConstraintType()!=ConstraintType::foreign_key))) + (constr && constr->getConstraintType()!=ConstraintType::ForeignKey))) { //If there are some differences on the XML code of the objects if(tab_obj->isCodeDiffersFrom(aux_obj)) @@ -684,7 +684,7 @@ void ModelsDiffHelper::processDiffInfos(void) check if the constraint is added by generalization or if this is not the case if it already exists in a ancestor table of its parent, this avoid the generation of commands to create or drop an inherited constraint raising errors when export the diff */ - if(constr && constr->getConstraintType()==ConstraintType::check) + if(constr && constr->getConstraintType()==ConstraintType::Check) { parent_tab=dynamic_cast
(constr->getParentTable()); skip_obj=constr->isAddedByGeneralization(); @@ -754,7 +754,7 @@ void ModelsDiffHelper::processDiffInfos(void) Primary keys, unique keys, check constraints and exclude constraints are created after foreign keys */ if(object->getObjectType()==ObjectType::ObjConstraint) { - if(dynamic_cast(object)->getConstraintType()==ConstraintType::foreign_key) + if(dynamic_cast(object)->getConstraintType()==ConstraintType::ForeignKey) create_fks[object->getObjectId()]=getCodeDefinition(object, false); else create_constrs[object->getObjectId()]=getCodeDefinition(object, false); @@ -794,7 +794,7 @@ void ModelsDiffHelper::processDiffInfos(void) create them at the end of diff buffer */ if(obj->getObjectType()==ObjectType::ObjConstraint) { - if(dynamic_cast(obj)->getConstraintType()==ConstraintType::foreign_key) + if(dynamic_cast(obj)->getConstraintType()==ConstraintType::ForeignKey) create_fks[obj->getObjectId()]=getCodeDefinition(obj, false); else create_constrs[obj->getObjectId()]=getCodeDefinition(obj, false); @@ -1038,7 +1038,7 @@ void ModelsDiffHelper::recreateObject(BaseObject *object, vector & { Constraint *constr=dynamic_cast(aux_obj); - if(constr->getConstraintType()==ConstraintType::primary_key) + if(constr->getConstraintType()==ConstraintType::PrimaryKey) { unsigned i=0, col_cnt=constr->getColumnCount(Constraint::SourceCols); vector ref_aux; @@ -1053,7 +1053,7 @@ void ModelsDiffHelper::recreateObject(BaseObject *object, vector & for(BaseObject *obj : ref_aux) { aux_constr=dynamic_cast(obj); - if(aux_constr && aux_constr->getConstraintType()==ConstraintType::foreign_key) + if(aux_constr && aux_constr->getConstraintType()==ConstraintType::ForeignKey) ref_objs.push_back(aux_constr); } } diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index 2bffcb1a35..b96e7d9214 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -342,7 +342,7 @@ void ModelValidationHelper::validateModel(void) at end of code defintion being free of any reference breaking. */ if(object != refs.back() && ( - ((col || (constr && constr->getConstraintType()!=ConstraintType::foreign_key)) && + ((col || (constr && constr->getConstraintType()!=ConstraintType::ForeignKey)) && (tab_obj->getParentTable()->getObjectId() <= object->getObjectId())) || (!constr && refs.back()->getObjectId() <= object->getObjectId())) @@ -395,7 +395,7 @@ void ModelValidationHelper::validateModel(void) { constr=dynamic_cast(tab_obj); - if(constr->getConstraintType()!=ConstraintType::primary_key) + if(constr->getConstraintType()!=ConstraintType::PrimaryKey) ref_cols=constr->getRelationshipAddedColumns(); } else if(obj_tp==ObjectType::ObjTrigger) @@ -475,9 +475,9 @@ void ModelValidationHelper::validateModel(void) /* If the object is an index or a primary key, unique or exclude constraint, insert the object on duplicated objects map */ if((!constr || - (constr && (constr->getConstraintType()==ConstraintType::primary_key || - constr->getConstraintType()==ConstraintType::unique || - constr->getConstraintType()==ConstraintType::exclude)))) + (constr && (constr->getConstraintType()==ConstraintType::PrimaryKey || + constr->getConstraintType()==ConstraintType::Unique || + constr->getConstraintType()==ConstraintType::Exclude)))) dup_objects[name].push_back(tab_obj); } } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 6e5e950577..d38dac6580 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2285,8 +2285,8 @@ void ModelWidget::copyObjects(bool duplicate_mode) !tab_obj->isAddedByRelationship() && (!constr || (((constr && - (constr->getConstraintType()==ConstraintType::foreign_key || - (constr->getConstraintType()==ConstraintType::unique && + (constr->getConstraintType()==ConstraintType::ForeignKey || + (constr->getConstraintType()==ConstraintType::Unique && constr->isReferRelationshipAddedColumn())))))))) deps.push_back(tab_obj); } @@ -2601,7 +2601,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) sel_table->setModified(true); } else if(constr && duplicate_mode && - constr->getConstraintType() == ConstraintType::primary_key && + constr->getConstraintType() == ConstraintType::PrimaryKey && constr->getParentTable()->getObjectIndex(constr) < 0) { constr->getParentTable()->addObject(constr); @@ -2609,7 +2609,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) } //Updates the fk relationships if the constraint is a foreign-key - if(constr && constr->getConstraintType()==ConstraintType::foreign_key) + if(constr && constr->getConstraintType()==ConstraintType::ForeignKey) db_model->updateTableFKRelationships(dynamic_cast
(tab_obj->getParentTable())); op_list->registerObject(tab_obj, Operation::ObjectCreated, -1, tab_obj->getParentTable()); @@ -2699,7 +2699,7 @@ void ModelWidget::duplicateObject(void) if(obj_type == ObjectType::ObjColumn) db_model->validateRelationships(); else if(obj_type == ObjectType::ObjConstraint && - dynamic_cast(object)->getConstraintType() == ConstraintType::foreign_key) + dynamic_cast(object)->getConstraintType() == ConstraintType::ForeignKey) db_model->updateTableFKRelationships(dynamic_cast
(table)); emit s_objectCreated(); @@ -2937,7 +2937,7 @@ void ModelWidget::removeObjects(bool cascade) aux_table=dynamic_cast
(table); if(aux_table && obj_type==ObjectType::ObjConstraint && - dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::foreign_key) + dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::ForeignKey) db_model->updateTableFKRelationships(aux_table); table->setModified(true); @@ -3883,11 +3883,11 @@ void ModelWidget::configurePopupMenu(const vector &objects) { switch(!constr->getConstraintType()) { - case ConstraintType::primary_key: str_aux=QString("_%1").arg(TableObjectView::TextPrimaryKey); break; - case ConstraintType::foreign_key: str_aux=QString("_%1").arg(TableObjectView::TextForeignKey); break; - case ConstraintType::check: str_aux=QString("_%1").arg(TableObjectView::TextCheck); break; - case ConstraintType::unique: str_aux=QString("_%1").arg(TableObjectView::TextUnique); break; - case ConstraintType::exclude: str_aux=QString("_%1").arg(TableObjectView::TextExclude); break; + case ConstraintType::PrimaryKey: str_aux=QString("_%1").arg(TableObjectView::TextPrimaryKey); break; + case ConstraintType::ForeignKey: str_aux=QString("_%1").arg(TableObjectView::TextForeignKey); break; + case ConstraintType::Check: str_aux=QString("_%1").arg(TableObjectView::TextCheck); break; + case ConstraintType::Unique: str_aux=QString("_%1").arg(TableObjectView::TextUnique); break; + case ConstraintType::Exclude: str_aux=QString("_%1").arg(TableObjectView::TextExclude); break; } //For each constaint is created a menu with the edit, source code, protect/unprotect and delete actions @@ -4126,7 +4126,7 @@ void ModelWidget::convertIntegerToSerial(void) QAction *action=dynamic_cast(sender()); Column *col=reinterpret_cast(action->data().value()); Table *tab=dynamic_cast
(col->getParentTable()); - PgSQLType col_type=col->getType(); + PgSqlType col_type=col->getType(); QRegExp regexp(QString("^nextval\\(.+\\:\\:regclass\\)")); QString serial_tp; @@ -4143,7 +4143,7 @@ void ModelWidget::convertIntegerToSerial(void) else serial_tp=QString("bigserial"); - col->setType(PgSQLType(serial_tp)); + col->setType(PgSqlType(serial_tp)); col->setDefaultValue(QString()); //Revalidate the relationships since the modified column can be a primary key diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index 47c04d1e82..bc109dc4a6 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -148,7 +148,7 @@ void ObjectRenameWidget::applyRenaming(void) /* If the object is a column and some primary key on table is referencing it the model relationship will be revalidated */ - if(col && tab->isConstraintRefColumn(col, ConstraintType::primary_key)) + if(col && tab->isConstraintRefColumn(col, ConstraintType::PrimaryKey)) model->validateRelationships(); tab->setModified(true); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 37ac2d9506..b006e80dbe 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -63,7 +63,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare configureFormLayout(grid, ObjectType::ObjOpClass); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); - values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); + values_map[indexing_lbl].push_back(~IndexingType(IndexingType::Brin)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); frame->setParent(this); @@ -205,7 +205,7 @@ void OperatorClassWidget::handleElement(int lin_idx) void OperatorClassWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, OperatorClass *op_class) { - PgSQLType type; + PgSqlType type; unsigned i, count; BaseObjectWidget::setAttributes(model, op_list, op_class, schema); diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index 0c409c23ac..b87fd4a3e7 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -33,7 +33,7 @@ OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(pa setRequiredField(indexing_lbl); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); - values_map[indexing_lbl].push_back(~IndexingType(IndexingType::brin)); + values_map[indexing_lbl].push_back(~IndexingType(IndexingType::Brin)); opfamily_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), opfamily_grid->count()+1, 0, 1, 0); diff --git a/libpgmodeler_ui/src/operatorwidget.cpp b/libpgmodeler_ui/src/operatorwidget.cpp index dea3b393fd..dfc33112db 100644 --- a/libpgmodeler_ui/src/operatorwidget.cpp +++ b/libpgmodeler_ui/src/operatorwidget.cpp @@ -81,7 +81,7 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, Object void OperatorWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Operator *oper) { unsigned i; - PgSQLType left_type, right_type; + PgSqlType left_type, right_type; BaseObjectWidget::setAttributes(model,op_list, oper, schema); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 792c9a8970..c57f6d2bad 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -126,8 +126,8 @@ namespace PgModelerUiNs { /* If the constraint is not FK but is declared outside table via alter (ALTER TABLE...ADD CONSTRAINT...) or The constraint is FK and the reference table is disabled the FK will not be enabled */ - if((constr->getConstraintType()!=ConstraintType::foreign_key && !constr->isDeclaredInTable()) || - (constr->getConstraintType()==ConstraintType::foreign_key && + if((constr->getConstraintType()!=ConstraintType::ForeignKey && !constr->isDeclaredInTable()) || + (constr->getConstraintType()==ConstraintType::ForeignKey && (disable || (!disable && !constr->getReferencedTable()->isSQLDisabled())))) constr->setSQLDisabled(disable); } diff --git a/libpgmodeler_ui/src/pgsqltypewidget.cpp b/libpgmodeler_ui/src/pgsqltypewidget.cpp index d647187cdd..a64e1b4e45 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.cpp +++ b/libpgmodeler_ui/src/pgsqltypewidget.cpp @@ -121,11 +121,11 @@ void PgSQLTypeWidget::updateTypeFormat(void) spatial_tp=SpatialType(spatial_cmb->currentText(), srid_spb->value()); if(var_z_chk->isChecked() && var_m_chk->isChecked()) - spatial_tp.setVariation(SpatialType::var_zm); + spatial_tp.setVariation(SpatialType::VarZm); else if(var_m_chk->isChecked()) - spatial_tp.setVariation(SpatialType::var_m); + spatial_tp.setVariation(SpatialType::VarM); else if(var_z_chk->isChecked()) - spatial_tp.setVariation(SpatialType::var_z); + spatial_tp.setVariation(SpatialType::VarZ); type.setSpatialType(spatial_tp); } @@ -154,21 +154,21 @@ void PgSQLTypeWidget::listPgSQLTypes(QComboBox *combo, DatabaseModel *model, uns combo->clear(); //Getting the user defined type adding them into the combo - PgSQLType::getUserTypes(types,model, user_type_conf); + PgSqlType::getUserTypes(types,model, user_type_conf); types.sort(); count=types.size(); for(idx=0; idx < count; idx++) - combo->addItem(types[idx], QVariant(PgSQLType::getUserTypeIndex(types[idx],nullptr,model))); + combo->addItem(types[idx], QVariant(PgSqlType::getUserTypeIndex(types[idx],nullptr,model))); //Getting the built-in type adding them into the combo - PgSQLType::getTypes(types, oid_types, pseudo_types); + PgSqlType::getTypes(types, oid_types, pseudo_types); types.sort(); combo->addItems(types); } } -void PgSQLTypeWidget::setAttributes(PgSQLType type, DatabaseModel *model, unsigned usr_type_conf, bool oid_types, bool pseudo_types) +void PgSQLTypeWidget::setAttributes(PgSqlType type, DatabaseModel *model, unsigned usr_type_conf, bool oid_types, bool pseudo_types) { try { @@ -210,7 +210,7 @@ void PgSQLTypeWidget::setAttributes(PgSQLType type, DatabaseModel *model, unsig } } -PgSQLType PgSQLTypeWidget::getPgSQLType(void) +PgSqlType PgSQLTypeWidget::getPgSQLType(void) { if(format_txt->toPlainText() == InvalidType) throw Exception(ErrorCode::AsgInvalidTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler_ui/src/pgsqltypewidget.h b/libpgmodeler_ui/src/pgsqltypewidget.h index 84432fdeaa..5de7574e69 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.h +++ b/libpgmodeler_ui/src/pgsqltypewidget.h @@ -37,7 +37,7 @@ class PgSQLTypeWidget: public QWidget, public Ui::PgSQLTypeWidget { Q_OBJECT //! \brief Stores the PostgreSQL type configured on the form - PgSQLType type; + PgSqlType type; //! \brief Syntax highlighter used on the format field SyntaxHighlighter *format_hl; @@ -53,19 +53,19 @@ class PgSQLTypeWidget: public QWidget, public Ui::PgSQLTypeWidget { must be shown using the last tree parameters. The DatabaseModel parameter is used to gather the user-defined types of the specified model. */ static void listPgSQLTypes(QComboBox *combo, DatabaseModel *model, - unsigned user_type_conf=UserTypeConfig::ALL_USER_TYPES, + unsigned user_type_conf=UserTypeConfig::AllUserTypes, bool oid_types=true, bool pseudo_types=true); private slots: void updateTypeFormat(void); public slots: - void setAttributes(PgSQLType type, DatabaseModel *model, - unsigned usr_type_conf=UserTypeConfig::ALL_USER_TYPES, + void setAttributes(PgSqlType type, DatabaseModel *model, + unsigned usr_type_conf=UserTypeConfig::AllUserTypes, bool oid_types=true, bool pseudo_types=true); //! \brief Returns the PostgreSQL type configured via form - PgSQLType getPgSQLType(void); + PgSqlType getPgSQLType(void); }; #endif diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index bf28a50632..e3ec878acc 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -544,9 +544,9 @@ void RelationshipWidget::generateBoundingExpr(void) PartitioningType part_type = part_type_lbl->text(); QString tmpl; - if(part_type == PartitioningType::list) + if(part_type == PartitioningType::List) tmpl = QString("IN (value)"); - else if(part_type == PartitioningType::range) + else if(part_type == PartitioningType::Range) tmpl = QString("FROM (value) TO (value)"); else tmpl = QString("WITH (MODULUS m, REMAINDER r)"); @@ -1138,8 +1138,8 @@ void RelationshipWidget::applyConfiguration(void) { rel->setDeferrable(deferrable_chk->isChecked()); rel->setDeferralType(DeferralType(deferral_cmb->currentText())); - rel->setActionType((del_action_cmb->currentIndex()!=0 ? ActionType(del_action_cmb->currentText()) : ActionType::null), Constraint::DeleteAction); - rel->setActionType((upd_action_cmb->currentIndex()!=0 ? ActionType(upd_action_cmb->currentText()) : ActionType::null), Constraint::UpdateAction); + rel->setActionType((del_action_cmb->currentIndex()!=0 ? ActionType(del_action_cmb->currentText()) : ActionType::Null), Constraint::DeleteAction); + rel->setActionType((upd_action_cmb->currentIndex()!=0 ? ActionType(upd_action_cmb->currentText()) : ActionType::Null), Constraint::UpdateAction); if(rel_type==BaseRelationship::RelationshipNn) rel->setSiglePKColumn(single_pk_chk->isChecked()); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index c311a0520d..aaa2253557 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -431,8 +431,8 @@ void TableWidget::showObjectData(TableObject *object, int row) ObjectType obj_type; QString str_aux, str_aux1; - QStringList contr_types={ ~ConstraintType(ConstraintType::primary_key), ~ConstraintType(ConstraintType::foreign_key), - ~ConstraintType(ConstraintType::check), ~ConstraintType(ConstraintType::unique), + QStringList contr_types={ ~ConstraintType(ConstraintType::PrimaryKey), ~ConstraintType(ConstraintType::ForeignKey), + ~ConstraintType(ConstraintType::Check), ~ConstraintType(ConstraintType::Unique), QString("NOT NULL") }, constr_codes={ TableObjectView::TextPrimaryKey, TableObjectView::TextForeignKey, @@ -442,8 +442,8 @@ void TableWidget::showObjectData(TableObject *object, int row) QFont font; unsigned i; - EventType events[]={ EventType::on_insert, EventType::on_delete, - EventType::on_truncate, EventType::on_update }; + EventType events[]={ EventType::OnInsert, EventType::OnDelete, + EventType::OnTruncate, EventType::OnUpdate }; obj_type=object->getObjectType(); tab=objects_tab_map[obj_type]; @@ -467,7 +467,7 @@ void TableWidget::showObjectData(TableObject *object, int row) //Column 3: Column defaul value if(column->getSequence()) str_aux=QString("nextval('%1'::regclass)").arg(column->getSequence()->getName(true).remove('"')); - else if(column->getIdentityType() != BaseType::null) + else if(column->getIdentityType() != BaseType::Null) str_aux=QString("GENERATED %1 AS IDENTITY").arg(~column->getIdentityType()); else str_aux=column->getDefaultValue(); @@ -508,7 +508,7 @@ void TableWidget::showObjectData(TableObject *object, int row) //Column 1: Constraint type tab->setCellText(~constr->getConstraintType(),row,1); - if(constr->getConstraintType()==ConstraintType::foreign_key) + if(constr->getConstraintType()==ConstraintType::ForeignKey) { //Column 2: ON DELETE action tab->setCellText(~constr->getActionType(false),row,2); @@ -826,16 +826,16 @@ void TableWidget::applyConfiguration(void) table->setUnlogged(unlogged_chk->isChecked()); table->setTag(dynamic_cast(tag_sel->getSelectedObject())); - part_type = partitioning_type_cmb->currentIndex() == 0 ? BaseType::null : PartitioningType(partitioning_type_cmb->currentText()); + part_type = partitioning_type_cmb->currentIndex() == 0 ? BaseType::Null : PartitioningType(partitioning_type_cmb->currentText()); table->setPartitioningType(part_type); - if(part_type != BaseType::null) + if(part_type != BaseType::Null) { partition_keys_tab->getElements(part_keys); table->addPartitionKeys(part_keys); if(part_keys.empty()) - part_type = BaseType::null; + part_type = BaseType::Null; } else table->removePartitionKeys(); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index 68931d1b6f..dc62b48389 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -115,7 +115,7 @@ void TriggerWidget::setConstraintTrigger(bool value) deferrable_chk->setChecked(false); } else - firing_mode_cmb->setCurrentText(~FiringType(FiringType::after)); + firing_mode_cmb->setCurrentText(~FiringType(FiringType::After)); } void TriggerWidget::enableTransitionTableNames(void) @@ -134,8 +134,8 @@ void TriggerWidget::enableTransitionTableNames(void) num_evnts++; } - old_table_edt->setEnabled(firing_type == FiringType::after && num_evnts == 1 && (update_chk->isChecked() || delete_chk->isChecked())); - new_table_edt->setEnabled(firing_type == FiringType::after && num_evnts == 1 && (update_chk->isChecked() || insert_chk->isChecked())); + old_table_edt->setEnabled(firing_type == FiringType::After && num_evnts == 1 && (update_chk->isChecked() || delete_chk->isChecked())); + new_table_edt->setEnabled(firing_type == FiringType::After && num_evnts == 1 && (update_chk->isChecked() || insert_chk->isChecked())); } void TriggerWidget::addColumn(int lin_idx) @@ -237,10 +237,10 @@ void TriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, deferral_type_cmb->setCurrentIndex(deferral_type_cmb->findText(~trigger->getDeferralType())); firing_mode_cmb->setCurrentIndex(firing_mode_cmb->findText(~trigger->getFiringType())); - insert_chk->setChecked(trigger->isExecuteOnEvent(EventType::on_insert)); - delete_chk->setChecked(trigger->isExecuteOnEvent(EventType::on_delete)); - update_chk->setChecked(trigger->isExecuteOnEvent(EventType::on_update)); - truncate_chk->setChecked(trigger->isExecuteOnEvent(EventType::on_truncate)); + insert_chk->setChecked(trigger->isExecuteOnEvent(EventType::OnInsert)); + delete_chk->setChecked(trigger->isExecuteOnEvent(EventType::OnDelete)); + update_chk->setChecked(trigger->isExecuteOnEvent(EventType::OnUpdate)); + truncate_chk->setChecked(trigger->isExecuteOnEvent(EventType::OnTruncate)); ref_table_sel->setSelectedObject(trigger->getReferencedTable()); function_sel->setSelectedObject(trigger->getFunction()); @@ -292,10 +292,10 @@ void TriggerWidget::applyConfiguration(void) trigger->setCondition(cond_expr_txt->toPlainText()); trigger->setFunction(dynamic_cast(function_sel->getSelectedObject())); trigger->setReferecendTable(dynamic_cast
(ref_table_sel->getSelectedObject())); - trigger->setEvent(EventType::on_insert, insert_chk->isChecked()); - trigger->setEvent(EventType::on_update, update_chk->isChecked()); - trigger->setEvent(EventType::on_delete, delete_chk->isChecked()); - trigger->setEvent(EventType::on_truncate, truncate_chk->isChecked()); + trigger->setEvent(EventType::OnInsert, insert_chk->isChecked()); + trigger->setEvent(EventType::OnUpdate, update_chk->isChecked()); + trigger->setEvent(EventType::OnDelete, delete_chk->isChecked()); + trigger->setEvent(EventType::OnTruncate, truncate_chk->isChecked()); trigger->setTransitionTableName(Trigger::OldTableName, old_table_edt->isEnabled() ? old_table_edt->text() : QString()); trigger->setTransitionTableName(Trigger::NewTableName, new_table_edt->isEnabled() ? new_table_edt->text() : QString()); trigger->removeArguments(); diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index bc31bf91a0..c52b0a67b2 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -206,14 +206,14 @@ void TypeWidget::handleAttribute(int row) void TypeWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Type *type) { - PgSQLType like_tp, elem_tp; + PgSqlType like_tp, elem_tp; unsigned type_conf, i, count; BaseObjectWidget::setAttributes(model, op_list, type, schema); attrib_collation_sel->setModel(model); - attrib_type_wgt->setAttributes(PgSQLType(), model); - range_subtype->setAttributes(PgSQLType(), model); + attrib_type_wgt->setAttributes(PgSqlType(), model); + range_subtype->setAttributes(PgSqlType(), model); opclass_sel->setModel(model); @@ -346,7 +346,7 @@ void TypeWidget::applyConfiguration(void) type->setDefaultValue(default_value_edt->text()); type->setCategory(CategoryType(category_cmb->currentText())); - type->setAlignment(PgSQLType(alignment_cmb->currentText())); + type->setAlignment(PgSqlType(alignment_cmb->currentText())); type->setStorage(StorageType(storage_cmb->currentText())); for(i=Type::InputFunc; i <= Type::AnalyzeFunc; i++) diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 73a5a12fd4..80ad8f7eba 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -343,8 +343,8 @@ void ViewWidget::showObjectData(TableObject *object, int row) ObjectType obj_type; QString str_aux; unsigned i; - EventType events[]={ EventType::on_insert, EventType::on_delete, - EventType::on_truncate, EventType::on_update }; + EventType events[]={ EventType::OnInsert, EventType::OnDelete, + EventType::OnTruncate, EventType::OnUpdate }; obj_type=object->getObjectType(); tab=objects_tab_map[obj_type]; diff --git a/tests/src/partrelationshiptest/partrelationshiptest.cpp b/tests/src/partrelationshiptest/partrelationshiptest.cpp index 268ded8e53..f9f7f4a687 100644 --- a/tests/src/partrelationshiptest/partrelationshiptest.cpp +++ b/tests/src/partrelationshiptest/partrelationshiptest.cpp @@ -45,14 +45,14 @@ void PartRelationhipTest::connRelTableNoColumnsAndTableTwoColumns(void) partitioned->setSchema(schema); partition->setSchema(schema); - partitioned->setPartitioningType(PartitioningType::list); + partitioned->setPartitioningType(PartitioningType::List); partitioned->setName("table_a"); partition->setName("partion_a"); col->setName("id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("sku"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); partitioned->addColumn(col); partitioned->addColumn(col1); @@ -82,14 +82,14 @@ void PartRelationhipTest::connRelTablesTwoColumnsSameNameShouldNotRaiseError(voi partitioned->setSchema(schema); partition->setSchema(schema); - partitioned->setPartitioningType(PartitioningType::list); + partitioned->setPartitioningType(PartitioningType::List); partitioned->setName("table_a"); partition->setName("partion_a"); col->setName("id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("sku"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); partitioned->addColumn(col); partitioned->addColumn(col1); @@ -97,9 +97,9 @@ void PartRelationhipTest::connRelTablesTwoColumnsSameNameShouldNotRaiseError(voi col = new Column; col1 = new Column; col->setName("id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("sku"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); partition->addColumn(col); partition->addColumn(col1); @@ -129,14 +129,14 @@ void PartRelationhipTest::connRelTablePartionHasMoreColsThanPartitionedTableShou partitioned->setSchema(schema); partition->setSchema(schema); - partitioned->setPartitioningType(PartitioningType::list); + partitioned->setPartitioningType(PartitioningType::List); partitioned->setName("table_a"); partition->setName("partion_a"); col->setName("id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("sku"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); partitioned->addColumn(col); partitioned->addColumn(col1); @@ -144,12 +144,12 @@ void PartRelationhipTest::connRelTablePartionHasMoreColsThanPartitionedTableShou col = new Column; col1 = new Column; col->setName("id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("sku"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); col2 = new Column; col2->setName("date"); - col2->setType(PgSQLType("date")); + col2->setType(PgSqlType("date")); partition->addColumn(col); partition->addColumn(col1); @@ -180,14 +180,14 @@ void PartRelationhipTest::connRelTablePartionHasDifferentColsThanPartitionedTabl partitioned->setSchema(schema); partition->setSchema(schema); - partitioned->setPartitioningType(PartitioningType::list); + partitioned->setPartitioningType(PartitioningType::List); partitioned->setName("table_a"); partition->setName("partion_a"); col->setName("id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("sku"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); partitioned->addColumn(col); partitioned->addColumn(col1); @@ -195,9 +195,9 @@ void PartRelationhipTest::connRelTablePartionHasDifferentColsThanPartitionedTabl col = new Column; col1 = new Column; col->setName("tag_id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("serial_number"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); partition->addColumn(col); partition->addColumn(col1); @@ -227,14 +227,14 @@ void PartRelationhipTest::connRelShouldInvalidateIfPartitionedColumnChanges(void partitioned->setSchema(schema); partition->setSchema(schema); - partitioned->setPartitioningType(PartitioningType::list); + partitioned->setPartitioningType(PartitioningType::List); partitioned->setName("table_a"); partition->setName("partion_a"); col->setName("id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("sku"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); partitioned->addColumn(col); partitioned->addColumn(col1); @@ -242,9 +242,9 @@ void PartRelationhipTest::connRelShouldInvalidateIfPartitionedColumnChanges(void col = new Column; col1 = new Column; col->setName("id"); - col->setType(PgSQLType("serial")); + col->setType(PgSqlType("serial")); col1->setName("sku"); - col1->setType(PgSQLType("smallint")); + col1->setType(PgSqlType("smallint")); partition->addColumn(col); partition->addColumn(col1); @@ -256,7 +256,7 @@ void PartRelationhipTest::connRelShouldInvalidateIfPartitionedColumnChanges(void QVERIFY(part_rel->isInvalidated() == true); partitioned->getColumn(0)->setName("id"); - partitioned->getColumn(0)->setType(PgSQLType("date")); + partitioned->getColumn(0)->setType(PgSqlType("date")); QVERIFY(part_rel->isInvalidated() == true); } catch(Exception &e) From ce6b67bdaae7bc2d8e533ec0fd152d2a13a9e4fe Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Oct 2018 16:20:46 -0300 Subject: [PATCH 176/425] Another refactoring on ObjectType enumerations removing the prefix 'Obj' --- libobjrenderer/src/baseobjectview.cpp | 2 +- libobjrenderer/src/graphicalview.cpp | 12 +- libobjrenderer/src/objectsscene.cpp | 32 +- libobjrenderer/src/relationshipview.cpp | 2 +- libobjrenderer/src/schemaview.cpp | 4 +- libobjrenderer/src/tableobjectview.cpp | 8 +- libobjrenderer/src/tabletitleview.cpp | 8 +- libobjrenderer/src/tableview.cpp | 24 +- libobjrenderer/src/textboxview.cpp | 4 +- libpgconnector/src/catalog.cpp | 70 +- libpgmodeler/src/aggregate.cpp | 4 +- libpgmodeler/src/basegraphicobject.cpp | 4 +- libpgmodeler/src/baseobject.cpp | 168 +-- libpgmodeler/src/baseobject.h | 72 +- libpgmodeler/src/baserelationship.cpp | 8 +- libpgmodeler/src/basetable.cpp | 2 +- libpgmodeler/src/cast.cpp | 12 +- libpgmodeler/src/collation.cpp | 2 +- libpgmodeler/src/column.cpp | 8 +- libpgmodeler/src/constraint.cpp | 4 +- libpgmodeler/src/conversion.cpp | 12 +- libpgmodeler/src/databasemodel.cpp | 1116 ++++++++--------- libpgmodeler/src/databasemodel.h | 2 +- libpgmodeler/src/domain.cpp | 4 +- libpgmodeler/src/eventtrigger.cpp | 6 +- libpgmodeler/src/extension.cpp | 2 +- libpgmodeler/src/function.cpp | 4 +- libpgmodeler/src/genericsql.cpp | 2 +- libpgmodeler/src/index.cpp | 2 +- libpgmodeler/src/language.cpp | 6 +- libpgmodeler/src/operationlist.cpp | 86 +- libpgmodeler/src/operator.cpp | 8 +- libpgmodeler/src/operatorclass.cpp | 2 +- libpgmodeler/src/operatorfamily.cpp | 2 +- libpgmodeler/src/parameter.cpp | 2 +- libpgmodeler/src/permission.cpp | 36 +- libpgmodeler/src/pgmodelerns.cpp | 60 +- libpgmodeler/src/pgmodelerns.h | 10 +- libpgmodeler/src/policy.cpp | 6 +- libpgmodeler/src/relationship.cpp | 62 +- libpgmodeler/src/role.cpp | 2 +- libpgmodeler/src/rule.cpp | 2 +- libpgmodeler/src/schema.cpp | 4 +- libpgmodeler/src/sequence.cpp | 2 +- libpgmodeler/src/table.cpp | 160 +-- libpgmodeler/src/tableobject.cpp | 4 +- libpgmodeler/src/tablespace.cpp | 4 +- libpgmodeler/src/tag.cpp | 2 +- libpgmodeler/src/textbox.cpp | 2 +- libpgmodeler/src/trigger.cpp | 16 +- libpgmodeler/src/type.cpp | 8 +- libpgmodeler/src/typeattribute.cpp | 2 +- libpgmodeler/src/view.cpp | 30 +- libpgmodeler_ui/src/aggregatewidget.cpp | 10 +- .../src/appearanceconfigwidget.cpp | 36 +- libpgmodeler_ui/src/baseform.cpp | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 80 +- libpgmodeler_ui/src/baseobjectwidget.h | 6 +- libpgmodeler_ui/src/castwidget.cpp | 6 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 24 +- libpgmodeler_ui/src/collationwidget.cpp | 4 +- libpgmodeler_ui/src/columnwidget.cpp | 8 +- libpgmodeler_ui/src/constraintwidget.cpp | 8 +- libpgmodeler_ui/src/conversionwidget.cpp | 6 +- libpgmodeler_ui/src/customsqlwidget.cpp | 14 +- .../src/databaseexplorerwidget.cpp | 266 ++-- libpgmodeler_ui/src/databaseimportform.cpp | 44 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 348 ++--- libpgmodeler_ui/src/databaseimporthelper.h | 2 +- libpgmodeler_ui/src/databasewidget.cpp | 28 +- libpgmodeler_ui/src/datamanipulationform.cpp | 56 +- libpgmodeler_ui/src/domainwidget.cpp | 4 +- libpgmodeler_ui/src/elementwidget.cpp | 22 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 6 +- libpgmodeler_ui/src/extensionwidget.cpp | 4 +- libpgmodeler_ui/src/functionwidget.cpp | 24 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 4 +- libpgmodeler_ui/src/indexwidget.cpp | 4 +- libpgmodeler_ui/src/languagewidget.cpp | 10 +- libpgmodeler_ui/src/mainwindow.cpp | 6 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 2 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 8 +- libpgmodeler_ui/src/modelexportform.cpp | 2 +- libpgmodeler_ui/src/modelexporthelper.cpp | 76 +- libpgmodeler_ui/src/modelexporthelper.h | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 102 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 64 +- libpgmodeler_ui/src/modelsdiffhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 38 +- libpgmodeler_ui/src/modelvalidationhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationwidget.cpp | 4 +- libpgmodeler_ui/src/modelwidget.cpp | 418 +++--- .../src/newobjectoverlaywidget.cpp | 88 +- libpgmodeler_ui/src/objectdepsrefswidget.cpp | 4 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 12 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 16 +- libpgmodeler_ui/src/objectsdiffinfo.cpp | 6 +- libpgmodeler_ui/src/objectselectorwidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 2 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 14 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 4 +- libpgmodeler_ui/src/operatorwidget.cpp | 8 +- libpgmodeler_ui/src/parameterwidget.cpp | 4 +- libpgmodeler_ui/src/permissionwidget.cpp | 10 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 10 +- libpgmodeler_ui/src/policywidget.cpp | 8 +- libpgmodeler_ui/src/referencewidget.cpp | 2 +- libpgmodeler_ui/src/relationshipwidget.cpp | 76 +- libpgmodeler_ui/src/resultsetmodel.cpp | 2 +- libpgmodeler_ui/src/rolewidget.cpp | 6 +- libpgmodeler_ui/src/rulewidget.cpp | 4 +- libpgmodeler_ui/src/schemawidget.cpp | 4 +- libpgmodeler_ui/src/sequencewidget.cpp | 6 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 12 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 20 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 12 +- libpgmodeler_ui/src/tabledatawidget.cpp | 10 +- libpgmodeler_ui/src/tablespacewidget.cpp | 4 +- libpgmodeler_ui/src/tablewidget.cpp | 190 +-- libpgmodeler_ui/src/tagwidget.cpp | 4 +- libpgmodeler_ui/src/textboxwidget.cpp | 4 +- libpgmodeler_ui/src/triggerwidget.cpp | 16 +- libpgmodeler_ui/src/typewidget.cpp | 12 +- libpgmodeler_ui/src/viewwidget.cpp | 72 +- main-cli/src/pgmodelercli.cpp | 78 +- main-cli/src/pgmodelercli.h | 2 +- plugins/xml2object/src/xml2objectwidget.cpp | 2 +- 128 files changed, 2299 insertions(+), 2299 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 787176d6f3..fb3d9659e3 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -161,7 +161,7 @@ void BaseObjectView::setSourceObject(BaseObject *object) this->addToGroup(pos_info_txt); } - if(!sql_disabled_box && object->getObjectType()!=ObjectType::ObjTextbox) + if(!sql_disabled_box && object->getObjectType()!=ObjectType::Textbox) { sql_disabled_txt=new QGraphicsSimpleTextItem; sql_disabled_box=new QGraphicsRectItem; diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index f13bc61fc8..646eae46c0 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -97,14 +97,14 @@ void GraphicalView::configureObject(void) i--; } - tab_objs.assign(view->getObjectList(ObjectType::ObjRule)->begin(), - view->getObjectList(ObjectType::ObjRule)->end()); + tab_objs.assign(view->getObjectList(ObjectType::Rule)->begin(), + view->getObjectList(ObjectType::Rule)->end()); tab_objs.insert(tab_objs.end(), - view->getObjectList(ObjectType::ObjTrigger)->begin(), - view->getObjectList(ObjectType::ObjTrigger)->end()); + view->getObjectList(ObjectType::Trigger)->begin(), + view->getObjectList(ObjectType::Trigger)->end()); tab_objs.insert(tab_objs.end(), - view->getObjectList(ObjectType::ObjIndex)->begin(), - view->getObjectList(ObjectType::ObjIndex)->end()); + view->getObjectList(ObjectType::Index)->begin(), + view->getObjectList(ObjectType::Index)->end()); ext_attribs->setVisible(!tab_objs.empty() && !hide_ext_attribs); ext_attribs_body->setVisible(!tab_objs.empty() && !hide_ext_attribs); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 4964badf36..e0863dc79f 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -71,8 +71,8 @@ ObjectsScene::~ObjectsScene(void) { QGraphicsItemGroup *item=nullptr; QList items; - ObjectType obj_types[]={ ObjectType::ObjRelationship, ObjectType::ObjTextbox, - ObjectType::ObjView, ObjectType::ObjTable, ObjectType::ObjSchema }; + ObjectType obj_types[]={ ObjectType::Relationship, ObjectType::Textbox, + ObjectType::View, ObjectType::Table, ObjectType::Schema }; unsigned i, count=sizeof(obj_types)/sizeof(ObjectType); this->removeItem(selection_rect); @@ -95,12 +95,12 @@ ObjectsScene::~ObjectsScene(void) /* Case the object is converted to a item group and can be converted to database objects, indicates that the object can be removed from the scene */ if(item && !item->parentItem() && - ((dynamic_cast(item) && obj_types[i]==ObjectType::ObjRelationship) || - (dynamic_cast(item) && obj_types[i]==ObjectType::ObjTextbox) || - (dynamic_cast(item) && obj_types[i]==ObjectType::ObjTextbox) || - (dynamic_cast(item) && obj_types[i]==ObjectType::ObjView) || - (dynamic_cast(item) && obj_types[i]==ObjectType::ObjTable) || - (dynamic_cast(item) && obj_types[i]==ObjectType::ObjSchema))) + ((dynamic_cast(item) && obj_types[i]==ObjectType::Relationship) || + (dynamic_cast(item) && obj_types[i]==ObjectType::Textbox) || + (dynamic_cast(item) && obj_types[i]==ObjectType::Textbox) || + (dynamic_cast(item) && obj_types[i]==ObjectType::View) || + (dynamic_cast(item) && obj_types[i]==ObjectType::Table) || + (dynamic_cast(item) && obj_types[i]==ObjectType::Schema))) { this->removeItem(item); @@ -173,8 +173,8 @@ QRectF ObjectsScene::itemsBoundingRect(bool seek_only_db_objs, bool selected_onl if(graph_obj) { - if(graph_obj->getObjectType()!=ObjectType::ObjRelationship && - graph_obj->getObjectType()!=ObjectType::ObjBaseRelationship) + if(graph_obj->getObjectType()!=ObjectType::Relationship && + graph_obj->getObjectType()!=ObjectType::BaseRelationship) pnt=graph_obj->getPosition(); else pnt=dynamic_cast(obj_view)->__boundingRect().topLeft(); @@ -187,8 +187,8 @@ QRectF ObjectsScene::itemsBoundingRect(bool seek_only_db_objs, bool selected_onl if(selected_only) { - if(graph_obj->getObjectType()!=ObjectType::ObjRelationship && - graph_obj->getObjectType()!=ObjectType::ObjBaseRelationship) + if(graph_obj->getObjectType()!=ObjectType::Relationship && + graph_obj->getObjectType()!=ObjectType::BaseRelationship) pnt = pnt + dynamic_cast(obj_view)->boundingRect().bottomRight(); else pnt = pnt + dynamic_cast(obj_view)->__boundingRect().bottomRight(); @@ -291,8 +291,8 @@ void ObjectsScene::showRelationshipLine(bool value, const QPointF &p_start) base_obj=dynamic_cast(object->getSourceObject()); if(!value && base_obj && - base_obj->getObjectType()!=ObjectType::ObjRelationship && - base_obj->getObjectType()!=ObjectType::ObjBaseRelationship && + base_obj->getObjectType()!=ObjectType::Relationship && + base_obj->getObjectType()!=ObjectType::BaseRelationship && !base_obj->isProtected()) flags=QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable | @@ -907,8 +907,8 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) if(!schema->isProtected()) { //Get the table-table and table-view relationships - rels=dynamic_cast(schema->getDatabase())->getObjects(ObjectType::ObjRelationship, schema); - base_rels=dynamic_cast(schema->getDatabase())->getObjects(ObjectType::ObjBaseRelationship, schema); + rels=dynamic_cast(schema->getDatabase())->getObjects(ObjectType::Relationship, schema); + base_rels=dynamic_cast(schema->getDatabase())->getObjects(ObjectType::BaseRelationship, schema); rels.insert(rels.end(), base_rels.begin(), base_rels.end()); for(auto &rel : rels) diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 8ccbf44786..39da34ee0f 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1226,7 +1226,7 @@ void RelationshipView::configureLine(void) for semantics purposes shows the type of this relationship as "Relationship" unlike "Link" */ if(rel_type==BaseRelationship::RelationshipFk) tool_tip=base_rel->getName(true) + - QString(" (") + BaseObject::getTypeName(ObjectType::ObjRelationship) + QString(")"); + QString(" (") + BaseObject::getTypeName(ObjectType::Relationship) + QString(")"); else tool_tip=base_rel->getName(true) + QString(" (") + base_rel->getTypeName() + QString(")"); diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index 40fdd47fb5..af68baf379 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -77,8 +77,8 @@ void SchemaView::fetchChildren(void) vector objs, objs1; //Gets all tables and views that belongs to the schema - objs=model->getObjects(ObjectType::ObjTable, schema); - objs1=model->getObjects(ObjectType::ObjView, schema); + objs=model->getObjects(ObjectType::Table, schema); + objs1=model->getObjects(ObjectType::View, schema); objs.insert(objs.end(), objs1.begin(), objs1.end()); children.clear(); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index ecca681dba..40295f0222 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -54,7 +54,7 @@ TableObjectView::~TableObjectView(void) void TableObjectView::configureDescriptor(ConstraintType constr_type) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; Column *column=dynamic_cast(this->getSourceObject()); bool ellipse_desc=false; double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); @@ -150,7 +150,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setPen(pen); } } - else if(obj_type != ObjectType::ObjBaseObject) + else if(obj_type != ObjectType::BaseObject) { TableObject *tab_obj=dynamic_cast(this->getSourceObject()); QGraphicsPolygonItem *desc=dynamic_cast(descriptor); @@ -556,8 +556,8 @@ QString TableObjectView::getConstraintString(Column *column) vector::iterator itr,itr_end; ConstraintType constr_type; - itr=table->getObjectList(ObjectType::ObjConstraint)->begin(); - itr_end=table->getObjectList(ObjectType::ObjConstraint)->end(); + itr=table->getObjectList(ObjectType::Constraint)->begin(); + itr_end=table->getObjectList(ObjectType::Constraint)->end(); while(itr!=itr_end) { diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 5980c17f95..d510388263 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -60,14 +60,14 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(!object) throw Exception(ErrorCode::OprNotAllocatedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Raises an error if the object is invalid - else if(object->getObjectType()!=ObjectType::ObjTable && - object->getObjectType()!=ObjectType::ObjView) + else if(object->getObjectType()!=ObjectType::Table && + object->getObjectType()!=ObjectType::View) throw Exception(ErrorCode::OprObjectInvalidType, __PRETTY_FUNCTION__, __FILE__, __LINE__); schema=dynamic_cast(object->getSchema()); tag=dynamic_cast(object)->getTag(); - if(object->getObjectType()==ObjectType::ObjView && !tag) + if(object->getObjectType()==ObjectType::View && !tag) { name_attrib=ParsersAttributes::VIEW_NAME; schema_name_attrib=ParsersAttributes::VIEW_SCHEMA_NAME; @@ -122,7 +122,7 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(tag) pen.setColor(tag->getElementColor(title_color_attrib, Tag::BorderColor)); - if(object->getObjectType()==ObjectType::ObjView || + if(object->getObjectType()==ObjectType::View || (table && table->isPartition())) pen.setStyle(Qt::DashLine); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 18135bc8fc..7c79a76042 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -54,25 +54,25 @@ void TableView::configureObject(void) if(obj_idx==0) { - tab_objs.assign(table->getObjectList(ObjectType::ObjColumn)->begin(), - table->getObjectList(ObjectType::ObjColumn)->end()); + tab_objs.assign(table->getObjectList(ObjectType::Column)->begin(), + table->getObjectList(ObjectType::Column)->end()); } else { - tab_objs.assign(table->getObjectList(ObjectType::ObjConstraint)->begin(), - table->getObjectList(ObjectType::ObjConstraint)->end()); + tab_objs.assign(table->getObjectList(ObjectType::Constraint)->begin(), + table->getObjectList(ObjectType::Constraint)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjectType::ObjTrigger)->begin(), - table->getObjectList(ObjectType::ObjTrigger)->end()); + table->getObjectList(ObjectType::Trigger)->begin(), + table->getObjectList(ObjectType::Trigger)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjectType::ObjIndex)->begin(), - table->getObjectList(ObjectType::ObjIndex)->end()); + table->getObjectList(ObjectType::Index)->begin(), + table->getObjectList(ObjectType::Index)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjectType::ObjRule)->begin(), - table->getObjectList(ObjectType::ObjRule)->end()); + table->getObjectList(ObjectType::Rule)->begin(), + table->getObjectList(ObjectType::Rule)->end()); tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjectType::ObjPolicy)->begin(), - table->getObjectList(ObjectType::ObjPolicy)->end()); + table->getObjectList(ObjectType::Policy)->begin(), + table->getObjectList(ObjectType::Policy)->end()); } //Gets the subitems of the current group diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index d1843a5fdb..fe5a4430bf 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -89,8 +89,8 @@ void TextboxView::__configureObject(void) if(!override_style) { QFont font; - box->setBrush(this->getFillStyle(BaseObject::getSchemaName(ObjectType::ObjTextbox))); - box->setPen(this->getBorderStyle(BaseObject::getSchemaName(ObjectType::ObjTextbox))); + box->setBrush(this->getFillStyle(BaseObject::getSchemaName(ObjectType::Textbox))); + box->setPen(this->getBorderStyle(BaseObject::getSchemaName(ObjectType::Textbox))); font=fmt.font(); font.setItalic(txtbox->getTextAttribute(Textbox::ItalicText)); diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 8f321096e7..75298cfc6f 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -30,35 +30,35 @@ const QString Catalog::PgModelerTempDbObj=QString("__pgmodeler_tmp"); attribs_map Catalog::catalog_queries; map Catalog::oid_fields= -{ {ObjectType::ObjDatabase, "oid"}, {ObjectType::ObjRole, "oid"}, {ObjectType::ObjSchema,"oid"}, - {ObjectType::ObjLanguage, "oid"}, {ObjectType::ObjTablespace, "oid"}, {ObjectType::ObjExtension, "ex.oid"}, - {ObjectType::ObjFunction, "pr.oid"}, {ObjectType::ObjAggregate, "pr.oid"}, {ObjectType::ObjOperator, "op.oid"}, - {ObjectType::ObjOpClass, "op.oid"}, {ObjectType::ObjOpFamily, "op.oid"}, {ObjectType::ObjCollation, "cl.oid"}, - {ObjectType::ObjConversion, "cn.oid"}, {ObjectType::ObjCast, "cs.oid"}, {ObjectType::ObjView, "vw.oid"}, - {ObjectType::ObjSequence, "sq.oid"}, {ObjectType::ObjDomain, "dm.oid"}, {ObjectType::ObjType, "tp.oid"}, - {ObjectType::ObjTable, "tb.oid"}, {ObjectType::ObjColumn, "cl.oid"}, {ObjectType::ObjConstraint, "cs.oid"}, - {ObjectType::ObjRule, "rl.oid"}, {ObjectType::ObjTrigger, "tg.oid"}, {ObjectType::ObjIndex, "id.indexrelid"}, - {ObjectType::ObjEventTrigger, "et.oid"}, {ObjectType::ObjPolicy, "pl.oid"} +{ {ObjectType::Database, "oid"}, {ObjectType::Role, "oid"}, {ObjectType::Schema,"oid"}, + {ObjectType::Language, "oid"}, {ObjectType::Tablespace, "oid"}, {ObjectType::Extension, "ex.oid"}, + {ObjectType::Function, "pr.oid"}, {ObjectType::Aggregate, "pr.oid"}, {ObjectType::Operator, "op.oid"}, + {ObjectType::OpClass, "op.oid"}, {ObjectType::OpFamily, "op.oid"}, {ObjectType::Collation, "cl.oid"}, + {ObjectType::Conversion, "cn.oid"}, {ObjectType::Cast, "cs.oid"}, {ObjectType::View, "vw.oid"}, + {ObjectType::Sequence, "sq.oid"}, {ObjectType::Domain, "dm.oid"}, {ObjectType::Type, "tp.oid"}, + {ObjectType::Table, "tb.oid"}, {ObjectType::Column, "cl.oid"}, {ObjectType::Constraint, "cs.oid"}, + {ObjectType::Rule, "rl.oid"}, {ObjectType::Trigger, "tg.oid"}, {ObjectType::Index, "id.indexrelid"}, + {ObjectType::EventTrigger, "et.oid"}, {ObjectType::Policy, "pl.oid"} }; map Catalog::ext_oid_fields={ - {ObjectType::ObjConstraint, "cs.conrelid"}, - {ObjectType::ObjIndex, "id.indexrelid"}, - {ObjectType::ObjTrigger, "tg.tgrelid"}, - {ObjectType::ObjRule, "rl.ev_class"}, - {ObjectType::ObjPolicy, "pl.polrelid"} + {ObjectType::Constraint, "cs.conrelid"}, + {ObjectType::Index, "id.indexrelid"}, + {ObjectType::Trigger, "tg.tgrelid"}, + {ObjectType::Rule, "rl.ev_class"}, + {ObjectType::Policy, "pl.polrelid"} }; map Catalog::name_fields= -{ {ObjectType::ObjDatabase, "datname"}, {ObjectType::ObjRole, "rolname"}, {ObjectType::ObjSchema,"nspname"}, - {ObjectType::ObjLanguage, "lanname"}, {ObjectType::ObjTablespace, "spcname"}, {ObjectType::ObjExtension, "extname"}, - {ObjectType::ObjFunction, "proname"}, {ObjectType::ObjAggregate, "proname"}, {ObjectType::ObjOperator, "oprname"}, - {ObjectType::ObjOpClass, "opcname"}, {ObjectType::ObjOpFamily, "opfname"}, {ObjectType::ObjCollation, "collname"}, - {ObjectType::ObjConversion, "conname"}, {ObjectType::ObjCast, ""}, {ObjectType::ObjView, "relname"}, - {ObjectType::ObjSequence, "relname"}, {ObjectType::ObjDomain, "typname"}, {ObjectType::ObjType, "typname"}, - {ObjectType::ObjTable, "relname"}, {ObjectType::ObjColumn, "attname"}, {ObjectType::ObjConstraint, "conname"}, - {ObjectType::ObjRule, "rulename"}, {ObjectType::ObjTrigger, "tgname"}, {ObjectType::ObjIndex, "relname"}, - {ObjectType::ObjEventTrigger, "evtname"}, {ObjectType::ObjPolicy, "polname"} +{ {ObjectType::Database, "datname"}, {ObjectType::Role, "rolname"}, {ObjectType::Schema,"nspname"}, + {ObjectType::Language, "lanname"}, {ObjectType::Tablespace, "spcname"}, {ObjectType::Extension, "extname"}, + {ObjectType::Function, "proname"}, {ObjectType::Aggregate, "proname"}, {ObjectType::Operator, "oprname"}, + {ObjectType::OpClass, "opcname"}, {ObjectType::OpFamily, "opfname"}, {ObjectType::Collation, "collname"}, + {ObjectType::Conversion, "conname"}, {ObjectType::Cast, ""}, {ObjectType::View, "relname"}, + {ObjectType::Sequence, "relname"}, {ObjectType::Domain, "typname"}, {ObjectType::Type, "typname"}, + {ObjectType::Table, "relname"}, {ObjectType::Column, "attname"}, {ObjectType::Constraint, "conname"}, + {ObjectType::Rule, "rulename"}, {ObjectType::Trigger, "tgname"}, {ObjectType::Index, "relname"}, + {ObjectType::EventTrigger, "evtname"}, {ObjectType::Policy, "polname"} }; Catalog::Catalog(void) @@ -84,7 +84,7 @@ void Catalog::setConnection(Connection &conn) connection.connect(); //Retrieving the last system oid - executeCatalogQuery(QueryList, ObjectType::ObjDatabase, res, true, + executeCatalogQuery(QueryList, ObjectType::Database, res, true, {{ParsersAttributes::NAME, conn.getConnectionParam(Connection::ParamDbName)}}); if(res.accessTuple(ResultSet::FirstTuple)) @@ -197,7 +197,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b else attribs[ParsersAttributes::OID_FILTER_OP]=QString(">"); - if(obj_type==ObjectType::ObjType && exclude_array_types) + if(obj_type==ObjectType::Type && exclude_array_types) attribs[ParsersAttributes::EXC_BUILTIN_ARRAYS]=ParsersAttributes::_TRUE_; //Checking if the custom filter expression is present @@ -207,7 +207,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b attribs.erase(ParsersAttributes::CUSTOM_FILTER); } - if(exclude_ext_objs && obj_type!=ObjectType::ObjDatabase && obj_type!=ObjectType::ObjRole && obj_type!=ObjectType::ObjTablespace && obj_type!=ObjectType::ObjExtension) + if(exclude_ext_objs && obj_type!=ObjectType::Database && obj_type!=ObjectType::Role && obj_type!=ObjectType::Tablespace && obj_type!=ObjectType::Extension) { if(ext_oid_fields.count(obj_type)==0) attribs[ParsersAttributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(oid_fields[obj_type]); @@ -287,9 +287,9 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map types=BaseObject::getObjectTypes(true, { ObjectType::ObjDatabase, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, - ObjectType::ObjTextbox, ObjectType::ObjTag, ObjectType::ObjColumn, ObjectType::ObjPermission, - ObjectType::ObjGenericSQL }); + vector types=BaseObject::getObjectTypes(true, { ObjectType::Database, ObjectType::Relationship, ObjectType::BaseRelationship, + ObjectType::Textbox, ObjectType::Tag, ObjectType::Column, ObjectType::Permission, + ObjectType::GenericSql }); attribs_map attribs, col_attribs, sch_names; vector tab_attribs; unsigned tab_oid=0; @@ -303,16 +303,16 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map Catalog::getObjectsAttributes(ObjectType obj_type, const QSt { try { - bool is_shared_obj=(obj_type==ObjectType::ObjDatabase || obj_type==ObjectType::ObjRole || obj_type==ObjectType::ObjTablespace || - obj_type==ObjectType::ObjLanguage || obj_type==ObjectType::ObjCast); + bool is_shared_obj=(obj_type==ObjectType::Database || obj_type==ObjectType::Role || obj_type==ObjectType::Tablespace || + obj_type==ObjectType::Language || obj_type==ObjectType::Cast); extra_attribs[ParsersAttributes::SCHEMA]=schema; extra_attribs[ParsersAttributes::TABLE]=table; @@ -600,7 +600,7 @@ vector Catalog::getObjectsAttributes(ObjectType obj_type, const QSt extra_attribs[ParsersAttributes::FILTER_OIDS]=createOidFilter(filter_oids); //Retrieve the comment catalog query. Only columns need to retreive comments in their own catalog query file - if(obj_type != ObjectType::ObjColumn) + if(obj_type != ObjectType::Column) extra_attribs[ParsersAttributes::COMMENT]=getCommentQuery(oid_fields[obj_type], is_shared_obj); return(getMultipleAttributes(obj_type, extra_attribs)); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 35e934da04..43db1ddc2f 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -20,7 +20,7 @@ Aggregate::Aggregate(void) { - obj_type=ObjectType::ObjAggregate; + obj_type=ObjectType::Aggregate; functions[0]=functions[1]=nullptr; sort_operator=nullptr; attributes[ParsersAttributes::TYPES]=QString(); @@ -42,7 +42,7 @@ void Aggregate::setFunction(unsigned func_idx, Function *func) if(!isValidFunction(func_idx, func)) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidConfiguration) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjAggregate)), + .arg(BaseObject::getTypeName(ObjectType::Aggregate)), ErrorCode::AsgFunctionInvalidConfiguration,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(functions[func_idx]!=func); diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 75607f0bc7..eab3acf5c2 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -118,6 +118,6 @@ QObject *BaseGraphicObject::getReceiverObject(void) bool BaseGraphicObject::isGraphicObject(ObjectType type) { - return(type==ObjectType::ObjTable || type==ObjectType::ObjView || type==ObjectType::ObjRelationship || - type==ObjectType::ObjBaseRelationship || type==ObjectType::ObjTextbox || type==ObjectType::ObjSchema); + return(type==ObjectType::Table || type==ObjectType::View || type==ObjectType::Relationship || + type==ObjectType::BaseRelationship || type==ObjectType::Textbox || type==ObjectType::Schema); } diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 52635dac66..a5f50371c8 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -76,7 +76,7 @@ BaseObject::BaseObject(void) object_id=BaseObject::global_id++; is_protected=system_obj=sql_disabled=false; code_invalidated=true; - obj_type=ObjectType::ObjBaseObject; + obj_type=ObjectType::BaseObject; schema=nullptr; owner=nullptr; tablespace=nullptr; @@ -105,7 +105,7 @@ unsigned BaseObject::getGlobalId(void) QString BaseObject::getTypeName(ObjectType obj_type) { - if(obj_type!=ObjectType::ObjBaseObject) + if(obj_type!=ObjectType::BaseObject) /* Due to the class BaseObject not be derived from QObject the function tr() is inefficient to translate the type names thus the method called to do the translation is from the application specifying the context (BaseObject) in the ts file and the text to be translated */ @@ -121,7 +121,7 @@ QString BaseObject::getTypeName(const QString &type_str) ObjectType BaseObject::getObjectType(const QString &type_name) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; for(int i=0; i < BaseObject::ObjectTypeCount; i++) { @@ -324,7 +324,7 @@ bool BaseObject::isValidName(const QString &name) void BaseObject::setDatabase(BaseObject *db) { - if((db && db->getObjectType()==ObjectType::ObjDatabase) || !db) + if((db && db->getObjectType()==ObjectType::Database) || !db) this->database=db; } @@ -378,13 +378,13 @@ void BaseObject::setComment(const QString &comment) bool BaseObject::acceptsSchema(ObjectType obj_type) { - return(obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjTable || - obj_type==ObjectType::ObjView || obj_type==ObjectType::ObjDomain || - obj_type==ObjectType::ObjAggregate || obj_type==ObjectType::ObjOperator || - obj_type==ObjectType::ObjSequence || obj_type==ObjectType::ObjConversion || - obj_type==ObjectType::ObjType || obj_type==ObjectType::ObjOpClass || - obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjCollation || - obj_type==ObjectType::ObjExtension); + return(obj_type==ObjectType::Function || obj_type==ObjectType::Table || + obj_type==ObjectType::View || obj_type==ObjectType::Domain || + obj_type==ObjectType::Aggregate || obj_type==ObjectType::Operator || + obj_type==ObjectType::Sequence || obj_type==ObjectType::Conversion || + obj_type==ObjectType::Type || obj_type==ObjectType::OpClass || + obj_type==ObjectType::OpFamily || obj_type==ObjectType::Collation || + obj_type==ObjectType::Extension); } bool BaseObject::acceptsSchema(void) @@ -394,15 +394,15 @@ bool BaseObject::acceptsSchema(void) bool BaseObject::acceptsOwner(ObjectType obj_type) { - return(obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjTable || - obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjSchema || - obj_type==ObjectType::ObjAggregate || obj_type==ObjectType::ObjOperator || - obj_type==ObjectType::ObjConversion || obj_type==ObjectType::ObjSequence || - obj_type==ObjectType::ObjLanguage || obj_type==ObjectType::ObjType || - obj_type==ObjectType::ObjTablespace || obj_type==ObjectType::ObjDatabase || - obj_type==ObjectType::ObjOpClass || obj_type==ObjectType::ObjOpFamily || - obj_type==ObjectType::ObjCollation || obj_type==ObjectType::ObjView || - obj_type==ObjectType::ObjEventTrigger); + return(obj_type==ObjectType::Function || obj_type==ObjectType::Table || + obj_type==ObjectType::Domain || obj_type==ObjectType::Schema || + obj_type==ObjectType::Aggregate || obj_type==ObjectType::Operator || + obj_type==ObjectType::Conversion || obj_type==ObjectType::Sequence || + obj_type==ObjectType::Language || obj_type==ObjectType::Type || + obj_type==ObjectType::Tablespace || obj_type==ObjectType::Database || + obj_type==ObjectType::OpClass || obj_type==ObjectType::OpFamily || + obj_type==ObjectType::Collation || obj_type==ObjectType::View || + obj_type==ObjectType::EventTrigger); } bool BaseObject::acceptsOwner(void) @@ -412,11 +412,11 @@ bool BaseObject::acceptsOwner(void) bool BaseObject::acceptsTablespace(ObjectType obj_type) { - return(obj_type==ObjectType::ObjIndex || - obj_type==ObjectType::ObjTable || - obj_type==ObjectType::ObjView || - obj_type==ObjectType::ObjConstraint || - obj_type==ObjectType::ObjDatabase); + return(obj_type==ObjectType::Index || + obj_type==ObjectType::Table || + obj_type==ObjectType::View || + obj_type==ObjectType::Constraint || + obj_type==ObjectType::Database); } bool BaseObject::acceptsTablespace(void) @@ -426,9 +426,9 @@ bool BaseObject::acceptsTablespace(void) bool BaseObject::acceptsCollation(ObjectType obj_type) { - return(obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjColumn || - obj_type==ObjectType::ObjCollation || obj_type==ObjectType::ObjType || - obj_type==ObjectType::ObjTypeAttribute); + return(obj_type==ObjectType::Domain || obj_type==ObjectType::Column || + obj_type==ObjectType::Collation || obj_type==ObjectType::Type || + obj_type==ObjectType::TypeAttribute); } bool BaseObject::acceptsCollation(void) @@ -438,40 +438,40 @@ bool BaseObject::acceptsCollation(void) bool BaseObject::acceptsCustomSQL(ObjectType obj_type) { - return(obj_type!=ObjectType::ObjColumn && obj_type!=ObjectType::ObjConstraint && - obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjParameter && - obj_type!=ObjectType::ObjTypeAttribute && obj_type!=ObjectType::ObjBaseRelationship && - obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjBaseTable && obj_type!=ObjectType::ObjPermission && - obj_type!=ObjectType::ObjTag && obj_type!=ObjectType::ObjGenericSQL); + return(obj_type!=ObjectType::Column && obj_type!=ObjectType::Constraint && + obj_type!=ObjectType::Relationship && obj_type!=ObjectType::Textbox && obj_type!=ObjectType::Parameter && + obj_type!=ObjectType::TypeAttribute && obj_type!=ObjectType::BaseRelationship && + obj_type!=ObjectType::BaseObject && obj_type!=ObjectType::BaseTable && obj_type!=ObjectType::Permission && + obj_type!=ObjectType::Tag && obj_type!=ObjectType::GenericSql); } bool BaseObject::acceptsAlterCommand(ObjectType obj_type) { - return(obj_type==ObjectType::ObjCollation || obj_type==ObjectType::ObjColumn || - obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjEventTrigger || - obj_type==ObjectType::ObjExtension || obj_type==ObjectType::ObjFunction || - obj_type==ObjectType::ObjIndex || obj_type==ObjectType::ObjRole || - obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjSequence || - obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjTablespace || - obj_type==ObjectType::ObjType || obj_type==ObjectType::ObjPolicy); + return(obj_type==ObjectType::Collation || obj_type==ObjectType::Column || + obj_type==ObjectType::Domain || obj_type==ObjectType::EventTrigger || + obj_type==ObjectType::Extension || obj_type==ObjectType::Function || + obj_type==ObjectType::Index || obj_type==ObjectType::Role || + obj_type==ObjectType::Schema || obj_type==ObjectType::Sequence || + obj_type==ObjectType::Table || obj_type==ObjectType::Tablespace || + obj_type==ObjectType::Type || obj_type==ObjectType::Policy); } bool BaseObject::acceptsDropCommand(ObjectType obj_type) { - return(obj_type!=ObjectType::ObjPermission && obj_type!=ObjectType::ObjRelationship && - obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjTypeAttribute && - obj_type!=ObjectType::ObjParameter && obj_type!=ObjectType::ObjBaseObject && - obj_type!=ObjectType::ObjTag && obj_type!=ObjectType::ObjBaseRelationship && - obj_type!=ObjectType::ObjBaseTable); + return(obj_type!=ObjectType::Permission && obj_type!=ObjectType::Relationship && + obj_type!=ObjectType::Textbox && obj_type!=ObjectType::TypeAttribute && + obj_type!=ObjectType::Parameter && obj_type!=ObjectType::BaseObject && + obj_type!=ObjectType::Tag && obj_type!=ObjectType::BaseRelationship && + obj_type!=ObjectType::BaseTable); } bool BaseObject::acceptsAlias(ObjectType obj_type) { - return(obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjBaseRelationship || - obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjView || - obj_type == ObjectType::ObjColumn || obj_type == ObjectType::ObjConstraint || - obj_type == ObjectType::ObjIndex || obj_type == ObjectType::ObjRule || - obj_type == ObjectType::ObjTrigger || obj_type == ObjectType::ObjPolicy); + return(obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship || + obj_type==ObjectType::Table || obj_type==ObjectType::Schema || obj_type==ObjectType::View || + obj_type == ObjectType::Column || obj_type == ObjectType::Constraint || + obj_type == ObjectType::Index || obj_type == ObjectType::Rule || + obj_type == ObjectType::Trigger || obj_type == ObjectType::Policy); } bool BaseObject::acceptsCustomSQL(void) @@ -496,7 +496,7 @@ void BaseObject::setSchema(BaseObject *schema) .arg(this->obj_name) .arg(this->getTypeName()), ErrorCode::AsgNotAllocatedSchema,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(schema && schema->getObjectType()!=ObjectType::ObjSchema) + else if(schema && schema->getObjectType()!=ObjectType::Schema) throw Exception(ErrorCode::AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsSchema()) throw Exception(ErrorCode::AsgInvalidSchemaObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -507,7 +507,7 @@ void BaseObject::setSchema(BaseObject *schema) void BaseObject::setOwner(BaseObject *owner) { - if(owner && owner->getObjectType()!=ObjectType::ObjRole) + if(owner && owner->getObjectType()!=ObjectType::Role) throw Exception(ErrorCode::AsgInvalidRoleObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsOwner()) throw Exception(ErrorCode::AsgRoleObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -518,7 +518,7 @@ void BaseObject::setOwner(BaseObject *owner) void BaseObject::setTablespace(BaseObject *tablespace) { - if(tablespace && tablespace->getObjectType()!=ObjectType::ObjTablespace) + if(tablespace && tablespace->getObjectType()!=ObjectType::Tablespace) throw Exception(ErrorCode::AsgInvalidTablespaceObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!acceptsTablespace()) throw Exception(ErrorCode::AsgTablespaceInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -531,7 +531,7 @@ void BaseObject::setCollation(BaseObject *collation) { if(collation && !acceptsCollation()) throw Exception(ErrorCode::AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(collation && collation->getObjectType()!=ObjectType::ObjCollation) + if(collation && collation->getObjectType()!=ObjectType::Collation) throw Exception(ErrorCode::AsgInvalidCollationObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->collation != collation); @@ -561,7 +561,7 @@ QString BaseObject::getName(bool format, bool prepend_schema) if(format) { QString aux_name; - aux_name=formatName(this->obj_name, (obj_type==ObjectType::ObjOperator)); + aux_name=formatName(this->obj_name, (obj_type==ObjectType::Operator)); if(this->schema && prepend_schema) aux_name=formatName(this->schema->getName(format)) + QString(".") + aux_name; @@ -697,11 +697,11 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) QString code_def; if((def_type==SchemaParser::SqlDefinition && - obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjBaseRelationship && - obj_type!=ObjectType::ObjBaseTable && obj_type!=ObjectType::ObjTextbox) || + obj_type!=ObjectType::BaseObject && obj_type!=ObjectType::BaseRelationship && + obj_type!=ObjectType::BaseTable && obj_type!=ObjectType::Textbox) || (def_type==SchemaParser::XmlDefinition && - obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjBaseTable)) + obj_type!=ObjectType::BaseObject && obj_type!=ObjectType::BaseTable)) { bool format=false; @@ -711,7 +711,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) //Formats the object's name in case the SQL definition is being generated format=((def_type==SchemaParser::SqlDefinition) || (def_type==SchemaParser::XmlDefinition && reduced_form && - obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjRelationship)); + obj_type!=ObjectType::Textbox && obj_type!=ObjectType::Relationship)); setBasicAttributes(format); @@ -751,7 +751,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) /** Only tablespaces and database do not have an ALTER OWNER SET because the rule says that PostgreSQL tablespaces and database should be created with just a command line isolated from the others **/ - if(obj_type!=ObjectType::ObjTablespace && obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::Tablespace && obj_type!=ObjectType::Database) { SchemaParser sch_parser; QString filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + @@ -840,7 +840,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) clearAttributes(); //Database object doesn't handles cached code. - if(use_cached_code && obj_type!=ObjectType::ObjDatabase) + if(use_cached_code && obj_type!=ObjectType::Database) { if(def_type==SchemaParser::SqlDefinition || (!reduced_form && def_type==SchemaParser::XmlDefinition)) @@ -909,8 +909,8 @@ void BaseObject::swapObjectsIds(BaseObject *obj1, BaseObject *obj2, bool enable_ ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the object is object is cluster level and the swap of these types isn't enabled else if(!enable_cl_obj_swap && - (obj1->getObjectType()==ObjectType::ObjDatabase || obj1->getObjectType()==ObjectType::ObjTablespace || obj1->getObjectType()==ObjectType::ObjRole || - obj2->getObjectType()==ObjectType::ObjDatabase || obj2->getObjectType()==ObjectType::ObjTablespace || obj2->getObjectType()==ObjectType::ObjRole)) + (obj1->getObjectType()==ObjectType::Database || obj1->getObjectType()==ObjectType::Tablespace || obj1->getObjectType()==ObjectType::Role || + obj2->getObjectType()==ObjectType::Database || obj2->getObjectType()==ObjectType::Tablespace || obj2->getObjectType()==ObjectType::Role)) throw Exception(ErrorCode::InvIdSwapInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -936,22 +936,22 @@ void BaseObject::updateObjectId(BaseObject *obj) vector BaseObject::getObjectTypes(bool inc_table_objs, vector exclude_types) { - vector vet_types={ ObjectType::ObjBaseRelationship, ObjectType::ObjAggregate, ObjectType::ObjCast, ObjectType::ObjCollation, - ObjectType::ObjConversion, ObjectType::ObjDatabase, ObjectType::ObjDomain, ObjectType::ObjExtension, ObjectType::ObjEventTrigger, - ObjectType::ObjTag, ObjectType::ObjFunction, ObjectType::ObjLanguage, ObjectType::ObjOpClass, ObjectType::ObjOperator, - ObjectType::ObjOpFamily, ObjectType::ObjRelationship, ObjectType::ObjRole, ObjectType::ObjSchema, - ObjectType::ObjSequence, ObjectType::ObjTable, ObjectType::ObjTablespace, ObjectType::ObjTextbox, - ObjectType::ObjType, ObjectType::ObjView, ObjectType::ObjPermission, ObjectType::ObjGenericSQL }; + vector vet_types={ ObjectType::BaseRelationship, ObjectType::Aggregate, ObjectType::Cast, ObjectType::Collation, + ObjectType::Conversion, ObjectType::Database, ObjectType::Domain, ObjectType::Extension, ObjectType::EventTrigger, + ObjectType::Tag, ObjectType::Function, ObjectType::Language, ObjectType::OpClass, ObjectType::Operator, + ObjectType::OpFamily, ObjectType::Relationship, ObjectType::Role, ObjectType::Schema, + ObjectType::Sequence, ObjectType::Table, ObjectType::Tablespace, ObjectType::Textbox, + ObjectType::Type, ObjectType::View, ObjectType::Permission, ObjectType::GenericSql }; vector::iterator itr; if(inc_table_objs) { - vet_types.push_back(ObjectType::ObjColumn); - vet_types.push_back(ObjectType::ObjConstraint); - vet_types.push_back(ObjectType::ObjTrigger); - vet_types.push_back(ObjectType::ObjRule); - vet_types.push_back(ObjectType::ObjIndex); - vet_types.push_back(ObjectType::ObjPolicy); + vet_types.push_back(ObjectType::Column); + vet_types.push_back(ObjectType::Constraint); + vet_types.push_back(ObjectType::Trigger); + vet_types.push_back(ObjectType::Rule); + vet_types.push_back(ObjectType::Index); + vet_types.push_back(ObjectType::Policy); } for(ObjectType type : exclude_types) @@ -966,15 +966,15 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector BaseObject::getChildObjectTypes(ObjectType obj_type) { - if(obj_type==ObjectType::ObjDatabase) - return(vector()={ObjectType::ObjCast, ObjectType::ObjRole, ObjectType::ObjLanguage, ObjectType::ObjTablespace, ObjectType::ObjSchema, ObjectType::ObjExtension, ObjectType::ObjEventTrigger}); - else if(obj_type==ObjectType::ObjSchema) - return(vector()={ObjectType::ObjAggregate, ObjectType::ObjConversion, ObjectType::ObjCollation, ObjectType::ObjDomain, ObjectType::ObjFunction, - ObjectType::ObjOpClass, ObjectType::ObjOperator, ObjectType::ObjOpFamily, ObjectType::ObjSequence, ObjectType::ObjType, ObjectType::ObjTable, ObjectType::ObjView}); - else if(obj_type==ObjectType::ObjTable) - return(vector()={ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjPolicy}); - else if(obj_type==ObjectType::ObjView) - return(vector()={ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex}); + if(obj_type==ObjectType::Database) + return(vector()={ObjectType::Cast, ObjectType::Role, ObjectType::Language, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Extension, ObjectType::EventTrigger}); + else if(obj_type==ObjectType::Schema) + return(vector()={ObjectType::Aggregate, ObjectType::Conversion, ObjectType::Collation, ObjectType::Domain, ObjectType::Function, + ObjectType::OpClass, ObjectType::Operator, ObjectType::OpFamily, ObjectType::Sequence, ObjectType::Type, ObjectType::Table, ObjectType::View}); + else if(obj_type==ObjectType::Table) + return(vector()={ObjectType::Column, ObjectType::Constraint, ObjectType::Rule, ObjectType::Trigger, ObjectType::Index, ObjectType::Policy}); + else if(obj_type==ObjectType::View) + return(vector()={ObjectType::Rule, ObjectType::Trigger, ObjectType::Index}); else return(vector()={}); } diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index c98e027535..d19e6a1ed1 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -37,42 +37,42 @@ #include enum class ObjectType: unsigned { - ObjColumn, - ObjConstraint, - ObjFunction, - ObjTrigger, - ObjIndex, - ObjRule, - ObjTable, - ObjView, - ObjDomain, - ObjSchema, - ObjAggregate, - ObjOperator, - ObjSequence, - ObjRole, - ObjConversion, - ObjCast, - ObjLanguage, - ObjType, - ObjTablespace, - ObjOpFamily, - ObjOpClass, - ObjDatabase, - ObjCollation, - ObjExtension, - ObjEventTrigger, - ObjPolicy, - ObjRelationship, - ObjTextbox, - ObjPermission, - ObjParameter, - ObjTypeAttribute, - ObjTag, - ObjGenericSQL, - ObjBaseRelationship, - ObjBaseObject, - ObjBaseTable + Column, + Constraint, + Function, + Trigger, + Index, + Rule, + Table, + View, + Domain, + Schema, + Aggregate, + Operator, + Sequence, + Role, + Conversion, + Cast, + Language, + Type, + Tablespace, + OpFamily, + OpClass, + Database, + Collation, + Extension, + EventTrigger, + Policy, + Relationship, + Textbox, + Permission, + Parameter, + TypeAttribute, + Tag, + GenericSql, + BaseRelationship, + BaseObject, + BaseTable }; //! \brief This unary operator overloading causes the provided ObjectType enum to be converted to its underlying datatype diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index b38c9f20ea..74ff022e66 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -75,7 +75,7 @@ BaseRelationship::BaseRelationship(unsigned rel_type, BaseTable *src_tab, BaseTa void BaseRelationship::configureRelationship(void) { - obj_type=ObjectType::ObjBaseRelationship; + obj_type=ObjectType::BaseRelationship; attributes[ParsersAttributes::TYPE]=QString(); attributes[ParsersAttributes::SRC_REQUIRED]=QString(); @@ -125,7 +125,7 @@ void BaseRelationship::configureRelationship(void) if(!src_table || !dst_table) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedTable) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjBaseRelationship)), + .arg(BaseObject::getTypeName(ObjectType::BaseRelationship)), ErrorCode::AsgNotAllocatedTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the relationship type is generalization or dependency @@ -512,7 +512,7 @@ QString BaseRelationship::getRelTypeAttribute(void) case RelationshipPart: return(ParsersAttributes::RELATIONSHIP_PART); break; case RelationshipFk: return(ParsersAttributes::RELATIONSHIP_FK); break; default: - if(src_table->getObjectType()==ObjectType::ObjView) + if(src_table->getObjectType()==ObjectType::View) return(ParsersAttributes::RELATION_TAB_VIEW); else return(ParsersAttributes::RELATIONSHIP_DEP); @@ -541,7 +541,7 @@ QString BaseRelationship::getRelationshipTypeName(unsigned rel_type, bool is_vie QString BaseRelationship::getRelationshipTypeName(void) { - return(getRelationshipTypeName(rel_type, src_table->getObjectType()==ObjectType::ObjView)); + return(getRelationshipTypeName(rel_type, src_table->getObjectType()==ObjectType::View)); } void BaseRelationship::setCodeInvalidated(bool value) diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 3f6e09e891..0d0731c563 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -21,7 +21,7 @@ BaseTable::BaseTable(void) { tag=nullptr; - obj_type=ObjectType::ObjBaseTable; + obj_type=ObjectType::BaseTable; attributes[ParsersAttributes::TAG]=QString(); attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=QString(); attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString(); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index d5b2cbb04e..4e27cce864 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -20,7 +20,7 @@ Cast::Cast(void) { - obj_type=ObjectType::ObjCast; + obj_type=ObjectType::Cast; cast_function=nullptr; cast_type=Explicit; is_in_out=false; @@ -40,7 +40,7 @@ void Cast::setDataType(unsigned type_idx, PgSqlType type) if((*type).isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNullTypeObject) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::Cast)), ErrorCode::AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->types[type_idx] != type); @@ -79,7 +79,7 @@ void Cast::setCastFunction(Function *cast_func) if(!cast_func) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::Cast)), ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Retrieve the cast function parameter count for specific validations @@ -89,7 +89,7 @@ void Cast::setCastFunction(Function *cast_func) if(param_count==0 || param_count > 3) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::Cast)), ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -112,7 +112,7 @@ void Cast::setCastFunction(Function *cast_func) if(error) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::Cast)), ErrorCode::AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -123,7 +123,7 @@ void Cast::setCastFunction(Function *cast_func) if(ret_type!=this->types[DstType] && !ret_type.canCastTo(this->types[DstType])) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjCast)), + .arg(BaseObject::getTypeName(ObjectType::Cast)), ErrorCode::AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(cast_function != cast_func); diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index 1f9e578f40..66dbd29a6f 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -20,7 +20,7 @@ Collation::Collation(void) { - obj_type=ObjectType::ObjCollation; + obj_type=ObjectType::Collation; encoding=BaseType::Null; attributes[ParsersAttributes::_LC_CTYPE_]=QString(); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index e0ccd9afd2..d32d26299e 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -20,7 +20,7 @@ Column::Column(void) { - obj_type=ObjectType::ObjColumn; + obj_type=ObjectType::Column; not_null=seq_cycle=false; attributes[ParsersAttributes::TYPE]=QString(); attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); @@ -152,7 +152,7 @@ QString Column::getOldName(bool format) void Column::setParentRelationship(BaseObject *parent_rel) { - if(parent_rel && parent_rel->getObjectType()!=ObjectType::ObjRelationship) + if(parent_rel && parent_rel->getObjectType()!=ObjectType::Relationship) throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->parent_rel=parent_rel; @@ -167,11 +167,11 @@ void Column::setSequence(BaseObject *seq) { if(seq) { - if(seq->getObjectType()!=ObjectType::ObjSequence) + if(seq->getObjectType()!=ObjectType::Sequence) throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) - .arg(BaseObject::getTypeName(ObjectType::ObjSequence)), + .arg(BaseObject::getTypeName(ObjectType::Sequence)), ErrorCode::AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!type.isIntegerType()) throw Exception(Exception::getErrorMessage(ErrorCode::IncompColumnTypeForSequence) diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index ce2d05d92b..9e310553f6 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -21,7 +21,7 @@ Constraint::Constraint(void) { ref_table=nullptr; - obj_type=ObjectType::ObjConstraint; + obj_type=ObjectType::Constraint; deferrable=false; no_inherit=false; fill_factor=0; @@ -149,7 +149,7 @@ void Constraint::addColumn(Column *column, unsigned col_type) if(!column) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedColumn) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)), + .arg(BaseObject::getTypeName(ObjectType::Constraint)), ErrorCode::AsgNotAllocatedColumn,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(constr_type!=ConstraintType::Check) { diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index a59c163c92..c267e737cb 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -20,7 +20,7 @@ Conversion::Conversion(void) { - obj_type=ObjectType::ObjConversion; + obj_type=ObjectType::Conversion; conversion_func=nullptr; is_default=false; attributes[ParsersAttributes::DEFAULT]=QString(); @@ -38,7 +38,7 @@ void Conversion::setEncoding(unsigned encoding_idx, EncodingType encoding_type) if((~encoding_type).isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNullTypeObject) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::Conversion)), ErrorCode::AsgNullTypeObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Assigns the encoding to the conversion in the specified index @@ -55,14 +55,14 @@ void Conversion::setConversionFunction(Function *conv_func) if(!conv_func) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::Conversion)), ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* The conversion function must have 5 parameters if it's not the case raises an error. */ else if(conv_func->getParameterCount()!=5) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::Conversion)), ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the function parameters does not following the type order: interger, integer, cstring, internal, integer */ @@ -73,13 +73,13 @@ void Conversion::setConversionFunction(Function *conv_func) conv_func->getParameter(4).getType()!=QString("integer")) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::Conversion)), ErrorCode::AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the conversion function return type is not 'void' else if(conv_func->getReturnType()!=QString("void")) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjectType::ObjConversion)), + .arg(BaseObject::getTypeName(ObjectType::Conversion)), ErrorCode::AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(conversion_func != conv_func); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index a9b48f53ca..72577279c4 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -25,7 +25,7 @@ DatabaseModel::DatabaseModel(void) { this->model_wgt=nullptr; object_id=DatabaseModel::dbmodel_id++; - obj_type=ObjectType::ObjDatabase; + obj_type=ObjectType::Database; is_template = false; allow_conns = true; @@ -33,10 +33,10 @@ DatabaseModel::DatabaseModel(void) encoding=BaseType::Null; BaseObject::setName(QObject::trUtf8("new_database").toUtf8()); - default_objs[ObjectType::ObjSchema]=nullptr; - default_objs[ObjectType::ObjRole]=nullptr; - default_objs[ObjectType::ObjTablespace]=nullptr; - default_objs[ObjectType::ObjCollation]=nullptr; + default_objs[ObjectType::Schema]=nullptr; + default_objs[ObjectType::Role]=nullptr; + default_objs[ObjectType::Tablespace]=nullptr; + default_objs[ObjectType::Collation]=nullptr; conn_limit=-1; last_zoom=1; @@ -102,55 +102,55 @@ void DatabaseModel::setAuthor(const QString &author) vector *DatabaseModel::getObjectList(ObjectType obj_type) { - if(obj_type==ObjectType::ObjTextbox) + if(obj_type==ObjectType::Textbox) return(&textboxes); - else if(obj_type==ObjectType::ObjTable) + else if(obj_type==ObjectType::Table) return(&tables); - else if(obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Function) return(&functions); - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) return(&aggregates); - else if(obj_type==ObjectType::ObjSchema) + else if(obj_type==ObjectType::Schema) return(&schemas); - else if(obj_type==ObjectType::ObjView) + else if(obj_type==ObjectType::View) return(&views); - else if(obj_type==ObjectType::ObjType) + else if(obj_type==ObjectType::Type) return(&types); - else if(obj_type==ObjectType::ObjRole) + else if(obj_type==ObjectType::Role) return(&roles); - else if(obj_type==ObjectType::ObjTablespace) + else if(obj_type==ObjectType::Tablespace) return(&tablespaces); - else if(obj_type==ObjectType::ObjLanguage) + else if(obj_type==ObjectType::Language) return(&languages); - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) return(&casts); - else if(obj_type==ObjectType::ObjConversion) + else if(obj_type==ObjectType::Conversion) return(&conversions); - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) return(&operators); - else if(obj_type==ObjectType::ObjOpClass) + else if(obj_type==ObjectType::OpClass) return(&op_classes); - else if(obj_type==ObjectType::ObjOpFamily) + else if(obj_type==ObjectType::OpFamily) return(&op_families); - else if(obj_type==ObjectType::ObjDomain) + else if(obj_type==ObjectType::Domain) return(&domains); - else if(obj_type==ObjectType::ObjSequence) + else if(obj_type==ObjectType::Sequence) return(&sequences); - else if(obj_type==ObjectType::ObjBaseRelationship) + else if(obj_type==ObjectType::BaseRelationship) return(&base_relationships); - else if(obj_type==ObjectType::ObjRelationship) + else if(obj_type==ObjectType::Relationship) return(&relationships); - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) return(&permissions); - else if(obj_type==ObjectType::ObjCollation) + else if(obj_type==ObjectType::Collation) return(&collations); - else if(obj_type==ObjectType::ObjExtension) + else if(obj_type==ObjectType::Extension) return(&extensions); - else if(obj_type==ObjectType::ObjTag) + else if(obj_type==ObjectType::Tag) return(&tags); - else if(obj_type==ObjectType::ObjEventTrigger) + else if(obj_type==ObjectType::EventTrigger) return(&eventtriggers); - else if(obj_type==ObjectType::ObjGenericSQL) + else if(obj_type==ObjectType::GenericSql) return(&genericsqls); else return(nullptr); @@ -166,54 +166,54 @@ void DatabaseModel::addObject(BaseObject *object, int obj_idx) { obj_type=object->getObjectType(); - if(obj_type==ObjectType::ObjRelationship || - obj_type==ObjectType::ObjBaseRelationship) + if(obj_type==ObjectType::Relationship || + obj_type==ObjectType::BaseRelationship) addRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTextbox) + else if(obj_type==ObjectType::Textbox) addTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTable) + else if(obj_type==ObjectType::Table) addTable(dynamic_cast
(object), obj_idx); - else if(obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Function) addFunction(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) addAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjSchema) + else if(obj_type==ObjectType::Schema) addSchema(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjView) + else if(obj_type==ObjectType::View) addView(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjType) + else if(obj_type==ObjectType::Type) addType(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjRole) + else if(obj_type==ObjectType::Role) addRole(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTablespace) + else if(obj_type==ObjectType::Tablespace) addTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjLanguage) + else if(obj_type==ObjectType::Language) addLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) addCast(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjConversion) + else if(obj_type==ObjectType::Conversion) addConversion(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) addOperator(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOpClass) + else if(obj_type==ObjectType::OpClass) addOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOpFamily) + else if(obj_type==ObjectType::OpFamily) addOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjDomain) + else if(obj_type==ObjectType::Domain) addDomain(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjSequence) + else if(obj_type==ObjectType::Sequence) addSequence(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjCollation) + else if(obj_type==ObjectType::Collation) addCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjExtension) + else if(obj_type==ObjectType::Extension) addExtension(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTag) + else if(obj_type==ObjectType::Tag) addTag(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) addPermission(dynamic_cast(object)); - else if(obj_type==ObjectType::ObjEventTrigger) + else if(obj_type==ObjectType::EventTrigger) addEventTrigger(dynamic_cast(object)); - else if(obj_type==ObjectType::ObjGenericSQL) + else if(obj_type==ObjectType::GenericSql) addGenericSQL(dynamic_cast(object)); } catch(Exception &e) @@ -234,54 +234,54 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) { obj_type=object->getObjectType(); - if(obj_type==ObjectType::ObjRelationship || - obj_type==ObjectType::ObjBaseRelationship) + if(obj_type==ObjectType::Relationship || + obj_type==ObjectType::BaseRelationship) removeRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTextbox) + else if(obj_type==ObjectType::Textbox) removeTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTable) + else if(obj_type==ObjectType::Table) removeTable(dynamic_cast
(object), obj_idx); - else if(obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Function) removeFunction(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) removeAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjSchema) + else if(obj_type==ObjectType::Schema) removeSchema(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjView) + else if(obj_type==ObjectType::View) removeView(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjType) + else if(obj_type==ObjectType::Type) removeType(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjRole) + else if(obj_type==ObjectType::Role) removeRole(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTablespace) + else if(obj_type==ObjectType::Tablespace) removeTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjLanguage) + else if(obj_type==ObjectType::Language) removeLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) removeCast(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjConversion) + else if(obj_type==ObjectType::Conversion) removeConversion(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) removeOperator(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOpClass) + else if(obj_type==ObjectType::OpClass) removeOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOpFamily) + else if(obj_type==ObjectType::OpFamily) removeOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjDomain) + else if(obj_type==ObjectType::Domain) removeDomain(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjSequence) + else if(obj_type==ObjectType::Sequence) removeSequence(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjCollation) + else if(obj_type==ObjectType::Collation) removeCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjExtension) + else if(obj_type==ObjectType::Extension) removeExtension(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTag) + else if(obj_type==ObjectType::Tag) removeTag(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) removePermission(dynamic_cast(object)); - else if(obj_type==ObjectType::ObjEventTrigger) + else if(obj_type==ObjectType::EventTrigger) removeEventTrigger(dynamic_cast(object)); - else if(obj_type==ObjectType::ObjGenericSQL) + else if(obj_type==ObjectType::GenericSql) removeGenericSQL(dynamic_cast(object)); } catch(Exception &e) @@ -294,8 +294,8 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) { if(TableObject::isTableObject(obj_type) || - obj_type==ObjectType::ObjBaseObject || obj_type==ObjectType::ObjBaseRelationship || - obj_type==ObjectType::ObjDatabase) + obj_type==ObjectType::BaseObject || obj_type==ObjectType::BaseRelationship || + obj_type==ObjectType::Database) throw Exception(ErrorCode::RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else @@ -308,49 +308,49 @@ void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); object=(*obj_list)[obj_idx]; - if(obj_type==ObjectType::ObjTextbox) + if(obj_type==ObjectType::Textbox) removeTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTable) + else if(obj_type==ObjectType::Table) removeTable(dynamic_cast
(object), obj_idx); - else if(obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Function) removeFunction(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) removeAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjSchema) + else if(obj_type==ObjectType::Schema) removeSchema(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjView) + else if(obj_type==ObjectType::View) removeView(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjType) + else if(obj_type==ObjectType::Type) removeType(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjRole) + else if(obj_type==ObjectType::Role) removeRole(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjTablespace) + else if(obj_type==ObjectType::Tablespace) removeTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjLanguage) + else if(obj_type==ObjectType::Language) removeLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) removeCast(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjConversion) + else if(obj_type==ObjectType::Conversion) removeConversion(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) removeOperator(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOpClass) + else if(obj_type==ObjectType::OpClass) removeOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjOpFamily) + else if(obj_type==ObjectType::OpFamily) removeOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjDomain) + else if(obj_type==ObjectType::Domain) removeDomain(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjSequence) + else if(obj_type==ObjectType::Sequence) removeSequence(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjCollation) + else if(obj_type==ObjectType::Collation) removeCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjBaseRelationship) + else if(obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) removeRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) removePermission(dynamic_cast(object)); - else if(obj_type==ObjectType::ObjEventTrigger) + else if(obj_type==ObjectType::EventTrigger) removeEventTrigger(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::ObjGenericSQL) + else if(obj_type==ObjectType::GenericSql) removeGenericSQL(dynamic_cast(object), obj_idx); } } @@ -379,7 +379,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) #endif - if(obj_type==ObjectType::ObjTablespace) + if(obj_type==ObjectType::Tablespace) { Tablespace *tabspc=nullptr, *aux_tabspc=nullptr; @@ -409,17 +409,17 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) /* Raises an error if there is an object with the same name. Special cases are for: functions/operator that are search by signature and views that are search on tables and views list */ - if((obj_type==ObjectType::ObjView && (getObject(object->getName(true), obj_type, idx) || - getObject(object->getName(true), ObjectType::ObjTable, idx))) || - (obj_type==ObjectType::ObjTable && (getObject(object->getName(true), obj_type, idx) || - getObject(object->getName(true), ObjectType::ObjView, idx))) || - (obj_type==ObjectType::ObjExtension && (getObject(object->getName(false), obj_type, idx))) || + if((obj_type==ObjectType::View && (getObject(object->getName(true), obj_type, idx) || + getObject(object->getName(true), ObjectType::Table, idx))) || + (obj_type==ObjectType::Table && (getObject(object->getName(true), obj_type, idx) || + getObject(object->getName(true), ObjectType::View, idx))) || + (obj_type==ObjectType::Extension && (getObject(object->getName(false), obj_type, idx))) || (getObject(object->getSignature(), obj_type, idx))) { QString str_aux; str_aux=Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) - .arg(object->getName(obj_type != ObjectType::ObjExtension)) + .arg(object->getName(obj_type != ObjectType::Extension)) .arg(object->getTypeName()) .arg(this->getName(true)) .arg(this->getTypeName()); @@ -429,7 +429,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) try { - if(obj_type==ObjectType::ObjTextbox || obj_type==ObjectType::ObjBaseRelationship) + if(obj_type==ObjectType::Textbox || obj_type==ObjectType::BaseRelationship) object->getCodeDefinition(SchemaParser::XmlDefinition); else object->getCodeDefinition(SchemaParser::SqlDefinition); @@ -565,9 +565,9 @@ vector DatabaseModel::getObjects(BaseObject *schema) { vector *obj_list=nullptr, sel_list; vector::iterator itr, itr_end; - ObjectType types[]={ ObjectType::ObjFunction, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjDomain, - ObjectType::ObjAggregate, ObjectType::ObjOperator, ObjectType::ObjSequence, ObjectType::ObjConversion, - ObjectType::ObjType, ObjectType::ObjOpClass, ObjectType::ObjOpFamily, ObjectType::ObjCollation }; + ObjectType types[]={ ObjectType::Function, ObjectType::Table, ObjectType::View, ObjectType::Domain, + ObjectType::Aggregate, ObjectType::Operator, ObjectType::Sequence, ObjectType::Conversion, + ObjectType::Type, ObjectType::OpClass, ObjectType::OpFamily, ObjectType::Collation }; unsigned i, count=sizeof(types)/sizeof(ObjectType); for(i=0; i < count; i++) @@ -654,7 +654,7 @@ unsigned DatabaseModel::getObjectCount(ObjectType obj_type) unsigned DatabaseModel::getMaxObjectCount(void) { - vector types = getObjectTypes(false, {ObjectType::ObjDatabase}); + vector types = getObjectTypes(false, {ObjectType::Database}); unsigned count = 0, max = 0; for(auto &type : types) @@ -668,7 +668,7 @@ unsigned DatabaseModel::getMaxObjectCount(void) unsigned DatabaseModel::getObjectCount(void) { - vector types= getObjectTypes(false, {ObjectType::ObjDatabase}); + vector types= getObjectTypes(false, {ObjectType::Database}); unsigned count=0; for(auto &type : types) @@ -716,14 +716,14 @@ QString DatabaseModel::getAuthor(void) void DatabaseModel::setProtected(bool value) { vector types = { - ObjectType::ObjBaseRelationship,ObjectType::ObjRelationship, ObjectType::ObjTable, ObjectType::ObjView, - ObjectType::ObjAggregate, ObjectType::ObjOperator, - ObjectType::ObjSequence, ObjectType::ObjConversion, - ObjectType::ObjCast, ObjectType::ObjOpFamily, ObjectType::ObjOpClass, - ObjectType::ObjBaseRelationship, ObjectType::ObjTextbox, - ObjectType::ObjDomain, ObjectType::ObjType, ObjectType::ObjFunction, - ObjectType::ObjLanguage, ObjectType::ObjTablespace, ObjectType::ObjRole, ObjectType::ObjCollation, - ObjectType::ObjExtension, ObjectType::ObjSchema, ObjectType::ObjPermission, ObjectType::ObjTag, ObjectType::ObjGenericSQL + ObjectType::BaseRelationship,ObjectType::Relationship, ObjectType::Table, ObjectType::View, + ObjectType::Aggregate, ObjectType::Operator, + ObjectType::Sequence, ObjectType::Conversion, + ObjectType::Cast, ObjectType::OpFamily, ObjectType::OpClass, + ObjectType::BaseRelationship, ObjectType::Textbox, + ObjectType::Domain, ObjectType::Type, ObjectType::Function, + ObjectType::Language, ObjectType::Tablespace, ObjectType::Role, ObjectType::Collation, + ObjectType::Extension, ObjectType::Schema, ObjectType::Permission, ObjectType::Tag, ObjectType::GenericSql }; for(auto &type : types) @@ -739,7 +739,7 @@ void DatabaseModel::setProtected(bool value) void DatabaseModel::destroyObjects(void) { - ObjectType graph_types[]={ ObjectType::ObjSchema, ObjectType::ObjBaseRelationship, ObjectType::ObjRelationship, ObjectType::ObjTable, ObjectType::ObjView }; + ObjectType graph_types[]={ ObjectType::Schema, ObjectType::BaseRelationship, ObjectType::Relationship, ObjectType::Table, ObjectType::View }; BaseObject *object=nullptr; map objects; map::reverse_iterator ritr, ritr_end; @@ -780,7 +780,7 @@ void DatabaseModel::destroyObjects(void) ritr++; // We ignore the database itself as well table children objects - if(object->getObjectType() == ObjectType::ObjDatabase || + if(object->getObjectType() == ObjectType::Database || TableObject::isTableObject(object->getObjectType())) continue; @@ -794,7 +794,7 @@ void DatabaseModel::destroyObjects(void) { __removeObject(object,-1,false); - if(object->getObjectType()==ObjectType::ObjRelationship) + if(object->getObjectType()==ObjectType::Relationship) dynamic_cast(object)->destroyObjects(); } @@ -835,12 +835,12 @@ void DatabaseModel::addTable(Table *table, int obj_idx) Table *DatabaseModel::getTable(unsigned obj_idx) { - return(dynamic_cast
(getObject(obj_idx, ObjectType::ObjTable))); + return(dynamic_cast
(getObject(obj_idx, ObjectType::Table))); } Table *DatabaseModel::getTable(const QString &name) { - return(dynamic_cast
(getObject(name, ObjectType::ObjTable))); + return(dynamic_cast
(getObject(name, ObjectType::Table))); } void DatabaseModel::removeTable(Table *table, int obj_idx) @@ -872,12 +872,12 @@ void DatabaseModel::addSequence(Sequence *sequence, int obj_idx) Sequence *DatabaseModel::getSequence(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjSequence))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Sequence))); } Sequence *DatabaseModel::getSequence(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjSequence))); + return(dynamic_cast(getObject(name, ObjectType::Sequence))); } void DatabaseModel::removeSequence(Sequence *sequence, int obj_idx) @@ -906,12 +906,12 @@ void DatabaseModel::addCollation(Collation *collation, int obj_idx) Collation *DatabaseModel::getCollation(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjCollation))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Collation))); } Collation *DatabaseModel::getCollation(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjCollation))); + return(dynamic_cast(getObject(name, ObjectType::Collation))); } void DatabaseModel::removeCollation(Collation *collation, int obj_idx) @@ -943,12 +943,12 @@ void DatabaseModel::addExtension(Extension *extension, int obj_idx) Extension *DatabaseModel::getExtension(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjCollation))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Collation))); } Extension *DatabaseModel::getExtension(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjExtension))); + return(dynamic_cast(getObject(name, ObjectType::Extension))); } void DatabaseModel::addTag(Tag *tag, int obj_idx) @@ -977,12 +977,12 @@ void DatabaseModel::removeTag(Tag *tag, int obj_idx) Tag *DatabaseModel::getTag(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjTag))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Tag))); } Tag *DatabaseModel::getTag(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjTag))); + return(dynamic_cast(getObject(name, ObjectType::Tag))); } void DatabaseModel::addEventTrigger(EventTrigger *evnttrig, int obj_idx) @@ -1011,12 +1011,12 @@ void DatabaseModel::removeEventTrigger(EventTrigger *evnttrig, int obj_idx) EventTrigger *DatabaseModel::getEventTrigger(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjEventTrigger))); + return(dynamic_cast(getObject(obj_idx, ObjectType::EventTrigger))); } EventTrigger *DatabaseModel::getEventTrigger(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjEventTrigger))); + return(dynamic_cast(getObject(name, ObjectType::EventTrigger))); } void DatabaseModel::addGenericSQL(GenericSQL *genericsql, int obj_idx) @@ -1045,12 +1045,12 @@ void DatabaseModel::removeGenericSQL(GenericSQL *genericsql, int obj_idx) GenericSQL *DatabaseModel::getGenericSQL(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjGenericSQL))); + return(dynamic_cast(getObject(obj_idx, ObjectType::GenericSql))); } GenericSQL *DatabaseModel::getGenericSQL(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjGenericSQL))); + return(dynamic_cast(getObject(name, ObjectType::GenericSql))); } void DatabaseModel::removeExtension(Extension *extension, int obj_idx) @@ -1086,12 +1086,12 @@ void DatabaseModel::addView(View *view, int obj_idx) View *DatabaseModel::getView(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjView))); + return(dynamic_cast(getObject(obj_idx, ObjectType::View))); } View *DatabaseModel::getView(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjView))); + return(dynamic_cast(getObject(name, ObjectType::View))); } void DatabaseModel::removeView(View *view, int obj_idx) @@ -1186,7 +1186,7 @@ void DatabaseModel::updateTableFKRelationships(Table *table) /* Workaround: In some cases the combination of the two tablenames can generate a duplicated relationship name so it`s necessary to check if a relationship with the same name already exists. If exists changes the name of the new one */ - if(getObjectIndex(rel->getName(), ObjectType::ObjBaseRelationship) >= 0) + if(getObjectIndex(rel->getName(), ObjectType::BaseRelationship) >= 0) rel->setName(PgModelerNs::generateUniqueName(rel, base_relationships)); addRelationship(rel); @@ -1255,7 +1255,7 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) if(rel->getTable(BaseRelationship::SrcTable)==view || rel->getTable(BaseRelationship::DstTable)==view) { - if(rel->getTable(BaseRelationship::SrcTable)->getObjectType()==ObjectType::ObjTable) + if(rel->getTable(BaseRelationship::SrcTable)->getObjectType()==ObjectType::Table) tab=dynamic_cast
(rel->getTable(BaseRelationship::SrcTable)); else tab=dynamic_cast
(rel->getTable(BaseRelationship::DstTable)); @@ -1314,7 +1314,7 @@ void DatabaseModel::disconnectRelationships(void) ritr_rel++; base_rel->blockSignals(loading_model); - if(base_rel->getObjectType()==ObjectType::ObjRelationship) + if(base_rel->getObjectType()==ObjectType::Relationship) { rel=dynamic_cast(base_rel); rel->disconnectRelationship(); @@ -1382,7 +1382,7 @@ void DatabaseModel::validateRelationships(void) itr++; //Validates only table-table relationships - if(base_rel->getObjectType()==ObjectType::ObjRelationship) + if(base_rel->getObjectType()==ObjectType::Relationship) { //Makes a cast to the correct object class rel=dynamic_cast(base_rel); @@ -1674,7 +1674,7 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) base_rel=dynamic_cast(*itr); itr++; - if(base_rel->getObjectType()==ObjectType::ObjRelationship) + if(base_rel->getObjectType()==ObjectType::Relationship) { rel_aux=dynamic_cast(base_rel); aux_rel_type=rel_aux->getRelationshipType(); @@ -1740,7 +1740,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) View *view=nullptr; BaseRelationship *rel=nullptr; Reference ref; - ObjectType tab_obj_type[3]={ ObjectType::ObjConstraint, ObjectType::ObjTrigger, ObjectType::ObjIndex }; + ObjectType tab_obj_type[3]={ ObjectType::Constraint, ObjectType::Trigger, ObjectType::Index }; bool found=false; vector objects, rem_objects, upd_tables_rels; @@ -1766,7 +1766,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) tab_obj=dynamic_cast(table->getObject(i, tab_obj_type[type_id])); found=false; - if(tab_obj_type[type_id]==ObjectType::ObjConstraint) + if(tab_obj_type[type_id]==ObjectType::Constraint) { constr=dynamic_cast(tab_obj); @@ -1781,7 +1781,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) if(found) xml_special_objs[constr->getObjectId()]=constr->getCodeDefinition(SchemaParser::XmlDefinition, true); } - else if(tab_obj_type[type_id]==ObjectType::ObjTrigger) + else if(tab_obj_type[type_id]==ObjectType::Trigger) { trigger=dynamic_cast(tab_obj); found=trigger->isReferRelationshipAddedColumn(); @@ -1944,16 +1944,16 @@ void DatabaseModel::createSpecialObject(const QString &xml_def, unsigned obj_id) //Identifies the object type through the start element on xml buffer obj_type=BaseObject::getObjectType(xmlparser.getElementName()); - if(obj_type==ObjectType::ObjSequence) + if(obj_type==ObjectType::Sequence) object=createSequence(true); else object=createObject(obj_type); - if(obj_type==ObjectType::ObjSequence) + if(obj_type==ObjectType::Sequence) addSequence(dynamic_cast(object)); - else if(obj_type==ObjectType::ObjView) + else if(obj_type==ObjectType::View) addView(dynamic_cast(object)); - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) addPermission(createPermission()); /* When the special object is recreated it receive a new id but to maintain @@ -1996,13 +1996,13 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) } //Before add the relationship, checks if a redundancy can occur case the relationship is added - if(rel->getObjectType()==ObjectType::ObjRelationship) + if(rel->getObjectType()==ObjectType::Relationship) checkRelationshipRedundancy(dynamic_cast(rel)); rel->blockSignals(loading_model); __addObject(rel, obj_idx); - if(rel->getObjectType()==ObjectType::ObjRelationship) + if(rel->getObjectType()==ObjectType::Relationship) { dynamic_cast(rel)->connectRelationship(); validateRelationships(); @@ -2026,7 +2026,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) { Table *recv_tab=nullptr; - if(rel->getObjectType()==ObjectType::ObjRelationship) + if(rel->getObjectType()==ObjectType::Relationship) { /* If the relationship is not a many-to-many we store the receiver table in order to update the fk relationships (if there are any) */ @@ -2036,7 +2036,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) storeSpecialObjectsXML(); disconnectRelationships(); } - else if(rel->getObjectType()==ObjectType::ObjBaseRelationship) + else if(rel->getObjectType()==ObjectType::BaseRelationship) { rel->blockSignals(loading_model); rel->disconnectRelationship(); @@ -2045,7 +2045,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) __removeObject(rel, obj_idx); - if(rel->getObjectType()==ObjectType::ObjRelationship) + if(rel->getObjectType()==ObjectType::Relationship) { validateRelationships(); } @@ -2064,7 +2064,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) BaseRelationship *DatabaseModel::getRelationship(unsigned obj_idx, ObjectType rel_type) { //Raises an error if the object type used to get a relationship is invalid - if(rel_type!=ObjectType::ObjRelationship && rel_type!=ObjectType::ObjBaseRelationship) + if(rel_type!=ObjectType::Relationship && rel_type!=ObjectType::BaseRelationship) throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(dynamic_cast(getObject(obj_idx, rel_type))); @@ -2072,10 +2072,10 @@ BaseRelationship *DatabaseModel::getRelationship(unsigned obj_idx, ObjectType re BaseRelationship *DatabaseModel::getRelationship(const QString &name) { - BaseRelationship *rel=dynamic_cast(getObject(name, ObjectType::ObjBaseRelationship)); + BaseRelationship *rel=dynamic_cast(getObject(name, ObjectType::BaseRelationship)); if(!rel) - rel=dynamic_cast(getObject(name, ObjectType::ObjRelationship)); + rel=dynamic_cast(getObject(name, ObjectType::Relationship)); return(rel); } @@ -2096,7 +2096,7 @@ BaseRelationship *DatabaseModel::getRelationship(BaseTable *src_tab, BaseTable * search_uniq_tab=true; } - if(ref_fk || src_tab->getObjectType()==ObjectType::ObjView || dst_tab->getObjectType()==ObjectType::ObjView) + if(ref_fk || src_tab->getObjectType()==ObjectType::View || dst_tab->getObjectType()==ObjectType::View) { itr=base_relationships.begin(); itr_end=base_relationships.end(); @@ -2175,12 +2175,12 @@ void DatabaseModel::removeTextbox(Textbox *txtbox, int obj_idx) Textbox *DatabaseModel::getTextbox(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjTextbox))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Textbox))); } Textbox *DatabaseModel::getTextbox(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjTextbox))); + return(dynamic_cast(getObject(name, ObjectType::Textbox))); } void DatabaseModel::addSchema(Schema *schema, int obj_idx) @@ -2197,12 +2197,12 @@ void DatabaseModel::addSchema(Schema *schema, int obj_idx) Schema *DatabaseModel::getSchema(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjSchema))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Schema))); } Schema *DatabaseModel::getSchema(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjSchema))); + return(dynamic_cast(getObject(name, ObjectType::Schema))); } void DatabaseModel::removeSchema(Schema *schema, int obj_idx) @@ -2231,12 +2231,12 @@ void DatabaseModel::addRole(Role *role, int obj_idx) Role *DatabaseModel::getRole(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjRole))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Role))); } Role *DatabaseModel::getRole(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjRole))); + return(dynamic_cast(getObject(name, ObjectType::Role))); } void DatabaseModel::removeRole(Role *role, int obj_idx) @@ -2265,12 +2265,12 @@ void DatabaseModel::addTablespace(Tablespace *tabspc, int obj_idx) Tablespace *DatabaseModel::getTablespace(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjTablespace))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Tablespace))); } Tablespace *DatabaseModel::getTablespace(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjTablespace))); + return(dynamic_cast(getObject(name, ObjectType::Tablespace))); } void DatabaseModel::removeTablespace(Tablespace *tabspc, int obj_idx) @@ -2311,12 +2311,12 @@ void DatabaseModel::removeCast(Cast *cast, int obj_idx) Cast *DatabaseModel::getCast(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjCast))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Cast))); } Cast *DatabaseModel::getCast(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjCast))); + return(dynamic_cast(getObject(name, ObjectType::Cast))); } void DatabaseModel::addConversion(Conversion *conv, int obj_idx) @@ -2346,12 +2346,12 @@ void DatabaseModel::removeConversion(Conversion *conv, int obj_idx) Conversion *DatabaseModel::getConversion(unsigned obj_idx) { return(dynamic_cast(getObject(obj_idx, - ObjectType::ObjConversion))); + ObjectType::Conversion))); } Conversion *DatabaseModel::getConversion(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjConversion))); + return(dynamic_cast(getObject(name, ObjectType::Conversion))); } void DatabaseModel::addLanguage(Language *lang, int obj_idx) @@ -2368,12 +2368,12 @@ void DatabaseModel::addLanguage(Language *lang, int obj_idx) Language *DatabaseModel::getLanguage(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjLanguage))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Language))); } Language *DatabaseModel::getLanguage(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjLanguage))); + return(dynamic_cast(getObject(name, ObjectType::Language))); } void DatabaseModel::removeLanguage(Language *lang, int obj_idx) @@ -2402,12 +2402,12 @@ void DatabaseModel::addFunction(Function *func, int obj_idx) Function *DatabaseModel::getFunction(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjFunction))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Function))); } Function *DatabaseModel::getFunction(const QString &signature) { - return(dynamic_cast(getObject(signature, ObjectType::ObjFunction))); + return(dynamic_cast(getObject(signature, ObjectType::Function))); } void DatabaseModel::removeFunction(Function *func, int obj_idx) @@ -2436,12 +2436,12 @@ void DatabaseModel::addAggregate(Aggregate *aggreg, int obj_idx) Aggregate *DatabaseModel::getAggregate(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjAggregate))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Aggregate))); } Aggregate *DatabaseModel::getAggregate(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjAggregate))); + return(dynamic_cast(getObject(name, ObjectType::Aggregate))); } void DatabaseModel::removeAggregate(Aggregate *aggreg, int obj_idx) @@ -2513,12 +2513,12 @@ void DatabaseModel::removeDomain(Domain *domain, int obj_idx) Domain *DatabaseModel::getDomain(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjDomain))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Domain))); } Domain *DatabaseModel::getDomain(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjDomain))); + return(dynamic_cast(getObject(name, ObjectType::Domain))); } void DatabaseModel::addOperatorFamily(OperatorFamily *op_family, int obj_idx) @@ -2535,12 +2535,12 @@ void DatabaseModel::addOperatorFamily(OperatorFamily *op_family, int obj_idx) OperatorFamily *DatabaseModel::getOperatorFamily(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjOpFamily))); + return(dynamic_cast(getObject(obj_idx, ObjectType::OpFamily))); } OperatorFamily *DatabaseModel::getOperatorFamily(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjOpFamily))); + return(dynamic_cast(getObject(name, ObjectType::OpFamily))); } void DatabaseModel::removeOperatorFamily(OperatorFamily *op_family, int obj_idx) @@ -2581,12 +2581,12 @@ void DatabaseModel::removeOperatorClass(OperatorClass *op_class, int obj_idx) OperatorClass *DatabaseModel::getOperatorClass(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjOpClass))); + return(dynamic_cast(getObject(obj_idx, ObjectType::OpClass))); } OperatorClass *DatabaseModel::getOperatorClass(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjOpClass))); + return(dynamic_cast(getObject(name, ObjectType::OpClass))); } void DatabaseModel::addOperator(Operator *oper, int obj_idx) @@ -2615,12 +2615,12 @@ void DatabaseModel::removeOperator(Operator *oper, int obj_idx) Operator *DatabaseModel::getOperator(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjOperator))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Operator))); } Operator *DatabaseModel::getOperator(const QString &signature) { - return(dynamic_cast(getObject(signature, ObjectType::ObjOperator))); + return(dynamic_cast(getObject(signature, ObjectType::Operator))); } void DatabaseModel::addType(Type *type, int obj_idx) @@ -2679,12 +2679,12 @@ void DatabaseModel::removeType(Type *type, int obj_idx) Type *DatabaseModel::getType(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjType))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Type))); } Type *DatabaseModel::getType(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::ObjType))); + return(dynamic_cast(getObject(name, ObjectType::Type))); } void DatabaseModel::removeUserType(BaseObject *object, int obj_idx) @@ -3026,10 +3026,10 @@ void DatabaseModel::loadModel(const QString &filename) protected_model=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_); - def_objs[ObjectType::ObjSchema]=attribs[ParsersAttributes::DEFAULT_SCHEMA]; - def_objs[ObjectType::ObjRole]=attribs[ParsersAttributes::DEFAULT_OWNER]; - def_objs[ObjectType::ObjCollation]=attribs[ParsersAttributes::DEFAULT_COLLATION]; - def_objs[ObjectType::ObjTablespace]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; + def_objs[ObjectType::Schema]=attribs[ParsersAttributes::DEFAULT_SCHEMA]; + def_objs[ObjectType::Role]=attribs[ParsersAttributes::DEFAULT_OWNER]; + def_objs[ObjectType::Collation]=attribs[ParsersAttributes::DEFAULT_COLLATION]; + def_objs[ObjectType::Tablespace]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3042,7 +3042,7 @@ void DatabaseModel::loadModel(const QString &filename) //Indentifies the object type to be load according to the current element on the parser obj_type=getObjectType(elem_name); - if(obj_type==ObjectType::ObjDatabase) + if(obj_type==ObjectType::Database) { xmlparser.getElementAttributes(attribs); configureDatabase(attribs); @@ -3057,12 +3057,12 @@ void DatabaseModel::loadModel(const QString &filename) if(object) { - if(!dynamic_cast(object) && obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjBaseRelationship) + if(!dynamic_cast(object) && obj_type!=ObjectType::Relationship && obj_type!=ObjectType::BaseRelationship) addObject(object); /* If there is at least one inheritance relationship we need to flag this situation in order to do an addtional rel. validation in the end of loading */ - if(!found_inh_rel && object->getObjectType()==ObjectType::ObjRelationship && + if(!found_inh_rel && object->getObjectType()==ObjectType::Relationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipGen) found_inh_rel=true; @@ -3114,7 +3114,7 @@ void DatabaseModel::loadModel(const QString &filename) //If there are relationship make a relationship validation to recreate any special object left behind if(!relationships.empty()) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::ObjRelationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::Relationship); storeSpecialObjectsXML(); disconnectRelationships(); validateRelationships(); @@ -3122,13 +3122,13 @@ void DatabaseModel::loadModel(const QString &filename) this->setInvalidated(false); - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::ObjRelationship); - this->setObjectsModified({ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship}); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::Relationship); + this->setObjectsModified({ObjectType::Relationship, ObjectType::BaseRelationship}); //Doing another relationship validation when there are inheritances to avoid incomplete tables if(found_inh_rel) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::ObjRelationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::Relationship); validateRelationships(); updateTablesFKRelationships(); } @@ -3156,68 +3156,68 @@ BaseObject *DatabaseModel::createObject(ObjectType obj_type) { BaseObject *object=nullptr; - if(obj_type!=ObjectType::ObjBaseObject) + if(obj_type!=ObjectType::BaseObject) { - if(obj_type==ObjectType::ObjRole) + if(obj_type==ObjectType::Role) object=createRole(); - else if(obj_type==ObjectType::ObjTablespace) + else if(obj_type==ObjectType::Tablespace) object=createTablespace(); - else if(obj_type==ObjectType::ObjSchema) + else if(obj_type==ObjectType::Schema) object=createSchema(); - else if(obj_type==ObjectType::ObjLanguage) + else if(obj_type==ObjectType::Language) object=createLanguage(); - else if(obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Function) object=createFunction(); - else if(obj_type==ObjectType::ObjType) + else if(obj_type==ObjectType::Type) object=createType(); - else if(obj_type==ObjectType::ObjDomain) + else if(obj_type==ObjectType::Domain) object=createDomain(); - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) object=createCast(); - else if(obj_type==ObjectType::ObjConversion) + else if(obj_type==ObjectType::Conversion) object=createConversion(); - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) object=createOperator(); - else if(obj_type==ObjectType::ObjOpFamily) + else if(obj_type==ObjectType::OpFamily) object=createOperatorFamily(); - else if(obj_type==ObjectType::ObjOpClass) + else if(obj_type==ObjectType::OpClass) object=createOperatorClass(); - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) object=createAggregate(); - else if(obj_type==ObjectType::ObjTable) + else if(obj_type==ObjectType::Table) object=createTable(); - else if(obj_type==ObjectType::ObjSequence) + else if(obj_type==ObjectType::Sequence) object=createSequence(); - else if(obj_type==ObjectType::ObjView) + else if(obj_type==ObjectType::View) object=createView(); - else if(obj_type==ObjectType::ObjTextbox) + else if(obj_type==ObjectType::Textbox) object=createTextbox(); - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) object=createConstraint(nullptr); - else if(obj_type==ObjectType::ObjTrigger) + else if(obj_type==ObjectType::Trigger) object=createTrigger(); - else if(obj_type==ObjectType::ObjIndex) + else if(obj_type==ObjectType::Index) object=createIndex(); - else if(obj_type==ObjectType::ObjColumn) + else if(obj_type==ObjectType::Column) object=createColumn(); - else if(obj_type==ObjectType::ObjRule) + else if(obj_type==ObjectType::Rule) object=createRule(); - else if(obj_type==ObjectType::ObjRelationship || - obj_type==ObjectType::ObjBaseRelationship) + else if(obj_type==ObjectType::Relationship || + obj_type==ObjectType::BaseRelationship) object=createRelationship(); - else if(obj_type==ObjectType::ObjCollation) + else if(obj_type==ObjectType::Collation) object=createCollation(); - else if(obj_type==ObjectType::ObjExtension) + else if(obj_type==ObjectType::Extension) object=createExtension(); - else if(obj_type==ObjectType::ObjTag) + else if(obj_type==ObjectType::Tag) object=createTag(); - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) object=createPermission(); - else if(obj_type==ObjectType::ObjEventTrigger) + else if(obj_type==ObjectType::EventTrigger) object=createEventTrigger(); - else if(obj_type==ObjectType::ObjGenericSQL) + else if(obj_type==ObjectType::GenericSql) object=createGenericSQL(); - else if(obj_type==ObjectType::ObjPolicy) + else if(obj_type==ObjectType::Policy) object=createPolicy(); } @@ -3230,7 +3230,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) QString elem_name; BaseObject *tabspc=nullptr, *owner=nullptr, *collation=nullptr; Schema *schema=nullptr; - ObjectType obj_type=ObjectType::ObjBaseObject, obj_type_aux; + ObjectType obj_type=ObjectType::BaseObject, obj_type_aux; bool has_error=false, protected_obj=false, sql_disabled=false; if(!object) @@ -3240,7 +3240,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) obj_type_aux=object->getObjectType(); - if(obj_type_aux!=ObjectType::ObjCast) + if(obj_type_aux!=ObjectType::Cast) object->setName(attribs[ParsersAttributes::NAME]); if(BaseObject::acceptsAlias(obj_type_aux)) @@ -3270,7 +3270,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's schema else if(elem_name==ParsersAttributes::SCHEMA) { - obj_type=ObjectType::ObjSchema; + obj_type=ObjectType::Schema; xmlparser.getElementAttributes(attribs_aux); schema=dynamic_cast(getObject(attribs_aux[ParsersAttributes::NAME], obj_type)); object->setSchema(schema); @@ -3279,7 +3279,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's tablespace else if(elem_name==ParsersAttributes::TABLESPACE) { - obj_type=ObjectType::ObjTablespace; + obj_type=ObjectType::Tablespace; xmlparser.getElementAttributes(attribs_aux); tabspc=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setTablespace(tabspc); @@ -3288,7 +3288,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's owner else if(elem_name==ParsersAttributes::ROLE) { - obj_type=ObjectType::ObjRole; + obj_type=ObjectType::Role; xmlparser.getElementAttributes(attribs_aux); owner=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setOwner(owner); @@ -3297,7 +3297,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) //Defines the object's schema else if(elem_name==ParsersAttributes::COLLATION) { - obj_type=ObjectType::ObjCollation; + obj_type=ObjectType::Collation; xmlparser.getElementAttributes(attribs_aux); collation=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); object->setCollation(collation); @@ -3323,8 +3323,8 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.getElementAttributes(attribs); if(elem_name==ParsersAttributes::POSITION && - (obj_type_aux!=ObjectType::ObjRelationship && - obj_type_aux!=ObjectType::ObjBaseRelationship)) + (obj_type_aux!=ObjectType::Relationship && + obj_type_aux!=ObjectType::BaseRelationship)) { dynamic_cast(object)->setPosition(QPointF(attribs[ParsersAttributes::X_POS].toDouble(), attribs[ParsersAttributes::Y_POS].toDouble())); @@ -3351,12 +3351,12 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else if(!object->getSchema() && - (obj_type_aux==ObjectType::ObjFunction || obj_type_aux==ObjectType::ObjTable || - obj_type_aux==ObjectType::ObjView || obj_type_aux==ObjectType::ObjDomain || - obj_type_aux==ObjectType::ObjAggregate || obj_type_aux==ObjectType::ObjOperator || - obj_type_aux==ObjectType::ObjSequence || obj_type_aux==ObjectType::ObjConversion || - obj_type_aux==ObjectType::ObjType || obj_type_aux==ObjectType::ObjOpFamily || - obj_type_aux==ObjectType::ObjOpClass)) + (obj_type_aux==ObjectType::Function || obj_type_aux==ObjectType::Table || + obj_type_aux==ObjectType::View || obj_type_aux==ObjectType::Domain || + obj_type_aux==ObjectType::Aggregate || obj_type_aux==ObjectType::Operator || + obj_type_aux==ObjectType::Sequence || obj_type_aux==ObjectType::Conversion || + obj_type_aux==ObjectType::Type || obj_type_aux==ObjectType::OpFamily || + obj_type_aux==ObjectType::OpClass)) { throw Exception(Exception::getErrorMessage(ErrorCode::InvObjectAllocationNoSchema) .arg(object->getName()) @@ -3508,16 +3508,16 @@ Role *DatabaseModel::createRole(void) for(i=0; i < len; i++) { //Gets the role using the name from the model using the name from the list - ref_role=dynamic_cast(getObject(list[i].trimmed(),ObjectType::ObjRole)); + ref_role=dynamic_cast(getObject(list[i].trimmed(),ObjectType::Role)); //Raises an error if the roles doesn't exists if(!ref_role) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(role->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjRole)) + .arg(BaseObject::getTypeName(ObjectType::Role)) .arg(list[i]) - .arg(BaseObject::getTypeName(ObjectType::ObjRole)), + .arg(BaseObject::getTypeName(ObjectType::Role)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -3606,7 +3606,7 @@ Language *DatabaseModel::createLanguage(void) { obj_type=BaseObject::getObjectType(xmlparser.getElementName()); - if(obj_type==ObjectType::ObjFunction) + if(obj_type==ObjectType::Function) { xmlparser.getElementAttributes(attribs); @@ -3620,7 +3620,7 @@ Language *DatabaseModel::createLanguage(void) { //Gets the function signature and tries to retrieve it from the model signature=attribs[ParsersAttributes::SIGNATURE]; - func=getObject(signature, ObjectType::ObjFunction); + func=getObject(signature, ObjectType::Function); //Raises an error if the function doesn't exists if(!func) @@ -3628,7 +3628,7 @@ Language *DatabaseModel::createLanguage(void) .arg(lang->getName()) .arg(lang->getTypeName()) .arg(signature) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(ref_type==ParsersAttributes::VALIDATOR_FUNC) @@ -3748,7 +3748,7 @@ Function *DatabaseModel::createFunction(void) } } //Gets the function language - else if(obj_type==ObjectType::ObjLanguage) + else if(obj_type==ObjectType::Language) { xmlparser.getElementAttributes(attribs); object=getObject(attribs[ParsersAttributes::NAME], obj_type); @@ -3759,7 +3759,7 @@ Function *DatabaseModel::createFunction(void) .arg(func->getName()) .arg(func->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), + .arg(BaseObject::getTypeName(ObjectType::Language)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); func->setLanguage(dynamic_cast(object)); @@ -3802,7 +3802,7 @@ Function *DatabaseModel::createFunction(void) if(e.getErrorType()==ErrorCode::RefUserTypeInexistsModel) throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(str_aux) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); @@ -3888,7 +3888,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjCollation); + collation=getObject(attribs[ParsersAttributes::NAME], ObjectType::Collation); //Raises an error if the operator class doesn't exists if(!collation) @@ -3897,7 +3897,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) .arg(tpattrib.getName()) .arg(tpattrib.getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4080,7 +4080,7 @@ Type *DatabaseModel::createType(void) else if(elem==ParsersAttributes::COLLATION) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjCollation); + collation=getObject(attribs[ParsersAttributes::NAME], ObjectType::Collation); //Raises an error if the operator class doesn't exists if(!collation) @@ -4089,7 +4089,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4098,7 +4098,7 @@ Type *DatabaseModel::createType(void) if(elem==ParsersAttributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjOpClass)); + op_class=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjectType::OpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -4107,7 +4107,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), + .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4119,7 +4119,7 @@ Type *DatabaseModel::createType(void) xmlparser.getElementAttributes(attribs); //Tries to get the function from the model - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4127,7 +4127,7 @@ Type *DatabaseModel::createType(void) .arg(type->getName()) .arg(type->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the function type is invalid else if(func_types.count(attribs[ParsersAttributes::REF_TYPE])==0) @@ -4259,7 +4259,7 @@ Cast *DatabaseModel::createCast(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4267,7 +4267,7 @@ Cast *DatabaseModel::createCast(void) .arg(cast->getName()) .arg(cast->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); cast->setCastFunction(dynamic_cast(func)); @@ -4318,7 +4318,7 @@ Conversion *DatabaseModel::createConversion(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4326,7 +4326,7 @@ Conversion *DatabaseModel::createConversion(void) .arg(conv->getName()) .arg(conv->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); conv->setConversionFunction(dynamic_cast(func)); @@ -4380,10 +4380,10 @@ Operator *DatabaseModel::createOperator(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[~ObjectType::ObjOperator]) + if(elem==objs_schemas[~ObjectType::Operator]) { xmlparser.getElementAttributes(attribs); - oper_aux=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOperator); + oper_aux=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Operator); //Raises an error if the auxiliary operator doesn't exists if(!oper_aux && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4391,7 +4391,7 @@ Operator *DatabaseModel::createOperator(void) .arg(oper->getSignature(true)) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setOperator(dynamic_cast(oper_aux), @@ -4412,7 +4412,7 @@ Operator *DatabaseModel::createOperator(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4420,7 +4420,7 @@ Operator *DatabaseModel::createOperator(void) .arg(oper->getName()) .arg(oper->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setFunction(dynamic_cast(func), @@ -4472,10 +4472,10 @@ OperatorClass *DatabaseModel::createOperatorClass(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[~ObjectType::ObjOpFamily]) + if(elem==objs_schemas[~ObjectType::OpFamily]) { xmlparser.getElementAttributes(attribs); - object=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOpFamily); + object=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::OpFamily); //Raises an error if the operator family doesn't exists if(!object) @@ -4483,7 +4483,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjOpFamily)), + .arg(BaseObject::getTypeName(ObjectType::OpFamily)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); op_class->setFamily(dynamic_cast(object)); @@ -4512,12 +4512,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) } else if(elem_type==OperatorClassElement::FunctionElem) { - object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjectType::ObjFunction); + object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjectType::Function); class_elem.setFunction(dynamic_cast(object),stg_number); } else if(elem_type==OperatorClassElement::OperatorElem) { - object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjectType::ObjOperator); + object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjectType::Operator); class_elem.setOperator(dynamic_cast(object),stg_number); if(xmlparser.hasElement(XmlParser::NextElement)) @@ -4526,14 +4526,14 @@ OperatorClass *DatabaseModel::createOperatorClass(void) xmlparser.accessElement(XmlParser::NextElement); xmlparser.getElementAttributes(attribs_aux); - object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjectType::ObjOpFamily); + object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjectType::OpFamily); if(!object && !attribs_aux[ParsersAttributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) .arg(attribs_aux[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjOpFamily)), + .arg(BaseObject::getTypeName(ObjectType::OpFamily)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); class_elem.setOperatorFamily(dynamic_cast(object)); @@ -4616,7 +4616,7 @@ Aggregate *DatabaseModel::createAggregate(void) else if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists on the model if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -4624,7 +4624,7 @@ Aggregate *DatabaseModel::createAggregate(void) .arg(aggreg->getName()) .arg(aggreg->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::TRANSITION_FUNC) @@ -4686,22 +4686,22 @@ Table *DatabaseModel::createTable(void) xmlparser.savePosition(); object=nullptr; - if(elem==BaseObject::objs_schemas[~ObjectType::ObjColumn]) + if(elem==BaseObject::objs_schemas[~ObjectType::Column]) object=createColumn(); - else if(elem==BaseObject::objs_schemas[~ObjectType::ObjConstraint]) + else if(elem==BaseObject::objs_schemas[~ObjectType::Constraint]) object=createConstraint(table); - else if(elem==BaseObject::objs_schemas[~ObjectType::ObjTag]) + else if(elem==BaseObject::objs_schemas[~ObjectType::Tag]) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME], ObjectType::ObjTag); + tag=getObject(aux_attribs[ParsersAttributes::NAME], ObjectType::Tag); if(!tag) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)) + .arg(BaseObject::getTypeName(ObjectType::Table)) .arg(aux_attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTag)) + .arg(BaseObject::getTypeName(ObjectType::Tag)) , ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4820,14 +4820,14 @@ Column *DatabaseModel::createColumn(void) if(!attribs[ParsersAttributes::SEQUENCE].isEmpty()) { - seq=getObject(attribs[ParsersAttributes::SEQUENCE], ObjectType::ObjSequence); + seq=getObject(attribs[ParsersAttributes::SEQUENCE], ObjectType::Sequence); if(!seq) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjColumn)) + .arg(BaseObject::getTypeName(ObjectType::Column)) .arg(attribs[ParsersAttributes::SEQUENCE]) - .arg(BaseObject::getTypeName(ObjectType::ObjSequence)), + .arg(BaseObject::getTypeName(ObjectType::Sequence)), ErrorCode::PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4887,9 +4887,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) obj_type=parent_obj->getObjectType(); //Identifies the correct parent type - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) table=dynamic_cast
(parent_obj); - else if(obj_type==ObjectType::ObjRelationship) + else if(obj_type==ObjectType::Relationship) rel=dynamic_cast(parent_obj); else //Raises an error if the user tries to create a constraint in a invalid parent @@ -4897,8 +4897,8 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) } else { - obj_type=ObjectType::ObjTable; - table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); + obj_type=ObjectType::Table; + table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); parent_obj=table; ins_constr_table=true; @@ -4907,9 +4907,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)) + .arg(BaseObject::getTypeName(ObjectType::Constraint)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4960,7 +4960,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(!attribs[ParsersAttributes::UPD_ACTION].isEmpty()) constr->setActionType(attribs[ParsersAttributes::UPD_ACTION], Constraint::UpdateAction); - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::ObjTable); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::Table); if(!ref_table && table->getName(true)==attribs[ParsersAttributes::REF_TABLE]) ref_table=table; @@ -4972,7 +4972,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) .arg(constr->getName()) .arg(constr->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5026,7 +5026,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { if(col_type==Constraint::SourceCols) { - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) { column=table->getColumn(col_list[i]); @@ -5035,7 +5035,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) column=table->getColumn(col_list[i], true); } else - column=dynamic_cast(rel->getObject(col_list[i], ObjectType::ObjColumn)); + column=dynamic_cast(rel->getObject(col_list[i], ObjectType::Column)); } else { @@ -5112,7 +5112,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec if(xml_elem==ParsersAttributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOpClass)); + op_class=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::OpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -5123,7 +5123,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), + .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5131,7 +5131,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjOpClass)), + .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5142,7 +5142,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==ParsersAttributes::OPERATOR) { xmlparser.getElementAttributes(attribs); - oper=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjOperator)); + oper=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Operator)); //Raises an error if the operator doesn't exists if(!oper) @@ -5151,7 +5151,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5160,7 +5160,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==ParsersAttributes::COLLATION) { xmlparser.getElementAttributes(attribs); - collation=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjCollation)); + collation=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjectType::Collation)); //Raises an error if the operator class doesn't exists if(!collation) @@ -5171,7 +5171,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5179,7 +5179,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5190,7 +5190,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { xmlparser.getElementAttributes(attribs); - if(parent_obj->getObjectType()==ObjectType::ObjTable) + if(parent_obj->getObjectType()==ObjectType::Table) { column=dynamic_cast
(parent_obj)->getColumn(attribs[ParsersAttributes::NAME]); @@ -5199,7 +5199,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec } else { - column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[ParsersAttributes::NAME], ObjectType::ObjColumn)); + column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[ParsersAttributes::NAME], ObjectType::Column)); } //Raises an error if the column doesn't exists @@ -5211,7 +5211,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjColumn)), + .arg(BaseObject::getTypeName(ObjectType::Column)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -5219,7 +5219,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjColumn)), + .arg(BaseObject::getTypeName(ObjectType::Column)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -5293,19 +5293,19 @@ Index *DatabaseModel::createIndex(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::View)); //Raises an error if the parent table doesn't exists if(!table) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjIndex)) + .arg(BaseObject::getTypeName(ObjectType::Index)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5374,17 +5374,17 @@ Rule *DatabaseModel::createRule(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::View)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjRule)) + .arg(BaseObject::getTypeName(ObjectType::Rule)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5453,17 +5453,17 @@ Trigger *DatabaseModel::createTrigger(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::View)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)) + .arg(BaseObject::getTypeName(ObjectType::Trigger)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5508,10 +5508,10 @@ Trigger *DatabaseModel::createTrigger(void) if(!attribs[ParsersAttributes::REF_TABLE].isEmpty()) { - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::ObjTable); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::Table); if(!ref_table) - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::ObjView); + ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::View); //Raises an error if the trigger is referencing a inexistent table if(!ref_table) @@ -5520,7 +5520,7 @@ Trigger *DatabaseModel::createTrigger(void) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::REF_TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5538,7 +5538,7 @@ Trigger *DatabaseModel::createTrigger(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -5547,7 +5547,7 @@ Trigger *DatabaseModel::createTrigger(void) .arg(trigger->getName()) .arg(trigger->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)); + .arg(BaseObject::getTypeName(ObjectType::Function)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5571,7 +5571,7 @@ Trigger *DatabaseModel::createTrigger(void) for(i=0; i < count; i++) { - column=dynamic_cast(table->getObject(list_aux[i].trimmed(), ObjectType::ObjColumn)); + column=dynamic_cast(table->getObject(list_aux[i].trimmed(), ObjectType::Column)); if(!column && dynamic_cast
(table)) column=dynamic_cast
(table)->getColumn(list_aux[i].trimmed(), true); @@ -5610,14 +5610,14 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); + table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjPolicy)) + .arg(BaseObject::getTypeName(ObjectType::Policy)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::_TRUE_); @@ -5655,7 +5655,7 @@ Policy *DatabaseModel::createPolicy(void) for(auto &name : rol_names) { - role=dynamic_cast(getObject(name.trimmed(), ObjectType::ObjRole)); + role=dynamic_cast(getObject(name.trimmed(), ObjectType::Role)); //Raises an error if the referenced role doesn't exists if(!role) @@ -5664,7 +5664,7 @@ Policy *DatabaseModel::createPolicy(void) .arg(policy->getName()) .arg(policy->getTypeName()) .arg(name) - .arg(BaseObject::getTypeName(ObjectType::ObjRole)), + .arg(BaseObject::getTypeName(ObjectType::Role)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5713,7 +5713,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) if(elem==ParsersAttributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::ObjFunction); + func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) @@ -5722,7 +5722,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) .arg(event_trig->getName()) .arg(event_trig->getTypeName()) .arg(attribs[ParsersAttributes::SIGNATURE]) - .arg(BaseObject::getTypeName(ObjectType::ObjFunction)), + .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5817,16 +5817,16 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) col_name=elem_list[1]; } - table=getObject(tab_name, ObjectType::ObjTable); + table=getObject(tab_name, ObjectType::Table); //Raises an error if the column parent table doesn't exists if(!table) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(sequence->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjSequence)) + .arg(BaseObject::getTypeName(ObjectType::Sequence)) .arg(tab_name) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5898,16 +5898,16 @@ View *DatabaseModel::createView(void) if(!attribs[ParsersAttributes::TABLE].isEmpty()) { column=nullptr; - table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable)); + table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); //Raises an error if the table doesn't exists if(!table) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(view->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjView)) + .arg(BaseObject::getTypeName(ObjectType::View)) .arg(attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)); + .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5924,10 +5924,10 @@ View *DatabaseModel::createView(void) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(view->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjView)) + .arg(BaseObject::getTypeName(ObjectType::View)) .arg(attribs[ParsersAttributes::TABLE] + QString(".") + attribs[ParsersAttributes::COLUMN]) - .arg(BaseObject::getTypeName(ObjectType::ObjColumn)); + .arg(BaseObject::getTypeName(ObjectType::Column)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5990,18 +5990,18 @@ View *DatabaseModel::createView(void) xmlparser.restorePosition(); } - else if(elem==BaseObject::getSchemaName(ObjectType::ObjTag)) + else if(elem==BaseObject::getSchemaName(ObjectType::Tag)) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjectType::ObjTag); + tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjectType::Tag); if(!tag) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)) + .arg(BaseObject::getTypeName(ObjectType::Table)) .arg(aux_attribs[ParsersAttributes::TABLE]) - .arg(BaseObject::getTypeName(ObjectType::ObjTag)) + .arg(BaseObject::getTypeName(ObjectType::Tag)) , ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6066,16 +6066,16 @@ Collation *DatabaseModel::createCollation(void) //Creating a collation from another collation else if(!attribs[ParsersAttributes::COLLATION].isEmpty()) { - copy_coll=this->getObject(attribs[ParsersAttributes::COLLATION], ObjectType::ObjCollation); + copy_coll=this->getObject(attribs[ParsersAttributes::COLLATION], ObjectType::Collation); //Raises an error if the copy collation doesn't exists if(!copy_coll) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(collation->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjCollation)) + .arg(BaseObject::getTypeName(ObjectType::Collation)) .arg(attribs[ParsersAttributes::COLLATION]) - .arg(BaseObject::getTypeName(ObjectType::ObjCollation)), + .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6203,7 +6203,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) DeferralType defer_type; ActionType del_action, upd_action; unsigned rel_type=0, i; - ObjectType table_types[2]={ObjectType::ObjView, ObjectType::ObjTable}, obj_rel_type; + ObjectType table_types[2]={ObjectType::View, ObjectType::Table}, obj_rel_type; QString str_aux, elem, tab_attribs[2]={ ParsersAttributes::SRC_TABLE, ParsersAttributes::DST_TABLE }; @@ -6226,15 +6226,15 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(attribs[ParsersAttributes::TYPE]!=ParsersAttributes::RELATION_TAB_VIEW && attribs[ParsersAttributes::TYPE]!=ParsersAttributes::RELATIONSHIP_FK) { - table_types[0]=ObjectType::ObjTable; - obj_rel_type=ObjectType::ObjRelationship; + table_types[0]=ObjectType::Table; + obj_rel_type=ObjectType::Relationship; } else { if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_FK) - table_types[0]=ObjectType::ObjTable; + table_types[0]=ObjectType::Table; - obj_rel_type=ObjectType::ObjBaseRelationship; + obj_rel_type=ObjectType::BaseRelationship; } //Gets the participant tables @@ -6255,7 +6255,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } } - if(obj_rel_type==ObjectType::ObjBaseRelationship) + if(obj_rel_type==ObjectType::BaseRelationship) { base_rel=getRelationship(tables[0], tables[1]); @@ -6306,7 +6306,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) .arg(this->getName()) .arg(this->getTypeName()) .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjBaseRelationship)), + .arg(BaseObject::getTypeName(ObjectType::BaseRelationship)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); base_rel->blockSignals(loading_model); @@ -6466,7 +6466,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } catch(Exception &e) { - if(base_rel && base_rel->getObjectType()==ObjectType::ObjRelationship) + if(base_rel && base_rel->getObjectType()==ObjectType::Relationship) delete(base_rel); throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); @@ -6484,7 +6484,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) /* If the FK relationship does not reference a foreign key (models generated in older versions) * we need to assign them to the respective relationships */ - if(base_rel && base_rel->getObjectType()==ObjectType::ObjBaseRelationship) + if(base_rel && base_rel->getObjectType()==ObjectType::BaseRelationship) { base_rel->blockSignals(loading_model); base_rel->connectRelationship(); @@ -6523,14 +6523,14 @@ Permission *DatabaseModel::createPermission(void) parent_name=attribs[ParsersAttributes::PARENT]; //If the object is a column its needed to get the parent table - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { - parent_table=dynamic_cast
(getObject(parent_name, ObjectType::ObjTable)); + parent_table=dynamic_cast
(getObject(parent_name, ObjectType::Table)); if(parent_table) object=parent_table->getColumn(obj_name); } - else if(obj_type==ObjectType::ObjDatabase) + else if(obj_type==ObjectType::Database) { object=this; } @@ -6559,14 +6559,14 @@ Permission *DatabaseModel::createPermission(void) for(i=0; i < len; i++) { - role=dynamic_cast(getObject(list[i].trimmed(),ObjectType::ObjRole)); + role=dynamic_cast(getObject(list[i].trimmed(),ObjectType::Role)); //Raises an error if the referenced role doesn't exists if(!role) { throw Exception(Exception::getErrorMessage(ErrorCode::PermissionRefInexistObject) .arg(list[i]) - .arg(BaseObject::getTypeName(ObjectType::ObjRole)), + .arg(BaseObject::getTypeName(ObjectType::Role)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6667,15 +6667,15 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab > Case the object is a column and its reference by the parent table primary key > Case the parent table is a partition and a column is being removed > Case the object is a constraint and its a table primary key */ - revalidate_rels=((obj_type==ObjectType::ObjColumn && + revalidate_rels=((obj_type==ObjectType::Column && (parent_tab->isConstraintRefColumn(dynamic_cast(object), ConstraintType::PrimaryKey) || parent_tab->isPartition() || parent_tab->isPartitioned())) || - (obj_type==ObjectType::ObjConstraint && + (obj_type==ObjectType::Constraint && dynamic_cast(object)->getConstraintType()==ConstraintType::PrimaryKey)); /* Additional validation for columns: checks if the parent table participates on a generalization/copy as destination table */ - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { itr=relationships.begin(); itr_end=relationships.end(); @@ -6823,7 +6823,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) object=obj_itr.second; obj_type=object->getObjectType(); - if(obj_type==ObjectType::ObjType && def_type==SchemaParser::SqlDefinition) + if(obj_type==ObjectType::Type && def_type==SchemaParser::SqlDefinition) { usr_type=dynamic_cast(object); @@ -6833,7 +6833,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) else attribs_aux[attrib]+=usr_type->getCodeDefinition(def_type); } - else if(obj_type==ObjectType::ObjDatabase) + else if(obj_type==ObjectType::Database) { if(def_type==SchemaParser::SqlDefinition) { @@ -6853,15 +6853,15 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) else attribs_aux[attrib]+=this->__getCodeDefinition(def_type); } - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) { attribs_aux[ParsersAttributes::PERMISSION]+=dynamic_cast(object)->getCodeDefinition(def_type); } - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) { attribs_aux[attrib]+=dynamic_cast(object)->getCodeDefinition(def_type, true); } - else if(obj_type==ObjectType::ObjRole || obj_type==ObjectType::ObjTablespace || obj_type==ObjectType::ObjSchema) + else if(obj_type==ObjectType::Role || obj_type==ObjectType::Tablespace || obj_type==ObjectType::Schema) { //The "public" schema does not have the SQL code definition generated if(def_type==SchemaParser::SqlDefinition) @@ -6871,7 +6871,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) /* The Tablespace has the SQL code definition disabled when generating the code of the entire model because this object cannot be created from a multiline sql command */ - if(obj_type==ObjectType::ObjTablespace && !object->isSystemObject() && def_type==SchemaParser::SqlDefinition) + if(obj_type==ObjectType::Tablespace && !object->isSystemObject() && def_type==SchemaParser::SqlDefinition) { //Saving the sql disabled state sql_disabled=object->isSQLDisabled(); @@ -6884,12 +6884,12 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) object->setSQLDisabled(sql_disabled); } //System object doesn't has the XML generated (the only exception is for public schema) - else if((obj_type!=ObjectType::ObjSchema && !object->isSystemObject()) || - (obj_type==ObjectType::ObjSchema && + else if((obj_type!=ObjectType::Schema && !object->isSystemObject()) || + (obj_type==ObjectType::Schema && ((object->getName()==QString("public") && def_type==SchemaParser::XmlDefinition) || (object->getName()!=QString("public") && object->getName()!=QString("pg_catalog"))))) { - if(object->getObjectType()==ObjectType::ObjSchema) + if(object->getObjectType()==ObjectType::Schema) search_path+=QString(",") + object->getName(true); //Generates the code definition and concatenates to the others @@ -6927,10 +6927,10 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[ParsersAttributes::PROTECTED]=(this->is_protected ? ParsersAttributes::_TRUE_ : QString()); attribs_aux[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs_aux[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); - attribs_aux[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::ObjSchema] ? default_objs[ObjectType::ObjSchema]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjectType::ObjRole] ? default_objs[ObjectType::ObjRole]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::ObjTablespace] ? default_objs[ObjectType::ObjTablespace]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjectType::ObjCollation] ? default_objs[ObjectType::ObjCollation]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getName(true) : QString()); + attribs_aux[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getName(true) : QString()); } else { @@ -6986,18 +6986,18 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b Constraint *constr=nullptr; View *view=nullptr; Relationship *rel=nullptr; - ObjectType aux_obj_types[]={ ObjectType::ObjRole, ObjectType::ObjTablespace, ObjectType::ObjSchema, ObjectType::ObjTag }, - obj_types[]={ ObjectType::ObjEventTrigger, ObjectType::ObjCollation, ObjectType::ObjLanguage, ObjectType::ObjFunction, ObjectType::ObjType, - ObjectType::ObjCast, ObjectType::ObjConversion, ObjectType::ObjExtension, - ObjectType::ObjOperator, ObjectType::ObjOpFamily, ObjectType::ObjOpClass, - ObjectType::ObjAggregate, ObjectType::ObjDomain, ObjectType::ObjTextbox, ObjectType::ObjBaseRelationship, - ObjectType::ObjRelationship, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjSequence, ObjectType::ObjGenericSQL }; + ObjectType aux_obj_types[]={ ObjectType::Role, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Tag }, + obj_types[]={ ObjectType::EventTrigger, ObjectType::Collation, ObjectType::Language, ObjectType::Function, ObjectType::Type, + ObjectType::Cast, ObjectType::Conversion, ObjectType::Extension, + ObjectType::Operator, ObjectType::OpFamily, ObjectType::OpClass, + ObjectType::Aggregate, ObjectType::Domain, ObjectType::Textbox, ObjectType::BaseRelationship, + ObjectType::Relationship, ObjectType::Table, ObjectType::View, ObjectType::Sequence, ObjectType::GenericSql }; unsigned i=0, aux_obj_cnt=sizeof(aux_obj_types)/sizeof(ObjectType), count=sizeof(obj_types)/sizeof(ObjectType); //The first objects on the map will be roles, tablespaces, schemas and tags for(i=0; i < aux_obj_cnt; i++) { - if(aux_obj_types[i]!=ObjectType::ObjTag || def_type==SchemaParser::XmlDefinition) + if(aux_obj_types[i]!=ObjectType::Tag || def_type==SchemaParser::XmlDefinition) { obj_list=getObjectList(aux_obj_types[i]); @@ -7013,7 +7013,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b { //For SQL definition, only the textbox and base relationship does not enters to the code generation list if(def_type==SchemaParser::SqlDefinition && - (obj_types[i]==ObjectType::ObjTextbox || obj_types[i]==ObjectType::ObjBaseRelationship)) + (obj_types[i]==ObjectType::Textbox || obj_types[i]==ObjectType::BaseRelationship)) obj_list=nullptr; else obj_list=getObjectList(obj_types[i]); @@ -7024,7 +7024,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b { /* If the object is a FK relationship it's stored in a separeted list in order to have the code generated at end of whole definition (after foreign keys definition) */ - if(object->getObjectType()==ObjectType::ObjBaseRelationship && + if(object->getObjectType()==ObjectType::BaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk) { fk_rels.push_back(object); @@ -7106,7 +7106,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b object=(*itr); itr++; - if(object->getObjectType()==ObjectType::ObjRelationship) + if(object->getObjectType()==ObjectType::Relationship) { rel=dynamic_cast(object); objs[0]=rel->getTable(Relationship::SrcTable); @@ -7122,7 +7122,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b table=rel->getGeneratedTable(); objs[2]=table; - for(BaseObject *tab_obj : *table->getObjectList(ObjectType::ObjConstraint)) + for(BaseObject *tab_obj : *table->getObjectList(ObjectType::Constraint)) { constr=dynamic_cast(tab_obj); @@ -7186,7 +7186,7 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vector dep_objs, chld_objs; Table *table=dynamic_cast
(object); - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; if(!object) return; @@ -7213,11 +7213,11 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vector::iterator end; - if(obj_type==ObjectType::ObjSchema) + if(obj_type==ObjectType::Schema) { //Retrieve all objects that belongs to the schema chld_objs=getObjects(object); @@ -7242,7 +7242,7 @@ void DatabaseModel::__getObjectDependencies(BaseObject *object, vectorgetObjectType()!=ObjectType::ObjColumn) || + if((!constr && child->getObjectType()!=ObjectType::Column) || (constr && ((constr->getConstraintType()==ConstraintType::ForeignKey) || (constr->getConstraintType()!=ConstraintType::ForeignKey && @@ -7284,7 +7284,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on /* Include tables generated by many-to-many relationships if their schemas are the same as the 'object' when this one is a schema too */ - if(obj_type==ObjectType::ObjSchema) + if(obj_type==ObjectType::Schema) { if(only_children) { @@ -7326,7 +7326,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on { constr=dynamic_cast(child); - if((!constr && child->getObjectType()!=ObjectType::ObjColumn) || + if((!constr && child->getObjectType()!=ObjectType::Column) || (constr && ((constr->getConstraintType()==ConstraintType::ForeignKey) || (constr->getConstraintType()!=ConstraintType::ForeignKey && @@ -7354,7 +7354,7 @@ vector DatabaseModel::getCreationOrder(BaseObject *object, bool on if(table) { - for(BaseObject *col : *table->getObjectList(ObjectType::ObjColumn)) + for(BaseObject *col : *table->getObjectList(ObjectType::Column)) { getPermissions(col, perms_aux); perms.insert(perms.end(), perms_aux.begin(), perms_aux.end()); @@ -7445,7 +7445,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetCollation(), deps, inc_indirect_deps); //** Getting the dependecies for operator class ** - if(obj_type==ObjectType::ObjOpClass) + if(obj_type==ObjectType::OpClass) { OperatorClass *opclass=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(opclass->getDataType()); @@ -7481,7 +7481,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object)->getType()); @@ -7489,13 +7489,13 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object)->getConversionFunction(); getObjectDependecies(func, deps, inc_indirect_deps); } //** Getting the dependecies for cast ** - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) { Cast *cast=dynamic_cast(object); BaseObject *usr_type=nullptr; @@ -7511,12 +7511,12 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetCastFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for event trigger ** - else if(obj_type==ObjectType::ObjEventTrigger) + else if(obj_type==ObjectType::EventTrigger) { getObjectDependecies(dynamic_cast(object)->getFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for function ** - else if(obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Function) { Function *func=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(func->getReturnType()); @@ -7547,7 +7547,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7574,7 +7574,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7585,7 +7585,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7612,7 +7612,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); unsigned i, i1, count, @@ -7626,7 +7626,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr; @@ -7655,14 +7655,14 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); if(seq->getOwnerColumn()) getObjectDependecies(seq->getOwnerColumn()->getParentTable(), deps, inc_indirect_deps); } //** Getting the dependecies for column ** - else if(obj_type==ObjectType::ObjColumn) + else if(obj_type==ObjectType::Column) { Column *col=dynamic_cast(object); BaseObject *usr_type=getObjectPgSQLType(col->getType()), @@ -7675,7 +7675,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7686,7 +7686,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for index ** - else if(obj_type==ObjectType::ObjIndex) + else if(obj_type==ObjectType::Index) { Index *index=dynamic_cast(object); BaseObject *usr_type=nullptr; @@ -7709,7 +7709,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetIndexElement(i).getCollation(), deps, inc_indirect_deps); } } - else if(obj_type==ObjectType::ObjPolicy) + else if(obj_type==ObjectType::Policy) { Policy *pol=dynamic_cast(object); @@ -7717,7 +7717,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *usr_type=nullptr, *seq=nullptr; @@ -7814,7 +7814,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); BaseObject *aux_type=nullptr; @@ -7843,7 +7843,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); unsigned i, count; @@ -7865,7 +7865,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); @@ -7911,14 +7911,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector refs.push_back(this); } - if(obj_type==ObjectType::ObjView && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::View && (!exclusion_mode || (exclusion_mode && !refer))) { View *view=dynamic_cast(object); vector tab_objs=view->getObjects(); refs.insert(refs.end(), tab_objs.begin(), tab_objs.end()); } - if(obj_type==ObjectType::ObjTable && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Table && (!exclusion_mode || (exclusion_mode && !refer))) { Table *table=dynamic_cast
(object); Sequence *seq=nullptr; @@ -7930,7 +7930,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector vector::iterator itr, itr_end; vector *tab_objs; unsigned i, count; - ObjectType tab_obj_types[4]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjPolicy }; + ObjectType tab_obj_types[4]={ ObjectType::Trigger, ObjectType::Rule, ObjectType::Index, ObjectType::Policy }; for(i=0; i < 4; i++) { @@ -8055,14 +8055,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjFunction && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Function && (!exclusion_mode || (exclusion_mode && !refer))) { Function *func=dynamic_cast(object); vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ObjectType::ObjCast, ObjectType::ObjEventTrigger, ObjectType::ObjConversion, - ObjectType::ObjAggregate, ObjectType::ObjOperator, ObjectType::ObjOpClass, - ObjectType::ObjTable, ObjectType::ObjType, ObjectType::ObjLanguage }; + ObjectType obj_types[]={ObjectType::Cast, ObjectType::EventTrigger, ObjectType::Conversion, + ObjectType::Aggregate, ObjectType::Operator, ObjectType::OpClass, + ObjectType::Table, ObjectType::Type, ObjectType::Language }; unsigned i, i1, count, cnt=sizeof(obj_types)/sizeof(ObjectType); Table *tab=nullptr; Aggregate *aggreg=nullptr; @@ -8078,7 +8078,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==ObjectType::ObjCast) + if(obj_types[i]==ObjectType::Cast) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8090,7 +8090,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjectType::ObjEventTrigger) + else if(obj_types[i]==ObjectType::EventTrigger) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8102,7 +8102,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjectType::ObjConversion) + else if(obj_types[i]==ObjectType::Conversion) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8114,7 +8114,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjectType::ObjAggregate) + else if(obj_types[i]==ObjectType::Aggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8129,7 +8129,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjectType::ObjOperator) + else if(obj_types[i]==ObjectType::Operator) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8145,7 +8145,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjectType::ObjOpClass) + else if(obj_types[i]==ObjectType::OpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8163,7 +8163,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjectType::ObjTable) + else if(obj_types[i]==ObjectType::Table) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8183,7 +8183,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjType) + else if(obj_types[i]==ObjectType::Type) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8200,7 +8200,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjLanguage) + else if(obj_types[i]==ObjectType::Language) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8219,14 +8219,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjSchema && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Schema && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[11]={ObjectType::ObjFunction, ObjectType::ObjTable, ObjectType::ObjView, - ObjectType::ObjDomain, ObjectType::ObjAggregate, ObjectType::ObjOperator, - ObjectType::ObjSequence, ObjectType::ObjConversion, - ObjectType::ObjType, ObjectType::ObjOpFamily, ObjectType::ObjOpClass}; + ObjectType obj_types[11]={ObjectType::Function, ObjectType::Table, ObjectType::View, + ObjectType::Domain, ObjectType::Aggregate, ObjectType::Operator, + ObjectType::Sequence, ObjectType::Conversion, + ObjectType::Type, ObjectType::OpFamily, ObjectType::OpClass}; unsigned i; for(i=0; i < 11 && (!exclusion_mode || (exclusion_mode && !refer)); i++) @@ -8247,15 +8247,15 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if((obj_type==ObjectType::ObjType || obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjSequence || - obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjExtension || obj_type==ObjectType::ObjView) + if((obj_type==ObjectType::Type || obj_type==ObjectType::Domain || obj_type==ObjectType::Sequence || + obj_type==ObjectType::Table || obj_type==ObjectType::Extension || obj_type==ObjectType::View) && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ObjectType::ObjTable, ObjectType::ObjOpClass, ObjectType::ObjCast, - ObjectType::ObjDomain, ObjectType::ObjFunction, ObjectType::ObjAggregate, - ObjectType::ObjOperator, ObjectType::ObjType, ObjectType::ObjRelationship }; + ObjectType obj_types[]={ObjectType::Table, ObjectType::OpClass, ObjectType::Cast, + ObjectType::Domain, ObjectType::Function, ObjectType::Aggregate, + ObjectType::Operator, ObjectType::Type, ObjectType::Relationship }; unsigned i, i1, count, tp_count = sizeof(obj_types)/sizeof(ObjectType); OperatorClass *op_class=nullptr; OperatorClassElement elem; @@ -8272,13 +8272,13 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector switch(obj_type) { - case ObjectType::ObjType: ptr_pgsqltype=dynamic_cast(object); break; - case ObjectType::ObjDomain: + case ObjectType::Type: ptr_pgsqltype=dynamic_cast(object); break; + case ObjectType::Domain: ptr_pgsqltype=dynamic_cast(object); break; - case ObjectType::ObjSequence: ptr_pgsqltype=dynamic_cast(object); break; - case ObjectType::ObjExtension: ptr_pgsqltype=dynamic_cast(object); break; - case ObjectType::ObjView: ptr_pgsqltype=dynamic_cast(object); break; + case ObjectType::Sequence: ptr_pgsqltype=dynamic_cast(object); break; + case ObjectType::Extension: ptr_pgsqltype=dynamic_cast(object); break; + case ObjectType::View: ptr_pgsqltype=dynamic_cast(object); break; default: ptr_pgsqltype=dynamic_cast(object); break; } @@ -8288,7 +8288,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==ObjectType::ObjRelationship) + if(obj_types[i]==ObjectType::Relationship) { bool added; @@ -8311,7 +8311,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjTable) + else if(obj_types[i]==ObjectType::Table) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8326,7 +8326,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector if(!col->isAddedByRelationship() && (col->getType()==ptr_pgsqltype || //Special case for postgis extension - (obj_type == ObjectType::ObjExtension && object->getName() == QString("postgis") && col->getType().isGiSType()))) + (obj_type == ObjectType::Extension && object->getName() == QString("postgis") && col->getType().isGiSType()))) { refer=true; refs.push_back(col); @@ -8334,7 +8334,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjOpClass) + else if(obj_types[i]==ObjectType::OpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8358,7 +8358,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjDomain) + else if(obj_types[i]==ObjectType::Domain) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8372,7 +8372,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjType) + else if(obj_types[i]==ObjectType::Type) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8389,7 +8389,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjAggregate) + else if(obj_types[i]==ObjectType::Aggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8407,7 +8407,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjFunction) + else if(obj_types[i]==ObjectType::Function) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8433,7 +8433,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjOperator) + else if(obj_types[i]==ObjectType::Operator) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8448,7 +8448,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjCast) + else if(obj_types[i]==ObjectType::Cast) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8466,15 +8466,15 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjRole && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Role && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[13]={ObjectType::ObjFunction, ObjectType::ObjTable, ObjectType::ObjDomain, - ObjectType::ObjAggregate, ObjectType::ObjSchema, ObjectType::ObjOperator, - ObjectType::ObjSequence, ObjectType::ObjConversion, - ObjectType::ObjLanguage, ObjectType::ObjTablespace, - ObjectType::ObjType, ObjectType::ObjOpFamily, ObjectType::ObjOpClass}; + ObjectType obj_types[13]={ObjectType::Function, ObjectType::Table, ObjectType::Domain, + ObjectType::Aggregate, ObjectType::Schema, ObjectType::Operator, + ObjectType::Sequence, ObjectType::Conversion, + ObjectType::Language, ObjectType::Tablespace, + ObjectType::Type, ObjectType::OpFamily, ObjectType::OpClass}; unsigned i,i1, count; Role *role_aux=nullptr; Role *role=dynamic_cast(object); @@ -8532,9 +8532,9 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector refs.push_back(*itr); } - if((*itr)->getObjectType() == ObjectType::ObjTable) + if((*itr)->getObjectType() == ObjectType::Table) { - for(auto obj : *(dynamic_cast
(*itr))->getObjectList(ObjectType::ObjPolicy)) + for(auto obj : *(dynamic_cast
(*itr))->getObjectList(ObjectType::Policy)) { if(dynamic_cast(obj)->isRoleExists(role)) { @@ -8556,7 +8556,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjTablespace && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Tablespace && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; unsigned i, count; @@ -8609,7 +8609,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjLanguage && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Language && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; Function *func=nullptr; @@ -8629,7 +8629,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjOpClass && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::OpClass && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; Type *usertype=nullptr; @@ -8707,14 +8707,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjOperator && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Operator && (!exclusion_mode || (exclusion_mode && !refer))) { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ObjectType::ObjOpClass, - ObjectType::ObjAggregate, - ObjectType::ObjOperator, - ObjectType::ObjTable }; + ObjectType obj_types[]={ObjectType::OpClass, + ObjectType::Aggregate, + ObjectType::Operator, + ObjectType::Table }; unsigned i, i1, count; OperatorClass *op_class=nullptr; Operator *oper_aux=nullptr, *oper=dynamic_cast(object); @@ -8727,7 +8727,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr=obj_list->begin(); itr_end=obj_list->end(); - if(obj_types[i]==ObjectType::ObjOpClass) + if(obj_types[i]==ObjectType::OpClass) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8745,7 +8745,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } - else if(obj_types[i]==ObjectType::ObjAggregate) + else if(obj_types[i]==ObjectType::Aggregate) { while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -8757,7 +8757,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } - else if(obj_types[i]==ObjectType::ObjOperator) + else if(obj_types[i]==ObjectType::Operator) { while(itr!=itr_end && !refer) { @@ -8805,7 +8805,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjOpFamily && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::OpFamily && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; OperatorFamily *op_family=dynamic_cast(object); @@ -8824,10 +8824,10 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjCollation && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Collation && (!exclusion_mode || (exclusion_mode && !refer))) { - ObjectType obj_types[]={ ObjectType::ObjDomain, ObjectType::ObjCollation, ObjectType::ObjType }, - tab_obj_types[]={ ObjectType::ObjColumn, ObjectType::ObjIndex }; + ObjectType obj_types[]={ ObjectType::Domain, ObjectType::Collation, ObjectType::Type }, + tab_obj_types[]={ ObjectType::Column, ObjectType::Index }; unsigned i, count; vector *obj_list=nullptr; vector::iterator itr, itr_end; @@ -8856,7 +8856,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } count=sizeof(tab_obj_types)/sizeof(ObjectType); - obj_list=getObjectList(ObjectType::ObjTable); + obj_list=getObjectList(ObjectType::Table); itr=obj_list->begin(); itr_end=obj_list->end(); @@ -8873,8 +8873,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(tab_itr!=tab_itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { tab_obj=(*tab_itr); - if((tab_obj->getObjectType()==ObjectType::ObjColumn && tab_obj->getCollation()==object) || - (tab_obj->getObjectType()==ObjectType::ObjIndex && + if((tab_obj->getObjectType()==ObjectType::Column && tab_obj->getCollation()==object) || + (tab_obj->getObjectType()==ObjectType::Index && dynamic_cast(tab_obj)->isReferCollation(dynamic_cast(object)))) { refer=true; @@ -8899,12 +8899,12 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjColumn && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Column && (!exclusion_mode || (exclusion_mode && !refer))) { Column *column=dynamic_cast(object); vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[]={ ObjectType::ObjSequence, ObjectType::ObjView, ObjectType::ObjTable, ObjectType::ObjRelationship }; + ObjectType obj_types[]={ ObjectType::Sequence, ObjectType::View, ObjectType::Table, ObjectType::Relationship }; unsigned i, count=sizeof(obj_types)/sizeof(ObjectType); for(i=0; i < count && (!exclusion_mode || (exclusion_mode && !refer)); i++) @@ -8915,13 +8915,13 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { - if((obj_types[i]==ObjectType::ObjSequence && dynamic_cast(*itr)->getOwnerColumn()==column) || - (obj_types[i]==ObjectType::ObjView && dynamic_cast(*itr)->isReferencingColumn(column))) + if((obj_types[i]==ObjectType::Sequence && dynamic_cast(*itr)->getOwnerColumn()==column) || + (obj_types[i]==ObjectType::View && dynamic_cast(*itr)->isReferencingColumn(column))) { refer=true; refs.push_back(*itr); } - else if(obj_types[i]==ObjectType::ObjTable) + else if(obj_types[i]==ObjectType::Table) { Table *tab=dynamic_cast
(*itr); unsigned count, idx, count1, i1; @@ -8980,7 +8980,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - else if(obj_types[i]==ObjectType::ObjRelationship) + else if(obj_types[i]==ObjectType::Relationship) { Relationship *rel=dynamic_cast(*itr); unsigned constr_cnt, idx; @@ -9002,7 +9002,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } - if(obj_type==ObjectType::ObjTag && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Tag && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; vector list; @@ -9025,7 +9025,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::ObjSequence && (!exclusion_mode || (exclusion_mode && !refer))) + if(obj_type==ObjectType::Sequence && (!exclusion_mode || (exclusion_mode && !refer))) { Table *table=nullptr; vector *cols=nullptr; @@ -9035,7 +9035,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector for(i=0; i < cnt && (!exclusion_mode || (exclusion_mode && !refer)); i++) { table=dynamic_cast
(tables[i]); - cols=table->getObjectList(ObjectType::ObjColumn); + cols=table->getObjectList(ObjectType::Column); itr=cols->begin(); itr_end=cols->end(); @@ -9083,9 +9083,9 @@ void DatabaseModel::setObjectsModified(vector &objects) void DatabaseModel::setObjectsModified(vector types) { - ObjectType obj_types[]={ObjectType::ObjTable, ObjectType::ObjView, - ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, - ObjectType::ObjTextbox, ObjectType::ObjSchema }; + ObjectType obj_types[]={ObjectType::Table, ObjectType::View, + ObjectType::Relationship, ObjectType::BaseRelationship, + ObjectType::Textbox, ObjectType::Schema }; vector::iterator itr, itr_end; vector *obj_list=nullptr; Textbox *label=nullptr; @@ -9105,7 +9105,7 @@ void DatabaseModel::setObjectsModified(vector types) dynamic_cast(*itr)->setModified(true); //For relationships is needed to set the labels as modified too - if(obj_types[i]==ObjectType::ObjRelationship || obj_types[i]==ObjectType::ObjBaseRelationship) + if(obj_types[i]==ObjectType::Relationship || obj_types[i]==ObjectType::BaseRelationship) { rel=dynamic_cast(*itr); for(i1=0; i1 < 3; i1++) @@ -9130,8 +9130,8 @@ void DatabaseModel::setCodesInvalidated(vector types) sel_types=BaseObject::getObjectTypes(false); else { - ObjectType tab_obj_types[]={ObjectType::ObjColumn, ObjectType::ObjConstraint, - ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjPolicy}; + ObjectType tab_obj_types[]={ObjectType::Column, ObjectType::Constraint, + ObjectType::Trigger, ObjectType::Rule, ObjectType::Index, ObjectType::Policy}; for(unsigned i=0; i < 6; i++) sel_types.erase(std::find(sel_types.begin(), sel_types.end(), tab_obj_types[i])); @@ -9156,27 +9156,27 @@ BaseObject *DatabaseModel::getObjectPgSQLType(PgSqlType type) switch(type.getUserTypeConfig()) { case UserTypeConfig::BaseType: - return(this->getObject(*type, ObjectType::ObjType)); + return(this->getObject(*type, ObjectType::Type)); break; case UserTypeConfig::DomainType: - return(this->getObject(*type, ObjectType::ObjDomain)); + return(this->getObject(*type, ObjectType::Domain)); break; case UserTypeConfig::TableType: - return(this->getObject(*type, ObjectType::ObjTable)); + return(this->getObject(*type, ObjectType::Table)); break; case UserTypeConfig::ViewType: - return(this->getObject(*type, ObjectType::ObjView)); + return(this->getObject(*type, ObjectType::View)); break; case UserTypeConfig::SequenceType: - return(this->getObject(*type, ObjectType::ObjSequence)); + return(this->getObject(*type, ObjectType::Sequence)); break; case UserTypeConfig::ExtensionType: - return(this->getObject(*type, ObjectType::ObjExtension)); + return(this->getObject(*type, ObjectType::Extension)); break; default: @@ -9187,7 +9187,7 @@ BaseObject *DatabaseModel::getObjectPgSQLType(PgSqlType type) void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_sch_name) { - ObjectType types[]={ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjDomain, ObjectType::ObjType, ObjectType::ObjSequence }; + ObjectType types[]={ ObjectType::Table, ObjectType::View, ObjectType::Domain, ObjectType::Type, ObjectType::Sequence }; vector list, vet; BaseObject *obj=nullptr; QString prev_name; @@ -9208,7 +9208,7 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s obj=list.back(); //For objects that is not a Views is needed to rename the pgsql type represented by the object - if(obj->getObjectType()!=ObjectType::ObjView) + if(obj->getObjectType()!=ObjectType::View) { //Configures the previous type name prev_name=BaseObject::formatName(prev_sch_name) + QString(".") + @@ -9216,14 +9216,14 @@ void DatabaseModel::validateSchemaRenaming(Schema *schema, const QString &prev_s /* Special case for tables. Need to make a dynamic_cast before the reinterpret_cast to get the correct reference to table */ - if(obj->getObjectType()==ObjectType::ObjTable) + if(obj->getObjectType()==ObjectType::Table) PgSqlType::renameUserType(prev_name, reinterpret_cast(dynamic_cast
(obj)), obj->getName(true)); else PgSqlType::renameUserType(prev_name, reinterpret_cast(obj), obj->getName(true)); } //For graphical objects set them as modified to redraw them - if(obj->getObjectType()==ObjectType::ObjTable || obj->getObjectType()==ObjectType::ObjView) + if(obj->getObjectType()==ObjectType::Table || obj->getObjectType()==ObjectType::View) dynamic_cast(obj)->setModified(true); list.pop_back(); @@ -9243,7 +9243,7 @@ void DatabaseModel::createSystemObjects(bool create_public) /* The particular case is for public schema that is created only when the flag is set. This because the public schema is written on model file even being a system object. This strategy permits the user controls the schema rectangle behavior */ - if(create_public && getObjectIndex(QString("public"), ObjectType::ObjSchema) < 0) + if(create_public && getObjectIndex(QString("public"), ObjectType::Schema) < 0) { public_sch=new Schema; public_sch->setName(QString("public")); @@ -9271,7 +9271,7 @@ void DatabaseModel::createSystemObjects(bool create_public) for(unsigned i=0; i < sizeof(lang_types)/sizeof(LanguageType); i++) { - if(getObjectIndex(~LanguageType(lang_types[i]), ObjectType::ObjLanguage) < 0) + if(getObjectIndex(~LanguageType(lang_types[i]), ObjectType::Language) < 0) { lang=new Language; lang->BaseObject::setName(~LanguageType(lang_types[i])); @@ -9299,7 +9299,7 @@ void DatabaseModel::createSystemObjects(bool create_public) addRole(postgres); setDefaultObject(postgres); - setDefaultObject(getObject(QString("public"), ObjectType::ObjSchema), ObjectType::ObjSchema); + setDefaultObject(getObject(QString("public"), ObjectType::Schema), ObjectType::Schema); } vector DatabaseModel::findObjects(const QString &pattern, vector types, bool format_obj_names, bool case_sensitive, bool is_regexp, bool exact_match) @@ -9329,13 +9329,13 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorbegin(), getObjectList(ObjectType::ObjTable)->end()); + tables.insert(tables.end(), getObjectList(ObjectType::Table)->begin(), getObjectList(ObjectType::Table)->end()); inc_tabs=true; } - if(!inc_views && ((*itr_tp)==ObjectType::ObjRule || (*itr_tp)==ObjectType::ObjTrigger)) + if(!inc_views && ((*itr_tp)==ObjectType::Rule || (*itr_tp)==ObjectType::Trigger)) { - tables.insert(tables.end(), getObjectList(ObjectType::ObjView)->begin(), getObjectList(ObjectType::ObjView)->end()); + tables.insert(tables.end(), getObjectList(ObjectType::View)->begin(), getObjectList(ObjectType::View)->end()); inc_views=true; } @@ -9349,7 +9349,7 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorbegin(), getObjectList(obj_type)->end()); @@ -9365,10 +9365,10 @@ vector DatabaseModel::findObjects(const QString &pattern, vectorgetObjectType()==ObjectType::ObjTable) + if(tab->getObjectType()==ObjectType::Table) tab_objs=dynamic_cast
(tab)->getObjectList(obj_type); - else if(tab->getObjectType()==ObjectType::ObjView && - (obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule)) + else if(tab->getObjectType()==ObjectType::View && + (obj_type==ObjectType::Trigger || obj_type==ObjectType::Rule)) tab_objs=dynamic_cast(tab)->getObjectList(obj_type); if(tab_objs) @@ -9583,15 +9583,15 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_objs_prot || save_objs_sqldis) { - vector types=getChildObjectTypes(ObjectType::ObjDatabase), sch_types=getChildObjectTypes(ObjectType::ObjSchema); + vector types=getChildObjectTypes(ObjectType::Database), sch_types=getChildObjectTypes(ObjectType::Schema); types.insert(types.end(), sch_types.begin(), sch_types.end()); //Removing the types for schema, table and view to avoid retrieving the objects twice if(save_objs_pos) { - types.erase(std::find(types.begin(), types.end(), ObjectType::ObjSchema)); - types.erase(std::find(types.begin(), types.end(), ObjectType::ObjTable)); - types.erase(std::find(types.begin(), types.end(), ObjectType::ObjView)); + types.erase(std::find(types.begin(), types.end(), ObjectType::Schema)); + types.erase(std::find(types.begin(), types.end(), ObjectType::Table)); + types.erase(std::find(types.begin(), types.end(), ObjectType::View)); } //Append the other objects to the list of selected entities @@ -9604,7 +9604,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option obj_type=object->getObjectType(); //When handling a tag , textbox or generic sql we just extract their XML code - if(obj_type==ObjectType::ObjTextbox || obj_type==ObjectType::ObjTag || obj_type == ObjectType::ObjGenericSQL) + if(obj_type==ObjectType::Textbox || obj_type==ObjectType::Tag || obj_type == ObjectType::GenericSql) { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving object `%1' (%2)") @@ -9638,7 +9638,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::TABLE]=base_tab->getSignature(); } - if(save_custom_sql && obj_type==ObjectType::ObjDatabase) + if(save_custom_sql && obj_type==ObjectType::Database) { attribs[ParsersAttributes::APPEND_AT_EOD]=(this->isAppendAtEOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); attribs[ParsersAttributes::PREPEND_AT_BOD]=(this->isPrependedAtBOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); @@ -9650,20 +9650,20 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::MODEL_AUTHOR]=this->getAuthor(); attribs[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); - attribs[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjectType::ObjCollation] ? default_objs[ObjectType::ObjCollation]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::ObjSchema] ? default_objs[ObjectType::ObjSchema]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::ObjTablespace] ? default_objs[ObjectType::ObjTablespace]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjectType::ObjRole] ? default_objs[ObjectType::ObjRole]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getSignature() : QString()); + attribs[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getSignature() : QString()); } //If the object is a graphic one and we need to save positions and colors if((save_objs_pos || save_custom_colors) && graph_obj) { - if(obj_type!=ObjectType::ObjBaseRelationship && obj_type!=ObjectType::ObjRelationship) + if(obj_type!=ObjectType::BaseRelationship && obj_type!=ObjectType::Relationship) { pnt=graph_obj->getPosition(); - if(obj_type==ObjectType::ObjSchema) + if(obj_type==ObjectType::Schema) { schema=dynamic_cast(object); @@ -9682,7 +9682,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::Y_POS]=QString::number(pnt.y()); } - if(obj_type!=ObjectType::ObjSchema || !attribs[ParsersAttributes::X_POS].isEmpty()) + if(obj_type!=ObjectType::Schema || !attribs[ParsersAttributes::X_POS].isEmpty()) { schparser.ignoreUnkownAttributes(true); attribs[ParsersAttributes::POSITION]= @@ -9756,9 +9756,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option /* The object's metadata code will be generated only if one of the key attributes for each option were filled previously. */ - if((save_db_attribs && obj_type==ObjectType::ObjDatabase) || + if((save_db_attribs && obj_type==ObjectType::Database) || (save_custom_colors && - ((obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjBaseRelationship) || + ((obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) || (!attribs[ParsersAttributes::CUSTOM_COLOR].isEmpty()))) || (save_objs_pos && (!attribs[ParsersAttributes::POSITION].isEmpty() || @@ -9797,10 +9797,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option ParsersAttributes::METADATA + GlobalAttributes::SchemaExt, attribs)); output.write(buf.data(),buf.size()); - emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ~ObjectType::ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ~ObjectType::BaseObject); } else - emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), ~ObjectType::ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), ~ObjectType::BaseObject); output.close(); } @@ -9872,9 +9872,9 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { elem_name=xmlparser.getElementName(); - if((elem_name==BaseObject::getSchemaName(ObjectType::ObjTag) && load_tags) || - (elem_name==BaseObject::getSchemaName(ObjectType::ObjTextbox) && load_textboxes) || - (elem_name==BaseObject::getSchemaName(ObjectType::ObjGenericSQL) && load_genericsqls)) + if((elem_name==BaseObject::getSchemaName(ObjectType::Tag) && load_tags) || + (elem_name==BaseObject::getSchemaName(ObjectType::Textbox) && load_textboxes) || + (elem_name==BaseObject::getSchemaName(ObjectType::GenericSql) && load_genericsqls)) { xmlparser.savePosition(); obj_type=BaseObject::getObjectType(elem_name); @@ -9889,7 +9889,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) already exists. Ignoring.") - .arg(new_object->getName()).arg(new_object->getTypeName()), ~ObjectType::ObjBaseObject); + .arg(new_object->getName()).arg(new_object->getTypeName()), ~ObjectType::BaseObject); delete(new_object); } @@ -9905,16 +9905,16 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option obj_type=BaseObject::getObjectType(attribs[ParsersAttributes::TYPE]); progress=xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()) * 100; - if(obj_type==ObjectType::ObjDatabase) + if(obj_type==ObjectType::Database) { if(load_db_attribs) { QStringList pos=attribs[ParsersAttributes::LAST_POSITION].split(','); - default_objs[ObjectType::ObjSchema]=getSchema(attribs[ParsersAttributes::DEFAULT_SCHEMA]); - default_objs[ObjectType::ObjRole]=getRole(attribs[ParsersAttributes::DEFAULT_OWNER]); - default_objs[ObjectType::ObjCollation]=getCollation(attribs[ParsersAttributes::DEFAULT_COLLATION]); - default_objs[ObjectType::ObjTablespace]=getTablespace(attribs[ParsersAttributes::DEFAULT_TABLESPACE]); + default_objs[ObjectType::Schema]=getSchema(attribs[ParsersAttributes::DEFAULT_SCHEMA]); + default_objs[ObjectType::Role]=getRole(attribs[ParsersAttributes::DEFAULT_OWNER]); + default_objs[ObjectType::Collation]=getCollation(attribs[ParsersAttributes::DEFAULT_COLLATION]); + default_objs[ObjectType::Tablespace]=getTablespace(attribs[ParsersAttributes::DEFAULT_TABLESPACE]); author=attribs[ParsersAttributes::MODEL_AUTHOR]; last_zoom=attribs[ParsersAttributes::LAST_ZOOM].toFloat(); @@ -9928,7 +9928,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { base_tab = getTable(attribs[ParsersAttributes::TABLE]); - if(!base_tab && (obj_type == ObjectType::ObjRule || obj_type == ObjectType::ObjIndex || obj_type == ObjectType::ObjTrigger)) + if(!base_tab && (obj_type == ObjectType::Rule || obj_type == ObjectType::Index || obj_type == ObjectType::Trigger)) base_tab = getView(attribs[ParsersAttributes::TABLE]); if(base_tab) @@ -9943,7 +9943,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option /* If the object does not exists but it is a relationship, we try to get the relationship involving the tables in paramenters src-table and dst-table */ - if(!object && obj_type==ObjectType::ObjRelationship) + if(!object && obj_type==ObjectType::Relationship) { src_tab=dynamic_cast(getObject(attribs[ParsersAttributes::SRC_TABLE], BaseObject::getObjectType(attribs[ParsersAttributes::SRC_TYPE]))); @@ -9967,14 +9967,14 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(!attribs[ParsersAttributes::SQL_DISABLED].isEmpty()) object->setSQLDisabled(attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_); } - else if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && load_tags && !attribs[ParsersAttributes::TAG].isEmpty()) + else if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && load_tags && !attribs[ParsersAttributes::TAG].isEmpty()) { tag=getTag(attribs[ParsersAttributes::TAG]); if(tag) dynamic_cast(object)->setTag(tag); } - else if(obj_type==ObjectType::ObjDatabase && load_custom_sql) + else if(obj_type==ObjectType::Database && load_custom_sql) { if(!attribs[ParsersAttributes::APPEND_AT_EOD].isEmpty()) this->setAppendAtEOD(attribs[ParsersAttributes::APPEND_AT_EOD]==ParsersAttributes::_TRUE_); @@ -10084,7 +10084,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else if(!object) { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) not found. Ignoring metadata.") - .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), ~ObjectType::ObjBaseObject); + .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), ~ObjectType::BaseObject); } xmlparser.restorePosition(); @@ -10095,7 +10095,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option while(xmlparser.accessElement(XmlParser::NextElement)); } - emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ~ObjectType::ObjBaseObject); + emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ~ObjectType::BaseObject); setObjectsModified(); } catch(Exception &e) diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index e255a873aa..efe55422b3 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -270,7 +270,7 @@ class DatabaseModel: public QObject, public BaseObject { //! \brief Sets the sql prepeding at beginning of entire model definition void setPrependAtBOD(bool value); - void setDefaultObject(BaseObject *object, ObjectType obj_type=ObjectType::ObjBaseObject); + void setDefaultObject(BaseObject *object, ObjectType obj_type=ObjectType::BaseObject); void setIsTemplate(bool value); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index c22ac448a3..520f22ebfe 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -20,7 +20,7 @@ Domain::Domain(void) { - obj_type=ObjectType::ObjDomain; + obj_type=ObjectType::Domain; not_null=false; attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); attributes[ParsersAttributes::NOT_NULL]=QString(); @@ -41,7 +41,7 @@ void Domain::addCheckConstraint(const QString &name, const QString &expr) { throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedObject) .arg(name) - .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)) + .arg(BaseObject::getTypeName(ObjectType::Constraint)) .arg(this->getName(true)) .arg(this->getTypeName()), ErrorCode::AsgDuplicatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index f4d2017f7d..1965516c1b 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -20,7 +20,7 @@ EventTrigger::EventTrigger(void) { - obj_type=ObjectType::ObjEventTrigger; + obj_type=ObjectType::EventTrigger; function=nullptr; attributes[ParsersAttributes::EVENT]=QString(); attributes[ParsersAttributes::FILTER]=QString(); @@ -38,7 +38,7 @@ void EventTrigger::setFunction(Function *func) if(!func) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjEventTrigger)), + .arg(BaseObject::getTypeName(ObjectType::EventTrigger)), ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions with return type other that event_trigger are not accepted else if(func->getReturnType()!=QString("event_trigger")) @@ -47,7 +47,7 @@ void EventTrigger::setFunction(Function *func) else if(func->getParameterCount()!=0) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjEventTrigger)), + .arg(BaseObject::getTypeName(ObjectType::EventTrigger)), ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Functions coded in SQL lang. is not accepted by event triggers else if(func->getLanguage()->getName()==~LanguageType(LanguageType::Sql)) diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 9716621e52..4c80b54fab 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -2,7 +2,7 @@ Extension::Extension(void) { - obj_type=ObjectType::ObjExtension; + obj_type=ObjectType::Extension; handles_type=false; attributes[ParsersAttributes::HANDLES_TYPE]=QString(); attributes[ParsersAttributes::CUR_VERSION]=QString(); diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 357f2b0391..28eabd0c38 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -25,7 +25,7 @@ Function::Function(void) returns_setof=false; is_wnd_function=false; is_leakproof=false; - obj_type=ObjectType::ObjFunction; + obj_type=ObjectType::Function; execution_cost=100; row_amount=1000; @@ -211,7 +211,7 @@ void Function::setLanguage(BaseObject *language) if(!language) throw Exception(ErrorCode::AsgNotAllocatedLanguage,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the language object is invalid - else if(language->getObjectType()!=ObjectType::ObjLanguage) + else if(language->getObjectType()!=ObjectType::Language) throw Exception(ErrorCode::AsgInvalidLanguageObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(this->language != language); diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 4df0073120..2ed576399f 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -20,7 +20,7 @@ GenericSQL::GenericSQL(void) { - obj_type=ObjectType::ObjGenericSQL; + obj_type=ObjectType::GenericSql; attributes[ParsersAttributes::DEFINITION] = QString(); } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 09f9b98ee5..7bf6c24c10 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -20,7 +20,7 @@ Index::Index(void) { - obj_type=ObjectType::ObjIndex; + obj_type=ObjectType::Index; index_attribs[Unique]=index_attribs[Concurrent]= index_attribs[FastUpdate]=index_attribs[Buffering]=false; fill_factor=90; diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 2db8d17886..02103a7e24 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -20,7 +20,7 @@ Language::Language(void) { - obj_type=ObjectType::ObjLanguage; + obj_type=ObjectType::Language; is_trusted=false; for(unsigned i=ValidatorFunc; i <= InlineFunc; i++) @@ -38,7 +38,7 @@ void Language::setName(const QString &name) if(name.toLower()==~LanguageType("c") || name.toLower()==~LanguageType("sql")) throw Exception(Exception::getErrorMessage(ErrorCode::AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), + .arg(BaseObject::getTypeName(ObjectType::Language)), ErrorCode::AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); @@ -85,7 +85,7 @@ void Language::setFunction(Function *func, unsigned func_type) ((func_type==ValidatorFunc || func_type==InlineFunc) && func->getReturnType()!=QString("void"))) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjectType::ObjLanguage)), + .arg(BaseObject::getTypeName(ObjectType::Language)), ErrorCode::AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else //Raises an error in case the function has invalid parameters (count and types) diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 4115c61013..159c65dff8 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -164,7 +164,7 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) { BaseObject *copy_obj=nullptr; - if(obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::BaseObject && obj_type!=ObjectType::Database) PgModelerNs::copyObject(©_obj, object, obj_type); else throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -228,7 +228,7 @@ void OperationList::removeOperations(void) if(unallocated_objs.count(object)==0 && (!tab_obj && model->getObjectIndex(object) < 0)) { - if(object->getObjectType()==ObjectType::ObjTable) + if(object->getObjectType()==ObjectType::Table) { vector list=dynamic_cast
(object)->getObjects(); @@ -355,10 +355,10 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(parent_obj && - (((obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) && - (parent_obj->getObjectType()!=ObjectType::ObjRelationship && parent_obj->getObjectType()!=ObjectType::ObjTable)) || + (((obj_type==ObjectType::Column || obj_type==ObjectType::Constraint) && + (parent_obj->getObjectType()!=ObjectType::Relationship && parent_obj->getObjectType()!=ObjectType::Table)) || - ((obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule || obj_type==ObjectType::ObjIndex) && !dynamic_cast(parent_obj)))) + ((obj_type==ObjectType::Trigger || obj_type==ObjectType::Rule || obj_type==ObjectType::Index) && !dynamic_cast(parent_obj)))) throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); //If the operations list is full makes the automatic cleaning before inserting a new operation @@ -414,19 +414,19 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje in the list on the parent object */ if(tab_obj) { - if(parent_obj->getObjectType()==ObjectType::ObjRelationship) + if(parent_obj->getObjectType()==ObjectType::Relationship) parent_rel=dynamic_cast(parent_obj); else parent_tab=dynamic_cast(parent_obj); - if(((obj_type==ObjectType::ObjTrigger && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || - (obj_type==ObjectType::ObjIndex && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || - (obj_type==ObjectType::ObjConstraint && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()))) + if(((obj_type==ObjectType::Trigger && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || + (obj_type==ObjectType::Index && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()) || + (obj_type==ObjectType::Constraint && dynamic_cast(tab_obj)->isReferRelationshipAddedColumn()))) { if(op_type==Operation::ObjectRemoved) tab_obj->setParentTable(parent_tab); - if(tab_obj->getObjectType()==ObjectType::ObjConstraint) + if(tab_obj->getObjectType()==ObjectType::Constraint) operation->setXMLDefinition(dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::XmlDefinition, true)); else operation->setXMLDefinition(tab_obj->getCodeDefinition(SchemaParser::XmlDefinition)); @@ -436,7 +436,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje /* If there is a parent relationship will get the index of the object. Only columns and constraints are handled case the parent is a relationship */ - if(parent_rel && (obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint)) + if(parent_rel && (obj_type==ObjectType::Column || obj_type==ObjectType::Constraint)) { //Case a specific index wasn't specified if(object_idx < 0) @@ -461,8 +461,8 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje } else { - if((obj_type==ObjectType::ObjSequence && dynamic_cast(object)->isReferRelationshipAddedColumn()) || - (obj_type==ObjectType::ObjView && dynamic_cast(object)->isReferRelationshipAddedColumn())) + if((obj_type==ObjectType::Sequence && dynamic_cast(object)->isReferRelationshipAddedColumn()) || + (obj_type==ObjectType::View && dynamic_cast(object)->isReferRelationshipAddedColumn())) operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XmlDefinition)); //Case a specific index wasn't specified @@ -474,7 +474,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje obj_idx=object_idx; } - if(obj_type==ObjectType::ObjColumn && dynamic_cast(object)->getType().isUserType()) + if(obj_type==ObjectType::Column && dynamic_cast(object)->getType().isUserType()) operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XmlDefinition)); operation->setObjectIndex(obj_idx); @@ -517,7 +517,7 @@ void OperationList::getOperationData(unsigned oper_idx, unsigned &oper_type, QSt } else { - obj_type=ObjectType::ObjBaseObject; + obj_type=ObjectType::BaseObject; obj_name=trUtf8("(invalid object)"); } } @@ -704,7 +704,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) 'parent_rel' get the reference to the relationship */ if(parent_obj) { - if(parent_obj->getObjectType()==ObjectType::ObjRelationship) + if(parent_obj->getObjectType()==ObjectType::Relationship) parent_rel=dynamic_cast(parent_obj); else parent_tab=dynamic_cast(parent_obj); @@ -722,17 +722,17 @@ void OperationList::executeOperation(Operation *oper, bool redo) xmlparser->restartParser(); xmlparser->loadXMLBuffer(xml_def); - if(obj_type==ObjectType::ObjTrigger) + if(obj_type==ObjectType::Trigger) aux_obj=model->createTrigger(); - else if(obj_type==ObjectType::ObjIndex) + else if(obj_type==ObjectType::Index) aux_obj=model->createIndex(); - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) aux_obj=model->createConstraint(parent_obj); - else if(obj_type==ObjectType::ObjSequence) + else if(obj_type==ObjectType::Sequence) aux_obj=model->createSequence(); - else if(obj_type==ObjectType::ObjView) + else if(obj_type==ObjectType::View) aux_obj=model->createView(); - else if(obj_type==ObjectType::ObjColumn) + else if(obj_type==ObjectType::Column) aux_obj=model->createColumn(); } @@ -741,7 +741,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) if(op_type==Operation::ObjectModified || op_type==Operation::ObjectMoved) { - if(obj_type==ObjectType::ObjRelationship) + if(obj_type==ObjectType::Relationship) { /* Due to the complexity of the class Relationship and the strong link between all relationships of the model it is necessary to store XML for special objects and @@ -764,7 +764,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) //For pk constraint, before restore the previous configuration, uncheck the not-null flag of the source columns - if(obj_type==ObjectType::ObjConstraint) + if(obj_type==ObjectType::Constraint) dynamic_cast(orig_obj)->setColumnsNotNull(false); /* The original object (obtained from the table, relationship or model) will have its @@ -780,7 +780,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) PgModelerNs::copyObject(reinterpret_cast(&object), aux_obj, obj_type); //For pk constraint, after restore the previous configuration, check the not-null flag of the new source columns - if(obj_type==ObjectType::ObjConstraint) + if(obj_type==ObjectType::Constraint) dynamic_cast(orig_obj)->setColumnsNotNull(true); } @@ -798,13 +798,13 @@ void OperationList::executeOperation(Operation *oper, bool redo) { parent_tab->addObject(dynamic_cast(object), obj_idx); - if(object->getObjectType()==ObjectType::ObjConstraint && + if(object->getObjectType()==ObjectType::Constraint && dynamic_cast(object)->getConstraintType()==ConstraintType::ForeignKey) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); } else if(parent_rel) parent_rel->addObject(dynamic_cast(object), obj_idx); - else if(object->getObjectType()==ObjectType::ObjTable) + else if(object->getObjectType()==ObjectType::Table) dynamic_cast
(object)->getCodeDefinition(SchemaParser::SqlDefinition); model->addObject(object, obj_idx); @@ -838,12 +838,12 @@ void OperationList::executeOperation(Operation *oper, bool redo) if(parent_tab->getSchema()) dynamic_cast(parent_tab->getSchema())->setModified(true); - if(object->getObjectType()==ObjectType::ObjColumn || - object->getObjectType()==ObjectType::ObjConstraint) + if(object->getObjectType()==ObjectType::Column || + object->getObjectType()==ObjectType::Constraint) { model->validateRelationships(dynamic_cast(object), dynamic_cast
(parent_tab)); - if(object->getObjectType()==ObjectType::ObjConstraint && + if(object->getObjectType()==ObjectType::Constraint && dynamic_cast(object)->getConstraintType()==ConstraintType::ForeignKey) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); } @@ -858,9 +858,9 @@ void OperationList::executeOperation(Operation *oper, bool redo) /* If the object in question is graphical it has the modified flag marked to force the redraw at the time of its restoration */ - else if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView || - obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjRelationship || - obj_type==ObjectType::ObjTextbox || obj_type==ObjectType::ObjSchema) + else if(obj_type==ObjectType::Table || obj_type==ObjectType::View || + obj_type==ObjectType::BaseRelationship || obj_type==ObjectType::Relationship || + obj_type==ObjectType::Textbox || obj_type==ObjectType::Schema) { BaseGraphicObject *graph_obj=dynamic_cast(object); @@ -869,15 +869,15 @@ void OperationList::executeOperation(Operation *oper, bool redo) graph_obj->setModified(true); //Case the object is a view is necessary to update the table-view relationships on the model - if(obj_type==ObjectType::ObjView && op_type==Operation::ObjectModified) + if(obj_type==ObjectType::View && op_type==Operation::ObjectModified) model->updateViewRelationships(dynamic_cast(graph_obj)); - else if((obj_type==ObjectType::ObjRelationship || - (obj_type==ObjectType::ObjTable && model->getRelationship(dynamic_cast(object), nullptr))) && + else if((obj_type==ObjectType::Relationship || + (obj_type==ObjectType::Table && model->getRelationship(dynamic_cast(object), nullptr))) && op_type==Operation::ObjectModified) model->validateRelationships(); //If a object had its schema restored is necessary to update the envolved schemas - if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && + if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && ((bkp_obj && graph_obj->getSchema()!=bkp_obj->getSchema() && op_type==Operation::ObjectModified) || op_type==Operation::ObjectMoved)) { @@ -889,12 +889,12 @@ void OperationList::executeOperation(Operation *oper, bool redo) } else if(op_type==Operation::ObjectModified) { - if(obj_type==ObjectType::ObjSchema) + if(obj_type==ObjectType::Schema) { model->validateSchemaRenaming(dynamic_cast(object), bkp_obj->getName()); dynamic_cast(object)->setModified(true); } - else if(obj_type==ObjectType::ObjTag) + else if(obj_type==ObjectType::Tag) { vector refs; model->getObjectReferences(object, refs); @@ -909,16 +909,16 @@ void OperationList::executeOperation(Operation *oper, bool redo) //Case the object is a type update the tables that are referencing it if(op_type==Operation::ObjectModified && - (object->getObjectType()==ObjectType::ObjType || object->getObjectType()==ObjectType::ObjDomain || - object->getObjectType()==ObjectType::ObjTable || object->getObjectType()==ObjectType::ObjView || - object->getObjectType()==ObjectType::ObjExtension)) + (object->getObjectType()==ObjectType::Type || object->getObjectType()==ObjectType::Domain || + object->getObjectType()==ObjectType::Table || object->getObjectType()==ObjectType::View || + object->getObjectType()==ObjectType::Extension)) { vector ref_objs; model->getObjectReferences(object, ref_objs); for(auto &obj : ref_objs) { - if(obj->getObjectType()==ObjectType::ObjColumn) + if(obj->getObjectType()==ObjectType::Column) dynamic_cast(obj)->getParentTable()->setModified(true); } } diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index cf4adaaf7c..44916036e3 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -22,7 +22,7 @@ Operator::Operator(void) { unsigned i; - obj_type=ObjectType::ObjOperator; + obj_type=ObjectType::Operator; for(i=FUNC_OPERATOR; i <= FUNC_RESTRICT; i++) functions[i]=nullptr; @@ -100,14 +100,14 @@ void Operator::setFunction(Function *func, unsigned func_type) if(!func) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Raises an error if the parameter count is invalid. To be used by the operator the function must own 1 or 2 parameters */ else if(func->getParameterCount()==0 || func->getParameterCount() > 2) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -142,7 +142,7 @@ void Operator::setFunction(Function *func, unsigned func_type) (argument_types[1]!=QString("\"any\"") && argument_types[1]!=param_type1)))) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjOperator)), + .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::AsgFunctionInvalidParameters,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index 858f772c41..27183ad0f4 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -20,7 +20,7 @@ OperatorClass::OperatorClass(void) { - obj_type=ObjectType::ObjOpClass; + obj_type=ObjectType::OpClass; family=nullptr; is_default=false; attributes[ParsersAttributes::FAMILY]=QString(); diff --git a/libpgmodeler/src/operatorfamily.cpp b/libpgmodeler/src/operatorfamily.cpp index 9e128ae719..46b1f1f3b2 100644 --- a/libpgmodeler/src/operatorfamily.cpp +++ b/libpgmodeler/src/operatorfamily.cpp @@ -20,7 +20,7 @@ OperatorFamily::OperatorFamily(void) { - obj_type=ObjectType::ObjOpFamily; + obj_type=ObjectType::OpFamily; attributes[ParsersAttributes::INDEX_TYPE]=QString(); } diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 4e9c5378f3..1f2a44c947 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -20,7 +20,7 @@ Parameter::Parameter(void) { - obj_type=ObjectType::ObjParameter; + obj_type=ObjectType::Parameter; is_in=is_out=is_variadic=false; } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index eea0247a7d..1307cb839f 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -38,7 +38,7 @@ Permission::Permission(BaseObject *obj) throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->object=obj; - this->obj_type=ObjectType::ObjPermission; + this->obj_type=ObjectType::Permission; revoke=cascade=false; attributes[ParsersAttributes::OBJECT]=QString(); @@ -56,10 +56,10 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) bool result=false; unsigned priv_id=static_cast(privilege); - result=(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjView || - obj_type==ObjectType::ObjSequence || obj_type==ObjectType::ObjDatabase || obj_type==ObjectType::ObjFunction || - obj_type==ObjectType::ObjAggregate || obj_type==ObjectType::ObjLanguage || obj_type==ObjectType::ObjSchema || - obj_type==ObjectType::ObjTablespace || obj_type==ObjectType::ObjDomain || obj_type==ObjectType::ObjType); + result=(obj_type==ObjectType::Table || obj_type==ObjectType::Column || obj_type==ObjectType::View || + obj_type==ObjectType::Sequence || obj_type==ObjectType::Database || obj_type==ObjectType::Function || + obj_type==ObjectType::Aggregate || obj_type==ObjectType::Language || obj_type==ObjectType::Schema || + obj_type==ObjectType::Tablespace || obj_type==ObjectType::Domain || obj_type==ObjectType::Type); //Validating privilege @@ -84,30 +84,30 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) View: SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER */ result=result && - (((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && + (((obj_type==ObjectType::Table || obj_type==ObjectType::View) && (priv_id==PrivSelect || priv_id==PrivInsert || priv_id==PrivUpdate || priv_id==PrivDelete || priv_id==PrivReferences || priv_id==PrivTrigger)) || - ((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && priv_id==PrivTruncate) || + ((obj_type==ObjectType::Table || obj_type==ObjectType::View) && priv_id==PrivTruncate) || - (obj_type==ObjectType::ObjColumn && + (obj_type==ObjectType::Column && (priv_id==PrivSelect ||priv_id==PrivInsert || priv_id==PrivUpdate || priv_id==PrivReferences)) || - (obj_type==ObjectType::ObjSequence && + (obj_type==ObjectType::Sequence && (priv_id==PrivUsage || priv_id==PrivSelect || priv_id==PrivUpdate)) || - (obj_type==ObjectType::ObjDatabase && + (obj_type==ObjectType::Database && (priv_id==PrivCreate || priv_id==PrivConnect || priv_id==PrivTemporary)) || - ((obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjAggregate) && priv_id==PrivExecute) || + ((obj_type==ObjectType::Function || obj_type==ObjectType::Aggregate) && priv_id==PrivExecute) || - ((obj_type==ObjectType::ObjLanguage || obj_type==ObjectType::ObjType || obj_type==ObjectType::ObjDomain) && priv_id==PrivUsage) || + ((obj_type==ObjectType::Language || obj_type==ObjectType::Type || obj_type==ObjectType::Domain) && priv_id==PrivUsage) || - (obj_type==ObjectType::ObjSchema && (priv_id==PrivUsage || priv_id==PrivCreate)) || + (obj_type==ObjectType::Schema && (priv_id==PrivUsage || priv_id==PrivCreate)) || - (obj_type==ObjectType::ObjTablespace && priv_id==PrivCreate)); + (obj_type==ObjectType::Tablespace && priv_id==PrivCreate)); } return(result); @@ -427,12 +427,12 @@ QString Permission::getCodeDefinition(unsigned def_type) { //Views and Tables uses the same key word when setting permission (TABLE) attributes[ParsersAttributes::TYPE]= - (object->getObjectType()==ObjectType::ObjView ? BaseObject::getSQLName(ObjectType::ObjTable): BaseObject::getSQLName(object->getObjectType())); + (object->getObjectType()==ObjectType::View ? BaseObject::getSQLName(ObjectType::Table): BaseObject::getSQLName(object->getObjectType())); } else attributes[ParsersAttributes::TYPE]=BaseObject::getSchemaName(object->getObjectType()); - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { attributes[ParsersAttributes::OBJECT]=object->getName(true); attributes[ParsersAttributes::PARENT]=dynamic_cast(object)->getParentTable()->getName(true); @@ -459,9 +459,9 @@ QString Permission::getCodeDefinition(unsigned def_type) for(i=0; i < 12; i++) { if(privileges[i] && !grant_option[i]) - priv_list.push_back(object->getObjectType() == ObjectType::ObjColumn ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); + priv_list.push_back(object->getObjectType() == ObjectType::Column ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); else if(grant_option[i]) - gop_priv_list.push_back(object->getObjectType() == ObjectType::ObjColumn ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); + gop_priv_list.push_back(object->getObjectType() == ObjectType::Column ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); } attributes[ParsersAttributes::PRIVILEGES] = priv_list.join(QChar(',')); diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index 3b62e88d48..57a38f0a5c 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -50,7 +50,7 @@ namespace PgModelerNs { { switch(obj_type) { - case ObjectType::ObjRelationship: + case ObjectType::Relationship: Relationship *rel1; rel1=new Relationship(dynamic_cast(copy_obj)); if(!(*psrc_obj)) @@ -58,7 +58,7 @@ namespace PgModelerNs { else (*(dynamic_cast(*psrc_obj)))=(*rel1); break; - case ObjectType::ObjBaseRelationship: + case ObjectType::BaseRelationship: BaseRelationship *rel; rel=new BaseRelationship(dynamic_cast(copy_obj)); if(!(*psrc_obj)) @@ -66,88 +66,88 @@ namespace PgModelerNs { else (*(dynamic_cast(*psrc_obj)))=(*rel); break; - case ObjectType::ObjColumn: + case ObjectType::Column: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjConstraint: + case ObjectType::Constraint: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjTrigger: + case ObjectType::Trigger: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjRule: + case ObjectType::Rule: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjIndex: + case ObjectType::Index: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjPolicy: + case ObjectType::Policy: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjTable: + case ObjectType::Table: copyObject(psrc_obj, dynamic_cast
(copy_obj)); break; - case ObjectType::ObjTextbox: + case ObjectType::Textbox: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjOpClass: + case ObjectType::OpClass: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjConversion: + case ObjectType::Conversion: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjCast: + case ObjectType::Cast: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjDomain: + case ObjectType::Domain: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjTablespace: + case ObjectType::Tablespace: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjSchema: + case ObjectType::Schema: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjOpFamily: + case ObjectType::OpFamily: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjFunction: + case ObjectType::Function: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjAggregate: + case ObjectType::Aggregate: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjLanguage: + case ObjectType::Language: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjOperator: + case ObjectType::Operator: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjRole: + case ObjectType::Role: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjSequence: + case ObjectType::Sequence: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjType: + case ObjectType::Type: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjView: + case ObjectType::View: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjCollation: + case ObjectType::Collation: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjExtension: + case ObjectType::Extension: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjTag: + case ObjectType::Tag: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjEventTrigger: + case ObjectType::EventTrigger: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; - case ObjectType::ObjGenericSQL: + case ObjectType::GenericSql: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; default: diff --git a/libpgmodeler/src/pgmodelerns.h b/libpgmodeler/src/pgmodelerns.h index bfd034db8e..a13bf1d346 100644 --- a/libpgmodeler/src/pgmodelerns.h +++ b/libpgmodeler/src/pgmodelerns.h @@ -65,16 +65,16 @@ namespace PgModelerNs { if(!obj) return(""); //Cast objects will not have the name changed since their name are automatically generated - else if(obj->getObjectType()==ObjectType::ObjCast || obj->getObjectType()==ObjectType::ObjDatabase) + else if(obj->getObjectType()==ObjectType::Cast || obj->getObjectType()==ObjectType::Database) return(obj->getName()); obj_name=obj->getName(fmt_name); obj_type=obj->getObjectType(); - if(!use_suf_on_conflict && obj_type!=ObjectType::ObjOperator) + if(!use_suf_on_conflict && obj_type!=ObjectType::Operator) obj_name += suffix; - counter = (use_suf_on_conflict && obj_type!= ObjectType::ObjOperator? 0 : 1); + counter = (use_suf_on_conflict && obj_type!= ObjectType::Operator? 0 : 1); id=QString::number(obj->getObjectId()); len=obj_name.size() + id.size(); @@ -85,7 +85,7 @@ namespace PgModelerNs { obj_name.chop(id.size() + 3); //Append the id of the object on its name (this is not applied to operators) - if(obj_type!=ObjectType::ObjOperator) + if(obj_type!=ObjectType::Operator) obj_name+=QString("_") + id; } @@ -101,7 +101,7 @@ namespace PgModelerNs { if(/*aux_obj!=obj &&*/ aux_obj->getName(fmt_name)==aux_name) { //For operators is appended a '?' on the name - if(obj_type==ObjectType::ObjOperator) + if(obj_type==ObjectType::Operator) aux_name=QString("%1%2").arg(obj_name).arg(QString("").leftJustified(counter++, oper_uniq_chr)); else { diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index cd47cc1066..2a411badcb 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -19,7 +19,7 @@ Policy::Policy(void) : TableObject() { - obj_type=ObjectType::ObjPolicy; + obj_type=ObjectType::Policy; permissive = false; policy_cmd = PolicyCmdType::All; @@ -32,12 +32,12 @@ Policy::Policy(void) : TableObject() void Policy::setParentTable(BaseTable *table) { - if(table && table->getObjectType() != ObjectType::ObjTable) + if(table && table->getObjectType() != ObjectType::Table) { throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidObjectType) .arg(this->obj_name) .arg(this->getTypeName()) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)), + .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::AsgInvalidObjectType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index bae33034aa..5ec8ad0187 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -50,7 +50,7 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, { try { - obj_type=ObjectType::ObjRelationship; + obj_type=ObjectType::Relationship; QString str_aux; /* Raises an error if the user tries to create a relationship which some @@ -437,9 +437,9 @@ int Relationship::getObjectIndex(TableObject *object) //Selecting the correct list using the object type obj_type=object->getObjectType(); - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) list=&rel_attributes; - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) @@ -496,7 +496,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) rel_type==RelationshipPart) && !(tab_obj->isAddedByRelationship() && tab_obj->isProtected() && - tab_obj->getObjectType()==ObjectType::ObjConstraint)) + tab_obj->getObjectType()==ObjectType::Constraint)) throw Exception(ErrorCode::AsgObjectInvalidRelationshipType,__PRETTY_FUNCTION__,__FILE__,__LINE__); try @@ -507,9 +507,9 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) { //Gets the object list according the object type obj_type=tab_obj->getObjectType(); - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) obj_list=&rel_attributes; - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) obj_list=&rel_constraints; else //Raises an error if the object type isn't valid (not a column or constraint) @@ -519,7 +519,7 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) tab_obj->setParentTable(src_table); //Generates the code for the object only for validation - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) dynamic_cast(tab_obj)->getCodeDefinition(SchemaParser::SqlDefinition); else { @@ -590,9 +590,9 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) TableObject *tab_obj=nullptr; Table *recv_table=nullptr; - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) obj_list=&rel_attributes; - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) obj_list=&rel_constraints; else throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -604,7 +604,7 @@ void Relationship::removeObject(unsigned obj_id, ObjectType obj_type) tab_obj=obj_list->at(obj_id); recv_table=this->getReceiverTable(); - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { Column *col=nullptr; Constraint *constr=nullptr; @@ -670,12 +670,12 @@ void Relationship::removeObject(TableObject *object) void Relationship::removeAttribute(unsigned attrib_idx) { - removeObject(attrib_idx, ObjectType::ObjColumn); + removeObject(attrib_idx, ObjectType::Column); } void Relationship::removeConstraint(unsigned constr_idx) { - removeObject(constr_idx, ObjectType::ObjConstraint); + removeObject(constr_idx, ObjectType::Constraint); } vector Relationship::getGeneratedColumns(void) @@ -708,9 +708,9 @@ TableObject *Relationship::getObject(unsigned obj_idx, ObjectType obj_type) { vector *list=nullptr; - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) list=&rel_attributes; - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) list=&rel_constraints; else throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -728,9 +728,9 @@ TableObject *Relationship::getObject(const QString &name, ObjectType obj_type) TableObject *obj_aux=nullptr; bool found=false; - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) list=&rel_attributes; - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) list=&rel_constraints; else throw Exception(ErrorCode::RefObjectInvalidType, __PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -762,7 +762,7 @@ Column *Relationship::getAttribute(unsigned attrib_idx) Column *Relationship::getAttribute(const QString &name) { - return(dynamic_cast(getObject(name,ObjectType::ObjColumn))); + return(dynamic_cast(getObject(name,ObjectType::Column))); } vector Relationship::getAttributes(void) @@ -781,7 +781,7 @@ Constraint *Relationship::getConstraint(unsigned constr_idx) Constraint *Relationship::getConstraint(const QString &name) { - return(dynamic_cast(getObject(name,ObjectType::ObjConstraint))); + return(dynamic_cast(getObject(name,ObjectType::Constraint))); } vector Relationship::getConstraints(void) @@ -801,9 +801,9 @@ unsigned Relationship::getConstraintCount(void) unsigned Relationship::getObjectCount(ObjectType obj_type) { - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) return(rel_attributes.size()); - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) return(rel_constraints.size()); else throw Exception(ErrorCode::RefObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -829,7 +829,7 @@ void Relationship::addConstraints(Table *recv_tab) if(constr->getConstraintType()!=ConstraintType::PrimaryKey) { - constr->setName(PgModelerNs::generateUniqueName(constr, (*recv_tab->getObjectList(ObjectType::ObjConstraint)))); + constr->setName(PgModelerNs::generateUniqueName(constr, (*recv_tab->getObjectList(ObjectType::Constraint)))); recv_tab->addConstraint(constr); } else @@ -885,7 +885,7 @@ void Relationship::addColumnsRelGenPart(void) i, i1, i2, id_tab, idx, tab_count; vector columns; - ObjectType types[2]={ObjectType::ObjTable, ObjectType::ObjBaseTable}; + ObjectType types[2]={ObjectType::Table, ObjectType::BaseTable}; ErrorCode err_code=ErrorCode::Custom; bool duplic=false, cond=false, /* 0 -> Column created by inheritance relationship @@ -979,12 +979,12 @@ void Relationship::addColumnsRelGenPart(void) for(i2=0; i2 < 2; i2++) { //Checking if the column came from a generalization relationship - if(types[i2]==ObjectType::ObjTable) + if(types[i2]==ObjectType::Table) { - tab_count=aux_tab->getObjectCount(ObjectType::ObjTable); + tab_count=aux_tab->getObjectCount(ObjectType::Table); for(idx=0; idx < tab_count; idx++) { - parent_tab=dynamic_cast
(aux_tab->getObject(idx, ObjectType::ObjTable)); + parent_tab=dynamic_cast
(aux_tab->getObject(idx, ObjectType::Table)); cond=(aux_col->getParentTable()==parent_tab && aux_col->isAddedByGeneralization()); } @@ -1141,7 +1141,7 @@ void Relationship::addConstraintsRelGenPart(void) { Table *parent_tab=dynamic_cast
(getReferenceTable()), *child_tab=dynamic_cast
(getReceiverTable()); - vector *constrs=parent_tab->getObjectList(ObjectType::ObjConstraint); + vector *constrs=parent_tab->getObjectList(ObjectType::Constraint); Constraint *ck_constr=nullptr, *constr=nullptr, *aux_constr=nullptr; try @@ -1152,7 +1152,7 @@ void Relationship::addConstraintsRelGenPart(void) if(constr->getConstraintType()==ConstraintType::Check && !constr->isNoInherit()) { - aux_constr=dynamic_cast(child_tab->getObject(constr->getName(), ObjectType::ObjConstraint)); + aux_constr=dynamic_cast(child_tab->getObject(constr->getName(), ObjectType::Constraint)); if(!aux_constr) { @@ -1354,7 +1354,7 @@ void Relationship::addUniqueKey(Table *recv_tab) uq->setName(generateObjectName(UqPattern)); uq->setAlias(generateObjectName(UqPattern, nullptr, true)); - uq->setName(PgModelerNs::generateUniqueName(uq, (*recv_tab->getObjectList(ObjectType::ObjConstraint)))); + uq->setName(PgModelerNs::generateUniqueName(uq, (*recv_tab->getObjectList(ObjectType::Constraint)))); recv_tab->addConstraint(uq); } catch(Exception &e) @@ -1482,7 +1482,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del fk->setName(name); fk->setAlias(fk_alias); - fk->setName(PgModelerNs::generateUniqueName(fk, (*recv_tab->getObjectList(ObjectType::ObjConstraint)))); + fk->setName(PgModelerNs::generateUniqueName(fk, (*recv_tab->getObjectList(ObjectType::Constraint)))); recv_tab->addConstraint(fk); } catch(Exception &e) @@ -1516,7 +1516,7 @@ void Relationship::addAttributes(Table *recv_tab) if(column->getParentTable()) break; - column->setName(PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjectType::ObjColumn)))); + column->setName(PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjectType::Column)))); column->setAddedByLinking(true); column->setParentRelationship(this); recv_tab->addColumn(column); @@ -1615,7 +1615,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b column->setType(PgSqlType(QString("smallint"))); column->setName(name); - name=PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjectType::ObjColumn))); + name=PgModelerNs::generateUniqueName(column, (*recv_tab->getObjectList(ObjectType::Column))); column->setName(name); if(!prev_name.isEmpty()) diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 0b1da8e193..7a12e6a581 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -22,7 +22,7 @@ unsigned Role::role_id=0; Role::Role(void) { - obj_type=ObjectType::ObjRole; + obj_type=ObjectType::Role; object_id=Role::role_id++; for(unsigned i=0; i <= OpBypassRls; i++) diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index 6f2998ef6c..94f52e5189 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -21,7 +21,7 @@ Rule::Rule(void) { execution_type=BaseType::Null; - obj_type=ObjectType::ObjRule; + obj_type=ObjectType::Rule; attributes[ParsersAttributes::EVENT_TYPE]=QString(); attributes[ParsersAttributes::TABLE]=QString(); attributes[ParsersAttributes::CONDITION]=QString(); diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index 663e5982a0..7609a5117d 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -20,7 +20,7 @@ Schema::Schema(void) { - obj_type=ObjectType::ObjSchema; + obj_type=ObjectType::Schema; fill_color=QColor(225,225,225, 80); rect_visible=false; attributes[ParsersAttributes::FILL_COLOR]=QString(); @@ -34,7 +34,7 @@ void Schema::setName(const QString &name) if(name.mid(0,3)==QString("pg_")) throw Exception(Exception::getErrorMessage(ErrorCode::AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjSchema)), + .arg(BaseObject::getTypeName(ObjectType::Schema)), ErrorCode::AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 5d449d9dd8..31a2b00aac 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -27,7 +27,7 @@ const QString Sequence::MaxBigNegativeValue=QString("-9223372036854775808"); Sequence::Sequence(void) { - obj_type=ObjectType::ObjSequence; + obj_type=ObjectType::Sequence; cycle=false; setDefaultValues(PgSqlType(QString("serial"))); owner_col=nullptr; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index bdce99f119..65d0e3a93b 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -24,7 +24,7 @@ const QString Table::DataLineBreak = QString("%1%2").arg("⸣").arg('\n'); Table::Table(void) : BaseTable() { - obj_type=ObjectType::ObjTable; + obj_type=ObjectType::Table; with_oid=gen_alter_cmds=unlogged=rls_enabled=rls_forced=false; attributes[ParsersAttributes::COLUMNS]=QString(); attributes[ParsersAttributes::INH_COLUMNS]=QString(); @@ -122,8 +122,8 @@ Table *Table::getPartitionedTable(void) void Table::setProtected(bool value) { - ObjectType obj_types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint, - ObjectType::ObjIndex, ObjectType::ObjRule, ObjectType::ObjTrigger }; + ObjectType obj_types[]={ ObjectType::Column, ObjectType::Constraint, + ObjectType::Index, ObjectType::Rule, ObjectType::Trigger }; unsigned i; vector::iterator itr, itr_end; vector *list=nullptr; @@ -161,8 +161,8 @@ void Table::setCommentAttribute(TableObject *tab_obj) attribs[ParsersAttributes::SIGNATURE]=tab_obj->getSignature(); attribs[ParsersAttributes::SQL_OBJECT]=tab_obj->getSQLName(); - attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==ObjectType::ObjColumn ? ParsersAttributes::_TRUE_ : QString()); - attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==ObjectType::ObjConstraint ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==ObjectType::Column ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==ObjectType::Constraint ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::TABLE]=this->getName(true); attribs[ParsersAttributes::NAME]=tab_obj->getName(true); attribs[ParsersAttributes::COMMENT]=QString(tab_obj->getComment()).replace(QString("'"), QString("''"));; @@ -192,7 +192,7 @@ void Table::setRelObjectsIndexesAttribute(void) attribs_map aux_attribs; vector *> obj_indexes={ &col_indexes, &constr_indexes }; QString attribs[]={ ParsersAttributes::COL_INDEXES, ParsersAttributes::CONSTR_INDEXES }; - ObjectType obj_types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint }; + ObjectType obj_types[]={ ObjectType::Column, ObjectType::Constraint }; unsigned idx=0, size=obj_indexes.size(); for(idx=0; idx < size; idx++) @@ -331,17 +331,17 @@ void Table::setConstraintsAttribute(unsigned def_type) vector *Table::getObjectList(ObjectType obj_type) { - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) return(&columns); - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) return(&constraints); - else if(obj_type==ObjectType::ObjRule) + else if(obj_type==ObjectType::Rule) return(&rules); - else if(obj_type==ObjectType::ObjTrigger) + else if(obj_type==ObjectType::Trigger) return(&triggers); - else if(obj_type==ObjectType::ObjIndex) + else if(obj_type==ObjectType::Index) return(&indexes); - else if(obj_type==ObjectType::ObjPolicy) + else if(obj_type==ObjectType::Policy) return(&policies); else throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -385,17 +385,17 @@ void Table::addObject(BaseObject *obj, int obj_idx) } //Raises an error if the user try to set the table as ancestor/copy of itself - else if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjBaseTable) && obj==this) + else if((obj_type==ObjectType::Table || obj_type==ObjectType::BaseTable) && obj==this) throw Exception(ErrorCode::InvInheritCopyPartRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); switch(obj_type) { - case ObjectType::ObjColumn: - case ObjectType::ObjConstraint: - case ObjectType::ObjTrigger: - case ObjectType::ObjIndex: - case ObjectType::ObjRule: - case ObjectType::ObjPolicy: + case ObjectType::Column: + case ObjectType::Constraint: + case ObjectType::Trigger: + case ObjectType::Index: + case ObjectType::Rule: + case ObjectType::Policy: TableObject *tab_obj; vector *obj_list; Column *col; @@ -420,14 +420,14 @@ void Table::addObject(BaseObject *obj, int obj_idx) .arg(this->getName()), ErrorCode::InvColumnTableType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) { //Raises a error if the user try to add a second primary key on the table if(dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::PrimaryKey && this->getPrimaryKey()) throw Exception(ErrorCode::AsgExistingPrimaryKeyTable,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(obj_type==ObjectType::ObjTrigger) + else if(obj_type==ObjectType::Trigger) dynamic_cast(tab_obj)->validateTrigger(); obj_list=getObjectList(obj_type); @@ -444,16 +444,16 @@ void Table::addObject(BaseObject *obj, int obj_idx) obj_list->push_back(tab_obj); } - if(obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) + if(obj_type==ObjectType::Column || obj_type==ObjectType::Constraint) { updateAlterCmdsStatus(); - if(obj_type==ObjectType::ObjConstraint) + if(obj_type==ObjectType::Constraint) dynamic_cast(tab_obj)->setColumnsNotNull(true); } break; - case ObjectType::ObjTable: + case ObjectType::Table: Table *tab; tab=dynamic_cast
(obj); if(obj_idx < 0 || obj_idx >= static_cast(ancestor_tables.size())) @@ -719,7 +719,7 @@ void Table::removeObject(BaseObject *obj) if(tab_obj) removeObject(getObjectIndex(tab_obj), obj->getObjectType()); else - removeObject(obj->getName(true), ObjectType::ObjTable); + removeObject(obj->getName(true), ObjectType::Table); } } catch(Exception &e) @@ -743,10 +743,10 @@ void Table::removeObject(const QString &name, ObjectType obj_type) void Table::removeObject(unsigned obj_idx, ObjectType obj_type) { //Raises an error if the user try to remove a object with invalid type - if(!TableObject::isTableObject(obj_type) && obj_type!=ObjectType::ObjTable) + if(!TableObject::isTableObject(obj_type) && obj_type!=ObjectType::Table) throw Exception(ErrorCode::RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(obj_type==ObjectType::ObjTable && obj_idx < ancestor_tables.size()) + else if(obj_type==ObjectType::Table && obj_idx < ancestor_tables.size()) { vector
::iterator itr; Table *tab=nullptr; @@ -766,7 +766,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) } } } - else if(obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjBaseTable) + else if(obj_type!=ObjectType::Table && obj_type!=ObjectType::BaseTable) { vector *obj_list=nullptr; vector::iterator itr; @@ -777,7 +777,7 @@ void Table::removeObject(unsigned obj_idx, ObjectType obj_type) if(obj_idx >= obj_list->size()) throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type!=ObjectType::ObjColumn) + if(obj_type!=ObjectType::Column) { itr=obj_list->begin() + obj_idx; TableObject *tab_obj=(*itr); @@ -833,7 +833,7 @@ void Table::removeColumn(const QString &name) { try { - removeObject(name,ObjectType::ObjColumn); + removeObject(name,ObjectType::Column); } catch(Exception &e) { @@ -845,7 +845,7 @@ void Table::removeColumn(unsigned idx) { try { - removeObject(idx,ObjectType::ObjColumn); + removeObject(idx,ObjectType::Column); } catch(Exception &e) { @@ -857,7 +857,7 @@ void Table::removeTrigger(const QString &name) { try { - removeObject(name,ObjectType::ObjTrigger); + removeObject(name,ObjectType::Trigger); } catch(Exception &e) { @@ -869,7 +869,7 @@ void Table::removeTrigger(unsigned idx) { try { - removeObject(idx,ObjectType::ObjTrigger); + removeObject(idx,ObjectType::Trigger); } catch(Exception &e) { @@ -881,7 +881,7 @@ void Table::removeIndex(const QString &name) { try { - removeObject(name,ObjectType::ObjIndex); + removeObject(name,ObjectType::Index); } catch(Exception &e) { @@ -893,7 +893,7 @@ void Table::removeIndex(unsigned idx) { try { - removeObject(idx,ObjectType::ObjIndex); + removeObject(idx,ObjectType::Index); } catch(Exception &e) { @@ -905,7 +905,7 @@ void Table::removeRule(const QString &name) { try { - removeObject(name,ObjectType::ObjRule); + removeObject(name,ObjectType::Rule); } catch(Exception &e) { @@ -917,7 +917,7 @@ void Table::removeRule(unsigned idx) { try { - removeObject(idx,ObjectType::ObjRule); + removeObject(idx,ObjectType::Rule); } catch(Exception &e) { @@ -929,7 +929,7 @@ void Table::removePolicy(const QString &name) { try { - removeObject(name, ObjectType::ObjPolicy); + removeObject(name, ObjectType::Policy); } catch(Exception &e) { @@ -941,7 +941,7 @@ void Table::removePolicy(unsigned idx) { try { - removeObject(idx, ObjectType::ObjPolicy); + removeObject(idx, ObjectType::Policy); } catch(Exception &e) { @@ -953,7 +953,7 @@ void Table::removeConstraint(const QString &name) { try { - removeObject(name,ObjectType::ObjConstraint); + removeObject(name,ObjectType::Constraint); } catch(Exception &e) { @@ -965,7 +965,7 @@ void Table::removeConstraint(unsigned idx) { try { - removeObject(idx,ObjectType::ObjConstraint); + removeObject(idx,ObjectType::Constraint); } catch(Exception &e) { @@ -977,7 +977,7 @@ void Table::removeAncestorTable(const QString &name) { try { - removeObject(name,ObjectType::ObjTable); + removeObject(name,ObjectType::Table); } catch(Exception &e) { @@ -989,7 +989,7 @@ void Table::removeAncestorTable(unsigned idx) { try { - removeObject(idx,ObjectType::ObjTable); + removeObject(idx,ObjectType::Table); } catch(Exception &e) { @@ -1071,7 +1071,7 @@ BaseObject *Table::getObject(const QString &name, ObjectType obj_type, int &obj_ } else obj_idx=-1; } - else if(obj_type==ObjectType::ObjTable) + else if(obj_type==ObjectType::Table) { vector
::iterator itr_tab, itr_end_tab; QString tab_name, aux_name=name; @@ -1108,7 +1108,7 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) { vector *obj_list=nullptr; - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) { //Raises an error if the object index is out of bound if(obj_idx >= ancestor_tables.size()) @@ -1130,12 +1130,12 @@ BaseObject *Table::getObject(unsigned obj_idx, ObjectType obj_type) Table *Table::getAncestorTable(const QString &name) { int idx; - return(dynamic_cast
(getObject(name,ObjectType::ObjTable,idx))); + return(dynamic_cast
(getObject(name,ObjectType::Table,idx))); } Table *Table::getAncestorTable(unsigned idx) { - return(dynamic_cast
(getObject(idx,ObjectType::ObjTable))); + return(dynamic_cast
(getObject(idx,ObjectType::Table))); } Column *Table::getColumn(const QString &name, bool ref_old_name) @@ -1143,7 +1143,7 @@ Column *Table::getColumn(const QString &name, bool ref_old_name) if(!ref_old_name) { int idx; - return(dynamic_cast(getObject(name,ObjectType::ObjColumn,idx))); + return(dynamic_cast(getObject(name,ObjectType::Column,idx))); } else { @@ -1170,62 +1170,62 @@ Column *Table::getColumn(const QString &name, bool ref_old_name) Column *Table::getColumn(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjectType::ObjColumn))); + return(dynamic_cast(getObject(idx,ObjectType::Column))); } Trigger *Table::getTrigger(const QString &name) { int idx; - return(dynamic_cast(getObject(name,ObjectType::ObjTrigger,idx))); + return(dynamic_cast(getObject(name,ObjectType::Trigger,idx))); } Trigger *Table::getTrigger(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjectType::ObjTrigger))); + return(dynamic_cast(getObject(idx,ObjectType::Trigger))); } Constraint *Table::getConstraint(const QString &name) { int idx; - return(dynamic_cast(getObject(name,ObjectType::ObjConstraint,idx))); + return(dynamic_cast(getObject(name,ObjectType::Constraint,idx))); } Constraint *Table::getConstraint(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjectType::ObjConstraint))); + return(dynamic_cast(getObject(idx,ObjectType::Constraint))); } Index *Table::getIndex(const QString &name) { int idx; - return(dynamic_cast(getObject(name,ObjectType::ObjIndex,idx))); + return(dynamic_cast(getObject(name,ObjectType::Index,idx))); } Index *Table::getIndex(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjectType::ObjIndex))); + return(dynamic_cast(getObject(idx,ObjectType::Index))); } Rule *Table::getRule(const QString &name) { int idx; - return(dynamic_cast(getObject(name,ObjectType::ObjRule,idx))); + return(dynamic_cast(getObject(name,ObjectType::Rule,idx))); } Rule *Table::getRule(unsigned idx) { - return(dynamic_cast(getObject(idx,ObjectType::ObjRule))); + return(dynamic_cast(getObject(idx,ObjectType::Rule))); } Policy *Table::getPolicy(const QString &name) { int idx; - return(dynamic_cast(getObject(name, ObjectType::ObjPolicy,idx))); + return(dynamic_cast(getObject(name, ObjectType::Policy,idx))); } Policy *Table::getPolicy(unsigned idx) { - return(dynamic_cast(getObject(idx, ObjectType::ObjPolicy))); + return(dynamic_cast(getObject(idx, ObjectType::Policy))); } unsigned Table::getColumnCount(void) @@ -1265,9 +1265,9 @@ unsigned Table::getAncestorTableCount(void) unsigned Table::getObjectCount(ObjectType obj_type, bool inc_added_by_rel) { - if(TableObject::isTableObject(obj_type) || obj_type==ObjectType::ObjTable) + if(TableObject::isTableObject(obj_type) || obj_type==ObjectType::Table) { - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) { return(ancestor_tables.size()); } @@ -1377,9 +1377,9 @@ void Table::setRelObjectsIndexes(const vector &obj_names, const vector< map *obj_idxs_map=nullptr; unsigned idx=0, size=obj_names.size(); - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) obj_idxs_map=&col_indexes; - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) obj_idxs_map=&constr_indexes; else throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1394,12 +1394,12 @@ void Table::saveRelObjectsIndexes(ObjectType obj_type) map *obj_idxs_map=nullptr; vector *list=nullptr; - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { obj_idxs_map=&col_indexes; list=&columns; } - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) { obj_idxs_map=&constr_indexes; list=&constraints; @@ -1424,14 +1424,14 @@ void Table::saveRelObjectsIndexes(ObjectType obj_type) void Table::saveRelObjectsIndexes(void) { - saveRelObjectsIndexes(ObjectType::ObjColumn); - saveRelObjectsIndexes(ObjectType::ObjConstraint); + saveRelObjectsIndexes(ObjectType::Column); + saveRelObjectsIndexes(ObjectType::Constraint); } void Table::restoreRelObjectsIndexes(void) { - restoreRelObjectsIndexes(ObjectType::ObjColumn); - restoreRelObjectsIndexes(ObjectType::ObjConstraint); + restoreRelObjectsIndexes(ObjectType::Column); + restoreRelObjectsIndexes(ObjectType::Constraint); if(!col_indexes.empty() || !constr_indexes.empty()) { @@ -1444,7 +1444,7 @@ void Table::restoreRelObjectsIndexes(ObjectType obj_type) { map *obj_idxs=nullptr; - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) obj_idxs=&col_indexes; else obj_idxs=&constr_indexes; @@ -1672,7 +1672,7 @@ void Table::operator = (Table &tab) bool Table::isReferRelationshipAddedObject(void) { vector::iterator itr, itr_end; - ObjectType types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint }; + ObjectType types[]={ ObjectType::Column, ObjectType::Constraint }; bool found=false; for(unsigned i=0; i < 2 && !found; i++) @@ -1743,7 +1743,7 @@ void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2 (*itr2)=aux_obj; } - if(obj_type!=ObjectType::ObjColumn && obj_type!=ObjectType::ObjConstraint) + if(obj_type!=ObjectType::Column && obj_type!=ObjectType::Constraint) BaseObject::swapObjectsIds(aux_obj, aux_obj1, false); setCodeInvalidated(true); @@ -1831,12 +1831,12 @@ void Table::getColumnReferences(Column *column, vector &refs, boo vector Table::getObjects(bool excl_cols_constr) { vector list; - vector types={ ObjectType::ObjColumn, ObjectType::ObjConstraint, - ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjRule, ObjectType::ObjPolicy }; + vector types={ ObjectType::Column, ObjectType::Constraint, + ObjectType::Trigger, ObjectType::Index, ObjectType::Rule, ObjectType::Policy }; for(auto type : types) { - if(excl_cols_constr && (type == ObjectType::ObjColumn || type == ObjectType::ObjConstraint)) + if(excl_cols_constr && (type == ObjectType::Column || type == ObjectType::Constraint)) continue; list.insert(list.end(), getObjectList(type)->begin(), getObjectList(type)->end()) ; @@ -1857,8 +1857,8 @@ vector Table::getPartitionKeys(void) void Table::setCodeInvalidated(bool value) { - vector types={ ObjectType::ObjColumn, ObjectType::ObjConstraint, - ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjRule, ObjectType::ObjPolicy }; + vector types={ ObjectType::Column, ObjectType::Constraint, + ObjectType::Trigger, ObjectType::Index, ObjectType::Rule, ObjectType::Policy }; for(auto type : types) { @@ -1954,7 +1954,7 @@ QString Table::getInitialDataCommands(void) //Separating valid columns (selected) from the invalids (ignored) for(QString col_name : col_names) { - if(getObjectIndex(col_name, ObjectType::ObjColumn) >= 0) + if(getObjectIndex(col_name, ObjectType::Column) >= 0) selected_cols.append(col_name); else ignored_cols.append(curr_col); @@ -2055,8 +2055,8 @@ void Table::setObjectListsCapacity(unsigned capacity) unsigned Table::getMaxObjectCount(void) { unsigned count = 0, max = 0; - vector types = { ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjIndex, - ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjPolicy }; + vector types = { ObjectType::Column, ObjectType::Constraint, ObjectType::Index, + ObjectType::Rule, ObjectType::Trigger, ObjectType::Policy }; for(auto type : types) { diff --git a/libpgmodeler/src/tableobject.cpp b/libpgmodeler/src/tableobject.cpp index 7e10fd4b5f..3c91ca7190 100644 --- a/libpgmodeler/src/tableobject.cpp +++ b/libpgmodeler/src/tableobject.cpp @@ -89,8 +89,8 @@ bool TableObject::isDeclaredInTable(void) bool TableObject::isTableObject(ObjectType type) { - return(type==ObjectType::ObjColumn || type==ObjectType::ObjConstraint || type==ObjectType::ObjTrigger || - type==ObjectType::ObjRule || type==ObjectType::ObjIndex || type==ObjectType::ObjPolicy); + return(type==ObjectType::Column || type==ObjectType::Constraint || type==ObjectType::Trigger || + type==ObjectType::Rule || type==ObjectType::Index || type==ObjectType::Policy); } void TableObject::operator = (TableObject &object) diff --git a/libpgmodeler/src/tablespace.cpp b/libpgmodeler/src/tablespace.cpp index 3bac283315..e91e637afc 100644 --- a/libpgmodeler/src/tablespace.cpp +++ b/libpgmodeler/src/tablespace.cpp @@ -22,7 +22,7 @@ unsigned Tablespace::tabspace_id=1000; Tablespace::Tablespace(void) { - obj_type=ObjectType::ObjTablespace; + obj_type=ObjectType::Tablespace; attributes[ParsersAttributes::DIRECTORY]=QString(); object_id=Tablespace::tabspace_id++; } @@ -34,7 +34,7 @@ void Tablespace::setName(const QString &name) if(name.mid(0,3)==QString("pg_")) throw Exception(Exception::getErrorMessage(ErrorCode::AsgReservedName) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjTablespace)), + .arg(BaseObject::getTypeName(ObjectType::Tablespace)), ErrorCode::AsgReservedName,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObject::setName(name); diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index d225f215bf..87c2909469 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -26,7 +26,7 @@ Tag::Tag(void) ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, ParsersAttributes::TABLE_EXT_BODY }; - obj_type=ObjectType::ObjTag; + obj_type=ObjectType::Tag; object_id=Tag::tag_id++; attributes[ParsersAttributes::STYLES]=QString(); diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index 94746c034e..38e55b1c33 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -20,7 +20,7 @@ Textbox::Textbox(void) { - obj_type=ObjectType::ObjTextbox; + obj_type=ObjectType::Textbox; font_size=9.0f; text_attributes[0]=text_attributes[1]=text_attributes[2]=false; attributes[ParsersAttributes::ITALIC]=QString(); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index a2a987f264..15b3b883b1 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -26,7 +26,7 @@ Trigger::Trigger(void) function=nullptr; is_exec_per_row=is_constraint=is_deferrable=false; - obj_type=ObjectType::ObjTrigger; + obj_type=ObjectType::Trigger; referenced_table=nullptr; for(i=0; i < 4; i++) @@ -98,7 +98,7 @@ void Trigger::setFunction(Function *func) if(!func) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)), + .arg(BaseObject::getTypeName(ObjectType::Trigger)), ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -109,7 +109,7 @@ void Trigger::setFunction(Function *func) else if(func->getParameterCount()!=0) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjTrigger)), + .arg(BaseObject::getTypeName(ObjectType::Trigger)), ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(function != func); @@ -249,7 +249,7 @@ void Trigger::removeColumns(void) void Trigger::setReferecendTable(BaseTable *ref_table) { //If the referenced table isn't valid raises an error - if(ref_table && ref_table->getObjectType()!=ObjectType::ObjTable) + if(ref_table && ref_table->getObjectType()!=ObjectType::Table) throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(referenced_table != ref_table); @@ -445,11 +445,11 @@ void Trigger::validateTrigger(void) if(!is_constraint) { //The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers - if(firing_type==FiringType::InsteadOf && parent_type==ObjectType::ObjTable) + if(firing_type==FiringType::InsteadOf && parent_type==ObjectType::Table) throw Exception(ErrorCode::InvTableTriggerInsteadOfFiring,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The INSTEAD OF mode cannot be used on view triggers that executes for each statement - else if(firing_type==FiringType::InsteadOf && parent_type==ObjectType::ObjView && !is_exec_per_row) + else if(firing_type==FiringType::InsteadOf && parent_type==ObjectType::View && !is_exec_per_row) throw Exception(ErrorCode::InvUsageInsteadOfOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event @@ -457,11 +457,11 @@ void Trigger::validateTrigger(void) throw Exception(ErrorCode::InvUsageInsteadOfUpdateTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table - else if(events[EventType::OnTruncate] && (is_exec_per_row || parent_type==ObjectType::ObjView)) + else if(events[EventType::OnTruncate] && (is_exec_per_row || parent_type==ObjectType::View)) throw Exception(ErrorCode::InvUsageTruncateOnTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //A view trigger cannot be AFTER/BEFORE when it executes for each row - else if(parent_type==ObjectType::ObjView && is_exec_per_row && (firing_type==FiringType::After || firing_type==FiringType::Before)) + else if(parent_type==ObjectType::View && is_exec_per_row && (firing_type==FiringType::After || firing_type==FiringType::Before)) throw Exception(ErrorCode::InvUsageAfterBeforeViewTrigger,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Only constraint triggers can be deferrable or reference another table diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 141c341a04..701e562162 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -20,7 +20,7 @@ Type::Type(void) { - obj_type=ObjectType::ObjType; + obj_type=ObjectType::Type; setConfiguration(EnumerationType); attributes[ParsersAttributes::BASE_TYPE]=QString(); @@ -231,7 +231,7 @@ void Type::setFunction(unsigned func_id, Function *func) else if(!func && (func_id==InputFunc || func_id==OutputFunc)) throw Exception(Exception::getErrorMessage(ErrorCode::AsgNotAllocatedFunction) .arg(this->getName(true)) - .arg(BaseObject::getTypeName(ObjectType::ObjType)), + .arg(BaseObject::getTypeName(ObjectType::Type)), ErrorCode::AsgNotAllocatedFunction,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(func) @@ -254,7 +254,7 @@ void Type::setFunction(unsigned func_id, Function *func) func_id==AnalyzeFunc || func_id==CanonicalFunc))) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjType)), + .arg(BaseObject::getTypeName(ObjectType::Type)), ErrorCode::AsgFunctionInvalidParamCount,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Checking the return types of function in relation to type. INPUT, RECV and CANONICAL functions must return the data type that is being defined according to the @@ -274,7 +274,7 @@ void Type::setFunction(unsigned func_id, Function *func) (func_id==SubtypeDiffFunc && func->getReturnType()!=QString("double precision"))) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjType)), + .arg(BaseObject::getTypeName(ObjectType::Type)), ErrorCode::AsgFunctionInvalidReturnType,__PRETTY_FUNCTION__,__FILE__,__LINE__); /* Validating the parameter types of function in relation to the type configuration. diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index 3267b69686..57d90b1e71 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -20,7 +20,7 @@ TypeAttribute::TypeAttribute(void) { - obj_type=ObjectType::ObjTypeAttribute; + obj_type=ObjectType::TypeAttribute; } void TypeAttribute::setType(PgSqlType type) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 14bbcf3b43..1389e532c0 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -20,7 +20,7 @@ View::View(void) : BaseTable() { - obj_type=ObjectType::ObjView; + obj_type=ObjectType::View; materialized=recursive=with_no_data=false; attributes[ParsersAttributes::DEFINITION]=QString(); attributes[ParsersAttributes::REFERENCES]=QString(); @@ -37,7 +37,7 @@ View::View(void) : BaseTable() View::~View(void) { - ObjectType types[]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex }; + ObjectType types[]={ ObjectType::Trigger, ObjectType::Rule, ObjectType::Index }; vector *list=nullptr; for(unsigned i=0; i < 3; i++) @@ -67,7 +67,7 @@ void View::setSchema(BaseObject *schema) void View::setProtected(bool value) { - ObjectType obj_types[]={ ObjectType::ObjRule, ObjectType::ObjTrigger }; + ObjectType obj_types[]={ ObjectType::Rule, ObjectType::Trigger }; unsigned i; vector::iterator itr, itr_end; vector *list=nullptr; @@ -605,7 +605,7 @@ QString View::getCodeDefinition(unsigned def_type) void View::setSQLObjectAttribute(void) { if(materialized) - attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::ObjView); + attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::View); } void View::setObjectListsCapacity(unsigned capacity) @@ -622,7 +622,7 @@ void View::setObjectListsCapacity(unsigned capacity) unsigned View::getMaxObjectCount(void) { unsigned count = 0, max = references.size(); - vector types = { ObjectType::ObjIndex, ObjectType::ObjRule, ObjectType::ObjTrigger }; + vector types = { ObjectType::Index, ObjectType::Rule, ObjectType::Trigger }; for(auto type : types) { @@ -721,7 +721,7 @@ void View::addObject(BaseObject *obj, int obj_idx) tab_obj->getCodeDefinition(SchemaParser::SqlDefinition); //Make a additional validation if the object is a trigger - if(tab_obj->getObjectType()==ObjectType::ObjTrigger) + if(tab_obj->getObjectType()==ObjectType::Trigger) dynamic_cast(tab_obj)->validateTrigger(); //Inserts the object at specified position @@ -824,7 +824,7 @@ void View::removeTrigger(unsigned idx) { try { - removeObject(idx, ObjectType::ObjTrigger); + removeObject(idx, ObjectType::Trigger); } catch(Exception &e) { @@ -836,7 +836,7 @@ void View::removeRule(unsigned idx) { try { - removeObject(idx, ObjectType::ObjRule); + removeObject(idx, ObjectType::Rule); } catch(Exception &e) { @@ -848,7 +848,7 @@ void View::removeIndex(unsigned idx) { try { - removeObject(idx, ObjectType::ObjIndex); + removeObject(idx, ObjectType::Index); } catch(Exception &e) { @@ -889,7 +889,7 @@ Trigger *View::getTrigger(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjTrigger))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Trigger))); } catch(Exception &e) { @@ -901,7 +901,7 @@ Rule *View::getRule(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjRule))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Rule))); } catch(Exception &e) { @@ -913,7 +913,7 @@ Index *View::getIndex(unsigned obj_idx) { try { - return(dynamic_cast(getObject(obj_idx, ObjectType::ObjIndex))); + return(dynamic_cast(getObject(obj_idx, ObjectType::Index))); } catch(Exception &e) { @@ -950,11 +950,11 @@ unsigned View::getIndexCount() vector *View::getObjectList(ObjectType obj_type) { - if(obj_type==ObjectType::ObjTrigger) + if(obj_type==ObjectType::Trigger) return(&triggers); - else if(obj_type==ObjectType::ObjRule) + else if(obj_type==ObjectType::Rule) return(&rules); - else if(obj_type==ObjectType::ObjIndex) + else if(obj_type==ObjectType::Index) return(&indexes); else throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index 527f03b4bb..67e53fbfda 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -18,7 +18,7 @@ #include "aggregatewidget.h" -AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjAggregate) +AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Aggregate) { try { @@ -30,9 +30,9 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, Obje initial_cond_hl=new SyntaxHighlighter(initial_cond_txt); initial_cond_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - final_func_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); - transition_func_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); - sort_op_sel=new ObjectSelectorWidget(ObjectType::ObjOperator, true, this); + final_func_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); + transition_func_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); + sort_op_sel=new ObjectSelectorWidget(ObjectType::Operator, true, this); input_type=new PgSQLTypeWidget(this, trUtf8("Input Data Type")); state_type=new PgSQLTypeWidget(this, trUtf8("State Data Type")); @@ -66,7 +66,7 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, Obje funcaoagregacao_grid->addWidget(frame, funcaoagregacao_grid->count()+1, 0, 1, 2); frame->setParent(this); - configureFormLayout(funcaoagregacao_grid, ObjectType::ObjAggregate); + configureFormLayout(funcaoagregacao_grid, ObjectType::Aggregate); setRequiredField(state_type); setRequiredField(input_type); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 5948b26ae1..eec9e8b85e 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -38,16 +38,16 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid ParsersAttributes::TABLE_BODY, //10 ParsersAttributes::TABLE_EXT_BODY, //11 ParsersAttributes::TABLE_TITLE, //12 - BaseObject::getSchemaName(ObjectType::ObjRule), //13 - BaseObject::getSchemaName(ObjectType::ObjRule), //14 - BaseObject::getSchemaName(ObjectType::ObjIndex), //15 - BaseObject::getSchemaName(ObjectType::ObjIndex), //16 - BaseObject::getSchemaName(ObjectType::ObjTrigger), //17 - BaseObject::getSchemaName(ObjectType::ObjTrigger), //18 - BaseObject::getSchemaName(ObjectType::ObjConstraint), //19 - BaseObject::getSchemaName(ObjectType::ObjConstraint), //20 - BaseObject::getSchemaName(ObjectType::ObjPolicy), //21 - BaseObject::getSchemaName(ObjectType::ObjPolicy), //22 + BaseObject::getSchemaName(ObjectType::Rule), //13 + BaseObject::getSchemaName(ObjectType::Rule), //14 + BaseObject::getSchemaName(ObjectType::Index), //15 + BaseObject::getSchemaName(ObjectType::Index), //16 + BaseObject::getSchemaName(ObjectType::Trigger), //17 + BaseObject::getSchemaName(ObjectType::Trigger), //18 + BaseObject::getSchemaName(ObjectType::Constraint), //19 + BaseObject::getSchemaName(ObjectType::Constraint), //20 + BaseObject::getSchemaName(ObjectType::Policy), //21 + BaseObject::getSchemaName(ObjectType::Policy), //22 ParsersAttributes::VIEW_SCHEMA_NAME, //21 -> 23 ParsersAttributes::VIEW_NAME, //22 ParsersAttributes::VIEW_BODY, //23 @@ -57,7 +57,7 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid ParsersAttributes::REF_COLUMN, //27 ParsersAttributes::REF_TABLE, //28 ParsersAttributes::REFERENCE, //29 - BaseObject::getSchemaName(ObjectType::ObjTextbox), //30 + BaseObject::getSchemaName(ObjectType::Textbox), //30 ParsersAttributes::COLUMN, //31 ParsersAttributes::COLUMN, //32 ParsersAttributes::INH_COLUMN, //33 @@ -161,7 +161,7 @@ void AppearanceConfigWidget::loadExampleModel(void) GlobalAttributes::DirSeparator + GlobalAttributes::ExampleModel); - count=model->getObjectCount(ObjectType::ObjTable); + count=model->getObjectCount(ObjectType::Table); for(i=0; i < count; i++) { tab=new TableView(model->getTable(i)); @@ -169,28 +169,28 @@ void AppearanceConfigWidget::loadExampleModel(void) scene->addItem(tab); } - count=model->getObjectCount(ObjectType::ObjView); + count=model->getObjectCount(ObjectType::View); for(i=0; i < count; i++) { view=new GraphicalView(model->getView(i)); scene->addItem(view); } - count=model->getObjectCount(ObjectType::ObjRelationship); + count=model->getObjectCount(ObjectType::Relationship); for(i=0; i < count; i++) { - rel=new RelationshipView(model->getRelationship(i, ObjectType::ObjRelationship)); + rel=new RelationshipView(model->getRelationship(i, ObjectType::Relationship)); scene->addItem(rel); } - count=model->getObjectCount(ObjectType::ObjBaseRelationship); + count=model->getObjectCount(ObjectType::BaseRelationship); for(i=0; i < count; i++) { - rel=new RelationshipView(model->getRelationship(i, ObjectType::ObjBaseRelationship)); + rel=new RelationshipView(model->getRelationship(i, ObjectType::BaseRelationship)); scene->addItem(rel); } - count=model->getObjectCount(ObjectType::ObjTextbox); + count=model->getObjectCount(ObjectType::Textbox); for(i=0; i < count; i++) { txtbox=new StyledTextboxView(model->getTextbox(i)); diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp index 6e290d178f..d8642086c4 100644 --- a/libpgmodeler_ui/src/baseform.cpp +++ b/libpgmodeler_ui/src/baseform.cpp @@ -127,7 +127,7 @@ void BaseForm::setMainWidget(BaseObjectWidget *widget) { if(!widget) return; - if(widget->getHandledObjectType()!=ObjectType::ObjBaseObject && widget->windowTitle().isEmpty()) + if(widget->getHandledObjectType()!=ObjectType::BaseObject && widget->windowTitle().isEmpty()) setWindowTitle(trUtf8("%1 properties").arg(BaseObject::getTypeName(widget->getHandledObjectType()))); else setWindowTitle(widget->windowTitle()); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 6e9e7eab7a..390eb5787e 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -57,10 +57,10 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge connect(edt_perms_tb, SIGNAL(clicked(bool)),this, SLOT(editPermissions(void))); connect(append_sql_tb, SIGNAL(clicked(bool)),this, SLOT(editCustomSQL(void))); - schema_sel=new ObjectSelectorWidget(ObjectType::ObjSchema, true, this); - collation_sel=new ObjectSelectorWidget(ObjectType::ObjCollation, true, this); - tablespace_sel=new ObjectSelectorWidget(ObjectType::ObjTablespace, true, this); - owner_sel=new ObjectSelectorWidget(ObjectType::ObjRole, true, this); + schema_sel=new ObjectSelectorWidget(ObjectType::Schema, true, this); + collation_sel=new ObjectSelectorWidget(ObjectType::Collation, true, this); + tablespace_sel=new ObjectSelectorWidget(ObjectType::Tablespace, true, this); + owner_sel=new ObjectSelectorWidget(ObjectType::Role, true, this); alias_ht=new HintTextWidget(alias_hint, this); alias_ht->setText(alias_edt->statusTip()); @@ -287,7 +287,7 @@ void BaseObjectWidget::cancelChainedOperation(void) void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *object, BaseObject *parent_obj, double obj_px, double obj_py, bool uses_op_list) { - ObjectType obj_type, parent_type=ObjectType::ObjBaseObject; + ObjectType obj_type, parent_type=ObjectType::BaseObject; /* Reseting the objects attributes in order to force them to be redefined every time this method is called */ @@ -309,11 +309,11 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis { parent_type=parent_obj->getObjectType(); - if(parent_type==ObjectType::ObjTable || parent_type==ObjectType::ObjView) + if(parent_type==ObjectType::Table || parent_type==ObjectType::View) this->table=dynamic_cast(parent_obj); - else if(parent_type==ObjectType::ObjRelationship) + else if(parent_type==ObjectType::Relationship) this->relationship=dynamic_cast(parent_obj); - else if(parent_type!=ObjectType::ObjDatabase && parent_type!=ObjectType::ObjSchema) + else if(parent_type!=ObjectType::Database && parent_type!=ObjectType::Schema) throw Exception(ErrorCode::AsgObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } else @@ -350,23 +350,23 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis append_sql_tb->setEnabled(object!=nullptr && !new_object); owner_sel->setModel(model); - owner_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjRole)); + owner_sel->setSelectedObject(model->getDefaultObject(ObjectType::Role)); schema_sel->setModel(model); - schema_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjSchema)); + schema_sel->setSelectedObject(model->getDefaultObject(ObjectType::Schema)); tablespace_sel->setModel(model); - tablespace_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjTablespace)); + tablespace_sel->setSelectedObject(model->getDefaultObject(ObjectType::Tablespace)); collation_sel->setModel(model); - collation_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjCollation)); + collation_sel->setSelectedObject(model->getDefaultObject(ObjectType::Collation)); if(object) { obj_id_lbl->setVisible(true); obj_id_lbl->setText(QString("ID: %1").arg(object->getObjectId())); - if(handled_obj_type != ObjectType::ObjBaseObject) + if(handled_obj_type != ObjectType::BaseObject) name_edt->setText(object->getName()); else name_edt->setText(object->getSignature()); @@ -390,9 +390,9 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis schema_sel->setSelectedObject(object->getSchema()); obj_type=object->getObjectType(); - object_protected=(parent_type!=ObjectType::ObjRelationship && + object_protected=(parent_type!=ObjectType::Relationship && (object->isProtected() || - ((obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) && + ((obj_type==ObjectType::Column || obj_type==ObjectType::Constraint) && dynamic_cast(object)->isAddedByRelationship()))); protected_obj_frm->setVisible(object_protected); disable_sql_chk->setChecked(object->isSQLDisabled()); @@ -403,7 +403,7 @@ void BaseObjectWidget::setAttributes(DatabaseModel *model, OperationList *op_lis obj_id_lbl->setVisible(false); protected_obj_frm->setVisible(false); - if(parent_obj && parent_obj->getObjectType()==ObjectType::ObjSchema) + if(parent_obj && parent_obj->getObjectType()==ObjectType::Schema) schema_sel->setSelectedObject(parent_obj); } } @@ -446,9 +446,9 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ this->setLayout(baseobject_grid); baseobject_grid->setContentsMargins(4, 4, 4, 4); - disable_sql_chk->setVisible(obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjPermission && - obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjTag && - obj_type!=ObjectType::ObjParameter); + disable_sql_chk->setVisible(obj_type!=ObjectType::BaseObject && obj_type!=ObjectType::Permission && + obj_type!=ObjectType::Textbox && obj_type!=ObjectType::Tag && + obj_type!=ObjectType::Parameter); alias_edt->setVisible(BaseObject::acceptsAlias(obj_type)); alias_hint_wgt->setVisible(BaseObject::acceptsAlias(obj_type)); @@ -469,22 +469,22 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ collation_lbl->setVisible(BaseObject::acceptsCollation(obj_type)); collation_sel->setVisible(BaseObject::acceptsCollation(obj_type)); - show_comment=obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjParameter; + show_comment=obj_type!=ObjectType::Relationship && obj_type!=ObjectType::Textbox && obj_type!=ObjectType::Parameter; comment_lbl->setVisible(show_comment); comment_edt->setVisible(show_comment); - if(obj_type!=ObjectType::ObjBaseObject) + if(obj_type!=ObjectType::BaseObject) { obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(obj_type))); obj_icon_lbl->setToolTip(BaseObject::getTypeName(obj_type)); - if(obj_type!=ObjectType::ObjPermission && obj_type!=ObjectType::ObjCast) + if(obj_type!=ObjectType::Permission && obj_type!=ObjectType::Cast) { setRequiredField(name_lbl); setRequiredField(name_edt); } - if(obj_type!=ObjectType::ObjExtension) + if(obj_type!=ObjectType::Extension) { setRequiredField(schema_lbl); setRequiredField(schema_sel); @@ -702,13 +702,13 @@ void BaseObjectWidget::applyConfiguration(void) QString obj_name; QApplication::setOverrideCursor(Qt::WaitCursor); - obj_name=BaseObject::formatName(name_edt->text().toUtf8(), obj_type==ObjectType::ObjOperator); + obj_name=BaseObject::formatName(name_edt->text().toUtf8(), obj_type==ObjectType::Operator); if(this->object->acceptsSchema() && schema_sel->getSelectedObject()) obj_name=schema_sel->getSelectedObject()->getName(true) + "." + obj_name; //Checking the object duplicity - if(obj_type!=ObjectType::ObjDatabase && obj_type!=ObjectType::ObjPermission && obj_type!=ObjectType::ObjParameter) + if(obj_type!=ObjectType::Database && obj_type!=ObjectType::Permission && obj_type!=ObjectType::Parameter) { if(table) { @@ -736,10 +736,10 @@ void BaseObjectWidget::applyConfiguration(void) checking on table list when the configured object is a view or a checking on view list when the configured object is a table, this because PostgreSQL does not accepts tables and views have the same name on the same schema */ - if(!aux_obj && obj_type==ObjectType::ObjTable) - aux_obj=model->getObject(obj_name, ObjectType::ObjView); - else if(!aux_obj && obj_type==ObjectType::ObjView) - aux_obj=model->getObject(obj_name, ObjectType::ObjTable); + if(!aux_obj && obj_type==ObjectType::Table) + aux_obj=model->getObject(obj_name, ObjectType::View); + else if(!aux_obj && obj_type==ObjectType::View) + aux_obj=model->getObject(obj_name, ObjectType::Table); aux_obj1=model->getObject(object->getSignature(), obj_type); new_obj=(!aux_obj && !aux_obj1); @@ -758,7 +758,7 @@ void BaseObjectWidget::applyConfiguration(void) } //Renames the object (only cast object aren't renamed) - if(obj_type!=ObjectType::ObjCast) + if(obj_type!=ObjectType::Cast) { prev_name=object->getName(); object->setName(name_edt->text().trimmed().toUtf8()); @@ -819,10 +819,10 @@ void BaseObjectWidget::finishConfiguration(void) if(table && TableObject::isTableObject(obj_type)) table->addObject(this->object); //Adding the object on the relationship, if specified - else if(relationship && (obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint)) + else if(relationship && (obj_type==ObjectType::Column || obj_type==ObjectType::Constraint)) relationship->addObject(dynamic_cast(this->object)); //Adding the object on the model - else if(obj_type!=ObjectType::ObjParameter) + else if(obj_type!=ObjectType::Parameter) model->addObject(this->object); registerNewObject(); @@ -831,7 +831,7 @@ void BaseObjectWidget::finishConfiguration(void) else { //If the object is being updated, validates its SQL definition - if(obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjTextbox || obj_type==ObjectType::ObjTag) + if(obj_type==ObjectType::BaseRelationship || obj_type==ObjectType::Textbox || obj_type==ObjectType::Tag) this->object->getCodeDefinition(SchemaParser::XmlDefinition); else this->object->getCodeDefinition(SchemaParser::SqlDefinition); @@ -842,7 +842,7 @@ void BaseObjectWidget::finishConfiguration(void) { obj->setCodeInvalidated(true); - if(obj->getObjectType()==ObjectType::ObjColumn) + if(obj->getObjectType()==ObjectType::Column) dynamic_cast(obj)->getParentTable()->setModified(true); } @@ -851,7 +851,7 @@ void BaseObjectWidget::finishConfiguration(void) //If the object is graphical (or a table object), updates it (or its parent) on the scene if(graph_obj || tab_obj) { - if(!graph_obj && tab_obj && tab_obj->getObjectType()!=ObjectType::ObjParameter) + if(!graph_obj && tab_obj && tab_obj->getObjectType()!=ObjectType::Parameter) { if(this->table) graph_obj=dynamic_cast(this->table); @@ -920,9 +920,9 @@ void BaseObjectWidget::cancelConfiguration(void) else if(relationship && relationship->getObjectIndex(tab_obj) >= 0) relationship->removeObject(tab_obj); - if(obj_type!=ObjectType::ObjTable && - obj_type!=ObjectType::ObjView && - obj_type!=ObjectType::ObjRelationship) + if(obj_type!=ObjectType::Table && + obj_type!=ObjectType::View && + obj_type!=ObjectType::Relationship) { if(!op_list->isObjectRegistered(this->object, Operation::ObjectCreated)) delete(this->object); @@ -933,8 +933,8 @@ void BaseObjectWidget::cancelConfiguration(void) //If the object is not a new one, restore its previous state if(op_list && - ((!new_object && obj_type!=ObjectType::ObjDatabase && obj_type!=ObjectType::ObjPermission && operation_count != op_list->getCurrentSize()) || - (new_object && (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView || obj_type==ObjectType::ObjRelationship)))) + ((!new_object && obj_type!=ObjectType::Database && obj_type!=ObjectType::Permission && operation_count != op_list->getCurrentSize()) || + (new_object && (obj_type==ObjectType::Table || obj_type==ObjectType::View || obj_type==ObjectType::Relationship)))) { try { diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index ac8f5c36f0..9b58783220 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -106,7 +106,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { /*! \brief Merges the specified grid layout with the 'baseobject_grid' creating a single form. The obj_type parameter must be specified to show the object type icon */ - void configureFormLayout(QGridLayout *grid=nullptr, ObjectType obj_type=ObjectType::ObjBaseObject); + void configureFormLayout(QGridLayout *grid=nullptr, ObjectType obj_type=ObjectType::BaseObject); /*! \brief Starts a object configuration, alocating a new one if necessary, registering the object on the operation list. This method doens't applies to database model edition */ @@ -144,7 +144,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { VERSIONS_INTERVAL=1, AFTER_VERSION=2; - BaseObjectWidget(QWidget * parent = 0, ObjectType obj_type=ObjectType::ObjBaseObject); + BaseObjectWidget(QWidget * parent = 0, ObjectType obj_type=ObjectType::BaseObject); virtual ~BaseObjectWidget(void); @@ -207,7 +207,7 @@ void BaseObjectWidget::startConfiguration(void) //! \brief If the object is already allocated if(this->object && op_list && - this->object->getObjectType()!=ObjectType::ObjDatabase) + this->object->getObjectType()!=ObjectType::Database) { if(this->table) op_list->registerObject(this->object, Operation::ObjectModified, -1, this->table); diff --git a/libpgmodeler_ui/src/castwidget.cpp b/libpgmodeler_ui/src/castwidget.cpp index 14ae5892e2..7b99a635b4 100644 --- a/libpgmodeler_ui/src/castwidget.cpp +++ b/libpgmodeler_ui/src/castwidget.cpp @@ -18,7 +18,7 @@ #include "castwidget.h" -CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjCast) +CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Cast) { try { @@ -30,13 +30,13 @@ CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob src_datatype=new PgSQLTypeWidget(this, trUtf8("Source data type")); trg_datatype=new PgSQLTypeWidget(this, trUtf8("Target data type")); - conv_func_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + conv_func_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); cast_grid->addWidget(conv_func_sel,1,1,1,4); cast_grid->addWidget(src_datatype,2,0,1,5); cast_grid->addWidget(trg_datatype,3,0,1,5); - configureFormLayout(cast_grid, ObjectType::ObjCast); + configureFormLayout(cast_grid, ObjectType::Cast); name_edt->setReadOnly(true); font=name_edt->font(); diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 5b02b3ff2c..9a894176bb 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -282,12 +282,12 @@ void CodeCompletionWidget::populateNameList(vector &objects, QStri obj_name.clear(); //Formatting the object name according to the object type - if(obj_type==ObjectType::ObjFunction) + if(obj_type==ObjectType::Function) { dynamic_cast(objects[i])->createSignature(false); obj_name=dynamic_cast(objects[i])->getSignature(); } - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) obj_name=dynamic_cast(objects[i])->getSignature(false); else obj_name+=objects[i]->getName(false, false); @@ -319,10 +319,10 @@ void CodeCompletionWidget::setQualifyingLevel(BaseObject *obj) { if(!obj) qualifying_level=-1; - else if(obj->getObjectType()==ObjectType::ObjSchema) + else if(obj->getObjectType()==ObjectType::Schema) qualifying_level=0; - else if(obj->getObjectType()==ObjectType::ObjTable || - obj->getObjectType()==ObjectType::ObjView) + else if(obj->getObjectType()==ObjectType::Table || + obj->getObjectType()==ObjectType::View) qualifying_level=1; else qualifying_level=2; @@ -344,7 +344,7 @@ void CodeCompletionWidget::updateList(void) QString pattern; QStringList list; vector objects; - vector types=BaseObject::getObjectTypes(false, { ObjectType::ObjTextbox, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); + vector types=BaseObject::getObjectTypes(false, { ObjectType::Textbox, ObjectType::Relationship, ObjectType::BaseRelationship }); QTextCursor tc; name_list->clear(); @@ -373,7 +373,7 @@ void CodeCompletionWidget::updateList(void) word.remove(completion_trigger); word.remove('"'); - objects=db_model->findObjects(word, { ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView }, false, false, false, true); + objects=db_model->findObjects(word, { ObjectType::Schema, ObjectType::Table, ObjectType::View }, false, false, false, true); if(objects.size()==1) setQualifyingLevel(objects[0]); @@ -587,9 +587,9 @@ void CodeCompletionWidget::insertObjectName(BaseObject *obj) if(modify_name && - (obj_type==ObjectType::ObjTable || TableObject::isTableObject(obj_type))) + (obj_type==ObjectType::Table || TableObject::isTableObject(obj_type))) { - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) { Table *tab=dynamic_cast
(obj); @@ -611,17 +611,17 @@ void CodeCompletionWidget::insertObjectName(BaseObject *obj) code_field_txt->setTextCursor(lvl_cur); } } - else if(obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Function) { Function *func=dynamic_cast(obj); func->createSignature(true, sch_qualified); name=func->getSignature(); } - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) { name.replace(',', QLatin1String(" AS ")); } - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) { Aggregate *agg; agg=dynamic_cast(obj); diff --git a/libpgmodeler_ui/src/collationwidget.cpp b/libpgmodeler_ui/src/collationwidget.cpp index c6629e1489..2d75c6dfe6 100644 --- a/libpgmodeler_ui/src/collationwidget.cpp +++ b/libpgmodeler_ui/src/collationwidget.cpp @@ -18,7 +18,7 @@ #include "collationwidget.h" -CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjCollation) +CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Collation) { try { @@ -32,7 +32,7 @@ CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, Obje collation_grid->addItem(new QSpacerItem(10,10, QSizePolicy::Minimum,QSizePolicy::Expanding), collation_grid->count()+1, 0, 1, 0); collation_grid->addWidget(frame, collation_grid->count()+1, 0, 1, 0); frame->setParent(this); - configureFormLayout(collation_grid, ObjectType::ObjCollation); + configureFormLayout(collation_grid, ObjectType::Collation); //Configures the encoding combobox EncodingType::getTypes(encodings); diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 5421b8286c..ad64fb293a 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -21,7 +21,7 @@ #include "baseform.h" #include "generalconfigwidget.h" -ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjColumn) +ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Column) { try { @@ -41,7 +41,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType hl_default_value=new SyntaxHighlighter(def_value_txt, true); hl_default_value->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - sequence_sel=new ObjectSelectorWidget(ObjectType::ObjSequence, true, this); + sequence_sel=new ObjectSelectorWidget(ObjectType::Sequence, true, this); sequence_sel->setEnabled(false); column_grid->addWidget(data_type,0,0,1,0); @@ -50,7 +50,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType column_grid->addItem(spacer,column_grid->count(),0); dynamic_cast(default_value_grp->layout())->addWidget(sequence_sel, 1, 1, 1, 6); - configureFormLayout(column_grid, ObjectType::ObjColumn); + configureFormLayout(column_grid, ObjectType::Column); configureTabOrder({ data_type }); map > fields_map; @@ -148,7 +148,7 @@ void ColumnWidget::editSequenceAttributes(void) schema = this->model->getSchema("public"); ident_col_seq.setName(QString("%1_%2_seq").arg(table ? table->getName() : QString()).arg(col ? col->getName() : QString("new_column"))); - ident_col_seq.setName(PgModelerNs::generateUniqueName(&ident_col_seq, *model->getObjectList(ObjectType::ObjSequence), false)); + ident_col_seq.setName(PgModelerNs::generateUniqueName(&ident_col_seq, *model->getObjectList(ObjectType::Sequence), false)); ident_col_seq.setSchema(schema); if(col) diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 5ead7dadcb..2f1cb106a9 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -18,7 +18,7 @@ #include "constraintwidget.h" -ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjConstraint) +ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Constraint) { try { @@ -48,7 +48,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob ObjectsTableWidget::UpdateButton | ObjectsTableWidget::DuplicateButton), true, this); - ref_table_sel=new ObjectSelectorWidget(ObjectType::ObjTable, true, this); + ref_table_sel=new ObjectSelectorWidget(ObjectType::Table, true, this); columns_tab->setColumnCount(2); columns_tab->setHeaderLabel(trUtf8("Column"), 0); @@ -67,7 +67,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob dynamic_cast(columns_tbw->widget(1)->layout())->addWidget(ref_table_sel, 0,1,1,2); dynamic_cast(columns_tbw->widget(1)->layout())->addWidget(ref_columns_tab, 3,0,1,3); - configureFormLayout(constraint_grid, ObjectType::ObjConstraint); + configureFormLayout(constraint_grid, ObjectType::Constraint); ConstraintType::getTypes(list); constr_type_cmb->addItems(list); @@ -359,7 +359,7 @@ void ConstraintWidget::setAttributes(DatabaseModel *model, OperationList *op_lis throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); obj_type=parent_obj->getObjectType(); - if(obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjRelationship) + if(obj_type!=ObjectType::Table && obj_type!=ObjectType::Relationship) throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); BaseObjectWidget::setAttributes(model, op_list, constr, parent_obj); diff --git a/libpgmodeler_ui/src/conversionwidget.cpp b/libpgmodeler_ui/src/conversionwidget.cpp index ba41fbd38e..d5a59700a4 100644 --- a/libpgmodeler_ui/src/conversionwidget.cpp +++ b/libpgmodeler_ui/src/conversionwidget.cpp @@ -18,7 +18,7 @@ #include "conversionwidget.h" -ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjConversion) +ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Conversion) { try { @@ -28,7 +28,7 @@ ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, Ob Ui_ConversionWidget::setupUi(this); conv_func_sel=nullptr; - conv_func_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + conv_func_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); convcod_grid->addWidget(conv_func_sel,1,1,1,3); setRequiredField(src_encoding_lbl); @@ -36,7 +36,7 @@ ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, Ob setRequiredField(conv_func_lbl); setRequiredField(conv_func_sel); - configureFormLayout(convcod_grid, ObjectType::ObjConversion); + configureFormLayout(convcod_grid, ObjectType::Conversion); frame=generateInformationFrame(trUtf8("The function to be assigned to an encoding conversion must have the following signature: void function(integer, integer, cstring, internal, integer).")); convcod_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), convcod_grid->count()+1, 0, 1, 0); convcod_grid->addWidget(frame, convcod_grid->count()+1, 0, 1, 0); diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index 915d842eae..13460bff9d 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -26,7 +26,7 @@ CustomSQLWidget::CustomSQLWidget(QWidget *parent) : BaseObjectWidget(parent) QFont font; Ui_CustomSQLWidget::setupUi(this); - configureFormLayout(sqlappend_grid, ObjectType::ObjBaseObject); + configureFormLayout(sqlappend_grid, ObjectType::BaseObject); append_sql_txt=PgModelerUiNs::createNumberedTextEditor(append_sql_wgt, true); prepend_sql_txt=PgModelerUiNs::createNumberedTextEditor(prepend_sql_wgt, true); @@ -106,9 +106,9 @@ void CustomSQLWidget::configureMenus(void) for(int i=0; i < count; i++) btns[i]->setMenu(nullptr); - if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) + if(obj_type==ObjectType::Table || obj_type==ObjectType::View) { - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) { insert_tb->setMenu(&insert_menu); delete_tb->setMenu(&delete_menu); @@ -132,7 +132,7 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) name_edt->setText(QString("%1 (%2)").arg(object->getSignature()).arg(object->getTypeName())); - if(object->getObjectType()==ObjectType::ObjDatabase) + if(object->getObjectType()==ObjectType::Database) end_of_model_chk->setChecked(dynamic_cast(object)->isAppendAtEOD()); append_sql_txt->setFocus(); @@ -145,8 +145,8 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) prepend_sql_cp->configureCompletion(model, prepend_sql_hl); prepend_sql_txt->moveCursor(QTextCursor::End); - end_of_model_chk->setVisible(object->getObjectType()==ObjectType::ObjDatabase); - begin_of_model_chk->setVisible(object->getObjectType()==ObjectType::ObjDatabase); + end_of_model_chk->setVisible(object->getObjectType()==ObjectType::Database); + begin_of_model_chk->setVisible(object->getObjectType()==ObjectType::Database); protected_obj_frm->setVisible(false); obj_id_lbl->setVisible(false); @@ -164,7 +164,7 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) void CustomSQLWidget::applyConfiguration(void) { - if(this->object->getObjectType()==ObjectType::ObjDatabase) + if(this->object->getObjectType()==ObjectType::Database) { dynamic_cast(this->object)->setAppendAtEOD(end_of_model_chk->isChecked()); dynamic_cast(this->object)->setPrependAtBOD(begin_of_model_chk->isChecked()); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 478bf89e83..b830d4e59d 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -195,7 +195,7 @@ DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); unsigned oid=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); - if((obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && oid > 0 && item->childCount() <= 1) + if((obj_type==ObjectType::Schema || obj_type==ObjectType::Table || obj_type==ObjectType::View) && oid > 0 && item->childCount() <= 1) { updateItem(item); } @@ -236,17 +236,17 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) if(k_event->key()==Qt::Key_Space) { QTreeWidgetItem *item=objects_trw->currentItem(); - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; if(item) { unsigned oid=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); - if(oid!=0 && (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView)) + if(oid!=0 && (obj_type==ObjectType::Table || obj_type==ObjectType::View)) { openDataGrid(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), - item->text(0), obj_type!=ObjectType::ObjView); + item->text(0), obj_type!=ObjectType::View); } } } @@ -274,15 +274,15 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; attribs_map fmt_attribs; QString attr_name, attr_value; QRegExp oid_regexp=QRegExp(QString("^[0-9]+")); - map dep_types={{ParsersAttributes::OWNER, ObjectType::ObjRole}, - {ParsersAttributes::SCHEMA, ObjectType::ObjSchema}, - {ParsersAttributes::TABLESPACE, ObjectType::ObjTablespace}, - {ParsersAttributes::COLLATION, ObjectType::ObjCollation}, - {ParsersAttributes::TABLE, ObjectType::ObjTable}}; + map dep_types={{ParsersAttributes::OWNER, ObjectType::Role}, + {ParsersAttributes::SCHEMA, ObjectType::Schema}, + {ParsersAttributes::TABLESPACE, ObjectType::Tablespace}, + {ParsersAttributes::COLLATION, ObjectType::Collation}, + {ParsersAttributes::TABLE, ObjectType::Table}}; if(attribs.count(ParsersAttributes::OBJECT_TYPE)!=0) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); @@ -291,27 +291,27 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) { switch(obj_type) { - case ObjectType::ObjCast: formatCastAttribs(attribs); break; - case ObjectType::ObjEventTrigger: formatEventTriggerAttribs(attribs); break; - case ObjectType::ObjLanguage: formatLanguageAttribs(attribs); break; - case ObjectType::ObjRole: formatRoleAttribs(attribs); break; - case ObjectType::ObjAggregate: formatAggregateAttribs(attribs); break; - case ObjectType::ObjConversion: formatConversionAttribs(attribs); break; - case ObjectType::ObjDomain: formatDomainAttribs(attribs); break; - case ObjectType::ObjExtension: formatExtensionAttribs(attribs); break; - case ObjectType::ObjFunction: formatFunctionAttribs(attribs); break; - case ObjectType::ObjOperator: formatOperatorAttribs(attribs); break; - case ObjectType::ObjOpClass: formatOperatorClassAttribs(attribs); break; - case ObjectType::ObjTable: formatTableAttribs(attribs); break; - case ObjectType::ObjSequence: formatSequenceAttribs(attribs); break; - case ObjectType::ObjType: formatTypeAttribs(attribs); break; - case ObjectType::ObjView: formatViewAttribs(attribs); break; - case ObjectType::ObjTrigger: formatTriggerAttribs(attribs); break; - case ObjectType::ObjRule: formatRuleAttribs(attribs); break; - case ObjectType::ObjColumn: formatColumnAttribs(attribs); break; - case ObjectType::ObjConstraint: formatConstraintAttribs(attribs); break; - case ObjectType::ObjIndex: formatIndexAttribs(attribs); break; - case ObjectType::ObjPolicy: formatPolicyAttribs(attribs); break; + case ObjectType::Cast: formatCastAttribs(attribs); break; + case ObjectType::EventTrigger: formatEventTriggerAttribs(attribs); break; + case ObjectType::Language: formatLanguageAttribs(attribs); break; + case ObjectType::Role: formatRoleAttribs(attribs); break; + case ObjectType::Aggregate: formatAggregateAttribs(attribs); break; + case ObjectType::Conversion: formatConversionAttribs(attribs); break; + case ObjectType::Domain: formatDomainAttribs(attribs); break; + case ObjectType::Extension: formatExtensionAttribs(attribs); break; + case ObjectType::Function: formatFunctionAttribs(attribs); break; + case ObjectType::Operator: formatOperatorAttribs(attribs); break; + case ObjectType::OpClass: formatOperatorClassAttribs(attribs); break; + case ObjectType::Table: formatTableAttribs(attribs); break; + case ObjectType::Sequence: formatSequenceAttribs(attribs); break; + case ObjectType::Type: formatTypeAttribs(attribs); break; + case ObjectType::View: formatViewAttribs(attribs); break; + case ObjectType::Trigger: formatTriggerAttribs(attribs); break; + case ObjectType::Rule: formatRuleAttribs(attribs); break; + case ObjectType::Column: formatColumnAttribs(attribs); break; + case ObjectType::Constraint: formatConstraintAttribs(attribs); break; + case ObjectType::Index: formatIndexAttribs(attribs); break; + case ObjectType::Policy: formatPolicyAttribs(attribs); break; default: break; } } @@ -408,29 +408,29 @@ void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { ParsersAttributes::IO_CAST }); formatOidAttribs(attribs, { ParsersAttributes::DEST_TYPE, - ParsersAttributes::SOURCE_TYPE }, ObjectType::ObjType, false); + ParsersAttributes::SOURCE_TYPE }, ObjectType::Type, false); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::ObjFunction, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatEventTriggerAttribs(attribs_map &attribs) { attribs[ParsersAttributes::VALUES]=Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES]).join(ElemSeparator); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::ObjFunction, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { ParsersAttributes::FINAL_FUNC, - ParsersAttributes::TRANSITION_FUNC }, ObjectType::ObjFunction, false); + ParsersAttributes::TRANSITION_FUNC }, ObjectType::Function, false); - formatOidAttribs(attribs, { ParsersAttributes::TYPES }, ObjectType::ObjType, true); + formatOidAttribs(attribs, { ParsersAttributes::TYPES }, ObjectType::Type, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) .arg(attribs[ParsersAttributes::TYPES])).replace(ElemSeparator, QString(",")); - attribs[ParsersAttributes::STATE_TYPE]=getObjectName(ObjectType::ObjType, attribs[ParsersAttributes::STATE_TYPE]); - attribs[ParsersAttributes::SORT_OP]=getObjectName(ObjectType::ObjOperator, attribs[ParsersAttributes::SORT_OP]); + attribs[ParsersAttributes::STATE_TYPE]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::STATE_TYPE]); + attribs[ParsersAttributes::SORT_OP]=getObjectName(ObjectType::Operator, attribs[ParsersAttributes::SORT_OP]); attribs[ParsersAttributes::INITIAL_COND]=Catalog::parseArrayValues(attribs[ParsersAttributes::INITIAL_COND]).join(ElemSeparator); } @@ -440,14 +440,14 @@ void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) formatOidAttribs(attribs, { ParsersAttributes::VALIDATOR_FUNC, ParsersAttributes::HANDLER_FUNC, - ParsersAttributes::INLINE_FUNC }, ObjectType::ObjFunction, false); + ParsersAttributes::INLINE_FUNC }, ObjectType::Function, false); } void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { ParsersAttributes::ADMIN_ROLES, ParsersAttributes::MEMBER_ROLES, - ParsersAttributes::REF_ROLES }, ObjectType::ObjRole, true); + ParsersAttributes::REF_ROLES }, ObjectType::Role, true); formatBooleanAttribs(attribs, { ParsersAttributes::SUPERUSER, ParsersAttributes::INHERIT, ParsersAttributes::CREATEROLE, ParsersAttributes::CREATEDB, @@ -458,13 +458,13 @@ void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { ParsersAttributes::DEFAULT }); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::ObjFunction, attribs[ParsersAttributes::FUNCTION]); + attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::FUNCTION]); } void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { ParsersAttributes::NOT_NULL }); - attribs[ParsersAttributes::TYPE]=getObjectName(ObjectType::ObjType, attribs[ParsersAttributes::TYPE]); + attribs[ParsersAttributes::TYPE]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::TYPE]); } void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) @@ -474,13 +474,13 @@ void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::LANGUAGE]=getObjectName(ObjectType::ObjLanguage, attribs[ParsersAttributes::LANGUAGE]); - attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(ObjectType::ObjType, attribs[ParsersAttributes::RETURN_TYPE]); + attribs[ParsersAttributes::LANGUAGE]=getObjectName(ObjectType::Language, attribs[ParsersAttributes::LANGUAGE]); + attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::RETURN_TYPE]); attribs[ParsersAttributes::ARG_NAMES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_NAMES]).join(ElemSeparator); attribs[ParsersAttributes::ARG_MODES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_MODES]).join(ElemSeparator); attribs[ParsersAttributes::ARG_DEFAULTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_DEFAULTS]).join(ElemSeparator); - formatOidAttribs(attribs, { ParsersAttributes::ARG_TYPES }, ObjectType::ObjType, true); + formatOidAttribs(attribs, { ParsersAttributes::ARG_TYPES }, ObjectType::Type, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) .arg(attribs[ParsersAttributes::ARG_TYPES])).replace(ElemSeparator, QString(",")); @@ -496,14 +496,14 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) ParsersAttributes::MERGES }); formatOidAttribs(attribs, { ParsersAttributes::LEFT_TYPE, - ParsersAttributes::RIGHT_TYPE}, ObjectType::ObjType, false); + ParsersAttributes::RIGHT_TYPE}, ObjectType::Type, false); formatOidAttribs(attribs, { ParsersAttributes::COMMUTATOR_OP, - ParsersAttributes::NEGATOR_OP}, ObjectType::ObjOperator, false); + ParsersAttributes::NEGATOR_OP}, ObjectType::Operator, false); formatOidAttribs(attribs, { ParsersAttributes::OPERATOR_FUNC, ParsersAttributes::RESTRICTION_FUNC, - ParsersAttributes::JOIN_FUNC }, ObjectType::ObjFunction, false); + ParsersAttributes::JOIN_FUNC }, ObjectType::Function, false); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2,%3)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME], true)) @@ -520,12 +520,12 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) ParsersAttributes::RLS_ENABLED, ParsersAttributes::RLS_FORCED}); - formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, ObjectType::ObjTable, true); - formatOidAttribs(attribs, { ParsersAttributes::PARTITIONED_TABLE }, ObjectType::ObjTable, false); + formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, ObjectType::Table, true); + formatOidAttribs(attribs, { ParsersAttributes::PARTITIONED_TABLE }, ObjectType::Table, false); - part_keys.push_back(getObjectsNames(ObjectType::ObjColumn, + part_keys.push_back(getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]), - getObjectName(ObjectType::ObjSchema, attribs[ParsersAttributes::SCHEMA]), + getObjectName(ObjectType::Schema, attribs[ParsersAttributes::SCHEMA]), attribs[ParsersAttributes::NAME]).join(ElemSeparator)); part_keys.push_back(Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator)); @@ -545,7 +545,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) seq_attrs={ ParsersAttributes::START, ParsersAttributes::MIN_VALUE, ParsersAttributes::MAX_VALUE, ParsersAttributes::INCREMENT, ParsersAttributes::CACHE, ParsersAttributes::CYCLE }; - QString sch_name=getObjectName(ObjectType::ObjSchema, attribs[ParsersAttributes::SCHEMA]); + QString sch_name=getObjectName(ObjectType::Schema, attribs[ParsersAttributes::SCHEMA]); attribs.erase(ParsersAttributes::ATTRIBUTE); for(int i=0; i < seq_values.size(); i++) @@ -556,8 +556,8 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) owner_col=attribs[ParsersAttributes::OWNER_COLUMN].split(':'); if(owner_col.size()==2) { - QStringList names=getObjectName(ObjectType::ObjTable, owner_col[0]).split('.'); - vector col_attribs=catalog.getObjectsAttributes(ObjectType::ObjColumn, names[0], names[1], { owner_col[1].toUInt() }); + QStringList names=getObjectName(ObjectType::Table, owner_col[0]).split('.'); + vector col_attribs=catalog.getObjectsAttributes(ObjectType::Column, names[0], names[1], { owner_col[1].toUInt() }); if(!col_attribs.empty()) attribs[ParsersAttributes::OWNER_COLUMN]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(ParsersAttributes::NAME)); @@ -602,8 +602,8 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) ParsersAttributes::RECV_FUNC, ParsersAttributes::SEND_FUNC, ParsersAttributes::TPMOD_IN_FUNC, - ParsersAttributes::TPMOD_OUT_FUNC }, ObjectType::ObjFunction, false); - attribs[ParsersAttributes::ELEMENT]=getObjectName(ObjectType::ObjType, attribs[ParsersAttributes::ELEMENT]); + ParsersAttributes::TPMOD_OUT_FUNC }, ObjectType::Function, false); + attribs[ParsersAttributes::ELEMENT]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::ELEMENT]); if(attribs[ParsersAttributes::ENUMERATIONS].isEmpty()) attribs.erase(ParsersAttributes::ENUMERATIONS); @@ -613,11 +613,11 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) attribs.erase(ParsersAttributes::RANGE_ATTRIBS); if(!range_attr.isEmpty()) { - attribs[ParsersAttributes::SUBTYPE]=getObjectName(ObjectType::ObjType, range_attr[0]); - attribs[ParsersAttributes::COLLATION]=getObjectName(ObjectType::ObjCollation, range_attr[1]); - attribs[ParsersAttributes::OP_CLASS]=getObjectName(ObjectType::ObjOpClass, range_attr[2]); - attribs[ParsersAttributes::CANONICAL_FUNC]=getObjectName(ObjectType::ObjFunction, range_attr[3]); - attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjectType::ObjFunction, range_attr[4]); + attribs[ParsersAttributes::SUBTYPE]=getObjectName(ObjectType::Type, range_attr[0]); + attribs[ParsersAttributes::COLLATION]=getObjectName(ObjectType::Collation, range_attr[1]); + attribs[ParsersAttributes::OP_CLASS]=getObjectName(ObjectType::OpClass, range_attr[2]); + attribs[ParsersAttributes::CANONICAL_FUNC]=getObjectName(ObjectType::Function, range_attr[3]); + attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjectType::Function, range_attr[4]); } if(!type_attr.isEmpty()) @@ -641,10 +641,10 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) { QStringList list, array_vals, elems; - attribs[ParsersAttributes::FAMILY]=getObjectName(ObjectType::ObjOpFamily, attribs[ParsersAttributes::FAMILY]); + attribs[ParsersAttributes::FAMILY]=getObjectName(ObjectType::OpFamily, attribs[ParsersAttributes::FAMILY]); formatBooleanAttribs(attribs, { ParsersAttributes::DEFAULT }); formatOidAttribs(attribs, { ParsersAttributes::STORAGE, - ParsersAttributes::TYPE }, ObjectType::ObjType, false); + ParsersAttributes::TYPE }, ObjectType::Type, false); array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::FUNCTION]); @@ -653,7 +653,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) for(int i=0; i < array_vals.size(); i++) { list=array_vals[i].split(':'); - elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(ObjectType::ObjFunction, list[1]))); + elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(ObjectType::Function, list[1]))); } attribs[ParsersAttributes::FUNCTION]=elems.join(ElemSeparator); @@ -669,8 +669,8 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) list=array_vals[i].split(':'); elems.push_back(QString("[%1] [%2] [%3]") .arg(list[0], - getObjectName(ObjectType::ObjOperator, list[1]), - getObjectName(ObjectType::ObjOperator, list[2]))); + getObjectName(ObjectType::Operator, list[1]), + getObjectName(ObjectType::Operator, list[2]))); } attribs[ParsersAttributes::OPERATOR]=elems.join(ElemSeparator); @@ -688,7 +688,7 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) ParsersAttributes::UPD_EVENT, ParsersAttributes::TRUNC_EVENT }); - attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(ObjectType::ObjFunction, attribs[ParsersAttributes::TRIGGER_FUNC]); + attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::TRIGGER_FUNC]); attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS]).join(ElemSeparator); attribs[ParsersAttributes::COLUMNS]=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]).join(ElemSeparator); } @@ -716,22 +716,22 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) {ParsersAttributes::EX_CONSTR, ConstraintType(ConstraintType::Exclude)}}; ConstraintType constr_type=types[attribs[ParsersAttributes::TYPE]]; - QStringList names=getObjectName(ObjectType::ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); + QStringList names=getObjectName(ObjectType::Table, attribs[ParsersAttributes::TABLE]).split('.'); formatBooleanAttribs(attribs, { ParsersAttributes::DEFERRABLE, ParsersAttributes::NO_INHERIT }); attribs[ParsersAttributes::TYPE]=~types[attribs[ParsersAttributes::TYPE]]; - attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjectType::ObjOpClass, + attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ElemSeparator); - attribs[ParsersAttributes::SRC_COLUMNS]=getObjectsNames(ObjectType::ObjColumn, + attribs[ParsersAttributes::SRC_COLUMNS]=getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[ParsersAttributes::SRC_COLUMNS]), names[0], names[1]).join(ElemSeparator); if(constr_type==ConstraintType::ForeignKey) { - attribs[ParsersAttributes::REF_TABLE]=getObjectName(ObjectType::ObjTable, attribs[ParsersAttributes::REF_TABLE]); + attribs[ParsersAttributes::REF_TABLE]=getObjectName(ObjectType::Table, attribs[ParsersAttributes::REF_TABLE]); names=attribs[ParsersAttributes::REF_TABLE].split('.'); - attribs[ParsersAttributes::DST_COLUMNS]=getObjectsNames(ObjectType::ObjColumn, + attribs[ParsersAttributes::DST_COLUMNS]=getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[ParsersAttributes::DST_COLUMNS]), names[0], names[1]).join(ElemSeparator); } @@ -755,7 +755,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) if(constr_type==ConstraintType::Exclude) { attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); - attribs[ParsersAttributes::OPERATORS]=getObjectsNames(ObjectType::ObjOperator, + attribs[ParsersAttributes::OPERATORS]=getObjectsNames(ObjectType::Operator, Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATORS])).join(ElemSeparator); } else @@ -768,28 +768,28 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) { - QStringList names=getObjectName(ObjectType::ObjTable, attribs[ParsersAttributes::TABLE]).split('.'); + QStringList names=getObjectName(ObjectType::Table, attribs[ParsersAttributes::TABLE]).split('.'); if(names.isEmpty() || names.size() == 1) - names=getObjectName(ObjectType::ObjView, attribs[ParsersAttributes::TABLE]).split('.'); + names=getObjectName(ObjectType::View, attribs[ParsersAttributes::TABLE]).split('.'); formatBooleanAttribs(attribs, { ParsersAttributes::UNIQUE }); attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); - attribs[ParsersAttributes::COLLATIONS]=getObjectsNames(ObjectType::ObjCollation, + attribs[ParsersAttributes::COLLATIONS]=getObjectsNames(ObjectType::Collation, Catalog::parseArrayValues(attribs[ParsersAttributes::COLLATIONS])).join(ElemSeparator); - attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjectType::ObjOpClass, + attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ElemSeparator); - attribs[ParsersAttributes::COLUMNS]=getObjectsNames(ObjectType::ObjColumn, + attribs[ParsersAttributes::COLUMNS]=getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]), names[0], names[1]).join(ElemSeparator); } void DatabaseExplorerWidget::formatPolicyAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::ROLES] = getObjectsNames(ObjectType::ObjRole, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ElemSeparator); + attribs[ParsersAttributes::ROLES] = getObjectsNames(ObjectType::Role, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ElemSeparator); } QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) @@ -808,8 +808,8 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) QString oid=attribs[ParsersAttributes::OID], obj_name=DepNotFound.arg(oid), sch_name; - if(obj_type!=ObjectType::ObjType) - obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME], obj_type==ObjectType::ObjOperator); + if(obj_type!=ObjectType::Type) + obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME], obj_type==ObjectType::Operator); else obj_name=attribs[ParsersAttributes::NAME]; @@ -817,7 +817,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) if(!attribs[ParsersAttributes::SCHEMA].isEmpty() && attribs[ParsersAttributes::SCHEMA]!=QString("0")) { - aux_attribs=catalog.getObjectAttributes(ObjectType::ObjSchema, attribs[ParsersAttributes::SCHEMA].toUInt()); + aux_attribs=catalog.getObjectAttributes(ObjectType::Schema, attribs[ParsersAttributes::SCHEMA].toUInt()); sch_name=BaseObject::formatName(aux_attribs[ParsersAttributes::NAME], false); if(!sch_name.isEmpty()) @@ -825,20 +825,20 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) } //Formatting paramenter types for function - if(obj_type==ObjectType::ObjFunction) + if(obj_type==ObjectType::Function) { QStringList names, arg_types=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_TYPES]); for(int idx=0; idx < arg_types.size(); idx++) { - names=getObjectName(ObjectType::ObjType, arg_types[idx]).split('.'); + names=getObjectName(ObjectType::Type, arg_types[idx]).split('.'); arg_types[idx]=names[names.size()-1]; } obj_name+=QString("(%1)").arg(arg_types.join(',')); } //Formatting paramenter types for operator - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) { QStringList arg_types, names; QString type_name; @@ -846,7 +846,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) for(QString attr : attrib_ids) { - names=getObjectName(ObjectType::ObjType, attribs[attr]).split('.'); + names=getObjectName(ObjectType::Type, attribs[attr]).split('.'); type_name=names[names.size()-1]; if(type_name.isEmpty()) type_name=QString("-"); @@ -962,7 +962,7 @@ void DatabaseExplorerWidget::listObjects(void) root->setText(0, connection.getConnectionId(true)); root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("server"))); root->setData(DatabaseImportForm::ObjectId, Qt::UserRole, -1); - root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, ~ObjectType::ObjBaseObject); + root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, ~ObjectType::BaseObject); root->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); root->addChild(curr_root); objects_trw->addTopLevelItem(root); @@ -1011,7 +1011,7 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); unsigned obj_id=item->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); - SnippetsConfigWidget::configureSnippetsMenu(&snippets_menu, { obj_type, ObjectType::ObjBaseObject }); + SnippetsConfigWidget::configureSnippetsMenu(&snippets_menu, { obj_type, ObjectType::BaseObject }); for(auto &act : handle_menu.actions()) handle_menu.removeAction(act); @@ -1020,24 +1020,24 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) if(obj_id > 0) { - if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) + if(obj_type==ObjectType::Table || obj_type==ObjectType::View) handle_menu.addAction(show_data_action); handle_menu.addAction(properties_action); handle_menu.addAction(source_action); - if(obj_type!=ObjectType::ObjCast && obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::Cast && obj_type!=ObjectType::Database) handle_menu.addAction(rename_action); - if(obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::Database) { handle_menu.addSeparator(); handle_menu.addAction(drop_action); - if(obj_type!=ObjectType::ObjRole && obj_type!=ObjectType::ObjTablespace) + if(obj_type!=ObjectType::Role && obj_type!=ObjectType::Tablespace) handle_menu.addAction(drop_cascade_action); - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) { handle_menu.addAction(truncate_action); handle_menu.addAction(trunc_cascade_action); @@ -1066,7 +1066,7 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) { openDataGrid(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), item->text(0), - item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt() != ~ObjectType::ObjView); + item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt() != ~ObjectType::View); } else if(exec_action) handleSelectedSnippet(exec_action->text()); @@ -1098,7 +1098,7 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) { QString obj_name; - if(obj_type!=ObjectType::ObjOperator) + if(obj_type!=ObjectType::Operator) obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME]); else obj_name=attribs[ParsersAttributes::NAME]; @@ -1137,7 +1137,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i attribs[BaseObject::getSchemaName(obj_type)]=ParsersAttributes::_TRUE_; //For cast, operator and function is needed to extract the name and the params types - if(obj_type==ObjectType::ObjOperator || obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjCast) + if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function || obj_type==ObjectType::Cast) { idx=obj_name.indexOf('('); idx1=obj_name.indexOf(')'); @@ -1145,26 +1145,26 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i types.removeAll(QString("-")); obj_name.remove(idx, obj_name.size()); } - else if(obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjOpClass) + else if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) obj_name.remove(QRegExp("( )+(\\[)(.)+(\\])")); //Formatting the names - attribs[ParsersAttributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjectType::ObjOperator); + attribs[ParsersAttributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjectType::Operator); attribs[ParsersAttributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); attribs[ParsersAttributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); //For table objects the "table" attribute must be schema qualified - if(obj_type!=ObjectType::ObjIndex && TableObject::isTableObject(obj_type)) + if(obj_type!=ObjectType::Index && TableObject::isTableObject(obj_type)) { attribs[ParsersAttributes::TABLE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::TABLE]; attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::NAME] + QString(" ON %1").arg(attribs[ParsersAttributes::TABLE]); } //For operators and functions there must exist the signature attribute - else if(obj_type==ObjectType::ObjOperator || obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function) attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::NAME] + QString("(%1)").arg(types.join(ElemSeparator)); - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) attribs[ParsersAttributes::SIGNATURE]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); - else if(obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjOpClass) + else if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); attribs[ParsersAttributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[ParsersAttributes::NAME]).arg(aux_attribs[ParsersAttributes::INDEX_TYPE]); @@ -1173,7 +1173,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { /* If we are handling a view we need to append the MATERIALIZED keyword in the sql-object in order * to construct DDL commands correctly for this kind of object */ - if(obj_type==ObjectType::ObjView) + if(obj_type==ObjectType::View) { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); @@ -1181,7 +1181,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { attribs[ParsersAttributes::SQL_OBJECT] = QString("%1 %2").arg(ParsersAttributes::MATERIALIZED.toUpper()) - .arg(BaseObject::getSQLName(ObjectType::ObjView)); + .arg(BaseObject::getSQLName(ObjectType::View)); } } @@ -1208,7 +1208,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) QString obj_name=item->data(DatabaseImportForm::ObjectName, Qt::UserRole).toString(); //Roles and tablespaces can't be removed in cascade mode - if(cascade && (obj_type==ObjectType::ObjRole || obj_type==ObjectType::ObjTablespace)) + if(cascade && (obj_type==ObjectType::Role || obj_type==ObjectType::Tablespace)) return; if(!cascade) @@ -1229,7 +1229,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) attribs=extractAttributesFromItem(item); - if(obj_type==ObjectType::ObjOperator || obj_type==ObjectType::ObjFunction) + if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function) attribs[ParsersAttributes::SIGNATURE].replace(ElemSeparator, QChar(',')); //Generate the drop command @@ -1294,7 +1294,7 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin Connection conn; SchemaParser schparser; - attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(ObjectType::ObjTable); + attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(ObjectType::Table); attribs[ParsersAttributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : ""); attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::_TRUE_ : ""); @@ -1352,7 +1352,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) QApplication::setOverrideCursor(Qt::WaitCursor); - if(obj_type==ObjectType::ObjDatabase) + if(obj_type==ObjectType::Database) listObjects(); else { @@ -1370,12 +1370,12 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) } else { - if(obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjTable || obj_type == ObjectType::ObjView) + if(obj_type==ObjectType::Schema || obj_type==ObjectType::Table || obj_type == ObjectType::View) { root=item; root->takeChildren(); - if(obj_type == ObjectType::ObjSchema) + if(obj_type == ObjectType::Schema) sch_name=item->text(0); else tab_name=item->text(0); @@ -1391,7 +1391,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) configureImportHelper(); //Updates the group type only - if(obj_id==0 || (obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjView && obj_type!=ObjectType::ObjSchema)) + if(obj_id==0 || (obj_type!=ObjectType::Table && obj_type!=ObjectType::View && obj_type!=ObjectType::Schema)) gen_items=DatabaseImportForm::updateObjectsTree(import_helper, objects_trw, { obj_type }, false, false, root, sch_name, tab_name, sort_column); else //Updates all child objcts when the selected object is a schema or table or view @@ -1399,7 +1399,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) BaseObject::getChildObjectTypes(obj_type), false, false, root, sch_name, tab_name, sort_column); //Creating dummy items for schemas and tables - if(obj_type==ObjectType::ObjSchema || obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) + if(obj_type==ObjectType::Schema || obj_type==ObjectType::Table || obj_type==ObjectType::View) { for(auto &item : gen_items) { @@ -1413,7 +1413,7 @@ void DatabaseExplorerWidget::updateItem(QTreeWidgetItem *item) objects_trw->sortItems(sort_column, Qt::AscendingOrder); objects_trw->setCurrentItem(nullptr); - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) { objects_trw->blockSignals(true); objects_trw->setCurrentItem(item); @@ -1452,22 +1452,22 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) if(item == objects_trw->topLevelItem(0)) orig_attribs=catalog.getServerAttributes(); //Retrieve them from the catalog - else if(obj_type!=ObjectType::ObjColumn) + else if(obj_type!=ObjectType::Column) { orig_attribs=catalog.getObjectAttributes(obj_type, oid); - if(obj_type == ObjectType::ObjTable) + if(obj_type == ObjectType::Table) { vector ref_fks; attribs_map ref_table, ref_schema; QStringList tab_list; - ref_fks = catalog.getObjectsAttributes(ObjectType::ObjConstraint, QString(), QString(), {}, {{ ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[ParsersAttributes::OID])}}); + ref_fks = catalog.getObjectsAttributes(ObjectType::Constraint, QString(), QString(), {}, {{ ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[ParsersAttributes::OID])}}); for(auto &fk : ref_fks) { - ref_table = catalog.getObjectAttributes(ObjectType::ObjTable, fk[ParsersAttributes::TABLE].toUInt()); - ref_schema = catalog.getObjectAttributes(ObjectType::ObjSchema, ref_table[ParsersAttributes::SCHEMA].toUInt()); + ref_table = catalog.getObjectAttributes(ObjectType::Table, fk[ParsersAttributes::TABLE].toUInt()); + ref_schema = catalog.getObjectAttributes(ObjectType::Schema, ref_table[ParsersAttributes::SCHEMA].toUInt()); tab_list.push_back(QString("%1.%2").arg(ref_schema[ParsersAttributes::NAME]).arg(ref_table[ParsersAttributes::NAME])); } @@ -1575,7 +1575,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) cached_attribs=item->data(DatabaseImportForm::ObjectOtherData,Qt::UserRole).value(); - if(cached_attribs[ParsersAttributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjectType::ObjConstraint) && item->childCount()==0) + if(cached_attribs[ParsersAttributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjectType::Constraint) && item->childCount()==0) { QTreeWidgetItem *fk_item=nullptr, *src_item=nullptr; @@ -1622,7 +1622,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } } } - else if(cached_attribs[ParsersAttributes::OBJECT_TYPE] == BaseObject::getSchemaName(ObjectType::ObjTable) && + else if(cached_attribs[ParsersAttributes::OBJECT_TYPE] == BaseObject::getSchemaName(ObjectType::Table) && !cached_attribs[ParsersAttributes::REFERRERS].isEmpty() && item->childCount() == 5) { QTreeWidgetItem *refs_item=nullptr, *tab_item=nullptr; @@ -1672,7 +1672,7 @@ void DatabaseExplorerWidget::startObjectRename(QTreeWidgetItem *item) { ObjectType obj_type=static_cast(item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); - if(obj_type!=ObjectType::ObjCast && obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::Cast && obj_type!=ObjectType::Database) { item->setFlags(item->flags() | Qt::ItemIsEditable); objects_trw->openPersistentEditor(item); @@ -1696,7 +1696,7 @@ void DatabaseExplorerWidget::finishObjectRename(void) ObjectType obj_type=static_cast(rename_item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); objects_trw->closePersistentEditor(rename_item); - attribs[ParsersAttributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjectType::ObjOperator); + attribs[ParsersAttributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjectType::Operator); //Generate the drop command schparser.ignoreEmptyAttributes(true); @@ -1772,7 +1772,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) tab_name=item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString(); name=item->data(DatabaseImportForm::ObjectName, Qt::UserRole).toString(); - if(!sch_name.isEmpty() && obj_type!=ObjectType::ObjExtension) + if(!sch_name.isEmpty() && obj_type!=ObjectType::Extension) { if(tab_name.isEmpty()) name.prepend(sch_name + QChar('.')); @@ -1781,11 +1781,11 @@ void DatabaseExplorerWidget::loadObjectSource(void) } //Special case for columns. We will retrieve the table from database and then generate the code for the column - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { oid=item->parent()->parent()->data(DatabaseImportForm::ObjectId, Qt::UserRole).toUInt(); is_column=true; - obj_type=ObjectType::ObjTable; + obj_type=ObjectType::Table; } //Importing the object and its dependencies @@ -1796,12 +1796,12 @@ void DatabaseExplorerWidget::loadObjectSource(void) toggle_disp_menu.actions().at(1)->isChecked(), true, false, false, false, false); - import_hlp.setSelectedOIDs(&dbmodel, {{ObjectType::ObjDatabase, {db_oid}}, {obj_type,{oid}}}, {}); + import_hlp.setSelectedOIDs(&dbmodel, {{ObjectType::Database, {db_oid}}, {obj_type,{oid}}}, {}); sys_oid=import_hlp.getLastSystemOID(); //Currently pgModeler does not support the visualization of base types and built-in ones - if(obj_type==ObjectType::ObjType && + if(obj_type==ObjectType::Type && (oid <= sys_oid || attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BASE_TYPE)) { source=trUtf8("-- Source code genaration for buil-in and base types currently unavailable --"); @@ -1811,13 +1811,13 @@ void DatabaseExplorerWidget::loadObjectSource(void) { import_hlp.importDatabase(); - if(obj_type==ObjectType::ObjDatabase) + if(obj_type==ObjectType::Database) source=getObjectSource(&dbmodel, &dbmodel); else { /* Fixing the signature of opclasses and opfamilies. The name is in form "name [index type]", so we change it to "name USING [index type]" */ - if(obj_type==ObjectType::ObjOpClass || obj_type==ObjectType::ObjOpFamily) + if(obj_type==ObjectType::OpClass || obj_type==ObjectType::OpFamily) { QString idx_type=item->text(0); @@ -1831,7 +1831,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) if(TableObject::isTableObject(obj_type) || is_column) { Table *table=nullptr; - table=dynamic_cast
(dbmodel.getObject(tab_name, ObjectType::ObjTable)); + table=dynamic_cast
(dbmodel.getObject(tab_name, ObjectType::Table)); QTreeWidgetItem *table_item=nullptr; //If the table was imported then the source code of it will be placed on the respective item @@ -1846,7 +1846,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) //Generate the code of table children objects as ALTER commands table->setGenerateAlterCmds(true); - object=table->getObject(name, (is_column ? ObjectType::ObjColumn : obj_type)); + object=table->getObject(name, (is_column ? ObjectType::Column : obj_type)); } } else @@ -1870,7 +1870,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) sch_item->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, getObjectSource(schema, &dbmodel)); } - if(obj_type != ObjectType::ObjDatabase) + if(obj_type != ObjectType::Database) { //Generating the code for the database itself and storing it in the first child of the root item in the tree objects_trw->setCurrentItem(objects_trw->topLevelItem(0)); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index b81449de24..97c688e856 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -145,7 +145,7 @@ void DatabaseImportForm::updateProgress(int progress, QString msg, ObjectType ob progress_lbl->setText(msg); progress_pb->setValue(progress); - if(obj_type!=ObjectType::ObjBaseObject) + if(obj_type!=ObjectType::BaseObject) ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); @@ -203,7 +203,7 @@ void DatabaseImportForm::importDatabase(void) settings_tbw->setCurrentIndex(1); getCheckedItems(obj_oids, col_oids); - obj_oids[ObjectType::ObjDatabase].push_back(database_cmb->itemData(database_cmb->currentIndex()).value()); + obj_oids[ObjectType::Database].push_back(database_cmb->itemData(database_cmb->currentIndex()).value()); if(create_model) { @@ -283,7 +283,7 @@ void DatabaseImportForm::getCheckedItems(map> &obj_ obj_type=static_cast((*itr)->data(ObjectTypeId, Qt::UserRole).value()); //If the object is not a column store it on general object list - if(obj_type!=ObjectType::ObjColumn) + if(obj_type!=ObjectType::Column) obj_oids[obj_type].push_back((*itr)->data(ObjectId, Qt::UserRole).value()); //If its a column else @@ -588,7 +588,7 @@ void DatabaseImportForm::listDatabases(DatabaseImportHelper &import_helper, QCom QStringList list; map oids; - db_attribs=import_helper.getObjects(ObjectType::ObjDatabase); + db_attribs=import_helper.getObjects(ObjectType::Database); dbcombo->blockSignals(true); dbcombo->clear(); @@ -609,7 +609,7 @@ void DatabaseImportForm::listDatabases(DatabaseImportHelper &import_helper, QCom for(int i=0; i < list.count(); i++) { - dbcombo->setItemIcon(i, QPixmap(PgModelerUiNs::getIconPath(ObjectType::ObjDatabase))); + dbcombo->setItemIcon(i, QPixmap(PgModelerUiNs::getIconPath(ObjectType::Database))); dbcombo->setItemData(i, oids[list[i]]); } @@ -643,7 +643,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { task_prog_wgt.setWindowTitle(trUtf8("Retrieving objects from database...")); task_prog_wgt.show(); - task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), ~ObjectType::ObjDatabase); + task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), ~ObjectType::Database); } tree_wgt->clear(); @@ -657,11 +657,11 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW //Creating database item db_item=new QTreeWidgetItem; db_item->setText(0, import_helper.getCurrentDatabase()); - db_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ObjectType::ObjDatabase))); - attribs=catalog.getObjectsAttributes(ObjectType::ObjDatabase, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); + db_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ObjectType::Database))); + attribs=catalog.getObjectsAttributes(ObjectType::Database, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(ParsersAttributes::OID).toUInt()); - db_item->setData(ObjectTypeId, Qt::UserRole, ~ObjectType::ObjDatabase); + db_item->setData(ObjectTypeId, Qt::UserRole, ~ObjectType::Database); db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(ParsersAttributes::OID))); tree_wgt->addTopLevelItem(db_item); @@ -669,7 +669,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW //Retrieving and listing the cluster scoped objects sch_items=DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, - BaseObject::getChildObjectTypes(ObjectType::ObjDatabase), + BaseObject::getChildObjectTypes(ObjectType::Database), checkable_items, disable_empty_grps, db_item); if(create_dummy_item) @@ -684,17 +684,17 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW } else { - ObjectType obj_type = ObjectType::ObjBaseObject; + ObjectType obj_type = ObjectType::BaseObject; aux_prog=task_prog_wgt.progress_pb->value(); inc=40/static_cast(sch_items.size()); while(!sch_items.empty()) { - task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), ~ObjectType::ObjSchema); + task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), ~ObjectType::Schema); //Retrieving and listing the schema scoped objects tab_items=DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, - BaseObject::getChildObjectTypes(ObjectType::ObjSchema), + BaseObject::getChildObjectTypes(ObjectType::Schema), checkable_items, disable_empty_grps, sch_items.back(), sch_items.back()->text(0)); inc1=(60/static_cast(tab_items.size()))/static_cast(sch_items.size()); @@ -799,7 +799,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe label=name=attribs[ParsersAttributes::NAME]; //Removing the trailing type string from op. families or op. classes names - if(obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjOpClass) + if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) { start=name.indexOf(QChar('[')); end=name.lastIndexOf(QChar(']')); @@ -817,8 +817,8 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe if(checkable_items) { if((oid > import_helper.getLastSystemOID()) || - (obj_type==ObjectType::ObjSchema && name==QString("public")) || - (obj_type==ObjectType::ObjColumn && root && root->data(0, Qt::UserRole).toUInt() > import_helper.getLastSystemOID())) + (obj_type==ObjectType::Schema && name==QString("public")) || + (obj_type==ObjectType::Column && root && root->data(0, Qt::UserRole).toUInt() > import_helper.getLastSystemOID())) { item->setCheckState(0, Qt::Checked); child_checked=true; @@ -827,16 +827,16 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setCheckState(0, Qt::Unchecked); //Disabling items that refers to PostgreSQL's built-in data types - if(obj_type==ObjectType::ObjType && oid <= import_helper.getLastSystemOID()) + if(obj_type==ObjectType::Type && oid <= import_helper.getLastSystemOID()) { item->setDisabled(true); item->setToolTip(0, trUtf8("This is a PostgreSQL built-in data type and cannot be imported.")); } //Disabling items that refers to pgModeler's built-in system objects - else if((obj_type==ObjectType::ObjTablespace && (name==QString("pg_default") || name==QString("pg_global"))) || - (obj_type==ObjectType::ObjRole && (name==QString("postgres"))) || - (obj_type==ObjectType::ObjSchema && (name==QString("pg_catalog") || name==QString("public"))) || - (obj_type==ObjectType::ObjLanguage && (name==~LanguageType(LanguageType::C) || + else if((obj_type==ObjectType::Tablespace && (name==QString("pg_default") || name==QString("pg_global"))) || + (obj_type==ObjectType::Role && (name==QString("postgres"))) || + (obj_type==ObjectType::Schema && (name==QString("pg_catalog") || name==QString("public"))) || + (obj_type==ObjectType::Language && (name==~LanguageType(LanguageType::C) || name==~LanguageType(LanguageType::Sql) || name==~LanguageType(LanguageType::PlPgsql)))) { @@ -861,7 +861,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setData(ObjectSchema, Qt::UserRole, schema); item->setData(ObjectTable, Qt::UserRole, table); - if(obj_type==ObjectType::ObjSchema || obj_type == ObjectType::ObjTable || obj_type == ObjectType::ObjView) + if(obj_type==ObjectType::Schema || obj_type == ObjectType::Table || obj_type == ObjectType::View) items_vect.push_back(item); } diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 12664eb361..551574aa2f 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -159,8 +159,8 @@ void DatabaseImportHelper::swapSequencesTablesIds(void) itr=seq_tab_swap.begin(); while(itr!=seq_tab_swap.end()) { - sequence=dbmodel->getObject(getObjectName(itr->first), ObjectType::ObjSequence); - table=dbmodel->getObject(getObjectName(itr->second), ObjectType::ObjTable); + sequence=dbmodel->getObject(getObjectName(itr->first), ObjectType::Sequence); + table=dbmodel->getObject(getObjectName(itr->second), ObjectType::Table); if(sequence && table) BaseObject::swapObjectsIds(sequence, table, false); itr++; @@ -173,8 +173,8 @@ void DatabaseImportHelper::retrieveSystemObjects(void) vector::iterator itr; map *obj_map=nullptr; vector objects; - ObjectType sys_objs[]={ ObjectType::ObjSchema, ObjectType::ObjRole, ObjectType::ObjTablespace, - ObjectType::ObjLanguage, /* ObjectType::ObjCollation,*/ ObjectType::ObjType }; + ObjectType sys_objs[]={ ObjectType::Schema, ObjectType::Role, ObjectType::Tablespace, + ObjectType::Language, /* ObjectType::ObjCollation,*/ ObjectType::Type }; unsigned i=0, oid=0, cnt=sizeof(sys_objs)/sizeof(ObjectType); for(i=0; i < cnt && !import_canceled; i++) @@ -183,11 +183,11 @@ void DatabaseImportHelper::retrieveSystemObjects(void) trUtf8("Retrieving system objects... `%1'").arg(BaseObject::getTypeName(sys_objs[i])), sys_objs[i]); - if(sys_objs[i]!=ObjectType::ObjType) + if(sys_objs[i]!=ObjectType::Type) { obj_map=&system_objs; - if(sys_objs[i]!=ObjectType::ObjLanguage) + if(sys_objs[i]!=ObjectType::Language) catalog.setFilter(Catalog::ListOnlySystemObjs); else catalog.setFilter(Catalog::ListAllObjects); @@ -254,8 +254,8 @@ void DatabaseImportHelper::retrieveUserObjects(void) while(col_itr!=column_oids.end()) { emit s_progressUpdated(progress, - trUtf8("Retrieving objects... `%1'").arg(BaseObject::getTypeName(ObjectType::ObjColumn)), - ObjectType::ObjColumn); + trUtf8("Retrieving objects... `%1'").arg(BaseObject::getTypeName(ObjectType::Column)), + ObjectType::Column); names=getObjectName(QString::number(col_itr->first)).split("."); @@ -274,7 +274,7 @@ void DatabaseImportHelper::retrieveTableColumns(const QString &sch_name, const Q vector cols; unsigned tab_oid=0, col_oid; - cols=catalog.getObjectsAttributes(ObjectType::ObjColumn, sch_name, tab_name, col_ids); + cols=catalog.getObjectsAttributes(ObjectType::Column, sch_name, tab_name, col_ids); for(auto &itr : cols) { @@ -309,7 +309,7 @@ void DatabaseImportHelper::createObjects(void) { /* Constraints are ignored in these phase being pushed into an auxiliary list in order to be created later */ - if(obj_type!=ObjectType::ObjConstraint) + if(obj_type!=ObjectType::Constraint) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2), oid `%3'...") .arg(attribs[ParsersAttributes::NAME]) @@ -386,7 +386,7 @@ void DatabaseImportHelper::createObjects(void) if(tries >= max_tries) emit s_progressUpdated(progress, trUtf8("Import failed to recreate some objects in `%1' tries.").arg(max_tries), - ObjectType::ObjBaseObject); + ObjectType::BaseObject); if(!import_canceled) { @@ -427,8 +427,8 @@ void DatabaseImportHelper::createConstraints(void) emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2)...") .arg(attribs[ParsersAttributes::NAME]) - .arg(BaseObject::getTypeName(ObjectType::ObjConstraint)), - ObjectType::ObjConstraint); + .arg(BaseObject::getTypeName(ObjectType::Constraint)), + ObjectType::Constraint); createObject(attribs); } @@ -464,7 +464,7 @@ void DatabaseImportHelper::createPermissions(void) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); emit s_progressUpdated(progress, msg.arg(getObjectName(attribs[ParsersAttributes::OID])) - .arg(BaseObject::getTypeName(obj_type)), ObjectType::ObjPermission); + .arg(BaseObject::getTypeName(obj_type)), ObjectType::Permission); createPermission(attribs); itr_obj++; @@ -472,7 +472,7 @@ void DatabaseImportHelper::createPermissions(void) progress=((i++)/static_cast(obj_perms.size())) * 100; } - emit s_progressUpdated(progress, trUtf8("Creating columns permissions..."), ObjectType::ObjPermission); + emit s_progressUpdated(progress, trUtf8("Creating columns permissions..."), ObjectType::Permission); //Create the column level permission i=0; while(itr_cols!=col_perms.end() && !import_canceled) @@ -485,7 +485,7 @@ void DatabaseImportHelper::createPermissions(void) obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); emit s_progressUpdated(progress, msg.arg(getObjectName(attribs[ParsersAttributes::OID])) - .arg(BaseObject::getTypeName(obj_type)), ObjectType::ObjPermission); + .arg(BaseObject::getTypeName(obj_type)), ObjectType::Permission); createPermission(attribs); itr++; @@ -511,9 +511,9 @@ void DatabaseImportHelper::updateFKRelationships(void) unsigned i=0, count=0; Table *tab=nullptr; - itr_tab=dbmodel->getObjectList(ObjectType::ObjTable)->begin(); - itr_tab_end=dbmodel->getObjectList(ObjectType::ObjTable)->end(); - count=dbmodel->getObjectList(ObjectType::ObjTable)->size(); + itr_tab=dbmodel->getObjectList(ObjectType::Table)->begin(); + itr_tab_end=dbmodel->getObjectList(ObjectType::Table)->end(); + count=dbmodel->getObjectList(ObjectType::Table)->size(); i=0; try @@ -525,8 +525,8 @@ void DatabaseImportHelper::updateFKRelationships(void) emit s_progressUpdated(progress, trUtf8("Updating relationships of `%1' (%2)...") .arg(tab->getName()) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)), - ObjectType::ObjTable); + .arg(BaseObject::getTypeName(ObjectType::Table)), + ObjectType::Table); dbmodel->updateTableFKRelationships(tab); @@ -564,7 +564,7 @@ void DatabaseImportHelper::importDatabase(void) if(!inherited_cols.empty()) { - emit s_progressUpdated(100, trUtf8("Validating relationships..."), ObjectType::ObjRelationship); + emit s_progressUpdated(100, trUtf8("Validating relationships..."), ObjectType::Relationship); dbmodel->validateRelationships(); } @@ -611,7 +611,7 @@ void DatabaseImportHelper::importDatabase(void) vector *rels=nullptr; vector::iterator itr, itr_end; std::uniform_int_distribution dist(0,255); - ObjectType rel_type[]={ ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }; + ObjectType rel_type[]={ ObjectType::Relationship, ObjectType::BaseRelationship }; BaseRelationship *rel=nullptr; for(unsigned i=0; i < 2; i++) @@ -633,7 +633,7 @@ void DatabaseImportHelper::importDatabase(void) } //Forcing the update of tables and views in order to correctly draw their titles without the schema's name - dbmodel->setObjectsModified({ ObjectType::ObjTable, ObjectType::ObjView }); + dbmodel->setObjectsModified({ ObjectType::Table, ObjectType::View }); } resetImportParameters(); @@ -661,7 +661,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) { unsigned oid=attribs[ParsersAttributes::OID].toUInt(); ObjectType obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); - QString obj_name=getObjectName(attribs[ParsersAttributes::OID], (obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjOperator)); + QString obj_name=getObjectName(attribs[ParsersAttributes::OID], (obj_type==ObjectType::Function || obj_type==ObjectType::Operator)); //Avoiding the creation of pgModeler's temp objects created in database during the catalog reading if(obj_name.contains(Catalog::PgModelerTempDbObj)) @@ -670,7 +670,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) try { if(!import_canceled && - (obj_type==ObjectType::ObjDatabase || TableObject::isTableObject(obj_type) || + (obj_type==ObjectType::Database || TableObject::isTableObject(obj_type) || //If the object does not exists on both model and created objects vector ((std::find(created_objs.begin(), created_objs.end(), oid)==created_objs.end()) && @@ -684,13 +684,13 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) attribs[ParsersAttributes::COMMENT]=getComment(attribs); if(attribs.count(ParsersAttributes::OWNER)) - attribs[ParsersAttributes::OWNER]=getDependencyObject(attribs[ParsersAttributes::OWNER], ObjectType::ObjRole, false, auto_resolve_deps); + attribs[ParsersAttributes::OWNER]=getDependencyObject(attribs[ParsersAttributes::OWNER], ObjectType::Role, false, auto_resolve_deps); if(attribs.count(ParsersAttributes::TABLESPACE)) - attribs[ParsersAttributes::TABLESPACE]=getDependencyObject(attribs[ParsersAttributes::TABLESPACE], ObjectType::ObjTablespace, false, auto_resolve_deps); + attribs[ParsersAttributes::TABLESPACE]=getDependencyObject(attribs[ParsersAttributes::TABLESPACE], ObjectType::Tablespace, false, auto_resolve_deps); if(attribs.count(ParsersAttributes::SCHEMA)) - attribs[ParsersAttributes::SCHEMA]=getDependencyObject(attribs[ParsersAttributes::SCHEMA], ObjectType::ObjSchema, false, auto_resolve_deps); + attribs[ParsersAttributes::SCHEMA]=getDependencyObject(attribs[ParsersAttributes::SCHEMA], ObjectType::Schema, false, auto_resolve_deps); /* Due to the object recreation mechanism there are some situations when pgModeler fails to recreate them due to the duplication of permissions. So, to avoid this problem we need to check if the OID of the @@ -707,31 +707,31 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) switch(obj_type) { - case ObjectType::ObjDatabase: configureDatabase(attribs); break; - case ObjectType::ObjTablespace: createTablespace(attribs); break; - case ObjectType::ObjSchema: createSchema(attribs); break; - case ObjectType::ObjRole: createRole(attribs); break; - case ObjectType::ObjDomain: createDomain(attribs); break; - case ObjectType::ObjExtension: createExtension(attribs); break; - case ObjectType::ObjFunction: createFunction(attribs); break; - case ObjectType::ObjLanguage: createLanguage(attribs); break; - case ObjectType::ObjOpFamily: createOperatorFamily(attribs); break; - case ObjectType::ObjOpClass: createOperatorClass(attribs); break; - case ObjectType::ObjOperator: createOperator(attribs); break; - case ObjectType::ObjCollation: createCollation(attribs); break; - case ObjectType::ObjCast: createCast(attribs); break; - case ObjectType::ObjConversion: createConversion(attribs); break; - case ObjectType::ObjSequence: createSequence(attribs); break; - case ObjectType::ObjAggregate: createAggregate(attribs); break; - case ObjectType::ObjType: createType(attribs); break; - case ObjectType::ObjTable: createTable(attribs); break; - case ObjectType::ObjView: createView(attribs); break; - case ObjectType::ObjRule: createRule(attribs); break; - case ObjectType::ObjTrigger: createTrigger(attribs); break; - case ObjectType::ObjIndex: createIndex(attribs); break; - case ObjectType::ObjConstraint: createConstraint(attribs); break; - case ObjectType::ObjPolicy: createPolicy(attribs); break; - case ObjectType::ObjEventTrigger: createEventTrigger(attribs); break; + case ObjectType::Database: configureDatabase(attribs); break; + case ObjectType::Tablespace: createTablespace(attribs); break; + case ObjectType::Schema: createSchema(attribs); break; + case ObjectType::Role: createRole(attribs); break; + case ObjectType::Domain: createDomain(attribs); break; + case ObjectType::Extension: createExtension(attribs); break; + case ObjectType::Function: createFunction(attribs); break; + case ObjectType::Language: createLanguage(attribs); break; + case ObjectType::OpFamily: createOperatorFamily(attribs); break; + case ObjectType::OpClass: createOperatorClass(attribs); break; + case ObjectType::Operator: createOperator(attribs); break; + case ObjectType::Collation: createCollation(attribs); break; + case ObjectType::Cast: createCast(attribs); break; + case ObjectType::Conversion: createConversion(attribs); break; + case ObjectType::Sequence: createSequence(attribs); break; + case ObjectType::Aggregate: createAggregate(attribs); break; + case ObjectType::Type: createType(attribs); break; + case ObjectType::Table: createTable(attribs); break; + case ObjectType::View: createView(attribs); break; + case ObjectType::Rule: createRule(attribs); break; + case ObjectType::Trigger: createTrigger(attribs); break; + case ObjectType::Index: createIndex(attribs); break; + case ObjectType::Constraint: createConstraint(attribs); break; + case ObjectType::Policy: createPolicy(attribs); break; + case ObjectType::EventTrigger: createEventTrigger(attribs); break; default: if(debug_mode) @@ -822,7 +822,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType /* If the attributes of the dependency exists but it was not created on the model yet, pgModeler will create it and it's dependencies recursively */ if(recursive_dep_res && !TableObject::isTableObject(obj_type) && - obj_type!=ObjectType::ObjDatabase && dbmodel->getObjectIndex(obj_attr[ParsersAttributes::NAME], obj_type) < 0) + obj_type!=ObjectType::Database && dbmodel->getObjectIndex(obj_attr[ParsersAttributes::NAME], obj_type) < 0) createObject(obj_attr); if(use_signature) @@ -927,7 +927,7 @@ void DatabaseImportHelper::createTablespace(attribs_map &attribs) try { - loadObjectXML(ObjectType::ObjTablespace, attribs); + loadObjectXML(ObjectType::Tablespace, attribs); tabspc=dbmodel->createTablespace(); dbmodel->addObject(tabspc); } @@ -949,7 +949,7 @@ void DatabaseImportHelper::createSchema(attribs_map &attribs) attribs[ParsersAttributes::FILL_COLOR]=QColor(dist(rand_num_engine), dist(rand_num_engine), dist(rand_num_engine)).name(); - loadObjectXML(ObjectType::ObjSchema, attribs); + loadObjectXML(ObjectType::Schema, attribs); schema=dbmodel->createSchema(); dbmodel->addObject(schema); @@ -975,7 +975,7 @@ void DatabaseImportHelper::createRole(attribs_map &attribs) for(unsigned i=0; i < 3; i++) attribs[role_types[i]]=getObjectNames(attribs[role_types[i]]).join(','); - loadObjectXML(ObjectType::ObjRole, attribs); + loadObjectXML(ObjectType::Role, attribs); role=dbmodel->createRole(); dbmodel->addObject(role); } @@ -1016,8 +1016,8 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) } attribs[ParsersAttributes::TYPE]=getType(attribs[ParsersAttributes::TYPE], true, attribs); - attribs[ParsersAttributes::COLLATION]=getDependencyObject(attribs[ParsersAttributes::COLLATION], ObjectType::ObjCollation); - loadObjectXML(ObjectType::ObjDomain, attribs); + attribs[ParsersAttributes::COLLATION]=getDependencyObject(attribs[ParsersAttributes::COLLATION], ObjectType::Collation); + loadObjectXML(ObjectType::Domain, attribs); dom=dbmodel->createDomain(); dbmodel->addDomain(dom); } @@ -1035,7 +1035,7 @@ void DatabaseImportHelper::createExtension(attribs_map &attribs) try { - loadObjectXML(ObjectType::ObjExtension, attribs); + loadObjectXML(ObjectType::Extension, attribs); ext=dbmodel->createExtension(); dbmodel->addExtension(ext); } @@ -1148,7 +1148,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) } //Get the language reference code - attribs[ParsersAttributes::LANGUAGE]=getDependencyObject(attribs[ParsersAttributes::LANGUAGE], ObjectType::ObjLanguage); + attribs[ParsersAttributes::LANGUAGE]=getDependencyObject(attribs[ParsersAttributes::LANGUAGE], ObjectType::Language); //Get the return type if there is no return table configured if(attribs[ParsersAttributes::RETURN_TABLE].isEmpty()) @@ -1163,7 +1163,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) attribs[ParsersAttributes::RETURN_TYPE]=getType(attribs[ParsersAttributes::RETURN_TYPE], true); } - loadObjectXML(ObjectType::ObjFunction, attribs); + loadObjectXML(ObjectType::Function, attribs); func=dbmodel->createFunction(); dbmodel->addFunction(func); } @@ -1195,12 +1195,12 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) function is defined after the language pgModeler will raise errors so in order to continue the import these fuctions are simply ignored */ if(func_oid < lang_oid) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::ObjFunction, true , true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true , true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); else attribs[func_types[i]]=QString(); } - loadObjectXML(ObjectType::ObjLanguage, attribs); + loadObjectXML(ObjectType::Language, attribs); lang=dbmodel->createLanguage(); dbmodel->addLanguage(lang); } @@ -1218,7 +1218,7 @@ void DatabaseImportHelper::createOperatorFamily(attribs_map &attribs) try { - loadObjectXML(ObjectType::ObjOpFamily, attribs); + loadObjectXML(ObjectType::OpFamily, attribs); opfam=dbmodel->createOperatorFamily(); dbmodel->addOperatorFamily(opfam); } @@ -1269,7 +1269,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) { list=array_vals[i].split(':'); elem_attr[ParsersAttributes::STRATEGY_NUM]=list[0]; - elem_attr[ParsersAttributes::DEFINITION]=getDependencyObject(list[1], ObjectType::ObjFunction, true); + elem_attr[ParsersAttributes::DEFINITION]=getDependencyObject(list[1], ObjectType::Function, true); elems.push_back(elem_attr); } } @@ -1286,8 +1286,8 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) list=array_vals[i].split(':'); elem_attr[ParsersAttributes::DEFINITION]=""; elem_attr[ParsersAttributes::STRATEGY_NUM]=list[0]; - elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[1], ObjectType::ObjOperator, true); - elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[2], ObjectType::ObjOpFamily, true); + elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[1], ObjectType::Operator, true); + elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[2], ObjectType::OpFamily, true); elems.push_back(elem_attr); } } @@ -1300,7 +1300,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) schparser.ignoreUnkownAttributes(false); } - loadObjectXML(ObjectType::ObjOpClass, attribs); + loadObjectXML(ObjectType::OpClass, attribs); opclass=dbmodel->createOperatorClass(); dbmodel->addOperatorClass(opclass); } @@ -1333,7 +1333,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) ParsersAttributes::NEGATOR_OP }; for(unsigned i=0; i < 3; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::ObjFunction, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); for(unsigned i=0; i < 2; i++) attribs[arg_types[i]]=getType(attribs[arg_types[i]], true, {{ParsersAttributes::REF_TYPE, arg_types[i]}}); @@ -1341,7 +1341,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) regexp.setPattern(ParsersAttributes::SIGNATURE + QString("(=)(\")")); for(unsigned i=0; i < 2; i++) { - attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjectType::ObjOperator, true, false, true, {{ParsersAttributes::REF_TYPE, op_types[i]}}); + attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjectType::Operator, true, false, true, {{ParsersAttributes::REF_TYPE, op_types[i]}}); if(!attribs[op_types[i]].isEmpty()) { @@ -1354,12 +1354,12 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) op_signature=attribs[op_types[i]].mid(pos, (attribs[op_types[i]].indexOf('"',pos) - pos)); //If the operator is not defined clear up the reference to it - if(dbmodel->getObjectIndex(op_signature, ObjectType::ObjOperator) < 0) + if(dbmodel->getObjectIndex(op_signature, ObjectType::Operator) < 0) attribs[op_types[i]].clear(); } } - loadObjectXML(ObjectType::ObjOperator, attribs); + loadObjectXML(ObjectType::Operator, attribs); oper=dbmodel->createOperator(); dbmodel->addOperator(oper); } @@ -1377,7 +1377,7 @@ void DatabaseImportHelper::createCollation(attribs_map &attribs) try { - loadObjectXML(ObjectType::ObjCollation, attribs); + loadObjectXML(ObjectType::Collation, attribs); coll=dbmodel->createCollation(); dbmodel->addCollation(coll); } @@ -1395,10 +1395,10 @@ void DatabaseImportHelper::createCast(attribs_map &attribs) try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::ObjFunction, true); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::Function, true); attribs[ParsersAttributes::SOURCE_TYPE]=getType(attribs[ParsersAttributes::SOURCE_TYPE], true); attribs[ParsersAttributes::DEST_TYPE]=getType(attribs[ParsersAttributes::DEST_TYPE], true); - loadObjectXML(ObjectType::ObjCast, attribs); + loadObjectXML(ObjectType::Cast, attribs); cast=dbmodel->createCast(); dbmodel->addCast(cast); } @@ -1416,8 +1416,8 @@ void DatabaseImportHelper::createConversion(attribs_map &attribs) try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::ObjFunction, true, auto_resolve_deps); - loadObjectXML(ObjectType::ObjConversion, attribs); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::Function, true, auto_resolve_deps); + loadObjectXML(ObjectType::Conversion, attribs); conv=dbmodel->createConversion(); dbmodel->addConversion(conv); } @@ -1460,7 +1460,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) /* Get the table and the owner column instances so the sequence code can be disabled if the column is an identity one */ - tab_name = getDependencyObject(owner_col[0], ObjectType::ObjTable, true, auto_resolve_deps, false, + tab_name = getDependencyObject(owner_col[0], ObjectType::Table, true, auto_resolve_deps, false, {{ ParsersAttributes::POSITION, schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XmlDefinition)}}); @@ -1474,7 +1474,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) for(int i=0; i < seq_attribs.size(); i++) attribs[attr[i]]=seq_attribs[i]; - loadObjectXML(ObjectType::ObjSequence, attribs); + loadObjectXML(ObjectType::Sequence, attribs); seq=dbmodel->createSequence(); dbmodel->addSequence(seq); @@ -1506,7 +1506,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) sch_name; for(unsigned i=0; i < 2; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::ObjFunction, true, auto_resolve_deps, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, auto_resolve_deps, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); types=getTypes(attribs[ParsersAttributes::TYPES], true); attribs[ParsersAttributes::TYPES]=QString(); @@ -1519,9 +1519,9 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) attribs[ParsersAttributes::STATE_TYPE]=getType(attribs[ParsersAttributes::STATE_TYPE], true, {{ParsersAttributes::REF_TYPE, ParsersAttributes::STATE_TYPE}}); - attribs[ParsersAttributes::SORT_OP]=getDependencyObject(attribs[ParsersAttributes::SORT_OP], ObjectType::ObjOperator, true); + attribs[ParsersAttributes::SORT_OP]=getDependencyObject(attribs[ParsersAttributes::SORT_OP], ObjectType::Operator, true); - loadObjectXML(ObjectType::ObjAggregate, attribs); + loadObjectXML(ObjectType::Aggregate, attribs); agg=dbmodel->createAggregate(); dbmodel->addAggregate(agg); @@ -1570,7 +1570,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { type_attrib.setName(values[0].remove('"')); type_attrib.setType(PgSqlType::parseString(values[1].remove('\\'))); - type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjectType::ObjCollation)); + type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjectType::Collation)); attribs[ParsersAttributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XmlDefinition); } } @@ -1580,10 +1580,10 @@ void DatabaseImportHelper::createType(attribs_map &attribs) QStringList range_attr=Catalog::parseArrayValues(attribs[ParsersAttributes::RANGE_ATTRIBS]); attribs[ParsersAttributes::SUBTYPE]=getType(range_attr[0], true); - attribs[ParsersAttributes::COLLATION]=getDependencyObject(range_attr[1], ObjectType::ObjCollation, true); - attribs[ParsersAttributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjectType::ObjOpClass, true); - attribs[ParsersAttributes::CANONICAL_FUNC]=getDependencyObject(range_attr[3], ObjectType::ObjFunction, true); - attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjectType::ObjFunction, true); + attribs[ParsersAttributes::COLLATION]=getDependencyObject(range_attr[1], ObjectType::Collation, true); + attribs[ParsersAttributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjectType::OpClass, true); + attribs[ParsersAttributes::CANONICAL_FUNC]=getDependencyObject(range_attr[3], ObjectType::Function, true); + attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjectType::Function, true); } else { @@ -1605,7 +1605,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { for(i=0; i < count; i++) { - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::ObjFunction, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); /* Since pgModeler requires that type functions refers to the constructing type as "any" it's necessary to replace the function parameter types names */ @@ -1614,7 +1614,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) } } - loadObjectXML(ObjectType::ObjType, attribs); + loadObjectXML(ObjectType::Type, attribs); type=dbmodel->createType(); dbmodel->addType(type); } @@ -1709,13 +1709,13 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) the non-array type, this way, if the original type is created there is no need to create the array form */ if(auto_resolve_deps && !is_type_registered && !type_name.contains(QString("[]"))) { - type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::ObjType); + type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::Type); unknown_obj_xml=UnkownObjectOidXml.arg(type_oid); /* If the type still doesn't exists means that the column maybe is referencing a domain this way pgModeler will try to retrieve the mentionend object */ if(type_def==unknown_obj_xml) - type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::ObjDomain); + type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::Domain); } col.setIdentityType(BaseType::Null); @@ -1759,15 +1759,15 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) //Checking if the collation used by the column exists, if not it'll be created when auto_resolve_deps is checked if(auto_resolve_deps && !itr->second[ParsersAttributes::COLLATION].isEmpty()) - getDependencyObject(itr->second[ParsersAttributes::COLLATION], ObjectType::ObjCollation); + getDependencyObject(itr->second[ParsersAttributes::COLLATION], ObjectType::Collation); - col.setCollation(dbmodel->getObject(getObjectName(itr->second[ParsersAttributes::COLLATION]),ObjectType::ObjCollation)); + col.setCollation(dbmodel->getObject(getObjectName(itr->second[ParsersAttributes::COLLATION]),ObjectType::Collation)); attribs[ParsersAttributes::COLUMNS]+=col.getCodeDefinition(SchemaParser::XmlDefinition); itr++; col_idx++; } - loadObjectXML(ObjectType::ObjTable, attribs); + loadObjectXML(ObjectType::Table, attribs); table=dbmodel->createTable(); for(unsigned col_idx : inh_cols) @@ -1782,7 +1782,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) Table *partitioned_tab = nullptr; attribs[ParsersAttributes::PARTITIONED_TABLE] = - getDependencyObject(attribs[ParsersAttributes::PARTITIONED_TABLE], ObjectType::ObjTable, true, auto_resolve_deps, false); + getDependencyObject(attribs[ParsersAttributes::PARTITIONED_TABLE], ObjectType::Table, true, auto_resolve_deps, false); partitioned_tab = dbmodel->getTable(attribs[ParsersAttributes::PARTITIONED_TABLE]); table->setPartionedTable(partitioned_tab); @@ -1790,8 +1790,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(!partitioned_tab) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::ObjTable)) - .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjectType::ObjTable)), + .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::Table)) + .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1831,8 +1831,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) // Retriving the collation for the partion key if(i < collations.size() && collations[i] != QString("0")) { - coll_name = getDependencyObject(collations[i], ObjectType::ObjCollation, false, true, false); - coll = dynamic_cast(dbmodel->getObject(coll_name, ObjectType::ObjCollation)); + coll_name = getDependencyObject(collations[i], ObjectType::Collation, false, true, false); + coll = dynamic_cast(dbmodel->getObject(coll_name, ObjectType::Collation)); //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" if(coll && (!coll->isSystemObject() || @@ -1843,8 +1843,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) // Retriving the operator class for the partion key if(i < opclasses.size() && opclasses[i] != QString("0")) { - opc_name = getDependencyObject(opclasses[i], ObjectType::ObjOpClass, true, true, false); - opclass = dynamic_cast(dbmodel->getObject(opc_name, ObjectType::ObjOpClass)); + opc_name = getDependencyObject(opclasses[i], ObjectType::OpClass, true, true, false); + opclass = dynamic_cast(dbmodel->getObject(opc_name, ObjectType::OpClass)); if(opclass) part_key.setOperatorClass(opclass); @@ -1883,7 +1883,7 @@ void DatabaseImportHelper::createView(attribs_map &attribs) ref.setDefinitionExpression(true); attribs[ParsersAttributes::REFERENCES]=ref.getXMLDefinition(); - loadObjectXML(ObjectType::ObjView, attribs); + loadObjectXML(ObjectType::View, attribs); view=dbmodel->createView(); dbmodel->addView(view); @@ -1903,7 +1903,7 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) QString cmds=attribs[ParsersAttributes::COMMANDS]; int start=-1; QRegExp cond_regexp(QString("(WHERE)(.)+(DO)")); - ObjectType table_type=ObjectType::ObjTable; + ObjectType table_type=ObjectType::Table; try { @@ -1916,12 +1916,12 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) attribs[ParsersAttributes::COMMANDS]=Catalog::parseRuleCommands(attribs[ParsersAttributes::COMMANDS]).join(';'); - if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::ObjView)) - table_type=ObjectType::ObjView; + if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::View)) + table_type=ObjectType::View; attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); - loadObjectXML(ObjectType::ObjRule, attribs); + loadObjectXML(ObjectType::Rule, attribs); rule=dbmodel->createRule(); } catch(Exception &e) @@ -1936,16 +1936,16 @@ void DatabaseImportHelper::createTrigger(attribs_map &attribs) { try { - ObjectType table_type=ObjectType::ObjTable; + ObjectType table_type=ObjectType::Table; - if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::ObjView)) - table_type=ObjectType::ObjView; + if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::View)) + table_type=ObjectType::View; attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); - attribs[ParsersAttributes::TRIGGER_FUNC]=getDependencyObject(attribs[ParsersAttributes::TRIGGER_FUNC], ObjectType::ObjFunction, true, true); + attribs[ParsersAttributes::TRIGGER_FUNC]=getDependencyObject(attribs[ParsersAttributes::TRIGGER_FUNC], ObjectType::Function, true, true); attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS].remove(QString(",\"\""))).join(','); - loadObjectXML(ObjectType::ObjTrigger, attribs); + loadObjectXML(ObjectType::Trigger, attribs); dbmodel->createTrigger(); } catch(Exception &e) @@ -2011,18 +2011,18 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) int i; attribs[ParsersAttributes::FACTOR]=QString("90"); - tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable, true, auto_resolve_deps, false); - parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::ObjTable)); + tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); + parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::Table)); if(!parent_tab) { - tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjView, true, auto_resolve_deps, false); - parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::ObjView)); + tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::View, true, auto_resolve_deps, false); + parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::View)); if(!parent_tab) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::ObjIndex)) - .arg(tab_name).arg(BaseObject::getTypeName(ObjectType::ObjTable)), + .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::Index)) + .arg(tab_name).arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -2037,7 +2037,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(cols[i]!=QString("0")) { - if(parent_tab->getObjectType() == ObjectType::ObjTable) + if(parent_tab->getObjectType() == ObjectType::Table) elem.setColumn(dynamic_cast
(parent_tab)->getColumn(getColumnName(attribs[ParsersAttributes::TABLE], cols[i]))); else elem.setExpression(getColumnName(attribs[ParsersAttributes::TABLE], cols[i])); @@ -2050,8 +2050,8 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(i < collations.size() && collations[i]!=QString("0")) { - coll_name=getDependencyObject(collations[i], ObjectType::ObjCollation, false, true, false); - coll=dynamic_cast(dbmodel->getObject(coll_name, ObjectType::ObjCollation)); + coll_name=getDependencyObject(collations[i], ObjectType::Collation, false, true, false); + coll=dynamic_cast(dbmodel->getObject(coll_name, ObjectType::Collation)); //Even if the collation exists we'll ignore it when it is the "pg_catalog.default" if(coll && (!coll->isSystemObject() || @@ -2061,8 +2061,8 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(i < opclasses.size() && opclasses[i]!=QString("0")) { - opc_name=getDependencyObject(opclasses[i], ObjectType::ObjOpClass, true, true, false); - opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjectType::ObjOpClass)); + opc_name=getDependencyObject(opclasses[i], ObjectType::OpClass, true, true, false); + opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjectType::OpClass)); if(opclass) elem.setOperatorClass(opclass); @@ -2073,7 +2073,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) } attribs[ParsersAttributes::TABLE]=tab_name; - loadObjectXML(ObjectType::ObjIndex, attribs); + loadObjectXML(ObjectType::Index, attribs); dbmodel->createIndex(); } catch(Exception &e) @@ -2100,13 +2100,13 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) QStringList factor=Catalog::parseArrayValues(attribs[ParsersAttributes::FACTOR]); //Retrieving the table is it was not imported yet and auto_resolve_deps is true - tab_name=getDependencyObject(table_oid, ObjectType::ObjTable, true, auto_resolve_deps, false); + tab_name=getDependencyObject(table_oid, ObjectType::Table, true, auto_resolve_deps, false); if(!factor.isEmpty() && factor[0].startsWith(QString("fillfactor="))) attribs[ParsersAttributes::FACTOR]=factor[0].remove(QString("fillfactor=")); attribs[attribs[ParsersAttributes::TYPE]]=ParsersAttributes::_TRUE_; - table=dynamic_cast
(dbmodel->getObject(tab_name, ObjectType::ObjTable)); + table=dynamic_cast
(dbmodel->getObject(tab_name, ObjectType::Table)); if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::EX_CONSTR) { @@ -2147,8 +2147,8 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) if(i < opclasses.size() && opclasses[i]!=QString("0")) { - opc_name=getDependencyObject(opclasses[i], ObjectType::ObjOpClass, true, true, false); - opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjectType::ObjOpClass)); + opc_name=getDependencyObject(opclasses[i], ObjectType::OpClass, true, true, false); + opclass=dynamic_cast(dbmodel->getObject(opc_name, ObjectType::OpClass)); if(opclass) elem.setOperatorClass(opclass); @@ -2156,8 +2156,8 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) if(i < opers.size() && opers[i]!=QString("0")) { - op_name=getDependencyObject(opers[i], ObjectType::ObjOperator, true, true, false); - oper=dynamic_cast(dbmodel->getObject(op_name, ObjectType::ObjOperator)); + op_name=getDependencyObject(opers[i], ObjectType::Operator, true, true, false); + oper=dynamic_cast(dbmodel->getObject(op_name, ObjectType::Operator)); if(oper) elem.setOperator(oper); @@ -2175,11 +2175,11 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) attribs[ParsersAttributes::SRC_COLUMNS]=getColumnNames(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::SRC_COLUMNS]).join(','); } - attribs[ParsersAttributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjectType::ObjTable, false, true, false); + attribs[ParsersAttributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjectType::Table, false, true, false); attribs[ParsersAttributes::DST_COLUMNS]=getColumnNames(ref_tab_oid, attribs[ParsersAttributes::DST_COLUMNS]).join(','); attribs[ParsersAttributes::TABLE]=tab_name; - loadObjectXML(ObjectType::ObjConstraint, attribs); + loadObjectXML(ObjectType::Constraint, attribs); constr=dbmodel->createConstraint(nullptr); if(table && constr->getConstraintType()==ConstraintType::PrimaryKey) @@ -2200,9 +2200,9 @@ void DatabaseImportHelper::createPolicy(attribs_map &attribs) { try { - attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::ObjTable, true, auto_resolve_deps, false); + attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); attribs[ParsersAttributes::ROLES]=getObjectNames(attribs[ParsersAttributes::ROLES]).join(','); - loadObjectXML(ObjectType::ObjPolicy, attribs); + loadObjectXML(ObjectType::Policy, attribs); dbmodel->createPolicy(); } catch(Exception &e) @@ -2216,14 +2216,14 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) { try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::ObjFunction, true, true); + attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::Function, true, true); attribs[ParsersAttributes::FILTER]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") .arg(ParsersAttributes::FILTER) .arg(ParsersAttributes::VARIABLE).arg(ParsersAttributes::TAG.toUpper()) .arg(ParsersAttributes::VALUES) .arg(Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES].remove('"')).join(',')); - loadObjectXML(ObjectType::ObjEventTrigger, attribs); + loadObjectXML(ObjectType::EventTrigger, attribs); dbmodel->addEventTrigger(dbmodel->createEventTrigger()); } catch(Exception &e) @@ -2253,9 +2253,9 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) if(!perm_list.isEmpty()) { - if(obj_type!=ObjectType::ObjColumn) + if(obj_type!=ObjectType::Column) { - if(obj_type==ObjectType::ObjDatabase) + if(obj_type==ObjectType::Database) object=dbmodel; else { @@ -2266,8 +2266,8 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) else { //If the object is column it's necessary to retrive the parent table to get the valid reference to column - table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[ParsersAttributes::TABLE]), ObjectType::ObjTable)); - object=table->getObject(getColumnName(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::OID]), ObjectType::ObjColumn); + table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[ParsersAttributes::TABLE]), ObjectType::Table)); + object=table->getObject(getColumnName(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::OID]), ObjectType::Column); } } @@ -2281,21 +2281,21 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) if(!privs.empty() || gop_privs.empty()) { - role=dynamic_cast(dbmodel->getObject(role_name, ObjectType::ObjRole)); + role=dynamic_cast(dbmodel->getObject(role_name, ObjectType::Role)); if(auto_resolve_deps && !role_name.isEmpty() && !role) { - QString oid = catalog.getObjectOID(role_name, ObjectType::ObjRole); - getDependencyObject(oid, ObjectType::ObjRole); - role=dynamic_cast(dbmodel->getObject(role_name, ObjectType::ObjRole)); + QString oid = catalog.getObjectOID(role_name, ObjectType::Role); + getDependencyObject(oid, ObjectType::Role); + role=dynamic_cast(dbmodel->getObject(role_name, ObjectType::Role)); } /* If the role doesn't exists and there is a name defined, throws an error because the roles wasn't found on the model */ if(!role && !role_name.isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(QString("permission_%1").arg(perm_list[i])).arg(BaseObject::getTypeName(ObjectType::ObjPermission)) - .arg(role_name).arg(BaseObject::getTypeName(ObjectType::ObjRole)) + .arg(QString("permission_%1").arg(perm_list[i])).arg(BaseObject::getTypeName(ObjectType::Permission)) + .arg(role_name).arg(BaseObject::getTypeName(ObjectType::Role)) ,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -2341,13 +2341,13 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) void DatabaseImportHelper::createTableInheritances(void) { //Creating table inheiritances - if(dbmodel->getObjectCount(ObjectType::ObjTable) > 0 && !import_canceled) + if(dbmodel->getObjectCount(ObjectType::Table) > 0 && !import_canceled) { try { emit s_progressUpdated(90, trUtf8("Creating table inheritances..."), - ObjectType::ObjRelationship); + ObjectType::Relationship); __createTableInheritances(); } catch(Exception &e) @@ -2373,7 +2373,7 @@ void DatabaseImportHelper::createTablePartitionings(void) emit s_progressUpdated(95, trUtf8("Creating table partitionings..."), - ObjectType::ObjRelationship); + ObjectType::Relationship); // Creating the paritioning relationships for(auto &itr : imported_tables) @@ -2414,7 +2414,7 @@ void DatabaseImportHelper::destroyDetachedColumns(void) emit s_progressUpdated(100, trUtf8("Destroying unused detached columns..."), - ObjectType::ObjColumn); + ObjectType::Column); //Destroying detached columns before create inheritances for(Column *col : inherited_cols) @@ -2451,13 +2451,13 @@ void DatabaseImportHelper::assignSequencesToColumns(void) Column *col=nullptr; emit s_progressUpdated(100, trUtf8("Assigning sequences to columns..."), - ObjectType::ObjSequence); + ObjectType::Sequence); - for(auto &object : *dbmodel->getObjectList(ObjectType::ObjTable)) + for(auto &object : *dbmodel->getObjectList(ObjectType::Table)) { table=dynamic_cast
(object); - for(auto &tab_obj : *table->getObjectList(ObjectType::ObjColumn)) + for(auto &tab_obj : *table->getObjectList(ObjectType::Column)) { col=dynamic_cast(tab_obj); @@ -2500,8 +2500,8 @@ void DatabaseImportHelper::__createTableInheritances(void) QStringList inh_list; unsigned oid; - itr=object_oids[ObjectType::ObjTable].begin(); - itr_end=object_oids[ObjectType::ObjTable].end(); + itr=object_oids[ObjectType::Table].begin(); + itr_end=object_oids[ObjectType::Table].end(); while(itr!=itr_end) { @@ -2513,19 +2513,19 @@ void DatabaseImportHelper::__createTableInheritances(void) if(!inh_list.isEmpty()) { //Get the child table resolving it's name from the oid - child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][ParsersAttributes::OID]), ObjectType::ObjTable)); + child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][ParsersAttributes::OID]), ObjectType::Table)); while(!inh_list.isEmpty()) { //Get the parent table resolving it's name from the oid - parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjectType::ObjTable)); + parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjectType::Table)); try { if(!parent_tab && auto_resolve_deps) { - getDependencyObject(inh_list.front(), ObjectType::ObjTable); - parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjectType::ObjTable)); + getDependencyObject(inh_list.front(), ObjectType::Table); + parent_tab=dynamic_cast
(dbmodel->getObject(getObjectName(inh_list.front()), ObjectType::Table)); } if(!parent_tab) @@ -2537,7 +2537,7 @@ void DatabaseImportHelper::__createTableInheritances(void) //Create the inheritance relationship rel=new Relationship(Relationship::RelationshipGen, child_tab, parent_tab); - rel->setName(PgModelerNs::generateUniqueName(rel, (*dbmodel->getObjectList(ObjectType::ObjRelationship)))); + rel->setName(PgModelerNs::generateUniqueName(rel, (*dbmodel->getObjectList(ObjectType::Relationship)))); dbmodel->addRelationship(rel); rel=nullptr; @@ -2561,7 +2561,7 @@ void DatabaseImportHelper::configureDatabase(attribs_map &attribs) try { attribs[ParsersAttributes::APPEND_AT_EOD]=QString(); - loadObjectXML(ObjectType::ObjDatabase, attribs); + loadObjectXML(ObjectType::Database, attribs); dbmodel->configureDatabase(attribs); } catch(Exception &e) @@ -2603,11 +2603,11 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f obj_name.prepend(sch_name + QString(".")); //Formatting the name in form of signature (only for functions and operators) - if(signature_form && (obj_type==ObjectType::ObjFunction || obj_type==ObjectType::ObjOperator || obj_type==ObjectType::ObjAggregate || obj_type==ObjectType::ObjOpFamily || obj_type==ObjectType::ObjOpClass)) + if(signature_form && (obj_type==ObjectType::Function || obj_type==ObjectType::Operator || obj_type==ObjectType::Aggregate || obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass)) { QStringList params; - if(obj_type==ObjectType::ObjFunction) + if(obj_type==ObjectType::Function) { QStringList arg_types=getTypes(obj_attr[ParsersAttributes::ARG_TYPES], false), arg_modes=Catalog::parseArrayValues(obj_attr[ParsersAttributes::ARG_MODES]); @@ -2627,14 +2627,14 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f } } } - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) { QStringList params=getTypes(obj_attr[ParsersAttributes::TYPES], false); if(params.isEmpty()) params.push_back(QString("*")); } - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) { if(obj_attr[ParsersAttributes::LEFT_TYPE].toUInt() > 0) params.push_back(getType(obj_attr[ParsersAttributes::LEFT_TYPE], false)); @@ -2651,7 +2651,7 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f obj_name += QString(" USING %1").arg(obj_attr[ParsersAttributes::INDEX_TYPE]); } - if(obj_type != ObjectType::ObjOpFamily && obj_type != ObjectType::ObjOpClass) + if(obj_type != ObjectType::OpFamily && obj_type != ObjectType::OpClass) obj_name+=QString("(") + params.join(',') + QString(")"); } @@ -2752,14 +2752,14 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, { ObjectType obj_type; - if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::ObjTable)) - obj_type=ObjectType::ObjTable; - else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::ObjView)) - obj_type=ObjectType::ObjView; - else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::ObjDomain)) - obj_type=ObjectType::ObjDomain; + if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::Table)) + obj_type=ObjectType::Table; + else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::View)) + obj_type=ObjectType::View; + else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::Domain)) + obj_type=ObjectType::Domain; else - obj_type=ObjectType::ObjSequence; + obj_type=ObjectType::Sequence; is_derivated_from_obj = true; getDependencyObject(type_attr[ParsersAttributes::OBJECT_ID], obj_type, true, true, false); diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 3cce457e32..e46211c4b2 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -272,7 +272,7 @@ class DatabaseImportHelper: public QObject { signals: //! \brief This singal is emitted whenever the export progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::ObjBaseObject); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::BaseObject); //! \brief This signal is emited when the import has finished void s_importFinished(Exception e=Exception()); diff --git a/libpgmodeler_ui/src/databasewidget.cpp b/libpgmodeler_ui/src/databasewidget.cpp index 1e03edcffc..e9cddb8798 100644 --- a/libpgmodeler_ui/src/databasewidget.cpp +++ b/libpgmodeler_ui/src/databasewidget.cpp @@ -18,7 +18,7 @@ #include "databasewidget.h" -DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjDatabase) +DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Database) { try { @@ -27,12 +27,12 @@ DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, Object QGridLayout *grid=nullptr; Ui_DatabaseWidget::setupUi(this); - configureFormLayout(database_grid, ObjectType::ObjDatabase); + configureFormLayout(database_grid, ObjectType::Database); - def_schema_sel=new ObjectSelectorWidget(ObjectType::ObjSchema, true, this); - def_collation_sel=new ObjectSelectorWidget(ObjectType::ObjCollation, true, this); - def_owner_sel=new ObjectSelectorWidget(ObjectType::ObjRole, true, this); - def_tablespace_sel=new ObjectSelectorWidget(ObjectType::ObjTablespace, true, this); + def_schema_sel=new ObjectSelectorWidget(ObjectType::Schema, true, this); + def_collation_sel=new ObjectSelectorWidget(ObjectType::Collation, true, this); + def_owner_sel=new ObjectSelectorWidget(ObjectType::Role, true, this); + def_tablespace_sel=new ObjectSelectorWidget(ObjectType::Tablespace, true, this); frame=generateInformationFrame(trUtf8("The fields LC_COLLATE and LC_CTYPE have pre-configured values based upon the running system. You can freely modify those values if you intend to export the model to another host.")); grid=dynamic_cast(attributes_twg->widget(0)->layout()); @@ -98,16 +98,16 @@ void DatabaseWidget::setAttributes(DatabaseModel *model) lcctype_cmb->setCurrentText(model->getLocalization(Collation::LcCtype)); def_schema_sel->setModel(model); - def_schema_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjSchema)); + def_schema_sel->setSelectedObject(model->getDefaultObject(ObjectType::Schema)); def_collation_sel->setModel(model); - def_collation_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjCollation)); + def_collation_sel->setSelectedObject(model->getDefaultObject(ObjectType::Collation)); def_owner_sel->setModel(model); - def_owner_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjRole)); + def_owner_sel->setSelectedObject(model->getDefaultObject(ObjectType::Role)); def_tablespace_sel->setModel(model); - def_tablespace_sel->setSelectedObject(model->getDefaultObject(ObjectType::ObjTablespace)); + def_tablespace_sel->setSelectedObject(model->getDefaultObject(ObjectType::Tablespace)); allow_conn_chk->setChecked(model->isAllowConnections()); is_template_chk->setChecked(model->isTemplate()); @@ -142,10 +142,10 @@ void DatabaseWidget::applyConfiguration(void) else model->setLocalization(Collation::LcCtype, QString()); - model->setDefaultObject(def_schema_sel->getSelectedObject(), ObjectType::ObjSchema); - model->setDefaultObject(def_owner_sel->getSelectedObject(), ObjectType::ObjRole); - model->setDefaultObject(def_collation_sel->getSelectedObject(), ObjectType::ObjCollation); - model->setDefaultObject(def_tablespace_sel->getSelectedObject(), ObjectType::ObjTablespace); + model->setDefaultObject(def_schema_sel->getSelectedObject(), ObjectType::Schema); + model->setDefaultObject(def_owner_sel->getSelectedObject(), ObjectType::Role); + model->setDefaultObject(def_collation_sel->getSelectedObject(), ObjectType::Collation); + model->setDefaultObject(def_tablespace_sel->getSelectedObject(), ObjectType::Tablespace); model->setIsTemplate(is_template_chk->isChecked()); model->setAllowConnections(allow_conn_chk->isChecked()); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 569a0a3b3e..9b72a349cd 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -177,9 +177,9 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("colar")), trUtf8("Pase items")); act->setShortcut(paste_tb->shortcut()); connect(act, SIGNAL(triggered(bool)), paste_tb, SLOT(click())); - act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == ObjectType::ObjTable); + act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == ObjectType::Table); - if(obj_type == ObjectType::ObjTable) + if(obj_type == ObjectType::Table) { item_menu.addSeparator(); act = item_menu.addAction(browse_tabs_tb->icon(), trUtf8("Browse tables")); @@ -226,7 +226,7 @@ void DataManipulationForm::setAttributes(Connection conn, const QString curr_sch this->setWindowTitle(this->windowTitle() + QString(" - ") + db_name); schema_cmb->clear(); - listObjects(schema_cmb, { ObjectType::ObjSchema }); + listObjects(schema_cmb, { ObjectType::Schema }); disableControlButtons(); schema_cmb->setCurrentText(curr_schema); @@ -270,9 +270,9 @@ void DataManipulationForm::listTables(void) if(schema_cmb->currentIndex() > 0) { if(hide_views_chk->isChecked()) - listObjects(table_cmb, { ObjectType::ObjTable }, schema_cmb->currentText()); + listObjects(table_cmb, { ObjectType::Table }, schema_cmb->currentText()); else - listObjects(table_cmb, { ObjectType::ObjTable, ObjectType::ObjView }, schema_cmb->currentText()); + listObjects(table_cmb, { ObjectType::Table, ObjectType::View }, schema_cmb->currentText()); } table_lbl->setEnabled(table_cmb->count() > 0); @@ -296,7 +296,7 @@ void DataManipulationForm::listColumns(void) vector cols; catalog.setConnection(conn); - cols=catalog.getObjectsAttributes(ObjectType::ObjColumn, schema_cmb->currentText(), table_cmb->currentText()); + cols=catalog.getObjectsAttributes(ObjectType::Column, schema_cmb->currentText(), table_cmb->currentText()); for(auto &col : cols) { @@ -388,12 +388,12 @@ void DataManipulationForm::retrieveData(void) clearChangedRows(); //If the table is empty automatically creates a new row - if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()== ~ObjectType::ObjTable) + if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()== ~ObjectType::Table) addRow(); else results_tbw->setFocus(); - if(table_cmb->currentData(Qt::UserRole).toUInt()== ~ObjectType::ObjTable) + if(table_cmb->currentData(Qt::UserRole).toUInt()== ~ObjectType::Table) csv_load_tb->setEnabled(!col_names.isEmpty()); else { @@ -407,15 +407,15 @@ void DataManipulationForm::retrieveData(void) QApplication::restoreOverrideCursor(); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == ~ObjectType::ObjTable && + table_cmb->currentData().toUInt() == ~ObjectType::Table && !col_names.isEmpty()); - truncate_tb->setEnabled(table_cmb->currentData().toUInt() == ~ObjectType::ObjTable && + truncate_tb->setEnabled(table_cmb->currentData().toUInt() == ~ObjectType::Table && res.getTupleCount() > 0 && !col_names.isEmpty()); code_compl_wgt->clearCustomItems(); - code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), ObjectType::ObjColumn); + code_compl_wgt->insertCustomItems(col_names, trUtf8("Column"), ObjectType::Column); columns_lst->clear(); QListWidgetItem *item = nullptr; @@ -476,7 +476,7 @@ void DataManipulationForm::enableRowControlButtons(void) duplicate_tb->setEnabled(cols_selected); copy_tb->setEnabled(sel_ranges.count() != 0); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == ~ObjectType::ObjTable && + table_cmb->currentData().toUInt() == ~ObjectType::Table && !col_names.isEmpty()); browse_tabs_tb->setEnabled((!fk_infos.empty() || !ref_fk_infos.empty()) && sel_ranges.count() == 1 && sel_ranges.at(0).rowCount() == 1); bulkedit_tb->setEnabled(sel_ranges.count() != 0); @@ -726,7 +726,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin table_oid = 0; - if(obj_type==ObjectType::ObjView) + if(obj_type==ObjectType::View) { warning_frm->setVisible(true); warning_lbl->setText(trUtf8("Views can't have their data handled through this grid, this way, all operations are disabled.")); @@ -735,7 +735,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin { catalog.setConnection(conn); //Retrieving the constraints from catalog using a custom filter to select only primary keys (contype=p) - pks=catalog.getObjectsAttributes(ObjectType::ObjConstraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='p'")}}); + pks=catalog.getObjectsAttributes(ObjectType::Constraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='p'")}}); warning_frm->setVisible(pks.empty()); @@ -745,8 +745,8 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin table_oid = pks[0][ParsersAttributes::TABLE].toUInt(); } - hint_frm->setVisible(obj_type==ObjectType::ObjTable); - add_tb->setEnabled(obj_type==ObjectType::ObjTable && !col_names.empty()); + hint_frm->setVisible(obj_type==ObjectType::Table); + add_tb->setEnabled(obj_type==ObjectType::Table && !col_names.empty()); pk_col_names.clear(); if(!pks.empty()) @@ -757,7 +757,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin for(QString id : col_str_ids) col_ids.push_back(id.toUInt()); - columns=catalog.getObjectsAttributes(ObjectType::ObjColumn, schema, table, col_ids); + columns=catalog.getObjectsAttributes(ObjectType::Column, schema, table, col_ids); for(auto &col : columns) pk_col_names.push_back(col[ParsersAttributes::NAME]); @@ -766,7 +766,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin catalog.closeConnection(); //For tables, even if there is no pk the user can manipulate data - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) results_tbw->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::AnyKeyPressed); else results_tbw->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -794,14 +794,14 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin ref_fk_infos.clear(); fk_infos.clear(); - if(obj_type==ObjectType::ObjView) + if(obj_type==ObjectType::View) return; catalog.setConnection(conn); //Retrieving the constraints from catalog using a custom filter to select only foreign keys (contype=f) - fks=catalog.getObjectsAttributes(ObjectType::ObjConstraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f'")}}); - ref_fks=catalog.getObjectsAttributes(ObjectType::ObjConstraint, QString(), QString(), {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(table_oid)}}); + fks=catalog.getObjectsAttributes(ObjectType::Constraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f'")}}); + ref_fks=catalog.getObjectsAttributes(ObjectType::Constraint, QString(), QString(), {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(table_oid)}}); if(!fks.empty() || !ref_fks.empty()) { @@ -819,8 +819,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &fk : fks) { - aux_table = catalog.getObjectAttributes(ObjectType::ObjTable, fk[ParsersAttributes::REF_TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(ObjectType::ObjSchema, aux_table[ParsersAttributes::SCHEMA].toUInt()); + aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[ParsersAttributes::REF_TABLE].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[ParsersAttributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[ParsersAttributes::NAME]) .arg(aux_table[ParsersAttributes::NAME]) @@ -842,7 +842,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjectType::ObjColumn, schema, table, col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, schema, table, col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); @@ -854,7 +854,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::DST_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjectType::ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); fk_infos[fk_name][ParsersAttributes::DST_COLUMNS] = name_list.join(Table::DataSeparator); @@ -871,8 +871,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin col_ids.clear(); name_list.clear(); - aux_table = catalog.getObjectAttributes(ObjectType::ObjTable, fk[ParsersAttributes::TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(ObjectType::ObjSchema, aux_table[ParsersAttributes::SCHEMA].toUInt()); + aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[ParsersAttributes::TABLE].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[ParsersAttributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[ParsersAttributes::NAME]) .arg(aux_table[ParsersAttributes::NAME]) @@ -882,7 +882,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjectType::ObjColumn, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) + for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index f52ca2491a..b1d224208c 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -19,7 +19,7 @@ #include "domainwidget.h" #include "numberedtexteditor.h" -DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjDomain) +DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Domain) { try { @@ -52,7 +52,7 @@ DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType connect(constr_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(handleConstraint(int))); connect(constr_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editConstraint(int))); - configureFormLayout(domain_grid, ObjectType::ObjDomain); + configureFormLayout(domain_grid, ObjectType::Domain); setRequiredField(data_type); configureTabOrder({ def_value_edt, not_null_chk, data_type, constr_name_edt, check_expr_txt }); diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index e970c47df4..22eb14d6db 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -32,9 +32,9 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) elem_expr_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); parent_obj=nullptr; - op_class_sel=new ObjectSelectorWidget(ObjectType::ObjOpClass, true, this); - collation_sel=new ObjectSelectorWidget(ObjectType::ObjCollation, true, this); - operator_sel=new ObjectSelectorWidget(ObjectType::ObjOperator, true, this); + op_class_sel=new ObjectSelectorWidget(ObjectType::OpClass, true, this); + collation_sel=new ObjectSelectorWidget(ObjectType::Collation, true, this); + operator_sel=new ObjectSelectorWidget(ObjectType::Operator, true, this); element_grid->addWidget(collation_sel, 3,1,1,2); element_grid->addWidget(op_class_sel, 4,1,1,2); @@ -102,7 +102,7 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj, else setPartitionKey(part_key); - if(parent_obj->getObjectType() == ObjectType::ObjTable && + if(parent_obj->getObjectType() == ObjectType::Table && (column || (!column && elem->getExpression().isEmpty()))) { column_rb->setChecked(true); @@ -136,9 +136,9 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) this->setEnabled(false); throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - else if(parent_obj->getObjectType()!=ObjectType::ObjTable && - parent_obj->getObjectType()!=ObjectType::ObjView && - parent_obj->getObjectType()!=ObjectType::ObjRelationship) + else if(parent_obj->getObjectType()!=ObjectType::Table && + parent_obj->getObjectType()!=ObjectType::View && + parent_obj->getObjectType()!=ObjectType::Relationship) throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); this->setEnabled(true); @@ -148,11 +148,11 @@ void ElementWidget::setAttributes(DatabaseModel *model, BaseObject *parent_obj) collation_sel->setModel(model); operator_sel->setModel(model); - cols_combo_parent->setVisible(parent_obj->getObjectType() == ObjectType::ObjTable); - column_rb->setVisible(parent_obj->getObjectType() == ObjectType::ObjTable); - expression_rb->setChecked(parent_obj->getObjectType() == ObjectType::ObjView); + cols_combo_parent->setVisible(parent_obj->getObjectType() == ObjectType::Table); + column_rb->setVisible(parent_obj->getObjectType() == ObjectType::Table); + expression_rb->setChecked(parent_obj->getObjectType() == ObjectType::View); - if(parent_obj->getObjectType() == ObjectType::ObjTable) + if(parent_obj->getObjectType() == ObjectType::Table) updateColumnsCombo(); } diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 571c87faea..4f2cf9552d 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -18,7 +18,7 @@ #include "eventtriggerwidget.h" -EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjEventTrigger) +EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::EventTrigger) { map > fields_map; map > values_map; @@ -26,7 +26,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent Ui_EventTriggerWidget::setupUi(this); - function_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + function_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); filter_tab=new ObjectsTableWidget(ObjectsTableWidget::AddButton | ObjectsTableWidget::EditButton | ObjectsTableWidget::UpdateButton | @@ -39,7 +39,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent eventtrigger_grid->addWidget(function_sel, 1, 1); filter_layout->addWidget(filter_tab); - configureFormLayout(eventtrigger_grid, ObjectType::ObjEventTrigger); + configureFormLayout(eventtrigger_grid, ObjectType::EventTrigger); setRequiredField(function_lbl); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(event_lbl); diff --git a/libpgmodeler_ui/src/extensionwidget.cpp b/libpgmodeler_ui/src/extensionwidget.cpp index 38b074992f..c4bc0ca0ac 100644 --- a/libpgmodeler_ui/src/extensionwidget.cpp +++ b/libpgmodeler_ui/src/extensionwidget.cpp @@ -1,9 +1,9 @@ #include "extensionwidget.h" -ExtensionWidget::ExtensionWidget(QWidget * parent) : BaseObjectWidget(parent, ObjectType::ObjExtension) +ExtensionWidget::ExtensionWidget(QWidget * parent) : BaseObjectWidget(parent, ObjectType::Extension) { Ui_ExtensionWidget::setupUi(this); - configureFormLayout(extension_grid, ObjectType::ObjExtension); + configureFormLayout(extension_grid, ObjectType::Extension); extension_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), extension_grid->count()+1, 0, 1, 0); configureTabOrder({ cur_ver_edt, old_ver_edt, handles_type_chk }); diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index a639d0445e..462acacc00 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -19,7 +19,7 @@ #include "functionwidget.h" #include "baseform.h" -FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjFunction) +FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Function) { try { @@ -34,7 +34,7 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, Object Ui_FunctionWidget::setupUi(this); - configureFormLayout(function_grid, ObjectType::ObjFunction); + configureFormLayout(function_grid, ObjectType::Function); source_code_txt=new NumberedTextEditor(this, true); dynamic_cast(source_code_frm->layout())->addWidget(source_code_txt, 1, 0, 1, 2); @@ -268,7 +268,7 @@ void FunctionWidget::setAttributes(DatabaseModel *model, OperationList *op_list, PgSqlType aux_type; BaseObjectWidget::setAttributes(model, op_list, func, schema); - languages=model->getObjects(ObjectType::ObjLanguage); + languages=model->getObjects(ObjectType::Language); while(!languages.empty()) { @@ -420,19 +420,19 @@ void FunctionWidget::validateConfiguredFunction(void) If the function is invalid the instances raises exceptions accusing the error that is enough to check the validity of the function in relation to objects that reference it. */ - if(obj_type==ObjectType::ObjConversion) + if(obj_type==ObjectType::Conversion) { conv=dynamic_cast(object); if(conv->getConversionFunction()==func) conv->setConversionFunction(func); } - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) { cast=dynamic_cast(object); if(cast->getCastFunction()==func) cast->setCastFunction(func); } - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) { aggr=dynamic_cast(object); if(aggr->getFunction(Aggregate::FinalFunc)==func) @@ -440,11 +440,11 @@ void FunctionWidget::validateConfiguredFunction(void) else if(aggr->getFunction(Aggregate::TransitionFunc)==func) aggr->setFunction(Aggregate::TransitionFunc, func); } - else if(obj_type==ObjectType::ObjTrigger) + else if(obj_type==ObjectType::Trigger) { dynamic_cast(object)->setFunction(func); } - else if(obj_type==ObjectType::ObjLanguage) + else if(obj_type==ObjectType::Language) { lang=dynamic_cast(object); @@ -454,7 +454,7 @@ void FunctionWidget::validateConfiguredFunction(void) lang->setFunction(func, i1); } } - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) { oper=dynamic_cast(object); for(i1=Operator::FUNC_OPERATOR; i1 <= Operator::FUNC_RESTRICT; i1++) @@ -463,7 +463,7 @@ void FunctionWidget::validateConfiguredFunction(void) oper->setFunction(func, i1); } } - else if(obj_type==ObjectType::ObjType) + else if(obj_type==ObjectType::Type) { type=dynamic_cast(object); if(type->getConfiguration()==Type::BaseType) @@ -475,7 +475,7 @@ void FunctionWidget::validateConfiguredFunction(void) } } } - else if(obj_type==ObjectType::ObjEventTrigger) + else if(obj_type==ObjectType::EventTrigger) { dynamic_cast(object)->setFunction(func); } @@ -504,7 +504,7 @@ void FunctionWidget::applyConfiguration(void) startConfiguration(); func=dynamic_cast(this->object); - func->setLanguage(model->getObject(language_cmb->currentText(), ObjectType::ObjLanguage)); + func->setLanguage(model->getObject(language_cmb->currentText(), ObjectType::Language)); func->setFunctionType(func_type_cmb->currentText()); func->setWindowFunction(window_func_chk->isChecked()); func->setLeakProof(leakproof_chk->isChecked()); diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 6000836f80..1abfd9b32b 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -18,10 +18,10 @@ #include "genericsqlwidget.h" -GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjGenericSQL) +GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::GenericSql) { Ui_GenericSQLWidget::setupUi(this); - configureFormLayout(genericsql_grid, ObjectType::ObjGenericSQL); + configureFormLayout(genericsql_grid, ObjectType::GenericSql); definition_txt = PgModelerUiNs::createNumberedTextEditor(sqlcode_grp, true); definition_hl = new SyntaxHighlighter(definition_txt); diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index 1bcf706a95..16e74603b8 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -18,7 +18,7 @@ #include "indexwidget.h" -IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjIndex) +IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Index) { try { @@ -40,7 +40,7 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: grid->addWidget(elements_tab,0,0); tabWidget->widget(1)->setLayout(grid); - configureFormLayout(index_grid, ObjectType::ObjIndex); + configureFormLayout(index_grid, ObjectType::Index); IndexingType::getTypes(list); indexing_cmb->addItems(list); diff --git a/libpgmodeler_ui/src/languagewidget.cpp b/libpgmodeler_ui/src/languagewidget.cpp index 10e199d2e3..2388f8cdb6 100644 --- a/libpgmodeler_ui/src/languagewidget.cpp +++ b/libpgmodeler_ui/src/languagewidget.cpp @@ -18,7 +18,7 @@ #include "languagewidget.h" -LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjLanguage) +LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Language) { try { @@ -29,15 +29,15 @@ LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, Object func_validator_sel=nullptr; func_inline_sel=nullptr; - func_handler_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); - func_validator_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); - func_inline_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + func_handler_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); + func_validator_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); + func_inline_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); language_grid->addWidget(func_handler_sel,1,1,1,2); language_grid->addWidget(func_validator_sel,2,1,1,2); language_grid->addWidget(func_inline_sel,3,1,1,2); - configureFormLayout(language_grid, ObjectType::ObjLanguage); + configureFormLayout(language_grid, ObjectType::Language); frame=generateInformationFrame(trUtf8("The functions to be assigned to the language should have, respectively, the following signatures:

Handler Function: language_handler function()
Validator Function: void function(oid)
Inline Function: void function(internal)")); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index eeac9eae2a..03e4ea1918 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -898,7 +898,7 @@ void MainWindow::addModel(const QString &filename) models_tbw->setTabToolTip(models_tbw->currentIndex(), filename); //Get the "public" schema and set as system object - public_sch=dynamic_cast(model_tab->db_model->getObject(QString("public"), ObjectType::ObjSchema)); + public_sch=dynamic_cast(model_tab->db_model->getObject(QString("public"), ObjectType::Schema)); if(public_sch) public_sch->setSystemObject(true); model_tab->db_model->setInvalidated(false); @@ -1158,7 +1158,7 @@ void MainWindow::setGridOptions(void) current_model->scene->alignObjectsToGrid(); //Forcing the relationship updating to fit the new position of the tables - current_model->getDatabaseModel()->setObjectsModified({ ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); + current_model->getDatabaseModel()->setObjectsModified({ ObjectType::Relationship, ObjectType::BaseRelationship }); } //Redraw the scene to apply the new grid options @@ -2042,7 +2042,7 @@ void MainWindow::toggleCompactView(void) { model_wgt = dynamic_cast(models_tbw->widget(idx)); model_wgt->toggleAllExtendedAttributes(action_compact_view->isChecked()); - model_wgt->getDatabaseModel()->setObjectsModified({ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjSchema}); + model_wgt->getDatabaseModel()->setObjectsModified({ ObjectType::Table, ObjectType::View, ObjectType::Relationship, ObjectType::BaseRelationship, ObjectType::Schema}); } QApplication::restoreOverrideCursor(); diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 1442e4a3b9..24d316b858 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -307,7 +307,7 @@ void MetadataHandlingForm::updateProgress(int progress, QString msg, unsigned in QString fmt_msg=PgModelerUiNs::formatMessage(msg); QPixmap icon; - if(obj_type==ObjectType::ObjBaseObject) + if(obj_type==ObjectType::BaseObject) { if(progress==100) icon=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index c777d1df27..a5b986296d 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -466,7 +466,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); - obj_oids[ObjectType::ObjDatabase].push_back(db_cmb->currentData().value()); + obj_oids[ObjectType::Database].push_back(db_cmb->currentData().value()); if(thread_id == SrcImportThread) { @@ -807,7 +807,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType } else if(diff_thread && diff_thread->isRunning()) { - if((progress == 0 || progress == 100) && obj_type==ObjectType::ObjBaseObject) + if((progress == 0 || progress == 100) && obj_type==ObjectType::BaseObject) { PgModelerUiNs::createOutputTreeItem(output_trw, msg, QPixmap(PgModelerUiNs::getIconPath("msgbox_info")), @@ -823,7 +823,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_aux = diff_progress + (progress/3); - if(obj_type==ObjectType::ObjBaseObject) + if(obj_type==ObjectType::BaseObject) ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); else ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); @@ -840,7 +840,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_lbl->setText(msg); progress_pb->setValue(progress); - if(obj_type!=ObjectType::ObjBaseObject) + if(obj_type!=ObjectType::BaseObject) progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(obj_type))); else progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index 8b0ab73ded..0ea365c6f1 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -141,7 +141,7 @@ void ModelExportForm::updateProgress(int progress, QString msg, ObjectType obj_t progress_lbl->setText(text); progress_pb->setValue(progress); - if(obj_type!=ObjectType::ObjBaseObject) + if(obj_type!=ObjectType::BaseObject) ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else if(!cmd.isEmpty()) ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index d8d3feb056..3aa56a5b76 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -11,7 +11,7 @@ void ModelExportHelper::resetExportParams(void) sql_gen_progress=progress=0; db_created=ignore_dup=drop_db=drop_objs=export_canceled=false; simulate=use_tmp_names=db_sql_reenabled=false; - created_objs[ObjectType::ObjRole]=created_objs[ObjectType::ObjTablespace]=-1; + created_objs[ObjectType::Role]=created_objs[ObjectType::Tablespace]=-1; db_model=nullptr; connection=nullptr; scene=nullptr; @@ -72,11 +72,11 @@ void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &file BaseObject::setPgSQLVersion(pgsql_ver); emit s_progressUpdated(progress, trUtf8("Generating SQL code for PostgreSQL `%1'").arg(BaseObject::getPgSQLVersion()), - ObjectType::ObjBaseObject); + ObjectType::BaseObject); progress=1; db_model->saveModel(filename, SchemaParser::SqlDefinition); - emit s_progressUpdated(100, trUtf8("Output SQL file `%1' successfully written.").arg(filename), ObjectType::ObjBaseObject); + emit s_progressUpdated(100, trUtf8("Output SQL file `%1' successfully written.").arg(filename), ObjectType::BaseObject); emit s_exportFinished(); } catch(Exception &e) @@ -198,7 +198,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename painter.setRenderHint(QPainter::SmoothPixmapTransform, true); emit s_progressUpdated((page_idx/static_cast(pages.size())) * 90, - trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), ObjectType::ObjBaseObject); + trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), ObjectType::BaseObject); //Render the entire viewport onto the pixmap view->render(&painter, QRectF(QPointF(0,0), pix.size()), retv); @@ -225,7 +225,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename if(!export_canceled) { - emit s_progressUpdated(100, trUtf8("Output image `%1' successfully written.").arg(filename), ObjectType::ObjBaseObject); + emit s_progressUpdated(100, trUtf8("Output image `%1' successfully written.").arg(filename), ObjectType::BaseObject); emit s_exportFinished(); } else @@ -304,7 +304,7 @@ void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename svg_file.close(); } - emit s_progressUpdated(100, trUtf8("Output file `%1' successfully written.").arg(filename), ObjectType::ObjBaseObject); + emit s_progressUpdated(100, trUtf8("Output file `%1' successfully written.").arg(filename), ObjectType::BaseObject); emit s_exportFinished(); } @@ -314,7 +314,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c QString version, sql_cmd, buf, sql_cmd_comment; Connection new_db_conn; unsigned i, count; - ObjectType types[]={ObjectType::ObjRole, ObjectType::ObjTablespace}; + ObjectType types[]={ObjectType::Role, ObjectType::Tablespace}; BaseObject *object=nullptr; QString tmpl_comm_regexp = QString("(COMMENT)( )+(ON)( )+(%1)(.)+(\n)(") + ParsersAttributes::DDL_END_TOKEN + QString(")"); QRegExp comm_regexp; @@ -337,7 +337,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c export_canceled=false; db_created=false; progress=sql_gen_progress=0; - created_objs[ObjectType::ObjRole]=created_objs[ObjectType::ObjTablespace]=-1; + created_objs[ObjectType::Role]=created_objs[ObjectType::Tablespace]=-1; errors.clear(); //Retrive the DBMS version in order to generate the correct code @@ -429,7 +429,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c sql_cmd=object->getCodeDefinition(SchemaParser::SqlDefinition); - if(types[type_id] == ObjectType::ObjTablespace) + if(types[type_id] == ObjectType::Tablespace) { comm_regexp = QRegExp(tmpl_comm_regexp.arg(object->getSQLName())); pos = comm_regexp.indexIn(sql_cmd); @@ -469,7 +469,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c emit s_progressUpdated(progress, trUtf8("Creating database `%1'") .arg(db_model->getName()), - ObjectType::ObjDatabase); + ObjectType::Database); sql_cmd=db_model->__getCodeDefinition(SchemaParser::SqlDefinition); pos = comm_regexp.indexIn(sql_cmd); @@ -582,12 +582,12 @@ void ModelExportHelper::saveGenAtlerCmdsStatus(DatabaseModel *db_model) Table *tab=nullptr; Relationship *rel=nullptr; - objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjTable)->begin(), - db_model->getObjectList(ObjectType::ObjTable)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::Table)->begin(), + db_model->getObjectList(ObjectType::Table)->end()); //Store the relationship on the auxiliary vector but only many-to-many are considered - objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjRelationship)->begin(), - db_model->getObjectList(ObjectType::ObjRelationship)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::Relationship)->begin(), + db_model->getObjectList(ObjectType::Relationship)->end()); alter_cmds_status.clear(); @@ -630,12 +630,12 @@ void ModelExportHelper::restoreGenAtlerCmdsStatus(void) void ModelExportHelper::undoDBMSExport(DatabaseModel *db_model, Connection &conn, bool use_tmp_names) { QString drop_cmd=QString("DROP %1 %2;"); - ObjectType types[]={ObjectType::ObjRole, ObjectType::ObjTablespace}; + ObjectType types[]={ObjectType::Role, ObjectType::Tablespace}; int type_id; BaseObject *object=nullptr; //In case of error during the export all created object are removed - if(db_created || created_objs[ObjectType::ObjRole] >= 0 || created_objs[ObjectType::ObjTablespace] >= 0) + if(db_created || created_objs[ObjectType::Role] >= 0 || created_objs[ObjectType::Tablespace] >= 0) { emit s_progressUpdated(99, trUtf8("Destroying objects created on the server.")); @@ -681,20 +681,20 @@ void ModelExportHelper::generateTempObjectNames(DatabaseModel *db_model) QTextStream stream(&tmp_name); QDateTime dt=QDateTime::currentDateTime(); QCryptographicHash hash(QCryptographicHash::Md5); - map obj_suffixes={ { ObjectType::ObjDatabase, QString("db_") }, - { ObjectType::ObjRole, QString("rl_")}, - { ObjectType::ObjTablespace, QString("tb_")} }; + map obj_suffixes={ { ObjectType::Database, QString("db_") }, + { ObjectType::Role, QString("rl_")}, + { ObjectType::Tablespace, QString("tb_")} }; orig_obj_names.clear(); orig_obj_names[db_model]=db_model->getName(); - for(auto &role : *db_model->getObjectList(ObjectType::ObjRole)) + for(auto &role : *db_model->getObjectList(ObjectType::Role)) { if(!role->isSystemObject()) orig_obj_names[role]=role->getName(); } - for(auto &tabspc : *db_model->getObjectList(ObjectType::ObjTablespace)) + for(auto &tabspc : *db_model->getObjectList(ObjectType::Tablespace)) { if(!tabspc->isSystemObject()) orig_obj_names[tabspc]=tabspc->getName(); @@ -763,7 +763,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co alter_tab=QString("ALTER TABLE"); vector db_sql_cmds; QTextStream ts; - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; bool ddl_tk_found=false, is_create=false, is_drop=false; unsigned aux_prog=0, curr_size=0, buf_size=sql_buf.size(), factor=(db_name.isEmpty() ? 70 : 90); @@ -776,13 +776,13 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co drop_tab_obj_reg(QString("^((\\-\\-)+( )*)+(%1)(.)+(DROP)(.)+").arg(alter_tab)), reg_aux; - vector obj_types={ ObjectType::ObjRole, ObjectType::ObjFunction, ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjPolicy, - ObjectType::ObjRule, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjDomain, - ObjectType::ObjSchema, ObjectType::ObjAggregate, ObjectType::ObjOpFamily, - ObjectType::ObjOpClass, ObjectType::ObjOperator, ObjectType::ObjSequence, - ObjectType::ObjConversion, ObjectType::ObjCast, ObjectType::ObjLanguage, - ObjectType::ObjCollation, ObjectType::ObjExtension, ObjectType::ObjType, - ObjectType::ObjEventTrigger, ObjectType::ObjDatabase }; + vector obj_types={ ObjectType::Role, ObjectType::Function, ObjectType::Trigger, ObjectType::Index, ObjectType::Policy, + ObjectType::Rule, ObjectType::Table, ObjectType::View, ObjectType::Domain, + ObjectType::Schema, ObjectType::Aggregate, ObjectType::OpFamily, + ObjectType::OpClass, ObjectType::Operator, ObjectType::Sequence, + ObjectType::Conversion, ObjectType::Cast, ObjectType::Language, + ObjectType::Collation, ObjectType::Extension, ObjectType::Type, + ObjectType::EventTrigger, ObjectType::Database }; /* Extract each SQL command from the buffer and execute them separately. This is done @@ -845,7 +845,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co { aux_cmd.remove('"'); aux_cmd.remove(QString("IF EXISTS ")); - obj_type=(aux_cmd.contains(QString("COLUMN")) ? ObjectType::ObjColumn : ObjectType::ObjConstraint); + obj_type=(aux_cmd.contains(QString("COLUMN")) ? ObjectType::Column : ObjectType::Constraint); reg_aux=QRegExp(QString("(COLUMN|CONSTRAINT)( )+")); //Extracting the table name @@ -893,21 +893,21 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co //Appeding special tokens when the object is an index or view if(lin.startsWith(QString("CREATE")) || lin.startsWith(QString("ALTER"))) { - if(obj_tp==ObjectType::ObjIndex) + if(obj_tp==ObjectType::Index) { lin.remove(QString("UNIQUE")); lin.remove(QString("CONCURRENTLY")); } - else if(obj_tp==ObjectType::ObjView) + else if(obj_tp==ObjectType::View) { lin.remove(QString("MATERIALIZED")); lin.remove(QString("RECURSIVE")); } - else if(obj_tp==ObjectType::ObjTable) + else if(obj_tp==ObjectType::Table) { lin.remove(QString("UNLOGGED")); } - else if(obj_tp==ObjectType::ObjFunction) + else if(obj_tp==ObjectType::Function) { lin.remove(QString("OR REPLACE")); } @@ -933,12 +933,12 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co lin=lin.mid(reg_aux.matchedLength(), sql_cmd.indexOf('\n')).simplified(); lin.remove('"'); - if(obj_tp!=ObjectType::ObjCast) + if(obj_tp!=ObjectType::Cast) { int spc_idx=lin.indexOf(' '); obj_name=lin.mid(0, (spc_idx >= 0 ? spc_idx + 1 : lin.size())); - if(obj_tp!=ObjectType::ObjFunction) + if(obj_tp!=ObjectType::Function) { obj_name=obj_name.remove('(').simplified(); obj_name=obj_name.remove(')').simplified(); @@ -971,13 +971,13 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co else if(!sql_cmd.trimmed().isEmpty()) { //General commands like grant, revoke or set aren't explicitly shown - emit s_progressUpdated(aux_prog, trUtf8("Running auxiliary command."), ObjectType::ObjBaseObject, sql_cmd); + emit s_progressUpdated(aux_prog, trUtf8("Running auxiliary command."), ObjectType::BaseObject, sql_cmd); } //Executes the extracted SQL command if(!sql_cmd.isEmpty()) { - if(obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::Database) conn.executeDDLCommand(sql_cmd); else db_sql_cmds.push_back(sql_cmd); diff --git a/libpgmodeler_ui/src/modelexporthelper.h b/libpgmodeler_ui/src/modelexporthelper.h index 2dc5a6e86c..126391a661 100644 --- a/libpgmodeler_ui/src/modelexporthelper.h +++ b/libpgmodeler_ui/src/modelexporthelper.h @@ -189,7 +189,7 @@ class ModelExportHelper: public QObject { signals: //! \brief This singal is emitted whenever the export progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::ObjBaseObject, QString cmd=QString(), bool is_code_gen=false); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::BaseObject, QString cmd=QString(), bool is_code_gen=false); //! \brief This signal is emited when the export has finished void s_exportFinished(void); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index a292018347..5687370f7b 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -120,8 +120,8 @@ void ModelObjectsWidget::editObject(void) { //If the user double-clicked the item "Permission (n)" on tree view if(sender()==objectstree_tw && objectstree_tw->currentItem() && - objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt() == ~ObjectType::ObjPermission) - model_wgt->showObjectForm(ObjectType::ObjPermission, reinterpret_cast(objectstree_tw->currentItem()->data(0, Qt::UserRole).value())); + objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt() == ~ObjectType::Permission) + model_wgt->showObjectForm(ObjectType::Permission, reinterpret_cast(objectstree_tw->currentItem()->data(0, Qt::UserRole).value())); //If the user double-clicked a permission on list view else if(sender()==objectslist_tbw && objectslist_tbw->currentRow() >= 0) { @@ -129,7 +129,7 @@ void ModelObjectsWidget::editObject(void) Permission *perm=dynamic_cast(obj); if(perm) - model_wgt->showObjectForm(ObjectType::ObjPermission, perm->getObject()); + model_wgt->showObjectForm(ObjectType::Permission, perm->getObject()); else model_wgt->editObject(); } @@ -140,7 +140,7 @@ void ModelObjectsWidget::editObject(void) void ModelObjectsWidget::selectObject(void) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; ModelWidget *model_wgt=nullptr; if(!simplified_view && this->model_wgt) @@ -161,15 +161,15 @@ void ModelObjectsWidget::selectObject(void) //If user select a group item popups a "New [OBJECT]" menu if((!simplified_view || (simplified_view && enable_obj_creation)) && !selected_object && QApplication::mouseButtons()==Qt::RightButton && - obj_type!=ObjectType::ObjColumn && obj_type!=ObjectType::ObjConstraint && obj_type!=ObjectType::ObjRule && - obj_type!=ObjectType::ObjIndex && obj_type!=ObjectType::ObjTrigger && obj_type!=ObjectType::ObjPermission) + obj_type!=ObjectType::Column && obj_type!=ObjectType::Constraint && obj_type!=ObjectType::Rule && + obj_type!=ObjectType::Index && obj_type!=ObjectType::Trigger && obj_type!=ObjectType::Permission) { QAction act(QPixmap(PgModelerUiNs::getIconPath(obj_type)), trUtf8("New") + QString(" ") + BaseObject::getTypeName(obj_type), nullptr); QMenu popup; //If not a relationship, connect the action to the addNewObject method of the model wiget - if(obj_type!=ObjectType::ObjRelationship) + if(obj_type!=ObjectType::Relationship) { act.setData(QVariant(~obj_type)); connect(&act, SIGNAL(triggered()), model_wgt, SLOT(addNewObject())); @@ -198,7 +198,7 @@ void ModelObjectsWidget::selectObject(void) } } - if(obj_type!=ObjectType::ObjPermission && selected_object && !simplified_view) + if(obj_type!=ObjectType::Permission && selected_object && !simplified_view) { model_wgt->scene->clearSelection(); model_wgt->configureObjectMenu(selected_object); @@ -229,7 +229,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr tab_obj=dynamic_cast(object); item=new QTreeWidgetItem(root); - if(obj_type==ObjectType::ObjFunction) + if(obj_type==ObjectType::Function) { Function *func=dynamic_cast(object); func->createSignature(false); @@ -237,13 +237,13 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr obj_name=func->getSignature(); func->createSignature(true); } - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) { Operator *oper=dynamic_cast(object); item->setText(0, oper->getSignature(false)); obj_name=oper->getSignature(false); } - else if(obj_type==ObjectType::ObjOpClass || obj_type == ObjectType::ObjOpFamily) + else if(obj_type==ObjectType::OpClass || obj_type == ObjectType::OpFamily) { obj_name=object->getSignature(false); obj_name.replace(QRegExp("( )+(USING)( )+"), QString(" [")); @@ -279,11 +279,11 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr item->setFont(0,font); - if(obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjRelationship) + if(obj_type==ObjectType::BaseRelationship || obj_type==ObjectType::Relationship) { rel_type=dynamic_cast(object)->getRelationshipType(); - if(obj_type==ObjectType::ObjBaseRelationship) + if(obj_type==ObjectType::BaseRelationship) { if(rel_type==BaseRelationship::RelationshipFk) str_aux=QString("fk"); @@ -301,7 +301,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr else if(rel_type==BaseRelationship::RelationshipGen) str_aux=QString("gen"); } - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) { constr_type=dynamic_cast(object)->getConstraintType(); @@ -324,19 +324,19 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr void ModelObjectsWidget::setObjectVisible(ObjectType obj_type, bool visible) { - if(obj_type!=ObjectType::ObjBaseObject && obj_type!=ObjectType::ObjBaseTable) + if(obj_type!=ObjectType::BaseObject && obj_type!=ObjectType::BaseTable) visible_objs_map[obj_type]=visible; if(visible && simplified_view) { - if(obj_type!=ObjectType::ObjDatabase) - visible_objs_map[ObjectType::ObjDatabase]=true; + if(obj_type!=ObjectType::Database) + visible_objs_map[ObjectType::Database]=true; if(TableObject::isTableObject(obj_type)) - visible_objs_map[ObjectType::ObjTable]=visible_objs_map[ObjectType::ObjSchema]=true; + visible_objs_map[ObjectType::Table]=visible_objs_map[ObjectType::Schema]=true; if(BaseObject::acceptsSchema(obj_type)) - visible_objs_map[ObjectType::ObjSchema]=true; + visible_objs_map[ObjectType::Schema]=true; } } @@ -461,28 +461,28 @@ void ModelObjectsWidget::updateObjectsList(void) void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) { - if(db_model && visible_objs_map[ObjectType::ObjSchema]) + if(db_model && visible_objs_map[ObjectType::Schema]) { BaseObject *schema=nullptr; vector obj_list; QFont font; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr, *item3=nullptr; - vector types = BaseObject::getChildObjectTypes(ObjectType::ObjSchema); + vector types = BaseObject::getChildObjectTypes(ObjectType::Schema); int count, count2, i; - QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::ObjSchema)) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::Schema)) + QString("_grp"))); //Removing the ObjectType::ObjTable and ObjectType::ObjView types since they are handled separetedly - types.erase(std::find(types.begin(), types.end(), ObjectType::ObjTable)); - types.erase(std::find(types.begin(), types.end(), ObjectType::ObjView)); + types.erase(std::find(types.begin(), types.end(), ObjectType::Table)); + types.erase(std::find(types.begin(), types.end(), ObjectType::View)); //Get the current schema count on database - count=(db_model->getObjectCount(ObjectType::ObjSchema)); + count=(db_model->getObjectCount(ObjectType::Schema)); item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setData(1, Qt::UserRole, QVariant(~ObjectType::ObjSchema)); + item->setData(1, Qt::UserRole, QVariant(~ObjectType::Schema)); //Create the schema group item - item->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(ObjectType::ObjSchema)).arg(count)); + item->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(ObjectType::Schema)).arg(count)); font=item->font(0); font.setItalic(true); item->setFont(0, font); @@ -500,7 +500,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) } else { - schema=db_model->getObject(i, ObjectType::ObjSchema); + schema=db_model->getObject(i, ObjectType::Schema); item2=createItemForObject(schema, item); } @@ -544,26 +544,26 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *schema) { - if(db_model && visible_objs_map[ObjectType::ObjTable]) + if(db_model && visible_objs_map[ObjectType::Table]) { vector obj_list; Table *table=nullptr; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr; QFont font; - vector types = BaseObject::getChildObjectTypes(ObjectType::ObjTable); - QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::ObjTable) + QString("_grp"))); + vector types = BaseObject::getChildObjectTypes(ObjectType::Table); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::Table) + QString("_grp"))); try { //Get all tables that belongs to the specified schema - obj_list=db_model->getObjects(ObjectType::ObjTable, schema); + obj_list=db_model->getObjects(ObjectType::Table, schema); //Create a table group item item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setText(0,BaseObject::getTypeName(ObjectType::ObjTable) + + item->setText(0,BaseObject::getTypeName(ObjectType::Table) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant(~ObjectType::ObjTable)); + item->setData(1, Qt::UserRole, QVariant(~ObjectType::Table)); font=item->font(0); font.setItalic(true); @@ -602,28 +602,28 @@ void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *sche void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schema) { - if(db_model && visible_objs_map[ObjectType::ObjView]) + if(db_model && visible_objs_map[ObjectType::View]) { BaseObject *object=nullptr; vector obj_list; View *view=nullptr; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr; QFont font; - ObjectType types[]={ ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex }; + ObjectType types[]={ ObjectType::Rule, ObjectType::Trigger, ObjectType::Index }; int count, count1, type_cnt=sizeof(types)/sizeof(ObjectType), i, i1, i2; - QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::ObjView)) + QString("_grp"))); + QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::View)) + QString("_grp"))); try { //Get all views that belongs to the specified schema - obj_list=db_model->getObjects(ObjectType::ObjView, schema); + obj_list=db_model->getObjects(ObjectType::View, schema); //Create a table group item item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setText(0,BaseObject::getTypeName(ObjectType::ObjView) + + item->setText(0,BaseObject::getTypeName(ObjectType::View) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant(~ObjectType::ObjView)); + item->setData(1, Qt::UserRole, QVariant(~ObjectType::View)); font=item->font(0); font.setItalic(true); @@ -670,7 +670,7 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject { try { - if(db_model && visible_objs_map[ObjectType::ObjPermission] && + if(db_model && visible_objs_map[ObjectType::Permission] && Permission::acceptsPermission(object->getObjectType())) { vector perms; @@ -683,11 +683,11 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject font.setItalic(true); item->setFont(0, font); item->setText(0, QString("%1 (%2)") - .arg(BaseObject::getTypeName(ObjectType::ObjPermission)) + .arg(BaseObject::getTypeName(ObjectType::Permission)) .arg(perms.size())); item->setData(0, Qt::UserRole, generateItemValue(object)); - item->setData(1, Qt::UserRole, static_cast(ObjectType::ObjPermission)); + item->setData(1, Qt::UserRole, static_cast(ObjectType::Permission)); } } catch(Exception &e) @@ -707,10 +707,10 @@ void ModelObjectsWidget::updateDatabaseTree(void) QTreeWidgetItem *root=nullptr,*item1=nullptr, *item2=nullptr; QFont font; vector ref_list, tree_state, obj_list; - ObjectType types[]={ ObjectType::ObjRole, ObjectType::ObjTablespace, - ObjectType::ObjLanguage, ObjectType::ObjCast, ObjectType::ObjTextbox, - ObjectType::ObjRelationship, ObjectType::ObjEventTrigger, - ObjectType::ObjTag, ObjectType::ObjGenericSQL, ObjectType::ObjExtension }; + ObjectType types[]={ ObjectType::Role, ObjectType::Tablespace, + ObjectType::Language, ObjectType::Cast, ObjectType::Textbox, + ObjectType::Relationship, ObjectType::EventTrigger, + ObjectType::Tag, ObjectType::GenericSql, ObjectType::Extension }; unsigned count, i, i1, type_cnt=sizeof(types)/sizeof(ObjectType); try @@ -721,7 +721,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) objectstree_tw->setUpdatesEnabled(false); objectstree_tw->clear(); - if(visible_objs_map[ObjectType::ObjDatabase]) + if(visible_objs_map[ObjectType::Database]) { root=createItemForObject(db_model); objectstree_tw->insertTopLevelItem(0,root); @@ -741,10 +741,10 @@ void ModelObjectsWidget::updateDatabaseTree(void) obj_list=(*db_model->getObjectList(types[i])); //Special case for relationship, merging the base relationship list to the relationship list - if(types[i]==ObjectType::ObjRelationship) + if(types[i]==ObjectType::Relationship) { vector obj_list_aux; - obj_list_aux=(*db_model->getObjectList(ObjectType::ObjBaseRelationship)); + obj_list_aux=(*db_model->getObjectList(ObjectType::BaseRelationship)); obj_list.insert(obj_list.end(), obj_list_aux.begin(), obj_list_aux.end()); } @@ -760,7 +760,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) object=obj_list.at(i1); item2=createItemForObject(object, item1); - if(types[i]==ObjectType::ObjTag) + if(types[i]==ObjectType::Tag) { db_model->getObjectReferences(object, ref_list); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 6ca096677a..7253ac5780 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -123,7 +123,7 @@ void ModelsDiffHelper::cancelDiff(void) void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned diff_type) { - ObjectType types[2]={ ObjectType::ObjColumn, ObjectType::ObjConstraint }; + ObjectType types[2]={ ObjectType::Column, ObjectType::Constraint }; vector *tab_objs=nullptr; Constraint *constr=nullptr; Table *ref_tab=nullptr, *comp_tab=nullptr; @@ -168,7 +168,7 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d at diffModels() */ if(aux_obj && diff_type!=ObjectsDiffInfo::DropObject && ((tab_obj->isAddedByGeneralization() || !tab_obj->isAddedByLinking() || - (aux_obj->getObjectType()==ObjectType::ObjColumn && tab_obj->isAddedByLinking())) || + (aux_obj->getObjectType()==ObjectType::Column && tab_obj->isAddedByLinking())) || (constr && constr->getConstraintType()!=ConstraintType::ForeignKey))) { //If there are some differences on the XML code of the objects @@ -240,9 +240,9 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) 1) ObjectType::ObjBaseRelationship objects 2) Objects which SQL code is disabled or system objects 3) Cluster objects such as roles and tablespaces (when the operatoin is DROP and keep_cluster_objs is true) */ - if(obj_type!=ObjectType::ObjBaseRelationship && + if(obj_type!=ObjectType::BaseRelationship && !object->isSystemObject() && !object->isSQLDisabled() && - ((diff_type==ObjectsDiffInfo::DropObject && (!diff_opts[OptKeepClusterObjs] || (diff_opts[OptKeepClusterObjs] && obj_type!=ObjectType::ObjRole && obj_type!=ObjectType::ObjTablespace))) || + ((diff_type==ObjectsDiffInfo::DropObject && (!diff_opts[OptKeepClusterObjs] || (diff_opts[OptKeepClusterObjs] && obj_type!=ObjectType::Role && obj_type!=ObjectType::Tablespace))) || (diff_type!=ObjectsDiffInfo::DropObject))) { emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), @@ -250,11 +250,11 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) object->getObjectType()); //Processing objects that are not database, table child object (they are processed further) - if(obj_type!=ObjectType::ObjDatabase && !TableObject::isTableObject(obj_type)) + if(obj_type!=ObjectType::Database && !TableObject::isTableObject(obj_type)) { /* Processing permissions. If the operation is DROP and keep_obj_perms is true the the permission is ignored */ - if(obj_type==ObjectType::ObjPermission && + if(obj_type==ObjectType::Permission && ((diff_type==ObjectsDiffInfo::DropObject && !diff_opts[OptKeepObjectPerms]) || @@ -265,7 +265,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) generateDiffInfo(diff_type, object); //Processing relationship (in this case only generalization and patitioning ones are considered) - else if(obj_type==ObjectType::ObjRelationship) + else if(obj_type==ObjectType::Relationship) { Table *ref_tab=nullptr, *rec_tab=nullptr; Relationship *rel=dynamic_cast(object); @@ -299,14 +299,14 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) } } } - else if(obj_type!=ObjectType::ObjPermission) + else if(obj_type!=ObjectType::Permission) { //Get the object from the database obj_name=object->getSignature(); aux_object=aux_model->getObject(obj_name, obj_type); //Special case for many-to-many relationships - if(obj_type==ObjectType::ObjTable && !aux_object) + if(obj_type==ObjectType::Table && !aux_object) aux_object=getRelNNTable(obj_name, aux_model); if(diff_type != ObjectsDiffInfo::DropObject && aux_object) @@ -339,7 +339,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) generateDiffInfo(ObjectsDiffInfo::AlterObject, object, aux_object); //If the object is a table, do additional comparision between their child objects - if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && object->getObjectType()==ObjectType::ObjTable) + if((!diff_opts[OptForceRecreation] || diff_opts[OptRecreateUnchangeble]) && object->getObjectType()==ObjectType::Table) { Table *tab=dynamic_cast
(object), *aux_tab=dynamic_cast
(aux_object); diffTables(tab, aux_tab, ObjectsDiffInfo::DropObject); @@ -421,7 +421,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) if(aux_base_tab) { - if(obj_type==ObjectType::ObjConstraint) + if(obj_type==ObjectType::Constraint) { Table *aux_table=dynamic_cast
(aux_base_tab); aux_tab_obj=aux_table->getObject(obj_name, obj_type); @@ -444,7 +444,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) BaseObject *ModelsDiffHelper::getRelNNTable(const QString &obj_name, DatabaseModel *model) { - vector *rels=model->getObjectList(ObjectType::ObjRelationship); + vector *rels=model->getObjectList(ObjectType::Relationship); Relationship *rel=nullptr; BaseObject *tab=nullptr; @@ -528,7 +528,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, emit s_objectsDiffInfoGenerated(diff_info); } - if(!diff_opts[OptReuseSequences] || imported_model->getObjectIndex(seq->getSignature(), ObjectType::ObjSequence) < 0) + if(!diff_opts[OptReuseSequences] || imported_model->getObjectIndex(seq->getSignature(), ObjectType::Sequence) < 0) { //Creates a CREATE info with the sequence diff_info=ObjectsDiffInfo(ObjectsDiffInfo::CreateObject, seq, nullptr); @@ -545,7 +545,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, while(itr!=itr_end) { if(itr->getDiffType()==ObjectsDiffInfo::DropObject && - itr->getObject()->getObjectType()==ObjectType::ObjSequence && + itr->getObject()->getObjectType()==ObjectType::Sequence && itr->getObject()->getSignature()==seq->getSignature()) { diff_infos.erase(itr); @@ -584,8 +584,8 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, /* Avoiding columns to be dropped when a sequence linked to them is dropped too. This because a column can be a reference to a sequence so to avoid drop and recreate that column this one will not be erased, unless the column does not exists in the model anymore */ - if((obj_type==ObjectType::ObjSequence && obj->getObjectType()!=ObjectType::ObjColumn) && - (obj_type!=ObjectType::ObjSequence && obj->getObjectType()!=ObjectType::ObjBaseRelationship)) + if((obj_type==ObjectType::Sequence && obj->getObjectType()!=ObjectType::Column) && + (obj_type!=ObjectType::Sequence && obj->getObjectType()!=ObjectType::BaseRelationship)) generateDiffInfo(diff_type, obj); if(diff_canceled) @@ -651,7 +651,7 @@ void ModelsDiffHelper::processDiffInfos(void) emit s_progressUpdated(0, trUtf8("Processing diff infos...")); //Reuniting the schema names to inject a SET search_path command - for(auto &schema : *imported_model->getObjectList(ObjectType::ObjSchema)) + for(auto &schema : *imported_model->getObjectList(ObjectType::Schema)) sch_names.push_back(schema->getName(true)); //Separating the base types @@ -718,13 +718,13 @@ void ModelsDiffHelper::processDiffInfos(void) //Undoing inheritances no_inherit_def+=rel->getAlterRelationshipDefinition(true); } - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) //Unsetting permissions unset_perms+=object->getDropDefinition(diff_opts[OptCascadeMode]); else { //Ordinary drop commands for any object except columns - if(obj_type!=ObjectType::ObjColumn) + if(obj_type!=ObjectType::Column) drop_objs[object->getObjectId()]=getCodeDefinition(object, true); else { @@ -745,14 +745,14 @@ void ModelsDiffHelper::processDiffInfos(void) //Creating inheritances inherit_def+=rel->getAlterRelationshipDefinition(false); } - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) //Setting permissions set_perms+=object->getCodeDefinition(SchemaParser::SqlDefinition); else { /* Special case for constaints: the creation commands for these objects are appended at the very end of create commands secion. Primary keys, unique keys, check constraints and exclude constraints are created after foreign keys */ - if(object->getObjectType()==ObjectType::ObjConstraint) + if(object->getObjectType()==ObjectType::Constraint) { if(dynamic_cast(object)->getConstraintType()==ConstraintType::ForeignKey) create_fks[object->getObjectId()]=getCodeDefinition(object, false); @@ -763,7 +763,7 @@ void ModelsDiffHelper::processDiffInfos(void) { create_objs[object->getObjectId()]=getCodeDefinition(object, false); - if(obj_type==ObjectType::ObjSchema) + if(obj_type==ObjectType::Schema) sch_names.push_back(object->getName(true)); } } @@ -772,7 +772,7 @@ void ModelsDiffHelper::processDiffInfos(void) else if(diff_type==ObjectsDiffInfo::AlterObject) { //Recreating the object instead of generating an ALTER command for it - if((diff_opts[OptForceRecreation] && obj_type!=ObjectType::ObjDatabase) && + if((diff_opts[OptForceRecreation] && obj_type!=ObjectType::Database) && (!diff_opts[OptRecreateUnchangeble] || (diff_opts[OptRecreateUnchangeble] && !object->acceptsAlterCommand() && diff.getObject()->getCodeDefinition(SchemaParser::SqlDefinition).simplified()!= @@ -792,7 +792,7 @@ void ModelsDiffHelper::processDiffInfos(void) { /* Special case for constraints, their code will be appeded to a separated variable in order to create them at the end of diff buffer */ - if(obj->getObjectType()==ObjectType::ObjConstraint) + if(obj->getObjectType()==ObjectType::Constraint) { if(dynamic_cast(obj)->getConstraintType()==ConstraintType::ForeignKey) create_fks[obj->getObjectId()]=getCodeDefinition(obj, false); @@ -812,7 +812,7 @@ void ModelsDiffHelper::processDiffInfos(void) if(diff.getOldObject()) alter_def=diff.getOldObject()->getAlterDefinition(object); - if(obj_type == ObjectType::ObjDatabase && diff_opts[OptPreserveDbName]) + if(obj_type == ObjectType::Database && diff_opts[OptPreserveDbName]) alter_def.remove(QRegExp(QString("(ALTER)( )+(DATABASE)( )+(%1)( )+(RENAME)( )+(TO)(.)*(\\n)").arg(diff.getOldObject()->getSignature()))); if(!alter_def.isEmpty()) @@ -821,7 +821,7 @@ void ModelsDiffHelper::processDiffInfos(void) /* If the object is a column checks if the types of the columns are differents, generating a TRUNCATE TABLE for the parent table */ - if(obj_type==ObjectType::ObjColumn && diff_opts[OptTruncateTables]) + if(obj_type==ObjectType::Column && diff_opts[OptTruncateTables]) { Column *src_col=dynamic_cast(object), *old_col=dynamic_cast(diff.getOldObject()); @@ -887,7 +887,7 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[ParsersAttributes::FK_DEFS]=QString(); attribs[ParsersAttributes::UNSET_PERMS]=unset_perms; attribs[ParsersAttributes::SET_PERMS]=set_perms; - attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjectType::ObjFunction)!=0 ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? ParsersAttributes::_TRUE_ : QString()); attribs[ParsersAttributes::SEARCH_PATH]=(has_diffs ? sch_names.join(',') : QString()); ritr=drop_objs.rbegin(); @@ -956,7 +956,7 @@ QString ModelsDiffHelper::getCodeDefinition(BaseObject *object, bool drop_cmd) /* For columns and constraints it is needed to force the generation of ALTER commands on the parent table */ - if(tab_obj && (tab_obj->getObjectType()==ObjectType::ObjColumn || tab_obj->getObjectType()==ObjectType::ObjConstraint)) + if(tab_obj && (tab_obj->getObjectType()==ObjectType::Column || tab_obj->getObjectType()==ObjectType::Constraint)) { bool gen_alter=false; Table *table=dynamic_cast
(tab_obj->getParentTable()); @@ -1004,9 +1004,9 @@ void ModelsDiffHelper::destroyTempObjects(void) void ModelsDiffHelper::recreateObject(BaseObject *object, vector &drop_objs, vector &create_objs) { if(object && - object->getObjectType()!=ObjectType::ObjBaseRelationship && - object->getObjectType()!=ObjectType::ObjRelationship && - object->getObjectType()!=ObjectType::ObjDatabase) + object->getObjectType()!=ObjectType::BaseRelationship && + object->getObjectType()!=ObjectType::Relationship && + object->getObjectType()!=ObjectType::Database) { vector ref_objs; BaseObject *aux_obj=nullptr; @@ -1034,7 +1034,7 @@ void ModelsDiffHelper::recreateObject(BaseObject *object, vector & /* If the to-be recreate object is a constraint check if it's a pk, if so, the fk's linked to it need to be recreated as well */ - if(aux_obj->getObjectType()==ObjectType::ObjConstraint) + if(aux_obj->getObjectType()==ObjectType::Constraint) { Constraint *constr=dynamic_cast(aux_obj); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.h b/libpgmodeler_ui/src/modelsdiffhelper.h index 846b6f8b5d..d0c61d8330 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.h +++ b/libpgmodeler_ui/src/modelsdiffhelper.h @@ -164,7 +164,7 @@ class ModelsDiffHelper: public QObject { signals: //! \brief This singal is emitted whenever the diff progress changes - void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::ObjBaseObject); + void s_progressUpdated(int progress, QString msg, ObjectType obj_type=ObjectType::BaseObject); //! \brief This signal is emited when the diff has finished void s_diffFinished(void); diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index b96e7d9214..94a1bbc229 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -106,7 +106,7 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) } } - if(aux_obj && (aux_obj->getObjectType()==ObjectType::ObjView || aux_obj->getObjectType()==ObjectType::ObjTable)) + if(aux_obj && (aux_obj->getObjectType()==ObjectType::View || aux_obj->getObjectType()==ObjectType::Table)) { vector base_rels=db_model->getRelationships(dynamic_cast(aux_obj)); for(auto &rel : base_rels) @@ -143,8 +143,8 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) /* If the last element of the referrer objects is a table or view the info object itself need to be renamed since tables and views will not be renamed */ - bool rename_obj=(refs.back()->getObjectType()==ObjectType::ObjTable || - refs.back()->getObjectType()==ObjectType::ObjView); + bool rename_obj=(refs.back()->getObjectType()==ObjectType::Table || + refs.back()->getObjectType()==ObjectType::View); if(rename_obj) { @@ -263,11 +263,11 @@ void ModelValidationHelper::validateModel(void) try { - ObjectType types[]={ ObjectType::ObjRole, ObjectType::ObjTablespace, ObjectType::ObjSchema, ObjectType::ObjLanguage, ObjectType::ObjFunction, - ObjectType::ObjType, ObjectType::ObjDomain, ObjectType::ObjSequence, ObjectType::ObjOperator, ObjectType::ObjOpFamily, - ObjectType::ObjOpClass, ObjectType::ObjCollation, ObjectType::ObjTable, ObjectType::ObjExtension, ObjectType::ObjView, ObjectType::ObjRelationship }, - aux_types[]={ ObjectType::ObjTable, ObjectType::ObjView }, - tab_obj_types[]={ ObjectType::ObjConstraint, ObjectType::ObjIndex }, + ObjectType types[]={ ObjectType::Role, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Language, ObjectType::Function, + ObjectType::Type, ObjectType::Domain, ObjectType::Sequence, ObjectType::Operator, ObjectType::OpFamily, + ObjectType::OpClass, ObjectType::Collation, ObjectType::Table, ObjectType::Extension, ObjectType::View, ObjectType::Relationship }, + aux_types[]={ ObjectType::Table, ObjectType::View }, + tab_obj_types[]={ ObjectType::Constraint, ObjectType::Index }, obj_type; unsigned i, i1, cnt, aux_cnt=sizeof(aux_types)/sizeof(ObjectType), count=sizeof(types)/sizeof(ObjectType), count1=sizeof(tab_obj_types)/sizeof(ObjectType); @@ -282,7 +282,7 @@ void ModelValidationHelper::validateModel(void) map > dup_objects; map >::iterator mitr; QString name, signal_msg=QString("`%1' (%2)"); - bool postgis_exists = db_model->getObjectIndex(QString("postgis"), ObjectType::ObjExtension) >= 0; + bool postgis_exists = db_model->getObjectIndex(QString("postgis"), ObjectType::Extension) >= 0; warn_count=error_count=progress=0; val_infos.clear(); @@ -309,7 +309,7 @@ void ModelValidationHelper::validateModel(void) /* Special validation case: For generalization and copy relationships validates the ids of participant tables. * Reference table cannot own an id greater thant receiver table */ - if(obj_type==ObjectType::ObjRelationship) + if(obj_type==ObjectType::Relationship) { rel=dynamic_cast(object); if(rel->getRelationshipType()==Relationship::RelationshipGen || @@ -362,9 +362,9 @@ void ModelValidationHelper::validateModel(void) /* Validating a special object. The validation made here is to check if the special object (constraint/index/trigger/view) references a column added by a relationship and that relationship is being created after the creation of the special object */ - if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView /* || obj_type==ObjectType::ObjSequence */) + if(obj_type==ObjectType::Table || obj_type==ObjectType::View /* || obj_type==ObjectType::ObjSequence */) { - vector tab_aux_types={ ObjectType::ObjConstraint, ObjectType::ObjTrigger, ObjectType::ObjIndex }; + vector tab_aux_types={ ObjectType::Constraint, ObjectType::Trigger, ObjectType::Index }; vector *tab_objs; vector ref_cols; vector rels; @@ -391,14 +391,14 @@ void ModelValidationHelper::validateModel(void) if(!tab_obj->isAddedByRelationship()) { - if(obj_tp==ObjectType::ObjConstraint) + if(obj_tp==ObjectType::Constraint) { constr=dynamic_cast(tab_obj); if(constr->getConstraintType()!=ConstraintType::PrimaryKey) ref_cols=constr->getRelationshipAddedColumns(); } - else if(obj_tp==ObjectType::ObjTrigger) + else if(obj_tp==ObjectType::Trigger) ref_cols=dynamic_cast(tab_obj)->getRelationshipAddedColumns(); else ref_cols=dynamic_cast(tab_obj)->getRelationshipAddedColumns(); @@ -445,7 +445,7 @@ void ModelValidationHelper::validateModel(void) /* Step 2: Validating name conflitcs between primary keys, unique keys, exclude constraints and indexs of all tables/views. The table and view names are checked too. */ - obj_list=db_model->getObjectList(ObjectType::ObjTable); + obj_list=db_model->getObjectList(ObjectType::Table); itr=obj_list->begin(); //Searching the model's tables and gathering all the constraints and index @@ -520,7 +520,7 @@ void ModelValidationHelper::validateModel(void) // Step 3: Checking if columns of any table is using GiS data types and the postgis extension is not created. if(!postgis_exists) { - obj_list=db_model->getObjectList(ObjectType::ObjTable); + obj_list=db_model->getObjectList(ObjectType::Table); itr=obj_list->begin(); i=0; @@ -529,7 +529,7 @@ void ModelValidationHelper::validateModel(void) table = dynamic_cast
(*itr); itr++; - for(auto &obj : *table->getObjectList(ObjectType::ObjColumn)) + for(auto &obj : *table->getObjectList(ObjectType::Column)) { col = dynamic_cast(obj); @@ -547,8 +547,8 @@ void ModelValidationHelper::validateModel(void) only when there is no validation infos generated because for each broken relationship there is the need to do a revalidation of all relationships */ if(val_infos.empty()) { - obj_list=db_model->getObjectList(ObjectType::ObjRelationship); - itr=db_model->getObjectList(ObjectType::ObjRelationship)->begin(); + obj_list=db_model->getObjectList(ObjectType::Relationship); + itr=db_model->getObjectList(ObjectType::Relationship)->begin(); while(itr!=obj_list->end() && !valid_canceled) { diff --git a/libpgmodeler_ui/src/modelvalidationhelper.h b/libpgmodeler_ui/src/modelvalidationhelper.h index ce23799e76..d8cd5d6483 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.h +++ b/libpgmodeler_ui/src/modelvalidationhelper.h @@ -113,7 +113,7 @@ class ModelValidationHelper: public QObject { void s_validationInfoGenerated(ValidationInfo val_info); //! \brief This signal is emitted when the validation progress changes - void s_progressUpdated(int prog, QString msg, ObjectType obj_type=ObjectType::ObjBaseObject, QString cmd=QString(), bool is_code_gen=false); + void s_progressUpdated(int prog, QString msg, ObjectType obj_type=ObjectType::BaseObject, QString cmd=QString(), bool is_code_gen=false); //! \brief This signal is emitted when the object is processed by the validator void s_objectProcessed(QString obj_name, ObjectType obj_type); diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index b5e1050e3e..6633b09ec8 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -273,7 +273,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) label->setText(trUtf8("The column %1 on %2 (%3) is referencing the geospatial data type %4 but the postgis extension is not present in the model!") .arg(col->getName()) .arg(col->getParentTable()->getSignature(true)) - .arg(BaseObject::getTypeName(ObjectType::ObjTable)) + .arg(BaseObject::getTypeName(ObjectType::Table)) .arg(~col->getType())); } else @@ -450,7 +450,7 @@ void ModelValidationWidget::updateProgress(int prog, QString msg, ObjectType obj msg=PgModelerUiNs::formatMessage(msg); - if(obj_type!=ObjectType::ObjBaseObject) + if(obj_type!=ObjectType::BaseObject) ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); else if(!cmd.isEmpty()) ico=QPixmap(PgModelerUiNs::getIconPath("sqlcmd")); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index d38dac6580..e449fd1cd5 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -81,14 +81,14 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) QAction *action=nullptr; QString str_ico; QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen"), QString("part") }; - ObjectType types[]={ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjTextbox, ObjectType::ObjRelationship, - ObjectType::ObjCast, ObjectType::ObjConversion, ObjectType::ObjDomain, - ObjectType::ObjFunction, ObjectType::ObjAggregate, ObjectType::ObjLanguage, - ObjectType::ObjOpClass, ObjectType::ObjOperator, ObjectType::ObjOpFamily, - ObjectType::ObjRole, ObjectType::ObjSchema, ObjectType::ObjSequence, ObjectType::ObjType, - ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex, ObjectType::ObjPolicy, - ObjectType::ObjTablespace, ObjectType::ObjCollation, ObjectType::ObjExtension, ObjectType::ObjEventTrigger, ObjectType::ObjTag, - ObjectType::ObjGenericSQL }; + ObjectType types[]={ ObjectType::Table, ObjectType::View, ObjectType::Textbox, ObjectType::Relationship, + ObjectType::Cast, ObjectType::Conversion, ObjectType::Domain, + ObjectType::Function, ObjectType::Aggregate, ObjectType::Language, + ObjectType::OpClass, ObjectType::Operator, ObjectType::OpFamily, + ObjectType::Role, ObjectType::Schema, ObjectType::Sequence, ObjectType::Type, + ObjectType::Column, ObjectType::Constraint, ObjectType::Rule, ObjectType::Trigger, ObjectType::Index, ObjectType::Policy, + ObjectType::Tablespace, ObjectType::Collation, ObjectType::Extension, ObjectType::EventTrigger, ObjectType::Tag, + ObjectType::GenericSql }; unsigned i, obj_cnt=sizeof(types)/sizeof(ObjectType), rel_types_id[]={ BaseRelationship::Relationship11, BaseRelationship::Relationship1n, BaseRelationship::RelationshipNn, BaseRelationship::RelationshipDep, @@ -96,7 +96,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) current_zoom=1; modified=panning_mode=false; - new_obj_type=ObjectType::ObjBaseObject; + new_obj_type=ObjectType::BaseObject; //Generating a temporary file name for the model QTemporaryFile tmp_file; @@ -368,17 +368,17 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) //Creating the relationship submenu rels_menu=new QMenu(this); - actions_new_objects[ObjectType::ObjRelationship]->setMenu(rels_menu); + actions_new_objects[ObjectType::Relationship]->setMenu(rels_menu); for(int i=0; i < rel_types_cod.size(); i++) { - str_ico=BaseObject::getSchemaName(ObjectType::ObjRelationship) + rel_types_cod[i]; + str_ico=BaseObject::getSchemaName(ObjectType::Relationship) + rel_types_cod[i]; action=new QAction(QIcon(PgModelerUiNs::getIconPath(str_ico)), BaseRelationship::getRelationshipTypeName(rel_types_id[i], false), this); //Storing a unique identifier for the relationship type - action->setData(QVariant(~ObjectType::ObjRelationship + rel_types_id[i])); + action->setData(QVariant(~ObjectType::Relationship + rel_types_id[i])); connect(action, SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); rels_menu->addAction(action); @@ -388,13 +388,13 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) new_obj_overlay_wgt->setObjectName(QString("new_obj_overlay_wgt")); new_obj_overlay_wgt->setVisible(false); - vector graph_types = { ObjectType::ObjBaseObject, ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjRelationship, ObjectType::ObjTextbox }; + vector graph_types = { ObjectType::BaseObject, ObjectType::Schema, ObjectType::Table, ObjectType::View, ObjectType::Relationship, ObjectType::Textbox }; QStringList labels = { trUtf8("All objects"), trUtf8("Schemas"), trUtf8("Tables"), trUtf8("Views"), trUtf8("Relationships"), trUtf8("Textboxes") }; i=0; for(auto &obj_type : graph_types) { - if(obj_type == ObjectType::ObjBaseObject) + if(obj_type == ObjectType::BaseObject) { action=new QAction(labels[i++], this); action->setShortcut(QKeySequence(trUtf8("Ctrl+A"))); @@ -666,7 +666,7 @@ void ModelWidget::mousePressEvent(QMouseEvent *event) { /* If the user is adding a graphical object, the left click will set the initial position and show the editing form related to the object type */ - if(!simple_obj_creation && (new_obj_type==ObjectType::ObjTable || new_obj_type==ObjectType::ObjTextbox || new_obj_type==ObjectType::ObjView)) + if(!simple_obj_creation && (new_obj_type==ObjectType::Table || new_obj_type==ObjectType::Textbox || new_obj_type==ObjectType::View)) { this->scene->enableRangeSelection(false); this->showObjectForm(new_obj_type, nullptr, nullptr, viewport->mapToScene(event->pos())); @@ -760,20 +760,20 @@ void ModelWidget::handleObjectAddition(BaseObject *object) switch(obj_type) { - case ObjectType::ObjTable: + case ObjectType::Table: item=new TableView(dynamic_cast
(graph_obj)); break; - case ObjectType::ObjView: + case ObjectType::View: item=new GraphicalView(dynamic_cast(graph_obj)); break; - case ObjectType::ObjRelationship: - case ObjectType::ObjBaseRelationship: + case ObjectType::Relationship: + case ObjectType::BaseRelationship: item=new RelationshipView(dynamic_cast(graph_obj)); break; break; - case ObjectType::ObjSchema: + case ObjectType::Schema: if(!graph_obj->isSystemObject() || (graph_obj->isSystemObject() && graph_obj->getName()==QString("public"))) { @@ -808,11 +808,11 @@ void ModelWidget::addNewObject(void) these types after select a table or schema, respectively */ if(selected_objects.size()==1 && (TableObject::isTableObject(obj_type) || - selected_objects[0]->getObjectType()==ObjectType::ObjSchema)) + selected_objects[0]->getObjectType()==ObjectType::Schema)) parent_obj=selected_objects[0]; //Creating a table or view inside a schema - if(parent_obj && parent_obj->getObjectType()==ObjectType::ObjSchema && (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView)) + if(parent_obj && parent_obj->getObjectType()==ObjectType::Schema && (obj_type==ObjectType::Table || obj_type==ObjectType::View)) { BaseObjectView *sch_graph=dynamic_cast(dynamic_cast(parent_obj)->getReceiverObject()); QSizeF size = sch_graph->boundingRect().size(); @@ -829,17 +829,17 @@ void ModelWidget::addNewObject(void) this->showObjectForm(obj_type, nullptr, parent_obj, pos); } - else if(obj_type!=ObjectType::ObjTable && obj_type!=ObjectType::ObjView && - obj_type!=ObjectType::ObjTextbox && obj_type <= ObjectType::ObjBaseTable) + else if(obj_type!=ObjectType::Table && obj_type!=ObjectType::View && + obj_type!=ObjectType::Textbox && obj_type <= ObjectType::BaseTable) this->showObjectForm(obj_type, nullptr, parent_obj); else { /* A small checking to enable the overlay widget to create relationships and other graphical objects without the user click on the canvas area */ - if((obj_type > ObjectType::ObjBaseObject && + if((obj_type > ObjectType::BaseObject && selected_objects.size()==2 && - selected_objects.at(0)->getObjectType()==ObjectType::ObjTable && - selected_objects.at(1)->getObjectType()==ObjectType::ObjTable)) + selected_objects.at(0)->getObjectType()==ObjectType::Table && + selected_objects.at(1)->getObjectType()==ObjectType::Table)) { this->showObjectForm(obj_type); } @@ -847,7 +847,7 @@ void ModelWidget::addNewObject(void) { //Simple table|view|textbox creation if(simple_obj_creation && - (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView || obj_type==ObjectType::ObjTextbox)) + (obj_type==ObjectType::Table || obj_type==ObjectType::View || obj_type==ObjectType::Textbox)) this->showObjectForm(obj_type, nullptr, parent_obj, viewport->mapToScene(viewport->rect().center())); else { @@ -860,7 +860,7 @@ void ModelWidget::addNewObject(void) * we force the enabling of the relationship creation steps. This will automatically selects the current table * as source table of the relationship */ if(selected_objects.size() == 1 && - selected_objects[0]->getObjectType() == ObjectType::ObjTable && new_obj_type > ObjectType::ObjBaseTable) + selected_objects[0]->getObjectType() == ObjectType::Table && new_obj_type > ObjectType::BaseTable) configureObjectSelection(); } } @@ -878,7 +878,7 @@ void ModelWidget::handleObjectRemoval(BaseObject *object) //Updates the parent schema if the removed object were a table or view if(graph_obj->getSchema() && - (graph_obj->getObjectType()==ObjectType::ObjTable || graph_obj->getObjectType()==ObjectType::ObjView)) + (graph_obj->getObjectType()==ObjectType::Table || graph_obj->getObjectType()==ObjectType::View)) dynamic_cast(graph_obj->getSchema())->setModified(true); } @@ -890,7 +890,7 @@ void ModelWidget::handleObjectDoubleClick(BaseGraphicObject *object) if(object) this->showObjectForm(object->getObjectType(), object, nullptr, object->getPosition()); else - this->showObjectForm(ObjectType::ObjDatabase, db_model); + this->showObjectForm(ObjectType::Database, db_model); } void ModelWidget::handleObjectsMovement(bool end_moviment) @@ -945,7 +945,7 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) obj=dynamic_cast(*itr); itr++; - if(obj->getObjectType()==ObjectType::ObjTable || obj->getObjectType()==ObjectType::ObjView) + if(obj->getObjectType()==ObjectType::Table || obj->getObjectType()==ObjectType::View) { Schema *schema=dynamic_cast(dynamic_cast(obj)->getSchema()); @@ -1025,7 +1025,7 @@ void ModelWidget::configureObjectSelection(void) /* Case the new_obj_type is a value greater the ObjectType::ObjBaseTable indicates that the user (un)selected a object using some "Relationship" action */ - if(new_obj_type > ObjectType::ObjBaseTable) + if(new_obj_type > ObjectType::BaseTable) { unsigned count=selected_objects.size(); ObjectType obj_type1, obj_type2; @@ -1037,11 +1037,11 @@ void ModelWidget::configureObjectSelection(void) { //Get the selected objects types obj_type1=selected_objects[0]->getObjectType(); - obj_type2=(count==2 ? selected_objects[1]->getObjectType() : ObjectType::ObjBaseObject); + obj_type2=(count==2 ? selected_objects[1]->getObjectType() : ObjectType::BaseObject); //If there is only one selected object and this is a table, activates the relationship creation if(!scene->isRelationshipLineVisible() && - count==1 && obj_type1==ObjectType::ObjTable && new_obj_type > ObjectType::ObjBaseTable && QApplication::keyboardModifiers()==0) + count==1 && obj_type1==ObjectType::Table && new_obj_type > ObjectType::BaseTable && QApplication::keyboardModifiers()==0) { BaseGraphicObject *graph_obj=dynamic_cast(selected_objects[0]); BaseObjectView *object=dynamic_cast(graph_obj->getReceiverObject()); @@ -1051,15 +1051,15 @@ void ModelWidget::configureObjectSelection(void) object->scenePos().y() + object->boundingRect().height()/2)); } //If the user has selected object that are not tables, cancel the operation - else if(obj_type1!=ObjectType::ObjTable || (obj_type2!=ObjectType::ObjTable && obj_type2!=ObjectType::ObjBaseObject)) + else if(obj_type1!=ObjectType::Table || (obj_type2!=ObjectType::Table && obj_type2!=ObjectType::BaseObject)) { this->cancelObjectAddition(); } /* Case there is only one selected object (table) and the SHIFT key is pressed too, creates a self-relationship. Case there is two selected objects, create a relationship between them */ - else if((count==1 && obj_type1==ObjectType::ObjTable && QApplication::keyboardModifiers()==Qt::ShiftModifier) || - (count==2 && obj_type1==ObjectType::ObjTable && obj_type2==ObjectType::ObjTable)) + else if((count==1 && obj_type1==ObjectType::Table && QApplication::keyboardModifiers()==Qt::ShiftModifier) || + (count==2 && obj_type1==ObjectType::Table && obj_type2==ObjectType::Table)) { /* Forcing no signals to be emitted by the scene while the relationship is being configured to avoid this * method to be called unecessarily */ @@ -1088,7 +1088,7 @@ void ModelWidget::selectAllObjects(void) ObjectType obj_type = static_cast(act->data().toUInt()); - if(obj_type == ObjectType::ObjBaseObject) + if(obj_type == ObjectType::BaseObject) { QPainterPath pth; pth.addRect(scene->sceneRect()); @@ -1102,8 +1102,8 @@ void ModelWidget::selectAllObjects(void) BaseObjectView *obj_view = nullptr; vector objs = *db_model->getObjectList(obj_type); - if(obj_type == ObjectType::ObjRelationship) - objs.insert(objs.end(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->begin(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->end()); + if(obj_type == ObjectType::Relationship) + objs.insert(objs.end(), db_model->getObjectList(ObjectType::BaseRelationship)->begin(), db_model->getObjectList(ObjectType::BaseRelationship)->end()); for(auto &obj : objs) { @@ -1257,7 +1257,7 @@ void ModelWidget::convertRelationshipNN(void) //Renames the table if there is other with the same name on the model avoiding conflicts tab->setName(tab_name); - tab->setName(PgModelerNs::generateUniqueName(tab, *db_model->getObjectList(ObjectType::ObjTable))); + tab->setName(PgModelerNs::generateUniqueName(tab, *db_model->getObjectList(ObjectType::Table))); op_list->startOperationChain(); @@ -1293,7 +1293,7 @@ void ModelWidget::convertRelationshipNN(void) for(QString pk_col : pk_cols) aux_constr->addColumn(tab->getColumn(pk_col), Constraint::SourceCols); - aux_constr->setName(PgModelerNs::generateUniqueName(tab, *tab->getObjectList(ObjectType::ObjConstraint), false, QString("_pk"))); + aux_constr->setName(PgModelerNs::generateUniqueName(tab, *tab->getObjectList(ObjectType::Constraint), false, QString("_pk"))); tab->addConstraint(aux_constr); op_list->registerObject(aux_constr, Operation::ObjectCreated, -1, tab); @@ -1393,7 +1393,7 @@ void ModelWidget::adjustSceneSize(void) if(align_objs) { scene->alignObjectsToGrid(); - db_model->setObjectsModified({ ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); + db_model->setObjectsModified({ ObjectType::Relationship, ObjectType::BaseRelationship }); } emit s_sceneInteracted(scene_rect.size()); @@ -1661,13 +1661,13 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb relationship. To get the specific relationship id (1-1, 1-n, n-n, gen, dep) is necessary to subtract the ObjectType::ObjRelationship from the obj_type parameter, the result will point to the BaseRelationship::RELATIONSHIP_??? constant. */ - if(obj_type > ObjectType::ObjBaseTable) + if(obj_type > ObjectType::BaseTable) { - rel_type=~obj_type - ~ObjectType::ObjRelationship; - obj_type=ObjectType::ObjRelationship; + rel_type=~obj_type - ~ObjectType::Relationship; + obj_type=ObjectType::Relationship; } - if(obj_type!=ObjectType::ObjPermission) + if(obj_type!=ObjectType::Permission) { if(object && obj_type!=object->getObjectType()) throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -1682,83 +1682,83 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb /* Raises an error if the user try to edit a reserverd object. The only exception is for "public" schema that can be edited only on its fill color an rectangle attributes */ if(object && object->isSystemObject() && - (object->getObjectType()!=ObjectType::ObjSchema || object->getName()!="public")) + (object->getObjectType()!=ObjectType::Schema || object->getName()!="public")) throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) .arg(object->getName()).arg(object->getTypeName()), ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type==ObjectType::ObjSchema) + if(obj_type==ObjectType::Schema) res=openEditingForm(object); - else if(obj_type==ObjectType::ObjRole) + else if(obj_type==ObjectType::Role) res=openEditingForm(object); - else if(obj_type==ObjectType::ObjTablespace) + else if(obj_type==ObjectType::Tablespace) res=openEditingForm(object); - else if(obj_type==ObjectType::ObjLanguage) + else if(obj_type==ObjectType::Language) res=openEditingForm(object); - else if(obj_type==ObjectType::ObjCast) + else if(obj_type==ObjectType::Cast) res=openEditingForm(object); - else if(obj_type==ObjectType::ObjTag) + else if(obj_type==ObjectType::Tag) res=openEditingForm(object); - else if(obj_type== ObjectType::ObjEventTrigger) + else if(obj_type== ObjectType::EventTrigger) res=openEditingForm(object); - else if(obj_type==ObjectType::ObjFunction) + else if(obj_type==ObjectType::Function) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjConversion) + else if(obj_type==ObjectType::Conversion) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjDomain) + else if(obj_type==ObjectType::Domain) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjAggregate) + else if(obj_type==ObjectType::Aggregate) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjSequence) + else if(obj_type==ObjectType::Sequence) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjOpFamily) + else if(obj_type==ObjectType::OpFamily) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjOpClass) + else if(obj_type==ObjectType::OpClass) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjType) + else if(obj_type==ObjectType::Type) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjCollation) + else if(obj_type==ObjectType::Collation) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjExtension) + else if(obj_type==ObjectType::Extension) res=openEditingForm(object, sel_schema); - else if(obj_type==ObjectType::ObjTable) + else if(obj_type==ObjectType::Table) res=openEditingForm(object, sel_schema, obj_pos); - else if(obj_type==ObjectType::ObjView) + else if(obj_type==ObjectType::View) res=openEditingForm(object, sel_schema, obj_pos); - else if(obj_type==ObjectType::ObjRule) + else if(obj_type==ObjectType::Rule) res=openEditingForm(object, parent_obj); - else if(obj_type== ObjectType::ObjTrigger) + else if(obj_type== ObjectType::Trigger) res=openEditingForm(object, parent_obj); - else if(obj_type== ObjectType::ObjIndex) + else if(obj_type== ObjectType::Index) res=openEditingForm(object, parent_obj); - else if(obj_type== ObjectType::ObjPolicy) + else if(obj_type== ObjectType::Policy) res=openEditingForm(object, parent_obj); - else if(obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Column || obj_type==ObjectType::Constraint) { TableObject *tab_obj=dynamic_cast(object); - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) res=openEditingForm(object, parent_obj); else res=openEditingForm(object, parent_obj); if(res==QDialog::Accepted) { - if(tab_obj && parent_obj->getObjectType()==ObjectType::ObjTable) + if(tab_obj && parent_obj->getObjectType()==ObjectType::Table) db_model->validateRelationships(tab_obj, dynamic_cast
(parent_obj)); else db_model->validateRelationships(); } } - else if(obj_type==ObjectType::ObjBaseRelationship || obj_type==ObjectType::ObjRelationship) + else if(obj_type==ObjectType::BaseRelationship || obj_type==ObjectType::Relationship) { RelationshipWidget *relationship_wgt=new RelationshipWidget; if(!object && rel_type > 0 && selected_objects.size() > 0 && - selected_objects[0]->getObjectType()==ObjectType::ObjTable) + selected_objects[0]->getObjectType()==ObjectType::Table) { Table *tab1=dynamic_cast
(selected_objects[0]), *tab2=(selected_objects.size()==2 ? @@ -1771,20 +1771,20 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb res=openEditingForm(relationship_wgt); scene->clearSelection(); } - else if(obj_type==ObjectType::ObjTextbox) + else if(obj_type==ObjectType::Textbox) { TextboxWidget *textbox_wgt=new TextboxWidget; textbox_wgt->setAttributes(db_model, op_list, dynamic_cast(object), obj_pos.x(), obj_pos.y()); res=openEditingForm(textbox_wgt); } - else if(obj_type==ObjectType::ObjPermission) + else if(obj_type==ObjectType::Permission) { PermissionWidget *permission_wgt=new PermissionWidget; Permission *perm=dynamic_cast(object); permission_wgt->setAttributes(db_model, nullptr, (perm ? perm->getObject() : object)); res=openEditingForm(permission_wgt, Messagebox::OkButton); } - else if(obj_type==ObjectType::ObjGenericSQL) + else if(obj_type==ObjectType::GenericSql) { GenericSQLWidget *genericsql_wgt=new GenericSQLWidget; genericsql_wgt->setAttributes(db_model, op_list, dynamic_cast(object)); @@ -1852,7 +1852,7 @@ void ModelWidget::showSourceCode(void) void ModelWidget::cancelObjectAddition(void) { //Reset the new object type to a invalid one forcing the user to select a correct type again - new_obj_type=ObjectType::ObjBaseObject; + new_obj_type=ObjectType::BaseObject; //Restore the cursor icon viewport->setCursor(QCursor(Qt::ArrowCursor)); @@ -1976,7 +1976,7 @@ void ModelWidget::changeOwner(void) ErrorCode::OprReservedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Register an operation only if the object is not the database itself - if(obj->getObjectType()!=ObjectType::ObjDatabase) + if(obj->getObjectType()!=ObjectType::Database) op_id=op_list->registerObject(obj, Operation::ObjectModified, -1); obj->setOwner(owner); @@ -2122,7 +2122,7 @@ void ModelWidget::protectObject(void) { bool protect=!graph_obj->isProtected(); - if(graph_obj->getObjectType()==ObjectType::ObjSchema) + if(graph_obj->getObjectType()==ObjectType::Schema) { Messagebox msgbox; msgbox.show(QString(QT_TR_NOOP("Do you want to %1 the selected schema's children too?")).arg(protect ? QT_TR_NOOP("protect") : QT_TR_NOOP("unprotect")), @@ -2172,7 +2172,7 @@ void ModelWidget::protectObject(void) obj_type=object->getObjectType(); - if(obj_type==ObjectType::ObjColumn || obj_type==ObjectType::ObjConstraint) + if(obj_type==ObjectType::Column || obj_type==ObjectType::Constraint) { tab_obj=dynamic_cast(object); @@ -2222,7 +2222,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) TableObject *tab_obj=nullptr; BaseTable *table=nullptr; Constraint *constr=nullptr; - ObjectType types[]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjConstraint, ObjectType::ObjPolicy }; + ObjectType types[]={ ObjectType::Trigger, ObjectType::Rule, ObjectType::Index, ObjectType::Constraint, ObjectType::Policy }; unsigned i, type_id, count; Messagebox msg_box; @@ -2255,7 +2255,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) object=(*itr); //Table-view relationships and FK relationship aren't copied since they are created automatically when pasting the tables/views - if(object->getObjectType()!=ObjectType::ObjBaseRelationship) + if(object->getObjectType()!=ObjectType::BaseRelationship) { if(msg_box.result()==QDialog::Accepted) db_model->getObjectDependecies(object, deps, true); @@ -2264,7 +2264,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) /* Copying the special objects (which references columns added by relationship) in order to be correclty created when pasted */ - if(object->getObjectType()==ObjectType::ObjTable || object->getObjectType() == ObjectType::ObjView) + if(object->getObjectType()==ObjectType::Table || object->getObjectType() == ObjectType::View) { table=dynamic_cast(object); @@ -2291,7 +2291,7 @@ void ModelWidget::copyObjects(bool duplicate_mode) deps.push_back(tab_obj); } - if(object->getObjectType() == ObjectType::ObjView && type_id >= 2) + if(object->getObjectType() == ObjectType::View && type_id >= 2) break; } } @@ -2376,7 +2376,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) /* The first validation is to check if the object to be pasted does not conflict with any other object of the same type on the model */ - if(obj_type==ObjectType::ObjFunction) + if(obj_type==ObjectType::Function) dynamic_cast(object)->createSignature(true); else if(tab_obj) aux_name=tab_obj->getName(true); @@ -2388,7 +2388,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) aux_object=db_model->getObject(aux_name, obj_type); else { - if(sel_view && (obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule || obj_type==ObjectType::ObjIndex)) + if(sel_view && (obj_type==ObjectType::Trigger || obj_type==ObjectType::Rule || obj_type==ObjectType::Index)) aux_object=sel_view->getObject(aux_name, obj_type); else if(sel_table) aux_object=sel_table->getObject(aux_name, obj_type); @@ -2407,7 +2407,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) object->getCodeDefinition(SchemaParser::SchemaParser::XmlDefinition))))) { //Resolving name conflicts - if(obj_type!=ObjectType::ObjCast) + if(obj_type!=ObjectType::Cast) { func=nullptr; oper=nullptr; @@ -2417,17 +2417,17 @@ void ModelWidget::pasteObjects(bool duplicate_mode) /* For each object type as follow configures the name and the suffix and store them on the 'copy_obj_name' variable. This string is used to check if there are objects with the same name on model. While the 'copy_obj_name' conflicts with other objects (of same type) this validation is made */ - if(obj_type==ObjectType::ObjFunction) + if(obj_type==ObjectType::Function) { func=dynamic_cast(object); - func->setName(PgModelerNs::generateUniqueName(func, (*db_model->getObjectList(ObjectType::ObjFunction)), false, QString("_cp"))); + func->setName(PgModelerNs::generateUniqueName(func, (*db_model->getObjectList(ObjectType::Function)), false, QString("_cp"))); copy_obj_name=func->getName(); func->setName(orig_obj_names[object]); } - else if(obj_type==ObjectType::ObjOperator) + else if(obj_type==ObjectType::Operator) { oper=dynamic_cast(object); - oper->setName(PgModelerNs::generateUniqueName(oper, (*db_model->getObjectList(ObjectType::ObjOperator)))); + oper->setName(PgModelerNs::generateUniqueName(oper, (*db_model->getObjectList(ObjectType::Operator)))); copy_obj_name=oper->getName(); oper->setName(orig_obj_names[object]); } @@ -2499,9 +2499,9 @@ void ModelWidget::pasteObjects(bool duplicate_mode) * is a table or is a view and the current object is a trigger, index, or rule (because * view's only accepts this two types) */ if(sel_table || - (sel_view && (tab_obj->getObjectType()==ObjectType::ObjTrigger || - tab_obj->getObjectType()==ObjectType::ObjRule || - tab_obj->getObjectType()==ObjectType::ObjIndex))) + (sel_view && (tab_obj->getObjectType()==ObjectType::Trigger || + tab_obj->getObjectType()==ObjectType::Rule || + tab_obj->getObjectType()==ObjectType::Index))) { //Backups the original parent table orig_parent_tab=tab_obj->getParentTable(); @@ -2548,7 +2548,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) object=(*itr); itr++; - if(orig_obj_names[object].count() && obj_type!=ObjectType::ObjCast) + if(orig_obj_names[object].count() && obj_type!=ObjectType::Cast) object->setName(orig_obj_names[object]); } @@ -2595,7 +2595,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) //Special case for table objects if(tab_obj) { - if(sel_table && tab_obj->getObjectType()==ObjectType::ObjColumn) + if(sel_table && tab_obj->getObjectType()==ObjectType::Column) { sel_table->addObject(tab_obj); sel_table->setModified(true); @@ -2687,7 +2687,7 @@ void ModelWidget::duplicateObject(void) table = dynamic_cast(object)->getParentTable(); PgModelerNs::copyObject(&dup_object, object, obj_type); - if(table->getObjectType() == ObjectType::ObjTable) + if(table->getObjectType() == ObjectType::Table) dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); else dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); @@ -2696,9 +2696,9 @@ void ModelWidget::duplicateObject(void) table->addObject(dup_object); table->setModified(true); - if(obj_type == ObjectType::ObjColumn) + if(obj_type == ObjectType::Column) db_model->validateRelationships(); - else if(obj_type == ObjectType::ObjConstraint && + else if(obj_type == ObjectType::Constraint && dynamic_cast(object)->getConstraintType() == ConstraintType::ForeignKey) db_model->updateTableFKRelationships(dynamic_cast
(table)); @@ -2728,7 +2728,7 @@ void ModelWidget::removeObjects(bool cascade) BaseTable *table=nullptr, *src_table=nullptr, *dst_table=nullptr; BaseRelationship *rel=nullptr; TableObject *tab_obj=nullptr; - ObjectType obj_type=ObjectType::ObjBaseObject, parent_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject, parent_type=ObjectType::BaseObject; BaseObject *object=nullptr, *aux_obj=nullptr; vector sel_objs, aux_sel_objs; @@ -2770,7 +2770,7 @@ void ModelWidget::removeObjects(bool cascade) } else { - if(sel_objs[0]->getObjectType()==ObjectType::ObjRelationship) + if(sel_objs[0]->getObjectType()==ObjectType::Relationship) msg_box.show(trUtf8("CAUTION: Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed?"), Messagebox::AlertIcon, Messagebox::YesNoButtons); else @@ -2800,7 +2800,7 @@ void ModelWidget::removeObjects(bool cascade) tab_obj=dynamic_cast(ref_obj); //Store the base relationships in a auxiliary list to be processed ahead - if(ref_obj->getObjectType()==ObjectType::ObjBaseRelationship) + if(ref_obj->getObjectType()==ObjectType::BaseRelationship) { aux_sel_objs.push_back(ref_obj); } @@ -2808,7 +2808,7 @@ void ModelWidget::removeObjects(bool cascade) else if(objs_map.count(obj_id)==0 && (!tab_obj || (tab_obj && !tab_obj->isAddedByRelationship()))) { - parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjectType::ObjDatabase); + parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjectType::Database); parent_name=(tab_obj ? tab_obj->getParentTable()->getName(true) : QString()); obj_name=(tab_obj ? tab_obj->getName() : ref_obj->getSignature()); @@ -2830,7 +2830,7 @@ void ModelWidget::removeObjects(bool cascade) obj_id=object->getObjectId(); //If the object is as FK relationship remove the foreign keys that generates it - if(obj_type==ObjectType::ObjBaseRelationship) + if(obj_type==ObjectType::BaseRelationship) { rel = dynamic_cast(object); @@ -2845,7 +2845,7 @@ void ModelWidget::removeObjects(bool cascade) tab_obj->getName(true), tab_obj->getObjectType(), tab_obj->getParentTable()->getName(true), - ObjectType::ObjTable); + ObjectType::Table); } } @@ -2856,7 +2856,7 @@ void ModelWidget::removeObjects(bool cascade) obj_name=(tab_obj ? object->getName(true) : object->getSignature()); parent_name=(tab_obj ? tab_obj->getParentTable()->getName(true) : QString()); - parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjectType::ObjDatabase); + parent_type=(tab_obj ? tab_obj->getParentTable()->getObjectType() : ObjectType::Database); objs_map[object->getObjectId()]=std::make_tuple(object, obj_name, @@ -2882,9 +2882,9 @@ void ModelWidget::removeObjects(bool cascade) parent_type=std::get<4>(ritr->second); ritr++; - if(obj_type==ObjectType::ObjBaseRelationship) + if(obj_type==ObjectType::BaseRelationship) continue; - else if(parent_type!=ObjectType::ObjDatabase) + else if(parent_type!=ObjectType::Database) { /* If the parent table does not exist on the model of the object to be removed * does not exists in parent table, it'll not be processed */ @@ -2925,7 +2925,7 @@ void ModelWidget::removeObjects(bool cascade) try { //If the object is a column validates the column removal before remove it - if(!cascade && obj_type==ObjectType::ObjColumn) + if(!cascade && obj_type==ObjectType::Column) db_model->validateColumnRemoval(dynamic_cast(tab_obj)); //Register the removed object on the operation list @@ -2936,7 +2936,7 @@ void ModelWidget::removeObjects(bool cascade) aux_table=dynamic_cast
(table); - if(aux_table && obj_type==ObjectType::ObjConstraint && + if(aux_table && obj_type==ObjectType::Constraint && dynamic_cast(tab_obj)->getConstraintType()==ConstraintType::ForeignKey) db_model->updateTableFKRelationships(aux_table); @@ -2964,7 +2964,7 @@ void ModelWidget::removeObjects(bool cascade) if(obj_idx >=0 ) { - if(obj_type==ObjectType::ObjRelationship) + if(obj_type==ObjectType::Relationship) { rel=dynamic_cast(object); src_table=rel->getTable(BaseRelationship::SrcTable); @@ -3115,7 +3115,7 @@ void ModelWidget::enableModelActions(bool value) void ModelWidget::configureSubmenu(BaseObject *object) { vector sel_objs; - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; bool tab_or_view=false, accepts_owner=false, accepts_schema=false; if(object) @@ -3130,7 +3130,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) obj_type=obj->getObjectType(); if(!tab_or_view) - tab_or_view=(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); + tab_or_view=(obj_type==ObjectType::Table || obj_type==ObjectType::View); if(!accepts_owner) accepts_owner=obj->acceptsOwner(); @@ -3151,16 +3151,16 @@ void ModelWidget::configureSubmenu(BaseObject *object) map act_map; QStringList name_list; QMenu *menus[]={ &schemas_menu, &owners_menu, &tags_menu }; - ObjectType types[]={ ObjectType::ObjSchema, ObjectType::ObjRole, ObjectType::ObjTag }; + ObjectType types[]={ ObjectType::Schema, ObjectType::Role, ObjectType::Tag }; for(unsigned i=0; i < 3; i++) { menus[i]->clear(); //Configuring actions "Move to schema", "Change Owner" and "Set tag" - if((types[i] == ObjectType::ObjSchema && accepts_schema) || - (types[i] == ObjectType::ObjRole && accepts_owner) || - (types[i]==ObjectType::ObjTag && tab_or_view)) + if((types[i] == ObjectType::Schema && accepts_schema) || + (types[i] == ObjectType::Role && accepts_owner) || + (types[i]==ObjectType::Tag && tab_or_view)) { obj_list=db_model->getObjects(types[i]); @@ -3171,7 +3171,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } else { - if(types[i] == ObjectType::ObjTag) + if(types[i] == ObjectType::Tag) { menus[i]->addAction(trUtf8("None"), this, SLOT(setTag())); menus[i]->addSeparator(); @@ -3219,7 +3219,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } //Display the quick rename action is a single object is selected - if(object && obj_type!=ObjectType::ObjCast) + if(object && obj_type!=ObjectType::Cast) { quick_actions_menu.addAction(action_rename); action_rename->setData(QVariant::fromValue(object)); @@ -3240,7 +3240,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) action_edit_perms->setData(QVariant::fromValue(object)); } - if(object && obj_type == ObjectType::ObjTable) + if(object && obj_type == ObjectType::Table) quick_actions_menu.addAction(action_edit_data); if(object && BaseObject::acceptsCustomSQL(obj_type)) @@ -3250,7 +3250,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) } if(object && - ((!TableObject::isTableObject(obj_type) && obj_type!=ObjectType::ObjTextbox && obj_type!=ObjectType::ObjBaseRelationship) || + ((!TableObject::isTableObject(obj_type) && obj_type!=ObjectType::Textbox && obj_type!=ObjectType::BaseRelationship) || (TableObject::isTableObject(obj_type) && !dynamic_cast(object)->isAddedByRelationship()))) { action_enable_sql->setData(QVariant::fromValue(object)); @@ -3271,7 +3271,7 @@ void ModelWidget::configureSubmenu(BaseObject *object) void ModelWidget::configureFadeMenu(void) { bool is_db_selected = (selected_objects.empty() || - (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::ObjDatabase)); + (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::Database)); fade_menu.clear(); fade_in_menu.clear(); fade_out_menu.clear(); @@ -3286,7 +3286,7 @@ void ModelWidget::configureFadeMenu(void) if(is_db_selected) { QAction *action = nullptr; - vector types = { ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjRelationship, ObjectType::ObjTextbox }; + vector types = { ObjectType::Schema, ObjectType::Table, ObjectType::View, ObjectType::Relationship, ObjectType::Textbox }; QStringList labels = { trUtf8("Schemas"), trUtf8("Tables"), trUtf8("Views"), trUtf8("Relationships"), trUtf8("Textboxes") }; unsigned id = 0; @@ -3308,13 +3308,13 @@ void ModelWidget::configureFadeMenu(void) } action = new QAction(trUtf8("All objects"), &fade_in_menu); - action->setData(~ObjectType::ObjBaseObject); + action->setData(~ObjectType::BaseObject); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); fade_in_menu.addSeparator(); fade_in_menu.addAction(action); action = new QAction(trUtf8("All objects"), &fade_out_menu); - action->setData(~ObjectType::ObjBaseObject); + action->setData(~ObjectType::BaseObject); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); fade_out_menu.addSeparator(); fade_out_menu.addAction(action); @@ -3329,7 +3329,7 @@ void ModelWidget::configureFadeMenu(void) { ObjectType obj_type = selected_objects[0]->getObjectType(); - if(obj_type == ObjectType::ObjTag) + if(obj_type == ObjectType::Tag) { fade_menu.addAction(action_fade_in); fade_menu.addAction(action_fade_out); @@ -3354,7 +3354,7 @@ void ModelWidget::configureFadeMenu(void) } } - if(obj_type == ObjectType::ObjTable || obj_type == ObjectType::ObjView) + if(obj_type == ObjectType::Table || obj_type == ObjectType::View) { fade_menu.addAction(action_fade_rels); action_fade_rels->setText(trUtf8("Table && Relationships")); @@ -3402,15 +3402,15 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) vector list; //If the database object is selected or there is no object select - if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::ObjDatabase)) + if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::Database)) { ObjectType obj_type = static_cast(action->data().toUInt()); //If the action contains a data of type ObjectType::ObjBaseObject means that the user wants to fade all objects - if(obj_type == ObjectType::ObjBaseObject) + if(obj_type == ObjectType::BaseObject) { - vector types = { ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView, - ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjTextbox}; + vector types = { ObjectType::Schema, ObjectType::Table, ObjectType::View, + ObjectType::Relationship, ObjectType::BaseRelationship, ObjectType::Textbox}; for(ObjectType type : types) { @@ -3424,18 +3424,18 @@ void ModelWidget::fadeObjects(QAction *action, bool fade_in) //Fading objects of a certain type list = *db_model->getObjectList(obj_type); - if(obj_type == ObjectType::ObjRelationship) + if(obj_type == ObjectType::Relationship) { list.insert(list.end(), - db_model->getObjectList(ObjectType::ObjBaseRelationship)->begin(), - db_model->getObjectList(ObjectType::ObjBaseRelationship)->end()); + db_model->getObjectList(ObjectType::BaseRelationship)->begin(), + db_model->getObjectList(ObjectType::BaseRelationship)->end()); } } } else { //For tag object the fade is applied in the tables/views related to it - if(selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::ObjTag) + if(selected_objects.size() == 1 && selected_objects[0]->getObjectType() == ObjectType::Tag) db_model->getObjectReferences(selected_objects[0], list); else { @@ -3482,8 +3482,8 @@ void ModelWidget::toggleAllExtendedAttributes(bool value) vector objects; this->scene->clearSelection(); - objects.assign(db_model->getObjectList(ObjectType::ObjTable)->begin(), db_model->getObjectList(ObjectType::ObjTable)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjView)->begin(), db_model->getObjectList(ObjectType::ObjView)->end()); + objects.assign(db_model->getObjectList(ObjectType::Table)->begin(), db_model->getObjectList(ObjectType::Table)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::View)->begin(), db_model->getObjectList(ObjectType::View)->end()); for(auto obj : objects) { @@ -3504,8 +3504,8 @@ void ModelWidget::toggleExtendedAttributes(void) if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0] == db_model)) { - objects.assign(db_model->getObjectList(ObjectType::ObjTable)->begin(), db_model->getObjectList(ObjectType::ObjTable)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjView)->begin(), db_model->getObjectList(ObjectType::ObjView)->end()); + objects.assign(db_model->getObjectList(ObjectType::Table)->begin(), db_model->getObjectList(ObjectType::Table)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::View)->begin(), db_model->getObjectList(ObjectType::View)->end()); } else objects = selected_objects; @@ -3521,7 +3521,7 @@ void ModelWidget::toggleExtendedAttributes(void) } } - db_model->setObjectsModified({ ObjectType::ObjSchema }); + db_model->setObjectsModified({ ObjectType::Schema }); this->setModified(true); } @@ -3530,7 +3530,7 @@ void ModelWidget::toggleSchemasRectangles(void) bool visible = sender() == action_show_schemas_rects; Schema *schema = nullptr; - for(auto obj : *db_model->getObjectList(ObjectType::ObjSchema)) + for(auto obj : *db_model->getObjectList(ObjectType::Schema)) { schema = dynamic_cast(obj); @@ -3546,8 +3546,8 @@ void ModelWidget::toggleSchemasRectangles(void) void ModelWidget::updateObjectsOpacity(void) { - vector types = { ObjectType::ObjSchema, ObjectType::ObjTable, ObjectType::ObjView, - ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjTextbox}; + vector types = { ObjectType::Schema, ObjectType::Table, ObjectType::View, + ObjectType::Relationship, ObjectType::BaseRelationship, ObjectType::Textbox}; BaseObjectView *obj_view = nullptr; BaseGraphicObject *base_obj = nullptr; @@ -3594,10 +3594,10 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Case there is no selected object or the selected object is the database model if(objects.empty() || (objects.size()==1 && objects[0]==db_model)) { - ObjectType types[]={ ObjectType::ObjAggregate, ObjectType::ObjCast, ObjectType::ObjEventTrigger, ObjectType::ObjCollation, ObjectType::ObjConversion, ObjectType::ObjDomain, - ObjectType::ObjExtension, ObjectType::ObjFunction, ObjectType::ObjGenericSQL, ObjectType::ObjLanguage, ObjectType::ObjOpClass, ObjectType::ObjOperator, - ObjectType::ObjOpFamily, ObjectType::ObjRelationship, ObjectType::ObjRole, ObjectType::ObjSchema, ObjectType::ObjSequence, - ObjectType::ObjTable, ObjectType::ObjTablespace, ObjectType::ObjTextbox, ObjectType::ObjType, ObjectType::ObjView, ObjectType::ObjTag }; + ObjectType types[]={ ObjectType::Aggregate, ObjectType::Cast, ObjectType::EventTrigger, ObjectType::Collation, ObjectType::Conversion, ObjectType::Domain, + ObjectType::Extension, ObjectType::Function, ObjectType::GenericSql, ObjectType::Language, ObjectType::OpClass, ObjectType::Operator, + ObjectType::OpFamily, ObjectType::Relationship, ObjectType::Role, ObjectType::Schema, ObjectType::Sequence, + ObjectType::Table, ObjectType::Tablespace, ObjectType::Textbox, ObjectType::Type, ObjectType::View, ObjectType::Tag }; unsigned cnt = sizeof(types)/sizeof(ObjectType); //Configures the "New object" menu with the types at database level @@ -3634,28 +3634,28 @@ void ModelWidget::configurePopupMenu(const vector &objects) configureSubmenu(obj); popup_menu.addAction(action_edit); - if((obj_type==ObjectType::ObjSchema && obj->isSystemObject()) || - (!obj->isProtected() && (obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjBaseRelationship || - obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjSchema || - obj_type == ObjectType::ObjTag || obj_type==ObjectType::ObjView))) + if((obj_type==ObjectType::Schema && obj->isSystemObject()) || + (!obj->isProtected() && (obj_type==ObjectType::Table || obj_type==ObjectType::BaseRelationship || + obj_type==ObjectType::Relationship || obj_type==ObjectType::Schema || + obj_type == ObjectType::Tag || obj_type==ObjectType::View))) { - if(obj_type==ObjectType::ObjTable || obj_type == ObjectType::ObjView) + if(obj_type==ObjectType::Table || obj_type == ObjectType::View) { for(auto type : BaseObject::getChildObjectTypes(obj_type)) new_object_menu.addAction(actions_new_objects[type]); - if(obj_type==ObjectType::ObjTable) - new_object_menu.addAction(actions_new_objects[ObjectType::ObjRelationship]); + if(obj_type==ObjectType::Table) + new_object_menu.addAction(actions_new_objects[ObjectType::Relationship]); action_new_object->setMenu(&new_object_menu); popup_menu.insertAction(action_quick_actions, action_new_object); } - else if(obj_type==ObjectType::ObjRelationship || obj_type==ObjectType::ObjBaseRelationship) + else if(obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) { - if(obj_type==ObjectType::ObjRelationship) + if(obj_type==ObjectType::Relationship) { - new_object_menu.addAction(actions_new_objects[ObjectType::ObjColumn]); - new_object_menu.addAction(actions_new_objects[ObjectType::ObjConstraint]); + new_object_menu.addAction(actions_new_objects[ObjectType::Column]); + new_object_menu.addAction(actions_new_objects[ObjectType::Constraint]); action_new_object->setMenu(&new_object_menu); popup_menu.insertAction(action_quick_actions, action_new_object); @@ -3692,9 +3692,9 @@ void ModelWidget::configurePopupMenu(const vector &objects) action->setData(QVariant::fromValue(reinterpret_cast(rel->getTable(BaseRelationship::DstTable)))); } } - else if(obj_type == ObjectType::ObjSchema) + else if(obj_type == ObjectType::Schema) { - for(auto type : BaseObject::getChildObjectTypes(ObjectType::ObjSchema)) + for(auto type : BaseObject::getChildObjectTypes(ObjectType::Schema)) new_object_menu.addAction(actions_new_objects[type]); action_new_object->setMenu(&new_object_menu); @@ -3703,7 +3703,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) popup_menu.addAction(action_sel_sch_children); action_sel_sch_children->setData(QVariant::fromValue(obj)); } - else if(obj_type == ObjectType::ObjTag) + else if(obj_type == ObjectType::Tag) { popup_menu.addAction(action_sel_tagged_tabs); action_sel_tagged_tabs->setData(QVariant::fromValue(obj)); @@ -3724,7 +3724,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) action_deps_refs->setData(QVariant::fromValue(obj)); tab_obj=dynamic_cast(obj); - if(tab_obj && tab_obj->getObjectType()==ObjectType::ObjColumn) + if(tab_obj && tab_obj->getObjectType()==ObjectType::Column) { Column *col=dynamic_cast(tab_obj); @@ -3763,7 +3763,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) for(auto &obj : objects) { - rem_points = obj->getObjectType() == ObjectType::ObjRelationship || obj->getObjectType() == ObjectType::ObjBaseRelationship; + rem_points = obj->getObjectType() == ObjectType::Relationship || obj->getObjectType() == ObjectType::BaseRelationship; if(!rem_points) break; } @@ -3783,7 +3783,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) /* Special case for systema objects: The actions protect/unprotect will be displayed only for system schemas. The rest of system objects those actions aren't available */ if(!objects[0]->isSystemObject() || - (objects[0]->isSystemObject() && objects[0]->getObjectType()==ObjectType::ObjSchema)) + (objects[0]->isSystemObject() && objects[0]->getObjectType()==ObjectType::Schema)) { if(!objects[0]->isProtected()) popup_menu.addAction(action_protect); @@ -3794,10 +3794,10 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Adding the extended attributes action (only for table/view/database) if(objects.size() > 1 || - (objects.empty() && (db_model->getObjectCount(ObjectType::ObjTable) > 0 || db_model->getObjectCount(ObjectType::ObjView) > 0)) || - (objects.size() == 1 && (objects[0]->getObjectType() == ObjectType::ObjTable || - objects[0]->getObjectType() == ObjectType::ObjView || - objects[0]->getObjectType() == ObjectType::ObjDatabase))) + (objects.empty() && (db_model->getObjectCount(ObjectType::Table) > 0 || db_model->getObjectCount(ObjectType::View) > 0)) || + (objects.size() == 1 && (objects[0]->getObjectType() == ObjectType::Table || + objects[0]->getObjectType() == ObjectType::View || + objects[0]->getObjectType() == ObjectType::Database))) { bool tab_or_view = false; @@ -3805,7 +3805,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { if(!tab_or_view) { - tab_or_view=(obj->getObjectType()==ObjectType::ObjTable || obj->getObjectType()==ObjectType::ObjView); + tab_or_view=(obj->getObjectType()==ObjectType::Table || obj->getObjectType()==ObjectType::View); break; } } @@ -3813,14 +3813,14 @@ void ModelWidget::configurePopupMenu(const vector &objects) if(tab_or_view || objects.empty() || objects.size() == 1) popup_menu.addAction(action_extended_attribs); - if(objects.empty() || (objects.size() == 1 && objects[0]->getObjectType() == ObjectType::ObjDatabase)) + if(objects.empty() || (objects.size() == 1 && objects[0]->getObjectType() == ObjectType::Database)) popup_menu.addAction(action_schemas_rects); } if(!tab_obj && (objects.empty() || objects.size() > 1 || - (objects.size() == 1 && (objects[0]->getObjectType() == ObjectType::ObjDatabase || - objects[0]->getObjectType() == ObjectType::ObjTag || + (objects.size() == 1 && (objects[0]->getObjectType() == ObjectType::Database || + objects[0]->getObjectType() == ObjectType::Tag || BaseGraphicObject::isGraphicObject(objects[0]->getObjectType()))))) { //Adding fade inout action only for graphical objects or when there is no objects selected or many objects seleted @@ -3831,7 +3831,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Adding the copy and paste if there is selected objects if(!model_protected && - !(objects.size()==1 && (objects[0]==db_model || objects[0]->getObjectType()==ObjectType::ObjBaseRelationship)) && + !(objects.size()==1 && (objects[0]==db_model || objects[0]->getObjectType()==ObjectType::BaseRelationship)) && !objects.empty()) { popup_menu.addAction(action_copy); @@ -3858,8 +3858,8 @@ void ModelWidget::configurePopupMenu(const vector &objects) 4) The object is a base relationship (table-view) */ if((tab_obj && !tab_obj->isAddedByRelationship() && !tab_obj->isProtected()) || (objects.size()==1 && objects[0]->isProtected()) || - (!tab_obj && objects.size()==1 && objects[0]!=db_model && objects[0]->getObjectType()!=ObjectType::ObjBaseRelationship) || - (objects.size()==1 && objects[0]->getObjectType()==ObjectType::ObjBaseRelationship && + (!tab_obj && objects.size()==1 && objects[0]!=db_model && objects[0]->getObjectType()!=ObjectType::BaseRelationship) || + (objects.size()==1 && objects[0]->getObjectType()==ObjectType::BaseRelationship && dynamic_cast(objects[0])->getRelationshipType()==BaseRelationship::RelationshipFk) || objects.size() > 1) { @@ -3872,7 +3872,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { table=dynamic_cast
(tab_obj->getParentTable()); - if(tab_obj->getObjectType()==ObjectType::ObjColumn) + if(tab_obj->getObjectType()==ObjectType::Column) { count=table->getConstraintCount(); @@ -3892,7 +3892,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) //For each constaint is created a menu with the edit, source code, protect/unprotect and delete actions submenu=new QMenu(&popup_menu); - submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::ObjConstraint) + str_aux))); + submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::Constraint) + str_aux))); submenu->setTitle(constr->getName()); action=new QAction(dynamic_cast(submenu)); @@ -3953,7 +3953,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) { submenu=new QMenu(&popup_menu); submenu->setTitle(trUtf8("Constraints")); - submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::ObjConstraint) + QString("_grp")))); + submenu->setIcon(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::Constraint) + QString("_grp")))); count=submenus.size(); for(i=0; i < count; i++) submenu->addMenu(submenus[i]); @@ -4041,7 +4041,7 @@ void ModelWidget::highlightObject(void) void ModelWidget::toggleNewObjectOverlay(void) { if(new_obj_overlay_wgt->isHidden() && - (selected_objects.empty() || selected_objects[0]->getObjectType()!=ObjectType::ObjBaseRelationship)) + (selected_objects.empty() || selected_objects[0]->getObjectType()!=ObjectType::BaseRelationship)) { new_obj_overlay_wgt->raise(); new_obj_overlay_wgt->show(); @@ -4088,7 +4088,7 @@ void ModelWidget::createSequenceFromColumn(void) //Creates a sequence which name is like the ones auto generated by PostgreSQL seq=new Sequence; seq->setName(BaseObject::formatName(tab->getName() + QString("_") + col->getName() + QString("_seq"))); - seq->setName(PgModelerNs::generateUniqueName(seq, *db_model->getObjectList(ObjectType::ObjSequence), false)); + seq->setName(PgModelerNs::generateUniqueName(seq, *db_model->getObjectList(ObjectType::Sequence), false)); seq->setSchema(tab->getSchema()); seq->setDefaultValues(col->getType()); @@ -4231,8 +4231,8 @@ void ModelWidget::removeRelationshipPoints(void) { vector rels; - rels = *db_model->getObjectList(ObjectType::ObjBaseRelationship); - rels.insert(rels.end(), db_model->getObjectList(ObjectType::ObjRelationship)->begin(), db_model->getObjectList(ObjectType::ObjRelationship)->end()); + rels = *db_model->getObjectList(ObjectType::BaseRelationship); + rels.insert(rels.end(), db_model->getObjectList(ObjectType::Relationship)->begin(), db_model->getObjectList(ObjectType::Relationship)->end()); op_list->startOperationChain(); for(auto &obj : rels) @@ -4273,7 +4273,7 @@ void ModelWidget::rearrangeSchemasInGrid(QPointF origin, unsigned tabs_per_row, unsigned sch_id=0; double x=origin.x(), y=origin.y(), max_y=-1, cy=0; - objects=db_model->getObjectList(ObjectType::ObjSchema); + objects=db_model->getObjectList(ObjectType::Schema); for(BaseObject *obj : *objects) { @@ -4316,13 +4316,13 @@ void ModelWidget::rearrangeSchemasInGrid(QPointF origin, unsigned tabs_per_row, } } - objects=db_model->getObjectList(ObjectType::ObjRelationship); + objects=db_model->getObjectList(ObjectType::Relationship); for(BaseObject *obj : *objects) { dynamic_cast(obj)->setModified(true); } - objects=db_model->getObjectList(ObjectType::ObjBaseRelationship); + objects=db_model->getObjectList(ObjectType::BaseRelationship); for(BaseObject *obj : *objects) { dynamic_cast(obj)->setModified(true); @@ -4344,8 +4344,8 @@ void ModelWidget::rearrangeTablesInGrid(Schema *schema, QPointF origin, unsigned double max_y=-1, x=origin.x(), y=origin.y(), cy=0; //Get the tables and views for the specified schema - tables=db_model->getObjects(ObjectType::ObjTable, schema); - views=db_model->getObjects(ObjectType::ObjView, schema); + tables=db_model->getObjects(ObjectType::Table, schema); + views=db_model->getObjects(ObjectType::View, schema); tables.insert(tables.end(), views.begin(), views.end()); itr=tables.begin(); @@ -4431,8 +4431,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) scene->clearSelection(); - objects.assign(db_model->getObjectList(ObjectType::ObjTable)->begin(), db_model->getObjectList(ObjectType::ObjTable)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjView)->begin(), db_model->getObjectList(ObjectType::ObjView)->end()); + objects.assign(db_model->getObjectList(ObjectType::Table)->begin(), db_model->getObjectList(ObjectType::Table)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::View)->begin(), db_model->getObjectList(ObjectType::View)->end()); //We determine the root by searching the table/view which contains the more amount of relationships connected for(auto obj : objects) @@ -4464,8 +4464,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) max_w = items_rect.width(); objects.clear(); - objects.assign(db_model->getObjectList(ObjectType::ObjTable)->begin(), db_model->getObjectList(ObjectType::ObjTable)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjView)->begin(), db_model->getObjectList(ObjectType::ObjView)->end()); + objects.assign(db_model->getObjectList(ObjectType::Table)->begin(), db_model->getObjectList(ObjectType::Table)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::View)->begin(), db_model->getObjectList(ObjectType::View)->end()); //Retrieving the rest of tables/views that were not evaluated in the previous iteration std::sort(objects.begin(), objects.end()); @@ -4519,7 +4519,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) //Repositioning remaining tables (without relationships) and textboxes objects.clear(); objects.assign(not_linked_tabs.begin(), not_linked_tabs.end()); - objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjTextbox)->begin(), db_model->getObjectList(ObjectType::ObjTextbox)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::Textbox)->begin(), db_model->getObjectList(ObjectType::Textbox)->end()); px = 50; py = items_rect.bottom() + 100; @@ -4542,8 +4542,8 @@ void ModelWidget::rearrangeTablesHierarchically(void) } objects.clear(); - objects.assign(db_model->getObjectList(ObjectType::ObjRelationship)->begin(), db_model->getObjectList(ObjectType::ObjRelationship)->end()); - objects.insert(objects.end(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->begin(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->end()); + objects.assign(db_model->getObjectList(ObjectType::Relationship)->begin(), db_model->getObjectList(ObjectType::Relationship)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::BaseRelationship)->begin(), db_model->getObjectList(ObjectType::BaseRelationship)->end()); for(auto obj : objects) { @@ -4557,7 +4557,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) breakRelationshipLine(dynamic_cast(obj), ModelWidget::BreakVert2NinetyDegrees); } - db_model->setObjectsModified({ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjSchema, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); + db_model->setObjectsModified({ ObjectType::Table, ObjectType::View, ObjectType::Schema, ObjectType::Relationship, ObjectType::BaseRelationship }); } else { @@ -4650,8 +4650,8 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) if(!schema) return; - tables = db_model->getObjects(ObjectType::ObjTable, schema); - views = db_model->getObjects(ObjectType::ObjView, schema); + tables = db_model->getObjects(ObjectType::Table, schema); + views = db_model->getObjects(ObjectType::View, schema); tables.insert(tables.end(), views.begin(), views.end()); if(!tables.empty()) @@ -4774,13 +4774,13 @@ void ModelWidget::rearrangeTablesInSchemas(void) random_device rand_seed; default_random_engine rand_num_engine; double max_w = 1000, max_h = 1000; - vector schemas = *db_model->getObjectList(ObjectType::ObjSchema), rels; + vector schemas = *db_model->getObjectList(ObjectType::Schema), rels; bool has_collision = false; uniform_int_distribution dist_x(0, max_w), dist_y(0, max_h); unsigned tries = 0, - max_tries = (db_model->getObjectCount(ObjectType::ObjTable) + - db_model->getObjectCount(ObjectType::ObjView) + - db_model->getObjectCount(ObjectType::ObjSchema)) * 100; + max_tries = (db_model->getObjectCount(ObjectType::Table) + + db_model->getObjectCount(ObjectType::View) + + db_model->getObjectCount(ObjectType::Schema)) * 100; rand_num_engine.seed(rand_seed()); @@ -4849,8 +4849,8 @@ void ModelWidget::rearrangeTablesInSchemas(void) } //Removing all custom points from relationships - rels.assign(db_model->getObjectList(ObjectType::ObjRelationship)->begin(), db_model->getObjectList(ObjectType::ObjRelationship)->end()); - rels.insert(rels.end(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->begin(), db_model->getObjectList(ObjectType::ObjBaseRelationship)->end()); + rels.assign(db_model->getObjectList(ObjectType::Relationship)->begin(), db_model->getObjectList(ObjectType::Relationship)->end()); + rels.insert(rels.end(), db_model->getObjectList(ObjectType::BaseRelationship)->begin(), db_model->getObjectList(ObjectType::BaseRelationship)->end()); for(auto &rel : rels) { @@ -4859,7 +4859,7 @@ void ModelWidget::rearrangeTablesInSchemas(void) base_rel->resetLabelsDistance(); } - db_model->setObjectsModified({ ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjSchema, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship }); + db_model->setObjectsModified({ ObjectType::Table, ObjectType::View, ObjectType::Schema, ObjectType::Relationship, ObjectType::BaseRelationship }); adjustSceneSize(); viewport->updateScene({ scene->sceneRect() }); } diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index 86362da154..ad0b6b38b8 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -29,34 +29,34 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par int action_idx=0; QList rel_actions=parent->rels_menu->actions(); map> obj_shortcuts={ - { aggregate_tb, std::make_tuple(trUtf8("A"), ObjectType::ObjAggregate) }, - { cast_tb, std::make_tuple(trUtf8("G"), ObjectType::ObjCast) }, - { eventtrigger_tb, std::make_tuple(trUtf8("K"), ObjectType::ObjEventTrigger)}, - { collation_tb, std::make_tuple(trUtf8("H"), ObjectType::ObjCollation) }, - { conversion_tb, std::make_tuple(trUtf8("J"), ObjectType::ObjConversion) }, - { domain_tb, std::make_tuple(trUtf8("D"), ObjectType::ObjDomain) }, - { extension_tb, std::make_tuple(trUtf8("E"), ObjectType::ObjExtension) }, - { function_tb, std::make_tuple(trUtf8("F"), ObjectType::ObjFunction) }, - { language_tb, std::make_tuple(trUtf8("L"), ObjectType::ObjLanguage) }, - { opclass_tb, std::make_tuple(trUtf8("O"), ObjectType::ObjOpClass) }, - { operator_tb, std::make_tuple(trUtf8("U"), ObjectType::ObjOperator) }, - { opfamily_tb, std::make_tuple(trUtf8("I"), ObjectType::ObjOpFamily) }, - { role_tb, std::make_tuple(trUtf8("R"), ObjectType::ObjRole) }, - { schema_tb, std::make_tuple(trUtf8("S"), ObjectType::ObjSchema) }, - { sequence_tb, std::make_tuple(trUtf8("Q"), ObjectType::ObjSequence) }, - { table_tb, std::make_tuple(trUtf8("T"), ObjectType::ObjTable) }, - { tablespace_tb, std::make_tuple(trUtf8("P"), ObjectType::ObjTablespace) }, - { textbox_tb, std::make_tuple(trUtf8("M"), ObjectType::ObjTextbox) }, - { type_tb, std::make_tuple(trUtf8("Y"), ObjectType::ObjType) }, - { view_tb, std::make_tuple(trUtf8("W"), ObjectType::ObjView) }, - { tag_tb, std::make_tuple(trUtf8("9"), ObjectType::ObjTag) }, - { constraint_tb, std::make_tuple(trUtf8("Z"), ObjectType::ObjConstraint) }, - { index_tb, std::make_tuple(trUtf8("X"), ObjectType::ObjIndex) }, - { column_tb, std::make_tuple(trUtf8("C"), ObjectType::ObjColumn) }, - { rule_tb, std::make_tuple(trUtf8("V"), ObjectType::ObjRule) }, - { trigger_tb, std::make_tuple(trUtf8("B"), ObjectType::ObjTrigger) }, - { policy_tb, std::make_tuple(trUtf8("9"), ObjectType::ObjPolicy) }, - { genericsql_tb, std::make_tuple(trUtf8("8"), ObjectType::ObjGenericSQL) } }; + { aggregate_tb, std::make_tuple(trUtf8("A"), ObjectType::Aggregate) }, + { cast_tb, std::make_tuple(trUtf8("G"), ObjectType::Cast) }, + { eventtrigger_tb, std::make_tuple(trUtf8("K"), ObjectType::EventTrigger)}, + { collation_tb, std::make_tuple(trUtf8("H"), ObjectType::Collation) }, + { conversion_tb, std::make_tuple(trUtf8("J"), ObjectType::Conversion) }, + { domain_tb, std::make_tuple(trUtf8("D"), ObjectType::Domain) }, + { extension_tb, std::make_tuple(trUtf8("E"), ObjectType::Extension) }, + { function_tb, std::make_tuple(trUtf8("F"), ObjectType::Function) }, + { language_tb, std::make_tuple(trUtf8("L"), ObjectType::Language) }, + { opclass_tb, std::make_tuple(trUtf8("O"), ObjectType::OpClass) }, + { operator_tb, std::make_tuple(trUtf8("U"), ObjectType::Operator) }, + { opfamily_tb, std::make_tuple(trUtf8("I"), ObjectType::OpFamily) }, + { role_tb, std::make_tuple(trUtf8("R"), ObjectType::Role) }, + { schema_tb, std::make_tuple(trUtf8("S"), ObjectType::Schema) }, + { sequence_tb, std::make_tuple(trUtf8("Q"), ObjectType::Sequence) }, + { table_tb, std::make_tuple(trUtf8("T"), ObjectType::Table) }, + { tablespace_tb, std::make_tuple(trUtf8("P"), ObjectType::Tablespace) }, + { textbox_tb, std::make_tuple(trUtf8("M"), ObjectType::Textbox) }, + { type_tb, std::make_tuple(trUtf8("Y"), ObjectType::Type) }, + { view_tb, std::make_tuple(trUtf8("W"), ObjectType::View) }, + { tag_tb, std::make_tuple(trUtf8("9"), ObjectType::Tag) }, + { constraint_tb, std::make_tuple(trUtf8("Z"), ObjectType::Constraint) }, + { index_tb, std::make_tuple(trUtf8("X"), ObjectType::Index) }, + { column_tb, std::make_tuple(trUtf8("C"), ObjectType::Column) }, + { rule_tb, std::make_tuple(trUtf8("V"), ObjectType::Rule) }, + { trigger_tb, std::make_tuple(trUtf8("B"), ObjectType::Trigger) }, + { policy_tb, std::make_tuple(trUtf8("9"), ObjectType::Policy) }, + { genericsql_tb, std::make_tuple(trUtf8("8"), ObjectType::GenericSql) } }; map> rel_shortcuts={ { rel11_tb, std::make_tuple(trUtf8("1"), 0) }, { rel1n_tb, std::make_tuple(trUtf8("2"), 1) }, @@ -107,26 +107,26 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par void NewObjectOverlayWidget::setSelectedObjects(vector &sel_objs) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; if(sel_objs.size()==1) obj_type=sel_objs.at(0)->getObjectType(); else if(sel_objs.empty()) - obj_type=ObjectType::ObjDatabase; - - db_objs_grp->setVisible(obj_type==ObjectType::ObjDatabase); - sch_objs_grp->setVisible(obj_type==ObjectType::ObjDatabase || obj_type==ObjectType::ObjSchema); - - tab_objs_grp->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView || obj_type==ObjectType::ObjRelationship); - column_tb->setDisabled(obj_type==ObjectType::ObjView); - constraint_tb->setDisabled(obj_type==ObjectType::ObjView); - index_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); - rule_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); - trigger_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); - policy_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); - tab_perms_tb->setVisible(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView); - rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==ObjectType::ObjTable) || - (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==ObjectType::ObjTable && sel_objs.at(1)->getObjectType()==ObjectType::ObjTable)); + obj_type=ObjectType::Database; + + db_objs_grp->setVisible(obj_type==ObjectType::Database); + sch_objs_grp->setVisible(obj_type==ObjectType::Database || obj_type==ObjectType::Schema); + + tab_objs_grp->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View || obj_type==ObjectType::Relationship); + column_tb->setDisabled(obj_type==ObjectType::View); + constraint_tb->setDisabled(obj_type==ObjectType::View); + index_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); + rule_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); + trigger_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); + policy_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); + tab_perms_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); + rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==ObjectType::Table) || + (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==ObjectType::Table && sel_objs.at(1)->getObjectType()==ObjectType::Table)); overlay_frm->adjustSize(); this->adjustSize(); diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index e444068e2e..0c375b7547 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -22,7 +22,7 @@ ObjectDepsRefsWidget::ObjectDepsRefsWidget(QWidget *parent): BaseObjectWidget(parent) { Ui_ObjectDepsRefsWidget::setupUi(this); - configureFormLayout(objectdepsrefs_grid, ObjectType::ObjBaseObject); + configureFormLayout(objectdepsrefs_grid, ObjectType::BaseObject); PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); @@ -116,7 +116,7 @@ void ObjectDepsRefsWidget::handleItemSelection(QTableWidgetItem *item) { parent=dynamic_cast(this->object)->getParentTable(); - if(parent->getObjectType()==ObjectType::ObjTable) + if(parent->getObjectType()==ObjectType::Table) parent_tab=dynamic_cast
(parent); else parent_view=dynamic_cast(parent); diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 7c9c48454d..899bd8bba9 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -104,7 +104,7 @@ void ObjectFinderWidget::fadeObjects(void) vector objects, other_objs; bool fade_listed = false; - for(auto obj_type : {ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjTextbox, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjSchema}) + for(auto obj_type : {ObjectType::Table, ObjectType::View, ObjectType::Textbox, ObjectType::Relationship, ObjectType::BaseRelationship, ObjectType::Schema}) { objects.insert(objects.end(), model_wgt->getDatabaseModel()->getObjectList(obj_type)->begin(), @@ -137,7 +137,7 @@ void ObjectFinderWidget::selectObjects(void) BaseGraphicObject *graph_obj = nullptr; bool sel_listed = false; - for(auto obj_type : {ObjectType::ObjTable, ObjectType::ObjView, ObjectType::ObjTextbox, ObjectType::ObjRelationship, ObjectType::ObjBaseRelationship, ObjectType::ObjSchema}) + for(auto obj_type : {ObjectType::Table, ObjectType::View, ObjectType::Textbox, ObjectType::Relationship, ObjectType::BaseRelationship, ObjectType::Schema}) { objects.insert(objects.end(), model_wgt->getDatabaseModel()->getObjectList(obj_type)->begin(), @@ -291,8 +291,8 @@ void ObjectFinderWidget::editObject(void) { if(selected_obj) { - if(selected_obj->getObjectType()==ObjectType::ObjPermission) - model_wgt->showObjectForm(ObjectType::ObjPermission, dynamic_cast(selected_obj)->getObject()); + if(selected_obj->getObjectType()==ObjectType::Permission) + model_wgt->showObjectForm(ObjectType::Permission, dynamic_cast(selected_obj)->getObject()); else { vector vect; @@ -330,7 +330,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorgetObjectType()==ObjectType::ObjBaseRelationship) + if(objs[i]->getObjectType()==ObjectType::BaseRelationship) str_aux=QString("tv"); else str_aux.clear(); @@ -466,7 +466,7 @@ void ObjectFinderWidget::updateObjectTypeList(QListWidget *list_wgt) { item=new QListWidgetItem; - if(types[type_id]==ObjectType::ObjBaseRelationship) + if(types[type_id]==ObjectType::BaseRelationship) str_aux=QString(BaseObject::getSchemaName(types[type_id])) + QString("tv"); else str_aux=QString(BaseObject::getSchemaName(types[type_id])); diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index bc109dc4a6..c5d89bd142 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -76,7 +76,7 @@ void ObjectRenameWidget::hideEvent(QHideEvent *) void ObjectRenameWidget::applyRenaming(void) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; try { @@ -92,13 +92,13 @@ void ObjectRenameWidget::applyRenaming(void) obj_type=object->getObjectType(); - if(obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::Database) { //Register the object on operations list before the modification op_list->registerObject(object, Operation::ObjectModified, -1, (tab_obj ? tab_obj->getParentTable() : nullptr)); //Format the object name to check if it will have a conflicting name - fmt_name=BaseObject::formatName(new_name_edt->text().toUtf8(), obj_type==ObjectType::ObjOperator); + fmt_name=BaseObject::formatName(new_name_edt->text().toUtf8(), obj_type==ObjectType::Operator); if(object->getSchema()) fmt_name=object->getSchema()->getName(true) + QString(".") + fmt_name; @@ -135,8 +135,8 @@ void ObjectRenameWidget::applyRenaming(void) { obj_graph->setModified(true); - if(obj_graph->getObjectType()==ObjectType::ObjTable || - obj_graph->getObjectType()==ObjectType::ObjView) + if(obj_graph->getObjectType()==ObjectType::Table || + obj_graph->getObjectType()==ObjectType::View) { dynamic_cast(obj_graph->getSchema())->setModified(true); } @@ -155,7 +155,7 @@ void ObjectRenameWidget::applyRenaming(void) tab->setCodeInvalidated(true); dynamic_cast(tab->getSchema())->setModified(true); } - else if(object->getObjectType()==ObjectType::ObjSchema) + else if(object->getObjectType()==ObjectType::Schema) { model->validateSchemaRenaming(dynamic_cast(object), obj_name_lbl->text().toUtf8()); dynamic_cast(object)->setModified(true); @@ -166,7 +166,7 @@ void ObjectRenameWidget::applyRenaming(void) for(auto &obj : ref_objs) { - if(obj->getObjectType()==ObjectType::ObjColumn) + if(obj->getObjectType()==ObjectType::Column) { col=dynamic_cast(obj); col->getParentTable()->setModified(true); @@ -184,7 +184,7 @@ void ObjectRenameWidget::applyRenaming(void) { Messagebox msg_box; - if(obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::Database) op_list->removeLastOperation(); msg_box.show(e); diff --git a/libpgmodeler_ui/src/objectsdiffinfo.cpp b/libpgmodeler_ui/src/objectsdiffinfo.cpp index 9784f35b04..5dfaccf2e7 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.cpp +++ b/libpgmodeler_ui/src/objectsdiffinfo.cpp @@ -46,7 +46,7 @@ QString ObjectsDiffInfo::getInfoMessage(void) { QString msg=QString("%1 `%2' (%3)"), obj_name; BaseObject *ref_obj=nullptr; - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; if(diff_type==AlterObject && old_object) ref_obj=old_object; @@ -58,9 +58,9 @@ QString ObjectsDiffInfo::getInfoMessage(void) /* Forcing the usage of BaseObject::getSignature for the following object, since the custom getSignature for those types return some undesired SQL keywords for this context */ - if(obj_type==ObjectType::ObjConstraint || obj_type==ObjectType::ObjTrigger || obj_type==ObjectType::ObjRule) + if(obj_type==ObjectType::Constraint || obj_type==ObjectType::Trigger || obj_type==ObjectType::Rule) obj_name=dynamic_cast(ref_obj)->TableObject::getSignature(); - else if(obj_type==ObjectType::ObjOpClass || obj_type==ObjectType::ObjOpFamily) + else if(obj_type==ObjectType::OpClass || obj_type==ObjectType::OpFamily) obj_name=ref_obj->BaseObject::getSignature(); else obj_name=ref_obj->getSignature(); diff --git a/libpgmodeler_ui/src/objectselectorwidget.cpp b/libpgmodeler_ui/src/objectselectorwidget.cpp index 8c4d382a00..c6494d181f 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.cpp +++ b/libpgmodeler_ui/src/objectselectorwidget.cpp @@ -129,7 +129,7 @@ void ObjectSelectorWidget::setSelectedObject(BaseObject *object) rem_object_tb->setEnabled(object); this->selected_obj=object; - if(object->getObjectType()!=ObjectType::ObjConstraint) + if(object->getObjectType()!=ObjectType::Constraint) obj_name_txt->setPlainText(selected_obj->getSignature()); else obj_name_txt->setPlainText(QString("%1.%2") diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 783727fb90..559bbe2ddb 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -95,7 +95,7 @@ void OperationListWidget::updateOperationList(void) str_aux=QString(BaseObject::getSchemaName(obj_type)); item->setData(0, Qt::UserRole, QVariant(~obj_type)); - if(obj_type==ObjectType::ObjBaseRelationship) + if(obj_type==ObjectType::BaseRelationship) str_aux+=QString("tv"); item->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(str_aux))); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index b006e80dbe..511829dd45 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -18,7 +18,7 @@ #include "operatorclasswidget.h" -OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjOpClass) +OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::OpClass) { try { @@ -30,11 +30,11 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare Ui_OperatorClassWidget::setupUi(this); - family_sel=new ObjectSelectorWidget(ObjectType::ObjOpFamily, true, this); + family_sel=new ObjectSelectorWidget(ObjectType::OpFamily, true, this); data_type=new PgSQLTypeWidget(this); - operator_sel=new ObjectSelectorWidget(ObjectType::ObjOperator, true, this); - elem_family_sel=new ObjectSelectorWidget(ObjectType::ObjOpFamily, true, this); - function_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + operator_sel=new ObjectSelectorWidget(ObjectType::Operator, true, this); + elem_family_sel=new ObjectSelectorWidget(ObjectType::OpFamily, true, this); + function_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); storage_type=new PgSQLTypeWidget(this, trUtf8("Storage Type")); elements_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::DuplicateButton, true, this); @@ -60,7 +60,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare grid->addWidget(data_type,4,0,1,5); grid->addWidget(elements_grp,5,0,1,5); this->setLayout(grid); - configureFormLayout(grid, ObjectType::ObjOpClass); + configureFormLayout(grid, ObjectType::OpClass); fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::Brin)); @@ -150,7 +150,7 @@ void OperatorClassWidget::showElementData(OperatorClassElement elem, int lin_idx else { elements_tab->setCellText(*elem.getStorage(), lin_idx, 0); - elements_tab->setCellText(BaseObject::getTypeName(ObjectType::ObjType), lin_idx, 1); + elements_tab->setCellText(BaseObject::getTypeName(ObjectType::Type), lin_idx, 1); } if(elem_type!=OperatorClassElement::StorageElem) diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index b87fd4a3e7..689ada4ce3 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -18,7 +18,7 @@ #include "operatorfamilywidget.h" -OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjOpFamily) +OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::OpFamily) { QStringList types; map > fields_map; @@ -26,7 +26,7 @@ OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(pa QFrame *frame=nullptr; Ui_OperatorFamilyWidget::setupUi(this); - configureFormLayout(opfamily_grid, ObjectType::ObjOpFamily); + configureFormLayout(opfamily_grid, ObjectType::OpFamily); IndexingType::getTypes(types); indexing_cmb->addItems(types); diff --git a/libpgmodeler_ui/src/operatorwidget.cpp b/libpgmodeler_ui/src/operatorwidget.cpp index dfc33112db..9f7f6a5b96 100644 --- a/libpgmodeler_ui/src/operatorwidget.cpp +++ b/libpgmodeler_ui/src/operatorwidget.cpp @@ -18,7 +18,7 @@ #include "operatorwidget.h" -OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjOperator) +OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Operator) { try { @@ -50,7 +50,7 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, Object for(i=Operator::FUNC_OPERATOR; i <= Operator::FUNC_RESTRICT; i++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjectType::Function, true, this); if(i!=Operator::FUNC_OPERATOR) grid->addWidget(functions_sel[i],i,1,1,1); @@ -59,12 +59,12 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, Object for(i=Operator::OPER_COMMUTATOR, i1=3; i <= Operator::OPER_NEGATOR; i++,i1++) { operators_sel[i]=nullptr; - operators_sel[i]=new ObjectSelectorWidget(ObjectType::ObjOperator, true, this); + operators_sel[i]=new ObjectSelectorWidget(ObjectType::Operator, true, this); grid->addWidget(operators_sel[i],i1,1,1,1); } operator_grid->addWidget(functions_sel[0],0,1,1,3); - configureFormLayout(operator_grid, ObjectType::ObjOperator); + configureFormLayout(operator_grid, ObjectType::Operator); setRequiredField(operator_func_lbl); setRequiredField(functions_sel[0]); diff --git a/libpgmodeler_ui/src/parameterwidget.cpp b/libpgmodeler_ui/src/parameterwidget.cpp index 22232dc591..5f8c0a3510 100644 --- a/libpgmodeler_ui/src/parameterwidget.cpp +++ b/libpgmodeler_ui/src/parameterwidget.cpp @@ -18,7 +18,7 @@ #include "parameterwidget.h" -ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjParameter) +ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Parameter) { try { @@ -41,7 +41,7 @@ ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, Obje parameter_grid->addWidget(data_type,2, 0, 1, 4); parameter_grid->addItem(spacer, parameter_grid->count()+1,0); - configureFormLayout(parameter_grid, ObjectType::ObjParameter); + configureFormLayout(parameter_grid, ObjectType::Parameter); connect(param_variadic_chk, SIGNAL(toggled(bool)), param_in_chk, SLOT(setDisabled(bool))); connect(param_variadic_chk, SIGNAL(toggled(bool)), param_out_chk, SLOT(setDisabled(bool))); connect(param_in_chk, SIGNAL(toggled(bool)), this, SLOT(enableVariadic(void))); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 58e3bf76ee..a8dfa5236e 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -18,7 +18,7 @@ #include "permissionwidget.h" -PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjPermission) +PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Permission) { QGridLayout *grid=nullptr; QFrame *frame=nullptr; @@ -39,7 +39,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob object_selection_wgt=new ModelObjectsWidget(true); permission=nullptr; - configureFormLayout(permission_grid, ObjectType::ObjPermission); + configureFormLayout(permission_grid, ObjectType::Permission); name_edt->setReadOnly(true); comment_edt->setVisible(false); @@ -89,7 +89,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob } frame=generateInformationFrame(trUtf8("Leave the Roles grid empty in order to create a %1 applicable to PUBLIC.") - .arg(BaseObject::getTypeName(ObjectType::ObjPermission).toLower())); + .arg(BaseObject::getTypeName(ObjectType::Permission).toLower())); permission_grid->addWidget(frame, permission_grid->count()+1, 0, 1, 0); frame->setParent(this); @@ -163,7 +163,7 @@ void PermissionWidget::setAttributes(DatabaseModel *model, BaseObject *parent_ob void PermissionWidget::selectRole(void) { - object_selection_wgt->setObjectVisible(ObjectType::ObjRole, true); + object_selection_wgt->setObjectVisible(ObjectType::Role, true); object_selection_wgt->setModel(this->model); object_selection_wgt->show(); } @@ -317,7 +317,7 @@ void PermissionWidget::updatePermission(void) //Checking if the permission already exists on model perm_idx=model->getPermissionIndex(perm, false); - if(perm_idx < 0 || (perm_idx >=0 && model->getObject(perm_idx,ObjectType::ObjPermission)==permission)) + if(perm_idx < 0 || (perm_idx >=0 && model->getObject(perm_idx,ObjectType::Permission)==permission)) { (*permission)=(*perm); listPermissions(); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index c57f6d2bad..61743e46e6 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -90,7 +90,7 @@ namespace PgModelerUiNs { void disableObjectSQL(BaseObject *object, bool disable) { - if(object && object->getObjectType()!=ObjectType::ObjBaseRelationship) + if(object && object->getObjectType()!=ObjectType::BaseRelationship) { Messagebox msgbox; ObjectType obj_type=object->getObjectType(); @@ -104,7 +104,7 @@ namespace PgModelerUiNs { object->setSQLDisabled(disable); - if(obj_type!=ObjectType::ObjDatabase && curr_val!=disable) + if(obj_type!=ObjectType::Database && curr_val!=disable) { msgbox.show(QString(QT_TR_NOOP("Do you want to apply the SQL %1 status to the object's references too? This will avoid problems when exporting or validating the model.")).arg(disable ? QT_TR_NOOP("disabling") : QT_TR_NOOP("enabling")), Messagebox::ConfirmIcon, Messagebox::YesNoButtons); @@ -115,10 +115,10 @@ namespace PgModelerUiNs { /* Special case for tables. When disable the code there is the need to disable constraints codes when the code of parent table is disabled too in order to avoid export errors */ - if(object->getObjectType()==ObjectType::ObjTable) + if(object->getObjectType()==ObjectType::Table) { Constraint *constr = nullptr; - vector *objects=dynamic_cast
(object)->getObjectList(ObjectType::ObjConstraint); + vector *objects=dynamic_cast
(object)->getObjectList(ObjectType::Constraint); for(auto &obj : (*objects)) { @@ -150,7 +150,7 @@ namespace PgModelerUiNs { tab_obj=dynamic_cast(refs.back()); //If the object is a relationship added does not do anything since the relationship itself will be disabled - if(refs.back()->getObjectType()!=ObjectType::ObjBaseRelationship && + if(refs.back()->getObjectType()!=ObjectType::BaseRelationship && (!tab_obj || (tab_obj && !tab_obj->isAddedByRelationship()))) { refs.back()->setSQLDisabled(object->isSQLDisabled()); diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index 5cc23518dd..45a44a077d 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -18,14 +18,14 @@ #include "policywidget.h" -PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjPolicy) +PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Policy) { try { Ui_PolicyWidget::setupUi(this); model_objs_wgt = new ModelObjectsWidget(true, this); - model_objs_wgt->setObjectVisible(ObjectType::ObjRole, true); + model_objs_wgt->setObjectVisible(ObjectType::Role, true); using_edt = PgModelerUiNs::createNumberedTextEditor(using_wgt); using_edt->setTabChangesFocus(true); @@ -49,7 +49,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType vbox->addWidget(roles_tab); QFrame *frame=generateInformationFrame(trUtf8("Leave the Roles grid empty in order to create a %1 applicable to PUBLIC.") - .arg(BaseObject::getTypeName(ObjectType::ObjPolicy).toLower())); + .arg(BaseObject::getTypeName(ObjectType::Policy).toLower())); vbox->addWidget(frame); frame->setParent(this); vbox->setContentsMargins(4,4,4,4); @@ -59,7 +59,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType PolicyCmdType::getTypes(cmds); command_cmb->addItems(cmds); - configureFormLayout(policy_grid, ObjectType::ObjPolicy); + configureFormLayout(policy_grid, ObjectType::Policy); configureTabOrder({ basics_grp, attribs_tbw }); connect(roles_tab, SIGNAL(s_rowAdded(int)), model_objs_wgt, SLOT(show())); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 4889107fd9..e48d27e3a5 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -37,7 +37,7 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) expression_hl=new SyntaxHighlighter(expression_txt, false, true); expression_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - ref_object_sel=new ObjectSelectorWidget({ ObjectType::ObjTable, ObjectType::ObjColumn }, true, this); + ref_object_sel=new ObjectSelectorWidget({ ObjectType::Table, ObjectType::Column }, true, this); ref_object_sel->enableObjectCreation(false); expression_cp=new CodeCompletionWidget(expression_txt, true); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index e3ec878acc..4623aebfc5 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -24,7 +24,7 @@ #include "relationshipconfigwidget.h" #include "generalconfigwidget.h" -RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjRelationship) +RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Relationship) { try { @@ -131,7 +131,7 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent grid=dynamic_cast(rel_attribs_tbw->widget(GeneralTab)->layout()); grid->addWidget(color_picker, 0, 1); - configureFormLayout(relationship_grid, ObjectType::ObjRelationship); + configureFormLayout(relationship_grid, ObjectType::Relationship); DeferralType::getTypes(list); deferral_cmb->addItems(list); @@ -260,7 +260,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l aux_rel=dynamic_cast(base_rel); - if(base_rel->getObjectType()==ObjectType::ObjBaseRelationship) + if(base_rel->getObjectType()==ObjectType::BaseRelationship) { if(base_rel->getRelationshipType()!=BaseRelationship::RelationshipFk) { @@ -321,7 +321,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } } - disable_sql_chk->setVisible(base_rel->getObjectType()==ObjectType::ObjRelationship); + disable_sql_chk->setVisible(base_rel->getObjectType()==ObjectType::Relationship); table1_mand_chk->setText(base_rel->getTable(BaseRelationship::SrcTable)->getName() + trUtf8(" is required")); table2_mand_chk->setText(base_rel->getTable(BaseRelationship::DstTable)->getName() + trUtf8(" is required")); @@ -336,10 +336,10 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l constraints_tab->setButtonsEnabled(ObjectsTableWidget::AllButtons, !aux_rel->isProtected()); //Lists the relationship attributes - listObjects(ObjectType::ObjColumn); + listObjects(ObjectType::Column); //Lists the relationship constraints - listObjects(ObjectType::ObjConstraint); + listObjects(ObjectType::Constraint); listSpecialPkColumns(); @@ -381,7 +381,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l rel_type==BaseRelationship::RelationshipFk); use_name_patterns=(rel1n || relnn || - (relgen_dep && base_rel->getObjectType()==ObjectType::ObjRelationship)); + (relgen_dep && base_rel->getObjectType()==ObjectType::Relationship)); name_patterns_grp->setVisible(use_name_patterns); @@ -423,15 +423,15 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l for(i=SettingsTab; i <= SpecialPkTab; i++) rel_attribs_tbw->addTab(tabs[i], tab_labels[i]); } - else if(relgen_dep && base_rel->getObjectType()==ObjectType::ObjRelationship) + else if(relgen_dep && base_rel->getObjectType()==ObjectType::Relationship) rel_attribs_tbw->addTab(tabs[SpecialPkTab], tab_labels[SpecialPkTab]); - if(base_rel->getObjectType()==ObjectType::ObjRelationship || - (base_rel->getObjectType()==ObjectType::ObjBaseRelationship && + if(base_rel->getObjectType()==ObjectType::Relationship || + (base_rel->getObjectType()==ObjectType::BaseRelationship && base_rel->getRelationshipType()==BaseRelationship::RelationshipFk)) rel_attribs_tbw->addTab(tabs[AdvancedTab], tab_labels[AdvancedTab]); - copy_options_grp->setVisible(base_rel->getObjectType()==ObjectType::ObjRelationship && + copy_options_grp->setVisible(base_rel->getObjectType()==ObjectType::Relationship && base_rel->getRelationshipType()==BaseRelationship::RelationshipDep); custom_color_chk->setChecked(base_rel->getCustomColor()!=Qt::transparent); @@ -463,7 +463,7 @@ QSize RelationshipWidget::getIdealSize(void) rel_type = dynamic_cast(this->object)->getRelationshipType(); if(rel_type == BaseRelationship::RelationshipFk || - (BaseRelationship::RelationshipDep && this->object && this->object->getObjectType()==ObjectType::ObjBaseRelationship)) + (BaseRelationship::RelationshipDep && this->object && this->object->getObjectType()==ObjectType::BaseRelationship)) return(QSize(640, 320)); else if(BaseRelationship::RelationshipGen) return(QSize(640, 520)); @@ -564,7 +564,7 @@ void RelationshipWidget::listObjects(ObjectType obj_type) try { - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) tab=attributes_tab; else tab=constraints_tab; @@ -683,13 +683,13 @@ void RelationshipWidget::showAdvancedObject(int row) ObjectType obj_type=object->getObjectType(); bool is_protected = false; - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { col=dynamic_cast(object); is_protected = col->isProtected(); openEditingForm(col, col->getParentTable()); } - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) { constr=dynamic_cast(object); @@ -733,7 +733,7 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) BaseObject *parent_aux = nullptr; int res = 0; - if(this->object->getObjectType() == ObjectType::ObjBaseRelationship) + if(this->object->getObjectType() == ObjectType::BaseRelationship) parent_aux = dynamic_cast(this->object)->getTable(BaseRelationship::SrcTable); else parent_aux = !parent ? this->object : parent; @@ -750,22 +750,22 @@ int RelationshipWidget::openEditingForm(TableObject *object, BaseObject *parent) void RelationshipWidget::addObject(void) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; try { if(sender()==attributes_tab) { - obj_type=ObjectType::ObjColumn; + obj_type=ObjectType::Column; tab=attributes_tab; } else { - obj_type=ObjectType::ObjConstraint; + obj_type=ObjectType::Constraint; tab=constraints_tab; } - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) openEditingForm(nullptr); else openEditingForm(nullptr); @@ -781,7 +781,7 @@ void RelationshipWidget::addObject(void) void RelationshipWidget::duplicateObject(int curr_row, int new_row) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; BaseObject *object = nullptr, *dup_object = nullptr; Relationship *rel = dynamic_cast(this->object); vector obj_list; @@ -795,13 +795,13 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) { if(sender()==attributes_tab) { - obj_type=ObjectType::ObjColumn; + obj_type=ObjectType::Column; tab=attributes_tab; obj_list = rel->getAttributes(); } else { - obj_type=ObjectType::ObjConstraint; + obj_type=ObjectType::Constraint; tab=constraints_tab; obj_list = rel->getConstraints(); } @@ -835,7 +835,7 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) void RelationshipWidget::editObject(int row) { - ObjectType obj_type=ObjectType::ObjColumn; + ObjectType obj_type=ObjectType::Column; TableObject *tab_obj=nullptr; try @@ -844,13 +844,13 @@ void RelationshipWidget::editObject(int row) if(sender()==attributes_tab) { - obj_type=ObjectType::ObjColumn; + obj_type=ObjectType::Column; tab_obj=reinterpret_cast(attributes_tab->getRowData(row).value()); openEditingForm(tab_obj); } else { - obj_type=ObjectType::ObjConstraint; + obj_type=ObjectType::Constraint; tab_obj=reinterpret_cast(constraints_tab->getRowData(row).value()); openEditingForm(tab_obj); } @@ -870,7 +870,7 @@ void RelationshipWidget::showObjectData(TableObject *object, int row) { ObjectsTableWidget *tab=nullptr; - if(object->getObjectType()==ObjectType::ObjColumn) + if(object->getObjectType()==ObjectType::Column) { tab=attributes_tab; attributes_tab->setCellText(*dynamic_cast(object)->getType(),row,1); @@ -888,7 +888,7 @@ void RelationshipWidget::showObjectData(TableObject *object, int row) void RelationshipWidget::removeObjects(void) { Relationship *rel=nullptr; - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; unsigned count, op_count=0, i; TableObject *object=nullptr; @@ -898,12 +898,12 @@ void RelationshipWidget::removeObjects(void) if(sender()==attributes_tab) { - obj_type=ObjectType::ObjColumn; + obj_type=ObjectType::Column; count=rel->getAttributeCount(); } else { - obj_type=ObjectType::ObjConstraint; + obj_type=ObjectType::Constraint; count=rel->getConstraintCount(); } @@ -917,7 +917,7 @@ void RelationshipWidget::removeObjects(void) rel->removeObject(object); } - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) listSpecialPkColumns(); } catch(Exception &e) @@ -944,7 +944,7 @@ void RelationshipWidget::removeObjects(void) void RelationshipWidget::removeObject(int row) { Relationship *rel=nullptr; - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; TableObject *object=nullptr; int op_id=-1; @@ -953,15 +953,15 @@ void RelationshipWidget::removeObject(int row) rel=dynamic_cast(this->object); if(sender()==attributes_tab) - obj_type=ObjectType::ObjColumn; + obj_type=ObjectType::Column; else - obj_type=ObjectType::ObjConstraint; + obj_type=ObjectType::Constraint; object=rel->getObject(row, obj_type); op_id=op_list->registerObject(object, Operation::ObjectRemoved, 0, rel); rel->removeObject(object); - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) listSpecialPkColumns(); } catch(Exception &e) @@ -1058,13 +1058,13 @@ void RelationshipWidget::applyConfiguration(void) /* Due to the complexity of the Relationship class and the strong link between all the relationships on the model is necessary to store the XML of the special objects and disconnect all relationships, edit the relationshi and revalidate all the relationships again */ - if(this->object->getObjectType()==ObjectType::ObjRelationship) + if(this->object->getObjectType()==ObjectType::Relationship) { model->storeSpecialObjectsXML(); model->disconnectRelationships(); } - if(!this->new_object && this->object->getObjectType()==ObjectType::ObjRelationship) + if(!this->new_object && this->object->getObjectType()==ObjectType::Relationship) op_list->registerObject(this->object, Operation::ObjectModified); else registerNewObject(); @@ -1076,7 +1076,7 @@ void RelationshipWidget::applyConfiguration(void) else base_rel->setCustomColor(Qt::transparent); - if(this->object->getObjectType()==ObjectType::ObjRelationship) + if(this->object->getObjectType()==ObjectType::Relationship) { QPlainTextEdit *pattern_fields[]={ src_col_pattern_txt, dst_col_pattern_txt, src_fk_pattern_txt, dst_fk_pattern_txt, diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index cf8b0a3c5d..b39dc007af 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -61,7 +61,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent end=std::unique(type_ids.begin(), type_ids.end()); type_ids.erase(end, type_ids.end()); - types = aux_cat.getObjectsAttributes(ObjectType::ObjType, QString(), QString(), type_ids); + types = aux_cat.getObjectsAttributes(ObjectType::Type, QString(), QString(), type_ids); col = 0; for(auto &tp : types) diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index 10f0fab6ba..c2a8bb9cb0 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -19,7 +19,7 @@ #include "rolewidget.h" #include "modelobjectswidget.h" -RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjRole) +RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Role) { ObjectsTableWidget *obj_tab=nullptr; QGridLayout *grid=nullptr; @@ -28,7 +28,7 @@ RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob unsigned i; Ui_RoleWidget::setupUi(this); - configureFormLayout(role_grid, ObjectType::ObjRole); + configureFormLayout(role_grid, ObjectType::Role); object_selection_wgt=new ModelObjectsWidget(true); @@ -102,7 +102,7 @@ void RoleWidget::configureRoleSelection(void) void RoleWidget::selectMemberRole(void) { - object_selection_wgt->setObjectVisible(ObjectType::ObjRole, true); + object_selection_wgt->setObjectVisible(ObjectType::Role, true); object_selection_wgt->setModel(this->model); object_selection_wgt->show(); } diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index 36d952daa0..7c1442d570 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -18,7 +18,7 @@ #include "rulewidget.h" -RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjRule) +RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Rule) { try { @@ -43,7 +43,7 @@ RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob rule_grid->addWidget(frame, rule_grid->count()+1, 0, 1, 0); frame->setParent(this); - configureFormLayout(rule_grid, ObjectType::ObjRule); + configureFormLayout(rule_grid, ObjectType::Rule); EventType::getTypes(list); event_cmb->addItems(list); diff --git a/libpgmodeler_ui/src/schemawidget.cpp b/libpgmodeler_ui/src/schemawidget.cpp index 07bc045971..ee4576ac9d 100644 --- a/libpgmodeler_ui/src/schemawidget.cpp +++ b/libpgmodeler_ui/src/schemawidget.cpp @@ -18,12 +18,12 @@ #include "schemawidget.h" -SchemaWidget::SchemaWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjSchema) +SchemaWidget::SchemaWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Schema) { Ui_SchemaWidget::setupUi(this); QHBoxLayout *hbox=nullptr; - configureFormLayout(nullptr, ObjectType::ObjSchema); + configureFormLayout(nullptr, ObjectType::Schema); color_picker=new ColorPickerWidget(1, this); diff --git a/libpgmodeler_ui/src/sequencewidget.cpp b/libpgmodeler_ui/src/sequencewidget.cpp index 0c22d105b2..a294e419b3 100644 --- a/libpgmodeler_ui/src/sequencewidget.cpp +++ b/libpgmodeler_ui/src/sequencewidget.cpp @@ -18,17 +18,17 @@ #include "sequencewidget.h" -SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjSequence) +SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Sequence) { try { Ui_SequenceWidget::setupUi(this); column_sel=nullptr; - column_sel=new ObjectSelectorWidget(ObjectType::ObjColumn, true, this); + column_sel=new ObjectSelectorWidget(ObjectType::Column, true, this); sequence_grid->addWidget(column_sel, 4, 1, 1, 3); - configureFormLayout(sequence_grid, ObjectType::ObjSequence); + configureFormLayout(sequence_grid, ObjectType::Sequence); sequence_grid->addItem(new QSpacerItem(10,0,QSizePolicy::Minimum,QSizePolicy::Expanding), sequence_grid->count(), 0); configureTabOrder(); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index a8aa1165a5..a2eab024dc 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -30,8 +30,8 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( QPixmap ico; QString gen_purpose=trUtf8("General purpose"); map types_map; - vector types=BaseObject::getObjectTypes(true, {ObjectType::ObjRelationship, ObjectType::ObjTag, ObjectType::ObjTextbox, - ObjectType::ObjPermission, ObjectType::ObjBaseRelationship }); + vector types=BaseObject::getObjectTypes(true, {ObjectType::Relationship, ObjectType::Tag, ObjectType::Textbox, + ObjectType::Permission, ObjectType::BaseRelationship }); setupUi(this); @@ -46,10 +46,10 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( filter_cmb->addItem(ico, itr.first, ~itr.second); } - applies_to_cmb->insertItem(0, gen_purpose, ~ObjectType::ObjBaseObject); + applies_to_cmb->insertItem(0, gen_purpose, ~ObjectType::BaseObject); applies_to_cmb->setCurrentIndex(0); - filter_cmb->insertItem(0, gen_purpose, ~ObjectType::ObjBaseObject); + filter_cmb->insertItem(0, gen_purpose, ~ObjectType::BaseObject); filter_cmb->insertItem(0, trUtf8("All snippets")); filter_cmb->setCurrentIndex(0); @@ -106,7 +106,7 @@ attribs_map SnippetsConfigWidget::getSnippetById(const QString &snip_id) QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) { QStringList ids; - QString type_name=(obj_type==ObjectType::ObjBaseObject ? + QString type_name=(obj_type==ObjectType::BaseObject ? ParsersAttributes::GENERAL : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) @@ -121,7 +121,7 @@ QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) vector SnippetsConfigWidget::getSnippetsByObject(ObjectType obj_type) { vector snippets; - QString type_name=(obj_type==ObjectType::ObjBaseObject ? + QString type_name=(obj_type==ObjectType::BaseObject ? ParsersAttributes::GENERAL : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index 28452505ea..314c23b577 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -25,7 +25,7 @@ SourceCodeWidget::SourceCodeWidget(QWidget *parent): BaseObjectWidget(parent) try { Ui_SourceCodeWidget::setupUi(this); - configureFormLayout(codigofonte_grid, ObjectType::ObjBaseObject); + configureFormLayout(codigofonte_grid, ObjectType::BaseObject); comment_lbl->setVisible(false); comment_edt->setVisible(false); @@ -76,9 +76,9 @@ void SourceCodeWidget::setSourceCodeTab(int) code_icon=QString("codigoxml"); enabled=(sourcecode_twg->currentIndex()==0 && - ((obj_type==ObjectType::ObjBaseRelationship && + ((obj_type==ObjectType::BaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk) - || (obj_type!=ObjectType::ObjBaseRelationship && obj_type!=ObjectType::ObjTextbox))); + || (obj_type!=ObjectType::BaseRelationship && obj_type!=ObjectType::Textbox))); icone=QPixmap(PgModelerUiNs::getIconPath(code_icon)); icon_lbl->setPixmap(icone); @@ -130,14 +130,14 @@ void SourceCodeWidget::generateSourceCode(int) xmlcode_txt->clear(); obj_type=object->getObjectType(); - if(obj_type!=ObjectType::ObjTextbox || - (obj_type==ObjectType::ObjBaseRelationship && + if(obj_type!=ObjectType::Textbox || + (obj_type==ObjectType::BaseRelationship && dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipFk)) { QString aux_def; BaseObject::setPgSQLVersion(version_cmb->currentText()); - if(obj_type==ObjectType::ObjDatabase) + if(obj_type==ObjectType::Database) { task_prog_wgt=new TaskProgressWidget; task_prog_wgt->setWindowTitle(trUtf8("Generating source code...")); @@ -229,10 +229,10 @@ void SourceCodeWidget::setAttributes(DatabaseModel *model, BaseObject *object) this->name_edt->setText(QString("%1 (%2)").arg(object->getSignature()).arg(object->getTypeName())); this->protected_obj_frm->setVisible(false); this->obj_id_lbl->setVisible(false); - this->code_options_cmb->setEnabled(obj_type!=ObjectType::ObjDatabase && - obj_type!=ObjectType::ObjTextbox && - obj_type!=ObjectType::ObjBaseRelationship && - obj_type!=ObjectType::ObjRelationship); + this->code_options_cmb->setEnabled(obj_type!=ObjectType::Database && + obj_type!=ObjectType::Textbox && + obj_type!=ObjectType::BaseRelationship && + obj_type!=ObjectType::Relationship); #ifdef DEMO_VERSION #warning "DEMO VERSION: SQL code display options disabled." diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index b913bd7c28..5939e1586c 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -268,7 +268,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab end=std::unique(type_ids.begin(), type_ids.end()); type_ids.erase(end, type_ids.end()); - types=catalog.getObjectsAttributes(ObjectType::ObjType, QString(), QString(), type_ids); + types=catalog.getObjectsAttributes(ObjectType::Type, QString(), QString(), type_ids); for(auto &tp : types) type_names[tp[ParsersAttributes::OID].toUInt()]=tp[ParsersAttributes::NAME]; diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index 33843331f3..99c1f85c1b 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -8,8 +8,8 @@ SwapObjectsIdsWidget::SwapObjectsIdsWidget(QWidget *parent, Qt::WindowFlags f) : try { QGridLayout *swap_objs_grid=new QGridLayout(this); - vector types=BaseObject::getObjectTypes(true, {ObjectType::ObjPermission, ObjectType::ObjRole, ObjectType::ObjTextbox, - ObjectType::ObjColumn, ObjectType::ObjConstraint }); + vector types=BaseObject::getObjectTypes(true, {ObjectType::Permission, ObjectType::Role, ObjectType::Textbox, + ObjectType::Column, ObjectType::Constraint }); setupUi(this); PgModelerUiNs::configureWidgetFont(message_lbl, PgModelerUiNs::MediumFontFactor); @@ -125,7 +125,7 @@ void SwapObjectsIdsWidget::fillCreationOrderGrid(void) //Using an stl function to extract all the values (objects) from the map and put them into a list std::for_each(creation_order.begin(), creation_order.end(), [&](const std::pair &itr) { - if(itr.second->getObjectType() != ObjectType::ObjConstraint) { + if(itr.second->getObjectType() != ObjectType::Constraint) { objects.push_back(itr.second); } }); @@ -185,7 +185,7 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) if(!src_obj && !dst_obj) throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raise an exception if the user try to swap an id of relationship by other object of different kind - else if((src_obj->getObjectType()==ObjectType::ObjRelationship || dst_obj->getObjectType()==ObjectType::ObjRelationship) && + else if((src_obj->getObjectType()==ObjectType::Relationship || dst_obj->getObjectType()==ObjectType::Relationship) && (src_obj->getObjectType() != dst_obj->getObjectType())) throw Exception(ErrorCode::InvRelationshipIdSwap,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -194,10 +194,10 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) BaseObject::swapObjectsIds(src_obj, dst_obj, false); //Special id swap for relationship - if(src_obj->getObjectType()==ObjectType::ObjRelationship) + if(src_obj->getObjectType()==ObjectType::Relationship) { vector::iterator itr, itr1; - vector *list=model->getObjectList(ObjectType::ObjRelationship); + vector *list=model->getObjectList(ObjectType::Relationship); //Find the relationships in the list and swap the memory position too itr=std::find(list->begin(), list->end(), src_obj); diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 87692e7c8a..78583a6728 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -23,12 +23,12 @@ const QString TableDataWidget::PlaceholderColumn=QString("$placeholder$"); -TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjBaseObject) +TableDataWidget::TableDataWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::BaseObject) { Ui_TableDataWidget::setupUi(this); - configureFormLayout(tabledata_grid, ObjectType::ObjBaseObject); + configureFormLayout(tabledata_grid, ObjectType::BaseObject); - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(ObjectType::ObjTable))); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(ObjectType::Table))); comment_lbl->setVisible(false); comment_edt->setVisible(false); @@ -355,7 +355,7 @@ void TableDataWidget::populateDataGrid(const QString &data) } else { - for(auto object : *table->getObjectList(ObjectType::ObjColumn)) + for(auto object : *table->getObjectList(ObjectType::Column)) columns.push_back(object->getName()); } @@ -434,7 +434,7 @@ void TableDataWidget::configureColumnNamesMenu(void) col_names_menu.clear(); - for(auto object : *table->getObjectList(ObjectType::ObjColumn)) + for(auto object : *table->getObjectList(ObjectType::Column)) col_names.push_back(object->getName()); for(int col = 0; col < data_tbw->columnCount(); col++) diff --git a/libpgmodeler_ui/src/tablespacewidget.cpp b/libpgmodeler_ui/src/tablespacewidget.cpp index de2b74876d..bced93e943 100644 --- a/libpgmodeler_ui/src/tablespacewidget.cpp +++ b/libpgmodeler_ui/src/tablespacewidget.cpp @@ -18,10 +18,10 @@ #include "tablespacewidget.h" -TablespaceWidget::TablespaceWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTablespace) +TablespaceWidget::TablespaceWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Tablespace) { Ui_TablespaceWidget::setupUi(this); - configureFormLayout(tablespace_grid, ObjectType::ObjTablespace); + configureFormLayout(tablespace_grid, ObjectType::Tablespace); tablespace_grid->addItem(new QSpacerItem(10,0,QSizePolicy::Minimum,QSizePolicy::Expanding), tablespace_grid->count(), 0); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index aaa2253557..783ff0fc8e 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -27,12 +27,12 @@ #include "policywidget.h" #include "generalconfigwidget.h" -TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTable) +TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Table) { QGridLayout *grid=nullptr; QVBoxLayout *vbox=nullptr; ObjectsTableWidget *tab=nullptr; - ObjectType types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjPolicy }; + ObjectType types[]={ ObjectType::Column, ObjectType::Constraint, ObjectType::Trigger, ObjectType::Rule, ObjectType::Index, ObjectType::Policy }; map > fields_map; QFrame *frame=nullptr; QPushButton *edt_data_tb=nullptr; @@ -68,7 +68,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: parent_tables->setHeaderLabel(trUtf8("Type"), 2); parent_tables->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),2); - tag_sel = new ObjectSelectorWidget(ObjectType::ObjTag, false, this); + tag_sel = new ObjectSelectorWidget(ObjectType::Tag, false, this); vbox = new QVBoxLayout(tag_sel_parent); vbox->addWidget(tag_sel); vbox->setContentsMargins(0,0,0,0); @@ -99,19 +99,19 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: connect(tab, SIGNAL(s_rowsMoved(int,int)), this, SLOT(swapObjects(int,int))); } - objects_tab_map[ObjectType::ObjColumn]->setColumnCount(6); - objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("PK"), 0); - objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Name"), 1); - objects_tab_map[ObjectType::ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),1); - objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Type"), 2); - objects_tab_map[ObjectType::ObjColumn]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),2); - objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Default Value"), 3); - objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Attribute(s)"), 4); - objects_tab_map[ObjectType::ObjColumn]->setHeaderLabel(trUtf8("Alias"), 5); - objects_tab_map[ObjectType::ObjColumn]->adjustColumnToContents(0); - - connect(objects_tab_map[ObjectType::ObjColumn], &ObjectsTableWidget::s_cellClicked, [&](int row, int col){ - if(col == 0 && objects_tab_map[ObjectType::ObjColumn]->isCellDisabled(static_cast(row), static_cast(col))) + objects_tab_map[ObjectType::Column]->setColumnCount(6); + objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("PK"), 0); + objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Name"), 1); + objects_tab_map[ObjectType::Column]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),1); + objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Type"), 2); + objects_tab_map[ObjectType::Column]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),2); + objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Default Value"), 3); + objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Attribute(s)"), 4); + objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Alias"), 5); + objects_tab_map[ObjectType::Column]->adjustColumnToContents(0); + + connect(objects_tab_map[ObjectType::Column], &ObjectsTableWidget::s_cellClicked, [&](int row, int col){ + if(col == 0 && objects_tab_map[ObjectType::Column]->isCellDisabled(static_cast(row), static_cast(col))) { Messagebox msg_box; Table *table = dynamic_cast
(this->object); @@ -124,49 +124,49 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: } }); - objects_tab_map[ObjectType::ObjConstraint]->setColumnCount(5); - objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjectType::ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("Type"), 1); - objects_tab_map[ObjectType::ObjConstraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); - objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("ON DELETE"), 2); - objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("ON UPDATE"), 3); - objects_tab_map[ObjectType::ObjConstraint]->setHeaderLabel(trUtf8("Alias"), 4); - - objects_tab_map[ObjectType::ObjTrigger]->setColumnCount(5); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Alias"), 4); - - objects_tab_map[ObjectType::ObjRule]->setColumnCount(4); - objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjectType::ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); - objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Event"), 2); - objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Alias"), 3); - - objects_tab_map[ObjectType::ObjIndex]->setColumnCount(3); - objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjectType::ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); - objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Alias"), 2); - - objects_tab_map[ObjectType::ObjPolicy]->setColumnCount(7); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Command"), 1); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("keyword")),1); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Permissive"), 2); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("USING expression"), 3); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("CHECK expression"), 4); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Roles"), 5); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),5); - objects_tab_map[ObjectType::ObjPolicy]->setHeaderLabel(trUtf8("Alias"), 6); + objects_tab_map[ObjectType::Constraint]->setColumnCount(5); + objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::Constraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("Type"), 1); + objects_tab_map[ObjectType::Constraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); + objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("ON DELETE"), 2); + objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("ON UPDATE"), 3); + objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("Alias"), 4); + + objects_tab_map[ObjectType::Trigger]->setColumnCount(5); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); + objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Firing"), 2); + objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Events"), 3); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Alias"), 4); + + objects_tab_map[ObjectType::Rule]->setColumnCount(4); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::Rule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Execution"), 1); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Event"), 2); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Alias"), 3); + + objects_tab_map[ObjectType::Index]->setColumnCount(3); + objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::Index]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Indexing"), 1); + objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Alias"), 2); + + objects_tab_map[ObjectType::Policy]->setColumnCount(7); + objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::Policy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Command"), 1); + objects_tab_map[ObjectType::Policy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("keyword")),1); + objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Permissive"), 2); + objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("USING expression"), 3); + objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("CHECK expression"), 4); + objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Roles"), 5); + objects_tab_map[ObjectType::Policy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),5); + objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Alias"), 6); partition_keys_tab = new ElementsTableWidget; partition_keys_tab->setEnabled(false); @@ -181,7 +181,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: partition_keys_tab->setEnabled(partitioning_type_cmb->currentIndex() != 0); }); - configureFormLayout(table_grid, ObjectType::ObjTable); + configureFormLayout(table_grid, ObjectType::Table); configureTabOrder({ tag_sel }); setMinimumSize(660, 620); } @@ -214,7 +214,7 @@ ObjectsTableWidget *TableWidget::getObjectTable(ObjectType obj_type) ObjectType TableWidget::getObjectType(QObject *sender) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; if(sender) { @@ -223,7 +223,7 @@ ObjectType TableWidget::getObjectType(QObject *sender) itr=objects_tab_map.begin(); itr_end=objects_tab_map.end(); - while(itr!=itr_end && obj_type==ObjectType::ObjBaseObject) + while(itr!=itr_end && obj_type==ObjectType::BaseObject) { if(itr->second==sender) obj_type=itr->first; @@ -241,7 +241,7 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc { unsigned i, count; Table *aux_tab=nullptr; - ObjectType types[]={ ObjectType::ObjColumn, ObjectType::ObjConstraint, ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex, ObjectType::ObjPolicy }; + ObjectType types[]={ ObjectType::Column, ObjectType::Constraint, ObjectType::Trigger, ObjectType::Rule, ObjectType::Index, ObjectType::Policy }; vector part_keys; if(!table) @@ -361,14 +361,14 @@ void TableWidget::listObjects(ObjectType obj_type) tab->blockSignals(false); //Enables the add button on the constraints, triggers and index tab only when there is columns created - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { - objects_tab_map[ObjectType::ObjConstraint]->setButtonsEnabled(ObjectsTableWidget::AddButton, - objects_tab_map[ObjectType::ObjColumn]->getRowCount() > 0); - objects_tab_map[ObjectType::ObjTrigger]->setButtonsEnabled(ObjectsTableWidget::AddButton, - objects_tab_map[ObjectType::ObjColumn]->getRowCount() > 0); - objects_tab_map[ObjectType::ObjIndex]->setButtonsEnabled(ObjectsTableWidget::AddButton, - objects_tab_map[ObjectType::ObjColumn]->getRowCount() > 0); + objects_tab_map[ObjectType::Constraint]->setButtonsEnabled(ObjectsTableWidget::AddButton, + objects_tab_map[ObjectType::Column]->getRowCount() > 0); + objects_tab_map[ObjectType::Trigger]->setButtonsEnabled(ObjectsTableWidget::AddButton, + objects_tab_map[ObjectType::Column]->getRowCount() > 0); + objects_tab_map[ObjectType::Index]->setButtonsEnabled(ObjectsTableWidget::AddButton, + objects_tab_map[ObjectType::Column]->getRowCount() > 0); } } catch(Exception &e) @@ -379,7 +379,7 @@ void TableWidget::listObjects(ObjectType obj_type) void TableWidget::handleObject(void) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; TableObject *object=nullptr; ObjectsTableWidget *obj_table=nullptr; @@ -394,23 +394,23 @@ void TableWidget::handleObject(void) if(obj_table->getSelectedRow()>=0) object=reinterpret_cast(obj_table->getRowData(obj_table->getSelectedRow()).value()); - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) openEditingForm(object); - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) openEditingForm(object); - else if(obj_type==ObjectType::ObjTrigger) + else if(obj_type==ObjectType::Trigger) openEditingForm(object); - else if(obj_type==ObjectType::ObjIndex) + else if(obj_type==ObjectType::Index) openEditingForm(object); - else if(obj_type==ObjectType::ObjRule) + else if(obj_type==ObjectType::Rule) openEditingForm(object); else openEditingForm(object); listObjects(obj_type); - if(obj_type == ObjectType::ObjConstraint) - listObjects(ObjectType::ObjColumn); + if(obj_type == ObjectType::Constraint) + listObjects(ObjectType::Column); } catch(Exception &e) { @@ -449,13 +449,13 @@ void TableWidget::showObjectData(TableObject *object, int row) tab=objects_tab_map[obj_type]; - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) tab->setCellText(object->getName(),row,1); else tab->setCellText(object->getName(),row,0); //For each object type there is a use for the columns from 1 to 3 - if(obj_type==ObjectType::ObjColumn) + if(obj_type==ObjectType::Column) { Table *table = dynamic_cast
(this->object); Constraint *pk = table->getPrimaryKey(); @@ -501,7 +501,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(column->getAlias(), row, 5); tab->adjustColumnToContents(0); } - else if(obj_type==ObjectType::ObjConstraint) + else if(obj_type==ObjectType::Constraint) { constr=dynamic_cast(object); @@ -524,7 +524,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(constr->getAlias(), row, 4); } - else if(obj_type==ObjectType::ObjTrigger) + else if(obj_type==ObjectType::Trigger) { trigger=dynamic_cast(object); @@ -546,7 +546,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(str_aux ,row,3); tab->setCellText(trigger->getAlias(), row, 4); } - else if(obj_type==ObjectType::ObjRule) + else if(obj_type==ObjectType::Rule) { rule=dynamic_cast(object); @@ -558,7 +558,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(rule->getAlias(), row, 3); } - else if(obj_type==ObjectType::ObjIndex) + else if(obj_type==ObjectType::Index) { index=dynamic_cast(object); @@ -567,7 +567,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setCellText(index->getAlias(), row, 2); } - else if(obj_type==ObjectType::ObjPolicy) + else if(obj_type==ObjectType::Policy) { QStringList rol_names; @@ -614,7 +614,7 @@ void TableWidget::removeObjects(void) Table *table=nullptr; unsigned count, op_count=0, i; BaseObject *object=nullptr; - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; try { @@ -641,8 +641,8 @@ void TableWidget::removeObjects(void) ErrorCode::RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - if(obj_type == ObjectType::ObjConstraint) - listObjects(ObjectType::ObjColumn); + if(obj_type == ObjectType::Constraint) + listObjects(ObjectType::Column); } catch(Exception &e) { @@ -670,7 +670,7 @@ void TableWidget::removeObject(int row) { Table *table=nullptr; BaseObject *object=nullptr; - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; int op_id=-1; try @@ -693,8 +693,8 @@ void TableWidget::removeObject(int row) .arg(object->getTypeName()), ErrorCode::RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(obj_type == ObjectType::ObjConstraint) - listObjects(ObjectType::ObjColumn); + if(obj_type == ObjectType::Constraint) + listObjects(ObjectType::Column); } catch(Exception &e) { @@ -713,7 +713,7 @@ void TableWidget::removeObject(int row) void TableWidget::duplicateObject(int sel_row, int new_row) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; BaseObject *object=nullptr, *dup_object=nullptr; ObjectsTableWidget *obj_table=nullptr; Table *table = dynamic_cast
(this->object); @@ -756,7 +756,7 @@ void TableWidget::duplicateObject(int sel_row, int new_row) void TableWidget::TableWidget::swapObjects(int idx1, int idx2) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; Table *table=nullptr; int count; @@ -810,7 +810,7 @@ void TableWidget::applyConfiguration(void) vector rels; vector pk_cols; vector part_keys; - ObjectsTableWidget *col_tab = objects_tab_map[ObjectType::ObjColumn]; + ObjectsTableWidget *col_tab = objects_tab_map[ObjectType::Column]; PartitioningType part_type; if(!this->new_object) @@ -861,7 +861,7 @@ void TableWidget::applyConfiguration(void) pk = new Constraint; pk->setName(pk_name); - pk->setName(PgModelerNs::generateUniqueName(pk, *table->getObjectList(ObjectType::ObjConstraint))); + pk->setName(PgModelerNs::generateUniqueName(pk, *table->getObjectList(ObjectType::Constraint))); for(Column *col : pk_cols) pk->addColumn(col, Constraint::SourceCols); diff --git a/libpgmodeler_ui/src/tagwidget.cpp b/libpgmodeler_ui/src/tagwidget.cpp index 08e62f6e95..dda9b47f5b 100644 --- a/libpgmodeler_ui/src/tagwidget.cpp +++ b/libpgmodeler_ui/src/tagwidget.cpp @@ -18,10 +18,10 @@ #include "tagwidget.h" -TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTag) +TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Tag) { Ui_TagWidget::setupUi(this); - configureFormLayout(tag_grid, ObjectType::ObjTag); + configureFormLayout(tag_grid, ObjectType::Tag); QStringList attribs={ ParsersAttributes::TABLE_NAME, ParsersAttributes::TABLE_SCHEMA_NAME, ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, diff --git a/libpgmodeler_ui/src/textboxwidget.cpp b/libpgmodeler_ui/src/textboxwidget.cpp index 9834f119be..a88627213f 100644 --- a/libpgmodeler_ui/src/textboxwidget.cpp +++ b/libpgmodeler_ui/src/textboxwidget.cpp @@ -18,10 +18,10 @@ #include "textboxwidget.h" -TextboxWidget::TextboxWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTextbox) +TextboxWidget::TextboxWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Textbox) { Ui_TextboxWidget::setupUi(this); - configureFormLayout(textbox_grid, ObjectType::ObjTextbox); + configureFormLayout(textbox_grid, ObjectType::Textbox); text_txt->removeEventFilter(this); connect(color_select_tb, SIGNAL(clicked(void)), this, SLOT(selectTextColor(void))); diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index dc62b48389..24aaf11aea 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -18,7 +18,7 @@ #include "triggerwidget.h" -TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjTrigger) +TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Trigger) { try { @@ -36,8 +36,8 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectTy arguments_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::DuplicateButton, true, this); - ref_table_sel=new ObjectSelectorWidget(ObjectType::ObjTable, true, this); - function_sel=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + ref_table_sel=new ObjectSelectorWidget(ObjectType::Table, true, this); + function_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); ref_table_sel->setEnabled(false); trigger_grid->addWidget(function_sel, 3, 1, 1, 5); @@ -58,7 +58,7 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectTy FiringType::getTypes(list); firing_mode_cmb->addItems(list); - configureFormLayout(trigger_grid, ObjectType::ObjTrigger); + configureFormLayout(trigger_grid, ObjectType::Trigger); connect(deferrable_chk, SIGNAL(toggled(bool)), deferral_type_cmb, SLOT(setEnabled(bool))); connect(columns_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addColumn(int))); @@ -97,7 +97,7 @@ void TriggerWidget::selectUpdateEvent(void) /* Disable the columns tab when the trigger belongs to a view. pgModeler does not support triggers reference view columns (yet) */ arg_cols_tbw->widget(1)->setEnabled(update_chk->isChecked() && - table->getObjectType()==ObjectType::ObjTable); + table->getObjectType()==ObjectType::Table); } void TriggerWidget::setConstraintTrigger(bool value) @@ -173,14 +173,14 @@ void TriggerWidget::updateColumnsCombo(void) try { - if(this->table->getObjectType()==ObjectType::ObjTable) + if(this->table->getObjectType()==ObjectType::Table) { - col_count=table->getObjectCount(ObjectType::ObjColumn); + col_count=table->getObjectCount(ObjectType::Column); column_cmb->clear(); for(i=0; i < col_count; i++) { - column=dynamic_cast(table->getObject(i, ObjectType::ObjColumn)); + column=dynamic_cast(table->getObject(i, ObjectType::Column)); if(columns_tab->getRowIndex(QVariant::fromValue(column)) < 0) { diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index c52b0a67b2..dd2e7d0d0d 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -18,7 +18,7 @@ #include "typewidget.h" -TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjType) +TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Type) { try { @@ -28,7 +28,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob unsigned i,i1; Ui_TypeWidget::setupUi(this); - configureFormLayout(type_grid, ObjectType::ObjType); + configureFormLayout(type_grid, ObjectType::Type); like_type=new PgSQLTypeWidget(this, trUtf8("Like Type")); element_type=new PgSQLTypeWidget(this, trUtf8("Element Type")); @@ -43,7 +43,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob for(i=Type::InputFunc; i <= Type::AnalyzeFunc; i++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjectType::Function, true, this); grid->addWidget(functions_sel[i],i,1,1,1); } @@ -64,7 +64,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob grid=dynamic_cast(attributes_gb->layout()); - attrib_collation_sel=new ObjectSelectorWidget(ObjectType::ObjCollation, true, this); + attrib_collation_sel=new ObjectSelectorWidget(ObjectType::Collation, true, this); grid->addWidget(attrib_collation_sel, 1,1,1,2); attrib_type_wgt=new PgSQLTypeWidget(this); @@ -81,13 +81,13 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob frame->setParent(base_attribs_twg->widget(0)); grid=dynamic_cast(range_attribs_gb->layout()); - opclass_sel=new ObjectSelectorWidget(ObjectType::ObjOpClass, true, this); + opclass_sel=new ObjectSelectorWidget(ObjectType::OpClass, true, this); grid->addWidget(opclass_sel,0,1,1,1); for(i1=1, i=Type::CanonicalFunc; i <= Type::SubtypeDiffFunc; i++,i1++) { functions_sel[i]=nullptr; - functions_sel[i]=new ObjectSelectorWidget(ObjectType::ObjFunction, true, this); + functions_sel[i]=new ObjectSelectorWidget(ObjectType::Function, true, this); grid->addWidget(functions_sel[i],i1,1,1,1); } diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 80ad8f7eba..69fa74668e 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -23,12 +23,12 @@ #include "baseform.h" #include "referencewidget.h" -ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ObjView) +ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::View) { try { ObjectsTableWidget *tab=nullptr; - ObjectType types[]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex }; + ObjectType types[]={ ObjectType::Trigger, ObjectType::Rule, ObjectType::Index }; QGridLayout *grid=nullptr; QVBoxLayout *vbox=nullptr; @@ -52,7 +52,7 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob vbox->setContentsMargins(4,4,4,4); vbox->addWidget(cte_expression_txt); - tag_sel=new ObjectSelectorWidget(ObjectType::ObjTag, false, this); + tag_sel=new ObjectSelectorWidget(ObjectType::Tag, false, this); dynamic_cast(options_gb->layout())->addWidget(tag_sel, 0, 1, 1, 4); references_tab=new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ ObjectsTableWidget::UpdateButton, true, this); @@ -89,29 +89,29 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ob connect(tab, SIGNAL(s_rowDuplicated(int,int)), this, SLOT(duplicateObject(int,int))); } - objects_tab_map[ObjectType::ObjTrigger]->setColumnCount(4); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Firing"), 2); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); - objects_tab_map[ObjectType::ObjTrigger]->setHeaderLabel(trUtf8("Events"), 3); - - objects_tab_map[ObjectType::ObjIndex]->setColumnCount(2); - objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjectType::ObjIndex]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjectType::ObjIndex]->setHeaderLabel(trUtf8("Indexing"), 1); - - objects_tab_map[ObjectType::ObjRule]->setColumnCount(3); - objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Name"), 0); - objects_tab_map[ObjectType::ObjRule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); - objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Execution"), 1); - objects_tab_map[ObjectType::ObjRule]->setHeaderLabel(trUtf8("Event"), 2); + objects_tab_map[ObjectType::Trigger]->setColumnCount(4); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); + objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("table")),1); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Firing"), 2); + objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Events"), 3); + + objects_tab_map[ObjectType::Index]->setColumnCount(2); + objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::Index]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Indexing"), 1); + + objects_tab_map[ObjectType::Rule]->setColumnCount(3); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Name"), 0); + objects_tab_map[ObjectType::Rule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Execution"), 1); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Event"), 2); tablespace_sel->setEnabled(false); tablespace_lbl->setEnabled(false); - configureFormLayout(view_grid, ObjectType::ObjView); + configureFormLayout(view_grid, ObjectType::View); fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(recursive_rb); fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(materialized_rb); @@ -169,7 +169,7 @@ int ViewWidget::openEditingForm(TableObject *object) void ViewWidget::handleObject(void) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; TableObject *object=nullptr; ObjectsTableWidget *obj_table=nullptr; @@ -181,9 +181,9 @@ void ViewWidget::handleObject(void) if(obj_table->getSelectedRow()>=0) object=reinterpret_cast(obj_table->getRowData(obj_table->getSelectedRow()).value()); - if(obj_type==ObjectType::ObjTrigger) + if(obj_type==ObjectType::Trigger) openEditingForm(object); - else if(obj_type==ObjectType::ObjIndex) + else if(obj_type==ObjectType::Index) openEditingForm(object); else openEditingForm(object); @@ -199,7 +199,7 @@ void ViewWidget::handleObject(void) void ViewWidget::duplicateObject(int curr_row, int new_row) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; BaseObject *object=nullptr, *dup_object=nullptr; ObjectsTableWidget *obj_table=nullptr; View *view = dynamic_cast(this->object); @@ -313,7 +313,7 @@ void ViewWidget::removeObject(int row) ObjectType ViewWidget::getObjectType(QObject *sender) { - ObjectType obj_type=ObjectType::ObjBaseObject; + ObjectType obj_type=ObjectType::BaseObject; if(sender) { @@ -322,7 +322,7 @@ ObjectType ViewWidget::getObjectType(QObject *sender) itr=objects_tab_map.begin(); itr_end=objects_tab_map.end(); - while(itr!=itr_end && obj_type==ObjectType::ObjBaseObject) + while(itr!=itr_end && obj_type==ObjectType::BaseObject) { if(itr->second==sender) obj_type=itr->first; @@ -352,7 +352,7 @@ void ViewWidget::showObjectData(TableObject *object, int row) //Column 0: Object name tab->setCellText(object->getName(),row,0); - if(obj_type==ObjectType::ObjTrigger) + if(obj_type==ObjectType::Trigger) { trigger=dynamic_cast(object); @@ -374,7 +374,7 @@ void ViewWidget::showObjectData(TableObject *object, int row) str_aux.remove(str_aux.size()-2, 2); tab->setCellText(str_aux ,row,3); } - else if(obj_type==ObjectType::ObjRule) + else if(obj_type==ObjectType::Rule) { rule=dynamic_cast(object); @@ -583,7 +583,7 @@ void ViewWidget::updateCodePreview(void) //Make a copy of each view objects (rule/trigger) to the auxiliary view for(i=0; i < count; i++) { - if(itr->first==ObjectType::ObjTrigger) + if(itr->first==ObjectType::Trigger) { tab_obj=new Trigger; (*dynamic_cast(tab_obj))= @@ -677,9 +677,9 @@ void ViewWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sch references_tab->blockSignals(false); references_tab->clearSelection(); - listObjects(ObjectType::ObjTrigger); - listObjects(ObjectType::ObjRule); - listObjects(ObjectType::ObjIndex); + listObjects(ObjectType::Trigger); + listObjects(ObjectType::Rule); + listObjects(ObjectType::Index); } void ViewWidget::applyConfiguration(void) @@ -687,7 +687,7 @@ void ViewWidget::applyConfiguration(void) try { View *view=nullptr; - ObjectType types[]={ ObjectType::ObjTrigger, ObjectType::ObjRule, ObjectType::ObjIndex }; + ObjectType types[]={ ObjectType::Trigger, ObjectType::Rule, ObjectType::Index }; unsigned expr_type[]={ Reference::SqlReferSelect, Reference::SqlReferFrom, Reference::SqlReferWhere, diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 2c92a3457c..bc9f96713c 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -627,20 +627,20 @@ void PgModelerCli::handleObjectAddition(BaseObject *object) switch(obj_type) { - case ObjectType::ObjTable: + case ObjectType::Table: item=new TableView(dynamic_cast
(graph_obj)); break; - case ObjectType::ObjView: + case ObjectType::View: item=new GraphicalView(dynamic_cast(graph_obj)); break; - case ObjectType::ObjRelationship: - case ObjectType::ObjBaseRelationship: + case ObjectType::Relationship: + case ObjectType::BaseRelationship: item=new RelationshipView(dynamic_cast(graph_obj)); break; break; - case ObjectType::ObjSchema: + case ObjectType::Schema: item=new SchemaView(dynamic_cast(graph_obj)); break; break; @@ -651,7 +651,7 @@ void PgModelerCli::handleObjectAddition(BaseObject *object) scene->addItem(item); - if(obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) + if(obj_type==ObjectType::Table || obj_type==ObjectType::View) dynamic_cast(graph_obj->getSchema())->setModified(true); } } @@ -667,7 +667,7 @@ void PgModelerCli::handleObjectRemoval(BaseObject *object) //Updates the parent schema if the removed object were a table or view if(graph_obj->getSchema() && - (graph_obj->getObjectType()==ObjectType::ObjTable || graph_obj->getObjectType()==ObjectType::ObjView)) + (graph_obj->getObjectType()==ObjectType::Table || graph_obj->getObjectType()==ObjectType::View)) dynamic_cast(graph_obj->getSchema())->setModified(true); } } @@ -722,12 +722,12 @@ void PgModelerCli::extractObjectXML(void) /* Special case for empty tags like , they will be converted to in order to be correctly extracted further. Currently only language has this behaviour, so additional object may be added in the future. */ - if(lin.contains(QString("<%1").arg(BaseObject::getSchemaName(ObjectType::ObjLanguage)))) + if(lin.contains(QString("<%1").arg(BaseObject::getSchemaName(ObjectType::Language)))) { lin=lin.simplified(); if(lin.contains(QString("/>"))) - lin.replace(QString("/>"), QString(">").arg(BaseObject::getSchemaName(ObjectType::ObjLanguage))); + lin.replace(QString("/>"), QString(">").arg(BaseObject::getSchemaName(ObjectType::Language))); } /* Special case for function signatures. In previous releases, the function's signature was wrongly including OUT parameters and according to docs they are not part of the signature, so it is needed @@ -820,8 +820,8 @@ void PgModelerCli::recreateObjects(void) QStringList fail_objs, constr, list; QString xml_def, aux_def, start_tag="<%1", end_tag="", aux_tag; BaseObject *object=nullptr; - ObjectType obj_type=ObjectType::ObjBaseObject; - vector types={ ObjectType::ObjIndex, ObjectType::ObjTrigger, ObjectType::ObjRule }; + ObjectType obj_type=ObjectType::BaseObject; + vector types={ ObjectType::Index, ObjectType::Trigger, ObjectType::Rule }; attribs_map attribs; bool use_fail_obj=false; unsigned tries=0, max_tries=parsed_opts[FixTries].toUInt(); @@ -858,11 +858,11 @@ void PgModelerCli::recreateObjects(void) xmlparser->getElementAttributes(attribs); - if(obj_type==ObjectType::ObjDatabase) + if(obj_type==ObjectType::Database) model->configureDatabase(attribs); else { - if(obj_type==ObjectType::ObjTable) + if(obj_type==ObjectType::Table) { //Before create a table extract it's foreign keys list=extractForeignKeys(xml_def); @@ -878,14 +878,14 @@ void PgModelerCli::recreateObjects(void) } //Discarding fk relationships - if(obj_type!=ObjectType::ObjRelationship || - (obj_type==ObjectType::ObjRelationship && !xml_def.contains(QString("\"%1\"").arg(ParsersAttributes::RELATIONSHIP_FK)))) + if(obj_type!=ObjectType::Relationship || + (obj_type==ObjectType::Relationship && !xml_def.contains(QString("\"%1\"").arg(ParsersAttributes::RELATIONSHIP_FK)))) { object=model->createObject(obj_type); if(object) { - if(!dynamic_cast(object) && obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjBaseRelationship) + if(!dynamic_cast(object) && obj_type!=ObjectType::Relationship && obj_type!=ObjectType::BaseRelationship) model->addObject(object); } @@ -895,7 +895,7 @@ void PgModelerCli::recreateObjects(void) /* Additional step to extract indexes/triggers/rules from within tables/views and putting their xml on the list of object to be created */ - if((obj_type==ObjectType::ObjTable || obj_type==ObjectType::ObjView) && + if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && xml_def.contains(QRegExp("(<)(index|trigger|rule)"))) { for(ObjectType type : types) @@ -933,7 +933,7 @@ void PgModelerCli::recreateObjects(void) } catch(Exception &e) { - if(obj_type!=ObjectType::ObjDatabase) + if(obj_type!=ObjectType::Database) fail_objs.push_back(xml_def); else throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); @@ -972,14 +972,14 @@ void PgModelerCli::recreateObjects(void) void PgModelerCli::fixObjectAttributes(QString &obj_xml) { //Placing objects , , outside of
- if(!obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjTablespace))) && - obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjTable)))) + if(!obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Tablespace))) && + obj_xml.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Table)))) { int start_idx=-1, end_idx=-1, len=0; - ObjectType obj_types[3]={ ObjectType::ObjRule, ObjectType::ObjTrigger, ObjectType::ObjIndex }; + ObjectType obj_types[3]={ ObjectType::Rule, ObjectType::Trigger, ObjectType::Index }; QString curr_tag, curr_end_tag, def, tab_name, sch_name, name_attr=QString("name=\""), - sch_name_attr=TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjSchema)) + QString(" ") + name_attr; + sch_name_attr=TagExpr.arg(BaseObject::getSchemaName(ObjectType::Schema)) + QString(" ") + name_attr; //Extracting the table's name start_idx=obj_xml.indexOf(name_attr); @@ -1008,7 +1008,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.remove(start_idx, len); //If the object is a rule include the table attribute - if(def.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjRule)))) + if(def.startsWith(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Rule)))) { start_idx=def.indexOf('>'); def.replace(start_idx, 1, QString(" ") + tab_name + QString(">")); @@ -1028,7 +1028,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.remove(QRegExp(AttributeExpr.arg(QString("recheck")))); //Remove values greater-op, less-op, sort-op or sort2-op from ref-type attribute from tags. - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjOperator)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Operator)))) { obj_xml.remove(QString("greater-op")); obj_xml.remove(QString("less-op")); @@ -1037,11 +1037,11 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) } //Replacing attribute owner by onwer-col for sequences - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjSequence)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Sequence)))) obj_xml.replace(ParsersAttributes::OWNER, ParsersAttributes::OWNER_COLUMN); //Remove sysid attribute from tags. - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjRole)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Role)))) obj_xml.remove(QRegExp(AttributeExpr.arg(QString("sysid")))); //Replace tag by on tags. @@ -1051,7 +1051,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.replace(EndTagExpr.arg(ParsersAttributes::PARAMETER), EndTagExpr.arg(ParsersAttributes::TYPE_ATTRIBUTE)); } - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjRelationship)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Relationship)))) { //Remove auto-sufix, src-sufix, dst-sufix, col-indexes, constr-indexes, attrib-indexes from tags. obj_xml.remove(QRegExp(AttributeExpr.arg(QString("auto-sufix")))); @@ -1065,25 +1065,25 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) } //Renaming the tag to on indexes - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjIndex)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Index)))) { obj_xml.replace(TagExpr.arg(ParsersAttributes::CONDITION), TagExpr.arg(ParsersAttributes::PREDICATE)); obj_xml.replace(EndTagExpr.arg(ParsersAttributes::CONDITION), EndTagExpr.arg(ParsersAttributes::PREDICATE)); } //Renaming the attribute default to default-value on domain - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjDomain)))) + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Domain)))) obj_xml.replace(ParsersAttributes::DEFAULT, ParsersAttributes::DEFAULT_VALUE); //Renaming the tag to if(obj_xml.contains(TagExpr.arg(QString("grant")))) { - obj_xml.replace(TagExpr.arg(QString("grant")), TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjPermission))); - obj_xml.replace(EndTagExpr.arg(QString("grant")), EndTagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjPermission))); + obj_xml.replace(TagExpr.arg(QString("grant")), TagExpr.arg(BaseObject::getSchemaName(ObjectType::Permission))); + obj_xml.replace(EndTagExpr.arg(QString("grant")), EndTagExpr.arg(BaseObject::getSchemaName(ObjectType::Permission))); } //Replace the constraint attribute and tag expression by constraint tag in . - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjDomain))) && + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Domain))) && obj_xml.contains(TagExpr.arg(ParsersAttributes::EXPRESSION))) { int start_idx=-1, end_idx=-1; @@ -1112,13 +1112,13 @@ void PgModelerCli::fixOpClassesFamiliesReferences(QString &obj_xml) { ObjectType ref_obj_type; - if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjIndex))) || + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Index))) || obj_xml.contains(QRegExp(QString("(%1)(.)+(type=)(\")(%2)(\")") - .arg(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjConstraint))) + .arg(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Constraint))) .arg(ParsersAttributes::EX_CONSTR)))) - ref_obj_type=ObjectType::ObjOpClass; - else if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::ObjOpClass)))) - ref_obj_type=ObjectType::ObjOpFamily; + ref_obj_type=ObjectType::OpClass; + else if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::OpClass)))) + ref_obj_type=ObjectType::OpFamily; else return; @@ -1278,8 +1278,8 @@ void PgModelerCli::importDatabase(DatabaseModel *model, Connection conn) catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); - db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::ParamDbName), ObjectType::ObjDatabase); - obj_oids[ObjectType::ObjDatabase].push_back(db_oid.toUInt()); + db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::ParamDbName), ObjectType::Database); + obj_oids[ObjectType::Database].push_back(db_oid.toUInt()); catalog.closeConnection(); diff --git a/main-cli/src/pgmodelercli.h b/main-cli/src/pgmodelercli.h index 73a21346c9..338e6a55a5 100644 --- a/main-cli/src/pgmodelercli.h +++ b/main-cli/src/pgmodelercli.h @@ -218,7 +218,7 @@ class PgModelerCli: public QApplication { private slots: void handleObjectAddition(BaseObject *); - void updateProgress(int progress, QString msg, ObjectType = ObjectType::ObjBaseObject); + void updateProgress(int progress, QString msg, ObjectType = ObjectType::BaseObject); void printIgnoredError(QString err_cod, QString err_msg, QString cmd); void handleObjectRemoval(BaseObject *object); }; diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index aa74bcc516..c9366ff023 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -81,7 +81,7 @@ void Xml2ObjectWidget::generateObject(void) object=model->createObject(obj_type); if(object && !dynamic_cast(object) && - obj_type!=ObjectType::ObjRelationship && obj_type!=ObjectType::ObjBaseRelationship) + obj_type!=ObjectType::Relationship && obj_type!=ObjectType::BaseRelationship) { model->addObject(object); op_list->registerObject(object, Operation::ObjectCreated, -1, model); From 5b4bdf648065fbc934db5fa6801f7c3af29a4a4c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 08:21:18 -0300 Subject: [PATCH 177/425] Fixed a bug in DatabaseModel::destroyObjects that could lead to segfault when the to be destroyed model has permissions on it --- libpgmodeler/src/databasemodel.cpp | 298 +++++++++++++++-------------- 1 file changed, 153 insertions(+), 145 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 72577279c4..13fcda52a7 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -44,11 +44,11 @@ DatabaseModel::DatabaseModel(void) attributes[ParsersAttributes::ENCODING]=QString(); attributes[ParsersAttributes::TEMPLATE_DB]=QString(); attributes[ParsersAttributes::CONN_LIMIT]=QString(); - attributes[ParsersAttributes::_LC_COLLATE_]=QString(); - attributes[ParsersAttributes::_LC_CTYPE_]=QString(); - attributes[ParsersAttributes::APPEND_AT_EOD]=QString(); + attributes[ParsersAttributes::LcCollate]=QString(); + attributes[ParsersAttributes::LcCtype]=QString(); + attributes[ParsersAttributes::AppendAtEod]=QString(); attributes[ParsersAttributes::PREPEND_AT_BOD]=QString(); - attributes[ParsersAttributes::ALLOW_CONNS]=QString(); + attributes[ParsersAttributes::AllowConns]=QString(); attributes[ParsersAttributes::IS_TEMPLATE]=QString(); } @@ -744,10 +744,14 @@ void DatabaseModel::destroyObjects(void) map objects; map::reverse_iterator ritr, ritr_end; vector rem_obj_types; + vector perms; //Blocking signals of all graphical objects to avoid uneeded updates in the destruction this->blockSignals(true); + //Making a copy of the permissions list so these objects can be destroyed at the end + perms = permissions; + for(unsigned i=0; i < 5; i++) { for(auto &object : *this->getObjectList(graph_types[i])) @@ -779,8 +783,9 @@ void DatabaseModel::destroyObjects(void) object = ritr->second; ritr++; - // We ignore the database itself as well table children objects + // We ignore the database itself, permission objects (destroyed separetely) and table children objects if(object->getObjectType() == ObjectType::Database || + object->getObjectType() == ObjectType::Permission || TableObject::isTableObject(object->getObjectType())) continue; @@ -803,6 +808,9 @@ void DatabaseModel::destroyObjects(void) PgSqlType::removeUserTypes(this); + for(auto &perm : perms) + delete(perm); + //Cleaning out the list of removed objects to avoid segfaults while calling this method again if(!rem_obj_types.empty()) { @@ -2959,12 +2967,12 @@ void DatabaseModel::configureDatabase(attribs_map &attribs) { encoding=attribs[ParsersAttributes::ENCODING]; template_db=attribs[ParsersAttributes::TEMPLATE_DB]; - localizations[0]=attribs[ParsersAttributes::_LC_CTYPE_]; - localizations[1]=attribs[ParsersAttributes::_LC_COLLATE_]; - append_at_eod=attribs[ParsersAttributes::APPEND_AT_EOD]==ParsersAttributes::_TRUE_; - prepend_at_bod=attribs[ParsersAttributes::PREPEND_AT_BOD]==ParsersAttributes::_TRUE_; - is_template=attribs[ParsersAttributes::IS_TEMPLATE]==ParsersAttributes::_TRUE_; - allow_conns=attribs[ParsersAttributes::ALLOW_CONNS] != ParsersAttributes::_FALSE_; + localizations[0]=attribs[ParsersAttributes::LcCtype]; + localizations[1]=attribs[ParsersAttributes::LcCollate]; + append_at_eod=attribs[ParsersAttributes::AppendAtEod]==ParsersAttributes::True; + prepend_at_bod=attribs[ParsersAttributes::PREPEND_AT_BOD]==ParsersAttributes::True; + is_template=attribs[ParsersAttributes::IS_TEMPLATE]==ParsersAttributes::True; + allow_conns=attribs[ParsersAttributes::AllowConns] != ParsersAttributes::False; if(!attribs[ParsersAttributes::CONN_LIMIT].isEmpty()) conn_limit=attribs[ParsersAttributes::CONN_LIMIT].toInt(); @@ -3020,11 +3028,11 @@ void DatabaseModel::loadModel(const QString &filename) this->last_zoom=attribs[ParsersAttributes::LAST_ZOOM].toDouble(); if(this->last_zoom <= 0) this->last_zoom=1; - this->is_template = attribs[ParsersAttributes::IS_TEMPLATE] == ParsersAttributes::_TRUE_; - this->allow_conns = (attribs[ParsersAttributes::ALLOW_CONNS].isEmpty() || - attribs[ParsersAttributes::ALLOW_CONNS] == ParsersAttributes::_TRUE_); + this->is_template = attribs[ParsersAttributes::IS_TEMPLATE] == ParsersAttributes::True; + this->allow_conns = (attribs[ParsersAttributes::AllowConns].isEmpty() || + attribs[ParsersAttributes::AllowConns] == ParsersAttributes::True); - protected_model=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_); + protected_model=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::True); def_objs[ObjectType::Schema]=attribs[ParsersAttributes::DEFAULT_SCHEMA]; def_objs[ObjectType::Role]=attribs[ParsersAttributes::DEFAULT_OWNER]; @@ -3244,10 +3252,10 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) object->setName(attribs[ParsersAttributes::NAME]); if(BaseObject::acceptsAlias(obj_type_aux)) - object->setAlias(attribs[ParsersAttributes::ALIAS]); + object->setAlias(attribs[ParsersAttributes::Alias]); - protected_obj=attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_; - sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_; + protected_obj=attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::True; + sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::True; xmlparser.savePosition(); @@ -3303,7 +3311,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) object->setCollation(collation); has_error=(!collation && !attribs_aux[ParsersAttributes::NAME].isEmpty()); } - else if(elem_name==ParsersAttributes::APPENDED_SQL) + else if(elem_name==ParsersAttributes::AppendedSql) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -3451,7 +3459,7 @@ Role *DatabaseModel::createRole(void) QString op_attribs[]={ ParsersAttributes::SUPERUSER, ParsersAttributes::CREATEDB, ParsersAttributes::CREATEROLE, ParsersAttributes::INHERIT, ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, - ParsersAttributes::REPLICATION, ParsersAttributes::BYPASSRLS }; + ParsersAttributes::REPLICATION, ParsersAttributes::BypassRls }; unsigned op_vect[]={ Role::OpSuperuser, Role::OpCreateDb, Role::OpCreateRole, Role::OpInherit, @@ -3475,7 +3483,7 @@ Role *DatabaseModel::createRole(void) //Setting up the role options according to the configured on the XML for(i=0; i < 8; i++) { - marked=attribs[op_attribs[i]]==ParsersAttributes::_TRUE_; + marked=attribs[op_attribs[i]]==ParsersAttributes::True; role->setOption(op_vect[i], marked); } @@ -3570,8 +3578,8 @@ Schema *DatabaseModel::createSchema(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(schema); schema->setFillColor(QColor(attribs[ParsersAttributes::FILL_COLOR])); - schema->setRectVisible(attribs[ParsersAttributes::RECT_VISIBLE]==ParsersAttributes::_TRUE_); - schema->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); + schema->setRectVisible(attribs[ParsersAttributes::RECT_VISIBLE]==ParsersAttributes::True); + schema->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); } catch(Exception &e) { @@ -3596,7 +3604,7 @@ Language *DatabaseModel::createLanguage(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(lang); - lang->setTrusted(attribs[ParsersAttributes::TRUSTED]==ParsersAttributes::_TRUE_); + lang->setTrusted(attribs[ParsersAttributes::TRUSTED]==ParsersAttributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3676,18 +3684,18 @@ Function *DatabaseModel::createFunction(void) if(!attribs[ParsersAttributes::RETURNS_SETOF].isEmpty()) func->setReturnSetOf(attribs[ParsersAttributes::RETURNS_SETOF]== - ParsersAttributes::_TRUE_); + ParsersAttributes::True); if(!attribs[ParsersAttributes::WINDOW_FUNC].isEmpty()) func->setWindowFunction(attribs[ParsersAttributes::WINDOW_FUNC]== - ParsersAttributes::_TRUE_); + ParsersAttributes::True); if(!attribs[ParsersAttributes::LEAKPROOF].isEmpty()) func->setLeakProof(attribs[ParsersAttributes::LEAKPROOF]== - ParsersAttributes::_TRUE_); + ParsersAttributes::True); - if(!attribs[ParsersAttributes::BEHAVIOR_TYPE].isEmpty()) - func->setBehaviorType(BehaviorType(attribs[ParsersAttributes::BEHAVIOR_TYPE])); + if(!attribs[ParsersAttributes::BehaviorType].isEmpty()) + func->setBehaviorType(BehaviorType(attribs[ParsersAttributes::BehaviorType])); if(!attribs[ParsersAttributes::FUNCTION_TYPE].isEmpty()) func->setFunctionType(FunctionType(attribs[ParsersAttributes::FUNCTION_TYPE])); @@ -3842,9 +3850,9 @@ Parameter DatabaseModel::createParameter(void) while(xmlparser.accessElement(XmlParser::NextElement)); } - param.setIn(attribs[ParsersAttributes::PARAM_IN]==ParsersAttributes::_TRUE_); - param.setOut(attribs[ParsersAttributes::PARAM_OUT]==ParsersAttributes::_TRUE_); - param.setVariadic(attribs[ParsersAttributes::PARAM_VARIADIC]==ParsersAttributes::_TRUE_); + param.setIn(attribs[ParsersAttributes::PARAM_IN]==ParsersAttributes::True); + param.setOut(attribs[ParsersAttributes::PARAM_OUT]==ParsersAttributes::True); + param.setVariadic(attribs[ParsersAttributes::PARAM_VARIADIC]==ParsersAttributes::True); xmlparser.restorePosition(); } @@ -3942,7 +3950,7 @@ PgSqlType DatabaseModel::createPgSQLType(void) if(!attribs[ParsersAttributes::PRECISION].isEmpty()) precision=attribs[ParsersAttributes::PRECISION].toInt(); - with_timezone=(attribs[ParsersAttributes::WITH_TIMEZONE]==ParsersAttributes::_TRUE_); + with_timezone=(attribs[ParsersAttributes::WITH_TIMEZONE]==ParsersAttributes::True); interv_type=attribs[ParsersAttributes::INTERVAL_TYPE]; if(!attribs[ParsersAttributes::SPATIAL_TYPE].isEmpty()) @@ -3995,16 +4003,16 @@ Type *DatabaseModel::createType(void) setBasicAttributes(type); xmlparser.getElementAttributes(attribs); - if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BASE_TYPE) + if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BaseType) { type->setConfiguration(Type::BaseType); - type->setByValue(attribs[ParsersAttributes::BY_VALUE]==ParsersAttributes::_TRUE_); + type->setByValue(attribs[ParsersAttributes::ByValue]==ParsersAttributes::True); if(!attribs[ParsersAttributes::INTERNAL_LENGTH].isEmpty()) type->setInternalLength(attribs[ParsersAttributes::INTERNAL_LENGTH].toUInt()); - if(!attribs[ParsersAttributes::ALIGNMENT].isEmpty()) - type->setAlignment(attribs[ParsersAttributes::ALIGNMENT]); + if(!attribs[ParsersAttributes::Alignment].isEmpty()) + type->setAlignment(attribs[ParsersAttributes::Alignment]); if(!attribs[ParsersAttributes::STORAGE].isEmpty()) type->setStorage(attribs[ParsersAttributes::STORAGE]); @@ -4018,11 +4026,11 @@ Type *DatabaseModel::createType(void) if(!attribs[ParsersAttributes::DEFAULT_VALUE].isEmpty()) type->setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); - if(!attribs[ParsersAttributes::CATEGORY].isEmpty()) - type->setCategory(attribs[ParsersAttributes::CATEGORY]); + if(!attribs[ParsersAttributes::Category].isEmpty()) + type->setCategory(attribs[ParsersAttributes::Category]); if(!attribs[ParsersAttributes::PREFERRED].isEmpty()) - type->setPreferred(attribs[ParsersAttributes::PREFERRED]==ParsersAttributes::_TRUE_); + type->setPreferred(attribs[ParsersAttributes::PREFERRED]==ParsersAttributes::True); //Configuring an auxiliary map used to reference the functions used by base type func_types[ParsersAttributes::INPUT_FUNC]=Type::InputFunc; @@ -4031,7 +4039,7 @@ Type *DatabaseModel::createType(void) func_types[ParsersAttributes::RECV_FUNC]=Type::RecvFunc; func_types[ParsersAttributes::TPMOD_IN_FUNC]=Type::TpmodInFunc; func_types[ParsersAttributes::TPMOD_OUT_FUNC]=Type::TpmodOutFunc; - func_types[ParsersAttributes::ANALYZE_FUNC]=Type::AnalyzeFunc; + func_types[ParsersAttributes::AnalyzeFunc]=Type::AnalyzeFunc; } else if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::COMPOSITE_TYPE) type->setConfiguration(Type::CompositeType); @@ -4040,7 +4048,7 @@ Type *DatabaseModel::createType(void) else { type->setConfiguration(Type::RangeType); - func_types[ParsersAttributes::CANONICAL_FUNC]=Type::CanonicalFunc; + func_types[ParsersAttributes::CanonicalFunc]=Type::CanonicalFunc; func_types[ParsersAttributes::SUBTYPE_DIFF_FUNC]=Type::SubtypeDiffFunc; } @@ -4175,7 +4183,7 @@ Domain *DatabaseModel::createDomain(void) if(!attribs[ParsersAttributes::DEFAULT_VALUE].isEmpty()) domain->setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); - domain->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::_TRUE_); + domain->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4228,14 +4236,14 @@ Cast *DatabaseModel::createCast(void) setBasicAttributes(cast); xmlparser.getElementAttributes(attribs); - if(attribs[ParsersAttributes::CAST_TYPE]==ParsersAttributes::IMPLICIT) + if(attribs[ParsersAttributes::CastType]==ParsersAttributes::IMPLICIT) cast->setCastType(Cast::Implicit); - else if(attribs[ParsersAttributes::CAST_TYPE]==ParsersAttributes::ASSIGNMENT) + else if(attribs[ParsersAttributes::CastType]==ParsersAttributes::Assignment) cast->setCastType(Cast::Assignment); else cast->setCastType(Cast::Explicit); - cast->setInOut(attribs[ParsersAttributes::IO_CAST]==ParsersAttributes::_TRUE_); + cast->setInOut(attribs[ParsersAttributes::IO_CAST]==ParsersAttributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4305,7 +4313,7 @@ Conversion *DatabaseModel::createConversion(void) conv->setEncoding(Conversion::DstEncoding, EncodingType(attribs[ParsersAttributes::DST_ENCODING])); - conv->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::_TRUE_); + conv->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4362,8 +4370,8 @@ Operator *DatabaseModel::createOperator(void) setBasicAttributes(oper); xmlparser.getElementAttributes(attribs); - oper->setMerges(attribs[ParsersAttributes::MERGES]==ParsersAttributes::_TRUE_); - oper->setHashes(attribs[ParsersAttributes::HASHES]==ParsersAttributes::_TRUE_); + oper->setMerges(attribs[ParsersAttributes::MERGES]==ParsersAttributes::True); + oper->setHashes(attribs[ParsersAttributes::HASHES]==ParsersAttributes::True); func_types[ParsersAttributes::OPERATOR_FUNC]=Operator::FUNC_OPERATOR; func_types[ParsersAttributes::JOIN_FUNC]=Operator::FUNC_JOIN; @@ -4458,7 +4466,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) xmlparser.getElementAttributes(attribs); op_class->setIndexingType(IndexingType(attribs[ParsersAttributes::INDEX_TYPE])); - op_class->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::_TRUE_); + op_class->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::True); elem_types[ParsersAttributes::FUNCTION]=OperatorClassElement::FunctionElem; elem_types[ParsersAttributes::OPERATOR]=OperatorClassElement::OperatorElem; @@ -4668,13 +4676,13 @@ Table *DatabaseModel::createTable(void) xmlparser.getElementAttributes(attribs); table->setObjectListsCapacity(attribs[ParsersAttributes::MAX_OBJ_COUNT].toUInt()); - table->setWithOIDs(attribs[ParsersAttributes::OIDS]==ParsersAttributes::_TRUE_); - table->setUnlogged(attribs[ParsersAttributes::UNLOGGED]==ParsersAttributes::_TRUE_); - table->setRLSEnabled(attribs[ParsersAttributes::RLS_ENABLED]==ParsersAttributes::_TRUE_); - table->setRLSForced(attribs[ParsersAttributes::RLS_FORCED]==ParsersAttributes::_TRUE_); - table->setGenerateAlterCmds(attribs[ParsersAttributes::GEN_ALTER_CMDS]==ParsersAttributes::_TRUE_); - table->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); - table->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); + table->setWithOIDs(attribs[ParsersAttributes::OIDS]==ParsersAttributes::True); + table->setUnlogged(attribs[ParsersAttributes::UNLOGGED]==ParsersAttributes::True); + table->setRLSEnabled(attribs[ParsersAttributes::RLS_ENABLED]==ParsersAttributes::True); + table->setRLSForced(attribs[ParsersAttributes::RLS_FORCED]==ParsersAttributes::True); + table->setGenerateAlterCmds(attribs[ParsersAttributes::GEN_ALTER_CMDS]==ParsersAttributes::True); + table->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::True); + table->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4810,10 +4818,10 @@ Column *DatabaseModel::createColumn(void) setBasicAttributes(column); xmlparser.getElementAttributes(attribs); - column->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::_TRUE_); + column->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::True); column->setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); column->setIdSeqAttributes(attribs[ParsersAttributes::MIN_VALUE], attribs[ParsersAttributes::MAX_VALUE], attribs[ParsersAttributes::INCREMENT], - attribs[ParsersAttributes::START], attribs[ParsersAttributes::CACHE], attribs[ParsersAttributes::CYCLE] == ParsersAttributes::_TRUE_); + attribs[ParsersAttributes::START], attribs[ParsersAttributes::Cache], attribs[ParsersAttributes::CYCLE] == ParsersAttributes::True); if(!attribs[ParsersAttributes::IDENTITY_TYPE].isEmpty()) column->setIdentityType(IdentityType(attribs[ParsersAttributes::IDENTITY_TYPE])); @@ -4919,7 +4927,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setParentTable(table); //Configuring the constraint type - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::CK_CONSTR) + if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::CkConstr) constr_type=ConstraintType::Check; else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::PK_CONSTR) constr_type=ConstraintType::PrimaryKey; @@ -4943,7 +4951,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) .arg(constr->getName()), ErrorCode::InvPrimaryKeyAllocation,__PRETTY_FUNCTION__,__FILE__,__LINE__); - deferrable=(attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::_TRUE_); + deferrable=(attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::True); constr->setDeferrable(deferrable); if(deferrable && !attribs[ParsersAttributes::DEFER_TYPE].isEmpty()) @@ -4981,7 +4989,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) } else if(constr_type==ConstraintType::Check) { - constr->setNoInherit(attribs[ParsersAttributes::NO_INHERIT]==ParsersAttributes::_TRUE_); + constr->setNoInherit(attribs[ParsersAttributes::NO_INHERIT]==ParsersAttributes::True); } else if(constr_type==ConstraintType::Exclude && !attribs[ParsersAttributes::INDEX_TYPE].isEmpty()) { @@ -5096,9 +5104,9 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setOperator(nullptr); elem.setOperatorClass(nullptr); - elem.setSortingAttribute(Element::AscOrder, attribs[ParsersAttributes::ASC_ORDER]==ParsersAttributes::_TRUE_); - elem.setSortingAttribute(Element::NullsFirst, attribs[ParsersAttributes::NULLS_FIRST]==ParsersAttributes::_TRUE_); - elem.setSortingEnabled(attribs[ParsersAttributes::USE_SORTING]!=ParsersAttributes::_FALSE_); + elem.setSortingAttribute(Element::AscOrder, attribs[ParsersAttributes::AscOrder]==ParsersAttributes::True); + elem.setSortingAttribute(Element::NullsFirst, attribs[ParsersAttributes::NULLS_FIRST]==ParsersAttributes::True); + elem.setSortingEnabled(attribs[ParsersAttributes::USE_SORTING]!=ParsersAttributes::False); xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5265,10 +5273,10 @@ QString DatabaseModel::getAlterDefinition(BaseObject *object) aux_attribs[ParsersAttributes::CONN_LIMIT]=QString::number(db_aux->conn_limit); if(this->is_template != db_aux->is_template) - aux_attribs[ParsersAttributes::IS_TEMPLATE] = (db_aux->is_template ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + aux_attribs[ParsersAttributes::IS_TEMPLATE] = (db_aux->is_template ? ParsersAttributes::True : ParsersAttributes::False); if(this->allow_conns != db_aux->allow_conns) - aux_attribs[ParsersAttributes::ALLOW_CONNS] = (db_aux->allow_conns ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + aux_attribs[ParsersAttributes::AllowConns] = (db_aux->allow_conns ? ParsersAttributes::True : ParsersAttributes::False); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), aux_attribs, true, false); alter_def+=BaseObject::getAlterDefinition(object); @@ -5313,10 +5321,10 @@ Index *DatabaseModel::createIndex(void) index=new Index; setBasicAttributes(index); index->setParentTable(table); - index->setIndexAttribute(Index::Concurrent, attribs[ParsersAttributes::CONCURRENT]==ParsersAttributes::_TRUE_); - index->setIndexAttribute(Index::Unique, attribs[ParsersAttributes::UNIQUE]==ParsersAttributes::_TRUE_); - index->setIndexAttribute(Index::FastUpdate, attribs[ParsersAttributes::FAST_UPDATE]==ParsersAttributes::_TRUE_); - index->setIndexAttribute(Index::Buffering, attribs[ParsersAttributes::BUFFERING]==ParsersAttributes::_TRUE_); + index->setIndexAttribute(Index::Concurrent, attribs[ParsersAttributes::CONCURRENT]==ParsersAttributes::True); + index->setIndexAttribute(Index::Unique, attribs[ParsersAttributes::UNIQUE]==ParsersAttributes::True); + index->setIndexAttribute(Index::FastUpdate, attribs[ParsersAttributes::FAST_UPDATE]==ParsersAttributes::True); + index->setIndexAttribute(Index::Buffering, attribs[ParsersAttributes::Buffering]==ParsersAttributes::True); index->setIndexingType(attribs[ParsersAttributes::INDEX_TYPE]); index->setFillFactor(attribs[ParsersAttributes::FACTOR].toUInt()); @@ -5472,28 +5480,28 @@ Trigger *DatabaseModel::createTrigger(void) setBasicAttributes(trigger); - trigger->setConstraint(attribs[ParsersAttributes::CONSTRAINT]==ParsersAttributes::_TRUE_); + trigger->setConstraint(attribs[ParsersAttributes::CONSTRAINT]==ParsersAttributes::True); trigger->setEvent(EventType::OnInsert, - (attribs[ParsersAttributes::INS_EVENT]==ParsersAttributes::_TRUE_)); + (attribs[ParsersAttributes::INS_EVENT]==ParsersAttributes::True)); trigger->setEvent(EventType::OnDelete, - (attribs[ParsersAttributes::DEL_EVENT]==ParsersAttributes::_TRUE_)); + (attribs[ParsersAttributes::DEL_EVENT]==ParsersAttributes::True)); trigger->setEvent(EventType::OnUpdate, - (attribs[ParsersAttributes::UPD_EVENT]==ParsersAttributes::_TRUE_)); + (attribs[ParsersAttributes::UPD_EVENT]==ParsersAttributes::True)); trigger->setEvent(EventType::OnTruncate, - (attribs[ParsersAttributes::TRUNC_EVENT]==ParsersAttributes::_TRUE_)); + (attribs[ParsersAttributes::TRUNC_EVENT]==ParsersAttributes::True)); - trigger->setExecutePerRow(attribs[ParsersAttributes::PER_ROW]==ParsersAttributes::_TRUE_); + trigger->setExecutePerRow(attribs[ParsersAttributes::PER_ROW]==ParsersAttributes::True); trigger->setFiringType(FiringType(attribs[ParsersAttributes::FIRING_TYPE])); trigger->setTransitionTableName(Trigger::OldTableName, attribs[ParsersAttributes::OLD_TABLE_NAME]); trigger->setTransitionTableName(Trigger::NewTableName, attribs[ParsersAttributes::NEW_TABLE_NAME]); - list_aux=attribs[ParsersAttributes::ARGUMENTS].split(','); + list_aux=attribs[ParsersAttributes::Arguments].split(','); count=list_aux.count(); for(i=0; i < count; i++) { @@ -5501,7 +5509,7 @@ Trigger *DatabaseModel::createTrigger(void) trigger->addArgument(list_aux[i]); } - trigger->setDeferrable(attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::_TRUE_); + trigger->setDeferrable(attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::True); if(trigger->isDeferrable()) trigger->setDeferralType(attribs[ParsersAttributes::DEFER_TYPE]); @@ -5620,7 +5628,7 @@ Policy *DatabaseModel::createPolicy(void) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::_TRUE_); + policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::True); policy->setPolicyCommand(PolicyCmdType(attribs[ParsersAttributes::COMMAND])); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5639,7 +5647,7 @@ Policy *DatabaseModel::createPolicy(void) if(attribs[ParsersAttributes::TYPE] == ParsersAttributes::USING_EXP) policy->setUsingExpression(xmlparser.getElementContent()); - else if(attribs[ParsersAttributes::TYPE] == ParsersAttributes::CHECK_EXP) + else if(attribs[ParsersAttributes::TYPE] == ParsersAttributes::CheckExp) policy->setCheckExpression(xmlparser.getElementContent()); xmlparser.restorePosition(); @@ -5796,9 +5804,9 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) attribs[ParsersAttributes::MAX_VALUE], attribs[ParsersAttributes::INCREMENT], attribs[ParsersAttributes::START], - attribs[ParsersAttributes::CACHE]); + attribs[ParsersAttributes::Cache]); - sequence->setCycle(attribs[ParsersAttributes::CYCLE]==ParsersAttributes::_TRUE_); + sequence->setCycle(attribs[ParsersAttributes::CYCLE]==ParsersAttributes::True); //Getting the sequence's owner column if(!attribs[ParsersAttributes::OWNER_COLUMN].isEmpty()) @@ -5876,11 +5884,11 @@ View *DatabaseModel::createView(void) xmlparser.getElementAttributes(attribs); view->setObjectListsCapacity(attribs[ParsersAttributes::MAX_OBJ_COUNT].toUInt()); - view->setMaterialized(attribs[ParsersAttributes::MATERIALIZED]==ParsersAttributes::_TRUE_); - view->setRecursive(attribs[ParsersAttributes::RECURSIVE]==ParsersAttributes::_TRUE_); - view->setWithNoData(attribs[ParsersAttributes::WITH_NO_DATA]==ParsersAttributes::_TRUE_); - view->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); - view->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); + view->setMaterialized(attribs[ParsersAttributes::MATERIALIZED]==ParsersAttributes::True); + view->setRecursive(attribs[ParsersAttributes::RECURSIVE]==ParsersAttributes::True); + view->setWithNoData(attribs[ParsersAttributes::WITH_NO_DATA]==ParsersAttributes::True); + view->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::True); + view->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5935,7 +5943,7 @@ View *DatabaseModel::createView(void) //Adds the configured reference to a temporarily list reference = Reference(table, column, - attribs[ParsersAttributes::ALIAS], + attribs[ParsersAttributes::Alias], attribs[ParsersAttributes::COLUMN_ALIAS]); reference.setReferenceAlias(attribs[ParsersAttributes::REF_ALIAS]); refs.push_back(reference); @@ -5943,7 +5951,7 @@ View *DatabaseModel::createView(void) else { xmlparser.savePosition(); - str_aux=attribs[ParsersAttributes::ALIAS]; + str_aux=attribs[ParsersAttributes::Alias]; xmlparser.accessElement(XmlParser::ChildElement); xmlparser.accessElement(XmlParser::ChildElement); @@ -6084,8 +6092,8 @@ Collation *DatabaseModel::createCollation(void) //Creating a collation using LC_COLLATE and LC_CTYPE params else { - collation->setLocalization(Collation::LcCollate, attribs[ParsersAttributes::_LC_COLLATE_]); - collation->setLocalization(Collation::LcCtype, attribs[ParsersAttributes::_LC_CTYPE_]); + collation->setLocalization(Collation::LcCollate, attribs[ParsersAttributes::LcCollate]); + collation->setLocalization(Collation::LcCtype, attribs[ParsersAttributes::LcCtype]); } } catch(Exception &e) @@ -6108,7 +6116,7 @@ Extension *DatabaseModel::createExtension(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(extension); - extension->setHandlesType(attribs[ParsersAttributes::HANDLES_TYPE]==ParsersAttributes::_TRUE_); + extension->setHandlesType(attribs[ParsersAttributes::HANDLES_TYPE]==ParsersAttributes::True); extension->setVersion(Extension::CurVersion, attribs[ParsersAttributes::CUR_VERSION]); extension->setVersion(Extension::OldVersion, attribs[ParsersAttributes::OLD_VERSION]); } @@ -6171,10 +6179,10 @@ Textbox *DatabaseModel::createTextbox(void) xmlparser.getElementAttributes(attribs); - txtbox->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); - txtbox->setTextAttribute(Textbox::ItalicText, attribs[ParsersAttributes::ITALIC]==ParsersAttributes::_TRUE_); - txtbox->setTextAttribute(Textbox::BoldText, attribs[ParsersAttributes::BOLD]==ParsersAttributes::_TRUE_); - txtbox->setTextAttribute(Textbox::UnderlineText, attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::_TRUE_); + txtbox->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); + txtbox->setTextAttribute(Textbox::ItalicText, attribs[ParsersAttributes::ITALIC]==ParsersAttributes::True); + txtbox->setTextAttribute(Textbox::BoldText, attribs[ParsersAttributes::Bold]==ParsersAttributes::True); + txtbox->setTextAttribute(Textbox::UnderlineText, attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::True); if(!attribs[ParsersAttributes::COLOR].isEmpty()) txtbox->setTextColor(QColor(attribs[ParsersAttributes::COLOR])); @@ -6217,8 +6225,8 @@ BaseRelationship *DatabaseModel::createRelationship(void) labels_id[ParsersAttributes::DST_LABEL]=BaseRelationship::DstCardLabel; xmlparser.getElementAttributes(attribs); - protect=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_); - faded_out=(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); + protect=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::True); + faded_out=(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); if(!attribs[ParsersAttributes::CUSTOM_COLOR].isEmpty()) custom_color=QColor(attribs[ParsersAttributes::CUSTOM_COLOR]); @@ -6265,7 +6273,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) { base_rel=new BaseRelationship(BaseRelationship::RelationshipFk, tables[0], tables[1], false, false); base_rel->setName(attribs[ParsersAttributes::NAME]); - base_rel->setAlias(attribs[ParsersAttributes::ALIAS]); + base_rel->setAlias(attribs[ParsersAttributes::Alias]); addRelationship(base_rel); /* If the source table doesn't have any fk that references the destination table indicates that the relationship @@ -6326,15 +6334,15 @@ BaseRelationship *DatabaseModel::createRelationship(void) Relationship::PkColPattern }, pat_count=sizeof(pattern_id)/sizeof(unsigned); - sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_; - src_mand=attribs[ParsersAttributes::SRC_REQUIRED]==ParsersAttributes::_TRUE_; - dst_mand=attribs[ParsersAttributes::DST_REQUIRED]==ParsersAttributes::_TRUE_; - identifier=attribs[ParsersAttributes::IDENTIFIER]==ParsersAttributes::_TRUE_; - deferrable=attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::_TRUE_; + sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::True; + src_mand=attribs[ParsersAttributes::SRC_REQUIRED]==ParsersAttributes::True; + dst_mand=attribs[ParsersAttributes::DST_REQUIRED]==ParsersAttributes::True; + identifier=attribs[ParsersAttributes::IDENTIFIER]==ParsersAttributes::True; + deferrable=attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::True; defer_type=DeferralType(attribs[ParsersAttributes::DEFER_TYPE]); del_action=ActionType(attribs[ParsersAttributes::DEL_ACTION]); upd_action=ActionType(attribs[ParsersAttributes::UPD_ACTION]); - single_pk_col=(attribs[ParsersAttributes::SINGLE_PK_COLUMN]==ParsersAttributes::_TRUE_); + single_pk_col=(attribs[ParsersAttributes::SINGLE_PK_COLUMN]==ParsersAttributes::True); if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_11) rel_type=BaseRelationship::Relationship11; @@ -6364,7 +6372,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) rel->setTableNameRelNN(attribs[ParsersAttributes::TABLE_NAME]); rel->setName(attribs[ParsersAttributes::NAME]); - rel->setAlias(attribs[ParsersAttributes::ALIAS]); + rel->setAlias(attribs[ParsersAttributes::Alias]); base_rel=rel; //Configuring the name patterns @@ -6511,8 +6519,8 @@ Permission *DatabaseModel::createPermission(void) try { xmlparser.getElementAttributes(priv_attribs); - revoke=priv_attribs[ParsersAttributes::REVOKE]==ParsersAttributes::_TRUE_; - cascade=priv_attribs[ParsersAttributes::CASCADE]==ParsersAttributes::_TRUE_; + revoke=priv_attribs[ParsersAttributes::REVOKE]==ParsersAttributes::True; + cascade=priv_attribs[ParsersAttributes::Cascade]==ParsersAttributes::True; xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -6585,7 +6593,7 @@ Permission *DatabaseModel::createPermission(void) { if(itr->first!=ParsersAttributes::GRANT_OP) { - priv_value=(itr->second==ParsersAttributes::_TRUE_); + priv_value=(itr->second==ParsersAttributes::True); grant_op=(itr->second==ParsersAttributes::GRANT_OP); if(itr->first==ParsersAttributes::CONNECT_PRIV) @@ -6716,7 +6724,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { - QString loc_attribs[]={ ParsersAttributes::_LC_CTYPE_, ParsersAttributes::_LC_COLLATE_ }; + QString loc_attribs[]={ ParsersAttributes::LcCtype, ParsersAttributes::LcCollate }; if(encoding!=BaseType::Null) attributes[ParsersAttributes::ENCODING]=QString("'%1'").arg(~encoding); @@ -6732,14 +6740,14 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) else { attributes[ParsersAttributes::ENCODING]=(~encoding); - attributes[ParsersAttributes::_LC_COLLATE_]=localizations[1]; - attributes[ParsersAttributes::_LC_CTYPE_]=localizations[0]; - attributes[ParsersAttributes::APPEND_AT_EOD]=(append_at_eod ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::PREPEND_AT_BOD]=(prepend_at_bod ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::LcCollate]=localizations[1]; + attributes[ParsersAttributes::LcCtype]=localizations[0]; + attributes[ParsersAttributes::AppendAtEod]=(append_at_eod ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::PREPEND_AT_BOD]=(prepend_at_bod ? ParsersAttributes::True : QString()); } - attributes[ParsersAttributes::IS_TEMPLATE]=(is_template ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); - attributes[ParsersAttributes::ALLOW_CONNS]=(allow_conns ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + attributes[ParsersAttributes::IS_TEMPLATE]=(is_template ? ParsersAttributes::True : ParsersAttributes::False); + attributes[ParsersAttributes::AllowConns]=(allow_conns ? ParsersAttributes::True : ParsersAttributes::False); attributes[ParsersAttributes::TEMPLATE_DB]=template_db; if(def_type==SchemaParser::SqlDefinition && append_at_eod) @@ -6807,7 +6815,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) if(def_type==SchemaParser::SqlDefinition) { - attribs_aux[ParsersAttributes::FUNCTION]=(!functions.empty() ? ParsersAttributes::_TRUE_ : QString()); + attribs_aux[ParsersAttributes::FUNCTION]=(!functions.empty() ? ParsersAttributes::True : QString()); for(auto &type : types) { @@ -6924,7 +6932,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) if(def_type==SchemaParser::XmlDefinition) { attribs_aux[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); - attribs_aux[ParsersAttributes::PROTECTED]=(this->is_protected ? ParsersAttributes::_TRUE_ : QString()); + attribs_aux[ParsersAttributes::PROTECTED]=(this->is_protected ? ParsersAttributes::True : QString()); attribs_aux[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs_aux[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); attribs_aux[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getName(true) : QString()); @@ -6962,7 +6970,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } - attribs_aux[ParsersAttributes::EXPORT_TO_FILE]=(export_file ? ParsersAttributes::_TRUE_ : QString()); + attribs_aux[ParsersAttributes::EXPORT_TO_FILE]=(export_file ? ParsersAttributes::True : QString()); def=schparser.getCodeDefinition(ParsersAttributes::DB_MODEL, attribs_aux, def_type); if(prepend_at_bod && def_type==SchemaParser::SqlDefinition) @@ -9622,15 +9630,15 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[ParsersAttributes::TABLE]=QString(); attribs[ParsersAttributes::NAME]=(TableObject::isTableObject(obj_type) ? object->getName() : object->getSignature()); - attribs[ParsersAttributes::ALIAS]=(save_objs_aliases ? object->getAlias() : QString()); + attribs[ParsersAttributes::Alias]=(save_objs_aliases ? object->getAlias() : QString()); attribs[ParsersAttributes::TYPE]=object->getSchemaName(); - attribs[ParsersAttributes::PROTECTED]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? ParsersAttributes::_TRUE_ : QString()); - attribs[ParsersAttributes::SQL_DISABLED]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::PROTECTED]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? ParsersAttributes::True : QString()); + attribs[ParsersAttributes::SQL_DISABLED]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? ParsersAttributes::True : QString()); attribs[ParsersAttributes::TAG]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); - attribs[ParsersAttributes::APPENDED_SQL]=object->getAppendedSQL(); + attribs[ParsersAttributes::AppendedSql]=object->getAppendedSQL(); attribs[ParsersAttributes::PREPENDED_SQL]=object->getPrependedSQL(); - attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); - attribs[ParsersAttributes::FADED_OUT]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? ParsersAttributes::True : QString()); + attribs[ParsersAttributes::FADED_OUT]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? ParsersAttributes::True : QString()); if(TableObject::isTableObject(obj_type)) { @@ -9640,8 +9648,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_custom_sql && obj_type==ObjectType::Database) { - attribs[ParsersAttributes::APPEND_AT_EOD]=(this->isAppendAtEOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); - attribs[ParsersAttributes::PREPEND_AT_BOD]=(this->isPrependedAtBOD() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + attribs[ParsersAttributes::AppendAtEod]=(this->isAppendAtEOD() ? ParsersAttributes::True : ParsersAttributes::False); + attribs[ParsersAttributes::PREPEND_AT_BOD]=(this->isPrependedAtBOD() ? ParsersAttributes::True : ParsersAttributes::False); } //Configuring database model attributes @@ -9668,7 +9676,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option schema=dynamic_cast(object); attribs[ParsersAttributes::CUSTOM_COLOR]=(save_custom_colors ? schema->getFillColor().name() : QString()); - attribs[ParsersAttributes::RECT_VISIBLE]=(schema->isRectVisible() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + attribs[ParsersAttributes::RECT_VISIBLE]=(schema->isRectVisible() ? ParsersAttributes::True : ParsersAttributes::False); if(schema->isRectVisible()) { @@ -9744,9 +9752,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_custom_sql) { if(!object->getAppendedSQL().isEmpty()) - attribs[ParsersAttributes::APPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + attribs[ParsersAttributes::AppendedSql]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - QString(ParsersAttributes::APPENDED_SQL).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); + QString(ParsersAttributes::AppendedSql).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); if(!object->getPrependedSQL().isEmpty()) attribs[ParsersAttributes::PREPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + @@ -9766,11 +9774,11 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option (save_tags && !attribs[ParsersAttributes::TAG].isEmpty()) || (save_objs_prot && !attribs[ParsersAttributes::PROTECTED].isEmpty()) || (save_objs_sqldis && !attribs[ParsersAttributes::SQL_DISABLED].isEmpty()) || - (save_custom_sql && (!attribs[ParsersAttributes::APPENDED_SQL].isEmpty() || + (save_custom_sql && (!attribs[ParsersAttributes::AppendedSql].isEmpty() || !attribs[ParsersAttributes::PREPENDED_SQL].isEmpty())) || (save_fadeout && !attribs[ParsersAttributes::FADED_OUT].isEmpty()) || (save_extattribs && !attribs[ParsersAttributes::HIDE_EXT_ATTRIBS].isEmpty()) || - (save_objs_aliases && !attribs[ParsersAttributes::ALIAS].isEmpty())) + (save_objs_aliases && !attribs[ParsersAttributes::Alias].isEmpty())) { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving metadata of the object `%1' (%2)") @@ -9962,10 +9970,10 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option (!attribs[ParsersAttributes::SQL_DISABLED].isEmpty() && load_objs_sqldis))) { if(!attribs[ParsersAttributes::PROTECTED].isEmpty()) - object->setProtected(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::_TRUE_); + object->setProtected(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::True); if(!attribs[ParsersAttributes::SQL_DISABLED].isEmpty()) - object->setSQLDisabled(attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::_TRUE_); + object->setSQLDisabled(attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::True); } else if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && load_tags && !attribs[ParsersAttributes::TAG].isEmpty()) { @@ -9976,15 +9984,15 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option } else if(obj_type==ObjectType::Database && load_custom_sql) { - if(!attribs[ParsersAttributes::APPEND_AT_EOD].isEmpty()) - this->setAppendAtEOD(attribs[ParsersAttributes::APPEND_AT_EOD]==ParsersAttributes::_TRUE_); + if(!attribs[ParsersAttributes::AppendAtEod].isEmpty()) + this->setAppendAtEOD(attribs[ParsersAttributes::AppendAtEod]==ParsersAttributes::True); if(!attribs[ParsersAttributes::PREPEND_AT_BOD].isEmpty()) - this->setPrependAtBOD(attribs[ParsersAttributes::PREPEND_AT_BOD]==ParsersAttributes::_TRUE_); + this->setPrependAtBOD(attribs[ParsersAttributes::PREPEND_AT_BOD]==ParsersAttributes::True); } - if(load_objs_aliases && !attribs[ParsersAttributes::ALIAS].isEmpty()) - object->setAlias(attribs[ParsersAttributes::ALIAS]); + if(load_objs_aliases && !attribs[ParsersAttributes::Alias].isEmpty()) + object->setAlias(attribs[ParsersAttributes::Alias]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -10014,8 +10022,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option xmlparser.restorePosition(); } - else if(load_custom_sql && aux_elem==ParsersAttributes::APPENDED_SQL && - attribs[ParsersAttributes::APPENDED_SQL].isEmpty()) + else if(load_custom_sql && aux_elem==ParsersAttributes::AppendedSql && + attribs[ParsersAttributes::AppendedSql].isEmpty()) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -10068,14 +10076,14 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(load_custom_colors) schema->setFillColor(QColor(attribs[ParsersAttributes::CUSTOM_COLOR])); - schema->setRectVisible(attribs[ParsersAttributes::RECT_VISIBLE]==ParsersAttributes::_TRUE_); + schema->setRectVisible(attribs[ParsersAttributes::RECT_VISIBLE]==ParsersAttributes::True); } if(load_fadeout) - dynamic_cast(object)->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::_TRUE_); + dynamic_cast(object)->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); if(load_extattribs && base_tab) - base_tab->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); + base_tab->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::True); } points.clear(); From 9b674194bae300bbc2ec99ed7347b544aea2df72 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 08:21:57 -0300 Subject: [PATCH 178/425] ParsersAttributes static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 14 +- libobjrenderer/src/relationshipview.cpp | 6 +- libobjrenderer/src/tableobjectview.cpp | 2 +- libparsers/src/parsersattributes.cpp | 112 +++++++------- libparsers/src/parsersattributes.h | 112 +++++++------- libpgconnector/src/catalog.cpp | 10 +- libpgmodeler/src/aggregate.cpp | 2 +- libpgmodeler/src/basegraphicobject.cpp | 2 +- libpgmodeler/src/baseobject.cpp | 28 ++-- libpgmodeler/src/baserelationship.cpp | 6 +- libpgmodeler/src/cast.cpp | 12 +- libpgmodeler/src/collation.cpp | 8 +- libpgmodeler/src/column.cpp | 18 +-- libpgmodeler/src/constraint.cpp | 14 +- libpgmodeler/src/conversion.cpp | 2 +- libpgmodeler/src/domain.cpp | 4 +- libpgmodeler/src/element.cpp | 6 +- libpgmodeler/src/eventtrigger.cpp | 2 +- libpgmodeler/src/extension.cpp | 4 +- libpgmodeler/src/function.cpp | 18 +-- libpgmodeler/src/index.cpp | 22 +-- libpgmodeler/src/language.cpp | 2 +- libpgmodeler/src/operator.cpp | 4 +- libpgmodeler/src/operatorclass.cpp | 2 +- libpgmodeler/src/operatorclasselement.cpp | 6 +- libpgmodeler/src/parameter.cpp | 6 +- libpgmodeler/src/permission.cpp | 8 +- libpgmodeler/src/pgsqltypes.cpp | 2 +- libpgmodeler/src/policy.cpp | 10 +- libpgmodeler/src/reference.cpp | 2 +- libpgmodeler/src/relationship.cpp | 26 ++-- libpgmodeler/src/role.cpp | 16 +- libpgmodeler/src/schema.cpp | 2 +- libpgmodeler/src/sequence.cpp | 14 +- libpgmodeler/src/table.cpp | 38 ++--- libpgmodeler/src/tableobject.cpp | 2 +- libpgmodeler/src/textbox.cpp | 8 +- libpgmodeler/src/trigger.cpp | 14 +- libpgmodeler/src/type.cpp | 50 +++---- libpgmodeler/src/view.cpp | 8 +- .../src/appearanceconfigwidget.cpp | 14 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 2 +- .../src/connectionsconfigwidget.cpp | 26 ++-- .../src/databaseexplorerwidget.cpp | 68 ++++----- libpgmodeler_ui/src/databaseimportform.cpp | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 62 ++++---- libpgmodeler_ui/src/generalconfigwidget.cpp | 138 +++++++++--------- libpgmodeler_ui/src/mainwindow.cpp | 70 ++++----- libpgmodeler_ui/src/modeldatabasediffform.cpp | 2 +- libpgmodeler_ui/src/modelfixform.cpp | 6 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 12 +- .../src/relationshipconfigwidget.cpp | 4 +- libpgmodeler_ui/src/relationshipwidget.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 14 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 18 +-- libpgmodeler_ui/src/updatenotifierwidget.cpp | 4 +- main-cli/src/pgmodelercli.cpp | 6 +- schemas/catalog/trigger.sch | 2 +- 58 files changed, 538 insertions(+), 538 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index fb3d9659e3..8a78d4dcb1 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -236,9 +236,9 @@ void BaseObjectView::loadObjectsStyle(void) { font.setFamily(attribs[ParsersAttributes::FONT]); font.setPointSizeF(attribs[ParsersAttributes::SIZE].toDouble()); - font.setBold(attribs[ParsersAttributes::BOLD]==ParsersAttributes::_TRUE_); - font.setItalic(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::_TRUE_); - font.setUnderline(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::_TRUE_); + font.setBold(attribs[ParsersAttributes::Bold]==ParsersAttributes::True); + font.setItalic(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::True); + font.setUnderline(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::True); font_fmt.setFont(font); font_config[ParsersAttributes::GLOBAL]=font_fmt; } @@ -247,9 +247,9 @@ void BaseObjectView::loadObjectsStyle(void) font_config[attribs[ParsersAttributes::ID]]=font_fmt; itr=font_config.find(attribs[ParsersAttributes::ID]); font=font_fmt.font(); - font.setBold(attribs[ParsersAttributes::BOLD]==ParsersAttributes::_TRUE_); - font.setItalic(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::_TRUE_); - font.setUnderline(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::_TRUE_); + font.setBold(attribs[ParsersAttributes::Bold]==ParsersAttributes::True); + font.setItalic(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::True); + font.setUnderline(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::True); (itr->second).setFont(font); (itr->second).setForeground(QColor(attribs[ParsersAttributes::COLOR])); } @@ -260,7 +260,7 @@ void BaseObjectView::loadObjectsStyle(void) vector colors; colors.push_back(!list.isEmpty() ? QColor(list[0]) : QColor(0,0,0)); colors.push_back(list.size()==2 ? QColor(list[1]) : colors[0]); - colors.push_back(QColor(attribs[ParsersAttributes::BORDER_COLOR])); + colors.push_back(QColor(attribs[ParsersAttributes::BorderColor])); color_config[attribs[ParsersAttributes::ID]]=colors; } diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 39da34ee0f..fc7c3dc05d 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1717,7 +1717,7 @@ void RelationshipView::configureAttributes(void) double py, px, factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize; - fmt=font_config[ParsersAttributes::ATTRIBUTE]; + fmt=font_config[ParsersAttributes::Attribute]; font=fmt.font(); font.setPointSizeF(font.pointSizeF() * 0.80f); @@ -1772,8 +1772,8 @@ void RelationshipView::configureAttributes(void) } desc->setRect(rect); - desc->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::ATTRIBUTE)); - desc->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::ATTRIBUTE)); + desc->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::Attribute)); + desc->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::Attribute)); lin->setPen(descriptor->pen()); text->setBrush(fmt.foreground()); text->setFont(font); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 40295f0222..0d51210e9e 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -506,7 +506,7 @@ void TableObjectView::configureObject(Reference reference) str_aux=reference.getColumnAlias(); str_aux=QString(" (") + str_aux + QString(") "); - fmt=font_config[ParsersAttributes::ALIAS]; + fmt=font_config[ParsersAttributes::Alias]; lables[2]->setText(str_aux); lables[2]->setFont(fmt.font()); lables[2]->setBrush(fmt.foreground()); diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/parsersattributes.cpp index 42783185c3..fbfa662920 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/parsersattributes.cpp @@ -20,62 +20,62 @@ namespace ParsersAttributes { const QString - _FALSE_=QString("false"), - _FILE_=QString("file"), - _LC_COLLATE_=QString("lc-collate"), - _LC_CTYPE_=QString("lc-ctype"), - _TRUE_=QString("true"), - ADMIN_OPTION=QString("admin-option"), - ADMIN_ROLES=QString("admin-roles"), - ALIAS=QString("alias"), - ALIGNMENT=QString("alignment"), - ALIGN_OBJS_TO_GRID=QString("align-objs-to-grid"), - ALTER_CMDS=QString("alter-cmds"), - ALLOW_CONNS=QString("allow-conns"), - ANALYZE_FUNC=QString("analyze"), - ANCESTOR_TABLE=QString("ancestor-table"), - APPEND_AT_EOD=QString("append-at-eod"), - APPENDED_SQL=QString("appended-sql"), - APPLICATION=QString("application"), - ARG_COUNT=QString("arg-count"), - ARG_DEF_COUNT=QString("arg-def-count"), - ARG_DEFAULTS=QString("arg-defaults"), - ARG_MODES=QString("arg-modes"), - ARG_NAMES=QString("arg-names"), - ARG_TYPES=QString("arg-types"), - ARGUMENTS=QString("arguments"), - ASC_ORDER=QString("asc-order"), - ASSIGNMENT=QString("assignment"), - ATTRIBUTE=QString("attribute"), - AUTO_BROWSE_DB=QString("auto-browse-db"), - AUTOSAVE_INTERVAL=QString("autosave-interval"), - BACKGROUND_COLOR=QString("background-color"), - BASE_TYPE=QString("base"), - BEFORE=QString("before"), - BEHAVIOR_TYPE=QString("behavior-type"), - BOLD=QString("bold"), - BORDER_COLOR=QString("border-color"), - BOTTOM=QString("bottom"), - BUFFERING=QString("buffering"), - BY_VALUE=QString("by-value"), - BYPASSRLS=QString("bypassrls"), - CACHE=QString("cache"), - CANONICAL_FUNC=QString("canonical"), - CANVAS_CORNER_MOVE=QString("canvas-corner-move"), - CASCADE=QString("cascade"), - CASE_SENSITIVE=QString("case-sensitive"), - CAST_TYPE=QString("cast-type"), - CATEGORY=QString("category"), - CHANGE=QString("change"), - CHANGELOG=QString("changelog"), - CHECK_EXP=QString("check-exp"), - CHECK_UPDATE=QString("check-update"), - CK_CONSTR=QString("ck-constr"), - CLIENT_ENCODING=QString("client-encoding"), - CODE_COMPLETION=QString("code-completion"), - CODE_FONT_SIZE=QString("code-font-size"), - CODE_FONT=QString("code-font"), - CODE_TAB_WIDTH=QString("code-tab-width"), + False=QString("false"), + File=QString("file"), + LcCollate=QString("lc-collate"), + LcCtype=QString("lc-ctype"), + True=QString("true"), + AdminOption=QString("admin-option"), + AdminRoles=QString("admin-roles"), + Alias=QString("alias"), + Alignment=QString("alignment"), + AlignObjsToGrid=QString("align-objs-to-grid"), + AlterCmds=QString("alter-cmds"), + AllowConns=QString("allow-conns"), + AnalyzeFunc=QString("analyze"), + AncestorTable=QString("ancestor-table"), + AppendAtEod=QString("append-at-eod"), + AppendedSql=QString("appended-sql"), + Application=QString("application"), + ArgCount=QString("arg-count"), + ArgDefCount=QString("arg-def-count"), + ArgDefaults=QString("arg-defaults"), + ArgModes=QString("arg-modes"), + ArgNames=QString("arg-names"), + ArgTypes=QString("arg-types"), + Arguments=QString("arguments"), + AscOrder=QString("asc-order"), + Assignment=QString("assignment"), + Attribute=QString("attribute"), + AutoBrowseDb=QString("auto-browse-db"), + AutoSaveInterval=QString("autosave-interval"), + BackgroundColor=QString("background-color"), + BaseType=QString("base"), + Before=QString("before"), + BehaviorType=QString("behavior-type"), + Bold=QString("bold"), + BorderColor=QString("border-color"), + Bottom=QString("bottom"), + Buffering=QString("buffering"), + ByValue=QString("by-value"), + BypassRls=QString("bypassrls"), + Cache=QString("cache"), + CanonicalFunc=QString("canonical"), + CanvasCornerMove=QString("canvas-corner-move"), + Cascade=QString("cascade"), + CaseSensitive=QString("case-sensitive"), + CastType=QString("cast-type"), + Category=QString("category"), + Change=QString("change"), + Changelog=QString("changelog"), + CheckExp=QString("check-exp"), + CheckUpdate=QString("check-update"), + CkConstr=QString("ck-constr"), + ClientEncoding=QString("client-encoding"), + CodeCompletion=QString("code-completion"), + CodeFontSize=QString("code-font-size"), + CodeFont=QString("code-font"), + CodeTabWidth=QString("code-tab-width"), COL_INDEXES=QString("col-indexes"), COLLATABLE=QString("collatable"), COLLATION=QString("collation"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/parsersattributes.h index 8d690e5f06..77c73bd268 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/parsersattributes.h @@ -35,62 +35,62 @@ namespace ParsersAttributes { extern const QString - _FALSE_, - _FILE_, - _LC_COLLATE_, - _LC_CTYPE_, - _TRUE_, - ADMIN_OPTION, - ADMIN_ROLES, - ALIAS, - ALIGNMENT, - ALIGN_OBJS_TO_GRID, - ALTER_CMDS, - ALLOW_CONNS, - ANALYZE_FUNC, - ANCESTOR_TABLE, - APPEND_AT_EOD, - APPENDED_SQL, - APPLICATION, - ARG_COUNT, - ARG_DEF_COUNT, - ARG_DEFAULTS, - ARG_MODES, - ARG_NAMES, - ARG_TYPES, - ARGUMENTS, - ASC_ORDER, - ASSIGNMENT, - ATTRIBUTE, - AUTO_BROWSE_DB, - AUTOSAVE_INTERVAL, - BACKGROUND_COLOR, - BASE_TYPE, - BEFORE, - BEHAVIOR_TYPE, - BOLD, - BORDER_COLOR, - BOTTOM, - BUFFERING, - BY_VALUE, - BYPASSRLS, - CACHE, - CANONICAL_FUNC, - CANVAS_CORNER_MOVE, - CASCADE, - CASE_SENSITIVE, - CAST_TYPE, - CATEGORY, - CHANGE, - CHANGELOG, - CHECK_EXP, - CHECK_UPDATE, - CK_CONSTR, - CLIENT_ENCODING, - CODE_COMPLETION, - CODE_FONT_SIZE, - CODE_FONT, - CODE_TAB_WIDTH, + False, + File, + LcCollate, + LcCtype, + True, + AdminOption, + AdminRoles, + Alias, + Alignment, + AlignObjsToGrid, + AlterCmds, + AllowConns, + AnalyzeFunc, + AncestorTable, + AppendAtEod, + AppendedSql, + Application, + ArgCount, + ArgDefCount, + ArgDefaults, + ArgModes, + ArgNames, + ArgTypes, + Arguments, + AscOrder, + Assignment, + Attribute, + AutoBrowseDb, + AutoSaveInterval, + BackgroundColor, + BaseType, + Before, + BehaviorType, + Bold, + BorderColor, + Bottom, + Buffering, + ByValue, + BypassRls, + Cache, + CanonicalFunc, + CanvasCornerMove, + Cascade, + CaseSensitive, + CastType, + Category, + Change, + Changelog, + CheckExp, + CheckUpdate, + CkConstr, + ClientEncoding, + CodeCompletion, + CodeFontSize, + CodeFont, + CodeTabWidth, COL_INDEXES, COLLATABLE, COLLATION, diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 75298cfc6f..2085a4b858 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -187,7 +187,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b } schparser.setPgSQLVersion(connection.getPgSQLVersion(true)); - attribs[qry_type]=ParsersAttributes::_TRUE_; + attribs[qry_type]=ParsersAttributes::True; if(exclude_sys_objs || list_only_sys_objs) attribs[ParsersAttributes::LAST_SYS_OID]=QString("%1").arg(last_sys_oid); @@ -198,7 +198,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b attribs[ParsersAttributes::OID_FILTER_OP]=QString(">"); if(obj_type==ObjectType::Type && exclude_array_types) - attribs[ParsersAttributes::EXC_BUILTIN_ARRAYS]=ParsersAttributes::_TRUE_; + attribs[ParsersAttributes::EXC_BUILTIN_ARRAYS]=ParsersAttributes::True; //Checking if the custom filter expression is present if(attribs.count(ParsersAttributes::CUSTOM_FILTER)) @@ -515,7 +515,7 @@ QString Catalog::getCommentQuery(const QString &oid_field, bool is_shared_obj) try { attribs_map attribs={{ParsersAttributes::OID, oid_field}, - {ParsersAttributes::SHARED_OBJ, (is_shared_obj ? ParsersAttributes::_TRUE_ : QString())}}; + {ParsersAttributes::SHARED_OBJ, (is_shared_obj ? ParsersAttributes::True : QString())}}; loadCatalogQuery(query_id); return(schparser.getCodeDefinition(attribs).simplified()); @@ -562,7 +562,7 @@ attribs_map Catalog::changeAttributeNames(const attribs_map &attribs) { attr_name.remove(BoolField); if(value==PgSqlFalse) value.clear(); - else value=ParsersAttributes::_TRUE_; + else value=ParsersAttributes::True; } attr_name.replace('_','-'); @@ -678,7 +678,7 @@ attribs_map Catalog::getServerAttributes(void) do { tuple=res.getTupleValues(); - attr_name = tuple[ParsersAttributes::ATTRIBUTE]; + attr_name = tuple[ParsersAttributes::Attribute]; attr_name.replace('_','-'); attribs[attr_name]=tuple[ParsersAttributes::VALUE]; } diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 43db1ddc2f..f41072d0e7 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -26,7 +26,7 @@ Aggregate::Aggregate(void) attributes[ParsersAttributes::TYPES]=QString(); attributes[ParsersAttributes::TRANSITION_FUNC]=QString(); attributes[ParsersAttributes::STATE_TYPE]=QString(); - attributes[ParsersAttributes::BASE_TYPE]=QString(); + attributes[ParsersAttributes::BaseType]=QString(); attributes[ParsersAttributes::FINAL_FUNC]=QString(); attributes[ParsersAttributes::INITIAL_COND]=QString(); attributes[ParsersAttributes::SORT_OP]=QString(); diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index eab3acf5c2..68b1aee4a7 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -76,7 +76,7 @@ bool BaseGraphicObject::isFadedOut(void) void BaseGraphicObject::setFadedOutAttribute(void) { - attributes[ParsersAttributes::FADED_OUT]=(is_faded_out ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::FADED_OUT]=(is_faded_out ? ParsersAttributes::True : QString()); } void BaseGraphicObject::setPositionAttribute(void) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index a5f50371c8..01303134f6 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -83,7 +83,7 @@ BaseObject::BaseObject(void) database=nullptr; collation=nullptr; attributes[ParsersAttributes::NAME]=QString(); - attributes[ParsersAttributes::ALIAS]=QString(); + attributes[ParsersAttributes::Alias]=QString(); attributes[ParsersAttributes::COMMENT]=QString(); attributes[ParsersAttributes::OWNER]=QString(); attributes[ParsersAttributes::TABLESPACE]=QString(); @@ -91,7 +91,7 @@ BaseObject::BaseObject(void) attributes[ParsersAttributes::COLLATION]=QString(); attributes[ParsersAttributes::PROTECTED]=QString(); attributes[ParsersAttributes::SQL_DISABLED]=QString(); - attributes[ParsersAttributes::APPENDED_SQL]=QString(); + attributes[ParsersAttributes::AppendedSql]=QString(); attributes[ParsersAttributes::PREPENDED_SQL]=QString(); attributes[ParsersAttributes::DROP]=QString(); attributes[ParsersAttributes::SIGNATURE]=QString(); @@ -677,8 +677,8 @@ void BaseObject::setBasicAttributes(bool format_name) if(attributes[ParsersAttributes::NAME].isEmpty()) attributes[ParsersAttributes::NAME]=this->getName(format_name); - if(attributes[ParsersAttributes::ALIAS].isEmpty()) - attributes[ParsersAttributes::ALIAS]=this->getAlias(); + if(attributes[ParsersAttributes::Alias].isEmpty()) + attributes[ParsersAttributes::Alias]=this->getAlias(); if(attributes[ParsersAttributes::SIGNATURE].isEmpty()) attributes[ParsersAttributes::SIGNATURE]=this->getSignature(format_name); @@ -706,7 +706,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) bool format=false; schparser.setPgSQLVersion(BaseObject::pgsql_ver); - attributes[ParsersAttributes::SQL_DISABLED]=(sql_disabled ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::SQL_DISABLED]=(sql_disabled ? ParsersAttributes::True : QString()); //Formats the object's name in case the SQL definition is being generated format=((def_type==SchemaParser::SqlDefinition) || @@ -724,7 +724,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) } if(def_type==SchemaParser::XmlDefinition) - attributes[ParsersAttributes::PROTECTED]=(is_protected ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::PROTECTED]=(is_protected ? ParsersAttributes::True : QString()); if(tablespace) { @@ -781,17 +781,17 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(!appended_sql.isEmpty()) { - attributes[ParsersAttributes::APPENDED_SQL]=appended_sql; + attributes[ParsersAttributes::AppendedSql]=appended_sql; if(def_type==SchemaParser::XmlDefinition) { schparser.ignoreUnkownAttributes(true); - attributes[ParsersAttributes::APPENDED_SQL]= - schparser.getCodeDefinition(QString(ParsersAttributes::APPENDED_SQL).remove('-'), attributes, def_type); + attributes[ParsersAttributes::AppendedSql]= + schparser.getCodeDefinition(QString(ParsersAttributes::AppendedSql).remove('-'), attributes, def_type); } else { - attributes[ParsersAttributes::APPENDED_SQL]=QString("\n-- Appended SQL commands --\n") + appended_sql; + attributes[ParsersAttributes::AppendedSql]=QString("\n-- Appended SQL commands --\n") + appended_sql; } } @@ -817,7 +817,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[ParsersAttributes::DROP].remove(ParsersAttributes::DDL_END_TOKEN + '\n'); } - attributes[ParsersAttributes::REDUCED_FORM]=(reduced_form ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::REDUCED_FORM]=(reduced_form ? ParsersAttributes::True : QString()); try { @@ -1127,9 +1127,9 @@ QString BaseObject::getDropDefinition(bool cascade) /* Creating an attribute that identifies the object type in order to permit conditional code generation inside the DROP script */ if(attribs.count(this->getSchemaName())==0) - attribs[this->getSchemaName()]=ParsersAttributes::_TRUE_; + attribs[this->getSchemaName()]=ParsersAttributes::True; - attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::Cascade]=(cascade ? ParsersAttributes::True : QString()); return(schparser.getCodeDefinition(ParsersAttributes::DROP, attribs, SchemaParser::SqlDefinition)); } @@ -1166,7 +1166,7 @@ void BaseObject::copyAttributes(attribs_map &attribs) { if(!attribs.empty()) { - attributes[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::True; for(auto &itr : attribs) attributes[itr.first]=itr.second; } diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 74ff022e66..92c8b928ed 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -100,7 +100,7 @@ void BaseRelationship::configureRelationship(void) attributes[ParsersAttributes::RELATIONSHIP_11]=QString(); attributes[ParsersAttributes::CONSTRAINTS]=QString(); attributes[ParsersAttributes::TABLE]=QString(); - attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); + attributes[ParsersAttributes::AncestorTable]=QString(); attributes[ParsersAttributes::COPY_OPTIONS]=QString(); attributes[ParsersAttributes::COPY_MODE]=QString(); attributes[ParsersAttributes::SRC_COL_PATTERN]=QString(); @@ -334,8 +334,8 @@ void BaseRelationship::setRelationshipAttributes(void) attributes[ParsersAttributes::TYPE]=getRelTypeAttribute(); - attributes[ParsersAttributes::SRC_REQUIRED]=(src_mandatory ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::DST_REQUIRED]=(dst_mandatory ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::SRC_REQUIRED]=(src_mandatory ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::DST_REQUIRED]=(dst_mandatory ? ParsersAttributes::True : QString()); if(src_table) attributes[ParsersAttributes::SRC_TABLE]=src_table->getName(true); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 4e27cce864..6108a2f7e5 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -26,7 +26,7 @@ Cast::Cast(void) is_in_out=false; attributes[ParsersAttributes::SOURCE_TYPE]=QString(); attributes[ParsersAttributes::DEST_TYPE]=QString(); - attributes[ParsersAttributes::CAST_TYPE]=QString(); + attributes[ParsersAttributes::CastType]=QString(); attributes[ParsersAttributes::IO_CAST]=QString(); attributes[ParsersAttributes::FUNCTION]=QString(); } @@ -183,17 +183,17 @@ QString Cast::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::FUNCTION]=cast_function->getCodeDefinition(def_type, true); } else - attributes[ParsersAttributes::IO_CAST]=(is_in_out ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::IO_CAST]=(is_in_out ? ParsersAttributes::True : QString()); if(cast_type==Assignment) - attributes[ParsersAttributes::CAST_TYPE]=ParsersAttributes::ASSIGNMENT; + attributes[ParsersAttributes::CastType]=ParsersAttributes::Assignment; else if(cast_type==Implicit) - attributes[ParsersAttributes::CAST_TYPE]=ParsersAttributes::IMPLICIT; + attributes[ParsersAttributes::CastType]=ParsersAttributes::IMPLICIT; else - attributes[ParsersAttributes::CAST_TYPE]=QString(); + attributes[ParsersAttributes::CastType]=QString(); if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::CAST_TYPE]=attributes[ParsersAttributes::CAST_TYPE].toUpper(); + attributes[ParsersAttributes::CastType]=attributes[ParsersAttributes::CastType].toUpper(); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index 66dbd29a6f..1c11c84ed4 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -23,8 +23,8 @@ Collation::Collation(void) obj_type=ObjectType::Collation; encoding=BaseType::Null; - attributes[ParsersAttributes::_LC_CTYPE_]=QString(); - attributes[ParsersAttributes::_LC_COLLATE_]=QString(); + attributes[ParsersAttributes::LcCtype]=QString(); + attributes[ParsersAttributes::LcCollate]=QString(); attributes[ParsersAttributes::LOCALE]=QString(); attributes[ParsersAttributes::ENCODING]=QString(); } @@ -111,7 +111,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[ParsersAttributes::COLLATION]=collation->getName(true); else { - QString lc_attribs[2]={ ParsersAttributes::_LC_CTYPE_, ParsersAttributes::_LC_COLLATE_ }; + QString lc_attribs[2]={ ParsersAttributes::LcCtype, ParsersAttributes::LcCollate }; if(localization[LcCtype].isEmpty() && localization[LcCollate].isEmpty()) throw Exception(ErrorCode::EmptyLCCollationAttributes,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -134,7 +134,7 @@ QString Collation::getAlterDefinition(BaseObject *object) { try { - attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object); + attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, false)); } catch(Exception &e) diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index d32d26299e..1189f77226 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -33,7 +33,7 @@ Column::Column(void) attributes[ParsersAttributes::MIN_VALUE]=QString(); attributes[ParsersAttributes::MAX_VALUE]=QString(); attributes[ParsersAttributes::START]=QString(); - attributes[ParsersAttributes::CACHE]=QString(); + attributes[ParsersAttributes::Cache]=QString(); attributes[ParsersAttributes::CYCLE]=QString(); parent_rel=sequence=nullptr; @@ -251,8 +251,8 @@ QString Column::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::MIN_VALUE]=seq_min_value; attributes[ParsersAttributes::MAX_VALUE]=seq_max_value; attributes[ParsersAttributes::START]=seq_start; - attributes[ParsersAttributes::CACHE]=seq_cache; - attributes[ParsersAttributes::CYCLE]=(seq_cycle ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::Cache]=seq_cache; + attributes[ParsersAttributes::CYCLE]=(seq_cycle ? ParsersAttributes::True : QString()); } else { @@ -268,8 +268,8 @@ QString Column::getCodeDefinition(unsigned def_type) } } - attributes[ParsersAttributes::NOT_NULL]=(!not_null ? QString() : ParsersAttributes::_TRUE_); - attributes[ParsersAttributes::DECL_IN_TABLE]=(isDeclaredInTable() ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::NOT_NULL]=(!not_null ? QString() : ParsersAttributes::True); + attributes[ParsersAttributes::DECL_IN_TABLE]=(isDeclaredInTable() ? ParsersAttributes::True : QString()); return(BaseObject::__getCodeDefinition(def_type)); } @@ -307,7 +307,7 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[ParsersAttributes::DEFAULT_VALUE]=(def_val.isEmpty() ? ParsersAttributes::UNSET : def_val); if(this->not_null!=col->not_null) - attribs[ParsersAttributes::NOT_NULL]=(!col->not_null ? ParsersAttributes::UNSET : ParsersAttributes::_TRUE_); + attribs[ParsersAttributes::NOT_NULL]=(!col->not_null ? ParsersAttributes::UNSET : ParsersAttributes::True); attribs[ParsersAttributes::NEW_IDENTITY_TYPE] = QString(); @@ -324,7 +324,7 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[ParsersAttributes::MAX_VALUE] = QString(); attribs[ParsersAttributes::START] = QString(); attribs[ParsersAttributes::INCREMENT] = QString(); - attribs[ParsersAttributes::CACHE] = QString(); + attribs[ParsersAttributes::Cache] = QString(); attribs[ParsersAttributes::CYCLE] = QString(); //Checking differences in the underlying sequence (identity col) @@ -356,13 +356,13 @@ QString Column::getAlterDefinition(BaseObject *object) if(!col->seq_cache.isEmpty() && this->seq_cache != col->seq_cache) { - attribs[ParsersAttributes::CACHE] = col->seq_cache; + attribs[ParsersAttributes::Cache] = col->seq_cache; ident_seq_changed = true; } if(this->seq_cycle != col->seq_cycle) { - attribs[ParsersAttributes::CYCLE] = (col->seq_cycle ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + attribs[ParsersAttributes::CYCLE] = (col->seq_cycle ? ParsersAttributes::True : ParsersAttributes::False); ident_seq_changed = true; } diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 9e310553f6..488671b641 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -29,7 +29,7 @@ Constraint::Constraint(void) attributes[ParsersAttributes::PK_CONSTR]=QString(); attributes[ParsersAttributes::FK_CONSTR]=QString(); - attributes[ParsersAttributes::CK_CONSTR]=QString(); + attributes[ParsersAttributes::CkConstr]=QString(); attributes[ParsersAttributes::UQ_CONSTR]=QString(); attributes[ParsersAttributes::EX_CONSTR]=QString(); attributes[ParsersAttributes::REF_TABLE]=QString(); @@ -653,7 +653,7 @@ void Constraint::setDeclInTableAttribute(void) if(!isDeclaredInTable() || (constr_type==ConstraintType::ForeignKey && !isAddedByLinking())) attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); else if(!isReferRelationshipAddedColumn() || constr_type==ConstraintType::PrimaryKey) - attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::True; } QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) @@ -665,14 +665,14 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[ParsersAttributes::PK_CONSTR]=QString(); attributes[ParsersAttributes::FK_CONSTR]=QString(); - attributes[ParsersAttributes::CK_CONSTR]=QString(); + attributes[ParsersAttributes::CkConstr]=QString(); attributes[ParsersAttributes::UQ_CONSTR]=QString(); attributes[ParsersAttributes::EX_CONSTR]=QString(); switch(!constr_type) { case ConstraintType::Check: - attrib=ParsersAttributes::CK_CONSTR; + attrib=ParsersAttributes::CkConstr; break; case ConstraintType::PrimaryKey: attrib=ParsersAttributes::PK_CONSTR; @@ -687,7 +687,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attrib=ParsersAttributes::EX_CONSTR; break; } - attributes[attrib]=ParsersAttributes::_TRUE_; + attributes[attrib]=ParsersAttributes::True; attributes[ParsersAttributes::TYPE]=attrib; attributes[ParsersAttributes::UPD_ACTION]=(~upd_action); @@ -711,8 +711,8 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) } attributes[ParsersAttributes::REF_TABLE]=(ref_table ? ref_table->getName(true) : QString()); - attributes[ParsersAttributes::DEFERRABLE]=(deferrable ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::NO_INHERIT]=(no_inherit ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::DEFERRABLE]=(deferrable ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::NO_INHERIT]=(no_inherit ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::COMPARISON_TYPE]=(~match_type); attributes[ParsersAttributes::DEFER_TYPE]=(~deferral_type); attributes[ParsersAttributes::INDEX_TYPE]=(~ index_type); diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index c267e737cb..ccabc4b64e 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -115,7 +115,7 @@ QString Conversion::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::DEFAULT]=(is_default ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::DEFAULT]=(is_default ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::SRC_ENCODING]=(~encodings[SrcEncoding]); attributes[ParsersAttributes::DST_ENCODING]=(~encodings[DstEncoding]); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 520f22ebfe..8bb2fa9d9a 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -126,7 +126,7 @@ QString Domain::getCodeDefinition(unsigned def_type) attribs_map aux_attribs; - attributes[ParsersAttributes::NOT_NULL]=(not_null ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::NOT_NULL]=(not_null ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::DEFAULT_VALUE]=default_value; for(auto itr : chk_constrs) @@ -180,7 +180,7 @@ QString Domain::getAlterDefinition(BaseObject *object) attributes[ParsersAttributes::DEFAULT_VALUE]=(!domain->default_value.isEmpty() ? domain->default_value : ParsersAttributes::UNSET); if(this->not_null!=domain->not_null) - attributes[ParsersAttributes::NOT_NULL]=(domain->not_null ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attributes[ParsersAttributes::NOT_NULL]=(domain->not_null ? ParsersAttributes::True : ParsersAttributes::UNSET); orig_constrs = this->chk_constrs; aux_constrs = domain->chk_constrs; diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 1f4a9df6b6..6bade2d2e7 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -96,9 +96,9 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) attributes[ParsersAttributes::COLUMN]=QString(); attributes[ParsersAttributes::EXPRESSION]=QString(); attributes[ParsersAttributes::OP_CLASS]=QString(); - attributes[ParsersAttributes::USE_SORTING]=(this->sorting_enabled ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::NULLS_FIRST]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::ASC_ORDER]=(this->sorting_enabled && this->sorting_attibs[AscOrder] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::USE_SORTING]=(this->sorting_enabled ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::NULLS_FIRST]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::AscOrder]=(this->sorting_enabled && this->sorting_attibs[AscOrder] ? ParsersAttributes::True : QString()); if(column) diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 1965516c1b..7574dc9473 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -143,7 +143,7 @@ QString EventTrigger::getAlterDefinition(BaseObject *object) { try { - attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object); + attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, false)); } catch(Exception &e) diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 4c80b54fab..58f4e7c801 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -86,7 +86,7 @@ QString Extension::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); attributes[ParsersAttributes::NAME]=this->getName(def_type==SchemaParser::SqlDefinition, false); - attributes[ParsersAttributes::HANDLES_TYPE]=(handles_type ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::HANDLES_TYPE]=(handles_type ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::CUR_VERSION]=versions[CurVersion]; attributes[ParsersAttributes::OLD_VERSION]=versions[OldVersion]; @@ -102,7 +102,7 @@ QString Extension::getAlterDefinition(BaseObject *object) try { - attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object); + attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); attributes[ParsersAttributes::NEW_VERSION]=QString(); if(!this->versions[CurVersion].isEmpty() && !ext->versions[CurVersion].isEmpty() && diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 28eabd0c38..823756d7a0 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -38,7 +38,7 @@ Function::Function(void) attributes[ParsersAttributes::LANGUAGE]=QString(); attributes[ParsersAttributes::RETURNS_SETOF]=QString(); attributes[ParsersAttributes::SECURITY_TYPE]=QString(); - attributes[ParsersAttributes::BEHAVIOR_TYPE]=QString(); + attributes[ParsersAttributes::BehaviorType]=QString(); attributes[ParsersAttributes::DEFINITION]=QString(); attributes[ParsersAttributes::SIGNATURE]=QString(); attributes[ParsersAttributes::REF_TYPE]=QString(); @@ -477,11 +477,11 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) setTableReturnTypeAttribute(def_type); - attributes[ParsersAttributes::RETURNS_SETOF]=(returns_setof ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::WINDOW_FUNC]=(is_wnd_function ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::LEAKPROOF]=(is_leakproof ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RETURNS_SETOF]=(returns_setof ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::WINDOW_FUNC]=(is_wnd_function ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::LEAKPROOF]=(is_leakproof ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::SECURITY_TYPE]=(~security_type); - attributes[ParsersAttributes::BEHAVIOR_TYPE]=(~behavior_type); + attributes[ParsersAttributes::BehaviorType]=(~behavior_type); attributes[ParsersAttributes::DEFINITION]=source_code; if(language->getName()==~LanguageType(LanguageType::C)) @@ -505,7 +505,7 @@ QString Function::getAlterDefinition(BaseObject *object) { attribs_map attribs; - attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object); + attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); if(this->source_code.simplified()!=func->source_code.simplified() || this->library!=func->library || @@ -521,7 +521,7 @@ QString Function::getAlterDefinition(BaseObject *object) if(this->returns_setof && func->returns_setof && this->row_amount!=func->row_amount) { - attribs[ParsersAttributes::RETURNS_SETOF]=ParsersAttributes::_TRUE_; + attribs[ParsersAttributes::RETURNS_SETOF]=ParsersAttributes::True; attribs[ParsersAttributes::ROW_AMOUNT]=QString::number(row_amount); } @@ -529,7 +529,7 @@ QString Function::getAlterDefinition(BaseObject *object) attribs[ParsersAttributes::FUNCTION_TYPE]=~func->function_type; if(this->is_leakproof!=func->is_leakproof) - attribs[ParsersAttributes::LEAKPROOF]=(func->is_leakproof ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[ParsersAttributes::LEAKPROOF]=(func->is_leakproof ? ParsersAttributes::True : ParsersAttributes::UNSET); if(this->security_type!=func->security_type) attribs[ParsersAttributes::SECURITY_TYPE]=~func->security_type; @@ -538,7 +538,7 @@ QString Function::getAlterDefinition(BaseObject *object) ((this->behavior_type==BehaviorType::CalledOnNullInput) || ((this->behavior_type==BehaviorType::Strict || this->behavior_type==BehaviorType::ReturnsNullOnNullInput) && func->function_type==BehaviorType::CalledOnNullInput))) - attribs[ParsersAttributes::BEHAVIOR_TYPE]=~func->behavior_type; + attribs[ParsersAttributes::BehaviorType]=~func->behavior_type; } copyAttributes(attribs); diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 7bf6c24c10..4aa2da67e1 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -34,11 +34,11 @@ Index::Index(void) attributes[ParsersAttributes::PREDICATE]=QString(); attributes[ParsersAttributes::OP_CLASS]=QString(); attributes[ParsersAttributes::NULLS_FIRST]=QString(); - attributes[ParsersAttributes::ASC_ORDER]=QString(); + attributes[ParsersAttributes::AscOrder]=QString(); attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); attributes[ParsersAttributes::ELEMENTS]=QString(); attributes[ParsersAttributes::FAST_UPDATE]=QString(); - attributes[ParsersAttributes::BUFFERING]=QString(); + attributes[ParsersAttributes::Buffering]=QString(); attributes[ParsersAttributes::STORAGE_PARAMS]=QString(); } @@ -331,8 +331,8 @@ QString Index::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); setIndexElementsAttribute(def_type); - attributes[ParsersAttributes::UNIQUE]=(index_attribs[Unique] ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::CONCURRENT]=(index_attribs[Concurrent] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::UNIQUE]=(index_attribs[Unique] ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::CONCURRENT]=(index_attribs[Concurrent] ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::INDEX_TYPE]=(~indexing_type); attributes[ParsersAttributes::PREDICATE]=predicate; attributes[ParsersAttributes::STORAGE_PARAMS]=QString(); @@ -346,15 +346,15 @@ QString Index::getCodeDefinition(unsigned def_type) } if(this->indexing_type==IndexingType::Gin) - attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::FAST_UPDATE]=(index_attribs[FastUpdate] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::FAST_UPDATE]=(index_attribs[FastUpdate] ? ParsersAttributes::True : QString()); if(this->indexing_type==IndexingType::Gist) - attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::BUFFERING]=(index_attribs[Buffering] ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::Buffering]=(index_attribs[Buffering] ? ParsersAttributes::True : QString()); if(/*this->indexing_type==IndexingType::btree && */fill_factor >= 10) { attributes[ParsersAttributes::FACTOR]=QString("%1").arg(fill_factor); - attributes[ParsersAttributes::STORAGE_PARAMS]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::STORAGE_PARAMS]=ParsersAttributes::True; } else if(def_type==SchemaParser::XmlDefinition) attributes[ParsersAttributes::FACTOR]=QString("0"); @@ -362,7 +362,7 @@ QString Index::getCodeDefinition(unsigned def_type) /* Case the index doesn't referece some column added by relationship it will be declared inside the parent table construction by the use of 'decl-in-table' schema attribute */ if(!isReferRelationshipAddedColumn()) - attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::True; return(BaseObject::__getCodeDefinition(def_type)); } @@ -385,7 +385,7 @@ QString Index::getAlterDefinition(BaseObject *object) try { attribs_map attribs; - attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object); + attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); if(this->indexing_type==index->indexing_type) { @@ -394,11 +394,11 @@ QString Index::getAlterDefinition(BaseObject *object) if(this->indexing_type==IndexingType::Gin && this->index_attribs[FastUpdate] != index->index_attribs[FastUpdate]) - attribs[ParsersAttributes::FAST_UPDATE]=(index->index_attribs[FastUpdate] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[ParsersAttributes::FAST_UPDATE]=(index->index_attribs[FastUpdate] ? ParsersAttributes::True : ParsersAttributes::UNSET); if(this->indexing_type==IndexingType::Gist && this->index_attribs[Buffering] != index->index_attribs[Buffering]) - attribs[ParsersAttributes::BUFFERING]=(index->index_attribs[Buffering] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[ParsersAttributes::Buffering]=(index->index_attribs[Buffering] ? ParsersAttributes::True : ParsersAttributes::UNSET); } copyAttributes(attribs); diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 02103a7e24..41ca39d415 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -120,7 +120,7 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) ParsersAttributes::HANDLER_FUNC, ParsersAttributes::INLINE_FUNC}; - attributes[ParsersAttributes::TRUSTED]=(is_trusted ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::TRUSTED]=(is_trusted ? ParsersAttributes::True : QString()); if(!reduced_form && def_type==SchemaParser::XmlDefinition) reduced_form=(!functions[ValidatorFunc] && !functions[HandlerFunc] && !functions[InlineFunc] && !this->getOwner()); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 44916036e3..ed7a754288 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -330,8 +330,8 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) } } - attributes[ParsersAttributes::HASHES]=(hashes ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::MERGES]=(merges ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::HASHES]=(hashes ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::MERGES]=(merges ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::SIGNATURE]=getSignature(); return(BaseObject::getCodeDefinition(def_type, reduced_form)); diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index 27183ad0f4..4f4f009867 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -173,7 +173,7 @@ QString OperatorClass::getCodeDefinition(unsigned def_type, bool reduced_form) setElementsAttribute(def_type); attributes[ParsersAttributes::INDEX_TYPE]=(~indexing_type); - attributes[ParsersAttributes::DEFAULT]=(is_default ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::DEFAULT]=(is_default ? ParsersAttributes::True : QString()); if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::TYPE]=(*data_type); diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 1de019ccdb..24c54102a3 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -137,7 +137,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) if(element_type==FunctionElem && function && strategy_number > 0) { //FUNCTION support_number [ ( op_type [ , op_type ] ) ] funcname ( argument_type [, ...] ) - attributes[ParsersAttributes::FUNCTION]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::FUNCTION]=ParsersAttributes::True; attributes[ParsersAttributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) @@ -148,7 +148,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) else if(element_type==OperatorElem && _operator && strategy_number > 0) { //OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] [ FOR SEARCH | FOR ORDER BY sort_family_name ] - attributes[ParsersAttributes::OPERATOR]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::OPERATOR]=ParsersAttributes::True; attributes[ParsersAttributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) @@ -167,7 +167,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) else if(element_type==StorageElem && storage!=PgSqlType::Null) { //STORAGE storage_type - attributes[ParsersAttributes::STORAGE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::STORAGE]=ParsersAttributes::True; if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::TYPE]=(*storage); diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 1f2a44c947..defe900a53 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -98,9 +98,9 @@ QString Parameter::getCodeDefinition(unsigned def_type, bool reduced_form) else attributes[ParsersAttributes::NAME]=obj_name; - attributes[ParsersAttributes::PARAM_IN]=(is_in ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::PARAM_OUT]=(is_out ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::PARAM_VARIADIC]=(is_variadic ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::PARAM_IN]=(is_in ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::PARAM_OUT]=(is_out ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::PARAM_VARIADIC]=(is_variadic ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::DEFAULT_VALUE]=default_value; attributes[ParsersAttributes::TYPE]=type.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 1307cb839f..1dd1be1657 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -47,7 +47,7 @@ Permission::Permission(BaseObject *obj) attributes[ParsersAttributes::GRANT_OP]=QString(); attributes[ParsersAttributes::ROLES]=QString(); attributes[ParsersAttributes::PRIVILEGES]=QString(); - attributes[ParsersAttributes::CASCADE]=QString(); + attributes[ParsersAttributes::Cascade]=QString(); attributes[ParsersAttributes::PRIVILEGES_GOP]=QString(); } @@ -420,8 +420,8 @@ QString Permission::getCodeDefinition(unsigned def_type) obj_type=object->getObjectType(); - attributes[ParsersAttributes::REVOKE]=(revoke ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::REVOKE]=(revoke ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::Cascade]=(cascade ? ParsersAttributes::True : QString()); if(def_type==SchemaParser::SqlDefinition) { @@ -447,7 +447,7 @@ QString Permission::getCodeDefinition(unsigned def_type) if(privileges[i] && grant_option[i]) attributes[priv_vect[i]]=ParsersAttributes::GRANT_OP; else if(privileges[i]) - attributes[priv_vect[i]]=ParsersAttributes::_TRUE_; + attributes[priv_vect[i]]=ParsersAttributes::True; else attributes[priv_vect[i]]=QString(); } diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 00056dcd62..e1cfbacea7 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1618,7 +1618,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) } if(with_timezone) - attribs[ParsersAttributes::WITH_TIMEZONE]=ParsersAttributes::_TRUE_; + attribs[ParsersAttributes::WITH_TIMEZONE]=ParsersAttributes::True; return(schparser.getCodeDefinition(ParsersAttributes::PGSQL_BASE_TYPE, attribs, def_type)); } diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index 2a411badcb..4c9c27c63b 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -26,7 +26,7 @@ Policy::Policy(void) : TableObject() attributes[ParsersAttributes::PERMISSIVE] = QString(); attributes[ParsersAttributes::COMMAND] = QString(); attributes[ParsersAttributes::USING_EXP] = QString(); - attributes[ParsersAttributes::CHECK_EXP] = QString(); + attributes[ParsersAttributes::CheckExp] = QString(); attributes[ParsersAttributes::ROLES] = QString(); } @@ -123,9 +123,9 @@ QString Policy::getCodeDefinition(unsigned def_type) for(auto role : roles) rol_names.append(role->getName(true)); - attributes[ParsersAttributes::PERMISSIVE] = (permissive ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::PERMISSIVE] = (permissive ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::USING_EXP] = using_expr; - attributes[ParsersAttributes::CHECK_EXP] = check_expr; + attributes[ParsersAttributes::CheckExp] = check_expr; attributes[ParsersAttributes::ROLES] = rol_names.join(QString(", ")); return(BaseObject::__getCodeDefinition(def_type)); @@ -151,13 +151,13 @@ QString Policy::getAlterDefinition(BaseObject *object) QStringList rol_names, aux_rol_names; attribs_map attribs; - attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object); + attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); if(this->using_expr.simplified() != policy->using_expr.simplified()) attribs[ParsersAttributes::USING_EXP] = policy->using_expr; if(this->check_expr.simplified() != policy->check_expr.simplified()) - attribs[ParsersAttributes::CHECK_EXP] = policy->check_expr; + attribs[ParsersAttributes::CheckExp] = policy->check_expr; for(auto role : this->roles) rol_names.append(role->getName(true)); diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index d5bc2e715b..d6ddf89342 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -228,7 +228,7 @@ QString Reference::getXMLDefinition(void) attribs[ParsersAttributes::REF_ALIAS]=ref_alias; attribs[ParsersAttributes::EXPRESSION]=expression; - attribs[ParsersAttributes::ALIAS]=alias; + attribs[ParsersAttributes::Alias]=alias; attribs[ParsersAttributes::COLUMN_ALIAS]=column_alias; return(schparser.getCodeDefinition(ParsersAttributes::REFERENCE, attribs, SchemaParser::XmlDefinition)); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 5ec8ad0187..d031d6134c 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2561,7 +2561,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) { unsigned count, i; - attributes[ParsersAttributes::RELATIONSHIP_1N]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::RELATIONSHIP_1N]=ParsersAttributes::True; attributes[ParsersAttributes::CONSTRAINTS]=fk_rel1n->getCodeDefinition(def_type); if(uq_rel11) @@ -2581,7 +2581,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) { unsigned count, i; - attributes[ParsersAttributes::RELATIONSHIP_NN]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::RELATIONSHIP_NN]=ParsersAttributes::True; attributes[ParsersAttributes::TABLE]=table_relnn->getCodeDefinition(def_type); count=table_relnn->getConstraintCount(); @@ -2594,7 +2594,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) } else if(rel_type==RelationshipGen) { - attributes[ParsersAttributes::RELATIONSHIP_GEN]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::RELATIONSHIP_GEN]=ParsersAttributes::True; attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); } @@ -2606,17 +2606,17 @@ QString Relationship::getCodeDefinition(unsigned def_type) bool reduced_form; setRelationshipAttributes(); - attributes[ParsersAttributes::IDENTIFIER]=(identifier ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::SINGLE_PK_COLUMN]=(single_pk_column ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::DEFERRABLE]=(deferrable ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::IDENTIFIER]=(identifier ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::SINGLE_PK_COLUMN]=(single_pk_column ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::DEFERRABLE]=(deferrable ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::DEFER_TYPE]=~deferral_type; attributes[ParsersAttributes::UPD_ACTION]=~upd_action; attributes[ParsersAttributes::DEL_ACTION]=~del_action; attributes[ParsersAttributes::TABLE_NAME]=tab_name_relnn; - attributes[ParsersAttributes::RELATIONSHIP_GEN]=(rel_type==RelationshipGen ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RELATIONSHIP_DEP]=(rel_type==RelationshipDep ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RELATIONSHIP_PART]=(rel_type==RelationshipPart ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RELATIONSHIP_GEN]=(rel_type==RelationshipGen ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::RELATIONSHIP_DEP]=(rel_type==RelationshipDep ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::RELATIONSHIP_PART]=(rel_type==RelationshipPart ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::SRC_COL_PATTERN]=name_patterns[SrcColPattern]; attributes[ParsersAttributes::DST_COL_PATTERN]=name_patterns[DstColPattern]; @@ -2711,19 +2711,19 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) return(QString()); attributes[ParsersAttributes::INHERIT]=QString(); - attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); + attributes[ParsersAttributes::AncestorTable]=QString(); attributes[ParsersAttributes::PARTITIONED_TABLE]=QString(); attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); if(rel_type == RelationshipGen) { - attributes[ParsersAttributes::INHERIT]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::_TRUE_); + attributes[ParsersAttributes::INHERIT]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::True); attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); - attributes[ParsersAttributes::ANCESTOR_TABLE]=getReferenceTable()->getName(true); + attributes[ParsersAttributes::AncestorTable]=getReferenceTable()->getName(true); } else { - attributes[ParsersAttributes::PARTITIONING]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::_TRUE_); + attributes[ParsersAttributes::PARTITIONING]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::True); attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); attributes[ParsersAttributes::PARTITIONED_TABLE]=getReferenceTable()->getName(true); attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=getReceiverTable()->getPartitionBoundingExpr(); diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 7a12e6a581..73bfd7ddc9 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -41,10 +41,10 @@ Role::Role(void) attributes[ParsersAttributes::VALIDITY]=QString(); attributes[ParsersAttributes::REF_ROLES]=QString(); attributes[ParsersAttributes::MEMBER_ROLES]=QString(); - attributes[ParsersAttributes::ADMIN_ROLES]=QString(); + attributes[ParsersAttributes::AdminRoles]=QString(); attributes[ParsersAttributes::REPLICATION]=QString(); attributes[ParsersAttributes::GROUP]=QString(); - attributes[ParsersAttributes::BYPASSRLS]=QString(); + attributes[ParsersAttributes::BypassRls]=QString(); } void Role::setOption(unsigned op_type, bool value) @@ -170,7 +170,7 @@ void Role::setRoleAttribute(unsigned role_type) break; case AdminRole: roles_vect=&admin_roles; - attrib=ParsersAttributes::ADMIN_ROLES; + attrib=ParsersAttributes::AdminRoles; break; case RefRole: default: @@ -332,14 +332,14 @@ QString Role::getCodeDefinition(unsigned def_type) QString op_attribs[]={ ParsersAttributes::SUPERUSER, ParsersAttributes::CREATEDB, ParsersAttributes::CREATEROLE, ParsersAttributes::INHERIT, ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, - ParsersAttributes::REPLICATION, ParsersAttributes::BYPASSRLS }; + ParsersAttributes::REPLICATION, ParsersAttributes::BypassRls }; setRoleAttribute(RefRole); setRoleAttribute(MemberRole); setRoleAttribute(AdminRole); for(i=0; i <= OpBypassRls; i++) - attributes[op_attribs[i]]=(options[i] ? ParsersAttributes::_TRUE_ : QString()); + attributes[op_attribs[i]]=(options[i] ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::PASSWORD]=password; attributes[ParsersAttributes::VALIDITY]=validity; @@ -363,9 +363,9 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) QString op_attribs[]={ ParsersAttributes::SUPERUSER, ParsersAttributes::CREATEDB, ParsersAttributes::CREATEROLE, ParsersAttributes::INHERIT, ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, - ParsersAttributes::REPLICATION, ParsersAttributes::BYPASSRLS }; + ParsersAttributes::REPLICATION, ParsersAttributes::BypassRls }; - attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object, ignore_name_diff); + attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object, ignore_name_diff); if(this->password!=role->password) attribs[ParsersAttributes::PASSWORD]=role->password; @@ -377,7 +377,7 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) { if((attribs.count(ParsersAttributes::PASSWORD) && i==OpEncrypted) || this->options[i]!=role->options[i]) - attribs[op_attribs[i]]=(role->options[i] ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[op_attribs[i]]=(role->options[i] ? ParsersAttributes::True : ParsersAttributes::UNSET); } copyAttributes(attribs); diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index 7609a5117d..d3b84a1d66 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -68,7 +68,7 @@ QString Schema::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); attributes[ParsersAttributes::FILL_COLOR]=fill_color.name(); - attributes[ParsersAttributes::RECT_VISIBLE]=(rect_visible ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::RECT_VISIBLE]=(rect_visible ? ParsersAttributes::True : QString()); setFadedOutAttribute(); return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 31a2b00aac..c91d95f317 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -36,7 +36,7 @@ Sequence::Sequence(void) attributes[ParsersAttributes::MIN_VALUE]=QString(); attributes[ParsersAttributes::MAX_VALUE]=QString(); attributes[ParsersAttributes::START]=QString(); - attributes[ParsersAttributes::CACHE]=QString(); + attributes[ParsersAttributes::Cache]=QString(); attributes[ParsersAttributes::CYCLE]=QString(); attributes[ParsersAttributes::OWNER_COLUMN]=QString(); attributes[ParsersAttributes::TABLE]=QString(); @@ -400,14 +400,14 @@ QString Sequence::getCodeDefinition(unsigned def_type) attributes[ParsersAttributes::COLUMN]=(owner_col ? owner_col->getName(true) : QString()); attributes[ParsersAttributes::COL_IS_IDENTITY]= - (owner_col && owner_col->getIdentityType() != BaseType::Null ? ParsersAttributes::_TRUE_ : QString()); + (owner_col && owner_col->getIdentityType() != BaseType::Null ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::INCREMENT]=increment; attributes[ParsersAttributes::MIN_VALUE]=min_value; attributes[ParsersAttributes::MAX_VALUE]=max_value; attributes[ParsersAttributes::START]=start; - attributes[ParsersAttributes::CACHE]=cache; - attributes[ParsersAttributes::CYCLE]=(cycle ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::Cache]=cache; + attributes[ParsersAttributes::CYCLE]=(cycle ? ParsersAttributes::True : QString()); return(BaseObject::__getCodeDefinition(def_type)); } @@ -424,7 +424,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) Table *table=nullptr; attribs_map attribs; - attributes[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object); + attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); if((this->owner_col && !seq->owner_col) || (!this->owner_col && seq->owner_col) || @@ -459,10 +459,10 @@ QString Sequence::getAlterDefinition(BaseObject *object) attribs[ParsersAttributes::START]=seq->start; if(!seq->cache.isEmpty() && this->cache!=seq->cache) - attribs[ParsersAttributes::CACHE]=seq->cache; + attribs[ParsersAttributes::Cache]=seq->cache; if(this->cycle!=seq->cycle) - attribs[ParsersAttributes::CYCLE]=(seq->cycle ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[ParsersAttributes::CYCLE]=(seq->cycle ? ParsersAttributes::True : ParsersAttributes::UNSET); copyAttributes(attribs); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 65d0e3a93b..062771eb64 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -32,7 +32,7 @@ Table::Table(void) : BaseTable() attributes[ParsersAttributes::OIDS]=QString(); attributes[ParsersAttributes::COLS_COMMENT]=QString(); attributes[ParsersAttributes::COPY_TABLE]=QString(); - attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); + attributes[ParsersAttributes::AncestorTable]=QString(); attributes[ParsersAttributes::GEN_ALTER_CMDS]=QString(); attributes[ParsersAttributes::CONSTR_SQL_DISABLED]=QString(); attributes[ParsersAttributes::COL_INDEXES]=QString(); @@ -161,8 +161,8 @@ void Table::setCommentAttribute(TableObject *tab_obj) attribs[ParsersAttributes::SIGNATURE]=tab_obj->getSignature(); attribs[ParsersAttributes::SQL_OBJECT]=tab_obj->getSQLName(); - attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==ObjectType::Column ? ParsersAttributes::_TRUE_ : QString()); - attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==ObjectType::Constraint ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==ObjectType::Column ? ParsersAttributes::True : QString()); + attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==ObjectType::Constraint ? ParsersAttributes::True : QString()); attribs[ParsersAttributes::TABLE]=this->getName(true); attribs[ParsersAttributes::NAME]=tab_obj->getName(true); attribs[ParsersAttributes::COMMENT]=QString(tab_obj->getComment()).replace(QString("'"), QString("''"));; @@ -184,7 +184,7 @@ void Table::setAncestorTableAttribute(void) for(i=0; i < count; i++) list.push_back(ancestor_tables[i]->getName(true)); - attributes[ParsersAttributes::ANCESTOR_TABLE]=list.join(','); + attributes[ParsersAttributes::AncestorTable]=list.join(','); } void Table::setRelObjectsIndexesAttribute(void) @@ -322,7 +322,7 @@ void Table::setConstraintsAttribute(unsigned def_type) str_constr+=lines[i]; } - attributes[ParsersAttributes::CONSTR_SQL_DISABLED]=(dis_sql_cnt==lines.size() ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::CONSTR_SQL_DISABLED]=(dis_sql_cnt==lines.size() ? ParsersAttributes::True : QString()); } } @@ -1593,15 +1593,15 @@ void Table::updateAlterCmdsStatus(void) QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) { QStringList part_keys_code; - attributes[ParsersAttributes::OIDS]=(with_oid ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::UNLOGGED]=(unlogged ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RLS_ENABLED]=(rls_enabled ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RLS_FORCED]=(rls_forced ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::OIDS]=(with_oid ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::UNLOGGED]=(unlogged ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::RLS_ENABLED]=(rls_enabled ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::RLS_FORCED]=(rls_forced ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::COPY_TABLE]=QString(); - attributes[ParsersAttributes::ANCESTOR_TABLE]=QString(); + attributes[ParsersAttributes::AncestorTable]=QString(); attributes[ParsersAttributes::TAG]=QString(); - attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::PARTITIONING]=~partitioning_type; attributes[ParsersAttributes::PARTITION_KEY]=QString(); attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=part_bounding_expr; @@ -1882,23 +1882,23 @@ QString Table::getAlterDefinition(BaseObject *object) attribs_map attribs; attribs[ParsersAttributes::OIDS]=QString(); - attribs[ParsersAttributes::ALTER_CMDS]=BaseObject::getAlterDefinition(object, true); + attribs[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object, true); if(this->getName()==tab->getName()) { - attribs[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::_TRUE_; + attribs[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::True; if(this->with_oid!=tab->with_oid) - attribs[ParsersAttributes::OIDS]=(tab->with_oid ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[ParsersAttributes::OIDS]=(tab->with_oid ? ParsersAttributes::True : ParsersAttributes::UNSET); if(this->unlogged!=tab->unlogged) - attribs[ParsersAttributes::UNLOGGED]=(tab->unlogged ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[ParsersAttributes::UNLOGGED]=(tab->unlogged ? ParsersAttributes::True : ParsersAttributes::UNSET); if(this->rls_enabled!=tab->rls_enabled) - attribs[ParsersAttributes::RLS_ENABLED]=(tab->rls_enabled ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[ParsersAttributes::RLS_ENABLED]=(tab->rls_enabled ? ParsersAttributes::True : ParsersAttributes::UNSET); if(this->rls_forced!=tab->rls_forced) - attribs[ParsersAttributes::RLS_FORCED]=(tab->rls_forced ? ParsersAttributes::_TRUE_ : ParsersAttributes::UNSET); + attribs[ParsersAttributes::RLS_FORCED]=(tab->rls_forced ? ParsersAttributes::True : ParsersAttributes::UNSET); } copyAttributes(attribs); @@ -1917,7 +1917,7 @@ QString Table::getTruncateDefinition(bool cascade) try { BaseObject::setBasicAttributes(true); - attributes[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::Cascade]=(cascade ? ParsersAttributes::True : QString()); return(BaseObject::getAlterDefinition(ParsersAttributes::TRUNCATE_PRIV, attributes, false, false)); } catch(Exception &e) diff --git a/libpgmodeler/src/tableobject.cpp b/libpgmodeler/src/tableobject.cpp index 3c91ca7190..315617ac1c 100644 --- a/libpgmodeler/src/tableobject.cpp +++ b/libpgmodeler/src/tableobject.cpp @@ -116,7 +116,7 @@ QString TableObject::getDropDefinition(bool cascade) if(getParentTable()) attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); - attributes[this->getSchemaName()]=ParsersAttributes::_TRUE_; + attributes[this->getSchemaName()]=ParsersAttributes::True; return(BaseObject::getDropDefinition(cascade)); } diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index 38e55b1c33..bd54f0ce9b 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -24,7 +24,7 @@ Textbox::Textbox(void) font_size=9.0f; text_attributes[0]=text_attributes[1]=text_attributes[2]=false; attributes[ParsersAttributes::ITALIC]=QString(); - attributes[ParsersAttributes::BOLD]=QString(); + attributes[ParsersAttributes::Bold]=QString(); attributes[ParsersAttributes::UNDERLINE]=QString(); attributes[ParsersAttributes::COLOR]=QString(); attributes[ParsersAttributes::FONT_SIZE]=QString(); @@ -43,13 +43,13 @@ QString Textbox::getCodeDefinition(unsigned def_type) setFadedOutAttribute(); if(text_attributes[ItalicText]) - attributes[ParsersAttributes::ITALIC]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::ITALIC]=ParsersAttributes::True; if(text_attributes[BoldText]) - attributes[ParsersAttributes::BOLD]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::Bold]=ParsersAttributes::True; if(text_attributes[UnderlineText]) - attributes[ParsersAttributes::UNDERLINE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::UNDERLINE]=ParsersAttributes::True; if(text_color.name()!=QString("#000000")) attributes[ParsersAttributes::COLOR]=text_color.name(); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 15b3b883b1..4a9340d6d1 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -32,7 +32,7 @@ Trigger::Trigger(void) for(i=0; i < 4; i++) events[tipos[i]]=false; - attributes[ParsersAttributes::ARGUMENTS]=QString(); + attributes[ParsersAttributes::Arguments]=QString(); attributes[ParsersAttributes::EVENTS]=QString(); attributes[ParsersAttributes::TRIGGER_FUNC]=QString(); attributes[ParsersAttributes::TABLE]=QString(); @@ -74,7 +74,7 @@ void Trigger::setArgumentAttribute(unsigned def_type) if(i < (count-1)) str_args+=QString(","); } - attributes[ParsersAttributes::ARGUMENTS]=str_args; + attributes[ParsersAttributes::Arguments]=str_args; } void Trigger::setFiringType(FiringType firing_type) @@ -360,7 +360,7 @@ void Trigger::setBasicAttributes(unsigned def_type) if(events.at(event_types[i])) { str_aux+=sql_event[i]; - attributes[attribs[i]]=ParsersAttributes::_TRUE_; + attributes[attribs[i]]=ParsersAttributes::True; if(event_types[i]==EventType::OnUpdate) { @@ -403,23 +403,23 @@ QString Trigger::getCodeDefinition(unsigned def_type) /* Case the trigger doesn't referece some column added by relationship it will be declared inside the parent table construction by the use of 'decl-in-table' schema attribute */ if(!isReferRelationshipAddedColumn()) - attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::True; if(getParentTable()) attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); - attributes[ParsersAttributes::CONSTRAINT]=(is_constraint ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::CONSTRAINT]=(is_constraint ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::FIRING_TYPE]=(~firing_type); //** Constraint trigger MUST execute per row ** - attributes[ParsersAttributes::PER_ROW]=((is_exec_per_row && !is_constraint) || is_constraint ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::PER_ROW]=((is_exec_per_row && !is_constraint) || is_constraint ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::CONDITION]=condition; if(referenced_table) attributes[ParsersAttributes::REF_TABLE]=referenced_table->getName(true); - attributes[ParsersAttributes::DEFERRABLE]=(is_deferrable ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::DEFERRABLE]=(is_deferrable ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::DEFER_TYPE]=(~deferral_type); if(def_type == SchemaParser::XmlDefinition) diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 701e562162..07ed7bf96c 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -23,7 +23,7 @@ Type::Type(void) obj_type=ObjectType::Type; setConfiguration(EnumerationType); - attributes[ParsersAttributes::BASE_TYPE]=QString(); + attributes[ParsersAttributes::BaseType]=QString(); attributes[ParsersAttributes::COMPOSITE_TYPE]=QString(); attributes[ParsersAttributes::RANGE_TYPE]=QString(); attributes[ParsersAttributes::TYPE_ATTRIBUTE]=QString(); @@ -35,22 +35,22 @@ Type::Type(void) attributes[ParsersAttributes::SEND_FUNC]=QString(); attributes[ParsersAttributes::TPMOD_IN_FUNC]=QString(); attributes[ParsersAttributes::TPMOD_OUT_FUNC]=QString(); - attributes[ParsersAttributes::ANALYZE_FUNC]=QString(); + attributes[ParsersAttributes::AnalyzeFunc]=QString(); attributes[ParsersAttributes::INTERNAL_LENGTH]=QString(); - attributes[ParsersAttributes::BY_VALUE]=QString(); - attributes[ParsersAttributes::ALIGNMENT]=QString(); + attributes[ParsersAttributes::ByValue]=QString(); + attributes[ParsersAttributes::Alignment]=QString(); attributes[ParsersAttributes::STORAGE]=QString(); attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); attributes[ParsersAttributes::ELEMENT]=QString(); attributes[ParsersAttributes::DELIMITER]=QString(); attributes[ParsersAttributes::REDUCED_FORM]=QString(); - attributes[ParsersAttributes::CATEGORY]=QString(); + attributes[ParsersAttributes::Category]=QString(); attributes[ParsersAttributes::PREFERRED]=QString(); attributes[ParsersAttributes::LIKE_TYPE]=QString(); attributes[ParsersAttributes::COLLATABLE]=QString(); attributes[ParsersAttributes::SUBTYPE]=QString(); attributes[ParsersAttributes::SUBTYPE_DIFF_FUNC]=QString(); - attributes[ParsersAttributes::CANONICAL_FUNC]=QString(); + attributes[ParsersAttributes::CanonicalFunc]=QString(); attributes[ParsersAttributes::OP_CLASS]=QString(); } @@ -617,17 +617,17 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) if(config==EnumerationType) { - attributes[ParsersAttributes::ENUM_TYPE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::ENUM_TYPE]=ParsersAttributes::True; setEnumerationsAttribute(def_type); } else if(config==CompositeType) { - attributes[ParsersAttributes::COMPOSITE_TYPE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::COMPOSITE_TYPE]=ParsersAttributes::True; setElementsAttribute(def_type); } else if(config==RangeType) { - attributes[ParsersAttributes::RANGE_TYPE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::RANGE_TYPE]=ParsersAttributes::True; if(def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::SUBTYPE]=(*subtype); @@ -644,15 +644,15 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) } else { - attributes[ParsersAttributes::BASE_TYPE]=ParsersAttributes::_TRUE_; + attributes[ParsersAttributes::BaseType]=ParsersAttributes::True; if(internal_len==0 && def_type==SchemaParser::SqlDefinition) attributes[ParsersAttributes::INTERNAL_LENGTH]=QString("VARIABLE"); else attributes[ParsersAttributes::INTERNAL_LENGTH]=QString("%1").arg(internal_len); - attributes[ParsersAttributes::BY_VALUE]=(by_value ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::ALIGNMENT]=(*alignment); + attributes[ParsersAttributes::ByValue]=(by_value ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::Alignment]=(*alignment); attributes[ParsersAttributes::STORAGE]=(~storage); attributes[ParsersAttributes::DEFAULT_VALUE]=default_value; @@ -662,10 +662,10 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) if(delimiter!='\0') attributes[ParsersAttributes::DELIMITER]=delimiter; - attributes[ParsersAttributes::CATEGORY]=~(category); + attributes[ParsersAttributes::Category]=~(category); - attributes[ParsersAttributes::PREFERRED]=(preferred ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::COLLATABLE]=(collatable ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::PREFERRED]=(preferred ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::COLLATABLE]=(collatable ? ParsersAttributes::True : QString()); if(like_type!=QString("\"any\"")) { @@ -685,8 +685,8 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) ParsersAttributes::SEND_FUNC, ParsersAttributes::TPMOD_IN_FUNC, ParsersAttributes::TPMOD_OUT_FUNC, - ParsersAttributes::ANALYZE_FUNC, - ParsersAttributes::CANONICAL_FUNC, + ParsersAttributes::AnalyzeFunc, + ParsersAttributes::CanonicalFunc, ParsersAttributes::SUBTYPE_DIFF_FUNC}; for(i=0; i < sizeof(functions)/sizeof(Function *); i++) @@ -730,10 +730,10 @@ QString Type::getAlterDefinition(BaseObject *object) { if(std::find(this->enumerations.begin(), this->enumerations.end(), enum_val)==this->enumerations.end()) { - attribs[ParsersAttributes::BEFORE]=QString(); + attribs[ParsersAttributes::Before]=QString(); if(prev_val.isEmpty()) { - attribs[ParsersAttributes::BEFORE]=ParsersAttributes::_TRUE_; + attribs[ParsersAttributes::Before]=ParsersAttributes::True; prev_val=this->enumerations[0]; } @@ -754,8 +754,8 @@ QString Type::getAlterDefinition(BaseObject *object) { if(type->getAttributeIndex(attrib.getName()) < 0) { - attribs[ParsersAttributes::DROP]=ParsersAttributes::_TRUE_; - attribs[ParsersAttributes::ATTRIBUTE]=attrib.getName(true); + attribs[ParsersAttributes::DROP]=ParsersAttributes::True; + attribs[ParsersAttributes::Attribute]=attrib.getName(true); copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); attribs.clear(); @@ -770,7 +770,7 @@ QString Type::getAlterDefinition(BaseObject *object) //Creating type attributes if(attrib_idx < 0) { - attribs[ParsersAttributes::ATTRIBUTE]=attrib.getName(true); + attribs[ParsersAttributes::Attribute]=attrib.getName(true); attribs[ParsersAttributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); attribs[ParsersAttributes::COLLATION]=QString(); @@ -783,17 +783,17 @@ QString Type::getAlterDefinition(BaseObject *object) //Changing type attributes else { - attribs[ParsersAttributes::CHANGE]=ParsersAttributes::_TRUE_; + attribs[ParsersAttributes::Change]=ParsersAttributes::True; if(!type_attribs[attrib_idx].getType().isEquivalentTo(attrib.getType())) { - attribs[ParsersAttributes::ATTRIBUTE]=attrib.getName(true); + attribs[ParsersAttributes::Attribute]=attrib.getName(true); attribs[ParsersAttributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); } copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); - attributes[ParsersAttributes::CHANGE]=QString(); + attributes[ParsersAttributes::Change]=QString(); } attribs.clear(); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 1389e532c0..2db9adaefd 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -574,12 +574,12 @@ QString View::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); attributes[ParsersAttributes::CTE_EXPRESSION]=cte_expression; - attributes[ParsersAttributes::MATERIALIZED]=(materialized ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::RECURSIVE]=(recursive ? ParsersAttributes::_TRUE_ : QString()); - attributes[ParsersAttributes::WITH_NO_DATA]=(with_no_data ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::MATERIALIZED]=(materialized ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::RECURSIVE]=(recursive ? ParsersAttributes::True : QString()); + attributes[ParsersAttributes::WITH_NO_DATA]=(with_no_data ? ParsersAttributes::True : QString()); attributes[ParsersAttributes::COLUMNS]=QString(); attributes[ParsersAttributes::TAG]=QString(); - attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::_TRUE_ : QString()); + attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::True : QString()); setSQLObjectAttribute(); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index eec9e8b85e..1a81a1856f 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -53,7 +53,7 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid ParsersAttributes::VIEW_BODY, //23 ParsersAttributes::VIEW_EXT_BODY, //24 ParsersAttributes::VIEW_TITLE, //25 - ParsersAttributes::ALIAS, //26 + ParsersAttributes::Alias, //26 ParsersAttributes::REF_COLUMN, //27 ParsersAttributes::REF_TABLE, //28 ParsersAttributes::REFERENCE, //29 @@ -73,8 +73,8 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid ParsersAttributes::RELATIONSHIP, //43 ParsersAttributes::LABEL, //44 ParsersAttributes::LABEL, //45 - ParsersAttributes::ATTRIBUTE, //46 - ParsersAttributes::ATTRIBUTE, //47 + ParsersAttributes::Attribute, //46 + ParsersAttributes::Attribute, //47 ParsersAttributes::TAG, //48 ParsersAttributes::TAG, //49 ParsersAttributes::PLACEHOLDER /*50*/}; @@ -291,13 +291,13 @@ void AppearanceConfigWidget::saveConfiguration(void) attribs[attrib_id]=item.font_fmt.foreground().color().name(); attrib_id=item.conf_id + QString("-") + ParsersAttributes::ITALIC; - attribs[attrib_id]=(font.italic() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + attribs[attrib_id]=(font.italic() ? ParsersAttributes::True : ParsersAttributes::False); - attrib_id=item.conf_id + QString("-") + ParsersAttributes::BOLD; - attribs[attrib_id]=(font.bold() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + attrib_id=item.conf_id + QString("-") + ParsersAttributes::Bold; + attribs[attrib_id]=(font.bold() ? ParsersAttributes::True : ParsersAttributes::False); attrib_id=item.conf_id + QString("-") + ParsersAttributes::UNDERLINE; - attribs[attrib_id]=(font.underline() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + attribs[attrib_id]=(font.underline() ? ParsersAttributes::True : ParsersAttributes::False); } //Special case: treating the global font element else diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 9a894176bb..451ce89191 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -202,7 +202,7 @@ void CodeCompletionWidget::configureCompletion(DatabaseModel *db_model, SyntaxHi auto_triggered=false; this->db_model=db_model; - if(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_COMPLETION]==ParsersAttributes::_TRUE_) + if(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeCompletion]==ParsersAttributes::True) { code_field_txt->installEventFilter(this); name_list->installEventFilter(this); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index cbc37f29c6..edd9b0a371 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -111,7 +111,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) Connection *conn=nullptr; destroyConnections(); - key_attribs.push_back(ParsersAttributes::ALIAS); + key_attribs.push_back(ParsersAttributes::Alias); BaseConfigWidget::loadConfiguration(GlobalAttributes::ConnectionsConf, config_params, key_attribs); /*try @@ -134,7 +134,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) { conn=new Connection; - conn->setConnectionParam(Connection::ParamAlias, itr->second[ParsersAttributes::ALIAS]); + conn->setConnectionParam(Connection::ParamAlias, itr->second[ParsersAttributes::Alias]); conn->setConnectionParam(Connection::ParamServerFqdn, itr->second[Connection::ParamServerFqdn]); conn->setConnectionParam(Connection::ParamPort, itr->second[Connection::ParamPort]); conn->setConnectionParam(Connection::ParamUser, itr->second[Connection::ParamUser]); @@ -150,11 +150,11 @@ void ConnectionsConfigWidget::loadConfiguration(void) conn->setConnectionParam(Connection::ParamKerberosServer, itr->second[Connection::ParamKerberosServer]); conn->setConnectionParam(Connection::ParamOthers, itr->second[Connection::ParamOthers]); - conn->setAutoBrowseDB(itr->second[ParsersAttributes::AUTO_BROWSE_DB]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(ParsersAttributes::DIFF)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(ParsersAttributes::EXPORT)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(ParsersAttributes::IMPORT)]==ParsersAttributes::_TRUE_); - conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(ParsersAttributes::VALIDATION)]==ParsersAttributes::_TRUE_); + conn->setAutoBrowseDB(itr->second[ParsersAttributes::AutoBrowseDb]==ParsersAttributes::True); + conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(ParsersAttributes::DIFF)]==ParsersAttributes::True); + conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(ParsersAttributes::EXPORT)]==ParsersAttributes::True); + conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(ParsersAttributes::IMPORT)]==ParsersAttributes::True); + conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(ParsersAttributes::VALIDATION)]==ParsersAttributes::True); connections.push_back(conn); itr++; @@ -504,14 +504,14 @@ void ConnectionsConfigWidget::saveConfiguration(void) if(attribs[Connection::ParamServerFqdn].isEmpty()) attribs[Connection::ParamServerFqdn]=attribs[Connection::ParamServerIp]; - attribs[ParsersAttributes::ALIAS]=attribs[Connection::ParamAlias]; - attribs[ParsersAttributes::AUTO_BROWSE_DB]=(conn->isAutoBrowseDB() ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::Alias]=attribs[Connection::ParamAlias]; + attribs[ParsersAttributes::AutoBrowseDb]=(conn->isAutoBrowseDB() ? ParsersAttributes::True : QString()); attribs[ParsersAttributes::CONNECTION_TIMEOUT]=attribs[Connection::ParamConnTimeout]; - attribs[DefaultFor.arg(ParsersAttributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DefaultFor.arg(ParsersAttributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DefaultFor.arg(ParsersAttributes::DIFF)]=(conn->isDefaultForOperation(Connection::OpDiff) ? ParsersAttributes::_TRUE_ : QString()); - attribs[DefaultFor.arg(ParsersAttributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? ParsersAttributes::_TRUE_ : QString()); + attribs[DefaultFor.arg(ParsersAttributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? ParsersAttributes::True : QString()); + attribs[DefaultFor.arg(ParsersAttributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? ParsersAttributes::True : QString()); + attribs[DefaultFor.arg(ParsersAttributes::DIFF)]=(conn->isDefaultForOperation(Connection::OpDiff) ? ParsersAttributes::True : QString()); + attribs[DefaultFor.arg(ParsersAttributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? ParsersAttributes::True : QString()); schparser.ignoreUnkownAttributes(true); config_params[GlobalAttributes::ConnectionsConf][ParsersAttributes::CONNECTIONS]+= diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index b830d4e59d..c8d4eeb6ab 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -33,11 +33,11 @@ const QString DatabaseExplorerWidget::ElemSeparator=QString("•"); const QString DatabaseExplorerWidget::DefaultSourceCode=QT_TR_NOOP("-- Source code not generated! Hit F7 or middle-click the item to load it. --"); const attribs_map DatabaseExplorerWidget::attribs_i18n { - {ADMIN_ROLES, QT_TR_NOOP("Admin. roles")}, {ALIGNMENT, QT_TR_NOOP("Alignment")}, {ANALYZE_FUNC, QT_TR_NOOP("Analyze func.")}, - {ARG_COUNT, QT_TR_NOOP("Arg. count")}, {ARG_DEF_COUNT, QT_TR_NOOP("Arg. default count")}, {ARG_DEFAULTS, QT_TR_NOOP("Arg. defaults")}, - {ARG_MODES, QT_TR_NOOP("Arg. modes")}, {ARG_NAMES, QT_TR_NOOP("Arg. names")}, {ARG_TYPES, QT_TR_NOOP("Arg. types")}, - {ATTRIBUTE, QT_TR_NOOP("Attribute")}, {BEHAVIOR_TYPE, QT_TR_NOOP("Behavior type")}, {BY_VALUE, QT_TR_NOOP("By value")}, - {CAST_TYPE, QT_TR_NOOP("Cast type")}, {CATEGORY, QT_TR_NOOP("Category")}, {COLLATABLE, QT_TR_NOOP("Collatable")}, + {AdminRoles, QT_TR_NOOP("Admin. roles")}, {Alignment, QT_TR_NOOP("Alignment")}, {AnalyzeFunc, QT_TR_NOOP("Analyze func.")}, + {ArgCount, QT_TR_NOOP("Arg. count")}, {ArgDefCount, QT_TR_NOOP("Arg. default count")}, {ArgDefaults, QT_TR_NOOP("Arg. defaults")}, + {ArgModes, QT_TR_NOOP("Arg. modes")}, {ArgNames, QT_TR_NOOP("Arg. names")}, {ArgTypes, QT_TR_NOOP("Arg. types")}, + {Attribute, QT_TR_NOOP("Attribute")}, {ParsersAttributes::BehaviorType, QT_TR_NOOP("Behavior type")}, {ByValue, QT_TR_NOOP("By value")}, + {CastType, QT_TR_NOOP("Cast type")}, {Category, QT_TR_NOOP("Category")}, {COLLATABLE, QT_TR_NOOP("Collatable")}, {COLLATION, QT_TR_NOOP("Collation")}, {COMMENT, QT_TR_NOOP("Comment")}, {COMMUTATOR_OP, QT_TR_NOOP("Commutator Op.")}, {CONFIGURATION, QT_TR_NOOP("Configuration")}, {CONN_LIMIT, QT_TR_NOOP("Conn. limit")}, {CONSTRAINT, QT_TR_NOOP("Constraint")}, {CREATEDB, QT_TR_NOOP("Create DB")}, {CREATEROLE, QT_TR_NOOP("Create role")}, {CUR_VERSION, QT_TR_NOOP("Curr. version")}, @@ -51,7 +51,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {INDEX_TYPE, QT_TR_NOOP("Index type")}, {INHERIT, QT_TR_NOOP("Inherit")}, {INITIAL_COND, QT_TR_NOOP("Ini. condition")}, {INLINE_FUNC, QT_TR_NOOP("Inline func.")}, {INPUT_FUNC, QT_TR_NOOP("Input func.")}, {INTERNAL_LENGTH, QT_TR_NOOP("Internal length")}, {INTERVAL_TYPE, QT_TR_NOOP("Interval type")}, {IO_CAST, QT_TR_NOOP("I/O cast")}, {JOIN_FUNC, QT_TR_NOOP("Join func.")}, - {LANGUAGE, QT_TR_NOOP("Language")}, {_LC_COLLATE_, QT_TR_NOOP("LC COLLATE")}, {_LC_CTYPE_, QT_TR_NOOP("LC CTYPE")}, + {LANGUAGE, QT_TR_NOOP("Language")}, {LcCollate, QT_TR_NOOP("LC COLLATE")}, {LcCtype, QT_TR_NOOP("LC CTYPE")}, {LEAKPROOF, QT_TR_NOOP("Leak proof")}, {LEFT_TYPE, QT_TR_NOOP("Left type")}, {LENGTH, QT_TR_NOOP("Length")}, {LIBRARY, QT_TR_NOOP("Library")}, {LOGIN, QT_TR_NOOP("Can login")}, {MATERIALIZED, QT_TR_NOOP("Materialized")}, {MEMBER_ROLES, QT_TR_NOOP("Member roles")}, {MERGES, QT_TR_NOOP("Merges")}, {NAME, QT_TR_NOOP("Name")}, @@ -70,14 +70,14 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {TPMOD_OUT_FUNC, QT_TR_NOOP("Type mod. out func.")}, {TRANSITION_FUNC, QT_TR_NOOP("Transition func.")}, {TRUSTED, QT_TR_NOOP("Trusted")}, {TYPE, QT_TR_NOOP("Type")}, {TYPE_ATTRIBUTE, QT_TR_NOOP("Type attribute")}, {TYPES, QT_TR_NOOP("Types")}, {UNLOGGED, QT_TR_NOOP("Unlogged")}, {VALIDATOR, QT_TR_NOOP("Validator func.")}, {VALIDITY, QT_TR_NOOP("Validity")}, - {WINDOW_FUNC, QT_TR_NOOP("Windows func.")}, {_FALSE_, QT_TR_NOOP("false")}, {_TRUE_, QT_TR_NOOP("true")}, - {CACHE, QT_TR_NOOP("Cache value")}, {CYCLE, QT_TR_NOOP("Cycle")}, {INCREMENT, QT_TR_NOOP("Increment")}, + {WINDOW_FUNC, QT_TR_NOOP("Windows func.")}, {False, QT_TR_NOOP("false")}, {True, QT_TR_NOOP("true")}, + {Cache, QT_TR_NOOP("Cache value")}, {CYCLE, QT_TR_NOOP("Cycle")}, {INCREMENT, QT_TR_NOOP("Increment")}, {MAX_VALUE, QT_TR_NOOP("Max. value")}, {MIN_VALUE, QT_TR_NOOP("Min. value")}, {START, QT_TR_NOOP("Start value")}, {LAST_VALUE, QT_TR_NOOP("Last value")}, {SUBTYPE, QT_TR_NOOP("Subtype")}, {OP_CLASS, QT_TR_NOOP("Op. class")}, - {CANONICAL_FUNC, QT_TR_NOOP("Canonical func.")}, {SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {CONSTRAINT, QT_TR_NOOP("Constraint")}, + {CanonicalFunc, QT_TR_NOOP("Canonical func.")}, {SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {CONSTRAINT, QT_TR_NOOP("Constraint")}, {DEFERRABLE, QT_TR_NOOP("Deferrable")}, {PER_ROW, QT_TR_NOOP("For each row")}, {FIRING_TYPE, QT_TR_NOOP("Firing")}, {INS_EVENT, QT_TR_NOOP("On insert")}, {DEL_EVENT, QT_TR_NOOP("On delete")}, {UPD_EVENT, QT_TR_NOOP("On update")}, - {TRUNC_EVENT, QT_TR_NOOP("On truncate")}, {ARGUMENTS, QT_TR_NOOP("Arguments")}, {TABLE, QT_TR_NOOP("Table")}, + {TRUNC_EVENT, QT_TR_NOOP("On truncate")}, {Arguments, QT_TR_NOOP("Arguments")}, {TABLE, QT_TR_NOOP("Table")}, {TRIGGER_FUNC, QT_TR_NOOP("Trigger func.")}, {COLUMNS, QT_TR_NOOP("Columns")}, {CONDITION, QT_TR_NOOP("Condition")}, {DEFER_TYPE, QT_TR_NOOP("Deferment")}, {EVENT_TYPE, QT_TR_NOOP("Event")}, {EXEC_TYPE, QT_TR_NOOP("Execution mode")}, {COMMANDS, QT_TR_NOOP("Commands")}, {POSITION, QT_TR_NOOP("Position")}, {COMPARISON_TYPE, QT_TR_NOOP("Comparison type")}, @@ -86,7 +86,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {OPERATORS, QT_TR_NOOP("Operators")}, {REF_TABLE, QT_TR_NOOP("Ref. table")}, {COLUMNS, QT_TR_NOOP("Columns")}, {UPD_ACTION, QT_TR_NOOP("On update")}, {SRC_COLUMNS, QT_TR_NOOP("Columns")}, {UNIQUE, QT_TR_NOOP("Unique")}, {PREDICATE, QT_TR_NOOP("Predicate")}, {COLLATIONS, QT_TR_NOOP("Collations")}, {INHERITED, QT_TR_NOOP("Inherited")}, - {CLIENT_ENCODING, QT_TR_NOOP("Client encoding")}, {CONFIG_FILE, QT_TR_NOOP("Configuration file")}, {DATA_DIRECTORY, QT_TR_NOOP("Data directory")}, + {ClientEncoding, QT_TR_NOOP("Client encoding")}, {CONFIG_FILE, QT_TR_NOOP("Configuration file")}, {DATA_DIRECTORY, QT_TR_NOOP("Data directory")}, {DYNAMIC_LIBRARY_PATH, QT_TR_NOOP("Dynamic library path")}, {DYNAMIC_SHARED_MEMORY, QT_TR_NOOP("Dynamic shared memory")}, {HBA_FILE, QT_TR_NOOP("Hba file")}, {LISTEN_ADDRESSES, QT_TR_NOOP("Listen addresses")}, {MAX_CONNECTIONS, QT_TR_NOOP("Max. connections")}, {PORT, QT_TR_NOOP("Listen port")}, {SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, {SSL, QT_TR_NOOP("SSL")}, {SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, @@ -94,7 +94,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {SERVER_VERSION, QT_TR_NOOP("Server version")}, {IDENT_FILE, QT_TR_NOOP("Ident file")}, {PASSWORD_ENCRYPTION, QT_TR_NOOP("Password encryption")}, {CONNECTION, QT_TR_NOOP("Connection ID")}, {SERVER_PID, QT_TR_NOOP("Server PID")}, {SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {REFERRERS, QT_TR_NOOP("Referrers")}, {IDENTITY_TYPE, QT_TR_NOOP("Identity")}, {COMMAND, QT_TR_NOOP("Command")}, - {USING_EXP, QT_TR_NOOP("USING expr.")}, {CHECK_EXP, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")}, + {USING_EXP, QT_TR_NOOP("USING expr.")}, {CheckExp, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")}, {RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {RLS_FORCED, QT_TR_NOOP("RLS forced")}, {LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, {LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, {TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {IS_PARTITIONED, QT_TR_NOOP("Partitioned")}, @@ -373,8 +373,8 @@ void DatabaseExplorerWidget::formatBooleanAttribs(attribs_map &attribs, QStringL { for(QString attr : bool_attrs) attribs[attr]=(attribs[attr].isEmpty() ? - attribs_i18n.at(ParsersAttributes::_FALSE_) : - attribs_i18n.at(ParsersAttributes::_TRUE_)); + attribs_i18n.at(ParsersAttributes::False) : + attribs_i18n.at(ParsersAttributes::True)); } void DatabaseExplorerWidget::formatOidAttribs(attribs_map &attribs, QStringList oid_attrs, ObjectType obj_type, bool is_oid_array) @@ -445,7 +445,7 @@ void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) { - formatOidAttribs(attribs, { ParsersAttributes::ADMIN_ROLES, + formatOidAttribs(attribs, { ParsersAttributes::AdminRoles, ParsersAttributes::MEMBER_ROLES, ParsersAttributes::REF_ROLES }, ObjectType::Role, true); @@ -476,14 +476,14 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) { attribs[ParsersAttributes::LANGUAGE]=getObjectName(ObjectType::Language, attribs[ParsersAttributes::LANGUAGE]); attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::RETURN_TYPE]); - attribs[ParsersAttributes::ARG_NAMES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_NAMES]).join(ElemSeparator); - attribs[ParsersAttributes::ARG_MODES]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_MODES]).join(ElemSeparator); - attribs[ParsersAttributes::ARG_DEFAULTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_DEFAULTS]).join(ElemSeparator); + attribs[ParsersAttributes::ArgNames]=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgNames]).join(ElemSeparator); + attribs[ParsersAttributes::ArgModes]=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgModes]).join(ElemSeparator); + attribs[ParsersAttributes::ArgDefaults]=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgDefaults]).join(ElemSeparator); - formatOidAttribs(attribs, { ParsersAttributes::ARG_TYPES }, ObjectType::Type, true); + formatOidAttribs(attribs, { ParsersAttributes::ArgTypes }, ObjectType::Type, true); attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) - .arg(attribs[ParsersAttributes::ARG_TYPES])).replace(ElemSeparator, QString(",")); + .arg(attribs[ParsersAttributes::ArgTypes])).replace(ElemSeparator, QString(",")); formatBooleanAttribs(attribs, { ParsersAttributes::WINDOW_FUNC, ParsersAttributes::LEAKPROOF, @@ -541,13 +541,13 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) { QStringList owner_col, - seq_values=Catalog::parseArrayValues(attribs[ParsersAttributes::ATTRIBUTE]), + seq_values=Catalog::parseArrayValues(attribs[ParsersAttributes::Attribute]), seq_attrs={ ParsersAttributes::START, ParsersAttributes::MIN_VALUE, ParsersAttributes::MAX_VALUE, ParsersAttributes::INCREMENT, - ParsersAttributes::CACHE, ParsersAttributes::CYCLE }; + ParsersAttributes::Cache, ParsersAttributes::CYCLE }; QString sch_name=getObjectName(ObjectType::Schema, attribs[ParsersAttributes::SCHEMA]); - attribs.erase(ParsersAttributes::ATTRIBUTE); + attribs.erase(ParsersAttributes::Attribute); for(int i=0; i < seq_values.size(); i++) attribs[seq_attrs[i]]=seq_values[i]; @@ -593,10 +593,10 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) QStringList range_attr=Catalog::parseArrayValues(attribs[ParsersAttributes::RANGE_ATTRIBS]), type_attr=Catalog::parseArrayValues(attribs[ParsersAttributes::TYPE_ATTRIBUTE]); - formatBooleanAttribs(attribs, { ParsersAttributes::BY_VALUE, + formatBooleanAttribs(attribs, { ParsersAttributes::ByValue, ParsersAttributes::COLLATABLE, ParsersAttributes::PREFERRED }); - formatOidAttribs(attribs, { ParsersAttributes::ANALYZE_FUNC, + formatOidAttribs(attribs, { ParsersAttributes::AnalyzeFunc, ParsersAttributes::INPUT_FUNC, ParsersAttributes::OUTPUT_FUNC, ParsersAttributes::RECV_FUNC, @@ -616,7 +616,7 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) attribs[ParsersAttributes::SUBTYPE]=getObjectName(ObjectType::Type, range_attr[0]); attribs[ParsersAttributes::COLLATION]=getObjectName(ObjectType::Collation, range_attr[1]); attribs[ParsersAttributes::OP_CLASS]=getObjectName(ObjectType::OpClass, range_attr[2]); - attribs[ParsersAttributes::CANONICAL_FUNC]=getObjectName(ObjectType::Function, range_attr[3]); + attribs[ParsersAttributes::CanonicalFunc]=getObjectName(ObjectType::Function, range_attr[3]); attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjectType::Function, range_attr[4]); } @@ -689,7 +689,7 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) ParsersAttributes::TRUNC_EVENT }); attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::TRIGGER_FUNC]); - attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS]).join(ElemSeparator); + attribs[ParsersAttributes::Arguments]=Catalog::parseArrayValues(attribs[ParsersAttributes::Arguments]).join(ElemSeparator); attribs[ParsersAttributes::COLUMNS]=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]).join(ElemSeparator); } @@ -712,7 +712,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) map types={{ParsersAttributes::PK_CONSTR, ConstraintType(ConstraintType::PrimaryKey)}, {ParsersAttributes::FK_CONSTR, ConstraintType(ConstraintType::ForeignKey)}, {ParsersAttributes::UQ_CONSTR, ConstraintType(ConstraintType::Unique)}, - {ParsersAttributes::CK_CONSTR, ConstraintType(ConstraintType::Check)}, + {ParsersAttributes::CkConstr, ConstraintType(ConstraintType::Check)}, {ParsersAttributes::EX_CONSTR, ConstraintType(ConstraintType::Exclude)}}; ConstraintType constr_type=types[attribs[ParsersAttributes::TYPE]]; @@ -827,7 +827,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) //Formatting paramenter types for function if(obj_type==ObjectType::Function) { - QStringList names, arg_types=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_TYPES]); + QStringList names, arg_types=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgTypes]); for(int idx=0; idx < arg_types.size(); idx++) { @@ -1134,7 +1134,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); attribs[ParsersAttributes::DECL_IN_TABLE]=QString(); - attribs[BaseObject::getSchemaName(obj_type)]=ParsersAttributes::_TRUE_; + attribs[BaseObject::getSchemaName(obj_type)]=ParsersAttributes::True; //For cast, operator and function is needed to extract the name and the params types if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function || obj_type==ObjectType::Cast) @@ -1177,7 +1177,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); - if(aux_attribs[ParsersAttributes::MATERIALIZED] == ParsersAttributes::_TRUE_) + if(aux_attribs[ParsersAttributes::MATERIALIZED] == ParsersAttributes::True) { attribs[ParsersAttributes::SQL_OBJECT] = QString("%1 %2").arg(ParsersAttributes::MATERIALIZED.toUpper()) @@ -1296,8 +1296,8 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(ObjectType::Table); attribs[ParsersAttributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); - attribs[ParsersAttributes::CASCADE]=(cascade ? ParsersAttributes::_TRUE_ : ""); - attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::_TRUE_ : ""); + attribs[ParsersAttributes::Cascade]=(cascade ? ParsersAttributes::True : ""); + attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::True : ""); //Generate the truncate command schparser.ignoreEmptyAttributes(true); @@ -1802,7 +1802,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) //Currently pgModeler does not support the visualization of base types and built-in ones if(obj_type==ObjectType::Type && - (oid <= sys_oid || attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BASE_TYPE)) + (oid <= sys_oid || attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BaseType)) { source=trUtf8("-- Source code genaration for buil-in and base types currently unavailable --"); emit s_sourceCodeShowRequested(source); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 97c688e856..b5f2ed4e07 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -748,7 +748,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe { QTreeWidgetItem *group=nullptr, *item=nullptr; QFont grp_fnt=tree_wgt->font(); - attribs_map extra_attribs={{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}; + attribs_map extra_attribs={{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::True}}; QString tooltip=QString("OID: %1"), name, label; bool child_checked=false; vector objects_vect; diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 551574aa2f..2b45c7eb16 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -420,9 +420,9 @@ void DatabaseImportHelper::createConstraints(void) try { //Check constraints are created only if they are not inherited, other types are created normally - if(attribs[ParsersAttributes::TYPE]!=ParsersAttributes::CK_CONSTR || - (attribs[ParsersAttributes::TYPE]==ParsersAttributes::CK_CONSTR && - attribs[ParsersAttributes::INHERITED]!=ParsersAttributes::_TRUE_)) + if(attribs[ParsersAttributes::TYPE]!=ParsersAttributes::CkConstr || + (attribs[ParsersAttributes::TYPE]==ParsersAttributes::CkConstr && + attribs[ParsersAttributes::INHERITED]!=ParsersAttributes::True)) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2)...") @@ -680,7 +680,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) attribs[ParsersAttributes::DECL_IN_TABLE]=QString(); //System objects will have the sql disabled by default - attribs[ParsersAttributes::SQL_DISABLED]=(catalog.isSystemObject(oid) || catalog.isExtensionObject(oid) ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::SQL_DISABLED]=(catalog.isSystemObject(oid) || catalog.isExtensionObject(oid) ? ParsersAttributes::True : QString()); attribs[ParsersAttributes::COMMENT]=getComment(attribs); if(attribs.count(ParsersAttributes::OWNER)) @@ -832,7 +832,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType if(generate_xml) { - obj_attr[ParsersAttributes::REDUCED_FORM]=ParsersAttributes::_TRUE_; + obj_attr[ParsersAttributes::REDUCED_FORM]=ParsersAttributes::True; schparser.ignoreUnkownAttributes(true); xml_def=schparser.getCodeDefinition(BaseObject::getSchemaName(obj_type), obj_attr, SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); @@ -969,7 +969,7 @@ void DatabaseImportHelper::createRole(attribs_map &attribs) try { QString role_types[]={ ParsersAttributes::REF_ROLES, - ParsersAttributes::ADMIN_ROLES, + ParsersAttributes::AdminRoles, ParsersAttributes::MEMBER_ROLES }; for(unsigned i=0; i < 3; i++) @@ -1059,10 +1059,10 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) try { - param_types=getTypes(attribs[ParsersAttributes::ARG_TYPES], false); - param_names=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_NAMES]); - param_modes=Catalog::parseArrayValues(attribs[ParsersAttributes::ARG_MODES]); - param_def_vals=Catalog::parseDefaultValues(attribs[ParsersAttributes::ARG_DEFAULTS]); + param_types=getTypes(attribs[ParsersAttributes::ArgTypes], false); + param_names=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgNames]); + param_modes=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgModes]); + param_def_vals=Catalog::parseDefaultValues(attribs[ParsersAttributes::ArgDefaults]); for(int i=0; i < param_types.size(); i++) { @@ -1071,7 +1071,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) if(i==0 && (attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::SEND_FUNC || attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::OUTPUT_FUNC || - attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CANONICAL_FUNC)) + attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CanonicalFunc)) type=PgSqlType(QString("\"any\"")); else { @@ -1157,7 +1157,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) the return type will be renamed to "any" (see rules on Type::setFunction()) */ if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::INPUT_FUNC || attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::RECV_FUNC || - attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CANONICAL_FUNC) + attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CanonicalFunc) attribs[ParsersAttributes::RETURN_TYPE]=PgSqlType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); else attribs[ParsersAttributes::RETURN_TYPE]=getType(attribs[ParsersAttributes::RETURN_TYPE], true); @@ -1246,14 +1246,14 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) //Generating attributes for STORAGE elements if(attribs[ParsersAttributes::STORAGE]!=QString("0")) { - elem_attr[ParsersAttributes::STORAGE]=ParsersAttributes::_TRUE_; + elem_attr[ParsersAttributes::STORAGE]=ParsersAttributes::True; elem_attr[ParsersAttributes::DEFINITION]=getType(attribs[ParsersAttributes::STORAGE], true); elems.push_back(elem_attr); } else if(attribs[ParsersAttributes::FUNCTION].isEmpty() && attribs[ParsersAttributes::OPERATOR].isEmpty()) { - elem_attr[ParsersAttributes::STORAGE]=ParsersAttributes::_TRUE_; + elem_attr[ParsersAttributes::STORAGE]=ParsersAttributes::True; elem_attr[ParsersAttributes::DEFINITION]=attribs[ParsersAttributes::TYPE]; elems.push_back(elem_attr); } @@ -1262,7 +1262,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) if(!attribs[ParsersAttributes::FUNCTION].isEmpty()) { elem_attr.clear(); - elem_attr[ParsersAttributes::FUNCTION]=ParsersAttributes::_TRUE_; + elem_attr[ParsersAttributes::FUNCTION]=ParsersAttributes::True; array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::FUNCTION]); for(int i=0; i < array_vals.size(); i++) @@ -1278,7 +1278,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) if(!attribs[ParsersAttributes::OPERATOR].isEmpty()) { elem_attr.clear(); - elem_attr[ParsersAttributes::OPERATOR]=ParsersAttributes::_TRUE_; + elem_attr[ParsersAttributes::OPERATOR]=ParsersAttributes::True; array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATOR]); for(int i=0; i < array_vals.size(); i++) @@ -1437,10 +1437,10 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) try { QStringList owner_col=attribs[ParsersAttributes::OWNER_COLUMN].split(':'), - seq_attribs=Catalog::parseArrayValues(attribs[ParsersAttributes::ATTRIBUTE]); + seq_attribs=Catalog::parseArrayValues(attribs[ParsersAttributes::Attribute]); QString attr[]={ ParsersAttributes::START, ParsersAttributes::MIN_VALUE, ParsersAttributes::MAX_VALUE, ParsersAttributes::INCREMENT, - ParsersAttributes::CACHE, ParsersAttributes::CYCLE }; + ParsersAttributes::Cache, ParsersAttributes::CYCLE }; attribs[ParsersAttributes::OWNER_COLUMN]=QString(); @@ -1547,7 +1547,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) try { - attribs[attribs[ParsersAttributes::CONFIGURATION]]=ParsersAttributes::_TRUE_; + attribs[attribs[ParsersAttributes::CONFIGURATION]]=ParsersAttributes::True; if(!attribs[ParsersAttributes::ENUM_TYPE].isEmpty()) { @@ -1582,7 +1582,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) attribs[ParsersAttributes::SUBTYPE]=getType(range_attr[0], true); attribs[ParsersAttributes::COLLATION]=getDependencyObject(range_attr[1], ObjectType::Collation, true); attribs[ParsersAttributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjectType::OpClass, true); - attribs[ParsersAttributes::CANONICAL_FUNC]=getDependencyObject(range_attr[3], ObjectType::Function, true); + attribs[ParsersAttributes::CanonicalFunc]=getDependencyObject(range_attr[3], ObjectType::Function, true); attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjectType::Function, true); } else @@ -1594,7 +1594,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) ParsersAttributes::SEND_FUNC, ParsersAttributes::TPMOD_IN_FUNC, ParsersAttributes::TPMOD_OUT_FUNC, - ParsersAttributes::ANALYZE_FUNC }; + ParsersAttributes::AnalyzeFunc }; unsigned i, count=sizeof(func_types)/sizeof(QString); attribs[ParsersAttributes::ELEMENT]=getType(attribs[ParsersAttributes::ELEMENT], false); @@ -1669,7 +1669,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) !itr->second.at(ParsersAttributes::PERMISSION).isEmpty()) col_perms[tab_oid].push_back(itr->second[ParsersAttributes::OID].toUInt()); - if(itr->second[ParsersAttributes::INHERITED]==ParsersAttributes::_TRUE_) + if(itr->second[ParsersAttributes::INHERITED]==ParsersAttributes::True) inh_cols.push_back(col_idx); col.setName(itr->second[ParsersAttributes::NAME]); @@ -1685,7 +1685,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) type_name=BaseObject::formatName(getObjectName(types[type_oid][ParsersAttributes::SCHEMA], true), false); type_name+=QString("."); - if(types[type_oid][ParsersAttributes::CATEGORY] == ~CategoryType(CategoryType::Array)) + if(types[type_oid][ParsersAttributes::Category] == ~CategoryType(CategoryType::Array)) { int dim = types[type_oid][ParsersAttributes::NAME].count(QString("[]")); QString aux_name = types[type_oid][ParsersAttributes::NAME].remove(QString("[]")); @@ -1797,7 +1797,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) } // Creating partition keys if present - if(attribs[ParsersAttributes::IS_PARTITIONED] == ParsersAttributes::_TRUE_) + if(attribs[ParsersAttributes::IS_PARTITIONED] == ParsersAttributes::True) { QStringList cols, collations, opclasses, exprs; PartitionKey part_key; @@ -1943,7 +1943,7 @@ void DatabaseImportHelper::createTrigger(attribs_map &attribs) attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); attribs[ParsersAttributes::TRIGGER_FUNC]=getDependencyObject(attribs[ParsersAttributes::TRIGGER_FUNC], ObjectType::Function, true, true); - attribs[ParsersAttributes::ARGUMENTS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ARGUMENTS].remove(QString(",\"\""))).join(','); + attribs[ParsersAttributes::Arguments]=Catalog::parseArrayValues(attribs[ParsersAttributes::Arguments].remove(QString(",\"\""))).join(','); loadObjectXML(ObjectType::Trigger, attribs); dbmodel->createTrigger(); @@ -2105,7 +2105,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) if(!factor.isEmpty() && factor[0].startsWith(QString("fillfactor="))) attribs[ParsersAttributes::FACTOR]=factor[0].remove(QString("fillfactor=")); - attribs[attribs[ParsersAttributes::TYPE]]=ParsersAttributes::_TRUE_; + attribs[attribs[ParsersAttributes::TYPE]]=ParsersAttributes::True; table=dynamic_cast
(dbmodel->getObject(tab_name, ObjectType::Table)); if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::EX_CONSTR) @@ -2560,7 +2560,7 @@ void DatabaseImportHelper::configureDatabase(attribs_map &attribs) { try { - attribs[ParsersAttributes::APPEND_AT_EOD]=QString(); + attribs[ParsersAttributes::AppendAtEod]=QString(); loadObjectXML(ObjectType::Database, attribs); dbmodel->configureDatabase(attribs); } @@ -2609,8 +2609,8 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f if(obj_type==ObjectType::Function) { - QStringList arg_types=getTypes(obj_attr[ParsersAttributes::ARG_TYPES], false), - arg_modes=Catalog::parseArrayValues(obj_attr[ParsersAttributes::ARG_MODES]); + QStringList arg_types=getTypes(obj_attr[ParsersAttributes::ArgTypes], false), + arg_modes=Catalog::parseArrayValues(obj_attr[ParsersAttributes::ArgModes]); for(int i=0; i < arg_types.size(); i++) { @@ -2730,7 +2730,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, type_attr=types[type_oid]; //Special treatment for array types. Removes the [] descriptor when generating XML code for the type - if(!type_attr.empty() && type_attr[ParsersAttributes::CATEGORY]==QString("A") && + if(!type_attr.empty() && type_attr[ParsersAttributes::Category]==QString("A") && type_attr[ParsersAttributes::NAME].contains(QString("[]"))) { obj_name=type_attr[ParsersAttributes::NAME]; @@ -2788,7 +2788,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, type_oid > catalog.getLastSysObjectOID() && !dbmodel->getType(aux_name)) { //If the type is not an array one we simply use the current type attributes map - if(type_attr[ParsersAttributes::CATEGORY] != QString("A")) + if(type_attr[ParsersAttributes::Category] != QString("A")) createObject(type_attr); /* In case the type is an array one we should use the oid held by "element" attribute to create the type related to current one */ diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 3a756de6fc..e7e421a712 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -94,12 +94,12 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::GRID_SIZE]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AUTOSAVE_INTERVAL]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AutoSaveInterval]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_TYPE]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_MARGIN]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_CUSTOM_SIZE]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::File]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]=QString(); @@ -107,18 +107,18 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_EXT_ATTRIBS]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_TABLE_TAGS]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::FILE_ASSOCIATED]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT_SIZE]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CANVAS_CORNER_MOVE]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CanvasCornerMove]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::INVERT_RANGESEL_TRIGGER]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CHECK_UPDATE]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CheckUpdate]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_LAST_POSITION]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_MAIN_MENU]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISABLE_SMOOTHNESS]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SIMPLIFIED_OBJ_CREATION]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CONFIRM_VALIDATION]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_MAIN_MENU]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_COMPLETION]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeCompletion]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISPLAY_LINE_NUMBERS]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_COLOR]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_BG_COLOR]=QString(); @@ -275,8 +275,8 @@ void GeneralConfigWidget::loadConfiguration(void) oplist_size_spb->setValue((config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]).toUInt()); history_max_length_spb->setValue(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HISTORY_MAX_LENGTH].toUInt()); - interv=(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AUTOSAVE_INTERVAL]).toUInt(); - tab_width=(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_TAB_WIDTH]).toInt(); + interv=(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AutoSaveInterval]).toUInt(); + tab_width=(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeTabWidth]).toInt(); autosave_interv_chk->setChecked(interv > 0); autosave_interv_spb->setValue(interv); @@ -286,19 +286,19 @@ void GeneralConfigWidget::loadConfiguration(void) tab_width_spb->setEnabled(tab_width_chk->isChecked()); tab_width_spb->setValue(tab_width); - corner_move_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CANVAS_CORNER_MOVE]==ParsersAttributes::_TRUE_); - invert_rangesel_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::INVERT_RANGESEL_TRIGGER]==ParsersAttributes::_TRUE_); - check_upd_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CHECK_UPDATE]==ParsersAttributes::_TRUE_); - save_last_pos_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_LAST_POSITION]==ParsersAttributes::_TRUE_); - disable_smooth_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISABLE_SMOOTHNESS]==ParsersAttributes::_TRUE_); - simple_obj_creation_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SIMPLIFIED_OBJ_CREATION]==ParsersAttributes::_TRUE_); - confirm_validation_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CONFIRM_VALIDATION]==ParsersAttributes::_TRUE_); - code_completion_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_COMPLETION]==ParsersAttributes::_TRUE_); - use_placeholders_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]==ParsersAttributes::_TRUE_); - use_curved_lines_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]==ParsersAttributes::_TRUE_); + corner_move_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CanvasCornerMove]==ParsersAttributes::True); + invert_rangesel_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::INVERT_RANGESEL_TRIGGER]==ParsersAttributes::True); + check_upd_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CheckUpdate]==ParsersAttributes::True); + save_last_pos_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_LAST_POSITION]==ParsersAttributes::True); + disable_smooth_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISABLE_SMOOTHNESS]==ParsersAttributes::True); + simple_obj_creation_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SIMPLIFIED_OBJ_CREATION]==ParsersAttributes::True); + confirm_validation_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CONFIRM_VALIDATION]==ParsersAttributes::True); + code_completion_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeCompletion]==ParsersAttributes::True); + use_placeholders_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]==ParsersAttributes::True); + use_curved_lines_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]==ParsersAttributes::True); - print_grid_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]==ParsersAttributes::_TRUE_); - print_pg_num_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]==ParsersAttributes::_TRUE_); + print_grid_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]==ParsersAttributes::True); + print_pg_num_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]==ParsersAttributes::True); paper_cmb->setCurrentIndex((config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_TYPE]).toUInt()); portrait_rb->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]==ParsersAttributes::PORTRAIT); @@ -317,14 +317,14 @@ void GeneralConfigWidget::loadConfiguration(void) width_spb->setValue((custom_size.count() >= 2 ? custom_size[0].toDouble() : 500)); height_spb->setValue((custom_size.count() >= 2 ? custom_size[1].toDouble() : 500)); - hide_ext_attribs_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::_TRUE_); - hide_rel_name_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_REL_NAME]==ParsersAttributes::_TRUE_); - hide_table_tags_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_TABLE_TAGS]==ParsersAttributes::_TRUE_); + hide_ext_attribs_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::True); + hide_rel_name_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_REL_NAME]==ParsersAttributes::True); + hide_table_tags_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_TABLE_TAGS]==ParsersAttributes::True); - font_cmb->setCurrentFont(QFont(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT])); - font_size_spb->setValue(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT_SIZE].toDouble()); - disp_line_numbers_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISPLAY_LINE_NUMBERS]==ParsersAttributes::_TRUE_); - hightlight_lines_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIGHLIGHT_LINES]==ParsersAttributes::_TRUE_); + font_cmb->setCurrentFont(QFont(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont])); + font_size_spb->setValue(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize].toDouble()); + disp_line_numbers_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISPLAY_LINE_NUMBERS]==ParsersAttributes::True); + hightlight_lines_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIGHLIGHT_LINES]==ParsersAttributes::True); line_numbers_cp->setColor(0, config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_COLOR]); line_numbers_bg_cp->setColor(0, config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_BG_COLOR]); line_highlight_cp->setColor(0, config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_HIGHLIGHT_COLOR]); @@ -332,7 +332,7 @@ void GeneralConfigWidget::loadConfiguration(void) source_editor_edt->setText(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_APP]); source_editor_args_edt->setText(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_ARGS]); - save_restore_geometry_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]==ParsersAttributes::_TRUE_); + save_restore_geometry_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]==ParsersAttributes::True); reset_sizes_tb->setEnabled(save_restore_geometry_chk->isChecked()); int ui_idx = ui_language_cmb->findData(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]); @@ -351,7 +351,7 @@ void GeneralConfigWidget::loadConfiguration(void) w = itr.second[ParsersAttributes::WIDTH].toInt(); h = itr.second[ParsersAttributes::HEIGHT].toInt(); widgets_geom[itr.first].geometry = QRect(QPoint(x,y), QSize(w, h)); - widgets_geom[itr.first].maximized = itr.second[ParsersAttributes::MAXIMIZED] == ParsersAttributes::_TRUE_; + widgets_geom[itr.first].maximized = itr.second[ParsersAttributes::MAXIMIZED] == ParsersAttributes::True; } } @@ -406,7 +406,7 @@ QString GeneralConfigWidget::getConfigurationParam(const QString §ion_id, co void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { if(!widget || - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::True) return; QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; @@ -418,7 +418,7 @@ void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &cus bool GeneralConfigWidget::restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { if(!widget || - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::_TRUE_) + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::True) return(false); QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; @@ -457,7 +457,7 @@ void GeneralConfigWidget::saveConfiguration(void) file_sch=root_dir + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - ParsersAttributes::_FILE_ + + ParsersAttributes::File + GlobalAttributes::SchemaExt; widget_sch=root_dir + @@ -468,27 +468,27 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::GRID_SIZE]=QString::number(grid_size_spb->value()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]=QString::number(oplist_size_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AUTOSAVE_INTERVAL]=QString::number(autosave_interv_chk->isChecked() ? autosave_interv_spb->value() : 0); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AutoSaveInterval]=QString::number(autosave_interv_chk->isChecked() ? autosave_interv_spb->value() : 0); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_TYPE]=QString::number(paper_cmb->currentIndex()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]=(portrait_rb->isChecked() ? ParsersAttributes::PORTRAIT : ParsersAttributes::LANDSCAPE); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CANVAS_CORNER_MOVE]=(corner_move_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::INVERT_RANGESEL_TRIGGER]=(invert_rangesel_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CHECK_UPDATE]=(check_upd_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_LAST_POSITION]=(save_last_pos_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISABLE_SMOOTHNESS]=(disable_smooth_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SIMPLIFIED_OBJ_CREATION]=(simple_obj_creation_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CONFIRM_VALIDATION]=(confirm_validation_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_COMPLETION]=(code_completion_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_TAB_WIDTH]=QString::number(tab_width_chk->isChecked() ? tab_width_spb->value() : 0); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CanvasCornerMove]=(corner_move_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::INVERT_RANGESEL_TRIGGER]=(invert_rangesel_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CheckUpdate]=(check_upd_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_LAST_POSITION]=(save_last_pos_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISABLE_SMOOTHNESS]=(disable_smooth_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SIMPLIFIED_OBJ_CREATION]=(simple_obj_creation_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CONFIRM_VALIDATION]=(confirm_validation_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeCompletion]=(code_completion_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeTabWidth]=QString::number(tab_width_chk->isChecked() ? tab_width_spb->value() : 0); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MIN_OBJECT_OPACITY]=QString::number(min_obj_opacity_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? ParsersAttributes::True : QString()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HISTORY_MAX_LENGTH]=QString::number(history_max_length_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? ParsersAttributes::True : QString()); ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]=(show_grid ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]=(show_delim ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::ALIGN_OBJS_TO_GRID]=(align_grid ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]=(show_grid ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]=(show_delim ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AlignObjsToGrid]=(align_grid ? ParsersAttributes::True : QString()); unity_cmb->setCurrentIndex(UnitMilimeters); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_MARGIN]=QString("%1,%2,%3,%4").arg(left_marg->value()) @@ -501,17 +501,17 @@ void GeneralConfigWidget::saveConfiguration(void) else config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_CUSTOM_SIZE]=QString("%1,%2").arg(width_spb->value()).arg(height_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]=(print_pg_num_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]=(print_grid_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]=(print_pg_num_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]=(print_grid_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_EXT_ATTRIBS]=(hide_ext_attribs_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_REL_NAME]=(hide_rel_name_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_TABLE_TAGS]=(hide_table_tags_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_EXT_ATTRIBS]=(hide_ext_attribs_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_REL_NAME]=(hide_rel_name_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_TABLE_TAGS]=(hide_table_tags_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT]=font_cmb->currentText(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT_SIZE]=QString::number(font_size_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISPLAY_LINE_NUMBERS]=(disp_line_numbers_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIGHLIGHT_LINES]=(hightlight_lines_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont]=font_cmb->currentText(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize]=QString::number(font_size_spb->value()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISPLAY_LINE_NUMBERS]=(disp_line_numbers_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIGHLIGHT_LINES]=(hightlight_lines_chk->isChecked() ? ParsersAttributes::True : QString()); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_COLOR]=line_numbers_cp->getColor(0).name(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_BG_COLOR]=line_numbers_bg_cp->getColor(0).name(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_HIGHLIGHT_COLOR]=line_highlight_cp->getColor(0).name(); @@ -520,10 +520,10 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_ARGS]=source_editor_args_edt->text(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]=ui_language_cmb->currentData().toString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]=(BaseObjectView::isCompactViewEnabled() ? ParsersAttributes::_TRUE_ : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]=(save_restore_geometry_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]=(BaseObjectView::isCompactViewEnabled() ? ParsersAttributes::True : QString()); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]=(save_restore_geometry_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::File]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); itr=config_params.begin(); @@ -532,14 +532,14 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DOCK_WIDGETS]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGETS_GEOMETRY]=QString(); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]=QString(); + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::File]=QString(); while(itr!=itr_end) { //Checking if the current attribute is a file to be stored in a tag - if((itr->first).contains(QRegExp(QString("(") + ParsersAttributes::_FILE_ + QString(")([0-9]+)")))) + if((itr->first).contains(QRegExp(QString("(") + ParsersAttributes::File + QString(")([0-9]+)")))) { - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::_FILE_]+= + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::File]+= schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } //Checking if the current attribute is a file to be stored in a tag @@ -572,7 +572,7 @@ void GeneralConfigWidget::saveConfiguration(void) attribs[ParsersAttributes::Y_POS] = QString::number(itr.second.geometry.top()); attribs[ParsersAttributes::WIDTH] = QString::number(itr.second.geometry.width()); attribs[ParsersAttributes::HEIGHT] = QString::number(itr.second.geometry.height()); - attribs[ParsersAttributes::MAXIMIZED] = itr.second.maximized ? ParsersAttributes::_TRUE_ : QString(); + attribs[ParsersAttributes::MAXIMIZED] = itr.second.maximized ? ParsersAttributes::True : QString(); schparser.ignoreUnkownAttributes(true); config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGETS_GEOMETRY]+= @@ -593,7 +593,7 @@ void GeneralConfigWidget::applyConfiguration(void) { int unit=unity_cmb->currentIndex(); QFont fnt; - double fnt_size=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT_SIZE].toDouble(); + double fnt_size=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize].toDouble(); if(fnt_size < 5.0f) fnt_size=5.0f; @@ -612,9 +612,9 @@ void GeneralConfigWidget::applyConfiguration(void) ObjectsScene::setInvertRangeSelectionTrigger(invert_rangesel_chk->isChecked()); ObjectsScene::setGridSize(grid_size_spb->value()); - ObjectsScene::setGridOptions(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]==ParsersAttributes::_TRUE_, - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::ALIGN_OBJS_TO_GRID]==ParsersAttributes::_TRUE_, - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]==ParsersAttributes::_TRUE_); + ObjectsScene::setGridOptions(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]==ParsersAttributes::True, + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AlignObjsToGrid]==ParsersAttributes::True, + config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]==ParsersAttributes::True); OperationList::setMaximumSize(oplist_size_spb->value()); BaseTableView::setHideExtAttributes(hide_ext_attribs_chk->isChecked()); @@ -629,7 +629,7 @@ void GeneralConfigWidget::applyConfiguration(void) BaseObjectView::setPlaceholderEnabled(use_placeholders_chk->isChecked()); SQLExecutionWidget::setSQLHistoryMaxLength(history_max_length_spb->value()); - fnt.setFamily(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT]); + fnt.setFamily(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont]); fnt.setPointSize(fnt_size); NumberedTextEditor::setLineNumbersVisible(disp_line_numbers_chk->isChecked()); NumberedTextEditor::setLineHighlightColor(line_highlight_cp->getColor(0)); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 03e4ea1918..0235e60a30 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -98,7 +98,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par try { //Storing the file of a previous session - if(itr->first.contains(ParsersAttributes::_FILE_) && + if(itr->first.contains(ParsersAttributes::File) && !attribs[ParsersAttributes::PATH].isEmpty()) prev_session_files.push_back(attribs[ParsersAttributes::PATH]); @@ -396,17 +396,17 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par #ifndef Q_OS_MAC //Restoring the canvas grid options - action_show_grid->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]==ParsersAttributes::_TRUE_); - action_alin_objs_grade->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::ALIGN_OBJS_TO_GRID]==ParsersAttributes::_TRUE_); - action_show_delimiters->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]==ParsersAttributes::_TRUE_); - action_compact_view->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]==ParsersAttributes::_TRUE_); + action_show_grid->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]==ParsersAttributes::True); + action_alin_objs_grade->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::AlignObjsToGrid]==ParsersAttributes::True); + action_show_delimiters->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]==ParsersAttributes::True); + action_compact_view->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]==ParsersAttributes::True); ObjectsScene::setGridOptions(action_show_grid->isChecked(), action_alin_objs_grade->isChecked(), action_show_delimiters->isChecked()); //Hiding/showing the main menu bar depending on the retrieved conf - main_menu_mb->setVisible(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_MAIN_MENU]==ParsersAttributes::_TRUE_); + main_menu_mb->setVisible(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_MAIN_MENU]==ParsersAttributes::True); if(main_menu_mb->isVisible()) file_menu->addAction(action_hide_main_menu); @@ -429,7 +429,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par #warning "NO UPDATE CHECK: Update checking is disabled." #else //Enabling update check at startup - if(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CHECK_UPDATE]==ParsersAttributes::_TRUE_) + if(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CheckUpdate]==ParsersAttributes::True) QTimer::singleShot(10000, update_notifier_wgt, SLOT(checkForUpdate())); #endif @@ -657,8 +657,8 @@ void MainWindow::closeEvent(QCloseEvent *event) conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); confs=conf_wgt->getConfigurationParams(); - attribs[ParsersAttributes::COMPACT_VIEW]=action_compact_view->isChecked() ? ParsersAttributes::_TRUE_ : QString(); - attribs[ParsersAttributes::SHOW_MAIN_MENU]=main_menu_mb->isVisible() ? ParsersAttributes::_TRUE_ : QString(); + attribs[ParsersAttributes::COMPACT_VIEW]=action_compact_view->isChecked() ? ParsersAttributes::True : QString(); + attribs[ParsersAttributes::SHOW_MAIN_MENU]=main_menu_mb->isVisible() ? ParsersAttributes::True : QString(); conf_wgt->addConfigurationParam(ParsersAttributes::CONFIGURATION, attribs); attribs.clear(); @@ -666,7 +666,7 @@ void MainWindow::closeEvent(QCloseEvent *event) count=models_tbw->count(); //Remove the references to old session - conf_wgt->removeConfigurationParam(QRegExp(QString("(%1)([0-9])+").arg(ParsersAttributes::_FILE_))); + conf_wgt->removeConfigurationParam(QRegExp(QString("(%1)([0-9])+").arg(ParsersAttributes::File))); //Saving the session for(i=0; i < count; i++) @@ -675,7 +675,7 @@ void MainWindow::closeEvent(QCloseEvent *event) if(!model->getFilename().isEmpty()) { - param_id=QString("%1%2").arg(ParsersAttributes::_FILE_).arg(i); + param_id=QString("%1%2").arg(ParsersAttributes::File).arg(i); attribs[ParsersAttributes::ID]=param_id; attribs[ParsersAttributes::PATH]=model->getFilename(); conf_wgt->addConfigurationParam(param_id, attribs); @@ -1146,9 +1146,9 @@ void MainWindow::setGridOptions(void) action_alin_objs_grade->isChecked(), action_show_delimiters->isChecked()); - attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::ALIGN_OBJS_TO_GRID] = (action_alin_objs_grade->isChecked() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); - attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID] = (action_show_grid->isChecked() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); - attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS] = (action_show_delimiters->isChecked() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::AlignObjsToGrid] = (action_alin_objs_grade->isChecked() ? ParsersAttributes::True : ParsersAttributes::False); + attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID] = (action_show_grid->isChecked() ? ParsersAttributes::True : ParsersAttributes::False); + attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS] = (action_show_delimiters->isChecked() ? ParsersAttributes::True : ParsersAttributes::False); if(current_model) { @@ -1831,25 +1831,25 @@ void MainWindow::storeDockWidgetsSettings(void) GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); attribs_map params; - params[ParsersAttributes::VALIDATOR]=ParsersAttributes::_TRUE_; - params[ParsersAttributes::SQL_VALIDATION]=(model_valid_wgt->sql_validation_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - params[ParsersAttributes::USE_UNIQUE_NAMES]=(model_valid_wgt->use_tmp_names_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + params[ParsersAttributes::VALIDATOR]=ParsersAttributes::True; + params[ParsersAttributes::SQL_VALIDATION]=(model_valid_wgt->sql_validation_chk->isChecked() ? ParsersAttributes::True : QString()); + params[ParsersAttributes::USE_UNIQUE_NAMES]=(model_valid_wgt->use_tmp_names_chk->isChecked() ? ParsersAttributes::True : QString()); params[ParsersAttributes::PGSQL_VERSION]=model_valid_wgt->version_cmb->currentText(); conf_wgt->addConfigurationParam(ParsersAttributes::VALIDATOR, params); params.clear(); - params[ParsersAttributes::OBJECT_FINDER]=ParsersAttributes::_TRUE_; - params[ParsersAttributes::SELECT_OBJECTS]=(obj_finder_wgt->select_btn->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - params[ParsersAttributes::FADEIN_OBJECTS]=(obj_finder_wgt->fade_btn->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - params[ParsersAttributes::REGULAR_EXP]=(obj_finder_wgt->regexp_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - params[ParsersAttributes::CASE_SENSITIVE]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - params[ParsersAttributes::EXACT_MATCH]=(obj_finder_wgt->exact_match_chk->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + params[ParsersAttributes::OBJECT_FINDER]=ParsersAttributes::True; + params[ParsersAttributes::SELECT_OBJECTS]=(obj_finder_wgt->select_btn->isChecked() ? ParsersAttributes::True : QString()); + params[ParsersAttributes::FADEIN_OBJECTS]=(obj_finder_wgt->fade_btn->isChecked() ? ParsersAttributes::True : QString()); + params[ParsersAttributes::REGULAR_EXP]=(obj_finder_wgt->regexp_chk->isChecked() ? ParsersAttributes::True : QString()); + params[ParsersAttributes::CaseSensitive]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? ParsersAttributes::True : QString()); + params[ParsersAttributes::EXACT_MATCH]=(obj_finder_wgt->exact_match_chk->isChecked() ? ParsersAttributes::True : QString()); conf_wgt->addConfigurationParam(ParsersAttributes::OBJECT_FINDER, params); params.clear(); - params[ParsersAttributes::SQL_TOOL]=ParsersAttributes::_TRUE_; - params[ParsersAttributes::SHOW_ATTRIBUTES_GRID]=(sql_tool_wgt->attributes_tb->isChecked() ? ParsersAttributes::_TRUE_ : QString()); - params[ParsersAttributes::SHOW_SOURCE_PANE]=(sql_tool_wgt->source_pane_tb->isChecked() ? ParsersAttributes::_TRUE_ : QString()); + params[ParsersAttributes::SQL_TOOL]=ParsersAttributes::True; + params[ParsersAttributes::SHOW_ATTRIBUTES_GRID]=(sql_tool_wgt->attributes_tb->isChecked() ? ParsersAttributes::True : QString()); + params[ParsersAttributes::SHOW_SOURCE_PANE]=(sql_tool_wgt->source_pane_tb->isChecked() ? ParsersAttributes::True : QString()); conf_wgt->addConfigurationParam(ParsersAttributes::SQL_TOOL, params); params.clear(); } @@ -1861,24 +1861,24 @@ void MainWindow::restoreDockWidgetsSettings(void) if(confs.count(ParsersAttributes::VALIDATOR)) { - model_valid_wgt->sql_validation_chk->setChecked(confs[ParsersAttributes::VALIDATOR][ParsersAttributes::SQL_VALIDATION]==ParsersAttributes::_TRUE_); - model_valid_wgt->use_tmp_names_chk->setChecked(confs[ParsersAttributes::VALIDATOR][ParsersAttributes::USE_UNIQUE_NAMES]==ParsersAttributes::_TRUE_); + model_valid_wgt->sql_validation_chk->setChecked(confs[ParsersAttributes::VALIDATOR][ParsersAttributes::SQL_VALIDATION]==ParsersAttributes::True); + model_valid_wgt->use_tmp_names_chk->setChecked(confs[ParsersAttributes::VALIDATOR][ParsersAttributes::USE_UNIQUE_NAMES]==ParsersAttributes::True); model_valid_wgt->version_cmb->setCurrentText(confs[ParsersAttributes::VALIDATOR][ParsersAttributes::PGSQL_VERSION]); } if(confs.count(ParsersAttributes::OBJECT_FINDER)) { - obj_finder_wgt->select_btn->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::SELECT_OBJECTS]==ParsersAttributes::_TRUE_); - obj_finder_wgt->fade_btn->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::FADEIN_OBJECTS]==ParsersAttributes::_TRUE_); - obj_finder_wgt->regexp_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::REGULAR_EXP]==ParsersAttributes::_TRUE_); - obj_finder_wgt->case_sensitive_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::CASE_SENSITIVE]==ParsersAttributes::_TRUE_); - obj_finder_wgt->exact_match_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::EXACT_MATCH]==ParsersAttributes::_TRUE_); + obj_finder_wgt->select_btn->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::SELECT_OBJECTS]==ParsersAttributes::True); + obj_finder_wgt->fade_btn->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::FADEIN_OBJECTS]==ParsersAttributes::True); + obj_finder_wgt->regexp_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::REGULAR_EXP]==ParsersAttributes::True); + obj_finder_wgt->case_sensitive_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::CaseSensitive]==ParsersAttributes::True); + obj_finder_wgt->exact_match_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::EXACT_MATCH]==ParsersAttributes::True); } if(confs.count(ParsersAttributes::SQL_TOOL)) { - sql_tool_wgt->attributes_tb->setChecked(confs[ParsersAttributes::SQL_TOOL][ParsersAttributes::SHOW_ATTRIBUTES_GRID]==ParsersAttributes::_TRUE_); - sql_tool_wgt->source_pane_tb->setChecked(confs[ParsersAttributes::SQL_TOOL][ParsersAttributes::SHOW_SOURCE_PANE]==ParsersAttributes::_TRUE_); + sql_tool_wgt->attributes_tb->setChecked(confs[ParsersAttributes::SQL_TOOL][ParsersAttributes::SHOW_ATTRIBUTES_GRID]==ParsersAttributes::True); + sql_tool_wgt->source_pane_tb->setChecked(confs[ParsersAttributes::SQL_TOOL][ParsersAttributes::SHOW_SOURCE_PANE]==ParsersAttributes::True); } } diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index a5b986296d..211132266e 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -465,7 +465,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) //The import process will exclude built-in array array types, system and extension objects catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); - catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); + catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::True}}); obj_oids[ObjectType::Database].push_back(db_cmb->currentData().value()); if(thread_id == SrcImportThread) diff --git a/libpgmodeler_ui/src/modelfixform.cpp b/libpgmodeler_ui/src/modelfixform.cpp index 00bf60f9bf..27be1456e9 100644 --- a/libpgmodeler_ui/src/modelfixform.cpp +++ b/libpgmodeler_ui/src/modelfixform.cpp @@ -35,12 +35,12 @@ ModelFixForm::ModelFixForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, PgModelerUiNs::configureWidgetFont(not_found_lbl, PgModelerUiNs::MediumFontFactor); //Configuring font style for output widget - if(!confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT].isEmpty()) + if(!confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont].isEmpty()) { - double size=confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT_SIZE].toDouble(); + double size=confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize].toDouble(); if(size < 5.0f) size=5.0f; - output_txt->setFontFamily(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CODE_FONT]); + output_txt->setFontFamily(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont]); output_txt->setFontPointSize(size); } diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 7253ac5780..afddbbb857 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -330,7 +330,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) ParsersAttributes::TABLESPACE, ParsersAttributes::COLLATION, ParsersAttributes::POSITION, - ParsersAttributes::APPENDED_SQL, + ParsersAttributes::AppendedSql, ParsersAttributes::PREPENDED_SQL }); //If a difference was detected between the objects @@ -869,17 +869,17 @@ void ModelsDiffHelper::processDiffInfos(void) has_diffs=(create_objs_count!=0 || alter_objs.size()!=0 || drop_objs.size()!=0); //Attributes used on the diff schema file - attribs[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::_TRUE_; + attribs[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::True; attribs[ParsersAttributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; attribs[ParsersAttributes::DB_MODEL]=source_model->getName(); attribs[ParsersAttributes::DATABASE]=imported_model->getName(); attribs[ParsersAttributes::DATE]=QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); attribs[ParsersAttributes::CONNECTION]=imported_model->getName(); - attribs[ParsersAttributes::CHANGE]=QString::number(alter_objs.size()); + attribs[ParsersAttributes::Change]=QString::number(alter_objs.size()); attribs[ParsersAttributes::CREATE]=QString::number(create_objs_count); attribs[ParsersAttributes::DROP]=QString::number(drop_objs.size()); attribs[ParsersAttributes::TRUNCATE]=QString::number(truncate_tabs.size()); - attribs[ParsersAttributes::ALTER_CMDS]=QString(); + attribs[ParsersAttributes::AlterCmds]=QString(); attribs[ParsersAttributes::DROP_CMDS]=QString(); attribs[ParsersAttributes::CREATE_CMDS]=QString(); attribs[ParsersAttributes::TRUNCATE_CMDS]=QString(); @@ -887,7 +887,7 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[ParsersAttributes::FK_DEFS]=QString(); attribs[ParsersAttributes::UNSET_PERMS]=unset_perms; attribs[ParsersAttributes::SET_PERMS]=set_perms; - attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? ParsersAttributes::_TRUE_ : QString()); + attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? ParsersAttributes::True : QString()); attribs[ParsersAttributes::SEARCH_PATH]=(has_diffs ? sch_names.join(',') : QString()); ritr=drop_objs.rbegin(); @@ -919,7 +919,7 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[ParsersAttributes::TRUNCATE_CMDS]+=itr.second; for(auto &itr : alter_objs) - attribs[ParsersAttributes::ALTER_CMDS]+=itr.second; + attribs[ParsersAttributes::AlterCmds]+=itr.second; //Generating the whole diff buffer schparser.setPgSQLVersion(pgsql_version); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index bac40e063c..647ae59d9c 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -103,7 +103,7 @@ void RelationshipConfigWidget::loadConfiguration(void) tab_edges_rb->setChecked(config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]==ParsersAttributes::CONNECT_TABLE_EDGES); crows_foot_rb->setChecked(config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]==ParsersAttributes::CROWS_FOOT); - deferrable_chk->setChecked(config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]==ParsersAttributes::_TRUE_); + deferrable_chk->setChecked(config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]==ParsersAttributes::True); deferral_cmb->setCurrentText(config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFER_TYPE]); idx=upd_action_cmb->findText(config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::UPD_ACTION]); @@ -153,7 +153,7 @@ void RelationshipConfigWidget::saveConfiguration(void) else config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]=ParsersAttributes::CONNECT_CENTER_PNTS; - config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]=(deferrable_chk->isChecked() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_); + config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]=(deferrable_chk->isChecked() ? ParsersAttributes::True : ParsersAttributes::False); config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFER_TYPE]=deferral_cmb->currentText(); config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEL_ACTION]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 4623aebfc5..87a948b228 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -478,7 +478,7 @@ void RelationshipWidget::useFKGlobalSettings(bool value) if(value) { map confs=RelationshipConfigWidget::getConfigurationParams(); - deferrable_chk->setChecked(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]==ParsersAttributes::_TRUE_); + deferrable_chk->setChecked(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]==ParsersAttributes::True); deferral_cmb->setCurrentText(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFER_TYPE]); upd_action_cmb->setCurrentText(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::UPD_ACTION]); del_action_cmb->setCurrentText(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEL_ACTION]); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index a2eab024dc..f8a21834b6 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -162,7 +162,7 @@ QString SnippetsConfigWidget::parseSnippet(attribs_map snippet, attribs_map attr QStringList aux_attribs; QString buf=snippet[ParsersAttributes::CONTENTS]; - if(snippet[ParsersAttributes::PARSABLE]!=ParsersAttributes::_TRUE_) + if(snippet[ParsersAttributes::PARSABLE]!=ParsersAttributes::True) return(buf); try @@ -170,7 +170,7 @@ QString SnippetsConfigWidget::parseSnippet(attribs_map snippet, attribs_map attr schparser.loadBuffer(buf); //Assigning dummy values for empty attributes - if(snippet[ParsersAttributes::PLACEHOLDERS]==ParsersAttributes::_TRUE_) + if(snippet[ParsersAttributes::PLACEHOLDERS]==ParsersAttributes::True) { aux_attribs=schparser.extractAttributes(); for(QString attr : aux_attribs) @@ -230,7 +230,7 @@ bool SnippetsConfigWidget::isSnippetValid(attribs_map &attribs, const QString &o err_msg=trUtf8("Empty label for snippet %1. Please, specify a value for it!").arg(snip_id); else if(attribs[ParsersAttributes::CONTENTS].isEmpty()) err_msg=trUtf8("Empty code for snippet %1. Please, specify a value for it!").arg(snip_id); - else if(attribs[ParsersAttributes::PARSABLE]==ParsersAttributes::_TRUE_) + else if(attribs[ParsersAttributes::PARSABLE]==ParsersAttributes::True) { try { @@ -311,9 +311,9 @@ attribs_map SnippetsConfigWidget::getSnippetAttributes(void) return(attribs_map{ {ParsersAttributes::ID, id_edt->text()}, {ParsersAttributes::LABEL, label_edt->text()}, {ParsersAttributes::OBJECT, object_id}, - {ParsersAttributes::PARSABLE, (parsable_chk->isChecked() ? ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_)}, + {ParsersAttributes::PARSABLE, (parsable_chk->isChecked() ? ParsersAttributes::True : ParsersAttributes::False)}, {ParsersAttributes::PLACEHOLDERS, (parsable_chk->isChecked() && placeholders_chk->isChecked() ? - ParsersAttributes::_TRUE_ : ParsersAttributes::_FALSE_)}, + ParsersAttributes::True : ParsersAttributes::False)}, {ParsersAttributes::CONTENTS, snippet_txt->toPlainText()} }); } @@ -326,8 +326,8 @@ void SnippetsConfigWidget::editSnippet(void) snippet_txt->setPlainText(config_params[snip_id].at(ParsersAttributes::CONTENTS)); id_edt->setText(snip_id); label_edt->setText(config_params[snip_id].at(ParsersAttributes::LABEL)); - parsable_chk->setChecked(config_params[snip_id].at(ParsersAttributes::PARSABLE)==ParsersAttributes::_TRUE_); - placeholders_chk->setChecked(config_params[snip_id].at(ParsersAttributes::PLACEHOLDERS)==ParsersAttributes::_TRUE_); + parsable_chk->setChecked(config_params[snip_id].at(ParsersAttributes::PARSABLE)==ParsersAttributes::True); + placeholders_chk->setChecked(config_params[snip_id].at(ParsersAttributes::PLACEHOLDERS)==ParsersAttributes::True); applies_to_cmb->setCurrentText(BaseObject::getTypeName(obj_type)); } diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 1d809a7e92..850fb3d05c 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -475,18 +475,18 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) ErrorCode::DefEmptyGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - chr_sensitive=(attribs[ParsersAttributes::CASE_SENSITIVE]==ParsersAttributes::_TRUE_); - italic=(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::_TRUE_); - bold=(attribs[ParsersAttributes::BOLD]==ParsersAttributes::_TRUE_); - underline=(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::_TRUE_); - partial_match=(attribs[ParsersAttributes::PARTIAL_MATCH]==ParsersAttributes::_TRUE_); + chr_sensitive=(attribs[ParsersAttributes::CaseSensitive]==ParsersAttributes::True); + italic=(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::True); + bold=(attribs[ParsersAttributes::Bold]==ParsersAttributes::True); + underline=(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::True); + partial_match=(attribs[ParsersAttributes::PARTIAL_MATCH]==ParsersAttributes::True); fg_color.setNamedColor(attribs[ParsersAttributes::FOREGROUND_COLOR]); //If the attribute isn't defined the bg color will be transparent - if(attribs[ParsersAttributes::BACKGROUND_COLOR].isEmpty()) + if(attribs[ParsersAttributes::BackgroundColor].isEmpty()) bg_color.setRgb(0,0,0,0); else - bg_color.setNamedColor(attribs[ParsersAttributes::BACKGROUND_COLOR]); + bg_color.setNamedColor(attribs[ParsersAttributes::BackgroundColor]); if(!attribs[ParsersAttributes::LOOKAHEAD_CHAR].isEmpty()) lookahead_char[group]=attribs[ParsersAttributes::LOOKAHEAD_CHAR][0]; @@ -524,9 +524,9 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) expr_type=attribs[ParsersAttributes::TYPE]; regexp.setPattern(attribs[ParsersAttributes::VALUE]); - if(attribs[ParsersAttributes::REGULAR_EXP]==ParsersAttributes::_TRUE_) + if(attribs[ParsersAttributes::REGULAR_EXP]==ParsersAttributes::True) regexp.setPatternSyntax(QRegExp::RegExp2); - else if(attribs[ParsersAttributes::WILDCARD]==ParsersAttributes::_TRUE_) + else if(attribs[ParsersAttributes::WILDCARD]==ParsersAttributes::True) regexp.setPatternSyntax(QRegExp::Wildcard); else regexp.setPatternSyntax(QRegExp::FixedString); diff --git a/libpgmodeler_ui/src/updatenotifierwidget.cpp b/libpgmodeler_ui/src/updatenotifierwidget.cpp index 8bb4b7ce37..aff7ea2593 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.cpp +++ b/libpgmodeler_ui/src/updatenotifierwidget.cpp @@ -138,9 +138,9 @@ void UpdateNotifierWidget::handleUpdateChecked(QNetworkReply *reply) QJsonDocument json_doc=QJsonDocument::fromJson(reply->readAll()); QJsonObject json_obj=json_doc.object(); QString version=json_obj.value(ParsersAttributes::NEW_VERSION).toString(), - changelog=json_obj.value(ParsersAttributes::CHANGELOG).toString(), + changelog=json_obj.value(ParsersAttributes::Changelog).toString(), date=json_obj.value(ParsersAttributes::DATE).toString(); - bool upd_found=(!version.isEmpty() && version!=ParsersAttributes::_FALSE_); + bool upd_found=(!version.isEmpty() && version!=ParsersAttributes::False); if(upd_found) { diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index bc9f96713c..c6f257940c 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1276,7 +1276,7 @@ void PgModelerCli::importDatabase(DatabaseModel *model, Connection conn) catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); - catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::_TRUE_}}); + catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::True}}); db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::ParamDbName), ObjectType::Database); obj_oids[ObjectType::Database].push_back(db_oid.toUInt()); @@ -1499,7 +1499,7 @@ bool PgModelerCli::containsRelAttributes(const QString &str) ParsersAttributes::LABEL, ParsersAttributes::LINE, ParsersAttributes::POSITION, ParsersAttributes::IDENTIFIER, ParsersAttributes::DEFERRABLE, ParsersAttributes::DEFER_TYPE, ParsersAttributes::TABLE_NAME, ParsersAttributes::SPECIAL_PK_COLS, ParsersAttributes::TABLE, - ParsersAttributes::ANCESTOR_TABLE, ParsersAttributes::COPY_OPTIONS, ParsersAttributes::COPY_MODE, + ParsersAttributes::AncestorTable, ParsersAttributes::COPY_OPTIONS, ParsersAttributes::COPY_MODE, ParsersAttributes::SRC_COL_PATTERN, ParsersAttributes::DST_COL_PATTERN, ParsersAttributes::PK_PATTERN, ParsersAttributes::UQ_PATTERN, ParsersAttributes::SRC_FK_PATTERN, ParsersAttributes::DST_FK_PATTERN }; @@ -1562,7 +1562,7 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) .arg(QFileInfo(GlobalAttributes::PgModelerAppPath).absolutePath()); attribs[ParsersAttributes::WORKING_DIR]=QStandardPaths::writableLocation(QStandardPaths::HomeLocation); - attribs[ParsersAttributes::APPLICATION]=(QFileInfo(startup_script).exists() ? + attribs[ParsersAttributes::Application]=(QFileInfo(startup_script).exists() ? startup_script : GlobalAttributes::PgModelerAppPath); attribs[ParsersAttributes::ICON]=exec_icon; } diff --git a/schemas/catalog/trigger.sch b/schemas/catalog/trigger.sch index dd76237ad4..46c861048a 100644 --- a/schemas/catalog/trigger.sch +++ b/schemas/catalog/trigger.sch @@ -77,7 +77,7 @@ END AS columns, ] - %if ({pgsql-ver} >= "10.0") %then + %if ({pgsql-ver} >=f "10.0") %then [ tgoldtable AS old_table_name, tgnewtable AS new_table_name, ] %else [ NULL AS old_table_name, NULL AS new_table_name, ] From f28f43e4b270c29dfd02e702923cf44ba02ed365 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 08:55:29 -0300 Subject: [PATCH 179/425] Renamed the namespace ParsersAttributes to Attributes Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 78 +- libobjrenderer/src/basetableview.cpp | 8 +- libobjrenderer/src/graphicalview.cpp | 4 +- libobjrenderer/src/objectsscene.cpp | 4 +- libobjrenderer/src/relationshipview.cpp | 48 +- libobjrenderer/src/schemaview.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 46 +- libobjrenderer/src/tabletitleview.cpp | 12 +- libobjrenderer/src/tableview.cpp | 2 +- libobjrenderer/src/textboxview.cpp | 6 +- libparsers/libparsers.pro | 4 +- .../{parsersattributes.cpp => attributes.cpp} | 118 +- .../src/{parsersattributes.h => attributes.h} | 122 +- libparsers/src/schemaparser.cpp | 6 +- libpgconnector/src/catalog.cpp | 92 +- libpgconnector/src/connection.cpp | 2 +- libpgmodeler/src/aggregate.cpp | 42 +- libpgmodeler/src/basegraphicobject.cpp | 16 +- libpgmodeler/src/baseobject.cpp | 124 +- libpgmodeler/src/baseobject.h | 2 +- libpgmodeler/src/baserelationship.cpp | 140 +- libpgmodeler/src/basetable.cpp | 6 +- libpgmodeler/src/cast.cpp | 36 +- libpgmodeler/src/collation.cpp | 20 +- libpgmodeler/src/column.cpp | 104 +- libpgmodeler/src/constraint.cpp | 100 +- libpgmodeler/src/conversion.cpp | 18 +- libpgmodeler/src/databasemodel.cpp | 1380 ++++++++--------- libpgmodeler/src/domain.cpp | 60 +- libpgmodeler/src/element.cpp | 20 +- libpgmodeler/src/eventtrigger.cpp | 26 +- libpgmodeler/src/excludeelement.cpp | 8 +- libpgmodeler/src/extension.cpp | 22 +- libpgmodeler/src/function.cpp | 90 +- libpgmodeler/src/genericsql.cpp | 4 +- libpgmodeler/src/index.cpp | 68 +- libpgmodeler/src/indexelement.cpp | 8 +- libpgmodeler/src/language.cpp | 18 +- libpgmodeler/src/operator.cpp | 44 +- libpgmodeler/src/operatorclass.cpp | 26 +- libpgmodeler/src/operatorclasselement.cpp | 44 +- libpgmodeler/src/operatorfamily.cpp | 6 +- libpgmodeler/src/parameter.cpp | 14 +- libpgmodeler/src/partitionkey.cpp | 8 +- libpgmodeler/src/permission.cpp | 54 +- libpgmodeler/src/pgsqltypes.cpp | 40 +- libpgmodeler/src/pgsqltypes.h | 2 +- libpgmodeler/src/policy.cpp | 32 +- libpgmodeler/src/reference.cpp | 18 +- libpgmodeler/src/relationship.cpp | 118 +- libpgmodeler/src/role.cpp | 70 +- libpgmodeler/src/rule.cpp | 20 +- libpgmodeler/src/schema.cpp | 8 +- libpgmodeler/src/sequence.cpp | 64 +- libpgmodeler/src/table.cpp | 138 +- libpgmodeler/src/tableobject.cpp | 4 +- libpgmodeler/src/tablespace.cpp | 4 +- libpgmodeler/src/tag.cpp | 24 +- libpgmodeler/src/textbox.cpp | 20 +- libpgmodeler/src/trigger.cpp | 88 +- libpgmodeler/src/type.cpp | 154 +- libpgmodeler/src/typeattribute.cpp | 10 +- libpgmodeler/src/view.cpp | 56 +- .../src/appearanceconfigwidget.cpp | 104 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 2 +- libpgmodeler_ui/src/baseconfigwidget.h | 2 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 6 +- .../src/connectionsconfigwidget.cpp | 34 +- .../src/databaseexplorerwidget.cpp | 733 ++++----- libpgmodeler_ui/src/databaseimportform.cpp | 22 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 606 ++++---- libpgmodeler_ui/src/datamanipulationform.cpp | 92 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 6 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 308 ++-- libpgmodeler_ui/src/mainwindow.cpp | 112 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 2 +- libpgmodeler_ui/src/modelexporthelper.cpp | 6 +- libpgmodeler_ui/src/modelfixform.cpp | 6 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 4 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 88 +- libpgmodeler_ui/src/modelwidget.cpp | 4 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 10 +- libpgmodeler_ui/src/permissionwidget.cpp | 12 +- .../src/relationshipconfigwidget.cpp | 86 +- libpgmodeler_ui/src/relationshipwidget.cpp | 22 +- libpgmodeler_ui/src/resultsetmodel.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 78 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 20 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 60 +- libpgmodeler_ui/src/syntaxhighlighter.h | 2 +- libpgmodeler_ui/src/tagwidget.cpp | 24 +- libpgmodeler_ui/src/updatenotifierwidget.cpp | 8 +- libpgmodeler_ui/src/updatenotifierwidget.h | 2 +- main-cli/src/pgmodelercli.cpp | 76 +- main/src/application.cpp | 6 +- tests/src/roletest/roletest.cpp | 2 +- 96 files changed, 3255 insertions(+), 3224 deletions(-) rename libparsers/src/{parsersattributes.cpp => attributes.cpp} (89%) rename libparsers/src/{parsersattributes.h => attributes.h} (89%) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 8a78d4dcb1..6b87dae4f7 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -232,37 +232,37 @@ void BaseObjectView::loadObjectsStyle(void) xmlparser.getElementAttributes(attribs); elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::GLOBAL) + if(elem==Attributes::GLOBAL) { - font.setFamily(attribs[ParsersAttributes::FONT]); - font.setPointSizeF(attribs[ParsersAttributes::SIZE].toDouble()); - font.setBold(attribs[ParsersAttributes::Bold]==ParsersAttributes::True); - font.setItalic(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::True); - font.setUnderline(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::True); + font.setFamily(attribs[Attributes::FONT]); + font.setPointSizeF(attribs[Attributes::SIZE].toDouble()); + font.setBold(attribs[Attributes::Bold]==Attributes::True); + font.setItalic(attribs[Attributes::ITALIC]==Attributes::True); + font.setUnderline(attribs[Attributes::UNDERLINE]==Attributes::True); font_fmt.setFont(font); - font_config[ParsersAttributes::GLOBAL]=font_fmt; + font_config[Attributes::GLOBAL]=font_fmt; } - else if(elem==ParsersAttributes::FONT) + else if(elem==Attributes::FONT) { - font_config[attribs[ParsersAttributes::ID]]=font_fmt; - itr=font_config.find(attribs[ParsersAttributes::ID]); + font_config[attribs[Attributes::ID]]=font_fmt; + itr=font_config.find(attribs[Attributes::ID]); font=font_fmt.font(); - font.setBold(attribs[ParsersAttributes::Bold]==ParsersAttributes::True); - font.setItalic(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::True); - font.setUnderline(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::True); + font.setBold(attribs[Attributes::Bold]==Attributes::True); + font.setItalic(attribs[Attributes::ITALIC]==Attributes::True); + font.setUnderline(attribs[Attributes::UNDERLINE]==Attributes::True); (itr->second).setFont(font); - (itr->second).setForeground(QColor(attribs[ParsersAttributes::COLOR])); + (itr->second).setForeground(QColor(attribs[Attributes::Color])); } - else if(elem==ParsersAttributes::OBJECT) + else if(elem==Attributes::OBJECT) { - list=attribs[ParsersAttributes::FILL_COLOR].split(','); + list=attribs[Attributes::FILL_COLOR].split(','); vector colors; colors.push_back(!list.isEmpty() ? QColor(list[0]) : QColor(0,0,0)); colors.push_back(list.size()==2 ? QColor(list[1]) : colors[0]); - colors.push_back(QColor(attribs[ParsersAttributes::BorderColor])); + colors.push_back(QColor(attribs[Attributes::BorderColor])); - color_config[attribs[ParsersAttributes::ID]]=colors; + color_config[attribs[Attributes::ID]]=colors; } } } @@ -279,9 +279,9 @@ void BaseObjectView::setFontStyle(const QString &id, QTextCharFormat font_fmt) { QFont font; - if(id!=ParsersAttributes::GLOBAL) + if(id!=Attributes::GLOBAL) { - font=font_config[ParsersAttributes::GLOBAL].font(); + font=font_config[Attributes::GLOBAL].font(); font.setItalic(font_fmt.font().italic()); font.setBold(font_fmt.font().bold()); font.setUnderline(font_fmt.font().underline()); @@ -343,7 +343,7 @@ QLinearGradient BaseObjectView::getFillStyle(const QString &id) if(!colors.empty()) { - if(id==ParsersAttributes::OBJ_SELECTION || id==ParsersAttributes::PLACEHOLDER) + if(id==Attributes::OBJ_SELECTION || id==Attributes::PLACEHOLDER) { colors[0].setAlpha(ObjectAlphaChannel); colors[1].setAlpha(ObjectAlphaChannel); @@ -369,7 +369,7 @@ QPen BaseObjectView::getBorderStyle(const QString &id) if(!colors.empty()) { - if(id==ParsersAttributes::OBJ_SELECTION) + if(id==Attributes::OBJ_SELECTION) colors[2].setAlpha(ObjectAlphaChannel); pen.setWidthF(ObjectBorderWidth); @@ -462,14 +462,14 @@ void BaseObjectView::configurePositionInfo(QPointF pos) { if(this->isSelected()) { - QFont fnt=font_config[ParsersAttributes::POSITION_INFO].font(); + QFont fnt=font_config[Attributes::POSITION_INFO].font(); - pos_info_rect->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::POSITION_INFO)); - pos_info_rect->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::POSITION_INFO)); + pos_info_rect->setBrush(BaseObjectView::getFillStyle(Attributes::POSITION_INFO)); + pos_info_rect->setPen(BaseObjectView::getBorderStyle(Attributes::POSITION_INFO)); fnt.setPointSizeF(fnt.pointSizeF() * 0.95); pos_info_txt->setFont(fnt); - pos_info_txt->setBrush(font_config[ParsersAttributes::POSITION_INFO].foreground()); + pos_info_txt->setBrush(font_config[Attributes::POSITION_INFO].foreground()); pos_info_txt->setText(QString(" x:%1 y:%2 ").arg(roundf(pos.x())).arg(roundf(pos.y()))); pos_info_rect->setRect(pos_info_txt->boundingRect()); @@ -490,7 +490,7 @@ void BaseObjectView::configureSQLDisabledInfo(void) if(this->getSourceObject()->isSQLDisabled()) { QTextCharFormat char_fmt; - char_fmt=BaseObjectView::getFontStyle(ParsersAttributes::POSITION_INFO); + char_fmt=BaseObjectView::getFontStyle(Attributes::POSITION_INFO); char_fmt.setFontPointSize(char_fmt.font().pointSizeF() * 0.80); sql_disabled_txt->setFont(char_fmt.font()); @@ -498,8 +498,8 @@ void BaseObjectView::configureSQLDisabledInfo(void) sql_disabled_txt->setBrush(char_fmt.foreground()); sql_disabled_box->setRect(QRectF(QPointF(0,0), sql_disabled_txt->boundingRect().size() + QSizeF(1.5 * HorizSpacing, 1.5 * VertSpacing))); - sql_disabled_box->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::POSITION_INFO)); - sql_disabled_box->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::POSITION_INFO)); + sql_disabled_box->setPen(BaseObjectView::getBorderStyle(Attributes::POSITION_INFO)); + sql_disabled_box->setBrush(BaseObjectView::getFillStyle(Attributes::POSITION_INFO)); px=bounding_rect.width() - sql_disabled_box->boundingRect().width() + (1.5 * HorizSpacing), py=-(sql_disabled_box->boundingRect().height()/2); @@ -532,8 +532,8 @@ void BaseObjectView::configureObjectSelection(void) rect_item->setRect(this->boundingRect()); rect_item->setPos(0,0); rect_item->setBorderRadius(5); - rect_item->setBrush(this->getFillStyle(ParsersAttributes::OBJ_SELECTION)); - rect_item->setPen(this->getBorderStyle(ParsersAttributes::OBJ_SELECTION)); + rect_item->setBrush(this->getFillStyle(Attributes::OBJ_SELECTION)); + rect_item->setPen(this->getBorderStyle(Attributes::OBJ_SELECTION)); } } @@ -546,7 +546,7 @@ void BaseObjectView::configureProtectedIcon(void) double factor; //Calculates the factor used to resize the protection icon accordding the font size - factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize; + factor=font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize; pol.append(QPointF(2,5)); pol.append(QPointF(2,2)); pol.append(QPointF(3,1)); pol.append(QPointF(4,0)); @@ -562,8 +562,8 @@ void BaseObjectView::configureProtectedIcon(void) pol_item=dynamic_cast(protected_icon->childItems().at(0)); pol_item->setPolygon(pol); - pol_item->setBrush(this->getFillStyle(ParsersAttributes::LOCKER_ARC)); - pol_item->setPen(this->getBorderStyle(ParsersAttributes::LOCKER_ARC)); + pol_item->setBrush(this->getFillStyle(Attributes::LOCKER_ARC)); + pol_item->setPen(this->getBorderStyle(Attributes::LOCKER_ARC)); pol.clear(); pol.append(QPointF(1,5)); pol.append(QPointF(10,5)); @@ -577,8 +577,8 @@ void BaseObjectView::configureProtectedIcon(void) pol_item=dynamic_cast(protected_icon->childItems().at(1)); pol_item->setPolygon(pol); - pol_item->setBrush(this->getFillStyle(ParsersAttributes::LOCKER_BODY)); - pol_item->setPen(this->getBorderStyle(ParsersAttributes::LOCKER_BODY)); + pol_item->setBrush(this->getFillStyle(Attributes::LOCKER_BODY)); + pol_item->setPen(this->getBorderStyle(Attributes::LOCKER_BODY)); } } @@ -629,10 +629,10 @@ void BaseObjectView::togglePlaceholder(bool visible) if(visible) { - QPen pen=BaseObjectView::getBorderStyle(ParsersAttributes::PLACEHOLDER); + QPen pen=BaseObjectView::getBorderStyle(Attributes::PLACEHOLDER); pen.setStyle(Qt::DashLine); - placeholder->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::PLACEHOLDER)); + placeholder->setBrush(BaseObjectView::getFillStyle(Attributes::PLACEHOLDER)); placeholder->setPen(pen); placeholder->setRect(QRectF(QPointF(0,0),this->bounding_rect.size())); placeholder->setPos(this->mapToScene(this->bounding_rect.topLeft())); @@ -644,7 +644,7 @@ void BaseObjectView::togglePlaceholder(bool visible) double BaseObjectView::getFontFactor(void) { - return(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize); + return(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize); } double BaseObjectView::getScreenDpiFactor(void) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 7637bcdea3..e3e63c96bf 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -320,12 +320,12 @@ void BaseTableView::configureTag(void) QPolygonF pol; QPointF p1, p2; double bottom; - QFont fnt=BaseObjectView::getFontStyle(ParsersAttributes::TAG).font(); + QFont fnt=BaseObjectView::getFontStyle(Attributes::TAG).font(); fnt.setPointSizeF(fnt.pointSizeF() * 0.80f); tag_name->setFont(fnt); tag_name->setText(tag->getName()); - tag_name->setBrush(BaseObjectView::getFontStyle(ParsersAttributes::TAG).foreground()); + tag_name->setBrush(BaseObjectView::getFontStyle(Attributes::TAG).foreground()); p1=tag_name->boundingRect().topLeft(); p2=tag_name->boundingRect().bottomRight(); @@ -339,8 +339,8 @@ void BaseTableView::configureTag(void) pol.append(QPointF(p1.x()-BaseObjectView::HorizSpacing, p2.y() + BaseObjectView::VertSpacing)); tag_body->setPolygon(pol); - tag_body->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::TAG)); - tag_body->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::TAG)); + tag_body->setPen(BaseObjectView::getBorderStyle(Attributes::TAG)); + tag_body->setBrush(BaseObjectView::getFillStyle(Attributes::TAG)); tag_name->setPos(-5, bottom - 1.5f); tag_body->setPos(-5, bottom - 1.5f); diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 646eae46c0..a300c2a7d8 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -40,8 +40,8 @@ void GraphicalView::configureObject(void) vector tab_objs; QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; - QString attribs[]={ ParsersAttributes::VIEW_BODY, ParsersAttributes::VIEW_EXT_BODY }, - tag_attribs[]={ ParsersAttributes::TABLE_BODY, ParsersAttributes::TABLE_EXT_BODY }; + QString attribs[]={ Attributes::VIEW_BODY, Attributes::VIEW_EXT_BODY }, + tag_attribs[]={ Attributes::TABLE_BODY, Attributes::TABLE_EXT_BODY }; double width, type_width=0, px=0; TableObjectView *col_item=nullptr; QList col_items; diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index e0863dc79f..86b75bdee2 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -825,8 +825,8 @@ void ObjectsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) pol.append(QPointF(event->scenePos().x(), event->scenePos().y())); pol.append(QPointF(sel_ini_pnt.x(), event->scenePos().y())); selection_rect->setPolygon(pol); - selection_rect->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::OBJ_SELECTION)); - selection_rect->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::OBJ_SELECTION)); + selection_rect->setBrush(BaseObjectView::getFillStyle(Attributes::OBJ_SELECTION)); + selection_rect->setPen(BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION)); } } } diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index fc7c3dc05d..756bf2bee5 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -249,11 +249,11 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant //Alter the relationship line color when it is selected if(line_color==Qt::transparent) - line_color=BaseObjectView::getBorderStyle(ParsersAttributes::RELATIONSHIP).color(); + line_color=BaseObjectView::getBorderStyle(Attributes::RELATIONSHIP).color(); if(value.toBool()) { - QColor cor1=BaseObjectView::getBorderStyle(ParsersAttributes::OBJ_SELECTION).color(), + QColor cor1=BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION).color(), cor2=line_color; color.setRedF((cor1.redF() + cor2.greenF())/2.0f); @@ -288,7 +288,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant { vector lines; QVector grad_stops = descriptor->brush().gradient()->stops(); - QColor sel_color = BaseObjectView::getBorderStyle(ParsersAttributes::OBJ_SELECTION).color(); + QColor sel_color = BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION).color(); QLinearGradient grad(QPointF(0,0),QPointF(0,1)); int color_id = 0; @@ -606,7 +606,7 @@ void RelationshipView::configureLine(void) if(base_rel->isSelfRelationship()) { - double fnt_factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize, + double fnt_factor=font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize, pos_factor = 0, offset = 0; unsigned rel_cnt = tables[0]->getConnectedRelsCount(base_rel->getTable(BaseRelationship::SrcTable), base_rel->getTable(BaseRelationship::DstTable)); @@ -812,8 +812,8 @@ void RelationshipView::configureLine(void) graph_points.push_back(pol); pol->setZValue(0); pol->setPolygon(pol_aux); - pol->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::OBJ_SELECTION)); - pol->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::OBJ_SELECTION)); + pol->setBrush(BaseObjectView::getFillStyle(Attributes::OBJ_SELECTION)); + pol->setPen(BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION)); this->addToGroup(pol); } else @@ -850,7 +850,7 @@ void RelationshipView::configureLine(void) QPolygonF pol; QLineF edge, line = QLineF(tables[0]->getCenter(), tables[1]->getCenter()); QPointF pi, center, p_aux[2]; - double font_factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(), + double font_factor=(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(), size_factor = 1, border_factor = ConnLineLength * 0.30, min_lim = 0, max_lim = 0, @@ -1005,7 +1005,7 @@ void RelationshipView::configureLine(void) pen.setColor(base_rel->getCustomColor()); else //Using the default color - pen=BaseObjectView::getBorderStyle(ParsersAttributes::RELATIONSHIP); + pen=BaseObjectView::getBorderStyle(Attributes::RELATIONSHIP); } //For dependency/partition relationships the line is dashed @@ -1271,7 +1271,7 @@ void RelationshipView::configureDescriptor(void) Relationship *rel=dynamic_cast(base_rel); unsigned rel_type=base_rel->getRelationshipType(); double x, y, x1, y1, angle = 0, - factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); + factor=(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); QPen pen; QPointF pnt; vector points=base_rel->getPoints(); @@ -1284,7 +1284,7 @@ void RelationshipView::configureDescriptor(void) pen.setColor(base_rel->getCustomColor()); else //Using the default color - pen=BaseObjectView::getBorderStyle(ParsersAttributes::RELATIONSHIP); + pen=BaseObjectView::getBorderStyle(Attributes::RELATIONSHIP); if(rel_type==BaseRelationship::RelationshipDep || rel_type == BaseRelationship::RelationshipPart) @@ -1296,7 +1296,7 @@ void RelationshipView::configureDescriptor(void) { QColor colors[2]; QLinearGradient grad; - BaseObjectView::getFillStyle(ParsersAttributes::RELATIONSHIP, colors[0], colors[1]); + BaseObjectView::getFillStyle(Attributes::RELATIONSHIP, colors[0], colors[1]); for(unsigned i=0; i < 2; i++) { @@ -1310,7 +1310,7 @@ void RelationshipView::configureDescriptor(void) descriptor->setBrush(grad); } else - descriptor->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::RELATIONSHIP)); + descriptor->setBrush(BaseObjectView::getFillStyle(Attributes::RELATIONSHIP)); if(rel_type==BaseRelationship::RelationshipDep || rel_type==BaseRelationship::RelationshipGen) @@ -1415,8 +1415,8 @@ void RelationshipView::configureDescriptor(void) pol_item->setPolygon(pol); pol_item->setTransformOriginPoint(obj_selection->boundingRect().center()); pol_item->setPos(x,y); - pol_item->setBrush(this->getFillStyle(ParsersAttributes::OBJ_SELECTION)); - pol_item->setPen(this->getBorderStyle(ParsersAttributes::OBJ_SELECTION)); + pol_item->setBrush(this->getFillStyle(Attributes::OBJ_SELECTION)); + pol_item->setPen(this->getBorderStyle(Attributes::OBJ_SELECTION)); pol_item=dynamic_cast(obj_shadow); pol_item->setPolygon(pol); @@ -1468,7 +1468,7 @@ void RelationshipView::configureCrowsFootDescriptors(void) QGraphicsLineItem *line_item = nullptr; QGraphicsEllipseItem *circle_item = nullptr; unsigned rel_type = base_rel->getRelationshipType(); - double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); + double factor=(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); int signal = 1; BaseTableView *tables[2] = { nullptr, nullptr }; bool mandatory[2] = { false, false }; @@ -1715,9 +1715,9 @@ void RelationshipView::configureAttributes(void) QRectF rect; QPolygonF pol; double py, px, - factor=font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize; + factor=font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize; - fmt=font_config[ParsersAttributes::Attribute]; + fmt=font_config[Attributes::Attribute]; font=fmt.font(); font.setPointSizeF(font.pointSizeF() * 0.80f); @@ -1772,13 +1772,13 @@ void RelationshipView::configureAttributes(void) } desc->setRect(rect); - desc->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::Attribute)); - desc->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::Attribute)); + desc->setPen(BaseObjectView::getBorderStyle(Attributes::Attribute)); + desc->setBrush(BaseObjectView::getFillStyle(Attributes::Attribute)); lin->setPen(descriptor->pen()); text->setBrush(fmt.foreground()); text->setFont(font); - sel_attrib->setPen(BaseObjectView::getBorderStyle(ParsersAttributes::OBJ_SELECTION)); - sel_attrib->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::OBJ_SELECTION)); + sel_attrib->setPen(BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION)); + sel_attrib->setBrush(BaseObjectView::getFillStyle(Attributes::OBJ_SELECTION)); attrib->setPos(px, py); @@ -2004,11 +2004,11 @@ void RelationshipView::configureLabelPosition(unsigned label_id, double x, doubl labels[label_id]->setPos(x,y); labels[label_id]->setToolTip(this->toolTip()); - char_fmt=BaseObjectView::getFontStyle(ParsersAttributes::LABEL); + char_fmt=BaseObjectView::getFontStyle(Attributes::LABEL); char_fmt.setFontPointSize(char_fmt.fontPointSize() * 0.90); labels[label_id]->setFontStyle(char_fmt); - labels[label_id]->setColorStyle(BaseObjectView::getFillStyle(ParsersAttributes::LABEL), - BaseObjectView::getBorderStyle(ParsersAttributes::LABEL)); + labels[label_id]->setColorStyle(BaseObjectView::getFillStyle(Attributes::LABEL), + BaseObjectView::getBorderStyle(Attributes::LABEL)); dynamic_cast(labels[label_id]->getSourceObject())->setModified(true); } } diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index af68baf379..ded4af9b11 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -201,7 +201,7 @@ void SchemaView::configureObject(void) //Configures the schema name at the top sch_name->setText(compact_view && !schema->getAlias().isEmpty() ? schema->getAlias() : schema->getName()); - font=BaseObjectView::getFontStyle(ParsersAttributes::GLOBAL).font(); + font=BaseObjectView::getFontStyle(Attributes::GLOBAL).font(); font.setItalic(true); font.setBold(true); font.setPointSizeF(font.pointSizeF() * 1.3f); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 0d51210e9e..3ffd8c3adc 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -57,7 +57,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) ObjectType obj_type=ObjectType::BaseObject; Column *column=dynamic_cast(this->getSourceObject()); bool ellipse_desc=false; - double factor=(font_config[ParsersAttributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); + double factor=(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); QPen pen; //Based upon the source object type the descriptor is allocated @@ -98,9 +98,9 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0f * factor, 9.0f * factor))); if(column->isNotNull()) - attrib=ParsersAttributes::NN_COLUMN; + attrib=Attributes::NN_COLUMN; else - attrib=ParsersAttributes::COLUMN; + attrib=Attributes::Column; desc->setBrush(this->getFillStyle(attrib)); @@ -114,7 +114,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) if(constr_type==ConstraintType::PrimaryKey) { - attrib=ParsersAttributes::PK_COLUMN; + attrib=Attributes::PK_COLUMN; pol.append(QPointF(2,0)); pol.append(QPointF(0,2)); pol.append(QPointF(0,7)); pol.append(QPointF(2,9)); pol.append(QPointF(3,8)); pol.append(QPointF(3,6)); pol.append(QPointF(4,6)); pol.append(QPointF(5,7)); pol.append(QPointF(6,6)); @@ -123,7 +123,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) } else if(constr_type==ConstraintType::ForeignKey) { - attrib=ParsersAttributes::FK_COLUMN; + attrib=Attributes::FK_COLUMN; pol.append(QPointF(0,3)); pol.append(QPointF(0,6)); pol.append(QPointF(4,6)); pol.append(QPointF(4,9)); pol.append(QPointF(5,9)); pol.append(QPointF(9,5)); pol.append(QPointF(9,4)); pol.append(QPointF(5,0)); pol.append(QPointF(4,0)); @@ -131,7 +131,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) } else if(constr_type==ConstraintType::Unique) { - attrib=ParsersAttributes::UQ_COLUMN; + attrib=Attributes::UQ_COLUMN; pol.append(QPointF(4,0)); pol.append(QPointF(0,4)); pol.append(QPointF(0,5)); pol.append(QPointF(4,9)); pol.append(QPointF(5,9)); pol.append(QPointF(9,5)); pol.append(QPointF(9,4)); pol.append(QPointF(5,0)); @@ -176,9 +176,9 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) QGraphicsEllipseItem *desc=dynamic_cast(descriptor); desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0f * factor, 9.0f * factor))); - desc->setBrush(this->getFillStyle(ParsersAttributes::REFERENCE)); + desc->setBrush(this->getFillStyle(Attributes::REFERENCE)); - pen = this->getBorderStyle(ParsersAttributes::REFERENCE); + pen = this->getBorderStyle(Attributes::REFERENCE); pen.setWidthF(ObjectBorderWidth * 1.15f); desc->setPen(pen); } @@ -209,28 +209,28 @@ void TableObjectView::configureObject(void) if(str_constr.indexOf(TextPrimaryKey)>=0) { - fmt=font_config[ParsersAttributes::PK_COLUMN]; + fmt=font_config[Attributes::PK_COLUMN]; constr_type=ConstraintType::PrimaryKey; } else if(str_constr.indexOf(TextForeignKey)>=0) { - fmt=font_config[ParsersAttributes::FK_COLUMN]; + fmt=font_config[Attributes::FK_COLUMN]; constr_type=ConstraintType::ForeignKey; } else if(str_constr.indexOf(TextUnique)>=0) { - fmt=font_config[ParsersAttributes::UQ_COLUMN]; + fmt=font_config[Attributes::UQ_COLUMN]; constr_type=ConstraintType::Unique; } else if(str_constr.indexOf(TextNotNull)>=0) - fmt=font_config[ParsersAttributes::NN_COLUMN]; + fmt=font_config[Attributes::NN_COLUMN]; else - fmt=font_config[ParsersAttributes::COLUMN]; + fmt=font_config[Attributes::Column]; if(column->isAddedByRelationship()) - fmt=font_config[ParsersAttributes::INH_COLUMN]; + fmt=font_config[Attributes::INH_COLUMN]; else if(column->isProtected()) - fmt=font_config[ParsersAttributes::PROT_COLUMN]; + fmt=font_config[Attributes::PROT_COLUMN]; if(str_constr.indexOf(TextPrimaryKey)>=0) atribs_tip+=(~ConstraintType(ConstraintType::PrimaryKey)).toLower() + QString(", "); @@ -250,9 +250,9 @@ void TableObjectView::configureObject(void) else { if(tab_obj->isAddedByRelationship()) - fmt=font_config[ParsersAttributes::INH_COLUMN]; + fmt=font_config[Attributes::INH_COLUMN]; else if(tab_obj->isProtected()) - fmt=font_config[ParsersAttributes::PROT_COLUMN]; + fmt=font_config[Attributes::PROT_COLUMN]; else fmt=font_config[tab_obj->getSchemaName()]; } @@ -277,7 +277,7 @@ void TableObjectView::configureObject(void) px+=lables[0]->boundingRect().width(); //Configuring the type label - fmt=font_config[ParsersAttributes::OBJECT_TYPE]; + fmt=font_config[Attributes::OBJECT_TYPE]; if(compact_view) lables[1]->setText(" "); @@ -295,7 +295,7 @@ void TableObjectView::configureObject(void) px+=lables[1]->boundingRect().width() + (3 * HorizSpacing); //Configuring the constraints label - fmt=font_config[ParsersAttributes::CONSTRAINTS]; + fmt=font_config[Attributes::Constraints]; if(compact_view) lables[2]->setText(" "); else if(column) @@ -447,7 +447,7 @@ void TableObjectView::configureObject(Reference reference) if(reference.getReferenceType()==Reference::ReferColumn) { //Configures the name label as: [table].[column] - fmt=font_config[ParsersAttributes::REF_TABLE]; + fmt=font_config[Attributes::REF_TABLE]; if(compact_view && !reference.getReferenceAlias().isEmpty()) lables[0]->setText(reference.getReferenceAlias()); @@ -459,7 +459,7 @@ void TableObjectView::configureObject(Reference reference) lables[0]->setPos(px, 0); px+=lables[0]->boundingRect().width(); - fmt=font_config[ParsersAttributes::REF_COLUMN]; + fmt=font_config[Attributes::REF_COLUMN]; if(compact_view && !reference.getReferenceAlias().isEmpty()) lables[1]->setText(QString(" ")); else @@ -477,7 +477,7 @@ void TableObjectView::configureObject(Reference reference) } else { - fmt=font_config[ParsersAttributes::REF_TABLE]; + fmt=font_config[Attributes::REF_TABLE]; str_aux = compact_view && !reference.getReferenceAlias().isEmpty() ? reference.getReferenceAlias() : QString(); if(str_aux.isEmpty()) @@ -506,7 +506,7 @@ void TableObjectView::configureObject(Reference reference) str_aux=reference.getColumnAlias(); str_aux=QString(" (") + str_aux + QString(") "); - fmt=font_config[ParsersAttributes::Alias]; + fmt=font_config[Attributes::Alias]; lables[2]->setText(str_aux); lables[2]->setFont(fmt.font()); lables[2]->setBrush(fmt.foreground()); diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index d510388263..894351e14f 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -69,15 +69,15 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(object->getObjectType()==ObjectType::View && !tag) { - name_attrib=ParsersAttributes::VIEW_NAME; - schema_name_attrib=ParsersAttributes::VIEW_SCHEMA_NAME; - title_color_attrib=ParsersAttributes::VIEW_TITLE; + name_attrib=Attributes::VIEW_NAME; + schema_name_attrib=Attributes::VIEW_SCHEMA_NAME; + title_color_attrib=Attributes::VIEW_TITLE; } else { - name_attrib=ParsersAttributes::TABLE_NAME; - schema_name_attrib=ParsersAttributes::TABLE_SCHEMA_NAME; - title_color_attrib=ParsersAttributes::TABLE_TITLE; + name_attrib=Attributes::TABLE_NAME; + schema_name_attrib=Attributes::TABLE_SCHEMA_NAME; + title_color_attrib=Attributes::TABLE_TITLE; } //Strike out the table name when its sql is disabled diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 7c79a76042..48cefa924d 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -37,7 +37,7 @@ void TableView::configureObject(void) QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; vector tab_objs; - QString atribs[]={ ParsersAttributes::TABLE_BODY, ParsersAttributes::TABLE_EXT_BODY }; + QString atribs[]={ Attributes::TABLE_BODY, Attributes::TABLE_EXT_BODY }; Tag *tag=table->getTag(); //Configures the table title diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index fe5a4430bf..731cda60cb 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -78,7 +78,7 @@ void TextboxView::setToolTip(const QString &tooltip) void TextboxView::__configureObject(void) { Textbox *txtbox=dynamic_cast(this->getSourceObject()); - QTextCharFormat fmt=font_config[ParsersAttributes::GLOBAL]; + QTextCharFormat fmt=font_config[Attributes::GLOBAL]; QPolygonF polygon; polygon.append(QPointF(0.0f,0.0f)); @@ -149,6 +149,6 @@ void TextboxView::configureObjectSelection(void) pol_item->setPolygon(box->polygon()); pol_item->setPos(0,0); - pol_item->setBrush(this->getFillStyle(ParsersAttributes::OBJ_SELECTION)); - pol_item->setPen(this->getBorderStyle(ParsersAttributes::OBJ_SELECTION)); + pol_item->setBrush(this->getFillStyle(Attributes::OBJ_SELECTION)); + pol_item->setPen(this->getBorderStyle(Attributes::OBJ_SELECTION)); } diff --git a/libparsers/libparsers.pro b/libparsers/libparsers.pro index c79ab53714..0a1d08891d 100644 --- a/libparsers/libparsers.pro +++ b/libparsers/libparsers.pro @@ -16,11 +16,11 @@ windows: DESTDIR = $$PWD HEADERS += src/schemaparser.h \ src/xmlparser.h \ src/attribsmap.h \ - src/parsersattributes.h + src/attributes.h SOURCES += src/schemaparser.cpp \ src/xmlparser.cpp \ - src/parsersattributes.cpp + src/attributes.cpp unix|windows: LIBS += -L$$OUT_PWD/../libutils/ -lutils $$XML_LIB diff --git a/libparsers/src/parsersattributes.cpp b/libparsers/src/attributes.cpp similarity index 89% rename from libparsers/src/parsersattributes.cpp rename to libparsers/src/attributes.cpp index fbfa662920..de788a903b 100644 --- a/libparsers/src/parsersattributes.cpp +++ b/libparsers/src/attributes.cpp @@ -16,9 +16,9 @@ # Also), you can get the complete GNU General Public License at */ -#include "parsersattributes.h" +#include "attributes.h" -namespace ParsersAttributes { +namespace Attributes { const QString False=QString("false"), File=QString("file"), @@ -76,63 +76,63 @@ namespace ParsersAttributes { CodeFontSize=QString("code-font-size"), CodeFont=QString("code-font"), CodeTabWidth=QString("code-tab-width"), - COL_INDEXES=QString("col-indexes"), - COLLATABLE=QString("collatable"), - COLLATION=QString("collation"), - COLLATIONS=QString("collations"), - COLOR=QString("color"), - COLORS=QString("colors"), - COLS_COMMENT=QString("cols-comment"), - COL_IS_IDENTITY=QString("col-is-identity"), - COLUMN_ALIAS=QString("column-alias"), - COLUMN=QString("column"), - COLUMNS=QString("columns"), - COMMAND=QString("command"), - COMMANDS=QString("commands"), - COMMENT=QString("comment"), - COMMUTATOR_OP=QString("commutator-op"), - COMPARISON_TYPE=QString("comparison-type"), - COMPACT_VIEW=QString("compact-view"), - COMPLETION_TRIGGER=QString("completion-trigger"), - COMPOSITE_TYPE=QString("composite"), - CONCURRENT=QString("concurrent"), - CONDITION=QString("condition"), - CONFIG_FILE=QString("config-file"), - CONFIGURATION=QString("configuration"), - CONFIRM_VALIDATION=QString("confirm-validation"), - CONN_LIMIT=QString("connlimit"), - CONNECT_CENTER_PNTS=QString("center-pnts"), - CONNECT_FK_TO_PK=QString("fk-to-pk"), - CONNECT_TABLE_EDGES=QString("table-edges"), - CONNECT_PRIV=QString("connect"), - CONNECTION=QString("connection"), - CONNECTIONS=QString("connections"), - CONNECTION_TIMEOUT=QString("connection-timeout"), - CONSTR_INDEXES=QString("constr-indexes"), - CONSTR_SQL_DISABLED=QString("constr-sql-disabled"), - CONSTRAINT=QString("constraint"), - CONSTRAINTS=QString("constraints"), - CONSTR_DEFS=QString("constr-defs"), - CONTENTS=QString("contents"), - COPY_MODE=QString("copy-mode"), - COPY_OPTIONS=QString("copy-options"), - COPY_TABLE=QString("copy-table"), - CREATE_CMDS=QString("create-cmds"), - CREATE_PRIV=QString("create"), - CREATE=QString("create"), - CREATEDB=QString("createdb"), - CREATEROLE=QString("createrole"), - CROWS_FOOT=QString("crows-foot"), - CTE_EXPRESSION=QString("cte-exp"), - CUR_VERSION=QString("cur-version"), - CUR_IDENTITY_TYPE=QString("cur-identity-type"), - CUSTOM_COLOR=QString("custom-color"), - CUSTOM_FILTER=QString("custom-filter"), - CUSTOMIDXS=QString("customidxs"), - CYCLE=QString("cycle"), - DATA_DIRECTORY=QString("data-directory"), - DATE=QString("date"), - DATABASE=QString("database"), + ColIndexes=QString("col-indexes"), + Collatable=QString("collatable"), + Collation=QString("collation"), + Collations=QString("collations"), + Color=QString("color"), + Colors=QString("colors"), + ColsComment=QString("cols-comment"), + ColIsIdentity=QString("col-is-identity"), + ColumnAlias=QString("column-alias"), + Column=QString("column"), + Columns=QString("columns"), + Command=QString("command"), + Commands=QString("commands"), + Comment=QString("comment"), + CommutatorOp=QString("commutator-op"), + ComparisonType=QString("comparison-type"), + CompactView=QString("compact-view"), + CompletionTrigger=QString("completion-trigger"), + CompositeType=QString("composite"), + Concurrent=QString("concurrent"), + Condition=QString("condition"), + ConfigFile=QString("config-file"), + Configuration=QString("configuration"), + ConfirmValidation=QString("confirm-validation"), + ConnLimit=QString("connlimit"), + ConnectCenterPnts=QString("center-pnts"), + ConnectFkToPk=QString("fk-to-pk"), + ConnectTableEdges=QString("table-edges"), + ConnectPriv=QString("connect"), + Connection=QString("connection"), + Connections=QString("connections"), + ConnectionTimeout=QString("connection-timeout"), + ConstrIndexes=QString("constr-indexes"), + ConstrSqlDisabled=QString("constr-sql-disabled"), + Constraint=QString("constraint"), + Constraints=QString("constraints"), + ConstrDefs=QString("constr-defs"), + Contents=QString("contents"), + CopyMode=QString("copy-mode"), + CopyOptions=QString("copy-options"), + CopyTable=QString("copy-table"), + CreateCmds=QString("create-cmds"), + CreatePriv=QString("create"), + Create=QString("create"), + CreateDb=QString("createdb"), + CreateRole=QString("createrole"), + CrowsFoot=QString("crows-foot"), + CteExpression=QString("cte-exp"), + CurVersion=QString("cur-version"), + CurIdentityType=QString("cur-identity-type"), + CustomColor=QString("custom-color"), + CustomFilter=QString("custom-filter"), + CustomIdxs=QString("customidxs"), + Cycle=QString("cycle"), + DataDirectory=QString("data-directory"), + Date=QString("date"), + Database=QString("database"), DB_MODEL=QString("dbmodel"), DDL_END_TOKEN=QString("-- ddl-end --"), DEAD_ROWS_AMOUNT=QString("dead-rows-amount"), diff --git a/libparsers/src/parsersattributes.h b/libparsers/src/attributes.h similarity index 89% rename from libparsers/src/parsersattributes.h rename to libparsers/src/attributes.h index 77c73bd268..d642dd42f2 100644 --- a/libparsers/src/parsersattributes.h +++ b/libparsers/src/attributes.h @@ -18,22 +18,22 @@ /** \ingroup libparsers -\namespace ParsersAttributes +\namespace Attributes \brief Definition of parsers attributes namespace which stores a series of static strings constants used to reference the attributes of objects in SQL/XML generation methods. Each string stores the name of the attribute used in the schema file "sch" of the respective objects. \note Creation date: 23/09/2008 */ -#ifndef PARSERS_ATTRIBUTES_H -#define PARSERS_ATTRIBUTES_H +#ifndef ATTRIBUTES_H +#define ATTRIBUTES_H /* Including QByteArray due to 'QByteArray has no toStdString()' error on Qt 5.4 (Windows only) */ #include #include -namespace ParsersAttributes { +namespace Attributes { extern const QString False, File, @@ -91,63 +91,63 @@ namespace ParsersAttributes { CodeFontSize, CodeFont, CodeTabWidth, - COL_INDEXES, - COLLATABLE, - COLLATION, - COLLATIONS, - COLOR, - COLORS, - COLS_COMMENT, - COL_IS_IDENTITY, - COLUMN_ALIAS, - COLUMN, - COLUMNS, - COMMAND, - COMMANDS, - COMMENT, - COMMUTATOR_OP, - COMPARISON_TYPE, - COMPACT_VIEW, - COMPLETION_TRIGGER, - COMPOSITE_TYPE, - CONCURRENT, - CONDITION, - CONFIGURATION, - CONFIG_FILE, - CONFIRM_VALIDATION, - CONN_LIMIT, - CONNECT_CENTER_PNTS, - CONNECT_FK_TO_PK, - CONNECT_TABLE_EDGES, - CONNECT_PRIV, - CONNECTION, - CONNECTIONS, - CONNECTION_TIMEOUT, - CONSTR_DEFS, - CONSTR_INDEXES, - CONSTR_SQL_DISABLED, - CONSTRAINT, - CONSTRAINTS, - CONTENTS, - COPY_MODE, - COPY_OPTIONS, - COPY_TABLE, - CREATE_CMDS, - CREATE_PRIV, - CREATE, - CREATEDB, - CREATEROLE, - CROWS_FOOT, - CTE_EXPRESSION, - CUR_VERSION, - CUR_IDENTITY_TYPE, - CUSTOM_COLOR, - CUSTOM_FILTER, - CUSTOMIDXS, - CYCLE, - DATABASE, - DATA_DIRECTORY, - DATE, + ColIndexes, + Collatable, + Collation, + Collations, + Color, + Colors, + ColsComment, + ColIsIdentity, + ColumnAlias, + Column, + Columns, + Command, + Commands, + Comment, + CommutatorOp, + ComparisonType, + CompactView, + CompletionTrigger, + CompositeType, + Concurrent, + Condition, + Configuration, + ConfigFile, + ConfirmValidation, + ConnLimit, + ConnectCenterPnts, + ConnectFkToPk, + ConnectTableEdges, + ConnectPriv, + Connection, + Connections, + ConnectionTimeout, + ConstrDefs, + ConstrIndexes, + ConstrSqlDisabled, + Constraint, + Constraints, + Contents, + CopyMode, + CopyOptions, + CopyTable, + CreateCmds, + CreatePriv, + Create, + CreateDb, + CreateRole, + CrowsFoot, + CteExpression, + CurVersion, + CurIdentityType, + CustomColor, + CustomFilter, + CustomIdxs, + Cycle, + Database, + DataDirectory, + Date, DB_MODEL, DDL_END_TOKEN, DEAD_ROWS_AMOUNT, diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 39763a6515..984a967ab0 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -17,7 +17,7 @@ */ #include "schemaparser.h" -#include "parsersattributes.h" +#include "attributes.h" const char SchemaParser::CharComment='#'; const char SchemaParser::CharLineEnd='\n'; @@ -891,7 +891,7 @@ QString SchemaParser::getCodeDefinition(const QString & obj_name, attribs_map &a filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::SQLSchemaDir + GlobalAttributes::DirSeparator + obj_name + GlobalAttributes::SchemaExt; - attribs[ParsersAttributes::PGSQL_VERSION]=pgsql_version; + attribs[Attributes::PGSQL_VERSION]=pgsql_version; //Try to get the object definitin from the specified path return(getCodeDefinition(filename, attribs)); @@ -1431,7 +1431,7 @@ QString SchemaParser::getCodeDefinition(const QString &filename, attribs_map &at try { loadFile(filename); - attribs[ParsersAttributes::PGSQL_VERSION]=pgsql_version; + attribs[Attributes::PGSQL_VERSION]=pgsql_version; return(getCodeDefinition(attribs)); } catch(Exception &e) diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 2085a4b858..f1c3811aa3 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -85,12 +85,12 @@ void Catalog::setConnection(Connection &conn) //Retrieving the last system oid executeCatalogQuery(QueryList, ObjectType::Database, res, true, - {{ParsersAttributes::NAME, conn.getConnectionParam(Connection::ParamDbName)}}); + {{Attributes::NAME, conn.getConnectionParam(Connection::ParamDbName)}}); if(res.accessTuple(ResultSet::FirstTuple)) { attribs_map attribs=changeAttributeNames(res.getTupleValues()); - last_sys_oid=attribs[ParsersAttributes::LAST_SYS_OID].toUInt(); + last_sys_oid=attribs[Attributes::LAST_SYS_OID].toUInt(); } //Retrieving the list of objects created by extensions @@ -182,44 +182,44 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b * due to support to this char in the middle of objects' names */ for(auto &attr : attribs) { - if(attr.first != ParsersAttributes::CUSTOM_FILTER && attr.second.contains(QChar('\''))) + if(attr.first != Attributes::CustomFilter && attr.second.contains(QChar('\''))) attr.second.replace(QChar('\''), QString("''")); } schparser.setPgSQLVersion(connection.getPgSQLVersion(true)); - attribs[qry_type]=ParsersAttributes::True; + attribs[qry_type]=Attributes::True; if(exclude_sys_objs || list_only_sys_objs) - attribs[ParsersAttributes::LAST_SYS_OID]=QString("%1").arg(last_sys_oid); + attribs[Attributes::LAST_SYS_OID]=QString("%1").arg(last_sys_oid); if(list_only_sys_objs) - attribs[ParsersAttributes::OID_FILTER_OP]=QString("<="); + attribs[Attributes::OID_FILTER_OP]=QString("<="); else - attribs[ParsersAttributes::OID_FILTER_OP]=QString(">"); + attribs[Attributes::OID_FILTER_OP]=QString(">"); if(obj_type==ObjectType::Type && exclude_array_types) - attribs[ParsersAttributes::EXC_BUILTIN_ARRAYS]=ParsersAttributes::True; + attribs[Attributes::EXC_BUILTIN_ARRAYS]=Attributes::True; //Checking if the custom filter expression is present - if(attribs.count(ParsersAttributes::CUSTOM_FILTER)) + if(attribs.count(Attributes::CustomFilter)) { - custom_filter=attribs[ParsersAttributes::CUSTOM_FILTER]; - attribs.erase(ParsersAttributes::CUSTOM_FILTER); + custom_filter=attribs[Attributes::CustomFilter]; + attribs.erase(Attributes::CustomFilter); } if(exclude_ext_objs && obj_type!=ObjectType::Database && obj_type!=ObjectType::Role && obj_type!=ObjectType::Tablespace && obj_type!=ObjectType::Extension) { if(ext_oid_fields.count(obj_type)==0) - attribs[ParsersAttributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(oid_fields[obj_type]); + attribs[Attributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(oid_fields[obj_type]); else - attribs[ParsersAttributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(ext_oid_fields[obj_type]); + attribs[Attributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(ext_oid_fields[obj_type]); } loadCatalogQuery(BaseObject::getSchemaName(obj_type)); schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - attribs[ParsersAttributes::PGSQL_VERSION]=schparser.getPgSQLVersion(); + attribs[Attributes::PGSQL_VERSION]=schparser.getPgSQLVersion(); sql=schparser.getCodeDefinition(attribs).simplified(); //Appeding the custom filter to the whole catalog query @@ -265,8 +265,8 @@ unsigned Catalog::getObjectCount(ObjectType obj_type, const QString &sch_name, c { ResultSet res; - extra_attribs[ParsersAttributes::SCHEMA]=sch_name; - extra_attribs[ParsersAttributes::TABLE]=tab_name; + extra_attribs[Attributes::SCHEMA]=sch_name; + extra_attribs[Attributes::TABLE]=tab_name; executeCatalogQuery(QueryList, obj_type, res, false, extra_attribs); res.accessTuple(ResultSet::FirstTuple); @@ -312,7 +312,7 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map Catalog::getObjectsNames(vector obj_types, const QStringList queries; attribs_map attribs; - extra_attribs[ParsersAttributes::SCHEMA]=sch_name; - extra_attribs[ParsersAttributes::TABLE]=tab_name; + extra_attribs[Attributes::SCHEMA]=sch_name; + extra_attribs[Attributes::TABLE]=tab_name; for(ObjectType obj_type : obj_types) { @@ -398,9 +398,9 @@ vector Catalog::getObjectsNames(vector obj_types, const { do { - attribs[ParsersAttributes::OID]=res.getColumnValue(ParsersAttributes::OID); - attribs[ParsersAttributes::NAME]=res.getColumnValue(ParsersAttributes::NAME); - attribs[ParsersAttributes::OBJECT_TYPE]=res.getColumnValue(QString("object_type")); + attribs[Attributes::OID]=res.getColumnValue(Attributes::OID); + attribs[Attributes::NAME]=res.getColumnValue(Attributes::NAME); + attribs[Attributes::OBJECT_TYPE]=res.getColumnValue(QString("object_type")); objects.push_back(attribs); attribs.clear(); } @@ -423,7 +423,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, attribs_map obj_attribs; //Add the name of the object as extra attrib in order to retrieve the data only for it - extra_attribs[ParsersAttributes::NAME]=obj_name; + extra_attribs[Attributes::NAME]=obj_name; executeCatalogQuery(QueryAttribs, obj_type, res, true, extra_attribs); if(res.accessTuple(ResultSet::FirstTuple)) @@ -431,7 +431,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, /* Insert the object type as an attribute of the query result to facilitate the import process on the classes that uses the Catalog */ - obj_attribs[ParsersAttributes::OBJECT_TYPE]=QString("%1").arg(~obj_type); + obj_attribs[Attributes::OBJECT_TYPE]=QString("%1").arg(~obj_type); return(obj_attribs); } @@ -458,7 +458,7 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ /* Insert the object type as an attribute of the query result to facilitate the import process on the classes that uses the Catalog */ - tuple[ParsersAttributes::OBJECT_TYPE]=QString("%1").arg(~obj_type); + tuple[Attributes::OBJECT_TYPE]=QString("%1").arg(~obj_type); obj_attribs.push_back(tuple); tuple.clear(); @@ -486,7 +486,7 @@ vector Catalog::getMultipleAttributes(const QString &catalog_sch, a schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - attribs[ParsersAttributes::PGSQL_VERSION]=schparser.getPgSQLVersion(); + attribs[Attributes::PGSQL_VERSION]=schparser.getPgSQLVersion(); connection.executeDMLCommand(schparser.getCodeDefinition(attribs).simplified(), res); if(res.accessTuple(ResultSet::FirstTuple)) @@ -510,12 +510,12 @@ vector Catalog::getMultipleAttributes(const QString &catalog_sch, a QString Catalog::getCommentQuery(const QString &oid_field, bool is_shared_obj) { - QString query_id=ParsersAttributes::COMMENT; + QString query_id=Attributes::Comment; try { - attribs_map attribs={{ParsersAttributes::OID, oid_field}, - {ParsersAttributes::SHARED_OBJ, (is_shared_obj ? ParsersAttributes::True : QString())}}; + attribs_map attribs={{Attributes::OID, oid_field}, + {Attributes::SHARED_OBJ, (is_shared_obj ? Attributes::True : QString())}}; loadCatalogQuery(query_id); return(schparser.getCodeDefinition(attribs).simplified()); @@ -533,8 +533,8 @@ QString Catalog::getNotExtObjectQuery(const QString &oid_field) try { - attribs_map attribs={{ParsersAttributes::OID, oid_field}, - {ParsersAttributes::EXT_OBJ_OIDS, ext_obj_oids}}; + attribs_map attribs={{Attributes::OID, oid_field}, + {Attributes::EXT_OBJ_OIDS, ext_obj_oids}}; loadCatalogQuery(query_id); @@ -562,7 +562,7 @@ attribs_map Catalog::changeAttributeNames(const attribs_map &attribs) { attr_name.remove(BoolField); if(value==PgSqlFalse) value.clear(); - else value=ParsersAttributes::True; + else value=Attributes::True; } attr_name.replace('_','-'); @@ -593,15 +593,15 @@ vector Catalog::getObjectsAttributes(ObjectType obj_type, const QSt bool is_shared_obj=(obj_type==ObjectType::Database || obj_type==ObjectType::Role || obj_type==ObjectType::Tablespace || obj_type==ObjectType::Language || obj_type==ObjectType::Cast); - extra_attribs[ParsersAttributes::SCHEMA]=schema; - extra_attribs[ParsersAttributes::TABLE]=table; + extra_attribs[Attributes::SCHEMA]=schema; + extra_attribs[Attributes::TABLE]=table; if(!filter_oids.empty()) - extra_attribs[ParsersAttributes::FILTER_OIDS]=createOidFilter(filter_oids); + extra_attribs[Attributes::FILTER_OIDS]=createOidFilter(filter_oids); //Retrieve the comment catalog query. Only columns need to retreive comments in their own catalog query file if(obj_type != ObjectType::Column) - extra_attribs[ParsersAttributes::COMMENT]=getCommentQuery(oid_fields[obj_type], is_shared_obj); + extra_attribs[Attributes::Comment]=getCommentQuery(oid_fields[obj_type], is_shared_obj); return(getMultipleAttributes(obj_type, extra_attribs)); } @@ -633,9 +633,9 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS attribs_map attribs; ResultSet res; - attribs[ParsersAttributes::CUSTOM_FILTER] = QString("%1 = E'%2'").arg(name_fields[obj_type]).arg(name); - attribs[ParsersAttributes::SCHEMA] = schema; - attribs[ParsersAttributes::TABLE] = table; + attribs[Attributes::CustomFilter] = QString("%1 = E'%2'").arg(name_fields[obj_type]).arg(name); + attribs[Attributes::SCHEMA] = schema; + attribs[Attributes::TABLE] = table; executeCatalogQuery(QueryList, obj_type, res, false, attribs); if(res.getTupleCount() > 1) @@ -647,7 +647,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS else { res.accessTuple(ResultSet::FirstTuple); - return(res.getColumnValue(ParsersAttributes::OID)); + return(res.getColumnValue(Attributes::OID)); } } catch(Exception &e) @@ -678,13 +678,13 @@ attribs_map Catalog::getServerAttributes(void) do { tuple=res.getTupleValues(); - attr_name = tuple[ParsersAttributes::Attribute]; + attr_name = tuple[Attributes::Attribute]; attr_name.replace('_','-'); - attribs[attr_name]=tuple[ParsersAttributes::VALUE]; + attribs[attr_name]=tuple[Attributes::VALUE]; } while(res.accessTuple(ResultSet::NextTuple)); - attribs[ParsersAttributes::CONNECTION] = connection.getConnectionId(); + attribs[Attributes::Connection] = connection.getConnectionId(); attribs_aux = connection.getServerInfo(); attribs.insert(attribs_aux.begin(), attribs_aux.end()) ; } diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index bef7340aca..61f882ec6c 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -19,7 +19,7 @@ #include "connection.h" #include #include -#include "parsersattributes.h" +#include "attributes.h" const QString Connection::SslDisable=QString("disable"); const QString Connection::SslAllow=QString("allow"); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index f41072d0e7..6e5e4c9b34 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -23,13 +23,13 @@ Aggregate::Aggregate(void) obj_type=ObjectType::Aggregate; functions[0]=functions[1]=nullptr; sort_operator=nullptr; - attributes[ParsersAttributes::TYPES]=QString(); - attributes[ParsersAttributes::TRANSITION_FUNC]=QString(); - attributes[ParsersAttributes::STATE_TYPE]=QString(); - attributes[ParsersAttributes::BaseType]=QString(); - attributes[ParsersAttributes::FINAL_FUNC]=QString(); - attributes[ParsersAttributes::INITIAL_COND]=QString(); - attributes[ParsersAttributes::SORT_OP]=QString(); + attributes[Attributes::TYPES]=QString(); + attributes[Attributes::TRANSITION_FUNC]=QString(); + attributes[Attributes::STATE_TYPE]=QString(); + attributes[Attributes::BaseType]=QString(); + attributes[Attributes::FINAL_FUNC]=QString(); + attributes[Attributes::INITIAL_COND]=QString(); + attributes[Attributes::SORT_OP]=QString(); } void Aggregate::setFunction(unsigned func_idx, Function *func) @@ -155,7 +155,7 @@ void Aggregate::setTypesAttribute(unsigned def_type) an aggregate that accepts any possible data '*' e.g. function(*) */ if(def_type == SchemaParser::SqlDefinition && str_types.isEmpty()) str_types='*'; - attributes[ParsersAttributes::TYPES]=str_types; + attributes[Attributes::TYPES]=str_types; } void Aggregate::addDataType(PgSqlType type) @@ -229,42 +229,42 @@ QString Aggregate::getCodeDefinition(unsigned def_type) if(functions[TransitionFunc]) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::TRANSITION_FUNC]=functions[TransitionFunc]->getSignature(); + attributes[Attributes::TRANSITION_FUNC]=functions[TransitionFunc]->getSignature(); else { - functions[TransitionFunc]->setAttribute(ParsersAttributes::REF_TYPE, - ParsersAttributes::TRANSITION_FUNC); - attributes[ParsersAttributes::TRANSITION_FUNC]=functions[TransitionFunc]->getCodeDefinition(def_type,true); + functions[TransitionFunc]->setAttribute(Attributes::REF_TYPE, + Attributes::TRANSITION_FUNC); + attributes[Attributes::TRANSITION_FUNC]=functions[TransitionFunc]->getCodeDefinition(def_type,true); } } if(functions[FinalFunc]) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::FINAL_FUNC]=functions[FinalFunc]->getSignature(); + attributes[Attributes::FINAL_FUNC]=functions[FinalFunc]->getSignature(); else { - functions[FinalFunc]->setAttribute(ParsersAttributes::REF_TYPE, - ParsersAttributes::FINAL_FUNC); - attributes[ParsersAttributes::FINAL_FUNC]=functions[FinalFunc]->getCodeDefinition(def_type,true); + functions[FinalFunc]->setAttribute(Attributes::REF_TYPE, + Attributes::FINAL_FUNC); + attributes[Attributes::FINAL_FUNC]=functions[FinalFunc]->getCodeDefinition(def_type,true); } } if(sort_operator) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::SORT_OP]=sort_operator->getName(true); + attributes[Attributes::SORT_OP]=sort_operator->getName(true); else - attributes[ParsersAttributes::SORT_OP]=sort_operator->getCodeDefinition(def_type,true); + attributes[Attributes::SORT_OP]=sort_operator->getCodeDefinition(def_type,true); } if(!initial_condition.isEmpty()) - attributes[ParsersAttributes::INITIAL_COND]=initial_condition; + attributes[Attributes::INITIAL_COND]=initial_condition; if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::STATE_TYPE]=*(state_type); + attributes[Attributes::STATE_TYPE]=*(state_type); else - attributes[ParsersAttributes::STATE_TYPE]=state_type.getCodeDefinition(def_type,ParsersAttributes::STATE_TYPE); + attributes[Attributes::STATE_TYPE]=state_type.getCodeDefinition(def_type,Attributes::STATE_TYPE); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 68b1aee4a7..6d13321598 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -22,10 +22,10 @@ BaseGraphicObject::BaseGraphicObject(void) { is_modified=true; is_faded_out=false; - attributes[ParsersAttributes::X_POS]=QString(); - attributes[ParsersAttributes::Y_POS]=QString(); - attributes[ParsersAttributes::POSITION]=QString(); - attributes[ParsersAttributes::FADED_OUT]=QString(); + attributes[Attributes::X_POS]=QString(); + attributes[Attributes::Y_POS]=QString(); + attributes[Attributes::POSITION]=QString(); + attributes[Attributes::FADED_OUT]=QString(); receiver_object=nullptr; } @@ -76,14 +76,14 @@ bool BaseGraphicObject::isFadedOut(void) void BaseGraphicObject::setFadedOutAttribute(void) { - attributes[ParsersAttributes::FADED_OUT]=(is_faded_out ? ParsersAttributes::True : QString()); + attributes[Attributes::FADED_OUT]=(is_faded_out ? Attributes::True : QString()); } void BaseGraphicObject::setPositionAttribute(void) { - attributes[ParsersAttributes::X_POS]=QString("%1").arg(position.x()); - attributes[ParsersAttributes::Y_POS]=QString("%1").arg(position.y()); - attributes[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XmlDefinition); + attributes[Attributes::X_POS]=QString("%1").arg(position.x()); + attributes[Attributes::Y_POS]=QString("%1").arg(position.y()); + attributes[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, attributes, SchemaParser::XmlDefinition); } void BaseGraphicObject::setPosition(QPointF pos) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 01303134f6..2090e0bafc 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -82,19 +82,19 @@ BaseObject::BaseObject(void) tablespace=nullptr; database=nullptr; collation=nullptr; - attributes[ParsersAttributes::NAME]=QString(); - attributes[ParsersAttributes::Alias]=QString(); - attributes[ParsersAttributes::COMMENT]=QString(); - attributes[ParsersAttributes::OWNER]=QString(); - attributes[ParsersAttributes::TABLESPACE]=QString(); - attributes[ParsersAttributes::SCHEMA]=QString(); - attributes[ParsersAttributes::COLLATION]=QString(); - attributes[ParsersAttributes::PROTECTED]=QString(); - attributes[ParsersAttributes::SQL_DISABLED]=QString(); - attributes[ParsersAttributes::AppendedSql]=QString(); - attributes[ParsersAttributes::PREPENDED_SQL]=QString(); - attributes[ParsersAttributes::DROP]=QString(); - attributes[ParsersAttributes::SIGNATURE]=QString(); + attributes[Attributes::NAME]=QString(); + attributes[Attributes::Alias]=QString(); + attributes[Attributes::Comment]=QString(); + attributes[Attributes::OWNER]=QString(); + attributes[Attributes::TABLESPACE]=QString(); + attributes[Attributes::SCHEMA]=QString(); + attributes[Attributes::Collation]=QString(); + attributes[Attributes::PROTECTED]=QString(); + attributes[Attributes::SQL_DISABLED]=QString(); + attributes[Attributes::AppendedSql]=QString(); + attributes[Attributes::PREPENDED_SQL]=QString(); + attributes[Attributes::DROP]=QString(); + attributes[Attributes::SIGNATURE]=QString(); this->setName(QApplication::translate("BaseObject","new_object","", -1)); } @@ -674,17 +674,17 @@ bool BaseObject::isSystemObject(void) void BaseObject::setBasicAttributes(bool format_name) { - if(attributes[ParsersAttributes::NAME].isEmpty()) - attributes[ParsersAttributes::NAME]=this->getName(format_name); + if(attributes[Attributes::NAME].isEmpty()) + attributes[Attributes::NAME]=this->getName(format_name); - if(attributes[ParsersAttributes::Alias].isEmpty()) - attributes[ParsersAttributes::Alias]=this->getAlias(); + if(attributes[Attributes::Alias].isEmpty()) + attributes[Attributes::Alias]=this->getAlias(); - if(attributes[ParsersAttributes::SIGNATURE].isEmpty()) - attributes[ParsersAttributes::SIGNATURE]=this->getSignature(format_name); + if(attributes[Attributes::SIGNATURE].isEmpty()) + attributes[Attributes::SIGNATURE]=this->getSignature(format_name); - if(attributes[ParsersAttributes::SQL_OBJECT].isEmpty()) - attributes[ParsersAttributes::SQL_OBJECT]=objs_sql[~this->obj_type]; + if(attributes[Attributes::SQL_OBJECT].isEmpty()) + attributes[Attributes::SQL_OBJECT]=objs_sql[~this->obj_type]; } QString BaseObject::__getCodeDefinition(unsigned def_type) @@ -706,7 +706,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) bool format=false; schparser.setPgSQLVersion(BaseObject::pgsql_ver); - attributes[ParsersAttributes::SQL_DISABLED]=(sql_disabled ? ParsersAttributes::True : QString()); + attributes[Attributes::SQL_DISABLED]=(sql_disabled ? Attributes::True : QString()); //Formats the object's name in case the SQL definition is being generated format=((def_type==SchemaParser::SqlDefinition) || @@ -718,35 +718,35 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(schema) { if(def_type==SchemaParser::XmlDefinition) - attributes[ParsersAttributes::SCHEMA]=schema->getCodeDefinition(def_type, true); + attributes[Attributes::SCHEMA]=schema->getCodeDefinition(def_type, true); else - attributes[ParsersAttributes::SCHEMA]=schema->getName(format); + attributes[Attributes::SCHEMA]=schema->getName(format); } if(def_type==SchemaParser::XmlDefinition) - attributes[ParsersAttributes::PROTECTED]=(is_protected ? ParsersAttributes::True : QString()); + attributes[Attributes::PROTECTED]=(is_protected ? Attributes::True : QString()); if(tablespace) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::TABLESPACE]=tablespace->getName(format); + attributes[Attributes::TABLESPACE]=tablespace->getName(format); else - attributes[ParsersAttributes::TABLESPACE]=tablespace->getCodeDefinition(def_type, true); + attributes[Attributes::TABLESPACE]=tablespace->getCodeDefinition(def_type, true); } - if(collation && attributes[ParsersAttributes::COLLATION].isEmpty()) + if(collation && attributes[Attributes::Collation].isEmpty()) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::COLLATION]=collation->getName(format); + attributes[Attributes::Collation]=collation->getName(format); else - attributes[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); + attributes[Attributes::Collation]=collation->getCodeDefinition(def_type, true); } if(owner) { if(def_type==SchemaParser::SqlDefinition) { - attributes[ParsersAttributes::OWNER]=owner->getName(format); + attributes[Attributes::OWNER]=owner->getName(format); /** Only tablespaces and database do not have an ALTER OWNER SET because the rule says that PostgreSQL tablespaces and database should be created @@ -756,68 +756,68 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) SchemaParser sch_parser; QString filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::OWNER + GlobalAttributes::SchemaExt; + Attributes::OWNER + GlobalAttributes::SchemaExt; sch_parser.ignoreUnkownAttributes(true); - attributes[ParsersAttributes::OWNER]=sch_parser.getCodeDefinition(filename, attributes); + attributes[Attributes::OWNER]=sch_parser.getCodeDefinition(filename, attributes); } } else - attributes[ParsersAttributes::OWNER]=owner->getCodeDefinition(def_type, true); + attributes[Attributes::OWNER]=owner->getCodeDefinition(def_type, true); } if(!comment.isEmpty()) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::COMMENT]=QString(comment).replace(QString("'"), QString("''")); + attributes[Attributes::Comment]=QString(comment).replace(QString("'"), QString("''")); else - attributes[ParsersAttributes::COMMENT]=comment; + attributes[Attributes::Comment]=comment; schparser.ignoreUnkownAttributes(true); - attributes[ParsersAttributes::COMMENT]= - schparser.getCodeDefinition(ParsersAttributes::COMMENT, attributes, def_type); + attributes[Attributes::Comment]= + schparser.getCodeDefinition(Attributes::Comment, attributes, def_type); } if(!appended_sql.isEmpty()) { - attributes[ParsersAttributes::AppendedSql]=appended_sql; + attributes[Attributes::AppendedSql]=appended_sql; if(def_type==SchemaParser::XmlDefinition) { schparser.ignoreUnkownAttributes(true); - attributes[ParsersAttributes::AppendedSql]= - schparser.getCodeDefinition(QString(ParsersAttributes::AppendedSql).remove('-'), attributes, def_type); + attributes[Attributes::AppendedSql]= + schparser.getCodeDefinition(QString(Attributes::AppendedSql).remove('-'), attributes, def_type); } else { - attributes[ParsersAttributes::AppendedSql]=QString("\n-- Appended SQL commands --\n") + appended_sql; + attributes[Attributes::AppendedSql]=QString("\n-- Appended SQL commands --\n") + appended_sql; } } if(!prepended_sql.isEmpty()) { - attributes[ParsersAttributes::PREPENDED_SQL]=prepended_sql; + attributes[Attributes::PREPENDED_SQL]=prepended_sql; if(def_type==SchemaParser::XmlDefinition) { schparser.ignoreUnkownAttributes(true); - attributes[ParsersAttributes::PREPENDED_SQL]= - schparser.getCodeDefinition(QString(ParsersAttributes::PREPENDED_SQL).remove('-'), attributes, def_type); + attributes[Attributes::PREPENDED_SQL]= + schparser.getCodeDefinition(QString(Attributes::PREPENDED_SQL).remove('-'), attributes, def_type); } else { - attributes[ParsersAttributes::PREPENDED_SQL]=QString("\n-- Prepended SQL commands --\n") + prepended_sql; + attributes[Attributes::PREPENDED_SQL]=QString("\n-- Prepended SQL commands --\n") + prepended_sql; } } if(def_type==SchemaParser::SqlDefinition && this->acceptsDropCommand()) { - attributes[ParsersAttributes::DROP]=getDropDefinition(true); - attributes[ParsersAttributes::DROP].remove(ParsersAttributes::DDL_END_TOKEN + '\n'); + attributes[Attributes::DROP]=getDropDefinition(true); + attributes[Attributes::DROP].remove(Attributes::DDL_END_TOKEN + '\n'); } - attributes[ParsersAttributes::REDUCED_FORM]=(reduced_form ? ParsersAttributes::True : QString()); + attributes[Attributes::REDUCED_FORM]=(reduced_form ? Attributes::True : QString()); try { @@ -1127,11 +1127,11 @@ QString BaseObject::getDropDefinition(bool cascade) /* Creating an attribute that identifies the object type in order to permit conditional code generation inside the DROP script */ if(attribs.count(this->getSchemaName())==0) - attribs[this->getSchemaName()]=ParsersAttributes::True; + attribs[this->getSchemaName()]=Attributes::True; - attribs[ParsersAttributes::Cascade]=(cascade ? ParsersAttributes::True : QString()); + attribs[Attributes::Cascade]=(cascade ? Attributes::True : QString()); - return(schparser.getCodeDefinition(ParsersAttributes::DROP, attribs, SchemaParser::SqlDefinition)); + return(schparser.getCodeDefinition(Attributes::DROP, attribs, SchemaParser::SqlDefinition)); } else return(QString()); @@ -1166,12 +1166,12 @@ void BaseObject::copyAttributes(attribs_map &attribs) { if(!attribs.empty()) { - attributes[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::True; + attributes[Attributes::HAS_CHANGES]=Attributes::True; for(auto &itr : attribs) attributes[itr.first]=itr.second; } else - attributes[ParsersAttributes::HAS_CHANGES]=QString(); + attributes[Attributes::HAS_CHANGES]=QString(); } QString BaseObject::getAlterDefinition(BaseObject *object) @@ -1193,17 +1193,17 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff try { - QStringList attribs={ ParsersAttributes::OWNER, ParsersAttributes::SCHEMA, ParsersAttributes::TABLESPACE }; + QStringList attribs={ Attributes::OWNER, Attributes::SCHEMA, Attributes::TABLESPACE }; bool accepts_obj[3]={ acceptsOwner(), acceptsSchema(), acceptsTablespace() }; BaseObject *dep_objs[3]={ this->getOwner(), this->getSchema(), this->getTablespace() }, *aux_dep_objs[3]={ object->getOwner(), object->getSchema(), object->getTablespace() }; if(!ignore_name_diff && this->getName()!=object->getName()) { - attributes[ParsersAttributes::NEW_NAME]=object->getName(true, false); - alter+=BaseObject::getAlterDefinition(ParsersAttributes::RENAME, attributes, true); - attributes[ParsersAttributes::NAME]=attributes[ParsersAttributes::NEW_NAME]; - attributes[ParsersAttributes::SIGNATURE]=object->getSignature(true); + attributes[Attributes::NEW_NAME]=object->getName(true, false); + alter+=BaseObject::getAlterDefinition(Attributes::RENAME, attributes, true); + attributes[Attributes::NAME]=attributes[Attributes::NEW_NAME]; + attributes[Attributes::SIGNATURE]=object->getSignature(true); } for(unsigned i=0; i < 3; i++) @@ -1233,13 +1233,13 @@ QString BaseObject::getAlterCommentDefinition(BaseObject *object, attribs_map at if(this->getComment()!=object->getComment()) { if(object->getComment().isEmpty()) - attributes[ParsersAttributes::COMMENT]=ParsersAttributes::UNSET; + attributes[Attributes::Comment]=Attributes::UNSET; else - attributes[ParsersAttributes::COMMENT]=object->getComment(); + attributes[Attributes::Comment]=object->getComment(); schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - return(schparser.getCodeDefinition(ParsersAttributes::COMMENT, attributes, SchemaParser::SqlDefinition)); + return(schparser.getCodeDefinition(Attributes::Comment, attributes, SchemaParser::SqlDefinition)); } return(QString()); diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index d19e6a1ed1..e953214770 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -25,7 +25,7 @@ #ifndef BASE_OBJECT_H #define BASE_OBJECT_H -#include "parsersattributes.h" +#include "attributes.h" #include "exception.h" #include "pgsqltypes.h" #include "schemaparser.h" diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 92c8b928ed..26662aa12f 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -77,46 +77,46 @@ void BaseRelationship::configureRelationship(void) { obj_type=ObjectType::BaseRelationship; - attributes[ParsersAttributes::TYPE]=QString(); - attributes[ParsersAttributes::SRC_REQUIRED]=QString(); - attributes[ParsersAttributes::DST_REQUIRED]=QString(); - attributes[ParsersAttributes::SRC_TABLE]=QString(); - attributes[ParsersAttributes::DST_TABLE]=QString(); - attributes[ParsersAttributes::POINTS]=QString(); - attributes[ParsersAttributes::COLUMNS]=QString(); - attributes[ParsersAttributes::CONSTRAINTS]=QString(); - attributes[ParsersAttributes::ELEMENTS]=QString(); - attributes[ParsersAttributes::IDENTIFIER]=QString(); - attributes[ParsersAttributes::REDUCED_FORM]=QString(); - attributes[ParsersAttributes::DEFERRABLE]=QString(); - attributes[ParsersAttributes::DEFER_TYPE]=QString(); - attributes[ParsersAttributes::TABLE_NAME]=QString(); - attributes[ParsersAttributes::SPECIAL_PK_COLS]=QString(); - attributes[ParsersAttributes::RELATIONSHIP_NN]=QString(); - attributes[ParsersAttributes::RELATIONSHIP_GEN]=QString(); - attributes[ParsersAttributes::RELATIONSHIP_DEP]=QString(); - attributes[ParsersAttributes::RELATIONSHIP_PART]=QString(); - attributes[ParsersAttributes::RELATIONSHIP_1N]=QString(); - attributes[ParsersAttributes::RELATIONSHIP_11]=QString(); - attributes[ParsersAttributes::CONSTRAINTS]=QString(); - attributes[ParsersAttributes::TABLE]=QString(); - attributes[ParsersAttributes::AncestorTable]=QString(); - attributes[ParsersAttributes::COPY_OPTIONS]=QString(); - attributes[ParsersAttributes::COPY_MODE]=QString(); - attributes[ParsersAttributes::SRC_COL_PATTERN]=QString(); - attributes[ParsersAttributes::DST_COL_PATTERN]=QString(); - attributes[ParsersAttributes::PK_PATTERN]=QString(); - attributes[ParsersAttributes::UQ_PATTERN]=QString(); - attributes[ParsersAttributes::SRC_FK_PATTERN]=QString(); - attributes[ParsersAttributes::DST_FK_PATTERN]=QString(); - attributes[ParsersAttributes::PK_COL_PATTERN]=QString(); - attributes[ParsersAttributes::SINGLE_PK_COLUMN]=QString(); - attributes[ParsersAttributes::UPD_ACTION]=QString(); - attributes[ParsersAttributes::DEL_ACTION]=QString(); - attributes[ParsersAttributes::CUSTOM_COLOR]=QString(); - attributes[ParsersAttributes::REFERENCE_FK]=QString(); - attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); - attributes[ParsersAttributes::ORIGINAL_PK]=QString(); + attributes[Attributes::TYPE]=QString(); + attributes[Attributes::SRC_REQUIRED]=QString(); + attributes[Attributes::DST_REQUIRED]=QString(); + attributes[Attributes::SRC_TABLE]=QString(); + attributes[Attributes::DST_TABLE]=QString(); + attributes[Attributes::POINTS]=QString(); + attributes[Attributes::Columns]=QString(); + attributes[Attributes::Constraints]=QString(); + attributes[Attributes::ELEMENTS]=QString(); + attributes[Attributes::IDENTIFIER]=QString(); + attributes[Attributes::REDUCED_FORM]=QString(); + attributes[Attributes::DEFERRABLE]=QString(); + attributes[Attributes::DEFER_TYPE]=QString(); + attributes[Attributes::TABLE_NAME]=QString(); + attributes[Attributes::SPECIAL_PK_COLS]=QString(); + attributes[Attributes::RELATIONSHIP_NN]=QString(); + attributes[Attributes::RELATIONSHIP_GEN]=QString(); + attributes[Attributes::RELATIONSHIP_DEP]=QString(); + attributes[Attributes::RELATIONSHIP_PART]=QString(); + attributes[Attributes::RELATIONSHIP_1N]=QString(); + attributes[Attributes::RELATIONSHIP_11]=QString(); + attributes[Attributes::Constraints]=QString(); + attributes[Attributes::TABLE]=QString(); + attributes[Attributes::AncestorTable]=QString(); + attributes[Attributes::CopyOptions]=QString(); + attributes[Attributes::CopyMode]=QString(); + attributes[Attributes::SRC_COL_PATTERN]=QString(); + attributes[Attributes::DST_COL_PATTERN]=QString(); + attributes[Attributes::PK_PATTERN]=QString(); + attributes[Attributes::UQ_PATTERN]=QString(); + attributes[Attributes::SRC_FK_PATTERN]=QString(); + attributes[Attributes::DST_FK_PATTERN]=QString(); + attributes[Attributes::PK_COL_PATTERN]=QString(); + attributes[Attributes::SINGLE_PK_COLUMN]=QString(); + attributes[Attributes::UPD_ACTION]=QString(); + attributes[Attributes::DEL_ACTION]=QString(); + attributes[Attributes::CustomColor]=QString(); + attributes[Attributes::REFERENCE_FK]=QString(); + attributes[Attributes::PARTITION_BOUND_EXPR]=QString(); + attributes[Attributes::ORIGINAL_PK]=QString(); //Check if the relationship type is valid if(rel_type <= RelationshipFk) @@ -328,47 +328,47 @@ void BaseRelationship::setRelationshipAttributes(void) { unsigned count, i; QString str_aux, - label_attribs[3]={ ParsersAttributes::SRC_LABEL, - ParsersAttributes::DST_LABEL, - ParsersAttributes::NAME_LABEL}; + label_attribs[3]={ Attributes::SRC_LABEL, + Attributes::DST_LABEL, + Attributes::NAME_LABEL}; - attributes[ParsersAttributes::TYPE]=getRelTypeAttribute(); - attributes[ParsersAttributes::SRC_REQUIRED]=(src_mandatory ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::DST_REQUIRED]=(dst_mandatory ? ParsersAttributes::True : QString()); + attributes[Attributes::TYPE]=getRelTypeAttribute(); + attributes[Attributes::SRC_REQUIRED]=(src_mandatory ? Attributes::True : QString()); + attributes[Attributes::DST_REQUIRED]=(dst_mandatory ? Attributes::True : QString()); if(src_table) - attributes[ParsersAttributes::SRC_TABLE]=src_table->getName(true); + attributes[Attributes::SRC_TABLE]=src_table->getName(true); if(dst_table) - attributes[ParsersAttributes::DST_TABLE]=dst_table->getName(true); + attributes[Attributes::DST_TABLE]=dst_table->getName(true); count=points.size(); for(i=0; i < count; i++) { - attributes[ParsersAttributes::X_POS]=QString("%1").arg(points[i].x()); - attributes[ParsersAttributes::Y_POS]=QString("%1").arg(points[i].y()); - str_aux+=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XmlDefinition); + attributes[Attributes::X_POS]=QString("%1").arg(points[i].x()); + attributes[Attributes::Y_POS]=QString("%1").arg(points[i].y()); + str_aux+=schparser.getCodeDefinition(Attributes::POSITION, attributes, SchemaParser::XmlDefinition); } - attributes[ParsersAttributes::POINTS]=str_aux; + attributes[Attributes::POINTS]=str_aux; str_aux=QString(); for(i=0; i < 3; i++) { if(!std::isnan(lables_dist[i].x())) { - attributes[ParsersAttributes::X_POS]=QString("%1").arg(lables_dist[i].x()); - attributes[ParsersAttributes::Y_POS]=QString("%1").arg(lables_dist[i].y()); - attributes[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, attributes, SchemaParser::XmlDefinition); - attributes[ParsersAttributes::REF_TYPE]=label_attribs[i]; - str_aux+=schparser.getCodeDefinition(ParsersAttributes::LABEL, attributes, SchemaParser::XmlDefinition); + attributes[Attributes::X_POS]=QString("%1").arg(lables_dist[i].x()); + attributes[Attributes::Y_POS]=QString("%1").arg(lables_dist[i].y()); + attributes[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, attributes, SchemaParser::XmlDefinition); + attributes[Attributes::REF_TYPE]=label_attribs[i]; + str_aux+=schparser.getCodeDefinition(Attributes::LABEL, attributes, SchemaParser::XmlDefinition); } } - attributes[ParsersAttributes::LABELS_POS]=str_aux; - attributes[ParsersAttributes::CUSTOM_COLOR]=(custom_color!=Qt::transparent ? custom_color.name() : QString()); - attributes[ParsersAttributes::REFERENCE_FK]=(reference_fk ? reference_fk->getName() : QString()); + attributes[Attributes::LABELS_POS]=str_aux; + attributes[Attributes::CustomColor]=(custom_color!=Qt::transparent ? custom_color.name() : QString()); + attributes[Attributes::REFERENCE_FK]=(reference_fk ? reference_fk->getName() : QString()); setFadedOutAttribute(); } @@ -419,8 +419,8 @@ QString BaseRelationship::getCodeDefinition(unsigned def_type) { bool reduced_form; setRelationshipAttributes(); - reduced_form=(attributes[ParsersAttributes::POINTS].isEmpty() && - attributes[ParsersAttributes::LABELS_POS].isEmpty()); + reduced_form=(attributes[Attributes::POINTS].isEmpty() && + attributes[Attributes::LABELS_POS].isEmpty()); if(!reduced_form) cached_reduced_code.clear(); @@ -505,17 +505,17 @@ QString BaseRelationship::getRelTypeAttribute(void) { switch(rel_type) { - case Relationship11: return(ParsersAttributes::RELATIONSHIP_11); break; - case Relationship1n: return(ParsersAttributes::RELATIONSHIP_1N); break; - case RelationshipNn: return(ParsersAttributes::RELATIONSHIP_NN); break; - case RelationshipGen: return(ParsersAttributes::RELATIONSHIP_GEN); break; - case RelationshipPart: return(ParsersAttributes::RELATIONSHIP_PART); break; - case RelationshipFk: return(ParsersAttributes::RELATIONSHIP_FK); break; + case Relationship11: return(Attributes::RELATIONSHIP_11); break; + case Relationship1n: return(Attributes::RELATIONSHIP_1N); break; + case RelationshipNn: return(Attributes::RELATIONSHIP_NN); break; + case RelationshipGen: return(Attributes::RELATIONSHIP_GEN); break; + case RelationshipPart: return(Attributes::RELATIONSHIP_PART); break; + case RelationshipFk: return(Attributes::RELATIONSHIP_FK); break; default: if(src_table->getObjectType()==ObjectType::View) - return(ParsersAttributes::RELATION_TAB_VIEW); + return(Attributes::RELATION_TAB_VIEW); else - return(ParsersAttributes::RELATIONSHIP_DEP); + return(Attributes::RELATIONSHIP_DEP); break; } } diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 0d0731c563..c84634b0e1 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -22,9 +22,9 @@ BaseTable::BaseTable(void) { tag=nullptr; obj_type=ObjectType::BaseTable; - attributes[ParsersAttributes::TAG]=QString(); - attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=QString(); - attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString(); + attributes[Attributes::TAG]=QString(); + attributes[Attributes::HIDE_EXT_ATTRIBS]=QString(); + attributes[Attributes::MAX_OBJ_COUNT]=QString(); hide_ext_attribs=false; } diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 6108a2f7e5..872337ed18 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -24,11 +24,11 @@ Cast::Cast(void) cast_function=nullptr; cast_type=Explicit; is_in_out=false; - attributes[ParsersAttributes::SOURCE_TYPE]=QString(); - attributes[ParsersAttributes::DEST_TYPE]=QString(); - attributes[ParsersAttributes::CastType]=QString(); - attributes[ParsersAttributes::IO_CAST]=QString(); - attributes[ParsersAttributes::FUNCTION]=QString(); + attributes[Attributes::SOURCE_TYPE]=QString(); + attributes[Attributes::DEST_TYPE]=QString(); + attributes[Attributes::CastType]=QString(); + attributes[Attributes::IO_CAST]=QString(); + attributes[Attributes::FUNCTION]=QString(); } void Cast::setDataType(unsigned type_idx, PgSqlType type) @@ -155,7 +155,7 @@ unsigned Cast::getCastType(void) QString Cast::getDropDefinition(bool cascade) { - attributes[ParsersAttributes::SIGNATURE].replace(QString(","), QString(" AS ")); + attributes[Attributes::SIGNATURE].replace(QString(","), QString(" AS ")); return(BaseObject::getDropDefinition(cascade)); } @@ -166,41 +166,41 @@ QString Cast::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { - attributes[ParsersAttributes::SOURCE_TYPE]=(*types[SrcType]); - attributes[ParsersAttributes::DEST_TYPE]=(*types[DstType]); + attributes[Attributes::SOURCE_TYPE]=(*types[SrcType]); + attributes[Attributes::DEST_TYPE]=(*types[DstType]); } else { - attributes[ParsersAttributes::SOURCE_TYPE]=types[SrcType].getCodeDefinition(def_type); - attributes[ParsersAttributes::DEST_TYPE]=types[DstType].getCodeDefinition(def_type); + attributes[Attributes::SOURCE_TYPE]=types[SrcType].getCodeDefinition(def_type); + attributes[Attributes::DEST_TYPE]=types[DstType].getCodeDefinition(def_type); } if(!is_in_out && cast_function) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::FUNCTION]=cast_function->getSignature(); + attributes[Attributes::FUNCTION]=cast_function->getSignature(); else - attributes[ParsersAttributes::FUNCTION]=cast_function->getCodeDefinition(def_type, true); + attributes[Attributes::FUNCTION]=cast_function->getCodeDefinition(def_type, true); } else - attributes[ParsersAttributes::IO_CAST]=(is_in_out ? ParsersAttributes::True : QString()); + attributes[Attributes::IO_CAST]=(is_in_out ? Attributes::True : QString()); if(cast_type==Assignment) - attributes[ParsersAttributes::CastType]=ParsersAttributes::Assignment; + attributes[Attributes::CastType]=Attributes::Assignment; else if(cast_type==Implicit) - attributes[ParsersAttributes::CastType]=ParsersAttributes::IMPLICIT; + attributes[Attributes::CastType]=Attributes::IMPLICIT; else - attributes[ParsersAttributes::CastType]=QString(); + attributes[Attributes::CastType]=QString(); if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::CastType]=attributes[ParsersAttributes::CastType].toUpper(); + attributes[Attributes::CastType]=attributes[Attributes::CastType].toUpper(); return(BaseObject::__getCodeDefinition(def_type)); } QString Cast::getSignature(bool) { - attributes[ParsersAttributes::SIGNATURE]=this->getName().remove(QString("cast")); + attributes[Attributes::SIGNATURE]=this->getName().remove(QString("cast")); return(BaseObject::getSignature(false)); } diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index 1c11c84ed4..1e18cabf3e 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -23,10 +23,10 @@ Collation::Collation(void) obj_type=ObjectType::Collation; encoding=BaseType::Null; - attributes[ParsersAttributes::LcCtype]=QString(); - attributes[ParsersAttributes::LcCollate]=QString(); - attributes[ParsersAttributes::LOCALE]=QString(); - attributes[ParsersAttributes::ENCODING]=QString(); + attributes[Attributes::LcCtype]=QString(); + attributes[Attributes::LcCollate]=QString(); + attributes[Attributes::LOCALE]=QString(); + attributes[Attributes::ENCODING]=QString(); } void Collation::setLocale(const QString &locale) @@ -102,16 +102,16 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) if(!locale.isEmpty()) { - attributes[ParsersAttributes::LOCALE]=locale; + attributes[Attributes::LOCALE]=locale; if(def_type==SchemaParser::SqlDefinition && encoding!=BaseType::Null) - attributes[ParsersAttributes::LOCALE]=locale + "." + (~encoding).toLower(); + attributes[Attributes::LOCALE]=locale + "." + (~encoding).toLower(); } else if(collation) - attributes[ParsersAttributes::COLLATION]=collation->getName(true); + attributes[Attributes::Collation]=collation->getName(true); else { - QString lc_attribs[2]={ ParsersAttributes::LcCtype, ParsersAttributes::LcCollate }; + QString lc_attribs[2]={ Attributes::LcCtype, Attributes::LcCollate }; if(localization[LcCtype].isEmpty() && localization[LcCollate].isEmpty()) throw Exception(ErrorCode::EmptyLCCollationAttributes,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -126,7 +126,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) } } - attributes[ParsersAttributes::ENCODING]=~encoding; + attributes[Attributes::ENCODING]=~encoding; return(BaseObject::getCodeDefinition(def_type, reduced_form)); } @@ -134,7 +134,7 @@ QString Collation::getAlterDefinition(BaseObject *object) { try { - attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, false)); } catch(Exception &e) diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 1189f77226..6aa1ee0945 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -22,19 +22,19 @@ Column::Column(void) { obj_type=ObjectType::Column; not_null=seq_cycle=false; - attributes[ParsersAttributes::TYPE]=QString(); - attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); - attributes[ParsersAttributes::NOT_NULL]=QString(); - attributes[ParsersAttributes::TABLE]=QString(); - attributes[ParsersAttributes::SEQUENCE]=QString(); - attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); - attributes[ParsersAttributes::IDENTITY_TYPE]=QString(); - attributes[ParsersAttributes::INCREMENT]=QString(); - attributes[ParsersAttributes::MIN_VALUE]=QString(); - attributes[ParsersAttributes::MAX_VALUE]=QString(); - attributes[ParsersAttributes::START]=QString(); - attributes[ParsersAttributes::Cache]=QString(); - attributes[ParsersAttributes::CYCLE]=QString(); + attributes[Attributes::TYPE]=QString(); + attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::NOT_NULL]=QString(); + attributes[Attributes::TABLE]=QString(); + attributes[Attributes::SEQUENCE]=QString(); + attributes[Attributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::IDENTITY_TYPE]=QString(); + attributes[Attributes::INCREMENT]=QString(); + attributes[Attributes::MIN_VALUE]=QString(); + attributes[Attributes::MAX_VALUE]=QString(); + attributes[Attributes::START]=QString(); + attributes[Attributes::Cache]=QString(); + attributes[Attributes::Cycle]=QString(); parent_rel=sequence=nullptr; identity_type=BaseType::Null; @@ -238,38 +238,38 @@ QString Column::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); if(getParentTable()) - attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::TABLE]=getParentTable()->getName(true); - attributes[ParsersAttributes::TYPE]=type.getCodeDefinition(def_type); - attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); - attributes[ParsersAttributes::IDENTITY_TYPE]=QString(); + attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); + attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::IDENTITY_TYPE]=QString(); if(identity_type != BaseType::Null) { - attributes[ParsersAttributes::IDENTITY_TYPE] = ~identity_type; - attributes[ParsersAttributes::INCREMENT]=seq_increment; - attributes[ParsersAttributes::MIN_VALUE]=seq_min_value; - attributes[ParsersAttributes::MAX_VALUE]=seq_max_value; - attributes[ParsersAttributes::START]=seq_start; - attributes[ParsersAttributes::Cache]=seq_cache; - attributes[ParsersAttributes::CYCLE]=(seq_cycle ? ParsersAttributes::True : QString()); + attributes[Attributes::IDENTITY_TYPE] = ~identity_type; + attributes[Attributes::INCREMENT]=seq_increment; + attributes[Attributes::MIN_VALUE]=seq_min_value; + attributes[Attributes::MAX_VALUE]=seq_max_value; + attributes[Attributes::START]=seq_start; + attributes[Attributes::Cache]=seq_cache; + attributes[Attributes::Cycle]=(seq_cycle ? Attributes::True : QString()); } else { if(!sequence) - attributes[ParsersAttributes::DEFAULT_VALUE]=default_value; + attributes[Attributes::DEFAULT_VALUE]=default_value; else { //Configuring the default value of the column to get the next value of the sequence if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::DEFAULT_VALUE]=QString("nextval('%1'::regclass)").arg(sequence->getSignature()); + attributes[Attributes::DEFAULT_VALUE]=QString("nextval('%1'::regclass)").arg(sequence->getSignature()); - attributes[ParsersAttributes::SEQUENCE]=sequence->getName(true); + attributes[Attributes::SEQUENCE]=sequence->getName(true); } } - attributes[ParsersAttributes::NOT_NULL]=(!not_null ? QString() : ParsersAttributes::True); - attributes[ParsersAttributes::DECL_IN_TABLE]=(isDeclaredInTable() ? ParsersAttributes::True : QString()); + attributes[Attributes::NOT_NULL]=(!not_null ? QString() : Attributes::True); + attributes[Attributes::DECL_IN_TABLE]=(isDeclaredInTable() ? Attributes::True : QString()); return(BaseObject::__getCodeDefinition(def_type)); } @@ -290,13 +290,13 @@ QString Column::getAlterDefinition(BaseObject *object) BaseObject::setBasicAttributes(true); if(getParentTable()) - attribs[ParsersAttributes::TABLE]=getParentTable()->getName(true); + attribs[Attributes::TABLE]=getParentTable()->getName(true); if(!this->type.isEquivalentTo(col->type) || (this->type.isEquivalentTo(col->type) && ((this->type.hasVariableLength() && (this->type.getLength()!=col->type.getLength())) || (this->type.acceptsPrecision() && (this->type.getPrecision()!=col->type.getPrecision()))))) - attribs[ParsersAttributes::TYPE]=col->type.getCodeDefinition(SchemaParser::SqlDefinition); + attribs[Attributes::TYPE]=col->type.getCodeDefinition(SchemaParser::SqlDefinition); if(col->sequence) def_val=QString("nextval('%1'::regclass)").arg(col->sequence->getSignature()); @@ -304,70 +304,70 @@ QString Column::getAlterDefinition(BaseObject *object) def_val=col->default_value; if(this->default_value!=def_val) - attribs[ParsersAttributes::DEFAULT_VALUE]=(def_val.isEmpty() ? ParsersAttributes::UNSET : def_val); + attribs[Attributes::DEFAULT_VALUE]=(def_val.isEmpty() ? Attributes::UNSET : def_val); if(this->not_null!=col->not_null) - attribs[ParsersAttributes::NOT_NULL]=(!col->not_null ? ParsersAttributes::UNSET : ParsersAttributes::True); + attribs[Attributes::NOT_NULL]=(!col->not_null ? Attributes::UNSET : Attributes::True); - attribs[ParsersAttributes::NEW_IDENTITY_TYPE] = QString(); + attribs[Attributes::NEW_IDENTITY_TYPE] = QString(); if(this->identity_type == BaseType::Null && col->identity_type != BaseType::Null) - attribs[ParsersAttributes::IDENTITY_TYPE] = ~col->identity_type; + attribs[Attributes::IDENTITY_TYPE] = ~col->identity_type; else if(this->identity_type != BaseType::Null && col->identity_type == BaseType::Null) - attribs[ParsersAttributes::IDENTITY_TYPE] = ParsersAttributes::UNSET; + attribs[Attributes::IDENTITY_TYPE] = Attributes::UNSET; else if(this->identity_type != BaseType::Null && col->identity_type != BaseType::Null && this->identity_type != col->identity_type) - attribs[ParsersAttributes::NEW_IDENTITY_TYPE] = ~col->identity_type; + attribs[Attributes::NEW_IDENTITY_TYPE] = ~col->identity_type; - attribs[ParsersAttributes::CUR_IDENTITY_TYPE] = QString(); - attribs[ParsersAttributes::MIN_VALUE] = QString(); - attribs[ParsersAttributes::MAX_VALUE] = QString(); - attribs[ParsersAttributes::START] = QString(); - attribs[ParsersAttributes::INCREMENT] = QString(); - attribs[ParsersAttributes::Cache] = QString(); - attribs[ParsersAttributes::CYCLE] = QString(); + attribs[Attributes::CurIdentityType] = QString(); + attribs[Attributes::MIN_VALUE] = QString(); + attribs[Attributes::MAX_VALUE] = QString(); + attribs[Attributes::START] = QString(); + attribs[Attributes::INCREMENT] = QString(); + attribs[Attributes::Cache] = QString(); + attribs[Attributes::Cycle] = QString(); //Checking differences in the underlying sequence (identity col) - if(attribs[ParsersAttributes::IDENTITY_TYPE] != ParsersAttributes::UNSET) + if(attribs[Attributes::IDENTITY_TYPE] != Attributes::UNSET) { if(!col->seq_min_value.isEmpty() && this->seq_min_value != col->seq_min_value) { - attribs[ParsersAttributes::MIN_VALUE] = col->seq_min_value; + attribs[Attributes::MIN_VALUE] = col->seq_min_value; ident_seq_changed = true; } if(!col->seq_max_value.isEmpty() && this->seq_max_value != col->seq_max_value) { - attribs[ParsersAttributes::MAX_VALUE] = col->seq_max_value; + attribs[Attributes::MAX_VALUE] = col->seq_max_value; ident_seq_changed = true; } if(!col->seq_start.isEmpty() && this->seq_start != col->seq_start) { - attribs[ParsersAttributes::START] = col->seq_start; + attribs[Attributes::START] = col->seq_start; ident_seq_changed = true; } if(!col->seq_increment.isEmpty() && this->seq_increment != col->seq_increment) { - attribs[ParsersAttributes::INCREMENT] = col->seq_increment; + attribs[Attributes::INCREMENT] = col->seq_increment; ident_seq_changed = true; } if(!col->seq_cache.isEmpty() && this->seq_cache != col->seq_cache) { - attribs[ParsersAttributes::Cache] = col->seq_cache; + attribs[Attributes::Cache] = col->seq_cache; ident_seq_changed = true; } if(this->seq_cycle != col->seq_cycle) { - attribs[ParsersAttributes::CYCLE] = (col->seq_cycle ? ParsersAttributes::True : ParsersAttributes::False); + attribs[Attributes::Cycle] = (col->seq_cycle ? Attributes::True : Attributes::False); ident_seq_changed = true; } if(ident_seq_changed) - attribs[ParsersAttributes::CUR_IDENTITY_TYPE] = ~this->identity_type; + attribs[Attributes::CurIdentityType] = ~this->identity_type; } copyAttributes(attribs); diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 488671b641..5afface3be 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -27,27 +27,27 @@ Constraint::Constraint(void) fill_factor=0; index_type=BaseType::Null; - attributes[ParsersAttributes::PK_CONSTR]=QString(); - attributes[ParsersAttributes::FK_CONSTR]=QString(); - attributes[ParsersAttributes::CkConstr]=QString(); - attributes[ParsersAttributes::UQ_CONSTR]=QString(); - attributes[ParsersAttributes::EX_CONSTR]=QString(); - attributes[ParsersAttributes::REF_TABLE]=QString(); - attributes[ParsersAttributes::SRC_COLUMNS]=QString(); - attributes[ParsersAttributes::DST_COLUMNS]=QString(); - attributes[ParsersAttributes::DEL_ACTION]=QString(); - attributes[ParsersAttributes::UPD_ACTION]=QString(); - attributes[ParsersAttributes::EXPRESSION]=QString(); - attributes[ParsersAttributes::TYPE]=QString(); - attributes[ParsersAttributes::COMPARISON_TYPE]=QString(); - attributes[ParsersAttributes::DEFER_TYPE]=QString(); - attributes[ParsersAttributes::INDEX_TYPE]=QString(); - attributes[ParsersAttributes::DEFERRABLE]=QString(); - attributes[ParsersAttributes::TABLE]=QString(); - attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); - attributes[ParsersAttributes::FACTOR]=QString(); - attributes[ParsersAttributes::NO_INHERIT]=QString(); - attributes[ParsersAttributes::ELEMENTS]=QString(); + attributes[Attributes::PK_CONSTR]=QString(); + attributes[Attributes::FK_CONSTR]=QString(); + attributes[Attributes::CkConstr]=QString(); + attributes[Attributes::UQ_CONSTR]=QString(); + attributes[Attributes::EX_CONSTR]=QString(); + attributes[Attributes::REF_TABLE]=QString(); + attributes[Attributes::SRC_COLUMNS]=QString(); + attributes[Attributes::DST_COLUMNS]=QString(); + attributes[Attributes::DEL_ACTION]=QString(); + attributes[Attributes::UPD_ACTION]=QString(); + attributes[Attributes::EXPRESSION]=QString(); + attributes[Attributes::TYPE]=QString(); + attributes[Attributes::ComparisonType]=QString(); + attributes[Attributes::DEFER_TYPE]=QString(); + attributes[Attributes::INDEX_TYPE]=QString(); + attributes[Attributes::DEFERRABLE]=QString(); + attributes[Attributes::TABLE]=QString(); + attributes[Attributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::FACTOR]=QString(); + attributes[Attributes::NO_INHERIT]=QString(); + attributes[Attributes::ELEMENTS]=QString(); } Constraint::~Constraint(void) @@ -197,12 +197,12 @@ void Constraint::setColumnsAttribute(unsigned col_type, unsigned def_type, bool if(col_type==ReferencedCols) { col_vector=&ref_columns; - attrib=ParsersAttributes::DST_COLUMNS; + attrib=Attributes::DST_COLUMNS; } else { col_vector=&columns; - attrib=ParsersAttributes::SRC_COLUMNS; + attrib=Attributes::SRC_COLUMNS; } count=col_vector->size(); @@ -630,7 +630,7 @@ void Constraint::setExcludeElementsAttribute(unsigned def_type) if(i < (count-1) && def_type==SchemaParser::SqlDefinition) str_elem+=','; } - attributes[ParsersAttributes::ELEMENTS]=str_elem; + attributes[Attributes::ELEMENTS]=str_elem; } void Constraint::setIndexType(IndexingType index_type) @@ -651,9 +651,9 @@ QString Constraint::getCodeDefinition(unsigned def_type) void Constraint::setDeclInTableAttribute(void) { if(!isDeclaredInTable() || (constr_type==ConstraintType::ForeignKey && !isAddedByLinking())) - attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::DECL_IN_TABLE]=QString(); else if(!isReferRelationshipAddedColumn() || constr_type==ConstraintType::PrimaryKey) - attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::True; + attributes[Attributes::DECL_IN_TABLE]=Attributes::True; } QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) @@ -663,36 +663,36 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) QString attrib; - attributes[ParsersAttributes::PK_CONSTR]=QString(); - attributes[ParsersAttributes::FK_CONSTR]=QString(); - attributes[ParsersAttributes::CkConstr]=QString(); - attributes[ParsersAttributes::UQ_CONSTR]=QString(); - attributes[ParsersAttributes::EX_CONSTR]=QString(); + attributes[Attributes::PK_CONSTR]=QString(); + attributes[Attributes::FK_CONSTR]=QString(); + attributes[Attributes::CkConstr]=QString(); + attributes[Attributes::UQ_CONSTR]=QString(); + attributes[Attributes::EX_CONSTR]=QString(); switch(!constr_type) { case ConstraintType::Check: - attrib=ParsersAttributes::CkConstr; + attrib=Attributes::CkConstr; break; case ConstraintType::PrimaryKey: - attrib=ParsersAttributes::PK_CONSTR; + attrib=Attributes::PK_CONSTR; break; case ConstraintType::ForeignKey: - attrib=ParsersAttributes::FK_CONSTR; + attrib=Attributes::FK_CONSTR; break; case ConstraintType::Unique: - attrib=ParsersAttributes::UQ_CONSTR; + attrib=Attributes::UQ_CONSTR; break; default: - attrib=ParsersAttributes::EX_CONSTR; + attrib=Attributes::EX_CONSTR; break; } - attributes[attrib]=ParsersAttributes::True; + attributes[attrib]=Attributes::True; - attributes[ParsersAttributes::TYPE]=attrib; - attributes[ParsersAttributes::UPD_ACTION]=(~upd_action); - attributes[ParsersAttributes::DEL_ACTION]=(~del_action); - attributes[ParsersAttributes::EXPRESSION]=expression; + attributes[Attributes::TYPE]=attrib; + attributes[Attributes::UPD_ACTION]=(~upd_action); + attributes[Attributes::DEL_ACTION]=(~del_action); + attributes[Attributes::EXPRESSION]=expression; if(constr_type!=ConstraintType::Check) { @@ -710,22 +710,22 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) setColumnsAttribute(ReferencedCols, def_type, inc_addedbyrel); } - attributes[ParsersAttributes::REF_TABLE]=(ref_table ? ref_table->getName(true) : QString()); - attributes[ParsersAttributes::DEFERRABLE]=(deferrable ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::NO_INHERIT]=(no_inherit ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::COMPARISON_TYPE]=(~match_type); - attributes[ParsersAttributes::DEFER_TYPE]=(~deferral_type); - attributes[ParsersAttributes::INDEX_TYPE]=(~ index_type); + attributes[Attributes::REF_TABLE]=(ref_table ? ref_table->getName(true) : QString()); + attributes[Attributes::DEFERRABLE]=(deferrable ? Attributes::True : QString()); + attributes[Attributes::NO_INHERIT]=(no_inherit ? Attributes::True : QString()); + attributes[Attributes::ComparisonType]=(~match_type); + attributes[Attributes::DEFER_TYPE]=(~deferral_type); + attributes[Attributes::INDEX_TYPE]=(~ index_type); if(getParentTable()) - attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::TABLE]=getParentTable()->getName(true); setDeclInTableAttribute(); if(fill_factor!=0 && (constr_type==ConstraintType::PrimaryKey || constr_type==ConstraintType::Unique)) - attributes[ParsersAttributes::FACTOR]=QString("%1").arg(fill_factor); + attributes[Attributes::FACTOR]=QString("%1").arg(fill_factor); else - attributes[ParsersAttributes::FACTOR]=QString(); + attributes[Attributes::FACTOR]=QString(); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index ccabc4b64e..6634eb21e3 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -23,10 +23,10 @@ Conversion::Conversion(void) obj_type=ObjectType::Conversion; conversion_func=nullptr; is_default=false; - attributes[ParsersAttributes::DEFAULT]=QString(); - attributes[ParsersAttributes::SRC_ENCODING]=QString(); - attributes[ParsersAttributes::DST_ENCODING]=QString(); - attributes[ParsersAttributes::FUNCTION]=QString(); + attributes[Attributes::DEFAULT]=QString(); + attributes[Attributes::SRC_ENCODING]=QString(); + attributes[Attributes::DST_ENCODING]=QString(); + attributes[Attributes::FUNCTION]=QString(); } void Conversion::setEncoding(unsigned encoding_idx, EncodingType encoding_type) @@ -115,16 +115,16 @@ QString Conversion::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::DEFAULT]=(is_default ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::SRC_ENCODING]=(~encodings[SrcEncoding]); - attributes[ParsersAttributes::DST_ENCODING]=(~encodings[DstEncoding]); + attributes[Attributes::DEFAULT]=(is_default ? Attributes::True : QString()); + attributes[Attributes::SRC_ENCODING]=(~encodings[SrcEncoding]); + attributes[Attributes::DST_ENCODING]=(~encodings[DstEncoding]); if(conversion_func) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::FUNCTION]=conversion_func->getName(true); + attributes[Attributes::FUNCTION]=conversion_func->getName(true); else - attributes[ParsersAttributes::FUNCTION]=conversion_func->getCodeDefinition(def_type, true); + attributes[Attributes::FUNCTION]=conversion_func->getCodeDefinition(def_type, true); } return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 13fcda52a7..0317083246 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -41,15 +41,15 @@ DatabaseModel::DatabaseModel(void) conn_limit=-1; last_zoom=1; loading_model=invalidated=append_at_eod=prepend_at_bod=false; - attributes[ParsersAttributes::ENCODING]=QString(); - attributes[ParsersAttributes::TEMPLATE_DB]=QString(); - attributes[ParsersAttributes::CONN_LIMIT]=QString(); - attributes[ParsersAttributes::LcCollate]=QString(); - attributes[ParsersAttributes::LcCtype]=QString(); - attributes[ParsersAttributes::AppendAtEod]=QString(); - attributes[ParsersAttributes::PREPEND_AT_BOD]=QString(); - attributes[ParsersAttributes::AllowConns]=QString(); - attributes[ParsersAttributes::IS_TEMPLATE]=QString(); + attributes[Attributes::ENCODING]=QString(); + attributes[Attributes::TEMPLATE_DB]=QString(); + attributes[Attributes::ConnLimit]=QString(); + attributes[Attributes::LcCollate]=QString(); + attributes[Attributes::LcCtype]=QString(); + attributes[Attributes::AppendAtEod]=QString(); + attributes[Attributes::PREPEND_AT_BOD]=QString(); + attributes[Attributes::AllowConns]=QString(); + attributes[Attributes::IS_TEMPLATE]=QString(); } DatabaseModel::DatabaseModel(ModelWidget *model_wgt):DatabaseModel() @@ -2965,17 +2965,17 @@ int DatabaseModel::getObjectIndex(BaseObject *object) void DatabaseModel::configureDatabase(attribs_map &attribs) { - encoding=attribs[ParsersAttributes::ENCODING]; - template_db=attribs[ParsersAttributes::TEMPLATE_DB]; - localizations[0]=attribs[ParsersAttributes::LcCtype]; - localizations[1]=attribs[ParsersAttributes::LcCollate]; - append_at_eod=attribs[ParsersAttributes::AppendAtEod]==ParsersAttributes::True; - prepend_at_bod=attribs[ParsersAttributes::PREPEND_AT_BOD]==ParsersAttributes::True; - is_template=attribs[ParsersAttributes::IS_TEMPLATE]==ParsersAttributes::True; - allow_conns=attribs[ParsersAttributes::AllowConns] != ParsersAttributes::False; + encoding=attribs[Attributes::ENCODING]; + template_db=attribs[Attributes::TEMPLATE_DB]; + localizations[0]=attribs[Attributes::LcCtype]; + localizations[1]=attribs[Attributes::LcCollate]; + append_at_eod=attribs[Attributes::AppendAtEod]==Attributes::True; + prepend_at_bod=attribs[Attributes::PREPEND_AT_BOD]==Attributes::True; + is_template=attribs[Attributes::IS_TEMPLATE]==Attributes::True; + allow_conns=attribs[Attributes::AllowConns] != Attributes::False; - if(!attribs[ParsersAttributes::CONN_LIMIT].isEmpty()) - conn_limit=attribs[ParsersAttributes::CONN_LIMIT].toInt(); + if(!attribs[Attributes::ConnLimit].isEmpty()) + conn_limit=attribs[Attributes::ConnLimit].toInt(); setBasicAttributes(this); } @@ -3016,28 +3016,28 @@ void DatabaseModel::loadModel(const QString &filename) //Gets the basic model information xmlparser.getElementAttributes(attribs); - setObjectListsCapacity(attribs[ParsersAttributes::MAX_OBJ_COUNT].toUInt()); + setObjectListsCapacity(attribs[Attributes::MAX_OBJ_COUNT].toUInt()); - this->author=attribs[ParsersAttributes::MODEL_AUTHOR]; + this->author=attribs[Attributes::MODEL_AUTHOR]; - pos_str=attribs[ParsersAttributes::LAST_POSITION].split(','); + pos_str=attribs[Attributes::LAST_POSITION].split(','); if(pos_str.size()>=2) this->last_pos=QPoint(pos_str[0].toUInt(),pos_str[1].toUInt()); - this->last_zoom=attribs[ParsersAttributes::LAST_ZOOM].toDouble(); + this->last_zoom=attribs[Attributes::LAST_ZOOM].toDouble(); if(this->last_zoom <= 0) this->last_zoom=1; - this->is_template = attribs[ParsersAttributes::IS_TEMPLATE] == ParsersAttributes::True; - this->allow_conns = (attribs[ParsersAttributes::AllowConns].isEmpty() || - attribs[ParsersAttributes::AllowConns] == ParsersAttributes::True); + this->is_template = attribs[Attributes::IS_TEMPLATE] == Attributes::True; + this->allow_conns = (attribs[Attributes::AllowConns].isEmpty() || + attribs[Attributes::AllowConns] == Attributes::True); - protected_model=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::True); + protected_model=(attribs[Attributes::PROTECTED]==Attributes::True); - def_objs[ObjectType::Schema]=attribs[ParsersAttributes::DEFAULT_SCHEMA]; - def_objs[ObjectType::Role]=attribs[ParsersAttributes::DEFAULT_OWNER]; - def_objs[ObjectType::Collation]=attribs[ParsersAttributes::DEFAULT_COLLATION]; - def_objs[ObjectType::Tablespace]=attribs[ParsersAttributes::DEFAULT_TABLESPACE]; + def_objs[ObjectType::Schema]=attribs[Attributes::DEFAULT_SCHEMA]; + def_objs[ObjectType::Role]=attribs[Attributes::DEFAULT_OWNER]; + def_objs[ObjectType::Collation]=attribs[Attributes::DEFAULT_COLLATION]; + def_objs[ObjectType::Tablespace]=attribs[Attributes::DEFAULT_TABLESPACE]; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3249,13 +3249,13 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) obj_type_aux=object->getObjectType(); if(obj_type_aux!=ObjectType::Cast) - object->setName(attribs[ParsersAttributes::NAME]); + object->setName(attribs[Attributes::NAME]); if(BaseObject::acceptsAlias(obj_type_aux)) - object->setAlias(attribs[ParsersAttributes::Alias]); + object->setAlias(attribs[Attributes::Alias]); - protected_obj=attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::True; - sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::True; + protected_obj=attribs[Attributes::PROTECTED]==Attributes::True; + sql_disabled=attribs[Attributes::SQL_DISABLED]==Attributes::True; xmlparser.savePosition(); @@ -3268,7 +3268,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) elem_name=xmlparser.getElementName(); //Defines the object's comment - if(elem_name==ParsersAttributes::COMMENT) + if(elem_name==Attributes::Comment) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -3276,49 +3276,49 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.restorePosition(); } //Defines the object's schema - else if(elem_name==ParsersAttributes::SCHEMA) + else if(elem_name==Attributes::SCHEMA) { obj_type=ObjectType::Schema; xmlparser.getElementAttributes(attribs_aux); - schema=dynamic_cast(getObject(attribs_aux[ParsersAttributes::NAME], obj_type)); + schema=dynamic_cast(getObject(attribs_aux[Attributes::NAME], obj_type)); object->setSchema(schema); - has_error=(!schema && !attribs_aux[ParsersAttributes::NAME].isEmpty()); + has_error=(!schema && !attribs_aux[Attributes::NAME].isEmpty()); } //Defines the object's tablespace - else if(elem_name==ParsersAttributes::TABLESPACE) + else if(elem_name==Attributes::TABLESPACE) { obj_type=ObjectType::Tablespace; xmlparser.getElementAttributes(attribs_aux); - tabspc=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); + tabspc=getObject(attribs_aux[Attributes::NAME], obj_type); object->setTablespace(tabspc); - has_error=(!tabspc && !attribs_aux[ParsersAttributes::NAME].isEmpty()); + has_error=(!tabspc && !attribs_aux[Attributes::NAME].isEmpty()); } //Defines the object's owner - else if(elem_name==ParsersAttributes::ROLE) + else if(elem_name==Attributes::ROLE) { obj_type=ObjectType::Role; xmlparser.getElementAttributes(attribs_aux); - owner=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); + owner=getObject(attribs_aux[Attributes::NAME], obj_type); object->setOwner(owner); - has_error=(!owner && !attribs_aux[ParsersAttributes::NAME].isEmpty()); + has_error=(!owner && !attribs_aux[Attributes::NAME].isEmpty()); } //Defines the object's schema - else if(elem_name==ParsersAttributes::COLLATION) + else if(elem_name==Attributes::Collation) { obj_type=ObjectType::Collation; xmlparser.getElementAttributes(attribs_aux); - collation=getObject(attribs_aux[ParsersAttributes::NAME], obj_type); + collation=getObject(attribs_aux[Attributes::NAME], obj_type); object->setCollation(collation); - has_error=(!collation && !attribs_aux[ParsersAttributes::NAME].isEmpty()); + has_error=(!collation && !attribs_aux[Attributes::NAME].isEmpty()); } - else if(elem_name==ParsersAttributes::AppendedSql) + else if(elem_name==Attributes::AppendedSql) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); object->setAppendedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } - else if(elem_name==ParsersAttributes::PREPENDED_SQL) + else if(elem_name==Attributes::PREPENDED_SQL) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -3326,16 +3326,16 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.restorePosition(); } //Defines the object's position (only for graphical objects) - else if(elem_name==ParsersAttributes::POSITION) + else if(elem_name==Attributes::POSITION) { xmlparser.getElementAttributes(attribs); - if(elem_name==ParsersAttributes::POSITION && + if(elem_name==Attributes::POSITION && (obj_type_aux!=ObjectType::Relationship && obj_type_aux!=ObjectType::BaseRelationship)) { - dynamic_cast(object)->setPosition(QPointF(attribs[ParsersAttributes::X_POS].toDouble(), - attribs[ParsersAttributes::Y_POS].toDouble())); + dynamic_cast(object)->setPosition(QPointF(attribs[Attributes::X_POS].toDouble(), + attribs[Attributes::Y_POS].toDouble())); } @@ -3354,7 +3354,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(object->getName()) .arg(object->getTypeName()) - .arg(attribs_aux[ParsersAttributes::NAME]) + .arg(attribs_aux[Attributes::NAME]) .arg(BaseObject::getTypeName(obj_type)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -3456,10 +3456,10 @@ Role *DatabaseModel::createRole(void) QString elem_name; unsigned role_type; - QString op_attribs[]={ ParsersAttributes::SUPERUSER, ParsersAttributes::CREATEDB, - ParsersAttributes::CREATEROLE, ParsersAttributes::INHERIT, - ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, - ParsersAttributes::REPLICATION, ParsersAttributes::BypassRls }; + QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, + Attributes::CreateRole, Attributes::INHERIT, + Attributes::LOGIN, Attributes::ENCRYPTED, + Attributes::REPLICATION, Attributes::BypassRls }; unsigned op_vect[]={ Role::OpSuperuser, Role::OpCreateDb, Role::OpCreateRole, Role::OpInherit, @@ -3474,16 +3474,16 @@ Role *DatabaseModel::createRole(void) //Gets all the attributes values from the XML xmlparser.getElementAttributes(attribs); - role->setPassword(attribs[ParsersAttributes::PASSWORD]); - role->setValidity(attribs[ParsersAttributes::VALIDITY]); + role->setPassword(attribs[Attributes::PASSWORD]); + role->setValidity(attribs[Attributes::VALIDITY]); - if(!attribs[ParsersAttributes::CONN_LIMIT].isEmpty()) - role->setConnectionLimit(attribs[ParsersAttributes::CONN_LIMIT].toInt()); + if(!attribs[Attributes::ConnLimit].isEmpty()) + role->setConnectionLimit(attribs[Attributes::ConnLimit].toInt()); //Setting up the role options according to the configured on the XML for(i=0; i < 8; i++) { - marked=attribs[op_attribs[i]]==ParsersAttributes::True; + marked=attribs[op_attribs[i]]==Attributes::True; role->setOption(op_vect[i], marked); } @@ -3496,19 +3496,19 @@ Role *DatabaseModel::createRole(void) elem_name=xmlparser.getElementName(); //Getting the member roles - if(elem_name==ParsersAttributes::ROLES) + if(elem_name==Attributes::ROLES) { //Gets the member roles attributes xmlparser.getElementAttributes(attribs_aux); //The member roles names are separated by comma, so it is needed to split them - list=attribs_aux[ParsersAttributes::NAMES].split(','); + list=attribs_aux[Attributes::NAMES].split(','); len=list.size(); //Identifying the member role type - if(attribs_aux[ParsersAttributes::ROLE_TYPE]==ParsersAttributes::REFER) + if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::REFER) role_type=Role::RefRole; - else if(attribs_aux[ParsersAttributes::ROLE_TYPE]==ParsersAttributes::MEMBER) + else if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::MEMBER) role_type=Role::MemberRole; else role_type=Role::AdminRole; @@ -3556,7 +3556,7 @@ Tablespace *DatabaseModel::createTablespace(void) tabspc=new Tablespace; setBasicAttributes(tabspc); xmlparser.getElementAttributes(attribs); - tabspc->setDirectory(attribs[ParsersAttributes::DIRECTORY]); + tabspc->setDirectory(attribs[Attributes::DIRECTORY]); } catch(Exception &e) { @@ -3577,9 +3577,9 @@ Schema *DatabaseModel::createSchema(void) schema=new Schema; xmlparser.getElementAttributes(attribs); setBasicAttributes(schema); - schema->setFillColor(QColor(attribs[ParsersAttributes::FILL_COLOR])); - schema->setRectVisible(attribs[ParsersAttributes::RECT_VISIBLE]==ParsersAttributes::True); - schema->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); + schema->setFillColor(QColor(attribs[Attributes::FILL_COLOR])); + schema->setRectVisible(attribs[Attributes::RECT_VISIBLE]==Attributes::True); + schema->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); } catch(Exception &e) { @@ -3604,7 +3604,7 @@ Language *DatabaseModel::createLanguage(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(lang); - lang->setTrusted(attribs[ParsersAttributes::TRUSTED]==ParsersAttributes::True); + lang->setTrusted(attribs[Attributes::TRUSTED]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3619,15 +3619,15 @@ Language *DatabaseModel::createLanguage(void) xmlparser.getElementAttributes(attribs); //Gets the function reference type - ref_type=attribs[ParsersAttributes::REF_TYPE]; + ref_type=attribs[Attributes::REF_TYPE]; //Only VALIDATOR, HANDLER and INLINE functions are accepted for the language - if(ref_type==ParsersAttributes::VALIDATOR_FUNC || - ref_type==ParsersAttributes::HANDLER_FUNC || - ref_type==ParsersAttributes::INLINE_FUNC) + if(ref_type==Attributes::VALIDATOR_FUNC || + ref_type==Attributes::HANDLER_FUNC || + ref_type==Attributes::INLINE_FUNC) { //Gets the function signature and tries to retrieve it from the model - signature=attribs[ParsersAttributes::SIGNATURE]; + signature=attribs[Attributes::SIGNATURE]; func=getObject(signature, ObjectType::Function); //Raises an error if the function doesn't exists @@ -3639,9 +3639,9 @@ Language *DatabaseModel::createLanguage(void) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(ref_type==ParsersAttributes::VALIDATOR_FUNC) + if(ref_type==Attributes::VALIDATOR_FUNC) lang->setFunction(dynamic_cast(func), Language::ValidatorFunc); - else if(ref_type==ParsersAttributes::HANDLER_FUNC) + else if(ref_type==Attributes::HANDLER_FUNC) lang->setFunction(dynamic_cast(func), Language::HandlerFunc); else lang->setFunction(dynamic_cast(func), Language::InlineFunc); @@ -3682,32 +3682,32 @@ Function *DatabaseModel::createFunction(void) setBasicAttributes(func); xmlparser.getElementAttributes(attribs); - if(!attribs[ParsersAttributes::RETURNS_SETOF].isEmpty()) - func->setReturnSetOf(attribs[ParsersAttributes::RETURNS_SETOF]== - ParsersAttributes::True); + if(!attribs[Attributes::RETURNS_SETOF].isEmpty()) + func->setReturnSetOf(attribs[Attributes::RETURNS_SETOF]== + Attributes::True); - if(!attribs[ParsersAttributes::WINDOW_FUNC].isEmpty()) - func->setWindowFunction(attribs[ParsersAttributes::WINDOW_FUNC]== - ParsersAttributes::True); + if(!attribs[Attributes::WINDOW_FUNC].isEmpty()) + func->setWindowFunction(attribs[Attributes::WINDOW_FUNC]== + Attributes::True); - if(!attribs[ParsersAttributes::LEAKPROOF].isEmpty()) - func->setLeakProof(attribs[ParsersAttributes::LEAKPROOF]== - ParsersAttributes::True); + if(!attribs[Attributes::LEAKPROOF].isEmpty()) + func->setLeakProof(attribs[Attributes::LEAKPROOF]== + Attributes::True); - if(!attribs[ParsersAttributes::BehaviorType].isEmpty()) - func->setBehaviorType(BehaviorType(attribs[ParsersAttributes::BehaviorType])); + if(!attribs[Attributes::BehaviorType].isEmpty()) + func->setBehaviorType(BehaviorType(attribs[Attributes::BehaviorType])); - if(!attribs[ParsersAttributes::FUNCTION_TYPE].isEmpty()) - func->setFunctionType(FunctionType(attribs[ParsersAttributes::FUNCTION_TYPE])); + if(!attribs[Attributes::FUNCTION_TYPE].isEmpty()) + func->setFunctionType(FunctionType(attribs[Attributes::FUNCTION_TYPE])); - if(!attribs[ParsersAttributes::SECURITY_TYPE].isEmpty()) - func->setSecurityType(SecurityType(attribs[ParsersAttributes::SECURITY_TYPE])); + if(!attribs[Attributes::SECURITY_TYPE].isEmpty()) + func->setSecurityType(SecurityType(attribs[Attributes::SECURITY_TYPE])); - if(!attribs[ParsersAttributes::EXECUTION_COST].isEmpty()) - func->setExecutionCost(attribs[ParsersAttributes::EXECUTION_COST].toInt()); + if(!attribs[Attributes::EXECUTION_COST].isEmpty()) + func->setExecutionCost(attribs[Attributes::EXECUTION_COST].toInt()); - if(!attribs[ParsersAttributes::ROW_AMOUNT].isEmpty()) - func->setRowAmount(attribs[ParsersAttributes::ROW_AMOUNT].toInt()); + if(!attribs[Attributes::ROW_AMOUNT].isEmpty()) + func->setRowAmount(attribs[Attributes::ROW_AMOUNT].toInt()); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3719,7 +3719,7 @@ Function *DatabaseModel::createFunction(void) obj_type=BaseObject::getObjectType(elem); //Gets the function return type from the XML - if(elem==ParsersAttributes::RETURN_TYPE) + if(elem==Attributes::RETURN_TYPE) { xmlparser.savePosition(); @@ -3732,13 +3732,13 @@ Function *DatabaseModel::createFunction(void) if(xmlparser.getElementType()==XML_ELEMENT_NODE) { //when the element found is a TYPE indicates that the function return type is a single one - if(xmlparser.getElementName()==ParsersAttributes::TYPE) + if(xmlparser.getElementName()==Attributes::TYPE) { type=createPgSQLType(); func->setReturnType(type); } //when the element found is a PARAMETER indicates that the function return type is a table - else if(xmlparser.getElementName()==ParsersAttributes::PARAMETER) + else if(xmlparser.getElementName()==Attributes::PARAMETER) { param=createParameter(); func->addReturnedTableColumn(param.getName(), param.getType()); @@ -3759,35 +3759,35 @@ Function *DatabaseModel::createFunction(void) else if(obj_type==ObjectType::Language) { xmlparser.getElementAttributes(attribs); - object=getObject(attribs[ParsersAttributes::NAME], obj_type); + object=getObject(attribs[Attributes::NAME], obj_type); //Raises an error if the function doesn't exisits if(!object) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(func->getName()) .arg(func->getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Language)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); func->setLanguage(dynamic_cast(object)); } //Gets a function parameter - else if(xmlparser.getElementName()==ParsersAttributes::PARAMETER) + else if(xmlparser.getElementName()==Attributes::PARAMETER) { param=createParameter(); func->addParameter(param); } //Gets the function code definition - else if(xmlparser.getElementName()==ParsersAttributes::DEFINITION) + else if(xmlparser.getElementName()==Attributes::DEFINITION) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs_aux); - if(!attribs_aux[ParsersAttributes::LIBRARY].isEmpty()) + if(!attribs_aux[Attributes::LIBRARY].isEmpty()) { - func->setLibrary(attribs_aux[ParsersAttributes::LIBRARY]); - func->setSymbol(attribs_aux[ParsersAttributes::SYMBOL]); + func->setLibrary(attribs_aux[Attributes::LIBRARY]); + func->setSymbol(attribs_aux[Attributes::SYMBOL]); } else if(xmlparser.accessElement(XmlParser::ChildElement)) func->setSourceCode(xmlparser.getElementContent()); @@ -3830,8 +3830,8 @@ Parameter DatabaseModel::createParameter(void) xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); - param.setName(attribs[ParsersAttributes::NAME]); - param.setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); + param.setName(attribs[Attributes::NAME]); + param.setDefaultValue(attribs[Attributes::DEFAULT_VALUE]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3841,7 +3841,7 @@ Parameter DatabaseModel::createParameter(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::TYPE) + if(elem==Attributes::TYPE) { param.setType(createPgSQLType()); } @@ -3850,9 +3850,9 @@ Parameter DatabaseModel::createParameter(void) while(xmlparser.accessElement(XmlParser::NextElement)); } - param.setIn(attribs[ParsersAttributes::PARAM_IN]==ParsersAttributes::True); - param.setOut(attribs[ParsersAttributes::PARAM_OUT]==ParsersAttributes::True); - param.setVariadic(attribs[ParsersAttributes::PARAM_VARIADIC]==ParsersAttributes::True); + param.setIn(attribs[Attributes::PARAM_IN]==Attributes::True); + param.setOut(attribs[Attributes::PARAM_OUT]==Attributes::True); + param.setVariadic(attribs[Attributes::PARAM_VARIADIC]==Attributes::True); xmlparser.restorePosition(); } @@ -3878,7 +3878,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); - tpattrib.setName(attribs[ParsersAttributes::NAME]); + tpattrib.setName(attribs[Attributes::NAME]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3888,15 +3888,15 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::TYPE) + if(elem==Attributes::TYPE) { tpattrib.setType(createPgSQLType()); } - else if(elem==ParsersAttributes::COLLATION) + else if(elem==Attributes::Collation) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[ParsersAttributes::NAME], ObjectType::Collation); + collation=getObject(attribs[Attributes::NAME], ObjectType::Collation); //Raises an error if the operator class doesn't exists if(!collation) @@ -3904,7 +3904,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tpattrib.getName()) .arg(tpattrib.getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -3941,29 +3941,29 @@ PgSqlType DatabaseModel::createPgSQLType(void) xmlparser.getElementAttributes(attribs); - if(!attribs[ParsersAttributes::LENGTH].isEmpty()) - length=attribs[ParsersAttributes::LENGTH].toUInt(); + if(!attribs[Attributes::LENGTH].isEmpty()) + length=attribs[Attributes::LENGTH].toUInt(); - if(!attribs[ParsersAttributes::DIMENSION].isEmpty()) - dimension=attribs[ParsersAttributes::DIMENSION].toUInt(); + if(!attribs[Attributes::DIMENSION].isEmpty()) + dimension=attribs[Attributes::DIMENSION].toUInt(); - if(!attribs[ParsersAttributes::PRECISION].isEmpty()) - precision=attribs[ParsersAttributes::PRECISION].toInt(); + if(!attribs[Attributes::PRECISION].isEmpty()) + precision=attribs[Attributes::PRECISION].toInt(); - with_timezone=(attribs[ParsersAttributes::WITH_TIMEZONE]==ParsersAttributes::True); - interv_type=attribs[ParsersAttributes::INTERVAL_TYPE]; + with_timezone=(attribs[Attributes::WITH_TIMEZONE]==Attributes::True); + interv_type=attribs[Attributes::INTERVAL_TYPE]; - if(!attribs[ParsersAttributes::SPATIAL_TYPE].isEmpty()) - spatial_type=SpatialType(attribs[ParsersAttributes::SPATIAL_TYPE], - attribs[ParsersAttributes::SRID].toUInt(), - attribs[ParsersAttributes::VARIATION].toUInt()); + if(!attribs[Attributes::SPATIAL_TYPE].isEmpty()) + spatial_type=SpatialType(attribs[Attributes::SPATIAL_TYPE], + attribs[Attributes::SRID].toUInt(), + attribs[Attributes::VARIATION].toUInt()); - name=attribs[ParsersAttributes::NAME]; + name=attribs[Attributes::NAME]; /* A small tweak to detect a timestamp/date type which name contains the time zone modifier. This situation can occur mainly on reverse engineering operation where the data type of objects in most of times came as string form and need to be parsed */ - if(!with_timezone && attribs[ParsersAttributes::NAME].contains(QString("with time zone"), Qt::CaseInsensitive)) + if(!with_timezone && attribs[Attributes::NAME].contains(QString("with time zone"), Qt::CaseInsensitive)) { with_timezone=true; name.remove(QString(" with time zone"), Qt::CaseInsensitive); @@ -4003,53 +4003,53 @@ Type *DatabaseModel::createType(void) setBasicAttributes(type); xmlparser.getElementAttributes(attribs); - if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BaseType) + if(attribs[Attributes::Configuration]==Attributes::BaseType) { type->setConfiguration(Type::BaseType); - type->setByValue(attribs[ParsersAttributes::ByValue]==ParsersAttributes::True); + type->setByValue(attribs[Attributes::ByValue]==Attributes::True); - if(!attribs[ParsersAttributes::INTERNAL_LENGTH].isEmpty()) - type->setInternalLength(attribs[ParsersAttributes::INTERNAL_LENGTH].toUInt()); + if(!attribs[Attributes::INTERNAL_LENGTH].isEmpty()) + type->setInternalLength(attribs[Attributes::INTERNAL_LENGTH].toUInt()); - if(!attribs[ParsersAttributes::Alignment].isEmpty()) - type->setAlignment(attribs[ParsersAttributes::Alignment]); + if(!attribs[Attributes::Alignment].isEmpty()) + type->setAlignment(attribs[Attributes::Alignment]); - if(!attribs[ParsersAttributes::STORAGE].isEmpty()) - type->setStorage(attribs[ParsersAttributes::STORAGE]); + if(!attribs[Attributes::STORAGE].isEmpty()) + type->setStorage(attribs[Attributes::STORAGE]); - if(!attribs[ParsersAttributes::ELEMENT].isEmpty()) - type->setElement(attribs[ParsersAttributes::ELEMENT]); + if(!attribs[Attributes::ELEMENT].isEmpty()) + type->setElement(attribs[Attributes::ELEMENT]); - if(!attribs[ParsersAttributes::DELIMITER].isEmpty()) - type->setDelimiter(attribs[ParsersAttributes::DELIMITER][0].toLatin1()); + if(!attribs[Attributes::DELIMITER].isEmpty()) + type->setDelimiter(attribs[Attributes::DELIMITER][0].toLatin1()); - if(!attribs[ParsersAttributes::DEFAULT_VALUE].isEmpty()) - type->setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); + if(!attribs[Attributes::DEFAULT_VALUE].isEmpty()) + type->setDefaultValue(attribs[Attributes::DEFAULT_VALUE]); - if(!attribs[ParsersAttributes::Category].isEmpty()) - type->setCategory(attribs[ParsersAttributes::Category]); + if(!attribs[Attributes::Category].isEmpty()) + type->setCategory(attribs[Attributes::Category]); - if(!attribs[ParsersAttributes::PREFERRED].isEmpty()) - type->setPreferred(attribs[ParsersAttributes::PREFERRED]==ParsersAttributes::True); + if(!attribs[Attributes::PREFERRED].isEmpty()) + type->setPreferred(attribs[Attributes::PREFERRED]==Attributes::True); //Configuring an auxiliary map used to reference the functions used by base type - func_types[ParsersAttributes::INPUT_FUNC]=Type::InputFunc; - func_types[ParsersAttributes::OUTPUT_FUNC]=Type::OutputFunc; - func_types[ParsersAttributes::SEND_FUNC]=Type::SendFunc; - func_types[ParsersAttributes::RECV_FUNC]=Type::RecvFunc; - func_types[ParsersAttributes::TPMOD_IN_FUNC]=Type::TpmodInFunc; - func_types[ParsersAttributes::TPMOD_OUT_FUNC]=Type::TpmodOutFunc; - func_types[ParsersAttributes::AnalyzeFunc]=Type::AnalyzeFunc; - } - else if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::COMPOSITE_TYPE) + func_types[Attributes::INPUT_FUNC]=Type::InputFunc; + func_types[Attributes::OUTPUT_FUNC]=Type::OutputFunc; + func_types[Attributes::SEND_FUNC]=Type::SendFunc; + func_types[Attributes::RECV_FUNC]=Type::RecvFunc; + func_types[Attributes::TPMOD_IN_FUNC]=Type::TpmodInFunc; + func_types[Attributes::TPMOD_OUT_FUNC]=Type::TpmodOutFunc; + func_types[Attributes::AnalyzeFunc]=Type::AnalyzeFunc; + } + else if(attribs[Attributes::Configuration]==Attributes::CompositeType) type->setConfiguration(Type::CompositeType); - else if(attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::ENUM_TYPE) + else if(attribs[Attributes::Configuration]==Attributes::ENUM_TYPE) type->setConfiguration(Type::EnumerationType); else { type->setConfiguration(Type::RangeType); - func_types[ParsersAttributes::CanonicalFunc]=Type::CanonicalFunc; - func_types[ParsersAttributes::SUBTYPE_DIFF_FUNC]=Type::SubtypeDiffFunc; + func_types[Attributes::CanonicalFunc]=Type::CanonicalFunc; + func_types[Attributes::SUBTYPE_DIFF_FUNC]=Type::SubtypeDiffFunc; } if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -4061,22 +4061,22 @@ Type *DatabaseModel::createType(void) elem=xmlparser.getElementName(); //Specific operations for ENUM type - if(elem==ParsersAttributes::ENUM_TYPE) + if(elem==Attributes::ENUM_TYPE) { xmlparser.getElementAttributes(attribs); - enums=attribs[ParsersAttributes::VALUES].split(','); + enums=attribs[Attributes::VALUES].split(','); count=enums.size(); for(i=0; i < count; i++) type->addEnumeration(enums[i]); } //Specific operations for COMPOSITE types - else if(elem==ParsersAttributes::TYPE_ATTRIBUTE) + else if(elem==Attributes::TYPE_ATTRIBUTE) { type->addAttribute(createTypeAttribute()); } //Specific operations for BASE / RANGE type - else if(elem==ParsersAttributes::TYPE) + else if(elem==Attributes::TYPE) { aux_type=createPgSQLType(); @@ -4085,10 +4085,10 @@ Type *DatabaseModel::createType(void) else type->setLikeType(aux_type); } - else if(elem==ParsersAttributes::COLLATION) + else if(elem==Attributes::Collation) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[ParsersAttributes::NAME], ObjectType::Collation); + collation=getObject(attribs[Attributes::NAME], ObjectType::Collation); //Raises an error if the operator class doesn't exists if(!collation) @@ -4096,17 +4096,17 @@ Type *DatabaseModel::createType(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } type->setCollation(collation); } - if(elem==ParsersAttributes::OP_CLASS) + if(elem==Attributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjectType::OpClass)); + op_class=dynamic_cast(getObject(attribs[Attributes::NAME], ObjectType::OpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -4114,7 +4114,7 @@ Type *DatabaseModel::createType(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4122,26 +4122,26 @@ Type *DatabaseModel::createType(void) type->setSubtypeOpClass(op_class); } //Configuring the functions used by the type (only for BASE type) - else if(elem==ParsersAttributes::FUNCTION) + else if(elem==Attributes::FUNCTION) { xmlparser.getElementAttributes(attribs); //Tries to get the function from the model - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the function type is invalid - else if(func_types.count(attribs[ParsersAttributes::REF_TYPE])==0) + else if(func_types.count(attribs[Attributes::REF_TYPE])==0) throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); - type->setFunction(func_types[attribs[ParsersAttributes::REF_TYPE]], dynamic_cast(func)); + type->setFunction(func_types[attribs[Attributes::REF_TYPE]], dynamic_cast(func)); } } } @@ -4180,10 +4180,10 @@ Domain *DatabaseModel::createDomain(void) setBasicAttributes(domain); xmlparser.getElementAttributes(attribs); - if(!attribs[ParsersAttributes::DEFAULT_VALUE].isEmpty()) - domain->setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); + if(!attribs[Attributes::DEFAULT_VALUE].isEmpty()) + domain->setDefaultValue(attribs[Attributes::DEFAULT_VALUE]); - domain->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::True); + domain->setNotNull(attribs[Attributes::NOT_NULL]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4194,17 +4194,17 @@ Domain *DatabaseModel::createDomain(void) elem=xmlparser.getElementName(); //If a type element is found it'll be extracted an type which the domain is applied - if(elem==ParsersAttributes::TYPE) + if(elem==Attributes::TYPE) { domain->setType(createPgSQLType()); } - else if(elem==ParsersAttributes::CONSTRAINT) + else if(elem==Attributes::Constraint) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); xmlparser.accessElement(XmlParser::ChildElement); xmlparser.accessElement(XmlParser::ChildElement); - domain->addCheckConstraint(attribs[ParsersAttributes::NAME], xmlparser.getElementContent()); + domain->addCheckConstraint(attribs[Attributes::NAME], xmlparser.getElementContent()); xmlparser.restorePosition(); } } @@ -4236,14 +4236,14 @@ Cast *DatabaseModel::createCast(void) setBasicAttributes(cast); xmlparser.getElementAttributes(attribs); - if(attribs[ParsersAttributes::CastType]==ParsersAttributes::IMPLICIT) + if(attribs[Attributes::CastType]==Attributes::IMPLICIT) cast->setCastType(Cast::Implicit); - else if(attribs[ParsersAttributes::CastType]==ParsersAttributes::Assignment) + else if(attribs[Attributes::CastType]==Attributes::Assignment) cast->setCastType(Cast::Assignment); else cast->setCastType(Cast::Explicit); - cast->setInOut(attribs[ParsersAttributes::IO_CAST]==ParsersAttributes::True); + cast->setInOut(attribs[Attributes::IO_CAST]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4254,7 +4254,7 @@ Cast *DatabaseModel::createCast(void) elem=xmlparser.getElementName(); //Extract one argument type from the XML - if(elem==ParsersAttributes::TYPE) + if(elem==Attributes::TYPE) { type=createPgSQLType(); if(type_idx==0) @@ -4264,17 +4264,17 @@ Cast *DatabaseModel::createCast(void) type_idx++; } //Extracts the conversion function - else if(elem==ParsersAttributes::FUNCTION) + else if(elem==Attributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(cast->getName()) .arg(cast->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4308,12 +4308,12 @@ Conversion *DatabaseModel::createConversion(void) xmlparser.getElementAttributes(attribs); conv->setEncoding(Conversion::SrcEncoding, - EncodingType(attribs[ParsersAttributes::SRC_ENCODING])); + EncodingType(attribs[Attributes::SRC_ENCODING])); conv->setEncoding(Conversion::DstEncoding, - EncodingType(attribs[ParsersAttributes::DST_ENCODING])); + EncodingType(attribs[Attributes::DST_ENCODING])); - conv->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::True); + conv->setDefault(attribs[Attributes::DEFAULT]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4323,17 +4323,17 @@ Conversion *DatabaseModel::createConversion(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::FUNCTION) + if(elem==Attributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(conv->getName()) .arg(conv->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4370,15 +4370,15 @@ Operator *DatabaseModel::createOperator(void) setBasicAttributes(oper); xmlparser.getElementAttributes(attribs); - oper->setMerges(attribs[ParsersAttributes::MERGES]==ParsersAttributes::True); - oper->setHashes(attribs[ParsersAttributes::HASHES]==ParsersAttributes::True); + oper->setMerges(attribs[Attributes::MERGES]==Attributes::True); + oper->setHashes(attribs[Attributes::HASHES]==Attributes::True); - func_types[ParsersAttributes::OPERATOR_FUNC]=Operator::FUNC_OPERATOR; - func_types[ParsersAttributes::JOIN_FUNC]=Operator::FUNC_JOIN; - func_types[ParsersAttributes::RESTRICTION_FUNC]=Operator::FUNC_RESTRICT; + func_types[Attributes::OPERATOR_FUNC]=Operator::FUNC_OPERATOR; + func_types[Attributes::JOIN_FUNC]=Operator::FUNC_JOIN; + func_types[Attributes::RESTRICTION_FUNC]=Operator::FUNC_RESTRICT; - oper_types[ParsersAttributes::COMMUTATOR_OP]=Operator::OPER_COMMUTATOR; - oper_types[ParsersAttributes::NEGATOR_OP]=Operator::OPER_NEGATOR; + oper_types[Attributes::CommutatorOp]=Operator::OPER_COMMUTATOR; + oper_types[Attributes::NEGATOR_OP]=Operator::OPER_NEGATOR; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4391,25 +4391,25 @@ Operator *DatabaseModel::createOperator(void) if(elem==objs_schemas[~ObjectType::Operator]) { xmlparser.getElementAttributes(attribs); - oper_aux=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Operator); + oper_aux=getObject(attribs[Attributes::SIGNATURE], ObjectType::Operator); //Raises an error if the auxiliary operator doesn't exists - if(!oper_aux && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) + if(!oper_aux && !attribs[Attributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(oper->getSignature(true)) .arg(oper->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setOperator(dynamic_cast(oper_aux), - oper_types[attribs[ParsersAttributes::REF_TYPE]]); + oper_types[attribs[Attributes::REF_TYPE]]); } - else if(elem==ParsersAttributes::TYPE) + else if(elem==Attributes::TYPE) { xmlparser.getElementAttributes(attribs); - if(attribs[ParsersAttributes::REF_TYPE]!=ParsersAttributes::RIGHT_TYPE) + if(attribs[Attributes::REF_TYPE]!=Attributes::RIGHT_TYPE) arg_type=Operator::LEFT_ARG; else arg_type=Operator::RIGHT_ARG; @@ -4417,22 +4417,22 @@ Operator *DatabaseModel::createOperator(void) type=createPgSQLType(); oper->setArgumentType(type, arg_type); } - else if(elem==ParsersAttributes::FUNCTION) + else if(elem==Attributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists on the model - if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(oper->getName()) .arg(oper->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setFunction(dynamic_cast(func), - func_types[attribs[ParsersAttributes::REF_TYPE]]); + func_types[attribs[Attributes::REF_TYPE]]); } } } @@ -4465,12 +4465,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) setBasicAttributes(op_class); xmlparser.getElementAttributes(attribs); - op_class->setIndexingType(IndexingType(attribs[ParsersAttributes::INDEX_TYPE])); - op_class->setDefault(attribs[ParsersAttributes::DEFAULT]==ParsersAttributes::True); + op_class->setIndexingType(IndexingType(attribs[Attributes::INDEX_TYPE])); + op_class->setDefault(attribs[Attributes::DEFAULT]==Attributes::True); - elem_types[ParsersAttributes::FUNCTION]=OperatorClassElement::FunctionElem; - elem_types[ParsersAttributes::OPERATOR]=OperatorClassElement::OperatorElem; - elem_types[ParsersAttributes::STORAGE]=OperatorClassElement::StorageElem; + elem_types[Attributes::FUNCTION]=OperatorClassElement::FunctionElem; + elem_types[Attributes::OPERATOR]=OperatorClassElement::OperatorElem; + elem_types[Attributes::STORAGE]=OperatorClassElement::StorageElem; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4483,31 +4483,31 @@ OperatorClass *DatabaseModel::createOperatorClass(void) if(elem==objs_schemas[~ObjectType::OpFamily]) { xmlparser.getElementAttributes(attribs); - object=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::OpFamily); + object=getObject(attribs[Attributes::SIGNATURE], ObjectType::OpFamily); //Raises an error if the operator family doesn't exists if(!object) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::OpFamily)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); op_class->setFamily(dynamic_cast(object)); } - else if(elem==ParsersAttributes::TYPE) + else if(elem==Attributes::TYPE) { xmlparser.getElementAttributes(attribs); type=createPgSQLType(); op_class->setDataType(type); } - else if(elem==ParsersAttributes::ELEMENT) + else if(elem==Attributes::ELEMENT) { xmlparser.getElementAttributes(attribs); - stg_number=attribs[ParsersAttributes::STRATEGY_NUM].toUInt(); - elem_type=elem_types[attribs[ParsersAttributes::TYPE]]; + stg_number=attribs[Attributes::STRATEGY_NUM].toUInt(); + elem_type=elem_types[attribs[Attributes::TYPE]]; xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -4520,12 +4520,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) } else if(elem_type==OperatorClassElement::FunctionElem) { - object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjectType::Function); + object=getObject(attribs[Attributes::SIGNATURE],ObjectType::Function); class_elem.setFunction(dynamic_cast(object),stg_number); } else if(elem_type==OperatorClassElement::OperatorElem) { - object=getObject(attribs[ParsersAttributes::SIGNATURE],ObjectType::Operator); + object=getObject(attribs[Attributes::SIGNATURE],ObjectType::Operator); class_elem.setOperator(dynamic_cast(object),stg_number); if(xmlparser.hasElement(XmlParser::NextElement)) @@ -4534,13 +4534,13 @@ OperatorClass *DatabaseModel::createOperatorClass(void) xmlparser.accessElement(XmlParser::NextElement); xmlparser.getElementAttributes(attribs_aux); - object=getObject(attribs_aux[ParsersAttributes::SIGNATURE],ObjectType::OpFamily); + object=getObject(attribs_aux[Attributes::SIGNATURE],ObjectType::OpFamily); - if(!object && !attribs_aux[ParsersAttributes::SIGNATURE].isEmpty()) + if(!object && !attribs_aux[Attributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) - .arg(attribs_aux[ParsersAttributes::SIGNATURE]) + .arg(attribs_aux[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::OpFamily)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4576,7 +4576,7 @@ OperatorFamily *DatabaseModel::createOperatorFamily(void) op_family=new OperatorFamily; setBasicAttributes(op_family); xmlparser.getElementAttributes(attribs); - op_family->setIndexingType(IndexingType(attribs[ParsersAttributes::INDEX_TYPE])); + op_family->setIndexingType(IndexingType(attribs[Attributes::INDEX_TYPE])); } catch(Exception &e) { @@ -4601,7 +4601,7 @@ Aggregate *DatabaseModel::createAggregate(void) setBasicAttributes(aggreg); xmlparser.getElementAttributes(attribs); - aggreg->setInitialCondition(attribs[ParsersAttributes::INITIAL_COND]); + aggreg->setInitialCondition(attribs[Attributes::INITIAL_COND]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4611,31 +4611,31 @@ Aggregate *DatabaseModel::createAggregate(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::TYPE) + if(elem==Attributes::TYPE) { xmlparser.getElementAttributes(attribs); type=createPgSQLType(); - if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::STATE_TYPE) + if(attribs[Attributes::REF_TYPE]==Attributes::STATE_TYPE) aggreg->setStateType(type); else aggreg->addDataType(type); } - else if(elem==ParsersAttributes::FUNCTION) + else if(elem==Attributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists on the model - if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(aggreg->getName()) .arg(aggreg->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::TRANSITION_FUNC) + if(attribs[Attributes::REF_TYPE]==Attributes::TRANSITION_FUNC) aggreg->setFunction(Aggregate::TransitionFunc, dynamic_cast(func)); else @@ -4675,14 +4675,14 @@ Table *DatabaseModel::createTable(void) setBasicAttributes(table); xmlparser.getElementAttributes(attribs); - table->setObjectListsCapacity(attribs[ParsersAttributes::MAX_OBJ_COUNT].toUInt()); - table->setWithOIDs(attribs[ParsersAttributes::OIDS]==ParsersAttributes::True); - table->setUnlogged(attribs[ParsersAttributes::UNLOGGED]==ParsersAttributes::True); - table->setRLSEnabled(attribs[ParsersAttributes::RLS_ENABLED]==ParsersAttributes::True); - table->setRLSForced(attribs[ParsersAttributes::RLS_FORCED]==ParsersAttributes::True); - table->setGenerateAlterCmds(attribs[ParsersAttributes::GEN_ALTER_CMDS]==ParsersAttributes::True); - table->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::True); - table->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); + table->setObjectListsCapacity(attribs[Attributes::MAX_OBJ_COUNT].toUInt()); + table->setWithOIDs(attribs[Attributes::OIDS]==Attributes::True); + table->setUnlogged(attribs[Attributes::UNLOGGED]==Attributes::True); + table->setRLSEnabled(attribs[Attributes::RLS_ENABLED]==Attributes::True); + table->setRLSForced(attribs[Attributes::RLS_FORCED]==Attributes::True); + table->setGenerateAlterCmds(attribs[Attributes::GEN_ALTER_CMDS]==Attributes::True); + table->setExtAttribsHidden(attribs[Attributes::HIDE_EXT_ATTRIBS]==Attributes::True); + table->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4701,14 +4701,14 @@ Table *DatabaseModel::createTable(void) else if(elem==BaseObject::objs_schemas[~ObjectType::Tag]) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME], ObjectType::Tag); + tag=getObject(aux_attribs[Attributes::NAME], ObjectType::Tag); if(!tag) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Table)) - .arg(aux_attribs[ParsersAttributes::TABLE]) + .arg(aux_attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Tag)) , ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4716,10 +4716,10 @@ Table *DatabaseModel::createTable(void) table->setTag(dynamic_cast(tag)); } //Retrieving custom columns / constraint indexes - else if(elem==ParsersAttributes::CUSTOMIDXS) + else if(elem==Attributes::CustomIdxs) { xmlparser.getElementAttributes(aux_attribs); - obj_type=BaseObject::getObjectType(aux_attribs[ParsersAttributes::OBJECT_TYPE]); + obj_type=BaseObject::getObjectType(aux_attribs[Attributes::OBJECT_TYPE]); xmlparser.savePosition(); @@ -4732,11 +4732,11 @@ Table *DatabaseModel::createTable(void) elem=xmlparser.getElementName(); //The element stores the index for each object in the current group - if(elem==ParsersAttributes::OBJECT) + if(elem==Attributes::OBJECT) { xmlparser.getElementAttributes(aux_attribs); - names.push_back(aux_attribs[ParsersAttributes::NAME]); - idxs.push_back(aux_attribs[ParsersAttributes::INDEX].toUInt()); + names.push_back(aux_attribs[Attributes::NAME]); + idxs.push_back(aux_attribs[Attributes::INDEX].toUInt()); } } } @@ -4749,10 +4749,10 @@ Table *DatabaseModel::createTable(void) xmlparser.restorePosition(); } - else if(elem==ParsersAttributes::PARTITIONING) + else if(elem==Attributes::PARTITIONING) { xmlparser.getElementAttributes(aux_attribs); - table->setPartitioningType(aux_attribs[ParsersAttributes::TYPE]); + table->setPartitioningType(aux_attribs[Attributes::TYPE]); xmlparser.savePosition(); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -4760,7 +4760,7 @@ Table *DatabaseModel::createTable(void) do { if(xmlparser.getElementType()==XML_ELEMENT_NODE && - xmlparser.getElementName()==ParsersAttributes::PARTITION_KEY) + xmlparser.getElementName()==Attributes::PARTITION_KEY) { createElement(part_key, nullptr, table); partition_keys.push_back(part_key); @@ -4774,7 +4774,7 @@ Table *DatabaseModel::createTable(void) xmlparser.restorePosition(); } //Retrieving initial data - else if(elem==ParsersAttributes::INITIAL_DATA) + else if(elem==Attributes::INITIAL_DATA) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -4818,23 +4818,23 @@ Column *DatabaseModel::createColumn(void) setBasicAttributes(column); xmlparser.getElementAttributes(attribs); - column->setNotNull(attribs[ParsersAttributes::NOT_NULL]==ParsersAttributes::True); - column->setDefaultValue(attribs[ParsersAttributes::DEFAULT_VALUE]); - column->setIdSeqAttributes(attribs[ParsersAttributes::MIN_VALUE], attribs[ParsersAttributes::MAX_VALUE], attribs[ParsersAttributes::INCREMENT], - attribs[ParsersAttributes::START], attribs[ParsersAttributes::Cache], attribs[ParsersAttributes::CYCLE] == ParsersAttributes::True); + column->setNotNull(attribs[Attributes::NOT_NULL]==Attributes::True); + column->setDefaultValue(attribs[Attributes::DEFAULT_VALUE]); + column->setIdSeqAttributes(attribs[Attributes::MIN_VALUE], attribs[Attributes::MAX_VALUE], attribs[Attributes::INCREMENT], + attribs[Attributes::START], attribs[Attributes::Cache], attribs[Attributes::Cycle] == Attributes::True); - if(!attribs[ParsersAttributes::IDENTITY_TYPE].isEmpty()) - column->setIdentityType(IdentityType(attribs[ParsersAttributes::IDENTITY_TYPE])); + if(!attribs[Attributes::IDENTITY_TYPE].isEmpty()) + column->setIdentityType(IdentityType(attribs[Attributes::IDENTITY_TYPE])); - if(!attribs[ParsersAttributes::SEQUENCE].isEmpty()) + if(!attribs[Attributes::SEQUENCE].isEmpty()) { - seq=getObject(attribs[ParsersAttributes::SEQUENCE], ObjectType::Sequence); + seq=getObject(attribs[Attributes::SEQUENCE], ObjectType::Sequence); if(!seq) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Column)) - .arg(attribs[ParsersAttributes::SEQUENCE]) + .arg(attribs[Attributes::SEQUENCE]) .arg(BaseObject::getTypeName(ObjectType::Sequence)), ErrorCode::PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4850,7 +4850,7 @@ Column *DatabaseModel::createColumn(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::TYPE) + if(elem==Attributes::TYPE) { column->setType(createPgSQLType()); } @@ -4906,7 +4906,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) else { obj_type=ObjectType::Table; - table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); + table=dynamic_cast
(getObject(attribs[Attributes::TABLE], ObjectType::Table)); parent_obj=table; ins_constr_table=true; @@ -4914,9 +4914,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(!table) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Constraint)) - .arg(attribs[ParsersAttributes::TABLE]) + .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4927,21 +4927,21 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setParentTable(table); //Configuring the constraint type - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::CkConstr) + if(attribs[Attributes::TYPE]==Attributes::CkConstr) constr_type=ConstraintType::Check; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::PK_CONSTR) + else if(attribs[Attributes::TYPE]==Attributes::PK_CONSTR) constr_type=ConstraintType::PrimaryKey; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::FK_CONSTR) + else if(attribs[Attributes::TYPE]==Attributes::FK_CONSTR) constr_type=ConstraintType::ForeignKey; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::UQ_CONSTR) + else if(attribs[Attributes::TYPE]==Attributes::UQ_CONSTR) constr_type=ConstraintType::Unique; else constr_type=ConstraintType::Exclude; constr->setConstraintType(constr_type); - if(!attribs[ParsersAttributes::FACTOR].isEmpty()) - constr->setFillFactor(attribs[ParsersAttributes::FACTOR].toUInt()); + if(!attribs[Attributes::FACTOR].isEmpty()) + constr->setFillFactor(attribs[Attributes::FACTOR].toUInt()); setBasicAttributes(constr); @@ -4951,26 +4951,26 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) .arg(constr->getName()), ErrorCode::InvPrimaryKeyAllocation,__PRETTY_FUNCTION__,__FILE__,__LINE__); - deferrable=(attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::True); + deferrable=(attribs[Attributes::DEFERRABLE]==Attributes::True); constr->setDeferrable(deferrable); - if(deferrable && !attribs[ParsersAttributes::DEFER_TYPE].isEmpty()) - constr->setDeferralType(attribs[ParsersAttributes::DEFER_TYPE]); + if(deferrable && !attribs[Attributes::DEFER_TYPE].isEmpty()) + constr->setDeferralType(attribs[Attributes::DEFER_TYPE]); if(constr_type==ConstraintType::ForeignKey) { - if(!attribs[ParsersAttributes::COMPARISON_TYPE].isEmpty()) - constr->setMatchType(attribs[ParsersAttributes::COMPARISON_TYPE]); + if(!attribs[Attributes::ComparisonType].isEmpty()) + constr->setMatchType(attribs[Attributes::ComparisonType]); - if(!attribs[ParsersAttributes::DEL_ACTION].isEmpty()) - constr->setActionType(attribs[ParsersAttributes::DEL_ACTION], Constraint::DeleteAction); + if(!attribs[Attributes::DEL_ACTION].isEmpty()) + constr->setActionType(attribs[Attributes::DEL_ACTION], Constraint::DeleteAction); - if(!attribs[ParsersAttributes::UPD_ACTION].isEmpty()) - constr->setActionType(attribs[ParsersAttributes::UPD_ACTION], Constraint::UpdateAction); + if(!attribs[Attributes::UPD_ACTION].isEmpty()) + constr->setActionType(attribs[Attributes::UPD_ACTION], Constraint::UpdateAction); - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::Table); + ref_table=getObject(attribs[Attributes::REF_TABLE], ObjectType::Table); - if(!ref_table && table->getName(true)==attribs[ParsersAttributes::REF_TABLE]) + if(!ref_table && table->getName(true)==attribs[Attributes::REF_TABLE]) ref_table=table; //Raises an error if the referenced table doesn't exists @@ -4979,7 +4979,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(constr->getName()) .arg(constr->getTypeName()) - .arg(attribs[ParsersAttributes::REF_TABLE]) + .arg(attribs[Attributes::REF_TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4989,11 +4989,11 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) } else if(constr_type==ConstraintType::Check) { - constr->setNoInherit(attribs[ParsersAttributes::NO_INHERIT]==ParsersAttributes::True); + constr->setNoInherit(attribs[Attributes::NO_INHERIT]==Attributes::True); } - else if(constr_type==ConstraintType::Exclude && !attribs[ParsersAttributes::INDEX_TYPE].isEmpty()) + else if(constr_type==ConstraintType::Exclude && !attribs[Attributes::INDEX_TYPE].isEmpty()) { - constr->setIndexType(attribs[ParsersAttributes::INDEX_TYPE]); + constr->setIndexType(attribs[Attributes::INDEX_TYPE]); } if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5004,12 +5004,12 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::EXCLUDE_ELEMENT) + if(elem==Attributes::EXCLUDE_ELEMENT) { createElement(exc_elem, constr, parent_obj); constr->addExcludeElement(exc_elem); } - else if(elem==ParsersAttributes::EXPRESSION) + else if(elem==Attributes::EXPRESSION) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5018,14 +5018,14 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) xmlparser.restorePosition(); } - else if(elem==ParsersAttributes::COLUMNS) + else if(elem==Attributes::Columns) { xmlparser.getElementAttributes(attribs); - col_list=attribs[ParsersAttributes::NAMES].split(','); + col_list=attribs[Attributes::NAMES].split(','); count=col_list.count(); - if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::SRC_COLUMNS) + if(attribs[Attributes::REF_TYPE]==Attributes::SRC_COLUMNS) col_type=Constraint::SourceCols; else col_type=Constraint::ReferencedCols; @@ -5093,9 +5093,9 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec bool is_part_key = false; xml_elem=xmlparser.getElementName(); - is_part_key = xml_elem == ParsersAttributes::PARTITION_KEY; + is_part_key = xml_elem == Attributes::PARTITION_KEY; - if(xml_elem==ParsersAttributes::INDEX_ELEMENT || xml_elem==ParsersAttributes::EXCLUDE_ELEMENT || is_part_key) + if(xml_elem==Attributes::INDEX_ELEMENT || xml_elem==Attributes::EXCLUDE_ELEMENT || is_part_key) { xmlparser.getElementAttributes(attribs); @@ -5104,9 +5104,9 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setOperator(nullptr); elem.setOperatorClass(nullptr); - elem.setSortingAttribute(Element::AscOrder, attribs[ParsersAttributes::AscOrder]==ParsersAttributes::True); - elem.setSortingAttribute(Element::NullsFirst, attribs[ParsersAttributes::NULLS_FIRST]==ParsersAttributes::True); - elem.setSortingEnabled(attribs[ParsersAttributes::USE_SORTING]!=ParsersAttributes::False); + elem.setSortingAttribute(Element::AscOrder, attribs[Attributes::AscOrder]==Attributes::True); + elem.setSortingAttribute(Element::NullsFirst, attribs[Attributes::NULLS_FIRST]==Attributes::True); + elem.setSortingEnabled(attribs[Attributes::USE_SORTING]!=Attributes::False); xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5117,10 +5117,10 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec if(xmlparser.getElementType()==XML_ELEMENT_NODE) { - if(xml_elem==ParsersAttributes::OP_CLASS) + if(xml_elem==Attributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::OpClass)); + op_class=dynamic_cast(getObject(attribs[Attributes::SIGNATURE], ObjectType::OpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -5130,7 +5130,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5138,7 +5138,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5147,10 +5147,10 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setOperatorClass(op_class); } //Checking if elem is a ExcludeElement to be able to assign an operator to it - else if(xml_elem==ParsersAttributes::OPERATOR) + else if(xml_elem==Attributes::OPERATOR) { xmlparser.getElementAttributes(attribs); - oper=dynamic_cast(getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Operator)); + oper=dynamic_cast(getObject(attribs[Attributes::SIGNATURE], ObjectType::Operator)); //Raises an error if the operator doesn't exists if(!oper) @@ -5158,17 +5158,17 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } elem.setOperator(oper); } - else if(xml_elem==ParsersAttributes::COLLATION) + else if(xml_elem==Attributes::Collation) { xmlparser.getElementAttributes(attribs); - collation=dynamic_cast(getObject(attribs[ParsersAttributes::NAME], ObjectType::Collation)); + collation=dynamic_cast(getObject(attribs[Attributes::NAME], ObjectType::Collation)); //Raises an error if the operator class doesn't exists if(!collation) @@ -5178,7 +5178,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5186,7 +5186,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5194,20 +5194,20 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setCollation(collation); } - else if(xml_elem==ParsersAttributes::COLUMN) + else if(xml_elem==Attributes::Column) { xmlparser.getElementAttributes(attribs); if(parent_obj->getObjectType()==ObjectType::Table) { - column=dynamic_cast
(parent_obj)->getColumn(attribs[ParsersAttributes::NAME]); + column=dynamic_cast
(parent_obj)->getColumn(attribs[Attributes::NAME]); if(!column) - column=dynamic_cast
(parent_obj)->getColumn(attribs[ParsersAttributes::NAME], true); + column=dynamic_cast
(parent_obj)->getColumn(attribs[Attributes::NAME], true); } else { - column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[ParsersAttributes::NAME], ObjectType::Column)); + column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[Attributes::NAME], ObjectType::Column)); } //Raises an error if the column doesn't exists @@ -5218,7 +5218,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Column)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5226,7 +5226,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Column)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5234,7 +5234,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setColumn(column); } - else if(xml_elem==ParsersAttributes::EXPRESSION) + else if(xml_elem==Attributes::EXPRESSION) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5266,17 +5266,17 @@ QString DatabaseModel::getAlterDefinition(BaseObject *object) QString alter_def; attribs_map aux_attribs; - aux_attribs[ParsersAttributes::SIGNATURE] = this->getSignature(); - aux_attribs[ParsersAttributes::SQL_OBJECT] = this->getSQLName(); + aux_attribs[Attributes::SIGNATURE] = this->getSignature(); + aux_attribs[Attributes::SQL_OBJECT] = this->getSQLName(); if(this->conn_limit!=db_aux->conn_limit) - aux_attribs[ParsersAttributes::CONN_LIMIT]=QString::number(db_aux->conn_limit); + aux_attribs[Attributes::ConnLimit]=QString::number(db_aux->conn_limit); if(this->is_template != db_aux->is_template) - aux_attribs[ParsersAttributes::IS_TEMPLATE] = (db_aux->is_template ? ParsersAttributes::True : ParsersAttributes::False); + aux_attribs[Attributes::IS_TEMPLATE] = (db_aux->is_template ? Attributes::True : Attributes::False); if(this->allow_conns != db_aux->allow_conns) - aux_attribs[ParsersAttributes::AllowConns] = (db_aux->allow_conns ? ParsersAttributes::True : ParsersAttributes::False); + aux_attribs[Attributes::AllowConns] = (db_aux->allow_conns ? Attributes::True : Attributes::False); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), aux_attribs, true, false); alter_def+=BaseObject::getAlterDefinition(object); @@ -5301,18 +5301,18 @@ Index *DatabaseModel::createIndex(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); + table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::View)); + table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::View)); //Raises an error if the parent table doesn't exists if(!table) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Index)) - .arg(attribs[ParsersAttributes::TABLE]) + .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5321,12 +5321,12 @@ Index *DatabaseModel::createIndex(void) index=new Index; setBasicAttributes(index); index->setParentTable(table); - index->setIndexAttribute(Index::Concurrent, attribs[ParsersAttributes::CONCURRENT]==ParsersAttributes::True); - index->setIndexAttribute(Index::Unique, attribs[ParsersAttributes::UNIQUE]==ParsersAttributes::True); - index->setIndexAttribute(Index::FastUpdate, attribs[ParsersAttributes::FAST_UPDATE]==ParsersAttributes::True); - index->setIndexAttribute(Index::Buffering, attribs[ParsersAttributes::Buffering]==ParsersAttributes::True); - index->setIndexingType(attribs[ParsersAttributes::INDEX_TYPE]); - index->setFillFactor(attribs[ParsersAttributes::FACTOR].toUInt()); + index->setIndexAttribute(Index::Concurrent, attribs[Attributes::Concurrent]==Attributes::True); + index->setIndexAttribute(Index::Unique, attribs[Attributes::UNIQUE]==Attributes::True); + index->setIndexAttribute(Index::FastUpdate, attribs[Attributes::FAST_UPDATE]==Attributes::True); + index->setIndexAttribute(Index::Buffering, attribs[Attributes::Buffering]==Attributes::True); + index->setIndexingType(attribs[Attributes::INDEX_TYPE]); + index->setFillFactor(attribs[Attributes::FACTOR].toUInt()); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5336,12 +5336,12 @@ Index *DatabaseModel::createIndex(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::INDEX_ELEMENT) + if(elem==Attributes::INDEX_ELEMENT) { createElement(idx_elem, index, table); index->addIndexElement(idx_elem); } - else if(elem==ParsersAttributes::PREDICATE) + else if(elem==Attributes::PREDICATE) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5382,22 +5382,22 @@ Rule *DatabaseModel::createRule(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); + table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::View)); + table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::View)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Rule)) - .arg(attribs[ParsersAttributes::TABLE]) + .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - rule->setExecutionType(attribs[ParsersAttributes::EXEC_TYPE]); - rule->setEventType(attribs[ParsersAttributes::EVENT_TYPE]); + rule->setExecutionType(attribs[Attributes::EXEC_TYPE]); + rule->setEventType(attribs[Attributes::EVENT_TYPE]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5407,8 +5407,8 @@ Rule *DatabaseModel::createRule(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::COMMANDS || - elem==ParsersAttributes::CONDITION) + if(elem==Attributes::Commands || + elem==Attributes::Condition) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5416,7 +5416,7 @@ Rule *DatabaseModel::createRule(void) str_aux=xmlparser.getElementContent(); xmlparser.restorePosition(); - if(elem==ParsersAttributes::COMMANDS) + if(elem==Attributes::Commands) { cmd_list=str_aux.split(';'); count=cmd_list.count(); @@ -5461,16 +5461,16 @@ Trigger *DatabaseModel::createTrigger(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); + table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::View)); + table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::View)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Trigger)) - .arg(attribs[ParsersAttributes::TABLE]) + .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5480,28 +5480,28 @@ Trigger *DatabaseModel::createTrigger(void) setBasicAttributes(trigger); - trigger->setConstraint(attribs[ParsersAttributes::CONSTRAINT]==ParsersAttributes::True); + trigger->setConstraint(attribs[Attributes::Constraint]==Attributes::True); trigger->setEvent(EventType::OnInsert, - (attribs[ParsersAttributes::INS_EVENT]==ParsersAttributes::True)); + (attribs[Attributes::INS_EVENT]==Attributes::True)); trigger->setEvent(EventType::OnDelete, - (attribs[ParsersAttributes::DEL_EVENT]==ParsersAttributes::True)); + (attribs[Attributes::DEL_EVENT]==Attributes::True)); trigger->setEvent(EventType::OnUpdate, - (attribs[ParsersAttributes::UPD_EVENT]==ParsersAttributes::True)); + (attribs[Attributes::UPD_EVENT]==Attributes::True)); trigger->setEvent(EventType::OnTruncate, - (attribs[ParsersAttributes::TRUNC_EVENT]==ParsersAttributes::True)); + (attribs[Attributes::TRUNC_EVENT]==Attributes::True)); - trigger->setExecutePerRow(attribs[ParsersAttributes::PER_ROW]==ParsersAttributes::True); + trigger->setExecutePerRow(attribs[Attributes::PER_ROW]==Attributes::True); - trigger->setFiringType(FiringType(attribs[ParsersAttributes::FIRING_TYPE])); + trigger->setFiringType(FiringType(attribs[Attributes::FIRING_TYPE])); - trigger->setTransitionTableName(Trigger::OldTableName, attribs[ParsersAttributes::OLD_TABLE_NAME]); - trigger->setTransitionTableName(Trigger::NewTableName, attribs[ParsersAttributes::NEW_TABLE_NAME]); + trigger->setTransitionTableName(Trigger::OldTableName, attribs[Attributes::OLD_TABLE_NAME]); + trigger->setTransitionTableName(Trigger::NewTableName, attribs[Attributes::NEW_TABLE_NAME]); - list_aux=attribs[ParsersAttributes::Arguments].split(','); + list_aux=attribs[Attributes::Arguments].split(','); count=list_aux.count(); for(i=0; i < count; i++) { @@ -5509,17 +5509,17 @@ Trigger *DatabaseModel::createTrigger(void) trigger->addArgument(list_aux[i]); } - trigger->setDeferrable(attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::True); + trigger->setDeferrable(attribs[Attributes::DEFERRABLE]==Attributes::True); if(trigger->isDeferrable()) - trigger->setDeferralType(attribs[ParsersAttributes::DEFER_TYPE]); + trigger->setDeferralType(attribs[Attributes::DEFER_TYPE]); - if(!attribs[ParsersAttributes::REF_TABLE].isEmpty()) + if(!attribs[Attributes::REF_TABLE].isEmpty()) { - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::Table); + ref_table=getObject(attribs[Attributes::REF_TABLE], ObjectType::Table); if(!ref_table) - ref_table=getObject(attribs[ParsersAttributes::REF_TABLE], ObjectType::View); + ref_table=getObject(attribs[Attributes::REF_TABLE], ObjectType::View); //Raises an error if the trigger is referencing a inexistent table if(!ref_table) @@ -5527,7 +5527,7 @@ Trigger *DatabaseModel::createTrigger(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(trigger->getName()) .arg(trigger->getTypeName()) - .arg(attribs[ParsersAttributes::REF_TABLE]) + .arg(attribs[Attributes::REF_TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5543,18 +5543,18 @@ Trigger *DatabaseModel::createTrigger(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::FUNCTION) + if(elem==Attributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(trigger->getName()) .arg(trigger->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Function)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5562,7 +5562,7 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setFunction(dynamic_cast(func)); } - else if(elem==ParsersAttributes::CONDITION) + else if(elem==Attributes::Condition) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5570,11 +5570,11 @@ Trigger *DatabaseModel::createTrigger(void) xmlparser.restorePosition(); trigger->setCondition(str_aux); } - else if(elem==ParsersAttributes::COLUMNS) + else if(elem==Attributes::Columns) { xmlparser.getElementAttributes(attribs); - list_aux=attribs[ParsersAttributes::NAMES].split(','); + list_aux=attribs[Attributes::NAMES].split(','); count=list_aux.count(); for(i=0; i < count; i++) @@ -5618,18 +5618,18 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); + table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::Table)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Policy)) - .arg(attribs[ParsersAttributes::TABLE]) + .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - policy->setPermissive(attribs[ParsersAttributes::PERMISSIVE] == ParsersAttributes::True); - policy->setPolicyCommand(PolicyCmdType(attribs[ParsersAttributes::COMMAND])); + policy->setPermissive(attribs[Attributes::PERMISSIVE] == Attributes::True); + policy->setPolicyCommand(PolicyCmdType(attribs[Attributes::Command])); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5639,27 +5639,27 @@ Policy *DatabaseModel::createPolicy(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::EXPRESSION) + if(elem==Attributes::EXPRESSION) { xmlparser.getElementAttributes(attribs); xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); - if(attribs[ParsersAttributes::TYPE] == ParsersAttributes::USING_EXP) + if(attribs[Attributes::TYPE] == Attributes::USING_EXP) policy->setUsingExpression(xmlparser.getElementContent()); - else if(attribs[ParsersAttributes::TYPE] == ParsersAttributes::CheckExp) + else if(attribs[Attributes::TYPE] == Attributes::CheckExp) policy->setCheckExpression(xmlparser.getElementContent()); xmlparser.restorePosition(); } - else if(xmlparser.getElementName()==ParsersAttributes::ROLES) + else if(xmlparser.getElementName()==Attributes::ROLES) { QStringList rol_names; Role *role = nullptr; xmlparser.getElementAttributes(attribs); - rol_names = attribs[ParsersAttributes::NAMES].split(','); + rol_names = attribs[Attributes::NAMES].split(','); for(auto &name : rol_names) { @@ -5708,7 +5708,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) event_trig=new EventTrigger; setBasicAttributes(event_trig); xmlparser.getElementAttributes(attribs); - event_trig->setEvent(EventTriggerType(attribs[ParsersAttributes::EVENT])); + event_trig->setEvent(EventTriggerType(attribs[Attributes::EVENT])); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5718,28 +5718,28 @@ EventTrigger *DatabaseModel::createEventTrigger(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::FUNCTION) + if(elem==Attributes::FUNCTION) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[ParsersAttributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[ParsersAttributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(event_trig->getName()) .arg(event_trig->getTypeName()) - .arg(attribs[ParsersAttributes::SIGNATURE]) + .arg(attribs[Attributes::SIGNATURE]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } event_trig->setFunction(dynamic_cast(func)); } - else if(elem==ParsersAttributes::FILTER) + else if(elem==Attributes::FILTER) { xmlparser.getElementAttributes(attribs); - event_trig->setFilter(attribs[ParsersAttributes::VARIABLE], attribs[ParsersAttributes::VALUES].split(',')); + event_trig->setFilter(attribs[Attributes::VARIABLE], attribs[Attributes::VALUES].split(',')); } } } @@ -5768,7 +5768,7 @@ GenericSQL *DatabaseModel::createGenericSQL(void) if(xmlparser.accessElement(XmlParser::ChildElement)) { - if(xmlparser.getElementType()==XML_ELEMENT_NODE && xmlparser.getElementName() == ParsersAttributes::DEFINITION) + if(xmlparser.getElementType()==XML_ELEMENT_NODE && xmlparser.getElementName() == Attributes::DEFINITION) { xmlparser.accessElement(XmlParser::ChildElement); genericsql->setDefinition(xmlparser.getElementContent()); @@ -5800,18 +5800,18 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) setBasicAttributes(sequence); xmlparser.getElementAttributes(attribs); - sequence->setValues(attribs[ParsersAttributes::MIN_VALUE], - attribs[ParsersAttributes::MAX_VALUE], - attribs[ParsersAttributes::INCREMENT], - attribs[ParsersAttributes::START], - attribs[ParsersAttributes::Cache]); + sequence->setValues(attribs[Attributes::MIN_VALUE], + attribs[Attributes::MAX_VALUE], + attribs[Attributes::INCREMENT], + attribs[Attributes::START], + attribs[Attributes::Cache]); - sequence->setCycle(attribs[ParsersAttributes::CYCLE]==ParsersAttributes::True); + sequence->setCycle(attribs[Attributes::Cycle]==Attributes::True); //Getting the sequence's owner column - if(!attribs[ParsersAttributes::OWNER_COLUMN].isEmpty()) + if(!attribs[Attributes::OWNER_COLUMN].isEmpty()) { - elem_list=attribs[ParsersAttributes::OWNER_COLUMN].split('.'); + elem_list=attribs[Attributes::OWNER_COLUMN].split('.'); count=elem_list.count(); if(count==3) @@ -5883,12 +5883,12 @@ View *DatabaseModel::createView(void) setBasicAttributes(view); xmlparser.getElementAttributes(attribs); - view->setObjectListsCapacity(attribs[ParsersAttributes::MAX_OBJ_COUNT].toUInt()); - view->setMaterialized(attribs[ParsersAttributes::MATERIALIZED]==ParsersAttributes::True); - view->setRecursive(attribs[ParsersAttributes::RECURSIVE]==ParsersAttributes::True); - view->setWithNoData(attribs[ParsersAttributes::WITH_NO_DATA]==ParsersAttributes::True); - view->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::True); - view->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); + view->setObjectListsCapacity(attribs[Attributes::MAX_OBJ_COUNT].toUInt()); + view->setMaterialized(attribs[Attributes::MATERIALIZED]==Attributes::True); + view->setRecursive(attribs[Attributes::RECURSIVE]==Attributes::True); + view->setWithNoData(attribs[Attributes::WITH_NO_DATA]==Attributes::True); + view->setExtAttribsHidden(attribs[Attributes::HIDE_EXT_ATTRIBS]==Attributes::True); + view->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5898,15 +5898,15 @@ View *DatabaseModel::createView(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::REFERENCE) + if(elem==Attributes::REFERENCE) { xmlparser.getElementAttributes(attribs); //If the table name is specified tries to create a reference to a table/column - if(!attribs[ParsersAttributes::TABLE].isEmpty()) + if(!attribs[Attributes::TABLE].isEmpty()) { column=nullptr; - table=dynamic_cast
(getObject(attribs[ParsersAttributes::TABLE], ObjectType::Table)); + table=dynamic_cast
(getObject(attribs[Attributes::TABLE], ObjectType::Table)); //Raises an error if the table doesn't exists if(!table) @@ -5914,18 +5914,18 @@ View *DatabaseModel::createView(void) str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(view->getName()) .arg(BaseObject::getTypeName(ObjectType::View)) - .arg(attribs[ParsersAttributes::TABLE]) + .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - if(!attribs[ParsersAttributes::COLUMN].isEmpty()) + if(!attribs[Attributes::Column].isEmpty()) { - column=table->getColumn(attribs[ParsersAttributes::COLUMN]); + column=table->getColumn(attribs[Attributes::Column]); if(!column) - column=table->getColumn(attribs[ParsersAttributes::COLUMN], true); + column=table->getColumn(attribs[Attributes::Column], true); //Raises an error if the view references an inexistant column if(!column) @@ -5933,8 +5933,8 @@ View *DatabaseModel::createView(void) str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(view->getName()) .arg(BaseObject::getTypeName(ObjectType::View)) - .arg(attribs[ParsersAttributes::TABLE] + QString(".") + - attribs[ParsersAttributes::COLUMN]) + .arg(attribs[Attributes::TABLE] + QString(".") + + attribs[Attributes::Column]) .arg(BaseObject::getTypeName(ObjectType::Column)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5943,41 +5943,41 @@ View *DatabaseModel::createView(void) //Adds the configured reference to a temporarily list reference = Reference(table, column, - attribs[ParsersAttributes::Alias], - attribs[ParsersAttributes::COLUMN_ALIAS]); - reference.setReferenceAlias(attribs[ParsersAttributes::REF_ALIAS]); + attribs[Attributes::Alias], + attribs[Attributes::ColumnAlias]); + reference.setReferenceAlias(attribs[Attributes::REF_ALIAS]); refs.push_back(reference); } else { xmlparser.savePosition(); - str_aux=attribs[ParsersAttributes::Alias]; + str_aux=attribs[Attributes::Alias]; xmlparser.accessElement(XmlParser::ChildElement); xmlparser.accessElement(XmlParser::ChildElement); reference = Reference(xmlparser.getElementContent(),str_aux); - reference.setReferenceAlias(attribs[ParsersAttributes::REF_ALIAS]); + reference.setReferenceAlias(attribs[Attributes::REF_ALIAS]); refs.push_back(reference); xmlparser.restorePosition(); } } - else if(elem==ParsersAttributes::EXPRESSION) + else if(elem==Attributes::EXPRESSION) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); xmlparser.accessElement(XmlParser::ChildElement); - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::CTE_EXPRESSION) + if(attribs[Attributes::TYPE]==Attributes::CteExpression) view->setCommomTableExpression(xmlparser.getElementContent()); else { - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::SELECT_EXP) + if(attribs[Attributes::TYPE]==Attributes::SELECT_EXP) type=Reference::SqlReferSelect; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::FROM_EXP) + else if(attribs[Attributes::TYPE]==Attributes::FROM_EXP) type=Reference::SqlReferFrom; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::SIMPLE_EXP) + else if(attribs[Attributes::TYPE]==Attributes::SIMPLE_EXP) type=Reference::SqlReferWhere; else type=Reference::SqlReferEndExpr; @@ -6001,14 +6001,14 @@ View *DatabaseModel::createView(void) else if(elem==BaseObject::getSchemaName(ObjectType::Tag)) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[ParsersAttributes::NAME] ,ObjectType::Tag); + tag=getObject(aux_attribs[Attributes::NAME] ,ObjectType::Tag); if(!tag) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Table)) - .arg(aux_attribs[ParsersAttributes::TABLE]) + .arg(aux_attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Tag)) , ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6065,16 +6065,16 @@ Collation *DatabaseModel::createCollation(void) xmlparser.getElementAttributes(attribs); - encoding=EncodingType(attribs[ParsersAttributes::ENCODING]); + encoding=EncodingType(attribs[Attributes::ENCODING]); collation->setEncoding(encoding); //Creating a collation from a base locale - if(!attribs[ParsersAttributes::LOCALE].isEmpty()) - collation->setLocale(attribs[ParsersAttributes::LOCALE]); + if(!attribs[Attributes::LOCALE].isEmpty()) + collation->setLocale(attribs[Attributes::LOCALE]); //Creating a collation from another collation - else if(!attribs[ParsersAttributes::COLLATION].isEmpty()) + else if(!attribs[Attributes::Collation].isEmpty()) { - copy_coll=this->getObject(attribs[ParsersAttributes::COLLATION], ObjectType::Collation); + copy_coll=this->getObject(attribs[Attributes::Collation], ObjectType::Collation); //Raises an error if the copy collation doesn't exists if(!copy_coll) @@ -6082,7 +6082,7 @@ Collation *DatabaseModel::createCollation(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(collation->getName()) .arg(BaseObject::getTypeName(ObjectType::Collation)) - .arg(attribs[ParsersAttributes::COLLATION]) + .arg(attribs[Attributes::Collation]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6092,8 +6092,8 @@ Collation *DatabaseModel::createCollation(void) //Creating a collation using LC_COLLATE and LC_CTYPE params else { - collation->setLocalization(Collation::LcCollate, attribs[ParsersAttributes::LcCollate]); - collation->setLocalization(Collation::LcCtype, attribs[ParsersAttributes::LcCtype]); + collation->setLocalization(Collation::LcCollate, attribs[Attributes::LcCollate]); + collation->setLocalization(Collation::LcCtype, attribs[Attributes::LcCtype]); } } catch(Exception &e) @@ -6116,9 +6116,9 @@ Extension *DatabaseModel::createExtension(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(extension); - extension->setHandlesType(attribs[ParsersAttributes::HANDLES_TYPE]==ParsersAttributes::True); - extension->setVersion(Extension::CurVersion, attribs[ParsersAttributes::CUR_VERSION]); - extension->setVersion(Extension::OldVersion, attribs[ParsersAttributes::OLD_VERSION]); + extension->setHandlesType(attribs[Attributes::HANDLES_TYPE]==Attributes::True); + extension->setVersion(Extension::CurVersion, attribs[Attributes::CurVersion]); + extension->setVersion(Extension::OldVersion, attribs[Attributes::OLD_VERSION]); } catch(Exception &e) { @@ -6148,10 +6148,10 @@ Tag *DatabaseModel::createTag(void) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::STYLE) + if(elem==Attributes::STYLE) { xmlparser.getElementAttributes(attribs); - tag->setElementColors(attribs[ParsersAttributes::ID],attribs[ParsersAttributes::COLORS]); + tag->setElementColors(attribs[Attributes::ID],attribs[Attributes::Colors]); } } } @@ -6179,16 +6179,16 @@ Textbox *DatabaseModel::createTextbox(void) xmlparser.getElementAttributes(attribs); - txtbox->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); - txtbox->setTextAttribute(Textbox::ItalicText, attribs[ParsersAttributes::ITALIC]==ParsersAttributes::True); - txtbox->setTextAttribute(Textbox::BoldText, attribs[ParsersAttributes::Bold]==ParsersAttributes::True); - txtbox->setTextAttribute(Textbox::UnderlineText, attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::True); + txtbox->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); + txtbox->setTextAttribute(Textbox::ItalicText, attribs[Attributes::ITALIC]==Attributes::True); + txtbox->setTextAttribute(Textbox::BoldText, attribs[Attributes::Bold]==Attributes::True); + txtbox->setTextAttribute(Textbox::UnderlineText, attribs[Attributes::UNDERLINE]==Attributes::True); - if(!attribs[ParsersAttributes::COLOR].isEmpty()) - txtbox->setTextColor(QColor(attribs[ParsersAttributes::COLOR])); + if(!attribs[Attributes::Color].isEmpty()) + txtbox->setTextColor(QColor(attribs[Attributes::Color])); - if(!attribs[ParsersAttributes::FONT_SIZE].isEmpty()) - txtbox->setFontSize(attribs[ParsersAttributes::FONT_SIZE].toDouble()); + if(!attribs[Attributes::FONT_SIZE].isEmpty()) + txtbox->setFontSize(attribs[Attributes::FONT_SIZE].toDouble()); } catch(Exception &e) { @@ -6213,33 +6213,33 @@ BaseRelationship *DatabaseModel::createRelationship(void) unsigned rel_type=0, i; ObjectType table_types[2]={ObjectType::View, ObjectType::Table}, obj_rel_type; QString str_aux, elem, - tab_attribs[2]={ ParsersAttributes::SRC_TABLE, - ParsersAttributes::DST_TABLE }; + tab_attribs[2]={ Attributes::SRC_TABLE, + Attributes::DST_TABLE }; QColor custom_color=Qt::transparent; Table *table = nullptr; try { - labels_id[ParsersAttributes::NAME_LABEL]=BaseRelationship::RelNameLabel; - labels_id[ParsersAttributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; - labels_id[ParsersAttributes::DST_LABEL]=BaseRelationship::DstCardLabel; + labels_id[Attributes::NAME_LABEL]=BaseRelationship::RelNameLabel; + labels_id[Attributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; + labels_id[Attributes::DST_LABEL]=BaseRelationship::DstCardLabel; xmlparser.getElementAttributes(attribs); - protect=(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::True); - faded_out=(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); + protect=(attribs[Attributes::PROTECTED]==Attributes::True); + faded_out=(attribs[Attributes::FADED_OUT]==Attributes::True); - if(!attribs[ParsersAttributes::CUSTOM_COLOR].isEmpty()) - custom_color=QColor(attribs[ParsersAttributes::CUSTOM_COLOR]); + if(!attribs[Attributes::CustomColor].isEmpty()) + custom_color=QColor(attribs[Attributes::CustomColor]); - if(attribs[ParsersAttributes::TYPE]!=ParsersAttributes::RELATION_TAB_VIEW && - attribs[ParsersAttributes::TYPE]!=ParsersAttributes::RELATIONSHIP_FK) + if(attribs[Attributes::TYPE]!=Attributes::RELATION_TAB_VIEW && + attribs[Attributes::TYPE]!=Attributes::RELATIONSHIP_FK) { table_types[0]=ObjectType::Table; obj_rel_type=ObjectType::Relationship; } else { - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_FK) + if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_FK) table_types[0]=ObjectType::Table; obj_rel_type=ObjectType::BaseRelationship; @@ -6254,7 +6254,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(!tables[i]) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(obj_rel_type)) .arg(attribs[tab_attribs[i]]) .arg(BaseObject::getTypeName(table_types[i])); @@ -6269,11 +6269,11 @@ BaseRelationship *DatabaseModel::createRelationship(void) /* Creates the fk relationship if it not exists. This generally happens when a foreign key is added to the table after its creation. */ - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_FK) + if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_FK) { base_rel=new BaseRelationship(BaseRelationship::RelationshipFk, tables[0], tables[1], false, false); - base_rel->setName(attribs[ParsersAttributes::NAME]); - base_rel->setAlias(attribs[ParsersAttributes::Alias]); + base_rel->setName(attribs[Attributes::NAME]); + base_rel->setAlias(attribs[Attributes::Alias]); addRelationship(base_rel); /* If the source table doesn't have any fk that references the destination table indicates that the relationship @@ -6300,20 +6300,20 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(!base_rel->getReferenceForeignKey()) { throw Exception(Exception::getErrorMessage(ErrorCode::InvAllocationFKRelationship) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(src_tab->getName(true)), ErrorCode::InvAllocationFKRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } else if(base_rel) - base_rel->setName(attribs[ParsersAttributes::NAME]); + base_rel->setName(attribs[Attributes::NAME]); if(!base_rel) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(this->getName()) .arg(this->getTypeName()) - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::BaseRelationship)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -6323,10 +6323,10 @@ BaseRelationship *DatabaseModel::createRelationship(void) } else { - QString pat_attrib[]= { ParsersAttributes::SRC_COL_PATTERN, ParsersAttributes::DST_COL_PATTERN, - ParsersAttributes::SRC_FK_PATTERN, ParsersAttributes::DST_FK_PATTERN, - ParsersAttributes::PK_PATTERN, ParsersAttributes::UQ_PATTERN, - ParsersAttributes::PK_COL_PATTERN }; + QString pat_attrib[]= { Attributes::SRC_COL_PATTERN, Attributes::DST_COL_PATTERN, + Attributes::SRC_FK_PATTERN, Attributes::DST_FK_PATTERN, + Attributes::PK_PATTERN, Attributes::UQ_PATTERN, + Attributes::PK_COL_PATTERN }; unsigned pattern_id[]= { Relationship::SrcColPattern, Relationship::DstColPattern, Relationship::SrcFkPattern, Relationship::DstFkPattern, @@ -6334,27 +6334,27 @@ BaseRelationship *DatabaseModel::createRelationship(void) Relationship::PkColPattern }, pat_count=sizeof(pattern_id)/sizeof(unsigned); - sql_disabled=attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::True; - src_mand=attribs[ParsersAttributes::SRC_REQUIRED]==ParsersAttributes::True; - dst_mand=attribs[ParsersAttributes::DST_REQUIRED]==ParsersAttributes::True; - identifier=attribs[ParsersAttributes::IDENTIFIER]==ParsersAttributes::True; - deferrable=attribs[ParsersAttributes::DEFERRABLE]==ParsersAttributes::True; - defer_type=DeferralType(attribs[ParsersAttributes::DEFER_TYPE]); - del_action=ActionType(attribs[ParsersAttributes::DEL_ACTION]); - upd_action=ActionType(attribs[ParsersAttributes::UPD_ACTION]); - single_pk_col=(attribs[ParsersAttributes::SINGLE_PK_COLUMN]==ParsersAttributes::True); - - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_11) + sql_disabled=attribs[Attributes::SQL_DISABLED]==Attributes::True; + src_mand=attribs[Attributes::SRC_REQUIRED]==Attributes::True; + dst_mand=attribs[Attributes::DST_REQUIRED]==Attributes::True; + identifier=attribs[Attributes::IDENTIFIER]==Attributes::True; + deferrable=attribs[Attributes::DEFERRABLE]==Attributes::True; + defer_type=DeferralType(attribs[Attributes::DEFER_TYPE]); + del_action=ActionType(attribs[Attributes::DEL_ACTION]); + upd_action=ActionType(attribs[Attributes::UPD_ACTION]); + single_pk_col=(attribs[Attributes::SINGLE_PK_COLUMN]==Attributes::True); + + if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_11) rel_type=BaseRelationship::Relationship11; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_1N) + else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_1N) rel_type=BaseRelationship::Relationship1n; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_NN) + else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_NN) rel_type=BaseRelationship::RelationshipNn; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_GEN) + else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_GEN) rel_type=BaseRelationship::RelationshipGen; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_DEP) + else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_DEP) rel_type=BaseRelationship::RelationshipDep; - else if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::RELATIONSHIP_PART) + else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_PART) rel_type=BaseRelationship::RelationshipPart; rel=new Relationship(rel_type, @@ -6362,17 +6362,17 @@ BaseRelationship *DatabaseModel::createRelationship(void) dynamic_cast
(tables[1]), src_mand, dst_mand, identifier, deferrable, defer_type, del_action, upd_action, - CopyOptions(attribs[ParsersAttributes::COPY_MODE].toUInt(), - attribs[ParsersAttributes::COPY_OPTIONS].toUInt())); + CopyOptions(attribs[Attributes::CopyMode].toUInt(), + attribs[Attributes::CopyOptions].toUInt())); rel->setSQLDisabled(sql_disabled); rel->setSiglePKColumn(single_pk_col); - if(!attribs[ParsersAttributes::TABLE_NAME].isEmpty()) - rel->setTableNameRelNN(attribs[ParsersAttributes::TABLE_NAME]); + if(!attribs[Attributes::TABLE_NAME].isEmpty()) + rel->setTableNameRelNN(attribs[Attributes::TABLE_NAME]); - rel->setName(attribs[ParsersAttributes::NAME]); - rel->setAlias(attribs[ParsersAttributes::Alias]); + rel->setName(attribs[Attributes::NAME]); + rel->setAlias(attribs[Attributes::Alias]); base_rel=rel; //Configuring the name patterns @@ -6388,20 +6388,20 @@ BaseRelationship *DatabaseModel::createRelationship(void) { elem=xmlparser.getElementName(); - if(elem == ParsersAttributes::EXPRESSION && rel) + if(elem == Attributes::EXPRESSION && rel) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); rel->setPartitionBoundingExpr(xmlparser.getElementContent()); xmlparser.restorePosition(); } - else if(elem==ParsersAttributes::COLUMN && rel) + else if(elem==Attributes::Column && rel) { xmlparser.savePosition(); rel->addObject(createColumn()); xmlparser.restorePosition(); } - else if(elem==ParsersAttributes::CONSTRAINT && rel) + else if(elem==Attributes::Constraint && rel) { xmlparser.savePosition(); xmlparser.getElementAttributes(constr_attribs); @@ -6411,9 +6411,9 @@ BaseRelationship *DatabaseModel::createRelationship(void) * the relationship contains a special primary key (created during relationship connection) * and the current constraint is the original one owned by one of the tables prior the connection * of the relationship. */ - if(constr_attribs[ParsersAttributes::TYPE] == ParsersAttributes::PK_CONSTR) + if(constr_attribs[Attributes::TYPE] == Attributes::PK_CONSTR) { - table = getTable(constr_attribs[ParsersAttributes::TABLE]); + table = getTable(constr_attribs[Attributes::TABLE]); rel->setOriginalPrimaryKey(createConstraint(table)); } else @@ -6421,7 +6421,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) xmlparser.restorePosition(); } - else if(elem==ParsersAttributes::LINE) + else if(elem==Attributes::LINE) { vector points; xmlparser.savePosition(); @@ -6430,18 +6430,18 @@ BaseRelationship *DatabaseModel::createRelationship(void) do { xmlparser.getElementAttributes(attribs); - points.push_back(QPointF(attribs[ParsersAttributes::X_POS].toDouble(), - attribs[ParsersAttributes::Y_POS].toDouble())); + points.push_back(QPointF(attribs[Attributes::X_POS].toDouble(), + attribs[Attributes::Y_POS].toDouble())); } while(xmlparser.accessElement(XmlParser::NextElement)); base_rel->setPoints(points); xmlparser.restorePosition(); } - else if(elem==ParsersAttributes::LABEL) + else if(elem==Attributes::LABEL) { xmlparser.getElementAttributes(attribs); - str_aux=attribs[ParsersAttributes::REF_TYPE]; + str_aux=attribs[Attributes::REF_TYPE]; xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -6449,15 +6449,15 @@ BaseRelationship *DatabaseModel::createRelationship(void) xmlparser.restorePosition(); base_rel->setLabelDistance(labels_id[str_aux], - QPointF(attribs[ParsersAttributes::X_POS].toFloat(), - attribs[ParsersAttributes::Y_POS].toFloat())); + QPointF(attribs[Attributes::X_POS].toFloat(), + attribs[Attributes::Y_POS].toFloat())); } - else if(elem==ParsersAttributes::SPECIAL_PK_COLS && rel) + else if(elem==Attributes::SPECIAL_PK_COLS && rel) { QList col_list; xmlparser.getElementAttributes(attribs); - col_list=attribs[ParsersAttributes::INDEXES].split(','); + col_list=attribs[Attributes::INDEXES].split(','); while(!col_list.isEmpty()) { @@ -6519,16 +6519,16 @@ Permission *DatabaseModel::createPermission(void) try { xmlparser.getElementAttributes(priv_attribs); - revoke=priv_attribs[ParsersAttributes::REVOKE]==ParsersAttributes::True; - cascade=priv_attribs[ParsersAttributes::Cascade]==ParsersAttributes::True; + revoke=priv_attribs[Attributes::REVOKE]==Attributes::True; + cascade=priv_attribs[Attributes::Cascade]==Attributes::True; xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); xmlparser.getElementAttributes(attribs); - obj_type=BaseObject::getObjectType(attribs[ParsersAttributes::TYPE]); - obj_name=attribs[ParsersAttributes::NAME]; - parent_name=attribs[ParsersAttributes::PARENT]; + obj_type=BaseObject::getObjectType(attribs[Attributes::TYPE]); + obj_name=attribs[Attributes::NAME]; + parent_name=attribs[Attributes::PARENT]; //If the object is a column its needed to get the parent table if(obj_type==ObjectType::Column) @@ -6558,11 +6558,11 @@ Permission *DatabaseModel::createPermission(void) do { - if(xmlparser.getElementName()==ParsersAttributes::ROLES) + if(xmlparser.getElementName()==Attributes::ROLES) { xmlparser.getElementAttributes(attribs); - list=attribs[ParsersAttributes::NAMES].split(','); + list=attribs[Attributes::NAMES].split(','); len=list.size(); for(i=0; i < len; i++) @@ -6582,7 +6582,7 @@ Permission *DatabaseModel::createPermission(void) perm->addRole(role); } } - else if(xmlparser.getElementName()==ParsersAttributes::PRIVILEGES) + else if(xmlparser.getElementName()==Attributes::PRIVILEGES) { xmlparser.getElementAttributes(priv_attribs); @@ -6591,34 +6591,34 @@ Permission *DatabaseModel::createPermission(void) while(itr!=itr_end) { - if(itr->first!=ParsersAttributes::GRANT_OP) + if(itr->first!=Attributes::GRANT_OP) { - priv_value=(itr->second==ParsersAttributes::True); - grant_op=(itr->second==ParsersAttributes::GRANT_OP); + priv_value=(itr->second==Attributes::True); + grant_op=(itr->second==Attributes::GRANT_OP); - if(itr->first==ParsersAttributes::CONNECT_PRIV) + if(itr->first==Attributes::ConnectPriv) priv_type=Permission::PrivConnect; - else if(itr->first==ParsersAttributes::CREATE_PRIV) + else if(itr->first==Attributes::CreatePriv) priv_type=Permission::PrivCreate; - else if(itr->first==ParsersAttributes::DELETE_PRIV) + else if(itr->first==Attributes::DELETE_PRIV) priv_type=Permission::PrivDelete; - else if(itr->first==ParsersAttributes::EXECUTE_PRIV) + else if(itr->first==Attributes::EXECUTE_PRIV) priv_type=Permission::PrivExecute; - else if(itr->first==ParsersAttributes::INSERT_PRIV) + else if(itr->first==Attributes::INSERT_PRIV) priv_type=Permission::PrivInsert; - else if(itr->first==ParsersAttributes::REFERENCES_PRIV) + else if(itr->first==Attributes::REFERENCES_PRIV) priv_type=Permission::PrivReferences; - else if(itr->first==ParsersAttributes::SELECT_PRIV) + else if(itr->first==Attributes::SELECT_PRIV) priv_type=Permission::PrivSelect; - else if(itr->first==ParsersAttributes::TEMPORARY_PRIV) + else if(itr->first==Attributes::TEMPORARY_PRIV) priv_type=Permission::PrivTemporary; - else if(itr->first==ParsersAttributes::TRIGGER_PRIV) + else if(itr->first==Attributes::TRIGGER_PRIV) priv_type=Permission::PrivTrigger; - else if(itr->first==ParsersAttributes::TRUNCATE_PRIV) + else if(itr->first==Attributes::TRUNCATE_PRIV) priv_type=Permission::PrivTruncate; - else if(itr->first==ParsersAttributes::UPDATE_PRIV) + else if(itr->first==Attributes::UPDATE_PRIV) priv_type=Permission::PrivUpdate; - else if(itr->first==ParsersAttributes::USAGE_PRIV) + else if(itr->first==Attributes::USAGE_PRIV) priv_type=Permission::PrivUsage; perm->setPrivilege(priv_type, (priv_value || grant_op), grant_op); @@ -6716,18 +6716,18 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) QString def, bkp_appended_sql, bkp_prepended_sql; //Forcing the name/signature cleanup due to the validation temp. names feature - attributes[ParsersAttributes::NAME]=QString(); - attributes[ParsersAttributes::SIGNATURE]=QString(); + attributes[Attributes::NAME]=QString(); + attributes[Attributes::SIGNATURE]=QString(); if(conn_limit >= 0) - attributes[ParsersAttributes::CONN_LIMIT]=QString("%1").arg(conn_limit); + attributes[Attributes::ConnLimit]=QString("%1").arg(conn_limit); if(def_type==SchemaParser::SqlDefinition) { - QString loc_attribs[]={ ParsersAttributes::LcCtype, ParsersAttributes::LcCollate }; + QString loc_attribs[]={ Attributes::LcCtype, Attributes::LcCollate }; if(encoding!=BaseType::Null) - attributes[ParsersAttributes::ENCODING]=QString("'%1'").arg(~encoding); + attributes[Attributes::ENCODING]=QString("'%1'").arg(~encoding); for(unsigned i=0; i < 2; i++) { @@ -6739,16 +6739,16 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) } else { - attributes[ParsersAttributes::ENCODING]=(~encoding); - attributes[ParsersAttributes::LcCollate]=localizations[1]; - attributes[ParsersAttributes::LcCtype]=localizations[0]; - attributes[ParsersAttributes::AppendAtEod]=(append_at_eod ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::PREPEND_AT_BOD]=(prepend_at_bod ? ParsersAttributes::True : QString()); + attributes[Attributes::ENCODING]=(~encoding); + attributes[Attributes::LcCollate]=localizations[1]; + attributes[Attributes::LcCtype]=localizations[0]; + attributes[Attributes::AppendAtEod]=(append_at_eod ? Attributes::True : QString()); + attributes[Attributes::PREPEND_AT_BOD]=(prepend_at_bod ? Attributes::True : QString()); } - attributes[ParsersAttributes::IS_TEMPLATE]=(is_template ? ParsersAttributes::True : ParsersAttributes::False); - attributes[ParsersAttributes::AllowConns]=(allow_conns ? ParsersAttributes::True : ParsersAttributes::False); - attributes[ParsersAttributes::TEMPLATE_DB]=template_db; + attributes[Attributes::IS_TEMPLATE]=(is_template ? Attributes::True : Attributes::False); + attributes[Attributes::AllowConns]=(allow_conns ? Attributes::True : Attributes::False); + attributes[Attributes::TEMPLATE_DB]=template_db; if(def_type==SchemaParser::SqlDefinition && append_at_eod) { @@ -6795,7 +6795,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) BaseObject *object=nullptr; QString def, search_path=QString("pg_catalog,public"), msg=trUtf8("Generating %1 code: `%2' (%3)"), - attrib=ParsersAttributes::OBJECTS, attrib_aux, + attrib=Attributes::OBJECTS, attrib_aux, def_type_str=(def_type==SchemaParser::SqlDefinition ? QString("SQL") : QString("XML")); Type *usr_type=nullptr; map objects_map; @@ -6807,15 +6807,15 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) general_obj_cnt=objects_map.size(); gen_defs_count=0; - attribs_aux[ParsersAttributes::SHELL_TYPES]=QString(); - attribs_aux[ParsersAttributes::PERMISSION]=QString(); - attribs_aux[ParsersAttributes::SCHEMA]=QString(); - attribs_aux[ParsersAttributes::TABLESPACE]=QString(); - attribs_aux[ParsersAttributes::ROLE]=QString(); + attribs_aux[Attributes::SHELL_TYPES]=QString(); + attribs_aux[Attributes::PERMISSION]=QString(); + attribs_aux[Attributes::SCHEMA]=QString(); + attribs_aux[Attributes::TABLESPACE]=QString(); + attribs_aux[Attributes::ROLE]=QString(); if(def_type==SchemaParser::SqlDefinition) { - attribs_aux[ParsersAttributes::FUNCTION]=(!functions.empty() ? ParsersAttributes::True : QString()); + attribs_aux[Attributes::FUNCTION]=(!functions.empty() ? Attributes::True : QString()); for(auto &type : types) { @@ -6837,7 +6837,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) //Generating the shell type declaration (only for base types) if(usr_type->getConfiguration()==Type::BaseType) - attribs_aux[ParsersAttributes::SHELL_TYPES]+=usr_type->getCodeDefinition(def_type, true); + attribs_aux[Attributes::SHELL_TYPES]+=usr_type->getCodeDefinition(def_type, true); else attribs_aux[attrib]+=usr_type->getCodeDefinition(def_type); } @@ -6863,7 +6863,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } else if(obj_type==ObjectType::Permission) { - attribs_aux[ParsersAttributes::PERMISSION]+=dynamic_cast(object)->getCodeDefinition(def_type); + attribs_aux[Attributes::PERMISSION]+=dynamic_cast(object)->getCodeDefinition(def_type); } else if(obj_type==ObjectType::Constraint) { @@ -6925,20 +6925,20 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } } - attribs_aux[ParsersAttributes::SEARCH_PATH]=search_path; - attribs_aux[ParsersAttributes::MODEL_AUTHOR]=author; - attribs_aux[ParsersAttributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; + attribs_aux[Attributes::SEARCH_PATH]=search_path; + attribs_aux[Attributes::MODEL_AUTHOR]=author; + attribs_aux[Attributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; if(def_type==SchemaParser::XmlDefinition) { - attribs_aux[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); - attribs_aux[ParsersAttributes::PROTECTED]=(this->is_protected ? ParsersAttributes::True : QString()); - attribs_aux[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); - attribs_aux[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); - attribs_aux[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getName(true) : QString()); - attribs_aux[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getName(true) : QString()); + attribs_aux[Attributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); + attribs_aux[Attributes::PROTECTED]=(this->is_protected ? Attributes::True : QString()); + attribs_aux[Attributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); + attribs_aux[Attributes::LAST_ZOOM]=QString::number(last_zoom); + attribs_aux[Attributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getName(true) : QString()); + attribs_aux[Attributes::DEFAULT_OWNER]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getName(true) : QString()); + attribs_aux[Attributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getName(true) : QString()); + attribs_aux[Attributes::DEFAULT_COLLATION]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getName(true) : QString()); } else { @@ -6970,8 +6970,8 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } - attribs_aux[ParsersAttributes::EXPORT_TO_FILE]=(export_file ? ParsersAttributes::True : QString()); - def=schparser.getCodeDefinition(ParsersAttributes::DB_MODEL, attribs_aux, def_type); + attribs_aux[Attributes::EXPORT_TO_FILE]=(export_file ? Attributes::True : QString()); + def=schparser.getCodeDefinition(Attributes::DB_MODEL, attribs_aux, def_type); if(prepend_at_bod && def_type==SchemaParser::SqlDefinition) def=QString("-- Prepended SQL commands --\n") + this->prepended_sql + QString("\n---\n\n") + def; @@ -9504,9 +9504,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option save_objs_sqldis=false, save_textboxes=false, save_tags=false, save_custom_sql=false, save_custom_colors=false, save_fadeout=false, save_extattribs=false, save_genericsqls=false, save_objs_aliases=false; - QStringList labels_attrs={ ParsersAttributes::SRC_LABEL, - ParsersAttributes::DST_LABEL, - ParsersAttributes::NAME_LABEL }; + QStringList labels_attrs={ Attributes::SRC_LABEL, + Attributes::DST_LABEL, + Attributes::NAME_LABEL }; save_db_attribs=(MetaDbAttributes & options) == MetaDbAttributes; save_objs_pos=(MetaObjsPositioning & options) == MetaObjsPositioning; @@ -9628,40 +9628,40 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option graph_obj=dynamic_cast(object); base_tab=dynamic_cast(object); - attribs[ParsersAttributes::TABLE]=QString(); - attribs[ParsersAttributes::NAME]=(TableObject::isTableObject(obj_type) ? object->getName() : object->getSignature()); - attribs[ParsersAttributes::Alias]=(save_objs_aliases ? object->getAlias() : QString()); - attribs[ParsersAttributes::TYPE]=object->getSchemaName(); - attribs[ParsersAttributes::PROTECTED]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? ParsersAttributes::True : QString()); - attribs[ParsersAttributes::SQL_DISABLED]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? ParsersAttributes::True : QString()); - attribs[ParsersAttributes::TAG]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); - attribs[ParsersAttributes::AppendedSql]=object->getAppendedSQL(); - attribs[ParsersAttributes::PREPENDED_SQL]=object->getPrependedSQL(); - attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? ParsersAttributes::True : QString()); - attribs[ParsersAttributes::FADED_OUT]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? ParsersAttributes::True : QString()); + attribs[Attributes::TABLE]=QString(); + attribs[Attributes::NAME]=(TableObject::isTableObject(obj_type) ? object->getName() : object->getSignature()); + attribs[Attributes::Alias]=(save_objs_aliases ? object->getAlias() : QString()); + attribs[Attributes::TYPE]=object->getSchemaName(); + attribs[Attributes::PROTECTED]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? Attributes::True : QString()); + attribs[Attributes::SQL_DISABLED]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? Attributes::True : QString()); + attribs[Attributes::TAG]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); + attribs[Attributes::AppendedSql]=object->getAppendedSQL(); + attribs[Attributes::PREPENDED_SQL]=object->getPrependedSQL(); + attribs[Attributes::HIDE_EXT_ATTRIBS]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? Attributes::True : QString()); + attribs[Attributes::FADED_OUT]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? Attributes::True : QString()); if(TableObject::isTableObject(obj_type)) { base_tab = dynamic_cast(object)->getParentTable(); - attribs[ParsersAttributes::TABLE]=base_tab->getSignature(); + attribs[Attributes::TABLE]=base_tab->getSignature(); } if(save_custom_sql && obj_type==ObjectType::Database) { - attribs[ParsersAttributes::AppendAtEod]=(this->isAppendAtEOD() ? ParsersAttributes::True : ParsersAttributes::False); - attribs[ParsersAttributes::PREPEND_AT_BOD]=(this->isPrependedAtBOD() ? ParsersAttributes::True : ParsersAttributes::False); + attribs[Attributes::AppendAtEod]=(this->isAppendAtEOD() ? Attributes::True : Attributes::False); + attribs[Attributes::PREPEND_AT_BOD]=(this->isPrependedAtBOD() ? Attributes::True : Attributes::False); } //Configuring database model attributes if(save_db_attribs && object==this) { - attribs[ParsersAttributes::MODEL_AUTHOR]=this->getAuthor(); - attribs[ParsersAttributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); - attribs[ParsersAttributes::LAST_ZOOM]=QString::number(last_zoom); - attribs[ParsersAttributes::DEFAULT_COLLATION]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getSignature() : QString()); - attribs[ParsersAttributes::DEFAULT_OWNER]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getSignature() : QString()); + attribs[Attributes::MODEL_AUTHOR]=this->getAuthor(); + attribs[Attributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); + attribs[Attributes::LAST_ZOOM]=QString::number(last_zoom); + attribs[Attributes::DEFAULT_COLLATION]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getSignature() : QString()); + attribs[Attributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getSignature() : QString()); + attribs[Attributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getSignature() : QString()); + attribs[Attributes::DEFAULT_OWNER]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getSignature() : QString()); } //If the object is a graphic one and we need to save positions and colors @@ -9675,28 +9675,28 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { schema=dynamic_cast(object); - attribs[ParsersAttributes::CUSTOM_COLOR]=(save_custom_colors ? schema->getFillColor().name() : QString()); - attribs[ParsersAttributes::RECT_VISIBLE]=(schema->isRectVisible() ? ParsersAttributes::True : ParsersAttributes::False); + attribs[Attributes::CustomColor]=(save_custom_colors ? schema->getFillColor().name() : QString()); + attribs[Attributes::RECT_VISIBLE]=(schema->isRectVisible() ? Attributes::True : Attributes::False); if(schema->isRectVisible()) { - attribs[ParsersAttributes::X_POS]=QString::number(pnt.x()); - attribs[ParsersAttributes::Y_POS]=QString::number(pnt.y()); + attribs[Attributes::X_POS]=QString::number(pnt.x()); + attribs[Attributes::Y_POS]=QString::number(pnt.y()); } } else { - attribs[ParsersAttributes::X_POS]=QString::number(pnt.x()); - attribs[ParsersAttributes::Y_POS]=QString::number(pnt.y()); + attribs[Attributes::X_POS]=QString::number(pnt.x()); + attribs[Attributes::Y_POS]=QString::number(pnt.y()); } - if(obj_type!=ObjectType::Schema || !attribs[ParsersAttributes::X_POS].isEmpty()) + if(obj_type!=ObjectType::Schema || !attribs[Attributes::X_POS].isEmpty()) { schparser.ignoreUnkownAttributes(true); - attribs[ParsersAttributes::POSITION]= + attribs[Attributes::POSITION]= schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::POSITION + GlobalAttributes::SchemaExt, attribs); + Attributes::POSITION + GlobalAttributes::SchemaExt, attribs); } } else @@ -9706,24 +9706,24 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs_map aux_attribs; - attribs[ParsersAttributes::CUSTOM_COLOR]=(save_custom_colors && rel->getCustomColor()!=Qt::transparent ? rel->getCustomColor().name() : ParsersAttributes::NONE); + attribs[Attributes::CustomColor]=(save_custom_colors && rel->getCustomColor()!=Qt::transparent ? rel->getCustomColor().name() : Attributes::NONE); - attribs[ParsersAttributes::SRC_TABLE]=rel->getTable(BaseRelationship::SrcTable)->getSignature(); - attribs[ParsersAttributes::SRC_TYPE]=rel->getTable(BaseRelationship::SrcTable)->getSchemaName(); + attribs[Attributes::SRC_TABLE]=rel->getTable(BaseRelationship::SrcTable)->getSignature(); + attribs[Attributes::SRC_TYPE]=rel->getTable(BaseRelationship::SrcTable)->getSchemaName(); - attribs[ParsersAttributes::DST_TABLE]=rel->getTable(BaseRelationship::DstTable)->getSignature(); - attribs[ParsersAttributes::DST_TYPE]=rel->getTable(BaseRelationship::DstTable)->getSchemaName(); + attribs[Attributes::DST_TABLE]=rel->getTable(BaseRelationship::DstTable)->getSignature(); + attribs[Attributes::DST_TYPE]=rel->getTable(BaseRelationship::DstTable)->getSchemaName(); for(QPointF pnt : points) { - attribs[ParsersAttributes::X_POS]=QString::number(pnt.x()); - attribs[ParsersAttributes::Y_POS]=QString::number(pnt.y()); + attribs[Attributes::X_POS]=QString::number(pnt.x()); + attribs[Attributes::Y_POS]=QString::number(pnt.y()); schparser.ignoreUnkownAttributes(true); - attribs[ParsersAttributes::POSITION]+= + attribs[Attributes::POSITION]+= schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::POSITION + GlobalAttributes::SchemaExt, attribs); + Attributes::POSITION + GlobalAttributes::SchemaExt, attribs); } //Saving the labels' custom positions @@ -9732,17 +9732,17 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option pnt=rel->getLabelDistance(id); if(!std::isnan(pnt.x()) && !std::isnan(pnt.y())) { - aux_attribs[ParsersAttributes::X_POS]=QString::number(pnt.x()); - aux_attribs[ParsersAttributes::Y_POS]=QString::number(pnt.y()); - aux_attribs[ParsersAttributes::REF_TYPE]=labels_attrs[id]; + aux_attribs[Attributes::X_POS]=QString::number(pnt.x()); + aux_attribs[Attributes::Y_POS]=QString::number(pnt.y()); + aux_attribs[Attributes::REF_TYPE]=labels_attrs[id]; - aux_attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + aux_attribs[Attributes::POSITION]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::POSITION + GlobalAttributes::SchemaExt, aux_attribs); + Attributes::POSITION + GlobalAttributes::SchemaExt, aux_attribs); - attribs[ParsersAttributes::POSITION]+=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + attribs[Attributes::POSITION]+=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::LABEL + GlobalAttributes::SchemaExt, aux_attribs); + Attributes::LABEL + GlobalAttributes::SchemaExt, aux_attribs); } } } @@ -9752,14 +9752,14 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_custom_sql) { if(!object->getAppendedSQL().isEmpty()) - attribs[ParsersAttributes::AppendedSql]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + attribs[Attributes::AppendedSql]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - QString(ParsersAttributes::AppendedSql).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); + QString(Attributes::AppendedSql).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); if(!object->getPrependedSQL().isEmpty()) - attribs[ParsersAttributes::PREPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + attribs[Attributes::PREPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - QString(ParsersAttributes::PREPENDED_SQL).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); + QString(Attributes::PREPENDED_SQL).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); } /* The object's metadata code will be generated only if one of the key attributes @@ -9767,18 +9767,18 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if((save_db_attribs && obj_type==ObjectType::Database) || (save_custom_colors && ((obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) || - (!attribs[ParsersAttributes::CUSTOM_COLOR].isEmpty()))) || + (!attribs[Attributes::CustomColor].isEmpty()))) || (save_objs_pos && - (!attribs[ParsersAttributes::POSITION].isEmpty() || - !attribs[ParsersAttributes::RECT_VISIBLE].isEmpty())) || - (save_tags && !attribs[ParsersAttributes::TAG].isEmpty()) || - (save_objs_prot && !attribs[ParsersAttributes::PROTECTED].isEmpty()) || - (save_objs_sqldis && !attribs[ParsersAttributes::SQL_DISABLED].isEmpty()) || - (save_custom_sql && (!attribs[ParsersAttributes::AppendedSql].isEmpty() || - !attribs[ParsersAttributes::PREPENDED_SQL].isEmpty())) || - (save_fadeout && !attribs[ParsersAttributes::FADED_OUT].isEmpty()) || - (save_extattribs && !attribs[ParsersAttributes::HIDE_EXT_ATTRIBS].isEmpty()) || - (save_objs_aliases && !attribs[ParsersAttributes::Alias].isEmpty())) + (!attribs[Attributes::POSITION].isEmpty() || + !attribs[Attributes::RECT_VISIBLE].isEmpty())) || + (save_tags && !attribs[Attributes::TAG].isEmpty()) || + (save_objs_prot && !attribs[Attributes::PROTECTED].isEmpty()) || + (save_objs_sqldis && !attribs[Attributes::SQL_DISABLED].isEmpty()) || + (save_custom_sql && (!attribs[Attributes::AppendedSql].isEmpty() || + !attribs[Attributes::PREPENDED_SQL].isEmpty())) || + (save_fadeout && !attribs[Attributes::FADED_OUT].isEmpty()) || + (save_extattribs && !attribs[Attributes::HIDE_EXT_ATTRIBS].isEmpty()) || + (save_objs_aliases && !attribs[Attributes::Alias].isEmpty())) { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving metadata of the object `%1' (%2)") @@ -9788,7 +9788,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option objs_def+=schparser.convertCharsToXMLEntities( schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::INFO + GlobalAttributes::SchemaExt, attribs)); + Attributes::INFO + GlobalAttributes::SchemaExt, attribs)); } else idx++; @@ -9799,10 +9799,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(!objs_def.isEmpty()) { //Generates the metadata XML buffer - attribs[ParsersAttributes::INFO]=objs_def; + attribs[Attributes::INFO]=objs_def; buf.append(schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::METADATA + GlobalAttributes::SchemaExt, attribs)); + Attributes::METADATA + GlobalAttributes::SchemaExt, attribs)); output.write(buf.data(),buf.size()); emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ~ObjectType::BaseObject); @@ -9860,9 +9860,9 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option try { - labels_attrs[ParsersAttributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; - labels_attrs[ParsersAttributes::DST_LABEL]=BaseRelationship::DstCardLabel; - labels_attrs[ParsersAttributes::NAME_LABEL]=BaseRelationship::RelNameLabel; + labels_attrs[Attributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; + labels_attrs[Attributes::DST_LABEL]=BaseRelationship::DstCardLabel; + labels_attrs[Attributes::NAME_LABEL]=BaseRelationship::RelNameLabel; xmlparser.restartParser(); @@ -9904,27 +9904,27 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option new_object=nullptr; xmlparser.restorePosition(); } - else if(elem_name==ParsersAttributes::INFO) + else if(elem_name==Attributes::INFO) { xmlparser.getElementAttributes(attribs); - obj_name=attribs[ParsersAttributes::OBJECT]; + obj_name=attribs[Attributes::OBJECT]; xmlparser.savePosition(); - obj_type=BaseObject::getObjectType(attribs[ParsersAttributes::TYPE]); + obj_type=BaseObject::getObjectType(attribs[Attributes::TYPE]); progress=xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()) * 100; if(obj_type==ObjectType::Database) { if(load_db_attribs) { - QStringList pos=attribs[ParsersAttributes::LAST_POSITION].split(','); + QStringList pos=attribs[Attributes::LAST_POSITION].split(','); - default_objs[ObjectType::Schema]=getSchema(attribs[ParsersAttributes::DEFAULT_SCHEMA]); - default_objs[ObjectType::Role]=getRole(attribs[ParsersAttributes::DEFAULT_OWNER]); - default_objs[ObjectType::Collation]=getCollation(attribs[ParsersAttributes::DEFAULT_COLLATION]); - default_objs[ObjectType::Tablespace]=getTablespace(attribs[ParsersAttributes::DEFAULT_TABLESPACE]); - author=attribs[ParsersAttributes::MODEL_AUTHOR]; - last_zoom=attribs[ParsersAttributes::LAST_ZOOM].toFloat(); + default_objs[ObjectType::Schema]=getSchema(attribs[Attributes::DEFAULT_SCHEMA]); + default_objs[ObjectType::Role]=getRole(attribs[Attributes::DEFAULT_OWNER]); + default_objs[ObjectType::Collation]=getCollation(attribs[Attributes::DEFAULT_COLLATION]); + default_objs[ObjectType::Tablespace]=getTablespace(attribs[Attributes::DEFAULT_TABLESPACE]); + author=attribs[Attributes::MODEL_AUTHOR]; + last_zoom=attribs[Attributes::LAST_ZOOM].toFloat(); if(pos.size()>=2) last_pos=QPoint(pos[0].toFloat(), pos[1].toFloat()); @@ -9934,13 +9934,13 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option } else if(TableObject::isTableObject(obj_type)) { - base_tab = getTable(attribs[ParsersAttributes::TABLE]); + base_tab = getTable(attribs[Attributes::TABLE]); if(!base_tab && (obj_type == ObjectType::Rule || obj_type == ObjectType::Index || obj_type == ObjectType::Trigger)) - base_tab = getView(attribs[ParsersAttributes::TABLE]); + base_tab = getView(attribs[Attributes::TABLE]); if(base_tab) - object = base_tab->getObject(attribs[ParsersAttributes::OBJECT], obj_type); + object = base_tab->getObject(attribs[Attributes::OBJECT], obj_type); //Discarding the object if it was added by relationship if(object && dynamic_cast(object)->isAddedByRelationship()) @@ -9953,10 +9953,10 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option involving the tables in paramenters src-table and dst-table */ if(!object && obj_type==ObjectType::Relationship) { - src_tab=dynamic_cast(getObject(attribs[ParsersAttributes::SRC_TABLE], - BaseObject::getObjectType(attribs[ParsersAttributes::SRC_TYPE]))); - dst_tab=dynamic_cast(getObject(attribs[ParsersAttributes::DST_TABLE], - BaseObject::getObjectType(attribs[ParsersAttributes::DST_TYPE]))); + src_tab=dynamic_cast(getObject(attribs[Attributes::SRC_TABLE], + BaseObject::getObjectType(attribs[Attributes::SRC_TYPE]))); + dst_tab=dynamic_cast(getObject(attribs[Attributes::DST_TABLE], + BaseObject::getObjectType(attribs[Attributes::DST_TYPE]))); object=getRelationship(src_tab, dst_tab); } @@ -9966,33 +9966,33 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option .arg(object->getName()).arg(object->getTypeName()), ~obj_type); if(!object->isSystemObject() && - ((!attribs[ParsersAttributes::PROTECTED].isEmpty() && load_objs_prot) || - (!attribs[ParsersAttributes::SQL_DISABLED].isEmpty() && load_objs_sqldis))) + ((!attribs[Attributes::PROTECTED].isEmpty() && load_objs_prot) || + (!attribs[Attributes::SQL_DISABLED].isEmpty() && load_objs_sqldis))) { - if(!attribs[ParsersAttributes::PROTECTED].isEmpty()) - object->setProtected(attribs[ParsersAttributes::PROTECTED]==ParsersAttributes::True); + if(!attribs[Attributes::PROTECTED].isEmpty()) + object->setProtected(attribs[Attributes::PROTECTED]==Attributes::True); - if(!attribs[ParsersAttributes::SQL_DISABLED].isEmpty()) - object->setSQLDisabled(attribs[ParsersAttributes::SQL_DISABLED]==ParsersAttributes::True); + if(!attribs[Attributes::SQL_DISABLED].isEmpty()) + object->setSQLDisabled(attribs[Attributes::SQL_DISABLED]==Attributes::True); } - else if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && load_tags && !attribs[ParsersAttributes::TAG].isEmpty()) + else if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && load_tags && !attribs[Attributes::TAG].isEmpty()) { - tag=getTag(attribs[ParsersAttributes::TAG]); + tag=getTag(attribs[Attributes::TAG]); if(tag) dynamic_cast(object)->setTag(tag); } else if(obj_type==ObjectType::Database && load_custom_sql) { - if(!attribs[ParsersAttributes::AppendAtEod].isEmpty()) - this->setAppendAtEOD(attribs[ParsersAttributes::AppendAtEod]==ParsersAttributes::True); + if(!attribs[Attributes::AppendAtEod].isEmpty()) + this->setAppendAtEOD(attribs[Attributes::AppendAtEod]==Attributes::True); - if(!attribs[ParsersAttributes::PREPEND_AT_BOD].isEmpty()) - this->setPrependAtBOD(attribs[ParsersAttributes::PREPEND_AT_BOD]==ParsersAttributes::True); + if(!attribs[Attributes::PREPEND_AT_BOD].isEmpty()) + this->setPrependAtBOD(attribs[Attributes::PREPEND_AT_BOD]==Attributes::True); } - if(load_objs_aliases && !attribs[ParsersAttributes::Alias].isEmpty()) - object->setAlias(attribs[ParsersAttributes::Alias]); + if(load_objs_aliases && !attribs[Attributes::Alias].isEmpty()) + object->setAlias(attribs[Attributes::Alias]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -10002,36 +10002,36 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option xmlparser.getElementAttributes(aux_attrib); //Retrieving and storing the points - if(aux_elem==ParsersAttributes::POSITION) + if(aux_elem==Attributes::POSITION) { - points.push_back(QPointF(aux_attrib[ParsersAttributes::X_POS].toFloat(), - aux_attrib[ParsersAttributes::Y_POS].toFloat())); + points.push_back(QPointF(aux_attrib[Attributes::X_POS].toFloat(), + aux_attrib[Attributes::Y_POS].toFloat())); } //Retrieving and storing the labels' custom positions - else if(aux_elem==ParsersAttributes::LABEL) + else if(aux_elem==Attributes::LABEL) { - ref_type=aux_attrib[ParsersAttributes::REF_TYPE]; + ref_type=aux_attrib[Attributes::REF_TYPE]; xmlparser.savePosition(); if(xmlparser.accessElement(XmlParser::ChildElement)) { xmlparser.getElementAttributes(aux_attrib); - labels_pos[labels_attrs[ref_type]]=QPointF(aux_attrib[ParsersAttributes::X_POS].toFloat(), - aux_attrib[ParsersAttributes::Y_POS].toFloat()); + labels_pos[labels_attrs[ref_type]]=QPointF(aux_attrib[Attributes::X_POS].toFloat(), + aux_attrib[Attributes::Y_POS].toFloat()); } xmlparser.restorePosition(); } - else if(load_custom_sql && aux_elem==ParsersAttributes::AppendedSql && - attribs[ParsersAttributes::AppendedSql].isEmpty()) + else if(load_custom_sql && aux_elem==Attributes::AppendedSql && + attribs[Attributes::AppendedSql].isEmpty()) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); object->setAppendedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } - else if(load_custom_sql && aux_elem==ParsersAttributes::PREPENDED_SQL && - attribs[ParsersAttributes::PREPENDED_SQL].isEmpty()) + else if(load_custom_sql && aux_elem==Attributes::PREPENDED_SQL && + attribs[Attributes::PREPENDED_SQL].isEmpty()) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -10054,10 +10054,10 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { if(load_custom_colors) { - if(attribs[ParsersAttributes::CUSTOM_COLOR]==ParsersAttributes::NONE) + if(attribs[Attributes::CustomColor]==Attributes::NONE) rel->setCustomColor(Qt::transparent); else - rel->setCustomColor(QColor(attribs[ParsersAttributes::CUSTOM_COLOR])); + rel->setCustomColor(QColor(attribs[Attributes::CustomColor])); } if(load_objs_pos) @@ -10074,16 +10074,16 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else if(schema) { if(load_custom_colors) - schema->setFillColor(QColor(attribs[ParsersAttributes::CUSTOM_COLOR])); + schema->setFillColor(QColor(attribs[Attributes::CustomColor])); - schema->setRectVisible(attribs[ParsersAttributes::RECT_VISIBLE]==ParsersAttributes::True); + schema->setRectVisible(attribs[Attributes::RECT_VISIBLE]==Attributes::True); } if(load_fadeout) - dynamic_cast(object)->setFadedOut(attribs[ParsersAttributes::FADED_OUT]==ParsersAttributes::True); + dynamic_cast(object)->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); if(load_extattribs && base_tab) - base_tab->setExtAttribsHidden(attribs[ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::True); + base_tab->setExtAttribsHidden(attribs[Attributes::HIDE_EXT_ATTRIBS]==Attributes::True); } points.clear(); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 8bb2fa9d9a..c1602eaaeb 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -22,10 +22,10 @@ Domain::Domain(void) { obj_type=ObjectType::Domain; not_null=false; - attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); - attributes[ParsersAttributes::NOT_NULL]=QString(); - attributes[ParsersAttributes::TYPE]=QString(); - attributes[ParsersAttributes::CONSTRAINTS]=QString(); + attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::NOT_NULL]=QString(); + attributes[Attributes::TYPE]=QString(); + attributes[Attributes::Constraints]=QString(); } void Domain::addCheckConstraint(const QString &name, const QString &expr) @@ -126,20 +126,20 @@ QString Domain::getCodeDefinition(unsigned def_type) attribs_map aux_attribs; - attributes[ParsersAttributes::NOT_NULL]=(not_null ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::DEFAULT_VALUE]=default_value; + attributes[Attributes::NOT_NULL]=(not_null ? Attributes::True : QString()); + attributes[Attributes::DEFAULT_VALUE]=default_value; for(auto itr : chk_constrs) { - aux_attribs[ParsersAttributes::NAME] = itr.first; - aux_attribs[ParsersAttributes::EXPRESSION] = itr.second; - attributes[ParsersAttributes::CONSTRAINTS]+=schparser.getCodeDefinition(ParsersAttributes::DOM_CONSTRAINT, aux_attribs, def_type); + aux_attribs[Attributes::NAME] = itr.first; + aux_attribs[Attributes::EXPRESSION] = itr.second; + attributes[Attributes::Constraints]+=schparser.getCodeDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, def_type); } if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::TYPE]=(*type); + attributes[Attributes::TYPE]=(*type); else - attributes[ParsersAttributes::TYPE]=type.getCodeDefinition(def_type); + attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); return(BaseObject::__getCodeDefinition(def_type)); } @@ -169,23 +169,23 @@ QString Domain::getAlterDefinition(BaseObject *object) attribs_map orig_constrs, aux_constrs, aux_attribs; QString orig_expr, aux_expr; - attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); - attributes[ParsersAttributes::NOT_NULL]=QString(); - attributes[ParsersAttributes::CONSTRAINTS]=QString(); - attributes[ParsersAttributes::EXPRESSION]=QString(); - attributes[ParsersAttributes::OLD_NAME]=QString(); - attributes[ParsersAttributes::NEW_NAME]=QString(); + attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::NOT_NULL]=QString(); + attributes[Attributes::Constraints]=QString(); + attributes[Attributes::EXPRESSION]=QString(); + attributes[Attributes::OLD_NAME]=QString(); + attributes[Attributes::NEW_NAME]=QString(); if(this->default_value!=domain->default_value) - attributes[ParsersAttributes::DEFAULT_VALUE]=(!domain->default_value.isEmpty() ? domain->default_value : ParsersAttributes::UNSET); + attributes[Attributes::DEFAULT_VALUE]=(!domain->default_value.isEmpty() ? domain->default_value : Attributes::UNSET); if(this->not_null!=domain->not_null) - attributes[ParsersAttributes::NOT_NULL]=(domain->not_null ? ParsersAttributes::True : ParsersAttributes::UNSET); + attributes[Attributes::NOT_NULL]=(domain->not_null ? Attributes::True : Attributes::UNSET); orig_constrs = this->chk_constrs; aux_constrs = domain->chk_constrs; - aux_attribs[ParsersAttributes::SQL_OBJECT] = this->getSQLName(); - aux_attribs[ParsersAttributes::SIGNATURE] = this->getSignature(); + aux_attribs[Attributes::SQL_OBJECT] = this->getSQLName(); + aux_attribs[Attributes::SIGNATURE] = this->getSignature(); //Generating the DROP for check constraints that does not exists anymore for(auto constr : orig_constrs) @@ -197,17 +197,17 @@ QString Domain::getAlterDefinition(BaseObject *object) if(aux_constrs.count(constr.first) == 0 || (aux_constrs.count(constr.first) && orig_expr != aux_expr)) { - aux_attribs[ParsersAttributes::NAME]=constr.first; - aux_attribs[ParsersAttributes::EXPRESSION]=ParsersAttributes::UNSET; - attributes[ParsersAttributes::CONSTRAINTS]+=BaseObject::getAlterDefinition(ParsersAttributes::DOM_CONSTRAINT, aux_attribs, false, true); + aux_attribs[Attributes::NAME]=constr.first; + aux_attribs[Attributes::EXPRESSION]=Attributes::UNSET; + attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, false, true); } //We should include a command to recreate the check constraint with the new expression if(aux_constrs.count(constr.first) && orig_expr != aux_expr) { - aux_attribs[ParsersAttributes::NAME]=constr.first; - aux_attribs[ParsersAttributes::EXPRESSION]=aux_constrs[constr.first]; - attributes[ParsersAttributes::CONSTRAINTS]+=BaseObject::getAlterDefinition(ParsersAttributes::DOM_CONSTRAINT, aux_attribs, false, true); + aux_attribs[Attributes::NAME]=constr.first; + aux_attribs[Attributes::EXPRESSION]=aux_constrs[constr.first]; + attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, false, true); } } @@ -216,9 +216,9 @@ QString Domain::getAlterDefinition(BaseObject *object) { if(orig_constrs.count(constr.first) == 0) { - aux_attribs[ParsersAttributes::NAME]=constr.first; - aux_attribs[ParsersAttributes::EXPRESSION]=constr.second; - attributes[ParsersAttributes::CONSTRAINTS]+=BaseObject::getAlterDefinition(ParsersAttributes::DOM_CONSTRAINT, aux_attribs, false, true); + aux_attribs[Attributes::NAME]=constr.first; + aux_attribs[Attributes::EXPRESSION]=constr.second; + attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, false, true); } } diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 6bade2d2e7..676c4a8b89 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -93,25 +93,25 @@ OperatorClass *Element::getOperatorClass(void) void Element::configureAttributes(attribs_map &attributes, unsigned def_type) { - attributes[ParsersAttributes::COLUMN]=QString(); - attributes[ParsersAttributes::EXPRESSION]=QString(); - attributes[ParsersAttributes::OP_CLASS]=QString(); - attributes[ParsersAttributes::USE_SORTING]=(this->sorting_enabled ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::NULLS_FIRST]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::AscOrder]=(this->sorting_enabled && this->sorting_attibs[AscOrder] ? ParsersAttributes::True : QString()); + attributes[Attributes::Column]=QString(); + attributes[Attributes::EXPRESSION]=QString(); + attributes[Attributes::OP_CLASS]=QString(); + attributes[Attributes::USE_SORTING]=(this->sorting_enabled ? Attributes::True : QString()); + attributes[Attributes::NULLS_FIRST]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? Attributes::True : QString()); + attributes[Attributes::AscOrder]=(this->sorting_enabled && this->sorting_attibs[AscOrder] ? Attributes::True : QString()); if(column) - attributes[ParsersAttributes::COLUMN]=column->getName(true); + attributes[Attributes::Column]=column->getName(true); else - attributes[ParsersAttributes::EXPRESSION]=expression; + attributes[Attributes::EXPRESSION]=expression; if(operator_class) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::OP_CLASS]=operator_class->getName(true); + attributes[Attributes::OP_CLASS]=operator_class->getName(true); else - attributes[ParsersAttributes::OP_CLASS]=operator_class->getCodeDefinition(def_type, true); + attributes[Attributes::OP_CLASS]=operator_class->getCodeDefinition(def_type, true); } } diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 7574dc9473..2b07ccfe5e 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -22,9 +22,9 @@ EventTrigger::EventTrigger(void) { obj_type=ObjectType::EventTrigger; function=nullptr; - attributes[ParsersAttributes::EVENT]=QString(); - attributes[ParsersAttributes::FILTER]=QString(); - attributes[ParsersAttributes::FUNCTION]=QString(); + attributes[Attributes::EVENT]=QString(); + attributes[Attributes::FILTER]=QString(); + attributes[Attributes::FUNCTION]=QString(); } void EventTrigger::setEvent(EventTriggerType evnt_type) @@ -59,7 +59,7 @@ void EventTrigger::setFunction(Function *func) void EventTrigger::setFilter(const QString &variable, const QStringList &values) { - if(variable.toLower()!=ParsersAttributes::TAG) + if(variable.toLower()!=Attributes::TAG) throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidEventTriggerVariable).arg(variable),__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!values.isEmpty()) @@ -109,31 +109,31 @@ QString EventTrigger::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::EVENT]=~event; + attributes[Attributes::EVENT]=~event; if(def_type==SchemaParser::SqlDefinition) { QStringList str_list; if(function) - attributes[ParsersAttributes::FUNCTION]=function->getSignature(); + attributes[Attributes::FUNCTION]=function->getSignature(); for(auto &flt : filter) str_list.push_back(QString("%1 IN ('%2')").arg(flt.first).arg(flt.second.join(QString("','")))); - attributes[ParsersAttributes::FILTER]=str_list.join(QString("\n\t AND ")); + attributes[Attributes::FILTER]=str_list.join(QString("\n\t AND ")); } else { if(function) - attributes[ParsersAttributes::FUNCTION]=function->getCodeDefinition(def_type, true); + attributes[Attributes::FUNCTION]=function->getCodeDefinition(def_type, true); for(auto &flt : filter) //Creating an element - attributes[ParsersAttributes::FILTER]+=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") - .arg(ParsersAttributes::FILTER) - .arg(ParsersAttributes::VARIABLE).arg(flt.first) - .arg(ParsersAttributes::VALUES).arg(flt.second.join(',')); + attributes[Attributes::FILTER]+=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") + .arg(Attributes::FILTER) + .arg(Attributes::VARIABLE).arg(flt.first) + .arg(Attributes::VALUES).arg(flt.second.join(',')); } return(BaseObject::__getCodeDefinition(def_type)); @@ -143,7 +143,7 @@ QString EventTrigger::getAlterDefinition(BaseObject *object) { try { - attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, false)); } catch(Exception &e) diff --git a/libpgmodeler/src/excludeelement.cpp b/libpgmodeler/src/excludeelement.cpp index fd19da9473..3f1f0eb712 100644 --- a/libpgmodeler/src/excludeelement.cpp +++ b/libpgmodeler/src/excludeelement.cpp @@ -20,18 +20,18 @@ QString ExcludeElement::getCodeDefinition(unsigned def_type) attribs_map attributes; schparser.setPgSQLVersion(BaseObject::getPgSQLVersion()); - attributes[ParsersAttributes::OPERATOR]=QString(); + attributes[Attributes::OPERATOR]=QString(); configureAttributes(attributes, def_type); if(_operator) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::OPERATOR]=_operator->getName(true); + attributes[Attributes::OPERATOR]=_operator->getName(true); else - attributes[ParsersAttributes::OPERATOR]=_operator->getCodeDefinition(def_type, true); + attributes[Attributes::OPERATOR]=_operator->getCodeDefinition(def_type, true); } - return(schparser.getCodeDefinition(ParsersAttributes::EXCLUDE_ELEMENT, attributes, def_type)); + return(schparser.getCodeDefinition(Attributes::EXCLUDE_ELEMENT, attributes, def_type)); } bool ExcludeElement::operator == (ExcludeElement &elem) diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 58f4e7c801..34e329ecb2 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -4,9 +4,9 @@ Extension::Extension(void) { obj_type=ObjectType::Extension; handles_type=false; - attributes[ParsersAttributes::HANDLES_TYPE]=QString(); - attributes[ParsersAttributes::CUR_VERSION]=QString(); - attributes[ParsersAttributes::OLD_VERSION]=QString(); + attributes[Attributes::HANDLES_TYPE]=QString(); + attributes[Attributes::CurVersion]=QString(); + attributes[Attributes::OLD_VERSION]=QString(); } void Extension::setName(const QString &name) @@ -85,10 +85,10 @@ QString Extension::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::NAME]=this->getName(def_type==SchemaParser::SqlDefinition, false); - attributes[ParsersAttributes::HANDLES_TYPE]=(handles_type ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::CUR_VERSION]=versions[CurVersion]; - attributes[ParsersAttributes::OLD_VERSION]=versions[OldVersion]; + attributes[Attributes::NAME]=this->getName(def_type==SchemaParser::SqlDefinition, false); + attributes[Attributes::HANDLES_TYPE]=(handles_type ? Attributes::True : QString()); + attributes[Attributes::CurVersion]=versions[CurVersion]; + attributes[Attributes::OLD_VERSION]=versions[OldVersion]; return(BaseObject::__getCodeDefinition(def_type)); } @@ -102,12 +102,12 @@ QString Extension::getAlterDefinition(BaseObject *object) try { - attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); - attributes[ParsersAttributes::NEW_VERSION]=QString(); + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); + attributes[Attributes::NEW_VERSION]=QString(); if(!this->versions[CurVersion].isEmpty() && !ext->versions[CurVersion].isEmpty() && this->versions[CurVersion].isEmpty() < ext->versions[CurVersion].isEmpty()) - attributes[ParsersAttributes::NEW_VERSION]=ext->versions[CurVersion]; + attributes[Attributes::NEW_VERSION]=ext->versions[CurVersion]; return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); } @@ -119,7 +119,7 @@ QString Extension::getAlterDefinition(BaseObject *object) QString Extension::getDropDefinition(bool cascade) { - attributes[ParsersAttributes::NAME] = this->getName(true); + attributes[Attributes::NAME] = this->getName(true); return(BaseObject::getDropDefinition(cascade)); } diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 823756d7a0..50db09d263 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -30,23 +30,23 @@ Function::Function(void) execution_cost=100; row_amount=1000; - attributes[ParsersAttributes::PARAMETERS]=QString(); - attributes[ParsersAttributes::EXECUTION_COST]=QString(); - attributes[ParsersAttributes::ROW_AMOUNT]=QString(); - attributes[ParsersAttributes::RETURN_TYPE]=QString(); - attributes[ParsersAttributes::FUNCTION_TYPE]=QString(); - attributes[ParsersAttributes::LANGUAGE]=QString(); - attributes[ParsersAttributes::RETURNS_SETOF]=QString(); - attributes[ParsersAttributes::SECURITY_TYPE]=QString(); - attributes[ParsersAttributes::BehaviorType]=QString(); - attributes[ParsersAttributes::DEFINITION]=QString(); - attributes[ParsersAttributes::SIGNATURE]=QString(); - attributes[ParsersAttributes::REF_TYPE]=QString(); - attributes[ParsersAttributes::WINDOW_FUNC]=QString(); - attributes[ParsersAttributes::RETURN_TABLE]=QString(); - attributes[ParsersAttributes::LIBRARY]=QString(); - attributes[ParsersAttributes::SYMBOL]=QString(); - attributes[ParsersAttributes::LEAKPROOF]=QString(); + attributes[Attributes::PARAMETERS]=QString(); + attributes[Attributes::EXECUTION_COST]=QString(); + attributes[Attributes::ROW_AMOUNT]=QString(); + attributes[Attributes::RETURN_TYPE]=QString(); + attributes[Attributes::FUNCTION_TYPE]=QString(); + attributes[Attributes::LANGUAGE]=QString(); + attributes[Attributes::RETURNS_SETOF]=QString(); + attributes[Attributes::SECURITY_TYPE]=QString(); + attributes[Attributes::BehaviorType]=QString(); + attributes[Attributes::DEFINITION]=QString(); + attributes[Attributes::SIGNATURE]=QString(); + attributes[Attributes::REF_TYPE]=QString(); + attributes[Attributes::WINDOW_FUNC]=QString(); + attributes[Attributes::RETURN_TABLE]=QString(); + attributes[Attributes::LIBRARY]=QString(); + attributes[Attributes::SYMBOL]=QString(); + attributes[Attributes::LEAKPROOF]=QString(); } void Function::setName(const QString &name) @@ -139,7 +139,7 @@ void Function::setParametersAttribute(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) str_param.remove(str_param.size()-2,2); - attributes[ParsersAttributes::PARAMETERS]=str_param; + attributes[Attributes::PARAMETERS]=str_param; } void Function::setTableReturnTypeAttribute(unsigned def_type) @@ -156,7 +156,7 @@ void Function::setTableReturnTypeAttribute(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) str_type.remove(str_type.size()-2,2); - attributes[ParsersAttributes::RETURN_TABLE]=str_type; + attributes[Attributes::RETURN_TABLE]=str_type; } void Function::setExecutionCost(unsigned exec_cost) @@ -457,40 +457,40 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) setParametersAttribute(def_type); - attributes[ParsersAttributes::EXECUTION_COST]=QString("%1").arg(execution_cost); - attributes[ParsersAttributes::ROW_AMOUNT]=QString("%1").arg(row_amount); - attributes[ParsersAttributes::FUNCTION_TYPE]=(~function_type); + attributes[Attributes::EXECUTION_COST]=QString("%1").arg(execution_cost); + attributes[Attributes::ROW_AMOUNT]=QString("%1").arg(row_amount); + attributes[Attributes::FUNCTION_TYPE]=(~function_type); if(language) { if(def_type==SchemaParser::SqlDefinition) { - attributes[ParsersAttributes::LANGUAGE]=language->getName(false); - attributes[ParsersAttributes::RETURN_TYPE]=(*return_type); + attributes[Attributes::LANGUAGE]=language->getName(false); + attributes[Attributes::RETURN_TYPE]=(*return_type); } else { - attributes[ParsersAttributes::LANGUAGE]=language->getCodeDefinition(def_type,true); - attributes[ParsersAttributes::RETURN_TYPE]=return_type.getCodeDefinition(def_type); + attributes[Attributes::LANGUAGE]=language->getCodeDefinition(def_type,true); + attributes[Attributes::RETURN_TYPE]=return_type.getCodeDefinition(def_type); } } setTableReturnTypeAttribute(def_type); - attributes[ParsersAttributes::RETURNS_SETOF]=(returns_setof ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::WINDOW_FUNC]=(is_wnd_function ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::LEAKPROOF]=(is_leakproof ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::SECURITY_TYPE]=(~security_type); - attributes[ParsersAttributes::BehaviorType]=(~behavior_type); - attributes[ParsersAttributes::DEFINITION]=source_code; + attributes[Attributes::RETURNS_SETOF]=(returns_setof ? Attributes::True : QString()); + attributes[Attributes::WINDOW_FUNC]=(is_wnd_function ? Attributes::True : QString()); + attributes[Attributes::LEAKPROOF]=(is_leakproof ? Attributes::True : QString()); + attributes[Attributes::SECURITY_TYPE]=(~security_type); + attributes[Attributes::BehaviorType]=(~behavior_type); + attributes[Attributes::DEFINITION]=source_code; if(language->getName()==~LanguageType(LanguageType::C)) { - attributes[ParsersAttributes::SYMBOL]=symbol; - attributes[ParsersAttributes::LIBRARY]=library; + attributes[Attributes::SYMBOL]=symbol; + attributes[Attributes::LIBRARY]=library; } - attributes[ParsersAttributes::SIGNATURE]=signature; + attributes[Attributes::SIGNATURE]=signature; return(BaseObject::getCodeDefinition(def_type, reduced_form)); } @@ -505,40 +505,40 @@ QString Function::getAlterDefinition(BaseObject *object) { attribs_map attribs; - attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); if(this->source_code.simplified()!=func->source_code.simplified() || this->library!=func->library || this->symbol!=func->symbol) { - attribs[ParsersAttributes::DEFINITION]=func->getCodeDefinition(SchemaParser::SqlDefinition); - attribs[ParsersAttributes::DEFINITION].replace(QString("CREATE FUNCTION"), QString("CREATE OR REPLACE FUNCTION")); + attribs[Attributes::DEFINITION]=func->getCodeDefinition(SchemaParser::SqlDefinition); + attribs[Attributes::DEFINITION].replace(QString("CREATE FUNCTION"), QString("CREATE OR REPLACE FUNCTION")); } else { if(this->execution_cost!=func->execution_cost) - attribs[ParsersAttributes::EXECUTION_COST]=QString::number(func->execution_cost); + attribs[Attributes::EXECUTION_COST]=QString::number(func->execution_cost); if(this->returns_setof && func->returns_setof && this->row_amount!=func->row_amount) { - attribs[ParsersAttributes::RETURNS_SETOF]=ParsersAttributes::True; - attribs[ParsersAttributes::ROW_AMOUNT]=QString::number(row_amount); + attribs[Attributes::RETURNS_SETOF]=Attributes::True; + attribs[Attributes::ROW_AMOUNT]=QString::number(row_amount); } if(this->function_type!=func->function_type) - attribs[ParsersAttributes::FUNCTION_TYPE]=~func->function_type; + attribs[Attributes::FUNCTION_TYPE]=~func->function_type; if(this->is_leakproof!=func->is_leakproof) - attribs[ParsersAttributes::LEAKPROOF]=(func->is_leakproof ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[Attributes::LEAKPROOF]=(func->is_leakproof ? Attributes::True : Attributes::UNSET); if(this->security_type!=func->security_type) - attribs[ParsersAttributes::SECURITY_TYPE]=~func->security_type; + attribs[Attributes::SECURITY_TYPE]=~func->security_type; if((this->behavior_type!=func->behavior_type) && ((this->behavior_type==BehaviorType::CalledOnNullInput) || ((this->behavior_type==BehaviorType::Strict || this->behavior_type==BehaviorType::ReturnsNullOnNullInput) && func->function_type==BehaviorType::CalledOnNullInput))) - attribs[ParsersAttributes::BehaviorType]=~func->behavior_type; + attribs[Attributes::BehaviorType]=~func->behavior_type; } copyAttributes(attribs); diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 2ed576399f..1b42fe8228 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -21,7 +21,7 @@ GenericSQL::GenericSQL(void) { obj_type=ObjectType::GenericSql; - attributes[ParsersAttributes::DEFINITION] = QString(); + attributes[Attributes::DEFINITION] = QString(); } void GenericSQL::setDefinition(const QString &def) @@ -40,7 +40,7 @@ QString GenericSQL::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::DEFINITION] = definition; + attributes[Attributes::DEFINITION] = definition; return(this->BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 4aa2da67e1..200bbd894c 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -24,22 +24,22 @@ Index::Index(void) index_attribs[Unique]=index_attribs[Concurrent]= index_attribs[FastUpdate]=index_attribs[Buffering]=false; fill_factor=90; - attributes[ParsersAttributes::UNIQUE]=QString(); - attributes[ParsersAttributes::CONCURRENT]=QString(); - attributes[ParsersAttributes::TABLE]=QString(); - attributes[ParsersAttributes::INDEX_TYPE]=QString(); - attributes[ParsersAttributes::COLUMNS]=QString(); - attributes[ParsersAttributes::EXPRESSION]=QString(); - attributes[ParsersAttributes::FACTOR]=QString(); - attributes[ParsersAttributes::PREDICATE]=QString(); - attributes[ParsersAttributes::OP_CLASS]=QString(); - attributes[ParsersAttributes::NULLS_FIRST]=QString(); - attributes[ParsersAttributes::AscOrder]=QString(); - attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); - attributes[ParsersAttributes::ELEMENTS]=QString(); - attributes[ParsersAttributes::FAST_UPDATE]=QString(); - attributes[ParsersAttributes::Buffering]=QString(); - attributes[ParsersAttributes::STORAGE_PARAMS]=QString(); + attributes[Attributes::UNIQUE]=QString(); + attributes[Attributes::Concurrent]=QString(); + attributes[Attributes::TABLE]=QString(); + attributes[Attributes::INDEX_TYPE]=QString(); + attributes[Attributes::Columns]=QString(); + attributes[Attributes::EXPRESSION]=QString(); + attributes[Attributes::FACTOR]=QString(); + attributes[Attributes::PREDICATE]=QString(); + attributes[Attributes::OP_CLASS]=QString(); + attributes[Attributes::NULLS_FIRST]=QString(); + attributes[Attributes::AscOrder]=QString(); + attributes[Attributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::ELEMENTS]=QString(); + attributes[Attributes::FAST_UPDATE]=QString(); + attributes[Attributes::Buffering]=QString(); + attributes[Attributes::STORAGE_PARAMS]=QString(); } void Index::setIndexElementsAttribute(unsigned def_type) @@ -54,7 +54,7 @@ void Index::setIndexElementsAttribute(unsigned def_type) if(i < (count-1) && def_type==SchemaParser::SqlDefinition) str_elem+=','; } - attributes[ParsersAttributes::ELEMENTS]=str_elem; + attributes[Attributes::ELEMENTS]=str_elem; } int Index::getElementIndex(IndexElement elem) @@ -331,38 +331,38 @@ QString Index::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); setIndexElementsAttribute(def_type); - attributes[ParsersAttributes::UNIQUE]=(index_attribs[Unique] ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::CONCURRENT]=(index_attribs[Concurrent] ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::INDEX_TYPE]=(~indexing_type); - attributes[ParsersAttributes::PREDICATE]=predicate; - attributes[ParsersAttributes::STORAGE_PARAMS]=QString(); + attributes[Attributes::UNIQUE]=(index_attribs[Unique] ? Attributes::True : QString()); + attributes[Attributes::Concurrent]=(index_attribs[Concurrent] ? Attributes::True : QString()); + attributes[Attributes::INDEX_TYPE]=(~indexing_type); + attributes[Attributes::PREDICATE]=predicate; + attributes[Attributes::STORAGE_PARAMS]=QString(); if(getParentTable()) { - attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::TABLE]=getParentTable()->getName(true); if(def_type==SchemaParser::SqlDefinition && getParentTable()->getSchema()) - attributes[ParsersAttributes::SCHEMA]=getParentTable()->getSchema()->getName(true); + attributes[Attributes::SCHEMA]=getParentTable()->getSchema()->getName(true); } if(this->indexing_type==IndexingType::Gin) - attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::FAST_UPDATE]=(index_attribs[FastUpdate] ? ParsersAttributes::True : QString()); + attributes[Attributes::STORAGE_PARAMS]=attributes[Attributes::FAST_UPDATE]=(index_attribs[FastUpdate] ? Attributes::True : QString()); if(this->indexing_type==IndexingType::Gist) - attributes[ParsersAttributes::STORAGE_PARAMS]=attributes[ParsersAttributes::Buffering]=(index_attribs[Buffering] ? ParsersAttributes::True : QString()); + attributes[Attributes::STORAGE_PARAMS]=attributes[Attributes::Buffering]=(index_attribs[Buffering] ? Attributes::True : QString()); if(/*this->indexing_type==IndexingType::btree && */fill_factor >= 10) { - attributes[ParsersAttributes::FACTOR]=QString("%1").arg(fill_factor); - attributes[ParsersAttributes::STORAGE_PARAMS]=ParsersAttributes::True; + attributes[Attributes::FACTOR]=QString("%1").arg(fill_factor); + attributes[Attributes::STORAGE_PARAMS]=Attributes::True; } else if(def_type==SchemaParser::XmlDefinition) - attributes[ParsersAttributes::FACTOR]=QString("0"); + attributes[Attributes::FACTOR]=QString("0"); /* Case the index doesn't referece some column added by relationship it will be declared inside the parent table construction by the use of 'decl-in-table' schema attribute */ if(!isReferRelationshipAddedColumn()) - attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::True; + attributes[Attributes::DECL_IN_TABLE]=Attributes::True; return(BaseObject::__getCodeDefinition(def_type)); } @@ -385,20 +385,20 @@ QString Index::getAlterDefinition(BaseObject *object) try { attribs_map attribs; - attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); if(this->indexing_type==index->indexing_type) { if(this->fill_factor!=index->fill_factor && index->fill_factor >= 10) - attribs[ParsersAttributes::FACTOR]=QString::number(index->fill_factor); + attribs[Attributes::FACTOR]=QString::number(index->fill_factor); if(this->indexing_type==IndexingType::Gin && this->index_attribs[FastUpdate] != index->index_attribs[FastUpdate]) - attribs[ParsersAttributes::FAST_UPDATE]=(index->index_attribs[FastUpdate] ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[Attributes::FAST_UPDATE]=(index->index_attribs[FastUpdate] ? Attributes::True : Attributes::UNSET); if(this->indexing_type==IndexingType::Gist && this->index_attribs[Buffering] != index->index_attribs[Buffering]) - attribs[ParsersAttributes::Buffering]=(index->index_attribs[Buffering] ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[Attributes::Buffering]=(index->index_attribs[Buffering] ? Attributes::True : Attributes::UNSET); } copyAttributes(attribs); diff --git a/libpgmodeler/src/indexelement.cpp b/libpgmodeler/src/indexelement.cpp index 75e562a746..4d8e88715e 100644 --- a/libpgmodeler/src/indexelement.cpp +++ b/libpgmodeler/src/indexelement.cpp @@ -38,17 +38,17 @@ QString IndexElement::getCodeDefinition(unsigned def_type) attribs_map attributes; schparser.setPgSQLVersion(BaseObject::getPgSQLVersion()); - attributes[ParsersAttributes::COLLATION]=QString(); + attributes[Attributes::Collation]=QString(); configureAttributes(attributes, def_type); if(collation) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::COLLATION]=collation->getName(true); + attributes[Attributes::Collation]=collation->getName(true); else - attributes[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); + attributes[Attributes::Collation]=collation->getCodeDefinition(def_type, true); } - return(schparser.getCodeDefinition(ParsersAttributes::INDEX_ELEMENT,attributes, def_type)); + return(schparser.getCodeDefinition(Attributes::INDEX_ELEMENT,attributes, def_type)); } diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 41ca39d415..5e786ba743 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -26,10 +26,10 @@ Language::Language(void) for(unsigned i=ValidatorFunc; i <= InlineFunc; i++) functions[i]=nullptr; - attributes[ParsersAttributes::TRUSTED]=QString(); - attributes[ParsersAttributes::HANDLER_FUNC]=QString(); - attributes[ParsersAttributes::VALIDATOR_FUNC]=QString(); - attributes[ParsersAttributes::INLINE_FUNC]=QString(); + attributes[Attributes::TRUSTED]=QString(); + attributes[Attributes::HANDLER_FUNC]=QString(); + attributes[Attributes::VALIDATOR_FUNC]=QString(); + attributes[Attributes::INLINE_FUNC]=QString(); } void Language::setName(const QString &name) @@ -116,11 +116,11 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) if(!code_def.isEmpty()) return(code_def); unsigned i; - QString attribs_func[3]={ParsersAttributes::VALIDATOR_FUNC, - ParsersAttributes::HANDLER_FUNC, - ParsersAttributes::INLINE_FUNC}; + QString attribs_func[3]={Attributes::VALIDATOR_FUNC, + Attributes::HANDLER_FUNC, + Attributes::INLINE_FUNC}; - attributes[ParsersAttributes::TRUSTED]=(is_trusted ? ParsersAttributes::True : QString()); + attributes[Attributes::TRUSTED]=(is_trusted ? Attributes::True : QString()); if(!reduced_form && def_type==SchemaParser::XmlDefinition) reduced_form=(!functions[ValidatorFunc] && !functions[HandlerFunc] && !functions[InlineFunc] && !this->getOwner()); @@ -133,7 +133,7 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[attribs_func[i]]=functions[i]->getName(true); else { - functions[i]->setAttribute(ParsersAttributes::REF_TYPE, attribs_func[i]); + functions[i]->setAttribute(Attributes::REF_TYPE, attribs_func[i]); attributes[attribs_func[i]]=functions[i]->getCodeDefinition(def_type, true); } } diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index ed7a754288..8a161ee803 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -34,17 +34,17 @@ Operator::Operator(void) argument_types[LEFT_ARG]=PgSqlType(QString("\"any\"")); argument_types[RIGHT_ARG]=PgSqlType(QString("\"any\"")); - attributes[ParsersAttributes::LEFT_TYPE]=QString(); - attributes[ParsersAttributes::RIGHT_TYPE]=QString(); - attributes[ParsersAttributes::COMMUTATOR_OP]=QString(); - attributes[ParsersAttributes::NEGATOR_OP]=QString(); - attributes[ParsersAttributes::RESTRICTION_FUNC]=QString(); - attributes[ParsersAttributes::JOIN_FUNC]=QString(); - attributes[ParsersAttributes::OPERATOR_FUNC]=QString(); - attributes[ParsersAttributes::HASHES]=QString(); - attributes[ParsersAttributes::MERGES]=QString(); - attributes[ParsersAttributes::SIGNATURE]=QString(); - attributes[ParsersAttributes::REF_TYPE]=QString(); + attributes[Attributes::LEFT_TYPE]=QString(); + attributes[Attributes::RIGHT_TYPE]=QString(); + attributes[Attributes::CommutatorOp]=QString(); + attributes[Attributes::NEGATOR_OP]=QString(); + attributes[Attributes::RESTRICTION_FUNC]=QString(); + attributes[Attributes::JOIN_FUNC]=QString(); + attributes[Attributes::OPERATOR_FUNC]=QString(); + attributes[Attributes::HASHES]=QString(); + attributes[Attributes::MERGES]=QString(); + attributes[Attributes::SIGNATURE]=QString(); + attributes[Attributes::REF_TYPE]=QString(); } bool Operator::isValidName(const QString &name) @@ -280,13 +280,13 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) if(!code_def.isEmpty()) return(code_def); unsigned i; - QString type_attribs[]={ParsersAttributes::LEFT_TYPE, ParsersAttributes::RIGHT_TYPE}, - op_attribs[]={ ParsersAttributes::COMMUTATOR_OP, - ParsersAttributes::NEGATOR_OP }, + QString type_attribs[]={Attributes::LEFT_TYPE, Attributes::RIGHT_TYPE}, + op_attribs[]={ Attributes::CommutatorOp, + Attributes::NEGATOR_OP }, - func_attribs[]={ParsersAttributes::OPERATOR_FUNC, - ParsersAttributes::JOIN_FUNC, - ParsersAttributes::RESTRICTION_FUNC}; + func_attribs[]={Attributes::OPERATOR_FUNC, + Attributes::JOIN_FUNC, + Attributes::RESTRICTION_FUNC}; for(i=Operator::LEFT_ARG; i <= Operator::RIGHT_ARG; i++) { @@ -310,7 +310,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[op_attribs[i]]=operators[i]->getName(true); else { - operators[i]->attributes[ParsersAttributes::REF_TYPE]=op_attribs[i]; + operators[i]->attributes[Attributes::REF_TYPE]=op_attribs[i]; attributes[op_attribs[i]]=operators[i]->getCodeDefinition(def_type, true); } } @@ -324,15 +324,15 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[func_attribs[i]]=functions[i]->getName(true); else { - functions[i]->setAttribute(ParsersAttributes::REF_TYPE, func_attribs[i]); + functions[i]->setAttribute(Attributes::REF_TYPE, func_attribs[i]); attributes[func_attribs[i]]=functions[i]->getCodeDefinition(def_type, true); } } } - attributes[ParsersAttributes::HASHES]=(hashes ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::MERGES]=(merges ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::SIGNATURE]=getSignature(); + attributes[Attributes::HASHES]=(hashes ? Attributes::True : QString()); + attributes[Attributes::MERGES]=(merges ? Attributes::True : QString()); + attributes[Attributes::SIGNATURE]=getSignature(); return(BaseObject::getCodeDefinition(def_type, reduced_form)); } diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index 4f4f009867..9a65f21d07 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -23,11 +23,11 @@ OperatorClass::OperatorClass(void) obj_type=ObjectType::OpClass; family=nullptr; is_default=false; - attributes[ParsersAttributes::FAMILY]=QString(); - attributes[ParsersAttributes::ELEMENTS]=QString(); - attributes[ParsersAttributes::INDEX_TYPE]=QString(); - attributes[ParsersAttributes::TYPE]=QString(); - attributes[ParsersAttributes::DEFAULT]=QString(); + attributes[Attributes::FAMILY]=QString(); + attributes[Attributes::ELEMENTS]=QString(); + attributes[Attributes::INDEX_TYPE]=QString(); + attributes[Attributes::TYPE]=QString(); + attributes[Attributes::DEFAULT]=QString(); } OperatorClass::~OperatorClass(void) @@ -78,7 +78,7 @@ void OperatorClass::setElementsAttribute(unsigned def_type) i < count-1) str_elems+=QString(",\n"); } - attributes[ParsersAttributes::ELEMENTS]=str_elems; + attributes[Attributes::ELEMENTS]=str_elems; } void OperatorClass::addElement(OperatorClassElement elem) @@ -172,23 +172,23 @@ QString OperatorClass::getCodeDefinition(unsigned def_type, bool reduced_form) if(!code_def.isEmpty()) return(code_def); setElementsAttribute(def_type); - attributes[ParsersAttributes::INDEX_TYPE]=(~indexing_type); - attributes[ParsersAttributes::DEFAULT]=(is_default ? ParsersAttributes::True : QString()); + attributes[Attributes::INDEX_TYPE]=(~indexing_type); + attributes[Attributes::DEFAULT]=(is_default ? Attributes::True : QString()); if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::TYPE]=(*data_type); + attributes[Attributes::TYPE]=(*data_type); else - attributes[ParsersAttributes::TYPE]=data_type.getCodeDefinition(def_type); + attributes[Attributes::TYPE]=data_type.getCodeDefinition(def_type); if(family) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::FAMILY]=family->getName(true); + attributes[Attributes::FAMILY]=family->getName(true); else - attributes[ParsersAttributes::FAMILY]=family->getSignature(); + attributes[Attributes::FAMILY]=family->getSignature(); } - attributes[ParsersAttributes::SIGNATURE]=getSignature(); + attributes[Attributes::SIGNATURE]=getSignature(); return(BaseObject::getCodeDefinition(def_type, reduced_form)); } diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 24c54102a3..5b25f661df 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -125,57 +125,57 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) SchemaParser schparser; attribs_map attributes; - attributes[ParsersAttributes::TYPE]=QString(); - attributes[ParsersAttributes::STRATEGY_NUM]=QString(); - attributes[ParsersAttributes::SIGNATURE]=QString(); - attributes[ParsersAttributes::FUNCTION]=QString(); - attributes[ParsersAttributes::OPERATOR]=QString(); - attributes[ParsersAttributes::STORAGE]=QString(); - attributes[ParsersAttributes::OP_FAMILY]=QString(); - attributes[ParsersAttributes::DEFINITION]=QString(); + attributes[Attributes::TYPE]=QString(); + attributes[Attributes::STRATEGY_NUM]=QString(); + attributes[Attributes::SIGNATURE]=QString(); + attributes[Attributes::FUNCTION]=QString(); + attributes[Attributes::OPERATOR]=QString(); + attributes[Attributes::STORAGE]=QString(); + attributes[Attributes::OP_FAMILY]=QString(); + attributes[Attributes::DEFINITION]=QString(); if(element_type==FunctionElem && function && strategy_number > 0) { //FUNCTION support_number [ ( op_type [ , op_type ] ) ] funcname ( argument_type [, ...] ) - attributes[ParsersAttributes::FUNCTION]=ParsersAttributes::True; - attributes[ParsersAttributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); + attributes[Attributes::FUNCTION]=Attributes::True; + attributes[Attributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::SIGNATURE]=function->getSignature(); + attributes[Attributes::SIGNATURE]=function->getSignature(); else - attributes[ParsersAttributes::DEFINITION]=function->getCodeDefinition(def_type,true); + attributes[Attributes::DEFINITION]=function->getCodeDefinition(def_type,true); } else if(element_type==OperatorElem && _operator && strategy_number > 0) { //OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] [ FOR SEARCH | FOR ORDER BY sort_family_name ] - attributes[ParsersAttributes::OPERATOR]=ParsersAttributes::True; - attributes[ParsersAttributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); + attributes[Attributes::OPERATOR]=Attributes::True; + attributes[Attributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::SIGNATURE]=_operator->getSignature(); + attributes[Attributes::SIGNATURE]=_operator->getSignature(); else - attributes[ParsersAttributes::DEFINITION]=_operator->getCodeDefinition(def_type,true); + attributes[Attributes::DEFINITION]=_operator->getCodeDefinition(def_type,true); if(op_family) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::OP_FAMILY]=op_family->getName(true); + attributes[Attributes::OP_FAMILY]=op_family->getName(true); else - attributes[ParsersAttributes::DEFINITION]+=op_family->getCodeDefinition(def_type,true); + attributes[Attributes::DEFINITION]+=op_family->getCodeDefinition(def_type,true); } } else if(element_type==StorageElem && storage!=PgSqlType::Null) { //STORAGE storage_type - attributes[ParsersAttributes::STORAGE]=ParsersAttributes::True; + attributes[Attributes::STORAGE]=Attributes::True; if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::TYPE]=(*storage); + attributes[Attributes::TYPE]=(*storage); else - attributes[ParsersAttributes::DEFINITION]=storage.getCodeDefinition(def_type); + attributes[Attributes::DEFINITION]=storage.getCodeDefinition(def_type); } - return(schparser.getCodeDefinition(ParsersAttributes::ELEMENT,attributes, def_type)); + return(schparser.getCodeDefinition(Attributes::ELEMENT,attributes, def_type)); } bool OperatorClassElement::operator == (OperatorClassElement &elem) diff --git a/libpgmodeler/src/operatorfamily.cpp b/libpgmodeler/src/operatorfamily.cpp index 46b1f1f3b2..f7ceb680ae 100644 --- a/libpgmodeler/src/operatorfamily.cpp +++ b/libpgmodeler/src/operatorfamily.cpp @@ -21,7 +21,7 @@ OperatorFamily::OperatorFamily(void) { obj_type=ObjectType::OpFamily; - attributes[ParsersAttributes::INDEX_TYPE]=QString(); + attributes[Attributes::INDEX_TYPE]=QString(); } void OperatorFamily::setIndexingType(IndexingType idx_type) @@ -45,8 +45,8 @@ QString OperatorFamily::getCodeDefinition(unsigned def_type, bool reduced_form) QString code_def=getCachedCode(def_type, reduced_form); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::SIGNATURE]=getSignature(); - attributes[ParsersAttributes::INDEX_TYPE]=(~indexing_type); + attributes[Attributes::SIGNATURE]=getSignature(); + attributes[Attributes::INDEX_TYPE]=(~indexing_type); return(BaseObject::getCodeDefinition(def_type,reduced_form)); } diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index defe900a53..af94b84066 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -94,15 +94,15 @@ QString Parameter::getCodeDefinition(unsigned def_type) QString Parameter::getCodeDefinition(unsigned def_type, bool reduced_form) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::NAME]=BaseObject::formatName(obj_name); + attributes[Attributes::NAME]=BaseObject::formatName(obj_name); else - attributes[ParsersAttributes::NAME]=obj_name; + attributes[Attributes::NAME]=obj_name; - attributes[ParsersAttributes::PARAM_IN]=(is_in ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::PARAM_OUT]=(is_out ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::PARAM_VARIADIC]=(is_variadic ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::DEFAULT_VALUE]=default_value; - attributes[ParsersAttributes::TYPE]=type.getCodeDefinition(def_type); + attributes[Attributes::PARAM_IN]=(is_in ? Attributes::True : QString()); + attributes[Attributes::PARAM_OUT]=(is_out ? Attributes::True : QString()); + attributes[Attributes::PARAM_VARIADIC]=(is_variadic ? Attributes::True : QString()); + attributes[Attributes::DEFAULT_VALUE]=default_value; + attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); return(BaseObject::getCodeDefinition(def_type, reduced_form)); } diff --git a/libpgmodeler/src/partitionkey.cpp b/libpgmodeler/src/partitionkey.cpp index a83d87b632..126d58dc36 100644 --- a/libpgmodeler/src/partitionkey.cpp +++ b/libpgmodeler/src/partitionkey.cpp @@ -38,16 +38,16 @@ QString PartitionKey::getCodeDefinition(unsigned def_type) attribs_map attribs; schparser.setPgSQLVersion(BaseObject::getPgSQLVersion()); - attribs[ParsersAttributes::COLLATION]=QString(); + attribs[Attributes::Collation]=QString(); configureAttributes(attribs, def_type); if(collation) { if(def_type==SchemaParser::SqlDefinition) - attribs[ParsersAttributes::COLLATION]=collation->getName(true); + attribs[Attributes::Collation]=collation->getName(true); else - attribs[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); + attribs[Attributes::Collation]=collation->getCodeDefinition(def_type, true); } - return(schparser.getCodeDefinition(ParsersAttributes::PARTITION_KEY, attribs, def_type)); + return(schparser.getCodeDefinition(Attributes::PARTITION_KEY, attribs, def_type)); } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 1dd1be1657..b37e0b77f9 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -41,14 +41,14 @@ Permission::Permission(BaseObject *obj) this->obj_type=ObjectType::Permission; revoke=cascade=false; - attributes[ParsersAttributes::OBJECT]=QString(); - attributes[ParsersAttributes::TYPE]=QString(); - attributes[ParsersAttributes::PARENT]=QString(); - attributes[ParsersAttributes::GRANT_OP]=QString(); - attributes[ParsersAttributes::ROLES]=QString(); - attributes[ParsersAttributes::PRIVILEGES]=QString(); - attributes[ParsersAttributes::Cascade]=QString(); - attributes[ParsersAttributes::PRIVILEGES_GOP]=QString(); + attributes[Attributes::OBJECT]=QString(); + attributes[Attributes::TYPE]=QString(); + attributes[Attributes::PARENT]=QString(); + attributes[Attributes::GRANT_OP]=QString(); + attributes[Attributes::ROLES]=QString(); + attributes[Attributes::PRIVILEGES]=QString(); + attributes[Attributes::Cascade]=QString(); + attributes[Attributes::PRIVILEGES_GOP]=QString(); } bool Permission::acceptsPermission(ObjectType obj_type, int privilege) @@ -411,43 +411,43 @@ QString Permission::getCodeDefinition(unsigned def_type) unsigned i, count; ObjectType obj_type; - QString priv_vect[12]={ ParsersAttributes::SELECT_PRIV, ParsersAttributes::INSERT_PRIV, - ParsersAttributes::UPDATE_PRIV, ParsersAttributes::DELETE_PRIV, - ParsersAttributes::TRUNCATE_PRIV, ParsersAttributes::REFERENCES_PRIV, - ParsersAttributes::TRIGGER_PRIV, ParsersAttributes::CREATE_PRIV, - ParsersAttributes::CONNECT_PRIV, ParsersAttributes::TEMPORARY_PRIV, - ParsersAttributes::EXECUTE_PRIV, ParsersAttributes::USAGE_PRIV }; + QString priv_vect[12]={ Attributes::SELECT_PRIV, Attributes::INSERT_PRIV, + Attributes::UPDATE_PRIV, Attributes::DELETE_PRIV, + Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, + Attributes::TRIGGER_PRIV, Attributes::CreatePriv, + Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, + Attributes::EXECUTE_PRIV, Attributes::USAGE_PRIV }; obj_type=object->getObjectType(); - attributes[ParsersAttributes::REVOKE]=(revoke ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::Cascade]=(cascade ? ParsersAttributes::True : QString()); + attributes[Attributes::REVOKE]=(revoke ? Attributes::True : QString()); + attributes[Attributes::Cascade]=(cascade ? Attributes::True : QString()); if(def_type==SchemaParser::SqlDefinition) { //Views and Tables uses the same key word when setting permission (TABLE) - attributes[ParsersAttributes::TYPE]= + attributes[Attributes::TYPE]= (object->getObjectType()==ObjectType::View ? BaseObject::getSQLName(ObjectType::Table): BaseObject::getSQLName(object->getObjectType())); } else - attributes[ParsersAttributes::TYPE]=BaseObject::getSchemaName(object->getObjectType()); + attributes[Attributes::TYPE]=BaseObject::getSchemaName(object->getObjectType()); if(obj_type==ObjectType::Column) { - attributes[ParsersAttributes::OBJECT]=object->getName(true); - attributes[ParsersAttributes::PARENT]=dynamic_cast(object)->getParentTable()->getName(true); + attributes[Attributes::OBJECT]=object->getName(true); + attributes[Attributes::PARENT]=dynamic_cast(object)->getParentTable()->getName(true); } else - attributes[ParsersAttributes::OBJECT]=object->getSignature(); + attributes[Attributes::OBJECT]=object->getSignature(); if(def_type==SchemaParser::XmlDefinition) { for(i=0; i < 12; i++) { if(privileges[i] && grant_option[i]) - attributes[priv_vect[i]]=ParsersAttributes::GRANT_OP; + attributes[priv_vect[i]]=Attributes::GRANT_OP; else if(privileges[i]) - attributes[priv_vect[i]]=ParsersAttributes::True; + attributes[priv_vect[i]]=Attributes::True; else attributes[priv_vect[i]]=QString(); } @@ -464,16 +464,16 @@ QString Permission::getCodeDefinition(unsigned def_type) gop_priv_list.push_back(object->getObjectType() == ObjectType::Column ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); } - attributes[ParsersAttributes::PRIVILEGES] = priv_list.join(QChar(',')); - attributes[ParsersAttributes::PRIVILEGES_GOP] = gop_priv_list.join(QChar(',')); + attributes[Attributes::PRIVILEGES] = priv_list.join(QChar(',')); + attributes[Attributes::PRIVILEGES_GOP] = gop_priv_list.join(QChar(',')); } count=roles.size(); for(i=0; i < count; i++) - attributes[ParsersAttributes::ROLES]+=roles[i]->getName(true) + QString(","); + attributes[Attributes::ROLES]+=roles[i]->getName(true) + QString(","); - attributes[ParsersAttributes::ROLES].remove(attributes[ParsersAttributes::ROLES].size()-1,1); + attributes[Attributes::ROLES].remove(attributes[Attributes::ROLES].size()-1,1); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index e1cfbacea7..7ef0f4101b 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1588,39 +1588,39 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs_map attribs; SchemaParser schparser; - attribs[ParsersAttributes::LENGTH]=QString(); - attribs[ParsersAttributes::DIMENSION]=QString(); - attribs[ParsersAttributes::PRECISION]=QString(); - attribs[ParsersAttributes::WITH_TIMEZONE]=QString(); - attribs[ParsersAttributes::INTERVAL_TYPE]=QString(); - attribs[ParsersAttributes::SPATIAL_TYPE]=QString(); - attribs[ParsersAttributes::VARIATION]=QString(); - attribs[ParsersAttributes::SRID]=QString(); - attribs[ParsersAttributes::REF_TYPE]=ref_type; - - attribs[ParsersAttributes::NAME]=(~(*this)); - attribs[ParsersAttributes::LENGTH]=QString("%1").arg(this->length); + attribs[Attributes::LENGTH]=QString(); + attribs[Attributes::DIMENSION]=QString(); + attribs[Attributes::PRECISION]=QString(); + attribs[Attributes::WITH_TIMEZONE]=QString(); + attribs[Attributes::INTERVAL_TYPE]=QString(); + attribs[Attributes::SPATIAL_TYPE]=QString(); + attribs[Attributes::VARIATION]=QString(); + attribs[Attributes::SRID]=QString(); + attribs[Attributes::REF_TYPE]=ref_type; + + attribs[Attributes::NAME]=(~(*this)); + attribs[Attributes::LENGTH]=QString("%1").arg(this->length); if(dimension > 0) - attribs[ParsersAttributes::DIMENSION]=QString("%1").arg(this->dimension); + attribs[Attributes::DIMENSION]=QString("%1").arg(this->dimension); if(precision >= 0) - attribs[ParsersAttributes::PRECISION]=QString("%1").arg(this->precision); + attribs[Attributes::PRECISION]=QString("%1").arg(this->precision); if(interval_type != BaseType::Null) - attribs[ParsersAttributes::INTERVAL_TYPE]=(~interval_type); + attribs[Attributes::INTERVAL_TYPE]=(~interval_type); if(isGiSType()) { - attribs[ParsersAttributes::SPATIAL_TYPE]=(~spatial_type); - attribs[ParsersAttributes::VARIATION]=QString("%1").arg(spatial_type.getVariation()); - attribs[ParsersAttributes::SRID]=QString("%1").arg(spatial_type.getSRID()); + attribs[Attributes::SPATIAL_TYPE]=(~spatial_type); + attribs[Attributes::VARIATION]=QString("%1").arg(spatial_type.getVariation()); + attribs[Attributes::SRID]=QString("%1").arg(spatial_type.getSRID()); } if(with_timezone) - attribs[ParsersAttributes::WITH_TIMEZONE]=ParsersAttributes::True; + attribs[Attributes::WITH_TIMEZONE]=Attributes::True; - return(schparser.getCodeDefinition(ParsersAttributes::PGSQL_BASE_TYPE, attribs, def_type)); + return(schparser.getCodeDefinition(Attributes::PGSQL_BASE_TYPE, attribs, def_type)); } } diff --git a/libpgmodeler/src/pgsqltypes.h b/libpgmodeler/src/pgsqltypes.h index 13148fd4e3..e746119b99 100644 --- a/libpgmodeler/src/pgsqltypes.h +++ b/libpgmodeler/src/pgsqltypes.h @@ -26,7 +26,7 @@ #define PGSQL_TYPES_H #include "exception.h" -#include "parsersattributes.h" +#include "attributes.h" #include "schemaparser.h" #include #include diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index 4c9c27c63b..ee36cd9779 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -23,11 +23,11 @@ Policy::Policy(void) : TableObject() permissive = false; policy_cmd = PolicyCmdType::All; - attributes[ParsersAttributes::PERMISSIVE] = QString(); - attributes[ParsersAttributes::COMMAND] = QString(); - attributes[ParsersAttributes::USING_EXP] = QString(); - attributes[ParsersAttributes::CheckExp] = QString(); - attributes[ParsersAttributes::ROLES] = QString(); + attributes[Attributes::PERMISSIVE] = QString(); + attributes[Attributes::Command] = QString(); + attributes[Attributes::USING_EXP] = QString(); + attributes[Attributes::CheckExp] = QString(); + attributes[Attributes::ROLES] = QString(); } void Policy::setParentTable(BaseTable *table) @@ -116,17 +116,17 @@ QString Policy::getCodeDefinition(unsigned def_type) QStringList rol_names; if(getParentTable()) - attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::TABLE]=getParentTable()->getName(true); - attributes[ParsersAttributes::COMMAND] = ~policy_cmd; + attributes[Attributes::Command] = ~policy_cmd; for(auto role : roles) rol_names.append(role->getName(true)); - attributes[ParsersAttributes::PERMISSIVE] = (permissive ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::USING_EXP] = using_expr; - attributes[ParsersAttributes::CheckExp] = check_expr; - attributes[ParsersAttributes::ROLES] = rol_names.join(QString(", ")); + attributes[Attributes::PERMISSIVE] = (permissive ? Attributes::True : QString()); + attributes[Attributes::USING_EXP] = using_expr; + attributes[Attributes::CheckExp] = check_expr; + attributes[Attributes::ROLES] = rol_names.join(QString(", ")); return(BaseObject::__getCodeDefinition(def_type)); } @@ -151,13 +151,13 @@ QString Policy::getAlterDefinition(BaseObject *object) QStringList rol_names, aux_rol_names; attribs_map attribs; - attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); if(this->using_expr.simplified() != policy->using_expr.simplified()) - attribs[ParsersAttributes::USING_EXP] = policy->using_expr; + attribs[Attributes::USING_EXP] = policy->using_expr; if(this->check_expr.simplified() != policy->check_expr.simplified()) - attribs[ParsersAttributes::CheckExp] = policy->check_expr; + attribs[Attributes::CheckExp] = policy->check_expr; for(auto role : this->roles) rol_names.append(role->getName(true)); @@ -169,9 +169,9 @@ QString Policy::getAlterDefinition(BaseObject *object) aux_rol_names.sort(); if(!rol_names.isEmpty() && aux_rol_names.isEmpty()) - attribs[ParsersAttributes::ROLES] = ParsersAttributes::UNSET; + attribs[Attributes::ROLES] = Attributes::UNSET; else if(rol_names.join(QString(", ")) != aux_rol_names.join(QString(", "))) - attribs[ParsersAttributes::ROLES] = aux_rol_names.join(QString(", ")); + attribs[Attributes::ROLES] = aux_rol_names.join(QString(", ")); copyAttributes(attribs); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index d6ddf89342..a1dcc64ede 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -217,21 +217,21 @@ QString Reference::getXMLDefinition(void) attribs_map attribs; SchemaParser schparser; - attribs[ParsersAttributes::TABLE]=QString(); - attribs[ParsersAttributes::COLUMN]=QString(); + attribs[Attributes::TABLE]=QString(); + attribs[Attributes::Column]=QString(); if(table) - attribs[ParsersAttributes::TABLE]=table->getName(true); + attribs[Attributes::TABLE]=table->getName(true); if(column) - attribs[ParsersAttributes::COLUMN]=column->getName(); + attribs[Attributes::Column]=column->getName(); - attribs[ParsersAttributes::REF_ALIAS]=ref_alias; - attribs[ParsersAttributes::EXPRESSION]=expression; - attribs[ParsersAttributes::Alias]=alias; - attribs[ParsersAttributes::COLUMN_ALIAS]=column_alias; + attribs[Attributes::REF_ALIAS]=ref_alias; + attribs[Attributes::EXPRESSION]=expression; + attribs[Attributes::Alias]=alias; + attribs[Attributes::ColumnAlias]=column_alias; - return(schparser.getCodeDefinition(ParsersAttributes::REFERENCE, attribs, SchemaParser::XmlDefinition)); + return(schparser.getCodeDefinition(Attributes::REFERENCE, attribs, SchemaParser::XmlDefinition)); } bool Reference::operator == (Reference &refer) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index d031d6134c..2ff653398d 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -380,7 +380,7 @@ QString Relationship::getTableNameRelNN(void) void Relationship::setPartitionBoundingExpr(const QString &part_bound_expr) { - part_bounding_expr = part_bound_expr.toLower() == ParsersAttributes::DEFAULT.toLower() ? QString() : part_bound_expr; + part_bounding_expr = part_bound_expr.toLower() == Attributes::DEFAULT.toLower() ? QString() : part_bound_expr; this->invalidated = true; } @@ -2561,41 +2561,41 @@ QString Relationship::getCodeDefinition(unsigned def_type) { unsigned count, i; - attributes[ParsersAttributes::RELATIONSHIP_1N]=ParsersAttributes::True; - attributes[ParsersAttributes::CONSTRAINTS]=fk_rel1n->getCodeDefinition(def_type); + attributes[Attributes::RELATIONSHIP_1N]=Attributes::True; + attributes[Attributes::Constraints]=fk_rel1n->getCodeDefinition(def_type); if(uq_rel11) - attributes[ParsersAttributes::CONSTRAINTS]+=uq_rel11->getCodeDefinition(def_type); + attributes[Attributes::Constraints]+=uq_rel11->getCodeDefinition(def_type); count=rel_constraints.size(); for(i=0; i < count; i++) { if(dynamic_cast(rel_constraints[i])->getConstraintType()!=ConstraintType::PrimaryKey) - attributes[ParsersAttributes::CONSTRAINTS]+=dynamic_cast(rel_constraints[i])->getCodeDefinition(def_type, false); + attributes[Attributes::Constraints]+=dynamic_cast(rel_constraints[i])->getCodeDefinition(def_type, false); } - attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); + attributes[Attributes::TABLE]=getReceiverTable()->getName(true); } else if(table_relnn && rel_type==RelationshipNn) { unsigned count, i; - attributes[ParsersAttributes::RELATIONSHIP_NN]=ParsersAttributes::True; - attributes[ParsersAttributes::TABLE]=table_relnn->getCodeDefinition(def_type); + attributes[Attributes::RELATIONSHIP_NN]=Attributes::True; + attributes[Attributes::TABLE]=table_relnn->getCodeDefinition(def_type); count=table_relnn->getConstraintCount(); for(i=0; i < count; i++) { if(table_relnn->getConstraint(i)->getConstraintType()!=ConstraintType::PrimaryKey && table_relnn->getConstraint(i)->getConstraintType()!=ConstraintType::Check) - attributes[ParsersAttributes::CONSTRAINTS]+=table_relnn->getConstraint(i)->getCodeDefinition(def_type, true); + attributes[Attributes::Constraints]+=table_relnn->getConstraint(i)->getCodeDefinition(def_type, true); } } else if(rel_type==RelationshipGen) { - attributes[ParsersAttributes::RELATIONSHIP_GEN]=ParsersAttributes::True; - attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); + attributes[Attributes::RELATIONSHIP_GEN]=Attributes::True; + attributes[Attributes::TABLE]=getReceiverTable()->getName(true); } return(this->BaseObject::__getCodeDefinition(SchemaParser::SqlDefinition)); @@ -2606,49 +2606,49 @@ QString Relationship::getCodeDefinition(unsigned def_type) bool reduced_form; setRelationshipAttributes(); - attributes[ParsersAttributes::IDENTIFIER]=(identifier ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::SINGLE_PK_COLUMN]=(single_pk_column ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::DEFERRABLE]=(deferrable ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::DEFER_TYPE]=~deferral_type; - attributes[ParsersAttributes::UPD_ACTION]=~upd_action; - attributes[ParsersAttributes::DEL_ACTION]=~del_action; - - attributes[ParsersAttributes::TABLE_NAME]=tab_name_relnn; - attributes[ParsersAttributes::RELATIONSHIP_GEN]=(rel_type==RelationshipGen ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::RELATIONSHIP_DEP]=(rel_type==RelationshipDep ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::RELATIONSHIP_PART]=(rel_type==RelationshipPart ? ParsersAttributes::True : QString()); - - attributes[ParsersAttributes::SRC_COL_PATTERN]=name_patterns[SrcColPattern]; - attributes[ParsersAttributes::DST_COL_PATTERN]=name_patterns[DstColPattern]; - attributes[ParsersAttributes::PK_PATTERN]=name_patterns[PkPattern]; - attributes[ParsersAttributes::UQ_PATTERN]=name_patterns[UqPattern]; - attributes[ParsersAttributes::SRC_FK_PATTERN]=name_patterns[SrcFkPattern]; - attributes[ParsersAttributes::DST_FK_PATTERN]=name_patterns[DstFkPattern]; - attributes[ParsersAttributes::PK_COL_PATTERN]=name_patterns[PkColPattern]; - - attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=part_bounding_expr; - - attributes[ParsersAttributes::COLUMNS]=QString(); + attributes[Attributes::IDENTIFIER]=(identifier ? Attributes::True : QString()); + attributes[Attributes::SINGLE_PK_COLUMN]=(single_pk_column ? Attributes::True : QString()); + attributes[Attributes::DEFERRABLE]=(deferrable ? Attributes::True : QString()); + attributes[Attributes::DEFER_TYPE]=~deferral_type; + attributes[Attributes::UPD_ACTION]=~upd_action; + attributes[Attributes::DEL_ACTION]=~del_action; + + attributes[Attributes::TABLE_NAME]=tab_name_relnn; + attributes[Attributes::RELATIONSHIP_GEN]=(rel_type==RelationshipGen ? Attributes::True : QString()); + attributes[Attributes::RELATIONSHIP_DEP]=(rel_type==RelationshipDep ? Attributes::True : QString()); + attributes[Attributes::RELATIONSHIP_PART]=(rel_type==RelationshipPart ? Attributes::True : QString()); + + attributes[Attributes::SRC_COL_PATTERN]=name_patterns[SrcColPattern]; + attributes[Attributes::DST_COL_PATTERN]=name_patterns[DstColPattern]; + attributes[Attributes::PK_PATTERN]=name_patterns[PkPattern]; + attributes[Attributes::UQ_PATTERN]=name_patterns[UqPattern]; + attributes[Attributes::SRC_FK_PATTERN]=name_patterns[SrcFkPattern]; + attributes[Attributes::DST_FK_PATTERN]=name_patterns[DstFkPattern]; + attributes[Attributes::PK_COL_PATTERN]=name_patterns[PkColPattern]; + + attributes[Attributes::PARTITION_BOUND_EXPR]=part_bounding_expr; + + attributes[Attributes::Columns]=QString(); count=rel_attributes.size(); for(i=0; i < count; i++) { - attributes[ParsersAttributes::COLUMNS]+=dynamic_cast(rel_attributes[i])-> + attributes[Attributes::Columns]+=dynamic_cast(rel_attributes[i])-> getCodeDefinition(SchemaParser::XmlDefinition); } - attributes[ParsersAttributes::CONSTRAINTS]=QString(); + attributes[Attributes::Constraints]=QString(); count=rel_constraints.size(); for(i=0; i < count; i++) { if(!rel_constraints[i]->isProtected()) - attributes[ParsersAttributes::CONSTRAINTS]+=dynamic_cast(rel_constraints[i])-> + attributes[Attributes::Constraints]+=dynamic_cast(rel_constraints[i])-> getCodeDefinition(SchemaParser::XmlDefinition, true); } if(pk_original) { pk_original->setParentTable(getReceiverTable()); - attributes[ParsersAttributes::ORIGINAL_PK]=pk_original->getCodeDefinition(SchemaParser::XmlDefinition); + attributes[Attributes::ORIGINAL_PK]=pk_original->getCodeDefinition(SchemaParser::XmlDefinition); pk_original->setParentTable(nullptr); } @@ -2657,23 +2657,23 @@ QString Relationship::getCodeDefinition(unsigned def_type) { if(!gen_columns.empty() && i < gen_columns.size()) { - attributes[ParsersAttributes::SPECIAL_PK_COLS]+=QString("%1").arg(column_ids_pk_rel[i]); - if(i < count-1) attributes[ParsersAttributes::SPECIAL_PK_COLS]+=","; + attributes[Attributes::SPECIAL_PK_COLS]+=QString("%1").arg(column_ids_pk_rel[i]); + if(i < count-1) attributes[Attributes::SPECIAL_PK_COLS]+=","; } } if(copy_options.getCopyMode()!=0) { - attributes[ParsersAttributes::COPY_OPTIONS]=QString("%1").arg(copy_options.getCopyOptionsIds()); - attributes[ParsersAttributes::COPY_MODE]=QString("%1").arg(copy_options.getCopyMode()); + attributes[Attributes::CopyOptions]=QString("%1").arg(copy_options.getCopyOptionsIds()); + attributes[Attributes::CopyMode]=QString("%1").arg(copy_options.getCopyMode()); } - reduced_form=(attributes[ParsersAttributes::COLUMNS].isEmpty() && - attributes[ParsersAttributes::CONSTRAINTS].isEmpty() && - attributes[ParsersAttributes::POINTS].isEmpty() && - attributes[ParsersAttributes::SPECIAL_PK_COLS].isEmpty() && - attributes[ParsersAttributes::POINTS].isEmpty() && - attributes[ParsersAttributes::LABELS_POS].isEmpty()); + reduced_form=(attributes[Attributes::Columns].isEmpty() && + attributes[Attributes::Constraints].isEmpty() && + attributes[Attributes::POINTS].isEmpty() && + attributes[Attributes::SPECIAL_PK_COLS].isEmpty() && + attributes[Attributes::POINTS].isEmpty() && + attributes[Attributes::LABELS_POS].isEmpty()); if(!reduced_form) cached_reduced_code.clear(); @@ -2710,23 +2710,23 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) if(rel_type != RelationshipGen && rel_type != RelationshipPart) return(QString()); - attributes[ParsersAttributes::INHERIT]=QString(); - attributes[ParsersAttributes::AncestorTable]=QString(); - attributes[ParsersAttributes::PARTITIONED_TABLE]=QString(); - attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); + attributes[Attributes::INHERIT]=QString(); + attributes[Attributes::AncestorTable]=QString(); + attributes[Attributes::PARTITIONED_TABLE]=QString(); + attributes[Attributes::PARTITION_BOUND_EXPR]=QString(); if(rel_type == RelationshipGen) { - attributes[ParsersAttributes::INHERIT]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::True); - attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); - attributes[ParsersAttributes::AncestorTable]=getReferenceTable()->getName(true); + attributes[Attributes::INHERIT]=(undo_inh_part ? Attributes::UNSET : Attributes::True); + attributes[Attributes::TABLE]=getReceiverTable()->getName(true); + attributes[Attributes::AncestorTable]=getReferenceTable()->getName(true); } else { - attributes[ParsersAttributes::PARTITIONING]=(undo_inh_part ? ParsersAttributes::UNSET : ParsersAttributes::True); - attributes[ParsersAttributes::TABLE]=getReceiverTable()->getName(true); - attributes[ParsersAttributes::PARTITIONED_TABLE]=getReferenceTable()->getName(true); - attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=getReceiverTable()->getPartitionBoundingExpr(); + attributes[Attributes::PARTITIONING]=(undo_inh_part ? Attributes::UNSET : Attributes::True); + attributes[Attributes::TABLE]=getReceiverTable()->getName(true); + attributes[Attributes::PARTITIONED_TABLE]=getReferenceTable()->getName(true); + attributes[Attributes::PARTITION_BOUND_EXPR]=getReceiverTable()->getPartitionBoundingExpr(); } return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes)); diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 73bfd7ddc9..056822a22b 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -30,21 +30,21 @@ Role::Role(void) conn_limit=-1; - attributes[ParsersAttributes::SUPERUSER]=QString(); - attributes[ParsersAttributes::CREATEDB]=QString(); - attributes[ParsersAttributes::CREATEROLE]=QString(); - attributes[ParsersAttributes::INHERIT]=QString(); - attributes[ParsersAttributes::LOGIN]=QString(); - attributes[ParsersAttributes::CONN_LIMIT]=QString(); - attributes[ParsersAttributes::PASSWORD]=QString(); - attributes[ParsersAttributes::ENCRYPTED]=QString(); - attributes[ParsersAttributes::VALIDITY]=QString(); - attributes[ParsersAttributes::REF_ROLES]=QString(); - attributes[ParsersAttributes::MEMBER_ROLES]=QString(); - attributes[ParsersAttributes::AdminRoles]=QString(); - attributes[ParsersAttributes::REPLICATION]=QString(); - attributes[ParsersAttributes::GROUP]=QString(); - attributes[ParsersAttributes::BypassRls]=QString(); + attributes[Attributes::SUPERUSER]=QString(); + attributes[Attributes::CreateDb]=QString(); + attributes[Attributes::CreateRole]=QString(); + attributes[Attributes::INHERIT]=QString(); + attributes[Attributes::LOGIN]=QString(); + attributes[Attributes::ConnLimit]=QString(); + attributes[Attributes::PASSWORD]=QString(); + attributes[Attributes::ENCRYPTED]=QString(); + attributes[Attributes::VALIDITY]=QString(); + attributes[Attributes::REF_ROLES]=QString(); + attributes[Attributes::MEMBER_ROLES]=QString(); + attributes[Attributes::AdminRoles]=QString(); + attributes[Attributes::REPLICATION]=QString(); + attributes[Attributes::GROUP]=QString(); + attributes[Attributes::BypassRls]=QString(); } void Role::setOption(unsigned op_type, bool value) @@ -166,16 +166,16 @@ void Role::setRoleAttribute(unsigned role_type) { case MemberRole: roles_vect=&member_roles; - attrib=ParsersAttributes::MEMBER_ROLES; + attrib=Attributes::MEMBER_ROLES; break; case AdminRole: roles_vect=&admin_roles; - attrib=ParsersAttributes::AdminRoles; + attrib=Attributes::AdminRoles; break; case RefRole: default: roles_vect=&ref_roles; - attrib=ParsersAttributes::REF_ROLES; + attrib=Attributes::REF_ROLES; break; } @@ -329,23 +329,23 @@ QString Role::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); unsigned i; - QString op_attribs[]={ ParsersAttributes::SUPERUSER, ParsersAttributes::CREATEDB, - ParsersAttributes::CREATEROLE, ParsersAttributes::INHERIT, - ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, - ParsersAttributes::REPLICATION, ParsersAttributes::BypassRls }; + QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, + Attributes::CreateRole, Attributes::INHERIT, + Attributes::LOGIN, Attributes::ENCRYPTED, + Attributes::REPLICATION, Attributes::BypassRls }; setRoleAttribute(RefRole); setRoleAttribute(MemberRole); setRoleAttribute(AdminRole); for(i=0; i <= OpBypassRls; i++) - attributes[op_attribs[i]]=(options[i] ? ParsersAttributes::True : QString()); + attributes[op_attribs[i]]=(options[i] ? Attributes::True : QString()); - attributes[ParsersAttributes::PASSWORD]=password; - attributes[ParsersAttributes::VALIDITY]=validity; + attributes[Attributes::PASSWORD]=password; + attributes[Attributes::VALIDITY]=validity; if(conn_limit >= 0) - attributes[ParsersAttributes::CONN_LIMIT]=QString("%1").arg(conn_limit); + attributes[Attributes::ConnLimit]=QString("%1").arg(conn_limit); return(BaseObject::__getCodeDefinition(def_type)); } @@ -360,24 +360,24 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) try { attribs_map attribs; - QString op_attribs[]={ ParsersAttributes::SUPERUSER, ParsersAttributes::CREATEDB, - ParsersAttributes::CREATEROLE, ParsersAttributes::INHERIT, - ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, - ParsersAttributes::REPLICATION, ParsersAttributes::BypassRls }; + QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, + Attributes::CreateRole, Attributes::INHERIT, + Attributes::LOGIN, Attributes::ENCRYPTED, + Attributes::REPLICATION, Attributes::BypassRls }; - attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object, ignore_name_diff); + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object, ignore_name_diff); if(this->password!=role->password) - attribs[ParsersAttributes::PASSWORD]=role->password; + attribs[Attributes::PASSWORD]=role->password; if(this->validity!=role->validity) - attribs[ParsersAttributes::VALIDITY]=role->validity; + attribs[Attributes::VALIDITY]=role->validity; for(unsigned i=0; i <= OpBypassRls; i++) { - if((attribs.count(ParsersAttributes::PASSWORD) && i==OpEncrypted) || + if((attribs.count(Attributes::PASSWORD) && i==OpEncrypted) || this->options[i]!=role->options[i]) - attribs[op_attribs[i]]=(role->options[i] ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[op_attribs[i]]=(role->options[i] ? Attributes::True : Attributes::UNSET); } copyAttributes(attribs); diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index 94f52e5189..e7920726d4 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -22,11 +22,11 @@ Rule::Rule(void) { execution_type=BaseType::Null; obj_type=ObjectType::Rule; - attributes[ParsersAttributes::EVENT_TYPE]=QString(); - attributes[ParsersAttributes::TABLE]=QString(); - attributes[ParsersAttributes::CONDITION]=QString(); - attributes[ParsersAttributes::EXEC_TYPE]=QString(); - attributes[ParsersAttributes::COMMANDS]=QString(); + attributes[Attributes::EVENT_TYPE]=QString(); + attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Condition]=QString(); + attributes[Attributes::EXEC_TYPE]=QString(); + attributes[Attributes::Commands]=QString(); } void Rule::setCommandsAttribute(void) @@ -41,7 +41,7 @@ void Rule::setCommandsAttribute(void) if(i < (qtd-1)) str_cmds+=QString(";"); } - attributes[ParsersAttributes::COMMANDS]=str_cmds; + attributes[Attributes::Commands]=str_cmds; } void Rule::setEventType(EventType type) @@ -127,12 +127,12 @@ QString Rule::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); setCommandsAttribute(); - attributes[ParsersAttributes::CONDITION]=conditional_expr; - attributes[ParsersAttributes::EXEC_TYPE]=(~execution_type); - attributes[ParsersAttributes::EVENT_TYPE]=(~event_type); + attributes[Attributes::Condition]=conditional_expr; + attributes[Attributes::EXEC_TYPE]=(~execution_type); + attributes[Attributes::EVENT_TYPE]=(~event_type); if(getParentTable()) - attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::TABLE]=getParentTable()->getName(true); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index d3b84a1d66..25c35baf1d 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -23,8 +23,8 @@ Schema::Schema(void) obj_type=ObjectType::Schema; fill_color=QColor(225,225,225, 80); rect_visible=false; - attributes[ParsersAttributes::FILL_COLOR]=QString(); - attributes[ParsersAttributes::RECT_VISIBLE]=QString(); + attributes[Attributes::FILL_COLOR]=QString(); + attributes[Attributes::RECT_VISIBLE]=QString(); } void Schema::setName(const QString &name) @@ -67,8 +67,8 @@ QString Schema::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::FILL_COLOR]=fill_color.name(); - attributes[ParsersAttributes::RECT_VISIBLE]=(rect_visible ? ParsersAttributes::True : QString()); + attributes[Attributes::FILL_COLOR]=fill_color.name(); + attributes[Attributes::RECT_VISIBLE]=(rect_visible ? Attributes::True : QString()); setFadedOutAttribute(); return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index c91d95f317..af2d957681 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -32,16 +32,16 @@ Sequence::Sequence(void) setDefaultValues(PgSqlType(QString("serial"))); owner_col=nullptr; - attributes[ParsersAttributes::INCREMENT]=QString(); - attributes[ParsersAttributes::MIN_VALUE]=QString(); - attributes[ParsersAttributes::MAX_VALUE]=QString(); - attributes[ParsersAttributes::START]=QString(); - attributes[ParsersAttributes::Cache]=QString(); - attributes[ParsersAttributes::CYCLE]=QString(); - attributes[ParsersAttributes::OWNER_COLUMN]=QString(); - attributes[ParsersAttributes::TABLE]=QString(); - attributes[ParsersAttributes::COLUMN]=QString(); - attributes[ParsersAttributes::COL_IS_IDENTITY]=QString(); + attributes[Attributes::INCREMENT]=QString(); + attributes[Attributes::MIN_VALUE]=QString(); + attributes[Attributes::MAX_VALUE]=QString(); + attributes[Attributes::START]=QString(); + attributes[Attributes::Cache]=QString(); + attributes[Attributes::Cycle]=QString(); + attributes[Attributes::OWNER_COLUMN]=QString(); + attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Column]=QString(); + attributes[Attributes::ColIsIdentity]=QString(); } bool Sequence::isZeroValue(const QString &value) @@ -392,22 +392,22 @@ QString Sequence::getCodeDefinition(unsigned def_type) if(owner_col) { - attributes[ParsersAttributes::OWNER_COLUMN]=owner_col->getSignature(); + attributes[Attributes::OWNER_COLUMN]=owner_col->getSignature(); table=dynamic_cast
(owner_col->getParentTable()); } - attributes[ParsersAttributes::TABLE]=(table ? table->getName(true) : QString()); - attributes[ParsersAttributes::COLUMN]=(owner_col ? owner_col->getName(true) : QString()); + attributes[Attributes::TABLE]=(table ? table->getName(true) : QString()); + attributes[Attributes::Column]=(owner_col ? owner_col->getName(true) : QString()); - attributes[ParsersAttributes::COL_IS_IDENTITY]= - (owner_col && owner_col->getIdentityType() != BaseType::Null ? ParsersAttributes::True : QString()); + attributes[Attributes::ColIsIdentity]= + (owner_col && owner_col->getIdentityType() != BaseType::Null ? Attributes::True : QString()); - attributes[ParsersAttributes::INCREMENT]=increment; - attributes[ParsersAttributes::MIN_VALUE]=min_value; - attributes[ParsersAttributes::MAX_VALUE]=max_value; - attributes[ParsersAttributes::START]=start; - attributes[ParsersAttributes::Cache]=cache; - attributes[ParsersAttributes::CYCLE]=(cycle ? ParsersAttributes::True : QString()); + attributes[Attributes::INCREMENT]=increment; + attributes[Attributes::MIN_VALUE]=min_value; + attributes[Attributes::MAX_VALUE]=max_value; + attributes[Attributes::START]=start; + attributes[Attributes::Cache]=cache; + attributes[Attributes::Cycle]=(cycle ? Attributes::True : QString()); return(BaseObject::__getCodeDefinition(def_type)); } @@ -424,7 +424,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) Table *table=nullptr; attribs_map attribs; - attributes[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object); + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); if((this->owner_col && !seq->owner_col) || (!this->owner_col && seq->owner_col) || @@ -433,36 +433,36 @@ QString Sequence::getAlterDefinition(BaseObject *object) { if(seq->owner_col) { - attribs[ParsersAttributes::OWNER_COLUMN]=seq->owner_col->getSignature(); + attribs[Attributes::OWNER_COLUMN]=seq->owner_col->getSignature(); table=dynamic_cast
(seq->owner_col->getParentTable()); if(table) { - attribs[ParsersAttributes::TABLE]=table->getName(true); - attribs[ParsersAttributes::COLUMN]=seq->owner_col->getName(true); + attribs[Attributes::TABLE]=table->getName(true); + attribs[Attributes::Column]=seq->owner_col->getName(true); } } else - attribs[ParsersAttributes::OWNER_COLUMN]=ParsersAttributes::UNSET; + attribs[Attributes::OWNER_COLUMN]=Attributes::UNSET; } if(!seq->increment.isEmpty() && this->increment!=seq->increment) - attribs[ParsersAttributes::INCREMENT]=seq->increment; + attribs[Attributes::INCREMENT]=seq->increment; if(!seq->min_value.isEmpty() && this->min_value!=seq->min_value) - attribs[ParsersAttributes::MIN_VALUE]=seq->min_value; + attribs[Attributes::MIN_VALUE]=seq->min_value; if(!seq->max_value.isEmpty() && this->max_value!=seq->max_value) - attribs[ParsersAttributes::MAX_VALUE]=seq->max_value; + attribs[Attributes::MAX_VALUE]=seq->max_value; if(!seq->start.isEmpty() && this->start!=seq->start) - attribs[ParsersAttributes::START]=seq->start; + attribs[Attributes::START]=seq->start; if(!seq->cache.isEmpty() && this->cache!=seq->cache) - attribs[ParsersAttributes::Cache]=seq->cache; + attribs[Attributes::Cache]=seq->cache; if(this->cycle!=seq->cycle) - attribs[ParsersAttributes::CYCLE]=(seq->cycle ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[Attributes::Cycle]=(seq->cycle ? Attributes::True : Attributes::UNSET); copyAttributes(attribs); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 062771eb64..18a1084035 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -26,25 +26,25 @@ Table::Table(void) : BaseTable() { obj_type=ObjectType::Table; with_oid=gen_alter_cmds=unlogged=rls_enabled=rls_forced=false; - attributes[ParsersAttributes::COLUMNS]=QString(); - attributes[ParsersAttributes::INH_COLUMNS]=QString(); - attributes[ParsersAttributes::CONSTRAINTS]=QString(); - attributes[ParsersAttributes::OIDS]=QString(); - attributes[ParsersAttributes::COLS_COMMENT]=QString(); - attributes[ParsersAttributes::COPY_TABLE]=QString(); - attributes[ParsersAttributes::AncestorTable]=QString(); - attributes[ParsersAttributes::GEN_ALTER_CMDS]=QString(); - attributes[ParsersAttributes::CONSTR_SQL_DISABLED]=QString(); - attributes[ParsersAttributes::COL_INDEXES]=QString(); - attributes[ParsersAttributes::CONSTR_INDEXES]=QString(); - attributes[ParsersAttributes::UNLOGGED]=QString(); - attributes[ParsersAttributes::INITIAL_DATA]=QString(); - attributes[ParsersAttributes::RLS_ENABLED]=QString(); - attributes[ParsersAttributes::RLS_FORCED]=QString(); - attributes[ParsersAttributes::PARTITIONING]=QString(); - attributes[ParsersAttributes::PARTITION_KEY]=QString(); - attributes[ParsersAttributes::PARTITIONED_TABLE]=QString(); - attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=QString(); + attributes[Attributes::Columns]=QString(); + attributes[Attributes::INH_COLUMNS]=QString(); + attributes[Attributes::Constraints]=QString(); + attributes[Attributes::OIDS]=QString(); + attributes[Attributes::ColsComment]=QString(); + attributes[Attributes::CopyTable]=QString(); + attributes[Attributes::AncestorTable]=QString(); + attributes[Attributes::GEN_ALTER_CMDS]=QString(); + attributes[Attributes::ConstrSqlDisabled]=QString(); + attributes[Attributes::ColIndexes]=QString(); + attributes[Attributes::ConstrIndexes]=QString(); + attributes[Attributes::UNLOGGED]=QString(); + attributes[Attributes::INITIAL_DATA]=QString(); + attributes[Attributes::RLS_ENABLED]=QString(); + attributes[Attributes::RLS_FORCED]=QString(); + attributes[Attributes::PARTITIONING]=QString(); + attributes[Attributes::PARTITION_KEY]=QString(); + attributes[Attributes::PARTITIONED_TABLE]=QString(); + attributes[Attributes::PARTITION_BOUND_EXPR]=QString(); copy_table=partitioned_table=nullptr; partitioning_type=BaseType::Null; @@ -159,19 +159,19 @@ void Table::setCommentAttribute(TableObject *tab_obj) { attribs_map attribs; - attribs[ParsersAttributes::SIGNATURE]=tab_obj->getSignature(); - attribs[ParsersAttributes::SQL_OBJECT]=tab_obj->getSQLName(); - attribs[ParsersAttributes::COLUMN]=(tab_obj->getObjectType()==ObjectType::Column ? ParsersAttributes::True : QString()); - attribs[ParsersAttributes::CONSTRAINT]=(tab_obj->getObjectType()==ObjectType::Constraint ? ParsersAttributes::True : QString()); - attribs[ParsersAttributes::TABLE]=this->getName(true); - attribs[ParsersAttributes::NAME]=tab_obj->getName(true); - attribs[ParsersAttributes::COMMENT]=QString(tab_obj->getComment()).replace(QString("'"), QString("''"));; + attribs[Attributes::SIGNATURE]=tab_obj->getSignature(); + attribs[Attributes::SQL_OBJECT]=tab_obj->getSQLName(); + attribs[Attributes::Column]=(tab_obj->getObjectType()==ObjectType::Column ? Attributes::True : QString()); + attribs[Attributes::Constraint]=(tab_obj->getObjectType()==ObjectType::Constraint ? Attributes::True : QString()); + attribs[Attributes::TABLE]=this->getName(true); + attribs[Attributes::NAME]=tab_obj->getName(true); + attribs[Attributes::Comment]=QString(tab_obj->getComment()).replace(QString("'"), QString("''"));; schparser.ignoreUnkownAttributes(true); if(tab_obj->isSQLDisabled()) - attributes[ParsersAttributes::COLS_COMMENT]+=QString("-- "); + attributes[Attributes::ColsComment]+=QString("-- "); - attributes[ParsersAttributes::COLS_COMMENT]+=schparser.getCodeDefinition(ParsersAttributes::COMMENT, attribs, SchemaParser::SqlDefinition); + attributes[Attributes::ColsComment]+=schparser.getCodeDefinition(Attributes::Comment, attribs, SchemaParser::SqlDefinition); schparser.ignoreUnkownAttributes(false); } } @@ -184,14 +184,14 @@ void Table::setAncestorTableAttribute(void) for(i=0; i < count; i++) list.push_back(ancestor_tables[i]->getName(true)); - attributes[ParsersAttributes::AncestorTable]=list.join(','); + attributes[Attributes::AncestorTable]=list.join(','); } void Table::setRelObjectsIndexesAttribute(void) { attribs_map aux_attribs; vector *> obj_indexes={ &col_indexes, &constr_indexes }; - QString attribs[]={ ParsersAttributes::COL_INDEXES, ParsersAttributes::CONSTR_INDEXES }; + QString attribs[]={ Attributes::ColIndexes, Attributes::ConstrIndexes }; ObjectType obj_types[]={ ObjectType::Column, ObjectType::Constraint }; unsigned idx=0, size=obj_indexes.size(); @@ -203,13 +203,13 @@ void Table::setRelObjectsIndexesAttribute(void) { for(auto &obj_idx : (*obj_indexes[idx])) { - aux_attribs[ParsersAttributes::NAME]=obj_idx.first; - aux_attribs[ParsersAttributes::INDEX]=QString::number(obj_idx.second); - aux_attribs[ParsersAttributes::OBJECTS]+=schparser.getCodeDefinition(ParsersAttributes::OBJECT, aux_attribs, SchemaParser::XmlDefinition); + aux_attribs[Attributes::NAME]=obj_idx.first; + aux_attribs[Attributes::INDEX]=QString::number(obj_idx.second); + aux_attribs[Attributes::OBJECTS]+=schparser.getCodeDefinition(Attributes::OBJECT, aux_attribs, SchemaParser::XmlDefinition); } - aux_attribs[ParsersAttributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_types[idx]); - attributes[attribs[idx]]=schparser.getCodeDefinition(ParsersAttributes::CUSTOMIDXS, aux_attribs, SchemaParser::XmlDefinition); + aux_attribs[Attributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_types[idx]); + attributes[attribs[idx]]=schparser.getCodeDefinition(Attributes::CustomIdxs, aux_attribs, SchemaParser::XmlDefinition); aux_attribs.clear(); } } @@ -249,10 +249,10 @@ void Table::setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols) str_cols.remove(count-2,2); } - attributes[ParsersAttributes::INH_COLUMNS]=inh_cols; + attributes[Attributes::INH_COLUMNS]=inh_cols; } - attributes[ParsersAttributes::COLUMNS]=str_cols; + attributes[Attributes::Columns]=str_cols; } void Table::setConstraintsAttribute(unsigned def_type) @@ -322,11 +322,11 @@ void Table::setConstraintsAttribute(unsigned def_type) str_constr+=lines[i]; } - attributes[ParsersAttributes::CONSTR_SQL_DISABLED]=(dis_sql_cnt==lines.size() ? ParsersAttributes::True : QString()); + attributes[Attributes::ConstrSqlDisabled]=(dis_sql_cnt==lines.size() ? Attributes::True : QString()); } } - attributes[ParsersAttributes::CONSTRAINTS]=str_constr; + attributes[Attributes::Constraints]=str_constr; } vector *Table::getObjectList(ObjectType obj_type) @@ -1593,35 +1593,35 @@ void Table::updateAlterCmdsStatus(void) QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) { QStringList part_keys_code; - attributes[ParsersAttributes::OIDS]=(with_oid ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::UNLOGGED]=(unlogged ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::RLS_ENABLED]=(rls_enabled ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::RLS_FORCED]=(rls_forced ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::COPY_TABLE]=QString(); - attributes[ParsersAttributes::AncestorTable]=QString(); - attributes[ParsersAttributes::TAG]=QString(); - attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::PARTITIONING]=~partitioning_type; - attributes[ParsersAttributes::PARTITION_KEY]=QString(); - attributes[ParsersAttributes::PARTITION_BOUND_EXPR]=part_bounding_expr; + attributes[Attributes::OIDS]=(with_oid ? Attributes::True : QString()); + attributes[Attributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? Attributes::True : QString()); + attributes[Attributes::UNLOGGED]=(unlogged ? Attributes::True : QString()); + attributes[Attributes::RLS_ENABLED]=(rls_enabled ? Attributes::True : QString()); + attributes[Attributes::RLS_FORCED]=(rls_forced ? Attributes::True : QString()); + attributes[Attributes::CopyTable]=QString(); + attributes[Attributes::AncestorTable]=QString(); + attributes[Attributes::TAG]=QString(); + attributes[Attributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? Attributes::True : QString()); + attributes[Attributes::PARTITIONING]=~partitioning_type; + attributes[Attributes::PARTITION_KEY]=QString(); + attributes[Attributes::PARTITION_BOUND_EXPR]=part_bounding_expr; for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); if(def_type == SchemaParser::SqlDefinition) - attributes[ParsersAttributes::PARTITION_KEY]=part_keys_code.join(','); + attributes[Attributes::PARTITION_KEY]=part_keys_code.join(','); else - attributes[ParsersAttributes::PARTITION_KEY]=part_keys_code.join(' '); + attributes[Attributes::PARTITION_KEY]=part_keys_code.join(' '); if(def_type==SchemaParser::SqlDefinition && copy_table) - attributes[ParsersAttributes::COPY_TABLE]=copy_table->getName(true) + copy_op.getSQLDefinition(); + attributes[Attributes::CopyTable]=copy_table->getName(true) + copy_op.getSQLDefinition(); if(def_type==SchemaParser::SqlDefinition && partitioned_table) - attributes[ParsersAttributes::PARTITIONED_TABLE]=partitioned_table->getName(true); + attributes[Attributes::PARTITIONED_TABLE]=partitioned_table->getName(true); if(tag && def_type==SchemaParser::XmlDefinition) - attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); + attributes[Attributes::TAG]=tag->getCodeDefinition(def_type, true); (copy_table ? copy_table->getName(true) : QString()); @@ -1634,11 +1634,11 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) setRelObjectsIndexesAttribute(); setPositionAttribute(); setFadedOutAttribute(); - attributes[ParsersAttributes::INITIAL_DATA]=initial_data; - attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); + attributes[Attributes::INITIAL_DATA]=initial_data; + attributes[Attributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); } else - attributes[ParsersAttributes::INITIAL_DATA]=getInitialDataCommands(); + attributes[Attributes::INITIAL_DATA]=getInitialDataCommands(); return(BaseObject::__getCodeDefinition(def_type)); } @@ -1881,24 +1881,24 @@ QString Table::getAlterDefinition(BaseObject *object) QString alter_def; attribs_map attribs; - attribs[ParsersAttributes::OIDS]=QString(); - attribs[ParsersAttributes::AlterCmds]=BaseObject::getAlterDefinition(object, true); + attribs[Attributes::OIDS]=QString(); + attribs[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object, true); if(this->getName()==tab->getName()) { - attribs[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::True; + attribs[Attributes::HAS_CHANGES]=Attributes::True; if(this->with_oid!=tab->with_oid) - attribs[ParsersAttributes::OIDS]=(tab->with_oid ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[Attributes::OIDS]=(tab->with_oid ? Attributes::True : Attributes::UNSET); if(this->unlogged!=tab->unlogged) - attribs[ParsersAttributes::UNLOGGED]=(tab->unlogged ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[Attributes::UNLOGGED]=(tab->unlogged ? Attributes::True : Attributes::UNSET); if(this->rls_enabled!=tab->rls_enabled) - attribs[ParsersAttributes::RLS_ENABLED]=(tab->rls_enabled ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[Attributes::RLS_ENABLED]=(tab->rls_enabled ? Attributes::True : Attributes::UNSET); if(this->rls_forced!=tab->rls_forced) - attribs[ParsersAttributes::RLS_FORCED]=(tab->rls_forced ? ParsersAttributes::True : ParsersAttributes::UNSET); + attribs[Attributes::RLS_FORCED]=(tab->rls_forced ? Attributes::True : Attributes::UNSET); } copyAttributes(attribs); @@ -1917,8 +1917,8 @@ QString Table::getTruncateDefinition(bool cascade) try { BaseObject::setBasicAttributes(true); - attributes[ParsersAttributes::Cascade]=(cascade ? ParsersAttributes::True : QString()); - return(BaseObject::getAlterDefinition(ParsersAttributes::TRUNCATE_PRIV, attributes, false, false)); + attributes[Attributes::Cascade]=(cascade ? Attributes::True : QString()); + return(BaseObject::getAlterDefinition(Attributes::TRUNCATE_PRIV, attributes, false, false)); } catch(Exception &e) { @@ -2033,7 +2033,7 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi } fmt_cmd=insert_cmd.arg(getSignature()).arg(col_list.join(", ")) - .arg(val_list.join(", ")).arg(ParsersAttributes::DDL_END_TOKEN); + .arg(val_list.join(", ")).arg(Attributes::DDL_END_TOKEN); } return(fmt_cmd); diff --git a/libpgmodeler/src/tableobject.cpp b/libpgmodeler/src/tableobject.cpp index 315617ac1c..ccb0ed8f20 100644 --- a/libpgmodeler/src/tableobject.cpp +++ b/libpgmodeler/src/tableobject.cpp @@ -114,9 +114,9 @@ void TableObject::setCodeInvalidated(bool value) QString TableObject::getDropDefinition(bool cascade) { if(getParentTable()) - attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::TABLE]=getParentTable()->getName(true); - attributes[this->getSchemaName()]=ParsersAttributes::True; + attributes[this->getSchemaName()]=Attributes::True; return(BaseObject::getDropDefinition(cascade)); } diff --git a/libpgmodeler/src/tablespace.cpp b/libpgmodeler/src/tablespace.cpp index e91e637afc..ad35d72bce 100644 --- a/libpgmodeler/src/tablespace.cpp +++ b/libpgmodeler/src/tablespace.cpp @@ -23,7 +23,7 @@ unsigned Tablespace::tabspace_id=1000; Tablespace::Tablespace(void) { obj_type=ObjectType::Tablespace; - attributes[ParsersAttributes::DIRECTORY]=QString(); + attributes[Attributes::DIRECTORY]=QString(); object_id=Tablespace::tabspace_id++; } @@ -64,7 +64,7 @@ QString Tablespace::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); if(!directory.isEmpty()) - attributes[ParsersAttributes::DIRECTORY]=QString("'") + directory + QString("'"); + attributes[Attributes::DIRECTORY]=QString("'") + directory + QString("'"); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 87c2909469..2daa31a7a7 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -22,17 +22,17 @@ unsigned Tag::tag_id=3000; Tag::Tag(void) { - QStringList attribs={ ParsersAttributes::TABLE_NAME, ParsersAttributes::TABLE_SCHEMA_NAME, - ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, - ParsersAttributes::TABLE_EXT_BODY }; + QStringList attribs={ Attributes::TABLE_NAME, Attributes::TABLE_SCHEMA_NAME, + Attributes::TABLE_TITLE, Attributes::TABLE_BODY, + Attributes::TABLE_EXT_BODY }; obj_type=ObjectType::Tag; object_id=Tag::tag_id++; - attributes[ParsersAttributes::STYLES]=QString(); + attributes[Attributes::STYLES]=QString(); for(auto &attr : attribs) { - if(attr!=ParsersAttributes::TABLE_NAME && attr!=ParsersAttributes::TABLE_SCHEMA_NAME) + if(attr!=Attributes::TABLE_NAME && attr!=Attributes::TABLE_SCHEMA_NAME) color_config[attr] = { QColor(0,0,0), QColor(0,0,0), QColor(0,0,0) }; else color_config[attr] = { QColor(0,0,0) }; @@ -110,7 +110,7 @@ void Tag::validateElementId(const QString &id, unsigned color_id) ErrorCode::OprInvalidElementId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if((color_id > ColorCount) || (color_id > 0 && - (id==ParsersAttributes::TABLE_NAME || id==ParsersAttributes::TABLE_SCHEMA_NAME))) + (id==Attributes::TABLE_NAME || id==Attributes::TABLE_SCHEMA_NAME))) throw Exception(Exception::getErrorMessage(ErrorCode::RefInvalidElementColorId).arg(id).arg(color_id), ErrorCode::RefInvalidElementColorId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -154,16 +154,16 @@ QString Tag::getCodeDefinition(unsigned def_type, bool reduced_form) for(auto &itr : color_config) { - attribs[ParsersAttributes::ID]=itr.first; - attribs[ParsersAttributes::COLORS]=QString(); + attribs[Attributes::ID]=itr.first; + attribs[Attributes::Colors]=QString(); - if(itr.first==ParsersAttributes::TABLE_NAME || itr.first==ParsersAttributes::TABLE_SCHEMA_NAME) - attribs[ParsersAttributes::COLORS]=itr.second[FillColor1].name(); + if(itr.first==Attributes::TABLE_NAME || itr.first==Attributes::TABLE_SCHEMA_NAME) + attribs[Attributes::Colors]=itr.second[FillColor1].name(); else - attribs[ParsersAttributes::COLORS]=itr.second[FillColor1].name() + QString(",") + + attribs[Attributes::Colors]=itr.second[FillColor1].name() + QString(",") + itr.second[FillColor2].name() + QString(",") + itr.second[BorderColor].name(); - attributes[ParsersAttributes::STYLES]+=schparser.getCodeDefinition(ParsersAttributes::STYLE, attribs, SchemaParser::XmlDefinition); + attributes[Attributes::STYLES]+=schparser.getCodeDefinition(Attributes::STYLE, attribs, SchemaParser::XmlDefinition); } } catch(Exception &e) diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index bd54f0ce9b..3a8a76745a 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -23,11 +23,11 @@ Textbox::Textbox(void) obj_type=ObjectType::Textbox; font_size=9.0f; text_attributes[0]=text_attributes[1]=text_attributes[2]=false; - attributes[ParsersAttributes::ITALIC]=QString(); - attributes[ParsersAttributes::Bold]=QString(); - attributes[ParsersAttributes::UNDERLINE]=QString(); - attributes[ParsersAttributes::COLOR]=QString(); - attributes[ParsersAttributes::FONT_SIZE]=QString(); + attributes[Attributes::ITALIC]=QString(); + attributes[Attributes::Bold]=QString(); + attributes[Attributes::UNDERLINE]=QString(); + attributes[Attributes::Color]=QString(); + attributes[Attributes::FONT_SIZE]=QString(); } QString Textbox::getCodeDefinition(unsigned def_type) @@ -43,18 +43,18 @@ QString Textbox::getCodeDefinition(unsigned def_type) setFadedOutAttribute(); if(text_attributes[ItalicText]) - attributes[ParsersAttributes::ITALIC]=ParsersAttributes::True; + attributes[Attributes::ITALIC]=Attributes::True; if(text_attributes[BoldText]) - attributes[ParsersAttributes::Bold]=ParsersAttributes::True; + attributes[Attributes::Bold]=Attributes::True; if(text_attributes[UnderlineText]) - attributes[ParsersAttributes::UNDERLINE]=ParsersAttributes::True; + attributes[Attributes::UNDERLINE]=Attributes::True; if(text_color.name()!=QString("#000000")) - attributes[ParsersAttributes::COLOR]=text_color.name(); + attributes[Attributes::Color]=text_color.name(); - attributes[ParsersAttributes::FONT_SIZE]=QString("%1").arg(font_size); + attributes[Attributes::FONT_SIZE]=QString("%1").arg(font_size); return(this->BaseObject::__getCodeDefinition(SchemaParser::XmlDefinition)); } diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 4a9340d6d1..a593f484ac 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -32,25 +32,25 @@ Trigger::Trigger(void) for(i=0; i < 4; i++) events[tipos[i]]=false; - attributes[ParsersAttributes::Arguments]=QString(); - attributes[ParsersAttributes::EVENTS]=QString(); - attributes[ParsersAttributes::TRIGGER_FUNC]=QString(); - attributes[ParsersAttributes::TABLE]=QString(); - attributes[ParsersAttributes::COLUMNS]=QString(); - attributes[ParsersAttributes::FIRING_TYPE]=QString(); - attributes[ParsersAttributes::PER_ROW]=QString(); - attributes[ParsersAttributes::INS_EVENT]=QString(); - attributes[ParsersAttributes::DEL_EVENT]=QString(); - attributes[ParsersAttributes::UPD_EVENT]=QString(); - attributes[ParsersAttributes::TRUNC_EVENT]=QString(); - attributes[ParsersAttributes::CONDITION]=QString(); - attributes[ParsersAttributes::REF_TABLE]=QString(); - attributes[ParsersAttributes::DEFER_TYPE]=QString(); - attributes[ParsersAttributes::DEFERRABLE]=QString(); - attributes[ParsersAttributes::DECL_IN_TABLE]=QString(); - attributes[ParsersAttributes::CONSTRAINT]=QString(); - attributes[ParsersAttributes::OLD_TABLE_NAME]=QString(); - attributes[ParsersAttributes::NEW_TABLE_NAME]=QString(); + attributes[Attributes::Arguments]=QString(); + attributes[Attributes::EVENTS]=QString(); + attributes[Attributes::TRIGGER_FUNC]=QString(); + attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Columns]=QString(); + attributes[Attributes::FIRING_TYPE]=QString(); + attributes[Attributes::PER_ROW]=QString(); + attributes[Attributes::INS_EVENT]=QString(); + attributes[Attributes::DEL_EVENT]=QString(); + attributes[Attributes::UPD_EVENT]=QString(); + attributes[Attributes::TRUNC_EVENT]=QString(); + attributes[Attributes::Condition]=QString(); + attributes[Attributes::REF_TABLE]=QString(); + attributes[Attributes::DEFER_TYPE]=QString(); + attributes[Attributes::DEFERRABLE]=QString(); + attributes[Attributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::Constraint]=QString(); + attributes[Attributes::OLD_TABLE_NAME]=QString(); + attributes[Attributes::NEW_TABLE_NAME]=QString(); } void Trigger::addArgument(const QString &arg) @@ -74,7 +74,7 @@ void Trigger::setArgumentAttribute(unsigned def_type) if(i < (count-1)) str_args+=QString(","); } - attributes[ParsersAttributes::Arguments]=str_args; + attributes[Attributes::Arguments]=str_args; } void Trigger::setFiringType(FiringType firing_type) @@ -346,8 +346,8 @@ vector Trigger::getRelationshipAddedColumns(void) void Trigger::setBasicAttributes(unsigned def_type) { QString str_aux, - attribs[4]={ParsersAttributes::INS_EVENT, ParsersAttributes::DEL_EVENT, - ParsersAttributes::TRUNC_EVENT, ParsersAttributes::UPD_EVENT }, + attribs[4]={Attributes::INS_EVENT, Attributes::DEL_EVENT, + Attributes::TRUNC_EVENT, Attributes::UPD_EVENT }, sql_event[4]={"INSERT OR ", "DELETE OR ", "TRUNCATE OR ", "UPDATE "}; unsigned count, i, i1, event_types[4]={EventType::OnInsert, EventType::OnDelete, EventType::OnTruncate, EventType::OnUpdate}; @@ -360,18 +360,18 @@ void Trigger::setBasicAttributes(unsigned def_type) if(events.at(event_types[i])) { str_aux+=sql_event[i]; - attributes[attribs[i]]=ParsersAttributes::True; + attributes[attribs[i]]=Attributes::True; if(event_types[i]==EventType::OnUpdate) { count=upd_columns.size(); - attributes[ParsersAttributes::COLUMNS]=QString(); + attributes[Attributes::Columns]=QString(); for(i1=0; i1 < count; i1++) { - attributes[ParsersAttributes::COLUMNS]+=upd_columns.at(i1)->getName(true); + attributes[Attributes::Columns]+=upd_columns.at(i1)->getName(true); if(i1 < count-1) - attributes[ParsersAttributes::COLUMNS]+=QString(","); + attributes[Attributes::Columns]+=QString(","); } } } @@ -379,17 +379,17 @@ void Trigger::setBasicAttributes(unsigned def_type) if(!str_aux.isEmpty()) str_aux.remove(str_aux.size()-3,3); - if(def_type==SchemaParser::SqlDefinition && !attributes[ParsersAttributes::COLUMNS].isEmpty()) - str_aux+=QString(" OF ") + attributes[ParsersAttributes::COLUMNS]; + if(def_type==SchemaParser::SqlDefinition && !attributes[Attributes::Columns].isEmpty()) + str_aux+=QString(" OF ") + attributes[Attributes::Columns]; - attributes[ParsersAttributes::EVENTS]=str_aux; + attributes[Attributes::EVENTS]=str_aux; if(function) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::TRIGGER_FUNC]=function->getName(true); + attributes[Attributes::TRIGGER_FUNC]=function->getName(true); else - attributes[ParsersAttributes::TRIGGER_FUNC]=function->getCodeDefinition(def_type, true); + attributes[Attributes::TRIGGER_FUNC]=function->getCodeDefinition(def_type, true); } } @@ -403,34 +403,34 @@ QString Trigger::getCodeDefinition(unsigned def_type) /* Case the trigger doesn't referece some column added by relationship it will be declared inside the parent table construction by the use of 'decl-in-table' schema attribute */ if(!isReferRelationshipAddedColumn()) - attributes[ParsersAttributes::DECL_IN_TABLE]=ParsersAttributes::True; + attributes[Attributes::DECL_IN_TABLE]=Attributes::True; if(getParentTable()) - attributes[ParsersAttributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::TABLE]=getParentTable()->getName(true); - attributes[ParsersAttributes::CONSTRAINT]=(is_constraint ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::FIRING_TYPE]=(~firing_type); + attributes[Attributes::Constraint]=(is_constraint ? Attributes::True : QString()); + attributes[Attributes::FIRING_TYPE]=(~firing_type); //** Constraint trigger MUST execute per row ** - attributes[ParsersAttributes::PER_ROW]=((is_exec_per_row && !is_constraint) || is_constraint ? ParsersAttributes::True : QString()); + attributes[Attributes::PER_ROW]=((is_exec_per_row && !is_constraint) || is_constraint ? Attributes::True : QString()); - attributes[ParsersAttributes::CONDITION]=condition; + attributes[Attributes::Condition]=condition; if(referenced_table) - attributes[ParsersAttributes::REF_TABLE]=referenced_table->getName(true); + attributes[Attributes::REF_TABLE]=referenced_table->getName(true); - attributes[ParsersAttributes::DEFERRABLE]=(is_deferrable ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::DEFER_TYPE]=(~deferral_type); + attributes[Attributes::DEFERRABLE]=(is_deferrable ? Attributes::True : QString()); + attributes[Attributes::DEFER_TYPE]=(~deferral_type); if(def_type == SchemaParser::XmlDefinition) { - attributes[ParsersAttributes::OLD_TABLE_NAME]=transition_tabs_names[OldTableName]; - attributes[ParsersAttributes::NEW_TABLE_NAME]=transition_tabs_names[NewTableName]; + attributes[Attributes::OLD_TABLE_NAME]=transition_tabs_names[OldTableName]; + attributes[Attributes::NEW_TABLE_NAME]=transition_tabs_names[NewTableName]; } else { - attributes[ParsersAttributes::OLD_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[OldTableName]); - attributes[ParsersAttributes::NEW_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[NewTableName]); + attributes[Attributes::OLD_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[OldTableName]); + attributes[Attributes::NEW_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[NewTableName]); } return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 07ed7bf96c..0884974ce9 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -23,35 +23,35 @@ Type::Type(void) obj_type=ObjectType::Type; setConfiguration(EnumerationType); - attributes[ParsersAttributes::BaseType]=QString(); - attributes[ParsersAttributes::COMPOSITE_TYPE]=QString(); - attributes[ParsersAttributes::RANGE_TYPE]=QString(); - attributes[ParsersAttributes::TYPE_ATTRIBUTE]=QString(); - attributes[ParsersAttributes::ENUM_TYPE]=QString(); - attributes[ParsersAttributes::ENUMERATIONS]=QString(); - attributes[ParsersAttributes::INPUT_FUNC]=QString(); - attributes[ParsersAttributes::OUTPUT_FUNC]=QString(); - attributes[ParsersAttributes::RECV_FUNC]=QString(); - attributes[ParsersAttributes::SEND_FUNC]=QString(); - attributes[ParsersAttributes::TPMOD_IN_FUNC]=QString(); - attributes[ParsersAttributes::TPMOD_OUT_FUNC]=QString(); - attributes[ParsersAttributes::AnalyzeFunc]=QString(); - attributes[ParsersAttributes::INTERNAL_LENGTH]=QString(); - attributes[ParsersAttributes::ByValue]=QString(); - attributes[ParsersAttributes::Alignment]=QString(); - attributes[ParsersAttributes::STORAGE]=QString(); - attributes[ParsersAttributes::DEFAULT_VALUE]=QString(); - attributes[ParsersAttributes::ELEMENT]=QString(); - attributes[ParsersAttributes::DELIMITER]=QString(); - attributes[ParsersAttributes::REDUCED_FORM]=QString(); - attributes[ParsersAttributes::Category]=QString(); - attributes[ParsersAttributes::PREFERRED]=QString(); - attributes[ParsersAttributes::LIKE_TYPE]=QString(); - attributes[ParsersAttributes::COLLATABLE]=QString(); - attributes[ParsersAttributes::SUBTYPE]=QString(); - attributes[ParsersAttributes::SUBTYPE_DIFF_FUNC]=QString(); - attributes[ParsersAttributes::CanonicalFunc]=QString(); - attributes[ParsersAttributes::OP_CLASS]=QString(); + attributes[Attributes::BaseType]=QString(); + attributes[Attributes::CompositeType]=QString(); + attributes[Attributes::RANGE_TYPE]=QString(); + attributes[Attributes::TYPE_ATTRIBUTE]=QString(); + attributes[Attributes::ENUM_TYPE]=QString(); + attributes[Attributes::ENUMERATIONS]=QString(); + attributes[Attributes::INPUT_FUNC]=QString(); + attributes[Attributes::OUTPUT_FUNC]=QString(); + attributes[Attributes::RECV_FUNC]=QString(); + attributes[Attributes::SEND_FUNC]=QString(); + attributes[Attributes::TPMOD_IN_FUNC]=QString(); + attributes[Attributes::TPMOD_OUT_FUNC]=QString(); + attributes[Attributes::AnalyzeFunc]=QString(); + attributes[Attributes::INTERNAL_LENGTH]=QString(); + attributes[Attributes::ByValue]=QString(); + attributes[Attributes::Alignment]=QString(); + attributes[Attributes::STORAGE]=QString(); + attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::ELEMENT]=QString(); + attributes[Attributes::DELIMITER]=QString(); + attributes[Attributes::REDUCED_FORM]=QString(); + attributes[Attributes::Category]=QString(); + attributes[Attributes::PREFERRED]=QString(); + attributes[Attributes::LIKE_TYPE]=QString(); + attributes[Attributes::Collatable]=QString(); + attributes[Attributes::SUBTYPE]=QString(); + attributes[Attributes::SUBTYPE_DIFF_FUNC]=QString(); + attributes[Attributes::CanonicalFunc]=QString(); + attributes[Attributes::OP_CLASS]=QString(); } void Type::setName(const QString &name) @@ -429,7 +429,7 @@ void Type::setElementsAttribute(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) str_elem.remove(str_elem.lastIndexOf(','), str_elem.size()); - attributes[ParsersAttributes::TYPE_ATTRIBUTE]=str_elem; + attributes[Attributes::TYPE_ATTRIBUTE]=str_elem; } void Type::setEnumerationsAttribute(unsigned def_type) @@ -448,7 +448,7 @@ void Type::setEnumerationsAttribute(unsigned def_type) if(i < (count-1)) str_enum+=QString(","); } - attributes[ParsersAttributes::ENUMERATIONS]=str_enum; + attributes[Attributes::ENUMERATIONS]=str_enum; } void Type::setCategory(CategoryType categ) @@ -617,77 +617,77 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) if(config==EnumerationType) { - attributes[ParsersAttributes::ENUM_TYPE]=ParsersAttributes::True; + attributes[Attributes::ENUM_TYPE]=Attributes::True; setEnumerationsAttribute(def_type); } else if(config==CompositeType) { - attributes[ParsersAttributes::COMPOSITE_TYPE]=ParsersAttributes::True; + attributes[Attributes::CompositeType]=Attributes::True; setElementsAttribute(def_type); } else if(config==RangeType) { - attributes[ParsersAttributes::RANGE_TYPE]=ParsersAttributes::True; + attributes[Attributes::RANGE_TYPE]=Attributes::True; if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::SUBTYPE]=(*subtype); + attributes[Attributes::SUBTYPE]=(*subtype); else - attributes[ParsersAttributes::SUBTYPE]=subtype.getCodeDefinition(SchemaParser::XmlDefinition); + attributes[Attributes::SUBTYPE]=subtype.getCodeDefinition(SchemaParser::XmlDefinition); if(subtype_opclass) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::OP_CLASS]=subtype_opclass->getName(true); + attributes[Attributes::OP_CLASS]=subtype_opclass->getName(true); else - attributes[ParsersAttributes::OP_CLASS]=subtype_opclass->getCodeDefinition(def_type, true); + attributes[Attributes::OP_CLASS]=subtype_opclass->getCodeDefinition(def_type, true); } } else { - attributes[ParsersAttributes::BaseType]=ParsersAttributes::True; + attributes[Attributes::BaseType]=Attributes::True; if(internal_len==0 && def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::INTERNAL_LENGTH]=QString("VARIABLE"); + attributes[Attributes::INTERNAL_LENGTH]=QString("VARIABLE"); else - attributes[ParsersAttributes::INTERNAL_LENGTH]=QString("%1").arg(internal_len); + attributes[Attributes::INTERNAL_LENGTH]=QString("%1").arg(internal_len); - attributes[ParsersAttributes::ByValue]=(by_value ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::Alignment]=(*alignment); - attributes[ParsersAttributes::STORAGE]=(~storage); - attributes[ParsersAttributes::DEFAULT_VALUE]=default_value; + attributes[Attributes::ByValue]=(by_value ? Attributes::True : QString()); + attributes[Attributes::Alignment]=(*alignment); + attributes[Attributes::STORAGE]=(~storage); + attributes[Attributes::DEFAULT_VALUE]=default_value; if(element!=QString("\"any\"")) - attributes[ParsersAttributes::ELEMENT]=(*element); + attributes[Attributes::ELEMENT]=(*element); if(delimiter!='\0') - attributes[ParsersAttributes::DELIMITER]=delimiter; + attributes[Attributes::DELIMITER]=delimiter; - attributes[ParsersAttributes::Category]=~(category); + attributes[Attributes::Category]=~(category); - attributes[ParsersAttributes::PREFERRED]=(preferred ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::COLLATABLE]=(collatable ? ParsersAttributes::True : QString()); + attributes[Attributes::PREFERRED]=(preferred ? Attributes::True : QString()); + attributes[Attributes::Collatable]=(collatable ? Attributes::True : QString()); if(like_type!=QString("\"any\"")) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::LIKE_TYPE]=(*like_type); + attributes[Attributes::LIKE_TYPE]=(*like_type); else - attributes[ParsersAttributes::LIKE_TYPE]=like_type.getCodeDefinition(SchemaParser::XmlDefinition); + attributes[Attributes::LIKE_TYPE]=like_type.getCodeDefinition(SchemaParser::XmlDefinition); } } if(config==BaseType || config==RangeType) { unsigned i; - QString func_attrib[]={ParsersAttributes::INPUT_FUNC, - ParsersAttributes::OUTPUT_FUNC, - ParsersAttributes::RECV_FUNC, - ParsersAttributes::SEND_FUNC, - ParsersAttributes::TPMOD_IN_FUNC, - ParsersAttributes::TPMOD_OUT_FUNC, - ParsersAttributes::AnalyzeFunc, - ParsersAttributes::CanonicalFunc, - ParsersAttributes::SUBTYPE_DIFF_FUNC}; + QString func_attrib[]={Attributes::INPUT_FUNC, + Attributes::OUTPUT_FUNC, + Attributes::RECV_FUNC, + Attributes::SEND_FUNC, + Attributes::TPMOD_IN_FUNC, + Attributes::TPMOD_OUT_FUNC, + Attributes::AnalyzeFunc, + Attributes::CanonicalFunc, + Attributes::SUBTYPE_DIFF_FUNC}; for(i=0; i < sizeof(functions)/sizeof(Function *); i++) { @@ -697,7 +697,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[func_attrib[i]]=functions[i]->getName(); else { - functions[i]->setAttribute(ParsersAttributes::REF_TYPE, func_attrib[i]); + functions[i]->setAttribute(Attributes::REF_TYPE, func_attrib[i]); attributes[func_attrib[i]]=functions[i]->getCodeDefinition(def_type, true); } } @@ -730,15 +730,15 @@ QString Type::getAlterDefinition(BaseObject *object) { if(std::find(this->enumerations.begin(), this->enumerations.end(), enum_val)==this->enumerations.end()) { - attribs[ParsersAttributes::Before]=QString(); + attribs[Attributes::Before]=QString(); if(prev_val.isEmpty()) { - attribs[ParsersAttributes::Before]=ParsersAttributes::True; + attribs[Attributes::Before]=Attributes::True; prev_val=this->enumerations[0]; } - attribs[ParsersAttributes::VALUE]=enum_val; - attribs[ParsersAttributes::EXISTING_VALUE]=prev_val; + attribs[Attributes::VALUE]=enum_val; + attribs[Attributes::EXISTING_VALUE]=prev_val; copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); attribs.clear(); @@ -754,12 +754,12 @@ QString Type::getAlterDefinition(BaseObject *object) { if(type->getAttributeIndex(attrib.getName()) < 0) { - attribs[ParsersAttributes::DROP]=ParsersAttributes::True; - attribs[ParsersAttributes::Attribute]=attrib.getName(true); + attribs[Attributes::DROP]=Attributes::True; + attribs[Attributes::Attribute]=attrib.getName(true); copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); attribs.clear(); - attributes[ParsersAttributes::DROP]=QString(); + attributes[Attributes::DROP]=QString(); } } @@ -770,12 +770,12 @@ QString Type::getAlterDefinition(BaseObject *object) //Creating type attributes if(attrib_idx < 0) { - attribs[ParsersAttributes::Attribute]=attrib.getName(true); - attribs[ParsersAttributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); - attribs[ParsersAttributes::COLLATION]=QString(); + attribs[Attributes::Attribute]=attrib.getName(true); + attribs[Attributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); + attribs[Attributes::Collation]=QString(); if(attrib.getCollation()) - attribs[ParsersAttributes::COLLATION]=attrib.getCollation()->getName(true); + attribs[Attributes::Collation]=attrib.getCollation()->getName(true); copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); @@ -783,17 +783,17 @@ QString Type::getAlterDefinition(BaseObject *object) //Changing type attributes else { - attribs[ParsersAttributes::Change]=ParsersAttributes::True; + attribs[Attributes::Change]=Attributes::True; if(!type_attribs[attrib_idx].getType().isEquivalentTo(attrib.getType())) { - attribs[ParsersAttributes::Attribute]=attrib.getName(true); - attribs[ParsersAttributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); + attribs[Attributes::Attribute]=attrib.getName(true); + attribs[Attributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); } copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); - attributes[ParsersAttributes::Change]=QString(); + attributes[Attributes::Change]=QString(); } attribs.clear(); diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index 57d90b1e71..eda7505cd4 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -40,18 +40,18 @@ QString TypeAttribute::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::NAME]=BaseObject::formatName(obj_name); + attributes[Attributes::NAME]=BaseObject::formatName(obj_name); else - attributes[ParsersAttributes::NAME]=obj_name; + attributes[Attributes::NAME]=obj_name; - attributes[ParsersAttributes::TYPE]=type.getCodeDefinition(def_type); + attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); if(collation) { if(def_type==SchemaParser::SqlDefinition) - attributes[ParsersAttributes::COLLATION]=collation->getName(true); + attributes[Attributes::Collation]=collation->getName(true); else - attributes[ParsersAttributes::COLLATION]=collation->getCodeDefinition(def_type, true); + attributes[Attributes::Collation]=collation->getCodeDefinition(def_type, true); } return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 2db9adaefd..8f38809676 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -22,17 +22,17 @@ View::View(void) : BaseTable() { obj_type=ObjectType::View; materialized=recursive=with_no_data=false; - attributes[ParsersAttributes::DEFINITION]=QString(); - attributes[ParsersAttributes::REFERENCES]=QString(); - attributes[ParsersAttributes::SELECT_EXP]=QString(); - attributes[ParsersAttributes::FROM_EXP]=QString(); - attributes[ParsersAttributes::SIMPLE_EXP]=QString(); - attributes[ParsersAttributes::END_EXP]=QString(); - attributes[ParsersAttributes::CTE_EXPRESSION]=QString(); - attributes[ParsersAttributes::MATERIALIZED]=QString(); - attributes[ParsersAttributes::RECURSIVE]=QString(); - attributes[ParsersAttributes::WITH_NO_DATA]=QString(); - attributes[ParsersAttributes::COLUMNS]=QString(); + attributes[Attributes::DEFINITION]=QString(); + attributes[Attributes::REFERENCES]=QString(); + attributes[Attributes::SELECT_EXP]=QString(); + attributes[Attributes::FROM_EXP]=QString(); + attributes[Attributes::SIMPLE_EXP]=QString(); + attributes[Attributes::END_EXP]=QString(); + attributes[Attributes::CteExpression]=QString(); + attributes[Attributes::MATERIALIZED]=QString(); + attributes[Attributes::RECURSIVE]=QString(); + attributes[Attributes::WITH_NO_DATA]=QString(); + attributes[Attributes::Columns]=QString(); } View::~View(void) @@ -474,23 +474,23 @@ void View::setDefinitionAttribute(void) if(!decl.endsWith(QChar(';'))) decl.append(QChar(';')); - attributes[ParsersAttributes::DEFINITION]=decl; + attributes[Attributes::DEFINITION]=decl; } void View::setReferencesAttribute(void) { QString str_aux; - QString attribs[]={ ParsersAttributes::SELECT_EXP, - ParsersAttributes::FROM_EXP, - ParsersAttributes::SIMPLE_EXP, - ParsersAttributes::END_EXP}; + QString attribs[]={ Attributes::SELECT_EXP, + Attributes::FROM_EXP, + Attributes::SIMPLE_EXP, + Attributes::END_EXP}; vector *vect_exp[]={&exp_select, &exp_from, &exp_where, &exp_end}; int cnt, i, i1; cnt=references.size(); for(i=0; i < cnt; i++) str_aux+=references[i].getXMLDefinition(); - attributes[ParsersAttributes::REFERENCES]=str_aux; + attributes[Attributes::REFERENCES]=str_aux; for(i=0; i < 4; i++) { @@ -573,21 +573,21 @@ QString View::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[ParsersAttributes::CTE_EXPRESSION]=cte_expression; - attributes[ParsersAttributes::MATERIALIZED]=(materialized ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::RECURSIVE]=(recursive ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::WITH_NO_DATA]=(with_no_data ? ParsersAttributes::True : QString()); - attributes[ParsersAttributes::COLUMNS]=QString(); - attributes[ParsersAttributes::TAG]=QString(); - attributes[ParsersAttributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? ParsersAttributes::True : QString()); + attributes[Attributes::CteExpression]=cte_expression; + attributes[Attributes::MATERIALIZED]=(materialized ? Attributes::True : QString()); + attributes[Attributes::RECURSIVE]=(recursive ? Attributes::True : QString()); + attributes[Attributes::WITH_NO_DATA]=(with_no_data ? Attributes::True : QString()); + attributes[Attributes::Columns]=QString(); + attributes[Attributes::TAG]=QString(); + attributes[Attributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? Attributes::True : QString()); setSQLObjectAttribute(); if(recursive) - attributes[ParsersAttributes::COLUMNS]=getColumnsList().join(','); + attributes[Attributes::Columns]=getColumnsList().join(','); if(tag && def_type==SchemaParser::XmlDefinition) - attributes[ParsersAttributes::TAG]=tag->getCodeDefinition(def_type, true); + attributes[Attributes::TAG]=tag->getCodeDefinition(def_type, true); if(def_type==SchemaParser::SqlDefinition) setDefinitionAttribute(); @@ -596,7 +596,7 @@ QString View::getCodeDefinition(unsigned def_type) setPositionAttribute(); setFadedOutAttribute(); setReferencesAttribute(); - attributes[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); + attributes[Attributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); } return(BaseObject::__getCodeDefinition(def_type)); @@ -605,7 +605,7 @@ QString View::getCodeDefinition(unsigned def_type) void View::setSQLObjectAttribute(void) { if(materialized) - attributes[ParsersAttributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::View); + attributes[Attributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::View); } void View::setObjectListsCapacity(unsigned capacity) diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 1a81a1856f..a001fd1e1b 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -25,19 +25,19 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid setupUi(this); QString conf_ids[]={ - ParsersAttributes::GLOBAL, //0 - ParsersAttributes::CONSTRAINTS, //1 - ParsersAttributes::OBJ_SELECTION, //2 - ParsersAttributes::POSITION_INFO, //3 - ParsersAttributes::POSITION_INFO, //4 - ParsersAttributes::OBJECT_TYPE, //5 - ParsersAttributes::LOCKER_ARC, //6 - ParsersAttributes::LOCKER_BODY, //7 - ParsersAttributes::TABLE_SCHEMA_NAME, //8 - ParsersAttributes::TABLE_NAME, //9 - ParsersAttributes::TABLE_BODY, //10 - ParsersAttributes::TABLE_EXT_BODY, //11 - ParsersAttributes::TABLE_TITLE, //12 + Attributes::GLOBAL, //0 + Attributes::Constraints, //1 + Attributes::OBJ_SELECTION, //2 + Attributes::POSITION_INFO, //3 + Attributes::POSITION_INFO, //4 + Attributes::OBJECT_TYPE, //5 + Attributes::LOCKER_ARC, //6 + Attributes::LOCKER_BODY, //7 + Attributes::TABLE_SCHEMA_NAME, //8 + Attributes::TABLE_NAME, //9 + Attributes::TABLE_BODY, //10 + Attributes::TABLE_EXT_BODY, //11 + Attributes::TABLE_TITLE, //12 BaseObject::getSchemaName(ObjectType::Rule), //13 BaseObject::getSchemaName(ObjectType::Rule), //14 BaseObject::getSchemaName(ObjectType::Index), //15 @@ -48,36 +48,36 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid BaseObject::getSchemaName(ObjectType::Constraint), //20 BaseObject::getSchemaName(ObjectType::Policy), //21 BaseObject::getSchemaName(ObjectType::Policy), //22 - ParsersAttributes::VIEW_SCHEMA_NAME, //21 -> 23 - ParsersAttributes::VIEW_NAME, //22 - ParsersAttributes::VIEW_BODY, //23 - ParsersAttributes::VIEW_EXT_BODY, //24 - ParsersAttributes::VIEW_TITLE, //25 - ParsersAttributes::Alias, //26 - ParsersAttributes::REF_COLUMN, //27 - ParsersAttributes::REF_TABLE, //28 - ParsersAttributes::REFERENCE, //29 + Attributes::VIEW_SCHEMA_NAME, //21 -> 23 + Attributes::VIEW_NAME, //22 + Attributes::VIEW_BODY, //23 + Attributes::VIEW_EXT_BODY, //24 + Attributes::VIEW_TITLE, //25 + Attributes::Alias, //26 + Attributes::REF_COLUMN, //27 + Attributes::REF_TABLE, //28 + Attributes::REFERENCE, //29 BaseObject::getSchemaName(ObjectType::Textbox), //30 - ParsersAttributes::COLUMN, //31 - ParsersAttributes::COLUMN, //32 - ParsersAttributes::INH_COLUMN, //33 - ParsersAttributes::PROT_COLUMN, //34 - ParsersAttributes::PK_COLUMN, //35 - ParsersAttributes::PK_COLUMN, //36 - ParsersAttributes::FK_COLUMN, //37 - ParsersAttributes::FK_COLUMN, //38 - ParsersAttributes::UQ_COLUMN, //39 - ParsersAttributes::UQ_COLUMN, //40 - ParsersAttributes::NN_COLUMN, //41 - ParsersAttributes::NN_COLUMN, //42 - ParsersAttributes::RELATIONSHIP, //43 - ParsersAttributes::LABEL, //44 - ParsersAttributes::LABEL, //45 - ParsersAttributes::Attribute, //46 - ParsersAttributes::Attribute, //47 - ParsersAttributes::TAG, //48 - ParsersAttributes::TAG, //49 - ParsersAttributes::PLACEHOLDER /*50*/}; + Attributes::Column, //31 + Attributes::Column, //32 + Attributes::INH_COLUMN, //33 + Attributes::PROT_COLUMN, //34 + Attributes::PK_COLUMN, //35 + Attributes::PK_COLUMN, //36 + Attributes::FK_COLUMN, //37 + Attributes::FK_COLUMN, //38 + Attributes::UQ_COLUMN, //39 + Attributes::UQ_COLUMN, //40 + Attributes::NN_COLUMN, //41 + Attributes::NN_COLUMN, //42 + Attributes::RELATIONSHIP, //43 + Attributes::LABEL, //44 + Attributes::LABEL, //45 + Attributes::Attribute, //46 + Attributes::Attribute, //47 + Attributes::TAG, //48 + Attributes::TAG, //49 + Attributes::PLACEHOLDER /*50*/}; int i, count=element_cmb->count(), //This auxiliary vector stores the id of elements that represents color/font conf. of objects obj_conf_ids_vect[]={ 2, 4, 6, 7, 10, 11, 12, 14, 16, 18, 20, 22, 25, 26, 27, @@ -211,8 +211,8 @@ void AppearanceConfigWidget::loadExampleModel(void) void AppearanceConfigWidget::updatePlaceholderItem(void) { - placeholder->setBrush(BaseObjectView::getFillStyle(ParsersAttributes::PLACEHOLDER)); - QPen pen=BaseObjectView::getBorderStyle(ParsersAttributes::PLACEHOLDER); + placeholder->setBrush(BaseObjectView::getFillStyle(Attributes::PLACEHOLDER)); + QPen pen=BaseObjectView::getBorderStyle(Attributes::PLACEHOLDER); pen.setStyle(Qt::DashLine); placeholder->setPen(pen); } @@ -238,7 +238,7 @@ void AppearanceConfigWidget::loadConfiguration(void) } this->enableConfigElement(); - font_cmb->setCurrentFont(BaseObjectView::getFontStyle(ParsersAttributes::GLOBAL).font()); + font_cmb->setCurrentFont(BaseObjectView::getFontStyle(Attributes::GLOBAL).font()); model->setObjectsModified(); updatePlaceholderItem(); scene->update(); @@ -282,7 +282,7 @@ void AppearanceConfigWidget::saveConfiguration(void) attribs[attrib_id]=item.colors[2].name(); } //If the item is a font config - else if(item.conf_id!=ParsersAttributes::GLOBAL && !item.obj_conf) + else if(item.conf_id!=Attributes::GLOBAL && !item.obj_conf) { font=item.font_fmt.font(); @@ -290,14 +290,14 @@ void AppearanceConfigWidget::saveConfiguration(void) attrib_id=item.conf_id + QString("-fcolor"); attribs[attrib_id]=item.font_fmt.foreground().color().name(); - attrib_id=item.conf_id + QString("-") + ParsersAttributes::ITALIC; - attribs[attrib_id]=(font.italic() ? ParsersAttributes::True : ParsersAttributes::False); + attrib_id=item.conf_id + QString("-") + Attributes::ITALIC; + attribs[attrib_id]=(font.italic() ? Attributes::True : Attributes::False); - attrib_id=item.conf_id + QString("-") + ParsersAttributes::Bold; - attribs[attrib_id]=(font.bold() ? ParsersAttributes::True : ParsersAttributes::False); + attrib_id=item.conf_id + QString("-") + Attributes::Bold; + attribs[attrib_id]=(font.bold() ? Attributes::True : Attributes::False); - attrib_id=item.conf_id + QString("-") + ParsersAttributes::UNDERLINE; - attribs[attrib_id]=(font.underline() ? ParsersAttributes::True : ParsersAttributes::False); + attrib_id=item.conf_id + QString("-") + Attributes::UNDERLINE; + attribs[attrib_id]=(font.underline() ? Attributes::True : Attributes::False); } //Special case: treating the global font element else diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index 5815dbd55f..c6ac1f43c2 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -227,7 +227,7 @@ void BaseConfigWidget::getConfigurationParams(map &config_ { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); - aux_attribs[ParsersAttributes::CONTENTS]=xmlparser.getElementContent(); + aux_attribs[Attributes::Contents]=xmlparser.getElementContent(); xmlparser.restorePosition(); } diff --git a/libpgmodeler_ui/src/baseconfigwidget.h b/libpgmodeler_ui/src/baseconfigwidget.h index a7cb87e899..36f8ddbc51 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.h +++ b/libpgmodeler_ui/src/baseconfigwidget.h @@ -29,7 +29,7 @@ #include "exception.h" #include "xmlparser.h" -#include "parsersattributes.h" +#include "attributes.h" #include #include diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 451ce89191..cf2c5acfca 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -202,7 +202,7 @@ void CodeCompletionWidget::configureCompletion(DatabaseModel *db_model, SyntaxHi auto_triggered=false; this->db_model=db_model; - if(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeCompletion]==ParsersAttributes::True) + if(confs[Attributes::Configuration][Attributes::CodeCompletion]==Attributes::True) { code_field_txt->installEventFilter(this); name_list->installEventFilter(this); @@ -226,8 +226,8 @@ void CodeCompletionWidget::configureCompletion(DatabaseModel *db_model, SyntaxHi if(enable_snippets) { clearCustomItems(); - insertCustomItems(SnippetsConfigWidget::getAllSnippetsAttribute(ParsersAttributes::ID), - SnippetsConfigWidget::getAllSnippetsAttribute(ParsersAttributes::LABEL), + insertCustomItems(SnippetsConfigWidget::getAllSnippetsAttribute(Attributes::ID), + SnippetsConfigWidget::getAllSnippetsAttribute(Attributes::LABEL), QPixmap(PgModelerUiNs::getIconPath("codesnippet"))); } } diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index edd9b0a371..94aa83ece9 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -111,7 +111,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) Connection *conn=nullptr; destroyConnections(); - key_attribs.push_back(ParsersAttributes::Alias); + key_attribs.push_back(Attributes::Alias); BaseConfigWidget::loadConfiguration(GlobalAttributes::ConnectionsConf, config_params, key_attribs); /*try @@ -134,13 +134,13 @@ void ConnectionsConfigWidget::loadConfiguration(void) { conn=new Connection; - conn->setConnectionParam(Connection::ParamAlias, itr->second[ParsersAttributes::Alias]); + conn->setConnectionParam(Connection::ParamAlias, itr->second[Attributes::Alias]); conn->setConnectionParam(Connection::ParamServerFqdn, itr->second[Connection::ParamServerFqdn]); conn->setConnectionParam(Connection::ParamPort, itr->second[Connection::ParamPort]); conn->setConnectionParam(Connection::ParamUser, itr->second[Connection::ParamUser]); conn->setConnectionParam(Connection::ParamPassword,itr->second[Connection::ParamPassword]); conn->setConnectionParam(Connection::ParamDbName, itr->second[Connection::ParamDbName]); - conn->setConnectionParam(Connection::ParamConnTimeout, itr->second[ParsersAttributes::CONNECTION_TIMEOUT]); + conn->setConnectionParam(Connection::ParamConnTimeout, itr->second[Attributes::ConnectionTimeout]); conn->setConnectionParam(Connection::ParamSslMode, itr->second[Connection::ParamSslMode]); conn->setConnectionParam(Connection::ParamSslRootCert, itr->second[Connection::ParamSslRootCert]); conn->setConnectionParam(Connection::ParamSslCert, itr->second[Connection::ParamSslCert]); @@ -150,11 +150,11 @@ void ConnectionsConfigWidget::loadConfiguration(void) conn->setConnectionParam(Connection::ParamKerberosServer, itr->second[Connection::ParamKerberosServer]); conn->setConnectionParam(Connection::ParamOthers, itr->second[Connection::ParamOthers]); - conn->setAutoBrowseDB(itr->second[ParsersAttributes::AutoBrowseDb]==ParsersAttributes::True); - conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(ParsersAttributes::DIFF)]==ParsersAttributes::True); - conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(ParsersAttributes::EXPORT)]==ParsersAttributes::True); - conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(ParsersAttributes::IMPORT)]==ParsersAttributes::True); - conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(ParsersAttributes::VALIDATION)]==ParsersAttributes::True); + conn->setAutoBrowseDB(itr->second[Attributes::AutoBrowseDb]==Attributes::True); + conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(Attributes::DIFF)]==Attributes::True); + conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(Attributes::EXPORT)]==Attributes::True); + conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(Attributes::IMPORT)]==Attributes::True); + conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(Attributes::VALIDATION)]==Attributes::True); connections.push_back(conn); itr++; @@ -494,7 +494,7 @@ void ConnectionsConfigWidget::saveConfiguration(void) /* Workaround: When there is no connection, to prevent saving an empty file, is necessary to fill the attribute CONNECTIONS with white spaces */ if(connections.empty()) - config_params[GlobalAttributes::ConnectionsConf][ParsersAttributes::CONNECTIONS]=QString(" "); + config_params[GlobalAttributes::ConnectionsConf][Attributes::Connections]=QString(" "); else { for(Connection *conn : connections) @@ -504,17 +504,17 @@ void ConnectionsConfigWidget::saveConfiguration(void) if(attribs[Connection::ParamServerFqdn].isEmpty()) attribs[Connection::ParamServerFqdn]=attribs[Connection::ParamServerIp]; - attribs[ParsersAttributes::Alias]=attribs[Connection::ParamAlias]; - attribs[ParsersAttributes::AutoBrowseDb]=(conn->isAutoBrowseDB() ? ParsersAttributes::True : QString()); - attribs[ParsersAttributes::CONNECTION_TIMEOUT]=attribs[Connection::ParamConnTimeout]; + attribs[Attributes::Alias]=attribs[Connection::ParamAlias]; + attribs[Attributes::AutoBrowseDb]=(conn->isAutoBrowseDB() ? Attributes::True : QString()); + attribs[Attributes::ConnectionTimeout]=attribs[Connection::ParamConnTimeout]; - attribs[DefaultFor.arg(ParsersAttributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? ParsersAttributes::True : QString()); - attribs[DefaultFor.arg(ParsersAttributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? ParsersAttributes::True : QString()); - attribs[DefaultFor.arg(ParsersAttributes::DIFF)]=(conn->isDefaultForOperation(Connection::OpDiff) ? ParsersAttributes::True : QString()); - attribs[DefaultFor.arg(ParsersAttributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? ParsersAttributes::True : QString()); + attribs[DefaultFor.arg(Attributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? Attributes::True : QString()); + attribs[DefaultFor.arg(Attributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? Attributes::True : QString()); + attribs[DefaultFor.arg(Attributes::DIFF)]=(conn->isDefaultForOperation(Connection::OpDiff) ? Attributes::True : QString()); + attribs[DefaultFor.arg(Attributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? Attributes::True : QString()); schparser.ignoreUnkownAttributes(true); - config_params[GlobalAttributes::ConnectionsConf][ParsersAttributes::CONNECTIONS]+= + config_params[GlobalAttributes::ConnectionsConf][Attributes::Connections]+= schparser.getCodeDefinition(GlobalAttributes::TmplConfigurationDir + GlobalAttributes::DirSeparator + GlobalAttributes::SchemasDir + diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index c8d4eeb6ab..47a30d8e3b 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -25,81 +25,112 @@ #include "pgmodeleruins.h" #include "generalconfigwidget.h" -using namespace ParsersAttributes; - const QString DatabaseExplorerWidget::DepNotDefined=QString(); const QString DatabaseExplorerWidget::DepNotFound=QT_TR_NOOP("(not found, OID: %1)"); const QString DatabaseExplorerWidget::ElemSeparator=QString("•"); const QString DatabaseExplorerWidget::DefaultSourceCode=QT_TR_NOOP("-- Source code not generated! Hit F7 or middle-click the item to load it. --"); const attribs_map DatabaseExplorerWidget::attribs_i18n { - {AdminRoles, QT_TR_NOOP("Admin. roles")}, {Alignment, QT_TR_NOOP("Alignment")}, {AnalyzeFunc, QT_TR_NOOP("Analyze func.")}, - {ArgCount, QT_TR_NOOP("Arg. count")}, {ArgDefCount, QT_TR_NOOP("Arg. default count")}, {ArgDefaults, QT_TR_NOOP("Arg. defaults")}, - {ArgModes, QT_TR_NOOP("Arg. modes")}, {ArgNames, QT_TR_NOOP("Arg. names")}, {ArgTypes, QT_TR_NOOP("Arg. types")}, - {Attribute, QT_TR_NOOP("Attribute")}, {ParsersAttributes::BehaviorType, QT_TR_NOOP("Behavior type")}, {ByValue, QT_TR_NOOP("By value")}, - {CastType, QT_TR_NOOP("Cast type")}, {Category, QT_TR_NOOP("Category")}, {COLLATABLE, QT_TR_NOOP("Collatable")}, - {COLLATION, QT_TR_NOOP("Collation")}, {COMMENT, QT_TR_NOOP("Comment")}, {COMMUTATOR_OP, QT_TR_NOOP("Commutator Op.")}, - {CONFIGURATION, QT_TR_NOOP("Configuration")}, {CONN_LIMIT, QT_TR_NOOP("Conn. limit")}, {CONSTRAINT, QT_TR_NOOP("Constraint")}, - {CREATEDB, QT_TR_NOOP("Create DB")}, {CREATEROLE, QT_TR_NOOP("Create role")}, {CUR_VERSION, QT_TR_NOOP("Curr. version")}, - {DEFAULT, QT_TR_NOOP("Default")}, {DEFAULT_VALUE, QT_TR_NOOP("Default value")}, {DEFINITION, QT_TR_NOOP("Definition")}, - {DELIMITER, QT_TR_NOOP("Delimiter")}, {DEST_TYPE, QT_TR_NOOP("Dest. type")}, {DIMENSION, QT_TR_NOOP("Dimension")}, - {DIRECTORY, QT_TR_NOOP("Directory")}, {DST_ENCODING, QT_TR_NOOP("Dest. encoding")}, {ELEMENT, QT_TR_NOOP("Element")}, - {ENCODING, QT_TR_NOOP("Encoding")}, {ENCRYPTED, QT_TR_NOOP("Encrypted")}, {ENUMERATIONS, QT_TR_NOOP("Enumerations")}, - {EXECUTION_COST, QT_TR_NOOP("Exec. cost")}, {EXPRESSION, QT_TR_NOOP("Expression")}, {FAMILY, QT_TR_NOOP("Op. family")}, - {FINAL_FUNC, QT_TR_NOOP("Final func.")}, {FUNCTION, QT_TR_NOOP("Function")}, {FUNCTION_TYPE, QT_TR_NOOP("Func. type")}, - {HANDLER_FUNC, QT_TR_NOOP("Handler func.")}, {HANDLES_TYPE, QT_TR_NOOP("Handles type")}, {HASHES, QT_TR_NOOP("Hashes")}, - {INDEX_TYPE, QT_TR_NOOP("Index type")}, {INHERIT, QT_TR_NOOP("Inherit")}, {INITIAL_COND, QT_TR_NOOP("Ini. condition")}, - {INLINE_FUNC, QT_TR_NOOP("Inline func.")}, {INPUT_FUNC, QT_TR_NOOP("Input func.")}, {INTERNAL_LENGTH, QT_TR_NOOP("Internal length")}, - {INTERVAL_TYPE, QT_TR_NOOP("Interval type")}, {IO_CAST, QT_TR_NOOP("I/O cast")}, {JOIN_FUNC, QT_TR_NOOP("Join func.")}, - {LANGUAGE, QT_TR_NOOP("Language")}, {LcCollate, QT_TR_NOOP("LC COLLATE")}, {LcCtype, QT_TR_NOOP("LC CTYPE")}, - {LEAKPROOF, QT_TR_NOOP("Leak proof")}, {LEFT_TYPE, QT_TR_NOOP("Left type")}, {LENGTH, QT_TR_NOOP("Length")}, - {LIBRARY, QT_TR_NOOP("Library")}, {LOGIN, QT_TR_NOOP("Can login")}, {MATERIALIZED, QT_TR_NOOP("Materialized")}, - {MEMBER_ROLES, QT_TR_NOOP("Member roles")}, {MERGES, QT_TR_NOOP("Merges")}, {NAME, QT_TR_NOOP("Name")}, - {NEGATOR_OP, QT_TR_NOOP("Negator op.")}, {NOT_NULL, QT_TR_NOOP("Not null")}, {OBJECT_TYPE, QT_TR_NOOP("Object type")}, - {OID, QT_TR_NOOP("OID")}, {OIDS, QT_TR_NOOP("With OIDs")}, {OLD_VERSION, QT_TR_NOOP("Old version")}, - {OPERATOR, QT_TR_NOOP("Operator")}, {OPERATOR_FUNC, QT_TR_NOOP("Operator func.")}, {OUTPUT_FUNC, QT_TR_NOOP("Output func.")}, - {OWNER, QT_TR_NOOP("Owner")}, {OWNER_COLUMN, QT_TR_NOOP("Owner column")}, {PARENTS, QT_TR_NOOP("Parents")}, - {PASSWORD, QT_TR_NOOP("Password")}, {PERMISSION, QT_TR_NOOP("Permissions")}, {PRECISION, QT_TR_NOOP("Precision")}, - {PREFERRED, QT_TR_NOOP("Preferred")}, {RANGE_ATTRIBS, QT_TR_NOOP("Range attributes")}, {RECV_FUNC, QT_TR_NOOP("Receive func.")}, - {REF_ROLES, QT_TR_NOOP("Ref. roles")}, {REPLICATION, QT_TR_NOOP("Replication")}, {RESTRICTION_FUNC, QT_TR_NOOP("Restriction func.")}, - {RETURN_TYPE, QT_TR_NOOP("Return type")}, {RETURNS_SETOF, QT_TR_NOOP("Returns SETOF")}, {RIGHT_TYPE, QT_TR_NOOP("Right type")}, - {ROW_AMOUNT, QT_TR_NOOP("Rows amount")}, {SCHEMA, QT_TR_NOOP("Schema")}, {SECURITY_TYPE, QT_TR_NOOP("Security type")}, - {SEND_FUNC, QT_TR_NOOP("Send func.")}, {SORT_OP, QT_TR_NOOP("Sort op.")}, {SOURCE_TYPE, QT_TR_NOOP("Source type")}, - {SRC_ENCODING, QT_TR_NOOP("Src. encoding")}, {STATE_TYPE, QT_TR_NOOP("State type")}, {STORAGE, QT_TR_NOOP("Storage")}, - {SUPERUSER, QT_TR_NOOP("Superuser")}, {TABLESPACE, QT_TR_NOOP("Tablespace")}, {TPMOD_IN_FUNC, QT_TR_NOOP("Type mod. in func.")}, - {TPMOD_OUT_FUNC, QT_TR_NOOP("Type mod. out func.")}, {TRANSITION_FUNC, QT_TR_NOOP("Transition func.")}, {TRUSTED, QT_TR_NOOP("Trusted")}, - {TYPE, QT_TR_NOOP("Type")}, {TYPE_ATTRIBUTE, QT_TR_NOOP("Type attribute")}, {TYPES, QT_TR_NOOP("Types")}, - {UNLOGGED, QT_TR_NOOP("Unlogged")}, {VALIDATOR, QT_TR_NOOP("Validator func.")}, {VALIDITY, QT_TR_NOOP("Validity")}, - {WINDOW_FUNC, QT_TR_NOOP("Windows func.")}, {False, QT_TR_NOOP("false")}, {True, QT_TR_NOOP("true")}, - {Cache, QT_TR_NOOP("Cache value")}, {CYCLE, QT_TR_NOOP("Cycle")}, {INCREMENT, QT_TR_NOOP("Increment")}, - {MAX_VALUE, QT_TR_NOOP("Max. value")}, {MIN_VALUE, QT_TR_NOOP("Min. value")}, {START, QT_TR_NOOP("Start value")}, - {LAST_VALUE, QT_TR_NOOP("Last value")}, {SUBTYPE, QT_TR_NOOP("Subtype")}, {OP_CLASS, QT_TR_NOOP("Op. class")}, - {CanonicalFunc, QT_TR_NOOP("Canonical func.")}, {SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {CONSTRAINT, QT_TR_NOOP("Constraint")}, - {DEFERRABLE, QT_TR_NOOP("Deferrable")}, {PER_ROW, QT_TR_NOOP("For each row")}, {FIRING_TYPE, QT_TR_NOOP("Firing")}, - {INS_EVENT, QT_TR_NOOP("On insert")}, {DEL_EVENT, QT_TR_NOOP("On delete")}, {UPD_EVENT, QT_TR_NOOP("On update")}, - {TRUNC_EVENT, QT_TR_NOOP("On truncate")}, {Arguments, QT_TR_NOOP("Arguments")}, {TABLE, QT_TR_NOOP("Table")}, - {TRIGGER_FUNC, QT_TR_NOOP("Trigger func.")}, {COLUMNS, QT_TR_NOOP("Columns")}, {CONDITION, QT_TR_NOOP("Condition")}, - {DEFER_TYPE, QT_TR_NOOP("Deferment")}, {EVENT_TYPE, QT_TR_NOOP("Event")}, {EXEC_TYPE, QT_TR_NOOP("Execution mode")}, - {COMMANDS, QT_TR_NOOP("Commands")}, {POSITION, QT_TR_NOOP("Position")}, {COMPARISON_TYPE, QT_TR_NOOP("Comparison type")}, - {DEL_ACTION, QT_TR_NOOP("On delete")}, {DST_COLUMNS, QT_TR_NOOP("Ref. columns")}, {EXPRESSIONS, QT_TR_NOOP("Expressions")}, - {FACTOR, QT_TR_NOOP("Fill factor")}, {NO_INHERIT, QT_TR_NOOP("No inherit")}, {OP_CLASSES, QT_TR_NOOP("Op. classes")}, - {OPERATORS, QT_TR_NOOP("Operators")}, {REF_TABLE, QT_TR_NOOP("Ref. table")}, {COLUMNS, QT_TR_NOOP("Columns")}, - {UPD_ACTION, QT_TR_NOOP("On update")}, {SRC_COLUMNS, QT_TR_NOOP("Columns")}, {UNIQUE, QT_TR_NOOP("Unique")}, - {PREDICATE, QT_TR_NOOP("Predicate")}, {COLLATIONS, QT_TR_NOOP("Collations")}, {INHERITED, QT_TR_NOOP("Inherited")}, - {ClientEncoding, QT_TR_NOOP("Client encoding")}, {CONFIG_FILE, QT_TR_NOOP("Configuration file")}, {DATA_DIRECTORY, QT_TR_NOOP("Data directory")}, - {DYNAMIC_LIBRARY_PATH, QT_TR_NOOP("Dynamic library path")}, {DYNAMIC_SHARED_MEMORY, QT_TR_NOOP("Dynamic shared memory")}, {HBA_FILE, QT_TR_NOOP("Hba file")}, - {LISTEN_ADDRESSES, QT_TR_NOOP("Listen addresses")}, {MAX_CONNECTIONS, QT_TR_NOOP("Max. connections")}, {PORT, QT_TR_NOOP("Listen port")}, - {SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, {SSL, QT_TR_NOOP("SSL")}, {SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, - {SSL_CERT_FILE, QT_TR_NOOP("SSL cert file")}, {SSL_CRL_FILE, QT_TR_NOOP("SSL crl file")}, {SSL_KEY_FILE, QT_TR_NOOP("SSL key file")}, - {SERVER_VERSION, QT_TR_NOOP("Server version")}, {IDENT_FILE, QT_TR_NOOP("Ident file")}, {PASSWORD_ENCRYPTION, QT_TR_NOOP("Password encryption")}, - {CONNECTION, QT_TR_NOOP("Connection ID")}, {SERVER_PID, QT_TR_NOOP("Server PID")}, {SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, - {REFERRERS, QT_TR_NOOP("Referrers")}, {IDENTITY_TYPE, QT_TR_NOOP("Identity")}, {COMMAND, QT_TR_NOOP("Command")}, - {USING_EXP, QT_TR_NOOP("USING expr.")}, {CheckExp, QT_TR_NOOP("CHECK expr.")}, {ROLES, QT_TR_NOOP("Roles")}, - {RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {RLS_FORCED, QT_TR_NOOP("RLS forced")}, {LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, - {LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, - {TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, {TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {IS_PARTITIONED, QT_TR_NOOP("Partitioned")}, - {PARTITIONED_TABLE, QT_TR_NOOP("Partition of")}, {PARTITION_BOUND_EXPR, QT_TR_NOOP("Partition bound expr.")}, {DEAD_ROWS_AMOUNT, QT_TR_NOOP("Dead rows amount")}, - {PARTITION_KEY, QT_TR_NOOP("Partition keys")}, {PARTITIONING, QT_TR_NOOP("Partitioning")} + {Attributes::AdminRoles, QT_TR_NOOP("Admin. roles")}, {Attributes::Alignment, QT_TR_NOOP("Alignment")}, + {Attributes::AnalyzeFunc, QT_TR_NOOP("Analyze func.")}, {Attributes::ArgCount, QT_TR_NOOP("Arg. count")}, + {Attributes::ArgDefCount, QT_TR_NOOP("Arg. default count")}, {Attributes::ArgDefaults, QT_TR_NOOP("Arg. defaults")}, + {Attributes::ArgModes, QT_TR_NOOP("Arg. modes")}, {Attributes::ArgNames, QT_TR_NOOP("Arg. names")}, + {Attributes::ArgTypes, QT_TR_NOOP("Arg. types")}, {Attributes::Attribute, QT_TR_NOOP("Attribute")}, + {Attributes::BehaviorType, QT_TR_NOOP("Behavior type")}, {Attributes::ByValue, QT_TR_NOOP("By value")}, + {Attributes::CastType, QT_TR_NOOP("Cast type")}, {Attributes::Category, QT_TR_NOOP("Category")}, + {Attributes::Collatable, QT_TR_NOOP("Collatable")}, {Attributes::Collation, QT_TR_NOOP("Collation")}, + {Attributes::Comment, QT_TR_NOOP("Comment")}, {Attributes::CommutatorOp, QT_TR_NOOP("Commutator Op.")}, + {Attributes::Configuration, QT_TR_NOOP("Configuration")}, {Attributes::ConnLimit, QT_TR_NOOP("Conn. limit")}, + {Attributes::Constraint, QT_TR_NOOP("Constraint")}, {Attributes::CreateDb, QT_TR_NOOP("Create DB")}, + {Attributes::CreateRole, QT_TR_NOOP("Create role")}, {Attributes::CurVersion, QT_TR_NOOP("Curr. version")}, + {Attributes::DEFAULT, QT_TR_NOOP("Default")}, {Attributes::DEFAULT_VALUE, QT_TR_NOOP("Default value")}, + {Attributes::DEFINITION, QT_TR_NOOP("Definition")}, {Attributes::DELIMITER, QT_TR_NOOP("Delimiter")}, + {Attributes::DEST_TYPE, QT_TR_NOOP("Dest. type")}, {Attributes::DIMENSION, QT_TR_NOOP("Dimension")}, + {Attributes::DIRECTORY, QT_TR_NOOP("Directory")}, {Attributes::DST_ENCODING, QT_TR_NOOP("Dest. encoding")}, + {Attributes::ELEMENT, QT_TR_NOOP("Element")}, {Attributes::ENCODING, QT_TR_NOOP("Encoding")}, + {Attributes::ENCRYPTED, QT_TR_NOOP("Encrypted")}, {Attributes::ENUMERATIONS, QT_TR_NOOP("Enumerations")}, + {Attributes::EXECUTION_COST, QT_TR_NOOP("Exec. cost")}, {Attributes::EXPRESSION, QT_TR_NOOP("Expression")}, + {Attributes::FAMILY, QT_TR_NOOP("Op. family")}, {Attributes::FINAL_FUNC, QT_TR_NOOP("Final func.")}, + {Attributes::FUNCTION, QT_TR_NOOP("Function")}, {Attributes::FUNCTION_TYPE, QT_TR_NOOP("Func. type")}, + {Attributes::HANDLER_FUNC, QT_TR_NOOP("Handler func.")}, {Attributes::HANDLES_TYPE, QT_TR_NOOP("Handles type")}, + {Attributes::HASHES, QT_TR_NOOP("Hashes")}, {Attributes::INDEX_TYPE, QT_TR_NOOP("Index type")}, + {Attributes::INHERIT, QT_TR_NOOP("Inherit")}, {Attributes::INITIAL_COND, QT_TR_NOOP("Ini. condition")}, + {Attributes::INLINE_FUNC, QT_TR_NOOP("Inline func.")}, {Attributes::INPUT_FUNC, QT_TR_NOOP("Input func.")}, + {Attributes::INTERNAL_LENGTH, QT_TR_NOOP("Internal length")}, {Attributes::INTERVAL_TYPE, QT_TR_NOOP("Interval type")}, + {Attributes::IO_CAST, QT_TR_NOOP("I/O cast")}, {Attributes::JOIN_FUNC, QT_TR_NOOP("Join func.")}, + {Attributes::LANGUAGE, QT_TR_NOOP("Language")}, {Attributes::LcCollate, QT_TR_NOOP("LC COLLATE")}, + {Attributes::LcCtype, QT_TR_NOOP("LC CTYPE")}, {Attributes::LEAKPROOF, QT_TR_NOOP("Leak proof")}, + {Attributes::LEFT_TYPE, QT_TR_NOOP("Left type")}, {Attributes::LENGTH, QT_TR_NOOP("Length")}, + {Attributes::LIBRARY, QT_TR_NOOP("Library")}, {Attributes::LOGIN, QT_TR_NOOP("Can login")}, + {Attributes::MATERIALIZED, QT_TR_NOOP("Materialized")}, {Attributes::MEMBER_ROLES, QT_TR_NOOP("Member roles")}, + {Attributes::MERGES, QT_TR_NOOP("Merges")}, {Attributes::NAME, QT_TR_NOOP("Name")}, + {Attributes::NEGATOR_OP, QT_TR_NOOP("Negator op.")}, {Attributes::NOT_NULL, QT_TR_NOOP("Not null")}, + {Attributes::OBJECT_TYPE, QT_TR_NOOP("Object type")}, {Attributes::OID, QT_TR_NOOP("OID")}, + {Attributes::OIDS, QT_TR_NOOP("With OIDs")}, {Attributes::OLD_VERSION, QT_TR_NOOP("Old version")}, + {Attributes::OPERATOR, QT_TR_NOOP("Operator")}, {Attributes::OPERATOR_FUNC, QT_TR_NOOP("Operator func.")}, + {Attributes::OUTPUT_FUNC, QT_TR_NOOP("Output func.")}, {Attributes::OWNER, QT_TR_NOOP("Owner")}, + {Attributes::OWNER_COLUMN, QT_TR_NOOP("Owner column")}, {Attributes::PARENTS, QT_TR_NOOP("Parents")}, + {Attributes::PASSWORD, QT_TR_NOOP("Password")}, {Attributes::PERMISSION, QT_TR_NOOP("Permissions")}, + {Attributes::PRECISION, QT_TR_NOOP("Precision")}, {Attributes::PREFERRED, QT_TR_NOOP("Preferred")}, + {Attributes::RANGE_ATTRIBS, QT_TR_NOOP("Range attributes")}, {Attributes::RECV_FUNC, QT_TR_NOOP("Receive func.")}, + {Attributes::REF_ROLES, QT_TR_NOOP("Ref. roles")}, {Attributes::REPLICATION, QT_TR_NOOP("Replication")}, + {Attributes::RESTRICTION_FUNC, QT_TR_NOOP("Restriction func.")}, {Attributes::RETURN_TYPE, QT_TR_NOOP("Return type")}, + {Attributes::RETURNS_SETOF, QT_TR_NOOP("Returns SETOF")}, {Attributes::RIGHT_TYPE, QT_TR_NOOP("Right type")}, + {Attributes::ROW_AMOUNT, QT_TR_NOOP("Rows amount")}, {Attributes::SCHEMA, QT_TR_NOOP("Schema")}, + {Attributes::SECURITY_TYPE, QT_TR_NOOP("Security type")}, {Attributes::SEND_FUNC, QT_TR_NOOP("Send func.")}, + {Attributes::SORT_OP, QT_TR_NOOP("Sort op.")}, {Attributes::SOURCE_TYPE, QT_TR_NOOP("Source type")}, + {Attributes::SRC_ENCODING, QT_TR_NOOP("Src. encoding")}, {Attributes::STATE_TYPE, QT_TR_NOOP("State type")}, + {Attributes::STORAGE, QT_TR_NOOP("Storage")}, {Attributes::SUPERUSER, QT_TR_NOOP("Superuser")}, + {Attributes::TABLESPACE, QT_TR_NOOP("Tablespace")}, {Attributes::TPMOD_IN_FUNC, QT_TR_NOOP("Type mod. in func.")}, + {Attributes::TPMOD_OUT_FUNC, QT_TR_NOOP("Type mod. out func.")}, {Attributes::TRANSITION_FUNC, QT_TR_NOOP("Transition func.")}, + {Attributes::TRUSTED, QT_TR_NOOP("Trusted")}, {Attributes::TYPE, QT_TR_NOOP("Type")}, + {Attributes::TYPE_ATTRIBUTE, QT_TR_NOOP("Type attribute")}, {Attributes::TYPES, QT_TR_NOOP("Types")}, + {Attributes::UNLOGGED, QT_TR_NOOP("Unlogged")}, {Attributes::VALIDATOR, QT_TR_NOOP("Validator func.")}, + {Attributes::VALIDITY, QT_TR_NOOP("Validity")}, {Attributes::WINDOW_FUNC, QT_TR_NOOP("Windows func.")}, + {Attributes::False, QT_TR_NOOP("false")}, {Attributes::True, QT_TR_NOOP("true")}, + {Attributes::Cache, QT_TR_NOOP("Cache value")}, {Attributes::Cycle, QT_TR_NOOP("Cycle")}, + {Attributes::INCREMENT, QT_TR_NOOP("Increment")}, {Attributes::MAX_VALUE, QT_TR_NOOP("Max. value")}, + {Attributes::MIN_VALUE, QT_TR_NOOP("Min. value")}, {Attributes::START, QT_TR_NOOP("Start value")}, + {Attributes::LAST_VALUE, QT_TR_NOOP("Last value")}, {Attributes::SUBTYPE, QT_TR_NOOP("Subtype")}, + {Attributes::OP_CLASS, QT_TR_NOOP("Op. class")}, {Attributes::CanonicalFunc, QT_TR_NOOP("Canonical func.")}, + {Attributes::SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {Attributes::DEFERRABLE, QT_TR_NOOP("Deferrable")}, + {Attributes::PER_ROW, QT_TR_NOOP("For each row")}, {Attributes::FIRING_TYPE, QT_TR_NOOP("Firing")}, + {Attributes::INS_EVENT, QT_TR_NOOP("On insert")}, {Attributes::DEL_EVENT, QT_TR_NOOP("On delete")}, + {Attributes::UPD_EVENT, QT_TR_NOOP("On update")}, {Attributes::TRUNC_EVENT, QT_TR_NOOP("On truncate")}, + {Attributes::Arguments, QT_TR_NOOP("Arguments")}, {Attributes::TABLE, QT_TR_NOOP("Table")}, + {Attributes::TRIGGER_FUNC, QT_TR_NOOP("Trigger func.")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, + {Attributes::Condition, QT_TR_NOOP("Condition")}, {Attributes::DEFER_TYPE, QT_TR_NOOP("Deferment")}, + {Attributes::EVENT_TYPE, QT_TR_NOOP("Event")}, {Attributes::EXEC_TYPE, QT_TR_NOOP("Execution mode")}, + {Attributes::Commands, QT_TR_NOOP("Commands")}, {Attributes::POSITION, QT_TR_NOOP("Position")}, + {Attributes::ComparisonType, QT_TR_NOOP("Comparison type")}, {Attributes::DEL_ACTION, QT_TR_NOOP("On delete")}, + {Attributes::DST_COLUMNS, QT_TR_NOOP("Ref. columns")}, {Attributes::EXPRESSIONS, QT_TR_NOOP("Expressions")}, + {Attributes::FACTOR, QT_TR_NOOP("Fill factor")}, {Attributes::NO_INHERIT, QT_TR_NOOP("No inherit")}, + {Attributes::OP_CLASSES, QT_TR_NOOP("Op. classes")}, {Attributes::OPERATORS, QT_TR_NOOP("Operators")}, + {Attributes::REF_TABLE, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, + {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SRC_COLUMNS, QT_TR_NOOP("Columns")}, + {Attributes::UNIQUE, QT_TR_NOOP("Unique")}, {Attributes::PREDICATE, QT_TR_NOOP("Predicate")}, + {Attributes::Collations, QT_TR_NOOP("Collations")}, {Attributes::INHERITED, QT_TR_NOOP("Inherited")}, + {Attributes::ClientEncoding, QT_TR_NOOP("Client encoding")}, {Attributes::ConfigFile, QT_TR_NOOP("Configuration file")}, + {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DYNAMIC_LIBRARY_PATH, QT_TR_NOOP("Dynamic library path")}, + {Attributes::DYNAMIC_SHARED_MEMORY, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HBA_FILE, QT_TR_NOOP("Hba file")}, + {Attributes::LISTEN_ADDRESSES, QT_TR_NOOP("Listen addresses")}, {Attributes::MAX_CONNECTIONS, QT_TR_NOOP("Max. connections")}, + {Attributes::PORT, QT_TR_NOOP("Listen port")}, {Attributes::SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, + {Attributes::SSL, QT_TR_NOOP("SSL")}, {Attributes::SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, + {Attributes::SSL_CERT_FILE, QT_TR_NOOP("SSL cert file")}, {Attributes::SSL_CRL_FILE, QT_TR_NOOP("SSL crl file")}, + {Attributes::SSL_KEY_FILE, QT_TR_NOOP("SSL key file")}, {Attributes::SERVER_VERSION, QT_TR_NOOP("Server version")}, + {Attributes::IDENT_FILE, QT_TR_NOOP("Ident file")}, {Attributes::PASSWORD_ENCRYPTION, QT_TR_NOOP("Password encryption")}, + {Attributes::Connection, QT_TR_NOOP("Connection ID")}, {Attributes::SERVER_PID, QT_TR_NOOP("Server PID")}, + {Attributes::SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {Attributes::REFERRERS, QT_TR_NOOP("Referrers")}, + {Attributes::IDENTITY_TYPE, QT_TR_NOOP("Identity")}, {Attributes::Command, QT_TR_NOOP("Command")}, + {Attributes::USING_EXP, QT_TR_NOOP("USING expr.")}, {Attributes::CheckExp, QT_TR_NOOP("CHECK expr.")}, + {Attributes::ROLES, QT_TR_NOOP("Roles")}, {Attributes::RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, + {Attributes::RLS_FORCED, QT_TR_NOOP("RLS forced")}, {Attributes::LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, + {Attributes::LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {Attributes::LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, + {Attributes::TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {Attributes::TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, + {Attributes::TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {Attributes::IS_PARTITIONED, QT_TR_NOOP("Partitioned")}, + {Attributes::PARTITIONED_TABLE, QT_TR_NOOP("Partition of")}, {Attributes::PARTITION_BOUND_EXPR, QT_TR_NOOP("Partition bound expr.")}, + {Attributes::DEAD_ROWS_AMOUNT, QT_TR_NOOP("Dead rows amount")}, {Attributes::PARTITION_KEY, QT_TR_NOOP("Partition keys")}, + {Attributes::PARTITIONING, QT_TR_NOOP("Partitioning")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) @@ -278,14 +309,14 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) attribs_map fmt_attribs; QString attr_name, attr_value; QRegExp oid_regexp=QRegExp(QString("^[0-9]+")); - map dep_types={{ParsersAttributes::OWNER, ObjectType::Role}, - {ParsersAttributes::SCHEMA, ObjectType::Schema}, - {ParsersAttributes::TABLESPACE, ObjectType::Tablespace}, - {ParsersAttributes::COLLATION, ObjectType::Collation}, - {ParsersAttributes::TABLE, ObjectType::Table}}; + map dep_types={{Attributes::OWNER, ObjectType::Role}, + {Attributes::SCHEMA, ObjectType::Schema}, + {Attributes::TABLESPACE, ObjectType::Tablespace}, + {Attributes::Collation, ObjectType::Collation}, + {Attributes::TABLE, ObjectType::Table}}; - if(attribs.count(ParsersAttributes::OBJECT_TYPE)!=0) - obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); + if(attribs.count(Attributes::OBJECT_TYPE)!=0) + obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); try { @@ -322,21 +353,21 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) } - if(attribs.count(ParsersAttributes::PERMISSION)!=0) - attribs[ParsersAttributes::PERMISSION]=Catalog::parseArrayValues(attribs[ParsersAttributes::PERMISSION]).join(ElemSeparator); + if(attribs.count(Attributes::PERMISSION)!=0) + attribs[Attributes::PERMISSION]=Catalog::parseArrayValues(attribs[Attributes::PERMISSION]).join(ElemSeparator); //Removing system schemas from object's name - if(attribs.count(ParsersAttributes::NAME)!=0 && - (attribs[ParsersAttributes::NAME].startsWith(QString("pg_catalog.")) || - attribs[ParsersAttributes::NAME].startsWith(QString("information_schema.")))) - attribs[ParsersAttributes::NAME]=attribs[ParsersAttributes::NAME].split('.').at(1); + if(attribs.count(Attributes::NAME)!=0 && + (attribs[Attributes::NAME].startsWith(QString("pg_catalog.")) || + attribs[Attributes::NAME].startsWith(QString("information_schema.")))) + attribs[Attributes::NAME]=attribs[Attributes::NAME].split('.').at(1); for(auto &attrib : attribs) { attr_name=attrib.first; attr_value=attrib.second; - if(attr_name==ParsersAttributes::OBJECT_TYPE) + if(attr_name==Attributes::OBJECT_TYPE) attr_value=BaseObject::getTypeName(static_cast(attr_value.toUInt())); //If the current attribute is related to a dependency object, retreive its real name @@ -352,18 +383,18 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) fmt_attribs[attr_name]=attr_value; } - if(attribs[ParsersAttributes::OID].toUInt() > 0) + if(attribs[Attributes::OID].toUInt() > 0) { - attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); - attribs[ParsersAttributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_type); + attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); + attribs[Attributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_type); - if(attribs.count(ParsersAttributes::SIGNATURE)==0) - attribs[ParsersAttributes::SIGNATURE]=BaseObject::formatName(attribs[ParsersAttributes::NAME]); + if(attribs.count(Attributes::SIGNATURE)==0) + attribs[Attributes::SIGNATURE]=BaseObject::formatName(attribs[Attributes::NAME]); - if(attribs.count(ParsersAttributes::SCHEMA)!=0) - attribs[ParsersAttributes::SIGNATURE]=QString("%1.%2") - .arg(BaseObject::formatName(attribs[ParsersAttributes::SCHEMA])) - .arg(attribs[ParsersAttributes::SIGNATURE]); + if(attribs.count(Attributes::SCHEMA)!=0) + attribs[Attributes::SIGNATURE]=QString("%1.%2") + .arg(BaseObject::formatName(attribs[Attributes::SCHEMA])) + .arg(attribs[Attributes::SIGNATURE]); } return(fmt_attribs); @@ -373,8 +404,8 @@ void DatabaseExplorerWidget::formatBooleanAttribs(attribs_map &attribs, QStringL { for(QString attr : bool_attrs) attribs[attr]=(attribs[attr].isEmpty() ? - attribs_i18n.at(ParsersAttributes::False) : - attribs_i18n.at(ParsersAttributes::True)); + attribs_i18n.at(Attributes::False) : + attribs_i18n.at(Attributes::True)); } void DatabaseExplorerWidget::formatOidAttribs(attribs_map &attribs, QStringList oid_attrs, ObjectType obj_type, bool is_oid_array) @@ -405,162 +436,162 @@ void DatabaseExplorerWidget::formatOidAttribs(attribs_map &attribs, QStringList void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::IO_CAST }); + formatBooleanAttribs(attribs, { Attributes::IO_CAST }); - formatOidAttribs(attribs, { ParsersAttributes::DEST_TYPE, - ParsersAttributes::SOURCE_TYPE }, ObjectType::Type, false); + formatOidAttribs(attribs, { Attributes::DEST_TYPE, + Attributes::SOURCE_TYPE }, ObjectType::Type, false); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::FUNCTION]); + attribs[Attributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[Attributes::FUNCTION]); } void DatabaseExplorerWidget::formatEventTriggerAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::VALUES]=Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES]).join(ElemSeparator); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::FUNCTION]); + attribs[Attributes::VALUES]=Catalog::parseArrayValues(attribs[Attributes::VALUES]).join(ElemSeparator); + attribs[Attributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[Attributes::FUNCTION]); } void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) { - formatOidAttribs(attribs, { ParsersAttributes::FINAL_FUNC, - ParsersAttributes::TRANSITION_FUNC }, ObjectType::Function, false); + formatOidAttribs(attribs, { Attributes::FINAL_FUNC, + Attributes::TRANSITION_FUNC }, ObjectType::Function, false); - formatOidAttribs(attribs, { ParsersAttributes::TYPES }, ObjectType::Type, true); - attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") - .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) - .arg(attribs[ParsersAttributes::TYPES])).replace(ElemSeparator, QString(",")); + formatOidAttribs(attribs, { Attributes::TYPES }, ObjectType::Type, true); + attribs[Attributes::SIGNATURE]=(QString("%1(%2)") + .arg(BaseObject::formatName(attribs[Attributes::NAME])) + .arg(attribs[Attributes::TYPES])).replace(ElemSeparator, QString(",")); - attribs[ParsersAttributes::STATE_TYPE]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::STATE_TYPE]); - attribs[ParsersAttributes::SORT_OP]=getObjectName(ObjectType::Operator, attribs[ParsersAttributes::SORT_OP]); - attribs[ParsersAttributes::INITIAL_COND]=Catalog::parseArrayValues(attribs[ParsersAttributes::INITIAL_COND]).join(ElemSeparator); + attribs[Attributes::STATE_TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::STATE_TYPE]); + attribs[Attributes::SORT_OP]=getObjectName(ObjectType::Operator, attribs[Attributes::SORT_OP]); + attribs[Attributes::INITIAL_COND]=Catalog::parseArrayValues(attribs[Attributes::INITIAL_COND]).join(ElemSeparator); } void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::TRUSTED }); + formatBooleanAttribs(attribs, { Attributes::TRUSTED }); - formatOidAttribs(attribs, { ParsersAttributes::VALIDATOR_FUNC, - ParsersAttributes::HANDLER_FUNC, - ParsersAttributes::INLINE_FUNC }, ObjectType::Function, false); + formatOidAttribs(attribs, { Attributes::VALIDATOR_FUNC, + Attributes::HANDLER_FUNC, + Attributes::INLINE_FUNC }, ObjectType::Function, false); } void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) { - formatOidAttribs(attribs, { ParsersAttributes::AdminRoles, - ParsersAttributes::MEMBER_ROLES, - ParsersAttributes::REF_ROLES }, ObjectType::Role, true); - - formatBooleanAttribs(attribs, { ParsersAttributes::SUPERUSER, ParsersAttributes::INHERIT, - ParsersAttributes::CREATEROLE, ParsersAttributes::CREATEDB, - ParsersAttributes::LOGIN, ParsersAttributes::ENCRYPTED, - ParsersAttributes::REPLICATION }); + formatOidAttribs(attribs, { Attributes::AdminRoles, + Attributes::MEMBER_ROLES, + Attributes::REF_ROLES }, ObjectType::Role, true); + + formatBooleanAttribs(attribs, { Attributes::SUPERUSER, Attributes::INHERIT, + Attributes::CreateRole, Attributes::CreateDb, + Attributes::LOGIN, Attributes::ENCRYPTED, + Attributes::REPLICATION }); } void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::DEFAULT }); - attribs[ParsersAttributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::FUNCTION]); + formatBooleanAttribs(attribs, { Attributes::DEFAULT }); + attribs[Attributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[Attributes::FUNCTION]); } void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::NOT_NULL }); - attribs[ParsersAttributes::TYPE]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::TYPE]); + formatBooleanAttribs(attribs, { Attributes::NOT_NULL }); + attribs[Attributes::TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::TYPE]); } void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::HANDLES_TYPE }); + formatBooleanAttribs(attribs, { Attributes::HANDLES_TYPE }); } void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::LANGUAGE]=getObjectName(ObjectType::Language, attribs[ParsersAttributes::LANGUAGE]); - attribs[ParsersAttributes::RETURN_TYPE]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::RETURN_TYPE]); - attribs[ParsersAttributes::ArgNames]=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgNames]).join(ElemSeparator); - attribs[ParsersAttributes::ArgModes]=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgModes]).join(ElemSeparator); - attribs[ParsersAttributes::ArgDefaults]=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgDefaults]).join(ElemSeparator); - - formatOidAttribs(attribs, { ParsersAttributes::ArgTypes }, ObjectType::Type, true); - attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2)") - .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])) - .arg(attribs[ParsersAttributes::ArgTypes])).replace(ElemSeparator, QString(",")); - - formatBooleanAttribs(attribs, { ParsersAttributes::WINDOW_FUNC, - ParsersAttributes::LEAKPROOF, - ParsersAttributes::RETURNS_SETOF }); + attribs[Attributes::LANGUAGE]=getObjectName(ObjectType::Language, attribs[Attributes::LANGUAGE]); + attribs[Attributes::RETURN_TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::RETURN_TYPE]); + attribs[Attributes::ArgNames]=Catalog::parseArrayValues(attribs[Attributes::ArgNames]).join(ElemSeparator); + attribs[Attributes::ArgModes]=Catalog::parseArrayValues(attribs[Attributes::ArgModes]).join(ElemSeparator); + attribs[Attributes::ArgDefaults]=Catalog::parseArrayValues(attribs[Attributes::ArgDefaults]).join(ElemSeparator); + + formatOidAttribs(attribs, { Attributes::ArgTypes }, ObjectType::Type, true); + attribs[Attributes::SIGNATURE]=(QString("%1(%2)") + .arg(BaseObject::formatName(attribs[Attributes::NAME])) + .arg(attribs[Attributes::ArgTypes])).replace(ElemSeparator, QString(",")); + + formatBooleanAttribs(attribs, { Attributes::WINDOW_FUNC, + Attributes::LEAKPROOF, + Attributes::RETURNS_SETOF }); } void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::HASHES, - ParsersAttributes::MERGES }); + formatBooleanAttribs(attribs, { Attributes::HASHES, + Attributes::MERGES }); - formatOidAttribs(attribs, { ParsersAttributes::LEFT_TYPE, - ParsersAttributes::RIGHT_TYPE}, ObjectType::Type, false); + formatOidAttribs(attribs, { Attributes::LEFT_TYPE, + Attributes::RIGHT_TYPE}, ObjectType::Type, false); - formatOidAttribs(attribs, { ParsersAttributes::COMMUTATOR_OP, - ParsersAttributes::NEGATOR_OP}, ObjectType::Operator, false); + formatOidAttribs(attribs, { Attributes::CommutatorOp, + Attributes::NEGATOR_OP}, ObjectType::Operator, false); - formatOidAttribs(attribs, { ParsersAttributes::OPERATOR_FUNC, - ParsersAttributes::RESTRICTION_FUNC, - ParsersAttributes::JOIN_FUNC }, ObjectType::Function, false); + formatOidAttribs(attribs, { Attributes::OPERATOR_FUNC, + Attributes::RESTRICTION_FUNC, + Attributes::JOIN_FUNC }, ObjectType::Function, false); - attribs[ParsersAttributes::SIGNATURE]=(QString("%1(%2,%3)") - .arg(BaseObject::formatName(attribs[ParsersAttributes::NAME], true)) - .arg(attribs[ParsersAttributes::LEFT_TYPE]) - .arg(attribs[ParsersAttributes::RIGHT_TYPE])).replace(ElemSeparator, QString(",")); + attribs[Attributes::SIGNATURE]=(QString("%1(%2,%3)") + .arg(BaseObject::formatName(attribs[Attributes::NAME], true)) + .arg(attribs[Attributes::LEFT_TYPE]) + .arg(attribs[Attributes::RIGHT_TYPE])).replace(ElemSeparator, QString(",")); } void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) { QStringList part_keys; - formatBooleanAttribs(attribs, { ParsersAttributes::OIDS, - ParsersAttributes::UNLOGGED, - ParsersAttributes::RLS_ENABLED, - ParsersAttributes::RLS_FORCED}); + formatBooleanAttribs(attribs, { Attributes::OIDS, + Attributes::UNLOGGED, + Attributes::RLS_ENABLED, + Attributes::RLS_FORCED}); - formatOidAttribs(attribs, { ParsersAttributes::PARENTS }, ObjectType::Table, true); - formatOidAttribs(attribs, { ParsersAttributes::PARTITIONED_TABLE }, ObjectType::Table, false); + formatOidAttribs(attribs, { Attributes::PARENTS }, ObjectType::Table, true); + formatOidAttribs(attribs, { Attributes::PARTITIONED_TABLE }, ObjectType::Table, false); part_keys.push_back(getObjectsNames(ObjectType::Column, - Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]), - getObjectName(ObjectType::Schema, attribs[ParsersAttributes::SCHEMA]), - attribs[ParsersAttributes::NAME]).join(ElemSeparator)); + Catalog::parseArrayValues(attribs[Attributes::PART_KEY_COLS]), + getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]), + attribs[Attributes::NAME]).join(ElemSeparator)); - part_keys.push_back(Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator)); + part_keys.push_back(Catalog::parseArrayValues(attribs[Attributes::EXPRESSIONS]).join(ElemSeparator)); part_keys.removeAll(QString()); - attribs[ParsersAttributes::PARTITION_KEY] = part_keys.join(ElemSeparator); - attribs.erase(ParsersAttributes::PART_KEY_COLLS); - attribs.erase(ParsersAttributes::PART_KEY_OPCLS); - attribs.erase(ParsersAttributes::PART_KEY_EXPRS); - attribs.erase(ParsersAttributes::PART_KEY_COLS); + attribs[Attributes::PARTITION_KEY] = part_keys.join(ElemSeparator); + attribs.erase(Attributes::PART_KEY_COLLS); + attribs.erase(Attributes::PART_KEY_OPCLS); + attribs.erase(Attributes::PART_KEY_EXPRS); + attribs.erase(Attributes::PART_KEY_COLS); } void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) { QStringList owner_col, - seq_values=Catalog::parseArrayValues(attribs[ParsersAttributes::Attribute]), - seq_attrs={ ParsersAttributes::START, ParsersAttributes::MIN_VALUE, - ParsersAttributes::MAX_VALUE, ParsersAttributes::INCREMENT, - ParsersAttributes::Cache, ParsersAttributes::CYCLE }; - QString sch_name=getObjectName(ObjectType::Schema, attribs[ParsersAttributes::SCHEMA]); + seq_values=Catalog::parseArrayValues(attribs[Attributes::Attribute]), + seq_attrs={ Attributes::START, Attributes::MIN_VALUE, + Attributes::MAX_VALUE, Attributes::INCREMENT, + Attributes::Cache, Attributes::Cycle }; + QString sch_name=getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]); - attribs.erase(ParsersAttributes::Attribute); + attribs.erase(Attributes::Attribute); for(int i=0; i < seq_values.size(); i++) attribs[seq_attrs[i]]=seq_values[i]; - formatBooleanAttribs(attribs, { ParsersAttributes::CYCLE }); + formatBooleanAttribs(attribs, { Attributes::Cycle }); - owner_col=attribs[ParsersAttributes::OWNER_COLUMN].split(':'); + owner_col=attribs[Attributes::OWNER_COLUMN].split(':'); if(owner_col.size()==2) { QStringList names=getObjectName(ObjectType::Table, owner_col[0]).split('.'); vector col_attribs=catalog.getObjectsAttributes(ObjectType::Column, names[0], names[1], { owner_col[1].toUInt() }); if(!col_attribs.empty()) - attribs[ParsersAttributes::OWNER_COLUMN]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(ParsersAttributes::NAME)); + attribs[Attributes::OWNER_COLUMN]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(Attributes::NAME)); } //Retrieving the current value of the sequence by querying the database @@ -570,10 +601,10 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) ResultSet res; conn.connect(); - conn.executeDMLCommand(QString("SELECT last_value FROM \"%1\".\"%2\"").arg(sch_name).arg(BaseObject::formatName(attribs[ParsersAttributes::NAME])), res); + conn.executeDMLCommand(QString("SELECT last_value FROM \"%1\".\"%2\"").arg(sch_name).arg(BaseObject::formatName(attribs[Attributes::NAME])), res); if(res.accessTuple(ResultSet::FirstTuple)) - attribs[ParsersAttributes::LAST_VALUE]=res.getColumnValue(QString("last_value")); + attribs[Attributes::LAST_VALUE]=res.getColumnValue(QString("last_value")); conn.close(); } @@ -585,39 +616,39 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatViewAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::MATERIALIZED }); + formatBooleanAttribs(attribs, { Attributes::MATERIALIZED }); } void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) { - QStringList range_attr=Catalog::parseArrayValues(attribs[ParsersAttributes::RANGE_ATTRIBS]), - type_attr=Catalog::parseArrayValues(attribs[ParsersAttributes::TYPE_ATTRIBUTE]); - - formatBooleanAttribs(attribs, { ParsersAttributes::ByValue, - ParsersAttributes::COLLATABLE, - ParsersAttributes::PREFERRED }); - formatOidAttribs(attribs, { ParsersAttributes::AnalyzeFunc, - ParsersAttributes::INPUT_FUNC, - ParsersAttributes::OUTPUT_FUNC, - ParsersAttributes::RECV_FUNC, - ParsersAttributes::SEND_FUNC, - ParsersAttributes::TPMOD_IN_FUNC, - ParsersAttributes::TPMOD_OUT_FUNC }, ObjectType::Function, false); - attribs[ParsersAttributes::ELEMENT]=getObjectName(ObjectType::Type, attribs[ParsersAttributes::ELEMENT]); - - if(attribs[ParsersAttributes::ENUMERATIONS].isEmpty()) - attribs.erase(ParsersAttributes::ENUMERATIONS); + QStringList range_attr=Catalog::parseArrayValues(attribs[Attributes::RANGE_ATTRIBS]), + type_attr=Catalog::parseArrayValues(attribs[Attributes::TYPE_ATTRIBUTE]); + + formatBooleanAttribs(attribs, { Attributes::ByValue, + Attributes::Collatable, + Attributes::PREFERRED }); + formatOidAttribs(attribs, { Attributes::AnalyzeFunc, + Attributes::INPUT_FUNC, + Attributes::OUTPUT_FUNC, + Attributes::RECV_FUNC, + Attributes::SEND_FUNC, + Attributes::TPMOD_IN_FUNC, + Attributes::TPMOD_OUT_FUNC }, ObjectType::Function, false); + attribs[Attributes::ELEMENT]=getObjectName(ObjectType::Type, attribs[Attributes::ELEMENT]); + + if(attribs[Attributes::ENUMERATIONS].isEmpty()) + attribs.erase(Attributes::ENUMERATIONS); else - attribs[ParsersAttributes::ENUMERATIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ENUMERATIONS]).join(ElemSeparator); + attribs[Attributes::ENUMERATIONS]=Catalog::parseArrayValues(attribs[Attributes::ENUMERATIONS]).join(ElemSeparator); - attribs.erase(ParsersAttributes::RANGE_ATTRIBS); + attribs.erase(Attributes::RANGE_ATTRIBS); if(!range_attr.isEmpty()) { - attribs[ParsersAttributes::SUBTYPE]=getObjectName(ObjectType::Type, range_attr[0]); - attribs[ParsersAttributes::COLLATION]=getObjectName(ObjectType::Collation, range_attr[1]); - attribs[ParsersAttributes::OP_CLASS]=getObjectName(ObjectType::OpClass, range_attr[2]); - attribs[ParsersAttributes::CanonicalFunc]=getObjectName(ObjectType::Function, range_attr[3]); - attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjectType::Function, range_attr[4]); + attribs[Attributes::SUBTYPE]=getObjectName(ObjectType::Type, range_attr[0]); + attribs[Attributes::Collation]=getObjectName(ObjectType::Collation, range_attr[1]); + attribs[Attributes::OP_CLASS]=getObjectName(ObjectType::OpClass, range_attr[2]); + attribs[Attributes::CanonicalFunc]=getObjectName(ObjectType::Function, range_attr[3]); + attribs[Attributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjectType::Function, range_attr[4]); } if(!type_attr.isEmpty()) @@ -631,22 +662,22 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) fmt_attribs.push_back(list.join(QLatin1String(" "))); } - attribs[ParsersAttributes::TYPE_ATTRIBUTE]=fmt_attribs.join(ElemSeparator); + attribs[Attributes::TYPE_ATTRIBUTE]=fmt_attribs.join(ElemSeparator); } else - attribs.erase(ParsersAttributes::TYPE_ATTRIBUTE); + attribs.erase(Attributes::TYPE_ATTRIBUTE); } void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) { QStringList list, array_vals, elems; - attribs[ParsersAttributes::FAMILY]=getObjectName(ObjectType::OpFamily, attribs[ParsersAttributes::FAMILY]); - formatBooleanAttribs(attribs, { ParsersAttributes::DEFAULT }); - formatOidAttribs(attribs, { ParsersAttributes::STORAGE, - ParsersAttributes::TYPE }, ObjectType::Type, false); + attribs[Attributes::FAMILY]=getObjectName(ObjectType::OpFamily, attribs[Attributes::FAMILY]); + formatBooleanAttribs(attribs, { Attributes::DEFAULT }); + formatOidAttribs(attribs, { Attributes::STORAGE, + Attributes::TYPE }, ObjectType::Type, false); - array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::FUNCTION]); + array_vals=Catalog::parseArrayValues(attribs[Attributes::FUNCTION]); if(!array_vals.isEmpty()) { @@ -656,11 +687,11 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(ObjectType::Function, list[1]))); } - attribs[ParsersAttributes::FUNCTION]=elems.join(ElemSeparator); + attribs[Attributes::FUNCTION]=elems.join(ElemSeparator); elems.clear(); } - array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATOR]); + array_vals=Catalog::parseArrayValues(attribs[Attributes::OPERATOR]); if(!array_vals.isEmpty()) { @@ -673,123 +704,123 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) getObjectName(ObjectType::Operator, list[2]))); } - attribs[ParsersAttributes::OPERATOR]=elems.join(ElemSeparator); + attribs[Attributes::OPERATOR]=elems.join(ElemSeparator); elems.clear(); } } void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::CONSTRAINT, - ParsersAttributes::DEFERRABLE, - ParsersAttributes::PER_ROW, - ParsersAttributes::INS_EVENT, - ParsersAttributes::DEL_EVENT, - ParsersAttributes::UPD_EVENT, - ParsersAttributes::TRUNC_EVENT }); - - attribs[ParsersAttributes::TRIGGER_FUNC]=getObjectName(ObjectType::Function, attribs[ParsersAttributes::TRIGGER_FUNC]); - attribs[ParsersAttributes::Arguments]=Catalog::parseArrayValues(attribs[ParsersAttributes::Arguments]).join(ElemSeparator); - attribs[ParsersAttributes::COLUMNS]=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]).join(ElemSeparator); + formatBooleanAttribs(attribs, { Attributes::Constraint, + Attributes::DEFERRABLE, + Attributes::PER_ROW, + Attributes::INS_EVENT, + Attributes::DEL_EVENT, + Attributes::UPD_EVENT, + Attributes::TRUNC_EVENT }); + + attribs[Attributes::TRIGGER_FUNC]=getObjectName(ObjectType::Function, attribs[Attributes::TRIGGER_FUNC]); + attribs[Attributes::Arguments]=Catalog::parseArrayValues(attribs[Attributes::Arguments]).join(ElemSeparator); + attribs[Attributes::Columns]=Catalog::parseArrayValues(attribs[Attributes::Columns]).join(ElemSeparator); } void DatabaseExplorerWidget::formatRuleAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::COMMANDS]=Catalog::parseRuleCommands(attribs[ParsersAttributes::COMMANDS]).join(';'); + attribs[Attributes::Commands]=Catalog::parseRuleCommands(attribs[Attributes::Commands]).join(';'); } void DatabaseExplorerWidget::formatColumnAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { ParsersAttributes::NOT_NULL, - ParsersAttributes::INHERITED }); - attribs[ParsersAttributes::POSITION]=attribs[ParsersAttributes::OID]; - attribs.erase(ParsersAttributes::OID); - attribs.erase(ParsersAttributes::TYPE_OID); + formatBooleanAttribs(attribs, { Attributes::NOT_NULL, + Attributes::INHERITED }); + attribs[Attributes::POSITION]=attribs[Attributes::OID]; + attribs.erase(Attributes::OID); + attribs.erase(Attributes::TYPE_OID); } void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) { - map types={{ParsersAttributes::PK_CONSTR, ConstraintType(ConstraintType::PrimaryKey)}, - {ParsersAttributes::FK_CONSTR, ConstraintType(ConstraintType::ForeignKey)}, - {ParsersAttributes::UQ_CONSTR, ConstraintType(ConstraintType::Unique)}, - {ParsersAttributes::CkConstr, ConstraintType(ConstraintType::Check)}, - {ParsersAttributes::EX_CONSTR, ConstraintType(ConstraintType::Exclude)}}; - - ConstraintType constr_type=types[attribs[ParsersAttributes::TYPE]]; - QStringList names=getObjectName(ObjectType::Table, attribs[ParsersAttributes::TABLE]).split('.'); - - formatBooleanAttribs(attribs, { ParsersAttributes::DEFERRABLE, - ParsersAttributes::NO_INHERIT }); - attribs[ParsersAttributes::TYPE]=~types[attribs[ParsersAttributes::TYPE]]; - attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, - Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ElemSeparator); - attribs[ParsersAttributes::SRC_COLUMNS]=getObjectsNames(ObjectType::Column, - Catalog::parseArrayValues(attribs[ParsersAttributes::SRC_COLUMNS]), + map types={{Attributes::PK_CONSTR, ConstraintType(ConstraintType::PrimaryKey)}, + {Attributes::FK_CONSTR, ConstraintType(ConstraintType::ForeignKey)}, + {Attributes::UQ_CONSTR, ConstraintType(ConstraintType::Unique)}, + {Attributes::CkConstr, ConstraintType(ConstraintType::Check)}, + {Attributes::EX_CONSTR, ConstraintType(ConstraintType::Exclude)}}; + + ConstraintType constr_type=types[attribs[Attributes::TYPE]]; + QStringList names=getObjectName(ObjectType::Table, attribs[Attributes::TABLE]).split('.'); + + formatBooleanAttribs(attribs, { Attributes::DEFERRABLE, + Attributes::NO_INHERIT }); + attribs[Attributes::TYPE]=~types[attribs[Attributes::TYPE]]; + attribs[Attributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, + Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES])).join(ElemSeparator); + attribs[Attributes::SRC_COLUMNS]=getObjectsNames(ObjectType::Column, + Catalog::parseArrayValues(attribs[Attributes::SRC_COLUMNS]), names[0], names[1]).join(ElemSeparator); if(constr_type==ConstraintType::ForeignKey) { - attribs[ParsersAttributes::REF_TABLE]=getObjectName(ObjectType::Table, attribs[ParsersAttributes::REF_TABLE]); - names=attribs[ParsersAttributes::REF_TABLE].split('.'); - attribs[ParsersAttributes::DST_COLUMNS]=getObjectsNames(ObjectType::Column, - Catalog::parseArrayValues(attribs[ParsersAttributes::DST_COLUMNS]), + attribs[Attributes::REF_TABLE]=getObjectName(ObjectType::Table, attribs[Attributes::REF_TABLE]); + names=attribs[Attributes::REF_TABLE].split('.'); + attribs[Attributes::DST_COLUMNS]=getObjectsNames(ObjectType::Column, + Catalog::parseArrayValues(attribs[Attributes::DST_COLUMNS]), names[0], names[1]).join(ElemSeparator); } else { - attribs.erase(ParsersAttributes::DST_COLUMNS); - attribs.erase(ParsersAttributes::REF_TABLE); - attribs.erase(ParsersAttributes::UPD_ACTION); - attribs.erase(ParsersAttributes::DEL_ACTION); - attribs.erase(ParsersAttributes::COMPARISON_TYPE); + attribs.erase(Attributes::DST_COLUMNS); + attribs.erase(Attributes::REF_TABLE); + attribs.erase(Attributes::UPD_ACTION); + attribs.erase(Attributes::DEL_ACTION); + attribs.erase(Attributes::ComparisonType); } if(constr_type==ConstraintType::Check) { - attribs.erase(ParsersAttributes::DEFERRABLE); - attribs.erase(ParsersAttributes::DEFER_TYPE); + attribs.erase(Attributes::DEFERRABLE); + attribs.erase(Attributes::DEFER_TYPE); } else - attribs.erase(ParsersAttributes::EXPRESSION); + attribs.erase(Attributes::EXPRESSION); if(constr_type==ConstraintType::Exclude) { - attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); - attribs[ParsersAttributes::OPERATORS]=getObjectsNames(ObjectType::Operator, - Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATORS])).join(ElemSeparator); + attribs[Attributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[Attributes::EXPRESSIONS]).join(ElemSeparator); + attribs[Attributes::OPERATORS]=getObjectsNames(ObjectType::Operator, + Catalog::parseArrayValues(attribs[Attributes::OPERATORS])).join(ElemSeparator); } else { - attribs.erase(ParsersAttributes::CONDITION); - attribs.erase(ParsersAttributes::EXPRESSIONS); - attribs.erase(ParsersAttributes::OPERATORS); + attribs.erase(Attributes::Condition); + attribs.erase(Attributes::EXPRESSIONS); + attribs.erase(Attributes::OPERATORS); } } void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) { - QStringList names=getObjectName(ObjectType::Table, attribs[ParsersAttributes::TABLE]).split('.'); + QStringList names=getObjectName(ObjectType::Table, attribs[Attributes::TABLE]).split('.'); if(names.isEmpty() || names.size() == 1) - names=getObjectName(ObjectType::View, attribs[ParsersAttributes::TABLE]).split('.'); + names=getObjectName(ObjectType::View, attribs[Attributes::TABLE]).split('.'); - formatBooleanAttribs(attribs, { ParsersAttributes::UNIQUE }); + formatBooleanAttribs(attribs, { Attributes::UNIQUE }); - attribs[ParsersAttributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::EXPRESSIONS]).join(ElemSeparator); + attribs[Attributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[Attributes::EXPRESSIONS]).join(ElemSeparator); - attribs[ParsersAttributes::COLLATIONS]=getObjectsNames(ObjectType::Collation, - Catalog::parseArrayValues(attribs[ParsersAttributes::COLLATIONS])).join(ElemSeparator); + attribs[Attributes::Collations]=getObjectsNames(ObjectType::Collation, + Catalog::parseArrayValues(attribs[Attributes::Collations])).join(ElemSeparator); - attribs[ParsersAttributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, - Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES])).join(ElemSeparator); + attribs[Attributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, + Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES])).join(ElemSeparator); - attribs[ParsersAttributes::COLUMNS]=getObjectsNames(ObjectType::Column, - Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]), names[0], names[1]).join(ElemSeparator); + attribs[Attributes::Columns]=getObjectsNames(ObjectType::Column, + Catalog::parseArrayValues(attribs[Attributes::Columns]), names[0], names[1]).join(ElemSeparator); } void DatabaseExplorerWidget::formatPolicyAttribs(attribs_map &attribs) { - attribs[ParsersAttributes::ROLES] = getObjectsNames(ObjectType::Role, Catalog::parseArrayValues(attribs[ParsersAttributes::ROLES])).join(ElemSeparator); + attribs[Attributes::ROLES] = getObjectsNames(ObjectType::Role, Catalog::parseArrayValues(attribs[Attributes::ROLES])).join(ElemSeparator); } QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) @@ -797,28 +828,28 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) try { if(attribs.empty() || - attribs[ParsersAttributes::OID].isEmpty() || - attribs[ParsersAttributes::OID]==QString("0") || - attribs[ParsersAttributes::NAME].isEmpty()) + attribs[Attributes::OID].isEmpty() || + attribs[Attributes::OID]==QString("0") || + attribs[Attributes::NAME].isEmpty()) return(DepNotDefined); else { - ObjectType obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); + ObjectType obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); attribs_map aux_attribs; - QString oid=attribs[ParsersAttributes::OID], + QString oid=attribs[Attributes::OID], obj_name=DepNotFound.arg(oid), sch_name; if(obj_type!=ObjectType::Type) - obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME], obj_type==ObjectType::Operator); + obj_name=BaseObject::formatName(attribs[Attributes::NAME], obj_type==ObjectType::Operator); else - obj_name=attribs[ParsersAttributes::NAME]; + obj_name=attribs[Attributes::NAME]; //Retrieving the schema name - if(!attribs[ParsersAttributes::SCHEMA].isEmpty() && - attribs[ParsersAttributes::SCHEMA]!=QString("0")) + if(!attribs[Attributes::SCHEMA].isEmpty() && + attribs[Attributes::SCHEMA]!=QString("0")) { - aux_attribs=catalog.getObjectAttributes(ObjectType::Schema, attribs[ParsersAttributes::SCHEMA].toUInt()); - sch_name=BaseObject::formatName(aux_attribs[ParsersAttributes::NAME], false); + aux_attribs=catalog.getObjectAttributes(ObjectType::Schema, attribs[Attributes::SCHEMA].toUInt()); + sch_name=BaseObject::formatName(aux_attribs[Attributes::NAME], false); if(!sch_name.isEmpty()) obj_name=sch_name + QString(".") + obj_name; @@ -827,7 +858,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) //Formatting paramenter types for function if(obj_type==ObjectType::Function) { - QStringList names, arg_types=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgTypes]); + QStringList names, arg_types=Catalog::parseArrayValues(attribs[Attributes::ArgTypes]); for(int idx=0; idx < arg_types.size(); idx++) { @@ -842,7 +873,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) { QStringList arg_types, names; QString type_name; - vector attrib_ids={ ParsersAttributes::LEFT_TYPE, ParsersAttributes::RIGHT_TYPE }; + vector attrib_ids={ Attributes::LEFT_TYPE, Attributes::RIGHT_TYPE }; for(QString attr : attrib_ids) { @@ -885,7 +916,7 @@ QStringList DatabaseExplorerWidget::getObjectsNames(ObjectType obj_type, const Q //Retrieve all the objects by their oids and put them on a auxiliary map in which key is their oids attribs_vect=catalog.getObjectsAttributes(obj_type, sch_name, tab_name, oids_vect); for(attribs_map attr : attribs_vect) - attrs_map[attr[ParsersAttributes::OID]]=attr; + attrs_map[attr[Attributes::OID]]=attr; //Retreving the names from the auxiliary map using the provided oids for(QString oid : oids) @@ -1089,27 +1120,27 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) //Formatting a schema qualified "table" attribute for table children objects if(TableObject::isTableObject(obj_type) && !sch_name.isEmpty() && !tab_name.isEmpty()) - attribs[ParsersAttributes::TABLE]=BaseObject::formatName(sch_name) + QString(".") + BaseObject::formatName(tab_name); + attribs[Attributes::TABLE]=BaseObject::formatName(sch_name) + QString(".") + BaseObject::formatName(tab_name); } //Formatting the "name" attribute if it is not schema qualified - else if(attribs.count(ParsersAttributes::SCHEMA) && - attribs.count(ParsersAttributes::NAME) && - !attribs[ParsersAttributes::NAME].contains('.')) + else if(attribs.count(Attributes::SCHEMA) && + attribs.count(Attributes::NAME) && + !attribs[Attributes::NAME].contains('.')) { QString obj_name; if(obj_type!=ObjectType::Operator) - obj_name=BaseObject::formatName(attribs[ParsersAttributes::NAME]); + obj_name=BaseObject::formatName(attribs[Attributes::NAME]); else - obj_name=attribs[ParsersAttributes::NAME]; + obj_name=attribs[Attributes::NAME]; - attribs[ParsersAttributes::NAME]=BaseObject::formatName(attribs[ParsersAttributes::SCHEMA]) + QString(".") + obj_name; + attribs[Attributes::NAME]=BaseObject::formatName(attribs[Attributes::SCHEMA]) + QString(".") + obj_name; } - if(attribs.count(ParsersAttributes::SQL_OBJECT)==0) + if(attribs.count(Attributes::SQL_OBJECT)==0) { - attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); - attribs[ParsersAttributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_type); + attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); + attribs[Attributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_type); } for(auto &attr : attribs) @@ -1132,9 +1163,9 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i attribs_map attribs; QStringList types; - attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); - attribs[ParsersAttributes::DECL_IN_TABLE]=QString(); - attribs[BaseObject::getSchemaName(obj_type)]=ParsersAttributes::True; + attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); + attribs[Attributes::DECL_IN_TABLE]=QString(); + attribs[BaseObject::getSchemaName(obj_type)]=Attributes::True; //For cast, operator and function is needed to extract the name and the params types if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function || obj_type==ObjectType::Cast) @@ -1149,25 +1180,25 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i obj_name.remove(QRegExp("( )+(\\[)(.)+(\\])")); //Formatting the names - attribs[ParsersAttributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjectType::Operator); - attribs[ParsersAttributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); - attribs[ParsersAttributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); + attribs[Attributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjectType::Operator); + attribs[Attributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); + attribs[Attributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); //For table objects the "table" attribute must be schema qualified if(obj_type!=ObjectType::Index && TableObject::isTableObject(obj_type)) { - attribs[ParsersAttributes::TABLE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::TABLE]; - attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::NAME] + QString(" ON %1").arg(attribs[ParsersAttributes::TABLE]); + attribs[Attributes::TABLE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::TABLE]; + attribs[Attributes::SIGNATURE]=attribs[Attributes::NAME] + QString(" ON %1").arg(attribs[Attributes::TABLE]); } //For operators and functions there must exist the signature attribute else if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function) - attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::NAME] + QString("(%1)").arg(types.join(ElemSeparator)); + attribs[Attributes::SIGNATURE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::NAME] + QString("(%1)").arg(types.join(ElemSeparator)); else if(obj_type==ObjectType::Cast) - attribs[ParsersAttributes::SIGNATURE]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); + attribs[Attributes::SIGNATURE]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); else if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); - attribs[ParsersAttributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[ParsersAttributes::NAME]).arg(aux_attribs[ParsersAttributes::INDEX_TYPE]); + attribs[Attributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[Attributes::NAME]).arg(aux_attribs[Attributes::INDEX_TYPE]); } else { @@ -1177,19 +1208,19 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); - if(aux_attribs[ParsersAttributes::MATERIALIZED] == ParsersAttributes::True) + if(aux_attribs[Attributes::MATERIALIZED] == Attributes::True) { - attribs[ParsersAttributes::SQL_OBJECT] = - QString("%1 %2").arg(ParsersAttributes::MATERIALIZED.toUpper()) + attribs[Attributes::SQL_OBJECT] = + QString("%1 %2").arg(Attributes::MATERIALIZED.toUpper()) .arg(BaseObject::getSQLName(ObjectType::View)); } } - if(!attribs[ParsersAttributes::SCHEMA].isEmpty() && - attribs[ParsersAttributes::NAME].indexOf(attribs[ParsersAttributes::SCHEMA] + QString(".")) < 0) - attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::SCHEMA] + QString(".") + attribs[ParsersAttributes::NAME]; + if(!attribs[Attributes::SCHEMA].isEmpty() && + attribs[Attributes::NAME].indexOf(attribs[Attributes::SCHEMA] + QString(".")) < 0) + attribs[Attributes::SIGNATURE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::NAME]; else - attribs[ParsersAttributes::SIGNATURE]=attribs[ParsersAttributes::NAME]; + attribs[Attributes::SIGNATURE]=attribs[Attributes::NAME]; } return(attribs); @@ -1230,12 +1261,12 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) attribs=extractAttributesFromItem(item); if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function) - attribs[ParsersAttributes::SIGNATURE].replace(ElemSeparator, QChar(',')); + attribs[Attributes::SIGNATURE].replace(ElemSeparator, QChar(',')); //Generate the drop command schparser.ignoreEmptyAttributes(true); schparser.ignoreUnkownAttributes(true); - drop_cmd=schparser.getCodeDefinition(ParsersAttributes::DROP, attribs, SchemaParser::SqlDefinition); + drop_cmd=schparser.getCodeDefinition(Attributes::DROP, attribs, SchemaParser::SqlDefinition); if(cascade) drop_cmd.replace(';', QString(" CASCADE;")); @@ -1294,17 +1325,17 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin Connection conn; SchemaParser schparser; - attribs[ParsersAttributes::SQL_OBJECT]=BaseObject::getSQLName(ObjectType::Table); - attribs[ParsersAttributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); - attribs[ParsersAttributes::Cascade]=(cascade ? ParsersAttributes::True : ""); - attribs[ParsersAttributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? ParsersAttributes::True : ""); + attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(ObjectType::Table); + attribs[Attributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); + attribs[Attributes::Cascade]=(cascade ? Attributes::True : ""); + attribs[Attributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? Attributes::True : ""); //Generate the truncate command schparser.ignoreEmptyAttributes(true); schparser.ignoreUnkownAttributes(true); truc_cmd=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::TRUNCATE + GlobalAttributes::SchemaExt, + Attributes::TRUNCATE + GlobalAttributes::SchemaExt, attribs); //Executes the truncate cmd @@ -1462,17 +1493,17 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) attribs_map ref_table, ref_schema; QStringList tab_list; - ref_fks = catalog.getObjectsAttributes(ObjectType::Constraint, QString(), QString(), {}, {{ ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[ParsersAttributes::OID])}}); + ref_fks = catalog.getObjectsAttributes(ObjectType::Constraint, QString(), QString(), {}, {{ Attributes::CustomFilter, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[Attributes::OID])}}); for(auto &fk : ref_fks) { - ref_table = catalog.getObjectAttributes(ObjectType::Table, fk[ParsersAttributes::TABLE].toUInt()); - ref_schema = catalog.getObjectAttributes(ObjectType::Schema, ref_table[ParsersAttributes::SCHEMA].toUInt()); - tab_list.push_back(QString("%1.%2").arg(ref_schema[ParsersAttributes::NAME]).arg(ref_table[ParsersAttributes::NAME])); + ref_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::TABLE].toUInt()); + ref_schema = catalog.getObjectAttributes(ObjectType::Schema, ref_table[Attributes::SCHEMA].toUInt()); + tab_list.push_back(QString("%1.%2").arg(ref_schema[Attributes::NAME]).arg(ref_table[Attributes::NAME])); } if(!tab_list.isEmpty()) - orig_attribs[ParsersAttributes::REFERRERS] = tab_list.join(Table::DataSeparator); + orig_attribs[Attributes::REFERRERS] = tab_list.join(Table::DataSeparator); } } else @@ -1487,7 +1518,7 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) //Format values and translate the attribute names fmt_attribs=formatObjectAttribs(orig_attribs); - fmt_attribs.erase(ParsersAttributes::SIGNATURE); + fmt_attribs.erase(Attributes::SIGNATURE); //Store the original attributes on the item to permit value replacements when using code snippets item->setData(DatabaseImportForm::ObjectOtherData, Qt::UserRole, QVariant::fromValue(orig_attribs)); @@ -1575,11 +1606,11 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) cached_attribs=item->data(DatabaseImportForm::ObjectOtherData,Qt::UserRole).value(); - if(cached_attribs[ParsersAttributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjectType::Constraint) && item->childCount()==0) + if(cached_attribs[Attributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjectType::Constraint) && item->childCount()==0) { QTreeWidgetItem *fk_item=nullptr, *src_item=nullptr; - if(cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::ForeignKey)) + if(cached_attribs[Attributes::TYPE]==~ConstraintType(ConstraintType::ForeignKey)) { /* Creates two items denoting the source columns and referenced tables. These items have a negative id indicating that no popup menu will be show if user @@ -1589,28 +1620,28 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) src_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); src_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("column"))); src_item->setText(0, QString("%1(%2)") - .arg(cached_attribs[ParsersAttributes::TABLE]) - .arg(cached_attribs[ParsersAttributes::SRC_COLUMNS])); + .arg(cached_attribs[Attributes::TABLE]) + .arg(cached_attribs[Attributes::SRC_COLUMNS])); src_item->setToolTip(0, trUtf8("Src. table: %1\nSrc. column(s): %2") - .arg(cached_attribs[ParsersAttributes::TABLE]) - .arg(cached_attribs[ParsersAttributes::SRC_COLUMNS])); + .arg(cached_attribs[Attributes::TABLE]) + .arg(cached_attribs[Attributes::SRC_COLUMNS])); src_item->setFlags(Qt::ItemIsEnabled); fk_item=new QTreeWidgetItem(item); fk_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); fk_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referenced"))); fk_item->setText(0, QString("%1(%2)") - .arg(cached_attribs[ParsersAttributes::REF_TABLE]) - .arg(cached_attribs[ParsersAttributes::DST_COLUMNS])); + .arg(cached_attribs[Attributes::REF_TABLE]) + .arg(cached_attribs[Attributes::DST_COLUMNS])); fk_item->setToolTip(0, trUtf8("Ref. table: %1\nRef. column(s): %2") - .arg(cached_attribs[ParsersAttributes::REF_TABLE]) - .arg(cached_attribs[ParsersAttributes::DST_COLUMNS])); + .arg(cached_attribs[Attributes::REF_TABLE]) + .arg(cached_attribs[Attributes::DST_COLUMNS])); fk_item->setFlags(Qt::ItemIsEnabled); } - else if(cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::Unique) || - cached_attribs[ParsersAttributes::TYPE]==~ConstraintType(ConstraintType::PrimaryKey)) + else if(cached_attribs[Attributes::TYPE]==~ConstraintType(ConstraintType::Unique) || + cached_attribs[Attributes::TYPE]==~ConstraintType(ConstraintType::PrimaryKey)) { - QStringList columns=cached_attribs[ParsersAttributes::SRC_COLUMNS].split(ElemSeparator); + QStringList columns=cached_attribs[Attributes::SRC_COLUMNS].split(ElemSeparator); for(auto &col : columns) { @@ -1622,11 +1653,11 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } } } - else if(cached_attribs[ParsersAttributes::OBJECT_TYPE] == BaseObject::getSchemaName(ObjectType::Table) && - !cached_attribs[ParsersAttributes::REFERRERS].isEmpty() && item->childCount() == 5) + else if(cached_attribs[Attributes::OBJECT_TYPE] == BaseObject::getSchemaName(ObjectType::Table) && + !cached_attribs[Attributes::REFERRERS].isEmpty() && item->childCount() == 5) { QTreeWidgetItem *refs_item=nullptr, *tab_item=nullptr; - QStringList ref_tab_names = cached_attribs[ParsersAttributes::REFERRERS].split(Table::DataSeparator); + QStringList ref_tab_names = cached_attribs[Attributes::REFERRERS].split(Table::DataSeparator); QFont font; refs_item=new QTreeWidgetItem(item); @@ -1637,7 +1668,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) refs_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); refs_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referrer"))); refs_item->setText(0, QString("%1 (%2)") - .arg(attribs_i18n.at(ParsersAttributes::REFERRERS)) + .arg(attribs_i18n.at(Attributes::REFERRERS)) .arg(ref_tab_names.length())); for(QString tab_name : ref_tab_names) @@ -1696,14 +1727,14 @@ void DatabaseExplorerWidget::finishObjectRename(void) ObjectType obj_type=static_cast(rename_item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); objects_trw->closePersistentEditor(rename_item); - attribs[ParsersAttributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjectType::Operator); + attribs[Attributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjectType::Operator); //Generate the drop command schparser.ignoreEmptyAttributes(true); schparser.ignoreUnkownAttributes(true); rename_cmd=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::RENAME + GlobalAttributes::SchemaExt, + Attributes::RENAME + GlobalAttributes::SchemaExt, attribs); //Executes the rename cmd @@ -1802,7 +1833,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) //Currently pgModeler does not support the visualization of base types and built-in ones if(obj_type==ObjectType::Type && - (oid <= sys_oid || attribs[ParsersAttributes::CONFIGURATION]==ParsersAttributes::BaseType)) + (oid <= sys_oid || attribs[Attributes::Configuration]==Attributes::BaseType)) { source=trUtf8("-- Source code genaration for buil-in and base types currently unavailable --"); emit s_sourceCodeShowRequested(source); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index b5f2ed4e07..f53b3038f8 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -658,12 +658,12 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW db_item=new QTreeWidgetItem; db_item->setText(0, import_helper.getCurrentDatabase()); db_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ObjectType::Database))); - attribs=catalog.getObjectsAttributes(ObjectType::Database, QString(), QString(), {}, {{ParsersAttributes::NAME, import_helper.getCurrentDatabase()}}); + attribs=catalog.getObjectsAttributes(ObjectType::Database, QString(), QString(), {}, {{Attributes::NAME, import_helper.getCurrentDatabase()}}); - db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(ParsersAttributes::OID).toUInt()); + db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(Attributes::OID).toUInt()); db_item->setData(ObjectTypeId, Qt::UserRole, ~ObjectType::Database); - db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(ParsersAttributes::OID))); + db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(Attributes::OID))); tree_wgt->addTopLevelItem(db_item); } @@ -748,7 +748,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe { QTreeWidgetItem *group=nullptr, *item=nullptr; QFont grp_fnt=tree_wgt->font(); - attribs_map extra_attribs={{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::True}}; + attribs_map extra_attribs={{Attributes::FILTER_TABLE_TYPES, Attributes::True}}; QString tooltip=QString("OID: %1"), name, label; bool child_checked=false; vector objects_vect; @@ -787,16 +787,16 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe for(attribs_map &attribs : objects_vect) { - obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); group=gen_groups[obj_type]; group->setData(ObjectCount, Qt::UserRole, group->data(ObjectCount, Qt::UserRole).toUInt() + 1); //Creates individual items for each object of the current type - oid=attribs[ParsersAttributes::OID].toUInt(); + oid=attribs[Attributes::OID].toUInt(); - attribs[ParsersAttributes::NAME].remove(QRegExp(QString("( )(without)( time zone)"))); - label=name=attribs[ParsersAttributes::NAME]; + attribs[Attributes::NAME].remove(QRegExp(QString("( )(without)( time zone)"))); + label=name=attribs[Attributes::NAME]; //Removing the trailing type string from op. families or op. classes names if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) @@ -810,8 +810,8 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item=new QTreeWidgetItem(group); item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(obj_type))); item->setText(0, label); - item->setText(ObjectId, attribs[ParsersAttributes::OID].rightJustified(10, '0')); - item->setData(ObjectId, Qt::UserRole, attribs[ParsersAttributes::OID].toUInt()); + item->setText(ObjectId, attribs[Attributes::OID].rightJustified(10, '0')); + item->setData(ObjectId, Qt::UserRole, attribs[Attributes::OID].toUInt()); item->setData(ObjectName, Qt::UserRole, name); if(checkable_items) @@ -841,7 +841,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe name==~LanguageType(LanguageType::PlPgsql)))) { item->setFont(0, grp_fnt); - item->setForeground(0, BaseObjectView::getFontStyle(ParsersAttributes::PROT_COLUMN).foreground()); + item->setForeground(0, BaseObjectView::getFontStyle(Attributes::PROT_COLUMN).foreground()); item->setToolTip(0, trUtf8("This is a pgModeler's built-in object. It will be ignored if checked by user.")); } } diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 2b45c7eb16..d1950a2f7f 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -204,7 +204,7 @@ void DatabaseImportHelper::retrieveSystemObjects(void) while(itr!=objects.end() && !import_canceled) { - oid=itr->at(ParsersAttributes::OID).toUInt(); + oid=itr->at(Attributes::OID).toUInt(); (*obj_map)[oid]=(*itr); itr++; } @@ -238,7 +238,7 @@ void DatabaseImportHelper::retrieveUserObjects(void) while(itr!=objects.end() && !import_canceled) { - oid=itr->at(ParsersAttributes::OID).toUInt(); + oid=itr->at(Attributes::OID).toUInt(); user_objs[oid]=(*itr); itr++; } @@ -278,8 +278,8 @@ void DatabaseImportHelper::retrieveTableColumns(const QString &sch_name, const Q for(auto &itr : cols) { - col_oid=itr.at(ParsersAttributes::OID).toUInt(); - tab_oid=itr.at(ParsersAttributes::TABLE).toUInt(); + col_oid=itr.at(Attributes::OID).toUInt(); + tab_oid=itr.at(Attributes::TABLE).toUInt(); columns[tab_oid][col_oid]=itr; } } @@ -303,7 +303,7 @@ void DatabaseImportHelper::createObjects(void) { oid=creation_order[i]; attribs=user_objs[oid]; - obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); try { @@ -312,9 +312,9 @@ void DatabaseImportHelper::createObjects(void) if(obj_type!=ObjectType::Constraint) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2), oid `%3'...") - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(obj_type)) - .arg(attribs[ParsersAttributes::OID]), + .arg(attribs[Attributes::OID]), obj_type); createObject(attribs); @@ -357,14 +357,14 @@ void DatabaseImportHelper::createObjects(void) while(itr!=itr_end && !import_canceled) { attribs=user_objs[*itr]; - obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); itr++; emit s_progressUpdated(progress, trUtf8("Trying to recreate object `%1' (%2), oid `%3'...") - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(obj_type)) - .arg(attribs[ParsersAttributes::OID]), + .arg(attribs[Attributes::OID]), obj_type); try @@ -420,13 +420,13 @@ void DatabaseImportHelper::createConstraints(void) try { //Check constraints are created only if they are not inherited, other types are created normally - if(attribs[ParsersAttributes::TYPE]!=ParsersAttributes::CkConstr || - (attribs[ParsersAttributes::TYPE]==ParsersAttributes::CkConstr && - attribs[ParsersAttributes::INHERITED]!=ParsersAttributes::True)) + if(attribs[Attributes::TYPE]!=Attributes::CkConstr || + (attribs[Attributes::TYPE]==Attributes::CkConstr && + attribs[Attributes::INHERITED]!=Attributes::True)) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2)...") - .arg(attribs[ParsersAttributes::NAME]) + .arg(attribs[Attributes::NAME]) .arg(BaseObject::getTypeName(ObjectType::Constraint)), ObjectType::Constraint); @@ -461,9 +461,9 @@ void DatabaseImportHelper::createPermissions(void) while(itr_obj!=obj_perms.end() && !import_canceled) { attribs=user_objs[*itr_obj]; - obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); emit s_progressUpdated(progress, - msg.arg(getObjectName(attribs[ParsersAttributes::OID])) + msg.arg(getObjectName(attribs[Attributes::OID])) .arg(BaseObject::getTypeName(obj_type)), ObjectType::Permission); createPermission(attribs); @@ -482,9 +482,9 @@ void DatabaseImportHelper::createPermissions(void) while(itr!=itr_cols->second.end()) { attribs=columns[itr_cols->first][*itr]; - obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); emit s_progressUpdated(progress, - msg.arg(getObjectName(attribs[ParsersAttributes::OID])) + msg.arg(getObjectName(attribs[Attributes::OID])) .arg(BaseObject::getTypeName(obj_type)), ObjectType::Permission); createPermission(attribs); @@ -659,9 +659,9 @@ void DatabaseImportHelper::cancelImport(void) void DatabaseImportHelper::createObject(attribs_map &attribs) { - unsigned oid=attribs[ParsersAttributes::OID].toUInt(); - ObjectType obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); - QString obj_name=getObjectName(attribs[ParsersAttributes::OID], (obj_type==ObjectType::Function || obj_type==ObjectType::Operator)); + unsigned oid=attribs[Attributes::OID].toUInt(); + ObjectType obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + QString obj_name=getObjectName(attribs[Attributes::OID], (obj_type==ObjectType::Function || obj_type==ObjectType::Operator)); //Avoiding the creation of pgModeler's temp objects created in database during the catalog reading if(obj_name.contains(Catalog::PgModelerTempDbObj)) @@ -677,25 +677,25 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) dbmodel->getObjectIndex(obj_name, obj_type) < 0))) { if(TableObject::isTableObject(obj_type)) - attribs[ParsersAttributes::DECL_IN_TABLE]=QString(); + attribs[Attributes::DECL_IN_TABLE]=QString(); //System objects will have the sql disabled by default - attribs[ParsersAttributes::SQL_DISABLED]=(catalog.isSystemObject(oid) || catalog.isExtensionObject(oid) ? ParsersAttributes::True : QString()); - attribs[ParsersAttributes::COMMENT]=getComment(attribs); + attribs[Attributes::SQL_DISABLED]=(catalog.isSystemObject(oid) || catalog.isExtensionObject(oid) ? Attributes::True : QString()); + attribs[Attributes::Comment]=getComment(attribs); - if(attribs.count(ParsersAttributes::OWNER)) - attribs[ParsersAttributes::OWNER]=getDependencyObject(attribs[ParsersAttributes::OWNER], ObjectType::Role, false, auto_resolve_deps); + if(attribs.count(Attributes::OWNER)) + attribs[Attributes::OWNER]=getDependencyObject(attribs[Attributes::OWNER], ObjectType::Role, false, auto_resolve_deps); - if(attribs.count(ParsersAttributes::TABLESPACE)) - attribs[ParsersAttributes::TABLESPACE]=getDependencyObject(attribs[ParsersAttributes::TABLESPACE], ObjectType::Tablespace, false, auto_resolve_deps); + if(attribs.count(Attributes::TABLESPACE)) + attribs[Attributes::TABLESPACE]=getDependencyObject(attribs[Attributes::TABLESPACE], ObjectType::Tablespace, false, auto_resolve_deps); - if(attribs.count(ParsersAttributes::SCHEMA)) - attribs[ParsersAttributes::SCHEMA]=getDependencyObject(attribs[ParsersAttributes::SCHEMA], ObjectType::Schema, false, auto_resolve_deps); + if(attribs.count(Attributes::SCHEMA)) + attribs[Attributes::SCHEMA]=getDependencyObject(attribs[Attributes::SCHEMA], ObjectType::Schema, false, auto_resolve_deps); /* Due to the object recreation mechanism there are some situations when pgModeler fails to recreate them due to the duplication of permissions. So, to avoid this problem we need to check if the OID of the object was previously registered in the vector of permissions to be created */ - if(!attribs[ParsersAttributes::PERMISSION].isEmpty() && + if(!attribs[Attributes::PERMISSION].isEmpty() && std::find(obj_perms.begin(), obj_perms.end(), oid)==obj_perms.end()) obj_perms.push_back(oid); @@ -749,7 +749,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) catch(Exception &e) { throw Exception(Exception::getErrorMessage(ErrorCode::ObjectNotImported) - .arg(obj_name).arg(BaseObject::getTypeName(obj_type)).arg(attribs[ParsersAttributes::OID]), + .arg(obj_name).arg(BaseObject::getTypeName(obj_type)).arg(attribs[Attributes::OID]), ErrorCode::ObjectNotImported,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs)); } } @@ -760,8 +760,8 @@ QString DatabaseImportHelper::getComment(attribs_map &attribs) { QString xml_def; - if(!attribs[ParsersAttributes::COMMENT].isEmpty()) - xml_def=schparser.getCodeDefinition(ParsersAttributes::COMMENT, attribs, SchemaParser::XmlDefinition); + if(!attribs[Attributes::Comment].isEmpty()) + xml_def=schparser.getCodeDefinition(Attributes::Comment, attribs, SchemaParser::XmlDefinition); return(xml_def); } @@ -822,17 +822,17 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType /* If the attributes of the dependency exists but it was not created on the model yet, pgModeler will create it and it's dependencies recursively */ if(recursive_dep_res && !TableObject::isTableObject(obj_type) && - obj_type!=ObjectType::Database && dbmodel->getObjectIndex(obj_attr[ParsersAttributes::NAME], obj_type) < 0) + obj_type!=ObjectType::Database && dbmodel->getObjectIndex(obj_attr[Attributes::NAME], obj_type) < 0) createObject(obj_attr); if(use_signature) - obj_name=obj_attr[ParsersAttributes::SIGNATURE]=getObjectName(oid, true); + obj_name=obj_attr[Attributes::SIGNATURE]=getObjectName(oid, true); else - obj_name=obj_attr[ParsersAttributes::NAME]=getObjectName(oid); + obj_name=obj_attr[Attributes::NAME]=getObjectName(oid); if(generate_xml) { - obj_attr[ParsersAttributes::REDUCED_FORM]=ParsersAttributes::True; + obj_attr[Attributes::REDUCED_FORM]=Attributes::True; schparser.ignoreUnkownAttributes(true); xml_def=schparser.getCodeDefinition(BaseObject::getSchemaName(obj_type), obj_attr, SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); @@ -869,7 +869,7 @@ void DatabaseImportHelper::loadObjectXML(ObjectType obj_type, attribs_map &attri if(debug_mode) { QTextStream ts(stdout); - ts << QString("").arg(attribs[ParsersAttributes::NAME]).arg(attribs[ParsersAttributes::OID]) << endl; + ts << QString("").arg(attribs[Attributes::NAME]).arg(attribs[Attributes::OID]) << endl; ts << xml_buf << endl; } @@ -910,8 +910,8 @@ QString DatabaseImportHelper::dumpObjectAttributes(attribs_map &attribs) QString dump_str; dump_str+=QString("-- Raw attributes: %1 (OID: %2) --\n") - .arg(attribs[ParsersAttributes::NAME]) - .arg(attribs[ParsersAttributes::OID]); + .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::OID]); for(auto &attr : attribs) dump_str+=QString("%1: %2\n").arg(attr.first).arg(attr.second); @@ -945,8 +945,8 @@ void DatabaseImportHelper::createSchema(attribs_map &attribs) try { - attribs[ParsersAttributes::RECT_VISIBLE]=QString(); - attribs[ParsersAttributes::FILL_COLOR]=QColor(dist(rand_num_engine), + attribs[Attributes::RECT_VISIBLE]=QString(); + attribs[Attributes::FILL_COLOR]=QColor(dist(rand_num_engine), dist(rand_num_engine), dist(rand_num_engine)).name(); loadObjectXML(ObjectType::Schema, attribs); @@ -968,9 +968,9 @@ void DatabaseImportHelper::createRole(attribs_map &attribs) try { - QString role_types[]={ ParsersAttributes::REF_ROLES, - ParsersAttributes::AdminRoles, - ParsersAttributes::MEMBER_ROLES }; + QString role_types[]={ Attributes::REF_ROLES, + Attributes::AdminRoles, + Attributes::MEMBER_ROLES }; for(unsigned i=0; i < 3; i++) attribs[role_types[i]]=getObjectNames(attribs[role_types[i]]).join(','); @@ -996,8 +996,8 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) try { - constraints = Catalog::parseArrayValues(attribs[ParsersAttributes::CONSTRAINTS]); - attribs[ParsersAttributes::CONSTRAINTS].clear(); + constraints = Catalog::parseArrayValues(attribs[Attributes::Constraints]); + attribs[Attributes::Constraints].clear(); for(auto constr : constraints) { @@ -1005,18 +1005,18 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) constr.remove(constr.length() - 1, 1); constr_attrs = constr.split(QChar(':')); - aux_attribs[ParsersAttributes::NAME] = constr_attrs.at(0); + aux_attribs[Attributes::NAME] = constr_attrs.at(0); expr = constr_attrs.at(1); expr.remove(0,1); expr.remove(expr.length() - 1,1); - aux_attribs[ParsersAttributes::EXPRESSION] = expr; + aux_attribs[Attributes::EXPRESSION] = expr; - attribs[ParsersAttributes::CONSTRAINTS]+= schparser.getCodeDefinition(ParsersAttributes::DOM_CONSTRAINT, aux_attribs, SchemaParser::XmlDefinition); + attribs[Attributes::Constraints]+= schparser.getCodeDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, SchemaParser::XmlDefinition); } - attribs[ParsersAttributes::TYPE]=getType(attribs[ParsersAttributes::TYPE], true, attribs); - attribs[ParsersAttributes::COLLATION]=getDependencyObject(attribs[ParsersAttributes::COLLATION], ObjectType::Collation); + attribs[Attributes::TYPE]=getType(attribs[Attributes::TYPE], true, attribs); + attribs[Attributes::Collation]=getDependencyObject(attribs[Attributes::Collation], ObjectType::Collation); loadObjectXML(ObjectType::Domain, attribs); dom=dbmodel->createDomain(); dbmodel->addDomain(dom); @@ -1059,19 +1059,19 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) try { - param_types=getTypes(attribs[ParsersAttributes::ArgTypes], false); - param_names=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgNames]); - param_modes=Catalog::parseArrayValues(attribs[ParsersAttributes::ArgModes]); - param_def_vals=Catalog::parseDefaultValues(attribs[ParsersAttributes::ArgDefaults]); + param_types=getTypes(attribs[Attributes::ArgTypes], false); + param_names=Catalog::parseArrayValues(attribs[Attributes::ArgNames]); + param_modes=Catalog::parseArrayValues(attribs[Attributes::ArgModes]); + param_def_vals=Catalog::parseDefaultValues(attribs[Attributes::ArgDefaults]); for(int i=0; i < param_types.size(); i++) { /* If the function is to be used as a user-defined data type support functions the parameter type will be renamed to "any" (see rules on Type::setFunction()) */ if(i==0 && - (attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::SEND_FUNC || - attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::OUTPUT_FUNC || - attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CanonicalFunc)) + (attribs[Attributes::REF_TYPE]==Attributes::SEND_FUNC || + attribs[Attributes::REF_TYPE]==Attributes::OUTPUT_FUNC || + attribs[Attributes::REF_TYPE]==Attributes::CanonicalFunc)) type=PgSqlType(QString("\"any\"")); else { @@ -1110,7 +1110,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) //If the mode is 't' indicates that the current parameter will be used as a return table colum if(!param_modes.isEmpty() && param_modes[i]==QString("t")) - attribs[ParsersAttributes::RETURN_TABLE]+=param.getCodeDefinition(SchemaParser::XmlDefinition); + attribs[Attributes::RETURN_TABLE]+=param.getCodeDefinition(SchemaParser::XmlDefinition); else parameters.push_back(param); } @@ -1137,30 +1137,30 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) param_xmls.push_front(param.getCodeDefinition(SchemaParser::XmlDefinition)); } - attribs[ParsersAttributes::PARAMETERS]+=param_xmls.join(QChar('\n')); + attribs[Attributes::PARAMETERS]+=param_xmls.join(QChar('\n')); } //Case the function's language is C the symbol is the 'definition' attribute - if(getObjectName(attribs[ParsersAttributes::LANGUAGE])==~LanguageType("c")) + if(getObjectName(attribs[Attributes::LANGUAGE])==~LanguageType("c")) { - attribs[ParsersAttributes::SYMBOL]=attribs[ParsersAttributes::DEFINITION]; - attribs[ParsersAttributes::DEFINITION]=QString(); + attribs[Attributes::SYMBOL]=attribs[Attributes::DEFINITION]; + attribs[Attributes::DEFINITION]=QString(); } //Get the language reference code - attribs[ParsersAttributes::LANGUAGE]=getDependencyObject(attribs[ParsersAttributes::LANGUAGE], ObjectType::Language); + attribs[Attributes::LANGUAGE]=getDependencyObject(attribs[Attributes::LANGUAGE], ObjectType::Language); //Get the return type if there is no return table configured - if(attribs[ParsersAttributes::RETURN_TABLE].isEmpty()) + if(attribs[Attributes::RETURN_TABLE].isEmpty()) { /* If the function is to be used as a user-defined data type support functions the return type will be renamed to "any" (see rules on Type::setFunction()) */ - if(attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::INPUT_FUNC || - attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::RECV_FUNC || - attribs[ParsersAttributes::REF_TYPE]==ParsersAttributes::CanonicalFunc) - attribs[ParsersAttributes::RETURN_TYPE]=PgSqlType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); + if(attribs[Attributes::REF_TYPE]==Attributes::INPUT_FUNC || + attribs[Attributes::REF_TYPE]==Attributes::RECV_FUNC || + attribs[Attributes::REF_TYPE]==Attributes::CanonicalFunc) + attribs[Attributes::RETURN_TYPE]=PgSqlType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); else - attribs[ParsersAttributes::RETURN_TYPE]=getType(attribs[ParsersAttributes::RETURN_TYPE], true); + attribs[Attributes::RETURN_TYPE]=getType(attribs[Attributes::RETURN_TYPE], true); } loadObjectXML(ObjectType::Function, attribs); @@ -1182,11 +1182,11 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) try { unsigned lang_oid, func_oid; - QString func_types[]={ ParsersAttributes::VALIDATOR_FUNC, - ParsersAttributes::HANDLER_FUNC, - ParsersAttributes::INLINE_FUNC }; + QString func_types[]={ Attributes::VALIDATOR_FUNC, + Attributes::HANDLER_FUNC, + Attributes::INLINE_FUNC }; - lang_oid=attribs[ParsersAttributes::OID].toUInt(); + lang_oid=attribs[Attributes::OID].toUInt(); for(unsigned i=0; i < 3; i++) { func_oid=attribs[func_types[i]].toUInt(); @@ -1195,7 +1195,7 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) function is defined after the language pgModeler will raise errors so in order to continue the import these fuctions are simply ignored */ if(func_oid < lang_oid) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true , true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true , true, true, {{Attributes::REF_TYPE, func_types[i]}}); else attribs[func_types[i]]=QString(); } @@ -1240,54 +1240,54 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) vector elems; QStringList array_vals, list; - attribs[ParsersAttributes::FAMILY]=getObjectName(attribs[ParsersAttributes::FAMILY], true); - attribs[ParsersAttributes::TYPE]=getType(attribs[ParsersAttributes::TYPE], true, attribs); + attribs[Attributes::FAMILY]=getObjectName(attribs[Attributes::FAMILY], true); + attribs[Attributes::TYPE]=getType(attribs[Attributes::TYPE], true, attribs); //Generating attributes for STORAGE elements - if(attribs[ParsersAttributes::STORAGE]!=QString("0")) + if(attribs[Attributes::STORAGE]!=QString("0")) { - elem_attr[ParsersAttributes::STORAGE]=ParsersAttributes::True; - elem_attr[ParsersAttributes::DEFINITION]=getType(attribs[ParsersAttributes::STORAGE], true); + elem_attr[Attributes::STORAGE]=Attributes::True; + elem_attr[Attributes::DEFINITION]=getType(attribs[Attributes::STORAGE], true); elems.push_back(elem_attr); } - else if(attribs[ParsersAttributes::FUNCTION].isEmpty() && - attribs[ParsersAttributes::OPERATOR].isEmpty()) + else if(attribs[Attributes::FUNCTION].isEmpty() && + attribs[Attributes::OPERATOR].isEmpty()) { - elem_attr[ParsersAttributes::STORAGE]=ParsersAttributes::True; - elem_attr[ParsersAttributes::DEFINITION]=attribs[ParsersAttributes::TYPE]; + elem_attr[Attributes::STORAGE]=Attributes::True; + elem_attr[Attributes::DEFINITION]=attribs[Attributes::TYPE]; elems.push_back(elem_attr); } //Generating attributes for FUNCTION elements - if(!attribs[ParsersAttributes::FUNCTION].isEmpty()) + if(!attribs[Attributes::FUNCTION].isEmpty()) { elem_attr.clear(); - elem_attr[ParsersAttributes::FUNCTION]=ParsersAttributes::True; - array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::FUNCTION]); + elem_attr[Attributes::FUNCTION]=Attributes::True; + array_vals=Catalog::parseArrayValues(attribs[Attributes::FUNCTION]); for(int i=0; i < array_vals.size(); i++) { list=array_vals[i].split(':'); - elem_attr[ParsersAttributes::STRATEGY_NUM]=list[0]; - elem_attr[ParsersAttributes::DEFINITION]=getDependencyObject(list[1], ObjectType::Function, true); + elem_attr[Attributes::STRATEGY_NUM]=list[0]; + elem_attr[Attributes::DEFINITION]=getDependencyObject(list[1], ObjectType::Function, true); elems.push_back(elem_attr); } } //Generating attributes for OPERATOR elements - if(!attribs[ParsersAttributes::OPERATOR].isEmpty()) + if(!attribs[Attributes::OPERATOR].isEmpty()) { elem_attr.clear(); - elem_attr[ParsersAttributes::OPERATOR]=ParsersAttributes::True; - array_vals=Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATOR]); + elem_attr[Attributes::OPERATOR]=Attributes::True; + array_vals=Catalog::parseArrayValues(attribs[Attributes::OPERATOR]); for(int i=0; i < array_vals.size(); i++) { list=array_vals[i].split(':'); - elem_attr[ParsersAttributes::DEFINITION]=""; - elem_attr[ParsersAttributes::STRATEGY_NUM]=list[0]; - elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[1], ObjectType::Operator, true); - elem_attr[ParsersAttributes::DEFINITION]+=getDependencyObject(list[2], ObjectType::OpFamily, true); + elem_attr[Attributes::DEFINITION]=""; + elem_attr[Attributes::STRATEGY_NUM]=list[0]; + elem_attr[Attributes::DEFINITION]+=getDependencyObject(list[1], ObjectType::Operator, true); + elem_attr[Attributes::DEFINITION]+=getDependencyObject(list[2], ObjectType::OpFamily, true); elems.push_back(elem_attr); } } @@ -1296,7 +1296,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) for(unsigned i=0; i < elems.size(); i++) { schparser.ignoreUnkownAttributes(true); - attribs[ParsersAttributes::ELEMENTS]+=schparser.getCodeDefinition(ParsersAttributes::ELEMENT, elems[i], SchemaParser::XmlDefinition); + attribs[Attributes::ELEMENTS]+=schparser.getCodeDefinition(Attributes::ELEMENT, elems[i], SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); } @@ -1322,26 +1322,26 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) QRegExp regexp; QString op_signature, - func_types[]={ ParsersAttributes::OPERATOR_FUNC, - ParsersAttributes::RESTRICTION_FUNC, - ParsersAttributes::JOIN_FUNC }, + func_types[]={ Attributes::OPERATOR_FUNC, + Attributes::RESTRICTION_FUNC, + Attributes::JOIN_FUNC }, - arg_types[]= { ParsersAttributes::LEFT_TYPE, - ParsersAttributes::RIGHT_TYPE }, + arg_types[]= { Attributes::LEFT_TYPE, + Attributes::RIGHT_TYPE }, - op_types[]= { ParsersAttributes::COMMUTATOR_OP, - ParsersAttributes::NEGATOR_OP }; + op_types[]= { Attributes::CommutatorOp, + Attributes::NEGATOR_OP }; for(unsigned i=0; i < 3; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{Attributes::REF_TYPE, func_types[i]}}); for(unsigned i=0; i < 2; i++) - attribs[arg_types[i]]=getType(attribs[arg_types[i]], true, {{ParsersAttributes::REF_TYPE, arg_types[i]}}); + attribs[arg_types[i]]=getType(attribs[arg_types[i]], true, {{Attributes::REF_TYPE, arg_types[i]}}); - regexp.setPattern(ParsersAttributes::SIGNATURE + QString("(=)(\")")); + regexp.setPattern(Attributes::SIGNATURE + QString("(=)(\")")); for(unsigned i=0; i < 2; i++) { - attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjectType::Operator, true, false, true, {{ParsersAttributes::REF_TYPE, op_types[i]}}); + attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjectType::Operator, true, false, true, {{Attributes::REF_TYPE, op_types[i]}}); if(!attribs[op_types[i]].isEmpty()) { @@ -1395,9 +1395,9 @@ void DatabaseImportHelper::createCast(attribs_map &attribs) try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::Function, true); - attribs[ParsersAttributes::SOURCE_TYPE]=getType(attribs[ParsersAttributes::SOURCE_TYPE], true); - attribs[ParsersAttributes::DEST_TYPE]=getType(attribs[ParsersAttributes::DEST_TYPE], true); + attribs[Attributes::FUNCTION]=getDependencyObject(attribs[Attributes::FUNCTION], ObjectType::Function, true); + attribs[Attributes::SOURCE_TYPE]=getType(attribs[Attributes::SOURCE_TYPE], true); + attribs[Attributes::DEST_TYPE]=getType(attribs[Attributes::DEST_TYPE], true); loadObjectXML(ObjectType::Cast, attribs); cast=dbmodel->createCast(); dbmodel->addCast(cast); @@ -1416,7 +1416,7 @@ void DatabaseImportHelper::createConversion(attribs_map &attribs) try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::Function, true, auto_resolve_deps); + attribs[Attributes::FUNCTION]=getDependencyObject(attribs[Attributes::FUNCTION], ObjectType::Function, true, auto_resolve_deps); loadObjectXML(ObjectType::Conversion, attribs); conv=dbmodel->createConversion(); dbmodel->addConversion(conv); @@ -1436,13 +1436,13 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) try { - QStringList owner_col=attribs[ParsersAttributes::OWNER_COLUMN].split(':'), - seq_attribs=Catalog::parseArrayValues(attribs[ParsersAttributes::Attribute]); - QString attr[]={ ParsersAttributes::START, ParsersAttributes::MIN_VALUE, - ParsersAttributes::MAX_VALUE, ParsersAttributes::INCREMENT, - ParsersAttributes::Cache, ParsersAttributes::CYCLE }; + QStringList owner_col=attribs[Attributes::OWNER_COLUMN].split(':'), + seq_attribs=Catalog::parseArrayValues(attribs[Attributes::Attribute]); + QString attr[]={ Attributes::START, Attributes::MIN_VALUE, + Attributes::MAX_VALUE, Attributes::INCREMENT, + Attributes::Cache, Attributes::Cycle }; - attribs[ParsersAttributes::OWNER_COLUMN]=QString(); + attribs[Attributes::OWNER_COLUMN]=QString(); /* If there are owner columns and the oid of sequence is greater than the owner column's table oid stores the oid of both (sequence and table) in order to swap it's ids at the end of import to @@ -1452,17 +1452,17 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) Table *tab = nullptr; QString col_name, tab_name; attribs_map pos_attrib={ - { ParsersAttributes::X_POS, QString("0") }, - { ParsersAttributes::Y_POS, QString("0") }}; + { Attributes::X_POS, QString("0") }, + { Attributes::Y_POS, QString("0") }}; - if(attribs[ParsersAttributes::OID].toUInt() > owner_col[0].toUInt()) - seq_tab_swap[attribs[ParsersAttributes::OID]]=owner_col[0]; + if(attribs[Attributes::OID].toUInt() > owner_col[0].toUInt()) + seq_tab_swap[attribs[Attributes::OID]]=owner_col[0]; /* Get the table and the owner column instances so the sequence code can be disabled if the column is an identity one */ tab_name = getDependencyObject(owner_col[0], ObjectType::Table, true, auto_resolve_deps, false, - {{ ParsersAttributes::POSITION, - schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XmlDefinition)}}); + {{ Attributes::POSITION, + schparser.getCodeDefinition(Attributes::POSITION, pos_attrib, SchemaParser::XmlDefinition)}}); col_name=getColumnName(owner_col[0], owner_col[1]); tab = dbmodel->getTable(tab_name); @@ -1501,25 +1501,25 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) try { QStringList types; - QString func_types[]={ ParsersAttributes::TRANSITION_FUNC, - ParsersAttributes::FINAL_FUNC }, + QString func_types[]={ Attributes::TRANSITION_FUNC, + Attributes::FINAL_FUNC }, sch_name; for(unsigned i=0; i < 2; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, auto_resolve_deps, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, auto_resolve_deps, true, {{Attributes::REF_TYPE, func_types[i]}}); - types=getTypes(attribs[ParsersAttributes::TYPES], true); - attribs[ParsersAttributes::TYPES]=QString(); + types=getTypes(attribs[Attributes::TYPES], true); + attribs[Attributes::TYPES]=QString(); if(!types.isEmpty()) { for(int i=0; i < types.size(); i++) - attribs[ParsersAttributes::TYPES]+=types[i]; + attribs[Attributes::TYPES]+=types[i]; } - attribs[ParsersAttributes::STATE_TYPE]=getType(attribs[ParsersAttributes::STATE_TYPE], true, - {{ParsersAttributes::REF_TYPE, ParsersAttributes::STATE_TYPE}}); - attribs[ParsersAttributes::SORT_OP]=getDependencyObject(attribs[ParsersAttributes::SORT_OP], ObjectType::Operator, true); + attribs[Attributes::STATE_TYPE]=getType(attribs[Attributes::STATE_TYPE], true, + {{Attributes::REF_TYPE, Attributes::STATE_TYPE}}); + attribs[Attributes::SORT_OP]=getDependencyObject(attribs[Attributes::SORT_OP], ObjectType::Operator, true); loadObjectXML(ObjectType::Aggregate, attribs); agg=dbmodel->createAggregate(); @@ -1547,20 +1547,20 @@ void DatabaseImportHelper::createType(attribs_map &attribs) try { - attribs[attribs[ParsersAttributes::CONFIGURATION]]=ParsersAttributes::True; + attribs[attribs[Attributes::Configuration]]=Attributes::True; - if(!attribs[ParsersAttributes::ENUM_TYPE].isEmpty()) + if(!attribs[Attributes::ENUM_TYPE].isEmpty()) { - attribs[ParsersAttributes::ENUMERATIONS]=Catalog::parseArrayValues(attribs[ParsersAttributes::ENUMERATIONS]).join(','); - attribs[ParsersAttributes::ENUMERATIONS].remove('"'); + attribs[Attributes::ENUMERATIONS]=Catalog::parseArrayValues(attribs[Attributes::ENUMERATIONS]).join(','); + attribs[Attributes::ENUMERATIONS].remove('"'); } - else if(!attribs[ParsersAttributes::COMPOSITE_TYPE].isEmpty()) + else if(!attribs[Attributes::CompositeType].isEmpty()) { QStringList comp_attribs, values; TypeAttribute type_attrib; - comp_attribs=Catalog::parseArrayValues(attribs[ParsersAttributes::TYPE_ATTRIBUTE]); - attribs[ParsersAttributes::TYPE_ATTRIBUTE]=QString(); + comp_attribs=Catalog::parseArrayValues(attribs[Attributes::TYPE_ATTRIBUTE]); + attribs[Attributes::TYPE_ATTRIBUTE]=QString(); for(int i=0; i < comp_attribs.size(); i++) { @@ -1571,41 +1571,41 @@ void DatabaseImportHelper::createType(attribs_map &attribs) type_attrib.setName(values[0].remove('"')); type_attrib.setType(PgSqlType::parseString(values[1].remove('\\'))); type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjectType::Collation)); - attribs[ParsersAttributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XmlDefinition); + attribs[Attributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XmlDefinition); } } } - else if(!attribs[ParsersAttributes::RANGE_TYPE].isEmpty()) + else if(!attribs[Attributes::RANGE_TYPE].isEmpty()) { - QStringList range_attr=Catalog::parseArrayValues(attribs[ParsersAttributes::RANGE_ATTRIBS]); + QStringList range_attr=Catalog::parseArrayValues(attribs[Attributes::RANGE_ATTRIBS]); - attribs[ParsersAttributes::SUBTYPE]=getType(range_attr[0], true); - attribs[ParsersAttributes::COLLATION]=getDependencyObject(range_attr[1], ObjectType::Collation, true); - attribs[ParsersAttributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjectType::OpClass, true); - attribs[ParsersAttributes::CanonicalFunc]=getDependencyObject(range_attr[3], ObjectType::Function, true); - attribs[ParsersAttributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjectType::Function, true); + attribs[Attributes::SUBTYPE]=getType(range_attr[0], true); + attribs[Attributes::Collation]=getDependencyObject(range_attr[1], ObjectType::Collation, true); + attribs[Attributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjectType::OpClass, true); + attribs[Attributes::CanonicalFunc]=getDependencyObject(range_attr[3], ObjectType::Function, true); + attribs[Attributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjectType::Function, true); } else { - QString type_name=getObjectName(attribs[ParsersAttributes::OID]), - func_types[]={ ParsersAttributes::INPUT_FUNC, - ParsersAttributes::OUTPUT_FUNC, - ParsersAttributes::RECV_FUNC, - ParsersAttributes::SEND_FUNC, - ParsersAttributes::TPMOD_IN_FUNC, - ParsersAttributes::TPMOD_OUT_FUNC, - ParsersAttributes::AnalyzeFunc }; + QString type_name=getObjectName(attribs[Attributes::OID]), + func_types[]={ Attributes::INPUT_FUNC, + Attributes::OUTPUT_FUNC, + Attributes::RECV_FUNC, + Attributes::SEND_FUNC, + Attributes::TPMOD_IN_FUNC, + Attributes::TPMOD_OUT_FUNC, + Attributes::AnalyzeFunc }; unsigned i, count=sizeof(func_types)/sizeof(QString); - attribs[ParsersAttributes::ELEMENT]=getType(attribs[ParsersAttributes::ELEMENT], false); + attribs[Attributes::ELEMENT]=getType(attribs[Attributes::ELEMENT], false); /* Workaround: if importing a datatype that is part of an extension we avoid the importing of * its supporting functions (since they will not be necessary here because the type will be sql-disabled)*/ - if(!catalog.isExtensionObject(attribs[ParsersAttributes::OID].toUInt())) + if(!catalog.isExtensionObject(attribs[Attributes::OID].toUInt())) { for(i=0; i < count; i++) { - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{ParsersAttributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{Attributes::REF_TYPE, func_types[i]}}); /* Since pgModeler requires that type functions refers to the constructing type as "any" it's necessary to replace the function parameter types names */ @@ -1632,48 +1632,48 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) try { - unsigned tab_oid=attribs[ParsersAttributes::OID].toUInt(), type_oid=0, col_idx=0; + unsigned tab_oid=attribs[Attributes::OID].toUInt(), type_oid=0, col_idx=0; bool is_type_registered=false; Column col; vector inh_cols; QString type_def, unknown_obj_xml, type_name, def_val; map::iterator itr, itr1, itr_end; attribs_map pos_attrib={ - { ParsersAttributes::X_POS, QString("0") }, - { ParsersAttributes::Y_POS, QString("0") }}; + { Attributes::X_POS, QString("0") }, + { Attributes::Y_POS, QString("0") }}; - attribs[ParsersAttributes::COLUMNS]=QString(); - attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); + attribs[Attributes::Columns]=QString(); + attribs[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); //Retrieving columns if they were not retrieved yet - if(columns[attribs[ParsersAttributes::OID].toUInt()].empty() && auto_resolve_deps) + if(columns[attribs[Attributes::OID].toUInt()].empty() && auto_resolve_deps) { /* Since the schema name sometimes comes in form os tag it is needed extract only the name from before retrieve the columns of the table */ - QString sch_name=attribs[ParsersAttributes::SCHEMA]; + QString sch_name=attribs[Attributes::SCHEMA]; sch_name.replace(QRegExp(QString("(\\t)*(<)(schema)( )+(name)( )*(=)")), QString()); sch_name.replace(QRegExp(QString("(/)(>)(\n)*")), QString()); sch_name.replace('"', QString()); sch_name=sch_name.trimmed(); - retrieveTableColumns(sch_name, attribs[ParsersAttributes::NAME]); + retrieveTableColumns(sch_name, attribs[Attributes::NAME]); } - itr=itr1=columns[attribs[ParsersAttributes::OID].toUInt()].begin(); - itr_end=columns[attribs[ParsersAttributes::OID].toUInt()].end(); - attribs[ParsersAttributes::MAX_OBJ_COUNT]=QString::number(columns[attribs[ParsersAttributes::OID].toUInt()].size()); + itr=itr1=columns[attribs[Attributes::OID].toUInt()].begin(); + itr_end=columns[attribs[Attributes::OID].toUInt()].end(); + attribs[Attributes::MAX_OBJ_COUNT]=QString::number(columns[attribs[Attributes::OID].toUInt()].size()); //Creating columns while(itr!=itr_end) { - if(itr->second.count(ParsersAttributes::PERMISSION) && - !itr->second.at(ParsersAttributes::PERMISSION).isEmpty()) - col_perms[tab_oid].push_back(itr->second[ParsersAttributes::OID].toUInt()); + if(itr->second.count(Attributes::PERMISSION) && + !itr->second.at(Attributes::PERMISSION).isEmpty()) + col_perms[tab_oid].push_back(itr->second[Attributes::OID].toUInt()); - if(itr->second[ParsersAttributes::INHERITED]==ParsersAttributes::True) + if(itr->second[Attributes::INHERITED]==Attributes::True) inh_cols.push_back(col_idx); - col.setName(itr->second[ParsersAttributes::NAME]); - type_oid=itr->second[ParsersAttributes::TYPE_OID].toUInt(); + col.setName(itr->second[Attributes::NAME]); + type_oid=itr->second[Attributes::TYPE_OID].toUInt(); /* If the type has an entry on the types map and its OID is greater than system object oids, means that it's a user defined type, thus, there is the need to check if the type @@ -1682,25 +1682,25 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) { /* Building the type name prepending the schema name in order to search it on * the user defined types list at PgSQLType class */ - type_name=BaseObject::formatName(getObjectName(types[type_oid][ParsersAttributes::SCHEMA], true), false); + type_name=BaseObject::formatName(getObjectName(types[type_oid][Attributes::SCHEMA], true), false); type_name+=QString("."); - if(types[type_oid][ParsersAttributes::Category] == ~CategoryType(CategoryType::Array)) + if(types[type_oid][Attributes::Category] == ~CategoryType(CategoryType::Array)) { - int dim = types[type_oid][ParsersAttributes::NAME].count(QString("[]")); - QString aux_name = types[type_oid][ParsersAttributes::NAME].remove(QString("[]")); + int dim = types[type_oid][Attributes::NAME].count(QString("[]")); + QString aux_name = types[type_oid][Attributes::NAME].remove(QString("[]")); type_name+=BaseObject::formatName(aux_name, false); type_name+=QString("[]").repeated(dim); } else - type_name+=BaseObject::formatName(types[type_oid][ParsersAttributes::NAME], false); + type_name+=BaseObject::formatName(types[type_oid][Attributes::NAME], false); is_type_registered=PgSqlType::isRegistered(type_name, dbmodel); } else { is_type_registered=(types.count(type_oid)!=0); - type_name=itr->second[ParsersAttributes::TYPE]; + type_name=itr->second[Attributes::TYPE]; } /* Checking if the type used by the column exists (is registered), @@ -1709,23 +1709,23 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) the non-array type, this way, if the original type is created there is no need to create the array form */ if(auto_resolve_deps && !is_type_registered && !type_name.contains(QString("[]"))) { - type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::Type); + type_def=getDependencyObject(itr->second[Attributes::TYPE_OID], ObjectType::Type); unknown_obj_xml=UnkownObjectOidXml.arg(type_oid); /* If the type still doesn't exists means that the column maybe is referencing a domain this way pgModeler will try to retrieve the mentionend object */ if(type_def==unknown_obj_xml) - type_def=getDependencyObject(itr->second[ParsersAttributes::TYPE_OID], ObjectType::Domain); + type_def=getDependencyObject(itr->second[Attributes::TYPE_OID], ObjectType::Domain); } col.setIdentityType(BaseType::Null); col.setType(PgSqlType::parseString(type_name)); - col.setNotNull(!itr->second[ParsersAttributes::NOT_NULL].isEmpty()); - col.setComment(itr->second[ParsersAttributes::COMMENT]); + col.setNotNull(!itr->second[Attributes::NOT_NULL].isEmpty()); + col.setComment(itr->second[Attributes::Comment]); //Overriding the default value if the column is identity - if(!itr->second[ParsersAttributes::IDENTITY_TYPE].isEmpty()) - col.setIdentityType(itr->second[ParsersAttributes::IDENTITY_TYPE]); + if(!itr->second[Attributes::IDENTITY_TYPE].isEmpty()) + col.setIdentityType(itr->second[Attributes::IDENTITY_TYPE]); else { /* Removing extra/forced type casting in the retrieved default value. @@ -1741,7 +1741,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) varchar to character varying) we remove the '::character varying'. The idea here is to eliminate the cast if the casting is equivalent to the column type. */ - def_val = itr->second[ParsersAttributes::DEFAULT_VALUE]; + def_val = itr->second[Attributes::DEFAULT_VALUE]; if(!def_val.startsWith(QString("nextval(")) && def_val.contains(QString("::"))) { @@ -1758,11 +1758,11 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) } //Checking if the collation used by the column exists, if not it'll be created when auto_resolve_deps is checked - if(auto_resolve_deps && !itr->second[ParsersAttributes::COLLATION].isEmpty()) - getDependencyObject(itr->second[ParsersAttributes::COLLATION], ObjectType::Collation); + if(auto_resolve_deps && !itr->second[Attributes::Collation].isEmpty()) + getDependencyObject(itr->second[Attributes::Collation], ObjectType::Collation); - col.setCollation(dbmodel->getObject(getObjectName(itr->second[ParsersAttributes::COLLATION]),ObjectType::Collation)); - attribs[ParsersAttributes::COLUMNS]+=col.getCodeDefinition(SchemaParser::XmlDefinition); + col.setCollation(dbmodel->getObject(getObjectName(itr->second[Attributes::Collation]),ObjectType::Collation)); + attribs[Attributes::Columns]+=col.getCodeDefinition(SchemaParser::XmlDefinition); itr++; col_idx++; } @@ -1774,30 +1774,30 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) inherited_cols.push_back(table->getColumn(col_idx)); // Storing the partition bound expression temporarily in the table in order to configure the partition hierarchy later - table->setPartitionBoundingExpr(attribs[ParsersAttributes::PARTITION_BOUND_EXPR].remove(QRegExp("^(FOR)( )+(VALUES)( )*", Qt::CaseInsensitive))); + table->setPartitionBoundingExpr(attribs[Attributes::PARTITION_BOUND_EXPR].remove(QRegExp("^(FOR)( )+(VALUES)( )*", Qt::CaseInsensitive))); // Retrieving the partitioned table related to the partition table being created - if(!attribs[ParsersAttributes::PARTITIONED_TABLE].isEmpty()) + if(!attribs[Attributes::PARTITIONED_TABLE].isEmpty()) { Table *partitioned_tab = nullptr; - attribs[ParsersAttributes::PARTITIONED_TABLE] = - getDependencyObject(attribs[ParsersAttributes::PARTITIONED_TABLE], ObjectType::Table, true, auto_resolve_deps, false); + attribs[Attributes::PARTITIONED_TABLE] = + getDependencyObject(attribs[Attributes::PARTITIONED_TABLE], ObjectType::Table, true, auto_resolve_deps, false); - partitioned_tab = dbmodel->getTable(attribs[ParsersAttributes::PARTITIONED_TABLE]); + partitioned_tab = dbmodel->getTable(attribs[Attributes::PARTITIONED_TABLE]); table->setPartionedTable(partitioned_tab); if(!partitioned_tab) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::Table)) - .arg(attribs[ParsersAttributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjectType::Table)), + .arg(attribs[Attributes::NAME]).arg(BaseObject::getTypeName(ObjectType::Table)) + .arg(attribs[Attributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } // Creating partition keys if present - if(attribs[ParsersAttributes::IS_PARTITIONED] == ParsersAttributes::True) + if(attribs[Attributes::IS_PARTITIONED] == Attributes::True) { QStringList cols, collations, opclasses, exprs; PartitionKey part_key; @@ -1807,13 +1807,13 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) OperatorClass *opclass = nullptr; vector part_keys; - part_type = PartitioningType(attribs[ParsersAttributes::PARTITIONING]); + part_type = PartitioningType(attribs[Attributes::PARTITIONING]); table->setPartitioningType(part_type); - cols=Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLS]); - collations=Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_COLLS]); - opclasses=Catalog::parseArrayValues(attribs[ParsersAttributes::PART_KEY_OPCLS]); - exprs = parseIndexExpressions(attribs[ParsersAttributes::PART_KEY_EXPRS]); + cols=Catalog::parseArrayValues(attribs[Attributes::PART_KEY_COLS]); + collations=Catalog::parseArrayValues(attribs[Attributes::PART_KEY_COLLS]); + opclasses=Catalog::parseArrayValues(attribs[Attributes::PART_KEY_OPCLS]); + exprs = parseIndexExpressions(attribs[Attributes::PART_KEY_EXPRS]); for(int i = 0; i < cols.size(); i++) { @@ -1821,7 +1821,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) // Retrieving the column used by the partition key if(cols[i] != QString("0")) - part_key.setColumn(table->getColumn(getColumnName(attribs[ParsersAttributes::OID], cols[i]))); + part_key.setColumn(table->getColumn(getColumnName(attribs[Attributes::OID], cols[i]))); else if(!exprs.isEmpty()) { part_key.setExpression(exprs.front()); @@ -1874,14 +1874,14 @@ void DatabaseImportHelper::createView(attribs_map &attribs) try { - attribs_map pos_attrib={{ ParsersAttributes::X_POS, QString("0") }, - { ParsersAttributes::Y_POS, QString("0") }}; + attribs_map pos_attrib={{ Attributes::X_POS, QString("0") }, + { Attributes::Y_POS, QString("0") }}; - attribs[ParsersAttributes::POSITION]=schparser.getCodeDefinition(ParsersAttributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); + attribs[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); - ref=Reference(attribs[ParsersAttributes::DEFINITION], QString()); + ref=Reference(attribs[Attributes::DEFINITION], QString()); ref.setDefinitionExpression(true); - attribs[ParsersAttributes::REFERENCES]=ref.getXMLDefinition(); + attribs[Attributes::REFERENCES]=ref.getXMLDefinition(); loadObjectXML(ObjectType::View, attribs); view=dbmodel->createView(); @@ -1900,7 +1900,7 @@ void DatabaseImportHelper::createView(attribs_map &attribs) void DatabaseImportHelper::createRule(attribs_map &attribs) { Rule *rule=nullptr; - QString cmds=attribs[ParsersAttributes::COMMANDS]; + QString cmds=attribs[Attributes::Commands]; int start=-1; QRegExp cond_regexp(QString("(WHERE)(.)+(DO)")); ObjectType table_type=ObjectType::Table; @@ -1910,16 +1910,16 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) start=cond_regexp.indexIn(cmds); if(start >=0) { - attribs[ParsersAttributes::CONDITION]=cmds.mid(start, cond_regexp.matchedLength()); - attribs[ParsersAttributes::CONDITION].remove(QRegExp(QString("(DO)|(WHERE)"))); + attribs[Attributes::Condition]=cmds.mid(start, cond_regexp.matchedLength()); + attribs[Attributes::Condition].remove(QRegExp(QString("(DO)|(WHERE)"))); } - attribs[ParsersAttributes::COMMANDS]=Catalog::parseRuleCommands(attribs[ParsersAttributes::COMMANDS]).join(';'); + attribs[Attributes::Commands]=Catalog::parseRuleCommands(attribs[Attributes::Commands]).join(';'); - if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::View)) + if(attribs[Attributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::View)) table_type=ObjectType::View; - attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); + attribs[Attributes::TABLE]=getDependencyObject(attribs[Attributes::TABLE], table_type, true, auto_resolve_deps, false); loadObjectXML(ObjectType::Rule, attribs); rule=dbmodel->createRule(); @@ -1938,12 +1938,12 @@ void DatabaseImportHelper::createTrigger(attribs_map &attribs) { ObjectType table_type=ObjectType::Table; - if(attribs[ParsersAttributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::View)) + if(attribs[Attributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::View)) table_type=ObjectType::View; - attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], table_type, true, auto_resolve_deps, false); - attribs[ParsersAttributes::TRIGGER_FUNC]=getDependencyObject(attribs[ParsersAttributes::TRIGGER_FUNC], ObjectType::Function, true, true); - attribs[ParsersAttributes::Arguments]=Catalog::parseArrayValues(attribs[ParsersAttributes::Arguments].remove(QString(",\"\""))).join(','); + attribs[Attributes::TABLE]=getDependencyObject(attribs[Attributes::TABLE], table_type, true, auto_resolve_deps, false); + attribs[Attributes::TRIGGER_FUNC]=getDependencyObject(attribs[Attributes::TRIGGER_FUNC], ObjectType::Function, true, true); + attribs[Attributes::Arguments]=Catalog::parseArrayValues(attribs[Attributes::Arguments].remove(QString(",\"\""))).join(','); loadObjectXML(ObjectType::Trigger, attribs); dbmodel->createTrigger(); @@ -2010,26 +2010,26 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) QString tab_name, coll_name, opc_name; int i; - attribs[ParsersAttributes::FACTOR]=QString("90"); - tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); + attribs[Attributes::FACTOR]=QString("90"); + tab_name=getDependencyObject(attribs[Attributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::Table)); if(!parent_tab) { - tab_name=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::View, true, auto_resolve_deps, false); + tab_name=getDependencyObject(attribs[Attributes::TABLE], ObjectType::View, true, auto_resolve_deps, false); parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::View)); if(!parent_tab) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[ParsersAttributes::NAME]).arg(BaseObject::getTypeName(ObjectType::Index)) + .arg(attribs[Attributes::NAME]).arg(BaseObject::getTypeName(ObjectType::Index)) .arg(tab_name).arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - cols=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]); - collations=Catalog::parseArrayValues(attribs[ParsersAttributes::COLLATIONS]); - opclasses=Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES]); - exprs = parseIndexExpressions(attribs[ParsersAttributes::EXPRESSIONS]); + cols=Catalog::parseArrayValues(attribs[Attributes::Columns]); + collations=Catalog::parseArrayValues(attribs[Attributes::Collations]); + opclasses=Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES]); + exprs = parseIndexExpressions(attribs[Attributes::EXPRESSIONS]); for(i=0; i < cols.size(); i++) { @@ -2038,9 +2038,9 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(cols[i]!=QString("0")) { if(parent_tab->getObjectType() == ObjectType::Table) - elem.setColumn(dynamic_cast
(parent_tab)->getColumn(getColumnName(attribs[ParsersAttributes::TABLE], cols[i]))); + elem.setColumn(dynamic_cast
(parent_tab)->getColumn(getColumnName(attribs[Attributes::TABLE], cols[i]))); else - elem.setExpression(getColumnName(attribs[ParsersAttributes::TABLE], cols[i])); + elem.setExpression(getColumnName(attribs[Attributes::TABLE], cols[i])); } else if(!exprs.isEmpty()) { @@ -2069,10 +2069,10 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) } if(elem.getColumn() || !elem.getExpression().isEmpty()) - attribs[ParsersAttributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); + attribs[Attributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); } - attribs[ParsersAttributes::TABLE]=tab_name; + attribs[Attributes::TABLE]=tab_name; loadObjectXML(ObjectType::Index, attribs); dbmodel->createIndex(); } @@ -2089,26 +2089,26 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) try { - QString table_oid=attribs[ParsersAttributes::TABLE], - ref_tab_oid=attribs[ParsersAttributes::REF_TABLE], + QString table_oid=attribs[Attributes::TABLE], + ref_tab_oid=attribs[Attributes::REF_TABLE], tab_name; Table *table=nullptr; //If the table oid is 0 indicates that the constraint is part of a data type like domains if(!table_oid.isEmpty() && table_oid!=QString("0")) { - QStringList factor=Catalog::parseArrayValues(attribs[ParsersAttributes::FACTOR]); + QStringList factor=Catalog::parseArrayValues(attribs[Attributes::FACTOR]); //Retrieving the table is it was not imported yet and auto_resolve_deps is true tab_name=getDependencyObject(table_oid, ObjectType::Table, true, auto_resolve_deps, false); if(!factor.isEmpty() && factor[0].startsWith(QString("fillfactor="))) - attribs[ParsersAttributes::FACTOR]=factor[0].remove(QString("fillfactor=")); + attribs[Attributes::FACTOR]=factor[0].remove(QString("fillfactor=")); - attribs[attribs[ParsersAttributes::TYPE]]=ParsersAttributes::True; + attribs[attribs[Attributes::TYPE]]=Attributes::True; table=dynamic_cast
(dbmodel->getObject(tab_name, ObjectType::Table)); - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::EX_CONSTR) + if(attribs[Attributes::TYPE]==Attributes::EX_CONSTR) { QStringList cols, opclasses, opers, exprs; ExcludeElement elem; @@ -2116,12 +2116,12 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) OperatorClass *opclass=nullptr; Operator *oper=nullptr; - attribs[ParsersAttributes::SRC_COLUMNS]=QString(); - attribs[ParsersAttributes::EXPRESSION]=attribs[ParsersAttributes::CONDITION]; + attribs[Attributes::SRC_COLUMNS]=QString(); + attribs[Attributes::EXPRESSION]=attribs[Attributes::Condition]; - cols=Catalog::parseArrayValues(attribs[ParsersAttributes::COLUMNS]); - opers=Catalog::parseArrayValues(attribs[ParsersAttributes::OPERATORS]); - opclasses=Catalog::parseArrayValues(attribs[ParsersAttributes::OP_CLASSES]); + cols=Catalog::parseArrayValues(attribs[Attributes::Columns]); + opers=Catalog::parseArrayValues(attribs[Attributes::OPERATORS]); + opclasses=Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES]); /* Due to the way exclude constraints are constructed (similar to indexes), * we get the constraint's definition in for of expressions. Internally we use pg_get_constraintdef. @@ -2129,8 +2129,8 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) * which we work to separate column only references from complex expression. Only complex expression will be used * and assigned to their exclude constraint elements. Column references are used in exclude elements but relying in * the cols list above */ - exprs=attribs[ParsersAttributes::EXPRESSIONS] - .replace(QString("EXCLUDE USING %1 (").arg(attribs[ParsersAttributes::INDEX_TYPE]), QString()) + exprs=attribs[Attributes::EXPRESSIONS] + .replace(QString("EXCLUDE USING %1 (").arg(attribs[Attributes::INDEX_TYPE]), QString()) .split(QRegExp("(WITH )(\\+|\\-|\\*|\\/|\\<|\\>|\\=|\\~|\\!|\\@|\\#|\\%|\\^|\\&|\\||\\'|\\?)+((,)?|(\\))?)"), QString::SkipEmptyParts); @@ -2163,21 +2163,21 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) elem.setOperator(oper); } - attribs[ParsersAttributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); + attribs[Attributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); } } else { //Clears the tablespace attribute when the constraint is fk avoiding errors - if(attribs[ParsersAttributes::TYPE]==ParsersAttributes::FK_CONSTR) - attribs[ParsersAttributes::TABLESPACE]=QString(); + if(attribs[Attributes::TYPE]==Attributes::FK_CONSTR) + attribs[Attributes::TABLESPACE]=QString(); - attribs[ParsersAttributes::SRC_COLUMNS]=getColumnNames(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::SRC_COLUMNS]).join(','); + attribs[Attributes::SRC_COLUMNS]=getColumnNames(attribs[Attributes::TABLE], attribs[Attributes::SRC_COLUMNS]).join(','); } - attribs[ParsersAttributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjectType::Table, false, true, false); - attribs[ParsersAttributes::DST_COLUMNS]=getColumnNames(ref_tab_oid, attribs[ParsersAttributes::DST_COLUMNS]).join(','); - attribs[ParsersAttributes::TABLE]=tab_name; + attribs[Attributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjectType::Table, false, true, false); + attribs[Attributes::DST_COLUMNS]=getColumnNames(ref_tab_oid, attribs[Attributes::DST_COLUMNS]).join(','); + attribs[Attributes::TABLE]=tab_name; loadObjectXML(ObjectType::Constraint, attribs); constr=dbmodel->createConstraint(nullptr); @@ -2200,8 +2200,8 @@ void DatabaseImportHelper::createPolicy(attribs_map &attribs) { try { - attribs[ParsersAttributes::TABLE]=getDependencyObject(attribs[ParsersAttributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); - attribs[ParsersAttributes::ROLES]=getObjectNames(attribs[ParsersAttributes::ROLES]).join(','); + attribs[Attributes::TABLE]=getDependencyObject(attribs[Attributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); + attribs[Attributes::ROLES]=getObjectNames(attribs[Attributes::ROLES]).join(','); loadObjectXML(ObjectType::Policy, attribs); dbmodel->createPolicy(); } @@ -2216,12 +2216,12 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) { try { - attribs[ParsersAttributes::FUNCTION]=getDependencyObject(attribs[ParsersAttributes::FUNCTION], ObjectType::Function, true, true); - attribs[ParsersAttributes::FILTER]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") - .arg(ParsersAttributes::FILTER) - .arg(ParsersAttributes::VARIABLE).arg(ParsersAttributes::TAG.toUpper()) - .arg(ParsersAttributes::VALUES) - .arg(Catalog::parseArrayValues(attribs[ParsersAttributes::VALUES].remove('"')).join(',')); + attribs[Attributes::FUNCTION]=getDependencyObject(attribs[Attributes::FUNCTION], ObjectType::Function, true, true); + attribs[Attributes::FILTER]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") + .arg(Attributes::FILTER) + .arg(Attributes::VARIABLE).arg(Attributes::TAG.toUpper()) + .arg(Attributes::VALUES) + .arg(Catalog::parseArrayValues(attribs[Attributes::VALUES].remove('"')).join(',')); loadObjectXML(ObjectType::EventTrigger, attribs); dbmodel->addEventTrigger(dbmodel->createEventTrigger()); @@ -2235,7 +2235,7 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) void DatabaseImportHelper::createPermission(attribs_map &attribs) { - ObjectType obj_type=static_cast(attribs[ParsersAttributes::OBJECT_TYPE].toUInt()); + ObjectType obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); Permission *perm=nullptr; QString sig; @@ -2249,7 +2249,7 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) Table *table=nullptr; //Parses the permissions vector string - perm_list=Catalog::parseArrayValues(attribs[ParsersAttributes::PERMISSION]); + perm_list=Catalog::parseArrayValues(attribs[Attributes::PERMISSION]); if(!perm_list.isEmpty()) { @@ -2259,15 +2259,15 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) object=dbmodel; else { - sig=getObjectName(attribs[ParsersAttributes::OID], true); - object=dbmodel->getObject(getObjectName(attribs[ParsersAttributes::OID], true), obj_type); + sig=getObjectName(attribs[Attributes::OID], true); + object=dbmodel->getObject(getObjectName(attribs[Attributes::OID], true), obj_type); } } else { //If the object is column it's necessary to retrive the parent table to get the valid reference to column - table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[ParsersAttributes::TABLE]), ObjectType::Table)); - object=table->getObject(getColumnName(attribs[ParsersAttributes::TABLE], attribs[ParsersAttributes::OID]), ObjectType::Column); + table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[Attributes::TABLE]), ObjectType::Table)); + object=table->getObject(getColumnName(attribs[Attributes::TABLE], attribs[Attributes::OID]), ObjectType::Column); } } @@ -2507,13 +2507,13 @@ void DatabaseImportHelper::__createTableInheritances(void) { //Get the list of parent table's oids oid=(*itr); - inh_list=Catalog::parseArrayValues(user_objs[oid][ParsersAttributes::PARENTS]); + inh_list=Catalog::parseArrayValues(user_objs[oid][Attributes::PARENTS]); itr++; if(!inh_list.isEmpty()) { //Get the child table resolving it's name from the oid - child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][ParsersAttributes::OID]), ObjectType::Table)); + child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][Attributes::OID]), ObjectType::Table)); while(!inh_list.isEmpty()) { @@ -2560,7 +2560,7 @@ void DatabaseImportHelper::configureDatabase(attribs_map &attribs) { try { - attribs[ParsersAttributes::AppendAtEod]=QString(); + attribs[Attributes::AppendAtEod]=QString(); loadObjectXML(ObjectType::Database, attribs); dbmodel->configureDatabase(attribs); } @@ -2592,12 +2592,12 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f else { QString sch_name, - obj_name=obj_attr[ParsersAttributes::NAME]; - ObjectType obj_type=static_cast(obj_attr[ParsersAttributes::OBJECT_TYPE].toUInt()); + obj_name=obj_attr[Attributes::NAME]; + ObjectType obj_type=static_cast(obj_attr[Attributes::OBJECT_TYPE].toUInt()); //If the object accepts an schema retrieve the schema name too if(BaseObject::acceptsSchema(obj_type)) - sch_name=getObjectName(obj_attr[ParsersAttributes::SCHEMA]); + sch_name=getObjectName(obj_attr[Attributes::SCHEMA]); if(!sch_name.isEmpty()) obj_name.prepend(sch_name + QString(".")); @@ -2609,8 +2609,8 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f if(obj_type==ObjectType::Function) { - QStringList arg_types=getTypes(obj_attr[ParsersAttributes::ArgTypes], false), - arg_modes=Catalog::parseArrayValues(obj_attr[ParsersAttributes::ArgModes]); + QStringList arg_types=getTypes(obj_attr[Attributes::ArgTypes], false), + arg_modes=Catalog::parseArrayValues(obj_attr[Attributes::ArgModes]); for(int i=0; i < arg_types.size(); i++) { @@ -2629,26 +2629,26 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f } else if(obj_type==ObjectType::Aggregate) { - QStringList params=getTypes(obj_attr[ParsersAttributes::TYPES], false); + QStringList params=getTypes(obj_attr[Attributes::TYPES], false); if(params.isEmpty()) params.push_back(QString("*")); } else if(obj_type==ObjectType::Operator) { - if(obj_attr[ParsersAttributes::LEFT_TYPE].toUInt() > 0) - params.push_back(getType(obj_attr[ParsersAttributes::LEFT_TYPE], false)); + if(obj_attr[Attributes::LEFT_TYPE].toUInt() > 0) + params.push_back(getType(obj_attr[Attributes::LEFT_TYPE], false)); else params.push_back(QString("NONE")); - if(obj_attr[ParsersAttributes::RIGHT_TYPE].toUInt() > 0) - params.push_back(getType(obj_attr[ParsersAttributes::RIGHT_TYPE], false)); + if(obj_attr[Attributes::RIGHT_TYPE].toUInt() > 0) + params.push_back(getType(obj_attr[Attributes::RIGHT_TYPE], false)); else params.push_back(QString("NONE")); } else { - obj_name += QString(" USING %1").arg(obj_attr[ParsersAttributes::INDEX_TYPE]); + obj_name += QString(" USING %1").arg(obj_attr[Attributes::INDEX_TYPE]); } if(obj_type != ObjectType::OpFamily && obj_type != ObjectType::OpClass) @@ -2683,7 +2683,7 @@ QString DatabaseImportHelper::getColumnName(const QString &tab_oid_str, const QS if(prepend_tab_name) col_name=getObjectName(tab_oid_str) + QString("."); - col_name+=columns[tab_oid][col_id].at(ParsersAttributes::NAME); + col_name+=columns[tab_oid][col_id].at(Attributes::NAME); } return(col_name); @@ -2707,7 +2707,7 @@ QStringList DatabaseImportHelper::getColumnNames(const QString &tab_oid_str, con col_id=col_ids[i].toUInt(); if(columns[tab_oid].count(col_id)) - col_names.push_back(tab_name + columns[tab_oid][col_id].at(ParsersAttributes::NAME)); + col_names.push_back(tab_name + columns[tab_oid][col_id].at(Attributes::NAME)); } } @@ -2721,7 +2721,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, attribs_map type_attr; QString xml_def, sch_name, obj_name, aux_name; unsigned type_oid=oid_str.toUInt(), elem_tp_oid = 0, - dimension=0, object_id=type_attr[ParsersAttributes::OBJECT_ID].toUInt(); + dimension=0, object_id=type_attr[Attributes::OBJECT_ID].toUInt(); bool is_derivated_from_obj = false; if(type_oid > 0) @@ -2730,39 +2730,39 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, type_attr=types[type_oid]; //Special treatment for array types. Removes the [] descriptor when generating XML code for the type - if(!type_attr.empty() && type_attr[ParsersAttributes::Category]==QString("A") && - type_attr[ParsersAttributes::NAME].contains(QString("[]"))) + if(!type_attr.empty() && type_attr[Attributes::Category]==QString("A") && + type_attr[Attributes::NAME].contains(QString("[]"))) { - obj_name=type_attr[ParsersAttributes::NAME]; - elem_tp_oid=type_attr[ParsersAttributes::ELEMENT].toUInt(); + obj_name=type_attr[Attributes::NAME]; + elem_tp_oid=type_attr[Attributes::ELEMENT].toUInt(); if(generate_xml) { - dimension=type_attr[ParsersAttributes::NAME].count(QString("[]")); + dimension=type_attr[Attributes::NAME].count(QString("[]")); obj_name.remove(QString("[]")); } } else - obj_name=type_attr[ParsersAttributes::NAME]; + obj_name=type_attr[Attributes::NAME]; /* If the type was generated from a table/sequence/view/domain and the source object is not yet imported and the auto resolve deps is enabled, we need to import it */ - if(!type_attr[ParsersAttributes::TYPE_CLASS].isEmpty() && auto_resolve_deps && + if(!type_attr[Attributes::TYPE_CLASS].isEmpty() && auto_resolve_deps && (!user_objs.count(object_id) && !system_objs.count(object_id))) { ObjectType obj_type; - if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::Table)) + if(type_attr[Attributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::Table)) obj_type=ObjectType::Table; - else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::View)) + else if(type_attr[Attributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::View)) obj_type=ObjectType::View; - else if(type_attr[ParsersAttributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::Domain)) + else if(type_attr[Attributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::Domain)) obj_type=ObjectType::Domain; else obj_type=ObjectType::Sequence; is_derivated_from_obj = true; - getDependencyObject(type_attr[ParsersAttributes::OBJECT_ID], obj_type, true, true, false); + getDependencyObject(type_attr[Attributes::OBJECT_ID], obj_type, true, true, false); } /* Removing the optional modifier "without time zone" from date/time types. @@ -2773,7 +2773,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, /* Prepend the schema name only if it is not a system schema ('pg_catalog' or 'information_schema') and if the schema's names is already present in the type's name (in case of table types) */ - sch_name=getObjectName(type_attr[ParsersAttributes::SCHEMA]); + sch_name=getObjectName(type_attr[Attributes::SCHEMA]); if(!sch_name.isEmpty() && ((sch_name!=QString("pg_catalog") && sch_name!=QString("information_schema")) || type_oid > catalog.getLastSysObjectOID()) && @@ -2788,7 +2788,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, type_oid > catalog.getLastSysObjectOID() && !dbmodel->getType(aux_name)) { //If the type is not an array one we simply use the current type attributes map - if(type_attr[ParsersAttributes::Category] != QString("A")) + if(type_attr[Attributes::Category] != QString("A")) createObject(type_attr); /* In case the type is an array one we should use the oid held by "element" attribute to create the type related to current one */ @@ -2798,11 +2798,11 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, if(generate_xml) { - extra_attribs[ParsersAttributes::NAME]=obj_name; - extra_attribs[ParsersAttributes::DIMENSION]=(dimension > 0 ? QString::number(dimension) : QString()); + extra_attribs[Attributes::NAME]=obj_name; + extra_attribs[Attributes::DIMENSION]=(dimension > 0 ? QString::number(dimension) : QString()); schparser.ignoreUnkownAttributes(true); - xml_def=schparser.getCodeDefinition(ParsersAttributes::PGSQL_BASE_TYPE, extra_attribs, SchemaParser::XmlDefinition); + xml_def=schparser.getCodeDefinition(Attributes::PGSQL_BASE_TYPE, extra_attribs, SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); } else diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 9b72a349cd..0012837036 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -300,8 +300,8 @@ void DataManipulationForm::listColumns(void) for(auto &col : cols) { - col_names.push_back(col[ParsersAttributes::NAME]); - code_compl_wgt->insertCustomItem(col[ParsersAttributes::NAME], {}, + col_names.push_back(col[Attributes::NAME]); + code_compl_wgt->insertCustomItem(col[Attributes::NAME], {}, QPixmap(PgModelerUiNs::getIconPath("column"))); } @@ -735,14 +735,14 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin { catalog.setConnection(conn); //Retrieving the constraints from catalog using a custom filter to select only primary keys (contype=p) - pks=catalog.getObjectsAttributes(ObjectType::Constraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='p'")}}); + pks=catalog.getObjectsAttributes(ObjectType::Constraint, schema, table, {}, {{Attributes::CustomFilter, QString("contype='p'")}}); warning_frm->setVisible(pks.empty()); if(pks.empty()) warning_lbl->setText(trUtf8("The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. WARNING: those operations can affect more than one row.")); else - table_oid = pks[0][ParsersAttributes::TABLE].toUInt(); + table_oid = pks[0][Attributes::TABLE].toUInt(); } hint_frm->setVisible(obj_type==ObjectType::Table); @@ -751,7 +751,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin if(!pks.empty()) { - QStringList col_str_ids=Catalog::parseArrayValues(pks[0][ParsersAttributes::COLUMNS]); + QStringList col_str_ids=Catalog::parseArrayValues(pks[0][Attributes::Columns]); vector col_ids; for(QString id : col_str_ids) @@ -760,7 +760,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin columns=catalog.getObjectsAttributes(ObjectType::Column, schema, table, col_ids); for(auto &col : columns) - pk_col_names.push_back(col[ParsersAttributes::NAME]); + pk_col_names.push_back(col[Attributes::NAME]); } catalog.closeConnection(); @@ -800,8 +800,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin catalog.setConnection(conn); //Retrieving the constraints from catalog using a custom filter to select only foreign keys (contype=f) - fks=catalog.getObjectsAttributes(ObjectType::Constraint, schema, table, {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f'")}}); - ref_fks=catalog.getObjectsAttributes(ObjectType::Constraint, QString(), QString(), {}, {{ParsersAttributes::CUSTOM_FILTER, QString("contype='f' AND cs.confrelid=%1").arg(table_oid)}}); + fks=catalog.getObjectsAttributes(ObjectType::Constraint, schema, table, {}, {{Attributes::CustomFilter, QString("contype='f'")}}); + ref_fks=catalog.getObjectsAttributes(ObjectType::Constraint, QString(), QString(), {}, {{Attributes::CustomFilter, QString("contype='f' AND cs.confrelid=%1").arg(table_oid)}}); if(!fks.empty() || !ref_fks.empty()) { @@ -819,45 +819,45 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &fk : fks) { - aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[ParsersAttributes::REF_TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[ParsersAttributes::SCHEMA].toUInt()); + aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::REF_TABLE].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") - .arg(aux_schema[ParsersAttributes::NAME]) - .arg(aux_table[ParsersAttributes::NAME]) - .arg(fk[ParsersAttributes::NAME]); + .arg(aux_schema[Attributes::NAME]) + .arg(aux_table[Attributes::NAME]) + .arg(fk[Attributes::NAME]); //Store the referenced schema and table names - fk_infos[fk_name][ParsersAttributes::REF_TABLE] = aux_table[ParsersAttributes::NAME]; - fk_infos[fk_name][ParsersAttributes::SCHEMA] = aux_schema[ParsersAttributes::NAME]; + fk_infos[fk_name][Attributes::REF_TABLE] = aux_table[Attributes::NAME]; + fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::NAME]; action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), - QString("%1.%2 (%3)").arg(aux_schema[ParsersAttributes::NAME]) - .arg(aux_table[ParsersAttributes::NAME]) - .arg(fk[ParsersAttributes::NAME]), this, SLOT(browseReferencedTable())); + QString("%1.%2 (%3)").arg(aux_schema[Attributes::NAME]) + .arg(aux_table[Attributes::NAME]) + .arg(fk[Attributes::NAME]), this, SLOT(browseReferencedTable())); action->setData(fk_name); col_ids.clear(); name_list.clear(); //Storing the source columns in a string - for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::SRC_COLUMNS])) + for(QString id : Catalog::parseArrayValues(fk[Attributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, schema, table, col_ids)) - name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); + name_list.push_back(BaseObject::formatName(col[Attributes::NAME])); - fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); + fk_infos[fk_name][Attributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); col_ids.clear(); name_list.clear(); //Storing the referenced columns in a string - for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::DST_COLUMNS])) + for(QString id : Catalog::parseArrayValues(fk[Attributes::DST_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) - name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); + for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[Attributes::NAME], aux_table[Attributes::NAME], col_ids)) + name_list.push_back(BaseObject::formatName(col[Attributes::NAME])); - fk_infos[fk_name][ParsersAttributes::DST_COLUMNS] = name_list.join(Table::DataSeparator); + fk_infos[fk_name][Attributes::DST_COLUMNS] = name_list.join(Table::DataSeparator); } submenu = new QMenu(this); @@ -871,29 +871,29 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin col_ids.clear(); name_list.clear(); - aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[ParsersAttributes::TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[ParsersAttributes::SCHEMA].toUInt()); + aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::TABLE].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") - .arg(aux_schema[ParsersAttributes::NAME]) - .arg(aux_table[ParsersAttributes::NAME]) - .arg(fk[ParsersAttributes::NAME]); + .arg(aux_schema[Attributes::NAME]) + .arg(aux_table[Attributes::NAME]) + .arg(fk[Attributes::NAME]); //Storing the source columns in a string - for(QString id : Catalog::parseArrayValues(fk[ParsersAttributes::SRC_COLUMNS])) + for(QString id : Catalog::parseArrayValues(fk[Attributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[ParsersAttributes::NAME], aux_table[ParsersAttributes::NAME], col_ids)) - name_list.push_back(BaseObject::formatName(col[ParsersAttributes::NAME])); + for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[Attributes::NAME], aux_table[Attributes::NAME], col_ids)) + name_list.push_back(BaseObject::formatName(col[Attributes::NAME])); action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), - QString("%1.%2 (%3)").arg(aux_schema[ParsersAttributes::NAME]) - .arg(aux_table[ParsersAttributes::NAME]) - .arg(fk[ParsersAttributes::NAME]), this, SLOT(browseReferrerTable())); + QString("%1.%2 (%3)").arg(aux_schema[Attributes::NAME]) + .arg(aux_table[Attributes::NAME]) + .arg(fk[Attributes::NAME]), this, SLOT(browseReferrerTable())); action->setData(fk_name); - ref_fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); - ref_fk_infos[fk_name][ParsersAttributes::TABLE] = aux_table[ParsersAttributes::NAME]; - ref_fk_infos[fk_name][ParsersAttributes::SCHEMA] = aux_schema[ParsersAttributes::NAME]; + ref_fk_infos[fk_name][Attributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); + ref_fk_infos[fk_name][Attributes::TABLE] = aux_table[Attributes::NAME]; + ref_fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::NAME]; } } @@ -1147,16 +1147,16 @@ void DataManipulationForm::browseTable(const QString &fk_name, bool browse_ref_t if(browse_ref_tab) { src_cols = pk_col_names; - ref_cols = ref_fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS].split(Table::DataSeparator); - schema = ref_fk_infos[fk_name][ParsersAttributes::SCHEMA]; - table = ref_fk_infos[fk_name][ParsersAttributes::TABLE]; + ref_cols = ref_fk_infos[fk_name][Attributes::SRC_COLUMNS].split(Table::DataSeparator); + schema = ref_fk_infos[fk_name][Attributes::SCHEMA]; + table = ref_fk_infos[fk_name][Attributes::TABLE]; } else { - src_cols = fk_infos[fk_name][ParsersAttributes::SRC_COLUMNS].split(Table::DataSeparator); - ref_cols = fk_infos[fk_name][ParsersAttributes::DST_COLUMNS].split(Table::DataSeparator); - schema = fk_infos[fk_name][ParsersAttributes::SCHEMA]; - table = fk_infos[fk_name][ParsersAttributes::REF_TABLE]; + src_cols = fk_infos[fk_name][Attributes::SRC_COLUMNS].split(Table::DataSeparator); + ref_cols = fk_infos[fk_name][Attributes::DST_COLUMNS].split(Table::DataSeparator); + schema = fk_infos[fk_name][Attributes::SCHEMA]; + table = fk_infos[fk_name][Attributes::REF_TABLE]; } for(QString col_name : src_cols) diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 4f2cf9552d..f612047581 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -83,10 +83,10 @@ void EventTriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_l event_cmb->setCurrentText(~event_trig->getEvent()); function_sel->setSelectedObject(event_trig->getFunction()); - QStringList filter=event_trig->getFilter(ParsersAttributes::TAG.toUpper()); + QStringList filter=event_trig->getFilter(Attributes::TAG.toUpper()); if(filter.isEmpty()) - filter=event_trig->getFilter(ParsersAttributes::TAG); + filter=event_trig->getFilter(Attributes::TAG); filter_tab->blockSignals(true); @@ -118,7 +118,7 @@ void EventTriggerWidget::applyConfiguration(void) event_trig->clearFilter(); for(unsigned row=0; row < filter_tab->getRowCount(); row++) - event_trig->setFilter(ParsersAttributes::TAG.toUpper(), filter_tab->getCellText(row, 0)); + event_trig->setFilter(Attributes::TAG.toUpper(), filter_tab->getCellText(row, 0)); finishConfiguration(); } diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index e7e421a712..47b1360084 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -92,45 +92,45 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa connect(save_restore_geometry_chk, SIGNAL(toggled(bool)), reset_sizes_tb, SLOT(setEnabled(bool))); connect(reset_sizes_tb, SIGNAL(clicked(bool)), this, SLOT(resetDialogsSizes())); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::GRID_SIZE]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AutoSaveInterval]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_TYPE]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_MARGIN]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_CUSTOM_SIZE]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::File]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_REL_NAME]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_EXT_ATTRIBS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_TABLE_TAGS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::FILE_ASSOCIATED]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CanvasCornerMove]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::INVERT_RANGESEL_TRIGGER]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CheckUpdate]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_LAST_POSITION]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_MAIN_MENU]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISABLE_SMOOTHNESS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SIMPLIFIED_OBJ_CREATION]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CONFIRM_VALIDATION]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_MAIN_MENU]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeCompletion]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISPLAY_LINE_NUMBERS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_COLOR]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_BG_COLOR]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_HIGHLIGHT_COLOR]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIGHLIGHT_LINES]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MIN_OBJECT_OPACITY]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HISTORY_MAX_LENGTH]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_APP]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes:: SAVE_RESTORE_GEOMETRY]=QString(); + config_params[Attributes::Configuration][Attributes::GRID_SIZE]=QString(); + config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]=QString(); + config_params[Attributes::Configuration][Attributes::AutoSaveInterval]=QString(); + config_params[Attributes::Configuration][Attributes::PAPER_TYPE]=QString(); + config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]=QString(); + config_params[Attributes::Configuration][Attributes::PAPER_MARGIN]=QString(); + config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE]=QString(); + config_params[Attributes::Configuration][Attributes::File]=QString(); + config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); + config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]=QString(); + config_params[Attributes::Configuration][Attributes::PRINT_GRID]=QString(); + config_params[Attributes::Configuration][Attributes::HIDE_REL_NAME]=QString(); + config_params[Attributes::Configuration][Attributes::HIDE_EXT_ATTRIBS]=QString(); + config_params[Attributes::Configuration][Attributes::HIDE_TABLE_TAGS]=QString(); + config_params[Attributes::Configuration][Attributes::FILE_ASSOCIATED]=QString(); + config_params[Attributes::Configuration][Attributes::CodeFont]=QString(); + config_params[Attributes::Configuration][Attributes::CodeFontSize]=QString(); + config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=QString(); + config_params[Attributes::Configuration][Attributes::INVERT_RANGESEL_TRIGGER]=QString(); + config_params[Attributes::Configuration][Attributes::CheckUpdate]=QString(); + config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]=QString(); + config_params[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]=QString(); + config_params[Attributes::Configuration][Attributes::DISABLE_SMOOTHNESS]=QString(); + config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]=QString(); + config_params[Attributes::Configuration][Attributes::ConfirmValidation]=QString(); + config_params[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]=QString(); + config_params[Attributes::Configuration][Attributes::CodeCompletion]=QString(); + config_params[Attributes::Configuration][Attributes::DISPLAY_LINE_NUMBERS]=QString(); + config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]=QString(); + config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]=QString(); + config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]=QString(); + config_params[Attributes::Configuration][Attributes::HIGHLIGHT_LINES]=QString(); + config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=QString(); + config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY]=QString(); + config_params[Attributes::Configuration][Attributes::HISTORY_MAX_LENGTH]=QString(); + config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]=QString(); + config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]=QString(); + config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=QString(); + config_params[Attributes::Configuration][Attributes:: SAVE_RESTORE_GEOMETRY]=QString(); simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this); simp_obj_creation_ht->setText(simple_obj_creation_chk->statusTip()); @@ -268,15 +268,15 @@ void GeneralConfigWidget::loadConfiguration(void) for(QWidget *wgt : child_wgts) wgt->blockSignals(true); - key_attribs.push_back(ParsersAttributes::ID); + key_attribs.push_back(Attributes::ID); BaseConfigWidget::loadConfiguration(GlobalAttributes::GeneralConf, config_params, key_attribs); - grid_size_spb->setValue((config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::GRID_SIZE]).toUInt()); - oplist_size_spb->setValue((config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]).toUInt()); - history_max_length_spb->setValue(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HISTORY_MAX_LENGTH].toUInt()); + grid_size_spb->setValue((config_params[Attributes::Configuration][Attributes::GRID_SIZE]).toUInt()); + oplist_size_spb->setValue((config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]).toUInt()); + history_max_length_spb->setValue(config_params[Attributes::Configuration][Attributes::HISTORY_MAX_LENGTH].toUInt()); - interv=(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AutoSaveInterval]).toUInt(); - tab_width=(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeTabWidth]).toInt(); + interv=(config_params[Attributes::Configuration][Attributes::AutoSaveInterval]).toUInt(); + tab_width=(config_params[Attributes::Configuration][Attributes::CodeTabWidth]).toInt(); autosave_interv_chk->setChecked(interv > 0); autosave_interv_spb->setValue(interv); @@ -286,28 +286,28 @@ void GeneralConfigWidget::loadConfiguration(void) tab_width_spb->setEnabled(tab_width_chk->isChecked()); tab_width_spb->setValue(tab_width); - corner_move_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CanvasCornerMove]==ParsersAttributes::True); - invert_rangesel_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::INVERT_RANGESEL_TRIGGER]==ParsersAttributes::True); - check_upd_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CheckUpdate]==ParsersAttributes::True); - save_last_pos_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_LAST_POSITION]==ParsersAttributes::True); - disable_smooth_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISABLE_SMOOTHNESS]==ParsersAttributes::True); - simple_obj_creation_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SIMPLIFIED_OBJ_CREATION]==ParsersAttributes::True); - confirm_validation_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CONFIRM_VALIDATION]==ParsersAttributes::True); - code_completion_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeCompletion]==ParsersAttributes::True); - use_placeholders_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]==ParsersAttributes::True); - use_curved_lines_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]==ParsersAttributes::True); + corner_move_chk->setChecked(config_params[Attributes::Configuration][Attributes::CanvasCornerMove]==Attributes::True); + invert_rangesel_chk->setChecked(config_params[Attributes::Configuration][Attributes::INVERT_RANGESEL_TRIGGER]==Attributes::True); + check_upd_chk->setChecked(config_params[Attributes::Configuration][Attributes::CheckUpdate]==Attributes::True); + save_last_pos_chk->setChecked(config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]==Attributes::True); + disable_smooth_chk->setChecked(config_params[Attributes::Configuration][Attributes::DISABLE_SMOOTHNESS]==Attributes::True); + simple_obj_creation_chk->setChecked(config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]==Attributes::True); + confirm_validation_chk->setChecked(config_params[Attributes::Configuration][Attributes::ConfirmValidation]==Attributes::True); + code_completion_chk->setChecked(config_params[Attributes::Configuration][Attributes::CodeCompletion]==Attributes::True); + use_placeholders_chk->setChecked(config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]==Attributes::True); + use_curved_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]==Attributes::True); - print_grid_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]==ParsersAttributes::True); - print_pg_num_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]==ParsersAttributes::True); + print_grid_chk->setChecked(config_params[Attributes::Configuration][Attributes::PRINT_GRID]==Attributes::True); + print_pg_num_chk->setChecked(config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]==Attributes::True); - paper_cmb->setCurrentIndex((config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_TYPE]).toUInt()); - portrait_rb->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]==ParsersAttributes::PORTRAIT); - landscape_rb->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]==ParsersAttributes::LANDSCAPE); + paper_cmb->setCurrentIndex((config_params[Attributes::Configuration][Attributes::PAPER_TYPE]).toUInt()); + portrait_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::PORTRAIT); + landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::LANDSCAPE); - min_obj_opacity_spb->setValue(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MIN_OBJECT_OPACITY].toUInt()); + min_obj_opacity_spb->setValue(config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY].toUInt()); - margin=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_MARGIN].split(','); - custom_size=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_CUSTOM_SIZE].split(','); + margin=config_params[Attributes::Configuration][Attributes::PAPER_MARGIN].split(','); + custom_size=config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE].split(','); left_marg->setValue((margin.count() >= 4 ? margin[0].toDouble() : 2)); top_marg->setValue((margin.count()>= 4 ? margin[1].toDouble() : 2)); @@ -317,25 +317,25 @@ void GeneralConfigWidget::loadConfiguration(void) width_spb->setValue((custom_size.count() >= 2 ? custom_size[0].toDouble() : 500)); height_spb->setValue((custom_size.count() >= 2 ? custom_size[1].toDouble() : 500)); - hide_ext_attribs_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_EXT_ATTRIBS]==ParsersAttributes::True); - hide_rel_name_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_REL_NAME]==ParsersAttributes::True); - hide_table_tags_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_TABLE_TAGS]==ParsersAttributes::True); + hide_ext_attribs_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIDE_EXT_ATTRIBS]==Attributes::True); + hide_rel_name_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIDE_REL_NAME]==Attributes::True); + hide_table_tags_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIDE_TABLE_TAGS]==Attributes::True); - font_cmb->setCurrentFont(QFont(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont])); - font_size_spb->setValue(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize].toDouble()); - disp_line_numbers_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISPLAY_LINE_NUMBERS]==ParsersAttributes::True); - hightlight_lines_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIGHLIGHT_LINES]==ParsersAttributes::True); - line_numbers_cp->setColor(0, config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_COLOR]); - line_numbers_bg_cp->setColor(0, config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_BG_COLOR]); - line_highlight_cp->setColor(0, config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_HIGHLIGHT_COLOR]); + font_cmb->setCurrentFont(QFont(config_params[Attributes::Configuration][Attributes::CodeFont])); + font_size_spb->setValue(config_params[Attributes::Configuration][Attributes::CodeFontSize].toDouble()); + disp_line_numbers_chk->setChecked(config_params[Attributes::Configuration][Attributes::DISPLAY_LINE_NUMBERS]==Attributes::True); + hightlight_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIGHLIGHT_LINES]==Attributes::True); + line_numbers_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]); + line_numbers_bg_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]); + line_highlight_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]); - source_editor_edt->setText(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_APP]); - source_editor_args_edt->setText(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_ARGS]); + source_editor_edt->setText(config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]); + source_editor_args_edt->setText(config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_ARGS]); - save_restore_geometry_chk->setChecked(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]==ParsersAttributes::True); + save_restore_geometry_chk->setChecked(config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY]==Attributes::True); reset_sizes_tb->setEnabled(save_restore_geometry_chk->isChecked()); - int ui_idx = ui_language_cmb->findData(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]); + int ui_idx = ui_language_cmb->findData(config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]); ui_language_cmb->setCurrentIndex(ui_idx >= 0 ? ui_idx : 0); for(QWidget *wgt : child_wgts) @@ -344,14 +344,14 @@ void GeneralConfigWidget::loadConfiguration(void) widgets_geom.clear(); for(auto itr : config_params) { - if(itr.second.count(ParsersAttributes::X_POS)) + if(itr.second.count(Attributes::X_POS)) { - x = itr.second[ParsersAttributes::X_POS].toInt(); - y = itr.second[ParsersAttributes::Y_POS].toInt(); - w = itr.second[ParsersAttributes::WIDTH].toInt(); - h = itr.second[ParsersAttributes::HEIGHT].toInt(); + x = itr.second[Attributes::X_POS].toInt(); + y = itr.second[Attributes::Y_POS].toInt(); + w = itr.second[Attributes::WIDTH].toInt(); + h = itr.second[Attributes::HEIGHT].toInt(); widgets_geom[itr.first].geometry = QRect(QPoint(x,y), QSize(w, h)); - widgets_geom[itr.first].maximized = itr.second[ParsersAttributes::MAXIMIZED] == ParsersAttributes::True; + widgets_geom[itr.first].maximized = itr.second[Attributes::MAXIMIZED] == Attributes::True; } } @@ -406,7 +406,7 @@ QString GeneralConfigWidget::getConfigurationParam(const QString §ion_id, co void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { if(!widget || - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::True) + config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY] != Attributes::True) return; QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; @@ -418,7 +418,7 @@ void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &cus bool GeneralConfigWidget::restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { if(!widget || - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY] != ParsersAttributes::True) + config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY] != Attributes::True) return(false); QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; @@ -457,104 +457,104 @@ void GeneralConfigWidget::saveConfiguration(void) file_sch=root_dir + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - ParsersAttributes::File + + Attributes::File + GlobalAttributes::SchemaExt; widget_sch=root_dir + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - ParsersAttributes::WIDGET + + Attributes::WIDGET + GlobalAttributes::SchemaExt; - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::GRID_SIZE]=QString::number(grid_size_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::OP_LIST_SIZE]=QString::number(oplist_size_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AutoSaveInterval]=QString::number(autosave_interv_chk->isChecked() ? autosave_interv_spb->value() : 0); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_TYPE]=QString::number(paper_cmb->currentIndex()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_ORIENTATION]=(portrait_rb->isChecked() ? ParsersAttributes::PORTRAIT : ParsersAttributes::LANDSCAPE); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CanvasCornerMove]=(corner_move_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::INVERT_RANGESEL_TRIGGER]=(invert_rangesel_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CheckUpdate]=(check_upd_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_LAST_POSITION]=(save_last_pos_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISABLE_SMOOTHNESS]=(disable_smooth_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SIMPLIFIED_OBJ_CREATION]=(simple_obj_creation_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CONFIRM_VALIDATION]=(confirm_validation_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeCompletion]=(code_completion_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeTabWidth]=QString::number(tab_width_chk->isChecked() ? tab_width_spb->value() : 0); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::MIN_OBJECT_OPACITY]=QString::number(min_obj_opacity_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HISTORY_MAX_LENGTH]=QString::number(history_max_length_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[Attributes::Configuration][Attributes::GRID_SIZE]=QString::number(grid_size_spb->value()); + config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]=QString::number(oplist_size_spb->value()); + config_params[Attributes::Configuration][Attributes::AutoSaveInterval]=QString::number(autosave_interv_chk->isChecked() ? autosave_interv_spb->value() : 0); + config_params[Attributes::Configuration][Attributes::PAPER_TYPE]=QString::number(paper_cmb->currentIndex()); + config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]=(portrait_rb->isChecked() ? Attributes::PORTRAIT : Attributes::LANDSCAPE); + config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=(corner_move_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::INVERT_RANGESEL_TRIGGER]=(invert_rangesel_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::CheckUpdate]=(check_upd_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]=(save_last_pos_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::DISABLE_SMOOTHNESS]=(disable_smooth_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]=(simple_obj_creation_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::ConfirmValidation]=(confirm_validation_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::CodeCompletion]=(code_completion_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::CodeTabWidth]=QString::number(tab_width_chk->isChecked() ? tab_width_spb->value() : 0); + config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY]=QString::number(min_obj_opacity_spb->value()); + config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HISTORY_MAX_LENGTH]=QString::number(history_max_length_spb->value()); + config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? Attributes::True : QString()); ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]=(show_grid ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]=(show_delim ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AlignObjsToGrid]=(align_grid ? ParsersAttributes::True : QString()); + config_params[Attributes::Configuration][Attributes::SHOW_CANVAS_GRID]=(show_grid ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::SHOW_PAGE_DELIMITERS]=(show_delim ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::AlignObjsToGrid]=(align_grid ? Attributes::True : QString()); unity_cmb->setCurrentIndex(UnitMilimeters); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_MARGIN]=QString("%1,%2,%3,%4").arg(left_marg->value()) + config_params[Attributes::Configuration][Attributes::PAPER_MARGIN]=QString("%1,%2,%3,%4").arg(left_marg->value()) .arg(top_marg->value()) .arg(right_marg->value()) .arg(bottom_marg->value()); if(paper_cmb->currentIndex()!=paper_cmb->count()-1) - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_CUSTOM_SIZE]=QString(); + config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE]=QString(); else - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PAPER_CUSTOM_SIZE]=QString("%1,%2").arg(width_spb->value()).arg(height_spb->value()); + config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE]=QString("%1,%2").arg(width_spb->value()).arg(height_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_PG_NUM]=(print_pg_num_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::PRINT_GRID]=(print_grid_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]=(print_pg_num_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::PRINT_GRID]=(print_grid_chk->isChecked() ? Attributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_EXT_ATTRIBS]=(hide_ext_attribs_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_REL_NAME]=(hide_rel_name_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIDE_TABLE_TAGS]=(hide_table_tags_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HIDE_EXT_ATTRIBS]=(hide_ext_attribs_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HIDE_REL_NAME]=(hide_rel_name_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HIDE_TABLE_TAGS]=(hide_table_tags_chk->isChecked() ? Attributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont]=font_cmb->currentText(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize]=QString::number(font_size_spb->value()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DISPLAY_LINE_NUMBERS]=(disp_line_numbers_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::HIGHLIGHT_LINES]=(hightlight_lines_chk->isChecked() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_COLOR]=line_numbers_cp->getColor(0).name(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_NUMBERS_BG_COLOR]=line_numbers_bg_cp->getColor(0).name(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::LINE_HIGHLIGHT_COLOR]=line_highlight_cp->getColor(0).name(); + config_params[Attributes::Configuration][Attributes::CodeFont]=font_cmb->currentText(); + config_params[Attributes::Configuration][Attributes::CodeFontSize]=QString::number(font_size_spb->value()); + config_params[Attributes::Configuration][Attributes::DISPLAY_LINE_NUMBERS]=(disp_line_numbers_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HIGHLIGHT_LINES]=(hightlight_lines_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]=line_numbers_cp->getColor(0).name(); + config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]=line_numbers_bg_cp->getColor(0).name(); + config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]=line_highlight_cp->getColor(0).name(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_APP]=source_editor_edt->text(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SOURCE_EDITOR_ARGS]=source_editor_args_edt->text(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::UI_LANGUAGE]=ui_language_cmb->currentData().toString(); + config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]=source_editor_edt->text(); + config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_ARGS]=source_editor_args_edt->text(); + config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]=ui_language_cmb->currentData().toString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]=(BaseObjectView::isCompactViewEnabled() ? ParsersAttributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SAVE_RESTORE_GEOMETRY]=(save_restore_geometry_chk->isChecked() ? ParsersAttributes::True : QString()); + config_params[Attributes::Configuration][Attributes::CompactView]=(BaseObjectView::isCompactViewEnabled() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY]=(save_restore_geometry_chk->isChecked() ? Attributes::True : QString()); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::File]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); + config_params[Attributes::Configuration][Attributes::File]=QString(); + config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); itr=config_params.begin(); itr_end=config_params.end(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DOCK_WIDGETS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGETS_GEOMETRY]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]=QString(); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::File]=QString(); + config_params[Attributes::Configuration][Attributes::DOCK_WIDGETS]=QString(); + config_params[Attributes::Configuration][Attributes::WIDGETS_GEOMETRY]=QString(); + config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); + config_params[Attributes::Configuration][Attributes::File]=QString(); while(itr!=itr_end) { //Checking if the current attribute is a file to be stored in a tag - if((itr->first).contains(QRegExp(QString("(") + ParsersAttributes::File + QString(")([0-9]+)")))) + if((itr->first).contains(QRegExp(QString("(") + Attributes::File + QString(")([0-9]+)")))) { - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::File]+= + config_params[Attributes::Configuration][Attributes::File]+= schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } //Checking if the current attribute is a file to be stored in a tag - else if((itr->first).contains(QRegExp(QString("(") + ParsersAttributes::RECENT + QString(")([0-9]+)")))) + else if((itr->first).contains(QRegExp(QString("(") + Attributes::RECENT + QString(")([0-9]+)")))) { - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::RECENT_MODELS]+= + config_params[Attributes::Configuration][Attributes::RECENT_MODELS]+= schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } - else if(itr->first==ParsersAttributes::VALIDATOR || - itr->first==ParsersAttributes::OBJECT_FINDER || - itr->first==ParsersAttributes::SQL_TOOL) + else if(itr->first==Attributes::VALIDATOR || + itr->first==Attributes::OBJECT_FINDER || + itr->first==Attributes::SQL_TOOL) { schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::DOCK_WIDGETS]+= + config_params[Attributes::Configuration][Attributes::DOCK_WIDGETS]+= schparser.getCodeDefinition(widget_sch, itr->second); schparser.ignoreUnkownAttributes(false); schparser.ignoreEmptyAttributes(false); @@ -567,15 +567,15 @@ void GeneralConfigWidget::saveConfiguration(void) { for(auto &itr : widgets_geom) { - attribs[ParsersAttributes::ID] = itr.first; - attribs[ParsersAttributes::X_POS] = QString::number(itr.second.geometry.left()); - attribs[ParsersAttributes::Y_POS] = QString::number(itr.second.geometry.top()); - attribs[ParsersAttributes::WIDTH] = QString::number(itr.second.geometry.width()); - attribs[ParsersAttributes::HEIGHT] = QString::number(itr.second.geometry.height()); - attribs[ParsersAttributes::MAXIMIZED] = itr.second.maximized ? ParsersAttributes::True : QString(); + attribs[Attributes::ID] = itr.first; + attribs[Attributes::X_POS] = QString::number(itr.second.geometry.left()); + attribs[Attributes::Y_POS] = QString::number(itr.second.geometry.top()); + attribs[Attributes::WIDTH] = QString::number(itr.second.geometry.width()); + attribs[Attributes::HEIGHT] = QString::number(itr.second.geometry.height()); + attribs[Attributes::MAXIMIZED] = itr.second.maximized ? Attributes::True : QString(); schparser.ignoreUnkownAttributes(true); - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::WIDGETS_GEOMETRY]+= + config_params[Attributes::Configuration][Attributes::WIDGETS_GEOMETRY]+= schparser.getCodeDefinition(widget_sch, attribs); schparser.ignoreUnkownAttributes(false); } @@ -593,7 +593,7 @@ void GeneralConfigWidget::applyConfiguration(void) { int unit=unity_cmb->currentIndex(); QFont fnt; - double fnt_size=config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize].toDouble(); + double fnt_size=config_params[Attributes::Configuration][Attributes::CodeFontSize].toDouble(); if(fnt_size < 5.0f) fnt_size=5.0f; @@ -612,9 +612,9 @@ void GeneralConfigWidget::applyConfiguration(void) ObjectsScene::setInvertRangeSelectionTrigger(invert_rangesel_chk->isChecked()); ObjectsScene::setGridSize(grid_size_spb->value()); - ObjectsScene::setGridOptions(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]==ParsersAttributes::True, - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::AlignObjsToGrid]==ParsersAttributes::True, - config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]==ParsersAttributes::True); + ObjectsScene::setGridOptions(config_params[Attributes::Configuration][Attributes::SHOW_CANVAS_GRID]==Attributes::True, + config_params[Attributes::Configuration][Attributes::AlignObjsToGrid]==Attributes::True, + config_params[Attributes::Configuration][Attributes::SHOW_PAGE_DELIMITERS]==Attributes::True); OperationList::setMaximumSize(oplist_size_spb->value()); BaseTableView::setHideExtAttributes(hide_ext_attribs_chk->isChecked()); @@ -629,7 +629,7 @@ void GeneralConfigWidget::applyConfiguration(void) BaseObjectView::setPlaceholderEnabled(use_placeholders_chk->isChecked()); SQLExecutionWidget::setSQLHistoryMaxLength(history_max_length_spb->value()); - fnt.setFamily(config_params[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont]); + fnt.setFamily(config_params[Attributes::Configuration][Attributes::CodeFont]); fnt.setPointSize(fnt_size); NumberedTextEditor::setLineNumbersVisible(disp_line_numbers_chk->isChecked()); NumberedTextEditor::setLineHighlightColor(line_highlight_cp->getColor(0)); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 0235e60a30..7f035e2a12 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -93,19 +93,19 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par while(itr!=itr_end) { attribs=itr->second; - if(attribs.count(ParsersAttributes::PATH)!=0) + if(attribs.count(Attributes::PATH)!=0) { try { //Storing the file of a previous session - if(itr->first.contains(ParsersAttributes::File) && - !attribs[ParsersAttributes::PATH].isEmpty()) - prev_session_files.push_back(attribs[ParsersAttributes::PATH]); + if(itr->first.contains(Attributes::File) && + !attribs[Attributes::PATH].isEmpty()) + prev_session_files.push_back(attribs[Attributes::PATH]); //Creating the recent models menu - else if(itr->first.contains(ParsersAttributes::RECENT) && - !attribs[ParsersAttributes::PATH].isEmpty()) - recent_models.push_back(attribs[ParsersAttributes::PATH]); + else if(itr->first.contains(Attributes::RECENT) && + !attribs[Attributes::PATH].isEmpty()) + recent_models.push_back(attribs[Attributes::PATH]); } catch(Exception &e) { @@ -396,17 +396,17 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par #ifndef Q_OS_MAC //Restoring the canvas grid options - action_show_grid->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID]==ParsersAttributes::True); - action_alin_objs_grade->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::AlignObjsToGrid]==ParsersAttributes::True); - action_show_delimiters->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS]==ParsersAttributes::True); - action_compact_view->setChecked(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::COMPACT_VIEW]==ParsersAttributes::True); + action_show_grid->setChecked(confs[Attributes::Configuration][Attributes::SHOW_CANVAS_GRID]==Attributes::True); + action_alin_objs_grade->setChecked(confs[Attributes::Configuration][Attributes::AlignObjsToGrid]==Attributes::True); + action_show_delimiters->setChecked(confs[Attributes::Configuration][Attributes::SHOW_PAGE_DELIMITERS]==Attributes::True); + action_compact_view->setChecked(confs[Attributes::Configuration][Attributes::CompactView]==Attributes::True); ObjectsScene::setGridOptions(action_show_grid->isChecked(), action_alin_objs_grade->isChecked(), action_show_delimiters->isChecked()); //Hiding/showing the main menu bar depending on the retrieved conf - main_menu_mb->setVisible(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_MAIN_MENU]==ParsersAttributes::True); + main_menu_mb->setVisible(confs[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]==Attributes::True); if(main_menu_mb->isVisible()) file_menu->addAction(action_hide_main_menu); @@ -429,7 +429,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par #warning "NO UPDATE CHECK: Update checking is disabled." #else //Enabling update check at startup - if(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CheckUpdate]==ParsersAttributes::True) + if(confs[Attributes::Configuration][Attributes::CheckUpdate]==Attributes::True) QTimer::singleShot(10000, update_notifier_wgt, SLOT(checkForUpdate())); #endif @@ -657,16 +657,16 @@ void MainWindow::closeEvent(QCloseEvent *event) conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); confs=conf_wgt->getConfigurationParams(); - attribs[ParsersAttributes::COMPACT_VIEW]=action_compact_view->isChecked() ? ParsersAttributes::True : QString(); - attribs[ParsersAttributes::SHOW_MAIN_MENU]=main_menu_mb->isVisible() ? ParsersAttributes::True : QString(); + attribs[Attributes::CompactView]=action_compact_view->isChecked() ? Attributes::True : QString(); + attribs[Attributes::SHOW_MAIN_MENU]=main_menu_mb->isVisible() ? Attributes::True : QString(); - conf_wgt->addConfigurationParam(ParsersAttributes::CONFIGURATION, attribs); + conf_wgt->addConfigurationParam(Attributes::Configuration, attribs); attribs.clear(); count=models_tbw->count(); //Remove the references to old session - conf_wgt->removeConfigurationParam(QRegExp(QString("(%1)([0-9])+").arg(ParsersAttributes::File))); + conf_wgt->removeConfigurationParam(QRegExp(QString("(%1)([0-9])+").arg(Attributes::File))); //Saving the session for(i=0; i < count; i++) @@ -675,9 +675,9 @@ void MainWindow::closeEvent(QCloseEvent *event) if(!model->getFilename().isEmpty()) { - param_id=QString("%1%2").arg(ParsersAttributes::File).arg(i); - attribs[ParsersAttributes::ID]=param_id; - attribs[ParsersAttributes::PATH]=model->getFilename(); + param_id=QString("%1%2").arg(Attributes::File).arg(i); + attribs[Attributes::ID]=param_id; + attribs[Attributes::PATH]=model->getFilename(); conf_wgt->addConfigurationParam(param_id, attribs); attribs.clear(); } @@ -692,9 +692,9 @@ void MainWindow::closeEvent(QCloseEvent *event) while(!recent_models.isEmpty()) { - param_id=QString("%1%2").arg(ParsersAttributes::RECENT).arg(QString::number(i++).rightJustified(2, '0')); - attribs[ParsersAttributes::ID]=param_id; - attribs[ParsersAttributes::PATH]=recent_models.front(); + param_id=QString("%1%2").arg(Attributes::RECENT).arg(QString::number(i++).rightJustified(2, '0')); + attribs[Attributes::ID]=param_id; + attribs[Attributes::PATH]=recent_models.front(); conf_wgt->addConfigurationParam(param_id, attribs); attribs.clear(); recent_models.pop_front(); @@ -1146,9 +1146,9 @@ void MainWindow::setGridOptions(void) action_alin_objs_grade->isChecked(), action_show_delimiters->isChecked()); - attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::AlignObjsToGrid] = (action_alin_objs_grade->isChecked() ? ParsersAttributes::True : ParsersAttributes::False); - attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_CANVAS_GRID] = (action_show_grid->isChecked() ? ParsersAttributes::True : ParsersAttributes::False); - attribs[ParsersAttributes::CONFIGURATION][ParsersAttributes::SHOW_PAGE_DELIMITERS] = (action_show_delimiters->isChecked() ? ParsersAttributes::True : ParsersAttributes::False); + attribs[Attributes::Configuration][Attributes::AlignObjsToGrid] = (action_alin_objs_grade->isChecked() ? Attributes::True : Attributes::False); + attribs[Attributes::Configuration][Attributes::SHOW_CANVAS_GRID] = (action_show_grid->isChecked() ? Attributes::True : Attributes::False); + attribs[Attributes::Configuration][Attributes::SHOW_PAGE_DELIMITERS] = (action_show_delimiters->isChecked() ? Attributes::True : Attributes::False); if(current_model) { @@ -1165,7 +1165,7 @@ void MainWindow::setGridOptions(void) current_model->scene->update(); } - conf_wgt->addConfigurationParam(ParsersAttributes::CONFIGURATION, attribs[ParsersAttributes::CONFIGURATION]); + conf_wgt->addConfigurationParam(Attributes::Configuration, attribs[Attributes::Configuration]); } void MainWindow::applyZoom(void) @@ -1831,26 +1831,26 @@ void MainWindow::storeDockWidgetsSettings(void) GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); attribs_map params; - params[ParsersAttributes::VALIDATOR]=ParsersAttributes::True; - params[ParsersAttributes::SQL_VALIDATION]=(model_valid_wgt->sql_validation_chk->isChecked() ? ParsersAttributes::True : QString()); - params[ParsersAttributes::USE_UNIQUE_NAMES]=(model_valid_wgt->use_tmp_names_chk->isChecked() ? ParsersAttributes::True : QString()); - params[ParsersAttributes::PGSQL_VERSION]=model_valid_wgt->version_cmb->currentText(); - conf_wgt->addConfigurationParam(ParsersAttributes::VALIDATOR, params); + params[Attributes::VALIDATOR]=Attributes::True; + params[Attributes::SQL_VALIDATION]=(model_valid_wgt->sql_validation_chk->isChecked() ? Attributes::True : QString()); + params[Attributes::USE_UNIQUE_NAMES]=(model_valid_wgt->use_tmp_names_chk->isChecked() ? Attributes::True : QString()); + params[Attributes::PGSQL_VERSION]=model_valid_wgt->version_cmb->currentText(); + conf_wgt->addConfigurationParam(Attributes::VALIDATOR, params); params.clear(); - params[ParsersAttributes::OBJECT_FINDER]=ParsersAttributes::True; - params[ParsersAttributes::SELECT_OBJECTS]=(obj_finder_wgt->select_btn->isChecked() ? ParsersAttributes::True : QString()); - params[ParsersAttributes::FADEIN_OBJECTS]=(obj_finder_wgt->fade_btn->isChecked() ? ParsersAttributes::True : QString()); - params[ParsersAttributes::REGULAR_EXP]=(obj_finder_wgt->regexp_chk->isChecked() ? ParsersAttributes::True : QString()); - params[ParsersAttributes::CaseSensitive]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? ParsersAttributes::True : QString()); - params[ParsersAttributes::EXACT_MATCH]=(obj_finder_wgt->exact_match_chk->isChecked() ? ParsersAttributes::True : QString()); - conf_wgt->addConfigurationParam(ParsersAttributes::OBJECT_FINDER, params); + params[Attributes::OBJECT_FINDER]=Attributes::True; + params[Attributes::SELECT_OBJECTS]=(obj_finder_wgt->select_btn->isChecked() ? Attributes::True : QString()); + params[Attributes::FADEIN_OBJECTS]=(obj_finder_wgt->fade_btn->isChecked() ? Attributes::True : QString()); + params[Attributes::REGULAR_EXP]=(obj_finder_wgt->regexp_chk->isChecked() ? Attributes::True : QString()); + params[Attributes::CaseSensitive]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? Attributes::True : QString()); + params[Attributes::EXACT_MATCH]=(obj_finder_wgt->exact_match_chk->isChecked() ? Attributes::True : QString()); + conf_wgt->addConfigurationParam(Attributes::OBJECT_FINDER, params); params.clear(); - params[ParsersAttributes::SQL_TOOL]=ParsersAttributes::True; - params[ParsersAttributes::SHOW_ATTRIBUTES_GRID]=(sql_tool_wgt->attributes_tb->isChecked() ? ParsersAttributes::True : QString()); - params[ParsersAttributes::SHOW_SOURCE_PANE]=(sql_tool_wgt->source_pane_tb->isChecked() ? ParsersAttributes::True : QString()); - conf_wgt->addConfigurationParam(ParsersAttributes::SQL_TOOL, params); + params[Attributes::SQL_TOOL]=Attributes::True; + params[Attributes::SHOW_ATTRIBUTES_GRID]=(sql_tool_wgt->attributes_tb->isChecked() ? Attributes::True : QString()); + params[Attributes::SHOW_SOURCE_PANE]=(sql_tool_wgt->source_pane_tb->isChecked() ? Attributes::True : QString()); + conf_wgt->addConfigurationParam(Attributes::SQL_TOOL, params); params.clear(); } @@ -1859,26 +1859,26 @@ void MainWindow::restoreDockWidgetsSettings(void) GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); map confs=conf_wgt->getConfigurationParams(); - if(confs.count(ParsersAttributes::VALIDATOR)) + if(confs.count(Attributes::VALIDATOR)) { - model_valid_wgt->sql_validation_chk->setChecked(confs[ParsersAttributes::VALIDATOR][ParsersAttributes::SQL_VALIDATION]==ParsersAttributes::True); - model_valid_wgt->use_tmp_names_chk->setChecked(confs[ParsersAttributes::VALIDATOR][ParsersAttributes::USE_UNIQUE_NAMES]==ParsersAttributes::True); - model_valid_wgt->version_cmb->setCurrentText(confs[ParsersAttributes::VALIDATOR][ParsersAttributes::PGSQL_VERSION]); + model_valid_wgt->sql_validation_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::SQL_VALIDATION]==Attributes::True); + model_valid_wgt->use_tmp_names_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::USE_UNIQUE_NAMES]==Attributes::True); + model_valid_wgt->version_cmb->setCurrentText(confs[Attributes::VALIDATOR][Attributes::PGSQL_VERSION]); } - if(confs.count(ParsersAttributes::OBJECT_FINDER)) + if(confs.count(Attributes::OBJECT_FINDER)) { - obj_finder_wgt->select_btn->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::SELECT_OBJECTS]==ParsersAttributes::True); - obj_finder_wgt->fade_btn->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::FADEIN_OBJECTS]==ParsersAttributes::True); - obj_finder_wgt->regexp_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::REGULAR_EXP]==ParsersAttributes::True); - obj_finder_wgt->case_sensitive_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::CaseSensitive]==ParsersAttributes::True); - obj_finder_wgt->exact_match_chk->setChecked(confs[ParsersAttributes::OBJECT_FINDER][ParsersAttributes::EXACT_MATCH]==ParsersAttributes::True); + obj_finder_wgt->select_btn->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::SELECT_OBJECTS]==Attributes::True); + obj_finder_wgt->fade_btn->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::FADEIN_OBJECTS]==Attributes::True); + obj_finder_wgt->regexp_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::REGULAR_EXP]==Attributes::True); + obj_finder_wgt->case_sensitive_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::CaseSensitive]==Attributes::True); + obj_finder_wgt->exact_match_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::EXACT_MATCH]==Attributes::True); } - if(confs.count(ParsersAttributes::SQL_TOOL)) + if(confs.count(Attributes::SQL_TOOL)) { - sql_tool_wgt->attributes_tb->setChecked(confs[ParsersAttributes::SQL_TOOL][ParsersAttributes::SHOW_ATTRIBUTES_GRID]==ParsersAttributes::True); - sql_tool_wgt->source_pane_tb->setChecked(confs[ParsersAttributes::SQL_TOOL][ParsersAttributes::SHOW_SOURCE_PANE]==ParsersAttributes::True); + sql_tool_wgt->attributes_tb->setChecked(confs[Attributes::SQL_TOOL][Attributes::SHOW_ATTRIBUTES_GRID]==Attributes::True); + sql_tool_wgt->source_pane_tb->setChecked(confs[Attributes::SQL_TOOL][Attributes::SHOW_SOURCE_PANE]==Attributes::True); } } diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 211132266e..e4efee3e9d 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -465,7 +465,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) //The import process will exclude built-in array array types, system and extension objects catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); - catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::True}}); + catalog.getObjectsOIDs(obj_oids, col_oids, {{Attributes::FILTER_TABLE_TYPES, Attributes::True}}); obj_oids[ObjectType::Database].push_back(db_cmb->currentData().value()); if(thread_id == SrcImportThread) diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 3aa56a5b76..44acdad278 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -290,7 +290,7 @@ void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename //Forcing the usage of the font settings defined for BaseObjectView and its subclasses svg_def.replace(font_attr.arg(scene->font().family()), - font_attr.arg(BaseObjectView::getFontStyle(ParsersAttributes::GLOBAL).font().family())); + font_attr.arg(BaseObjectView::getFontStyle(Attributes::GLOBAL).font().family())); /* Removing the empty (transparent) backgound object in order to save some space in the file if the grid or delimiter is displayed */ @@ -316,7 +316,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c unsigned i, count; ObjectType types[]={ObjectType::Role, ObjectType::Tablespace}; BaseObject *object=nullptr; - QString tmpl_comm_regexp = QString("(COMMENT)( )+(ON)( )+(%1)(.)+(\n)(") + ParsersAttributes::DDL_END_TOKEN + QString(")"); + QString tmpl_comm_regexp = QString("(COMMENT)( )+(ON)( )+(%1)(.)+(\n)(") + Attributes::DDL_END_TOKEN + QString(")"); QRegExp comm_regexp; try @@ -826,7 +826,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co } else { - ddl_tk_found=(lin.indexOf(ParsersAttributes::DDL_END_TOKEN) >= 0); + ddl_tk_found=(lin.indexOf(Attributes::DDL_END_TOKEN) >= 0); lin.remove(QRegExp(QString("^(--)+(.)+$"))); //If the line isn't empty after cleanup it will be included on sql command diff --git a/libpgmodeler_ui/src/modelfixform.cpp b/libpgmodeler_ui/src/modelfixform.cpp index 27be1456e9..4b5c174431 100644 --- a/libpgmodeler_ui/src/modelfixform.cpp +++ b/libpgmodeler_ui/src/modelfixform.cpp @@ -35,12 +35,12 @@ ModelFixForm::ModelFixForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, PgModelerUiNs::configureWidgetFont(not_found_lbl, PgModelerUiNs::MediumFontFactor); //Configuring font style for output widget - if(!confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont].isEmpty()) + if(!confs[Attributes::Configuration][Attributes::CodeFont].isEmpty()) { - double size=confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFontSize].toDouble(); + double size=confs[Attributes::Configuration][Attributes::CodeFontSize].toDouble(); if(size < 5.0f) size=5.0f; - output_txt->setFontFamily(confs[ParsersAttributes::CONFIGURATION][ParsersAttributes::CodeFont]); + output_txt->setFontFamily(confs[Attributes::Configuration][Attributes::CodeFont]); output_txt->setFontPointSize(size); } diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 5687370f7b..b21107a8ab 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -269,12 +269,12 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr if(tab_obj && tab_obj->isAddedByRelationship()) { font.setItalic(true); - item->setForeground(0,BaseObjectView::getFontStyle(ParsersAttributes::INH_COLUMN).foreground()); + item->setForeground(0,BaseObjectView::getFontStyle(Attributes::INH_COLUMN).foreground()); } else if(object->isProtected() || object->isSystemObject()) { font.setItalic(true); - item->setForeground(0,BaseObjectView::getFontStyle(ParsersAttributes::PROT_COLUMN).foreground()); + item->setForeground(0,BaseObjectView::getFontStyle(Attributes::PROT_COLUMN).foreground()); } item->setFont(0,font); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index afddbbb857..3cb4f5557e 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -319,19 +319,19 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) //If the objects does not differ, try to compare their XML definition if(!objs_differs) xml_differs=object->isCodeDiffersFrom(aux_object, - { ParsersAttributes::MAX_OBJ_COUNT, - ParsersAttributes::PROTECTED, - ParsersAttributes::SQL_DISABLED, - ParsersAttributes::RECT_VISIBLE, - ParsersAttributes::FILL_COLOR, - ParsersAttributes::FADED_OUT, - ParsersAttributes::HIDE_EXT_ATTRIBS}, - { ParsersAttributes::ROLE, - ParsersAttributes::TABLESPACE, - ParsersAttributes::COLLATION, - ParsersAttributes::POSITION, - ParsersAttributes::AppendedSql, - ParsersAttributes::PREPENDED_SQL }); + { Attributes::MAX_OBJ_COUNT, + Attributes::PROTECTED, + Attributes::SQL_DISABLED, + Attributes::RECT_VISIBLE, + Attributes::FILL_COLOR, + Attributes::FADED_OUT, + Attributes::HIDE_EXT_ATTRIBS}, + { Attributes::ROLE, + Attributes::TABLESPACE, + Attributes::Collation, + Attributes::POSITION, + Attributes::AppendedSql, + Attributes::PREPENDED_SQL }); //If a difference was detected between the objects if(objs_differs || xml_differs) @@ -847,7 +847,7 @@ void ModelsDiffHelper::processDiffInfos(void) if(create_objs.count(schema_id)!=0) create_objs[schema_id]+=type->getCodeDefinition(SchemaParser::SqlDefinition, true); else - attribs[ParsersAttributes::CREATE_CMDS]+=type->getCodeDefinition(SchemaParser::SqlDefinition, true); + attribs[Attributes::CreateCmds]+=type->getCodeDefinition(SchemaParser::SqlDefinition, true); type->convertFunctionParameters(true); } @@ -869,63 +869,63 @@ void ModelsDiffHelper::processDiffInfos(void) has_diffs=(create_objs_count!=0 || alter_objs.size()!=0 || drop_objs.size()!=0); //Attributes used on the diff schema file - attribs[ParsersAttributes::HAS_CHANGES]=ParsersAttributes::True; - attribs[ParsersAttributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; - attribs[ParsersAttributes::DB_MODEL]=source_model->getName(); - attribs[ParsersAttributes::DATABASE]=imported_model->getName(); - attribs[ParsersAttributes::DATE]=QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); - attribs[ParsersAttributes::CONNECTION]=imported_model->getName(); - attribs[ParsersAttributes::Change]=QString::number(alter_objs.size()); - attribs[ParsersAttributes::CREATE]=QString::number(create_objs_count); - attribs[ParsersAttributes::DROP]=QString::number(drop_objs.size()); - attribs[ParsersAttributes::TRUNCATE]=QString::number(truncate_tabs.size()); - attribs[ParsersAttributes::AlterCmds]=QString(); - attribs[ParsersAttributes::DROP_CMDS]=QString(); - attribs[ParsersAttributes::CREATE_CMDS]=QString(); - attribs[ParsersAttributes::TRUNCATE_CMDS]=QString(); - attribs[ParsersAttributes::CONSTR_DEFS]=QString(); - attribs[ParsersAttributes::FK_DEFS]=QString(); - attribs[ParsersAttributes::UNSET_PERMS]=unset_perms; - attribs[ParsersAttributes::SET_PERMS]=set_perms; - attribs[ParsersAttributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? ParsersAttributes::True : QString()); - attribs[ParsersAttributes::SEARCH_PATH]=(has_diffs ? sch_names.join(',') : QString()); + attribs[Attributes::HAS_CHANGES]=Attributes::True; + attribs[Attributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; + attribs[Attributes::DB_MODEL]=source_model->getName(); + attribs[Attributes::Database]=imported_model->getName(); + attribs[Attributes::Date]=QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); + attribs[Attributes::Connection]=imported_model->getName(); + attribs[Attributes::Change]=QString::number(alter_objs.size()); + attribs[Attributes::Create]=QString::number(create_objs_count); + attribs[Attributes::DROP]=QString::number(drop_objs.size()); + attribs[Attributes::TRUNCATE]=QString::number(truncate_tabs.size()); + attribs[Attributes::AlterCmds]=QString(); + attribs[Attributes::DROP_CMDS]=QString(); + attribs[Attributes::CreateCmds]=QString(); + attribs[Attributes::TRUNCATE_CMDS]=QString(); + attribs[Attributes::ConstrDefs]=QString(); + attribs[Attributes::FK_DEFS]=QString(); + attribs[Attributes::UNSET_PERMS]=unset_perms; + attribs[Attributes::SET_PERMS]=set_perms; + attribs[Attributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? Attributes::True : QString()); + attribs[Attributes::SEARCH_PATH]=(has_diffs ? sch_names.join(',') : QString()); ritr=drop_objs.rbegin(); ritr_end=drop_objs.rend(); - attribs[ParsersAttributes::DROP_CMDS]+=no_inherit_def; + attribs[Attributes::DROP_CMDS]+=no_inherit_def; while(ritr!=ritr_end) { - attribs[ParsersAttributes::DROP_CMDS]+=ritr->second; + attribs[Attributes::DROP_CMDS]+=ritr->second; ritr++; } - attribs[ParsersAttributes::DROP_CMDS]+=col_drop_def; + attribs[Attributes::DROP_CMDS]+=col_drop_def; for(auto &itr : create_objs) - attribs[ParsersAttributes::CREATE_CMDS]+=itr.second; + attribs[Attributes::CreateCmds]+=itr.second; - attribs[ParsersAttributes::CREATE_CMDS]+=inherit_def; + attribs[Attributes::CreateCmds]+=inherit_def; for(auto &itr : create_constrs) - attribs[ParsersAttributes::CONSTR_DEFS]+=itr.second; + attribs[Attributes::ConstrDefs]+=itr.second; for(auto &itr : create_fks) - attribs[ParsersAttributes::FK_DEFS]+=itr.second; + attribs[Attributes::FK_DEFS]+=itr.second; for(auto &itr : truncate_tabs) - attribs[ParsersAttributes::TRUNCATE_CMDS]+=itr.second; + attribs[Attributes::TRUNCATE_CMDS]+=itr.second; for(auto &itr : alter_objs) - attribs[ParsersAttributes::AlterCmds]+=itr.second; + attribs[Attributes::AlterCmds]+=itr.second; //Generating the whole diff buffer schparser.setPgSQLVersion(pgsql_version); diff_def=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + - ParsersAttributes::DIFF + GlobalAttributes::SchemaExt, attribs); + Attributes::DIFF + GlobalAttributes::SchemaExt, attribs); } if(diff_def.isEmpty()) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index e449fd1cd5..e4ced06426 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -174,11 +174,11 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) magnifier_frm->setCursor(Qt::CrossCursor); QColor c1, c2; - BaseObjectView::getFillStyle(ParsersAttributes::OBJ_SELECTION, c1, c2); + BaseObjectView::getFillStyle(Attributes::OBJ_SELECTION, c1, c2); c1.setAlpha(50); magnifier_frm->setStyleSheet(QString("background-color: %1; border: 1px solid %2;") .arg(c1.name(QColor::HexArgb)) - .arg(BaseObjectView::getBorderStyle(ParsersAttributes::OBJ_SELECTION).color().name(QColor::HexArgb))); + .arg(BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION).color().name(QColor::HexArgb))); magnifier_area_lbl = new QLabel(this); magnifier_area_lbl->raise(); diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 899bd8bba9..f0dc530cee 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -363,18 +363,18 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorisProtected() || objs[i]->isSystemObject()) { fnt.setItalic(true); - tab_item->setForeground(BaseObjectView::getFontStyle(ParsersAttributes::PROT_COLUMN).foreground()); + tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::PROT_COLUMN).foreground()); } else if(dynamic_cast(objs[i]) && dynamic_cast(objs[i])->isAddedByRelationship()) { fnt.setItalic(true); - tab_item->setForeground(BaseObjectView::getFontStyle(ParsersAttributes::INH_COLUMN).foreground()); + tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::INH_COLUMN).foreground()); } else { fnt.setItalic(false); - tab_item->setForeground(BaseObjectView::getFontStyle(ParsersAttributes::COLUMN).foreground()); + tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::Column).foreground()); } @@ -416,12 +416,12 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorisProtected() || parent_obj->isSystemObject()) { fnt.setItalic(true); - tab_item->setForeground(BaseObjectView::getFontStyle(ParsersAttributes::PROT_COLUMN).foreground()); + tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::PROT_COLUMN).foreground()); } else { fnt.setItalic(false); - tab_item->setForeground(BaseObjectView::getFontStyle(ParsersAttributes::COLUMN).foreground()); + tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::Column).foreground()); } tab_item->setFont(fnt); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index a8dfa5236e..3ed5edc940 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -24,12 +24,12 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob QFrame *frame=nullptr; QCheckBox *check=nullptr; unsigned i; - QString privs[]={ ParsersAttributes::SELECT_PRIV, ParsersAttributes::INSERT_PRIV, - ParsersAttributes::UPDATE_PRIV, ParsersAttributes::DELETE_PRIV, - ParsersAttributes::TRUNCATE_PRIV, ParsersAttributes::REFERENCES_PRIV, - ParsersAttributes::TRIGGER_PRIV, ParsersAttributes::CREATE_PRIV, - ParsersAttributes::CONNECT_PRIV, ParsersAttributes::TEMPORARY_PRIV, - ParsersAttributes::EXECUTE_PRIV, ParsersAttributes::USAGE_PRIV }; + QString privs[]={ Attributes::SELECT_PRIV, Attributes::INSERT_PRIV, + Attributes::UPDATE_PRIV, Attributes::DELETE_PRIV, + Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, + Attributes::TRIGGER_PRIV, Attributes::CreatePriv, + Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, + Attributes::EXECUTE_PRIV, Attributes::USAGE_PRIV }; Ui_PermissionWidget::setupUi(this); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 647ae59d9c..18fe2083d1 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -22,9 +22,9 @@ map RelationshipConfigWidget::config_params; RelationshipConfigWidget::RelationshipConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { - QStringList list, rel_types={ ParsersAttributes::RELATIONSHIP_11, ParsersAttributes::RELATIONSHIP_1N, - ParsersAttributes::RELATIONSHIP_NN, ParsersAttributes::RELATIONSHIP_GEN, - ParsersAttributes::RELATIONSHIP_DEP, ParsersAttributes::RELATIONSHIP_PART }; + QStringList list, rel_types={ Attributes::RELATIONSHIP_11, Attributes::RELATIONSHIP_1N, + Attributes::RELATIONSHIP_NN, Attributes::RELATIONSHIP_GEN, + Attributes::RELATIONSHIP_DEP, Attributes::RELATIONSHIP_PART }; unsigned rel_types_id[]={ BaseRelationship::Relationship11, BaseRelationship::Relationship1n, BaseRelationship::RelationshipNn, BaseRelationship::RelationshipGen, BaseRelationship::RelationshipDep, BaseRelationship::RelationshipPart}; @@ -95,29 +95,29 @@ void RelationshipConfigWidget::loadConfiguration(void) try { int idx; - vector key_attribs={ParsersAttributes::TYPE}; + vector key_attribs={Attributes::TYPE}; BaseConfigWidget::loadConfiguration(GlobalAttributes::RelationshipsConf, config_params, key_attribs); - fk_to_pk_rb->setChecked(config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]==ParsersAttributes::CONNECT_FK_TO_PK); - center_pnts_rb->setChecked(config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]==ParsersAttributes::CONNECT_CENTER_PNTS); - tab_edges_rb->setChecked(config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]==ParsersAttributes::CONNECT_TABLE_EDGES); - crows_foot_rb->setChecked(config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]==ParsersAttributes::CROWS_FOOT); + fk_to_pk_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::ConnectFkToPk); + center_pnts_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::ConnectCenterPnts); + tab_edges_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::ConnectTableEdges); + crows_foot_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::CrowsFoot); - deferrable_chk->setChecked(config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]==ParsersAttributes::True); - deferral_cmb->setCurrentText(config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFER_TYPE]); + deferrable_chk->setChecked(config_params[Attributes::FOREIGN_KEYS][Attributes::DEFERRABLE]==Attributes::True); + deferral_cmb->setCurrentText(config_params[Attributes::FOREIGN_KEYS][Attributes::DEFER_TYPE]); - idx=upd_action_cmb->findText(config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::UPD_ACTION]); + idx=upd_action_cmb->findText(config_params[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]); upd_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); - idx=del_action_cmb->findText(config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEL_ACTION]); + idx=del_action_cmb->findText(config_params[Attributes::FOREIGN_KEYS][Attributes::DEL_ACTION]); del_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); - patterns[ParsersAttributes::RELATIONSHIP_11]=config_params[ParsersAttributes::RELATIONSHIP_11]; - patterns[ParsersAttributes::RELATIONSHIP_1N]=config_params[ParsersAttributes::RELATIONSHIP_1N]; - patterns[ParsersAttributes::RELATIONSHIP_NN]=config_params[ParsersAttributes::RELATIONSHIP_NN]; - patterns[ParsersAttributes::RELATIONSHIP_GEN]=config_params[ParsersAttributes::RELATIONSHIP_GEN]; - patterns[ParsersAttributes::RELATIONSHIP_DEP]=config_params[ParsersAttributes::RELATIONSHIP_DEP]; - patterns[ParsersAttributes::RELATIONSHIP_PART]=config_params[ParsersAttributes::RELATIONSHIP_PART]; + patterns[Attributes::RELATIONSHIP_11]=config_params[Attributes::RELATIONSHIP_11]; + patterns[Attributes::RELATIONSHIP_1N]=config_params[Attributes::RELATIONSHIP_1N]; + patterns[Attributes::RELATIONSHIP_NN]=config_params[Attributes::RELATIONSHIP_NN]; + patterns[Attributes::RELATIONSHIP_GEN]=config_params[Attributes::RELATIONSHIP_GEN]; + patterns[Attributes::RELATIONSHIP_DEP]=config_params[Attributes::RELATIONSHIP_DEP]; + patterns[Attributes::RELATIONSHIP_PART]=config_params[Attributes::RELATIONSHIP_PART]; fillNamePatterns(); this->applyConfiguration(); @@ -140,32 +140,32 @@ void RelationshipConfigWidget::saveConfiguration(void) patterns_sch=root_dir + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - ParsersAttributes::PATTERNS + + Attributes::PATTERNS + GlobalAttributes::SchemaExt; if(crows_foot_rb->isChecked()) - config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]=ParsersAttributes::CROWS_FOOT; + config_params[Attributes::Connection][Attributes::MODE]=Attributes::CrowsFoot; else if(fk_to_pk_rb->isChecked()) - config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]=ParsersAttributes::CONNECT_FK_TO_PK; + config_params[Attributes::Connection][Attributes::MODE]=Attributes::ConnectFkToPk; else if(tab_edges_rb->isChecked()) - config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]=ParsersAttributes::CONNECT_TABLE_EDGES; + config_params[Attributes::Connection][Attributes::MODE]=Attributes::ConnectTableEdges; else - config_params[ParsersAttributes::CONNECTION][ParsersAttributes::MODE]=ParsersAttributes::CONNECT_CENTER_PNTS; + config_params[Attributes::Connection][Attributes::MODE]=Attributes::ConnectCenterPnts; - config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]=(deferrable_chk->isChecked() ? ParsersAttributes::True : ParsersAttributes::False); - config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFER_TYPE]=deferral_cmb->currentText(); - config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); - config_params[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEL_ACTION]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); + config_params[Attributes::FOREIGN_KEYS][Attributes::DEFERRABLE]=(deferrable_chk->isChecked() ? Attributes::True : Attributes::False); + config_params[Attributes::FOREIGN_KEYS][Attributes::DEFER_TYPE]=deferral_cmb->currentText(); + config_params[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); + config_params[Attributes::FOREIGN_KEYS][Attributes::DEL_ACTION]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); - config_params[ParsersAttributes::NAME_PATTERNS][ParsersAttributes::PATTERNS]=QString(); + config_params[Attributes::NAME_PATTERNS][Attributes::PATTERNS]=QString(); for(auto &itr : patterns) { schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); config_params[itr.first]=itr.second; - config_params[ParsersAttributes::NAME_PATTERNS][ParsersAttributes::PATTERNS]+=schparser.getCodeDefinition(patterns_sch, itr.second); + config_params[Attributes::NAME_PATTERNS][Attributes::PATTERNS]+=schparser.getCodeDefinition(patterns_sch, itr.second); } BaseConfigWidget::saveConfiguration(GlobalAttributes::RelationshipsConf, config_params); @@ -213,14 +213,14 @@ void RelationshipConfigWidget::fillNamePatterns(void) dst_col_pattern_txt, src_fk_pattern_txt, dst_fk_pattern_txt, pk_col_pattern_txt }; - QList pattern_ids={ ParsersAttributes::PK_PATTERN, ParsersAttributes::UQ_PATTERN, - ParsersAttributes::SRC_COL_PATTERN, ParsersAttributes::DST_COL_PATTERN, - ParsersAttributes::SRC_FK_PATTERN, ParsersAttributes::DST_FK_PATTERN, - ParsersAttributes::PK_COL_PATTERN }; + QList pattern_ids={ Attributes::PK_PATTERN, Attributes::UQ_PATTERN, + Attributes::SRC_COL_PATTERN, Attributes::DST_COL_PATTERN, + Attributes::SRC_FK_PATTERN, Attributes::DST_FK_PATTERN, + Attributes::PK_COL_PATTERN }; - relnn=(rel_type==ParsersAttributes::RELATIONSHIP_NN); - reldep=(rel_type==ParsersAttributes::RELATIONSHIP_DEP || rel_type==ParsersAttributes::RELATIONSHIP_PART); - relgen=(rel_type==ParsersAttributes::RELATIONSHIP_GEN); + relnn=(rel_type==Attributes::RELATIONSHIP_NN); + reldep=(rel_type==Attributes::RELATIONSHIP_DEP || rel_type==Attributes::RELATIONSHIP_PART); + relgen=(rel_type==Attributes::RELATIONSHIP_GEN); dst_col_pattern_txt->setEnabled(relnn); dst_fk_pattern_txt->setEnabled(relnn); @@ -252,13 +252,13 @@ void RelationshipConfigWidget::updatePattern(void) { QPlainTextEdit *input=qobject_cast(sender()); QString rel_type=rel_type_cmb->currentData().toString(); - map inputs_map={ { pk_pattern_txt, ParsersAttributes::PK_PATTERN }, - { uq_pattern_txt, ParsersAttributes::UQ_PATTERN }, - { src_col_pattern_txt, ParsersAttributes::SRC_COL_PATTERN }, - { dst_col_pattern_txt, ParsersAttributes::DST_COL_PATTERN }, - { src_fk_pattern_txt, ParsersAttributes::SRC_FK_PATTERN }, - { dst_fk_pattern_txt, ParsersAttributes::DST_FK_PATTERN }, - { pk_col_pattern_txt, ParsersAttributes::PK_COL_PATTERN } }; + map inputs_map={ { pk_pattern_txt, Attributes::PK_PATTERN }, + { uq_pattern_txt, Attributes::UQ_PATTERN }, + { src_col_pattern_txt, Attributes::SRC_COL_PATTERN }, + { dst_col_pattern_txt, Attributes::DST_COL_PATTERN }, + { src_fk_pattern_txt, Attributes::SRC_FK_PATTERN }, + { dst_fk_pattern_txt, Attributes::DST_FK_PATTERN }, + { pk_col_pattern_txt, Attributes::PK_COL_PATTERN } }; setConfigurationChanged(true); patterns[rel_type][inputs_map[input]]=input->toPlainText(); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 87a948b228..cf389e630f 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -478,10 +478,10 @@ void RelationshipWidget::useFKGlobalSettings(bool value) if(value) { map confs=RelationshipConfigWidget::getConfigurationParams(); - deferrable_chk->setChecked(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFERRABLE]==ParsersAttributes::True); - deferral_cmb->setCurrentText(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEFER_TYPE]); - upd_action_cmb->setCurrentText(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::UPD_ACTION]); - del_action_cmb->setCurrentText(confs[ParsersAttributes::FOREIGN_KEYS][ParsersAttributes::DEL_ACTION]); + deferrable_chk->setChecked(confs[Attributes::FOREIGN_KEYS][Attributes::DEFERRABLE]==Attributes::True); + deferral_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::DEFER_TYPE]); + upd_action_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]); + del_action_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::DEL_ACTION]); } else { @@ -517,13 +517,13 @@ void RelationshipWidget::usePatternGlobalSettings(bool value) QString rel_type=rel->getRelTypeAttribute(); //Using the global settings - pk_pattern_txt->setPlainText(confs[rel_type][ParsersAttributes::PK_PATTERN]); - src_fk_pattern_txt->setPlainText(confs[rel_type][ParsersAttributes::SRC_FK_PATTERN]); - dst_fk_pattern_txt->setPlainText(confs[rel_type][ParsersAttributes::DST_FK_PATTERN]); - uq_pattern_txt->setPlainText(confs[rel_type][ParsersAttributes::UQ_PATTERN]); - src_col_pattern_txt->setPlainText(confs[rel_type][ParsersAttributes::SRC_COL_PATTERN]); - dst_col_pattern_txt->setPlainText(confs[rel_type][ParsersAttributes::DST_COL_PATTERN]); - pk_col_pattern_txt->setPlainText(confs[rel_type][ParsersAttributes::PK_COL_PATTERN]); + pk_pattern_txt->setPlainText(confs[rel_type][Attributes::PK_PATTERN]); + src_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_FK_PATTERN]); + dst_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::DST_FK_PATTERN]); + uq_pattern_txt->setPlainText(confs[rel_type][Attributes::UQ_PATTERN]); + src_col_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_COL_PATTERN]); + dst_col_pattern_txt->setPlainText(confs[rel_type][Attributes::DST_COL_PATTERN]); + pk_col_pattern_txt->setPlainText(confs[rel_type][Attributes::PK_COL_PATTERN]); } else { diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index b39dc007af..021ea2e09b 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -65,7 +65,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent col = 0; for(auto &tp : types) - type_names[tp[ParsersAttributes::OID].toInt()]=tp[ParsersAttributes::NAME]; + type_names[tp[Attributes::OID].toInt()]=tp[Attributes::NAME]; for(col=0; col < col_count; col++) tooltip_data.push_back(type_names[res.getColumnTypeId(col)]); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index f8a21834b6..33ba15f9e8 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -107,12 +107,12 @@ QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) { QStringList ids; QString type_name=(obj_type==ObjectType::BaseObject ? - ParsersAttributes::GENERAL : BaseObject::getSchemaName(obj_type)); + Attributes::GENERAL : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) { - if(snip.second[ParsersAttributes::OBJECT]==type_name) - ids.push_back(snip.second[ParsersAttributes::ID]); + if(snip.second[Attributes::OBJECT]==type_name) + ids.push_back(snip.second[Attributes::ID]); } return(ids); @@ -122,11 +122,11 @@ vector SnippetsConfigWidget::getSnippetsByObject(ObjectType obj_typ { vector snippets; QString type_name=(obj_type==ObjectType::BaseObject ? - ParsersAttributes::GENERAL : BaseObject::getSchemaName(obj_type)); + Attributes::GENERAL : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) { - if(snip.second[ParsersAttributes::OBJECT]==type_name) + if(snip.second[Attributes::OBJECT]==type_name) snippets.push_back(snip.second); } @@ -160,9 +160,9 @@ QString SnippetsConfigWidget::parseSnippet(attribs_map snippet, attribs_map attr { SchemaParser schparser; QStringList aux_attribs; - QString buf=snippet[ParsersAttributes::CONTENTS]; + QString buf=snippet[Attributes::Contents]; - if(snippet[ParsersAttributes::PARSABLE]!=ParsersAttributes::True) + if(snippet[Attributes::PARSABLE]!=Attributes::True) return(buf); try @@ -170,7 +170,7 @@ QString SnippetsConfigWidget::parseSnippet(attribs_map snippet, attribs_map attr schparser.loadBuffer(buf); //Assigning dummy values for empty attributes - if(snippet[ParsersAttributes::PLACEHOLDERS]==ParsersAttributes::True) + if(snippet[Attributes::PLACEHOLDERS]==Attributes::True) { aux_attribs=schparser.extractAttributes(); for(QString attr : aux_attribs) @@ -213,24 +213,24 @@ void SnippetsConfigWidget::fillSnippetsCombo(map &config) snippets_cmb->clear(); for(auto &cfg : config) - snippets_cmb->addItem(QString("[%1] %2").arg(cfg.first, cfg.second.at(ParsersAttributes::LABEL)), cfg.first); + snippets_cmb->addItem(QString("[%1] %2").arg(cfg.first, cfg.second.at(Attributes::LABEL)), cfg.first); } bool SnippetsConfigWidget::isSnippetValid(attribs_map &attribs, const QString &orig_id) { Messagebox msg_box; - QString snip_id=attribs.at(ParsersAttributes::ID), + QString snip_id=attribs.at(Attributes::ID), err_msg; if(!orig_id.isEmpty() && snip_id!=orig_id && config_params.count(snip_id)!=0) err_msg=trUtf8("Duplicated snippet id %1 detected. Please, specify a different one!").arg(snip_id); else if(!IdFormatRegExp.exactMatch(snip_id)) err_msg=trUtf8("Invalid ID pattern detected %1. This one must start with at leat one letter and be composed by letters, numbers and/or underscore!").arg(snip_id); - else if(attribs[ParsersAttributes::LABEL].isEmpty()) + else if(attribs[Attributes::LABEL].isEmpty()) err_msg=trUtf8("Empty label for snippet %1. Please, specify a value for it!").arg(snip_id); - else if(attribs[ParsersAttributes::CONTENTS].isEmpty()) + else if(attribs[Attributes::Contents].isEmpty()) err_msg=trUtf8("Empty code for snippet %1. Please, specify a value for it!").arg(snip_id); - else if(attribs[ParsersAttributes::PARSABLE]==ParsersAttributes::True) + else if(attribs[Attributes::PARSABLE]==Attributes::True) { try { @@ -270,7 +270,7 @@ void SnippetsConfigWidget::loadConfiguration(void) QStringList inv_snippets; this->resetForm(); - BaseConfigWidget::loadConfiguration(GlobalAttributes::SnippetsConf, config_params, { ParsersAttributes::ID }); + BaseConfigWidget::loadConfiguration(GlobalAttributes::SnippetsConf, config_params, { Attributes::ID }); //Check if there are invalid snippets loaded for(auto &snip : config_params) @@ -306,28 +306,28 @@ attribs_map SnippetsConfigWidget::getSnippetAttributes(void) QString object_id=BaseObject::getSchemaName(static_cast(applies_to_cmb->currentData().toUInt())); if(object_id.isEmpty()) - object_id=ParsersAttributes::GENERAL; - - return(attribs_map{ {ParsersAttributes::ID, id_edt->text()}, - {ParsersAttributes::LABEL, label_edt->text()}, - {ParsersAttributes::OBJECT, object_id}, - {ParsersAttributes::PARSABLE, (parsable_chk->isChecked() ? ParsersAttributes::True : ParsersAttributes::False)}, - {ParsersAttributes::PLACEHOLDERS, (parsable_chk->isChecked() && placeholders_chk->isChecked() ? - ParsersAttributes::True : ParsersAttributes::False)}, - {ParsersAttributes::CONTENTS, snippet_txt->toPlainText()} }); + object_id=Attributes::GENERAL; + + return(attribs_map{ {Attributes::ID, id_edt->text()}, + {Attributes::LABEL, label_edt->text()}, + {Attributes::OBJECT, object_id}, + {Attributes::PARSABLE, (parsable_chk->isChecked() ? Attributes::True : Attributes::False)}, + {Attributes::PLACEHOLDERS, (parsable_chk->isChecked() && placeholders_chk->isChecked() ? + Attributes::True : Attributes::False)}, + {Attributes::Contents, snippet_txt->toPlainText()} }); } void SnippetsConfigWidget::editSnippet(void) { QString snip_id=snippets_cmb->currentData().toString(); - ObjectType obj_type=BaseObject::getObjectType(config_params[snip_id].at(ParsersAttributes::OBJECT)); + ObjectType obj_type=BaseObject::getObjectType(config_params[snip_id].at(Attributes::OBJECT)); enableEditMode(true); - snippet_txt->setPlainText(config_params[snip_id].at(ParsersAttributes::CONTENTS)); + snippet_txt->setPlainText(config_params[snip_id].at(Attributes::Contents)); id_edt->setText(snip_id); - label_edt->setText(config_params[snip_id].at(ParsersAttributes::LABEL)); - parsable_chk->setChecked(config_params[snip_id].at(ParsersAttributes::PARSABLE)==ParsersAttributes::True); - placeholders_chk->setChecked(config_params[snip_id].at(ParsersAttributes::PLACEHOLDERS)==ParsersAttributes::True); + label_edt->setText(config_params[snip_id].at(Attributes::LABEL)); + parsable_chk->setChecked(config_params[snip_id].at(Attributes::PARSABLE)==Attributes::True); + placeholders_chk->setChecked(config_params[snip_id].at(Attributes::PLACEHOLDERS)==Attributes::True); applies_to_cmb->setCurrentText(BaseObject::getTypeName(obj_type)); } @@ -414,11 +414,11 @@ void SnippetsConfigWidget::filterSnippets(int idx) QString object_id=BaseObject::getSchemaName(obj_type); if(object_id.isEmpty()) - object_id=ParsersAttributes::GENERAL; + object_id=Attributes::GENERAL; for(auto &cfg : config_params) { - if(cfg.second.at(ParsersAttributes::OBJECT)==object_id) + if(cfg.second.at(Attributes::OBJECT)==object_id) flt_snippets[cfg.first]=cfg.second; } @@ -451,7 +451,7 @@ void SnippetsConfigWidget::saveConfiguration(void) snippet_sch=root_dir + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - ParsersAttributes::SNIPPET + + Attributes::SNIPPET + GlobalAttributes::SchemaExt; attribs_map attribs; @@ -466,7 +466,7 @@ void SnippetsConfigWidget::saveConfiguration(void) for(auto &snip : snippets) { - attribs[ParsersAttributes::SNIPPET]+= + attribs[Attributes::SNIPPET]+= schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(snippet_sch, snip)); } } @@ -520,8 +520,8 @@ void SnippetsConfigWidget::configureSnippetsMenu(QMenu *snip_menu, vectoraddMenu(menu); } //Creating the action for the current snippet act=new QAction(QPixmap(PgModelerUiNs::getIconPath("codesnippet")), snip_id, submenus[object]); - act->setToolTip(snip[ParsersAttributes::LABEL]); + act->setToolTip(snip[Attributes::LABEL]); submenus[object]->addAction(act); } //Include the "general" submenu at the end of snippet menu - if(submenus.count(ParsersAttributes::GENERAL)!=0) + if(submenus.count(Attributes::GENERAL)!=0) { if(snip_menu->isEmpty()) - snip_menu->addMenu(submenus[ParsersAttributes::GENERAL]); + snip_menu->addMenu(submenus[Attributes::GENERAL]); else { //Inserting the "general" submenu at the top of snippets actions - snip_menu->insertMenu(snip_menu->actions().at(0), submenus[ParsersAttributes::GENERAL]); + snip_menu->insertMenu(snip_menu->actions().at(0), submenus[Attributes::GENERAL]); snip_menu->insertSeparator(snip_menu->actions().at(1)); } } diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 5939e1586c..81d6f5a460 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -271,7 +271,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab types=catalog.getObjectsAttributes(ObjectType::Type, QString(), QString(), type_ids); for(auto &tp : types) - type_names[tp[ParsersAttributes::OID].toUInt()]=tp[ParsersAttributes::NAME]; + type_names[tp[Attributes::OID].toUInt()]=tp[Attributes::NAME]; catalog.setFilter(orig_filter); @@ -448,8 +448,8 @@ void SQLExecutionWidget::addToSQLHistory(const QString &cmd, unsigned rows, cons else fmt_cmd += QString("-- %1 %2\n").arg(trUtf8("Rows:")).arg(rows); - if(!fmt_cmd.trimmed().endsWith(ParsersAttributes::DDL_END_TOKEN)) - fmt_cmd += ParsersAttributes::DDL_END_TOKEN + QChar('\n'); + if(!fmt_cmd.trimmed().endsWith(Attributes::DDL_END_TOKEN)) + fmt_cmd += Attributes::DDL_END_TOKEN + QChar('\n'); SQLExecutionWidget::validateSQLHistoryLength(sql_cmd_conn.getConnectionId(true,true), fmt_cmd, cmd_history_txt); } @@ -468,7 +468,7 @@ void SQLExecutionWidget::validateSQLHistoryLength(const QString &conn_id, const { QStringList buffer = cmds.split(QChar('\n')); cmds = buffer.mid(buffer.size()/2).join(QChar('\n')); - cmds = cmds.mid(cmds.indexOf(ParsersAttributes::DDL_END_TOKEN) + ParsersAttributes::DDL_END_TOKEN.length()); + cmds = cmds.mid(cmds.indexOf(Attributes::DDL_END_TOKEN) + Attributes::DDL_END_TOKEN.length()); cmd_history[conn_id] = cmds.trimmed(); if(cmd_history_txt) @@ -829,14 +829,14 @@ void SQLExecutionWidget::saveSQLHistory(void) for(auto hist : cmd_history) { - attribs[ParsersAttributes::CONNECTION] = hist.first; - attribs[ParsersAttributes::COMMANDS] = hist.second; + attribs[Attributes::Connection] = hist.first; + attribs[Attributes::Commands] = hist.second; schparser.ignoreEmptyAttributes(true); commands += schparser.getCodeDefinition(GlobalAttributes::TmplConfigurationDir + GlobalAttributes::DirSeparator + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - ParsersAttributes::COMMANDS + + Attributes::Commands + GlobalAttributes::SchemaExt, attribs); } @@ -848,7 +848,7 @@ void SQLExecutionWidget::saveSQLHistory(void) GlobalAttributes::SchemaExt); attribs.clear(); - attribs[ParsersAttributes::COMMANDS] = commands; + attribs[Attributes::Commands] = commands; buffer.append(schparser.getCodeDefinition(attribs)); @@ -896,13 +896,13 @@ void SQLExecutionWidget::loadSQLHistory(void) { do { - if(xmlparser.getElementName() == ParsersAttributes::COMMANDS) + if(xmlparser.getElementName() == Attributes::Commands) { xmlparser.getElementAttributes(attribs); xmlparser.savePosition(); if(xmlparser.accessElement(XmlParser::ChildElement)) - cmd_history[attribs[ParsersAttributes::CONNECTION]].append(xmlparser.getElementContent()); + cmd_history[attribs[Attributes::Connection]].append(xmlparser.getElementContent()); xmlparser.restorePosition(); } diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 850fb3d05c..62fa205704 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -390,27 +390,27 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) { elem=xmlparser.getElementName(); - if(elem==ParsersAttributes::WORD_SEPARATORS) + if(elem==Attributes::WORD_SEPARATORS) { xmlparser.getElementAttributes(attribs); - word_separators=attribs[ParsersAttributes::VALUE]; + word_separators=attribs[Attributes::VALUE]; } - else if(elem==ParsersAttributes::WORD_DELIMITERS) + else if(elem==Attributes::WORD_DELIMITERS) { xmlparser.getElementAttributes(attribs); - word_delimiters=attribs[ParsersAttributes::VALUE]; + word_delimiters=attribs[Attributes::VALUE]; } - else if(elem==ParsersAttributes::IGNORED_CHARS) + else if(elem==Attributes::IGNORED_CHARS) { xmlparser.getElementAttributes(attribs); - ignored_chars=attribs[ParsersAttributes::VALUE]; + ignored_chars=attribs[Attributes::VALUE]; } - else if(elem==ParsersAttributes::COMPLETION_TRIGGER) + else if(elem==Attributes::CompletionTrigger) { xmlparser.getElementAttributes(attribs); - if(attribs[ParsersAttributes::VALUE].size() >= 1) - completion_trigger=attribs[ParsersAttributes::VALUE].at(0); + if(attribs[Attributes::VALUE].size() >= 1) + completion_trigger=attribs[Attributes::VALUE].at(0); } /* If the element is what defines the order of application of the groups @@ -418,7 +418,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) the groups used to highlight the source code. ALL groups in this block must be declared before they are built otherwise an error will be triggered. */ - else if(elem==ParsersAttributes::HIGHLIGHT_ORDER) + else if(elem==Attributes::HIGHLIGHT_ORDER) { //Marks a flag indication that groups are being declared groups_decl=true; @@ -427,10 +427,10 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) elem=xmlparser.getElementName(); } - if(elem==ParsersAttributes::GROUP) + if(elem==Attributes::GROUP) { xmlparser.getElementAttributes(attribs); - group=attribs[ParsersAttributes::NAME]; + group=attribs[Attributes::NAME]; /* If the parser is on the group declaration block and not in the build block some validations are made. */ @@ -446,7 +446,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) else if(attribs.size() > 1 || xmlparser.hasElement(XmlParser::ChildElement)) { throw Exception(Exception::getErrorMessage(ErrorCode::InvGroupDeclaration) - .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), + .arg(group).arg(Attributes::HIGHLIGHT_ORDER), ErrorCode::InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -465,7 +465,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) else if(find(groups_order.begin(), groups_order.end(), group)==groups_order.end()) { throw Exception(Exception::getErrorMessage(ErrorCode::DefNotDeclaredGroup) - .arg(group).arg(ParsersAttributes::HIGHLIGHT_ORDER), + .arg(group).arg(Attributes::HIGHLIGHT_ORDER), ErrorCode::DefNotDeclaredGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group does not have children element @@ -475,21 +475,21 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) ErrorCode::DefEmptyGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } - chr_sensitive=(attribs[ParsersAttributes::CaseSensitive]==ParsersAttributes::True); - italic=(attribs[ParsersAttributes::ITALIC]==ParsersAttributes::True); - bold=(attribs[ParsersAttributes::Bold]==ParsersAttributes::True); - underline=(attribs[ParsersAttributes::UNDERLINE]==ParsersAttributes::True); - partial_match=(attribs[ParsersAttributes::PARTIAL_MATCH]==ParsersAttributes::True); - fg_color.setNamedColor(attribs[ParsersAttributes::FOREGROUND_COLOR]); + chr_sensitive=(attribs[Attributes::CaseSensitive]==Attributes::True); + italic=(attribs[Attributes::ITALIC]==Attributes::True); + bold=(attribs[Attributes::Bold]==Attributes::True); + underline=(attribs[Attributes::UNDERLINE]==Attributes::True); + partial_match=(attribs[Attributes::PARTIAL_MATCH]==Attributes::True); + fg_color.setNamedColor(attribs[Attributes::FOREGROUND_COLOR]); //If the attribute isn't defined the bg color will be transparent - if(attribs[ParsersAttributes::BackgroundColor].isEmpty()) + if(attribs[Attributes::BackgroundColor].isEmpty()) bg_color.setRgb(0,0,0,0); else - bg_color.setNamedColor(attribs[ParsersAttributes::BackgroundColor]); + bg_color.setNamedColor(attribs[Attributes::BackgroundColor]); - if(!attribs[ParsersAttributes::LOOKAHEAD_CHAR].isEmpty()) - lookahead_char[group]=attribs[ParsersAttributes::LOOKAHEAD_CHAR][0]; + if(!attribs[Attributes::LOOKAHEAD_CHAR].isEmpty()) + lookahead_char[group]=attribs[Attributes::LOOKAHEAD_CHAR][0]; format.setFontFamily(default_font.family()); format.setFontPointSize(default_font.pointSizeF()); @@ -521,19 +521,19 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) if(xmlparser.getElementType()==XML_ELEMENT_NODE) { xmlparser.getElementAttributes(attribs); - expr_type=attribs[ParsersAttributes::TYPE]; - regexp.setPattern(attribs[ParsersAttributes::VALUE]); + expr_type=attribs[Attributes::TYPE]; + regexp.setPattern(attribs[Attributes::VALUE]); - if(attribs[ParsersAttributes::REGULAR_EXP]==ParsersAttributes::True) + if(attribs[Attributes::REGULAR_EXP]==Attributes::True) regexp.setPatternSyntax(QRegExp::RegExp2); - else if(attribs[ParsersAttributes::WILDCARD]==ParsersAttributes::True) + else if(attribs[Attributes::WILDCARD]==Attributes::True) regexp.setPatternSyntax(QRegExp::Wildcard); else regexp.setPatternSyntax(QRegExp::FixedString); if(expr_type.isEmpty() || - expr_type==ParsersAttributes::SIMPLE_EXP || - expr_type==ParsersAttributes::INITIAL_EXP) + expr_type==Attributes::SIMPLE_EXP || + expr_type==Attributes::INITIAL_EXP) initial_exprs[group].push_back(regexp); else final_exprs[group].push_back(regexp); diff --git a/libpgmodeler_ui/src/syntaxhighlighter.h b/libpgmodeler_ui/src/syntaxhighlighter.h index 8cf4890aa1..c2badb46d5 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.h +++ b/libpgmodeler_ui/src/syntaxhighlighter.h @@ -31,7 +31,7 @@ #include "exception.h" #include "xmlparser.h" #include "globalattributes.h" -#include "parsersattributes.h" +#include "attributes.h" #include class SyntaxHighlighter: public QSyntaxHighlighter { diff --git a/libpgmodeler_ui/src/tagwidget.cpp b/libpgmodeler_ui/src/tagwidget.cpp index dda9b47f5b..39d3a8d0b6 100644 --- a/libpgmodeler_ui/src/tagwidget.cpp +++ b/libpgmodeler_ui/src/tagwidget.cpp @@ -23,15 +23,15 @@ TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Tag) Ui_TagWidget::setupUi(this); configureFormLayout(tag_grid, ObjectType::Tag); - QStringList attribs={ ParsersAttributes::TABLE_NAME, ParsersAttributes::TABLE_SCHEMA_NAME, - ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, - ParsersAttributes::TABLE_EXT_BODY }; + QStringList attribs={ Attributes::TABLE_NAME, Attributes::TABLE_SCHEMA_NAME, + Attributes::TABLE_TITLE, Attributes::TABLE_BODY, + Attributes::TABLE_EXT_BODY }; unsigned color_count=1; int row=0; for(auto &attr : attribs) { - if(color_count==1 && attr!=ParsersAttributes::TABLE_NAME && attr!=ParsersAttributes::TABLE_SCHEMA_NAME) + if(color_count==1 && attr!=Attributes::TABLE_NAME && attr!=Attributes::TABLE_SCHEMA_NAME) color_count=3; color_pickers[attr]=new ColorPickerWidget(color_count, this); @@ -46,15 +46,15 @@ TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Tag) void TagWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Tag *tag) { unsigned color_count=1, i; - QStringList attribs={ ParsersAttributes::TABLE_NAME, ParsersAttributes::TABLE_SCHEMA_NAME, - ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, - ParsersAttributes::TABLE_EXT_BODY }; + QStringList attribs={ Attributes::TABLE_NAME, Attributes::TABLE_SCHEMA_NAME, + Attributes::TABLE_TITLE, Attributes::TABLE_BODY, + Attributes::TABLE_EXT_BODY }; BaseObjectWidget::setAttributes(model, op_list, tag); for(auto &attr : attribs) { - if(color_count==1 && attr!=ParsersAttributes::TABLE_NAME && attr!=ParsersAttributes::TABLE_SCHEMA_NAME) + if(color_count==1 && attr!=Attributes::TABLE_NAME && attr!=Attributes::TABLE_SCHEMA_NAME) color_count=3; for(i=0; i < color_count; i++) @@ -73,16 +73,16 @@ void TagWidget::applyConfiguration(void) { Tag *tag=nullptr; vector tagged_tabs; - QStringList attribs={ ParsersAttributes::TABLE_TITLE, ParsersAttributes::TABLE_BODY, - ParsersAttributes::TABLE_EXT_BODY }; + QStringList attribs={ Attributes::TABLE_TITLE, Attributes::TABLE_BODY, + Attributes::TABLE_EXT_BODY }; startConfiguration(); tag=dynamic_cast(this->object); BaseObjectWidget::applyConfiguration(); - tag->setElementColor(ParsersAttributes::TABLE_NAME, color_pickers[ParsersAttributes::TABLE_NAME]->getColor(0), Tag::FillColor1); - tag->setElementColor(ParsersAttributes::TABLE_SCHEMA_NAME, color_pickers[ParsersAttributes::TABLE_SCHEMA_NAME]->getColor(0), Tag::FillColor1); + tag->setElementColor(Attributes::TABLE_NAME, color_pickers[Attributes::TABLE_NAME]->getColor(0), Tag::FillColor1); + tag->setElementColor(Attributes::TABLE_SCHEMA_NAME, color_pickers[Attributes::TABLE_SCHEMA_NAME]->getColor(0), Tag::FillColor1); for(auto &attr : attribs) { diff --git a/libpgmodeler_ui/src/updatenotifierwidget.cpp b/libpgmodeler_ui/src/updatenotifierwidget.cpp index aff7ea2593..c3937091ff 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.cpp +++ b/libpgmodeler_ui/src/updatenotifierwidget.cpp @@ -137,10 +137,10 @@ void UpdateNotifierWidget::handleUpdateChecked(QNetworkReply *reply) { QJsonDocument json_doc=QJsonDocument::fromJson(reply->readAll()); QJsonObject json_obj=json_doc.object(); - QString version=json_obj.value(ParsersAttributes::NEW_VERSION).toString(), - changelog=json_obj.value(ParsersAttributes::Changelog).toString(), - date=json_obj.value(ParsersAttributes::DATE).toString(); - bool upd_found=(!version.isEmpty() && version!=ParsersAttributes::False); + QString version=json_obj.value(Attributes::NEW_VERSION).toString(), + changelog=json_obj.value(Attributes::Changelog).toString(), + date=json_obj.value(Attributes::Date).toString(); + bool upd_found=(!version.isEmpty() && version!=Attributes::False); if(upd_found) { diff --git a/libpgmodeler_ui/src/updatenotifierwidget.h b/libpgmodeler_ui/src/updatenotifierwidget.h index b650b28468..917cd60bf7 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.h +++ b/libpgmodeler_ui/src/updatenotifierwidget.h @@ -49,7 +49,7 @@ #include "ui_updatenotifierwidget.h" #include "messagebox.h" #include "globalattributes.h" -#include "parsersattributes.h" +#include "attributes.h" class UpdateNotifierWidget: public QWidget, public Ui::UpdateNotifierWidget { private: diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index c6f257940c..0afd2348c8 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -678,7 +678,7 @@ void PgModelerCli::extractObjectXML(void) QFile input; QString buf, lin, def_xml, end_tag; QTextStream ts; - QRegExp regexp(QString("^(\\<\\?xml)(.)*(\\<%1)( )*").arg(ParsersAttributes::DB_MODEL)), + QRegExp regexp(QString("^(\\<\\?xml)(.)*(\\<%1)( )*").arg(Attributes::DB_MODEL)), default_obj=QRegExp(QString("(default)(\\-)(schema|owner|collation|tablespace)")), //[schema].[func_name](...OUT [type]...) @@ -711,7 +711,7 @@ void PgModelerCli::extractObjectXML(void) //Remove the header entry from buffer buf.remove(start, regexp.matchedLength()+1); buf.remove(0, buf.indexOf(QString("\n"))); - buf.remove(QString("<\\%1>").arg(ParsersAttributes::DB_MODEL)); + buf.remove(QString("<\\%1>").arg(Attributes::DB_MODEL)); ts.setString(&buf); //Extracts the objects xml line by line @@ -766,7 +766,7 @@ void PgModelerCli::extractObjectXML(void) /* Checking if the line start a relationship. Relationships are treated a little different because they can be empty or contain open and close tags */ - is_rel=lin.contains(ParsersAttributes::RELATIONSHIP); + is_rel=lin.contains(Attributes::RELATIONSHIP); if(is_rel) { @@ -879,7 +879,7 @@ void PgModelerCli::recreateObjects(void) //Discarding fk relationships if(obj_type!=ObjectType::Relationship || - (obj_type==ObjectType::Relationship && !xml_def.contains(QString("\"%1\"").arg(ParsersAttributes::RELATIONSHIP_FK)))) + (obj_type==ObjectType::Relationship && !xml_def.contains(QString("\"%1\"").arg(Attributes::RELATIONSHIP_FK)))) { object=model->createObject(obj_type); @@ -1024,7 +1024,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) } //Remove recheck attribute from tags. - if(obj_xml.contains(TagExpr.arg(ParsersAttributes::ELEMENT))) + if(obj_xml.contains(TagExpr.arg(Attributes::ELEMENT))) obj_xml.remove(QRegExp(AttributeExpr.arg(QString("recheck")))); //Remove values greater-op, less-op, sort-op or sort2-op from ref-type attribute from tags. @@ -1038,7 +1038,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Replacing attribute owner by onwer-col for sequences if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Sequence)))) - obj_xml.replace(ParsersAttributes::OWNER, ParsersAttributes::OWNER_COLUMN); + obj_xml.replace(Attributes::OWNER, Attributes::OWNER_COLUMN); //Remove sysid attribute from tags. if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Role)))) @@ -1047,8 +1047,8 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Replace tag by on tags. if(obj_xml.contains(TagExpr.arg(QString("usertype")))) { - obj_xml.replace(TagExpr.arg(ParsersAttributes::PARAMETER), TagExpr.arg(ParsersAttributes::TYPE_ATTRIBUTE)); - obj_xml.replace(EndTagExpr.arg(ParsersAttributes::PARAMETER), EndTagExpr.arg(ParsersAttributes::TYPE_ATTRIBUTE)); + obj_xml.replace(TagExpr.arg(Attributes::PARAMETER), TagExpr.arg(Attributes::TYPE_ATTRIBUTE)); + obj_xml.replace(EndTagExpr.arg(Attributes::PARAMETER), EndTagExpr.arg(Attributes::TYPE_ATTRIBUTE)); } if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Relationship)))) @@ -1061,19 +1061,19 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.remove(QRegExp(AttributeExpr.arg(QString("constr-indexes")))); obj_xml.remove(QRegExp(AttributeExpr.arg(QString("attrib-indexes")))); - obj_xml.replace(QString("line-color"), ParsersAttributes::CUSTOM_COLOR); + obj_xml.replace(QString("line-color"), Attributes::CustomColor); } //Renaming the tag to on indexes if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Index)))) { - obj_xml.replace(TagExpr.arg(ParsersAttributes::CONDITION), TagExpr.arg(ParsersAttributes::PREDICATE)); - obj_xml.replace(EndTagExpr.arg(ParsersAttributes::CONDITION), EndTagExpr.arg(ParsersAttributes::PREDICATE)); + obj_xml.replace(TagExpr.arg(Attributes::Condition), TagExpr.arg(Attributes::PREDICATE)); + obj_xml.replace(EndTagExpr.arg(Attributes::Condition), EndTagExpr.arg(Attributes::PREDICATE)); } //Renaming the attribute default to default-value on domain if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Domain)))) - obj_xml.replace(ParsersAttributes::DEFAULT, ParsersAttributes::DEFAULT_VALUE); + obj_xml.replace(Attributes::DEFAULT, Attributes::DEFAULT_VALUE); //Renaming the tag to if(obj_xml.contains(TagExpr.arg(QString("grant")))) @@ -1084,24 +1084,24 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Replace the constraint attribute and tag expression by constraint tag in . if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Domain))) && - obj_xml.contains(TagExpr.arg(ParsersAttributes::EXPRESSION))) + obj_xml.contains(TagExpr.arg(Attributes::EXPRESSION))) { int start_idx=-1, end_idx=-1; - QRegExp regexp = QRegExp(AttributeExpr.arg(ParsersAttributes::CONSTRAINT)); + QRegExp regexp = QRegExp(AttributeExpr.arg(Attributes::Constraint)); QString constr_name; regexp.indexIn(obj_xml); constr_name = regexp.capturedTexts().at(0); - constr_name.remove(QString("%1=\"").arg(ParsersAttributes::CONSTRAINT)); + constr_name.remove(QString("%1=\"").arg(Attributes::Constraint)); constr_name.remove(constr_name.length() - 1, 1); - obj_xml.remove(QRegExp(AttributeExpr.arg(ParsersAttributes::CONSTRAINT))); + obj_xml.remove(QRegExp(AttributeExpr.arg(Attributes::Constraint))); - start_idx = obj_xml.indexOf(TagExpr.arg(ParsersAttributes::EXPRESSION)); + start_idx = obj_xml.indexOf(TagExpr.arg(Attributes::EXPRESSION)); obj_xml.insert(start_idx, QString("\n\t\n\t\t").arg(constr_name)); - end_idx = obj_xml.indexOf(EndTagExpr.arg(ParsersAttributes::EXPRESSION)); - obj_xml.insert(end_idx + EndTagExpr.arg(ParsersAttributes::EXPRESSION).length() + 1, QString("\n\t\n")); + end_idx = obj_xml.indexOf(EndTagExpr.arg(Attributes::EXPRESSION)); + obj_xml.insert(end_idx + EndTagExpr.arg(Attributes::EXPRESSION).length() + 1, QString("\n\t\n")); } //Fix the references to op. classes and families if needed @@ -1115,7 +1115,7 @@ void PgModelerCli::fixOpClassesFamiliesReferences(QString &obj_xml) if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Index))) || obj_xml.contains(QRegExp(QString("(%1)(.)+(type=)(\")(%2)(\")") .arg(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Constraint))) - .arg(ParsersAttributes::EX_CONSTR)))) + .arg(Attributes::EX_CONSTR)))) ref_obj_type=ObjectType::OpClass; else if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::OpClass)))) ref_obj_type=ObjectType::OpFamily; @@ -1276,7 +1276,7 @@ void PgModelerCli::importDatabase(DatabaseModel *model, Connection conn) catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); - catalog.getObjectsOIDs(obj_oids, col_oids, {{ParsersAttributes::FILTER_TABLE_TYPES, ParsersAttributes::True}}); + catalog.getObjectsOIDs(obj_oids, col_oids, {{Attributes::FILTER_TABLE_TYPES, Attributes::True}}); db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::ParamDbName), ObjectType::Database); obj_oids[ObjectType::Database].push_back(db_oid.toUInt()); @@ -1458,8 +1458,8 @@ QStringList PgModelerCli::extractForeignKeys(QString &obj_xml) { QStringList constr_lst; int start=0, end=0, pos=0, count=0; - QString start_tag=QString("<%1").arg(ParsersAttributes::CONSTRAINT), - end_tag=QString(" attribs={ ParsersAttributes::RELATIONSHIP, - ParsersAttributes::TYPE, ParsersAttributes::SRC_REQUIRED, ParsersAttributes::DST_REQUIRED, - ParsersAttributes::SRC_TABLE, ParsersAttributes::DST_TABLE, ParsersAttributes::POINTS, - ParsersAttributes::COLUMNS, ParsersAttributes::COLUMN, ParsersAttributes::CONSTRAINT, - ParsersAttributes::LABEL, ParsersAttributes::LINE, ParsersAttributes::POSITION, - ParsersAttributes::IDENTIFIER, ParsersAttributes::DEFERRABLE, ParsersAttributes::DEFER_TYPE, - ParsersAttributes::TABLE_NAME, ParsersAttributes::SPECIAL_PK_COLS, ParsersAttributes::TABLE, - ParsersAttributes::AncestorTable, ParsersAttributes::COPY_OPTIONS, ParsersAttributes::COPY_MODE, - ParsersAttributes::SRC_COL_PATTERN, ParsersAttributes::DST_COL_PATTERN, ParsersAttributes::PK_PATTERN, - ParsersAttributes::UQ_PATTERN, ParsersAttributes::SRC_FK_PATTERN, ParsersAttributes::DST_FK_PATTERN }; + static vector attribs={ Attributes::RELATIONSHIP, + Attributes::TYPE, Attributes::SRC_REQUIRED, Attributes::DST_REQUIRED, + Attributes::SRC_TABLE, Attributes::DST_TABLE, Attributes::POINTS, + Attributes::Columns, Attributes::Column, Attributes::Constraint, + Attributes::LABEL, Attributes::LINE, Attributes::POSITION, + Attributes::IDENTIFIER, Attributes::DEFERRABLE, Attributes::DEFER_TYPE, + Attributes::TABLE_NAME, Attributes::SPECIAL_PK_COLS, Attributes::TABLE, + Attributes::AncestorTable, Attributes::CopyOptions, Attributes::CopyMode, + Attributes::SRC_COL_PATTERN, Attributes::DST_COL_PATTERN, Attributes::PK_PATTERN, + Attributes::UQ_PATTERN, Attributes::SRC_FK_PATTERN, Attributes::DST_FK_PATTERN }; for(unsigned i=0; i < attribs.size() && !found; i++) found=str.contains(attribs[i]); @@ -1561,10 +1561,10 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) QString startup_script=QString("%1/start-pgmodeler.sh") .arg(QFileInfo(GlobalAttributes::PgModelerAppPath).absolutePath()); - attribs[ParsersAttributes::WORKING_DIR]=QStandardPaths::writableLocation(QStandardPaths::HomeLocation); - attribs[ParsersAttributes::Application]=(QFileInfo(startup_script).exists() ? + attribs[Attributes::WORKING_DIR]=QStandardPaths::writableLocation(QStandardPaths::HomeLocation); + attribs[Attributes::Application]=(QFileInfo(startup_script).exists() ? startup_script : GlobalAttributes::PgModelerAppPath); - attribs[ParsersAttributes::ICON]=exec_icon; + attribs[Attributes::ICON]=exec_icon; } try @@ -1593,7 +1593,7 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) out.write(buf.data(), buf.size()); out.close(); buf.clear(); - attribs[ParsersAttributes::ICON]=dbm_icon; + attribs[Attributes::ICON]=dbm_icon; } } diff --git a/main/src/application.cpp b/main/src/application.cpp index fc49c9c761..2b74dda21e 100644 --- a/main/src/application.cpp +++ b/main/src/application.cpp @@ -18,7 +18,7 @@ #include "application.h" #include "globalattributes.h" #include "messagebox.h" -#include "parsersattributes.h" +#include "attributes.h" Application::Application(int &argc, char **argv) : QApplication(argc,argv) { @@ -68,12 +68,12 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) if(input.open(QFile::ReadOnly)) { QString buf = QString(input.readAll()); - QRegExp regexp = QRegExp(QString("(%1)(.*)(=)(\\\")(.)+(\\\")(\\\n)").arg(ParsersAttributes::UI_LANGUAGE)); + QRegExp regexp = QRegExp(QString("(%1)(.*)(=)(\\\")(.)+(\\\")(\\\n)").arg(Attributes::UI_LANGUAGE)); int idx = regexp.indexIn(QString(buf)); //Extract the value of the ui-language attribute in the conf file lang_id = buf.mid(idx, regexp.matchedLength()); - lang_id.remove(ParsersAttributes::UI_LANGUAGE); + lang_id.remove(Attributes::UI_LANGUAGE); lang_id.remove(QChar('"')).remove(QChar('=')).remove(QChar('\n')); } diff --git a/tests/src/roletest/roletest.cpp b/tests/src/roletest/roletest.cpp index c0ab037a9b..386e642a89 100644 --- a/tests/src/roletest/roletest.cpp +++ b/tests/src/roletest/roletest.cpp @@ -42,7 +42,7 @@ void RoleTest::alterCommandEndsWithSemiColon(void) role2.setOption(Role::OpLogin, false); alter_cmd=role1.getAlterDefinition(&role2); - alter_cmd.remove(QString("\n%1\n").arg(ParsersAttributes::DDL_END_TOKEN)); + alter_cmd.remove(QString("\n%1\n").arg(Attributes::DDL_END_TOKEN)); QCOMPARE(alter_cmd.endsWith(";"), true); } From 97f3fc81126001db7e11e79ddc9c2a655630fa7c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 09:17:21 -0300 Subject: [PATCH 180/425] Attributes namespace static const items refactoring checkpoint --- libparsers/src/attributes.cpp | 102 ++++++------- libparsers/src/attributes.h | 102 ++++++------- libpgmodeler/src/baseobject.cpp | 8 +- libpgmodeler/src/baserelationship.cpp | 22 +-- libpgmodeler/src/cast.cpp | 6 +- libpgmodeler/src/collation.cpp | 4 +- libpgmodeler/src/column.cpp | 14 +- libpgmodeler/src/constraint.cpp | 32 ++-- libpgmodeler/src/conversion.cpp | 8 +- libpgmodeler/src/databasemodel.cpp | 138 +++++++++--------- libpgmodeler/src/domain.cpp | 16 +- libpgmodeler/src/eventtrigger.cpp | 4 +- libpgmodeler/src/function.cpp | 8 +- libpgmodeler/src/genericsql.cpp | 4 +- libpgmodeler/src/index.cpp | 8 +- libpgmodeler/src/operatorclass.cpp | 8 +- libpgmodeler/src/operatorclasselement.cpp | 12 +- libpgmodeler/src/parameter.cpp | 2 +- libpgmodeler/src/permission.cpp | 2 +- libpgmodeler/src/pgsqltypes.cpp | 4 +- libpgmodeler/src/relationship.cpp | 12 +- libpgmodeler/src/role.cpp | 6 +- libpgmodeler/src/rule.cpp | 4 +- libpgmodeler/src/table.cpp | 2 +- libpgmodeler/src/tablespace.cpp | 4 +- libpgmodeler/src/trigger.cpp | 20 +-- libpgmodeler/src/type.cpp | 24 +-- libpgmodeler/src/view.cpp | 8 +- .../src/connectionsconfigwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 74 +++++----- libpgmodeler_ui/src/databaseimporthelper.cpp | 48 +++--- libpgmodeler_ui/src/datamanipulationform.cpp | 6 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 16 +- libpgmodeler_ui/src/mainwindow.cpp | 4 +- libpgmodeler_ui/src/modelexporthelper.cpp | 4 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 14 +- libpgmodeler_ui/src/permissionwidget.cpp | 2 +- .../src/relationshipconfigwidget.cpp | 20 +-- libpgmodeler_ui/src/relationshipwidget.cpp | 10 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 6 +- main-cli/src/pgmodelercli.cpp | 20 +-- tests/src/roletest/roletest.cpp | 2 +- 42 files changed, 407 insertions(+), 407 deletions(-) diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index de788a903b..200b69e3f1 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -133,57 +133,57 @@ namespace Attributes { DataDirectory=QString("data-directory"), Date=QString("date"), Database=QString("database"), - DB_MODEL=QString("dbmodel"), - DDL_END_TOKEN=QString("-- ddl-end --"), - DEAD_ROWS_AMOUNT=QString("dead-rows-amount"), - DECL_IN_TABLE=QString("decl-in-table"), - DECLARATION=QString("declaration"), - DEFAULT_COLLATION=QString("default-collation"), - DEFAULT_FOR_OPS=QString("default-for-ops"), - DEFAULT_OWNER=QString("default-owner"), - DEFAULT_SCHEMA=QString("default-schema"), - DEFAULT_TABLESPACE=QString("default-tablespace"), - DEFAULT_VALUE=QString("default-value"), - DEFAULT=QString("default"), - DEFER_TYPE=QString("defer-type"), - DEFERRABLE=QString("deferrable"), - DEFINITION=QString("definition"), - DEL_ACTION=QString("del-action"), - DEL_EVENT=QString("del-event"), - DELETE_PRIV=QString("delete"), - DELIMITER=QString("delimiter"), - DEST_TYPE=QString("destiny-type"), - DST_TYPE=QString("dst-type"), - DIFF=QString("diff"), - DIMENSION=QString("dimension"), - DIRECTORY=QString("directory"), - DISABLE_SMOOTHNESS=QString("disable-smoothness"), - DISPLAY_LINE_NUMBERS=QString("display-line-numbers"), - DOM_CONSTRAINT=QString("domconstraint"), - DOCK_WIDGETS=QString("dock-widgets"), - DROP_CMDS=QString("drop-cmds"), - DROP=QString("drop"), - DST_COL_PATTERN=QString("dst-col-pattern"), - DST_COLUMNS=QString("dst-columns"), - DST_ENCODING=QString("dst-encoding"), - DST_FK_PATTERN=QString("dst-fk-pattern"), - DST_LABEL=QString("dst-label"), - DST_REQUIRED=QString("dst-required"), - DST_TABLE=QString("dst-table"), - DYNAMIC_LIBRARY_PATH=QString("dynamic-library-path"), - DYNAMIC_SHARED_MEMORY=QString("dynamic-shared-memory-type"), - END_EXP=QString("end-exp"), - ELEMENT=QString("element"), - ELEMENTS=QString("elements"), - ENCODING=QString("encoding"), - ENCRYPTED=QString("encrypted"), - ENUM_TYPE=QString("enumeration"), - ENUMERATIONS=QString("enumerations"), - EVENT_TYPE=QString("event-type"), - EVENT=QString("event"), - EVENTS=QString("events"), - EX_CONSTR=QString("ex-constr"), - EXACT_MATCH=QString("exact-match"), + DbModel=QString("dbmodel"), + DdlEndToken=QString("-- ddl-end --"), + DeadRowsAmount=QString("dead-rows-amount"), + DeclInTable=QString("decl-in-table"), + Declaration=QString("declaration"), + DefaultCollation=QString("default-collation"), + DefaultForOps=QString("default-for-ops"), + DefaultOwner=QString("default-owner"), + DefaultSchema=QString("default-schema"), + DefaultTablespace=QString("default-tablespace"), + DefaultValue=QString("default-value"), + Default=QString("default"), + DeferType=QString("defer-type"), + Deferrable=QString("deferrable"), + Definition=QString("definition"), + DelAction=QString("del-action"), + DelEvent=QString("del-event"), + DeletePriv=QString("delete"), + Delimiter=QString("delimiter"), + DestType=QString("destiny-type"), + DstType=QString("dst-type"), + Diff=QString("diff"), + Dimension=QString("dimension"), + Directory=QString("directory"), + DisableSmoothness=QString("disable-smoothness"), + DisplayLineNumbers=QString("display-line-numbers"), + DomConstraint=QString("domconstraint"), + DockWidgets=QString("dock-widgets"), + DropCmds=QString("drop-cmds"), + Drop=QString("drop"), + DstColPattern=QString("dst-col-pattern"), + DstColumns=QString("dst-columns"), + DstEncoding=QString("dst-encoding"), + DstFkPattern=QString("dst-fk-pattern"), + DstLabel=QString("dst-label"), + DstRequired=QString("dst-required"), + DstTable=QString("dst-table"), + DynamicLibraryPath=QString("dynamic-library-path"), + DynamicSharedMemory=QString("dynamic-shared-memory-type"), + EndExp=QString("end-exp"), + Element=QString("element"), + Elements=QString("elements"), + Encoding=QString("encoding"), + Encrypted=QString("encrypted"), + EnumType=QString("enumeration"), + Enumerations=QString("enumerations"), + EventType=QString("event-type"), + Event=QString("event"), + Events=QString("events"), + ExConstr=QString("ex-constr"), + ExactMatch=QString("exact-match"), EXC_BUILTIN_ARRAYS=QString("exc-builtin-arrays"), EXCLUDE_ELEMENT=QString("excelement"), EXEC_TYPE=QString("exec-type"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index d642dd42f2..3024804931 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -148,57 +148,57 @@ namespace Attributes { Database, DataDirectory, Date, - DB_MODEL, - DDL_END_TOKEN, - DEAD_ROWS_AMOUNT, - DECL_IN_TABLE, - DECLARATION, - DEFAULT_COLLATION, - DEFAULT_FOR_OPS, - DEFAULT_OWNER, - DEFAULT_SCHEMA, - DEFAULT_TABLESPACE, - DEFAULT_VALUE, - DEFAULT, - DEFER_TYPE, - DEFERRABLE, - DEFINITION, - DEL_ACTION, - DEL_EVENT, - DELETE_PRIV, - DELIMITER, - DEST_TYPE, - DST_TYPE, - DIFF, - DIMENSION, - DIRECTORY, - DISABLE_SMOOTHNESS, - DISPLAY_LINE_NUMBERS, - DOM_CONSTRAINT, - DOCK_WIDGETS, - DROP_CMDS, - DROP, - DST_COL_PATTERN, - DST_COLUMNS, - DST_ENCODING, - DST_FK_PATTERN, - DST_LABEL, - DST_REQUIRED, - DST_TABLE, - DYNAMIC_LIBRARY_PATH, - DYNAMIC_SHARED_MEMORY, - ELEMENT, - ELEMENTS, - ENCODING, - ENCRYPTED, - END_EXP, - ENUM_TYPE, - ENUMERATIONS, - EVENT_TYPE, - EVENT, - EVENTS, - EX_CONSTR, - EXACT_MATCH, + DbModel, + DdlEndToken, + DeadRowsAmount, + DeclInTable, + Declaration, + DefaultCollation, + DefaultForOps, + DefaultOwner, + DefaultSchema, + DefaultTablespace, + DefaultValue, + Default, + DeferType, + Deferrable, + Definition, + DelAction, + DelEvent, + DeletePriv, + Delimiter, + DestType, + DstType, + Diff, + Dimension, + Directory, + DisableSmoothness, + DisplayLineNumbers, + DomConstraint, + DockWidgets, + DropCmds, + Drop, + DstColPattern, + DstColumns, + DstEncoding, + DstFkPattern, + DstLabel, + DstRequired, + DstTable, + DynamicLibraryPath, + DynamicSharedMemory, + Element, + Elements, + Encoding, + Encrypted, + EndExp, + EnumType, + Enumerations, + EventType, + Event, + Events, + ExConstr, + ExactMatch, EXC_BUILTIN_ARRAYS, EXCLUDE_ELEMENT, EXEC_TYPE, diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 2090e0bafc..4da9cd2773 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -93,7 +93,7 @@ BaseObject::BaseObject(void) attributes[Attributes::SQL_DISABLED]=QString(); attributes[Attributes::AppendedSql]=QString(); attributes[Attributes::PREPENDED_SQL]=QString(); - attributes[Attributes::DROP]=QString(); + attributes[Attributes::Drop]=QString(); attributes[Attributes::SIGNATURE]=QString(); this->setName(QApplication::translate("BaseObject","new_object","", -1)); } @@ -813,8 +813,8 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(def_type==SchemaParser::SqlDefinition && this->acceptsDropCommand()) { - attributes[Attributes::DROP]=getDropDefinition(true); - attributes[Attributes::DROP].remove(Attributes::DDL_END_TOKEN + '\n'); + attributes[Attributes::Drop]=getDropDefinition(true); + attributes[Attributes::Drop].remove(Attributes::DdlEndToken + '\n'); } attributes[Attributes::REDUCED_FORM]=(reduced_form ? Attributes::True : QString()); @@ -1131,7 +1131,7 @@ QString BaseObject::getDropDefinition(bool cascade) attribs[Attributes::Cascade]=(cascade ? Attributes::True : QString()); - return(schparser.getCodeDefinition(Attributes::DROP, attribs, SchemaParser::SqlDefinition)); + return(schparser.getCodeDefinition(Attributes::Drop, attribs, SchemaParser::SqlDefinition)); } else return(QString()); diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 26662aa12f..7a65c539a0 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -79,17 +79,17 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::TYPE]=QString(); attributes[Attributes::SRC_REQUIRED]=QString(); - attributes[Attributes::DST_REQUIRED]=QString(); + attributes[Attributes::DstRequired]=QString(); attributes[Attributes::SRC_TABLE]=QString(); - attributes[Attributes::DST_TABLE]=QString(); + attributes[Attributes::DstTable]=QString(); attributes[Attributes::POINTS]=QString(); attributes[Attributes::Columns]=QString(); attributes[Attributes::Constraints]=QString(); - attributes[Attributes::ELEMENTS]=QString(); + attributes[Attributes::Elements]=QString(); attributes[Attributes::IDENTIFIER]=QString(); attributes[Attributes::REDUCED_FORM]=QString(); - attributes[Attributes::DEFERRABLE]=QString(); - attributes[Attributes::DEFER_TYPE]=QString(); + attributes[Attributes::Deferrable]=QString(); + attributes[Attributes::DeferType]=QString(); attributes[Attributes::TABLE_NAME]=QString(); attributes[Attributes::SPECIAL_PK_COLS]=QString(); attributes[Attributes::RELATIONSHIP_NN]=QString(); @@ -104,15 +104,15 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::CopyOptions]=QString(); attributes[Attributes::CopyMode]=QString(); attributes[Attributes::SRC_COL_PATTERN]=QString(); - attributes[Attributes::DST_COL_PATTERN]=QString(); + attributes[Attributes::DstColPattern]=QString(); attributes[Attributes::PK_PATTERN]=QString(); attributes[Attributes::UQ_PATTERN]=QString(); attributes[Attributes::SRC_FK_PATTERN]=QString(); - attributes[Attributes::DST_FK_PATTERN]=QString(); + attributes[Attributes::DstFkPattern]=QString(); attributes[Attributes::PK_COL_PATTERN]=QString(); attributes[Attributes::SINGLE_PK_COLUMN]=QString(); attributes[Attributes::UPD_ACTION]=QString(); - attributes[Attributes::DEL_ACTION]=QString(); + attributes[Attributes::DelAction]=QString(); attributes[Attributes::CustomColor]=QString(); attributes[Attributes::REFERENCE_FK]=QString(); attributes[Attributes::PARTITION_BOUND_EXPR]=QString(); @@ -329,19 +329,19 @@ void BaseRelationship::setRelationshipAttributes(void) unsigned count, i; QString str_aux, label_attribs[3]={ Attributes::SRC_LABEL, - Attributes::DST_LABEL, + Attributes::DstLabel, Attributes::NAME_LABEL}; attributes[Attributes::TYPE]=getRelTypeAttribute(); attributes[Attributes::SRC_REQUIRED]=(src_mandatory ? Attributes::True : QString()); - attributes[Attributes::DST_REQUIRED]=(dst_mandatory ? Attributes::True : QString()); + attributes[Attributes::DstRequired]=(dst_mandatory ? Attributes::True : QString()); if(src_table) attributes[Attributes::SRC_TABLE]=src_table->getName(true); if(dst_table) - attributes[Attributes::DST_TABLE]=dst_table->getName(true); + attributes[Attributes::DstTable]=dst_table->getName(true); count=points.size(); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 872337ed18..a9b203b97e 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -25,7 +25,7 @@ Cast::Cast(void) cast_type=Explicit; is_in_out=false; attributes[Attributes::SOURCE_TYPE]=QString(); - attributes[Attributes::DEST_TYPE]=QString(); + attributes[Attributes::DestType]=QString(); attributes[Attributes::CastType]=QString(); attributes[Attributes::IO_CAST]=QString(); attributes[Attributes::FUNCTION]=QString(); @@ -167,12 +167,12 @@ QString Cast::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { attributes[Attributes::SOURCE_TYPE]=(*types[SrcType]); - attributes[Attributes::DEST_TYPE]=(*types[DstType]); + attributes[Attributes::DestType]=(*types[DstType]); } else { attributes[Attributes::SOURCE_TYPE]=types[SrcType].getCodeDefinition(def_type); - attributes[Attributes::DEST_TYPE]=types[DstType].getCodeDefinition(def_type); + attributes[Attributes::DestType]=types[DstType].getCodeDefinition(def_type); } if(!is_in_out && cast_function) diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index 1e18cabf3e..f8bff6dcfc 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -26,7 +26,7 @@ Collation::Collation(void) attributes[Attributes::LcCtype]=QString(); attributes[Attributes::LcCollate]=QString(); attributes[Attributes::LOCALE]=QString(); - attributes[Attributes::ENCODING]=QString(); + attributes[Attributes::Encoding]=QString(); } void Collation::setLocale(const QString &locale) @@ -126,7 +126,7 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) } } - attributes[Attributes::ENCODING]=~encoding; + attributes[Attributes::Encoding]=~encoding; return(BaseObject::getCodeDefinition(def_type, reduced_form)); } diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 6aa1ee0945..624217399a 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -23,11 +23,11 @@ Column::Column(void) obj_type=ObjectType::Column; not_null=seq_cycle=false; attributes[Attributes::TYPE]=QString(); - attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::NOT_NULL]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::SEQUENCE]=QString(); - attributes[Attributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::IDENTITY_TYPE]=QString(); attributes[Attributes::INCREMENT]=QString(); attributes[Attributes::MIN_VALUE]=QString(); @@ -241,7 +241,7 @@ QString Column::getCodeDefinition(unsigned def_type) attributes[Attributes::TABLE]=getParentTable()->getName(true); attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); - attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::IDENTITY_TYPE]=QString(); if(identity_type != BaseType::Null) @@ -257,19 +257,19 @@ QString Column::getCodeDefinition(unsigned def_type) else { if(!sequence) - attributes[Attributes::DEFAULT_VALUE]=default_value; + attributes[Attributes::DefaultValue]=default_value; else { //Configuring the default value of the column to get the next value of the sequence if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::DEFAULT_VALUE]=QString("nextval('%1'::regclass)").arg(sequence->getSignature()); + attributes[Attributes::DefaultValue]=QString("nextval('%1'::regclass)").arg(sequence->getSignature()); attributes[Attributes::SEQUENCE]=sequence->getName(true); } } attributes[Attributes::NOT_NULL]=(!not_null ? QString() : Attributes::True); - attributes[Attributes::DECL_IN_TABLE]=(isDeclaredInTable() ? Attributes::True : QString()); + attributes[Attributes::DeclInTable]=(isDeclaredInTable() ? Attributes::True : QString()); return(BaseObject::__getCodeDefinition(def_type)); } @@ -304,7 +304,7 @@ QString Column::getAlterDefinition(BaseObject *object) def_val=col->default_value; if(this->default_value!=def_val) - attribs[Attributes::DEFAULT_VALUE]=(def_val.isEmpty() ? Attributes::UNSET : def_val); + attribs[Attributes::DefaultValue]=(def_val.isEmpty() ? Attributes::UNSET : def_val); if(this->not_null!=col->not_null) attribs[Attributes::NOT_NULL]=(!col->not_null ? Attributes::UNSET : Attributes::True); diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 5afface3be..f69b728a72 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -31,23 +31,23 @@ Constraint::Constraint(void) attributes[Attributes::FK_CONSTR]=QString(); attributes[Attributes::CkConstr]=QString(); attributes[Attributes::UQ_CONSTR]=QString(); - attributes[Attributes::EX_CONSTR]=QString(); + attributes[Attributes::ExConstr]=QString(); attributes[Attributes::REF_TABLE]=QString(); attributes[Attributes::SRC_COLUMNS]=QString(); - attributes[Attributes::DST_COLUMNS]=QString(); - attributes[Attributes::DEL_ACTION]=QString(); + attributes[Attributes::DstColumns]=QString(); + attributes[Attributes::DelAction]=QString(); attributes[Attributes::UPD_ACTION]=QString(); attributes[Attributes::EXPRESSION]=QString(); attributes[Attributes::TYPE]=QString(); attributes[Attributes::ComparisonType]=QString(); - attributes[Attributes::DEFER_TYPE]=QString(); + attributes[Attributes::DeferType]=QString(); attributes[Attributes::INDEX_TYPE]=QString(); - attributes[Attributes::DEFERRABLE]=QString(); + attributes[Attributes::Deferrable]=QString(); attributes[Attributes::TABLE]=QString(); - attributes[Attributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::FACTOR]=QString(); attributes[Attributes::NO_INHERIT]=QString(); - attributes[Attributes::ELEMENTS]=QString(); + attributes[Attributes::Elements]=QString(); } Constraint::~Constraint(void) @@ -197,7 +197,7 @@ void Constraint::setColumnsAttribute(unsigned col_type, unsigned def_type, bool if(col_type==ReferencedCols) { col_vector=&ref_columns; - attrib=Attributes::DST_COLUMNS; + attrib=Attributes::DstColumns; } else { @@ -630,7 +630,7 @@ void Constraint::setExcludeElementsAttribute(unsigned def_type) if(i < (count-1) && def_type==SchemaParser::SqlDefinition) str_elem+=','; } - attributes[Attributes::ELEMENTS]=str_elem; + attributes[Attributes::Elements]=str_elem; } void Constraint::setIndexType(IndexingType index_type) @@ -651,9 +651,9 @@ QString Constraint::getCodeDefinition(unsigned def_type) void Constraint::setDeclInTableAttribute(void) { if(!isDeclaredInTable() || (constr_type==ConstraintType::ForeignKey && !isAddedByLinking())) - attributes[Attributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::DeclInTable]=QString(); else if(!isReferRelationshipAddedColumn() || constr_type==ConstraintType::PrimaryKey) - attributes[Attributes::DECL_IN_TABLE]=Attributes::True; + attributes[Attributes::DeclInTable]=Attributes::True; } QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) @@ -667,7 +667,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[Attributes::FK_CONSTR]=QString(); attributes[Attributes::CkConstr]=QString(); attributes[Attributes::UQ_CONSTR]=QString(); - attributes[Attributes::EX_CONSTR]=QString(); + attributes[Attributes::ExConstr]=QString(); switch(!constr_type) { @@ -684,14 +684,14 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attrib=Attributes::UQ_CONSTR; break; default: - attrib=Attributes::EX_CONSTR; + attrib=Attributes::ExConstr; break; } attributes[attrib]=Attributes::True; attributes[Attributes::TYPE]=attrib; attributes[Attributes::UPD_ACTION]=(~upd_action); - attributes[Attributes::DEL_ACTION]=(~del_action); + attributes[Attributes::DelAction]=(~del_action); attributes[Attributes::EXPRESSION]=expression; if(constr_type!=ConstraintType::Check) @@ -711,10 +711,10 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) } attributes[Attributes::REF_TABLE]=(ref_table ? ref_table->getName(true) : QString()); - attributes[Attributes::DEFERRABLE]=(deferrable ? Attributes::True : QString()); + attributes[Attributes::Deferrable]=(deferrable ? Attributes::True : QString()); attributes[Attributes::NO_INHERIT]=(no_inherit ? Attributes::True : QString()); attributes[Attributes::ComparisonType]=(~match_type); - attributes[Attributes::DEFER_TYPE]=(~deferral_type); + attributes[Attributes::DeferType]=(~deferral_type); attributes[Attributes::INDEX_TYPE]=(~ index_type); if(getParentTable()) diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index 6634eb21e3..42d64967e4 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -23,9 +23,9 @@ Conversion::Conversion(void) obj_type=ObjectType::Conversion; conversion_func=nullptr; is_default=false; - attributes[Attributes::DEFAULT]=QString(); + attributes[Attributes::Default]=QString(); attributes[Attributes::SRC_ENCODING]=QString(); - attributes[Attributes::DST_ENCODING]=QString(); + attributes[Attributes::DstEncoding]=QString(); attributes[Attributes::FUNCTION]=QString(); } @@ -115,9 +115,9 @@ QString Conversion::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[Attributes::DEFAULT]=(is_default ? Attributes::True : QString()); + attributes[Attributes::Default]=(is_default ? Attributes::True : QString()); attributes[Attributes::SRC_ENCODING]=(~encodings[SrcEncoding]); - attributes[Attributes::DST_ENCODING]=(~encodings[DstEncoding]); + attributes[Attributes::DstEncoding]=(~encodings[DstEncoding]); if(conversion_func) { diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 0317083246..85bb718202 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -41,7 +41,7 @@ DatabaseModel::DatabaseModel(void) conn_limit=-1; last_zoom=1; loading_model=invalidated=append_at_eod=prepend_at_bod=false; - attributes[Attributes::ENCODING]=QString(); + attributes[Attributes::Encoding]=QString(); attributes[Attributes::TEMPLATE_DB]=QString(); attributes[Attributes::ConnLimit]=QString(); attributes[Attributes::LcCollate]=QString(); @@ -2965,7 +2965,7 @@ int DatabaseModel::getObjectIndex(BaseObject *object) void DatabaseModel::configureDatabase(attribs_map &attribs) { - encoding=attribs[Attributes::ENCODING]; + encoding=attribs[Attributes::Encoding]; template_db=attribs[Attributes::TEMPLATE_DB]; localizations[0]=attribs[Attributes::LcCtype]; localizations[1]=attribs[Attributes::LcCollate]; @@ -3034,10 +3034,10 @@ void DatabaseModel::loadModel(const QString &filename) protected_model=(attribs[Attributes::PROTECTED]==Attributes::True); - def_objs[ObjectType::Schema]=attribs[Attributes::DEFAULT_SCHEMA]; - def_objs[ObjectType::Role]=attribs[Attributes::DEFAULT_OWNER]; - def_objs[ObjectType::Collation]=attribs[Attributes::DEFAULT_COLLATION]; - def_objs[ObjectType::Tablespace]=attribs[Attributes::DEFAULT_TABLESPACE]; + def_objs[ObjectType::Schema]=attribs[Attributes::DefaultSchema]; + def_objs[ObjectType::Role]=attribs[Attributes::DefaultOwner]; + def_objs[ObjectType::Collation]=attribs[Attributes::DefaultCollation]; + def_objs[ObjectType::Tablespace]=attribs[Attributes::DefaultTablespace]; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3458,7 +3458,7 @@ Role *DatabaseModel::createRole(void) QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::INHERIT, - Attributes::LOGIN, Attributes::ENCRYPTED, + Attributes::LOGIN, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; unsigned op_vect[]={ Role::OpSuperuser, Role::OpCreateDb, @@ -3556,7 +3556,7 @@ Tablespace *DatabaseModel::createTablespace(void) tabspc=new Tablespace; setBasicAttributes(tabspc); xmlparser.getElementAttributes(attribs); - tabspc->setDirectory(attribs[Attributes::DIRECTORY]); + tabspc->setDirectory(attribs[Attributes::Directory]); } catch(Exception &e) { @@ -3779,7 +3779,7 @@ Function *DatabaseModel::createFunction(void) func->addParameter(param); } //Gets the function code definition - else if(xmlparser.getElementName()==Attributes::DEFINITION) + else if(xmlparser.getElementName()==Attributes::Definition) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs_aux); @@ -3831,7 +3831,7 @@ Parameter DatabaseModel::createParameter(void) xmlparser.getElementAttributes(attribs); param.setName(attribs[Attributes::NAME]); - param.setDefaultValue(attribs[Attributes::DEFAULT_VALUE]); + param.setDefaultValue(attribs[Attributes::DefaultValue]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3944,8 +3944,8 @@ PgSqlType DatabaseModel::createPgSQLType(void) if(!attribs[Attributes::LENGTH].isEmpty()) length=attribs[Attributes::LENGTH].toUInt(); - if(!attribs[Attributes::DIMENSION].isEmpty()) - dimension=attribs[Attributes::DIMENSION].toUInt(); + if(!attribs[Attributes::Dimension].isEmpty()) + dimension=attribs[Attributes::Dimension].toUInt(); if(!attribs[Attributes::PRECISION].isEmpty()) precision=attribs[Attributes::PRECISION].toInt(); @@ -4017,14 +4017,14 @@ Type *DatabaseModel::createType(void) if(!attribs[Attributes::STORAGE].isEmpty()) type->setStorage(attribs[Attributes::STORAGE]); - if(!attribs[Attributes::ELEMENT].isEmpty()) - type->setElement(attribs[Attributes::ELEMENT]); + if(!attribs[Attributes::Element].isEmpty()) + type->setElement(attribs[Attributes::Element]); - if(!attribs[Attributes::DELIMITER].isEmpty()) - type->setDelimiter(attribs[Attributes::DELIMITER][0].toLatin1()); + if(!attribs[Attributes::Delimiter].isEmpty()) + type->setDelimiter(attribs[Attributes::Delimiter][0].toLatin1()); - if(!attribs[Attributes::DEFAULT_VALUE].isEmpty()) - type->setDefaultValue(attribs[Attributes::DEFAULT_VALUE]); + if(!attribs[Attributes::DefaultValue].isEmpty()) + type->setDefaultValue(attribs[Attributes::DefaultValue]); if(!attribs[Attributes::Category].isEmpty()) type->setCategory(attribs[Attributes::Category]); @@ -4043,7 +4043,7 @@ Type *DatabaseModel::createType(void) } else if(attribs[Attributes::Configuration]==Attributes::CompositeType) type->setConfiguration(Type::CompositeType); - else if(attribs[Attributes::Configuration]==Attributes::ENUM_TYPE) + else if(attribs[Attributes::Configuration]==Attributes::EnumType) type->setConfiguration(Type::EnumerationType); else { @@ -4061,7 +4061,7 @@ Type *DatabaseModel::createType(void) elem=xmlparser.getElementName(); //Specific operations for ENUM type - if(elem==Attributes::ENUM_TYPE) + if(elem==Attributes::EnumType) { xmlparser.getElementAttributes(attribs); enums=attribs[Attributes::VALUES].split(','); @@ -4180,8 +4180,8 @@ Domain *DatabaseModel::createDomain(void) setBasicAttributes(domain); xmlparser.getElementAttributes(attribs); - if(!attribs[Attributes::DEFAULT_VALUE].isEmpty()) - domain->setDefaultValue(attribs[Attributes::DEFAULT_VALUE]); + if(!attribs[Attributes::DefaultValue].isEmpty()) + domain->setDefaultValue(attribs[Attributes::DefaultValue]); domain->setNotNull(attribs[Attributes::NOT_NULL]==Attributes::True); @@ -4311,9 +4311,9 @@ Conversion *DatabaseModel::createConversion(void) EncodingType(attribs[Attributes::SRC_ENCODING])); conv->setEncoding(Conversion::DstEncoding, - EncodingType(attribs[Attributes::DST_ENCODING])); + EncodingType(attribs[Attributes::DstEncoding])); - conv->setDefault(attribs[Attributes::DEFAULT]==Attributes::True); + conv->setDefault(attribs[Attributes::Default]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4466,7 +4466,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) xmlparser.getElementAttributes(attribs); op_class->setIndexingType(IndexingType(attribs[Attributes::INDEX_TYPE])); - op_class->setDefault(attribs[Attributes::DEFAULT]==Attributes::True); + op_class->setDefault(attribs[Attributes::Default]==Attributes::True); elem_types[Attributes::FUNCTION]=OperatorClassElement::FunctionElem; elem_types[Attributes::OPERATOR]=OperatorClassElement::OperatorElem; @@ -4502,7 +4502,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) type=createPgSQLType(); op_class->setDataType(type); } - else if(elem==Attributes::ELEMENT) + else if(elem==Attributes::Element) { xmlparser.getElementAttributes(attribs); @@ -4819,7 +4819,7 @@ Column *DatabaseModel::createColumn(void) xmlparser.getElementAttributes(attribs); column->setNotNull(attribs[Attributes::NOT_NULL]==Attributes::True); - column->setDefaultValue(attribs[Attributes::DEFAULT_VALUE]); + column->setDefaultValue(attribs[Attributes::DefaultValue]); column->setIdSeqAttributes(attribs[Attributes::MIN_VALUE], attribs[Attributes::MAX_VALUE], attribs[Attributes::INCREMENT], attribs[Attributes::START], attribs[Attributes::Cache], attribs[Attributes::Cycle] == Attributes::True); @@ -4951,19 +4951,19 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) .arg(constr->getName()), ErrorCode::InvPrimaryKeyAllocation,__PRETTY_FUNCTION__,__FILE__,__LINE__); - deferrable=(attribs[Attributes::DEFERRABLE]==Attributes::True); + deferrable=(attribs[Attributes::Deferrable]==Attributes::True); constr->setDeferrable(deferrable); - if(deferrable && !attribs[Attributes::DEFER_TYPE].isEmpty()) - constr->setDeferralType(attribs[Attributes::DEFER_TYPE]); + if(deferrable && !attribs[Attributes::DeferType].isEmpty()) + constr->setDeferralType(attribs[Attributes::DeferType]); if(constr_type==ConstraintType::ForeignKey) { if(!attribs[Attributes::ComparisonType].isEmpty()) constr->setMatchType(attribs[Attributes::ComparisonType]); - if(!attribs[Attributes::DEL_ACTION].isEmpty()) - constr->setActionType(attribs[Attributes::DEL_ACTION], Constraint::DeleteAction); + if(!attribs[Attributes::DelAction].isEmpty()) + constr->setActionType(attribs[Attributes::DelAction], Constraint::DeleteAction); if(!attribs[Attributes::UPD_ACTION].isEmpty()) constr->setActionType(attribs[Attributes::UPD_ACTION], Constraint::UpdateAction); @@ -5397,7 +5397,7 @@ Rule *DatabaseModel::createRule(void) rule->setExecutionType(attribs[Attributes::EXEC_TYPE]); - rule->setEventType(attribs[Attributes::EVENT_TYPE]); + rule->setEventType(attribs[Attributes::EventType]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5486,7 +5486,7 @@ Trigger *DatabaseModel::createTrigger(void) (attribs[Attributes::INS_EVENT]==Attributes::True)); trigger->setEvent(EventType::OnDelete, - (attribs[Attributes::DEL_EVENT]==Attributes::True)); + (attribs[Attributes::DelEvent]==Attributes::True)); trigger->setEvent(EventType::OnUpdate, (attribs[Attributes::UPD_EVENT]==Attributes::True)); @@ -5509,10 +5509,10 @@ Trigger *DatabaseModel::createTrigger(void) trigger->addArgument(list_aux[i]); } - trigger->setDeferrable(attribs[Attributes::DEFERRABLE]==Attributes::True); + trigger->setDeferrable(attribs[Attributes::Deferrable]==Attributes::True); if(trigger->isDeferrable()) - trigger->setDeferralType(attribs[Attributes::DEFER_TYPE]); + trigger->setDeferralType(attribs[Attributes::DeferType]); if(!attribs[Attributes::REF_TABLE].isEmpty()) { @@ -5708,7 +5708,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) event_trig=new EventTrigger; setBasicAttributes(event_trig); xmlparser.getElementAttributes(attribs); - event_trig->setEvent(EventTriggerType(attribs[Attributes::EVENT])); + event_trig->setEvent(EventTriggerType(attribs[Attributes::Event])); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5768,7 +5768,7 @@ GenericSQL *DatabaseModel::createGenericSQL(void) if(xmlparser.accessElement(XmlParser::ChildElement)) { - if(xmlparser.getElementType()==XML_ELEMENT_NODE && xmlparser.getElementName() == Attributes::DEFINITION) + if(xmlparser.getElementType()==XML_ELEMENT_NODE && xmlparser.getElementName() == Attributes::Definition) { xmlparser.accessElement(XmlParser::ChildElement); genericsql->setDefinition(xmlparser.getElementContent()); @@ -6065,7 +6065,7 @@ Collation *DatabaseModel::createCollation(void) xmlparser.getElementAttributes(attribs); - encoding=EncodingType(attribs[Attributes::ENCODING]); + encoding=EncodingType(attribs[Attributes::Encoding]); collation->setEncoding(encoding); //Creating a collation from a base locale @@ -6214,7 +6214,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) ObjectType table_types[2]={ObjectType::View, ObjectType::Table}, obj_rel_type; QString str_aux, elem, tab_attribs[2]={ Attributes::SRC_TABLE, - Attributes::DST_TABLE }; + Attributes::DstTable }; QColor custom_color=Qt::transparent; Table *table = nullptr; @@ -6222,7 +6222,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) { labels_id[Attributes::NAME_LABEL]=BaseRelationship::RelNameLabel; labels_id[Attributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; - labels_id[Attributes::DST_LABEL]=BaseRelationship::DstCardLabel; + labels_id[Attributes::DstLabel]=BaseRelationship::DstCardLabel; xmlparser.getElementAttributes(attribs); protect=(attribs[Attributes::PROTECTED]==Attributes::True); @@ -6323,8 +6323,8 @@ BaseRelationship *DatabaseModel::createRelationship(void) } else { - QString pat_attrib[]= { Attributes::SRC_COL_PATTERN, Attributes::DST_COL_PATTERN, - Attributes::SRC_FK_PATTERN, Attributes::DST_FK_PATTERN, + QString pat_attrib[]= { Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, + Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, Attributes::PK_PATTERN, Attributes::UQ_PATTERN, Attributes::PK_COL_PATTERN }; @@ -6336,11 +6336,11 @@ BaseRelationship *DatabaseModel::createRelationship(void) sql_disabled=attribs[Attributes::SQL_DISABLED]==Attributes::True; src_mand=attribs[Attributes::SRC_REQUIRED]==Attributes::True; - dst_mand=attribs[Attributes::DST_REQUIRED]==Attributes::True; + dst_mand=attribs[Attributes::DstRequired]==Attributes::True; identifier=attribs[Attributes::IDENTIFIER]==Attributes::True; - deferrable=attribs[Attributes::DEFERRABLE]==Attributes::True; - defer_type=DeferralType(attribs[Attributes::DEFER_TYPE]); - del_action=ActionType(attribs[Attributes::DEL_ACTION]); + deferrable=attribs[Attributes::Deferrable]==Attributes::True; + defer_type=DeferralType(attribs[Attributes::DeferType]); + del_action=ActionType(attribs[Attributes::DelAction]); upd_action=ActionType(attribs[Attributes::UPD_ACTION]); single_pk_col=(attribs[Attributes::SINGLE_PK_COLUMN]==Attributes::True); @@ -6600,7 +6600,7 @@ Permission *DatabaseModel::createPermission(void) priv_type=Permission::PrivConnect; else if(itr->first==Attributes::CreatePriv) priv_type=Permission::PrivCreate; - else if(itr->first==Attributes::DELETE_PRIV) + else if(itr->first==Attributes::DeletePriv) priv_type=Permission::PrivDelete; else if(itr->first==Attributes::EXECUTE_PRIV) priv_type=Permission::PrivExecute; @@ -6727,7 +6727,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) QString loc_attribs[]={ Attributes::LcCtype, Attributes::LcCollate }; if(encoding!=BaseType::Null) - attributes[Attributes::ENCODING]=QString("'%1'").arg(~encoding); + attributes[Attributes::Encoding]=QString("'%1'").arg(~encoding); for(unsigned i=0; i < 2; i++) { @@ -6739,7 +6739,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) } else { - attributes[Attributes::ENCODING]=(~encoding); + attributes[Attributes::Encoding]=(~encoding); attributes[Attributes::LcCollate]=localizations[1]; attributes[Attributes::LcCtype]=localizations[0]; attributes[Attributes::AppendAtEod]=(append_at_eod ? Attributes::True : QString()); @@ -6935,10 +6935,10 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[Attributes::PROTECTED]=(this->is_protected ? Attributes::True : QString()); attribs_aux[Attributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs_aux[Attributes::LAST_ZOOM]=QString::number(last_zoom); - attribs_aux[Attributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getName(true) : QString()); - attribs_aux[Attributes::DEFAULT_OWNER]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getName(true) : QString()); - attribs_aux[Attributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getName(true) : QString()); - attribs_aux[Attributes::DEFAULT_COLLATION]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getName(true) : QString()); + attribs_aux[Attributes::DefaultSchema]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getName(true) : QString()); + attribs_aux[Attributes::DefaultOwner]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getName(true) : QString()); + attribs_aux[Attributes::DefaultTablespace]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getName(true) : QString()); + attribs_aux[Attributes::DefaultCollation]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getName(true) : QString()); } else { @@ -6971,7 +6971,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } attribs_aux[Attributes::EXPORT_TO_FILE]=(export_file ? Attributes::True : QString()); - def=schparser.getCodeDefinition(Attributes::DB_MODEL, attribs_aux, def_type); + def=schparser.getCodeDefinition(Attributes::DbModel, attribs_aux, def_type); if(prepend_at_bod && def_type==SchemaParser::SqlDefinition) def=QString("-- Prepended SQL commands --\n") + this->prepended_sql + QString("\n---\n\n") + def; @@ -9505,7 +9505,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option save_custom_sql=false, save_custom_colors=false, save_fadeout=false, save_extattribs=false, save_genericsqls=false, save_objs_aliases=false; QStringList labels_attrs={ Attributes::SRC_LABEL, - Attributes::DST_LABEL, + Attributes::DstLabel, Attributes::NAME_LABEL }; save_db_attribs=(MetaDbAttributes & options) == MetaDbAttributes; @@ -9658,10 +9658,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::MODEL_AUTHOR]=this->getAuthor(); attribs[Attributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs[Attributes::LAST_ZOOM]=QString::number(last_zoom); - attribs[Attributes::DEFAULT_COLLATION]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getSignature() : QString()); - attribs[Attributes::DEFAULT_SCHEMA]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getSignature() : QString()); - attribs[Attributes::DEFAULT_TABLESPACE]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getSignature() : QString()); - attribs[Attributes::DEFAULT_OWNER]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getSignature() : QString()); + attribs[Attributes::DefaultCollation]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getSignature() : QString()); + attribs[Attributes::DefaultSchema]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getSignature() : QString()); + attribs[Attributes::DefaultTablespace]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getSignature() : QString()); + attribs[Attributes::DefaultOwner]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getSignature() : QString()); } //If the object is a graphic one and we need to save positions and colors @@ -9711,8 +9711,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::SRC_TABLE]=rel->getTable(BaseRelationship::SrcTable)->getSignature(); attribs[Attributes::SRC_TYPE]=rel->getTable(BaseRelationship::SrcTable)->getSchemaName(); - attribs[Attributes::DST_TABLE]=rel->getTable(BaseRelationship::DstTable)->getSignature(); - attribs[Attributes::DST_TYPE]=rel->getTable(BaseRelationship::DstTable)->getSchemaName(); + attribs[Attributes::DstTable]=rel->getTable(BaseRelationship::DstTable)->getSignature(); + attribs[Attributes::DstType]=rel->getTable(BaseRelationship::DstTable)->getSchemaName(); for(QPointF pnt : points) { @@ -9861,7 +9861,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option try { labels_attrs[Attributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; - labels_attrs[Attributes::DST_LABEL]=BaseRelationship::DstCardLabel; + labels_attrs[Attributes::DstLabel]=BaseRelationship::DstCardLabel; labels_attrs[Attributes::NAME_LABEL]=BaseRelationship::RelNameLabel; xmlparser.restartParser(); @@ -9919,10 +9919,10 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { QStringList pos=attribs[Attributes::LAST_POSITION].split(','); - default_objs[ObjectType::Schema]=getSchema(attribs[Attributes::DEFAULT_SCHEMA]); - default_objs[ObjectType::Role]=getRole(attribs[Attributes::DEFAULT_OWNER]); - default_objs[ObjectType::Collation]=getCollation(attribs[Attributes::DEFAULT_COLLATION]); - default_objs[ObjectType::Tablespace]=getTablespace(attribs[Attributes::DEFAULT_TABLESPACE]); + default_objs[ObjectType::Schema]=getSchema(attribs[Attributes::DefaultSchema]); + default_objs[ObjectType::Role]=getRole(attribs[Attributes::DefaultOwner]); + default_objs[ObjectType::Collation]=getCollation(attribs[Attributes::DefaultCollation]); + default_objs[ObjectType::Tablespace]=getTablespace(attribs[Attributes::DefaultTablespace]); author=attribs[Attributes::MODEL_AUTHOR]; last_zoom=attribs[Attributes::LAST_ZOOM].toFloat(); @@ -9955,8 +9955,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { src_tab=dynamic_cast(getObject(attribs[Attributes::SRC_TABLE], BaseObject::getObjectType(attribs[Attributes::SRC_TYPE]))); - dst_tab=dynamic_cast(getObject(attribs[Attributes::DST_TABLE], - BaseObject::getObjectType(attribs[Attributes::DST_TYPE]))); + dst_tab=dynamic_cast(getObject(attribs[Attributes::DstTable], + BaseObject::getObjectType(attribs[Attributes::DstType]))); object=getRelationship(src_tab, dst_tab); } diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index c1602eaaeb..75593338ad 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -22,7 +22,7 @@ Domain::Domain(void) { obj_type=ObjectType::Domain; not_null=false; - attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::NOT_NULL]=QString(); attributes[Attributes::TYPE]=QString(); attributes[Attributes::Constraints]=QString(); @@ -127,13 +127,13 @@ QString Domain::getCodeDefinition(unsigned def_type) attribs_map aux_attribs; attributes[Attributes::NOT_NULL]=(not_null ? Attributes::True : QString()); - attributes[Attributes::DEFAULT_VALUE]=default_value; + attributes[Attributes::DefaultValue]=default_value; for(auto itr : chk_constrs) { aux_attribs[Attributes::NAME] = itr.first; aux_attribs[Attributes::EXPRESSION] = itr.second; - attributes[Attributes::Constraints]+=schparser.getCodeDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, def_type); + attributes[Attributes::Constraints]+=schparser.getCodeDefinition(Attributes::DomConstraint, aux_attribs, def_type); } if(def_type==SchemaParser::SqlDefinition) @@ -169,7 +169,7 @@ QString Domain::getAlterDefinition(BaseObject *object) attribs_map orig_constrs, aux_constrs, aux_attribs; QString orig_expr, aux_expr; - attributes[Attributes::DEFAULT_VALUE]=QString(); + attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::NOT_NULL]=QString(); attributes[Attributes::Constraints]=QString(); attributes[Attributes::EXPRESSION]=QString(); @@ -177,7 +177,7 @@ QString Domain::getAlterDefinition(BaseObject *object) attributes[Attributes::NEW_NAME]=QString(); if(this->default_value!=domain->default_value) - attributes[Attributes::DEFAULT_VALUE]=(!domain->default_value.isEmpty() ? domain->default_value : Attributes::UNSET); + attributes[Attributes::DefaultValue]=(!domain->default_value.isEmpty() ? domain->default_value : Attributes::UNSET); if(this->not_null!=domain->not_null) attributes[Attributes::NOT_NULL]=(domain->not_null ? Attributes::True : Attributes::UNSET); @@ -199,7 +199,7 @@ QString Domain::getAlterDefinition(BaseObject *object) { aux_attribs[Attributes::NAME]=constr.first; aux_attribs[Attributes::EXPRESSION]=Attributes::UNSET; - attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, false, true); + attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } //We should include a command to recreate the check constraint with the new expression @@ -207,7 +207,7 @@ QString Domain::getAlterDefinition(BaseObject *object) { aux_attribs[Attributes::NAME]=constr.first; aux_attribs[Attributes::EXPRESSION]=aux_constrs[constr.first]; - attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, false, true); + attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } } @@ -218,7 +218,7 @@ QString Domain::getAlterDefinition(BaseObject *object) { aux_attribs[Attributes::NAME]=constr.first; aux_attribs[Attributes::EXPRESSION]=constr.second; - attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, false, true); + attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } } diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 2b07ccfe5e..4985410255 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -22,7 +22,7 @@ EventTrigger::EventTrigger(void) { obj_type=ObjectType::EventTrigger; function=nullptr; - attributes[Attributes::EVENT]=QString(); + attributes[Attributes::Event]=QString(); attributes[Attributes::FILTER]=QString(); attributes[Attributes::FUNCTION]=QString(); } @@ -109,7 +109,7 @@ QString EventTrigger::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[Attributes::EVENT]=~event; + attributes[Attributes::Event]=~event; if(def_type==SchemaParser::SqlDefinition) { diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 50db09d263..90dd560708 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -39,7 +39,7 @@ Function::Function(void) attributes[Attributes::RETURNS_SETOF]=QString(); attributes[Attributes::SECURITY_TYPE]=QString(); attributes[Attributes::BehaviorType]=QString(); - attributes[Attributes::DEFINITION]=QString(); + attributes[Attributes::Definition]=QString(); attributes[Attributes::SIGNATURE]=QString(); attributes[Attributes::REF_TYPE]=QString(); attributes[Attributes::WINDOW_FUNC]=QString(); @@ -482,7 +482,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::LEAKPROOF]=(is_leakproof ? Attributes::True : QString()); attributes[Attributes::SECURITY_TYPE]=(~security_type); attributes[Attributes::BehaviorType]=(~behavior_type); - attributes[Attributes::DEFINITION]=source_code; + attributes[Attributes::Definition]=source_code; if(language->getName()==~LanguageType(LanguageType::C)) { @@ -511,8 +511,8 @@ QString Function::getAlterDefinition(BaseObject *object) this->library!=func->library || this->symbol!=func->symbol) { - attribs[Attributes::DEFINITION]=func->getCodeDefinition(SchemaParser::SqlDefinition); - attribs[Attributes::DEFINITION].replace(QString("CREATE FUNCTION"), QString("CREATE OR REPLACE FUNCTION")); + attribs[Attributes::Definition]=func->getCodeDefinition(SchemaParser::SqlDefinition); + attribs[Attributes::Definition].replace(QString("CREATE FUNCTION"), QString("CREATE OR REPLACE FUNCTION")); } else { diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 1b42fe8228..1b0d6f9fc3 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -21,7 +21,7 @@ GenericSQL::GenericSQL(void) { obj_type=ObjectType::GenericSql; - attributes[Attributes::DEFINITION] = QString(); + attributes[Attributes::Definition] = QString(); } void GenericSQL::setDefinition(const QString &def) @@ -40,7 +40,7 @@ QString GenericSQL::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[Attributes::DEFINITION] = definition; + attributes[Attributes::Definition] = definition; return(this->BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 200bbd894c..f093e68d4a 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -35,8 +35,8 @@ Index::Index(void) attributes[Attributes::OP_CLASS]=QString(); attributes[Attributes::NULLS_FIRST]=QString(); attributes[Attributes::AscOrder]=QString(); - attributes[Attributes::DECL_IN_TABLE]=QString(); - attributes[Attributes::ELEMENTS]=QString(); + attributes[Attributes::DeclInTable]=QString(); + attributes[Attributes::Elements]=QString(); attributes[Attributes::FAST_UPDATE]=QString(); attributes[Attributes::Buffering]=QString(); attributes[Attributes::STORAGE_PARAMS]=QString(); @@ -54,7 +54,7 @@ void Index::setIndexElementsAttribute(unsigned def_type) if(i < (count-1) && def_type==SchemaParser::SqlDefinition) str_elem+=','; } - attributes[Attributes::ELEMENTS]=str_elem; + attributes[Attributes::Elements]=str_elem; } int Index::getElementIndex(IndexElement elem) @@ -362,7 +362,7 @@ QString Index::getCodeDefinition(unsigned def_type) /* Case the index doesn't referece some column added by relationship it will be declared inside the parent table construction by the use of 'decl-in-table' schema attribute */ if(!isReferRelationshipAddedColumn()) - attributes[Attributes::DECL_IN_TABLE]=Attributes::True; + attributes[Attributes::DeclInTable]=Attributes::True; return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index 9a65f21d07..e9ec86ad78 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -24,10 +24,10 @@ OperatorClass::OperatorClass(void) family=nullptr; is_default=false; attributes[Attributes::FAMILY]=QString(); - attributes[Attributes::ELEMENTS]=QString(); + attributes[Attributes::Elements]=QString(); attributes[Attributes::INDEX_TYPE]=QString(); attributes[Attributes::TYPE]=QString(); - attributes[Attributes::DEFAULT]=QString(); + attributes[Attributes::Default]=QString(); } OperatorClass::~OperatorClass(void) @@ -78,7 +78,7 @@ void OperatorClass::setElementsAttribute(unsigned def_type) i < count-1) str_elems+=QString(",\n"); } - attributes[Attributes::ELEMENTS]=str_elems; + attributes[Attributes::Elements]=str_elems; } void OperatorClass::addElement(OperatorClassElement elem) @@ -173,7 +173,7 @@ QString OperatorClass::getCodeDefinition(unsigned def_type, bool reduced_form) setElementsAttribute(def_type); attributes[Attributes::INDEX_TYPE]=(~indexing_type); - attributes[Attributes::DEFAULT]=(is_default ? Attributes::True : QString()); + attributes[Attributes::Default]=(is_default ? Attributes::True : QString()); if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::TYPE]=(*data_type); diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 5b25f661df..2d75ee84ce 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -132,7 +132,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[Attributes::OPERATOR]=QString(); attributes[Attributes::STORAGE]=QString(); attributes[Attributes::OP_FAMILY]=QString(); - attributes[Attributes::DEFINITION]=QString(); + attributes[Attributes::Definition]=QString(); if(element_type==FunctionElem && function && strategy_number > 0) { @@ -143,7 +143,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::SIGNATURE]=function->getSignature(); else - attributes[Attributes::DEFINITION]=function->getCodeDefinition(def_type,true); + attributes[Attributes::Definition]=function->getCodeDefinition(def_type,true); } else if(element_type==OperatorElem && _operator && strategy_number > 0) { @@ -154,14 +154,14 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::SIGNATURE]=_operator->getSignature(); else - attributes[Attributes::DEFINITION]=_operator->getCodeDefinition(def_type,true); + attributes[Attributes::Definition]=_operator->getCodeDefinition(def_type,true); if(op_family) { if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::OP_FAMILY]=op_family->getName(true); else - attributes[Attributes::DEFINITION]+=op_family->getCodeDefinition(def_type,true); + attributes[Attributes::Definition]+=op_family->getCodeDefinition(def_type,true); } } else if(element_type==StorageElem && storage!=PgSqlType::Null) @@ -172,10 +172,10 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::TYPE]=(*storage); else - attributes[Attributes::DEFINITION]=storage.getCodeDefinition(def_type); + attributes[Attributes::Definition]=storage.getCodeDefinition(def_type); } - return(schparser.getCodeDefinition(Attributes::ELEMENT,attributes, def_type)); + return(schparser.getCodeDefinition(Attributes::Element,attributes, def_type)); } bool OperatorClassElement::operator == (OperatorClassElement &elem) diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index af94b84066..6a2e008e17 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -101,7 +101,7 @@ QString Parameter::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::PARAM_IN]=(is_in ? Attributes::True : QString()); attributes[Attributes::PARAM_OUT]=(is_out ? Attributes::True : QString()); attributes[Attributes::PARAM_VARIADIC]=(is_variadic ? Attributes::True : QString()); - attributes[Attributes::DEFAULT_VALUE]=default_value; + attributes[Attributes::DefaultValue]=default_value; attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); return(BaseObject::getCodeDefinition(def_type, reduced_form)); diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index b37e0b77f9..5fee063139 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -412,7 +412,7 @@ QString Permission::getCodeDefinition(unsigned def_type) unsigned i, count; ObjectType obj_type; QString priv_vect[12]={ Attributes::SELECT_PRIV, Attributes::INSERT_PRIV, - Attributes::UPDATE_PRIV, Attributes::DELETE_PRIV, + Attributes::UPDATE_PRIV, Attributes::DeletePriv, Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 7ef0f4101b..e46d204fbf 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1589,7 +1589,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) SchemaParser schparser; attribs[Attributes::LENGTH]=QString(); - attribs[Attributes::DIMENSION]=QString(); + attribs[Attributes::Dimension]=QString(); attribs[Attributes::PRECISION]=QString(); attribs[Attributes::WITH_TIMEZONE]=QString(); attribs[Attributes::INTERVAL_TYPE]=QString(); @@ -1602,7 +1602,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs[Attributes::LENGTH]=QString("%1").arg(this->length); if(dimension > 0) - attribs[Attributes::DIMENSION]=QString("%1").arg(this->dimension); + attribs[Attributes::Dimension]=QString("%1").arg(this->dimension); if(precision >= 0) attribs[Attributes::PRECISION]=QString("%1").arg(this->precision); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 2ff653398d..869f55fc0e 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -380,7 +380,7 @@ QString Relationship::getTableNameRelNN(void) void Relationship::setPartitionBoundingExpr(const QString &part_bound_expr) { - part_bounding_expr = part_bound_expr.toLower() == Attributes::DEFAULT.toLower() ? QString() : part_bound_expr; + part_bounding_expr = part_bound_expr.toLower() == Attributes::Default.toLower() ? QString() : part_bound_expr; this->invalidated = true; } @@ -2608,10 +2608,10 @@ QString Relationship::getCodeDefinition(unsigned def_type) setRelationshipAttributes(); attributes[Attributes::IDENTIFIER]=(identifier ? Attributes::True : QString()); attributes[Attributes::SINGLE_PK_COLUMN]=(single_pk_column ? Attributes::True : QString()); - attributes[Attributes::DEFERRABLE]=(deferrable ? Attributes::True : QString()); - attributes[Attributes::DEFER_TYPE]=~deferral_type; + attributes[Attributes::Deferrable]=(deferrable ? Attributes::True : QString()); + attributes[Attributes::DeferType]=~deferral_type; attributes[Attributes::UPD_ACTION]=~upd_action; - attributes[Attributes::DEL_ACTION]=~del_action; + attributes[Attributes::DelAction]=~del_action; attributes[Attributes::TABLE_NAME]=tab_name_relnn; attributes[Attributes::RELATIONSHIP_GEN]=(rel_type==RelationshipGen ? Attributes::True : QString()); @@ -2619,11 +2619,11 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::RELATIONSHIP_PART]=(rel_type==RelationshipPart ? Attributes::True : QString()); attributes[Attributes::SRC_COL_PATTERN]=name_patterns[SrcColPattern]; - attributes[Attributes::DST_COL_PATTERN]=name_patterns[DstColPattern]; + attributes[Attributes::DstColPattern]=name_patterns[DstColPattern]; attributes[Attributes::PK_PATTERN]=name_patterns[PkPattern]; attributes[Attributes::UQ_PATTERN]=name_patterns[UqPattern]; attributes[Attributes::SRC_FK_PATTERN]=name_patterns[SrcFkPattern]; - attributes[Attributes::DST_FK_PATTERN]=name_patterns[DstFkPattern]; + attributes[Attributes::DstFkPattern]=name_patterns[DstFkPattern]; attributes[Attributes::PK_COL_PATTERN]=name_patterns[PkColPattern]; attributes[Attributes::PARTITION_BOUND_EXPR]=part_bounding_expr; diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 056822a22b..cbe958f70f 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -37,7 +37,7 @@ Role::Role(void) attributes[Attributes::LOGIN]=QString(); attributes[Attributes::ConnLimit]=QString(); attributes[Attributes::PASSWORD]=QString(); - attributes[Attributes::ENCRYPTED]=QString(); + attributes[Attributes::Encrypted]=QString(); attributes[Attributes::VALIDITY]=QString(); attributes[Attributes::REF_ROLES]=QString(); attributes[Attributes::MEMBER_ROLES]=QString(); @@ -331,7 +331,7 @@ QString Role::getCodeDefinition(unsigned def_type) unsigned i; QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::INHERIT, - Attributes::LOGIN, Attributes::ENCRYPTED, + Attributes::LOGIN, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; setRoleAttribute(RefRole); @@ -362,7 +362,7 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) attribs_map attribs; QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::INHERIT, - Attributes::LOGIN, Attributes::ENCRYPTED, + Attributes::LOGIN, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object, ignore_name_diff); diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index e7920726d4..892ae8caef 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -22,7 +22,7 @@ Rule::Rule(void) { execution_type=BaseType::Null; obj_type=ObjectType::Rule; - attributes[Attributes::EVENT_TYPE]=QString(); + attributes[Attributes::EventType]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::Condition]=QString(); attributes[Attributes::EXEC_TYPE]=QString(); @@ -129,7 +129,7 @@ QString Rule::getCodeDefinition(unsigned def_type) setCommandsAttribute(); attributes[Attributes::Condition]=conditional_expr; attributes[Attributes::EXEC_TYPE]=(~execution_type); - attributes[Attributes::EVENT_TYPE]=(~event_type); + attributes[Attributes::EventType]=(~event_type); if(getParentTable()) attributes[Attributes::TABLE]=getParentTable()->getName(true); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 18a1084035..43c17170e8 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -2033,7 +2033,7 @@ QString Table::createInsertCommand(const QStringList &col_names, const QStringLi } fmt_cmd=insert_cmd.arg(getSignature()).arg(col_list.join(", ")) - .arg(val_list.join(", ")).arg(Attributes::DDL_END_TOKEN); + .arg(val_list.join(", ")).arg(Attributes::DdlEndToken); } return(fmt_cmd); diff --git a/libpgmodeler/src/tablespace.cpp b/libpgmodeler/src/tablespace.cpp index ad35d72bce..3e2aae5ac2 100644 --- a/libpgmodeler/src/tablespace.cpp +++ b/libpgmodeler/src/tablespace.cpp @@ -23,7 +23,7 @@ unsigned Tablespace::tabspace_id=1000; Tablespace::Tablespace(void) { obj_type=ObjectType::Tablespace; - attributes[Attributes::DIRECTORY]=QString(); + attributes[Attributes::Directory]=QString(); object_id=Tablespace::tabspace_id++; } @@ -64,7 +64,7 @@ QString Tablespace::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); if(!directory.isEmpty()) - attributes[Attributes::DIRECTORY]=QString("'") + directory + QString("'"); + attributes[Attributes::Directory]=QString("'") + directory + QString("'"); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index a593f484ac..2078d98234 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -33,21 +33,21 @@ Trigger::Trigger(void) events[tipos[i]]=false; attributes[Attributes::Arguments]=QString(); - attributes[Attributes::EVENTS]=QString(); + attributes[Attributes::Events]=QString(); attributes[Attributes::TRIGGER_FUNC]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::Columns]=QString(); attributes[Attributes::FIRING_TYPE]=QString(); attributes[Attributes::PER_ROW]=QString(); attributes[Attributes::INS_EVENT]=QString(); - attributes[Attributes::DEL_EVENT]=QString(); + attributes[Attributes::DelEvent]=QString(); attributes[Attributes::UPD_EVENT]=QString(); attributes[Attributes::TRUNC_EVENT]=QString(); attributes[Attributes::Condition]=QString(); attributes[Attributes::REF_TABLE]=QString(); - attributes[Attributes::DEFER_TYPE]=QString(); - attributes[Attributes::DEFERRABLE]=QString(); - attributes[Attributes::DECL_IN_TABLE]=QString(); + attributes[Attributes::DeferType]=QString(); + attributes[Attributes::Deferrable]=QString(); + attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::Constraint]=QString(); attributes[Attributes::OLD_TABLE_NAME]=QString(); attributes[Attributes::NEW_TABLE_NAME]=QString(); @@ -346,7 +346,7 @@ vector Trigger::getRelationshipAddedColumns(void) void Trigger::setBasicAttributes(unsigned def_type) { QString str_aux, - attribs[4]={Attributes::INS_EVENT, Attributes::DEL_EVENT, + attribs[4]={Attributes::INS_EVENT, Attributes::DelEvent, Attributes::TRUNC_EVENT, Attributes::UPD_EVENT }, sql_event[4]={"INSERT OR ", "DELETE OR ", "TRUNCATE OR ", "UPDATE "}; unsigned count, i, i1, event_types[4]={EventType::OnInsert, EventType::OnDelete, @@ -382,7 +382,7 @@ void Trigger::setBasicAttributes(unsigned def_type) if(def_type==SchemaParser::SqlDefinition && !attributes[Attributes::Columns].isEmpty()) str_aux+=QString(" OF ") + attributes[Attributes::Columns]; - attributes[Attributes::EVENTS]=str_aux; + attributes[Attributes::Events]=str_aux; if(function) { @@ -403,7 +403,7 @@ QString Trigger::getCodeDefinition(unsigned def_type) /* Case the trigger doesn't referece some column added by relationship it will be declared inside the parent table construction by the use of 'decl-in-table' schema attribute */ if(!isReferRelationshipAddedColumn()) - attributes[Attributes::DECL_IN_TABLE]=Attributes::True; + attributes[Attributes::DeclInTable]=Attributes::True; if(getParentTable()) attributes[Attributes::TABLE]=getParentTable()->getName(true); @@ -419,8 +419,8 @@ QString Trigger::getCodeDefinition(unsigned def_type) if(referenced_table) attributes[Attributes::REF_TABLE]=referenced_table->getName(true); - attributes[Attributes::DEFERRABLE]=(is_deferrable ? Attributes::True : QString()); - attributes[Attributes::DEFER_TYPE]=(~deferral_type); + attributes[Attributes::Deferrable]=(is_deferrable ? Attributes::True : QString()); + attributes[Attributes::DeferType]=(~deferral_type); if(def_type == SchemaParser::XmlDefinition) { diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 0884974ce9..acc454027a 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -27,8 +27,8 @@ Type::Type(void) attributes[Attributes::CompositeType]=QString(); attributes[Attributes::RANGE_TYPE]=QString(); attributes[Attributes::TYPE_ATTRIBUTE]=QString(); - attributes[Attributes::ENUM_TYPE]=QString(); - attributes[Attributes::ENUMERATIONS]=QString(); + attributes[Attributes::EnumType]=QString(); + attributes[Attributes::Enumerations]=QString(); attributes[Attributes::INPUT_FUNC]=QString(); attributes[Attributes::OUTPUT_FUNC]=QString(); attributes[Attributes::RECV_FUNC]=QString(); @@ -40,9 +40,9 @@ Type::Type(void) attributes[Attributes::ByValue]=QString(); attributes[Attributes::Alignment]=QString(); attributes[Attributes::STORAGE]=QString(); - attributes[Attributes::DEFAULT_VALUE]=QString(); - attributes[Attributes::ELEMENT]=QString(); - attributes[Attributes::DELIMITER]=QString(); + attributes[Attributes::DefaultValue]=QString(); + attributes[Attributes::Element]=QString(); + attributes[Attributes::Delimiter]=QString(); attributes[Attributes::REDUCED_FORM]=QString(); attributes[Attributes::Category]=QString(); attributes[Attributes::PREFERRED]=QString(); @@ -448,7 +448,7 @@ void Type::setEnumerationsAttribute(unsigned def_type) if(i < (count-1)) str_enum+=QString(","); } - attributes[Attributes::ENUMERATIONS]=str_enum; + attributes[Attributes::Enumerations]=str_enum; } void Type::setCategory(CategoryType categ) @@ -617,7 +617,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) if(config==EnumerationType) { - attributes[Attributes::ENUM_TYPE]=Attributes::True; + attributes[Attributes::EnumType]=Attributes::True; setEnumerationsAttribute(def_type); } else if(config==CompositeType) @@ -654,13 +654,13 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::ByValue]=(by_value ? Attributes::True : QString()); attributes[Attributes::Alignment]=(*alignment); attributes[Attributes::STORAGE]=(~storage); - attributes[Attributes::DEFAULT_VALUE]=default_value; + attributes[Attributes::DefaultValue]=default_value; if(element!=QString("\"any\"")) - attributes[Attributes::ELEMENT]=(*element); + attributes[Attributes::Element]=(*element); if(delimiter!='\0') - attributes[Attributes::DELIMITER]=delimiter; + attributes[Attributes::Delimiter]=delimiter; attributes[Attributes::Category]=~(category); @@ -754,12 +754,12 @@ QString Type::getAlterDefinition(BaseObject *object) { if(type->getAttributeIndex(attrib.getName()) < 0) { - attribs[Attributes::DROP]=Attributes::True; + attribs[Attributes::Drop]=Attributes::True; attribs[Attributes::Attribute]=attrib.getName(true); copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); attribs.clear(); - attributes[Attributes::DROP]=QString(); + attributes[Attributes::Drop]=QString(); } } diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 8f38809676..31b24c5e45 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -22,12 +22,12 @@ View::View(void) : BaseTable() { obj_type=ObjectType::View; materialized=recursive=with_no_data=false; - attributes[Attributes::DEFINITION]=QString(); + attributes[Attributes::Definition]=QString(); attributes[Attributes::REFERENCES]=QString(); attributes[Attributes::SELECT_EXP]=QString(); attributes[Attributes::FROM_EXP]=QString(); attributes[Attributes::SIMPLE_EXP]=QString(); - attributes[Attributes::END_EXP]=QString(); + attributes[Attributes::EndExp]=QString(); attributes[Attributes::CteExpression]=QString(); attributes[Attributes::MATERIALIZED]=QString(); attributes[Attributes::RECURSIVE]=QString(); @@ -474,7 +474,7 @@ void View::setDefinitionAttribute(void) if(!decl.endsWith(QChar(';'))) decl.append(QChar(';')); - attributes[Attributes::DEFINITION]=decl; + attributes[Attributes::Definition]=decl; } void View::setReferencesAttribute(void) @@ -483,7 +483,7 @@ void View::setReferencesAttribute(void) QString attribs[]={ Attributes::SELECT_EXP, Attributes::FROM_EXP, Attributes::SIMPLE_EXP, - Attributes::END_EXP}; + Attributes::EndExp}; vector *vect_exp[]={&exp_select, &exp_from, &exp_where, &exp_end}; int cnt, i, i1; diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 94aa83ece9..8e0cc099ca 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -151,7 +151,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) conn->setConnectionParam(Connection::ParamOthers, itr->second[Connection::ParamOthers]); conn->setAutoBrowseDB(itr->second[Attributes::AutoBrowseDb]==Attributes::True); - conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(Attributes::DIFF)]==Attributes::True); + conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(Attributes::Diff)]==Attributes::True); conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(Attributes::EXPORT)]==Attributes::True); conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(Attributes::IMPORT)]==Attributes::True); conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(Attributes::VALIDATION)]==Attributes::True); @@ -510,7 +510,7 @@ void ConnectionsConfigWidget::saveConfiguration(void) attribs[DefaultFor.arg(Attributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? Attributes::True : QString()); - attribs[DefaultFor.arg(Attributes::DIFF)]=(conn->isDefaultForOperation(Connection::OpDiff) ? Attributes::True : QString()); + attribs[DefaultFor.arg(Attributes::Diff)]=(conn->isDefaultForOperation(Connection::OpDiff) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? Attributes::True : QString()); schparser.ignoreUnkownAttributes(true); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 47a30d8e3b..1785dd423b 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -43,12 +43,12 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Configuration, QT_TR_NOOP("Configuration")}, {Attributes::ConnLimit, QT_TR_NOOP("Conn. limit")}, {Attributes::Constraint, QT_TR_NOOP("Constraint")}, {Attributes::CreateDb, QT_TR_NOOP("Create DB")}, {Attributes::CreateRole, QT_TR_NOOP("Create role")}, {Attributes::CurVersion, QT_TR_NOOP("Curr. version")}, - {Attributes::DEFAULT, QT_TR_NOOP("Default")}, {Attributes::DEFAULT_VALUE, QT_TR_NOOP("Default value")}, - {Attributes::DEFINITION, QT_TR_NOOP("Definition")}, {Attributes::DELIMITER, QT_TR_NOOP("Delimiter")}, - {Attributes::DEST_TYPE, QT_TR_NOOP("Dest. type")}, {Attributes::DIMENSION, QT_TR_NOOP("Dimension")}, - {Attributes::DIRECTORY, QT_TR_NOOP("Directory")}, {Attributes::DST_ENCODING, QT_TR_NOOP("Dest. encoding")}, - {Attributes::ELEMENT, QT_TR_NOOP("Element")}, {Attributes::ENCODING, QT_TR_NOOP("Encoding")}, - {Attributes::ENCRYPTED, QT_TR_NOOP("Encrypted")}, {Attributes::ENUMERATIONS, QT_TR_NOOP("Enumerations")}, + {Attributes::Default, QT_TR_NOOP("Default")}, {Attributes::DefaultValue, QT_TR_NOOP("Default value")}, + {Attributes::Definition, QT_TR_NOOP("Definition")}, {Attributes::Delimiter, QT_TR_NOOP("Delimiter")}, + {Attributes::DestType, QT_TR_NOOP("Dest. type")}, {Attributes::Dimension, QT_TR_NOOP("Dimension")}, + {Attributes::Directory, QT_TR_NOOP("Directory")}, {Attributes::DstEncoding, QT_TR_NOOP("Dest. encoding")}, + {Attributes::Element, QT_TR_NOOP("Element")}, {Attributes::Encoding, QT_TR_NOOP("Encoding")}, + {Attributes::Encrypted, QT_TR_NOOP("Encrypted")}, {Attributes::Enumerations, QT_TR_NOOP("Enumerations")}, {Attributes::EXECUTION_COST, QT_TR_NOOP("Exec. cost")}, {Attributes::EXPRESSION, QT_TR_NOOP("Expression")}, {Attributes::FAMILY, QT_TR_NOOP("Op. family")}, {Attributes::FINAL_FUNC, QT_TR_NOOP("Final func.")}, {Attributes::FUNCTION, QT_TR_NOOP("Function")}, {Attributes::FUNCTION_TYPE, QT_TR_NOOP("Func. type")}, @@ -93,17 +93,17 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::MIN_VALUE, QT_TR_NOOP("Min. value")}, {Attributes::START, QT_TR_NOOP("Start value")}, {Attributes::LAST_VALUE, QT_TR_NOOP("Last value")}, {Attributes::SUBTYPE, QT_TR_NOOP("Subtype")}, {Attributes::OP_CLASS, QT_TR_NOOP("Op. class")}, {Attributes::CanonicalFunc, QT_TR_NOOP("Canonical func.")}, - {Attributes::SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {Attributes::DEFERRABLE, QT_TR_NOOP("Deferrable")}, + {Attributes::SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {Attributes::Deferrable, QT_TR_NOOP("Deferrable")}, {Attributes::PER_ROW, QT_TR_NOOP("For each row")}, {Attributes::FIRING_TYPE, QT_TR_NOOP("Firing")}, - {Attributes::INS_EVENT, QT_TR_NOOP("On insert")}, {Attributes::DEL_EVENT, QT_TR_NOOP("On delete")}, + {Attributes::INS_EVENT, QT_TR_NOOP("On insert")}, {Attributes::DelEvent, QT_TR_NOOP("On delete")}, {Attributes::UPD_EVENT, QT_TR_NOOP("On update")}, {Attributes::TRUNC_EVENT, QT_TR_NOOP("On truncate")}, {Attributes::Arguments, QT_TR_NOOP("Arguments")}, {Attributes::TABLE, QT_TR_NOOP("Table")}, {Attributes::TRIGGER_FUNC, QT_TR_NOOP("Trigger func.")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, - {Attributes::Condition, QT_TR_NOOP("Condition")}, {Attributes::DEFER_TYPE, QT_TR_NOOP("Deferment")}, - {Attributes::EVENT_TYPE, QT_TR_NOOP("Event")}, {Attributes::EXEC_TYPE, QT_TR_NOOP("Execution mode")}, + {Attributes::Condition, QT_TR_NOOP("Condition")}, {Attributes::DeferType, QT_TR_NOOP("Deferment")}, + {Attributes::EventType, QT_TR_NOOP("Event")}, {Attributes::EXEC_TYPE, QT_TR_NOOP("Execution mode")}, {Attributes::Commands, QT_TR_NOOP("Commands")}, {Attributes::POSITION, QT_TR_NOOP("Position")}, - {Attributes::ComparisonType, QT_TR_NOOP("Comparison type")}, {Attributes::DEL_ACTION, QT_TR_NOOP("On delete")}, - {Attributes::DST_COLUMNS, QT_TR_NOOP("Ref. columns")}, {Attributes::EXPRESSIONS, QT_TR_NOOP("Expressions")}, + {Attributes::ComparisonType, QT_TR_NOOP("Comparison type")}, {Attributes::DelAction, QT_TR_NOOP("On delete")}, + {Attributes::DstColumns, QT_TR_NOOP("Ref. columns")}, {Attributes::EXPRESSIONS, QT_TR_NOOP("Expressions")}, {Attributes::FACTOR, QT_TR_NOOP("Fill factor")}, {Attributes::NO_INHERIT, QT_TR_NOOP("No inherit")}, {Attributes::OP_CLASSES, QT_TR_NOOP("Op. classes")}, {Attributes::OPERATORS, QT_TR_NOOP("Operators")}, {Attributes::REF_TABLE, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, @@ -111,8 +111,8 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::UNIQUE, QT_TR_NOOP("Unique")}, {Attributes::PREDICATE, QT_TR_NOOP("Predicate")}, {Attributes::Collations, QT_TR_NOOP("Collations")}, {Attributes::INHERITED, QT_TR_NOOP("Inherited")}, {Attributes::ClientEncoding, QT_TR_NOOP("Client encoding")}, {Attributes::ConfigFile, QT_TR_NOOP("Configuration file")}, - {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DYNAMIC_LIBRARY_PATH, QT_TR_NOOP("Dynamic library path")}, - {Attributes::DYNAMIC_SHARED_MEMORY, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HBA_FILE, QT_TR_NOOP("Hba file")}, + {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DynamicLibraryPath, QT_TR_NOOP("Dynamic library path")}, + {Attributes::DynamicSharedMemory, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HBA_FILE, QT_TR_NOOP("Hba file")}, {Attributes::LISTEN_ADDRESSES, QT_TR_NOOP("Listen addresses")}, {Attributes::MAX_CONNECTIONS, QT_TR_NOOP("Max. connections")}, {Attributes::PORT, QT_TR_NOOP("Listen port")}, {Attributes::SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, {Attributes::SSL, QT_TR_NOOP("SSL")}, {Attributes::SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, @@ -129,7 +129,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {Attributes::TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, {Attributes::TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {Attributes::IS_PARTITIONED, QT_TR_NOOP("Partitioned")}, {Attributes::PARTITIONED_TABLE, QT_TR_NOOP("Partition of")}, {Attributes::PARTITION_BOUND_EXPR, QT_TR_NOOP("Partition bound expr.")}, - {Attributes::DEAD_ROWS_AMOUNT, QT_TR_NOOP("Dead rows amount")}, {Attributes::PARTITION_KEY, QT_TR_NOOP("Partition keys")}, + {Attributes::DeadRowsAmount, QT_TR_NOOP("Dead rows amount")}, {Attributes::PARTITION_KEY, QT_TR_NOOP("Partition keys")}, {Attributes::PARTITIONING, QT_TR_NOOP("Partitioning")} }; @@ -438,7 +438,7 @@ void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::IO_CAST }); - formatOidAttribs(attribs, { Attributes::DEST_TYPE, + formatOidAttribs(attribs, { Attributes::DestType, Attributes::SOURCE_TYPE }, ObjectType::Type, false); attribs[Attributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[Attributes::FUNCTION]); @@ -482,13 +482,13 @@ void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::SUPERUSER, Attributes::INHERIT, Attributes::CreateRole, Attributes::CreateDb, - Attributes::LOGIN, Attributes::ENCRYPTED, + Attributes::LOGIN, Attributes::Encrypted, Attributes::REPLICATION }); } void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { Attributes::DEFAULT }); + formatBooleanAttribs(attribs, { Attributes::Default }); attribs[Attributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[Attributes::FUNCTION]); } @@ -634,12 +634,12 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) Attributes::SEND_FUNC, Attributes::TPMOD_IN_FUNC, Attributes::TPMOD_OUT_FUNC }, ObjectType::Function, false); - attribs[Attributes::ELEMENT]=getObjectName(ObjectType::Type, attribs[Attributes::ELEMENT]); + attribs[Attributes::Element]=getObjectName(ObjectType::Type, attribs[Attributes::Element]); - if(attribs[Attributes::ENUMERATIONS].isEmpty()) - attribs.erase(Attributes::ENUMERATIONS); + if(attribs[Attributes::Enumerations].isEmpty()) + attribs.erase(Attributes::Enumerations); else - attribs[Attributes::ENUMERATIONS]=Catalog::parseArrayValues(attribs[Attributes::ENUMERATIONS]).join(ElemSeparator); + attribs[Attributes::Enumerations]=Catalog::parseArrayValues(attribs[Attributes::Enumerations]).join(ElemSeparator); attribs.erase(Attributes::RANGE_ATTRIBS); if(!range_attr.isEmpty()) @@ -673,7 +673,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) QStringList list, array_vals, elems; attribs[Attributes::FAMILY]=getObjectName(ObjectType::OpFamily, attribs[Attributes::FAMILY]); - formatBooleanAttribs(attribs, { Attributes::DEFAULT }); + formatBooleanAttribs(attribs, { Attributes::Default }); formatOidAttribs(attribs, { Attributes::STORAGE, Attributes::TYPE }, ObjectType::Type, false); @@ -712,10 +712,10 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::Constraint, - Attributes::DEFERRABLE, + Attributes::Deferrable, Attributes::PER_ROW, Attributes::INS_EVENT, - Attributes::DEL_EVENT, + Attributes::DelEvent, Attributes::UPD_EVENT, Attributes::TRUNC_EVENT }); @@ -744,12 +744,12 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) {Attributes::FK_CONSTR, ConstraintType(ConstraintType::ForeignKey)}, {Attributes::UQ_CONSTR, ConstraintType(ConstraintType::Unique)}, {Attributes::CkConstr, ConstraintType(ConstraintType::Check)}, - {Attributes::EX_CONSTR, ConstraintType(ConstraintType::Exclude)}}; + {Attributes::ExConstr, ConstraintType(ConstraintType::Exclude)}}; ConstraintType constr_type=types[attribs[Attributes::TYPE]]; QStringList names=getObjectName(ObjectType::Table, attribs[Attributes::TABLE]).split('.'); - formatBooleanAttribs(attribs, { Attributes::DEFERRABLE, + formatBooleanAttribs(attribs, { Attributes::Deferrable, Attributes::NO_INHERIT }); attribs[Attributes::TYPE]=~types[attribs[Attributes::TYPE]]; attribs[Attributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, @@ -762,23 +762,23 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) { attribs[Attributes::REF_TABLE]=getObjectName(ObjectType::Table, attribs[Attributes::REF_TABLE]); names=attribs[Attributes::REF_TABLE].split('.'); - attribs[Attributes::DST_COLUMNS]=getObjectsNames(ObjectType::Column, - Catalog::parseArrayValues(attribs[Attributes::DST_COLUMNS]), + attribs[Attributes::DstColumns]=getObjectsNames(ObjectType::Column, + Catalog::parseArrayValues(attribs[Attributes::DstColumns]), names[0], names[1]).join(ElemSeparator); } else { - attribs.erase(Attributes::DST_COLUMNS); + attribs.erase(Attributes::DstColumns); attribs.erase(Attributes::REF_TABLE); attribs.erase(Attributes::UPD_ACTION); - attribs.erase(Attributes::DEL_ACTION); + attribs.erase(Attributes::DelAction); attribs.erase(Attributes::ComparisonType); } if(constr_type==ConstraintType::Check) { - attribs.erase(Attributes::DEFERRABLE); - attribs.erase(Attributes::DEFER_TYPE); + attribs.erase(Attributes::Deferrable); + attribs.erase(Attributes::DeferType); } else attribs.erase(Attributes::EXPRESSION); @@ -1164,7 +1164,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i QStringList types; attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); - attribs[Attributes::DECL_IN_TABLE]=QString(); + attribs[Attributes::DeclInTable]=QString(); attribs[BaseObject::getSchemaName(obj_type)]=Attributes::True; //For cast, operator and function is needed to extract the name and the params types @@ -1266,7 +1266,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) //Generate the drop command schparser.ignoreEmptyAttributes(true); schparser.ignoreUnkownAttributes(true); - drop_cmd=schparser.getCodeDefinition(Attributes::DROP, attribs, SchemaParser::SqlDefinition); + drop_cmd=schparser.getCodeDefinition(Attributes::Drop, attribs, SchemaParser::SqlDefinition); if(cascade) drop_cmd.replace(';', QString(" CASCADE;")); @@ -1632,10 +1632,10 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) fk_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referenced"))); fk_item->setText(0, QString("%1(%2)") .arg(cached_attribs[Attributes::REF_TABLE]) - .arg(cached_attribs[Attributes::DST_COLUMNS])); + .arg(cached_attribs[Attributes::DstColumns])); fk_item->setToolTip(0, trUtf8("Ref. table: %1\nRef. column(s): %2") .arg(cached_attribs[Attributes::REF_TABLE]) - .arg(cached_attribs[Attributes::DST_COLUMNS])); + .arg(cached_attribs[Attributes::DstColumns])); fk_item->setFlags(Qt::ItemIsEnabled); } else if(cached_attribs[Attributes::TYPE]==~ConstraintType(ConstraintType::Unique) || diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index d1950a2f7f..91cf838c13 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -677,7 +677,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) dbmodel->getObjectIndex(obj_name, obj_type) < 0))) { if(TableObject::isTableObject(obj_type)) - attribs[Attributes::DECL_IN_TABLE]=QString(); + attribs[Attributes::DeclInTable]=QString(); //System objects will have the sql disabled by default attribs[Attributes::SQL_DISABLED]=(catalog.isSystemObject(oid) || catalog.isExtensionObject(oid) ? Attributes::True : QString()); @@ -1012,7 +1012,7 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) expr.remove(expr.length() - 1,1); aux_attribs[Attributes::EXPRESSION] = expr; - attribs[Attributes::Constraints]+= schparser.getCodeDefinition(Attributes::DOM_CONSTRAINT, aux_attribs, SchemaParser::XmlDefinition); + attribs[Attributes::Constraints]+= schparser.getCodeDefinition(Attributes::DomConstraint, aux_attribs, SchemaParser::XmlDefinition); } attribs[Attributes::TYPE]=getType(attribs[Attributes::TYPE], true, attribs); @@ -1143,8 +1143,8 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) //Case the function's language is C the symbol is the 'definition' attribute if(getObjectName(attribs[Attributes::LANGUAGE])==~LanguageType("c")) { - attribs[Attributes::SYMBOL]=attribs[Attributes::DEFINITION]; - attribs[Attributes::DEFINITION]=QString(); + attribs[Attributes::SYMBOL]=attribs[Attributes::Definition]; + attribs[Attributes::Definition]=QString(); } //Get the language reference code @@ -1247,14 +1247,14 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) if(attribs[Attributes::STORAGE]!=QString("0")) { elem_attr[Attributes::STORAGE]=Attributes::True; - elem_attr[Attributes::DEFINITION]=getType(attribs[Attributes::STORAGE], true); + elem_attr[Attributes::Definition]=getType(attribs[Attributes::STORAGE], true); elems.push_back(elem_attr); } else if(attribs[Attributes::FUNCTION].isEmpty() && attribs[Attributes::OPERATOR].isEmpty()) { elem_attr[Attributes::STORAGE]=Attributes::True; - elem_attr[Attributes::DEFINITION]=attribs[Attributes::TYPE]; + elem_attr[Attributes::Definition]=attribs[Attributes::TYPE]; elems.push_back(elem_attr); } @@ -1269,7 +1269,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) { list=array_vals[i].split(':'); elem_attr[Attributes::STRATEGY_NUM]=list[0]; - elem_attr[Attributes::DEFINITION]=getDependencyObject(list[1], ObjectType::Function, true); + elem_attr[Attributes::Definition]=getDependencyObject(list[1], ObjectType::Function, true); elems.push_back(elem_attr); } } @@ -1284,10 +1284,10 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) for(int i=0; i < array_vals.size(); i++) { list=array_vals[i].split(':'); - elem_attr[Attributes::DEFINITION]=""; + elem_attr[Attributes::Definition]=""; elem_attr[Attributes::STRATEGY_NUM]=list[0]; - elem_attr[Attributes::DEFINITION]+=getDependencyObject(list[1], ObjectType::Operator, true); - elem_attr[Attributes::DEFINITION]+=getDependencyObject(list[2], ObjectType::OpFamily, true); + elem_attr[Attributes::Definition]+=getDependencyObject(list[1], ObjectType::Operator, true); + elem_attr[Attributes::Definition]+=getDependencyObject(list[2], ObjectType::OpFamily, true); elems.push_back(elem_attr); } } @@ -1296,7 +1296,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) for(unsigned i=0; i < elems.size(); i++) { schparser.ignoreUnkownAttributes(true); - attribs[Attributes::ELEMENTS]+=schparser.getCodeDefinition(Attributes::ELEMENT, elems[i], SchemaParser::XmlDefinition); + attribs[Attributes::Elements]+=schparser.getCodeDefinition(Attributes::Element, elems[i], SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); } @@ -1397,7 +1397,7 @@ void DatabaseImportHelper::createCast(attribs_map &attribs) { attribs[Attributes::FUNCTION]=getDependencyObject(attribs[Attributes::FUNCTION], ObjectType::Function, true); attribs[Attributes::SOURCE_TYPE]=getType(attribs[Attributes::SOURCE_TYPE], true); - attribs[Attributes::DEST_TYPE]=getType(attribs[Attributes::DEST_TYPE], true); + attribs[Attributes::DestType]=getType(attribs[Attributes::DestType], true); loadObjectXML(ObjectType::Cast, attribs); cast=dbmodel->createCast(); dbmodel->addCast(cast); @@ -1549,10 +1549,10 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { attribs[attribs[Attributes::Configuration]]=Attributes::True; - if(!attribs[Attributes::ENUM_TYPE].isEmpty()) + if(!attribs[Attributes::EnumType].isEmpty()) { - attribs[Attributes::ENUMERATIONS]=Catalog::parseArrayValues(attribs[Attributes::ENUMERATIONS]).join(','); - attribs[Attributes::ENUMERATIONS].remove('"'); + attribs[Attributes::Enumerations]=Catalog::parseArrayValues(attribs[Attributes::Enumerations]).join(','); + attribs[Attributes::Enumerations].remove('"'); } else if(!attribs[Attributes::CompositeType].isEmpty()) { @@ -1597,7 +1597,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) Attributes::AnalyzeFunc }; unsigned i, count=sizeof(func_types)/sizeof(QString); - attribs[Attributes::ELEMENT]=getType(attribs[Attributes::ELEMENT], false); + attribs[Attributes::Element]=getType(attribs[Attributes::Element], false); /* Workaround: if importing a datatype that is part of an extension we avoid the importing of * its supporting functions (since they will not be necessary here because the type will be sql-disabled)*/ @@ -1741,7 +1741,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) varchar to character varying) we remove the '::character varying'. The idea here is to eliminate the cast if the casting is equivalent to the column type. */ - def_val = itr->second[Attributes::DEFAULT_VALUE]; + def_val = itr->second[Attributes::DefaultValue]; if(!def_val.startsWith(QString("nextval(")) && def_val.contains(QString("::"))) { @@ -1879,7 +1879,7 @@ void DatabaseImportHelper::createView(attribs_map &attribs) attribs[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); - ref=Reference(attribs[Attributes::DEFINITION], QString()); + ref=Reference(attribs[Attributes::Definition], QString()); ref.setDefinitionExpression(true); attribs[Attributes::REFERENCES]=ref.getXMLDefinition(); @@ -2069,7 +2069,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) } if(elem.getColumn() || !elem.getExpression().isEmpty()) - attribs[Attributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); + attribs[Attributes::Elements]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); } attribs[Attributes::TABLE]=tab_name; @@ -2108,7 +2108,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) attribs[attribs[Attributes::TYPE]]=Attributes::True; table=dynamic_cast
(dbmodel->getObject(tab_name, ObjectType::Table)); - if(attribs[Attributes::TYPE]==Attributes::EX_CONSTR) + if(attribs[Attributes::TYPE]==Attributes::ExConstr) { QStringList cols, opclasses, opers, exprs; ExcludeElement elem; @@ -2163,7 +2163,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) elem.setOperator(oper); } - attribs[Attributes::ELEMENTS]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); + attribs[Attributes::Elements]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); } } else @@ -2176,7 +2176,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) } attribs[Attributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjectType::Table, false, true, false); - attribs[Attributes::DST_COLUMNS]=getColumnNames(ref_tab_oid, attribs[Attributes::DST_COLUMNS]).join(','); + attribs[Attributes::DstColumns]=getColumnNames(ref_tab_oid, attribs[Attributes::DstColumns]).join(','); attribs[Attributes::TABLE]=tab_name; loadObjectXML(ObjectType::Constraint, attribs); @@ -2734,7 +2734,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, type_attr[Attributes::NAME].contains(QString("[]"))) { obj_name=type_attr[Attributes::NAME]; - elem_tp_oid=type_attr[Attributes::ELEMENT].toUInt(); + elem_tp_oid=type_attr[Attributes::Element].toUInt(); if(generate_xml) { @@ -2799,7 +2799,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, if(generate_xml) { extra_attribs[Attributes::NAME]=obj_name; - extra_attribs[Attributes::DIMENSION]=(dimension > 0 ? QString::number(dimension) : QString()); + extra_attribs[Attributes::Dimension]=(dimension > 0 ? QString::number(dimension) : QString()); schparser.ignoreUnkownAttributes(true); xml_def=schparser.getCodeDefinition(Attributes::PGSQL_BASE_TYPE, extra_attribs, SchemaParser::XmlDefinition); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 0012837036..ec03fb8827 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -851,13 +851,13 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin name_list.clear(); //Storing the referenced columns in a string - for(QString id : Catalog::parseArrayValues(fk[Attributes::DST_COLUMNS])) + for(QString id : Catalog::parseArrayValues(fk[Attributes::DstColumns])) col_ids.push_back(id.toUInt()); for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[Attributes::NAME], aux_table[Attributes::NAME], col_ids)) name_list.push_back(BaseObject::formatName(col[Attributes::NAME])); - fk_infos[fk_name][Attributes::DST_COLUMNS] = name_list.join(Table::DataSeparator); + fk_infos[fk_name][Attributes::DstColumns] = name_list.join(Table::DataSeparator); } submenu = new QMenu(this); @@ -1154,7 +1154,7 @@ void DataManipulationForm::browseTable(const QString &fk_name, bool browse_ref_t else { src_cols = fk_infos[fk_name][Attributes::SRC_COLUMNS].split(Table::DataSeparator); - ref_cols = fk_infos[fk_name][Attributes::DST_COLUMNS].split(Table::DataSeparator); + ref_cols = fk_infos[fk_name][Attributes::DstColumns].split(Table::DataSeparator); schema = fk_infos[fk_name][Attributes::SCHEMA]; table = fk_infos[fk_name][Attributes::REF_TABLE]; } diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 47b1360084..ed56753300 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -114,12 +114,12 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::CheckUpdate]=QString(); config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]=QString(); config_params[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]=QString(); - config_params[Attributes::Configuration][Attributes::DISABLE_SMOOTHNESS]=QString(); + config_params[Attributes::Configuration][Attributes::DisableSmoothness]=QString(); config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]=QString(); config_params[Attributes::Configuration][Attributes::ConfirmValidation]=QString(); config_params[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]=QString(); config_params[Attributes::Configuration][Attributes::CodeCompletion]=QString(); - config_params[Attributes::Configuration][Attributes::DISPLAY_LINE_NUMBERS]=QString(); + config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]=QString(); config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]=QString(); config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]=QString(); config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]=QString(); @@ -290,7 +290,7 @@ void GeneralConfigWidget::loadConfiguration(void) invert_rangesel_chk->setChecked(config_params[Attributes::Configuration][Attributes::INVERT_RANGESEL_TRIGGER]==Attributes::True); check_upd_chk->setChecked(config_params[Attributes::Configuration][Attributes::CheckUpdate]==Attributes::True); save_last_pos_chk->setChecked(config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]==Attributes::True); - disable_smooth_chk->setChecked(config_params[Attributes::Configuration][Attributes::DISABLE_SMOOTHNESS]==Attributes::True); + disable_smooth_chk->setChecked(config_params[Attributes::Configuration][Attributes::DisableSmoothness]==Attributes::True); simple_obj_creation_chk->setChecked(config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]==Attributes::True); confirm_validation_chk->setChecked(config_params[Attributes::Configuration][Attributes::ConfirmValidation]==Attributes::True); code_completion_chk->setChecked(config_params[Attributes::Configuration][Attributes::CodeCompletion]==Attributes::True); @@ -323,7 +323,7 @@ void GeneralConfigWidget::loadConfiguration(void) font_cmb->setCurrentFont(QFont(config_params[Attributes::Configuration][Attributes::CodeFont])); font_size_spb->setValue(config_params[Attributes::Configuration][Attributes::CodeFontSize].toDouble()); - disp_line_numbers_chk->setChecked(config_params[Attributes::Configuration][Attributes::DISPLAY_LINE_NUMBERS]==Attributes::True); + disp_line_numbers_chk->setChecked(config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]==Attributes::True); hightlight_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIGHLIGHT_LINES]==Attributes::True); line_numbers_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]); line_numbers_bg_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]); @@ -475,7 +475,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::INVERT_RANGESEL_TRIGGER]=(invert_rangesel_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CheckUpdate]=(check_upd_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]=(save_last_pos_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::DISABLE_SMOOTHNESS]=(disable_smooth_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::DisableSmoothness]=(disable_smooth_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]=(simple_obj_creation_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::ConfirmValidation]=(confirm_validation_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CodeCompletion]=(code_completion_chk->isChecked() ? Attributes::True : QString()); @@ -510,7 +510,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::CodeFont]=font_cmb->currentText(); config_params[Attributes::Configuration][Attributes::CodeFontSize]=QString::number(font_size_spb->value()); - config_params[Attributes::Configuration][Attributes::DISPLAY_LINE_NUMBERS]=(disp_line_numbers_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]=(disp_line_numbers_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::HIGHLIGHT_LINES]=(hightlight_lines_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]=line_numbers_cp->getColor(0).name(); config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]=line_numbers_bg_cp->getColor(0).name(); @@ -529,7 +529,7 @@ void GeneralConfigWidget::saveConfiguration(void) itr=config_params.begin(); itr_end=config_params.end(); - config_params[Attributes::Configuration][Attributes::DOCK_WIDGETS]=QString(); + config_params[Attributes::Configuration][Attributes::DockWidgets]=QString(); config_params[Attributes::Configuration][Attributes::WIDGETS_GEOMETRY]=QString(); config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); config_params[Attributes::Configuration][Attributes::File]=QString(); @@ -554,7 +554,7 @@ void GeneralConfigWidget::saveConfiguration(void) { schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - config_params[Attributes::Configuration][Attributes::DOCK_WIDGETS]+= + config_params[Attributes::Configuration][Attributes::DockWidgets]+= schparser.getCodeDefinition(widget_sch, itr->second); schparser.ignoreUnkownAttributes(false); schparser.ignoreEmptyAttributes(false); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 7f035e2a12..da00fd2c70 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1843,7 +1843,7 @@ void MainWindow::storeDockWidgetsSettings(void) params[Attributes::FADEIN_OBJECTS]=(obj_finder_wgt->fade_btn->isChecked() ? Attributes::True : QString()); params[Attributes::REGULAR_EXP]=(obj_finder_wgt->regexp_chk->isChecked() ? Attributes::True : QString()); params[Attributes::CaseSensitive]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? Attributes::True : QString()); - params[Attributes::EXACT_MATCH]=(obj_finder_wgt->exact_match_chk->isChecked() ? Attributes::True : QString()); + params[Attributes::ExactMatch]=(obj_finder_wgt->exact_match_chk->isChecked() ? Attributes::True : QString()); conf_wgt->addConfigurationParam(Attributes::OBJECT_FINDER, params); params.clear(); @@ -1872,7 +1872,7 @@ void MainWindow::restoreDockWidgetsSettings(void) obj_finder_wgt->fade_btn->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::FADEIN_OBJECTS]==Attributes::True); obj_finder_wgt->regexp_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::REGULAR_EXP]==Attributes::True); obj_finder_wgt->case_sensitive_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::CaseSensitive]==Attributes::True); - obj_finder_wgt->exact_match_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::EXACT_MATCH]==Attributes::True); + obj_finder_wgt->exact_match_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::ExactMatch]==Attributes::True); } if(confs.count(Attributes::SQL_TOOL)) diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 44acdad278..4e864e762a 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -316,7 +316,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c unsigned i, count; ObjectType types[]={ObjectType::Role, ObjectType::Tablespace}; BaseObject *object=nullptr; - QString tmpl_comm_regexp = QString("(COMMENT)( )+(ON)( )+(%1)(.)+(\n)(") + Attributes::DDL_END_TOKEN + QString(")"); + QString tmpl_comm_regexp = QString("(COMMENT)( )+(ON)( )+(%1)(.)+(\n)(") + Attributes::DdlEndToken + QString(")"); QRegExp comm_regexp; try @@ -826,7 +826,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co } else { - ddl_tk_found=(lin.indexOf(Attributes::DDL_END_TOKEN) >= 0); + ddl_tk_found=(lin.indexOf(Attributes::DdlEndToken) >= 0); lin.remove(QRegExp(QString("^(--)+(.)+$"))); //If the line isn't empty after cleanup it will be included on sql command diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 3cb4f5557e..9d7f2c8d0c 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -871,16 +871,16 @@ void ModelsDiffHelper::processDiffInfos(void) //Attributes used on the diff schema file attribs[Attributes::HAS_CHANGES]=Attributes::True; attribs[Attributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; - attribs[Attributes::DB_MODEL]=source_model->getName(); + attribs[Attributes::DbModel]=source_model->getName(); attribs[Attributes::Database]=imported_model->getName(); attribs[Attributes::Date]=QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); attribs[Attributes::Connection]=imported_model->getName(); attribs[Attributes::Change]=QString::number(alter_objs.size()); attribs[Attributes::Create]=QString::number(create_objs_count); - attribs[Attributes::DROP]=QString::number(drop_objs.size()); + attribs[Attributes::Drop]=QString::number(drop_objs.size()); attribs[Attributes::TRUNCATE]=QString::number(truncate_tabs.size()); attribs[Attributes::AlterCmds]=QString(); - attribs[Attributes::DROP_CMDS]=QString(); + attribs[Attributes::DropCmds]=QString(); attribs[Attributes::CreateCmds]=QString(); attribs[Attributes::TRUNCATE_CMDS]=QString(); attribs[Attributes::ConstrDefs]=QString(); @@ -893,15 +893,15 @@ void ModelsDiffHelper::processDiffInfos(void) ritr=drop_objs.rbegin(); ritr_end=drop_objs.rend(); - attribs[Attributes::DROP_CMDS]+=no_inherit_def; + attribs[Attributes::DropCmds]+=no_inherit_def; while(ritr!=ritr_end) { - attribs[Attributes::DROP_CMDS]+=ritr->second; + attribs[Attributes::DropCmds]+=ritr->second; ritr++; } - attribs[Attributes::DROP_CMDS]+=col_drop_def; + attribs[Attributes::DropCmds]+=col_drop_def; for(auto &itr : create_objs) @@ -925,7 +925,7 @@ void ModelsDiffHelper::processDiffInfos(void) schparser.setPgSQLVersion(pgsql_version); diff_def=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + - Attributes::DIFF + GlobalAttributes::SchemaExt, attribs); + Attributes::Diff + GlobalAttributes::SchemaExt, attribs); } if(diff_def.isEmpty()) diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 3ed5edc940..f0469fc2c4 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -25,7 +25,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob QCheckBox *check=nullptr; unsigned i; QString privs[]={ Attributes::SELECT_PRIV, Attributes::INSERT_PRIV, - Attributes::UPDATE_PRIV, Attributes::DELETE_PRIV, + Attributes::UPDATE_PRIV, Attributes::DeletePriv, Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 18fe2083d1..5b8aab333e 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -103,13 +103,13 @@ void RelationshipConfigWidget::loadConfiguration(void) tab_edges_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::ConnectTableEdges); crows_foot_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::CrowsFoot); - deferrable_chk->setChecked(config_params[Attributes::FOREIGN_KEYS][Attributes::DEFERRABLE]==Attributes::True); - deferral_cmb->setCurrentText(config_params[Attributes::FOREIGN_KEYS][Attributes::DEFER_TYPE]); + deferrable_chk->setChecked(config_params[Attributes::FOREIGN_KEYS][Attributes::Deferrable]==Attributes::True); + deferral_cmb->setCurrentText(config_params[Attributes::FOREIGN_KEYS][Attributes::DeferType]); idx=upd_action_cmb->findText(config_params[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]); upd_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); - idx=del_action_cmb->findText(config_params[Attributes::FOREIGN_KEYS][Attributes::DEL_ACTION]); + idx=del_action_cmb->findText(config_params[Attributes::FOREIGN_KEYS][Attributes::DelAction]); del_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); patterns[Attributes::RELATIONSHIP_11]=config_params[Attributes::RELATIONSHIP_11]; @@ -153,10 +153,10 @@ void RelationshipConfigWidget::saveConfiguration(void) else config_params[Attributes::Connection][Attributes::MODE]=Attributes::ConnectCenterPnts; - config_params[Attributes::FOREIGN_KEYS][Attributes::DEFERRABLE]=(deferrable_chk->isChecked() ? Attributes::True : Attributes::False); - config_params[Attributes::FOREIGN_KEYS][Attributes::DEFER_TYPE]=deferral_cmb->currentText(); + config_params[Attributes::FOREIGN_KEYS][Attributes::Deferrable]=(deferrable_chk->isChecked() ? Attributes::True : Attributes::False); + config_params[Attributes::FOREIGN_KEYS][Attributes::DeferType]=deferral_cmb->currentText(); config_params[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); - config_params[Attributes::FOREIGN_KEYS][Attributes::DEL_ACTION]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); + config_params[Attributes::FOREIGN_KEYS][Attributes::DelAction]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); config_params[Attributes::NAME_PATTERNS][Attributes::PATTERNS]=QString(); @@ -214,8 +214,8 @@ void RelationshipConfigWidget::fillNamePatterns(void) pk_col_pattern_txt }; QList pattern_ids={ Attributes::PK_PATTERN, Attributes::UQ_PATTERN, - Attributes::SRC_COL_PATTERN, Attributes::DST_COL_PATTERN, - Attributes::SRC_FK_PATTERN, Attributes::DST_FK_PATTERN, + Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, + Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, Attributes::PK_COL_PATTERN }; relnn=(rel_type==Attributes::RELATIONSHIP_NN); @@ -255,9 +255,9 @@ void RelationshipConfigWidget::updatePattern(void) map inputs_map={ { pk_pattern_txt, Attributes::PK_PATTERN }, { uq_pattern_txt, Attributes::UQ_PATTERN }, { src_col_pattern_txt, Attributes::SRC_COL_PATTERN }, - { dst_col_pattern_txt, Attributes::DST_COL_PATTERN }, + { dst_col_pattern_txt, Attributes::DstColPattern }, { src_fk_pattern_txt, Attributes::SRC_FK_PATTERN }, - { dst_fk_pattern_txt, Attributes::DST_FK_PATTERN }, + { dst_fk_pattern_txt, Attributes::DstFkPattern }, { pk_col_pattern_txt, Attributes::PK_COL_PATTERN } }; setConfigurationChanged(true); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index cf389e630f..25d78cdc4f 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -478,10 +478,10 @@ void RelationshipWidget::useFKGlobalSettings(bool value) if(value) { map confs=RelationshipConfigWidget::getConfigurationParams(); - deferrable_chk->setChecked(confs[Attributes::FOREIGN_KEYS][Attributes::DEFERRABLE]==Attributes::True); - deferral_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::DEFER_TYPE]); + deferrable_chk->setChecked(confs[Attributes::FOREIGN_KEYS][Attributes::Deferrable]==Attributes::True); + deferral_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::DeferType]); upd_action_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]); - del_action_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::DEL_ACTION]); + del_action_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::DelAction]); } else { @@ -519,10 +519,10 @@ void RelationshipWidget::usePatternGlobalSettings(bool value) //Using the global settings pk_pattern_txt->setPlainText(confs[rel_type][Attributes::PK_PATTERN]); src_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_FK_PATTERN]); - dst_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::DST_FK_PATTERN]); + dst_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::DstFkPattern]); uq_pattern_txt->setPlainText(confs[rel_type][Attributes::UQ_PATTERN]); src_col_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_COL_PATTERN]); - dst_col_pattern_txt->setPlainText(confs[rel_type][Attributes::DST_COL_PATTERN]); + dst_col_pattern_txt->setPlainText(confs[rel_type][Attributes::DstColPattern]); pk_col_pattern_txt->setPlainText(confs[rel_type][Attributes::PK_COL_PATTERN]); } else diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 81d6f5a460..cd5e919b24 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -448,8 +448,8 @@ void SQLExecutionWidget::addToSQLHistory(const QString &cmd, unsigned rows, cons else fmt_cmd += QString("-- %1 %2\n").arg(trUtf8("Rows:")).arg(rows); - if(!fmt_cmd.trimmed().endsWith(Attributes::DDL_END_TOKEN)) - fmt_cmd += Attributes::DDL_END_TOKEN + QChar('\n'); + if(!fmt_cmd.trimmed().endsWith(Attributes::DdlEndToken)) + fmt_cmd += Attributes::DdlEndToken + QChar('\n'); SQLExecutionWidget::validateSQLHistoryLength(sql_cmd_conn.getConnectionId(true,true), fmt_cmd, cmd_history_txt); } @@ -468,7 +468,7 @@ void SQLExecutionWidget::validateSQLHistoryLength(const QString &conn_id, const { QStringList buffer = cmds.split(QChar('\n')); cmds = buffer.mid(buffer.size()/2).join(QChar('\n')); - cmds = cmds.mid(cmds.indexOf(Attributes::DDL_END_TOKEN) + Attributes::DDL_END_TOKEN.length()); + cmds = cmds.mid(cmds.indexOf(Attributes::DdlEndToken) + Attributes::DdlEndToken.length()); cmd_history[conn_id] = cmds.trimmed(); if(cmd_history_txt) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 0afd2348c8..d07e88b425 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -678,7 +678,7 @@ void PgModelerCli::extractObjectXML(void) QFile input; QString buf, lin, def_xml, end_tag; QTextStream ts; - QRegExp regexp(QString("^(\\<\\?xml)(.)*(\\<%1)( )*").arg(Attributes::DB_MODEL)), + QRegExp regexp(QString("^(\\<\\?xml)(.)*(\\<%1)( )*").arg(Attributes::DbModel)), default_obj=QRegExp(QString("(default)(\\-)(schema|owner|collation|tablespace)")), //[schema].[func_name](...OUT [type]...) @@ -711,7 +711,7 @@ void PgModelerCli::extractObjectXML(void) //Remove the header entry from buffer buf.remove(start, regexp.matchedLength()+1); buf.remove(0, buf.indexOf(QString("\n"))); - buf.remove(QString("<\\%1>").arg(Attributes::DB_MODEL)); + buf.remove(QString("<\\%1>").arg(Attributes::DbModel)); ts.setString(&buf); //Extracts the objects xml line by line @@ -1024,7 +1024,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) } //Remove recheck attribute from tags. - if(obj_xml.contains(TagExpr.arg(Attributes::ELEMENT))) + if(obj_xml.contains(TagExpr.arg(Attributes::Element))) obj_xml.remove(QRegExp(AttributeExpr.arg(QString("recheck")))); //Remove values greater-op, less-op, sort-op or sort2-op from ref-type attribute from tags. @@ -1073,7 +1073,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Renaming the attribute default to default-value on domain if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Domain)))) - obj_xml.replace(Attributes::DEFAULT, Attributes::DEFAULT_VALUE); + obj_xml.replace(Attributes::Default, Attributes::DefaultValue); //Renaming the tag to if(obj_xml.contains(TagExpr.arg(QString("grant")))) @@ -1115,7 +1115,7 @@ void PgModelerCli::fixOpClassesFamiliesReferences(QString &obj_xml) if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Index))) || obj_xml.contains(QRegExp(QString("(%1)(.)+(type=)(\")(%2)(\")") .arg(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Constraint))) - .arg(Attributes::EX_CONSTR)))) + .arg(Attributes::ExConstr)))) ref_obj_type=ObjectType::OpClass; else if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::OpClass)))) ref_obj_type=ObjectType::OpFamily; @@ -1493,15 +1493,15 @@ bool PgModelerCli::containsRelAttributes(const QString &str) { bool found=false; static vector attribs={ Attributes::RELATIONSHIP, - Attributes::TYPE, Attributes::SRC_REQUIRED, Attributes::DST_REQUIRED, - Attributes::SRC_TABLE, Attributes::DST_TABLE, Attributes::POINTS, + Attributes::TYPE, Attributes::SRC_REQUIRED, Attributes::DstRequired, + Attributes::SRC_TABLE, Attributes::DstTable, Attributes::POINTS, Attributes::Columns, Attributes::Column, Attributes::Constraint, Attributes::LABEL, Attributes::LINE, Attributes::POSITION, - Attributes::IDENTIFIER, Attributes::DEFERRABLE, Attributes::DEFER_TYPE, + Attributes::IDENTIFIER, Attributes::Deferrable, Attributes::DeferType, Attributes::TABLE_NAME, Attributes::SPECIAL_PK_COLS, Attributes::TABLE, Attributes::AncestorTable, Attributes::CopyOptions, Attributes::CopyMode, - Attributes::SRC_COL_PATTERN, Attributes::DST_COL_PATTERN, Attributes::PK_PATTERN, - Attributes::UQ_PATTERN, Attributes::SRC_FK_PATTERN, Attributes::DST_FK_PATTERN }; + Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, Attributes::PK_PATTERN, + Attributes::UQ_PATTERN, Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern }; for(unsigned i=0; i < attribs.size() && !found; i++) found=str.contains(attribs[i]); diff --git a/tests/src/roletest/roletest.cpp b/tests/src/roletest/roletest.cpp index 386e642a89..c381495b82 100644 --- a/tests/src/roletest/roletest.cpp +++ b/tests/src/roletest/roletest.cpp @@ -42,7 +42,7 @@ void RoleTest::alterCommandEndsWithSemiColon(void) role2.setOption(Role::OpLogin, false); alter_cmd=role1.getAlterDefinition(&role2); - alter_cmd.remove(QString("\n%1\n").arg(Attributes::DDL_END_TOKEN)); + alter_cmd.remove(QString("\n%1\n").arg(Attributes::DdlEndToken)); QCOMPARE(alter_cmd.endsWith(";"), true); } From bdc2b268c54cdf5489f9e9685e36fc2592a5f1ab Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 09:28:07 -0300 Subject: [PATCH 181/425] Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 18 +-- libobjrenderer/src/relationshipview.cpp | 10 +- libobjrenderer/src/schemaview.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 6 +- libobjrenderer/src/textboxview.cpp | 2 +- libparsers/src/attributes.cpp | 100 ++++++++-------- libparsers/src/attributes.h | 100 ++++++++-------- libpgconnector/src/catalog.cpp | 6 +- libpgmodeler/src/aggregate.cpp | 8 +- libpgmodeler/src/basegraphicobject.cpp | 4 +- libpgmodeler/src/baseobject.cpp | 4 +- libpgmodeler/src/basetable.cpp | 2 +- libpgmodeler/src/cast.cpp | 6 +- libpgmodeler/src/constraint.cpp | 16 +-- libpgmodeler/src/conversion.cpp | 6 +- libpgmodeler/src/databasemodel.cpp | 108 +++++++++--------- libpgmodeler/src/domain.cpp | 10 +- libpgmodeler/src/element.cpp | 4 +- libpgmodeler/src/eventtrigger.cpp | 14 +-- libpgmodeler/src/excludeelement.cpp | 2 +- libpgmodeler/src/extension.cpp | 4 +- libpgmodeler/src/function.cpp | 12 +- libpgmodeler/src/index.cpp | 16 +-- libpgmodeler/src/language.cpp | 4 +- libpgmodeler/src/operator.cpp | 4 +- libpgmodeler/src/operatorclass.cpp | 6 +- libpgmodeler/src/operatorclasselement.cpp | 4 +- libpgmodeler/src/permission.cpp | 6 +- libpgmodeler/src/reference.cpp | 2 +- libpgmodeler/src/role.cpp | 2 +- libpgmodeler/src/rule.cpp | 4 +- libpgmodeler/src/schema.cpp | 4 +- libpgmodeler/src/table.cpp | 8 +- libpgmodeler/src/textbox.cpp | 4 +- libpgmodeler/src/trigger.cpp | 4 +- libpgmodeler/src/type.cpp | 2 +- libpgmodeler/src/view.cpp | 6 +- .../src/appearanceconfigwidget.cpp | 10 +- .../src/connectionsconfigwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 52 ++++----- libpgmodeler_ui/src/databaseimportform.cpp | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 42 +++---- libpgmodeler_ui/src/generalconfigwidget.cpp | 36 +++--- libpgmodeler_ui/src/mainwindow.cpp | 4 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 2 +- libpgmodeler_ui/src/modelexporthelper.cpp | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 14 +-- libpgmodeler_ui/src/permissionwidget.cpp | 2 +- .../src/relationshipconfigwidget.cpp | 16 +-- libpgmodeler_ui/src/relationshipwidget.cpp | 8 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 16 +-- libpgmodeler_ui/src/syntaxhighlighter.cpp | 4 +- main-cli/src/pgmodelercli.cpp | 12 +- 53 files changed, 373 insertions(+), 373 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 6b87dae4f7..4f6a926404 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -232,17 +232,17 @@ void BaseObjectView::loadObjectsStyle(void) xmlparser.getElementAttributes(attribs); elem=xmlparser.getElementName(); - if(elem==Attributes::GLOBAL) + if(elem==Attributes::Global) { - font.setFamily(attribs[Attributes::FONT]); + font.setFamily(attribs[Attributes::Font]); font.setPointSizeF(attribs[Attributes::SIZE].toDouble()); font.setBold(attribs[Attributes::Bold]==Attributes::True); font.setItalic(attribs[Attributes::ITALIC]==Attributes::True); font.setUnderline(attribs[Attributes::UNDERLINE]==Attributes::True); font_fmt.setFont(font); - font_config[Attributes::GLOBAL]=font_fmt; + font_config[Attributes::Global]=font_fmt; } - else if(elem==Attributes::FONT) + else if(elem==Attributes::Font) { font_config[attribs[Attributes::ID]]=font_fmt; itr=font_config.find(attribs[Attributes::ID]); @@ -255,7 +255,7 @@ void BaseObjectView::loadObjectsStyle(void) } else if(elem==Attributes::OBJECT) { - list=attribs[Attributes::FILL_COLOR].split(','); + list=attribs[Attributes::FillColor].split(','); vector colors; colors.push_back(!list.isEmpty() ? QColor(list[0]) : QColor(0,0,0)); @@ -279,9 +279,9 @@ void BaseObjectView::setFontStyle(const QString &id, QTextCharFormat font_fmt) { QFont font; - if(id!=Attributes::GLOBAL) + if(id!=Attributes::Global) { - font=font_config[Attributes::GLOBAL].font(); + font=font_config[Attributes::Global].font(); font.setItalic(font_fmt.font().italic()); font.setBold(font_fmt.font().bold()); font.setUnderline(font_fmt.font().underline()); @@ -546,7 +546,7 @@ void BaseObjectView::configureProtectedIcon(void) double factor; //Calculates the factor used to resize the protection icon accordding the font size - factor=font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize; + factor=font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize; pol.append(QPointF(2,5)); pol.append(QPointF(2,2)); pol.append(QPointF(3,1)); pol.append(QPointF(4,0)); @@ -644,7 +644,7 @@ void BaseObjectView::togglePlaceholder(bool visible) double BaseObjectView::getFontFactor(void) { - return(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize); + return(font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize); } double BaseObjectView::getScreenDpiFactor(void) diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 756bf2bee5..0aca52eb3e 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -606,7 +606,7 @@ void RelationshipView::configureLine(void) if(base_rel->isSelfRelationship()) { - double fnt_factor=font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize, + double fnt_factor=font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize, pos_factor = 0, offset = 0; unsigned rel_cnt = tables[0]->getConnectedRelsCount(base_rel->getTable(BaseRelationship::SrcTable), base_rel->getTable(BaseRelationship::DstTable)); @@ -850,7 +850,7 @@ void RelationshipView::configureLine(void) QPolygonF pol; QLineF edge, line = QLineF(tables[0]->getCenter(), tables[1]->getCenter()); QPointF pi, center, p_aux[2]; - double font_factor=(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(), + double font_factor=(font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(), size_factor = 1, border_factor = ConnLineLength * 0.30, min_lim = 0, max_lim = 0, @@ -1271,7 +1271,7 @@ void RelationshipView::configureDescriptor(void) Relationship *rel=dynamic_cast(base_rel); unsigned rel_type=base_rel->getRelationshipType(); double x, y, x1, y1, angle = 0, - factor=(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); + factor=(font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); QPen pen; QPointF pnt; vector points=base_rel->getPoints(); @@ -1468,7 +1468,7 @@ void RelationshipView::configureCrowsFootDescriptors(void) QGraphicsLineItem *line_item = nullptr; QGraphicsEllipseItem *circle_item = nullptr; unsigned rel_type = base_rel->getRelationshipType(); - double factor=(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); + double factor=(font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); int signal = 1; BaseTableView *tables[2] = { nullptr, nullptr }; bool mandatory[2] = { false, false }; @@ -1715,7 +1715,7 @@ void RelationshipView::configureAttributes(void) QRectF rect; QPolygonF pol; double py, px, - factor=font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize; + factor=font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize; fmt=font_config[Attributes::Attribute]; font=fmt.font(); diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index ded4af9b11..e6b72a53f3 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -201,7 +201,7 @@ void SchemaView::configureObject(void) //Configures the schema name at the top sch_name->setText(compact_view && !schema->getAlias().isEmpty() ? schema->getAlias() : schema->getName()); - font=BaseObjectView::getFontStyle(Attributes::GLOBAL).font(); + font=BaseObjectView::getFontStyle(Attributes::Global).font(); font.setItalic(true); font.setBold(true); font.setPointSizeF(font.pointSizeF() * 1.3f); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 3ffd8c3adc..eed93cc2a2 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -57,7 +57,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) ObjectType obj_type=ObjectType::BaseObject; Column *column=dynamic_cast(this->getSourceObject()); bool ellipse_desc=false; - double factor=(font_config[Attributes::GLOBAL].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); + double factor=(font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); QPen pen; //Based upon the source object type the descriptor is allocated @@ -123,7 +123,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) } else if(constr_type==ConstraintType::ForeignKey) { - attrib=Attributes::FK_COLUMN; + attrib=Attributes::FkColumn; pol.append(QPointF(0,3)); pol.append(QPointF(0,6)); pol.append(QPointF(4,6)); pol.append(QPointF(4,9)); pol.append(QPointF(5,9)); pol.append(QPointF(9,5)); pol.append(QPointF(9,4)); pol.append(QPointF(5,0)); pol.append(QPointF(4,0)); @@ -214,7 +214,7 @@ void TableObjectView::configureObject(void) } else if(str_constr.indexOf(TextForeignKey)>=0) { - fmt=font_config[Attributes::FK_COLUMN]; + fmt=font_config[Attributes::FkColumn]; constr_type=ConstraintType::ForeignKey; } else if(str_constr.indexOf(TextUnique)>=0) diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 731cda60cb..aeaad506b3 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -78,7 +78,7 @@ void TextboxView::setToolTip(const QString &tooltip) void TextboxView::__configureObject(void) { Textbox *txtbox=dynamic_cast(this->getSourceObject()); - QTextCharFormat fmt=font_config[Attributes::GLOBAL]; + QTextCharFormat fmt=font_config[Attributes::Global]; QPolygonF polygon; polygon.append(QPointF(0.0f,0.0f)); diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 200b69e3f1..d2ca35c47f 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -184,56 +184,56 @@ namespace Attributes { Events=QString("events"), ExConstr=QString("ex-constr"), ExactMatch=QString("exact-match"), - EXC_BUILTIN_ARRAYS=QString("exc-builtin-arrays"), - EXCLUDE_ELEMENT=QString("excelement"), - EXEC_TYPE=QString("exec-type"), - EXECUTE_PRIV=QString("execute"), - EXECUTION_COST=QString("execution-cost"), - EXISTING_VALUE=QString("existing-value"), - EXPLICIT=QString("explicit"), - EXPORT=QString("export"), - EXPORT_TO_FILE=QString("export-to-file"), - EXPRESSION=QString("expression"), - EXPRESSIONS=QString("expressions"), - EXT_OBJ_OIDS=QString("ext-obj-oids"), - FACTOR=QString("factor"), - FADEIN_OBJECTS=QString("fadein-objects"), - FADED_OUT=QString("faded-out"), - FAMILY=QString("family"), - FAST_UPDATE=QString("fast-update"), - FILE_ASSOCIATED=QString("file-associated"), - FILL_COLOR=QString("fill-color"), - FILTER_OIDS=QString("filter-oids"), - FILTER_TABLE_TYPES=QString("filter-tab-types"), - FILTER=QString("filter"), - FINAL_FUNC=QString("final"), - FIRING_TYPE=QString("firing-type"), - FK_COLUMN=QString("fk-column"), - FK_CONSTR=QString("fk-constr"), - FK_DEFS=QString("fk-defs"), - FONT_SIZE=QString("font-size"), - FONT=QString("font"), - FOREGROUND_COLOR=QString("foreground-color"), - FOREIGN_KEYS=QString("foreign-keys"), - FROM_EXP=QString("from-exp"), - FUNCTION_TYPE=QString("function-type"), - FUNCTION=QString("function"), - GENERAL=QString("general"), - GEN_ALTER_CMDS=QString("gen-alter-cmds"), - GLOBAL=QString("global"), - GRANT_OP=QString("grant-op"), - GRID_SIZE=QString("grid-size"), - GROUP=QString("group"), - HANDLER_FUNC=QString("handler"), - HANDLES_TYPE=QString("handles-type"), - HAS_CHANGES=QString("has-changes"), - HASHES=QString("hashes"), - HBA_FILE=QString("hba-file"), - HEIGHT=QString("height"), - HIDE_EXT_ATTRIBS=QString("hide-ext-attribs"), - HIDE_REL_NAME=QString("hide-rel-name"), - HIDE_TABLE_TAGS=QString("hide-table-tags"), - HIGHLIGHT_LINES=QString("highlight-lines"), + ExcBuiltinArrays=QString("exc-builtin-arrays"), + ExcludeElement=QString("excelement"), + ExecType=QString("exec-type"), + ExecutPriv=QString("execute"), + ExecutionCost=QString("execution-cost"), + ExistingValue=QString("existing-value"), + Explicit=QString("explicit"), + Export=QString("export"), + ExportToFile=QString("export-to-file"), + Expression=QString("expression"), + Expressions=QString("expressions"), + ExtObjOids=QString("ext-obj-oids"), + Factor=QString("factor"), + FadeInObjects=QString("fadein-objects"), + FadedOut=QString("faded-out"), + Family=QString("family"), + FastUpdate=QString("fast-update"), + FileAssociated=QString("file-associated"), + FillColor=QString("fill-color"), + FilterOids=QString("filter-oids"), + FilterTableTypes=QString("filter-tab-types"), + Filter=QString("filter"), + FinalFunc=QString("final"), + FiringType=QString("firing-type"), + FkColumn=QString("fk-column"), + FkConstr=QString("fk-constr"), + FkDefs=QString("fk-defs"), + FontSize=QString("font-size"), + Font=QString("font"), + ForegroundColor=QString("foreground-color"), + ForeignKeys=QString("foreign-keys"), + FromExp=QString("from-exp"), + FunctionType=QString("function-type"), + Function=QString("function"), + General=QString("general"), + GenAlterCmds=QString("gen-alter-cmds"), + Global=QString("global"), + GrantOp=QString("grant-op"), + GridSize=QString("grid-size"), + Group=QString("group"), + HandlerFunc=QString("handler"), + HandlesType=QString("handles-type"), + HasChanges=QString("has-changes"), + Hashes=QString("hashes"), + HbaFile=QString("hba-file"), + Height=QString("height"), + HideExtAttribs=QString("hide-ext-attribs"), + HideRelName=QString("hide-rel-name"), + HideTableTags=QString("hide-table-tags"), + HighlightLines=QString("highlight-lines"), HIGHLIGHT_ORDER=QString("highlight-order"), HISTORY_MAX_LENGTH=QString("history-max-length"), ICON=QString("icon"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 3024804931..60bf161ecd 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -199,56 +199,56 @@ namespace Attributes { Events, ExConstr, ExactMatch, - EXC_BUILTIN_ARRAYS, - EXCLUDE_ELEMENT, - EXEC_TYPE, - EXECUTE_PRIV, - EXECUTION_COST, - EXISTING_VALUE, - EXPLICIT, - EXPORT, - EXPORT_TO_FILE, - EXPRESSION, - EXPRESSIONS, - EXT_OBJ_OIDS, - FACTOR, - FADEIN_OBJECTS, - FADED_OUT, - FAMILY, - FAST_UPDATE, - FILE_ASSOCIATED, - FILL_COLOR, - FILTER_OIDS, - FILTER_TABLE_TYPES, - FILTER, - FINAL_FUNC, - FIRING_TYPE, - FK_COLUMN, - FK_CONSTR, - FK_DEFS, - FONT_SIZE, - FONT, - FOREGROUND_COLOR, - FOREIGN_KEYS, - FROM_EXP, - FUNCTION_TYPE, - FUNCTION, - GENERAL, - GEN_ALTER_CMDS, - GLOBAL, - GRANT_OP, - GRID_SIZE, - GROUP, - HANDLER_FUNC, - HANDLES_TYPE, - HAS_CHANGES, - HASHES, - HBA_FILE, - HEIGHT, - HIDE_EXT_ATTRIBS, - HIDE_REL_NAME, - HIDE_TABLE_TAGS, - HIGHLIGHT_LINES, + ExcBuiltinArrays, + ExcludeElement, + ExecType, + ExecutPriv, + ExecutionCost, + ExistingValue, + Explicit, + Export, + ExportToFile, + Expression, + Expressions, + ExtObjOids, + Factor, + FadeInObjects, + FadedOut, + Family, + FastUpdate, + FileAssociated, + FillColor, + FilterOids, + FilterTableTypes, + Filter, + FinalFunc, + FiringType, + FkColumn, + FkConstr, + FkDefs, + FontSize, + Font, + ForegroundColor, + ForeignKeys, + FromExp, + FunctionType, + Function, + General, + GenAlterCmds, + Global, + GrantOp, + GridSize, + Group, + HandlerFunc, + HandlesType, + HasChanges, + Hashes, + HbaFile, + Height, + HideExtAttribs, + HideRelName, + HideTableTags, + HighlightLines, HIGHLIGHT_ORDER, HISTORY_MAX_LENGTH, ICON, diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index f1c3811aa3..4d29d2aa73 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -198,7 +198,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b attribs[Attributes::OID_FILTER_OP]=QString(">"); if(obj_type==ObjectType::Type && exclude_array_types) - attribs[Attributes::EXC_BUILTIN_ARRAYS]=Attributes::True; + attribs[Attributes::ExcBuiltinArrays]=Attributes::True; //Checking if the custom filter expression is present if(attribs.count(Attributes::CustomFilter)) @@ -534,7 +534,7 @@ QString Catalog::getNotExtObjectQuery(const QString &oid_field) try { attribs_map attribs={{Attributes::OID, oid_field}, - {Attributes::EXT_OBJ_OIDS, ext_obj_oids}}; + {Attributes::ExtObjOids, ext_obj_oids}}; loadCatalogQuery(query_id); @@ -597,7 +597,7 @@ vector Catalog::getObjectsAttributes(ObjectType obj_type, const QSt extra_attribs[Attributes::TABLE]=table; if(!filter_oids.empty()) - extra_attribs[Attributes::FILTER_OIDS]=createOidFilter(filter_oids); + extra_attribs[Attributes::FilterOids]=createOidFilter(filter_oids); //Retrieve the comment catalog query. Only columns need to retreive comments in their own catalog query file if(obj_type != ObjectType::Column) diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 6e5e4c9b34..80d272c5ee 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -27,7 +27,7 @@ Aggregate::Aggregate(void) attributes[Attributes::TRANSITION_FUNC]=QString(); attributes[Attributes::STATE_TYPE]=QString(); attributes[Attributes::BaseType]=QString(); - attributes[Attributes::FINAL_FUNC]=QString(); + attributes[Attributes::FinalFunc]=QString(); attributes[Attributes::INITIAL_COND]=QString(); attributes[Attributes::SORT_OP]=QString(); } @@ -241,12 +241,12 @@ QString Aggregate::getCodeDefinition(unsigned def_type) if(functions[FinalFunc]) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::FINAL_FUNC]=functions[FinalFunc]->getSignature(); + attributes[Attributes::FinalFunc]=functions[FinalFunc]->getSignature(); else { functions[FinalFunc]->setAttribute(Attributes::REF_TYPE, - Attributes::FINAL_FUNC); - attributes[Attributes::FINAL_FUNC]=functions[FinalFunc]->getCodeDefinition(def_type,true); + Attributes::FinalFunc); + attributes[Attributes::FinalFunc]=functions[FinalFunc]->getCodeDefinition(def_type,true); } } diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 6d13321598..3efa9b72d6 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -25,7 +25,7 @@ BaseGraphicObject::BaseGraphicObject(void) attributes[Attributes::X_POS]=QString(); attributes[Attributes::Y_POS]=QString(); attributes[Attributes::POSITION]=QString(); - attributes[Attributes::FADED_OUT]=QString(); + attributes[Attributes::FadedOut]=QString(); receiver_object=nullptr; } @@ -76,7 +76,7 @@ bool BaseGraphicObject::isFadedOut(void) void BaseGraphicObject::setFadedOutAttribute(void) { - attributes[Attributes::FADED_OUT]=(is_faded_out ? Attributes::True : QString()); + attributes[Attributes::FadedOut]=(is_faded_out ? Attributes::True : QString()); } void BaseGraphicObject::setPositionAttribute(void) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 4da9cd2773..fa7f4986b6 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -1166,12 +1166,12 @@ void BaseObject::copyAttributes(attribs_map &attribs) { if(!attribs.empty()) { - attributes[Attributes::HAS_CHANGES]=Attributes::True; + attributes[Attributes::HasChanges]=Attributes::True; for(auto &itr : attribs) attributes[itr.first]=itr.second; } else - attributes[Attributes::HAS_CHANGES]=QString(); + attributes[Attributes::HasChanges]=QString(); } QString BaseObject::getAlterDefinition(BaseObject *object) diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index c84634b0e1..51b16ea09b 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -23,7 +23,7 @@ BaseTable::BaseTable(void) tag=nullptr; obj_type=ObjectType::BaseTable; attributes[Attributes::TAG]=QString(); - attributes[Attributes::HIDE_EXT_ATTRIBS]=QString(); + attributes[Attributes::HideExtAttribs]=QString(); attributes[Attributes::MAX_OBJ_COUNT]=QString(); hide_ext_attribs=false; } diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index a9b203b97e..aa3fe1d0c3 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -28,7 +28,7 @@ Cast::Cast(void) attributes[Attributes::DestType]=QString(); attributes[Attributes::CastType]=QString(); attributes[Attributes::IO_CAST]=QString(); - attributes[Attributes::FUNCTION]=QString(); + attributes[Attributes::Function]=QString(); } void Cast::setDataType(unsigned type_idx, PgSqlType type) @@ -178,9 +178,9 @@ QString Cast::getCodeDefinition(unsigned def_type) if(!is_in_out && cast_function) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::FUNCTION]=cast_function->getSignature(); + attributes[Attributes::Function]=cast_function->getSignature(); else - attributes[Attributes::FUNCTION]=cast_function->getCodeDefinition(def_type, true); + attributes[Attributes::Function]=cast_function->getCodeDefinition(def_type, true); } else attributes[Attributes::IO_CAST]=(is_in_out ? Attributes::True : QString()); diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index f69b728a72..99113ab500 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -28,7 +28,7 @@ Constraint::Constraint(void) index_type=BaseType::Null; attributes[Attributes::PK_CONSTR]=QString(); - attributes[Attributes::FK_CONSTR]=QString(); + attributes[Attributes::FkConstr]=QString(); attributes[Attributes::CkConstr]=QString(); attributes[Attributes::UQ_CONSTR]=QString(); attributes[Attributes::ExConstr]=QString(); @@ -37,7 +37,7 @@ Constraint::Constraint(void) attributes[Attributes::DstColumns]=QString(); attributes[Attributes::DelAction]=QString(); attributes[Attributes::UPD_ACTION]=QString(); - attributes[Attributes::EXPRESSION]=QString(); + attributes[Attributes::Expression]=QString(); attributes[Attributes::TYPE]=QString(); attributes[Attributes::ComparisonType]=QString(); attributes[Attributes::DeferType]=QString(); @@ -45,7 +45,7 @@ Constraint::Constraint(void) attributes[Attributes::Deferrable]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::DeclInTable]=QString(); - attributes[Attributes::FACTOR]=QString(); + attributes[Attributes::Factor]=QString(); attributes[Attributes::NO_INHERIT]=QString(); attributes[Attributes::Elements]=QString(); } @@ -664,7 +664,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) QString attrib; attributes[Attributes::PK_CONSTR]=QString(); - attributes[Attributes::FK_CONSTR]=QString(); + attributes[Attributes::FkConstr]=QString(); attributes[Attributes::CkConstr]=QString(); attributes[Attributes::UQ_CONSTR]=QString(); attributes[Attributes::ExConstr]=QString(); @@ -678,7 +678,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attrib=Attributes::PK_CONSTR; break; case ConstraintType::ForeignKey: - attrib=Attributes::FK_CONSTR; + attrib=Attributes::FkConstr; break; case ConstraintType::Unique: attrib=Attributes::UQ_CONSTR; @@ -692,7 +692,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[Attributes::TYPE]=attrib; attributes[Attributes::UPD_ACTION]=(~upd_action); attributes[Attributes::DelAction]=(~del_action); - attributes[Attributes::EXPRESSION]=expression; + attributes[Attributes::Expression]=expression; if(constr_type!=ConstraintType::Check) { @@ -723,9 +723,9 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) setDeclInTableAttribute(); if(fill_factor!=0 && (constr_type==ConstraintType::PrimaryKey || constr_type==ConstraintType::Unique)) - attributes[Attributes::FACTOR]=QString("%1").arg(fill_factor); + attributes[Attributes::Factor]=QString("%1").arg(fill_factor); else - attributes[Attributes::FACTOR]=QString(); + attributes[Attributes::Factor]=QString(); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index 42d64967e4..92509e56f4 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -26,7 +26,7 @@ Conversion::Conversion(void) attributes[Attributes::Default]=QString(); attributes[Attributes::SRC_ENCODING]=QString(); attributes[Attributes::DstEncoding]=QString(); - attributes[Attributes::FUNCTION]=QString(); + attributes[Attributes::Function]=QString(); } void Conversion::setEncoding(unsigned encoding_idx, EncodingType encoding_type) @@ -122,9 +122,9 @@ QString Conversion::getCodeDefinition(unsigned def_type) if(conversion_func) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::FUNCTION]=conversion_func->getName(true); + attributes[Attributes::Function]=conversion_func->getName(true); else - attributes[Attributes::FUNCTION]=conversion_func->getCodeDefinition(def_type, true); + attributes[Attributes::Function]=conversion_func->getCodeDefinition(def_type, true); } return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 85bb718202..7c2fc54d2a 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3577,9 +3577,9 @@ Schema *DatabaseModel::createSchema(void) schema=new Schema; xmlparser.getElementAttributes(attribs); setBasicAttributes(schema); - schema->setFillColor(QColor(attribs[Attributes::FILL_COLOR])); + schema->setFillColor(QColor(attribs[Attributes::FillColor])); schema->setRectVisible(attribs[Attributes::RECT_VISIBLE]==Attributes::True); - schema->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); + schema->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); } catch(Exception &e) { @@ -3623,7 +3623,7 @@ Language *DatabaseModel::createLanguage(void) //Only VALIDATOR, HANDLER and INLINE functions are accepted for the language if(ref_type==Attributes::VALIDATOR_FUNC || - ref_type==Attributes::HANDLER_FUNC || + ref_type==Attributes::HandlerFunc || ref_type==Attributes::INLINE_FUNC) { //Gets the function signature and tries to retrieve it from the model @@ -3641,7 +3641,7 @@ Language *DatabaseModel::createLanguage(void) if(ref_type==Attributes::VALIDATOR_FUNC) lang->setFunction(dynamic_cast(func), Language::ValidatorFunc); - else if(ref_type==Attributes::HANDLER_FUNC) + else if(ref_type==Attributes::HandlerFunc) lang->setFunction(dynamic_cast(func), Language::HandlerFunc); else lang->setFunction(dynamic_cast(func), Language::InlineFunc); @@ -3697,14 +3697,14 @@ Function *DatabaseModel::createFunction(void) if(!attribs[Attributes::BehaviorType].isEmpty()) func->setBehaviorType(BehaviorType(attribs[Attributes::BehaviorType])); - if(!attribs[Attributes::FUNCTION_TYPE].isEmpty()) - func->setFunctionType(FunctionType(attribs[Attributes::FUNCTION_TYPE])); + if(!attribs[Attributes::FunctionType].isEmpty()) + func->setFunctionType(FunctionType(attribs[Attributes::FunctionType])); if(!attribs[Attributes::SECURITY_TYPE].isEmpty()) func->setSecurityType(SecurityType(attribs[Attributes::SECURITY_TYPE])); - if(!attribs[Attributes::EXECUTION_COST].isEmpty()) - func->setExecutionCost(attribs[Attributes::EXECUTION_COST].toInt()); + if(!attribs[Attributes::ExecutionCost].isEmpty()) + func->setExecutionCost(attribs[Attributes::ExecutionCost].toInt()); if(!attribs[Attributes::ROW_AMOUNT].isEmpty()) func->setRowAmount(attribs[Attributes::ROW_AMOUNT].toInt()); @@ -4122,7 +4122,7 @@ Type *DatabaseModel::createType(void) type->setSubtypeOpClass(op_class); } //Configuring the functions used by the type (only for BASE type) - else if(elem==Attributes::FUNCTION) + else if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); @@ -4264,7 +4264,7 @@ Cast *DatabaseModel::createCast(void) type_idx++; } //Extracts the conversion function - else if(elem==Attributes::FUNCTION) + else if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); @@ -4323,7 +4323,7 @@ Conversion *DatabaseModel::createConversion(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::FUNCTION) + if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); @@ -4371,7 +4371,7 @@ Operator *DatabaseModel::createOperator(void) xmlparser.getElementAttributes(attribs); oper->setMerges(attribs[Attributes::MERGES]==Attributes::True); - oper->setHashes(attribs[Attributes::HASHES]==Attributes::True); + oper->setHashes(attribs[Attributes::Hashes]==Attributes::True); func_types[Attributes::OPERATOR_FUNC]=Operator::FUNC_OPERATOR; func_types[Attributes::JOIN_FUNC]=Operator::FUNC_JOIN; @@ -4417,7 +4417,7 @@ Operator *DatabaseModel::createOperator(void) type=createPgSQLType(); oper->setArgumentType(type, arg_type); } - else if(elem==Attributes::FUNCTION) + else if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); @@ -4468,7 +4468,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) op_class->setIndexingType(IndexingType(attribs[Attributes::INDEX_TYPE])); op_class->setDefault(attribs[Attributes::Default]==Attributes::True); - elem_types[Attributes::FUNCTION]=OperatorClassElement::FunctionElem; + elem_types[Attributes::Function]=OperatorClassElement::FunctionElem; elem_types[Attributes::OPERATOR]=OperatorClassElement::OperatorElem; elem_types[Attributes::STORAGE]=OperatorClassElement::StorageElem; @@ -4621,7 +4621,7 @@ Aggregate *DatabaseModel::createAggregate(void) else aggreg->addDataType(type); } - else if(elem==Attributes::FUNCTION) + else if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); @@ -4680,9 +4680,9 @@ Table *DatabaseModel::createTable(void) table->setUnlogged(attribs[Attributes::UNLOGGED]==Attributes::True); table->setRLSEnabled(attribs[Attributes::RLS_ENABLED]==Attributes::True); table->setRLSForced(attribs[Attributes::RLS_FORCED]==Attributes::True); - table->setGenerateAlterCmds(attribs[Attributes::GEN_ALTER_CMDS]==Attributes::True); - table->setExtAttribsHidden(attribs[Attributes::HIDE_EXT_ATTRIBS]==Attributes::True); - table->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); + table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); + table->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); + table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4931,7 +4931,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr_type=ConstraintType::Check; else if(attribs[Attributes::TYPE]==Attributes::PK_CONSTR) constr_type=ConstraintType::PrimaryKey; - else if(attribs[Attributes::TYPE]==Attributes::FK_CONSTR) + else if(attribs[Attributes::TYPE]==Attributes::FkConstr) constr_type=ConstraintType::ForeignKey; else if(attribs[Attributes::TYPE]==Attributes::UQ_CONSTR) constr_type=ConstraintType::Unique; @@ -4940,8 +4940,8 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setConstraintType(constr_type); - if(!attribs[Attributes::FACTOR].isEmpty()) - constr->setFillFactor(attribs[Attributes::FACTOR].toUInt()); + if(!attribs[Attributes::Factor].isEmpty()) + constr->setFillFactor(attribs[Attributes::Factor].toUInt()); setBasicAttributes(constr); @@ -5004,12 +5004,12 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { elem=xmlparser.getElementName(); - if(elem==Attributes::EXCLUDE_ELEMENT) + if(elem==Attributes::ExcludeElement) { createElement(exc_elem, constr, parent_obj); constr->addExcludeElement(exc_elem); } - else if(elem==Attributes::EXPRESSION) + else if(elem==Attributes::Expression) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5095,7 +5095,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec xml_elem=xmlparser.getElementName(); is_part_key = xml_elem == Attributes::PARTITION_KEY; - if(xml_elem==Attributes::INDEX_ELEMENT || xml_elem==Attributes::EXCLUDE_ELEMENT || is_part_key) + if(xml_elem==Attributes::INDEX_ELEMENT || xml_elem==Attributes::ExcludeElement || is_part_key) { xmlparser.getElementAttributes(attribs); @@ -5234,7 +5234,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setColumn(column); } - else if(xml_elem==Attributes::EXPRESSION) + else if(xml_elem==Attributes::Expression) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5323,10 +5323,10 @@ Index *DatabaseModel::createIndex(void) index->setParentTable(table); index->setIndexAttribute(Index::Concurrent, attribs[Attributes::Concurrent]==Attributes::True); index->setIndexAttribute(Index::Unique, attribs[Attributes::UNIQUE]==Attributes::True); - index->setIndexAttribute(Index::FastUpdate, attribs[Attributes::FAST_UPDATE]==Attributes::True); + index->setIndexAttribute(Index::FastUpdate, attribs[Attributes::FastUpdate]==Attributes::True); index->setIndexAttribute(Index::Buffering, attribs[Attributes::Buffering]==Attributes::True); index->setIndexingType(attribs[Attributes::INDEX_TYPE]); - index->setFillFactor(attribs[Attributes::FACTOR].toUInt()); + index->setFillFactor(attribs[Attributes::Factor].toUInt()); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5396,7 +5396,7 @@ Rule *DatabaseModel::createRule(void) ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - rule->setExecutionType(attribs[Attributes::EXEC_TYPE]); + rule->setExecutionType(attribs[Attributes::ExecType]); rule->setEventType(attribs[Attributes::EventType]); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5496,7 +5496,7 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setExecutePerRow(attribs[Attributes::PER_ROW]==Attributes::True); - trigger->setFiringType(FiringType(attribs[Attributes::FIRING_TYPE])); + trigger->setFiringType(FiringType(attribs[Attributes::FiringType])); trigger->setTransitionTableName(Trigger::OldTableName, attribs[Attributes::OLD_TABLE_NAME]); trigger->setTransitionTableName(Trigger::NewTableName, attribs[Attributes::NEW_TABLE_NAME]); @@ -5543,7 +5543,7 @@ Trigger *DatabaseModel::createTrigger(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::FUNCTION) + if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); @@ -5639,7 +5639,7 @@ Policy *DatabaseModel::createPolicy(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::EXPRESSION) + if(elem==Attributes::Expression) { xmlparser.getElementAttributes(attribs); xmlparser.savePosition(); @@ -5718,7 +5718,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::FUNCTION) + if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); @@ -5736,7 +5736,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) event_trig->setFunction(dynamic_cast(func)); } - else if(elem==Attributes::FILTER) + else if(elem==Attributes::Filter) { xmlparser.getElementAttributes(attribs); event_trig->setFilter(attribs[Attributes::VARIABLE], attribs[Attributes::VALUES].split(',')); @@ -5887,8 +5887,8 @@ View *DatabaseModel::createView(void) view->setMaterialized(attribs[Attributes::MATERIALIZED]==Attributes::True); view->setRecursive(attribs[Attributes::RECURSIVE]==Attributes::True); view->setWithNoData(attribs[Attributes::WITH_NO_DATA]==Attributes::True); - view->setExtAttribsHidden(attribs[Attributes::HIDE_EXT_ATTRIBS]==Attributes::True); - view->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); + view->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); + view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5963,7 +5963,7 @@ View *DatabaseModel::createView(void) xmlparser.restorePosition(); } } - else if(elem==Attributes::EXPRESSION) + else if(elem==Attributes::Expression) { xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); @@ -5975,7 +5975,7 @@ View *DatabaseModel::createView(void) { if(attribs[Attributes::TYPE]==Attributes::SELECT_EXP) type=Reference::SqlReferSelect; - else if(attribs[Attributes::TYPE]==Attributes::FROM_EXP) + else if(attribs[Attributes::TYPE]==Attributes::FromExp) type=Reference::SqlReferFrom; else if(attribs[Attributes::TYPE]==Attributes::SIMPLE_EXP) type=Reference::SqlReferWhere; @@ -6116,7 +6116,7 @@ Extension *DatabaseModel::createExtension(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(extension); - extension->setHandlesType(attribs[Attributes::HANDLES_TYPE]==Attributes::True); + extension->setHandlesType(attribs[Attributes::HandlesType]==Attributes::True); extension->setVersion(Extension::CurVersion, attribs[Attributes::CurVersion]); extension->setVersion(Extension::OldVersion, attribs[Attributes::OLD_VERSION]); } @@ -6179,7 +6179,7 @@ Textbox *DatabaseModel::createTextbox(void) xmlparser.getElementAttributes(attribs); - txtbox->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); + txtbox->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); txtbox->setTextAttribute(Textbox::ItalicText, attribs[Attributes::ITALIC]==Attributes::True); txtbox->setTextAttribute(Textbox::BoldText, attribs[Attributes::Bold]==Attributes::True); txtbox->setTextAttribute(Textbox::UnderlineText, attribs[Attributes::UNDERLINE]==Attributes::True); @@ -6187,8 +6187,8 @@ Textbox *DatabaseModel::createTextbox(void) if(!attribs[Attributes::Color].isEmpty()) txtbox->setTextColor(QColor(attribs[Attributes::Color])); - if(!attribs[Attributes::FONT_SIZE].isEmpty()) - txtbox->setFontSize(attribs[Attributes::FONT_SIZE].toDouble()); + if(!attribs[Attributes::FontSize].isEmpty()) + txtbox->setFontSize(attribs[Attributes::FontSize].toDouble()); } catch(Exception &e) { @@ -6226,7 +6226,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) xmlparser.getElementAttributes(attribs); protect=(attribs[Attributes::PROTECTED]==Attributes::True); - faded_out=(attribs[Attributes::FADED_OUT]==Attributes::True); + faded_out=(attribs[Attributes::FadedOut]==Attributes::True); if(!attribs[Attributes::CustomColor].isEmpty()) custom_color=QColor(attribs[Attributes::CustomColor]); @@ -6388,7 +6388,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) { elem=xmlparser.getElementName(); - if(elem == Attributes::EXPRESSION && rel) + if(elem == Attributes::Expression && rel) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -6591,10 +6591,10 @@ Permission *DatabaseModel::createPermission(void) while(itr!=itr_end) { - if(itr->first!=Attributes::GRANT_OP) + if(itr->first!=Attributes::GrantOp) { priv_value=(itr->second==Attributes::True); - grant_op=(itr->second==Attributes::GRANT_OP); + grant_op=(itr->second==Attributes::GrantOp); if(itr->first==Attributes::ConnectPriv) priv_type=Permission::PrivConnect; @@ -6602,7 +6602,7 @@ Permission *DatabaseModel::createPermission(void) priv_type=Permission::PrivCreate; else if(itr->first==Attributes::DeletePriv) priv_type=Permission::PrivDelete; - else if(itr->first==Attributes::EXECUTE_PRIV) + else if(itr->first==Attributes::ExecutPriv) priv_type=Permission::PrivExecute; else if(itr->first==Attributes::INSERT_PRIV) priv_type=Permission::PrivInsert; @@ -6815,7 +6815,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) if(def_type==SchemaParser::SqlDefinition) { - attribs_aux[Attributes::FUNCTION]=(!functions.empty() ? Attributes::True : QString()); + attribs_aux[Attributes::Function]=(!functions.empty() ? Attributes::True : QString()); for(auto &type : types) { @@ -6970,7 +6970,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } - attribs_aux[Attributes::EXPORT_TO_FILE]=(export_file ? Attributes::True : QString()); + attribs_aux[Attributes::ExportToFile]=(export_file ? Attributes::True : QString()); def=schparser.getCodeDefinition(Attributes::DbModel, attribs_aux, def_type); if(prepend_at_bod && def_type==SchemaParser::SqlDefinition) @@ -9637,8 +9637,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::TAG]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); attribs[Attributes::AppendedSql]=object->getAppendedSQL(); attribs[Attributes::PREPENDED_SQL]=object->getPrependedSQL(); - attribs[Attributes::HIDE_EXT_ATTRIBS]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? Attributes::True : QString()); - attribs[Attributes::FADED_OUT]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? Attributes::True : QString()); + attribs[Attributes::HideExtAttribs]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? Attributes::True : QString()); + attribs[Attributes::FadedOut]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? Attributes::True : QString()); if(TableObject::isTableObject(obj_type)) { @@ -9776,8 +9776,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option (save_objs_sqldis && !attribs[Attributes::SQL_DISABLED].isEmpty()) || (save_custom_sql && (!attribs[Attributes::AppendedSql].isEmpty() || !attribs[Attributes::PREPENDED_SQL].isEmpty())) || - (save_fadeout && !attribs[Attributes::FADED_OUT].isEmpty()) || - (save_extattribs && !attribs[Attributes::HIDE_EXT_ATTRIBS].isEmpty()) || + (save_fadeout && !attribs[Attributes::FadedOut].isEmpty()) || + (save_extattribs && !attribs[Attributes::HideExtAttribs].isEmpty()) || (save_objs_aliases && !attribs[Attributes::Alias].isEmpty())) { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, @@ -10080,10 +10080,10 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option } if(load_fadeout) - dynamic_cast(object)->setFadedOut(attribs[Attributes::FADED_OUT]==Attributes::True); + dynamic_cast(object)->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(load_extattribs && base_tab) - base_tab->setExtAttribsHidden(attribs[Attributes::HIDE_EXT_ATTRIBS]==Attributes::True); + base_tab->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); } points.clear(); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 75593338ad..2874f56165 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -132,7 +132,7 @@ QString Domain::getCodeDefinition(unsigned def_type) for(auto itr : chk_constrs) { aux_attribs[Attributes::NAME] = itr.first; - aux_attribs[Attributes::EXPRESSION] = itr.second; + aux_attribs[Attributes::Expression] = itr.second; attributes[Attributes::Constraints]+=schparser.getCodeDefinition(Attributes::DomConstraint, aux_attribs, def_type); } @@ -172,7 +172,7 @@ QString Domain::getAlterDefinition(BaseObject *object) attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::NOT_NULL]=QString(); attributes[Attributes::Constraints]=QString(); - attributes[Attributes::EXPRESSION]=QString(); + attributes[Attributes::Expression]=QString(); attributes[Attributes::OLD_NAME]=QString(); attributes[Attributes::NEW_NAME]=QString(); @@ -198,7 +198,7 @@ QString Domain::getAlterDefinition(BaseObject *object) (aux_constrs.count(constr.first) && orig_expr != aux_expr)) { aux_attribs[Attributes::NAME]=constr.first; - aux_attribs[Attributes::EXPRESSION]=Attributes::UNSET; + aux_attribs[Attributes::Expression]=Attributes::UNSET; attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } @@ -206,7 +206,7 @@ QString Domain::getAlterDefinition(BaseObject *object) if(aux_constrs.count(constr.first) && orig_expr != aux_expr) { aux_attribs[Attributes::NAME]=constr.first; - aux_attribs[Attributes::EXPRESSION]=aux_constrs[constr.first]; + aux_attribs[Attributes::Expression]=aux_constrs[constr.first]; attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } } @@ -217,7 +217,7 @@ QString Domain::getAlterDefinition(BaseObject *object) if(orig_constrs.count(constr.first) == 0) { aux_attribs[Attributes::NAME]=constr.first; - aux_attribs[Attributes::EXPRESSION]=constr.second; + aux_attribs[Attributes::Expression]=constr.second; attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } } diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 676c4a8b89..b6e9a6437f 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -94,7 +94,7 @@ OperatorClass *Element::getOperatorClass(void) void Element::configureAttributes(attribs_map &attributes, unsigned def_type) { attributes[Attributes::Column]=QString(); - attributes[Attributes::EXPRESSION]=QString(); + attributes[Attributes::Expression]=QString(); attributes[Attributes::OP_CLASS]=QString(); attributes[Attributes::USE_SORTING]=(this->sorting_enabled ? Attributes::True : QString()); attributes[Attributes::NULLS_FIRST]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? Attributes::True : QString()); @@ -104,7 +104,7 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) if(column) attributes[Attributes::Column]=column->getName(true); else - attributes[Attributes::EXPRESSION]=expression; + attributes[Attributes::Expression]=expression; if(operator_class) { diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 4985410255..6427a4df7c 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -23,8 +23,8 @@ EventTrigger::EventTrigger(void) obj_type=ObjectType::EventTrigger; function=nullptr; attributes[Attributes::Event]=QString(); - attributes[Attributes::FILTER]=QString(); - attributes[Attributes::FUNCTION]=QString(); + attributes[Attributes::Filter]=QString(); + attributes[Attributes::Function]=QString(); } void EventTrigger::setEvent(EventTriggerType evnt_type) @@ -116,22 +116,22 @@ QString EventTrigger::getCodeDefinition(unsigned def_type) QStringList str_list; if(function) - attributes[Attributes::FUNCTION]=function->getSignature(); + attributes[Attributes::Function]=function->getSignature(); for(auto &flt : filter) str_list.push_back(QString("%1 IN ('%2')").arg(flt.first).arg(flt.second.join(QString("','")))); - attributes[Attributes::FILTER]=str_list.join(QString("\n\t AND ")); + attributes[Attributes::Filter]=str_list.join(QString("\n\t AND ")); } else { if(function) - attributes[Attributes::FUNCTION]=function->getCodeDefinition(def_type, true); + attributes[Attributes::Function]=function->getCodeDefinition(def_type, true); for(auto &flt : filter) //Creating an element - attributes[Attributes::FILTER]+=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") - .arg(Attributes::FILTER) + attributes[Attributes::Filter]+=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") + .arg(Attributes::Filter) .arg(Attributes::VARIABLE).arg(flt.first) .arg(Attributes::VALUES).arg(flt.second.join(',')); } diff --git a/libpgmodeler/src/excludeelement.cpp b/libpgmodeler/src/excludeelement.cpp index 3f1f0eb712..f7e6719dbf 100644 --- a/libpgmodeler/src/excludeelement.cpp +++ b/libpgmodeler/src/excludeelement.cpp @@ -31,7 +31,7 @@ QString ExcludeElement::getCodeDefinition(unsigned def_type) attributes[Attributes::OPERATOR]=_operator->getCodeDefinition(def_type, true); } - return(schparser.getCodeDefinition(Attributes::EXCLUDE_ELEMENT, attributes, def_type)); + return(schparser.getCodeDefinition(Attributes::ExcludeElement, attributes, def_type)); } bool ExcludeElement::operator == (ExcludeElement &elem) diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index 34e329ecb2..d71dd8f1b8 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -4,7 +4,7 @@ Extension::Extension(void) { obj_type=ObjectType::Extension; handles_type=false; - attributes[Attributes::HANDLES_TYPE]=QString(); + attributes[Attributes::HandlesType]=QString(); attributes[Attributes::CurVersion]=QString(); attributes[Attributes::OLD_VERSION]=QString(); } @@ -86,7 +86,7 @@ QString Extension::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); attributes[Attributes::NAME]=this->getName(def_type==SchemaParser::SqlDefinition, false); - attributes[Attributes::HANDLES_TYPE]=(handles_type ? Attributes::True : QString()); + attributes[Attributes::HandlesType]=(handles_type ? Attributes::True : QString()); attributes[Attributes::CurVersion]=versions[CurVersion]; attributes[Attributes::OLD_VERSION]=versions[OldVersion]; diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 90dd560708..f5b7bf846f 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -31,10 +31,10 @@ Function::Function(void) row_amount=1000; attributes[Attributes::PARAMETERS]=QString(); - attributes[Attributes::EXECUTION_COST]=QString(); + attributes[Attributes::ExecutionCost]=QString(); attributes[Attributes::ROW_AMOUNT]=QString(); attributes[Attributes::RETURN_TYPE]=QString(); - attributes[Attributes::FUNCTION_TYPE]=QString(); + attributes[Attributes::FunctionType]=QString(); attributes[Attributes::LANGUAGE]=QString(); attributes[Attributes::RETURNS_SETOF]=QString(); attributes[Attributes::SECURITY_TYPE]=QString(); @@ -457,9 +457,9 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) setParametersAttribute(def_type); - attributes[Attributes::EXECUTION_COST]=QString("%1").arg(execution_cost); + attributes[Attributes::ExecutionCost]=QString("%1").arg(execution_cost); attributes[Attributes::ROW_AMOUNT]=QString("%1").arg(row_amount); - attributes[Attributes::FUNCTION_TYPE]=(~function_type); + attributes[Attributes::FunctionType]=(~function_type); if(language) { @@ -517,7 +517,7 @@ QString Function::getAlterDefinition(BaseObject *object) else { if(this->execution_cost!=func->execution_cost) - attribs[Attributes::EXECUTION_COST]=QString::number(func->execution_cost); + attribs[Attributes::ExecutionCost]=QString::number(func->execution_cost); if(this->returns_setof && func->returns_setof && this->row_amount!=func->row_amount) { @@ -526,7 +526,7 @@ QString Function::getAlterDefinition(BaseObject *object) } if(this->function_type!=func->function_type) - attribs[Attributes::FUNCTION_TYPE]=~func->function_type; + attribs[Attributes::FunctionType]=~func->function_type; if(this->is_leakproof!=func->is_leakproof) attribs[Attributes::LEAKPROOF]=(func->is_leakproof ? Attributes::True : Attributes::UNSET); diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index f093e68d4a..bc023b677d 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -29,15 +29,15 @@ Index::Index(void) attributes[Attributes::TABLE]=QString(); attributes[Attributes::INDEX_TYPE]=QString(); attributes[Attributes::Columns]=QString(); - attributes[Attributes::EXPRESSION]=QString(); - attributes[Attributes::FACTOR]=QString(); + attributes[Attributes::Expression]=QString(); + attributes[Attributes::Factor]=QString(); attributes[Attributes::PREDICATE]=QString(); attributes[Attributes::OP_CLASS]=QString(); attributes[Attributes::NULLS_FIRST]=QString(); attributes[Attributes::AscOrder]=QString(); attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::Elements]=QString(); - attributes[Attributes::FAST_UPDATE]=QString(); + attributes[Attributes::FastUpdate]=QString(); attributes[Attributes::Buffering]=QString(); attributes[Attributes::STORAGE_PARAMS]=QString(); } @@ -346,18 +346,18 @@ QString Index::getCodeDefinition(unsigned def_type) } if(this->indexing_type==IndexingType::Gin) - attributes[Attributes::STORAGE_PARAMS]=attributes[Attributes::FAST_UPDATE]=(index_attribs[FastUpdate] ? Attributes::True : QString()); + attributes[Attributes::STORAGE_PARAMS]=attributes[Attributes::FastUpdate]=(index_attribs[FastUpdate] ? Attributes::True : QString()); if(this->indexing_type==IndexingType::Gist) attributes[Attributes::STORAGE_PARAMS]=attributes[Attributes::Buffering]=(index_attribs[Buffering] ? Attributes::True : QString()); if(/*this->indexing_type==IndexingType::btree && */fill_factor >= 10) { - attributes[Attributes::FACTOR]=QString("%1").arg(fill_factor); + attributes[Attributes::Factor]=QString("%1").arg(fill_factor); attributes[Attributes::STORAGE_PARAMS]=Attributes::True; } else if(def_type==SchemaParser::XmlDefinition) - attributes[Attributes::FACTOR]=QString("0"); + attributes[Attributes::Factor]=QString("0"); /* Case the index doesn't referece some column added by relationship it will be declared inside the parent table construction by the use of 'decl-in-table' schema attribute */ @@ -390,11 +390,11 @@ QString Index::getAlterDefinition(BaseObject *object) if(this->indexing_type==index->indexing_type) { if(this->fill_factor!=index->fill_factor && index->fill_factor >= 10) - attribs[Attributes::FACTOR]=QString::number(index->fill_factor); + attribs[Attributes::Factor]=QString::number(index->fill_factor); if(this->indexing_type==IndexingType::Gin && this->index_attribs[FastUpdate] != index->index_attribs[FastUpdate]) - attribs[Attributes::FAST_UPDATE]=(index->index_attribs[FastUpdate] ? Attributes::True : Attributes::UNSET); + attribs[Attributes::FastUpdate]=(index->index_attribs[FastUpdate] ? Attributes::True : Attributes::UNSET); if(this->indexing_type==IndexingType::Gist && this->index_attribs[Buffering] != index->index_attribs[Buffering]) diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 5e786ba743..d4ec36fa84 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -27,7 +27,7 @@ Language::Language(void) functions[i]=nullptr; attributes[Attributes::TRUSTED]=QString(); - attributes[Attributes::HANDLER_FUNC]=QString(); + attributes[Attributes::HandlerFunc]=QString(); attributes[Attributes::VALIDATOR_FUNC]=QString(); attributes[Attributes::INLINE_FUNC]=QString(); } @@ -117,7 +117,7 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) unsigned i; QString attribs_func[3]={Attributes::VALIDATOR_FUNC, - Attributes::HANDLER_FUNC, + Attributes::HandlerFunc, Attributes::INLINE_FUNC}; attributes[Attributes::TRUSTED]=(is_trusted ? Attributes::True : QString()); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 8a161ee803..9ba6341984 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -41,7 +41,7 @@ Operator::Operator(void) attributes[Attributes::RESTRICTION_FUNC]=QString(); attributes[Attributes::JOIN_FUNC]=QString(); attributes[Attributes::OPERATOR_FUNC]=QString(); - attributes[Attributes::HASHES]=QString(); + attributes[Attributes::Hashes]=QString(); attributes[Attributes::MERGES]=QString(); attributes[Attributes::SIGNATURE]=QString(); attributes[Attributes::REF_TYPE]=QString(); @@ -330,7 +330,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) } } - attributes[Attributes::HASHES]=(hashes ? Attributes::True : QString()); + attributes[Attributes::Hashes]=(hashes ? Attributes::True : QString()); attributes[Attributes::MERGES]=(merges ? Attributes::True : QString()); attributes[Attributes::SIGNATURE]=getSignature(); diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index e9ec86ad78..f4d7e69ccb 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -23,7 +23,7 @@ OperatorClass::OperatorClass(void) obj_type=ObjectType::OpClass; family=nullptr; is_default=false; - attributes[Attributes::FAMILY]=QString(); + attributes[Attributes::Family]=QString(); attributes[Attributes::Elements]=QString(); attributes[Attributes::INDEX_TYPE]=QString(); attributes[Attributes::TYPE]=QString(); @@ -183,9 +183,9 @@ QString OperatorClass::getCodeDefinition(unsigned def_type, bool reduced_form) if(family) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::FAMILY]=family->getName(true); + attributes[Attributes::Family]=family->getName(true); else - attributes[Attributes::FAMILY]=family->getSignature(); + attributes[Attributes::Family]=family->getSignature(); } attributes[Attributes::SIGNATURE]=getSignature(); diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 2d75ee84ce..5e183b380e 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -128,7 +128,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[Attributes::TYPE]=QString(); attributes[Attributes::STRATEGY_NUM]=QString(); attributes[Attributes::SIGNATURE]=QString(); - attributes[Attributes::FUNCTION]=QString(); + attributes[Attributes::Function]=QString(); attributes[Attributes::OPERATOR]=QString(); attributes[Attributes::STORAGE]=QString(); attributes[Attributes::OP_FAMILY]=QString(); @@ -137,7 +137,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) if(element_type==FunctionElem && function && strategy_number > 0) { //FUNCTION support_number [ ( op_type [ , op_type ] ) ] funcname ( argument_type [, ...] ) - attributes[Attributes::FUNCTION]=Attributes::True; + attributes[Attributes::Function]=Attributes::True; attributes[Attributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 5fee063139..105dae8643 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -44,7 +44,7 @@ Permission::Permission(BaseObject *obj) attributes[Attributes::OBJECT]=QString(); attributes[Attributes::TYPE]=QString(); attributes[Attributes::PARENT]=QString(); - attributes[Attributes::GRANT_OP]=QString(); + attributes[Attributes::GrantOp]=QString(); attributes[Attributes::ROLES]=QString(); attributes[Attributes::PRIVILEGES]=QString(); attributes[Attributes::Cascade]=QString(); @@ -416,7 +416,7 @@ QString Permission::getCodeDefinition(unsigned def_type) Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, - Attributes::EXECUTE_PRIV, Attributes::USAGE_PRIV }; + Attributes::ExecutPriv, Attributes::USAGE_PRIV }; obj_type=object->getObjectType(); @@ -445,7 +445,7 @@ QString Permission::getCodeDefinition(unsigned def_type) for(i=0; i < 12; i++) { if(privileges[i] && grant_option[i]) - attributes[priv_vect[i]]=Attributes::GRANT_OP; + attributes[priv_vect[i]]=Attributes::GrantOp; else if(privileges[i]) attributes[priv_vect[i]]=Attributes::True; else diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index a1dcc64ede..a8cafd0ae1 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -227,7 +227,7 @@ QString Reference::getXMLDefinition(void) attribs[Attributes::Column]=column->getName(); attribs[Attributes::REF_ALIAS]=ref_alias; - attribs[Attributes::EXPRESSION]=expression; + attribs[Attributes::Expression]=expression; attribs[Attributes::Alias]=alias; attribs[Attributes::ColumnAlias]=column_alias; diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index cbe958f70f..736bf891c6 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -43,7 +43,7 @@ Role::Role(void) attributes[Attributes::MEMBER_ROLES]=QString(); attributes[Attributes::AdminRoles]=QString(); attributes[Attributes::REPLICATION]=QString(); - attributes[Attributes::GROUP]=QString(); + attributes[Attributes::Group]=QString(); attributes[Attributes::BypassRls]=QString(); } diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index 892ae8caef..64409d80b3 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -25,7 +25,7 @@ Rule::Rule(void) attributes[Attributes::EventType]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::Condition]=QString(); - attributes[Attributes::EXEC_TYPE]=QString(); + attributes[Attributes::ExecType]=QString(); attributes[Attributes::Commands]=QString(); } @@ -128,7 +128,7 @@ QString Rule::getCodeDefinition(unsigned def_type) setCommandsAttribute(); attributes[Attributes::Condition]=conditional_expr; - attributes[Attributes::EXEC_TYPE]=(~execution_type); + attributes[Attributes::ExecType]=(~execution_type); attributes[Attributes::EventType]=(~event_type); if(getParentTable()) diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index 25c35baf1d..c0e2b41040 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -23,7 +23,7 @@ Schema::Schema(void) obj_type=ObjectType::Schema; fill_color=QColor(225,225,225, 80); rect_visible=false; - attributes[Attributes::FILL_COLOR]=QString(); + attributes[Attributes::FillColor]=QString(); attributes[Attributes::RECT_VISIBLE]=QString(); } @@ -67,7 +67,7 @@ QString Schema::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[Attributes::FILL_COLOR]=fill_color.name(); + attributes[Attributes::FillColor]=fill_color.name(); attributes[Attributes::RECT_VISIBLE]=(rect_visible ? Attributes::True : QString()); setFadedOutAttribute(); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 43c17170e8..f2e4550c77 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -33,7 +33,7 @@ Table::Table(void) : BaseTable() attributes[Attributes::ColsComment]=QString(); attributes[Attributes::CopyTable]=QString(); attributes[Attributes::AncestorTable]=QString(); - attributes[Attributes::GEN_ALTER_CMDS]=QString(); + attributes[Attributes::GenAlterCmds]=QString(); attributes[Attributes::ConstrSqlDisabled]=QString(); attributes[Attributes::ColIndexes]=QString(); attributes[Attributes::ConstrIndexes]=QString(); @@ -1594,14 +1594,14 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) { QStringList part_keys_code; attributes[Attributes::OIDS]=(with_oid ? Attributes::True : QString()); - attributes[Attributes::GEN_ALTER_CMDS]=(gen_alter_cmds ? Attributes::True : QString()); + attributes[Attributes::GenAlterCmds]=(gen_alter_cmds ? Attributes::True : QString()); attributes[Attributes::UNLOGGED]=(unlogged ? Attributes::True : QString()); attributes[Attributes::RLS_ENABLED]=(rls_enabled ? Attributes::True : QString()); attributes[Attributes::RLS_FORCED]=(rls_forced ? Attributes::True : QString()); attributes[Attributes::CopyTable]=QString(); attributes[Attributes::AncestorTable]=QString(); attributes[Attributes::TAG]=QString(); - attributes[Attributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? Attributes::True : QString()); + attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); attributes[Attributes::PARTITIONING]=~partitioning_type; attributes[Attributes::PARTITION_KEY]=QString(); attributes[Attributes::PARTITION_BOUND_EXPR]=part_bounding_expr; @@ -1886,7 +1886,7 @@ QString Table::getAlterDefinition(BaseObject *object) if(this->getName()==tab->getName()) { - attribs[Attributes::HAS_CHANGES]=Attributes::True; + attribs[Attributes::HasChanges]=Attributes::True; if(this->with_oid!=tab->with_oid) attribs[Attributes::OIDS]=(tab->with_oid ? Attributes::True : Attributes::UNSET); diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index 3a8a76745a..b6a28a97a6 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -27,7 +27,7 @@ Textbox::Textbox(void) attributes[Attributes::Bold]=QString(); attributes[Attributes::UNDERLINE]=QString(); attributes[Attributes::Color]=QString(); - attributes[Attributes::FONT_SIZE]=QString(); + attributes[Attributes::FontSize]=QString(); } QString Textbox::getCodeDefinition(unsigned def_type) @@ -54,7 +54,7 @@ QString Textbox::getCodeDefinition(unsigned def_type) if(text_color.name()!=QString("#000000")) attributes[Attributes::Color]=text_color.name(); - attributes[Attributes::FONT_SIZE]=QString("%1").arg(font_size); + attributes[Attributes::FontSize]=QString("%1").arg(font_size); return(this->BaseObject::__getCodeDefinition(SchemaParser::XmlDefinition)); } diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 2078d98234..65a2f78687 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -37,7 +37,7 @@ Trigger::Trigger(void) attributes[Attributes::TRIGGER_FUNC]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::Columns]=QString(); - attributes[Attributes::FIRING_TYPE]=QString(); + attributes[Attributes::FiringType]=QString(); attributes[Attributes::PER_ROW]=QString(); attributes[Attributes::INS_EVENT]=QString(); attributes[Attributes::DelEvent]=QString(); @@ -409,7 +409,7 @@ QString Trigger::getCodeDefinition(unsigned def_type) attributes[Attributes::TABLE]=getParentTable()->getName(true); attributes[Attributes::Constraint]=(is_constraint ? Attributes::True : QString()); - attributes[Attributes::FIRING_TYPE]=(~firing_type); + attributes[Attributes::FiringType]=(~firing_type); //** Constraint trigger MUST execute per row ** attributes[Attributes::PER_ROW]=((is_exec_per_row && !is_constraint) || is_constraint ? Attributes::True : QString()); diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index acc454027a..9ac265ad2e 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -738,7 +738,7 @@ QString Type::getAlterDefinition(BaseObject *object) } attribs[Attributes::VALUE]=enum_val; - attribs[Attributes::EXISTING_VALUE]=prev_val; + attribs[Attributes::ExistingValue]=prev_val; copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); attribs.clear(); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 31b24c5e45..8d57a5ec60 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -25,7 +25,7 @@ View::View(void) : BaseTable() attributes[Attributes::Definition]=QString(); attributes[Attributes::REFERENCES]=QString(); attributes[Attributes::SELECT_EXP]=QString(); - attributes[Attributes::FROM_EXP]=QString(); + attributes[Attributes::FromExp]=QString(); attributes[Attributes::SIMPLE_EXP]=QString(); attributes[Attributes::EndExp]=QString(); attributes[Attributes::CteExpression]=QString(); @@ -481,7 +481,7 @@ void View::setReferencesAttribute(void) { QString str_aux; QString attribs[]={ Attributes::SELECT_EXP, - Attributes::FROM_EXP, + Attributes::FromExp, Attributes::SIMPLE_EXP, Attributes::EndExp}; vector *vect_exp[]={&exp_select, &exp_from, &exp_where, &exp_end}; @@ -579,7 +579,7 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::WITH_NO_DATA]=(with_no_data ? Attributes::True : QString()); attributes[Attributes::Columns]=QString(); attributes[Attributes::TAG]=QString(); - attributes[Attributes::HIDE_EXT_ATTRIBS]=(isExtAttribsHidden() ? Attributes::True : QString()); + attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); setSQLObjectAttribute(); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index a001fd1e1b..d4559403dc 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -25,7 +25,7 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid setupUi(this); QString conf_ids[]={ - Attributes::GLOBAL, //0 + Attributes::Global, //0 Attributes::Constraints, //1 Attributes::OBJ_SELECTION, //2 Attributes::POSITION_INFO, //3 @@ -64,8 +64,8 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::PROT_COLUMN, //34 Attributes::PK_COLUMN, //35 Attributes::PK_COLUMN, //36 - Attributes::FK_COLUMN, //37 - Attributes::FK_COLUMN, //38 + Attributes::FkColumn, //37 + Attributes::FkColumn, //38 Attributes::UQ_COLUMN, //39 Attributes::UQ_COLUMN, //40 Attributes::NN_COLUMN, //41 @@ -238,7 +238,7 @@ void AppearanceConfigWidget::loadConfiguration(void) } this->enableConfigElement(); - font_cmb->setCurrentFont(BaseObjectView::getFontStyle(Attributes::GLOBAL).font()); + font_cmb->setCurrentFont(BaseObjectView::getFontStyle(Attributes::Global).font()); model->setObjectsModified(); updatePlaceholderItem(); scene->update(); @@ -282,7 +282,7 @@ void AppearanceConfigWidget::saveConfiguration(void) attribs[attrib_id]=item.colors[2].name(); } //If the item is a font config - else if(item.conf_id!=Attributes::GLOBAL && !item.obj_conf) + else if(item.conf_id!=Attributes::Global && !item.obj_conf) { font=item.font_fmt.font(); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 8e0cc099ca..8fafb9f3f8 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -152,7 +152,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) conn->setAutoBrowseDB(itr->second[Attributes::AutoBrowseDb]==Attributes::True); conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(Attributes::Diff)]==Attributes::True); - conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(Attributes::EXPORT)]==Attributes::True); + conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(Attributes::Export)]==Attributes::True); conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(Attributes::IMPORT)]==Attributes::True); conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(Attributes::VALIDATION)]==Attributes::True); @@ -508,7 +508,7 @@ void ConnectionsConfigWidget::saveConfiguration(void) attribs[Attributes::AutoBrowseDb]=(conn->isAutoBrowseDB() ? Attributes::True : QString()); attribs[Attributes::ConnectionTimeout]=attribs[Connection::ParamConnTimeout]; - attribs[DefaultFor.arg(Attributes::EXPORT)]=(conn->isDefaultForOperation(Connection::OpExport) ? Attributes::True : QString()); + attribs[DefaultFor.arg(Attributes::Export)]=(conn->isDefaultForOperation(Connection::OpExport) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::Diff)]=(conn->isDefaultForOperation(Connection::OpDiff) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? Attributes::True : QString()); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 1785dd423b..90423e0021 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -49,11 +49,11 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Directory, QT_TR_NOOP("Directory")}, {Attributes::DstEncoding, QT_TR_NOOP("Dest. encoding")}, {Attributes::Element, QT_TR_NOOP("Element")}, {Attributes::Encoding, QT_TR_NOOP("Encoding")}, {Attributes::Encrypted, QT_TR_NOOP("Encrypted")}, {Attributes::Enumerations, QT_TR_NOOP("Enumerations")}, - {Attributes::EXECUTION_COST, QT_TR_NOOP("Exec. cost")}, {Attributes::EXPRESSION, QT_TR_NOOP("Expression")}, - {Attributes::FAMILY, QT_TR_NOOP("Op. family")}, {Attributes::FINAL_FUNC, QT_TR_NOOP("Final func.")}, - {Attributes::FUNCTION, QT_TR_NOOP("Function")}, {Attributes::FUNCTION_TYPE, QT_TR_NOOP("Func. type")}, - {Attributes::HANDLER_FUNC, QT_TR_NOOP("Handler func.")}, {Attributes::HANDLES_TYPE, QT_TR_NOOP("Handles type")}, - {Attributes::HASHES, QT_TR_NOOP("Hashes")}, {Attributes::INDEX_TYPE, QT_TR_NOOP("Index type")}, + {Attributes::ExecutionCost, QT_TR_NOOP("Exec. cost")}, {Attributes::Expression, QT_TR_NOOP("Expression")}, + {Attributes::Family, QT_TR_NOOP("Op. family")}, {Attributes::FinalFunc, QT_TR_NOOP("Final func.")}, + {Attributes::Function, QT_TR_NOOP("Function")}, {Attributes::FunctionType, QT_TR_NOOP("Func. type")}, + {Attributes::HandlerFunc, QT_TR_NOOP("Handler func.")}, {Attributes::HandlesType, QT_TR_NOOP("Handles type")}, + {Attributes::Hashes, QT_TR_NOOP("Hashes")}, {Attributes::INDEX_TYPE, QT_TR_NOOP("Index type")}, {Attributes::INHERIT, QT_TR_NOOP("Inherit")}, {Attributes::INITIAL_COND, QT_TR_NOOP("Ini. condition")}, {Attributes::INLINE_FUNC, QT_TR_NOOP("Inline func.")}, {Attributes::INPUT_FUNC, QT_TR_NOOP("Input func.")}, {Attributes::INTERNAL_LENGTH, QT_TR_NOOP("Internal length")}, {Attributes::INTERVAL_TYPE, QT_TR_NOOP("Interval type")}, @@ -94,17 +94,17 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::LAST_VALUE, QT_TR_NOOP("Last value")}, {Attributes::SUBTYPE, QT_TR_NOOP("Subtype")}, {Attributes::OP_CLASS, QT_TR_NOOP("Op. class")}, {Attributes::CanonicalFunc, QT_TR_NOOP("Canonical func.")}, {Attributes::SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {Attributes::Deferrable, QT_TR_NOOP("Deferrable")}, - {Attributes::PER_ROW, QT_TR_NOOP("For each row")}, {Attributes::FIRING_TYPE, QT_TR_NOOP("Firing")}, + {Attributes::PER_ROW, QT_TR_NOOP("For each row")}, {Attributes::FiringType, QT_TR_NOOP("Firing")}, {Attributes::INS_EVENT, QT_TR_NOOP("On insert")}, {Attributes::DelEvent, QT_TR_NOOP("On delete")}, {Attributes::UPD_EVENT, QT_TR_NOOP("On update")}, {Attributes::TRUNC_EVENT, QT_TR_NOOP("On truncate")}, {Attributes::Arguments, QT_TR_NOOP("Arguments")}, {Attributes::TABLE, QT_TR_NOOP("Table")}, {Attributes::TRIGGER_FUNC, QT_TR_NOOP("Trigger func.")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::Condition, QT_TR_NOOP("Condition")}, {Attributes::DeferType, QT_TR_NOOP("Deferment")}, - {Attributes::EventType, QT_TR_NOOP("Event")}, {Attributes::EXEC_TYPE, QT_TR_NOOP("Execution mode")}, + {Attributes::EventType, QT_TR_NOOP("Event")}, {Attributes::ExecType, QT_TR_NOOP("Execution mode")}, {Attributes::Commands, QT_TR_NOOP("Commands")}, {Attributes::POSITION, QT_TR_NOOP("Position")}, {Attributes::ComparisonType, QT_TR_NOOP("Comparison type")}, {Attributes::DelAction, QT_TR_NOOP("On delete")}, - {Attributes::DstColumns, QT_TR_NOOP("Ref. columns")}, {Attributes::EXPRESSIONS, QT_TR_NOOP("Expressions")}, - {Attributes::FACTOR, QT_TR_NOOP("Fill factor")}, {Attributes::NO_INHERIT, QT_TR_NOOP("No inherit")}, + {Attributes::DstColumns, QT_TR_NOOP("Ref. columns")}, {Attributes::Expressions, QT_TR_NOOP("Expressions")}, + {Attributes::Factor, QT_TR_NOOP("Fill factor")}, {Attributes::NO_INHERIT, QT_TR_NOOP("No inherit")}, {Attributes::OP_CLASSES, QT_TR_NOOP("Op. classes")}, {Attributes::OPERATORS, QT_TR_NOOP("Operators")}, {Attributes::REF_TABLE, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SRC_COLUMNS, QT_TR_NOOP("Columns")}, @@ -112,7 +112,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Collations, QT_TR_NOOP("Collations")}, {Attributes::INHERITED, QT_TR_NOOP("Inherited")}, {Attributes::ClientEncoding, QT_TR_NOOP("Client encoding")}, {Attributes::ConfigFile, QT_TR_NOOP("Configuration file")}, {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DynamicLibraryPath, QT_TR_NOOP("Dynamic library path")}, - {Attributes::DynamicSharedMemory, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HBA_FILE, QT_TR_NOOP("Hba file")}, + {Attributes::DynamicSharedMemory, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HbaFile, QT_TR_NOOP("Hba file")}, {Attributes::LISTEN_ADDRESSES, QT_TR_NOOP("Listen addresses")}, {Attributes::MAX_CONNECTIONS, QT_TR_NOOP("Max. connections")}, {Attributes::PORT, QT_TR_NOOP("Listen port")}, {Attributes::SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, {Attributes::SSL, QT_TR_NOOP("SSL")}, {Attributes::SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, @@ -441,18 +441,18 @@ void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) formatOidAttribs(attribs, { Attributes::DestType, Attributes::SOURCE_TYPE }, ObjectType::Type, false); - attribs[Attributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[Attributes::FUNCTION]); + attribs[Attributes::Function]=getObjectName(ObjectType::Function, attribs[Attributes::Function]); } void DatabaseExplorerWidget::formatEventTriggerAttribs(attribs_map &attribs) { attribs[Attributes::VALUES]=Catalog::parseArrayValues(attribs[Attributes::VALUES]).join(ElemSeparator); - attribs[Attributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[Attributes::FUNCTION]); + attribs[Attributes::Function]=getObjectName(ObjectType::Function, attribs[Attributes::Function]); } void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) { - formatOidAttribs(attribs, { Attributes::FINAL_FUNC, + formatOidAttribs(attribs, { Attributes::FinalFunc, Attributes::TRANSITION_FUNC }, ObjectType::Function, false); formatOidAttribs(attribs, { Attributes::TYPES }, ObjectType::Type, true); @@ -470,7 +470,7 @@ void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::TRUSTED }); formatOidAttribs(attribs, { Attributes::VALIDATOR_FUNC, - Attributes::HANDLER_FUNC, + Attributes::HandlerFunc, Attributes::INLINE_FUNC }, ObjectType::Function, false); } @@ -489,7 +489,7 @@ void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::Default }); - attribs[Attributes::FUNCTION]=getObjectName(ObjectType::Function, attribs[Attributes::FUNCTION]); + attribs[Attributes::Function]=getObjectName(ObjectType::Function, attribs[Attributes::Function]); } void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) @@ -500,7 +500,7 @@ void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { Attributes::HANDLES_TYPE }); + formatBooleanAttribs(attribs, { Attributes::HandlesType }); } void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) @@ -523,7 +523,7 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { Attributes::HASHES, + formatBooleanAttribs(attribs, { Attributes::Hashes, Attributes::MERGES }); formatOidAttribs(attribs, { Attributes::LEFT_TYPE, @@ -559,7 +559,7 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]), attribs[Attributes::NAME]).join(ElemSeparator)); - part_keys.push_back(Catalog::parseArrayValues(attribs[Attributes::EXPRESSIONS]).join(ElemSeparator)); + part_keys.push_back(Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator)); part_keys.removeAll(QString()); attribs[Attributes::PARTITION_KEY] = part_keys.join(ElemSeparator); @@ -672,12 +672,12 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) { QStringList list, array_vals, elems; - attribs[Attributes::FAMILY]=getObjectName(ObjectType::OpFamily, attribs[Attributes::FAMILY]); + attribs[Attributes::Family]=getObjectName(ObjectType::OpFamily, attribs[Attributes::Family]); formatBooleanAttribs(attribs, { Attributes::Default }); formatOidAttribs(attribs, { Attributes::STORAGE, Attributes::TYPE }, ObjectType::Type, false); - array_vals=Catalog::parseArrayValues(attribs[Attributes::FUNCTION]); + array_vals=Catalog::parseArrayValues(attribs[Attributes::Function]); if(!array_vals.isEmpty()) { @@ -687,7 +687,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) elems.push_back(QString("[%1] %2").arg(list[0], getObjectName(ObjectType::Function, list[1]))); } - attribs[Attributes::FUNCTION]=elems.join(ElemSeparator); + attribs[Attributes::Function]=elems.join(ElemSeparator); elems.clear(); } @@ -741,7 +741,7 @@ void DatabaseExplorerWidget::formatColumnAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) { map types={{Attributes::PK_CONSTR, ConstraintType(ConstraintType::PrimaryKey)}, - {Attributes::FK_CONSTR, ConstraintType(ConstraintType::ForeignKey)}, + {Attributes::FkConstr, ConstraintType(ConstraintType::ForeignKey)}, {Attributes::UQ_CONSTR, ConstraintType(ConstraintType::Unique)}, {Attributes::CkConstr, ConstraintType(ConstraintType::Check)}, {Attributes::ExConstr, ConstraintType(ConstraintType::Exclude)}}; @@ -781,18 +781,18 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) attribs.erase(Attributes::DeferType); } else - attribs.erase(Attributes::EXPRESSION); + attribs.erase(Attributes::Expression); if(constr_type==ConstraintType::Exclude) { - attribs[Attributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[Attributes::EXPRESSIONS]).join(ElemSeparator); + attribs[Attributes::Expressions]=Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator); attribs[Attributes::OPERATORS]=getObjectsNames(ObjectType::Operator, Catalog::parseArrayValues(attribs[Attributes::OPERATORS])).join(ElemSeparator); } else { attribs.erase(Attributes::Condition); - attribs.erase(Attributes::EXPRESSIONS); + attribs.erase(Attributes::Expressions); attribs.erase(Attributes::OPERATORS); } } @@ -806,7 +806,7 @@ void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::UNIQUE }); - attribs[Attributes::EXPRESSIONS]=Catalog::parseArrayValues(attribs[Attributes::EXPRESSIONS]).join(ElemSeparator); + attribs[Attributes::Expressions]=Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator); attribs[Attributes::Collations]=getObjectsNames(ObjectType::Collation, Catalog::parseArrayValues(attribs[Attributes::Collations])).join(ElemSeparator); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index f53b3038f8..0ab4bd6890 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -748,7 +748,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe { QTreeWidgetItem *group=nullptr, *item=nullptr; QFont grp_fnt=tree_wgt->font(); - attribs_map extra_attribs={{Attributes::FILTER_TABLE_TYPES, Attributes::True}}; + attribs_map extra_attribs={{Attributes::FilterTableTypes, Attributes::True}}; QString tooltip=QString("OID: %1"), name, label; bool child_checked=false; vector objects_vect; diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 91cf838c13..a6f5788da6 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -946,7 +946,7 @@ void DatabaseImportHelper::createSchema(attribs_map &attribs) try { attribs[Attributes::RECT_VISIBLE]=QString(); - attribs[Attributes::FILL_COLOR]=QColor(dist(rand_num_engine), + attribs[Attributes::FillColor]=QColor(dist(rand_num_engine), dist(rand_num_engine), dist(rand_num_engine)).name(); loadObjectXML(ObjectType::Schema, attribs); @@ -1010,7 +1010,7 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) expr = constr_attrs.at(1); expr.remove(0,1); expr.remove(expr.length() - 1,1); - aux_attribs[Attributes::EXPRESSION] = expr; + aux_attribs[Attributes::Expression] = expr; attribs[Attributes::Constraints]+= schparser.getCodeDefinition(Attributes::DomConstraint, aux_attribs, SchemaParser::XmlDefinition); } @@ -1183,7 +1183,7 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) { unsigned lang_oid, func_oid; QString func_types[]={ Attributes::VALIDATOR_FUNC, - Attributes::HANDLER_FUNC, + Attributes::HandlerFunc, Attributes::INLINE_FUNC }; lang_oid=attribs[Attributes::OID].toUInt(); @@ -1240,7 +1240,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) vector elems; QStringList array_vals, list; - attribs[Attributes::FAMILY]=getObjectName(attribs[Attributes::FAMILY], true); + attribs[Attributes::Family]=getObjectName(attribs[Attributes::Family], true); attribs[Attributes::TYPE]=getType(attribs[Attributes::TYPE], true, attribs); //Generating attributes for STORAGE elements @@ -1250,7 +1250,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) elem_attr[Attributes::Definition]=getType(attribs[Attributes::STORAGE], true); elems.push_back(elem_attr); } - else if(attribs[Attributes::FUNCTION].isEmpty() && + else if(attribs[Attributes::Function].isEmpty() && attribs[Attributes::OPERATOR].isEmpty()) { elem_attr[Attributes::STORAGE]=Attributes::True; @@ -1259,11 +1259,11 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) } //Generating attributes for FUNCTION elements - if(!attribs[Attributes::FUNCTION].isEmpty()) + if(!attribs[Attributes::Function].isEmpty()) { elem_attr.clear(); - elem_attr[Attributes::FUNCTION]=Attributes::True; - array_vals=Catalog::parseArrayValues(attribs[Attributes::FUNCTION]); + elem_attr[Attributes::Function]=Attributes::True; + array_vals=Catalog::parseArrayValues(attribs[Attributes::Function]); for(int i=0; i < array_vals.size(); i++) { @@ -1395,7 +1395,7 @@ void DatabaseImportHelper::createCast(attribs_map &attribs) try { - attribs[Attributes::FUNCTION]=getDependencyObject(attribs[Attributes::FUNCTION], ObjectType::Function, true); + attribs[Attributes::Function]=getDependencyObject(attribs[Attributes::Function], ObjectType::Function, true); attribs[Attributes::SOURCE_TYPE]=getType(attribs[Attributes::SOURCE_TYPE], true); attribs[Attributes::DestType]=getType(attribs[Attributes::DestType], true); loadObjectXML(ObjectType::Cast, attribs); @@ -1416,7 +1416,7 @@ void DatabaseImportHelper::createConversion(attribs_map &attribs) try { - attribs[Attributes::FUNCTION]=getDependencyObject(attribs[Attributes::FUNCTION], ObjectType::Function, true, auto_resolve_deps); + attribs[Attributes::Function]=getDependencyObject(attribs[Attributes::Function], ObjectType::Function, true, auto_resolve_deps); loadObjectXML(ObjectType::Conversion, attribs); conv=dbmodel->createConversion(); dbmodel->addConversion(conv); @@ -1502,7 +1502,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) { QStringList types; QString func_types[]={ Attributes::TRANSITION_FUNC, - Attributes::FINAL_FUNC }, + Attributes::FinalFunc }, sch_name; for(unsigned i=0; i < 2; i++) @@ -2010,7 +2010,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) QString tab_name, coll_name, opc_name; int i; - attribs[Attributes::FACTOR]=QString("90"); + attribs[Attributes::Factor]=QString("90"); tab_name=getDependencyObject(attribs[Attributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::Table)); @@ -2029,7 +2029,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) cols=Catalog::parseArrayValues(attribs[Attributes::Columns]); collations=Catalog::parseArrayValues(attribs[Attributes::Collations]); opclasses=Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES]); - exprs = parseIndexExpressions(attribs[Attributes::EXPRESSIONS]); + exprs = parseIndexExpressions(attribs[Attributes::Expressions]); for(i=0; i < cols.size(); i++) { @@ -2097,13 +2097,13 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) //If the table oid is 0 indicates that the constraint is part of a data type like domains if(!table_oid.isEmpty() && table_oid!=QString("0")) { - QStringList factor=Catalog::parseArrayValues(attribs[Attributes::FACTOR]); + QStringList factor=Catalog::parseArrayValues(attribs[Attributes::Factor]); //Retrieving the table is it was not imported yet and auto_resolve_deps is true tab_name=getDependencyObject(table_oid, ObjectType::Table, true, auto_resolve_deps, false); if(!factor.isEmpty() && factor[0].startsWith(QString("fillfactor="))) - attribs[Attributes::FACTOR]=factor[0].remove(QString("fillfactor=")); + attribs[Attributes::Factor]=factor[0].remove(QString("fillfactor=")); attribs[attribs[Attributes::TYPE]]=Attributes::True; table=dynamic_cast
(dbmodel->getObject(tab_name, ObjectType::Table)); @@ -2117,7 +2117,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) Operator *oper=nullptr; attribs[Attributes::SRC_COLUMNS]=QString(); - attribs[Attributes::EXPRESSION]=attribs[Attributes::Condition]; + attribs[Attributes::Expression]=attribs[Attributes::Condition]; cols=Catalog::parseArrayValues(attribs[Attributes::Columns]); opers=Catalog::parseArrayValues(attribs[Attributes::OPERATORS]); @@ -2129,7 +2129,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) * which we work to separate column only references from complex expression. Only complex expression will be used * and assigned to their exclude constraint elements. Column references are used in exclude elements but relying in * the cols list above */ - exprs=attribs[Attributes::EXPRESSIONS] + exprs=attribs[Attributes::Expressions] .replace(QString("EXCLUDE USING %1 (").arg(attribs[Attributes::INDEX_TYPE]), QString()) .split(QRegExp("(WITH )(\\+|\\-|\\*|\\/|\\<|\\>|\\=|\\~|\\!|\\@|\\#|\\%|\\^|\\&|\\||\\'|\\?)+((,)?|(\\))?)"), QString::SkipEmptyParts); @@ -2169,7 +2169,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) else { //Clears the tablespace attribute when the constraint is fk avoiding errors - if(attribs[Attributes::TYPE]==Attributes::FK_CONSTR) + if(attribs[Attributes::TYPE]==Attributes::FkConstr) attribs[Attributes::TABLESPACE]=QString(); attribs[Attributes::SRC_COLUMNS]=getColumnNames(attribs[Attributes::TABLE], attribs[Attributes::SRC_COLUMNS]).join(','); @@ -2216,9 +2216,9 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) { try { - attribs[Attributes::FUNCTION]=getDependencyObject(attribs[Attributes::FUNCTION], ObjectType::Function, true, true); - attribs[Attributes::FILTER]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") - .arg(Attributes::FILTER) + attribs[Attributes::Function]=getDependencyObject(attribs[Attributes::Function], ObjectType::Function, true, true); + attribs[Attributes::Filter]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") + .arg(Attributes::Filter) .arg(Attributes::VARIABLE).arg(Attributes::TAG.toUpper()) .arg(Attributes::VALUES) .arg(Catalog::parseArrayValues(attribs[Attributes::VALUES].remove('"')).join(',')); diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index ed56753300..becabee1cd 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -92,7 +92,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa connect(save_restore_geometry_chk, SIGNAL(toggled(bool)), reset_sizes_tb, SLOT(setEnabled(bool))); connect(reset_sizes_tb, SIGNAL(clicked(bool)), this, SLOT(resetDialogsSizes())); - config_params[Attributes::Configuration][Attributes::GRID_SIZE]=QString(); + config_params[Attributes::Configuration][Attributes::GridSize]=QString(); config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]=QString(); config_params[Attributes::Configuration][Attributes::AutoSaveInterval]=QString(); config_params[Attributes::Configuration][Attributes::PAPER_TYPE]=QString(); @@ -103,10 +103,10 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]=QString(); config_params[Attributes::Configuration][Attributes::PRINT_GRID]=QString(); - config_params[Attributes::Configuration][Attributes::HIDE_REL_NAME]=QString(); - config_params[Attributes::Configuration][Attributes::HIDE_EXT_ATTRIBS]=QString(); - config_params[Attributes::Configuration][Attributes::HIDE_TABLE_TAGS]=QString(); - config_params[Attributes::Configuration][Attributes::FILE_ASSOCIATED]=QString(); + config_params[Attributes::Configuration][Attributes::HideRelName]=QString(); + config_params[Attributes::Configuration][Attributes::HideExtAttribs]=QString(); + config_params[Attributes::Configuration][Attributes::HideTableTags]=QString(); + config_params[Attributes::Configuration][Attributes::FileAssociated]=QString(); config_params[Attributes::Configuration][Attributes::CodeFont]=QString(); config_params[Attributes::Configuration][Attributes::CodeFontSize]=QString(); config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=QString(); @@ -123,7 +123,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]=QString(); config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]=QString(); config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]=QString(); - config_params[Attributes::Configuration][Attributes::HIGHLIGHT_LINES]=QString(); + config_params[Attributes::Configuration][Attributes::HighlightLines]=QString(); config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=QString(); config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY]=QString(); config_params[Attributes::Configuration][Attributes::HISTORY_MAX_LENGTH]=QString(); @@ -271,7 +271,7 @@ void GeneralConfigWidget::loadConfiguration(void) key_attribs.push_back(Attributes::ID); BaseConfigWidget::loadConfiguration(GlobalAttributes::GeneralConf, config_params, key_attribs); - grid_size_spb->setValue((config_params[Attributes::Configuration][Attributes::GRID_SIZE]).toUInt()); + grid_size_spb->setValue((config_params[Attributes::Configuration][Attributes::GridSize]).toUInt()); oplist_size_spb->setValue((config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]).toUInt()); history_max_length_spb->setValue(config_params[Attributes::Configuration][Attributes::HISTORY_MAX_LENGTH].toUInt()); @@ -317,14 +317,14 @@ void GeneralConfigWidget::loadConfiguration(void) width_spb->setValue((custom_size.count() >= 2 ? custom_size[0].toDouble() : 500)); height_spb->setValue((custom_size.count() >= 2 ? custom_size[1].toDouble() : 500)); - hide_ext_attribs_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIDE_EXT_ATTRIBS]==Attributes::True); - hide_rel_name_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIDE_REL_NAME]==Attributes::True); - hide_table_tags_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIDE_TABLE_TAGS]==Attributes::True); + hide_ext_attribs_chk->setChecked(config_params[Attributes::Configuration][Attributes::HideExtAttribs]==Attributes::True); + hide_rel_name_chk->setChecked(config_params[Attributes::Configuration][Attributes::HideRelName]==Attributes::True); + hide_table_tags_chk->setChecked(config_params[Attributes::Configuration][Attributes::HideTableTags]==Attributes::True); font_cmb->setCurrentFont(QFont(config_params[Attributes::Configuration][Attributes::CodeFont])); font_size_spb->setValue(config_params[Attributes::Configuration][Attributes::CodeFontSize].toDouble()); disp_line_numbers_chk->setChecked(config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]==Attributes::True); - hightlight_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::HIGHLIGHT_LINES]==Attributes::True); + hightlight_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::HighlightLines]==Attributes::True); line_numbers_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]); line_numbers_bg_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]); line_highlight_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]); @@ -349,7 +349,7 @@ void GeneralConfigWidget::loadConfiguration(void) x = itr.second[Attributes::X_POS].toInt(); y = itr.second[Attributes::Y_POS].toInt(); w = itr.second[Attributes::WIDTH].toInt(); - h = itr.second[Attributes::HEIGHT].toInt(); + h = itr.second[Attributes::Height].toInt(); widgets_geom[itr.first].geometry = QRect(QPoint(x,y), QSize(w, h)); widgets_geom[itr.first].maximized = itr.second[Attributes::MAXIMIZED] == Attributes::True; } @@ -466,7 +466,7 @@ void GeneralConfigWidget::saveConfiguration(void) Attributes::WIDGET + GlobalAttributes::SchemaExt; - config_params[Attributes::Configuration][Attributes::GRID_SIZE]=QString::number(grid_size_spb->value()); + config_params[Attributes::Configuration][Attributes::GridSize]=QString::number(grid_size_spb->value()); config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]=QString::number(oplist_size_spb->value()); config_params[Attributes::Configuration][Attributes::AutoSaveInterval]=QString::number(autosave_interv_chk->isChecked() ? autosave_interv_spb->value() : 0); config_params[Attributes::Configuration][Attributes::PAPER_TYPE]=QString::number(paper_cmb->currentIndex()); @@ -504,14 +504,14 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]=(print_pg_num_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::PRINT_GRID]=(print_grid_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::HIDE_EXT_ATTRIBS]=(hide_ext_attribs_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::HIDE_REL_NAME]=(hide_rel_name_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::HIDE_TABLE_TAGS]=(hide_table_tags_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HideExtAttribs]=(hide_ext_attribs_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HideRelName]=(hide_rel_name_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HideTableTags]=(hide_table_tags_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CodeFont]=font_cmb->currentText(); config_params[Attributes::Configuration][Attributes::CodeFontSize]=QString::number(font_size_spb->value()); config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]=(disp_line_numbers_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::HIGHLIGHT_LINES]=(hightlight_lines_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::HighlightLines]=(hightlight_lines_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]=line_numbers_cp->getColor(0).name(); config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]=line_numbers_bg_cp->getColor(0).name(); config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]=line_highlight_cp->getColor(0).name(); @@ -571,7 +571,7 @@ void GeneralConfigWidget::saveConfiguration(void) attribs[Attributes::X_POS] = QString::number(itr.second.geometry.left()); attribs[Attributes::Y_POS] = QString::number(itr.second.geometry.top()); attribs[Attributes::WIDTH] = QString::number(itr.second.geometry.width()); - attribs[Attributes::HEIGHT] = QString::number(itr.second.geometry.height()); + attribs[Attributes::Height] = QString::number(itr.second.geometry.height()); attribs[Attributes::MAXIMIZED] = itr.second.maximized ? Attributes::True : QString(); schparser.ignoreUnkownAttributes(true); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index da00fd2c70..74c4740711 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1840,7 +1840,7 @@ void MainWindow::storeDockWidgetsSettings(void) params[Attributes::OBJECT_FINDER]=Attributes::True; params[Attributes::SELECT_OBJECTS]=(obj_finder_wgt->select_btn->isChecked() ? Attributes::True : QString()); - params[Attributes::FADEIN_OBJECTS]=(obj_finder_wgt->fade_btn->isChecked() ? Attributes::True : QString()); + params[Attributes::FadeInObjects]=(obj_finder_wgt->fade_btn->isChecked() ? Attributes::True : QString()); params[Attributes::REGULAR_EXP]=(obj_finder_wgt->regexp_chk->isChecked() ? Attributes::True : QString()); params[Attributes::CaseSensitive]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? Attributes::True : QString()); params[Attributes::ExactMatch]=(obj_finder_wgt->exact_match_chk->isChecked() ? Attributes::True : QString()); @@ -1869,7 +1869,7 @@ void MainWindow::restoreDockWidgetsSettings(void) if(confs.count(Attributes::OBJECT_FINDER)) { obj_finder_wgt->select_btn->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::SELECT_OBJECTS]==Attributes::True); - obj_finder_wgt->fade_btn->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::FADEIN_OBJECTS]==Attributes::True); + obj_finder_wgt->fade_btn->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::FadeInObjects]==Attributes::True); obj_finder_wgt->regexp_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::REGULAR_EXP]==Attributes::True); obj_finder_wgt->case_sensitive_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::CaseSensitive]==Attributes::True); obj_finder_wgt->exact_match_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::ExactMatch]==Attributes::True); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index e4efee3e9d..b629e5c98d 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -465,7 +465,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) //The import process will exclude built-in array array types, system and extension objects catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); - catalog.getObjectsOIDs(obj_oids, col_oids, {{Attributes::FILTER_TABLE_TYPES, Attributes::True}}); + catalog.getObjectsOIDs(obj_oids, col_oids, {{Attributes::FilterTableTypes, Attributes::True}}); obj_oids[ObjectType::Database].push_back(db_cmb->currentData().value()); if(thread_id == SrcImportThread) diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 4e864e762a..a7fd0bccac 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -290,7 +290,7 @@ void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename //Forcing the usage of the font settings defined for BaseObjectView and its subclasses svg_def.replace(font_attr.arg(scene->font().family()), - font_attr.arg(BaseObjectView::getFontStyle(Attributes::GLOBAL).font().family())); + font_attr.arg(BaseObjectView::getFontStyle(Attributes::Global).font().family())); /* Removing the empty (transparent) backgound object in order to save some space in the file if the grid or delimiter is displayed */ diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 9d7f2c8d0c..e3c1816a53 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -323,9 +323,9 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) Attributes::PROTECTED, Attributes::SQL_DISABLED, Attributes::RECT_VISIBLE, - Attributes::FILL_COLOR, - Attributes::FADED_OUT, - Attributes::HIDE_EXT_ATTRIBS}, + Attributes::FillColor, + Attributes::FadedOut, + Attributes::HideExtAttribs}, { Attributes::ROLE, Attributes::TABLESPACE, Attributes::Collation, @@ -869,7 +869,7 @@ void ModelsDiffHelper::processDiffInfos(void) has_diffs=(create_objs_count!=0 || alter_objs.size()!=0 || drop_objs.size()!=0); //Attributes used on the diff schema file - attribs[Attributes::HAS_CHANGES]=Attributes::True; + attribs[Attributes::HasChanges]=Attributes::True; attribs[Attributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; attribs[Attributes::DbModel]=source_model->getName(); attribs[Attributes::Database]=imported_model->getName(); @@ -884,10 +884,10 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[Attributes::CreateCmds]=QString(); attribs[Attributes::TRUNCATE_CMDS]=QString(); attribs[Attributes::ConstrDefs]=QString(); - attribs[Attributes::FK_DEFS]=QString(); + attribs[Attributes::FkDefs]=QString(); attribs[Attributes::UNSET_PERMS]=unset_perms; attribs[Attributes::SET_PERMS]=set_perms; - attribs[Attributes::FUNCTION]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? Attributes::True : QString()); + attribs[Attributes::Function]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? Attributes::True : QString()); attribs[Attributes::SEARCH_PATH]=(has_diffs ? sch_names.join(',') : QString()); ritr=drop_objs.rbegin(); @@ -913,7 +913,7 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[Attributes::ConstrDefs]+=itr.second; for(auto &itr : create_fks) - attribs[Attributes::FK_DEFS]+=itr.second; + attribs[Attributes::FkDefs]+=itr.second; for(auto &itr : truncate_tabs) attribs[Attributes::TRUNCATE_CMDS]+=itr.second; diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index f0469fc2c4..9fe537b150 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -29,7 +29,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, - Attributes::EXECUTE_PRIV, Attributes::USAGE_PRIV }; + Attributes::ExecutPriv, Attributes::USAGE_PRIV }; Ui_PermissionWidget::setupUi(this); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 5b8aab333e..91be7f1cc4 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -103,13 +103,13 @@ void RelationshipConfigWidget::loadConfiguration(void) tab_edges_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::ConnectTableEdges); crows_foot_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::CrowsFoot); - deferrable_chk->setChecked(config_params[Attributes::FOREIGN_KEYS][Attributes::Deferrable]==Attributes::True); - deferral_cmb->setCurrentText(config_params[Attributes::FOREIGN_KEYS][Attributes::DeferType]); + deferrable_chk->setChecked(config_params[Attributes::ForeignKeys][Attributes::Deferrable]==Attributes::True); + deferral_cmb->setCurrentText(config_params[Attributes::ForeignKeys][Attributes::DeferType]); - idx=upd_action_cmb->findText(config_params[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]); + idx=upd_action_cmb->findText(config_params[Attributes::ForeignKeys][Attributes::UPD_ACTION]); upd_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); - idx=del_action_cmb->findText(config_params[Attributes::FOREIGN_KEYS][Attributes::DelAction]); + idx=del_action_cmb->findText(config_params[Attributes::ForeignKeys][Attributes::DelAction]); del_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); patterns[Attributes::RELATIONSHIP_11]=config_params[Attributes::RELATIONSHIP_11]; @@ -153,10 +153,10 @@ void RelationshipConfigWidget::saveConfiguration(void) else config_params[Attributes::Connection][Attributes::MODE]=Attributes::ConnectCenterPnts; - config_params[Attributes::FOREIGN_KEYS][Attributes::Deferrable]=(deferrable_chk->isChecked() ? Attributes::True : Attributes::False); - config_params[Attributes::FOREIGN_KEYS][Attributes::DeferType]=deferral_cmb->currentText(); - config_params[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); - config_params[Attributes::FOREIGN_KEYS][Attributes::DelAction]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); + config_params[Attributes::ForeignKeys][Attributes::Deferrable]=(deferrable_chk->isChecked() ? Attributes::True : Attributes::False); + config_params[Attributes::ForeignKeys][Attributes::DeferType]=deferral_cmb->currentText(); + config_params[Attributes::ForeignKeys][Attributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); + config_params[Attributes::ForeignKeys][Attributes::DelAction]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); config_params[Attributes::NAME_PATTERNS][Attributes::PATTERNS]=QString(); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 25d78cdc4f..b2fd8d3764 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -478,10 +478,10 @@ void RelationshipWidget::useFKGlobalSettings(bool value) if(value) { map confs=RelationshipConfigWidget::getConfigurationParams(); - deferrable_chk->setChecked(confs[Attributes::FOREIGN_KEYS][Attributes::Deferrable]==Attributes::True); - deferral_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::DeferType]); - upd_action_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::UPD_ACTION]); - del_action_cmb->setCurrentText(confs[Attributes::FOREIGN_KEYS][Attributes::DelAction]); + deferrable_chk->setChecked(confs[Attributes::ForeignKeys][Attributes::Deferrable]==Attributes::True); + deferral_cmb->setCurrentText(confs[Attributes::ForeignKeys][Attributes::DeferType]); + upd_action_cmb->setCurrentText(confs[Attributes::ForeignKeys][Attributes::UPD_ACTION]); + del_action_cmb->setCurrentText(confs[Attributes::ForeignKeys][Attributes::DelAction]); } else { diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 33ba15f9e8..f1ac770d6d 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -107,7 +107,7 @@ QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) { QStringList ids; QString type_name=(obj_type==ObjectType::BaseObject ? - Attributes::GENERAL : BaseObject::getSchemaName(obj_type)); + Attributes::General : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) { @@ -122,7 +122,7 @@ vector SnippetsConfigWidget::getSnippetsByObject(ObjectType obj_typ { vector snippets; QString type_name=(obj_type==ObjectType::BaseObject ? - Attributes::GENERAL : BaseObject::getSchemaName(obj_type)); + Attributes::General : BaseObject::getSchemaName(obj_type)); for(auto &snip : config_params) { @@ -306,7 +306,7 @@ attribs_map SnippetsConfigWidget::getSnippetAttributes(void) QString object_id=BaseObject::getSchemaName(static_cast(applies_to_cmb->currentData().toUInt())); if(object_id.isEmpty()) - object_id=Attributes::GENERAL; + object_id=Attributes::General; return(attribs_map{ {Attributes::ID, id_edt->text()}, {Attributes::LABEL, label_edt->text()}, @@ -414,7 +414,7 @@ void SnippetsConfigWidget::filterSnippets(int idx) QString object_id=BaseObject::getSchemaName(obj_type); if(object_id.isEmpty()) - object_id=Attributes::GENERAL; + object_id=Attributes::General; for(auto &cfg : config_params) { @@ -543,7 +543,7 @@ void SnippetsConfigWidget::configureSnippetsMenu(QMenu *snip_menu, vectoraddMenu(menu); } @@ -554,14 +554,14 @@ void SnippetsConfigWidget::configureSnippetsMenu(QMenu *snip_menu, vectorisEmpty()) - snip_menu->addMenu(submenus[Attributes::GENERAL]); + snip_menu->addMenu(submenus[Attributes::General]); else { //Inserting the "general" submenu at the top of snippets actions - snip_menu->insertMenu(snip_menu->actions().at(0), submenus[Attributes::GENERAL]); + snip_menu->insertMenu(snip_menu->actions().at(0), submenus[Attributes::General]); snip_menu->insertSeparator(snip_menu->actions().at(1)); } } diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 62fa205704..92cd421163 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -427,7 +427,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) elem=xmlparser.getElementName(); } - if(elem==Attributes::GROUP) + if(elem==Attributes::Group) { xmlparser.getElementAttributes(attribs); group=attribs[Attributes::NAME]; @@ -480,7 +480,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) bold=(attribs[Attributes::Bold]==Attributes::True); underline=(attribs[Attributes::UNDERLINE]==Attributes::True); partial_match=(attribs[Attributes::PARTIAL_MATCH]==Attributes::True); - fg_color.setNamedColor(attribs[Attributes::FOREGROUND_COLOR]); + fg_color.setNamedColor(attribs[Attributes::ForegroundColor]); //If the attribute isn't defined the bg color will be transparent if(attribs[Attributes::BackgroundColor].isEmpty()) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index d07e88b425..16e9c928da 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1084,7 +1084,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Replace the constraint attribute and tag expression by constraint tag in . if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Domain))) && - obj_xml.contains(TagExpr.arg(Attributes::EXPRESSION))) + obj_xml.contains(TagExpr.arg(Attributes::Expression))) { int start_idx=-1, end_idx=-1; QRegExp regexp = QRegExp(AttributeExpr.arg(Attributes::Constraint)); @@ -1097,11 +1097,11 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.remove(QRegExp(AttributeExpr.arg(Attributes::Constraint))); - start_idx = obj_xml.indexOf(TagExpr.arg(Attributes::EXPRESSION)); + start_idx = obj_xml.indexOf(TagExpr.arg(Attributes::Expression)); obj_xml.insert(start_idx, QString("\n\t\n\t\t").arg(constr_name)); - end_idx = obj_xml.indexOf(EndTagExpr.arg(Attributes::EXPRESSION)); - obj_xml.insert(end_idx + EndTagExpr.arg(Attributes::EXPRESSION).length() + 1, QString("\n\t\n")); + end_idx = obj_xml.indexOf(EndTagExpr.arg(Attributes::Expression)); + obj_xml.insert(end_idx + EndTagExpr.arg(Attributes::Expression).length() + 1, QString("\n\t\n")); } //Fix the references to op. classes and families if needed @@ -1276,7 +1276,7 @@ void PgModelerCli::importDatabase(DatabaseModel *model, Connection conn) catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); - catalog.getObjectsOIDs(obj_oids, col_oids, {{Attributes::FILTER_TABLE_TYPES, Attributes::True}}); + catalog.getObjectsOIDs(obj_oids, col_oids, {{Attributes::FilterTableTypes, Attributes::True}}); db_oid = catalog.getObjectOID(conn.getConnectionParam(Connection::ParamDbName), ObjectType::Database); obj_oids[ObjectType::Database].push_back(db_oid.toUInt()); @@ -1472,7 +1472,7 @@ QStringList PgModelerCli::extractForeignKeys(QString &obj_xml) count=(end - start) + end_tag.size() + 1; constr=obj_xml.mid(start, count); - if(constr.contains(Attributes::FK_CONSTR)) + if(constr.contains(Attributes::FkConstr)) { obj_xml.remove(start, count); constr_lst.push_back(constr); From 598f6eee95ab19a77eae02172cc59cd1fa43325c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 10:12:14 -0300 Subject: [PATCH 182/425] Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 10 +- libobjrenderer/src/relationshipview.cpp | 6 +- libobjrenderer/src/tableobjectview.cpp | 4 +- libparsers/src/attributes.cpp | 100 ++++++++-------- libparsers/src/attributes.h | 100 ++++++++-------- libpgconnector/src/catalog.cpp | 4 +- libpgmodeler/src/aggregate.cpp | 4 +- libpgmodeler/src/baserelationship.cpp | 8 +- libpgmodeler/src/cast.cpp | 6 +- libpgmodeler/src/column.cpp | 20 ++-- libpgmodeler/src/constraint.cpp | 4 +- libpgmodeler/src/databasemodel.cpp | 110 +++++++++--------- libpgmodeler/src/function.cpp | 16 +-- libpgmodeler/src/index.cpp | 4 +- libpgmodeler/src/indexelement.cpp | 2 +- libpgmodeler/src/language.cpp | 4 +- libpgmodeler/src/operator.cpp | 8 +- libpgmodeler/src/operatorclass.cpp | 4 +- libpgmodeler/src/operatorfamily.cpp | 4 +- libpgmodeler/src/permission.cpp | 2 +- libpgmodeler/src/pgsqltypes.cpp | 8 +- libpgmodeler/src/relationship.cpp | 8 +- libpgmodeler/src/role.cpp | 6 +- libpgmodeler/src/sequence.cpp | 6 +- libpgmodeler/src/table.cpp | 12 +- libpgmodeler/src/tag.cpp | 2 +- libpgmodeler/src/textbox.cpp | 4 +- libpgmodeler/src/trigger.cpp | 4 +- libpgmodeler/src/type.cpp | 16 +-- .../src/appearanceconfigwidget.cpp | 8 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 4 +- .../src/connectionsconfigwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 64 +++++----- libpgmodeler_ui/src/databaseimporthelper.cpp | 34 +++--- libpgmodeler_ui/src/generalconfigwidget.cpp | 20 ++-- libpgmodeler_ui/src/mainwindow.cpp | 4 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 2 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 2 +- libpgmodeler_ui/src/permissionwidget.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 20 ++-- libpgmodeler_ui/src/syntaxhighlighter.cpp | 12 +- main-cli/src/pgmodelercli.cpp | 8 +- 42 files changed, 335 insertions(+), 335 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 4f6a926404..a3e2d84863 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -237,18 +237,18 @@ void BaseObjectView::loadObjectsStyle(void) font.setFamily(attribs[Attributes::Font]); font.setPointSizeF(attribs[Attributes::SIZE].toDouble()); font.setBold(attribs[Attributes::Bold]==Attributes::True); - font.setItalic(attribs[Attributes::ITALIC]==Attributes::True); + font.setItalic(attribs[Attributes::Italic]==Attributes::True); font.setUnderline(attribs[Attributes::UNDERLINE]==Attributes::True); font_fmt.setFont(font); font_config[Attributes::Global]=font_fmt; } else if(elem==Attributes::Font) { - font_config[attribs[Attributes::ID]]=font_fmt; - itr=font_config.find(attribs[Attributes::ID]); + font_config[attribs[Attributes::Id]]=font_fmt; + itr=font_config.find(attribs[Attributes::Id]); font=font_fmt.font(); font.setBold(attribs[Attributes::Bold]==Attributes::True); - font.setItalic(attribs[Attributes::ITALIC]==Attributes::True); + font.setItalic(attribs[Attributes::Italic]==Attributes::True); font.setUnderline(attribs[Attributes::UNDERLINE]==Attributes::True); (itr->second).setFont(font); (itr->second).setForeground(QColor(attribs[Attributes::Color])); @@ -262,7 +262,7 @@ void BaseObjectView::loadObjectsStyle(void) colors.push_back(list.size()==2 ? QColor(list[1]) : colors[0]); colors.push_back(QColor(attribs[Attributes::BorderColor])); - color_config[attribs[Attributes::ID]]=colors; + color_config[attribs[Attributes::Id]]=colors; } } } diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 0aca52eb3e..9a3d4bf3d0 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -2004,11 +2004,11 @@ void RelationshipView::configureLabelPosition(unsigned label_id, double x, doubl labels[label_id]->setPos(x,y); labels[label_id]->setToolTip(this->toolTip()); - char_fmt=BaseObjectView::getFontStyle(Attributes::LABEL); + char_fmt=BaseObjectView::getFontStyle(Attributes::Label); char_fmt.setFontPointSize(char_fmt.fontPointSize() * 0.90); labels[label_id]->setFontStyle(char_fmt); - labels[label_id]->setColorStyle(BaseObjectView::getFillStyle(Attributes::LABEL), - BaseObjectView::getBorderStyle(Attributes::LABEL)); + labels[label_id]->setColorStyle(BaseObjectView::getFillStyle(Attributes::Label), + BaseObjectView::getBorderStyle(Attributes::Label)); dynamic_cast(labels[label_id]->getSourceObject())->setModified(true); } } diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index eed93cc2a2..e609af5a4e 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -228,7 +228,7 @@ void TableObjectView::configureObject(void) fmt=font_config[Attributes::Column]; if(column->isAddedByRelationship()) - fmt=font_config[Attributes::INH_COLUMN]; + fmt=font_config[Attributes::InhColumn]; else if(column->isProtected()) fmt=font_config[Attributes::PROT_COLUMN]; @@ -250,7 +250,7 @@ void TableObjectView::configureObject(void) else { if(tab_obj->isAddedByRelationship()) - fmt=font_config[Attributes::INH_COLUMN]; + fmt=font_config[Attributes::InhColumn]; else if(tab_obj->isProtected()) fmt=font_config[Attributes::PROT_COLUMN]; else diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index d2ca35c47f..907f89ce0e 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -234,59 +234,59 @@ namespace Attributes { HideRelName=QString("hide-rel-name"), HideTableTags=QString("hide-table-tags"), HighlightLines=QString("highlight-lines"), - HIGHLIGHT_ORDER=QString("highlight-order"), - HISTORY_MAX_LENGTH=QString("history-max-length"), - ICON=QString("icon"), - ID=QString("id"), - IDENTIFIER=QString("identifier"), - IDENTITY_TYPE=QString("identity-type"), - IDENT_FILE=QString("ident-file"), - IGNORED_CHARS=QString("ignored-chars"), - IMPLICIT=QString("implicit"), - IMPORT=QString("import"), - INCREMENT=QString("increment"), - INDEX_ELEMENT=QString("idxelement"), - INDEX_TYPE=QString("index-type"), - INDEX=QString("index"), - INDEXES=QString("indexes"), - INFO=QString("info"), - INH_COLUMN=QString("inh-column"), - INH_COLUMNS=QString("inh-columns"), - INHERIT=QString("inherit"), - INHERITED=QString("inherited"), - INITIAL_COND=QString("initial-cond"), - INITIAL_DATA=QString("initial-data"), - INITIAL_EXP=QString("initial-exp"), - INLINE_FUNC=QString("inline"), - INPUT_FUNC=QString("input"), - INS_EVENT=QString("ins-event"), - INSERT_PRIV=QString("insert"), - INTERNAL_LENGTH=QString("internal-length"), - INTERVAL_TYPE=QString("interval-type"), - INVERT_RANGESEL_TRIGGER=QString("invert-rangesel-trigger"), - IS_TEMPLATE=QString("is-template"), - IS_PARTITIONED=QString("is-partitioned"), - IO_CAST=QString("io-cast"), - ITALIC=QString("italic"), - JOIN_FUNC=QString("join"), - LABEL=QString("label"), - LABELS_POS=QString("labels-pos"), - LANDSCAPE=QString("landscape"), - LANGUAGE=QString("language"), - LAST_POSITION=QString("last-position"), - LAST_SYS_OID=QString("last-sys-oid"), - LAST_VALUE=QString("last-value"), - LAST_ZOOM=QString("last-zoom"), + HighlightOrder=QString("highlight-order"), + HistoryMaxLength=QString("history-max-length"), + Icon=QString("icon"), + Id=QString("id"), + Identifier=QString("identifier"), + IdentityType=QString("identity-type"), + IdentFile=QString("ident-file"), + IgnoredChars=QString("ignored-chars"), + Implicit=QString("implicit"), + Import=QString("import"), + Increment=QString("increment"), + IndexElement=QString("idxelement"), + IndexType=QString("index-type"), + Index=QString("index"), + Indexes=QString("indexes"), + Info=QString("info"), + InhColumn=QString("inh-column"), + InhColumns=QString("inh-columns"), + Inherit=QString("inherit"), + Inherited=QString("inherited"), + InitialCond=QString("initial-cond"), + InitialData=QString("initial-data"), + InitialExp=QString("initial-exp"), + InlineFunc=QString("inline"), + InputFunc=QString("input"), + InsEvent=QString("ins-event"), + InsertPriv=QString("insert"), + InternalLength=QString("internal-length"), + IntervalType=QString("interval-type"), + InvertRangeSelTrigger=QString("invert-rangesel-trigger"), + IsTemplate=QString("is-template"), + IsPartitioned=QString("is-partitioned"), + IoCast=QString("io-cast"), + Italic=QString("italic"), + JoinFunc=QString("join"), + Label=QString("label"), + LabelsPos=QString("labels-pos"), + Landscape=QString("landscape"), + Language=QString("language"), + LastPosition=QString("last-position"), + LastSysOid=QString("last-sys-oid"), + LastValue=QString("last-value"), + LastZoom=QString("last-zoom"), LAST_ANALYZE=QString("last-analyze"), LAST_AUTOVACUUM=QString("last-autovacuum"), LAST_VACUUM=QString("last-vacuum"), - LEAKPROOF=QString("leakproof"), - LEFT_TYPE=QString("left-type"), - LEFT=QString("left"), - LENGTH=QString("length"), - LIBRARY=QString("library"), - LIKE_TYPE=QString("like-type"), - LINE=QString("line"), + LeakProof=QString("leakproof"), + LeftType=QString("left-type"), + Left=QString("left"), + Length=QString("length"), + Library=QString("library"), + LikeType=QString("like-type"), + Line=QString("line"), LINE_NUMBERS_COLOR=QString("line-numbers-color"), LINE_NUMBERS_BG_COLOR=QString("line-numbers-bg-color"), LINE_HIGHLIGHT_COLOR=QString("line-highlight-color"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 60bf161ecd..c4f5cb4521 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -249,56 +249,56 @@ namespace Attributes { HideRelName, HideTableTags, HighlightLines, - HIGHLIGHT_ORDER, - HISTORY_MAX_LENGTH, - ICON, - ID, - IDENTIFIER, - IDENTITY_TYPE, - IGNORED_CHARS, - IMPLICIT, - IMPORT, - INCREMENT, - IDENT_FILE, - INDEX_ELEMENT, - INDEX_TYPE, - INDEX, - INDEXES, - INFO, - INH_COLUMN, - INH_COLUMNS, - INHERIT, - INHERITED, - INITIAL_COND, - INITIAL_DATA, - INITIAL_EXP, - INLINE_FUNC, - INPUT_FUNC, - INS_EVENT, - INSERT_PRIV, - INTERNAL_LENGTH, - INTERVAL_TYPE, - INVERT_RANGESEL_TRIGGER, - IO_CAST, - IS_TEMPLATE, - IS_PARTITIONED, - ITALIC, - JOIN_FUNC, - LABEL, - LABELS_POS, - LANDSCAPE, - LANGUAGE, - LAST_POSITION, - LAST_SYS_OID, - LAST_VALUE, - LAST_ZOOM, - LEAKPROOF, - LEFT_TYPE, - LEFT, - LENGTH, - LIBRARY, - LIKE_TYPE, - LINE, + HighlightOrder, + HistoryMaxLength, + Icon, + Id, + Identifier, + IdentityType, + IgnoredChars, + Implicit, + Import, + Increment, + IdentFile, + IndexElement, + IndexType, + Index, + Indexes, + Info, + InhColumn, + InhColumns, + Inherit, + Inherited, + InitialCond, + InitialData, + InitialExp, + InlineFunc, + InputFunc, + InsEvent, + InsertPriv, + InternalLength, + IntervalType, + InvertRangeSelTrigger, + IoCast, + IsTemplate, + IsPartitioned, + Italic, + JoinFunc, + Label, + LabelsPos, + Landscape, + Language, + LastPosition, + LastSysOid, + LastValue, + LastZoom, + LeakProof, + LeftType, + Left, + Length, + Library, + LikeType, + Line, LINE_NUMBERS_COLOR, LINE_NUMBERS_BG_COLOR, LINE_HIGHLIGHT_COLOR, diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 4d29d2aa73..4135169234 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -90,7 +90,7 @@ void Catalog::setConnection(Connection &conn) if(res.accessTuple(ResultSet::FirstTuple)) { attribs_map attribs=changeAttributeNames(res.getTupleValues()); - last_sys_oid=attribs[Attributes::LAST_SYS_OID].toUInt(); + last_sys_oid=attribs[Attributes::LastSysOid].toUInt(); } //Retrieving the list of objects created by extensions @@ -190,7 +190,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b attribs[qry_type]=Attributes::True; if(exclude_sys_objs || list_only_sys_objs) - attribs[Attributes::LAST_SYS_OID]=QString("%1").arg(last_sys_oid); + attribs[Attributes::LastSysOid]=QString("%1").arg(last_sys_oid); if(list_only_sys_objs) attribs[Attributes::OID_FILTER_OP]=QString("<="); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 80d272c5ee..c20b279012 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -28,7 +28,7 @@ Aggregate::Aggregate(void) attributes[Attributes::STATE_TYPE]=QString(); attributes[Attributes::BaseType]=QString(); attributes[Attributes::FinalFunc]=QString(); - attributes[Attributes::INITIAL_COND]=QString(); + attributes[Attributes::InitialCond]=QString(); attributes[Attributes::SORT_OP]=QString(); } @@ -259,7 +259,7 @@ QString Aggregate::getCodeDefinition(unsigned def_type) } if(!initial_condition.isEmpty()) - attributes[Attributes::INITIAL_COND]=initial_condition; + attributes[Attributes::InitialCond]=initial_condition; if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::STATE_TYPE]=*(state_type); diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 7a65c539a0..eca042a671 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -86,7 +86,7 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::Columns]=QString(); attributes[Attributes::Constraints]=QString(); attributes[Attributes::Elements]=QString(); - attributes[Attributes::IDENTIFIER]=QString(); + attributes[Attributes::Identifier]=QString(); attributes[Attributes::REDUCED_FORM]=QString(); attributes[Attributes::Deferrable]=QString(); attributes[Attributes::DeferType]=QString(); @@ -362,11 +362,11 @@ void BaseRelationship::setRelationshipAttributes(void) attributes[Attributes::Y_POS]=QString("%1").arg(lables_dist[i].y()); attributes[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, attributes, SchemaParser::XmlDefinition); attributes[Attributes::REF_TYPE]=label_attribs[i]; - str_aux+=schparser.getCodeDefinition(Attributes::LABEL, attributes, SchemaParser::XmlDefinition); + str_aux+=schparser.getCodeDefinition(Attributes::Label, attributes, SchemaParser::XmlDefinition); } } - attributes[Attributes::LABELS_POS]=str_aux; + attributes[Attributes::LabelsPos]=str_aux; attributes[Attributes::CustomColor]=(custom_color!=Qt::transparent ? custom_color.name() : QString()); attributes[Attributes::REFERENCE_FK]=(reference_fk ? reference_fk->getName() : QString()); setFadedOutAttribute(); @@ -420,7 +420,7 @@ QString BaseRelationship::getCodeDefinition(unsigned def_type) bool reduced_form; setRelationshipAttributes(); reduced_form=(attributes[Attributes::POINTS].isEmpty() && - attributes[Attributes::LABELS_POS].isEmpty()); + attributes[Attributes::LabelsPos].isEmpty()); if(!reduced_form) cached_reduced_code.clear(); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index aa3fe1d0c3..0d1938744b 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -27,7 +27,7 @@ Cast::Cast(void) attributes[Attributes::SOURCE_TYPE]=QString(); attributes[Attributes::DestType]=QString(); attributes[Attributes::CastType]=QString(); - attributes[Attributes::IO_CAST]=QString(); + attributes[Attributes::IoCast]=QString(); attributes[Attributes::Function]=QString(); } @@ -183,12 +183,12 @@ QString Cast::getCodeDefinition(unsigned def_type) attributes[Attributes::Function]=cast_function->getCodeDefinition(def_type, true); } else - attributes[Attributes::IO_CAST]=(is_in_out ? Attributes::True : QString()); + attributes[Attributes::IoCast]=(is_in_out ? Attributes::True : QString()); if(cast_type==Assignment) attributes[Attributes::CastType]=Attributes::Assignment; else if(cast_type==Implicit) - attributes[Attributes::CastType]=Attributes::IMPLICIT; + attributes[Attributes::CastType]=Attributes::Implicit; else attributes[Attributes::CastType]=QString(); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 624217399a..e0b0bec731 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -28,8 +28,8 @@ Column::Column(void) attributes[Attributes::TABLE]=QString(); attributes[Attributes::SEQUENCE]=QString(); attributes[Attributes::DeclInTable]=QString(); - attributes[Attributes::IDENTITY_TYPE]=QString(); - attributes[Attributes::INCREMENT]=QString(); + attributes[Attributes::IdentityType]=QString(); + attributes[Attributes::Increment]=QString(); attributes[Attributes::MIN_VALUE]=QString(); attributes[Attributes::MAX_VALUE]=QString(); attributes[Attributes::START]=QString(); @@ -242,12 +242,12 @@ QString Column::getCodeDefinition(unsigned def_type) attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); attributes[Attributes::DefaultValue]=QString(); - attributes[Attributes::IDENTITY_TYPE]=QString(); + attributes[Attributes::IdentityType]=QString(); if(identity_type != BaseType::Null) { - attributes[Attributes::IDENTITY_TYPE] = ~identity_type; - attributes[Attributes::INCREMENT]=seq_increment; + attributes[Attributes::IdentityType] = ~identity_type; + attributes[Attributes::Increment]=seq_increment; attributes[Attributes::MIN_VALUE]=seq_min_value; attributes[Attributes::MAX_VALUE]=seq_max_value; attributes[Attributes::START]=seq_start; @@ -312,9 +312,9 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[Attributes::NEW_IDENTITY_TYPE] = QString(); if(this->identity_type == BaseType::Null && col->identity_type != BaseType::Null) - attribs[Attributes::IDENTITY_TYPE] = ~col->identity_type; + attribs[Attributes::IdentityType] = ~col->identity_type; else if(this->identity_type != BaseType::Null && col->identity_type == BaseType::Null) - attribs[Attributes::IDENTITY_TYPE] = Attributes::UNSET; + attribs[Attributes::IdentityType] = Attributes::UNSET; else if(this->identity_type != BaseType::Null && col->identity_type != BaseType::Null && this->identity_type != col->identity_type) attribs[Attributes::NEW_IDENTITY_TYPE] = ~col->identity_type; @@ -323,12 +323,12 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[Attributes::MIN_VALUE] = QString(); attribs[Attributes::MAX_VALUE] = QString(); attribs[Attributes::START] = QString(); - attribs[Attributes::INCREMENT] = QString(); + attribs[Attributes::Increment] = QString(); attribs[Attributes::Cache] = QString(); attribs[Attributes::Cycle] = QString(); //Checking differences in the underlying sequence (identity col) - if(attribs[Attributes::IDENTITY_TYPE] != Attributes::UNSET) + if(attribs[Attributes::IdentityType] != Attributes::UNSET) { if(!col->seq_min_value.isEmpty() && this->seq_min_value != col->seq_min_value) { @@ -350,7 +350,7 @@ QString Column::getAlterDefinition(BaseObject *object) if(!col->seq_increment.isEmpty() && this->seq_increment != col->seq_increment) { - attribs[Attributes::INCREMENT] = col->seq_increment; + attribs[Attributes::Increment] = col->seq_increment; ident_seq_changed = true; } diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 99113ab500..f076ff46e3 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -41,7 +41,7 @@ Constraint::Constraint(void) attributes[Attributes::TYPE]=QString(); attributes[Attributes::ComparisonType]=QString(); attributes[Attributes::DeferType]=QString(); - attributes[Attributes::INDEX_TYPE]=QString(); + attributes[Attributes::IndexType]=QString(); attributes[Attributes::Deferrable]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::DeclInTable]=QString(); @@ -715,7 +715,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[Attributes::NO_INHERIT]=(no_inherit ? Attributes::True : QString()); attributes[Attributes::ComparisonType]=(~match_type); attributes[Attributes::DeferType]=(~deferral_type); - attributes[Attributes::INDEX_TYPE]=(~ index_type); + attributes[Attributes::IndexType]=(~ index_type); if(getParentTable()) attributes[Attributes::TABLE]=getParentTable()->getName(true); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 7c2fc54d2a..66bbd50419 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -49,7 +49,7 @@ DatabaseModel::DatabaseModel(void) attributes[Attributes::AppendAtEod]=QString(); attributes[Attributes::PREPEND_AT_BOD]=QString(); attributes[Attributes::AllowConns]=QString(); - attributes[Attributes::IS_TEMPLATE]=QString(); + attributes[Attributes::IsTemplate]=QString(); } DatabaseModel::DatabaseModel(ModelWidget *model_wgt):DatabaseModel() @@ -2971,7 +2971,7 @@ void DatabaseModel::configureDatabase(attribs_map &attribs) localizations[1]=attribs[Attributes::LcCollate]; append_at_eod=attribs[Attributes::AppendAtEod]==Attributes::True; prepend_at_bod=attribs[Attributes::PREPEND_AT_BOD]==Attributes::True; - is_template=attribs[Attributes::IS_TEMPLATE]==Attributes::True; + is_template=attribs[Attributes::IsTemplate]==Attributes::True; allow_conns=attribs[Attributes::AllowConns] != Attributes::False; if(!attribs[Attributes::ConnLimit].isEmpty()) @@ -3020,15 +3020,15 @@ void DatabaseModel::loadModel(const QString &filename) this->author=attribs[Attributes::MODEL_AUTHOR]; - pos_str=attribs[Attributes::LAST_POSITION].split(','); + pos_str=attribs[Attributes::LastPosition].split(','); if(pos_str.size()>=2) this->last_pos=QPoint(pos_str[0].toUInt(),pos_str[1].toUInt()); - this->last_zoom=attribs[Attributes::LAST_ZOOM].toDouble(); + this->last_zoom=attribs[Attributes::LastZoom].toDouble(); if(this->last_zoom <= 0) this->last_zoom=1; - this->is_template = attribs[Attributes::IS_TEMPLATE] == Attributes::True; + this->is_template = attribs[Attributes::IsTemplate] == Attributes::True; this->allow_conns = (attribs[Attributes::AllowConns].isEmpty() || attribs[Attributes::AllowConns] == Attributes::True); @@ -3457,7 +3457,7 @@ Role *DatabaseModel::createRole(void) unsigned role_type; QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, - Attributes::CreateRole, Attributes::INHERIT, + Attributes::CreateRole, Attributes::Inherit, Attributes::LOGIN, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; @@ -3624,7 +3624,7 @@ Language *DatabaseModel::createLanguage(void) //Only VALIDATOR, HANDLER and INLINE functions are accepted for the language if(ref_type==Attributes::VALIDATOR_FUNC || ref_type==Attributes::HandlerFunc || - ref_type==Attributes::INLINE_FUNC) + ref_type==Attributes::InlineFunc) { //Gets the function signature and tries to retrieve it from the model signature=attribs[Attributes::SIGNATURE]; @@ -3690,8 +3690,8 @@ Function *DatabaseModel::createFunction(void) func->setWindowFunction(attribs[Attributes::WINDOW_FUNC]== Attributes::True); - if(!attribs[Attributes::LEAKPROOF].isEmpty()) - func->setLeakProof(attribs[Attributes::LEAKPROOF]== + if(!attribs[Attributes::LeakProof].isEmpty()) + func->setLeakProof(attribs[Attributes::LeakProof]== Attributes::True); if(!attribs[Attributes::BehaviorType].isEmpty()) @@ -3784,9 +3784,9 @@ Function *DatabaseModel::createFunction(void) xmlparser.savePosition(); xmlparser.getElementAttributes(attribs_aux); - if(!attribs_aux[Attributes::LIBRARY].isEmpty()) + if(!attribs_aux[Attributes::Library].isEmpty()) { - func->setLibrary(attribs_aux[Attributes::LIBRARY]); + func->setLibrary(attribs_aux[Attributes::Library]); func->setSymbol(attribs_aux[Attributes::SYMBOL]); } else if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -3941,8 +3941,8 @@ PgSqlType DatabaseModel::createPgSQLType(void) xmlparser.getElementAttributes(attribs); - if(!attribs[Attributes::LENGTH].isEmpty()) - length=attribs[Attributes::LENGTH].toUInt(); + if(!attribs[Attributes::Length].isEmpty()) + length=attribs[Attributes::Length].toUInt(); if(!attribs[Attributes::Dimension].isEmpty()) dimension=attribs[Attributes::Dimension].toUInt(); @@ -3951,7 +3951,7 @@ PgSqlType DatabaseModel::createPgSQLType(void) precision=attribs[Attributes::PRECISION].toInt(); with_timezone=(attribs[Attributes::WITH_TIMEZONE]==Attributes::True); - interv_type=attribs[Attributes::INTERVAL_TYPE]; + interv_type=attribs[Attributes::IntervalType]; if(!attribs[Attributes::SPATIAL_TYPE].isEmpty()) spatial_type=SpatialType(attribs[Attributes::SPATIAL_TYPE], @@ -4008,8 +4008,8 @@ Type *DatabaseModel::createType(void) type->setConfiguration(Type::BaseType); type->setByValue(attribs[Attributes::ByValue]==Attributes::True); - if(!attribs[Attributes::INTERNAL_LENGTH].isEmpty()) - type->setInternalLength(attribs[Attributes::INTERNAL_LENGTH].toUInt()); + if(!attribs[Attributes::InternalLength].isEmpty()) + type->setInternalLength(attribs[Attributes::InternalLength].toUInt()); if(!attribs[Attributes::Alignment].isEmpty()) type->setAlignment(attribs[Attributes::Alignment]); @@ -4033,7 +4033,7 @@ Type *DatabaseModel::createType(void) type->setPreferred(attribs[Attributes::PREFERRED]==Attributes::True); //Configuring an auxiliary map used to reference the functions used by base type - func_types[Attributes::INPUT_FUNC]=Type::InputFunc; + func_types[Attributes::InputFunc]=Type::InputFunc; func_types[Attributes::OUTPUT_FUNC]=Type::OutputFunc; func_types[Attributes::SEND_FUNC]=Type::SendFunc; func_types[Attributes::RECV_FUNC]=Type::RecvFunc; @@ -4236,14 +4236,14 @@ Cast *DatabaseModel::createCast(void) setBasicAttributes(cast); xmlparser.getElementAttributes(attribs); - if(attribs[Attributes::CastType]==Attributes::IMPLICIT) + if(attribs[Attributes::CastType]==Attributes::Implicit) cast->setCastType(Cast::Implicit); else if(attribs[Attributes::CastType]==Attributes::Assignment) cast->setCastType(Cast::Assignment); else cast->setCastType(Cast::Explicit); - cast->setInOut(attribs[Attributes::IO_CAST]==Attributes::True); + cast->setInOut(attribs[Attributes::IoCast]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4374,7 +4374,7 @@ Operator *DatabaseModel::createOperator(void) oper->setHashes(attribs[Attributes::Hashes]==Attributes::True); func_types[Attributes::OPERATOR_FUNC]=Operator::FUNC_OPERATOR; - func_types[Attributes::JOIN_FUNC]=Operator::FUNC_JOIN; + func_types[Attributes::JoinFunc]=Operator::FUNC_JOIN; func_types[Attributes::RESTRICTION_FUNC]=Operator::FUNC_RESTRICT; oper_types[Attributes::CommutatorOp]=Operator::OPER_COMMUTATOR; @@ -4465,7 +4465,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) setBasicAttributes(op_class); xmlparser.getElementAttributes(attribs); - op_class->setIndexingType(IndexingType(attribs[Attributes::INDEX_TYPE])); + op_class->setIndexingType(IndexingType(attribs[Attributes::IndexType])); op_class->setDefault(attribs[Attributes::Default]==Attributes::True); elem_types[Attributes::Function]=OperatorClassElement::FunctionElem; @@ -4576,7 +4576,7 @@ OperatorFamily *DatabaseModel::createOperatorFamily(void) op_family=new OperatorFamily; setBasicAttributes(op_family); xmlparser.getElementAttributes(attribs); - op_family->setIndexingType(IndexingType(attribs[Attributes::INDEX_TYPE])); + op_family->setIndexingType(IndexingType(attribs[Attributes::IndexType])); } catch(Exception &e) { @@ -4601,7 +4601,7 @@ Aggregate *DatabaseModel::createAggregate(void) setBasicAttributes(aggreg); xmlparser.getElementAttributes(attribs); - aggreg->setInitialCondition(attribs[Attributes::INITIAL_COND]); + aggreg->setInitialCondition(attribs[Attributes::InitialCond]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4736,7 +4736,7 @@ Table *DatabaseModel::createTable(void) { xmlparser.getElementAttributes(aux_attribs); names.push_back(aux_attribs[Attributes::NAME]); - idxs.push_back(aux_attribs[Attributes::INDEX].toUInt()); + idxs.push_back(aux_attribs[Attributes::Index].toUInt()); } } } @@ -4774,7 +4774,7 @@ Table *DatabaseModel::createTable(void) xmlparser.restorePosition(); } //Retrieving initial data - else if(elem==Attributes::INITIAL_DATA) + else if(elem==Attributes::InitialData) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -4820,11 +4820,11 @@ Column *DatabaseModel::createColumn(void) xmlparser.getElementAttributes(attribs); column->setNotNull(attribs[Attributes::NOT_NULL]==Attributes::True); column->setDefaultValue(attribs[Attributes::DefaultValue]); - column->setIdSeqAttributes(attribs[Attributes::MIN_VALUE], attribs[Attributes::MAX_VALUE], attribs[Attributes::INCREMENT], + column->setIdSeqAttributes(attribs[Attributes::MIN_VALUE], attribs[Attributes::MAX_VALUE], attribs[Attributes::Increment], attribs[Attributes::START], attribs[Attributes::Cache], attribs[Attributes::Cycle] == Attributes::True); - if(!attribs[Attributes::IDENTITY_TYPE].isEmpty()) - column->setIdentityType(IdentityType(attribs[Attributes::IDENTITY_TYPE])); + if(!attribs[Attributes::IdentityType].isEmpty()) + column->setIdentityType(IdentityType(attribs[Attributes::IdentityType])); if(!attribs[Attributes::SEQUENCE].isEmpty()) { @@ -4991,9 +4991,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { constr->setNoInherit(attribs[Attributes::NO_INHERIT]==Attributes::True); } - else if(constr_type==ConstraintType::Exclude && !attribs[Attributes::INDEX_TYPE].isEmpty()) + else if(constr_type==ConstraintType::Exclude && !attribs[Attributes::IndexType].isEmpty()) { - constr->setIndexType(attribs[Attributes::INDEX_TYPE]); + constr->setIndexType(attribs[Attributes::IndexType]); } if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5095,7 +5095,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec xml_elem=xmlparser.getElementName(); is_part_key = xml_elem == Attributes::PARTITION_KEY; - if(xml_elem==Attributes::INDEX_ELEMENT || xml_elem==Attributes::ExcludeElement || is_part_key) + if(xml_elem==Attributes::IndexElement || xml_elem==Attributes::ExcludeElement || is_part_key) { xmlparser.getElementAttributes(attribs); @@ -5273,7 +5273,7 @@ QString DatabaseModel::getAlterDefinition(BaseObject *object) aux_attribs[Attributes::ConnLimit]=QString::number(db_aux->conn_limit); if(this->is_template != db_aux->is_template) - aux_attribs[Attributes::IS_TEMPLATE] = (db_aux->is_template ? Attributes::True : Attributes::False); + aux_attribs[Attributes::IsTemplate] = (db_aux->is_template ? Attributes::True : Attributes::False); if(this->allow_conns != db_aux->allow_conns) aux_attribs[Attributes::AllowConns] = (db_aux->allow_conns ? Attributes::True : Attributes::False); @@ -5325,7 +5325,7 @@ Index *DatabaseModel::createIndex(void) index->setIndexAttribute(Index::Unique, attribs[Attributes::UNIQUE]==Attributes::True); index->setIndexAttribute(Index::FastUpdate, attribs[Attributes::FastUpdate]==Attributes::True); index->setIndexAttribute(Index::Buffering, attribs[Attributes::Buffering]==Attributes::True); - index->setIndexingType(attribs[Attributes::INDEX_TYPE]); + index->setIndexingType(attribs[Attributes::IndexType]); index->setFillFactor(attribs[Attributes::Factor].toUInt()); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5336,7 +5336,7 @@ Index *DatabaseModel::createIndex(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::INDEX_ELEMENT) + if(elem==Attributes::IndexElement) { createElement(idx_elem, index, table); index->addIndexElement(idx_elem); @@ -5483,7 +5483,7 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setConstraint(attribs[Attributes::Constraint]==Attributes::True); trigger->setEvent(EventType::OnInsert, - (attribs[Attributes::INS_EVENT]==Attributes::True)); + (attribs[Attributes::InsEvent]==Attributes::True)); trigger->setEvent(EventType::OnDelete, (attribs[Attributes::DelEvent]==Attributes::True)); @@ -5802,7 +5802,7 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) sequence->setValues(attribs[Attributes::MIN_VALUE], attribs[Attributes::MAX_VALUE], - attribs[Attributes::INCREMENT], + attribs[Attributes::Increment], attribs[Attributes::START], attribs[Attributes::Cache]); @@ -6151,7 +6151,7 @@ Tag *DatabaseModel::createTag(void) if(elem==Attributes::STYLE) { xmlparser.getElementAttributes(attribs); - tag->setElementColors(attribs[Attributes::ID],attribs[Attributes::Colors]); + tag->setElementColors(attribs[Attributes::Id],attribs[Attributes::Colors]); } } } @@ -6180,7 +6180,7 @@ Textbox *DatabaseModel::createTextbox(void) xmlparser.getElementAttributes(attribs); txtbox->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); - txtbox->setTextAttribute(Textbox::ItalicText, attribs[Attributes::ITALIC]==Attributes::True); + txtbox->setTextAttribute(Textbox::ItalicText, attribs[Attributes::Italic]==Attributes::True); txtbox->setTextAttribute(Textbox::BoldText, attribs[Attributes::Bold]==Attributes::True); txtbox->setTextAttribute(Textbox::UnderlineText, attribs[Attributes::UNDERLINE]==Attributes::True); @@ -6337,7 +6337,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) sql_disabled=attribs[Attributes::SQL_DISABLED]==Attributes::True; src_mand=attribs[Attributes::SRC_REQUIRED]==Attributes::True; dst_mand=attribs[Attributes::DstRequired]==Attributes::True; - identifier=attribs[Attributes::IDENTIFIER]==Attributes::True; + identifier=attribs[Attributes::Identifier]==Attributes::True; deferrable=attribs[Attributes::Deferrable]==Attributes::True; defer_type=DeferralType(attribs[Attributes::DeferType]); del_action=ActionType(attribs[Attributes::DelAction]); @@ -6421,7 +6421,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) xmlparser.restorePosition(); } - else if(elem==Attributes::LINE) + else if(elem==Attributes::Line) { vector points; xmlparser.savePosition(); @@ -6438,7 +6438,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) base_rel->setPoints(points); xmlparser.restorePosition(); } - else if(elem==Attributes::LABEL) + else if(elem==Attributes::Label) { xmlparser.getElementAttributes(attribs); str_aux=attribs[Attributes::REF_TYPE]; @@ -6457,7 +6457,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) QList col_list; xmlparser.getElementAttributes(attribs); - col_list=attribs[Attributes::INDEXES].split(','); + col_list=attribs[Attributes::Indexes].split(','); while(!col_list.isEmpty()) { @@ -6604,7 +6604,7 @@ Permission *DatabaseModel::createPermission(void) priv_type=Permission::PrivDelete; else if(itr->first==Attributes::ExecutPriv) priv_type=Permission::PrivExecute; - else if(itr->first==Attributes::INSERT_PRIV) + else if(itr->first==Attributes::InsertPriv) priv_type=Permission::PrivInsert; else if(itr->first==Attributes::REFERENCES_PRIV) priv_type=Permission::PrivReferences; @@ -6746,7 +6746,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) attributes[Attributes::PREPEND_AT_BOD]=(prepend_at_bod ? Attributes::True : QString()); } - attributes[Attributes::IS_TEMPLATE]=(is_template ? Attributes::True : Attributes::False); + attributes[Attributes::IsTemplate]=(is_template ? Attributes::True : Attributes::False); attributes[Attributes::AllowConns]=(allow_conns ? Attributes::True : Attributes::False); attributes[Attributes::TEMPLATE_DB]=template_db; @@ -6933,8 +6933,8 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) { attribs_aux[Attributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); attribs_aux[Attributes::PROTECTED]=(this->is_protected ? Attributes::True : QString()); - attribs_aux[Attributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); - attribs_aux[Attributes::LAST_ZOOM]=QString::number(last_zoom); + attribs_aux[Attributes::LastPosition]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); + attribs_aux[Attributes::LastZoom]=QString::number(last_zoom); attribs_aux[Attributes::DefaultSchema]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getName(true) : QString()); attribs_aux[Attributes::DefaultOwner]=(default_objs[ObjectType::Role] ? default_objs[ObjectType::Role]->getName(true) : QString()); attribs_aux[Attributes::DefaultTablespace]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getName(true) : QString()); @@ -9656,8 +9656,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_db_attribs && object==this) { attribs[Attributes::MODEL_AUTHOR]=this->getAuthor(); - attribs[Attributes::LAST_POSITION]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); - attribs[Attributes::LAST_ZOOM]=QString::number(last_zoom); + attribs[Attributes::LastPosition]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); + attribs[Attributes::LastZoom]=QString::number(last_zoom); attribs[Attributes::DefaultCollation]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getSignature() : QString()); attribs[Attributes::DefaultSchema]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getSignature() : QString()); attribs[Attributes::DefaultTablespace]=(default_objs[ObjectType::Tablespace] ? default_objs[ObjectType::Tablespace]->getSignature() : QString()); @@ -9742,7 +9742,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::POSITION]+=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - Attributes::LABEL + GlobalAttributes::SchemaExt, aux_attribs); + Attributes::Label + GlobalAttributes::SchemaExt, aux_attribs); } } } @@ -9788,7 +9788,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option objs_def+=schparser.convertCharsToXMLEntities( schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - Attributes::INFO + GlobalAttributes::SchemaExt, attribs)); + Attributes::Info + GlobalAttributes::SchemaExt, attribs)); } else idx++; @@ -9799,7 +9799,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(!objs_def.isEmpty()) { //Generates the metadata XML buffer - attribs[Attributes::INFO]=objs_def; + attribs[Attributes::Info]=objs_def; buf.append(schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + Attributes::METADATA + GlobalAttributes::SchemaExt, attribs)); @@ -9904,7 +9904,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option new_object=nullptr; xmlparser.restorePosition(); } - else if(elem_name==Attributes::INFO) + else if(elem_name==Attributes::Info) { xmlparser.getElementAttributes(attribs); obj_name=attribs[Attributes::OBJECT]; @@ -9917,14 +9917,14 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { if(load_db_attribs) { - QStringList pos=attribs[Attributes::LAST_POSITION].split(','); + QStringList pos=attribs[Attributes::LastPosition].split(','); default_objs[ObjectType::Schema]=getSchema(attribs[Attributes::DefaultSchema]); default_objs[ObjectType::Role]=getRole(attribs[Attributes::DefaultOwner]); default_objs[ObjectType::Collation]=getCollation(attribs[Attributes::DefaultCollation]); default_objs[ObjectType::Tablespace]=getTablespace(attribs[Attributes::DefaultTablespace]); author=attribs[Attributes::MODEL_AUTHOR]; - last_zoom=attribs[Attributes::LAST_ZOOM].toFloat(); + last_zoom=attribs[Attributes::LastZoom].toFloat(); if(pos.size()>=2) last_pos=QPoint(pos[0].toFloat(), pos[1].toFloat()); @@ -10008,7 +10008,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option aux_attrib[Attributes::Y_POS].toFloat())); } //Retrieving and storing the labels' custom positions - else if(aux_elem==Attributes::LABEL) + else if(aux_elem==Attributes::Label) { ref_type=aux_attrib[Attributes::REF_TYPE]; xmlparser.savePosition(); diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index f5b7bf846f..a1f489f0e6 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -35,7 +35,7 @@ Function::Function(void) attributes[Attributes::ROW_AMOUNT]=QString(); attributes[Attributes::RETURN_TYPE]=QString(); attributes[Attributes::FunctionType]=QString(); - attributes[Attributes::LANGUAGE]=QString(); + attributes[Attributes::Language]=QString(); attributes[Attributes::RETURNS_SETOF]=QString(); attributes[Attributes::SECURITY_TYPE]=QString(); attributes[Attributes::BehaviorType]=QString(); @@ -44,9 +44,9 @@ Function::Function(void) attributes[Attributes::REF_TYPE]=QString(); attributes[Attributes::WINDOW_FUNC]=QString(); attributes[Attributes::RETURN_TABLE]=QString(); - attributes[Attributes::LIBRARY]=QString(); + attributes[Attributes::Library]=QString(); attributes[Attributes::SYMBOL]=QString(); - attributes[Attributes::LEAKPROOF]=QString(); + attributes[Attributes::LeakProof]=QString(); } void Function::setName(const QString &name) @@ -465,12 +465,12 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) { if(def_type==SchemaParser::SqlDefinition) { - attributes[Attributes::LANGUAGE]=language->getName(false); + attributes[Attributes::Language]=language->getName(false); attributes[Attributes::RETURN_TYPE]=(*return_type); } else { - attributes[Attributes::LANGUAGE]=language->getCodeDefinition(def_type,true); + attributes[Attributes::Language]=language->getCodeDefinition(def_type,true); attributes[Attributes::RETURN_TYPE]=return_type.getCodeDefinition(def_type); } } @@ -479,7 +479,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::RETURNS_SETOF]=(returns_setof ? Attributes::True : QString()); attributes[Attributes::WINDOW_FUNC]=(is_wnd_function ? Attributes::True : QString()); - attributes[Attributes::LEAKPROOF]=(is_leakproof ? Attributes::True : QString()); + attributes[Attributes::LeakProof]=(is_leakproof ? Attributes::True : QString()); attributes[Attributes::SECURITY_TYPE]=(~security_type); attributes[Attributes::BehaviorType]=(~behavior_type); attributes[Attributes::Definition]=source_code; @@ -487,7 +487,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) if(language->getName()==~LanguageType(LanguageType::C)) { attributes[Attributes::SYMBOL]=symbol; - attributes[Attributes::LIBRARY]=library; + attributes[Attributes::Library]=library; } attributes[Attributes::SIGNATURE]=signature; @@ -529,7 +529,7 @@ QString Function::getAlterDefinition(BaseObject *object) attribs[Attributes::FunctionType]=~func->function_type; if(this->is_leakproof!=func->is_leakproof) - attribs[Attributes::LEAKPROOF]=(func->is_leakproof ? Attributes::True : Attributes::UNSET); + attribs[Attributes::LeakProof]=(func->is_leakproof ? Attributes::True : Attributes::UNSET); if(this->security_type!=func->security_type) attribs[Attributes::SECURITY_TYPE]=~func->security_type; diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index bc023b677d..88fe787104 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -27,7 +27,7 @@ Index::Index(void) attributes[Attributes::UNIQUE]=QString(); attributes[Attributes::Concurrent]=QString(); attributes[Attributes::TABLE]=QString(); - attributes[Attributes::INDEX_TYPE]=QString(); + attributes[Attributes::IndexType]=QString(); attributes[Attributes::Columns]=QString(); attributes[Attributes::Expression]=QString(); attributes[Attributes::Factor]=QString(); @@ -333,7 +333,7 @@ QString Index::getCodeDefinition(unsigned def_type) setIndexElementsAttribute(def_type); attributes[Attributes::UNIQUE]=(index_attribs[Unique] ? Attributes::True : QString()); attributes[Attributes::Concurrent]=(index_attribs[Concurrent] ? Attributes::True : QString()); - attributes[Attributes::INDEX_TYPE]=(~indexing_type); + attributes[Attributes::IndexType]=(~indexing_type); attributes[Attributes::PREDICATE]=predicate; attributes[Attributes::STORAGE_PARAMS]=QString(); diff --git a/libpgmodeler/src/indexelement.cpp b/libpgmodeler/src/indexelement.cpp index 4d8e88715e..538c03226c 100644 --- a/libpgmodeler/src/indexelement.cpp +++ b/libpgmodeler/src/indexelement.cpp @@ -49,6 +49,6 @@ QString IndexElement::getCodeDefinition(unsigned def_type) attributes[Attributes::Collation]=collation->getCodeDefinition(def_type, true); } - return(schparser.getCodeDefinition(Attributes::INDEX_ELEMENT,attributes, def_type)); + return(schparser.getCodeDefinition(Attributes::IndexElement,attributes, def_type)); } diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index d4ec36fa84..5e9e755ca5 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -29,7 +29,7 @@ Language::Language(void) attributes[Attributes::TRUSTED]=QString(); attributes[Attributes::HandlerFunc]=QString(); attributes[Attributes::VALIDATOR_FUNC]=QString(); - attributes[Attributes::INLINE_FUNC]=QString(); + attributes[Attributes::InlineFunc]=QString(); } void Language::setName(const QString &name) @@ -118,7 +118,7 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) unsigned i; QString attribs_func[3]={Attributes::VALIDATOR_FUNC, Attributes::HandlerFunc, - Attributes::INLINE_FUNC}; + Attributes::InlineFunc}; attributes[Attributes::TRUSTED]=(is_trusted ? Attributes::True : QString()); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 9ba6341984..2af4a16e9b 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -34,12 +34,12 @@ Operator::Operator(void) argument_types[LEFT_ARG]=PgSqlType(QString("\"any\"")); argument_types[RIGHT_ARG]=PgSqlType(QString("\"any\"")); - attributes[Attributes::LEFT_TYPE]=QString(); + attributes[Attributes::LeftType]=QString(); attributes[Attributes::RIGHT_TYPE]=QString(); attributes[Attributes::CommutatorOp]=QString(); attributes[Attributes::NEGATOR_OP]=QString(); attributes[Attributes::RESTRICTION_FUNC]=QString(); - attributes[Attributes::JOIN_FUNC]=QString(); + attributes[Attributes::JoinFunc]=QString(); attributes[Attributes::OPERATOR_FUNC]=QString(); attributes[Attributes::Hashes]=QString(); attributes[Attributes::MERGES]=QString(); @@ -280,12 +280,12 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) if(!code_def.isEmpty()) return(code_def); unsigned i; - QString type_attribs[]={Attributes::LEFT_TYPE, Attributes::RIGHT_TYPE}, + QString type_attribs[]={Attributes::LeftType, Attributes::RIGHT_TYPE}, op_attribs[]={ Attributes::CommutatorOp, Attributes::NEGATOR_OP }, func_attribs[]={Attributes::OPERATOR_FUNC, - Attributes::JOIN_FUNC, + Attributes::JoinFunc, Attributes::RESTRICTION_FUNC}; for(i=Operator::LEFT_ARG; i <= Operator::RIGHT_ARG; i++) diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index f4d7e69ccb..b744fcc290 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -25,7 +25,7 @@ OperatorClass::OperatorClass(void) is_default=false; attributes[Attributes::Family]=QString(); attributes[Attributes::Elements]=QString(); - attributes[Attributes::INDEX_TYPE]=QString(); + attributes[Attributes::IndexType]=QString(); attributes[Attributes::TYPE]=QString(); attributes[Attributes::Default]=QString(); } @@ -172,7 +172,7 @@ QString OperatorClass::getCodeDefinition(unsigned def_type, bool reduced_form) if(!code_def.isEmpty()) return(code_def); setElementsAttribute(def_type); - attributes[Attributes::INDEX_TYPE]=(~indexing_type); + attributes[Attributes::IndexType]=(~indexing_type); attributes[Attributes::Default]=(is_default ? Attributes::True : QString()); if(def_type==SchemaParser::SqlDefinition) diff --git a/libpgmodeler/src/operatorfamily.cpp b/libpgmodeler/src/operatorfamily.cpp index f7ceb680ae..df944cbee0 100644 --- a/libpgmodeler/src/operatorfamily.cpp +++ b/libpgmodeler/src/operatorfamily.cpp @@ -21,7 +21,7 @@ OperatorFamily::OperatorFamily(void) { obj_type=ObjectType::OpFamily; - attributes[Attributes::INDEX_TYPE]=QString(); + attributes[Attributes::IndexType]=QString(); } void OperatorFamily::setIndexingType(IndexingType idx_type) @@ -46,7 +46,7 @@ QString OperatorFamily::getCodeDefinition(unsigned def_type, bool reduced_form) if(!code_def.isEmpty()) return(code_def); attributes[Attributes::SIGNATURE]=getSignature(); - attributes[Attributes::INDEX_TYPE]=(~indexing_type); + attributes[Attributes::IndexType]=(~indexing_type); return(BaseObject::getCodeDefinition(def_type,reduced_form)); } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 105dae8643..e42669a32c 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -411,7 +411,7 @@ QString Permission::getCodeDefinition(unsigned def_type) unsigned i, count; ObjectType obj_type; - QString priv_vect[12]={ Attributes::SELECT_PRIV, Attributes::INSERT_PRIV, + QString priv_vect[12]={ Attributes::SELECT_PRIV, Attributes::InsertPriv, Attributes::UPDATE_PRIV, Attributes::DeletePriv, Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index e46d204fbf..d5b8f2ca12 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1588,18 +1588,18 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs_map attribs; SchemaParser schparser; - attribs[Attributes::LENGTH]=QString(); + attribs[Attributes::Length]=QString(); attribs[Attributes::Dimension]=QString(); attribs[Attributes::PRECISION]=QString(); attribs[Attributes::WITH_TIMEZONE]=QString(); - attribs[Attributes::INTERVAL_TYPE]=QString(); + attribs[Attributes::IntervalType]=QString(); attribs[Attributes::SPATIAL_TYPE]=QString(); attribs[Attributes::VARIATION]=QString(); attribs[Attributes::SRID]=QString(); attribs[Attributes::REF_TYPE]=ref_type; attribs[Attributes::NAME]=(~(*this)); - attribs[Attributes::LENGTH]=QString("%1").arg(this->length); + attribs[Attributes::Length]=QString("%1").arg(this->length); if(dimension > 0) attribs[Attributes::Dimension]=QString("%1").arg(this->dimension); @@ -1608,7 +1608,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs[Attributes::PRECISION]=QString("%1").arg(this->precision); if(interval_type != BaseType::Null) - attribs[Attributes::INTERVAL_TYPE]=(~interval_type); + attribs[Attributes::IntervalType]=(~interval_type); if(isGiSType()) { diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 869f55fc0e..6ec5e2a129 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2606,7 +2606,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) bool reduced_form; setRelationshipAttributes(); - attributes[Attributes::IDENTIFIER]=(identifier ? Attributes::True : QString()); + attributes[Attributes::Identifier]=(identifier ? Attributes::True : QString()); attributes[Attributes::SINGLE_PK_COLUMN]=(single_pk_column ? Attributes::True : QString()); attributes[Attributes::Deferrable]=(deferrable ? Attributes::True : QString()); attributes[Attributes::DeferType]=~deferral_type; @@ -2673,7 +2673,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::POINTS].isEmpty() && attributes[Attributes::SPECIAL_PK_COLS].isEmpty() && attributes[Attributes::POINTS].isEmpty() && - attributes[Attributes::LABELS_POS].isEmpty()); + attributes[Attributes::LabelsPos].isEmpty()); if(!reduced_form) cached_reduced_code.clear(); @@ -2710,14 +2710,14 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) if(rel_type != RelationshipGen && rel_type != RelationshipPart) return(QString()); - attributes[Attributes::INHERIT]=QString(); + attributes[Attributes::Inherit]=QString(); attributes[Attributes::AncestorTable]=QString(); attributes[Attributes::PARTITIONED_TABLE]=QString(); attributes[Attributes::PARTITION_BOUND_EXPR]=QString(); if(rel_type == RelationshipGen) { - attributes[Attributes::INHERIT]=(undo_inh_part ? Attributes::UNSET : Attributes::True); + attributes[Attributes::Inherit]=(undo_inh_part ? Attributes::UNSET : Attributes::True); attributes[Attributes::TABLE]=getReceiverTable()->getName(true); attributes[Attributes::AncestorTable]=getReferenceTable()->getName(true); } diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 736bf891c6..b318a18620 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -33,7 +33,7 @@ Role::Role(void) attributes[Attributes::SUPERUSER]=QString(); attributes[Attributes::CreateDb]=QString(); attributes[Attributes::CreateRole]=QString(); - attributes[Attributes::INHERIT]=QString(); + attributes[Attributes::Inherit]=QString(); attributes[Attributes::LOGIN]=QString(); attributes[Attributes::ConnLimit]=QString(); attributes[Attributes::PASSWORD]=QString(); @@ -330,7 +330,7 @@ QString Role::getCodeDefinition(unsigned def_type) unsigned i; QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, - Attributes::CreateRole, Attributes::INHERIT, + Attributes::CreateRole, Attributes::Inherit, Attributes::LOGIN, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; @@ -361,7 +361,7 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) { attribs_map attribs; QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, - Attributes::CreateRole, Attributes::INHERIT, + Attributes::CreateRole, Attributes::Inherit, Attributes::LOGIN, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index af2d957681..8c79d7f6fd 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -32,7 +32,7 @@ Sequence::Sequence(void) setDefaultValues(PgSqlType(QString("serial"))); owner_col=nullptr; - attributes[Attributes::INCREMENT]=QString(); + attributes[Attributes::Increment]=QString(); attributes[Attributes::MIN_VALUE]=QString(); attributes[Attributes::MAX_VALUE]=QString(); attributes[Attributes::START]=QString(); @@ -402,7 +402,7 @@ QString Sequence::getCodeDefinition(unsigned def_type) attributes[Attributes::ColIsIdentity]= (owner_col && owner_col->getIdentityType() != BaseType::Null ? Attributes::True : QString()); - attributes[Attributes::INCREMENT]=increment; + attributes[Attributes::Increment]=increment; attributes[Attributes::MIN_VALUE]=min_value; attributes[Attributes::MAX_VALUE]=max_value; attributes[Attributes::START]=start; @@ -447,7 +447,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) } if(!seq->increment.isEmpty() && this->increment!=seq->increment) - attribs[Attributes::INCREMENT]=seq->increment; + attribs[Attributes::Increment]=seq->increment; if(!seq->min_value.isEmpty() && this->min_value!=seq->min_value) attribs[Attributes::MIN_VALUE]=seq->min_value; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index f2e4550c77..c7cae6f130 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -27,7 +27,7 @@ Table::Table(void) : BaseTable() obj_type=ObjectType::Table; with_oid=gen_alter_cmds=unlogged=rls_enabled=rls_forced=false; attributes[Attributes::Columns]=QString(); - attributes[Attributes::INH_COLUMNS]=QString(); + attributes[Attributes::InhColumns]=QString(); attributes[Attributes::Constraints]=QString(); attributes[Attributes::OIDS]=QString(); attributes[Attributes::ColsComment]=QString(); @@ -38,7 +38,7 @@ Table::Table(void) : BaseTable() attributes[Attributes::ColIndexes]=QString(); attributes[Attributes::ConstrIndexes]=QString(); attributes[Attributes::UNLOGGED]=QString(); - attributes[Attributes::INITIAL_DATA]=QString(); + attributes[Attributes::InitialData]=QString(); attributes[Attributes::RLS_ENABLED]=QString(); attributes[Attributes::RLS_FORCED]=QString(); attributes[Attributes::PARTITIONING]=QString(); @@ -204,7 +204,7 @@ void Table::setRelObjectsIndexesAttribute(void) for(auto &obj_idx : (*obj_indexes[idx])) { aux_attribs[Attributes::NAME]=obj_idx.first; - aux_attribs[Attributes::INDEX]=QString::number(obj_idx.second); + aux_attribs[Attributes::Index]=QString::number(obj_idx.second); aux_attribs[Attributes::OBJECTS]+=schparser.getCodeDefinition(Attributes::OBJECT, aux_attribs, SchemaParser::XmlDefinition); } @@ -249,7 +249,7 @@ void Table::setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols) str_cols.remove(count-2,2); } - attributes[Attributes::INH_COLUMNS]=inh_cols; + attributes[Attributes::InhColumns]=inh_cols; } attributes[Attributes::Columns]=str_cols; @@ -1634,11 +1634,11 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) setRelObjectsIndexesAttribute(); setPositionAttribute(); setFadedOutAttribute(); - attributes[Attributes::INITIAL_DATA]=initial_data; + attributes[Attributes::InitialData]=initial_data; attributes[Attributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); } else - attributes[Attributes::INITIAL_DATA]=getInitialDataCommands(); + attributes[Attributes::InitialData]=getInitialDataCommands(); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 2daa31a7a7..bf5c4099f2 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -154,7 +154,7 @@ QString Tag::getCodeDefinition(unsigned def_type, bool reduced_form) for(auto &itr : color_config) { - attribs[Attributes::ID]=itr.first; + attribs[Attributes::Id]=itr.first; attribs[Attributes::Colors]=QString(); if(itr.first==Attributes::TABLE_NAME || itr.first==Attributes::TABLE_SCHEMA_NAME) diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index b6a28a97a6..aba747a139 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -23,7 +23,7 @@ Textbox::Textbox(void) obj_type=ObjectType::Textbox; font_size=9.0f; text_attributes[0]=text_attributes[1]=text_attributes[2]=false; - attributes[Attributes::ITALIC]=QString(); + attributes[Attributes::Italic]=QString(); attributes[Attributes::Bold]=QString(); attributes[Attributes::UNDERLINE]=QString(); attributes[Attributes::Color]=QString(); @@ -43,7 +43,7 @@ QString Textbox::getCodeDefinition(unsigned def_type) setFadedOutAttribute(); if(text_attributes[ItalicText]) - attributes[Attributes::ITALIC]=Attributes::True; + attributes[Attributes::Italic]=Attributes::True; if(text_attributes[BoldText]) attributes[Attributes::Bold]=Attributes::True; diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 65a2f78687..30845203e8 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -39,7 +39,7 @@ Trigger::Trigger(void) attributes[Attributes::Columns]=QString(); attributes[Attributes::FiringType]=QString(); attributes[Attributes::PER_ROW]=QString(); - attributes[Attributes::INS_EVENT]=QString(); + attributes[Attributes::InsEvent]=QString(); attributes[Attributes::DelEvent]=QString(); attributes[Attributes::UPD_EVENT]=QString(); attributes[Attributes::TRUNC_EVENT]=QString(); @@ -346,7 +346,7 @@ vector Trigger::getRelationshipAddedColumns(void) void Trigger::setBasicAttributes(unsigned def_type) { QString str_aux, - attribs[4]={Attributes::INS_EVENT, Attributes::DelEvent, + attribs[4]={Attributes::InsEvent, Attributes::DelEvent, Attributes::TRUNC_EVENT, Attributes::UPD_EVENT }, sql_event[4]={"INSERT OR ", "DELETE OR ", "TRUNCATE OR ", "UPDATE "}; unsigned count, i, i1, event_types[4]={EventType::OnInsert, EventType::OnDelete, diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 9ac265ad2e..b4faa99c0c 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -29,14 +29,14 @@ Type::Type(void) attributes[Attributes::TYPE_ATTRIBUTE]=QString(); attributes[Attributes::EnumType]=QString(); attributes[Attributes::Enumerations]=QString(); - attributes[Attributes::INPUT_FUNC]=QString(); + attributes[Attributes::InputFunc]=QString(); attributes[Attributes::OUTPUT_FUNC]=QString(); attributes[Attributes::RECV_FUNC]=QString(); attributes[Attributes::SEND_FUNC]=QString(); attributes[Attributes::TPMOD_IN_FUNC]=QString(); attributes[Attributes::TPMOD_OUT_FUNC]=QString(); attributes[Attributes::AnalyzeFunc]=QString(); - attributes[Attributes::INTERNAL_LENGTH]=QString(); + attributes[Attributes::InternalLength]=QString(); attributes[Attributes::ByValue]=QString(); attributes[Attributes::Alignment]=QString(); attributes[Attributes::STORAGE]=QString(); @@ -46,7 +46,7 @@ Type::Type(void) attributes[Attributes::REDUCED_FORM]=QString(); attributes[Attributes::Category]=QString(); attributes[Attributes::PREFERRED]=QString(); - attributes[Attributes::LIKE_TYPE]=QString(); + attributes[Attributes::LikeType]=QString(); attributes[Attributes::Collatable]=QString(); attributes[Attributes::SUBTYPE]=QString(); attributes[Attributes::SUBTYPE_DIFF_FUNC]=QString(); @@ -647,9 +647,9 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::BaseType]=Attributes::True; if(internal_len==0 && def_type==SchemaParser::SqlDefinition) - attributes[Attributes::INTERNAL_LENGTH]=QString("VARIABLE"); + attributes[Attributes::InternalLength]=QString("VARIABLE"); else - attributes[Attributes::INTERNAL_LENGTH]=QString("%1").arg(internal_len); + attributes[Attributes::InternalLength]=QString("%1").arg(internal_len); attributes[Attributes::ByValue]=(by_value ? Attributes::True : QString()); attributes[Attributes::Alignment]=(*alignment); @@ -670,16 +670,16 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) if(like_type!=QString("\"any\"")) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::LIKE_TYPE]=(*like_type); + attributes[Attributes::LikeType]=(*like_type); else - attributes[Attributes::LIKE_TYPE]=like_type.getCodeDefinition(SchemaParser::XmlDefinition); + attributes[Attributes::LikeType]=like_type.getCodeDefinition(SchemaParser::XmlDefinition); } } if(config==BaseType || config==RangeType) { unsigned i; - QString func_attrib[]={Attributes::INPUT_FUNC, + QString func_attrib[]={Attributes::InputFunc, Attributes::OUTPUT_FUNC, Attributes::RECV_FUNC, Attributes::SEND_FUNC, diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index d4559403dc..95d93edd4a 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -60,7 +60,7 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid BaseObject::getSchemaName(ObjectType::Textbox), //30 Attributes::Column, //31 Attributes::Column, //32 - Attributes::INH_COLUMN, //33 + Attributes::InhColumn, //33 Attributes::PROT_COLUMN, //34 Attributes::PK_COLUMN, //35 Attributes::PK_COLUMN, //36 @@ -71,8 +71,8 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::NN_COLUMN, //41 Attributes::NN_COLUMN, //42 Attributes::RELATIONSHIP, //43 - Attributes::LABEL, //44 - Attributes::LABEL, //45 + Attributes::Label, //44 + Attributes::Label, //45 Attributes::Attribute, //46 Attributes::Attribute, //47 Attributes::TAG, //48 @@ -290,7 +290,7 @@ void AppearanceConfigWidget::saveConfiguration(void) attrib_id=item.conf_id + QString("-fcolor"); attribs[attrib_id]=item.font_fmt.foreground().color().name(); - attrib_id=item.conf_id + QString("-") + Attributes::ITALIC; + attrib_id=item.conf_id + QString("-") + Attributes::Italic; attribs[attrib_id]=(font.italic() ? Attributes::True : Attributes::False); attrib_id=item.conf_id + QString("-") + Attributes::Bold; diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index cf2c5acfca..67bf261ce0 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -226,8 +226,8 @@ void CodeCompletionWidget::configureCompletion(DatabaseModel *db_model, SyntaxHi if(enable_snippets) { clearCustomItems(); - insertCustomItems(SnippetsConfigWidget::getAllSnippetsAttribute(Attributes::ID), - SnippetsConfigWidget::getAllSnippetsAttribute(Attributes::LABEL), + insertCustomItems(SnippetsConfigWidget::getAllSnippetsAttribute(Attributes::Id), + SnippetsConfigWidget::getAllSnippetsAttribute(Attributes::Label), QPixmap(PgModelerUiNs::getIconPath("codesnippet"))); } } diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 8fafb9f3f8..149943986a 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -153,7 +153,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) conn->setAutoBrowseDB(itr->second[Attributes::AutoBrowseDb]==Attributes::True); conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(Attributes::Diff)]==Attributes::True); conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(Attributes::Export)]==Attributes::True); - conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(Attributes::IMPORT)]==Attributes::True); + conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(Attributes::Import)]==Attributes::True); conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(Attributes::VALIDATION)]==Attributes::True); connections.push_back(conn); @@ -509,7 +509,7 @@ void ConnectionsConfigWidget::saveConfiguration(void) attribs[Attributes::ConnectionTimeout]=attribs[Connection::ParamConnTimeout]; attribs[DefaultFor.arg(Attributes::Export)]=(conn->isDefaultForOperation(Connection::OpExport) ? Attributes::True : QString()); - attribs[DefaultFor.arg(Attributes::IMPORT)]=(conn->isDefaultForOperation(Connection::OpImport) ? Attributes::True : QString()); + attribs[DefaultFor.arg(Attributes::Import)]=(conn->isDefaultForOperation(Connection::OpImport) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::Diff)]=(conn->isDefaultForOperation(Connection::OpDiff) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? Attributes::True : QString()); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 90423e0021..218fd895b8 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -53,15 +53,15 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Family, QT_TR_NOOP("Op. family")}, {Attributes::FinalFunc, QT_TR_NOOP("Final func.")}, {Attributes::Function, QT_TR_NOOP("Function")}, {Attributes::FunctionType, QT_TR_NOOP("Func. type")}, {Attributes::HandlerFunc, QT_TR_NOOP("Handler func.")}, {Attributes::HandlesType, QT_TR_NOOP("Handles type")}, - {Attributes::Hashes, QT_TR_NOOP("Hashes")}, {Attributes::INDEX_TYPE, QT_TR_NOOP("Index type")}, - {Attributes::INHERIT, QT_TR_NOOP("Inherit")}, {Attributes::INITIAL_COND, QT_TR_NOOP("Ini. condition")}, - {Attributes::INLINE_FUNC, QT_TR_NOOP("Inline func.")}, {Attributes::INPUT_FUNC, QT_TR_NOOP("Input func.")}, - {Attributes::INTERNAL_LENGTH, QT_TR_NOOP("Internal length")}, {Attributes::INTERVAL_TYPE, QT_TR_NOOP("Interval type")}, - {Attributes::IO_CAST, QT_TR_NOOP("I/O cast")}, {Attributes::JOIN_FUNC, QT_TR_NOOP("Join func.")}, - {Attributes::LANGUAGE, QT_TR_NOOP("Language")}, {Attributes::LcCollate, QT_TR_NOOP("LC COLLATE")}, - {Attributes::LcCtype, QT_TR_NOOP("LC CTYPE")}, {Attributes::LEAKPROOF, QT_TR_NOOP("Leak proof")}, - {Attributes::LEFT_TYPE, QT_TR_NOOP("Left type")}, {Attributes::LENGTH, QT_TR_NOOP("Length")}, - {Attributes::LIBRARY, QT_TR_NOOP("Library")}, {Attributes::LOGIN, QT_TR_NOOP("Can login")}, + {Attributes::Hashes, QT_TR_NOOP("Hashes")}, {Attributes::IndexType, QT_TR_NOOP("Index type")}, + {Attributes::Inherit, QT_TR_NOOP("Inherit")}, {Attributes::InitialCond, QT_TR_NOOP("Ini. condition")}, + {Attributes::InlineFunc, QT_TR_NOOP("Inline func.")}, {Attributes::InputFunc, QT_TR_NOOP("Input func.")}, + {Attributes::InternalLength, QT_TR_NOOP("Internal length")}, {Attributes::IntervalType, QT_TR_NOOP("Interval type")}, + {Attributes::IoCast, QT_TR_NOOP("I/O cast")}, {Attributes::JoinFunc, QT_TR_NOOP("Join func.")}, + {Attributes::Language, QT_TR_NOOP("Language")}, {Attributes::LcCollate, QT_TR_NOOP("LC COLLATE")}, + {Attributes::LcCtype, QT_TR_NOOP("LC CTYPE")}, {Attributes::LeakProof, QT_TR_NOOP("Leak proof")}, + {Attributes::LeftType, QT_TR_NOOP("Left type")}, {Attributes::Length, QT_TR_NOOP("Length")}, + {Attributes::Library, QT_TR_NOOP("Library")}, {Attributes::LOGIN, QT_TR_NOOP("Can login")}, {Attributes::MATERIALIZED, QT_TR_NOOP("Materialized")}, {Attributes::MEMBER_ROLES, QT_TR_NOOP("Member roles")}, {Attributes::MERGES, QT_TR_NOOP("Merges")}, {Attributes::NAME, QT_TR_NOOP("Name")}, {Attributes::NEGATOR_OP, QT_TR_NOOP("Negator op.")}, {Attributes::NOT_NULL, QT_TR_NOOP("Not null")}, @@ -89,13 +89,13 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::VALIDITY, QT_TR_NOOP("Validity")}, {Attributes::WINDOW_FUNC, QT_TR_NOOP("Windows func.")}, {Attributes::False, QT_TR_NOOP("false")}, {Attributes::True, QT_TR_NOOP("true")}, {Attributes::Cache, QT_TR_NOOP("Cache value")}, {Attributes::Cycle, QT_TR_NOOP("Cycle")}, - {Attributes::INCREMENT, QT_TR_NOOP("Increment")}, {Attributes::MAX_VALUE, QT_TR_NOOP("Max. value")}, + {Attributes::Increment, QT_TR_NOOP("Increment")}, {Attributes::MAX_VALUE, QT_TR_NOOP("Max. value")}, {Attributes::MIN_VALUE, QT_TR_NOOP("Min. value")}, {Attributes::START, QT_TR_NOOP("Start value")}, - {Attributes::LAST_VALUE, QT_TR_NOOP("Last value")}, {Attributes::SUBTYPE, QT_TR_NOOP("Subtype")}, + {Attributes::LastValue, QT_TR_NOOP("Last value")}, {Attributes::SUBTYPE, QT_TR_NOOP("Subtype")}, {Attributes::OP_CLASS, QT_TR_NOOP("Op. class")}, {Attributes::CanonicalFunc, QT_TR_NOOP("Canonical func.")}, {Attributes::SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {Attributes::Deferrable, QT_TR_NOOP("Deferrable")}, {Attributes::PER_ROW, QT_TR_NOOP("For each row")}, {Attributes::FiringType, QT_TR_NOOP("Firing")}, - {Attributes::INS_EVENT, QT_TR_NOOP("On insert")}, {Attributes::DelEvent, QT_TR_NOOP("On delete")}, + {Attributes::InsEvent, QT_TR_NOOP("On insert")}, {Attributes::DelEvent, QT_TR_NOOP("On delete")}, {Attributes::UPD_EVENT, QT_TR_NOOP("On update")}, {Attributes::TRUNC_EVENT, QT_TR_NOOP("On truncate")}, {Attributes::Arguments, QT_TR_NOOP("Arguments")}, {Attributes::TABLE, QT_TR_NOOP("Table")}, {Attributes::TRIGGER_FUNC, QT_TR_NOOP("Trigger func.")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, @@ -109,7 +109,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::REF_TABLE, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SRC_COLUMNS, QT_TR_NOOP("Columns")}, {Attributes::UNIQUE, QT_TR_NOOP("Unique")}, {Attributes::PREDICATE, QT_TR_NOOP("Predicate")}, - {Attributes::Collations, QT_TR_NOOP("Collations")}, {Attributes::INHERITED, QT_TR_NOOP("Inherited")}, + {Attributes::Collations, QT_TR_NOOP("Collations")}, {Attributes::Inherited, QT_TR_NOOP("Inherited")}, {Attributes::ClientEncoding, QT_TR_NOOP("Client encoding")}, {Attributes::ConfigFile, QT_TR_NOOP("Configuration file")}, {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DynamicLibraryPath, QT_TR_NOOP("Dynamic library path")}, {Attributes::DynamicSharedMemory, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HbaFile, QT_TR_NOOP("Hba file")}, @@ -118,16 +118,16 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::SSL, QT_TR_NOOP("SSL")}, {Attributes::SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, {Attributes::SSL_CERT_FILE, QT_TR_NOOP("SSL cert file")}, {Attributes::SSL_CRL_FILE, QT_TR_NOOP("SSL crl file")}, {Attributes::SSL_KEY_FILE, QT_TR_NOOP("SSL key file")}, {Attributes::SERVER_VERSION, QT_TR_NOOP("Server version")}, - {Attributes::IDENT_FILE, QT_TR_NOOP("Ident file")}, {Attributes::PASSWORD_ENCRYPTION, QT_TR_NOOP("Password encryption")}, + {Attributes::IdentFile, QT_TR_NOOP("Ident file")}, {Attributes::PASSWORD_ENCRYPTION, QT_TR_NOOP("Password encryption")}, {Attributes::Connection, QT_TR_NOOP("Connection ID")}, {Attributes::SERVER_PID, QT_TR_NOOP("Server PID")}, {Attributes::SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {Attributes::REFERRERS, QT_TR_NOOP("Referrers")}, - {Attributes::IDENTITY_TYPE, QT_TR_NOOP("Identity")}, {Attributes::Command, QT_TR_NOOP("Command")}, + {Attributes::IdentityType, QT_TR_NOOP("Identity")}, {Attributes::Command, QT_TR_NOOP("Command")}, {Attributes::USING_EXP, QT_TR_NOOP("USING expr.")}, {Attributes::CheckExp, QT_TR_NOOP("CHECK expr.")}, {Attributes::ROLES, QT_TR_NOOP("Roles")}, {Attributes::RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, {Attributes::RLS_FORCED, QT_TR_NOOP("RLS forced")}, {Attributes::LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, {Attributes::LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {Attributes::LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {Attributes::TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {Attributes::TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, - {Attributes::TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {Attributes::IS_PARTITIONED, QT_TR_NOOP("Partitioned")}, + {Attributes::TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {Attributes::IsPartitioned, QT_TR_NOOP("Partitioned")}, {Attributes::PARTITIONED_TABLE, QT_TR_NOOP("Partition of")}, {Attributes::PARTITION_BOUND_EXPR, QT_TR_NOOP("Partition bound expr.")}, {Attributes::DeadRowsAmount, QT_TR_NOOP("Dead rows amount")}, {Attributes::PARTITION_KEY, QT_TR_NOOP("Partition keys")}, {Attributes::PARTITIONING, QT_TR_NOOP("Partitioning")} @@ -436,7 +436,7 @@ void DatabaseExplorerWidget::formatOidAttribs(attribs_map &attribs, QStringList void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { Attributes::IO_CAST }); + formatBooleanAttribs(attribs, { Attributes::IoCast }); formatOidAttribs(attribs, { Attributes::DestType, Attributes::SOURCE_TYPE }, ObjectType::Type, false); @@ -462,7 +462,7 @@ void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) attribs[Attributes::STATE_TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::STATE_TYPE]); attribs[Attributes::SORT_OP]=getObjectName(ObjectType::Operator, attribs[Attributes::SORT_OP]); - attribs[Attributes::INITIAL_COND]=Catalog::parseArrayValues(attribs[Attributes::INITIAL_COND]).join(ElemSeparator); + attribs[Attributes::InitialCond]=Catalog::parseArrayValues(attribs[Attributes::InitialCond]).join(ElemSeparator); } void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) @@ -471,7 +471,7 @@ void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) formatOidAttribs(attribs, { Attributes::VALIDATOR_FUNC, Attributes::HandlerFunc, - Attributes::INLINE_FUNC }, ObjectType::Function, false); + Attributes::InlineFunc }, ObjectType::Function, false); } void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) @@ -480,7 +480,7 @@ void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) Attributes::MEMBER_ROLES, Attributes::REF_ROLES }, ObjectType::Role, true); - formatBooleanAttribs(attribs, { Attributes::SUPERUSER, Attributes::INHERIT, + formatBooleanAttribs(attribs, { Attributes::SUPERUSER, Attributes::Inherit, Attributes::CreateRole, Attributes::CreateDb, Attributes::LOGIN, Attributes::Encrypted, Attributes::REPLICATION }); @@ -505,7 +505,7 @@ void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) { - attribs[Attributes::LANGUAGE]=getObjectName(ObjectType::Language, attribs[Attributes::LANGUAGE]); + attribs[Attributes::Language]=getObjectName(ObjectType::Language, attribs[Attributes::Language]); attribs[Attributes::RETURN_TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::RETURN_TYPE]); attribs[Attributes::ArgNames]=Catalog::parseArrayValues(attribs[Attributes::ArgNames]).join(ElemSeparator); attribs[Attributes::ArgModes]=Catalog::parseArrayValues(attribs[Attributes::ArgModes]).join(ElemSeparator); @@ -517,7 +517,7 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) .arg(attribs[Attributes::ArgTypes])).replace(ElemSeparator, QString(",")); formatBooleanAttribs(attribs, { Attributes::WINDOW_FUNC, - Attributes::LEAKPROOF, + Attributes::LeakProof, Attributes::RETURNS_SETOF }); } @@ -526,7 +526,7 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::Hashes, Attributes::MERGES }); - formatOidAttribs(attribs, { Attributes::LEFT_TYPE, + formatOidAttribs(attribs, { Attributes::LeftType, Attributes::RIGHT_TYPE}, ObjectType::Type, false); formatOidAttribs(attribs, { Attributes::CommutatorOp, @@ -534,11 +534,11 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) formatOidAttribs(attribs, { Attributes::OPERATOR_FUNC, Attributes::RESTRICTION_FUNC, - Attributes::JOIN_FUNC }, ObjectType::Function, false); + Attributes::JoinFunc }, ObjectType::Function, false); attribs[Attributes::SIGNATURE]=(QString("%1(%2,%3)") .arg(BaseObject::formatName(attribs[Attributes::NAME], true)) - .arg(attribs[Attributes::LEFT_TYPE]) + .arg(attribs[Attributes::LeftType]) .arg(attribs[Attributes::RIGHT_TYPE])).replace(ElemSeparator, QString(",")); } @@ -574,7 +574,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) QStringList owner_col, seq_values=Catalog::parseArrayValues(attribs[Attributes::Attribute]), seq_attrs={ Attributes::START, Attributes::MIN_VALUE, - Attributes::MAX_VALUE, Attributes::INCREMENT, + Attributes::MAX_VALUE, Attributes::Increment, Attributes::Cache, Attributes::Cycle }; QString sch_name=getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]); @@ -604,7 +604,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) conn.executeDMLCommand(QString("SELECT last_value FROM \"%1\".\"%2\"").arg(sch_name).arg(BaseObject::formatName(attribs[Attributes::NAME])), res); if(res.accessTuple(ResultSet::FirstTuple)) - attribs[Attributes::LAST_VALUE]=res.getColumnValue(QString("last_value")); + attribs[Attributes::LastValue]=res.getColumnValue(QString("last_value")); conn.close(); } @@ -628,7 +628,7 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) Attributes::Collatable, Attributes::PREFERRED }); formatOidAttribs(attribs, { Attributes::AnalyzeFunc, - Attributes::INPUT_FUNC, + Attributes::InputFunc, Attributes::OUTPUT_FUNC, Attributes::RECV_FUNC, Attributes::SEND_FUNC, @@ -714,7 +714,7 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::Constraint, Attributes::Deferrable, Attributes::PER_ROW, - Attributes::INS_EVENT, + Attributes::InsEvent, Attributes::DelEvent, Attributes::UPD_EVENT, Attributes::TRUNC_EVENT }); @@ -732,7 +732,7 @@ void DatabaseExplorerWidget::formatRuleAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatColumnAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::NOT_NULL, - Attributes::INHERITED }); + Attributes::Inherited }); attribs[Attributes::POSITION]=attribs[Attributes::OID]; attribs.erase(Attributes::OID); attribs.erase(Attributes::TYPE_OID); @@ -873,7 +873,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) { QStringList arg_types, names; QString type_name; - vector attrib_ids={ Attributes::LEFT_TYPE, Attributes::RIGHT_TYPE }; + vector attrib_ids={ Attributes::LeftType, Attributes::RIGHT_TYPE }; for(QString attr : attrib_ids) { @@ -1198,7 +1198,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i else if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); - attribs[Attributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[Attributes::NAME]).arg(aux_attribs[Attributes::INDEX_TYPE]); + attribs[Attributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[Attributes::NAME]).arg(aux_attribs[Attributes::IndexType]); } else { diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index a6f5788da6..9f818cf2a9 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -422,7 +422,7 @@ void DatabaseImportHelper::createConstraints(void) //Check constraints are created only if they are not inherited, other types are created normally if(attribs[Attributes::TYPE]!=Attributes::CkConstr || (attribs[Attributes::TYPE]==Attributes::CkConstr && - attribs[Attributes::INHERITED]!=Attributes::True)) + attribs[Attributes::Inherited]!=Attributes::True)) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2)...") @@ -1141,21 +1141,21 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) } //Case the function's language is C the symbol is the 'definition' attribute - if(getObjectName(attribs[Attributes::LANGUAGE])==~LanguageType("c")) + if(getObjectName(attribs[Attributes::Language])==~LanguageType("c")) { attribs[Attributes::SYMBOL]=attribs[Attributes::Definition]; attribs[Attributes::Definition]=QString(); } //Get the language reference code - attribs[Attributes::LANGUAGE]=getDependencyObject(attribs[Attributes::LANGUAGE], ObjectType::Language); + attribs[Attributes::Language]=getDependencyObject(attribs[Attributes::Language], ObjectType::Language); //Get the return type if there is no return table configured if(attribs[Attributes::RETURN_TABLE].isEmpty()) { /* If the function is to be used as a user-defined data type support functions the return type will be renamed to "any" (see rules on Type::setFunction()) */ - if(attribs[Attributes::REF_TYPE]==Attributes::INPUT_FUNC || + if(attribs[Attributes::REF_TYPE]==Attributes::InputFunc || attribs[Attributes::REF_TYPE]==Attributes::RECV_FUNC || attribs[Attributes::REF_TYPE]==Attributes::CanonicalFunc) attribs[Attributes::RETURN_TYPE]=PgSqlType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); @@ -1184,7 +1184,7 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) unsigned lang_oid, func_oid; QString func_types[]={ Attributes::VALIDATOR_FUNC, Attributes::HandlerFunc, - Attributes::INLINE_FUNC }; + Attributes::InlineFunc }; lang_oid=attribs[Attributes::OID].toUInt(); for(unsigned i=0; i < 3; i++) @@ -1324,9 +1324,9 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) func_types[]={ Attributes::OPERATOR_FUNC, Attributes::RESTRICTION_FUNC, - Attributes::JOIN_FUNC }, + Attributes::JoinFunc }, - arg_types[]= { Attributes::LEFT_TYPE, + arg_types[]= { Attributes::LeftType, Attributes::RIGHT_TYPE }, op_types[]= { Attributes::CommutatorOp, @@ -1439,7 +1439,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) QStringList owner_col=attribs[Attributes::OWNER_COLUMN].split(':'), seq_attribs=Catalog::parseArrayValues(attribs[Attributes::Attribute]); QString attr[]={ Attributes::START, Attributes::MIN_VALUE, - Attributes::MAX_VALUE, Attributes::INCREMENT, + Attributes::MAX_VALUE, Attributes::Increment, Attributes::Cache, Attributes::Cycle }; attribs[Attributes::OWNER_COLUMN]=QString(); @@ -1588,7 +1588,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) else { QString type_name=getObjectName(attribs[Attributes::OID]), - func_types[]={ Attributes::INPUT_FUNC, + func_types[]={ Attributes::InputFunc, Attributes::OUTPUT_FUNC, Attributes::RECV_FUNC, Attributes::SEND_FUNC, @@ -1669,7 +1669,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) !itr->second.at(Attributes::PERMISSION).isEmpty()) col_perms[tab_oid].push_back(itr->second[Attributes::OID].toUInt()); - if(itr->second[Attributes::INHERITED]==Attributes::True) + if(itr->second[Attributes::Inherited]==Attributes::True) inh_cols.push_back(col_idx); col.setName(itr->second[Attributes::NAME]); @@ -1724,8 +1724,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) col.setComment(itr->second[Attributes::Comment]); //Overriding the default value if the column is identity - if(!itr->second[Attributes::IDENTITY_TYPE].isEmpty()) - col.setIdentityType(itr->second[Attributes::IDENTITY_TYPE]); + if(!itr->second[Attributes::IdentityType].isEmpty()) + col.setIdentityType(itr->second[Attributes::IdentityType]); else { /* Removing extra/forced type casting in the retrieved default value. @@ -1797,7 +1797,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) } // Creating partition keys if present - if(attribs[Attributes::IS_PARTITIONED] == Attributes::True) + if(attribs[Attributes::IsPartitioned] == Attributes::True) { QStringList cols, collations, opclasses, exprs; PartitionKey part_key; @@ -2130,7 +2130,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) * and assigned to their exclude constraint elements. Column references are used in exclude elements but relying in * the cols list above */ exprs=attribs[Attributes::Expressions] - .replace(QString("EXCLUDE USING %1 (").arg(attribs[Attributes::INDEX_TYPE]), QString()) + .replace(QString("EXCLUDE USING %1 (").arg(attribs[Attributes::IndexType]), QString()) .split(QRegExp("(WITH )(\\+|\\-|\\*|\\/|\\<|\\>|\\=|\\~|\\!|\\@|\\#|\\%|\\^|\\&|\\||\\'|\\?)+((,)?|(\\))?)"), QString::SkipEmptyParts); @@ -2636,8 +2636,8 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f } else if(obj_type==ObjectType::Operator) { - if(obj_attr[Attributes::LEFT_TYPE].toUInt() > 0) - params.push_back(getType(obj_attr[Attributes::LEFT_TYPE], false)); + if(obj_attr[Attributes::LeftType].toUInt() > 0) + params.push_back(getType(obj_attr[Attributes::LeftType], false)); else params.push_back(QString("NONE")); @@ -2648,7 +2648,7 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f } else { - obj_name += QString(" USING %1").arg(obj_attr[Attributes::INDEX_TYPE]); + obj_name += QString(" USING %1").arg(obj_attr[Attributes::IndexType]); } if(obj_type != ObjectType::OpFamily && obj_type != ObjectType::OpClass) diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index becabee1cd..da719cdc0a 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -110,7 +110,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::CodeFont]=QString(); config_params[Attributes::Configuration][Attributes::CodeFontSize]=QString(); config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=QString(); - config_params[Attributes::Configuration][Attributes::INVERT_RANGESEL_TRIGGER]=QString(); + config_params[Attributes::Configuration][Attributes::InvertRangeSelTrigger]=QString(); config_params[Attributes::Configuration][Attributes::CheckUpdate]=QString(); config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]=QString(); config_params[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]=QString(); @@ -126,7 +126,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::HighlightLines]=QString(); config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=QString(); config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY]=QString(); - config_params[Attributes::Configuration][Attributes::HISTORY_MAX_LENGTH]=QString(); + config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString(); config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]=QString(); config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]=QString(); config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=QString(); @@ -268,12 +268,12 @@ void GeneralConfigWidget::loadConfiguration(void) for(QWidget *wgt : child_wgts) wgt->blockSignals(true); - key_attribs.push_back(Attributes::ID); + key_attribs.push_back(Attributes::Id); BaseConfigWidget::loadConfiguration(GlobalAttributes::GeneralConf, config_params, key_attribs); grid_size_spb->setValue((config_params[Attributes::Configuration][Attributes::GridSize]).toUInt()); oplist_size_spb->setValue((config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]).toUInt()); - history_max_length_spb->setValue(config_params[Attributes::Configuration][Attributes::HISTORY_MAX_LENGTH].toUInt()); + history_max_length_spb->setValue(config_params[Attributes::Configuration][Attributes::HistoryMaxLength].toUInt()); interv=(config_params[Attributes::Configuration][Attributes::AutoSaveInterval]).toUInt(); tab_width=(config_params[Attributes::Configuration][Attributes::CodeTabWidth]).toInt(); @@ -287,7 +287,7 @@ void GeneralConfigWidget::loadConfiguration(void) tab_width_spb->setValue(tab_width); corner_move_chk->setChecked(config_params[Attributes::Configuration][Attributes::CanvasCornerMove]==Attributes::True); - invert_rangesel_chk->setChecked(config_params[Attributes::Configuration][Attributes::INVERT_RANGESEL_TRIGGER]==Attributes::True); + invert_rangesel_chk->setChecked(config_params[Attributes::Configuration][Attributes::InvertRangeSelTrigger]==Attributes::True); check_upd_chk->setChecked(config_params[Attributes::Configuration][Attributes::CheckUpdate]==Attributes::True); save_last_pos_chk->setChecked(config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]==Attributes::True); disable_smooth_chk->setChecked(config_params[Attributes::Configuration][Attributes::DisableSmoothness]==Attributes::True); @@ -302,7 +302,7 @@ void GeneralConfigWidget::loadConfiguration(void) paper_cmb->setCurrentIndex((config_params[Attributes::Configuration][Attributes::PAPER_TYPE]).toUInt()); portrait_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::PORTRAIT); - landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::LANDSCAPE); + landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::Landscape); min_obj_opacity_spb->setValue(config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY].toUInt()); @@ -470,9 +470,9 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]=QString::number(oplist_size_spb->value()); config_params[Attributes::Configuration][Attributes::AutoSaveInterval]=QString::number(autosave_interv_chk->isChecked() ? autosave_interv_spb->value() : 0); config_params[Attributes::Configuration][Attributes::PAPER_TYPE]=QString::number(paper_cmb->currentIndex()); - config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]=(portrait_rb->isChecked() ? Attributes::PORTRAIT : Attributes::LANDSCAPE); + config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]=(portrait_rb->isChecked() ? Attributes::PORTRAIT : Attributes::Landscape); config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=(corner_move_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::INVERT_RANGESEL_TRIGGER]=(invert_rangesel_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::InvertRangeSelTrigger]=(invert_rangesel_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CheckUpdate]=(check_upd_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]=(save_last_pos_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::DisableSmoothness]=(disable_smooth_chk->isChecked() ? Attributes::True : QString()); @@ -482,7 +482,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::CodeTabWidth]=QString::number(tab_width_chk->isChecked() ? tab_width_spb->value() : 0); config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY]=QString::number(min_obj_opacity_spb->value()); config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::HISTORY_MAX_LENGTH]=QString::number(history_max_length_spb->value()); + config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString::number(history_max_length_spb->value()); config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? Attributes::True : QString()); ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); @@ -567,7 +567,7 @@ void GeneralConfigWidget::saveConfiguration(void) { for(auto &itr : widgets_geom) { - attribs[Attributes::ID] = itr.first; + attribs[Attributes::Id] = itr.first; attribs[Attributes::X_POS] = QString::number(itr.second.geometry.left()); attribs[Attributes::Y_POS] = QString::number(itr.second.geometry.top()); attribs[Attributes::WIDTH] = QString::number(itr.second.geometry.width()); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 74c4740711..5a39da9846 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -676,7 +676,7 @@ void MainWindow::closeEvent(QCloseEvent *event) if(!model->getFilename().isEmpty()) { param_id=QString("%1%2").arg(Attributes::File).arg(i); - attribs[Attributes::ID]=param_id; + attribs[Attributes::Id]=param_id; attribs[Attributes::PATH]=model->getFilename(); conf_wgt->addConfigurationParam(param_id, attribs); attribs.clear(); @@ -693,7 +693,7 @@ void MainWindow::closeEvent(QCloseEvent *event) while(!recent_models.isEmpty()) { param_id=QString("%1%2").arg(Attributes::RECENT).arg(QString::number(i++).rightJustified(2, '0')); - attribs[Attributes::ID]=param_id; + attribs[Attributes::Id]=param_id; attribs[Attributes::PATH]=recent_models.front(); conf_wgt->addConfigurationParam(param_id, attribs); attribs.clear(); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index b21107a8ab..7579324c00 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -269,7 +269,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr if(tab_obj && tab_obj->isAddedByRelationship()) { font.setItalic(true); - item->setForeground(0,BaseObjectView::getFontStyle(Attributes::INH_COLUMN).foreground()); + item->setForeground(0,BaseObjectView::getFontStyle(Attributes::InhColumn).foreground()); } else if(object->isProtected() || object->isSystemObject()) { diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index f0dc530cee..f92a9c5e0e 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -369,7 +369,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vector(objs[i])->isAddedByRelationship()) { fnt.setItalic(true); - tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::INH_COLUMN).foreground()); + tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::InhColumn).foreground()); } else { diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 9fe537b150..aa326838b9 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -24,7 +24,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob QFrame *frame=nullptr; QCheckBox *check=nullptr; unsigned i; - QString privs[]={ Attributes::SELECT_PRIV, Attributes::INSERT_PRIV, + QString privs[]={ Attributes::SELECT_PRIV, Attributes::InsertPriv, Attributes::UPDATE_PRIV, Attributes::DeletePriv, Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index f1ac770d6d..b57e0ce817 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -112,7 +112,7 @@ QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) for(auto &snip : config_params) { if(snip.second[Attributes::OBJECT]==type_name) - ids.push_back(snip.second[Attributes::ID]); + ids.push_back(snip.second[Attributes::Id]); } return(ids); @@ -213,20 +213,20 @@ void SnippetsConfigWidget::fillSnippetsCombo(map &config) snippets_cmb->clear(); for(auto &cfg : config) - snippets_cmb->addItem(QString("[%1] %2").arg(cfg.first, cfg.second.at(Attributes::LABEL)), cfg.first); + snippets_cmb->addItem(QString("[%1] %2").arg(cfg.first, cfg.second.at(Attributes::Label)), cfg.first); } bool SnippetsConfigWidget::isSnippetValid(attribs_map &attribs, const QString &orig_id) { Messagebox msg_box; - QString snip_id=attribs.at(Attributes::ID), + QString snip_id=attribs.at(Attributes::Id), err_msg; if(!orig_id.isEmpty() && snip_id!=orig_id && config_params.count(snip_id)!=0) err_msg=trUtf8("Duplicated snippet id %1 detected. Please, specify a different one!").arg(snip_id); else if(!IdFormatRegExp.exactMatch(snip_id)) err_msg=trUtf8("Invalid ID pattern detected %1. This one must start with at leat one letter and be composed by letters, numbers and/or underscore!").arg(snip_id); - else if(attribs[Attributes::LABEL].isEmpty()) + else if(attribs[Attributes::Label].isEmpty()) err_msg=trUtf8("Empty label for snippet %1. Please, specify a value for it!").arg(snip_id); else if(attribs[Attributes::Contents].isEmpty()) err_msg=trUtf8("Empty code for snippet %1. Please, specify a value for it!").arg(snip_id); @@ -270,7 +270,7 @@ void SnippetsConfigWidget::loadConfiguration(void) QStringList inv_snippets; this->resetForm(); - BaseConfigWidget::loadConfiguration(GlobalAttributes::SnippetsConf, config_params, { Attributes::ID }); + BaseConfigWidget::loadConfiguration(GlobalAttributes::SnippetsConf, config_params, { Attributes::Id }); //Check if there are invalid snippets loaded for(auto &snip : config_params) @@ -308,8 +308,8 @@ attribs_map SnippetsConfigWidget::getSnippetAttributes(void) if(object_id.isEmpty()) object_id=Attributes::General; - return(attribs_map{ {Attributes::ID, id_edt->text()}, - {Attributes::LABEL, label_edt->text()}, + return(attribs_map{ {Attributes::Id, id_edt->text()}, + {Attributes::Label, label_edt->text()}, {Attributes::OBJECT, object_id}, {Attributes::PARSABLE, (parsable_chk->isChecked() ? Attributes::True : Attributes::False)}, {Attributes::PLACEHOLDERS, (parsable_chk->isChecked() && placeholders_chk->isChecked() ? @@ -325,7 +325,7 @@ void SnippetsConfigWidget::editSnippet(void) enableEditMode(true); snippet_txt->setPlainText(config_params[snip_id].at(Attributes::Contents)); id_edt->setText(snip_id); - label_edt->setText(config_params[snip_id].at(Attributes::LABEL)); + label_edt->setText(config_params[snip_id].at(Attributes::Label)); parsable_chk->setChecked(config_params[snip_id].at(Attributes::PARSABLE)==Attributes::True); placeholders_chk->setChecked(config_params[snip_id].at(Attributes::PLACEHOLDERS)==Attributes::True); applies_to_cmb->setCurrentText(BaseObject::getTypeName(obj_type)); @@ -521,7 +521,7 @@ void SnippetsConfigWidget::configureSnippetsMenu(QMenu *snip_menu, vectorsetToolTip(snip[Attributes::LABEL]); + act->setToolTip(snip[Attributes::Label]); submenus[object]->addAction(act); } diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 92cd421163..4f7b51574c 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -400,7 +400,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) xmlparser.getElementAttributes(attribs); word_delimiters=attribs[Attributes::VALUE]; } - else if(elem==Attributes::IGNORED_CHARS) + else if(elem==Attributes::IgnoredChars) { xmlparser.getElementAttributes(attribs); ignored_chars=attribs[Attributes::VALUE]; @@ -418,7 +418,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) the groups used to highlight the source code. ALL groups in this block must be declared before they are built otherwise an error will be triggered. */ - else if(elem==Attributes::HIGHLIGHT_ORDER) + else if(elem==Attributes::HighlightOrder) { //Marks a flag indication that groups are being declared groups_decl=true; @@ -446,7 +446,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) else if(attribs.size() > 1 || xmlparser.hasElement(XmlParser::ChildElement)) { throw Exception(Exception::getErrorMessage(ErrorCode::InvGroupDeclaration) - .arg(group).arg(Attributes::HIGHLIGHT_ORDER), + .arg(group).arg(Attributes::HighlightOrder), ErrorCode::InvRedeclarationGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -465,7 +465,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) else if(find(groups_order.begin(), groups_order.end(), group)==groups_order.end()) { throw Exception(Exception::getErrorMessage(ErrorCode::DefNotDeclaredGroup) - .arg(group).arg(Attributes::HIGHLIGHT_ORDER), + .arg(group).arg(Attributes::HighlightOrder), ErrorCode::DefNotDeclaredGroup,__PRETTY_FUNCTION__,__FILE__,__LINE__); } //Raises an error if the group does not have children element @@ -476,7 +476,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) } chr_sensitive=(attribs[Attributes::CaseSensitive]==Attributes::True); - italic=(attribs[Attributes::ITALIC]==Attributes::True); + italic=(attribs[Attributes::Italic]==Attributes::True); bold=(attribs[Attributes::Bold]==Attributes::True); underline=(attribs[Attributes::UNDERLINE]==Attributes::True); partial_match=(attribs[Attributes::PARTIAL_MATCH]==Attributes::True); @@ -533,7 +533,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) if(expr_type.isEmpty() || expr_type==Attributes::SIMPLE_EXP || - expr_type==Attributes::INITIAL_EXP) + expr_type==Attributes::InitialExp) initial_exprs[group].push_back(regexp); else final_exprs[group].push_back(regexp); diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 16e9c928da..ebe7bb2042 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1496,8 +1496,8 @@ bool PgModelerCli::containsRelAttributes(const QString &str) Attributes::TYPE, Attributes::SRC_REQUIRED, Attributes::DstRequired, Attributes::SRC_TABLE, Attributes::DstTable, Attributes::POINTS, Attributes::Columns, Attributes::Column, Attributes::Constraint, - Attributes::LABEL, Attributes::LINE, Attributes::POSITION, - Attributes::IDENTIFIER, Attributes::Deferrable, Attributes::DeferType, + Attributes::Label, Attributes::Line, Attributes::POSITION, + Attributes::Identifier, Attributes::Deferrable, Attributes::DeferType, Attributes::TABLE_NAME, Attributes::SPECIAL_PK_COLS, Attributes::TABLE, Attributes::AncestorTable, Attributes::CopyOptions, Attributes::CopyMode, Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, Attributes::PK_PATTERN, @@ -1564,7 +1564,7 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) attribs[Attributes::WORKING_DIR]=QStandardPaths::writableLocation(QStandardPaths::HomeLocation); attribs[Attributes::Application]=(QFileInfo(startup_script).exists() ? startup_script : GlobalAttributes::PgModelerAppPath); - attribs[Attributes::ICON]=exec_icon; + attribs[Attributes::Icon]=exec_icon; } try @@ -1593,7 +1593,7 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) out.write(buf.data(), buf.size()); out.close(); buf.clear(); - attribs[Attributes::ICON]=dbm_icon; + attribs[Attributes::Icon]=dbm_icon; } } From 1b0ff0b1f6ff50f5b85652159f5f1b4237b7a995 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 10:28:13 -0300 Subject: [PATCH 183/425] Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 18 +- libobjrenderer/src/objectsscene.cpp | 4 +- libobjrenderer/src/relationshipview.cpp | 16 +- libobjrenderer/src/tableobjectview.cpp | 6 +- libobjrenderer/src/textboxview.cpp | 4 +- libparsers/src/attributes.cpp | 98 ++++----- libparsers/src/attributes.h | 98 ++++----- libpgconnector/src/catalog.cpp | 30 +-- libpgmodeler/src/baseobject.cpp | 10 +- libpgmodeler/src/baserelationship.cpp | 2 +- libpgmodeler/src/basetable.cpp | 2 +- libpgmodeler/src/collation.cpp | 6 +- libpgmodeler/src/column.cpp | 26 +-- libpgmodeler/src/constraint.cpp | 4 +- libpgmodeler/src/databasemodel.cpp | 186 +++++++++--------- libpgmodeler/src/domain.cpp | 20 +- libpgmodeler/src/element.cpp | 2 +- libpgmodeler/src/extension.cpp | 12 +- libpgmodeler/src/index.cpp | 2 +- libpgmodeler/src/operator.cpp | 8 +- libpgmodeler/src/parameter.cpp | 4 +- libpgmodeler/src/permission.cpp | 6 +- libpgmodeler/src/pgsqltypes.cpp | 2 +- libpgmodeler/src/role.cpp | 10 +- libpgmodeler/src/sequence.cpp | 12 +- libpgmodeler/src/table.cpp | 18 +- libpgmodeler/src/trigger.cpp | 12 +- libpgmodeler/src/typeattribute.cpp | 4 +- libpgmodeler/src/view.cpp | 6 +- .../src/appearanceconfigwidget.cpp | 12 +- .../src/databaseexplorerwidget.cpp | 136 ++++++------- libpgmodeler_ui/src/databaseimportform.cpp | 18 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 128 ++++++------ libpgmodeler_ui/src/datamanipulationform.cpp | 48 ++--- libpgmodeler_ui/src/generalconfigwidget.cpp | 30 +-- libpgmodeler_ui/src/mainwindow.cpp | 16 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 4 +- .../src/relationshipconfigwidget.cpp | 20 +- libpgmodeler_ui/src/resultsetmodel.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 12 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 6 +- libpgmodeler_ui/src/updatenotifierwidget.cpp | 2 +- 44 files changed, 533 insertions(+), 533 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index a3e2d84863..23121f3a9a 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -253,7 +253,7 @@ void BaseObjectView::loadObjectsStyle(void) (itr->second).setFont(font); (itr->second).setForeground(QColor(attribs[Attributes::Color])); } - else if(elem==Attributes::OBJECT) + else if(elem==Attributes::Object) { list=attribs[Attributes::FillColor].split(','); @@ -343,7 +343,7 @@ QLinearGradient BaseObjectView::getFillStyle(const QString &id) if(!colors.empty()) { - if(id==Attributes::OBJ_SELECTION || id==Attributes::PLACEHOLDER) + if(id==Attributes::ObjSelection || id==Attributes::PLACEHOLDER) { colors[0].setAlpha(ObjectAlphaChannel); colors[1].setAlpha(ObjectAlphaChannel); @@ -369,7 +369,7 @@ QPen BaseObjectView::getBorderStyle(const QString &id) if(!colors.empty()) { - if(id==Attributes::OBJ_SELECTION) + if(id==Attributes::ObjSelection) colors[2].setAlpha(ObjectAlphaChannel); pen.setWidthF(ObjectBorderWidth); @@ -532,8 +532,8 @@ void BaseObjectView::configureObjectSelection(void) rect_item->setRect(this->boundingRect()); rect_item->setPos(0,0); rect_item->setBorderRadius(5); - rect_item->setBrush(this->getFillStyle(Attributes::OBJ_SELECTION)); - rect_item->setPen(this->getBorderStyle(Attributes::OBJ_SELECTION)); + rect_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); + rect_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); } } @@ -562,8 +562,8 @@ void BaseObjectView::configureProtectedIcon(void) pol_item=dynamic_cast(protected_icon->childItems().at(0)); pol_item->setPolygon(pol); - pol_item->setBrush(this->getFillStyle(Attributes::LOCKER_ARC)); - pol_item->setPen(this->getBorderStyle(Attributes::LOCKER_ARC)); + pol_item->setBrush(this->getFillStyle(Attributes::LockerArc)); + pol_item->setPen(this->getBorderStyle(Attributes::LockerArc)); pol.clear(); pol.append(QPointF(1,5)); pol.append(QPointF(10,5)); @@ -577,8 +577,8 @@ void BaseObjectView::configureProtectedIcon(void) pol_item=dynamic_cast(protected_icon->childItems().at(1)); pol_item->setPolygon(pol); - pol_item->setBrush(this->getFillStyle(Attributes::LOCKER_BODY)); - pol_item->setPen(this->getBorderStyle(Attributes::LOCKER_BODY)); + pol_item->setBrush(this->getFillStyle(Attributes::LockerBody)); + pol_item->setPen(this->getBorderStyle(Attributes::LockerBody)); } } diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 86b75bdee2..6f46650a17 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -825,8 +825,8 @@ void ObjectsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) pol.append(QPointF(event->scenePos().x(), event->scenePos().y())); pol.append(QPointF(sel_ini_pnt.x(), event->scenePos().y())); selection_rect->setPolygon(pol); - selection_rect->setBrush(BaseObjectView::getFillStyle(Attributes::OBJ_SELECTION)); - selection_rect->setPen(BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION)); + selection_rect->setBrush(BaseObjectView::getFillStyle(Attributes::ObjSelection)); + selection_rect->setPen(BaseObjectView::getBorderStyle(Attributes::ObjSelection)); } } } diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 9a3d4bf3d0..cd3bbf9cec 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -253,7 +253,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant if(value.toBool()) { - QColor cor1=BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION).color(), + QColor cor1=BaseObjectView::getBorderStyle(Attributes::ObjSelection).color(), cor2=line_color; color.setRedF((cor1.redF() + cor2.greenF())/2.0f); @@ -288,7 +288,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant { vector lines; QVector grad_stops = descriptor->brush().gradient()->stops(); - QColor sel_color = BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION).color(); + QColor sel_color = BaseObjectView::getBorderStyle(Attributes::ObjSelection).color(); QLinearGradient grad(QPointF(0,0),QPointF(0,1)); int color_id = 0; @@ -812,8 +812,8 @@ void RelationshipView::configureLine(void) graph_points.push_back(pol); pol->setZValue(0); pol->setPolygon(pol_aux); - pol->setBrush(BaseObjectView::getFillStyle(Attributes::OBJ_SELECTION)); - pol->setPen(BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION)); + pol->setBrush(BaseObjectView::getFillStyle(Attributes::ObjSelection)); + pol->setPen(BaseObjectView::getBorderStyle(Attributes::ObjSelection)); this->addToGroup(pol); } else @@ -1415,8 +1415,8 @@ void RelationshipView::configureDescriptor(void) pol_item->setPolygon(pol); pol_item->setTransformOriginPoint(obj_selection->boundingRect().center()); pol_item->setPos(x,y); - pol_item->setBrush(this->getFillStyle(Attributes::OBJ_SELECTION)); - pol_item->setPen(this->getBorderStyle(Attributes::OBJ_SELECTION)); + pol_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); + pol_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); pol_item=dynamic_cast(obj_shadow); pol_item->setPolygon(pol); @@ -1777,8 +1777,8 @@ void RelationshipView::configureAttributes(void) lin->setPen(descriptor->pen()); text->setBrush(fmt.foreground()); text->setFont(font); - sel_attrib->setPen(BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION)); - sel_attrib->setBrush(BaseObjectView::getFillStyle(Attributes::OBJ_SELECTION)); + sel_attrib->setPen(BaseObjectView::getBorderStyle(Attributes::ObjSelection)); + sel_attrib->setBrush(BaseObjectView::getFillStyle(Attributes::ObjSelection)); attrib->setPos(px, py); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index e609af5a4e..dd15d9da36 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -98,7 +98,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0f * factor, 9.0f * factor))); if(column->isNotNull()) - attrib=Attributes::NN_COLUMN; + attrib=Attributes::NnColumn; else attrib=Attributes::Column; @@ -223,7 +223,7 @@ void TableObjectView::configureObject(void) constr_type=ConstraintType::Unique; } else if(str_constr.indexOf(TextNotNull)>=0) - fmt=font_config[Attributes::NN_COLUMN]; + fmt=font_config[Attributes::NnColumn]; else fmt=font_config[Attributes::Column]; @@ -277,7 +277,7 @@ void TableObjectView::configureObject(void) px+=lables[0]->boundingRect().width(); //Configuring the type label - fmt=font_config[Attributes::OBJECT_TYPE]; + fmt=font_config[Attributes::ObjectType]; if(compact_view) lables[1]->setText(" "); diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index aeaad506b3..a8c3c7e5da 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -149,6 +149,6 @@ void TextboxView::configureObjectSelection(void) pol_item->setPolygon(box->polygon()); pol_item->setPos(0,0); - pol_item->setBrush(this->getFillStyle(Attributes::OBJ_SELECTION)); - pol_item->setPen(this->getBorderStyle(Attributes::OBJ_SELECTION)); + pol_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); + pol_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); } diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 907f89ce0e..b3a2f8cb9c 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -287,55 +287,55 @@ namespace Attributes { Library=QString("library"), LikeType=QString("like-type"), Line=QString("line"), - LINE_NUMBERS_COLOR=QString("line-numbers-color"), - LINE_NUMBERS_BG_COLOR=QString("line-numbers-bg-color"), - LINE_HIGHLIGHT_COLOR=QString("line-highlight-color"), - LISTEN_ADDRESSES=QString("listen-addresses"), - LOCALE=QString("locale"), - LOCKER_ARC=QString("locker-arc"), - LOCKER_BODY=QString("locker-body"), - LOGIN=QString("login"), - LOOKAHEAD_CHAR=QString("lookahead-char"), - MATERIALIZED=QString("materialized"), - MAX_CONNECTIONS=QString("max-connections"), - MAX_OBJ_COUNT=QString("max-obj-count"), - MAX_VALUE=QString("max-value"), - MAXIMIZED=QString("maximized"), - MEMBER_ROLES=QString("member-roles"), - MEMBER=QString("member"), - MERGES=QString("merges"), - METADATA=QString("metadata"), - MIN_OBJECT_OPACITY=QString("min-object-opacity"), - MIN_VALUE=QString("min-value"), - MODE=QString("mode"), - MODEL_AUTHOR=QString("author"), - NAME_LABEL=QString("name-label"), - NAME_PATTERNS=QString("name-patterns"), - NAME=QString("name"), - NAMES=QString("names"), - NEGATOR_OP=QString("negator-op"), - NEW_NAME=QString("new-name"), - NEW_TABLE_NAME=QString("new-table-name"), - NEW_IDENTITY_TYPE=QString("new-identity-type"), - NEW_VERSION=QString("new-version"), - NN_COLUMN=QString("nn-column"), - NO_INHERIT=QString("no-inherit"), - NONE=QString("none"), - NOT_EXT_OBJECT=QString("not-ext-object"), - NOT_NULL=QString("not-null"), - NULLS_FIRST=QString("nulls-first"), - OBJ_SELECTION=QString("obj-selection"), - OBJECT_ID=QString("object-id"), - OBJECT_FINDER=QString("objectfinder"), - OBJECT_TYPE=QString("object-type"), - OBJECT=QString("object"), - OBJECTS=QString("objects"), - OID_FILTER_OP=QString("oid-filter-op"), - OID=QString("oid"), - OIDS=QString("oids"), - OLD_NAME=QString("old-name"), - OLD_TABLE_NAME=QString("old-table-name"), - OLD_VERSION=QString("old-version"), + LineNumbersColor=QString("line-numbers-color"), + LineNumbersBgColor=QString("line-numbers-bg-color"), + LineHighlightColor=QString("line-highlight-color"), + ListenAddresses=QString("listen-addresses"), + Locale=QString("locale"), + LockerArc=QString("locker-arc"), + LockerBody=QString("locker-body"), + Login=QString("login"), + LookaheadChar=QString("lookahead-char"), + Materialized=QString("materialized"), + MaxConnections=QString("max-connections"), + MaxObjCount=QString("max-obj-count"), + MaxValue=QString("max-value"), + Maximized=QString("maximized"), + MemberRoles=QString("member-roles"), + Member=QString("member"), + Merges=QString("merges"), + Metadata=QString("metadata"), + MinObjectOpacity=QString("min-object-opacity"), + MinValue=QString("min-value"), + Mode=QString("mode"), + ModelAuthor=QString("author"), + NameLabel=QString("name-label"), + NamePatterns=QString("name-patterns"), + Name=QString("name"), + Names=QString("names"), + NegatorOp=QString("negator-op"), + NewName=QString("new-name"), + NewTableName=QString("new-table-name"), + NewIdentityType=QString("new-identity-type"), + NewVersion=QString("new-version"), + NnColumn=QString("nn-column"), + NoInherit=QString("no-inherit"), + None=QString("none"), + NotExtObject=QString("not-ext-object"), + NotNull=QString("not-null"), + NullsFirst=QString("nulls-first"), + ObjSelection=QString("obj-selection"), + ObjectId=QString("object-id"), + ObjectFinder=QString("objectfinder"), + ObjectType=QString("object-type"), + Object=QString("object"), + Objects=QString("objects"), + OidFilterOp=QString("oid-filter-op"), + Oid=QString("oid"), + Oids=QString("oids"), + OldName=QString("old-name"), + OldTableName=QString("old-table-name"), + OldVersion=QString("old-version"), OP_CLASS=QString("opclass"), OP_CLASSES=QString("opclasses"), OP_FAMILY=QString("opfamily"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index c4f5cb4521..f14869dd60 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -299,55 +299,55 @@ namespace Attributes { Library, LikeType, Line, - LINE_NUMBERS_COLOR, - LINE_NUMBERS_BG_COLOR, - LINE_HIGHLIGHT_COLOR, - LISTEN_ADDRESSES, - LOCALE, - LOCKER_ARC, - LOCKER_BODY, - LOGIN, - LOOKAHEAD_CHAR, - MATERIALIZED, - MAX_CONNECTIONS, - MAX_OBJ_COUNT, - MAX_VALUE, - MAXIMIZED, - MEMBER_ROLES, - MEMBER, - MERGES, - METADATA, - MIN_OBJECT_OPACITY, - MIN_VALUE, - MODE, - MODEL_AUTHOR, - NAME_LABEL, - NAME_PATTERNS, - NAME, - NAMES, - NEGATOR_OP, - NEW_NAME, - NEW_TABLE_NAME, - NEW_IDENTITY_TYPE, - NEW_VERSION, - NN_COLUMN, - NO_INHERIT, - NONE, - NOT_EXT_OBJECT, - NOT_NULL, - NULLS_FIRST, - OBJ_SELECTION, - OBJECT_ID, - OBJECT_FINDER, - OBJECT_TYPE, - OBJECT, - OBJECTS, - OID_FILTER_OP, - OID, - OIDS, - OLD_NAME, - OLD_TABLE_NAME, - OLD_VERSION, + LineNumbersColor, + LineNumbersBgColor, + LineHighlightColor, + ListenAddresses, + Locale, + LockerArc, + LockerBody, + Login, + LookaheadChar, + Materialized, + MaxConnections, + MaxObjCount, + MaxValue, + Maximized, + MemberRoles, + Member, + Merges, + Metadata, + MinObjectOpacity, + MinValue, + Mode, + ModelAuthor, + NameLabel, + NamePatterns, + Name, + Names, + NegatorOp, + NewName, + NewTableName, + NewIdentityType, + NewVersion, + NnColumn, + NoInherit, + None, + NotExtObject, + NotNull, + NullsFirst, + ObjSelection, + ObjectId, + ObjectFinder, + ObjectType, + Object, + Objects, + OidFilterOp, + Oid, + Oids, + OldName, + OldTableName, + OldVersion, OP_CLASS, OP_CLASSES, OP_FAMILY, diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 4135169234..a438678da3 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -85,7 +85,7 @@ void Catalog::setConnection(Connection &conn) //Retrieving the last system oid executeCatalogQuery(QueryList, ObjectType::Database, res, true, - {{Attributes::NAME, conn.getConnectionParam(Connection::ParamDbName)}}); + {{Attributes::Name, conn.getConnectionParam(Connection::ParamDbName)}}); if(res.accessTuple(ResultSet::FirstTuple)) { @@ -193,9 +193,9 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b attribs[Attributes::LastSysOid]=QString("%1").arg(last_sys_oid); if(list_only_sys_objs) - attribs[Attributes::OID_FILTER_OP]=QString("<="); + attribs[Attributes::OidFilterOp]=QString("<="); else - attribs[Attributes::OID_FILTER_OP]=QString(">"); + attribs[Attributes::OidFilterOp]=QString(">"); if(obj_type==ObjectType::Type && exclude_array_types) attribs[Attributes::ExcBuiltinArrays]=Attributes::True; @@ -210,9 +210,9 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b if(exclude_ext_objs && obj_type!=ObjectType::Database && obj_type!=ObjectType::Role && obj_type!=ObjectType::Tablespace && obj_type!=ObjectType::Extension) { if(ext_oid_fields.count(obj_type)==0) - attribs[Attributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(oid_fields[obj_type]); + attribs[Attributes::NotExtObject]=getNotExtObjectQuery(oid_fields[obj_type]); else - attribs[Attributes::NOT_EXT_OBJECT]=getNotExtObjectQuery(ext_oid_fields[obj_type]); + attribs[Attributes::NotExtObject]=getNotExtObjectQuery(ext_oid_fields[obj_type]); } loadCatalogQuery(BaseObject::getSchemaName(obj_type)); @@ -341,7 +341,7 @@ attribs_map Catalog::getObjectsNames(ObjectType obj_type, const QString &sch_nam { do { - objects[res.getColumnValue(Attributes::OID)]=res.getColumnValue(Attributes::NAME); + objects[res.getColumnValue(Attributes::Oid)]=res.getColumnValue(Attributes::Name); } while(res.accessTuple(ResultSet::NextTuple)); } @@ -398,9 +398,9 @@ vector Catalog::getObjectsNames(vector obj_types, const { do { - attribs[Attributes::OID]=res.getColumnValue(Attributes::OID); - attribs[Attributes::NAME]=res.getColumnValue(Attributes::NAME); - attribs[Attributes::OBJECT_TYPE]=res.getColumnValue(QString("object_type")); + attribs[Attributes::Oid]=res.getColumnValue(Attributes::Oid); + attribs[Attributes::Name]=res.getColumnValue(Attributes::Name); + attribs[Attributes::ObjectType]=res.getColumnValue(QString("object_type")); objects.push_back(attribs); attribs.clear(); } @@ -423,7 +423,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, attribs_map obj_attribs; //Add the name of the object as extra attrib in order to retrieve the data only for it - extra_attribs[Attributes::NAME]=obj_name; + extra_attribs[Attributes::Name]=obj_name; executeCatalogQuery(QueryAttribs, obj_type, res, true, extra_attribs); if(res.accessTuple(ResultSet::FirstTuple)) @@ -431,7 +431,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, /* Insert the object type as an attribute of the query result to facilitate the import process on the classes that uses the Catalog */ - obj_attribs[Attributes::OBJECT_TYPE]=QString("%1").arg(~obj_type); + obj_attribs[Attributes::ObjectType]=QString("%1").arg(~obj_type); return(obj_attribs); } @@ -458,7 +458,7 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ /* Insert the object type as an attribute of the query result to facilitate the import process on the classes that uses the Catalog */ - tuple[Attributes::OBJECT_TYPE]=QString("%1").arg(~obj_type); + tuple[Attributes::ObjectType]=QString("%1").arg(~obj_type); obj_attribs.push_back(tuple); tuple.clear(); @@ -514,7 +514,7 @@ QString Catalog::getCommentQuery(const QString &oid_field, bool is_shared_obj) try { - attribs_map attribs={{Attributes::OID, oid_field}, + attribs_map attribs={{Attributes::Oid, oid_field}, {Attributes::SHARED_OBJ, (is_shared_obj ? Attributes::True : QString())}}; loadCatalogQuery(query_id); @@ -533,7 +533,7 @@ QString Catalog::getNotExtObjectQuery(const QString &oid_field) try { - attribs_map attribs={{Attributes::OID, oid_field}, + attribs_map attribs={{Attributes::Oid, oid_field}, {Attributes::ExtObjOids, ext_obj_oids}}; @@ -647,7 +647,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS else { res.accessTuple(ResultSet::FirstTuple); - return(res.getColumnValue(Attributes::OID)); + return(res.getColumnValue(Attributes::Oid)); } } catch(Exception &e) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index fa7f4986b6..50b5a6bfc7 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -82,7 +82,7 @@ BaseObject::BaseObject(void) tablespace=nullptr; database=nullptr; collation=nullptr; - attributes[Attributes::NAME]=QString(); + attributes[Attributes::Name]=QString(); attributes[Attributes::Alias]=QString(); attributes[Attributes::Comment]=QString(); attributes[Attributes::OWNER]=QString(); @@ -674,8 +674,8 @@ bool BaseObject::isSystemObject(void) void BaseObject::setBasicAttributes(bool format_name) { - if(attributes[Attributes::NAME].isEmpty()) - attributes[Attributes::NAME]=this->getName(format_name); + if(attributes[Attributes::Name].isEmpty()) + attributes[Attributes::Name]=this->getName(format_name); if(attributes[Attributes::Alias].isEmpty()) attributes[Attributes::Alias]=this->getAlias(); @@ -1200,9 +1200,9 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff if(!ignore_name_diff && this->getName()!=object->getName()) { - attributes[Attributes::NEW_NAME]=object->getName(true, false); + attributes[Attributes::NewName]=object->getName(true, false); alter+=BaseObject::getAlterDefinition(Attributes::RENAME, attributes, true); - attributes[Attributes::NAME]=attributes[Attributes::NEW_NAME]; + attributes[Attributes::Name]=attributes[Attributes::NewName]; attributes[Attributes::SIGNATURE]=object->getSignature(true); } diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index eca042a671..20a17ee8f2 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -330,7 +330,7 @@ void BaseRelationship::setRelationshipAttributes(void) QString str_aux, label_attribs[3]={ Attributes::SRC_LABEL, Attributes::DstLabel, - Attributes::NAME_LABEL}; + Attributes::NameLabel}; attributes[Attributes::TYPE]=getRelTypeAttribute(); diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 51b16ea09b..5df46f647c 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -24,7 +24,7 @@ BaseTable::BaseTable(void) obj_type=ObjectType::BaseTable; attributes[Attributes::TAG]=QString(); attributes[Attributes::HideExtAttribs]=QString(); - attributes[Attributes::MAX_OBJ_COUNT]=QString(); + attributes[Attributes::MaxObjCount]=QString(); hide_ext_attribs=false; } diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index f8bff6dcfc..e5b2a84259 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -25,7 +25,7 @@ Collation::Collation(void) attributes[Attributes::LcCtype]=QString(); attributes[Attributes::LcCollate]=QString(); - attributes[Attributes::LOCALE]=QString(); + attributes[Attributes::Locale]=QString(); attributes[Attributes::Encoding]=QString(); } @@ -102,10 +102,10 @@ QString Collation::getCodeDefinition(unsigned def_type, bool reduced_form) if(!locale.isEmpty()) { - attributes[Attributes::LOCALE]=locale; + attributes[Attributes::Locale]=locale; if(def_type==SchemaParser::SqlDefinition && encoding!=BaseType::Null) - attributes[Attributes::LOCALE]=locale + "." + (~encoding).toLower(); + attributes[Attributes::Locale]=locale + "." + (~encoding).toLower(); } else if(collation) attributes[Attributes::Collation]=collation->getName(true); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index e0b0bec731..645abdb496 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -24,14 +24,14 @@ Column::Column(void) not_null=seq_cycle=false; attributes[Attributes::TYPE]=QString(); attributes[Attributes::DefaultValue]=QString(); - attributes[Attributes::NOT_NULL]=QString(); + attributes[Attributes::NotNull]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::SEQUENCE]=QString(); attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::IdentityType]=QString(); attributes[Attributes::Increment]=QString(); - attributes[Attributes::MIN_VALUE]=QString(); - attributes[Attributes::MAX_VALUE]=QString(); + attributes[Attributes::MinValue]=QString(); + attributes[Attributes::MaxValue]=QString(); attributes[Attributes::START]=QString(); attributes[Attributes::Cache]=QString(); attributes[Attributes::Cycle]=QString(); @@ -248,8 +248,8 @@ QString Column::getCodeDefinition(unsigned def_type) { attributes[Attributes::IdentityType] = ~identity_type; attributes[Attributes::Increment]=seq_increment; - attributes[Attributes::MIN_VALUE]=seq_min_value; - attributes[Attributes::MAX_VALUE]=seq_max_value; + attributes[Attributes::MinValue]=seq_min_value; + attributes[Attributes::MaxValue]=seq_max_value; attributes[Attributes::START]=seq_start; attributes[Attributes::Cache]=seq_cache; attributes[Attributes::Cycle]=(seq_cycle ? Attributes::True : QString()); @@ -268,7 +268,7 @@ QString Column::getCodeDefinition(unsigned def_type) } } - attributes[Attributes::NOT_NULL]=(!not_null ? QString() : Attributes::True); + attributes[Attributes::NotNull]=(!not_null ? QString() : Attributes::True); attributes[Attributes::DeclInTable]=(isDeclaredInTable() ? Attributes::True : QString()); return(BaseObject::__getCodeDefinition(def_type)); @@ -307,9 +307,9 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[Attributes::DefaultValue]=(def_val.isEmpty() ? Attributes::UNSET : def_val); if(this->not_null!=col->not_null) - attribs[Attributes::NOT_NULL]=(!col->not_null ? Attributes::UNSET : Attributes::True); + attribs[Attributes::NotNull]=(!col->not_null ? Attributes::UNSET : Attributes::True); - attribs[Attributes::NEW_IDENTITY_TYPE] = QString(); + attribs[Attributes::NewIdentityType] = QString(); if(this->identity_type == BaseType::Null && col->identity_type != BaseType::Null) attribs[Attributes::IdentityType] = ~col->identity_type; @@ -317,11 +317,11 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[Attributes::IdentityType] = Attributes::UNSET; else if(this->identity_type != BaseType::Null && col->identity_type != BaseType::Null && this->identity_type != col->identity_type) - attribs[Attributes::NEW_IDENTITY_TYPE] = ~col->identity_type; + attribs[Attributes::NewIdentityType] = ~col->identity_type; attribs[Attributes::CurIdentityType] = QString(); - attribs[Attributes::MIN_VALUE] = QString(); - attribs[Attributes::MAX_VALUE] = QString(); + attribs[Attributes::MinValue] = QString(); + attribs[Attributes::MaxValue] = QString(); attribs[Attributes::START] = QString(); attribs[Attributes::Increment] = QString(); attribs[Attributes::Cache] = QString(); @@ -332,13 +332,13 @@ QString Column::getAlterDefinition(BaseObject *object) { if(!col->seq_min_value.isEmpty() && this->seq_min_value != col->seq_min_value) { - attribs[Attributes::MIN_VALUE] = col->seq_min_value; + attribs[Attributes::MinValue] = col->seq_min_value; ident_seq_changed = true; } if(!col->seq_max_value.isEmpty() && this->seq_max_value != col->seq_max_value) { - attribs[Attributes::MAX_VALUE] = col->seq_max_value; + attribs[Attributes::MaxValue] = col->seq_max_value; ident_seq_changed = true; } diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index f076ff46e3..79298234a4 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -46,7 +46,7 @@ Constraint::Constraint(void) attributes[Attributes::TABLE]=QString(); attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::Factor]=QString(); - attributes[Attributes::NO_INHERIT]=QString(); + attributes[Attributes::NoInherit]=QString(); attributes[Attributes::Elements]=QString(); } @@ -712,7 +712,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[Attributes::REF_TABLE]=(ref_table ? ref_table->getName(true) : QString()); attributes[Attributes::Deferrable]=(deferrable ? Attributes::True : QString()); - attributes[Attributes::NO_INHERIT]=(no_inherit ? Attributes::True : QString()); + attributes[Attributes::NoInherit]=(no_inherit ? Attributes::True : QString()); attributes[Attributes::ComparisonType]=(~match_type); attributes[Attributes::DeferType]=(~deferral_type); attributes[Attributes::IndexType]=(~ index_type); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 66bbd50419..d9cadaf27a 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3016,9 +3016,9 @@ void DatabaseModel::loadModel(const QString &filename) //Gets the basic model information xmlparser.getElementAttributes(attribs); - setObjectListsCapacity(attribs[Attributes::MAX_OBJ_COUNT].toUInt()); + setObjectListsCapacity(attribs[Attributes::MaxObjCount].toUInt()); - this->author=attribs[Attributes::MODEL_AUTHOR]; + this->author=attribs[Attributes::ModelAuthor]; pos_str=attribs[Attributes::LastPosition].split(','); @@ -3249,7 +3249,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) obj_type_aux=object->getObjectType(); if(obj_type_aux!=ObjectType::Cast) - object->setName(attribs[Attributes::NAME]); + object->setName(attribs[Attributes::Name]); if(BaseObject::acceptsAlias(obj_type_aux)) object->setAlias(attribs[Attributes::Alias]); @@ -3280,36 +3280,36 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) { obj_type=ObjectType::Schema; xmlparser.getElementAttributes(attribs_aux); - schema=dynamic_cast(getObject(attribs_aux[Attributes::NAME], obj_type)); + schema=dynamic_cast(getObject(attribs_aux[Attributes::Name], obj_type)); object->setSchema(schema); - has_error=(!schema && !attribs_aux[Attributes::NAME].isEmpty()); + has_error=(!schema && !attribs_aux[Attributes::Name].isEmpty()); } //Defines the object's tablespace else if(elem_name==Attributes::TABLESPACE) { obj_type=ObjectType::Tablespace; xmlparser.getElementAttributes(attribs_aux); - tabspc=getObject(attribs_aux[Attributes::NAME], obj_type); + tabspc=getObject(attribs_aux[Attributes::Name], obj_type); object->setTablespace(tabspc); - has_error=(!tabspc && !attribs_aux[Attributes::NAME].isEmpty()); + has_error=(!tabspc && !attribs_aux[Attributes::Name].isEmpty()); } //Defines the object's owner else if(elem_name==Attributes::ROLE) { obj_type=ObjectType::Role; xmlparser.getElementAttributes(attribs_aux); - owner=getObject(attribs_aux[Attributes::NAME], obj_type); + owner=getObject(attribs_aux[Attributes::Name], obj_type); object->setOwner(owner); - has_error=(!owner && !attribs_aux[Attributes::NAME].isEmpty()); + has_error=(!owner && !attribs_aux[Attributes::Name].isEmpty()); } //Defines the object's schema else if(elem_name==Attributes::Collation) { obj_type=ObjectType::Collation; xmlparser.getElementAttributes(attribs_aux); - collation=getObject(attribs_aux[Attributes::NAME], obj_type); + collation=getObject(attribs_aux[Attributes::Name], obj_type); object->setCollation(collation); - has_error=(!collation && !attribs_aux[Attributes::NAME].isEmpty()); + has_error=(!collation && !attribs_aux[Attributes::Name].isEmpty()); } else if(elem_name==Attributes::AppendedSql) { @@ -3354,7 +3354,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(object->getName()) .arg(object->getTypeName()) - .arg(attribs_aux[Attributes::NAME]) + .arg(attribs_aux[Attributes::Name]) .arg(BaseObject::getTypeName(obj_type)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -3458,7 +3458,7 @@ Role *DatabaseModel::createRole(void) QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, - Attributes::LOGIN, Attributes::Encrypted, + Attributes::Login, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; unsigned op_vect[]={ Role::OpSuperuser, Role::OpCreateDb, @@ -3502,13 +3502,13 @@ Role *DatabaseModel::createRole(void) xmlparser.getElementAttributes(attribs_aux); //The member roles names are separated by comma, so it is needed to split them - list=attribs_aux[Attributes::NAMES].split(','); + list=attribs_aux[Attributes::Names].split(','); len=list.size(); //Identifying the member role type if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::REFER) role_type=Role::RefRole; - else if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::MEMBER) + else if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::Member) role_type=Role::MemberRole; else role_type=Role::AdminRole; @@ -3759,14 +3759,14 @@ Function *DatabaseModel::createFunction(void) else if(obj_type==ObjectType::Language) { xmlparser.getElementAttributes(attribs); - object=getObject(attribs[Attributes::NAME], obj_type); + object=getObject(attribs[Attributes::Name], obj_type); //Raises an error if the function doesn't exisits if(!object) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(func->getName()) .arg(func->getTypeName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Language)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -3830,7 +3830,7 @@ Parameter DatabaseModel::createParameter(void) xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); - param.setName(attribs[Attributes::NAME]); + param.setName(attribs[Attributes::Name]); param.setDefaultValue(attribs[Attributes::DefaultValue]); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -3878,7 +3878,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) xmlparser.savePosition(); xmlparser.getElementAttributes(attribs); - tpattrib.setName(attribs[Attributes::NAME]); + tpattrib.setName(attribs[Attributes::Name]); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3896,7 +3896,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[Attributes::NAME], ObjectType::Collation); + collation=getObject(attribs[Attributes::Name], ObjectType::Collation); //Raises an error if the operator class doesn't exists if(!collation) @@ -3904,7 +3904,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tpattrib.getName()) .arg(tpattrib.getTypeName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -3958,12 +3958,12 @@ PgSqlType DatabaseModel::createPgSQLType(void) attribs[Attributes::SRID].toUInt(), attribs[Attributes::VARIATION].toUInt()); - name=attribs[Attributes::NAME]; + name=attribs[Attributes::Name]; /* A small tweak to detect a timestamp/date type which name contains the time zone modifier. This situation can occur mainly on reverse engineering operation where the data type of objects in most of times came as string form and need to be parsed */ - if(!with_timezone && attribs[Attributes::NAME].contains(QString("with time zone"), Qt::CaseInsensitive)) + if(!with_timezone && attribs[Attributes::Name].contains(QString("with time zone"), Qt::CaseInsensitive)) { with_timezone=true; name.remove(QString(" with time zone"), Qt::CaseInsensitive); @@ -4088,7 +4088,7 @@ Type *DatabaseModel::createType(void) else if(elem==Attributes::Collation) { xmlparser.getElementAttributes(attribs); - collation=getObject(attribs[Attributes::NAME], ObjectType::Collation); + collation=getObject(attribs[Attributes::Name], ObjectType::Collation); //Raises an error if the operator class doesn't exists if(!collation) @@ -4096,7 +4096,7 @@ Type *DatabaseModel::createType(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4106,7 +4106,7 @@ Type *DatabaseModel::createType(void) if(elem==Attributes::OP_CLASS) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[Attributes::NAME], ObjectType::OpClass)); + op_class=dynamic_cast(getObject(attribs[Attributes::Name], ObjectType::OpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -4114,7 +4114,7 @@ Type *DatabaseModel::createType(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4183,7 +4183,7 @@ Domain *DatabaseModel::createDomain(void) if(!attribs[Attributes::DefaultValue].isEmpty()) domain->setDefaultValue(attribs[Attributes::DefaultValue]); - domain->setNotNull(attribs[Attributes::NOT_NULL]==Attributes::True); + domain->setNotNull(attribs[Attributes::NotNull]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4204,7 +4204,7 @@ Domain *DatabaseModel::createDomain(void) xmlparser.getElementAttributes(attribs); xmlparser.accessElement(XmlParser::ChildElement); xmlparser.accessElement(XmlParser::ChildElement); - domain->addCheckConstraint(attribs[Attributes::NAME], xmlparser.getElementContent()); + domain->addCheckConstraint(attribs[Attributes::Name], xmlparser.getElementContent()); xmlparser.restorePosition(); } } @@ -4370,7 +4370,7 @@ Operator *DatabaseModel::createOperator(void) setBasicAttributes(oper); xmlparser.getElementAttributes(attribs); - oper->setMerges(attribs[Attributes::MERGES]==Attributes::True); + oper->setMerges(attribs[Attributes::Merges]==Attributes::True); oper->setHashes(attribs[Attributes::Hashes]==Attributes::True); func_types[Attributes::OPERATOR_FUNC]=Operator::FUNC_OPERATOR; @@ -4378,7 +4378,7 @@ Operator *DatabaseModel::createOperator(void) func_types[Attributes::RESTRICTION_FUNC]=Operator::FUNC_RESTRICT; oper_types[Attributes::CommutatorOp]=Operator::OPER_COMMUTATOR; - oper_types[Attributes::NEGATOR_OP]=Operator::OPER_NEGATOR; + oper_types[Attributes::NegatorOp]=Operator::OPER_NEGATOR; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4675,8 +4675,8 @@ Table *DatabaseModel::createTable(void) setBasicAttributes(table); xmlparser.getElementAttributes(attribs); - table->setObjectListsCapacity(attribs[Attributes::MAX_OBJ_COUNT].toUInt()); - table->setWithOIDs(attribs[Attributes::OIDS]==Attributes::True); + table->setObjectListsCapacity(attribs[Attributes::MaxObjCount].toUInt()); + table->setWithOIDs(attribs[Attributes::Oids]==Attributes::True); table->setUnlogged(attribs[Attributes::UNLOGGED]==Attributes::True); table->setRLSEnabled(attribs[Attributes::RLS_ENABLED]==Attributes::True); table->setRLSForced(attribs[Attributes::RLS_FORCED]==Attributes::True); @@ -4701,12 +4701,12 @@ Table *DatabaseModel::createTable(void) else if(elem==BaseObject::objs_schemas[~ObjectType::Tag]) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[Attributes::NAME], ObjectType::Tag); + tag=getObject(aux_attribs[Attributes::Name], ObjectType::Tag); if(!tag) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Table)) .arg(aux_attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Tag)) @@ -4719,7 +4719,7 @@ Table *DatabaseModel::createTable(void) else if(elem==Attributes::CustomIdxs) { xmlparser.getElementAttributes(aux_attribs); - obj_type=BaseObject::getObjectType(aux_attribs[Attributes::OBJECT_TYPE]); + obj_type=BaseObject::getObjectType(aux_attribs[Attributes::ObjectType]); xmlparser.savePosition(); @@ -4732,10 +4732,10 @@ Table *DatabaseModel::createTable(void) elem=xmlparser.getElementName(); //The element stores the index for each object in the current group - if(elem==Attributes::OBJECT) + if(elem==Attributes::Object) { xmlparser.getElementAttributes(aux_attribs); - names.push_back(aux_attribs[Attributes::NAME]); + names.push_back(aux_attribs[Attributes::Name]); idxs.push_back(aux_attribs[Attributes::Index].toUInt()); } } @@ -4818,9 +4818,9 @@ Column *DatabaseModel::createColumn(void) setBasicAttributes(column); xmlparser.getElementAttributes(attribs); - column->setNotNull(attribs[Attributes::NOT_NULL]==Attributes::True); + column->setNotNull(attribs[Attributes::NotNull]==Attributes::True); column->setDefaultValue(attribs[Attributes::DefaultValue]); - column->setIdSeqAttributes(attribs[Attributes::MIN_VALUE], attribs[Attributes::MAX_VALUE], attribs[Attributes::Increment], + column->setIdSeqAttributes(attribs[Attributes::MinValue], attribs[Attributes::MaxValue], attribs[Attributes::Increment], attribs[Attributes::START], attribs[Attributes::Cache], attribs[Attributes::Cycle] == Attributes::True); if(!attribs[Attributes::IdentityType].isEmpty()) @@ -4832,7 +4832,7 @@ Column *DatabaseModel::createColumn(void) if(!seq) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Column)) .arg(attribs[Attributes::SEQUENCE]) .arg(BaseObject::getTypeName(ObjectType::Sequence)), @@ -4914,7 +4914,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(!table) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Constraint)) .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)); @@ -4989,7 +4989,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) } else if(constr_type==ConstraintType::Check) { - constr->setNoInherit(attribs[Attributes::NO_INHERIT]==Attributes::True); + constr->setNoInherit(attribs[Attributes::NoInherit]==Attributes::True); } else if(constr_type==ConstraintType::Exclude && !attribs[Attributes::IndexType].isEmpty()) { @@ -5022,7 +5022,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) { xmlparser.getElementAttributes(attribs); - col_list=attribs[Attributes::NAMES].split(','); + col_list=attribs[Attributes::Names].split(','); count=col_list.count(); if(attribs[Attributes::REF_TYPE]==Attributes::SRC_COLUMNS) @@ -5105,7 +5105,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setOperatorClass(nullptr); elem.setSortingAttribute(Element::AscOrder, attribs[Attributes::AscOrder]==Attributes::True); - elem.setSortingAttribute(Element::NullsFirst, attribs[Attributes::NULLS_FIRST]==Attributes::True); + elem.setSortingAttribute(Element::NullsFirst, attribs[Attributes::NullsFirst]==Attributes::True); elem.setSortingEnabled(attribs[Attributes::USE_SORTING]!=Attributes::False); xmlparser.savePosition(); @@ -5168,7 +5168,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==Attributes::Collation) { xmlparser.getElementAttributes(attribs); - collation=dynamic_cast(getObject(attribs[Attributes::NAME], ObjectType::Collation)); + collation=dynamic_cast(getObject(attribs[Attributes::Name], ObjectType::Collation)); //Raises an error if the operator class doesn't exists if(!collation) @@ -5178,7 +5178,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5186,7 +5186,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Collation)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5200,14 +5200,14 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec if(parent_obj->getObjectType()==ObjectType::Table) { - column=dynamic_cast
(parent_obj)->getColumn(attribs[Attributes::NAME]); + column=dynamic_cast
(parent_obj)->getColumn(attribs[Attributes::Name]); if(!column) - column=dynamic_cast
(parent_obj)->getColumn(attribs[Attributes::NAME], true); + column=dynamic_cast
(parent_obj)->getColumn(attribs[Attributes::Name], true); } else { - column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[Attributes::NAME], ObjectType::Column)); + column=dynamic_cast(dynamic_cast(parent_obj)->getObject(attribs[Attributes::Name], ObjectType::Column)); } //Raises an error if the column doesn't exists @@ -5218,7 +5218,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Column)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5226,7 +5226,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Column)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5310,7 +5310,7 @@ Index *DatabaseModel::createIndex(void) if(!table) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Index)) .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)); @@ -5389,7 +5389,7 @@ Rule *DatabaseModel::createRule(void) if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Rule)) .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)), @@ -5468,7 +5468,7 @@ Trigger *DatabaseModel::createTrigger(void) if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Trigger)) .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)), @@ -5498,8 +5498,8 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setFiringType(FiringType(attribs[Attributes::FiringType])); - trigger->setTransitionTableName(Trigger::OldTableName, attribs[Attributes::OLD_TABLE_NAME]); - trigger->setTransitionTableName(Trigger::NewTableName, attribs[Attributes::NEW_TABLE_NAME]); + trigger->setTransitionTableName(Trigger::OldTableName, attribs[Attributes::OldTableName]); + trigger->setTransitionTableName(Trigger::NewTableName, attribs[Attributes::NewTableName]); list_aux=attribs[Attributes::Arguments].split(','); count=list_aux.count(); @@ -5574,7 +5574,7 @@ Trigger *DatabaseModel::createTrigger(void) { xmlparser.getElementAttributes(attribs); - list_aux=attribs[Attributes::NAMES].split(','); + list_aux=attribs[Attributes::Names].split(','); count=list_aux.count(); for(i=0; i < count; i++) @@ -5622,7 +5622,7 @@ Policy *DatabaseModel::createPolicy(void) if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Policy)) .arg(attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Table)), @@ -5659,7 +5659,7 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.getElementAttributes(attribs); - rol_names = attribs[Attributes::NAMES].split(','); + rol_names = attribs[Attributes::Names].split(','); for(auto &name : rol_names) { @@ -5800,8 +5800,8 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) setBasicAttributes(sequence); xmlparser.getElementAttributes(attribs); - sequence->setValues(attribs[Attributes::MIN_VALUE], - attribs[Attributes::MAX_VALUE], + sequence->setValues(attribs[Attributes::MinValue], + attribs[Attributes::MaxValue], attribs[Attributes::Increment], attribs[Attributes::START], attribs[Attributes::Cache]); @@ -5883,8 +5883,8 @@ View *DatabaseModel::createView(void) setBasicAttributes(view); xmlparser.getElementAttributes(attribs); - view->setObjectListsCapacity(attribs[Attributes::MAX_OBJ_COUNT].toUInt()); - view->setMaterialized(attribs[Attributes::MATERIALIZED]==Attributes::True); + view->setObjectListsCapacity(attribs[Attributes::MaxObjCount].toUInt()); + view->setMaterialized(attribs[Attributes::Materialized]==Attributes::True); view->setRecursive(attribs[Attributes::RECURSIVE]==Attributes::True); view->setWithNoData(attribs[Attributes::WITH_NO_DATA]==Attributes::True); view->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); @@ -6001,12 +6001,12 @@ View *DatabaseModel::createView(void) else if(elem==BaseObject::getSchemaName(ObjectType::Tag)) { xmlparser.getElementAttributes(aux_attribs); - tag=getObject(aux_attribs[Attributes::NAME] ,ObjectType::Tag); + tag=getObject(aux_attribs[Attributes::Name] ,ObjectType::Tag); if(!tag) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Table)) .arg(aux_attribs[Attributes::TABLE]) .arg(BaseObject::getTypeName(ObjectType::Tag)) @@ -6069,8 +6069,8 @@ Collation *DatabaseModel::createCollation(void) collation->setEncoding(encoding); //Creating a collation from a base locale - if(!attribs[Attributes::LOCALE].isEmpty()) - collation->setLocale(attribs[Attributes::LOCALE]); + if(!attribs[Attributes::Locale].isEmpty()) + collation->setLocale(attribs[Attributes::Locale]); //Creating a collation from another collation else if(!attribs[Attributes::Collation].isEmpty()) { @@ -6118,7 +6118,7 @@ Extension *DatabaseModel::createExtension(void) extension->setHandlesType(attribs[Attributes::HandlesType]==Attributes::True); extension->setVersion(Extension::CurVersion, attribs[Attributes::CurVersion]); - extension->setVersion(Extension::OldVersion, attribs[Attributes::OLD_VERSION]); + extension->setVersion(Extension::OldVersion, attribs[Attributes::OldVersion]); } catch(Exception &e) { @@ -6220,7 +6220,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) try { - labels_id[Attributes::NAME_LABEL]=BaseRelationship::RelNameLabel; + labels_id[Attributes::NameLabel]=BaseRelationship::RelNameLabel; labels_id[Attributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; labels_id[Attributes::DstLabel]=BaseRelationship::DstCardLabel; @@ -6254,7 +6254,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(!tables[i]) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(obj_rel_type)) .arg(attribs[tab_attribs[i]]) .arg(BaseObject::getTypeName(table_types[i])); @@ -6272,7 +6272,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_FK) { base_rel=new BaseRelationship(BaseRelationship::RelationshipFk, tables[0], tables[1], false, false); - base_rel->setName(attribs[Attributes::NAME]); + base_rel->setName(attribs[Attributes::Name]); base_rel->setAlias(attribs[Attributes::Alias]); addRelationship(base_rel); @@ -6300,20 +6300,20 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(!base_rel->getReferenceForeignKey()) { throw Exception(Exception::getErrorMessage(ErrorCode::InvAllocationFKRelationship) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(src_tab->getName(true)), ErrorCode::InvAllocationFKRelationship,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } } else if(base_rel) - base_rel->setName(attribs[Attributes::NAME]); + base_rel->setName(attribs[Attributes::Name]); if(!base_rel) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(this->getName()) .arg(this->getTypeName()) - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::BaseRelationship)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -6371,7 +6371,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(!attribs[Attributes::TABLE_NAME].isEmpty()) rel->setTableNameRelNN(attribs[Attributes::TABLE_NAME]); - rel->setName(attribs[Attributes::NAME]); + rel->setName(attribs[Attributes::Name]); rel->setAlias(attribs[Attributes::Alias]); base_rel=rel; @@ -6527,7 +6527,7 @@ Permission *DatabaseModel::createPermission(void) xmlparser.getElementAttributes(attribs); obj_type=BaseObject::getObjectType(attribs[Attributes::TYPE]); - obj_name=attribs[Attributes::NAME]; + obj_name=attribs[Attributes::Name]; parent_name=attribs[Attributes::PARENT]; //If the object is a column its needed to get the parent table @@ -6562,7 +6562,7 @@ Permission *DatabaseModel::createPermission(void) { xmlparser.getElementAttributes(attribs); - list=attribs[Attributes::NAMES].split(','); + list=attribs[Attributes::Names].split(','); len=list.size(); for(i=0; i < len; i++) @@ -6716,7 +6716,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) QString def, bkp_appended_sql, bkp_prepended_sql; //Forcing the name/signature cleanup due to the validation temp. names feature - attributes[Attributes::NAME]=QString(); + attributes[Attributes::Name]=QString(); attributes[Attributes::SIGNATURE]=QString(); if(conn_limit >= 0) @@ -6795,7 +6795,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) BaseObject *object=nullptr; QString def, search_path=QString("pg_catalog,public"), msg=trUtf8("Generating %1 code: `%2' (%3)"), - attrib=Attributes::OBJECTS, attrib_aux, + attrib=Attributes::Objects, attrib_aux, def_type_str=(def_type==SchemaParser::SqlDefinition ? QString("SQL") : QString("XML")); Type *usr_type=nullptr; map objects_map; @@ -6926,12 +6926,12 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } attribs_aux[Attributes::SEARCH_PATH]=search_path; - attribs_aux[Attributes::MODEL_AUTHOR]=author; + attribs_aux[Attributes::ModelAuthor]=author; attribs_aux[Attributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; if(def_type==SchemaParser::XmlDefinition) { - attribs_aux[Attributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); + attribs_aux[Attributes::MaxObjCount]=QString::number(static_cast(getMaxObjectCount() * 1.20)); attribs_aux[Attributes::PROTECTED]=(this->is_protected ? Attributes::True : QString()); attribs_aux[Attributes::LastPosition]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs_aux[Attributes::LastZoom]=QString::number(last_zoom); @@ -9506,7 +9506,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option save_extattribs=false, save_genericsqls=false, save_objs_aliases=false; QStringList labels_attrs={ Attributes::SRC_LABEL, Attributes::DstLabel, - Attributes::NAME_LABEL }; + Attributes::NameLabel }; save_db_attribs=(MetaDbAttributes & options) == MetaDbAttributes; save_objs_pos=(MetaObjsPositioning & options) == MetaObjsPositioning; @@ -9629,7 +9629,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option base_tab=dynamic_cast(object); attribs[Attributes::TABLE]=QString(); - attribs[Attributes::NAME]=(TableObject::isTableObject(obj_type) ? object->getName() : object->getSignature()); + attribs[Attributes::Name]=(TableObject::isTableObject(obj_type) ? object->getName() : object->getSignature()); attribs[Attributes::Alias]=(save_objs_aliases ? object->getAlias() : QString()); attribs[Attributes::TYPE]=object->getSchemaName(); attribs[Attributes::PROTECTED]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? Attributes::True : QString()); @@ -9655,7 +9655,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option //Configuring database model attributes if(save_db_attribs && object==this) { - attribs[Attributes::MODEL_AUTHOR]=this->getAuthor(); + attribs[Attributes::ModelAuthor]=this->getAuthor(); attribs[Attributes::LastPosition]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs[Attributes::LastZoom]=QString::number(last_zoom); attribs[Attributes::DefaultCollation]=(default_objs[ObjectType::Collation] ? default_objs[ObjectType::Collation]->getSignature() : QString()); @@ -9706,7 +9706,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs_map aux_attribs; - attribs[Attributes::CustomColor]=(save_custom_colors && rel->getCustomColor()!=Qt::transparent ? rel->getCustomColor().name() : Attributes::NONE); + attribs[Attributes::CustomColor]=(save_custom_colors && rel->getCustomColor()!=Qt::transparent ? rel->getCustomColor().name() : Attributes::None); attribs[Attributes::SRC_TABLE]=rel->getTable(BaseRelationship::SrcTable)->getSignature(); attribs[Attributes::SRC_TYPE]=rel->getTable(BaseRelationship::SrcTable)->getSchemaName(); @@ -9802,7 +9802,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::Info]=objs_def; buf.append(schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - Attributes::METADATA + GlobalAttributes::SchemaExt, attribs)); + Attributes::Metadata + GlobalAttributes::SchemaExt, attribs)); output.write(buf.data(),buf.size()); emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ~ObjectType::BaseObject); @@ -9862,7 +9862,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { labels_attrs[Attributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; labels_attrs[Attributes::DstLabel]=BaseRelationship::DstCardLabel; - labels_attrs[Attributes::NAME_LABEL]=BaseRelationship::RelNameLabel; + labels_attrs[Attributes::NameLabel]=BaseRelationship::RelNameLabel; xmlparser.restartParser(); @@ -9907,7 +9907,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else if(elem_name==Attributes::Info) { xmlparser.getElementAttributes(attribs); - obj_name=attribs[Attributes::OBJECT]; + obj_name=attribs[Attributes::Object]; xmlparser.savePosition(); obj_type=BaseObject::getObjectType(attribs[Attributes::TYPE]); @@ -9923,7 +9923,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option default_objs[ObjectType::Role]=getRole(attribs[Attributes::DefaultOwner]); default_objs[ObjectType::Collation]=getCollation(attribs[Attributes::DefaultCollation]); default_objs[ObjectType::Tablespace]=getTablespace(attribs[Attributes::DefaultTablespace]); - author=attribs[Attributes::MODEL_AUTHOR]; + author=attribs[Attributes::ModelAuthor]; last_zoom=attribs[Attributes::LastZoom].toFloat(); if(pos.size()>=2) @@ -9940,7 +9940,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option base_tab = getView(attribs[Attributes::TABLE]); if(base_tab) - object = base_tab->getObject(attribs[Attributes::OBJECT], obj_type); + object = base_tab->getObject(attribs[Attributes::Object], obj_type); //Discarding the object if it was added by relationship if(object && dynamic_cast(object)->isAddedByRelationship()) @@ -10054,7 +10054,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option { if(load_custom_colors) { - if(attribs[Attributes::CustomColor]==Attributes::NONE) + if(attribs[Attributes::CustomColor]==Attributes::None) rel->setCustomColor(Qt::transparent); else rel->setCustomColor(QColor(attribs[Attributes::CustomColor])); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 2874f56165..3c2cf39bed 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -23,7 +23,7 @@ Domain::Domain(void) obj_type=ObjectType::Domain; not_null=false; attributes[Attributes::DefaultValue]=QString(); - attributes[Attributes::NOT_NULL]=QString(); + attributes[Attributes::NotNull]=QString(); attributes[Attributes::TYPE]=QString(); attributes[Attributes::Constraints]=QString(); } @@ -126,12 +126,12 @@ QString Domain::getCodeDefinition(unsigned def_type) attribs_map aux_attribs; - attributes[Attributes::NOT_NULL]=(not_null ? Attributes::True : QString()); + attributes[Attributes::NotNull]=(not_null ? Attributes::True : QString()); attributes[Attributes::DefaultValue]=default_value; for(auto itr : chk_constrs) { - aux_attribs[Attributes::NAME] = itr.first; + aux_attribs[Attributes::Name] = itr.first; aux_attribs[Attributes::Expression] = itr.second; attributes[Attributes::Constraints]+=schparser.getCodeDefinition(Attributes::DomConstraint, aux_attribs, def_type); } @@ -170,17 +170,17 @@ QString Domain::getAlterDefinition(BaseObject *object) QString orig_expr, aux_expr; attributes[Attributes::DefaultValue]=QString(); - attributes[Attributes::NOT_NULL]=QString(); + attributes[Attributes::NotNull]=QString(); attributes[Attributes::Constraints]=QString(); attributes[Attributes::Expression]=QString(); - attributes[Attributes::OLD_NAME]=QString(); - attributes[Attributes::NEW_NAME]=QString(); + attributes[Attributes::OldName]=QString(); + attributes[Attributes::NewName]=QString(); if(this->default_value!=domain->default_value) attributes[Attributes::DefaultValue]=(!domain->default_value.isEmpty() ? domain->default_value : Attributes::UNSET); if(this->not_null!=domain->not_null) - attributes[Attributes::NOT_NULL]=(domain->not_null ? Attributes::True : Attributes::UNSET); + attributes[Attributes::NotNull]=(domain->not_null ? Attributes::True : Attributes::UNSET); orig_constrs = this->chk_constrs; aux_constrs = domain->chk_constrs; @@ -197,7 +197,7 @@ QString Domain::getAlterDefinition(BaseObject *object) if(aux_constrs.count(constr.first) == 0 || (aux_constrs.count(constr.first) && orig_expr != aux_expr)) { - aux_attribs[Attributes::NAME]=constr.first; + aux_attribs[Attributes::Name]=constr.first; aux_attribs[Attributes::Expression]=Attributes::UNSET; attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } @@ -205,7 +205,7 @@ QString Domain::getAlterDefinition(BaseObject *object) //We should include a command to recreate the check constraint with the new expression if(aux_constrs.count(constr.first) && orig_expr != aux_expr) { - aux_attribs[Attributes::NAME]=constr.first; + aux_attribs[Attributes::Name]=constr.first; aux_attribs[Attributes::Expression]=aux_constrs[constr.first]; attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } @@ -216,7 +216,7 @@ QString Domain::getAlterDefinition(BaseObject *object) { if(orig_constrs.count(constr.first) == 0) { - aux_attribs[Attributes::NAME]=constr.first; + aux_attribs[Attributes::Name]=constr.first; aux_attribs[Attributes::Expression]=constr.second; attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index b6e9a6437f..7c34fb5b0e 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -97,7 +97,7 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) attributes[Attributes::Expression]=QString(); attributes[Attributes::OP_CLASS]=QString(); attributes[Attributes::USE_SORTING]=(this->sorting_enabled ? Attributes::True : QString()); - attributes[Attributes::NULLS_FIRST]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? Attributes::True : QString()); + attributes[Attributes::NullsFirst]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? Attributes::True : QString()); attributes[Attributes::AscOrder]=(this->sorting_enabled && this->sorting_attibs[AscOrder] ? Attributes::True : QString()); diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index d71dd8f1b8..faafca7e79 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -6,7 +6,7 @@ Extension::Extension(void) handles_type=false; attributes[Attributes::HandlesType]=QString(); attributes[Attributes::CurVersion]=QString(); - attributes[Attributes::OLD_VERSION]=QString(); + attributes[Attributes::OldVersion]=QString(); } void Extension::setName(const QString &name) @@ -85,10 +85,10 @@ QString Extension::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[Attributes::NAME]=this->getName(def_type==SchemaParser::SqlDefinition, false); + attributes[Attributes::Name]=this->getName(def_type==SchemaParser::SqlDefinition, false); attributes[Attributes::HandlesType]=(handles_type ? Attributes::True : QString()); attributes[Attributes::CurVersion]=versions[CurVersion]; - attributes[Attributes::OLD_VERSION]=versions[OldVersion]; + attributes[Attributes::OldVersion]=versions[OldVersion]; return(BaseObject::__getCodeDefinition(def_type)); } @@ -103,11 +103,11 @@ QString Extension::getAlterDefinition(BaseObject *object) try { attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); - attributes[Attributes::NEW_VERSION]=QString(); + attributes[Attributes::NewVersion]=QString(); if(!this->versions[CurVersion].isEmpty() && !ext->versions[CurVersion].isEmpty() && this->versions[CurVersion].isEmpty() < ext->versions[CurVersion].isEmpty()) - attributes[Attributes::NEW_VERSION]=ext->versions[CurVersion]; + attributes[Attributes::NewVersion]=ext->versions[CurVersion]; return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); } @@ -119,7 +119,7 @@ QString Extension::getAlterDefinition(BaseObject *object) QString Extension::getDropDefinition(bool cascade) { - attributes[Attributes::NAME] = this->getName(true); + attributes[Attributes::Name] = this->getName(true); return(BaseObject::getDropDefinition(cascade)); } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 88fe787104..c18b9ff382 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -33,7 +33,7 @@ Index::Index(void) attributes[Attributes::Factor]=QString(); attributes[Attributes::PREDICATE]=QString(); attributes[Attributes::OP_CLASS]=QString(); - attributes[Attributes::NULLS_FIRST]=QString(); + attributes[Attributes::NullsFirst]=QString(); attributes[Attributes::AscOrder]=QString(); attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::Elements]=QString(); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 2af4a16e9b..694ed69074 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -37,12 +37,12 @@ Operator::Operator(void) attributes[Attributes::LeftType]=QString(); attributes[Attributes::RIGHT_TYPE]=QString(); attributes[Attributes::CommutatorOp]=QString(); - attributes[Attributes::NEGATOR_OP]=QString(); + attributes[Attributes::NegatorOp]=QString(); attributes[Attributes::RESTRICTION_FUNC]=QString(); attributes[Attributes::JoinFunc]=QString(); attributes[Attributes::OPERATOR_FUNC]=QString(); attributes[Attributes::Hashes]=QString(); - attributes[Attributes::MERGES]=QString(); + attributes[Attributes::Merges]=QString(); attributes[Attributes::SIGNATURE]=QString(); attributes[Attributes::REF_TYPE]=QString(); } @@ -282,7 +282,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) unsigned i; QString type_attribs[]={Attributes::LeftType, Attributes::RIGHT_TYPE}, op_attribs[]={ Attributes::CommutatorOp, - Attributes::NEGATOR_OP }, + Attributes::NegatorOp }, func_attribs[]={Attributes::OPERATOR_FUNC, Attributes::JoinFunc, @@ -331,7 +331,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) } attributes[Attributes::Hashes]=(hashes ? Attributes::True : QString()); - attributes[Attributes::MERGES]=(merges ? Attributes::True : QString()); + attributes[Attributes::Merges]=(merges ? Attributes::True : QString()); attributes[Attributes::SIGNATURE]=getSignature(); return(BaseObject::getCodeDefinition(def_type, reduced_form)); diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 6a2e008e17..a854f77222 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -94,9 +94,9 @@ QString Parameter::getCodeDefinition(unsigned def_type) QString Parameter::getCodeDefinition(unsigned def_type, bool reduced_form) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::NAME]=BaseObject::formatName(obj_name); + attributes[Attributes::Name]=BaseObject::formatName(obj_name); else - attributes[Attributes::NAME]=obj_name; + attributes[Attributes::Name]=obj_name; attributes[Attributes::PARAM_IN]=(is_in ? Attributes::True : QString()); attributes[Attributes::PARAM_OUT]=(is_out ? Attributes::True : QString()); diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index e42669a32c..1d2406bd97 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -41,7 +41,7 @@ Permission::Permission(BaseObject *obj) this->obj_type=ObjectType::Permission; revoke=cascade=false; - attributes[Attributes::OBJECT]=QString(); + attributes[Attributes::Object]=QString(); attributes[Attributes::TYPE]=QString(); attributes[Attributes::PARENT]=QString(); attributes[Attributes::GrantOp]=QString(); @@ -434,11 +434,11 @@ QString Permission::getCodeDefinition(unsigned def_type) if(obj_type==ObjectType::Column) { - attributes[Attributes::OBJECT]=object->getName(true); + attributes[Attributes::Object]=object->getName(true); attributes[Attributes::PARENT]=dynamic_cast(object)->getParentTable()->getName(true); } else - attributes[Attributes::OBJECT]=object->getSignature(); + attributes[Attributes::Object]=object->getSignature(); if(def_type==SchemaParser::XmlDefinition) { diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index d5b8f2ca12..9f48bed985 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1598,7 +1598,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs[Attributes::SRID]=QString(); attribs[Attributes::REF_TYPE]=ref_type; - attribs[Attributes::NAME]=(~(*this)); + attribs[Attributes::Name]=(~(*this)); attribs[Attributes::Length]=QString("%1").arg(this->length); if(dimension > 0) diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index b318a18620..edb3387842 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -34,13 +34,13 @@ Role::Role(void) attributes[Attributes::CreateDb]=QString(); attributes[Attributes::CreateRole]=QString(); attributes[Attributes::Inherit]=QString(); - attributes[Attributes::LOGIN]=QString(); + attributes[Attributes::Login]=QString(); attributes[Attributes::ConnLimit]=QString(); attributes[Attributes::PASSWORD]=QString(); attributes[Attributes::Encrypted]=QString(); attributes[Attributes::VALIDITY]=QString(); attributes[Attributes::REF_ROLES]=QString(); - attributes[Attributes::MEMBER_ROLES]=QString(); + attributes[Attributes::MemberRoles]=QString(); attributes[Attributes::AdminRoles]=QString(); attributes[Attributes::REPLICATION]=QString(); attributes[Attributes::Group]=QString(); @@ -166,7 +166,7 @@ void Role::setRoleAttribute(unsigned role_type) { case MemberRole: roles_vect=&member_roles; - attrib=Attributes::MEMBER_ROLES; + attrib=Attributes::MemberRoles; break; case AdminRole: roles_vect=&admin_roles; @@ -331,7 +331,7 @@ QString Role::getCodeDefinition(unsigned def_type) unsigned i; QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, - Attributes::LOGIN, Attributes::Encrypted, + Attributes::Login, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; setRoleAttribute(RefRole); @@ -362,7 +362,7 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) attribs_map attribs; QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, - Attributes::LOGIN, Attributes::Encrypted, + Attributes::Login, Attributes::Encrypted, Attributes::REPLICATION, Attributes::BypassRls }; attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object, ignore_name_diff); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 8c79d7f6fd..37d763ea69 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -33,8 +33,8 @@ Sequence::Sequence(void) owner_col=nullptr; attributes[Attributes::Increment]=QString(); - attributes[Attributes::MIN_VALUE]=QString(); - attributes[Attributes::MAX_VALUE]=QString(); + attributes[Attributes::MinValue]=QString(); + attributes[Attributes::MaxValue]=QString(); attributes[Attributes::START]=QString(); attributes[Attributes::Cache]=QString(); attributes[Attributes::Cycle]=QString(); @@ -403,8 +403,8 @@ QString Sequence::getCodeDefinition(unsigned def_type) (owner_col && owner_col->getIdentityType() != BaseType::Null ? Attributes::True : QString()); attributes[Attributes::Increment]=increment; - attributes[Attributes::MIN_VALUE]=min_value; - attributes[Attributes::MAX_VALUE]=max_value; + attributes[Attributes::MinValue]=min_value; + attributes[Attributes::MaxValue]=max_value; attributes[Attributes::START]=start; attributes[Attributes::Cache]=cache; attributes[Attributes::Cycle]=(cycle ? Attributes::True : QString()); @@ -450,10 +450,10 @@ QString Sequence::getAlterDefinition(BaseObject *object) attribs[Attributes::Increment]=seq->increment; if(!seq->min_value.isEmpty() && this->min_value!=seq->min_value) - attribs[Attributes::MIN_VALUE]=seq->min_value; + attribs[Attributes::MinValue]=seq->min_value; if(!seq->max_value.isEmpty() && this->max_value!=seq->max_value) - attribs[Attributes::MAX_VALUE]=seq->max_value; + attribs[Attributes::MaxValue]=seq->max_value; if(!seq->start.isEmpty() && this->start!=seq->start) attribs[Attributes::START]=seq->start; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index c7cae6f130..3fb524c4c0 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -29,7 +29,7 @@ Table::Table(void) : BaseTable() attributes[Attributes::Columns]=QString(); attributes[Attributes::InhColumns]=QString(); attributes[Attributes::Constraints]=QString(); - attributes[Attributes::OIDS]=QString(); + attributes[Attributes::Oids]=QString(); attributes[Attributes::ColsComment]=QString(); attributes[Attributes::CopyTable]=QString(); attributes[Attributes::AncestorTable]=QString(); @@ -164,7 +164,7 @@ void Table::setCommentAttribute(TableObject *tab_obj) attribs[Attributes::Column]=(tab_obj->getObjectType()==ObjectType::Column ? Attributes::True : QString()); attribs[Attributes::Constraint]=(tab_obj->getObjectType()==ObjectType::Constraint ? Attributes::True : QString()); attribs[Attributes::TABLE]=this->getName(true); - attribs[Attributes::NAME]=tab_obj->getName(true); + attribs[Attributes::Name]=tab_obj->getName(true); attribs[Attributes::Comment]=QString(tab_obj->getComment()).replace(QString("'"), QString("''"));; schparser.ignoreUnkownAttributes(true); @@ -203,12 +203,12 @@ void Table::setRelObjectsIndexesAttribute(void) { for(auto &obj_idx : (*obj_indexes[idx])) { - aux_attribs[Attributes::NAME]=obj_idx.first; + aux_attribs[Attributes::Name]=obj_idx.first; aux_attribs[Attributes::Index]=QString::number(obj_idx.second); - aux_attribs[Attributes::OBJECTS]+=schparser.getCodeDefinition(Attributes::OBJECT, aux_attribs, SchemaParser::XmlDefinition); + aux_attribs[Attributes::Objects]+=schparser.getCodeDefinition(Attributes::Object, aux_attribs, SchemaParser::XmlDefinition); } - aux_attribs[Attributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_types[idx]); + aux_attribs[Attributes::ObjectType]=BaseObject::getSchemaName(obj_types[idx]); attributes[attribs[idx]]=schparser.getCodeDefinition(Attributes::CustomIdxs, aux_attribs, SchemaParser::XmlDefinition); aux_attribs.clear(); } @@ -1593,7 +1593,7 @@ void Table::updateAlterCmdsStatus(void) QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) { QStringList part_keys_code; - attributes[Attributes::OIDS]=(with_oid ? Attributes::True : QString()); + attributes[Attributes::Oids]=(with_oid ? Attributes::True : QString()); attributes[Attributes::GenAlterCmds]=(gen_alter_cmds ? Attributes::True : QString()); attributes[Attributes::UNLOGGED]=(unlogged ? Attributes::True : QString()); attributes[Attributes::RLS_ENABLED]=(rls_enabled ? Attributes::True : QString()); @@ -1635,7 +1635,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) setPositionAttribute(); setFadedOutAttribute(); attributes[Attributes::InitialData]=initial_data; - attributes[Attributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); + attributes[Attributes::MaxObjCount]=QString::number(static_cast(getMaxObjectCount() * 1.20)); } else attributes[Attributes::InitialData]=getInitialDataCommands(); @@ -1881,7 +1881,7 @@ QString Table::getAlterDefinition(BaseObject *object) QString alter_def; attribs_map attribs; - attribs[Attributes::OIDS]=QString(); + attribs[Attributes::Oids]=QString(); attribs[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object, true); if(this->getName()==tab->getName()) @@ -1889,7 +1889,7 @@ QString Table::getAlterDefinition(BaseObject *object) attribs[Attributes::HasChanges]=Attributes::True; if(this->with_oid!=tab->with_oid) - attribs[Attributes::OIDS]=(tab->with_oid ? Attributes::True : Attributes::UNSET); + attribs[Attributes::Oids]=(tab->with_oid ? Attributes::True : Attributes::UNSET); if(this->unlogged!=tab->unlogged) attribs[Attributes::UNLOGGED]=(tab->unlogged ? Attributes::True : Attributes::UNSET); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 30845203e8..e657e3ad7c 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -49,8 +49,8 @@ Trigger::Trigger(void) attributes[Attributes::Deferrable]=QString(); attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::Constraint]=QString(); - attributes[Attributes::OLD_TABLE_NAME]=QString(); - attributes[Attributes::NEW_TABLE_NAME]=QString(); + attributes[Attributes::OldTableName]=QString(); + attributes[Attributes::NewTableName]=QString(); } void Trigger::addArgument(const QString &arg) @@ -424,13 +424,13 @@ QString Trigger::getCodeDefinition(unsigned def_type) if(def_type == SchemaParser::XmlDefinition) { - attributes[Attributes::OLD_TABLE_NAME]=transition_tabs_names[OldTableName]; - attributes[Attributes::NEW_TABLE_NAME]=transition_tabs_names[NewTableName]; + attributes[Attributes::OldTableName]=transition_tabs_names[OldTableName]; + attributes[Attributes::NewTableName]=transition_tabs_names[NewTableName]; } else { - attributes[Attributes::OLD_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[OldTableName]); - attributes[Attributes::NEW_TABLE_NAME]=BaseObject::formatName(transition_tabs_names[NewTableName]); + attributes[Attributes::OldTableName]=BaseObject::formatName(transition_tabs_names[OldTableName]); + attributes[Attributes::NewTableName]=BaseObject::formatName(transition_tabs_names[NewTableName]); } return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index eda7505cd4..ea3319725e 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -40,9 +40,9 @@ QString TypeAttribute::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::NAME]=BaseObject::formatName(obj_name); + attributes[Attributes::Name]=BaseObject::formatName(obj_name); else - attributes[Attributes::NAME]=obj_name; + attributes[Attributes::Name]=obj_name; attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 8d57a5ec60..8ad8f6348f 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -29,7 +29,7 @@ View::View(void) : BaseTable() attributes[Attributes::SIMPLE_EXP]=QString(); attributes[Attributes::EndExp]=QString(); attributes[Attributes::CteExpression]=QString(); - attributes[Attributes::MATERIALIZED]=QString(); + attributes[Attributes::Materialized]=QString(); attributes[Attributes::RECURSIVE]=QString(); attributes[Attributes::WITH_NO_DATA]=QString(); attributes[Attributes::Columns]=QString(); @@ -574,7 +574,7 @@ QString View::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); attributes[Attributes::CteExpression]=cte_expression; - attributes[Attributes::MATERIALIZED]=(materialized ? Attributes::True : QString()); + attributes[Attributes::Materialized]=(materialized ? Attributes::True : QString()); attributes[Attributes::RECURSIVE]=(recursive ? Attributes::True : QString()); attributes[Attributes::WITH_NO_DATA]=(with_no_data ? Attributes::True : QString()); attributes[Attributes::Columns]=QString(); @@ -596,7 +596,7 @@ QString View::getCodeDefinition(unsigned def_type) setPositionAttribute(); setFadedOutAttribute(); setReferencesAttribute(); - attributes[Attributes::MAX_OBJ_COUNT]=QString::number(static_cast(getMaxObjectCount() * 1.20)); + attributes[Attributes::MaxObjCount]=QString::number(static_cast(getMaxObjectCount() * 1.20)); } return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 95d93edd4a..784fe4760b 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -27,12 +27,12 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid QString conf_ids[]={ Attributes::Global, //0 Attributes::Constraints, //1 - Attributes::OBJ_SELECTION, //2 + Attributes::ObjSelection, //2 Attributes::POSITION_INFO, //3 Attributes::POSITION_INFO, //4 - Attributes::OBJECT_TYPE, //5 - Attributes::LOCKER_ARC, //6 - Attributes::LOCKER_BODY, //7 + Attributes::ObjectType, //5 + Attributes::LockerArc, //6 + Attributes::LockerBody, //7 Attributes::TABLE_SCHEMA_NAME, //8 Attributes::TABLE_NAME, //9 Attributes::TABLE_BODY, //10 @@ -68,8 +68,8 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::FkColumn, //38 Attributes::UQ_COLUMN, //39 Attributes::UQ_COLUMN, //40 - Attributes::NN_COLUMN, //41 - Attributes::NN_COLUMN, //42 + Attributes::NnColumn, //41 + Attributes::NnColumn, //42 Attributes::RELATIONSHIP, //43 Attributes::Label, //44 Attributes::Label, //45 diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 218fd895b8..81a58fce47 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -61,12 +61,12 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Language, QT_TR_NOOP("Language")}, {Attributes::LcCollate, QT_TR_NOOP("LC COLLATE")}, {Attributes::LcCtype, QT_TR_NOOP("LC CTYPE")}, {Attributes::LeakProof, QT_TR_NOOP("Leak proof")}, {Attributes::LeftType, QT_TR_NOOP("Left type")}, {Attributes::Length, QT_TR_NOOP("Length")}, - {Attributes::Library, QT_TR_NOOP("Library")}, {Attributes::LOGIN, QT_TR_NOOP("Can login")}, - {Attributes::MATERIALIZED, QT_TR_NOOP("Materialized")}, {Attributes::MEMBER_ROLES, QT_TR_NOOP("Member roles")}, - {Attributes::MERGES, QT_TR_NOOP("Merges")}, {Attributes::NAME, QT_TR_NOOP("Name")}, - {Attributes::NEGATOR_OP, QT_TR_NOOP("Negator op.")}, {Attributes::NOT_NULL, QT_TR_NOOP("Not null")}, - {Attributes::OBJECT_TYPE, QT_TR_NOOP("Object type")}, {Attributes::OID, QT_TR_NOOP("OID")}, - {Attributes::OIDS, QT_TR_NOOP("With OIDs")}, {Attributes::OLD_VERSION, QT_TR_NOOP("Old version")}, + {Attributes::Library, QT_TR_NOOP("Library")}, {Attributes::Login, QT_TR_NOOP("Can login")}, + {Attributes::Materialized, QT_TR_NOOP("Materialized")}, {Attributes::MemberRoles, QT_TR_NOOP("Member roles")}, + {Attributes::Merges, QT_TR_NOOP("Merges")}, {Attributes::Name, QT_TR_NOOP("Name")}, + {Attributes::NegatorOp, QT_TR_NOOP("Negator op.")}, {Attributes::NotNull, QT_TR_NOOP("Not null")}, + {Attributes::ObjectType, QT_TR_NOOP("Object type")}, {Attributes::Oid, QT_TR_NOOP("OID")}, + {Attributes::Oids, QT_TR_NOOP("With OIDs")}, {Attributes::OldVersion, QT_TR_NOOP("Old version")}, {Attributes::OPERATOR, QT_TR_NOOP("Operator")}, {Attributes::OPERATOR_FUNC, QT_TR_NOOP("Operator func.")}, {Attributes::OUTPUT_FUNC, QT_TR_NOOP("Output func.")}, {Attributes::OWNER, QT_TR_NOOP("Owner")}, {Attributes::OWNER_COLUMN, QT_TR_NOOP("Owner column")}, {Attributes::PARENTS, QT_TR_NOOP("Parents")}, @@ -89,8 +89,8 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::VALIDITY, QT_TR_NOOP("Validity")}, {Attributes::WINDOW_FUNC, QT_TR_NOOP("Windows func.")}, {Attributes::False, QT_TR_NOOP("false")}, {Attributes::True, QT_TR_NOOP("true")}, {Attributes::Cache, QT_TR_NOOP("Cache value")}, {Attributes::Cycle, QT_TR_NOOP("Cycle")}, - {Attributes::Increment, QT_TR_NOOP("Increment")}, {Attributes::MAX_VALUE, QT_TR_NOOP("Max. value")}, - {Attributes::MIN_VALUE, QT_TR_NOOP("Min. value")}, {Attributes::START, QT_TR_NOOP("Start value")}, + {Attributes::Increment, QT_TR_NOOP("Increment")}, {Attributes::MaxValue, QT_TR_NOOP("Max. value")}, + {Attributes::MinValue, QT_TR_NOOP("Min. value")}, {Attributes::START, QT_TR_NOOP("Start value")}, {Attributes::LastValue, QT_TR_NOOP("Last value")}, {Attributes::SUBTYPE, QT_TR_NOOP("Subtype")}, {Attributes::OP_CLASS, QT_TR_NOOP("Op. class")}, {Attributes::CanonicalFunc, QT_TR_NOOP("Canonical func.")}, {Attributes::SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {Attributes::Deferrable, QT_TR_NOOP("Deferrable")}, @@ -104,7 +104,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Commands, QT_TR_NOOP("Commands")}, {Attributes::POSITION, QT_TR_NOOP("Position")}, {Attributes::ComparisonType, QT_TR_NOOP("Comparison type")}, {Attributes::DelAction, QT_TR_NOOP("On delete")}, {Attributes::DstColumns, QT_TR_NOOP("Ref. columns")}, {Attributes::Expressions, QT_TR_NOOP("Expressions")}, - {Attributes::Factor, QT_TR_NOOP("Fill factor")}, {Attributes::NO_INHERIT, QT_TR_NOOP("No inherit")}, + {Attributes::Factor, QT_TR_NOOP("Fill factor")}, {Attributes::NoInherit, QT_TR_NOOP("No inherit")}, {Attributes::OP_CLASSES, QT_TR_NOOP("Op. classes")}, {Attributes::OPERATORS, QT_TR_NOOP("Operators")}, {Attributes::REF_TABLE, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SRC_COLUMNS, QT_TR_NOOP("Columns")}, @@ -113,7 +113,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::ClientEncoding, QT_TR_NOOP("Client encoding")}, {Attributes::ConfigFile, QT_TR_NOOP("Configuration file")}, {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DynamicLibraryPath, QT_TR_NOOP("Dynamic library path")}, {Attributes::DynamicSharedMemory, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HbaFile, QT_TR_NOOP("Hba file")}, - {Attributes::LISTEN_ADDRESSES, QT_TR_NOOP("Listen addresses")}, {Attributes::MAX_CONNECTIONS, QT_TR_NOOP("Max. connections")}, + {Attributes::ListenAddresses, QT_TR_NOOP("Listen addresses")}, {Attributes::MaxConnections, QT_TR_NOOP("Max. connections")}, {Attributes::PORT, QT_TR_NOOP("Listen port")}, {Attributes::SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, {Attributes::SSL, QT_TR_NOOP("SSL")}, {Attributes::SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, {Attributes::SSL_CERT_FILE, QT_TR_NOOP("SSL cert file")}, {Attributes::SSL_CRL_FILE, QT_TR_NOOP("SSL crl file")}, @@ -315,8 +315,8 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) {Attributes::Collation, ObjectType::Collation}, {Attributes::TABLE, ObjectType::Table}}; - if(attribs.count(Attributes::OBJECT_TYPE)!=0) - obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + if(attribs.count(Attributes::ObjectType)!=0) + obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); try { @@ -357,17 +357,17 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) attribs[Attributes::PERMISSION]=Catalog::parseArrayValues(attribs[Attributes::PERMISSION]).join(ElemSeparator); //Removing system schemas from object's name - if(attribs.count(Attributes::NAME)!=0 && - (attribs[Attributes::NAME].startsWith(QString("pg_catalog.")) || - attribs[Attributes::NAME].startsWith(QString("information_schema.")))) - attribs[Attributes::NAME]=attribs[Attributes::NAME].split('.').at(1); + if(attribs.count(Attributes::Name)!=0 && + (attribs[Attributes::Name].startsWith(QString("pg_catalog.")) || + attribs[Attributes::Name].startsWith(QString("information_schema.")))) + attribs[Attributes::Name]=attribs[Attributes::Name].split('.').at(1); for(auto &attrib : attribs) { attr_name=attrib.first; attr_value=attrib.second; - if(attr_name==Attributes::OBJECT_TYPE) + if(attr_name==Attributes::ObjectType) attr_value=BaseObject::getTypeName(static_cast(attr_value.toUInt())); //If the current attribute is related to a dependency object, retreive its real name @@ -383,13 +383,13 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) fmt_attribs[attr_name]=attr_value; } - if(attribs[Attributes::OID].toUInt() > 0) + if(attribs[Attributes::Oid].toUInt() > 0) { attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); - attribs[Attributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_type); + attribs[Attributes::ObjectType]=BaseObject::getSchemaName(obj_type); if(attribs.count(Attributes::SIGNATURE)==0) - attribs[Attributes::SIGNATURE]=BaseObject::formatName(attribs[Attributes::NAME]); + attribs[Attributes::SIGNATURE]=BaseObject::formatName(attribs[Attributes::Name]); if(attribs.count(Attributes::SCHEMA)!=0) attribs[Attributes::SIGNATURE]=QString("%1.%2") @@ -457,7 +457,7 @@ void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) formatOidAttribs(attribs, { Attributes::TYPES }, ObjectType::Type, true); attribs[Attributes::SIGNATURE]=(QString("%1(%2)") - .arg(BaseObject::formatName(attribs[Attributes::NAME])) + .arg(BaseObject::formatName(attribs[Attributes::Name])) .arg(attribs[Attributes::TYPES])).replace(ElemSeparator, QString(",")); attribs[Attributes::STATE_TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::STATE_TYPE]); @@ -477,12 +477,12 @@ void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { Attributes::AdminRoles, - Attributes::MEMBER_ROLES, + Attributes::MemberRoles, Attributes::REF_ROLES }, ObjectType::Role, true); formatBooleanAttribs(attribs, { Attributes::SUPERUSER, Attributes::Inherit, Attributes::CreateRole, Attributes::CreateDb, - Attributes::LOGIN, Attributes::Encrypted, + Attributes::Login, Attributes::Encrypted, Attributes::REPLICATION }); } @@ -494,7 +494,7 @@ void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { Attributes::NOT_NULL }); + formatBooleanAttribs(attribs, { Attributes::NotNull }); attribs[Attributes::TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::TYPE]); } @@ -513,7 +513,7 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) formatOidAttribs(attribs, { Attributes::ArgTypes }, ObjectType::Type, true); attribs[Attributes::SIGNATURE]=(QString("%1(%2)") - .arg(BaseObject::formatName(attribs[Attributes::NAME])) + .arg(BaseObject::formatName(attribs[Attributes::Name])) .arg(attribs[Attributes::ArgTypes])).replace(ElemSeparator, QString(",")); formatBooleanAttribs(attribs, { Attributes::WINDOW_FUNC, @@ -524,20 +524,20 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::Hashes, - Attributes::MERGES }); + Attributes::Merges }); formatOidAttribs(attribs, { Attributes::LeftType, Attributes::RIGHT_TYPE}, ObjectType::Type, false); formatOidAttribs(attribs, { Attributes::CommutatorOp, - Attributes::NEGATOR_OP}, ObjectType::Operator, false); + Attributes::NegatorOp}, ObjectType::Operator, false); formatOidAttribs(attribs, { Attributes::OPERATOR_FUNC, Attributes::RESTRICTION_FUNC, Attributes::JoinFunc }, ObjectType::Function, false); attribs[Attributes::SIGNATURE]=(QString("%1(%2,%3)") - .arg(BaseObject::formatName(attribs[Attributes::NAME], true)) + .arg(BaseObject::formatName(attribs[Attributes::Name], true)) .arg(attribs[Attributes::LeftType]) .arg(attribs[Attributes::RIGHT_TYPE])).replace(ElemSeparator, QString(",")); } @@ -546,7 +546,7 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) { QStringList part_keys; - formatBooleanAttribs(attribs, { Attributes::OIDS, + formatBooleanAttribs(attribs, { Attributes::Oids, Attributes::UNLOGGED, Attributes::RLS_ENABLED, Attributes::RLS_FORCED}); @@ -557,7 +557,7 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) part_keys.push_back(getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[Attributes::PART_KEY_COLS]), getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]), - attribs[Attributes::NAME]).join(ElemSeparator)); + attribs[Attributes::Name]).join(ElemSeparator)); part_keys.push_back(Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator)); part_keys.removeAll(QString()); @@ -573,8 +573,8 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) { QStringList owner_col, seq_values=Catalog::parseArrayValues(attribs[Attributes::Attribute]), - seq_attrs={ Attributes::START, Attributes::MIN_VALUE, - Attributes::MAX_VALUE, Attributes::Increment, + seq_attrs={ Attributes::START, Attributes::MinValue, + Attributes::MaxValue, Attributes::Increment, Attributes::Cache, Attributes::Cycle }; QString sch_name=getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]); @@ -591,7 +591,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) vector col_attribs=catalog.getObjectsAttributes(ObjectType::Column, names[0], names[1], { owner_col[1].toUInt() }); if(!col_attribs.empty()) - attribs[Attributes::OWNER_COLUMN]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(Attributes::NAME)); + attribs[Attributes::OWNER_COLUMN]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(Attributes::Name)); } //Retrieving the current value of the sequence by querying the database @@ -601,7 +601,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) ResultSet res; conn.connect(); - conn.executeDMLCommand(QString("SELECT last_value FROM \"%1\".\"%2\"").arg(sch_name).arg(BaseObject::formatName(attribs[Attributes::NAME])), res); + conn.executeDMLCommand(QString("SELECT last_value FROM \"%1\".\"%2\"").arg(sch_name).arg(BaseObject::formatName(attribs[Attributes::Name])), res); if(res.accessTuple(ResultSet::FirstTuple)) attribs[Attributes::LastValue]=res.getColumnValue(QString("last_value")); @@ -616,7 +616,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatViewAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { Attributes::MATERIALIZED }); + formatBooleanAttribs(attribs, { Attributes::Materialized }); } void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) @@ -731,10 +731,10 @@ void DatabaseExplorerWidget::formatRuleAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatColumnAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { Attributes::NOT_NULL, + formatBooleanAttribs(attribs, { Attributes::NotNull, Attributes::Inherited }); - attribs[Attributes::POSITION]=attribs[Attributes::OID]; - attribs.erase(Attributes::OID); + attribs[Attributes::POSITION]=attribs[Attributes::Oid]; + attribs.erase(Attributes::Oid); attribs.erase(Attributes::TYPE_OID); } @@ -750,7 +750,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) QStringList names=getObjectName(ObjectType::Table, attribs[Attributes::TABLE]).split('.'); formatBooleanAttribs(attribs, { Attributes::Deferrable, - Attributes::NO_INHERIT }); + Attributes::NoInherit }); attribs[Attributes::TYPE]=~types[attribs[Attributes::TYPE]]; attribs[Attributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES])).join(ElemSeparator); @@ -828,28 +828,28 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) try { if(attribs.empty() || - attribs[Attributes::OID].isEmpty() || - attribs[Attributes::OID]==QString("0") || - attribs[Attributes::NAME].isEmpty()) + attribs[Attributes::Oid].isEmpty() || + attribs[Attributes::Oid]==QString("0") || + attribs[Attributes::Name].isEmpty()) return(DepNotDefined); else { - ObjectType obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + ObjectType obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); attribs_map aux_attribs; - QString oid=attribs[Attributes::OID], + QString oid=attribs[Attributes::Oid], obj_name=DepNotFound.arg(oid), sch_name; if(obj_type!=ObjectType::Type) - obj_name=BaseObject::formatName(attribs[Attributes::NAME], obj_type==ObjectType::Operator); + obj_name=BaseObject::formatName(attribs[Attributes::Name], obj_type==ObjectType::Operator); else - obj_name=attribs[Attributes::NAME]; + obj_name=attribs[Attributes::Name]; //Retrieving the schema name if(!attribs[Attributes::SCHEMA].isEmpty() && attribs[Attributes::SCHEMA]!=QString("0")) { aux_attribs=catalog.getObjectAttributes(ObjectType::Schema, attribs[Attributes::SCHEMA].toUInt()); - sch_name=BaseObject::formatName(aux_attribs[Attributes::NAME], false); + sch_name=BaseObject::formatName(aux_attribs[Attributes::Name], false); if(!sch_name.isEmpty()) obj_name=sch_name + QString(".") + obj_name; @@ -916,7 +916,7 @@ QStringList DatabaseExplorerWidget::getObjectsNames(ObjectType obj_type, const Q //Retrieve all the objects by their oids and put them on a auxiliary map in which key is their oids attribs_vect=catalog.getObjectsAttributes(obj_type, sch_name, tab_name, oids_vect); for(attribs_map attr : attribs_vect) - attrs_map[attr[Attributes::OID]]=attr; + attrs_map[attr[Attributes::Oid]]=attr; //Retreving the names from the auxiliary map using the provided oids for(QString oid : oids) @@ -1124,23 +1124,23 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) } //Formatting the "name" attribute if it is not schema qualified else if(attribs.count(Attributes::SCHEMA) && - attribs.count(Attributes::NAME) && - !attribs[Attributes::NAME].contains('.')) + attribs.count(Attributes::Name) && + !attribs[Attributes::Name].contains('.')) { QString obj_name; if(obj_type!=ObjectType::Operator) - obj_name=BaseObject::formatName(attribs[Attributes::NAME]); + obj_name=BaseObject::formatName(attribs[Attributes::Name]); else - obj_name=attribs[Attributes::NAME]; + obj_name=attribs[Attributes::Name]; - attribs[Attributes::NAME]=BaseObject::formatName(attribs[Attributes::SCHEMA]) + QString(".") + obj_name; + attribs[Attributes::Name]=BaseObject::formatName(attribs[Attributes::SCHEMA]) + QString(".") + obj_name; } if(attribs.count(Attributes::SQL_OBJECT)==0) { attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); - attribs[Attributes::OBJECT_TYPE]=BaseObject::getSchemaName(obj_type); + attribs[Attributes::ObjectType]=BaseObject::getSchemaName(obj_type); } for(auto &attr : attribs) @@ -1180,7 +1180,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i obj_name.remove(QRegExp("( )+(\\[)(.)+(\\])")); //Formatting the names - attribs[Attributes::NAME]=BaseObject::formatName(obj_name, obj_type==ObjectType::Operator); + attribs[Attributes::Name]=BaseObject::formatName(obj_name, obj_type==ObjectType::Operator); attribs[Attributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); attribs[Attributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); @@ -1188,17 +1188,17 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i if(obj_type!=ObjectType::Index && TableObject::isTableObject(obj_type)) { attribs[Attributes::TABLE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::TABLE]; - attribs[Attributes::SIGNATURE]=attribs[Attributes::NAME] + QString(" ON %1").arg(attribs[Attributes::TABLE]); + attribs[Attributes::SIGNATURE]=attribs[Attributes::Name] + QString(" ON %1").arg(attribs[Attributes::TABLE]); } //For operators and functions there must exist the signature attribute else if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function) - attribs[Attributes::SIGNATURE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::NAME] + QString("(%1)").arg(types.join(ElemSeparator)); + attribs[Attributes::SIGNATURE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::Name] + QString("(%1)").arg(types.join(ElemSeparator)); else if(obj_type==ObjectType::Cast) attribs[Attributes::SIGNATURE]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); else if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); - attribs[Attributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[Attributes::NAME]).arg(aux_attribs[Attributes::IndexType]); + attribs[Attributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[Attributes::Name]).arg(aux_attribs[Attributes::IndexType]); } else { @@ -1208,19 +1208,19 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); - if(aux_attribs[Attributes::MATERIALIZED] == Attributes::True) + if(aux_attribs[Attributes::Materialized] == Attributes::True) { attribs[Attributes::SQL_OBJECT] = - QString("%1 %2").arg(Attributes::MATERIALIZED.toUpper()) + QString("%1 %2").arg(Attributes::Materialized.toUpper()) .arg(BaseObject::getSQLName(ObjectType::View)); } } if(!attribs[Attributes::SCHEMA].isEmpty() && - attribs[Attributes::NAME].indexOf(attribs[Attributes::SCHEMA] + QString(".")) < 0) - attribs[Attributes::SIGNATURE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::NAME]; + attribs[Attributes::Name].indexOf(attribs[Attributes::SCHEMA] + QString(".")) < 0) + attribs[Attributes::SIGNATURE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::Name]; else - attribs[Attributes::SIGNATURE]=attribs[Attributes::NAME]; + attribs[Attributes::SIGNATURE]=attribs[Attributes::Name]; } return(attribs); @@ -1493,13 +1493,13 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) attribs_map ref_table, ref_schema; QStringList tab_list; - ref_fks = catalog.getObjectsAttributes(ObjectType::Constraint, QString(), QString(), {}, {{ Attributes::CustomFilter, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[Attributes::OID])}}); + ref_fks = catalog.getObjectsAttributes(ObjectType::Constraint, QString(), QString(), {}, {{ Attributes::CustomFilter, QString("contype='f' AND cs.confrelid=%1").arg(orig_attribs[Attributes::Oid])}}); for(auto &fk : ref_fks) { ref_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::TABLE].toUInt()); ref_schema = catalog.getObjectAttributes(ObjectType::Schema, ref_table[Attributes::SCHEMA].toUInt()); - tab_list.push_back(QString("%1.%2").arg(ref_schema[Attributes::NAME]).arg(ref_table[Attributes::NAME])); + tab_list.push_back(QString("%1.%2").arg(ref_schema[Attributes::Name]).arg(ref_table[Attributes::Name])); } if(!tab_list.isEmpty()) @@ -1606,7 +1606,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) cached_attribs=item->data(DatabaseImportForm::ObjectOtherData,Qt::UserRole).value(); - if(cached_attribs[Attributes::OBJECT_TYPE]==BaseObject::getSchemaName(ObjectType::Constraint) && item->childCount()==0) + if(cached_attribs[Attributes::ObjectType]==BaseObject::getSchemaName(ObjectType::Constraint) && item->childCount()==0) { QTreeWidgetItem *fk_item=nullptr, *src_item=nullptr; @@ -1653,7 +1653,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } } } - else if(cached_attribs[Attributes::OBJECT_TYPE] == BaseObject::getSchemaName(ObjectType::Table) && + else if(cached_attribs[Attributes::ObjectType] == BaseObject::getSchemaName(ObjectType::Table) && !cached_attribs[Attributes::REFERRERS].isEmpty() && item->childCount() == 5) { QTreeWidgetItem *refs_item=nullptr, *tab_item=nullptr; @@ -1727,7 +1727,7 @@ void DatabaseExplorerWidget::finishObjectRename(void) ObjectType obj_type=static_cast(rename_item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt()); objects_trw->closePersistentEditor(rename_item); - attribs[Attributes::NEW_NAME]=BaseObject::formatName(rename_item->text(0), obj_type==ObjectType::Operator); + attribs[Attributes::NewName]=BaseObject::formatName(rename_item->text(0), obj_type==ObjectType::Operator); //Generate the drop command schparser.ignoreEmptyAttributes(true); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 0ab4bd6890..8eb06f37f2 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -658,12 +658,12 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW db_item=new QTreeWidgetItem; db_item->setText(0, import_helper.getCurrentDatabase()); db_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ObjectType::Database))); - attribs=catalog.getObjectsAttributes(ObjectType::Database, QString(), QString(), {}, {{Attributes::NAME, import_helper.getCurrentDatabase()}}); + attribs=catalog.getObjectsAttributes(ObjectType::Database, QString(), QString(), {}, {{Attributes::Name, import_helper.getCurrentDatabase()}}); - db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(Attributes::OID).toUInt()); + db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(Attributes::Oid).toUInt()); db_item->setData(ObjectTypeId, Qt::UserRole, ~ObjectType::Database); - db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(Attributes::OID))); + db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(Attributes::Oid))); tree_wgt->addTopLevelItem(db_item); } @@ -787,16 +787,16 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe for(attribs_map &attribs : objects_vect) { - obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); group=gen_groups[obj_type]; group->setData(ObjectCount, Qt::UserRole, group->data(ObjectCount, Qt::UserRole).toUInt() + 1); //Creates individual items for each object of the current type - oid=attribs[Attributes::OID].toUInt(); + oid=attribs[Attributes::Oid].toUInt(); - attribs[Attributes::NAME].remove(QRegExp(QString("( )(without)( time zone)"))); - label=name=attribs[Attributes::NAME]; + attribs[Attributes::Name].remove(QRegExp(QString("( )(without)( time zone)"))); + label=name=attribs[Attributes::Name]; //Removing the trailing type string from op. families or op. classes names if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) @@ -810,8 +810,8 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item=new QTreeWidgetItem(group); item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(obj_type))); item->setText(0, label); - item->setText(ObjectId, attribs[Attributes::OID].rightJustified(10, '0')); - item->setData(ObjectId, Qt::UserRole, attribs[Attributes::OID].toUInt()); + item->setText(ObjectId, attribs[Attributes::Oid].rightJustified(10, '0')); + item->setData(ObjectId, Qt::UserRole, attribs[Attributes::Oid].toUInt()); item->setData(ObjectName, Qt::UserRole, name); if(checkable_items) diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 9f818cf2a9..71488f0dc8 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -204,7 +204,7 @@ void DatabaseImportHelper::retrieveSystemObjects(void) while(itr!=objects.end() && !import_canceled) { - oid=itr->at(Attributes::OID).toUInt(); + oid=itr->at(Attributes::Oid).toUInt(); (*obj_map)[oid]=(*itr); itr++; } @@ -238,7 +238,7 @@ void DatabaseImportHelper::retrieveUserObjects(void) while(itr!=objects.end() && !import_canceled) { - oid=itr->at(Attributes::OID).toUInt(); + oid=itr->at(Attributes::Oid).toUInt(); user_objs[oid]=(*itr); itr++; } @@ -278,7 +278,7 @@ void DatabaseImportHelper::retrieveTableColumns(const QString &sch_name, const Q for(auto &itr : cols) { - col_oid=itr.at(Attributes::OID).toUInt(); + col_oid=itr.at(Attributes::Oid).toUInt(); tab_oid=itr.at(Attributes::TABLE).toUInt(); columns[tab_oid][col_oid]=itr; } @@ -303,7 +303,7 @@ void DatabaseImportHelper::createObjects(void) { oid=creation_order[i]; attribs=user_objs[oid]; - obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); try { @@ -312,9 +312,9 @@ void DatabaseImportHelper::createObjects(void) if(obj_type!=ObjectType::Constraint) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2), oid `%3'...") - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(obj_type)) - .arg(attribs[Attributes::OID]), + .arg(attribs[Attributes::Oid]), obj_type); createObject(attribs); @@ -357,14 +357,14 @@ void DatabaseImportHelper::createObjects(void) while(itr!=itr_end && !import_canceled) { attribs=user_objs[*itr]; - obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); itr++; emit s_progressUpdated(progress, trUtf8("Trying to recreate object `%1' (%2), oid `%3'...") - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(obj_type)) - .arg(attribs[Attributes::OID]), + .arg(attribs[Attributes::Oid]), obj_type); try @@ -426,7 +426,7 @@ void DatabaseImportHelper::createConstraints(void) { emit s_progressUpdated(progress, trUtf8("Creating object `%1' (%2)...") - .arg(attribs[Attributes::NAME]) + .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Constraint)), ObjectType::Constraint); @@ -461,9 +461,9 @@ void DatabaseImportHelper::createPermissions(void) while(itr_obj!=obj_perms.end() && !import_canceled) { attribs=user_objs[*itr_obj]; - obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); emit s_progressUpdated(progress, - msg.arg(getObjectName(attribs[Attributes::OID])) + msg.arg(getObjectName(attribs[Attributes::Oid])) .arg(BaseObject::getTypeName(obj_type)), ObjectType::Permission); createPermission(attribs); @@ -482,9 +482,9 @@ void DatabaseImportHelper::createPermissions(void) while(itr!=itr_cols->second.end()) { attribs=columns[itr_cols->first][*itr]; - obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); emit s_progressUpdated(progress, - msg.arg(getObjectName(attribs[Attributes::OID])) + msg.arg(getObjectName(attribs[Attributes::Oid])) .arg(BaseObject::getTypeName(obj_type)), ObjectType::Permission); createPermission(attribs); @@ -659,9 +659,9 @@ void DatabaseImportHelper::cancelImport(void) void DatabaseImportHelper::createObject(attribs_map &attribs) { - unsigned oid=attribs[Attributes::OID].toUInt(); - ObjectType obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); - QString obj_name=getObjectName(attribs[Attributes::OID], (obj_type==ObjectType::Function || obj_type==ObjectType::Operator)); + unsigned oid=attribs[Attributes::Oid].toUInt(); + ObjectType obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); + QString obj_name=getObjectName(attribs[Attributes::Oid], (obj_type==ObjectType::Function || obj_type==ObjectType::Operator)); //Avoiding the creation of pgModeler's temp objects created in database during the catalog reading if(obj_name.contains(Catalog::PgModelerTempDbObj)) @@ -749,7 +749,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) catch(Exception &e) { throw Exception(Exception::getErrorMessage(ErrorCode::ObjectNotImported) - .arg(obj_name).arg(BaseObject::getTypeName(obj_type)).arg(attribs[Attributes::OID]), + .arg(obj_name).arg(BaseObject::getTypeName(obj_type)).arg(attribs[Attributes::Oid]), ErrorCode::ObjectNotImported,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs)); } } @@ -822,13 +822,13 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType /* If the attributes of the dependency exists but it was not created on the model yet, pgModeler will create it and it's dependencies recursively */ if(recursive_dep_res && !TableObject::isTableObject(obj_type) && - obj_type!=ObjectType::Database && dbmodel->getObjectIndex(obj_attr[Attributes::NAME], obj_type) < 0) + obj_type!=ObjectType::Database && dbmodel->getObjectIndex(obj_attr[Attributes::Name], obj_type) < 0) createObject(obj_attr); if(use_signature) obj_name=obj_attr[Attributes::SIGNATURE]=getObjectName(oid, true); else - obj_name=obj_attr[Attributes::NAME]=getObjectName(oid); + obj_name=obj_attr[Attributes::Name]=getObjectName(oid); if(generate_xml) { @@ -869,7 +869,7 @@ void DatabaseImportHelper::loadObjectXML(ObjectType obj_type, attribs_map &attri if(debug_mode) { QTextStream ts(stdout); - ts << QString("").arg(attribs[Attributes::NAME]).arg(attribs[Attributes::OID]) << endl; + ts << QString("").arg(attribs[Attributes::Name]).arg(attribs[Attributes::Oid]) << endl; ts << xml_buf << endl; } @@ -910,8 +910,8 @@ QString DatabaseImportHelper::dumpObjectAttributes(attribs_map &attribs) QString dump_str; dump_str+=QString("-- Raw attributes: %1 (OID: %2) --\n") - .arg(attribs[Attributes::NAME]) - .arg(attribs[Attributes::OID]); + .arg(attribs[Attributes::Name]) + .arg(attribs[Attributes::Oid]); for(auto &attr : attribs) dump_str+=QString("%1: %2\n").arg(attr.first).arg(attr.second); @@ -970,7 +970,7 @@ void DatabaseImportHelper::createRole(attribs_map &attribs) { QString role_types[]={ Attributes::REF_ROLES, Attributes::AdminRoles, - Attributes::MEMBER_ROLES }; + Attributes::MemberRoles }; for(unsigned i=0; i < 3; i++) attribs[role_types[i]]=getObjectNames(attribs[role_types[i]]).join(','); @@ -1005,7 +1005,7 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) constr.remove(constr.length() - 1, 1); constr_attrs = constr.split(QChar(':')); - aux_attribs[Attributes::NAME] = constr_attrs.at(0); + aux_attribs[Attributes::Name] = constr_attrs.at(0); expr = constr_attrs.at(1); expr.remove(0,1); @@ -1186,7 +1186,7 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) Attributes::HandlerFunc, Attributes::InlineFunc }; - lang_oid=attribs[Attributes::OID].toUInt(); + lang_oid=attribs[Attributes::Oid].toUInt(); for(unsigned i=0; i < 3; i++) { func_oid=attribs[func_types[i]].toUInt(); @@ -1330,7 +1330,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) Attributes::RIGHT_TYPE }, op_types[]= { Attributes::CommutatorOp, - Attributes::NEGATOR_OP }; + Attributes::NegatorOp }; for(unsigned i=0; i < 3; i++) attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{Attributes::REF_TYPE, func_types[i]}}); @@ -1438,8 +1438,8 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) { QStringList owner_col=attribs[Attributes::OWNER_COLUMN].split(':'), seq_attribs=Catalog::parseArrayValues(attribs[Attributes::Attribute]); - QString attr[]={ Attributes::START, Attributes::MIN_VALUE, - Attributes::MAX_VALUE, Attributes::Increment, + QString attr[]={ Attributes::START, Attributes::MinValue, + Attributes::MaxValue, Attributes::Increment, Attributes::Cache, Attributes::Cycle }; attribs[Attributes::OWNER_COLUMN]=QString(); @@ -1455,8 +1455,8 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) { Attributes::X_POS, QString("0") }, { Attributes::Y_POS, QString("0") }}; - if(attribs[Attributes::OID].toUInt() > owner_col[0].toUInt()) - seq_tab_swap[attribs[Attributes::OID]]=owner_col[0]; + if(attribs[Attributes::Oid].toUInt() > owner_col[0].toUInt()) + seq_tab_swap[attribs[Attributes::Oid]]=owner_col[0]; /* Get the table and the owner column instances so the sequence code can be disabled if the column is an identity one */ @@ -1587,7 +1587,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) } else { - QString type_name=getObjectName(attribs[Attributes::OID]), + QString type_name=getObjectName(attribs[Attributes::Oid]), func_types[]={ Attributes::InputFunc, Attributes::OUTPUT_FUNC, Attributes::RECV_FUNC, @@ -1601,7 +1601,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) /* Workaround: if importing a datatype that is part of an extension we avoid the importing of * its supporting functions (since they will not be necessary here because the type will be sql-disabled)*/ - if(!catalog.isExtensionObject(attribs[Attributes::OID].toUInt())) + if(!catalog.isExtensionObject(attribs[Attributes::Oid].toUInt())) { for(i=0; i < count; i++) { @@ -1632,7 +1632,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) try { - unsigned tab_oid=attribs[Attributes::OID].toUInt(), type_oid=0, col_idx=0; + unsigned tab_oid=attribs[Attributes::Oid].toUInt(), type_oid=0, col_idx=0; bool is_type_registered=false; Column col; vector inh_cols; @@ -1646,7 +1646,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) attribs[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); //Retrieving columns if they were not retrieved yet - if(columns[attribs[Attributes::OID].toUInt()].empty() && auto_resolve_deps) + if(columns[attribs[Attributes::Oid].toUInt()].empty() && auto_resolve_deps) { /* Since the schema name sometimes comes in form os tag it is needed extract only the name from before retrieve the columns of the table */ @@ -1655,24 +1655,24 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) sch_name.replace(QRegExp(QString("(/)(>)(\n)*")), QString()); sch_name.replace('"', QString()); sch_name=sch_name.trimmed(); - retrieveTableColumns(sch_name, attribs[Attributes::NAME]); + retrieveTableColumns(sch_name, attribs[Attributes::Name]); } - itr=itr1=columns[attribs[Attributes::OID].toUInt()].begin(); - itr_end=columns[attribs[Attributes::OID].toUInt()].end(); - attribs[Attributes::MAX_OBJ_COUNT]=QString::number(columns[attribs[Attributes::OID].toUInt()].size()); + itr=itr1=columns[attribs[Attributes::Oid].toUInt()].begin(); + itr_end=columns[attribs[Attributes::Oid].toUInt()].end(); + attribs[Attributes::MaxObjCount]=QString::number(columns[attribs[Attributes::Oid].toUInt()].size()); //Creating columns while(itr!=itr_end) { if(itr->second.count(Attributes::PERMISSION) && !itr->second.at(Attributes::PERMISSION).isEmpty()) - col_perms[tab_oid].push_back(itr->second[Attributes::OID].toUInt()); + col_perms[tab_oid].push_back(itr->second[Attributes::Oid].toUInt()); if(itr->second[Attributes::Inherited]==Attributes::True) inh_cols.push_back(col_idx); - col.setName(itr->second[Attributes::NAME]); + col.setName(itr->second[Attributes::Name]); type_oid=itr->second[Attributes::TYPE_OID].toUInt(); /* If the type has an entry on the types map and its OID is greater than system object oids, @@ -1687,13 +1687,13 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(types[type_oid][Attributes::Category] == ~CategoryType(CategoryType::Array)) { - int dim = types[type_oid][Attributes::NAME].count(QString("[]")); - QString aux_name = types[type_oid][Attributes::NAME].remove(QString("[]")); + int dim = types[type_oid][Attributes::Name].count(QString("[]")); + QString aux_name = types[type_oid][Attributes::Name].remove(QString("[]")); type_name+=BaseObject::formatName(aux_name, false); type_name+=QString("[]").repeated(dim); } else - type_name+=BaseObject::formatName(types[type_oid][Attributes::NAME], false); + type_name+=BaseObject::formatName(types[type_oid][Attributes::Name], false); is_type_registered=PgSqlType::isRegistered(type_name, dbmodel); } @@ -1720,7 +1720,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) col.setIdentityType(BaseType::Null); col.setType(PgSqlType::parseString(type_name)); - col.setNotNull(!itr->second[Attributes::NOT_NULL].isEmpty()); + col.setNotNull(!itr->second[Attributes::NotNull].isEmpty()); col.setComment(itr->second[Attributes::Comment]); //Overriding the default value if the column is identity @@ -1790,7 +1790,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) if(!partitioned_tab) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]).arg(BaseObject::getTypeName(ObjectType::Table)) + .arg(attribs[Attributes::Name]).arg(BaseObject::getTypeName(ObjectType::Table)) .arg(attribs[Attributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -1821,7 +1821,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) // Retrieving the column used by the partition key if(cols[i] != QString("0")) - part_key.setColumn(table->getColumn(getColumnName(attribs[Attributes::OID], cols[i]))); + part_key.setColumn(table->getColumn(getColumnName(attribs[Attributes::Oid], cols[i]))); else if(!exprs.isEmpty()) { part_key.setExpression(exprs.front()); @@ -2021,7 +2021,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(!parent_tab) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) - .arg(attribs[Attributes::NAME]).arg(BaseObject::getTypeName(ObjectType::Index)) + .arg(attribs[Attributes::Name]).arg(BaseObject::getTypeName(ObjectType::Index)) .arg(tab_name).arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -2235,7 +2235,7 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) void DatabaseImportHelper::createPermission(attribs_map &attribs) { - ObjectType obj_type=static_cast(attribs[Attributes::OBJECT_TYPE].toUInt()); + ObjectType obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); Permission *perm=nullptr; QString sig; @@ -2259,15 +2259,15 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) object=dbmodel; else { - sig=getObjectName(attribs[Attributes::OID], true); - object=dbmodel->getObject(getObjectName(attribs[Attributes::OID], true), obj_type); + sig=getObjectName(attribs[Attributes::Oid], true); + object=dbmodel->getObject(getObjectName(attribs[Attributes::Oid], true), obj_type); } } else { //If the object is column it's necessary to retrive the parent table to get the valid reference to column table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[Attributes::TABLE]), ObjectType::Table)); - object=table->getObject(getColumnName(attribs[Attributes::TABLE], attribs[Attributes::OID]), ObjectType::Column); + object=table->getObject(getColumnName(attribs[Attributes::TABLE], attribs[Attributes::Oid]), ObjectType::Column); } } @@ -2513,7 +2513,7 @@ void DatabaseImportHelper::__createTableInheritances(void) if(!inh_list.isEmpty()) { //Get the child table resolving it's name from the oid - child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][Attributes::OID]), ObjectType::Table)); + child_tab=dynamic_cast
(dbmodel->getObject(getObjectName(user_objs[oid][Attributes::Oid]), ObjectType::Table)); while(!inh_list.isEmpty()) { @@ -2592,8 +2592,8 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f else { QString sch_name, - obj_name=obj_attr[Attributes::NAME]; - ObjectType obj_type=static_cast(obj_attr[Attributes::OBJECT_TYPE].toUInt()); + obj_name=obj_attr[Attributes::Name]; + ObjectType obj_type=static_cast(obj_attr[Attributes::ObjectType].toUInt()); //If the object accepts an schema retrieve the schema name too if(BaseObject::acceptsSchema(obj_type)) @@ -2683,7 +2683,7 @@ QString DatabaseImportHelper::getColumnName(const QString &tab_oid_str, const QS if(prepend_tab_name) col_name=getObjectName(tab_oid_str) + QString("."); - col_name+=columns[tab_oid][col_id].at(Attributes::NAME); + col_name+=columns[tab_oid][col_id].at(Attributes::Name); } return(col_name); @@ -2707,7 +2707,7 @@ QStringList DatabaseImportHelper::getColumnNames(const QString &tab_oid_str, con col_id=col_ids[i].toUInt(); if(columns[tab_oid].count(col_id)) - col_names.push_back(tab_name + columns[tab_oid][col_id].at(Attributes::NAME)); + col_names.push_back(tab_name + columns[tab_oid][col_id].at(Attributes::Name)); } } @@ -2721,7 +2721,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, attribs_map type_attr; QString xml_def, sch_name, obj_name, aux_name; unsigned type_oid=oid_str.toUInt(), elem_tp_oid = 0, - dimension=0, object_id=type_attr[Attributes::OBJECT_ID].toUInt(); + dimension=0, object_id=type_attr[Attributes::ObjectId].toUInt(); bool is_derivated_from_obj = false; if(type_oid > 0) @@ -2731,19 +2731,19 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, //Special treatment for array types. Removes the [] descriptor when generating XML code for the type if(!type_attr.empty() && type_attr[Attributes::Category]==QString("A") && - type_attr[Attributes::NAME].contains(QString("[]"))) + type_attr[Attributes::Name].contains(QString("[]"))) { - obj_name=type_attr[Attributes::NAME]; + obj_name=type_attr[Attributes::Name]; elem_tp_oid=type_attr[Attributes::Element].toUInt(); if(generate_xml) { - dimension=type_attr[Attributes::NAME].count(QString("[]")); + dimension=type_attr[Attributes::Name].count(QString("[]")); obj_name.remove(QString("[]")); } } else - obj_name=type_attr[Attributes::NAME]; + obj_name=type_attr[Attributes::Name]; /* If the type was generated from a table/sequence/view/domain and the source object is not yet imported and the auto resolve deps is enabled, we need to import it */ @@ -2762,7 +2762,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, obj_type=ObjectType::Sequence; is_derivated_from_obj = true; - getDependencyObject(type_attr[Attributes::OBJECT_ID], obj_type, true, true, false); + getDependencyObject(type_attr[Attributes::ObjectId], obj_type, true, true, false); } /* Removing the optional modifier "without time zone" from date/time types. @@ -2798,7 +2798,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, if(generate_xml) { - extra_attribs[Attributes::NAME]=obj_name; + extra_attribs[Attributes::Name]=obj_name; extra_attribs[Attributes::Dimension]=(dimension > 0 ? QString::number(dimension) : QString()); schparser.ignoreUnkownAttributes(true); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index ec03fb8827..13aad26b3b 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -300,8 +300,8 @@ void DataManipulationForm::listColumns(void) for(auto &col : cols) { - col_names.push_back(col[Attributes::NAME]); - code_compl_wgt->insertCustomItem(col[Attributes::NAME], {}, + col_names.push_back(col[Attributes::Name]); + code_compl_wgt->insertCustomItem(col[Attributes::Name], {}, QPixmap(PgModelerUiNs::getIconPath("column"))); } @@ -760,7 +760,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin columns=catalog.getObjectsAttributes(ObjectType::Column, schema, table, col_ids); for(auto &col : columns) - pk_col_names.push_back(col[Attributes::NAME]); + pk_col_names.push_back(col[Attributes::Name]); } catalog.closeConnection(); @@ -822,17 +822,17 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::REF_TABLE].toUInt()); aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") - .arg(aux_schema[Attributes::NAME]) - .arg(aux_table[Attributes::NAME]) - .arg(fk[Attributes::NAME]); + .arg(aux_schema[Attributes::Name]) + .arg(aux_table[Attributes::Name]) + .arg(fk[Attributes::Name]); //Store the referenced schema and table names - fk_infos[fk_name][Attributes::REF_TABLE] = aux_table[Attributes::NAME]; - fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::NAME]; + fk_infos[fk_name][Attributes::REF_TABLE] = aux_table[Attributes::Name]; + fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::Name]; action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), - QString("%1.%2 (%3)").arg(aux_schema[Attributes::NAME]) - .arg(aux_table[Attributes::NAME]) - .arg(fk[Attributes::NAME]), this, SLOT(browseReferencedTable())); + QString("%1.%2 (%3)").arg(aux_schema[Attributes::Name]) + .arg(aux_table[Attributes::Name]) + .arg(fk[Attributes::Name]), this, SLOT(browseReferencedTable())); action->setData(fk_name); col_ids.clear(); @@ -843,7 +843,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin col_ids.push_back(id.toUInt()); for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, schema, table, col_ids)) - name_list.push_back(BaseObject::formatName(col[Attributes::NAME])); + name_list.push_back(BaseObject::formatName(col[Attributes::Name])); fk_infos[fk_name][Attributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); @@ -854,8 +854,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(QString id : Catalog::parseArrayValues(fk[Attributes::DstColumns])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[Attributes::NAME], aux_table[Attributes::NAME], col_ids)) - name_list.push_back(BaseObject::formatName(col[Attributes::NAME])); + for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[Attributes::Name], aux_table[Attributes::Name], col_ids)) + name_list.push_back(BaseObject::formatName(col[Attributes::Name])); fk_infos[fk_name][Attributes::DstColumns] = name_list.join(Table::DataSeparator); } @@ -874,26 +874,26 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::TABLE].toUInt()); aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") - .arg(aux_schema[Attributes::NAME]) - .arg(aux_table[Attributes::NAME]) - .arg(fk[Attributes::NAME]); + .arg(aux_schema[Attributes::Name]) + .arg(aux_table[Attributes::Name]) + .arg(fk[Attributes::Name]); //Storing the source columns in a string for(QString id : Catalog::parseArrayValues(fk[Attributes::SRC_COLUMNS])) col_ids.push_back(id.toUInt()); - for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[Attributes::NAME], aux_table[Attributes::NAME], col_ids)) - name_list.push_back(BaseObject::formatName(col[Attributes::NAME])); + for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[Attributes::Name], aux_table[Attributes::Name], col_ids)) + name_list.push_back(BaseObject::formatName(col[Attributes::Name])); action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), - QString("%1.%2 (%3)").arg(aux_schema[Attributes::NAME]) - .arg(aux_table[Attributes::NAME]) - .arg(fk[Attributes::NAME]), this, SLOT(browseReferrerTable())); + QString("%1.%2 (%3)").arg(aux_schema[Attributes::Name]) + .arg(aux_table[Attributes::Name]) + .arg(fk[Attributes::Name]), this, SLOT(browseReferrerTable())); action->setData(fk_name); ref_fk_infos[fk_name][Attributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); - ref_fk_infos[fk_name][Attributes::TABLE] = aux_table[Attributes::NAME]; - ref_fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::NAME]; + ref_fk_infos[fk_name][Attributes::TABLE] = aux_table[Attributes::Name]; + ref_fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::Name]; } } diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index da719cdc0a..2a7b02d0cb 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -120,12 +120,12 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]=QString(); config_params[Attributes::Configuration][Attributes::CodeCompletion]=QString(); config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]=QString(); - config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]=QString(); - config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]=QString(); - config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]=QString(); + config_params[Attributes::Configuration][Attributes::LineNumbersColor]=QString(); + config_params[Attributes::Configuration][Attributes::LineNumbersBgColor]=QString(); + config_params[Attributes::Configuration][Attributes::LineHighlightColor]=QString(); config_params[Attributes::Configuration][Attributes::HighlightLines]=QString(); config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=QString(); - config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY]=QString(); + config_params[Attributes::Configuration][Attributes::MinObjectOpacity]=QString(); config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString(); config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]=QString(); config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]=QString(); @@ -304,7 +304,7 @@ void GeneralConfigWidget::loadConfiguration(void) portrait_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::PORTRAIT); landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::Landscape); - min_obj_opacity_spb->setValue(config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY].toUInt()); + min_obj_opacity_spb->setValue(config_params[Attributes::Configuration][Attributes::MinObjectOpacity].toUInt()); margin=config_params[Attributes::Configuration][Attributes::PAPER_MARGIN].split(','); custom_size=config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE].split(','); @@ -325,9 +325,9 @@ void GeneralConfigWidget::loadConfiguration(void) font_size_spb->setValue(config_params[Attributes::Configuration][Attributes::CodeFontSize].toDouble()); disp_line_numbers_chk->setChecked(config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]==Attributes::True); hightlight_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::HighlightLines]==Attributes::True); - line_numbers_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]); - line_numbers_bg_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]); - line_highlight_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]); + line_numbers_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LineNumbersColor]); + line_numbers_bg_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LineNumbersBgColor]); + line_highlight_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LineHighlightColor]); source_editor_edt->setText(config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]); source_editor_args_edt->setText(config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_ARGS]); @@ -351,7 +351,7 @@ void GeneralConfigWidget::loadConfiguration(void) w = itr.second[Attributes::WIDTH].toInt(); h = itr.second[Attributes::Height].toInt(); widgets_geom[itr.first].geometry = QRect(QPoint(x,y), QSize(w, h)); - widgets_geom[itr.first].maximized = itr.second[Attributes::MAXIMIZED] == Attributes::True; + widgets_geom[itr.first].maximized = itr.second[Attributes::Maximized] == Attributes::True; } } @@ -480,7 +480,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::ConfirmValidation]=(confirm_validation_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CodeCompletion]=(code_completion_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CodeTabWidth]=QString::number(tab_width_chk->isChecked() ? tab_width_spb->value() : 0); - config_params[Attributes::Configuration][Attributes::MIN_OBJECT_OPACITY]=QString::number(min_obj_opacity_spb->value()); + config_params[Attributes::Configuration][Attributes::MinObjectOpacity]=QString::number(min_obj_opacity_spb->value()); config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString::number(history_max_length_spb->value()); config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? Attributes::True : QString()); @@ -512,9 +512,9 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::CodeFontSize]=QString::number(font_size_spb->value()); config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]=(disp_line_numbers_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::HighlightLines]=(hightlight_lines_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_COLOR]=line_numbers_cp->getColor(0).name(); - config_params[Attributes::Configuration][Attributes::LINE_NUMBERS_BG_COLOR]=line_numbers_bg_cp->getColor(0).name(); - config_params[Attributes::Configuration][Attributes::LINE_HIGHLIGHT_COLOR]=line_highlight_cp->getColor(0).name(); + config_params[Attributes::Configuration][Attributes::LineNumbersColor]=line_numbers_cp->getColor(0).name(); + config_params[Attributes::Configuration][Attributes::LineNumbersBgColor]=line_numbers_bg_cp->getColor(0).name(); + config_params[Attributes::Configuration][Attributes::LineHighlightColor]=line_highlight_cp->getColor(0).name(); config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]=source_editor_edt->text(); config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_ARGS]=source_editor_args_edt->text(); @@ -549,7 +549,7 @@ void GeneralConfigWidget::saveConfiguration(void) schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } else if(itr->first==Attributes::VALIDATOR || - itr->first==Attributes::OBJECT_FINDER || + itr->first==Attributes::ObjectFinder || itr->first==Attributes::SQL_TOOL) { schparser.ignoreUnkownAttributes(true); @@ -572,7 +572,7 @@ void GeneralConfigWidget::saveConfiguration(void) attribs[Attributes::Y_POS] = QString::number(itr.second.geometry.top()); attribs[Attributes::WIDTH] = QString::number(itr.second.geometry.width()); attribs[Attributes::Height] = QString::number(itr.second.geometry.height()); - attribs[Attributes::MAXIMIZED] = itr.second.maximized ? Attributes::True : QString(); + attribs[Attributes::Maximized] = itr.second.maximized ? Attributes::True : QString(); schparser.ignoreUnkownAttributes(true); config_params[Attributes::Configuration][Attributes::WIDGETS_GEOMETRY]+= diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 5a39da9846..b8e7761333 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1838,13 +1838,13 @@ void MainWindow::storeDockWidgetsSettings(void) conf_wgt->addConfigurationParam(Attributes::VALIDATOR, params); params.clear(); - params[Attributes::OBJECT_FINDER]=Attributes::True; + params[Attributes::ObjectFinder]=Attributes::True; params[Attributes::SELECT_OBJECTS]=(obj_finder_wgt->select_btn->isChecked() ? Attributes::True : QString()); params[Attributes::FadeInObjects]=(obj_finder_wgt->fade_btn->isChecked() ? Attributes::True : QString()); params[Attributes::REGULAR_EXP]=(obj_finder_wgt->regexp_chk->isChecked() ? Attributes::True : QString()); params[Attributes::CaseSensitive]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? Attributes::True : QString()); params[Attributes::ExactMatch]=(obj_finder_wgt->exact_match_chk->isChecked() ? Attributes::True : QString()); - conf_wgt->addConfigurationParam(Attributes::OBJECT_FINDER, params); + conf_wgt->addConfigurationParam(Attributes::ObjectFinder, params); params.clear(); params[Attributes::SQL_TOOL]=Attributes::True; @@ -1866,13 +1866,13 @@ void MainWindow::restoreDockWidgetsSettings(void) model_valid_wgt->version_cmb->setCurrentText(confs[Attributes::VALIDATOR][Attributes::PGSQL_VERSION]); } - if(confs.count(Attributes::OBJECT_FINDER)) + if(confs.count(Attributes::ObjectFinder)) { - obj_finder_wgt->select_btn->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::SELECT_OBJECTS]==Attributes::True); - obj_finder_wgt->fade_btn->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::FadeInObjects]==Attributes::True); - obj_finder_wgt->regexp_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::REGULAR_EXP]==Attributes::True); - obj_finder_wgt->case_sensitive_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::CaseSensitive]==Attributes::True); - obj_finder_wgt->exact_match_chk->setChecked(confs[Attributes::OBJECT_FINDER][Attributes::ExactMatch]==Attributes::True); + obj_finder_wgt->select_btn->setChecked(confs[Attributes::ObjectFinder][Attributes::SELECT_OBJECTS]==Attributes::True); + obj_finder_wgt->fade_btn->setChecked(confs[Attributes::ObjectFinder][Attributes::FadeInObjects]==Attributes::True); + obj_finder_wgt->regexp_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::REGULAR_EXP]==Attributes::True); + obj_finder_wgt->case_sensitive_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::CaseSensitive]==Attributes::True); + obj_finder_wgt->exact_match_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::ExactMatch]==Attributes::True); } if(confs.count(Attributes::SQL_TOOL)) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index e3c1816a53..beecc0d353 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -319,7 +319,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) //If the objects does not differ, try to compare their XML definition if(!objs_differs) xml_differs=object->isCodeDiffersFrom(aux_object, - { Attributes::MAX_OBJ_COUNT, + { Attributes::MaxObjCount, Attributes::PROTECTED, Attributes::SQL_DISABLED, Attributes::RECT_VISIBLE, diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index e4ced06426..21dffe8765 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -174,11 +174,11 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) magnifier_frm->setCursor(Qt::CrossCursor); QColor c1, c2; - BaseObjectView::getFillStyle(Attributes::OBJ_SELECTION, c1, c2); + BaseObjectView::getFillStyle(Attributes::ObjSelection, c1, c2); c1.setAlpha(50); magnifier_frm->setStyleSheet(QString("background-color: %1; border: 1px solid %2;") .arg(c1.name(QColor::HexArgb)) - .arg(BaseObjectView::getBorderStyle(Attributes::OBJ_SELECTION).color().name(QColor::HexArgb))); + .arg(BaseObjectView::getBorderStyle(Attributes::ObjSelection).color().name(QColor::HexArgb))); magnifier_area_lbl = new QLabel(this); magnifier_area_lbl->raise(); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 91be7f1cc4..d21a4a2a5e 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -98,10 +98,10 @@ void RelationshipConfigWidget::loadConfiguration(void) vector key_attribs={Attributes::TYPE}; BaseConfigWidget::loadConfiguration(GlobalAttributes::RelationshipsConf, config_params, key_attribs); - fk_to_pk_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::ConnectFkToPk); - center_pnts_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::ConnectCenterPnts); - tab_edges_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::ConnectTableEdges); - crows_foot_rb->setChecked(config_params[Attributes::Connection][Attributes::MODE]==Attributes::CrowsFoot); + fk_to_pk_rb->setChecked(config_params[Attributes::Connection][Attributes::Mode]==Attributes::ConnectFkToPk); + center_pnts_rb->setChecked(config_params[Attributes::Connection][Attributes::Mode]==Attributes::ConnectCenterPnts); + tab_edges_rb->setChecked(config_params[Attributes::Connection][Attributes::Mode]==Attributes::ConnectTableEdges); + crows_foot_rb->setChecked(config_params[Attributes::Connection][Attributes::Mode]==Attributes::CrowsFoot); deferrable_chk->setChecked(config_params[Attributes::ForeignKeys][Attributes::Deferrable]==Attributes::True); deferral_cmb->setCurrentText(config_params[Attributes::ForeignKeys][Attributes::DeferType]); @@ -145,27 +145,27 @@ void RelationshipConfigWidget::saveConfiguration(void) if(crows_foot_rb->isChecked()) - config_params[Attributes::Connection][Attributes::MODE]=Attributes::CrowsFoot; + config_params[Attributes::Connection][Attributes::Mode]=Attributes::CrowsFoot; else if(fk_to_pk_rb->isChecked()) - config_params[Attributes::Connection][Attributes::MODE]=Attributes::ConnectFkToPk; + config_params[Attributes::Connection][Attributes::Mode]=Attributes::ConnectFkToPk; else if(tab_edges_rb->isChecked()) - config_params[Attributes::Connection][Attributes::MODE]=Attributes::ConnectTableEdges; + config_params[Attributes::Connection][Attributes::Mode]=Attributes::ConnectTableEdges; else - config_params[Attributes::Connection][Attributes::MODE]=Attributes::ConnectCenterPnts; + config_params[Attributes::Connection][Attributes::Mode]=Attributes::ConnectCenterPnts; config_params[Attributes::ForeignKeys][Attributes::Deferrable]=(deferrable_chk->isChecked() ? Attributes::True : Attributes::False); config_params[Attributes::ForeignKeys][Attributes::DeferType]=deferral_cmb->currentText(); config_params[Attributes::ForeignKeys][Attributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); config_params[Attributes::ForeignKeys][Attributes::DelAction]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); - config_params[Attributes::NAME_PATTERNS][Attributes::PATTERNS]=QString(); + config_params[Attributes::NamePatterns][Attributes::PATTERNS]=QString(); for(auto &itr : patterns) { schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); config_params[itr.first]=itr.second; - config_params[Attributes::NAME_PATTERNS][Attributes::PATTERNS]+=schparser.getCodeDefinition(patterns_sch, itr.second); + config_params[Attributes::NamePatterns][Attributes::PATTERNS]+=schparser.getCodeDefinition(patterns_sch, itr.second); } BaseConfigWidget::saveConfiguration(GlobalAttributes::RelationshipsConf, config_params); diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index 021ea2e09b..46a7da444a 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -65,7 +65,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent col = 0; for(auto &tp : types) - type_names[tp[Attributes::OID].toInt()]=tp[Attributes::NAME]; + type_names[tp[Attributes::Oid].toInt()]=tp[Attributes::Name]; for(col=0; col < col_count; col++) tooltip_data.push_back(type_names[res.getColumnTypeId(col)]); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index b57e0ce817..db3e4dcb1b 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -111,7 +111,7 @@ QStringList SnippetsConfigWidget::getSnippetsIdsByObject(ObjectType obj_type) for(auto &snip : config_params) { - if(snip.second[Attributes::OBJECT]==type_name) + if(snip.second[Attributes::Object]==type_name) ids.push_back(snip.second[Attributes::Id]); } @@ -126,7 +126,7 @@ vector SnippetsConfigWidget::getSnippetsByObject(ObjectType obj_typ for(auto &snip : config_params) { - if(snip.second[Attributes::OBJECT]==type_name) + if(snip.second[Attributes::Object]==type_name) snippets.push_back(snip.second); } @@ -310,7 +310,7 @@ attribs_map SnippetsConfigWidget::getSnippetAttributes(void) return(attribs_map{ {Attributes::Id, id_edt->text()}, {Attributes::Label, label_edt->text()}, - {Attributes::OBJECT, object_id}, + {Attributes::Object, object_id}, {Attributes::PARSABLE, (parsable_chk->isChecked() ? Attributes::True : Attributes::False)}, {Attributes::PLACEHOLDERS, (parsable_chk->isChecked() && placeholders_chk->isChecked() ? Attributes::True : Attributes::False)}, @@ -320,7 +320,7 @@ attribs_map SnippetsConfigWidget::getSnippetAttributes(void) void SnippetsConfigWidget::editSnippet(void) { QString snip_id=snippets_cmb->currentData().toString(); - ObjectType obj_type=BaseObject::getObjectType(config_params[snip_id].at(Attributes::OBJECT)); + ObjectType obj_type=BaseObject::getObjectType(config_params[snip_id].at(Attributes::Object)); enableEditMode(true); snippet_txt->setPlainText(config_params[snip_id].at(Attributes::Contents)); @@ -418,7 +418,7 @@ void SnippetsConfigWidget::filterSnippets(int idx) for(auto &cfg : config_params) { - if(cfg.second.at(Attributes::OBJECT)==object_id) + if(cfg.second.at(Attributes::Object)==object_id) flt_snippets[cfg.first]=cfg.second; } @@ -520,7 +520,7 @@ void SnippetsConfigWidget::configureSnippetsMenu(QMenu *snip_menu, vectorreadAll()); QJsonObject json_obj=json_doc.object(); - QString version=json_obj.value(Attributes::NEW_VERSION).toString(), + QString version=json_obj.value(Attributes::NewVersion).toString(), changelog=json_obj.value(Attributes::Changelog).toString(), date=json_obj.value(Attributes::Date).toString(); bool upd_found=(!version.isEmpty() && version!=Attributes::False); From 96231587b79125e6869a8201a9774e9a3abdd7f4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 10:39:28 -0300 Subject: [PATCH 184/425] Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 6 +- libobjrenderer/src/tableobjectview.cpp | 4 +- libparsers/src/attributes.cpp | 100 +++++++++--------- libparsers/src/attributes.h | 100 +++++++++--------- libparsers/src/schemaparser.cpp | 4 +- libpgconnector/src/catalog.cpp | 4 +- libpgmodeler/src/baseobject.cpp | 12 +-- libpgmodeler/src/baserelationship.cpp | 14 +-- libpgmodeler/src/constraint.cpp | 6 +- libpgmodeler/src/databasemodel.cpp | 54 +++++----- libpgmodeler/src/element.cpp | 6 +- libpgmodeler/src/excludeelement.cpp | 6 +- libpgmodeler/src/function.cpp | 4 +- libpgmodeler/src/index.cpp | 2 +- libpgmodeler/src/operator.cpp | 4 +- libpgmodeler/src/operatorclasselement.cpp | 8 +- libpgmodeler/src/parameter.cpp | 6 +- libpgmodeler/src/partitionkey.cpp | 2 +- libpgmodeler/src/permission.cpp | 4 +- libpgmodeler/src/pgsqltypes.cpp | 2 +- libpgmodeler/src/policy.cpp | 4 +- libpgmodeler/src/relationship.cpp | 22 ++-- libpgmodeler/src/role.cpp | 8 +- libpgmodeler/src/sequence.cpp | 8 +- libpgmodeler/src/table.cpp | 20 ++-- libpgmodeler/src/trigger.cpp | 4 +- libpgmodeler/src/type.cpp | 10 +- .../src/appearanceconfigwidget.cpp | 10 +- .../src/databaseexplorerwidget.cpp | 78 +++++++------- libpgmodeler_ui/src/databaseimporthelper.cpp | 66 ++++++------ libpgmodeler_ui/src/generalconfigwidget.cpp | 34 +++--- libpgmodeler_ui/src/mainwindow.cpp | 18 ++-- libpgmodeler_ui/src/modelsdiffhelper.cpp | 2 +- .../src/relationshipconfigwidget.cpp | 14 +-- libpgmodeler_ui/src/relationshipwidget.cpp | 4 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 14 +-- libpgmodeler_ui/src/syntaxhighlighter.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 10 +- 38 files changed, 338 insertions(+), 338 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 23121f3a9a..2f9309a4ce 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -343,7 +343,7 @@ QLinearGradient BaseObjectView::getFillStyle(const QString &id) if(!colors.empty()) { - if(id==Attributes::ObjSelection || id==Attributes::PLACEHOLDER) + if(id==Attributes::ObjSelection || id==Attributes::Placeholder) { colors[0].setAlpha(ObjectAlphaChannel); colors[1].setAlpha(ObjectAlphaChannel); @@ -629,10 +629,10 @@ void BaseObjectView::togglePlaceholder(bool visible) if(visible) { - QPen pen=BaseObjectView::getBorderStyle(Attributes::PLACEHOLDER); + QPen pen=BaseObjectView::getBorderStyle(Attributes::Placeholder); pen.setStyle(Qt::DashLine); - placeholder->setBrush(BaseObjectView::getFillStyle(Attributes::PLACEHOLDER)); + placeholder->setBrush(BaseObjectView::getFillStyle(Attributes::Placeholder)); placeholder->setPen(pen); placeholder->setRect(QRectF(QPointF(0,0),this->bounding_rect.size())); placeholder->setPos(this->mapToScene(this->bounding_rect.topLeft())); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index dd15d9da36..f69c1c14e5 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -114,7 +114,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) if(constr_type==ConstraintType::PrimaryKey) { - attrib=Attributes::PK_COLUMN; + attrib=Attributes::PkColumn; pol.append(QPointF(2,0)); pol.append(QPointF(0,2)); pol.append(QPointF(0,7)); pol.append(QPointF(2,9)); pol.append(QPointF(3,8)); pol.append(QPointF(3,6)); pol.append(QPointF(4,6)); pol.append(QPointF(5,7)); pol.append(QPointF(6,6)); @@ -209,7 +209,7 @@ void TableObjectView::configureObject(void) if(str_constr.indexOf(TextPrimaryKey)>=0) { - fmt=font_config[Attributes::PK_COLUMN]; + fmt=font_config[Attributes::PkColumn]; constr_type=ConstraintType::PrimaryKey; } else if(str_constr.indexOf(TextForeignKey)>=0) diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index b3a2f8cb9c..febb274a7a 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -336,56 +336,56 @@ namespace Attributes { OldName=QString("old-name"), OldTableName=QString("old-table-name"), OldVersion=QString("old-version"), - OP_CLASS=QString("opclass"), - OP_CLASSES=QString("opclasses"), - OP_FAMILY=QString("opfamily"), - OP_LIST_SIZE=QString("op-list-size"), - OPERATOR_FUNC=QString("operfunc"), - OPERATOR=QString("operator"), - OPERATORS=QString("operators"), - ORIGINAL_PK=QString("original-pk"), - OUTPUT_FUNC=QString("output"), - OWNER_COLUMN=QString("owner-col"), - OWNER=QString("owner"), - PAPER_CUSTOM_SIZE=QString("paper-custom-size"), - PAPER_MARGIN=QString("paper-margin"), - PAPER_ORIENTATION=QString("paper-orientation"), - PAPER_TYPE=QString("paper-type"), - PARAM_IN=QString("in"), - PARAM_OUT=QString("out"), - PARAM_VARIADIC=QString("variadic"), - PARAMETER=QString("parameter"), - PARAMETERS=QString("parameters"), - PARENT=QString("parent"), - PARENTS=QString("parents"), - PARSABLE=QString("parsable"), - PARTIAL_MATCH=QString("partial-match"), - PARTITION_KEY=QString("partitionkey"), - PARTITION_BOUND_EXPR=QString("partition-bound-expr"), - PARTITIONED_TABLE=QString("partitioned-table"), - PARTITIONING=QString("partitioning"), - PART_KEY_COLS=QString("part-key-cols"), - PART_KEY_COLLS=QString("part-key-colls"), - PART_KEY_OPCLS=QString("part-key-opcls"), - PART_KEY_EXPRS=QString("part-key-exprs"), - PASSWORD=QString("password"), - PASSWORD_ENCRYPTION=QString("password-encryption"), - PATH=QString("path"), - PATTERNS=QString("patterns"), - PER_ROW=QString("per-line"), - PERMISSION=QString("permission"), - PERMISSIVE=QString("permissive"), - PGMODELER_VERSION=QString("pgmodeler-ver"), - PGSQL_BASE_TYPE=QString("basetype"), - PGSQL_VERSION=QString("pgsql-ver"), - PLACEHOLDER=QString("placeholder"), - PLACEHOLDERS=QString("placeholders"), - PK_COL_PATTERN=QString("pk-col-pattern"), - PK_COLUMN=QString("pk-column"), - PK_CONSTR=QString("pk-constr"), - PK_PATTERN=QString("pk-pattern"), - POINTS=QString("points"), - PORT=QString("port"), + OpClass=QString("opclass"), + OpClasses=QString("opclasses"), + OpFamily=QString("opfamily"), + OpListSize=QString("op-list-size"), + OperatorFunc=QString("operfunc"), + Operator=QString("operator"), + Operators=QString("operators"), + OriginalPk=QString("original-pk"), + OutputFunc=QString("output"), + OwnerColumn=QString("owner-col"), + Owner=QString("owner"), + PaperCustomSize=QString("paper-custom-size"), + PaperMargin=QString("paper-margin"), + PaperOrientation=QString("paper-orientation"), + PaperType=QString("paper-type"), + ParamIn=QString("in"), + ParamOut=QString("out"), + ParamVariadic=QString("variadic"), + Parameter=QString("parameter"), + Parameters=QString("parameters"), + Parent=QString("parent"), + Parents=QString("parents"), + Parsable=QString("parsable"), + PartialMatch=QString("partial-match"), + PartitionKey=QString("partitionkey"), + PartitionBoundExpr=QString("partition-bound-expr"), + PartitionedTable=QString("partitioned-table"), + Partitioning=QString("partitioning"), + PartKeyCols=QString("part-key-cols"), + PartKeyColls=QString("part-key-colls"), + PartKeyOpCls=QString("part-key-opcls"), + PartKeyExprs=QString("part-key-exprs"), + Password=QString("password"), + PasswordEncryption=QString("password-encryption"), + Path=QString("path"), + Patterns=QString("patterns"), + PerRow=QString("per-line"), + Permission=QString("permission"), + Permissive=QString("permissive"), + PgModelerVersion=QString("pgmodeler-ver"), + PgSqlBaseType=QString("basetype"), + PgSqlVersion=QString("pgsql-ver"), + Placeholder=QString("placeholder"), + Placeholders=QString("placeholders"), + PkColPattern=QString("pk-col-pattern"), + PkColumn=QString("pk-column"), + PkConstr=QString("pk-constr"), + PkPattern=QString("pk-pattern"), + Points=QString("points"), + Port=QString("port"), PORTRAIT=QString("portrait"), POSITION_INFO=QString("pos-info"), POSITION=QString("position"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index f14869dd60..2e4c21fbca 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -348,56 +348,56 @@ namespace Attributes { OldName, OldTableName, OldVersion, - OP_CLASS, - OP_CLASSES, - OP_FAMILY, - OP_LIST_SIZE, - OPERATOR_FUNC, - OPERATOR, - OPERATORS, - ORIGINAL_PK, - OUTPUT_FUNC, - OWNER_COLUMN, - OWNER, - PAPER_CUSTOM_SIZE, - PAPER_MARGIN, - PAPER_ORIENTATION, - PAPER_TYPE, - PARAM_IN, - PARAM_OUT, - PARAM_VARIADIC, - PARAMETER, - PARAMETERS, - PARENT, - PARENTS, - PARSABLE, - PARTIAL_MATCH, - PARTITION_KEY, - PARTITIONED_TABLE, - PARTITION_BOUND_EXPR, - PARTITIONING, - PART_KEY_COLS, - PART_KEY_COLLS, - PART_KEY_OPCLS, - PART_KEY_EXPRS, - PASSWORD, - PASSWORD_ENCRYPTION, - PATH, - PATTERNS, - PER_ROW, - PERMISSION, - PERMISSIVE, - PGMODELER_VERSION, - PGSQL_BASE_TYPE, - PGSQL_VERSION, - PLACEHOLDER, - PLACEHOLDERS, - PK_COL_PATTERN, - PK_COLUMN, - PK_CONSTR, - PK_PATTERN, - POINTS, - PORT, + OpClass, + OpClasses, + OpFamily, + OpListSize, + OperatorFunc, + Operator, + Operators, + OriginalPk, + OutputFunc, + OwnerColumn, + Owner, + PaperCustomSize, + PaperMargin, + PaperOrientation, + PaperType, + ParamIn, + ParamOut, + ParamVariadic, + Parameter, + Parameters, + Parent, + Parents, + Parsable, + PartialMatch, + PartitionKey, + PartitionedTable, + PartitionBoundExpr, + Partitioning, + PartKeyCols, + PartKeyColls, + PartKeyOpCls, + PartKeyExprs, + Password, + PasswordEncryption, + Path, + Patterns, + PerRow, + Permission, + Permissive, + PgModelerVersion, + PgSqlBaseType, + PgSqlVersion, + Placeholder, + Placeholders, + PkColPattern, + PkColumn, + PkConstr, + PkPattern, + Points, + Port, PORTRAIT, POSITION_INFO, POSITION, diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 984a967ab0..c6c11724dc 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -891,7 +891,7 @@ QString SchemaParser::getCodeDefinition(const QString & obj_name, attribs_map &a filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::SQLSchemaDir + GlobalAttributes::DirSeparator + obj_name + GlobalAttributes::SchemaExt; - attribs[Attributes::PGSQL_VERSION]=pgsql_version; + attribs[Attributes::PgSqlVersion]=pgsql_version; //Try to get the object definitin from the specified path return(getCodeDefinition(filename, attribs)); @@ -1431,7 +1431,7 @@ QString SchemaParser::getCodeDefinition(const QString &filename, attribs_map &at try { loadFile(filename); - attribs[Attributes::PGSQL_VERSION]=pgsql_version; + attribs[Attributes::PgSqlVersion]=pgsql_version; return(getCodeDefinition(attribs)); } catch(Exception &e) diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index a438678da3..0c6fc2a2ee 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -219,7 +219,7 @@ QString Catalog::getCatalogQuery(const QString &qry_type, ObjectType obj_type, b schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - attribs[Attributes::PGSQL_VERSION]=schparser.getPgSQLVersion(); + attribs[Attributes::PgSqlVersion]=schparser.getPgSQLVersion(); sql=schparser.getCodeDefinition(attribs).simplified(); //Appeding the custom filter to the whole catalog query @@ -486,7 +486,7 @@ vector Catalog::getMultipleAttributes(const QString &catalog_sch, a schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); - attribs[Attributes::PGSQL_VERSION]=schparser.getPgSQLVersion(); + attribs[Attributes::PgSqlVersion]=schparser.getPgSQLVersion(); connection.executeDMLCommand(schparser.getCodeDefinition(attribs).simplified(), res); if(res.accessTuple(ResultSet::FirstTuple)) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 50b5a6bfc7..e13fb5205c 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -85,7 +85,7 @@ BaseObject::BaseObject(void) attributes[Attributes::Name]=QString(); attributes[Attributes::Alias]=QString(); attributes[Attributes::Comment]=QString(); - attributes[Attributes::OWNER]=QString(); + attributes[Attributes::Owner]=QString(); attributes[Attributes::TABLESPACE]=QString(); attributes[Attributes::SCHEMA]=QString(); attributes[Attributes::Collation]=QString(); @@ -746,7 +746,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) { if(def_type==SchemaParser::SqlDefinition) { - attributes[Attributes::OWNER]=owner->getName(format); + attributes[Attributes::Owner]=owner->getName(format); /** Only tablespaces and database do not have an ALTER OWNER SET because the rule says that PostgreSQL tablespaces and database should be created @@ -756,14 +756,14 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) SchemaParser sch_parser; QString filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + - Attributes::OWNER + GlobalAttributes::SchemaExt; + Attributes::Owner + GlobalAttributes::SchemaExt; sch_parser.ignoreUnkownAttributes(true); - attributes[Attributes::OWNER]=sch_parser.getCodeDefinition(filename, attributes); + attributes[Attributes::Owner]=sch_parser.getCodeDefinition(filename, attributes); } } else - attributes[Attributes::OWNER]=owner->getCodeDefinition(def_type, true); + attributes[Attributes::Owner]=owner->getCodeDefinition(def_type, true); } if(!comment.isEmpty()) @@ -1193,7 +1193,7 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff try { - QStringList attribs={ Attributes::OWNER, Attributes::SCHEMA, Attributes::TABLESPACE }; + QStringList attribs={ Attributes::Owner, Attributes::SCHEMA, Attributes::TABLESPACE }; bool accepts_obj[3]={ acceptsOwner(), acceptsSchema(), acceptsTablespace() }; BaseObject *dep_objs[3]={ this->getOwner(), this->getSchema(), this->getTablespace() }, *aux_dep_objs[3]={ object->getOwner(), object->getSchema(), object->getTablespace() }; diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 20a17ee8f2..ce387573b2 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -82,7 +82,7 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::DstRequired]=QString(); attributes[Attributes::SRC_TABLE]=QString(); attributes[Attributes::DstTable]=QString(); - attributes[Attributes::POINTS]=QString(); + attributes[Attributes::Points]=QString(); attributes[Attributes::Columns]=QString(); attributes[Attributes::Constraints]=QString(); attributes[Attributes::Elements]=QString(); @@ -105,18 +105,18 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::CopyMode]=QString(); attributes[Attributes::SRC_COL_PATTERN]=QString(); attributes[Attributes::DstColPattern]=QString(); - attributes[Attributes::PK_PATTERN]=QString(); + attributes[Attributes::PkPattern]=QString(); attributes[Attributes::UQ_PATTERN]=QString(); attributes[Attributes::SRC_FK_PATTERN]=QString(); attributes[Attributes::DstFkPattern]=QString(); - attributes[Attributes::PK_COL_PATTERN]=QString(); + attributes[Attributes::PkColPattern]=QString(); attributes[Attributes::SINGLE_PK_COLUMN]=QString(); attributes[Attributes::UPD_ACTION]=QString(); attributes[Attributes::DelAction]=QString(); attributes[Attributes::CustomColor]=QString(); attributes[Attributes::REFERENCE_FK]=QString(); - attributes[Attributes::PARTITION_BOUND_EXPR]=QString(); - attributes[Attributes::ORIGINAL_PK]=QString(); + attributes[Attributes::PartitionBoundExpr]=QString(); + attributes[Attributes::OriginalPk]=QString(); //Check if the relationship type is valid if(rel_type <= RelationshipFk) @@ -351,7 +351,7 @@ void BaseRelationship::setRelationshipAttributes(void) attributes[Attributes::Y_POS]=QString("%1").arg(points[i].y()); str_aux+=schparser.getCodeDefinition(Attributes::POSITION, attributes, SchemaParser::XmlDefinition); } - attributes[Attributes::POINTS]=str_aux; + attributes[Attributes::Points]=str_aux; str_aux=QString(); for(i=0; i < 3; i++) @@ -419,7 +419,7 @@ QString BaseRelationship::getCodeDefinition(unsigned def_type) { bool reduced_form; setRelationshipAttributes(); - reduced_form=(attributes[Attributes::POINTS].isEmpty() && + reduced_form=(attributes[Attributes::Points].isEmpty() && attributes[Attributes::LabelsPos].isEmpty()); if(!reduced_form) diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 79298234a4..3c0c0437d1 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -27,7 +27,7 @@ Constraint::Constraint(void) fill_factor=0; index_type=BaseType::Null; - attributes[Attributes::PK_CONSTR]=QString(); + attributes[Attributes::PkConstr]=QString(); attributes[Attributes::FkConstr]=QString(); attributes[Attributes::CkConstr]=QString(); attributes[Attributes::UQ_CONSTR]=QString(); @@ -663,7 +663,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) QString attrib; - attributes[Attributes::PK_CONSTR]=QString(); + attributes[Attributes::PkConstr]=QString(); attributes[Attributes::FkConstr]=QString(); attributes[Attributes::CkConstr]=QString(); attributes[Attributes::UQ_CONSTR]=QString(); @@ -675,7 +675,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attrib=Attributes::CkConstr; break; case ConstraintType::PrimaryKey: - attrib=Attributes::PK_CONSTR; + attrib=Attributes::PkConstr; break; case ConstraintType::ForeignKey: attrib=Attributes::FkConstr; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index d9cadaf27a..5043abd9c8 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3474,7 +3474,7 @@ Role *DatabaseModel::createRole(void) //Gets all the attributes values from the XML xmlparser.getElementAttributes(attribs); - role->setPassword(attribs[Attributes::PASSWORD]); + role->setPassword(attribs[Attributes::Password]); role->setValidity(attribs[Attributes::VALIDITY]); if(!attribs[Attributes::ConnLimit].isEmpty()) @@ -3738,7 +3738,7 @@ Function *DatabaseModel::createFunction(void) func->setReturnType(type); } //when the element found is a PARAMETER indicates that the function return type is a table - else if(xmlparser.getElementName()==Attributes::PARAMETER) + else if(xmlparser.getElementName()==Attributes::Parameter) { param=createParameter(); func->addReturnedTableColumn(param.getName(), param.getType()); @@ -3773,7 +3773,7 @@ Function *DatabaseModel::createFunction(void) func->setLanguage(dynamic_cast(object)); } //Gets a function parameter - else if(xmlparser.getElementName()==Attributes::PARAMETER) + else if(xmlparser.getElementName()==Attributes::Parameter) { param=createParameter(); func->addParameter(param); @@ -3850,9 +3850,9 @@ Parameter DatabaseModel::createParameter(void) while(xmlparser.accessElement(XmlParser::NextElement)); } - param.setIn(attribs[Attributes::PARAM_IN]==Attributes::True); - param.setOut(attribs[Attributes::PARAM_OUT]==Attributes::True); - param.setVariadic(attribs[Attributes::PARAM_VARIADIC]==Attributes::True); + param.setIn(attribs[Attributes::ParamIn]==Attributes::True); + param.setOut(attribs[Attributes::ParamOut]==Attributes::True); + param.setVariadic(attribs[Attributes::ParamVariadic]==Attributes::True); xmlparser.restorePosition(); } @@ -4034,7 +4034,7 @@ Type *DatabaseModel::createType(void) //Configuring an auxiliary map used to reference the functions used by base type func_types[Attributes::InputFunc]=Type::InputFunc; - func_types[Attributes::OUTPUT_FUNC]=Type::OutputFunc; + func_types[Attributes::OutputFunc]=Type::OutputFunc; func_types[Attributes::SEND_FUNC]=Type::SendFunc; func_types[Attributes::RECV_FUNC]=Type::RecvFunc; func_types[Attributes::TPMOD_IN_FUNC]=Type::TpmodInFunc; @@ -4103,7 +4103,7 @@ Type *DatabaseModel::createType(void) type->setCollation(collation); } - if(elem==Attributes::OP_CLASS) + if(elem==Attributes::OpClass) { xmlparser.getElementAttributes(attribs); op_class=dynamic_cast(getObject(attribs[Attributes::Name], ObjectType::OpClass)); @@ -4373,7 +4373,7 @@ Operator *DatabaseModel::createOperator(void) oper->setMerges(attribs[Attributes::Merges]==Attributes::True); oper->setHashes(attribs[Attributes::Hashes]==Attributes::True); - func_types[Attributes::OPERATOR_FUNC]=Operator::FUNC_OPERATOR; + func_types[Attributes::OperatorFunc]=Operator::FUNC_OPERATOR; func_types[Attributes::JoinFunc]=Operator::FUNC_JOIN; func_types[Attributes::RESTRICTION_FUNC]=Operator::FUNC_RESTRICT; @@ -4469,7 +4469,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) op_class->setDefault(attribs[Attributes::Default]==Attributes::True); elem_types[Attributes::Function]=OperatorClassElement::FunctionElem; - elem_types[Attributes::OPERATOR]=OperatorClassElement::OperatorElem; + elem_types[Attributes::Operator]=OperatorClassElement::OperatorElem; elem_types[Attributes::STORAGE]=OperatorClassElement::StorageElem; if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -4749,7 +4749,7 @@ Table *DatabaseModel::createTable(void) xmlparser.restorePosition(); } - else if(elem==Attributes::PARTITIONING) + else if(elem==Attributes::Partitioning) { xmlparser.getElementAttributes(aux_attribs); table->setPartitioningType(aux_attribs[Attributes::TYPE]); @@ -4760,7 +4760,7 @@ Table *DatabaseModel::createTable(void) do { if(xmlparser.getElementType()==XML_ELEMENT_NODE && - xmlparser.getElementName()==Attributes::PARTITION_KEY) + xmlparser.getElementName()==Attributes::PartitionKey) { createElement(part_key, nullptr, table); partition_keys.push_back(part_key); @@ -4929,7 +4929,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) //Configuring the constraint type if(attribs[Attributes::TYPE]==Attributes::CkConstr) constr_type=ConstraintType::Check; - else if(attribs[Attributes::TYPE]==Attributes::PK_CONSTR) + else if(attribs[Attributes::TYPE]==Attributes::PkConstr) constr_type=ConstraintType::PrimaryKey; else if(attribs[Attributes::TYPE]==Attributes::FkConstr) constr_type=ConstraintType::ForeignKey; @@ -5093,7 +5093,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec bool is_part_key = false; xml_elem=xmlparser.getElementName(); - is_part_key = xml_elem == Attributes::PARTITION_KEY; + is_part_key = xml_elem == Attributes::PartitionKey; if(xml_elem==Attributes::IndexElement || xml_elem==Attributes::ExcludeElement || is_part_key) { @@ -5117,7 +5117,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec if(xmlparser.getElementType()==XML_ELEMENT_NODE) { - if(xml_elem==Attributes::OP_CLASS) + if(xml_elem==Attributes::OpClass) { xmlparser.getElementAttributes(attribs); op_class=dynamic_cast(getObject(attribs[Attributes::SIGNATURE], ObjectType::OpClass)); @@ -5147,7 +5147,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setOperatorClass(op_class); } //Checking if elem is a ExcludeElement to be able to assign an operator to it - else if(xml_elem==Attributes::OPERATOR) + else if(xml_elem==Attributes::Operator) { xmlparser.getElementAttributes(attribs); oper=dynamic_cast(getObject(attribs[Attributes::SIGNATURE], ObjectType::Operator)); @@ -5494,7 +5494,7 @@ Trigger *DatabaseModel::createTrigger(void) trigger->setEvent(EventType::OnTruncate, (attribs[Attributes::TRUNC_EVENT]==Attributes::True)); - trigger->setExecutePerRow(attribs[Attributes::PER_ROW]==Attributes::True); + trigger->setExecutePerRow(attribs[Attributes::PerRow]==Attributes::True); trigger->setFiringType(FiringType(attribs[Attributes::FiringType])); @@ -5628,7 +5628,7 @@ Policy *DatabaseModel::createPolicy(void) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - policy->setPermissive(attribs[Attributes::PERMISSIVE] == Attributes::True); + policy->setPermissive(attribs[Attributes::Permissive] == Attributes::True); policy->setPolicyCommand(PolicyCmdType(attribs[Attributes::Command])); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5809,9 +5809,9 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) sequence->setCycle(attribs[Attributes::Cycle]==Attributes::True); //Getting the sequence's owner column - if(!attribs[Attributes::OWNER_COLUMN].isEmpty()) + if(!attribs[Attributes::OwnerColumn].isEmpty()) { - elem_list=attribs[Attributes::OWNER_COLUMN].split('.'); + elem_list=attribs[Attributes::OwnerColumn].split('.'); count=elem_list.count(); if(count==3) @@ -6325,8 +6325,8 @@ BaseRelationship *DatabaseModel::createRelationship(void) { QString pat_attrib[]= { Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, - Attributes::PK_PATTERN, Attributes::UQ_PATTERN, - Attributes::PK_COL_PATTERN }; + Attributes::PkPattern, Attributes::UQ_PATTERN, + Attributes::PkColPattern }; unsigned pattern_id[]= { Relationship::SrcColPattern, Relationship::DstColPattern, Relationship::SrcFkPattern, Relationship::DstFkPattern, @@ -6411,7 +6411,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) * the relationship contains a special primary key (created during relationship connection) * and the current constraint is the original one owned by one of the tables prior the connection * of the relationship. */ - if(constr_attribs[Attributes::TYPE] == Attributes::PK_CONSTR) + if(constr_attribs[Attributes::TYPE] == Attributes::PkConstr) { table = getTable(constr_attribs[Attributes::TABLE]); rel->setOriginalPrimaryKey(createConstraint(table)); @@ -6528,7 +6528,7 @@ Permission *DatabaseModel::createPermission(void) obj_type=BaseObject::getObjectType(attribs[Attributes::TYPE]); obj_name=attribs[Attributes::Name]; - parent_name=attribs[Attributes::PARENT]; + parent_name=attribs[Attributes::Parent]; //If the object is a column its needed to get the parent table if(obj_type==ObjectType::Column) @@ -6808,7 +6808,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) gen_defs_count=0; attribs_aux[Attributes::SHELL_TYPES]=QString(); - attribs_aux[Attributes::PERMISSION]=QString(); + attribs_aux[Attributes::Permission]=QString(); attribs_aux[Attributes::SCHEMA]=QString(); attribs_aux[Attributes::TABLESPACE]=QString(); attribs_aux[Attributes::ROLE]=QString(); @@ -6863,7 +6863,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } else if(obj_type==ObjectType::Permission) { - attribs_aux[Attributes::PERMISSION]+=dynamic_cast(object)->getCodeDefinition(def_type); + attribs_aux[Attributes::Permission]+=dynamic_cast(object)->getCodeDefinition(def_type); } else if(obj_type==ObjectType::Constraint) { @@ -6927,7 +6927,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[Attributes::SEARCH_PATH]=search_path; attribs_aux[Attributes::ModelAuthor]=author; - attribs_aux[Attributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; + attribs_aux[Attributes::PgModelerVersion]=GlobalAttributes::PgModelerVersion; if(def_type==SchemaParser::XmlDefinition) { diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 7c34fb5b0e..327094ce85 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -95,7 +95,7 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) { attributes[Attributes::Column]=QString(); attributes[Attributes::Expression]=QString(); - attributes[Attributes::OP_CLASS]=QString(); + attributes[Attributes::OpClass]=QString(); attributes[Attributes::USE_SORTING]=(this->sorting_enabled ? Attributes::True : QString()); attributes[Attributes::NullsFirst]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? Attributes::True : QString()); attributes[Attributes::AscOrder]=(this->sorting_enabled && this->sorting_attibs[AscOrder] ? Attributes::True : QString()); @@ -109,9 +109,9 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) if(operator_class) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::OP_CLASS]=operator_class->getName(true); + attributes[Attributes::OpClass]=operator_class->getName(true); else - attributes[Attributes::OP_CLASS]=operator_class->getCodeDefinition(def_type, true); + attributes[Attributes::OpClass]=operator_class->getCodeDefinition(def_type, true); } } diff --git a/libpgmodeler/src/excludeelement.cpp b/libpgmodeler/src/excludeelement.cpp index f7e6719dbf..620e9eab06 100644 --- a/libpgmodeler/src/excludeelement.cpp +++ b/libpgmodeler/src/excludeelement.cpp @@ -20,15 +20,15 @@ QString ExcludeElement::getCodeDefinition(unsigned def_type) attribs_map attributes; schparser.setPgSQLVersion(BaseObject::getPgSQLVersion()); - attributes[Attributes::OPERATOR]=QString(); + attributes[Attributes::Operator]=QString(); configureAttributes(attributes, def_type); if(_operator) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::OPERATOR]=_operator->getName(true); + attributes[Attributes::Operator]=_operator->getName(true); else - attributes[Attributes::OPERATOR]=_operator->getCodeDefinition(def_type, true); + attributes[Attributes::Operator]=_operator->getCodeDefinition(def_type, true); } return(schparser.getCodeDefinition(Attributes::ExcludeElement, attributes, def_type)); diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index a1f489f0e6..640be06fb5 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -30,7 +30,7 @@ Function::Function(void) execution_cost=100; row_amount=1000; - attributes[Attributes::PARAMETERS]=QString(); + attributes[Attributes::Parameters]=QString(); attributes[Attributes::ExecutionCost]=QString(); attributes[Attributes::ROW_AMOUNT]=QString(); attributes[Attributes::RETURN_TYPE]=QString(); @@ -139,7 +139,7 @@ void Function::setParametersAttribute(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) str_param.remove(str_param.size()-2,2); - attributes[Attributes::PARAMETERS]=str_param; + attributes[Attributes::Parameters]=str_param; } void Function::setTableReturnTypeAttribute(unsigned def_type) diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index c18b9ff382..ac4891e9bc 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -32,7 +32,7 @@ Index::Index(void) attributes[Attributes::Expression]=QString(); attributes[Attributes::Factor]=QString(); attributes[Attributes::PREDICATE]=QString(); - attributes[Attributes::OP_CLASS]=QString(); + attributes[Attributes::OpClass]=QString(); attributes[Attributes::NullsFirst]=QString(); attributes[Attributes::AscOrder]=QString(); attributes[Attributes::DeclInTable]=QString(); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 694ed69074..99a35d03bd 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -40,7 +40,7 @@ Operator::Operator(void) attributes[Attributes::NegatorOp]=QString(); attributes[Attributes::RESTRICTION_FUNC]=QString(); attributes[Attributes::JoinFunc]=QString(); - attributes[Attributes::OPERATOR_FUNC]=QString(); + attributes[Attributes::OperatorFunc]=QString(); attributes[Attributes::Hashes]=QString(); attributes[Attributes::Merges]=QString(); attributes[Attributes::SIGNATURE]=QString(); @@ -284,7 +284,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) op_attribs[]={ Attributes::CommutatorOp, Attributes::NegatorOp }, - func_attribs[]={Attributes::OPERATOR_FUNC, + func_attribs[]={Attributes::OperatorFunc, Attributes::JoinFunc, Attributes::RESTRICTION_FUNC}; diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 5e183b380e..f23dbeaf2a 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -129,9 +129,9 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[Attributes::STRATEGY_NUM]=QString(); attributes[Attributes::SIGNATURE]=QString(); attributes[Attributes::Function]=QString(); - attributes[Attributes::OPERATOR]=QString(); + attributes[Attributes::Operator]=QString(); attributes[Attributes::STORAGE]=QString(); - attributes[Attributes::OP_FAMILY]=QString(); + attributes[Attributes::OpFamily]=QString(); attributes[Attributes::Definition]=QString(); if(element_type==FunctionElem && function && strategy_number > 0) @@ -148,7 +148,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) else if(element_type==OperatorElem && _operator && strategy_number > 0) { //OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] [ FOR SEARCH | FOR ORDER BY sort_family_name ] - attributes[Attributes::OPERATOR]=Attributes::True; + attributes[Attributes::Operator]=Attributes::True; attributes[Attributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) @@ -159,7 +159,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) if(op_family) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::OP_FAMILY]=op_family->getName(true); + attributes[Attributes::OpFamily]=op_family->getName(true); else attributes[Attributes::Definition]+=op_family->getCodeDefinition(def_type,true); } diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index a854f77222..651450f6a0 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -98,9 +98,9 @@ QString Parameter::getCodeDefinition(unsigned def_type, bool reduced_form) else attributes[Attributes::Name]=obj_name; - attributes[Attributes::PARAM_IN]=(is_in ? Attributes::True : QString()); - attributes[Attributes::PARAM_OUT]=(is_out ? Attributes::True : QString()); - attributes[Attributes::PARAM_VARIADIC]=(is_variadic ? Attributes::True : QString()); + attributes[Attributes::ParamIn]=(is_in ? Attributes::True : QString()); + attributes[Attributes::ParamOut]=(is_out ? Attributes::True : QString()); + attributes[Attributes::ParamVariadic]=(is_variadic ? Attributes::True : QString()); attributes[Attributes::DefaultValue]=default_value; attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/partitionkey.cpp b/libpgmodeler/src/partitionkey.cpp index 126d58dc36..48a2c95bea 100644 --- a/libpgmodeler/src/partitionkey.cpp +++ b/libpgmodeler/src/partitionkey.cpp @@ -49,5 +49,5 @@ QString PartitionKey::getCodeDefinition(unsigned def_type) attribs[Attributes::Collation]=collation->getCodeDefinition(def_type, true); } - return(schparser.getCodeDefinition(Attributes::PARTITION_KEY, attribs, def_type)); + return(schparser.getCodeDefinition(Attributes::PartitionKey, attribs, def_type)); } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 1d2406bd97..d374f5a7ac 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -43,7 +43,7 @@ Permission::Permission(BaseObject *obj) attributes[Attributes::Object]=QString(); attributes[Attributes::TYPE]=QString(); - attributes[Attributes::PARENT]=QString(); + attributes[Attributes::Parent]=QString(); attributes[Attributes::GrantOp]=QString(); attributes[Attributes::ROLES]=QString(); attributes[Attributes::PRIVILEGES]=QString(); @@ -435,7 +435,7 @@ QString Permission::getCodeDefinition(unsigned def_type) if(obj_type==ObjectType::Column) { attributes[Attributes::Object]=object->getName(true); - attributes[Attributes::PARENT]=dynamic_cast(object)->getParentTable()->getName(true); + attributes[Attributes::Parent]=dynamic_cast(object)->getParentTable()->getName(true); } else attributes[Attributes::Object]=object->getSignature(); diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 9f48bed985..89dcde79e9 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1620,7 +1620,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) if(with_timezone) attribs[Attributes::WITH_TIMEZONE]=Attributes::True; - return(schparser.getCodeDefinition(Attributes::PGSQL_BASE_TYPE, attribs, def_type)); + return(schparser.getCodeDefinition(Attributes::PgSqlBaseType, attribs, def_type)); } } diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index ee36cd9779..c080c28d1a 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -23,7 +23,7 @@ Policy::Policy(void) : TableObject() permissive = false; policy_cmd = PolicyCmdType::All; - attributes[Attributes::PERMISSIVE] = QString(); + attributes[Attributes::Permissive] = QString(); attributes[Attributes::Command] = QString(); attributes[Attributes::USING_EXP] = QString(); attributes[Attributes::CheckExp] = QString(); @@ -123,7 +123,7 @@ QString Policy::getCodeDefinition(unsigned def_type) for(auto role : roles) rol_names.append(role->getName(true)); - attributes[Attributes::PERMISSIVE] = (permissive ? Attributes::True : QString()); + attributes[Attributes::Permissive] = (permissive ? Attributes::True : QString()); attributes[Attributes::USING_EXP] = using_expr; attributes[Attributes::CheckExp] = check_expr; attributes[Attributes::ROLES] = rol_names.join(QString(", ")); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 6ec5e2a129..9ce0ff6323 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2620,13 +2620,13 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::SRC_COL_PATTERN]=name_patterns[SrcColPattern]; attributes[Attributes::DstColPattern]=name_patterns[DstColPattern]; - attributes[Attributes::PK_PATTERN]=name_patterns[PkPattern]; + attributes[Attributes::PkPattern]=name_patterns[PkPattern]; attributes[Attributes::UQ_PATTERN]=name_patterns[UqPattern]; attributes[Attributes::SRC_FK_PATTERN]=name_patterns[SrcFkPattern]; attributes[Attributes::DstFkPattern]=name_patterns[DstFkPattern]; - attributes[Attributes::PK_COL_PATTERN]=name_patterns[PkColPattern]; + attributes[Attributes::PkColPattern]=name_patterns[PkColPattern]; - attributes[Attributes::PARTITION_BOUND_EXPR]=part_bounding_expr; + attributes[Attributes::PartitionBoundExpr]=part_bounding_expr; attributes[Attributes::Columns]=QString(); count=rel_attributes.size(); @@ -2648,7 +2648,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) if(pk_original) { pk_original->setParentTable(getReceiverTable()); - attributes[Attributes::ORIGINAL_PK]=pk_original->getCodeDefinition(SchemaParser::XmlDefinition); + attributes[Attributes::OriginalPk]=pk_original->getCodeDefinition(SchemaParser::XmlDefinition); pk_original->setParentTable(nullptr); } @@ -2670,9 +2670,9 @@ QString Relationship::getCodeDefinition(unsigned def_type) reduced_form=(attributes[Attributes::Columns].isEmpty() && attributes[Attributes::Constraints].isEmpty() && - attributes[Attributes::POINTS].isEmpty() && + attributes[Attributes::Points].isEmpty() && attributes[Attributes::SPECIAL_PK_COLS].isEmpty() && - attributes[Attributes::POINTS].isEmpty() && + attributes[Attributes::Points].isEmpty() && attributes[Attributes::LabelsPos].isEmpty()); if(!reduced_form) @@ -2712,8 +2712,8 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) attributes[Attributes::Inherit]=QString(); attributes[Attributes::AncestorTable]=QString(); - attributes[Attributes::PARTITIONED_TABLE]=QString(); - attributes[Attributes::PARTITION_BOUND_EXPR]=QString(); + attributes[Attributes::PartitionedTable]=QString(); + attributes[Attributes::PartitionBoundExpr]=QString(); if(rel_type == RelationshipGen) { @@ -2723,10 +2723,10 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) } else { - attributes[Attributes::PARTITIONING]=(undo_inh_part ? Attributes::UNSET : Attributes::True); + attributes[Attributes::Partitioning]=(undo_inh_part ? Attributes::UNSET : Attributes::True); attributes[Attributes::TABLE]=getReceiverTable()->getName(true); - attributes[Attributes::PARTITIONED_TABLE]=getReferenceTable()->getName(true); - attributes[Attributes::PARTITION_BOUND_EXPR]=getReceiverTable()->getPartitionBoundingExpr(); + attributes[Attributes::PartitionedTable]=getReferenceTable()->getName(true); + attributes[Attributes::PartitionBoundExpr]=getReceiverTable()->getPartitionBoundingExpr(); } return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes)); diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index edb3387842..eb3a280f9f 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -36,7 +36,7 @@ Role::Role(void) attributes[Attributes::Inherit]=QString(); attributes[Attributes::Login]=QString(); attributes[Attributes::ConnLimit]=QString(); - attributes[Attributes::PASSWORD]=QString(); + attributes[Attributes::Password]=QString(); attributes[Attributes::Encrypted]=QString(); attributes[Attributes::VALIDITY]=QString(); attributes[Attributes::REF_ROLES]=QString(); @@ -341,7 +341,7 @@ QString Role::getCodeDefinition(unsigned def_type) for(i=0; i <= OpBypassRls; i++) attributes[op_attribs[i]]=(options[i] ? Attributes::True : QString()); - attributes[Attributes::PASSWORD]=password; + attributes[Attributes::Password]=password; attributes[Attributes::VALIDITY]=validity; if(conn_limit >= 0) @@ -368,14 +368,14 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object, ignore_name_diff); if(this->password!=role->password) - attribs[Attributes::PASSWORD]=role->password; + attribs[Attributes::Password]=role->password; if(this->validity!=role->validity) attribs[Attributes::VALIDITY]=role->validity; for(unsigned i=0; i <= OpBypassRls; i++) { - if((attribs.count(Attributes::PASSWORD) && i==OpEncrypted) || + if((attribs.count(Attributes::Password) && i==OpEncrypted) || this->options[i]!=role->options[i]) attribs[op_attribs[i]]=(role->options[i] ? Attributes::True : Attributes::UNSET); } diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 37d763ea69..9d4bbd5ec4 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -38,7 +38,7 @@ Sequence::Sequence(void) attributes[Attributes::START]=QString(); attributes[Attributes::Cache]=QString(); attributes[Attributes::Cycle]=QString(); - attributes[Attributes::OWNER_COLUMN]=QString(); + attributes[Attributes::OwnerColumn]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::Column]=QString(); attributes[Attributes::ColIsIdentity]=QString(); @@ -392,7 +392,7 @@ QString Sequence::getCodeDefinition(unsigned def_type) if(owner_col) { - attributes[Attributes::OWNER_COLUMN]=owner_col->getSignature(); + attributes[Attributes::OwnerColumn]=owner_col->getSignature(); table=dynamic_cast
(owner_col->getParentTable()); } @@ -433,7 +433,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) { if(seq->owner_col) { - attribs[Attributes::OWNER_COLUMN]=seq->owner_col->getSignature(); + attribs[Attributes::OwnerColumn]=seq->owner_col->getSignature(); table=dynamic_cast
(seq->owner_col->getParentTable()); if(table) @@ -443,7 +443,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) } } else - attribs[Attributes::OWNER_COLUMN]=Attributes::UNSET; + attribs[Attributes::OwnerColumn]=Attributes::UNSET; } if(!seq->increment.isEmpty() && this->increment!=seq->increment) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 3fb524c4c0..6daa502bf1 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -41,10 +41,10 @@ Table::Table(void) : BaseTable() attributes[Attributes::InitialData]=QString(); attributes[Attributes::RLS_ENABLED]=QString(); attributes[Attributes::RLS_FORCED]=QString(); - attributes[Attributes::PARTITIONING]=QString(); - attributes[Attributes::PARTITION_KEY]=QString(); - attributes[Attributes::PARTITIONED_TABLE]=QString(); - attributes[Attributes::PARTITION_BOUND_EXPR]=QString(); + attributes[Attributes::Partitioning]=QString(); + attributes[Attributes::PartitionKey]=QString(); + attributes[Attributes::PartitionedTable]=QString(); + attributes[Attributes::PartitionBoundExpr]=QString(); copy_table=partitioned_table=nullptr; partitioning_type=BaseType::Null; @@ -1602,23 +1602,23 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::AncestorTable]=QString(); attributes[Attributes::TAG]=QString(); attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); - attributes[Attributes::PARTITIONING]=~partitioning_type; - attributes[Attributes::PARTITION_KEY]=QString(); - attributes[Attributes::PARTITION_BOUND_EXPR]=part_bounding_expr; + attributes[Attributes::Partitioning]=~partitioning_type; + attributes[Attributes::PartitionKey]=QString(); + attributes[Attributes::PartitionBoundExpr]=part_bounding_expr; for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); if(def_type == SchemaParser::SqlDefinition) - attributes[Attributes::PARTITION_KEY]=part_keys_code.join(','); + attributes[Attributes::PartitionKey]=part_keys_code.join(','); else - attributes[Attributes::PARTITION_KEY]=part_keys_code.join(' '); + attributes[Attributes::PartitionKey]=part_keys_code.join(' '); if(def_type==SchemaParser::SqlDefinition && copy_table) attributes[Attributes::CopyTable]=copy_table->getName(true) + copy_op.getSQLDefinition(); if(def_type==SchemaParser::SqlDefinition && partitioned_table) - attributes[Attributes::PARTITIONED_TABLE]=partitioned_table->getName(true); + attributes[Attributes::PartitionedTable]=partitioned_table->getName(true); if(tag && def_type==SchemaParser::XmlDefinition) attributes[Attributes::TAG]=tag->getCodeDefinition(def_type, true); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index e657e3ad7c..b09ac55819 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -38,7 +38,7 @@ Trigger::Trigger(void) attributes[Attributes::TABLE]=QString(); attributes[Attributes::Columns]=QString(); attributes[Attributes::FiringType]=QString(); - attributes[Attributes::PER_ROW]=QString(); + attributes[Attributes::PerRow]=QString(); attributes[Attributes::InsEvent]=QString(); attributes[Attributes::DelEvent]=QString(); attributes[Attributes::UPD_EVENT]=QString(); @@ -412,7 +412,7 @@ QString Trigger::getCodeDefinition(unsigned def_type) attributes[Attributes::FiringType]=(~firing_type); //** Constraint trigger MUST execute per row ** - attributes[Attributes::PER_ROW]=((is_exec_per_row && !is_constraint) || is_constraint ? Attributes::True : QString()); + attributes[Attributes::PerRow]=((is_exec_per_row && !is_constraint) || is_constraint ? Attributes::True : QString()); attributes[Attributes::Condition]=condition; diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index b4faa99c0c..291c56f32b 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -30,7 +30,7 @@ Type::Type(void) attributes[Attributes::EnumType]=QString(); attributes[Attributes::Enumerations]=QString(); attributes[Attributes::InputFunc]=QString(); - attributes[Attributes::OUTPUT_FUNC]=QString(); + attributes[Attributes::OutputFunc]=QString(); attributes[Attributes::RECV_FUNC]=QString(); attributes[Attributes::SEND_FUNC]=QString(); attributes[Attributes::TPMOD_IN_FUNC]=QString(); @@ -51,7 +51,7 @@ Type::Type(void) attributes[Attributes::SUBTYPE]=QString(); attributes[Attributes::SUBTYPE_DIFF_FUNC]=QString(); attributes[Attributes::CanonicalFunc]=QString(); - attributes[Attributes::OP_CLASS]=QString(); + attributes[Attributes::OpClass]=QString(); } void Type::setName(const QString &name) @@ -637,9 +637,9 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) if(subtype_opclass) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::OP_CLASS]=subtype_opclass->getName(true); + attributes[Attributes::OpClass]=subtype_opclass->getName(true); else - attributes[Attributes::OP_CLASS]=subtype_opclass->getCodeDefinition(def_type, true); + attributes[Attributes::OpClass]=subtype_opclass->getCodeDefinition(def_type, true); } } else @@ -680,7 +680,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) { unsigned i; QString func_attrib[]={Attributes::InputFunc, - Attributes::OUTPUT_FUNC, + Attributes::OutputFunc, Attributes::RECV_FUNC, Attributes::SEND_FUNC, Attributes::TPMOD_IN_FUNC, diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 784fe4760b..6ca7c6917f 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -62,8 +62,8 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::Column, //32 Attributes::InhColumn, //33 Attributes::PROT_COLUMN, //34 - Attributes::PK_COLUMN, //35 - Attributes::PK_COLUMN, //36 + Attributes::PkColumn, //35 + Attributes::PkColumn, //36 Attributes::FkColumn, //37 Attributes::FkColumn, //38 Attributes::UQ_COLUMN, //39 @@ -77,7 +77,7 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::Attribute, //47 Attributes::TAG, //48 Attributes::TAG, //49 - Attributes::PLACEHOLDER /*50*/}; + Attributes::Placeholder /*50*/}; int i, count=element_cmb->count(), //This auxiliary vector stores the id of elements that represents color/font conf. of objects obj_conf_ids_vect[]={ 2, 4, 6, 7, 10, 11, 12, 14, 16, 18, 20, 22, 25, 26, 27, @@ -211,8 +211,8 @@ void AppearanceConfigWidget::loadExampleModel(void) void AppearanceConfigWidget::updatePlaceholderItem(void) { - placeholder->setBrush(BaseObjectView::getFillStyle(Attributes::PLACEHOLDER)); - QPen pen=BaseObjectView::getBorderStyle(Attributes::PLACEHOLDER); + placeholder->setBrush(BaseObjectView::getFillStyle(Attributes::Placeholder)); + QPen pen=BaseObjectView::getBorderStyle(Attributes::Placeholder); pen.setStyle(Qt::DashLine); placeholder->setPen(pen); } diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 81a58fce47..b2f2e71fce 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -67,10 +67,10 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::NegatorOp, QT_TR_NOOP("Negator op.")}, {Attributes::NotNull, QT_TR_NOOP("Not null")}, {Attributes::ObjectType, QT_TR_NOOP("Object type")}, {Attributes::Oid, QT_TR_NOOP("OID")}, {Attributes::Oids, QT_TR_NOOP("With OIDs")}, {Attributes::OldVersion, QT_TR_NOOP("Old version")}, - {Attributes::OPERATOR, QT_TR_NOOP("Operator")}, {Attributes::OPERATOR_FUNC, QT_TR_NOOP("Operator func.")}, - {Attributes::OUTPUT_FUNC, QT_TR_NOOP("Output func.")}, {Attributes::OWNER, QT_TR_NOOP("Owner")}, - {Attributes::OWNER_COLUMN, QT_TR_NOOP("Owner column")}, {Attributes::PARENTS, QT_TR_NOOP("Parents")}, - {Attributes::PASSWORD, QT_TR_NOOP("Password")}, {Attributes::PERMISSION, QT_TR_NOOP("Permissions")}, + {Attributes::Operator, QT_TR_NOOP("Operator")}, {Attributes::OperatorFunc, QT_TR_NOOP("Operator func.")}, + {Attributes::OutputFunc, QT_TR_NOOP("Output func.")}, {Attributes::Owner, QT_TR_NOOP("Owner")}, + {Attributes::OwnerColumn, QT_TR_NOOP("Owner column")}, {Attributes::Parents, QT_TR_NOOP("Parents")}, + {Attributes::Password, QT_TR_NOOP("Password")}, {Attributes::Permission, QT_TR_NOOP("Permissions")}, {Attributes::PRECISION, QT_TR_NOOP("Precision")}, {Attributes::PREFERRED, QT_TR_NOOP("Preferred")}, {Attributes::RANGE_ATTRIBS, QT_TR_NOOP("Range attributes")}, {Attributes::RECV_FUNC, QT_TR_NOOP("Receive func.")}, {Attributes::REF_ROLES, QT_TR_NOOP("Ref. roles")}, {Attributes::REPLICATION, QT_TR_NOOP("Replication")}, @@ -92,9 +92,9 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Increment, QT_TR_NOOP("Increment")}, {Attributes::MaxValue, QT_TR_NOOP("Max. value")}, {Attributes::MinValue, QT_TR_NOOP("Min. value")}, {Attributes::START, QT_TR_NOOP("Start value")}, {Attributes::LastValue, QT_TR_NOOP("Last value")}, {Attributes::SUBTYPE, QT_TR_NOOP("Subtype")}, - {Attributes::OP_CLASS, QT_TR_NOOP("Op. class")}, {Attributes::CanonicalFunc, QT_TR_NOOP("Canonical func.")}, + {Attributes::OpClass, QT_TR_NOOP("Op. class")}, {Attributes::CanonicalFunc, QT_TR_NOOP("Canonical func.")}, {Attributes::SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {Attributes::Deferrable, QT_TR_NOOP("Deferrable")}, - {Attributes::PER_ROW, QT_TR_NOOP("For each row")}, {Attributes::FiringType, QT_TR_NOOP("Firing")}, + {Attributes::PerRow, QT_TR_NOOP("For each row")}, {Attributes::FiringType, QT_TR_NOOP("Firing")}, {Attributes::InsEvent, QT_TR_NOOP("On insert")}, {Attributes::DelEvent, QT_TR_NOOP("On delete")}, {Attributes::UPD_EVENT, QT_TR_NOOP("On update")}, {Attributes::TRUNC_EVENT, QT_TR_NOOP("On truncate")}, {Attributes::Arguments, QT_TR_NOOP("Arguments")}, {Attributes::TABLE, QT_TR_NOOP("Table")}, @@ -105,7 +105,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::ComparisonType, QT_TR_NOOP("Comparison type")}, {Attributes::DelAction, QT_TR_NOOP("On delete")}, {Attributes::DstColumns, QT_TR_NOOP("Ref. columns")}, {Attributes::Expressions, QT_TR_NOOP("Expressions")}, {Attributes::Factor, QT_TR_NOOP("Fill factor")}, {Attributes::NoInherit, QT_TR_NOOP("No inherit")}, - {Attributes::OP_CLASSES, QT_TR_NOOP("Op. classes")}, {Attributes::OPERATORS, QT_TR_NOOP("Operators")}, + {Attributes::OpClasses, QT_TR_NOOP("Op. classes")}, {Attributes::Operators, QT_TR_NOOP("Operators")}, {Attributes::REF_TABLE, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SRC_COLUMNS, QT_TR_NOOP("Columns")}, {Attributes::UNIQUE, QT_TR_NOOP("Unique")}, {Attributes::PREDICATE, QT_TR_NOOP("Predicate")}, @@ -114,11 +114,11 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DynamicLibraryPath, QT_TR_NOOP("Dynamic library path")}, {Attributes::DynamicSharedMemory, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HbaFile, QT_TR_NOOP("Hba file")}, {Attributes::ListenAddresses, QT_TR_NOOP("Listen addresses")}, {Attributes::MaxConnections, QT_TR_NOOP("Max. connections")}, - {Attributes::PORT, QT_TR_NOOP("Listen port")}, {Attributes::SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, + {Attributes::Port, QT_TR_NOOP("Listen port")}, {Attributes::SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, {Attributes::SSL, QT_TR_NOOP("SSL")}, {Attributes::SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, {Attributes::SSL_CERT_FILE, QT_TR_NOOP("SSL cert file")}, {Attributes::SSL_CRL_FILE, QT_TR_NOOP("SSL crl file")}, {Attributes::SSL_KEY_FILE, QT_TR_NOOP("SSL key file")}, {Attributes::SERVER_VERSION, QT_TR_NOOP("Server version")}, - {Attributes::IdentFile, QT_TR_NOOP("Ident file")}, {Attributes::PASSWORD_ENCRYPTION, QT_TR_NOOP("Password encryption")}, + {Attributes::IdentFile, QT_TR_NOOP("Ident file")}, {Attributes::PasswordEncryption, QT_TR_NOOP("Password encryption")}, {Attributes::Connection, QT_TR_NOOP("Connection ID")}, {Attributes::SERVER_PID, QT_TR_NOOP("Server PID")}, {Attributes::SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {Attributes::REFERRERS, QT_TR_NOOP("Referrers")}, {Attributes::IdentityType, QT_TR_NOOP("Identity")}, {Attributes::Command, QT_TR_NOOP("Command")}, @@ -128,9 +128,9 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {Attributes::LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {Attributes::TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {Attributes::TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, {Attributes::TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {Attributes::IsPartitioned, QT_TR_NOOP("Partitioned")}, - {Attributes::PARTITIONED_TABLE, QT_TR_NOOP("Partition of")}, {Attributes::PARTITION_BOUND_EXPR, QT_TR_NOOP("Partition bound expr.")}, - {Attributes::DeadRowsAmount, QT_TR_NOOP("Dead rows amount")}, {Attributes::PARTITION_KEY, QT_TR_NOOP("Partition keys")}, - {Attributes::PARTITIONING, QT_TR_NOOP("Partitioning")} + {Attributes::PartitionedTable, QT_TR_NOOP("Partition of")}, {Attributes::PartitionBoundExpr, QT_TR_NOOP("Partition bound expr.")}, + {Attributes::DeadRowsAmount, QT_TR_NOOP("Dead rows amount")}, {Attributes::PartitionKey, QT_TR_NOOP("Partition keys")}, + {Attributes::Partitioning, QT_TR_NOOP("Partitioning")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) @@ -309,7 +309,7 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) attribs_map fmt_attribs; QString attr_name, attr_value; QRegExp oid_regexp=QRegExp(QString("^[0-9]+")); - map dep_types={{Attributes::OWNER, ObjectType::Role}, + map dep_types={{Attributes::Owner, ObjectType::Role}, {Attributes::SCHEMA, ObjectType::Schema}, {Attributes::TABLESPACE, ObjectType::Tablespace}, {Attributes::Collation, ObjectType::Collation}, @@ -353,8 +353,8 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) } - if(attribs.count(Attributes::PERMISSION)!=0) - attribs[Attributes::PERMISSION]=Catalog::parseArrayValues(attribs[Attributes::PERMISSION]).join(ElemSeparator); + if(attribs.count(Attributes::Permission)!=0) + attribs[Attributes::Permission]=Catalog::parseArrayValues(attribs[Attributes::Permission]).join(ElemSeparator); //Removing system schemas from object's name if(attribs.count(Attributes::Name)!=0 && @@ -532,7 +532,7 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) formatOidAttribs(attribs, { Attributes::CommutatorOp, Attributes::NegatorOp}, ObjectType::Operator, false); - formatOidAttribs(attribs, { Attributes::OPERATOR_FUNC, + formatOidAttribs(attribs, { Attributes::OperatorFunc, Attributes::RESTRICTION_FUNC, Attributes::JoinFunc }, ObjectType::Function, false); @@ -551,22 +551,22 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) Attributes::RLS_ENABLED, Attributes::RLS_FORCED}); - formatOidAttribs(attribs, { Attributes::PARENTS }, ObjectType::Table, true); - formatOidAttribs(attribs, { Attributes::PARTITIONED_TABLE }, ObjectType::Table, false); + formatOidAttribs(attribs, { Attributes::Parents }, ObjectType::Table, true); + formatOidAttribs(attribs, { Attributes::PartitionedTable }, ObjectType::Table, false); part_keys.push_back(getObjectsNames(ObjectType::Column, - Catalog::parseArrayValues(attribs[Attributes::PART_KEY_COLS]), + Catalog::parseArrayValues(attribs[Attributes::PartKeyCols]), getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]), attribs[Attributes::Name]).join(ElemSeparator)); part_keys.push_back(Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator)); part_keys.removeAll(QString()); - attribs[Attributes::PARTITION_KEY] = part_keys.join(ElemSeparator); - attribs.erase(Attributes::PART_KEY_COLLS); - attribs.erase(Attributes::PART_KEY_OPCLS); - attribs.erase(Attributes::PART_KEY_EXPRS); - attribs.erase(Attributes::PART_KEY_COLS); + attribs[Attributes::PartitionKey] = part_keys.join(ElemSeparator); + attribs.erase(Attributes::PartKeyColls); + attribs.erase(Attributes::PartKeyOpCls); + attribs.erase(Attributes::PartKeyExprs); + attribs.erase(Attributes::PartKeyCols); } void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) @@ -584,14 +584,14 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::Cycle }); - owner_col=attribs[Attributes::OWNER_COLUMN].split(':'); + owner_col=attribs[Attributes::OwnerColumn].split(':'); if(owner_col.size()==2) { QStringList names=getObjectName(ObjectType::Table, owner_col[0]).split('.'); vector col_attribs=catalog.getObjectsAttributes(ObjectType::Column, names[0], names[1], { owner_col[1].toUInt() }); if(!col_attribs.empty()) - attribs[Attributes::OWNER_COLUMN]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(Attributes::Name)); + attribs[Attributes::OwnerColumn]=QString("%1.%2.%3").arg(names[0], names[1], col_attribs[0].at(Attributes::Name)); } //Retrieving the current value of the sequence by querying the database @@ -629,7 +629,7 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) Attributes::PREFERRED }); formatOidAttribs(attribs, { Attributes::AnalyzeFunc, Attributes::InputFunc, - Attributes::OUTPUT_FUNC, + Attributes::OutputFunc, Attributes::RECV_FUNC, Attributes::SEND_FUNC, Attributes::TPMOD_IN_FUNC, @@ -646,7 +646,7 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) { attribs[Attributes::SUBTYPE]=getObjectName(ObjectType::Type, range_attr[0]); attribs[Attributes::Collation]=getObjectName(ObjectType::Collation, range_attr[1]); - attribs[Attributes::OP_CLASS]=getObjectName(ObjectType::OpClass, range_attr[2]); + attribs[Attributes::OpClass]=getObjectName(ObjectType::OpClass, range_attr[2]); attribs[Attributes::CanonicalFunc]=getObjectName(ObjectType::Function, range_attr[3]); attribs[Attributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjectType::Function, range_attr[4]); } @@ -691,7 +691,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) elems.clear(); } - array_vals=Catalog::parseArrayValues(attribs[Attributes::OPERATOR]); + array_vals=Catalog::parseArrayValues(attribs[Attributes::Operator]); if(!array_vals.isEmpty()) { @@ -704,7 +704,7 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) getObjectName(ObjectType::Operator, list[2]))); } - attribs[Attributes::OPERATOR]=elems.join(ElemSeparator); + attribs[Attributes::Operator]=elems.join(ElemSeparator); elems.clear(); } } @@ -713,7 +713,7 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::Constraint, Attributes::Deferrable, - Attributes::PER_ROW, + Attributes::PerRow, Attributes::InsEvent, Attributes::DelEvent, Attributes::UPD_EVENT, @@ -740,7 +740,7 @@ void DatabaseExplorerWidget::formatColumnAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) { - map types={{Attributes::PK_CONSTR, ConstraintType(ConstraintType::PrimaryKey)}, + map types={{Attributes::PkConstr, ConstraintType(ConstraintType::PrimaryKey)}, {Attributes::FkConstr, ConstraintType(ConstraintType::ForeignKey)}, {Attributes::UQ_CONSTR, ConstraintType(ConstraintType::Unique)}, {Attributes::CkConstr, ConstraintType(ConstraintType::Check)}, @@ -752,8 +752,8 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::Deferrable, Attributes::NoInherit }); attribs[Attributes::TYPE]=~types[attribs[Attributes::TYPE]]; - attribs[Attributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, - Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES])).join(ElemSeparator); + attribs[Attributes::OpClasses]=getObjectsNames(ObjectType::OpClass, + Catalog::parseArrayValues(attribs[Attributes::OpClasses])).join(ElemSeparator); attribs[Attributes::SRC_COLUMNS]=getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[Attributes::SRC_COLUMNS]), names[0], names[1]).join(ElemSeparator); @@ -786,14 +786,14 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) if(constr_type==ConstraintType::Exclude) { attribs[Attributes::Expressions]=Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator); - attribs[Attributes::OPERATORS]=getObjectsNames(ObjectType::Operator, - Catalog::parseArrayValues(attribs[Attributes::OPERATORS])).join(ElemSeparator); + attribs[Attributes::Operators]=getObjectsNames(ObjectType::Operator, + Catalog::parseArrayValues(attribs[Attributes::Operators])).join(ElemSeparator); } else { attribs.erase(Attributes::Condition); attribs.erase(Attributes::Expressions); - attribs.erase(Attributes::OPERATORS); + attribs.erase(Attributes::Operators); } } @@ -811,8 +811,8 @@ void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) attribs[Attributes::Collations]=getObjectsNames(ObjectType::Collation, Catalog::parseArrayValues(attribs[Attributes::Collations])).join(ElemSeparator); - attribs[Attributes::OP_CLASSES]=getObjectsNames(ObjectType::OpClass, - Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES])).join(ElemSeparator); + attribs[Attributes::OpClasses]=getObjectsNames(ObjectType::OpClass, + Catalog::parseArrayValues(attribs[Attributes::OpClasses])).join(ElemSeparator); attribs[Attributes::Columns]=getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[Attributes::Columns]), names[0], names[1]).join(ElemSeparator); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 71488f0dc8..a5705aba46 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -683,8 +683,8 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) attribs[Attributes::SQL_DISABLED]=(catalog.isSystemObject(oid) || catalog.isExtensionObject(oid) ? Attributes::True : QString()); attribs[Attributes::Comment]=getComment(attribs); - if(attribs.count(Attributes::OWNER)) - attribs[Attributes::OWNER]=getDependencyObject(attribs[Attributes::OWNER], ObjectType::Role, false, auto_resolve_deps); + if(attribs.count(Attributes::Owner)) + attribs[Attributes::Owner]=getDependencyObject(attribs[Attributes::Owner], ObjectType::Role, false, auto_resolve_deps); if(attribs.count(Attributes::TABLESPACE)) attribs[Attributes::TABLESPACE]=getDependencyObject(attribs[Attributes::TABLESPACE], ObjectType::Tablespace, false, auto_resolve_deps); @@ -695,7 +695,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) /* Due to the object recreation mechanism there are some situations when pgModeler fails to recreate them due to the duplication of permissions. So, to avoid this problem we need to check if the OID of the object was previously registered in the vector of permissions to be created */ - if(!attribs[Attributes::PERMISSION].isEmpty() && + if(!attribs[Attributes::Permission].isEmpty() && std::find(obj_perms.begin(), obj_perms.end(), oid)==obj_perms.end()) obj_perms.push_back(oid); @@ -1070,7 +1070,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) the parameter type will be renamed to "any" (see rules on Type::setFunction()) */ if(i==0 && (attribs[Attributes::REF_TYPE]==Attributes::SEND_FUNC || - attribs[Attributes::REF_TYPE]==Attributes::OUTPUT_FUNC || + attribs[Attributes::REF_TYPE]==Attributes::OutputFunc || attribs[Attributes::REF_TYPE]==Attributes::CanonicalFunc)) type=PgSqlType(QString("\"any\"")); else @@ -1137,7 +1137,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) param_xmls.push_front(param.getCodeDefinition(SchemaParser::XmlDefinition)); } - attribs[Attributes::PARAMETERS]+=param_xmls.join(QChar('\n')); + attribs[Attributes::Parameters]+=param_xmls.join(QChar('\n')); } //Case the function's language is C the symbol is the 'definition' attribute @@ -1251,7 +1251,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) elems.push_back(elem_attr); } else if(attribs[Attributes::Function].isEmpty() && - attribs[Attributes::OPERATOR].isEmpty()) + attribs[Attributes::Operator].isEmpty()) { elem_attr[Attributes::STORAGE]=Attributes::True; elem_attr[Attributes::Definition]=attribs[Attributes::TYPE]; @@ -1275,11 +1275,11 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) } //Generating attributes for OPERATOR elements - if(!attribs[Attributes::OPERATOR].isEmpty()) + if(!attribs[Attributes::Operator].isEmpty()) { elem_attr.clear(); - elem_attr[Attributes::OPERATOR]=Attributes::True; - array_vals=Catalog::parseArrayValues(attribs[Attributes::OPERATOR]); + elem_attr[Attributes::Operator]=Attributes::True; + array_vals=Catalog::parseArrayValues(attribs[Attributes::Operator]); for(int i=0; i < array_vals.size(); i++) { @@ -1322,7 +1322,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) QRegExp regexp; QString op_signature, - func_types[]={ Attributes::OPERATOR_FUNC, + func_types[]={ Attributes::OperatorFunc, Attributes::RESTRICTION_FUNC, Attributes::JoinFunc }, @@ -1436,13 +1436,13 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) try { - QStringList owner_col=attribs[Attributes::OWNER_COLUMN].split(':'), + QStringList owner_col=attribs[Attributes::OwnerColumn].split(':'), seq_attribs=Catalog::parseArrayValues(attribs[Attributes::Attribute]); QString attr[]={ Attributes::START, Attributes::MinValue, Attributes::MaxValue, Attributes::Increment, Attributes::Cache, Attributes::Cycle }; - attribs[Attributes::OWNER_COLUMN]=QString(); + attribs[Attributes::OwnerColumn]=QString(); /* If there are owner columns and the oid of sequence is greater than the owner column's table oid stores the oid of both (sequence and table) in order to swap it's ids at the end of import to @@ -1581,7 +1581,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) attribs[Attributes::SUBTYPE]=getType(range_attr[0], true); attribs[Attributes::Collation]=getDependencyObject(range_attr[1], ObjectType::Collation, true); - attribs[Attributes::OP_CLASS]=getDependencyObject(range_attr[2], ObjectType::OpClass, true); + attribs[Attributes::OpClass]=getDependencyObject(range_attr[2], ObjectType::OpClass, true); attribs[Attributes::CanonicalFunc]=getDependencyObject(range_attr[3], ObjectType::Function, true); attribs[Attributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjectType::Function, true); } @@ -1589,7 +1589,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { QString type_name=getObjectName(attribs[Attributes::Oid]), func_types[]={ Attributes::InputFunc, - Attributes::OUTPUT_FUNC, + Attributes::OutputFunc, Attributes::RECV_FUNC, Attributes::SEND_FUNC, Attributes::TPMOD_IN_FUNC, @@ -1665,8 +1665,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) //Creating columns while(itr!=itr_end) { - if(itr->second.count(Attributes::PERMISSION) && - !itr->second.at(Attributes::PERMISSION).isEmpty()) + if(itr->second.count(Attributes::Permission) && + !itr->second.at(Attributes::Permission).isEmpty()) col_perms[tab_oid].push_back(itr->second[Attributes::Oid].toUInt()); if(itr->second[Attributes::Inherited]==Attributes::True) @@ -1774,24 +1774,24 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) inherited_cols.push_back(table->getColumn(col_idx)); // Storing the partition bound expression temporarily in the table in order to configure the partition hierarchy later - table->setPartitionBoundingExpr(attribs[Attributes::PARTITION_BOUND_EXPR].remove(QRegExp("^(FOR)( )+(VALUES)( )*", Qt::CaseInsensitive))); + table->setPartitionBoundingExpr(attribs[Attributes::PartitionBoundExpr].remove(QRegExp("^(FOR)( )+(VALUES)( )*", Qt::CaseInsensitive))); // Retrieving the partitioned table related to the partition table being created - if(!attribs[Attributes::PARTITIONED_TABLE].isEmpty()) + if(!attribs[Attributes::PartitionedTable].isEmpty()) { Table *partitioned_tab = nullptr; - attribs[Attributes::PARTITIONED_TABLE] = - getDependencyObject(attribs[Attributes::PARTITIONED_TABLE], ObjectType::Table, true, auto_resolve_deps, false); + attribs[Attributes::PartitionedTable] = + getDependencyObject(attribs[Attributes::PartitionedTable], ObjectType::Table, true, auto_resolve_deps, false); - partitioned_tab = dbmodel->getTable(attribs[Attributes::PARTITIONED_TABLE]); + partitioned_tab = dbmodel->getTable(attribs[Attributes::PartitionedTable]); table->setPartionedTable(partitioned_tab); if(!partitioned_tab) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]).arg(BaseObject::getTypeName(ObjectType::Table)) - .arg(attribs[Attributes::PARTITIONED_TABLE]).arg(BaseObject::getTypeName(ObjectType::Table)), + .arg(attribs[Attributes::PartitionedTable]).arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1807,13 +1807,13 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) OperatorClass *opclass = nullptr; vector part_keys; - part_type = PartitioningType(attribs[Attributes::PARTITIONING]); + part_type = PartitioningType(attribs[Attributes::Partitioning]); table->setPartitioningType(part_type); - cols=Catalog::parseArrayValues(attribs[Attributes::PART_KEY_COLS]); - collations=Catalog::parseArrayValues(attribs[Attributes::PART_KEY_COLLS]); - opclasses=Catalog::parseArrayValues(attribs[Attributes::PART_KEY_OPCLS]); - exprs = parseIndexExpressions(attribs[Attributes::PART_KEY_EXPRS]); + cols=Catalog::parseArrayValues(attribs[Attributes::PartKeyCols]); + collations=Catalog::parseArrayValues(attribs[Attributes::PartKeyColls]); + opclasses=Catalog::parseArrayValues(attribs[Attributes::PartKeyOpCls]); + exprs = parseIndexExpressions(attribs[Attributes::PartKeyExprs]); for(int i = 0; i < cols.size(); i++) { @@ -2028,7 +2028,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) cols=Catalog::parseArrayValues(attribs[Attributes::Columns]); collations=Catalog::parseArrayValues(attribs[Attributes::Collations]); - opclasses=Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES]); + opclasses=Catalog::parseArrayValues(attribs[Attributes::OpClasses]); exprs = parseIndexExpressions(attribs[Attributes::Expressions]); for(i=0; i < cols.size(); i++) @@ -2120,8 +2120,8 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) attribs[Attributes::Expression]=attribs[Attributes::Condition]; cols=Catalog::parseArrayValues(attribs[Attributes::Columns]); - opers=Catalog::parseArrayValues(attribs[Attributes::OPERATORS]); - opclasses=Catalog::parseArrayValues(attribs[Attributes::OP_CLASSES]); + opers=Catalog::parseArrayValues(attribs[Attributes::Operators]); + opclasses=Catalog::parseArrayValues(attribs[Attributes::OpClasses]); /* Due to the way exclude constraints are constructed (similar to indexes), * we get the constraint's definition in for of expressions. Internally we use pg_get_constraintdef. @@ -2249,7 +2249,7 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) Table *table=nullptr; //Parses the permissions vector string - perm_list=Catalog::parseArrayValues(attribs[Attributes::PERMISSION]); + perm_list=Catalog::parseArrayValues(attribs[Attributes::Permission]); if(!perm_list.isEmpty()) { @@ -2507,7 +2507,7 @@ void DatabaseImportHelper::__createTableInheritances(void) { //Get the list of parent table's oids oid=(*itr); - inh_list=Catalog::parseArrayValues(user_objs[oid][Attributes::PARENTS]); + inh_list=Catalog::parseArrayValues(user_objs[oid][Attributes::Parents]); itr++; if(!inh_list.isEmpty()) @@ -2802,7 +2802,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, extra_attribs[Attributes::Dimension]=(dimension > 0 ? QString::number(dimension) : QString()); schparser.ignoreUnkownAttributes(true); - xml_def=schparser.getCodeDefinition(Attributes::PGSQL_BASE_TYPE, extra_attribs, SchemaParser::XmlDefinition); + xml_def=schparser.getCodeDefinition(Attributes::PgSqlBaseType, extra_attribs, SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); } else diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 2a7b02d0cb..f92b9a691b 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -93,12 +93,12 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa connect(reset_sizes_tb, SIGNAL(clicked(bool)), this, SLOT(resetDialogsSizes())); config_params[Attributes::Configuration][Attributes::GridSize]=QString(); - config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]=QString(); + config_params[Attributes::Configuration][Attributes::OpListSize]=QString(); config_params[Attributes::Configuration][Attributes::AutoSaveInterval]=QString(); - config_params[Attributes::Configuration][Attributes::PAPER_TYPE]=QString(); - config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]=QString(); - config_params[Attributes::Configuration][Attributes::PAPER_MARGIN]=QString(); - config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE]=QString(); + config_params[Attributes::Configuration][Attributes::PaperType]=QString(); + config_params[Attributes::Configuration][Attributes::PaperOrientation]=QString(); + config_params[Attributes::Configuration][Attributes::PaperMargin]=QString(); + config_params[Attributes::Configuration][Attributes::PaperCustomSize]=QString(); config_params[Attributes::Configuration][Attributes::File]=QString(); config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]=QString(); @@ -272,7 +272,7 @@ void GeneralConfigWidget::loadConfiguration(void) BaseConfigWidget::loadConfiguration(GlobalAttributes::GeneralConf, config_params, key_attribs); grid_size_spb->setValue((config_params[Attributes::Configuration][Attributes::GridSize]).toUInt()); - oplist_size_spb->setValue((config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]).toUInt()); + oplist_size_spb->setValue((config_params[Attributes::Configuration][Attributes::OpListSize]).toUInt()); history_max_length_spb->setValue(config_params[Attributes::Configuration][Attributes::HistoryMaxLength].toUInt()); interv=(config_params[Attributes::Configuration][Attributes::AutoSaveInterval]).toUInt(); @@ -300,14 +300,14 @@ void GeneralConfigWidget::loadConfiguration(void) print_grid_chk->setChecked(config_params[Attributes::Configuration][Attributes::PRINT_GRID]==Attributes::True); print_pg_num_chk->setChecked(config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]==Attributes::True); - paper_cmb->setCurrentIndex((config_params[Attributes::Configuration][Attributes::PAPER_TYPE]).toUInt()); - portrait_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::PORTRAIT); - landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]==Attributes::Landscape); + paper_cmb->setCurrentIndex((config_params[Attributes::Configuration][Attributes::PaperType]).toUInt()); + portrait_rb->setChecked(config_params[Attributes::Configuration][Attributes::PaperOrientation]==Attributes::PORTRAIT); + landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PaperOrientation]==Attributes::Landscape); min_obj_opacity_spb->setValue(config_params[Attributes::Configuration][Attributes::MinObjectOpacity].toUInt()); - margin=config_params[Attributes::Configuration][Attributes::PAPER_MARGIN].split(','); - custom_size=config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE].split(','); + margin=config_params[Attributes::Configuration][Attributes::PaperMargin].split(','); + custom_size=config_params[Attributes::Configuration][Attributes::PaperCustomSize].split(','); left_marg->setValue((margin.count() >= 4 ? margin[0].toDouble() : 2)); top_marg->setValue((margin.count()>= 4 ? margin[1].toDouble() : 2)); @@ -467,10 +467,10 @@ void GeneralConfigWidget::saveConfiguration(void) GlobalAttributes::SchemaExt; config_params[Attributes::Configuration][Attributes::GridSize]=QString::number(grid_size_spb->value()); - config_params[Attributes::Configuration][Attributes::OP_LIST_SIZE]=QString::number(oplist_size_spb->value()); + config_params[Attributes::Configuration][Attributes::OpListSize]=QString::number(oplist_size_spb->value()); config_params[Attributes::Configuration][Attributes::AutoSaveInterval]=QString::number(autosave_interv_chk->isChecked() ? autosave_interv_spb->value() : 0); - config_params[Attributes::Configuration][Attributes::PAPER_TYPE]=QString::number(paper_cmb->currentIndex()); - config_params[Attributes::Configuration][Attributes::PAPER_ORIENTATION]=(portrait_rb->isChecked() ? Attributes::PORTRAIT : Attributes::Landscape); + config_params[Attributes::Configuration][Attributes::PaperType]=QString::number(paper_cmb->currentIndex()); + config_params[Attributes::Configuration][Attributes::PaperOrientation]=(portrait_rb->isChecked() ? Attributes::PORTRAIT : Attributes::Landscape); config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=(corner_move_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::InvertRangeSelTrigger]=(invert_rangesel_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CheckUpdate]=(check_upd_chk->isChecked() ? Attributes::True : QString()); @@ -491,15 +491,15 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::AlignObjsToGrid]=(align_grid ? Attributes::True : QString()); unity_cmb->setCurrentIndex(UnitMilimeters); - config_params[Attributes::Configuration][Attributes::PAPER_MARGIN]=QString("%1,%2,%3,%4").arg(left_marg->value()) + config_params[Attributes::Configuration][Attributes::PaperMargin]=QString("%1,%2,%3,%4").arg(left_marg->value()) .arg(top_marg->value()) .arg(right_marg->value()) .arg(bottom_marg->value()); if(paper_cmb->currentIndex()!=paper_cmb->count()-1) - config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE]=QString(); + config_params[Attributes::Configuration][Attributes::PaperCustomSize]=QString(); else - config_params[Attributes::Configuration][Attributes::PAPER_CUSTOM_SIZE]=QString("%1,%2").arg(width_spb->value()).arg(height_spb->value()); + config_params[Attributes::Configuration][Attributes::PaperCustomSize]=QString("%1,%2").arg(width_spb->value()).arg(height_spb->value()); config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]=(print_pg_num_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::PRINT_GRID]=(print_grid_chk->isChecked() ? Attributes::True : QString()); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index b8e7761333..ce167cb424 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -93,19 +93,19 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par while(itr!=itr_end) { attribs=itr->second; - if(attribs.count(Attributes::PATH)!=0) + if(attribs.count(Attributes::Path)!=0) { try { //Storing the file of a previous session if(itr->first.contains(Attributes::File) && - !attribs[Attributes::PATH].isEmpty()) - prev_session_files.push_back(attribs[Attributes::PATH]); + !attribs[Attributes::Path].isEmpty()) + prev_session_files.push_back(attribs[Attributes::Path]); //Creating the recent models menu else if(itr->first.contains(Attributes::RECENT) && - !attribs[Attributes::PATH].isEmpty()) - recent_models.push_back(attribs[Attributes::PATH]); + !attribs[Attributes::Path].isEmpty()) + recent_models.push_back(attribs[Attributes::Path]); } catch(Exception &e) { @@ -677,7 +677,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { param_id=QString("%1%2").arg(Attributes::File).arg(i); attribs[Attributes::Id]=param_id; - attribs[Attributes::PATH]=model->getFilename(); + attribs[Attributes::Path]=model->getFilename(); conf_wgt->addConfigurationParam(param_id, attribs); attribs.clear(); } @@ -694,7 +694,7 @@ void MainWindow::closeEvent(QCloseEvent *event) { param_id=QString("%1%2").arg(Attributes::RECENT).arg(QString::number(i++).rightJustified(2, '0')); attribs[Attributes::Id]=param_id; - attribs[Attributes::PATH]=recent_models.front(); + attribs[Attributes::Path]=recent_models.front(); conf_wgt->addConfigurationParam(param_id, attribs); attribs.clear(); recent_models.pop_front(); @@ -1834,7 +1834,7 @@ void MainWindow::storeDockWidgetsSettings(void) params[Attributes::VALIDATOR]=Attributes::True; params[Attributes::SQL_VALIDATION]=(model_valid_wgt->sql_validation_chk->isChecked() ? Attributes::True : QString()); params[Attributes::USE_UNIQUE_NAMES]=(model_valid_wgt->use_tmp_names_chk->isChecked() ? Attributes::True : QString()); - params[Attributes::PGSQL_VERSION]=model_valid_wgt->version_cmb->currentText(); + params[Attributes::PgSqlVersion]=model_valid_wgt->version_cmb->currentText(); conf_wgt->addConfigurationParam(Attributes::VALIDATOR, params); params.clear(); @@ -1863,7 +1863,7 @@ void MainWindow::restoreDockWidgetsSettings(void) { model_valid_wgt->sql_validation_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::SQL_VALIDATION]==Attributes::True); model_valid_wgt->use_tmp_names_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::USE_UNIQUE_NAMES]==Attributes::True); - model_valid_wgt->version_cmb->setCurrentText(confs[Attributes::VALIDATOR][Attributes::PGSQL_VERSION]); + model_valid_wgt->version_cmb->setCurrentText(confs[Attributes::VALIDATOR][Attributes::PgSqlVersion]); } if(confs.count(Attributes::ObjectFinder)) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index beecc0d353..3c46cb9556 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -870,7 +870,7 @@ void ModelsDiffHelper::processDiffInfos(void) //Attributes used on the diff schema file attribs[Attributes::HasChanges]=Attributes::True; - attribs[Attributes::PGMODELER_VERSION]=GlobalAttributes::PgModelerVersion; + attribs[Attributes::PgModelerVersion]=GlobalAttributes::PgModelerVersion; attribs[Attributes::DbModel]=source_model->getName(); attribs[Attributes::Database]=imported_model->getName(); attribs[Attributes::Date]=QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss"); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index d21a4a2a5e..52d413f552 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -140,7 +140,7 @@ void RelationshipConfigWidget::saveConfiguration(void) patterns_sch=root_dir + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - Attributes::PATTERNS + + Attributes::Patterns + GlobalAttributes::SchemaExt; @@ -158,14 +158,14 @@ void RelationshipConfigWidget::saveConfiguration(void) config_params[Attributes::ForeignKeys][Attributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); config_params[Attributes::ForeignKeys][Attributes::DelAction]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); - config_params[Attributes::NamePatterns][Attributes::PATTERNS]=QString(); + config_params[Attributes::NamePatterns][Attributes::Patterns]=QString(); for(auto &itr : patterns) { schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); config_params[itr.first]=itr.second; - config_params[Attributes::NamePatterns][Attributes::PATTERNS]+=schparser.getCodeDefinition(patterns_sch, itr.second); + config_params[Attributes::NamePatterns][Attributes::Patterns]+=schparser.getCodeDefinition(patterns_sch, itr.second); } BaseConfigWidget::saveConfiguration(GlobalAttributes::RelationshipsConf, config_params); @@ -213,10 +213,10 @@ void RelationshipConfigWidget::fillNamePatterns(void) dst_col_pattern_txt, src_fk_pattern_txt, dst_fk_pattern_txt, pk_col_pattern_txt }; - QList pattern_ids={ Attributes::PK_PATTERN, Attributes::UQ_PATTERN, + QList pattern_ids={ Attributes::PkPattern, Attributes::UQ_PATTERN, Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, - Attributes::PK_COL_PATTERN }; + Attributes::PkColPattern }; relnn=(rel_type==Attributes::RELATIONSHIP_NN); reldep=(rel_type==Attributes::RELATIONSHIP_DEP || rel_type==Attributes::RELATIONSHIP_PART); @@ -252,13 +252,13 @@ void RelationshipConfigWidget::updatePattern(void) { QPlainTextEdit *input=qobject_cast(sender()); QString rel_type=rel_type_cmb->currentData().toString(); - map inputs_map={ { pk_pattern_txt, Attributes::PK_PATTERN }, + map inputs_map={ { pk_pattern_txt, Attributes::PkPattern }, { uq_pattern_txt, Attributes::UQ_PATTERN }, { src_col_pattern_txt, Attributes::SRC_COL_PATTERN }, { dst_col_pattern_txt, Attributes::DstColPattern }, { src_fk_pattern_txt, Attributes::SRC_FK_PATTERN }, { dst_fk_pattern_txt, Attributes::DstFkPattern }, - { pk_col_pattern_txt, Attributes::PK_COL_PATTERN } }; + { pk_col_pattern_txt, Attributes::PkColPattern } }; setConfigurationChanged(true); patterns[rel_type][inputs_map[input]]=input->toPlainText(); diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index b2fd8d3764..981cbaef43 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -517,13 +517,13 @@ void RelationshipWidget::usePatternGlobalSettings(bool value) QString rel_type=rel->getRelTypeAttribute(); //Using the global settings - pk_pattern_txt->setPlainText(confs[rel_type][Attributes::PK_PATTERN]); + pk_pattern_txt->setPlainText(confs[rel_type][Attributes::PkPattern]); src_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_FK_PATTERN]); dst_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::DstFkPattern]); uq_pattern_txt->setPlainText(confs[rel_type][Attributes::UQ_PATTERN]); src_col_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_COL_PATTERN]); dst_col_pattern_txt->setPlainText(confs[rel_type][Attributes::DstColPattern]); - pk_col_pattern_txt->setPlainText(confs[rel_type][Attributes::PK_COL_PATTERN]); + pk_col_pattern_txt->setPlainText(confs[rel_type][Attributes::PkColPattern]); } else { diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index db3e4dcb1b..ac3d1cd70b 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -162,7 +162,7 @@ QString SnippetsConfigWidget::parseSnippet(attribs_map snippet, attribs_map attr QStringList aux_attribs; QString buf=snippet[Attributes::Contents]; - if(snippet[Attributes::PARSABLE]!=Attributes::True) + if(snippet[Attributes::Parsable]!=Attributes::True) return(buf); try @@ -170,7 +170,7 @@ QString SnippetsConfigWidget::parseSnippet(attribs_map snippet, attribs_map attr schparser.loadBuffer(buf); //Assigning dummy values for empty attributes - if(snippet[Attributes::PLACEHOLDERS]==Attributes::True) + if(snippet[Attributes::Placeholders]==Attributes::True) { aux_attribs=schparser.extractAttributes(); for(QString attr : aux_attribs) @@ -230,7 +230,7 @@ bool SnippetsConfigWidget::isSnippetValid(attribs_map &attribs, const QString &o err_msg=trUtf8("Empty label for snippet %1. Please, specify a value for it!").arg(snip_id); else if(attribs[Attributes::Contents].isEmpty()) err_msg=trUtf8("Empty code for snippet %1. Please, specify a value for it!").arg(snip_id); - else if(attribs[Attributes::PARSABLE]==Attributes::True) + else if(attribs[Attributes::Parsable]==Attributes::True) { try { @@ -311,8 +311,8 @@ attribs_map SnippetsConfigWidget::getSnippetAttributes(void) return(attribs_map{ {Attributes::Id, id_edt->text()}, {Attributes::Label, label_edt->text()}, {Attributes::Object, object_id}, - {Attributes::PARSABLE, (parsable_chk->isChecked() ? Attributes::True : Attributes::False)}, - {Attributes::PLACEHOLDERS, (parsable_chk->isChecked() && placeholders_chk->isChecked() ? + {Attributes::Parsable, (parsable_chk->isChecked() ? Attributes::True : Attributes::False)}, + {Attributes::Placeholders, (parsable_chk->isChecked() && placeholders_chk->isChecked() ? Attributes::True : Attributes::False)}, {Attributes::Contents, snippet_txt->toPlainText()} }); } @@ -326,8 +326,8 @@ void SnippetsConfigWidget::editSnippet(void) snippet_txt->setPlainText(config_params[snip_id].at(Attributes::Contents)); id_edt->setText(snip_id); label_edt->setText(config_params[snip_id].at(Attributes::Label)); - parsable_chk->setChecked(config_params[snip_id].at(Attributes::PARSABLE)==Attributes::True); - placeholders_chk->setChecked(config_params[snip_id].at(Attributes::PLACEHOLDERS)==Attributes::True); + parsable_chk->setChecked(config_params[snip_id].at(Attributes::Parsable)==Attributes::True); + placeholders_chk->setChecked(config_params[snip_id].at(Attributes::Placeholders)==Attributes::True); applies_to_cmb->setCurrentText(BaseObject::getTypeName(obj_type)); } diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 5a24a2b744..0a06261df5 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -479,7 +479,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) italic=(attribs[Attributes::Italic]==Attributes::True); bold=(attribs[Attributes::Bold]==Attributes::True); underline=(attribs[Attributes::UNDERLINE]==Attributes::True); - partial_match=(attribs[Attributes::PARTIAL_MATCH]==Attributes::True); + partial_match=(attribs[Attributes::PartialMatch]==Attributes::True); fg_color.setNamedColor(attribs[Attributes::ForegroundColor]); //If the attribute isn't defined the bg color will be transparent diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index ebe7bb2042..24443bf6ab 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1038,7 +1038,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Replacing attribute owner by onwer-col for sequences if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Sequence)))) - obj_xml.replace(Attributes::OWNER, Attributes::OWNER_COLUMN); + obj_xml.replace(Attributes::Owner, Attributes::OwnerColumn); //Remove sysid attribute from tags. if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Role)))) @@ -1047,8 +1047,8 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Replace tag by on tags. if(obj_xml.contains(TagExpr.arg(QString("usertype")))) { - obj_xml.replace(TagExpr.arg(Attributes::PARAMETER), TagExpr.arg(Attributes::TYPE_ATTRIBUTE)); - obj_xml.replace(EndTagExpr.arg(Attributes::PARAMETER), EndTagExpr.arg(Attributes::TYPE_ATTRIBUTE)); + obj_xml.replace(TagExpr.arg(Attributes::Parameter), TagExpr.arg(Attributes::TYPE_ATTRIBUTE)); + obj_xml.replace(EndTagExpr.arg(Attributes::Parameter), EndTagExpr.arg(Attributes::TYPE_ATTRIBUTE)); } if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Relationship)))) @@ -1494,13 +1494,13 @@ bool PgModelerCli::containsRelAttributes(const QString &str) bool found=false; static vector attribs={ Attributes::RELATIONSHIP, Attributes::TYPE, Attributes::SRC_REQUIRED, Attributes::DstRequired, - Attributes::SRC_TABLE, Attributes::DstTable, Attributes::POINTS, + Attributes::SRC_TABLE, Attributes::DstTable, Attributes::Points, Attributes::Columns, Attributes::Column, Attributes::Constraint, Attributes::Label, Attributes::Line, Attributes::POSITION, Attributes::Identifier, Attributes::Deferrable, Attributes::DeferType, Attributes::TABLE_NAME, Attributes::SPECIAL_PK_COLS, Attributes::TABLE, Attributes::AncestorTable, Attributes::CopyOptions, Attributes::CopyMode, - Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, Attributes::PK_PATTERN, + Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, Attributes::PkPattern, Attributes::UQ_PATTERN, Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern }; for(unsigned i=0; i < attribs.size() && !found; i++) From cb50a831d45a82e75f651d3bc032ec1d47fdba0a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 10:52:25 -0300 Subject: [PATCH 185/425] Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 14 +- libobjrenderer/src/relationshipview.cpp | 10 +- libobjrenderer/src/tableobjectview.cpp | 14 +- libparsers/src/attributes.cpp | 100 +++++------ libparsers/src/attributes.h | 100 +++++------ libpgmodeler/src/aggregate.cpp | 4 +- libpgmodeler/src/basegraphicobject.cpp | 4 +- libpgmodeler/src/baseobject.cpp | 18 +- libpgmodeler/src/baserelationship.cpp | 40 ++--- libpgmodeler/src/constraint.cpp | 4 +- libpgmodeler/src/databasemodel.cpp | 168 +++++++++--------- libpgmodeler/src/function.cpp | 18 +- libpgmodeler/src/index.cpp | 4 +- libpgmodeler/src/language.cpp | 2 +- libpgmodeler/src/operator.cpp | 10 +- libpgmodeler/src/permission.cpp | 10 +- libpgmodeler/src/pgsqltypes.cpp | 6 +- libpgmodeler/src/reference.cpp | 4 +- libpgmodeler/src/relationship.cpp | 12 +- libpgmodeler/src/role.cpp | 10 +- libpgmodeler/src/schema.cpp | 4 +- libpgmodeler/src/trigger.cpp | 4 +- libpgmodeler/src/type.cpp | 16 +- libpgmodeler/src/view.cpp | 8 +- .../src/appearanceconfigwidget.cpp | 14 +- .../src/databaseexplorerwidget.cpp | 60 +++---- libpgmodeler_ui/src/databaseimportform.cpp | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 62 +++---- libpgmodeler_ui/src/datamanipulationform.cpp | 6 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 26 +-- libpgmodeler_ui/src/mainwindow.cpp | 8 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 8 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 4 +- libpgmodeler_ui/src/permissionwidget.cpp | 2 +- .../src/relationshipconfigwidget.cpp | 24 +-- libpgmodeler_ui/src/syntaxhighlighter.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 12 +- 38 files changed, 408 insertions(+), 408 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 2f9309a4ce..502014c3d1 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -462,14 +462,14 @@ void BaseObjectView::configurePositionInfo(QPointF pos) { if(this->isSelected()) { - QFont fnt=font_config[Attributes::POSITION_INFO].font(); + QFont fnt=font_config[Attributes::PositionInfo].font(); - pos_info_rect->setBrush(BaseObjectView::getFillStyle(Attributes::POSITION_INFO)); - pos_info_rect->setPen(BaseObjectView::getBorderStyle(Attributes::POSITION_INFO)); + pos_info_rect->setBrush(BaseObjectView::getFillStyle(Attributes::PositionInfo)); + pos_info_rect->setPen(BaseObjectView::getBorderStyle(Attributes::PositionInfo)); fnt.setPointSizeF(fnt.pointSizeF() * 0.95); pos_info_txt->setFont(fnt); - pos_info_txt->setBrush(font_config[Attributes::POSITION_INFO].foreground()); + pos_info_txt->setBrush(font_config[Attributes::PositionInfo].foreground()); pos_info_txt->setText(QString(" x:%1 y:%2 ").arg(roundf(pos.x())).arg(roundf(pos.y()))); pos_info_rect->setRect(pos_info_txt->boundingRect()); @@ -490,7 +490,7 @@ void BaseObjectView::configureSQLDisabledInfo(void) if(this->getSourceObject()->isSQLDisabled()) { QTextCharFormat char_fmt; - char_fmt=BaseObjectView::getFontStyle(Attributes::POSITION_INFO); + char_fmt=BaseObjectView::getFontStyle(Attributes::PositionInfo); char_fmt.setFontPointSize(char_fmt.font().pointSizeF() * 0.80); sql_disabled_txt->setFont(char_fmt.font()); @@ -498,8 +498,8 @@ void BaseObjectView::configureSQLDisabledInfo(void) sql_disabled_txt->setBrush(char_fmt.foreground()); sql_disabled_box->setRect(QRectF(QPointF(0,0), sql_disabled_txt->boundingRect().size() + QSizeF(1.5 * HorizSpacing, 1.5 * VertSpacing))); - sql_disabled_box->setPen(BaseObjectView::getBorderStyle(Attributes::POSITION_INFO)); - sql_disabled_box->setBrush(BaseObjectView::getFillStyle(Attributes::POSITION_INFO)); + sql_disabled_box->setPen(BaseObjectView::getBorderStyle(Attributes::PositionInfo)); + sql_disabled_box->setBrush(BaseObjectView::getFillStyle(Attributes::PositionInfo)); px=bounding_rect.width() - sql_disabled_box->boundingRect().width() + (1.5 * HorizSpacing), py=-(sql_disabled_box->boundingRect().height()/2); diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index cd3bbf9cec..5bf3d88986 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -249,7 +249,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant //Alter the relationship line color when it is selected if(line_color==Qt::transparent) - line_color=BaseObjectView::getBorderStyle(Attributes::RELATIONSHIP).color(); + line_color=BaseObjectView::getBorderStyle(Attributes::Relationship).color(); if(value.toBool()) { @@ -1005,7 +1005,7 @@ void RelationshipView::configureLine(void) pen.setColor(base_rel->getCustomColor()); else //Using the default color - pen=BaseObjectView::getBorderStyle(Attributes::RELATIONSHIP); + pen=BaseObjectView::getBorderStyle(Attributes::Relationship); } //For dependency/partition relationships the line is dashed @@ -1284,7 +1284,7 @@ void RelationshipView::configureDescriptor(void) pen.setColor(base_rel->getCustomColor()); else //Using the default color - pen=BaseObjectView::getBorderStyle(Attributes::RELATIONSHIP); + pen=BaseObjectView::getBorderStyle(Attributes::Relationship); if(rel_type==BaseRelationship::RelationshipDep || rel_type == BaseRelationship::RelationshipPart) @@ -1296,7 +1296,7 @@ void RelationshipView::configureDescriptor(void) { QColor colors[2]; QLinearGradient grad; - BaseObjectView::getFillStyle(Attributes::RELATIONSHIP, colors[0], colors[1]); + BaseObjectView::getFillStyle(Attributes::Relationship, colors[0], colors[1]); for(unsigned i=0; i < 2; i++) { @@ -1310,7 +1310,7 @@ void RelationshipView::configureDescriptor(void) descriptor->setBrush(grad); } else - descriptor->setBrush(BaseObjectView::getFillStyle(Attributes::RELATIONSHIP)); + descriptor->setBrush(BaseObjectView::getFillStyle(Attributes::Relationship)); if(rel_type==BaseRelationship::RelationshipDep || rel_type==BaseRelationship::RelationshipGen) diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index f69c1c14e5..57bbf43347 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -176,9 +176,9 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) QGraphicsEllipseItem *desc=dynamic_cast(descriptor); desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0f * factor, 9.0f * factor))); - desc->setBrush(this->getFillStyle(Attributes::REFERENCE)); + desc->setBrush(this->getFillStyle(Attributes::Reference)); - pen = this->getBorderStyle(Attributes::REFERENCE); + pen = this->getBorderStyle(Attributes::Reference); pen.setWidthF(ObjectBorderWidth * 1.15f); desc->setPen(pen); } @@ -230,7 +230,7 @@ void TableObjectView::configureObject(void) if(column->isAddedByRelationship()) fmt=font_config[Attributes::InhColumn]; else if(column->isProtected()) - fmt=font_config[Attributes::PROT_COLUMN]; + fmt=font_config[Attributes::ProtColumn]; if(str_constr.indexOf(TextPrimaryKey)>=0) atribs_tip+=(~ConstraintType(ConstraintType::PrimaryKey)).toLower() + QString(", "); @@ -252,7 +252,7 @@ void TableObjectView::configureObject(void) if(tab_obj->isAddedByRelationship()) fmt=font_config[Attributes::InhColumn]; else if(tab_obj->isProtected()) - fmt=font_config[Attributes::PROT_COLUMN]; + fmt=font_config[Attributes::ProtColumn]; else fmt=font_config[tab_obj->getSchemaName()]; } @@ -447,7 +447,7 @@ void TableObjectView::configureObject(Reference reference) if(reference.getReferenceType()==Reference::ReferColumn) { //Configures the name label as: [table].[column] - fmt=font_config[Attributes::REF_TABLE]; + fmt=font_config[Attributes::RefTable]; if(compact_view && !reference.getReferenceAlias().isEmpty()) lables[0]->setText(reference.getReferenceAlias()); @@ -459,7 +459,7 @@ void TableObjectView::configureObject(Reference reference) lables[0]->setPos(px, 0); px+=lables[0]->boundingRect().width(); - fmt=font_config[Attributes::REF_COLUMN]; + fmt=font_config[Attributes::RefColumn]; if(compact_view && !reference.getReferenceAlias().isEmpty()) lables[1]->setText(QString(" ")); else @@ -477,7 +477,7 @@ void TableObjectView::configureObject(Reference reference) } else { - fmt=font_config[Attributes::REF_TABLE]; + fmt=font_config[Attributes::RefTable]; str_aux = compact_view && !reference.getReferenceAlias().isEmpty() ? reference.getReferenceAlias() : QString(); if(str_aux.isEmpty()) diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index febb274a7a..5ca3309d13 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -386,56 +386,56 @@ namespace Attributes { PkPattern=QString("pk-pattern"), Points=QString("points"), Port=QString("port"), - PORTRAIT=QString("portrait"), - POSITION_INFO=QString("pos-info"), - POSITION=QString("position"), - PRECISION=QString("precision"), - PREDICATE=QString("predicate"), - PREFERRED=QString("preferred"), - PREPEND_AT_BOD=QString("prepend-at-bod"), - PREPENDED_SQL=QString("prepended-sql"), - PRINT_GRID=QString("print-grid"), - PRINT_PG_NUM=QString("print-pg-num"), - PRIVILEGES_GOP=QString("privileges-gop"), - PRIVILEGES=QString("privileges"), - PROT_COLUMN=QString("prot-column"), - PROTECTED=QString("protected"), - RANGE_ATTRIBS=QString("range-attribs"), - RANGE_TYPE=QString("range"), - RECENT_MODELS=QString("recent-models"), - RECENT=QString("recent"), - RECT_VISIBLE=QString("rect-visible"), - RECURSIVE=QString("recursive"), - RECV_FUNC=QString("receive"), - REDUCED_FORM=QString("reduced-form"), - REF_ALIAS=QString("ref-alias"), - REF_COLUMN=QString("ref-column"), - REF_ROLES=QString("ref-roles"), - REF_TABLE=QString("ref-table"), - REF_TYPE=QString("ref-type"), - REFER=QString("refer"), - REFERENCE=QString("reference"), - REFERENCE_FK=QString("reference-fk"), - REFERENCES_PRIV=QString("references"), - REFERENCES=QString("references"), - REFERRERS=QString("referrers"), - REGULAR_EXP=QString("regexp"), - RELATION_TAB_VIEW=QString("reltv"), - RELATIONSHIP_11=QString("rel11"), - RELATIONSHIP_1N=QString("rel1n"), - RELATIONSHIP_DEP=QString("reldep"), - RELATIONSHIP_FK=QString("relfk"), - RELATIONSHIP_GEN=QString("relgen"), - RELATIONSHIP_NN=QString("relnn"), - RELATIONSHIP_PART=QString("relpart"), - RELATIONSHIP=QString("relationship"), - RENAME=QString("rename"), - REPLICATION=QString("replication"), - RESTRICTION_FUNC=QString("restriction"), - RESTART_SEQ=QString("restart-seq"), - RETURN_TABLE=QString("return-table"), - RETURN_TYPE=QString("return-type"), - RETURNS_SETOF=QString("returns-setof"), + Portrait=QString("portrait"), + PositionInfo=QString("pos-info"), + Position=QString("position"), + Precision=QString("precision"), + Predicate=QString("predicate"), + Preferred=QString("preferred"), + PrependAtBod=QString("prepend-at-bod"), + PrependedSql=QString("prepended-sql"), + PrintGrid=QString("print-grid"), + PrintPgNum=QString("print-pg-num"), + PrivilegesGop=QString("privileges-gop"), + Privileges=QString("privileges"), + ProtColumn=QString("prot-column"), + Protected=QString("protected"), + RangeAttribs=QString("range-attribs"), + RangeType=QString("range"), + RecentModels=QString("recent-models"), + Recent=QString("recent"), + RectVisible=QString("rect-visible"), + Recursive=QString("recursive"), + RecvFunc=QString("receive"), + ReducedForm=QString("reduced-form"), + RefAlias=QString("ref-alias"), + RefColumn=QString("ref-column"), + RefRoles=QString("ref-roles"), + RefTable=QString("ref-table"), + RefType=QString("ref-type"), + Refer=QString("refer"), + Reference=QString("reference"), + ReferenceFk=QString("reference-fk"), + ReferencesPriv=QString("references"), + References=QString("references"), + Referrers=QString("referrers"), + RegularExp=QString("regexp"), + RelationshipTabView=QString("reltv"), + Relationship11=QString("rel11"), + Relationship1n=QString("rel1n"), + RelationshipDep=QString("reldep"), + RelationshipFk=QString("relfk"), + RelationshipGen=QString("relgen"), + RelationshipNn=QString("relnn"), + RelationshipPart=QString("relpart"), + Relationship=QString("relationship"), + Rename=QString("rename"), + Replication=QString("replication"), + RestrictionFunc=QString("restriction"), + RestartSeq=QString("restart-seq"), + ReturnTable=QString("return-table"), + ReturnType=QString("return-type"), + ReturnsSetOf=QString("returns-setof"), REVOKE=QString("revoke"), RIGHT_TYPE=QString("right-type"), RIGHT=QString("right"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 2e4c21fbca..9da93b948e 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -398,56 +398,56 @@ namespace Attributes { PkPattern, Points, Port, - PORTRAIT, - POSITION_INFO, - POSITION, - PRECISION, - PREDICATE, - PREFERRED, - PREPEND_AT_BOD, - PREPENDED_SQL, - PRINT_GRID, - PRINT_PG_NUM, - PRIVILEGES_GOP, - PRIVILEGES, - PROT_COLUMN, - PROTECTED, - RANGE_ATTRIBS, - RANGE_TYPE, - RECENT_MODELS, - RECENT, - RECT_VISIBLE, - RECURSIVE, - RECV_FUNC, - REDUCED_FORM, - REF_ALIAS, - REF_COLUMN, - REF_ROLES, - REF_TABLE, - REF_TYPE, - REFER, - REFERENCE, - REFERENCE_FK, - REFERENCES_PRIV, - REFERENCES, - REFERRERS, - REGULAR_EXP, - RELATION_TAB_VIEW, - RELATIONSHIP_11, - RELATIONSHIP_1N, - RELATIONSHIP_DEP, - RELATIONSHIP_FK, - RELATIONSHIP_GEN, - RELATIONSHIP_NN, - RELATIONSHIP_PART, - RELATIONSHIP, - RENAME, - REPLICATION, - RESTART_SEQ, - RESTRICTION_FUNC, - RETURN_TABLE, - RETURN_TYPE, - RETURNS_SETOF, + Portrait, + PositionInfo, + Position, + Precision, + Predicate, + Preferred, + PrependAtBod, + PrependedSql, + PrintGrid, + PrintPgNum, + PrivilegesGop, + Privileges, + ProtColumn, + Protected, + RangeAttribs, + RangeType, + RecentModels, + Recent, + RectVisible, + Recursive, + RecvFunc, + ReducedForm, + RefAlias, + RefColumn, + RefRoles, + RefTable, + RefType, + Refer, + Reference, + ReferenceFk, + ReferencesPriv, + References, + Referrers, + RegularExp, + RelationshipTabView, + Relationship11, + Relationship1n, + RelationshipDep, + RelationshipFk, + RelationshipGen, + RelationshipNn, + RelationshipPart, + Relationship, + Rename, + Replication, + RestartSeq, + RestrictionFunc, + ReturnTable, + ReturnType, + ReturnsSetOf, REVOKE, RIGHT_TYPE, RIGHT, diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index c20b279012..12d8e08622 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -232,7 +232,7 @@ QString Aggregate::getCodeDefinition(unsigned def_type) attributes[Attributes::TRANSITION_FUNC]=functions[TransitionFunc]->getSignature(); else { - functions[TransitionFunc]->setAttribute(Attributes::REF_TYPE, + functions[TransitionFunc]->setAttribute(Attributes::RefType, Attributes::TRANSITION_FUNC); attributes[Attributes::TRANSITION_FUNC]=functions[TransitionFunc]->getCodeDefinition(def_type,true); } @@ -244,7 +244,7 @@ QString Aggregate::getCodeDefinition(unsigned def_type) attributes[Attributes::FinalFunc]=functions[FinalFunc]->getSignature(); else { - functions[FinalFunc]->setAttribute(Attributes::REF_TYPE, + functions[FinalFunc]->setAttribute(Attributes::RefType, Attributes::FinalFunc); attributes[Attributes::FinalFunc]=functions[FinalFunc]->getCodeDefinition(def_type,true); } diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 3efa9b72d6..8c2fcde1bd 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -24,7 +24,7 @@ BaseGraphicObject::BaseGraphicObject(void) is_faded_out=false; attributes[Attributes::X_POS]=QString(); attributes[Attributes::Y_POS]=QString(); - attributes[Attributes::POSITION]=QString(); + attributes[Attributes::Position]=QString(); attributes[Attributes::FadedOut]=QString(); receiver_object=nullptr; } @@ -83,7 +83,7 @@ void BaseGraphicObject::setPositionAttribute(void) { attributes[Attributes::X_POS]=QString("%1").arg(position.x()); attributes[Attributes::Y_POS]=QString("%1").arg(position.y()); - attributes[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, attributes, SchemaParser::XmlDefinition); + attributes[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, attributes, SchemaParser::XmlDefinition); } void BaseGraphicObject::setPosition(QPointF pos) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index e13fb5205c..6478d1671f 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -89,10 +89,10 @@ BaseObject::BaseObject(void) attributes[Attributes::TABLESPACE]=QString(); attributes[Attributes::SCHEMA]=QString(); attributes[Attributes::Collation]=QString(); - attributes[Attributes::PROTECTED]=QString(); + attributes[Attributes::Protected]=QString(); attributes[Attributes::SQL_DISABLED]=QString(); attributes[Attributes::AppendedSql]=QString(); - attributes[Attributes::PREPENDED_SQL]=QString(); + attributes[Attributes::PrependedSql]=QString(); attributes[Attributes::Drop]=QString(); attributes[Attributes::SIGNATURE]=QString(); this->setName(QApplication::translate("BaseObject","new_object","", -1)); @@ -724,7 +724,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) } if(def_type==SchemaParser::XmlDefinition) - attributes[Attributes::PROTECTED]=(is_protected ? Attributes::True : QString()); + attributes[Attributes::Protected]=(is_protected ? Attributes::True : QString()); if(tablespace) { @@ -797,17 +797,17 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(!prepended_sql.isEmpty()) { - attributes[Attributes::PREPENDED_SQL]=prepended_sql; + attributes[Attributes::PrependedSql]=prepended_sql; if(def_type==SchemaParser::XmlDefinition) { schparser.ignoreUnkownAttributes(true); - attributes[Attributes::PREPENDED_SQL]= - schparser.getCodeDefinition(QString(Attributes::PREPENDED_SQL).remove('-'), attributes, def_type); + attributes[Attributes::PrependedSql]= + schparser.getCodeDefinition(QString(Attributes::PrependedSql).remove('-'), attributes, def_type); } else { - attributes[Attributes::PREPENDED_SQL]=QString("\n-- Prepended SQL commands --\n") + prepended_sql; + attributes[Attributes::PrependedSql]=QString("\n-- Prepended SQL commands --\n") + prepended_sql; } } @@ -817,7 +817,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::Drop].remove(Attributes::DdlEndToken + '\n'); } - attributes[Attributes::REDUCED_FORM]=(reduced_form ? Attributes::True : QString()); + attributes[Attributes::ReducedForm]=(reduced_form ? Attributes::True : QString()); try { @@ -1201,7 +1201,7 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff if(!ignore_name_diff && this->getName()!=object->getName()) { attributes[Attributes::NewName]=object->getName(true, false); - alter+=BaseObject::getAlterDefinition(Attributes::RENAME, attributes, true); + alter+=BaseObject::getAlterDefinition(Attributes::Rename, attributes, true); attributes[Attributes::Name]=attributes[Attributes::NewName]; attributes[Attributes::SIGNATURE]=object->getSignature(true); } diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index ce387573b2..1c4b53983c 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -87,17 +87,17 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::Constraints]=QString(); attributes[Attributes::Elements]=QString(); attributes[Attributes::Identifier]=QString(); - attributes[Attributes::REDUCED_FORM]=QString(); + attributes[Attributes::ReducedForm]=QString(); attributes[Attributes::Deferrable]=QString(); attributes[Attributes::DeferType]=QString(); attributes[Attributes::TABLE_NAME]=QString(); attributes[Attributes::SPECIAL_PK_COLS]=QString(); - attributes[Attributes::RELATIONSHIP_NN]=QString(); - attributes[Attributes::RELATIONSHIP_GEN]=QString(); - attributes[Attributes::RELATIONSHIP_DEP]=QString(); - attributes[Attributes::RELATIONSHIP_PART]=QString(); - attributes[Attributes::RELATIONSHIP_1N]=QString(); - attributes[Attributes::RELATIONSHIP_11]=QString(); + attributes[Attributes::RelationshipNn]=QString(); + attributes[Attributes::RelationshipGen]=QString(); + attributes[Attributes::RelationshipDep]=QString(); + attributes[Attributes::RelationshipPart]=QString(); + attributes[Attributes::Relationship1n]=QString(); + attributes[Attributes::Relationship11]=QString(); attributes[Attributes::Constraints]=QString(); attributes[Attributes::TABLE]=QString(); attributes[Attributes::AncestorTable]=QString(); @@ -114,7 +114,7 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::UPD_ACTION]=QString(); attributes[Attributes::DelAction]=QString(); attributes[Attributes::CustomColor]=QString(); - attributes[Attributes::REFERENCE_FK]=QString(); + attributes[Attributes::ReferenceFk]=QString(); attributes[Attributes::PartitionBoundExpr]=QString(); attributes[Attributes::OriginalPk]=QString(); @@ -349,7 +349,7 @@ void BaseRelationship::setRelationshipAttributes(void) { attributes[Attributes::X_POS]=QString("%1").arg(points[i].x()); attributes[Attributes::Y_POS]=QString("%1").arg(points[i].y()); - str_aux+=schparser.getCodeDefinition(Attributes::POSITION, attributes, SchemaParser::XmlDefinition); + str_aux+=schparser.getCodeDefinition(Attributes::Position, attributes, SchemaParser::XmlDefinition); } attributes[Attributes::Points]=str_aux; @@ -360,15 +360,15 @@ void BaseRelationship::setRelationshipAttributes(void) { attributes[Attributes::X_POS]=QString("%1").arg(lables_dist[i].x()); attributes[Attributes::Y_POS]=QString("%1").arg(lables_dist[i].y()); - attributes[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, attributes, SchemaParser::XmlDefinition); - attributes[Attributes::REF_TYPE]=label_attribs[i]; + attributes[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, attributes, SchemaParser::XmlDefinition); + attributes[Attributes::RefType]=label_attribs[i]; str_aux+=schparser.getCodeDefinition(Attributes::Label, attributes, SchemaParser::XmlDefinition); } } attributes[Attributes::LabelsPos]=str_aux; attributes[Attributes::CustomColor]=(custom_color!=Qt::transparent ? custom_color.name() : QString()); - attributes[Attributes::REFERENCE_FK]=(reference_fk ? reference_fk->getName() : QString()); + attributes[Attributes::ReferenceFk]=(reference_fk ? reference_fk->getName() : QString()); setFadedOutAttribute(); } @@ -505,17 +505,17 @@ QString BaseRelationship::getRelTypeAttribute(void) { switch(rel_type) { - case Relationship11: return(Attributes::RELATIONSHIP_11); break; - case Relationship1n: return(Attributes::RELATIONSHIP_1N); break; - case RelationshipNn: return(Attributes::RELATIONSHIP_NN); break; - case RelationshipGen: return(Attributes::RELATIONSHIP_GEN); break; - case RelationshipPart: return(Attributes::RELATIONSHIP_PART); break; - case RelationshipFk: return(Attributes::RELATIONSHIP_FK); break; + case Relationship11: return(Attributes::Relationship11); break; + case Relationship1n: return(Attributes::Relationship1n); break; + case RelationshipNn: return(Attributes::RelationshipNn); break; + case RelationshipGen: return(Attributes::RelationshipGen); break; + case RelationshipPart: return(Attributes::RelationshipPart); break; + case RelationshipFk: return(Attributes::RelationshipFk); break; default: if(src_table->getObjectType()==ObjectType::View) - return(Attributes::RELATION_TAB_VIEW); + return(Attributes::RelationshipTabView); else - return(Attributes::RELATIONSHIP_DEP); + return(Attributes::RelationshipDep); break; } } diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 3c0c0437d1..9bbd08c91c 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -32,7 +32,7 @@ Constraint::Constraint(void) attributes[Attributes::CkConstr]=QString(); attributes[Attributes::UQ_CONSTR]=QString(); attributes[Attributes::ExConstr]=QString(); - attributes[Attributes::REF_TABLE]=QString(); + attributes[Attributes::RefTable]=QString(); attributes[Attributes::SRC_COLUMNS]=QString(); attributes[Attributes::DstColumns]=QString(); attributes[Attributes::DelAction]=QString(); @@ -710,7 +710,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) setColumnsAttribute(ReferencedCols, def_type, inc_addedbyrel); } - attributes[Attributes::REF_TABLE]=(ref_table ? ref_table->getName(true) : QString()); + attributes[Attributes::RefTable]=(ref_table ? ref_table->getName(true) : QString()); attributes[Attributes::Deferrable]=(deferrable ? Attributes::True : QString()); attributes[Attributes::NoInherit]=(no_inherit ? Attributes::True : QString()); attributes[Attributes::ComparisonType]=(~match_type); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 5043abd9c8..24f035e31c 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -47,7 +47,7 @@ DatabaseModel::DatabaseModel(void) attributes[Attributes::LcCollate]=QString(); attributes[Attributes::LcCtype]=QString(); attributes[Attributes::AppendAtEod]=QString(); - attributes[Attributes::PREPEND_AT_BOD]=QString(); + attributes[Attributes::PrependAtBod]=QString(); attributes[Attributes::AllowConns]=QString(); attributes[Attributes::IsTemplate]=QString(); } @@ -2970,7 +2970,7 @@ void DatabaseModel::configureDatabase(attribs_map &attribs) localizations[0]=attribs[Attributes::LcCtype]; localizations[1]=attribs[Attributes::LcCollate]; append_at_eod=attribs[Attributes::AppendAtEod]==Attributes::True; - prepend_at_bod=attribs[Attributes::PREPEND_AT_BOD]==Attributes::True; + prepend_at_bod=attribs[Attributes::PrependAtBod]==Attributes::True; is_template=attribs[Attributes::IsTemplate]==Attributes::True; allow_conns=attribs[Attributes::AllowConns] != Attributes::False; @@ -3032,7 +3032,7 @@ void DatabaseModel::loadModel(const QString &filename) this->allow_conns = (attribs[Attributes::AllowConns].isEmpty() || attribs[Attributes::AllowConns] == Attributes::True); - protected_model=(attribs[Attributes::PROTECTED]==Attributes::True); + protected_model=(attribs[Attributes::Protected]==Attributes::True); def_objs[ObjectType::Schema]=attribs[Attributes::DefaultSchema]; def_objs[ObjectType::Role]=attribs[Attributes::DefaultOwner]; @@ -3254,7 +3254,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) if(BaseObject::acceptsAlias(obj_type_aux)) object->setAlias(attribs[Attributes::Alias]); - protected_obj=attribs[Attributes::PROTECTED]==Attributes::True; + protected_obj=attribs[Attributes::Protected]==Attributes::True; sql_disabled=attribs[Attributes::SQL_DISABLED]==Attributes::True; xmlparser.savePosition(); @@ -3318,7 +3318,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) object->setAppendedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } - else if(elem_name==Attributes::PREPENDED_SQL) + else if(elem_name==Attributes::PrependedSql) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -3326,11 +3326,11 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.restorePosition(); } //Defines the object's position (only for graphical objects) - else if(elem_name==Attributes::POSITION) + else if(elem_name==Attributes::Position) { xmlparser.getElementAttributes(attribs); - if(elem_name==Attributes::POSITION && + if(elem_name==Attributes::Position && (obj_type_aux!=ObjectType::Relationship && obj_type_aux!=ObjectType::BaseRelationship)) { @@ -3459,7 +3459,7 @@ Role *DatabaseModel::createRole(void) QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, Attributes::Login, Attributes::Encrypted, - Attributes::REPLICATION, Attributes::BypassRls }; + Attributes::Replication, Attributes::BypassRls }; unsigned op_vect[]={ Role::OpSuperuser, Role::OpCreateDb, Role::OpCreateRole, Role::OpInherit, @@ -3506,7 +3506,7 @@ Role *DatabaseModel::createRole(void) len=list.size(); //Identifying the member role type - if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::REFER) + if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::Refer) role_type=Role::RefRole; else if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::Member) role_type=Role::MemberRole; @@ -3578,7 +3578,7 @@ Schema *DatabaseModel::createSchema(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(schema); schema->setFillColor(QColor(attribs[Attributes::FillColor])); - schema->setRectVisible(attribs[Attributes::RECT_VISIBLE]==Attributes::True); + schema->setRectVisible(attribs[Attributes::RectVisible]==Attributes::True); schema->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); } catch(Exception &e) @@ -3619,7 +3619,7 @@ Language *DatabaseModel::createLanguage(void) xmlparser.getElementAttributes(attribs); //Gets the function reference type - ref_type=attribs[Attributes::REF_TYPE]; + ref_type=attribs[Attributes::RefType]; //Only VALIDATOR, HANDLER and INLINE functions are accepted for the language if(ref_type==Attributes::VALIDATOR_FUNC || @@ -3682,8 +3682,8 @@ Function *DatabaseModel::createFunction(void) setBasicAttributes(func); xmlparser.getElementAttributes(attribs); - if(!attribs[Attributes::RETURNS_SETOF].isEmpty()) - func->setReturnSetOf(attribs[Attributes::RETURNS_SETOF]== + if(!attribs[Attributes::ReturnsSetOf].isEmpty()) + func->setReturnSetOf(attribs[Attributes::ReturnsSetOf]== Attributes::True); if(!attribs[Attributes::WINDOW_FUNC].isEmpty()) @@ -3719,7 +3719,7 @@ Function *DatabaseModel::createFunction(void) obj_type=BaseObject::getObjectType(elem); //Gets the function return type from the XML - if(elem==Attributes::RETURN_TYPE) + if(elem==Attributes::ReturnType) { xmlparser.savePosition(); @@ -3947,8 +3947,8 @@ PgSqlType DatabaseModel::createPgSQLType(void) if(!attribs[Attributes::Dimension].isEmpty()) dimension=attribs[Attributes::Dimension].toUInt(); - if(!attribs[Attributes::PRECISION].isEmpty()) - precision=attribs[Attributes::PRECISION].toInt(); + if(!attribs[Attributes::Precision].isEmpty()) + precision=attribs[Attributes::Precision].toInt(); with_timezone=(attribs[Attributes::WITH_TIMEZONE]==Attributes::True); interv_type=attribs[Attributes::IntervalType]; @@ -4029,14 +4029,14 @@ Type *DatabaseModel::createType(void) if(!attribs[Attributes::Category].isEmpty()) type->setCategory(attribs[Attributes::Category]); - if(!attribs[Attributes::PREFERRED].isEmpty()) - type->setPreferred(attribs[Attributes::PREFERRED]==Attributes::True); + if(!attribs[Attributes::Preferred].isEmpty()) + type->setPreferred(attribs[Attributes::Preferred]==Attributes::True); //Configuring an auxiliary map used to reference the functions used by base type func_types[Attributes::InputFunc]=Type::InputFunc; func_types[Attributes::OutputFunc]=Type::OutputFunc; func_types[Attributes::SEND_FUNC]=Type::SendFunc; - func_types[Attributes::RECV_FUNC]=Type::RecvFunc; + func_types[Attributes::RecvFunc]=Type::RecvFunc; func_types[Attributes::TPMOD_IN_FUNC]=Type::TpmodInFunc; func_types[Attributes::TPMOD_OUT_FUNC]=Type::TpmodOutFunc; func_types[Attributes::AnalyzeFunc]=Type::AnalyzeFunc; @@ -4138,10 +4138,10 @@ Type *DatabaseModel::createType(void) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the function type is invalid - else if(func_types.count(attribs[Attributes::REF_TYPE])==0) + else if(func_types.count(attribs[Attributes::RefType])==0) throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); - type->setFunction(func_types[attribs[Attributes::REF_TYPE]], dynamic_cast(func)); + type->setFunction(func_types[attribs[Attributes::RefType]], dynamic_cast(func)); } } } @@ -4375,7 +4375,7 @@ Operator *DatabaseModel::createOperator(void) func_types[Attributes::OperatorFunc]=Operator::FUNC_OPERATOR; func_types[Attributes::JoinFunc]=Operator::FUNC_JOIN; - func_types[Attributes::RESTRICTION_FUNC]=Operator::FUNC_RESTRICT; + func_types[Attributes::RestrictionFunc]=Operator::FUNC_RESTRICT; oper_types[Attributes::CommutatorOp]=Operator::OPER_COMMUTATOR; oper_types[Attributes::NegatorOp]=Operator::OPER_NEGATOR; @@ -4403,13 +4403,13 @@ Operator *DatabaseModel::createOperator(void) ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setOperator(dynamic_cast(oper_aux), - oper_types[attribs[Attributes::REF_TYPE]]); + oper_types[attribs[Attributes::RefType]]); } else if(elem==Attributes::TYPE) { xmlparser.getElementAttributes(attribs); - if(attribs[Attributes::REF_TYPE]!=Attributes::RIGHT_TYPE) + if(attribs[Attributes::RefType]!=Attributes::RIGHT_TYPE) arg_type=Operator::LEFT_ARG; else arg_type=Operator::RIGHT_ARG; @@ -4432,7 +4432,7 @@ Operator *DatabaseModel::createOperator(void) ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); oper->setFunction(dynamic_cast(func), - func_types[attribs[Attributes::REF_TYPE]]); + func_types[attribs[Attributes::RefType]]); } } } @@ -4616,7 +4616,7 @@ Aggregate *DatabaseModel::createAggregate(void) xmlparser.getElementAttributes(attribs); type=createPgSQLType(); - if(attribs[Attributes::REF_TYPE]==Attributes::STATE_TYPE) + if(attribs[Attributes::RefType]==Attributes::STATE_TYPE) aggreg->setStateType(type); else aggreg->addDataType(type); @@ -4635,7 +4635,7 @@ Aggregate *DatabaseModel::createAggregate(void) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(attribs[Attributes::REF_TYPE]==Attributes::TRANSITION_FUNC) + if(attribs[Attributes::RefType]==Attributes::TRANSITION_FUNC) aggreg->setFunction(Aggregate::TransitionFunc, dynamic_cast(func)); else @@ -4968,9 +4968,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(!attribs[Attributes::UPD_ACTION].isEmpty()) constr->setActionType(attribs[Attributes::UPD_ACTION], Constraint::UpdateAction); - ref_table=getObject(attribs[Attributes::REF_TABLE], ObjectType::Table); + ref_table=getObject(attribs[Attributes::RefTable], ObjectType::Table); - if(!ref_table && table->getName(true)==attribs[Attributes::REF_TABLE]) + if(!ref_table && table->getName(true)==attribs[Attributes::RefTable]) ref_table=table; //Raises an error if the referenced table doesn't exists @@ -4979,7 +4979,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(constr->getName()) .arg(constr->getTypeName()) - .arg(attribs[Attributes::REF_TABLE]) + .arg(attribs[Attributes::RefTable]) .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5025,7 +5025,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) col_list=attribs[Attributes::Names].split(','); count=col_list.count(); - if(attribs[Attributes::REF_TYPE]==Attributes::SRC_COLUMNS) + if(attribs[Attributes::RefType]==Attributes::SRC_COLUMNS) col_type=Constraint::SourceCols; else col_type=Constraint::ReferencedCols; @@ -5341,7 +5341,7 @@ Index *DatabaseModel::createIndex(void) createElement(idx_elem, index, table); index->addIndexElement(idx_elem); } - else if(elem==Attributes::PREDICATE) + else if(elem==Attributes::Predicate) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5514,12 +5514,12 @@ Trigger *DatabaseModel::createTrigger(void) if(trigger->isDeferrable()) trigger->setDeferralType(attribs[Attributes::DeferType]); - if(!attribs[Attributes::REF_TABLE].isEmpty()) + if(!attribs[Attributes::RefTable].isEmpty()) { - ref_table=getObject(attribs[Attributes::REF_TABLE], ObjectType::Table); + ref_table=getObject(attribs[Attributes::RefTable], ObjectType::Table); if(!ref_table) - ref_table=getObject(attribs[Attributes::REF_TABLE], ObjectType::View); + ref_table=getObject(attribs[Attributes::RefTable], ObjectType::View); //Raises an error if the trigger is referencing a inexistent table if(!ref_table) @@ -5527,7 +5527,7 @@ Trigger *DatabaseModel::createTrigger(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(trigger->getName()) .arg(trigger->getTypeName()) - .arg(attribs[Attributes::REF_TABLE]) + .arg(attribs[Attributes::RefTable]) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5885,7 +5885,7 @@ View *DatabaseModel::createView(void) xmlparser.getElementAttributes(attribs); view->setObjectListsCapacity(attribs[Attributes::MaxObjCount].toUInt()); view->setMaterialized(attribs[Attributes::Materialized]==Attributes::True); - view->setRecursive(attribs[Attributes::RECURSIVE]==Attributes::True); + view->setRecursive(attribs[Attributes::Recursive]==Attributes::True); view->setWithNoData(attribs[Attributes::WITH_NO_DATA]==Attributes::True); view->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); @@ -5898,7 +5898,7 @@ View *DatabaseModel::createView(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::REFERENCE) + if(elem==Attributes::Reference) { xmlparser.getElementAttributes(attribs); @@ -5945,7 +5945,7 @@ View *DatabaseModel::createView(void) reference = Reference(table, column, attribs[Attributes::Alias], attribs[Attributes::ColumnAlias]); - reference.setReferenceAlias(attribs[Attributes::REF_ALIAS]); + reference.setReferenceAlias(attribs[Attributes::RefAlias]); refs.push_back(reference); } else @@ -5957,7 +5957,7 @@ View *DatabaseModel::createView(void) xmlparser.accessElement(XmlParser::ChildElement); reference = Reference(xmlparser.getElementContent(),str_aux); - reference.setReferenceAlias(attribs[Attributes::REF_ALIAS]); + reference.setReferenceAlias(attribs[Attributes::RefAlias]); refs.push_back(reference); xmlparser.restorePosition(); @@ -6225,21 +6225,21 @@ BaseRelationship *DatabaseModel::createRelationship(void) labels_id[Attributes::DstLabel]=BaseRelationship::DstCardLabel; xmlparser.getElementAttributes(attribs); - protect=(attribs[Attributes::PROTECTED]==Attributes::True); + protect=(attribs[Attributes::Protected]==Attributes::True); faded_out=(attribs[Attributes::FadedOut]==Attributes::True); if(!attribs[Attributes::CustomColor].isEmpty()) custom_color=QColor(attribs[Attributes::CustomColor]); - if(attribs[Attributes::TYPE]!=Attributes::RELATION_TAB_VIEW && - attribs[Attributes::TYPE]!=Attributes::RELATIONSHIP_FK) + if(attribs[Attributes::TYPE]!=Attributes::RelationshipTabView && + attribs[Attributes::TYPE]!=Attributes::RelationshipFk) { table_types[0]=ObjectType::Table; obj_rel_type=ObjectType::Relationship; } else { - if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_FK) + if(attribs[Attributes::TYPE]==Attributes::RelationshipFk) table_types[0]=ObjectType::Table; obj_rel_type=ObjectType::BaseRelationship; @@ -6269,7 +6269,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) /* Creates the fk relationship if it not exists. This generally happens when a foreign key is added to the table after its creation. */ - if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_FK) + if(attribs[Attributes::TYPE]==Attributes::RelationshipFk) { base_rel=new BaseRelationship(BaseRelationship::RelationshipFk, tables[0], tables[1], false, false); base_rel->setName(attribs[Attributes::Name]); @@ -6344,17 +6344,17 @@ BaseRelationship *DatabaseModel::createRelationship(void) upd_action=ActionType(attribs[Attributes::UPD_ACTION]); single_pk_col=(attribs[Attributes::SINGLE_PK_COLUMN]==Attributes::True); - if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_11) + if(attribs[Attributes::TYPE]==Attributes::Relationship11) rel_type=BaseRelationship::Relationship11; - else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_1N) + else if(attribs[Attributes::TYPE]==Attributes::Relationship1n) rel_type=BaseRelationship::Relationship1n; - else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_NN) + else if(attribs[Attributes::TYPE]==Attributes::RelationshipNn) rel_type=BaseRelationship::RelationshipNn; - else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_GEN) + else if(attribs[Attributes::TYPE]==Attributes::RelationshipGen) rel_type=BaseRelationship::RelationshipGen; - else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_DEP) + else if(attribs[Attributes::TYPE]==Attributes::RelationshipDep) rel_type=BaseRelationship::RelationshipDep; - else if(attribs[Attributes::TYPE]==Attributes::RELATIONSHIP_PART) + else if(attribs[Attributes::TYPE]==Attributes::RelationshipPart) rel_type=BaseRelationship::RelationshipPart; rel=new Relationship(rel_type, @@ -6441,7 +6441,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) else if(elem==Attributes::Label) { xmlparser.getElementAttributes(attribs); - str_aux=attribs[Attributes::REF_TYPE]; + str_aux=attribs[Attributes::RefType]; xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -6582,7 +6582,7 @@ Permission *DatabaseModel::createPermission(void) perm->addRole(role); } } - else if(xmlparser.getElementName()==Attributes::PRIVILEGES) + else if(xmlparser.getElementName()==Attributes::Privileges) { xmlparser.getElementAttributes(priv_attribs); @@ -6606,7 +6606,7 @@ Permission *DatabaseModel::createPermission(void) priv_type=Permission::PrivExecute; else if(itr->first==Attributes::InsertPriv) priv_type=Permission::PrivInsert; - else if(itr->first==Attributes::REFERENCES_PRIV) + else if(itr->first==Attributes::ReferencesPriv) priv_type=Permission::PrivReferences; else if(itr->first==Attributes::SELECT_PRIV) priv_type=Permission::PrivSelect; @@ -6743,7 +6743,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) attributes[Attributes::LcCollate]=localizations[1]; attributes[Attributes::LcCtype]=localizations[0]; attributes[Attributes::AppendAtEod]=(append_at_eod ? Attributes::True : QString()); - attributes[Attributes::PREPEND_AT_BOD]=(prepend_at_bod ? Attributes::True : QString()); + attributes[Attributes::PrependAtBod]=(prepend_at_bod ? Attributes::True : QString()); } attributes[Attributes::IsTemplate]=(is_template ? Attributes::True : Attributes::False); @@ -6932,7 +6932,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) if(def_type==SchemaParser::XmlDefinition) { attribs_aux[Attributes::MaxObjCount]=QString::number(static_cast(getMaxObjectCount() * 1.20)); - attribs_aux[Attributes::PROTECTED]=(this->is_protected ? Attributes::True : QString()); + attribs_aux[Attributes::Protected]=(this->is_protected ? Attributes::True : QString()); attribs_aux[Attributes::LastPosition]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); attribs_aux[Attributes::LastZoom]=QString::number(last_zoom); attribs_aux[Attributes::DefaultSchema]=(default_objs[ObjectType::Schema] ? default_objs[ObjectType::Schema]->getName(true) : QString()); @@ -9632,11 +9632,11 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::Name]=(TableObject::isTableObject(obj_type) ? object->getName() : object->getSignature()); attribs[Attributes::Alias]=(save_objs_aliases ? object->getAlias() : QString()); attribs[Attributes::TYPE]=object->getSchemaName(); - attribs[Attributes::PROTECTED]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? Attributes::True : QString()); + attribs[Attributes::Protected]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? Attributes::True : QString()); attribs[Attributes::SQL_DISABLED]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? Attributes::True : QString()); attribs[Attributes::TAG]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); attribs[Attributes::AppendedSql]=object->getAppendedSQL(); - attribs[Attributes::PREPENDED_SQL]=object->getPrependedSQL(); + attribs[Attributes::PrependedSql]=object->getPrependedSQL(); attribs[Attributes::HideExtAttribs]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? Attributes::True : QString()); attribs[Attributes::FadedOut]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? Attributes::True : QString()); @@ -9649,7 +9649,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(save_custom_sql && obj_type==ObjectType::Database) { attribs[Attributes::AppendAtEod]=(this->isAppendAtEOD() ? Attributes::True : Attributes::False); - attribs[Attributes::PREPEND_AT_BOD]=(this->isPrependedAtBOD() ? Attributes::True : Attributes::False); + attribs[Attributes::PrependAtBod]=(this->isPrependedAtBOD() ? Attributes::True : Attributes::False); } //Configuring database model attributes @@ -9676,7 +9676,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option schema=dynamic_cast(object); attribs[Attributes::CustomColor]=(save_custom_colors ? schema->getFillColor().name() : QString()); - attribs[Attributes::RECT_VISIBLE]=(schema->isRectVisible() ? Attributes::True : Attributes::False); + attribs[Attributes::RectVisible]=(schema->isRectVisible() ? Attributes::True : Attributes::False); if(schema->isRectVisible()) { @@ -9693,10 +9693,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(obj_type!=ObjectType::Schema || !attribs[Attributes::X_POS].isEmpty()) { schparser.ignoreUnkownAttributes(true); - attribs[Attributes::POSITION]= + attribs[Attributes::Position]= schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - Attributes::POSITION + GlobalAttributes::SchemaExt, attribs); + Attributes::Position + GlobalAttributes::SchemaExt, attribs); } } else @@ -9720,10 +9720,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::Y_POS]=QString::number(pnt.y()); schparser.ignoreUnkownAttributes(true); - attribs[Attributes::POSITION]+= + attribs[Attributes::Position]+= schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - Attributes::POSITION + GlobalAttributes::SchemaExt, attribs); + Attributes::Position + GlobalAttributes::SchemaExt, attribs); } //Saving the labels' custom positions @@ -9734,13 +9734,13 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { aux_attribs[Attributes::X_POS]=QString::number(pnt.x()); aux_attribs[Attributes::Y_POS]=QString::number(pnt.y()); - aux_attribs[Attributes::REF_TYPE]=labels_attrs[id]; + aux_attribs[Attributes::RefType]=labels_attrs[id]; - aux_attribs[Attributes::POSITION]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + aux_attribs[Attributes::Position]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - Attributes::POSITION + GlobalAttributes::SchemaExt, aux_attribs); + Attributes::Position + GlobalAttributes::SchemaExt, aux_attribs); - attribs[Attributes::POSITION]+=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + attribs[Attributes::Position]+=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + Attributes::Label + GlobalAttributes::SchemaExt, aux_attribs); } @@ -9757,9 +9757,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option QString(Attributes::AppendedSql).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); if(!object->getPrependedSQL().isEmpty()) - attribs[Attributes::PREPENDED_SQL]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + + attribs[Attributes::PrependedSql]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::XMLSchemaDir + GlobalAttributes::DirSeparator + - QString(Attributes::PREPENDED_SQL).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); + QString(Attributes::PrependedSql).remove(QChar('-')) + GlobalAttributes::SchemaExt, attribs); } /* The object's metadata code will be generated only if one of the key attributes @@ -9769,13 +9769,13 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option ((obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) || (!attribs[Attributes::CustomColor].isEmpty()))) || (save_objs_pos && - (!attribs[Attributes::POSITION].isEmpty() || - !attribs[Attributes::RECT_VISIBLE].isEmpty())) || + (!attribs[Attributes::Position].isEmpty() || + !attribs[Attributes::RectVisible].isEmpty())) || (save_tags && !attribs[Attributes::TAG].isEmpty()) || - (save_objs_prot && !attribs[Attributes::PROTECTED].isEmpty()) || + (save_objs_prot && !attribs[Attributes::Protected].isEmpty()) || (save_objs_sqldis && !attribs[Attributes::SQL_DISABLED].isEmpty()) || (save_custom_sql && (!attribs[Attributes::AppendedSql].isEmpty() || - !attribs[Attributes::PREPENDED_SQL].isEmpty())) || + !attribs[Attributes::PrependedSql].isEmpty())) || (save_fadeout && !attribs[Attributes::FadedOut].isEmpty()) || (save_extattribs && !attribs[Attributes::HideExtAttribs].isEmpty()) || (save_objs_aliases && !attribs[Attributes::Alias].isEmpty())) @@ -9966,11 +9966,11 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option .arg(object->getName()).arg(object->getTypeName()), ~obj_type); if(!object->isSystemObject() && - ((!attribs[Attributes::PROTECTED].isEmpty() && load_objs_prot) || + ((!attribs[Attributes::Protected].isEmpty() && load_objs_prot) || (!attribs[Attributes::SQL_DISABLED].isEmpty() && load_objs_sqldis))) { - if(!attribs[Attributes::PROTECTED].isEmpty()) - object->setProtected(attribs[Attributes::PROTECTED]==Attributes::True); + if(!attribs[Attributes::Protected].isEmpty()) + object->setProtected(attribs[Attributes::Protected]==Attributes::True); if(!attribs[Attributes::SQL_DISABLED].isEmpty()) object->setSQLDisabled(attribs[Attributes::SQL_DISABLED]==Attributes::True); @@ -9987,8 +9987,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(!attribs[Attributes::AppendAtEod].isEmpty()) this->setAppendAtEOD(attribs[Attributes::AppendAtEod]==Attributes::True); - if(!attribs[Attributes::PREPEND_AT_BOD].isEmpty()) - this->setPrependAtBOD(attribs[Attributes::PREPEND_AT_BOD]==Attributes::True); + if(!attribs[Attributes::PrependAtBod].isEmpty()) + this->setPrependAtBOD(attribs[Attributes::PrependAtBod]==Attributes::True); } if(load_objs_aliases && !attribs[Attributes::Alias].isEmpty()) @@ -10002,7 +10002,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option xmlparser.getElementAttributes(aux_attrib); //Retrieving and storing the points - if(aux_elem==Attributes::POSITION) + if(aux_elem==Attributes::Position) { points.push_back(QPointF(aux_attrib[Attributes::X_POS].toFloat(), aux_attrib[Attributes::Y_POS].toFloat())); @@ -10010,7 +10010,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option //Retrieving and storing the labels' custom positions else if(aux_elem==Attributes::Label) { - ref_type=aux_attrib[Attributes::REF_TYPE]; + ref_type=aux_attrib[Attributes::RefType]; xmlparser.savePosition(); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -10030,8 +10030,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option object->setAppendedSQL(xmlparser.getElementContent()); xmlparser.restorePosition(); } - else if(load_custom_sql && aux_elem==Attributes::PREPENDED_SQL && - attribs[Attributes::PREPENDED_SQL].isEmpty()) + else if(load_custom_sql && aux_elem==Attributes::PrependedSql && + attribs[Attributes::PrependedSql].isEmpty()) { xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -10076,7 +10076,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(load_custom_colors) schema->setFillColor(QColor(attribs[Attributes::CustomColor])); - schema->setRectVisible(attribs[Attributes::RECT_VISIBLE]==Attributes::True); + schema->setRectVisible(attribs[Attributes::RectVisible]==Attributes::True); } if(load_fadeout) diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 640be06fb5..5151ddbbe7 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -33,17 +33,17 @@ Function::Function(void) attributes[Attributes::Parameters]=QString(); attributes[Attributes::ExecutionCost]=QString(); attributes[Attributes::ROW_AMOUNT]=QString(); - attributes[Attributes::RETURN_TYPE]=QString(); + attributes[Attributes::ReturnType]=QString(); attributes[Attributes::FunctionType]=QString(); attributes[Attributes::Language]=QString(); - attributes[Attributes::RETURNS_SETOF]=QString(); + attributes[Attributes::ReturnsSetOf]=QString(); attributes[Attributes::SECURITY_TYPE]=QString(); attributes[Attributes::BehaviorType]=QString(); attributes[Attributes::Definition]=QString(); attributes[Attributes::SIGNATURE]=QString(); - attributes[Attributes::REF_TYPE]=QString(); + attributes[Attributes::RefType]=QString(); attributes[Attributes::WINDOW_FUNC]=QString(); - attributes[Attributes::RETURN_TABLE]=QString(); + attributes[Attributes::ReturnTable]=QString(); attributes[Attributes::Library]=QString(); attributes[Attributes::SYMBOL]=QString(); attributes[Attributes::LeakProof]=QString(); @@ -156,7 +156,7 @@ void Function::setTableReturnTypeAttribute(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) str_type.remove(str_type.size()-2,2); - attributes[Attributes::RETURN_TABLE]=str_type; + attributes[Attributes::ReturnTable]=str_type; } void Function::setExecutionCost(unsigned exec_cost) @@ -466,18 +466,18 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) if(def_type==SchemaParser::SqlDefinition) { attributes[Attributes::Language]=language->getName(false); - attributes[Attributes::RETURN_TYPE]=(*return_type); + attributes[Attributes::ReturnType]=(*return_type); } else { attributes[Attributes::Language]=language->getCodeDefinition(def_type,true); - attributes[Attributes::RETURN_TYPE]=return_type.getCodeDefinition(def_type); + attributes[Attributes::ReturnType]=return_type.getCodeDefinition(def_type); } } setTableReturnTypeAttribute(def_type); - attributes[Attributes::RETURNS_SETOF]=(returns_setof ? Attributes::True : QString()); + attributes[Attributes::ReturnsSetOf]=(returns_setof ? Attributes::True : QString()); attributes[Attributes::WINDOW_FUNC]=(is_wnd_function ? Attributes::True : QString()); attributes[Attributes::LeakProof]=(is_leakproof ? Attributes::True : QString()); attributes[Attributes::SECURITY_TYPE]=(~security_type); @@ -521,7 +521,7 @@ QString Function::getAlterDefinition(BaseObject *object) if(this->returns_setof && func->returns_setof && this->row_amount!=func->row_amount) { - attribs[Attributes::RETURNS_SETOF]=Attributes::True; + attribs[Attributes::ReturnsSetOf]=Attributes::True; attribs[Attributes::ROW_AMOUNT]=QString::number(row_amount); } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index ac4891e9bc..49c7d22302 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -31,7 +31,7 @@ Index::Index(void) attributes[Attributes::Columns]=QString(); attributes[Attributes::Expression]=QString(); attributes[Attributes::Factor]=QString(); - attributes[Attributes::PREDICATE]=QString(); + attributes[Attributes::Predicate]=QString(); attributes[Attributes::OpClass]=QString(); attributes[Attributes::NullsFirst]=QString(); attributes[Attributes::AscOrder]=QString(); @@ -334,7 +334,7 @@ QString Index::getCodeDefinition(unsigned def_type) attributes[Attributes::UNIQUE]=(index_attribs[Unique] ? Attributes::True : QString()); attributes[Attributes::Concurrent]=(index_attribs[Concurrent] ? Attributes::True : QString()); attributes[Attributes::IndexType]=(~indexing_type); - attributes[Attributes::PREDICATE]=predicate; + attributes[Attributes::Predicate]=predicate; attributes[Attributes::STORAGE_PARAMS]=QString(); if(getParentTable()) diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 5e9e755ca5..d97ec1ab07 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -133,7 +133,7 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[attribs_func[i]]=functions[i]->getName(true); else { - functions[i]->setAttribute(Attributes::REF_TYPE, attribs_func[i]); + functions[i]->setAttribute(Attributes::RefType, attribs_func[i]); attributes[attribs_func[i]]=functions[i]->getCodeDefinition(def_type, true); } } diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 99a35d03bd..a8e05dc217 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -38,13 +38,13 @@ Operator::Operator(void) attributes[Attributes::RIGHT_TYPE]=QString(); attributes[Attributes::CommutatorOp]=QString(); attributes[Attributes::NegatorOp]=QString(); - attributes[Attributes::RESTRICTION_FUNC]=QString(); + attributes[Attributes::RestrictionFunc]=QString(); attributes[Attributes::JoinFunc]=QString(); attributes[Attributes::OperatorFunc]=QString(); attributes[Attributes::Hashes]=QString(); attributes[Attributes::Merges]=QString(); attributes[Attributes::SIGNATURE]=QString(); - attributes[Attributes::REF_TYPE]=QString(); + attributes[Attributes::RefType]=QString(); } bool Operator::isValidName(const QString &name) @@ -286,7 +286,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) func_attribs[]={Attributes::OperatorFunc, Attributes::JoinFunc, - Attributes::RESTRICTION_FUNC}; + Attributes::RestrictionFunc}; for(i=Operator::LEFT_ARG; i <= Operator::RIGHT_ARG; i++) { @@ -310,7 +310,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[op_attribs[i]]=operators[i]->getName(true); else { - operators[i]->attributes[Attributes::REF_TYPE]=op_attribs[i]; + operators[i]->attributes[Attributes::RefType]=op_attribs[i]; attributes[op_attribs[i]]=operators[i]->getCodeDefinition(def_type, true); } } @@ -324,7 +324,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[func_attribs[i]]=functions[i]->getName(true); else { - functions[i]->setAttribute(Attributes::REF_TYPE, func_attribs[i]); + functions[i]->setAttribute(Attributes::RefType, func_attribs[i]); attributes[func_attribs[i]]=functions[i]->getCodeDefinition(def_type, true); } } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index d374f5a7ac..93e7ccdf37 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -46,9 +46,9 @@ Permission::Permission(BaseObject *obj) attributes[Attributes::Parent]=QString(); attributes[Attributes::GrantOp]=QString(); attributes[Attributes::ROLES]=QString(); - attributes[Attributes::PRIVILEGES]=QString(); + attributes[Attributes::Privileges]=QString(); attributes[Attributes::Cascade]=QString(); - attributes[Attributes::PRIVILEGES_GOP]=QString(); + attributes[Attributes::PrivilegesGop]=QString(); } bool Permission::acceptsPermission(ObjectType obj_type, int privilege) @@ -413,7 +413,7 @@ QString Permission::getCodeDefinition(unsigned def_type) ObjectType obj_type; QString priv_vect[12]={ Attributes::SELECT_PRIV, Attributes::InsertPriv, Attributes::UPDATE_PRIV, Attributes::DeletePriv, - Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, + Attributes::TRUNCATE_PRIV, Attributes::ReferencesPriv, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, Attributes::ExecutPriv, Attributes::USAGE_PRIV }; @@ -464,8 +464,8 @@ QString Permission::getCodeDefinition(unsigned def_type) gop_priv_list.push_back(object->getObjectType() == ObjectType::Column ? QString("%1(%2)").arg(priv_vect[i].toUpper()).arg(object->getName(true)) : priv_vect[i].toUpper()); } - attributes[Attributes::PRIVILEGES] = priv_list.join(QChar(',')); - attributes[Attributes::PRIVILEGES_GOP] = gop_priv_list.join(QChar(',')); + attributes[Attributes::Privileges] = priv_list.join(QChar(',')); + attributes[Attributes::PrivilegesGop] = gop_priv_list.join(QChar(',')); } count=roles.size(); diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 89dcde79e9..e8b6346d7a 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1590,13 +1590,13 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs[Attributes::Length]=QString(); attribs[Attributes::Dimension]=QString(); - attribs[Attributes::PRECISION]=QString(); + attribs[Attributes::Precision]=QString(); attribs[Attributes::WITH_TIMEZONE]=QString(); attribs[Attributes::IntervalType]=QString(); attribs[Attributes::SPATIAL_TYPE]=QString(); attribs[Attributes::VARIATION]=QString(); attribs[Attributes::SRID]=QString(); - attribs[Attributes::REF_TYPE]=ref_type; + attribs[Attributes::RefType]=ref_type; attribs[Attributes::Name]=(~(*this)); attribs[Attributes::Length]=QString("%1").arg(this->length); @@ -1605,7 +1605,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs[Attributes::Dimension]=QString("%1").arg(this->dimension); if(precision >= 0) - attribs[Attributes::PRECISION]=QString("%1").arg(this->precision); + attribs[Attributes::Precision]=QString("%1").arg(this->precision); if(interval_type != BaseType::Null) attribs[Attributes::IntervalType]=(~interval_type); diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index a8cafd0ae1..9fce182b6b 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -226,12 +226,12 @@ QString Reference::getXMLDefinition(void) if(column) attribs[Attributes::Column]=column->getName(); - attribs[Attributes::REF_ALIAS]=ref_alias; + attribs[Attributes::RefAlias]=ref_alias; attribs[Attributes::Expression]=expression; attribs[Attributes::Alias]=alias; attribs[Attributes::ColumnAlias]=column_alias; - return(schparser.getCodeDefinition(Attributes::REFERENCE, attribs, SchemaParser::XmlDefinition)); + return(schparser.getCodeDefinition(Attributes::Reference, attribs, SchemaParser::XmlDefinition)); } bool Reference::operator == (Reference &refer) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 9ce0ff6323..ec3897df97 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2561,7 +2561,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) { unsigned count, i; - attributes[Attributes::RELATIONSHIP_1N]=Attributes::True; + attributes[Attributes::Relationship1n]=Attributes::True; attributes[Attributes::Constraints]=fk_rel1n->getCodeDefinition(def_type); if(uq_rel11) @@ -2581,7 +2581,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) { unsigned count, i; - attributes[Attributes::RELATIONSHIP_NN]=Attributes::True; + attributes[Attributes::RelationshipNn]=Attributes::True; attributes[Attributes::TABLE]=table_relnn->getCodeDefinition(def_type); count=table_relnn->getConstraintCount(); @@ -2594,7 +2594,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) } else if(rel_type==RelationshipGen) { - attributes[Attributes::RELATIONSHIP_GEN]=Attributes::True; + attributes[Attributes::RelationshipGen]=Attributes::True; attributes[Attributes::TABLE]=getReceiverTable()->getName(true); } @@ -2614,9 +2614,9 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::DelAction]=~del_action; attributes[Attributes::TABLE_NAME]=tab_name_relnn; - attributes[Attributes::RELATIONSHIP_GEN]=(rel_type==RelationshipGen ? Attributes::True : QString()); - attributes[Attributes::RELATIONSHIP_DEP]=(rel_type==RelationshipDep ? Attributes::True : QString()); - attributes[Attributes::RELATIONSHIP_PART]=(rel_type==RelationshipPart ? Attributes::True : QString()); + attributes[Attributes::RelationshipGen]=(rel_type==RelationshipGen ? Attributes::True : QString()); + attributes[Attributes::RelationshipDep]=(rel_type==RelationshipDep ? Attributes::True : QString()); + attributes[Attributes::RelationshipPart]=(rel_type==RelationshipPart ? Attributes::True : QString()); attributes[Attributes::SRC_COL_PATTERN]=name_patterns[SrcColPattern]; attributes[Attributes::DstColPattern]=name_patterns[DstColPattern]; diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index eb3a280f9f..335102b1d4 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -39,10 +39,10 @@ Role::Role(void) attributes[Attributes::Password]=QString(); attributes[Attributes::Encrypted]=QString(); attributes[Attributes::VALIDITY]=QString(); - attributes[Attributes::REF_ROLES]=QString(); + attributes[Attributes::RefRoles]=QString(); attributes[Attributes::MemberRoles]=QString(); attributes[Attributes::AdminRoles]=QString(); - attributes[Attributes::REPLICATION]=QString(); + attributes[Attributes::Replication]=QString(); attributes[Attributes::Group]=QString(); attributes[Attributes::BypassRls]=QString(); } @@ -175,7 +175,7 @@ void Role::setRoleAttribute(unsigned role_type) case RefRole: default: roles_vect=&ref_roles; - attrib=Attributes::REF_ROLES; + attrib=Attributes::RefRoles; break; } @@ -332,7 +332,7 @@ QString Role::getCodeDefinition(unsigned def_type) QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, Attributes::Login, Attributes::Encrypted, - Attributes::REPLICATION, Attributes::BypassRls }; + Attributes::Replication, Attributes::BypassRls }; setRoleAttribute(RefRole); setRoleAttribute(MemberRole); @@ -363,7 +363,7 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, Attributes::Login, Attributes::Encrypted, - Attributes::REPLICATION, Attributes::BypassRls }; + Attributes::Replication, Attributes::BypassRls }; attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object, ignore_name_diff); diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index c0e2b41040..bccce66b5f 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -24,7 +24,7 @@ Schema::Schema(void) fill_color=QColor(225,225,225, 80); rect_visible=false; attributes[Attributes::FillColor]=QString(); - attributes[Attributes::RECT_VISIBLE]=QString(); + attributes[Attributes::RectVisible]=QString(); } void Schema::setName(const QString &name) @@ -68,7 +68,7 @@ QString Schema::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); attributes[Attributes::FillColor]=fill_color.name(); - attributes[Attributes::RECT_VISIBLE]=(rect_visible ? Attributes::True : QString()); + attributes[Attributes::RectVisible]=(rect_visible ? Attributes::True : QString()); setFadedOutAttribute(); return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index b09ac55819..82fb28c34d 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -44,7 +44,7 @@ Trigger::Trigger(void) attributes[Attributes::UPD_EVENT]=QString(); attributes[Attributes::TRUNC_EVENT]=QString(); attributes[Attributes::Condition]=QString(); - attributes[Attributes::REF_TABLE]=QString(); + attributes[Attributes::RefTable]=QString(); attributes[Attributes::DeferType]=QString(); attributes[Attributes::Deferrable]=QString(); attributes[Attributes::DeclInTable]=QString(); @@ -417,7 +417,7 @@ QString Trigger::getCodeDefinition(unsigned def_type) attributes[Attributes::Condition]=condition; if(referenced_table) - attributes[Attributes::REF_TABLE]=referenced_table->getName(true); + attributes[Attributes::RefTable]=referenced_table->getName(true); attributes[Attributes::Deferrable]=(is_deferrable ? Attributes::True : QString()); attributes[Attributes::DeferType]=(~deferral_type); diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 291c56f32b..7ce789e021 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -25,13 +25,13 @@ Type::Type(void) attributes[Attributes::BaseType]=QString(); attributes[Attributes::CompositeType]=QString(); - attributes[Attributes::RANGE_TYPE]=QString(); + attributes[Attributes::RangeType]=QString(); attributes[Attributes::TYPE_ATTRIBUTE]=QString(); attributes[Attributes::EnumType]=QString(); attributes[Attributes::Enumerations]=QString(); attributes[Attributes::InputFunc]=QString(); attributes[Attributes::OutputFunc]=QString(); - attributes[Attributes::RECV_FUNC]=QString(); + attributes[Attributes::RecvFunc]=QString(); attributes[Attributes::SEND_FUNC]=QString(); attributes[Attributes::TPMOD_IN_FUNC]=QString(); attributes[Attributes::TPMOD_OUT_FUNC]=QString(); @@ -43,9 +43,9 @@ Type::Type(void) attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::Element]=QString(); attributes[Attributes::Delimiter]=QString(); - attributes[Attributes::REDUCED_FORM]=QString(); + attributes[Attributes::ReducedForm]=QString(); attributes[Attributes::Category]=QString(); - attributes[Attributes::PREFERRED]=QString(); + attributes[Attributes::Preferred]=QString(); attributes[Attributes::LikeType]=QString(); attributes[Attributes::Collatable]=QString(); attributes[Attributes::SUBTYPE]=QString(); @@ -627,7 +627,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) } else if(config==RangeType) { - attributes[Attributes::RANGE_TYPE]=Attributes::True; + attributes[Attributes::RangeType]=Attributes::True; if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::SUBTYPE]=(*subtype); @@ -664,7 +664,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::Category]=~(category); - attributes[Attributes::PREFERRED]=(preferred ? Attributes::True : QString()); + attributes[Attributes::Preferred]=(preferred ? Attributes::True : QString()); attributes[Attributes::Collatable]=(collatable ? Attributes::True : QString()); if(like_type!=QString("\"any\"")) @@ -681,7 +681,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) unsigned i; QString func_attrib[]={Attributes::InputFunc, Attributes::OutputFunc, - Attributes::RECV_FUNC, + Attributes::RecvFunc, Attributes::SEND_FUNC, Attributes::TPMOD_IN_FUNC, Attributes::TPMOD_OUT_FUNC, @@ -697,7 +697,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[func_attrib[i]]=functions[i]->getName(); else { - functions[i]->setAttribute(Attributes::REF_TYPE, func_attrib[i]); + functions[i]->setAttribute(Attributes::RefType, func_attrib[i]); attributes[func_attrib[i]]=functions[i]->getCodeDefinition(def_type, true); } } diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 8ad8f6348f..08d6ba5fd2 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -23,14 +23,14 @@ View::View(void) : BaseTable() obj_type=ObjectType::View; materialized=recursive=with_no_data=false; attributes[Attributes::Definition]=QString(); - attributes[Attributes::REFERENCES]=QString(); + attributes[Attributes::References]=QString(); attributes[Attributes::SELECT_EXP]=QString(); attributes[Attributes::FromExp]=QString(); attributes[Attributes::SIMPLE_EXP]=QString(); attributes[Attributes::EndExp]=QString(); attributes[Attributes::CteExpression]=QString(); attributes[Attributes::Materialized]=QString(); - attributes[Attributes::RECURSIVE]=QString(); + attributes[Attributes::Recursive]=QString(); attributes[Attributes::WITH_NO_DATA]=QString(); attributes[Attributes::Columns]=QString(); } @@ -490,7 +490,7 @@ void View::setReferencesAttribute(void) cnt=references.size(); for(i=0; i < cnt; i++) str_aux+=references[i].getXMLDefinition(); - attributes[Attributes::REFERENCES]=str_aux; + attributes[Attributes::References]=str_aux; for(i=0; i < 4; i++) { @@ -575,7 +575,7 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::CteExpression]=cte_expression; attributes[Attributes::Materialized]=(materialized ? Attributes::True : QString()); - attributes[Attributes::RECURSIVE]=(recursive ? Attributes::True : QString()); + attributes[Attributes::Recursive]=(recursive ? Attributes::True : QString()); attributes[Attributes::WITH_NO_DATA]=(with_no_data ? Attributes::True : QString()); attributes[Attributes::Columns]=QString(); attributes[Attributes::TAG]=QString(); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 6ca7c6917f..650503937b 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -28,8 +28,8 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::Global, //0 Attributes::Constraints, //1 Attributes::ObjSelection, //2 - Attributes::POSITION_INFO, //3 - Attributes::POSITION_INFO, //4 + Attributes::PositionInfo, //3 + Attributes::PositionInfo, //4 Attributes::ObjectType, //5 Attributes::LockerArc, //6 Attributes::LockerBody, //7 @@ -54,14 +54,14 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::VIEW_EXT_BODY, //24 Attributes::VIEW_TITLE, //25 Attributes::Alias, //26 - Attributes::REF_COLUMN, //27 - Attributes::REF_TABLE, //28 - Attributes::REFERENCE, //29 + Attributes::RefColumn, //27 + Attributes::RefTable, //28 + Attributes::Reference, //29 BaseObject::getSchemaName(ObjectType::Textbox), //30 Attributes::Column, //31 Attributes::Column, //32 Attributes::InhColumn, //33 - Attributes::PROT_COLUMN, //34 + Attributes::ProtColumn, //34 Attributes::PkColumn, //35 Attributes::PkColumn, //36 Attributes::FkColumn, //37 @@ -70,7 +70,7 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::UQ_COLUMN, //40 Attributes::NnColumn, //41 Attributes::NnColumn, //42 - Attributes::RELATIONSHIP, //43 + Attributes::Relationship, //43 Attributes::Label, //44 Attributes::Label, //45 Attributes::Attribute, //46 diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index b2f2e71fce..7a25b19a50 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -71,11 +71,11 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::OutputFunc, QT_TR_NOOP("Output func.")}, {Attributes::Owner, QT_TR_NOOP("Owner")}, {Attributes::OwnerColumn, QT_TR_NOOP("Owner column")}, {Attributes::Parents, QT_TR_NOOP("Parents")}, {Attributes::Password, QT_TR_NOOP("Password")}, {Attributes::Permission, QT_TR_NOOP("Permissions")}, - {Attributes::PRECISION, QT_TR_NOOP("Precision")}, {Attributes::PREFERRED, QT_TR_NOOP("Preferred")}, - {Attributes::RANGE_ATTRIBS, QT_TR_NOOP("Range attributes")}, {Attributes::RECV_FUNC, QT_TR_NOOP("Receive func.")}, - {Attributes::REF_ROLES, QT_TR_NOOP("Ref. roles")}, {Attributes::REPLICATION, QT_TR_NOOP("Replication")}, - {Attributes::RESTRICTION_FUNC, QT_TR_NOOP("Restriction func.")}, {Attributes::RETURN_TYPE, QT_TR_NOOP("Return type")}, - {Attributes::RETURNS_SETOF, QT_TR_NOOP("Returns SETOF")}, {Attributes::RIGHT_TYPE, QT_TR_NOOP("Right type")}, + {Attributes::Precision, QT_TR_NOOP("Precision")}, {Attributes::Preferred, QT_TR_NOOP("Preferred")}, + {Attributes::RangeAttribs, QT_TR_NOOP("Range attributes")}, {Attributes::RecvFunc, QT_TR_NOOP("Receive func.")}, + {Attributes::RefRoles, QT_TR_NOOP("Ref. roles")}, {Attributes::Replication, QT_TR_NOOP("Replication")}, + {Attributes::RestrictionFunc, QT_TR_NOOP("Restriction func.")}, {Attributes::ReturnType, QT_TR_NOOP("Return type")}, + {Attributes::ReturnsSetOf, QT_TR_NOOP("Returns SETOF")}, {Attributes::RIGHT_TYPE, QT_TR_NOOP("Right type")}, {Attributes::ROW_AMOUNT, QT_TR_NOOP("Rows amount")}, {Attributes::SCHEMA, QT_TR_NOOP("Schema")}, {Attributes::SECURITY_TYPE, QT_TR_NOOP("Security type")}, {Attributes::SEND_FUNC, QT_TR_NOOP("Send func.")}, {Attributes::SORT_OP, QT_TR_NOOP("Sort op.")}, {Attributes::SOURCE_TYPE, QT_TR_NOOP("Source type")}, @@ -101,14 +101,14 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::TRIGGER_FUNC, QT_TR_NOOP("Trigger func.")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::Condition, QT_TR_NOOP("Condition")}, {Attributes::DeferType, QT_TR_NOOP("Deferment")}, {Attributes::EventType, QT_TR_NOOP("Event")}, {Attributes::ExecType, QT_TR_NOOP("Execution mode")}, - {Attributes::Commands, QT_TR_NOOP("Commands")}, {Attributes::POSITION, QT_TR_NOOP("Position")}, + {Attributes::Commands, QT_TR_NOOP("Commands")}, {Attributes::Position, QT_TR_NOOP("Position")}, {Attributes::ComparisonType, QT_TR_NOOP("Comparison type")}, {Attributes::DelAction, QT_TR_NOOP("On delete")}, {Attributes::DstColumns, QT_TR_NOOP("Ref. columns")}, {Attributes::Expressions, QT_TR_NOOP("Expressions")}, {Attributes::Factor, QT_TR_NOOP("Fill factor")}, {Attributes::NoInherit, QT_TR_NOOP("No inherit")}, {Attributes::OpClasses, QT_TR_NOOP("Op. classes")}, {Attributes::Operators, QT_TR_NOOP("Operators")}, - {Attributes::REF_TABLE, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, + {Attributes::RefTable, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SRC_COLUMNS, QT_TR_NOOP("Columns")}, - {Attributes::UNIQUE, QT_TR_NOOP("Unique")}, {Attributes::PREDICATE, QT_TR_NOOP("Predicate")}, + {Attributes::UNIQUE, QT_TR_NOOP("Unique")}, {Attributes::Predicate, QT_TR_NOOP("Predicate")}, {Attributes::Collations, QT_TR_NOOP("Collations")}, {Attributes::Inherited, QT_TR_NOOP("Inherited")}, {Attributes::ClientEncoding, QT_TR_NOOP("Client encoding")}, {Attributes::ConfigFile, QT_TR_NOOP("Configuration file")}, {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DynamicLibraryPath, QT_TR_NOOP("Dynamic library path")}, @@ -120,7 +120,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::SSL_KEY_FILE, QT_TR_NOOP("SSL key file")}, {Attributes::SERVER_VERSION, QT_TR_NOOP("Server version")}, {Attributes::IdentFile, QT_TR_NOOP("Ident file")}, {Attributes::PasswordEncryption, QT_TR_NOOP("Password encryption")}, {Attributes::Connection, QT_TR_NOOP("Connection ID")}, {Attributes::SERVER_PID, QT_TR_NOOP("Server PID")}, - {Attributes::SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {Attributes::REFERRERS, QT_TR_NOOP("Referrers")}, + {Attributes::SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {Attributes::Referrers, QT_TR_NOOP("Referrers")}, {Attributes::IdentityType, QT_TR_NOOP("Identity")}, {Attributes::Command, QT_TR_NOOP("Command")}, {Attributes::USING_EXP, QT_TR_NOOP("USING expr.")}, {Attributes::CheckExp, QT_TR_NOOP("CHECK expr.")}, {Attributes::ROLES, QT_TR_NOOP("Roles")}, {Attributes::RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, @@ -478,12 +478,12 @@ void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { Attributes::AdminRoles, Attributes::MemberRoles, - Attributes::REF_ROLES }, ObjectType::Role, true); + Attributes::RefRoles }, ObjectType::Role, true); formatBooleanAttribs(attribs, { Attributes::SUPERUSER, Attributes::Inherit, Attributes::CreateRole, Attributes::CreateDb, Attributes::Login, Attributes::Encrypted, - Attributes::REPLICATION }); + Attributes::Replication }); } void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) @@ -506,7 +506,7 @@ void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) { attribs[Attributes::Language]=getObjectName(ObjectType::Language, attribs[Attributes::Language]); - attribs[Attributes::RETURN_TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::RETURN_TYPE]); + attribs[Attributes::ReturnType]=getObjectName(ObjectType::Type, attribs[Attributes::ReturnType]); attribs[Attributes::ArgNames]=Catalog::parseArrayValues(attribs[Attributes::ArgNames]).join(ElemSeparator); attribs[Attributes::ArgModes]=Catalog::parseArrayValues(attribs[Attributes::ArgModes]).join(ElemSeparator); attribs[Attributes::ArgDefaults]=Catalog::parseArrayValues(attribs[Attributes::ArgDefaults]).join(ElemSeparator); @@ -518,7 +518,7 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::WINDOW_FUNC, Attributes::LeakProof, - Attributes::RETURNS_SETOF }); + Attributes::ReturnsSetOf }); } void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) @@ -533,7 +533,7 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) Attributes::NegatorOp}, ObjectType::Operator, false); formatOidAttribs(attribs, { Attributes::OperatorFunc, - Attributes::RESTRICTION_FUNC, + Attributes::RestrictionFunc, Attributes::JoinFunc }, ObjectType::Function, false); attribs[Attributes::SIGNATURE]=(QString("%1(%2,%3)") @@ -621,16 +621,16 @@ void DatabaseExplorerWidget::formatViewAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) { - QStringList range_attr=Catalog::parseArrayValues(attribs[Attributes::RANGE_ATTRIBS]), + QStringList range_attr=Catalog::parseArrayValues(attribs[Attributes::RangeAttribs]), type_attr=Catalog::parseArrayValues(attribs[Attributes::TYPE_ATTRIBUTE]); formatBooleanAttribs(attribs, { Attributes::ByValue, Attributes::Collatable, - Attributes::PREFERRED }); + Attributes::Preferred }); formatOidAttribs(attribs, { Attributes::AnalyzeFunc, Attributes::InputFunc, Attributes::OutputFunc, - Attributes::RECV_FUNC, + Attributes::RecvFunc, Attributes::SEND_FUNC, Attributes::TPMOD_IN_FUNC, Attributes::TPMOD_OUT_FUNC }, ObjectType::Function, false); @@ -641,7 +641,7 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) else attribs[Attributes::Enumerations]=Catalog::parseArrayValues(attribs[Attributes::Enumerations]).join(ElemSeparator); - attribs.erase(Attributes::RANGE_ATTRIBS); + attribs.erase(Attributes::RangeAttribs); if(!range_attr.isEmpty()) { attribs[Attributes::SUBTYPE]=getObjectName(ObjectType::Type, range_attr[0]); @@ -733,7 +733,7 @@ void DatabaseExplorerWidget::formatColumnAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::NotNull, Attributes::Inherited }); - attribs[Attributes::POSITION]=attribs[Attributes::Oid]; + attribs[Attributes::Position]=attribs[Attributes::Oid]; attribs.erase(Attributes::Oid); attribs.erase(Attributes::TYPE_OID); } @@ -760,8 +760,8 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) if(constr_type==ConstraintType::ForeignKey) { - attribs[Attributes::REF_TABLE]=getObjectName(ObjectType::Table, attribs[Attributes::REF_TABLE]); - names=attribs[Attributes::REF_TABLE].split('.'); + attribs[Attributes::RefTable]=getObjectName(ObjectType::Table, attribs[Attributes::RefTable]); + names=attribs[Attributes::RefTable].split('.'); attribs[Attributes::DstColumns]=getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[Attributes::DstColumns]), names[0], names[1]).join(ElemSeparator); @@ -769,7 +769,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) else { attribs.erase(Attributes::DstColumns); - attribs.erase(Attributes::REF_TABLE); + attribs.erase(Attributes::RefTable); attribs.erase(Attributes::UPD_ACTION); attribs.erase(Attributes::DelAction); attribs.erase(Attributes::ComparisonType); @@ -1328,7 +1328,7 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(ObjectType::Table); attribs[Attributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); attribs[Attributes::Cascade]=(cascade ? Attributes::True : ""); - attribs[Attributes::RESTART_SEQ]=(msg_box.isCustomOptionChecked() ? Attributes::True : ""); + attribs[Attributes::RestartSeq]=(msg_box.isCustomOptionChecked() ? Attributes::True : ""); //Generate the truncate command schparser.ignoreEmptyAttributes(true); @@ -1503,7 +1503,7 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) } if(!tab_list.isEmpty()) - orig_attribs[Attributes::REFERRERS] = tab_list.join(Table::DataSeparator); + orig_attribs[Attributes::Referrers] = tab_list.join(Table::DataSeparator); } } else @@ -1631,10 +1631,10 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) fk_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); fk_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referenced"))); fk_item->setText(0, QString("%1(%2)") - .arg(cached_attribs[Attributes::REF_TABLE]) + .arg(cached_attribs[Attributes::RefTable]) .arg(cached_attribs[Attributes::DstColumns])); fk_item->setToolTip(0, trUtf8("Ref. table: %1\nRef. column(s): %2") - .arg(cached_attribs[Attributes::REF_TABLE]) + .arg(cached_attribs[Attributes::RefTable]) .arg(cached_attribs[Attributes::DstColumns])); fk_item->setFlags(Qt::ItemIsEnabled); } @@ -1654,10 +1654,10 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } } else if(cached_attribs[Attributes::ObjectType] == BaseObject::getSchemaName(ObjectType::Table) && - !cached_attribs[Attributes::REFERRERS].isEmpty() && item->childCount() == 5) + !cached_attribs[Attributes::Referrers].isEmpty() && item->childCount() == 5) { QTreeWidgetItem *refs_item=nullptr, *tab_item=nullptr; - QStringList ref_tab_names = cached_attribs[Attributes::REFERRERS].split(Table::DataSeparator); + QStringList ref_tab_names = cached_attribs[Attributes::Referrers].split(Table::DataSeparator); QFont font; refs_item=new QTreeWidgetItem(item); @@ -1668,7 +1668,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) refs_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); refs_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("referrer"))); refs_item->setText(0, QString("%1 (%2)") - .arg(attribs_i18n.at(Attributes::REFERRERS)) + .arg(attribs_i18n.at(Attributes::Referrers)) .arg(ref_tab_names.length())); for(QString tab_name : ref_tab_names) @@ -1734,7 +1734,7 @@ void DatabaseExplorerWidget::finishObjectRename(void) schparser.ignoreUnkownAttributes(true); rename_cmd=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + - Attributes::RENAME + GlobalAttributes::SchemaExt, + Attributes::Rename + GlobalAttributes::SchemaExt, attribs); //Executes the rename cmd diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 8eb06f37f2..94b97f7483 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -841,7 +841,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe name==~LanguageType(LanguageType::PlPgsql)))) { item->setFont(0, grp_fnt); - item->setForeground(0, BaseObjectView::getFontStyle(Attributes::PROT_COLUMN).foreground()); + item->setForeground(0, BaseObjectView::getFontStyle(Attributes::ProtColumn).foreground()); item->setToolTip(0, trUtf8("This is a pgModeler's built-in object. It will be ignored if checked by user.")); } } diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index a5705aba46..46d6431e10 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -832,7 +832,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType if(generate_xml) { - obj_attr[Attributes::REDUCED_FORM]=Attributes::True; + obj_attr[Attributes::ReducedForm]=Attributes::True; schparser.ignoreUnkownAttributes(true); xml_def=schparser.getCodeDefinition(BaseObject::getSchemaName(obj_type), obj_attr, SchemaParser::XmlDefinition); schparser.ignoreUnkownAttributes(false); @@ -945,7 +945,7 @@ void DatabaseImportHelper::createSchema(attribs_map &attribs) try { - attribs[Attributes::RECT_VISIBLE]=QString(); + attribs[Attributes::RectVisible]=QString(); attribs[Attributes::FillColor]=QColor(dist(rand_num_engine), dist(rand_num_engine), dist(rand_num_engine)).name(); @@ -968,7 +968,7 @@ void DatabaseImportHelper::createRole(attribs_map &attribs) try { - QString role_types[]={ Attributes::REF_ROLES, + QString role_types[]={ Attributes::RefRoles, Attributes::AdminRoles, Attributes::MemberRoles }; @@ -1069,9 +1069,9 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) /* If the function is to be used as a user-defined data type support functions the parameter type will be renamed to "any" (see rules on Type::setFunction()) */ if(i==0 && - (attribs[Attributes::REF_TYPE]==Attributes::SEND_FUNC || - attribs[Attributes::REF_TYPE]==Attributes::OutputFunc || - attribs[Attributes::REF_TYPE]==Attributes::CanonicalFunc)) + (attribs[Attributes::RefType]==Attributes::SEND_FUNC || + attribs[Attributes::RefType]==Attributes::OutputFunc || + attribs[Attributes::RefType]==Attributes::CanonicalFunc)) type=PgSqlType(QString("\"any\"")); else { @@ -1110,7 +1110,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) //If the mode is 't' indicates that the current parameter will be used as a return table colum if(!param_modes.isEmpty() && param_modes[i]==QString("t")) - attribs[Attributes::RETURN_TABLE]+=param.getCodeDefinition(SchemaParser::XmlDefinition); + attribs[Attributes::ReturnTable]+=param.getCodeDefinition(SchemaParser::XmlDefinition); else parameters.push_back(param); } @@ -1151,16 +1151,16 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) attribs[Attributes::Language]=getDependencyObject(attribs[Attributes::Language], ObjectType::Language); //Get the return type if there is no return table configured - if(attribs[Attributes::RETURN_TABLE].isEmpty()) + if(attribs[Attributes::ReturnTable].isEmpty()) { /* If the function is to be used as a user-defined data type support functions the return type will be renamed to "any" (see rules on Type::setFunction()) */ - if(attribs[Attributes::REF_TYPE]==Attributes::InputFunc || - attribs[Attributes::REF_TYPE]==Attributes::RECV_FUNC || - attribs[Attributes::REF_TYPE]==Attributes::CanonicalFunc) - attribs[Attributes::RETURN_TYPE]=PgSqlType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); + if(attribs[Attributes::RefType]==Attributes::InputFunc || + attribs[Attributes::RefType]==Attributes::RecvFunc || + attribs[Attributes::RefType]==Attributes::CanonicalFunc) + attribs[Attributes::ReturnType]=PgSqlType(QString("\"any\"")).getCodeDefinition(SchemaParser::XmlDefinition); else - attribs[Attributes::RETURN_TYPE]=getType(attribs[Attributes::RETURN_TYPE], true); + attribs[Attributes::ReturnType]=getType(attribs[Attributes::ReturnType], true); } loadObjectXML(ObjectType::Function, attribs); @@ -1195,7 +1195,7 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) function is defined after the language pgModeler will raise errors so in order to continue the import these fuctions are simply ignored */ if(func_oid < lang_oid) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true , true, true, {{Attributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true , true, true, {{Attributes::RefType, func_types[i]}}); else attribs[func_types[i]]=QString(); } @@ -1323,7 +1323,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) QString op_signature, func_types[]={ Attributes::OperatorFunc, - Attributes::RESTRICTION_FUNC, + Attributes::RestrictionFunc, Attributes::JoinFunc }, arg_types[]= { Attributes::LeftType, @@ -1333,15 +1333,15 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) Attributes::NegatorOp }; for(unsigned i=0; i < 3; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{Attributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{Attributes::RefType, func_types[i]}}); for(unsigned i=0; i < 2; i++) - attribs[arg_types[i]]=getType(attribs[arg_types[i]], true, {{Attributes::REF_TYPE, arg_types[i]}}); + attribs[arg_types[i]]=getType(attribs[arg_types[i]], true, {{Attributes::RefType, arg_types[i]}}); regexp.setPattern(Attributes::SIGNATURE + QString("(=)(\")")); for(unsigned i=0; i < 2; i++) { - attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjectType::Operator, true, false, true, {{Attributes::REF_TYPE, op_types[i]}}); + attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjectType::Operator, true, false, true, {{Attributes::RefType, op_types[i]}}); if(!attribs[op_types[i]].isEmpty()) { @@ -1461,8 +1461,8 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) /* Get the table and the owner column instances so the sequence code can be disabled if the column is an identity one */ tab_name = getDependencyObject(owner_col[0], ObjectType::Table, true, auto_resolve_deps, false, - {{ Attributes::POSITION, - schparser.getCodeDefinition(Attributes::POSITION, pos_attrib, SchemaParser::XmlDefinition)}}); + {{ Attributes::Position, + schparser.getCodeDefinition(Attributes::Position, pos_attrib, SchemaParser::XmlDefinition)}}); col_name=getColumnName(owner_col[0], owner_col[1]); tab = dbmodel->getTable(tab_name); @@ -1506,7 +1506,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) sch_name; for(unsigned i=0; i < 2; i++) - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, auto_resolve_deps, true, {{Attributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, auto_resolve_deps, true, {{Attributes::RefType, func_types[i]}}); types=getTypes(attribs[Attributes::TYPES], true); attribs[Attributes::TYPES]=QString(); @@ -1518,7 +1518,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) } attribs[Attributes::STATE_TYPE]=getType(attribs[Attributes::STATE_TYPE], true, - {{Attributes::REF_TYPE, Attributes::STATE_TYPE}}); + {{Attributes::RefType, Attributes::STATE_TYPE}}); attribs[Attributes::SORT_OP]=getDependencyObject(attribs[Attributes::SORT_OP], ObjectType::Operator, true); loadObjectXML(ObjectType::Aggregate, attribs); @@ -1575,9 +1575,9 @@ void DatabaseImportHelper::createType(attribs_map &attribs) } } } - else if(!attribs[Attributes::RANGE_TYPE].isEmpty()) + else if(!attribs[Attributes::RangeType].isEmpty()) { - QStringList range_attr=Catalog::parseArrayValues(attribs[Attributes::RANGE_ATTRIBS]); + QStringList range_attr=Catalog::parseArrayValues(attribs[Attributes::RangeAttribs]); attribs[Attributes::SUBTYPE]=getType(range_attr[0], true); attribs[Attributes::Collation]=getDependencyObject(range_attr[1], ObjectType::Collation, true); @@ -1590,7 +1590,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) QString type_name=getObjectName(attribs[Attributes::Oid]), func_types[]={ Attributes::InputFunc, Attributes::OutputFunc, - Attributes::RECV_FUNC, + Attributes::RecvFunc, Attributes::SEND_FUNC, Attributes::TPMOD_IN_FUNC, Attributes::TPMOD_OUT_FUNC, @@ -1605,7 +1605,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { for(i=0; i < count; i++) { - attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{Attributes::REF_TYPE, func_types[i]}}); + attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, true, true, {{Attributes::RefType, func_types[i]}}); /* Since pgModeler requires that type functions refers to the constructing type as "any" it's necessary to replace the function parameter types names */ @@ -1643,7 +1643,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) { Attributes::Y_POS, QString("0") }}; attribs[Attributes::Columns]=QString(); - attribs[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); + attribs[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, pos_attrib, SchemaParser::XmlDefinition); //Retrieving columns if they were not retrieved yet if(columns[attribs[Attributes::Oid].toUInt()].empty() && auto_resolve_deps) @@ -1877,11 +1877,11 @@ void DatabaseImportHelper::createView(attribs_map &attribs) attribs_map pos_attrib={{ Attributes::X_POS, QString("0") }, { Attributes::Y_POS, QString("0") }}; - attribs[Attributes::POSITION]=schparser.getCodeDefinition(Attributes::POSITION, pos_attrib, SchemaParser::XmlDefinition); + attribs[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, pos_attrib, SchemaParser::XmlDefinition); ref=Reference(attribs[Attributes::Definition], QString()); ref.setDefinitionExpression(true); - attribs[Attributes::REFERENCES]=ref.getXMLDefinition(); + attribs[Attributes::References]=ref.getXMLDefinition(); loadObjectXML(ObjectType::View, attribs); view=dbmodel->createView(); @@ -2090,7 +2090,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) try { QString table_oid=attribs[Attributes::TABLE], - ref_tab_oid=attribs[Attributes::REF_TABLE], + ref_tab_oid=attribs[Attributes::RefTable], tab_name; Table *table=nullptr; @@ -2175,7 +2175,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) attribs[Attributes::SRC_COLUMNS]=getColumnNames(attribs[Attributes::TABLE], attribs[Attributes::SRC_COLUMNS]).join(','); } - attribs[Attributes::REF_TABLE]=getDependencyObject(ref_tab_oid, ObjectType::Table, false, true, false); + attribs[Attributes::RefTable]=getDependencyObject(ref_tab_oid, ObjectType::Table, false, true, false); attribs[Attributes::DstColumns]=getColumnNames(ref_tab_oid, attribs[Attributes::DstColumns]).join(','); attribs[Attributes::TABLE]=tab_name; diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 13aad26b3b..4dd882b08a 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -819,7 +819,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &fk : fks) { - aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::REF_TABLE].toUInt()); + aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::RefTable].toUInt()); aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::SCHEMA].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[Attributes::Name]) @@ -827,7 +827,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin .arg(fk[Attributes::Name]); //Store the referenced schema and table names - fk_infos[fk_name][Attributes::REF_TABLE] = aux_table[Attributes::Name]; + fk_infos[fk_name][Attributes::RefTable] = aux_table[Attributes::Name]; fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::Name]; action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), QString("%1.%2 (%3)").arg(aux_schema[Attributes::Name]) @@ -1156,7 +1156,7 @@ void DataManipulationForm::browseTable(const QString &fk_name, bool browse_ref_t src_cols = fk_infos[fk_name][Attributes::SRC_COLUMNS].split(Table::DataSeparator); ref_cols = fk_infos[fk_name][Attributes::DstColumns].split(Table::DataSeparator); schema = fk_infos[fk_name][Attributes::SCHEMA]; - table = fk_infos[fk_name][Attributes::REF_TABLE]; + table = fk_infos[fk_name][Attributes::RefTable]; } for(QString col_name : src_cols) diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index f92b9a691b..078fb49056 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -100,9 +100,9 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::PaperMargin]=QString(); config_params[Attributes::Configuration][Attributes::PaperCustomSize]=QString(); config_params[Attributes::Configuration][Attributes::File]=QString(); - config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); - config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]=QString(); - config_params[Attributes::Configuration][Attributes::PRINT_GRID]=QString(); + config_params[Attributes::Configuration][Attributes::RecentModels]=QString(); + config_params[Attributes::Configuration][Attributes::PrintPgNum]=QString(); + config_params[Attributes::Configuration][Attributes::PrintGrid]=QString(); config_params[Attributes::Configuration][Attributes::HideRelName]=QString(); config_params[Attributes::Configuration][Attributes::HideExtAttribs]=QString(); config_params[Attributes::Configuration][Attributes::HideTableTags]=QString(); @@ -297,11 +297,11 @@ void GeneralConfigWidget::loadConfiguration(void) use_placeholders_chk->setChecked(config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]==Attributes::True); use_curved_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]==Attributes::True); - print_grid_chk->setChecked(config_params[Attributes::Configuration][Attributes::PRINT_GRID]==Attributes::True); - print_pg_num_chk->setChecked(config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]==Attributes::True); + print_grid_chk->setChecked(config_params[Attributes::Configuration][Attributes::PrintGrid]==Attributes::True); + print_pg_num_chk->setChecked(config_params[Attributes::Configuration][Attributes::PrintPgNum]==Attributes::True); paper_cmb->setCurrentIndex((config_params[Attributes::Configuration][Attributes::PaperType]).toUInt()); - portrait_rb->setChecked(config_params[Attributes::Configuration][Attributes::PaperOrientation]==Attributes::PORTRAIT); + portrait_rb->setChecked(config_params[Attributes::Configuration][Attributes::PaperOrientation]==Attributes::Portrait); landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PaperOrientation]==Attributes::Landscape); min_obj_opacity_spb->setValue(config_params[Attributes::Configuration][Attributes::MinObjectOpacity].toUInt()); @@ -470,7 +470,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::OpListSize]=QString::number(oplist_size_spb->value()); config_params[Attributes::Configuration][Attributes::AutoSaveInterval]=QString::number(autosave_interv_chk->isChecked() ? autosave_interv_spb->value() : 0); config_params[Attributes::Configuration][Attributes::PaperType]=QString::number(paper_cmb->currentIndex()); - config_params[Attributes::Configuration][Attributes::PaperOrientation]=(portrait_rb->isChecked() ? Attributes::PORTRAIT : Attributes::Landscape); + config_params[Attributes::Configuration][Attributes::PaperOrientation]=(portrait_rb->isChecked() ? Attributes::Portrait : Attributes::Landscape); config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=(corner_move_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::InvertRangeSelTrigger]=(invert_rangesel_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CheckUpdate]=(check_upd_chk->isChecked() ? Attributes::True : QString()); @@ -501,8 +501,8 @@ void GeneralConfigWidget::saveConfiguration(void) else config_params[Attributes::Configuration][Attributes::PaperCustomSize]=QString("%1,%2").arg(width_spb->value()).arg(height_spb->value()); - config_params[Attributes::Configuration][Attributes::PRINT_PG_NUM]=(print_pg_num_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::PRINT_GRID]=(print_grid_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::PrintPgNum]=(print_pg_num_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::PrintGrid]=(print_grid_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::HideExtAttribs]=(hide_ext_attribs_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::HideRelName]=(hide_rel_name_chk->isChecked() ? Attributes::True : QString()); @@ -524,14 +524,14 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY]=(save_restore_geometry_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::File]=QString(); - config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); + config_params[Attributes::Configuration][Attributes::RecentModels]=QString(); itr=config_params.begin(); itr_end=config_params.end(); config_params[Attributes::Configuration][Attributes::DockWidgets]=QString(); config_params[Attributes::Configuration][Attributes::WIDGETS_GEOMETRY]=QString(); - config_params[Attributes::Configuration][Attributes::RECENT_MODELS]=QString(); + config_params[Attributes::Configuration][Attributes::RecentModels]=QString(); config_params[Attributes::Configuration][Attributes::File]=QString(); while(itr!=itr_end) @@ -543,9 +543,9 @@ void GeneralConfigWidget::saveConfiguration(void) schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } //Checking if the current attribute is a file to be stored in a tag - else if((itr->first).contains(QRegExp(QString("(") + Attributes::RECENT + QString(")([0-9]+)")))) + else if((itr->first).contains(QRegExp(QString("(") + Attributes::Recent + QString(")([0-9]+)")))) { - config_params[Attributes::Configuration][Attributes::RECENT_MODELS]+= + config_params[Attributes::Configuration][Attributes::RecentModels]+= schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } else if(itr->first==Attributes::VALIDATOR || diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index ce167cb424..deb09e5699 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -103,7 +103,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par prev_session_files.push_back(attribs[Attributes::Path]); //Creating the recent models menu - else if(itr->first.contains(Attributes::RECENT) && + else if(itr->first.contains(Attributes::Recent) && !attribs[Attributes::Path].isEmpty()) recent_models.push_back(attribs[Attributes::Path]); } @@ -692,7 +692,7 @@ void MainWindow::closeEvent(QCloseEvent *event) while(!recent_models.isEmpty()) { - param_id=QString("%1%2").arg(Attributes::RECENT).arg(QString::number(i++).rightJustified(2, '0')); + param_id=QString("%1%2").arg(Attributes::Recent).arg(QString::number(i++).rightJustified(2, '0')); attribs[Attributes::Id]=param_id; attribs[Attributes::Path]=recent_models.front(); conf_wgt->addConfigurationParam(param_id, attribs); @@ -1841,7 +1841,7 @@ void MainWindow::storeDockWidgetsSettings(void) params[Attributes::ObjectFinder]=Attributes::True; params[Attributes::SELECT_OBJECTS]=(obj_finder_wgt->select_btn->isChecked() ? Attributes::True : QString()); params[Attributes::FadeInObjects]=(obj_finder_wgt->fade_btn->isChecked() ? Attributes::True : QString()); - params[Attributes::REGULAR_EXP]=(obj_finder_wgt->regexp_chk->isChecked() ? Attributes::True : QString()); + params[Attributes::RegularExp]=(obj_finder_wgt->regexp_chk->isChecked() ? Attributes::True : QString()); params[Attributes::CaseSensitive]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? Attributes::True : QString()); params[Attributes::ExactMatch]=(obj_finder_wgt->exact_match_chk->isChecked() ? Attributes::True : QString()); conf_wgt->addConfigurationParam(Attributes::ObjectFinder, params); @@ -1870,7 +1870,7 @@ void MainWindow::restoreDockWidgetsSettings(void) { obj_finder_wgt->select_btn->setChecked(confs[Attributes::ObjectFinder][Attributes::SELECT_OBJECTS]==Attributes::True); obj_finder_wgt->fade_btn->setChecked(confs[Attributes::ObjectFinder][Attributes::FadeInObjects]==Attributes::True); - obj_finder_wgt->regexp_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::REGULAR_EXP]==Attributes::True); + obj_finder_wgt->regexp_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::RegularExp]==Attributes::True); obj_finder_wgt->case_sensitive_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::CaseSensitive]==Attributes::True); obj_finder_wgt->exact_match_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::ExactMatch]==Attributes::True); } diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 7579324c00..29bbc72d6f 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -274,7 +274,7 @@ QTreeWidgetItem *ModelObjectsWidget::createItemForObject(BaseObject *object, QTr else if(object->isProtected() || object->isSystemObject()) { font.setItalic(true); - item->setForeground(0,BaseObjectView::getFontStyle(Attributes::PROT_COLUMN).foreground()); + item->setForeground(0,BaseObjectView::getFontStyle(Attributes::ProtColumn).foreground()); } item->setFont(0,font); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 3c46cb9556..dfa088934e 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -320,18 +320,18 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) if(!objs_differs) xml_differs=object->isCodeDiffersFrom(aux_object, { Attributes::MaxObjCount, - Attributes::PROTECTED, + Attributes::Protected, Attributes::SQL_DISABLED, - Attributes::RECT_VISIBLE, + Attributes::RectVisible, Attributes::FillColor, Attributes::FadedOut, Attributes::HideExtAttribs}, { Attributes::ROLE, Attributes::TABLESPACE, Attributes::Collation, - Attributes::POSITION, + Attributes::Position, Attributes::AppendedSql, - Attributes::PREPENDED_SQL }); + Attributes::PrependedSql }); //If a difference was detected between the objects if(objs_differs || xml_differs) diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index f92a9c5e0e..a33bbeaf8b 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -363,7 +363,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorisProtected() || objs[i]->isSystemObject()) { fnt.setItalic(true); - tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::PROT_COLUMN).foreground()); + tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::ProtColumn).foreground()); } else if(dynamic_cast(objs[i]) && dynamic_cast(objs[i])->isAddedByRelationship()) @@ -416,7 +416,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorisProtected() || parent_obj->isSystemObject()) { fnt.setItalic(true); - tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::PROT_COLUMN).foreground()); + tab_item->setForeground(BaseObjectView::getFontStyle(Attributes::ProtColumn).foreground()); } else { diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index aa326838b9..8e780e5bb0 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -26,7 +26,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob unsigned i; QString privs[]={ Attributes::SELECT_PRIV, Attributes::InsertPriv, Attributes::UPDATE_PRIV, Attributes::DeletePriv, - Attributes::TRUNCATE_PRIV, Attributes::REFERENCES_PRIV, + Attributes::TRUNCATE_PRIV, Attributes::ReferencesPriv, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, Attributes::ExecutPriv, Attributes::USAGE_PRIV }; diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 52d413f552..b53b586e96 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -22,9 +22,9 @@ map RelationshipConfigWidget::config_params; RelationshipConfigWidget::RelationshipConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { - QStringList list, rel_types={ Attributes::RELATIONSHIP_11, Attributes::RELATIONSHIP_1N, - Attributes::RELATIONSHIP_NN, Attributes::RELATIONSHIP_GEN, - Attributes::RELATIONSHIP_DEP, Attributes::RELATIONSHIP_PART }; + QStringList list, rel_types={ Attributes::Relationship11, Attributes::Relationship1n, + Attributes::RelationshipNn, Attributes::RelationshipGen, + Attributes::RelationshipDep, Attributes::RelationshipPart }; unsigned rel_types_id[]={ BaseRelationship::Relationship11, BaseRelationship::Relationship1n, BaseRelationship::RelationshipNn, BaseRelationship::RelationshipGen, BaseRelationship::RelationshipDep, BaseRelationship::RelationshipPart}; @@ -112,12 +112,12 @@ void RelationshipConfigWidget::loadConfiguration(void) idx=del_action_cmb->findText(config_params[Attributes::ForeignKeys][Attributes::DelAction]); del_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); - patterns[Attributes::RELATIONSHIP_11]=config_params[Attributes::RELATIONSHIP_11]; - patterns[Attributes::RELATIONSHIP_1N]=config_params[Attributes::RELATIONSHIP_1N]; - patterns[Attributes::RELATIONSHIP_NN]=config_params[Attributes::RELATIONSHIP_NN]; - patterns[Attributes::RELATIONSHIP_GEN]=config_params[Attributes::RELATIONSHIP_GEN]; - patterns[Attributes::RELATIONSHIP_DEP]=config_params[Attributes::RELATIONSHIP_DEP]; - patterns[Attributes::RELATIONSHIP_PART]=config_params[Attributes::RELATIONSHIP_PART]; + patterns[Attributes::Relationship11]=config_params[Attributes::Relationship11]; + patterns[Attributes::Relationship1n]=config_params[Attributes::Relationship1n]; + patterns[Attributes::RelationshipNn]=config_params[Attributes::RelationshipNn]; + patterns[Attributes::RelationshipGen]=config_params[Attributes::RelationshipGen]; + patterns[Attributes::RelationshipDep]=config_params[Attributes::RelationshipDep]; + patterns[Attributes::RelationshipPart]=config_params[Attributes::RelationshipPart]; fillNamePatterns(); this->applyConfiguration(); @@ -218,9 +218,9 @@ void RelationshipConfigWidget::fillNamePatterns(void) Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, Attributes::PkColPattern }; - relnn=(rel_type==Attributes::RELATIONSHIP_NN); - reldep=(rel_type==Attributes::RELATIONSHIP_DEP || rel_type==Attributes::RELATIONSHIP_PART); - relgen=(rel_type==Attributes::RELATIONSHIP_GEN); + relnn=(rel_type==Attributes::RelationshipNn); + reldep=(rel_type==Attributes::RelationshipDep || rel_type==Attributes::RelationshipPart); + relgen=(rel_type==Attributes::RelationshipGen); dst_col_pattern_txt->setEnabled(relnn); dst_fk_pattern_txt->setEnabled(relnn); diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 0a06261df5..bf44a0020f 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -524,7 +524,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) expr_type=attribs[Attributes::TYPE]; regexp.setPattern(attribs[Attributes::VALUE]); - if(attribs[Attributes::REGULAR_EXP]==Attributes::True) + if(attribs[Attributes::RegularExp]==Attributes::True) regexp.setPatternSyntax(QRegExp::RegExp2); else if(attribs[Attributes::WILDCARD]==Attributes::True) regexp.setPatternSyntax(QRegExp::Wildcard); diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 24443bf6ab..a4cec9c82b 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -766,7 +766,7 @@ void PgModelerCli::extractObjectXML(void) /* Checking if the line start a relationship. Relationships are treated a little different because they can be empty or contain open and close tags */ - is_rel=lin.contains(Attributes::RELATIONSHIP); + is_rel=lin.contains(Attributes::Relationship); if(is_rel) { @@ -879,7 +879,7 @@ void PgModelerCli::recreateObjects(void) //Discarding fk relationships if(obj_type!=ObjectType::Relationship || - (obj_type==ObjectType::Relationship && !xml_def.contains(QString("\"%1\"").arg(Attributes::RELATIONSHIP_FK)))) + (obj_type==ObjectType::Relationship && !xml_def.contains(QString("\"%1\"").arg(Attributes::RelationshipFk)))) { object=model->createObject(obj_type); @@ -1067,8 +1067,8 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Renaming the tag to on indexes if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Index)))) { - obj_xml.replace(TagExpr.arg(Attributes::Condition), TagExpr.arg(Attributes::PREDICATE)); - obj_xml.replace(EndTagExpr.arg(Attributes::Condition), EndTagExpr.arg(Attributes::PREDICATE)); + obj_xml.replace(TagExpr.arg(Attributes::Condition), TagExpr.arg(Attributes::Predicate)); + obj_xml.replace(EndTagExpr.arg(Attributes::Condition), EndTagExpr.arg(Attributes::Predicate)); } //Renaming the attribute default to default-value on domain @@ -1492,11 +1492,11 @@ QStringList PgModelerCli::extractForeignKeys(QString &obj_xml) bool PgModelerCli::containsRelAttributes(const QString &str) { bool found=false; - static vector attribs={ Attributes::RELATIONSHIP, + static vector attribs={ Attributes::Relationship, Attributes::TYPE, Attributes::SRC_REQUIRED, Attributes::DstRequired, Attributes::SRC_TABLE, Attributes::DstTable, Attributes::Points, Attributes::Columns, Attributes::Column, Attributes::Constraint, - Attributes::Label, Attributes::Line, Attributes::POSITION, + Attributes::Label, Attributes::Line, Attributes::Position, Attributes::Identifier, Attributes::Deferrable, Attributes::DeferType, Attributes::TABLE_NAME, Attributes::SPECIAL_PK_COLS, Attributes::TABLE, Attributes::AncestorTable, Attributes::CopyOptions, Attributes::CopyMode, From 5e60a332c305280c16b7f44e720fd0d216a9e800 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 11:05:22 -0300 Subject: [PATCH 186/425] Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 2 +- libparsers/src/attributes.cpp | 100 +++++------ libparsers/src/attributes.h | 100 +++++------ libpgconnector/src/catalog.cpp | 14 +- libpgmodeler/src/aggregate.cpp | 6 +- libpgmodeler/src/baseobject.cpp | 24 +-- libpgmodeler/src/baserelationship.cpp | 6 +- libpgmodeler/src/cast.cpp | 10 +- libpgmodeler/src/column.cpp | 4 +- libpgmodeler/src/databasemodel.cpp | 162 +++++++++--------- libpgmodeler/src/domain.cpp | 4 +- libpgmodeler/src/function.cpp | 16 +- libpgmodeler/src/index.cpp | 2 +- libpgmodeler/src/operator.cpp | 8 +- libpgmodeler/src/operatorclass.cpp | 2 +- libpgmodeler/src/operatorclasselement.cpp | 6 +- libpgmodeler/src/operatorfamily.cpp | 2 +- libpgmodeler/src/permission.cpp | 10 +- libpgmodeler/src/pgsqltypes.cpp | 4 +- libpgmodeler/src/policy.cpp | 8 +- libpgmodeler/src/relationship.cpp | 10 +- libpgmodeler/src/table.cpp | 16 +- libpgmodeler/src/type.cpp | 4 +- libpgmodeler/src/view.cpp | 10 +- .../src/databaseexplorerwidget.cpp | 112 ++++++------ libpgmodeler_ui/src/databaseimporthelper.cpp | 34 ++-- libpgmodeler_ui/src/datamanipulationform.cpp | 12 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 46 ++--- libpgmodeler_ui/src/mainwindow.cpp | 34 ++-- libpgmodeler_ui/src/modelsdiffhelper.cpp | 8 +- libpgmodeler_ui/src/permissionwidget.cpp | 2 +- .../src/relationshipconfigwidget.cpp | 4 +- libpgmodeler_ui/src/relationshipwidget.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 4 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 4 +- 36 files changed, 397 insertions(+), 397 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 502014c3d1..9360941f7a 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -235,7 +235,7 @@ void BaseObjectView::loadObjectsStyle(void) if(elem==Attributes::Global) { font.setFamily(attribs[Attributes::Font]); - font.setPointSizeF(attribs[Attributes::SIZE].toDouble()); + font.setPointSizeF(attribs[Attributes::Size].toDouble()); font.setBold(attribs[Attributes::Bold]==Attributes::True); font.setItalic(attribs[Attributes::Italic]==Attributes::True); font.setUnderline(attribs[Attributes::UNDERLINE]==Attributes::True); diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 5ca3309d13..37dd06f8ff 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -436,59 +436,59 @@ namespace Attributes { ReturnTable=QString("return-table"), ReturnType=QString("return-type"), ReturnsSetOf=QString("returns-setof"), - REVOKE=QString("revoke"), - RIGHT_TYPE=QString("right-type"), - RIGHT=QString("right"), - RLS_ENABLED=QString("rls-enabled"), - RLS_FORCED=QString("rls-forced"), - ROLE_TYPE=QString("role-type"), - ROLE=QString("role"), + Revoke=QString("revoke"), + RightType=QString("right-type"), + Right=QString("right"), + RlsEnabled=QString("rls-enabled"), + RlsForced=QString("rls-forced"), + RoleType=QString("role-type"), + Role=QString("role"), ROLE_CURRENT_USER=QString("CURRENT_USER"), ROLE_SESSION_USER=QString("SESSION_USER"), ROLE_PUBLIC=QString("PUBLIC"), - ROLES=QString("roles"), - ROW_AMOUNT=QString("row-amount"), - RULES=QString("rules"), - SAVE_LAST_POSITION=QString("save-last-position"), - SAVE_RESTORE_GEOMETRY=QString("save-restore-geometry"), - SCHEMA=QString("schema"), - SEARCH_PATH=QString("search-path"), - SECURITY_TYPE=QString("security-type"), - SELECT_EXP=QString("select-exp"), - SELECT_PRIV=QString("select"), - SELECT_OBJECTS=QString("select-objects"), - SEND_FUNC=QString("send"), - SEQUENCE=QString("sequence"), - SERVER_ENCODING=QString("server-encoding"), - SERVER_VERSION=QString("server-version"), - SERVER_PID=QString("server-pid"), - SERVER_PROTOCOL=QString("server-protocol"), - SET_PERMS=QString("set-perms"), - SHARED_OBJ=QString("shared-obj"), - SHELL_TYPES=QString("shell-types"), - SHOW_CANVAS_GRID=QString("show-canvas-grid"), - SHOW_PAGE_DELIMITERS=QString("show-page-delimiters"), - SHOW_ATTRIBUTES_GRID=QString("show-attributes-grid"), - SHOW_SOURCE_PANE=QString("show-source-pane"), - SHOW_MAIN_MENU=QString("show-main-menu"), - SIGNATURE=QString("signature"), - SIMPLE_EXP=QString("simple-exp"), - SIMPLIFIED_OBJ_CREATION=QString("simplified-obj-creation"), - SINGLE_PK_COLUMN=QString("single-pk-col"), - SIZE=QString("size"), - SNIPPET=QString("snippet"), - SORT_OP=QString("sort-op"), - SOURCE_EDITOR_APP=QString("source-editor-app"), - SOURCE_EDITOR_ARGS=QString("source-editor-args"), - SOURCE_TYPE=QString("source-type"), - SRC_TYPE=QString("src-type"), - SPATIAL_TYPE=QString("spatial-type"), - SPECIAL_PK_COLS=QString("special-pk-cols"), - SQL_DISABLED=QString("sql-disabled"), - SQL_OBJECT=QString("sql-object"), - SQL_VALIDATION=QString("sql-validation"), - SQL_TOOL=QString("sqltool"), - SRC_COL_PATTERN=QString("src-col-pattern"), + Roles=QString("roles"), + RowAmount=QString("row-amount"), + Rules=QString("rules"), + SaveLastPosition=QString("save-last-position"), + SaveRestoreGeometry=QString("save-restore-geometry"), + Schema=QString("schema"), + SearchPath=QString("search-path"), + SecurityType=QString("security-type"), + SelectExp=QString("select-exp"), + SelectPriv=QString("select"), + SelectObjects=QString("select-objects"), + SendFunc=QString("send"), + Sequence=QString("sequence"), + ServerEncoding=QString("server-encoding"), + ServerVersion=QString("server-version"), + ServerPid=QString("server-pid"), + ServerProtocol=QString("server-protocol"), + SetPerms=QString("set-perms"), + SharedObj=QString("shared-obj"), + ShellTypes=QString("shell-types"), + ShowCanvasGrid=QString("show-canvas-grid"), + ShowPageDelimiters=QString("show-page-delimiters"), + ShowAttributesGrid=QString("show-attributes-grid"), + ShowSourcePane=QString("show-source-pane"), + ShowMainMenu=QString("show-main-menu"), + Signature=QString("signature"), + SimpleExp=QString("simple-exp"), + SimplifiedObjCreation=QString("simplified-obj-creation"), + SinglePkColumn=QString("single-pk-col"), + Size=QString("size"), + Snippet=QString("snippet"), + SortOp=QString("sort-op"), + SourceEditorApp=QString("source-editor-app"), + SourceEditorArgs=QString("source-editor-args"), + SourceType=QString("source-type"), + SrcType=QString("src-type"), + SpatialType=QString("spatial-type"), + SpecialPkCols=QString("special-pk-cols"), + SqlDisabled=QString("sql-disabled"), + SqlObject=QString("sql-object"), + SqlValidation=QString("sql-validation"), + SqlTool=QString("sqltool"), + SrcColPattern=QString("src-col-pattern"), SRC_COLUMNS=QString("src-columns"), SRC_ENCODING=QString("src-encoding"), SRC_FK_PATTERN=QString("src-fk-pattern"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 9da93b948e..ed86270116 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -448,56 +448,56 @@ namespace Attributes { ReturnTable, ReturnType, ReturnsSetOf, - REVOKE, - RIGHT_TYPE, - RIGHT, - RLS_ENABLED, - RLS_FORCED, - ROLE_TYPE, - ROLE, - ROLES, - ROW_AMOUNT, - RULES, - SAVE_LAST_POSITION, - SAVE_RESTORE_GEOMETRY, - SCHEMA, - SEARCH_PATH, - SECURITY_TYPE, - SELECT_EXP, - SELECT_PRIV, - SELECT_OBJECTS, - SEND_FUNC, - SEQUENCE, - SERVER_ENCODING, - SERVER_VERSION, - SERVER_PID, - SERVER_PROTOCOL, - SET_PERMS, - SHARED_OBJ, - SHELL_TYPES, - SHOW_CANVAS_GRID, - SHOW_PAGE_DELIMITERS, - SHOW_ATTRIBUTES_GRID, - SHOW_SOURCE_PANE, - SHOW_MAIN_MENU, - SIGNATURE, - SIMPLE_EXP, - SIMPLIFIED_OBJ_CREATION, - SINGLE_PK_COLUMN, - SIZE, - SNIPPET, - SORT_OP, - SOURCE_EDITOR_APP, - SOURCE_EDITOR_ARGS, - SOURCE_TYPE, - SRC_TYPE, - SPATIAL_TYPE, - SPECIAL_PK_COLS, - SQL_DISABLED, - SQL_OBJECT, - SQL_VALIDATION, - SQL_TOOL, - SRC_COL_PATTERN, + Revoke, + RightType, + Right, + RlsEnabled, + RlsForced, + RoleType, + Role, + Roles, + RowAmount, + Rules, + SaveLastPosition, + SaveRestoreGeometry, + Schema, + SearchPath, + SecurityType, + SelectExp, + SelectPriv, + SelectObjects, + SendFunc, + Sequence, + ServerEncoding, + ServerVersion, + ServerPid, + ServerProtocol, + SetPerms, + SharedObj, + ShellTypes, + ShowCanvasGrid, + ShowPageDelimiters, + ShowAttributesGrid, + ShowSourcePane, + ShowMainMenu, + Signature, + SimpleExp, + SimplifiedObjCreation, + SinglePkColumn, + Size, + Snippet, + SortOp, + SourceEditorApp, + SourceEditorArgs, + SourceType, + SrcType, + SpatialType, + SpecialPkCols, + SqlDisabled, + SqlObject, + SqlValidation, + SqlTool, + SrcColPattern, SRC_COLUMNS, SRC_ENCODING, SRC_FK_PATTERN, diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 0c6fc2a2ee..0159945de7 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -265,7 +265,7 @@ unsigned Catalog::getObjectCount(ObjectType obj_type, const QString &sch_name, c { ResultSet res; - extra_attribs[Attributes::SCHEMA]=sch_name; + extra_attribs[Attributes::Schema]=sch_name; extra_attribs[Attributes::TABLE]=tab_name; executeCatalogQuery(QueryList, obj_type, res, false, extra_attribs); @@ -312,7 +312,7 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map Catalog::getObjectsNames(vector obj_types, const QStringList queries; attribs_map attribs; - extra_attribs[Attributes::SCHEMA]=sch_name; + extra_attribs[Attributes::Schema]=sch_name; extra_attribs[Attributes::TABLE]=tab_name; for(ObjectType obj_type : obj_types) @@ -515,7 +515,7 @@ QString Catalog::getCommentQuery(const QString &oid_field, bool is_shared_obj) try { attribs_map attribs={{Attributes::Oid, oid_field}, - {Attributes::SHARED_OBJ, (is_shared_obj ? Attributes::True : QString())}}; + {Attributes::SharedObj, (is_shared_obj ? Attributes::True : QString())}}; loadCatalogQuery(query_id); return(schparser.getCodeDefinition(attribs).simplified()); @@ -593,7 +593,7 @@ vector Catalog::getObjectsAttributes(ObjectType obj_type, const QSt bool is_shared_obj=(obj_type==ObjectType::Database || obj_type==ObjectType::Role || obj_type==ObjectType::Tablespace || obj_type==ObjectType::Language || obj_type==ObjectType::Cast); - extra_attribs[Attributes::SCHEMA]=schema; + extra_attribs[Attributes::Schema]=schema; extra_attribs[Attributes::TABLE]=table; if(!filter_oids.empty()) @@ -634,7 +634,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS ResultSet res; attribs[Attributes::CustomFilter] = QString("%1 = E'%2'").arg(name_fields[obj_type]).arg(name); - attribs[Attributes::SCHEMA] = schema; + attribs[Attributes::Schema] = schema; attribs[Attributes::TABLE] = table; executeCatalogQuery(QueryList, obj_type, res, false, attribs); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 12d8e08622..ecafadc53e 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -29,7 +29,7 @@ Aggregate::Aggregate(void) attributes[Attributes::BaseType]=QString(); attributes[Attributes::FinalFunc]=QString(); attributes[Attributes::InitialCond]=QString(); - attributes[Attributes::SORT_OP]=QString(); + attributes[Attributes::SortOp]=QString(); } void Aggregate::setFunction(unsigned func_idx, Function *func) @@ -253,9 +253,9 @@ QString Aggregate::getCodeDefinition(unsigned def_type) if(sort_operator) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::SORT_OP]=sort_operator->getName(true); + attributes[Attributes::SortOp]=sort_operator->getName(true); else - attributes[Attributes::SORT_OP]=sort_operator->getCodeDefinition(def_type,true); + attributes[Attributes::SortOp]=sort_operator->getCodeDefinition(def_type,true); } if(!initial_condition.isEmpty()) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 6478d1671f..e5cdcb8ac0 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -87,14 +87,14 @@ BaseObject::BaseObject(void) attributes[Attributes::Comment]=QString(); attributes[Attributes::Owner]=QString(); attributes[Attributes::TABLESPACE]=QString(); - attributes[Attributes::SCHEMA]=QString(); + attributes[Attributes::Schema]=QString(); attributes[Attributes::Collation]=QString(); attributes[Attributes::Protected]=QString(); - attributes[Attributes::SQL_DISABLED]=QString(); + attributes[Attributes::SqlDisabled]=QString(); attributes[Attributes::AppendedSql]=QString(); attributes[Attributes::PrependedSql]=QString(); attributes[Attributes::Drop]=QString(); - attributes[Attributes::SIGNATURE]=QString(); + attributes[Attributes::Signature]=QString(); this->setName(QApplication::translate("BaseObject","new_object","", -1)); } @@ -680,11 +680,11 @@ void BaseObject::setBasicAttributes(bool format_name) if(attributes[Attributes::Alias].isEmpty()) attributes[Attributes::Alias]=this->getAlias(); - if(attributes[Attributes::SIGNATURE].isEmpty()) - attributes[Attributes::SIGNATURE]=this->getSignature(format_name); + if(attributes[Attributes::Signature].isEmpty()) + attributes[Attributes::Signature]=this->getSignature(format_name); - if(attributes[Attributes::SQL_OBJECT].isEmpty()) - attributes[Attributes::SQL_OBJECT]=objs_sql[~this->obj_type]; + if(attributes[Attributes::SqlObject].isEmpty()) + attributes[Attributes::SqlObject]=objs_sql[~this->obj_type]; } QString BaseObject::__getCodeDefinition(unsigned def_type) @@ -706,7 +706,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) bool format=false; schparser.setPgSQLVersion(BaseObject::pgsql_ver); - attributes[Attributes::SQL_DISABLED]=(sql_disabled ? Attributes::True : QString()); + attributes[Attributes::SqlDisabled]=(sql_disabled ? Attributes::True : QString()); //Formats the object's name in case the SQL definition is being generated format=((def_type==SchemaParser::SqlDefinition) || @@ -718,9 +718,9 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(schema) { if(def_type==SchemaParser::XmlDefinition) - attributes[Attributes::SCHEMA]=schema->getCodeDefinition(def_type, true); + attributes[Attributes::Schema]=schema->getCodeDefinition(def_type, true); else - attributes[Attributes::SCHEMA]=schema->getName(format); + attributes[Attributes::Schema]=schema->getName(format); } if(def_type==SchemaParser::XmlDefinition) @@ -1193,7 +1193,7 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff try { - QStringList attribs={ Attributes::Owner, Attributes::SCHEMA, Attributes::TABLESPACE }; + QStringList attribs={ Attributes::Owner, Attributes::Schema, Attributes::TABLESPACE }; bool accepts_obj[3]={ acceptsOwner(), acceptsSchema(), acceptsTablespace() }; BaseObject *dep_objs[3]={ this->getOwner(), this->getSchema(), this->getTablespace() }, *aux_dep_objs[3]={ object->getOwner(), object->getSchema(), object->getTablespace() }; @@ -1203,7 +1203,7 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff attributes[Attributes::NewName]=object->getName(true, false); alter+=BaseObject::getAlterDefinition(Attributes::Rename, attributes, true); attributes[Attributes::Name]=attributes[Attributes::NewName]; - attributes[Attributes::SIGNATURE]=object->getSignature(true); + attributes[Attributes::Signature]=object->getSignature(true); } for(unsigned i=0; i < 3; i++) diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 1c4b53983c..a817689aa2 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -91,7 +91,7 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::Deferrable]=QString(); attributes[Attributes::DeferType]=QString(); attributes[Attributes::TABLE_NAME]=QString(); - attributes[Attributes::SPECIAL_PK_COLS]=QString(); + attributes[Attributes::SpecialPkCols]=QString(); attributes[Attributes::RelationshipNn]=QString(); attributes[Attributes::RelationshipGen]=QString(); attributes[Attributes::RelationshipDep]=QString(); @@ -103,14 +103,14 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::AncestorTable]=QString(); attributes[Attributes::CopyOptions]=QString(); attributes[Attributes::CopyMode]=QString(); - attributes[Attributes::SRC_COL_PATTERN]=QString(); + attributes[Attributes::SrcColPattern]=QString(); attributes[Attributes::DstColPattern]=QString(); attributes[Attributes::PkPattern]=QString(); attributes[Attributes::UQ_PATTERN]=QString(); attributes[Attributes::SRC_FK_PATTERN]=QString(); attributes[Attributes::DstFkPattern]=QString(); attributes[Attributes::PkColPattern]=QString(); - attributes[Attributes::SINGLE_PK_COLUMN]=QString(); + attributes[Attributes::SinglePkColumn]=QString(); attributes[Attributes::UPD_ACTION]=QString(); attributes[Attributes::DelAction]=QString(); attributes[Attributes::CustomColor]=QString(); diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index 0d1938744b..bf2e039ac1 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -24,7 +24,7 @@ Cast::Cast(void) cast_function=nullptr; cast_type=Explicit; is_in_out=false; - attributes[Attributes::SOURCE_TYPE]=QString(); + attributes[Attributes::SourceType]=QString(); attributes[Attributes::DestType]=QString(); attributes[Attributes::CastType]=QString(); attributes[Attributes::IoCast]=QString(); @@ -155,7 +155,7 @@ unsigned Cast::getCastType(void) QString Cast::getDropDefinition(bool cascade) { - attributes[Attributes::SIGNATURE].replace(QString(","), QString(" AS ")); + attributes[Attributes::Signature].replace(QString(","), QString(" AS ")); return(BaseObject::getDropDefinition(cascade)); } @@ -166,12 +166,12 @@ QString Cast::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { - attributes[Attributes::SOURCE_TYPE]=(*types[SrcType]); + attributes[Attributes::SourceType]=(*types[SrcType]); attributes[Attributes::DestType]=(*types[DstType]); } else { - attributes[Attributes::SOURCE_TYPE]=types[SrcType].getCodeDefinition(def_type); + attributes[Attributes::SourceType]=types[SrcType].getCodeDefinition(def_type); attributes[Attributes::DestType]=types[DstType].getCodeDefinition(def_type); } @@ -200,7 +200,7 @@ QString Cast::getCodeDefinition(unsigned def_type) QString Cast::getSignature(bool) { - attributes[Attributes::SIGNATURE]=this->getName().remove(QString("cast")); + attributes[Attributes::Signature]=this->getName().remove(QString("cast")); return(BaseObject::getSignature(false)); } diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 645abdb496..c098ca6767 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -26,7 +26,7 @@ Column::Column(void) attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::NotNull]=QString(); attributes[Attributes::TABLE]=QString(); - attributes[Attributes::SEQUENCE]=QString(); + attributes[Attributes::Sequence]=QString(); attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::IdentityType]=QString(); attributes[Attributes::Increment]=QString(); @@ -264,7 +264,7 @@ QString Column::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::DefaultValue]=QString("nextval('%1'::regclass)").arg(sequence->getSignature()); - attributes[Attributes::SEQUENCE]=sequence->getName(true); + attributes[Attributes::Sequence]=sequence->getName(true); } } diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 24f035e31c..432eb0ce9b 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3255,7 +3255,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) object->setAlias(attribs[Attributes::Alias]); protected_obj=attribs[Attributes::Protected]==Attributes::True; - sql_disabled=attribs[Attributes::SQL_DISABLED]==Attributes::True; + sql_disabled=attribs[Attributes::SqlDisabled]==Attributes::True; xmlparser.savePosition(); @@ -3276,7 +3276,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) xmlparser.restorePosition(); } //Defines the object's schema - else if(elem_name==Attributes::SCHEMA) + else if(elem_name==Attributes::Schema) { obj_type=ObjectType::Schema; xmlparser.getElementAttributes(attribs_aux); @@ -3294,7 +3294,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) has_error=(!tabspc && !attribs_aux[Attributes::Name].isEmpty()); } //Defines the object's owner - else if(elem_name==Attributes::ROLE) + else if(elem_name==Attributes::Role) { obj_type=ObjectType::Role; xmlparser.getElementAttributes(attribs_aux); @@ -3496,7 +3496,7 @@ Role *DatabaseModel::createRole(void) elem_name=xmlparser.getElementName(); //Getting the member roles - if(elem_name==Attributes::ROLES) + if(elem_name==Attributes::Roles) { //Gets the member roles attributes xmlparser.getElementAttributes(attribs_aux); @@ -3506,9 +3506,9 @@ Role *DatabaseModel::createRole(void) len=list.size(); //Identifying the member role type - if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::Refer) + if(attribs_aux[Attributes::RoleType]==Attributes::Refer) role_type=Role::RefRole; - else if(attribs_aux[Attributes::ROLE_TYPE]==Attributes::Member) + else if(attribs_aux[Attributes::RoleType]==Attributes::Member) role_type=Role::MemberRole; else role_type=Role::AdminRole; @@ -3627,7 +3627,7 @@ Language *DatabaseModel::createLanguage(void) ref_type==Attributes::InlineFunc) { //Gets the function signature and tries to retrieve it from the model - signature=attribs[Attributes::SIGNATURE]; + signature=attribs[Attributes::Signature]; func=getObject(signature, ObjectType::Function); //Raises an error if the function doesn't exists @@ -3700,14 +3700,14 @@ Function *DatabaseModel::createFunction(void) if(!attribs[Attributes::FunctionType].isEmpty()) func->setFunctionType(FunctionType(attribs[Attributes::FunctionType])); - if(!attribs[Attributes::SECURITY_TYPE].isEmpty()) - func->setSecurityType(SecurityType(attribs[Attributes::SECURITY_TYPE])); + if(!attribs[Attributes::SecurityType].isEmpty()) + func->setSecurityType(SecurityType(attribs[Attributes::SecurityType])); if(!attribs[Attributes::ExecutionCost].isEmpty()) func->setExecutionCost(attribs[Attributes::ExecutionCost].toInt()); - if(!attribs[Attributes::ROW_AMOUNT].isEmpty()) - func->setRowAmount(attribs[Attributes::ROW_AMOUNT].toInt()); + if(!attribs[Attributes::RowAmount].isEmpty()) + func->setRowAmount(attribs[Attributes::RowAmount].toInt()); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3953,8 +3953,8 @@ PgSqlType DatabaseModel::createPgSQLType(void) with_timezone=(attribs[Attributes::WITH_TIMEZONE]==Attributes::True); interv_type=attribs[Attributes::IntervalType]; - if(!attribs[Attributes::SPATIAL_TYPE].isEmpty()) - spatial_type=SpatialType(attribs[Attributes::SPATIAL_TYPE], + if(!attribs[Attributes::SpatialType].isEmpty()) + spatial_type=SpatialType(attribs[Attributes::SpatialType], attribs[Attributes::SRID].toUInt(), attribs[Attributes::VARIATION].toUInt()); @@ -4035,7 +4035,7 @@ Type *DatabaseModel::createType(void) //Configuring an auxiliary map used to reference the functions used by base type func_types[Attributes::InputFunc]=Type::InputFunc; func_types[Attributes::OutputFunc]=Type::OutputFunc; - func_types[Attributes::SEND_FUNC]=Type::SendFunc; + func_types[Attributes::SendFunc]=Type::SendFunc; func_types[Attributes::RecvFunc]=Type::RecvFunc; func_types[Attributes::TPMOD_IN_FUNC]=Type::TpmodInFunc; func_types[Attributes::TPMOD_OUT_FUNC]=Type::TpmodOutFunc; @@ -4127,14 +4127,14 @@ Type *DatabaseModel::createType(void) xmlparser.getElementAttributes(attribs); //Tries to get the function from the model - func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::Signature], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::Signature].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(type->getName()) .arg(type->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); //Raises an error if the function type is invalid @@ -4267,14 +4267,14 @@ Cast *DatabaseModel::createCast(void) else if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::Signature], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::Signature].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(cast->getName()) .arg(cast->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4326,14 +4326,14 @@ Conversion *DatabaseModel::createConversion(void) if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::Signature], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::Signature].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(conv->getName()) .arg(conv->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4391,14 +4391,14 @@ Operator *DatabaseModel::createOperator(void) if(elem==objs_schemas[~ObjectType::Operator]) { xmlparser.getElementAttributes(attribs); - oper_aux=getObject(attribs[Attributes::SIGNATURE], ObjectType::Operator); + oper_aux=getObject(attribs[Attributes::Signature], ObjectType::Operator); //Raises an error if the auxiliary operator doesn't exists - if(!oper_aux && !attribs[Attributes::SIGNATURE].isEmpty()) + if(!oper_aux && !attribs[Attributes::Signature].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(oper->getSignature(true)) .arg(oper->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4409,7 +4409,7 @@ Operator *DatabaseModel::createOperator(void) { xmlparser.getElementAttributes(attribs); - if(attribs[Attributes::RefType]!=Attributes::RIGHT_TYPE) + if(attribs[Attributes::RefType]!=Attributes::RightType) arg_type=Operator::LEFT_ARG; else arg_type=Operator::RIGHT_ARG; @@ -4420,14 +4420,14 @@ Operator *DatabaseModel::createOperator(void) else if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::Signature], ObjectType::Function); //Raises an error if the function doesn't exists on the model - if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::Signature].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(oper->getName()) .arg(oper->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4483,14 +4483,14 @@ OperatorClass *DatabaseModel::createOperatorClass(void) if(elem==objs_schemas[~ObjectType::OpFamily]) { xmlparser.getElementAttributes(attribs); - object=getObject(attribs[Attributes::SIGNATURE], ObjectType::OpFamily); + object=getObject(attribs[Attributes::Signature], ObjectType::OpFamily); //Raises an error if the operator family doesn't exists if(!object) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::OpFamily)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4520,12 +4520,12 @@ OperatorClass *DatabaseModel::createOperatorClass(void) } else if(elem_type==OperatorClassElement::FunctionElem) { - object=getObject(attribs[Attributes::SIGNATURE],ObjectType::Function); + object=getObject(attribs[Attributes::Signature],ObjectType::Function); class_elem.setFunction(dynamic_cast(object),stg_number); } else if(elem_type==OperatorClassElement::OperatorElem) { - object=getObject(attribs[Attributes::SIGNATURE],ObjectType::Operator); + object=getObject(attribs[Attributes::Signature],ObjectType::Operator); class_elem.setOperator(dynamic_cast(object),stg_number); if(xmlparser.hasElement(XmlParser::NextElement)) @@ -4534,13 +4534,13 @@ OperatorClass *DatabaseModel::createOperatorClass(void) xmlparser.accessElement(XmlParser::NextElement); xmlparser.getElementAttributes(attribs_aux); - object=getObject(attribs_aux[Attributes::SIGNATURE],ObjectType::OpFamily); + object=getObject(attribs_aux[Attributes::Signature],ObjectType::OpFamily); - if(!object && !attribs_aux[Attributes::SIGNATURE].isEmpty()) + if(!object && !attribs_aux[Attributes::Signature].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(op_class->getName()) .arg(op_class->getTypeName()) - .arg(attribs_aux[Attributes::SIGNATURE]) + .arg(attribs_aux[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::OpFamily)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4624,14 +4624,14 @@ Aggregate *DatabaseModel::createAggregate(void) else if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::Signature], ObjectType::Function); //Raises an error if the function doesn't exists on the model - if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::Signature].isEmpty()) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(aggreg->getName()) .arg(aggreg->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4678,8 +4678,8 @@ Table *DatabaseModel::createTable(void) table->setObjectListsCapacity(attribs[Attributes::MaxObjCount].toUInt()); table->setWithOIDs(attribs[Attributes::Oids]==Attributes::True); table->setUnlogged(attribs[Attributes::UNLOGGED]==Attributes::True); - table->setRLSEnabled(attribs[Attributes::RLS_ENABLED]==Attributes::True); - table->setRLSForced(attribs[Attributes::RLS_FORCED]==Attributes::True); + table->setRLSEnabled(attribs[Attributes::RlsEnabled]==Attributes::True); + table->setRLSForced(attribs[Attributes::RlsForced]==Attributes::True); table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); table->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); @@ -4826,15 +4826,15 @@ Column *DatabaseModel::createColumn(void) if(!attribs[Attributes::IdentityType].isEmpty()) column->setIdentityType(IdentityType(attribs[Attributes::IdentityType])); - if(!attribs[Attributes::SEQUENCE].isEmpty()) + if(!attribs[Attributes::Sequence].isEmpty()) { - seq=getObject(attribs[Attributes::SEQUENCE], ObjectType::Sequence); + seq=getObject(attribs[Attributes::Sequence], ObjectType::Sequence); if(!seq) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Column)) - .arg(attribs[Attributes::SEQUENCE]) + .arg(attribs[Attributes::Sequence]) .arg(BaseObject::getTypeName(ObjectType::Sequence)), ErrorCode::PermissionRefInexistObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5120,7 +5120,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec if(xml_elem==Attributes::OpClass) { xmlparser.getElementAttributes(attribs); - op_class=dynamic_cast(getObject(attribs[Attributes::SIGNATURE], ObjectType::OpClass)); + op_class=dynamic_cast(getObject(attribs[Attributes::Signature], ObjectType::OpClass)); //Raises an error if the operator class doesn't exists if(!op_class) @@ -5130,7 +5130,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5138,7 +5138,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec { throw Exception(Exception::getErrorMessage(ErrorCode::PartKeyObjectInexistsModel) .arg(parent_obj->getName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::OpClass)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5150,7 +5150,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec else if(xml_elem==Attributes::Operator) { xmlparser.getElementAttributes(attribs); - oper=dynamic_cast(getObject(attribs[Attributes::SIGNATURE], ObjectType::Operator)); + oper=dynamic_cast(getObject(attribs[Attributes::Signature], ObjectType::Operator)); //Raises an error if the operator doesn't exists if(!oper) @@ -5158,7 +5158,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Operator)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5266,8 +5266,8 @@ QString DatabaseModel::getAlterDefinition(BaseObject *object) QString alter_def; attribs_map aux_attribs; - aux_attribs[Attributes::SIGNATURE] = this->getSignature(); - aux_attribs[Attributes::SQL_OBJECT] = this->getSQLName(); + aux_attribs[Attributes::Signature] = this->getSignature(); + aux_attribs[Attributes::SqlObject] = this->getSQLName(); if(this->conn_limit!=db_aux->conn_limit) aux_attribs[Attributes::ConnLimit]=QString::number(db_aux->conn_limit); @@ -5546,15 +5546,15 @@ Trigger *DatabaseModel::createTrigger(void) if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::Signature], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::Signature].isEmpty()) { str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(trigger->getName()) .arg(trigger->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Function)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5652,7 +5652,7 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.restorePosition(); } - else if(xmlparser.getElementName()==Attributes::ROLES) + else if(xmlparser.getElementName()==Attributes::Roles) { QStringList rol_names; Role *role = nullptr; @@ -5721,15 +5721,15 @@ EventTrigger *DatabaseModel::createEventTrigger(void) if(elem==Attributes::Function) { xmlparser.getElementAttributes(attribs); - func=getObject(attribs[Attributes::SIGNATURE], ObjectType::Function); + func=getObject(attribs[Attributes::Signature], ObjectType::Function); //Raises an error if the function doesn't exists - if(!func && !attribs[Attributes::SIGNATURE].isEmpty()) + if(!func && !attribs[Attributes::Signature].isEmpty()) { throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(event_trig->getName()) .arg(event_trig->getTypeName()) - .arg(attribs[Attributes::SIGNATURE]) + .arg(attribs[Attributes::Signature]) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -5973,11 +5973,11 @@ View *DatabaseModel::createView(void) view->setCommomTableExpression(xmlparser.getElementContent()); else { - if(attribs[Attributes::TYPE]==Attributes::SELECT_EXP) + if(attribs[Attributes::TYPE]==Attributes::SelectExp) type=Reference::SqlReferSelect; else if(attribs[Attributes::TYPE]==Attributes::FromExp) type=Reference::SqlReferFrom; - else if(attribs[Attributes::TYPE]==Attributes::SIMPLE_EXP) + else if(attribs[Attributes::TYPE]==Attributes::SimpleExp) type=Reference::SqlReferWhere; else type=Reference::SqlReferEndExpr; @@ -6323,7 +6323,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) } else { - QString pat_attrib[]= { Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, + QString pat_attrib[]= { Attributes::SrcColPattern, Attributes::DstColPattern, Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, Attributes::PkPattern, Attributes::UQ_PATTERN, Attributes::PkColPattern }; @@ -6334,7 +6334,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) Relationship::PkColPattern }, pat_count=sizeof(pattern_id)/sizeof(unsigned); - sql_disabled=attribs[Attributes::SQL_DISABLED]==Attributes::True; + sql_disabled=attribs[Attributes::SqlDisabled]==Attributes::True; src_mand=attribs[Attributes::SRC_REQUIRED]==Attributes::True; dst_mand=attribs[Attributes::DstRequired]==Attributes::True; identifier=attribs[Attributes::Identifier]==Attributes::True; @@ -6342,7 +6342,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) defer_type=DeferralType(attribs[Attributes::DeferType]); del_action=ActionType(attribs[Attributes::DelAction]); upd_action=ActionType(attribs[Attributes::UPD_ACTION]); - single_pk_col=(attribs[Attributes::SINGLE_PK_COLUMN]==Attributes::True); + single_pk_col=(attribs[Attributes::SinglePkColumn]==Attributes::True); if(attribs[Attributes::TYPE]==Attributes::Relationship11) rel_type=BaseRelationship::Relationship11; @@ -6452,7 +6452,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) QPointF(attribs[Attributes::X_POS].toFloat(), attribs[Attributes::Y_POS].toFloat())); } - else if(elem==Attributes::SPECIAL_PK_COLS && rel) + else if(elem==Attributes::SpecialPkCols && rel) { QList col_list; @@ -6519,7 +6519,7 @@ Permission *DatabaseModel::createPermission(void) try { xmlparser.getElementAttributes(priv_attribs); - revoke=priv_attribs[Attributes::REVOKE]==Attributes::True; + revoke=priv_attribs[Attributes::Revoke]==Attributes::True; cascade=priv_attribs[Attributes::Cascade]==Attributes::True; xmlparser.savePosition(); @@ -6558,7 +6558,7 @@ Permission *DatabaseModel::createPermission(void) do { - if(xmlparser.getElementName()==Attributes::ROLES) + if(xmlparser.getElementName()==Attributes::Roles) { xmlparser.getElementAttributes(attribs); @@ -6608,7 +6608,7 @@ Permission *DatabaseModel::createPermission(void) priv_type=Permission::PrivInsert; else if(itr->first==Attributes::ReferencesPriv) priv_type=Permission::PrivReferences; - else if(itr->first==Attributes::SELECT_PRIV) + else if(itr->first==Attributes::SelectPriv) priv_type=Permission::PrivSelect; else if(itr->first==Attributes::TEMPORARY_PRIV) priv_type=Permission::PrivTemporary; @@ -6717,7 +6717,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) //Forcing the name/signature cleanup due to the validation temp. names feature attributes[Attributes::Name]=QString(); - attributes[Attributes::SIGNATURE]=QString(); + attributes[Attributes::Signature]=QString(); if(conn_limit >= 0) attributes[Attributes::ConnLimit]=QString("%1").arg(conn_limit); @@ -6807,11 +6807,11 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) general_obj_cnt=objects_map.size(); gen_defs_count=0; - attribs_aux[Attributes::SHELL_TYPES]=QString(); + attribs_aux[Attributes::ShellTypes]=QString(); attribs_aux[Attributes::Permission]=QString(); - attribs_aux[Attributes::SCHEMA]=QString(); + attribs_aux[Attributes::Schema]=QString(); attribs_aux[Attributes::TABLESPACE]=QString(); - attribs_aux[Attributes::ROLE]=QString(); + attribs_aux[Attributes::Role]=QString(); if(def_type==SchemaParser::SqlDefinition) { @@ -6837,7 +6837,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) //Generating the shell type declaration (only for base types) if(usr_type->getConfiguration()==Type::BaseType) - attribs_aux[Attributes::SHELL_TYPES]+=usr_type->getCodeDefinition(def_type, true); + attribs_aux[Attributes::ShellTypes]+=usr_type->getCodeDefinition(def_type, true); else attribs_aux[attrib]+=usr_type->getCodeDefinition(def_type); } @@ -6925,7 +6925,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } } - attribs_aux[Attributes::SEARCH_PATH]=search_path; + attribs_aux[Attributes::SearchPath]=search_path; attribs_aux[Attributes::ModelAuthor]=author; attribs_aux[Attributes::PgModelerVersion]=GlobalAttributes::PgModelerVersion; @@ -9633,7 +9633,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::Alias]=(save_objs_aliases ? object->getAlias() : QString()); attribs[Attributes::TYPE]=object->getSchemaName(); attribs[Attributes::Protected]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? Attributes::True : QString()); - attribs[Attributes::SQL_DISABLED]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? Attributes::True : QString()); + attribs[Attributes::SqlDisabled]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? Attributes::True : QString()); attribs[Attributes::TAG]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); attribs[Attributes::AppendedSql]=object->getAppendedSQL(); attribs[Attributes::PrependedSql]=object->getPrependedSQL(); @@ -9709,7 +9709,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::CustomColor]=(save_custom_colors && rel->getCustomColor()!=Qt::transparent ? rel->getCustomColor().name() : Attributes::None); attribs[Attributes::SRC_TABLE]=rel->getTable(BaseRelationship::SrcTable)->getSignature(); - attribs[Attributes::SRC_TYPE]=rel->getTable(BaseRelationship::SrcTable)->getSchemaName(); + attribs[Attributes::SrcType]=rel->getTable(BaseRelationship::SrcTable)->getSchemaName(); attribs[Attributes::DstTable]=rel->getTable(BaseRelationship::DstTable)->getSignature(); attribs[Attributes::DstType]=rel->getTable(BaseRelationship::DstTable)->getSchemaName(); @@ -9773,7 +9773,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option !attribs[Attributes::RectVisible].isEmpty())) || (save_tags && !attribs[Attributes::TAG].isEmpty()) || (save_objs_prot && !attribs[Attributes::Protected].isEmpty()) || - (save_objs_sqldis && !attribs[Attributes::SQL_DISABLED].isEmpty()) || + (save_objs_sqldis && !attribs[Attributes::SqlDisabled].isEmpty()) || (save_custom_sql && (!attribs[Attributes::AppendedSql].isEmpty() || !attribs[Attributes::PrependedSql].isEmpty())) || (save_fadeout && !attribs[Attributes::FadedOut].isEmpty()) || @@ -9954,7 +9954,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(!object && obj_type==ObjectType::Relationship) { src_tab=dynamic_cast(getObject(attribs[Attributes::SRC_TABLE], - BaseObject::getObjectType(attribs[Attributes::SRC_TYPE]))); + BaseObject::getObjectType(attribs[Attributes::SrcType]))); dst_tab=dynamic_cast(getObject(attribs[Attributes::DstTable], BaseObject::getObjectType(attribs[Attributes::DstType]))); object=getRelationship(src_tab, dst_tab); @@ -9967,13 +9967,13 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(!object->isSystemObject() && ((!attribs[Attributes::Protected].isEmpty() && load_objs_prot) || - (!attribs[Attributes::SQL_DISABLED].isEmpty() && load_objs_sqldis))) + (!attribs[Attributes::SqlDisabled].isEmpty() && load_objs_sqldis))) { if(!attribs[Attributes::Protected].isEmpty()) object->setProtected(attribs[Attributes::Protected]==Attributes::True); - if(!attribs[Attributes::SQL_DISABLED].isEmpty()) - object->setSQLDisabled(attribs[Attributes::SQL_DISABLED]==Attributes::True); + if(!attribs[Attributes::SqlDisabled].isEmpty()) + object->setSQLDisabled(attribs[Attributes::SqlDisabled]==Attributes::True); } else if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && load_tags && !attribs[Attributes::TAG].isEmpty()) { diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 3c2cf39bed..ef7cb3fcd6 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -184,8 +184,8 @@ QString Domain::getAlterDefinition(BaseObject *object) orig_constrs = this->chk_constrs; aux_constrs = domain->chk_constrs; - aux_attribs[Attributes::SQL_OBJECT] = this->getSQLName(); - aux_attribs[Attributes::SIGNATURE] = this->getSignature(); + aux_attribs[Attributes::SqlObject] = this->getSQLName(); + aux_attribs[Attributes::Signature] = this->getSignature(); //Generating the DROP for check constraints that does not exists anymore for(auto constr : orig_constrs) diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 5151ddbbe7..130b408dcb 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -32,15 +32,15 @@ Function::Function(void) attributes[Attributes::Parameters]=QString(); attributes[Attributes::ExecutionCost]=QString(); - attributes[Attributes::ROW_AMOUNT]=QString(); + attributes[Attributes::RowAmount]=QString(); attributes[Attributes::ReturnType]=QString(); attributes[Attributes::FunctionType]=QString(); attributes[Attributes::Language]=QString(); attributes[Attributes::ReturnsSetOf]=QString(); - attributes[Attributes::SECURITY_TYPE]=QString(); + attributes[Attributes::SecurityType]=QString(); attributes[Attributes::BehaviorType]=QString(); attributes[Attributes::Definition]=QString(); - attributes[Attributes::SIGNATURE]=QString(); + attributes[Attributes::Signature]=QString(); attributes[Attributes::RefType]=QString(); attributes[Attributes::WINDOW_FUNC]=QString(); attributes[Attributes::ReturnTable]=QString(); @@ -458,7 +458,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) setParametersAttribute(def_type); attributes[Attributes::ExecutionCost]=QString("%1").arg(execution_cost); - attributes[Attributes::ROW_AMOUNT]=QString("%1").arg(row_amount); + attributes[Attributes::RowAmount]=QString("%1").arg(row_amount); attributes[Attributes::FunctionType]=(~function_type); if(language) @@ -480,7 +480,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::ReturnsSetOf]=(returns_setof ? Attributes::True : QString()); attributes[Attributes::WINDOW_FUNC]=(is_wnd_function ? Attributes::True : QString()); attributes[Attributes::LeakProof]=(is_leakproof ? Attributes::True : QString()); - attributes[Attributes::SECURITY_TYPE]=(~security_type); + attributes[Attributes::SecurityType]=(~security_type); attributes[Attributes::BehaviorType]=(~behavior_type); attributes[Attributes::Definition]=source_code; @@ -490,7 +490,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::Library]=library; } - attributes[Attributes::SIGNATURE]=signature; + attributes[Attributes::Signature]=signature; return(BaseObject::getCodeDefinition(def_type, reduced_form)); } @@ -522,7 +522,7 @@ QString Function::getAlterDefinition(BaseObject *object) if(this->returns_setof && func->returns_setof && this->row_amount!=func->row_amount) { attribs[Attributes::ReturnsSetOf]=Attributes::True; - attribs[Attributes::ROW_AMOUNT]=QString::number(row_amount); + attribs[Attributes::RowAmount]=QString::number(row_amount); } if(this->function_type!=func->function_type) @@ -532,7 +532,7 @@ QString Function::getAlterDefinition(BaseObject *object) attribs[Attributes::LeakProof]=(func->is_leakproof ? Attributes::True : Attributes::UNSET); if(this->security_type!=func->security_type) - attribs[Attributes::SECURITY_TYPE]=~func->security_type; + attribs[Attributes::SecurityType]=~func->security_type; if((this->behavior_type!=func->behavior_type) && ((this->behavior_type==BehaviorType::CalledOnNullInput) || diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 49c7d22302..59ec3ccf61 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -342,7 +342,7 @@ QString Index::getCodeDefinition(unsigned def_type) attributes[Attributes::TABLE]=getParentTable()->getName(true); if(def_type==SchemaParser::SqlDefinition && getParentTable()->getSchema()) - attributes[Attributes::SCHEMA]=getParentTable()->getSchema()->getName(true); + attributes[Attributes::Schema]=getParentTable()->getSchema()->getName(true); } if(this->indexing_type==IndexingType::Gin) diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index a8e05dc217..cc3a79012c 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -35,7 +35,7 @@ Operator::Operator(void) argument_types[RIGHT_ARG]=PgSqlType(QString("\"any\"")); attributes[Attributes::LeftType]=QString(); - attributes[Attributes::RIGHT_TYPE]=QString(); + attributes[Attributes::RightType]=QString(); attributes[Attributes::CommutatorOp]=QString(); attributes[Attributes::NegatorOp]=QString(); attributes[Attributes::RestrictionFunc]=QString(); @@ -43,7 +43,7 @@ Operator::Operator(void) attributes[Attributes::OperatorFunc]=QString(); attributes[Attributes::Hashes]=QString(); attributes[Attributes::Merges]=QString(); - attributes[Attributes::SIGNATURE]=QString(); + attributes[Attributes::Signature]=QString(); attributes[Attributes::RefType]=QString(); } @@ -280,7 +280,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) if(!code_def.isEmpty()) return(code_def); unsigned i; - QString type_attribs[]={Attributes::LeftType, Attributes::RIGHT_TYPE}, + QString type_attribs[]={Attributes::LeftType, Attributes::RightType}, op_attribs[]={ Attributes::CommutatorOp, Attributes::NegatorOp }, @@ -332,7 +332,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::Hashes]=(hashes ? Attributes::True : QString()); attributes[Attributes::Merges]=(merges ? Attributes::True : QString()); - attributes[Attributes::SIGNATURE]=getSignature(); + attributes[Attributes::Signature]=getSignature(); return(BaseObject::getCodeDefinition(def_type, reduced_form)); } diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index b744fcc290..b3a4b54dba 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -188,7 +188,7 @@ QString OperatorClass::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::Family]=family->getSignature(); } - attributes[Attributes::SIGNATURE]=getSignature(); + attributes[Attributes::Signature]=getSignature(); return(BaseObject::getCodeDefinition(def_type, reduced_form)); } diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index f23dbeaf2a..876953027e 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -127,7 +127,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[Attributes::TYPE]=QString(); attributes[Attributes::STRATEGY_NUM]=QString(); - attributes[Attributes::SIGNATURE]=QString(); + attributes[Attributes::Signature]=QString(); attributes[Attributes::Function]=QString(); attributes[Attributes::Operator]=QString(); attributes[Attributes::STORAGE]=QString(); @@ -141,7 +141,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[Attributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::SIGNATURE]=function->getSignature(); + attributes[Attributes::Signature]=function->getSignature(); else attributes[Attributes::Definition]=function->getCodeDefinition(def_type,true); } @@ -152,7 +152,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) attributes[Attributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::SIGNATURE]=_operator->getSignature(); + attributes[Attributes::Signature]=_operator->getSignature(); else attributes[Attributes::Definition]=_operator->getCodeDefinition(def_type,true); diff --git a/libpgmodeler/src/operatorfamily.cpp b/libpgmodeler/src/operatorfamily.cpp index df944cbee0..92de17e7fe 100644 --- a/libpgmodeler/src/operatorfamily.cpp +++ b/libpgmodeler/src/operatorfamily.cpp @@ -45,7 +45,7 @@ QString OperatorFamily::getCodeDefinition(unsigned def_type, bool reduced_form) QString code_def=getCachedCode(def_type, reduced_form); if(!code_def.isEmpty()) return(code_def); - attributes[Attributes::SIGNATURE]=getSignature(); + attributes[Attributes::Signature]=getSignature(); attributes[Attributes::IndexType]=(~indexing_type); return(BaseObject::getCodeDefinition(def_type,reduced_form)); } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 93e7ccdf37..b1bafc935a 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -45,7 +45,7 @@ Permission::Permission(BaseObject *obj) attributes[Attributes::TYPE]=QString(); attributes[Attributes::Parent]=QString(); attributes[Attributes::GrantOp]=QString(); - attributes[Attributes::ROLES]=QString(); + attributes[Attributes::Roles]=QString(); attributes[Attributes::Privileges]=QString(); attributes[Attributes::Cascade]=QString(); attributes[Attributes::PrivilegesGop]=QString(); @@ -411,7 +411,7 @@ QString Permission::getCodeDefinition(unsigned def_type) unsigned i, count; ObjectType obj_type; - QString priv_vect[12]={ Attributes::SELECT_PRIV, Attributes::InsertPriv, + QString priv_vect[12]={ Attributes::SelectPriv, Attributes::InsertPriv, Attributes::UPDATE_PRIV, Attributes::DeletePriv, Attributes::TRUNCATE_PRIV, Attributes::ReferencesPriv, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, @@ -420,7 +420,7 @@ QString Permission::getCodeDefinition(unsigned def_type) obj_type=object->getObjectType(); - attributes[Attributes::REVOKE]=(revoke ? Attributes::True : QString()); + attributes[Attributes::Revoke]=(revoke ? Attributes::True : QString()); attributes[Attributes::Cascade]=(cascade ? Attributes::True : QString()); if(def_type==SchemaParser::SqlDefinition) @@ -471,9 +471,9 @@ QString Permission::getCodeDefinition(unsigned def_type) count=roles.size(); for(i=0; i < count; i++) - attributes[Attributes::ROLES]+=roles[i]->getName(true) + QString(","); + attributes[Attributes::Roles]+=roles[i]->getName(true) + QString(","); - attributes[Attributes::ROLES].remove(attributes[Attributes::ROLES].size()-1,1); + attributes[Attributes::Roles].remove(attributes[Attributes::Roles].size()-1,1); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index e8b6346d7a..923507124a 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1593,7 +1593,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs[Attributes::Precision]=QString(); attribs[Attributes::WITH_TIMEZONE]=QString(); attribs[Attributes::IntervalType]=QString(); - attribs[Attributes::SPATIAL_TYPE]=QString(); + attribs[Attributes::SpatialType]=QString(); attribs[Attributes::VARIATION]=QString(); attribs[Attributes::SRID]=QString(); attribs[Attributes::RefType]=ref_type; @@ -1612,7 +1612,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) if(isGiSType()) { - attribs[Attributes::SPATIAL_TYPE]=(~spatial_type); + attribs[Attributes::SpatialType]=(~spatial_type); attribs[Attributes::VARIATION]=QString("%1").arg(spatial_type.getVariation()); attribs[Attributes::SRID]=QString("%1").arg(spatial_type.getSRID()); } diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index c080c28d1a..23b0edf2f2 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -27,7 +27,7 @@ Policy::Policy(void) : TableObject() attributes[Attributes::Command] = QString(); attributes[Attributes::USING_EXP] = QString(); attributes[Attributes::CheckExp] = QString(); - attributes[Attributes::ROLES] = QString(); + attributes[Attributes::Roles] = QString(); } void Policy::setParentTable(BaseTable *table) @@ -126,7 +126,7 @@ QString Policy::getCodeDefinition(unsigned def_type) attributes[Attributes::Permissive] = (permissive ? Attributes::True : QString()); attributes[Attributes::USING_EXP] = using_expr; attributes[Attributes::CheckExp] = check_expr; - attributes[Attributes::ROLES] = rol_names.join(QString(", ")); + attributes[Attributes::Roles] = rol_names.join(QString(", ")); return(BaseObject::__getCodeDefinition(def_type)); } @@ -169,9 +169,9 @@ QString Policy::getAlterDefinition(BaseObject *object) aux_rol_names.sort(); if(!rol_names.isEmpty() && aux_rol_names.isEmpty()) - attribs[Attributes::ROLES] = Attributes::UNSET; + attribs[Attributes::Roles] = Attributes::UNSET; else if(rol_names.join(QString(", ")) != aux_rol_names.join(QString(", "))) - attribs[Attributes::ROLES] = aux_rol_names.join(QString(", ")); + attribs[Attributes::Roles] = aux_rol_names.join(QString(", ")); copyAttributes(attribs); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index ec3897df97..5667273ed7 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2607,7 +2607,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) setRelationshipAttributes(); attributes[Attributes::Identifier]=(identifier ? Attributes::True : QString()); - attributes[Attributes::SINGLE_PK_COLUMN]=(single_pk_column ? Attributes::True : QString()); + attributes[Attributes::SinglePkColumn]=(single_pk_column ? Attributes::True : QString()); attributes[Attributes::Deferrable]=(deferrable ? Attributes::True : QString()); attributes[Attributes::DeferType]=~deferral_type; attributes[Attributes::UPD_ACTION]=~upd_action; @@ -2618,7 +2618,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::RelationshipDep]=(rel_type==RelationshipDep ? Attributes::True : QString()); attributes[Attributes::RelationshipPart]=(rel_type==RelationshipPart ? Attributes::True : QString()); - attributes[Attributes::SRC_COL_PATTERN]=name_patterns[SrcColPattern]; + attributes[Attributes::SrcColPattern]=name_patterns[SrcColPattern]; attributes[Attributes::DstColPattern]=name_patterns[DstColPattern]; attributes[Attributes::PkPattern]=name_patterns[PkPattern]; attributes[Attributes::UQ_PATTERN]=name_patterns[UqPattern]; @@ -2657,8 +2657,8 @@ QString Relationship::getCodeDefinition(unsigned def_type) { if(!gen_columns.empty() && i < gen_columns.size()) { - attributes[Attributes::SPECIAL_PK_COLS]+=QString("%1").arg(column_ids_pk_rel[i]); - if(i < count-1) attributes[Attributes::SPECIAL_PK_COLS]+=","; + attributes[Attributes::SpecialPkCols]+=QString("%1").arg(column_ids_pk_rel[i]); + if(i < count-1) attributes[Attributes::SpecialPkCols]+=","; } } @@ -2671,7 +2671,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) reduced_form=(attributes[Attributes::Columns].isEmpty() && attributes[Attributes::Constraints].isEmpty() && attributes[Attributes::Points].isEmpty() && - attributes[Attributes::SPECIAL_PK_COLS].isEmpty() && + attributes[Attributes::SpecialPkCols].isEmpty() && attributes[Attributes::Points].isEmpty() && attributes[Attributes::LabelsPos].isEmpty()); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 6daa502bf1..7246142377 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -39,8 +39,8 @@ Table::Table(void) : BaseTable() attributes[Attributes::ConstrIndexes]=QString(); attributes[Attributes::UNLOGGED]=QString(); attributes[Attributes::InitialData]=QString(); - attributes[Attributes::RLS_ENABLED]=QString(); - attributes[Attributes::RLS_FORCED]=QString(); + attributes[Attributes::RlsEnabled]=QString(); + attributes[Attributes::RlsForced]=QString(); attributes[Attributes::Partitioning]=QString(); attributes[Attributes::PartitionKey]=QString(); attributes[Attributes::PartitionedTable]=QString(); @@ -159,8 +159,8 @@ void Table::setCommentAttribute(TableObject *tab_obj) { attribs_map attribs; - attribs[Attributes::SIGNATURE]=tab_obj->getSignature(); - attribs[Attributes::SQL_OBJECT]=tab_obj->getSQLName(); + attribs[Attributes::Signature]=tab_obj->getSignature(); + attribs[Attributes::SqlObject]=tab_obj->getSQLName(); attribs[Attributes::Column]=(tab_obj->getObjectType()==ObjectType::Column ? Attributes::True : QString()); attribs[Attributes::Constraint]=(tab_obj->getObjectType()==ObjectType::Constraint ? Attributes::True : QString()); attribs[Attributes::TABLE]=this->getName(true); @@ -1596,8 +1596,8 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::Oids]=(with_oid ? Attributes::True : QString()); attributes[Attributes::GenAlterCmds]=(gen_alter_cmds ? Attributes::True : QString()); attributes[Attributes::UNLOGGED]=(unlogged ? Attributes::True : QString()); - attributes[Attributes::RLS_ENABLED]=(rls_enabled ? Attributes::True : QString()); - attributes[Attributes::RLS_FORCED]=(rls_forced ? Attributes::True : QString()); + attributes[Attributes::RlsEnabled]=(rls_enabled ? Attributes::True : QString()); + attributes[Attributes::RlsForced]=(rls_forced ? Attributes::True : QString()); attributes[Attributes::CopyTable]=QString(); attributes[Attributes::AncestorTable]=QString(); attributes[Attributes::TAG]=QString(); @@ -1895,10 +1895,10 @@ QString Table::getAlterDefinition(BaseObject *object) attribs[Attributes::UNLOGGED]=(tab->unlogged ? Attributes::True : Attributes::UNSET); if(this->rls_enabled!=tab->rls_enabled) - attribs[Attributes::RLS_ENABLED]=(tab->rls_enabled ? Attributes::True : Attributes::UNSET); + attribs[Attributes::RlsEnabled]=(tab->rls_enabled ? Attributes::True : Attributes::UNSET); if(this->rls_forced!=tab->rls_forced) - attribs[Attributes::RLS_FORCED]=(tab->rls_forced ? Attributes::True : Attributes::UNSET); + attribs[Attributes::RlsForced]=(tab->rls_forced ? Attributes::True : Attributes::UNSET); } copyAttributes(attribs); diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 7ce789e021..4c03351667 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -32,7 +32,7 @@ Type::Type(void) attributes[Attributes::InputFunc]=QString(); attributes[Attributes::OutputFunc]=QString(); attributes[Attributes::RecvFunc]=QString(); - attributes[Attributes::SEND_FUNC]=QString(); + attributes[Attributes::SendFunc]=QString(); attributes[Attributes::TPMOD_IN_FUNC]=QString(); attributes[Attributes::TPMOD_OUT_FUNC]=QString(); attributes[Attributes::AnalyzeFunc]=QString(); @@ -682,7 +682,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) QString func_attrib[]={Attributes::InputFunc, Attributes::OutputFunc, Attributes::RecvFunc, - Attributes::SEND_FUNC, + Attributes::SendFunc, Attributes::TPMOD_IN_FUNC, Attributes::TPMOD_OUT_FUNC, Attributes::AnalyzeFunc, diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 08d6ba5fd2..1e79dfc366 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -24,9 +24,9 @@ View::View(void) : BaseTable() materialized=recursive=with_no_data=false; attributes[Attributes::Definition]=QString(); attributes[Attributes::References]=QString(); - attributes[Attributes::SELECT_EXP]=QString(); + attributes[Attributes::SelectExp]=QString(); attributes[Attributes::FromExp]=QString(); - attributes[Attributes::SIMPLE_EXP]=QString(); + attributes[Attributes::SimpleExp]=QString(); attributes[Attributes::EndExp]=QString(); attributes[Attributes::CteExpression]=QString(); attributes[Attributes::Materialized]=QString(); @@ -480,9 +480,9 @@ void View::setDefinitionAttribute(void) void View::setReferencesAttribute(void) { QString str_aux; - QString attribs[]={ Attributes::SELECT_EXP, + QString attribs[]={ Attributes::SelectExp, Attributes::FromExp, - Attributes::SIMPLE_EXP, + Attributes::SimpleExp, Attributes::EndExp}; vector *vect_exp[]={&exp_select, &exp_from, &exp_where, &exp_end}; int cnt, i, i1; @@ -605,7 +605,7 @@ QString View::getCodeDefinition(unsigned def_type) void View::setSQLObjectAttribute(void) { if(materialized) - attributes[Attributes::SQL_OBJECT]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::View); + attributes[Attributes::SqlObject]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::View); } void View::setObjectListsCapacity(unsigned capacity) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 7a25b19a50..0ce6d25291 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -75,10 +75,10 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::RangeAttribs, QT_TR_NOOP("Range attributes")}, {Attributes::RecvFunc, QT_TR_NOOP("Receive func.")}, {Attributes::RefRoles, QT_TR_NOOP("Ref. roles")}, {Attributes::Replication, QT_TR_NOOP("Replication")}, {Attributes::RestrictionFunc, QT_TR_NOOP("Restriction func.")}, {Attributes::ReturnType, QT_TR_NOOP("Return type")}, - {Attributes::ReturnsSetOf, QT_TR_NOOP("Returns SETOF")}, {Attributes::RIGHT_TYPE, QT_TR_NOOP("Right type")}, - {Attributes::ROW_AMOUNT, QT_TR_NOOP("Rows amount")}, {Attributes::SCHEMA, QT_TR_NOOP("Schema")}, - {Attributes::SECURITY_TYPE, QT_TR_NOOP("Security type")}, {Attributes::SEND_FUNC, QT_TR_NOOP("Send func.")}, - {Attributes::SORT_OP, QT_TR_NOOP("Sort op.")}, {Attributes::SOURCE_TYPE, QT_TR_NOOP("Source type")}, + {Attributes::ReturnsSetOf, QT_TR_NOOP("Returns SETOF")}, {Attributes::RightType, QT_TR_NOOP("Right type")}, + {Attributes::RowAmount, QT_TR_NOOP("Rows amount")}, {Attributes::Schema, QT_TR_NOOP("Schema")}, + {Attributes::SecurityType, QT_TR_NOOP("Security type")}, {Attributes::SendFunc, QT_TR_NOOP("Send func.")}, + {Attributes::SortOp, QT_TR_NOOP("Sort op.")}, {Attributes::SourceType, QT_TR_NOOP("Source type")}, {Attributes::SRC_ENCODING, QT_TR_NOOP("Src. encoding")}, {Attributes::STATE_TYPE, QT_TR_NOOP("State type")}, {Attributes::STORAGE, QT_TR_NOOP("Storage")}, {Attributes::SUPERUSER, QT_TR_NOOP("Superuser")}, {Attributes::TABLESPACE, QT_TR_NOOP("Tablespace")}, {Attributes::TPMOD_IN_FUNC, QT_TR_NOOP("Type mod. in func.")}, @@ -114,17 +114,17 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DynamicLibraryPath, QT_TR_NOOP("Dynamic library path")}, {Attributes::DynamicSharedMemory, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HbaFile, QT_TR_NOOP("Hba file")}, {Attributes::ListenAddresses, QT_TR_NOOP("Listen addresses")}, {Attributes::MaxConnections, QT_TR_NOOP("Max. connections")}, - {Attributes::Port, QT_TR_NOOP("Listen port")}, {Attributes::SERVER_ENCODING, QT_TR_NOOP("Server encoding")}, + {Attributes::Port, QT_TR_NOOP("Listen port")}, {Attributes::ServerEncoding, QT_TR_NOOP("Server encoding")}, {Attributes::SSL, QT_TR_NOOP("SSL")}, {Attributes::SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, {Attributes::SSL_CERT_FILE, QT_TR_NOOP("SSL cert file")}, {Attributes::SSL_CRL_FILE, QT_TR_NOOP("SSL crl file")}, - {Attributes::SSL_KEY_FILE, QT_TR_NOOP("SSL key file")}, {Attributes::SERVER_VERSION, QT_TR_NOOP("Server version")}, + {Attributes::SSL_KEY_FILE, QT_TR_NOOP("SSL key file")}, {Attributes::ServerVersion, QT_TR_NOOP("Server version")}, {Attributes::IdentFile, QT_TR_NOOP("Ident file")}, {Attributes::PasswordEncryption, QT_TR_NOOP("Password encryption")}, - {Attributes::Connection, QT_TR_NOOP("Connection ID")}, {Attributes::SERVER_PID, QT_TR_NOOP("Server PID")}, - {Attributes::SERVER_PROTOCOL, QT_TR_NOOP("Server protocol")}, {Attributes::Referrers, QT_TR_NOOP("Referrers")}, + {Attributes::Connection, QT_TR_NOOP("Connection ID")}, {Attributes::ServerPid, QT_TR_NOOP("Server PID")}, + {Attributes::ServerProtocol, QT_TR_NOOP("Server protocol")}, {Attributes::Referrers, QT_TR_NOOP("Referrers")}, {Attributes::IdentityType, QT_TR_NOOP("Identity")}, {Attributes::Command, QT_TR_NOOP("Command")}, {Attributes::USING_EXP, QT_TR_NOOP("USING expr.")}, {Attributes::CheckExp, QT_TR_NOOP("CHECK expr.")}, - {Attributes::ROLES, QT_TR_NOOP("Roles")}, {Attributes::RLS_ENABLED, QT_TR_NOOP("RLS enabled")}, - {Attributes::RLS_FORCED, QT_TR_NOOP("RLS forced")}, {Attributes::LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, + {Attributes::Roles, QT_TR_NOOP("Roles")}, {Attributes::RlsEnabled, QT_TR_NOOP("RLS enabled")}, + {Attributes::RlsForced, QT_TR_NOOP("RLS forced")}, {Attributes::LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, {Attributes::LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {Attributes::LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, {Attributes::TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {Attributes::TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, {Attributes::TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {Attributes::IsPartitioned, QT_TR_NOOP("Partitioned")}, @@ -310,7 +310,7 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) QString attr_name, attr_value; QRegExp oid_regexp=QRegExp(QString("^[0-9]+")); map dep_types={{Attributes::Owner, ObjectType::Role}, - {Attributes::SCHEMA, ObjectType::Schema}, + {Attributes::Schema, ObjectType::Schema}, {Attributes::TABLESPACE, ObjectType::Tablespace}, {Attributes::Collation, ObjectType::Collation}, {Attributes::TABLE, ObjectType::Table}}; @@ -385,16 +385,16 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) if(attribs[Attributes::Oid].toUInt() > 0) { - attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); + attribs[Attributes::SqlObject]=BaseObject::getSQLName(obj_type); attribs[Attributes::ObjectType]=BaseObject::getSchemaName(obj_type); - if(attribs.count(Attributes::SIGNATURE)==0) - attribs[Attributes::SIGNATURE]=BaseObject::formatName(attribs[Attributes::Name]); + if(attribs.count(Attributes::Signature)==0) + attribs[Attributes::Signature]=BaseObject::formatName(attribs[Attributes::Name]); - if(attribs.count(Attributes::SCHEMA)!=0) - attribs[Attributes::SIGNATURE]=QString("%1.%2") - .arg(BaseObject::formatName(attribs[Attributes::SCHEMA])) - .arg(attribs[Attributes::SIGNATURE]); + if(attribs.count(Attributes::Schema)!=0) + attribs[Attributes::Signature]=QString("%1.%2") + .arg(BaseObject::formatName(attribs[Attributes::Schema])) + .arg(attribs[Attributes::Signature]); } return(fmt_attribs); @@ -439,7 +439,7 @@ void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::IoCast }); formatOidAttribs(attribs, { Attributes::DestType, - Attributes::SOURCE_TYPE }, ObjectType::Type, false); + Attributes::SourceType }, ObjectType::Type, false); attribs[Attributes::Function]=getObjectName(ObjectType::Function, attribs[Attributes::Function]); } @@ -456,12 +456,12 @@ void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) Attributes::TRANSITION_FUNC }, ObjectType::Function, false); formatOidAttribs(attribs, { Attributes::TYPES }, ObjectType::Type, true); - attribs[Attributes::SIGNATURE]=(QString("%1(%2)") + attribs[Attributes::Signature]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[Attributes::Name])) .arg(attribs[Attributes::TYPES])).replace(ElemSeparator, QString(",")); attribs[Attributes::STATE_TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::STATE_TYPE]); - attribs[Attributes::SORT_OP]=getObjectName(ObjectType::Operator, attribs[Attributes::SORT_OP]); + attribs[Attributes::SortOp]=getObjectName(ObjectType::Operator, attribs[Attributes::SortOp]); attribs[Attributes::InitialCond]=Catalog::parseArrayValues(attribs[Attributes::InitialCond]).join(ElemSeparator); } @@ -512,7 +512,7 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) attribs[Attributes::ArgDefaults]=Catalog::parseArrayValues(attribs[Attributes::ArgDefaults]).join(ElemSeparator); formatOidAttribs(attribs, { Attributes::ArgTypes }, ObjectType::Type, true); - attribs[Attributes::SIGNATURE]=(QString("%1(%2)") + attribs[Attributes::Signature]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[Attributes::Name])) .arg(attribs[Attributes::ArgTypes])).replace(ElemSeparator, QString(",")); @@ -527,7 +527,7 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) Attributes::Merges }); formatOidAttribs(attribs, { Attributes::LeftType, - Attributes::RIGHT_TYPE}, ObjectType::Type, false); + Attributes::RightType}, ObjectType::Type, false); formatOidAttribs(attribs, { Attributes::CommutatorOp, Attributes::NegatorOp}, ObjectType::Operator, false); @@ -536,10 +536,10 @@ void DatabaseExplorerWidget::formatOperatorAttribs(attribs_map &attribs) Attributes::RestrictionFunc, Attributes::JoinFunc }, ObjectType::Function, false); - attribs[Attributes::SIGNATURE]=(QString("%1(%2,%3)") + attribs[Attributes::Signature]=(QString("%1(%2,%3)") .arg(BaseObject::formatName(attribs[Attributes::Name], true)) .arg(attribs[Attributes::LeftType]) - .arg(attribs[Attributes::RIGHT_TYPE])).replace(ElemSeparator, QString(",")); + .arg(attribs[Attributes::RightType])).replace(ElemSeparator, QString(",")); } void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) @@ -548,15 +548,15 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::Oids, Attributes::UNLOGGED, - Attributes::RLS_ENABLED, - Attributes::RLS_FORCED}); + Attributes::RlsEnabled, + Attributes::RlsForced}); formatOidAttribs(attribs, { Attributes::Parents }, ObjectType::Table, true); formatOidAttribs(attribs, { Attributes::PartitionedTable }, ObjectType::Table, false); part_keys.push_back(getObjectsNames(ObjectType::Column, Catalog::parseArrayValues(attribs[Attributes::PartKeyCols]), - getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]), + getObjectName(ObjectType::Schema, attribs[Attributes::Schema]), attribs[Attributes::Name]).join(ElemSeparator)); part_keys.push_back(Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator)); @@ -576,7 +576,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) seq_attrs={ Attributes::START, Attributes::MinValue, Attributes::MaxValue, Attributes::Increment, Attributes::Cache, Attributes::Cycle }; - QString sch_name=getObjectName(ObjectType::Schema, attribs[Attributes::SCHEMA]); + QString sch_name=getObjectName(ObjectType::Schema, attribs[Attributes::Schema]); attribs.erase(Attributes::Attribute); for(int i=0; i < seq_values.size(); i++) @@ -631,7 +631,7 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) Attributes::InputFunc, Attributes::OutputFunc, Attributes::RecvFunc, - Attributes::SEND_FUNC, + Attributes::SendFunc, Attributes::TPMOD_IN_FUNC, Attributes::TPMOD_OUT_FUNC }, ObjectType::Function, false); attribs[Attributes::Element]=getObjectName(ObjectType::Type, attribs[Attributes::Element]); @@ -820,7 +820,7 @@ void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatPolicyAttribs(attribs_map &attribs) { - attribs[Attributes::ROLES] = getObjectsNames(ObjectType::Role, Catalog::parseArrayValues(attribs[Attributes::ROLES])).join(ElemSeparator); + attribs[Attributes::Roles] = getObjectsNames(ObjectType::Role, Catalog::parseArrayValues(attribs[Attributes::Roles])).join(ElemSeparator); } QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) @@ -845,10 +845,10 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) obj_name=attribs[Attributes::Name]; //Retrieving the schema name - if(!attribs[Attributes::SCHEMA].isEmpty() && - attribs[Attributes::SCHEMA]!=QString("0")) + if(!attribs[Attributes::Schema].isEmpty() && + attribs[Attributes::Schema]!=QString("0")) { - aux_attribs=catalog.getObjectAttributes(ObjectType::Schema, attribs[Attributes::SCHEMA].toUInt()); + aux_attribs=catalog.getObjectAttributes(ObjectType::Schema, attribs[Attributes::Schema].toUInt()); sch_name=BaseObject::formatName(aux_attribs[Attributes::Name], false); if(!sch_name.isEmpty()) @@ -873,7 +873,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) { QStringList arg_types, names; QString type_name; - vector attrib_ids={ Attributes::LeftType, Attributes::RIGHT_TYPE }; + vector attrib_ids={ Attributes::LeftType, Attributes::RightType }; for(QString attr : attrib_ids) { @@ -1123,7 +1123,7 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) attribs[Attributes::TABLE]=BaseObject::formatName(sch_name) + QString(".") + BaseObject::formatName(tab_name); } //Formatting the "name" attribute if it is not schema qualified - else if(attribs.count(Attributes::SCHEMA) && + else if(attribs.count(Attributes::Schema) && attribs.count(Attributes::Name) && !attribs[Attributes::Name].contains('.')) { @@ -1134,12 +1134,12 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) else obj_name=attribs[Attributes::Name]; - attribs[Attributes::Name]=BaseObject::formatName(attribs[Attributes::SCHEMA]) + QString(".") + obj_name; + attribs[Attributes::Name]=BaseObject::formatName(attribs[Attributes::Schema]) + QString(".") + obj_name; } - if(attribs.count(Attributes::SQL_OBJECT)==0) + if(attribs.count(Attributes::SqlObject)==0) { - attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); + attribs[Attributes::SqlObject]=BaseObject::getSQLName(obj_type); attribs[Attributes::ObjectType]=BaseObject::getSchemaName(obj_type); } @@ -1163,7 +1163,7 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i attribs_map attribs; QStringList types; - attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(obj_type); + attribs[Attributes::SqlObject]=BaseObject::getSQLName(obj_type); attribs[Attributes::DeclInTable]=QString(); attribs[BaseObject::getSchemaName(obj_type)]=Attributes::True; @@ -1182,23 +1182,23 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i //Formatting the names attribs[Attributes::Name]=BaseObject::formatName(obj_name, obj_type==ObjectType::Operator); attribs[Attributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); - attribs[Attributes::SCHEMA]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); + attribs[Attributes::Schema]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); //For table objects the "table" attribute must be schema qualified if(obj_type!=ObjectType::Index && TableObject::isTableObject(obj_type)) { - attribs[Attributes::TABLE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::TABLE]; - attribs[Attributes::SIGNATURE]=attribs[Attributes::Name] + QString(" ON %1").arg(attribs[Attributes::TABLE]); + attribs[Attributes::TABLE]=attribs[Attributes::Schema] + QString(".") + attribs[Attributes::TABLE]; + attribs[Attributes::Signature]=attribs[Attributes::Name] + QString(" ON %1").arg(attribs[Attributes::TABLE]); } //For operators and functions there must exist the signature attribute else if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function) - attribs[Attributes::SIGNATURE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::Name] + QString("(%1)").arg(types.join(ElemSeparator)); + attribs[Attributes::Signature]=attribs[Attributes::Schema] + QString(".") + attribs[Attributes::Name] + QString("(%1)").arg(types.join(ElemSeparator)); else if(obj_type==ObjectType::Cast) - attribs[Attributes::SIGNATURE]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); + attribs[Attributes::Signature]=QString("(%1 AS %2)").arg(types[0]).arg(types[1]); else if(obj_type==ObjectType::OpFamily || obj_type==ObjectType::OpClass) { attribs_map aux_attribs=item->data(DatabaseImportForm::ObjectOtherData, Qt::UserRole).value(); - attribs[Attributes::SIGNATURE]=QString("%1 USING %2").arg(attribs[Attributes::Name]).arg(aux_attribs[Attributes::IndexType]); + attribs[Attributes::Signature]=QString("%1 USING %2").arg(attribs[Attributes::Name]).arg(aux_attribs[Attributes::IndexType]); } else { @@ -1210,17 +1210,17 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i if(aux_attribs[Attributes::Materialized] == Attributes::True) { - attribs[Attributes::SQL_OBJECT] = + attribs[Attributes::SqlObject] = QString("%1 %2").arg(Attributes::Materialized.toUpper()) .arg(BaseObject::getSQLName(ObjectType::View)); } } - if(!attribs[Attributes::SCHEMA].isEmpty() && - attribs[Attributes::Name].indexOf(attribs[Attributes::SCHEMA] + QString(".")) < 0) - attribs[Attributes::SIGNATURE]=attribs[Attributes::SCHEMA] + QString(".") + attribs[Attributes::Name]; + if(!attribs[Attributes::Schema].isEmpty() && + attribs[Attributes::Name].indexOf(attribs[Attributes::Schema] + QString(".")) < 0) + attribs[Attributes::Signature]=attribs[Attributes::Schema] + QString(".") + attribs[Attributes::Name]; else - attribs[Attributes::SIGNATURE]=attribs[Attributes::Name]; + attribs[Attributes::Signature]=attribs[Attributes::Name]; } return(attribs); @@ -1261,7 +1261,7 @@ void DatabaseExplorerWidget::dropObject(QTreeWidgetItem *item, bool cascade) attribs=extractAttributesFromItem(item); if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function) - attribs[Attributes::SIGNATURE].replace(ElemSeparator, QChar(',')); + attribs[Attributes::Signature].replace(ElemSeparator, QChar(',')); //Generate the drop command schparser.ignoreEmptyAttributes(true); @@ -1325,8 +1325,8 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin Connection conn; SchemaParser schparser; - attribs[Attributes::SQL_OBJECT]=BaseObject::getSQLName(ObjectType::Table); - attribs[Attributes::SIGNATURE]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); + attribs[Attributes::SqlObject]=BaseObject::getSQLName(ObjectType::Table); + attribs[Attributes::Signature]=QString("%1.%2").arg(BaseObject::formatName(sch_name)).arg(BaseObject::formatName(obj_name)); attribs[Attributes::Cascade]=(cascade ? Attributes::True : ""); attribs[Attributes::RestartSeq]=(msg_box.isCustomOptionChecked() ? Attributes::True : ""); @@ -1498,7 +1498,7 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) for(auto &fk : ref_fks) { ref_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::TABLE].toUInt()); - ref_schema = catalog.getObjectAttributes(ObjectType::Schema, ref_table[Attributes::SCHEMA].toUInt()); + ref_schema = catalog.getObjectAttributes(ObjectType::Schema, ref_table[Attributes::Schema].toUInt()); tab_list.push_back(QString("%1.%2").arg(ref_schema[Attributes::Name]).arg(ref_table[Attributes::Name])); } @@ -1518,7 +1518,7 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) //Format values and translate the attribute names fmt_attribs=formatObjectAttribs(orig_attribs); - fmt_attribs.erase(Attributes::SIGNATURE); + fmt_attribs.erase(Attributes::Signature); //Store the original attributes on the item to permit value replacements when using code snippets item->setData(DatabaseImportForm::ObjectOtherData, Qt::UserRole, QVariant::fromValue(orig_attribs)); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 46d6431e10..0fe8c2dd67 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -680,7 +680,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) attribs[Attributes::DeclInTable]=QString(); //System objects will have the sql disabled by default - attribs[Attributes::SQL_DISABLED]=(catalog.isSystemObject(oid) || catalog.isExtensionObject(oid) ? Attributes::True : QString()); + attribs[Attributes::SqlDisabled]=(catalog.isSystemObject(oid) || catalog.isExtensionObject(oid) ? Attributes::True : QString()); attribs[Attributes::Comment]=getComment(attribs); if(attribs.count(Attributes::Owner)) @@ -689,8 +689,8 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) if(attribs.count(Attributes::TABLESPACE)) attribs[Attributes::TABLESPACE]=getDependencyObject(attribs[Attributes::TABLESPACE], ObjectType::Tablespace, false, auto_resolve_deps); - if(attribs.count(Attributes::SCHEMA)) - attribs[Attributes::SCHEMA]=getDependencyObject(attribs[Attributes::SCHEMA], ObjectType::Schema, false, auto_resolve_deps); + if(attribs.count(Attributes::Schema)) + attribs[Attributes::Schema]=getDependencyObject(attribs[Attributes::Schema], ObjectType::Schema, false, auto_resolve_deps); /* Due to the object recreation mechanism there are some situations when pgModeler fails to recreate them due to the duplication of permissions. So, to avoid this problem we need to check if the OID of the @@ -826,7 +826,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType createObject(obj_attr); if(use_signature) - obj_name=obj_attr[Attributes::SIGNATURE]=getObjectName(oid, true); + obj_name=obj_attr[Attributes::Signature]=getObjectName(oid, true); else obj_name=obj_attr[Attributes::Name]=getObjectName(oid); @@ -1069,7 +1069,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) /* If the function is to be used as a user-defined data type support functions the parameter type will be renamed to "any" (see rules on Type::setFunction()) */ if(i==0 && - (attribs[Attributes::RefType]==Attributes::SEND_FUNC || + (attribs[Attributes::RefType]==Attributes::SendFunc || attribs[Attributes::RefType]==Attributes::OutputFunc || attribs[Attributes::RefType]==Attributes::CanonicalFunc)) type=PgSqlType(QString("\"any\"")); @@ -1327,7 +1327,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) Attributes::JoinFunc }, arg_types[]= { Attributes::LeftType, - Attributes::RIGHT_TYPE }, + Attributes::RightType }, op_types[]= { Attributes::CommutatorOp, Attributes::NegatorOp }; @@ -1338,7 +1338,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) for(unsigned i=0; i < 2; i++) attribs[arg_types[i]]=getType(attribs[arg_types[i]], true, {{Attributes::RefType, arg_types[i]}}); - regexp.setPattern(Attributes::SIGNATURE + QString("(=)(\")")); + regexp.setPattern(Attributes::Signature + QString("(=)(\")")); for(unsigned i=0; i < 2; i++) { attribs[op_types[i]]=getDependencyObject(attribs[op_types[i]], ObjectType::Operator, true, false, true, {{Attributes::RefType, op_types[i]}}); @@ -1396,7 +1396,7 @@ void DatabaseImportHelper::createCast(attribs_map &attribs) try { attribs[Attributes::Function]=getDependencyObject(attribs[Attributes::Function], ObjectType::Function, true); - attribs[Attributes::SOURCE_TYPE]=getType(attribs[Attributes::SOURCE_TYPE], true); + attribs[Attributes::SourceType]=getType(attribs[Attributes::SourceType], true); attribs[Attributes::DestType]=getType(attribs[Attributes::DestType], true); loadObjectXML(ObjectType::Cast, attribs); cast=dbmodel->createCast(); @@ -1519,7 +1519,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) attribs[Attributes::STATE_TYPE]=getType(attribs[Attributes::STATE_TYPE], true, {{Attributes::RefType, Attributes::STATE_TYPE}}); - attribs[Attributes::SORT_OP]=getDependencyObject(attribs[Attributes::SORT_OP], ObjectType::Operator, true); + attribs[Attributes::SortOp]=getDependencyObject(attribs[Attributes::SortOp], ObjectType::Operator, true); loadObjectXML(ObjectType::Aggregate, attribs); agg=dbmodel->createAggregate(); @@ -1591,7 +1591,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) func_types[]={ Attributes::InputFunc, Attributes::OutputFunc, Attributes::RecvFunc, - Attributes::SEND_FUNC, + Attributes::SendFunc, Attributes::TPMOD_IN_FUNC, Attributes::TPMOD_OUT_FUNC, Attributes::AnalyzeFunc }; @@ -1650,7 +1650,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) { /* Since the schema name sometimes comes in form os tag it is needed extract only the name from before retrieve the columns of the table */ - QString sch_name=attribs[Attributes::SCHEMA]; + QString sch_name=attribs[Attributes::Schema]; sch_name.replace(QRegExp(QString("(\\t)*(<)(schema)( )+(name)( )*(=)")), QString()); sch_name.replace(QRegExp(QString("(/)(>)(\n)*")), QString()); sch_name.replace('"', QString()); @@ -1682,7 +1682,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) { /* Building the type name prepending the schema name in order to search it on * the user defined types list at PgSQLType class */ - type_name=BaseObject::formatName(getObjectName(types[type_oid][Attributes::SCHEMA], true), false); + type_name=BaseObject::formatName(getObjectName(types[type_oid][Attributes::Schema], true), false); type_name+=QString("."); if(types[type_oid][Attributes::Category] == ~CategoryType(CategoryType::Array)) @@ -2201,7 +2201,7 @@ void DatabaseImportHelper::createPolicy(attribs_map &attribs) try { attribs[Attributes::TABLE]=getDependencyObject(attribs[Attributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); - attribs[Attributes::ROLES]=getObjectNames(attribs[Attributes::ROLES]).join(','); + attribs[Attributes::Roles]=getObjectNames(attribs[Attributes::Roles]).join(','); loadObjectXML(ObjectType::Policy, attribs); dbmodel->createPolicy(); } @@ -2597,7 +2597,7 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f //If the object accepts an schema retrieve the schema name too if(BaseObject::acceptsSchema(obj_type)) - sch_name=getObjectName(obj_attr[Attributes::SCHEMA]); + sch_name=getObjectName(obj_attr[Attributes::Schema]); if(!sch_name.isEmpty()) obj_name.prepend(sch_name + QString(".")); @@ -2641,8 +2641,8 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f else params.push_back(QString("NONE")); - if(obj_attr[Attributes::RIGHT_TYPE].toUInt() > 0) - params.push_back(getType(obj_attr[Attributes::RIGHT_TYPE], false)); + if(obj_attr[Attributes::RightType].toUInt() > 0) + params.push_back(getType(obj_attr[Attributes::RightType], false)); else params.push_back(QString("NONE")); } @@ -2773,7 +2773,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, /* Prepend the schema name only if it is not a system schema ('pg_catalog' or 'information_schema') and if the schema's names is already present in the type's name (in case of table types) */ - sch_name=getObjectName(type_attr[Attributes::SCHEMA]); + sch_name=getObjectName(type_attr[Attributes::Schema]); if(!sch_name.isEmpty() && ((sch_name!=QString("pg_catalog") && sch_name!=QString("information_schema")) || type_oid > catalog.getLastSysObjectOID()) && diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 4dd882b08a..6ebc0b8c8f 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -820,7 +820,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin for(auto &fk : fks) { aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::RefTable].toUInt()); - aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::SCHEMA].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::Schema].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[Attributes::Name]) .arg(aux_table[Attributes::Name]) @@ -828,7 +828,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin //Store the referenced schema and table names fk_infos[fk_name][Attributes::RefTable] = aux_table[Attributes::Name]; - fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::Name]; + fk_infos[fk_name][Attributes::Schema] = aux_schema[Attributes::Name]; action = submenu->addAction(QPixmap(PgModelerUiNs::getIconPath("table")), QString("%1.%2 (%3)").arg(aux_schema[Attributes::Name]) .arg(aux_table[Attributes::Name]) @@ -872,7 +872,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin name_list.clear(); aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::TABLE].toUInt()); - aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::SCHEMA].toUInt()); + aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::Schema].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[Attributes::Name]) .arg(aux_table[Attributes::Name]) @@ -893,7 +893,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin ref_fk_infos[fk_name][Attributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); ref_fk_infos[fk_name][Attributes::TABLE] = aux_table[Attributes::Name]; - ref_fk_infos[fk_name][Attributes::SCHEMA] = aux_schema[Attributes::Name]; + ref_fk_infos[fk_name][Attributes::Schema] = aux_schema[Attributes::Name]; } } @@ -1148,14 +1148,14 @@ void DataManipulationForm::browseTable(const QString &fk_name, bool browse_ref_t { src_cols = pk_col_names; ref_cols = ref_fk_infos[fk_name][Attributes::SRC_COLUMNS].split(Table::DataSeparator); - schema = ref_fk_infos[fk_name][Attributes::SCHEMA]; + schema = ref_fk_infos[fk_name][Attributes::Schema]; table = ref_fk_infos[fk_name][Attributes::TABLE]; } else { src_cols = fk_infos[fk_name][Attributes::SRC_COLUMNS].split(Table::DataSeparator); ref_cols = fk_infos[fk_name][Attributes::DstColumns].split(Table::DataSeparator); - schema = fk_infos[fk_name][Attributes::SCHEMA]; + schema = fk_infos[fk_name][Attributes::Schema]; table = fk_infos[fk_name][Attributes::RefTable]; } diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 078fb49056..058bc431ab 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -112,12 +112,12 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=QString(); config_params[Attributes::Configuration][Attributes::InvertRangeSelTrigger]=QString(); config_params[Attributes::Configuration][Attributes::CheckUpdate]=QString(); - config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]=QString(); - config_params[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]=QString(); + config_params[Attributes::Configuration][Attributes::SaveLastPosition]=QString(); + config_params[Attributes::Configuration][Attributes::ShowMainMenu]=QString(); config_params[Attributes::Configuration][Attributes::DisableSmoothness]=QString(); - config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]=QString(); + config_params[Attributes::Configuration][Attributes::SimplifiedObjCreation]=QString(); config_params[Attributes::Configuration][Attributes::ConfirmValidation]=QString(); - config_params[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]=QString(); + config_params[Attributes::Configuration][Attributes::ShowMainMenu]=QString(); config_params[Attributes::Configuration][Attributes::CodeCompletion]=QString(); config_params[Attributes::Configuration][Attributes::DisplayLineNumbers]=QString(); config_params[Attributes::Configuration][Attributes::LineNumbersColor]=QString(); @@ -127,10 +127,10 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=QString(); config_params[Attributes::Configuration][Attributes::MinObjectOpacity]=QString(); config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString(); - config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]=QString(); + config_params[Attributes::Configuration][Attributes::SourceEditorApp]=QString(); config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]=QString(); config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=QString(); - config_params[Attributes::Configuration][Attributes:: SAVE_RESTORE_GEOMETRY]=QString(); + config_params[Attributes::Configuration][Attributes:: SaveRestoreGeometry]=QString(); simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this); simp_obj_creation_ht->setText(simple_obj_creation_chk->statusTip()); @@ -289,9 +289,9 @@ void GeneralConfigWidget::loadConfiguration(void) corner_move_chk->setChecked(config_params[Attributes::Configuration][Attributes::CanvasCornerMove]==Attributes::True); invert_rangesel_chk->setChecked(config_params[Attributes::Configuration][Attributes::InvertRangeSelTrigger]==Attributes::True); check_upd_chk->setChecked(config_params[Attributes::Configuration][Attributes::CheckUpdate]==Attributes::True); - save_last_pos_chk->setChecked(config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]==Attributes::True); + save_last_pos_chk->setChecked(config_params[Attributes::Configuration][Attributes::SaveLastPosition]==Attributes::True); disable_smooth_chk->setChecked(config_params[Attributes::Configuration][Attributes::DisableSmoothness]==Attributes::True); - simple_obj_creation_chk->setChecked(config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]==Attributes::True); + simple_obj_creation_chk->setChecked(config_params[Attributes::Configuration][Attributes::SimplifiedObjCreation]==Attributes::True); confirm_validation_chk->setChecked(config_params[Attributes::Configuration][Attributes::ConfirmValidation]==Attributes::True); code_completion_chk->setChecked(config_params[Attributes::Configuration][Attributes::CodeCompletion]==Attributes::True); use_placeholders_chk->setChecked(config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]==Attributes::True); @@ -329,10 +329,10 @@ void GeneralConfigWidget::loadConfiguration(void) line_numbers_bg_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LineNumbersBgColor]); line_highlight_cp->setColor(0, config_params[Attributes::Configuration][Attributes::LineHighlightColor]); - source_editor_edt->setText(config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]); - source_editor_args_edt->setText(config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_ARGS]); + source_editor_edt->setText(config_params[Attributes::Configuration][Attributes::SourceEditorApp]); + source_editor_args_edt->setText(config_params[Attributes::Configuration][Attributes::SourceEditorArgs]); - save_restore_geometry_chk->setChecked(config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY]==Attributes::True); + save_restore_geometry_chk->setChecked(config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]==Attributes::True); reset_sizes_tb->setEnabled(save_restore_geometry_chk->isChecked()); int ui_idx = ui_language_cmb->findData(config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]); @@ -406,7 +406,7 @@ QString GeneralConfigWidget::getConfigurationParam(const QString §ion_id, co void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { if(!widget || - config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY] != Attributes::True) + config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry] != Attributes::True) return; QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; @@ -418,7 +418,7 @@ void GeneralConfigWidget::saveWidgetGeometry(QWidget *widget, const QString &cus bool GeneralConfigWidget::restoreWidgetGeometry(QWidget *widget, const QString &custom_wgt_name) { if(!widget || - config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY] != Attributes::True) + config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry] != Attributes::True) return(false); QString dlg_name = custom_wgt_name.isEmpty() ? widget->metaObject()->className() : custom_wgt_name; @@ -474,9 +474,9 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::CanvasCornerMove]=(corner_move_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::InvertRangeSelTrigger]=(invert_rangesel_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CheckUpdate]=(check_upd_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::SAVE_LAST_POSITION]=(save_last_pos_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::SaveLastPosition]=(save_last_pos_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::DisableSmoothness]=(disable_smooth_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::SIMPLIFIED_OBJ_CREATION]=(simple_obj_creation_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::SimplifiedObjCreation]=(simple_obj_creation_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::ConfirmValidation]=(confirm_validation_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CodeCompletion]=(code_completion_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CodeTabWidth]=QString::number(tab_width_chk->isChecked() ? tab_width_spb->value() : 0); @@ -486,8 +486,8 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? Attributes::True : QString()); ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); - config_params[Attributes::Configuration][Attributes::SHOW_CANVAS_GRID]=(show_grid ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::SHOW_PAGE_DELIMITERS]=(show_delim ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::ShowCanvasGrid]=(show_grid ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::ShowPageDelimiters]=(show_delim ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::AlignObjsToGrid]=(align_grid ? Attributes::True : QString()); unity_cmb->setCurrentIndex(UnitMilimeters); @@ -516,12 +516,12 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::LineNumbersBgColor]=line_numbers_bg_cp->getColor(0).name(); config_params[Attributes::Configuration][Attributes::LineHighlightColor]=line_highlight_cp->getColor(0).name(); - config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_APP]=source_editor_edt->text(); - config_params[Attributes::Configuration][Attributes::SOURCE_EDITOR_ARGS]=source_editor_args_edt->text(); + config_params[Attributes::Configuration][Attributes::SourceEditorApp]=source_editor_edt->text(); + config_params[Attributes::Configuration][Attributes::SourceEditorArgs]=source_editor_args_edt->text(); config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]=ui_language_cmb->currentData().toString(); config_params[Attributes::Configuration][Attributes::CompactView]=(BaseObjectView::isCompactViewEnabled() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::SAVE_RESTORE_GEOMETRY]=(save_restore_geometry_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]=(save_restore_geometry_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::File]=QString(); config_params[Attributes::Configuration][Attributes::RecentModels]=QString(); @@ -550,7 +550,7 @@ void GeneralConfigWidget::saveConfiguration(void) } else if(itr->first==Attributes::VALIDATOR || itr->first==Attributes::ObjectFinder || - itr->first==Attributes::SQL_TOOL) + itr->first==Attributes::SqlTool) { schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); @@ -612,9 +612,9 @@ void GeneralConfigWidget::applyConfiguration(void) ObjectsScene::setInvertRangeSelectionTrigger(invert_rangesel_chk->isChecked()); ObjectsScene::setGridSize(grid_size_spb->value()); - ObjectsScene::setGridOptions(config_params[Attributes::Configuration][Attributes::SHOW_CANVAS_GRID]==Attributes::True, + ObjectsScene::setGridOptions(config_params[Attributes::Configuration][Attributes::ShowCanvasGrid]==Attributes::True, config_params[Attributes::Configuration][Attributes::AlignObjsToGrid]==Attributes::True, - config_params[Attributes::Configuration][Attributes::SHOW_PAGE_DELIMITERS]==Attributes::True); + config_params[Attributes::Configuration][Attributes::ShowPageDelimiters]==Attributes::True); OperationList::setMaximumSize(oplist_size_spb->value()); BaseTableView::setHideExtAttributes(hide_ext_attribs_chk->isChecked()); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index deb09e5699..013a8f0bc6 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -396,9 +396,9 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par #ifndef Q_OS_MAC //Restoring the canvas grid options - action_show_grid->setChecked(confs[Attributes::Configuration][Attributes::SHOW_CANVAS_GRID]==Attributes::True); + action_show_grid->setChecked(confs[Attributes::Configuration][Attributes::ShowCanvasGrid]==Attributes::True); action_alin_objs_grade->setChecked(confs[Attributes::Configuration][Attributes::AlignObjsToGrid]==Attributes::True); - action_show_delimiters->setChecked(confs[Attributes::Configuration][Attributes::SHOW_PAGE_DELIMITERS]==Attributes::True); + action_show_delimiters->setChecked(confs[Attributes::Configuration][Attributes::ShowPageDelimiters]==Attributes::True); action_compact_view->setChecked(confs[Attributes::Configuration][Attributes::CompactView]==Attributes::True); ObjectsScene::setGridOptions(action_show_grid->isChecked(), @@ -406,7 +406,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par action_show_delimiters->isChecked()); //Hiding/showing the main menu bar depending on the retrieved conf - main_menu_mb->setVisible(confs[Attributes::Configuration][Attributes::SHOW_MAIN_MENU]==Attributes::True); + main_menu_mb->setVisible(confs[Attributes::Configuration][Attributes::ShowMainMenu]==Attributes::True); if(main_menu_mb->isVisible()) file_menu->addAction(action_hide_main_menu); @@ -658,7 +658,7 @@ void MainWindow::closeEvent(QCloseEvent *event) confs=conf_wgt->getConfigurationParams(); attribs[Attributes::CompactView]=action_compact_view->isChecked() ? Attributes::True : QString(); - attribs[Attributes::SHOW_MAIN_MENU]=main_menu_mb->isVisible() ? Attributes::True : QString(); + attribs[Attributes::ShowMainMenu]=main_menu_mb->isVisible() ? Attributes::True : QString(); conf_wgt->addConfigurationParam(Attributes::Configuration, attribs); attribs.clear(); @@ -1147,8 +1147,8 @@ void MainWindow::setGridOptions(void) action_show_delimiters->isChecked()); attribs[Attributes::Configuration][Attributes::AlignObjsToGrid] = (action_alin_objs_grade->isChecked() ? Attributes::True : Attributes::False); - attribs[Attributes::Configuration][Attributes::SHOW_CANVAS_GRID] = (action_show_grid->isChecked() ? Attributes::True : Attributes::False); - attribs[Attributes::Configuration][Attributes::SHOW_PAGE_DELIMITERS] = (action_show_delimiters->isChecked() ? Attributes::True : Attributes::False); + attribs[Attributes::Configuration][Attributes::ShowCanvasGrid] = (action_show_grid->isChecked() ? Attributes::True : Attributes::False); + attribs[Attributes::Configuration][Attributes::ShowPageDelimiters] = (action_show_delimiters->isChecked() ? Attributes::True : Attributes::False); if(current_model) { @@ -1832,14 +1832,14 @@ void MainWindow::storeDockWidgetsSettings(void) attribs_map params; params[Attributes::VALIDATOR]=Attributes::True; - params[Attributes::SQL_VALIDATION]=(model_valid_wgt->sql_validation_chk->isChecked() ? Attributes::True : QString()); + params[Attributes::SqlValidation]=(model_valid_wgt->sql_validation_chk->isChecked() ? Attributes::True : QString()); params[Attributes::USE_UNIQUE_NAMES]=(model_valid_wgt->use_tmp_names_chk->isChecked() ? Attributes::True : QString()); params[Attributes::PgSqlVersion]=model_valid_wgt->version_cmb->currentText(); conf_wgt->addConfigurationParam(Attributes::VALIDATOR, params); params.clear(); params[Attributes::ObjectFinder]=Attributes::True; - params[Attributes::SELECT_OBJECTS]=(obj_finder_wgt->select_btn->isChecked() ? Attributes::True : QString()); + params[Attributes::SelectObjects]=(obj_finder_wgt->select_btn->isChecked() ? Attributes::True : QString()); params[Attributes::FadeInObjects]=(obj_finder_wgt->fade_btn->isChecked() ? Attributes::True : QString()); params[Attributes::RegularExp]=(obj_finder_wgt->regexp_chk->isChecked() ? Attributes::True : QString()); params[Attributes::CaseSensitive]=(obj_finder_wgt->case_sensitive_chk->isChecked() ? Attributes::True : QString()); @@ -1847,10 +1847,10 @@ void MainWindow::storeDockWidgetsSettings(void) conf_wgt->addConfigurationParam(Attributes::ObjectFinder, params); params.clear(); - params[Attributes::SQL_TOOL]=Attributes::True; - params[Attributes::SHOW_ATTRIBUTES_GRID]=(sql_tool_wgt->attributes_tb->isChecked() ? Attributes::True : QString()); - params[Attributes::SHOW_SOURCE_PANE]=(sql_tool_wgt->source_pane_tb->isChecked() ? Attributes::True : QString()); - conf_wgt->addConfigurationParam(Attributes::SQL_TOOL, params); + params[Attributes::SqlTool]=Attributes::True; + params[Attributes::ShowAttributesGrid]=(sql_tool_wgt->attributes_tb->isChecked() ? Attributes::True : QString()); + params[Attributes::ShowSourcePane]=(sql_tool_wgt->source_pane_tb->isChecked() ? Attributes::True : QString()); + conf_wgt->addConfigurationParam(Attributes::SqlTool, params); params.clear(); } @@ -1861,24 +1861,24 @@ void MainWindow::restoreDockWidgetsSettings(void) if(confs.count(Attributes::VALIDATOR)) { - model_valid_wgt->sql_validation_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::SQL_VALIDATION]==Attributes::True); + model_valid_wgt->sql_validation_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::SqlValidation]==Attributes::True); model_valid_wgt->use_tmp_names_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::USE_UNIQUE_NAMES]==Attributes::True); model_valid_wgt->version_cmb->setCurrentText(confs[Attributes::VALIDATOR][Attributes::PgSqlVersion]); } if(confs.count(Attributes::ObjectFinder)) { - obj_finder_wgt->select_btn->setChecked(confs[Attributes::ObjectFinder][Attributes::SELECT_OBJECTS]==Attributes::True); + obj_finder_wgt->select_btn->setChecked(confs[Attributes::ObjectFinder][Attributes::SelectObjects]==Attributes::True); obj_finder_wgt->fade_btn->setChecked(confs[Attributes::ObjectFinder][Attributes::FadeInObjects]==Attributes::True); obj_finder_wgt->regexp_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::RegularExp]==Attributes::True); obj_finder_wgt->case_sensitive_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::CaseSensitive]==Attributes::True); obj_finder_wgt->exact_match_chk->setChecked(confs[Attributes::ObjectFinder][Attributes::ExactMatch]==Attributes::True); } - if(confs.count(Attributes::SQL_TOOL)) + if(confs.count(Attributes::SqlTool)) { - sql_tool_wgt->attributes_tb->setChecked(confs[Attributes::SQL_TOOL][Attributes::SHOW_ATTRIBUTES_GRID]==Attributes::True); - sql_tool_wgt->source_pane_tb->setChecked(confs[Attributes::SQL_TOOL][Attributes::SHOW_SOURCE_PANE]==Attributes::True); + sql_tool_wgt->attributes_tb->setChecked(confs[Attributes::SqlTool][Attributes::ShowAttributesGrid]==Attributes::True); + sql_tool_wgt->source_pane_tb->setChecked(confs[Attributes::SqlTool][Attributes::ShowSourcePane]==Attributes::True); } } diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index dfa088934e..5c0024a9e4 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -321,12 +321,12 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) xml_differs=object->isCodeDiffersFrom(aux_object, { Attributes::MaxObjCount, Attributes::Protected, - Attributes::SQL_DISABLED, + Attributes::SqlDisabled, Attributes::RectVisible, Attributes::FillColor, Attributes::FadedOut, Attributes::HideExtAttribs}, - { Attributes::ROLE, + { Attributes::Role, Attributes::TABLESPACE, Attributes::Collation, Attributes::Position, @@ -886,9 +886,9 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[Attributes::ConstrDefs]=QString(); attribs[Attributes::FkDefs]=QString(); attribs[Attributes::UNSET_PERMS]=unset_perms; - attribs[Attributes::SET_PERMS]=set_perms; + attribs[Attributes::SetPerms]=set_perms; attribs[Attributes::Function]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? Attributes::True : QString()); - attribs[Attributes::SEARCH_PATH]=(has_diffs ? sch_names.join(',') : QString()); + attribs[Attributes::SearchPath]=(has_diffs ? sch_names.join(',') : QString()); ritr=drop_objs.rbegin(); ritr_end=drop_objs.rend(); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 8e780e5bb0..fa9787c37e 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -24,7 +24,7 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob QFrame *frame=nullptr; QCheckBox *check=nullptr; unsigned i; - QString privs[]={ Attributes::SELECT_PRIV, Attributes::InsertPriv, + QString privs[]={ Attributes::SelectPriv, Attributes::InsertPriv, Attributes::UPDATE_PRIV, Attributes::DeletePriv, Attributes::TRUNCATE_PRIV, Attributes::ReferencesPriv, Attributes::TRIGGER_PRIV, Attributes::CreatePriv, diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index b53b586e96..e5b4442c9a 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -214,7 +214,7 @@ void RelationshipConfigWidget::fillNamePatterns(void) pk_col_pattern_txt }; QList pattern_ids={ Attributes::PkPattern, Attributes::UQ_PATTERN, - Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, + Attributes::SrcColPattern, Attributes::DstColPattern, Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, Attributes::PkColPattern }; @@ -254,7 +254,7 @@ void RelationshipConfigWidget::updatePattern(void) QString rel_type=rel_type_cmb->currentData().toString(); map inputs_map={ { pk_pattern_txt, Attributes::PkPattern }, { uq_pattern_txt, Attributes::UQ_PATTERN }, - { src_col_pattern_txt, Attributes::SRC_COL_PATTERN }, + { src_col_pattern_txt, Attributes::SrcColPattern }, { dst_col_pattern_txt, Attributes::DstColPattern }, { src_fk_pattern_txt, Attributes::SRC_FK_PATTERN }, { dst_fk_pattern_txt, Attributes::DstFkPattern }, diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 981cbaef43..2ef627799b 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -521,7 +521,7 @@ void RelationshipWidget::usePatternGlobalSettings(bool value) src_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_FK_PATTERN]); dst_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::DstFkPattern]); uq_pattern_txt->setPlainText(confs[rel_type][Attributes::UQ_PATTERN]); - src_col_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_COL_PATTERN]); + src_col_pattern_txt->setPlainText(confs[rel_type][Attributes::SrcColPattern]); dst_col_pattern_txt->setPlainText(confs[rel_type][Attributes::DstColPattern]); pk_col_pattern_txt->setPlainText(confs[rel_type][Attributes::PkColPattern]); } diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index ac3d1cd70b..4b8a48f0db 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -451,7 +451,7 @@ void SnippetsConfigWidget::saveConfiguration(void) snippet_sch=root_dir + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - Attributes::SNIPPET + + Attributes::Snippet + GlobalAttributes::SchemaExt; attribs_map attribs; @@ -466,7 +466,7 @@ void SnippetsConfigWidget::saveConfiguration(void) for(auto &snip : snippets) { - attribs[Attributes::SNIPPET]+= + attribs[Attributes::Snippet]+= schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(snippet_sch, snip)); } } diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index bf44a0020f..17ab2b6020 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -532,7 +532,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) regexp.setPatternSyntax(QRegExp::FixedString); if(expr_type.isEmpty() || - expr_type==Attributes::SIMPLE_EXP || + expr_type==Attributes::SimpleExp || expr_type==Attributes::InitialExp) initial_exprs[group].push_back(regexp); else diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index a4cec9c82b..f44f6cf81d 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1498,9 +1498,9 @@ bool PgModelerCli::containsRelAttributes(const QString &str) Attributes::Columns, Attributes::Column, Attributes::Constraint, Attributes::Label, Attributes::Line, Attributes::Position, Attributes::Identifier, Attributes::Deferrable, Attributes::DeferType, - Attributes::TABLE_NAME, Attributes::SPECIAL_PK_COLS, Attributes::TABLE, + Attributes::TABLE_NAME, Attributes::SpecialPkCols, Attributes::TABLE, Attributes::AncestorTable, Attributes::CopyOptions, Attributes::CopyMode, - Attributes::SRC_COL_PATTERN, Attributes::DstColPattern, Attributes::PkPattern, + Attributes::SrcColPattern, Attributes::DstColPattern, Attributes::PkPattern, Attributes::UQ_PATTERN, Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern }; for(unsigned i=0; i < attribs.size() && !found; i++) From 4729f33549f0b6a2f47c4aeb8a97ebd47eb70f57 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 11:13:58 -0300 Subject: [PATCH 187/425] Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/basetableview.cpp | 8 +- libobjrenderer/src/graphicalview.cpp | 2 +- libobjrenderer/src/tabletitleview.cpp | 6 +- libobjrenderer/src/tableview.cpp | 2 +- libparsers/src/attributes.cpp | 100 ++++----- libparsers/src/attributes.h | 100 ++++----- libpgconnector/src/catalog.cpp | 10 +- libpgmodeler/src/aggregate.cpp | 14 +- libpgmodeler/src/baseobject.cpp | 8 +- libpgmodeler/src/baserelationship.cpp | 20 +- libpgmodeler/src/basetable.cpp | 2 +- libpgmodeler/src/column.cpp | 20 +- libpgmodeler/src/constraint.cpp | 12 +- libpgmodeler/src/conversion.cpp | 4 +- libpgmodeler/src/databasemodel.cpp | 204 +++++++++--------- libpgmodeler/src/domain.cpp | 6 +- libpgmodeler/src/eventtrigger.cpp | 2 +- libpgmodeler/src/function.cpp | 4 +- libpgmodeler/src/index.cpp | 14 +- libpgmodeler/src/language.cpp | 4 +- libpgmodeler/src/operatorclass.cpp | 6 +- libpgmodeler/src/operatorclasselement.cpp | 14 +- libpgmodeler/src/parameter.cpp | 2 +- libpgmodeler/src/permission.cpp | 12 +- libpgmodeler/src/pgsqltypes.cpp | 4 +- libpgmodeler/src/policy.cpp | 2 +- libpgmodeler/src/reference.cpp | 4 +- libpgmodeler/src/relationship.cpp | 14 +- libpgmodeler/src/role.cpp | 6 +- libpgmodeler/src/rule.cpp | 4 +- libpgmodeler/src/sequence.cpp | 12 +- libpgmodeler/src/table.cpp | 8 +- libpgmodeler/src/tableobject.cpp | 2 +- libpgmodeler/src/tag.cpp | 16 +- libpgmodeler/src/trigger.cpp | 14 +- libpgmodeler/src/type.cpp | 30 +-- libpgmodeler/src/typeattribute.cpp | 2 +- libpgmodeler/src/view.cpp | 4 +- .../src/appearanceconfigwidget.cpp | 14 +- .../src/databaseexplorerwidget.cpp | 114 +++++----- libpgmodeler_ui/src/databaseimporthelper.cpp | 104 ++++----- libpgmodeler_ui/src/datamanipulationform.cpp | 20 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 6 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 8 +- libpgmodeler_ui/src/permissionwidget.cpp | 6 +- .../src/relationshipconfigwidget.cpp | 6 +- libpgmodeler_ui/src/relationshipwidget.cpp | 2 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 2 +- libpgmodeler_ui/src/tagwidget.cpp | 24 +-- main-cli/src/pgmodelercli.cpp | 12 +- 50 files changed, 508 insertions(+), 508 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index e3e63c96bf..17149dc4a4 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -320,12 +320,12 @@ void BaseTableView::configureTag(void) QPolygonF pol; QPointF p1, p2; double bottom; - QFont fnt=BaseObjectView::getFontStyle(Attributes::TAG).font(); + QFont fnt=BaseObjectView::getFontStyle(Attributes::Tag).font(); fnt.setPointSizeF(fnt.pointSizeF() * 0.80f); tag_name->setFont(fnt); tag_name->setText(tag->getName()); - tag_name->setBrush(BaseObjectView::getFontStyle(Attributes::TAG).foreground()); + tag_name->setBrush(BaseObjectView::getFontStyle(Attributes::Tag).foreground()); p1=tag_name->boundingRect().topLeft(); p2=tag_name->boundingRect().bottomRight(); @@ -339,8 +339,8 @@ void BaseTableView::configureTag(void) pol.append(QPointF(p1.x()-BaseObjectView::HorizSpacing, p2.y() + BaseObjectView::VertSpacing)); tag_body->setPolygon(pol); - tag_body->setPen(BaseObjectView::getBorderStyle(Attributes::TAG)); - tag_body->setBrush(BaseObjectView::getFillStyle(Attributes::TAG)); + tag_body->setPen(BaseObjectView::getBorderStyle(Attributes::Tag)); + tag_body->setBrush(BaseObjectView::getFillStyle(Attributes::Tag)); tag_name->setPos(-5, bottom - 1.5f); tag_body->setPos(-5, bottom - 1.5f); diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index a300c2a7d8..c8fa5e27d1 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -41,7 +41,7 @@ void GraphicalView::configureObject(void) QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; QString attribs[]={ Attributes::VIEW_BODY, Attributes::VIEW_EXT_BODY }, - tag_attribs[]={ Attributes::TABLE_BODY, Attributes::TABLE_EXT_BODY }; + tag_attribs[]={ Attributes::TableBody, Attributes::TableExtBody }; double width, type_width=0, px=0; TableObjectView *col_item=nullptr; QList col_items; diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 894351e14f..5b26c76743 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -75,9 +75,9 @@ void TableTitleView::configureObject(BaseGraphicObject *object) } else { - name_attrib=Attributes::TABLE_NAME; - schema_name_attrib=Attributes::TABLE_SCHEMA_NAME; - title_color_attrib=Attributes::TABLE_TITLE; + name_attrib=Attributes::TableName; + schema_name_attrib=Attributes::TableSchemaName; + title_color_attrib=Attributes::TableTitle; } //Strike out the table name when its sql is disabled diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 48cefa924d..3a03e5599a 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -37,7 +37,7 @@ void TableView::configureObject(void) QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; vector tab_objs; - QString atribs[]={ Attributes::TABLE_BODY, Attributes::TABLE_EXT_BODY }; + QString atribs[]={ Attributes::TableBody, Attributes::TableExtBody }; Tag *tag=table->getTag(); //Configures the table title diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 37dd06f8ff..9462b2caf7 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -489,59 +489,59 @@ namespace Attributes { SqlValidation=QString("sql-validation"), SqlTool=QString("sqltool"), SrcColPattern=QString("src-col-pattern"), - SRC_COLUMNS=QString("src-columns"), - SRC_ENCODING=QString("src-encoding"), - SRC_FK_PATTERN=QString("src-fk-pattern"), - SRC_LABEL=QString("src-label"), - SRC_REQUIRED=QString("src-required"), - SRC_TABLE=QString("src-table"), - SRID=QString("srid"), - SSL=QString("ssl"), - SSL_CA_FILE=QString("ssl-ca-file"), - SSL_CERT_FILE=QString("ssl-cert-file"), - SSL_CRL_FILE=QString("ssl-crl-file"), - SSL_KEY_FILE=QString("ssl-key-file"), - START=QString("start"), - STATE_TYPE=QString("state-type"), - STORAGE_PARAMS=QString("stg-params"), - STORAGE=QString("storage"), - STRATEGY_NUM=QString("stg-number"), - STYLE=QString("style"), - STYLES=QString("styles"), - SUBTYPE_DIFF_FUNC=QString("subtypediff"), - SUBTYPE=QString("subtype"), - SUPERUSER=QString("superuser"), - SYMBOL=QString("symbol"), - TABLE_BODY=QString("table-body"), - TABLE_EXT_BODY=QString("table-ext-body"), - TABLE_NAME=QString("table-name"), - TABLE_OBJECT=QString("table-obj"), - TABLE_SCHEMA_NAME=QString("table-schema-name"), - TABLE_TITLE=QString("table-title"), - TABLE_TYPE=QString("table-type"), - TABLE=QString("table"), - TABLESPACE=QString("tablespace"), - TAG=QString("tag"), - TEMPLATE_DB=QString("template"), - TEMPORARY_PRIV=QString("temporary"), - TOP=QString("top"), - TPMOD_IN_FUNC=QString("tpmodin"), - TPMOD_OUT_FUNC=QString("tpmodout"), - TRANSITION_FUNC=QString("transition"), - TRIGGER_FUNC=QString("trigger-func"), - TRIGGER_PRIV=QString("trigger"), - TRIGGERS=QString("triggers"), - TRUNC_EVENT=QString("trunc-event"), - TRUNCATE_CMDS=QString("truncate-cmds"), - TRUNCATE_PRIV=QString("truncate"), - TRUNCATE=QString("truncate"), - TRUSTED=QString("trusted"), + SrcColumns=QString("src-columns"), + SrcEncoding=QString("src-encoding"), + SrcFkPattern=QString("src-fk-pattern"), + SrcLabel=QString("src-label"), + SrcRequired=QString("src-required"), + SrcTable=QString("src-table"), + Srid=QString("srid"), + Ssl=QString("ssl"), + SslCaFile=QString("ssl-ca-file"), + SslCertFile=QString("ssl-cert-file"), + SslCrlFile=QString("ssl-crl-file"), + SslKeyFile=QString("ssl-key-file"), + Start=QString("start"), + StateType=QString("state-type"), + StorageParams=QString("stg-params"), + Storage=QString("storage"), + StrategyNum=QString("stg-number"), + Style=QString("style"), + Styles=QString("styles"), + SubtypeDiffFunc=QString("subtypediff"), + Subtype=QString("subtype"), + Superuser=QString("superuser"), + Symbol=QString("symbol"), + TableBody=QString("table-body"), + TableExtBody=QString("table-ext-body"), + TableName=QString("table-name"), + TableObject=QString("table-obj"), + TableSchemaName=QString("table-schema-name"), + TableTitle=QString("table-title"), + TableType=QString("table-type"), + Table=QString("table"), + Tablespace=QString("tablespace"), + Tag=QString("tag"), + TemplateDb=QString("template"), + TemporaryPriv=QString("temporary"), + Top=QString("top"), + TpmodInFunc=QString("tpmodin"), + TpmodOutFunc=QString("tpmodout"), + TransitionFunc=QString("transition"), + TriggerFunc=QString("trigger-func"), + TriggerPriv=QString("trigger"), + Triggers=QString("triggers"), + TruncEvent=QString("trunc-event"), + TruncateCmds=QString("truncate-cmds"), + TruncatePriv=QString("truncate"), + Truncate=QString("truncate"), + Trusted=QString("trusted"), TUPLES_DEL=QString("tuples-del"), TUPLES_UPD=QString("tuples-upd"), TUPLES_INS=QString("tuples-ins"), - TYPE_ATTRIBUTE=QString("typeattrib"), - TYPE_OID=QString("type-oid"), - TYPE=QString("type"), + TypeAttribute=QString("typeattrib"), + TypeOid=QString("type-oid"), + Type=QString("type"), TYPES=QString("types"), TYPE_CLASS=QString("type-class"), UI_LANGUAGE=QString("ui-language"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index ed86270116..a03e7c9fdd 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -498,56 +498,56 @@ namespace Attributes { SqlValidation, SqlTool, SrcColPattern, - SRC_COLUMNS, - SRC_ENCODING, - SRC_FK_PATTERN, - SRC_LABEL, - SRC_REQUIRED, - SRC_TABLE, - SRID, - SSL, - SSL_CA_FILE, - SSL_CERT_FILE, - SSL_CRL_FILE, - SSL_KEY_FILE, - START, - STATE_TYPE, - STORAGE_PARAMS, - STORAGE, - STRATEGY_NUM, - STYLE, - STYLES, - SUBTYPE_DIFF_FUNC, - SUBTYPE, - SUPERUSER, - SYMBOL, - TABLE_BODY, - TABLE_EXT_BODY, - TABLE_NAME, - TABLE_OBJECT, - TABLE_SCHEMA_NAME, - TABLE_TITLE, - TABLE, - TABLE_TYPE, - TABLESPACE, - TAG, - TEMPLATE_DB, - TEMPORARY_PRIV, - TOP, - TPMOD_IN_FUNC, - TPMOD_OUT_FUNC, - TRANSITION_FUNC, - TRIGGER_FUNC, - TRIGGER_PRIV, - TRIGGERS, - TRUNC_EVENT, - TRUNCATE_CMDS, - TRUNCATE_PRIV, - TRUNCATE, - TRUSTED, - TYPE_ATTRIBUTE, - TYPE_OID, - TYPE, + SrcColumns, + SrcEncoding, + SrcFkPattern, + SrcLabel, + SrcRequired, + SrcTable, + Srid, + Ssl, + SslCaFile, + SslCertFile, + SslCrlFile, + SslKeyFile, + Start, + StateType, + StorageParams, + Storage, + StrategyNum, + Style, + Styles, + SubtypeDiffFunc, + Subtype, + Superuser, + Symbol, + TableBody, + TableExtBody, + TableName, + TableObject, + TableSchemaName, + TableTitle, + Table, + TableType, + Tablespace, + Tag, + TemplateDb, + TemporaryPriv, + Top, + TpmodInFunc, + TpmodOutFunc, + TransitionFunc, + TriggerFunc, + TriggerPriv, + Triggers, + TruncEvent, + TruncateCmds, + TruncatePriv, + Truncate, + Trusted, + TypeAttribute, + TypeOid, + Type, TYPES, TYPE_CLASS, UI_LANGUAGE, diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 0159945de7..14ee57597a 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -266,7 +266,7 @@ unsigned Catalog::getObjectCount(ObjectType obj_type, const QString &sch_name, c ResultSet res; extra_attribs[Attributes::Schema]=sch_name; - extra_attribs[Attributes::TABLE]=tab_name; + extra_attribs[Attributes::Table]=tab_name; executeCatalogQuery(QueryList, obj_type, res, false, extra_attribs); res.accessTuple(ResultSet::FirstTuple); @@ -334,7 +334,7 @@ attribs_map Catalog::getObjectsNames(ObjectType obj_type, const QString &sch_nam attribs_map objects; extra_attribs[Attributes::Schema]=sch_name; - extra_attribs[Attributes::TABLE]=tab_name; + extra_attribs[Attributes::Table]=tab_name; executeCatalogQuery(QueryList, obj_type, res, false, extra_attribs); if(res.accessTuple(ResultSet::FirstTuple)) @@ -365,7 +365,7 @@ vector Catalog::getObjectsNames(vector obj_types, const attribs_map attribs; extra_attribs[Attributes::Schema]=sch_name; - extra_attribs[Attributes::TABLE]=tab_name; + extra_attribs[Attributes::Table]=tab_name; for(ObjectType obj_type : obj_types) { @@ -594,7 +594,7 @@ vector Catalog::getObjectsAttributes(ObjectType obj_type, const QSt obj_type==ObjectType::Language || obj_type==ObjectType::Cast); extra_attribs[Attributes::Schema]=schema; - extra_attribs[Attributes::TABLE]=table; + extra_attribs[Attributes::Table]=table; if(!filter_oids.empty()) extra_attribs[Attributes::FilterOids]=createOidFilter(filter_oids); @@ -635,7 +635,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS attribs[Attributes::CustomFilter] = QString("%1 = E'%2'").arg(name_fields[obj_type]).arg(name); attribs[Attributes::Schema] = schema; - attribs[Attributes::TABLE] = table; + attribs[Attributes::Table] = table; executeCatalogQuery(QueryList, obj_type, res, false, attribs); if(res.getTupleCount() > 1) diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index ecafadc53e..d265d0c008 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -24,8 +24,8 @@ Aggregate::Aggregate(void) functions[0]=functions[1]=nullptr; sort_operator=nullptr; attributes[Attributes::TYPES]=QString(); - attributes[Attributes::TRANSITION_FUNC]=QString(); - attributes[Attributes::STATE_TYPE]=QString(); + attributes[Attributes::TransitionFunc]=QString(); + attributes[Attributes::StateType]=QString(); attributes[Attributes::BaseType]=QString(); attributes[Attributes::FinalFunc]=QString(); attributes[Attributes::InitialCond]=QString(); @@ -229,12 +229,12 @@ QString Aggregate::getCodeDefinition(unsigned def_type) if(functions[TransitionFunc]) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::TRANSITION_FUNC]=functions[TransitionFunc]->getSignature(); + attributes[Attributes::TransitionFunc]=functions[TransitionFunc]->getSignature(); else { functions[TransitionFunc]->setAttribute(Attributes::RefType, - Attributes::TRANSITION_FUNC); - attributes[Attributes::TRANSITION_FUNC]=functions[TransitionFunc]->getCodeDefinition(def_type,true); + Attributes::TransitionFunc); + attributes[Attributes::TransitionFunc]=functions[TransitionFunc]->getCodeDefinition(def_type,true); } } @@ -262,9 +262,9 @@ QString Aggregate::getCodeDefinition(unsigned def_type) attributes[Attributes::InitialCond]=initial_condition; if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::STATE_TYPE]=*(state_type); + attributes[Attributes::StateType]=*(state_type); else - attributes[Attributes::STATE_TYPE]=state_type.getCodeDefinition(def_type,Attributes::STATE_TYPE); + attributes[Attributes::StateType]=state_type.getCodeDefinition(def_type,Attributes::StateType); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index e5cdcb8ac0..0883c46e73 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -86,7 +86,7 @@ BaseObject::BaseObject(void) attributes[Attributes::Alias]=QString(); attributes[Attributes::Comment]=QString(); attributes[Attributes::Owner]=QString(); - attributes[Attributes::TABLESPACE]=QString(); + attributes[Attributes::Tablespace]=QString(); attributes[Attributes::Schema]=QString(); attributes[Attributes::Collation]=QString(); attributes[Attributes::Protected]=QString(); @@ -729,9 +729,9 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) if(tablespace) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::TABLESPACE]=tablespace->getName(format); + attributes[Attributes::Tablespace]=tablespace->getName(format); else - attributes[Attributes::TABLESPACE]=tablespace->getCodeDefinition(def_type, true); + attributes[Attributes::Tablespace]=tablespace->getCodeDefinition(def_type, true); } if(collation && attributes[Attributes::Collation].isEmpty()) @@ -1193,7 +1193,7 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff try { - QStringList attribs={ Attributes::Owner, Attributes::Schema, Attributes::TABLESPACE }; + QStringList attribs={ Attributes::Owner, Attributes::Schema, Attributes::Tablespace }; bool accepts_obj[3]={ acceptsOwner(), acceptsSchema(), acceptsTablespace() }; BaseObject *dep_objs[3]={ this->getOwner(), this->getSchema(), this->getTablespace() }, *aux_dep_objs[3]={ object->getOwner(), object->getSchema(), object->getTablespace() }; diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index a817689aa2..2c951e6da7 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -77,10 +77,10 @@ void BaseRelationship::configureRelationship(void) { obj_type=ObjectType::BaseRelationship; - attributes[Attributes::TYPE]=QString(); - attributes[Attributes::SRC_REQUIRED]=QString(); + attributes[Attributes::Type]=QString(); + attributes[Attributes::SrcRequired]=QString(); attributes[Attributes::DstRequired]=QString(); - attributes[Attributes::SRC_TABLE]=QString(); + attributes[Attributes::SrcTable]=QString(); attributes[Attributes::DstTable]=QString(); attributes[Attributes::Points]=QString(); attributes[Attributes::Columns]=QString(); @@ -90,7 +90,7 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::ReducedForm]=QString(); attributes[Attributes::Deferrable]=QString(); attributes[Attributes::DeferType]=QString(); - attributes[Attributes::TABLE_NAME]=QString(); + attributes[Attributes::TableName]=QString(); attributes[Attributes::SpecialPkCols]=QString(); attributes[Attributes::RelationshipNn]=QString(); attributes[Attributes::RelationshipGen]=QString(); @@ -99,7 +99,7 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::Relationship1n]=QString(); attributes[Attributes::Relationship11]=QString(); attributes[Attributes::Constraints]=QString(); - attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Table]=QString(); attributes[Attributes::AncestorTable]=QString(); attributes[Attributes::CopyOptions]=QString(); attributes[Attributes::CopyMode]=QString(); @@ -107,7 +107,7 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::DstColPattern]=QString(); attributes[Attributes::PkPattern]=QString(); attributes[Attributes::UQ_PATTERN]=QString(); - attributes[Attributes::SRC_FK_PATTERN]=QString(); + attributes[Attributes::SrcFkPattern]=QString(); attributes[Attributes::DstFkPattern]=QString(); attributes[Attributes::PkColPattern]=QString(); attributes[Attributes::SinglePkColumn]=QString(); @@ -328,17 +328,17 @@ void BaseRelationship::setRelationshipAttributes(void) { unsigned count, i; QString str_aux, - label_attribs[3]={ Attributes::SRC_LABEL, + label_attribs[3]={ Attributes::SrcLabel, Attributes::DstLabel, Attributes::NameLabel}; - attributes[Attributes::TYPE]=getRelTypeAttribute(); - attributes[Attributes::SRC_REQUIRED]=(src_mandatory ? Attributes::True : QString()); + attributes[Attributes::Type]=getRelTypeAttribute(); + attributes[Attributes::SrcRequired]=(src_mandatory ? Attributes::True : QString()); attributes[Attributes::DstRequired]=(dst_mandatory ? Attributes::True : QString()); if(src_table) - attributes[Attributes::SRC_TABLE]=src_table->getName(true); + attributes[Attributes::SrcTable]=src_table->getName(true); if(dst_table) attributes[Attributes::DstTable]=dst_table->getName(true); diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 5df46f647c..f78b938dd2 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -22,7 +22,7 @@ BaseTable::BaseTable(void) { tag=nullptr; obj_type=ObjectType::BaseTable; - attributes[Attributes::TAG]=QString(); + attributes[Attributes::Tag]=QString(); attributes[Attributes::HideExtAttribs]=QString(); attributes[Attributes::MaxObjCount]=QString(); hide_ext_attribs=false; diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index c098ca6767..c819331fc9 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -22,17 +22,17 @@ Column::Column(void) { obj_type=ObjectType::Column; not_null=seq_cycle=false; - attributes[Attributes::TYPE]=QString(); + attributes[Attributes::Type]=QString(); attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::NotNull]=QString(); - attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Table]=QString(); attributes[Attributes::Sequence]=QString(); attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::IdentityType]=QString(); attributes[Attributes::Increment]=QString(); attributes[Attributes::MinValue]=QString(); attributes[Attributes::MaxValue]=QString(); - attributes[Attributes::START]=QString(); + attributes[Attributes::Start]=QString(); attributes[Attributes::Cache]=QString(); attributes[Attributes::Cycle]=QString(); @@ -238,9 +238,9 @@ QString Column::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); if(getParentTable()) - attributes[Attributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::Table]=getParentTable()->getName(true); - attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); + attributes[Attributes::Type]=type.getCodeDefinition(def_type); attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::IdentityType]=QString(); @@ -250,7 +250,7 @@ QString Column::getCodeDefinition(unsigned def_type) attributes[Attributes::Increment]=seq_increment; attributes[Attributes::MinValue]=seq_min_value; attributes[Attributes::MaxValue]=seq_max_value; - attributes[Attributes::START]=seq_start; + attributes[Attributes::Start]=seq_start; attributes[Attributes::Cache]=seq_cache; attributes[Attributes::Cycle]=(seq_cycle ? Attributes::True : QString()); } @@ -290,13 +290,13 @@ QString Column::getAlterDefinition(BaseObject *object) BaseObject::setBasicAttributes(true); if(getParentTable()) - attribs[Attributes::TABLE]=getParentTable()->getName(true); + attribs[Attributes::Table]=getParentTable()->getName(true); if(!this->type.isEquivalentTo(col->type) || (this->type.isEquivalentTo(col->type) && ((this->type.hasVariableLength() && (this->type.getLength()!=col->type.getLength())) || (this->type.acceptsPrecision() && (this->type.getPrecision()!=col->type.getPrecision()))))) - attribs[Attributes::TYPE]=col->type.getCodeDefinition(SchemaParser::SqlDefinition); + attribs[Attributes::Type]=col->type.getCodeDefinition(SchemaParser::SqlDefinition); if(col->sequence) def_val=QString("nextval('%1'::regclass)").arg(col->sequence->getSignature()); @@ -322,7 +322,7 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[Attributes::CurIdentityType] = QString(); attribs[Attributes::MinValue] = QString(); attribs[Attributes::MaxValue] = QString(); - attribs[Attributes::START] = QString(); + attribs[Attributes::Start] = QString(); attribs[Attributes::Increment] = QString(); attribs[Attributes::Cache] = QString(); attribs[Attributes::Cycle] = QString(); @@ -344,7 +344,7 @@ QString Column::getAlterDefinition(BaseObject *object) if(!col->seq_start.isEmpty() && this->seq_start != col->seq_start) { - attribs[Attributes::START] = col->seq_start; + attribs[Attributes::Start] = col->seq_start; ident_seq_changed = true; } diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 9bbd08c91c..443753d64b 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -33,17 +33,17 @@ Constraint::Constraint(void) attributes[Attributes::UQ_CONSTR]=QString(); attributes[Attributes::ExConstr]=QString(); attributes[Attributes::RefTable]=QString(); - attributes[Attributes::SRC_COLUMNS]=QString(); + attributes[Attributes::SrcColumns]=QString(); attributes[Attributes::DstColumns]=QString(); attributes[Attributes::DelAction]=QString(); attributes[Attributes::UPD_ACTION]=QString(); attributes[Attributes::Expression]=QString(); - attributes[Attributes::TYPE]=QString(); + attributes[Attributes::Type]=QString(); attributes[Attributes::ComparisonType]=QString(); attributes[Attributes::DeferType]=QString(); attributes[Attributes::IndexType]=QString(); attributes[Attributes::Deferrable]=QString(); - attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Table]=QString(); attributes[Attributes::DeclInTable]=QString(); attributes[Attributes::Factor]=QString(); attributes[Attributes::NoInherit]=QString(); @@ -202,7 +202,7 @@ void Constraint::setColumnsAttribute(unsigned col_type, unsigned def_type, bool else { col_vector=&columns; - attrib=Attributes::SRC_COLUMNS; + attrib=Attributes::SrcColumns; } count=col_vector->size(); @@ -689,7 +689,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) } attributes[attrib]=Attributes::True; - attributes[Attributes::TYPE]=attrib; + attributes[Attributes::Type]=attrib; attributes[Attributes::UPD_ACTION]=(~upd_action); attributes[Attributes::DelAction]=(~del_action); attributes[Attributes::Expression]=expression; @@ -718,7 +718,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[Attributes::IndexType]=(~ index_type); if(getParentTable()) - attributes[Attributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::Table]=getParentTable()->getName(true); setDeclInTableAttribute(); diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index 92509e56f4..6d1e693e30 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -24,7 +24,7 @@ Conversion::Conversion(void) conversion_func=nullptr; is_default=false; attributes[Attributes::Default]=QString(); - attributes[Attributes::SRC_ENCODING]=QString(); + attributes[Attributes::SrcEncoding]=QString(); attributes[Attributes::DstEncoding]=QString(); attributes[Attributes::Function]=QString(); } @@ -116,7 +116,7 @@ QString Conversion::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); attributes[Attributes::Default]=(is_default ? Attributes::True : QString()); - attributes[Attributes::SRC_ENCODING]=(~encodings[SrcEncoding]); + attributes[Attributes::SrcEncoding]=(~encodings[SrcEncoding]); attributes[Attributes::DstEncoding]=(~encodings[DstEncoding]); if(conversion_func) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 432eb0ce9b..149ddb9074 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -42,7 +42,7 @@ DatabaseModel::DatabaseModel(void) last_zoom=1; loading_model=invalidated=append_at_eod=prepend_at_bod=false; attributes[Attributes::Encoding]=QString(); - attributes[Attributes::TEMPLATE_DB]=QString(); + attributes[Attributes::TemplateDb]=QString(); attributes[Attributes::ConnLimit]=QString(); attributes[Attributes::LcCollate]=QString(); attributes[Attributes::LcCtype]=QString(); @@ -2966,7 +2966,7 @@ int DatabaseModel::getObjectIndex(BaseObject *object) void DatabaseModel::configureDatabase(attribs_map &attribs) { encoding=attribs[Attributes::Encoding]; - template_db=attribs[Attributes::TEMPLATE_DB]; + template_db=attribs[Attributes::TemplateDb]; localizations[0]=attribs[Attributes::LcCtype]; localizations[1]=attribs[Attributes::LcCollate]; append_at_eod=attribs[Attributes::AppendAtEod]==Attributes::True; @@ -3285,7 +3285,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) has_error=(!schema && !attribs_aux[Attributes::Name].isEmpty()); } //Defines the object's tablespace - else if(elem_name==Attributes::TABLESPACE) + else if(elem_name==Attributes::Tablespace) { obj_type=ObjectType::Tablespace; xmlparser.getElementAttributes(attribs_aux); @@ -3456,7 +3456,7 @@ Role *DatabaseModel::createRole(void) QString elem_name; unsigned role_type; - QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, + QString op_attribs[]={ Attributes::Superuser, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, Attributes::Login, Attributes::Encrypted, Attributes::Replication, Attributes::BypassRls }; @@ -3604,7 +3604,7 @@ Language *DatabaseModel::createLanguage(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(lang); - lang->setTrusted(attribs[Attributes::TRUSTED]==Attributes::True); + lang->setTrusted(attribs[Attributes::Trusted]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -3732,7 +3732,7 @@ Function *DatabaseModel::createFunction(void) if(xmlparser.getElementType()==XML_ELEMENT_NODE) { //when the element found is a TYPE indicates that the function return type is a single one - if(xmlparser.getElementName()==Attributes::TYPE) + if(xmlparser.getElementName()==Attributes::Type) { type=createPgSQLType(); func->setReturnType(type); @@ -3787,7 +3787,7 @@ Function *DatabaseModel::createFunction(void) if(!attribs_aux[Attributes::Library].isEmpty()) { func->setLibrary(attribs_aux[Attributes::Library]); - func->setSymbol(attribs_aux[Attributes::SYMBOL]); + func->setSymbol(attribs_aux[Attributes::Symbol]); } else if(xmlparser.accessElement(XmlParser::ChildElement)) func->setSourceCode(xmlparser.getElementContent()); @@ -3841,7 +3841,7 @@ Parameter DatabaseModel::createParameter(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::TYPE) + if(elem==Attributes::Type) { param.setType(createPgSQLType()); } @@ -3888,7 +3888,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::TYPE) + if(elem==Attributes::Type) { tpattrib.setType(createPgSQLType()); } @@ -3955,7 +3955,7 @@ PgSqlType DatabaseModel::createPgSQLType(void) if(!attribs[Attributes::SpatialType].isEmpty()) spatial_type=SpatialType(attribs[Attributes::SpatialType], - attribs[Attributes::SRID].toUInt(), + attribs[Attributes::Srid].toUInt(), attribs[Attributes::VARIATION].toUInt()); name=attribs[Attributes::Name]; @@ -4014,8 +4014,8 @@ Type *DatabaseModel::createType(void) if(!attribs[Attributes::Alignment].isEmpty()) type->setAlignment(attribs[Attributes::Alignment]); - if(!attribs[Attributes::STORAGE].isEmpty()) - type->setStorage(attribs[Attributes::STORAGE]); + if(!attribs[Attributes::Storage].isEmpty()) + type->setStorage(attribs[Attributes::Storage]); if(!attribs[Attributes::Element].isEmpty()) type->setElement(attribs[Attributes::Element]); @@ -4037,8 +4037,8 @@ Type *DatabaseModel::createType(void) func_types[Attributes::OutputFunc]=Type::OutputFunc; func_types[Attributes::SendFunc]=Type::SendFunc; func_types[Attributes::RecvFunc]=Type::RecvFunc; - func_types[Attributes::TPMOD_IN_FUNC]=Type::TpmodInFunc; - func_types[Attributes::TPMOD_OUT_FUNC]=Type::TpmodOutFunc; + func_types[Attributes::TpmodInFunc]=Type::TpmodInFunc; + func_types[Attributes::TpmodOutFunc]=Type::TpmodOutFunc; func_types[Attributes::AnalyzeFunc]=Type::AnalyzeFunc; } else if(attribs[Attributes::Configuration]==Attributes::CompositeType) @@ -4049,7 +4049,7 @@ Type *DatabaseModel::createType(void) { type->setConfiguration(Type::RangeType); func_types[Attributes::CanonicalFunc]=Type::CanonicalFunc; - func_types[Attributes::SUBTYPE_DIFF_FUNC]=Type::SubtypeDiffFunc; + func_types[Attributes::SubtypeDiffFunc]=Type::SubtypeDiffFunc; } if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -4071,12 +4071,12 @@ Type *DatabaseModel::createType(void) type->addEnumeration(enums[i]); } //Specific operations for COMPOSITE types - else if(elem==Attributes::TYPE_ATTRIBUTE) + else if(elem==Attributes::TypeAttribute) { type->addAttribute(createTypeAttribute()); } //Specific operations for BASE / RANGE type - else if(elem==Attributes::TYPE) + else if(elem==Attributes::Type) { aux_type=createPgSQLType(); @@ -4194,7 +4194,7 @@ Domain *DatabaseModel::createDomain(void) elem=xmlparser.getElementName(); //If a type element is found it'll be extracted an type which the domain is applied - if(elem==Attributes::TYPE) + if(elem==Attributes::Type) { domain->setType(createPgSQLType()); } @@ -4254,7 +4254,7 @@ Cast *DatabaseModel::createCast(void) elem=xmlparser.getElementName(); //Extract one argument type from the XML - if(elem==Attributes::TYPE) + if(elem==Attributes::Type) { type=createPgSQLType(); if(type_idx==0) @@ -4308,7 +4308,7 @@ Conversion *DatabaseModel::createConversion(void) xmlparser.getElementAttributes(attribs); conv->setEncoding(Conversion::SrcEncoding, - EncodingType(attribs[Attributes::SRC_ENCODING])); + EncodingType(attribs[Attributes::SrcEncoding])); conv->setEncoding(Conversion::DstEncoding, EncodingType(attribs[Attributes::DstEncoding])); @@ -4405,7 +4405,7 @@ Operator *DatabaseModel::createOperator(void) oper->setOperator(dynamic_cast(oper_aux), oper_types[attribs[Attributes::RefType]]); } - else if(elem==Attributes::TYPE) + else if(elem==Attributes::Type) { xmlparser.getElementAttributes(attribs); @@ -4470,7 +4470,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) elem_types[Attributes::Function]=OperatorClassElement::FunctionElem; elem_types[Attributes::Operator]=OperatorClassElement::OperatorElem; - elem_types[Attributes::STORAGE]=OperatorClassElement::StorageElem; + elem_types[Attributes::Storage]=OperatorClassElement::StorageElem; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4496,7 +4496,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) op_class->setFamily(dynamic_cast(object)); } - else if(elem==Attributes::TYPE) + else if(elem==Attributes::Type) { xmlparser.getElementAttributes(attribs); type=createPgSQLType(); @@ -4506,8 +4506,8 @@ OperatorClass *DatabaseModel::createOperatorClass(void) { xmlparser.getElementAttributes(attribs); - stg_number=attribs[Attributes::STRATEGY_NUM].toUInt(); - elem_type=elem_types[attribs[Attributes::TYPE]]; + stg_number=attribs[Attributes::StrategyNum].toUInt(); + elem_type=elem_types[attribs[Attributes::Type]]; xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -4611,12 +4611,12 @@ Aggregate *DatabaseModel::createAggregate(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::TYPE) + if(elem==Attributes::Type) { xmlparser.getElementAttributes(attribs); type=createPgSQLType(); - if(attribs[Attributes::RefType]==Attributes::STATE_TYPE) + if(attribs[Attributes::RefType]==Attributes::StateType) aggreg->setStateType(type); else aggreg->addDataType(type); @@ -4635,7 +4635,7 @@ Aggregate *DatabaseModel::createAggregate(void) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(attribs[Attributes::RefType]==Attributes::TRANSITION_FUNC) + if(attribs[Attributes::RefType]==Attributes::TransitionFunc) aggreg->setFunction(Aggregate::TransitionFunc, dynamic_cast(func)); else @@ -4708,7 +4708,7 @@ Table *DatabaseModel::createTable(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Table)) - .arg(aux_attribs[Attributes::TABLE]) + .arg(aux_attribs[Attributes::Table]) .arg(BaseObject::getTypeName(ObjectType::Tag)) , ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -4752,7 +4752,7 @@ Table *DatabaseModel::createTable(void) else if(elem==Attributes::Partitioning) { xmlparser.getElementAttributes(aux_attribs); - table->setPartitioningType(aux_attribs[Attributes::TYPE]); + table->setPartitioningType(aux_attribs[Attributes::Type]); xmlparser.savePosition(); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -4821,7 +4821,7 @@ Column *DatabaseModel::createColumn(void) column->setNotNull(attribs[Attributes::NotNull]==Attributes::True); column->setDefaultValue(attribs[Attributes::DefaultValue]); column->setIdSeqAttributes(attribs[Attributes::MinValue], attribs[Attributes::MaxValue], attribs[Attributes::Increment], - attribs[Attributes::START], attribs[Attributes::Cache], attribs[Attributes::Cycle] == Attributes::True); + attribs[Attributes::Start], attribs[Attributes::Cache], attribs[Attributes::Cycle] == Attributes::True); if(!attribs[Attributes::IdentityType].isEmpty()) column->setIdentityType(IdentityType(attribs[Attributes::IdentityType])); @@ -4850,7 +4850,7 @@ Column *DatabaseModel::createColumn(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::TYPE) + if(elem==Attributes::Type) { column->setType(createPgSQLType()); } @@ -4906,7 +4906,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) else { obj_type=ObjectType::Table; - table=dynamic_cast
(getObject(attribs[Attributes::TABLE], ObjectType::Table)); + table=dynamic_cast
(getObject(attribs[Attributes::Table], ObjectType::Table)); parent_obj=table; ins_constr_table=true; @@ -4916,7 +4916,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Constraint)) - .arg(attribs[Attributes::TABLE]) + .arg(attribs[Attributes::Table]) .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -4927,13 +4927,13 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr->setParentTable(table); //Configuring the constraint type - if(attribs[Attributes::TYPE]==Attributes::CkConstr) + if(attribs[Attributes::Type]==Attributes::CkConstr) constr_type=ConstraintType::Check; - else if(attribs[Attributes::TYPE]==Attributes::PkConstr) + else if(attribs[Attributes::Type]==Attributes::PkConstr) constr_type=ConstraintType::PrimaryKey; - else if(attribs[Attributes::TYPE]==Attributes::FkConstr) + else if(attribs[Attributes::Type]==Attributes::FkConstr) constr_type=ConstraintType::ForeignKey; - else if(attribs[Attributes::TYPE]==Attributes::UQ_CONSTR) + else if(attribs[Attributes::Type]==Attributes::UQ_CONSTR) constr_type=ConstraintType::Unique; else constr_type=ConstraintType::Exclude; @@ -5025,7 +5025,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) col_list=attribs[Attributes::Names].split(','); count=col_list.count(); - if(attribs[Attributes::RefType]==Attributes::SRC_COLUMNS) + if(attribs[Attributes::RefType]==Attributes::SrcColumns) col_type=Constraint::SourceCols; else col_type=Constraint::ReferencedCols; @@ -5301,10 +5301,10 @@ Index *DatabaseModel::createIndex(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::Table)); + table=dynamic_cast(getObject(attribs[Attributes::Table], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::View)); + table=dynamic_cast(getObject(attribs[Attributes::Table], ObjectType::View)); //Raises an error if the parent table doesn't exists if(!table) @@ -5312,7 +5312,7 @@ Index *DatabaseModel::createIndex(void) str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Index)) - .arg(attribs[Attributes::TABLE]) + .arg(attribs[Attributes::Table]) .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5382,16 +5382,16 @@ Rule *DatabaseModel::createRule(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::Table)); + table=dynamic_cast(getObject(attribs[Attributes::Table], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::View)); + table=dynamic_cast(getObject(attribs[Attributes::Table], ObjectType::View)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Rule)) - .arg(attribs[Attributes::TABLE]) + .arg(attribs[Attributes::Table]) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5461,16 +5461,16 @@ Trigger *DatabaseModel::createTrigger(void) { xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::Table)); + table=dynamic_cast(getObject(attribs[Attributes::Table], ObjectType::Table)); if(!table) - table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::View)); + table=dynamic_cast(getObject(attribs[Attributes::Table], ObjectType::View)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Trigger)) - .arg(attribs[Attributes::TABLE]) + .arg(attribs[Attributes::Table]) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5492,7 +5492,7 @@ Trigger *DatabaseModel::createTrigger(void) (attribs[Attributes::UPD_EVENT]==Attributes::True)); trigger->setEvent(EventType::OnTruncate, - (attribs[Attributes::TRUNC_EVENT]==Attributes::True)); + (attribs[Attributes::TruncEvent]==Attributes::True)); trigger->setExecutePerRow(attribs[Attributes::PerRow]==Attributes::True); @@ -5618,13 +5618,13 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.getElementAttributes(attribs); - table=dynamic_cast(getObject(attribs[Attributes::TABLE], ObjectType::Table)); + table=dynamic_cast(getObject(attribs[Attributes::Table], ObjectType::Table)); if(!table) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Policy)) - .arg(attribs[Attributes::TABLE]) + .arg(attribs[Attributes::Table]) .arg(BaseObject::getTypeName(ObjectType::Table)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5645,9 +5645,9 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); - if(attribs[Attributes::TYPE] == Attributes::USING_EXP) + if(attribs[Attributes::Type] == Attributes::USING_EXP) policy->setUsingExpression(xmlparser.getElementContent()); - else if(attribs[Attributes::TYPE] == Attributes::CheckExp) + else if(attribs[Attributes::Type] == Attributes::CheckExp) policy->setCheckExpression(xmlparser.getElementContent()); xmlparser.restorePosition(); @@ -5803,7 +5803,7 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) sequence->setValues(attribs[Attributes::MinValue], attribs[Attributes::MaxValue], attribs[Attributes::Increment], - attribs[Attributes::START], + attribs[Attributes::Start], attribs[Attributes::Cache]); sequence->setCycle(attribs[Attributes::Cycle]==Attributes::True); @@ -5903,10 +5903,10 @@ View *DatabaseModel::createView(void) xmlparser.getElementAttributes(attribs); //If the table name is specified tries to create a reference to a table/column - if(!attribs[Attributes::TABLE].isEmpty()) + if(!attribs[Attributes::Table].isEmpty()) { column=nullptr; - table=dynamic_cast
(getObject(attribs[Attributes::TABLE], ObjectType::Table)); + table=dynamic_cast
(getObject(attribs[Attributes::Table], ObjectType::Table)); //Raises an error if the table doesn't exists if(!table) @@ -5914,7 +5914,7 @@ View *DatabaseModel::createView(void) str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(view->getName()) .arg(BaseObject::getTypeName(ObjectType::View)) - .arg(attribs[Attributes::TABLE]) + .arg(attribs[Attributes::Table]) .arg(BaseObject::getTypeName(ObjectType::Table)); throw Exception(str_aux,ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -5933,7 +5933,7 @@ View *DatabaseModel::createView(void) str_aux=Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(view->getName()) .arg(BaseObject::getTypeName(ObjectType::View)) - .arg(attribs[Attributes::TABLE] + QString(".") + + .arg(attribs[Attributes::Table] + QString(".") + attribs[Attributes::Column]) .arg(BaseObject::getTypeName(ObjectType::Column)); @@ -5969,15 +5969,15 @@ View *DatabaseModel::createView(void) xmlparser.getElementAttributes(attribs); xmlparser.accessElement(XmlParser::ChildElement); - if(attribs[Attributes::TYPE]==Attributes::CteExpression) + if(attribs[Attributes::Type]==Attributes::CteExpression) view->setCommomTableExpression(xmlparser.getElementContent()); else { - if(attribs[Attributes::TYPE]==Attributes::SelectExp) + if(attribs[Attributes::Type]==Attributes::SelectExp) type=Reference::SqlReferSelect; - else if(attribs[Attributes::TYPE]==Attributes::FromExp) + else if(attribs[Attributes::Type]==Attributes::FromExp) type=Reference::SqlReferFrom; - else if(attribs[Attributes::TYPE]==Attributes::SimpleExp) + else if(attribs[Attributes::Type]==Attributes::SimpleExp) type=Reference::SqlReferWhere; else type=Reference::SqlReferEndExpr; @@ -6008,7 +6008,7 @@ View *DatabaseModel::createView(void) throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) .arg(attribs[Attributes::Name]) .arg(BaseObject::getTypeName(ObjectType::Table)) - .arg(aux_attribs[Attributes::TABLE]) + .arg(aux_attribs[Attributes::Table]) .arg(BaseObject::getTypeName(ObjectType::Tag)) , ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -6148,7 +6148,7 @@ Tag *DatabaseModel::createTag(void) { elem=xmlparser.getElementName(); - if(elem==Attributes::STYLE) + if(elem==Attributes::Style) { xmlparser.getElementAttributes(attribs); tag->setElementColors(attribs[Attributes::Id],attribs[Attributes::Colors]); @@ -6213,7 +6213,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) unsigned rel_type=0, i; ObjectType table_types[2]={ObjectType::View, ObjectType::Table}, obj_rel_type; QString str_aux, elem, - tab_attribs[2]={ Attributes::SRC_TABLE, + tab_attribs[2]={ Attributes::SrcTable, Attributes::DstTable }; QColor custom_color=Qt::transparent; Table *table = nullptr; @@ -6221,7 +6221,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) try { labels_id[Attributes::NameLabel]=BaseRelationship::RelNameLabel; - labels_id[Attributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; + labels_id[Attributes::SrcLabel]=BaseRelationship::SrcCardLabel; labels_id[Attributes::DstLabel]=BaseRelationship::DstCardLabel; xmlparser.getElementAttributes(attribs); @@ -6231,15 +6231,15 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(!attribs[Attributes::CustomColor].isEmpty()) custom_color=QColor(attribs[Attributes::CustomColor]); - if(attribs[Attributes::TYPE]!=Attributes::RelationshipTabView && - attribs[Attributes::TYPE]!=Attributes::RelationshipFk) + if(attribs[Attributes::Type]!=Attributes::RelationshipTabView && + attribs[Attributes::Type]!=Attributes::RelationshipFk) { table_types[0]=ObjectType::Table; obj_rel_type=ObjectType::Relationship; } else { - if(attribs[Attributes::TYPE]==Attributes::RelationshipFk) + if(attribs[Attributes::Type]==Attributes::RelationshipFk) table_types[0]=ObjectType::Table; obj_rel_type=ObjectType::BaseRelationship; @@ -6269,7 +6269,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) /* Creates the fk relationship if it not exists. This generally happens when a foreign key is added to the table after its creation. */ - if(attribs[Attributes::TYPE]==Attributes::RelationshipFk) + if(attribs[Attributes::Type]==Attributes::RelationshipFk) { base_rel=new BaseRelationship(BaseRelationship::RelationshipFk, tables[0], tables[1], false, false); base_rel->setName(attribs[Attributes::Name]); @@ -6324,7 +6324,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) else { QString pat_attrib[]= { Attributes::SrcColPattern, Attributes::DstColPattern, - Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, + Attributes::SrcFkPattern, Attributes::DstFkPattern, Attributes::PkPattern, Attributes::UQ_PATTERN, Attributes::PkColPattern }; @@ -6335,7 +6335,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) pat_count=sizeof(pattern_id)/sizeof(unsigned); sql_disabled=attribs[Attributes::SqlDisabled]==Attributes::True; - src_mand=attribs[Attributes::SRC_REQUIRED]==Attributes::True; + src_mand=attribs[Attributes::SrcRequired]==Attributes::True; dst_mand=attribs[Attributes::DstRequired]==Attributes::True; identifier=attribs[Attributes::Identifier]==Attributes::True; deferrable=attribs[Attributes::Deferrable]==Attributes::True; @@ -6344,17 +6344,17 @@ BaseRelationship *DatabaseModel::createRelationship(void) upd_action=ActionType(attribs[Attributes::UPD_ACTION]); single_pk_col=(attribs[Attributes::SinglePkColumn]==Attributes::True); - if(attribs[Attributes::TYPE]==Attributes::Relationship11) + if(attribs[Attributes::Type]==Attributes::Relationship11) rel_type=BaseRelationship::Relationship11; - else if(attribs[Attributes::TYPE]==Attributes::Relationship1n) + else if(attribs[Attributes::Type]==Attributes::Relationship1n) rel_type=BaseRelationship::Relationship1n; - else if(attribs[Attributes::TYPE]==Attributes::RelationshipNn) + else if(attribs[Attributes::Type]==Attributes::RelationshipNn) rel_type=BaseRelationship::RelationshipNn; - else if(attribs[Attributes::TYPE]==Attributes::RelationshipGen) + else if(attribs[Attributes::Type]==Attributes::RelationshipGen) rel_type=BaseRelationship::RelationshipGen; - else if(attribs[Attributes::TYPE]==Attributes::RelationshipDep) + else if(attribs[Attributes::Type]==Attributes::RelationshipDep) rel_type=BaseRelationship::RelationshipDep; - else if(attribs[Attributes::TYPE]==Attributes::RelationshipPart) + else if(attribs[Attributes::Type]==Attributes::RelationshipPart) rel_type=BaseRelationship::RelationshipPart; rel=new Relationship(rel_type, @@ -6368,8 +6368,8 @@ BaseRelationship *DatabaseModel::createRelationship(void) rel->setSQLDisabled(sql_disabled); rel->setSiglePKColumn(single_pk_col); - if(!attribs[Attributes::TABLE_NAME].isEmpty()) - rel->setTableNameRelNN(attribs[Attributes::TABLE_NAME]); + if(!attribs[Attributes::TableName].isEmpty()) + rel->setTableNameRelNN(attribs[Attributes::TableName]); rel->setName(attribs[Attributes::Name]); rel->setAlias(attribs[Attributes::Alias]); @@ -6411,9 +6411,9 @@ BaseRelationship *DatabaseModel::createRelationship(void) * the relationship contains a special primary key (created during relationship connection) * and the current constraint is the original one owned by one of the tables prior the connection * of the relationship. */ - if(constr_attribs[Attributes::TYPE] == Attributes::PkConstr) + if(constr_attribs[Attributes::Type] == Attributes::PkConstr) { - table = getTable(constr_attribs[Attributes::TABLE]); + table = getTable(constr_attribs[Attributes::Table]); rel->setOriginalPrimaryKey(createConstraint(table)); } else @@ -6526,7 +6526,7 @@ Permission *DatabaseModel::createPermission(void) xmlparser.accessElement(XmlParser::ChildElement); xmlparser.getElementAttributes(attribs); - obj_type=BaseObject::getObjectType(attribs[Attributes::TYPE]); + obj_type=BaseObject::getObjectType(attribs[Attributes::Type]); obj_name=attribs[Attributes::Name]; parent_name=attribs[Attributes::Parent]; @@ -6610,11 +6610,11 @@ Permission *DatabaseModel::createPermission(void) priv_type=Permission::PrivReferences; else if(itr->first==Attributes::SelectPriv) priv_type=Permission::PrivSelect; - else if(itr->first==Attributes::TEMPORARY_PRIV) + else if(itr->first==Attributes::TemporaryPriv) priv_type=Permission::PrivTemporary; - else if(itr->first==Attributes::TRIGGER_PRIV) + else if(itr->first==Attributes::TriggerPriv) priv_type=Permission::PrivTrigger; - else if(itr->first==Attributes::TRUNCATE_PRIV) + else if(itr->first==Attributes::TruncatePriv) priv_type=Permission::PrivTruncate; else if(itr->first==Attributes::UPDATE_PRIV) priv_type=Permission::PrivUpdate; @@ -6748,7 +6748,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) attributes[Attributes::IsTemplate]=(is_template ? Attributes::True : Attributes::False); attributes[Attributes::AllowConns]=(allow_conns ? Attributes::True : Attributes::False); - attributes[Attributes::TEMPLATE_DB]=template_db; + attributes[Attributes::TemplateDb]=template_db; if(def_type==SchemaParser::SqlDefinition && append_at_eod) { @@ -6810,7 +6810,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) attribs_aux[Attributes::ShellTypes]=QString(); attribs_aux[Attributes::Permission]=QString(); attribs_aux[Attributes::Schema]=QString(); - attribs_aux[Attributes::TABLESPACE]=QString(); + attribs_aux[Attributes::Tablespace]=QString(); attribs_aux[Attributes::Role]=QString(); if(def_type==SchemaParser::SqlDefinition) @@ -9504,7 +9504,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option save_objs_sqldis=false, save_textboxes=false, save_tags=false, save_custom_sql=false, save_custom_colors=false, save_fadeout=false, save_extattribs=false, save_genericsqls=false, save_objs_aliases=false; - QStringList labels_attrs={ Attributes::SRC_LABEL, + QStringList labels_attrs={ Attributes::SrcLabel, Attributes::DstLabel, Attributes::NameLabel }; @@ -9628,13 +9628,13 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option graph_obj=dynamic_cast(object); base_tab=dynamic_cast(object); - attribs[Attributes::TABLE]=QString(); + attribs[Attributes::Table]=QString(); attribs[Attributes::Name]=(TableObject::isTableObject(obj_type) ? object->getName() : object->getSignature()); attribs[Attributes::Alias]=(save_objs_aliases ? object->getAlias() : QString()); - attribs[Attributes::TYPE]=object->getSchemaName(); + attribs[Attributes::Type]=object->getSchemaName(); attribs[Attributes::Protected]=(save_objs_prot && object->isProtected() && !object->isSystemObject() ? Attributes::True : QString()); attribs[Attributes::SqlDisabled]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? Attributes::True : QString()); - attribs[Attributes::TAG]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); + attribs[Attributes::Tag]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); attribs[Attributes::AppendedSql]=object->getAppendedSQL(); attribs[Attributes::PrependedSql]=object->getPrependedSQL(); attribs[Attributes::HideExtAttribs]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? Attributes::True : QString()); @@ -9643,7 +9643,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(TableObject::isTableObject(obj_type)) { base_tab = dynamic_cast(object)->getParentTable(); - attribs[Attributes::TABLE]=base_tab->getSignature(); + attribs[Attributes::Table]=base_tab->getSignature(); } if(save_custom_sql && obj_type==ObjectType::Database) @@ -9708,7 +9708,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::CustomColor]=(save_custom_colors && rel->getCustomColor()!=Qt::transparent ? rel->getCustomColor().name() : Attributes::None); - attribs[Attributes::SRC_TABLE]=rel->getTable(BaseRelationship::SrcTable)->getSignature(); + attribs[Attributes::SrcTable]=rel->getTable(BaseRelationship::SrcTable)->getSignature(); attribs[Attributes::SrcType]=rel->getTable(BaseRelationship::SrcTable)->getSchemaName(); attribs[Attributes::DstTable]=rel->getTable(BaseRelationship::DstTable)->getSignature(); @@ -9771,7 +9771,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option (save_objs_pos && (!attribs[Attributes::Position].isEmpty() || !attribs[Attributes::RectVisible].isEmpty())) || - (save_tags && !attribs[Attributes::TAG].isEmpty()) || + (save_tags && !attribs[Attributes::Tag].isEmpty()) || (save_objs_prot && !attribs[Attributes::Protected].isEmpty()) || (save_objs_sqldis && !attribs[Attributes::SqlDisabled].isEmpty()) || (save_custom_sql && (!attribs[Attributes::AppendedSql].isEmpty() || @@ -9860,7 +9860,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option try { - labels_attrs[Attributes::SRC_LABEL]=BaseRelationship::SrcCardLabel; + labels_attrs[Attributes::SrcLabel]=BaseRelationship::SrcCardLabel; labels_attrs[Attributes::DstLabel]=BaseRelationship::DstCardLabel; labels_attrs[Attributes::NameLabel]=BaseRelationship::RelNameLabel; @@ -9910,7 +9910,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option obj_name=attribs[Attributes::Object]; xmlparser.savePosition(); - obj_type=BaseObject::getObjectType(attribs[Attributes::TYPE]); + obj_type=BaseObject::getObjectType(attribs[Attributes::Type]); progress=xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()) * 100; if(obj_type==ObjectType::Database) @@ -9934,10 +9934,10 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option } else if(TableObject::isTableObject(obj_type)) { - base_tab = getTable(attribs[Attributes::TABLE]); + base_tab = getTable(attribs[Attributes::Table]); if(!base_tab && (obj_type == ObjectType::Rule || obj_type == ObjectType::Index || obj_type == ObjectType::Trigger)) - base_tab = getView(attribs[Attributes::TABLE]); + base_tab = getView(attribs[Attributes::Table]); if(base_tab) object = base_tab->getObject(attribs[Attributes::Object], obj_type); @@ -9953,7 +9953,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option involving the tables in paramenters src-table and dst-table */ if(!object && obj_type==ObjectType::Relationship) { - src_tab=dynamic_cast(getObject(attribs[Attributes::SRC_TABLE], + src_tab=dynamic_cast(getObject(attribs[Attributes::SrcTable], BaseObject::getObjectType(attribs[Attributes::SrcType]))); dst_tab=dynamic_cast(getObject(attribs[Attributes::DstTable], BaseObject::getObjectType(attribs[Attributes::DstType]))); @@ -9975,9 +9975,9 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(!attribs[Attributes::SqlDisabled].isEmpty()) object->setSQLDisabled(attribs[Attributes::SqlDisabled]==Attributes::True); } - else if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && load_tags && !attribs[Attributes::TAG].isEmpty()) + else if((obj_type==ObjectType::Table || obj_type==ObjectType::View) && load_tags && !attribs[Attributes::Tag].isEmpty()) { - tag=getTag(attribs[Attributes::TAG]); + tag=getTag(attribs[Attributes::Tag]); if(tag) dynamic_cast(object)->setTag(tag); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index ef7cb3fcd6..41134c0ee1 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -24,7 +24,7 @@ Domain::Domain(void) not_null=false; attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::NotNull]=QString(); - attributes[Attributes::TYPE]=QString(); + attributes[Attributes::Type]=QString(); attributes[Attributes::Constraints]=QString(); } @@ -137,9 +137,9 @@ QString Domain::getCodeDefinition(unsigned def_type) } if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::TYPE]=(*type); + attributes[Attributes::Type]=(*type); else - attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); + attributes[Attributes::Type]=type.getCodeDefinition(def_type); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 6427a4df7c..7c6e1fd179 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -59,7 +59,7 @@ void EventTrigger::setFunction(Function *func) void EventTrigger::setFilter(const QString &variable, const QStringList &values) { - if(variable.toLower()!=Attributes::TAG) + if(variable.toLower()!=Attributes::Tag) throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidEventTriggerVariable).arg(variable),__PRETTY_FUNCTION__,__FILE__,__LINE__); if(!values.isEmpty()) diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 130b408dcb..477fa50ea5 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -45,7 +45,7 @@ Function::Function(void) attributes[Attributes::WINDOW_FUNC]=QString(); attributes[Attributes::ReturnTable]=QString(); attributes[Attributes::Library]=QString(); - attributes[Attributes::SYMBOL]=QString(); + attributes[Attributes::Symbol]=QString(); attributes[Attributes::LeakProof]=QString(); } @@ -486,7 +486,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) if(language->getName()==~LanguageType(LanguageType::C)) { - attributes[Attributes::SYMBOL]=symbol; + attributes[Attributes::Symbol]=symbol; attributes[Attributes::Library]=library; } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 59ec3ccf61..f9edb12242 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -26,7 +26,7 @@ Index::Index(void) fill_factor=90; attributes[Attributes::UNIQUE]=QString(); attributes[Attributes::Concurrent]=QString(); - attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Table]=QString(); attributes[Attributes::IndexType]=QString(); attributes[Attributes::Columns]=QString(); attributes[Attributes::Expression]=QString(); @@ -39,7 +39,7 @@ Index::Index(void) attributes[Attributes::Elements]=QString(); attributes[Attributes::FastUpdate]=QString(); attributes[Attributes::Buffering]=QString(); - attributes[Attributes::STORAGE_PARAMS]=QString(); + attributes[Attributes::StorageParams]=QString(); } void Index::setIndexElementsAttribute(unsigned def_type) @@ -335,26 +335,26 @@ QString Index::getCodeDefinition(unsigned def_type) attributes[Attributes::Concurrent]=(index_attribs[Concurrent] ? Attributes::True : QString()); attributes[Attributes::IndexType]=(~indexing_type); attributes[Attributes::Predicate]=predicate; - attributes[Attributes::STORAGE_PARAMS]=QString(); + attributes[Attributes::StorageParams]=QString(); if(getParentTable()) { - attributes[Attributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::Table]=getParentTable()->getName(true); if(def_type==SchemaParser::SqlDefinition && getParentTable()->getSchema()) attributes[Attributes::Schema]=getParentTable()->getSchema()->getName(true); } if(this->indexing_type==IndexingType::Gin) - attributes[Attributes::STORAGE_PARAMS]=attributes[Attributes::FastUpdate]=(index_attribs[FastUpdate] ? Attributes::True : QString()); + attributes[Attributes::StorageParams]=attributes[Attributes::FastUpdate]=(index_attribs[FastUpdate] ? Attributes::True : QString()); if(this->indexing_type==IndexingType::Gist) - attributes[Attributes::STORAGE_PARAMS]=attributes[Attributes::Buffering]=(index_attribs[Buffering] ? Attributes::True : QString()); + attributes[Attributes::StorageParams]=attributes[Attributes::Buffering]=(index_attribs[Buffering] ? Attributes::True : QString()); if(/*this->indexing_type==IndexingType::btree && */fill_factor >= 10) { attributes[Attributes::Factor]=QString("%1").arg(fill_factor); - attributes[Attributes::STORAGE_PARAMS]=Attributes::True; + attributes[Attributes::StorageParams]=Attributes::True; } else if(def_type==SchemaParser::XmlDefinition) attributes[Attributes::Factor]=QString("0"); diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index d97ec1ab07..9a7e184f33 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -26,7 +26,7 @@ Language::Language(void) for(unsigned i=ValidatorFunc; i <= InlineFunc; i++) functions[i]=nullptr; - attributes[Attributes::TRUSTED]=QString(); + attributes[Attributes::Trusted]=QString(); attributes[Attributes::HandlerFunc]=QString(); attributes[Attributes::VALIDATOR_FUNC]=QString(); attributes[Attributes::InlineFunc]=QString(); @@ -120,7 +120,7 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) Attributes::HandlerFunc, Attributes::InlineFunc}; - attributes[Attributes::TRUSTED]=(is_trusted ? Attributes::True : QString()); + attributes[Attributes::Trusted]=(is_trusted ? Attributes::True : QString()); if(!reduced_form && def_type==SchemaParser::XmlDefinition) reduced_form=(!functions[ValidatorFunc] && !functions[HandlerFunc] && !functions[InlineFunc] && !this->getOwner()); diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index b3a4b54dba..3516c41f7c 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -26,7 +26,7 @@ OperatorClass::OperatorClass(void) attributes[Attributes::Family]=QString(); attributes[Attributes::Elements]=QString(); attributes[Attributes::IndexType]=QString(); - attributes[Attributes::TYPE]=QString(); + attributes[Attributes::Type]=QString(); attributes[Attributes::Default]=QString(); } @@ -176,9 +176,9 @@ QString OperatorClass::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::Default]=(is_default ? Attributes::True : QString()); if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::TYPE]=(*data_type); + attributes[Attributes::Type]=(*data_type); else - attributes[Attributes::TYPE]=data_type.getCodeDefinition(def_type); + attributes[Attributes::Type]=data_type.getCodeDefinition(def_type); if(family) { diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 876953027e..68ae0bb521 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -125,12 +125,12 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) SchemaParser schparser; attribs_map attributes; - attributes[Attributes::TYPE]=QString(); - attributes[Attributes::STRATEGY_NUM]=QString(); + attributes[Attributes::Type]=QString(); + attributes[Attributes::StrategyNum]=QString(); attributes[Attributes::Signature]=QString(); attributes[Attributes::Function]=QString(); attributes[Attributes::Operator]=QString(); - attributes[Attributes::STORAGE]=QString(); + attributes[Attributes::Storage]=QString(); attributes[Attributes::OpFamily]=QString(); attributes[Attributes::Definition]=QString(); @@ -138,7 +138,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) { //FUNCTION support_number [ ( op_type [ , op_type ] ) ] funcname ( argument_type [, ...] ) attributes[Attributes::Function]=Attributes::True; - attributes[Attributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); + attributes[Attributes::StrategyNum]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::Signature]=function->getSignature(); @@ -149,7 +149,7 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) { //OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] [ FOR SEARCH | FOR ORDER BY sort_family_name ] attributes[Attributes::Operator]=Attributes::True; - attributes[Attributes::STRATEGY_NUM]=QString("%1").arg(strategy_number); + attributes[Attributes::StrategyNum]=QString("%1").arg(strategy_number); if(def_type==SchemaParser::SqlDefinition) attributes[Attributes::Signature]=_operator->getSignature(); @@ -167,10 +167,10 @@ QString OperatorClassElement::getCodeDefinition(unsigned def_type) else if(element_type==StorageElem && storage!=PgSqlType::Null) { //STORAGE storage_type - attributes[Attributes::STORAGE]=Attributes::True; + attributes[Attributes::Storage]=Attributes::True; if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::TYPE]=(*storage); + attributes[Attributes::Type]=(*storage); else attributes[Attributes::Definition]=storage.getCodeDefinition(def_type); } diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 651450f6a0..7628a2f87f 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -102,7 +102,7 @@ QString Parameter::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::ParamOut]=(is_out ? Attributes::True : QString()); attributes[Attributes::ParamVariadic]=(is_variadic ? Attributes::True : QString()); attributes[Attributes::DefaultValue]=default_value; - attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); + attributes[Attributes::Type]=type.getCodeDefinition(def_type); return(BaseObject::getCodeDefinition(def_type, reduced_form)); } diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index b1bafc935a..12e7f251fe 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -42,7 +42,7 @@ Permission::Permission(BaseObject *obj) revoke=cascade=false; attributes[Attributes::Object]=QString(); - attributes[Attributes::TYPE]=QString(); + attributes[Attributes::Type]=QString(); attributes[Attributes::Parent]=QString(); attributes[Attributes::GrantOp]=QString(); attributes[Attributes::Roles]=QString(); @@ -413,9 +413,9 @@ QString Permission::getCodeDefinition(unsigned def_type) ObjectType obj_type; QString priv_vect[12]={ Attributes::SelectPriv, Attributes::InsertPriv, Attributes::UPDATE_PRIV, Attributes::DeletePriv, - Attributes::TRUNCATE_PRIV, Attributes::ReferencesPriv, - Attributes::TRIGGER_PRIV, Attributes::CreatePriv, - Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, + Attributes::TruncatePriv, Attributes::ReferencesPriv, + Attributes::TriggerPriv, Attributes::CreatePriv, + Attributes::ConnectPriv, Attributes::TemporaryPriv, Attributes::ExecutPriv, Attributes::USAGE_PRIV }; obj_type=object->getObjectType(); @@ -426,11 +426,11 @@ QString Permission::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { //Views and Tables uses the same key word when setting permission (TABLE) - attributes[Attributes::TYPE]= + attributes[Attributes::Type]= (object->getObjectType()==ObjectType::View ? BaseObject::getSQLName(ObjectType::Table): BaseObject::getSQLName(object->getObjectType())); } else - attributes[Attributes::TYPE]=BaseObject::getSchemaName(object->getObjectType()); + attributes[Attributes::Type]=BaseObject::getSchemaName(object->getObjectType()); if(obj_type==ObjectType::Column) { diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 923507124a..858e30400e 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1595,7 +1595,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs[Attributes::IntervalType]=QString(); attribs[Attributes::SpatialType]=QString(); attribs[Attributes::VARIATION]=QString(); - attribs[Attributes::SRID]=QString(); + attribs[Attributes::Srid]=QString(); attribs[Attributes::RefType]=ref_type; attribs[Attributes::Name]=(~(*this)); @@ -1614,7 +1614,7 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) { attribs[Attributes::SpatialType]=(~spatial_type); attribs[Attributes::VARIATION]=QString("%1").arg(spatial_type.getVariation()); - attribs[Attributes::SRID]=QString("%1").arg(spatial_type.getSRID()); + attribs[Attributes::Srid]=QString("%1").arg(spatial_type.getSRID()); } if(with_timezone) diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index 23b0edf2f2..803c928c3c 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -116,7 +116,7 @@ QString Policy::getCodeDefinition(unsigned def_type) QStringList rol_names; if(getParentTable()) - attributes[Attributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::Table]=getParentTable()->getName(true); attributes[Attributes::Command] = ~policy_cmd; diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 9fce182b6b..45373abf9d 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -217,11 +217,11 @@ QString Reference::getXMLDefinition(void) attribs_map attribs; SchemaParser schparser; - attribs[Attributes::TABLE]=QString(); + attribs[Attributes::Table]=QString(); attribs[Attributes::Column]=QString(); if(table) - attribs[Attributes::TABLE]=table->getName(true); + attribs[Attributes::Table]=table->getName(true); if(column) attribs[Attributes::Column]=column->getName(); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 5667273ed7..4e710c8c11 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2575,14 +2575,14 @@ QString Relationship::getCodeDefinition(unsigned def_type) } - attributes[Attributes::TABLE]=getReceiverTable()->getName(true); + attributes[Attributes::Table]=getReceiverTable()->getName(true); } else if(table_relnn && rel_type==RelationshipNn) { unsigned count, i; attributes[Attributes::RelationshipNn]=Attributes::True; - attributes[Attributes::TABLE]=table_relnn->getCodeDefinition(def_type); + attributes[Attributes::Table]=table_relnn->getCodeDefinition(def_type); count=table_relnn->getConstraintCount(); for(i=0; i < count; i++) @@ -2595,7 +2595,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) else if(rel_type==RelationshipGen) { attributes[Attributes::RelationshipGen]=Attributes::True; - attributes[Attributes::TABLE]=getReceiverTable()->getName(true); + attributes[Attributes::Table]=getReceiverTable()->getName(true); } return(this->BaseObject::__getCodeDefinition(SchemaParser::SqlDefinition)); @@ -2613,7 +2613,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::UPD_ACTION]=~upd_action; attributes[Attributes::DelAction]=~del_action; - attributes[Attributes::TABLE_NAME]=tab_name_relnn; + attributes[Attributes::TableName]=tab_name_relnn; attributes[Attributes::RelationshipGen]=(rel_type==RelationshipGen ? Attributes::True : QString()); attributes[Attributes::RelationshipDep]=(rel_type==RelationshipDep ? Attributes::True : QString()); attributes[Attributes::RelationshipPart]=(rel_type==RelationshipPart ? Attributes::True : QString()); @@ -2622,7 +2622,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::DstColPattern]=name_patterns[DstColPattern]; attributes[Attributes::PkPattern]=name_patterns[PkPattern]; attributes[Attributes::UQ_PATTERN]=name_patterns[UqPattern]; - attributes[Attributes::SRC_FK_PATTERN]=name_patterns[SrcFkPattern]; + attributes[Attributes::SrcFkPattern]=name_patterns[SrcFkPattern]; attributes[Attributes::DstFkPattern]=name_patterns[DstFkPattern]; attributes[Attributes::PkColPattern]=name_patterns[PkColPattern]; @@ -2718,13 +2718,13 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) if(rel_type == RelationshipGen) { attributes[Attributes::Inherit]=(undo_inh_part ? Attributes::UNSET : Attributes::True); - attributes[Attributes::TABLE]=getReceiverTable()->getName(true); + attributes[Attributes::Table]=getReceiverTable()->getName(true); attributes[Attributes::AncestorTable]=getReferenceTable()->getName(true); } else { attributes[Attributes::Partitioning]=(undo_inh_part ? Attributes::UNSET : Attributes::True); - attributes[Attributes::TABLE]=getReceiverTable()->getName(true); + attributes[Attributes::Table]=getReceiverTable()->getName(true); attributes[Attributes::PartitionedTable]=getReferenceTable()->getName(true); attributes[Attributes::PartitionBoundExpr]=getReceiverTable()->getPartitionBoundingExpr(); } diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 335102b1d4..5e3606c37e 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -30,7 +30,7 @@ Role::Role(void) conn_limit=-1; - attributes[Attributes::SUPERUSER]=QString(); + attributes[Attributes::Superuser]=QString(); attributes[Attributes::CreateDb]=QString(); attributes[Attributes::CreateRole]=QString(); attributes[Attributes::Inherit]=QString(); @@ -329,7 +329,7 @@ QString Role::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); unsigned i; - QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, + QString op_attribs[]={ Attributes::Superuser, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, Attributes::Login, Attributes::Encrypted, Attributes::Replication, Attributes::BypassRls }; @@ -360,7 +360,7 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) try { attribs_map attribs; - QString op_attribs[]={ Attributes::SUPERUSER, Attributes::CreateDb, + QString op_attribs[]={ Attributes::Superuser, Attributes::CreateDb, Attributes::CreateRole, Attributes::Inherit, Attributes::Login, Attributes::Encrypted, Attributes::Replication, Attributes::BypassRls }; diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index 64409d80b3..2713d7a473 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -23,7 +23,7 @@ Rule::Rule(void) execution_type=BaseType::Null; obj_type=ObjectType::Rule; attributes[Attributes::EventType]=QString(); - attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Table]=QString(); attributes[Attributes::Condition]=QString(); attributes[Attributes::ExecType]=QString(); attributes[Attributes::Commands]=QString(); @@ -132,7 +132,7 @@ QString Rule::getCodeDefinition(unsigned def_type) attributes[Attributes::EventType]=(~event_type); if(getParentTable()) - attributes[Attributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::Table]=getParentTable()->getName(true); return(BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 9d4bbd5ec4..ac1a34025c 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -35,11 +35,11 @@ Sequence::Sequence(void) attributes[Attributes::Increment]=QString(); attributes[Attributes::MinValue]=QString(); attributes[Attributes::MaxValue]=QString(); - attributes[Attributes::START]=QString(); + attributes[Attributes::Start]=QString(); attributes[Attributes::Cache]=QString(); attributes[Attributes::Cycle]=QString(); attributes[Attributes::OwnerColumn]=QString(); - attributes[Attributes::TABLE]=QString(); + attributes[Attributes::Table]=QString(); attributes[Attributes::Column]=QString(); attributes[Attributes::ColIsIdentity]=QString(); } @@ -396,7 +396,7 @@ QString Sequence::getCodeDefinition(unsigned def_type) table=dynamic_cast
(owner_col->getParentTable()); } - attributes[Attributes::TABLE]=(table ? table->getName(true) : QString()); + attributes[Attributes::Table]=(table ? table->getName(true) : QString()); attributes[Attributes::Column]=(owner_col ? owner_col->getName(true) : QString()); attributes[Attributes::ColIsIdentity]= @@ -405,7 +405,7 @@ QString Sequence::getCodeDefinition(unsigned def_type) attributes[Attributes::Increment]=increment; attributes[Attributes::MinValue]=min_value; attributes[Attributes::MaxValue]=max_value; - attributes[Attributes::START]=start; + attributes[Attributes::Start]=start; attributes[Attributes::Cache]=cache; attributes[Attributes::Cycle]=(cycle ? Attributes::True : QString()); @@ -438,7 +438,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) if(table) { - attribs[Attributes::TABLE]=table->getName(true); + attribs[Attributes::Table]=table->getName(true); attribs[Attributes::Column]=seq->owner_col->getName(true); } } @@ -456,7 +456,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) attribs[Attributes::MaxValue]=seq->max_value; if(!seq->start.isEmpty() && this->start!=seq->start) - attribs[Attributes::START]=seq->start; + attribs[Attributes::Start]=seq->start; if(!seq->cache.isEmpty() && this->cache!=seq->cache) attribs[Attributes::Cache]=seq->cache; diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 7246142377..7a19a878df 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -163,7 +163,7 @@ void Table::setCommentAttribute(TableObject *tab_obj) attribs[Attributes::SqlObject]=tab_obj->getSQLName(); attribs[Attributes::Column]=(tab_obj->getObjectType()==ObjectType::Column ? Attributes::True : QString()); attribs[Attributes::Constraint]=(tab_obj->getObjectType()==ObjectType::Constraint ? Attributes::True : QString()); - attribs[Attributes::TABLE]=this->getName(true); + attribs[Attributes::Table]=this->getName(true); attribs[Attributes::Name]=tab_obj->getName(true); attribs[Attributes::Comment]=QString(tab_obj->getComment()).replace(QString("'"), QString("''"));; @@ -1600,7 +1600,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::RlsForced]=(rls_forced ? Attributes::True : QString()); attributes[Attributes::CopyTable]=QString(); attributes[Attributes::AncestorTable]=QString(); - attributes[Attributes::TAG]=QString(); + attributes[Attributes::Tag]=QString(); attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); attributes[Attributes::Partitioning]=~partitioning_type; attributes[Attributes::PartitionKey]=QString(); @@ -1621,7 +1621,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::PartitionedTable]=partitioned_table->getName(true); if(tag && def_type==SchemaParser::XmlDefinition) - attributes[Attributes::TAG]=tag->getCodeDefinition(def_type, true); + attributes[Attributes::Tag]=tag->getCodeDefinition(def_type, true); (copy_table ? copy_table->getName(true) : QString()); @@ -1918,7 +1918,7 @@ QString Table::getTruncateDefinition(bool cascade) { BaseObject::setBasicAttributes(true); attributes[Attributes::Cascade]=(cascade ? Attributes::True : QString()); - return(BaseObject::getAlterDefinition(Attributes::TRUNCATE_PRIV, attributes, false, false)); + return(BaseObject::getAlterDefinition(Attributes::TruncatePriv, attributes, false, false)); } catch(Exception &e) { diff --git a/libpgmodeler/src/tableobject.cpp b/libpgmodeler/src/tableobject.cpp index ccb0ed8f20..8030b21b86 100644 --- a/libpgmodeler/src/tableobject.cpp +++ b/libpgmodeler/src/tableobject.cpp @@ -114,7 +114,7 @@ void TableObject::setCodeInvalidated(bool value) QString TableObject::getDropDefinition(bool cascade) { if(getParentTable()) - attributes[Attributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::Table]=getParentTable()->getName(true); attributes[this->getSchemaName()]=Attributes::True; diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index bf5c4099f2..4a46a216bf 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -22,17 +22,17 @@ unsigned Tag::tag_id=3000; Tag::Tag(void) { - QStringList attribs={ Attributes::TABLE_NAME, Attributes::TABLE_SCHEMA_NAME, - Attributes::TABLE_TITLE, Attributes::TABLE_BODY, - Attributes::TABLE_EXT_BODY }; + QStringList attribs={ Attributes::TableName, Attributes::TableSchemaName, + Attributes::TableTitle, Attributes::TableBody, + Attributes::TableExtBody }; obj_type=ObjectType::Tag; object_id=Tag::tag_id++; - attributes[Attributes::STYLES]=QString(); + attributes[Attributes::Styles]=QString(); for(auto &attr : attribs) { - if(attr!=Attributes::TABLE_NAME && attr!=Attributes::TABLE_SCHEMA_NAME) + if(attr!=Attributes::TableName && attr!=Attributes::TableSchemaName) color_config[attr] = { QColor(0,0,0), QColor(0,0,0), QColor(0,0,0) }; else color_config[attr] = { QColor(0,0,0) }; @@ -110,7 +110,7 @@ void Tag::validateElementId(const QString &id, unsigned color_id) ErrorCode::OprInvalidElementId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if((color_id > ColorCount) || (color_id > 0 && - (id==Attributes::TABLE_NAME || id==Attributes::TABLE_SCHEMA_NAME))) + (id==Attributes::TableName || id==Attributes::TableSchemaName))) throw Exception(Exception::getErrorMessage(ErrorCode::RefInvalidElementColorId).arg(id).arg(color_id), ErrorCode::RefInvalidElementColorId ,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -157,13 +157,13 @@ QString Tag::getCodeDefinition(unsigned def_type, bool reduced_form) attribs[Attributes::Id]=itr.first; attribs[Attributes::Colors]=QString(); - if(itr.first==Attributes::TABLE_NAME || itr.first==Attributes::TABLE_SCHEMA_NAME) + if(itr.first==Attributes::TableName || itr.first==Attributes::TableSchemaName) attribs[Attributes::Colors]=itr.second[FillColor1].name(); else attribs[Attributes::Colors]=itr.second[FillColor1].name() + QString(",") + itr.second[FillColor2].name() + QString(",") + itr.second[BorderColor].name(); - attributes[Attributes::STYLES]+=schparser.getCodeDefinition(Attributes::STYLE, attribs, SchemaParser::XmlDefinition); + attributes[Attributes::Styles]+=schparser.getCodeDefinition(Attributes::Style, attribs, SchemaParser::XmlDefinition); } } catch(Exception &e) diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 82fb28c34d..3c0a21bd22 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -34,15 +34,15 @@ Trigger::Trigger(void) attributes[Attributes::Arguments]=QString(); attributes[Attributes::Events]=QString(); - attributes[Attributes::TRIGGER_FUNC]=QString(); - attributes[Attributes::TABLE]=QString(); + attributes[Attributes::TriggerFunc]=QString(); + attributes[Attributes::Table]=QString(); attributes[Attributes::Columns]=QString(); attributes[Attributes::FiringType]=QString(); attributes[Attributes::PerRow]=QString(); attributes[Attributes::InsEvent]=QString(); attributes[Attributes::DelEvent]=QString(); attributes[Attributes::UPD_EVENT]=QString(); - attributes[Attributes::TRUNC_EVENT]=QString(); + attributes[Attributes::TruncEvent]=QString(); attributes[Attributes::Condition]=QString(); attributes[Attributes::RefTable]=QString(); attributes[Attributes::DeferType]=QString(); @@ -347,7 +347,7 @@ void Trigger::setBasicAttributes(unsigned def_type) { QString str_aux, attribs[4]={Attributes::InsEvent, Attributes::DelEvent, - Attributes::TRUNC_EVENT, Attributes::UPD_EVENT }, + Attributes::TruncEvent, Attributes::UPD_EVENT }, sql_event[4]={"INSERT OR ", "DELETE OR ", "TRUNCATE OR ", "UPDATE "}; unsigned count, i, i1, event_types[4]={EventType::OnInsert, EventType::OnDelete, EventType::OnTruncate, EventType::OnUpdate}; @@ -387,9 +387,9 @@ void Trigger::setBasicAttributes(unsigned def_type) if(function) { if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::TRIGGER_FUNC]=function->getName(true); + attributes[Attributes::TriggerFunc]=function->getName(true); else - attributes[Attributes::TRIGGER_FUNC]=function->getCodeDefinition(def_type, true); + attributes[Attributes::TriggerFunc]=function->getCodeDefinition(def_type, true); } } @@ -406,7 +406,7 @@ QString Trigger::getCodeDefinition(unsigned def_type) attributes[Attributes::DeclInTable]=Attributes::True; if(getParentTable()) - attributes[Attributes::TABLE]=getParentTable()->getName(true); + attributes[Attributes::Table]=getParentTable()->getName(true); attributes[Attributes::Constraint]=(is_constraint ? Attributes::True : QString()); attributes[Attributes::FiringType]=(~firing_type); diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 4c03351667..d74857ea11 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -26,20 +26,20 @@ Type::Type(void) attributes[Attributes::BaseType]=QString(); attributes[Attributes::CompositeType]=QString(); attributes[Attributes::RangeType]=QString(); - attributes[Attributes::TYPE_ATTRIBUTE]=QString(); + attributes[Attributes::TypeAttribute]=QString(); attributes[Attributes::EnumType]=QString(); attributes[Attributes::Enumerations]=QString(); attributes[Attributes::InputFunc]=QString(); attributes[Attributes::OutputFunc]=QString(); attributes[Attributes::RecvFunc]=QString(); attributes[Attributes::SendFunc]=QString(); - attributes[Attributes::TPMOD_IN_FUNC]=QString(); - attributes[Attributes::TPMOD_OUT_FUNC]=QString(); + attributes[Attributes::TpmodInFunc]=QString(); + attributes[Attributes::TpmodOutFunc]=QString(); attributes[Attributes::AnalyzeFunc]=QString(); attributes[Attributes::InternalLength]=QString(); attributes[Attributes::ByValue]=QString(); attributes[Attributes::Alignment]=QString(); - attributes[Attributes::STORAGE]=QString(); + attributes[Attributes::Storage]=QString(); attributes[Attributes::DefaultValue]=QString(); attributes[Attributes::Element]=QString(); attributes[Attributes::Delimiter]=QString(); @@ -48,8 +48,8 @@ Type::Type(void) attributes[Attributes::Preferred]=QString(); attributes[Attributes::LikeType]=QString(); attributes[Attributes::Collatable]=QString(); - attributes[Attributes::SUBTYPE]=QString(); - attributes[Attributes::SUBTYPE_DIFF_FUNC]=QString(); + attributes[Attributes::Subtype]=QString(); + attributes[Attributes::SubtypeDiffFunc]=QString(); attributes[Attributes::CanonicalFunc]=QString(); attributes[Attributes::OpClass]=QString(); } @@ -429,7 +429,7 @@ void Type::setElementsAttribute(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) str_elem.remove(str_elem.lastIndexOf(','), str_elem.size()); - attributes[Attributes::TYPE_ATTRIBUTE]=str_elem; + attributes[Attributes::TypeAttribute]=str_elem; } void Type::setEnumerationsAttribute(unsigned def_type) @@ -630,9 +630,9 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::RangeType]=Attributes::True; if(def_type==SchemaParser::SqlDefinition) - attributes[Attributes::SUBTYPE]=(*subtype); + attributes[Attributes::Subtype]=(*subtype); else - attributes[Attributes::SUBTYPE]=subtype.getCodeDefinition(SchemaParser::XmlDefinition); + attributes[Attributes::Subtype]=subtype.getCodeDefinition(SchemaParser::XmlDefinition); if(subtype_opclass) { @@ -653,7 +653,7 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::ByValue]=(by_value ? Attributes::True : QString()); attributes[Attributes::Alignment]=(*alignment); - attributes[Attributes::STORAGE]=(~storage); + attributes[Attributes::Storage]=(~storage); attributes[Attributes::DefaultValue]=default_value; if(element!=QString("\"any\"")) @@ -683,11 +683,11 @@ QString Type::getCodeDefinition(unsigned def_type, bool reduced_form) Attributes::OutputFunc, Attributes::RecvFunc, Attributes::SendFunc, - Attributes::TPMOD_IN_FUNC, - Attributes::TPMOD_OUT_FUNC, + Attributes::TpmodInFunc, + Attributes::TpmodOutFunc, Attributes::AnalyzeFunc, Attributes::CanonicalFunc, - Attributes::SUBTYPE_DIFF_FUNC}; + Attributes::SubtypeDiffFunc}; for(i=0; i < sizeof(functions)/sizeof(Function *); i++) { @@ -771,7 +771,7 @@ QString Type::getAlterDefinition(BaseObject *object) if(attrib_idx < 0) { attribs[Attributes::Attribute]=attrib.getName(true); - attribs[Attributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); + attribs[Attributes::Type]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); attribs[Attributes::Collation]=QString(); if(attrib.getCollation()) @@ -788,7 +788,7 @@ QString Type::getAlterDefinition(BaseObject *object) if(!type_attribs[attrib_idx].getType().isEquivalentTo(attrib.getType())) { attribs[Attributes::Attribute]=attrib.getName(true); - attribs[Attributes::TYPE]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); + attribs[Attributes::Type]=attrib.getType().getCodeDefinition(SchemaParser::SqlDefinition); } copyAttributes(attribs); diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index ea3319725e..00aee07be8 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -44,7 +44,7 @@ QString TypeAttribute::getCodeDefinition(unsigned def_type) else attributes[Attributes::Name]=obj_name; - attributes[Attributes::TYPE]=type.getCodeDefinition(def_type); + attributes[Attributes::Type]=type.getCodeDefinition(def_type); if(collation) { diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 1e79dfc366..bdb9df6c47 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -578,7 +578,7 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::Recursive]=(recursive ? Attributes::True : QString()); attributes[Attributes::WITH_NO_DATA]=(with_no_data ? Attributes::True : QString()); attributes[Attributes::Columns]=QString(); - attributes[Attributes::TAG]=QString(); + attributes[Attributes::Tag]=QString(); attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); setSQLObjectAttribute(); @@ -587,7 +587,7 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::Columns]=getColumnsList().join(','); if(tag && def_type==SchemaParser::XmlDefinition) - attributes[Attributes::TAG]=tag->getCodeDefinition(def_type, true); + attributes[Attributes::Tag]=tag->getCodeDefinition(def_type, true); if(def_type==SchemaParser::SqlDefinition) setDefinitionAttribute(); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 650503937b..5871cf6a7a 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -33,11 +33,11 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::ObjectType, //5 Attributes::LockerArc, //6 Attributes::LockerBody, //7 - Attributes::TABLE_SCHEMA_NAME, //8 - Attributes::TABLE_NAME, //9 - Attributes::TABLE_BODY, //10 - Attributes::TABLE_EXT_BODY, //11 - Attributes::TABLE_TITLE, //12 + Attributes::TableSchemaName, //8 + Attributes::TableName, //9 + Attributes::TableBody, //10 + Attributes::TableExtBody, //11 + Attributes::TableTitle, //12 BaseObject::getSchemaName(ObjectType::Rule), //13 BaseObject::getSchemaName(ObjectType::Rule), //14 BaseObject::getSchemaName(ObjectType::Index), //15 @@ -75,8 +75,8 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::Label, //45 Attributes::Attribute, //46 Attributes::Attribute, //47 - Attributes::TAG, //48 - Attributes::TAG, //49 + Attributes::Tag, //48 + Attributes::Tag, //49 Attributes::Placeholder /*50*/}; int i, count=element_cmb->count(), //This auxiliary vector stores the id of elements that represents color/font conf. of objects diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 0ce6d25291..4b031d4a4a 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -79,26 +79,26 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::RowAmount, QT_TR_NOOP("Rows amount")}, {Attributes::Schema, QT_TR_NOOP("Schema")}, {Attributes::SecurityType, QT_TR_NOOP("Security type")}, {Attributes::SendFunc, QT_TR_NOOP("Send func.")}, {Attributes::SortOp, QT_TR_NOOP("Sort op.")}, {Attributes::SourceType, QT_TR_NOOP("Source type")}, - {Attributes::SRC_ENCODING, QT_TR_NOOP("Src. encoding")}, {Attributes::STATE_TYPE, QT_TR_NOOP("State type")}, - {Attributes::STORAGE, QT_TR_NOOP("Storage")}, {Attributes::SUPERUSER, QT_TR_NOOP("Superuser")}, - {Attributes::TABLESPACE, QT_TR_NOOP("Tablespace")}, {Attributes::TPMOD_IN_FUNC, QT_TR_NOOP("Type mod. in func.")}, - {Attributes::TPMOD_OUT_FUNC, QT_TR_NOOP("Type mod. out func.")}, {Attributes::TRANSITION_FUNC, QT_TR_NOOP("Transition func.")}, - {Attributes::TRUSTED, QT_TR_NOOP("Trusted")}, {Attributes::TYPE, QT_TR_NOOP("Type")}, - {Attributes::TYPE_ATTRIBUTE, QT_TR_NOOP("Type attribute")}, {Attributes::TYPES, QT_TR_NOOP("Types")}, + {Attributes::SrcEncoding, QT_TR_NOOP("Src. encoding")}, {Attributes::StateType, QT_TR_NOOP("State type")}, + {Attributes::Storage, QT_TR_NOOP("Storage")}, {Attributes::Superuser, QT_TR_NOOP("Superuser")}, + {Attributes::Tablespace, QT_TR_NOOP("Tablespace")}, {Attributes::TpmodInFunc, QT_TR_NOOP("Type mod. in func.")}, + {Attributes::TpmodOutFunc, QT_TR_NOOP("Type mod. out func.")}, {Attributes::TransitionFunc, QT_TR_NOOP("Transition func.")}, + {Attributes::Trusted, QT_TR_NOOP("Trusted")}, {Attributes::Type, QT_TR_NOOP("Type")}, + {Attributes::TypeAttribute, QT_TR_NOOP("Type attribute")}, {Attributes::TYPES, QT_TR_NOOP("Types")}, {Attributes::UNLOGGED, QT_TR_NOOP("Unlogged")}, {Attributes::VALIDATOR, QT_TR_NOOP("Validator func.")}, {Attributes::VALIDITY, QT_TR_NOOP("Validity")}, {Attributes::WINDOW_FUNC, QT_TR_NOOP("Windows func.")}, {Attributes::False, QT_TR_NOOP("false")}, {Attributes::True, QT_TR_NOOP("true")}, {Attributes::Cache, QT_TR_NOOP("Cache value")}, {Attributes::Cycle, QT_TR_NOOP("Cycle")}, {Attributes::Increment, QT_TR_NOOP("Increment")}, {Attributes::MaxValue, QT_TR_NOOP("Max. value")}, - {Attributes::MinValue, QT_TR_NOOP("Min. value")}, {Attributes::START, QT_TR_NOOP("Start value")}, - {Attributes::LastValue, QT_TR_NOOP("Last value")}, {Attributes::SUBTYPE, QT_TR_NOOP("Subtype")}, + {Attributes::MinValue, QT_TR_NOOP("Min. value")}, {Attributes::Start, QT_TR_NOOP("Start value")}, + {Attributes::LastValue, QT_TR_NOOP("Last value")}, {Attributes::Subtype, QT_TR_NOOP("Subtype")}, {Attributes::OpClass, QT_TR_NOOP("Op. class")}, {Attributes::CanonicalFunc, QT_TR_NOOP("Canonical func.")}, - {Attributes::SUBTYPE_DIFF_FUNC, QT_TR_NOOP("Subtype diff func.")}, {Attributes::Deferrable, QT_TR_NOOP("Deferrable")}, + {Attributes::SubtypeDiffFunc, QT_TR_NOOP("Subtype diff func.")}, {Attributes::Deferrable, QT_TR_NOOP("Deferrable")}, {Attributes::PerRow, QT_TR_NOOP("For each row")}, {Attributes::FiringType, QT_TR_NOOP("Firing")}, {Attributes::InsEvent, QT_TR_NOOP("On insert")}, {Attributes::DelEvent, QT_TR_NOOP("On delete")}, - {Attributes::UPD_EVENT, QT_TR_NOOP("On update")}, {Attributes::TRUNC_EVENT, QT_TR_NOOP("On truncate")}, - {Attributes::Arguments, QT_TR_NOOP("Arguments")}, {Attributes::TABLE, QT_TR_NOOP("Table")}, - {Attributes::TRIGGER_FUNC, QT_TR_NOOP("Trigger func.")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, + {Attributes::UPD_EVENT, QT_TR_NOOP("On update")}, {Attributes::TruncEvent, QT_TR_NOOP("On truncate")}, + {Attributes::Arguments, QT_TR_NOOP("Arguments")}, {Attributes::Table, QT_TR_NOOP("Table")}, + {Attributes::TriggerFunc, QT_TR_NOOP("Trigger func.")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::Condition, QT_TR_NOOP("Condition")}, {Attributes::DeferType, QT_TR_NOOP("Deferment")}, {Attributes::EventType, QT_TR_NOOP("Event")}, {Attributes::ExecType, QT_TR_NOOP("Execution mode")}, {Attributes::Commands, QT_TR_NOOP("Commands")}, {Attributes::Position, QT_TR_NOOP("Position")}, @@ -107,7 +107,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Factor, QT_TR_NOOP("Fill factor")}, {Attributes::NoInherit, QT_TR_NOOP("No inherit")}, {Attributes::OpClasses, QT_TR_NOOP("Op. classes")}, {Attributes::Operators, QT_TR_NOOP("Operators")}, {Attributes::RefTable, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, - {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SRC_COLUMNS, QT_TR_NOOP("Columns")}, + {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SrcColumns, QT_TR_NOOP("Columns")}, {Attributes::UNIQUE, QT_TR_NOOP("Unique")}, {Attributes::Predicate, QT_TR_NOOP("Predicate")}, {Attributes::Collations, QT_TR_NOOP("Collations")}, {Attributes::Inherited, QT_TR_NOOP("Inherited")}, {Attributes::ClientEncoding, QT_TR_NOOP("Client encoding")}, {Attributes::ConfigFile, QT_TR_NOOP("Configuration file")}, @@ -115,9 +115,9 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::DynamicSharedMemory, QT_TR_NOOP("Dynamic shared memory")}, {Attributes::HbaFile, QT_TR_NOOP("Hba file")}, {Attributes::ListenAddresses, QT_TR_NOOP("Listen addresses")}, {Attributes::MaxConnections, QT_TR_NOOP("Max. connections")}, {Attributes::Port, QT_TR_NOOP("Listen port")}, {Attributes::ServerEncoding, QT_TR_NOOP("Server encoding")}, - {Attributes::SSL, QT_TR_NOOP("SSL")}, {Attributes::SSL_CA_FILE, QT_TR_NOOP("SSL ca file")}, - {Attributes::SSL_CERT_FILE, QT_TR_NOOP("SSL cert file")}, {Attributes::SSL_CRL_FILE, QT_TR_NOOP("SSL crl file")}, - {Attributes::SSL_KEY_FILE, QT_TR_NOOP("SSL key file")}, {Attributes::ServerVersion, QT_TR_NOOP("Server version")}, + {Attributes::Ssl, QT_TR_NOOP("SSL")}, {Attributes::SslCaFile, QT_TR_NOOP("SSL ca file")}, + {Attributes::SslCertFile, QT_TR_NOOP("SSL cert file")}, {Attributes::SslCrlFile, QT_TR_NOOP("SSL crl file")}, + {Attributes::SslKeyFile, QT_TR_NOOP("SSL key file")}, {Attributes::ServerVersion, QT_TR_NOOP("Server version")}, {Attributes::IdentFile, QT_TR_NOOP("Ident file")}, {Attributes::PasswordEncryption, QT_TR_NOOP("Password encryption")}, {Attributes::Connection, QT_TR_NOOP("Connection ID")}, {Attributes::ServerPid, QT_TR_NOOP("Server PID")}, {Attributes::ServerProtocol, QT_TR_NOOP("Server protocol")}, {Attributes::Referrers, QT_TR_NOOP("Referrers")}, @@ -311,9 +311,9 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) QRegExp oid_regexp=QRegExp(QString("^[0-9]+")); map dep_types={{Attributes::Owner, ObjectType::Role}, {Attributes::Schema, ObjectType::Schema}, - {Attributes::TABLESPACE, ObjectType::Tablespace}, + {Attributes::Tablespace, ObjectType::Tablespace}, {Attributes::Collation, ObjectType::Collation}, - {Attributes::TABLE, ObjectType::Table}}; + {Attributes::Table, ObjectType::Table}}; if(attribs.count(Attributes::ObjectType)!=0) obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); @@ -453,21 +453,21 @@ void DatabaseExplorerWidget::formatEventTriggerAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) { formatOidAttribs(attribs, { Attributes::FinalFunc, - Attributes::TRANSITION_FUNC }, ObjectType::Function, false); + Attributes::TransitionFunc }, ObjectType::Function, false); formatOidAttribs(attribs, { Attributes::TYPES }, ObjectType::Type, true); attribs[Attributes::Signature]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[Attributes::Name])) .arg(attribs[Attributes::TYPES])).replace(ElemSeparator, QString(",")); - attribs[Attributes::STATE_TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::STATE_TYPE]); + attribs[Attributes::StateType]=getObjectName(ObjectType::Type, attribs[Attributes::StateType]); attribs[Attributes::SortOp]=getObjectName(ObjectType::Operator, attribs[Attributes::SortOp]); attribs[Attributes::InitialCond]=Catalog::parseArrayValues(attribs[Attributes::InitialCond]).join(ElemSeparator); } void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) { - formatBooleanAttribs(attribs, { Attributes::TRUSTED }); + formatBooleanAttribs(attribs, { Attributes::Trusted }); formatOidAttribs(attribs, { Attributes::VALIDATOR_FUNC, Attributes::HandlerFunc, @@ -480,7 +480,7 @@ void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) Attributes::MemberRoles, Attributes::RefRoles }, ObjectType::Role, true); - formatBooleanAttribs(attribs, { Attributes::SUPERUSER, Attributes::Inherit, + formatBooleanAttribs(attribs, { Attributes::Superuser, Attributes::Inherit, Attributes::CreateRole, Attributes::CreateDb, Attributes::Login, Attributes::Encrypted, Attributes::Replication }); @@ -495,7 +495,7 @@ void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::NotNull }); - attribs[Attributes::TYPE]=getObjectName(ObjectType::Type, attribs[Attributes::TYPE]); + attribs[Attributes::Type]=getObjectName(ObjectType::Type, attribs[Attributes::Type]); } void DatabaseExplorerWidget::formatExtensionAttribs(attribs_map &attribs) @@ -573,7 +573,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) { QStringList owner_col, seq_values=Catalog::parseArrayValues(attribs[Attributes::Attribute]), - seq_attrs={ Attributes::START, Attributes::MinValue, + seq_attrs={ Attributes::Start, Attributes::MinValue, Attributes::MaxValue, Attributes::Increment, Attributes::Cache, Attributes::Cycle }; QString sch_name=getObjectName(ObjectType::Schema, attribs[Attributes::Schema]); @@ -622,7 +622,7 @@ void DatabaseExplorerWidget::formatViewAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) { QStringList range_attr=Catalog::parseArrayValues(attribs[Attributes::RangeAttribs]), - type_attr=Catalog::parseArrayValues(attribs[Attributes::TYPE_ATTRIBUTE]); + type_attr=Catalog::parseArrayValues(attribs[Attributes::TypeAttribute]); formatBooleanAttribs(attribs, { Attributes::ByValue, Attributes::Collatable, @@ -632,8 +632,8 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) Attributes::OutputFunc, Attributes::RecvFunc, Attributes::SendFunc, - Attributes::TPMOD_IN_FUNC, - Attributes::TPMOD_OUT_FUNC }, ObjectType::Function, false); + Attributes::TpmodInFunc, + Attributes::TpmodOutFunc }, ObjectType::Function, false); attribs[Attributes::Element]=getObjectName(ObjectType::Type, attribs[Attributes::Element]); if(attribs[Attributes::Enumerations].isEmpty()) @@ -644,11 +644,11 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) attribs.erase(Attributes::RangeAttribs); if(!range_attr.isEmpty()) { - attribs[Attributes::SUBTYPE]=getObjectName(ObjectType::Type, range_attr[0]); + attribs[Attributes::Subtype]=getObjectName(ObjectType::Type, range_attr[0]); attribs[Attributes::Collation]=getObjectName(ObjectType::Collation, range_attr[1]); attribs[Attributes::OpClass]=getObjectName(ObjectType::OpClass, range_attr[2]); attribs[Attributes::CanonicalFunc]=getObjectName(ObjectType::Function, range_attr[3]); - attribs[Attributes::SUBTYPE_DIFF_FUNC]=getObjectName(ObjectType::Function, range_attr[4]); + attribs[Attributes::SubtypeDiffFunc]=getObjectName(ObjectType::Function, range_attr[4]); } if(!type_attr.isEmpty()) @@ -662,10 +662,10 @@ void DatabaseExplorerWidget::formatTypeAttribs(attribs_map &attribs) fmt_attribs.push_back(list.join(QLatin1String(" "))); } - attribs[Attributes::TYPE_ATTRIBUTE]=fmt_attribs.join(ElemSeparator); + attribs[Attributes::TypeAttribute]=fmt_attribs.join(ElemSeparator); } else - attribs.erase(Attributes::TYPE_ATTRIBUTE); + attribs.erase(Attributes::TypeAttribute); } void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) @@ -674,8 +674,8 @@ void DatabaseExplorerWidget::formatOperatorClassAttribs(attribs_map &attribs) attribs[Attributes::Family]=getObjectName(ObjectType::OpFamily, attribs[Attributes::Family]); formatBooleanAttribs(attribs, { Attributes::Default }); - formatOidAttribs(attribs, { Attributes::STORAGE, - Attributes::TYPE }, ObjectType::Type, false); + formatOidAttribs(attribs, { Attributes::Storage, + Attributes::Type }, ObjectType::Type, false); array_vals=Catalog::parseArrayValues(attribs[Attributes::Function]); @@ -717,9 +717,9 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) Attributes::InsEvent, Attributes::DelEvent, Attributes::UPD_EVENT, - Attributes::TRUNC_EVENT }); + Attributes::TruncEvent }); - attribs[Attributes::TRIGGER_FUNC]=getObjectName(ObjectType::Function, attribs[Attributes::TRIGGER_FUNC]); + attribs[Attributes::TriggerFunc]=getObjectName(ObjectType::Function, attribs[Attributes::TriggerFunc]); attribs[Attributes::Arguments]=Catalog::parseArrayValues(attribs[Attributes::Arguments]).join(ElemSeparator); attribs[Attributes::Columns]=Catalog::parseArrayValues(attribs[Attributes::Columns]).join(ElemSeparator); } @@ -735,7 +735,7 @@ void DatabaseExplorerWidget::formatColumnAttribs(attribs_map &attribs) Attributes::Inherited }); attribs[Attributes::Position]=attribs[Attributes::Oid]; attribs.erase(Attributes::Oid); - attribs.erase(Attributes::TYPE_OID); + attribs.erase(Attributes::TypeOid); } void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) @@ -746,16 +746,16 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) {Attributes::CkConstr, ConstraintType(ConstraintType::Check)}, {Attributes::ExConstr, ConstraintType(ConstraintType::Exclude)}}; - ConstraintType constr_type=types[attribs[Attributes::TYPE]]; - QStringList names=getObjectName(ObjectType::Table, attribs[Attributes::TABLE]).split('.'); + ConstraintType constr_type=types[attribs[Attributes::Type]]; + QStringList names=getObjectName(ObjectType::Table, attribs[Attributes::Table]).split('.'); formatBooleanAttribs(attribs, { Attributes::Deferrable, Attributes::NoInherit }); - attribs[Attributes::TYPE]=~types[attribs[Attributes::TYPE]]; + attribs[Attributes::Type]=~types[attribs[Attributes::Type]]; attribs[Attributes::OpClasses]=getObjectsNames(ObjectType::OpClass, Catalog::parseArrayValues(attribs[Attributes::OpClasses])).join(ElemSeparator); - attribs[Attributes::SRC_COLUMNS]=getObjectsNames(ObjectType::Column, - Catalog::parseArrayValues(attribs[Attributes::SRC_COLUMNS]), + attribs[Attributes::SrcColumns]=getObjectsNames(ObjectType::Column, + Catalog::parseArrayValues(attribs[Attributes::SrcColumns]), names[0], names[1]).join(ElemSeparator); if(constr_type==ConstraintType::ForeignKey) @@ -799,10 +799,10 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) { - QStringList names=getObjectName(ObjectType::Table, attribs[Attributes::TABLE]).split('.'); + QStringList names=getObjectName(ObjectType::Table, attribs[Attributes::Table]).split('.'); if(names.isEmpty() || names.size() == 1) - names=getObjectName(ObjectType::View, attribs[Attributes::TABLE]).split('.'); + names=getObjectName(ObjectType::View, attribs[Attributes::Table]).split('.'); formatBooleanAttribs(attribs, { Attributes::UNIQUE }); @@ -1120,7 +1120,7 @@ void DatabaseExplorerWidget::handleSelectedSnippet(const QString &snip_id) //Formatting a schema qualified "table" attribute for table children objects if(TableObject::isTableObject(obj_type) && !sch_name.isEmpty() && !tab_name.isEmpty()) - attribs[Attributes::TABLE]=BaseObject::formatName(sch_name) + QString(".") + BaseObject::formatName(tab_name); + attribs[Attributes::Table]=BaseObject::formatName(sch_name) + QString(".") + BaseObject::formatName(tab_name); } //Formatting the "name" attribute if it is not schema qualified else if(attribs.count(Attributes::Schema) && @@ -1181,14 +1181,14 @@ attribs_map DatabaseExplorerWidget::extractAttributesFromItem(QTreeWidgetItem *i //Formatting the names attribs[Attributes::Name]=BaseObject::formatName(obj_name, obj_type==ObjectType::Operator); - attribs[Attributes::TABLE]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); + attribs[Attributes::Table]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectTable, Qt::UserRole).toString()); attribs[Attributes::Schema]=BaseObject::formatName(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString()); //For table objects the "table" attribute must be schema qualified if(obj_type!=ObjectType::Index && TableObject::isTableObject(obj_type)) { - attribs[Attributes::TABLE]=attribs[Attributes::Schema] + QString(".") + attribs[Attributes::TABLE]; - attribs[Attributes::Signature]=attribs[Attributes::Name] + QString(" ON %1").arg(attribs[Attributes::TABLE]); + attribs[Attributes::Table]=attribs[Attributes::Schema] + QString(".") + attribs[Attributes::Table]; + attribs[Attributes::Signature]=attribs[Attributes::Name] + QString(" ON %1").arg(attribs[Attributes::Table]); } //For operators and functions there must exist the signature attribute else if(obj_type==ObjectType::Operator || obj_type==ObjectType::Function) @@ -1335,7 +1335,7 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin schparser.ignoreUnkownAttributes(true); truc_cmd=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + GlobalAttributes::AlterSchemaDir + GlobalAttributes::DirSeparator + - Attributes::TRUNCATE + GlobalAttributes::SchemaExt, + Attributes::Truncate + GlobalAttributes::SchemaExt, attribs); //Executes the truncate cmd @@ -1497,7 +1497,7 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) for(auto &fk : ref_fks) { - ref_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::TABLE].toUInt()); + ref_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::Table].toUInt()); ref_schema = catalog.getObjectAttributes(ObjectType::Schema, ref_table[Attributes::Schema].toUInt()); tab_list.push_back(QString("%1.%2").arg(ref_schema[Attributes::Name]).arg(ref_table[Attributes::Name])); } @@ -1610,7 +1610,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) { QTreeWidgetItem *fk_item=nullptr, *src_item=nullptr; - if(cached_attribs[Attributes::TYPE]==~ConstraintType(ConstraintType::ForeignKey)) + if(cached_attribs[Attributes::Type]==~ConstraintType(ConstraintType::ForeignKey)) { /* Creates two items denoting the source columns and referenced tables. These items have a negative id indicating that no popup menu will be show if user @@ -1620,11 +1620,11 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) src_item->setData(DatabaseImportForm::ObjectId, Qt::UserRole, QVariant::fromValue(-1)); src_item->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("column"))); src_item->setText(0, QString("%1(%2)") - .arg(cached_attribs[Attributes::TABLE]) - .arg(cached_attribs[Attributes::SRC_COLUMNS])); + .arg(cached_attribs[Attributes::Table]) + .arg(cached_attribs[Attributes::SrcColumns])); src_item->setToolTip(0, trUtf8("Src. table: %1\nSrc. column(s): %2") - .arg(cached_attribs[Attributes::TABLE]) - .arg(cached_attribs[Attributes::SRC_COLUMNS])); + .arg(cached_attribs[Attributes::Table]) + .arg(cached_attribs[Attributes::SrcColumns])); src_item->setFlags(Qt::ItemIsEnabled); fk_item=new QTreeWidgetItem(item); @@ -1638,10 +1638,10 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) .arg(cached_attribs[Attributes::DstColumns])); fk_item->setFlags(Qt::ItemIsEnabled); } - else if(cached_attribs[Attributes::TYPE]==~ConstraintType(ConstraintType::Unique) || - cached_attribs[Attributes::TYPE]==~ConstraintType(ConstraintType::PrimaryKey)) + else if(cached_attribs[Attributes::Type]==~ConstraintType(ConstraintType::Unique) || + cached_attribs[Attributes::Type]==~ConstraintType(ConstraintType::PrimaryKey)) { - QStringList columns=cached_attribs[Attributes::SRC_COLUMNS].split(ElemSeparator); + QStringList columns=cached_attribs[Attributes::SrcColumns].split(ElemSeparator); for(auto &col : columns) { diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 0fe8c2dd67..b952cc4263 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -279,7 +279,7 @@ void DatabaseImportHelper::retrieveTableColumns(const QString &sch_name, const Q for(auto &itr : cols) { col_oid=itr.at(Attributes::Oid).toUInt(); - tab_oid=itr.at(Attributes::TABLE).toUInt(); + tab_oid=itr.at(Attributes::Table).toUInt(); columns[tab_oid][col_oid]=itr; } } @@ -420,8 +420,8 @@ void DatabaseImportHelper::createConstraints(void) try { //Check constraints are created only if they are not inherited, other types are created normally - if(attribs[Attributes::TYPE]!=Attributes::CkConstr || - (attribs[Attributes::TYPE]==Attributes::CkConstr && + if(attribs[Attributes::Type]!=Attributes::CkConstr || + (attribs[Attributes::Type]==Attributes::CkConstr && attribs[Attributes::Inherited]!=Attributes::True)) { emit s_progressUpdated(progress, @@ -686,8 +686,8 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) if(attribs.count(Attributes::Owner)) attribs[Attributes::Owner]=getDependencyObject(attribs[Attributes::Owner], ObjectType::Role, false, auto_resolve_deps); - if(attribs.count(Attributes::TABLESPACE)) - attribs[Attributes::TABLESPACE]=getDependencyObject(attribs[Attributes::TABLESPACE], ObjectType::Tablespace, false, auto_resolve_deps); + if(attribs.count(Attributes::Tablespace)) + attribs[Attributes::Tablespace]=getDependencyObject(attribs[Attributes::Tablespace], ObjectType::Tablespace, false, auto_resolve_deps); if(attribs.count(Attributes::Schema)) attribs[Attributes::Schema]=getDependencyObject(attribs[Attributes::Schema], ObjectType::Schema, false, auto_resolve_deps); @@ -1015,7 +1015,7 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) attribs[Attributes::Constraints]+= schparser.getCodeDefinition(Attributes::DomConstraint, aux_attribs, SchemaParser::XmlDefinition); } - attribs[Attributes::TYPE]=getType(attribs[Attributes::TYPE], true, attribs); + attribs[Attributes::Type]=getType(attribs[Attributes::Type], true, attribs); attribs[Attributes::Collation]=getDependencyObject(attribs[Attributes::Collation], ObjectType::Collation); loadObjectXML(ObjectType::Domain, attribs); dom=dbmodel->createDomain(); @@ -1143,7 +1143,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) //Case the function's language is C the symbol is the 'definition' attribute if(getObjectName(attribs[Attributes::Language])==~LanguageType("c")) { - attribs[Attributes::SYMBOL]=attribs[Attributes::Definition]; + attribs[Attributes::Symbol]=attribs[Attributes::Definition]; attribs[Attributes::Definition]=QString(); } @@ -1241,20 +1241,20 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) QStringList array_vals, list; attribs[Attributes::Family]=getObjectName(attribs[Attributes::Family], true); - attribs[Attributes::TYPE]=getType(attribs[Attributes::TYPE], true, attribs); + attribs[Attributes::Type]=getType(attribs[Attributes::Type], true, attribs); //Generating attributes for STORAGE elements - if(attribs[Attributes::STORAGE]!=QString("0")) + if(attribs[Attributes::Storage]!=QString("0")) { - elem_attr[Attributes::STORAGE]=Attributes::True; - elem_attr[Attributes::Definition]=getType(attribs[Attributes::STORAGE], true); + elem_attr[Attributes::Storage]=Attributes::True; + elem_attr[Attributes::Definition]=getType(attribs[Attributes::Storage], true); elems.push_back(elem_attr); } else if(attribs[Attributes::Function].isEmpty() && attribs[Attributes::Operator].isEmpty()) { - elem_attr[Attributes::STORAGE]=Attributes::True; - elem_attr[Attributes::Definition]=attribs[Attributes::TYPE]; + elem_attr[Attributes::Storage]=Attributes::True; + elem_attr[Attributes::Definition]=attribs[Attributes::Type]; elems.push_back(elem_attr); } @@ -1268,7 +1268,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) for(int i=0; i < array_vals.size(); i++) { list=array_vals[i].split(':'); - elem_attr[Attributes::STRATEGY_NUM]=list[0]; + elem_attr[Attributes::StrategyNum]=list[0]; elem_attr[Attributes::Definition]=getDependencyObject(list[1], ObjectType::Function, true); elems.push_back(elem_attr); } @@ -1285,7 +1285,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) { list=array_vals[i].split(':'); elem_attr[Attributes::Definition]=""; - elem_attr[Attributes::STRATEGY_NUM]=list[0]; + elem_attr[Attributes::StrategyNum]=list[0]; elem_attr[Attributes::Definition]+=getDependencyObject(list[1], ObjectType::Operator, true); elem_attr[Attributes::Definition]+=getDependencyObject(list[2], ObjectType::OpFamily, true); elems.push_back(elem_attr); @@ -1438,7 +1438,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) { QStringList owner_col=attribs[Attributes::OwnerColumn].split(':'), seq_attribs=Catalog::parseArrayValues(attribs[Attributes::Attribute]); - QString attr[]={ Attributes::START, Attributes::MinValue, + QString attr[]={ Attributes::Start, Attributes::MinValue, Attributes::MaxValue, Attributes::Increment, Attributes::Cache, Attributes::Cycle }; @@ -1501,7 +1501,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) try { QStringList types; - QString func_types[]={ Attributes::TRANSITION_FUNC, + QString func_types[]={ Attributes::TransitionFunc, Attributes::FinalFunc }, sch_name; @@ -1517,8 +1517,8 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) attribs[Attributes::TYPES]+=types[i]; } - attribs[Attributes::STATE_TYPE]=getType(attribs[Attributes::STATE_TYPE], true, - {{Attributes::RefType, Attributes::STATE_TYPE}}); + attribs[Attributes::StateType]=getType(attribs[Attributes::StateType], true, + {{Attributes::RefType, Attributes::StateType}}); attribs[Attributes::SortOp]=getDependencyObject(attribs[Attributes::SortOp], ObjectType::Operator, true); loadObjectXML(ObjectType::Aggregate, attribs); @@ -1559,8 +1559,8 @@ void DatabaseImportHelper::createType(attribs_map &attribs) QStringList comp_attribs, values; TypeAttribute type_attrib; - comp_attribs=Catalog::parseArrayValues(attribs[Attributes::TYPE_ATTRIBUTE]); - attribs[Attributes::TYPE_ATTRIBUTE]=QString(); + comp_attribs=Catalog::parseArrayValues(attribs[Attributes::TypeAttribute]); + attribs[Attributes::TypeAttribute]=QString(); for(int i=0; i < comp_attribs.size(); i++) { @@ -1571,7 +1571,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) type_attrib.setName(values[0].remove('"')); type_attrib.setType(PgSqlType::parseString(values[1].remove('\\'))); type_attrib.setCollation(dbmodel->getObject(getObjectName(values[2].remove('"')), ObjectType::Collation)); - attribs[Attributes::TYPE_ATTRIBUTE]+=type_attrib.getCodeDefinition(SchemaParser::XmlDefinition); + attribs[Attributes::TypeAttribute]+=type_attrib.getCodeDefinition(SchemaParser::XmlDefinition); } } } @@ -1579,11 +1579,11 @@ void DatabaseImportHelper::createType(attribs_map &attribs) { QStringList range_attr=Catalog::parseArrayValues(attribs[Attributes::RangeAttribs]); - attribs[Attributes::SUBTYPE]=getType(range_attr[0], true); + attribs[Attributes::Subtype]=getType(range_attr[0], true); attribs[Attributes::Collation]=getDependencyObject(range_attr[1], ObjectType::Collation, true); attribs[Attributes::OpClass]=getDependencyObject(range_attr[2], ObjectType::OpClass, true); attribs[Attributes::CanonicalFunc]=getDependencyObject(range_attr[3], ObjectType::Function, true); - attribs[Attributes::SUBTYPE_DIFF_FUNC]=getDependencyObject(range_attr[4], ObjectType::Function, true); + attribs[Attributes::SubtypeDiffFunc]=getDependencyObject(range_attr[4], ObjectType::Function, true); } else { @@ -1592,8 +1592,8 @@ void DatabaseImportHelper::createType(attribs_map &attribs) Attributes::OutputFunc, Attributes::RecvFunc, Attributes::SendFunc, - Attributes::TPMOD_IN_FUNC, - Attributes::TPMOD_OUT_FUNC, + Attributes::TpmodInFunc, + Attributes::TpmodOutFunc, Attributes::AnalyzeFunc }; unsigned i, count=sizeof(func_types)/sizeof(QString); @@ -1673,7 +1673,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) inh_cols.push_back(col_idx); col.setName(itr->second[Attributes::Name]); - type_oid=itr->second[Attributes::TYPE_OID].toUInt(); + type_oid=itr->second[Attributes::TypeOid].toUInt(); /* If the type has an entry on the types map and its OID is greater than system object oids, means that it's a user defined type, thus, there is the need to check if the type @@ -1700,7 +1700,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) else { is_type_registered=(types.count(type_oid)!=0); - type_name=itr->second[Attributes::TYPE]; + type_name=itr->second[Attributes::Type]; } /* Checking if the type used by the column exists (is registered), @@ -1709,13 +1709,13 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) the non-array type, this way, if the original type is created there is no need to create the array form */ if(auto_resolve_deps && !is_type_registered && !type_name.contains(QString("[]"))) { - type_def=getDependencyObject(itr->second[Attributes::TYPE_OID], ObjectType::Type); + type_def=getDependencyObject(itr->second[Attributes::TypeOid], ObjectType::Type); unknown_obj_xml=UnkownObjectOidXml.arg(type_oid); /* If the type still doesn't exists means that the column maybe is referencing a domain this way pgModeler will try to retrieve the mentionend object */ if(type_def==unknown_obj_xml) - type_def=getDependencyObject(itr->second[Attributes::TYPE_OID], ObjectType::Domain); + type_def=getDependencyObject(itr->second[Attributes::TypeOid], ObjectType::Domain); } col.setIdentityType(BaseType::Null); @@ -1916,10 +1916,10 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) attribs[Attributes::Commands]=Catalog::parseRuleCommands(attribs[Attributes::Commands]).join(';'); - if(attribs[Attributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::View)) + if(attribs[Attributes::TableType]==BaseObject::getSchemaName(ObjectType::View)) table_type=ObjectType::View; - attribs[Attributes::TABLE]=getDependencyObject(attribs[Attributes::TABLE], table_type, true, auto_resolve_deps, false); + attribs[Attributes::Table]=getDependencyObject(attribs[Attributes::Table], table_type, true, auto_resolve_deps, false); loadObjectXML(ObjectType::Rule, attribs); rule=dbmodel->createRule(); @@ -1938,11 +1938,11 @@ void DatabaseImportHelper::createTrigger(attribs_map &attribs) { ObjectType table_type=ObjectType::Table; - if(attribs[Attributes::TABLE_TYPE]==BaseObject::getSchemaName(ObjectType::View)) + if(attribs[Attributes::TableType]==BaseObject::getSchemaName(ObjectType::View)) table_type=ObjectType::View; - attribs[Attributes::TABLE]=getDependencyObject(attribs[Attributes::TABLE], table_type, true, auto_resolve_deps, false); - attribs[Attributes::TRIGGER_FUNC]=getDependencyObject(attribs[Attributes::TRIGGER_FUNC], ObjectType::Function, true, true); + attribs[Attributes::Table]=getDependencyObject(attribs[Attributes::Table], table_type, true, auto_resolve_deps, false); + attribs[Attributes::TriggerFunc]=getDependencyObject(attribs[Attributes::TriggerFunc], ObjectType::Function, true, true); attribs[Attributes::Arguments]=Catalog::parseArrayValues(attribs[Attributes::Arguments].remove(QString(",\"\""))).join(','); loadObjectXML(ObjectType::Trigger, attribs); @@ -2011,12 +2011,12 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) int i; attribs[Attributes::Factor]=QString("90"); - tab_name=getDependencyObject(attribs[Attributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); + tab_name=getDependencyObject(attribs[Attributes::Table], ObjectType::Table, true, auto_resolve_deps, false); parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::Table)); if(!parent_tab) { - tab_name=getDependencyObject(attribs[Attributes::TABLE], ObjectType::View, true, auto_resolve_deps, false); + tab_name=getDependencyObject(attribs[Attributes::Table], ObjectType::View, true, auto_resolve_deps, false); parent_tab=dynamic_cast(dbmodel->getObject(tab_name, ObjectType::View)); if(!parent_tab) @@ -2038,9 +2038,9 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) if(cols[i]!=QString("0")) { if(parent_tab->getObjectType() == ObjectType::Table) - elem.setColumn(dynamic_cast
(parent_tab)->getColumn(getColumnName(attribs[Attributes::TABLE], cols[i]))); + elem.setColumn(dynamic_cast
(parent_tab)->getColumn(getColumnName(attribs[Attributes::Table], cols[i]))); else - elem.setExpression(getColumnName(attribs[Attributes::TABLE], cols[i])); + elem.setExpression(getColumnName(attribs[Attributes::Table], cols[i])); } else if(!exprs.isEmpty()) { @@ -2072,7 +2072,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) attribs[Attributes::Elements]+=elem.getCodeDefinition(SchemaParser::XmlDefinition); } - attribs[Attributes::TABLE]=tab_name; + attribs[Attributes::Table]=tab_name; loadObjectXML(ObjectType::Index, attribs); dbmodel->createIndex(); } @@ -2089,7 +2089,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) try { - QString table_oid=attribs[Attributes::TABLE], + QString table_oid=attribs[Attributes::Table], ref_tab_oid=attribs[Attributes::RefTable], tab_name; Table *table=nullptr; @@ -2105,10 +2105,10 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) if(!factor.isEmpty() && factor[0].startsWith(QString("fillfactor="))) attribs[Attributes::Factor]=factor[0].remove(QString("fillfactor=")); - attribs[attribs[Attributes::TYPE]]=Attributes::True; + attribs[attribs[Attributes::Type]]=Attributes::True; table=dynamic_cast
(dbmodel->getObject(tab_name, ObjectType::Table)); - if(attribs[Attributes::TYPE]==Attributes::ExConstr) + if(attribs[Attributes::Type]==Attributes::ExConstr) { QStringList cols, opclasses, opers, exprs; ExcludeElement elem; @@ -2116,7 +2116,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) OperatorClass *opclass=nullptr; Operator *oper=nullptr; - attribs[Attributes::SRC_COLUMNS]=QString(); + attribs[Attributes::SrcColumns]=QString(); attribs[Attributes::Expression]=attribs[Attributes::Condition]; cols=Catalog::parseArrayValues(attribs[Attributes::Columns]); @@ -2169,15 +2169,15 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) else { //Clears the tablespace attribute when the constraint is fk avoiding errors - if(attribs[Attributes::TYPE]==Attributes::FkConstr) - attribs[Attributes::TABLESPACE]=QString(); + if(attribs[Attributes::Type]==Attributes::FkConstr) + attribs[Attributes::Tablespace]=QString(); - attribs[Attributes::SRC_COLUMNS]=getColumnNames(attribs[Attributes::TABLE], attribs[Attributes::SRC_COLUMNS]).join(','); + attribs[Attributes::SrcColumns]=getColumnNames(attribs[Attributes::Table], attribs[Attributes::SrcColumns]).join(','); } attribs[Attributes::RefTable]=getDependencyObject(ref_tab_oid, ObjectType::Table, false, true, false); attribs[Attributes::DstColumns]=getColumnNames(ref_tab_oid, attribs[Attributes::DstColumns]).join(','); - attribs[Attributes::TABLE]=tab_name; + attribs[Attributes::Table]=tab_name; loadObjectXML(ObjectType::Constraint, attribs); constr=dbmodel->createConstraint(nullptr); @@ -2200,7 +2200,7 @@ void DatabaseImportHelper::createPolicy(attribs_map &attribs) { try { - attribs[Attributes::TABLE]=getDependencyObject(attribs[Attributes::TABLE], ObjectType::Table, true, auto_resolve_deps, false); + attribs[Attributes::Table]=getDependencyObject(attribs[Attributes::Table], ObjectType::Table, true, auto_resolve_deps, false); attribs[Attributes::Roles]=getObjectNames(attribs[Attributes::Roles]).join(','); loadObjectXML(ObjectType::Policy, attribs); dbmodel->createPolicy(); @@ -2219,7 +2219,7 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) attribs[Attributes::Function]=getDependencyObject(attribs[Attributes::Function], ObjectType::Function, true, true); attribs[Attributes::Filter]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") .arg(Attributes::Filter) - .arg(Attributes::VARIABLE).arg(Attributes::TAG.toUpper()) + .arg(Attributes::VARIABLE).arg(Attributes::Tag.toUpper()) .arg(Attributes::VALUES) .arg(Catalog::parseArrayValues(attribs[Attributes::VALUES].remove('"')).join(',')); @@ -2266,8 +2266,8 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) else { //If the object is column it's necessary to retrive the parent table to get the valid reference to column - table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[Attributes::TABLE]), ObjectType::Table)); - object=table->getObject(getColumnName(attribs[Attributes::TABLE], attribs[Attributes::Oid]), ObjectType::Column); + table=dynamic_cast
(dbmodel->getObject(getObjectName(attribs[Attributes::Table]), ObjectType::Table)); + object=table->getObject(getColumnName(attribs[Attributes::Table], attribs[Attributes::Oid]), ObjectType::Column); } } diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 6ebc0b8c8f..cdd28ca9ce 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -742,7 +742,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin if(pks.empty()) warning_lbl->setText(trUtf8("The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. WARNING: those operations can affect more than one row.")); else - table_oid = pks[0][Attributes::TABLE].toUInt(); + table_oid = pks[0][Attributes::Table].toUInt(); } hint_frm->setVisible(obj_type==ObjectType::Table); @@ -839,13 +839,13 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin name_list.clear(); //Storing the source columns in a string - for(QString id : Catalog::parseArrayValues(fk[Attributes::SRC_COLUMNS])) + for(QString id : Catalog::parseArrayValues(fk[Attributes::SrcColumns])) col_ids.push_back(id.toUInt()); for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, schema, table, col_ids)) name_list.push_back(BaseObject::formatName(col[Attributes::Name])); - fk_infos[fk_name][Attributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); + fk_infos[fk_name][Attributes::SrcColumns] = name_list.join(Table::DataSeparator); col_ids.clear(); name_list.clear(); @@ -871,7 +871,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin col_ids.clear(); name_list.clear(); - aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::TABLE].toUInt()); + aux_table = catalog.getObjectAttributes(ObjectType::Table, fk[Attributes::Table].toUInt()); aux_schema = catalog.getObjectAttributes(ObjectType::Schema, aux_table[Attributes::Schema].toUInt()); fk_name = QString("%1.%2.%3") .arg(aux_schema[Attributes::Name]) @@ -879,7 +879,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin .arg(fk[Attributes::Name]); //Storing the source columns in a string - for(QString id : Catalog::parseArrayValues(fk[Attributes::SRC_COLUMNS])) + for(QString id : Catalog::parseArrayValues(fk[Attributes::SrcColumns])) col_ids.push_back(id.toUInt()); for(auto &col : catalog.getObjectsAttributes(ObjectType::Column, aux_schema[Attributes::Name], aux_table[Attributes::Name], col_ids)) @@ -891,8 +891,8 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin .arg(fk[Attributes::Name]), this, SLOT(browseReferrerTable())); action->setData(fk_name); - ref_fk_infos[fk_name][Attributes::SRC_COLUMNS] = name_list.join(Table::DataSeparator); - ref_fk_infos[fk_name][Attributes::TABLE] = aux_table[Attributes::Name]; + ref_fk_infos[fk_name][Attributes::SrcColumns] = name_list.join(Table::DataSeparator); + ref_fk_infos[fk_name][Attributes::Table] = aux_table[Attributes::Name]; ref_fk_infos[fk_name][Attributes::Schema] = aux_schema[Attributes::Name]; } } @@ -1147,13 +1147,13 @@ void DataManipulationForm::browseTable(const QString &fk_name, bool browse_ref_t if(browse_ref_tab) { src_cols = pk_col_names; - ref_cols = ref_fk_infos[fk_name][Attributes::SRC_COLUMNS].split(Table::DataSeparator); + ref_cols = ref_fk_infos[fk_name][Attributes::SrcColumns].split(Table::DataSeparator); schema = ref_fk_infos[fk_name][Attributes::Schema]; - table = ref_fk_infos[fk_name][Attributes::TABLE]; + table = ref_fk_infos[fk_name][Attributes::Table]; } else { - src_cols = fk_infos[fk_name][Attributes::SRC_COLUMNS].split(Table::DataSeparator); + src_cols = fk_infos[fk_name][Attributes::SrcColumns].split(Table::DataSeparator); ref_cols = fk_infos[fk_name][Attributes::DstColumns].split(Table::DataSeparator); schema = fk_infos[fk_name][Attributes::Schema]; table = fk_infos[fk_name][Attributes::RefTable]; diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index f612047581..c8eba88533 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -83,10 +83,10 @@ void EventTriggerWidget::setAttributes(DatabaseModel *model, OperationList *op_l event_cmb->setCurrentText(~event_trig->getEvent()); function_sel->setSelectedObject(event_trig->getFunction()); - QStringList filter=event_trig->getFilter(Attributes::TAG.toUpper()); + QStringList filter=event_trig->getFilter(Attributes::Tag.toUpper()); if(filter.isEmpty()) - filter=event_trig->getFilter(Attributes::TAG); + filter=event_trig->getFilter(Attributes::Tag); filter_tab->blockSignals(true); @@ -118,7 +118,7 @@ void EventTriggerWidget::applyConfiguration(void) event_trig->clearFilter(); for(unsigned row=0; row < filter_tab->getRowCount(); row++) - event_trig->setFilter(Attributes::TAG.toUpper(), filter_tab->getCellText(row, 0)); + event_trig->setFilter(Attributes::Tag.toUpper(), filter_tab->getCellText(row, 0)); finishConfiguration(); } diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 5c0024a9e4..dfaef490cf 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -327,7 +327,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) Attributes::FadedOut, Attributes::HideExtAttribs}, { Attributes::Role, - Attributes::TABLESPACE, + Attributes::Tablespace, Attributes::Collation, Attributes::Position, Attributes::AppendedSql, @@ -878,11 +878,11 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[Attributes::Change]=QString::number(alter_objs.size()); attribs[Attributes::Create]=QString::number(create_objs_count); attribs[Attributes::Drop]=QString::number(drop_objs.size()); - attribs[Attributes::TRUNCATE]=QString::number(truncate_tabs.size()); + attribs[Attributes::Truncate]=QString::number(truncate_tabs.size()); attribs[Attributes::AlterCmds]=QString(); attribs[Attributes::DropCmds]=QString(); attribs[Attributes::CreateCmds]=QString(); - attribs[Attributes::TRUNCATE_CMDS]=QString(); + attribs[Attributes::TruncateCmds]=QString(); attribs[Attributes::ConstrDefs]=QString(); attribs[Attributes::FkDefs]=QString(); attribs[Attributes::UNSET_PERMS]=unset_perms; @@ -916,7 +916,7 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[Attributes::FkDefs]+=itr.second; for(auto &itr : truncate_tabs) - attribs[Attributes::TRUNCATE_CMDS]+=itr.second; + attribs[Attributes::TruncateCmds]+=itr.second; for(auto &itr : alter_objs) attribs[Attributes::AlterCmds]+=itr.second; diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index fa9787c37e..b3f0fcd39b 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -26,9 +26,9 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob unsigned i; QString privs[]={ Attributes::SelectPriv, Attributes::InsertPriv, Attributes::UPDATE_PRIV, Attributes::DeletePriv, - Attributes::TRUNCATE_PRIV, Attributes::ReferencesPriv, - Attributes::TRIGGER_PRIV, Attributes::CreatePriv, - Attributes::ConnectPriv, Attributes::TEMPORARY_PRIV, + Attributes::TruncatePriv, Attributes::ReferencesPriv, + Attributes::TriggerPriv, Attributes::CreatePriv, + Attributes::ConnectPriv, Attributes::TemporaryPriv, Attributes::ExecutPriv, Attributes::USAGE_PRIV }; Ui_PermissionWidget::setupUi(this); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index e5b4442c9a..e983b63669 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -95,7 +95,7 @@ void RelationshipConfigWidget::loadConfiguration(void) try { int idx; - vector key_attribs={Attributes::TYPE}; + vector key_attribs={Attributes::Type}; BaseConfigWidget::loadConfiguration(GlobalAttributes::RelationshipsConf, config_params, key_attribs); fk_to_pk_rb->setChecked(config_params[Attributes::Connection][Attributes::Mode]==Attributes::ConnectFkToPk); @@ -215,7 +215,7 @@ void RelationshipConfigWidget::fillNamePatterns(void) QList pattern_ids={ Attributes::PkPattern, Attributes::UQ_PATTERN, Attributes::SrcColPattern, Attributes::DstColPattern, - Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern, + Attributes::SrcFkPattern, Attributes::DstFkPattern, Attributes::PkColPattern }; relnn=(rel_type==Attributes::RelationshipNn); @@ -256,7 +256,7 @@ void RelationshipConfigWidget::updatePattern(void) { uq_pattern_txt, Attributes::UQ_PATTERN }, { src_col_pattern_txt, Attributes::SrcColPattern }, { dst_col_pattern_txt, Attributes::DstColPattern }, - { src_fk_pattern_txt, Attributes::SRC_FK_PATTERN }, + { src_fk_pattern_txt, Attributes::SrcFkPattern }, { dst_fk_pattern_txt, Attributes::DstFkPattern }, { pk_col_pattern_txt, Attributes::PkColPattern } }; diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 2ef627799b..a79cb066ad 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -518,7 +518,7 @@ void RelationshipWidget::usePatternGlobalSettings(bool value) //Using the global settings pk_pattern_txt->setPlainText(confs[rel_type][Attributes::PkPattern]); - src_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::SRC_FK_PATTERN]); + src_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::SrcFkPattern]); dst_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::DstFkPattern]); uq_pattern_txt->setPlainText(confs[rel_type][Attributes::UQ_PATTERN]); src_col_pattern_txt->setPlainText(confs[rel_type][Attributes::SrcColPattern]); diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 17ab2b6020..25ff0b23a0 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -521,7 +521,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) if(xmlparser.getElementType()==XML_ELEMENT_NODE) { xmlparser.getElementAttributes(attribs); - expr_type=attribs[Attributes::TYPE]; + expr_type=attribs[Attributes::Type]; regexp.setPattern(attribs[Attributes::VALUE]); if(attribs[Attributes::RegularExp]==Attributes::True) diff --git a/libpgmodeler_ui/src/tagwidget.cpp b/libpgmodeler_ui/src/tagwidget.cpp index 39d3a8d0b6..47bd04f789 100644 --- a/libpgmodeler_ui/src/tagwidget.cpp +++ b/libpgmodeler_ui/src/tagwidget.cpp @@ -23,15 +23,15 @@ TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Tag) Ui_TagWidget::setupUi(this); configureFormLayout(tag_grid, ObjectType::Tag); - QStringList attribs={ Attributes::TABLE_NAME, Attributes::TABLE_SCHEMA_NAME, - Attributes::TABLE_TITLE, Attributes::TABLE_BODY, - Attributes::TABLE_EXT_BODY }; + QStringList attribs={ Attributes::TableName, Attributes::TableSchemaName, + Attributes::TableTitle, Attributes::TableBody, + Attributes::TableExtBody }; unsigned color_count=1; int row=0; for(auto &attr : attribs) { - if(color_count==1 && attr!=Attributes::TABLE_NAME && attr!=Attributes::TABLE_SCHEMA_NAME) + if(color_count==1 && attr!=Attributes::TableName && attr!=Attributes::TableSchemaName) color_count=3; color_pickers[attr]=new ColorPickerWidget(color_count, this); @@ -46,15 +46,15 @@ TagWidget::TagWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Tag) void TagWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Tag *tag) { unsigned color_count=1, i; - QStringList attribs={ Attributes::TABLE_NAME, Attributes::TABLE_SCHEMA_NAME, - Attributes::TABLE_TITLE, Attributes::TABLE_BODY, - Attributes::TABLE_EXT_BODY }; + QStringList attribs={ Attributes::TableName, Attributes::TableSchemaName, + Attributes::TableTitle, Attributes::TableBody, + Attributes::TableExtBody }; BaseObjectWidget::setAttributes(model, op_list, tag); for(auto &attr : attribs) { - if(color_count==1 && attr!=Attributes::TABLE_NAME && attr!=Attributes::TABLE_SCHEMA_NAME) + if(color_count==1 && attr!=Attributes::TableName && attr!=Attributes::TableSchemaName) color_count=3; for(i=0; i < color_count; i++) @@ -73,16 +73,16 @@ void TagWidget::applyConfiguration(void) { Tag *tag=nullptr; vector tagged_tabs; - QStringList attribs={ Attributes::TABLE_TITLE, Attributes::TABLE_BODY, - Attributes::TABLE_EXT_BODY }; + QStringList attribs={ Attributes::TableTitle, Attributes::TableBody, + Attributes::TableExtBody }; startConfiguration(); tag=dynamic_cast(this->object); BaseObjectWidget::applyConfiguration(); - tag->setElementColor(Attributes::TABLE_NAME, color_pickers[Attributes::TABLE_NAME]->getColor(0), Tag::FillColor1); - tag->setElementColor(Attributes::TABLE_SCHEMA_NAME, color_pickers[Attributes::TABLE_SCHEMA_NAME]->getColor(0), Tag::FillColor1); + tag->setElementColor(Attributes::TableName, color_pickers[Attributes::TableName]->getColor(0), Tag::FillColor1); + tag->setElementColor(Attributes::TableSchemaName, color_pickers[Attributes::TableSchemaName]->getColor(0), Tag::FillColor1); for(auto &attr : attribs) { diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index f44f6cf81d..d512be5a7c 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1047,8 +1047,8 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Replace tag by on tags. if(obj_xml.contains(TagExpr.arg(QString("usertype")))) { - obj_xml.replace(TagExpr.arg(Attributes::Parameter), TagExpr.arg(Attributes::TYPE_ATTRIBUTE)); - obj_xml.replace(EndTagExpr.arg(Attributes::Parameter), EndTagExpr.arg(Attributes::TYPE_ATTRIBUTE)); + obj_xml.replace(TagExpr.arg(Attributes::Parameter), TagExpr.arg(Attributes::TypeAttribute)); + obj_xml.replace(EndTagExpr.arg(Attributes::Parameter), EndTagExpr.arg(Attributes::TypeAttribute)); } if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Relationship)))) @@ -1493,15 +1493,15 @@ bool PgModelerCli::containsRelAttributes(const QString &str) { bool found=false; static vector attribs={ Attributes::Relationship, - Attributes::TYPE, Attributes::SRC_REQUIRED, Attributes::DstRequired, - Attributes::SRC_TABLE, Attributes::DstTable, Attributes::Points, + Attributes::Type, Attributes::SrcRequired, Attributes::DstRequired, + Attributes::SrcTable, Attributes::DstTable, Attributes::Points, Attributes::Columns, Attributes::Column, Attributes::Constraint, Attributes::Label, Attributes::Line, Attributes::Position, Attributes::Identifier, Attributes::Deferrable, Attributes::DeferType, - Attributes::TABLE_NAME, Attributes::SpecialPkCols, Attributes::TABLE, + Attributes::TableName, Attributes::SpecialPkCols, Attributes::Table, Attributes::AncestorTable, Attributes::CopyOptions, Attributes::CopyMode, Attributes::SrcColPattern, Attributes::DstColPattern, Attributes::PkPattern, - Attributes::UQ_PATTERN, Attributes::SRC_FK_PATTERN, Attributes::DstFkPattern }; + Attributes::UQ_PATTERN, Attributes::SrcFkPattern, Attributes::DstFkPattern }; for(unsigned i=0; i < attribs.size() && !found; i++) found=str.contains(attribs[i]); From 506c1cc4de1ce92668d1e5fc5939c82c5a21ba6a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 11:27:47 -0300 Subject: [PATCH 188/425] Attributes namespace static const items refactoring checkpoint --- libobjrenderer/src/baseobjectview.cpp | 4 +- libobjrenderer/src/graphicalview.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 4 +- libobjrenderer/src/tabletitleview.cpp | 6 +- libparsers/src/attributes.cpp | 106 +++++++++--------- libparsers/src/attributes.h | 106 +++++++++--------- libpgconnector/src/catalog.cpp | 2 +- libpgmodeler/src/aggregate.cpp | 4 +- libpgmodeler/src/basegraphicobject.cpp | 8 +- libpgmodeler/src/baseobject.cpp | 2 +- libpgmodeler/src/baserelationship.cpp | 12 +- libpgmodeler/src/column.cpp | 8 +- libpgmodeler/src/constraint.cpp | 10 +- libpgmodeler/src/databasemodel.cpp | 84 +++++++------- libpgmodeler/src/domain.cpp | 6 +- libpgmodeler/src/element.cpp | 2 +- libpgmodeler/src/eventtrigger.cpp | 4 +- libpgmodeler/src/function.cpp | 6 +- libpgmodeler/src/index.cpp | 8 +- libpgmodeler/src/language.cpp | 4 +- libpgmodeler/src/permission.cpp | 4 +- libpgmodeler/src/pgsqltypes.cpp | 8 +- libpgmodeler/src/policy.cpp | 8 +- libpgmodeler/src/relationship.cpp | 8 +- libpgmodeler/src/role.cpp | 8 +- libpgmodeler/src/sequence.cpp | 4 +- libpgmodeler/src/table.cpp | 12 +- libpgmodeler/src/textbox.cpp | 4 +- libpgmodeler/src/trigger.cpp | 4 +- libpgmodeler/src/type.cpp | 2 +- libpgmodeler/src/view.cpp | 4 +- .../src/appearanceconfigwidget.cpp | 16 +-- .../src/connectionsconfigwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 42 +++---- libpgmodeler_ui/src/databaseimporthelper.cpp | 36 +++--- libpgmodeler_ui/src/generalconfigwidget.cpp | 40 +++---- libpgmodeler_ui/src/mainwindow.cpp | 14 +-- libpgmodeler_ui/src/modelsdiffhelper.cpp | 2 +- libpgmodeler_ui/src/permissionwidget.cpp | 4 +- .../src/relationshipconfigwidget.cpp | 8 +- libpgmodeler_ui/src/relationshipwidget.cpp | 4 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 20 ++-- main-cli/src/pgmodelercli.cpp | 4 +- main/src/application.cpp | 4 +- 44 files changed, 326 insertions(+), 326 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 9360941f7a..482b0e16b7 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -238,7 +238,7 @@ void BaseObjectView::loadObjectsStyle(void) font.setPointSizeF(attribs[Attributes::Size].toDouble()); font.setBold(attribs[Attributes::Bold]==Attributes::True); font.setItalic(attribs[Attributes::Italic]==Attributes::True); - font.setUnderline(attribs[Attributes::UNDERLINE]==Attributes::True); + font.setUnderline(attribs[Attributes::Underline]==Attributes::True); font_fmt.setFont(font); font_config[Attributes::Global]=font_fmt; } @@ -249,7 +249,7 @@ void BaseObjectView::loadObjectsStyle(void) font=font_fmt.font(); font.setBold(attribs[Attributes::Bold]==Attributes::True); font.setItalic(attribs[Attributes::Italic]==Attributes::True); - font.setUnderline(attribs[Attributes::UNDERLINE]==Attributes::True); + font.setUnderline(attribs[Attributes::Underline]==Attributes::True); (itr->second).setFont(font); (itr->second).setForeground(QColor(attribs[Attributes::Color])); } diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index c8fa5e27d1..64b8478ffc 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -40,7 +40,7 @@ void GraphicalView::configureObject(void) vector tab_objs; QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; - QString attribs[]={ Attributes::VIEW_BODY, Attributes::VIEW_EXT_BODY }, + QString attribs[]={ Attributes::ViewBody, Attributes::ViewExtBody }, tag_attribs[]={ Attributes::TableBody, Attributes::TableExtBody }; double width, type_width=0, px=0; TableObjectView *col_item=nullptr; diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 57bbf43347..b3fe2d68dd 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -131,7 +131,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) } else if(constr_type==ConstraintType::Unique) { - attrib=Attributes::UQ_COLUMN; + attrib=Attributes::UqColumn; pol.append(QPointF(4,0)); pol.append(QPointF(0,4)); pol.append(QPointF(0,5)); pol.append(QPointF(4,9)); pol.append(QPointF(5,9)); pol.append(QPointF(9,5)); pol.append(QPointF(9,4)); pol.append(QPointF(5,0)); @@ -219,7 +219,7 @@ void TableObjectView::configureObject(void) } else if(str_constr.indexOf(TextUnique)>=0) { - fmt=font_config[Attributes::UQ_COLUMN]; + fmt=font_config[Attributes::UqColumn]; constr_type=ConstraintType::Unique; } else if(str_constr.indexOf(TextNotNull)>=0) diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 5b26c76743..ded7bee287 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -69,9 +69,9 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(object->getObjectType()==ObjectType::View && !tag) { - name_attrib=Attributes::VIEW_NAME; - schema_name_attrib=Attributes::VIEW_SCHEMA_NAME; - title_color_attrib=Attributes::VIEW_TITLE; + name_attrib=Attributes::ViewName; + schema_name_attrib=Attributes::ViewSchemaName; + title_color_attrib=Attributes::ViewTitle; } else { diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 9462b2caf7..87d1b4f987 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -277,9 +277,9 @@ namespace Attributes { LastSysOid=QString("last-sys-oid"), LastValue=QString("last-value"), LastZoom=QString("last-zoom"), - LAST_ANALYZE=QString("last-analyze"), - LAST_AUTOVACUUM=QString("last-autovacuum"), - LAST_VACUUM=QString("last-vacuum"), + LastAnalyze=QString("last-analyze"), + LastAutovacuum=QString("last-autovacuum"), + LastVacuum=QString("last-vacuum"), LeakProof=QString("leakproof"), LeftType=QString("left-type"), Left=QString("left"), @@ -536,58 +536,58 @@ namespace Attributes { TruncatePriv=QString("truncate"), Truncate=QString("truncate"), Trusted=QString("trusted"), - TUPLES_DEL=QString("tuples-del"), - TUPLES_UPD=QString("tuples-upd"), - TUPLES_INS=QString("tuples-ins"), + TuplesDel=QString("tuples-del"), + TyplesUpd=QString("tuples-upd"), + TuplesIns=QString("tuples-ins"), TypeAttribute=QString("typeattrib"), TypeOid=QString("type-oid"), Type=QString("type"), - TYPES=QString("types"), - TYPE_CLASS=QString("type-class"), - UI_LANGUAGE=QString("ui-language"), - UNDERLINE=QString("underline"), - UNIQUE=QString("unique"), - UNLOGGED=QString("unlogged"), - UNSET_PERMS=QString("unset-perms"), - UNSET=QString("unset"), - UPD_ACTION=QString("upd-action"), - UPD_EVENT=QString("upd-event"), - UPDATE_PRIV=QString("update"), - UQ_COLUMN=QString("uq-column"), - UQ_CONSTR=QString("uq-constr"), - UQ_PATTERN=QString("uq-pattern"), - USAGE_PRIV=QString("usage"), - USE_CURVED_LINES=QString("use-curved-lines"), - USE_PLACEHOLDERS=QString("use-placeholders"), - USE_SORTING=QString("use-sorting"), - USE_UNIQUE_NAMES=QString("use-unique-names"), - USING_EXP=QString("using-exp"), - VALIDATOR_FUNC=QString("validator"), - VALIDATOR=QString("validator"), - VALIDITY=QString("validity"), - VALIDATION=QString("validation"), - VALUE=QString("value"), - VALUES=QString("values"), - VARIABLE=QString("variable"), - VARIATION=QString("variation"), - VIEW_BODY=QString("view-body"), - VIEW_EXT_BODY=QString("view-ext-body"), - VIEW_NAME=QString("view-name"), - VIEW_SCHEMA_NAME=QString("view-schema-name"), - VIEW_TITLE=QString("view-title"), - VISIBLE=QString("visible"), - WIDGET=QString("widget"), - WIDGETS_GEOMETRY=QString("widgets-geometry"), - WIDTH=QString("width"), - WILDCARD=QString("wildcard"), - WINDOW_FUNC=QString("window-func"), - WITH_NO_DATA=QString("with-no-data"), - WITH_TIMEZONE=QString("with-timezone"), - WITHOUT_OIDS=QString("without-oids"), - WORD_DELIMITERS=QString("word-delimiters"), - WORD_SEPARATORS=QString("word-separators"), - WORKING_DIR=QString("working-dir"), - X_POS=QString("x"), - Y_POS=QString("y"); + Types=QString("types"), + TypeClass=QString("type-class"), + UiLanguage=QString("ui-language"), + Underline=QString("underline"), + Unique=QString("unique"), + Unlogged=QString("unlogged"), + UnsetPerms=QString("unset-perms"), + Unset=QString("unset"), + UpdAction=QString("upd-action"), + UpdEvent=QString("upd-event"), + UpdatePriv=QString("update"), + UqColumn=QString("uq-column"), + UqConstr=QString("uq-constr"), + UqPattern=QString("uq-pattern"), + UsagePriv=QString("usage"), + UseCurvedLines=QString("use-curved-lines"), + UsePlaceholders=QString("use-placeholders"), + UseSorting=QString("use-sorting"), + UseUniqueNames=QString("use-unique-names"), + UsingExp=QString("using-exp"), + ValidatorFunc=QString("validator"), + Validator=QString("validator"), + Validity=QString("validity"), + Validation=QString("validation"), + Value=QString("value"), + Values=QString("values"), + Variable=QString("variable"), + Variation=QString("variation"), + ViewBody=QString("view-body"), + ViewExtBody=QString("view-ext-body"), + ViewName=QString("view-name"), + ViewSchemaName=QString("view-schema-name"), + ViewTitle=QString("view-title"), + Visible=QString("visible"), + Widget=QString("widget"), + WidgetsGeometry=QString("widgets-geometry"), + Width=QString("width"), + Wildcard=QString("wildcard"), + WindowFunc=QString("window-func"), + WithNoData=QString("with-no-data"), + WithTimezone=QString("with-timezone"), + WithoutOids=QString("without-oids"), + WordDelimiters=QString("word-delimiters"), + WordSeparators=QString("word-separators"), + WorkingDir=QString("working-dir"), + XPos=QString("x"), + YPos=QString("y"); } diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index a03e7c9fdd..22b835aea5 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -548,59 +548,59 @@ namespace Attributes { TypeAttribute, TypeOid, Type, - TYPES, - TYPE_CLASS, - UI_LANGUAGE, - UNDERLINE, - UNIQUE, - UNLOGGED, - UNSET_PERMS, - UNSET, - UPD_ACTION, - UPD_EVENT, - UPDATE_PRIV, - UQ_COLUMN, - UQ_CONSTR, - UQ_PATTERN, - USAGE_PRIV, - USE_CURVED_LINES, - USE_PLACEHOLDERS, - USE_SORTING, - USE_UNIQUE_NAMES, - USING_EXP, - VALIDATOR_FUNC, - VALIDATOR, - VALIDITY, - VALIDATION, - VALUE, - VALUES, - VARIABLE, - VARIATION, - VIEW_BODY, - VIEW_EXT_BODY, - VIEW_NAME, - VIEW_SCHEMA_NAME, - VIEW_TITLE, - VISIBLE, - WIDGET, - WIDGETS_GEOMETRY, - WIDTH, - WILDCARD, - WINDOW_FUNC, - WITH_NO_DATA, - WITH_TIMEZONE, - WITHOUT_OIDS, - WORD_DELIMITERS, - WORD_SEPARATORS, - WORKING_DIR, - X_POS, - Y_POS, - LAST_ANALYZE, - LAST_AUTOVACUUM, - LAST_VACUUM, - TUPLES_DEL, - TUPLES_UPD, - TUPLES_INS; + Types, + TypeClass, + UiLanguage, + Underline, + Unique, + Unlogged, + UnsetPerms, + Unset, + UpdAction, + UpdEvent, + UpdatePriv, + UqColumn, + UqConstr, + UqPattern, + UsagePriv, + UseCurvedLines, + UsePlaceholders, + UseSorting, + UseUniqueNames, + UsingExp, + ValidatorFunc, + Validator, + Validity, + Validation, + Value, + Values, + Variable, + Variation, + ViewBody, + ViewExtBody, + ViewName, + ViewSchemaName, + ViewTitle, + Visible, + Widget, + WidgetsGeometry, + Width, + Wildcard, + WindowFunc, + WithNoData, + WithTimezone, + WithoutOids, + WordDelimiters, + WordSeparators, + WorkingDir, + XPos, + YPos, + LastAnalyze, + LastAutovacuum, + LastVacuum, + TuplesDel, + TyplesUpd, + TuplesIns; } #endif diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 14ee57597a..2dfc5e7a79 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -680,7 +680,7 @@ attribs_map Catalog::getServerAttributes(void) tuple=res.getTupleValues(); attr_name = tuple[Attributes::Attribute]; attr_name.replace('_','-'); - attribs[attr_name]=tuple[Attributes::VALUE]; + attribs[attr_name]=tuple[Attributes::Value]; } while(res.accessTuple(ResultSet::NextTuple)); diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index d265d0c008..5c74d24a8e 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -23,7 +23,7 @@ Aggregate::Aggregate(void) obj_type=ObjectType::Aggregate; functions[0]=functions[1]=nullptr; sort_operator=nullptr; - attributes[Attributes::TYPES]=QString(); + attributes[Attributes::Types]=QString(); attributes[Attributes::TransitionFunc]=QString(); attributes[Attributes::StateType]=QString(); attributes[Attributes::BaseType]=QString(); @@ -155,7 +155,7 @@ void Aggregate::setTypesAttribute(unsigned def_type) an aggregate that accepts any possible data '*' e.g. function(*) */ if(def_type == SchemaParser::SqlDefinition && str_types.isEmpty()) str_types='*'; - attributes[Attributes::TYPES]=str_types; + attributes[Attributes::Types]=str_types; } void Aggregate::addDataType(PgSqlType type) diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 8c2fcde1bd..f7426abf91 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -22,8 +22,8 @@ BaseGraphicObject::BaseGraphicObject(void) { is_modified=true; is_faded_out=false; - attributes[Attributes::X_POS]=QString(); - attributes[Attributes::Y_POS]=QString(); + attributes[Attributes::XPos]=QString(); + attributes[Attributes::YPos]=QString(); attributes[Attributes::Position]=QString(); attributes[Attributes::FadedOut]=QString(); receiver_object=nullptr; @@ -81,8 +81,8 @@ void BaseGraphicObject::setFadedOutAttribute(void) void BaseGraphicObject::setPositionAttribute(void) { - attributes[Attributes::X_POS]=QString("%1").arg(position.x()); - attributes[Attributes::Y_POS]=QString("%1").arg(position.y()); + attributes[Attributes::XPos]=QString("%1").arg(position.x()); + attributes[Attributes::YPos]=QString("%1").arg(position.y()); attributes[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, attributes, SchemaParser::XmlDefinition); } diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 0883c46e73..9b2e4a7dbe 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -1233,7 +1233,7 @@ QString BaseObject::getAlterCommentDefinition(BaseObject *object, attribs_map at if(this->getComment()!=object->getComment()) { if(object->getComment().isEmpty()) - attributes[Attributes::Comment]=Attributes::UNSET; + attributes[Attributes::Comment]=Attributes::Unset; else attributes[Attributes::Comment]=object->getComment(); diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 2c951e6da7..781f30df38 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -106,12 +106,12 @@ void BaseRelationship::configureRelationship(void) attributes[Attributes::SrcColPattern]=QString(); attributes[Attributes::DstColPattern]=QString(); attributes[Attributes::PkPattern]=QString(); - attributes[Attributes::UQ_PATTERN]=QString(); + attributes[Attributes::UqPattern]=QString(); attributes[Attributes::SrcFkPattern]=QString(); attributes[Attributes::DstFkPattern]=QString(); attributes[Attributes::PkColPattern]=QString(); attributes[Attributes::SinglePkColumn]=QString(); - attributes[Attributes::UPD_ACTION]=QString(); + attributes[Attributes::UpdAction]=QString(); attributes[Attributes::DelAction]=QString(); attributes[Attributes::CustomColor]=QString(); attributes[Attributes::ReferenceFk]=QString(); @@ -347,8 +347,8 @@ void BaseRelationship::setRelationshipAttributes(void) count=points.size(); for(i=0; i < count; i++) { - attributes[Attributes::X_POS]=QString("%1").arg(points[i].x()); - attributes[Attributes::Y_POS]=QString("%1").arg(points[i].y()); + attributes[Attributes::XPos]=QString("%1").arg(points[i].x()); + attributes[Attributes::YPos]=QString("%1").arg(points[i].y()); str_aux+=schparser.getCodeDefinition(Attributes::Position, attributes, SchemaParser::XmlDefinition); } attributes[Attributes::Points]=str_aux; @@ -358,8 +358,8 @@ void BaseRelationship::setRelationshipAttributes(void) { if(!std::isnan(lables_dist[i].x())) { - attributes[Attributes::X_POS]=QString("%1").arg(lables_dist[i].x()); - attributes[Attributes::Y_POS]=QString("%1").arg(lables_dist[i].y()); + attributes[Attributes::XPos]=QString("%1").arg(lables_dist[i].x()); + attributes[Attributes::YPos]=QString("%1").arg(lables_dist[i].y()); attributes[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, attributes, SchemaParser::XmlDefinition); attributes[Attributes::RefType]=label_attribs[i]; str_aux+=schparser.getCodeDefinition(Attributes::Label, attributes, SchemaParser::XmlDefinition); diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index c819331fc9..26044726d7 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -304,17 +304,17 @@ QString Column::getAlterDefinition(BaseObject *object) def_val=col->default_value; if(this->default_value!=def_val) - attribs[Attributes::DefaultValue]=(def_val.isEmpty() ? Attributes::UNSET : def_val); + attribs[Attributes::DefaultValue]=(def_val.isEmpty() ? Attributes::Unset : def_val); if(this->not_null!=col->not_null) - attribs[Attributes::NotNull]=(!col->not_null ? Attributes::UNSET : Attributes::True); + attribs[Attributes::NotNull]=(!col->not_null ? Attributes::Unset : Attributes::True); attribs[Attributes::NewIdentityType] = QString(); if(this->identity_type == BaseType::Null && col->identity_type != BaseType::Null) attribs[Attributes::IdentityType] = ~col->identity_type; else if(this->identity_type != BaseType::Null && col->identity_type == BaseType::Null) - attribs[Attributes::IdentityType] = Attributes::UNSET; + attribs[Attributes::IdentityType] = Attributes::Unset; else if(this->identity_type != BaseType::Null && col->identity_type != BaseType::Null && this->identity_type != col->identity_type) attribs[Attributes::NewIdentityType] = ~col->identity_type; @@ -328,7 +328,7 @@ QString Column::getAlterDefinition(BaseObject *object) attribs[Attributes::Cycle] = QString(); //Checking differences in the underlying sequence (identity col) - if(attribs[Attributes::IdentityType] != Attributes::UNSET) + if(attribs[Attributes::IdentityType] != Attributes::Unset) { if(!col->seq_min_value.isEmpty() && this->seq_min_value != col->seq_min_value) { diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 443753d64b..44703f12c1 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -30,13 +30,13 @@ Constraint::Constraint(void) attributes[Attributes::PkConstr]=QString(); attributes[Attributes::FkConstr]=QString(); attributes[Attributes::CkConstr]=QString(); - attributes[Attributes::UQ_CONSTR]=QString(); + attributes[Attributes::UqConstr]=QString(); attributes[Attributes::ExConstr]=QString(); attributes[Attributes::RefTable]=QString(); attributes[Attributes::SrcColumns]=QString(); attributes[Attributes::DstColumns]=QString(); attributes[Attributes::DelAction]=QString(); - attributes[Attributes::UPD_ACTION]=QString(); + attributes[Attributes::UpdAction]=QString(); attributes[Attributes::Expression]=QString(); attributes[Attributes::Type]=QString(); attributes[Attributes::ComparisonType]=QString(); @@ -666,7 +666,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[Attributes::PkConstr]=QString(); attributes[Attributes::FkConstr]=QString(); attributes[Attributes::CkConstr]=QString(); - attributes[Attributes::UQ_CONSTR]=QString(); + attributes[Attributes::UqConstr]=QString(); attributes[Attributes::ExConstr]=QString(); switch(!constr_type) @@ -681,7 +681,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attrib=Attributes::FkConstr; break; case ConstraintType::Unique: - attrib=Attributes::UQ_CONSTR; + attrib=Attributes::UqConstr; break; default: attrib=Attributes::ExConstr; @@ -690,7 +690,7 @@ QString Constraint::getCodeDefinition(unsigned def_type, bool inc_addedbyrel) attributes[attrib]=Attributes::True; attributes[Attributes::Type]=attrib; - attributes[Attributes::UPD_ACTION]=(~upd_action); + attributes[Attributes::UpdAction]=(~upd_action); attributes[Attributes::DelAction]=(~del_action); attributes[Attributes::Expression]=expression; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 149ddb9074..2132376837 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3334,8 +3334,8 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) (obj_type_aux!=ObjectType::Relationship && obj_type_aux!=ObjectType::BaseRelationship)) { - dynamic_cast(object)->setPosition(QPointF(attribs[Attributes::X_POS].toDouble(), - attribs[Attributes::Y_POS].toDouble())); + dynamic_cast(object)->setPosition(QPointF(attribs[Attributes::XPos].toDouble(), + attribs[Attributes::YPos].toDouble())); } @@ -3475,7 +3475,7 @@ Role *DatabaseModel::createRole(void) xmlparser.getElementAttributes(attribs); role->setPassword(attribs[Attributes::Password]); - role->setValidity(attribs[Attributes::VALIDITY]); + role->setValidity(attribs[Attributes::Validity]); if(!attribs[Attributes::ConnLimit].isEmpty()) role->setConnectionLimit(attribs[Attributes::ConnLimit].toInt()); @@ -3622,7 +3622,7 @@ Language *DatabaseModel::createLanguage(void) ref_type=attribs[Attributes::RefType]; //Only VALIDATOR, HANDLER and INLINE functions are accepted for the language - if(ref_type==Attributes::VALIDATOR_FUNC || + if(ref_type==Attributes::ValidatorFunc || ref_type==Attributes::HandlerFunc || ref_type==Attributes::InlineFunc) { @@ -3639,7 +3639,7 @@ Language *DatabaseModel::createLanguage(void) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(ref_type==Attributes::VALIDATOR_FUNC) + if(ref_type==Attributes::ValidatorFunc) lang->setFunction(dynamic_cast(func), Language::ValidatorFunc); else if(ref_type==Attributes::HandlerFunc) lang->setFunction(dynamic_cast(func), Language::HandlerFunc); @@ -3686,8 +3686,8 @@ Function *DatabaseModel::createFunction(void) func->setReturnSetOf(attribs[Attributes::ReturnsSetOf]== Attributes::True); - if(!attribs[Attributes::WINDOW_FUNC].isEmpty()) - func->setWindowFunction(attribs[Attributes::WINDOW_FUNC]== + if(!attribs[Attributes::WindowFunc].isEmpty()) + func->setWindowFunction(attribs[Attributes::WindowFunc]== Attributes::True); if(!attribs[Attributes::LeakProof].isEmpty()) @@ -3950,13 +3950,13 @@ PgSqlType DatabaseModel::createPgSQLType(void) if(!attribs[Attributes::Precision].isEmpty()) precision=attribs[Attributes::Precision].toInt(); - with_timezone=(attribs[Attributes::WITH_TIMEZONE]==Attributes::True); + with_timezone=(attribs[Attributes::WithTimezone]==Attributes::True); interv_type=attribs[Attributes::IntervalType]; if(!attribs[Attributes::SpatialType].isEmpty()) spatial_type=SpatialType(attribs[Attributes::SpatialType], attribs[Attributes::Srid].toUInt(), - attribs[Attributes::VARIATION].toUInt()); + attribs[Attributes::Variation].toUInt()); name=attribs[Attributes::Name]; @@ -4064,7 +4064,7 @@ Type *DatabaseModel::createType(void) if(elem==Attributes::EnumType) { xmlparser.getElementAttributes(attribs); - enums=attribs[Attributes::VALUES].split(','); + enums=attribs[Attributes::Values].split(','); count=enums.size(); for(i=0; i < count; i++) @@ -4677,7 +4677,7 @@ Table *DatabaseModel::createTable(void) table->setObjectListsCapacity(attribs[Attributes::MaxObjCount].toUInt()); table->setWithOIDs(attribs[Attributes::Oids]==Attributes::True); - table->setUnlogged(attribs[Attributes::UNLOGGED]==Attributes::True); + table->setUnlogged(attribs[Attributes::Unlogged]==Attributes::True); table->setRLSEnabled(attribs[Attributes::RlsEnabled]==Attributes::True); table->setRLSForced(attribs[Attributes::RlsForced]==Attributes::True); table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); @@ -4933,7 +4933,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) constr_type=ConstraintType::PrimaryKey; else if(attribs[Attributes::Type]==Attributes::FkConstr) constr_type=ConstraintType::ForeignKey; - else if(attribs[Attributes::Type]==Attributes::UQ_CONSTR) + else if(attribs[Attributes::Type]==Attributes::UqConstr) constr_type=ConstraintType::Unique; else constr_type=ConstraintType::Exclude; @@ -4965,8 +4965,8 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(!attribs[Attributes::DelAction].isEmpty()) constr->setActionType(attribs[Attributes::DelAction], Constraint::DeleteAction); - if(!attribs[Attributes::UPD_ACTION].isEmpty()) - constr->setActionType(attribs[Attributes::UPD_ACTION], Constraint::UpdateAction); + if(!attribs[Attributes::UpdAction].isEmpty()) + constr->setActionType(attribs[Attributes::UpdAction], Constraint::UpdateAction); ref_table=getObject(attribs[Attributes::RefTable], ObjectType::Table); @@ -5106,7 +5106,7 @@ void DatabaseModel::createElement(Element &elem, TableObject *tab_obj, BaseObjec elem.setSortingAttribute(Element::AscOrder, attribs[Attributes::AscOrder]==Attributes::True); elem.setSortingAttribute(Element::NullsFirst, attribs[Attributes::NullsFirst]==Attributes::True); - elem.setSortingEnabled(attribs[Attributes::USE_SORTING]!=Attributes::False); + elem.setSortingEnabled(attribs[Attributes::UseSorting]!=Attributes::False); xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); @@ -5322,7 +5322,7 @@ Index *DatabaseModel::createIndex(void) setBasicAttributes(index); index->setParentTable(table); index->setIndexAttribute(Index::Concurrent, attribs[Attributes::Concurrent]==Attributes::True); - index->setIndexAttribute(Index::Unique, attribs[Attributes::UNIQUE]==Attributes::True); + index->setIndexAttribute(Index::Unique, attribs[Attributes::Unique]==Attributes::True); index->setIndexAttribute(Index::FastUpdate, attribs[Attributes::FastUpdate]==Attributes::True); index->setIndexAttribute(Index::Buffering, attribs[Attributes::Buffering]==Attributes::True); index->setIndexingType(attribs[Attributes::IndexType]); @@ -5489,7 +5489,7 @@ Trigger *DatabaseModel::createTrigger(void) (attribs[Attributes::DelEvent]==Attributes::True)); trigger->setEvent(EventType::OnUpdate, - (attribs[Attributes::UPD_EVENT]==Attributes::True)); + (attribs[Attributes::UpdEvent]==Attributes::True)); trigger->setEvent(EventType::OnTruncate, (attribs[Attributes::TruncEvent]==Attributes::True)); @@ -5645,7 +5645,7 @@ Policy *DatabaseModel::createPolicy(void) xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); - if(attribs[Attributes::Type] == Attributes::USING_EXP) + if(attribs[Attributes::Type] == Attributes::UsingExp) policy->setUsingExpression(xmlparser.getElementContent()); else if(attribs[Attributes::Type] == Attributes::CheckExp) policy->setCheckExpression(xmlparser.getElementContent()); @@ -5739,7 +5739,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) else if(elem==Attributes::Filter) { xmlparser.getElementAttributes(attribs); - event_trig->setFilter(attribs[Attributes::VARIABLE], attribs[Attributes::VALUES].split(',')); + event_trig->setFilter(attribs[Attributes::Variable], attribs[Attributes::Values].split(',')); } } } @@ -5886,7 +5886,7 @@ View *DatabaseModel::createView(void) view->setObjectListsCapacity(attribs[Attributes::MaxObjCount].toUInt()); view->setMaterialized(attribs[Attributes::Materialized]==Attributes::True); view->setRecursive(attribs[Attributes::Recursive]==Attributes::True); - view->setWithNoData(attribs[Attributes::WITH_NO_DATA]==Attributes::True); + view->setWithNoData(attribs[Attributes::WithNoData]==Attributes::True); view->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); @@ -6182,7 +6182,7 @@ Textbox *DatabaseModel::createTextbox(void) txtbox->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); txtbox->setTextAttribute(Textbox::ItalicText, attribs[Attributes::Italic]==Attributes::True); txtbox->setTextAttribute(Textbox::BoldText, attribs[Attributes::Bold]==Attributes::True); - txtbox->setTextAttribute(Textbox::UnderlineText, attribs[Attributes::UNDERLINE]==Attributes::True); + txtbox->setTextAttribute(Textbox::UnderlineText, attribs[Attributes::Underline]==Attributes::True); if(!attribs[Attributes::Color].isEmpty()) txtbox->setTextColor(QColor(attribs[Attributes::Color])); @@ -6325,7 +6325,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) { QString pat_attrib[]= { Attributes::SrcColPattern, Attributes::DstColPattern, Attributes::SrcFkPattern, Attributes::DstFkPattern, - Attributes::PkPattern, Attributes::UQ_PATTERN, + Attributes::PkPattern, Attributes::UqPattern, Attributes::PkColPattern }; unsigned pattern_id[]= { Relationship::SrcColPattern, Relationship::DstColPattern, @@ -6341,7 +6341,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) deferrable=attribs[Attributes::Deferrable]==Attributes::True; defer_type=DeferralType(attribs[Attributes::DeferType]); del_action=ActionType(attribs[Attributes::DelAction]); - upd_action=ActionType(attribs[Attributes::UPD_ACTION]); + upd_action=ActionType(attribs[Attributes::UpdAction]); single_pk_col=(attribs[Attributes::SinglePkColumn]==Attributes::True); if(attribs[Attributes::Type]==Attributes::Relationship11) @@ -6430,8 +6430,8 @@ BaseRelationship *DatabaseModel::createRelationship(void) do { xmlparser.getElementAttributes(attribs); - points.push_back(QPointF(attribs[Attributes::X_POS].toDouble(), - attribs[Attributes::Y_POS].toDouble())); + points.push_back(QPointF(attribs[Attributes::XPos].toDouble(), + attribs[Attributes::YPos].toDouble())); } while(xmlparser.accessElement(XmlParser::NextElement)); @@ -6449,8 +6449,8 @@ BaseRelationship *DatabaseModel::createRelationship(void) xmlparser.restorePosition(); base_rel->setLabelDistance(labels_id[str_aux], - QPointF(attribs[Attributes::X_POS].toFloat(), - attribs[Attributes::Y_POS].toFloat())); + QPointF(attribs[Attributes::XPos].toFloat(), + attribs[Attributes::YPos].toFloat())); } else if(elem==Attributes::SpecialPkCols && rel) { @@ -6616,9 +6616,9 @@ Permission *DatabaseModel::createPermission(void) priv_type=Permission::PrivTrigger; else if(itr->first==Attributes::TruncatePriv) priv_type=Permission::PrivTruncate; - else if(itr->first==Attributes::UPDATE_PRIV) + else if(itr->first==Attributes::UpdatePriv) priv_type=Permission::PrivUpdate; - else if(itr->first==Attributes::USAGE_PRIV) + else if(itr->first==Attributes::UsagePriv) priv_type=Permission::PrivUsage; perm->setPrivilege(priv_type, (priv_value || grant_op), grant_op); @@ -9680,17 +9680,17 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option if(schema->isRectVisible()) { - attribs[Attributes::X_POS]=QString::number(pnt.x()); - attribs[Attributes::Y_POS]=QString::number(pnt.y()); + attribs[Attributes::XPos]=QString::number(pnt.x()); + attribs[Attributes::YPos]=QString::number(pnt.y()); } } else { - attribs[Attributes::X_POS]=QString::number(pnt.x()); - attribs[Attributes::Y_POS]=QString::number(pnt.y()); + attribs[Attributes::XPos]=QString::number(pnt.x()); + attribs[Attributes::YPos]=QString::number(pnt.y()); } - if(obj_type!=ObjectType::Schema || !attribs[Attributes::X_POS].isEmpty()) + if(obj_type!=ObjectType::Schema || !attribs[Attributes::XPos].isEmpty()) { schparser.ignoreUnkownAttributes(true); attribs[Attributes::Position]= @@ -9716,8 +9716,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option for(QPointF pnt : points) { - attribs[Attributes::X_POS]=QString::number(pnt.x()); - attribs[Attributes::Y_POS]=QString::number(pnt.y()); + attribs[Attributes::XPos]=QString::number(pnt.x()); + attribs[Attributes::YPos]=QString::number(pnt.y()); schparser.ignoreUnkownAttributes(true); attribs[Attributes::Position]+= @@ -9732,8 +9732,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option pnt=rel->getLabelDistance(id); if(!std::isnan(pnt.x()) && !std::isnan(pnt.y())) { - aux_attribs[Attributes::X_POS]=QString::number(pnt.x()); - aux_attribs[Attributes::Y_POS]=QString::number(pnt.y()); + aux_attribs[Attributes::XPos]=QString::number(pnt.x()); + aux_attribs[Attributes::YPos]=QString::number(pnt.y()); aux_attribs[Attributes::RefType]=labels_attrs[id]; aux_attribs[Attributes::Position]=schparser.getCodeDefinition(GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + @@ -10004,8 +10004,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option //Retrieving and storing the points if(aux_elem==Attributes::Position) { - points.push_back(QPointF(aux_attrib[Attributes::X_POS].toFloat(), - aux_attrib[Attributes::Y_POS].toFloat())); + points.push_back(QPointF(aux_attrib[Attributes::XPos].toFloat(), + aux_attrib[Attributes::YPos].toFloat())); } //Retrieving and storing the labels' custom positions else if(aux_elem==Attributes::Label) @@ -10016,8 +10016,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(xmlparser.accessElement(XmlParser::ChildElement)) { xmlparser.getElementAttributes(aux_attrib); - labels_pos[labels_attrs[ref_type]]=QPointF(aux_attrib[Attributes::X_POS].toFloat(), - aux_attrib[Attributes::Y_POS].toFloat()); + labels_pos[labels_attrs[ref_type]]=QPointF(aux_attrib[Attributes::XPos].toFloat(), + aux_attrib[Attributes::YPos].toFloat()); } xmlparser.restorePosition(); diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 41134c0ee1..c935843a97 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -177,10 +177,10 @@ QString Domain::getAlterDefinition(BaseObject *object) attributes[Attributes::NewName]=QString(); if(this->default_value!=domain->default_value) - attributes[Attributes::DefaultValue]=(!domain->default_value.isEmpty() ? domain->default_value : Attributes::UNSET); + attributes[Attributes::DefaultValue]=(!domain->default_value.isEmpty() ? domain->default_value : Attributes::Unset); if(this->not_null!=domain->not_null) - attributes[Attributes::NotNull]=(domain->not_null ? Attributes::True : Attributes::UNSET); + attributes[Attributes::NotNull]=(domain->not_null ? Attributes::True : Attributes::Unset); orig_constrs = this->chk_constrs; aux_constrs = domain->chk_constrs; @@ -198,7 +198,7 @@ QString Domain::getAlterDefinition(BaseObject *object) (aux_constrs.count(constr.first) && orig_expr != aux_expr)) { aux_attribs[Attributes::Name]=constr.first; - aux_attribs[Attributes::Expression]=Attributes::UNSET; + aux_attribs[Attributes::Expression]=Attributes::Unset; attributes[Attributes::Constraints]+=BaseObject::getAlterDefinition(Attributes::DomConstraint, aux_attribs, false, true); } diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 327094ce85..03a6a3e913 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -96,7 +96,7 @@ void Element::configureAttributes(attribs_map &attributes, unsigned def_type) attributes[Attributes::Column]=QString(); attributes[Attributes::Expression]=QString(); attributes[Attributes::OpClass]=QString(); - attributes[Attributes::USE_SORTING]=(this->sorting_enabled ? Attributes::True : QString()); + attributes[Attributes::UseSorting]=(this->sorting_enabled ? Attributes::True : QString()); attributes[Attributes::NullsFirst]=(this->sorting_enabled && this->sorting_attibs[NullsFirst] ? Attributes::True : QString()); attributes[Attributes::AscOrder]=(this->sorting_enabled && this->sorting_attibs[AscOrder] ? Attributes::True : QString()); diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 7c6e1fd179..5b2b8166e1 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -132,8 +132,8 @@ QString EventTrigger::getCodeDefinition(unsigned def_type) //Creating an element attributes[Attributes::Filter]+=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") .arg(Attributes::Filter) - .arg(Attributes::VARIABLE).arg(flt.first) - .arg(Attributes::VALUES).arg(flt.second.join(',')); + .arg(Attributes::Variable).arg(flt.first) + .arg(Attributes::Values).arg(flt.second.join(',')); } return(BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 477fa50ea5..629f023e6b 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -42,7 +42,7 @@ Function::Function(void) attributes[Attributes::Definition]=QString(); attributes[Attributes::Signature]=QString(); attributes[Attributes::RefType]=QString(); - attributes[Attributes::WINDOW_FUNC]=QString(); + attributes[Attributes::WindowFunc]=QString(); attributes[Attributes::ReturnTable]=QString(); attributes[Attributes::Library]=QString(); attributes[Attributes::Symbol]=QString(); @@ -478,7 +478,7 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) setTableReturnTypeAttribute(def_type); attributes[Attributes::ReturnsSetOf]=(returns_setof ? Attributes::True : QString()); - attributes[Attributes::WINDOW_FUNC]=(is_wnd_function ? Attributes::True : QString()); + attributes[Attributes::WindowFunc]=(is_wnd_function ? Attributes::True : QString()); attributes[Attributes::LeakProof]=(is_leakproof ? Attributes::True : QString()); attributes[Attributes::SecurityType]=(~security_type); attributes[Attributes::BehaviorType]=(~behavior_type); @@ -529,7 +529,7 @@ QString Function::getAlterDefinition(BaseObject *object) attribs[Attributes::FunctionType]=~func->function_type; if(this->is_leakproof!=func->is_leakproof) - attribs[Attributes::LeakProof]=(func->is_leakproof ? Attributes::True : Attributes::UNSET); + attribs[Attributes::LeakProof]=(func->is_leakproof ? Attributes::True : Attributes::Unset); if(this->security_type!=func->security_type) attribs[Attributes::SecurityType]=~func->security_type; diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index f9edb12242..232f6d88eb 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -24,7 +24,7 @@ Index::Index(void) index_attribs[Unique]=index_attribs[Concurrent]= index_attribs[FastUpdate]=index_attribs[Buffering]=false; fill_factor=90; - attributes[Attributes::UNIQUE]=QString(); + attributes[Attributes::Unique]=QString(); attributes[Attributes::Concurrent]=QString(); attributes[Attributes::Table]=QString(); attributes[Attributes::IndexType]=QString(); @@ -331,7 +331,7 @@ QString Index::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); setIndexElementsAttribute(def_type); - attributes[Attributes::UNIQUE]=(index_attribs[Unique] ? Attributes::True : QString()); + attributes[Attributes::Unique]=(index_attribs[Unique] ? Attributes::True : QString()); attributes[Attributes::Concurrent]=(index_attribs[Concurrent] ? Attributes::True : QString()); attributes[Attributes::IndexType]=(~indexing_type); attributes[Attributes::Predicate]=predicate; @@ -394,11 +394,11 @@ QString Index::getAlterDefinition(BaseObject *object) if(this->indexing_type==IndexingType::Gin && this->index_attribs[FastUpdate] != index->index_attribs[FastUpdate]) - attribs[Attributes::FastUpdate]=(index->index_attribs[FastUpdate] ? Attributes::True : Attributes::UNSET); + attribs[Attributes::FastUpdate]=(index->index_attribs[FastUpdate] ? Attributes::True : Attributes::Unset); if(this->indexing_type==IndexingType::Gist && this->index_attribs[Buffering] != index->index_attribs[Buffering]) - attribs[Attributes::Buffering]=(index->index_attribs[Buffering] ? Attributes::True : Attributes::UNSET); + attribs[Attributes::Buffering]=(index->index_attribs[Buffering] ? Attributes::True : Attributes::Unset); } copyAttributes(attribs); diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 9a7e184f33..2b90d090ad 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -28,7 +28,7 @@ Language::Language(void) attributes[Attributes::Trusted]=QString(); attributes[Attributes::HandlerFunc]=QString(); - attributes[Attributes::VALIDATOR_FUNC]=QString(); + attributes[Attributes::ValidatorFunc]=QString(); attributes[Attributes::InlineFunc]=QString(); } @@ -116,7 +116,7 @@ QString Language::getCodeDefinition(unsigned def_type, bool reduced_form) if(!code_def.isEmpty()) return(code_def); unsigned i; - QString attribs_func[3]={Attributes::VALIDATOR_FUNC, + QString attribs_func[3]={Attributes::ValidatorFunc, Attributes::HandlerFunc, Attributes::InlineFunc}; diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 12e7f251fe..7dec0b1692 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -412,11 +412,11 @@ QString Permission::getCodeDefinition(unsigned def_type) unsigned i, count; ObjectType obj_type; QString priv_vect[12]={ Attributes::SelectPriv, Attributes::InsertPriv, - Attributes::UPDATE_PRIV, Attributes::DeletePriv, + Attributes::UpdatePriv, Attributes::DeletePriv, Attributes::TruncatePriv, Attributes::ReferencesPriv, Attributes::TriggerPriv, Attributes::CreatePriv, Attributes::ConnectPriv, Attributes::TemporaryPriv, - Attributes::ExecutPriv, Attributes::USAGE_PRIV }; + Attributes::ExecutPriv, Attributes::UsagePriv }; obj_type=object->getObjectType(); diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 858e30400e..841b6216b2 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1591,10 +1591,10 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) attribs[Attributes::Length]=QString(); attribs[Attributes::Dimension]=QString(); attribs[Attributes::Precision]=QString(); - attribs[Attributes::WITH_TIMEZONE]=QString(); + attribs[Attributes::WithTimezone]=QString(); attribs[Attributes::IntervalType]=QString(); attribs[Attributes::SpatialType]=QString(); - attribs[Attributes::VARIATION]=QString(); + attribs[Attributes::Variation]=QString(); attribs[Attributes::Srid]=QString(); attribs[Attributes::RefType]=ref_type; @@ -1613,12 +1613,12 @@ QString PgSqlType::getCodeDefinition(unsigned def_type,QString ref_type) if(isGiSType()) { attribs[Attributes::SpatialType]=(~spatial_type); - attribs[Attributes::VARIATION]=QString("%1").arg(spatial_type.getVariation()); + attribs[Attributes::Variation]=QString("%1").arg(spatial_type.getVariation()); attribs[Attributes::Srid]=QString("%1").arg(spatial_type.getSRID()); } if(with_timezone) - attribs[Attributes::WITH_TIMEZONE]=Attributes::True; + attribs[Attributes::WithTimezone]=Attributes::True; return(schparser.getCodeDefinition(Attributes::PgSqlBaseType, attribs, def_type)); } diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index 803c928c3c..21aaf0c5a1 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -25,7 +25,7 @@ Policy::Policy(void) : TableObject() attributes[Attributes::Permissive] = QString(); attributes[Attributes::Command] = QString(); - attributes[Attributes::USING_EXP] = QString(); + attributes[Attributes::UsingExp] = QString(); attributes[Attributes::CheckExp] = QString(); attributes[Attributes::Roles] = QString(); } @@ -124,7 +124,7 @@ QString Policy::getCodeDefinition(unsigned def_type) rol_names.append(role->getName(true)); attributes[Attributes::Permissive] = (permissive ? Attributes::True : QString()); - attributes[Attributes::USING_EXP] = using_expr; + attributes[Attributes::UsingExp] = using_expr; attributes[Attributes::CheckExp] = check_expr; attributes[Attributes::Roles] = rol_names.join(QString(", ")); @@ -154,7 +154,7 @@ QString Policy::getAlterDefinition(BaseObject *object) attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); if(this->using_expr.simplified() != policy->using_expr.simplified()) - attribs[Attributes::USING_EXP] = policy->using_expr; + attribs[Attributes::UsingExp] = policy->using_expr; if(this->check_expr.simplified() != policy->check_expr.simplified()) attribs[Attributes::CheckExp] = policy->check_expr; @@ -169,7 +169,7 @@ QString Policy::getAlterDefinition(BaseObject *object) aux_rol_names.sort(); if(!rol_names.isEmpty() && aux_rol_names.isEmpty()) - attribs[Attributes::Roles] = Attributes::UNSET; + attribs[Attributes::Roles] = Attributes::Unset; else if(rol_names.join(QString(", ")) != aux_rol_names.join(QString(", "))) attribs[Attributes::Roles] = aux_rol_names.join(QString(", ")); diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 4e710c8c11..8a576e293d 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2610,7 +2610,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::SinglePkColumn]=(single_pk_column ? Attributes::True : QString()); attributes[Attributes::Deferrable]=(deferrable ? Attributes::True : QString()); attributes[Attributes::DeferType]=~deferral_type; - attributes[Attributes::UPD_ACTION]=~upd_action; + attributes[Attributes::UpdAction]=~upd_action; attributes[Attributes::DelAction]=~del_action; attributes[Attributes::TableName]=tab_name_relnn; @@ -2621,7 +2621,7 @@ QString Relationship::getCodeDefinition(unsigned def_type) attributes[Attributes::SrcColPattern]=name_patterns[SrcColPattern]; attributes[Attributes::DstColPattern]=name_patterns[DstColPattern]; attributes[Attributes::PkPattern]=name_patterns[PkPattern]; - attributes[Attributes::UQ_PATTERN]=name_patterns[UqPattern]; + attributes[Attributes::UqPattern]=name_patterns[UqPattern]; attributes[Attributes::SrcFkPattern]=name_patterns[SrcFkPattern]; attributes[Attributes::DstFkPattern]=name_patterns[DstFkPattern]; attributes[Attributes::PkColPattern]=name_patterns[PkColPattern]; @@ -2717,13 +2717,13 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) if(rel_type == RelationshipGen) { - attributes[Attributes::Inherit]=(undo_inh_part ? Attributes::UNSET : Attributes::True); + attributes[Attributes::Inherit]=(undo_inh_part ? Attributes::Unset : Attributes::True); attributes[Attributes::Table]=getReceiverTable()->getName(true); attributes[Attributes::AncestorTable]=getReferenceTable()->getName(true); } else { - attributes[Attributes::Partitioning]=(undo_inh_part ? Attributes::UNSET : Attributes::True); + attributes[Attributes::Partitioning]=(undo_inh_part ? Attributes::Unset : Attributes::True); attributes[Attributes::Table]=getReceiverTable()->getName(true); attributes[Attributes::PartitionedTable]=getReferenceTable()->getName(true); attributes[Attributes::PartitionBoundExpr]=getReceiverTable()->getPartitionBoundingExpr(); diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 5e3606c37e..f2cbab35bd 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -38,7 +38,7 @@ Role::Role(void) attributes[Attributes::ConnLimit]=QString(); attributes[Attributes::Password]=QString(); attributes[Attributes::Encrypted]=QString(); - attributes[Attributes::VALIDITY]=QString(); + attributes[Attributes::Validity]=QString(); attributes[Attributes::RefRoles]=QString(); attributes[Attributes::MemberRoles]=QString(); attributes[Attributes::AdminRoles]=QString(); @@ -342,7 +342,7 @@ QString Role::getCodeDefinition(unsigned def_type) attributes[op_attribs[i]]=(options[i] ? Attributes::True : QString()); attributes[Attributes::Password]=password; - attributes[Attributes::VALIDITY]=validity; + attributes[Attributes::Validity]=validity; if(conn_limit >= 0) attributes[Attributes::ConnLimit]=QString("%1").arg(conn_limit); @@ -371,13 +371,13 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) attribs[Attributes::Password]=role->password; if(this->validity!=role->validity) - attribs[Attributes::VALIDITY]=role->validity; + attribs[Attributes::Validity]=role->validity; for(unsigned i=0; i <= OpBypassRls; i++) { if((attribs.count(Attributes::Password) && i==OpEncrypted) || this->options[i]!=role->options[i]) - attribs[op_attribs[i]]=(role->options[i] ? Attributes::True : Attributes::UNSET); + attribs[op_attribs[i]]=(role->options[i] ? Attributes::True : Attributes::Unset); } copyAttributes(attribs); diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index ac1a34025c..0ad64f2ca7 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -443,7 +443,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) } } else - attribs[Attributes::OwnerColumn]=Attributes::UNSET; + attribs[Attributes::OwnerColumn]=Attributes::Unset; } if(!seq->increment.isEmpty() && this->increment!=seq->increment) @@ -462,7 +462,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) attribs[Attributes::Cache]=seq->cache; if(this->cycle!=seq->cycle) - attribs[Attributes::Cycle]=(seq->cycle ? Attributes::True : Attributes::UNSET); + attribs[Attributes::Cycle]=(seq->cycle ? Attributes::True : Attributes::Unset); copyAttributes(attribs); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 7a19a878df..00895e2df8 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -37,7 +37,7 @@ Table::Table(void) : BaseTable() attributes[Attributes::ConstrSqlDisabled]=QString(); attributes[Attributes::ColIndexes]=QString(); attributes[Attributes::ConstrIndexes]=QString(); - attributes[Attributes::UNLOGGED]=QString(); + attributes[Attributes::Unlogged]=QString(); attributes[Attributes::InitialData]=QString(); attributes[Attributes::RlsEnabled]=QString(); attributes[Attributes::RlsForced]=QString(); @@ -1595,7 +1595,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) QStringList part_keys_code; attributes[Attributes::Oids]=(with_oid ? Attributes::True : QString()); attributes[Attributes::GenAlterCmds]=(gen_alter_cmds ? Attributes::True : QString()); - attributes[Attributes::UNLOGGED]=(unlogged ? Attributes::True : QString()); + attributes[Attributes::Unlogged]=(unlogged ? Attributes::True : QString()); attributes[Attributes::RlsEnabled]=(rls_enabled ? Attributes::True : QString()); attributes[Attributes::RlsForced]=(rls_forced ? Attributes::True : QString()); attributes[Attributes::CopyTable]=QString(); @@ -1889,16 +1889,16 @@ QString Table::getAlterDefinition(BaseObject *object) attribs[Attributes::HasChanges]=Attributes::True; if(this->with_oid!=tab->with_oid) - attribs[Attributes::Oids]=(tab->with_oid ? Attributes::True : Attributes::UNSET); + attribs[Attributes::Oids]=(tab->with_oid ? Attributes::True : Attributes::Unset); if(this->unlogged!=tab->unlogged) - attribs[Attributes::UNLOGGED]=(tab->unlogged ? Attributes::True : Attributes::UNSET); + attribs[Attributes::Unlogged]=(tab->unlogged ? Attributes::True : Attributes::Unset); if(this->rls_enabled!=tab->rls_enabled) - attribs[Attributes::RlsEnabled]=(tab->rls_enabled ? Attributes::True : Attributes::UNSET); + attribs[Attributes::RlsEnabled]=(tab->rls_enabled ? Attributes::True : Attributes::Unset); if(this->rls_forced!=tab->rls_forced) - attribs[Attributes::RlsForced]=(tab->rls_forced ? Attributes::True : Attributes::UNSET); + attribs[Attributes::RlsForced]=(tab->rls_forced ? Attributes::True : Attributes::Unset); } copyAttributes(attribs); diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index aba747a139..659e970327 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -25,7 +25,7 @@ Textbox::Textbox(void) text_attributes[0]=text_attributes[1]=text_attributes[2]=false; attributes[Attributes::Italic]=QString(); attributes[Attributes::Bold]=QString(); - attributes[Attributes::UNDERLINE]=QString(); + attributes[Attributes::Underline]=QString(); attributes[Attributes::Color]=QString(); attributes[Attributes::FontSize]=QString(); } @@ -49,7 +49,7 @@ QString Textbox::getCodeDefinition(unsigned def_type) attributes[Attributes::Bold]=Attributes::True; if(text_attributes[UnderlineText]) - attributes[Attributes::UNDERLINE]=Attributes::True; + attributes[Attributes::Underline]=Attributes::True; if(text_color.name()!=QString("#000000")) attributes[Attributes::Color]=text_color.name(); diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 3c0a21bd22..15f548dd61 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -41,7 +41,7 @@ Trigger::Trigger(void) attributes[Attributes::PerRow]=QString(); attributes[Attributes::InsEvent]=QString(); attributes[Attributes::DelEvent]=QString(); - attributes[Attributes::UPD_EVENT]=QString(); + attributes[Attributes::UpdEvent]=QString(); attributes[Attributes::TruncEvent]=QString(); attributes[Attributes::Condition]=QString(); attributes[Attributes::RefTable]=QString(); @@ -347,7 +347,7 @@ void Trigger::setBasicAttributes(unsigned def_type) { QString str_aux, attribs[4]={Attributes::InsEvent, Attributes::DelEvent, - Attributes::TruncEvent, Attributes::UPD_EVENT }, + Attributes::TruncEvent, Attributes::UpdEvent }, sql_event[4]={"INSERT OR ", "DELETE OR ", "TRUNCATE OR ", "UPDATE "}; unsigned count, i, i1, event_types[4]={EventType::OnInsert, EventType::OnDelete, EventType::OnTruncate, EventType::OnUpdate}; diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index d74857ea11..82973d04e0 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -737,7 +737,7 @@ QString Type::getAlterDefinition(BaseObject *object) prev_val=this->enumerations[0]; } - attribs[Attributes::VALUE]=enum_val; + attribs[Attributes::Value]=enum_val; attribs[Attributes::ExistingValue]=prev_val; copyAttributes(attribs); alter_def+=BaseObject::getAlterDefinition(this->getSchemaName(), attributes, true, true); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index bdb9df6c47..07595c9f58 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -31,7 +31,7 @@ View::View(void) : BaseTable() attributes[Attributes::CteExpression]=QString(); attributes[Attributes::Materialized]=QString(); attributes[Attributes::Recursive]=QString(); - attributes[Attributes::WITH_NO_DATA]=QString(); + attributes[Attributes::WithNoData]=QString(); attributes[Attributes::Columns]=QString(); } @@ -576,7 +576,7 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::CteExpression]=cte_expression; attributes[Attributes::Materialized]=(materialized ? Attributes::True : QString()); attributes[Attributes::Recursive]=(recursive ? Attributes::True : QString()); - attributes[Attributes::WITH_NO_DATA]=(with_no_data ? Attributes::True : QString()); + attributes[Attributes::WithNoData]=(with_no_data ? Attributes::True : QString()); attributes[Attributes::Columns]=QString(); attributes[Attributes::Tag]=QString(); attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 5871cf6a7a..57f8aec5e8 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -48,11 +48,11 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid BaseObject::getSchemaName(ObjectType::Constraint), //20 BaseObject::getSchemaName(ObjectType::Policy), //21 BaseObject::getSchemaName(ObjectType::Policy), //22 - Attributes::VIEW_SCHEMA_NAME, //21 -> 23 - Attributes::VIEW_NAME, //22 - Attributes::VIEW_BODY, //23 - Attributes::VIEW_EXT_BODY, //24 - Attributes::VIEW_TITLE, //25 + Attributes::ViewSchemaName, //21 -> 23 + Attributes::ViewName, //22 + Attributes::ViewBody, //23 + Attributes::ViewExtBody, //24 + Attributes::ViewTitle, //25 Attributes::Alias, //26 Attributes::RefColumn, //27 Attributes::RefTable, //28 @@ -66,8 +66,8 @@ AppearanceConfigWidget::AppearanceConfigWidget(QWidget * parent) : BaseConfigWid Attributes::PkColumn, //36 Attributes::FkColumn, //37 Attributes::FkColumn, //38 - Attributes::UQ_COLUMN, //39 - Attributes::UQ_COLUMN, //40 + Attributes::UqColumn, //39 + Attributes::UqColumn, //40 Attributes::NnColumn, //41 Attributes::NnColumn, //42 Attributes::Relationship, //43 @@ -296,7 +296,7 @@ void AppearanceConfigWidget::saveConfiguration(void) attrib_id=item.conf_id + QString("-") + Attributes::Bold; attribs[attrib_id]=(font.bold() ? Attributes::True : Attributes::False); - attrib_id=item.conf_id + QString("-") + Attributes::UNDERLINE; + attrib_id=item.conf_id + QString("-") + Attributes::Underline; attribs[attrib_id]=(font.underline() ? Attributes::True : Attributes::False); } //Special case: treating the global font element diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 149943986a..431199694b 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -154,7 +154,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) conn->setDefaultForOperation(Connection::OpDiff, itr->second[DefaultFor.arg(Attributes::Diff)]==Attributes::True); conn->setDefaultForOperation(Connection::OpExport, itr->second[DefaultFor.arg(Attributes::Export)]==Attributes::True); conn->setDefaultForOperation(Connection::OpImport, itr->second[DefaultFor.arg(Attributes::Import)]==Attributes::True); - conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(Attributes::VALIDATION)]==Attributes::True); + conn->setDefaultForOperation(Connection::OpValidation, itr->second[DefaultFor.arg(Attributes::Validation)]==Attributes::True); connections.push_back(conn); itr++; @@ -511,7 +511,7 @@ void ConnectionsConfigWidget::saveConfiguration(void) attribs[DefaultFor.arg(Attributes::Export)]=(conn->isDefaultForOperation(Connection::OpExport) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::Import)]=(conn->isDefaultForOperation(Connection::OpImport) ? Attributes::True : QString()); attribs[DefaultFor.arg(Attributes::Diff)]=(conn->isDefaultForOperation(Connection::OpDiff) ? Attributes::True : QString()); - attribs[DefaultFor.arg(Attributes::VALIDATION)]=(conn->isDefaultForOperation(Connection::OpValidation) ? Attributes::True : QString()); + attribs[DefaultFor.arg(Attributes::Validation)]=(conn->isDefaultForOperation(Connection::OpValidation) ? Attributes::True : QString()); schparser.ignoreUnkownAttributes(true); config_params[GlobalAttributes::ConnectionsConf][Attributes::Connections]+= diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 4b031d4a4a..5f65914e41 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -84,9 +84,9 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Tablespace, QT_TR_NOOP("Tablespace")}, {Attributes::TpmodInFunc, QT_TR_NOOP("Type mod. in func.")}, {Attributes::TpmodOutFunc, QT_TR_NOOP("Type mod. out func.")}, {Attributes::TransitionFunc, QT_TR_NOOP("Transition func.")}, {Attributes::Trusted, QT_TR_NOOP("Trusted")}, {Attributes::Type, QT_TR_NOOP("Type")}, - {Attributes::TypeAttribute, QT_TR_NOOP("Type attribute")}, {Attributes::TYPES, QT_TR_NOOP("Types")}, - {Attributes::UNLOGGED, QT_TR_NOOP("Unlogged")}, {Attributes::VALIDATOR, QT_TR_NOOP("Validator func.")}, - {Attributes::VALIDITY, QT_TR_NOOP("Validity")}, {Attributes::WINDOW_FUNC, QT_TR_NOOP("Windows func.")}, + {Attributes::TypeAttribute, QT_TR_NOOP("Type attribute")}, {Attributes::Types, QT_TR_NOOP("Types")}, + {Attributes::Unlogged, QT_TR_NOOP("Unlogged")}, {Attributes::Validator, QT_TR_NOOP("Validator func.")}, + {Attributes::Validity, QT_TR_NOOP("Validity")}, {Attributes::WindowFunc, QT_TR_NOOP("Windows func.")}, {Attributes::False, QT_TR_NOOP("false")}, {Attributes::True, QT_TR_NOOP("true")}, {Attributes::Cache, QT_TR_NOOP("Cache value")}, {Attributes::Cycle, QT_TR_NOOP("Cycle")}, {Attributes::Increment, QT_TR_NOOP("Increment")}, {Attributes::MaxValue, QT_TR_NOOP("Max. value")}, @@ -96,7 +96,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::SubtypeDiffFunc, QT_TR_NOOP("Subtype diff func.")}, {Attributes::Deferrable, QT_TR_NOOP("Deferrable")}, {Attributes::PerRow, QT_TR_NOOP("For each row")}, {Attributes::FiringType, QT_TR_NOOP("Firing")}, {Attributes::InsEvent, QT_TR_NOOP("On insert")}, {Attributes::DelEvent, QT_TR_NOOP("On delete")}, - {Attributes::UPD_EVENT, QT_TR_NOOP("On update")}, {Attributes::TruncEvent, QT_TR_NOOP("On truncate")}, + {Attributes::UpdEvent, QT_TR_NOOP("On update")}, {Attributes::TruncEvent, QT_TR_NOOP("On truncate")}, {Attributes::Arguments, QT_TR_NOOP("Arguments")}, {Attributes::Table, QT_TR_NOOP("Table")}, {Attributes::TriggerFunc, QT_TR_NOOP("Trigger func.")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, {Attributes::Condition, QT_TR_NOOP("Condition")}, {Attributes::DeferType, QT_TR_NOOP("Deferment")}, @@ -107,8 +107,8 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Factor, QT_TR_NOOP("Fill factor")}, {Attributes::NoInherit, QT_TR_NOOP("No inherit")}, {Attributes::OpClasses, QT_TR_NOOP("Op. classes")}, {Attributes::Operators, QT_TR_NOOP("Operators")}, {Attributes::RefTable, QT_TR_NOOP("Ref. table")}, {Attributes::Columns, QT_TR_NOOP("Columns")}, - {Attributes::UPD_ACTION, QT_TR_NOOP("On update")}, {Attributes::SrcColumns, QT_TR_NOOP("Columns")}, - {Attributes::UNIQUE, QT_TR_NOOP("Unique")}, {Attributes::Predicate, QT_TR_NOOP("Predicate")}, + {Attributes::UpdAction, QT_TR_NOOP("On update")}, {Attributes::SrcColumns, QT_TR_NOOP("Columns")}, + {Attributes::Unique, QT_TR_NOOP("Unique")}, {Attributes::Predicate, QT_TR_NOOP("Predicate")}, {Attributes::Collations, QT_TR_NOOP("Collations")}, {Attributes::Inherited, QT_TR_NOOP("Inherited")}, {Attributes::ClientEncoding, QT_TR_NOOP("Client encoding")}, {Attributes::ConfigFile, QT_TR_NOOP("Configuration file")}, {Attributes::DataDirectory, QT_TR_NOOP("Data directory")}, {Attributes::DynamicLibraryPath, QT_TR_NOOP("Dynamic library path")}, @@ -122,12 +122,12 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::Connection, QT_TR_NOOP("Connection ID")}, {Attributes::ServerPid, QT_TR_NOOP("Server PID")}, {Attributes::ServerProtocol, QT_TR_NOOP("Server protocol")}, {Attributes::Referrers, QT_TR_NOOP("Referrers")}, {Attributes::IdentityType, QT_TR_NOOP("Identity")}, {Attributes::Command, QT_TR_NOOP("Command")}, - {Attributes::USING_EXP, QT_TR_NOOP("USING expr.")}, {Attributes::CheckExp, QT_TR_NOOP("CHECK expr.")}, + {Attributes::UsingExp, QT_TR_NOOP("USING expr.")}, {Attributes::CheckExp, QT_TR_NOOP("CHECK expr.")}, {Attributes::Roles, QT_TR_NOOP("Roles")}, {Attributes::RlsEnabled, QT_TR_NOOP("RLS enabled")}, - {Attributes::RlsForced, QT_TR_NOOP("RLS forced")}, {Attributes::LAST_ANALYZE, QT_TR_NOOP("Last analyze")}, - {Attributes::LAST_AUTOVACUUM, QT_TR_NOOP("Last autovacuum")}, {Attributes::LAST_VACUUM, QT_TR_NOOP("Last vacuum")}, - {Attributes::TUPLES_DEL, QT_TR_NOOP("Tuples deleted")}, {Attributes::TUPLES_UPD, QT_TR_NOOP("Tuples updated")}, - {Attributes::TUPLES_INS, QT_TR_NOOP("Tuples inserted")}, {Attributes::IsPartitioned, QT_TR_NOOP("Partitioned")}, + {Attributes::RlsForced, QT_TR_NOOP("RLS forced")}, {Attributes::LastAnalyze, QT_TR_NOOP("Last analyze")}, + {Attributes::LastAutovacuum, QT_TR_NOOP("Last autovacuum")}, {Attributes::LastVacuum, QT_TR_NOOP("Last vacuum")}, + {Attributes::TuplesDel, QT_TR_NOOP("Tuples deleted")}, {Attributes::TyplesUpd, QT_TR_NOOP("Tuples updated")}, + {Attributes::TuplesIns, QT_TR_NOOP("Tuples inserted")}, {Attributes::IsPartitioned, QT_TR_NOOP("Partitioned")}, {Attributes::PartitionedTable, QT_TR_NOOP("Partition of")}, {Attributes::PartitionBoundExpr, QT_TR_NOOP("Partition bound expr.")}, {Attributes::DeadRowsAmount, QT_TR_NOOP("Dead rows amount")}, {Attributes::PartitionKey, QT_TR_NOOP("Partition keys")}, {Attributes::Partitioning, QT_TR_NOOP("Partitioning")} @@ -446,7 +446,7 @@ void DatabaseExplorerWidget::formatCastAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatEventTriggerAttribs(attribs_map &attribs) { - attribs[Attributes::VALUES]=Catalog::parseArrayValues(attribs[Attributes::VALUES]).join(ElemSeparator); + attribs[Attributes::Values]=Catalog::parseArrayValues(attribs[Attributes::Values]).join(ElemSeparator); attribs[Attributes::Function]=getObjectName(ObjectType::Function, attribs[Attributes::Function]); } @@ -455,10 +455,10 @@ void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) formatOidAttribs(attribs, { Attributes::FinalFunc, Attributes::TransitionFunc }, ObjectType::Function, false); - formatOidAttribs(attribs, { Attributes::TYPES }, ObjectType::Type, true); + formatOidAttribs(attribs, { Attributes::Types }, ObjectType::Type, true); attribs[Attributes::Signature]=(QString("%1(%2)") .arg(BaseObject::formatName(attribs[Attributes::Name])) - .arg(attribs[Attributes::TYPES])).replace(ElemSeparator, QString(",")); + .arg(attribs[Attributes::Types])).replace(ElemSeparator, QString(",")); attribs[Attributes::StateType]=getObjectName(ObjectType::Type, attribs[Attributes::StateType]); attribs[Attributes::SortOp]=getObjectName(ObjectType::Operator, attribs[Attributes::SortOp]); @@ -469,7 +469,7 @@ void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::Trusted }); - formatOidAttribs(attribs, { Attributes::VALIDATOR_FUNC, + formatOidAttribs(attribs, { Attributes::ValidatorFunc, Attributes::HandlerFunc, Attributes::InlineFunc }, ObjectType::Function, false); } @@ -516,7 +516,7 @@ void DatabaseExplorerWidget::formatFunctionAttribs(attribs_map &attribs) .arg(BaseObject::formatName(attribs[Attributes::Name])) .arg(attribs[Attributes::ArgTypes])).replace(ElemSeparator, QString(",")); - formatBooleanAttribs(attribs, { Attributes::WINDOW_FUNC, + formatBooleanAttribs(attribs, { Attributes::WindowFunc, Attributes::LeakProof, Attributes::ReturnsSetOf }); } @@ -547,7 +547,7 @@ void DatabaseExplorerWidget::formatTableAttribs(attribs_map &attribs) QStringList part_keys; formatBooleanAttribs(attribs, { Attributes::Oids, - Attributes::UNLOGGED, + Attributes::Unlogged, Attributes::RlsEnabled, Attributes::RlsForced}); @@ -716,7 +716,7 @@ void DatabaseExplorerWidget::formatTriggerAttribs(attribs_map &attribs) Attributes::PerRow, Attributes::InsEvent, Attributes::DelEvent, - Attributes::UPD_EVENT, + Attributes::UpdEvent, Attributes::TruncEvent }); attribs[Attributes::TriggerFunc]=getObjectName(ObjectType::Function, attribs[Attributes::TriggerFunc]); @@ -742,7 +742,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) { map types={{Attributes::PkConstr, ConstraintType(ConstraintType::PrimaryKey)}, {Attributes::FkConstr, ConstraintType(ConstraintType::ForeignKey)}, - {Attributes::UQ_CONSTR, ConstraintType(ConstraintType::Unique)}, + {Attributes::UqConstr, ConstraintType(ConstraintType::Unique)}, {Attributes::CkConstr, ConstraintType(ConstraintType::Check)}, {Attributes::ExConstr, ConstraintType(ConstraintType::Exclude)}}; @@ -770,7 +770,7 @@ void DatabaseExplorerWidget::formatConstraintAttribs(attribs_map &attribs) { attribs.erase(Attributes::DstColumns); attribs.erase(Attributes::RefTable); - attribs.erase(Attributes::UPD_ACTION); + attribs.erase(Attributes::UpdAction); attribs.erase(Attributes::DelAction); attribs.erase(Attributes::ComparisonType); } @@ -804,7 +804,7 @@ void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) if(names.isEmpty() || names.size() == 1) names=getObjectName(ObjectType::View, attribs[Attributes::Table]).split('.'); - formatBooleanAttribs(attribs, { Attributes::UNIQUE }); + formatBooleanAttribs(attribs, { Attributes::Unique }); attribs[Attributes::Expressions]=Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index b952cc4263..82c8284343 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1182,7 +1182,7 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) try { unsigned lang_oid, func_oid; - QString func_types[]={ Attributes::VALIDATOR_FUNC, + QString func_types[]={ Attributes::ValidatorFunc, Attributes::HandlerFunc, Attributes::InlineFunc }; @@ -1452,8 +1452,8 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) Table *tab = nullptr; QString col_name, tab_name; attribs_map pos_attrib={ - { Attributes::X_POS, QString("0") }, - { Attributes::Y_POS, QString("0") }}; + { Attributes::XPos, QString("0") }, + { Attributes::YPos, QString("0") }}; if(attribs[Attributes::Oid].toUInt() > owner_col[0].toUInt()) seq_tab_swap[attribs[Attributes::Oid]]=owner_col[0]; @@ -1508,13 +1508,13 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) for(unsigned i=0; i < 2; i++) attribs[func_types[i]]=getDependencyObject(attribs[func_types[i]], ObjectType::Function, true, auto_resolve_deps, true, {{Attributes::RefType, func_types[i]}}); - types=getTypes(attribs[Attributes::TYPES], true); - attribs[Attributes::TYPES]=QString(); + types=getTypes(attribs[Attributes::Types], true); + attribs[Attributes::Types]=QString(); if(!types.isEmpty()) { for(int i=0; i < types.size(); i++) - attribs[Attributes::TYPES]+=types[i]; + attribs[Attributes::Types]+=types[i]; } attribs[Attributes::StateType]=getType(attribs[Attributes::StateType], true, @@ -1639,8 +1639,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) QString type_def, unknown_obj_xml, type_name, def_val; map::iterator itr, itr1, itr_end; attribs_map pos_attrib={ - { Attributes::X_POS, QString("0") }, - { Attributes::Y_POS, QString("0") }}; + { Attributes::XPos, QString("0") }, + { Attributes::YPos, QString("0") }}; attribs[Attributes::Columns]=QString(); attribs[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, pos_attrib, SchemaParser::XmlDefinition); @@ -1874,8 +1874,8 @@ void DatabaseImportHelper::createView(attribs_map &attribs) try { - attribs_map pos_attrib={{ Attributes::X_POS, QString("0") }, - { Attributes::Y_POS, QString("0") }}; + attribs_map pos_attrib={{ Attributes::XPos, QString("0") }, + { Attributes::YPos, QString("0") }}; attribs[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, pos_attrib, SchemaParser::XmlDefinition); @@ -2219,9 +2219,9 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) attribs[Attributes::Function]=getDependencyObject(attribs[Attributes::Function], ObjectType::Function, true, true); attribs[Attributes::Filter]=QString("\t<%1 %2=\"%3\" %4=\"%5\"/>\n") .arg(Attributes::Filter) - .arg(Attributes::VARIABLE).arg(Attributes::Tag.toUpper()) - .arg(Attributes::VALUES) - .arg(Catalog::parseArrayValues(attribs[Attributes::VALUES].remove('"')).join(',')); + .arg(Attributes::Variable).arg(Attributes::Tag.toUpper()) + .arg(Attributes::Values) + .arg(Catalog::parseArrayValues(attribs[Attributes::Values].remove('"')).join(',')); loadObjectXML(ObjectType::EventTrigger, attribs); dbmodel->addEventTrigger(dbmodel->createEventTrigger()); @@ -2629,7 +2629,7 @@ QString DatabaseImportHelper::getObjectName(const QString &oid, bool signature_f } else if(obj_type==ObjectType::Aggregate) { - QStringList params=getTypes(obj_attr[Attributes::TYPES], false); + QStringList params=getTypes(obj_attr[Attributes::Types], false); if(params.isEmpty()) params.push_back(QString("*")); @@ -2747,16 +2747,16 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, /* If the type was generated from a table/sequence/view/domain and the source object is not yet imported and the auto resolve deps is enabled, we need to import it */ - if(!type_attr[Attributes::TYPE_CLASS].isEmpty() && auto_resolve_deps && + if(!type_attr[Attributes::TypeClass].isEmpty() && auto_resolve_deps && (!user_objs.count(object_id) && !system_objs.count(object_id))) { ObjectType obj_type; - if(type_attr[Attributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::Table)) + if(type_attr[Attributes::TypeClass]==BaseObject::getSchemaName(ObjectType::Table)) obj_type=ObjectType::Table; - else if(type_attr[Attributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::View)) + else if(type_attr[Attributes::TypeClass]==BaseObject::getSchemaName(ObjectType::View)) obj_type=ObjectType::View; - else if(type_attr[Attributes::TYPE_CLASS]==BaseObject::getSchemaName(ObjectType::Domain)) + else if(type_attr[Attributes::TypeClass]==BaseObject::getSchemaName(ObjectType::Domain)) obj_type=ObjectType::Domain; else obj_type=ObjectType::Sequence; diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 058bc431ab..3a641d1cea 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -124,12 +124,12 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::LineNumbersBgColor]=QString(); config_params[Attributes::Configuration][Attributes::LineHighlightColor]=QString(); config_params[Attributes::Configuration][Attributes::HighlightLines]=QString(); - config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=QString(); + config_params[Attributes::Configuration][Attributes::UsePlaceholders]=QString(); config_params[Attributes::Configuration][Attributes::MinObjectOpacity]=QString(); config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString(); config_params[Attributes::Configuration][Attributes::SourceEditorApp]=QString(); - config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]=QString(); - config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=QString(); + config_params[Attributes::Configuration][Attributes::UiLanguage]=QString(); + config_params[Attributes::Configuration][Attributes::UseCurvedLines]=QString(); config_params[Attributes::Configuration][Attributes:: SaveRestoreGeometry]=QString(); simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this); @@ -294,8 +294,8 @@ void GeneralConfigWidget::loadConfiguration(void) simple_obj_creation_chk->setChecked(config_params[Attributes::Configuration][Attributes::SimplifiedObjCreation]==Attributes::True); confirm_validation_chk->setChecked(config_params[Attributes::Configuration][Attributes::ConfirmValidation]==Attributes::True); code_completion_chk->setChecked(config_params[Attributes::Configuration][Attributes::CodeCompletion]==Attributes::True); - use_placeholders_chk->setChecked(config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]==Attributes::True); - use_curved_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]==Attributes::True); + use_placeholders_chk->setChecked(config_params[Attributes::Configuration][Attributes::UsePlaceholders]==Attributes::True); + use_curved_lines_chk->setChecked(config_params[Attributes::Configuration][Attributes::UseCurvedLines]==Attributes::True); print_grid_chk->setChecked(config_params[Attributes::Configuration][Attributes::PrintGrid]==Attributes::True); print_pg_num_chk->setChecked(config_params[Attributes::Configuration][Attributes::PrintPgNum]==Attributes::True); @@ -335,7 +335,7 @@ void GeneralConfigWidget::loadConfiguration(void) save_restore_geometry_chk->setChecked(config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]==Attributes::True); reset_sizes_tb->setEnabled(save_restore_geometry_chk->isChecked()); - int ui_idx = ui_language_cmb->findData(config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]); + int ui_idx = ui_language_cmb->findData(config_params[Attributes::Configuration][Attributes::UiLanguage]); ui_language_cmb->setCurrentIndex(ui_idx >= 0 ? ui_idx : 0); for(QWidget *wgt : child_wgts) @@ -344,11 +344,11 @@ void GeneralConfigWidget::loadConfiguration(void) widgets_geom.clear(); for(auto itr : config_params) { - if(itr.second.count(Attributes::X_POS)) + if(itr.second.count(Attributes::XPos)) { - x = itr.second[Attributes::X_POS].toInt(); - y = itr.second[Attributes::Y_POS].toInt(); - w = itr.second[Attributes::WIDTH].toInt(); + x = itr.second[Attributes::XPos].toInt(); + y = itr.second[Attributes::YPos].toInt(); + w = itr.second[Attributes::Width].toInt(); h = itr.second[Attributes::Height].toInt(); widgets_geom[itr.first].geometry = QRect(QPoint(x,y), QSize(w, h)); widgets_geom[itr.first].maximized = itr.second[Attributes::Maximized] == Attributes::True; @@ -463,7 +463,7 @@ void GeneralConfigWidget::saveConfiguration(void) widget_sch=root_dir + GlobalAttributes::SchemasDir + GlobalAttributes::DirSeparator + - Attributes::WIDGET + + Attributes::Widget + GlobalAttributes::SchemaExt; config_params[Attributes::Configuration][Attributes::GridSize]=QString::number(grid_size_spb->value()); @@ -481,9 +481,9 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::CodeCompletion]=(code_completion_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::CodeTabWidth]=QString::number(tab_width_chk->isChecked() ? tab_width_spb->value() : 0); config_params[Attributes::Configuration][Attributes::MinObjectOpacity]=QString::number(min_obj_opacity_spb->value()); - config_params[Attributes::Configuration][Attributes::USE_PLACEHOLDERS]=(use_placeholders_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::UsePlaceholders]=(use_placeholders_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString::number(history_max_length_spb->value()); - config_params[Attributes::Configuration][Attributes::USE_CURVED_LINES]=(use_curved_lines_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::UseCurvedLines]=(use_curved_lines_chk->isChecked() ? Attributes::True : QString()); ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); config_params[Attributes::Configuration][Attributes::ShowCanvasGrid]=(show_grid ? Attributes::True : QString()); @@ -518,7 +518,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::SourceEditorApp]=source_editor_edt->text(); config_params[Attributes::Configuration][Attributes::SourceEditorArgs]=source_editor_args_edt->text(); - config_params[Attributes::Configuration][Attributes::UI_LANGUAGE]=ui_language_cmb->currentData().toString(); + config_params[Attributes::Configuration][Attributes::UiLanguage]=ui_language_cmb->currentData().toString(); config_params[Attributes::Configuration][Attributes::CompactView]=(BaseObjectView::isCompactViewEnabled() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]=(save_restore_geometry_chk->isChecked() ? Attributes::True : QString()); @@ -530,7 +530,7 @@ void GeneralConfigWidget::saveConfiguration(void) itr_end=config_params.end(); config_params[Attributes::Configuration][Attributes::DockWidgets]=QString(); - config_params[Attributes::Configuration][Attributes::WIDGETS_GEOMETRY]=QString(); + config_params[Attributes::Configuration][Attributes::WidgetsGeometry]=QString(); config_params[Attributes::Configuration][Attributes::RecentModels]=QString(); config_params[Attributes::Configuration][Attributes::File]=QString(); @@ -548,7 +548,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::RecentModels]+= schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } - else if(itr->first==Attributes::VALIDATOR || + else if(itr->first==Attributes::Validator || itr->first==Attributes::ObjectFinder || itr->first==Attributes::SqlTool) { @@ -568,14 +568,14 @@ void GeneralConfigWidget::saveConfiguration(void) for(auto &itr : widgets_geom) { attribs[Attributes::Id] = itr.first; - attribs[Attributes::X_POS] = QString::number(itr.second.geometry.left()); - attribs[Attributes::Y_POS] = QString::number(itr.second.geometry.top()); - attribs[Attributes::WIDTH] = QString::number(itr.second.geometry.width()); + attribs[Attributes::XPos] = QString::number(itr.second.geometry.left()); + attribs[Attributes::YPos] = QString::number(itr.second.geometry.top()); + attribs[Attributes::Width] = QString::number(itr.second.geometry.width()); attribs[Attributes::Height] = QString::number(itr.second.geometry.height()); attribs[Attributes::Maximized] = itr.second.maximized ? Attributes::True : QString(); schparser.ignoreUnkownAttributes(true); - config_params[Attributes::Configuration][Attributes::WIDGETS_GEOMETRY]+= + config_params[Attributes::Configuration][Attributes::WidgetsGeometry]+= schparser.getCodeDefinition(widget_sch, attribs); schparser.ignoreUnkownAttributes(false); } diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 013a8f0bc6..a9fc1e756e 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1831,11 +1831,11 @@ void MainWindow::storeDockWidgetsSettings(void) GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); attribs_map params; - params[Attributes::VALIDATOR]=Attributes::True; + params[Attributes::Validator]=Attributes::True; params[Attributes::SqlValidation]=(model_valid_wgt->sql_validation_chk->isChecked() ? Attributes::True : QString()); - params[Attributes::USE_UNIQUE_NAMES]=(model_valid_wgt->use_tmp_names_chk->isChecked() ? Attributes::True : QString()); + params[Attributes::UseUniqueNames]=(model_valid_wgt->use_tmp_names_chk->isChecked() ? Attributes::True : QString()); params[Attributes::PgSqlVersion]=model_valid_wgt->version_cmb->currentText(); - conf_wgt->addConfigurationParam(Attributes::VALIDATOR, params); + conf_wgt->addConfigurationParam(Attributes::Validator, params); params.clear(); params[Attributes::ObjectFinder]=Attributes::True; @@ -1859,11 +1859,11 @@ void MainWindow::restoreDockWidgetsSettings(void) GeneralConfigWidget *conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::GeneralConfWgt)); map confs=conf_wgt->getConfigurationParams(); - if(confs.count(Attributes::VALIDATOR)) + if(confs.count(Attributes::Validator)) { - model_valid_wgt->sql_validation_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::SqlValidation]==Attributes::True); - model_valid_wgt->use_tmp_names_chk->setChecked(confs[Attributes::VALIDATOR][Attributes::USE_UNIQUE_NAMES]==Attributes::True); - model_valid_wgt->version_cmb->setCurrentText(confs[Attributes::VALIDATOR][Attributes::PgSqlVersion]); + model_valid_wgt->sql_validation_chk->setChecked(confs[Attributes::Validator][Attributes::SqlValidation]==Attributes::True); + model_valid_wgt->use_tmp_names_chk->setChecked(confs[Attributes::Validator][Attributes::UseUniqueNames]==Attributes::True); + model_valid_wgt->version_cmb->setCurrentText(confs[Attributes::Validator][Attributes::PgSqlVersion]); } if(confs.count(Attributes::ObjectFinder)) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index dfaef490cf..726b537cf6 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -885,7 +885,7 @@ void ModelsDiffHelper::processDiffInfos(void) attribs[Attributes::TruncateCmds]=QString(); attribs[Attributes::ConstrDefs]=QString(); attribs[Attributes::FkDefs]=QString(); - attribs[Attributes::UNSET_PERMS]=unset_perms; + attribs[Attributes::UnsetPerms]=unset_perms; attribs[Attributes::SetPerms]=set_perms; attribs[Attributes::Function]=(has_diffs && source_model->getObjectCount(ObjectType::Function)!=0 ? Attributes::True : QString()); attribs[Attributes::SearchPath]=(has_diffs ? sch_names.join(',') : QString()); diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index b3f0fcd39b..b9acdccd99 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -25,11 +25,11 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob QCheckBox *check=nullptr; unsigned i; QString privs[]={ Attributes::SelectPriv, Attributes::InsertPriv, - Attributes::UPDATE_PRIV, Attributes::DeletePriv, + Attributes::UpdatePriv, Attributes::DeletePriv, Attributes::TruncatePriv, Attributes::ReferencesPriv, Attributes::TriggerPriv, Attributes::CreatePriv, Attributes::ConnectPriv, Attributes::TemporaryPriv, - Attributes::ExecutPriv, Attributes::USAGE_PRIV }; + Attributes::ExecutPriv, Attributes::UsagePriv }; Ui_PermissionWidget::setupUi(this); diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index e983b63669..3d3d7e8e21 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -106,7 +106,7 @@ void RelationshipConfigWidget::loadConfiguration(void) deferrable_chk->setChecked(config_params[Attributes::ForeignKeys][Attributes::Deferrable]==Attributes::True); deferral_cmb->setCurrentText(config_params[Attributes::ForeignKeys][Attributes::DeferType]); - idx=upd_action_cmb->findText(config_params[Attributes::ForeignKeys][Attributes::UPD_ACTION]); + idx=upd_action_cmb->findText(config_params[Attributes::ForeignKeys][Attributes::UpdAction]); upd_action_cmb->setCurrentIndex(idx < 0 ? 0 : idx); idx=del_action_cmb->findText(config_params[Attributes::ForeignKeys][Attributes::DelAction]); @@ -155,7 +155,7 @@ void RelationshipConfigWidget::saveConfiguration(void) config_params[Attributes::ForeignKeys][Attributes::Deferrable]=(deferrable_chk->isChecked() ? Attributes::True : Attributes::False); config_params[Attributes::ForeignKeys][Attributes::DeferType]=deferral_cmb->currentText(); - config_params[Attributes::ForeignKeys][Attributes::UPD_ACTION]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); + config_params[Attributes::ForeignKeys][Attributes::UpdAction]=(upd_action_cmb->currentIndex() > 0 ? upd_action_cmb->currentText() : QString()); config_params[Attributes::ForeignKeys][Attributes::DelAction]=(del_action_cmb->currentIndex() > 0 ? del_action_cmb->currentText() : QString()); config_params[Attributes::NamePatterns][Attributes::Patterns]=QString(); @@ -213,7 +213,7 @@ void RelationshipConfigWidget::fillNamePatterns(void) dst_col_pattern_txt, src_fk_pattern_txt, dst_fk_pattern_txt, pk_col_pattern_txt }; - QList pattern_ids={ Attributes::PkPattern, Attributes::UQ_PATTERN, + QList pattern_ids={ Attributes::PkPattern, Attributes::UqPattern, Attributes::SrcColPattern, Attributes::DstColPattern, Attributes::SrcFkPattern, Attributes::DstFkPattern, Attributes::PkColPattern }; @@ -253,7 +253,7 @@ void RelationshipConfigWidget::updatePattern(void) QPlainTextEdit *input=qobject_cast(sender()); QString rel_type=rel_type_cmb->currentData().toString(); map inputs_map={ { pk_pattern_txt, Attributes::PkPattern }, - { uq_pattern_txt, Attributes::UQ_PATTERN }, + { uq_pattern_txt, Attributes::UqPattern }, { src_col_pattern_txt, Attributes::SrcColPattern }, { dst_col_pattern_txt, Attributes::DstColPattern }, { src_fk_pattern_txt, Attributes::SrcFkPattern }, diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index a79cb066ad..1138039281 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -480,7 +480,7 @@ void RelationshipWidget::useFKGlobalSettings(bool value) map confs=RelationshipConfigWidget::getConfigurationParams(); deferrable_chk->setChecked(confs[Attributes::ForeignKeys][Attributes::Deferrable]==Attributes::True); deferral_cmb->setCurrentText(confs[Attributes::ForeignKeys][Attributes::DeferType]); - upd_action_cmb->setCurrentText(confs[Attributes::ForeignKeys][Attributes::UPD_ACTION]); + upd_action_cmb->setCurrentText(confs[Attributes::ForeignKeys][Attributes::UpdAction]); del_action_cmb->setCurrentText(confs[Attributes::ForeignKeys][Attributes::DelAction]); } else @@ -520,7 +520,7 @@ void RelationshipWidget::usePatternGlobalSettings(bool value) pk_pattern_txt->setPlainText(confs[rel_type][Attributes::PkPattern]); src_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::SrcFkPattern]); dst_fk_pattern_txt->setPlainText(confs[rel_type][Attributes::DstFkPattern]); - uq_pattern_txt->setPlainText(confs[rel_type][Attributes::UQ_PATTERN]); + uq_pattern_txt->setPlainText(confs[rel_type][Attributes::UqPattern]); src_col_pattern_txt->setPlainText(confs[rel_type][Attributes::SrcColPattern]); dst_col_pattern_txt->setPlainText(confs[rel_type][Attributes::DstColPattern]); pk_col_pattern_txt->setPlainText(confs[rel_type][Attributes::PkColPattern]); diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 25ff0b23a0..983921b065 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -390,27 +390,27 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) { elem=xmlparser.getElementName(); - if(elem==Attributes::WORD_SEPARATORS) + if(elem==Attributes::WordSeparators) { xmlparser.getElementAttributes(attribs); - word_separators=attribs[Attributes::VALUE]; + word_separators=attribs[Attributes::Value]; } - else if(elem==Attributes::WORD_DELIMITERS) + else if(elem==Attributes::WordDelimiters) { xmlparser.getElementAttributes(attribs); - word_delimiters=attribs[Attributes::VALUE]; + word_delimiters=attribs[Attributes::Value]; } else if(elem==Attributes::IgnoredChars) { xmlparser.getElementAttributes(attribs); - ignored_chars=attribs[Attributes::VALUE]; + ignored_chars=attribs[Attributes::Value]; } else if(elem==Attributes::CompletionTrigger) { xmlparser.getElementAttributes(attribs); - if(attribs[Attributes::VALUE].size() >= 1) - completion_trigger=attribs[Attributes::VALUE].at(0); + if(attribs[Attributes::Value].size() >= 1) + completion_trigger=attribs[Attributes::Value].at(0); } /* If the element is what defines the order of application of the groups @@ -478,7 +478,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) chr_sensitive=(attribs[Attributes::CaseSensitive]==Attributes::True); italic=(attribs[Attributes::Italic]==Attributes::True); bold=(attribs[Attributes::Bold]==Attributes::True); - underline=(attribs[Attributes::UNDERLINE]==Attributes::True); + underline=(attribs[Attributes::Underline]==Attributes::True); partial_match=(attribs[Attributes::PartialMatch]==Attributes::True); fg_color.setNamedColor(attribs[Attributes::ForegroundColor]); @@ -522,11 +522,11 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) { xmlparser.getElementAttributes(attribs); expr_type=attribs[Attributes::Type]; - regexp.setPattern(attribs[Attributes::VALUE]); + regexp.setPattern(attribs[Attributes::Value]); if(attribs[Attributes::RegularExp]==Attributes::True) regexp.setPatternSyntax(QRegExp::RegExp2); - else if(attribs[Attributes::WILDCARD]==Attributes::True) + else if(attribs[Attributes::Wildcard]==Attributes::True) regexp.setPatternSyntax(QRegExp::Wildcard); else regexp.setPatternSyntax(QRegExp::FixedString); diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index d512be5a7c..2382687698 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1501,7 +1501,7 @@ bool PgModelerCli::containsRelAttributes(const QString &str) Attributes::TableName, Attributes::SpecialPkCols, Attributes::Table, Attributes::AncestorTable, Attributes::CopyOptions, Attributes::CopyMode, Attributes::SrcColPattern, Attributes::DstColPattern, Attributes::PkPattern, - Attributes::UQ_PATTERN, Attributes::SrcFkPattern, Attributes::DstFkPattern }; + Attributes::UqPattern, Attributes::SrcFkPattern, Attributes::DstFkPattern }; for(unsigned i=0; i < attribs.size() && !found; i++) found=str.contains(attribs[i]); @@ -1561,7 +1561,7 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) QString startup_script=QString("%1/start-pgmodeler.sh") .arg(QFileInfo(GlobalAttributes::PgModelerAppPath).absolutePath()); - attribs[Attributes::WORKING_DIR]=QStandardPaths::writableLocation(QStandardPaths::HomeLocation); + attribs[Attributes::WorkingDir]=QStandardPaths::writableLocation(QStandardPaths::HomeLocation); attribs[Attributes::Application]=(QFileInfo(startup_script).exists() ? startup_script : GlobalAttributes::PgModelerAppPath); attribs[Attributes::Icon]=exec_icon; diff --git a/main/src/application.cpp b/main/src/application.cpp index 2b74dda21e..8be45ebc5a 100644 --- a/main/src/application.cpp +++ b/main/src/application.cpp @@ -68,12 +68,12 @@ Application::Application(int &argc, char **argv) : QApplication(argc,argv) if(input.open(QFile::ReadOnly)) { QString buf = QString(input.readAll()); - QRegExp regexp = QRegExp(QString("(%1)(.*)(=)(\\\")(.)+(\\\")(\\\n)").arg(Attributes::UI_LANGUAGE)); + QRegExp regexp = QRegExp(QString("(%1)(.*)(=)(\\\")(.)+(\\\")(\\\n)").arg(Attributes::UiLanguage)); int idx = regexp.indexIn(QString(buf)); //Extract the value of the ui-language attribute in the conf file lang_id = buf.mid(idx, regexp.matchedLength()); - lang_id.remove(Attributes::UI_LANGUAGE); + lang_id.remove(Attributes::UiLanguage); lang_id.remove(QChar('"')).remove(QChar('=')).remove(QChar('\n')); } From f8b347e8bf3c7656761a14c5f8e9738dc38d7be3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 21:15:42 -0300 Subject: [PATCH 189/425] Fixed compilation problems on Windows --- libpgmodeler_ui/src/pluginsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/welcomewidget.cpp | 2 +- libutils/src/globalattributes.cpp | 4 ++-- main-cli/src/pgmodelercli.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.cpp b/libpgmodeler_ui/src/pluginsconfigwidget.cpp index 76e0bbb34d..ca04dd1240 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.cpp +++ b/libpgmodeler_ui/src/pluginsconfigwidget.cpp @@ -90,7 +90,7 @@ void PluginsConfigWidget::loadConfiguration(void) [PLUGINS ROOT DIR]/[PLUGIN NAME]/lib[PLUGIN NAME].[EXTENSION] */ #ifdef Q_OS_WIN lib=dir_plugins + plugin_name + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::DirSeparator + plugin_name + QString(".dll"); #else #ifdef Q_OS_MAC diff --git a/libpgmodeler_ui/src/welcomewidget.cpp b/libpgmodeler_ui/src/welcomewidget.cpp index fcd92d93fa..c525505e76 100644 --- a/libpgmodeler_ui/src/welcomewidget.cpp +++ b/libpgmodeler_ui/src/welcomewidget.cpp @@ -38,7 +38,7 @@ WelcomeWidget::WelcomeWidget(QWidget *parent): QWidget(parent) #ifdef Q_OS_LINUX PgModelerUiNs::__configureWidgetFont(btn, 1.20f); #else - PgModelerUiNS::__configureWidgetFont(btn, 1.50f); + PgModelerUiNs::__configureWidgetFont(btn, 1.50f); #endif } } diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index e815eec4bb..ae3684174d 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -94,10 +94,10 @@ namespace GlobalAttributes { QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1/tmp").arg(PgModelerAppName)), #else ConfigurationsDir=getPathFromEnv(QString("PGMODELER_CONF_DIR"), - QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QString("/%1").arg(PGMODELER_APP_NAME)), + QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QString("/%1").arg(PgModelerAppName)), TemporaryDir=getPathFromEnv(QString("PGMODELER_TMP_DIR"), - QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QString("/%1/tmp").arg(PGMODELER_APP_NAME)), + QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QString("/%1/tmp").arg(PgModelerAppName)), #endif SQLHighlightConfPath=ConfigurationsDir + DirSeparator + SQLHighlightConf + ConfigurationExt, diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 2382687698..021093e38c 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1662,13 +1662,13 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) //Checking if the .dbm registry key exists QSettings dbm_ext(QString("HKEY_CURRENT_USER\\Software\\Classes\\.dbm"), QSettings::NativeFormat); - QString exe_path=QDir::toNativeSeparators(GlobalAttributes::PGMODELER_APP_PATH); + QString exe_path=QDir::toNativeSeparators(GlobalAttributes::PgModelerAppPath); //If there is no value assigned to .dbm/Default key and the user wants to uninstall file association, raises an error if(uninstall && dbm_ext.value(QString("Default")).toString().isEmpty()) - throw Exception(msg_no_association, ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg_no_association, ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else if(!uninstall && !dbm_ext.value(QString("Default")).toString().isEmpty()) - throw Exception(msg_file_associated, ERR_CUSTOM,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(msg_file_associated, ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { if(!uninstall) From 2f7a586163bb05eb86161beb5aa94300766ed3ad Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 21:28:54 -0300 Subject: [PATCH 190/425] Fixed compilation problems on macOs --- libpgmodeler_ui/src/pluginsconfigwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.cpp b/libpgmodeler_ui/src/pluginsconfigwidget.cpp index ca04dd1240..43e6477c42 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.cpp +++ b/libpgmodeler_ui/src/pluginsconfigwidget.cpp @@ -95,7 +95,7 @@ void PluginsConfigWidget::loadConfiguration(void) #else #ifdef Q_OS_MAC lib=dir_plugins + plugin_name + - GlobalAttributes::DIR_SEPARATOR + + GlobalAttributes::DirSeparator + QString("lib") + plugin_name + QString(".dylib"); #else lib=dir_plugins + plugin_name + From 23c2141e56edb5f8ce3c32498e711d4665921508 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Oct 2018 21:44:56 -0300 Subject: [PATCH 191/425] Testing C++14 support --- pgmodeler.pri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgmodeler.pri b/pgmodeler.pri index d74b69a94d..61d94ef72b 100644 --- a/pgmodeler.pri +++ b/pgmodeler.pri @@ -11,7 +11,7 @@ # General Qt settings QT += core widgets printsupport network svg -CONFIG += ordered qt stl rtti exceptions warn_on c++11 +CONFIG += ordered qt stl rtti exceptions warn_on c++14 TEMPLATE = subdirs MOC_DIR = moc OBJECTS_DIR = obj From ab75cd1dd391af6bdce7d5108f524c0fe0e7accb Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 27 Oct 2018 15:18:24 -0300 Subject: [PATCH 192/425] Minor update on known issues at README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0eff748b78..576dd1a395 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,12 @@ For details about installation process from source code visit the [Installation] Known Issues ----------- +* Due to the usage of Qt's raster engine to draw objects the process to handle objects on the canvas tends to get slower as lots of objects are created due to the constantly CPU usage. A heavy performance degradation can be noticed when dealing with models with ~500+ tables and/or relationships. There're plans to improve the speed of drawing operations for large models for future releases. * The diff process still presents false-positive results due its limitations. Sometimes, there is the need to run the process twice to get the full changes. * pgModeler does not fully supports the [quoted identifier notation](http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). When using quoted identifiers only the following characters are accepted in the middle of names: a-z A-Z 0-9 _ . @ $ - / \ space. * pgModeler is unusable in sandboxed Mac OS X installations. To workaround this issue you'll need to deactivate sandbox usage to run pgModeler properly. There is no planning to adapt this tool for sandbox feature in Mac OS X. * pgModeler can't be compiled in Microsoft Visual Studio due to use of some gcc/clang extensions. -* Compiling the source using '-Wconversion' (disabled by Qt in its default) generates a lot of warnings. These warnings are harmless in 99% of times but we can't just ignore them but I don't plan to fix them in a near future (mail me for more details). +* Compiling the source using '-Wconversion' (disabled by Qt in its defaults) generates a lot of warnings. These warnings are harmless in 99% of times but we can't just ignore them but I don't plan to fix them in a near future. * pgModeler sometimes can crash during the export, import or validation process due to some threaded operations that, depending on size and arrange of the model, causes race conditions. * Due to particularities on executing bundles on MacOSX the file association does not work correctly on this system. So it's not possible to open a model file by clicking it on Finder. From ef6471f1ecdce09896fb2e72e31fefb649215630 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 27 Oct 2018 15:37:13 -0300 Subject: [PATCH 193/425] Improved the DatabaseModel::destroyObjects to avoid crashes on certain situations --- README.md | 2 +- libpgmodeler/src/databasemodel.cpp | 8 +++----- libpgmodeler_ui/src/modelwidget.cpp | 5 +---- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 576dd1a395..8a2e455fa0 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ For details about installation process from source code visit the [Installation] Known Issues ----------- -* Due to the usage of Qt's raster engine to draw objects the process to handle objects on the canvas tends to get slower as lots of objects are created due to the constantly CPU usage. A heavy performance degradation can be noticed when dealing with models with ~500+ tables and/or relationships. There're plans to improve the speed of drawing operations for large models for future releases. +* Due to the usage of Qt's raster engine to draw objects, the process of handling objects on the canvas tends to get slower as lots of objects are created due causing constant CPU usage. A heavy performance degradation can be noticed when dealing with models with ~500+ tables and/or relationships. There're plans to improve the speed of drawing operations for large models for future releases. * The diff process still presents false-positive results due its limitations. Sometimes, there is the need to run the process twice to get the full changes. * pgModeler does not fully supports the [quoted identifier notation](http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). When using quoted identifiers only the following characters are accepted in the middle of names: a-z A-Z 0-9 _ . @ $ - / \ space. * pgModeler is unusable in sandboxed Mac OS X installations. To workaround this issue you'll need to deactivate sandbox usage to run pgModeler properly. There is no planning to adapt this tool for sandbox feature in Mac OS X. diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 2132376837..a4851e1867 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -744,14 +744,10 @@ void DatabaseModel::destroyObjects(void) map objects; map::reverse_iterator ritr, ritr_end; vector rem_obj_types; - vector perms; //Blocking signals of all graphical objects to avoid uneeded updates in the destruction this->blockSignals(true); - //Making a copy of the permissions list so these objects can be destroyed at the end - perms = permissions; - for(unsigned i=0; i < 5; i++) { for(auto &object : *this->getObjectList(graph_types[i])) @@ -808,9 +804,11 @@ void DatabaseModel::destroyObjects(void) PgSqlType::removeUserTypes(this); - for(auto &perm : perms) + for(auto &perm : permissions) delete(perm); + permissions.clear(); + //Cleaning out the list of removed objects to avoid segfaults while calling this method again if(!rem_obj_types.empty()) { diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 21dffe8765..c03cfcd764 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -155,6 +155,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) //Force the scene to be drawn from the left to right and from top to bottom viewport->setAlignment(Qt::AlignLeft | Qt::AlignTop); viewport->setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate); + viewport->setCacheMode(QGraphicsView::CacheBackground); viewport->centerOn(0,0); viewport->setMouseTracking(true); @@ -489,10 +490,6 @@ ModelWidget::~ModelWidget(void) delete(viewport); delete(scene); - - op_list->removeOperations(); - db_model->destroyObjects(); - delete(op_list); delete(db_model); } From 0eae663c12ec62d1dd4caec298a0029c2686e81a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 30 Oct 2018 11:00:17 -0300 Subject: [PATCH 194/425] Removing unused fr_FR UI translations --- lang/fr_FR.qm.old | Bin 246373 -> 0 bytes lang/fr_FR.qm.old1 | Bin 224921 -> 0 bytes lang/fr_FR.ts.old | 11006 ------------------------------------------- 3 files changed, 11006 deletions(-) delete mode 100755 lang/fr_FR.qm.old delete mode 100755 lang/fr_FR.qm.old1 delete mode 100755 lang/fr_FR.ts.old diff --git a/lang/fr_FR.qm.old b/lang/fr_FR.qm.old deleted file mode 100755 index 22f2cc7d1b87298eddac1a53ff1dfb9a1b96b13a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 246373 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 z zA+HfQ!jq`jc)2p5F~Nd!Ft+@`)t zHSQ_{Ae_j?X>g_SjGyp%^c46ld!|T?{aY{ZP(?GkLbM?OcH{tZ07Cl?$Z2=b7N=YT zZt+8n=a*u+@N2P5;hP!71EHueNVbj!8n=|~p#?gs{6;d#ayuA%Ph>Vp0_uzeCu1ck zR6JJlLH41I4D>oRVAm@kXYaN!IpS7Of0k2EZNiav*zl}=Y{d6f9muwvRq2z6%uVs? z=+2c;B?roL(iszl9s7;;zPhcd6Hno+v=GsK=TCBap@FT-A@&*y+NzZFd8JNF#wMYQrJeqK<8pJuxaEGZ0O<(L&rvoIPt9DN^{d{kVX~E# z@TP_{RtP}YgJY|sZscQdNrj;TKn1Yp*}|nIfcx1uFfA4X8dOO)P(Iti^$ds?@?Hg* z(ugtQ>rGEEN~%SA^ysa`({r#~GO0UxT16Rh;6NnqVFyNt+}NF-ZghDiJqO*uv}~E4 z%%C5Axc;w%xnQIik;2Q@&MCXBys^c-vL({5x3%le^yB0F-eB! zWwb3{n8G70w^VGZ@tUUFNL!7(F47J*IHz4T;;XWOc%>tWgU+Py9FjiuY0#!W8C!9K zUWAaG{xl=+>?n4%->a>UN6uiMPulw8fcO~%RSHF3@D2senoDr!eob)#G#wjw-0Go! zXP)?!hDLp5=lD(;yFkik0<))p;}2D~6cQL8d>Uy`_ruHj{C>@4O#&oJ+r6>(Yzw>s zEg*JV`l#Ka!m4Xep>hHqi&AT(@0Di-mDsw!{fe9lpe zf3@64v_E^P975t}X>nMK7(LgA5#4ElQbI(UD^O{t^#P&QEohC5#Mwim?jFMYglnyzJl~3n&J`Se=TWB+aOF5RqWWmcV$WGy|%8+Z%EHe#vO1b1m7ZoUat1(z@t z&UR{x0V`6=o9&llsd6Z{4pf4{*-gO!FxF58ZXgd2-7U2v%!JJKu+==4`9>{IaaM)} zWOiCOF|k(7nBEU_Mr%xoH>onr!Z-OO)y+a;F6;pMa#M2rzBP`IxH4s=Z~yGc5!fVLGPy(^ORd~!nx_9i?S#J zp8yX}s{t(>ka6Ac(|22JXd4|nA|I^4Czk!f_ThBqYydyKoXuU4AX7dFkO=YhDlw$+ z<4P{2LNi&}TH27rkUUfBx+foTU^1DzEo|foS9g#&vkVIQq!}NiMi+9NC%~kf61$<} zGBgFoWa4xMaOYtoSp_(P^k28ege$-sy(=3UB>fhKYQf#;P==WW6+qmuGeN13%2ua9 zaOuwwrtXHEUWf0o-H$GF3HR^QOFh%}>dK-k|fc( zlbmEEZS)+|$nR>)quR&bnq#|e%=m*gvZ?kpzP++TvI26Y9pK>_p30&h_ZhM{vbE*K z#CnT(#2Uj+`Nl(IauJ@v9s2ZDr%+HHq33tNNJgYJ)6u~c_9?S6+svP}}@mjt&9 z+rKE&@|Nx3n!&U>3jER-CUV;nS`&nrPnFIucy8$lI=fR0+fJ-J;wejOzY&x?pdQb_ zq8z1z)pM(M)<$Il0d#2=1_)Dqps4A^dM9)QGbv6aCz=AjQzqr(_lG~d)#~Tf{7VaK ze`zuy)l?`e=q5<|`(yu$9492j7AY>3=6YYtV>rLn=zYE3?d($^3=n4(Ooj82DpQD{ zZouQIwoR$p9IsZ+v3Pu2ol-jfci4XEvqnp-AbqSWURcy??dNuo)MmzEf1yO2G(Q1Y0lTVE|0QL%GGsxN~A}p~6Q+&yPBFx09RwBZEdny~xOEPywQe z^K&>DonG!klh`3Wh>ZIfw72X@FCrhAynlxFJKmr45pwIivMH|itPc>XXDP8HO(EsM zCkgn(=b5LkThIWzAPeXL9&(oz4HH98l4rUdzHpRUf+=PiZ)zI0zp#nr>p(kk9Bb&4&w;nT~jn@by8iLFi-Mcn}2LWxUG+GZ9G_AKwFH&=4+}eL{MZ3Yq;(kZjIAk4~UGR?6-

GO^i6pn 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 Z9V*Zy(eD0AfOb`o{QE$y7hXK^{{jmTS~CCu diff --git a/lang/fr_FR.qm.old1 b/lang/fr_FR.qm.old1 deleted file mode 100755 index 7b1f0ecfd4496306b88ed58dc09713d7396eb7e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 224921 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 diff --git a/lang/fr_FR.ts.old b/lang/fr_FR.ts.old deleted file mode 100755 index c10f2c124d..0000000000 --- a/lang/fr_FR.ts.old +++ /dev/null @@ -1,11006 +0,0 @@ - - - - - AboutWidget - - About pgModeler - À propos de pgModeler - - - PostgreSQL Database Modeler - PostgreSQL Database Modeler - - - Open source data modeling tool designed for PostgreSQL. No more DDL commands written by hand, let pgModeler do the job for you! This software reunites the concepts of entity-relationship diagrams and the features that PostgreSQL implements as extensions of SQL standards. - Outil de modéliation entité-association pour PostgreSQL. Plus aucun ordre LDD à saisir à la main, laissez PgModeler le faire pour vous ! Ce logiciel fusionne le concept de modélisation entité-association et toutes les fonctionnalités étendues que propose PostgreSQL en plus des standards SQL. - - - Design, configure, deploy - Concevoir, configurer, déployer - - - <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" font-size:11pt; font-style:italic; text-decoration: underline; color:#0057ae;">http://pgmodeler.com.br</span></a></p></body></html> - <html><head/><body><p><a href="http://pgmodeler.com.br"><span style=" font-size:11pt; font-style:italic; text-decoration: underline; color:#0057ae;">http://pgmodeler.com.br</span></a></p></body></html> - - - pgModeler is proudly a brazilian software! - pgModeler est un logiciel brésilien et fier de l'être! - - - <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - - - Contributors - Contributeurs - - - <html><head/><body><p>This page is dedicated to all contributors who gave a bit of their time in make pgModeler a better software somehow. The complete list of people that helped pgModeler can be found at <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>If you have a great idea to improve pgModeler please submit it <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">here</span></a>. No ideas for now but want to help? Why not donate a few bucks <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">here</span></a>!?</p></body></html> - <html><head/><body><p>Cette page est dédiée à tous les contributeurs qui ont donné un peu de leur temps afin de rendre ce logiciel meilleur d'une manière ou d'une autre. La liste complète des personnes est disponible sur <a href="https://github.com/pgmodeler/pgmodeler/graphs/contributors"><span style=" text-decoration: underline; color:#00a489;">GitHub</span></a>.</p><p>Si vous avez une idée géniable afin d'améliorer pgModeler n'hésitez pas à la soumettre <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#00a489;">ici</span></a>. Vous n'avez pas d'idée mais vous voulez aider ? Pourquoi ne pas un don <a href="http://pgmodeler.com.br/#donate"><span style=" text-decoration: underline; color:#00a489;">ici</span></a> !?</p></body></html> - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 4 - 4 - - - 5 - 5 - - - 6 - 6 - - - Name - Nom - - - Country - Pays - - - Contribution - Contribution - - - Damien Degois - Damien Degois - - - France - France - - - French UI translation and several improvements in auxiliary scripts. - Francisation IHM et amélioration de scripts. - - - Ji Bin - Ji Bin - - - China - Chine - - - Chinese UI translation and small fixes. - Traduction en lagnue chinoise et quelques corrections. - - - Pierre-Samuel LE STANG - Pierre-Samuel LE STANG - - - French UI translation. - Francisation IHM. - - - Lisandro Damián Nicanor - Lisandro Damián Nicanor - - - Argentina - Argentine - - - Russia - Russie - - - N/A - Inconnu - - - Hide this widget - Cacher ce widget - - - ... - ... - - - 0.0.0.0 - 0.0.0.0 - - - License - Licence - - - Build: - Build: - - - (CODE_NAME) - - - - (BUILD_NUM) - - - - Improvements on build scripts enabling the custom packaging in Linux distros; Per-user settings; pgModeler's package maintainer in Debian Linux. - - - - Pavel Alexeev - - - - Additional work for packaging in Linux distros; pgModeler's package maintainer in Fedora Linux. - - - - Mariusz Fik - - - - Poland - - - - Custom packaging first ideas. Tester of first version of custom packaging patch. - - - - <a href="http://pgmodeler.com.br">http://pgmodeler.com.br</a> - - - - <html><head/><body><p>Copyright 2006-2016 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> - <html><head/><body><p>Copyright 2006-2015 - Raphael Araújo e Silva &lt;<a href="mailto:raphael@pgmodeler.com.br"><span style=" text-decoration: underline; color:#0057ae;">raphael@pgmodeler.com.br</span></a>&gt;</p></body></html> {2006-2016 ?} {0057a?} - - - 7 - 7 - - - 8 - 8 - - - Jonathan DUPRE - - - - Gilberto Castillo - - - - Cuba - - - - Spanish UI translation. - - - - - AggregateWidget - - Form - Formulaire - - - Final Function: - Fonction finale: - - - Sort Operator: - Opérateur de tri: - - - Initial Condition: - Condition initiale: - - - Funtion Inputs - Entrées de la fonction - - - Function State - État de la fonction - - - Transition Func.: - Fonction de transition: - - - Input Data Type - Type de donnée en entrée - - - State Data Type - Type de donnée d'état - - - An aggregate function that accepts the types <em><strong>typeA</strong></em> and <em><strong>typeB</strong></em> as input types and which type of state is <em><strong>state_type</strong></em>, must obey the following rules: <br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Final Function:</strong> <em>void final_function(<strong>state_type</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Transition Function:</strong> <em><strong>state_type</strong> transition_function(<strong>state_type</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> - Une fonction d'agrégation qui accepte les types <em><strong>typeA</strong></em> et <em><strong>typeB</strong></em> comme types d'entrées et dont le type d'état est <em><strong>type_etat</strong></em>, doit obéir aux règles suivantes:<br/><br/> <strong> &nbsp;&nbsp;&nbsp;• Fonction Finale:</strong> <em>void fonction_finale(<strong>type_etat</strong>)</em><br/> <strong> &nbsp;&nbsp;&nbsp;• Fonction de Transition,:</strong> <em><strong>type_etat</strong> fonction_transition(<strong>type_etat</strong>, <strong>typeA</strong>, <strong>typeB</strong>)</em> - - - - AppearanceConfigWidget - - Form - Formulaire - - - Element: - Élement: - - - Global: Font style - Global: Style de police - - - Global: Constraints descriptor - Global: Marqueurs de contraintes - - - Global: Object selection - Global: Selection d'objet - - - Global: Position hint text - Global: Texte de la boite de coordonées - - - Global: Position hint box - Global: Fond de la boite de coordonées - - - Global: Objects type - Global: Type de colonne - - - Global: Lock arc - Global: Cadenas (objet vérouillé, couleur de l'arceau) - - - Global: Lock body - Global: Cadenas (objet vérouillé, couleur du corps) - - - Table: Schema name - Table: Nom du schema - - - Table: Table name - Table: Nom de la table - - - Table: Columns box - Table: Zone des colonnes - - - Table: Extended attributes box - Table: Zone d'attributs étendus - - - Table: Title box - Table: Zone de titre - - - Rule: Name - Règle: Nom - - - Rule: Descriptor - Règle: Couleur de l'icône - - - Index: Name - Index: Nom - - - Index: Descriptor - Index: Couleur de l'icône - - - Trigger: Name - Déclencheur: Nom - - - Trigger: Descriptor - Déclencheur: Couleur de l'icône - - - View: Schema name - Vue: Nom du schema - - - View: View name - Vue: Nom de la vue - - - View: References box - Vue: Couleur d'arriere plan - - - View: Extended attributes box - Vue: Dialogue des attributs étendus - - - View: Title box - Vue: Couleur d'arriere plan de la barre de titre - - - View: Table / columns alias - Vue: Alias de table / colonne - - - View: Referenced column - Vue: Colonne référencée - - - View: Referenced table - Vue: Table référencée - - - View: Reference descriptor - Vue: Couleur de l'icône des références - - - Textbox: Body - Zone de texte: Corps - - - Column: Column name - Colonne: Nom de la colonne - - - Column: Descriptor - Colonne: Couleur de l'icône - - - Column: Included / Inherited by relationship - Colonne: Incluses / Héritées par associations - - - Column: Protected - Colonne: Protégée - - - Column (pk): Column name - Colonne (pk): Nom de la colonne - - - Column (pk): Descriptor - Colonne (pk): Couleur de l'icône - - - Column (fk): Column name - Colonne (fk): Nom de la colonne - - - Column (fk): Descriptor - Colonne (fk): Couleur de l'icône - - - Column (uq): Column name - Colonne (uq): Nom de la colonne - - - Column (uq): Descriptor - Colonne (uq): Couleur de l'icône - - - Column (nn): Column name - Colonne (nn): Nom de la colonne - - - Column (nn): Descriptor - Colnne (nn): Couleur de l'icône - - - Relationship: Descriptor - Associations: Couleur de l'icône - - - Relationship: Label text - Associations: Texte de l'étiquette - - - Relationship: Label box - Relations: Arrière plan de l'étiquette - - - Relationship: Attribute text - Relations: Texte des attributs - - - Relationship: Attribute descriptor - Relations: Couleur de l'icône des attributs - - - Tag: Name - Nom - - - Tag: Body - Corps - - - Font: - Police: - - - pt - pt - - - Bold - Gras - - - Italic - Italique - - - Colors: - Couleur: - - - Underline - Souligné - - - Placeholder: Body - - - - - Application - - Unknown exception caught! - Exception inconnue générée! - - - Failed to create initial configuration in `%1'! Check if the current user has write permission over that path and at least read permission over `%2'. - Impossible de créer les fichiers de configuration initiale dans `%1'! Vérifiez si vous avez la permission d'écriture dans ce dossier. Vérifiez l'existence et d'avoir les droits en lecture sur le dossier `%2'. - - - - BaseForm - - Dialog - Dialogue - - - &Apply - &Appliquer - - - &Cancel - A&nnuler - - - &Ok - &Ok - - - %1 properties - - - - - BaseObject - - Column - Colonne - - - Constraint - Contrainte - - - Function - Fonction - - - Trigger - Déclencheur - - - Index - Index - - - Rule - Règle - - - Table - Table - - - View - Vue - - - Domain - Domaine - - - Schema - Schéma - - - Aggregate - Fonction d'agrégat - - - Operator - Opérateur - - - Sequence - Séquence - - - Role - Rôle - - - Conversion - Convertion - - - Cast - Convertion de type - - - Language - Langage - - - Type - Type - - - Operator Family - Famille d'opérateurs - - - Operator Class - Classe d'opérateurs - - - Database - Base de données - - - Extension - Extension - - - Relationship - Relation - - - Collation - Collation - - - Textbox - Zone de texte - - - Event Trigger - Déclencheur sur évènement - - - Permission - Permission - - - Parameter - Paramètre - - - Type Attribute - Attribut de type - - - Basic Relationship - Relation simple - - - Tag - Tag - - - new_object - IMPOSSIBLE ! PROBLEME AU LANCEMENT SI %N EST PRESENT - - nouvel_objet - nouveaux_objets - - - - Tablespace - Intuitif - Tablespace - - - - BaseObjectView - - SQL off - SQL désactivé - - - - BaseObjectWidget - - Form - Formulaire - - - Name: - Nom: - - - ID: - Identifiant: - - - icone - icône - - - Comment: - Commentaire: - - - Tablespace: - Tablespace: - - - Edit object's permissions - Editer les permissions de l'objet - - - Disables the generated SQL code using comment tokens (--). -This will disable the code of all child and referrer objects. - Désactivez le SQL généré en utilisant les marqueurs de commentaire (--). -Ceci désactivera le SQL pour les objets enfants dont cet objet est le parent. - - - Append or prepend a set of SQL commands to the object's definition. - Doutes - Ajouter des commandes SQL avant ou après la définition de cet objet. - - - Custom SQL - Code SQL Libre - - - Owner: - Propriétaire: - - - Schema: - Schéma: - - - Disable SQL code - Désactiver le code SQL - - - Collation: - Collation: - - - Edit permissions - Editer les permissions - - - This object is protected thus no change in form will be applied to it. - L'objet est vérouillé, par conséquent aucun changement dans le formulaire ne lui sera appliqué. - - - Create / Edit: - Créer / Éditer: - - - Required field. Leaving this empty will raise errors! - Champ requis. Laisser ce champ vide génèrera une erreur! - - - Value(s) - Valeur(s) - - - Version - Version - - - The <em style='color: %1'><strong>highlighted</strong></em> fields on the form are available only on specific PostgreSQL versions. When generating SQL code for versions other than those specified on fields' tooltips pgModeler will ignore their values. - Les champs en <em style='color: %1'><strong>surbrillance</strong></em> dans le formulaire sont disponibles pour certaines versions de PostgreSQL uniquement. Ils seront ignorés s'il est demandé un export SQL pour une version de PostgreSQL non spécifiée dans l'infobulle du champ. - - - The <em style='color: %1'><strong>highlighted</strong></em> fields in the form or one of their values are available only on specific PostgreSQL versions. Generating SQL code for versions other than those specified in the fields' tooltips may create incompatible code. - - - - - BaseRelationship - - rel_%1_%2 - rel_%1_%2 - - - - BugReportForm - - Bug Report - Signaler un bug - - - Bug report - Signaler un bug - - - Create - Créer - - - &Cancel - A&nnuler - - - Use the form below to generate a complete bug report. Please, try to be as clear as possible when describing the actions that can reproduce the bug. Additionally, it's important to attach a sample database model so that the bug can be quickly discovered and fixed! - Utilisez le formulaire ci-dessous pour générer un rapport d'erreur complet. Merci d'être le plus clair possible dans la description de vos actions afin que le bug puisse être reproduit. De plus, il est important de joindre un modèle de base dans lequel le bug puisse être rapidement découvert, et par la même occasion rapidement corrigé ! - - - Report - Rapport - - - Issue details - Détails du problème - - - Output: - Sortie : - - - Select the report's output folder - Sélectionnez un dossier de sortie pour écrire le rapport d'erreur - - - ... - ... - - - <html><head/><body><p>If you prefer it's possible to report this issue anytime on pgModeler's project repository at <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#0057ae;">GitHub</span></a>. </p></body></html> - <html><head/><body><p>Il vous est également possible de signaler un bug à tout moment via le dépôt du projet pgModeler sur <a href="http://github.com/pgmodeler/pgmodeler/issues"><span style=" text-decoration: underline; color:#0057ae;">GitHub</span></a>. </p></body></html> - - - Database Model - Modèle de base - - - In none occasion the models sent within the report will be published. They are kept safe and are used only for debug purpose. - Les modèles de base de données joints avec les rapports d'erreur NE SONT EN AUCUN CAS publiés. Ils ne sont utilisés qu'à des fins de debogage. - - - Attach the below database model file to be debugged. - Joindre le fichier modèle ci-dessous pour débogage. - - - Attach a different database model - Joindre un autre modèle de base - - - Bug report successfuly generated! Please, send the file <strong>%1</strong> to <em>%2</em> in order be analyzed. Thank you for the collaboration! - Le rapport de bug a été généré avec succès ! S'il vous plait, veuillez envoyer le fichier <strong>%1</strong> à <em>%2</em> pour expertise. Merci de votre collaboration ! - - - Load model - Sélectionner un modèle - - - Database model (*.dbm);;All files (*.*) - Modèle de base de données (*.dbm);; Tous les fichiers (*.*) - - - Select report output folder - Sélection du dossier de sortie - - - - CastWidget - - Form - Formulaire - - - Conversion Func.: - Fonction de conversion: - - - Cast Type: - Conversion de type: - - - Explicit - Explicite - - - Implicit - Implicite - - - Assignment - Affectation - - - Input / Output - Entrée / Sortie - - - Source data type - Type de donnée source - - - Target data type - Type de donnée cible - - - The function to be assigned to a cast from <em><strong>typeA</strong></em> to <em><strong>typeB</strong></em> must have the following signature: <em><strong>typeB</strong> function(<strong>typeA</strong>, integer, boolean)</em>. - La fonction à affecter à une convertion de <em><strong>typeA</strong></em> vers <em><strong>typeB</strong></em> doit avoir la signature suivante: <em><strong>typeB</strong> fonction(<strong>typeA</strong>, integer, boolean)</em>. - - - I&mplicit - - - - E&xplicit - - - - - Catalog - - Object type: %1 - ? - - Type d'objet: %1 - Types d'objets: %1 - - - - - CentralWidget - - Form - Formulaire - - - New model - Nouveau modèle - - - Open model - Ouvrir modèle - - - Sample models - Modèles de démo - - - Recent models - Modèles récents - - - Last session - Dernière session - - - - CodeCompletionWidget - - Make persistent - Rentre persistant - - - Makes the widget closable only by ESC key or mouse click on other controls. - Rendre ce widget refermable uniquement par la touche Échap ou par un clic sur les autres contrôles. - - - SQL Keyword - Mot-clé SQL - - - (no items found.) - (aucun élément trouvé.) - - - - CollationWidget - - Form - Formulaire - - - Locale: - Locale: - - - Encoding: - Encodage: - - - LC_COLLATE: - LC_COLLATE: - - - LC_CTYPE: - LC_CTYPE: - - - The fields <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong>, <strong><em>LC_COLLATE & LC_CTYPE</em></strong> are mutually exclusive, so you have to set only one of them in order to properly handle a collation. - Les champs <strong><em>Collation</em></strong>, <strong><em>Locale</em></strong> et <strong><em>LC_COLLATE & LC_CTYPE</em></strong> sont mutuellement exclusifs, vous ne devez en définir qu'un de manière à gérer correctement la collation. - - - Not defined - Non défini - - - - ColorPickerWidget - - Form - Formulaire - - - Generate random color(s) - Génération aléatoire de couleur(s) - - - Alt+R - Alt+R - - - Select color - Sélectionner une couleur - - - - ColumnWidget - - Form - Formulaire - - - Default Value: - Valeur par défaut: - - - Expression: - Expression: - - - NOT NULL - Non-Null - - - Sequence: - Séquence: - - - E&xpression: - - - - &NOT NULL - - - - Se&quence: - - - - - ConfigurationForm - - pgModeler Configuration - Paramètres de pgModeler - - - Relationships - Associations - - - Appearance - Apparence - - - Connections - Connexions - - - Snippets - Snippets - - - &Apply - &Appliquer - - - &Cancel - A&nnuler - - - Defaults - Défauts - - - General - Général - - - Plug-ins - Extensions - - - Any modification made until now in the current section will be lost! Do you really want to restore default settings? - Toutes les modifications réalisées jusqu'à présent dans la section actuelle seront perdues! Souhaitez vous réellement restaurer les paramètres par défaut? - - - - Connection - - ERROR: trying to open an already stablished connection. - ERREUR: impossible de démarrer une connection déjà établie. - - - - ConnectionsConfigWidget - - Form - Formulaire - - - Connections: - Connexions: - - - Create new connection - Créer une nouvelle connexion - - - Cancel edition - Annuler l'édition - - - Duplicate the selected connection - Dupliquer la connexion sélectionnée - - - Edit selected connection - Editer la connexion sélectionnée - - - Delete selected connection - Supprimer la connexion sélectionnée - - - Connection Alias: - Alias de la connexion: - - - Connection DB: - Nom de la base: - - - Host/Port: - Hôte/Port: - - - User: - Utilisateur: - - - Password: - Mot de passe: - - - Timeout: - Délai d'expiration: - - - second(s) - seconde(s) - - - SSL Mode: - Mode SSL: - - - Disable - Désactivé - - - Allow - Autorisé - - - Require - Requis - - - AC verification - Vérification des AC - - - Full verification - Vérification complète - - - Client Certificate: - Certificat Client: - - - ~/.postgresql/postgresql.crt - ~/.postgresql/postgresql.crt - - - Automatically browses the named database when using this connection to manage databases on <strong>Manage</strong> view. - Parcourir et afficher automatiquement le contenu de la base de données indiquée ci-contre lors de l'utilisation de cette connexion dans le <strong>Manager</strong>. - - - Auto browse - Toujours montrer - - - Client Key: - Clef client: - - - ~/.postgresql/postgresql.key - ~/.postgresql/postgresql.key - - - Root Certificate: - Certificat racine: - - - ~/.postgresql/root.crt - ~/.postgresql/root.crt - - - Revoked Certs.: - Liste de révocations: - - - ~/.postgresql/root.crl - ~/.postgresql/root.crl - - - Kerberus Server: - Serveur Kerberos: - - - Force GSSAPI - Forcer GSSAPI - - - Options: - Options: - - - Add - Ajouter - - - Update - Mettre à jour - - - Test - Tester - - - Success - Succès - - - Connection successfuly stablished! - -Server details: - -PID: `%1' -Protocol: `%2' -Version: `%3' - Connexion établie avec succès! - -Détails du serveur : - -PID: `%1' -Protocole: `%2' -Version: `%3' - - - There is an unsaved connection! Want to save it? - Le paramétrage de la connexion n'a pas été sauvegardé! Voulez-vous enregistrer les changements? - - - Edit database connections - - - - General - Général - - - Other params: - - - - Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. - - - - Default for: - - - - Diff - Différencier - - - Export - Exporter - - - Import - Importer - - - Validation - - - - Security - - - - Kerberos Server: - - - - Indicates in which operations (diff, export, import or validation) the connection is used if none is explicitly specified by the user. - - - - There is a connection being created or edited! Do you want to save it? - - - - Found %1 connection(s) - - - - No connections found - - - - Edit connections - - - - - ConstraintWidget - - Form - Formulaire - - - Constraint Type: - Type de contrainte: - - - Fill Factor: - Taux de remplissage: - - - Match: - Comparaison: - - - This attribute cannot be changed once the object is created. - Cet attribut ne peut pas être modifié une fois l'objet créé. - - - Expression: - Expression: - - - Deferrable: - Différable: - - - Deferral: - Report: - - - ON DELETE: - ON DELETE: - - - ON UPDATE: - ON UPDATE: - - - Columns - Colonnes - - - Column: - Colonne: - - - Referenced Columns - Colonnes référencées - - - Table: - Table: - - - Indexing: - Indexation: - - - Exclude Elements - Élements exclus - - - No inherit: - Pas d'héritage: - - - Column - Colonne - - - Type - Type - - - Columns which were included by relationship can not be added / removed manually from the primary key. If done such changes they can raise errors. To create primary key using columns included by relationship use the following options: identifier field, attributes & constraints tab or primary key tab on the relationship form. - Les colonnes inclues dans la relation de peuvent être ajoutées/retirés manuellement de la clef primaire sous peine d’erreur. Pour créer une clef primaire utilisant des colonnes contenues dans une relation, veuillez utiliser une des options suivantes: champ identifiant, l'onglet attributs et contraintes ou l'onglet clef primaire du formulaire de la relation. - - - - ConversionWidget - - Form - Formulaire - - - Source Encoding: - Encodage de la source: - - - Target Encoding: - Encodage de la destination: - - - Conversion Func.: - Fonction de conversion: - - - Default Conversion: - Convertion par défaut: - - - The function to be assigned to an encoding conversion must have the following signature: <em>void function(integer, integer, cstring, internal, integer)</em>. - La fonction à affecter à une convertion d'encodage doit avoir la signature suivante: <em>void function(integer, integer, cstring, internal, integer)</em>. - - - - CrashHandlerForm - - Crash Handler - Gestionnaire d'incident - - - Stack trace - Piles d'exécution - - - Input: - Entrée: - - - Load report file for analysis - Ouvrir un rapport d'erreur pour analyse - - - Save the attached model file on the filesystem - Sauvegarder le modèle joint sur le système de fichiers - - - pgModeler bug report (*.bug);;All files (*.*) - Rapport de bug pgModeler (*.bug);;Tous les fichiers (*.*) - - - Load report - Ouvrir un rapport d'erreur - - - Save model - Enregistrer le modèle - - - Database model (*.dbm);;All files (*.*) - Modèle de base de données (*.dbm);; Tous les fichiers (*.*) - - - Crash handler - Gestionnaire d'incident - - - Bug report analysis mode activated. - Mode d'analyse de rapport d'erreur activé. - - - Oops! pgModeler just crashed! - Oh oh! pgModeler s'est planté ! - - - We apologize for what happened! It is clear that a nasty bug caused that. Please fill out the form below describing your actions before pgModeler quit unexpectedly. This will help on bug extermination and improve the software. - Nous vous prions de nous excuser pour ce qui vient de se passer ! Il est clair qu'un vilain bug soit à l'origine de tout cela. Veuillez renseigner le formulaire ci-dessous en décrivant les actions qui vous avez faites avant que pgModeler ne sombre de manière inopinée. Ceci nous aidera à exterminer ce bug et ainsi améliorer le logiciel. - - - - CustomSQLWidget - - Form - Formulaire - - - SQL code - Code SQL - - - Puts an SELECT command template at current cursor position. - Insère une commande SELECT à la position courante du curseur. - - - &SELECT - &SELECT - - - Puts an INSERT command template at current cursor position. - Insère une commande INSERT à la position courante du curseur. - - - &INSERT - &INSERT - - - Puts an UPDATE command template at current cursor position. - Insère une commande UPDATE à la position courante du curseur. - - - Puts an DELETE command template at current cursor position. - Insère une commande DELETE à la position courante du curseur. - - - &DELETE - &DELETE - - - &Clear - E&ffacer - - - Append SQL - Code SQL suffixé - - - Append the SQL code at the very end of model definition. -Unchecking this will cause the SQL to be appended at the end of CREATE DATABASE command. - Ajouter le code SQL à la toute fin de la définition du modèle -Sinon (décoché) pgModeler ajoutera ce code après la commande SQL CREATE DATABASE. - - - Append at end of model definition. - Suffixer à la fin de la définition du modèle. - - - Prepend SQL - Code SQL préfixé - - - Prepend at beginning of model definition. - Préfixer au tout début de la définition du modèle. - - - <html><head/><body><p>Use custom commands with extreme caution because you can change the semantics of the entire model when running SQL validation or export processes. Additionally, depending on the amount of commands, those processes can have their performance sensibly degradated.</p></body></html> - <html><head/><body><p>Utilisez cet espace pour y inscrire vos commandes SQL personnalisées avec précaution. Vous pourriez créer des incohérences qui peuvent interférer avec les fonctionnalités de validation et d'export du modèle. De plus, selon la nature des commandes entrées ces fonctionnalités peuvent être ralenties.</p></body></html> - - - Append / Prepend SQL code - Code SQL préfixé/suffixé - - - Type: - Type: - - - Generic INSERT - INSERT générique - - - Include serial columns - Inclure les colonnes de type "serial" - - - Exclude serial columns - Exclure les colonnes de type "serial" - - - Generic SELECT - SELECT générique - - - Table SELECT - Table SELECT - - - Generic UPDATE - UPDATE générique - - - Table UPDATE - Table UPDATE - - - Generic DELETE - DELETE générique - - - Table DELETE - Table DELETE - - - &UPDATE - &UPDATE - - - Add custom SQL code - - - - - DataManipulationForm - - Data Manipulation - Édition des données - - - &Close - &Fermer - - - Rows returned: - Lignes retournées: - - - 0 - 0 - - - Maximum limit of listed rows - Nombre maximum de lignes en retour de résulat - - - (Limit: 0) - (Limit: 0) - - - Empty values are assumed as <strong>DEFAULT</strong>. To use special values like <strong>NULL</strong>, a function call like <strong>now()</strong> or a specific data escaping, enclose values in <strong>&lt;&gt;</strong>. To use <strong>&lt;</strong> or <strong>&gt;</strong> as part of the value prepend the backslash character, e.g., <strong>\&lt;</strong> or <strong>\&gt;</strong>. - Les valeurs vides sont affichées en tant que <strong>DEFAULT</strong>. Pour utiliser les valeurs spéciales telles que <strong>NULL</strong>, un appel à une fonction comme <strong>now()</strong> ou toute autre fonction d'échappement spécifique, entourez ces valeurs/fonctions avec <strong>&lt;&gt;</strong>. Pour utiliser <strong>&lt;</strong> ou <strong>&gt;</strong> en tant que caractères à part entière, protégez-les avec un antislash : <strong>\&lt;</strong> ou <strong>\&gt;</strong>. - - - Refresh listing - Actualiser la liste - - - Refresh - Actualiser - - - F5 - F5 - - - Save changes - Enregistrer les changements - - - Save - Enregistrer - - - Ctrl+S - Ctrl+S - - - Copy the selection as CSV buffer - Copier la sélection avec un formatage de type CSV - - - Copy - Copier - - - Ctrl+C - Ctrl+C - - - Export results to CSV file - Exporter les résultats vers un fichier CSV - - - Export - Exporter - - - Ctrl+X - Ctrl+X - - - Undo modifications - Annuler les modifications - - - Undo - Annuler - - - Ctrl+Z - Ctrl+Z - - - Add data - Ajouter une ligne - - - Add - Ajouter - - - Ins - Ins - - - Mark the selected rows to be deleted - Marquer les lignes sélectionner pour suppression - - - Delete - Supprimer - - - Del - Suppr - - - Filter the result set - Filtrer les résultats - - - Table: - Table: - - - Schema: - Schéma: - - - in - dans - - - Hide views - Masquer les vues - - - Filter expression - Expression pour filtrer - - - Order && Limit - Order && Limit - - - Column: - Colonne: - - - Limit in: - Limit : - - - 000000 - 000000 - - - 100 - 100 - - - results - lignes - - - Add Item - Ajouter un élément - - - Remove Item - Supprimer un élément - - - Clear the order by columns list - Effacer la liste - - - Move selected item up - Déplacer vers le haut - - - Move selected item down - Déplacer vers le bas - - - <em>(Limit: <strong>%1</strong>)</em> - <em>(Limit: <strong>%1</strong>)</em> - - - No objects found - Aucun objet trouvé - - - Found %1 object(s) - %1 objets trouvés - - - Views can't have their data handled through this grid, this way, all operations are disabled. - Les données des vues ne sont pas modifiables par le biais de cette grille de résultats, de ce fait, aucune opération de modification n'est permise. - - - The selected table doesn't owns a primary key! Updates and deletes will be performed by considering all columns as primary key. <strong>WARNING:</strong> those operations can affect more than one row. - La table sélectionnée ne comporte pas de clé primaire ! Les mises à jour et les suppressions seront réalisées en considérant que l'ensemble des colonnes constitue une clé primaire. <strong>ATTENTION:</strong> ces opérations peuvent affecter plus d'une ligne. - - - This row is marked to be %1 - Cette ligne est estampillée pour être %1 - - - deleted - supprimée - - - updated - mise à jour - - - inserted - insérée - - - [binary data] - [données binaires] - - - <strong>WARNING:</strong> Once commited its not possible to undo the changes! Proceed with saving? - <strong>ATTENTION:</strong> Une fois validés (Commit), il ne sera plus possible d'annuler les changements ! Sauvegarder les changements ? - - - update - update - - - insert - insert - - - ASC - Intuitif - ASC - - - DESC - Intuitif - DESC - - - delete - delete - - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> - - - - Add empty rows - - - - Duplicate the selected rows - - - - Duplicate - - - - Ctrl+D - - - - results (Use <strong>0</strong> for no limit) - - - - <strong>WARNING: </strong> There are some changed rows waiting the commit! Do you really want to discard them and retrieve the data now? - - - - Rows returned: <strong>%1</strong>&nbsp;&nbsp;&nbsp; - - - - none - - - - - DatabaseExplorerWidget - - Form - Formulaire - - - Toggles the display of system objects. - Basculer l'affichage des objets système. - - - Sys. objects - Objets syst. - - - Toggles the display of extension objects - Basculer l'affichage des objets issus des extensions - - - Ext. objects - Objets ext. - - - Open the grid to visualize or edit data. - Ouvre l'éditeur de données. - - - Data &Grid - &Grille des données - - - Alt+G - Alt+G - - - Open a new SQL execution pane. - Ouvre un nouvel onglet d'exécution SQL. - - - ... - ... - - - Ctrl+F5 - Ctrl+F5 - - - Update the objects tree. - Actualiser l'arbre des objets. - - - Expands all items - Ouvre tous les nœuds de l'arborescence - - - Collapses all items - Ferme tous les nœuds de l'arborescence - - - Filter: - Filtrer: - - - By OID - Par OID - - - Attribute - Attribut - - - Value - Valeur - - - Show raw attributes names - Afficher le nom réel des attributs - - - (not found, OID: %1) - (inconnu, OID: %1) - - - By value - Par valeur - - - Collatable - Collatable - - - Collation - Collation - - - Constraint - Contrainte - - - Default - Défaut - - - Definition - Définition - - - Dimension - Dimension - - - Element - Élement - - - Encrypted - Encrypté - - - Enumerations - Énumérations - - - Expression - Expression - - - Function - Fonction - - - Language - Langage - - - Length - Longueur - - - Library - Bibliothèque - - - Materialized - Matérialisée - - - Name - Nom - - - Permissions - Permissions - - - Precision - Précision - - - Preferred - Préféré - - - Schema - Schéma - - - Storage - Stockage - - - Superuser - Super utilisateur - - - Tablespace - Espace de stockage logique - - - Type - Type - - - Unlogged - Unlogged - - - Validity - Validité - - - Subtype - Sous-type - - - Arguments - Arguments - - - Table - Table - - - Columns - Colonnes - - - Event - Evènement - - - Unique - Unique - - - Snippets - Snippets - - - Drop object - Supprimer l'objet - - - Drop cascade - Supprimer en cascade - - - Truncate - Truncate - - - Trunc. cascade - Trunc. cascade - - - Show data - Afficher les données - - - Reload properties - Recharger les propriétés - - - Update - Mettre à jour - - - Do you really want to drop the object <strong>%1</strong> <em>(%2)</em>? - Voulez-vous vraiment supprimer l'objet <strong>%1</strong> <em>(%2)</em> ? - - - Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it? - Voulez-vous vraiment supprimer EN CASCADE l'objet <strong>%1</strong> <em>(%2)</em>? Cette action sera susceptible de supprimer en plus d'autres objets qui en dépendent. - - - Do you really want to truncate the table <strong>%1</strong>? - Voulez-vous vraiment vider la table <strong>%1</strong> ? - - - Do you really want to <strong>cascade</strong> truncate the table <strong>%1</strong>? This action will truncate all the tables that depends on it? - Voulez-vous vraiment vider EN CASCADE la table <strong>%1</strong> <em>(%2)</em>? Cette action sera susceptible de supprimer d'autres lignes dans les tables qui en dépendent. - - - Admin. roles - - - - Alignment - - - - Analyze func. - - - - Arg. count - - - - Arg. default count - - - - Arg. defaults - - - - Arg. modes - - - - Arg. names - - - - Arg. types - - - - Behavior type - - - - Cast type - - - - Category - - - - Comment - - - - Commutator Op. - - - - Configuration - - - - Conn. limit - - - - Create DB - - - - Create role - - - - Curr. version - - - - Default value - - - - Delimiter - - - - Dest. type - - - - Directory - - - - Dest. encoding - - - - Encoding - - - - Exec. cost - - - - Op. family - - - - Final func. - - - - Func. type - - - - Handler func. - - - - Handles type - - - - Hashes - - - - Index type - - - - Inherit - - - - Ini. condition - - - - Inline func. - - - - Input func. - - - - Internal length - - - - Interval type - - - - I/O cast - - - - Join func. - - - - LC COLLATE - - - - LC CTYPE - - - - Leak proof - - - - Left type - - - - Can login - - - - Member roles - - - - Merges - - - - Negator op. - - - - Not null - - - - Object type - - - - OID - - - - With OIDs - - - - Old version - - - - Operator - - - - Operator func. - - - - Output func. - - - - Owner - - - - Owner column - - - - Parents - - - - Password - - - - Range attributes - - - - Receive func. - - - - Ref. roles - - - - Replication - - - - Restriction func. - - - - Return type - - - - Returns SETOF - - - - Right type - - - - Rows amount - - - - Security type - - - - Send func. - - - - Sort op. - - - - Source type - - - - Src. encoding - - - - State type - - - - Type mod. in func. - - - - Type mod. out func. - - - - Transition func. - - - - Trusted - - - - Type attribute - - - - Types - - - - Validator func. - - - - Windows func. - - - - false - - - - true - - - - Cache value - - - - Cycle - - - - Increment - - - - Max. value - - - - Min. value - - - - Start value - - - - Last value - - - - Op. class - - - - Canonical func. - - - - Subtype diff func. - - - - Deferrable - - - - For each row - - - - Firing - - - - On insert - - - - On delete - - - - On update - - - - On truncate - - - - Trigger func. - - - - Condition - - - - Deferment - - - - Execution mode - - - - Commands - Commandes - - - Position - - - - Comparison type - - - - Ref. columns - - - - Expressions - - - - Fill factor - - - - No inherit - - - - Op. classes - - - - Operators - - - - Ref. table - - - - Predicate - - - - Collations - - - - Inherited - - - - System - - - - Extension - Extension - - - Open the grid to visualize or edit data - - - - Open a new SQL execution pane - - - - Ctrl+F6 - Ctrl+F6 - - - Update the objects tree - - - - Ctrl+S - Ctrl+S - - - Drop this database - - - - Filters the currently loaded items in the tree by using a pattern and matching their names. If <strong>By OID</strong> is checked the pattern is interpreted as an integer value that represents the object id (OID). <br><br/><strong>HINT:</strong> if you need to search the entire database use the full refresh (<strong>Ctrl+F5</strong>) prior the filtering. - - - - Show raw attributes - - - - -- Source code not generated! Hit F7 or middle-click the item to load it. -- - - - - Rename - Renommer - - - Source code - Code source - - - Quick refresh - - - - Full refresh - - - - Do you really want to <strong>cascade</strong> drop the object <strong>%1</strong> <em>(%2)</em>? This action will drop all the other objects that depends on it. - - - - Src. table: %1 -Src. column(s): %2 - - - - Ref. table: %1 -Ref. column(s): %2 - - - - -- Source code genaration for buil-in and base types currently unavailable -- - - - - -- Source code unavailable for the object %1 (%2). -- - - - - - DatabaseImportForm - - Database Import - Import d'une base de données - - - &Import - &Importer - - - &Close - &Fermer - - - Options - Options - - - Starting point where objects will be put. - Point d'origine à partir duquel les objets seront créés sur le schéma. - - - Spacing: - Espacement: - - - Enables the import of objects created by extensions. Generally there is no need to check this option but if there are objects in the database that directly references this category of objects this mode must be enabled. - Active l'importation des objets créés par les extensions. Généralement il n'y a pas lieu d'activer cette option sauf si des objets en base référencent directement ce type d'objet. - - - Import extension objects - Importer les objets des extensions - - - Connection: - Connexion: - - - Ignore import errors - Ignorer les erreurs - - - pgModeler ignores import errors and will try to create as many as possible objects. By checking this option the import operation will be not aborted but an incomplete model will be constructed. This option generates a log file on pgModeler's temp directory. - pgModeler ignorera les erreurs qui pourront survenir lors de l'importation et essayera de créer autant d'objets qui lui sera possible. En activant cette fonction le processus d'importation ne sera pas interrompu, toutefois vous pourrez vous retrouver avec un modèle incomplet. Cette option active la génération d'un fichier log dans le dossier temporaire de pgModeler. - - - Enables the import of system built-in objects. It's recommend to select only those objects that are directly referenced by the ones to be imported. WARNING: Try to import a huge set of system objects can bloat the resultant model or even crash pgModeler due to memory/cpu overuse. - Active l'importation des objets système. Il est recommandé d'utiliser ce mode uniquement lorsque le reste du modèle y fait directement référence (afin de conserver une intégrité). ATTENTION : Ceci va entrainer la création de beaucoup d'élements qui peuvent rendre difficile la lecture du schéma, voir même provoquer un plantage de pgModeler en cas de saturation mémoire ou CPU. - - - Import system objects - Importer les objets système - - - Automatically resolve dependencies - Résoudre automatiquement les dépendances - - - Resolve some of the object's dependencies by query the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types and extensions. - Résoudre certaines dépendances entre les objets en interrogeant le catalogue lorsqu'un objet n'existe pas dans la base à importer. Dans certains cas il vous sera nécessaire de combiner cette option avec celles ci-dessous. Cette option ne s'applique pas aux objets situés au niveau du cluster tels que les rôles, les tablespaces, les langues, les types de données ou encore les extentions. - - - Origin point: - Point d'origine: - - - Connect and list available databases - Connecter et lister les bases de données disponibles - - - ... - ... - - - Debug mode - Activer le mode debug - - - All catalog queries as well the created objects' source code are printed to standard outupt (stdout). - Toutes les requêtes effectuées sur le catalogue ainsi que le code source de tous les objets créés sera affiché sur la sortie standard (stdout). - - - Spacing between objects - Espacement inter-objets - - - Schemas per row - Nombre maximal de schémas pouvant être placés sur une seule ligne (en longueur) - - - Tables per row: - Tables sur une ligne: - - - Schemas per row: - Schémas sur une ligne: - - - Tables per row - Nombre maximal de tables pouvant être placées sur une seule ligne (en longueur) - - - Database import - Importation d'une base (Base existante vers modèle) - - - Settings - Paramètres - - - Random colors will be assigned to imported relationships facilitating the identification of links between tables mainly in large models. - Coloriser les associations de manière aléatoire afin de faciliter l'identification des liens entre les tables, cela peut être utile sur de grands modèles. - - - Random colors for relationships - Coloriser les associations de manière aléatoire - - - Database - Base de données - - - Select all objects - Tout cocher - - - Clear object selection - Tout décocher - - - Expands all items - Développer tous les éléments - - - Collapses all items - Replier tous les éléments - - - Filter: - Filtrer: - - - Filter object by it's OID - Filtrer un objet par son OID - - - By OID - Par OID - - - Output - Sortie - - - Progress label... - Indicateur de progression... - - - Cancel - Annuler - - - Retrieving objects from database... - Récupération des objets à partir de la base de données... - - - Importing process aborted! - Processus d'importation en erreur ! - - - Importing process canceled by user! - Processus d'importation interrompu par l'utilisateur ! - - - Importing process sucessfuly ended! - Processus d'importation terminé avec succès ! - - - No databases found - Aucune base de données trouvée - - - Found %1 database(s) - %1 base(s) de données trouvée(s) - - - Retrieving cluster level objects... - Récupération des objets du cluster... - - - Retrieving objects of schema `%1'... - Récupération des objets du schéma `%1'... - - - Retrieving objects of table `%1'... - Récupération des objets de la table `%1'... - - - This is a PostgreSQL built-in data type and cannot be imported. - Ce type de données est déjà intégré nativement dans PostgreSQL. Il ne peut être importé. - - - This is a pgModeler's built-in object. It will be ignored if checked by user. - Cet objet fait partie intégrante de pgModeler. Il sera ignoré même si vous le cochez. - - - Create all imported objects in the current working model instead of create a new one. - - - - Import objects to the working model - - - - <strong>ATTENTION:</strong> You are about to import objects to the current working model! This action will cause irreversible changes to it even in case of critical errors during the process. Do you want to proceed? - - - - Schemas per row - - - - Resolve some of the object's dependencies by querying the catalog when a needed object does not exists on the loaded set. In some cases it's necessary to combine this option with others below. This option does not applies to database level objects like role, tablespace and language as well for data types, extensions. - - - - All catalog queries as well the created objects' source code are printed to standard output (stdout). - - - - - DatabaseImportHelper - - Retrieving system objects... `%1' - Récupération des objets système... `%1' - - - Retrieving objects... `%1' - Récupération des objets... `%1' - - - Creating table inheritances... - Création des tables héritées... - - - Creating objects permissions... - Création des permissions... - - - Creating object `%1' (%2)... - Création de l'objet `%1' (%2)... - - - Trying to recreate object `%1' (%2)... - Tentative de recréation de l'objet `%1' (%2)... - - - Creating columns permissions... - Création des permissions sur les champs... - - - Update relationships of `%1' (%2)... - Mise à jour des associations de `%1' (%2)... - - - Destroying unused detached columns... - Suppression des colonnes détachées de la table parent (héritage)... - - - The database import ended but some errors were generated and saved into the log file `%1'. This file will last until pgModeler quit. - L'import de la base a échoué mais les erreurs rencontrées ont été sauvegardées dans le fichier journal `%1'. Ce fichier sera disponible jusqu'à la fermeture de pgModeler. - - - Import failed to recreate some objects in `%1' tries. - - - - Creating permissions for object `%1' (%2)... - - - - Updating relationships of `%1' (%2)... - - - - Validating relationships... - - - - Assigning sequences to columns... - - - - - DatabaseModel - - The demonstration version can create only `%1' instances of each object type! You've reach this limit for the type: `%2' - Cette version de démonstration peut créer seulement `%1' instances pour chaque type d'objet ! Cette limite a été atteinte pour les objets de type : `%2' - - - Loading: `%1' (%2) - Chargement: `%1' (%2) - - - Generating %1 of the object `%2' (%3) - Génération %1 de l'objet `%2' (%3) - - - Validating relationships... - - - - Saving object `%1' (%2) - - - - Saving metadata of the object `%1' (%2) - - - - Metadata file successfully saved! - - - - Process successfully ended but no metadata was saved! - - - - Creating object `%1' (%2) - - - - Object `%1' (%2) already exists. Ignoring. - - - - Loading metadata for object `%1' (%2) - - - - Object `%1' (%2) not found. Ignoring metadata. - - - - Metadata file successfully loaded! - - - - - DatabaseWidget - - Form - Formulaire - - - Attributes - Attributs - - - Template DB: - Modèle de BDD: - - - Model Author: - Auteur du modèle: - - - Encoding: - Encodage: - - - Default Objects - Attributs par défaut des objets - - - Tablespace: - Tablespace: - - - Schema: - Schéma: - - - Collation: - Collation: - - - Owner: - Propriétaire: - - - LC_COLLATE: - LC_COLLATE: - - - Connections: - Connexions: - - - LC_CTYPE: - LC_CTYPE: - - - The fields <strong>LC_COLLATE</strong> and <strong>LC_CTYPE</strong> have pre-configured values based upon the running system. You can freely modify those values if you intend to export the model to another host. - Les champs <strong>LC_COLLATE</strong> et <strong>LC_CTYPE</strong> ont déjà des valeur pré-configurées basées sur le système. Vous pouvez librement les modifier si vous deviez exporter le modèle pour une autre machine hôte. - - - Use the above fields to specify the default attributes assigned to new objects created on the database model. Leaving a field empty will cause PostgreSQL to use the default values when exporting the model. - Utilisez les champs ci-dessus pour spécifier les attributs par défaut à assigner aux futurs objets qui seront créés dans le modèle. Laisser ces champs vides fera en sorte que PostgreSQL utilise ses valeurs par défaut lors de l'exportation du modèle. - - - Default - Défaut - - - - DomainWidget - - Form - Formulaire - - - Constraint - Contrainte - - - Name: - Nom: - - - Not Null: - Non Null: - - - Check Expr.: - Expr. de vérif.: - - - Default Value: - Valeur par défaut: - - - - DonateWidget - - Form - Formulaire - - - Donate to pgModeler - - - - Hide this widget - - - - ... - ... - - - <html><head/><body><p>pgModeler is brought to you thanks to a <span style=" font-style:italic;">great effort to create and distribute a quality product</span>. This project is reaching out levels of maturity never imagined. All this is the result of a joint work between its author and the <span style=" font-weight:600;">Open Source community</span>. <br/><br/>This software has a long way to go yet and with your help we'll keep maintaining the good job and bringing new improvements on each release. If you did like pgModeler and thinks it deserves a contribution please make a donation!</p></body></html> - - - - I want to help! - - - - - ElementsWidget - - Form - Formulaire - - - Column: - Colonne: - - - Expression: - Expression: - - - Collation: - Collation: - - - Operator Class: - Classe d'opérateurs: - - - Operator: - Opérateur: - - - Sorting: - Tri: - - - Ascending - Ascendant - - - Descending - Descendant - - - Nulls first - Null en premier - - - Element - Élement - - - Type - Type - - - Operator Class - Classe d'opérateur - - - Sorting - Tri - - - Nulls First - Null en premier - - - Collation - Collation - - - Operator - Operateur - - - Expression - Expression - - - Yes - Oui - - - No - Non - - - - EventTriggerWidget - - Form - Formulaire - - - Event: - Evènement: - - - Function: - Fonction: - - - Filter - Filtrer - - - Tag: - Tag: - - - Tag command - Commande de déclenchement - - - - Exception - - Assignment of a pseudo-type to the type of the column! - Utilisation d'un pseudo-type comme type de la colonne! - - - Zero length assignment! - Affectation de longueur nulle! - - - Assignment of a precision greater than the length of the type! - Utilisation d'une précision est plus grande que la longueur du type! - - - Assignment of an invalid precision to type time, timestamp or interval. The precision in this case must be equal to or less than 6! - Utilisation d'une précision de type time, timestamp ou interval invalide. La précision de ces types doit être inférieure ou égale à 6! - - - Reference to a column which index is out of the capacity of the column list! - Référence à une colonne dont l'index dépasse la capacité de la liste des colonnes! - - - Assignment of not allocated object! - Indefini ? - Utilisation d'un objet non référencé! - - - Assigning object of an invalid type! - Assignation d'un objet dont le type est invalide! - - - Removing an object of an invalid type! - Suppression d'un objet dont le type est invalide! - - - Obtaining an object of an invalid type! - L'objet obtenu est de type invalide! - - - Assignment of empty name to table return type! - Affectation d'un nom vide au type retourné par la table! - - - Reference to an event which does not belongs to trigger! - Qui ne provient ? - Référence à un évènement qui n'appartient pas au déclencheur! - - - Assignment of a function which language is invalid! - Définition d'une fonction dont le langage est invalide! - - - Assignment of empty name to an object! - Affectation d'un nom vide à l'objet! - - - Assignment of schema object which type is invalid! - Affectation d'un schema dont le type est invalide! - - - Assignment of tablespace object with invalid type! - Utilisation d'un tablespace dont le type est invalide! - - - Assignment of tablespace to an invalid object! - Affectation d'un tablespace à un objet invalide! - - - Assignment of tablespace to a constraint which type is invalid! To belong to a tablespace the constraint must be a primary key or unique! - Affectation d'un tablespace à une contrainte dont le type est invalide! Pour appartenir à un tablespace une contrainte doit être une clef primaire ou unique! - - - Assignment of owner object which type is invalid! - Affectation d'un propiétaire dont le type est invalide! - - - Assignment of owner to an invalid object! - Affectation d'un propriétaire à un objet invalide! - - - Reference to a function with invalid type! - Référence à une fonction dont le type est invalide! - - - Reference to an argument of the operator with invalid type! - Référence à un argument de l'opérateur dont le type est invalide! - - - Reference to an operator with invalid type! - Référence à un opérateur dont le type est invalide! - - - Assignment of value to an invalid option type on role! - Utilisation d'un attribut invalide pour un rôle! - - - Reference to an invalid role type! - Référence à un type de rôle invalide! - - - Insertion of empty command to the rule! - Ajout d'une commande vide dans cette règle! - - - Is not possible to create a self generalization/copy relationship! The table can not inherit or copy their own attributes! - Impossible de créer une association de généralisation/copie avec elle même! Une table ne peut hériter ou copier ses propres attributs! - - - Assignment of an object that already belongs to another table! - Utilisation d'un objet appartenant déjà à une autre table! - - - Assignment of a schema to the sequence which differs from the schema of the owner table! - Affectation d'un schéma à la séquence diffèrent du schéma de la table! - - - Assignment of an invalid value to one of the sequence attributes! - Utilisation d'une valeur invalide comme attribut de séquence! - - - Assignment of a minimum value to the sequence which is greater than the maximum value! - La valeur minimale de la séquence est supérieure à la valeur maximale! - - - Assignment of a null increment value to the sequence! - La valeur de l'incrément de la séquence est nulle! - - - Assignment of null cache value to the sequence! - La valeur cache de la séquence est nul! - - - Allocation of object with invalid type! - Le type de l'objet alloué est invalide! - - - Assignment of not allocated language! - Indéfini ? - Utilisation d'un langage inconnu! - - - Assignment of language object which type is invalid! - Définition d'un objet langage dont le type est invalide! - - - Reference to data type with an index outside the capacity of data types list! - Référence à un type de donnée dont l'index est en dehors de la capacité de la liste des types de données! - - - Assignment of invalid type to the object! - Affectation d'un type invalide à l'objet! - - - Obtaining types with invalid quantity! - Utilisation d'une quantité de types invalide! - - - Insertion of item which already exists in the attributes list of the type! - Ajout d'un attribut déjà présent dans la définition de ce type! - - - Insertion of invalid item in the attributes list of the type! - Ajout d'un attribut invalide à la liste des attributs de ce type! - - - Insertion of item which already exists in the enumarations list of the type! - Ajout d'un élément déjà existant dans l'énumeration! - - - Insertion of invalid item in the enumerations list of the type! - Ajout d'un élément invlaide dans l'énumeration! - - - Assignment of invalid configuration to the type! - La configuration assigné au type est invalide! - - - Assignment of an operator which input type count is invalid to aggregate function! - Utilisation d'un opérateur dont le nombre d'argument est invalide avec une fonction d'agrégation (un et seulement un)! - - - Assignment of an operator which types of arguments is invalid! - Utilisation d'un opérateur dont le type des arguments est invalide! - - - A view reference must be used in at least one these SQL scopes: View Definition, SELECT-FROM, FROM-WHERE or After WHERE! - Lors de la définition d'une vue, une référence doit utiliser au moins une des options suivantes:SELECT-FROM, FROM-WHERE ou Après WHERE! - - - Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again! - Impossible de trouver le fichier des préférences par défaut `%1' ! Pour restaurer les préférences par défaut veuillez vérifier l'existance de ce fichier et réessayez ! - - - Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3' - Impossible de charger l'extension `%1' depuis la bibliothèque`%2' ! Message retourné par le gestionnaire d'extension : `%3' - - - Unknown attribute `%1' in file %2, line %3, column %4! - Attribut `%1' incconu dans le fichier %2, ligne %3, colonne %4 ! - - - Invalid use of a view referece as whole SQL definition! The assigned reference must be an expression! - À contrôler - Utilisation invalide d'une vue en tant que définition SQL! La référence doit être une expression! - - - Assignment of a second definition expression to the view! - Assignation d'une seconde expression à la vue! - - - Assignment of collation object which type is invalid! - À contrôler - Utilisation d'un objet collation invlaide! - - - Collations must be created at least with attributes LC_COLLATE and LC_CTYPE defined! - Les collations doivent être définies avec les attributs LC_COLLATE et LC_CTYPE renseignés! - - - Reference to an invalid copy table option! - Référence à une option invalide de copie de table! - - - The INSTEAD OF mode cannot be used on triggers that belongs to tables! This is available only for view triggers! - Le mode AU LIEU DE (INSTEAD OF) ne peut être utilisé comme trigger de table! Ce n'est valable que pour les triggers de vue! - - - The TRUNCATE event can only be used when the trigger executes for each statement and belongs to a table! - L'événement TRUNCATE ne peut être utilisé que lors d'un trigger sur chaque ligne et qu'il appartient à une table! - - - The INSTEAD OF mode cannot be used on view triggers that executes for each statement! - Le mode AU LIEU DE (INSTEAD OF) ne peut être utilisé avec triggeurs de vues qui s’exécutent à chaque requête! - - - Constraint triggers can only be executed on AFTER events and for each row! - Les triggeurs de contraintes ne peuvent être exécutés qu'après (AFTER) et pour chaque lignes! - - - A view trigger cannot be AFTER/BEFORE when it executes for each row! - Les triggeurs de vues ne peuvent être AFTER/BEFORE quand il sont configuré pour une exécution sur chaque ligne! - - - A trigger cannot make reference to columns when using INSTEAD OF mode and UPDATE event! - Un triggeur ne peut faire référence aux colonnes quand il est utilisé en mode INSTEAD OF sur un événement de type UPDATE! - - - Only constraint triggers can be deferrable or reference another table! - Seuls les déclencheurs de contraintes peuvent être déférés ou référencer une autre table! - - - Reference to a function id which is incompatible whit the user define type configuration! - Doutes - Référence faite à un identifiant de fonction incompatible avec le type configuré! - - - The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack! - La procédure de validation a échouée à cause d'une erreur levée par l'assistant de validation. Pour de plus amples informations, referez vous à la pile des exceptions! - - - Assignment of an invalid strategy/support number to an operator class element! - Hum ... numéro de stratégie/support ? - Affectation d'un numéro de stratégie/support invalide à un élément de la classe 'operator'! - - - Insertion of element which already exists in the element list! - Insertion d'un élément déjà existant dans la liste des éléments! - - - Reference to a parameter which index is out of the parameter list bounds! - Référence un paramètre dont l'index est hors des limites de la liste de ces derniers! - - - Reference to an argument which index is out of argument list bounds! - Référence un argument dont l'index est hors des limites de la liste de ces derniers! - - - Assignment of a name which contains invalid characters! - Utilisation de caractères invalides dans le nom! - - - Assignment of a name which length exceeds the maximum of 63 characters! - Utilisation de plus de 63 caractères dans le nom! - - - Reference to a role which index is out of role list bounds! - Référence un rôle dont l'index est hors des limites de la liste de ces derniers! - - - Reference to a command which index is out of the command list bounds! - Référence une commande dont l'index est hors des limites de la liste de ces dernières! - - - Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values! - À contrôler. - Affectation de la valeur de départ de la séquence en dehors des limites de cette dernière (min et max)! - - - Reference to a label which index is out of labels list bounds! - Référence un label dont l'index est hors des limites de la liste de ces derniers! - - - Reference to an attribute which index is out of the attributes list bounds! - Référence un attribut dont l'index est hors des limites de la liste de ces derniers! - - - Reference to an enumeration which index is out of the enumerations list bounds! - Référence une énumération dont l'index est hors des limites de la liste de ces dernières! - - - Reference to an element which index is out of element list bounds! - Référence un élément dont l'index est hors des limites de la liste de ces derniers! - - - Reference to an object which index is out of object list bounds! - Référence un objet dont l'index est hors des limites de la liste de ces derniers! - - - Removal of an object not allocated! - Suppression d'un objet non alloué! - - - The object `%1' (%2) can not be manipulated because it is reserved to PostgreSQL! This object is present in the database model only as a reference! - L'objet `%1' (%2) ne peut être modifié car il est est réservé à PostgreSQL! Cet objet apparaît dans le modèle uniquement comme référence! - - - Unsupported PostgreSQL version (%1) detected! Valid versions are: %2 - Une version non supportée de PostgreSQL (%1) a été détectée! Les versions supportées sont: %2 - - - Operation with object(s) which type(s) is invalid! - Opérations sur des objet(s) dont le(s) type(s) sont invalides! - - - Reference to object with invalid type! - Référence à un objet ayant un type invalide! - - - Operation with object not allocated! - Opération sur des objets non alloués! - - - The relationship of the type 1-1 where both tables are mandatory participation is not implemented because it requires fusion between the tables that breaks the modeling done by the user! - Une association de type 1-1, quand les deux tables sont obligatoires, n'est pas implémentée car celà requiert la fusion des tables, ce qui casse le modèle réalisé par l'utilisateur! - - - Assignment of an invalid expression to the object! - Affectation d'une expression invalide à l'objet! - - - Assignment of a primary key to a table which already has one! - Impossible de définir une clef primaire à une table qui en possède déjà une! - - - Identifier relationship can not be created for a self relationship, relationships of the type n-n, copy or generalization! - Review needed ! Doutes ... - Seules des associations de type 1:1 ou 1:n peuvents être utilisé comme identifiant. En aucun cas les autoassociations, associations n:n, généralisations ou copies ne le peuvent! - - - An attribute can not be added to a copy or generalization relationship! - Un attribut ne peut être ajouté à une relation copie ou généralisation! - - - A foreign key can not be added to a relationship because is created automatically when this is connected! - Une clef étrangère ne peut être ajoutée à une relation car elle est créée automatiquement lors de la mise en relation! - - - Reference to an user-defined data type that not exists in the model! - Référence à un type de donné défini par l'utilisateur qui n'existe pas dans le modèle! - - - Assignment of invalid maximum size to operation list! - La taille maximum affectée à la liste d'opérations est invalide! - - - One or more objects were invalidated and automatically removed because they were referencing table columns which were included through relationships and which no longer exists due to disconnection of relationships or exclusion of such generated columns! - Un ou plusieurs objets ont été invalidés et automatiquement supprimés car ils référençaient des colonnes qui étaient incluses dans des relations et qui n'existaient plus du fait de la suppression de relation ou d'exclusion de ces colonnes! - - - Reference to an invalid privilege type! - Référence à un type de privilège invalide! - - - Insertion of a role which already exists in the role list of the permission! - Ajout d'un rôle déjà existant dans la liste de cette permission! - - - Assignment of privilege incompatible with the type of object referenced by permission! - Utilisation d'un privilège incompatible avec le type d'objet référencé par la permission! - - - It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature! - Il est impossible de créer des tableaux de domaines ou séquences (dimension >= 1)! PostgreSQL n'inplémente pas encore cette fonctionnalité! - - - Assignment of invalid name to the table generated from N-N relationship! - Le nom de la table générée par la relation N-N est invalide! - - - Reference to a column of the objects table with invalid index! - Référence à une colonne de la table ayant un index invalide! - - - Reference to a row of the objects table with invalid index! - Référence à une ligne de la table ayant un index invalide! - - - Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns! - Les contraintes telles que clef primaire, clef étrangère ou l'unicité doivent avoir au moins une colonne associée! Pour les clefs étrangères, les colonnes référencées doivent également être sélectionnées! - - - Unable to load one or more configuration files! Please check if files exists in the configuration folder and if they are not corrupted to preventing this error to occur again on the next startup! - Impossible de charger un ou plusieurs fichiers de configuration! Veuillez vérifier que les fichiers existent bien dans le dossier de configuration et qu'ils ne soient pas corrompus pour éviter que l'erreur ne se produise à nouveau au prochain lancement! - - - The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack! - -** Executed SQL command: ** - -%1 - Le process d'exportation a échoué suite à une erreur déclenchée par le serveur PostgreSQL lors de la tentative d'exécution d'une commande SQL. Pour plus de détails concernant l'erreur vérifiez la pile d'exceptions! - -** Commande SQL exécutée: ** - -%1 - - - One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details. - Une ou plusieurs extensions n'ont pas été activée(s) car des erreurs sont apparues lors du processus de chargment. Pour plus de détails, consultez la pile d'exceptions. - - - Invalid syntax in file %1, line %2, column %3! - Syntaxe invalide dans le fichier %1, ligne %2, colonne %3! - - - Assignment of empty XML buffer to parser! - Passage d'un tampon XML vide au parseur! - - - Could not access the file or directory %1! Make sure that it exists or if the user has access permissions on it! - Impossible d'accéder au fichier ou dossier %1! Assurez vous qu'il existe et que l'utilisateur a le droit d'y accéder! - - - Assignment of empty DTD file name! - Le nom du fichier DTD est vide! - - - Assignment of empty name to the DTD declaration! - Le nom de la DTD est vide! - - - Operation on unallocated element tree! It is necessary to load the XML parser buffer and interpret it so that the tree is generated! - Opération sur un élément de l'arbre XML non initialisé! Il est nécessaire de remplir le tampon de l'analyseur XML et de lancer l'interprétation pour que l'arbre soit généré! - - - Could not load file %1. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing! - Impossible de charger le fichier %1. Le fichier semble incohérent ou une de ses dépendances (fichiers DTD) contient des erreurs ou est manquantes! - - - Operation with unallocated tree element! - Opération sur un élément non alloué de l'arbre! - - - Operation with element which does not exists in the element tree currently loaded! - Opération sur un élément inexistant dans l'arbre des élément actullement chargé! - - - Assignment of a value to an invalid connection parameter! - Affectation d'une valeur à un paramètre de connexion invalide! - - - Operation on connection not established! - Opération sur une connexion non établie! - - - Attempt to connect without define configuration parameters! - Tentative de connexion sans paramètre de configuration défini! - - - Assignment of not allocated SQL command result! - indéfini ? - Affectation d'un résultat de commande SQL non alloué! - - - Unable to allocate the result of the SQL command because the response from the DBMS was not understood by the client! - Impossible de retourner le résultat de la commande SQL car la réponse du SGBD n'a pas été comprise par le client! - - - Reference to a column of tuple with invalid index! - Référence à une colonne de tuple dont l'index est invalide! - - - Reference to a column of tuple with invalid name! - Référence à une colonne de tuple dont le nom est invalide! - - - Reference to a tuple with index invalid or the result is empty (no tuples)! - Référence à un tuple avec un index invalide ou le résultat est vide (pas de tuple)! - - - Assignment of a not allocated column to object `%1' (%2)! - - - - Assignment of a not allocated schema to object `%1' (%2)! - - - - The object `%1' (%2) has inconsistent SQL or XML definition! - - - - The object `%1' (%2) already exists on `%3' (%4)! - - - - The object `%1' (%2) cannot be assigned because there is already exists in the container object `%3'! - - - - The insertion of the parameter `%1' will not be possible because there is another parameter with same name in the function `%2'! - - - - The insertion of the table return type `%1' will not be possible because there is another return type with the same name in the `%2'! - - - - The column `%1' cannot be assigned to the trigger `%2' because they belongs to different parent tables! - - - - Assignment of a not allocated function to object `%1' (%2)! - - - - Assignment of a function which return type is different from `%1'! - - - - Assignment of a function which parameter count is invalid to the object `%1' (%2)! - - - - Event trigger function must be coded in any language other than SQL! - - - - Assignment of not allocated table to object `%1' (%2)! - - - - Assignment of appended or prepended SQL to an invalid object! - - - - The insertion of the role `%1' is not possible because this is already being referenced by role `%2'! - - - - Reference redundancy detected by having the role `%1' referencing the role `%2'! - - - - The role `%1' can not be listed as a member of itself! - - - - Assignment of owner table which is not in the same schema as the sequence `%1'! - - - - Assignment of owner table which does not belong to the same owner of the sequence `%1'! - - - - Assignment of a nonexistent owner column to the sequence `%1'! - - - - Assignment of an owner column to the sequence `%1' that is not related to any table! - - - - Assignment of a function with invalid return type to object `%1' (%2)! - - - - Assignment of a function with invalid parameter(s) type(s) to object `%1' (%2)! - - - - Assignment of an empty directory to object `%1' (%2)! - - - - Assignment of system reserved name to the object `%1' (%2)! - - - - One function with invalid configuration is been used by the object `%1' (%2)! - - - - The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4)! - - - - The object `%1' (%2) can not be removed because it is being referenced by object `%3' (%4) that belongs to `%5' (%6)! - - - - The creation of the relationship `%1' between the table `%2' and `%3' can not be done because one does not have a primary key. If the relationship is of the type n-n both tables must have primary keys! - - - - Unable to create a copy relationship because the column `%1' in table `%2' already exists in table `%3'! - - - - Unable to create the generalization relationship because the column `%1' in table `%2' can not be merged with the column `%3' of table `%4' because they have incompatible types! - - - - The object `%1' (%2) is referencing the object `%3' (%4) which was not found in the model! - - - - Unable to write the file or directory `%1'! Make sure the output directory exists, or if the user has write permissions over it! - - - - There is already a relationship between `%1' (%2) and `%3' (%4) in the model! - - - - The primary key `%1' can only be allocated if declared within a block of code that defines a table or relationship! - - - - There is already a permission on object `%1' (%2) which has one or more equal roles from those present on permission to be assigned to the object! - - - - A permission is referencing the object `%1' (%2) which was not found in the model! - - - - The object `%1' (%2) can not be created because its not being assigned to any schema! - - - - The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'! - - - - The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead! - - - - The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS! - - - - The operator `%1' can not be assigned as a comutator of operator `%2' because it has incompatible settings! - - - - The operator `%1' can not be assigned as negator of operator `%2' because it has incompatible settings! - - - - The type `%1' can not self refer in the attributes `element' or `copy type' or be used as a data type of an attribute in the configuration of a composite type! - - - - Assignment of invalid element to type `%1'! - - - - Assignment of invalid alignment to type `%1'! - - - - The relationship `%1' can not make use of the special primary key because it is marked as identifier or it is a self relationship! - - - - The object `%1' (%2) can not be edited or deleted because it was automatically included through a relationship! If the object is an attribute or constraint the modifications must be done on the relationship editing form. - - - - The object `%1' (%2) can not be deleted because it is protected! - - - - The group `%1' has already been declared earlier! - - - - The group `%1' can not be built in the groups declaration block (%2)! - - - - The group `%1' was built but not declared in the groups declaration block (%2)! - - - - The group `%1' can not be built without possessing child elements! - - - - The group `%1' can not be built once more because this was done in previous blocks! - - - - The group `%1' has been declared but not built! - - - - The new configuration of the function invalidates the object `%1' (%2)! In this case it is needed to undo the relationship between the affected object and function in order to the new configuration to take effect! - - - - Invalid instruction `%1' on file %2, line %3, column %4! - - - - Invalid metacharacter `%1' in file %2, line %3, column %4! - - - - Invalid operator `%1' in comparison expression, file %2, line %3, column %4! - - - - Attribute `%1' with an undefined value in file %2, line %3, column %4! - - - - Attribute `%1' with an invalid name in file %2, line %3, column %4! - - - - Error while interpreting XML buffer at line %1 column %2. -Message generated by the parser: %3. %4 - - - - Attempt to start a connection already stablished! - - - - Could not connect to the database. -Message returned: `%1' - - - - Unable to allocate command result for the SQL because the server has generated a fatal error! -Message returned by the DBMS: `%1' - - - - Reference to a column of a tuple which was not yet initialized (tuple navigation not started)! - - - - Could not execute the SQL command. - Message returned: `%1' - - - - It is not possible mix ordinary references (SELECT-FROM, FROM-WHERE, After WHERE) with references used as view SQL definition! - - - - The object `%1' (%2) cannot reference itself! This operation is not permitted for this kind of object! - - - - Only operator families which uses `btree' as indexing method are accepted by operator class elements! - - - - Copy relationship between tables `%1' and `%2' cannot be done because the first one already copies attributes from `%3'! Tables can have only one copy table! - - - - Assignment of a column which has no parent table to the object `%1' (%2)! - - - - The operator class assigned to the object `%1' (%2) must use `btree' as indexing method! - - - - The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified! - - - - The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'! - - - - Assignement of an invalid object name pattern to the relationship `%1'! - - - - Reference to an invalid object name pattern id on the relationship `%1'! - - - - Mixing incompatibles DBMS export modes: `ignore object duplications', `drop database' or `drop objects' cannot be used with `simulate export'! - - - - Mixing incompatibles DROP options: `drop database' and `drop objects' cannot be used at the same time! - - - - Invalid object id swapping operation! The objects involved are the same! - - - - Invalid object id swapping operation! The database itself, tablespaces or roles cannot have the ids swapped! - - - - The widget already has a parent and cannot be assigned to a different object! - - - - The object `%1' (%2) could not be imported due to one or more errors! Check the exception stack for more details. - - - - Could not load the database model file `%1'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case. - - - - The column `%1' cannot reference it's parent table `%2' as data type! - - - - Operation with an invalid element id `%1'! - - - - Reference to an invalid color id `%1' for element `%2'! - - - - The sequence `%1' can't be assigned to the column `%2' because the data type of the latter is incompatible. The type used must be an integer one! - - - - The option to generate temporary object names can only be used in simulation mode! - - - - Could not assign the variable `%1' to event trigger's filter. Currently, PostgreSQL supports only the `TAG' variable! - - - - Could not perform the `%1' operation on `%2' using the data on row `%3'! All changes were rolled back. - - ** Returned error ** - -%4 - - - - Malformed unescaped value on row `%1' column `%2'! - - - - The object `%1' (%2) can't be handled because some needed fields are not set! Please, make sure to fill at least the requires fields in order to properly create or update the object. - - - - A relationship can only be swapped by other object of the same kind! - - - - Assignment of a null type to object `%1' (%2)! - - - - Unable to create the generalization relationship because the constraint `%1' in table `%2' can not be merged with the constraint `%3' of table `%4' due to their incompatible composition! - - - - Unable to write the file `%1' due to one or more errors in the definition generation process! - - - - The configuration of the relationship `%1' generates a redundancy between the relationships `%2'. Redundancy on identifier or generalization/copy relationships are not accepted since they result in incorrect column spreading making the model inconsistent! - - - - Reference to a tuple with an invalid index or the result is empty (no tuples)! - - - - Invalid use of a view reference as whole SQL definition! The assigned reference must be an expression! - - - - At the moment pgModeler does not support the creation of primary keys which some columns were generated by relationship connection. To create primary keys with this feature you can use the field `Identifier' or the tab `Primary key' on relationship editing form! - - - - Reference to a function id which is incompatible with the user define type configuration! - - - - Invalid use of variadic parameter mode! This mode can be used only with an array or "any" data type! - - - - Assignment of an invalid object to `%1' (%2)! The assigned object must be of type `%3'. - - - - It's not possible convert the type of the column `%1' to serial! It must have an `integer' based type and its default value must be a call to `nextval(seq_name::regclass)' function or a sequence object must be directly assigned to the column! - - - - Trying to undo/redo an invalid operation over an object that does not exists anymore or can't be handled! The operation history will be cleaned up. - - - - A parent table of `%1' which OID is `%2' was not found in the set of imported objects! - - - - The enumeration `%1' can't be assigned to the type `%2' because contains invalid characters! - - - - The enumeration `%1' can't be assigned to the type `%2' because is too long! - - - - The connection was idle for too long and was automatically closed! - - - - The connection was unexpectedly closed by the database server `%1' at port `%2'! - - - - - ExtensionWidget - - Form - Formulaire - - - Version: - Version: - - - Old Version: - Ancienne version: - - - This attribute cannot be changed once the object is created. - Cet attribut ne peut être modifié une fois l'objet créé. - - - Handles data type - Prendre en charge les types de données - - - - FindReplaceWidget - - Form - Formulaire - - - Replace one occurrence - Remplace une occurrence - - - Replace - Remplacer - - - Replace all occurrences - Remplace toutes les occurrences - - - Replace All - Remplacer tout - - - Replace the selection and find the next one - Remplacer l'occurrence courante et trouver le suivant - - - Replace && Find - Remplacer && Suivant - - - Replace: - Remplacer par: - - - Find: - Recherche: - - - Find previous - Précédent - - - Shift+F3 - Shift+F3 - - - Find next - Suivant - - - F3 - F3 - - - Case sensitive - Respecter la casse - - - Regular expression - Expression régulière - - - Whole words - Mots entier - - - - FunctionWidget - - Form - Formulaire - - - Attributes - Attributs - - - Langague: - Langage: - - - Function Type: - Type de fonction: - - - Execution Cost: - Coût d'exécution: - - - Rows Returned: - Lignes retournées: - - - Behavior: - Comportement: - - - Security: - Sécurité: - - - Return Method: - Type de retour: - - - Simple - Simple - - - Set - Multiple - - - Table - Table - - - Return Table - Table de retour - - - Windown Func. - Fonct. fenêtrage - - - Leakproof - Leakproof - - - Parameters - Arguments - - - Definition - Définition - - - Dynamic Library: - Bibliotèque dynamique: - - - Symbol: - Symbole: - - - Library: - Bibliotèque: - - - Source code: - Code source: - - - Column - Colonne - - - Type - Type - - - Name - Nom - - - Mode - Mode - - - Default Value - Valeur par défaut - - - Si&mple - - - - Tab&le - - - - - GeneralConfigWidget - - Form - Formulaire - - - Milimeters - Millimètres - - - Pixels - Pixels - - - Inches - Pouces - - - Centimeter - Centimètres - - - A0 (841 x 1189 mm) - A0 (841 x 1189 mm) - - - General && Design - Général && modélisation - - - The opened models will be saved periodically - Les modèles ouverts seront sauvegardés à interval régulier - - - Check if there is a new version on server - Vérifier la présence d'une nouvelle version au lancement - - - Design - Modélisation - - - Graphical objects (table, views and textboxes) will be created in a single step without the need to click on canvas - Les nouveaux objets graphiques (tables, vues, zones de textes) seront ajoutés au modèle sans avoir besoin d'effectuer un second clic sur le caneva pour les positionner - - - Simplify creation of graphical objects - Créer les nouveaux objets en un clic - - - After loading the model the last zoom and position on canvas will be restored - Restaure la dernière position ainsi que le zoom sur le caneva à l'écran lors de l'ouverture d'un modèle - - - Save and restore last position and zoom - Sauvegarder la position et le zoom - - - Disable antialiasing for lines and texts improving performance on huge models (requires restart) - Désactive l'anticrénelage pour les lignes et les textes afin d'améliorer la réactivité de l'application sur des modèles très etoffés (nécessite un redémarrage) - - - Disable render smoothness - Désactiver l'anticrénelage - - - Hide the object that represents the relationship name - Masque l'étiquette indiquant le nom de chaque association - - - Operations like save, export and diff will be executed without asking user to validate the model - Certaines opérations comme l'enregistrement du fichier, l'export ou encore le différenetiel seront lancées sans demander à l'utilisateur de valider le modèle avant - - - Validate before save, export or diff - Validation du modèle toujours requise - - - Hide the object which represents the tag assigned to the table - Masque l'étiquette indiquant le tag associé à chaque table - - - Hide the portion of table which represent triggers, indexes and rules - Masque les règles, les déclencheurs et les index dans l'affichage des tables - - - Swap panning and range selection triggers - Inverser le comportement du clic gauche - - - Toggles the code completion in all fields that accepts the input of SQL commads. - Active la complétion du code SQL dans les zones de texte prévues à cet effet. - - - Enable SQL code completion - Activer la complétion du code SQL - - - Printing && Code - Impression && édition - - - A1 (594 x 841 mm) - A1 (594 x 841 mm) - - - A2 (420 x 594 mm) - A2 (420 x 594 mm) - - - A3 (297 x 420 mm) - A3 (297 x 420 mm) - - - A4 (210 x 297 mm) - A4 (210 x 297 mm) - - - A5 (148 x 210 mm) - A5 (148 x 210 mm) - - - A6 (105 x 148 mm) - A6 (105 x 148 mm) - - - A7 (74 x 105 mm) - A7 (74 x 105 mm) - - - A8 (52 x 74 mm) - A8 (52 x 74 mm) - - - A9 (37 x 52 mm) - A9 (37 x 52 mm) - - - B0 (1030 x 1456 mm) - B0 (1030 x 1456 mm) - - - B1 (728 x 1030 mm) - B1 (728 x 1030 mm) - - - B10 (32 x 45 mm) - B10 (32 x 45 mm) - - - B2 (515 x 728 mm) - B2 (515 x 728 mm) - - - B3 (364 x 515 mm) - B3 (364 x 515 mm) - - - B4 (257 x 364 mm) - B4 (257 x 364 mm) - - - B5 (182 x 257 mm) - B5 (182 x 257 mm) - - - B6 (128 x 182 mm) - B6 (128 x 182 mm) - - - B7 (91 x 128 mm) - B7 (91 x 128 mm) - - - B8 (64 x 91 mm) - B8 (64 x 91 mm) - - - B9 (45 x 64 mm) - B9 (45 x 64 mm) - - - C5E (163 x 229 mm) - C5E (163 x 229 mm) - - - Comm10E (105 x 241 mm) - Comm10E (105 x 241 mm) - - - DLE (110 x 220 mm) - DLE (110 x 220 mm) - - - Executive (191 x 254 mm) - Executive (191 x 254 mm) - - - Folio (210 x 330 mm) - Folio (210 x 330 mm) - - - Ledger (432 x 279 mm) - Ledger (432 x 279 mm) - - - Legal (216 x 356 mm) - Legal (216 x 356 mm) - - - Letter (216 x 279 mm) - Lettre (216 x 279 mm) - - - Tabloid (279 x 432 mm) - Tabloid (279 x 432 mm) - - - Code font style - Style de police pour le code SQL - - - Size: - Taille: - - - pt - pt - - - Font: - Police: - - - Hide relationship name - Masquer le nom des associations - - - Hide table extended attributes - Masquer les attributs étendus des tables - - - Paper: - Papier: - - - Orientation: - Orientation: - - - Autosave interval: - Interval d'auto-enregistrement: - - - Grid size: - Taille de la grille: - - - General - Général - - - Check for updates at startup - Vérifier MAJ au démarrage - - - Operation history: - Historique des opérations: - - - By default panning mode is triggered with left click and range selection with Shift + left click. - Par défaut : le clic gauche permet de déplacer le canevas (glisser-déplacer), la sélection multiple (rectangle) s'effectue par Shift + clic gauche. - - - Hide table tags - Masquer le tag des tables - - - Printing - Impression - - - Options: - Options: - - - Print grid - Imprimer la grille - - - Custom - Personalisé - - - Unity: - Unité: - - - Custom Size: - Taille papier: - - - Width: - Largeur: - - - Height: - Hauteur: - - - Page Margins: - Marges de la page: - - - Left: - Gauche: - - - Left margin - Marge gauche - - - Top: - Haut: - - - Top margin - Marge haute - - - Right: - Droite: - - - Right margin - Marge droite - - - Bottom: - Bas: - - - Bottom margin - Marge basse - - - Landscape - Paysage - - - Portrait - Portrait - - - Print page numbers - Imprimer les numéros de page - - - minute(s) - minute(s) - - - items - entrées - - - pixels - pixels - - - Start move the canvas when the cursor is on the canvas edges - - - - Move canvas by keep mouse on corners - - - - Disable antialiasing for lines and texts improving performance when handling huge models. - - - - Triggers a dialog asking the user to validate the model before a save, export or diff operation. - - - - When enabled this option creates a placeholder object at the previous table's position when starting to move it. This will cause graphical updates on relationship lines to be performed only when the drag & drop action is done improving the performance. Disabling placeholders will cause those updates to be executed every time the table's position changes a single pixel (classical behavior). - - - - Use placeholders when moving tables - - - - Toggles the code completion in all fields that accepts the input of SQL commands. - - - - Code style - - - - Colors: - Couleur: - - - Display line numbers - - - - Highlight lines at cursor's position - - - - Custom tab width: - - - - Line numbers' font color - - - - Line numbers' background color - - - - Highlighted line color - - - - The little brown fox jumps over the lazy dog - - - - - GraphicalView - - Connected rels: %1 - Associations : %1 - - - - HintTextWidget - - Form - Formulaire - - - - IndexWidget - - Form - Formulaire - - - Attributes - Attributs - - - Indexing: - Indexation: - - - Fill Factor: - Taux de remplissage: - - - Options: - Options: - - - Concurrent - Concurrent - - - Unique - Unique - - - Fast update - Mise à jour rapide - - - Elements - Élements - - - Buffering - - - - Predicate: - - - - - LanguageWidget - - Form - Formulaire - - - Trusted: - De confiance: - - - The functions to be assigned to the language should have, respectively, the following signatures:<br/><br/> <strong>Handler Function:</strong> <em>language_handler function()</em><br/> <strong>Validator Function:</strong> <em>void function(oid)</em><br/> <strong>Inline Function:</strong> <em>void function(internal)</em> - Les fonctions attribuées au langage doivent avoir espectivement les signatures suivantes:<br/><br/> <strong>Fonction de management:</strong> <em>language_handler fonction()</em><br/> <strong>Fonction de validation:</strong> <em>void fonction(oid)</em><br/> <strong>Fonction Inline:</strong> <em>void fonction(internal)</em> - - - Validator Func.: - - - - Handler Func.: - - - - Inline Func.: - - - - - MainWindow - - pgModeler - PostgreSQL Database Modeler - pgModeler - PostgreSQL Database Modeler - - - &File - &Fichier - - - &Edit - Édit&ion - - - &Show - &Affichage - - - &Plugins - E&xtensions - - - Plugins - Extensions - - - New - Nouveau - - - Controls - Contrôles - - - General - Général - - - Ctrl+N - Ctrl+N - - - Save - Enregistrer - - - Ctrl+S - Ctrl+S - - - Zoom in - Zoom + - - - Ctrl+= - Ctrl+= - - - Zoom out - Zoom - - - - Zoom - - Zoom - - - - Ctrl+- - Ctrl+- - - - Load - Ouvrir - - - Ctrl+O - Ctrl+O - - - Next - Suivant - - - Ctrl+Right - Ctrl+Right - - - Previous - Précédent - - - Ctrl+Left - Ctrl+Left - - - Save as - Enregistrer sous - - - Exit - Quitter - - - Ctrl+Q - Ctrl+Q - - - About pgModeler - À propos de pgModeler - - - Export the current opened model in different modes - Exporter le modèle courant sous différentes formes - - - Close - Fermer - - - Close current model - Fermer le modèle courant - - - Ctrl+H - Ctrl+H - - - Settings - Paramètres - - - Edit pgModeler settings - Configurer pgModeler - - - F10 - F10 - - - Wiki - Wiki - - - Access the wiki pages - Visiter le wiki (site) - - - CSS - CSS - - - Access the list of loaded plugins - Accéder a la liste des extensions chargées - - - Recent Models - Modèles récents - - - Load recently opened model - Charger des modèles ouverts récemment - - - Import - Importer - - - Import existing database to new model (reverse engineering) - Importer une base de données existante vers un modèle (reverse engineering) - - - Ctrl+Shift+I - Ctrl+Shift+I - - - Restore Session - Restaurer la session - - - Fix a model - Réparer un modèle - - - New version found! - Nouvelle version disponible! - - - Update for the current version is available on project's site - Une mise à jour pour votre version est disponible sur le site de pgModeler - - - Check for update - Vérifier les mises à jour - - - Main menu - Menu principal - - - Show expanded - Afficher la barre de menus - - - Hide main menu - Cacher la barre de menus - - - Hides the main menu bar and put the action on a separated action - Masque la barre de menu (le menu reste accessible via un bouton dans la barre d'outils) - - - Ctrl+Shift+H - Ctrl+Shift+H - - - Diff - Différencier - - - Determine the changes between model and database - Déterminer les modifications apportées entre un modèle et une base existante - - - Welcome - Accueil - - - Welcome screen - Écran d'accueil - - - Design - Modéliser - - - Design datase models - Modéliser une base de données - - - Manage - Administrer - - - Manage existent databases - Administrer des bases existantes - - - Bug report - Rapporter un bug - - - F1 - F1 - - - O&bjects - O&bjets - - - Alt+B - Alt+B - - - &Validation - &Validation - - - Alt+V - Alt+V - - - &Operations - &Opérations - - - Alt+O - Alt+O - - - Find Object - Chercher un objet - - - Ctrl+F - Ctrl+F - - - msg - message - - - Help - Aide - - - F4 - F4 - - - Print - Imprimer - - - Ctrl+P - Ctrl+P - - - Undo - Annuler - - - Ctrl+Z - Ctrl+Z - - - Redo - Rétablir - - - Ctrl+Y - Ctrl+Y - - - Export - Exporter - - - Ctrl+Shift+S - Ctrl+Shift+S - - - Show grid - Afficher la grille - - - Ctrl+G - Ctrl+G - - - Ctrl+W - Ctrl+W - - - Normal zoom - Zoom normal - - - Ctrl+0 - Ctrl+0 - - - Align to grid - Aligner sur la grille - - - Align objects position to grid - Aligner les objets sur la grille - - - Show delimiters - Afficher les délimiteurs - - - Show the page delimiters - Afficher les délimiteurs de page - - - Ctrl+L - Ctrl+L - - - Save all - Tout enregistrer - - - Overview - Vue d'ensemble - - - Show the model overview - Afficher la vue d'ensemble du modèle - - - Save all models - Enregistrer tous les modèles - - - Clear Menu - Vider cette liste des modèles récents - - - The demonstration version can create only `one' instance of database model! - La version de démonstration ne peut gérer qu'un seul modèle de base à la fois ! - - - Save model - Enregistrer le modèle - - - Warning - Avertissement - - - Save '%1' as... - Enregistrer '%1' sous... - - - Database model (*.dbm);;All files (*.*) - Modèle de base de données (*.dbm);; Tous les fichiers (*.*) - - - Database model printing - Impression du modèle de base de données - - - Confirmation - Confirmation - - - Some models were modified! Do you really want to quit pgModeler without save them? - Des modifications n'ont pas été enregistrées ! Êtes-vous sûr de vouloir QUITTER pgModeler SANS SAUVEGARDER ? - - - The model was modified! Do you really want to close without save it? - Le modèle a été modifié. -Voulez-vous vraiment le FERMER SANS le SAUVEGARDER? - - - Save anyway - Sauvegarder quand même - - - Validate - Valider - - - Changes were detected in the definitions of paper/margin of the model which may cause the incorrect print of the objects. Do you want to continue printing using the new settings? To use the default settings click 'No' or 'Cancel' to abort printing. - Des modifications ont été détectées dans les définitions du papier ou des marges du modèle ce qui pourrait causer une mauvaise impression des objets. Souhaitez vous continuer l'impression avec les nouveaux paramètres? Pour utiliser les paramètres par défaut cliquez sur 'Non' ou 'Annuler' pour interrompre l'impression. - - - Load model - Charger un modèle - - - Could not load the database model file `%1'. Check the error stack to see details. You can try to fix it in order to make it loadable again. - Impossible de charger le modèle `%1'. Consultez la pile d'appel pour plus de détails. Essayez de réparer le modèle pour tenter de l'ouvrir à nouveau. - - - Fix model - Réparer un modèle - - - Cancel - Annuler - - - Open Wiki pages - Accèder au Wiki - - - This action will open a web browser window! Want to proceed? - Cette action ouvrira votre navigateur web! Souhaitez vous continuer? - - - Toggle the model objects widget - - - - Toogle the model validation widgets - - - - Toggle the operation history widget - - - - Toggle the object finder - - - - action_main_menu - - - - Expands the main menu bar in classical mode - - - - (Demo) - - - - Saving temp. models - - - - You're running a demonstration version! The model saving feature is available only in the full version! - - - - <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! It's recommended to validate it before save in order to create a consistent model otherwise the generated file will be broken demanding manual fixes to be loadable again! - <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de l'enregistrer il est recommandé de le valider afin de créer un modèle cohérent, sinon il peut en résulter un fichier mal formé nécessitant une édition manuelle pour pouvoir être chargé à nouveau dans l'application par la suite ! - - - <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the export process it's recommended to validate in order to correctly create the objects on database server! - <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de procéder à un export il est recommandé de valider le modèle afin s'assurer de créer correctement les objets en base ! - - - Export anyway - Exporter quand même - - - <strong>WARNING:</strong> The model <strong>%1</strong> is invalidated! Before run the diff process it's recommended to validate in order to correctly analyze and generate the difference between the model and a database! - <strong>AVERTISSEMENT:</strong> Le modèle <strong>%1</strong> n'a pas été validé ! Avant de procéder à un différentiel il est recommandé de valider le modèle afin s'assurer que l'analyse entre celui-ci de la base de donnée se fasse correctement ! - - - Diff anyway - Différencier quand même - - - (no samples found) - - - - save - - - - export - - - - diff - - - - Executing pending <strong>%1</strong> operation... - - - - He&lp - - - - Pl&ugins - - - - &New - - - - New model - Nouveau modèle - - - &Save - E&nregistrer - - - &Zoom in - - - - Zoo&m out - - - - &Load - O&uvrir - - - Sa&ve as - - - - E&xit - - - - Exit pgModeler - - - - &About pgModeler - - - - &Print - - - - Print model - - - - &Undo - - - - Undo operation - - - - &Redo - - - - Redo operation - - - - &Export - &Exporter - - - Ctrl+Shift+E - - - - &Show grid - - - - &Close - &Fermer - - - &Normal zoom - - - - &Align to grid - - - - Show &delimiters - - - - &Settings - - - - F12 - F12 - - - &Overview - - - - &Support - - - - Access the support page - - - - New object - - - - &Recent Models - - - - &Import - &Importer - - - Rest&ore Session - - - - &Fix a model - - - - &Check for update - - - - &Diff - - - - Ctrl+Shift+D - - - - Shift+W - - - - Design database models - - - - Shift+D - - - - Shift+M - - - - &Bug report - - - - Report a bug - - - - Donate - - - - Help pgModeler by donating! - - - - Objects me&tadata - - - - Objects metadata - - - - Save modified model(s) - - - - The following models were modified but not saved: %1. Do you really want to quit pgModeler? - - - - The model <strong>%1</strong> was modified! Do you really want to close without save it? - - - - Access support page - - - - You're running a demonstration version! Note that you'll be able to create only <strong>%1</strong> instances of each type of object and some key features will be disabled or limited!<br/><br/>You can purchase a full binary copy or get the source code at <a href='http://pgmodeler.com.br'>pgmodeler.com.br</a>. <strong>NOTE:</strong> pgModeler is an open source software, but purchasing binary copies or providing some donations will support the project and cover all development costs.<br/><br/> <strong>HINT:</strong> in order to test all features it's recommended to use the <strong>demo.dbm</strong> model located in </strong>Sample models</strong> at <strong>Welcome</strong> view.<br/><br/><br/><br/> - - - - - Messagebox - - Dialog - Boîte de dialogue - - - msg - message - - - Exceptions - Exceptions - - - Show/hide exceptions stack. - Afficher/cacher la pile d'exceptions. - - - ... - ... - - - &Yes - &Oui - - - &No - &Non - - - Cancel - Annuler - - - Error - Erreur - - - Alert - Alerte - - - Information - Information - - - Confirmation - Confirmation - - - &Ok - &Ok - - - &Cancel - A&nnuler - - - Show raw text errors or information. - - - - - MetadataHandlingForm - - Handle metadata - - - - &Apply - &Appliquer - - - &Cancel - A&nnuler - - - Handle objects metadata - - - - Settings - Paramètres - - - Extract from: - - - - Loading a metadata file to the current model is an irreversible operation so be sure to specify a backup file before proceed. - - - - Options - Options - - - Handles the following database model attributes in the metadata file: author, zoom factor, last position and default objects. - - - - Database model metadata - - - - Handles the objects' positioning in the metadata file. - - - - Objects' positioning - - - - Handles the objects' custom colors in the metadata file. Currently available only for relationships and schemas. - - - - Custom object's colors - - - - Handles the objects' protection status in the metadata file. - - - - Objects' protection status - - - - Handles the objects' SQL disabled status in the metadata file. - - - - Objects' SQL disabled status - - - - Handles the objects' custom SQL commands in the metadata file. - - - - Custom SQL commands - - - - Save textboxes to the output file when extracting metadata. When loading the file textboxes are recreated and duplicated ones are ignored. - - - - Textbox objects - - - - Save tags to the output file when extracting metadata. When loading the file tags are recreated and duplicated ones are ignored. - - - - Tag objects - - - - Backup file: - - - - Select file - - - - ... - ... - - - Apply to: - - - - Operation: - - - - Extracts the objects metadata from one of the loaded models and apply to the current model. - - - - Extract from a &model - - - - Reads the objects metadata from a previously saved backup file and apply to the current model. - - - - Restore a bac&kup file - - - - Output - - - - Progress label... - Indicateur de progression... - - - model not saved yet - - - - The backup file cannot be the same as the input model! - - - - Extracting metadata to file `%1' - - - - Saving backup metadata to file `%1' - - - - Applying metadata from file `%1' - - - - Metadata processing aborted! - - - - Objects metadata file (*.omf);;All files (*.*) - - - - - ModelDatabaseDiffForm - - Settings - Paramètres - - - Connection: - Connexion: - - - Connect and list available databases - Connecter et lister les bases de données disponibles - - - ... - ... - - - Ignore import errors - Ignorer les erreurs - - - Import system objects - Importer les objets système - - - Import extension objects - Importer les objets des extensions - - - File: - Fichier: - - - Select output file - Sélectionner un fichier de sortie - - - Cancel - Annuler - - - Progress label... - Indicateur de progression... - - - 0 - 0 - - - &Close - &Fermer - - - Waiting process to start... - En attente... - - - Confirmation - Confirmation - - - SQL code (*.sql);;All files (*.*) - Code SQL (*.sql);;Tous les fichiers (*.*) - - - Database model diff - - - - Generate diff from model - - - - Input database - - - - Database: - - - - Options - - - - Trucate tables before alter columns - - - - For DROP command, the objects that depends on an object to be dropped will be deleted as well. For TRUNCATE command, tables that are linked to a table to be truncated will be truncate too. <strong>NOTE:</strong> this option can affect more objects than listed in the output or diff preview. - - - - Drop or truncate in cascade mode - - - - Permissions already set on database objects will be kept.The ones configured on the model will be applied to the database. - - - - Keep object's permissions - - - - Database cluster level objects like roles and tablespaces will not be dropped. - - - - Keep cluster objects - - - - Recreate only unmodifiable objects - - - - Force recreation of objects - - - - Ignores errors generated by duplicated objects when exporting the diff to database. - - - - Ignore duplicity errors - - - - Serial columns are converted to integer and having the default value changed to <strong>nextval(sequence)</strong> function call. By default, a new sequence is created for each serial column but checking this option sequences matching the name on column's default value will be reused and will not be dropped. - - - - Reuse sequences on serial columns - - - - Diff mode - - - - Override the PostgreSQL version when generating the diff. The default is to use the same version as the input database. - - - - Use PostgreSQL: - - - - Compares the model and the input database storing the diff in a SQL file for later usage. - - - - Compares the model and the input database generating a diff and applying it directly to the latter. <strong>WARNING:</strong> this mode causes irreversible changes on the database and in case of failure the original structure is not restored, so make sure to have a backup before proceed. - - - - Output - - - - Changes: - - - - Step label... - - - - <html><head/><body><p>Objects marked with an <span style=" font-weight:600;">ALTER</span> may not be effectively changed unless that the differences detected are in attributes that can be modified through ALTER commands otherwise no operationwill be performed or, if the force recreation is checked, the object will be dropped and created again.</p></body></html> - - - - Objects to be created - - - - Objects to be dropped - - - - Possible objects to be changed - - - - Ignored objects (system ones or with sql disabled) - - - - Diff Preview - - - - &Apply diff - - - - &Generate - - - - Importing database <strong>%1</strong>... - - - - Comparing the model <strong>%1</strong> and database <strong>%2</strong>... - - - - <strong>WARNING:</strong> The generated diff is ready to be exported! Once started this process will cause irreversible changes on the database. Do you really want to proceed? - - - - Apply diff - - - - Preview diff - - - - Exporting diff to database <strong>%1</strong>... - - - - Diff process paused. Waiting user action... - - - - Saving diff to file <strong>%1</strong> - - - - Diff process sucessfully ended! - - - - No operations left. - - - - Operation cancelled by the user. - - - - Process aborted due to errors! - - - - -- No differences were detected between model and database. -- - - - - Error code <strong>%1</strong> found and ignored. Proceeding with export. - Code erreur <strong>%1</strong> reçu et ignoré. Poursuite de l'export. - - - Save diff as... - - - - Ignores as many as possible errors on import step. This option generates an incomplete diff. - - - - Clears the data of all tables which will have columns modified. This is useful to avoid errors related to type casting. <strong>WARNING:</strong> DO NOT use this option on production servers and always make a backup before use it. - - - - Import system (built-in) objects. Use this if the import step is returning errors related to missing objects. - - - - Import objects created by extensions. Use this if the import step is returning errors even importing built in ones. - - - - Instead of use an ALTER command to modify certain kind of objects a DROP and CREATE will be used in order to do a full modification. This option does not affects the database object. - - - - No command to rename the destination database will be generated even the model's name differ from database name. - - - - Preserve database name - - - - Avoid the generation of DROP commands for objects that exists in database but not in the model. This is useful when diff a partial model against the complete database. - - - - Do not drop missing objects - - - - Store in S&QL file - - - - Appl&y on server - - - - - --- SQL code purposely truncated at this point in demo version! - - - - - ModelExportForm - - Model Export - Export du modèle - - - File: - Fichier: - - - Select target file - Sélectionner le fichier cible - - - ... - ... - - - Zoom: - Zoom: - - - Export model - Exportation d'un modèle - - - Settings - Paramètres - - - Database server - Serveur de base de données - - - pgModeler ignores errors generated by duplicated objects and creates only that ones which does not exists in the database. This option may be used when an object was created after a previous model export. - pgModeler ignorera les erreurs générées en raison d'objets dupliqués et ne créera uniquement ceux qui n'existent pas déjà en base. Cette option peut être utile lorsqu'un objet est créé après un précédent export. - - - PostgreSQL version in which the SQL code should be generated. It is recommended to select this option only when the version of the DBMS, somehow, is not identifiable or if you need to generate a specific version of SQL code for test purposes. - Version de PostgreSQL pour laquelle le code SQL sera généré. Il est recommandé d'activer cette option uniquement si la version du SGBD n'est pas identifiable ou pour une raison spécifique par exemple pour des essais. - - - If <strong>DB</strong> is checked pgModeler will destroy the database if already exists on the server. When <strong>Objects</strong> is checked pgModeler will execute the DROP command attached to SQL-enabled objects. <strong>WARNING:</strong> this option leads to data loss so make sure to have a backup first. - Si <strong>BDD</strong> est coché pgModeler procèdera à la suppression complète de la base de données si elle existe déjà. Lorsque <strong>Objets</strong> est coché pgModeler effectuera la commande DROP rattachée à l'objet (si la génération du code SQL pour cet objet n'a pas été désactivée dans ses propriétés) <strong>AVERTISSEMENT:</strong> cette option engendre la perte de données, pensez à faire une sauvegarde avant. - - - Drop: - Ordre SQL intuitif - Drop: - - - DB - BDD - - - Objects - Objets - - - PNG Image - Image PNG - - - Show delimiters - Afficher les délimiteurs de page - - - Exporting the model page by page will generate files with a <strong>_p[n]</strong> suffix where <strong>n</strong> is the page id. Check if the current user has write permission on output folder. - Exporter le modèle page par page génèrera des fichiers avec un suffixe de type <strong>_p[n]</strong> où <strong>n</strong> est le numéro de la page. Vérifiez que vous avez bien le droit d'écriture dans le dossier de sortie. - - - Page by page - Une image par page - - - PostgreSQL: - PostgreSQL: - - - PostgreSQL version in which the SQL code should be generated - Version de PostgreSQL pour laquelle le code SQL doit être généré - - - Cancel - Annuler - - - pgModeler will destroy the database if already exists on the server. Make sure to have a backup before use this option because all data will be lost. - pgModeler détruira la base de données si elle existe déjà sur le serveur. Assurez-vous d'avoir une sauvegarde si besoin avant car les données seront définitivement perdues. - - - Image: - Image: - - - Show grid - Afficher la grille - - - Connection: - Connexion: - - - Ignore object duplicity - Ignorer les objets dupliqués - - - SQL file - Fichier texte SQL - - - Output - Progression - - - Progress label... - Indicateur de progression... - - - &Export - &Exporter - - - &Close - &Fermer - - - Initializing model export... - Initialisation de l'exportation du modèle... - - - Saving file '%1' - Enregistrement du fichier '%1' - - - Exporting process aborted! - Processus d'exportation terminé en erreur! - - - Exporting process canceled by user! - Processus d'exportation annulé par l'utilisateur! - - - Exporting process sucessfuly ended! - Processus d'exportation terminé avec succès! - - - Export model as... - Exporter le modèle sous... - - - Error code <strong>%1</strong> found and ignored. Proceeding with export. - Code erreur <strong>%1</strong> reçu et ignoré. Poursuite de l'export. - - - SQL code (*.sql);;All files (*.*) - Fichiers SQL (*.sql);;Tous les fichiers (*.*) - - - PNG image (*.png);;All files (*.*) - Image PNG (*.png);;Tous les fichiers (*.*) - - - Ob&jects - - - - Graphics file - - - - Image (PNG) - - - - Type: - Type: - - - Vectorial (SVG) - - - - SQL script (*.sql);;All files (*.*) - - - - Portable Network Graphics (*.png);;All files (*.*) - - - - Scalable Vector Graphics (*.svg);;All files (*.*) - - - - - ModelExportHelper - - Generating SQL code for PostgreSQL `%1' - - - - Output SQL file `%1' successfully written. - - - - Rendering objects to page %1/%2. - - - - Output image `%1' successfully written. - - - - Starting export to DBMS. - - - - PostgreSQL version detection overridden. Using version `%1'. - - - - PostgreSQL `%1' server detected. - - - - Generating temporary names for database, roles and tablespaces. - - - - Enabling the SQL code for database `%1' to avoid errors. - - - - Ignoring object duplication errors. - - - - Ignoring the following error code(s): `%1'. - - - - Trying to drop database `%1'. - - - - Simulation mode activated. - - - - Generating SQL for `%1' objects... - - - - Destroying objects created on the server. - - - - Restoring original names of database, roles and tablespaces. - - - - Creating object `%1' (%2) - - - - Dropping object `%1' (%2) - - - - Changing object `%1' (%2) - - - - Running auxiliary command. - - - - Exporting model to SVG file. - - - - SVG representation of database model - - - - SVG file generated by pgModeler - - - - Output file `%1' successfully written. - - - - Creating database `%1' - - - - Connecting to database `%1' - - - - Renaming `%1' (%2) to `%3' - - - - - ModelFixForm - - Model file fix - Réparer un fichier modèle - - - &Fix - &Réparer - - - &Close - &Fermer - - - Fix model file - Réparer un modèle - - - <html><head/><body><p>[pgmodeler-cli not found error]</p></body></html> - <html><head/><body><p>[pgmodeler-cli not found error]</p></body></html> - - - pgmodeler-cli: - pgmodeler-cli: - - - Browse for pgmodeler-cli tool - Rechercher l'outil pgmodeler-cli - - - ... - ... - - - The specified file is not the pgModeler command line tool (pgmodeler-cli). - Ce fichier n'est pas l'outil en ligne de commande de pgModeler (pgmodeler-cli). - - - Input file: - Fichier source: - - - Output file: - Fichier cible: - - - Fix tries: - Tentatives: - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Waiting process to start...</p></body></html> - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">En attente...</p></body></html> - - - Select input file - Sélectionner le modèle à réparer - - - Select output file - Sélectionner un fichier de sortie - - - Load fixed model when finish - Charger le modèle réparé une fois l'opération terminée - - - In some cases the fix process will fail to restore all objects within the model demanding manual fixes by changing the file on a text editor. <strong>NOTE:</strong> relationships may lost their graphical configuration like custom points and line color. - Dans certains cas, le processus de réparation peut échouer à restaurer et récupérer tous les objets du modèle, ce qui peut réclamer des modifications manuelles dans le fichier à partir d'un éditeur de texte. <strong>REMARQUE:</strong> les associations peuvent perdre leur configuration graphique tels que des points placés manuellement par l'utilisateur ou la couleur. - - - Waiting process to start... - En attente... - - - Could not locate <strong>%1</strong> tool on <strong>%2</strong>. The fix process can't continue! Please check pgModeler installation or try to manually specify the command below. - Impossible de localiser l'outil <strong>%1</strong> dans <strong>%2</strong>. Impossible de continuer ! Veuillez vérifier votre installation de pgModeler ou alors spécifiez l'emplacement de l'outil. - - - pgModeler command line tool (%1) - Outil en ligne de commande de pgModeler (%1) - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Monospace'; font-size:10pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Waiting process to start...</span></p></body></html> - - - - - ModelNavigationWidget - - Form - Formulaire - - - Previous model - Modèle précédent - - - Ctrl+Up - Ctrl+Haut - - - Next model - Modèle suivant - - - Ctrl+Down - Ctrl+Bas - - - Close model - Fermer - - - ... - ... - - - (model not saved yet) - (modèle pas encore sauvegardé) - - - Ctrl+Left - Ctrl+Left - - - Ctrl+Right - Ctrl+Right - - - Alt+C - - - - - ModelObjectsWidget - - Model Objects - Objets du modèle - - - Hide this widget - Cacher ce widget - - - 1 - 1 - - - Object - Objet - - - Type - Type - - - Parent Object - Objet parent - - - Parent Type - Type parent - - - Visible Object Types - Afficher les objets des types suivants - - - Select All - Tout sélect. - - - Clear All - Tout effacer - - - Select - Sélectionner - - - Return - Retour - - - Cancel - Annuler - - - Esc - Échap. - - - Objects view configuration - Filtres d'affichage des objets - - - Expands all items - Développer tous les éléments - - - Collapses all items - Replier tous les éléments - - - Filter: - Filtrer: - - - ... - ... - - - Tree view - Vue en arbre - - - List view - Vue en liste - - - New - Nouveau - - - ID - ID - - - By ID - - - - - ModelOverviewWidget - - Model overview - Vue générale du modèle - - - - ModelRestorationForm - - Model restoration - Restauration de modèle - - - &Restore - &Restaurer - - - &Cancel - A&nnuler - - - Modified: %1 - Modifié: %1 - - - pgModeler was not closed properly in a previous execution and some models were still being edited. Click <strong>Restore</strong> to reopen the models or <strong>Cancel</strong> to abort the restoration. - - - - pgModeler will try to recover the selected models but will not destroy them in case of loading failure. This option serves as a last resort in order to try to recover the database model. Temporary models will last until the application is closed so the user must try to manually recover the files before exit pgModeler. - - - - Keep temporary models in case of restoration failure - - - - Database - Base de données - - - File - - - - Modified - - - - Size - - - - - ModelValidationHelper - - There are pending errors! SQL validation will not be executed. - - - - Operation canceled by the user. - - - - - ModelValidationWidget - - Form - Formulaire - - - 0 - 0 - - - Try to apply a fix on the selected validation info. - Essayer d'appliquer le correctif sur l’élément sélectionné. - - - Clear validation results - Effacer le résultat de la validation - - - Va&lidate - Va&lider - - - Warnings: does not prevents model to be saved. - Avertissements: n'empêche de pouvoir sauvegarder le modèle. - - - Errors: model will not be saved while there are validation errors. - Erreurs: le modèle ne peut être sauvegardé tant que des erreurs de validation subsistent. - - - Use unique temporary names for database, role and tablespace objects - Utiliser des noms uniques et temporaires pour la base, les rôles et les tablespaces - - - SQL Validation: - Validation SQL: - - - Connection alias - Alias de la connexion - - - PostgreSQL version - Version de PostgreSQL - - - SQL validation, if enabled, will occur only on the last step or when there are no warnings. - Validation SQL, si activée, ne sera déclenchée qu'à la fin ou uniquement s'il n'y a pas d'avertissements. - - - Using temporary names will avoid object duplication errors when running the SQL validation. - Utiliser des noms temporaires évite les erreurs dues aux objets dupliqués lors de la validation SQL. - - - Try to resolve the reported issues. - Essayer de résoudre les problèmes rencontrés. - - - Ctrl+S - Ctrl+S - - - Clear - Effacer - - - Options - Options - - - Cancel the SQL validation in progress. - Annuler le processus de validation SQL en cours. - - - Cancel - Annuler - - - Esc - Échap - - - Change the creation order for two objects by swapping their ids - Modifie l'ordre de création de deux objets en échangeant leurs numéros d'identification - - - Swap Ids - Echanger identifiants - - - Enable validation of SQL code on DBMS (requires connection) - Activer la validation SQL sur le serveur (requiert une connexion) - - - Apply Fix - Appliquer le correctif - - - Hide this widget - Fermer ce widget - - - ... - ... - - - The object <strong>%1</strong> <em>(%2)</em> [id: %3] is being referenced by <strong>%4</strong> object(s) before its creation. - L'objet <strong>%1</strong> <em>(%2)</em> [id: %3] est référencé par <strong>%4</strong> objet(s) avant sa création. - - - Autodetect - Auto détection - - - The object <strong>%1</strong> <em>(%2)</em> [id: %3]%4 is referencing columns created by <strong>%5</strong> relationship(s) but is created before them. - L'objet <strong>%1</strong> <em>(%2)</em> [id: %3]%4 a pour référence des colonnes créées par <strong>%5</strong> association(s) but is created before them. - - - The object <strong>%1</strong> <em>(%2)</em> has a name that conflicts with <strong>%3</strong> object's name(s). - Le nom de l'objet <strong>%1</strong> <em>(%2)</em> entre en conflit avec l'objet<strong>%3</strong>. - - - Database model sucessfully validated. - Modèle de données validé avec succès. - - - Running SQL validation... - Validation SQL en cours... - - - Processing object: %1 - Traitement de l'objet: %1 - - - Conflicting object: <strong>%1</strong> <em>(%2)</em>. - Objet en conflit: <strong>%1</strong> <em>(%2)</em>. - - - Referrer object: <strong>%1</strong> <em>(%2)</em> [id: %3]. - Seconde lecture ? - Objet réferent: <strong>%1</strong> <em>(%2)</em> [id: %3]. - - - SQL validation failed due to error(s) below. <strong>NOTE:</strong><em> These errors does not invalidates the model but may affect operations like <strong>export</strong> and <strong>diff</strong>.</em> - - - - <em>The above object was created by a relationship. Change the name pattern on it's generator relationship. Fix will not be applied!</em> - - - - Relationship: <strong>%1</strong> [id: %2]. - - - - Running SQL commands on server... - Execution des commandes SQL sur le serveur... - - - Enables the validation of SQL code in DBMS. This process requires the use of a pre-configured connection. SQL validation will occur only in the last step (when all objects were validated) or when there are no warnings. - - - - Connection to be used in the SQL validation - - - - pgModeler will generate unique and temporary names for database, role and tablespace objects. This option avoids object duplication errors when running the SQL validation. - - - - Use unique temporary names for cluster level objects - - - - The relationship <strong>%1</strong> [id: %2] is in a permanent invalidation state and needs to be relocated. - - - - <strong>HINT:</strong> try to swap the relationship by another ones that somehow are linked to it through generated columns or constraints to solve this issue. Note that other objects may be lost in the swap process. - - - - SQL validation not executed! No connection defined. - - - - Database model successfully validated. - - - - - ModelWidget - - Copy - Copier - - - Generalization - Généralisation - - - Convert - Convertir - - - New - Nouveau - - - Quick - Act. rapides - - - Source code - Code source - - - Show object source code - Afficher le code source de l'objet - - - Source - Source - - - Properties - Propriétés - - - Space - Espace - - - Edit the object properties - Editer les propriétés de l'objet - - - Protect - Vérrouiller - - - Unprotect - Déverrouiller - - - Protects object(s) from modifications - Empêcher l(es)'objet(s) d'être modifiés - - - Delete - Supprimer - - - Shift+Del - Shift+Suppr - - - Select all - Tout sélect. - - - Selects all the graphical objects in the model - Sélectionner tous les objets graphiques du modèle - - - Paste - Coller - - - Cut - Couper - - - Deps && Referrers - Dép. && Rèf. - - - Add a new object in the model - Ajouter un nouvel objet dans le modèle - - - Rename - Renommer - - - Quick rename the object - Renommage rapide de l'objet - - - Move to schema - Déplacer vers le schema - - - Edit permissions - Editer les permissions - - - Change owner - Changer le propriétaire - - - Select children - Sélectionnez les éléments - - - Highlight - Mettre en avant - - - Del - Suppr - - - Ctrl+A - Ctrl+A - - - F2 - F2 - - - Custom SQL - Code SQL Libre - - - Alt+Q - Alt+Q - - - Loading database model - Ouverture du modèle de base de données - - - Saving database model - Enregistrement du modèle de base de données - - - Also copy all dependencies of selected objects? This minimizes the breakdown of references when copied objects are pasted into another model. - Copier également les dépendences des objets sélectionnés? Ceci minimise la perte des références lorsque les objets copiés sont collés dans un autre modèle. - - - Pasting objects... - Collage des objets... - - - Not all objects were pasted to the model due to errors returned during the process! Refer to error stack for more details! - Tous les objets n'ont pas été collés dans le modèle à cause d'erreurs retournés durant le processus! Se référer à la pile d'erreurs pour plus de détails! - - - Do you really want to delete the selected object? - Souhaitez vous réellement supprimer l'objet sélectionné? - - - (no objects) - (aucun objet) - - - Constraints - Contraintes - - - One to One (1-1) - - - - One to Many (1-n) - - - - Many to Many (n-n) - - - - <strong>ATTENTION:</strong> The database model is protected! Operations that could modify it are disabled! - - - - Alt+S - - - - Del. cascade - Supprimer en cascade - - - Ctrl+C - Ctrl+C - - - Ctrl+V - Ctrl+V - - - Ctrl+X - Ctrl+X - - - Quick action for the selected object - Actions rapides sur l'objet sélectionné - - - Set tag - Affecter un tag - - - Ctrl+E - Ctrl+E - - - Open relationship - - - - Convert to sequence - - - - Convert to serial - - - - Break line - - - - Remove points - - - - Enable SQL - - - - Disable SQL - - - - 90° (vertical) - - - - 90° (horizontal) - - - - 90° + 90° (vertical) - - - - 90° + 90° (horizontal) - - - - Zoom: %1% - - - - Do you really want to convert the relationship into an intermediate table? - - - - Validating object: `%1' (%2) - - - - Generating XML for: `%1' (%2) - - - - Pasting object: `%1' (%2) - - - - <strong>CAUTION:</strong> You are about to delete objects in cascade mode which means more objects than the selected will be dropped too. Do you really want to proceed? - - - - <strong>CAUTION:</strong> Remove multiple objects at once can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? - - - - <strong>CAUTION:</strong> Remove a relationship can cause irreversible invalidations to other objects in the model causing such invalid objects to be deleted too. Do you really want to proceed? - - - - The cascade deletion found some problems when running! Some objects could not be deleted or registered in the operation's history! Please, refer to error stack for more details. - - - - Inheritance - - - - Do you want to %1 the selected schema's children too? - - - - protect - - - - unprotect - - - - - ModelsDiffHelper - - Processing object `%1' (%2)... - - - - Skipping object `%1' (%2)... - - - - Processing diff infos... - - - - Processing `%1' info for object `%2' (%3)... - - - - No differences between the model and database. - - - - Preparing diff code... - - - - - NewObjectOverlayWidget - - Form - Formulaire - - - Role - Rôle - - - Tag - Tag - - - Cast - Convertion de type - - - Language - Langage - - - Textbox - Zone de texte - - - Event Trigger - Déclencheur sur évènement - - - Tablespace - Tablespace - - - Schema - Schéma - - - Domain - Domaine - - - Conversion - Convertion - - - Aggregate - Fonction d'agrégat - - - Collation - Collation - - - Table - Table - - - Type - Type - - - Sequence - Séquence - - - Extension - Extension - - - Function - Fonction - - - View - Vue - - - Permissions - Permissions - - - Rule - Règle - - - Index - Index - - - Column - Colonne - - - Constraint - Contrainte - - - Trigger - Déclencheur - - - Copy - Copie - - - M - M - - - 9 - 9 - - - Z - Z - - - 1 - 1 - - - 2 - 2 - - - 3 - 3 - - - 5 - 5 - - - 4 - 4 - - - 0 - 0 - - - A - - - - Op. Family - - - - Op. Class - - - - Operator - - - - Many-to-many - - - - One-to-many - - - - One-to-one - - - - Inheritance - - - - G - - - - K - - - - H - - - - J - - - - D - - - - E - - - - F - - - - L - - - - O - - - - U - - - - I - - - - R - - - - S - - - - Q - - - - T - - - - P - - - - Y - - - - W - - - - X - - - - C - - - - V - - - - B - - - - - NumberedTextEditor - - Upper case - - - - Lower case - - - - Ident right - - - - Ident left - - - - - ObjectDepsRefsWidget - - Form - Formulaire - - - Dependencies - Dépendances - - - Object - Objet - - - Type - Type - - - Parent Object - Objet parent - - - Parent Type - Type parent - - - References - Références - - - ID - Intuitif - ID - - - Exclude indirect dependencies - Exclure les dépendances indirectes - - - Include indirect references - Inclure les références indirectes - - - This object does not exists anymore. The dependencies and references listing are disabled. - Cet objet n'existe plus. L'affichage de ses dépendances et références est désactivé. - - - Object's dependencies & references - Dépendances et références d'un objet - - - - ObjectFinderWidget - - Form - Formulaire - - - Pattern: - Motif: - - - Hide this widget - Cacher ce widget - - - ... - ... - - - Highlight - Mettre en avant - - - Find - Chercher - - - Clears the search results - Éffacer les résultats - - - Clear - Effacer - - - Regular Expression - Expression régulières - - - Exact Match - Correspondance exacte - - - Select All - Tout sélect. - - - Clear All - Tout effacer - - - Case Sensitive - Sensible à la casse - - - Object - Objet - - - Type - Type - - - Parent Object - Objet parent - - - Parent Type - Type parent - - - Defines the search filter - Défini le filtre de recherche - - - Filter - Filtrer - - - Found <strong>%1</strong> object(s). - <strong>%1</strong> objet(s) trouvé(s). - - - No objects found. - Aucun objet trouvé. - - - Highlight graphical objects when selecting them or their children on the result list - - - - ID - ID - - - - ObjectRenameWidget - - Form - Formulaire - - - .... - .... - - - to: - en: - - - Rename - Renommer - - - Cancel - Annuler - - - - ObjectSelectorWidget - - Form - Formulaire - - - Clear field - Effeacer le champs - - - Select Object - Sélectionner un objet - - - Select %1 - - - - - ObjectTableWidget - - Form - Formulaire - - - Add Item - Ajouter un élément - - - Ins - Ins - - - Remove Item - Supprimer un élément - - - Del - Suppr. - - - Update Item - Actualiser les éléments - - - Alt+R - Alt+R - - - Remove All - Tout supprimer - - - Shift+Del - Shift+Del - - - Edit Item - Editer l'élément - - - Space - Space - - - Move Up - Déplacer vers le haut - - - Ctrl+Up - Ctrl+Haut - - - Move Down - Déplacer vers le bas - - - Ctrl+Down - Ctrl+Bas - - - Move to start - Déplacer au début - - - Ctrl+Home - Ctrl+début - - - Move to end - Déplacer à la fin - - - Ctrl+End, Ctrl+S - Ctrl+Fin, Ctrl+S - - - Confirmação - Confirmation - - - Do you really want to remove the selected item? - Souhaitez vous réellement supprimer l'élément sélectionné? - - - Do you really want to remove the all items? - Souhaitez vous réellement supprimer tous les éléments? - - - Confirmation - Confirmation - - - - OperationList - - (invalid object) - - - - - OperationListWidget - - Executed Operations - Opérations exécutées - - - Hide this widget - Cacher ce widget - - - ... - ... - - - 1 - 1 - - - Operations: - Opérations: - - - 0 - 0 - - - Position: - Position: - - - Delete operation history - Supprimer l'historique des opérations - - - Undo - Annuler - - - Redo - Rétablir - - - Object: %1 - Objet: %1 - - - Name: %1 - Nom: %1 - - - created - créé - - - removed - supprimé - - - modified - modifié - - - moved - déplacé - - - Operation: %1 - Opération: %1 - - - Undoing operations... - Annulation des opérations... - - - Redoing operations... - Rétablissement des opérations... - - - Operation history exclusion - ?? À controler dans le contexte ?? - Exclure l'historique des opérations - - - Delete the executed operations history is an irreversible action, do you want to continue? - Supprimer l'historique des opérations exécutées est une action irréversible, souhaitez vous continuer? - - - - OperatorClassWidget - - Form - Formulaire - - - Default Class: - Classe par défaut: - - - Indexing: - Indexation: - - - Elements - Élements - - - Element Type: - Type d'élement: - - - Operator - Operateur - - - Function - Fonction - - - Storage - Stockage - - - Function: - Fonction: - - - Operator: - Opérateur: - - - Support/Strategy: - Support/Stratégie: - - - Op. Family: - Famille d'opérateurs: - - - Storage Type - Type de Stockage - - - Object - Objet - - - Type - Type - - - Support/Strategy - Support/Stratégie - - - Operator Family - Famille d'opérateurs - - - - OperatorFamilyWidget - - Form - Formulaire - - - Indexing: - Indexation: - - - - OperatorWidget - - Form - Formulaire - - - Options: - Options: - - - MERGES - MERGES - - - HASHES - HASHES - - - Arguments - Arguments - - - Advanced - Avancé - - - Restrict: - Restriction: - - - Commutator: - Commutateur: - - - Negator: - Négateur: - - - Operator Func.: - Fonction de l'opérateur: - - - Join: - Jointure: - - - Right Argument Type - Type argument à droite - - - Left Argument Type - Type d'argument à gauche - - - To create a unary operator it is necessary to specify as <strong><em>'any'</em></strong> one of its arguments. Additionally, the function that defines the operator must have only one parameter and this, in turn, must have the same data type of the the argument of unary operator. - Pour créer un opérateur unaire il est nécessaire de spécifier <strong><em>'any'</em></strong> comme l'un de ses arguments. De plus, la fonction qui définit l'opérateur doit avoir seulement un paramètre et celui-ci doit avoir le même type de donnée que l'argument de l'opérateur unaire. - - - - ParameterWidget - - Form - Formulaire - - - Default Value: - Valeur par défaut: - - - Mode: - Mode: - - - IN - IN - - - OUT - OUT - - - VARIADIC - VARIADIC - - - - PermissionWidget - - Form - Formulaire - - - Roles - Rôles - - - ID: - Identifiant: - - - Permissions - Permissions - - - Add Permission - Ajouter permission - - - Update Permission - Actualiser permission - - - Cancel Operation - Annuler l'opération - - - Privileges - Privilèges - - - Disable SQL code - Désactiver le code SQL - - - Grant - Grant - - - Revoke - Revoke - - - Cascade - Cascade - - - Privilege - Privilège - - - GRANT OPTION - GRANT OPTION - - - Code Preview - Prévisualisation du code - - - Type: - Type: - - - Role - Rôle - - - Id - Identifiant - - - Leave the <em><strong>Roles</strong></em> empty to create a permission applicable to <strong><em>PUBLIC</em></strong>. - Laissez le champ <em><strong>Rôles</strong></em> vide pour créer une permission applicable à <strong><em>PUBLIC</em></strong>. - - - -- No permissions defined for the specified object! - -- Aucune permission définie pour cet objet! - - - /* Could not generate the SQL code preview for permissions! - /* Impossible de générer la prévisualisation du code SQL pour les permissions! - - - Edit permissions - Editer les permissions - - - &Grant - - - - Re&voke - - - - - PgModelerCLI - - Unrecognized option '%1'. - Option '%1' non reconnue. - - - Value not specified for option '%1'. - Valeur pour l'option '%1' manquante. - - - Option '%1' does not accept values. - L'option '%1' n'accepte pas de valeur. - - - Connection aliased as '%1' was not found on configuration file. - La connexion nommé '%1' n'existe pas dans le fichier de configuration. - - - Usage: pgmodeler-cli [OPTIONS] - Utilisation: pgmodeler-cli [OPTIONS] - - - command line interface. - interface en ligne de commande - - - PostgreSQL Database Modeler Project - pgmodeler.com.br - PostgreSQL Database Modeler Project - pgmodeler.com.br - - - General options: - Options générales: - - - %1, %2 Export to a sql script file. - %1, %2 Export vers un fichier SQL. - - - %1, %2 Export to a png image. - %1, %2 Export en image PNG. - - - %1, %2 Export directly to a PostgreSQL server. - %1, %2 Exporter directement dans un serveur PostgreSQL. - - - %1, %2 List available connections on %3 file. - %1, %2 Lister les connexions disponnibles dans le fichier %3. - - - %1, %2 Version of generated SQL code. Only for file or dbms export. - %1, %2 Version de PostgreSQL pour laquelle doit être généré l'export. Uniquement pour les exports fichier SQL et en direct dans le serveur. - - - %1, %2 Silent execution. Only critical errors are shown during process. - %1, %2 Exécution silencieuse. Seuls les avertissements et erreurs seront affichés pendant le traitement. - - - %1, %2 Show this help menu. - %1, %2 Affiche ce menu. - - - PNG export options: - Option d'export PNG: - - - %1, %2 Draws the grid on the exported png image. - %1, %2 Dessiner la grille. - - - %1, %2 Draws the page delimiters on the exported png image. - %1, %2 Dessiner les limites de pages. - - - DBMS export options: - Option d'exportation directe dans un serveur: - - - %1, %2 Ignores errors related to duplicated objects that eventually exists on server side. - %1, %2 Ignorer les erreurs relatives à d'éventuels objets dupliqués déjà existant sur le serveur. - - - %1, %2=[ALIAS] Connection configuration alias to be used. - %1, %2=[ALIAS] Alias de connexion à utiliser. - - - %1, %2=[HOST] PostgreSQL host which export will operate. - %1, %2=[HOST] Hôte du serveur PostgreSQL. - - - %1, %2=[PORT] PostgreSQL host listening port. - %1, %2=[PORT] Port du serveur PostgreSQL. - - - %1, %2=[USER] PosrgreSQL username. - %1, %2=[USER] Nom d'utilisateur. - - - %1, %2=[PASSWORD] PosrgreSQL user password. - %1, %2=[PASSWORD] Mot de passe. - - - %1, %2=[DBNAME] Connection's initial database. - %1, %2=[DBNAME] Base de données initiale de connexion. - - - Available connections (alias : conn. string) - Connexions disponibles (alias : chaîne de conn.) - - - No export mode specified! - Pas de mode d'export spécifié! - - - Multiple export mode especified! - Multiples mode d'exportation spécifiés! - - - No input file specified! - Pas de fichier source! - - - No output file specified! - Pas de fichier de sortie! - - - Input file must be different from output! - Le fichier source doit être différent du fichier de sortie! - - - Incomplete connection information! - Les information de connexion sont incomplètes! - - - Starting model export... - Début de l'export du modèle... - - - Loading input file: - Chargement du fichier source: - - - Export to PNG image: - Export en image PNG: - - - Export to SQL script file: - Export en fichier SQL: - - - Export to DBMS: - Export directement en base: - - - Export successfully ended! - Export complété avec succès! - - - Copyright 2006-2015 Raphael A. Silva <raphael@pgmodeler.com.br> - - - - This CLI tool provides the operations to export pgModeler's database models without -the need to load them on graphical interface as well to fix model files to the most recent -accepted structure. All available options are described below. - Cet outil en ligne de commande permet d'exporter des modèles de base pgModeler sans avoir besoin de les ouvrir via l'interface graphique. Il permet aussi de réparer des fichiers de modèle vers un format de structure le plus récent. Toutes les options disponibles sont décrites ci-dessous. - - - %1, %2=[FILE] Input model file (.dbm). Mandatory use when fixing a model or exporting it. - - - - %1, %2=[FILE] Output file. Mandatory use when fixing model or export to file or png. - - - - %1, %2 Try to fix the structure of the input model file in order to make it loadable again. - - - - %1, %2 Model fix tries. When reaching the maximum count the invalid objects will be discard. - - - - %1, %2 Drop the database before execute a export process. - - - - %1, %2 Runs the DROP commands attached to SQL-enabled objects. - - - - %1, %2 Simulates a export process. Actually executes all steps but undoing any modification. - - - - %1, %2 Generates temporary names for database, roles and tablespaces when in simulation mode. - - - - Miscellaneous options: - - - - %1, %2=[ACTION] Handles the file association to .dbm files. The ACTION can be [%3 | %4]. - - - - There are no connections configured. - - - - Export, fix model and update mime operations can't be used at the same time! - - - - Invalid zoom specified! - - - - Invalid action specified to update mime option! - - - - Starting model fixing... - - - - Starting mime update... - - - - Fixed model file: - - - - Model successfully fixed! - - - - Extracting objects' XML... - - - - Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted! - - - - Recreating objects... - - - - -** Object(s) that couldn't fixed: - - - - WARNING: There are objects that maybe can't be fixed. Trying again... (tries %1/%2) - - - - Database model files (.dbm) are already associated to pgModeler! - - - - There is no file association related to pgModeler and .dbm files! - - - - Mime database operation: %1 - - - - Can't erase the file %1! Check if the current user has permissions to delete it and if the file exists. - - - - Running update-mime-database command... - - - - This CLI tool provides the operations to export pgModeler's database models without - the need to load them on graphical interface as well to fix model files to the most recent - accepted structure. All available options are described below. - - - - %1, %2 Export to a svg file. - - - - PNG and SVG export options: - - - - %1, %2 Each page will be exported on a separated png image. (Only for PNG) - - - - %1, %2=[FACTOR] Applies a zoom (in percent) before export to png image. Accepted zoom interval: %3-%4 (Only for PNG) - - - - %1, %2=[USER] PostgreSQL username. - - - - %1, %2=[PASSWORD] PostgreSQL user password. - - - - Multiple export mode specified! - - - - Mime database successfully updated. - - - - Export to SVG file: - - - - - PgModelerPlugin - - Plugin Information - Information de l'extension - - - Version: %1 - Version: %1 - - - Author: %1 - Auteur: %1 - - - - PgModelerUiNS - - Do you want to apply the <strong>SQL %1 status</strong> to the object's references too? This will avoid problems when exporting or validating the model. - Souhaitez-vous appliquer <strong>SQL %1 status</strong> aux références de l'objet également ? Cela permet d'éviter des porlbèmes lors de l'exportation ou la validation du modèle. - - - disabling - - - - enabling - - - - - PgSQLTypeWidget - - Form - Formulaire - - - Data Type - Type de donnée - - - SRID: - SRID: - - - Variation: - Variation: - - - Z - Z - - - M - M - - - Precision - Précision - - - Spatial: - Spatial: - - - Dimension - Dimension - - - Format: - Format: - - - Timezone: - Fuseau horaire: - - - Type: - Type: - - - P: - P: - - - Length - Taille ? - Longueur - - - L: - L: - - - Interval: - Intervalle: - - - [ ]: - [ ]: - - - NONE - AUCUN - - - - PluginsConfigWidget - - Form - Formulaire - - - Plug-ins root directory: - Répertoire racine des extentions: - - - Open in file manager - Ouvrir dans le getionnaire de fichier - - - Loaded plug-ins - Extensions chargées - - - Plugin - Extension - - - Version - Version - - - Library - Bibliothèque - - - - QObject - - new_database - nouvelle_base - - - %1 (line: %2) - %1 (ligne: %2) - - - - Relationship - - %1_has_one_%2 - Traduction approprié ? - %1_has_one_%2 - - - %1_has_many_%2 - Traduction approprié ? - %1_has_many_%2 - - - many_%1_has_many_%2 - Traduction approprié ? - many_%1_has_many_%2 - - - %1_inherits_%2 - Traduction approprié ? - %1_inherits_%2 - - - %1_copies_%2 - Traduction approprié ? - %1_copies_%2 - - - - RelationshipConfigWidget - - Form - Formulaire - - - Connect FK to PK columns - Relier les associations avec chacune des colonnes des clés étrangères/primaires concernées - - - Connect tables' center points - Relier les associations aux tables en un point central - - - Foreign key settings - Clés étrangères - - - Deferral: - Report: - - - Deferrable: - Différable: - - - ON DELETE: - ON DELETE: - - - ON UPDATE: - ON UPDATE: - - - Name patterns - Règles de nommage - - - Relationship type: - Type d'association: - - - Foreign Key (Target): - Clé étrangère (Cible): - - - Unique Key Name: - Nom contrainte unique: - - - Primary Key Name: - Nom contrainte clé primaire: - - - Primary Key Column: - Nom colonne clé primaire: - - - Column (Target): - Colonne (Cible): - - - Foreign Key (Source): - Clé étrangère (Source): - - - Column (Source): - Colonne (Source): - - - One to one (1:1) - Un à un (1:1) - - - Connection Mode - Affichage - - - FK Settings && Patterns - Clès étrangères && nommage - - - One to many (1:n) - Un à plusieurs (1:n) - - - Many to many (n:n) - Plusieurs à plusieurs (n:n) - - - Generalization - Généralisation - - - Copy - Copie - - - Default - Défaut - - - This mode is available only for <strong>one-to-one</strong>, <strong>one-to-many</strong> and <strong>fk relationships</strong> but provides a better semantics when linking tables by placing the lines on the exact point where the relationship occurs. - Ce mode d'affichage est disponible uniquement pour les associations de type <strong>un à un</strong>, <strong>un à plusieurs</strong> et <strong>les associations à clé étrangère</strong>. Il permet une meilleure sémantique pour relier les tables en traçant les lignes sur chacunes des colonnes concernées par l'assocation. - - - This mode is the classical one. It connects the relationship to tables through their central points. - Ceci est le mode classique. L'association est reliée aux tables en un seul trait central. - - - Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). - Motif pour les noms de clés étrangères générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). - - - Pattern for columns generated based upon target table's pk (n-n). - Motif pour les noms de colonnes générées qui sont basées sur la clé primaire de la table cible (n:n). - - - Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). - Motif pour les noms de colonnes générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). - - - Pattern for foreign key generated based upon target table's pk (n-n). - Motif pour les noms de clés étrangères générées qui sont basées sur une clé primaire de la table cible (n:n). - - - Pattern for unique key generated by the relationship. - Motif pour les noms de clés uniques qui sont générées par une association. - - - Pattern for primary key generated by identifier relationship. - Motif pour les noms de clés primaires qui sont générées par une association. - - - - RelationshipWidget - - Form - Formulaire - - - General - Général - - - One to one relationship - Association un à un - - - 1-1 - 1-1 - - - One to many relationship - Association un à plusieurs - - - 1-n - 1-n - - - Many to many relationship - Association plusieurs à plusieurs - - - n-n - n-n - - - Generalization relationship (inheritance) - Association de généralisation (héritage) - - - gen - gen - - - Dependency / Copy relationship - Relation de dépendance / copie - - - dep - dep - - - Relationship generated via foreign key - Relation générée par une clef étrangère - - - fk - fk - - - Identifier - Identifiant - - - Rel. Type: - Type de relation: - - - Table 1: - Table n°1: - - - Table 2: - Table n°2: - - - Foreign key Settings - Propriétés par défaut des clés étrangères - - - Use the values defined on settings dialogs for the fields below - Utiliser les paramètres de pgModeler pour les champs ci-dessous - - - Use global settings for these fields - Utiliser les paramètres globaux de pgModeler - - - ON DELETE: - Intuitif - ON DELETE: - - - ON UPDATE: - Intuitif - ON UPDATE: - - - Name Patterns - Règles de nommage - - - Column (Source): - Colonne (Source): - - - Column (Target): - Colonne (Cible): - - - Foreign Key (Source): - Clé étrangère (Source): - - - Foreign Key (Target): - Clé étrangère (Cible): - - - Cardinality: - Cardinalité: - - - [SRC] is required - [SRC] est requis - - - [DST] is required - [DST] est requis - - - Name of the table generated from many to many relationship - Nom de la table générée par une relation plusieurs à plusieurs - - - Deferrable: - Différable: - - - Deferral: - Report: - - - Copy Options - Options de copie - - - INDEXES - INDEXES - - - COMMENTS - COMMENTAIRES - - - INCLUDING - INCLURE - - - DEFAULTS - DEFAUTS - - - EXCLUDING - EXCLURE - - - CONSTRAINTS - CONTRAINTES - - - Use defaults - Utiliser les valeurs par défauts - - - ALL - TOUT - - - STORAGE - STOCKAGE - - - Gen. Table Name: - Nom nouvelle table: - - - Attributes - Attributs - - - Constraints - Contraintes - - - Primary key - Clef primaire - - - Advanced - Avancé - - - Attribute - Attribut - - - Type - Type - - - Constraint - Contrainte - - - Name - Nom - - - This advanced tab shows the objects (columns or table) auto created by the relationship's connection as well the foreign keys that represents the link between the participant tables. - Cet onglet avancé montre les objets (colonnes ou tables) générés automatiquement par la relation ainsi que les clefs étrangères qui forment le(s) lien(s) entre les tables. - - - is required - est requis - - - Reference Table: - Table de référence: - - - Default - Défaut - - - Receiver Table: - Table de destination: - - - Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). - Motif pour les noms de colonnes générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). - - - Pattern for columns generated based upon target table's pk (n-n). - Motif pour les noms de colonnes générées qui sont basées sur la clé primaire de la table cible (n:n). - - - Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n). - Motif pour les noms de clés étrangères générées qui sont basées sur la clé primaire d'une table référencée (1:1 et 1:n) ou sur la clé primaire de la table source (n:n). - - - Pattern for foreign key generated based upon target table's pk (n-n). - Motif pour les noms de clés étrangères générées qui sont basées sur une clé primaire de la table cible (n:n). - - - Pattern for primary key generated by identifier relationship. - Motif pour les noms de clés primaires qui sont générées par une association. - - - Primary Key Name: - Nom contrainte clé primaire: - - - Pattern for unique key generated by the relationship. - Motif pour les noms de clés uniques qui sont générées par une association. - - - Unique Key Name: - Nom contrainte unique: - - - Primay Key Column: - - - - The receiver's primary key will be composed by the generated foreign key columns. - - - - Instead of create a multi-valued primary key with the generated foreign keys columns a single column is created and used as primary key. - - - - Single PK column - - - - Custom Color: - - - - Use the special primary key if you want to include a primary key containing generated columns to the receiver table. <strong>Important:</strong> if this is a new relationship there is a need to finish its creation and reopen this dialog to create the special primary key. - - - - Referer View: - - - - Referer view references one or more columns of a table to construct it's own columns. - - - - Referenced table has its columns referenced by a view in order to construct the columns of this latter. - - - - Referer Table: - - - - Referer table references one or more columns of a table through foreign keys. This is the (n) side of relationship. - - - - Referenced table has its columns referenced by a table's foreign key. This is the (1) side of relationship. - - - - Referenced Table: - - - - Reference table has the columns from its primary key will copied to the receiver table in order to represent the linking between them. This is the (1) side of relationship. - - - - Receiver (or referer) table will receive the generated columns and the foreign key in order to represent the linking between them. This is the (n) side of relationship. - - - - In many-to-many relationships both tables are used as reference to generate the table that represents the linking. Columns from both tables are copied to the resultant table and two foreign keys are created as well in order to reference each participant table. - - - - &1-1 - - - - &gen - - - - E&XCLUDING - - - - Available tokens to define name patterns:<br/> <strong>%1</strong> = Reference (source) primary key column name. <em>(Ignored on constraint patterns)</em><br/> <strong>%2</strong> = Reference (source) table name.<br/> <strong>%3</strong> = Receiver (destination) table name.<br/> <strong>%4</strong> = Generated table name. <em>(Only for n:n relationships)</em> - - - - - RoleWidget - - Form - Formulaire - - - Password: - Mot de passe: - - - Connections: - Connexions: - - - Attributes - Attributs - - - Superuser - Super utilisateur - - - Inherit Permissions - Hériter des permissions - - - Can create Database - Peut créer des bases de données - - - Can create Role - Peut créer des rôles - - - Can use Replication - Peut utiliser la réplication - - - Encrypted - Encrypté - - - Can Login - Peut s'authentifier - - - Members - Membres - - - Member of - Membre de - - - Members (Admin.) - Membres (Admin.) - - - Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. - Definir <strong><em>Connexions</em></strong> à <strong><em>-1</em></strong> créé le rôle sans limite de connexion.<br/> Décocher <strong><em>Validité</em></strong> créé un rôle qui n'expire jamais. - - - Role - Rôle - - - Validity - Validité - - - yyyy-MMM-dd hh:mm:ss - - - - Assigning <strong><em>-1</em></strong> to <strong><em>Connections</em></strong> creates a role without connection limit.<br/> Unchecking <strong><em>Validity</em></strong> creates an role that never expires. - - - - - RuleWidget - - Form - Formulaire - - - Event: - Evènement: - - - Execution Type: - Type d'exécution: - - - Conditional Expr.: - Expr. conditionnelle: - - - Commands - Commandes - - - SQL Command: - Commandes SQL: - - - SQL command - Commande SQL - - - To create a rule that does not perform any action (<strong>DO NOTHING</strong>) simply do not specify commands in the SQL commands table. - Pour créer une règle qui n'éxécute aucune action (<strong>DO NOTHING</strong>), ne spécifiez aucune commandes dans le champs des commandes SQL. - - - - SQLExecutionWidget - - Form - Formulaire - - - Load SQL script - Ouvrir un script SQL - - - &Load - O&uvrir - - - Save SQL commands - Sauvegarder commandes SQL - - - &Save - E&nregistrer - - - &Find - &Rechercher - - - Alt+F - Alt+F - - - Run the specified SQL command - Exécute la commande SQL entrée - - - Run SQL - Exécuter SQL - - - F6 - F6 - - - Clear sql input field and results - Effacer le code SQL et la grille de résultat - - - Clear All - Effacer - - - Export results to a CSV file - Exporter les résultats dans un fichier CSV - - - Snippe&ts - Snippe&ts - - - E&xport - E&xporter - - - Shows the command history - Afficher l'historique des commandes - - - &History - &Historique - - - Alt+H - Alt+H - - - Command History - Historique des commandes - - - Clear sql input field and results. - Effacer les résultats et le code SQL saisi. - - - Clear - Effacer - - - ... - ... - - - 0 - 0 - - - Rows returned: - Lignes retournées: - - - SQL file (*.sql);;All files (*.*) - Fichier SQL (*.sql);;Tous les fichiers (*.*) - - - [binary data] - [données binaires] - - - Save CSV file - Sauvegarder fichier CSV - - - Comma-separated values file (*.csv);;All files (*.*) - Fichiers CSV, champs séparés par des points-virgules (*.csv);;Tous les fichiers (*.*) - - - The SQL input field and the results grid will be cleared! Want to proceed? - Tout le code SQL ainsi que la grille des résultats vont être purgés! Continuer? - - - Load SQL commands - - - - Copy selection - - - - Search in SQL code - - - - Toggles the output pane - - - - &Output - - - - Alt+O - Alt+O - - - Results - - - - Messages - - - - History - - - - No results retrieved or changes done due to the error above. - - - - Messages (%1) - - - - Results (%1) - - - - [%1]: SQL command successfully executed. <em>%2 <strong>%3</strong></em> - - - - Rows affected - - - - Rows retrieved - - - - Clear history - - - - - SQLToolWidget - - Form - Formulaire - - - Database explorer - Explorateur de bases de données - - - Connect to server - Démarrer la connexion - - - Disconnect from server - Se déconnecter - - - Browse selected database. - Charger les informations de la base sélectionnée - - - Drop the selected database - Supprimer la base de données sélectionnée - - - Shift+Del - Shift+Del - - - Update the database list. - Actualiser la liste des bases de données. - - - SQL execution - Exécuteur SQL - - - ... - ... - - - Warning - Avertissement - - - <strong>CAUTION:</strong> You are about to drop the entire database <strong>%1</strong>! All data will be completely wiped out. Do you really want to proceed? - <strong>ATTENTION:</strong> Vous êtes sur le point de supprimer l'intégralité de la base de données <strong>%1</strong>! Toutes les données seront définitivement supprimées. Détruire la base ? - - - You're running a demonstration version! The data manipulation feature is available only in the full version! - Vous utilisez la version de démonstration ! Cette fonctionnalité est disponible uniquement sur la version complète ! - - - Disconnect from all databases - - - - Update the database list - - - - Toggle the object's attributes grid - - - - Attributes - Attributs - - - Alt+R - Alt+R - - - Toggle the display of source code pane - - - - Source code - Code source - - - <strong>ATTENTION:</strong> Disconnect from all databases will close any opened tab in this view! Do you really want to proceed? - - - - - SchemaWidget - - Form - Formulaire - - - Show rectangle - Afficher le rectangle - - - Fill color: - Couleur de remplissage: - - - - SequenceWidget - - Form - Formulaire - - - Cyclic: - Cyclique: - - - Start: - Début: - - - Maximum: - Maximum: - - - Minimum: - Minimum: - - - Increment: - Incrément: - - - Cache: - Cache: - - - Owner Col.: - Pas mieux - Owner Col.: - - - - SnippetsConfigWidget - - Form - Formulaire - - - Create new connection - Créer une nouvelle connexion - - - Cancel edition - Annuler l'édition - - - Edit selected connection - Editer la connexion sélectionnée - - - Delete selected connection - Supprimer la connexion sélectionnée - - - Remove All - Tout supprimer - - - Shift+Del - Shift+Del - - - Filter: - Filtrer: - - - ID: - Identifiant: - - - Add - Ajouter - - - Update - Mettre à jour - - - General - Général - - - Label: - - - - Applies to: - - - - Parsable or dynamic snippets are written in the <strong>schema micro language</strong> syntax. When using a parsable snippet the attributes surrounded in <strong>{}</strong> will be replaced by the selected object's matching attributes. - - - - Parsable - - - - When handling parsable snippets empty attributes will be replaced by a value in the format <strong>{attribute}</strong>. Note that this option can affect the semantics of the resulting snippet. - - - - Placeholders - - - - Parse the snippet in order to check if there are syntax errors. - - - - Parse - - - - Snippets: - - - - General purpose - - - - All snippets - - - - /* Error parsing the snippet '%1': - - %2 */ - - - - Duplicated snippet id <strong>%1</strong> detected. Please, specify a different one! - - - - Invalid ID pattern detected <strong>%1</strong>. This one must start with at leat one letter and be composed by letters, numbers and/or underscore! - - - - Empty label for snippet <strong>%1</strong>. Please, specify a value for it! - - - - Empty code for snippet <strong>%1</strong>. Please, specify a value for it! - - - - The dynamic snippet contains syntax error(s). Additional info: <br/><em>%1</em> - - - - Do you really want to remove all snippets? - - - - No syntax errors found in the snippet. - - - - - SourceCodeWidget - - Form - Formulaire - - - Version: - Version: - - - PostgreSQL - PostgreSQL - - - iconecodigo - icone - - - SQL - SQL - - - XML - XML - - - Type: - Type: - - - Source code visualization - Visualisation du code source - - - SQL code (*.sql);;All files (*.*) - Code SQL (*.sql);;Tous les fichiers (*.*) - - - Generating source code... - Génération du code source... - - - -- SQL code unavailable for this type of object -- - -- Code SQL non disponible pour ce type d'objet. -- - - - Code display: - - - - Original - - - - Original + depedencies' SQL - - - - Original + children's SQL - - - - Save the SQL code to a file. - - - - Save SQL - - - - Save SQL code as... - - - - -- NOTE: the code below contains the SQL for the selected object --- as well for its dependencies and children (if applicable). --- --- This feature is only a convinience in order to permit you to test --- the whole object's SQL definition at once. --- --- When exporting or generating the SQL for the whole database model --- all objects will be placed at their original positions. - - - - - - - <!-- XML code preview disabled in demonstration version --> - - - - <strong>Original:</strong> displays only the original object's SQL code.<br/><br/> <strong>Dependencies:</strong> displays the original code including all dependencies needed to properly create the selected object.<br/><br/> <strong>Children:</strong> displays the original code including all object's children SQL code. This option is used only by schemas, tables and views. - - - - - --- SQL code purposely truncated at this point in demo version! - - - - - SwapObjectsIdsWidget - - Form - Formulaire - - - Create: - Créer: - - - ID: - Identifiant: - - - Before: - Avant: - - - It's recommended to use this feature only when the SQL validation fails in cases when a object is being referenced in portions where the ordinary validation couldn't reach, e.g., inside of a rule command or check constraint expression. - Il est recommandé d'utiliser cette fonctionnalité seulement lorsque la validation SQL échoue. C'est souvent le cas lorsque des objets possèdent des références vers d'autres objets que vous avez créé ultérieurement dans le modèle . Echanger les ID débloque la situation. - - - Swap the values of the fields - Procède à l'échange - - - Swap values - Échanger - - - Change objects creation order - - - - - Table - - new_table - nouvelle_table - - - In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2' - - - - - TableDataWidget - - Edit table data - - - - Add empty rows - - - - Add - Ajouter - - - Ins - Ins - - - Some invalid or duplicated columns were detected. In order to solve this issue double-click the header of the highlighted ones in order to define the correct name in which the data belongs to or delete the entire column. Note that these columns are completely igored when generating the <strong>INSERT</strong> commands. - - - - Add an empty column - - - - Remove all rows from the grid preserving columns - - - - Clear - Effacer - - - Shift+Del - - - - Delete the selected rows - - - - Delete - Supprimer - - - Del - - - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in <span style=" font-weight:600;">{}</span>. To use <span style=" font-weight:600;">{</span> or <span style=" font-weight:600;">}</span> as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\{</span> or <span style=" font-weight:600;">\}</span>.</p></body></html> - - - - Duplicate the selected rows - - - - Duplicate - - - - Ctrl+D - - - - Delete the selected columns - - - - Remove all columns (and rows) from the grid - - - - Ctrl+Shift+Del - - - - Delete columns is an irreversible action! Do you really want to proceed? - - - - Remove all rows is an irreversible action! Do you really want to proceed? - - - - Remove all columns is an irreversible action! Do you really want to proceed? - - - - Unknown column - - - - Duplicated column - - - - (no columns) - - - - - TableObjectView - - -Relationship: %1 - - - - - TableView - - Connected rels: %1 - Associations: %1 - - - - TableWidget - - Form - Formulaire - - - Options - Options - - - Tag: - Tag: - - - With OID - Avec OID - - - Generate ALTER for columns/constraints - Utiliser ALTER pour les colonnes/contraintes - - - Unlogged - Unlogged - - - Columns - Colonnes - - - Constraints - Contraintes - - - Triggers - Déclencheur - - - Rules - Règles - - - Indexes - Indexes - - - Tables - Tables - - - Name - Nom - - - Schema - Schéma - - - Type - Type - - - Default Value - Valeur par défaut - - - Attribute - Attribut - - - ON DELETE - ON DELETE - - - ON UPDATE - ON UPDATE - - - Refer. Table - Table référ. - - - Firing - Déclencheur - - - Events - Evènements - - - Execution - Exécution - - - Event - Evènement - - - Indexing - Indexation - - - Parent - Parent - - - Copy - Copie - - - &Columns - - - - Co&nstraints - - - - Tri&ggers - - - - &Rules - - - - &Indexes - - - - &Tables - - - - Edit data - - - - Define initial data for the table - - - - - TablespaceWidget - - Form - Formulaire - - - Directory: - Dossier: - - - - TagWidget - - Form - Formulaire - - - Colors - Couleurs - - - Extended body: - Corps étendu: - - - Body: - Corps: - - - Title: - Titre: - - - Schema name: - Nom du schéma: - - - Table name: - Nom de la table: - - - - TaskProgressWidget - - Executing tasks - Exécution des tâches - - - Waiting task to start... - En attente du démarrage de la tâche ... - - - - TextboxWidget - - Form - Formulaire - - - Font: - Police: - - - Text - Texte - - - pt - pt - - - Color: - Couleur: - - - Bold - Gras - - - Italic - Italique - - - Underline - Souligné - - - Select text color - Sélection de la couleur de texte - - - - TriggerWidget - - Form - Formulaire - - - Event: - Evènement: - - - INSERT - INSERT - - - DELETE - DELETE - - - UPDATE - UPDATE - - - TRUNCATE - TRUNCATE - - - Deferrable: - Différable: - - - Columns - Colonnes - - - Column: - Colonne: - - - Arguments - Arguments - - - Constraint - Contrainte - - - FOR EACH ROW - Pour chaque ligne - - - Refer. Table: - Table référ.: - - - Condition: - Condition: - - - Argument: - Argument: - - - Function: - Fonction: - - - Options: - Options: - - - Excution: - Excution: - - - Column - Colonne - - - Type - Type - - - - TypeWidget - - Form - Formulaire - - - Configuration: - Configuration: - - - Base Type - Type de base - - - Enumeration - Enumération - - - Composite - Composite - - - Enumerations - Énumérations - - - Enumeration: - Énumeration: - - - Attributes - Attributs - - - Internal Length: - Long. interne: - - - Storage: - Stockage: - - - Category: - Catégorie: - - - Delimiter: - Délimiteur: - - - Alignment: - Alignement: - - - char - char - - - smallint - smallint - - - integer - integer - - - double precision - double precision - - - Default Value: - Valeur par défaut: - - - Range - Interval - - - Options: - Options: - - - By value - Par valeur - - - Preferred - Préféré - - - Collatable - Collatable - - - Functions - Fonctions - - - INPUT: - INPUT: - - - OUTPUT: - OUTPUT: - - - RECV: - RECV: - - - SEND: - SEND: - - - TPMOD_IN: - TPMOD_IN: - - - TPMOD_OUT: - TPMOD_OUT: - - - ANALYZE: - ANALYZE: - - - Name: - Nom: - - - Collation: - Collation: - - - Subtype Diff Func.: - Fonction de différence du sous-type: - - - Operator Class: - Classe d'opérateurs: - - - Canonical Func.: - Fonction canonique: - - - Like Type - Type de Like - - - Element Type - Type d'élement - - - Subtype - Sous-type - - - Name - Nom - - - Type - Type - - - Collation - Collation - - - The functions to be assigned to a type should be written in C language and possess, respectively, the following signatures:<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any function(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring function(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta function(any)</em></td> <td><strong>RECV:</strong> <em>any function(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer function(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring function(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean function(internal)</em></td> <tr> </table> - La fonction assignée à un type devrait être écrite en langage C et possèder, les signatures respective suivantes:<br/> <table> <tr> <td><strong>INPUT:</strong> <em>any fonction(cstring, oid, integer)</em></td> <td><strong>OUTPUT:</strong> <em>cstring fonction(any)</em></td> </tr> <tr> <td><strong>SEND:</strong> <em>byta fonction(any)</em></td> <td><strong>RECV:</strong> <em>any fonction(internal, oid, integer)</em></td> </tr> <tr> <td><strong>TPMOD_IN:</strong> <em>integer fonction(cstring[])</em></td> <td><strong>TPMOD_OUT:</strong> <em>cstring fonction(integer)</em></td> </tr> <tr> <td><strong>ANALYZE:</strong> <em>boolean fonction(internal)</em></td> <tr> </table> - - - The functions to be assigned to a range type should have the following signatures:<br/><br/><strong>Canonical:</strong> <em>any function(any)</em> <br/><strong>Subtype Diff:</strong> <em>double precision function(subtype, subtype)</em> - Les fonction assignables au type interval (RANGE) doivent avoir la signature suivante:<br/><br/><strong>Canonique:</strong> <em>any function(any)</em> <br/><strong>Subtype Diff:</strong> <em>double precision function(subtype, subtype)</em> - - - Co&mposite - - - - - UpdateNotifierWidget - - Update Notifier - Vérificateur de mise à jour - - - New update found! - Nouvelle mise à jour disponible! - - - Hide this widget - Cacher ce widget - - - ... - ... - - - Released in: - Date de sortie: - - - mmm dd, yyyy - dd mmm yyyy - - - Version: - Version: - - - 0.0.0 - 0.0.0 - - - Changelog - Journal des modifications - - - Redirects to purchase page. - Redirige vers la page web pour acheter. - - - Get binary package - Télécharger l'application compilée - - - Redirects to GitHub source repository. - Redirige vers la page web du dépôt GitHub. - - - Get source code - Télécharger le code source - - - <strong>Note:</strong> Both actions below will open a new web browser window - <strong>Remarque:</strong> Ces boutons entraînent l'ouverture de votre navigateur web - - - Purchase a new package - Acheter un nouveau paquet - - - Failed to check updates - Impossible de vérifier la présence de mise à jour - - - The update notifier failed to check for new versions! Please, verify your internet connectivity and try again! Connection error returned: <strong>%1</strong>. - Le vérificateur de mise à jour n'a pas pu vérifier la présence de nouvelles versions ! Vérifiez votre connexion à Internet et réessayez ! Code d'erreur retourné : <strong>%1</strong>. - - - No updates found - Aucune mise à jour disponible - - - You are running the most recent pgModeler version! No update needed. - Vous utilisez déjà la version de pgModeler la plus récente ! Aucune mise à jour requise. - - - The update notifier failed to check for new versions! A HTTP status code was returned: <strong>%1</strong> - Le vérificateur de mise à jour n'a pas pu vérifier la présence de nouvelles versions ! Code retour HTTP reçu : <strong>%1</strong> - - - Recover a package - - - - Update found! - - - - New version: - - - - - ViewWidget - - Form - Formulaire - - - References - Références - - - Column - Colonne - - - Expression - Expression - - - Used in: - Utilisé dans: - - - Reference Type: - Type de référence: - - - SELECT-FROM - SELECT-FROM - - - FROM-WHERE - FROM-WHERE - - - After WHERE - Après WHERE - - - View Definition - Définition de la vue - - - Options - Options - - - Tag: - Tag: - - - Mode: - Mode: - - - Ordinary - Ordinaire - - - Recursive - Récursif - - - Materialized - Matérialisée - - - With no data - With no data - - - Table: - Table: - - - Table Alias: - Alias table: - - - Column: - Colonne: - - - Column Alias: - Alias colonne: - - - Expression: - Expression: - - - Expression Alias: - Alias expression: - - - Triggers - Déclencheur - - - Rules - Règles - - - Table Expression - CTE - - - Code Preview - Prévisualisation du code - - - Col./Expr. - Col./Expr. - - - Alias - Alias - - - Alias Col. - Alias col. - - - Flags: SF FW AW VD - Flags: SF FW AW VD - - - Name - Nom - - - Refer. Table - Table référ. - - - Firing - Déclenche - - - Events - Evènements - - - Execution - Exécution - - - Event - Evènement - - - /* Could not generate the SQL code. Make sure all attributes are correctly filled! - /* Le code SQL ne peut être généré. Vérifiez que les champs sont correctement remplis! - - - To reference all columns in a table (*) just do not fill the field <strong>Column</strong>, this is the same as write <em><strong>[schema].[tablel].*</strong></em> - Pour référencer toutes les colonnes dans une table (*) ne remplissez pas le champs <strong>Colonne</strong>, ceci revient à écrire <em><strong>[schéma].[table].*</strong></em> - - - Recursi&ve - - - - &Materialized - - - - - WelcomeWidget - - Form - Formulaire - - - New model - Nouveau modèle - - - Open model - Ouvrir modèle - - - Sample models - Modèles de démo - - - Recent models - Modèles récents - - - Last session - Dernière session - - - - Xml2Object - - Xml2Object - Xml2Object - - - - Xml2ObjectWidget - - XML2Object - XML2Object - - - Load XML - Charger XML - - - Clear - Effacer - - - Generate - Générer - - - Close - Fermer - - - Database model (*.dbm);;XML file (*.xml);;All files (*.*) - Modèle de base de données (*.dbm);;Fichier XML (*.xml);;Tous les fichiers (*.*) - - - Load file - Charger un fichier - - - From 20b35083f8fdaf6dc17770e2667dd192a398bf9c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 31 Oct 2018 11:46:19 -0300 Subject: [PATCH 195/425] Improved the TableTitleView to avoid adding children item. The custom paint() method draws them --- libobjrenderer/src/objectsscene.cpp | 4 +++ libobjrenderer/src/tabletitleview.cpp | 35 +++++++++++++++------------ libobjrenderer/src/tabletitleview.h | 5 ++-- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 6f46650a17..a7e8ac4ffb 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -450,6 +450,10 @@ void ObjectsScene::addItem(QGraphicsItem *item) } QGraphicsScene::addItem(item); + +#warning "Debug!" + QTextStream out(stdout); + out << this->items().count() << endl; } } diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index ded7bee287..a7a325d9bc 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -26,21 +26,13 @@ TableTitleView::TableTitleView(void) : BaseObjectView(nullptr) obj_name=new QGraphicsSimpleTextItem; obj_name->setZValue(1); - //box=new QGraphicsPolygonItem; box=new RoundedRectItem; box->setRoundedCorners(RoundedRectItem::TopLeftCorner | RoundedRectItem::TopRightCorner); box->setZValue(0); - - this->addToGroup(box); - this->addToGroup(schema_name); - this->addToGroup(obj_name); } TableTitleView::~TableTitleView(void) { - this->removeFromGroup(schema_name); - this->removeFromGroup(obj_name); - this->removeFromGroup(box); delete(schema_name); delete(obj_name); delete(box); @@ -122,34 +114,45 @@ void TableTitleView::configureObject(BaseGraphicObject *object) if(tag) pen.setColor(tag->getElementColor(title_color_attrib, Tag::BorderColor)); - if(object->getObjectType()==ObjectType::View || - (table && table->isPartition())) + if(object->getObjectType()==ObjectType::View || (table && table->isPartition())) pen.setStyle(Qt::DashLine); box->setPen(pen); if(schema->isRectVisible()) this->resizeTitle(obj_name->boundingRect().width() + (2 * HorizSpacing), - obj_name->boundingRect().height() + (2 * VertSpacing)); + obj_name->boundingRect().height() + (2 * VertSpacing)); else this->resizeTitle(obj_name->boundingRect().width() + schema_name->boundingRect().width() + (2 * HorizSpacing), - schema_name->boundingRect().height() + (2 * VertSpacing)); + schema_name->boundingRect().height() + (2 * VertSpacing)); } void TableTitleView::resizeTitle(double width, double height) { + double py = (height / 1.5); box->setRect(QRectF(0,0, width, height)); if(schema_name->text()==QString(" ")) - obj_name->setPos((box->boundingRect().width() - obj_name->boundingRect().width())/2.0f, VertSpacing); + obj_name->setPos((box->boundingRect().width() - obj_name->boundingRect().width())/2.0f, py); else { - schema_name->setPos((box->boundingRect().width() - (schema_name->boundingRect().width() + obj_name->boundingRect().width()))/2.0f, VertSpacing); - obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), VertSpacing); - obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), VertSpacing); + schema_name->setPos((box->boundingRect().width() - (schema_name->boundingRect().width() + obj_name->boundingRect().width()))/2.0f, py); + obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), py); } this->bounding_rect.setTopLeft(this->pos()); this->bounding_rect.setSize(QSizeF(box->boundingRect().width(), box->boundingRect().height())); } +void TableTitleView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + box->paint(painter, option, widget); + + painter->setFont(schema_name->font()); + painter->setPen(schema_name->brush().color()); + painter->drawText(schema_name->pos(), schema_name->text()); + + painter->setFont(obj_name->font()); + painter->setPen(obj_name->brush().color()); + painter->drawText(obj_name->pos(), obj_name->text()); +} diff --git a/libobjrenderer/src/tabletitleview.h b/libobjrenderer/src/tabletitleview.h index dbcdb00514..17f27c8e7a 100644 --- a/libobjrenderer/src/tabletitleview.h +++ b/libobjrenderer/src/tabletitleview.h @@ -36,8 +36,7 @@ class TableTitleView: public BaseObjectView private: Q_OBJECT - //! \brief Polygonal object that defines the title border - //QGraphicsPolygonItem *box; + //! \brief Rounded rectangle object that defines the title border RoundedRectItem *box; //! \brief Graphical texts that is used to store the object name and schema name @@ -52,6 +51,8 @@ class TableTitleView: public BaseObjectView void configureObject(BaseGraphicObject *object); void resizeTitle(double width, double height); + + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); }; #endif From 74f7ac49ed809b7afa7edfa00c12946b6ade78b8 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 31 Oct 2018 17:56:26 -0300 Subject: [PATCH 196/425] Starting to refactor TableObjectView to avoid adding extra scene items --- libobjrenderer/src/objectsscene.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 73 +++++++++++++++++--------- libobjrenderer/src/tableobjectview.h | 6 +++ libobjrenderer/src/tableview.cpp | 3 +- 4 files changed, 56 insertions(+), 28 deletions(-) diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index a7e8ac4ffb..48d6deb973 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -451,7 +451,7 @@ void ObjectsScene::addItem(QGraphicsItem *item) QGraphicsScene::addItem(item); -#warning "Debug!" + #warning "Debug!" QTextStream out(stdout); out << this->items().count() << endl; } diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index b3fe2d68dd..e3285fd807 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -36,18 +36,18 @@ TableObjectView::TableObjectView(TableObject *object) : BaseObjectView(object) for(unsigned i=0; i < 3; i++) { lables[i]=new QGraphicsSimpleTextItem; - this->addToGroup(lables[i]); + //this->addToGroup(lables[i]); } } TableObjectView::~TableObjectView(void) { - this->removeFromGroup(descriptor); + //this->removeFromGroup(descriptor); delete(descriptor); for(unsigned i=0; i < 3; i++) { - this->removeFromGroup(lables[i]); + //this->removeFromGroup(lables[i]); delete(lables[i]); } } @@ -71,7 +71,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) if(descriptor && ((ellipse_desc && !dynamic_cast(descriptor)) || (!ellipse_desc && dynamic_cast(descriptor)))) { - this->removeFromGroup(descriptor); + //this->removeFromGroup(descriptor); delete(descriptor); descriptor=nullptr; } @@ -83,7 +83,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) else descriptor=new QGraphicsPolygonItem; - this->addToGroup(descriptor); + //this->addToGroup(descriptor); } if(column) @@ -260,7 +260,7 @@ void TableObjectView::configureObject(void) configureDescriptor(constr_type); //Set the descriptor position as the first item on the view - descriptor->setPos(HorizSpacing, 1); + descriptor->setPos(HorizSpacing, 0); px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HorizSpacing); //Configuring the labels as follow: [object name] [type] [constraints] @@ -409,7 +409,7 @@ void TableObjectView::configureObject(void) atribs_tip.remove(atribs_tip.length()-2, 2); atribs_tip=QString("\n") + ConstrDelimStart + - QString(" ") + atribs_tip + QString(" ") + ConstrDelimEnd; + QString(" ") + atribs_tip + QString(" ") + ConstrDelimEnd; } @@ -420,16 +420,8 @@ void TableObjectView::configureObject(void) lables[2]->setBrush(fmt.foreground()); lables[2]->setPos(px, 0); - //Calculating the object bounding rect that is composed by the join of the all object's child dimensions descriptor->setPos(HorizSpacing, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); - bounding_rect.setTopLeft(QPointF(descriptor->boundingRect().left(), lables[0]->boundingRect().top())); - - //Special case: when the constraint label has no text use the type label dimension - if(lables[2]->boundingRect().width()==0) - bounding_rect.setBottomRight(QPointF(lables[1]->boundingRect().right(), lables[0]->boundingRect().bottom())); - else - bounding_rect.setBottomRight(QPointF(lables[2]->boundingRect().right(), lables[0]->boundingRect().bottom())); - + calculateBoundingRect(); this->setToolTip(tooltip + atribs_tip); } } @@ -516,12 +508,7 @@ void TableObjectView::configureObject(Reference reference) lables[2]->setText(QString()); descriptor->setPos(HorizSpacing, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); - bounding_rect.setTopLeft(QPointF(descriptor->pos().x(), lables[0]->pos().y())); - - if(lables[2]->text().isEmpty()) - bounding_rect.setBottomRight(QPointF(lables[1]->boundingRect().right(), lables[0]->boundingRect().bottom())); - else - bounding_rect.setBottomRight(QPointF(lables[2]->boundingRect().right(), lables[0]->boundingRect().bottom())); + calculateBoundingRect(); } void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) @@ -533,6 +520,26 @@ void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) descriptor->setPos(px, descriptor->pos().y()); else lables[obj_idx-1]->setPos(px, lables[obj_idx-1]->pos().y()); + + calculateBoundingRect(); +} + +void TableObjectView::calculateBoundingRect(void) +{ + double width = 0, height = 0; + + width = descriptor->boundingRect().width(); + height = descriptor->boundingRect().height(); + + for(int i = 0; i < 3; i++) + { + width += lables[i]->boundingRect().width(); + + if(height < lables[i]->boundingRect().height()) + height = lables[i]->boundingRect().height(); + } + + bounding_rect = QRectF(QPointF(0,0), QSizeF(width, height)); } QGraphicsItem *TableObjectView::getChildObject(unsigned obj_idx) @@ -588,12 +595,28 @@ QString TableObjectView::getConstraintString(Column *column) str_constr+=TextNotNull + ConstrSeparator; if(!str_constr.isEmpty()) - str_constr= ConstrDelimStart + - ConstrSeparator + str_constr + - ConstrDelimEnd; + str_constr= ConstrDelimStart + ConstrSeparator + str_constr + ConstrDelimEnd; return(str_constr); } else return(QString()); } +void TableObjectView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + descriptor->paint(painter, option, widget); + + for(int i = 0 ; i < 3; i++) + { + lables[i]->paint(painter, option, widget); + /*painter->setFont(lables[i]->font()); + painter->setPen(lables[i]->brush().color()); + painter->drawText(lables[i]->pos(), lables[i]->text());*/ + } +} + +QRectF TableObjectView::boundingRect(void) const +{ + return(bounding_rect); +} + diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index 10af2fb7cb..f9b2d90cfc 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -51,6 +51,8 @@ class TableObjectView: public BaseObjectView return(value); } + void calculateBoundingRect(void); + public: static const QString ConstrDelimEnd, ConstrDelimStart, @@ -81,6 +83,10 @@ class TableObjectView: public BaseObjectView /*! \brief Returns a formatted string containing the keywords indicating the constraints that is applyed to the passed column */ static QString getConstraintString(Column *column); + + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); + + virtual QRectF boundingRect(void) const; }; #endif diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 3a03e5599a..a7462b660a 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -98,8 +98,7 @@ void TableView::configureObject(void) col_item=dynamic_cast(subitems[i]); col_item->setSourceObject(tab_obj); col_item->configureObject(); - col_item->moveBy(-col_item->scenePos().x(), - -col_item->scenePos().y()); + col_item->moveBy(-col_item->scenePos().x(),-col_item->scenePos().y()); } else col_item=new TableObjectView(tab_obj); From 544da4d0a625299209c7a9d1c207cd0081649ba2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 1 Nov 2018 01:09:42 -0300 Subject: [PATCH 197/425] Improved TableObjectView to correctly draw table child objects correctly. Pending the fix for drawing view references --- libobjrenderer/src/baseobjectview.cpp | 2 +- libobjrenderer/src/graphicalview.cpp | 4 ++-- libobjrenderer/src/tableobjectview.cpp | 31 +++++++++++++++++--------- libobjrenderer/src/tabletitleview.cpp | 3 +-- libobjrenderer/src/tableview.cpp | 12 ++++------ libpgmodeler_ui/src/pgmodeleruins.cpp | 7 ++++-- 6 files changed, 33 insertions(+), 26 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 482b0e16b7..f9a13c2cb1 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -502,7 +502,7 @@ void BaseObjectView::configureSQLDisabledInfo(void) sql_disabled_box->setBrush(BaseObjectView::getFillStyle(Attributes::PositionInfo)); px=bounding_rect.width() - sql_disabled_box->boundingRect().width() + (1.5 * HorizSpacing), - py=-(sql_disabled_box->boundingRect().height()/2); + py=-(sql_disabled_box->boundingRect().height()/2); sql_disabled_txt->setPos(px + (HorizSpacing * 0.75), py + (VertSpacing * 0.75)); sql_disabled_box->setPos(px, py); diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 64b8478ffc..337a5b2b63 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -128,7 +128,7 @@ void GraphicalView::configureObject(void) col_item->setSourceObject(tab_obj); col_item->configureObject(); col_item->moveBy(-col_item->scenePos().x(), - -col_item->scenePos().y()); + -col_item->scenePos().y()); } else col_item=new TableObjectView(tab_obj); @@ -140,7 +140,7 @@ void GraphicalView::configureObject(void) /* Calculates the width of the name + type of the object. This is used to align all the constraint labels on table */ width=col_item->getChildObject(0)->boundingRect().width() + - col_item->getChildObject(1)->boundingRect().width() + (3 * HorizSpacing); + col_item->getChildObject(1)->boundingRect().width() + (3 * HorizSpacing); if(px < width) px=width; //Gets the maximum width of the column type label to align all at same horizontal position diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index e3285fd807..c863da2ef3 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -297,9 +297,9 @@ void TableObjectView::configureObject(void) //Configuring the constraints label fmt=font_config[Attributes::Constraints]; if(compact_view) - lables[2]->setText(" "); + lables[2]->setText(QString(" ")); else if(column) - lables[2]->setText(str_constr); + lables[2]->setText(!str_constr.isEmpty() ? str_constr : QString(" ")); else { Rule *rule=dynamic_cast(tab_obj); @@ -401,6 +401,8 @@ void TableObjectView::configureObject(void) lables[2]->setText(ConstrDelimStart + QString(" ") + str_constr + QString(" ") + ConstrDelimEnd); + else + lables[2]->setText(QString(" ")); } if(!atribs_tip.isEmpty()) @@ -433,7 +435,7 @@ void TableObjectView::configureObject(Reference reference) QString str_aux; configureDescriptor(); - descriptor->setPos(HorizSpacing, 1); + descriptor->setPos(HorizSpacing, 0); px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HorizSpacing); if(reference.getReferenceType()==Reference::ReferColumn) @@ -482,7 +484,7 @@ void TableObjectView::configureObject(Reference reference) lables[0]->setText(str_aux); lables[0]->setFont(fmt.font()); lables[0]->setBrush(fmt.foreground()); - lables[1]->setText(QString()); + lables[1]->setText(QString(" ")); lables[0]->setPos(px, 0); px+=lables[0]->boundingRect().width(); } @@ -505,7 +507,10 @@ void TableObjectView::configureObject(Reference reference) lables[2]->setPos(px, 0); } else - lables[2]->setText(QString()); + { + lables[2]->setPos(px, 0); + lables[2]->setText(QString(" ")); + } descriptor->setPos(HorizSpacing, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); calculateBoundingRect(); @@ -528,18 +533,19 @@ void TableObjectView::calculateBoundingRect(void) { double width = 0, height = 0; - width = descriptor->boundingRect().width(); + width = descriptor->pos().x() + descriptor->boundingRect().width(); height = descriptor->boundingRect().height(); for(int i = 0; i < 3; i++) { - width += lables[i]->boundingRect().width(); + if(width < lables[i]->pos().x()) + width = lables[i]->pos().x() + lables[i]->boundingRect().width(); if(height < lables[i]->boundingRect().height()) height = lables[i]->boundingRect().height(); } - bounding_rect = QRectF(QPointF(0,0), QSizeF(width, height)); + bounding_rect = QRectF(QPointF(0,0), QSizeF(width + (4 * HorizSpacing), height)); } QGraphicsItem *TableObjectView::getChildObject(unsigned obj_idx) @@ -604,14 +610,17 @@ QString TableObjectView::getConstraintString(Column *column) void TableObjectView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + painter->save(); + painter->translate(descriptor->pos()); descriptor->paint(painter, option, widget); + painter->restore(); for(int i = 0 ; i < 3; i++) { + painter->save(); + painter->translate(lables[i]->pos()); lables[i]->paint(painter, option, widget); - /*painter->setFont(lables[i]->font()); - painter->setPen(lables[i]->brush().color()); - painter->drawText(lables[i]->pos(), lables[i]->text());*/ + painter->restore(); } } diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index a7a325d9bc..d310daf15b 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -53,7 +53,7 @@ void TableTitleView::configureObject(BaseGraphicObject *object) throw Exception(ErrorCode::OprNotAllocatedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); //Raises an error if the object is invalid else if(object->getObjectType()!=ObjectType::Table && - object->getObjectType()!=ObjectType::View) + object->getObjectType()!=ObjectType::View) throw Exception(ErrorCode::OprObjectInvalidType, __PRETTY_FUNCTION__, __FILE__, __LINE__); schema=dynamic_cast(object->getSchema()); @@ -72,7 +72,6 @@ void TableTitleView::configureObject(BaseGraphicObject *object) title_color_attrib=Attributes::TableTitle; } - //Strike out the table name when its sql is disabled fmt=font_config[schema_name_attrib]; font=fmt.font(); schema_name->setFont(font); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index a7462b660a..df4d795e25 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -78,7 +78,7 @@ void TableView::configureObject(void) //Gets the subitems of the current group subitems=groups[obj_idx]->childItems(); groups[obj_idx]->moveBy(-groups[obj_idx]->scenePos().x(), - -groups[obj_idx]->scenePos().y()); + -groups[obj_idx]->scenePos().y()); count=tab_objs.size(); //Special case: if there is no item on extended attributes, the extended body is hidden @@ -110,7 +110,7 @@ void TableView::configureObject(void) /* Calculates the width of the name + type of the object. This is used to align all the constraint labels on table */ width=col_item->getChildObject(0)->boundingRect().width() + - col_item->getChildObject(1)->boundingRect().width() + (6 * HorizSpacing); + col_item->getChildObject(1)->boundingRect().width() + (5 * HorizSpacing); if(px < width) px=width; @@ -139,9 +139,7 @@ void TableView::configureObject(void) col_item->setChildObjectXPos(2, px); //Positioning the constraints label - col_item->setChildObjectXPos(3, px + - ((col_item->getChildObject(2)->boundingRect().width() + - col_item->getChildObject(3)->boundingRect().width()) * 0.90)); + col_item->setChildObjectXPos(3, px + (col_item->getChildObject(2)->boundingRect().width() * 1.05)); groups[obj_idx]->addToGroup(col_item); } @@ -184,9 +182,7 @@ void TableView::configureObject(void) { col_item=dynamic_cast(subitems.front()); subitems.pop_front(); - col_item->setChildObjectXPos(3, width - - col_item->boundingRect().width() - (2 * HorizSpacing) - 1); - + col_item->setChildObjectXPos(3, width - col_item->getChildObject(3)->boundingRect().width() - (2 * HorizSpacing) - 1); //Generating the connection points of the columns if(obj_idx==0) diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 61743e46e6..053f6ec373 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -104,6 +104,9 @@ namespace PgModelerUiNs { object->setSQLDisabled(disable); + if(TableObject::isTableObject(object->getObjectType())) + dynamic_cast(object)->getParentTable()->setModified(true); + if(obj_type!=ObjectType::Database && curr_val!=disable) { msgbox.show(QString(QT_TR_NOOP("Do you want to apply the SQL %1 status to the object's references too? This will avoid problems when exporting or validating the model.")).arg(disable ? QT_TR_NOOP("disabling") : QT_TR_NOOP("enabling")), @@ -114,7 +117,7 @@ namespace PgModelerUiNs { } /* Special case for tables. When disable the code there is the need to disable constraints - codes when the code of parent table is disabled too in order to avoid export errors */ + * codes when the code of parent table is disabled too in order to avoid export errors */ if(object->getObjectType()==ObjectType::Table) { Constraint *constr = nullptr; @@ -125,7 +128,7 @@ namespace PgModelerUiNs { constr=dynamic_cast(obj); /* If the constraint is not FK but is declared outside table via alter (ALTER TABLE...ADD CONSTRAINT...) or - The constraint is FK and the reference table is disabled the FK will not be enabled */ + * The constraint is FK and the reference table is disabled the FK will not be enabled */ if((constr->getConstraintType()!=ConstraintType::ForeignKey && !constr->isDeclaredInTable()) || (constr->getConstraintType()==ConstraintType::ForeignKey && (disable || (!disable && !constr->getReferencedTable()->isSQLDisabled())))) From d8c075bcee087bbea765a32f62886b5901bcd8ac Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 1 Nov 2018 11:04:50 -0300 Subject: [PATCH 198/425] Fixed the rendering of view references --- libobjrenderer/src/graphicalview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 337a5b2b63..716f0cc850 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -212,8 +212,7 @@ void GraphicalView::configureObject(void) { col_item=dynamic_cast(subitems.front()); subitems.pop_front(); - col_item->setChildObjectXPos(3, width - - col_item->boundingRect().width() - (2 * HorizSpacing) - 1); + col_item->setChildObjectXPos(3, width - col_item->getChildObject(3)->boundingRect().width() - (2 * HorizSpacing)); } } From 197bf2b5987b0ec439d02a9ba7c84b31d70832b4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 1 Nov 2018 15:07:09 -0300 Subject: [PATCH 199/425] Created the class TextPolygonItem which can be used to draw a text over a background polygon. Replace the tag_body and tag_name elements by the tag_item which is a instance of TextPolygonItem --- libobjrenderer/libobjrenderer.pro | 6 +- libobjrenderer/src/baseobjectview.cpp | 29 ++------ libobjrenderer/src/baseobjectview.h | 4 +- libobjrenderer/src/basetableview.cpp | 44 +++++------- libobjrenderer/src/basetableview.h | 5 +- libobjrenderer/src/relationshipview.cpp | 6 +- libobjrenderer/src/styledtextboxview.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 9 +-- libobjrenderer/src/tabletitleview.cpp | 2 +- libobjrenderer/src/textboxview.cpp | 4 +- libobjrenderer/src/textpolygonitem.cpp | 91 ++++++++++++++++++++++++ libobjrenderer/src/textpolygonitem.h | 66 +++++++++++++++++ 12 files changed, 197 insertions(+), 71 deletions(-) create mode 100644 libobjrenderer/src/textpolygonitem.cpp create mode 100644 libobjrenderer/src/textpolygonitem.h diff --git a/libobjrenderer/libobjrenderer.pro b/libobjrenderer/libobjrenderer.pro index c01064dd1d..b0a69a67d3 100644 --- a/libobjrenderer/libobjrenderer.pro +++ b/libobjrenderer/libobjrenderer.pro @@ -25,7 +25,8 @@ HEADERS += src/baseobjectview.h \ src/schemaview.h \ src/roundedrectitem.h \ src/styledtextboxview.h \ - src/beziercurveitem.h + src/beziercurveitem.h \ + src/textpolygonitem.h SOURCES += src/baseobjectview.cpp \ src/textboxview.cpp \ @@ -39,7 +40,8 @@ SOURCES += src/baseobjectview.cpp \ src/schemaview.cpp \ src/roundedrectitem.cpp \ src/styledtextboxview.cpp \ - src/beziercurveitem.cpp + src/beziercurveitem.cpp \ + src/textpolygonitem.cpp unix|windows: LIBS += -L$$OUT_PWD/../libpgmodeler/ -lpgmodeler \ -L$$OUT_PWD/../libparsers/ -lparsers \ diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index f9a13c2cb1..9352a3d429 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -179,27 +179,6 @@ BaseObject *BaseObjectView::getSourceObject(void) return(reinterpret_cast(this->data(0).value())); } -void BaseObjectView::resizePolygon(QPolygonF &pol, double width, double height) -{ - QVector::iterator itr,itr_end; - double coef_a, coef_b; - - itr=pol.begin(); - itr_end=pol.end(); - - //Calculates the resize factor - coef_a=width / pol.boundingRect().width(); - coef_b=height / pol.boundingRect().height(); - - //Applies the resize factor to all the polygon points - while(itr!=itr_end) - { - itr->setX(itr->x() * coef_a); - itr->setY(itr->y() * coef_b); - itr++; - } -} - void BaseObjectView::loadObjectsStyle(void) { QTextCharFormat font_fmt; @@ -557,8 +536,8 @@ void BaseObjectView::configureProtectedIcon(void) pol.append(QPointF(4,3)); pol.append(QPointF(4,5)); if(factor!=1.0f) - this->resizePolygon(pol, pol.boundingRect().width() * factor, - pol.boundingRect().height() * factor); + TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor, + pol.boundingRect().height() * factor); pol_item=dynamic_cast(protected_icon->childItems().at(0)); pol_item->setPolygon(pol); @@ -572,8 +551,8 @@ void BaseObjectView::configureProtectedIcon(void) pol.append(QPointF(0,9)); pol.append(QPointF(0,6)); if(factor!=1.0f) - this->resizePolygon(pol, pol.boundingRect().width() * factor, - pol.boundingRect().height() * factor); + TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor, + pol.boundingRect().height() * factor); pol_item=dynamic_cast(protected_icon->childItems().at(1)); pol_item->setPolygon(pol); diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 3bf705b87e..2a57a8f173 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -30,6 +30,7 @@ #include "baserelationship.h" #include "xmlparser.h" #include "roundedrectitem.h" +#include "textpolygonitem.h" class BaseObjectView: public QObject, public QGraphicsItemGroup { private: @@ -91,9 +92,6 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { //! \brief Stores the object colors configuration static map> color_config; - //! \brief Resizes to the specified dimension the passed polygon - void resizePolygon(QPolygonF &pol, double width, double height); - //! \brief Configures the objects shadow polygon void configureObjectShadow(void); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 17149dc4a4..ff0a7bc445 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -47,11 +47,8 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) columns=new QGraphicsItemGroup; columns->setZValue(1); - tag_name=new QGraphicsSimpleTextItem; - tag_name->setZValue(3); - - tag_body=new QGraphicsPolygonItem; - tag_body->setZValue(2); + tag_item = new TextPolygonItem; + tag_item->setZValue(3); obj_shadow=new RoundedRectItem; obj_shadow->setZValue(-1); @@ -65,8 +62,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) this->addToGroup(columns); this->addToGroup(body); this->addToGroup(title); - this->addToGroup(tag_name); - this->addToGroup(tag_body); + this->addToGroup(tag_item); this->addToGroup(ext_attribs); this->addToGroup(ext_attribs_body); this->addToGroup(ext_attribs_toggler); @@ -86,8 +82,7 @@ BaseTableView::~BaseTableView(void) this->removeFromGroup(ext_attribs_tog_arrow); this->removeFromGroup(ext_attribs); this->removeFromGroup(columns); - this->removeFromGroup(tag_name); - this->removeFromGroup(tag_body); + this->removeFromGroup(tag_item); delete(ext_attribs_tog_arrow); delete(ext_attribs_toggler); delete(ext_attribs_body); @@ -95,8 +90,7 @@ BaseTableView::~BaseTableView(void) delete(body); delete(title); delete(columns); - delete(tag_name); - delete(tag_body); + delete(tag_item); } void BaseTableView::setHideExtAttributes(bool value) @@ -254,7 +248,7 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) //Sets the selection position as same as item's position rect1=this->mapRectToItem(item, item->boundingRect()); obj_selection->setVisible(true); - obj_selection->setPos(QPointF(title->pos().x() + HorizSpacing,-rect1.top())); + obj_selection->setPos(QPointF(title->pos().x(), -rect1.top())); //Stores the selected child object sel_child_obj=dynamic_cast(item->getSourceObject()); @@ -312,8 +306,7 @@ void BaseTableView::configureTag(void) BaseTable *tab=dynamic_cast(this->getSourceObject()); Tag *tag=tab->getTag(); - tag_body->setVisible(tag!=nullptr && !hide_tags); - tag_name->setVisible(tag!=nullptr && !hide_tags); + tag_item->setVisible(tag!=nullptr && !hide_tags); if(!hide_tags && tag) { @@ -323,12 +316,12 @@ void BaseTableView::configureTag(void) QFont fnt=BaseObjectView::getFontStyle(Attributes::Tag).font(); fnt.setPointSizeF(fnt.pointSizeF() * 0.80f); - tag_name->setFont(fnt); - tag_name->setText(tag->getName()); - tag_name->setBrush(BaseObjectView::getFontStyle(Attributes::Tag).foreground()); + tag_item->setFont(fnt); + tag_item->setText(tag->getName()); + tag_item->setBrush(BaseObjectView::getFontStyle(Attributes::Tag).foreground()); - p1=tag_name->boundingRect().topLeft(); - p2=tag_name->boundingRect().bottomRight(); + p1=tag_item->getTextBoundingRect().topLeft(); + p2=tag_item->getTextBoundingRect().bottomRight(); bottom=this->boundingRect().bottom(); pol.append(QPointF(p1.x()-BaseObjectView::HorizSpacing, p1.y() - BaseObjectView::VertSpacing)); @@ -338,12 +331,11 @@ void BaseTableView::configureTag(void) pol.append(QPointF(p1.x(), p2.y() + BaseObjectView::VertSpacing)); pol.append(QPointF(p1.x()-BaseObjectView::HorizSpacing, p2.y() + BaseObjectView::VertSpacing)); - tag_body->setPolygon(pol); - tag_body->setPen(BaseObjectView::getBorderStyle(Attributes::Tag)); - tag_body->setBrush(BaseObjectView::getFillStyle(Attributes::Tag)); - - tag_name->setPos(-5, bottom - 1.5f); - tag_body->setPos(-5, bottom - 1.5f); + tag_item->setPolygon(pol); + tag_item->setPen(BaseObjectView::getBorderStyle(Attributes::Tag)); + tag_item->setBrush(BaseObjectView::getFillStyle(Attributes::Tag)); + tag_item->setPos(-5, bottom - 1.5f); + tag_item->setTextPos(-5, bottom - 1.5f); } } @@ -453,7 +445,7 @@ float BaseTableView::calculateWidth(void) if(!columns->childItems().isEmpty() && (columns->boundingRect().width() > title->boundingRect().width() && (hide_ext_attribs || dynamic_cast(this->getSourceObject())->isExtAttribsHidden() || - (columns->boundingRect().width() > ext_attribs->boundingRect().width())))) + (columns->boundingRect().width() >= ext_attribs->boundingRect().width())))) return(columns->boundingRect().width() + (2 * HorizSpacing)); if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 1dc1ddb9d6..3512ad7195 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -31,6 +31,7 @@ #include "tableobjectview.h" #include "roundedrectitem.h" #include "baserelationship.h" +#include "textpolygonitem.h" class BaseTableView: public BaseObjectView { private: @@ -56,9 +57,9 @@ class BaseTableView: public BaseObjectView { *ext_attribs_toggler; - QGraphicsPolygonItem *tag_body, *ext_attribs_tog_arrow; + QGraphicsPolygonItem *ext_attribs_tog_arrow; - QGraphicsSimpleTextItem *tag_name; + TextPolygonItem *tag_item; //! \brief Stores the reference to the child object currently selected on table TableObject *sel_child_obj; diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 5bf3d88986..1d1455a088 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1332,9 +1332,9 @@ void RelationshipView::configureDescriptor(void) //Resizes the polygon according the font factor if(factor!=1.0f) - this->resizePolygon(pol, - pol.boundingRect().width() * factor , - pol.boundingRect().height() * factor); + TextPolygonItem::resizePolygon(pol, + pol.boundingRect().width() * factor , + pol.boundingRect().height() * factor); if(base_rel->isSelfRelationship()) pnt=points.at(points.size()/2); diff --git a/libobjrenderer/src/styledtextboxview.cpp b/libobjrenderer/src/styledtextboxview.cpp index c37f0f9efc..c783e2c33b 100644 --- a/libobjrenderer/src/styledtextboxview.cpp +++ b/libobjrenderer/src/styledtextboxview.cpp @@ -37,7 +37,7 @@ void StyledTextboxView::configureObject(void) if(rect.height() < fold->boundingRect().height()) rect.setHeight(fold->boundingRect().height() + (2 * VertSpacing)); - this->resizePolygon(pol, rect.width() + fold->boundingRect().width(), rect.height()); + TextPolygonItem::resizePolygon(pol, rect.width() + fold->boundingRect().width(), rect.height()); pnt=pol.at(2); pol.remove(2); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index c863da2ef3..41e13b57fe 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -138,9 +138,8 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) } if(factor!=1.0f) - this->resizePolygon(pol, - pol.boundingRect().width() * factor, - pol.boundingRect().height() * factor); + TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor, + pol.boundingRect().height() * factor); desc->setPolygon(pol); desc->setBrush(this->getFillStyle(attrib)); @@ -160,9 +159,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) pol.append(QPointF(9,9)); pol.append(QPointF(9,4)); if(factor!=1.0f) - this->resizePolygon(pol, - pol.boundingRect().width() * factor , - pol.boundingRect().height() * factor); + TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor , pol.boundingRect().height() * factor); desc->setPolygon(pol); desc->setBrush(this->getFillStyle(tab_obj->getSchemaName())); diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index d310daf15b..fb2edeae71 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -139,7 +139,7 @@ void TableTitleView::resizeTitle(double width, double height) obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), py); } - this->bounding_rect.setTopLeft(this->pos()); + this->bounding_rect.setTopLeft(QPointF(0,0)); this->bounding_rect.setSize(QSizeF(box->boundingRect().width(), box->boundingRect().height())); } diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index a8c3c7e5da..48e4e1765c 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -109,8 +109,8 @@ void TextboxView::__configureObject(void) else text->setPos(HorizSpacing, VertSpacing); - this->resizePolygon(polygon, roundf(text->boundingRect().width() + (2.5 * HorizSpacing)), - roundf(text->boundingRect().height() + (1.5 * VertSpacing))); + TextPolygonItem::resizePolygon(polygon, roundf(text->boundingRect().width() + (2.5 * HorizSpacing)), + roundf(text->boundingRect().height() + (1.5 * VertSpacing))); box->setPos(0,0); box->setPolygon(polygon); diff --git a/libobjrenderer/src/textpolygonitem.cpp b/libobjrenderer/src/textpolygonitem.cpp new file mode 100644 index 0000000000..45db31f199 --- /dev/null +++ b/libobjrenderer/src/textpolygonitem.cpp @@ -0,0 +1,91 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "textpolygonitem.h" + +TextPolygonItem::TextPolygonItem(QGraphicsItem *parent) : QGraphicsPolygonItem(parent) +{ + text_item = new QGraphicsSimpleTextItem; +} + +TextPolygonItem::~TextPolygonItem(void) +{ + delete(text_item); +} + +void TextPolygonItem::setText(const QString &text) +{ + text_item->setText(text); +} + +void TextPolygonItem::setTextPen(const QPen &pen) +{ + text_item->setPen(pen); +} + +void TextPolygonItem::setTextBrush(const QBrush &brush) +{ + text_item->setBrush(brush); +} + +QRectF TextPolygonItem::getTextBoundingRect(void) +{ + return(text_item->boundingRect()); +} + +void TextPolygonItem::setTextPos(const QPointF &pos) +{ + text_item->setPos(pos); +} + +void TextPolygonItem::setTextPos(double x, double y) +{ + text_item->setPos(x, y); +} + +void TextPolygonItem::setFont(const QFont &fnt) +{ + text_item->setFont(fnt); +} + +void TextPolygonItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + QGraphicsPolygonItem::paint(painter, option, widget); + text_item->paint(painter, option, widget); +} + +void TextPolygonItem::resizePolygon(QPolygonF &pol, double width, double height) +{ + QVector::iterator itr,itr_end; + double coef_a, coef_b; + + itr=pol.begin(); + itr_end=pol.end(); + + //Calculates the resize factor + coef_a=width / pol.boundingRect().width(); + coef_b=height / pol.boundingRect().height(); + + //Applies the resize factor to all the polygon points + while(itr!=itr_end) + { + itr->setX(itr->x() * coef_a); + itr->setY(itr->y() * coef_b); + itr++; + } +} diff --git a/libobjrenderer/src/textpolygonitem.h b/libobjrenderer/src/textpolygonitem.h new file mode 100644 index 0000000000..fee085f68c --- /dev/null +++ b/libobjrenderer/src/textpolygonitem.h @@ -0,0 +1,66 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libobjrenderer +\class TextPolygonItem +\brief This specialization of QGraphicsPolygonItem allows a text to be drawn over a polygonal element +*/ + +#ifndef TEXT_POLYGON_ITEM_H +#define TEXT_POLYGON_ITEM_H + +#include +#include +#include +#include + +class TextPolygonItem : public QGraphicsPolygonItem { + private: + QGraphicsSimpleTextItem *text_item; + + public: + TextPolygonItem(QGraphicsItem *parent = nullptr); + ~TextPolygonItem(void); + + //! \brief Defines the text displayed by the item + void setText(const QString &text); + + //! \brief Defines the position of the text element (in local coordinate) + void setTextPos(const QPointF &pos); + void setTextPos(double x, double y); + + //! \brief Defines the pen used by the text element + void setTextPen(const QPen &pen); + + //! \brief Defines the brush used by the text element + void setTextBrush(const QBrush &brush); + + //! \brief Returns the bounding rect of the text item + QRectF getTextBoundingRect(void); + + //! \brief Sets the font used by the text item + void setFont(const QFont &fnt); + + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); + + //! \brief Resizes to the specified dimension the passed polygon + static void resizePolygon(QPolygonF &pol, double width, double height); +}; + +#endif From 21f95bacad5828f02a7a4fd9a632ec8d7dd45e0a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 1 Nov 2018 15:47:23 -0300 Subject: [PATCH 200/425] Replaced the sql_info_txt and sql_info_box items by an single isntance of TextPolygonItem to denote SQL disabled status --- libobjrenderer/src/baseobjectview.cpp | 93 +++++++++++++------------ libobjrenderer/src/baseobjectview.h | 10 +-- libobjrenderer/src/basetableview.cpp | 16 ++--- libobjrenderer/src/relationshipview.cpp | 13 ++-- libobjrenderer/src/textpolygonitem.cpp | 2 + 5 files changed, 68 insertions(+), 66 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 9352a3d429..807c58ddd0 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -32,10 +32,10 @@ BaseObjectView::BaseObjectView(BaseObject *object) protected_icon=nullptr; obj_shadow=nullptr; obj_selection=nullptr; - pos_info_rect=nullptr; - pos_info_txt=nullptr; - sql_disabled_txt=nullptr; - sql_disabled_box=nullptr; + pos_info_item=nullptr; + //sql_disabled_txt=nullptr; + //sql_disabled_box=nullptr; + sql_disabled_item=nullptr; placeholder=nullptr; setSourceObject(object); } @@ -93,18 +93,14 @@ void BaseObjectView::setSourceObject(BaseObject *object) protected_icon=nullptr; } - if(pos_info_txt) + if(pos_info_item) { - this->removeFromGroup(pos_info_txt); - delete(pos_info_txt); - pos_info_txt=nullptr; - - this->removeFromGroup(pos_info_rect); - delete(pos_info_rect); - pos_info_rect=nullptr; + this->removeFromGroup(pos_info_item); + delete(pos_info_item); + pos_info_item=nullptr; } - if(sql_disabled_box) + /*if(sql_disabled_box) { this->removeFromGroup(sql_disabled_txt); delete(sql_disabled_txt); @@ -113,6 +109,13 @@ void BaseObjectView::setSourceObject(BaseObject *object) this->removeFromGroup(sql_disabled_box); delete(sql_disabled_box); sql_disabled_box=nullptr; + }*/ + + if(sql_disabled_item) + { + this->removeFromGroup(sql_disabled_item); + delete(sql_disabled_item); + sql_disabled_item=nullptr; } if(placeholder) @@ -150,18 +153,14 @@ void BaseObjectView::setSourceObject(BaseObject *object) this->addToGroup(protected_icon); } - if(!pos_info_txt) + if(!pos_info_item) { - pos_info_rect=new QGraphicsRectItem; - pos_info_txt=new QGraphicsSimpleTextItem; - pos_info_rect->setZValue(9); - pos_info_txt->setZValue(10); - - this->addToGroup(pos_info_rect); - this->addToGroup(pos_info_txt); + pos_info_item=new TextPolygonItem; + pos_info_item->setZValue(10); + this->addToGroup(pos_info_item); } - if(!sql_disabled_box && object->getObjectType()!=ObjectType::Textbox) + /* if(!sql_disabled_box && object->getObjectType()!=ObjectType::Textbox) { sql_disabled_txt=new QGraphicsSimpleTextItem; sql_disabled_box=new QGraphicsRectItem; @@ -170,6 +169,13 @@ void BaseObjectView::setSourceObject(BaseObject *object) this->addToGroup(sql_disabled_box); this->addToGroup(sql_disabled_txt); + } */ + + if(!sql_disabled_item && object->getObjectType()!=ObjectType::Textbox) + { + sql_disabled_item=new TextPolygonItem; + sql_disabled_item->setZValue(100); + this->addToGroup(sql_disabled_item); } } } @@ -402,8 +408,7 @@ QVariant BaseObjectView::itemChange(GraphicsItemChange change, const QVariant &v else if(change == ItemSelectedHasChanged && obj_selection) { this->setSelectionOrder(value.toBool()); - pos_info_rect->setVisible(value.toBool()); - pos_info_txt->setVisible(value.toBool()); + pos_info_item->setVisible(value.toBool()); obj_selection->setVisible(value.toBool()); this->configurePositionInfo(this->pos()); @@ -443,28 +448,26 @@ void BaseObjectView::configurePositionInfo(QPointF pos) { QFont fnt=font_config[Attributes::PositionInfo].font(); - pos_info_rect->setBrush(BaseObjectView::getFillStyle(Attributes::PositionInfo)); - pos_info_rect->setPen(BaseObjectView::getBorderStyle(Attributes::PositionInfo)); + pos_info_item->setBrush(BaseObjectView::getFillStyle(Attributes::PositionInfo)); + pos_info_item->setPen(BaseObjectView::getBorderStyle(Attributes::PositionInfo)); fnt.setPointSizeF(fnt.pointSizeF() * 0.95); - pos_info_txt->setFont(fnt); - pos_info_txt->setBrush(font_config[Attributes::PositionInfo].foreground()); + pos_info_item->setFont(fnt); + pos_info_item->setTextBrush(font_config[Attributes::PositionInfo].foreground()); - pos_info_txt->setText(QString(" x:%1 y:%2 ").arg(roundf(pos.x())).arg(roundf(pos.y()))); - pos_info_rect->setRect(pos_info_txt->boundingRect()); - pos_info_txt->setPos(-0.5, -pos_info_txt->boundingRect().height()/2); - pos_info_rect->setPos(-0.5, -pos_info_rect->boundingRect().height()/2); + pos_info_item->setText(QString(" x:%1 y:%2 ").arg(roundf(pos.x())).arg(roundf(pos.y()))); + pos_info_item->setPolygon(QPolygonF(pos_info_item->getTextBoundingRect())); + pos_info_item->setPos(-0.5, -pos_info_item->boundingRect().height()/2); } } void BaseObjectView::configureSQLDisabledInfo(void) { - if(sql_disabled_box) + if(sql_disabled_item) { double px=0, py=0; - sql_disabled_txt->setVisible(this->getSourceObject()->isSQLDisabled()); - sql_disabled_box->setVisible(this->getSourceObject()->isSQLDisabled()); + sql_disabled_item->setVisible(this->getSourceObject()->isSQLDisabled()); if(this->getSourceObject()->isSQLDisabled()) { @@ -472,19 +475,19 @@ void BaseObjectView::configureSQLDisabledInfo(void) char_fmt=BaseObjectView::getFontStyle(Attributes::PositionInfo); char_fmt.setFontPointSize(char_fmt.font().pointSizeF() * 0.80); - sql_disabled_txt->setFont(char_fmt.font()); - sql_disabled_txt->setText(trUtf8("SQL off")); - sql_disabled_txt->setBrush(char_fmt.foreground()); + sql_disabled_item->setFont(char_fmt.font()); + sql_disabled_item->setText(trUtf8("SQL off")); + sql_disabled_item->setTextBrush(char_fmt.foreground()); - sql_disabled_box->setRect(QRectF(QPointF(0,0), sql_disabled_txt->boundingRect().size() + QSizeF(1.5 * HorizSpacing, 1.5 * VertSpacing))); - sql_disabled_box->setPen(BaseObjectView::getBorderStyle(Attributes::PositionInfo)); - sql_disabled_box->setBrush(BaseObjectView::getFillStyle(Attributes::PositionInfo)); + sql_disabled_item->setPolygon(QRectF(QPointF(0,0), sql_disabled_item->getTextBoundingRect().size() + QSizeF(1.5 * HorizSpacing, 1.5 * VertSpacing))); + sql_disabled_item->setPen(BaseObjectView::getBorderStyle(Attributes::PositionInfo)); + sql_disabled_item->setBrush(BaseObjectView::getFillStyle(Attributes::PositionInfo)); - px=bounding_rect.width() - sql_disabled_box->boundingRect().width() + (1.5 * HorizSpacing), - py=-(sql_disabled_box->boundingRect().height()/2); + px=bounding_rect.width() - sql_disabled_item->boundingRect().width() + (1.5 * HorizSpacing), + py=-(sql_disabled_item->boundingRect().height()/2); - sql_disabled_txt->setPos(px + (HorizSpacing * 0.75), py + (VertSpacing * 0.75)); - sql_disabled_box->setPos(px, py); + sql_disabled_item->setPos(px, py); + sql_disabled_item->setTextPos(HorizSpacing * 0.75, VertSpacing * 0.75); } } } diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 2a57a8f173..4f8c6efd9a 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -59,11 +59,8 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { mainly when creating relationships between tables. */ unsigned sel_order; - //! \brief Graphical text for the position info - QGraphicsSimpleTextItem *pos_info_txt; - - //! \brief Graphical object (rectangle) of the position info - QGraphicsRectItem *pos_info_rect; + //! \brief This item display the current object position on the scene + TextPolygonItem *pos_info_item; //! \brief Stores the objects bounding rect QRectF bounding_rect; @@ -86,6 +83,9 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { //! \brief Graphical text for the sql disabled info QGraphicsSimpleTextItem *sql_disabled_txt; + //! \brief This items is used to display the sql disabled status of the object + TextPolygonItem *sql_disabled_item; + //! \brief Stores the object font configuration static map font_config; diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index ff0a7bc445..22c112a152 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -248,7 +248,7 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) //Sets the selection position as same as item's position rect1=this->mapRectToItem(item, item->boundingRect()); obj_selection->setVisible(true); - obj_selection->setPos(QPointF(title->pos().x(), -rect1.top())); + obj_selection->setPos(QPointF(title->pos().x() + HorizSpacing, -rect1.top())); //Stores the selected child object sel_child_obj=dynamic_cast(item->getSourceObject()); @@ -324,18 +324,18 @@ void BaseTableView::configureTag(void) p2=tag_item->getTextBoundingRect().bottomRight(); bottom=this->boundingRect().bottom(); - pol.append(QPointF(p1.x()-BaseObjectView::HorizSpacing, p1.y() - BaseObjectView::VertSpacing)); - pol.append(QPointF(p2.x(), p1.y() - BaseObjectView::VertSpacing)); - pol.append(QPointF(p2.x() + BaseObjectView::HorizSpacing + 5, p2.y()/2)); - pol.append(QPointF(p2.x(), p2.y() + BaseObjectView::VertSpacing)); - pol.append(QPointF(p1.x(), p2.y() + BaseObjectView::VertSpacing)); - pol.append(QPointF(p1.x()-BaseObjectView::HorizSpacing, p2.y() + BaseObjectView::VertSpacing)); + pol.append(QPointF(p1.x()- HorizSpacing, p1.y() - VertSpacing)); + pol.append(QPointF(p2.x(), p1.y() - VertSpacing)); + pol.append(QPointF(p2.x() + HorizSpacing + 5, p2.y()/2)); + pol.append(QPointF(p2.x(), p2.y() + VertSpacing)); + pol.append(QPointF(p1.x(), p2.y() + VertSpacing)); + pol.append(QPointF(p1.x()-HorizSpacing, p2.y() + VertSpacing)); tag_item->setPolygon(pol); tag_item->setPen(BaseObjectView::getBorderStyle(Attributes::Tag)); tag_item->setBrush(BaseObjectView::getFillStyle(Attributes::Tag)); tag_item->setPos(-5, bottom - 1.5f); - tag_item->setTextPos(-5, bottom - 1.5f); + tag_item->setTextPos(HorizSpacing/2, 0); } } diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 1d1455a088..7c98ac07c6 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -231,8 +231,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant vector rel_lines; this->setSelectionOrder(value.toBool()); - pos_info_rect->setVisible(value.toBool()); - pos_info_txt->setVisible(value.toBool()); + pos_info_item->setVisible(value.toBool()); obj_selection->setVisible(value.toBool() && descriptor->isVisible()); this->configurePositionInfo(); @@ -567,10 +566,8 @@ void RelationshipView::configurePositionInfo(void) if(this->isSelected()) { BaseObjectView::configurePositionInfo(descriptor->pos()); - pos_info_txt->setPos(descriptor->pos().x(), - descriptor->pos().y() - pos_info_txt->boundingRect().height()); - pos_info_rect->setPos(descriptor->pos().x(), - descriptor->pos().y() - pos_info_rect->boundingRect().height()); + pos_info_item->setPos(descriptor->pos().x(), + descriptor->pos().y() - pos_info_item->boundingRect().height()); } } @@ -1404,8 +1401,8 @@ void RelationshipView::configureDescriptor(void) configureSQLDisabledInfo(); x1+=6 * HorizSpacing; y1-=3 * VertSpacing; - sql_disabled_box->setPos(x1, y1); - sql_disabled_txt->setPos(x1 + HorizSpacing, y1 + VertSpacing); + sql_disabled_item->setPos(x1, y1); + //sql_disabled_item->setTextPos(x1 + HorizSpacing, y1 + VertSpacing); descriptor->setPolygon(pol); descriptor->setTransformOriginPoint(descriptor->boundingRect().center()); diff --git a/libobjrenderer/src/textpolygonitem.cpp b/libobjrenderer/src/textpolygonitem.cpp index 45db31f199..d71601739c 100644 --- a/libobjrenderer/src/textpolygonitem.cpp +++ b/libobjrenderer/src/textpolygonitem.cpp @@ -66,6 +66,8 @@ void TextPolygonItem::setFont(const QFont &fnt) void TextPolygonItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { QGraphicsPolygonItem::paint(painter, option, widget); + + painter->translate(text_item->pos()); text_item->paint(painter, option, widget); } From 478cbdf282964ea75d1c17de6ab6537362ea04ab Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 1 Nov 2018 21:54:53 -0300 Subject: [PATCH 201/425] Minor improvement in TextboxView to use only a TextPolygonItem to hold text and the object's rectangle instead of a box and a text items --- libobjrenderer/src/styledtextboxview.cpp | 16 +++---- libobjrenderer/src/textboxview.cpp | 56 +++++++++++------------- libobjrenderer/src/textboxview.h | 3 ++ libobjrenderer/src/textpolygonitem.cpp | 5 +++ libobjrenderer/src/textpolygonitem.h | 2 + 5 files changed, 43 insertions(+), 39 deletions(-) diff --git a/libobjrenderer/src/styledtextboxview.cpp b/libobjrenderer/src/styledtextboxview.cpp index c783e2c33b..8634e03949 100644 --- a/libobjrenderer/src/styledtextboxview.cpp +++ b/libobjrenderer/src/styledtextboxview.cpp @@ -9,9 +9,9 @@ StyledTextboxView::StyledTextboxView(Textbox *txtbox, bool override_style) : Tex pol.append(QPointF(0,20)); fold=new QGraphicsPolygonItem; - this->addToGroup(fold); fold->setPolygon(pol); + this->addToGroup(fold); this->configureObject(); } @@ -28,11 +28,11 @@ void StyledTextboxView::configureObject(void) QPointF pnt; this->__configureObject(); - fold->setBrush(box->brush()); - fold->setPen(box->pen()); + fold->setBrush(text_item->brush()); + fold->setPen(text_item->pen()); - rect=box->boundingRect(); - pol=box->polygon(); + rect = text_item->boundingRect(); + pol = text_item->polygon(); if(rect.height() < fold->boundingRect().height()) rect.setHeight(fold->boundingRect().height() + (2 * VertSpacing)); @@ -43,11 +43,11 @@ void StyledTextboxView::configureObject(void) pol.remove(2); pol.insert(2, QPointF(pnt.x(), roundf(pnt.y() - fold->boundingRect().height()))); pol.insert(3, QPointF(roundf(pnt.x() - fold->boundingRect().width()), pnt.y())); - box->setPolygon(pol); - rect=box->boundingRect(); + text_item->setPolygon(pol); + rect = text_item->boundingRect(); fold->setPos(rect.width() - fold->boundingRect().width(), - rect.height() - fold->boundingRect().height()); + rect.height() - fold->boundingRect().height()); this->configureObjectShadow(); this->configureObjectSelection(); diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 48e4e1765c..b8a8d778e5 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -26,8 +26,8 @@ TextboxView::TextboxView(Textbox *txtbox, bool override_style) : BaseObjectView( box=new QGraphicsPolygonItem; text=new QGraphicsSimpleTextItem; - box->setZValue(0); - text->setZValue(1); + text_item = new TextPolygonItem; + this->addToGroup(text_item); obj_shadow=new QGraphicsPolygonItem; obj_shadow->setZValue(-1); @@ -39,25 +39,21 @@ TextboxView::TextboxView(Textbox *txtbox, bool override_style) : BaseObjectView( this->addToGroup(obj_selection); this->override_style=override_style; - this->addToGroup(text); - this->addToGroup(box); this->configureObject(); } TextboxView::~TextboxView(void) { - this->removeFromGroup(box); - this->removeFromGroup(text); - delete(box); - delete(text); + this->removeFromGroup(text_item); + delete(text_item); } void TextboxView::setColorStyle(const QBrush &fill_style, const QPen &border_style) { if(override_style) { - box->setBrush(fill_style); - box->setPen(border_style); + text_item->setBrush(fill_style); + text_item->setPen(border_style); } } @@ -65,8 +61,8 @@ void TextboxView::setFontStyle(const QTextCharFormat &fmt) { if(override_style) { - text->setFont(fmt.font()); - text->setBrush(fmt.foreground()); + text_item->setFont(fmt.font()); + text_item->setTextBrush(fmt.foreground()); } } @@ -89,8 +85,9 @@ void TextboxView::__configureObject(void) if(!override_style) { QFont font; - box->setBrush(this->getFillStyle(BaseObject::getSchemaName(ObjectType::Textbox))); - box->setPen(this->getBorderStyle(BaseObject::getSchemaName(ObjectType::Textbox))); + + text_item->setBrush(this->getFillStyle(BaseObject::getSchemaName(ObjectType::Textbox))); + text_item->setPen(this->getBorderStyle(BaseObject::getSchemaName(ObjectType::Textbox))); font=fmt.font(); font.setItalic(txtbox->getTextAttribute(Textbox::ItalicText)); @@ -98,28 +95,25 @@ void TextboxView::__configureObject(void) font.setUnderline(txtbox->getTextAttribute(Textbox::UnderlineText)); font.setPointSizeF(txtbox->getFontSize()); - text->setFont(font); - text->setBrush(txtbox->getTextColor()); + text_item->setFont(font); + text_item->setTextBrush(txtbox->getTextColor()); } - text->setText(txtbox->getComment()); + text_item->setText(txtbox->getComment()); + text_item->setTextPos(HorizSpacing * 2, VertSpacing * (text_item->getFont().italic() ? 0.90 : 0.50)); - if(text->font().italic()) - text->setPos(HorizSpacing * 1.5, VertSpacing * 0.90); - else - text->setPos(HorizSpacing, VertSpacing); + TextPolygonItem::resizePolygon(polygon, roundf(text_item->getTextBoundingRect().width() + (2.5 * HorizSpacing)), + roundf(text_item->getTextBoundingRect().height() + (1.5 * VertSpacing))); - TextPolygonItem::resizePolygon(polygon, roundf(text->boundingRect().width() + (2.5 * HorizSpacing)), - roundf(text->boundingRect().height() + (1.5 * VertSpacing))); + text_item->setPos(0,0); + text_item->setPolygon(polygon); - box->setPos(0,0); - box->setPolygon(polygon); + protected_icon->setPos(text_item->boundingRect().right() - (protected_icon->boundingRect().width() + 2 * HorizSpacing), + text_item->boundingRect().bottom()- (protected_icon->boundingRect().height() + 2 * VertSpacing)); - protected_icon->setPos(box->boundingRect().right() - (protected_icon->boundingRect().width() + 2 * HorizSpacing), - box->boundingRect().bottom()- (protected_icon->boundingRect().height() + 2 * VertSpacing)); + this->bounding_rect.setTopLeft(text_item->boundingRect().topLeft()); + this->bounding_rect.setBottomRight(text_item->boundingRect().bottomRight()); - this->bounding_rect.setTopLeft(box->boundingRect().topLeft()); - this->bounding_rect.setBottomRight(box->boundingRect().bottomRight()); BaseObjectView::__configureObject(); if(!txtbox_tooltip.isEmpty()) @@ -139,7 +133,7 @@ void TextboxView::configureObjectShadow(void) pol_item->setPen(Qt::NoPen); pol_item->setBrush(QColor(50,50,50,60)); - pol_item->setPolygon(box->polygon()); + pol_item->setPolygon(text_item->polygon()); pol_item->setPos(3.5,3.5); } @@ -147,7 +141,7 @@ void TextboxView::configureObjectSelection(void) { QGraphicsPolygonItem *pol_item=dynamic_cast(obj_selection); - pol_item->setPolygon(box->polygon()); + pol_item->setPolygon(text_item->polygon()); pol_item->setPos(0,0); pol_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); pol_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); diff --git a/libobjrenderer/src/textboxview.h b/libobjrenderer/src/textboxview.h index 473ddd3e4d..687f0562b4 100644 --- a/libobjrenderer/src/textboxview.h +++ b/libobjrenderer/src/textboxview.h @@ -28,6 +28,7 @@ #include "textbox.h" #include "baseobjectview.h" #include "roundedrectitem.h" +#include "textpolygonitem.h" class TextboxView: public BaseObjectView { private: @@ -45,6 +46,8 @@ class TextboxView: public BaseObjectView { //! \brief Graphical item that represent the text QGraphicsSimpleTextItem *text; + TextPolygonItem *text_item; + //! \brief Configures the shadow for the textbox void configureObjectShadow(void); diff --git a/libobjrenderer/src/textpolygonitem.cpp b/libobjrenderer/src/textpolygonitem.cpp index d71601739c..b3aa2a86f1 100644 --- a/libobjrenderer/src/textpolygonitem.cpp +++ b/libobjrenderer/src/textpolygonitem.cpp @@ -63,6 +63,11 @@ void TextPolygonItem::setFont(const QFont &fnt) text_item->setFont(fnt); } +QFont TextPolygonItem::getFont() +{ + return(text_item->font()); +} + void TextPolygonItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { QGraphicsPolygonItem::paint(painter, option, widget); diff --git a/libobjrenderer/src/textpolygonitem.h b/libobjrenderer/src/textpolygonitem.h index fee085f68c..43fdb53e42 100644 --- a/libobjrenderer/src/textpolygonitem.h +++ b/libobjrenderer/src/textpolygonitem.h @@ -57,6 +57,8 @@ class TextPolygonItem : public QGraphicsPolygonItem { //! \brief Sets the font used by the text item void setFont(const QFont &fnt); + QFont getFont(void); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); //! \brief Resizes to the specified dimension the passed polygon From eed596e56faff6e3dd140e0a8bbd19ebc3c9b0d2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 1 Nov 2018 23:05:17 -0300 Subject: [PATCH 202/425] Removing debug and commented code --- libobjrenderer/src/baseobjectview.cpp | 2 -- libobjrenderer/src/objectsscene.cpp | 4 ---- libobjrenderer/src/relationshipview.cpp | 1 - 3 files changed, 7 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 807c58ddd0..c313edc276 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -33,8 +33,6 @@ BaseObjectView::BaseObjectView(BaseObject *object) obj_shadow=nullptr; obj_selection=nullptr; pos_info_item=nullptr; - //sql_disabled_txt=nullptr; - //sql_disabled_box=nullptr; sql_disabled_item=nullptr; placeholder=nullptr; setSourceObject(object); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 48d6deb973..6f46650a17 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -450,10 +450,6 @@ void ObjectsScene::addItem(QGraphicsItem *item) } QGraphicsScene::addItem(item); - - #warning "Debug!" - QTextStream out(stdout); - out << this->items().count() << endl; } } diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 7c98ac07c6..7aad9a529b 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1402,7 +1402,6 @@ void RelationshipView::configureDescriptor(void) x1+=6 * HorizSpacing; y1-=3 * VertSpacing; sql_disabled_item->setPos(x1, y1); - //sql_disabled_item->setTextPos(x1 + HorizSpacing, y1 + VertSpacing); descriptor->setPolygon(pol); descriptor->setTransformOriginPoint(descriptor->boundingRect().center()); From d89a895fbcb92cf8e3d022c78559fb30e2c0d4b1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 3 Nov 2018 16:09:00 -0300 Subject: [PATCH 203/425] Minor performance adjustment in ModelWidget --- libpgmodeler_ui/src/mainwindow.cpp | 7 +++++-- libpgmodeler_ui/src/modelwidget.cpp | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index a9fc1e756e..40ba89d628 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1304,6 +1304,8 @@ void MainWindow::applyConfigurations(void) tmpmodel_save_timer.setInterval(model_save_timer.interval() != 0 ? model_save_timer.interval()/2 : 300000); tmpmodel_save_timer.start(); + QApplication::setOverrideCursor(Qt::WaitCursor); + //Force the update of all opened models count=models_tbw->count(); for(i=0; i < count; i++) @@ -1311,11 +1313,12 @@ void MainWindow::applyConfigurations(void) model=dynamic_cast(models_tbw->widget(i)); model->updateObjectsOpacity(); model->db_model->setObjectsModified(); - model->update(); } updateConnections(); - sql_tool_wgt->configureSnippets(); + sql_tool_wgt->configureSnippets(); + + QApplication::restoreOverrideCursor(); } sql_tool_wgt->updateTabs(); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index c03cfcd764..0fce8cdf55 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -154,8 +154,9 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) //Force the scene to be drawn from the left to right and from top to bottom viewport->setAlignment(Qt::AlignLeft | Qt::AlignTop); - viewport->setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate); + viewport->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); viewport->setCacheMode(QGraphicsView::CacheBackground); + viewport->setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing); viewport->centerOn(0,0); viewport->setMouseTracking(true); From 32c306726a3e87beb1bc773a83354b8256b45f4c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 3 Nov 2018 16:22:25 -0300 Subject: [PATCH 204/425] Minor fixes in README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8a2e455fa0..4f21264c0d 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ See [LICENSE](https://github.com/pgmodeler/pgmodeler/blob/master/LICENSE) for de Donate to pgModeler ------------------- -Much effort, coffee, chocolate, time and knowledge has been devoted to this project so that a usable and constantly improved product could be delivered to the community. If you liked pgModeler and think it deserves a contribution please donate any amount (via PayPal) at [project's official site](http://pgmodeler.com.br). +Much effort, coffee, chocolate, time and knowledge is being devoted to this project so that a reliable and constantly improved product can be delivered to the community. If you liked pgModeler and think it deserves a contribution please donate any amount (via PayPal) at [project's official site](https://pgmodeler.io). Developers and Reviewers wanted! -------------------------------- @@ -27,12 +27,12 @@ pgModeler grown bigger and reached a state that its lonely developer cannot hand Compiling/Installation ---------------------- -For details about installation process from source code visit the [Installation](http://www.pgmodeler.com.br/support/installation) section. If you don't want to compile pgModeler there are binaries available for purchase at [official site](http://www.pgmodeler.com.br/download). +For details about installation process from source code visit the [Installation](https://www.pgmodeler.io/support/installation) section. If you don't want to compile pgModeler there are binaries available for purchase at [official site](http://www.pgmodeler.io/purchase). Known Issues ----------- -* Due to the usage of Qt's raster engine to draw objects, the process of handling objects on the canvas tends to get slower as lots of objects are created due causing constant CPU usage. A heavy performance degradation can be noticed when dealing with models with ~500+ tables and/or relationships. There're plans to improve the speed of drawing operations for large models for future releases. +* Due to the usage of Qt's raster engine to draw objects, the process of handling objects on the canvas tends to get slower as lots of objects are created causing constant CPU usage. A heavy performance degradation can be noticed when dealing with models with ~500+ tables and/or relationships. There're plans to improve the speed of drawing operations for large models for future releases. * The diff process still presents false-positive results due its limitations. Sometimes, there is the need to run the process twice to get the full changes. * pgModeler does not fully supports the [quoted identifier notation](http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). When using quoted identifiers only the following characters are accepted in the middle of names: a-z A-Z 0-9 _ . @ $ - / \ space. * pgModeler is unusable in sandboxed Mac OS X installations. To workaround this issue you'll need to deactivate sandbox usage to run pgModeler properly. There is no planning to adapt this tool for sandbox feature in Mac OS X. From a9fc586a57f154907a8ac5608f9fbac3c31f4caa Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 3 Nov 2018 17:39:15 -0300 Subject: [PATCH 205/425] Fixed the macos deploy script --- macdeploy.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/macdeploy.sh b/macdeploy.sh index 94b50fe822..cda1d4e6e7 100755 --- a/macdeploy.sh +++ b/macdeploy.sh @@ -1,13 +1,13 @@ #!/bin/bash USR=`whoami` -PGSQL_ROOT=/Library/PostgreSQL/10.1 -QT_ROOT=/Users/$USR/Qt5.9.3/5.9.3/clang_64 +PGSQL_ROOT=/Library/PostgreSQL/10 +QT_ROOT=/Users/$USR/Qt5.11.2/5.11.2/clang_64 QMAKE_ARGS="-r CONFIG+=x86_64 CONFIG+=release -spec macx-clang" LOG=macdeploy.log # Detecting current pgModeler version -DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PGMODELER_VERSION | sed 's/PGMODELER_VERSION=QString("//g' | sed 's/"),//g' | sed 's/^ *//g' | cut -s -f2` +DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/"),//g' | sed 's/^ *//g' | cut -s -f2` BUILD_NUM=$(date '+%Y%m%d') WITH_BUILD_NUM='-with-build-num' @@ -45,7 +45,7 @@ echo "Copyright 2006-2018 Raphael A. Silva " # Identifying System Qt version if [ -e "$QT_ROOT/bin/qmake" ]; then - QT_VER=`$QT_ROOT/bin/qmake --version | grep -m 1 -o '[0-9].[0-9].[0-9]'` + QT_VER=`$QT_ROOT/bin/qmake --version | grep -m 1 -o -E '[0-9]\.[0-9]+\.[0-9]+'` QT_VER=${QT_VER:0:5} fi From 75e522d57da068003b6ae35141ef1cb503755fb2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 3 Nov 2018 17:45:14 -0300 Subject: [PATCH 206/425] Fixed the linux deploy script --- linuxdeploy.sh | 6 +++--- windeploy.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/linuxdeploy.sh b/linuxdeploy.sh index b984b7c9d7..42b8cf3bc9 100755 --- a/linuxdeploy.sh +++ b/linuxdeploy.sh @@ -39,7 +39,7 @@ QT_CONF="$BUILD_DIR/$INSTALL_ROOT/qt.conf" DEP_PLUGINS_DIR="$BUILD_DIR/$INSTALL_ROOT/lib/qtplugins" # Detecting current pgModeler version -DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PGMODELER_VERSION | sed 's/PGMODELER_VERSION=QString("//g' | sed 's/"),//g' | sed 's/^ *//g' | cut -s -f2` +DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/"),//g' | sed 's/^ *//g' | cut -s -f2` GEN_INSTALLER_OPT='-gen-installer' DEMO_VERSION_OPT='-demo-version' NO_QT_LIBS_OPT='-no-qt-libs' @@ -154,13 +154,13 @@ echo "Copyright 2006-2018 Raphael A. Silva " # Identifying System Qt version if [ -e "$QMAKE_ROOT/$QMAKE_CMD" ]; then - QT_VER_1=`$QMAKE_ROOT/$QMAKE_CMD --version | grep --color=never -m 1 -o '[0-9].[0-9].[0-9]'` + QT_VER_1=`$QMAKE_ROOT/$QMAKE_CMD --version | grep --color=never -m 1 -o -E '[0-9].[0-9]+\.[0-9]+'` QT_VER_1=${QT_VER_1:0:5} fi # Identifying Fallback Qt version if [ -e "$FALLBACK_QMAKE_ROOT/$QMAKE_CMD" ]; then - QT_VER_2=`$FALLBACK_QMAKE_ROOT/$QMAKE_CMD --version | grep --color=never -m 1 -o '[0-9].[0-9].[0-9]'` + QT_VER_2=`$FALLBACK_QMAKE_ROOT/$QMAKE_CMD --version | grep --color=never -m 1 -o -E '[0-9].[0-9]+\.[0-9]+'` QT_VER_2=${QT_VER_2:0:5} export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$FALLBACK_QT_ROOT/lib" fi diff --git a/windeploy.sh b/windeploy.sh index cffd57d6b9..e268694fba 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -7,7 +7,7 @@ INNOSETUP_CMD='/c/Program Files (x86)/Inno Setup 5/ISCC.exe' LOG=windeploy.log # Detecting current pgModeler version -DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PGMODELER_VERSION | sed 's/PGMODELER_VERSION=QString("//g' | sed 's/"),//g'` +DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/"),//g'` DEPLOY_VER=${DEPLOY_VER/PGMODELER_VERSION=\"/} DEPLOY_VER=`echo ${DEPLOY_VER/\",/} | tr -d ' '` @@ -131,7 +131,7 @@ echo "Copyright 2006-2018 Raphael A. Silva " # Identifying Qt version if [ -e "$QMAKE_ROOT/qmake" ]; then - QT_VER=`$QMAKE_ROOT/qmake --version | grep '[0-9].[0-9].[0-9]'` + QT_VER=`$QMAKE_ROOT/qmake --version | grep -E '[0-9]\.[0-9]+\.[0-9]+'` QT_VER=${QT_VER:0:5} fi From 8deba046329b2ab9b5a7f8085a9405a5b8a84751 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 4 Nov 2018 11:32:24 -0300 Subject: [PATCH 207/425] Minor adjustment on protected icon position on TableTitleView and TextboxView --- libobjrenderer/src/basetableview.cpp | 2 +- libobjrenderer/src/tabletitleview.cpp | 5 +++-- libobjrenderer/src/textboxview.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 22c112a152..f7b577aead 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -406,7 +406,7 @@ void BaseTableView::__configureObject(float width) } //Set the protected icon position to the top-right on the title - protected_icon->setPos(title->pos().x() + title->boundingRect().width() * 0.90f, 2 * VertSpacing); + protected_icon->setPos(title->pos().x() + (2 * HorizSpacing), title->boundingRect().height() * 0.25); this->bounding_rect.setTopLeft(title->boundingRect().topLeft()); this->bounding_rect.setWidth(title->boundingRect().width()); diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index fb2edeae71..71449c5e05 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -128,7 +128,9 @@ void TableTitleView::configureObject(BaseGraphicObject *object) void TableTitleView::resizeTitle(double width, double height) { - double py = (height / 1.5); + double py = height / 1.5; + + box->setPos(0,0); box->setRect(QRectF(0,0, width, height)); if(schema_name->text()==QString(" ")) @@ -139,7 +141,6 @@ void TableTitleView::resizeTitle(double width, double height) obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), py); } - this->bounding_rect.setTopLeft(QPointF(0,0)); this->bounding_rect.setSize(QSizeF(box->boundingRect().width(), box->boundingRect().height())); } diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index b8a8d778e5..191f19a778 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -108,8 +108,8 @@ void TextboxView::__configureObject(void) text_item->setPos(0,0); text_item->setPolygon(polygon); - protected_icon->setPos(text_item->boundingRect().right() - (protected_icon->boundingRect().width() + 2 * HorizSpacing), - text_item->boundingRect().bottom()- (protected_icon->boundingRect().height() + 2 * VertSpacing)); + protected_icon->setPos(text_item->boundingRect().width() + 2 * HorizSpacing, + text_item->boundingRect().height() * 0.70); this->bounding_rect.setTopLeft(text_item->boundingRect().topLeft()); this->bounding_rect.setBottomRight(text_item->boundingRect().bottomRight()); From 042e22cd7558ddeb1ea9c6768e9f1065e813d467 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 4 Nov 2018 15:20:35 -0300 Subject: [PATCH 208/425] Move the default implementation of configureObjectShadow and configureObjectSelection from BaseObjectView to BaseTableView Disabling configureObjectSelection and configureObjectShadow on TableObjectView and RelationshipView --- libobjrenderer/src/baseobjectview.cpp | 38 --------------------------- libobjrenderer/src/baseobjectview.h | 4 +-- libobjrenderer/src/basetableview.cpp | 36 +++++++++++++++++++++---- libobjrenderer/src/basetableview.h | 6 +++++ libobjrenderer/src/relationshipview.h | 3 +++ libobjrenderer/src/tableobjectview.h | 3 +++ libobjrenderer/src/tableview.cpp | 2 -- 7 files changed, 45 insertions(+), 47 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index c313edc276..4c0ae7bb9d 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -158,17 +158,6 @@ void BaseObjectView::setSourceObject(BaseObject *object) this->addToGroup(pos_info_item); } - /* if(!sql_disabled_box && object->getObjectType()!=ObjectType::Textbox) - { - sql_disabled_txt=new QGraphicsSimpleTextItem; - sql_disabled_box=new QGraphicsRectItem; - sql_disabled_txt->setZValue(100); - sql_disabled_box->setZValue(99); - - this->addToGroup(sql_disabled_box); - this->addToGroup(sql_disabled_txt); - } */ - if(!sql_disabled_item && object->getObjectType()!=ObjectType::Textbox) { sql_disabled_item=new TextPolygonItem; @@ -490,33 +479,6 @@ void BaseObjectView::configureSQLDisabledInfo(void) } } -void BaseObjectView::configureObjectShadow(void) -{ - RoundedRectItem *rect_item=dynamic_cast(obj_shadow); - - if(rect_item) - { - rect_item->setPen(Qt::NoPen); - rect_item->setBrush(QColor(50,50,50,60)); - rect_item->setRect(this->boundingRect()); - rect_item->setPos(3.5,3.5); - } -} - -void BaseObjectView::configureObjectSelection(void) -{ - RoundedRectItem *rect_item=dynamic_cast(obj_selection); - - if(rect_item) - { - rect_item->setRect(this->boundingRect()); - rect_item->setPos(0,0); - rect_item->setBorderRadius(5); - rect_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); - rect_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); - } -} - void BaseObjectView::configureProtectedIcon(void) { if(protected_icon) diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 4f8c6efd9a..5125e84500 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -93,10 +93,10 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { static map> color_config; //! \brief Configures the objects shadow polygon - void configureObjectShadow(void); + void configureObjectShadow(void) {} //! \brief Configures the object selection polygon - void configureObjectSelection(void); + void configureObjectSelection(void) {} //! \brief Configures the polygons used to show the current object position void configurePositionInfo(QPointF pos); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index f7b577aead..aeb87a9485 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -149,7 +149,7 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) //If the user clicks the extended attributes toggler if(!this->isSelected() && event->buttons()==Qt::LeftButton && - this->ext_attribs_toggler->boundingRect().contains(pnt)) + this->ext_attribs_toggler->boundingRect().contains(pnt) ) { Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); @@ -174,6 +174,9 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) } BaseObjectView::mousePressEvent(event); + + if(this->isSelected() && obj_selection->boundingRect().height() < this->boundingRect().height()) + configureObjectSelection(); } } @@ -241,8 +244,8 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { dynamic_cast(obj_selection)->setBorderRadius(2); dynamic_cast(obj_selection)->setRect(QRectF(0,0, - title->boundingRect().width() - (2.5 * HorizSpacing), - item->boundingRect().height())); + title->boundingRect().width() - (2.5 * HorizSpacing), + item->boundingRect().height())); } //Sets the selection position as same as item's position @@ -423,8 +426,8 @@ void BaseTableView::__configureObject(float width) ext_attribs_body->setVisible(!tab->isExtAttribsHidden()); this->bounding_rect.setHeight(title->boundingRect().height() + - body->boundingRect().height() + - (!tab->isExtAttribsHidden() ? ext_attribs_body->boundingRect().height() : 0) + + body->boundingRect().height() + + (!tab->isExtAttribsHidden() ? ext_attribs_body->boundingRect().height() : 0) + ext_attribs_toggler->boundingRect().height() - VertSpacing - 1); body->setRoundedCorners(RoundedRectItem::NoCorners); @@ -436,6 +439,9 @@ void BaseTableView::__configureObject(float width) trUtf8("Connected rels: %1").arg(this->getConnectRelsCount()); this->setToolTip(this->table_tooltip); + + configureObjectSelection(); + configureObjectShadow(); } float BaseTableView::calculateWidth(void) @@ -472,3 +478,23 @@ void BaseTableView::togglePlaceholder(bool value) BaseObjectView::togglePlaceholder(!connected_rels.empty() && value); } +void BaseTableView::configureObjectShadow(void) +{ + RoundedRectItem *rect_item=dynamic_cast(obj_shadow); + + rect_item->setPen(Qt::NoPen); + rect_item->setBrush(QColor(50,50,50,60)); + rect_item->setRect(this->boundingRect()); + rect_item->setPos(3.5, 4.5); +} + +void BaseTableView::configureObjectSelection(void) +{ + RoundedRectItem *rect_item=dynamic_cast(obj_selection); + + rect_item->setRect(this->boundingRect()); + rect_item->setPos(0, 0); + rect_item->setBorderRadius(5); + rect_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); + rect_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); +} diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 3512ad7195..6654365b22 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -122,6 +122,12 @@ class BaseTableView: public BaseObjectView { unsigned getConnectedRelsCount(BaseTable *src_tab, BaseTable *dst_tab); + //! \brief Configures the shadow for the table + void configureObjectShadow(void); + + //! \brief Configures the selection for the table + void configureObjectSelection(void); + signals: //! \brief Signal emitted when a table is moved over the scene void s_objectMoved(void); diff --git a/libobjrenderer/src/relationshipview.h b/libobjrenderer/src/relationshipview.h index 00eac1de83..67654f2ef9 100644 --- a/libobjrenderer/src/relationshipview.h +++ b/libobjrenderer/src/relationshipview.h @@ -203,6 +203,9 @@ class RelationshipView: public BaseObjectView { line connection mode used. */ QPointF getConnectionPoint(unsigned table_idx); + void configureObjectShadow(void) = delete; + void configureObjectSelection(void) = delete; + signals: void s_relationshipModified(BaseGraphicObject *rel); diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index f9b2d90cfc..b67b274de0 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -87,6 +87,9 @@ class TableObjectView: public BaseObjectView virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); virtual QRectF boundingRect(void) const; + + void configureObjectShadow(void) = delete; + void configureObjectSelection(void) = delete; }; #endif diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index df4d795e25..32d60ad7e1 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -211,8 +211,6 @@ void TableView::configureObject(void) table_tooltip += QString("\n---\n%1").arg(table->getComment()); BaseObjectView::__configureObject(); - BaseObjectView::configureObjectShadow(); - BaseObjectView::configureObjectSelection(); configureTag(); configureSQLDisabledInfo(); From 6639f437f463b47bdebf6707bdda41d840d4fd20 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 4 Nov 2018 16:06:19 -0300 Subject: [PATCH 209/425] Fixed an artifact when user switched on and off the compact view The zoom in/out level is now sensible on how much the user rolls the mouse wheel --- libobjrenderer/src/basetableview.cpp | 7 ++++--- libpgmodeler_ui/src/mainwindow.cpp | 6 ++++++ libpgmodeler_ui/src/modelwidget.cpp | 6 ++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index aeb87a9485..fbe7ac380f 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -40,12 +40,14 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) ext_attribs=new QGraphicsItemGroup; ext_attribs->setZValue(1); + ext_attribs->setFlag(QGraphicsItem::ItemClipsChildrenToShape); ext_attribs_tog_arrow=new QGraphicsPolygonItem; ext_attribs_tog_arrow->setZValue(2); columns=new QGraphicsItemGroup; columns->setZValue(1); + columns->setFlag(QGraphicsItem::ItemClipsChildrenToShape); tag_item = new TextPolygonItem; tag_item->setZValue(3); @@ -411,8 +413,7 @@ void BaseTableView::__configureObject(float width) //Set the protected icon position to the top-right on the title protected_icon->setPos(title->pos().x() + (2 * HorizSpacing), title->boundingRect().height() * 0.25); - this->bounding_rect.setTopLeft(title->boundingRect().topLeft()); - this->bounding_rect.setWidth(title->boundingRect().width()); + this->bounding_rect = title->boundingRect(); if(!ext_attribs->isVisible()) { @@ -428,7 +429,7 @@ void BaseTableView::__configureObject(float width) this->bounding_rect.setHeight(title->boundingRect().height() + body->boundingRect().height() + (!tab->isExtAttribsHidden() ? ext_attribs_body->boundingRect().height() : 0) + - ext_attribs_toggler->boundingRect().height() - VertSpacing - 1); + ext_attribs_toggler->boundingRect().height() - VertSpacing - 1); body->setRoundedCorners(RoundedRectItem::NoCorners); } diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 40ba89d628..f6ccaba894 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1315,6 +1315,9 @@ void MainWindow::applyConfigurations(void) model->db_model->setObjectsModified(); } + if(current_model) + current_model->update(); + updateConnections(); sql_tool_wgt->configureSnippets(); @@ -2048,5 +2051,8 @@ void MainWindow::toggleCompactView(void) model_wgt->getDatabaseModel()->setObjectsModified({ ObjectType::Table, ObjectType::View, ObjectType::Relationship, ObjectType::BaseRelationship, ObjectType::Schema}); } + if(current_model) + current_model->update(); + QApplication::restoreOverrideCursor(); } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 0fce8cdf55..bb4d30b0a6 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -535,10 +535,12 @@ bool ModelWidget::eventFilter(QObject *object, QEvent *event) object == viewport->verticalScrollBar()) && event->type() == QEvent::Wheel && w_event->modifiers()==Qt::ControlModifier) { + double zoom_inc = roundf(fabs(w_event->angleDelta().y())/120) * ZoomIncrement; + if(w_event->angleDelta().y() < 0) - this->applyZoom(this->current_zoom - ZoomIncrement); + this->applyZoom(this->current_zoom - zoom_inc); else - this->applyZoom(this->current_zoom + ZoomIncrement); + this->applyZoom(this->current_zoom + zoom_inc); return(true); } From 9fb5f2a1664addcdd9e2ef3835077cc3d3df122d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 4 Nov 2018 17:01:39 -0300 Subject: [PATCH 210/425] Fixed the view resizing Fixed a regression in schema's rectangle selection Fixed the StyledTextboxView bounding rect --- libobjrenderer/src/baseobjectview.cpp | 14 ++++++++++++++ libobjrenderer/src/baseobjectview.h | 2 +- libobjrenderer/src/basetableview.cpp | 16 +--------------- libobjrenderer/src/basetableview.h | 3 --- libobjrenderer/src/graphicalview.cpp | 6 +++--- libobjrenderer/src/styledtextboxview.cpp | 2 ++ libobjrenderer/src/tableobjectview.cpp | 6 ++++-- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 4c0ae7bb9d..1da06ae8c4 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -429,6 +429,20 @@ void BaseObjectView::toggleProtectionIcon(bool value) obj_graf->setModified(true); } +void BaseObjectView::configureObjectSelection(void) +{ + RoundedRectItem *rect_item=dynamic_cast(obj_selection); + + if(rect_item) + { + rect_item->setRect(this->boundingRect()); + rect_item->setPos(0, 0); + rect_item->setBorderRadius(5); + rect_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); + rect_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); + } +} + void BaseObjectView::configurePositionInfo(QPointF pos) { if(this->isSelected()) diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 5125e84500..b9a3f45339 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -96,7 +96,7 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { void configureObjectShadow(void) {} //! \brief Configures the object selection polygon - void configureObjectSelection(void) {} + void configureObjectSelection(void); //! \brief Configures the polygons used to show the current object position void configurePositionInfo(QPointF pos); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index fbe7ac380f..f097952109 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -120,7 +120,7 @@ QVariant BaseTableView::itemChange(GraphicsItemChange change, const QVariant &va if(change==ItemSelectedHasChanged) { this->setToolTip(this->table_tooltip); - BaseObjectView::configureObjectSelection(); + configureObjectSelection(); } if(change==ItemPositionHasChanged) @@ -176,9 +176,6 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) } BaseObjectView::mousePressEvent(event); - - if(this->isSelected() && obj_selection->boundingRect().height() < this->boundingRect().height()) - configureObjectSelection(); } } @@ -488,14 +485,3 @@ void BaseTableView::configureObjectShadow(void) rect_item->setRect(this->boundingRect()); rect_item->setPos(3.5, 4.5); } - -void BaseTableView::configureObjectSelection(void) -{ - RoundedRectItem *rect_item=dynamic_cast(obj_selection); - - rect_item->setRect(this->boundingRect()); - rect_item->setPos(0, 0); - rect_item->setBorderRadius(5); - rect_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); - rect_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); -} diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 6654365b22..d0c935235d 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -125,9 +125,6 @@ class BaseTableView: public BaseObjectView { //! \brief Configures the shadow for the table void configureObjectShadow(void); - //! \brief Configures the selection for the table - void configureObjectSelection(void); - signals: //! \brief Signal emitted when a table is moved over the scene void s_objectMoved(void); diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 716f0cc850..263ef040cf 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -76,7 +76,7 @@ void GraphicalView::configureObject(void) //Moves the reference to the origin to be moved latter graph_ref->moveBy(-graph_ref->scenePos().x(), - -graph_ref->scenePos().y()); + -graph_ref->scenePos().y()); } else graph_ref=new TableObjectView; @@ -203,8 +203,8 @@ void GraphicalView::configureObject(void) bodies[idx]->setPos(title->pos().x(), title->boundingRect().height()-1); else bodies[idx]->setPos(title->pos().x(), - title->boundingRect().height() + - bodies[0]->boundingRect().height() - 2); + title->boundingRect().height() + + bodies[0]->boundingRect().height() - 2); groups[idx]->setPos(bodies[idx]->pos()); subitems=groups[idx]->childItems(); diff --git a/libobjrenderer/src/styledtextboxview.cpp b/libobjrenderer/src/styledtextboxview.cpp index 8634e03949..0d58ef1a27 100644 --- a/libobjrenderer/src/styledtextboxview.cpp +++ b/libobjrenderer/src/styledtextboxview.cpp @@ -49,6 +49,8 @@ void StyledTextboxView::configureObject(void) fold->setPos(rect.width() - fold->boundingRect().width(), rect.height() - fold->boundingRect().height()); + bounding_rect = text_item->boundingRect(); + this->configureObjectShadow(); this->configureObjectSelection(); } diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 41e13b57fe..dbc0341262 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -528,14 +528,16 @@ void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) void TableObjectView::calculateBoundingRect(void) { - double width = 0, height = 0; + double width = 0, height = 0, curr_w = 0; width = descriptor->pos().x() + descriptor->boundingRect().width(); height = descriptor->boundingRect().height(); for(int i = 0; i < 3; i++) { - if(width < lables[i]->pos().x()) + curr_w = lables[i]->pos().x() + lables[i]->boundingRect().width(); + + if(width < curr_w) width = lables[i]->pos().x() + lables[i]->boundingRect().width(); if(height < lables[i]->boundingRect().height()) From a1307660ef9ef1c11118e2db43096ea055588bae Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 4 Nov 2018 17:29:34 -0300 Subject: [PATCH 211/425] Added constants to reference child objects of TableObjectView --- libobjrenderer/src/graphicalview.cpp | 15 ++++++++------- libobjrenderer/src/tableobjectview.cpp | 6 +++--- libobjrenderer/src/tableobjectview.h | 5 +++++ libobjrenderer/src/tableview.cpp | 12 +++++++----- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 263ef040cf..6e017bfb06 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -139,13 +139,13 @@ void GraphicalView::configureObject(void) /* Calculates the width of the name + type of the object. This is used to align all the constraint labels on table */ - width=col_item->getChildObject(0)->boundingRect().width() + - col_item->getChildObject(1)->boundingRect().width() + (3 * HorizSpacing); + width=col_item->getChildObject(TableObjectView::ObjDescriptor)->boundingRect().width() + + col_item->getChildObject(TableObjectView::NameLabel)->boundingRect().width() + (3 * HorizSpacing); if(px < width) px=width; //Gets the maximum width of the column type label to align all at same horizontal position - if(type_width < col_item->getChildObject(2)->boundingRect().width()) - type_width=col_item->getChildObject(2)->boundingRect().width() + (3 * HorizSpacing); + if(type_width < col_item->getChildObject(TableObjectView::TypeLabel)->boundingRect().width()) + type_width=col_item->getChildObject(TableObjectView::TypeLabel)->boundingRect().width() + (3 * HorizSpacing); col_items.push_back(col_item); } @@ -168,10 +168,10 @@ void GraphicalView::configureObject(void) col_items.pop_front(); //Positioning the type label - col_item->setChildObjectXPos(2, px); + col_item->setChildObjectXPos(TableObjectView::TypeLabel, px); //Positioning the constraints label - col_item->setChildObjectXPos(3, px + type_width); + col_item->setChildObjectXPos(TableObjectView::ConstrAliasLabel, px + type_width); ext_attribs->addToGroup(col_item); } } @@ -212,7 +212,8 @@ void GraphicalView::configureObject(void) { col_item=dynamic_cast(subitems.front()); subitems.pop_front(); - col_item->setChildObjectXPos(3, width - col_item->getChildObject(3)->boundingRect().width() - (2 * HorizSpacing)); + col_item->setChildObjectXPos(TableObjectView::ConstrAliasLabel, + width - col_item->getChildObject(3)->boundingRect().width() - (2 * HorizSpacing)); } } diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index dbc0341262..3c4ab8ca2c 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -549,13 +549,13 @@ void TableObjectView::calculateBoundingRect(void) QGraphicsItem *TableObjectView::getChildObject(unsigned obj_idx) { - if(obj_idx >= 4) + if(obj_idx > ConstrAliasLabel) throw Exception(ErrorCode::RefObjectInvalidIndex, __PRETTY_FUNCTION__, __FILE__, __LINE__); - if(obj_idx==0) + if(obj_idx == ObjDescriptor) return(descriptor); else - return(lables[obj_idx-1]); + return(lables[obj_idx - 1]); } QString TableObjectView::getConstraintString(Column *column) diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index b67b274de0..bd3ce63ea3 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -65,6 +65,11 @@ class TableObjectView: public BaseObjectView TextCheck, TextExclude; + static constexpr unsigned ObjDescriptor = 0, + NameLabel = 1, + TypeLabel = 2, + ConstrAliasLabel = 3; + TableObjectView(TableObject *object=nullptr); ~TableObjectView(void); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 32d60ad7e1..e72711643e 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -109,8 +109,8 @@ void TableView::configureObject(void) /* Calculates the width of the name + type of the object. This is used to align all the constraint labels on table */ - width=col_item->getChildObject(0)->boundingRect().width() + - col_item->getChildObject(1)->boundingRect().width() + (5 * HorizSpacing); + width=col_item->getChildObject(TableObjectView::ObjDescriptor)->boundingRect().width() + + col_item->getChildObject(TableObjectView::NameLabel)->boundingRect().width() + (5 * HorizSpacing); if(px < width) px=width; @@ -136,10 +136,11 @@ void TableView::configureObject(void) col_items.pop_front(); //Positioning the type label - col_item->setChildObjectXPos(2, px); + col_item->setChildObjectXPos(TableObjectView::TypeLabel, px); //Positioning the constraints label - col_item->setChildObjectXPos(3, px + (col_item->getChildObject(2)->boundingRect().width() * 1.05)); + col_item->setChildObjectXPos(TableObjectView::ConstrAliasLabel, + px + (col_item->getChildObject(TableObjectView::TypeLabel)->boundingRect().width() * 1.05)); groups[obj_idx]->addToGroup(col_item); } @@ -182,7 +183,8 @@ void TableView::configureObject(void) { col_item=dynamic_cast(subitems.front()); subitems.pop_front(); - col_item->setChildObjectXPos(3, width - col_item->getChildObject(3)->boundingRect().width() - (2 * HorizSpacing) - 1); + col_item->setChildObjectXPos(TableObjectView::ConstrAliasLabel, + width - col_item->getChildObject(TableObjectView::ConstrAliasLabel)->boundingRect().width() - (2 * HorizSpacing) - 1); //Generating the connection points of the columns if(obj_idx==0) From 93d7b8d2bb9f5c2a263915d848530ccd2f15c1fb Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 6 Nov 2018 09:04:37 -0300 Subject: [PATCH 212/425] Fixed a bug that was causing crashed while configure new constraints on tables --- libpgmodeler_ui/src/pgmodeleruins.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 053f6ec373..a18b5698c1 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -95,6 +95,7 @@ namespace PgModelerUiNs { Messagebox msgbox; ObjectType obj_type=object->getObjectType(); bool curr_val=object->isSQLDisabled(); + TableObject *tab_obj = dynamic_cast(object); if(object->isSystemObject()) throw Exception(Exception::getErrorMessage(ErrorCode::OprReservedObject) @@ -104,8 +105,8 @@ namespace PgModelerUiNs { object->setSQLDisabled(disable); - if(TableObject::isTableObject(object->getObjectType())) - dynamic_cast(object)->getParentTable()->setModified(true); + if(tab_obj && tab_obj->getParentTable()) + tab_obj->getParentTable()->setModified(true); if(obj_type!=ObjectType::Database && curr_val!=disable) { From 33406730efcf9fbc891e2f943b67392f0c2f23e3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 7 Nov 2018 16:25:21 -0300 Subject: [PATCH 213/425] Added an item to control table attributes toggling an column pagination --- libobjrenderer/libobjrenderer.pro | 6 +- libobjrenderer/src/attributestoggleritem.cpp | 192 +++++++++++++++++++ libobjrenderer/src/attributestoggleritem.h | 67 +++++++ libobjrenderer/src/basetableview.cpp | 183 +++++++----------- libobjrenderer/src/basetableview.h | 11 +- libpgmodeler/src/basetable.cpp | 10 + libpgmodeler/src/basetable.h | 14 ++ libpgmodeler_ui/src/modelwidget.cpp | 2 +- 8 files changed, 369 insertions(+), 116 deletions(-) create mode 100644 libobjrenderer/src/attributestoggleritem.cpp create mode 100644 libobjrenderer/src/attributestoggleritem.h diff --git a/libobjrenderer/libobjrenderer.pro b/libobjrenderer/libobjrenderer.pro index b0a69a67d3..76eb3d3b4f 100644 --- a/libobjrenderer/libobjrenderer.pro +++ b/libobjrenderer/libobjrenderer.pro @@ -26,7 +26,8 @@ HEADERS += src/baseobjectview.h \ src/roundedrectitem.h \ src/styledtextboxview.h \ src/beziercurveitem.h \ - src/textpolygonitem.h + src/textpolygonitem.h \ + src/attributestoggleritem.h SOURCES += src/baseobjectview.cpp \ src/textboxview.cpp \ @@ -41,7 +42,8 @@ SOURCES += src/baseobjectview.cpp \ src/roundedrectitem.cpp \ src/styledtextboxview.cpp \ src/beziercurveitem.cpp \ - src/textpolygonitem.cpp + src/textpolygonitem.cpp \ + src/attributestoggleritem.cpp unix|windows: LIBS += -L$$OUT_PWD/../libpgmodeler/ -lpgmodeler \ -L$$OUT_PWD/../libparsers/ -lparsers \ diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp new file mode 100644 index 0000000000..7131855423 --- /dev/null +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -0,0 +1,192 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "attributestoggleritem.h" +#include +#include +#include +#include "baseobjectview.h" + +AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRectItem(parent) +{ + this->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); + + for(unsigned arr_id = 0; arr_id < 3; arr_id++) + { + arrows[arr_id] = new QGraphicsPolygonItem; + arrows_selected[arr_id] = false; + } + + arrows[AttribsToggler]->setToolTip(trUtf8("Toggles the display of columns and extended attributes")); + arrows[NextAttribsArrow]->setToolTip(trUtf8("Display the next columns page")); + arrows[PrevAttribsArrow]->setToolTip(trUtf8("Display the previous columns page")); + toggler_inverted = false; +} + +void AttributesTogglerItem::setArrowsBrush(const QBrush &brush) +{ + for(unsigned arr_id = 0; arr_id < 3; arr_id++) + arrows[arr_id]->setBrush(brush); +} + +void AttributesTogglerItem::setArrowsPen(const QPen &pen) +{ + for(unsigned arr_id = 0; arr_id < 3; arr_id++) + arrows[arr_id]->setPen(pen); +} + +void AttributesTogglerItem::setRect(const QRectF &rect) +{ + configureButtons(rect); +} + +void AttributesTogglerItem::setCollapseMode(CollapseMode coll_mode) +{ + collapse_mode = coll_mode; + configureButtons(this->rect()); +} + +void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) +{ + QRectF rect; + double h_spacing = 4 * BaseObjectView::HorizSpacing; + + this->setToolTip(QString()); + + for(unsigned arr_id = 0; arr_id < 3; arr_id++) + { + rect.setSize(QSizeF(arrows[arr_id]->boundingRect().width() + h_spacing, this->boundingRect().height())); + rect.moveTo(arrows[arr_id]->pos().x() - (h_spacing/2), 0); + arrows_selected[arr_id] = rect.contains(pnt); + + if(arrows_selected[arr_id]) + { + this->setToolTip(arrows[arr_id]->toolTip()); + + if(clicked) + { + if(collapse_mode == CollapseMode::NotCollapsed) + collapse_mode = CollapseMode::ExtAttribsCollapsed; + else if(collapse_mode == CollapseMode::ExtAttribsCollapsed) + collapse_mode = CollapseMode::AllAttribsCollapsed; + else + collapse_mode = CollapseMode::NotCollapsed; + + configureButtons(this->rect()); + emit s_collapseModeChanged(collapse_mode); + } + } + } + + this->update(); +} + +void AttributesTogglerItem::clearArrowSelection(void) +{ + for(unsigned arr_id = 0; arr_id < 3; arr_id++) + arrows_selected[arr_id] = false; + + this->update(); +} + +void AttributesTogglerItem::configureButtons(const QRectF &rect) +{ + double fnt_factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, + pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(), + factor = fnt_factor * pixel_ratio, + arr_width = 0, px = 0, + h_spacing = 8 * BaseObjectView::HorizSpacing, + height = 4 * BaseObjectView::VertSpacing; + QPolygonF pol; + QRectF new_rect = rect; + + pol.append(QPointF(0, 5 * factor)); + pol.append(QPointF(8 * factor, 0)); + pol.append(QPointF(8 * factor, 10 * factor)); + height += pol.boundingRect().height(); + arr_width = pol.boundingRect().width() + h_spacing; + arrows[PrevAttribsArrow]->setPolygon(pol); + + pol.remove(0); + pol.translate(-8 * factor, 0); + pol.append(QPointF(8 * factor, 5 * factor)); + arrows[NextAttribsArrow]->setPolygon(pol); + arr_width += pol.boundingRect().width() + h_spacing; + + pol.clear(); + if(collapse_mode == CollapseMode::NotCollapsed) + { + pol.append(QPointF(5 * factor, 0)); + pol.append(QPointF(0, 8 * factor)); + pol.append(QPointF(10 * factor, 8 * factor)); + } + else + { + pol.append(QPointF(0, 0)); + pol.append(QPointF(10 * factor, 0)); + pol.append(QPointF(5 * factor, 8 * factor)); + } + + arrows[AttribsToggler]->setPolygon(pol); + arr_width += pol.boundingRect().width(); + + new_rect.setHeight(height); + RoundedRectItem::setRect(new_rect); + + px = (new_rect.width() - arr_width)/2; + + arrows[PrevAttribsArrow]->setPos(px, (new_rect.height() - arrows[PrevAttribsArrow]->boundingRect().height())/2); + px += arrows[PrevAttribsArrow]->boundingRect().width() + h_spacing; + + arrows[NextAttribsArrow]->setPos(px, (new_rect.height() - arrows[NextAttribsArrow]->boundingRect().height())/2); + px += arrows[NextAttribsArrow]->boundingRect().width() + h_spacing * 0.80; + + arrows[AttribsToggler]->setPos(px, (new_rect.height() - arrows[AttribsToggler]->boundingRect().height())/2); +} + +void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + RoundedRectItem::paint(painter, option, widget); + + for(unsigned arr_id = 0; arr_id < 3; arr_id++) + { + painter->save(); + painter->translate(arrows[arr_id]->pos()); + arrows[arr_id]->paint(painter, option, widget); + painter->restore(); + + if(arrows_selected[arr_id]) + { + QRectF sel_rect; + QSizeF size = QSizeF(arrows[AttribsToggler]->boundingRect().size().width() + (2 * BaseObjectView::HorizSpacing), + arrows[PrevAttribsArrow]->boundingRect().size().height() + BaseObjectView::HorizSpacing); + double tx = 0, ty = 0, arr_x = arrows[arr_id]->pos().x(); + + sel_rect.setSize(size); + tx = arr_x - (((arr_x + size.width()) - (arr_x + arrows[arr_id]->boundingRect().width()))/2); + ty = (this->boundingRect().size().height() - size.height())/2.5; + + painter->save(); + painter->translate(tx, ty); + painter->setBrush(BaseObjectView::getFillStyle(Attributes::ObjSelection)); + painter->setPen(BaseObjectView::getBorderStyle(Attributes::ObjSelection)); + painter->drawRect(sel_rect); + painter->restore(); + } + } +} diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h new file mode 100644 index 0000000000..cd26d41ea7 --- /dev/null +++ b/libobjrenderer/src/attributestoggleritem.h @@ -0,0 +1,67 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libobjrenderer +\class AttributesTogglerItem +\brief Implements a basic table's attributes toggler used by BaseTableView. +*/ + +#ifndef ATTRIBUTES_TOGGLER_ITEM_H +#define ATTRIBUTES_TOGGLER_ITEM_H + +#include +#include +#include "roundedrectitem.h" +#include "basetable.h" + +class AttributesTogglerItem: public QObject, public RoundedRectItem { + private: + Q_OBJECT + + CollapseMode collapse_mode; + + QGraphicsPolygonItem *arrows[3]; + + bool arrows_selected[3]; + + bool toggler_inverted; + + static constexpr unsigned AttribsToggler=0, + NextAttribsArrow=1, + PrevAttribsArrow=2; + + void configureButtons(const QRectF &rect); + + public: + AttributesTogglerItem(QGraphicsItem *parent = nullptr); + + void setArrowsBrush(const QBrush &brush); + void setArrowsPen(const QPen &pen); + void setRect(const QRectF &rect); + void setCollapseMode(CollapseMode coll_mode); + void setArrowSelected(const QPointF &pnt, bool clicked = false); + void clearArrowSelection(void); + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); + + signals: + void s_collapseModeChanged(CollapseMode); +}; + +#endif diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index f097952109..ae236ddfa1 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -34,17 +34,10 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) ext_attribs_body=new RoundedRectItem; ext_attribs_body->setRoundedCorners(RoundedRectItem::NoCorners); - ext_attribs_toggler=new RoundedRectItem; - ext_attribs_toggler->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); - ext_attribs_toggler->setZValue(-1); - ext_attribs=new QGraphicsItemGroup; ext_attribs->setZValue(1); ext_attribs->setFlag(QGraphicsItem::ItemClipsChildrenToShape); - ext_attribs_tog_arrow=new QGraphicsPolygonItem; - ext_attribs_tog_arrow->setZValue(2); - columns=new QGraphicsItemGroup; columns->setZValue(1); columns->setFlag(QGraphicsItem::ItemClipsChildrenToShape); @@ -59,6 +52,9 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) obj_selection->setVisible(false); obj_selection->setZValue(4); + attribs_toggler = new AttributesTogglerItem; + attribs_toggler->setZValue(2); + this->addToGroup(obj_selection); this->addToGroup(obj_shadow); this->addToGroup(columns); @@ -67,26 +63,25 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) this->addToGroup(tag_item); this->addToGroup(ext_attribs); this->addToGroup(ext_attribs_body); - this->addToGroup(ext_attribs_toggler); - this->addToGroup(ext_attribs_tog_arrow); + this->addToGroup(attribs_toggler); this->setAcceptHoverEvents(true); sel_child_obj=nullptr; configurePlaceholder(); + + connect(attribs_toggler, SIGNAL(s_collapseModeChanged(CollapseMode)), this, SLOT(configureCollapsedSections(CollapseMode))); } BaseTableView::~BaseTableView(void) { this->removeFromGroup(body); this->removeFromGroup(title); + this->removeFromGroup(attribs_toggler); this->removeFromGroup(ext_attribs_body); - this->removeFromGroup(ext_attribs_toggler); - this->removeFromGroup(ext_attribs_tog_arrow); this->removeFromGroup(ext_attribs); this->removeFromGroup(columns); this->removeFromGroup(tag_item); - delete(ext_attribs_tog_arrow); - delete(ext_attribs_toggler); + delete(attribs_toggler); delete(ext_attribs_body); delete(ext_attribs); delete(body); @@ -147,32 +142,14 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) } else { - QPointF pnt = this->ext_attribs_toggler->mapFromScene(event->scenePos()); + //QPointF pnt = this->ext_attribs_toggler->mapFromScene(event->scenePos()); + QPointF pnt = attribs_toggler->mapFromScene(event->scenePos()); //If the user clicks the extended attributes toggler if(!this->isSelected() && event->buttons()==Qt::LeftButton && - this->ext_attribs_toggler->boundingRect().contains(pnt) ) + attribs_toggler->isVisible() && attribs_toggler->boundingRect().contains(pnt)) { - Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); - - //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object - this->setFlag(QGraphicsItem::ItemIsSelectable, false); - - dynamic_cast(this->getSourceObject()) - ->setExtAttribsHidden(!dynamic_cast(this->getSourceObject())->isExtAttribsHidden()); - - //Updating the object geometry to show/hide the extended attributes - this->configureObject(); - - obj_selection->setVisible(false); - - // Using a single shot time to restore the selectable flag - QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); - - //Updating the schema box that holds the object (if visible) - schema->setModified(true); - - emit s_extAttributesToggled(); + attribs_toggler->setArrowSelected(pnt, true); } BaseObjectView::mousePressEvent(event); @@ -184,6 +161,7 @@ void BaseTableView::hoverLeaveEvent(QGraphicsSceneHoverEvent *) if(!this->isSelected() && obj_selection->isVisible()) obj_selection->setVisible(false); + attribs_toggler->clearArrowSelection(); sel_child_obj=nullptr; } @@ -196,7 +174,8 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) QList items; double cols_height, item_idx, ext_height=0; QRectF rect, rect1; - QPointF pnt = this->ext_attribs_toggler->mapFromScene(event->scenePos()); + //QPointF pnt = this->ext_attribs_toggler->mapFromScene(event->scenePos()); + QPointF pnt = attribs_toggler->mapFromScene(event->scenePos()); items.append(columns->childItems()); @@ -214,18 +193,9 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) rect=this->mapRectToItem(title, title->boundingRect()); item_idx=(event->pos().y() - rect.bottom()) / cols_height; - if(ext_attribs_toggler->isVisible() && this->ext_attribs_toggler->boundingRect().contains(pnt)) + if(attribs_toggler->isVisible() && attribs_toggler->boundingRect().contains(pnt)) { - dynamic_cast(obj_selection)->setBorderRadius(2); - dynamic_cast(obj_selection)->setRect(QRectF(0,0, - title->boundingRect().width() - (2.5 * HorizSpacing), - ext_attribs_toggler->boundingRect().height() * 0.65f)); - - //Sets the selection position as same as item's position - rect1=this->mapRectToItem(ext_attribs_toggler, ext_attribs_toggler->boundingRect()); - obj_selection->setVisible(true); - obj_selection->setPos(QPointF(title->pos().x() + HorizSpacing, -rect1.top() + 1.5f)); - this->setToolTip(trUtf8("Toggles the extended attributes display")); + attribs_toggler->setArrowSelected(pnt); } //If the index is invalid clears the selection else if(item_idx < 0 || item_idx >= items.size()) @@ -344,78 +314,43 @@ void BaseTableView::configureTag(void) void BaseTableView::__configureObject(float width) { BaseTable *tab = dynamic_cast(this->getSourceObject()); + double py = 0, v_spacing = 1.5 * VertSpacing, + factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, + pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(); - if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs) - { - QPen pen = ext_attribs_body->pen(); - float py = 0; - float factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f; - float pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(); - - ext_attribs_toggler->setVisible(true); - ext_attribs_tog_arrow->setVisible(true); - - ext_attribs_toggler->setPen(pen); - ext_attribs_toggler->setBrush(ext_attribs_body->brush()); - ext_attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor * pixel_ratio)); - - if(!tab->isExtAttribsHidden()) - { - py = title->boundingRect().height() + - body->boundingRect().height() + - ext_attribs_body->boundingRect().height() - VertSpacing - 1; - } - else - { - py = title->boundingRect().height() + - body->boundingRect().height() - 2; - } - - ext_attribs_toggler->setPos(ext_attribs_body->pos().x(), py); - - QPolygonF pol; + py = title->boundingRect().height() + + body->boundingRect().height() - 2; - if(!tab->isExtAttribsHidden()) - { - pol.append(QPointF(0,0)); - pol.append(QPointF(-5 * factor * pixel_ratio, 6 * factor * pixel_ratio)); - pol.append(QPointF(5 * factor * pixel_ratio, 6 * factor * pixel_ratio)); - } - else - { - pol.append(QPointF(0,6 * factor * pixel_ratio)); - pol.append(QPointF(-5 * factor * pixel_ratio, 0)); - pol.append(QPointF(5 * factor * pixel_ratio, 0)); - } + if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && !tab->isExtAttribsHidden()) + { + py = title->boundingRect().height() + + body->boundingRect().height() + + ext_attribs_body->boundingRect().height() - v_spacing; + } - QLinearGradient grad(QPointF(0,0),QPointF(0,1)); - grad.setCoordinateMode(QGradient::ObjectBoundingMode); - grad.setColorAt(0, ext_attribs_body->pen().color().lighter(200)); - grad.setColorAt(1, ext_attribs_body->pen().color().lighter()); + QPen pen = body->pen(); + attribs_toggler->setBrush(body->brush()); + attribs_toggler->setPen(body->pen()); - pen.setStyle(Qt::SolidLine); - ext_attribs_tog_arrow->setPen(pen); - ext_attribs_tog_arrow->setBrush(grad); - ext_attribs_tog_arrow->setPolygon(pol); + QLinearGradient grad(QPointF(0,0),QPointF(0,1)); + grad.setCoordinateMode(QGradient::ObjectBoundingMode); + grad.setColorAt(0, body->pen().color().lighter(200)); + grad.setColorAt(1, body->pen().color().lighter()); + pen.setStyle(Qt::SolidLine); - ext_attribs_tog_arrow->setPos(ext_attribs_body->boundingRect().width() * 0.51f, - ext_attribs_toggler->pos().y() + pol.boundingRect().height() * 0.525f); - } - else - { - ext_attribs_tog_arrow->setVisible(false); - ext_attribs_toggler->setVisible(false); - } + attribs_toggler->setArrowsBrush(grad); + attribs_toggler->setArrowsPen(body->pen()); + attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor * pixel_ratio)); + attribs_toggler->setPos(title->pos().x(), py); + attribs_toggler->setVisible(!columns->childItems().isEmpty()); //Set the protected icon position to the top-right on the title protected_icon->setPos(title->pos().x() + (2 * HorizSpacing), title->boundingRect().height() * 0.25); - this->bounding_rect = title->boundingRect(); if(!ext_attribs->isVisible()) { - this->bounding_rect.setHeight(title->boundingRect().height() + - body->boundingRect().height() - 1); + this->bounding_rect.setHeight(title->boundingRect().height() + body->boundingRect().height()); body->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); } else @@ -425,12 +360,14 @@ void BaseTableView::__configureObject(float width) this->bounding_rect.setHeight(title->boundingRect().height() + body->boundingRect().height() + - (!tab->isExtAttribsHidden() ? ext_attribs_body->boundingRect().height() : 0) + - ext_attribs_toggler->boundingRect().height() - VertSpacing - 1); + (!tab->isExtAttribsHidden() ? ext_attribs_body->boundingRect().height() - v_spacing : - v_spacing)); body->setRoundedCorners(RoundedRectItem::NoCorners); } + this->bounding_rect.setHeight(this->bounding_rect.height() + + attribs_toggler->boundingRect().height()); + this->table_tooltip=this->getSourceObject()->getName(true) + QString(" (") + this->getSourceObject()->getTypeName() + QString(") \n") + QString("Id: %1\n").arg(this->getSourceObject()->getObjectId()) + @@ -485,3 +422,31 @@ void BaseTableView::configureObjectShadow(void) rect_item->setRect(this->boundingRect()); rect_item->setPos(3.5, 4.5); } + +void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) +{ + Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); + + //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object + this->setFlag(QGraphicsItem::ItemIsSelectable, false); + + dynamic_cast(this->getSourceObject()) + ->setExtAttribsHidden(!dynamic_cast(this->getSourceObject())->isExtAttribsHidden()); + + QTextStream out(stdout); + out << static_cast(coll_mode) << endl; + dynamic_cast(this->getSourceObject())->setCollapseMode(coll_mode); + + //Updating the object geometry to show/hide the extended attributes + this->configureObject(); + + obj_selection->setVisible(false); + + // Using a single shot time to restore the selectable flag + QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); + + //Updating the schema box that holds the object (if visible) + schema->setModified(true); + + emit s_extAttributesToggled(); +} diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index d0c935235d..60d29515eb 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -32,6 +32,7 @@ #include "roundedrectitem.h" #include "baserelationship.h" #include "textpolygonitem.h" +#include "attributestoggleritem.h" class BaseTableView: public BaseObjectView { private: @@ -53,11 +54,9 @@ class BaseTableView: public BaseObjectView { //! \brief Extended table attributes (indexes, rules, triggers) section body *ext_attribs_body, - *placeholder, + *placeholder; - *ext_attribs_toggler; - - QGraphicsPolygonItem *ext_attribs_tog_arrow; + AttributesTogglerItem *attribs_toggler; TextPolygonItem *tag_item; @@ -125,6 +124,10 @@ class BaseTableView: public BaseObjectView { //! \brief Configures the shadow for the table void configureObjectShadow(void); + private slots: + //! \brief This slot reconfigures the table when the attributes toggler emits the signal s_collapseModeChanged + void configureCollapsedSections(CollapseMode coll_mode); + signals: //! \brief Signal emitted when a table is moved over the scene void s_objectMoved(void); diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index f78b938dd2..b1aa09137a 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -67,3 +67,13 @@ void BaseTable::operator = (BaseTable &tab) (*dynamic_cast(this))=dynamic_cast(tab); this->tag=tab.tag; } + +CollapseMode BaseTable::getCollapseMode(void) +{ + return(collapse_mode); +} + +void BaseTable::setCollapseMode(CollapseMode coll_mode) +{ + collapse_mode = coll_mode; +} diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index b285e47d79..caf91aa0c9 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -29,13 +29,24 @@ #include "basegraphicobject.h" #include "tag.h" +//! \brief This enum is used to control the collapsing of the tables +enum class CollapseMode: unsigned { + NotCollapsed, //Table is fully expanded (columns and extended attributes) + ExtAttribsCollapsed, //Extended attributes are collapsed + AllAttribsCollapsed, //Columns (attributes) and extended attributes are collapsed +}; + class BaseTable: public BaseGraphicObject { private: bool hide_ext_attribs; + CollapseMode collapse_mode; + protected: Tag *tag; + void setCollapseMode(CollapseMode coll_mode); + public: BaseTable(void); @@ -91,7 +102,10 @@ class BaseTable: public BaseGraphicObject { //! \brief Copy the attributes between two tables void operator = (BaseTable &tab); + CollapseMode getCollapseMode(void); + friend class DatabaseModel; + friend class BaseTableView; }; #endif diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index bb4d30b0a6..7062d01690 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -156,7 +156,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) viewport->setAlignment(Qt::AlignLeft | Qt::AlignTop); viewport->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); viewport->setCacheMode(QGraphicsView::CacheBackground); - viewport->setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing); + //viewport->setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing); viewport->centerOn(0,0); viewport->setMouseTracking(true); From 3a3c7e3263ff3cd0f3d59e84ec6295d7f6c6843c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 8 Nov 2018 10:45:02 -0300 Subject: [PATCH 214/425] Table collapsing done --- libobjrenderer/src/attributestoggleritem.cpp | 32 +++++++-- libobjrenderer/src/attributestoggleritem.h | 10 ++- libobjrenderer/src/basetableview.cpp | 71 ++++++++------------ libobjrenderer/src/basetableview.h | 2 +- libobjrenderer/src/tableview.cpp | 38 ++++------- libpgmodeler/src/basetable.cpp | 1 + libpgmodeler/src/basetable.h | 4 +- libpgmodeler/src/databasemodel.cpp | 2 +- libpgmodeler/src/table.cpp | 16 ++--- libpgmodeler/src/table.h | 8 +-- libpgmodeler/src/view.cpp | 13 ++-- libpgmodeler/src/view.h | 4 +- 12 files changed, 100 insertions(+), 101 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index 7131855423..48d5d71155 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -35,7 +35,9 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec arrows[AttribsToggler]->setToolTip(trUtf8("Toggles the display of columns and extended attributes")); arrows[NextAttribsArrow]->setToolTip(trUtf8("Display the next columns page")); arrows[PrevAttribsArrow]->setToolTip(trUtf8("Display the previous columns page")); - toggler_inverted = false; + arrow_inverted = has_ext_attribs = false; + collapse_mode = CollapseMode::NotCollapsed; + arrows_width = 0; } void AttributesTogglerItem::setArrowsBrush(const QBrush &brush) @@ -78,12 +80,20 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) { this->setToolTip(arrows[arr_id]->toolTip()); - if(clicked) + if(clicked && arr_id == AttribsToggler) { if(collapse_mode == CollapseMode::NotCollapsed) - collapse_mode = CollapseMode::ExtAttribsCollapsed; + { + collapse_mode = (has_ext_attribs ? CollapseMode::ExtAttribsCollapsed : CollapseMode::AllAttribsCollapsed); + arrow_inverted = false; + } else if(collapse_mode == CollapseMode::ExtAttribsCollapsed) - collapse_mode = CollapseMode::AllAttribsCollapsed; + collapse_mode = (arrow_inverted ? CollapseMode::NotCollapsed : CollapseMode::AllAttribsCollapsed); + else if(collapse_mode == CollapseMode::AllAttribsCollapsed) + { + collapse_mode = (has_ext_attribs ? CollapseMode::ExtAttribsCollapsed : CollapseMode::NotCollapsed); + arrow_inverted = true; + } else collapse_mode = CollapseMode::NotCollapsed; @@ -96,6 +106,11 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) this->update(); } +void AttributesTogglerItem::setHasExtAttributes(bool value) +{ + has_ext_attribs = value; +} + void AttributesTogglerItem::clearArrowSelection(void) { for(unsigned arr_id = 0; arr_id < 3; arr_id++) @@ -104,6 +119,11 @@ void AttributesTogglerItem::clearArrowSelection(void) this->update(); } +double AttributesTogglerItem::getArrowsWidth(void) +{ + return(arrows_width); +} + void AttributesTogglerItem::configureButtons(const QRectF &rect) { double fnt_factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, @@ -129,7 +149,8 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) arr_width += pol.boundingRect().width() + h_spacing; pol.clear(); - if(collapse_mode == CollapseMode::NotCollapsed) + if(collapse_mode == CollapseMode::NotCollapsed || + (!arrow_inverted && collapse_mode == CollapseMode::ExtAttribsCollapsed)) { pol.append(QPointF(5 * factor, 0)); pol.append(QPointF(0, 8 * factor)); @@ -144,6 +165,7 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) arrows[AttribsToggler]->setPolygon(pol); arr_width += pol.boundingRect().width(); + arrows_width = arr_width + h_spacing; new_rect.setHeight(height); RoundedRectItem::setRect(new_rect); diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index cd26d41ea7..aa06b43d50 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -38,9 +38,13 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { QGraphicsPolygonItem *arrows[3]; - bool arrows_selected[3]; + bool arrows_selected[3], - bool toggler_inverted; + arrow_inverted, + + has_ext_attribs; + + double arrows_width; static constexpr unsigned AttribsToggler=0, NextAttribsArrow=1, @@ -56,7 +60,9 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { void setRect(const QRectF &rect); void setCollapseMode(CollapseMode coll_mode); void setArrowSelected(const QPointF &pnt, bool clicked = false); + void setHasExtAttributes(bool value); void clearArrowSelection(void); + double getArrowsWidth(void); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index ae236ddfa1..45fa3b70f7 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -30,6 +30,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) body->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); title=new TableTitleView; + title->setZValue(2); ext_attribs_body=new RoundedRectItem; ext_attribs_body->setRoundedCorners(RoundedRectItem::NoCorners); @@ -53,7 +54,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) obj_selection->setZValue(4); attribs_toggler = new AttributesTogglerItem; - attribs_toggler->setZValue(2); + attribs_toggler->setZValue(1); this->addToGroup(obj_selection); this->addToGroup(obj_shadow); @@ -116,6 +117,7 @@ QVariant BaseTableView::itemChange(GraphicsItemChange change, const QVariant &va { this->setToolTip(this->table_tooltip); configureObjectSelection(); + attribs_toggler->clearArrowSelection(); } if(change==ItemPositionHasChanged) @@ -148,9 +150,7 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) //If the user clicks the extended attributes toggler if(!this->isSelected() && event->buttons()==Qt::LeftButton && attribs_toggler->isVisible() && attribs_toggler->boundingRect().contains(pnt)) - { attribs_toggler->setArrowSelected(pnt, true); - } BaseObjectView::mousePressEvent(event); } @@ -313,21 +313,10 @@ void BaseTableView::configureTag(void) void BaseTableView::__configureObject(float width) { - BaseTable *tab = dynamic_cast(this->getSourceObject()); - double py = 0, v_spacing = 1.5 * VertSpacing, + double height = 0, factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(); - py = title->boundingRect().height() + - body->boundingRect().height() - 2; - - if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && !tab->isExtAttribsHidden()) - { - py = title->boundingRect().height() + - body->boundingRect().height() + - ext_attribs_body->boundingRect().height() - v_spacing; - } - QPen pen = body->pen(); attribs_toggler->setBrush(body->brush()); attribs_toggler->setPen(body->pen()); @@ -341,32 +330,21 @@ void BaseTableView::__configureObject(float width) attribs_toggler->setArrowsBrush(grad); attribs_toggler->setArrowsPen(body->pen()); attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor * pixel_ratio)); - attribs_toggler->setPos(title->pos().x(), py); - attribs_toggler->setVisible(!columns->childItems().isEmpty()); //Set the protected icon position to the top-right on the title protected_icon->setPos(title->pos().x() + (2 * HorizSpacing), title->boundingRect().height() * 0.25); this->bounding_rect = title->boundingRect(); - if(!ext_attribs->isVisible()) - { - this->bounding_rect.setHeight(title->boundingRect().height() + body->boundingRect().height()); - body->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); - } - else - { - ext_attribs->setVisible(!tab->isExtAttribsHidden()); - ext_attribs_body->setVisible(!tab->isExtAttribsHidden()); + body->setRoundedCorners(RoundedRectItem::NoCorners); - this->bounding_rect.setHeight(title->boundingRect().height() + - body->boundingRect().height() + - (!tab->isExtAttribsHidden() ? ext_attribs_body->boundingRect().height() - v_spacing : - v_spacing)); + height = title->boundingRect().height() + attribs_toggler->boundingRect().height() - VertSpacing; + height += (body->isVisible() ? body->boundingRect().height() : 1); + height += (ext_attribs_body->isVisible() ? ext_attribs_body->boundingRect().height() - VertSpacing + 1 : 0); - body->setRoundedCorners(RoundedRectItem::NoCorners); - } + this->bounding_rect.setHeight(height); - this->bounding_rect.setHeight(this->bounding_rect.height() + - attribs_toggler->boundingRect().height()); + attribs_toggler->setPos(title->pos().x(), + height - attribs_toggler->boundingRect().height()); this->table_tooltip=this->getSourceObject()->getName(true) + QString(" (") + this->getSourceObject()->getTypeName() + QString(") \n") + @@ -379,23 +357,30 @@ void BaseTableView::__configureObject(float width) configureObjectShadow(); } -float BaseTableView::calculateWidth(void) +double BaseTableView::calculateWidth(void) { + double spacing = (2 * HorizSpacing); + /* Calculating the maximum width between the title, columns and extended attributes. - This width is used to set the uniform width of table */ - if(!columns->childItems().isEmpty() && + * This width is used to set the uniform width of table */ + + if(columns->isVisible() && (columns->boundingRect().width() > title->boundingRect().width() && - (hide_ext_attribs || dynamic_cast(this->getSourceObject())->isExtAttribsHidden() || + (hide_ext_attribs || + dynamic_cast(this->getSourceObject())->getCollapseMode() == CollapseMode::ExtAttribsCollapsed || (columns->boundingRect().width() >= ext_attribs->boundingRect().width())))) - return(columns->boundingRect().width() + (2 * HorizSpacing)); + return(columns->boundingRect().width() + spacing); - if(!ext_attribs->childItems().isEmpty() && !hide_ext_attribs && - !dynamic_cast(this->getSourceObject())->isExtAttribsHidden() && + if(ext_attribs->isVisible() && (ext_attribs->boundingRect().width() > title->boundingRect().width() && ext_attribs->boundingRect().width() > columns->boundingRect().width())) - return(ext_attribs->boundingRect().width() + (2 * HorizSpacing)); + return(ext_attribs->boundingRect().width() + spacing); + + if(attribs_toggler->isVisible() && !columns->isVisible() && + attribs_toggler->getArrowsWidth() > title->boundingRect().width()) + return(attribs_toggler->getArrowsWidth() + spacing); - return(title->boundingRect().width() + (2 * HorizSpacing)); + return(title->boundingRect().width() + spacing); } int BaseTableView::getConnectRelsCount(void) @@ -433,8 +418,6 @@ void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) dynamic_cast(this->getSourceObject()) ->setExtAttribsHidden(!dynamic_cast(this->getSourceObject())->isExtAttribsHidden()); - QTextStream out(stdout); - out << static_cast(coll_mode) << endl; dynamic_cast(this->getSourceObject())->setCollapseMode(coll_mode); //Updating the object geometry to show/hide the extended attributes diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 60d29515eb..8727aa39bf 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -85,7 +85,7 @@ class BaseTableView: public BaseObjectView { void __configureObject(float width); //! \brief Determines the table width based upon its subsection (title, body and extended attribs) - float calculateWidth(void); + double calculateWidth(void); public: static constexpr unsigned LeftConnPoint=0, diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index e72711643e..6dfebc6bcb 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -36,15 +36,19 @@ void TableView::configureObject(void) TableObject *tab_obj=nullptr; QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; - vector tab_objs; + vector tab_objs, ext_tab_objs; QString atribs[]={ Attributes::TableBody, Attributes::TableExtBody }; Tag *tag=table->getTag(); //Configures the table title title->configureObject(table); - px=0; + for(auto &obj : table->getObjects({ ObjectType::Column })) + ext_tab_objs.push_back(dynamic_cast(obj)); + + attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_tab_objs.empty()); + px=0; old_width=this->bounding_rect.width(); old_height=this->bounding_rect.height(); @@ -54,25 +58,14 @@ void TableView::configureObject(void) if(obj_idx==0) { - tab_objs.assign(table->getObjectList(ObjectType::Column)->begin(), - table->getObjectList(ObjectType::Column)->end()); + if(table->getCollapseMode() != CollapseMode::AllAttribsCollapsed) + tab_objs.assign(table->getObjectList(ObjectType::Column)->begin(), + table->getObjectList(ObjectType::Column)->end()); } else { - tab_objs.assign(table->getObjectList(ObjectType::Constraint)->begin(), - table->getObjectList(ObjectType::Constraint)->end()); - tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjectType::Trigger)->begin(), - table->getObjectList(ObjectType::Trigger)->end()); - tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjectType::Index)->begin(), - table->getObjectList(ObjectType::Index)->end()); - tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjectType::Rule)->begin(), - table->getObjectList(ObjectType::Rule)->end()); - tab_objs.insert(tab_objs.end(), - table->getObjectList(ObjectType::Policy)->begin(), - table->getObjectList(ObjectType::Policy)->end()); + if(!hide_ext_attribs && table->getCollapseMode() == CollapseMode::NotCollapsed) + tab_objs.assign(ext_tab_objs.begin(), ext_tab_objs.end()); } //Gets the subitems of the current group @@ -80,13 +73,8 @@ void TableView::configureObject(void) groups[obj_idx]->moveBy(-groups[obj_idx]->scenePos().x(), -groups[obj_idx]->scenePos().y()); count=tab_objs.size(); - - //Special case: if there is no item on extended attributes, the extended body is hidden - if(obj_idx==1) - { - groups[obj_idx]->setVisible(count > 0 && !hide_ext_attribs); - bodies[obj_idx]->setVisible(count > 0 && !hide_ext_attribs); - } + groups[obj_idx]->setVisible(count > 0); + bodies[obj_idx]->setVisible(count > 0); for(i=0; i < count; i++) { diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index b1aa09137a..1c4b2fa744 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -26,6 +26,7 @@ BaseTable::BaseTable(void) attributes[Attributes::HideExtAttribs]=QString(); attributes[Attributes::MaxObjCount]=QString(); hide_ext_attribs=false; + collapse_mode = CollapseMode::NotCollapsed; } void BaseTable::setExtAttribsHidden(bool value) diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index caf91aa0c9..bc30807bfe 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -84,8 +84,8 @@ class BaseTable: public BaseGraphicObject { //! \brief Returns the index for the specified table object virtual int getObjectIndex(BaseObject *obj)=0; - //! \brief Returns all child objects of the table - virtual vector getObjects(void)=0; + //! \brief Returns all children objects of the table but excluding the ones of the provided type + virtual vector getObjects(const vector &excl_types = {})=0; virtual QString getCodeDefinition(unsigned tipo_def)=0; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index a4851e1867..df2c6bea48 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -7074,7 +7074,7 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b fkeys.push_back(constr); } - for(auto obj : table->getObjects(true)) + for(auto obj : table->getObjects({ ObjectType::Column, ObjectType::Constraint })) objects_map[obj->getObjectId()]=obj; } diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 00895e2df8..9c9688c8ea 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1828,15 +1828,17 @@ void Table::getColumnReferences(Column *column, vector &refs, boo } } -vector Table::getObjects(bool excl_cols_constr) + +vector Table::getObjects(const vector &excl_types) { vector list; vector types={ ObjectType::Column, ObjectType::Constraint, - ObjectType::Trigger, ObjectType::Index, ObjectType::Rule, ObjectType::Policy }; + ObjectType::Trigger, ObjectType::Index, + ObjectType::Rule, ObjectType::Policy }; for(auto type : types) { - if(excl_cols_constr && (type == ObjectType::Column || type == ObjectType::Constraint)) + if(std::find(excl_types.begin(), excl_types.end(), type) != excl_types.end()) continue; list.insert(list.end(), getObjectList(type)->begin(), getObjectList(type)->end()) ; @@ -1845,11 +1847,6 @@ vector Table::getObjects(bool excl_cols_constr) return(list); } -vector Table::getObjects(void) -{ - return(getObjects(false)); -} - vector Table::getPartitionKeys(void) { return(partition_keys); @@ -1858,7 +1855,8 @@ vector Table::getPartitionKeys(void) void Table::setCodeInvalidated(bool value) { vector types={ ObjectType::Column, ObjectType::Constraint, - ObjectType::Trigger, ObjectType::Index, ObjectType::Rule, ObjectType::Policy }; + ObjectType::Trigger, ObjectType::Index, + ObjectType::Rule, ObjectType::Policy }; for(auto type : types) { diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 4a9c54ebe6..4b09f49daf 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -359,12 +359,8 @@ class Table: public BaseTable { //! \brief Returns the primary key of the table. Returns nullptr when it doesn't exists Constraint *getPrimaryKey(void); - /*! \brief Returns all child objects of the table. If the excl_cols_contr is true - then the method will return all objects except columns and constraint */ - vector getObjects(bool excl_cols_constr); - - //! \brief Returns all child objects of the table. This is the same as call getObjects(false) - vector getObjects(void); + //! \brief Returns the children objects of the table excluding the provided children types + vector getObjects(const vector &excl_types = {}); //! \brief Returns all the partition keys used by the table vector getPartitionKeys(void); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 07595c9f58..9f446c420a 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -999,13 +999,18 @@ void View::operator = (View &view) PgSqlType::renameUserType(prev_name, this, this->getName(true)); } -vector View::getObjects(void) +vector View::getObjects(const vector &excl_types) { vector list; + vector types={ ObjectType::Trigger, ObjectType::Index, ObjectType::Rule }; - list.assign(triggers.begin(), triggers.end()); - list.insert(list.end(), rules.begin(), rules.end()); - list.insert(list.end(), indexes.begin(), indexes.end()); + for(auto type : types) + { + if(std::find(excl_types.begin(), excl_types.end(), type) != excl_types.end()) + continue; + + list.insert(list.end(), getObjectList(type)->begin(), getObjectList(type)->end()) ; + } return(list); } diff --git a/libpgmodeler/src/view.h b/libpgmodeler/src/view.h index d9d8316159..429fd425d1 100644 --- a/libpgmodeler/src/view.h +++ b/libpgmodeler/src/view.h @@ -137,8 +137,8 @@ class View: public BaseTable { //! \brief Returns the object index searching by its index and type int getObjectIndex(const QString &name, ObjectType obj_type); - //! \brief Returns all child objects of the view (does not include references) - vector getObjects(void); + //! \brief Returns the children objects of the view excluding the provided children types (does not include references) + vector getObjects(const vector &excl_types = {}); //! \brief Returns the view's child object using its index and type TableObject *getObject(unsigned obj_idx, ObjectType obj_type); From 43c2c0cb255202c210e7a9667603f0a63d091969 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 8 Nov 2018 15:48:22 -0300 Subject: [PATCH 215/425] Fixed the height calculation of TableObjectView --- libobjrenderer/src/basetableview.cpp | 3 +- libobjrenderer/src/graphicalview.cpp | 109 +++++++++++++++---------- libobjrenderer/src/tableobjectview.cpp | 5 +- 3 files changed, 66 insertions(+), 51 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 45fa3b70f7..c314919062 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -174,13 +174,12 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) QList items; double cols_height, item_idx, ext_height=0; QRectF rect, rect1; - //QPointF pnt = this->ext_attribs_toggler->mapFromScene(event->scenePos()); QPointF pnt = attribs_toggler->mapFromScene(event->scenePos()); items.append(columns->childItems()); if(!hide_ext_attribs && - !dynamic_cast(this->getSourceObject())->isExtAttribsHidden()) + dynamic_cast(this->getSourceObject())->getCollapseMode() == CollapseMode::NotCollapsed) { items.append(ext_attribs->childItems()); ext_height=ext_attribs->boundingRect().height(); diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 6e017bfb06..c772a54288 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -37,7 +37,7 @@ void GraphicalView::configureObject(void) QPen pen; TableObjectView *graph_ref=nullptr; QList subitems; - vector tab_objs; + vector tab_objs, ext_view_objs; QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; QString attribs[]={ Attributes::ViewBody, Attributes::ViewExtBody }, @@ -51,6 +51,11 @@ void GraphicalView::configureObject(void) //Configures the view's title title->configureObject(view); + for(auto &obj : view->getObjects()) + ext_view_objs.push_back(dynamic_cast(obj)); + + attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_view_objs.empty()); + //Gets the reference count on SELECT part of the SQL definition count=view->getReferenceCount(Reference::SqlReferSelect); @@ -59,64 +64,76 @@ void GraphicalView::configureObject(void) //Moves the references group to the origin to be moved latter columns->moveBy(-columns->scenePos().x(), -columns->scenePos().y()); + columns->setVisible(view->getCollapseMode() != CollapseMode::AllAttribsCollapsed); + ext_attribs->setVisible(!ext_view_objs.empty() && view->getCollapseMode() == CollapseMode::NotCollapsed); + body->setVisible(columns->isVisible()); + ext_attribs_body->setVisible(ext_attribs->isVisible()); - subitems=columns->childItems(); - - for(i=0; i < count; i++) + if(!columns->isVisible()) { - if(count1==0) - ref=view->getReference(i, Reference::SqlReferSelect); - else - ref=view->getReference(i, Reference::SqlViewDefinition); - - //Reuses the subitem if it was allocated before - if(!subitems.isEmpty() && i < subitems.size()) + for(auto &item : columns->childItems()) { - graph_ref=dynamic_cast(subitems[i]); + columns->removeFromGroup(item); + delete(item); + } + } + else + { + subitems=columns->childItems(); + for(i=0; i < count; i++) + { + if(count1==0) + ref=view->getReference(i, Reference::SqlReferSelect); + else + ref=view->getReference(i, Reference::SqlViewDefinition); + + //Reuses the subitem if it was allocated before + if(!subitems.isEmpty() && i < subitems.size()) + { + graph_ref=dynamic_cast(subitems[i]); - //Moves the reference to the origin to be moved latter - graph_ref->moveBy(-graph_ref->scenePos().x(), - -graph_ref->scenePos().y()); + //Moves the reference to the origin to be moved latter + graph_ref->moveBy(-graph_ref->scenePos().x(), + -graph_ref->scenePos().y()); + } + else + graph_ref=new TableObjectView; + + columns->removeFromGroup(graph_ref); + graph_ref->configureObject(ref); + graph_ref->moveBy(HorizSpacing, i * graph_ref->boundingRect().height()); + columns->addToGroup(graph_ref); } - else - graph_ref=new TableObjectView; - columns->removeFromGroup(graph_ref); - graph_ref->configureObject(ref); - graph_ref->moveBy(HorizSpacing, (i * graph_ref->boundingRect().height()) + VertSpacing); - columns->addToGroup(graph_ref); + //Destroy the graphical references not used + i=subitems.size()-1; + while(i > count-1) + { + graph_ref=dynamic_cast(subitems[i]); + columns->removeFromGroup(graph_ref); + delete(graph_ref); + i--; + } } - //Destroy the graphical references not used - i=subitems.size()-1; - while(i > count-1) + if(!hide_ext_attribs && view->getCollapseMode() == CollapseMode::NotCollapsed) + tab_objs.assign(ext_view_objs.begin(), ext_view_objs.end()); + + if(tab_objs.empty()) { - graph_ref=dynamic_cast(subitems[i]); - columns->removeFromGroup(graph_ref); - delete(graph_ref); - i--; + for(auto &item : ext_attribs->childItems()) + { + ext_attribs->removeFromGroup(item); + delete(item); + } } - - tab_objs.assign(view->getObjectList(ObjectType::Rule)->begin(), - view->getObjectList(ObjectType::Rule)->end()); - tab_objs.insert(tab_objs.end(), - view->getObjectList(ObjectType::Trigger)->begin(), - view->getObjectList(ObjectType::Trigger)->end()); - tab_objs.insert(tab_objs.end(), - view->getObjectList(ObjectType::Index)->begin(), - view->getObjectList(ObjectType::Index)->end()); - - ext_attribs->setVisible(!tab_objs.empty() && !hide_ext_attribs); - ext_attribs_body->setVisible(!tab_objs.empty() && !hide_ext_attribs); - - if(!tab_objs.empty()) + else { count=tab_objs.size(); //Gets the subitems of the current group subitems=ext_attribs->childItems(); - ext_attribs->moveBy(-ext_attribs->scenePos().x(), - -ext_attribs->scenePos().y()); + ext_attribs->moveBy(-ext_attribs->scenePos().x(), -ext_attribs->scenePos().y()); for(i=0; i < count; i++) { tab_obj=tab_objs.at(i); @@ -184,8 +201,10 @@ void GraphicalView::configureObject(void) //Resizes the columns/extended attributes using the new width for(int idx=0; idx < 2; idx++) { - bodies[idx]->setRect(QRectF(0,0, width, groups[idx]->boundingRect().height() + (2 * VertSpacing))); + if(!groups[idx]->isVisible()) + continue; + bodies[idx]->setRect(QRectF(0,0, width, groups[idx]->boundingRect().height() + (2 * VertSpacing))); pen=this->getBorderStyle(attribs[idx]); pen.setStyle(Qt::DashLine); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 3c4ab8ca2c..3acbc77c8b 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -531,7 +531,7 @@ void TableObjectView::calculateBoundingRect(void) double width = 0, height = 0, curr_w = 0; width = descriptor->pos().x() + descriptor->boundingRect().width(); - height = descriptor->boundingRect().height(); + height = lables[0]->boundingRect().height(); for(int i = 0; i < 3; i++) { @@ -539,9 +539,6 @@ void TableObjectView::calculateBoundingRect(void) if(width < curr_w) width = lables[i]->pos().x() + lables[i]->boundingRect().width(); - - if(height < lables[i]->boundingRect().height()) - height = lables[i]->boundingRect().height(); } bounding_rect = QRectF(QPointF(0,0), QSizeF(width + (4 * HorizSpacing), height)); From 99442e931752ffab630b7a3bea1e756d38bd9ebc Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 8 Nov 2018 17:48:04 -0300 Subject: [PATCH 216/425] Adjusting the hover selection on table attributes at BaseTableView --- libobjrenderer/src/basetableview.cpp | 6 +++--- libobjrenderer/src/tableobjectview.cpp | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index c314919062..90a08e7729 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -211,15 +211,15 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) if(obj_selection->boundingRect().height()!=item->boundingRect().height()) { dynamic_cast(obj_selection)->setBorderRadius(2); - dynamic_cast(obj_selection)->setRect(QRectF(0,0, + dynamic_cast(obj_selection)->setRect(QRectF(0, 0, title->boundingRect().width() - (2.5 * HorizSpacing), - item->boundingRect().height())); + item->boundingRect().height() - VertSpacing)); } //Sets the selection position as same as item's position rect1=this->mapRectToItem(item, item->boundingRect()); obj_selection->setVisible(true); - obj_selection->setPos(QPointF(title->pos().x() + HorizSpacing, -rect1.top())); + obj_selection->setPos(QPointF(title->pos().x() + HorizSpacing, -rect1.top() + VertSpacing/2)); //Stores the selected child object sel_child_obj=dynamic_cast(item->getSourceObject()); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 3acbc77c8b..2e7d829dc9 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -82,8 +82,6 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) descriptor=new QGraphicsEllipseItem; else descriptor=new QGraphicsPolygonItem; - - //this->addToGroup(descriptor); } if(column) @@ -186,7 +184,7 @@ void TableObjectView::configureObject(void) if(this->getSourceObject()) { QTextCharFormat fmt; - double px; + double px = 0; QString str_constr, tooltip, atribs_tip; TableObject *tab_obj=dynamic_cast(this->getSourceObject()); Column *column=dynamic_cast(tab_obj); @@ -256,9 +254,8 @@ void TableObjectView::configureObject(void) configureDescriptor(constr_type); - //Set the descriptor position as the first item on the view descriptor->setPos(HorizSpacing, 0); - px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HorizSpacing); + px=HorizSpacing + descriptor->boundingRect().width() + (2 * HorizSpacing); //Configuring the labels as follow: [object name] [type] [constraints] lables[0]->setText(compact_view && !tab_obj->getAlias().isEmpty() ? tab_obj->getAlias() : tab_obj->getName()); @@ -419,7 +416,6 @@ void TableObjectView::configureObject(void) lables[2]->setBrush(fmt.foreground()); lables[2]->setPos(px, 0); - descriptor->setPos(HorizSpacing, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); calculateBoundingRect(); this->setToolTip(tooltip + atribs_tip); } @@ -509,7 +505,6 @@ void TableObjectView::configureObject(Reference reference) lables[2]->setText(QString(" ")); } - descriptor->setPos(HorizSpacing, lables[0]->boundingRect().center().y() - descriptor->boundingRect().center().y()); calculateBoundingRect(); } @@ -528,7 +523,7 @@ void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) void TableObjectView::calculateBoundingRect(void) { - double width = 0, height = 0, curr_w = 0; + double width = 0, height = 0, curr_w = 0, py = 0; width = descriptor->pos().x() + descriptor->boundingRect().width(); height = lables[0]->boundingRect().height(); @@ -541,7 +536,16 @@ void TableObjectView::calculateBoundingRect(void) width = lables[i]->pos().x() + lables[i]->boundingRect().width(); } - bounding_rect = QRectF(QPointF(0,0), QSizeF(width + (4 * HorizSpacing), height)); + bounding_rect = QRectF(QPointF(0,0), QSizeF(width + (4 * HorizSpacing), height + (1.5 * VertSpacing))); + + //Adjusting the Y position of the objects in order to center them on the new bouding rect + descriptor->setPos(descriptor->pos().x(), + (bounding_rect.height() - descriptor->boundingRect().height() + (VertSpacing * 0.75))/2); + + py = (bounding_rect.height() - lables[0]->boundingRect().height())/2; + + for(unsigned i = 0; i < 3; i++) + lables[i]->setPos(lables[i]->pos().x(), py); } QGraphicsItem *TableObjectView::getChildObject(unsigned obj_idx) From 1ea067c513e31fb098d2fa0bb95d2fd482b9bc8c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 8 Nov 2018 23:31:41 -0300 Subject: [PATCH 217/425] Removed the several operators ~ overload that statically cast enums to their underlying type and created a template function called enum_cast in C++14 syntax --- crashhandler/src/main.cpp | 2 +- libobjrenderer/src/tableobjectview.cpp | 4 +- libpgconnector/src/catalog.cpp | 6 +-- libpgmodeler/src/baseobject.cpp | 10 ++--- libpgmodeler/src/baseobject.h | 6 --- libpgmodeler/src/basetable.h | 4 +- libpgmodeler/src/databasemodel.cpp | 38 +++++++++---------- .../src/databaseexplorerwidget.cpp | 4 +- libpgmodeler_ui/src/databaseimportform.cpp | 12 +++--- libpgmodeler_ui/src/datamanipulationform.cpp | 12 +++--- libpgmodeler_ui/src/modelobjectswidget.cpp | 14 +++---- libpgmodeler_ui/src/modelwidget.cpp | 22 +++++------ libpgmodeler_ui/src/objectfinderwidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 2 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 8 ++-- libpgmodeler_ui/src/taskprogresswidget.cpp | 2 +- libutils/src/exception.cpp | 12 +++--- libutils/src/exception.h | 15 ++++---- main-cli/src/main.cpp | 2 +- main/src/main.cpp | 2 +- 21 files changed, 88 insertions(+), 93 deletions(-) diff --git a/crashhandler/src/main.cpp b/crashhandler/src/main.cpp index bd0fe53a2c..55cd3a9dfd 100644 --- a/crashhandler/src/main.cpp +++ b/crashhandler/src/main.cpp @@ -44,6 +44,6 @@ int main(int argc, char **argv) { QTextStream out(stdout); out << e.getExceptionsText(); - return(~e.getErrorType()); + return(enum_cast(e.getErrorType())); } } diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 2e7d829dc9..10b1a6b19b 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -536,11 +536,11 @@ void TableObjectView::calculateBoundingRect(void) width = lables[i]->pos().x() + lables[i]->boundingRect().width(); } - bounding_rect = QRectF(QPointF(0,0), QSizeF(width + (4 * HorizSpacing), height + (1.5 * VertSpacing))); + bounding_rect = QRectF(QPointF(0,0), QSizeF(width + (4 * HorizSpacing), height + VertSpacing * 0.80)); //Adjusting the Y position of the objects in order to center them on the new bouding rect descriptor->setPos(descriptor->pos().x(), - (bounding_rect.height() - descriptor->boundingRect().height() + (VertSpacing * 0.75))/2); + (bounding_rect.height() - descriptor->boundingRect().height() + (VertSpacing * 0.4))/2); py = (bounding_rect.height() - lables[0]->boundingRect().height())/2; diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 2dfc5e7a79..0009fcfb5e 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -379,7 +379,7 @@ vector Catalog::getObjectsNames(vector obj_types, const { //Injecting the object type integer code in order to sort the final result sql.replace(sql.indexOf(select_kw), select_kw.size(), - QString("%1 %2 AS object_type, ").arg(select_kw).arg(~obj_type)); + QString("%1 %2 AS object_type, ").arg(select_kw).arg(enum_cast(obj_type))); sql+=QChar('\n'); queries.push_back(sql); @@ -431,7 +431,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, /* Insert the object type as an attribute of the query result to facilitate the import process on the classes that uses the Catalog */ - obj_attribs[Attributes::ObjectType]=QString("%1").arg(~obj_type); + obj_attribs[Attributes::ObjectType]=QString("%1").arg(enum_cast(obj_type)); return(obj_attribs); } @@ -458,7 +458,7 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ /* Insert the object type as an attribute of the query result to facilitate the import process on the classes that uses the Catalog */ - tuple[Attributes::ObjectType]=QString("%1").arg(~obj_type); + tuple[Attributes::ObjectType]=QString("%1").arg(enum_cast(obj_type)); obj_attribs.push_back(tuple); tuple.clear(); diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 9b2e4a7dbe..126d90a71f 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -109,7 +109,7 @@ QString BaseObject::getTypeName(ObjectType obj_type) /* Due to the class BaseObject not be derived from QObject the function tr() is inefficient to translate the type names thus the method called to do the translation is from the application specifying the context (BaseObject) in the ts file and the text to be translated */ - return(QApplication::translate("BaseObject",obj_type_names[~obj_type].toStdString().c_str(),"", -1)); + return(QApplication::translate("BaseObject",obj_type_names[enum_cast(obj_type)].toStdString().c_str(),"", -1)); else return(QString()); } @@ -137,12 +137,12 @@ ObjectType BaseObject::getObjectType(const QString &type_name) QString BaseObject::getSchemaName(ObjectType obj_type) { - return(objs_schemas[~obj_type]); + return(objs_schemas[enum_cast(obj_type)]); } QString BaseObject::getSQLName(ObjectType obj_type) { - return(objs_sql[~obj_type]); + return(objs_sql[enum_cast(obj_type)]); } QString BaseObject::formatName(const QString &name, bool is_operator) @@ -684,7 +684,7 @@ void BaseObject::setBasicAttributes(bool format_name) attributes[Attributes::Signature]=this->getSignature(format_name); if(attributes[Attributes::SqlObject].isEmpty()) - attributes[Attributes::SqlObject]=objs_sql[~this->obj_type]; + attributes[Attributes::SqlObject]=objs_sql[enum_cast(this->obj_type)]; } QString BaseObject::__getCodeDefinition(unsigned def_type) @@ -821,7 +821,7 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) try { - code_def+=schparser.getCodeDefinition(objs_schemas[~obj_type], attributes, def_type); + code_def+=schparser.getCodeDefinition(objs_schemas[enum_cast(obj_type)], attributes, def_type); //Internally disabling the SQL definition if(sql_disabled && def_type==SchemaParser::SqlDefinition) diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index e953214770..dff93e7ab3 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -75,12 +75,6 @@ enum class ObjectType: unsigned { BaseTable }; -//! \brief This unary operator overloading causes the provided ObjectType enum to be converted to its underlying datatype -constexpr std::underlying_type::type operator ~ (ObjectType obj_type) noexcept -{ - return(static_cast::type>(obj_type)); -} - class BaseObject { private: //! \brief Current PostgreSQL version used in SQL code generation diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index bc30807bfe..e3b594f821 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -31,9 +31,9 @@ //! \brief This enum is used to control the collapsing of the tables enum class CollapseMode: unsigned { - NotCollapsed, //Table is fully expanded (columns and extended attributes) - ExtAttribsCollapsed, //Extended attributes are collapsed AllAttribsCollapsed, //Columns (attributes) and extended attributes are collapsed + ExtAttribsCollapsed, //Extended attributes are collapsed + NotCollapsed //Table is fully expanded (columns and extended attributes) }; class BaseTable: public BaseGraphicObject { diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index df2c6bea48..f791b4a8e6 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3076,7 +3076,7 @@ void DatabaseModel::loadModel(const QString &filename) trUtf8("Loading: `%1' (%2)") .arg(object->getName()) .arg(object->getTypeName()), - ~obj_type); + enum_cast(obj_type)); } xmlparser.restorePosition(); @@ -3120,7 +3120,7 @@ void DatabaseModel::loadModel(const QString &filename) //If there are relationship make a relationship validation to recreate any special object left behind if(!relationships.empty()) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::Relationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), enum_cast(ObjectType::Relationship)); storeSpecialObjectsXML(); disconnectRelationships(); validateRelationships(); @@ -3128,13 +3128,13 @@ void DatabaseModel::loadModel(const QString &filename) this->setInvalidated(false); - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::Relationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), enum_cast(ObjectType::Relationship)); this->setObjectsModified({ObjectType::Relationship, ObjectType::BaseRelationship}); //Doing another relationship validation when there are inheritances to avoid incomplete tables if(found_inh_rel) { - emit s_objectLoaded(100, trUtf8("Validating relationships..."), ~ObjectType::Relationship); + emit s_objectLoaded(100, trUtf8("Validating relationships..."), enum_cast(ObjectType::Relationship)); validateRelationships(); updateTablesFKRelationships(); } @@ -4386,7 +4386,7 @@ Operator *DatabaseModel::createOperator(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[~ObjectType::Operator]) + if(elem==objs_schemas[enum_cast(ObjectType::Operator)]) { xmlparser.getElementAttributes(attribs); oper_aux=getObject(attribs[Attributes::Signature], ObjectType::Operator); @@ -4478,7 +4478,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) { elem=xmlparser.getElementName(); - if(elem==objs_schemas[~ObjectType::OpFamily]) + if(elem==objs_schemas[enum_cast(ObjectType::OpFamily)]) { xmlparser.getElementAttributes(attribs); object=getObject(attribs[Attributes::Signature], ObjectType::OpFamily); @@ -4692,11 +4692,11 @@ Table *DatabaseModel::createTable(void) xmlparser.savePosition(); object=nullptr; - if(elem==BaseObject::objs_schemas[~ObjectType::Column]) + if(elem==BaseObject::objs_schemas[enum_cast(ObjectType::Column)]) object=createColumn(); - else if(elem==BaseObject::objs_schemas[~ObjectType::Constraint]) + else if(elem==BaseObject::objs_schemas[enum_cast(ObjectType::Constraint)]) object=createConstraint(table); - else if(elem==BaseObject::objs_schemas[~ObjectType::Tag]) + else if(elem==BaseObject::objs_schemas[enum_cast(ObjectType::Tag)]) { xmlparser.getElementAttributes(aux_attribs); tag=getObject(aux_attribs[Attributes::Name], ObjectType::Tag); @@ -6919,7 +6919,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) msg.arg(def_type_str) .arg(object->getName()) .arg(object->getTypeName()), - ~object->getObjectType()); + enum_cast(object->getObjectType())); } } @@ -9614,7 +9614,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving object `%1' (%2)") - .arg(object->getName()).arg(object->getTypeName()), ~obj_type); + .arg(object->getName()).arg(object->getTypeName()), enum_cast(obj_type)); objs_def+=object->getCodeDefinition(SchemaParser::XmlDefinition); continue; @@ -9780,7 +9780,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving metadata of the object `%1' (%2)") - .arg(object->getSignature()).arg(object->getTypeName()), ~obj_type); + .arg(object->getSignature()).arg(object->getTypeName()), enum_cast(obj_type)); schparser.ignoreUnkownAttributes(true); objs_def+=schparser.convertCharsToXMLEntities( @@ -9803,10 +9803,10 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option Attributes::Metadata + GlobalAttributes::SchemaExt, attribs)); output.write(buf.data(),buf.size()); - emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), ~ObjectType::BaseObject); + emit s_objectLoaded(100, trUtf8("Metadata file successfully saved!"), enum_cast(ObjectType::BaseObject)); } else - emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), ~ObjectType::BaseObject); + emit s_objectLoaded(100, trUtf8("Process successfully ended but no metadata was saved!"), enum_cast(ObjectType::BaseObject)); output.close(); } @@ -9889,13 +9889,13 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(getObjectIndex(new_object->getName(), obj_type) < 0) { emit s_objectLoaded(progress, trUtf8("Creating object `%1' (%2)") - .arg(new_object->getName()).arg(new_object->getTypeName()), ~obj_type); + .arg(new_object->getName()).arg(new_object->getTypeName()), enum_cast(obj_type)); addObject(new_object); } else { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) already exists. Ignoring.") - .arg(new_object->getName()).arg(new_object->getTypeName()), ~ObjectType::BaseObject); + .arg(new_object->getName()).arg(new_object->getTypeName()), enum_cast(ObjectType::BaseObject)); delete(new_object); } @@ -9961,7 +9961,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(object) { emit s_objectLoaded(progress, trUtf8("Loading metadata for object `%1' (%2)") - .arg(object->getName()).arg(object->getTypeName()), ~obj_type); + .arg(object->getName()).arg(object->getTypeName()), enum_cast(obj_type)); if(!object->isSystemObject() && ((!attribs[Attributes::Protected].isEmpty() && load_objs_prot) || @@ -10090,7 +10090,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option else if(!object) { emit s_objectLoaded(progress, trUtf8("Object `%1' (%2) not found. Ignoring metadata.") - .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), ~ObjectType::BaseObject); + .arg(obj_name).arg(BaseObject::getTypeName(obj_type)), enum_cast(ObjectType::BaseObject)); } xmlparser.restorePosition(); @@ -10101,7 +10101,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option while(xmlparser.accessElement(XmlParser::NextElement)); } - emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), ~ObjectType::BaseObject); + emit s_objectLoaded(100, trUtf8("Metadata file successfully loaded!"), enum_cast(ObjectType::BaseObject)); setObjectsModified(); } catch(Exception &e) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 5f65914e41..201e93a7df 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -993,7 +993,7 @@ void DatabaseExplorerWidget::listObjects(void) root->setText(0, connection.getConnectionId(true)); root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("server"))); root->setData(DatabaseImportForm::ObjectId, Qt::UserRole, -1); - root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, ~ObjectType::BaseObject); + root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, enum_cast(ObjectType::BaseObject)); root->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); root->addChild(curr_root); objects_trw->addTopLevelItem(root); @@ -1097,7 +1097,7 @@ void DatabaseExplorerWidget::handleObject(QTreeWidgetItem *item, int) { openDataGrid(item->data(DatabaseImportForm::ObjectSchema, Qt::UserRole).toString(), item->text(0), - item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt() != ~ObjectType::View); + item->data(DatabaseImportForm::ObjectTypeId, Qt::UserRole).toUInt() != enum_cast(ObjectType::View)); } else if(exec_action) handleSelectedSnippet(exec_action->text()); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 94b97f7483..737184c05b 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -643,7 +643,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { task_prog_wgt.setWindowTitle(trUtf8("Retrieving objects from database...")); task_prog_wgt.show(); - task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), ~ObjectType::Database); + task_prog_wgt.updateProgress(1, trUtf8("Retrieving cluster level objects..."), enum_cast(ObjectType::Database)); } tree_wgt->clear(); @@ -661,7 +661,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW attribs=catalog.getObjectsAttributes(ObjectType::Database, QString(), QString(), {}, {{Attributes::Name, import_helper.getCurrentDatabase()}}); db_item->setData(ObjectId, Qt::UserRole, attribs[0].at(Attributes::Oid).toUInt()); - db_item->setData(ObjectTypeId, Qt::UserRole, ~ObjectType::Database); + db_item->setData(ObjectTypeId, Qt::UserRole, enum_cast(ObjectType::Database)); db_item->setToolTip(0, QString("OID: %1").arg(attribs[0].at(Attributes::Oid))); tree_wgt->addTopLevelItem(db_item); @@ -690,7 +690,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW while(!sch_items.empty()) { - task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), ~ObjectType::Schema); + task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of schema `%1'...").arg(sch_items.back()->text(0)), enum_cast(ObjectType::Schema)); //Retrieving and listing the schema scoped objects tab_items=DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, @@ -704,7 +704,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW if(aux_prog > 99) aux_prog=99; obj_type = static_cast(tab_items.back()->data(ObjectTypeId, Qt::UserRole).toUInt()); - task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of `%1' (%2)...").arg(tab_items.back()->text(0)).arg(BaseObject::getTypeName(obj_type)), ~obj_type); + task_prog_wgt.updateProgress(static_cast(aux_prog), trUtf8("Retrieving objects of `%1' (%2)...").arg(tab_items.back()->text(0)).arg(BaseObject::getTypeName(obj_type)), enum_cast(obj_type)); DatabaseImportForm::updateObjectsTree(import_helper, tree_wgt, BaseObject::getChildObjectTypes(obj_type), checkable_items, disable_empty_grps, tab_items.back(), sch_items.back()->text(0), tab_items.back()->text(0)); @@ -774,7 +774,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe //Group items does contains a zero valued id to indicate that is not a valide object group->setData(ObjectId, Qt::UserRole, 0); - group->setData(ObjectTypeId, Qt::UserRole, ~grp_type); + group->setData(ObjectTypeId, Qt::UserRole, enum_cast(grp_type)); group->setData(ObjectCount, Qt::UserRole, 0); group->setData(ObjectSchema, Qt::UserRole, schema); group->setData(ObjectTable, Qt::UserRole, table); @@ -855,7 +855,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe item->setToolTip(0,tooltip.arg(oid)); //Stores the object's type as the second data of the item - item->setData(ObjectTypeId, Qt::UserRole, ~obj_type); + item->setData(ObjectTypeId, Qt::UserRole, enum_cast(obj_type)); //Stores the schema and the table's name of the object item->setData(ObjectSchema, Qt::UserRole, schema); diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index cdd28ca9ce..339ba3bc85 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -388,12 +388,12 @@ void DataManipulationForm::retrieveData(void) clearChangedRows(); //If the table is empty automatically creates a new row - if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()== ~ObjectType::Table) + if(results_tbw->rowCount()==0 && table_cmb->currentData(Qt::UserRole).toUInt()== enum_cast(ObjectType::Table)) addRow(); else results_tbw->setFocus(); - if(table_cmb->currentData(Qt::UserRole).toUInt()== ~ObjectType::Table) + if(table_cmb->currentData(Qt::UserRole).toUInt()== enum_cast(ObjectType::Table)) csv_load_tb->setEnabled(!col_names.isEmpty()); else { @@ -407,10 +407,10 @@ void DataManipulationForm::retrieveData(void) QApplication::restoreOverrideCursor(); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == ~ObjectType::Table && + table_cmb->currentData().toUInt() == enum_cast(ObjectType::Table) && !col_names.isEmpty()); - truncate_tb->setEnabled(table_cmb->currentData().toUInt() == ~ObjectType::Table && + truncate_tb->setEnabled(table_cmb->currentData().toUInt() == enum_cast(ObjectType::Table) && res.getTupleCount() > 0 && !col_names.isEmpty()); @@ -476,7 +476,7 @@ void DataManipulationForm::enableRowControlButtons(void) duplicate_tb->setEnabled(cols_selected); copy_tb->setEnabled(sel_ranges.count() != 0); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && - table_cmb->currentData().toUInt() == ~ObjectType::Table && + table_cmb->currentData().toUInt() == enum_cast(ObjectType::Table) && !col_names.isEmpty()); browse_tabs_tb->setEnabled((!fk_infos.empty() || !ref_fk_infos.empty()) && sel_ranges.count() == 1 && sel_ranges.at(0).rowCount() == 1); bulkedit_tb->setEnabled(sel_ranges.count() != 0); @@ -690,7 +690,7 @@ void DataManipulationForm::listObjects(QComboBox *combo, vector obj_ for(; idx < count; idx++) { combo->setItemIcon(idx, QPixmap(PgModelerUiNs::getIconPath(obj_type))); - combo->setItemData(idx, ~obj_type); + combo->setItemData(idx, enum_cast(obj_type)); } idx=count; diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 29bbc72d6f..fd335bee90 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -120,7 +120,7 @@ void ModelObjectsWidget::editObject(void) { //If the user double-clicked the item "Permission (n)" on tree view if(sender()==objectstree_tw && objectstree_tw->currentItem() && - objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt() == ~ObjectType::Permission) + objectstree_tw->currentItem()->data(1, Qt::UserRole).toUInt() == enum_cast(ObjectType::Permission)) model_wgt->showObjectForm(ObjectType::Permission, reinterpret_cast(objectstree_tw->currentItem()->data(0, Qt::UserRole).value())); //If the user double-clicked a permission on list view else if(sender()==objectslist_tbw && objectslist_tbw->currentRow() >= 0) @@ -171,7 +171,7 @@ void ModelObjectsWidget::selectObject(void) //If not a relationship, connect the action to the addNewObject method of the model wiget if(obj_type!=ObjectType::Relationship) { - act.setData(QVariant(~obj_type)); + act.setData(QVariant(enum_cast(obj_type))); connect(&act, SIGNAL(triggered()), model_wgt, SLOT(addNewObject())); } //Case is a relationship, insert the relationship menu of the model wiget into the action @@ -479,7 +479,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) count=(db_model->getObjectCount(ObjectType::Schema)); item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setData(1, Qt::UserRole, QVariant(~ObjectType::Schema)); + item->setData(1, Qt::UserRole, QVariant(enum_cast(ObjectType::Schema))); //Create the schema group item item->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(ObjectType::Schema)).arg(count)); @@ -523,7 +523,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) count2=obj_list.size(); item3->setText(0, QString("%1 (%2)").arg(BaseObject::getTypeName(type)).arg(count2)); - item3->setData(1, Qt::UserRole, QVariant(~type)); + item3->setData(1, Qt::UserRole, QVariant(enum_cast(type))); font=item3->font(0); font.setItalic(true); @@ -563,7 +563,7 @@ void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *sche item->setIcon(0,group_icon); item->setText(0,BaseObject::getTypeName(ObjectType::Table) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant(~ObjectType::Table)); + item->setData(1, Qt::UserRole, QVariant(enum_cast(ObjectType::Table))); font=item->font(0); font.setItalic(true); @@ -623,7 +623,7 @@ void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schem item->setIcon(0,group_icon); item->setText(0,BaseObject::getTypeName(ObjectType::View) + QString(" (%1)").arg(obj_list.size())); - item->setData(1, Qt::UserRole, QVariant(~ObjectType::View)); + item->setData(1, Qt::UserRole, QVariant(enum_cast(ObjectType::View))); font=item->font(0); font.setItalic(true); @@ -736,7 +736,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) str_aux=QString(BaseObject::getSchemaName(types[i])); item1->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(str_aux + QString("_grp")))); - item1->setData(1, Qt::UserRole, QVariant(~types[i])); + item1->setData(1, Qt::UserRole, QVariant(enum_cast(types[i]))); obj_list=(*db_model->getObjectList(types[i])); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 7062d01690..79e465bf9f 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -364,7 +364,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) for(i=0; i < obj_cnt; i++) { actions_new_objects[types[i]]=new QAction(QIcon(PgModelerUiNs::getIconPath(types[i])), BaseObject::getTypeName(types[i]), this); - actions_new_objects[types[i]]->setData(QVariant(~types[i])); + actions_new_objects[types[i]]->setData(QVariant(enum_cast(types[i]))); connect(actions_new_objects[types[i]], SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); } @@ -380,7 +380,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) BaseRelationship::getRelationshipTypeName(rel_types_id[i], false), this); //Storing a unique identifier for the relationship type - action->setData(QVariant(~ObjectType::Relationship + rel_types_id[i])); + action->setData(QVariant(enum_cast(ObjectType::Relationship) + rel_types_id[i])); connect(action, SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); rels_menu->addAction(action); @@ -409,7 +409,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) select_all_menu.addAction(action); } - action->setData(QVariant(~obj_type)); + action->setData(QVariant(enum_cast(obj_type))); connect(action, SIGNAL(triggered(bool)), this, SLOT(selectAllObjects())); } @@ -1663,7 +1663,7 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb to the BaseRelationship::RELATIONSHIP_??? constant. */ if(obj_type > ObjectType::BaseTable) { - rel_type=~obj_type - ~ObjectType::Relationship; + rel_type=enum_cast(obj_type) - enum_cast(ObjectType::Relationship); obj_type=ObjectType::Relationship; } @@ -2369,7 +2369,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Validating object: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), - ~object->getObjectType()); + enum_cast(object->getObjectType())); if(!tab_obj || ((sel_table || sel_view) && tab_obj)) { @@ -2471,7 +2471,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Generating XML for: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), - ~object->getObjectType()); + enum_cast(object->getObjectType())); if(!tab_obj) { @@ -2575,7 +2575,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Pasting object: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), - ~object->getObjectType()); + enum_cast(object->getObjectType())); //Creates the object from the XML object=db_model->createObject(BaseObject::getObjectType(xmlparser->getElementName())); @@ -3294,13 +3294,13 @@ void ModelWidget::configureFadeMenu(void) { action = new QAction(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp"))), labels[id], &fade_in_menu); - action->setData(~type); + action->setData(enum_cast(type)); fade_in_menu.addAction(action); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); action = new QAction(QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp"))), labels[id], &fade_out_menu); - action->setData(~type); + action->setData(enum_cast(type)); fade_out_menu.addAction(action); id++; @@ -3308,13 +3308,13 @@ void ModelWidget::configureFadeMenu(void) } action = new QAction(trUtf8("All objects"), &fade_in_menu); - action->setData(~ObjectType::BaseObject); + action->setData(enum_cast(ObjectType::BaseObject)); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); fade_in_menu.addSeparator(); fade_in_menu.addAction(action); action = new QAction(trUtf8("All objects"), &fade_out_menu); - action->setData(~ObjectType::BaseObject); + action->setData(enum_cast(ObjectType::BaseObject)); connect(action, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); fade_out_menu.addSeparator(); fade_out_menu.addAction(action); diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index a33bbeaf8b..b16a63198a 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -478,7 +478,7 @@ void ObjectFinderWidget::updateObjectTypeList(QListWidget *list_wgt) //By default all object types are checked item->setCheckState(Qt::Checked); - item->setData(Qt::UserRole, QVariant(~types[type_id])); + item->setData(Qt::UserRole, QVariant(enum_cast(types[type_id]))); list_wgt->insertItem(type_id, item); } } diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index 559bbe2ddb..cfed8d40f5 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -93,7 +93,7 @@ void OperationListWidget::updateOperationList(void) item=new QTreeWidgetItem; str_aux=QString(BaseObject::getSchemaName(obj_type)); - item->setData(0, Qt::UserRole, QVariant(~obj_type)); + item->setData(0, Qt::UserRole, QVariant(enum_cast(obj_type))); if(obj_type==ObjectType::BaseRelationship) str_aux+=QString("tv"); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index a18b5698c1..79dd7baedc 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -263,7 +263,7 @@ namespace PgModelerUiNs { text=QString("%1 (%2)").arg(ex.getFile()).arg(ex.getLine()); createOutputTreeItem(exceptions_trw, text, QPixmap(getIconPath("codigofonte")), item, false, true); - text=QString("%1 (%2)").arg(Exception::getErrorCode(ex.getErrorType())).arg(~ex.getErrorType()); + text=QString("%1 (%2)").arg(Exception::getErrorCode(ex.getErrorType())).arg(enum_cast(ex.getErrorType())); createOutputTreeItem(exceptions_trw, text, QPixmap(getIconPath("msgbox_alerta")), item, false, true); child_item=createOutputTreeItem(exceptions_trw, ex.getErrorMessage(), QPixmap(getIconPath("msgbox_erro")), item, false, true); diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 4b8a48f0db..778f4c718f 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -42,14 +42,14 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( for(auto &itr : types_map) { ico.load(PgModelerUiNs::getIconPath(itr.second)); - applies_to_cmb->addItem(ico, itr.first, ~itr.second); - filter_cmb->addItem(ico, itr.first, ~itr.second); + applies_to_cmb->addItem(ico, itr.first, enum_cast(itr.second)); + filter_cmb->addItem(ico, itr.first, enum_cast(itr.second)); } - applies_to_cmb->insertItem(0, gen_purpose, ~ObjectType::BaseObject); + applies_to_cmb->insertItem(0, gen_purpose, enum_cast(ObjectType::BaseObject)); applies_to_cmb->setCurrentIndex(0); - filter_cmb->insertItem(0, gen_purpose, ~ObjectType::BaseObject); + filter_cmb->insertItem(0, gen_purpose, enum_cast(ObjectType::BaseObject)); filter_cmb->insertItem(0, trUtf8("All snippets")); filter_cmb->setCurrentIndex(0); diff --git a/libpgmodeler_ui/src/taskprogresswidget.cpp b/libpgmodeler_ui/src/taskprogresswidget.cpp index 82678ccfb1..5b16dbe4ce 100644 --- a/libpgmodeler_ui/src/taskprogresswidget.cpp +++ b/libpgmodeler_ui/src/taskprogresswidget.cpp @@ -28,7 +28,7 @@ TaskProgressWidget::TaskProgressWidget(QWidget *parent, Qt::WindowFlags f) : QDi this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); for(auto &obj_tp : obj_types) - addIcon(~obj_tp, QIcon(PgModelerUiNs::getIconPath(obj_tp))); + addIcon(enum_cast(obj_tp), QIcon(PgModelerUiNs::getIconPath(obj_tp))); } void TaskProgressWidget::addIcon(unsigned id, const QIcon &ico) diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index c1dd5d8e71..865116673e 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -278,7 +278,7 @@ Exception::Exception(ErrorCode error_code, const QString &method, const QString /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - configureException(QApplication::translate("Exception",messages[static_cast(error_code)][ErrorMessage].toStdString().c_str(),"", -1), + configureException(QApplication::translate("Exception",messages[enum_cast(error_code)][ErrorMessage].toStdString().c_str(),"", -1), error_code, method, file, line, extra_info); if(exception) addException(*exception); @@ -297,7 +297,7 @@ Exception::Exception(ErrorCode error_code, const QString &method, const QString /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - configureException(QApplication::translate("Exception",messages[static_cast(error_code)][ErrorMessage].toStdString().c_str(),"",-1), + configureException(QApplication::translate("Exception",messages[enum_cast(error_code)][ErrorMessage].toStdString().c_str(),"",-1), error_code, method, file, line, extra_info); itr=exceptions.begin(); @@ -354,19 +354,19 @@ QString Exception::getErrorMessage(void) QString Exception::getErrorMessage(ErrorCode error_code) { - if(static_cast(error_code) < ErrorCount) + if(enum_cast(error_code) < ErrorCount) /* Because the Exception class is not derived from QObject the function tr() is inefficient to translate messages so the translation method is called directly from the application specifying the context (Exception) in the ts file and the text to be translated */ - return(QApplication::translate("Exception", messages[static_cast(error_code)][ErrorMessage].toStdString().c_str(), "", -1)); + return(QApplication::translate("Exception", messages[enum_cast(error_code)][ErrorMessage].toStdString().c_str(), "", -1)); else return(QString()); } QString Exception::getErrorCode(ErrorCode error_code) { - if(static_cast(error_code) < ErrorCount) - return(messages[static_cast(error_code)][ErrorCodeId]); + if(enum_cast(error_code) < ErrorCount) + return(messages[enum_cast(error_code)][ErrorCodeId]); else return(QString()); } diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 2549fcb552..3aa08239b4 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -35,6 +35,13 @@ using namespace std; +//! \brief This function causes the provided enum to be converted to its underlying datatype +template +constexpr std::underlying_type_t enum_cast (Enum obj_type) noexcept +{ + return(static_cast>(obj_type)); +} + //! \brief This enum defines the global error codes used throughout the application enum class ErrorCode: unsigned { Custom, @@ -280,15 +287,9 @@ enum class ErrorCode: unsigned { RemColumnRefByPartitionKey }; -//! \brief This unary operator overloading causes the provided enum to be converted to its underlying datatype -constexpr std::underlying_type::type operator ~ (ErrorCode err_code) noexcept -{ - return(static_cast::type>(err_code)); -} - class Exception { private: - static constexpr int ErrorCount=241; + static constexpr unsigned ErrorCount=241; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ diff --git a/main-cli/src/main.cpp b/main-cli/src/main.cpp index cb332a9bb0..73c07ee793 100644 --- a/main-cli/src/main.cpp +++ b/main-cli/src/main.cpp @@ -49,7 +49,7 @@ int main(int argc, char **argv) out << endl; out << e.getExceptionsText(); out << QString("** pgmodeler-cli aborted due to critical error(s). **") << endl << endl; - return(e.getErrorType()==ErrorCode::Custom ? -1 : ~e.getErrorType()); + return(e.getErrorType()==ErrorCode::Custom ? -1 : enum_cast(e.getErrorType())); } #endif } diff --git a/main/src/main.cpp b/main/src/main.cpp index 2642d6ebd4..491ecf3fe8 100644 --- a/main/src/main.cpp +++ b/main/src/main.cpp @@ -150,6 +150,6 @@ int main(int argc, char **argv) { QTextStream ts(stdout); ts << e.getExceptionsText(); - return(~e.getErrorType()); + return(enum_cast(e.getErrorType())); } } From 4a5b47043ad7bb809b9a6d092c5f1816d47b7d62 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 8 Nov 2018 23:32:40 -0300 Subject: [PATCH 218/425] Added an extra button to AttributesTogglerItem to allow expanding and collapsing of tables to be controlled independently --- libobjrenderer/src/attributestoggleritem.cpp | 97 +++++++++++--------- libobjrenderer/src/attributestoggleritem.h | 13 ++- 2 files changed, 59 insertions(+), 51 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index 48d5d71155..f1f90fcbe2 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -26,29 +26,30 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec { this->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); - for(unsigned arr_id = 0; arr_id < 3; arr_id++) + for(unsigned arr_id = 0; arr_id < 4; arr_id++) { arrows[arr_id] = new QGraphicsPolygonItem; arrows_selected[arr_id] = false; } - arrows[AttribsToggler]->setToolTip(trUtf8("Toggles the display of columns and extended attributes")); + arrows[AttribsExpandArrow]->setToolTip(trUtf8("Expands the currently collapsed section of the object")); + arrows[AttribsCollapseArrow]->setToolTip(trUtf8("Collapses the currently expanded section of the object")); arrows[NextAttribsArrow]->setToolTip(trUtf8("Display the next columns page")); arrows[PrevAttribsArrow]->setToolTip(trUtf8("Display the previous columns page")); - arrow_inverted = has_ext_attribs = false; + has_ext_attribs = false; collapse_mode = CollapseMode::NotCollapsed; arrows_width = 0; } void AttributesTogglerItem::setArrowsBrush(const QBrush &brush) { - for(unsigned arr_id = 0; arr_id < 3; arr_id++) + for(unsigned arr_id = 0; arr_id < 4; arr_id++) arrows[arr_id]->setBrush(brush); } void AttributesTogglerItem::setArrowsPen(const QPen &pen) { - for(unsigned arr_id = 0; arr_id < 3; arr_id++) + for(unsigned arr_id = 0; arr_id < 4; arr_id++) arrows[arr_id]->setPen(pen); } @@ -67,10 +68,12 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) { QRectF rect; double h_spacing = 4 * BaseObjectView::HorizSpacing; + unsigned coll_mode = static_cast(collapse_mode); this->setToolTip(QString()); + clearArrowSelection(); - for(unsigned arr_id = 0; arr_id < 3; arr_id++) + for(unsigned arr_id = 0; arr_id < 4; arr_id++) { rect.setSize(QSizeF(arrows[arr_id]->boundingRect().width() + h_spacing, this->boundingRect().height())); rect.moveTo(arrows[arr_id]->pos().x() - (h_spacing/2), 0); @@ -80,26 +83,23 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) { this->setToolTip(arrows[arr_id]->toolTip()); - if(clicked && arr_id == AttribsToggler) + if(clicked) { - if(collapse_mode == CollapseMode::NotCollapsed) - { - collapse_mode = (has_ext_attribs ? CollapseMode::ExtAttribsCollapsed : CollapseMode::AllAttribsCollapsed); - arrow_inverted = false; - } - else if(collapse_mode == CollapseMode::ExtAttribsCollapsed) - collapse_mode = (arrow_inverted ? CollapseMode::NotCollapsed : CollapseMode::AllAttribsCollapsed); - else if(collapse_mode == CollapseMode::AllAttribsCollapsed) - { - collapse_mode = (has_ext_attribs ? CollapseMode::ExtAttribsCollapsed : CollapseMode::NotCollapsed); - arrow_inverted = true; - } + if(arr_id == AttribsExpandArrow) + coll_mode++; + else if(arr_id == AttribsCollapseArrow) + coll_mode--; + + if(coll_mode > enum_cast(CollapseMode::NotCollapsed)) + collapse_mode = (arr_id == AttribsExpandArrow ? CollapseMode::NotCollapsed : CollapseMode::AllAttribsCollapsed); else - collapse_mode = CollapseMode::NotCollapsed; + collapse_mode = static_cast(coll_mode); configureButtons(this->rect()); emit s_collapseModeChanged(collapse_mode); } + + break; } } @@ -113,7 +113,7 @@ void AttributesTogglerItem::setHasExtAttributes(bool value) void AttributesTogglerItem::clearArrowSelection(void) { - for(unsigned arr_id = 0; arr_id < 3; arr_id++) + for(unsigned arr_id = 0; arr_id < 4; arr_id++) arrows_selected[arr_id] = false; this->update(); @@ -130,7 +130,7 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(), factor = fnt_factor * pixel_ratio, arr_width = 0, px = 0, - h_spacing = 8 * BaseObjectView::HorizSpacing, + h_spacing = 6 * BaseObjectView::HorizSpacing, height = 4 * BaseObjectView::VertSpacing; QPolygonF pol; QRectF new_rect = rect; @@ -149,53 +149,62 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) arr_width += pol.boundingRect().width() + h_spacing; pol.clear(); - if(collapse_mode == CollapseMode::NotCollapsed || - (!arrow_inverted && collapse_mode == CollapseMode::ExtAttribsCollapsed)) - { - pol.append(QPointF(5 * factor, 0)); - pol.append(QPointF(0, 8 * factor)); - pol.append(QPointF(10 * factor, 8 * factor)); - } - else - { - pol.append(QPointF(0, 0)); - pol.append(QPointF(10 * factor, 0)); - pol.append(QPointF(5 * factor, 8 * factor)); - } + pol.append(QPointF(5 * factor, 0)); + pol.append(QPointF(0, 8 * factor)); + pol.append(QPointF(10 * factor, 8 * factor)); + arrows[AttribsCollapseArrow]->setPolygon(pol); + arr_width += pol.boundingRect().width() + h_spacing; - arrows[AttribsToggler]->setPolygon(pol); - arr_width += pol.boundingRect().width(); - arrows_width = arr_width + h_spacing; + pol.clear(); + pol.append(QPointF(0, 0)); + pol.append(QPointF(10 * factor, 0)); + pol.append(QPointF(5 * factor, 8 * factor)); + arrows[AttribsExpandArrow]->setPolygon(pol); + arr_width += pol.boundingRect().width() + h_spacing; + + arrows_width = arr_width; new_rect.setHeight(height); RoundedRectItem::setRect(new_rect); - px = (new_rect.width() - arr_width)/2; + px = (new_rect.width() - arr_width + h_spacing)/2; arrows[PrevAttribsArrow]->setPos(px, (new_rect.height() - arrows[PrevAttribsArrow]->boundingRect().height())/2); px += arrows[PrevAttribsArrow]->boundingRect().width() + h_spacing; arrows[NextAttribsArrow]->setPos(px, (new_rect.height() - arrows[NextAttribsArrow]->boundingRect().height())/2); - px += arrows[NextAttribsArrow]->boundingRect().width() + h_spacing * 0.80; + px += arrows[NextAttribsArrow]->boundingRect().width() + h_spacing; + + arrows[AttribsCollapseArrow]->setPos(px, (new_rect.height() - arrows[AttribsCollapseArrow]->boundingRect().height())/2); + px += arrows[AttribsCollapseArrow]->boundingRect().width() + h_spacing * 0.80; - arrows[AttribsToggler]->setPos(px, (new_rect.height() - arrows[AttribsToggler]->boundingRect().height())/2); + arrows[AttribsExpandArrow]->setPos(px, (new_rect.height() - arrows[AttribsExpandArrow]->boundingRect().height())/2); } void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + double p_opacity = 1; RoundedRectItem::paint(painter, option, widget); - for(unsigned arr_id = 0; arr_id < 3; arr_id++) + for(unsigned arr_id = 0; arr_id < 4; arr_id++) { painter->save(); painter->translate(arrows[arr_id]->pos()); + + if((collapse_mode == CollapseMode::NotCollapsed && arr_id == AttribsExpandArrow) || + (collapse_mode == CollapseMode::AllAttribsCollapsed && arr_id == AttribsCollapseArrow)) + p_opacity = 0.40; + else + p_opacity = 1; + + painter->setOpacity(p_opacity); arrows[arr_id]->paint(painter, option, widget); painter->restore(); - if(arrows_selected[arr_id]) + if(arrows_selected[arr_id] && p_opacity > 0.40) { QRectF sel_rect; - QSizeF size = QSizeF(arrows[AttribsToggler]->boundingRect().size().width() + (2 * BaseObjectView::HorizSpacing), + QSizeF size = QSizeF(arrows[AttribsExpandArrow]->boundingRect().size().width() + (2 * BaseObjectView::HorizSpacing), arrows[PrevAttribsArrow]->boundingRect().size().height() + BaseObjectView::HorizSpacing); double tx = 0, ty = 0, arr_x = arrows[arr_id]->pos().x(); diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index aa06b43d50..56e8147c3f 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -36,19 +36,18 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { CollapseMode collapse_mode; - QGraphicsPolygonItem *arrows[3]; + QGraphicsPolygonItem *arrows[4]; - bool arrows_selected[3], - - arrow_inverted, + bool arrows_selected[4], has_ext_attribs; double arrows_width; - static constexpr unsigned AttribsToggler=0, - NextAttribsArrow=1, - PrevAttribsArrow=2; + static constexpr unsigned AttribsExpandArrow=0, + AttribsCollapseArrow=1, + NextAttribsArrow=2, + PrevAttribsArrow=3; void configureButtons(const QRectF &rect); From 94c182c1127f5178d2c2740c5def67e21b8368df Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 9 Nov 2018 17:24:19 -0300 Subject: [PATCH 219/425] Added a rudimentary logic to control attribute pagination buttons on AttributesTogglerItem --- libobjrenderer/src/attributestoggleritem.cpp | 117 +++++++++++++------ libobjrenderer/src/attributestoggleritem.h | 9 ++ libobjrenderer/src/basetableview.cpp | 6 +- 3 files changed, 91 insertions(+), 41 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index f1f90fcbe2..3e48e2c175 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -26,6 +26,8 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec { this->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); + sel_rect = new QGraphicsRectItem; + for(unsigned arr_id = 0; arr_id < 4; arr_id++) { arrows[arr_id] = new QGraphicsPolygonItem; @@ -34,11 +36,22 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec arrows[AttribsExpandArrow]->setToolTip(trUtf8("Expands the currently collapsed section of the object")); arrows[AttribsCollapseArrow]->setToolTip(trUtf8("Collapses the currently expanded section of the object")); - arrows[NextAttribsArrow]->setToolTip(trUtf8("Display the next columns page")); - arrows[PrevAttribsArrow]->setToolTip(trUtf8("Display the previous columns page")); + arrows[NextAttribsArrow]->setToolTip(trUtf8("Display the next attributes page")); + arrows[PrevAttribsArrow]->setToolTip(trUtf8("Display the previous attributes page")); has_ext_attribs = false; collapse_mode = CollapseMode::NotCollapsed; arrows_width = 0; + curr_attribs_page = 0; + max_attribs_pages = 5; + configureButtonsState(); +} + +AttributesTogglerItem::~AttributesTogglerItem(void) +{ + for(unsigned arr_id = 0; arr_id < 4; arr_id++) + delete(arrows[arr_id]); + + delete(sel_rect); } void AttributesTogglerItem::setArrowsBrush(const QBrush &brush) @@ -85,27 +98,78 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) if(clicked) { - if(arr_id == AttribsExpandArrow) - coll_mode++; - else if(arr_id == AttribsCollapseArrow) - coll_mode--; - - if(coll_mode > enum_cast(CollapseMode::NotCollapsed)) - collapse_mode = (arr_id == AttribsExpandArrow ? CollapseMode::NotCollapsed : CollapseMode::AllAttribsCollapsed); - else - collapse_mode = static_cast(coll_mode); - + if(arr_id == AttribsExpandArrow || arr_id == AttribsCollapseArrow) + { + if(arr_id == AttribsExpandArrow) + coll_mode++; + else if(arr_id == AttribsCollapseArrow) + coll_mode--; + + if(!has_ext_attribs && static_cast(coll_mode) == CollapseMode::ExtAttribsCollapsed) + coll_mode += (arr_id == AttribsExpandArrow ? 1 : -1); + + if(coll_mode > enum_cast(CollapseMode::NotCollapsed)) + collapse_mode = (arr_id == AttribsExpandArrow ? CollapseMode::NotCollapsed : CollapseMode::AllAttribsCollapsed); + else + collapse_mode = static_cast(coll_mode); + + emit s_collapseModeChanged(collapse_mode); + } + else if(max_attribs_pages != 0) + { + if(arr_id == PrevAttribsArrow) + curr_attribs_page--; + else if(arr_id == NextAttribsArrow) + curr_attribs_page++; + + if(curr_attribs_page >= max_attribs_pages) + curr_attribs_page = (arr_id == PrevAttribsArrow ? 0 : max_attribs_pages - 1); + + #warning "Just a test! The signal emitted here is for page change" + emit s_collapseModeChanged(collapse_mode); + } + + clearArrowSelection(); configureButtons(this->rect()); - emit s_collapseModeChanged(collapse_mode); + } + else + { + //Configuring the selection rectangle if the arrows isn't clicked + QRectF rect; + QSizeF size = QSizeF(arrows[AttribsExpandArrow]->boundingRect().size().width() + (2 * BaseObjectView::HorizSpacing), + arrows[PrevAttribsArrow]->boundingRect().size().height() + BaseObjectView::HorizSpacing); + double px = 0, py = 0, arr_x = arrows[arr_id]->pos().x(); + + rect.setSize(size); + px = arr_x - (((arr_x + size.width()) - (arr_x + arrows[arr_id]->boundingRect().width()))/2); + py = (this->boundingRect().size().height() - size.height())/2.5; + + sel_rect->setBrush(BaseObjectView::getFillStyle(Attributes::ObjSelection)); + sel_rect->setPen(BaseObjectView::getBorderStyle(Attributes::ObjSelection)); + sel_rect->setRect(rect); + sel_rect->setPos(px, py); } break; } } + configureButtonsState(); this->update(); } +void AttributesTogglerItem::configureButtonsState(void) +{ + arrows[AttribsExpandArrow]->setOpacity(collapse_mode == CollapseMode::ExtAttribsCollapsed || + collapse_mode == CollapseMode::AllAttribsCollapsed? 1 : 0.40); + + arrows[AttribsCollapseArrow]->setOpacity(collapse_mode == CollapseMode::ExtAttribsCollapsed || + collapse_mode == CollapseMode::NotCollapsed ? 1 : 0.40); + + arrows[PrevAttribsArrow]->setOpacity(max_attribs_pages != 0 && curr_attribs_page > 0 ? 1 : 0.40); + arrows[NextAttribsArrow]->setOpacity(max_attribs_pages != 0 && curr_attribs_page < max_attribs_pages - 1 ? 1 : 0.40); +} + void AttributesTogglerItem::setHasExtAttributes(bool value) { has_ext_attribs = value; @@ -183,40 +247,21 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - double p_opacity = 1; RoundedRectItem::paint(painter, option, widget); for(unsigned arr_id = 0; arr_id < 4; arr_id++) { painter->save(); painter->translate(arrows[arr_id]->pos()); - - if((collapse_mode == CollapseMode::NotCollapsed && arr_id == AttribsExpandArrow) || - (collapse_mode == CollapseMode::AllAttribsCollapsed && arr_id == AttribsCollapseArrow)) - p_opacity = 0.40; - else - p_opacity = 1; - - painter->setOpacity(p_opacity); + painter->setOpacity(arrows[arr_id]->opacity()); arrows[arr_id]->paint(painter, option, widget); painter->restore(); - if(arrows_selected[arr_id] && p_opacity > 0.40) + if(arrows_selected[arr_id] && arrows[arr_id]->opacity() > 0.40) { - QRectF sel_rect; - QSizeF size = QSizeF(arrows[AttribsExpandArrow]->boundingRect().size().width() + (2 * BaseObjectView::HorizSpacing), - arrows[PrevAttribsArrow]->boundingRect().size().height() + BaseObjectView::HorizSpacing); - double tx = 0, ty = 0, arr_x = arrows[arr_id]->pos().x(); - - sel_rect.setSize(size); - tx = arr_x - (((arr_x + size.width()) - (arr_x + arrows[arr_id]->boundingRect().width()))/2); - ty = (this->boundingRect().size().height() - size.height())/2.5; - painter->save(); - painter->translate(tx, ty); - painter->setBrush(BaseObjectView::getFillStyle(Attributes::ObjSelection)); - painter->setPen(BaseObjectView::getBorderStyle(Attributes::ObjSelection)); - painter->drawRect(sel_rect); + painter->translate(sel_rect->pos()); + sel_rect->paint(painter, option, widget); painter->restore(); } } diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index 56e8147c3f..77ae7b2a7e 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -34,6 +34,8 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { private: Q_OBJECT + QGraphicsRectItem *sel_rect; + CollapseMode collapse_mode; QGraphicsPolygonItem *arrows[4]; @@ -44,15 +46,21 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { double arrows_width; + unsigned curr_attribs_page, + + max_attribs_pages; + static constexpr unsigned AttribsExpandArrow=0, AttribsCollapseArrow=1, NextAttribsArrow=2, PrevAttribsArrow=3; void configureButtons(const QRectF &rect); + void configureButtonsState(void); public: AttributesTogglerItem(QGraphicsItem *parent = nullptr); + ~AttributesTogglerItem(void); void setArrowsBrush(const QBrush &brush); void setArrowsPen(const QPen &pen); @@ -67,6 +75,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { signals: void s_collapseModeChanged(CollapseMode); + void s_currentAttribsPageChanged(unsigned); }; #endif diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 90a08e7729..c758003e69 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -186,7 +186,7 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) } //Calculates the default item height - cols_height=roundf((columns->boundingRect().height() + ext_height) / static_cast(items.size())); + cols_height=(columns->boundingRect().height() + ext_height + (2*VertSpacing)) / static_cast(items.size()); //Calculates the item index based upon the mouse position rect=this->mapRectToItem(title, title->boundingRect()); @@ -204,7 +204,6 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) } else if(!items.isEmpty()) { - //QPolygonF pol; BaseObjectView *item=dynamic_cast(items[item_idx]); //Configures the selection with the item's dimension @@ -414,9 +413,6 @@ void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object this->setFlag(QGraphicsItem::ItemIsSelectable, false); - dynamic_cast(this->getSourceObject()) - ->setExtAttribsHidden(!dynamic_cast(this->getSourceObject())->isExtAttribsHidden()); - dynamic_cast(this->getSourceObject())->setCollapseMode(coll_mode); //Updating the object geometry to show/hide the extended attributes From 6fd1c294385a122dc967d58c471b22742cdc5c3c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 12 Nov 2018 16:38:22 -0300 Subject: [PATCH 220/425] Added a pagination toggler on AttributesTogglerItem Collapsing states are now persited to database model file --- conf/defaults/example.dbm | 6 +- conf/example.dbm | 6 +- libobjrenderer/src/attributestoggleritem.cpp | 109 +++++++++++++------ libobjrenderer/src/attributestoggleritem.h | 14 ++- libobjrenderer/src/basetableview.cpp | 55 ++++++---- libobjrenderer/src/basetableview.h | 6 +- libobjrenderer/src/graphicalview.cpp | 20 ++-- libobjrenderer/src/objectsscene.cpp | 7 +- libobjrenderer/src/objectsscene.h | 8 +- libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libpgmodeler/src/basetable.cpp | 15 ++- libpgmodeler/src/basetable.h | 7 +- libpgmodeler/src/databasemodel.cpp | 22 ++-- libpgmodeler/src/databasemodel.h | 2 +- libpgmodeler/src/table.cpp | 2 +- libpgmodeler/src/view.cpp | 3 +- libpgmodeler_ui/res/icones/collapse.png | Bin 0 -> 1198 bytes libpgmodeler_ui/res/resources.qrc | 1 + libpgmodeler_ui/src/mainwindow.cpp | 7 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 6 +- libpgmodeler_ui/src/metadatahandlingform.h | 4 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 38 ++++--- libpgmodeler_ui/src/modelwidget.h | 11 +- libpgmodeler_ui/ui/metadatahandlingform.ui | 8 +- main-cli/src/pgmodelercli.cpp | 2 + schemas/xml/dtd/table.dtd | 2 +- schemas/xml/dtd/view.dtd | 2 +- schemas/xml/table.sch | 4 +- schemas/xml/view.sch | 2 +- 31 files changed, 223 insertions(+), 150 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/collapse.png diff --git a/conf/defaults/example.dbm b/conf/defaults/example.dbm index 38f936f7ce..91f607f44e 100644 --- a/conf/defaults/example.dbm +++ b/conf/defaults/example.dbm @@ -36,7 +36,7 @@ CAUTION: Do not modify this file unless you know what you are doing. -

+
@@ -65,7 +65,7 @@ CAUTION: Do not modify this file unless you know what you are doing. -
+
@@ -159,7 +159,7 @@ CAUTION: Do not modify this file unless you know what you are doing. -
+
diff --git a/conf/example.dbm b/conf/example.dbm index 38f936f7ce..91f607f44e 100644 --- a/conf/example.dbm +++ b/conf/example.dbm @@ -36,7 +36,7 @@ CAUTION: Do not modify this file unless you know what you are doing. -
+
@@ -65,7 +65,7 @@ CAUTION: Do not modify this file unless you know what you are doing. -
+
@@ -159,7 +159,7 @@ CAUTION: Do not modify this file unless you know what you are doing. -
+
diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index 3e48e2c175..b93ab56000 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -28,7 +28,7 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec sel_rect = new QGraphicsRectItem; - for(unsigned arr_id = 0; arr_id < 4; arr_id++) + for(unsigned arr_id = 0; arr_id < 5; arr_id++) { arrows[arr_id] = new QGraphicsPolygonItem; arrows_selected[arr_id] = false; @@ -36,11 +36,13 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec arrows[AttribsExpandArrow]->setToolTip(trUtf8("Expands the currently collapsed section of the object")); arrows[AttribsCollapseArrow]->setToolTip(trUtf8("Collapses the currently expanded section of the object")); - arrows[NextAttribsArrow]->setToolTip(trUtf8("Display the next attributes page")); - arrows[PrevAttribsArrow]->setToolTip(trUtf8("Display the previous attributes page")); + arrows[NextAttribsArrow]->setToolTip(trUtf8("Displays the next attributes page")); + arrows[PrevAttribsArrow]->setToolTip(trUtf8("Displays the previous attributes page")); + arrows[TogglePaginationBtn]->setToolTip(trUtf8("Toggles the attributes pagination on the object")); has_ext_attribs = false; + enable_pagination = false; collapse_mode = CollapseMode::NotCollapsed; - arrows_width = 0; + arrows_width = arrows_height = 0; curr_attribs_page = 0; max_attribs_pages = 5; configureButtonsState(); @@ -48,7 +50,7 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec AttributesTogglerItem::~AttributesTogglerItem(void) { - for(unsigned arr_id = 0; arr_id < 4; arr_id++) + for(unsigned arr_id = 0; arr_id < 5; arr_id++) delete(arrows[arr_id]); delete(sel_rect); @@ -56,13 +58,13 @@ AttributesTogglerItem::~AttributesTogglerItem(void) void AttributesTogglerItem::setArrowsBrush(const QBrush &brush) { - for(unsigned arr_id = 0; arr_id < 4; arr_id++) + for(unsigned arr_id = 0; arr_id < 5; arr_id++) arrows[arr_id]->setBrush(brush); } void AttributesTogglerItem::setArrowsPen(const QPen &pen) { - for(unsigned arr_id = 0; arr_id < 4; arr_id++) + for(unsigned arr_id = 0; arr_id < 5; arr_id++) arrows[arr_id]->setPen(pen); } @@ -73,8 +75,13 @@ void AttributesTogglerItem::setRect(const QRectF &rect) void AttributesTogglerItem::setCollapseMode(CollapseMode coll_mode) { - collapse_mode = coll_mode; - configureButtons(this->rect()); + //Avoiding setting up Extended attribs collapsed when the toggler is configured to not having extended attribs + if(!has_ext_attribs && coll_mode == CollapseMode::ExtAttribsCollapsed) + collapse_mode = CollapseMode::NotCollapsed; + else + collapse_mode = coll_mode; + + configureButtonsState(); } void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) @@ -86,11 +93,11 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) this->setToolTip(QString()); clearArrowSelection(); - for(unsigned arr_id = 0; arr_id < 4; arr_id++) + for(unsigned arr_id = 0; arr_id < 5; arr_id++) { rect.setSize(QSizeF(arrows[arr_id]->boundingRect().width() + h_spacing, this->boundingRect().height())); rect.moveTo(arrows[arr_id]->pos().x() - (h_spacing/2), 0); - arrows_selected[arr_id] = rect.contains(pnt); + arrows_selected[arr_id] = rect.contains(pnt) && arrows[arr_id]->isVisible(); if(arrows_selected[arr_id]) { @@ -112,8 +119,10 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) collapse_mode = (arr_id == AttribsExpandArrow ? CollapseMode::NotCollapsed : CollapseMode::AllAttribsCollapsed); else collapse_mode = static_cast(coll_mode); - - emit s_collapseModeChanged(collapse_mode); + } + else if(arr_id == TogglePaginationBtn) + { + enable_pagination = !enable_pagination; } else if(max_attribs_pages != 0) { @@ -124,20 +133,26 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) if(curr_attribs_page >= max_attribs_pages) curr_attribs_page = (arr_id == PrevAttribsArrow ? 0 : max_attribs_pages - 1); - - #warning "Just a test! The signal emitted here is for page change" - emit s_collapseModeChanged(collapse_mode); } - clearArrowSelection(); configureButtons(this->rect()); + clearArrowSelection(); + configureButtonsState(); + + if(arr_id == TogglePaginationBtn) + emit s_paginationToggled(); + else if(arr_id == AttribsExpandArrow || arr_id == AttribsCollapseArrow) + emit s_collapseModeChanged(collapse_mode); + else + #warning "Just a test! The signal emitted here is for page change" + emit s_collapseModeChanged(collapse_mode); } else { //Configuring the selection rectangle if the arrows isn't clicked QRectF rect; QSizeF size = QSizeF(arrows[AttribsExpandArrow]->boundingRect().size().width() + (2 * BaseObjectView::HorizSpacing), - arrows[PrevAttribsArrow]->boundingRect().size().height() + BaseObjectView::HorizSpacing); + arrows_height + BaseObjectView::VertSpacing); double px = 0, py = 0, arr_x = arrows[arr_id]->pos().x(); rect.setSize(size); @@ -153,9 +168,6 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) break; } } - - configureButtonsState(); - this->update(); } void AttributesTogglerItem::configureButtonsState(void) @@ -168,16 +180,20 @@ void AttributesTogglerItem::configureButtonsState(void) arrows[PrevAttribsArrow]->setOpacity(max_attribs_pages != 0 && curr_attribs_page > 0 ? 1 : 0.40); arrows[NextAttribsArrow]->setOpacity(max_attribs_pages != 0 && curr_attribs_page < max_attribs_pages - 1 ? 1 : 0.40); + + arrows[PrevAttribsArrow]->setVisible(enable_pagination); + arrows[NextAttribsArrow]->setVisible(enable_pagination); } void AttributesTogglerItem::setHasExtAttributes(bool value) { has_ext_attribs = value; + configureButtonsState(); } void AttributesTogglerItem::clearArrowSelection(void) { - for(unsigned arr_id = 0; arr_id < 4; arr_id++) + for(unsigned arr_id = 0; arr_id < 5; arr_id++) arrows_selected[arr_id] = false; this->update(); @@ -202,15 +218,19 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) pol.append(QPointF(0, 5 * factor)); pol.append(QPointF(8 * factor, 0)); pol.append(QPointF(8 * factor, 10 * factor)); - height += pol.boundingRect().height(); - arr_width = pol.boundingRect().width() + h_spacing; - arrows[PrevAttribsArrow]->setPolygon(pol); - - pol.remove(0); - pol.translate(-8 * factor, 0); - pol.append(QPointF(8 * factor, 5 * factor)); - arrows[NextAttribsArrow]->setPolygon(pol); - arr_width += pol.boundingRect().width() + h_spacing; + arrows_height = pol.boundingRect().height(); + height += arrows_height; + + if(enable_pagination) + { + arrows[PrevAttribsArrow]->setPolygon(pol); + arr_width = pol.boundingRect().width() + h_spacing; + pol.remove(0); + pol.translate(-8 * factor, 0); + pol.append(QPointF(8 * factor, 5 * factor)); + arrows[NextAttribsArrow]->setPolygon(pol); + arr_width += pol.boundingRect().width() + h_spacing; + } pol.clear(); pol.append(QPointF(5 * factor, 0)); @@ -226,6 +246,14 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) arrows[AttribsExpandArrow]->setPolygon(pol); arr_width += pol.boundingRect().width() + h_spacing; + pol.clear(); + pol.append(QPointF(4 * factor, 0)); + pol.append(QPointF(8 * factor, 4 * factor)); + pol.append(QPointF(4 * factor, 8 * factor)); + pol.append(QPointF(0, 4 * factor)); + arrows[TogglePaginationBtn]->setPolygon(pol); + arr_width += pol.boundingRect().width() + h_spacing; + arrows_width = arr_width; new_rect.setHeight(height); @@ -233,11 +261,17 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) px = (new_rect.width() - arr_width + h_spacing)/2; - arrows[PrevAttribsArrow]->setPos(px, (new_rect.height() - arrows[PrevAttribsArrow]->boundingRect().height())/2); - px += arrows[PrevAttribsArrow]->boundingRect().width() + h_spacing; + arrows[TogglePaginationBtn]->setPos(px, (new_rect.height() - arrows[TogglePaginationBtn]->boundingRect().height())/2); + px += arrows[TogglePaginationBtn]->boundingRect().width() + h_spacing; - arrows[NextAttribsArrow]->setPos(px, (new_rect.height() - arrows[NextAttribsArrow]->boundingRect().height())/2); - px += arrows[NextAttribsArrow]->boundingRect().width() + h_spacing; + if(enable_pagination) + { + arrows[PrevAttribsArrow]->setPos(px, (new_rect.height() - arrows[PrevAttribsArrow]->boundingRect().height())/2); + px += arrows[PrevAttribsArrow]->boundingRect().width() + h_spacing; + + arrows[NextAttribsArrow]->setPos(px, (new_rect.height() - arrows[NextAttribsArrow]->boundingRect().height())/2); + px += arrows[NextAttribsArrow]->boundingRect().width() + h_spacing; + } arrows[AttribsCollapseArrow]->setPos(px, (new_rect.height() - arrows[AttribsCollapseArrow]->boundingRect().height())/2); px += arrows[AttribsCollapseArrow]->boundingRect().width() + h_spacing * 0.80; @@ -249,8 +283,11 @@ void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsI { RoundedRectItem::paint(painter, option, widget); - for(unsigned arr_id = 0; arr_id < 4; arr_id++) + for(unsigned arr_id = 0; arr_id < 5; arr_id++) { + if(!arrows[arr_id]->isVisible()) + continue; + painter->save(); painter->translate(arrows[arr_id]->pos()); painter->setOpacity(arrows[arr_id]->opacity()); diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index 77ae7b2a7e..bcc03ca348 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -38,13 +38,15 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { CollapseMode collapse_mode; - QGraphicsPolygonItem *arrows[4]; + QGraphicsPolygonItem *arrows[5]; - bool arrows_selected[4], + bool arrows_selected[5], - has_ext_attribs; + has_ext_attribs, - double arrows_width; + enable_pagination; + + double arrows_width, arrows_height; unsigned curr_attribs_page, @@ -53,7 +55,8 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { static constexpr unsigned AttribsExpandArrow=0, AttribsCollapseArrow=1, NextAttribsArrow=2, - PrevAttribsArrow=3; + PrevAttribsArrow=3, + TogglePaginationBtn=4; void configureButtons(const QRectF &rect); void configureButtonsState(void); @@ -76,6 +79,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { signals: void s_collapseModeChanged(CollapseMode); void s_currentAttribsPageChanged(unsigned); + void s_paginationToggled(void); }; #endif diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index c758003e69..f91408921f 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -71,6 +71,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) configurePlaceholder(); connect(attribs_toggler, SIGNAL(s_collapseModeChanged(CollapseMode)), this, SLOT(configureCollapsedSections(CollapseMode))); + connect(attribs_toggler, SIGNAL(s_paginationToggled()), this, SLOT(toggleAttribsPaginaiton())); } BaseTableView::~BaseTableView(void) @@ -144,7 +145,6 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) } else { - //QPointF pnt = this->ext_attribs_toggler->mapFromScene(event->scenePos()); QPointF pnt = attribs_toggler->mapFromScene(event->scenePos()); //If the user clicks the extended attributes toggler @@ -311,6 +311,7 @@ void BaseTableView::configureTag(void) void BaseTableView::__configureObject(float width) { + BaseTable *tab = dynamic_cast(getSourceObject()); double height = 0, factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(); @@ -325,6 +326,7 @@ void BaseTableView::__configureObject(float width) grad.setColorAt(1, body->pen().color().lighter()); pen.setStyle(Qt::SolidLine); + attribs_toggler->setCollapseMode(tab->getCollapseMode()); attribs_toggler->setArrowsBrush(grad); attribs_toggler->setArrowsPen(body->pen()); attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor * pixel_ratio)); @@ -357,28 +359,15 @@ void BaseTableView::__configureObject(float width) double BaseTableView::calculateWidth(void) { - double spacing = (2 * HorizSpacing); - - /* Calculating the maximum width between the title, columns and extended attributes. + /* Calculating the maximum width between the title, columns, extended attributes and the attribs toggler. * This width is used to set the uniform width of table */ + vector widths = { columns->isVisible() ? columns->boundingRect().width() : 0, + ext_attribs->isVisible() ? ext_attribs->boundingRect().width() : 0, + attribs_toggler->isVisible() ? attribs_toggler->getArrowsWidth() : 0, + title->boundingRect().width() }; - if(columns->isVisible() && - (columns->boundingRect().width() > title->boundingRect().width() && - (hide_ext_attribs || - dynamic_cast(this->getSourceObject())->getCollapseMode() == CollapseMode::ExtAttribsCollapsed || - (columns->boundingRect().width() >= ext_attribs->boundingRect().width())))) - return(columns->boundingRect().width() + spacing); - - if(ext_attribs->isVisible() && - (ext_attribs->boundingRect().width() > title->boundingRect().width() && - ext_attribs->boundingRect().width() > columns->boundingRect().width())) - return(ext_attribs->boundingRect().width() + spacing); - - if(attribs_toggler->isVisible() && !columns->isVisible() && - attribs_toggler->getArrowsWidth() > title->boundingRect().width()) - return(attribs_toggler->getArrowsWidth() + spacing); - - return(title->boundingRect().width() + spacing); + std::sort(widths.begin(), widths.end()); + return (widths.back() + (2 * HorizSpacing)); } int BaseTableView::getConnectRelsCount(void) @@ -426,5 +415,27 @@ void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) //Updating the schema box that holds the object (if visible) schema->setModified(true); - emit s_extAttributesToggled(); + emit s_collapseModeChanged(); +} + +void BaseTableView::toggleAttribsPaginaiton(void) +{ + Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); + + //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object + this->setFlag(QGraphicsItem::ItemIsSelectable, false); + + #warning "Mark the pagination toggled on base table here!" + //dynamic_cast(this->getSourceObject())->setCollapseMode(coll_mode); + + //Updating the object geometry to show/hide the extended attributes + this->configureObject(); + + obj_selection->setVisible(false); + + // Using a single shot time to restore the selectable flag + QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); + + //Updating the schema box that holds the object (if visible) + schema->setModified(true); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 8727aa39bf..3f3a1722f3 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -128,6 +128,8 @@ class BaseTableView: public BaseObjectView { //! \brief This slot reconfigures the table when the attributes toggler emits the signal s_collapseModeChanged void configureCollapsedSections(CollapseMode coll_mode); + void toggleAttribsPaginaiton(void); + signals: //! \brief Signal emitted when a table is moved over the scene void s_objectMoved(void); @@ -138,8 +140,8 @@ class BaseTableView: public BaseObjectView { //! \brief Signal emitted when the user right-click a focused table child object void s_childObjectSelected(TableObject *); - //! \brief Signal emitted when the user toggles the table's extended attributes area - void s_extAttributesToggled(void); + //! \brief Signal emitted when the user toggles the table's collapse mode + void s_collapseModeChanged(void); friend class RelationshipView; }; diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index c772a54288..727fd8e5be 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -201,23 +201,29 @@ void GraphicalView::configureObject(void) //Resizes the columns/extended attributes using the new width for(int idx=0; idx < 2; idx++) { - if(!groups[idx]->isVisible()) - continue; - - bodies[idx]->setRect(QRectF(0,0, width, groups[idx]->boundingRect().height() + (2 * VertSpacing))); - pen=this->getBorderStyle(attribs[idx]); - pen.setStyle(Qt::DashLine); - + /* Configuring the brush and pen of the bodies even if they aren't visible + * the attributes toggler at the bottom of the view uses the color of the attributes body + * this will avoid the creation of a transparent toggler */ if(!tag) + { bodies[idx]->setBrush(this->getFillStyle(attribs[idx])); + pen=this->getBorderStyle(attribs[idx]); + } else { bodies[idx]->setBrush(tag->getFillStyle(tag_attribs[idx])); pen.setColor(tag->getElementColor(tag_attribs[idx], Tag::BorderColor)); } + pen.setStyle(Qt::DashLine); bodies[idx]->setPen(pen); + // We avoid the construction of the rect related to the current body item if the related group isn't visible + if(!groups[idx]->isVisible()) + continue; + + bodies[idx]->setRect(QRectF(0,0, width, groups[idx]->boundingRect().height() + (2 * VertSpacing))); + if(idx==0) bodies[idx]->setPos(title->pos().x(), title->boundingRect().height()-1); else diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 6f46650a17..3b0356285b 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -405,9 +405,9 @@ void ObjectsScene::emitObjectModification(BaseGraphicObject *object) emit s_objectModified(object); } -void ObjectsScene::emitExtAttributesToggled(void) +void ObjectsScene::emitCollapseModeChanged(void) { - emit s_extAttributesToggled(); + emit s_collapseModeChanged(); } void ObjectsScene::emitChildObjectSelection(TableObject *child_obj) @@ -439,8 +439,7 @@ void ObjectsScene::addItem(QGraphicsItem *item) { connect(tab, SIGNAL(s_childObjectSelected(TableObject*)), this, SLOT(emitChildObjectSelection(TableObject*))); - connect(tab, SIGNAL(s_extAttributesToggled()), - this, SLOT(emitExtAttributesToggled())); + connect(tab, SIGNAL(s_collapseModeChanged()), this, SLOT(emitCollapseModeChanged())); } if(obj) diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 3c15598299..5a7745ec08 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -202,8 +202,8 @@ class ObjectsScene: public QGraphicsScene { //! \brief Handles and redirects the signal emitted by the selected object void emitObjectSelection(BaseGraphicObject *object, bool selected); - //! \brief Handles and redirects the signal emitted by the tables/views when the extended attributes are toggled - void emitExtAttributesToggled(void); + //! \brief Handles and redirects the signal emitted by the tables/views when the collapse mode changed + void emitCollapseModeChanged(void); signals: //! \brief Signal emitted when the user start or finalizes a object movement. @@ -212,8 +212,8 @@ class ObjectsScene: public QGraphicsScene { //! \brief Signal emitted when a object is modified on scene void s_objectModified(BaseGraphicObject *objeto); - //! \brief Signal emitted when the user toggles a table's extended attributes in the scene - void s_extAttributesToggled(void); + //! \brief Signal emitted when the user toggles a table's collapse mode in the scene + void s_collapseModeChanged(void); //! \brief Signal emitted when the user right-click a specific object on the scene requesting the popup menu void s_popupMenuRequested(BaseObject *); diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 87d1b4f987..5bb84af6d5 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -77,6 +77,7 @@ namespace Attributes { CodeFont=QString("code-font"), CodeTabWidth=QString("code-tab-width"), ColIndexes=QString("col-indexes"), + CollapseMode=QString("collapse-mode"), Collatable=QString("collatable"), Collation=QString("collation"), Collations=QString("collations"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 22b835aea5..9a8b756104 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -92,6 +92,7 @@ namespace Attributes { CodeFont, CodeTabWidth, ColIndexes, + CollapseMode, Collatable, Collation, Collations, diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 1c4b2fa744..984fc22460 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -23,22 +23,24 @@ BaseTable::BaseTable(void) tag=nullptr; obj_type=ObjectType::BaseTable; attributes[Attributes::Tag]=QString(); - attributes[Attributes::HideExtAttribs]=QString(); + //attributes[Attributes::HideExtAttribs]=QString(); attributes[Attributes::MaxObjCount]=QString(); - hide_ext_attribs=false; + attributes[Attributes::CollapseMode]=QString(); + + //hide_ext_attribs=false; collapse_mode = CollapseMode::NotCollapsed; } -void BaseTable::setExtAttribsHidden(bool value) +/* void BaseTable::setExtAttribsHidden(bool value) { setCodeInvalidated(hide_ext_attribs != value); hide_ext_attribs = value; -} +} */ -bool BaseTable::isExtAttribsHidden(void) +/* bool BaseTable::isExtAttribsHidden(void) { return(hide_ext_attribs); -} +} */ void BaseTable::setTag(Tag *tag) { @@ -76,5 +78,6 @@ CollapseMode BaseTable::getCollapseMode(void) void BaseTable::setCollapseMode(CollapseMode coll_mode) { + setCodeInvalidated(collapse_mode != coll_mode); collapse_mode = coll_mode; } diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index e3b594f821..2bca4ebeda 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -45,14 +45,9 @@ class BaseTable: public BaseGraphicObject { protected: Tag *tag; - void setCollapseMode(CollapseMode coll_mode); - public: BaseTable(void); - virtual void setExtAttribsHidden(bool value); - virtual bool isExtAttribsHidden(void); - virtual void setTag(Tag *tag); virtual Tag *getTag(void); @@ -102,10 +97,10 @@ class BaseTable: public BaseGraphicObject { //! \brief Copy the attributes between two tables void operator = (BaseTable &tab); + void setCollapseMode(CollapseMode coll_mode); CollapseMode getCollapseMode(void); friend class DatabaseModel; - friend class BaseTableView; }; #endif diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index f791b4a8e6..bd0f8c83e6 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4679,7 +4679,7 @@ Table *DatabaseModel::createTable(void) table->setRLSEnabled(attribs[Attributes::RlsEnabled]==Attributes::True); table->setRLSForced(attribs[Attributes::RlsForced]==Attributes::True); table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); - table->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); + table->setCollapseMode(static_cast(attribs[Attributes::CollapseMode].toUInt())); table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5885,7 +5885,7 @@ View *DatabaseModel::createView(void) view->setMaterialized(attribs[Attributes::Materialized]==Attributes::True); view->setRecursive(attribs[Attributes::Recursive]==Attributes::True); view->setWithNoData(attribs[Attributes::WithNoData]==Attributes::True); - view->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); + view->setCollapseMode(static_cast(attribs[Attributes::CollapseMode].toUInt())); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -9501,7 +9501,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option bool save_db_attribs=false, save_objs_pos=false, save_objs_prot=false, save_objs_sqldis=false, save_textboxes=false, save_tags=false, save_custom_sql=false, save_custom_colors=false, save_fadeout=false, - save_extattribs=false, save_genericsqls=false, save_objs_aliases=false; + save_collapsemode=false, save_genericsqls=false, save_objs_aliases=false; QStringList labels_attrs={ Attributes::SrcLabel, Attributes::DstLabel, Attributes::NameLabel }; @@ -9515,7 +9515,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option save_custom_sql=(MetaObjsCustomSql & options) == MetaObjsCustomSql; save_custom_colors=(MetaObjsCustomColors & options) == MetaObjsCustomColors; save_fadeout=(MetaObjsFadeOut & options) == MetaObjsFadeOut; - save_extattribs=(MetaObjsExtAttribs & options) == MetaObjsExtAttribs; + save_collapsemode=(MetaObjsCollapseMode & options) == MetaObjsCollapseMode; save_genericsqls=(MetaGenericSqlObjs & options) == MetaGenericSqlObjs; save_objs_aliases=(MetaObjsAliases & options) == MetaObjsAliases; @@ -9634,9 +9634,9 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option attribs[Attributes::SqlDisabled]=(save_objs_sqldis && object->isSQLDisabled() && !object->isSystemObject() ? Attributes::True : QString()); attribs[Attributes::Tag]=(save_tags && base_tab && base_tab->getTag() ? base_tab->getTag()->getName() : QString()); attribs[Attributes::AppendedSql]=object->getAppendedSQL(); - attribs[Attributes::PrependedSql]=object->getPrependedSQL(); - attribs[Attributes::HideExtAttribs]=(save_extattribs && base_tab && base_tab->isExtAttribsHidden() ? Attributes::True : QString()); + attribs[Attributes::PrependedSql]=object->getPrependedSQL(); attribs[Attributes::FadedOut]=(save_fadeout && graph_obj && graph_obj->isFadedOut() ? Attributes::True : QString()); + attribs[Attributes::CollapseMode]=(save_collapsemode && base_tab ? QString::number(enum_cast(base_tab->getCollapseMode())) : QString()); if(TableObject::isTableObject(obj_type)) { @@ -9775,7 +9775,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option (save_custom_sql && (!attribs[Attributes::AppendedSql].isEmpty() || !attribs[Attributes::PrependedSql].isEmpty())) || (save_fadeout && !attribs[Attributes::FadedOut].isEmpty()) || - (save_extattribs && !attribs[Attributes::HideExtAttribs].isEmpty()) || + (save_collapsemode && !attribs[Attributes::CollapseMode].isEmpty()) || (save_objs_aliases && !attribs[Attributes::Alias].isEmpty())) { emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, @@ -9841,7 +9841,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option bool load_db_attribs=false, load_objs_pos=false, load_objs_prot=false, load_objs_sqldis=false, load_textboxes=false, load_tags=false, load_custom_sql=false, load_custom_colors=false, load_fadeout=false, - load_extattribs=false, load_genericsqls=false, load_objs_aliases=false; + load_collapse_mode=false, load_genericsqls=false, load_objs_aliases=false; load_db_attribs=(MetaDbAttributes & options) == MetaDbAttributes; load_objs_pos=(MetaObjsPositioning & options) == MetaObjsPositioning; @@ -9852,7 +9852,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option load_custom_sql=(MetaObjsCustomSql & options) == MetaObjsCustomSql; load_custom_colors=(MetaObjsCustomColors & options) == MetaObjsCustomColors; load_fadeout=(MetaObjsFadeOut & options) == MetaObjsFadeOut; - load_extattribs=(MetaObjsExtAttribs & options) == MetaObjsExtAttribs; + load_collapse_mode=(MetaObjsCollapseMode & options) == MetaObjsCollapseMode; load_genericsqls=(MetaGenericSqlObjs & options) == MetaGenericSqlObjs; load_objs_aliases=(MetaObjsAliases & options) == MetaObjsAliases; @@ -10080,8 +10080,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(load_fadeout) dynamic_cast(object)->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); - if(load_extattribs && base_tab) - base_tab->setExtAttribsHidden(attribs[Attributes::HideExtAttribs]==Attributes::True); + if(load_collapse_mode && base_tab) + base_tab->setCollapseMode(static_cast(attribs[Attributes::CollapseMode].toUInt())); } points.clear(); diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index efe55422b3..3d16b41b98 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -187,7 +187,7 @@ class DatabaseModel: public QObject, public BaseObject { MetaObjsCustomSql=16, //! \brief Handle object's custom sql when save/load metadata file MetaObjsCustomColors=32, //! \brief Handle object's custom colors when save/load metadata file MetaObjsFadeOut=64, //! \brief Handle graphical object's fade out status when save/load metadata file - MetaObjsExtAttribs=128, //! \brief Handle tables and views extended attributes display when save/load metadata file + MetaObjsCollapseMode=128, //! \brief Handle tables and views collapse mode when save/load metadata file MetaTextboxObjs=256, //! \brief Handle textboxes object when save/load metadata file MetaTagObjs=512, //! \brief Handle tags object when save/load metadata file MetaGenericSqlObjs=1024, //! \brief Handle generic sql object when save/load metadata file diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 9c9688c8ea..ceae36327a 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1601,10 +1601,10 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::CopyTable]=QString(); attributes[Attributes::AncestorTable]=QString(); attributes[Attributes::Tag]=QString(); - attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); attributes[Attributes::Partitioning]=~partitioning_type; attributes[Attributes::PartitionKey]=QString(); attributes[Attributes::PartitionBoundExpr]=part_bounding_expr; + attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 9f446c420a..819bac1109 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -579,7 +579,8 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::WithNoData]=(with_no_data ? Attributes::True : QString()); attributes[Attributes::Columns]=QString(); attributes[Attributes::Tag]=QString(); - attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); + //attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); + attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); setSQLObjectAttribute(); diff --git a/libpgmodeler_ui/res/icones/collapse.png b/libpgmodeler_ui/res/icones/collapse.png new file mode 100644 index 0000000000000000000000000000000000000000..cb094f2c9bb0462a11aadb23b1e4eb399e78d6cb GIT binary patch literal 1198 zcmV;f1X25mP)1d&22Y9DI4wIAun?#|4;KG3OK+R~|1 zc<>}=Gnv`*zyJB)Gw0j`|92C~WHJ_u#VX6o%dLMAADI7!_zGYM#|IdkawMJ?WPbbIyk6&tH; zou&8Mk*5#t?)Yjk@qK;2)6~>-Tuv*XlrOiPoM=7zQdKZ)H2yMtmdk@@D2)~DeDT1h zjeaqdQUD~A$*s~;z_0(%b0#w8Tzey0R!aY9F9VamVn%JOWrMp9eZIfKFOFx^1pKhR z(s!}w!_%+6_sHtC*7fv7OiNM_4A3)lj+K@7(RKZBYwE(cQ9oE(i^UT-aI)de`VG4x zz3KB0)v29==Z7xhe|3kpfHawe*zrH2W@KA61C!{bj zO^aZl5NQew3ygr|{P0OOZCQW+3m>g{E0f8HCEJ45W7}(pF{8kC00 zKxl*%2t%VSmtH!lt*xzm?X%6>d@FD(0*5==D*OJr`mz*;uY;#pZ&*Q6}tk+so9E#dIK3MZ{(~j1N z(x8+kBulW}F$97mUw=B@zUR`8;qd`$?be+X7e?**aAy$k>cCtU4VUMl;qqKwC({~@ zay3dT41!GNMsaL~5Q0d!EEfrv6FaAIa@yB|b1I;< zK9x$Pd<7O5MJVm!DhJzfuyYD0>*8b;rYtB*rBbK-;Kbu`fTyMvsHmv$*GRezf`K9; zg)6Y#42B^wWq?96iXo+MoLNa2i9~z_+U^7gkL`mg0PnZwLLXWv-#8;9BlG7#T}uaF zwmmT?>tl_#J~_Frix9%M0<$V%T}uar;S%avI_9iiewxf;n$Zje>i2z5VYq~44<_JB z7u#CDN*5DjBeXXsrnhEdY~;2H;6)kQtD4R*Mt9Ju>~ukWm()w(^?~?Twwy8-QC@nW3gC?)>`NrM-_3? zwHG9&1{?2s=EQSj2J^~;7D9NRr1s`BDWwMV;NajeaCW{ARssb;5C~1pfYy|ofHCDB zA#eCofD1T)J>^+o9LNBicones/newtab.png icones/relationshippart.png icones/resizecols.png + icones/collapse.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index f6ccaba894..e11c702b99 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1059,7 +1059,7 @@ void MainWindow::setCurrentModel(void) more_actions_menu.clear(); more_actions_menu.addAction(current_model->action_select_all); more_actions_menu.addAction(current_model->action_fade); - more_actions_menu.addAction(current_model->action_extended_attribs); + more_actions_menu.addAction(current_model->action_collapse_mode); more_actions_menu.addAction(current_model->action_edit_creation_order); general_tb->addAction(action_other_actions); tool_btn = qobject_cast(general_tb->widgetForAction(action_other_actions)); @@ -2047,7 +2047,10 @@ void MainWindow::toggleCompactView(void) for(int idx = 0; idx < models_tbw->count(); idx++) { model_wgt = dynamic_cast(models_tbw->widget(idx)); - model_wgt->toggleAllExtendedAttributes(action_compact_view->isChecked()); + + if(action_compact_view->isChecked()) + model_wgt->setAllCollapseMode(CollapseMode::ExtAttribsCollapsed); + model_wgt->getDatabaseModel()->setObjectsModified({ ObjectType::Table, ObjectType::View, ObjectType::Relationship, ObjectType::BaseRelationship, ObjectType::Schema}); } diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 24d316b858..9caebdaa4c 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -43,8 +43,8 @@ MetadataHandlingForm::MetadataHandlingForm(QWidget *parent, Qt::WindowFlags f) : objs_fadedout_ht=new HintTextWidget(objs_fadedout_hint, this); objs_fadedout_ht->setText(objs_fadedout_chk->statusTip()); - objs_extattribs_ht=new HintTextWidget(objs_extattribs_hint, this); - objs_extattribs_ht->setText(objs_extattribs_chk->statusTip()); + objs_collapse_mode_ht=new HintTextWidget(objs_collapse_mode_hint, this); + objs_collapse_mode_ht->setText(objs_collapse_mode_chk->statusTip()); custom_sql_ht=new HintTextWidget(custom_sql_hint, this); custom_sql_ht->setText(custom_sql_chk->statusTip()); @@ -175,7 +175,7 @@ void MetadataHandlingForm::handleObjectsMetada(void) options+=(tag_objs_chk->isChecked() ? DatabaseModel::MetaTagObjs : 0); options+=(textbox_objs_chk->isChecked() ? DatabaseModel::MetaTextboxObjs : 0); options+=(objs_fadedout_chk->isChecked() ? DatabaseModel::MetaObjsFadeOut : 0); - options+=(objs_extattribs_chk->isChecked() ? DatabaseModel::MetaObjsExtAttribs : 0); + options+=(objs_collapse_mode_chk->isChecked() ? DatabaseModel::MetaObjsCollapseMode : 0); options+=(generic_sql_objs_chk->isChecked() ? DatabaseModel::MetaGenericSqlObjs : 0); options+=(objs_aliases_chk->isChecked() ? DatabaseModel::MetaObjsAliases : 0); diff --git a/libpgmodeler_ui/src/metadatahandlingform.h b/libpgmodeler_ui/src/metadatahandlingform.h index 5d9c807a45..17b42dae7e 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.h +++ b/libpgmodeler_ui/src/metadatahandlingform.h @@ -41,8 +41,8 @@ class MetadataHandlingForm: public QDialog, public Ui::MetadataHandlingForm { HintTextWidget *db_metadata_ht, *objs_positioning_ht, *objs_protection_ht, *objs_sql_disabled_ht, *custom_sql_ht, *textbox_objs_ht, *tag_objs_ht, - *custom_colors_ht, *extract_restore_ht, *restore_ht, *objs_fadedout_ht, *objs_extattribs_ht, - *generic_sql_objs_ht, *extract_only_ht, *objs_aliases_ht; + *custom_colors_ht, *extract_restore_ht, *restore_ht, *objs_fadedout_ht, + *objs_collapse_mode_ht, *generic_sql_objs_ht, *extract_only_ht, *objs_aliases_ht; void showEvent(QShowEvent *); void selectFile(bool is_output); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 726b537cf6..c7aa68fa73 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -325,7 +325,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) Attributes::RectVisible, Attributes::FillColor, Attributes::FadedOut, - Attributes::HideExtAttribs}, + Attributes::CollapseMode}, { Attributes::Role, Attributes::Tablespace, Attributes::Collation, diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 79e465bf9f..e3e150f67f 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -299,16 +299,21 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) action_duplicate->setShortcut(QKeySequence(trUtf8("Ctrl+D"))); action_duplicate->setMenuRole(QAction::NoRole); - action_extended_attribs=new QAction(QIcon(PgModelerUiNs::getIconPath("toggleattribs")), trUtf8("Extended attributes"), this); - action_show_ext_attribs=new QAction(trUtf8("Show"), this); - action_hide_ext_attribs=new QAction(trUtf8("Hide"), this); + action_collapse_mode=new QAction(QIcon(PgModelerUiNs::getIconPath("collapse")), trUtf8("Collapse"), this); + action_no_collapse_attribs=new QAction(trUtf8("Not collapsed"), this); + action_no_collapse_attribs->setData(enum_cast(CollapseMode::NotCollapsed)); + action_collapse_ext_attribs=new QAction(trUtf8("Extended attributes"), this); + action_collapse_ext_attribs->setData(enum_cast(CollapseMode::ExtAttribsCollapsed)); + action_collpase_all_attribs=new QAction(trUtf8("All attributes"), this); + action_collpase_all_attribs->setData(enum_cast(CollapseMode::AllAttribsCollapsed)); action_jump_to_table=new QAction(QIcon(PgModelerUiNs::getIconPath("jumptotable")), trUtf8("Jump to table"), this); action_jump_to_table->setMenu(&jump_to_tab_menu); - toggle_attrs_menu.addAction(action_show_ext_attribs); - toggle_attrs_menu.addAction(action_hide_ext_attribs); - action_extended_attribs->setMenu(&toggle_attrs_menu); + toggle_attrs_menu.addAction(action_no_collapse_attribs); + toggle_attrs_menu.addAction(action_collapse_ext_attribs); + toggle_attrs_menu.addAction(action_collpase_all_attribs); + action_collapse_mode->setMenu(&toggle_attrs_menu); action_schemas_rects=new QAction(QIcon(PgModelerUiNs::getIconPath("schemarect")), trUtf8("Schemas rectangles"), this); action_show_schemas_rects=new QAction(trUtf8("Show"), this); @@ -444,8 +449,9 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(action_fade_out, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); connect(action_fade_rels_in, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsIn())); connect(action_fade_rels_out, SIGNAL(triggered(bool)), this, SLOT(fadeObjectsOut())); - connect(action_show_ext_attribs, SIGNAL(triggered(bool)), this, SLOT(toggleExtendedAttributes())); - connect(action_hide_ext_attribs, SIGNAL(triggered(bool)), this, SLOT(toggleExtendedAttributes())); + connect(action_collapse_ext_attribs, SIGNAL(triggered(bool)), this, SLOT(setCollapseMode())); + connect(action_collpase_all_attribs, SIGNAL(triggered(bool)), this, SLOT(setCollapseMode())); + connect(action_no_collapse_attribs, SIGNAL(triggered(bool)), this, SLOT(setCollapseMode())); connect(action_show_schemas_rects, SIGNAL(triggered(bool)), this, SLOT(toggleSchemasRectangles())); connect(action_hide_schemas_rects, SIGNAL(triggered(bool)), this, SLOT(toggleSchemasRectangles())); connect(db_model, SIGNAL(s_objectAdded(BaseObject*)), this, SLOT(handleObjectAddition(BaseObject *))); @@ -457,7 +463,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(scene, SIGNAL(s_popupMenuRequested(void)), this, SLOT(showObjectMenu(void))); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(configureObjectSelection(void))); connect(scene, SIGNAL(s_objectsSelectedInRange(void)), this, SLOT(configureObjectSelection(void))); - connect(scene, &ObjectsScene::s_extAttributesToggled, [&](){ modified = true; }); + connect(scene, &ObjectsScene::s_collapseModeChanged, [&](){ modified = true; }); connect(scene, SIGNAL(s_popupMenuRequested(BaseObject*)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_popupMenuRequested(void)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), new_obj_overlay_wgt, SLOT(hide())); @@ -3476,7 +3482,7 @@ void ModelWidget::fadeObjectsOut(void) fadeObjects(qobject_cast(sender()), false); } -void ModelWidget::toggleAllExtendedAttributes(bool value) +void ModelWidget::setAllCollapseMode(CollapseMode mode) { BaseTable *base_tab = nullptr; vector objects; @@ -3490,15 +3496,15 @@ void ModelWidget::toggleAllExtendedAttributes(bool value) base_tab = dynamic_cast(obj); if(base_tab) - base_tab->setExtAttribsHidden(value); + base_tab->setCollapseMode(mode); } this->setModified(true); } -void ModelWidget::toggleExtendedAttributes(void) +void ModelWidget::setCollapseMode(void) { - bool hide = sender() == action_hide_ext_attribs; + CollapseMode mode = static_cast(dynamic_cast(sender())->data().toUInt()); BaseTable *base_tab = nullptr; vector objects; @@ -3514,9 +3520,9 @@ void ModelWidget::toggleExtendedAttributes(void) { base_tab = dynamic_cast(obj); - if(base_tab && base_tab->isExtAttribsHidden() != hide) + if(base_tab && base_tab->getCollapseMode() != mode) { - base_tab->setExtAttribsHidden(hide); + base_tab->setCollapseMode(mode); base_tab->setModified(true); } } @@ -3811,7 +3817,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) } if(tab_or_view || objects.empty() || objects.size() == 1) - popup_menu.addAction(action_extended_attribs); + popup_menu.addAction(action_collapse_mode); if(objects.empty() || (objects.size() == 1 && objects[0]->getObjectType() == ObjectType::Database)) popup_menu.addAction(action_schemas_rects); diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index a41d9961c8..4b8e6ff606 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -236,9 +236,10 @@ class ModelWidget: public QWidget { *action_fade_rels, *action_fade_rels_in, *action_fade_rels_out, - *action_extended_attribs, - *action_show_ext_attribs, - *action_hide_ext_attribs, + *action_collapse_mode, + *action_collapse_ext_attribs, + *action_collpase_all_attribs, + *action_no_collapse_attribs, *action_edit_creation_order, *action_jump_to_table, *action_schemas_rects, @@ -274,7 +275,7 @@ class ModelWidget: public QWidget { void fadeObjects(const vector &objects, bool fade_in); - void toggleAllExtendedAttributes(bool value); + void setAllCollapseMode(CollapseMode mode); public: static constexpr double MinimumZoom=0.050000, @@ -471,7 +472,7 @@ class ModelWidget: public QWidget { void fadeObjectsOut(void); - void toggleExtendedAttributes(void); + void setCollapseMode(void); void toggleSchemasRectangles(void); diff --git a/libpgmodeler_ui/ui/metadatahandlingform.ui b/libpgmodeler_ui/ui/metadatahandlingform.ui index d866525fc4..7f486c5b2d 100644 --- a/libpgmodeler_ui/ui/metadatahandlingform.ui +++ b/libpgmodeler_ui/ui/metadatahandlingform.ui @@ -817,7 +817,7 @@ - + 0 @@ -828,10 +828,10 @@ - Handles the tables' and views' extended attributes display status in the metadata file. + Handles the tables' and views' collapsing mode in the metadata file. - Tables' extended attributes display + Tables and views collpsing mode true @@ -839,7 +839,7 @@ - + 0 diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 021093e38c..9f6d828785 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1106,6 +1106,8 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Fix the references to op. classes and families if needed fixOpClassesFamiliesReferences(obj_xml); + + #warning "TODO: Add a fix to remove hide-ext-attribs on tables/views" } void PgModelerCli::fixOpClassesFamiliesReferences(QString &obj_xml) diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 6fcafdd94a..27c2c65940 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -21,7 +21,7 @@ - + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 14fb7e1ea0..4a6583fd67 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -10,7 +10,7 @@ - + diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index 2b0c8eab74..4b8549a763 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -1,7 +1,7 @@ # XML definition for tables # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -[
$br From dd162a8ad5a30ca0706bb61e11b4dc8e234063e1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 12 Nov 2018 17:33:39 -0300 Subject: [PATCH 221/425] Adding support to persist pagination enabled on tables and views at database model file --- libobjrenderer/src/attributestoggleritem.cpp | 21 ++++++++++----- libobjrenderer/src/attributestoggleritem.h | 5 ++-- libobjrenderer/src/basetableview.cpp | 10 +++++--- libobjrenderer/src/basetableview.h | 5 +++- libobjrenderer/src/objectsscene.cpp | 9 +++++-- libobjrenderer/src/objectsscene.h | 6 +++++ libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libpgmodeler/src/basetable.cpp | 27 ++++++++++---------- libpgmodeler/src/basetable.h | 5 +++- libpgmodeler/src/databasemodel.cpp | 2 ++ libpgmodeler/src/table.cpp | 1 + libpgmodeler/src/view.cpp | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 3 ++- libpgmodeler_ui/src/modelwidget.cpp | 1 + schemas/xml/dtd/table.dtd | 1 + schemas/xml/dtd/view.dtd | 1 + schemas/xml/table.sch | 1 + schemas/xml/view.sch | 1 + 19 files changed, 70 insertions(+), 33 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index b93ab56000..39c4eaa03e 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -40,7 +40,7 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec arrows[PrevAttribsArrow]->setToolTip(trUtf8("Displays the previous attributes page")); arrows[TogglePaginationBtn]->setToolTip(trUtf8("Toggles the attributes pagination on the object")); has_ext_attribs = false; - enable_pagination = false; + pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; arrows_width = arrows_height = 0; curr_attribs_page = 0; @@ -122,7 +122,7 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) } else if(arr_id == TogglePaginationBtn) { - enable_pagination = !enable_pagination; + pagination_enabled = !pagination_enabled; } else if(max_attribs_pages != 0) { @@ -140,7 +140,7 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) configureButtonsState(); if(arr_id == TogglePaginationBtn) - emit s_paginationToggled(); + emit s_paginationToggled(pagination_enabled); else if(arr_id == AttribsExpandArrow || arr_id == AttribsCollapseArrow) emit s_collapseModeChanged(collapse_mode); else @@ -181,8 +181,8 @@ void AttributesTogglerItem::configureButtonsState(void) arrows[PrevAttribsArrow]->setOpacity(max_attribs_pages != 0 && curr_attribs_page > 0 ? 1 : 0.40); arrows[NextAttribsArrow]->setOpacity(max_attribs_pages != 0 && curr_attribs_page < max_attribs_pages - 1 ? 1 : 0.40); - arrows[PrevAttribsArrow]->setVisible(enable_pagination); - arrows[NextAttribsArrow]->setVisible(enable_pagination); + arrows[PrevAttribsArrow]->setVisible(pagination_enabled); + arrows[NextAttribsArrow]->setVisible(pagination_enabled); } void AttributesTogglerItem::setHasExtAttributes(bool value) @@ -191,6 +191,13 @@ void AttributesTogglerItem::setHasExtAttributes(bool value) configureButtonsState(); } +void AttributesTogglerItem::setPaginationEnabled(bool value) +{ + pagination_enabled = value; + configureButtons(this->boundingRect()); + configureButtonsState(); +} + void AttributesTogglerItem::clearArrowSelection(void) { for(unsigned arr_id = 0; arr_id < 5; arr_id++) @@ -221,7 +228,7 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) arrows_height = pol.boundingRect().height(); height += arrows_height; - if(enable_pagination) + if(pagination_enabled) { arrows[PrevAttribsArrow]->setPolygon(pol); arr_width = pol.boundingRect().width() + h_spacing; @@ -264,7 +271,7 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) arrows[TogglePaginationBtn]->setPos(px, (new_rect.height() - arrows[TogglePaginationBtn]->boundingRect().height())/2); px += arrows[TogglePaginationBtn]->boundingRect().width() + h_spacing; - if(enable_pagination) + if(pagination_enabled) { arrows[PrevAttribsArrow]->setPos(px, (new_rect.height() - arrows[PrevAttribsArrow]->boundingRect().height())/2); px += arrows[PrevAttribsArrow]->boundingRect().width() + h_spacing; diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index bcc03ca348..f48c40b7a6 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -44,7 +44,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { has_ext_attribs, - enable_pagination; + pagination_enabled; double arrows_width, arrows_height; @@ -71,6 +71,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { void setCollapseMode(CollapseMode coll_mode); void setArrowSelected(const QPointF &pnt, bool clicked = false); void setHasExtAttributes(bool value); + void setPaginationEnabled(bool value); void clearArrowSelection(void); double getArrowsWidth(void); @@ -79,7 +80,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { signals: void s_collapseModeChanged(CollapseMode); void s_currentAttribsPageChanged(unsigned); - void s_paginationToggled(void); + void s_paginationToggled(bool); }; #endif diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index f91408921f..f1767636c2 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -71,7 +71,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) configurePlaceholder(); connect(attribs_toggler, SIGNAL(s_collapseModeChanged(CollapseMode)), this, SLOT(configureCollapsedSections(CollapseMode))); - connect(attribs_toggler, SIGNAL(s_paginationToggled()), this, SLOT(toggleAttribsPaginaiton())); + connect(attribs_toggler, SIGNAL(s_paginationToggled(bool)), this, SLOT(toggleAttribsPaginaiton(bool))); } BaseTableView::~BaseTableView(void) @@ -327,6 +327,7 @@ void BaseTableView::__configureObject(float width) pen.setStyle(Qt::SolidLine); attribs_toggler->setCollapseMode(tab->getCollapseMode()); + attribs_toggler->setPaginationEnabled(tab->isPaginationEnabled()); attribs_toggler->setArrowsBrush(grad); attribs_toggler->setArrowsPen(body->pen()); attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor * pixel_ratio)); @@ -418,15 +419,14 @@ void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) emit s_collapseModeChanged(); } -void BaseTableView::toggleAttribsPaginaiton(void) +void BaseTableView::toggleAttribsPaginaiton(bool enabled) { Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object this->setFlag(QGraphicsItem::ItemIsSelectable, false); - #warning "Mark the pagination toggled on base table here!" - //dynamic_cast(this->getSourceObject())->setCollapseMode(coll_mode); + dynamic_cast(this->getSourceObject())->setPaginationEnabled(enabled); //Updating the object geometry to show/hide the extended attributes this->configureObject(); @@ -438,4 +438,6 @@ void BaseTableView::toggleAttribsPaginaiton(void) //Updating the schema box that holds the object (if visible) schema->setModified(true); + + emit s_paginationToggled(); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 3f3a1722f3..368bd1baf1 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -128,7 +128,7 @@ class BaseTableView: public BaseObjectView { //! \brief This slot reconfigures the table when the attributes toggler emits the signal s_collapseModeChanged void configureCollapsedSections(CollapseMode coll_mode); - void toggleAttribsPaginaiton(void); + void toggleAttribsPaginaiton(bool enabled); signals: //! \brief Signal emitted when a table is moved over the scene @@ -143,6 +143,9 @@ class BaseTableView: public BaseObjectView { //! \brief Signal emitted when the user toggles the table's collapse mode void s_collapseModeChanged(void); + //! \brief Signal emitted when the user toggles the table's attributes pagination + void s_paginationToggled(void); + friend class RelationshipView; }; diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 3b0356285b..e16a6e3f71 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -410,6 +410,11 @@ void ObjectsScene::emitCollapseModeChanged(void) emit s_collapseModeChanged(); } +void ObjectsScene::emitPaginationToggled(void) +{ + emit s_paginationToggled(); +} + void ObjectsScene::emitChildObjectSelection(TableObject *child_obj) { /* Treats the TableView::s_childObjectSelect() only when there is no @@ -437,9 +442,9 @@ void ObjectsScene::addItem(QGraphicsItem *item) this, SLOT(emitObjectModification(BaseGraphicObject*))); else if(tab) { - connect(tab, SIGNAL(s_childObjectSelected(TableObject*)), - this, SLOT(emitChildObjectSelection(TableObject*))); + connect(tab, SIGNAL(s_childObjectSelected(TableObject*)), this, SLOT(emitChildObjectSelection(TableObject*))); connect(tab, SIGNAL(s_collapseModeChanged()), this, SLOT(emitCollapseModeChanged())); + connect(tab, SIGNAL(s_paginationToggled()), this, SLOT(emitPaginationToggled())); } if(obj) diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 5a7745ec08..84f8d97574 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -205,6 +205,9 @@ class ObjectsScene: public QGraphicsScene { //! \brief Handles and redirects the signal emitted by the tables/views when the collapse mode changed void emitCollapseModeChanged(void); + //! \brief Handles and redirects the signal emitted by the tables/views when the pagination of attributes is toggled + void emitPaginationToggled(void); + signals: //! \brief Signal emitted when the user start or finalizes a object movement. void s_objectsMoved(bool end_moviment); @@ -215,6 +218,9 @@ class ObjectsScene: public QGraphicsScene { //! \brief Signal emitted when the user toggles a table's collapse mode in the scene void s_collapseModeChanged(void); + //! \brief Signal emitted when the user toggles a table's attributes pagination + void s_paginationToggled(void); + //! \brief Signal emitted when the user right-click a specific object on the scene requesting the popup menu void s_popupMenuRequested(BaseObject *); diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 5bb84af6d5..c5949cbfd0 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -348,6 +348,7 @@ namespace Attributes { OutputFunc=QString("output"), OwnerColumn=QString("owner-col"), Owner=QString("owner"), + Pagination=QString("pagination"), PaperCustomSize=QString("paper-custom-size"), PaperMargin=QString("paper-margin"), PaperOrientation=QString("paper-orientation"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 9a8b756104..75b6bd4a7d 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -360,6 +360,7 @@ namespace Attributes { OutputFunc, OwnerColumn, Owner, + Pagination, PaperCustomSize, PaperMargin, PaperOrientation, diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 984fc22460..9d4eaf9fa2 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -23,25 +23,13 @@ BaseTable::BaseTable(void) tag=nullptr; obj_type=ObjectType::BaseTable; attributes[Attributes::Tag]=QString(); - //attributes[Attributes::HideExtAttribs]=QString(); attributes[Attributes::MaxObjCount]=QString(); attributes[Attributes::CollapseMode]=QString(); - - //hide_ext_attribs=false; + attributes[Attributes::Pagination]=QString(); + pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; } -/* void BaseTable::setExtAttribsHidden(bool value) -{ - setCodeInvalidated(hide_ext_attribs != value); - hide_ext_attribs = value; -} */ - -/* bool BaseTable::isExtAttribsHidden(void) -{ - return(hide_ext_attribs); -} */ - void BaseTable::setTag(Tag *tag) { setCodeInvalidated(this->tag != tag); @@ -76,6 +64,17 @@ CollapseMode BaseTable::getCollapseMode(void) return(collapse_mode); } +void BaseTable::setPaginationEnabled(bool value) +{ + setCodeInvalidated(pagination_enabled != value); + pagination_enabled = value; +} + +bool BaseTable::isPaginationEnabled(void) +{ + return(pagination_enabled); +} + void BaseTable::setCollapseMode(CollapseMode coll_mode) { setCodeInvalidated(collapse_mode != coll_mode); diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index 2bca4ebeda..f692d491fb 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -38,7 +38,7 @@ enum class CollapseMode: unsigned { class BaseTable: public BaseGraphicObject { private: - bool hide_ext_attribs; + bool pagination_enabled; CollapseMode collapse_mode; @@ -100,6 +100,9 @@ class BaseTable: public BaseGraphicObject { void setCollapseMode(CollapseMode coll_mode); CollapseMode getCollapseMode(void); + void setPaginationEnabled(bool value); + bool isPaginationEnabled(void); + friend class DatabaseModel; }; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index bd0f8c83e6..63e7412272 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4680,6 +4680,7 @@ Table *DatabaseModel::createTable(void) table->setRLSForced(attribs[Attributes::RlsForced]==Attributes::True); table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); table->setCollapseMode(static_cast(attribs[Attributes::CollapseMode].toUInt())); + table->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5886,6 +5887,7 @@ View *DatabaseModel::createView(void) view->setRecursive(attribs[Attributes::Recursive]==Attributes::True); view->setWithNoData(attribs[Attributes::WithNoData]==Attributes::True); view->setCollapseMode(static_cast(attribs[Attributes::CollapseMode].toUInt())); + view->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index ceae36327a..e88c5beb6d 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1605,6 +1605,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::PartitionKey]=QString(); attributes[Attributes::PartitionBoundExpr]=part_bounding_expr; attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); + attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 819bac1109..4c44e81a00 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -579,7 +579,7 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::WithNoData]=(with_no_data ? Attributes::True : QString()); attributes[Attributes::Columns]=QString(); attributes[Attributes::Tag]=QString(); - //attributes[Attributes::HideExtAttribs]=(isExtAttribsHidden() ? Attributes::True : QString()); + attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); setSQLObjectAttribute(); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index c7aa68fa73..994e91bac1 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -325,7 +325,8 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) Attributes::RectVisible, Attributes::FillColor, Attributes::FadedOut, - Attributes::CollapseMode}, + Attributes::CollapseMode, + Attributes::Pagination}, { Attributes::Role, Attributes::Tablespace, Attributes::Collation, diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index e3e150f67f..ad83d07f25 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -464,6 +464,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(configureObjectSelection(void))); connect(scene, SIGNAL(s_objectsSelectedInRange(void)), this, SLOT(configureObjectSelection(void))); connect(scene, &ObjectsScene::s_collapseModeChanged, [&](){ modified = true; }); + connect(scene, &ObjectsScene::s_paginationToggled, [&](){ modified = true; }); connect(scene, SIGNAL(s_popupMenuRequested(BaseObject*)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_popupMenuRequested(void)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), new_obj_overlay_wgt, SLOT(hide())); diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 27c2c65940..20b75356c7 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -22,6 +22,7 @@ + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 4a6583fd67..6ff14a14f4 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -12,6 +12,7 @@ + diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index 4b8549a763..5ba8b6b465 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -10,6 +10,7 @@ %if {protected} %then [ protected=] "true" %end %if {sql-disabled} %then [ sql-disabled=] "true" %end %if {collapse-mode} %then [ collapse-mode=] "{collapse-mode}" %end + %if {pagination} %then [ pagination=] "true" %end %if {faded-out} %then [ faded-out=] "true" %end %if {rls-enabled} %then [ rls-enabled=] "true" %end %if {rls-forced} %then [ rls-forced=] "true" %end diff --git a/schemas/xml/view.sch b/schemas/xml/view.sch index 3b70b77f52..2bbbce075b 100644 --- a/schemas/xml/view.sch +++ b/schemas/xml/view.sch @@ -13,6 +13,7 @@ %if {with-no-data} %then [ with-no-data=] "true" %end %if {sql-disabled} %then [ sql-disabled=] "true" %end %if {collapse-mode} %then [ collapse-mode=] "{collapse-mode}" %end + %if {pagination} %then [ pagination=] "true" %end %if {faded-out} %then [ faded-out=] "true" %end %if {max-obj-count} %then [ max-obj-count=] "{max-obj-count}" %end > $br From 5f0e434b6a57a47f540aef02b8aee1f5db340d93 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 14 Nov 2018 08:46:47 -0300 Subject: [PATCH 222/425] Improved database model loading times by avoiding the rendering of tables while the children object (indexes, trigger, rules, etc) are being added Finished the attributes pagination on tables (pending the implementation for views) --- libobjrenderer/src/attributestoggleritem.cpp | 34 ++++--- libobjrenderer/src/attributestoggleritem.h | 7 +- libobjrenderer/src/basetableview.cpp | 29 +++++- libobjrenderer/src/basetableview.h | 4 + libobjrenderer/src/tableview.cpp | 94 +++++++++++++++++--- libpgmodeler/src/basetable.cpp | 11 +++ libpgmodeler/src/basetable.h | 5 ++ libpgmodeler/src/databasemodel.cpp | 20 +++-- libpgmodeler_ui/src/databaseimportform.cpp | 1 + libpgmodeler_ui/src/databaseimporthelper.cpp | 3 - libpgmodeler_ui/src/modelwidget.cpp | 1 + 11 files changed, 170 insertions(+), 39 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index 39c4eaa03e..c72e0be83d 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -43,8 +43,7 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; arrows_width = arrows_height = 0; - curr_attribs_page = 0; - max_attribs_pages = 5; + current_page = max_pages = 0; configureButtonsState(); } @@ -124,15 +123,15 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) { pagination_enabled = !pagination_enabled; } - else if(max_attribs_pages != 0) + else if(max_pages != 0) { if(arr_id == PrevAttribsArrow) - curr_attribs_page--; + current_page--; else if(arr_id == NextAttribsArrow) - curr_attribs_page++; + current_page++; - if(curr_attribs_page >= max_attribs_pages) - curr_attribs_page = (arr_id == PrevAttribsArrow ? 0 : max_attribs_pages - 1); + if(current_page >= max_pages) + current_page = (arr_id == PrevAttribsArrow ? 0 : max_pages - 1); } configureButtons(this->rect()); @@ -144,8 +143,7 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) else if(arr_id == AttribsExpandArrow || arr_id == AttribsCollapseArrow) emit s_collapseModeChanged(collapse_mode); else - #warning "Just a test! The signal emitted here is for page change" - emit s_collapseModeChanged(collapse_mode); + emit s_currentPageChanged(current_page); } else { @@ -178,8 +176,8 @@ void AttributesTogglerItem::configureButtonsState(void) arrows[AttribsCollapseArrow]->setOpacity(collapse_mode == CollapseMode::ExtAttribsCollapsed || collapse_mode == CollapseMode::NotCollapsed ? 1 : 0.40); - arrows[PrevAttribsArrow]->setOpacity(max_attribs_pages != 0 && curr_attribs_page > 0 ? 1 : 0.40); - arrows[NextAttribsArrow]->setOpacity(max_attribs_pages != 0 && curr_attribs_page < max_attribs_pages - 1 ? 1 : 0.40); + arrows[PrevAttribsArrow]->setOpacity(max_pages != 0 && current_page > 0 ? 1 : 0.40); + arrows[NextAttribsArrow]->setOpacity(max_pages != 0 && current_page < max_pages - 1 ? 1 : 0.40); arrows[PrevAttribsArrow]->setVisible(pagination_enabled); arrows[NextAttribsArrow]->setVisible(pagination_enabled); @@ -198,6 +196,20 @@ void AttributesTogglerItem::setPaginationEnabled(bool value) configureButtonsState(); } +void AttributesTogglerItem::setPaginationValues(unsigned curr_page, unsigned max_page) +{ + if(!pagination_enabled) + return; + + if(curr_page > max_page) + current_page = max_pages = max_page; + else + { + current_page = curr_page; + max_pages = max_page; + } +} + void AttributesTogglerItem::clearArrowSelection(void) { for(unsigned arr_id = 0; arr_id < 5; arr_id++) diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index f48c40b7a6..bd79dd6037 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -48,9 +48,9 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { double arrows_width, arrows_height; - unsigned curr_attribs_page, + unsigned current_page, - max_attribs_pages; + max_pages; static constexpr unsigned AttribsExpandArrow=0, AttribsCollapseArrow=1, @@ -72,6 +72,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { void setArrowSelected(const QPointF &pnt, bool clicked = false); void setHasExtAttributes(bool value); void setPaginationEnabled(bool value); + void setPaginationValues(unsigned curr_page, unsigned max_page); void clearArrowSelection(void); double getArrowsWidth(void); @@ -79,7 +80,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { signals: void s_collapseModeChanged(CollapseMode); - void s_currentAttribsPageChanged(unsigned); + void s_currentPageChanged(unsigned); void s_paginationToggled(bool); }; diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index f1767636c2..bf01f2c76b 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -18,8 +18,9 @@ #include "basetableview.h" -bool BaseTableView::hide_ext_attribs=false; -bool BaseTableView::hide_tags=false; +bool BaseTableView::hide_ext_attribs = false; +bool BaseTableView::hide_tags = false; +unsigned BaseTableView::attribs_per_page = 20; BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) { @@ -72,6 +73,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) connect(attribs_toggler, SIGNAL(s_collapseModeChanged(CollapseMode)), this, SLOT(configureCollapsedSections(CollapseMode))); connect(attribs_toggler, SIGNAL(s_paginationToggled(bool)), this, SLOT(toggleAttribsPaginaiton(bool))); + connect(attribs_toggler, SIGNAL(s_currentPageChanged(unsigned)), this, SLOT(configureCurrentPage(uint))); } BaseTableView::~BaseTableView(void) @@ -441,3 +443,26 @@ void BaseTableView::toggleAttribsPaginaiton(bool enabled) emit s_paginationToggled(); } + +void BaseTableView::configureCurrentPage(unsigned page) +{ + Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); + + //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object + this->setFlag(QGraphicsItem::ItemIsSelectable, false); + + dynamic_cast(this->getSourceObject())->setCurrentPage(page); + + //Updating the object geometry to show/hide the extended attributes + this->configureObject(); + + obj_selection->setVisible(false); + + // Using a single shot time to restore the selectable flag + QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); + + //Updating the schema box that holds the object (if visible) + schema->setModified(true); + + //emit s_paginationToggled(); +} diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 368bd1baf1..2d56b8c7cc 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -48,6 +48,8 @@ class BaseTableView: public BaseObjectView { static bool hide_ext_attribs, hide_tags; + static unsigned attribs_per_page; + //! \brief Polygonal object that defines the table body RoundedRectItem *body, @@ -130,6 +132,8 @@ class BaseTableView: public BaseObjectView { void toggleAttribsPaginaiton(bool enabled); + void configureCurrentPage(unsigned page); + signals: //! \brief Signal emitted when a table is moved over the scene void s_objectMoved(void); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 6dfebc6bcb..f62859c8e8 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -29,6 +29,8 @@ void TableView::configureObject(void) Table *table=dynamic_cast
(this->getSourceObject()); int i, count, obj_idx; double width=0, px=0, cy=0, old_width=0, old_height=0; + unsigned col_cnt = 0, ext_attr_cnt = 0, total_objs_cnt = 0, + start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; QPen pen; TableObjectView *col_item=nullptr; QList subitems; @@ -36,15 +38,70 @@ void TableView::configureObject(void) TableObject *tab_obj=nullptr; QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; - vector tab_objs, ext_tab_objs; + vector tab_objs, columns, ext_tab_objs; QString atribs[]={ Attributes::TableBody, Attributes::TableExtBody }; Tag *tag=table->getTag(); + CollapseMode collapse_mode = table->getCollapseMode(); + ObjectType ext_types[5] = { ObjectType::Constraint, + ObjectType::Trigger, ObjectType::Index, + ObjectType::Rule, ObjectType::Policy }; //Configures the table title title->configureObject(table); - for(auto &obj : table->getObjects({ ObjectType::Column })) - ext_tab_objs.push_back(dynamic_cast(obj)); + columns.assign(table->getObjectList(ObjectType::Column)->begin(), + table->getObjectList(ObjectType::Column)->end()); + + for(unsigned idx = 0; idx < 5; idx++) + { + ext_tab_objs.insert(ext_tab_objs.end(), + table->getObjectList(ext_types[idx])->begin(), + table->getObjectList(ext_types[idx])->end()); + } + + if(collapse_mode != CollapseMode::AllAttribsCollapsed) + total_objs_cnt = columns.size() + (collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0); + + if(table->isPaginationEnabled() && total_objs_cnt > attribs_per_page) + { + double col_factor = columns.size() / static_cast(total_objs_cnt), + ext_factor = 1 - col_factor; + unsigned max_pages = 0, res = 0; + + col_cnt = floor(col_factor * attribs_per_page); + ext_attr_cnt = hide_ext_attribs ? 0 : floor(ext_factor * attribs_per_page); + res = attribs_per_page - (col_cnt + ext_attr_cnt); + if(res > 0) col_cnt += res; + + max_pages = ceil(total_objs_cnt / static_cast(attribs_per_page)); + + start_col = table->getCurrentPage() * col_cnt; + end_col = start_col + col_cnt; + + start_ext = table->getCurrentPage() * ext_attr_cnt; + end_ext = start_ext + ext_attr_cnt; + + attribs_toggler->setPaginationValues(table->getCurrentPage(), max_pages); + + if(start_col > columns.size()) + start_col = columns.size(); + + if(start_ext > ext_tab_objs.size()) + start_ext = ext_tab_objs.size(); + + if(end_col > columns.size() || table->getCurrentPage() == max_pages - 1) + end_col = columns.size(); + + if(end_ext > ext_tab_objs.size() || table->getCurrentPage() == max_pages - 1) + end_ext = ext_tab_objs.size(); + } + else + { + total_objs_cnt = 0; + col_cnt = columns.size(); + ext_attr_cnt = ext_tab_objs.size(); + attribs_toggler->setPaginationValues(0, 0); + } attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_tab_objs.empty()); @@ -58,14 +115,23 @@ void TableView::configureObject(void) if(obj_idx==0) { - if(table->getCollapseMode() != CollapseMode::AllAttribsCollapsed) - tab_objs.assign(table->getObjectList(ObjectType::Column)->begin(), - table->getObjectList(ObjectType::Column)->end()); + if(collapse_mode != CollapseMode::AllAttribsCollapsed) + { + if(table->isPaginationEnabled() && total_objs_cnt != 0) + tab_objs.assign(columns.begin() + start_col, columns.begin() + end_col); + else + tab_objs.assign(columns.begin(), columns.end()); + } } else { - if(!hide_ext_attribs && table->getCollapseMode() == CollapseMode::NotCollapsed) - tab_objs.assign(ext_tab_objs.begin(), ext_tab_objs.end()); + if(!hide_ext_attribs && collapse_mode == CollapseMode::NotCollapsed) + { + if(table->isPaginationEnabled() && total_objs_cnt != 0) + tab_objs.assign(ext_tab_objs.begin() + start_ext, ext_tab_objs.begin() + end_ext); + else + tab_objs.assign(ext_tab_objs.begin(), ext_tab_objs.end()); + } } //Gets the subitems of the current group @@ -161,9 +227,15 @@ void TableView::configureObject(void) if(obj_idx==0) bodies[obj_idx]->setPos(title->pos().x(), title->boundingRect().height()-1); else - bodies[obj_idx]->setPos(title->pos().x(), - title->boundingRect().height() + - bodies[0]->boundingRect().height() - 2); + { + if(bodies[0]->isVisible()) + bodies[obj_idx]->setPos(title->pos().x(), + title->boundingRect().height() + + bodies[0]->boundingRect().height() - 2); + else + bodies[obj_idx]->setPos(title->pos().x(), title->boundingRect().height()-1); + } + groups[obj_idx]->setPos(bodies[obj_idx]->pos()); subitems=groups[obj_idx]->childItems(); diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 9d4eaf9fa2..92833f1f96 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -28,6 +28,7 @@ BaseTable::BaseTable(void) attributes[Attributes::Pagination]=QString(); pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; + curr_page = 0; } void BaseTable::setTag(Tag *tag) @@ -75,6 +76,16 @@ bool BaseTable::isPaginationEnabled(void) return(pagination_enabled); } +void BaseTable::setCurrentPage(unsigned page) +{ + curr_page = page; +} + +unsigned BaseTable::getCurrentPage(void) +{ + return(curr_page); +} + void BaseTable::setCollapseMode(CollapseMode coll_mode) { setCodeInvalidated(collapse_mode != coll_mode); diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index f692d491fb..b608d0bccd 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -42,6 +42,8 @@ class BaseTable: public BaseGraphicObject { CollapseMode collapse_mode; + unsigned curr_page; + protected: Tag *tag; @@ -103,6 +105,9 @@ class BaseTable: public BaseGraphicObject { void setPaginationEnabled(bool value); bool isPaginationEnabled(void); + void setCurrentPage(unsigned page); + unsigned getCurrentPage(void); + friend class DatabaseModel; }; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 63e7412272..503371004a 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3127,9 +3127,7 @@ void DatabaseModel::loadModel(const QString &filename) } this->setInvalidated(false); - emit s_objectLoaded(100, trUtf8("Validating relationships..."), enum_cast(ObjectType::Relationship)); - this->setObjectsModified({ObjectType::Relationship, ObjectType::BaseRelationship}); //Doing another relationship validation when there are inheritances to avoid incomplete tables if(found_inh_rel) @@ -3138,6 +3136,9 @@ void DatabaseModel::loadModel(const QString &filename) validateRelationships(); updateTablesFKRelationships(); } + + emit s_objectLoaded(100, trUtf8("Rendering database model..."), enum_cast(ObjectType::BaseObject)); + this->setObjectsModified(); } catch(Exception &e) { @@ -4679,7 +4680,7 @@ Table *DatabaseModel::createTable(void) table->setRLSEnabled(attribs[Attributes::RlsEnabled]==Attributes::True); table->setRLSForced(attribs[Attributes::RlsForced]==Attributes::True); table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); - table->setCollapseMode(static_cast(attribs[Attributes::CollapseMode].toUInt())); + table->setCollapseMode(attribs[Attributes::CollapseMode].isEmpty() ? CollapseMode::NotCollapsed : static_cast(attribs[Attributes::CollapseMode].toUInt())); table->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); @@ -5067,8 +5068,9 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) if(constr->getConstraintType()!=ConstraintType::PrimaryKey) { table->addConstraint(constr); + if(this->getObjectIndex(table) >= 0) - table->setModified(true); + table->setModified(!loading_model); } } } @@ -5354,7 +5356,7 @@ Index *DatabaseModel::createIndex(void) } table->addObject(index); - table->setModified(true); + table->setModified(!loading_model); } catch(Exception &e) { @@ -5434,7 +5436,7 @@ Rule *DatabaseModel::createRule(void) } table->addObject(rule); - table->setModified(true); + table->setModified(!loading_model); } catch(Exception &e) { @@ -5592,7 +5594,7 @@ Trigger *DatabaseModel::createTrigger(void) } table->addObject(trigger); - table->setModified(true); + table->setModified(!loading_model); } catch(Exception &e) { @@ -5684,7 +5686,7 @@ Policy *DatabaseModel::createPolicy(void) } table->addObject(policy); - table->setModified(true); + table->setModified(!loading_model); } catch(Exception &e) { @@ -5886,7 +5888,7 @@ View *DatabaseModel::createView(void) view->setMaterialized(attribs[Attributes::Materialized]==Attributes::True); view->setRecursive(attribs[Attributes::Recursive]==Attributes::True); view->setWithNoData(attribs[Attributes::WithNoData]==Attributes::True); - view->setCollapseMode(static_cast(attribs[Attributes::CollapseMode].toUInt())); + view->setCollapseMode(attribs[Attributes::CollapseMode].isEmpty() ? CollapseMode::NotCollapsed : static_cast(attribs[Attributes::CollapseMode].toUInt())); view->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 737184c05b..4074525333 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -525,6 +525,7 @@ void DatabaseImportForm::handleImportFinished(Exception e) msgbox.show(e, e.getErrorMessage(), Messagebox::AlertIcon); } + model_wgt->getDatabaseModel()->setObjectsModified(); model_wgt->rearrangeSchemasInGrid(); model_wgt->getDatabaseModel()->setInvalidated(false); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 82c8284343..2a236ada7c 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -631,9 +631,6 @@ void DatabaseImportHelper::importDatabase(void) } } } - - //Forcing the update of tables and views in order to correctly draw their titles without the schema's name - dbmodel->setObjectsModified({ ObjectType::Table, ObjectType::View }); } resetImportParameters(); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index ad83d07f25..2c34081dd6 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1358,6 +1358,7 @@ void ModelWidget::loadModel(const QString &filename) try { connect(db_model, SIGNAL(s_objectLoaded(int,QString,unsigned)), &task_prog_wgt, SLOT(updateProgress(int,QString,unsigned))); + task_prog_wgt.addIcon(enum_cast(ObjectType::BaseObject), QPixmap(PgModelerUiNs::getIconPath("design"))); task_prog_wgt.setWindowTitle(trUtf8("Loading database model")); task_prog_wgt.show(); From 869835aac0b32dbdf4bd090ad61862e075484ea1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 14 Nov 2018 09:52:03 -0300 Subject: [PATCH 223/425] Disabling pagination for views while the columns for that kind of object aren't available --- libobjrenderer/src/attributestoggleritem.cpp | 45 ++++++++------- libobjrenderer/src/attributestoggleritem.h | 4 +- libobjrenderer/src/basetableview.cpp | 60 ++++++-------------- libobjrenderer/src/basetableview.h | 6 ++ libobjrenderer/src/graphicalview.cpp | 1 + libobjrenderer/src/objectsscene.cpp | 22 ++----- libobjrenderer/src/objectsscene.h | 12 +--- libpgmodeler_ui/src/modelwidget.cpp | 1 + 8 files changed, 60 insertions(+), 91 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index c72e0be83d..adb1826391 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -38,7 +38,7 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec arrows[AttribsCollapseArrow]->setToolTip(trUtf8("Collapses the currently expanded section of the object")); arrows[NextAttribsArrow]->setToolTip(trUtf8("Displays the next attributes page")); arrows[PrevAttribsArrow]->setToolTip(trUtf8("Displays the previous attributes page")); - arrows[TogglePaginationBtn]->setToolTip(trUtf8("Toggles the attributes pagination on the object")); + arrows[PaginationTogglerBtn]->setToolTip(trUtf8("Toggles the attributes pagination on the object")); has_ext_attribs = false; pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; @@ -119,7 +119,7 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) else collapse_mode = static_cast(coll_mode); } - else if(arr_id == TogglePaginationBtn) + else if(arr_id == PaginationTogglerBtn) { pagination_enabled = !pagination_enabled; } @@ -138,7 +138,7 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) clearArrowSelection(); configureButtonsState(); - if(arr_id == TogglePaginationBtn) + if(arr_id == PaginationTogglerBtn) emit s_paginationToggled(pagination_enabled); else if(arr_id == AttribsExpandArrow || arr_id == AttribsCollapseArrow) emit s_collapseModeChanged(collapse_mode); @@ -189,8 +189,9 @@ void AttributesTogglerItem::setHasExtAttributes(bool value) configureButtonsState(); } -void AttributesTogglerItem::setPaginationEnabled(bool value) +void AttributesTogglerItem::setPaginationEnabled(bool value, bool hide_pag_toggler) { + arrows[PaginationTogglerBtn]->setVisible(!hide_pag_toggler); pagination_enabled = value; configureButtons(this->boundingRect()); configureButtonsState(); @@ -265,13 +266,16 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) arrows[AttribsExpandArrow]->setPolygon(pol); arr_width += pol.boundingRect().width() + h_spacing; - pol.clear(); - pol.append(QPointF(4 * factor, 0)); - pol.append(QPointF(8 * factor, 4 * factor)); - pol.append(QPointF(4 * factor, 8 * factor)); - pol.append(QPointF(0, 4 * factor)); - arrows[TogglePaginationBtn]->setPolygon(pol); - arr_width += pol.boundingRect().width() + h_spacing; + if(arrows[PaginationTogglerBtn]->isVisible()) + { + pol.clear(); + pol.append(QPointF(4 * factor, 0)); + pol.append(QPointF(8 * factor, 4 * factor)); + pol.append(QPointF(4 * factor, 8 * factor)); + pol.append(QPointF(0, 4 * factor)); + arrows[PaginationTogglerBtn]->setPolygon(pol); + arr_width += pol.boundingRect().width() + h_spacing; + } arrows_width = arr_width; @@ -280,16 +284,19 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) px = (new_rect.width() - arr_width + h_spacing)/2; - arrows[TogglePaginationBtn]->setPos(px, (new_rect.height() - arrows[TogglePaginationBtn]->boundingRect().height())/2); - px += arrows[TogglePaginationBtn]->boundingRect().width() + h_spacing; - - if(pagination_enabled) + if(arrows[PaginationTogglerBtn]->isVisible()) { - arrows[PrevAttribsArrow]->setPos(px, (new_rect.height() - arrows[PrevAttribsArrow]->boundingRect().height())/2); - px += arrows[PrevAttribsArrow]->boundingRect().width() + h_spacing; + arrows[PaginationTogglerBtn]->setPos(px, (new_rect.height() - arrows[PaginationTogglerBtn]->boundingRect().height())/2); + px += arrows[PaginationTogglerBtn]->boundingRect().width() + h_spacing; - arrows[NextAttribsArrow]->setPos(px, (new_rect.height() - arrows[NextAttribsArrow]->boundingRect().height())/2); - px += arrows[NextAttribsArrow]->boundingRect().width() + h_spacing; + if(pagination_enabled) + { + arrows[PrevAttribsArrow]->setPos(px, (new_rect.height() - arrows[PrevAttribsArrow]->boundingRect().height())/2); + px += arrows[PrevAttribsArrow]->boundingRect().width() + h_spacing; + + arrows[NextAttribsArrow]->setPos(px, (new_rect.height() - arrows[NextAttribsArrow]->boundingRect().height())/2); + px += arrows[NextAttribsArrow]->boundingRect().width() + h_spacing; + } } arrows[AttribsCollapseArrow]->setPos(px, (new_rect.height() - arrows[AttribsCollapseArrow]->boundingRect().height())/2); diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index bd79dd6037..80a188c4be 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -56,7 +56,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { AttribsCollapseArrow=1, NextAttribsArrow=2, PrevAttribsArrow=3, - TogglePaginationBtn=4; + PaginationTogglerBtn=4; void configureButtons(const QRectF &rect); void configureButtonsState(void); @@ -71,7 +71,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { void setCollapseMode(CollapseMode coll_mode); void setArrowSelected(const QPointF &pnt, bool clicked = false); void setHasExtAttributes(bool value); - void setPaginationEnabled(bool value); + void setPaginationEnabled(bool value, bool hide_pag_toggler = false); void setPaginationValues(unsigned curr_page, unsigned max_page); void clearArrowSelection(void); double getArrowsWidth(void); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index bf01f2c76b..7004dafbc1 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -398,71 +398,45 @@ void BaseTableView::configureObjectShadow(void) rect_item->setPos(3.5, 4.5); } -void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) +void BaseTableView::startGeometryUpdate(void) { - Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); - //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object this->setFlag(QGraphicsItem::ItemIsSelectable, false); +} - dynamic_cast(this->getSourceObject())->setCollapseMode(coll_mode); - - //Updating the object geometry to show/hide the extended attributes +void BaseTableView::finishGeometryUpdate(void) +{ + //Updating the object's geometry to reflect the geometry change this->configureObject(); - obj_selection->setVisible(false); // Using a single shot time to restore the selectable flag QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); //Updating the schema box that holds the object (if visible) - schema->setModified(true); + dynamic_cast(this->getSourceObject()->getSchema())->setModified(true); +} +void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) +{ + startGeometryUpdate(); + dynamic_cast(this->getSourceObject())->setCollapseMode(coll_mode); + finishGeometryUpdate(); emit s_collapseModeChanged(); } void BaseTableView::toggleAttribsPaginaiton(bool enabled) { - Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); - - //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object - this->setFlag(QGraphicsItem::ItemIsSelectable, false); - + startGeometryUpdate(); dynamic_cast(this->getSourceObject())->setPaginationEnabled(enabled); - - //Updating the object geometry to show/hide the extended attributes - this->configureObject(); - - obj_selection->setVisible(false); - - // Using a single shot time to restore the selectable flag - QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); - - //Updating the schema box that holds the object (if visible) - schema->setModified(true); - + finishGeometryUpdate(); emit s_paginationToggled(); } void BaseTableView::configureCurrentPage(unsigned page) { - Schema *schema = dynamic_cast(this->getSourceObject()->getSchema()); - - //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object - this->setFlag(QGraphicsItem::ItemIsSelectable, false); - + startGeometryUpdate(); dynamic_cast(this->getSourceObject())->setCurrentPage(page); - - //Updating the object geometry to show/hide the extended attributes - this->configureObject(); - - obj_selection->setVisible(false); - - // Using a single shot time to restore the selectable flag - QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); - - //Updating the schema box that holds the object (if visible) - schema->setModified(true); - - //emit s_paginationToggled(); + finishGeometryUpdate(); + emit s_currentPageChanged(); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 2d56b8c7cc..d4964e4896 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -89,6 +89,9 @@ class BaseTableView: public BaseObjectView { //! \brief Determines the table width based upon its subsection (title, body and extended attribs) double calculateWidth(void); + void startGeometryUpdate(void); + void finishGeometryUpdate(void); + public: static constexpr unsigned LeftConnPoint=0, RightConnPoint=1; @@ -150,6 +153,9 @@ class BaseTableView: public BaseObjectView { //! \brief Signal emitted when the user toggles the table's attributes pagination void s_paginationToggled(void); + //! \brief Signal emitted when the user changes the current table's attributes page + void s_currentPageChanged(void); + friend class RelationshipView; }; diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 727fd8e5be..f510de073c 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -246,6 +246,7 @@ void GraphicalView::configureObject(void) this->bounding_rect.setWidth(title->boundingRect().width()); BaseTableView::__configureObject(width); + attribs_toggler->setPaginationEnabled(false, true); if(!view->getAlias().isEmpty()) table_tooltip += QString("\nAlias: %1").arg(view->getAlias()); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index e16a6e3f71..eeffd69578 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -400,21 +400,6 @@ void ObjectsScene::configurePrinter(QPrinter *printer, const QSizeF &custom_size custom_paper_size=orig_custom_sz; } -void ObjectsScene::emitObjectModification(BaseGraphicObject *object) -{ - emit s_objectModified(object); -} - -void ObjectsScene::emitCollapseModeChanged(void) -{ - emit s_collapseModeChanged(); -} - -void ObjectsScene::emitPaginationToggled(void) -{ - emit s_paginationToggled(); -} - void ObjectsScene::emitChildObjectSelection(TableObject *child_obj) { /* Treats the TableView::s_childObjectSelect() only when there is no @@ -439,12 +424,13 @@ void ObjectsScene::addItem(QGraphicsItem *item) if(rel) connect(rel, SIGNAL(s_relationshipModified(BaseGraphicObject*)), - this, SLOT(emitObjectModification(BaseGraphicObject*))); + this, SIGNAL(s_objectModified(BaseGraphicObject*))); else if(tab) { connect(tab, SIGNAL(s_childObjectSelected(TableObject*)), this, SLOT(emitChildObjectSelection(TableObject*))); - connect(tab, SIGNAL(s_collapseModeChanged()), this, SLOT(emitCollapseModeChanged())); - connect(tab, SIGNAL(s_paginationToggled()), this, SLOT(emitPaginationToggled())); + connect(tab, SIGNAL(s_collapseModeChanged()), this, SIGNAL(s_collapseModeChanged())); + connect(tab, SIGNAL(s_paginationToggled()), this, SIGNAL(s_paginationToggled())); + connect(tab, SIGNAL(s_currentPageChanged()), this, SIGNAL(s_currentPageChanged())); } if(obj) diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 84f8d97574..2047a5cb85 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -193,21 +193,12 @@ class ObjectsScene: public QGraphicsScene { //! \brief Moves the scene when the user puts the mouse cursor on one of scene's edges void moveObjectScene(void); - //! \brief Handles and redirects the signal emitted by the modified object - void emitObjectModification(BaseGraphicObject *object); - //! \brief Handles and redirects the signal emitted by the selected child object void emitChildObjectSelection(TableObject *child_obj); //! \brief Handles and redirects the signal emitted by the selected object void emitObjectSelection(BaseGraphicObject *object, bool selected); - //! \brief Handles and redirects the signal emitted by the tables/views when the collapse mode changed - void emitCollapseModeChanged(void); - - //! \brief Handles and redirects the signal emitted by the tables/views when the pagination of attributes is toggled - void emitPaginationToggled(void); - signals: //! \brief Signal emitted when the user start or finalizes a object movement. void s_objectsMoved(bool end_moviment); @@ -221,6 +212,9 @@ class ObjectsScene: public QGraphicsScene { //! \brief Signal emitted when the user toggles a table's attributes pagination void s_paginationToggled(void); + //! \brief Signal emitted when the user changes a table's attributes page + void s_currentPageChanged(void); + //! \brief Signal emitted when the user right-click a specific object on the scene requesting the popup menu void s_popupMenuRequested(BaseObject *); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 2c34081dd6..ec2c63fc42 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -465,6 +465,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(scene, SIGNAL(s_objectsSelectedInRange(void)), this, SLOT(configureObjectSelection(void))); connect(scene, &ObjectsScene::s_collapseModeChanged, [&](){ modified = true; }); connect(scene, &ObjectsScene::s_paginationToggled, [&](){ modified = true; }); + connect(scene, &ObjectsScene::s_currentPageChanged, [&](){ modified = true; }); connect(scene, SIGNAL(s_popupMenuRequested(BaseObject*)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_popupMenuRequested(void)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), new_obj_overlay_wgt, SLOT(hide())); From 315f4b7cb40d82fb3c9937cf3d80adcf29bed429 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 14 Nov 2018 14:27:41 -0300 Subject: [PATCH 224/425] Documented the class AttributesTogglerItem --- libobjrenderer/src/attributestoggleritem.cpp | 158 ++++++++++--------- libobjrenderer/src/attributestoggleritem.h | 89 +++++++++-- 2 files changed, 161 insertions(+), 86 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index adb1826391..b9cf62b034 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -30,19 +30,20 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec for(unsigned arr_id = 0; arr_id < 5; arr_id++) { - arrows[arr_id] = new QGraphicsPolygonItem; - arrows_selected[arr_id] = false; + buttons[arr_id] = new QGraphicsPolygonItem; + btns_selected[arr_id] = false; } - arrows[AttribsExpandArrow]->setToolTip(trUtf8("Expands the currently collapsed section of the object")); - arrows[AttribsCollapseArrow]->setToolTip(trUtf8("Collapses the currently expanded section of the object")); - arrows[NextAttribsArrow]->setToolTip(trUtf8("Displays the next attributes page")); - arrows[PrevAttribsArrow]->setToolTip(trUtf8("Displays the previous attributes page")); - arrows[PaginationTogglerBtn]->setToolTip(trUtf8("Toggles the attributes pagination on the object")); + buttons[AttribsExpandBtn]->setToolTip(trUtf8("Expands the currently collapsed section of the object")); + buttons[AttribsCollapseBtn]->setToolTip(trUtf8("Collapses the currently expanded section of the object")); + buttons[NextAttribsPageBtn]->setToolTip(trUtf8("Displays the next attributes page")); + buttons[PrevAttribsPageBtn]->setToolTip(trUtf8("Displays the previous attributes page")); + buttons[PaginationTogglerBtn]->setToolTip(trUtf8("Toggles the attributes pagination on the object")); + has_ext_attribs = false; pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; - arrows_width = arrows_height = 0; + btns_width = btns_height = 0; current_page = max_pages = 0; configureButtonsState(); } @@ -50,21 +51,21 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec AttributesTogglerItem::~AttributesTogglerItem(void) { for(unsigned arr_id = 0; arr_id < 5; arr_id++) - delete(arrows[arr_id]); + delete(buttons[arr_id]); delete(sel_rect); } -void AttributesTogglerItem::setArrowsBrush(const QBrush &brush) +void AttributesTogglerItem::setButtonsBrush(const QBrush &brush) { for(unsigned arr_id = 0; arr_id < 5; arr_id++) - arrows[arr_id]->setBrush(brush); + buttons[arr_id]->setBrush(brush); } -void AttributesTogglerItem::setArrowsPen(const QPen &pen) +void AttributesTogglerItem::setButtonsPen(const QPen &pen) { for(unsigned arr_id = 0; arr_id < 5; arr_id++) - arrows[arr_id]->setPen(pen); + buttons[arr_id]->setPen(pen); } void AttributesTogglerItem::setRect(const QRectF &rect) @@ -74,7 +75,7 @@ void AttributesTogglerItem::setRect(const QRectF &rect) void AttributesTogglerItem::setCollapseMode(CollapseMode coll_mode) { - //Avoiding setting up Extended attribs collapsed when the toggler is configured to not having extended attribs + //Avoiding setting up extended attributes collapsed when the toggler is configured to not having extended attribs if(!has_ext_attribs && coll_mode == CollapseMode::ExtAttribsCollapsed) collapse_mode = CollapseMode::NotCollapsed; else @@ -83,39 +84,39 @@ void AttributesTogglerItem::setCollapseMode(CollapseMode coll_mode) configureButtonsState(); } -void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) +void AttributesTogglerItem::setButtonSelected(const QPointF &pnt, bool clicked) { QRectF rect; double h_spacing = 4 * BaseObjectView::HorizSpacing; unsigned coll_mode = static_cast(collapse_mode); this->setToolTip(QString()); - clearArrowSelection(); + clearButtonsSelection(); for(unsigned arr_id = 0; arr_id < 5; arr_id++) { - rect.setSize(QSizeF(arrows[arr_id]->boundingRect().width() + h_spacing, this->boundingRect().height())); - rect.moveTo(arrows[arr_id]->pos().x() - (h_spacing/2), 0); - arrows_selected[arr_id] = rect.contains(pnt) && arrows[arr_id]->isVisible(); + rect.setSize(QSizeF(buttons[arr_id]->boundingRect().width() + h_spacing, this->boundingRect().height())); + rect.moveTo(buttons[arr_id]->pos().x() - (h_spacing/2), 0); + btns_selected[arr_id] = rect.contains(pnt) && buttons[arr_id]->isVisible(); - if(arrows_selected[arr_id]) + if(btns_selected[arr_id]) { - this->setToolTip(arrows[arr_id]->toolTip()); + this->setToolTip(buttons[arr_id]->toolTip()); if(clicked) { - if(arr_id == AttribsExpandArrow || arr_id == AttribsCollapseArrow) + if(arr_id == AttribsExpandBtn || arr_id == AttribsCollapseBtn) { - if(arr_id == AttribsExpandArrow) + if(arr_id == AttribsExpandBtn) coll_mode++; - else if(arr_id == AttribsCollapseArrow) + else if(arr_id == AttribsCollapseBtn) coll_mode--; if(!has_ext_attribs && static_cast(coll_mode) == CollapseMode::ExtAttribsCollapsed) - coll_mode += (arr_id == AttribsExpandArrow ? 1 : -1); + coll_mode += (arr_id == AttribsExpandBtn ? 1 : -1); if(coll_mode > enum_cast(CollapseMode::NotCollapsed)) - collapse_mode = (arr_id == AttribsExpandArrow ? CollapseMode::NotCollapsed : CollapseMode::AllAttribsCollapsed); + collapse_mode = (arr_id == AttribsExpandBtn ? CollapseMode::NotCollapsed : CollapseMode::AllAttribsCollapsed); else collapse_mode = static_cast(coll_mode); } @@ -125,22 +126,22 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) } else if(max_pages != 0) { - if(arr_id == PrevAttribsArrow) + if(arr_id == PrevAttribsPageBtn) current_page--; - else if(arr_id == NextAttribsArrow) + else if(arr_id == NextAttribsPageBtn) current_page++; if(current_page >= max_pages) - current_page = (arr_id == PrevAttribsArrow ? 0 : max_pages - 1); + current_page = (arr_id == PrevAttribsPageBtn ? 0 : max_pages - 1); } configureButtons(this->rect()); - clearArrowSelection(); + clearButtonsSelection(); configureButtonsState(); if(arr_id == PaginationTogglerBtn) emit s_paginationToggled(pagination_enabled); - else if(arr_id == AttribsExpandArrow || arr_id == AttribsCollapseArrow) + else if(arr_id == AttribsExpandBtn || arr_id == AttribsCollapseBtn) emit s_collapseModeChanged(collapse_mode); else emit s_currentPageChanged(current_page); @@ -149,12 +150,12 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) { //Configuring the selection rectangle if the arrows isn't clicked QRectF rect; - QSizeF size = QSizeF(arrows[AttribsExpandArrow]->boundingRect().size().width() + (2 * BaseObjectView::HorizSpacing), - arrows_height + BaseObjectView::VertSpacing); - double px = 0, py = 0, arr_x = arrows[arr_id]->pos().x(); + QSizeF size = QSizeF(buttons[AttribsExpandBtn]->boundingRect().size().width() + (2 * BaseObjectView::HorizSpacing), + btns_height + BaseObjectView::VertSpacing); + double px = 0, py = 0, arr_x = buttons[arr_id]->pos().x(); rect.setSize(size); - px = arr_x - (((arr_x + size.width()) - (arr_x + arrows[arr_id]->boundingRect().width()))/2); + px = arr_x - (((arr_x + size.width()) - (arr_x + buttons[arr_id]->boundingRect().width()))/2); py = (this->boundingRect().size().height() - size.height())/2.5; sel_rect->setBrush(BaseObjectView::getFillStyle(Attributes::ObjSelection)); @@ -170,17 +171,17 @@ void AttributesTogglerItem::setArrowSelected(const QPointF &pnt, bool clicked) void AttributesTogglerItem::configureButtonsState(void) { - arrows[AttribsExpandArrow]->setOpacity(collapse_mode == CollapseMode::ExtAttribsCollapsed || - collapse_mode == CollapseMode::AllAttribsCollapsed? 1 : 0.40); + buttons[AttribsExpandBtn]->setOpacity(collapse_mode == CollapseMode::ExtAttribsCollapsed || + collapse_mode == CollapseMode::AllAttribsCollapsed? 1 : ButtonMinOpacity); - arrows[AttribsCollapseArrow]->setOpacity(collapse_mode == CollapseMode::ExtAttribsCollapsed || - collapse_mode == CollapseMode::NotCollapsed ? 1 : 0.40); + buttons[AttribsCollapseBtn]->setOpacity(collapse_mode == CollapseMode::ExtAttribsCollapsed || + collapse_mode == CollapseMode::NotCollapsed ? 1 : ButtonMinOpacity); - arrows[PrevAttribsArrow]->setOpacity(max_pages != 0 && current_page > 0 ? 1 : 0.40); - arrows[NextAttribsArrow]->setOpacity(max_pages != 0 && current_page < max_pages - 1 ? 1 : 0.40); + buttons[PrevAttribsPageBtn]->setOpacity(max_pages != 0 && current_page > 0 ? 1 : ButtonMinOpacity); + buttons[NextAttribsPageBtn]->setOpacity(max_pages != 0 && current_page < max_pages - 1 ? 1 : ButtonMinOpacity); - arrows[PrevAttribsArrow]->setVisible(pagination_enabled); - arrows[NextAttribsArrow]->setVisible(pagination_enabled); + buttons[PrevAttribsPageBtn]->setVisible(pagination_enabled); + buttons[NextAttribsPageBtn]->setVisible(pagination_enabled); } void AttributesTogglerItem::setHasExtAttributes(bool value) @@ -191,7 +192,7 @@ void AttributesTogglerItem::setHasExtAttributes(bool value) void AttributesTogglerItem::setPaginationEnabled(bool value, bool hide_pag_toggler) { - arrows[PaginationTogglerBtn]->setVisible(!hide_pag_toggler); + buttons[PaginationTogglerBtn]->setVisible(!hide_pag_toggler); pagination_enabled = value; configureButtons(this->boundingRect()); configureButtonsState(); @@ -211,17 +212,22 @@ void AttributesTogglerItem::setPaginationValues(unsigned curr_page, unsigned max } } -void AttributesTogglerItem::clearArrowSelection(void) +void AttributesTogglerItem::clearButtonsSelection(void) { for(unsigned arr_id = 0; arr_id < 5; arr_id++) - arrows_selected[arr_id] = false; + btns_selected[arr_id] = false; this->update(); } -double AttributesTogglerItem::getArrowsWidth(void) +double AttributesTogglerItem::getButtonsWidth(void) +{ + return(btns_width); +} + +double AttributesTogglerItem::getButtonsHeight(void) { - return(arrows_width); + return(btns_height); } void AttributesTogglerItem::configureButtons(const QRectF &rect) @@ -235,74 +241,79 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) QPolygonF pol; QRectF new_rect = rect; + // Defining the previous page button (<) pol.append(QPointF(0, 5 * factor)); pol.append(QPointF(8 * factor, 0)); pol.append(QPointF(8 * factor, 10 * factor)); - arrows_height = pol.boundingRect().height(); - height += arrows_height; + btns_height = pol.boundingRect().height(); + height += btns_height; if(pagination_enabled) { - arrows[PrevAttribsArrow]->setPolygon(pol); + buttons[PrevAttribsPageBtn]->setPolygon(pol); arr_width = pol.boundingRect().width() + h_spacing; + + // Defining the next page button (>) pol.remove(0); pol.translate(-8 * factor, 0); pol.append(QPointF(8 * factor, 5 * factor)); - arrows[NextAttribsArrow]->setPolygon(pol); + buttons[NextAttribsPageBtn]->setPolygon(pol); arr_width += pol.boundingRect().width() + h_spacing; } + // Defining the collapse button (^) pol.clear(); pol.append(QPointF(5 * factor, 0)); pol.append(QPointF(0, 8 * factor)); pol.append(QPointF(10 * factor, 8 * factor)); - arrows[AttribsCollapseArrow]->setPolygon(pol); + buttons[AttribsCollapseBtn]->setPolygon(pol); arr_width += pol.boundingRect().width() + h_spacing; + // Defining the expand button pol.clear(); pol.append(QPointF(0, 0)); pol.append(QPointF(10 * factor, 0)); pol.append(QPointF(5 * factor, 8 * factor)); - arrows[AttribsExpandArrow]->setPolygon(pol); + buttons[AttribsExpandBtn]->setPolygon(pol); arr_width += pol.boundingRect().width() + h_spacing; - if(arrows[PaginationTogglerBtn]->isVisible()) + // Defining the pagination toggler button + if(buttons[PaginationTogglerBtn]->isVisible()) { pol.clear(); pol.append(QPointF(4 * factor, 0)); pol.append(QPointF(8 * factor, 4 * factor)); pol.append(QPointF(4 * factor, 8 * factor)); pol.append(QPointF(0, 4 * factor)); - arrows[PaginationTogglerBtn]->setPolygon(pol); + buttons[PaginationTogglerBtn]->setPolygon(pol); arr_width += pol.boundingRect().width() + h_spacing; } - arrows_width = arr_width; - + btns_width = arr_width; new_rect.setHeight(height); RoundedRectItem::setRect(new_rect); px = (new_rect.width() - arr_width + h_spacing)/2; - if(arrows[PaginationTogglerBtn]->isVisible()) + if(buttons[PaginationTogglerBtn]->isVisible()) { - arrows[PaginationTogglerBtn]->setPos(px, (new_rect.height() - arrows[PaginationTogglerBtn]->boundingRect().height())/2); - px += arrows[PaginationTogglerBtn]->boundingRect().width() + h_spacing; + buttons[PaginationTogglerBtn]->setPos(px, (new_rect.height() - buttons[PaginationTogglerBtn]->boundingRect().height())/2); + px += buttons[PaginationTogglerBtn]->boundingRect().width() + h_spacing; if(pagination_enabled) { - arrows[PrevAttribsArrow]->setPos(px, (new_rect.height() - arrows[PrevAttribsArrow]->boundingRect().height())/2); - px += arrows[PrevAttribsArrow]->boundingRect().width() + h_spacing; + buttons[PrevAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[PrevAttribsPageBtn]->boundingRect().height())/2); + px += buttons[PrevAttribsPageBtn]->boundingRect().width() + h_spacing; - arrows[NextAttribsArrow]->setPos(px, (new_rect.height() - arrows[NextAttribsArrow]->boundingRect().height())/2); - px += arrows[NextAttribsArrow]->boundingRect().width() + h_spacing; + buttons[NextAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[NextAttribsPageBtn]->boundingRect().height())/2); + px += buttons[NextAttribsPageBtn]->boundingRect().width() + h_spacing; } } - arrows[AttribsCollapseArrow]->setPos(px, (new_rect.height() - arrows[AttribsCollapseArrow]->boundingRect().height())/2); - px += arrows[AttribsCollapseArrow]->boundingRect().width() + h_spacing * 0.80; + buttons[AttribsCollapseBtn]->setPos(px, (new_rect.height() - buttons[AttribsCollapseBtn]->boundingRect().height())/2); + px += buttons[AttribsCollapseBtn]->boundingRect().width() + h_spacing * 0.80; - arrows[AttribsExpandArrow]->setPos(px, (new_rect.height() - arrows[AttribsExpandArrow]->boundingRect().height())/2); + buttons[AttribsExpandBtn]->setPos(px, (new_rect.height() - buttons[AttribsExpandBtn]->boundingRect().height())/2); } void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) @@ -311,16 +322,17 @@ void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsI for(unsigned arr_id = 0; arr_id < 5; arr_id++) { - if(!arrows[arr_id]->isVisible()) + if(!buttons[arr_id]->isVisible()) continue; painter->save(); - painter->translate(arrows[arr_id]->pos()); - painter->setOpacity(arrows[arr_id]->opacity()); - arrows[arr_id]->paint(painter, option, widget); + painter->translate(buttons[arr_id]->pos()); + painter->setOpacity(buttons[arr_id]->opacity()); + buttons[arr_id]->paint(painter, option, widget); painter->restore(); - if(arrows_selected[arr_id] && arrows[arr_id]->opacity() > 0.40) + // Drawing the selection rectangle over the button if it isn't faded + if(btns_selected[arr_id] && buttons[arr_id]->opacity() > ButtonMinOpacity) { painter->save(); painter->translate(sel_rect->pos()); diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index 80a188c4be..05ccba02de 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -19,7 +19,7 @@ /** \ingroup libobjrenderer \class AttributesTogglerItem -\brief Implements a basic table's attributes toggler used by BaseTableView. +\brief Implements a basic table's attributes toggler/pagination used by BaseTableView. */ #ifndef ATTRIBUTES_TOGGLER_ITEM_H @@ -34,53 +34,116 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { private: Q_OBJECT + //! \brief Stores the selection rectangle of the item's internal elements QGraphicsRectItem *sel_rect; + //! \brief Stores the current collasping mode related to the table associated to this toggler CollapseMode collapse_mode; - QGraphicsPolygonItem *arrows[5]; + //! \brief Stores the polygonal items denoting the control buttons of the toggler + QGraphicsPolygonItem *buttons[5]; - bool arrows_selected[5], + //! \brief Stores the selected status of the buttons + bool btns_selected[5], + /*! \brief Indicates if the table associated to this toggler has extended attributes + * This attribute changes the way some buttons are rendered */ has_ext_attribs, + //! \brief Indicates if the pagination is enabled for the table associated to this toggler pagination_enabled; - double arrows_width, arrows_height; + //! \brief Stores the width of all visible buttons + double btns_width, + //! \brief Stores the height of all visible buttons + btns_height; + + //! \brief Store the current page visible on the table associated to this toggler unsigned current_page, + //! \brief Store the maximum pages allowed for the table associated to this toggler max_pages; - static constexpr unsigned AttribsExpandArrow=0, - AttribsCollapseArrow=1, - NextAttribsArrow=2, - PrevAttribsArrow=3, + //! \brief The minimum opacity factor used to fade buttons + static constexpr double ButtonMinOpacity = 0.40; + + //! \brief Constant used to reference the attributes expand button + static constexpr unsigned AttribsExpandBtn=0, + + //! \brief Constant used to reference the attributes collapse button + AttribsCollapseBtn=1, + + //! \brief Constant used to reference the next page button + NextAttribsPageBtn=2, + + //! \brief Constant used to reference the previous page button + PrevAttribsPageBtn=3, + + //! \brief Constant used to reference the pagination toggler button PaginationTogglerBtn=4; + /*! \brief Configures the postion and dimensions of the buttons based on the provided bounding rect + * If the provided rect is smaller than the total width/height of the buttons it will be assumed + * as bouding rect the latter dimensions */ void configureButtons(const QRectF &rect); + + /*! \brief Configure the buttons visibility and opacity based upon the current values + * of pagination and collapse mode */ void configureButtonsState(void); public: AttributesTogglerItem(QGraphicsItem *parent = nullptr); ~AttributesTogglerItem(void); - void setArrowsBrush(const QBrush &brush); - void setArrowsPen(const QPen &pen); + //! \brief Configures the buttons brush + void setButtonsBrush(const QBrush &brush); + + //! \brief Configures the buttons pen + void setButtonsPen(const QPen &pen); + + //! \brief Configures the bounding rect of the whole toggler item void setRect(const QRectF &rect); + + //! \brief Configures the current collapse mode of the toggler void setCollapseMode(CollapseMode coll_mode); - void setArrowSelected(const QPointF &pnt, bool clicked = false); + + /*! \brief Set a button selected (highlighted by the selection rectangle) if the provided + * point is within a button's bouding rect. The parameter 'clicked' indicates if the button + * is also clicked and not only hovered (the default behaviour) which causes addtional actions to be executed */ + void setButtonSelected(const QPointF &pnt, bool clicked = false); + + //! \brief Defines if the toggles is controlling extended attributes pagination/collapsing void setHasExtAttributes(bool value); + + /*! \brief Toggles the pagination. If the hide_pag_toggler is set then the button that enables/disables + * the pagination will be hidden permanently and the pagination automatically disabled */ void setPaginationEnabled(bool value, bool hide_pag_toggler = false); + + /*! \brief Defines the current values of the pagination (current page and maximum allowed pages) + * Thes values are used to control the buttons fading when the page navigation reaches one of the limits (min/max) */ void setPaginationValues(unsigned curr_page, unsigned max_page); - void clearArrowSelection(void); - double getArrowsWidth(void); + //! \brief Clears the selection status of the buttons + void clearButtonsSelection(void); + + //! \brief Returns the width of the area occupied by all buttons (including spacing between them) + double getButtonsWidth(void); + + //! \brief Returns the height of the area occupied by all buttons (including a vertical spacing) + double getButtonsHeight(void); + + //! \brief Paints the toggler and its internal componets void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); signals: + //! \brief Signal emitted when the current collapse mode changes (the user clicks the collpase/expand buttons) void s_collapseModeChanged(CollapseMode); + + //! \brief Signal emitted when the current page changes (the user clicks the page navigation buttons) void s_currentPageChanged(unsigned); + + //! \brief Signal emitted when the user clicks the pagination toggler buttons void s_paginationToggled(bool); }; From a0954213afeaf262ea1f11f52a6df6acb9e5b509 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 14 Nov 2018 15:31:58 -0300 Subject: [PATCH 225/425] Persisting current page attribute of tables/views in the database model file --- libobjrenderer/src/basetableview.cpp | 36 ++++++++++++++------ libobjrenderer/src/basetableview.h | 28 ++++++++++++++-- libobjrenderer/src/tableview.cpp | 37 ++++++++++++++++----- libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libpgmodeler/src/basetable.cpp | 2 ++ libpgmodeler/src/basetable.h | 16 +++++++++ libpgmodeler/src/databasemodel.cpp | 2 ++ libpgmodeler/src/table.cpp | 1 + libpgmodeler/src/view.cpp | 1 + libpgmodeler_ui/src/generalconfigwidget.cpp | 2 ++ schemas/xml/dtd/table.dtd | 1 + schemas/xml/dtd/view.dtd | 1 + schemas/xml/sanepredial.omf | 11 ------ schemas/xml/table.sch | 1 + schemas/xml/view.sch | 1 + 16 files changed, 108 insertions(+), 34 deletions(-) delete mode 100755 schemas/xml/sanepredial.omf diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 7004dafbc1..21623761f6 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -20,7 +20,7 @@ bool BaseTableView::hide_ext_attribs = false; bool BaseTableView::hide_tags = false; -unsigned BaseTableView::attribs_per_page = 20; +unsigned BaseTableView::attribs_per_page = 5; BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) { @@ -72,7 +72,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) configurePlaceholder(); connect(attribs_toggler, SIGNAL(s_collapseModeChanged(CollapseMode)), this, SLOT(configureCollapsedSections(CollapseMode))); - connect(attribs_toggler, SIGNAL(s_paginationToggled(bool)), this, SLOT(toggleAttribsPaginaiton(bool))); + connect(attribs_toggler, SIGNAL(s_paginationToggled(bool)), this, SLOT(togglePagination(bool))); connect(attribs_toggler, SIGNAL(s_currentPageChanged(unsigned)), this, SLOT(configureCurrentPage(uint))); } @@ -120,7 +120,7 @@ QVariant BaseTableView::itemChange(GraphicsItemChange change, const QVariant &va { this->setToolTip(this->table_tooltip); configureObjectSelection(); - attribs_toggler->clearArrowSelection(); + attribs_toggler->clearButtonsSelection(); } if(change==ItemPositionHasChanged) @@ -152,18 +152,29 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) //If the user clicks the extended attributes toggler if(!this->isSelected() && event->buttons()==Qt::LeftButton && attribs_toggler->isVisible() && attribs_toggler->boundingRect().contains(pnt)) - attribs_toggler->setArrowSelected(pnt, true); + attribs_toggler->setButtonSelected(pnt, true); BaseObjectView::mousePressEvent(event); } } +void BaseTableView::setAttributesPerPage(unsigned value) +{ + if(value > 0) + attribs_per_page = value; +} + +unsigned BaseTableView::getAttributesPerPage(void) +{ + return(attribs_per_page); +} + void BaseTableView::hoverLeaveEvent(QGraphicsSceneHoverEvent *) { if(!this->isSelected() && obj_selection->isVisible()) obj_selection->setVisible(false); - attribs_toggler->clearArrowSelection(); + attribs_toggler->clearButtonsSelection(); sel_child_obj=nullptr; } @@ -196,7 +207,7 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) if(attribs_toggler->isVisible() && attribs_toggler->boundingRect().contains(pnt)) { - attribs_toggler->setArrowSelected(pnt); + attribs_toggler->setButtonSelected(pnt); } //If the index is invalid clears the selection else if(item_idx < 0 || item_idx >= items.size()) @@ -330,8 +341,8 @@ void BaseTableView::__configureObject(float width) attribs_toggler->setCollapseMode(tab->getCollapseMode()); attribs_toggler->setPaginationEnabled(tab->isPaginationEnabled()); - attribs_toggler->setArrowsBrush(grad); - attribs_toggler->setArrowsPen(body->pen()); + attribs_toggler->setButtonsBrush(grad); + attribs_toggler->setButtonsPen(body->pen()); attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor * pixel_ratio)); //Set the protected icon position to the top-right on the title @@ -366,7 +377,7 @@ double BaseTableView::calculateWidth(void) * This width is used to set the uniform width of table */ vector widths = { columns->isVisible() ? columns->boundingRect().width() : 0, ext_attribs->isVisible() ? ext_attribs->boundingRect().width() : 0, - attribs_toggler->isVisible() ? attribs_toggler->getArrowsWidth() : 0, + attribs_toggler->isVisible() ? attribs_toggler->getButtonsWidth() : 0, title->boundingRect().width() }; std::sort(widths.begin(), widths.end()); @@ -425,10 +436,13 @@ void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) emit s_collapseModeChanged(); } -void BaseTableView::toggleAttribsPaginaiton(bool enabled) +void BaseTableView::togglePagination(bool enabled) { + BaseTable *tab = dynamic_cast(this->getSourceObject()); + startGeometryUpdate(); - dynamic_cast(this->getSourceObject())->setPaginationEnabled(enabled); + tab->setPaginationEnabled(enabled); + tab->setCurrentPage(0); finishGeometryUpdate(); emit s_paginationToggled(); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index d4964e4896..ddf2f122af 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -44,10 +44,16 @@ class BaseTableView: public BaseObjectView { protected: //! \brief Item groups that stores columns and extended attributes, respectively QGraphicsItemGroup *columns, + *ext_attribs; - static bool hide_ext_attribs, hide_tags; + //! brief Indicates if the extended attributes body should be hidden + static bool hide_ext_attribs, + + //! brief Indicates if the tag object should be hidden + hide_tags; + //! brief Controls the maximum amount of attributes visible per page (columns/references + extended attributes) static unsigned attribs_per_page; //! \brief Polygonal object that defines the table body @@ -89,7 +95,13 @@ class BaseTableView: public BaseObjectView { //! \brief Determines the table width based upon its subsection (title, body and extended attribs) double calculateWidth(void); + /*! \brief This as an auxiliary method called before the object changes its dimensions and it causes + * the object to not being selectable. This method is called whenever one of the signals are captured + * from the attributes toggler: s_paginationToggled s_currentPageChanged s_collapseModeChanged */ void startGeometryUpdate(void); + + /*! \brief This auxiliary method is called after any geometry change finishes forcing the update of the object + * and in some cases the schema box which contains it */ void finishGeometryUpdate(void); public: @@ -103,6 +115,12 @@ class BaseTableView: public BaseObjectView { void hoverMoveEvent(QGraphicsSceneHoverEvent *event); void mousePressEvent(QGraphicsSceneMouseEvent *event); + //! brief Defines the amount of attributes per page to be displayed + static void setAttributesPerPage(unsigned value); + + //! brief Returns the current amount of attributes per page to be displayed + static unsigned getAttributesPerPage(void); + //! \brief Hides the table's extended attributes (rules, triggers, indexes). This applies to all table/view instances static void setHideExtAttributes(bool value); @@ -130,11 +148,15 @@ class BaseTableView: public BaseObjectView { void configureObjectShadow(void); private slots: - //! \brief This slot reconfigures the table when the attributes toggler emits the signal s_collapseModeChanged + /*! \brief This slot reconfigures the table when the attributes toggler emits the signal s_collapseModeChanged + * hiding or exposing the sections related to the current collapse mode */ void configureCollapsedSections(CollapseMode coll_mode); - void toggleAttribsPaginaiton(bool enabled); + //! \brief This slot reconfigures the table when the attributes toggler emits the signal s_paginationToggled + void togglePagination(bool enabled); + /*! \brief This slot reconfigures the table when the attributes toggler emits the signal s_currentPageChanged + * causing the the attributes of the current page to be displayed */ void configureCurrentPage(unsigned page); signals: diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index f62859c8e8..848ae1db77 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -49,9 +49,11 @@ void TableView::configureObject(void) //Configures the table title title->configureObject(table); + // We store the columns in a separated vector in order to paginate them (if enabled) columns.assign(table->getObjectList(ObjectType::Column)->begin(), table->getObjectList(ObjectType::Column)->end()); + // We store the extended attributes in a separated vector in order to paginate them (if enabled) for(unsigned idx = 0; idx < 5; idx++) { ext_tab_objs.insert(ext_tab_objs.end(), @@ -59,41 +61,58 @@ void TableView::configureObject(void) table->getObjectList(ext_types[idx])->end()); } + /* Calculating the amount of objects visible on the table. + * If the extended attributes are hidden somehow the amount of these objects is discarded and + * only columns will be visible on the pagination */ if(collapse_mode != CollapseMode::AllAttribsCollapsed) total_objs_cnt = columns.size() + (collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0); + /* If the pagination is enabled for the table and the amount of objects is greater than the + * number of objects per page we configure the pagination parameter */ if(table->isPaginationEnabled() && total_objs_cnt > attribs_per_page) { + // Calculating the proportions of columns and extended attributes displayed per page double col_factor = columns.size() / static_cast(total_objs_cnt), - ext_factor = 1 - col_factor; - unsigned max_pages = 0, res = 0; + ext_factor = 1 - col_factor; + unsigned max_pages = 0, res = 0, curr_page = table->getCurrentPage(); + /* Determining the amount of columns and extended attribs to be displayed based upon + * the proportions of columns/ext. attribs and the total of these objects */ col_cnt = floor(col_factor * attribs_per_page); ext_attr_cnt = hide_ext_attribs ? 0 : floor(ext_factor * attribs_per_page); + + /* In certain situations the calculation aren't exact so we include to the column amount + * the remaining number of elements (generally this ins't greater than 1) */ res = attribs_per_page - (col_cnt + ext_attr_cnt); if(res > 0) col_cnt += res; + // Determining the maximum amount of pages max_pages = ceil(total_objs_cnt / static_cast(attribs_per_page)); - start_col = table->getCurrentPage() * col_cnt; - end_col = start_col + col_cnt; + // Validating the current page related to the maximum determined + if(curr_page >= max_pages) + curr_page = max_pages - 1; - start_ext = table->getCurrentPage() * ext_attr_cnt; + // Calculating the start and end columns/ext. attributes for the current page + start_col = curr_page * col_cnt; + end_col = start_col + col_cnt; + start_ext = curr_page * ext_attr_cnt; end_ext = start_ext + ext_attr_cnt; - attribs_toggler->setPaginationValues(table->getCurrentPage(), max_pages); - if(start_col > columns.size()) start_col = columns.size(); if(start_ext > ext_tab_objs.size()) start_ext = ext_tab_objs.size(); - if(end_col > columns.size() || table->getCurrentPage() == max_pages - 1) + if(end_col > columns.size() || curr_page == max_pages - 1) end_col = columns.size(); - if(end_ext > ext_tab_objs.size() || table->getCurrentPage() == max_pages - 1) + if(end_ext > ext_tab_objs.size() || curr_page == max_pages - 1) end_ext = ext_tab_objs.size(); + + // Configure the attributes toggler item withe the calculated pagination parameters + attribs_toggler->setPaginationValues(curr_page, max_pages); } else { diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index c5949cbfd0..da886afd38 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -125,6 +125,7 @@ namespace Attributes { CreateRole=QString("createrole"), CrowsFoot=QString("crows-foot"), CteExpression=QString("cte-exp"), + CurrentPage=QString("current-page"), CurVersion=QString("cur-version"), CurIdentityType=QString("cur-identity-type"), CustomColor=QString("custom-color"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 75b6bd4a7d..464f512838 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -140,6 +140,7 @@ namespace Attributes { CreateRole, CrowsFoot, CteExpression, + CurrentPage, CurVersion, CurIdentityType, CustomColor, diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 92833f1f96..4acda8243c 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -26,6 +26,7 @@ BaseTable::BaseTable(void) attributes[Attributes::MaxObjCount]=QString(); attributes[Attributes::CollapseMode]=QString(); attributes[Attributes::Pagination]=QString(); + attributes[Attributes::CurrentPage]=QString(); pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; curr_page = 0; @@ -78,6 +79,7 @@ bool BaseTable::isPaginationEnabled(void) void BaseTable::setCurrentPage(unsigned page) { + setCodeInvalidated(curr_page != page); curr_page = page; } diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index b608d0bccd..cc16afc666 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -38,10 +38,14 @@ enum class CollapseMode: unsigned { class BaseTable: public BaseGraphicObject { private: + + //! \brief Indicates if the pagination is enabled for the table bool pagination_enabled; + //! \brief Stores the current collpase mode for the table CollapseMode collapse_mode; + //! \brief Stores the current page visible on the table unsigned curr_page; protected: @@ -99,13 +103,25 @@ class BaseTable: public BaseGraphicObject { //! \brief Copy the attributes between two tables void operator = (BaseTable &tab); + /*! \brief Defines the current collapse mode for the table. Calling this method direclty + * will not update the geometry of the graphical representation of this object. For that, + * the setModified(true) should be called */ void setCollapseMode(CollapseMode coll_mode); + CollapseMode getCollapseMode(void); + /*! \brief Defines the pagination enabling for the table. Calling this method direclty + * will not update the geometry of the graphical representation of this object. For that, + * the setModified(true) should be called */ void setPaginationEnabled(bool value); + bool isPaginationEnabled(void); + /*! \brief Defines the current page visible on the table. Calling this method direclty + * will not update the geometry of the graphical representation of this object. For that, + * the setModified(true) should be called */ void setCurrentPage(unsigned page); + unsigned getCurrentPage(void); friend class DatabaseModel; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 503371004a..3222446746 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4682,6 +4682,7 @@ Table *DatabaseModel::createTable(void) table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); table->setCollapseMode(attribs[Attributes::CollapseMode].isEmpty() ? CollapseMode::NotCollapsed : static_cast(attribs[Attributes::CollapseMode].toUInt())); table->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); + table->setCurrentPage(attribs[Attributes::CurrentPage].toUInt()); table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5890,6 +5891,7 @@ View *DatabaseModel::createView(void) view->setWithNoData(attribs[Attributes::WithNoData]==Attributes::True); view->setCollapseMode(attribs[Attributes::CollapseMode].isEmpty() ? CollapseMode::NotCollapsed : static_cast(attribs[Attributes::CollapseMode].toUInt())); view->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); + view->setCurrentPage(attribs[Attributes::CurrentPage].toUInt()); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index e88c5beb6d..2114774365 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1606,6 +1606,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::PartitionBoundExpr]=part_bounding_expr; attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); + attributes[Attributes::CurrentPage]=(isPaginationEnabled() ? QString::number(getCurrentPage()) : QString()); for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 4c44e81a00..dcf90dcb87 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -581,6 +581,7 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::Tag]=QString(); attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); + attributes[Attributes::CurrentPage]=(isPaginationEnabled() ? QString::number(getCurrentPage()) : QString()); setSQLObjectAttribute(); diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 3a641d1cea..fec90df374 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -29,6 +29,8 @@ map GeneralConfigWidget::config_params; map GeneralConfigWidget::widgets_geom; +#warning "Create a configuration entry for attributes pagination" + GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { QPrinter::PaperSize paper_ids[]={QPrinter::A0, QPrinter::A1, QPrinter::A2, QPrinter::A3, QPrinter::A4, QPrinter::A5, diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 20b75356c7..0f69859e54 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -23,6 +23,7 @@ + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 6ff14a14f4..693a02067f 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -13,6 +13,7 @@ + diff --git a/schemas/xml/sanepredial.omf b/schemas/xml/sanepredial.omf deleted file mode 100755 index a15f3e6fd2..0000000000 --- a/schemas/xml/sanepredial.omf +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index 5ba8b6b465..18c2d64394 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -11,6 +11,7 @@ %if {sql-disabled} %then [ sql-disabled=] "true" %end %if {collapse-mode} %then [ collapse-mode=] "{collapse-mode}" %end %if {pagination} %then [ pagination=] "true" %end + %if {current-page} %then [ current-page=] "{current-page}" %end %if {faded-out} %then [ faded-out=] "true" %end %if {rls-enabled} %then [ rls-enabled=] "true" %end %if {rls-forced} %then [ rls-forced=] "true" %end diff --git a/schemas/xml/view.sch b/schemas/xml/view.sch index 2bbbce075b..3510b93a94 100644 --- a/schemas/xml/view.sch +++ b/schemas/xml/view.sch @@ -14,6 +14,7 @@ %if {sql-disabled} %then [ sql-disabled=] "true" %end %if {collapse-mode} %then [ collapse-mode=] "{collapse-mode}" %end %if {pagination} %then [ pagination=] "true" %end + %if {current-page} %then [ current-page=] "{current-page}" %end %if {faded-out} %then [ faded-out=] "true" %end %if {max-obj-count} %then [ max-obj-count=] "{max-obj-count}" %end > $br From a007da840410133646b52c725baa0067c5ddc4ea Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 14 Nov 2018 16:04:16 -0300 Subject: [PATCH 226/425] Added a configuration option to control attributes per pages in table/ views --- conf/defaults/pgmodeler.conf | 1 + conf/dtd/pgmodeler.dtd | 1 + conf/pgmodeler.conf | 1 + conf/schemas/pgmodeler.sch | 1 + libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libpgmodeler_ui/src/generalconfigwidget.cpp | 29 +- libpgmodeler_ui/src/generalconfigwidget.h | 2 +- libpgmodeler_ui/ui/generalconfigwidget.ui | 497 ++++++++++++-------- 9 files changed, 317 insertions(+), 217 deletions(-) diff --git a/conf/defaults/pgmodeler.conf b/conf/defaults/pgmodeler.conf index f26210ece4..fc3bfdc6c6 100644 --- a/conf/defaults/pgmodeler.conf +++ b/conf/defaults/pgmodeler.conf @@ -36,6 +36,7 @@ show-page-delimiters="true" align-objs-to-grid="true" min-object-opacity="10" + attribs-per-page="20" history-max-length="1000" use-curved-lines="true" compact-view="false" diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd index 3f1b0ead91..610ff22752 100644 --- a/conf/dtd/pgmodeler.dtd +++ b/conf/dtd/pgmodeler.dtd @@ -39,6 +39,7 @@ + diff --git a/conf/pgmodeler.conf b/conf/pgmodeler.conf index f26210ece4..fc3bfdc6c6 100644 --- a/conf/pgmodeler.conf +++ b/conf/pgmodeler.conf @@ -36,6 +36,7 @@ show-page-delimiters="true" align-objs-to-grid="true" min-object-opacity="10" + attribs-per-page="20" history-max-length="1000" use-curved-lines="true" compact-view="false" diff --git a/conf/schemas/pgmodeler.sch b/conf/schemas/pgmodeler.sch index 02af5b471e..b45c9fb715 100644 --- a/conf/schemas/pgmodeler.sch +++ b/conf/schemas/pgmodeler.sch @@ -45,6 +45,7 @@ $sp [ GeneralConfigWidget::config_params; map GeneralConfigWidget::widgets_geom; -#warning "Create a configuration entry for attributes pagination" - GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(parent) { QPrinter::PaperSize paper_ids[]={QPrinter::A0, QPrinter::A1, QPrinter::A2, QPrinter::A3, QPrinter::A4, QPrinter::A5, @@ -132,7 +130,8 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::SourceEditorApp]=QString(); config_params[Attributes::Configuration][Attributes::UiLanguage]=QString(); config_params[Attributes::Configuration][Attributes::UseCurvedLines]=QString(); - config_params[Attributes::Configuration][Attributes:: SaveRestoreGeometry]=QString(); + config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]=QString(); + config_params[Attributes::Configuration][Attributes::AttribsPerPage]=QString(); simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this); simp_obj_creation_ht->setText(simple_obj_creation_chk->statusTip()); @@ -185,6 +184,9 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa use_curved_lines_ht=new HintTextWidget(use_curved_lines_hint, this); use_curved_lines_ht->setText(use_curved_lines_chk->statusTip()); + attributes_per_page_ht=new HintTextWidget(attributes_per_page_hint, this); + attributes_per_page_ht->setText(attributes_per_page_spb->statusTip()); + selectPaperSize(); QList chk_boxes=this->findChildren(); @@ -307,6 +309,7 @@ void GeneralConfigWidget::loadConfiguration(void) landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PaperOrientation]==Attributes::Landscape); min_obj_opacity_spb->setValue(config_params[Attributes::Configuration][Attributes::MinObjectOpacity].toUInt()); + attributes_per_page_spb->setValue(config_params[Attributes::Configuration][Attributes::AttribsPerPage].toUInt()); margin=config_params[Attributes::Configuration][Attributes::PaperMargin].split(','); custom_size=config_params[Attributes::Configuration][Attributes::PaperCustomSize].split(','); @@ -346,15 +349,15 @@ void GeneralConfigWidget::loadConfiguration(void) widgets_geom.clear(); for(auto itr : config_params) { - if(itr.second.count(Attributes::XPos)) - { - x = itr.second[Attributes::XPos].toInt(); - y = itr.second[Attributes::YPos].toInt(); - w = itr.second[Attributes::Width].toInt(); - h = itr.second[Attributes::Height].toInt(); - widgets_geom[itr.first].geometry = QRect(QPoint(x,y), QSize(w, h)); - widgets_geom[itr.first].maximized = itr.second[Attributes::Maximized] == Attributes::True; - } + if(itr.second.count(Attributes::XPos)) + { + x = itr.second[Attributes::XPos].toInt(); + y = itr.second[Attributes::YPos].toInt(); + w = itr.second[Attributes::Width].toInt(); + h = itr.second[Attributes::Height].toInt(); + widgets_geom[itr.first].geometry = QRect(QPoint(x,y), QSize(w, h)); + widgets_geom[itr.first].maximized = itr.second[Attributes::Maximized] == Attributes::True; + } } updateFontPreview(); @@ -486,6 +489,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::UsePlaceholders]=(use_placeholders_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString::number(history_max_length_spb->value()); config_params[Attributes::Configuration][Attributes::UseCurvedLines]=(use_curved_lines_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::AttribsPerPage]=QString::number(attributes_per_page_spb->value()); ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); config_params[Attributes::Configuration][Attributes::ShowCanvasGrid]=(show_grid ? Attributes::True : QString()); @@ -621,6 +625,7 @@ void GeneralConfigWidget::applyConfiguration(void) OperationList::setMaximumSize(oplist_size_spb->value()); BaseTableView::setHideExtAttributes(hide_ext_attribs_chk->isChecked()); BaseTableView::setHideTags(hide_table_tags_chk->isChecked()); + BaseTableView::setAttributesPerPage(attributes_per_page_spb->value()); RelationshipView::setHideNameLabel(hide_rel_name_chk->isChecked()); RelationshipView::setCurvedLines(use_curved_lines_chk->isChecked()); ModelWidget::setSaveLastCanvasPosition(save_last_pos_chk->isChecked()); diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index 4579b08dfb..1654c86e02 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -64,7 +64,7 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg *hide_ext_attribs_ht, *hide_table_tags_ht, *hide_rel_name_ht, *code_completion_ht, *use_placeholders_ht, *min_obj_opacity_ht, *autosave_ht, *op_history_ht, *ui_language_ht, *grid_size_ht, - *use_curved_lines_ht, *max_result_rows_ht; + *use_curved_lines_ht, *max_result_rows_ht, *attributes_per_page_ht; ColorPickerWidget *line_numbers_cp, *line_numbers_bg_cp, *line_highlight_cp; diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index a32ffd9c43..5ac16c1eb2 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -7,7 +7,7 @@ 0 0 743 - 587 + 712 @@ -81,10 +81,10 @@ 10 - - + + - + 0 @@ -98,12 +98,12 @@ - Minimum object opacity (%): + Attributes per page: - + 0 @@ -117,13 +117,13 @@ - Defines the minimum opacity percentage applied to the objects when using the fade out feature. A zero opacity causes the object to be completely hidden not being possible to interact with it in the canvas area. + Defines the minimum amount of attributes visible per page on tables and view when the pagination is enabled on these objects. - 0 + 5 - 70 + 100 5 @@ -134,7 +134,7 @@ - + Qt::Horizontal @@ -147,7 +147,7 @@ - + 0 @@ -170,12 +170,12 @@ - - + + - + - + 0 0 @@ -186,16 +186,13 @@ 0 - - - - Canvas grid size: + Minimum object opacity (%): - + 0 @@ -209,24 +206,24 @@ - Defines the vertical and horizontal grid size. This value affects the spacing of objects when using the feature that aligns the objects on the grid. + Defines the minimum opacity percentage applied to the objects when using the fade out feature. A zero opacity causes the object to be completely hidden not being possible to interact with it in the canvas area. - 10 + 0 - 100 + 70 - 1 + 5 - 20 + 10 - + Qt::Horizontal @@ -239,7 +236,7 @@ - + 0 @@ -262,32 +259,73 @@ - - + + - + - + 0 0 + + + 210 + 0 + + - Start move the canvas when the cursor is on the canvas edges + Defines the period when the opened models will be saved automatically. The temporary models saving period will be defined as the half of the value defined here. If the autosave is disabled the temporary models saving will occur in a period of 5 minutes. - Move canvas by keep mouse on corners + Autosave interval (minutes): - - false + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + 5 + + + 30 + + + 5 - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + 0 @@ -310,29 +348,67 @@ - - + + - + - + 0 0 - - + + + 210 + 0 + + + + Operation history size: + + + + + + + + 0 + 0 + + + + + 60 + 0 + - After loading the model the last zoom and position on canvas will be restored + Defines the maximum amount of elements held in the operation history. Once reached the maximum number the history is automatically cleaned. - - Save and restore last position and zoom + + 500 + + + 1000 - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + 0 @@ -355,32 +431,76 @@ - - + + - + - + 0 0 - - + + + 210 + 0 + - By default the range selection is triggered with Shift + left click. By checking this option range selection will be activated only with a single click and move. + - Trigger range selection with a single click + Canvas grid size: - - false + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + Defines the vertical and horizontal grid size. This value affects the spacing of objects when using the feature that aligns the objects on the grid. + + + 10 + + + 100 + + + 1 + + + 20 - + + + Qt::Horizontal + + + + 40 + 20 + + + + + + 0 @@ -403,10 +523,10 @@ - - + + - + 0 @@ -417,15 +537,18 @@ - Hide the portion of table which represents triggers, indexes and rules. + Graphical objects (table, views and textboxes) will be created in a single step without the need to click on canvas - Hide table extended attributes + Simplify the creation of graphical objects + + + false - + 0 @@ -448,12 +571,12 @@ - - + + - + - + 0 0 @@ -462,15 +585,15 @@ - Hide the object which represents the tag assigned to the table + When enabled this option creates a placeholder object at the previous table's position when starting to move it. This will cause graphical updates on relationship lines to be performed only when the drag & drop action is done improving the performance. Disabling placeholders will cause those updates to be executed every time the table's position changes a single pixel (classical behavior). - Hide table tags + Use placeholders when moving tables - + 0 @@ -493,67 +616,29 @@ - - - - - - - 0 - 0 - - - - - 210 - 0 - - - - Operation history: - - - + + - + - + 0 0 - - - 60 - 0 - + + - Defines the maximum amount of elements held in the operation history. Once reached the maximum number the history is automatically cleaned. - - - 500 + After loading the model the last zoom and position on canvas will be restored - - 1000 + + Save and restore last position and zoom - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + 0 @@ -576,18 +661,24 @@ - - + + - + + + + 0 + 0 + + - Triggers a dialog asking the user to validate the model before a save, export or diff operation. + By default the range selection is triggered with Shift + left click. By checking this option range selection will be activated only with a single click and move. - Validate before save, export or diff + Trigger range selection with a single click false @@ -595,7 +686,7 @@ - + 0 @@ -618,73 +709,74 @@ - - + + - + - + 0 0 - - - 200 - 0 - - - Defines the period when the opened models will be saved automatically. The temporary models saving period will be defined as the half of the value defined here. If the autosave is disabled the temporary models saving will occur in a period of 5 minutes. + Hide the portion of table which represents triggers, indexes and rules. - Autosave interval (minutes): + Hide table extended attributes - + - + 0 0 - 60 - 0 + 22 + 22 - - 5 - - - 30 - - - 5 + + + 22 + 22 + + + + + - - - Qt::Horizontal + + + + 0 + 0 + - - - 40 - 20 - + + - + + Hide the object which represents the tag assigned to the table + + + Hide table tags + + - + 0 @@ -707,12 +799,12 @@ - - + + - + - + 0 0 @@ -721,15 +813,15 @@ - Disable the antialiasing for lines and texts improving performance when handling huge models. + Hide the object that represents the relationship name - Disable render smoothness + Hide relationship name - + 0 @@ -752,24 +844,18 @@ - - + + - - - - 0 - 0 - - + - Graphical objects (table, views and textboxes) will be created in a single step without the need to click on canvas + Triggers a dialog asking the user to validate the model before a save, export or diff operation. - Simplify creation of graphical objects + Validate before save, export or diff false @@ -777,7 +863,7 @@ - + 0 @@ -800,12 +886,12 @@ - - + + - + - + 0 0 @@ -814,15 +900,18 @@ - Toggles the code completion in all fields that accepts the input of SQL commands. + Start move the canvas when the cursor is on the canvas edges - Enable SQL code completion + Move canvas by keeping the mouse on corners + + + false - + 0 @@ -845,12 +934,12 @@ - - + + - + - + 0 0 @@ -859,15 +948,15 @@ - When enabled this option creates a placeholder object at the previous table's position when starting to move it. This will cause graphical updates on relationship lines to be performed only when the drag & drop action is done improving the performance. Disabling placeholders will cause those updates to be executed every time the table's position changes a single pixel (classical behavior). + Replaces any straight line in relationship by curved ones in order to improve the model's visualization. - Use placeholders when moving tables + Use curved lines for relationships - + 0 @@ -890,10 +979,10 @@ - - + + - + 0 @@ -904,15 +993,15 @@ - Hide the object that represents the relationship name + Toggles the code completion in all fields that accepts the input of SQL commands. - Hide relationship name + Enable SQL code completion - + 0 @@ -935,12 +1024,12 @@ - - + + - + - + 0 0 @@ -949,15 +1038,15 @@ - Replaces any straight line in relationship by curved ones in order to improve the model's visualization. + Disable the antialiasing for lines and texts improving performance when handling huge models. - Use curved lines for relationships + Disable render smoothness - + 0 From 1d3cac7c3ae64561b0893902020f381ad3a9901b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 14 Nov 2018 16:11:20 -0300 Subject: [PATCH 227/425] Added a fix step on CLI to remove the deprecated attribute hide-ext- attribs from tables and views xml code --- main-cli/src/pgmodelercli.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 9f6d828785..fadb229452 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1104,10 +1104,15 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) obj_xml.insert(end_idx + EndTagExpr.arg(Attributes::Expression).length() + 1, QString("\n\t\n")); } + //Remove the deprecated attribute hide-ext-attribs from
and + if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Table))) || + obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::View)))) + { + obj_xml.replace(QRegExp(AttributeExpr.arg(Attributes::HideExtAttribs)), QString()); + } + //Fix the references to op. classes and families if needed fixOpClassesFamiliesReferences(obj_xml); - - #warning "TODO: Add a fix to remove hide-ext-attribs on tables/views" } void PgModelerCli::fixOpClassesFamiliesReferences(QString &obj_xml) From 4ce818c81229ccb6a824d264ed25de25aa215acd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 14 Nov 2018 17:06:50 -0300 Subject: [PATCH 228/425] Added a pagination toggler action on context menu at ModelWidget --- libobjrenderer/src/basetableview.cpp | 3 +- libobjrenderer/src/tableview.cpp | 2 + libpgmodeler/src/basetable.cpp | 3 ++ libpgmodeler_ui/res/icones/pagination.png | Bin 0 -> 666 bytes libpgmodeler_ui/res/resources.qrc | 1 + libpgmodeler_ui/src/modelsdiffhelper.cpp | 1 + libpgmodeler_ui/src/modelwidget.cpp | 46 +++++++++++++++++++++- libpgmodeler_ui/src/modelwidget.h | 5 +++ 8 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/pagination.png diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 21623761f6..bb7e97d62f 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -339,11 +339,10 @@ void BaseTableView::__configureObject(float width) grad.setColorAt(1, body->pen().color().lighter()); pen.setStyle(Qt::SolidLine); - attribs_toggler->setCollapseMode(tab->getCollapseMode()); - attribs_toggler->setPaginationEnabled(tab->isPaginationEnabled()); attribs_toggler->setButtonsBrush(grad); attribs_toggler->setButtonsPen(body->pen()); attribs_toggler->setRect(QRectF(0, 0, width, 12 * factor * pixel_ratio)); + attribs_toggler->setCollapseMode(tab->getCollapseMode()); //Set the protected icon position to the top-right on the title protected_icon->setPos(title->pos().x() + (2 * HorizSpacing), title->boundingRect().height() * 0.25); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 848ae1db77..2de863087a 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -67,6 +67,8 @@ void TableView::configureObject(void) if(collapse_mode != CollapseMode::AllAttribsCollapsed) total_objs_cnt = columns.size() + (collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0); + attribs_toggler->setPaginationEnabled(table->isPaginationEnabled()); + /* If the pagination is enabled for the table and the amount of objects is greater than the * number of objects per page we configure the pagination parameter */ if(table->isPaginationEnabled() && total_objs_cnt > attribs_per_page) diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 4acda8243c..b2d36aef72 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -70,6 +70,9 @@ void BaseTable::setPaginationEnabled(bool value) { setCodeInvalidated(pagination_enabled != value); pagination_enabled = value; + + if(!pagination_enabled) + curr_page = 0; } bool BaseTable::isPaginationEnabled(void) diff --git a/libpgmodeler_ui/res/icones/pagination.png b/libpgmodeler_ui/res/icones/pagination.png new file mode 100644 index 0000000000000000000000000000000000000000..eabba28bd9696d316a542860310e3bae638bf5cd GIT binary patch literal 666 zcmV;L0%iS)P)Uhb`C$y4)6zBzjX&=mf!hyL67F>z+ccgKrmV?KrkAj z(TNmIks1fkTJz@FqeO~Zot%88Ua#+{M61TsYPB9N6ad^a5CjV;?c3s7CvyO;?1ulH zPmpv6tQOvZg##>b3LF5fb>e5h*0UXW+39o=1z1~K1E~1`B0{-bP82{yfUpB1!ph3Z zT#0JUJpf)jeK3>1-|qwA6o?4Mn8<3)y|L$MR%`B&&E)~6#sFk<`3pI12cj_)5k!QI zt$nh&JR4j4(b^=lafQ{&*!ytmv$=gRaaV4f)ny%UA#BdE z4p@M8qr%ysPw&HP&IWzjjmpHNZrtwz#B*Nw1XebAyHSa|CdRoC)8rO+WsLbU@mG9R z@i@d)x@<$y7^c%RUyJ~F{$zbFzlfley5SpR4v&tGj*G=&UPL^=6OqVp?mxzu=sEO_ z$@4sWyaf=Y&W9}YiBd`c>GgVFGnvfWX_qSnECU(f8n6VUL-T=DXckC9Gk^vH;74df z;2ZEA7=>}?&{F^=0olUJ0Zicones/relationshippart.png icones/resizecols.png icones/collapse.png + icones/pagination.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 994e91bac1..c35f23a103 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -326,6 +326,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) Attributes::FillColor, Attributes::FadedOut, Attributes::CollapseMode, + Attributes::CurrentPage, Attributes::Pagination}, { Attributes::Role, Attributes::Tablespace, diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index ec2c63fc42..f582f861fc 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -154,9 +154,8 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) //Force the scene to be drawn from the left to right and from top to bottom viewport->setAlignment(Qt::AlignLeft | Qt::AlignTop); - viewport->setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); + viewport->setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate); viewport->setCacheMode(QGraphicsView::CacheBackground); - //viewport->setOptimizationFlag(QGraphicsView::DontAdjustForAntialiasing); viewport->centerOn(0,0); viewport->setMouseTracking(true); @@ -299,6 +298,17 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) action_duplicate->setShortcut(QKeySequence(trUtf8("Ctrl+D"))); action_duplicate->setMenuRole(QAction::NoRole); + action_pagination=new QAction(QIcon(PgModelerUiNs::getIconPath("pagination")), trUtf8("Pagination"), this); + action_pagination->setMenu(&pagination_menu); + + action = pagination_menu.addAction(trUtf8("Enable")); + action->setData(true); + connect(action, SIGNAL(triggered(bool)), this, SLOT(togglePagination())); + + action = pagination_menu.addAction(trUtf8("Disable")); + action->setData(false); + connect(action, SIGNAL(triggered(bool)), this, SLOT(togglePagination())); + action_collapse_mode=new QAction(QIcon(PgModelerUiNs::getIconPath("collapse")), trUtf8("Collapse"), this); action_no_collapse_attribs=new QAction(trUtf8("Not collapsed"), this); action_no_collapse_attribs->setData(enum_cast(CollapseMode::NotCollapsed)); @@ -3534,6 +3544,35 @@ void ModelWidget::setCollapseMode(void) this->setModified(true); } +void ModelWidget::togglePagination(void) +{ + bool enable = dynamic_cast(sender())->data().toBool(); + BaseTable *base_tab = nullptr; + vector objects; + + if(selected_objects.empty() || (selected_objects.size() == 1 && selected_objects[0] == db_model)) + { + objects.assign(db_model->getObjectList(ObjectType::Table)->begin(), db_model->getObjectList(ObjectType::Table)->end()); + objects.insert(objects.end(), db_model->getObjectList(ObjectType::View)->begin(), db_model->getObjectList(ObjectType::View)->end()); + } + else + objects = selected_objects; + + for(auto obj : objects) + { + base_tab = dynamic_cast(obj); + + if(base_tab && base_tab->isPaginationEnabled() != enable) + { + base_tab->setPaginationEnabled(enable); + base_tab->setModified(true); + } + } + + db_model->setObjectsModified({ ObjectType::Schema }); + this->setModified(true); +} + void ModelWidget::toggleSchemasRectangles(void) { bool visible = sender() == action_show_schemas_rects; @@ -3820,7 +3859,10 @@ void ModelWidget::configurePopupMenu(const vector &objects) } if(tab_or_view || objects.empty() || objects.size() == 1) + { popup_menu.addAction(action_collapse_mode); + popup_menu.addAction(action_pagination); + } if(objects.empty() || (objects.size() == 1 && objects[0]->getObjectType() == ObjectType::Database)) popup_menu.addAction(action_schemas_rects); diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index 4b8e6ff606..4aceed18f4 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -114,6 +114,8 @@ class ModelWidget: public QWidget { toggle_attrs_menu, + pagination_menu, + select_all_menu, jump_to_tab_menu, @@ -236,6 +238,7 @@ class ModelWidget: public QWidget { *action_fade_rels, *action_fade_rels_in, *action_fade_rels_out, + *action_pagination, *action_collapse_mode, *action_collapse_ext_attribs, *action_collpase_all_attribs, @@ -474,6 +477,8 @@ class ModelWidget: public QWidget { void setCollapseMode(void); + void togglePagination(void); + void toggleSchemasRectangles(void); void editCreationOrder(void); From 7718721b77a921965a2b8f1bfb3ec4e3c221d24a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 15 Nov 2018 11:40:45 -0300 Subject: [PATCH 229/425] Fixed the column name deduction for recursive views --- libpgmodeler/src/view.cpp | 75 +++++++++++++++++++++++++++++++-------- libpgmodeler/src/view.h | 23 +++++++++--- 2 files changed, 79 insertions(+), 19 deletions(-) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index dcf90dcb87..b221483d97 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -185,34 +185,77 @@ vector *View::getExpressionList(unsigned sql_type) return(nullptr); } -QStringList View::getColumnsList(void) +void View::generateColumnNamesTypes(void) { - QStringList col_list; - unsigned i=0, count=exp_select.size(), col_id=0, col_count=0; - Table *tab=nullptr; + unsigned col_id = 0, col_count = 0, expr_idx = 0; + Table *tab = nullptr; + Reference ref; + Column *col = nullptr; + QStringList names; + QString fmt_name; - for(i=0; i < count; i++) + col_names.clear(); + col_types.clear(); + + for(auto ref_id : exp_select) { - if(!references[i].getColumn()) + ref = references[ref_id]; + + if(!ref.getExpression().isEmpty()) { - tab=references[i].getTable(); + if(!ref.getAlias().isEmpty()) + names.push_back(ref.getAlias()); + else + names.push_back(QString("_expr%1_").arg(expr_idx++)); - if(!tab) continue; + col_types.push_back(Attributes::Expression); + } + else if(!ref.getColumn()) + { + tab=ref.getTable(); col_count=tab->getColumnCount(); for(col_id=0; col_id < col_count; col_id++) - col_list.push_back(tab->getColumn(col_id)->getName(true)); + { + col = tab->getColumn(col_id); + names.push_back(col->getName()); + col_types.push_back(*col->getType()); + } } else { - if(!references[i].getColumnAlias().isEmpty()) - col_list.push_back(references[i].getColumnAlias()); + if(!ref.getColumnAlias().isEmpty()) + names.push_back(ref.getColumnAlias()); else - col_list.push_back(references[i].getColumn()->getName(true)); + names.push_back(ref.getColumn()->getName()); + + col_types.push_back(*ref.getColumn()->getType()); + } + } + + for(auto &name : names) + { + col_id = 1; + fmt_name = name; + + while(col_names.indexOf(BaseObject::formatName(fmt_name)) >= 0) + { + fmt_name = name + QString::number(col_id); + col_id++; } + + col_names.push_back(fmt_name); } +} - return(col_list); +QStringList View::getColumnNames(void) +{ + return(col_names); +} + +QStringList View::getColumnTypes(void) +{ + return(col_types); } void View::addReference(Reference &refer, unsigned sql_type, int expr_id) @@ -274,6 +317,7 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) this->object_id=BaseObject::getGlobalId(); } + generateColumnNamesTypes(); setCodeInvalidated(true); } @@ -366,6 +410,7 @@ void View::removeReference(unsigned ref_id) //Removes the reference from the view references.erase(references.begin() + ref_id); + generateColumnNamesTypes(); setCodeInvalidated(true); } @@ -376,6 +421,8 @@ void View::removeReferences(void) exp_from.clear(); exp_where.clear(); exp_end.clear(); + col_names.clear(); + col_types.clear(); setCodeInvalidated(true); } @@ -586,7 +633,7 @@ QString View::getCodeDefinition(unsigned def_type) setSQLObjectAttribute(); if(recursive) - attributes[Attributes::Columns]=getColumnsList().join(','); + attributes[Attributes::Columns]=col_names.join(','); if(tag && def_type==SchemaParser::XmlDefinition) attributes[Attributes::Tag]=tag->getCodeDefinition(def_type, true); diff --git a/libpgmodeler/src/view.h b/libpgmodeler/src/view.h index 429fd425d1..699997edb3 100644 --- a/libpgmodeler/src/view.h +++ b/libpgmodeler/src/view.h @@ -30,6 +30,12 @@ class View: public BaseTable { private: + //! \brief Deduced column names + QStringList col_names, + + //! \brief Deduces column types + col_types; + //! \brief Stores the references to expressions and objects vector references; @@ -71,13 +77,14 @@ class View: public BaseTable { //! \brief Returns the reference to internal expression list according to the SQL expression type vector *getExpressionList(unsigned sql_type); - /*! \brief Returns a list of deduced names for view's colums for recursive views. - The names are retrieved, first, from columns aliases and lastly from table's columns - when TABLE.* syntax is used */ - QStringList getColumnsList(void); - void setSQLObjectAttribute(void); + /*! \brief Returns a list of deduced names for view's colums (useful for recursive views). + * The names are retrieved, first, from columns aliases and lastly from table's columns + * when TABLE.* syntax is used. For expressions, if aliases aren't defined, a column name in the + * for _expr#_ is used. */ + void generateColumnNamesTypes(void); + public: View(void); ~View(void); @@ -238,6 +245,12 @@ class View: public BaseTable { unsigned getMaxObjectCount(void); + //! \brief Returns the deduced names of the view's columns + QStringList getColumnNames(void); + + //! \brief Returns the deduced types of the view's columns + QStringList getColumnTypes(void); + //! \brief Copy the attributes between two views void operator = (View &visao); }; From 04741eed0d5e1e00269f3df1cb9161fe74090f91 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 15 Nov 2018 13:22:44 -0300 Subject: [PATCH 230/425] Improved the update of views when referencend columns and tables change their structure --- libobjrenderer/src/graphicalview.cpp | 51 +++++++++++++++++++++----- libobjrenderer/src/tableobjectview.cpp | 43 ++++++++++++++++++++++ libobjrenderer/src/tableobjectview.h | 3 ++ libpgmodeler/src/databasemodel.cpp | 28 ++++++++++++++ libpgmodeler/src/databasemodel.h | 3 ++ libpgmodeler/src/view.h | 12 +++--- libpgmodeler_ui/src/columnwidget.cpp | 2 + libpgmodeler_ui/src/mainwindow.cpp | 5 ++- libpgmodeler_ui/src/modelwidget.cpp | 3 ++ libpgmodeler_ui/src/tablewidget.cpp | 1 + 10 files changed, 134 insertions(+), 17 deletions(-) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index f510de073c..9c04a42979 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -47,6 +47,8 @@ void GraphicalView::configureObject(void) QList col_items; TableObject *tab_obj=nullptr; Tag *tag=view->getTag(); + QStringList col_names = view->getColumnNames(), + col_types = view->getColumnTypes(); //Configures the view's title title->configureObject(view); @@ -57,10 +59,12 @@ void GraphicalView::configureObject(void) attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_view_objs.empty()); //Gets the reference count on SELECT part of the SQL definition - count=view->getReferenceCount(Reference::SqlReferSelect); + //count=view->getReferenceCount(Reference::SqlReferSelect); - if(count==0) - count=count1=view->getReferenceCount(Reference::SqlViewDefinition); + //if(count==0) + // count=count1=view->getReferenceCount(Reference::SqlViewDefinition); + + count = col_names.size(); //Moves the references group to the origin to be moved latter columns->moveBy(-columns->scenePos().x(), -columns->scenePos().y()); @@ -82,10 +86,10 @@ void GraphicalView::configureObject(void) subitems=columns->childItems(); for(i=0; i < count; i++) { - if(count1==0) - ref=view->getReference(i, Reference::SqlReferSelect); - else - ref=view->getReference(i, Reference::SqlViewDefinition); + //if(count1==0) + // ref=view->getReference(i, Reference::SqlReferSelect); + //else + // ref=view->getReference(i, Reference::SqlViewDefinition); //Reuses the subitem if it was allocated before if(!subitems.isEmpty() && i < subitems.size()) @@ -99,10 +103,22 @@ void GraphicalView::configureObject(void) else graph_ref=new TableObjectView; - columns->removeFromGroup(graph_ref); - graph_ref->configureObject(ref); + //columns->removeFromGroup(graph_ref); + graph_ref->configureObject(col_names[i], col_types[i], QString("----")); graph_ref->moveBy(HorizSpacing, i * graph_ref->boundingRect().height()); - columns->addToGroup(graph_ref); + //columns->addToGroup(graph_ref); + + /* Calculates the width of the name + type of the object. This is used to align all + the constraint labels on table */ + width=graph_ref->getChildObject(TableObjectView::ObjDescriptor)->boundingRect().width() + + graph_ref->getChildObject(TableObjectView::NameLabel)->boundingRect().width() + (8 * HorizSpacing); + if(px < width) px=width; + + //Gets the maximum width of the column type label to align all at same horizontal position + if(type_width < graph_ref->getChildObject(TableObjectView::TypeLabel)->boundingRect().width()) + type_width=graph_ref->getChildObject(TableObjectView::TypeLabel)->boundingRect().width() + (3 * HorizSpacing); + + col_items.push_back(graph_ref); } //Destroy the graphical references not used @@ -114,6 +130,21 @@ void GraphicalView::configureObject(void) delete(graph_ref); i--; } + + //Set all items position + while(!col_items.isEmpty()) + { + col_item=dynamic_cast(col_items.front()); + columns->removeFromGroup(col_item); + col_items.pop_front(); + + //Positioning the type label + col_item->setChildObjectXPos(TableObjectView::TypeLabel, px); + + //Positioning the constraints label + col_item->setChildObjectXPos(TableObjectView::ConstrAliasLabel, px + type_width); + columns->addToGroup(col_item); + } } if(!hide_ext_attribs && view->getCollapseMode() == CollapseMode::NotCollapsed) diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 10b1a6b19b..5d2249262e 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -508,6 +508,49 @@ void TableObjectView::configureObject(Reference reference) calculateBoundingRect(); } +void TableObjectView::configureObject(const QString &name, const QString &type, const QString &alias) +{ + QTextCharFormat fmt; + double px; + + configureDescriptor(); + descriptor->setPos(HorizSpacing, 0); + px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HorizSpacing); + + fmt = font_config[Attributes::Column]; + lables[0]->setText(name); + lables[0]->setFont(fmt.font()); + lables[0]->setBrush(fmt.foreground()); + lables[0]->setPos(px, 0); + px+=lables[0]->boundingRect().width() + (4 * HorizSpacing); + + if(!compact_view && !type.isEmpty()) + { + fmt=font_config[Attributes::ObjectType]; + lables[1]->setText(type); + lables[1]->setFont(fmt.font()); + lables[1]->setBrush(fmt.foreground()); + lables[1]->setPos(px, 0); + px+=lables[1]->boundingRect().width() + (4 * HorizSpacing); + } + else + lables[1]->setText(QString()); + + //Configures a label for the alias (if there is one) + if(!compact_view && !alias.isEmpty()) + { + fmt=font_config[Attributes::Alias]; + lables[2]->setText(QString(" (") + alias + QString(") ")); + lables[2]->setFont(fmt.font()); + lables[2]->setBrush(fmt.foreground()); + lables[2]->setPos(px, 0); + } + else + lables[2]->setText(QString()); + + calculateBoundingRect(); +} + void TableObjectView::setChildObjectXPos(unsigned obj_idx, double px) { if(obj_idx >= 4) diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index bd3ce63ea3..7387577ad4 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -76,6 +76,9 @@ class TableObjectView: public BaseObjectView //! \brief Configures the object as a view reference void configureObject(Reference reference); + //! \brief Configures a generic item containing a name, datatype and alias + void configureObject(const QString &name, const QString &type, const QString &alias = QString()); + //! \brief Configures the object as a table object void configureObject(void); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 3222446746..b8164d5883 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -5786,6 +5786,34 @@ GenericSQL *DatabaseModel::createGenericSQL(void) return(genericsql); } +void DatabaseModel::updateViewsReferTable(Table *table) +{ + BaseRelationship *rel = nullptr; + View *view = nullptr; + Table *tab = nullptr; + + if(!table) return; + + for(auto obj : base_relationships) + { + rel = dynamic_cast(obj); + + if(rel->getRelationshipType() != BaseRelationship::RelationshipDep) + continue; + + view = dynamic_cast(rel->getTable(BaseRelationship::SrcTable)); + tab = dynamic_cast
(rel->getTable(BaseRelationship::DstTable)); + + if(view && tab == table) + { + view->generateColumnNamesTypes(); + view->setCodeInvalidated(true); + view->setModified(true); + dynamic_cast(view->getSchema())->setModified(true); + } + } +} + Sequence *DatabaseModel::createSequence(bool ignore_onwer) { attribs_map attribs; diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 3d16b41b98..66c8836b0b 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -534,6 +534,9 @@ class DatabaseModel: public QObject, public BaseObject { EventTrigger *createEventTrigger(void); GenericSQL *createGenericSQL(void); + //! \brief Update views that reference the provided table forcing the column name deduction and redraw of the former objects + void updateViewsReferTable(Table *table); + //! \brief Creates/removes the relationship between the passed view and the referecend tables void updateViewRelationships(View *view, bool force_rel_removal=false); diff --git a/libpgmodeler/src/view.h b/libpgmodeler/src/view.h index 699997edb3..d03089d647 100644 --- a/libpgmodeler/src/view.h +++ b/libpgmodeler/src/view.h @@ -79,12 +79,6 @@ class View: public BaseTable { void setSQLObjectAttribute(void); - /*! \brief Returns a list of deduced names for view's colums (useful for recursive views). - * The names are retrieved, first, from columns aliases and lastly from table's columns - * when TABLE.* syntax is used. For expressions, if aliases aren't defined, a column name in the - * for _expr#_ is used. */ - void generateColumnNamesTypes(void); - public: View(void); ~View(void); @@ -251,6 +245,12 @@ class View: public BaseTable { //! \brief Returns the deduced types of the view's columns QStringList getColumnTypes(void); + /*! \brief Returns a list of deduced names for view's colums (useful for recursive views). + * The names are retrieved, first, from columns aliases and lastly from table's columns + * when TABLE.* syntax is used. For expressions, if aliases aren't defined, a column name in the + * for _expr#_ is used. */ + void generateColumnNamesTypes(void); + //! \brief Copy the attributes between two views void operator = (View &visao); }; diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index ad64fb293a..db9aae40b5 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -198,6 +198,8 @@ void ColumnWidget::applyConfiguration(void) } BaseObjectWidget::applyConfiguration(); + model->updateViewsReferTable(dynamic_cast
(table)); + finishConfiguration(); } catch(Exception &e) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index e11c702b99..e8204dac3c 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -2050,8 +2050,11 @@ void MainWindow::toggleCompactView(void) if(action_compact_view->isChecked()) model_wgt->setAllCollapseMode(CollapseMode::ExtAttribsCollapsed); + else + model_wgt->setAllCollapseMode(CollapseMode::NotCollapsed); - model_wgt->getDatabaseModel()->setObjectsModified({ ObjectType::Table, ObjectType::View, ObjectType::Relationship, ObjectType::BaseRelationship, ObjectType::Schema}); + model_wgt->getDatabaseModel()->setObjectsModified({ ObjectType::Table, ObjectType::View, ObjectType::Relationship, + ObjectType::BaseRelationship, ObjectType::Schema}); } if(current_model) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index f582f861fc..633c426226 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2964,6 +2964,9 @@ void ModelWidget::removeObjects(bool cascade) if(aux_table) db_model->validateRelationships(tab_obj, aux_table); + + if(obj_type == ObjectType::Column) + db_model->updateViewsReferTable(aux_table); } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 783ff0fc8e..d1a2137042 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -906,6 +906,7 @@ void TableWidget::applyConfiguration(void) model->validateRelationships(); model->updateTableFKRelationships(table); + model->updateViewsReferTable(table); } catch(Exception &e) { From 2df2b8f053638bcc89c24f5975dd209ee5fdec2a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 15 Nov 2018 16:19:18 -0300 Subject: [PATCH 231/425] Fixed the rendering of view which contains only a single reference that is the whole object's defintion --- libobjrenderer/src/graphicalview.cpp | 29 ++---- libobjrenderer/src/tableobjectview.cpp | 21 +++-- libpgmodeler/src/view.cpp | 118 ++++++++++++++++--------- libpgmodeler/src/view.h | 10 +++ 4 files changed, 105 insertions(+), 73 deletions(-) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 9c04a42979..8829de06ba 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -32,8 +32,7 @@ GraphicalView::GraphicalView(View *view) : BaseTableView(view) void GraphicalView::configureObject(void) { View *view=dynamic_cast(this->getSourceObject()); - int i, count, count1=0; - Reference ref; + int i, count; QPen pen; TableObjectView *graph_ref=nullptr; QList subitems; @@ -47,8 +46,7 @@ void GraphicalView::configureObject(void) QList col_items; TableObject *tab_obj=nullptr; Tag *tag=view->getTag(); - QStringList col_names = view->getColumnNames(), - col_types = view->getColumnTypes(); + QStringList col_names, col_types; //Configures the view's title title->configureObject(view); @@ -58,12 +56,8 @@ void GraphicalView::configureObject(void) attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_view_objs.empty()); - //Gets the reference count on SELECT part of the SQL definition - //count=view->getReferenceCount(Reference::SqlReferSelect); - - //if(count==0) - // count=count1=view->getReferenceCount(Reference::SqlViewDefinition); - + col_names = (!compact_view ? view->getColumnNames() : view->getColumnAliases()); + col_types = view->getColumnTypes(); count = col_names.size(); //Moves the references group to the origin to be moved latter @@ -86,11 +80,6 @@ void GraphicalView::configureObject(void) subitems=columns->childItems(); for(i=0; i < count; i++) { - //if(count1==0) - // ref=view->getReference(i, Reference::SqlReferSelect); - //else - // ref=view->getReference(i, Reference::SqlViewDefinition); - //Reuses the subitem if it was allocated before if(!subitems.isEmpty() && i < subitems.size()) { @@ -103,10 +92,8 @@ void GraphicalView::configureObject(void) else graph_ref=new TableObjectView; - //columns->removeFromGroup(graph_ref); - graph_ref->configureObject(col_names[i], col_types[i], QString("----")); - graph_ref->moveBy(HorizSpacing, i * graph_ref->boundingRect().height()); - //columns->addToGroup(graph_ref); + graph_ref->configureObject(col_names[i], col_types[i], QString()); + graph_ref->moveBy(HorizSpacing, (i * graph_ref->boundingRect().height()) + VertSpacing); /* Calculates the width of the name + type of the object. This is used to align all the constraint labels on table */ @@ -141,7 +128,7 @@ void GraphicalView::configureObject(void) //Positioning the type label col_item->setChildObjectXPos(TableObjectView::TypeLabel, px); - //Positioning the constraints label + //Positioning the constraints label col_item->setChildObjectXPos(TableObjectView::ConstrAliasLabel, px + type_width); columns->addToGroup(col_item); } @@ -256,7 +243,7 @@ void GraphicalView::configureObject(void) bodies[idx]->setRect(QRectF(0,0, width, groups[idx]->boundingRect().height() + (2 * VertSpacing))); if(idx==0) - bodies[idx]->setPos(title->pos().x(), title->boundingRect().height()-1); + bodies[idx]->setPos(title->pos().x(), title->boundingRect().height() - 1); else bodies[idx]->setPos(title->pos().x(), title->boundingRect().height() + diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 5d2249262e..31517b5538 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -274,7 +274,7 @@ void TableObjectView::configureObject(void) fmt=font_config[Attributes::ObjectType]; if(compact_view) - lables[1]->setText(" "); + lables[1]->setText(QString()); else { if(column) @@ -291,7 +291,7 @@ void TableObjectView::configureObject(void) //Configuring the constraints label fmt=font_config[Attributes::Constraints]; if(compact_view) - lables[2]->setText(QString(" ")); + lables[2]->setText(QString()); else if(column) lables[2]->setText(!str_constr.isEmpty() ? str_constr : QString(" ")); else @@ -396,7 +396,7 @@ void TableObjectView::configureObject(void) str_constr + QString(" ") + ConstrDelimEnd); else - lables[2]->setText(QString(" ")); + lables[2]->setText(QString()); } if(!atribs_tip.isEmpty()) @@ -448,7 +448,7 @@ void TableObjectView::configureObject(Reference reference) fmt=font_config[Attributes::RefColumn]; if(compact_view && !reference.getReferenceAlias().isEmpty()) - lables[1]->setText(QString(" ")); + lables[1]->setText(QString()); else { if(reference.getColumn()) @@ -477,7 +477,7 @@ void TableObjectView::configureObject(Reference reference) lables[0]->setText(str_aux); lables[0]->setFont(fmt.font()); lables[0]->setBrush(fmt.foreground()); - lables[1]->setText(QString(" ")); + lables[1]->setText(QString()); lables[0]->setPos(px, 0); px+=lables[0]->boundingRect().width(); } @@ -500,10 +500,7 @@ void TableObjectView::configureObject(Reference reference) lables[2]->setPos(px, 0); } else - { - lables[2]->setPos(px, 0); - lables[2]->setText(QString(" ")); - } + lables[2]->setText(QString()); calculateBoundingRect(); } @@ -573,6 +570,9 @@ void TableObjectView::calculateBoundingRect(void) for(int i = 0; i < 3; i++) { + if(lables[i]->text().isEmpty()) + continue; + curr_w = lables[i]->pos().x() + lables[i]->boundingRect().width(); if(width < curr_w) @@ -660,6 +660,9 @@ void TableObjectView::paint(QPainter *painter, const QStyleOptionGraphicsItem *o for(int i = 0 ; i < 3; i++) { + if(lables[i]->text().isEmpty()) + continue; + painter->save(); painter->translate(lables[i]->pos()); lables[i]->paint(painter, option, widget); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index b221483d97..652c9276b0 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -191,60 +191,65 @@ void View::generateColumnNamesTypes(void) Table *tab = nullptr; Reference ref; Column *col = nullptr; - QStringList names; - QString fmt_name; + QString name; + col_aliases.clear(); col_names.clear(); col_types.clear(); - for(auto ref_id : exp_select) + if(hasDefinitionExpression()) { - ref = references[ref_id]; - - if(!ref.getExpression().isEmpty()) - { - if(!ref.getAlias().isEmpty()) - names.push_back(ref.getAlias()); - else - names.push_back(QString("_expr%1_").arg(expr_idx++)); - - col_types.push_back(Attributes::Expression); - } - else if(!ref.getColumn()) + col_names.push_back(QString("%1...").arg(references[0].getExpression().mid(0, 20)).remove(QChar::LineFeed)); + col_aliases.push_back(!references[0].getReferenceAlias().isEmpty() ? references[0].getReferenceAlias() : col_names.at(0)); + col_types.push_back(Attributes::Expression); + } + else + { + for(auto ref_id : exp_select) { - tab=ref.getTable(); - col_count=tab->getColumnCount(); + ref = references[ref_id]; - for(col_id=0; col_id < col_count; col_id++) + if(!ref.getExpression().isEmpty()) { - col = tab->getColumn(col_id); - names.push_back(col->getName()); - col_types.push_back(*col->getType()); + if(!ref.getAlias().isEmpty()) + name = ref.getAlias(); + else + name = QString("_expr%1_").arg(expr_idx++); + + addColumnName(name); + col_types.push_back(Attributes::Expression); + col_aliases.push_back(!ref.getReferenceAlias().isEmpty() ? ref.getReferenceAlias() : name); + } + else if(!ref.getColumn()) + { + tab=ref.getTable(); + col_count=tab->getColumnCount(); + + for(col_id=0; col_id < col_count; col_id++) + { + col = tab->getColumn(col_id); + addColumnName(col->getName()); + col_types.push_back(*col->getType()); + col_aliases.push_back(!col->getAlias().isEmpty() ? col->getAlias() : col->getName()); + } } - } - else - { - if(!ref.getColumnAlias().isEmpty()) - names.push_back(ref.getColumnAlias()); else - names.push_back(ref.getColumn()->getName()); + { + col = ref.getColumn(); - col_types.push_back(*ref.getColumn()->getType()); - } - } + if(!ref.getColumnAlias().isEmpty()) + addColumnName(ref.getColumnAlias()); + else + addColumnName(col->getName()); - for(auto &name : names) - { - col_id = 1; - fmt_name = name; + col_types.push_back(*col->getType()); - while(col_names.indexOf(BaseObject::formatName(fmt_name)) >= 0) - { - fmt_name = name + QString::number(col_id); - col_id++; + if(!ref.getReferenceAlias().isEmpty()) + col_aliases.push_back(ref.getReferenceAlias()); + else + col_aliases.push_back(!col->getAlias().isEmpty() ? col->getAlias() : col->getName()); + } } - - col_names.push_back(fmt_name); } } @@ -258,6 +263,11 @@ QStringList View::getColumnTypes(void) return(col_types); } +QStringList View::getColumnAliases(void) +{ + return(col_aliases); +} + void View::addReference(Reference &refer, unsigned sql_type, int expr_id) { int idx; @@ -632,8 +642,16 @@ QString View::getCodeDefinition(unsigned def_type) setSQLObjectAttribute(); - if(recursive) - attributes[Attributes::Columns]=col_names.join(','); + // We use column names only if the view has references that aren't its whole definition (Reference::SqlViewDefinition) + if(recursive && !hasDefinitionExpression()) + { + QStringList fmt_names; + + for(auto &name : col_names) + fmt_names.push_back(formatName(name)); + + attributes[Attributes::Columns]=fmt_names.join(','); + } if(tag && def_type==SchemaParser::XmlDefinition) attributes[Attributes::Tag]=tag->getCodeDefinition(def_type, true); @@ -654,7 +672,21 @@ QString View::getCodeDefinition(unsigned def_type) void View::setSQLObjectAttribute(void) { if(materialized) - attributes[Attributes::SqlObject]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::View); + attributes[Attributes::SqlObject]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::View); +} + +void View::addColumnName(const QString &name) +{ + unsigned col_id = 1; + QString fmt_name = name; + + while(col_names.indexOf(fmt_name) >= 0) + { + fmt_name = name + QString::number(col_id); + col_id++; + } + + col_names.push_back(fmt_name); } void View::setObjectListsCapacity(unsigned capacity) diff --git a/libpgmodeler/src/view.h b/libpgmodeler/src/view.h index d03089d647..aa4805e8d6 100644 --- a/libpgmodeler/src/view.h +++ b/libpgmodeler/src/view.h @@ -33,6 +33,9 @@ class View: public BaseTable { //! \brief Deduced column names QStringList col_names, + //! \brief Deduced columns aliases (used in compact view) + col_aliases, + //! \brief Deduces column types col_types; @@ -79,6 +82,10 @@ class View: public BaseTable { void setSQLObjectAttribute(void); + /*! \brief Adds the provided names as a view's column name. In case of duplicated name + * the most recent one will receive a numeric suffix */ + void addColumnName(const QString &name); + public: View(void); ~View(void); @@ -245,6 +252,9 @@ class View: public BaseTable { //! \brief Returns the deduced types of the view's columns QStringList getColumnTypes(void); + //! \brief Returns the deduced aliases of the view's columns (for using on the compact view as column names) + QStringList getColumnAliases(void); + /*! \brief Returns a list of deduced names for view's colums (useful for recursive views). * The names are retrieved, first, from columns aliases and lastly from table's columns * when TABLE.* syntax is used. For expressions, if aliases aren't defined, a column name in the From a08fad406b0b4e98aee6f8a3bc4c13cc359b2ea3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 15 Nov 2018 17:27:16 -0300 Subject: [PATCH 232/425] Added support to view column's pagination --- libobjrenderer/src/graphicalview.cpp | 113 ++++++++++++++++++++++++--- libobjrenderer/src/tableview.cpp | 5 ++ libpgmodeler/src/view.cpp | 2 +- libpgmodeler_ui/src/viewwidget.cpp | 2 +- 4 files changed, 107 insertions(+), 15 deletions(-) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 8829de06ba..617419e87d 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -36,7 +36,7 @@ void GraphicalView::configureObject(void) QPen pen; TableObjectView *graph_ref=nullptr; QList subitems; - vector tab_objs, ext_view_objs; + vector tab_objs, ext_tab_objs; QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; QString attribs[]={ Attributes::ViewBody, Attributes::ViewExtBody }, @@ -47,25 +47,93 @@ void GraphicalView::configureObject(void) TableObject *tab_obj=nullptr; Tag *tag=view->getTag(); QStringList col_names, col_types; + unsigned col_cnt = 0, ext_attr_cnt = 0, total_objs_cnt = 0, + start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; + CollapseMode collapse_mode = view->getCollapseMode(); //Configures the view's title title->configureObject(view); for(auto &obj : view->getObjects()) - ext_view_objs.push_back(dynamic_cast(obj)); + ext_tab_objs.push_back(dynamic_cast(obj)); - attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_view_objs.empty()); + attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_tab_objs.empty()); col_names = (!compact_view ? view->getColumnNames() : view->getColumnAliases()); col_types = view->getColumnTypes(); - count = col_names.size(); + + /* Calculating the amount of objects visible on the table. + * If the extended attributes are hidden somehow the amount of these objects is discarded and + * only columns will be visible on the pagination */ + if(collapse_mode != CollapseMode::AllAttribsCollapsed) + total_objs_cnt = col_names.size() + (collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0); + + attribs_toggler->setPaginationEnabled(view->isPaginationEnabled()); + + /* If the pagination is enabled for the table and the amount of objects is greater than the + * number of objects per page we configure the pagination parameter */ + if(view->isPaginationEnabled() && total_objs_cnt > attribs_per_page) + { + // Calculating the proportions of columns and extended attributes displayed per page + double col_factor = col_names.size() / static_cast(total_objs_cnt), + ext_factor = 1 - col_factor; + unsigned max_pages = 0, res = 0, curr_page = view->getCurrentPage(); + + /* Determining the amount of columns and extended attribs to be displayed based upon + * the proportions of columns/ext. attribs and the total of these objects */ + col_cnt = floor(col_factor * attribs_per_page); + ext_attr_cnt = hide_ext_attribs ? 0 : floor(ext_factor * attribs_per_page); + + /* If the extended attributes factor is too small so the counter related to it + * is zero we force it to have at least one visible extended attribute */ + if(ext_attr_cnt == 0 && !hide_ext_attribs && !ext_tab_objs.empty()) + ext_attr_cnt = 1; + + /* In certain situations the calculation aren't exact so we include to the column amount + * the remaining number of elements (generally this ins't greater than 1) */ + res = attribs_per_page - (col_cnt + ext_attr_cnt); + if(res > 0) col_cnt += res; + + // Determining the maximum amount of pages + max_pages = ceil(total_objs_cnt / static_cast(attribs_per_page)); + + // Validating the current page related to the maximum determined + if(curr_page >= max_pages) + curr_page = max_pages - 1; + + // Calculating the start and end columns/ext. attributes for the current page + start_col = curr_page * col_cnt; + end_col = start_col + col_cnt; + start_ext = curr_page * ext_attr_cnt; + end_ext = start_ext + ext_attr_cnt; + + if(start_col > static_cast(col_names.size())) + start_col = col_names.size(); + + if(start_ext > ext_tab_objs.size()) + start_ext = ext_tab_objs.size(); + + if(end_col > static_cast(col_names.size()) || curr_page == max_pages - 1) + end_col = col_names.size(); + + if(end_ext > ext_tab_objs.size() || curr_page == max_pages - 1) + end_ext = ext_tab_objs.size(); + + // Configure the attributes toggler item withe the calculated pagination parameters + attribs_toggler->setPaginationValues(curr_page, max_pages); + } + else + { + total_objs_cnt = 0; + col_cnt = col_names.size(); + ext_attr_cnt = ext_tab_objs.size(); + attribs_toggler->setPaginationValues(0, 0); + } //Moves the references group to the origin to be moved latter columns->moveBy(-columns->scenePos().x(), -columns->scenePos().y()); - columns->setVisible(view->getCollapseMode() != CollapseMode::AllAttribsCollapsed); - ext_attribs->setVisible(!ext_view_objs.empty() && view->getCollapseMode() == CollapseMode::NotCollapsed); + columns->setVisible(view->getCollapseMode() != CollapseMode::AllAttribsCollapsed && start_col < static_cast(col_names.size())); body->setVisible(columns->isVisible()); - ext_attribs_body->setVisible(ext_attribs->isVisible()); if(!columns->isVisible()) { @@ -77,6 +145,12 @@ void GraphicalView::configureObject(void) } else { + QStringList aux_col_names, aux_col_types; + + aux_col_names = col_names.mid(start_col, col_cnt); + aux_col_types = col_types.mid(start_col, col_cnt); + count = aux_col_names.size(); + subitems=columns->childItems(); for(i=0; i < count; i++) { @@ -92,7 +166,7 @@ void GraphicalView::configureObject(void) else graph_ref=new TableObjectView; - graph_ref->configureObject(col_names[i], col_types[i], QString()); + graph_ref->configureObject(aux_col_names[i], aux_col_types[i], QString()); graph_ref->moveBy(HorizSpacing, (i * graph_ref->boundingRect().height()) + VertSpacing); /* Calculates the width of the name + type of the object. This is used to align all @@ -135,7 +209,15 @@ void GraphicalView::configureObject(void) } if(!hide_ext_attribs && view->getCollapseMode() == CollapseMode::NotCollapsed) - tab_objs.assign(ext_view_objs.begin(), ext_view_objs.end()); + { + if(view->isPaginationEnabled() && total_objs_cnt != 0) + tab_objs.assign(ext_tab_objs.begin() + start_ext, ext_tab_objs.begin() + end_ext); + else + tab_objs.assign(ext_tab_objs.begin(), ext_tab_objs.end()); + } + + ext_attribs->setVisible(!tab_objs.empty() && view->getCollapseMode() == CollapseMode::NotCollapsed); + ext_attribs_body->setVisible(ext_attribs->isVisible()); if(tab_objs.empty()) { @@ -245,9 +327,15 @@ void GraphicalView::configureObject(void) if(idx==0) bodies[idx]->setPos(title->pos().x(), title->boundingRect().height() - 1); else - bodies[idx]->setPos(title->pos().x(), - title->boundingRect().height() + - bodies[0]->boundingRect().height() - 2); + { + if(bodies[0]->isVisible()) + bodies[idx]->setPos(title->pos().x(), + title->boundingRect().height() + + bodies[0]->boundingRect().height() - 2); + else + bodies[idx]->setPos(title->pos().x(), title->boundingRect().height()-1); + } + groups[idx]->setPos(bodies[idx]->pos()); subitems=groups[idx]->childItems(); @@ -264,7 +352,6 @@ void GraphicalView::configureObject(void) this->bounding_rect.setWidth(title->boundingRect().width()); BaseTableView::__configureObject(width); - attribs_toggler->setPaginationEnabled(false, true); if(!view->getAlias().isEmpty()) table_tooltip += QString("\nAlias: %1").arg(view->getAlias()); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 2de863087a..ccddde0fa4 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -83,6 +83,11 @@ void TableView::configureObject(void) col_cnt = floor(col_factor * attribs_per_page); ext_attr_cnt = hide_ext_attribs ? 0 : floor(ext_factor * attribs_per_page); + /* If the extended attributes factor is too small so the counter related to it + * is zero we force it to have at least one visible extended attribute */ + if(ext_attr_cnt == 0 && !hide_ext_attribs && !ext_tab_objs.empty()) + ext_attr_cnt = 1; + /* In certain situations the calculation aren't exact so we include to the column amount * the remaining number of elements (generally this ins't greater than 1) */ res = attribs_per_page - (col_cnt + ext_attr_cnt); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 652c9276b0..1005e7945f 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -199,7 +199,7 @@ void View::generateColumnNamesTypes(void) if(hasDefinitionExpression()) { - col_names.push_back(QString("%1...").arg(references[0].getExpression().mid(0, 20)).remove(QChar::LineFeed)); + col_names.push_back(QString("%1...").arg(references[0].getExpression().simplified().mid(0, 20))); col_aliases.push_back(!references[0].getReferenceAlias().isEmpty() ? references[0].getReferenceAlias() : col_names.at(0)); col_types.push_back(Attributes::Expression); } diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 69fa74668e..34f3150a41 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -512,7 +512,7 @@ void ViewWidget::showReferenceData(Reference refer, unsigned ref_flags, unsigned } else { - references_tab->setCellText(refer.getExpression(),row,0); + references_tab->setCellText(refer.getExpression().simplified(),row,0); references_tab->setCellText(refer.getAlias(),row,1); } From f44176a301f05bad41881cb00c153ef14203cd4f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 15 Nov 2018 22:46:42 -0300 Subject: [PATCH 233/425] Fixed a crash while renaming view's children objects --- libpgmodeler_ui/src/objectrenamewidget.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index c5d89bd142..edd3b96a27 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -107,7 +107,7 @@ void ObjectRenameWidget::applyRenaming(void) if(tab_obj) { parent_obj=tab_obj->getParentTable(); - aux_obj=dynamic_cast
(tab_obj->getParentTable())->getObject(fmt_name, obj_type); + aux_obj=dynamic_cast(tab_obj->getParentTable())->getObject(fmt_name, obj_type); } //For database child object, check if there is another object with the same new name else @@ -143,17 +143,23 @@ void ObjectRenameWidget::applyRenaming(void) } else if(tab_obj) { - Table *tab=dynamic_cast
(tab_obj->getParentTable()); + BaseTable *base_tab = tab_obj->getParentTable(); + Table *tab = dynamic_cast
(base_tab); Column *col=dynamic_cast(tab_obj); /* If the object is a column and some primary key on table is referencing it - the model relationship will be revalidated */ - if(col && tab->isConstraintRefColumn(col, ConstraintType::PrimaryKey)) - model->validateRelationships(); + * the model relationship will be revalidated */ + if(col && tab) + { + if(tab->isConstraintRefColumn(col, ConstraintType::PrimaryKey)) + model->validateRelationships(); + else + model->updateViewsReferTable(tab); + } - tab->setModified(true); - tab->setCodeInvalidated(true); - dynamic_cast(tab->getSchema())->setModified(true); + base_tab->setModified(true); + base_tab->setCodeInvalidated(true); + dynamic_cast(base_tab->getSchema())->setModified(true); } else if(object->getObjectType()==ObjectType::Schema) { From 8930cc84c2a60b99b19a1397db78300b5553ee08 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 15 Nov 2018 23:00:41 -0300 Subject: [PATCH 234/425] Starting to modify pagination. Now columns and extended attributes will be paginated independently --- libobjrenderer/src/basetableview.cpp | 50 ++++++++++++++- libobjrenderer/src/basetableview.h | 9 +++ libobjrenderer/src/graphicalview.cpp | 92 +++++----------------------- libobjrenderer/src/tableview.cpp | 78 +++-------------------- libpgmodeler/src/basetable.cpp | 26 +++++--- libpgmodeler/src/basetable.h | 11 ++-- libpgmodeler/src/databasemodel.cpp | 4 +- libpgmodeler/src/table.cpp | 2 +- libpgmodeler/src/view.cpp | 2 +- 9 files changed, 110 insertions(+), 164 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index bb7e97d62f..adc87f250a 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -424,7 +424,50 @@ void BaseTableView::finishGeometryUpdate(void) QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); //Updating the schema box that holds the object (if visible) - dynamic_cast(this->getSourceObject()->getSchema())->setModified(true); + dynamic_cast(this->getSourceObject()->getSchema())->setModified(true); +} + +bool BaseTableView::__configurePaginationParams(unsigned page_id, unsigned total_cols, unsigned &start_col, unsigned &end_col) +{ + BaseTable *table = dynamic_cast(getSourceObject()); + + start_col = end_col = 0; + attribs_toggler->setPaginationEnabled(table->isPaginationEnabled()); + + /* If the pagination is enabled for the table and the amount of objects is greater than the + * number of objects per page we configure the pagination parameter */ + if(table->isPaginationEnabled() && total_cols > attribs_per_page) + { + // Calculating the proportions of columns and extended attributes displayed per page + unsigned max_pages = 0, curr_page = table->getCurrentPage(page_id); + + // Determining the maximum amount of pages + max_pages = ceil(total_cols / static_cast(attribs_per_page)); + + // Validating the current page related to the maximum determined + if(curr_page >= max_pages) + curr_page = max_pages - 1; + + // Calculating the start and end columns/ext. attributes for the current page + start_col = curr_page * attribs_per_page; + end_col = start_col + attribs_per_page; + + // Validating the determined start/end indexes avoiding the extrapolation of limits + if(start_col > total_cols) + start_col = total_cols; + + if(end_col > total_cols /*|| curr_page == max_pages - 1*/) + end_col = total_cols; + + // Configure the attributes toggler item withe the calculated pagination parameters + attribs_toggler->setPaginationValues(curr_page, max_pages); + return(true); + } + else + { + attribs_toggler->setPaginationValues(0, 0); + return(false); + } } void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) @@ -441,7 +484,7 @@ void BaseTableView::togglePagination(bool enabled) startGeometryUpdate(); tab->setPaginationEnabled(enabled); - tab->setCurrentPage(0); + tab->resetCurrentPages(); finishGeometryUpdate(); emit s_paginationToggled(); } @@ -449,7 +492,8 @@ void BaseTableView::togglePagination(bool enabled) void BaseTableView::configureCurrentPage(unsigned page) { startGeometryUpdate(); - dynamic_cast(this->getSourceObject())->setCurrentPage(page); + dynamic_cast(this->getSourceObject())->setCurrentPage(BaseTable::AttribsPage, page); + //dynamic_cast(this->getSourceObject())->setCurrentPage(BaseTable::AttribsPage, page); finishGeometryUpdate(); emit s_currentPageChanged(); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index ddf2f122af..c6bd08186e 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -104,6 +104,15 @@ class BaseTableView: public BaseObjectView { * and in some cases the schema box which contains it */ void finishGeometryUpdate(void); + /*! \brief Determines the pagination paramenters for the table. The input parameters are the total amount of columns and + * the total amount of extended attributes. The other paramenters (start_col, end_col, start_ext, end_ext) are reference + * parameters that will hold the indexes of columns and extended paramenters to be displayed in the current page. + * See configureObject() on TableView and GraphicalView */ + //void configurePaginationParams(unsigned total_cols, unsigned total_ext_attr, unsigned &start_col, unsigned &end_col, + // unsigned &start_ext, unsigned &end_ext, unsigned &total_objs_cnt); + + bool __configurePaginationParams(unsigned page_id, unsigned total_cols, unsigned &start_col, unsigned &end_col); + public: static constexpr unsigned LeftConnPoint=0, RightConnPoint=1; diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 617419e87d..4ab9feab65 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -32,7 +32,8 @@ GraphicalView::GraphicalView(View *view) : BaseTableView(view) void GraphicalView::configureObject(void) { View *view=dynamic_cast(this->getSourceObject()); - int i, count; + int i = 0, count = 0; + unsigned start_col = 0, end_col = 0, start_ext = 0, end_ext = 0, total_objs_cnt = 0; QPen pen; TableObjectView *graph_ref=nullptr; QList subitems; @@ -47,9 +48,6 @@ void GraphicalView::configureObject(void) TableObject *tab_obj=nullptr; Tag *tag=view->getTag(); QStringList col_names, col_types; - unsigned col_cnt = 0, ext_attr_cnt = 0, total_objs_cnt = 0, - start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; - CollapseMode collapse_mode = view->getCollapseMode(); //Configures the view's title title->configureObject(view); @@ -61,74 +59,8 @@ void GraphicalView::configureObject(void) col_names = (!compact_view ? view->getColumnNames() : view->getColumnAliases()); col_types = view->getColumnTypes(); - - /* Calculating the amount of objects visible on the table. - * If the extended attributes are hidden somehow the amount of these objects is discarded and - * only columns will be visible on the pagination */ - if(collapse_mode != CollapseMode::AllAttribsCollapsed) - total_objs_cnt = col_names.size() + (collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0); - - attribs_toggler->setPaginationEnabled(view->isPaginationEnabled()); - - /* If the pagination is enabled for the table and the amount of objects is greater than the - * number of objects per page we configure the pagination parameter */ - if(view->isPaginationEnabled() && total_objs_cnt > attribs_per_page) - { - // Calculating the proportions of columns and extended attributes displayed per page - double col_factor = col_names.size() / static_cast(total_objs_cnt), - ext_factor = 1 - col_factor; - unsigned max_pages = 0, res = 0, curr_page = view->getCurrentPage(); - - /* Determining the amount of columns and extended attribs to be displayed based upon - * the proportions of columns/ext. attribs and the total of these objects */ - col_cnt = floor(col_factor * attribs_per_page); - ext_attr_cnt = hide_ext_attribs ? 0 : floor(ext_factor * attribs_per_page); - - /* If the extended attributes factor is too small so the counter related to it - * is zero we force it to have at least one visible extended attribute */ - if(ext_attr_cnt == 0 && !hide_ext_attribs && !ext_tab_objs.empty()) - ext_attr_cnt = 1; - - /* In certain situations the calculation aren't exact so we include to the column amount - * the remaining number of elements (generally this ins't greater than 1) */ - res = attribs_per_page - (col_cnt + ext_attr_cnt); - if(res > 0) col_cnt += res; - - // Determining the maximum amount of pages - max_pages = ceil(total_objs_cnt / static_cast(attribs_per_page)); - - // Validating the current page related to the maximum determined - if(curr_page >= max_pages) - curr_page = max_pages - 1; - - // Calculating the start and end columns/ext. attributes for the current page - start_col = curr_page * col_cnt; - end_col = start_col + col_cnt; - start_ext = curr_page * ext_attr_cnt; - end_ext = start_ext + ext_attr_cnt; - - if(start_col > static_cast(col_names.size())) - start_col = col_names.size(); - - if(start_ext > ext_tab_objs.size()) - start_ext = ext_tab_objs.size(); - - if(end_col > static_cast(col_names.size()) || curr_page == max_pages - 1) - end_col = col_names.size(); - - if(end_ext > ext_tab_objs.size() || curr_page == max_pages - 1) - end_ext = ext_tab_objs.size(); - - // Configure the attributes toggler item withe the calculated pagination parameters - attribs_toggler->setPaginationValues(curr_page, max_pages); - } - else - { - total_objs_cnt = 0; - col_cnt = col_names.size(); - ext_attr_cnt = ext_tab_objs.size(); - attribs_toggler->setPaginationValues(0, 0); - } +#warning "Disabled!" + //configurePaginationParams(col_names.size(), ext_tab_objs.size(), start_col, end_col, start_ext, end_ext, total_objs_cnt); //Moves the references group to the origin to be moved latter columns->moveBy(-columns->scenePos().x(), -columns->scenePos().y()); @@ -146,12 +78,22 @@ void GraphicalView::configureObject(void) else { QStringList aux_col_names, aux_col_types; + int col_cnt = end_col - start_col; - aux_col_names = col_names.mid(start_col, col_cnt); - aux_col_types = col_types.mid(start_col, col_cnt); - count = aux_col_names.size(); + if(total_objs_cnt == 0) + { + aux_col_names = col_names; + aux_col_types = col_types; + } + else + { + aux_col_names = col_names.mid(start_col, col_cnt); + aux_col_types = col_types.mid(start_col, col_cnt); + } + count = aux_col_names.size(); subitems=columns->childItems(); + for(i=0; i < count; i++) { //Reuses the subitem if it was allocated before diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index ccddde0fa4..e2438818cc 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -29,8 +29,7 @@ void TableView::configureObject(void) Table *table=dynamic_cast
(this->getSourceObject()); int i, count, obj_idx; double width=0, px=0, cy=0, old_width=0, old_height=0; - unsigned col_cnt = 0, ext_attr_cnt = 0, total_objs_cnt = 0, - start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; + unsigned total_objs_cnt = 0, start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; QPen pen; TableObjectView *col_item=nullptr; QList subitems; @@ -45,6 +44,7 @@ void TableView::configureObject(void) ObjectType ext_types[5] = { ObjectType::Constraint, ObjectType::Trigger, ObjectType::Index, ObjectType::Rule, ObjectType::Policy }; + bool has_col_pag = false, has_ext_pag = false; //Configures the table title title->configureObject(table); @@ -61,73 +61,9 @@ void TableView::configureObject(void) table->getObjectList(ext_types[idx])->end()); } - /* Calculating the amount of objects visible on the table. - * If the extended attributes are hidden somehow the amount of these objects is discarded and - * only columns will be visible on the pagination */ - if(collapse_mode != CollapseMode::AllAttribsCollapsed) - total_objs_cnt = columns.size() + (collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0); - - attribs_toggler->setPaginationEnabled(table->isPaginationEnabled()); - - /* If the pagination is enabled for the table and the amount of objects is greater than the - * number of objects per page we configure the pagination parameter */ - if(table->isPaginationEnabled() && total_objs_cnt > attribs_per_page) - { - // Calculating the proportions of columns and extended attributes displayed per page - double col_factor = columns.size() / static_cast(total_objs_cnt), - ext_factor = 1 - col_factor; - unsigned max_pages = 0, res = 0, curr_page = table->getCurrentPage(); - - /* Determining the amount of columns and extended attribs to be displayed based upon - * the proportions of columns/ext. attribs and the total of these objects */ - col_cnt = floor(col_factor * attribs_per_page); - ext_attr_cnt = hide_ext_attribs ? 0 : floor(ext_factor * attribs_per_page); - - /* If the extended attributes factor is too small so the counter related to it - * is zero we force it to have at least one visible extended attribute */ - if(ext_attr_cnt == 0 && !hide_ext_attribs && !ext_tab_objs.empty()) - ext_attr_cnt = 1; - - /* In certain situations the calculation aren't exact so we include to the column amount - * the remaining number of elements (generally this ins't greater than 1) */ - res = attribs_per_page - (col_cnt + ext_attr_cnt); - if(res > 0) col_cnt += res; - - // Determining the maximum amount of pages - max_pages = ceil(total_objs_cnt / static_cast(attribs_per_page)); - - // Validating the current page related to the maximum determined - if(curr_page >= max_pages) - curr_page = max_pages - 1; - - // Calculating the start and end columns/ext. attributes for the current page - start_col = curr_page * col_cnt; - end_col = start_col + col_cnt; - start_ext = curr_page * ext_attr_cnt; - end_ext = start_ext + ext_attr_cnt; - - if(start_col > columns.size()) - start_col = columns.size(); - - if(start_ext > ext_tab_objs.size()) - start_ext = ext_tab_objs.size(); - - if(end_col > columns.size() || curr_page == max_pages - 1) - end_col = columns.size(); - - if(end_ext > ext_tab_objs.size() || curr_page == max_pages - 1) - end_ext = ext_tab_objs.size(); - - // Configure the attributes toggler item withe the calculated pagination parameters - attribs_toggler->setPaginationValues(curr_page, max_pages); - } - else - { - total_objs_cnt = 0; - col_cnt = columns.size(); - ext_attr_cnt = ext_tab_objs.size(); - attribs_toggler->setPaginationValues(0, 0); - } +/* configurePaginationParams(columns.size(), ext_tab_objs.size(), + start_col, end_col, start_ext, end_ext, total_objs_cnt); */ + has_col_pag = __configurePaginationParams(BaseTable::AttribsPage, columns.size(), start_col, end_col); attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_tab_objs.empty()); @@ -143,7 +79,7 @@ void TableView::configureObject(void) { if(collapse_mode != CollapseMode::AllAttribsCollapsed) { - if(table->isPaginationEnabled() && total_objs_cnt != 0) + if(table->isPaginationEnabled() && has_col_pag) tab_objs.assign(columns.begin() + start_col, columns.begin() + end_col); else tab_objs.assign(columns.begin(), columns.end()); @@ -153,7 +89,7 @@ void TableView::configureObject(void) { if(!hide_ext_attribs && collapse_mode == CollapseMode::NotCollapsed) { - if(table->isPaginationEnabled() && total_objs_cnt != 0) + if(table->isPaginationEnabled() && has_ext_pag) tab_objs.assign(ext_tab_objs.begin() + start_ext, ext_tab_objs.begin() + end_ext); else tab_objs.assign(ext_tab_objs.begin(), ext_tab_objs.end()); diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index b2d36aef72..a62aa041c7 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -29,7 +29,13 @@ BaseTable::BaseTable(void) attributes[Attributes::CurrentPage]=QString(); pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; - curr_page = 0; + resetCurrentPages(); +} + +void BaseTable::resetCurrentPages(void) +{ + curr_page[AttribsPage] = 0; + curr_page[ExtAttribsPage] = 0; } void BaseTable::setTag(Tag *tag) @@ -72,7 +78,7 @@ void BaseTable::setPaginationEnabled(bool value) pagination_enabled = value; if(!pagination_enabled) - curr_page = 0; + resetCurrentPages(); } bool BaseTable::isPaginationEnabled(void) @@ -80,15 +86,21 @@ bool BaseTable::isPaginationEnabled(void) return(pagination_enabled); } -void BaseTable::setCurrentPage(unsigned page) +void BaseTable::setCurrentPage(unsigned page_id, unsigned value) { - setCodeInvalidated(curr_page != page); - curr_page = page; + if(page_id > ExtAttribsPage) + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + setCodeInvalidated(curr_page[page_id] != value); + curr_page[page_id] = value; } -unsigned BaseTable::getCurrentPage(void) +unsigned BaseTable::getCurrentPage(unsigned page_id) { - return(curr_page); + if(page_id > ExtAttribsPage) + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + return(curr_page[page_id]); } void BaseTable::setCollapseMode(CollapseMode coll_mode) diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index cc16afc666..f6abd67e5d 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -46,12 +46,15 @@ class BaseTable: public BaseGraphicObject { CollapseMode collapse_mode; //! \brief Stores the current page visible on the table - unsigned curr_page; + unsigned curr_page[2]; protected: Tag *tag; public: + static constexpr unsigned AttribsPage = 0, + ExtAttribsPage = 1; + BaseTable(void); virtual void setTag(Tag *tag); @@ -120,9 +123,9 @@ class BaseTable: public BaseGraphicObject { /*! \brief Defines the current page visible on the table. Calling this method direclty * will not update the geometry of the graphical representation of this object. For that, * the setModified(true) should be called */ - void setCurrentPage(unsigned page); - - unsigned getCurrentPage(void); + void setCurrentPage(unsigned page_id, unsigned value); + void resetCurrentPages(void); + unsigned getCurrentPage(unsigned page_id); friend class DatabaseModel; }; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index b8164d5883..7188ffaf41 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4682,7 +4682,7 @@ Table *DatabaseModel::createTable(void) table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); table->setCollapseMode(attribs[Attributes::CollapseMode].isEmpty() ? CollapseMode::NotCollapsed : static_cast(attribs[Attributes::CollapseMode].toUInt())); table->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); - table->setCurrentPage(attribs[Attributes::CurrentPage].toUInt()); + //table->setCurrentPage(attribs[Attributes::CurrentPage].toUInt()); table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5919,7 +5919,7 @@ View *DatabaseModel::createView(void) view->setWithNoData(attribs[Attributes::WithNoData]==Attributes::True); view->setCollapseMode(attribs[Attributes::CollapseMode].isEmpty() ? CollapseMode::NotCollapsed : static_cast(attribs[Attributes::CollapseMode].toUInt())); view->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); - view->setCurrentPage(attribs[Attributes::CurrentPage].toUInt()); + //view->setCurrentPage(attribs[Attributes::CurrentPage].toUInt()); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 2114774365..0004e508d7 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1606,7 +1606,7 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::PartitionBoundExpr]=part_bounding_expr; attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); - attributes[Attributes::CurrentPage]=(isPaginationEnabled() ? QString::number(getCurrentPage()) : QString()); + //attributes[Attributes::CurrentPage]=(isPaginationEnabled() ? QString::number(getCurrentPage()) : QString()); for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 1005e7945f..8d5b8f4487 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -638,7 +638,7 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::Tag]=QString(); attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); - attributes[Attributes::CurrentPage]=(isPaginationEnabled() ? QString::number(getCurrentPage()) : QString()); + //attributes[Attributes::CurrentPage]=(isPaginationEnabled() ? QString::number(getCurrentPage()) : QString()); setSQLObjectAttribute(); From 282720a195970bd8981423a07b375ed0b9873f9e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 15 Nov 2018 23:47:43 -0300 Subject: [PATCH 235/425] Added the buttons related to the pagination of extended attributes in AttributesTogglerItem --- libobjrenderer/src/attributestoggleritem.cpp | 98 +++++++++++++++----- libobjrenderer/src/attributestoggleritem.h | 20 ++-- libobjrenderer/src/basetableview.cpp | 15 ++- libobjrenderer/src/basetableview.h | 2 +- libobjrenderer/src/tableview.cpp | 8 +- libpgmodeler/src/basetable.cpp | 18 ++-- libpgmodeler/src/basetable.h | 8 +- 7 files changed, 114 insertions(+), 55 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index b9cf62b034..71aacee0b5 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -28,7 +28,7 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec sel_rect = new QGraphicsRectItem; - for(unsigned arr_id = 0; arr_id < 5; arr_id++) + for(unsigned arr_id = 0; arr_id < 7; arr_id++) { buttons[arr_id] = new QGraphicsPolygonItem; btns_selected[arr_id] = false; @@ -44,13 +44,16 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; btns_width = btns_height = 0; - current_page = max_pages = 0; + + for(unsigned idx = 0; idx < 2; idx++) + current_page[idx] = max_pages[idx] = 0; + configureButtonsState(); } AttributesTogglerItem::~AttributesTogglerItem(void) { - for(unsigned arr_id = 0; arr_id < 5; arr_id++) + for(unsigned arr_id = 0; arr_id < 7; arr_id++) delete(buttons[arr_id]); delete(sel_rect); @@ -58,13 +61,13 @@ AttributesTogglerItem::~AttributesTogglerItem(void) void AttributesTogglerItem::setButtonsBrush(const QBrush &brush) { - for(unsigned arr_id = 0; arr_id < 5; arr_id++) + for(unsigned arr_id = 0; arr_id < 7; arr_id++) buttons[arr_id]->setBrush(brush); } void AttributesTogglerItem::setButtonsPen(const QPen &pen) { - for(unsigned arr_id = 0; arr_id < 5; arr_id++) + for(unsigned arr_id = 0; arr_id < 7; arr_id++) buttons[arr_id]->setPen(pen); } @@ -88,12 +91,12 @@ void AttributesTogglerItem::setButtonSelected(const QPointF &pnt, bool clicked) { QRectF rect; double h_spacing = 4 * BaseObjectView::HorizSpacing; - unsigned coll_mode = static_cast(collapse_mode); + unsigned coll_mode = static_cast(collapse_mode), section_id = 0; this->setToolTip(QString()); clearButtonsSelection(); - for(unsigned arr_id = 0; arr_id < 5; arr_id++) + for(unsigned arr_id = 0; arr_id < 7; arr_id++) { rect.setSize(QSizeF(buttons[arr_id]->boundingRect().width() + h_spacing, this->boundingRect().height())); rect.moveTo(buttons[arr_id]->pos().x() - (h_spacing/2), 0); @@ -124,15 +127,23 @@ void AttributesTogglerItem::setButtonSelected(const QPointF &pnt, bool clicked) { pagination_enabled = !pagination_enabled; } - else if(max_pages != 0) + else { - if(arr_id == PrevAttribsPageBtn) - current_page--; - else if(arr_id == NextAttribsPageBtn) - current_page++; - - if(current_page >= max_pages) - current_page = (arr_id == PrevAttribsPageBtn ? 0 : max_pages - 1); + if(arr_id == PrevAttribsPageBtn || arr_id == NextAttribsPageBtn) + section_id = BaseTable::AttribsSection; + else + section_id = BaseTable::ExtAttribsSection; + + if(max_pages[section_id] != 0) + { + if(arr_id == PrevAttribsPageBtn || arr_id == PrevExtAttribsPageBtn) + current_page[section_id]--; + else + current_page[section_id]++; + + if(current_page[section_id] >= max_pages[section_id]) + current_page[section_id] = (arr_id == PrevAttribsPageBtn || arr_id == PrevExtAttribsPageBtn ? 0 : max_pages[section_id] - 1); + } } configureButtons(this->rect()); @@ -144,7 +155,7 @@ void AttributesTogglerItem::setButtonSelected(const QPointF &pnt, bool clicked) else if(arr_id == AttribsExpandBtn || arr_id == AttribsCollapseBtn) emit s_collapseModeChanged(collapse_mode); else - emit s_currentPageChanged(current_page); + emit s_currentPageChanged(section_id, current_page[section_id]); } else { @@ -177,11 +188,18 @@ void AttributesTogglerItem::configureButtonsState(void) buttons[AttribsCollapseBtn]->setOpacity(collapse_mode == CollapseMode::ExtAttribsCollapsed || collapse_mode == CollapseMode::NotCollapsed ? 1 : ButtonMinOpacity); - buttons[PrevAttribsPageBtn]->setOpacity(max_pages != 0 && current_page > 0 ? 1 : ButtonMinOpacity); - buttons[NextAttribsPageBtn]->setOpacity(max_pages != 0 && current_page < max_pages - 1 ? 1 : ButtonMinOpacity); + buttons[PrevAttribsPageBtn]->setOpacity(max_pages[BaseTable::AttribsSection] != 0 && current_page[BaseTable::AttribsSection] > 0 ? 1 : ButtonMinOpacity); + buttons[NextAttribsPageBtn]->setOpacity(max_pages[BaseTable::AttribsSection] != 0 && + current_page[BaseTable::AttribsSection] < max_pages[BaseTable::AttribsSection] - 1 ? 1 : ButtonMinOpacity); + + buttons[PrevExtAttribsPageBtn]->setOpacity(max_pages[BaseTable::ExtAttribsSection] != 0 && current_page[BaseTable::ExtAttribsSection] > 0 ? 1 : ButtonMinOpacity); + buttons[NextExtAttribsPageBtn]->setOpacity(max_pages[BaseTable::ExtAttribsSection] != 0 && + current_page[BaseTable::ExtAttribsSection] < max_pages[BaseTable::ExtAttribsSection] - 1 ? 1 : ButtonMinOpacity); buttons[PrevAttribsPageBtn]->setVisible(pagination_enabled); buttons[NextAttribsPageBtn]->setVisible(pagination_enabled); + buttons[PrevExtAttribsPageBtn]->setVisible(pagination_enabled); + buttons[NextExtAttribsPageBtn]->setVisible(pagination_enabled); } void AttributesTogglerItem::setHasExtAttributes(bool value) @@ -198,23 +216,23 @@ void AttributesTogglerItem::setPaginationEnabled(bool value, bool hide_pag_toggl configureButtonsState(); } -void AttributesTogglerItem::setPaginationValues(unsigned curr_page, unsigned max_page) +void AttributesTogglerItem::setPaginationValues(unsigned section_id, unsigned curr_page, unsigned max_page) { - if(!pagination_enabled) + if(!pagination_enabled || section_id > BaseTable::ExtAttribsSection) return; if(curr_page > max_page) - current_page = max_pages = max_page; + current_page[section_id] = max_pages[section_id] = max_page; else { - current_page = curr_page; - max_pages = max_page; + current_page[section_id] = curr_page; + max_pages[section_id] = max_page; } } void AttributesTogglerItem::clearButtonsSelection(void) { - for(unsigned arr_id = 0; arr_id < 5; arr_id++) + for(unsigned arr_id = 0; arr_id < 7; arr_id++) btns_selected[arr_id] = false; this->update(); @@ -259,6 +277,30 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) pol.append(QPointF(8 * factor, 5 * factor)); buttons[NextAttribsPageBtn]->setPolygon(pol); arr_width += pol.boundingRect().width() + h_spacing; + + pol.clear(); + pol.append(QPointF(0, 5 * factor)); + pol.append(QPointF(5 * factor, 0)); pol.append(QPointF(8 * factor, 0)); + pol.append(QPointF(8 * factor, 3 * factor)); pol.append(QPointF(6 * factor, 3 * factor)); + pol.append(QPointF(4 * factor, 5 * factor)); + pol.append(QPointF(6 * factor, 7 * factor)); pol.append(QPointF(8 * factor, 7 * factor)); + pol.append(QPointF(8 * factor, 10 * factor)); pol.append(QPointF(5 * factor, 10 * factor)); + buttons[PrevExtAttribsPageBtn]->setPolygon(pol); + arr_width += pol.boundingRect().width() + h_spacing; + + pol.clear(); + pol.append(QPointF(0, 0)); + pol.append(QPointF(3 * factor, 0)); + pol.append(QPointF(8 * factor, 5 * factor)); + pol.append(QPointF(3 * factor, 10 * factor)); + pol.append(QPointF(0, 10 * factor)); + pol.append(QPointF(0, 7 * factor)); + pol.append(QPointF(2 * factor, 7 * factor)); + pol.append(QPointF(4 * factor, 5 * factor)); + pol.append(QPointF(2 * factor, 3 * factor)); + pol.append(QPointF(0, 3 * factor)); + buttons[NextExtAttribsPageBtn]->setPolygon(pol); + arr_width += pol.boundingRect().width() + h_spacing; } // Defining the collapse button (^) @@ -307,6 +349,12 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) buttons[NextAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[NextAttribsPageBtn]->boundingRect().height())/2); px += buttons[NextAttribsPageBtn]->boundingRect().width() + h_spacing; + + buttons[PrevExtAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[PrevExtAttribsPageBtn]->boundingRect().height())/2); + px += buttons[PrevExtAttribsPageBtn]->boundingRect().width() + h_spacing; + + buttons[NextExtAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[NextExtAttribsPageBtn]->boundingRect().height())/2); + px += buttons[NextExtAttribsPageBtn]->boundingRect().width() + h_spacing; } } @@ -320,7 +368,7 @@ void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsI { RoundedRectItem::paint(painter, option, widget); - for(unsigned arr_id = 0; arr_id < 5; arr_id++) + for(unsigned arr_id = 0; arr_id < 7; arr_id++) { if(!buttons[arr_id]->isVisible()) continue; diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index 05ccba02de..1e3095b56c 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -41,10 +41,10 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { CollapseMode collapse_mode; //! \brief Stores the polygonal items denoting the control buttons of the toggler - QGraphicsPolygonItem *buttons[5]; + QGraphicsPolygonItem *buttons[7]; //! \brief Stores the selected status of the buttons - bool btns_selected[5], + bool btns_selected[7], /*! \brief Indicates if the table associated to this toggler has extended attributes * This attribute changes the way some buttons are rendered */ @@ -60,10 +60,10 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { btns_height; //! \brief Store the current page visible on the table associated to this toggler - unsigned current_page, + unsigned current_page[2], //! \brief Store the maximum pages allowed for the table associated to this toggler - max_pages; + max_pages[2]; //! \brief The minimum opacity factor used to fade buttons static constexpr double ButtonMinOpacity = 0.40; @@ -80,8 +80,14 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { //! \brief Constant used to reference the previous page button PrevAttribsPageBtn=3, + //! \brief Constant used to reference the next page button + NextExtAttribsPageBtn=4, + + //! \brief Constant used to reference the previous page button + PrevExtAttribsPageBtn=5, + //! \brief Constant used to reference the pagination toggler button - PaginationTogglerBtn=4; + PaginationTogglerBtn=6; /*! \brief Configures the postion and dimensions of the buttons based on the provided bounding rect * If the provided rect is smaller than the total width/height of the buttons it will be assumed @@ -122,7 +128,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { /*! \brief Defines the current values of the pagination (current page and maximum allowed pages) * Thes values are used to control the buttons fading when the page navigation reaches one of the limits (min/max) */ - void setPaginationValues(unsigned curr_page, unsigned max_page); + void setPaginationValues(unsigned page_id, unsigned curr_page, unsigned max_page); //! \brief Clears the selection status of the buttons void clearButtonsSelection(void); @@ -141,7 +147,7 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { void s_collapseModeChanged(CollapseMode); //! \brief Signal emitted when the current page changes (the user clicks the page navigation buttons) - void s_currentPageChanged(unsigned); + void s_currentPageChanged(unsigned, unsigned); //! \brief Signal emitted when the user clicks the pagination toggler buttons void s_paginationToggled(bool); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index adc87f250a..51ae6bcf9a 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -73,7 +73,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) connect(attribs_toggler, SIGNAL(s_collapseModeChanged(CollapseMode)), this, SLOT(configureCollapsedSections(CollapseMode))); connect(attribs_toggler, SIGNAL(s_paginationToggled(bool)), this, SLOT(togglePagination(bool))); - connect(attribs_toggler, SIGNAL(s_currentPageChanged(unsigned)), this, SLOT(configureCurrentPage(uint))); + connect(attribs_toggler, SIGNAL(s_currentPageChanged(unsigned,unsigned)), this, SLOT(configureCurrentPage(unsigned,unsigned))); } BaseTableView::~BaseTableView(void) @@ -427,7 +427,7 @@ void BaseTableView::finishGeometryUpdate(void) dynamic_cast(this->getSourceObject()->getSchema())->setModified(true); } -bool BaseTableView::__configurePaginationParams(unsigned page_id, unsigned total_cols, unsigned &start_col, unsigned &end_col) +bool BaseTableView::__configurePaginationParams(unsigned section_id, unsigned total_cols, unsigned &start_col, unsigned &end_col) { BaseTable *table = dynamic_cast(getSourceObject()); @@ -439,7 +439,7 @@ bool BaseTableView::__configurePaginationParams(unsigned page_id, unsigned total if(table->isPaginationEnabled() && total_cols > attribs_per_page) { // Calculating the proportions of columns and extended attributes displayed per page - unsigned max_pages = 0, curr_page = table->getCurrentPage(page_id); + unsigned max_pages = 0, curr_page = table->getCurrentPage(section_id); // Determining the maximum amount of pages max_pages = ceil(total_cols / static_cast(attribs_per_page)); @@ -460,12 +460,12 @@ bool BaseTableView::__configurePaginationParams(unsigned page_id, unsigned total end_col = total_cols; // Configure the attributes toggler item withe the calculated pagination parameters - attribs_toggler->setPaginationValues(curr_page, max_pages); + attribs_toggler->setPaginationValues(section_id, curr_page, max_pages); return(true); } else { - attribs_toggler->setPaginationValues(0, 0); + attribs_toggler->setPaginationValues(section_id, 0, 0); return(false); } } @@ -489,11 +489,10 @@ void BaseTableView::togglePagination(bool enabled) emit s_paginationToggled(); } -void BaseTableView::configureCurrentPage(unsigned page) +void BaseTableView::configureCurrentPage(unsigned section_id, unsigned page) { startGeometryUpdate(); - dynamic_cast(this->getSourceObject())->setCurrentPage(BaseTable::AttribsPage, page); - //dynamic_cast(this->getSourceObject())->setCurrentPage(BaseTable::AttribsPage, page); + dynamic_cast(this->getSourceObject())->setCurrentPage(section_id, page); finishGeometryUpdate(); emit s_currentPageChanged(); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index c6bd08186e..b1bd20e11d 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -166,7 +166,7 @@ class BaseTableView: public BaseObjectView { /*! \brief This slot reconfigures the table when the attributes toggler emits the signal s_currentPageChanged * causing the the attributes of the current page to be displayed */ - void configureCurrentPage(unsigned page); + void configureCurrentPage(unsigned section_id, unsigned page); signals: //! \brief Signal emitted when a table is moved over the scene diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index e2438818cc..df0f2878e7 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -63,7 +63,13 @@ void TableView::configureObject(void) /* configurePaginationParams(columns.size(), ext_tab_objs.size(), start_col, end_col, start_ext, end_ext, total_objs_cnt); */ - has_col_pag = __configurePaginationParams(BaseTable::AttribsPage, columns.size(), start_col, end_col); + + + has_col_pag = __configurePaginationParams(BaseTable::AttribsSection, columns.size(), start_col, end_col); + + has_ext_pag = __configurePaginationParams(BaseTable::ExtAttribsSection, + collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0, + start_ext, end_ext); attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_tab_objs.empty()); diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index a62aa041c7..31698c0cde 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -34,8 +34,8 @@ BaseTable::BaseTable(void) void BaseTable::resetCurrentPages(void) { - curr_page[AttribsPage] = 0; - curr_page[ExtAttribsPage] = 0; + curr_page[AttribsSection] = 0; + curr_page[ExtAttribsSection] = 0; } void BaseTable::setTag(Tag *tag) @@ -86,21 +86,21 @@ bool BaseTable::isPaginationEnabled(void) return(pagination_enabled); } -void BaseTable::setCurrentPage(unsigned page_id, unsigned value) +void BaseTable::setCurrentPage(unsigned section_id, unsigned value) { - if(page_id > ExtAttribsPage) + if(section_id > ExtAttribsSection) throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); - setCodeInvalidated(curr_page[page_id] != value); - curr_page[page_id] = value; + setCodeInvalidated(curr_page[section_id] != value); + curr_page[section_id] = value; } -unsigned BaseTable::getCurrentPage(unsigned page_id) +unsigned BaseTable::getCurrentPage(unsigned section_id) { - if(page_id > ExtAttribsPage) + if(section_id > ExtAttribsSection) throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); - return(curr_page[page_id]); + return(curr_page[section_id]); } void BaseTable::setCollapseMode(CollapseMode coll_mode) diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index f6abd67e5d..d356d950d4 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -52,8 +52,8 @@ class BaseTable: public BaseGraphicObject { Tag *tag; public: - static constexpr unsigned AttribsPage = 0, - ExtAttribsPage = 1; + static constexpr unsigned AttribsSection = 0, + ExtAttribsSection = 1; BaseTable(void); @@ -123,9 +123,9 @@ class BaseTable: public BaseGraphicObject { /*! \brief Defines the current page visible on the table. Calling this method direclty * will not update the geometry of the graphical representation of this object. For that, * the setModified(true) should be called */ - void setCurrentPage(unsigned page_id, unsigned value); + void setCurrentPage(unsigned section_id, unsigned value); void resetCurrentPages(void); - unsigned getCurrentPage(unsigned page_id); + unsigned getCurrentPage(unsigned section_id); friend class DatabaseModel; }; From 982c57fd2f91aa2fd51c6e8fa0341c9ae9766514 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 16 Nov 2018 00:57:47 -0300 Subject: [PATCH 236/425] Improved the saving and restore pagination info from database model files --- libobjrenderer/src/attributestoggleritem.cpp | 154 ++++++++++--------- libobjrenderer/src/attributestoggleritem.h | 4 + libobjrenderer/src/basetableview.cpp | 20 +-- libobjrenderer/src/basetableview.h | 13 +- libobjrenderer/src/graphicalview.cpp | 24 +-- libobjrenderer/src/tableview.cpp | 10 +- libparsers/src/attributes.cpp | 3 +- libparsers/src/attributes.h | 3 +- libpgmodeler/src/basetable.cpp | 3 +- libpgmodeler/src/databasemodel.cpp | 6 +- libpgmodeler/src/table.cpp | 3 +- libpgmodeler/src/view.cpp | 3 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 2 +- schemas/xml/dtd/table.dtd | 3 +- schemas/xml/dtd/view.dtd | 3 +- schemas/xml/table.sch | 3 +- schemas/xml/view.sch | 3 +- 17 files changed, 139 insertions(+), 121 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index 71aacee0b5..5dd49074fa 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -22,15 +22,18 @@ #include #include "baseobjectview.h" +QPolygonF AttributesTogglerItem::btn_polygons[7]; + AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRectItem(parent) { + createButtonPolygons(); this->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); - sel_rect = new QGraphicsRectItem; for(unsigned arr_id = 0; arr_id < 7; arr_id++) { buttons[arr_id] = new QGraphicsPolygonItem; + buttons[arr_id]->setPolygon(btn_polygons[arr_id]); btns_selected[arr_id] = false; } @@ -38,6 +41,8 @@ AttributesTogglerItem::AttributesTogglerItem(QGraphicsItem *parent) : RoundedRec buttons[AttribsCollapseBtn]->setToolTip(trUtf8("Collapses the currently expanded section of the object")); buttons[NextAttribsPageBtn]->setToolTip(trUtf8("Displays the next attributes page")); buttons[PrevAttribsPageBtn]->setToolTip(trUtf8("Displays the previous attributes page")); + buttons[NextExtAttribsPageBtn]->setToolTip(trUtf8("Displays the next extended attributes page")); + buttons[PrevExtAttribsPageBtn]->setToolTip(trUtf8("Displays the previous extended attributes page")); buttons[PaginationTogglerBtn]->setToolTip(trUtf8("Toggles the attributes pagination on the object")); has_ext_attribs = false; @@ -192,8 +197,8 @@ void AttributesTogglerItem::configureButtonsState(void) buttons[NextAttribsPageBtn]->setOpacity(max_pages[BaseTable::AttribsSection] != 0 && current_page[BaseTable::AttribsSection] < max_pages[BaseTable::AttribsSection] - 1 ? 1 : ButtonMinOpacity); - buttons[PrevExtAttribsPageBtn]->setOpacity(max_pages[BaseTable::ExtAttribsSection] != 0 && current_page[BaseTable::ExtAttribsSection] > 0 ? 1 : ButtonMinOpacity); - buttons[NextExtAttribsPageBtn]->setOpacity(max_pages[BaseTable::ExtAttribsSection] != 0 && + buttons[PrevExtAttribsPageBtn]->setOpacity(has_ext_attribs && max_pages[BaseTable::ExtAttribsSection] != 0 && current_page[BaseTable::ExtAttribsSection] > 0 ? 1 : ButtonMinOpacity); + buttons[NextExtAttribsPageBtn]->setOpacity(has_ext_attribs && max_pages[BaseTable::ExtAttribsSection] != 0 && current_page[BaseTable::ExtAttribsSection] < max_pages[BaseTable::ExtAttribsSection] - 1 ? 1 : ButtonMinOpacity); buttons[PrevAttribsPageBtn]->setVisible(pagination_enabled); @@ -250,86 +255,28 @@ double AttributesTogglerItem::getButtonsHeight(void) void AttributesTogglerItem::configureButtons(const QRectF &rect) { - double fnt_factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, - pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(), - factor = fnt_factor * pixel_ratio, - arr_width = 0, px = 0, + double arr_width = 0, px = 0, h_spacing = 6 * BaseObjectView::HorizSpacing, height = 4 * BaseObjectView::VertSpacing; - QPolygonF pol; QRectF new_rect = rect; - // Defining the previous page button (<) - pol.append(QPointF(0, 5 * factor)); - pol.append(QPointF(8 * factor, 0)); - pol.append(QPointF(8 * factor, 10 * factor)); - btns_height = pol.boundingRect().height(); + btns_height = btn_polygons[PrevAttribsPageBtn].boundingRect().height(); height += btns_height; if(pagination_enabled) { - buttons[PrevAttribsPageBtn]->setPolygon(pol); - arr_width = pol.boundingRect().width() + h_spacing; - - // Defining the next page button (>) - pol.remove(0); - pol.translate(-8 * factor, 0); - pol.append(QPointF(8 * factor, 5 * factor)); - buttons[NextAttribsPageBtn]->setPolygon(pol); - arr_width += pol.boundingRect().width() + h_spacing; - - pol.clear(); - pol.append(QPointF(0, 5 * factor)); - pol.append(QPointF(5 * factor, 0)); pol.append(QPointF(8 * factor, 0)); - pol.append(QPointF(8 * factor, 3 * factor)); pol.append(QPointF(6 * factor, 3 * factor)); - pol.append(QPointF(4 * factor, 5 * factor)); - pol.append(QPointF(6 * factor, 7 * factor)); pol.append(QPointF(8 * factor, 7 * factor)); - pol.append(QPointF(8 * factor, 10 * factor)); pol.append(QPointF(5 * factor, 10 * factor)); - buttons[PrevExtAttribsPageBtn]->setPolygon(pol); - arr_width += pol.boundingRect().width() + h_spacing; - - pol.clear(); - pol.append(QPointF(0, 0)); - pol.append(QPointF(3 * factor, 0)); - pol.append(QPointF(8 * factor, 5 * factor)); - pol.append(QPointF(3 * factor, 10 * factor)); - pol.append(QPointF(0, 10 * factor)); - pol.append(QPointF(0, 7 * factor)); - pol.append(QPointF(2 * factor, 7 * factor)); - pol.append(QPointF(4 * factor, 5 * factor)); - pol.append(QPointF(2 * factor, 3 * factor)); - pol.append(QPointF(0, 3 * factor)); - buttons[NextExtAttribsPageBtn]->setPolygon(pol); - arr_width += pol.boundingRect().width() + h_spacing; + arr_width = btn_polygons[PrevAttribsPageBtn].boundingRect().width() + + btn_polygons[NextAttribsPageBtn].boundingRect().width() + + btn_polygons[PrevExtAttribsPageBtn].boundingRect().width() + + btn_polygons[NextExtAttribsPageBtn].boundingRect().width() + + (4 * h_spacing); } - // Defining the collapse button (^) - pol.clear(); - pol.append(QPointF(5 * factor, 0)); - pol.append(QPointF(0, 8 * factor)); - pol.append(QPointF(10 * factor, 8 * factor)); - buttons[AttribsCollapseBtn]->setPolygon(pol); - arr_width += pol.boundingRect().width() + h_spacing; - - // Defining the expand button - pol.clear(); - pol.append(QPointF(0, 0)); - pol.append(QPointF(10 * factor, 0)); - pol.append(QPointF(5 * factor, 8 * factor)); - buttons[AttribsExpandBtn]->setPolygon(pol); - arr_width += pol.boundingRect().width() + h_spacing; - - // Defining the pagination toggler button + arr_width += btn_polygons[AttribsCollapseBtn].boundingRect().width() + + btn_polygons[AttribsExpandBtn].boundingRect().width() + (2 * h_spacing); + if(buttons[PaginationTogglerBtn]->isVisible()) - { - pol.clear(); - pol.append(QPointF(4 * factor, 0)); - pol.append(QPointF(8 * factor, 4 * factor)); - pol.append(QPointF(4 * factor, 8 * factor)); - pol.append(QPointF(0, 4 * factor)); - buttons[PaginationTogglerBtn]->setPolygon(pol); - arr_width += pol.boundingRect().width() + h_spacing; - } + arr_width += btn_polygons[AttribsExpandBtn].boundingRect().width() + h_spacing; btns_width = arr_width; new_rect.setHeight(height); @@ -344,13 +291,13 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) if(pagination_enabled) { + buttons[PrevExtAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[PrevExtAttribsPageBtn]->boundingRect().height())/2); + px += buttons[PrevExtAttribsPageBtn]->boundingRect().width() + h_spacing; + buttons[PrevAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[PrevAttribsPageBtn]->boundingRect().height())/2); px += buttons[PrevAttribsPageBtn]->boundingRect().width() + h_spacing; buttons[NextAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[NextAttribsPageBtn]->boundingRect().height())/2); - px += buttons[NextAttribsPageBtn]->boundingRect().width() + h_spacing; - - buttons[PrevExtAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[PrevExtAttribsPageBtn]->boundingRect().height())/2); px += buttons[PrevExtAttribsPageBtn]->boundingRect().width() + h_spacing; buttons[NextExtAttribsPageBtn]->setPos(px, (new_rect.height() - buttons[NextExtAttribsPageBtn]->boundingRect().height())/2); @@ -389,3 +336,60 @@ void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsI } } } + +void AttributesTogglerItem::createButtonPolygons(void) +{ + if(!btn_polygons[0].isEmpty()) + return; + + QPolygonF *pol = nullptr; + double fnt_factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, + pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(), + factor = fnt_factor * pixel_ratio; + + pol = &btn_polygons[PrevAttribsPageBtn]; + pol->append(QPointF(0, 5 * factor)); + pol->append(QPointF(8 * factor, 0)); + pol->append(QPointF(8 * factor, 10 * factor)); + + pol = &btn_polygons[NextAttribsPageBtn]; + pol->append(QPointF(0, 0)); + pol->append(QPointF(8 * factor, 5 * factor)); + pol->append(QPointF(0, 10 * factor)); + + pol = &btn_polygons[PrevExtAttribsPageBtn]; + pol->append(QPointF(0, 0)); + pol->append(QPointF(2 * factor, 0)); + pol->append(QPointF(2 * factor, 4 * factor)); + pol->append(QPointF(8 * factor, 0)); + pol->append(QPointF(8 * factor, 10 * factor)); + pol->append(QPointF(2 * factor, 6 * factor)); + pol->append(QPointF(2 * factor, 10 * factor)); + pol->append(QPointF(0, 10 * factor)); + + pol = &btn_polygons[NextExtAttribsPageBtn]; + pol->append(QPointF(0, 0)); + pol->append(QPointF(6 * factor, 4 * factor)); + pol->append(QPointF(6 * factor, 0 * factor)); + pol->append(QPointF(8 * factor, 0)); + pol->append(QPointF(8 * factor, 10 * factor)); + pol->append(QPointF(6 * factor, 10 * factor)); + pol->append(QPointF(6 * factor, 6 * factor)); + pol->append(QPointF(0, 10 * factor)); + + pol = &btn_polygons[AttribsCollapseBtn]; + pol->append(QPointF(5 * factor, 0)); + pol->append(QPointF(0, 8 * factor)); + pol->append(QPointF(10 * factor, 8 * factor)); + + pol = &btn_polygons[AttribsExpandBtn]; + pol->append(QPointF(0, 0)); + pol->append(QPointF(10 * factor, 0)); + pol->append(QPointF(5 * factor, 8 * factor)); + + pol = &btn_polygons[PaginationTogglerBtn]; + pol->append(QPointF(4 * factor, 0)); + pol->append(QPointF(8 * factor, 4 * factor)); + pol->append(QPointF(4 * factor, 8 * factor)); + pol->append(QPointF(0, 4 * factor)); +} diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index 1e3095b56c..f60017502c 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -34,6 +34,8 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { private: Q_OBJECT + static QPolygonF btn_polygons[7]; + //! \brief Stores the selection rectangle of the item's internal elements QGraphicsRectItem *sel_rect; @@ -98,6 +100,8 @@ class AttributesTogglerItem: public QObject, public RoundedRectItem { * of pagination and collapse mode */ void configureButtonsState(void); + static void createButtonPolygons(void); + public: AttributesTogglerItem(QGraphicsItem *parent = nullptr); ~AttributesTogglerItem(void); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 51ae6bcf9a..5aa2aa8fee 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -427,37 +427,37 @@ void BaseTableView::finishGeometryUpdate(void) dynamic_cast(this->getSourceObject()->getSchema())->setModified(true); } -bool BaseTableView::__configurePaginationParams(unsigned section_id, unsigned total_cols, unsigned &start_col, unsigned &end_col) +bool BaseTableView::configurePaginationParams(unsigned section_id, unsigned total_attrs, unsigned &start_attr, unsigned &end_attr) { BaseTable *table = dynamic_cast(getSourceObject()); - start_col = end_col = 0; + start_attr = end_attr = 0; attribs_toggler->setPaginationEnabled(table->isPaginationEnabled()); /* If the pagination is enabled for the table and the amount of objects is greater than the * number of objects per page we configure the pagination parameter */ - if(table->isPaginationEnabled() && total_cols > attribs_per_page) + if(table->isPaginationEnabled() && total_attrs > attribs_per_page) { // Calculating the proportions of columns and extended attributes displayed per page unsigned max_pages = 0, curr_page = table->getCurrentPage(section_id); // Determining the maximum amount of pages - max_pages = ceil(total_cols / static_cast(attribs_per_page)); + max_pages = ceil(total_attrs / static_cast(attribs_per_page)); // Validating the current page related to the maximum determined if(curr_page >= max_pages) curr_page = max_pages - 1; // Calculating the start and end columns/ext. attributes for the current page - start_col = curr_page * attribs_per_page; - end_col = start_col + attribs_per_page; + start_attr = curr_page * attribs_per_page; + end_attr = start_attr + attribs_per_page; // Validating the determined start/end indexes avoiding the extrapolation of limits - if(start_col > total_cols) - start_col = total_cols; + if(start_attr > total_attrs) + start_attr = total_attrs; - if(end_col > total_cols /*|| curr_page == max_pages - 1*/) - end_col = total_cols; + if(end_attr > total_attrs) + end_attr = total_attrs; // Configure the attributes toggler item withe the calculated pagination parameters attribs_toggler->setPaginationValues(section_id, curr_page, max_pages); diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index b1bd20e11d..9cc629cedc 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -104,14 +104,11 @@ class BaseTableView: public BaseObjectView { * and in some cases the schema box which contains it */ void finishGeometryUpdate(void); - /*! \brief Determines the pagination paramenters for the table. The input parameters are the total amount of columns and - * the total amount of extended attributes. The other paramenters (start_col, end_col, start_ext, end_ext) are reference - * parameters that will hold the indexes of columns and extended paramenters to be displayed in the current page. - * See configureObject() on TableView and GraphicalView */ - //void configurePaginationParams(unsigned total_cols, unsigned total_ext_attr, unsigned &start_col, unsigned &end_col, - // unsigned &start_ext, unsigned &end_ext, unsigned &total_objs_cnt); - - bool __configurePaginationParams(unsigned page_id, unsigned total_cols, unsigned &start_col, unsigned &end_col); + /*! \brief Determines the pagination paramenters for a section of the table. The input parameters are + * the section (BaseTable::AttribsSection | ExtAttribsSection) and the total amount of attributes in the section. + * The other paramenters start_attr and end_attr are reference parameters that will hold the indexes of items + * to be displayed in the current page. See configureObject() on TableView and GraphicalView */ + bool configurePaginationParams(unsigned page_id, unsigned total_attrs, unsigned &start_attr, unsigned &end_attr); public: static constexpr unsigned LeftConnPoint=0, diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 4ab9feab65..ad4b962322 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -33,7 +33,7 @@ void GraphicalView::configureObject(void) { View *view=dynamic_cast(this->getSourceObject()); int i = 0, count = 0; - unsigned start_col = 0, end_col = 0, start_ext = 0, end_ext = 0, total_objs_cnt = 0; + unsigned start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; QPen pen; TableObjectView *graph_ref=nullptr; QList subitems; @@ -48,6 +48,8 @@ void GraphicalView::configureObject(void) TableObject *tab_obj=nullptr; Tag *tag=view->getTag(); QStringList col_names, col_types; + CollapseMode collapse_mode = view->getCollapseMode(); + bool has_col_pag = false, has_ext_pag = false; //Configures the view's title title->configureObject(view); @@ -59,8 +61,12 @@ void GraphicalView::configureObject(void) col_names = (!compact_view ? view->getColumnNames() : view->getColumnAliases()); col_types = view->getColumnTypes(); -#warning "Disabled!" - //configurePaginationParams(col_names.size(), ext_tab_objs.size(), start_col, end_col, start_ext, end_ext, total_objs_cnt); + + has_col_pag = configurePaginationParams(BaseTable::AttribsSection, col_names.size(), start_col, end_col); + + has_ext_pag = configurePaginationParams(BaseTable::ExtAttribsSection, + collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0, + start_ext, end_ext); //Moves the references group to the origin to be moved latter columns->moveBy(-columns->scenePos().x(), -columns->scenePos().y()); @@ -80,15 +86,15 @@ void GraphicalView::configureObject(void) QStringList aux_col_names, aux_col_types; int col_cnt = end_col - start_col; - if(total_objs_cnt == 0) + if(has_col_pag) { - aux_col_names = col_names; - aux_col_types = col_types; + aux_col_names = col_names.mid(start_col, col_cnt); + aux_col_types = col_types.mid(start_col, col_cnt); } else { - aux_col_names = col_names.mid(start_col, col_cnt); - aux_col_types = col_types.mid(start_col, col_cnt); + aux_col_names = col_names; + aux_col_types = col_types; } count = aux_col_names.size(); @@ -152,7 +158,7 @@ void GraphicalView::configureObject(void) if(!hide_ext_attribs && view->getCollapseMode() == CollapseMode::NotCollapsed) { - if(view->isPaginationEnabled() && total_objs_cnt != 0) + if(view->isPaginationEnabled() && has_ext_pag) tab_objs.assign(ext_tab_objs.begin() + start_ext, ext_tab_objs.begin() + end_ext); else tab_objs.assign(ext_tab_objs.begin(), ext_tab_objs.end()); diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index df0f2878e7..4769e0b1ef 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -29,7 +29,7 @@ void TableView::configureObject(void) Table *table=dynamic_cast
(this->getSourceObject()); int i, count, obj_idx; double width=0, px=0, cy=0, old_width=0, old_height=0; - unsigned total_objs_cnt = 0, start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; + unsigned start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; QPen pen; TableObjectView *col_item=nullptr; QList subitems; @@ -61,13 +61,9 @@ void TableView::configureObject(void) table->getObjectList(ext_types[idx])->end()); } -/* configurePaginationParams(columns.size(), ext_tab_objs.size(), - start_col, end_col, start_ext, end_ext, total_objs_cnt); */ + has_col_pag = configurePaginationParams(BaseTable::AttribsSection, columns.size(), start_col, end_col); - - has_col_pag = __configurePaginationParams(BaseTable::AttribsSection, columns.size(), start_col, end_col); - - has_ext_pag = __configurePaginationParams(BaseTable::ExtAttribsSection, + has_ext_pag = configurePaginationParams(BaseTable::ExtAttribsSection, collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0, start_ext, end_ext); diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index f53138510b..e605349980 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -47,6 +47,7 @@ namespace Attributes { AscOrder=QString("asc-order"), Assignment=QString("assignment"), Attribute=QString("attribute"), + AttribsPage=QString("attribs-page"), AttribsPerPage=QString("attribs-per-page"), AutoBrowseDb=QString("auto-browse-db"), AutoSaveInterval=QString("autosave-interval"), @@ -126,7 +127,6 @@ namespace Attributes { CreateRole=QString("createrole"), CrowsFoot=QString("crows-foot"), CteExpression=QString("cte-exp"), - CurrentPage=QString("current-page"), CurVersion=QString("cur-version"), CurIdentityType=QString("cur-identity-type"), CustomColor=QString("custom-color"), @@ -198,6 +198,7 @@ namespace Attributes { ExportToFile=QString("export-to-file"), Expression=QString("expression"), Expressions=QString("expressions"), + ExtAttribsPage=QString("ext-attribs-page"), ExtObjOids=QString("ext-obj-oids"), Factor=QString("factor"), FadeInObjects=QString("fadein-objects"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 2f3a7d05c6..ba6590dd30 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -62,6 +62,7 @@ namespace Attributes { AscOrder, Assignment, Attribute, + AttribsPage, AttribsPerPage, AutoBrowseDb, AutoSaveInterval, @@ -141,7 +142,6 @@ namespace Attributes { CreateRole, CrowsFoot, CteExpression, - CurrentPage, CurVersion, CurIdentityType, CustomColor, @@ -213,6 +213,7 @@ namespace Attributes { ExportToFile, Expression, Expressions, + ExtAttribsPage, ExtObjOids, Factor, FadeInObjects, diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 31698c0cde..105a223adf 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -26,7 +26,8 @@ BaseTable::BaseTable(void) attributes[Attributes::MaxObjCount]=QString(); attributes[Attributes::CollapseMode]=QString(); attributes[Attributes::Pagination]=QString(); - attributes[Attributes::CurrentPage]=QString(); + attributes[Attributes::AttribsPage]=QString(); + attributes[Attributes::ExtAttribsPage]=QString(); pagination_enabled = false; collapse_mode = CollapseMode::NotCollapsed; resetCurrentPages(); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 7188ffaf41..e4fd1ecb28 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -4682,7 +4682,8 @@ Table *DatabaseModel::createTable(void) table->setGenerateAlterCmds(attribs[Attributes::GenAlterCmds]==Attributes::True); table->setCollapseMode(attribs[Attributes::CollapseMode].isEmpty() ? CollapseMode::NotCollapsed : static_cast(attribs[Attributes::CollapseMode].toUInt())); table->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); - //table->setCurrentPage(attribs[Attributes::CurrentPage].toUInt()); + table->setCurrentPage(BaseTable::AttribsSection, attribs[Attributes::AttribsPage].toUInt()); + table->setCurrentPage(BaseTable::ExtAttribsSection, attribs[Attributes::ExtAttribsPage].toUInt()); table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5919,7 +5920,8 @@ View *DatabaseModel::createView(void) view->setWithNoData(attribs[Attributes::WithNoData]==Attributes::True); view->setCollapseMode(attribs[Attributes::CollapseMode].isEmpty() ? CollapseMode::NotCollapsed : static_cast(attribs[Attributes::CollapseMode].toUInt())); view->setPaginationEnabled(attribs[Attributes::Pagination]==Attributes::True); - //view->setCurrentPage(attribs[Attributes::CurrentPage].toUInt()); + view->setCurrentPage(BaseTable::AttribsSection, attribs[Attributes::AttribsPage].toUInt()); + view->setCurrentPage(BaseTable::ExtAttribsSection, attribs[Attributes::ExtAttribsPage].toUInt()); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); if(xmlparser.accessElement(XmlParser::ChildElement)) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 0004e508d7..eb373de2ac 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1606,7 +1606,8 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::PartitionBoundExpr]=part_bounding_expr; attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); - //attributes[Attributes::CurrentPage]=(isPaginationEnabled() ? QString::number(getCurrentPage()) : QString()); + attributes[Attributes::AttribsPage]=(isPaginationEnabled() ? QString::number(getCurrentPage(AttribsSection)) : QString()); + attributes[Attributes::ExtAttribsPage]=(isPaginationEnabled() ? QString::number(getCurrentPage(ExtAttribsSection)) : QString()); for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 8d5b8f4487..6c6636061c 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -638,7 +638,8 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::Tag]=QString(); attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); - //attributes[Attributes::CurrentPage]=(isPaginationEnabled() ? QString::number(getCurrentPage()) : QString()); + attributes[Attributes::AttribsPage]=(isPaginationEnabled() ? QString::number(getCurrentPage(AttribsSection)) : QString()); + attributes[Attributes::ExtAttribsPage]=(isPaginationEnabled() ? QString::number(getCurrentPage(ExtAttribsSection)) : QString()); setSQLObjectAttribute(); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index c35f23a103..eaabfa2323 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -326,7 +326,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) Attributes::FillColor, Attributes::FadedOut, Attributes::CollapseMode, - Attributes::CurrentPage, + Attributes::AttribsPage, Attributes::Pagination}, { Attributes::Role, Attributes::Tablespace, diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 0f69859e54..2306c7fa47 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -23,7 +23,8 @@ - + + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 693a02067f..fbe89c03da 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -13,7 +13,8 @@ - + + diff --git a/schemas/xml/table.sch b/schemas/xml/table.sch index 18c2d64394..ff2ba279a7 100644 --- a/schemas/xml/table.sch +++ b/schemas/xml/table.sch @@ -11,7 +11,8 @@ %if {sql-disabled} %then [ sql-disabled=] "true" %end %if {collapse-mode} %then [ collapse-mode=] "{collapse-mode}" %end %if {pagination} %then [ pagination=] "true" %end - %if {current-page} %then [ current-page=] "{current-page}" %end + %if {attribs-page} %then [ attribs-page=] "{attribs-page}" %end + %if {ext-attribs-page} %then [ ext-attribs-page=] "{ext-attribs-page}" %end %if {faded-out} %then [ faded-out=] "true" %end %if {rls-enabled} %then [ rls-enabled=] "true" %end %if {rls-forced} %then [ rls-forced=] "true" %end diff --git a/schemas/xml/view.sch b/schemas/xml/view.sch index 3510b93a94..5dee49e76d 100644 --- a/schemas/xml/view.sch +++ b/schemas/xml/view.sch @@ -14,7 +14,8 @@ %if {sql-disabled} %then [ sql-disabled=] "true" %end %if {collapse-mode} %then [ collapse-mode=] "{collapse-mode}" %end %if {pagination} %then [ pagination=] "true" %end - %if {current-page} %then [ current-page=] "{current-page}" %end + %if {attribs-page} %then [ attribs-page=] "{attribs-page}" %end + %if {ext-attribs-page} %then [ ext-attribs-page=] "{ext-attribs-page}" %end %if {faded-out} %then [ faded-out=] "true" %end %if {max-obj-count} %then [ max-obj-count=] "{max-obj-count}" %end > $br From 725d8849eea75a93986230688326b04f2ec3ac7a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 16 Nov 2018 01:33:03 -0300 Subject: [PATCH 237/425] Added a dedicated config param to store the extended attributes per page --- conf/defaults/pgmodeler.conf | 3 +- conf/dtd/pgmodeler.dtd | 1 + conf/pgmodeler.conf | 3 +- conf/schemas/pgmodeler.sch | 1 + libobjrenderer/src/basetableview.cpp | 28 +++++++---- libobjrenderer/src/basetableview.h | 6 +-- libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libpgmodeler_ui/src/generalconfigwidget.cpp | 14 ++++-- libpgmodeler_ui/src/generalconfigwidget.h | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 1 + libpgmodeler_ui/ui/generalconfigwidget.ui | 55 +++++++++++++++++++-- 12 files changed, 92 insertions(+), 24 deletions(-) diff --git a/conf/defaults/pgmodeler.conf b/conf/defaults/pgmodeler.conf index fc3bfdc6c6..77ed3484cc 100644 --- a/conf/defaults/pgmodeler.conf +++ b/conf/defaults/pgmodeler.conf @@ -36,7 +36,8 @@ show-page-delimiters="true" align-objs-to-grid="true" min-object-opacity="10" - attribs-per-page="20" + attribs-per-page="10" + ext-attribs-per-page="5" history-max-length="1000" use-curved-lines="true" compact-view="false" diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd index 610ff22752..9550fa9113 100644 --- a/conf/dtd/pgmodeler.dtd +++ b/conf/dtd/pgmodeler.dtd @@ -40,6 +40,7 @@ + diff --git a/conf/pgmodeler.conf b/conf/pgmodeler.conf index fc3bfdc6c6..77ed3484cc 100644 --- a/conf/pgmodeler.conf +++ b/conf/pgmodeler.conf @@ -36,7 +36,8 @@ show-page-delimiters="true" align-objs-to-grid="true" min-object-opacity="10" - attribs-per-page="20" + attribs-per-page="10" + ext-attribs-per-page="5" history-max-length="1000" use-curved-lines="true" compact-view="false" diff --git a/conf/schemas/pgmodeler.sch b/conf/schemas/pgmodeler.sch index b45c9fb715..68992b4a74 100644 --- a/conf/schemas/pgmodeler.sch +++ b/conf/schemas/pgmodeler.sch @@ -46,6 +46,7 @@ $sp [ BaseTable::ExtAttribsSection) + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + if(value > 0) - attribs_per_page = value; + attribs_per_page[section_id] = value; } -unsigned BaseTableView::getAttributesPerPage(void) +unsigned BaseTableView::getAttributesPerPage(unsigned section_id) { - return(attribs_per_page); + if(section_id > BaseTable::ExtAttribsSection) + throw Exception(ErrorCode::RefElementInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + return(attribs_per_page[section_id]); } void BaseTableView::hoverLeaveEvent(QGraphicsSceneHoverEvent *) @@ -429,28 +435,32 @@ void BaseTableView::finishGeometryUpdate(void) bool BaseTableView::configurePaginationParams(unsigned section_id, unsigned total_attrs, unsigned &start_attr, unsigned &end_attr) { + if(section_id > BaseTable::ExtAttribsSection) + return false; + BaseTable *table = dynamic_cast(getSourceObject()); + unsigned attr_per_page = attribs_per_page[section_id]; start_attr = end_attr = 0; attribs_toggler->setPaginationEnabled(table->isPaginationEnabled()); /* If the pagination is enabled for the table and the amount of objects is greater than the * number of objects per page we configure the pagination parameter */ - if(table->isPaginationEnabled() && total_attrs > attribs_per_page) + if(table->isPaginationEnabled() && total_attrs > attr_per_page) { // Calculating the proportions of columns and extended attributes displayed per page unsigned max_pages = 0, curr_page = table->getCurrentPage(section_id); // Determining the maximum amount of pages - max_pages = ceil(total_attrs / static_cast(attribs_per_page)); + max_pages = ceil(total_attrs / static_cast(attr_per_page)); // Validating the current page related to the maximum determined if(curr_page >= max_pages) curr_page = max_pages - 1; // Calculating the start and end columns/ext. attributes for the current page - start_attr = curr_page * attribs_per_page; - end_attr = start_attr + attribs_per_page; + start_attr = curr_page * attr_per_page; + end_attr = start_attr + attr_per_page; // Validating the determined start/end indexes avoiding the extrapolation of limits if(start_attr > total_attrs) diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 9cc629cedc..9992f63d38 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -54,7 +54,7 @@ class BaseTableView: public BaseObjectView { hide_tags; //! brief Controls the maximum amount of attributes visible per page (columns/references + extended attributes) - static unsigned attribs_per_page; + static unsigned attribs_per_page[2]; //! \brief Polygonal object that defines the table body RoundedRectItem *body, @@ -122,10 +122,10 @@ class BaseTableView: public BaseObjectView { void mousePressEvent(QGraphicsSceneMouseEvent *event); //! brief Defines the amount of attributes per page to be displayed - static void setAttributesPerPage(unsigned value); + static void setAttributesPerPage(unsigned section_id, unsigned value); //! brief Returns the current amount of attributes per page to be displayed - static unsigned getAttributesPerPage(void); + static unsigned getAttributesPerPage(unsigned section_id); //! \brief Hides the table's extended attributes (rules, triggers, indexes). This applies to all table/view instances static void setHideExtAttributes(bool value); diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index e605349980..77722f6069 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -199,6 +199,7 @@ namespace Attributes { Expression=QString("expression"), Expressions=QString("expressions"), ExtAttribsPage=QString("ext-attribs-page"), + ExtAttribsPerPage=QString("ext-attribs-per-page"), ExtObjOids=QString("ext-obj-oids"), Factor=QString("factor"), FadeInObjects=QString("fadein-objects"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index ba6590dd30..23122bb530 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -214,6 +214,7 @@ namespace Attributes { Expression, Expressions, ExtAttribsPage, + ExtAttribsPerPage, ExtObjOids, Factor, FadeInObjects, diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 74feeaa0de..bcf53e0ef5 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -132,6 +132,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::UseCurvedLines]=QString(); config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]=QString(); config_params[Attributes::Configuration][Attributes::AttribsPerPage]=QString(); + config_params[Attributes::Configuration][Attributes::ExtAttribsPerPage]=QString(); simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this); simp_obj_creation_ht->setText(simple_obj_creation_chk->statusTip()); @@ -184,8 +185,8 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa use_curved_lines_ht=new HintTextWidget(use_curved_lines_hint, this); use_curved_lines_ht->setText(use_curved_lines_chk->statusTip()); - attributes_per_page_ht=new HintTextWidget(attributes_per_page_hint, this); - attributes_per_page_ht->setText(attributes_per_page_spb->statusTip()); + attribs_per_page_ht=new HintTextWidget(attributes_per_page_hint, this); + attribs_per_page_ht->setText(attribs_per_page_spb->statusTip()); selectPaperSize(); @@ -309,7 +310,8 @@ void GeneralConfigWidget::loadConfiguration(void) landscape_rb->setChecked(config_params[Attributes::Configuration][Attributes::PaperOrientation]==Attributes::Landscape); min_obj_opacity_spb->setValue(config_params[Attributes::Configuration][Attributes::MinObjectOpacity].toUInt()); - attributes_per_page_spb->setValue(config_params[Attributes::Configuration][Attributes::AttribsPerPage].toUInt()); + attribs_per_page_spb->setValue(config_params[Attributes::Configuration][Attributes::AttribsPerPage].toUInt()); + ext_attribs_per_page_spb->setValue(config_params[Attributes::Configuration][Attributes::ExtAttribsPerPage].toUInt()); margin=config_params[Attributes::Configuration][Attributes::PaperMargin].split(','); custom_size=config_params[Attributes::Configuration][Attributes::PaperCustomSize].split(','); @@ -489,7 +491,8 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::UsePlaceholders]=(use_placeholders_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::HistoryMaxLength]=QString::number(history_max_length_spb->value()); config_params[Attributes::Configuration][Attributes::UseCurvedLines]=(use_curved_lines_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::AttribsPerPage]=QString::number(attributes_per_page_spb->value()); + config_params[Attributes::Configuration][Attributes::AttribsPerPage]=QString::number(attribs_per_page_spb->value()); + config_params[Attributes::Configuration][Attributes::ExtAttribsPerPage]=QString::number(ext_attribs_per_page_spb->value()); ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); config_params[Attributes::Configuration][Attributes::ShowCanvasGrid]=(show_grid ? Attributes::True : QString()); @@ -625,7 +628,8 @@ void GeneralConfigWidget::applyConfiguration(void) OperationList::setMaximumSize(oplist_size_spb->value()); BaseTableView::setHideExtAttributes(hide_ext_attribs_chk->isChecked()); BaseTableView::setHideTags(hide_table_tags_chk->isChecked()); - BaseTableView::setAttributesPerPage(attributes_per_page_spb->value()); + BaseTableView::setAttributesPerPage(BaseTable::AttribsSection, attribs_per_page_spb->value()); + BaseTableView::setAttributesPerPage(BaseTable::ExtAttribsSection, ext_attribs_per_page_spb->value()); RelationshipView::setHideNameLabel(hide_rel_name_chk->isChecked()); RelationshipView::setCurvedLines(use_curved_lines_chk->isChecked()); ModelWidget::setSaveLastCanvasPosition(save_last_pos_chk->isChecked()); diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index 1654c86e02..183d60f143 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -64,7 +64,7 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg *hide_ext_attribs_ht, *hide_table_tags_ht, *hide_rel_name_ht, *code_completion_ht, *use_placeholders_ht, *min_obj_opacity_ht, *autosave_ht, *op_history_ht, *ui_language_ht, *grid_size_ht, - *use_curved_lines_ht, *max_result_rows_ht, *attributes_per_page_ht; + *use_curved_lines_ht, *max_result_rows_ht, *attribs_per_page_ht; ColorPickerWidget *line_numbers_cp, *line_numbers_bg_cp, *line_highlight_cp; diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index eaabfa2323..6e40c94042 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -327,6 +327,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) Attributes::FadedOut, Attributes::CollapseMode, Attributes::AttribsPage, + Attributes::ExtAttribsPage, Attributes::Pagination}, { Attributes::Role, Attributes::Tablespace, diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 5ac16c1eb2..23101322d9 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -6,7 +6,7 @@ 0 0 - 743 + 794 712 @@ -103,7 +103,7 @@ - + 0 @@ -117,7 +117,7 @@ - Defines the minimum amount of attributes visible per page on tables and view when the pagination is enabled on these objects. + These spinners define the minimum amount of attributes visible per page in each section of tables and views when the pagination is enabled on them. The first one controls the amount of columns per page. The second defines the amount of extended attributes (constraints, indexes, trigger, rules, policies) displayed per page. 5 @@ -133,6 +133,53 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + Defines the minimum amount of attributes visible per page on tables and view when the pagination is enabled on these objects. + + + 5 + + + 100 + + + 5 + + + 5 + + + @@ -264,7 +311,7 @@ - + 0 0 From 325c5131f81c01eab1cc4ec5c2c38ca0baa197e2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 16 Nov 2018 18:52:40 -0300 Subject: [PATCH 238/425] Changed View in such way to use the class SimpleColumn to represent its deduced columns. Added a tab "Columns" in ReferenceWidget where the user will be able to insert columns to be used as view columns (WIP) --- libobjrenderer/src/graphicalview.cpp | 28 +- libobjrenderer/src/tableobjectview.cpp | 26 +- libobjrenderer/src/tableobjectview.h | 4 +- libpgmodeler/src/reference.cpp | 10 + libpgmodeler/src/reference.h | 21 + libpgmodeler/src/view.cpp | 82 +-- libpgmodeler/src/view.h | 28 +- libpgmodeler_ui/src/referencewidget.cpp | 24 +- libpgmodeler_ui/src/referencewidget.h | 6 + libpgmodeler_ui/ui/referencewidget.ui | 922 ++++++++++++++---------- 10 files changed, 667 insertions(+), 484 deletions(-) diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index ad4b962322..4850e19711 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -38,6 +38,7 @@ void GraphicalView::configureObject(void) TableObjectView *graph_ref=nullptr; QList subitems; vector tab_objs, ext_tab_objs; + vector view_cols; QGraphicsItemGroup *groups[]={ columns, ext_attribs }; RoundedRectItem *bodies[]={ body, ext_attribs_body }; QString attribs[]={ Attributes::ViewBody, Attributes::ViewExtBody }, @@ -47,7 +48,6 @@ void GraphicalView::configureObject(void) QList col_items; TableObject *tab_obj=nullptr; Tag *tag=view->getTag(); - QStringList col_names, col_types; CollapseMode collapse_mode = view->getCollapseMode(); bool has_col_pag = false, has_ext_pag = false; @@ -59,18 +59,15 @@ void GraphicalView::configureObject(void) attribs_toggler->setHasExtAttributes(!hide_ext_attribs && !ext_tab_objs.empty()); - col_names = (!compact_view ? view->getColumnNames() : view->getColumnAliases()); - col_types = view->getColumnTypes(); - - has_col_pag = configurePaginationParams(BaseTable::AttribsSection, col_names.size(), start_col, end_col); - + view_cols = view->getColumns(); + has_col_pag = configurePaginationParams(BaseTable::AttribsSection, view_cols.size(), start_col, end_col); has_ext_pag = configurePaginationParams(BaseTable::ExtAttribsSection, collapse_mode != CollapseMode::ExtAttribsCollapsed ? ext_tab_objs.size() : 0, start_ext, end_ext); //Moves the references group to the origin to be moved latter columns->moveBy(-columns->scenePos().x(), -columns->scenePos().y()); - columns->setVisible(view->getCollapseMode() != CollapseMode::AllAttribsCollapsed && start_col < static_cast(col_names.size())); + columns->setVisible(view->getCollapseMode() != CollapseMode::AllAttribsCollapsed && start_col < static_cast(view_cols.size())); body->setVisible(columns->isVisible()); if(!columns->isVisible()) @@ -83,21 +80,14 @@ void GraphicalView::configureObject(void) } else { - QStringList aux_col_names, aux_col_types; - int col_cnt = end_col - start_col; + vector aux_view_cols; if(has_col_pag) - { - aux_col_names = col_names.mid(start_col, col_cnt); - aux_col_types = col_types.mid(start_col, col_cnt); - } + aux_view_cols.assign(view_cols.begin() + start_col, view_cols.begin() + end_col); else - { - aux_col_names = col_names; - aux_col_types = col_types; - } + aux_view_cols = view_cols; - count = aux_col_names.size(); + count = aux_view_cols.size(); subitems=columns->childItems(); for(i=0; i < count; i++) @@ -114,7 +104,7 @@ void GraphicalView::configureObject(void) else graph_ref=new TableObjectView; - graph_ref->configureObject(aux_col_names[i], aux_col_types[i], QString()); + graph_ref->configureObject(aux_view_cols[i]); graph_ref->moveBy(HorizSpacing, (i * graph_ref->boundingRect().height()) + VertSpacing); /* Calculates the width of the name + type of the object. This is used to align all diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 31517b5538..173df676f3 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -505,7 +505,7 @@ void TableObjectView::configureObject(Reference reference) calculateBoundingRect(); } -void TableObjectView::configureObject(const QString &name, const QString &type, const QString &alias) +void TableObjectView::configureObject(const SimpleColumn &col) { QTextCharFormat fmt; double px; @@ -515,16 +515,21 @@ void TableObjectView::configureObject(const QString &name, const QString &type, px=descriptor->pos().x() + descriptor->boundingRect().width() + (2 * HorizSpacing); fmt = font_config[Attributes::Column]; - lables[0]->setText(name); + + if(compact_view && !col.alias.isEmpty()) + lables[0]->setText(col.alias); + else + lables[0]->setText(col.name); + lables[0]->setFont(fmt.font()); lables[0]->setBrush(fmt.foreground()); lables[0]->setPos(px, 0); px+=lables[0]->boundingRect().width() + (4 * HorizSpacing); - if(!compact_view && !type.isEmpty()) + if(!compact_view && !col.type.isEmpty()) { fmt=font_config[Attributes::ObjectType]; - lables[1]->setText(type); + lables[1]->setText(col.type); lables[1]->setFont(fmt.font()); lables[1]->setBrush(fmt.foreground()); lables[1]->setPos(px, 0); @@ -533,18 +538,7 @@ void TableObjectView::configureObject(const QString &name, const QString &type, else lables[1]->setText(QString()); - //Configures a label for the alias (if there is one) - if(!compact_view && !alias.isEmpty()) - { - fmt=font_config[Attributes::Alias]; - lables[2]->setText(QString(" (") + alias + QString(") ")); - lables[2]->setFont(fmt.font()); - lables[2]->setBrush(fmt.foreground()); - lables[2]->setPos(px, 0); - } - else - lables[2]->setText(QString()); - + lables[2]->setText(QString()); calculateBoundingRect(); } diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index 7387577ad4..d67a3a2a75 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -76,8 +76,8 @@ class TableObjectView: public BaseObjectView //! \brief Configures the object as a view reference void configureObject(Reference reference); - //! \brief Configures a generic item containing a name, datatype and alias - void configureObject(const QString &name, const QString &type, const QString &alias = QString()); + //! \brief Configures a item from a SimpleColumn instance + void configureObject(const SimpleColumn &col); //! \brief Configures the object as a table object void configureObject(void); diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 45373abf9d..2eed8dc327 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -73,6 +73,16 @@ bool Reference::isDefinitionExpression(void) return(is_def_expr); } +void Reference::addColumn(const QString &name, const QString &type, const QString &alias) +{ + +} + +void Reference::removeColumns(void) +{ + columns.clear(); +} + Table *Reference::getTable(void) { return(table); diff --git a/libpgmodeler/src/reference.h b/libpgmodeler/src/reference.h index 3b2ff88f4a..2b11e1bd1f 100644 --- a/libpgmodeler/src/reference.h +++ b/libpgmodeler/src/reference.h @@ -29,6 +29,15 @@ #include "table.h" #include "schema.h" +/*! \brief This simple struct acts like a rudimentary column used by Reference and Views to represent columns + * Note that, as intended, the struct expects that all received values are validated since they are immutable */ +struct SimpleColumn { + QString name, type, alias; + + SimpleColumn(const QString &_name, const QString &_type, const QString &_alias) : + name(_name), type(_type), alias(_alias) {} +}; + class Reference { private: //! \brief Stores the table used by the reference @@ -52,6 +61,12 @@ class Reference { //! \brief Indicates if the expression is used as entire view definition bool is_def_expr; + /*! \brief Stores the columns that the reference (when being an expression) generates. + * These columns are used when drawing a view and that has only on definition expression. + * By having columns, instead of drawing the expression as a column of the view, the ones in + * this vector are displayed */ + vector columns; + public: //! \brief Constants used to define the reference type static constexpr unsigned ReferColumn=0, //! \brief The reference is based on a table column @@ -107,6 +122,12 @@ class Reference { //! \brief Indicates if the reference when used as expression defines the entire view (raw sql definition) bool isDefinitionExpression(void); + //! \brief Adds a column as being generated by the reference (if it is an expression) + void addColumn(const QString &name, const QString &type, const QString &alias); + + //! \brief Clears the columns generated by the expression + void removeColumns(void); + /*! \brief Compare the attributes of two references returning true when they have the same values */ bool operator == (Reference &refer); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 6c6636061c..f19401cef8 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -191,17 +191,15 @@ void View::generateColumnNamesTypes(void) Table *tab = nullptr; Reference ref; Column *col = nullptr; - QString name; + QString name, alias; - col_aliases.clear(); - col_names.clear(); - col_types.clear(); + columns.clear(); if(hasDefinitionExpression()) { - col_names.push_back(QString("%1...").arg(references[0].getExpression().simplified().mid(0, 20))); - col_aliases.push_back(!references[0].getReferenceAlias().isEmpty() ? references[0].getReferenceAlias() : col_names.at(0)); - col_types.push_back(Attributes::Expression); + columns.push_back(SimpleColumn(QString("%1...").arg(references[0].getExpression().simplified().mid(0, 20)), + Attributes::Expression, + !references[0].getReferenceAlias().isEmpty() ? references[0].getReferenceAlias() : QString())); } else { @@ -216,9 +214,9 @@ void View::generateColumnNamesTypes(void) else name = QString("_expr%1_").arg(expr_idx++); - addColumnName(name); - col_types.push_back(Attributes::Expression); - col_aliases.push_back(!ref.getReferenceAlias().isEmpty() ? ref.getReferenceAlias() : name); + name = getUniqueColumnName(name); + columns.push_back(SimpleColumn(name, Attributes::Expression, + !ref.getReferenceAlias().isEmpty() ? ref.getReferenceAlias() : name)); } else if(!ref.getColumn()) { @@ -228,9 +226,9 @@ void View::generateColumnNamesTypes(void) for(col_id=0; col_id < col_count; col_id++) { col = tab->getColumn(col_id); - addColumnName(col->getName()); - col_types.push_back(*col->getType()); - col_aliases.push_back(!col->getAlias().isEmpty() ? col->getAlias() : col->getName()); + name = getUniqueColumnName(col->getName()); + columns.push_back(SimpleColumn(name, *col->getType(), + !col->getAlias().isEmpty() ? col->getAlias() : col->getName())); } } else @@ -238,34 +236,24 @@ void View::generateColumnNamesTypes(void) col = ref.getColumn(); if(!ref.getColumnAlias().isEmpty()) - addColumnName(ref.getColumnAlias()); + name = getUniqueColumnName(ref.getColumnAlias()); else - addColumnName(col->getName()); - - col_types.push_back(*col->getType()); + name = getUniqueColumnName(col->getName()); if(!ref.getReferenceAlias().isEmpty()) - col_aliases.push_back(ref.getReferenceAlias()); + alias = ref.getReferenceAlias(); else - col_aliases.push_back(!col->getAlias().isEmpty() ? col->getAlias() : col->getName()); + alias = !col->getAlias().isEmpty() ? col->getAlias() : col->getName(); + + columns.push_back(SimpleColumn(name, *col->getType(), alias)); } } } } -QStringList View::getColumnNames(void) -{ - return(col_names); -} - -QStringList View::getColumnTypes(void) -{ - return(col_types); -} - -QStringList View::getColumnAliases(void) +vector View::getColumns(void) { - return(col_aliases); + return(columns); } void View::addReference(Reference &refer, unsigned sql_type, int expr_id) @@ -431,8 +419,7 @@ void View::removeReferences(void) exp_from.clear(); exp_where.clear(); exp_end.clear(); - col_names.clear(); - col_types.clear(); + columns.clear(); setCodeInvalidated(true); } @@ -648,8 +635,11 @@ QString View::getCodeDefinition(unsigned def_type) { QStringList fmt_names; - for(auto &name : col_names) - fmt_names.push_back(formatName(name)); + //for(auto &name : col_names) + // fmt_names.push_back(formatName(name)); + + for(auto &col : columns) + fmt_names.push_back(formatName(col.name)); attributes[Attributes::Columns]=fmt_names.join(','); } @@ -676,18 +666,28 @@ void View::setSQLObjectAttribute(void) attributes[Attributes::SqlObject]=QString("MATERIALIZED ") + BaseObject::getSQLName(ObjectType::View); } -void View::addColumnName(const QString &name) +QString View::getUniqueColumnName(const QString &name) { - unsigned col_id = 1; + unsigned idx = 1; QString fmt_name = name; + vector::iterator itr, itr_end; - while(col_names.indexOf(fmt_name) >= 0) + itr = columns.begin(); + itr_end = columns.end(); + + while(itr != itr_end) { - fmt_name = name + QString::number(col_id); - col_id++; + if(itr->name == fmt_name) + { + fmt_name = name + QString::number(idx); + idx++; + itr = columns.begin(); + } + else + itr++; } - col_names.push_back(fmt_name); + return(fmt_name); } void View::setObjectListsCapacity(unsigned capacity) diff --git a/libpgmodeler/src/view.h b/libpgmodeler/src/view.h index aa4805e8d6..76b8faf308 100644 --- a/libpgmodeler/src/view.h +++ b/libpgmodeler/src/view.h @@ -30,15 +30,6 @@ class View: public BaseTable { private: - //! \brief Deduced column names - QStringList col_names, - - //! \brief Deduced columns aliases (used in compact view) - col_aliases, - - //! \brief Deduces column types - col_types; - //! \brief Stores the references to expressions and objects vector references; @@ -53,6 +44,8 @@ class View: public BaseTable { vector rules; vector indexes; + vector columns; + /*! \brief Commom table expression. This is prepend on the views definition. CTE's are available since PostgreSQL 8.4: > http://www.postgresql.org/docs/8.4/interactive/queries-with.html */ @@ -82,9 +75,8 @@ class View: public BaseTable { void setSQLObjectAttribute(void); - /*! \brief Adds the provided names as a view's column name. In case of duplicated name - * the most recent one will receive a numeric suffix */ - void addColumnName(const QString &name); + //! \brief Returns a unique name for a columns comparing it to the existent columns. In case of duplication the name receives a suffix + QString getUniqueColumnName(const QString &name); public: View(void); @@ -246,21 +238,15 @@ class View: public BaseTable { unsigned getMaxObjectCount(void); - //! \brief Returns the deduced names of the view's columns - QStringList getColumnNames(void); - - //! \brief Returns the deduced types of the view's columns - QStringList getColumnTypes(void); - - //! \brief Returns the deduced aliases of the view's columns (for using on the compact view as column names) - QStringList getColumnAliases(void); - /*! \brief Returns a list of deduced names for view's colums (useful for recursive views). * The names are retrieved, first, from columns aliases and lastly from table's columns * when TABLE.* syntax is used. For expressions, if aliases aren't defined, a column name in the * for _expr#_ is used. */ void generateColumnNamesTypes(void); + //! \brief Returns the deduced columns of the view + vector getColumns(void); + //! \brief Copy the attributes between two views void operator = (View &visao); }; diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index e48d27e3a5..6c25917141 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -41,11 +41,25 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) ref_object_sel->enableObjectCreation(false); expression_cp=new CodeCompletionWidget(expression_txt, true); - reference_grid->addWidget(ref_object_sel, 3, 1, 1, 3); - reference_grid->addWidget(expression_txt, 5, 1, 1, 4); + QGridLayout *grid = dynamic_cast(properties_tbw->widget(0)->layout()); + grid->addWidget(ref_object_sel, 2, 1, 1, 3); + grid->addWidget(expression_txt, 4, 1, 1, 4); + + properties_tbw->setTabEnabled(1, false); + pgsqltype_wgt = new PgSQLTypeWidget(this); + columns_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons, true, this); + + QFrame *info_frm=BaseObjectWidget::generateInformationFrame(trUtf8("This tab can be used to inform the columns that the view owns. This is just a convenience to make the visualization of this kind of object more intuitive. If no column is specified here the columns of the view displayed in the canvas will be a fragment of the expression defined in the previous tab.")); + QVBoxLayout *vbox = dynamic_cast(properties_tbw->widget(1)->layout()); + + vbox->addWidget(pgsqltype_wgt); + vbox->addWidget(columns_tab); + + info_frm->setParent(this); + vbox->addWidget(info_frm); selectReferenceType(); - setMinimumSize(630, 380); + setMinimumSize(640, 480); connect(view_def_chk, SIGNAL(toggled(bool)), select_from_chk, SLOT(setDisabled(bool))); connect(view_def_chk, SIGNAL(toggled(bool)), from_where_chk, SLOT(setDisabled(bool))); @@ -67,6 +81,9 @@ void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseM this->ref_flags = ref_flags; this->reference = ref; + pgsqltype_wgt->setAttributes(PgSqlType(), model, + UserTypeConfig::AllUserTypes ^ UserTypeConfig::SequenceType, true, false); + expression_cp->configureCompletion(model, expression_hl); ref_object_sel->setModel(model); @@ -171,4 +188,5 @@ void ReferenceWidget::selectReferenceType(void) expression_txt->setEnabled(!ref_obj); expr_alias_edt->setEnabled(!ref_obj); view_def_chk->setVisible(!ref_obj); + properties_tbw->setTabEnabled(1, !ref_obj); } diff --git a/libpgmodeler_ui/src/referencewidget.h b/libpgmodeler_ui/src/referencewidget.h index 8ef7ccf4a6..292ef768ed 100644 --- a/libpgmodeler_ui/src/referencewidget.h +++ b/libpgmodeler_ui/src/referencewidget.h @@ -26,6 +26,8 @@ #include "codecompletionwidget.h" #include "objectselectorwidget.h" #include "hinttextwidget.h" +#include "pgsqltypewidget.h" +#include "objectstablewidget.h" class ReferenceWidget : public QWidget, Ui::ReferenceWidget { private: @@ -41,6 +43,10 @@ class ReferenceWidget : public QWidget, Ui::ReferenceWidget { ObjectSelectorWidget *ref_object_sel; + PgSQLTypeWidget *pgsqltype_wgt; + + ObjectsTableWidget *columns_tab; + unsigned ref_flags; Reference reference; diff --git a/libpgmodeler_ui/ui/referencewidget.ui b/libpgmodeler_ui/ui/referencewidget.ui index 3659d59a8f..9dbb2336da 100644 --- a/libpgmodeler_ui/ui/referencewidget.ui +++ b/libpgmodeler_ui/ui/referencewidget.ui @@ -6,8 +6,8 @@ 0 0 - 622 - 184 + 689 + 263 @@ -32,394 +32,552 @@ 4 - - - - - 0 - 0 - - - - Table alias: - - - + + 6 + - - - - 0 - 0 - - - - - 0 - 0 - - - - Ref. type: - - - - - - - - 0 - 0 - - - - Used in: - - - - - - - - 0 - 0 - - - - Expression: - - - - - - - - 0 - 0 - - - - Expr. alias: - - - - - - - - 0 - 0 - - - - - - - - - - - 0 - 0 - - - - - false - - - - - - - <strong>SELECT</strong><br/>The reference will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns.<br/><strong>FROM</strong><br/>The reference is used in the FROM portion of the command in order to reference tables or construct JOIN statements.<br/><strong>WHERE</strong><br/>The reference will be used as part of the WHERE clause in form of conditional expression. <br/><strong>GROUP/HAVING</strong><br/>The reference will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements.<br/><strong>View definition</strong><br/>The reference's expression is used exclusively as the view's definition.<br/> - - - SELECT - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - false - - - - FROM - - - - - - - - 0 - 0 - - - - - false - - - - WHERE - - - - - - - - 0 - 0 - - - - - false - - - - GROUP/HAVING - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - View Definition - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - 22 - 22 - + + + true - - - 22 - 22 - + + 0 - - - - - - - - View's references can point to a table, column or expression. - - - Table / Column - - - - Table / Column - + + + Properties + + + + 4 + + + 4 + + + 4 + + + 4 + + + 6 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Ref. type: + + - - - Expression - + + + + + + + 0 + 0 + + + + + false + + + + + + + <strong>SELECT</strong><br/>The reference will be used as part of the SELECT statement to retrieve columns or expressions that will compose the view's columns.<br/><strong>FROM</strong><br/>The reference is used in the FROM portion of the command in order to reference tables or construct JOIN statements.<br/><strong>WHERE</strong><br/>The reference will be used as part of the WHERE clause in form of conditional expression. <br/><strong>GROUP/HAVING</strong><br/>The reference will be appended to the very end of the view's definition. This is useful when using GROUP BY/HAVING statements.<br/><strong>View definition</strong><br/>The reference's expression is used exclusively as the view's definition.<br/> + + + SELECT + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + false + + + + FROM + + + + + + + + 0 + 0 + + + + + false + + + + WHERE + + + + + + + + 0 + 0 + + + + + false + + + + GROUP/HAVING + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + View Definition + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + - - - - - - - 0 - 0 - - - - Ref. alias: - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - This is a more friendly description for the reference. When displaying the model in compact view this is the text shown for the reference instead of its real description. If this field is empty the real description will be displayed anyway. - - - - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - + + + + + + View's references can point to a table, column or expression. + + + Table / Column + + + + Table / Column + + + + + Expression + + + + + + + + + 0 + 0 + + + + Ref. alias: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + This is a more friendly description for the reference. When displaying the model in compact view this is the text shown for the reference instead of its real description. If this field is empty the real description will be displayed anyway. + + + + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + + + 0 + 0 + + + + Used in: + + + + + + + + 0 + 0 + + + + Ref. object: + + + + + + + + 0 + 0 + + + + Table alias: + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Column alias: + + + + + + + false + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Expression: + + + + + + + + 0 + 0 + + + + Expr. alias: + + + + + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + 318 + 17 + + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + true + + + Columns + + + + 6 + + + 4 + + + 4 + + + 4 + + + 4 - - - - - - - - - 0 - 0 - - - - Ref. object: - - - - - - - - 0 - 0 - - - - Column alias: - - - - - - - false - - - - 0 - 0 - - + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Name: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + This is the name of the object in the PostgreSQL database. + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Alias: + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + This is a more friendly name for the object. When displaying the model in compact view this is the name shown for the object instead of its real name. If this field is empty the real name will be displayed anyway. + + + + + + + + + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - From 8a9d1d537109dfb4c0c450ada3cd93dd5fb398be Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 19 Nov 2018 17:24:07 -0300 Subject: [PATCH 239/425] Finished the support to column creating on ReferenceWidget Added the ability to load reference columns from database model file in DatabaseModel::createView --- libpgmodeler/src/databasemodel.cpp | 24 +++++- libpgmodeler/src/reference.cpp | 52 ++++++++++++- libpgmodeler/src/reference.h | 9 ++- libpgmodeler/src/view.cpp | 17 +++-- libpgmodeler/src/view.h | 2 +- libpgmodeler_ui/src/referencewidget.cpp | 89 +++++++++++++++++++++- libpgmodeler_ui/src/referencewidget.h | 12 ++- libpgmodeler_ui/ui/referencewidget.ui | 98 ++++++++++++++++++++----- schemas/xml/dtd/view.dtd | 2 +- schemas/xml/reference.sch | 6 +- 10 files changed, 274 insertions(+), 37 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index e4fd1ecb28..5d76186d3d 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -5807,7 +5807,7 @@ void DatabaseModel::updateViewsReferTable(Table *table) if(view && tab == table) { - view->generateColumnNamesTypes(); + view->generateColumns(); view->setCodeInvalidated(true); view->setModified(true); dynamic_cast(view->getSchema())->setModified(true); @@ -5987,13 +5987,31 @@ View *DatabaseModel::createView(void) xmlparser.savePosition(); str_aux=attribs[Attributes::Alias]; + // Retrieving the reference expression xmlparser.accessElement(XmlParser::ChildElement); + xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); - reference = Reference(xmlparser.getElementContent(),str_aux); reference.setReferenceAlias(attribs[Attributes::RefAlias]); - refs.push_back(reference); + xmlparser.restorePosition(); + // Creating the columns related to the expression + if(xmlparser.accessElement(XmlParser::NextElement)) + { + elem = xmlparser.getElementName(); + + do + { + xmlparser.savePosition(); + column = createColumn(); + reference.addColumn(column); + delete(column); + xmlparser.restorePosition(); + } + while(xmlparser.accessElement(XmlParser::NextElement)); + } + + refs.push_back(reference); xmlparser.restorePosition(); } } diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 2eed8dc327..4a2a119046 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -73,9 +73,44 @@ bool Reference::isDefinitionExpression(void) return(is_def_expr); } -void Reference::addColumn(const QString &name, const QString &type, const QString &alias) +void Reference::addColumn(const QString &name, PgSqlType type, const QString &alias) { + QString aux_name = name; + if(aux_name.startsWith(QChar('\"')) && + aux_name.endsWith(QChar('\"'))) + { + aux_name.remove(0, 1); + aux_name.remove(aux_name.length(), 1); + } + + // Validating the column name + if(!BaseObject::isValidName(name)) + { + if(aux_name.isEmpty()) + throw Exception(ErrorCode::AsgEmptyNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + else if(aux_name.size() > BaseObject::ObjectNameMaxLength) + throw Exception(ErrorCode::AsgLongNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + else + throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + + // Checking if the column already exists + for(auto &col : columns) + { + if(col.name == name) + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + + columns.push_back(SimpleColumn(name, *type, alias)); +} + +void Reference::addColumn(Column *col) +{ + if(!col) + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + addColumn(col->getName(), col->getType(), col->getAlias()); } void Reference::removeColumns(void) @@ -83,6 +118,11 @@ void Reference::removeColumns(void) columns.clear(); } +vector Reference::getColumns(void) +{ + return(columns); +} + Table *Reference::getTable(void) { return(table); @@ -226,6 +266,7 @@ QString Reference::getXMLDefinition(void) { attribs_map attribs; SchemaParser schparser; + Column col_aux; attribs[Attributes::Table]=QString(); attribs[Attributes::Column]=QString(); @@ -240,6 +281,15 @@ QString Reference::getXMLDefinition(void) attribs[Attributes::Expression]=expression; attribs[Attributes::Alias]=alias; attribs[Attributes::ColumnAlias]=column_alias; + attribs[Attributes::Columns]=QString(); + + for(auto &col : columns) + { + col_aux.setName(col.name); + col_aux.setType(PgSqlType::parseString(col.type)); + col_aux.setAlias(col.alias); + attribs[Attributes::Columns]+=col_aux.getCodeDefinition(SchemaParser::XmlDefinition); + } return(schparser.getCodeDefinition(Attributes::Reference, attribs, SchemaParser::XmlDefinition)); } diff --git a/libpgmodeler/src/reference.h b/libpgmodeler/src/reference.h index 2b11e1bd1f..58fbf50a56 100644 --- a/libpgmodeler/src/reference.h +++ b/libpgmodeler/src/reference.h @@ -32,8 +32,7 @@ /*! \brief This simple struct acts like a rudimentary column used by Reference and Views to represent columns * Note that, as intended, the struct expects that all received values are validated since they are immutable */ struct SimpleColumn { - QString name, type, alias; - + QString name, type, alias; SimpleColumn(const QString &_name, const QString &_type, const QString &_alias) : name(_name), type(_type), alias(_alias) {} }; @@ -123,11 +122,15 @@ class Reference { bool isDefinitionExpression(void); //! \brief Adds a column as being generated by the reference (if it is an expression) - void addColumn(const QString &name, const QString &type, const QString &alias); + void addColumn(const QString &name, PgSqlType type, const QString &alias); + void addColumn(Column *col); //! \brief Clears the columns generated by the expression void removeColumns(void); + //! \brief Returns the columns which the reference generates + vector getColumns(void); + /*! \brief Compare the attributes of two references returning true when they have the same values */ bool operator == (Reference &refer); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index f19401cef8..d1cf9e9fcb 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -185,7 +185,7 @@ vector *View::getExpressionList(unsigned sql_type) return(nullptr); } -void View::generateColumnNamesTypes(void) +void View::generateColumns(void) { unsigned col_id = 0, col_count = 0, expr_idx = 0; Table *tab = nullptr; @@ -197,9 +197,14 @@ void View::generateColumnNamesTypes(void) if(hasDefinitionExpression()) { - columns.push_back(SimpleColumn(QString("%1...").arg(references[0].getExpression().simplified().mid(0, 20)), - Attributes::Expression, - !references[0].getReferenceAlias().isEmpty() ? references[0].getReferenceAlias() : QString())); + vector ref_cols = references[0].getColumns(); + + if(ref_cols.empty()) + columns.push_back(SimpleColumn(QString("%1...").arg(references[0].getExpression().simplified().mid(0, 20)), + Attributes::Expression, + !references[0].getReferenceAlias().isEmpty() ? references[0].getReferenceAlias() : QString())); + else + columns = ref_cols; } else { @@ -315,7 +320,7 @@ void View::addReference(Reference &refer, unsigned sql_type, int expr_id) this->object_id=BaseObject::getGlobalId(); } - generateColumnNamesTypes(); + generateColumns(); setCodeInvalidated(true); } @@ -408,7 +413,7 @@ void View::removeReference(unsigned ref_id) //Removes the reference from the view references.erase(references.begin() + ref_id); - generateColumnNamesTypes(); + generateColumns(); setCodeInvalidated(true); } diff --git a/libpgmodeler/src/view.h b/libpgmodeler/src/view.h index 76b8faf308..2993ae3e66 100644 --- a/libpgmodeler/src/view.h +++ b/libpgmodeler/src/view.h @@ -242,7 +242,7 @@ class View: public BaseTable { * The names are retrieved, first, from columns aliases and lastly from table's columns * when TABLE.* syntax is used. For expressions, if aliases aren't defined, a column name in the * for _expr#_ is used. */ - void generateColumnNamesTypes(void); + void generateColumns(void); //! \brief Returns the deduced columns of the view vector getColumns(void); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 6c25917141..6a2c18318a 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -23,6 +23,8 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) { setupUi(this); + model = nullptr; + ref_flags = 0; ref_alias_ht=new HintTextWidget(ref_alias_hint, this); ref_alias_ht->setText(ref_alias_edt->statusTip()); @@ -33,6 +35,9 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) ref_object_ht=new HintTextWidget(ref_object_hint, this); ref_object_ht->setText(trUtf8("To reference all columns of a table select only a table in the object selector, this is the same as write [schema].[table].*. In order to reference a only a single column of a table select a column object in the selector.")); + alias_ht=new HintTextWidget(alias_hint, this); + alias_ht->setText(alias_edt->statusTip()); + expression_txt=new NumberedTextEditor(this, true); expression_hl=new SyntaxHighlighter(expression_txt, false, true); expression_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); @@ -47,7 +52,14 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) properties_tbw->setTabEnabled(1, false); pgsqltype_wgt = new PgSQLTypeWidget(this); + columns_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons, true, this); + columns_tab->setColumnCount(3); + columns_tab->setHeaderLabel(trUtf8("Name"), 0); + columns_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + columns_tab->setHeaderLabel(trUtf8("Type"), 1); + columns_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("usertype")),1); + columns_tab->setHeaderLabel(trUtf8("Alias"), 2); QFrame *info_frm=BaseObjectWidget::generateInformationFrame(trUtf8("This tab can be used to inform the columns that the view owns. This is just a convenience to make the visualization of this kind of object more intuitive. If no column is specified here the columns of the view displayed in the canvas will be a fragment of the expression defined in the previous tab.")); QVBoxLayout *vbox = dynamic_cast(properties_tbw->widget(1)->layout()); @@ -61,10 +73,20 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) selectReferenceType(); setMinimumSize(640, 480); + connect(columns_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addColumn(int))); + connect(columns_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(updateColumn(int))); + connect(columns_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editColumn(int))); + connect(columns_tab, SIGNAL(s_rowDuplicated(int,int)), this, SLOT(duplicateColumn(int,int))); + connect(view_def_chk, SIGNAL(toggled(bool)), select_from_chk, SLOT(setDisabled(bool))); connect(view_def_chk, SIGNAL(toggled(bool)), from_where_chk, SLOT(setDisabled(bool))); connect(view_def_chk, SIGNAL(toggled(bool)), after_where_chk, SLOT(setDisabled(bool))); connect(view_def_chk, SIGNAL(toggled(bool)), end_expr_chk, SLOT(setDisabled(bool))); + + connect(view_def_chk, &QCheckBox::toggled, [&](bool checked){ + properties_tbw->setTabEnabled(1, checked); + }); + connect(ref_type_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(selectReferenceType(void))); connect(ref_object_sel, &ObjectSelectorWidget::s_objectSelected, [&](){ @@ -80,6 +102,7 @@ void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseM { this->ref_flags = ref_flags; this->reference = ref; + this->model = model; pgsqltype_wgt->setAttributes(PgSqlType(), model, UserTypeConfig::AllUserTypes ^ UserTypeConfig::SequenceType, true, false); @@ -107,7 +130,23 @@ void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseM } if(ref_flags == Reference::SqlViewDefinition) + { + int row = 0; view_def_chk->setChecked(true); + columns_tab->blockSignals(true); + + for(auto &col : ref.getColumns()) + { + columns_tab->addRow(); + columns_tab->setCellText(col.name, row, 0); + columns_tab->setCellText(col.type, row, 1); + columns_tab->setCellText(col.alias, row, 2); + columns_tab->setRowData(QVariant::fromValue(PgSqlType::parseString(col.type)), row); + row++; + } + + columns_tab->blockSignals(false); + } else { select_from_chk->setChecked((ref_flags & Reference::SqlReferSelect) == Reference::SqlReferSelect); @@ -155,7 +194,15 @@ void ReferenceWidget::applyConfiguration(void) ref_flags = 0; if(view_def_chk->isChecked()) + { ref_flags = Reference::SqlViewDefinition; + reference.removeColumns(); + + for(unsigned row = 0; row < columns_tab->getRowCount(); row++) + reference.addColumn(columns_tab->getCellText(row, 0), + columns_tab->getRowData(row).value(), + columns_tab->getCellText(row, 2)); + } if(select_from_chk->isChecked()) ref_flags |= Reference::SqlReferSelect; @@ -169,6 +216,7 @@ void ReferenceWidget::applyConfiguration(void) if(end_expr_chk->isChecked()) ref_flags |= Reference::SqlReferEndExpr; + emit s_closeRequested(); } catch(Exception &e) @@ -177,6 +225,45 @@ void ReferenceWidget::applyConfiguration(void) } } +void ReferenceWidget::handleColumn(int row) +{ + PgSqlType type = pgsqltype_wgt->getPgSQLType(); + columns_tab->setCellText(name_edt->text(), row, 0); + columns_tab->setCellText(*type, row, 1); + columns_tab->setCellText(alias_edt->text(), row, 2); + columns_tab->setRowData(QVariant::fromValue(type), row); + name_edt->clear(); + alias_edt->clear(); + name_edt->setFocus(); +} + +void ReferenceWidget::addColumn(int row) +{ + if(!name_edt->text().isEmpty()) + handleColumn(row); + else + columns_tab->removeRow(row); +} + +void ReferenceWidget::updateColumn(int row) +{ + if(!name_edt->text().isEmpty()) + handleColumn(row); +} + +void ReferenceWidget::editColumn(int row) +{ + name_edt->setText(columns_tab->getCellText(row, 0)); + alias_edt->setText(columns_tab->getCellText(row, 2)); + pgsqltype_wgt->setAttributes(columns_tab->getRowData(row).value(), model, + UserTypeConfig::AllUserTypes ^ UserTypeConfig::SequenceType, true, false); +} + +void ReferenceWidget::duplicateColumn(int src_row, int new_row) +{ + columns_tab->setRowData(columns_tab->getRowData(src_row), new_row); +} + void ReferenceWidget::selectReferenceType(void) { //Marks if the select reference type treats a reference to an object @@ -188,5 +275,5 @@ void ReferenceWidget::selectReferenceType(void) expression_txt->setEnabled(!ref_obj); expr_alias_edt->setEnabled(!ref_obj); view_def_chk->setVisible(!ref_obj); - properties_tbw->setTabEnabled(1, !ref_obj); + properties_tbw->setTabEnabled(1, !ref_obj && view_def_chk->isChecked()); } diff --git a/libpgmodeler_ui/src/referencewidget.h b/libpgmodeler_ui/src/referencewidget.h index 292ef768ed..f3f89e68f4 100644 --- a/libpgmodeler_ui/src/referencewidget.h +++ b/libpgmodeler_ui/src/referencewidget.h @@ -33,7 +33,7 @@ class ReferenceWidget : public QWidget, Ui::ReferenceWidget { private: Q_OBJECT - HintTextWidget *ref_alias_ht, *used_in_ht, *ref_object_ht; + HintTextWidget *ref_alias_ht, *used_in_ht, *ref_object_ht, *alias_ht; NumberedTextEditor *expression_txt; @@ -51,13 +51,15 @@ class ReferenceWidget : public QWidget, Ui::ReferenceWidget { Reference reference; + DatabaseModel *model; + + void handleColumn(int row); + public: explicit ReferenceWidget(QWidget *parent = 0); void setAttributes(Reference ref, unsigned ref_flags, DatabaseModel *model); - Reference getReference(void); - unsigned getReferenceFlags(void); public slots: @@ -65,6 +67,10 @@ class ReferenceWidget : public QWidget, Ui::ReferenceWidget { private slots: void selectReferenceType(void); + void addColumn(int row); + void updateColumn(int row); + void editColumn(int row); + void duplicateColumn(int src_row, int new_row); signals: void s_closeRequested(void); diff --git a/libpgmodeler_ui/ui/referencewidget.ui b/libpgmodeler_ui/ui/referencewidget.ui index 9dbb2336da..b252ccd749 100644 --- a/libpgmodeler_ui/ui/referencewidget.ui +++ b/libpgmodeler_ui/ui/referencewidget.ui @@ -497,8 +497,27 @@ - - + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Alias: + + + + + 0 @@ -518,34 +537,64 @@ - This is the name of the object in the PostgreSQL database. + This is a more friendly name for the column. When displaying the model in compact view this is the name shown for the column instead of its real name. If this field is empty the real name will be displayed anyway. - - + + 0 0 - - - 16777215 - 16777215 - - - - Alias: - + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + - - + + 0 @@ -565,7 +614,7 @@ - This is a more friendly name for the object. When displaying the model in compact view this is the name shown for the object instead of its real name. If this field is empty the real name will be displayed anyway. + This is the name of the object in the PostgreSQL database. @@ -580,6 +629,21 @@ + + properties_tbw + ref_type_cmb + ref_alias_edt + select_from_chk + from_where_chk + after_where_chk + end_expr_chk + view_def_chk + tab_alias_edt + col_alias_edt + expr_alias_edt + name_edt + alias_edt + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index fbe89c03da..14ea7a8500 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -17,7 +17,7 @@ - + diff --git a/schemas/xml/reference.sch b/schemas/xml/reference.sch index c8756fd63a..e06e91b913 100644 --- a/schemas/xml/reference.sch +++ b/schemas/xml/reference.sch @@ -18,8 +18,12 @@ $tb $br + $tb $tb $br -$tb $br + + %if {columns} %then {columns} %end + + $tb $br %else /> $br %end From cf72a23e683afc49b4ac73c35fe9fe1b2b52704e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 19 Nov 2018 18:14:12 -0300 Subject: [PATCH 240/425] Added support to view's columns import in DatabaseImportHelper --- libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libpgmodeler_ui/src/databaseimporthelper.cpp | 81 +++++++++++++++++--- 3 files changed, 72 insertions(+), 11 deletions(-) diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 77722f6069..4a1d6cb39e 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -458,6 +458,7 @@ namespace Attributes { SaveLastPosition=QString("save-last-position"), SaveRestoreGeometry=QString("save-restore-geometry"), Schema=QString("schema"), + SchemaOid=QString("schema-oid"), SearchPath=QString("search-path"), SecurityType=QString("security-type"), SelectExp=QString("select-exp"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 23122bb530..1582871633 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -467,6 +467,7 @@ namespace Attributes { SaveLastPosition, SaveRestoreGeometry, Schema, + SchemaOid, SearchPath, SecurityType, SelectExp, diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 2a236ada7c..ce06c0d4af 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -633,6 +633,7 @@ void DatabaseImportHelper::importDatabase(void) } } + dbmodel->setObjectsModified(); resetImportParameters(); } catch(Exception &e) @@ -687,7 +688,11 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) attribs[Attributes::Tablespace]=getDependencyObject(attribs[Attributes::Tablespace], ObjectType::Tablespace, false, auto_resolve_deps); if(attribs.count(Attributes::Schema)) + { + //Here we preserve the schema oid for latter usage in certain methods + attribs[Attributes::SchemaOid]=attribs[Attributes::Schema]; attribs[Attributes::Schema]=getDependencyObject(attribs[Attributes::Schema], ObjectType::Schema, false, auto_resolve_deps); + } /* Due to the object recreation mechanism there are some situations when pgModeler fails to recreate them due to the duplication of permissions. So, to avoid this problem we need to check if the OID of the @@ -1645,13 +1650,8 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) //Retrieving columns if they were not retrieved yet if(columns[attribs[Attributes::Oid].toUInt()].empty() && auto_resolve_deps) { - /* Since the schema name sometimes comes in form os tag - it is needed extract only the name from before retrieve the columns of the table */ - QString sch_name=attribs[Attributes::Schema]; - sch_name.replace(QRegExp(QString("(\\t)*(<)(schema)( )+(name)( )*(=)")), QString()); - sch_name.replace(QRegExp(QString("(/)(>)(\n)*")), QString()); - sch_name.replace('"', QString()); - sch_name=sch_name.trimmed(); + QString sch_name; + sch_name = getDependencyObject(attribs[Attributes::SchemaOid], ObjectType::Schema, true, auto_resolve_deps, false); retrieveTableColumns(sch_name, attribs[Attributes::Name]); } @@ -1868,6 +1868,10 @@ void DatabaseImportHelper::createView(attribs_map &attribs) { View *view=nullptr; Reference ref; + Column col; + unsigned type_oid = 0; + QString type_name, type_def, unknown_obj_xml, sch_name; + bool is_type_registered = false; try { @@ -1877,14 +1881,69 @@ void DatabaseImportHelper::createView(attribs_map &attribs) attribs[Attributes::Position]=schparser.getCodeDefinition(Attributes::Position, pos_attrib, SchemaParser::XmlDefinition); ref=Reference(attribs[Attributes::Definition], QString()); - ref.setDefinitionExpression(true); + ref.setDefinitionExpression(true); + + sch_name = getDependencyObject(attribs[Attributes::SchemaOid], ObjectType::Schema, true, auto_resolve_deps, false); + retrieveTableColumns(sch_name, attribs[Attributes::Name]); + + //Creating columns + for(auto &itr : columns[attribs[Attributes::Oid].toUInt()]) + { + col.setName(itr.second[Attributes::Name]); + type_oid=itr.second[Attributes::TypeOid].toUInt(); + + /* If the type has an entry on the types map and its OID is greater than system object oids, + * means that it's a user defined type, thus, there is the need to check if the type + * is registered. */ + if(types.count(type_oid)!=0 && type_oid > catalog.getLastSysObjectOID()) + { + /* Building the type name prepending the schema name in order to search it on + * the user defined types list at PgSQLType class */ + type_name=BaseObject::formatName(getObjectName(types[type_oid][Attributes::Schema], true), false); + type_name+=QString("."); + + if(types[type_oid][Attributes::Category] == ~CategoryType(CategoryType::Array)) + { + int dim = types[type_oid][Attributes::Name].count(QString("[]")); + QString aux_name = types[type_oid][Attributes::Name].remove(QString("[]")); + type_name+=BaseObject::formatName(aux_name, false); + type_name+=QString("[]").repeated(dim); + } + else + type_name+=BaseObject::formatName(types[type_oid][Attributes::Name], false); + + is_type_registered=PgSqlType::isRegistered(type_name, dbmodel); + } + else + { + is_type_registered=(types.count(type_oid)!=0); + type_name=itr.second[Attributes::Type]; + } + + /* Checking if the type used by the column exists (is registered), + * if not it'll be created when auto_resolve_deps is checked. The only exception here if for + * array types [] that will not be automatically created because they are derivated from + * the non-array type, this way, if the original type is created there is no need to create the array form */ + if(auto_resolve_deps && !is_type_registered && !type_name.contains(QString("[]"))) + { + type_def = getDependencyObject(itr.second[Attributes::TypeOid], ObjectType::Type); + unknown_obj_xml = UnkownObjectOidXml.arg(type_oid); + + /* If the type still doesn't exists means that the column maybe is referencing a domain + * this way pgModeler will try to retrieve the mentionend object */ + if(type_def==unknown_obj_xml) + type_def=getDependencyObject(itr.second[Attributes::TypeOid], ObjectType::Domain); + } + + col.setType(PgSqlType::parseString(type_name)); + ref.addColumn(&col); + } + attribs[Attributes::References]=ref.getXMLDefinition(); loadObjectXML(ObjectType::View, attribs); - view=dbmodel->createView(); + view = dbmodel->createView(); dbmodel->addView(view); - - retrieveTableColumns(view->getSchema()->getName(), view->getName()); } catch(Exception &e) { From 239d7ff0aba07dde84687c8b47e61e052b51f407 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 20 Nov 2018 10:02:54 -0300 Subject: [PATCH 241/425] Fixed sample models --- samples/oldsample.dbm | 6 ------ samples/pagila.dbm | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/samples/oldsample.dbm b/samples/oldsample.dbm index 9c1986dbd2..d60dd02458 100644 --- a/samples/oldsample.dbm +++ b/samples/oldsample.dbm @@ -1042,9 +1042,6 @@ CAUTION: Do not modify this file unless you know what you are doing. - - - - - - -
+
From 35c8c782b5d29d363d8546241e13a28e699d61f8 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 22 Nov 2018 11:10:48 -0300 Subject: [PATCH 242/425] Adding support to scene layers (WIP) --- libobjrenderer/src/baseobjectview.cpp | 18 ++ libobjrenderer/src/baseobjectview.h | 8 + libobjrenderer/src/objectsscene.cpp | 167 +++++++++++++- libobjrenderer/src/objectsscene.h | 19 ++ libpgmodeler/src/basegraphicobject.cpp | 12 + libpgmodeler/src/basegraphicobject.h | 9 + libpgmodeler_ui/libpgmodeler_ui.pro | 9 +- libpgmodeler_ui/res/icones/addlayer.png | Bin 0 -> 1606 bytes libpgmodeler_ui/res/icones/clearlayers.png | Bin 0 -> 1848 bytes libpgmodeler_ui/res/icones/dellayer.png | Bin 0 -> 1717 bytes libpgmodeler_ui/res/icones/layers.png | Bin 0 -> 1261 bytes libpgmodeler_ui/res/icones/movetolayer.png | Bin 0 -> 1700 bytes libpgmodeler_ui/res/resources.qrc | 5 + libpgmodeler_ui/src/layerswidget.cpp | 186 +++++++++++++++ libpgmodeler_ui/src/layerswidget.h | 66 ++++++ libpgmodeler_ui/src/mainwindow.cpp | 47 ++-- libpgmodeler_ui/src/mainwindow.h | 6 +- libpgmodeler_ui/src/modelwidget.cpp | 42 +++- libpgmodeler_ui/src/modelwidget.h | 8 + libpgmodeler_ui/ui/layerswidget.ui | 252 +++++++++++++++++++++ libpgmodeler_ui/ui/mainwindow.ui | 198 +++++++++------- libpgmodeler_ui/ui/sceneinfowidget.ui | 4 +- 22 files changed, 951 insertions(+), 105 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/addlayer.png create mode 100644 libpgmodeler_ui/res/icones/clearlayers.png create mode 100644 libpgmodeler_ui/res/icones/dellayer.png create mode 100644 libpgmodeler_ui/res/icones/layers.png create mode 100644 libpgmodeler_ui/res/icones/movetolayer.png create mode 100644 libpgmodeler_ui/src/layerswidget.cpp create mode 100644 libpgmodeler_ui/src/layerswidget.h create mode 100644 libpgmodeler_ui/ui/layerswidget.ui diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 1da06ae8c4..dcc556220a 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -603,6 +603,24 @@ double BaseObjectView::getFontFactor(void) return(font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize); } +void BaseObjectView::setLayer(unsigned layer) +{ + BaseGraphicObject *graph_obj = dynamic_cast(this->getSourceObject()); + + if(graph_obj) + graph_obj->setLayer(layer); +} + +unsigned BaseObjectView::getLayer(void) +{ + BaseGraphicObject *graph_obj = dynamic_cast(this->getSourceObject()); + + if(graph_obj) + return(graph_obj->getLayer()); + + return(0); +} + double BaseObjectView::getScreenDpiFactor(void) { QScreen *screen = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow())); diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index b9a3f45339..fe2a2717d0 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -113,6 +113,12 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { void setSelectionOrder(bool selected); + //! \brief Defines in which layer the object is visible + void setLayer(unsigned layer); + + //! \brief Returns the layer in which the object is visible + unsigned getLayer(void); + public: static constexpr double VertSpacing=2.0f, HorizSpacing=2.0f, @@ -203,6 +209,8 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { //! \brief Signal emmited whenever the width or height of the table changes void s_objectDimensionChanged(void); + + friend class ObjectsScene; }; #endif diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index eeffd69578..544e91ed90 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -32,6 +32,9 @@ bool ObjectsScene::invert_rangesel_trigger=false; ObjectsScene::ObjectsScene(void) { + layers.push_back(trUtf8("Default layer")); + active_layers.push_back(layers[0]); + moving_objs=move_scene=false; enable_range_sel=true; this->setBackgroundBrush(grid); @@ -119,6 +122,163 @@ ObjectsScene::~ObjectsScene(void) } } +QString ObjectsScene::formatLayerName(const QString &name) +{ + QString fmt_name = name; + unsigned idx = 1; + + while(layers.contains(fmt_name)) + fmt_name = QString("%1 %2").arg(name).arg(QString::number(idx++)); + + return(fmt_name); +} + +QString ObjectsScene::addLayer(const QString &name) +{ + if(name.isEmpty()) + return(QString()); + + QString fmt_name = formatLayerName(name); + layers.push_back(fmt_name); + + return(fmt_name); +} + +QString ObjectsScene::renameLayer(unsigned idx, const QString &name) +{ + if(name.isEmpty() || idx >= static_cast(layers.size())) + return (QString()); + + layers[idx] = formatLayerName(name); + + return(layers[idx]); +} + +void ObjectsScene::removeLayer(const QString &name) +{ + int idx = layers.indexOf(name); + + if(idx > 0) + { + layers.removeAll(name); + active_layers.removeAll(name); + moveObjectsToLayer(static_cast(idx), DefaultLayer); + } +} + +void ObjectsScene::removeLayers(void) +{ + QString def_layer = layers.at(DefaultLayer); + + layers.clear(); + layers.push_back(def_layer); + active_layers.clear(); + active_layers.push_back(def_layer); + + updateActiveLayers(); +} + +void ObjectsScene::setActiveLayers(QStringList act_layers) +{ + BaseObjectView *obj_view = nullptr; + QList layers_idxs; + int idx = -1; + + active_layers.clear(); + + for(auto &layer : act_layers) + { + idx = layers.indexOf(layer); + + if(idx >= 0) + { + layers_idxs.push_back(idx); + active_layers.push_back(layer); + } + } + + if(!layers_idxs.isEmpty()) + { + bool is_in_layer = false; + + for(auto &item : this->items()) + { + obj_view = dynamic_cast(item); + + if(obj_view && !obj_view->parentItem()) + { + unsigned l = obj_view->getLayer(); + is_in_layer = layers_idxs.contains(obj_view->getLayer()); + + if(!obj_view->isVisible() && is_in_layer) + obj_view->setVisible(true); + else if(obj_view->isVisible() && !is_in_layer) + obj_view->setVisible(false); + } + } + } + else + { + for(auto &item : this->items()) + { + obj_view = dynamic_cast(item); + + if(obj_view && !obj_view->parentItem()) + obj_view->setVisible(false); + } + } +} + +void ObjectsScene::moveObjectsToLayer(unsigned old_layer, unsigned new_layer) +{ + BaseObjectView *obj_view = nullptr; + unsigned total_layers = static_cast(layers.size()); + + if(old_layer == new_layer || old_layer >= total_layers || new_layer >= total_layers) + return; + + for(auto &item : this->items()) + { + obj_view = dynamic_cast(item); + + if(obj_view && !obj_view->parentItem() && obj_view->getLayer() == old_layer) + { + obj_view->setLayer(new_layer); + obj_view->setVisible(isLayerActive(layers[new_layer])); + } + } +} + +bool ObjectsScene::isLayerActive(const QString &name) +{ + return(active_layers.contains(name)); +} + +QStringList ObjectsScene::getActiveLayers(void) +{ + return(active_layers); +} + +QStringList ObjectsScene::getLayers(void) +{ + return(layers); +} + +unsigned ObjectsScene::getLayerId(const QString &name) +{ + int idx = layers.contains(name); + + if(idx < 0) + return(DefaultLayer); + + return(static_cast(idx)); +} + +void ObjectsScene::updateActiveLayers(void) +{ + setActiveLayers(active_layers); +} + void ObjectsScene::setEnableCornerMove(bool enable) { ObjectsScene::corner_move=enable; @@ -423,8 +583,7 @@ void ObjectsScene::addItem(QGraphicsItem *item) BaseObjectView *obj=dynamic_cast(item); if(rel) - connect(rel, SIGNAL(s_relationshipModified(BaseGraphicObject*)), - this, SIGNAL(s_objectModified(BaseGraphicObject*))); + connect(rel, SIGNAL(s_relationshipModified(BaseGraphicObject*)), this, SIGNAL(s_objectModified(BaseGraphicObject*))); else if(tab) { connect(tab, SIGNAL(s_childObjectSelected(TableObject*)), this, SLOT(emitChildObjectSelection(TableObject*))); @@ -435,8 +594,8 @@ void ObjectsScene::addItem(QGraphicsItem *item) if(obj) { - connect(obj, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), - this, SLOT(emitObjectSelection(BaseGraphicObject*,bool))); + connect(obj, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(emitObjectSelection(BaseGraphicObject*,bool))); + obj->setLayer(DefaultLayer); } QGraphicsScene::addItem(item); diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 2047a5cb85..846bd62e86 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -37,6 +37,9 @@ class ObjectsScene: public QGraphicsScene { private: Q_OBJECT + //! \brief Holds the names of the layers on the scene used to separate in the objects on the canvas + QStringList layers, active_layers; + vector removed_objs; //! \brief Indicates if the corner move is enabled for the scene @@ -122,6 +125,8 @@ class ObjectsScene: public QGraphicsScene { exceeds the scene's size limits */ void adjustScenePositionOnKeyEvent(int key); + QString formatLayerName(const QString &name); + protected: //! \brief Brush used to draw the grid over the scene static QBrush grid; @@ -139,9 +144,23 @@ class ObjectsScene: public QGraphicsScene { void blockItemsSignals(bool block); public: + static constexpr unsigned DefaultLayer = 0; + ObjectsScene(void); ~ObjectsScene(void); + QString addLayer(const QString &name); + QString renameLayer(unsigned idx, const QString &name); + void removeLayer(const QString &name); + void removeLayers(void); + void setActiveLayers(QStringList act_layers); + void moveObjectsToLayer(unsigned old_layer, unsigned new_layer); + bool isLayerActive(const QString &name); + QStringList getActiveLayers(void); + QStringList getLayers(void); + unsigned getLayerId(const QString &name); + void updateActiveLayers(void); + static void setEnableCornerMove(bool enable); static void setInvertRangeSelectionTrigger(bool invert); static bool isCornerMoveEnabled(void); diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index f7426abf91..a2efef32e9 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -27,6 +27,7 @@ BaseGraphicObject::BaseGraphicObject(void) attributes[Attributes::Position]=QString(); attributes[Attributes::FadedOut]=QString(); receiver_object=nullptr; + layer = 0; } void BaseGraphicObject::setProtected(bool value) @@ -121,3 +122,14 @@ bool BaseGraphicObject::isGraphicObject(ObjectType type) return(type==ObjectType::Table || type==ObjectType::View || type==ObjectType::Relationship || type==ObjectType::BaseRelationship || type==ObjectType::Textbox || type==ObjectType::Schema); } + +void BaseGraphicObject::setLayer(unsigned layer) +{ + setCodeInvalidated(this->layer != layer); + this->layer = layer; +} + +unsigned BaseGraphicObject::getLayer(void) +{ + return(layer); +} diff --git a/libpgmodeler/src/basegraphicobject.h b/libpgmodeler/src/basegraphicobject.h index f0d9440fbb..bc6459a768 100644 --- a/libpgmodeler/src/basegraphicobject.h +++ b/libpgmodeler/src/basegraphicobject.h @@ -55,6 +55,9 @@ class BaseGraphicObject: public QObject, public BaseObject { it in the QGraphcisScene) */ QObject *receiver_object; + //! \brief This attributes holds the layer in which the object is visible. + unsigned layer; + protected: /*! \brief Method that defines the objects position attributes used in generation of XML code definition */ @@ -112,6 +115,12 @@ class BaseGraphicObject: public QObject, public BaseObject { //! \brief Returns if the passed type one that has a graphical representation (table, view, schema, relationship or textbox) static bool isGraphicObject(ObjectType type); + //! \brief Defines in which layer the object is visible + void setLayer(unsigned layer); + + //! \brief Returns the layer in which the object is visible + unsigned getLayer(void); + signals: //! \brief Signal emitted when the user calls the setModified() method void s_objectModified(void); diff --git a/libpgmodeler_ui/libpgmodeler_ui.pro b/libpgmodeler_ui/libpgmodeler_ui.pro index 579a3447d4..60f03cc545 100644 --- a/libpgmodeler_ui/libpgmodeler_ui.pro +++ b/libpgmodeler_ui/libpgmodeler_ui.pro @@ -116,7 +116,8 @@ SOURCES += src/mainwindow.cpp \ src/referencewidget.cpp \ src/sqlexecutionhelper.cpp \ src/elementstablewidget.cpp \ - src/elementwidget.cpp + src/elementwidget.cpp \ + src/layerswidget.cpp HEADERS += src/mainwindow.h \ @@ -220,7 +221,8 @@ HEADERS += src/mainwindow.h \ src/referencewidget.h \ src/sqlexecutionhelper.h \ src/elementstablewidget.h \ - src/elementwidget.h + src/elementwidget.h \ + src/layerswidget.h FORMS += ui/mainwindow.ui \ ui/textboxwidget.ui \ @@ -304,7 +306,8 @@ FORMS += ui/mainwindow.ui \ ui/policywidget.ui \ ui/objectstablewidget.ui \ ui/referencewidget.ui \ - ui/elementwidget.ui + ui/elementwidget.ui \ + ui/layerswidget.ui unix|windows: LIBS += -L$$OUT_PWD/../libobjrenderer/ -lobjrenderer \ -L$$OUT_PWD/../libpgconnector/ -lpgconnector \ diff --git a/libpgmodeler_ui/res/icones/addlayer.png b/libpgmodeler_ui/res/icones/addlayer.png new file mode 100644 index 0000000000000000000000000000000000000000..b516c27070ec933e13cbd63029f196c06da52ddd GIT binary patch literal 1606 zcmV-M2D$l(P)Q$>|3MXD+_ zX_ZR-5>da>A5qn+3aMK44+(#w)=}0ZC@oDyAULE%HU?q9AqFoo_8KP!f8(8a8wmc|kfthD)OHyCpOP#U&Yz>8-bE)ArU&)i@BAmIHc0L;gmQ%z;1 zvBZv*Hm`SsVa$zK14_Y`3V7*^!^Js3$jy>3j>Qu9udq3k@~Jl@x4J6rmtu1{G@o_2 zke(fcd}8uss%hE6SmM5AHZ7OHl$+OnHZ6D>>K4K)?>fADDV=;K@o^9{_cR|%rkcL6 z$WQ)uFPH{|On=M;#8h$xSc z7g{dRdST#}N>H=7l!xmUlW~0z>te9~J%$>ht|^`pR>6Hn(4ceVQ_Sks`3abSZkYbpv&b*XWy%TXe?_Kpyw{NYwQTHBk? z?tbVAKmi$G=sL?L5USdB=)KizmM+*)Gmp3XvX}yvWzzo6IeNM;BRSGwuKFXt+46lH zFN!|9_p%Dw>;ihHIHLy7u&Y5EQ4b$ zX9$P$sr_nA&h#H2vWbL?X}{7zRrHI97_@z$d2oFkJI{>ElZU#F|9W#dpe-P@{+CDk zH`cF;HdaS)T&OR%Fa*w=>SO!r`IJP9eHrGc!;`~-lQ5Krdh!U;opezg)AXVf(6iwDnG4+SaVfpESA|FMggvyI{)uB0?!eXsr+t zJUrsXB`o-ER|9;r;W~+<&KQFq4sQO)Szzqk)AW@MYZ4D{tl;Ry@u|eKF)-quqiV@1 z>dL-^tGy|mxF|+5qYP$;D6$I359Q-(7o|0>b`cRy_H>Xu{g3t5_2kw!_B3tUP?gwO zTTV;&7~pp;WcJ!Cr5VePbFjaKYu+RvXaR)+1XBzgvS>6O8nmF$gba&`%qStl!UC*2 z9@+cyJ#}mE-C0|~WY%Tl;-Z{7U*C8k!(N8!$lYk|;c6F8dw5zgsWY4yIm?Q|r5IWQ z1{6vwvbc1rLDYEG5}>Hy+kYGJlp^aYl+L~DhYLoCt#}K^xv@tIMW5;6hg%+{b*O{8 zi`Su1^z2aGn@|Cn8#- zv5gQ)G=gYgAUN>6;L-rrZTh(}gT0KP^F}&)JMpwf=hZGmBtMuN3g$@g!=i5o0DZ$p zrU4k4%M+VkOC7XCd=KZ_`Cf4ByE7RO{yQPF0R33}8xa9^FnJKI=>Px#07*qoM6N<$ Ef)oz_DgXcg literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/icones/clearlayers.png b/libpgmodeler_ui/res/icones/clearlayers.png new file mode 100644 index 0000000000000000000000000000000000000000..01f76cea5497b09e4bac931641640fe21af343fe GIT binary patch literal 1848 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 LNkvXXu0mjfk>5FZ literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/icones/layers.png b/libpgmodeler_ui/res/icones/layers.png new file mode 100644 index 0000000000000000000000000000000000000000..1028e204fe6223d7565d0b6bc5f3ee07995e437b GIT binary patch literal 1261 zcmVV6vzL!_qKGP6fgoU2o!O$E@V^)NC7vKMdH9<@r98rOZc=cnPf4`_Jw6z#ut-q zS!Bufjm$63p%x~xV3x?_O&M4w4txPx6k5TIDjNuW-Ffb9L3xp)+sG16a=7KT_nhDJ zKj%Ep<*>%aJp=eZ00@U0Mox0PyjXmITmB&*bD#gS$5sDjQT%@T=zbaizM{@r8y~GU z?$;@B&H~6*0PxbEU0UE|pA#eFcGJm79qUAs|0bH zAcj|fST3HJJXx(a?tMXlW~(Huhd_@kG7WHiHjfS$BIp8sA_k3NGDb=pI<{Z z6+Ryxl|9%&c<7lx4BkJR(iE`1;?Q1ch~)eYNM{!!=lY?b>X1Gwx2P~(jb8gq(6wKx z7t+*9ob9nwAGI~0sj?c<4#<|`Ah)p43i2>k3UWcV@0)M4Gt>7Jrp2Ipbb3{X&>{do zL`GaF8n2Gy;;-g2-c#?q4e2F?HR04FXMwD=ruOBWbYoer7VX1RbBUiufdGghF$~As zEcm6P$K*XxzW6Kj!TvnT#Ohw7>B5em7NfFoNAvktdRGVBh~sxt9`T$tn0RZP660i9G{YbAZ1A X3E$$crP{FW00000NkvXXu0mjfwTEZ1 literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/icones/movetolayer.png b/libpgmodeler_ui/res/icones/movetolayer.png new file mode 100644 index 0000000000000000000000000000000000000000..f1ed6cc39bf4b0a401081b8ca09fee866f989b1c GIT binary patch literal 1700 zcmV;V23z@wP)TVK2h z(7y};`I**Wb8&&kx2eX#p#Vs;5HKxhEQhzxCm6gOZh2)x*>?bAJ_O`vT7%7{1s>nV z8VBzOK$2!>YyqYT50=B;^9lNAAt7c0ukd($8}4*)IGA$1B<2=Z(@KS6O&PRyCFl!J zPeOblcuTN(NwLTG@Dc~d20<1x$9_637#6H9hIcL`xG)%QdByjiByN7E{B%pO`L2=_ z_=(R!mOzzLb}l5YgPV{vQudyr6p3>e!!0{+B9Z<+`KNn>&39LNeCroEI2BHTIu+P` ztdI7-%eNGQ`icU!tgb-QQzVvqV1G}7Gri%KS2x}uA=1CRuF~WCc9nxqFQ>lNA;X`K z^pcgcfU2UrTgq?$=OavxMR?+yl_ZRmSLzDj@BRdz_TKP>0F-Cj`r8_+y=xz;Qb^d& zkpy%EM^V)X)!s5J>qd^xT3l?+ghn*3j>lPA=Ek(2b;xkguXD6J^zQGQN}B|5+s_XU zj~SMQVWnay5VnQhfl?}p&LgDETdZ*6h9<5H#6pk?tt#Rg~&H4nDpZCDcFA8-92DOYVgw zE?2hO;a*s(kxDRJKrY|}l-i#i{II&F{Eo(&Jlewv(7(mndmiV=*#k^yza_&}H!CoJ zX<8VDiD6pQdmJ3Y39Xqb3B z#){Q7=(>qz!3vK;TgMRXr@BL@f3v0xND4q*`Rk*XRyEY-tywb0-Xm+-xM~ZkqM|W@ zW=s$>$Iz`flX`?<%}80!Ka8D<7nmtx*5krPbu1hf!JwuQzJ9mjgm3U&UdyEom@9# zhp{XWAM_&IxtYoWfh@~;K$ZY<)hw#M`)cK$A3XAW#i(`(NhlbWfnjMR%{ZDl$&hw| zOYtsp)nejToP5^VfMkAeRxQ+eTpTzPrsLG{{TzI8r(FRpAOZvwAbS5xuCF%U>#G=w z`H@h_ca<}6#ZUjx1tgr5lov9r^^)(bWY9mtz`$lyd0k4nvt-1%D>{#^C?z8+WBtkO z+b#2NPyNImQj$Pa0TS*4XQSe@Fw7*`QX#D;|H8$q>&bNeh-}4&QP_`L^)S>w$<=Ew zaC?5^+-iZHlm0k7`9L*Jm-FF|l-G1~&-btQ0>u{1DpS%?WfyOLumj0)oU9BN0*D!- z+EJC`X?NY#Tcf^tyClnI2M>-^Qv-$5WXYgwPyXVDG~~xXbERw!i*A|jIqSC zgN3;T*LCz!kH*=vom4J(ov#$t&wKc^03ifV-nWVy!E0e)NX~+=MB4*rtkSUBmx8kkOkbfVl&m7Ubz2_!M^UE zKlnmV+XSXc^%SU)W{tFSJ-zA8aV3FCVK*TeP--{0avuN1%4b92{=Ppp1@_q@m2DtB z&FWupZq7F>stqFBfabbidCOw4s1*DpI({`^Bu57fJHId%p uZ9C=qsT(*Hfb8LZW7{uW&In;q_OL;{GzV_0000icones/resizecols.png icones/collapse.png icones/pagination.png + icones/layers.png + icones/addlayer.png + icones/dellayer.png + icones/clearlayers.png + icones/movetolayer.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/layerswidget.cpp b/libpgmodeler_ui/src/layerswidget.cpp new file mode 100644 index 0000000000..5582d04713 --- /dev/null +++ b/libpgmodeler_ui/src/layerswidget.cpp @@ -0,0 +1,186 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "layerswidget.h" +#include + +LayersWidget::LayersWidget(QWidget *parent) : QWidget(parent) +{ + setupUi(this); + setModel(nullptr); + curr_item = nullptr; + + layers_lst->installEventFilter(this); + + connect(hide_tb, SIGNAL(clicked(bool)), this, SIGNAL(s_visibilityChanged(bool))); + connect(layers_lst, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(startLayerRenaming(QListWidgetItem*))); + connect(layers_lst, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(updateActiveLayers())); + connect(layers_lst, SIGNAL(itemSelectionChanged()), this, SLOT(finishLayerRenaming())); + connect(layers_lst, SIGNAL(itemSelectionChanged()), this, SLOT(enableButtons())); + connect(add_tb, SIGNAL(clicked(bool)), this, SLOT(addLayer())); + connect(remove_tb, SIGNAL(clicked(bool)), this, SLOT(removeLayer(bool))); + connect(remove_all_tb, &QToolButton::clicked, [&](){ + removeLayer(true); + }); +} + +void LayersWidget::setLayers(const QStringList &layers) +{ + QListWidgetItem *item = nullptr; + QStringList active_layers = model->scene->getActiveLayers(); + + for(auto &layer : layers) + { + item = new QListWidgetItem(layer); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setCheckState(active_layers.contains(layer) ? Qt::Checked : Qt::Unchecked); + layers_lst->addItem(item); + } +} + +bool LayersWidget::eventFilter(QObject *watched, QEvent *event) +{ + if(watched == layers_lst && event->type() == QEvent::KeyPress) + { + QKeyEvent *k_event = dynamic_cast(event); + + if(curr_item && (k_event->key() == Qt::Key_Enter || k_event->key() == Qt::Key_Return)) + finishLayerRenaming(); + } + + return(false); +} + +void LayersWidget::updateActiveLayers(void) +{ + QStringList active_layers; + QListWidgetItem *item = nullptr; + + for(int row = 0; row < layers_lst->count(); row++) + { + item = layers_lst->item(row); + + if(item->checkState() == Qt::Checked) + active_layers.push_back(item->text()); + } + + model->scene->setActiveLayers(active_layers); +} + +void LayersWidget::removeLayer(bool clear) +{ + QListWidgetItem *item = nullptr; + Messagebox msg_box; + + if(clear) + msg_box.show(trUtf8("This action will delete all layers (except the default one) and the objects in them will be moved to the default layer. Do you want to proceed?"), + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); + else + msg_box.show(trUtf8("Delete the selected layer will cause objects in it to be moved to the default layer. Do you want to proceed?"), + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); + + if(msg_box.result() == QDialog::Accepted) + { + if(clear) + { + model->scene->removeLayers(); + + while(layers_lst->count() > 1) + { + item = layers_lst->takeItem(layers_lst->count() - 1); + delete(item); + } + } + else if(layers_lst->currentRow() > 0) + { + item = layers_lst->currentItem(); + model->scene->removeLayer(item->text()); + layers_lst->takeItem(layers_lst->currentRow()); + delete(item); + } + + layers_lst->setCurrentRow(-1); + enableButtons(); + } +} + +void LayersWidget::enableButtons(void) +{ + remove_tb->setEnabled(layers_lst->currentRow() > 0); + remove_all_tb->setEnabled(layers_lst->count() > 1); +} + +void LayersWidget::setVisible(bool value) +{ + QWidget::setVisible(value); + emit s_visibilityChanged(value); +} + +void LayersWidget::setModel(ModelWidget *model) +{ + bool enable = model != nullptr; + + this->model = model; + layers_lst->clear(); + add_tb->setEnabled(enable); + + if(model) + setLayers(model->scene->getLayers()); +} + +QListWidgetItem *LayersWidget::addLayer(const QString &name) +{ + QListWidgetItem *item = nullptr; + QString aux_name = name.isEmpty() ? trUtf8("New layer") : name; + + aux_name = model->scene->addLayer(aux_name); + item = new QListWidgetItem(aux_name); + item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setCheckState(Qt::Unchecked); + layers_lst->addItem(item); + enableButtons(); + + return(item); +} + +void LayersWidget::startLayerRenaming(QListWidgetItem *item) +{ + if(layers_lst->item(0) != item) + { + curr_item = item; + curr_text = item->text(); + layers_lst->openPersistentEditor(item); + } +} + +void LayersWidget::finishLayerRenaming(void) +{ + if(curr_item) + { + layers_lst->closePersistentEditor(curr_item); + + if(curr_item->text().isEmpty()) + curr_item->setText(curr_text); + else + curr_item->setText(model->scene->renameLayer(layers_lst->currentRow(), curr_item->text())); + + curr_item = nullptr; + curr_text.clear(); + } +} + diff --git a/libpgmodeler_ui/src/layerswidget.h b/libpgmodeler_ui/src/layerswidget.h new file mode 100644 index 0000000000..e484f48d26 --- /dev/null +++ b/libpgmodeler_ui/src/layerswidget.h @@ -0,0 +1,66 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2018 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler_ui +\class LayersWidget +\brief Implements the widget that allows the user to handle scene layers +*/ + +#ifndef LAYERS_WIDGET_H +#define LAYERS_WIDGET_H + +#include +#include "ui_layerswidget.h" +#include "modelwidget.h" + +class LayersWidget : public QWidget, Ui::LayersWidget { + private: + Q_OBJECT + + ModelWidget *model; + + QListWidgetItem *curr_item; + + QString curr_text; + + void setLayers(const QStringList &layers); + + bool eventFilter(QObject *watched, QEvent *event); + + public: + explicit LayersWidget(QWidget *parent = nullptr); + + void setModel(ModelWidget *model); + + private slots: + QListWidgetItem *addLayer(const QString &name = QString()); + void startLayerRenaming(QListWidgetItem *item); + void finishLayerRenaming(void); + void updateActiveLayers(void); + void removeLayer(bool clear = false); + void enableButtons(void); + + public slots: + void setVisible(bool value); + + signals: + void s_visibilityChanged(bool); +}; + +#endif diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index e8204dac3c..d68ce33f33 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -37,11 +37,14 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par pending_op=NoPendingOp; central_wgt=nullptr; - canvas_info_wgt = new SceneInfoWidget(this); - QHBoxLayout *hbox = new QHBoxLayout(canvas_info_parent); - hbox->addWidget(canvas_info_wgt); + layers_wgt = new LayersWidget(this); + layers_wgt->setVisible(false); + + scene_info_wgt = new SceneInfoWidget(this); + QHBoxLayout *hbox = new QHBoxLayout(scene_info_parent); + hbox->addWidget(scene_info_wgt); hbox->setContentsMargins(4,4,4,4); - canvas_info_parent->setLayout(hbox); + scene_info_parent->setLayout(hbox); QToolButton *tool_btn = qobject_cast(control_tb->widgetForAction(action_arrange_objects)); tool_btn->setMenu(&arrange_menu); @@ -323,6 +326,9 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(model_valid_wgt, SIGNAL(s_fixApplied()), this, SLOT(removeOperations()), Qt::QueuedConnection); connect(model_valid_wgt, SIGNAL(s_graphicalObjectsUpdated()), model_objs_wgt, SLOT(updateObjectsView()), Qt::QueuedConnection); + connect(layers_btn, SIGNAL(toggled(bool)), this, SLOT(toggleLayersWidget(bool))); + connect(layers_wgt, SIGNAL(s_visibilityChanged(bool)), layers_btn, SLOT(setChecked(bool))); + connect(&tmpmodel_save_timer, SIGNAL(timeout()), this, SLOT(saveTemporaryModels())); models_tbw_parent->resize(QSize(models_tbw_parent->maximumWidth(), models_tbw_parent->height())); @@ -593,6 +599,8 @@ void MainWindow::resizeEvent(QResizeEvent *) action_about->setChecked(false); action_donate->setChecked(false); action_update_found->setChecked(false); + + toggleLayersWidget(layers_wgt->isVisible()); } void MainWindow::closeEvent(QCloseEvent *event) @@ -761,7 +769,7 @@ void MainWindow::saveTemporaryModels(void) if(count > 0) { QApplication::setOverrideCursor(Qt::WaitCursor); - canvas_info_parent->setVisible(false); + scene_info_parent->setVisible(false); bg_saving_wgt->setVisible(true); bg_saving_pb->setValue(0); bg_saving_wgt->repaint(); @@ -777,7 +785,7 @@ void MainWindow::saveTemporaryModels(void) bg_saving_pb->setValue(100); bg_saving_wgt->setVisible(false); - canvas_info_parent->setVisible(true); + scene_info_parent->setVisible(true); QApplication::restoreOverrideCursor(); } @@ -1001,6 +1009,7 @@ void MainWindow::showMainMenu(void) void MainWindow::setCurrentModel(void) { + layers_wgt->setVisible(false); models_tbw->setVisible(models_tbw->count() > 0); action_design->setEnabled(models_tbw->count() > 0); @@ -1032,7 +1041,7 @@ void MainWindow::setCurrentModel(void) QToolButton *tool_btn=nullptr; QList btns; QFont font; - + layers_wgt->setModel(current_model); current_model->setFocus(Qt::OtherFocusReason); current_model->cancelObjectAddition(); @@ -1098,10 +1107,10 @@ void MainWindow::setCurrentModel(void) connect(current_model, SIGNAL(s_zoomModified(double)), this, SLOT(updateToolsState(void)), Qt::UniqueConnection); connect(current_model, SIGNAL(s_objectModified(void)), this, SLOT(updateModelTabName(void)), Qt::UniqueConnection); - connect(current_model, SIGNAL(s_sceneInteracted(BaseObjectView*)), canvas_info_wgt, SLOT(updateSelectedObject(BaseObjectView*)), Qt::UniqueConnection); - connect(current_model, SIGNAL(s_sceneInteracted(int,QRectF)), canvas_info_wgt, SLOT(updateSelectedObjects(int,QRectF)), Qt::UniqueConnection); - connect(current_model, SIGNAL(s_sceneInteracted(QPointF)), canvas_info_wgt, SLOT(updateMousePosition(QPointF)), Qt::UniqueConnection); - connect(current_model, SIGNAL(s_zoomModified(double)), canvas_info_wgt, SLOT(updateSceneZoom(double)), Qt::UniqueConnection); + connect(current_model, SIGNAL(s_sceneInteracted(BaseObjectView*)), scene_info_wgt, SLOT(updateSelectedObject(BaseObjectView*)), Qt::UniqueConnection); + connect(current_model, SIGNAL(s_sceneInteracted(int,QRectF)), scene_info_wgt, SLOT(updateSelectedObjects(int,QRectF)), Qt::UniqueConnection); + connect(current_model, SIGNAL(s_sceneInteracted(QPointF)), scene_info_wgt, SLOT(updateMousePosition(QPointF)), Qt::UniqueConnection); + connect(current_model, SIGNAL(s_zoomModified(double)), scene_info_wgt, SLOT(updateSceneZoom(double)), Qt::UniqueConnection); connect(action_alin_objs_grade, SIGNAL(triggered(bool)), this, SLOT(setGridOptions(void)), Qt::UniqueConnection); connect(action_show_grid, SIGNAL(triggered(bool)), this, SLOT(setGridOptions(void)), Qt::UniqueConnection); @@ -1113,8 +1122,8 @@ void MainWindow::setCurrentModel(void) if(action_overview->isChecked()) overview_wgt->show(current_model); - canvas_info_wgt->updateMousePosition(QPointF(0,0)); - canvas_info_wgt->updateSceneZoom(current_model->getCurrentZoom()); + scene_info_wgt->updateMousePosition(QPointF(0,0)); + scene_info_wgt->updateSceneZoom(current_model->getCurrentZoom()); current_model->emitSceneInteracted(); } else @@ -1926,6 +1935,8 @@ void MainWindow::changeCurrentView(bool checked) { QAction *curr_act=qobject_cast(sender()); + layers_wgt->setVisible(false); + if(checked) { bool enable=(curr_act==action_design); @@ -2062,3 +2073,13 @@ void MainWindow::toggleCompactView(void) QApplication::restoreOverrideCursor(); } + +void MainWindow::toggleLayersWidget(bool show) +{ + QPoint tb_pos = mapTo(this, tool_btns_bar_wgt->pos()), + btn_pos = mapTo(this, layers_btn->pos()); + + layers_wgt->move(btn_pos.x() + general_tb->width(), + tb_pos.y() - layers_wgt->height() * 0.80); + layers_wgt->setVisible(show); +} diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 93f9c97827..b3f86b6fd4 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -50,6 +50,7 @@ #include "configurationform.h" #include "donatewidget.h" #include "sceneinfowidget.h" +#include "layerswidget.h" class MainWindow: public QMainWindow, public Ui::MainWindow { private: @@ -79,7 +80,9 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { DonateWidget *donate_wgt; - SceneInfoWidget *canvas_info_wgt; + SceneInfoWidget *scene_info_wgt; + + LayersWidget *layers_wgt; /*! \brief Widget positioned on the center of main window that contains some basic operations like create new model, open a file, restore session */ @@ -291,6 +294,7 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { void restoreTemporaryModels(void); void arrangeObjects(void); void toggleCompactView(void); + void toggleLayersWidget(bool show); }; #endif diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 633c426226..c856fd746d 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -266,6 +266,9 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) action_moveto_schema=new QAction(QIcon(PgModelerUiNs::getIconPath("movetoschema")), trUtf8("Move to schema"), this); action_moveto_schema->setMenu(&schemas_menu); + action_moveto_layer=new QAction(QIcon(PgModelerUiNs::getIconPath("movetolayer")), trUtf8("Move to layer"), this); + action_moveto_layer->setMenu(&layers_menu); + action_set_tag=new QAction(QIcon(PgModelerUiNs::getIconPath("tag")), trUtf8("Set tag"), this); action_set_tag->setMenu(&tags_menu); @@ -1968,6 +1971,20 @@ void ModelWidget::moveToSchema(void) } } +void ModelWidget::moveToLayer(void) +{ + QAction *act = dynamic_cast(sender()); + BaseGraphicObject *graph_obj = nullptr; + + for(auto &obj : selected_objects) + { + graph_obj = dynamic_cast(obj); + graph_obj->setLayer(scene->getLayerId(act->text())); + } + + scene->updateActiveLayers(); +} + void ModelWidget::changeOwner(void) { QAction *act=dynamic_cast(sender()); @@ -3136,9 +3153,10 @@ void ModelWidget::enableModelActions(bool value) void ModelWidget::configureSubmenu(BaseObject *object) { + QAction *act=nullptr; vector sel_objs; ObjectType obj_type=ObjectType::BaseObject; - bool tab_or_view=false, accepts_owner=false, accepts_schema=false; + bool tab_or_view=false, is_graph_obj = false, accepts_owner=false, accepts_schema=false; if(object) sel_objs.push_back(object); @@ -3154,6 +3172,9 @@ void ModelWidget::configureSubmenu(BaseObject *object) if(!tab_or_view) tab_or_view=(obj_type==ObjectType::Table || obj_type==ObjectType::View); + if(!is_graph_obj) + is_graph_obj = BaseGraphicObject::isGraphicObject(obj_type); + if(!accepts_owner) accepts_owner=obj->acceptsOwner(); @@ -3168,7 +3189,6 @@ void ModelWidget::configureSubmenu(BaseObject *object) { if(accepts_owner || accepts_schema) { - QAction *act=nullptr; vector obj_list; map act_map; QStringList name_list; @@ -3240,6 +3260,21 @@ void ModelWidget::configureSubmenu(BaseObject *object) } } + // Configuring the layers menu + if(is_graph_obj) + { + layers_menu.clear(); + + for(auto &layer : scene->getLayers()) + { + act = layers_menu.addAction(layer); + connect(act, SIGNAL(triggered(bool)), this, SLOT(moveToLayer())); + + //if(sel_objs.size() == 1 && scene->getLayer()) + //act->setEnabled(); + } + } + //Display the quick rename action is a single object is selected if(object && obj_type!=ObjectType::Cast) { @@ -3256,6 +3291,9 @@ void ModelWidget::configureSubmenu(BaseObject *object) if(tab_or_view) quick_actions_menu.addAction(action_set_tag); + if(is_graph_obj) + quick_actions_menu.addAction(action_moveto_layer); + if(object && Permission::acceptsPermission(obj_type)) { quick_actions_menu.addAction(action_edit_perms); diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index 4aceed18f4..410330a6a1 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -102,6 +102,9 @@ class ModelWidget: public QWidget { //! \brief Stores the tags used by the "set tag" operation tags_menu, + //! \brief Stores the layers used by the "move to layer" operation + layers_menu, + break_rel_menu, fade_menu, @@ -229,6 +232,7 @@ class ModelWidget: public QWidget { *action_break_rel_line, *action_remove_rel_points, *action_set_tag, + *action_moveto_layer, *action_disable_sql, *action_enable_sql, *action_duplicate, @@ -396,6 +400,9 @@ class ModelWidget: public QWidget { //! \brief Move the selected object to a schema (selectable via menu) void moveToSchema(void); + //! \brief Move the selected object to a layer (selectable via menu) + void moveToLayer(void); + //! \brief Quickly changes the object's owner via popup menu void changeOwner(void); @@ -523,6 +530,7 @@ class ModelWidget: public QWidget { friend class DatabaseImportForm; friend class ObjectFinderWidget; friend class NewObjectOverlayWidget; + friend class LayersWidget; }; #endif diff --git a/libpgmodeler_ui/ui/layerswidget.ui b/libpgmodeler_ui/ui/layerswidget.ui new file mode 100644 index 0000000000..855cd5a63e --- /dev/null +++ b/libpgmodeler_ui/ui/layerswidget.ui @@ -0,0 +1,252 @@ + + + LayersWidget + + + + 0 + 0 + 448 + 165 + + + + Form + + + true + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 165 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Remove All + + + Delete all + + + + :/icones/icones/clearlayers.png:/icones/icones/clearlayers.png + + + + 22 + 22 + + + + Shift+Del + + + Qt::ToolButtonTextBesideIcon + + + false + + + + + + + true + + + + + + + + 20 + 20 + + + + + 20 + 20 + + + + Hide this widget + + + ... + + + + :/icones/icones/fechar1.png:/icones/icones/fechar1.png + + + true + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 20 + 20 + + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Add Item + + + Add + + + + :/icones/icones/addlayer.png:/icones/icones/addlayer.png + + + + 22 + 22 + + + + Ins + + + Qt::ToolButtonTextBesideIcon + + + false + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Remove All + + + Delete + + + + :/icones/icones/dellayer.png:/icones/icones/dellayer.png + + + + 22 + 22 + + + + Shift+Del + + + Qt::ToolButtonTextBesideIcon + + + false + + + + + + + + + + + + + diff --git a/libpgmodeler_ui/ui/mainwindow.ui b/libpgmodeler_ui/ui/mainwindow.ui index c60ebcbcc5..8b12fd1600 100644 --- a/libpgmodeler_ui/ui/mainwindow.ui +++ b/libpgmodeler_ui/ui/mainwindow.ui @@ -382,83 +382,6 @@ 0 - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 3 - - - - - Saving temp. models - - - - - - - - 16777215 - 16 - - - - 24 - - - - - - - - @@ -546,9 +469,60 @@ + + + + + 0 + 0 + + + + Toggle the object finder + + + Layers + + + + :/icones/icones/layers.png:/icones/icones/layers.png + + + + 22 + 22 + + + + Ctrl+F + + + true + + + Qt::ToolButtonTextBesideIcon + + + false + + + - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + 0 @@ -653,8 +627,72 @@ - - + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 3 + + + + + Saving temp. models + + + + + + + + 16777215 + 16 + + + + 24 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + 20 diff --git a/libpgmodeler_ui/ui/sceneinfowidget.ui b/libpgmodeler_ui/ui/sceneinfowidget.ui index ef15a45fca..20fefecc2e 100644 --- a/libpgmodeler_ui/ui/sceneinfowidget.ui +++ b/libpgmodeler_ui/ui/sceneinfowidget.ui @@ -6,8 +6,8 @@ 0 0 - 349 - 20 + 429 + 34 From c1d3406e4cb4712c44ccb50ce45532b6369845f0 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 22 Nov 2018 11:44:08 -0300 Subject: [PATCH 243/425] Minor fix in the layer renaming method --- libobjrenderer/src/objectsscene.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 544e91ed90..53e042273f 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -149,7 +149,8 @@ QString ObjectsScene::renameLayer(unsigned idx, const QString &name) if(name.isEmpty() || idx >= static_cast(layers.size())) return (QString()); - layers[idx] = formatLayerName(name); + if(name != layers[idx]) + layers[idx] = formatLayerName(name); return(layers[idx]); } From 724c0cc3b6eb2af1798c46d3d8cb43f2d1b7b4c0 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 22 Nov 2018 22:03:07 -0300 Subject: [PATCH 244/425] Minor fixes in OperationList Minor adjusments on SchemaView and BaseTableView (and its children classes) to update the geometry when they switch from invisble to visible state --- libobjrenderer/src/basetableview.cpp | 9 +++++ libobjrenderer/src/basetableview.h | 6 +++ libobjrenderer/src/graphicalview.cpp | 9 +++++ libobjrenderer/src/objectsscene.cpp | 47 ++++++++++++++++------ libobjrenderer/src/objectsscene.h | 4 +- libobjrenderer/src/schemaview.cpp | 6 ++- libobjrenderer/src/tableview.cpp | 9 +++++ libpgmodeler/src/databasemodel.cpp | 2 +- libpgmodeler/src/databasemodel.h | 2 +- libpgmodeler/src/operationlist.cpp | 4 +- libpgmodeler_ui/src/columnwidget.cpp | 2 +- libpgmodeler_ui/src/layerswidget.cpp | 25 +++++++++--- libpgmodeler_ui/src/layerswidget.h | 2 + libpgmodeler_ui/src/modelwidget.cpp | 24 ++++++----- libpgmodeler_ui/src/objectrenamewidget.cpp | 2 +- libpgmodeler_ui/src/tablewidget.cpp | 2 +- 16 files changed, 119 insertions(+), 36 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index c1c843a140..95957791e7 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -27,6 +27,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) if(!base_tab) throw Exception(ErrorCode::AsgNotAllocattedObject, __PRETTY_FUNCTION__, __FILE__, __LINE__); + pending_geom_update = false; body=new RoundedRectItem; body->setRoundedCorners(RoundedRectItem::BottomLeftCorner | RoundedRectItem::BottomRightCorner); @@ -122,6 +123,14 @@ QVariant BaseTableView::itemChange(GraphicsItemChange change, const QVariant &va configureObjectSelection(); attribs_toggler->clearButtonsSelection(); } + else if(change == ItemVisibleHasChanged) + { + if(value.toBool() && pending_geom_update) + { + this->configureObject(); + pending_geom_update = false; + } + } if(change==ItemPositionHasChanged) emit s_objectMoved(); diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 9992f63d38..237093e50d 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -42,6 +42,12 @@ class BaseTableView: public BaseObjectView { vector connected_rels; protected: + /*! \brief This attributes indicates that the object's geometry update is pending demanding a + * call to configureObject(). This attribute is set to true only when the objects is invisible + * the the configureObject is called. Once the object gets visible again this attribute is set + * to false and the geometry updated immediately (see BaseTableView::itemChange()) */ + bool pending_geom_update; + //! \brief Item groups that stores columns and extended attributes, respectively QGraphicsItemGroup *columns, diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 4850e19711..80245ad09a 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -31,6 +31,15 @@ GraphicalView::GraphicalView(View *view) : BaseTableView(view) void GraphicalView::configureObject(void) { + /* If the table isn't visible we abort the current configuration + * and mark its geometry update as pending so in the next call to + * setVisible(true) the geometry can be updated (see BaseObjectView::itemChange()) */ + if(!this->isVisible()) + { + pending_geom_update = true; + return; + } + View *view=dynamic_cast(this->getSourceObject()); int i = 0, count = 0; unsigned start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 53e042273f..326149b2b0 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -33,7 +33,7 @@ bool ObjectsScene::invert_rangesel_trigger=false; ObjectsScene::ObjectsScene(void) { layers.push_back(trUtf8("Default layer")); - active_layers.push_back(layers[0]); + active_layers.push_back(layers.at(0)); moving_objs=move_scene=false; enable_range_sel=true; @@ -161,20 +161,35 @@ void ObjectsScene::removeLayer(const QString &name) if(idx > 0) { + moveObjectsToLayer(idx, DefaultLayer); layers.removeAll(name); active_layers.removeAll(name); - moveObjectsToLayer(static_cast(idx), DefaultLayer); } } void ObjectsScene::removeLayers(void) { - QString def_layer = layers.at(DefaultLayer); + BaseObjectView *obj_view = nullptr; + QString def_layer = layers[DefaultLayer]; + bool is_active = active_layers.contains(def_layer); layers.clear(); - layers.push_back(def_layer); active_layers.clear(); - active_layers.push_back(def_layer); + layers.push_back(def_layer); + + if(is_active) + active_layers.push_back(def_layer); + + for(auto &item : this->items()) + { + obj_view = dynamic_cast(item); + + if(obj_view && !obj_view->parentItem() && obj_view->getLayer() != DefaultLayer) + { + obj_view->setLayer(DefaultLayer); + obj_view->setVisible(is_active); + } + } updateActiveLayers(); } @@ -208,7 +223,6 @@ void ObjectsScene::setActiveLayers(QStringList act_layers) if(obj_view && !obj_view->parentItem()) { - unsigned l = obj_view->getLayer(); is_in_layer = layers_idxs.contains(obj_view->getLayer()); if(!obj_view->isVisible() && is_in_layer) @@ -233,7 +247,7 @@ void ObjectsScene::setActiveLayers(QStringList act_layers) void ObjectsScene::moveObjectsToLayer(unsigned old_layer, unsigned new_layer) { BaseObjectView *obj_view = nullptr; - unsigned total_layers = static_cast(layers.size()); + unsigned total_layers = layers.size(); if(old_layer == new_layer || old_layer >= total_layers || new_layer >= total_layers) return; @@ -255,6 +269,14 @@ bool ObjectsScene::isLayerActive(const QString &name) return(active_layers.contains(name)); } +bool ObjectsScene::isLayerActive(unsigned layer_id) +{ + if(layer_id >= static_cast(layers.size())) + return(false); + + return(active_layers.contains(layers[layer_id])); +} + QStringList ObjectsScene::getActiveLayers(void) { return(active_layers); @@ -268,11 +290,7 @@ QStringList ObjectsScene::getLayers(void) unsigned ObjectsScene::getLayerId(const QString &name) { int idx = layers.contains(name); - - if(idx < 0) - return(DefaultLayer); - - return(static_cast(idx)); + return(idx < 0 ? InvalidLayer : static_cast(idx)); } void ObjectsScene::updateActiveLayers(void) @@ -595,8 +613,11 @@ void ObjectsScene::addItem(QGraphicsItem *item) if(obj) { + if(obj->getLayer() >= static_cast(layers.size())) + obj->setLayer(DefaultLayer); + + obj->setVisible(isLayerActive(obj->getLayer())); connect(obj, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(emitObjectSelection(BaseGraphicObject*,bool))); - obj->setLayer(DefaultLayer); } QGraphicsScene::addItem(item); diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 846bd62e86..43d748d185 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -144,7 +144,8 @@ class ObjectsScene: public QGraphicsScene { void blockItemsSignals(bool block); public: - static constexpr unsigned DefaultLayer = 0; + static constexpr unsigned DefaultLayer = 0, + InvalidLayer = UINT_MAX; ObjectsScene(void); ~ObjectsScene(void); @@ -156,6 +157,7 @@ class ObjectsScene: public QGraphicsScene { void setActiveLayers(QStringList act_layers); void moveObjectsToLayer(unsigned old_layer, unsigned new_layer); bool isLayerActive(const QString &name); + bool isLayerActive(unsigned layer_id); QStringList getActiveLayers(void); QStringList getLayers(void); unsigned getLayerId(const QString &name); diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index e6b72a53f3..60e1a29eae 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -17,6 +17,7 @@ */ #include "schemaview.h" +#include "objectsscene.h" SchemaView::SchemaView(Schema *schema) : BaseObjectView(schema) { @@ -166,7 +167,6 @@ void SchemaView::moveTo(QPointF new_pos) void SchemaView::configureObject(void) { Schema *schema=dynamic_cast(this->getSourceObject()); - this->fetchChildren(); /* Only configures the schema view if the rectangle is visible and there are @@ -240,7 +240,9 @@ void SchemaView::configureObject(void) box->setPen(QPen(color, 1, Qt::SolidLine)); this->bounding_rect=rect; - this->setVisible(true); + + ObjectsScene *scene = dynamic_cast(this->scene()); + this->setVisible(scene && scene->isLayerActive(schema->getLayer())); this->setToolTip(schema->getName(true) + QString(" (") + schema->getTypeName() + QString(")") + diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 4769e0b1ef..31daaaab6f 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -26,6 +26,15 @@ TableView::TableView(Table *table) : BaseTableView(table) void TableView::configureObject(void) { + /* If the table isn't visible we abort the current configuration + * and mark its geometry update as pending so in the next call to + * setVisible(true) the geometry can be updated (see BaseObjectView::itemChange()) */ + if(!this->isVisible()) + { + pending_geom_update = true; + return; + } + Table *table=dynamic_cast
(this->getSourceObject()); int i, count, obj_idx; double width=0, px=0, cy=0, old_width=0, old_height=0; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 5d76186d3d..680ffdc2d6 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -5787,7 +5787,7 @@ GenericSQL *DatabaseModel::createGenericSQL(void) return(genericsql); } -void DatabaseModel::updateViewsReferTable(Table *table) +void DatabaseModel::updateViewsReferencingTable(Table *table) { BaseRelationship *rel = nullptr; View *view = nullptr; diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 66c8836b0b..9b4c7c0b99 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -535,7 +535,7 @@ class DatabaseModel: public QObject, public BaseObject { GenericSQL *createGenericSQL(void); //! \brief Update views that reference the provided table forcing the column name deduction and redraw of the former objects - void updateViewsReferTable(Table *table); + void updateViewsReferencingTable(Table *table); //! \brief Creates/removes the relationship between the passed view and the referecend tables void updateViewRelationships(View *view, bool force_rel_removal=false); diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 159c65dff8..79883da3cb 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -844,8 +844,10 @@ void OperationList::executeOperation(Operation *oper, bool redo) model->validateRelationships(dynamic_cast(object), dynamic_cast
(parent_tab)); if(object->getObjectType()==ObjectType::Constraint && - dynamic_cast(object)->getConstraintType()==ConstraintType::ForeignKey) + dynamic_cast(object)->getConstraintType()==ConstraintType::ForeignKey) model->updateTableFKRelationships(dynamic_cast
(parent_tab)); + else if(object->getObjectType() == ObjectType::Column) + model->updateViewsReferencingTable(dynamic_cast
(parent_tab)); } } else if(parent_rel) diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index db9aae40b5..3a84691465 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -198,7 +198,7 @@ void ColumnWidget::applyConfiguration(void) } BaseObjectWidget::applyConfiguration(); - model->updateViewsReferTable(dynamic_cast
(table)); + model->updateViewsReferencingTable(dynamic_cast
(table)); finishConfiguration(); } diff --git a/libpgmodeler_ui/src/layerswidget.cpp b/libpgmodeler_ui/src/layerswidget.cpp index 5582d04713..45890d4659 100644 --- a/libpgmodeler_ui/src/layerswidget.cpp +++ b/libpgmodeler_ui/src/layerswidget.cpp @@ -24,7 +24,7 @@ LayersWidget::LayersWidget(QWidget *parent) : QWidget(parent) setupUi(this); setModel(nullptr); curr_item = nullptr; - + curr_row = -1; layers_lst->installEventFilter(this); connect(hide_tb, SIGNAL(clicked(bool)), this, SIGNAL(s_visibilityChanged(bool))); @@ -42,13 +42,12 @@ LayersWidget::LayersWidget(QWidget *parent) : QWidget(parent) void LayersWidget::setLayers(const QStringList &layers) { QListWidgetItem *item = nullptr; - QStringList active_layers = model->scene->getActiveLayers(); for(auto &layer : layers) { item = new QListWidgetItem(layer); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); - item->setCheckState(active_layers.contains(layer) ? Qt::Checked : Qt::Unchecked); + item->setCheckState(model->scene->isLayerActive(layer) ? Qt::Checked : Qt::Unchecked); layers_lst->addItem(item); } } @@ -61,6 +60,8 @@ bool LayersWidget::eventFilter(QObject *watched, QEvent *event) if(curr_item && (k_event->key() == Qt::Key_Enter || k_event->key() == Qt::Key_Return)) finishLayerRenaming(); + else if(!curr_item && k_event->key() == Qt::Key_F2 && layers_lst->currentRow() > 0) + startLayerRenaming(layers_lst->currentItem()); } return(false); @@ -150,9 +151,16 @@ QListWidgetItem *LayersWidget::addLayer(const QString &name) aux_name = model->scene->addLayer(aux_name); item = new QListWidgetItem(aux_name); - item->setFlags(item->flags() | Qt::ItemIsUserCheckable); + item->setFlags((item->flags() | Qt::ItemIsUserCheckable) ^ Qt::ItemIsEditable); item->setCheckState(Qt::Unchecked); + layers_lst->addItem(item); + + /* Reconfigure the model's menu if we have selected items so the new layer can + * appear in the "Move to layer" quick action */ + if(!model->scene->selectedItems().isEmpty()) + model->configureObjectSelection(); + enableButtons(); return(item); @@ -164,6 +172,7 @@ void LayersWidget::startLayerRenaming(QListWidgetItem *item) { curr_item = item; curr_text = item->text(); + curr_row = layers_lst->currentRow(); layers_lst->openPersistentEditor(item); } } @@ -177,10 +186,16 @@ void LayersWidget::finishLayerRenaming(void) if(curr_item->text().isEmpty()) curr_item->setText(curr_text); else - curr_item->setText(model->scene->renameLayer(layers_lst->currentRow(), curr_item->text())); + curr_item->setText(model->scene->renameLayer(curr_row, curr_item->text())); curr_item = nullptr; curr_text.clear(); + curr_row = -1; + + /* Reconfigure the model's menu if we have selected items so the renamed layer can + * appear in the "Move to layer" quick action */ + if(!model->scene->selectedItems().isEmpty()) + model->configureObjectSelection(); } } diff --git a/libpgmodeler_ui/src/layerswidget.h b/libpgmodeler_ui/src/layerswidget.h index e484f48d26..909cd64f4d 100644 --- a/libpgmodeler_ui/src/layerswidget.h +++ b/libpgmodeler_ui/src/layerswidget.h @@ -39,6 +39,8 @@ class LayersWidget : public QWidget, Ui::LayersWidget { QString curr_text; + int curr_row; + void setLayers(const QStringList &layers); bool eventFilter(QObject *watched, QEvent *event); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index c856fd746d..f516f035d0 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1428,7 +1428,7 @@ void ModelWidget::printModel(QPrinter *printer, bool print_grid, bool print_page bool show_grid, align_objs, show_delims; unsigned page_cnt, page, h_page_cnt, v_page_cnt, h_pg_id, v_pg_id; vector pages; - QRectF margins, page_rect; + QRectF margins; QPrinter::PaperSize paper_size_id; QPrinter::Orientation orient; QSizeF paper_size, custom_p_size; @@ -1975,14 +1975,17 @@ void ModelWidget::moveToLayer(void) { QAction *act = dynamic_cast(sender()); BaseGraphicObject *graph_obj = nullptr; + unsigned layer_id = act->data().toUInt(); for(auto &obj : selected_objects) { graph_obj = dynamic_cast(obj); - graph_obj->setLayer(scene->getLayerId(act->text())); + graph_obj->setLayer(layer_id); } + QApplication::setOverrideCursor(Qt::WaitCursor); scene->updateActiveLayers(); + QApplication::restoreOverrideCursor(); } void ModelWidget::changeOwner(void) @@ -2731,9 +2734,13 @@ void ModelWidget::duplicateObject(void) op_id=op_list->registerObject(dup_object, Operation::ObjectCreated, -1, table); table->addObject(dup_object); table->setModified(true); + dynamic_cast(table->getSchema())->setModified(true); if(obj_type == ObjectType::Column) + { db_model->validateRelationships(); + db_model->updateViewsReferencingTable(dynamic_cast
(table)); + } else if(obj_type == ObjectType::Constraint && dynamic_cast(object)->getConstraintType() == ConstraintType::ForeignKey) db_model->updateTableFKRelationships(dynamic_cast
(table)); @@ -2983,7 +2990,7 @@ void ModelWidget::removeObjects(bool cascade) db_model->validateRelationships(tab_obj, aux_table); if(obj_type == ObjectType::Column) - db_model->updateViewsReferTable(aux_table); + db_model->updateViewsReferencingTable(aux_table); } catch(Exception &e) { @@ -3263,15 +3270,14 @@ void ModelWidget::configureSubmenu(BaseObject *object) // Configuring the layers menu if(is_graph_obj) { + unsigned layer_id = ObjectsScene::DefaultLayer; layers_menu.clear(); for(auto &layer : scene->getLayers()) { act = layers_menu.addAction(layer); + act->setData(layer_id++); connect(act, SIGNAL(triggered(bool)), this, SLOT(moveToLayer())); - - //if(sel_objs.size() == 1 && scene->getLayer()) - //act->setEnabled(); } } @@ -3285,15 +3291,15 @@ void ModelWidget::configureSubmenu(BaseObject *object) if(accepts_schema) quick_actions_menu.addAction(action_moveto_schema); + if(is_graph_obj) + quick_actions_menu.addAction(action_moveto_layer); + if(accepts_owner) quick_actions_menu.addAction(action_change_owner); if(tab_or_view) quick_actions_menu.addAction(action_set_tag); - if(is_graph_obj) - quick_actions_menu.addAction(action_moveto_layer); - if(object && Permission::acceptsPermission(obj_type)) { quick_actions_menu.addAction(action_edit_perms); diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index edd3b96a27..821bb2ef78 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -154,7 +154,7 @@ void ObjectRenameWidget::applyRenaming(void) if(tab->isConstraintRefColumn(col, ConstraintType::PrimaryKey)) model->validateRelationships(); else - model->updateViewsReferTable(tab); + model->updateViewsReferencingTable(tab); } base_tab->setModified(true); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index d1a2137042..8eaefd4295 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -906,7 +906,7 @@ void TableWidget::applyConfiguration(void) model->validateRelationships(); model->updateTableFKRelationships(table); - model->updateViewsReferTable(table); + model->updateViewsReferencingTable(table); } catch(Exception &e) { From d50fd975341ca6525c65531d933104036661b026 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 23 Nov 2018 16:24:07 -0300 Subject: [PATCH 245/425] Finished the first version of scene layers. Minor fix in AttributesTogglerItem in order to consinder the parents opacity during paint --- libobjrenderer/src/attributestoggleritem.cpp | 3 +- libobjrenderer/src/objectsscene.cpp | 70 ++++++++++++++++---- libobjrenderer/src/objectsscene.h | 48 +++++++++++++- libparsers/src/attributes.cpp | 3 + libparsers/src/attributes.h | 3 + libpgmodeler/src/basegraphicobject.cpp | 1 + libpgmodeler/src/basegraphicobject.h | 2 +- libpgmodeler/src/baserelationship.cpp | 4 +- libpgmodeler/src/basetable.h | 6 +- libpgmodeler/src/databasemodel.cpp | 50 +++++++++++++- libpgmodeler/src/databasemodel.h | 12 ++++ libpgmodeler/src/schema.cpp | 1 + libpgmodeler/src/table.cpp | 10 +-- libpgmodeler/src/textbox.cpp | 2 + libpgmodeler/src/view.cpp | 11 +-- libpgmodeler_ui/src/mainwindow.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 21 ++++++ libpgmodeler_ui/src/modelwidget.h | 2 + libpgmodeler_ui/ui/layerswidget.ui | 6 +- schemas/xml/dbmodel.sch | 12 ++++ schemas/xml/dtd/dbmodel.dtd | 2 + schemas/xml/dtd/relationship.dtd | 1 + schemas/xml/dtd/schema.dtd | 1 + schemas/xml/dtd/table.dtd | 1 + schemas/xml/dtd/textbox.dtd | 1 + schemas/xml/dtd/view.dtd | 1 + schemas/xml/relationship.sch | 2 +- schemas/xml/schema.sch | 6 +- schemas/xml/table.sch | 2 +- schemas/xml/textbox.sch | 2 +- schemas/xml/view.sch | 2 +- 31 files changed, 247 insertions(+), 43 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index 5dd49074fa..f10b557c81 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -313,6 +313,7 @@ void AttributesTogglerItem::configureButtons(const QRectF &rect) void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + QGraphicsItem *parent = this->parentItem(); RoundedRectItem::paint(painter, option, widget); for(unsigned arr_id = 0; arr_id < 7; arr_id++) @@ -322,7 +323,7 @@ void AttributesTogglerItem::paint(QPainter *painter, const QStyleOptionGraphicsI painter->save(); painter->translate(buttons[arr_id]->pos()); - painter->setOpacity(buttons[arr_id]->opacity()); + painter->setOpacity(buttons[arr_id]->opacity() * (parent ? parent->opacity() : 1)); buttons[arr_id]->paint(painter, option, widget); painter->restore(); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 326149b2b0..8342e07dda 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -124,9 +124,19 @@ ObjectsScene::~ObjectsScene(void) QString ObjectsScene::formatLayerName(const QString &name) { - QString fmt_name = name; + QString fmt_name; unsigned idx = 1; + //Removing invalid chars + for(auto &chr : name) + { + if(chr.isLetterOrNumber() || chr == ' ' || chr == '_') + fmt_name.append(chr); + else + fmt_name.append('_'); + } + + //Doing the desambiguation (if needed) while(layers.contains(fmt_name)) fmt_name = QString("%1 %2").arg(name).arg(QString::number(idx++)); @@ -141,6 +151,7 @@ QString ObjectsScene::addLayer(const QString &name) QString fmt_name = formatLayerName(name); layers.push_back(fmt_name); + emit s_layersChanged(); return(fmt_name); } @@ -152,6 +163,7 @@ QString ObjectsScene::renameLayer(unsigned idx, const QString &name) if(name != layers[idx]) layers[idx] = formatLayerName(name); + emit s_layersChanged(); return(layers[idx]); } @@ -164,6 +176,7 @@ void ObjectsScene::removeLayer(const QString &name) moveObjectsToLayer(idx, DefaultLayer); layers.removeAll(name); active_layers.removeAll(name); + emit s_layersChanged(); } } @@ -191,46 +204,62 @@ void ObjectsScene::removeLayers(void) } } + emit s_layersChanged(); updateActiveLayers(); } void ObjectsScene::setActiveLayers(QStringList act_layers) { - BaseObjectView *obj_view = nullptr; - QList layers_idxs; + QList layers_idxs; int idx = -1; - active_layers.clear(); - for(auto &layer : act_layers) { idx = layers.indexOf(layer); if(idx >= 0) - { layers_idxs.push_back(idx); - active_layers.push_back(layer); - } } + setActiveLayers(layers_idxs); +} + +void ObjectsScene::setActiveLayers(QList layers_idxs) +{ + BaseObjectView *obj_view = nullptr; + active_layers.clear(); + if(!layers_idxs.isEmpty()) { bool is_in_layer = false; + unsigned layer_cnt = static_cast(layers.size()); + SchemaView *sch_view = nullptr; for(auto &item : this->items()) { obj_view = dynamic_cast(item); - if(obj_view && !obj_view->parentItem()) + if(obj_view && !obj_view->parentItem() && obj_view->getLayer() < layer_cnt) { + sch_view = dynamic_cast(obj_view); is_in_layer = layers_idxs.contains(obj_view->getLayer()); if(!obj_view->isVisible() && is_in_layer) - obj_view->setVisible(true); + { + if(!sch_view || + (sch_view && dynamic_cast(sch_view->getSourceObject())->isRectVisible())) + obj_view->setVisible(true); + } else if(obj_view->isVisible() && !is_in_layer) obj_view->setVisible(false); } } + + for(auto &idx : layers_idxs) + { + if(idx < layer_cnt) + active_layers.push_back(layers[idx]); + } } else { @@ -242,6 +271,8 @@ void ObjectsScene::setActiveLayers(QStringList act_layers) obj_view->setVisible(false); } } + + emit s_activeLayersChanged(); } void ObjectsScene::moveObjectsToLayer(unsigned old_layer, unsigned new_layer) @@ -262,6 +293,8 @@ void ObjectsScene::moveObjectsToLayer(unsigned old_layer, unsigned new_layer) obj_view->setVisible(isLayerActive(layers[new_layer])); } } + + emit s_objectsMovedLayer(); } bool ObjectsScene::isLayerActive(const QString &name) @@ -282,6 +315,16 @@ QStringList ObjectsScene::getActiveLayers(void) return(active_layers); } +QList ObjectsScene::getActiveLayersIds(void) +{ + QList list; + + for(auto &layer : active_layers) + list.push_back(layers.indexOf(layer)); + + return(list); +} + QStringList ObjectsScene::getLayers(void) { return(layers); @@ -613,10 +656,9 @@ void ObjectsScene::addItem(QGraphicsItem *item) if(obj) { - if(obj->getLayer() >= static_cast(layers.size())) - obj->setLayer(DefaultLayer); - - obj->setVisible(isLayerActive(obj->getLayer())); + //if(obj->getLayer() >= static_cast(layers.size())) + // obj->setLayer(DefaultLayer); + //obj->setVisible(isLayerActive(obj->getLayer())); connect(obj, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(emitObjectSelection(BaseGraphicObject*,bool))); } diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 43d748d185..5efa3492c6 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -117,14 +117,15 @@ class ObjectsScene: public QGraphicsScene { QGraphicsView *getActiveViewport(void); - //! brief Performs the final steps when moving the objects like adjusting position to grid, moving children object, etc + //! \brief Performs the final steps when moving the objects like adjusting position to grid, moving children object, etc void finishObjectsMove(const QPointF &pnt_end); - /*! brief Performs the scene position adjustment when pressing/releasing the arrow keys to avoid objects to be hidden in the corners. + /*! \brief Performs the scene position adjustment when pressing/releasing the arrow keys to avoid objects to be hidden in the corners. This method will adjust the scene size automatically when moving objects right or down if the selected items bounding rects exceeds the scene's size limits */ void adjustScenePositionOnKeyEvent(int key); + //! \brief Formats the name of the layer removing any invalid chars and doing the desambiguation in case the name already exists QString formatLayerName(const QString &name); protected: @@ -150,17 +151,49 @@ class ObjectsScene: public QGraphicsScene { ObjectsScene(void); ~ObjectsScene(void); + /*! \brief Add a new layer to the scene. In case of duplicated name this method + * automatically does the desambiguation. The name of the new layer is returned. */ QString addLayer(const QString &name); + + /*! \brief Rename the layer of the provided index. In case of duplicated name this method + * automatically does the desambiguation. */ QString renameLayer(unsigned idx, const QString &name); + + //! \brief Remove the named layer. Objects in the destroyed layer are automatically moved to the default one void removeLayer(const QString &name); + + //! \brief Destroy all layers (except the default one) moving all objects from the destroyed layers to the default one void removeLayers(void); + + //! \brief Set the named layers as active. Activating a layer causes objects attached to it to be visible void setActiveLayers(QStringList act_layers); + + //! \brief Set the layers with the provided indexes as active. Activating a layer causes objects attached to it to be visible + void setActiveLayers(QList ids); + + /*! \brief Move the objects from a layer to another. This method automatically hides/show the objects in the new layer + * according to the activation status of the destination layer */ void moveObjectsToLayer(unsigned old_layer, unsigned new_layer); + + //! \brief Returns true when the named layer is currenctly activated bool isLayerActive(const QString &name); + + //! \brief Returns true when the layer with the provided id is currenctly activated bool isLayerActive(unsigned layer_id); + + //! \brief Returns a list containing the names of the active layers QStringList getActiveLayers(void); + + //! \brief Returns a list containing the ids of the active layers + QList getActiveLayersIds(void); + + //! \brief Returns a list containing the names of all layers in the scene QStringList getLayers(void); + + //! \brief Returns the id of the named layer. If the layer does not exist the constant ObjectsScene::InvalidLayer is returned unsigned getLayerId(const QString &name); + + //! \brief This method causes objects in the active layers to have their visibility state updated. void updateActiveLayers(void); static void setEnableCornerMove(bool enable); @@ -251,9 +284,18 @@ class ObjectsScene: public QGraphicsScene { //! \brief Signal emitted when objects are selected via range selection void s_objectsSelectedInRange(void); - //! \brief Signal emtted when a blank area of the canvas is pressed + //! \brief Signal emitted when a blank area of the canvas is pressed void s_objectsScenePressed(Qt::MouseButtons); + //! \brief Signal emitted when the active layers change + void s_activeLayersChanged(void); + + //! \brief Signal emitted when the layers change (add, remove, rename) + void s_layersChanged(void); + + //! \brief Signal emitted when objects are moved from a layer to another + void s_objectsMovedLayer(void); + friend class ModelWidget; }; diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 4a1d6cb39e..9309180ed2 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -25,6 +25,7 @@ namespace Attributes { LcCollate=QString("lc-collate"), LcCtype=QString("lc-ctype"), True=QString("true"), + ActiveLayers=QString("active-layers"), AdminOption=QString("admin-option"), AdminRoles=QString("admin-roles"), Alias=QString("alias"), @@ -286,6 +287,8 @@ namespace Attributes { LastAutovacuum=QString("last-autovacuum"), LastVacuum=QString("last-vacuum"), LeakProof=QString("leakproof"), + Layer=QString("layer"), + Layers=QString("layers"), LeftType=QString("left-type"), Left=QString("left"), Length=QString("length"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 1582871633..f3b57ea31f 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -40,6 +40,7 @@ namespace Attributes { LcCollate, LcCtype, True, + ActiveLayers, AdminOption, AdminRoles, Alias, @@ -297,6 +298,8 @@ namespace Attributes { LastSysOid, LastValue, LastZoom, + Layer, + Layers, LeakProof, LeftType, Left, diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index a2efef32e9..119574b0b8 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -26,6 +26,7 @@ BaseGraphicObject::BaseGraphicObject(void) attributes[Attributes::YPos]=QString(); attributes[Attributes::Position]=QString(); attributes[Attributes::FadedOut]=QString(); + attributes[Attributes::Layer]=QString(); receiver_object=nullptr; layer = 0; } diff --git a/libpgmodeler/src/basegraphicobject.h b/libpgmodeler/src/basegraphicobject.h index bc6459a768..eecfb889d8 100644 --- a/libpgmodeler/src/basegraphicobject.h +++ b/libpgmodeler/src/basegraphicobject.h @@ -55,10 +55,10 @@ class BaseGraphicObject: public QObject, public BaseObject { it in the QGraphcisScene) */ QObject *receiver_object; + protected: //! \brief This attributes holds the layer in which the object is visible. unsigned layer; - protected: /*! \brief Method that defines the objects position attributes used in generation of XML code definition */ void setPositionAttribute(void); diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 781f30df38..5bc1ce73b6 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -332,7 +332,7 @@ void BaseRelationship::setRelationshipAttributes(void) Attributes::DstLabel, Attributes::NameLabel}; - + attributes[Attributes::Layer]=QString::number(layer); attributes[Attributes::Type]=getRelTypeAttribute(); attributes[Attributes::SrcRequired]=(src_mandatory ? Attributes::True : QString()); attributes[Attributes::DstRequired]=(dst_mandatory ? Attributes::True : QString()); @@ -420,7 +420,7 @@ QString BaseRelationship::getCodeDefinition(unsigned def_type) bool reduced_form; setRelationshipAttributes(); reduced_form=(attributes[Attributes::Points].isEmpty() && - attributes[Attributes::LabelsPos].isEmpty()); + attributes[Attributes::LabelsPos].isEmpty()); if(!reduced_form) cached_reduced_code.clear(); diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index d356d950d4..301929d134 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -37,7 +37,8 @@ enum class CollapseMode: unsigned { }; class BaseTable: public BaseGraphicObject { - private: + protected: + Tag *tag; //! \brief Indicates if the pagination is enabled for the table bool pagination_enabled; @@ -48,9 +49,6 @@ class BaseTable: public BaseGraphicObject { //! \brief Stores the current page visible on the table unsigned curr_page[2]; - protected: - Tag *tag; - public: static constexpr unsigned AttribsSection = 0, ExtAttribsSection = 1; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 680ffdc2d6..33e09573b7 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3030,6 +3030,20 @@ void DatabaseModel::loadModel(const QString &filename) this->allow_conns = (attribs[Attributes::AllowConns].isEmpty() || attribs[Attributes::AllowConns] == Attributes::True); + layers = attribs[Attributes::Layers].split(';', QString::SkipEmptyParts); + + active_layers.clear(); + + /* Compatibility with models created prior the layers features: + * If the "active-layers" is absent we make the default layer always visible */ + if(!attribs.count(Attributes::ActiveLayers)) + active_layers.push_back(0); + else + { + for(auto &layer_id : attribs[Attributes::ActiveLayers].split(';', QString::SkipEmptyParts)) + active_layers.push_back(layer_id.toInt()); + } + protected_model=(attribs[Attributes::Protected]==Attributes::True); def_objs[ObjectType::Schema]=attribs[Attributes::DefaultSchema]; @@ -3579,6 +3593,7 @@ Schema *DatabaseModel::createSchema(void) schema->setFillColor(QColor(attribs[Attributes::FillColor])); schema->setRectVisible(attribs[Attributes::RectVisible]==Attributes::True); schema->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); + schema->setLayer(attribs[Attributes::Layer].toUInt()); } catch(Exception &e) { @@ -4685,6 +4700,7 @@ Table *DatabaseModel::createTable(void) table->setCurrentPage(BaseTable::AttribsSection, attribs[Attributes::AttribsPage].toUInt()); table->setCurrentPage(BaseTable::ExtAttribsSection, attribs[Attributes::ExtAttribsPage].toUInt()); table->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); + table->setLayer(attribs[Attributes::Layer].toUInt()); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -5923,6 +5939,7 @@ View *DatabaseModel::createView(void) view->setCurrentPage(BaseTable::AttribsSection, attribs[Attributes::AttribsPage].toUInt()); view->setCurrentPage(BaseTable::ExtAttribsSection, attribs[Attributes::ExtAttribsPage].toUInt()); view->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); + view->setLayer(attribs[Attributes::Layer].toUInt()); if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -6232,6 +6249,7 @@ Textbox *DatabaseModel::createTextbox(void) xmlparser.getElementAttributes(attribs); txtbox->setFadedOut(attribs[Attributes::FadedOut]==Attributes::True); + txtbox->setLayer(attribs[Attributes::Layer].toUInt()); txtbox->setTextAttribute(Textbox::ItalicText, attribs[Attributes::Italic]==Attributes::True); txtbox->setTextAttribute(Textbox::BoldText, attribs[Attributes::Bold]==Attributes::True); txtbox->setTextAttribute(Textbox::UnderlineText, attribs[Attributes::Underline]==Attributes::True); @@ -6262,7 +6280,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) bool src_mand, dst_mand, identifier, protect, deferrable, sql_disabled, single_pk_col, faded_out; DeferralType defer_type; ActionType del_action, upd_action; - unsigned rel_type=0, i; + unsigned rel_type=0, i = 0, layer = 0; ObjectType table_types[2]={ObjectType::View, ObjectType::Table}, obj_rel_type; QString str_aux, elem, tab_attribs[2]={ Attributes::SrcTable, @@ -6277,8 +6295,10 @@ BaseRelationship *DatabaseModel::createRelationship(void) labels_id[Attributes::DstLabel]=BaseRelationship::DstCardLabel; xmlparser.getElementAttributes(attribs); + protect=(attribs[Attributes::Protected]==Attributes::True); faded_out=(attribs[Attributes::FadedOut]==Attributes::True); + layer = attribs[Attributes::Layer].toUInt(); if(!attribs[Attributes::CustomColor].isEmpty()) custom_color=QColor(attribs[Attributes::CustomColor]); @@ -6541,6 +6561,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) base_rel->setFadedOut(faded_out); base_rel->setProtected(protect); base_rel->setCustomColor(custom_color); + base_rel->setLayer(layer); /* If the FK relationship does not reference a foreign key (models generated in older versions) * we need to assign them to the respective relationships */ @@ -6983,6 +7004,13 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) if(def_type==SchemaParser::XmlDefinition) { + QStringList act_layers; + + for(auto &layer_id : active_layers) + act_layers.push_back(QString::number(layer_id)); + + attribs_aux[Attributes::Layers]=layers.join(';'); + attribs_aux[Attributes::ActiveLayers]=act_layers.join(';'); attribs_aux[Attributes::MaxObjCount]=QString::number(static_cast(getMaxObjectCount() * 1.20)); attribs_aux[Attributes::Protected]=(this->is_protected ? Attributes::True : QString()); attribs_aux[Attributes::LastPosition]=QString("%1,%2").arg(last_pos.x()).arg(last_pos.y()); @@ -10168,3 +10196,23 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } } + +void DatabaseModel::setLayers(const QStringList &layers) +{ + this->layers = layers; +} + +QStringList DatabaseModel::getLayers(void) +{ + return(layers); +} + +void DatabaseModel::setActiveLayers(const QList &layers) +{ + active_layers = layers; +} + +QList DatabaseModel::getActiveLayers(void) +{ + return(active_layers); +} diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 9b4c7c0b99..8f6e890295 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -67,6 +67,11 @@ class DatabaseModel: public QObject, public BaseObject { XmlParser xmlparser; + //! \brief Stores the layers names and active layer to write them on XML code + QStringList layers; + + QList active_layers; + //! \brief Stores the model widget that is managing this database model instance ModelWidget *model_wgt; @@ -179,6 +184,12 @@ class DatabaseModel: public QObject, public BaseObject { //! \brief Set the initial capacity of the objects list for a optimized memory usage void setObjectListsCapacity(unsigned capacity); + protected: + void setLayers(const QStringList &layers); + void setActiveLayers(const QList &layers); + QStringList getLayers(void); + QList getActiveLayers(void); + public: static constexpr unsigned MetaDbAttributes=1, //! \brief Handle database model attribute when save/load metadata file MetaObjsPositioning=2, //! \brief Handle objects' positioning when save/load metadata file @@ -636,6 +647,7 @@ class DatabaseModel: public QObject, public BaseObject { void s_objectLoaded(int progress, QString object_id, unsigned obj_type); friend class DatabaseImportHelper; + friend class ModelWidget; }; #endif diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index bccce66b5f..802c132cf2 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -67,6 +67,7 @@ QString Schema::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); + attributes[Attributes::Layer]=QString::number(layer); attributes[Attributes::FillColor]=fill_color.name(); attributes[Attributes::RectVisible]=(rect_visible ? Attributes::True : QString()); setFadedOutAttribute(); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index eb373de2ac..561e2b3095 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1604,10 +1604,11 @@ QString Table::__getCodeDefinition(unsigned def_type, bool incl_rel_added_objs) attributes[Attributes::Partitioning]=~partitioning_type; attributes[Attributes::PartitionKey]=QString(); attributes[Attributes::PartitionBoundExpr]=part_bounding_expr; - attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); - attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); - attributes[Attributes::AttribsPage]=(isPaginationEnabled() ? QString::number(getCurrentPage(AttribsSection)) : QString()); - attributes[Attributes::ExtAttribsPage]=(isPaginationEnabled() ? QString::number(getCurrentPage(ExtAttribsSection)) : QString()); + attributes[Attributes::Layer]=QString::number(layer); + attributes[Attributes::Pagination]=(pagination_enabled ? Attributes::True : QString()); + attributes[Attributes::CollapseMode]=QString::number(enum_cast(collapse_mode)); + attributes[Attributes::AttribsPage]=(pagination_enabled ? QString::number(curr_page[AttribsSection]) : QString()); + attributes[Attributes::ExtAttribsPage]=(pagination_enabled ? QString::number(curr_page[ExtAttribsSection]) : QString()); for(auto part_key : partition_keys) part_keys_code+=part_key.getCodeDefinition(def_type); @@ -1660,6 +1661,7 @@ void Table::operator = (Table &tab) (*dynamic_cast(this))=dynamic_cast(tab); + this->layer = tab.layer; this->with_oid=tab.with_oid; this->col_indexes=tab.col_indexes; this->constr_indexes=tab.constr_indexes; diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index 659e970327..af8e1a60e7 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -55,6 +55,7 @@ QString Textbox::getCodeDefinition(unsigned def_type) attributes[Attributes::Color]=text_color.name(); attributes[Attributes::FontSize]=QString("%1").arg(font_size); + attributes[Attributes::Layer]=QString::number(layer); return(this->BaseObject::__getCodeDefinition(SchemaParser::XmlDefinition)); } @@ -69,6 +70,7 @@ void Textbox::operator = (Textbox &txtbox) this->text_attributes[2]=txtbox.text_attributes[2]; this->text_color=txtbox.text_color; this->font_size=txtbox.font_size; + this->layer = txtbox.layer; } void Textbox::setTextAttribute(unsigned attrib, bool value) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index d1cf9e9fcb..3c52860add 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -628,10 +628,11 @@ QString View::getCodeDefinition(unsigned def_type) attributes[Attributes::WithNoData]=(with_no_data ? Attributes::True : QString()); attributes[Attributes::Columns]=QString(); attributes[Attributes::Tag]=QString(); - attributes[Attributes::Pagination]=(isPaginationEnabled() ? Attributes::True : QString()); - attributes[Attributes::CollapseMode]=QString::number(enum_cast(getCollapseMode())); - attributes[Attributes::AttribsPage]=(isPaginationEnabled() ? QString::number(getCurrentPage(AttribsSection)) : QString()); - attributes[Attributes::ExtAttribsPage]=(isPaginationEnabled() ? QString::number(getCurrentPage(ExtAttribsSection)) : QString()); + attributes[Attributes::Layer]=QString::number(layer); + attributes[Attributes::Pagination]=(pagination_enabled ? Attributes::True : QString()); + attributes[Attributes::CollapseMode]=QString::number(enum_cast(collapse_mode)); + attributes[Attributes::AttribsPage]=(pagination_enabled ? QString::number(curr_page[AttribsSection]) : QString()); + attributes[Attributes::ExtAttribsPage]=(pagination_enabled ? QString::number(curr_page[ExtAttribsSection]) : QString()); setSQLObjectAttribute(); @@ -1074,6 +1075,8 @@ void View::operator = (View &view) (*dynamic_cast(this))=reinterpret_cast(view); + this->pagination_enabled = view.pagination_enabled; + this->layer = view.layer; this->references=view.references; this->exp_select=view.exp_select; this->exp_from=view.exp_from; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index d68ce33f33..e8a5da217a 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1041,10 +1041,10 @@ void MainWindow::setCurrentModel(void) QToolButton *tool_btn=nullptr; QList btns; QFont font; + layers_wgt->setModel(current_model); current_model->setFocus(Qt::OtherFocusReason); current_model->cancelObjectAddition(); - general_tb->addSeparator(); general_tb->addAction(current_model->action_new_object); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index f516f035d0..ea5a3a44e0 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -479,6 +479,9 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(scene, &ObjectsScene::s_collapseModeChanged, [&](){ modified = true; }); connect(scene, &ObjectsScene::s_paginationToggled, [&](){ modified = true; }); connect(scene, &ObjectsScene::s_currentPageChanged, [&](){ modified = true; }); + connect(scene, &ObjectsScene::s_objectsMovedLayer, [&](){ modified = true; }); + connect(scene, SIGNAL(s_layersChanged()), this, SLOT(updateModelLayers())); + connect(scene, SIGNAL(s_activeLayersChanged()), this, SLOT(updateModelLayers())); connect(scene, SIGNAL(s_popupMenuRequested(BaseObject*)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_popupMenuRequested(void)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), new_obj_overlay_wgt, SLOT(hide())); @@ -1381,6 +1384,14 @@ void ModelWidget::loadModel(const QString &filename) this->adjustSceneSize(); this->updateObjectsOpacity(); + scene->blockSignals(true); + + for(auto &layer : db_model->getLayers()) + scene->addLayer(layer); + + scene->setActiveLayers(db_model->getActiveLayers()); + scene->blockSignals(false); + task_prog_wgt.close(); protected_model_frm->setVisible(db_model->isProtected()); this->modified=false; @@ -4520,6 +4531,16 @@ void ModelWidget::editTableData(void) emit s_objectManipulated(); } +void ModelWidget::updateModelLayers(void) +{ + QStringList layers = scene->getLayers(); + + layers.removeAt(0); + db_model->setLayers(layers); + db_model->setActiveLayers(scene->getActiveLayersIds()); + modified = true; +} + void ModelWidget::rearrangeTablesHierarchically(void) { vector objects; diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index 410330a6a1..bf59932a9d 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -494,6 +494,8 @@ class ModelWidget: public QWidget { void editTableData(void); + void updateModelLayers(void); + public slots: void loadModel(const QString &filename); void saveModel(const QString &filename); diff --git a/libpgmodeler_ui/ui/layerswidget.ui b/libpgmodeler_ui/ui/layerswidget.ui index 855cd5a63e..b8014d4e80 100644 --- a/libpgmodeler_ui/ui/layerswidget.ui +++ b/libpgmodeler_ui/ui/layerswidget.ui @@ -74,7 +74,7 @@ - Remove All + Remove all layers Delete all @@ -170,7 +170,7 @@ - Add Item + Add a new layer Add @@ -214,7 +214,7 @@ - Remove All + Remove the selected layer Delete diff --git a/schemas/xml/dbmodel.sch b/schemas/xml/dbmodel.sch index 930f513c51..356580e73b 100644 --- a/schemas/xml/dbmodel.sch +++ b/schemas/xml/dbmodel.sch @@ -50,6 +50,18 @@ %end %end + + %if {layers} %then + $br $tb + [ layers]="{layers}" + + [ active-layers]= + %if {active-layers} %then + "{active-layers}" + %else + "" + %end + %end > $br %if {objects} %then {objects} %end diff --git a/schemas/xml/dtd/dbmodel.dtd b/schemas/xml/dtd/dbmodel.dtd index 1f84c56544..1b0ee4823b 100644 --- a/schemas/xml/dtd/dbmodel.dtd +++ b/schemas/xml/dtd/dbmodel.dtd @@ -79,3 +79,5 @@ + + diff --git a/schemas/xml/dtd/relationship.dtd b/schemas/xml/dtd/relationship.dtd index 6acf64b843..fed2d8449c 100644 --- a/schemas/xml/dtd/relationship.dtd +++ b/schemas/xml/dtd/relationship.dtd @@ -7,6 +7,7 @@ + diff --git a/schemas/xml/dtd/schema.dtd b/schemas/xml/dtd/schema.dtd index 99cc73d800..2713a87464 100644 --- a/schemas/xml/dtd/schema.dtd +++ b/schemas/xml/dtd/schema.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/table.dtd b/schemas/xml/dtd/table.dtd index 2306c7fa47..ed1a638455 100644 --- a/schemas/xml/dtd/table.dtd +++ b/schemas/xml/dtd/table.dtd @@ -15,6 +15,7 @@ + diff --git a/schemas/xml/dtd/textbox.dtd b/schemas/xml/dtd/textbox.dtd index 5c3c86984a..7357956775 100644 --- a/schemas/xml/dtd/textbox.dtd +++ b/schemas/xml/dtd/textbox.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 14ea7a8500..6009bf8be0 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -4,6 +4,7 @@ --> + diff --git a/schemas/xml/relationship.sch b/schemas/xml/relationship.sch index 8e07bb7fc6..e8467628c6 100644 --- a/schemas/xml/relationship.sch +++ b/schemas/xml/relationship.sch @@ -1,7 +1,7 @@ # XML definition for relationships # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -[ Date: Fri, 23 Nov 2018 20:49:51 -0300 Subject: [PATCH 246/425] Minor adjusment in ObjectsScene::addItem to make the item (in)visible according to the visibility of its layer (issue #1209) --- libobjrenderer/src/objectsscene.cpp | 4 +--- libpgmodeler_ui/src/databaseimporthelper.cpp | 2 ++ schemas/xml/relationship.sch | 4 +++- schemas/xml/table.sch | 6 +++--- schemas/xml/view.sch | 8 +++----- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 8342e07dda..900cc37448 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -656,9 +656,7 @@ void ObjectsScene::addItem(QGraphicsItem *item) if(obj) { - //if(obj->getLayer() >= static_cast(layers.size())) - // obj->setLayer(DefaultLayer); - //obj->setVisible(isLayerActive(obj->getLayer())); + obj->setVisible(isLayerActive(obj->getLayer())); connect(obj, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(emitObjectSelection(BaseGraphicObject*,bool))); } diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index ce06c0d4af..febf3675fe 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -2617,6 +2617,8 @@ void DatabaseImportHelper::configureDatabase(attribs_map &attribs) try { attribs[Attributes::AppendAtEod]=QString(); + attribs[Attributes::Layers]=QString(); + attribs[Attributes::ActiveLayers]=QString(); loadObjectXML(ObjectType::Database, attribs); dbmodel->configureDatabase(attribs); } diff --git a/schemas/xml/relationship.sch b/schemas/xml/relationship.sch index e8467628c6..0e5fbf71f6 100644 --- a/schemas/xml/relationship.sch +++ b/schemas/xml/relationship.sch @@ -1,7 +1,9 @@ # XML definition for relationships # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -[ Date: Mon, 26 Nov 2018 10:46:45 -0300 Subject: [PATCH 247/425] Minor adjustments on LayersWidget Minor adjustments on MainWindow to make the overview widget to update its content whenever the active layers change on the current model. --- libpgmodeler_ui/src/layerswidget.cpp | 7 ++++--- libpgmodeler_ui/src/layerswidget.h | 24 +++++++++++++++++++++++- libpgmodeler_ui/src/mainwindow.cpp | 1 + 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/layerswidget.cpp b/libpgmodeler_ui/src/layerswidget.cpp index 45890d4659..a599c6bb08 100644 --- a/libpgmodeler_ui/src/layerswidget.cpp +++ b/libpgmodeler_ui/src/layerswidget.cpp @@ -39,11 +39,11 @@ LayersWidget::LayersWidget(QWidget *parent) : QWidget(parent) }); } -void LayersWidget::setLayers(const QStringList &layers) +void LayersWidget::updateLayers(void) { QListWidgetItem *item = nullptr; - for(auto &layer : layers) + for(auto &layer : model->scene->getLayers()) { item = new QListWidgetItem(layer); item->setFlags(item->flags() | Qt::ItemIsUserCheckable); @@ -81,6 +81,7 @@ void LayersWidget::updateActiveLayers(void) } model->scene->setActiveLayers(active_layers); + emit s_activeLayersChanged(); } void LayersWidget::removeLayer(bool clear) @@ -141,7 +142,7 @@ void LayersWidget::setModel(ModelWidget *model) add_tb->setEnabled(enable); if(model) - setLayers(model->scene->getLayers()); + updateLayers(); } QListWidgetItem *LayersWidget::addLayer(const QString &name) diff --git a/libpgmodeler_ui/src/layerswidget.h b/libpgmodeler_ui/src/layerswidget.h index 909cd64f4d..47e7683f8f 100644 --- a/libpgmodeler_ui/src/layerswidget.h +++ b/libpgmodeler_ui/src/layerswidget.h @@ -33,36 +33,58 @@ class LayersWidget : public QWidget, Ui::LayersWidget { private: Q_OBJECT + //! \brief Model in which the layer widget will operate on ModelWidget *model; + /*! \brief The current selected item in the layers list. We need to store it in a separated attribute + * for renaming purposes */ QListWidgetItem *curr_item; + //! \brief Stores the current's item text (layer name) to revert the renaming if the user aborts it QString curr_text; + //! \brief Stores the current's item row int curr_row; - void setLayers(const QStringList &layers); + //! \brief Configures the layers listing + void updateLayers(void); bool eventFilter(QObject *watched, QEvent *event); public: explicit LayersWidget(QWidget *parent = nullptr); + //! \brief Defines the model in which the widget will work void setModel(ModelWidget *model); private slots: + //! \brief Add a new item (layer) to the listing. If the provided name is empty a default name is assigned QListWidgetItem *addLayer(const QString &name = QString()); + + //! \brief Triggers the renaming operation over a item void startLayerRenaming(QListWidgetItem *item); + + //! \brief Finishes the renaming operation over a item void finishLayerRenaming(void); + + //! \brief Updates the active layeres on the scene causing a redraw of the items void updateActiveLayers(void); + + //! \brief Remove a layer from the listing. If 'clear' is true them all layers (except the default) are removed void removeLayer(bool clear = false); + + //! \brief Enables the control buttons according to the selection on the list void enableButtons(void); public slots: void setVisible(bool value); signals: + //! \brief Signal emitted whenever the widget changes its visibility void s_visibilityChanged(bool); + + //! \brief Signal emitted whenever the current active layers change + void s_activeLayersChanged(void); }; #endif diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index e8a5da217a..93e00d98b4 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -223,6 +223,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par }); connect(oper_list_wgt, SIGNAL(s_operationExecuted(void)), overview_wgt, SLOT(updateOverview(void))); + connect(layers_wgt, SIGNAL(s_activeLayersChanged(void)), overview_wgt, SLOT(updateOverview(void))); connect(configuration_form, SIGNAL(finished(int)), this, SLOT(applyConfigurations(void))); connect(configuration_form, SIGNAL(rejected()), this, SLOT(updateConnections())); From 9ebe8dc2a5d79a48b8cbf0e4207f163fb661a85f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 29 Nov 2018 08:49:21 -0300 Subject: [PATCH 248/425] Updates on CHANGELOG.md and RELEASENOTES.md for 0.9.2-alpha1 --- CHANGELOG.md | 115 ++++++++++++++++++++++++++++++++++++++++++++++++ RELEASENOTES.md | 100 +++++++++++++++++++++++++---------------- 2 files changed, 177 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75bb042df6..46b3c0abc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,121 @@ Change Log --------- +v0.9.2-alpha1 +------ +Release date: December 17, 2018
+ +* [New] Added support to scene layers. +* [New] Added support to view's columns importing in DatabaseImportHelper. +* [New] Added the ability to load view columns from database model file in DatabaseModel::createView. +* [New] Added a tab "Columns" in ReferenceWidget where the user will be able to insert columns to be used as view columns. +* [New] Added support to pagination of tables and views columns pagination. +* [New] Added a pagination toggler action on context menu at ModelWidget. +* [New] Added a fix step on CLI to remove the deprecated attribute hide-ext-attribs from tables and views xml code. +* [New] Added a configuration option to control attributes per pages in tables and views. +* [New] Added support to save collapsing states and current attributes pages to the database model file. +* [New] Added constants to reference child objects of TableObjectView. +* [New] Added the class TextPolygonItem which can be used to draw a text over a background polygon. +* [New] Added support to OLD/NEW tables aliases on triggers. +* [New] Added a hint text on RelationshipWidget to document the correct usage of default partitions. +* [New] Added support for partition attaching/detaching detection in diff process. +* [New] Added auxiliary methods in Table class in order to add/remove and retrieve partition tables. +* [New] Added support to importing partitioned/partition tables on DatabaseImportHelper. +* [New] Added a missing validation in Relationship to avoid creating other types of relationships involving partitioned or partition tables. +* [New] Added support to specify partition bounding expression on partitioning relationships. +* [New] Added support to resize grid cells to fit contents on ObjectsTableWidget. +* [New] Added a tab "Partition keys" that will handle partitioning configuration on TableWidget. +* [New] Added a method in ObjectsTableWidget to hide some horizontal header sections. +* [New] Added some validations when creating partitioning relationships. +* [New] Added support to hide columns on data manipulation dialog. +* [New] Added a transient attribute to objects DatabaseModel, Table and View in order to give a hint on the maximum count of objects held. This attribute is used to preallocate the vectors which store the children objects in order to avoid excessive memory allocation/deallocation due to vector resizing. +* [New] Added a column labeled "Alias" on all objects tables in TableWidget so the aliases of children can be displayed. +* [New] Added support to adding tabs via shortcut or corner button in the SQL Execution panel. +* [Change] Minor adjustments on MainWindow to make the overview widget to update its contents whenever the active layers change on the current model. +* [Change] Minor adjusment in ObjectsScene::addItem to make the item (in)visible according to the visibility of its related layer. +* [Change] Minor fix in AttributesTogglerItem in order to consider the parent's opacity during painting. +* [Change] Minor fixes in OperationList in order to force views to be updated correctly when operating over a table which is referenced by those objects. +* [Change] Minor adjustments on SchemaView and BaseTableView (and its children classes) to update the geometry when they switch from invisble to visible state. +* [Change] Changed views in such way so they can use the struct SimpleColumn to represent their deduced columns. +* [Change] Improved the update of views when referenced columns and tables change their structure. +* [Change] Improved database model loading times by avoiding the rendering of tables while the children objects (indexes, trigger, rules, etc) are being added. +* [Change] Removed the several operators ~ overloading that statically cast enums to their underlying type and created a template function called enum_cast in C++14 syntax. +* [Change] The zoom in/out level is now sensible on how much the user rolls the mouse wheel. +* [Change] Move the default implementation of configureObjectShadow and configureObjectSelection from BaseObjectView to BaseTableView. +* [Change] Disabling configureObjectSelection and configureObjectShadow on TableObjectView and RelationshipView. +* [Change] Minor adjustment on protected icon position on TableTitleView and TextboxView. +* [Change] Minor performance adjustments in ModelWidget. +* [Change] Minor improvement in TextboxView to use only a TextPolygonItem to hold text and the object's rectangle instead of a box and a text items. +* [Change] Replaced the sql_info_txt and sql_info_box items by a single instance of TextPolygonItem to denote SQL disabled status. +* [Change] Replace the tag_body and tag_name elements on BaseTableView by the tag_item which is a instance of TextPolygonItem. +* [Change] Improved the TableObjectView to avoid adding extra scene items. +* [Change] Improved the TableTitleView to avoid adding children items. A custom paint() method now draws them. +* [Change] Removing unused fr_FR UI translations. +* [Change] Minor update on known issues sections at README.md. +* [Change] Renamed the namespace ParsersAttributes to Attributes and its attributes has been refactored. +* [Change] Refactored all static const attributes of the classes present in pgsqltypes.h. +* [Change] Renamed PgModelerNS to PgModelerNs. +* [Change] Renamed PgModelerUiNs to PgModelerUiNs. +* [Change] Renamed XMLParser to XmlParser. +* [Change] Removing uneeded temporary QString instance created from Exception::getErroMessage call before throwing exceptions. +* [Change] Refactored static const attributes of BaseObject. +* [Change] Refactored the items in the enum ObjectType by removing the prefix 'OBJ'. +* [Change] The enums ErrorType and ObjectType were transformed into scoped enums. Also the ErrorType enum was renamed to ErrorCode. +* [Change] Code refactoring done in order to make it more close to C++14 in order to take advantage of new features introduced by that standard. +* [Change] Removed unused labels and fixed warning frame on ModelWidget. +* [Change] Minor improvements on table's attributes displaying on DatabaseExplorerWidget. +* [Change] Improved the diff process in such way to avoid generating unnecessary/noise commands related to changing types of columns to integer and setting nextval() call as default value. +* [Change] Partition tables are now displayed in the "Tables" tab at TableWidget. +* [Change] Removed the cached catalog query test feature from Catalog. +* [Change] Fine tuning on the validation of the entities used in the partitioning relationship creation. +* [Change] Forcing the partitioning relationship to be invalidated when the reference table (partitioned) partitioning type is set to null (no partitioning). +* [Change] Move the FK settings, copy options and name patterns group boxes to a dedicated tab on RelationshipWidget. +* [Change] Improved the models destruction when closing the application. +* [Change] Improved the Index/Exclude/ParitionKey elements handling by creating a generic form/grid that handles these kinds of objects (ElementsTableWidget). +* [Change] Modified the RelationshipWidget in order to handle partitioning relationships. +* [Change] Modified RelationshipConfigWidget in order to write name partterns for partitioning relationships. +* [Change] Improved the column copying and validation on class Relationship to include partitioning relationship logics. +* [Change] Improved the reverse engineering performance by avoiding update relationships as they are being imported. +* [Change] Improved the object duplication feature in ModelWidget. +* [Change] When the model is loaded it is copied to the temporary models storage as a first version of the temporary dbm file. +* [Change] Simplified the temporary models saving process by removing the thread that was controlling it. Actually the thread was unnacessary because the process was being executed in the main thread no matter if there was another thread to control the saving. +* [Change] Minor adjustment on the hint text resizing. +* [Change] Increasing to 5 minutes the period in which the temporary model saving will be executed. +* [Change] pgModeler will now use the official docs url in the help buttons. +* [Fix] Fixed a minor bug that was preventing the copy action to be enabled in DataManipulationForm. +* [Fix] Fixed some sample models to remove deprecated attributes. +* [Fix] Fixed a crash while renaming view's children objects. +* [Fix] Fixed the rendering of views which contain only a single reference that is the whole object's defintion. +* [Fix] Fixed the column name deduction for recursive views. +* [Fix] Fixed a bug that was causing crashes while configure new constraints on tables. +* [Fix] Fixed the view's resizing. +* [Fix] Fixed a regression in schema's rectangle selection. +* [Fix] Fixed the StyledTextboxView bounding rectangle. +* [Fix] Fixed an artifact when user switched on and off the compact view. +* [Fix] Fixed the Linux deploy script. +* [Fix] Fixed the macOs deploy script. +* [Fix] Fixed some compilation problems on macOs due to the usage of C++14. +* [Fix] Fixed some compilation problems on Windows due to the usage of C++14. +* [Fix] Fixed a bug in DatabaseModel::destroyObjects that could lead to segfault when the destroyed model had permissions on it. +* [Fix] Fixed a bug when importing columns which data types is some user defined type in form of array, e.g., custom_type[]. +* [Fix] Fixed a bug in SchemaParser that was causing only the first %set line in a if block to be parsed no matter that there were others %set below the same block. +* [Fix] Fixed the tooltip of some graphical objects by adding their comments and aliases. +* [Fix] Fixed the catalog query for tables to select partitioned tables correctly. +* [Fix] Fixed the catalog query for types to avoid selecting partitioned tables as being data types. +* [Fix] Fixed a bug that was causing special primary key configured on a relationship to make the original primary key of the table to disappear after disconnect the relationship. Now pgModeler stores in memory the original PK prior the connection of relationship and creation of the special PK. When disconnected the relationship, the original primary key is restored on its parent table. +* [Fix] Fixed the creation of elements (index, exclude, patition key) on DatabaseModel. +* [Fix] Fixed the class Relationship to reuse compatible columns when handling partitioning relationships. +* [Fix] Fixed the diff process in such way to create new columns with their respective COMMENT ON statement when present. +* [Fix] Fixed the detection of comment changes for columns on diff process. +* [Fix] Fixed the order of recent models saved on the file pgmodeler.conf. +* [Fix] Fixed a bug when creating a view reference as the whole view definition. +* [Fix] Minor tooltip fix on DatabaseExplorerWidget. +* [Fix] Making pgModeler honor the columns arrangement in primary keys. +* [Fix] Fixed a bug that was causing FK relationship deletion to crash the application sometimes. +* [Fix] Some fixes were done in the ModelOverviewWidget in order to support large models without exceed the screen size when configuring the size of the overall widget. +* [Fix] Fixes a bad erase in View::removeReference. +* [Fix] Fixed some bugs related to dialog size restoration in DataManipulationForm and TableWidget. + v0.9.2-alpha ------ Release date: August 20, 2018
diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0563e2773d..4ff262aa87 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,40 +1,64 @@ -v0.9.2-alpha +v0.9.2-alpha1 ------ -Release date: August 20, 2018
-Changes since: v0.9.1
- -Summary: this release does not have an extensive change log but brings some long desired features as well important fixes. The first feature to talk about is the long awaited SQL execution cancelling which enables the user to abort the execution of any command issued to the server in the SQL execution field (Manage view) without the need to kill the application in order to interrupt the running SQL (like on previous releases).
- -Another feature introduced is the compact view of the model. This one makes the tables and views smaller by hiding the columns' data types and other informations. This feature came as a support to those developers who need to present their models to an audience without database specific knowledge. The trick here is to replace the original names of graphical objects by more friendly ones so the audience can understand the essence of the model being worked without worry about the tech details.
- -Also I decided to include a functionality to save and restore the majority of dialogs sizes and their positions, another long requested feature. This one can be useful for those who don't want pgModeler to resize the forms automatically everytime (specially when working in high resolution screens or dual monitors environments). This feature comes activated by default on new installations and can be deactivated at general settings.
- -More features were implemented in this release too, being some of them: the support to sequence options on indentity columns, the support to bulk data edition on data manipulation dialog, the support to paste CSV text from clipboard into the dialog where initial data can be specified for tables (in design view) and some other.
- -One important change done was a partial refactoring of the View editing form by moving the fields related to view's references to a dedicated dialog making the whole form a bit less complicated to use. I have plans to keep improving that dialog in special but in future releases a full UX/UI remodeling will be done in the application.
- -Below some of the changes of this release, for the complete list of changes, please, take a look into the CHANGELOG.md.
- -* [New] Added the support to cancelling SQL execution in SQLExecutionWidget. -* [New] Added support to save/restore the dialogs sizes and positions. -* [New] Added support to truncate tables in DataManipulationForm. -* [New] Added support to aliases on some graphical objects to be is used in the compact view mode. -* [New] Added support to save/load object's metadata containing aliases information. -* [New] Added support to compact view of the model where graphical objects can have a more friendly name for a reduced view as well for those who don't need to see details about tables (clients of the business, for instance). -* [New] Added support to sequence options for identity columns. -* [New] Added the ability to paste CSV text from clipboard into the TableDataWidget. -* [New] Added support to bulk data edit in TableDataWidget. -* [Change] Changed the behaviour of the fade in/out of relationships linked to a table by applying the effect on the other tables that are related to the selected one. -* [Change] Refactored the view editing dialog by moving the references handling form to a dedicated modal dialog. -* [Change] Improved the model loading from file by blocking signals of relationships avoiding excessive/repetive rendering of objects. The whole model is fully rendered when the file was completely loaded. -* [Change] Minor adjustment on constraints rendering at extended attributes section of tables. -* [Fix] Minor fix on stylesheet in order to display the extended button on general toolbar. -* [Fix] Fix a shortcut conflict in DataManipulationform. -* [Fix] Fixed the offset of strings composing the StorageType. -* [Fix] Minor fix in SQLExecutionWidget allowing the output widget to be resized to a size lower than the default one. -* [Fix] Fixed the generation of Database object source in DatabaseExplorerWidget. -* [Fix] Minor fix in HintTextWidget to stay on top of all widget when being displayed. -* [Fix] Fixed a bug that was not quoting extension name when needed. -* [Fix] Fixed a crash when trying to remove a fk relationship when it was created from a foreign key which references protected columns (added by relationship). -* [Fix] Fix a crash when importing CSV files into DataManipulationForm. +Release date: December 17, 2018
+Changes since: v0.9.2-alpha
+ +Summary: finally, after four months, we have a new version out of the oven! This one has A LOT of changes that range from several code refactoring and performance improvements to the introduction of new interesting features like table partitioning and canvas layers.
+ +First, let's talk about the changes and improvements. The objects drawing operations received a good set of patches making it a bit faster and less memory consuming. Putting these improvements in numbers, we have reduced in ~40% the internal size of a database model which means less objects to keep in memory as well to be drawn giving a good performance gain. You can see more details here: https://bit.ly/2Q3XMT5
+ +The overall performance of the reverse engineering was improved which, in consequence, have enhanced the diff process performance as well. The diff process received some fixes and changes and now it is generating less false-positive changes.
+ +In the new features side, we added scene layers which goals is to introduce a new level of visual segmentation of graphical objects. Another new feature created is the support to view columns that are deduced from the relationships between these objects and the tables.
+ +Also, still in the design view, tables and views can have their attributes paginated or even collapsed to minimize the area occupied by these objects making big objects easier to visualize.
+ +Now, about the bug fixes, several crashes were eliminated making the tool more stable for different usages, the reverse engineering received some patches so it can import correctly user-defined type in form of arrays and many others
+ +Finally, some of the key changes of this release are listed below. For the complete list of changes, fixes and new feautures, please, read the CHANGELOG.md.
+ +* [New] Added support to scene layers. +* [New] Added support to view's columns importing in DatabaseImportHelper. +* [New] Added the ability to load view columns from database model file in DatabaseModel::createView. +* [New] Added a tab "Columns" in ReferenceWidget where the user will be able to insert columns to be used as view columns. +* [New] Added support to pagination of tables and views columns pagination. +* [New] Added a fix step on CLI to remove the deprecated attribute hide-ext-attribs from tables and views xml code. +* [New] Added a configuration option to control attributes per pages in tables and views. +* [New] Added support to save collapsing states and current attributes pages to the database model file. +* [New] Added support to OLD/NEW tables aliases on triggers. +* [New] Added support for partition attaching/detaching detection in diff process. +* [New] Added support to importing partitioned/partition tables on DatabaseImportHelper. +* [New] Added support to resize grid cells to fit contents on ObjectsTableWidget. +* [New] Added support to hide columns on data manipulation dialog. +* [Change] Minor fixes in OperationList in order to force views to be updated correctly when operating over a table which is referenced by those objects. +* [Change] Minor adjustments on SchemaView and BaseTableView (and its children classes) to update the geometry when they switch from invisble to visible state. +* [Change] Improved the update of views when referenced columns and tables change their structure. +* [Change] Improved database model loading times by avoiding the rendering of tables while the children objects (indexes, trigger, rules, etc) are being added. +* [Change] The zoom in/out level is now sensible on how much the user rolls the mouse wheel. +* [Change] Code refactoring done in order to make it more close to C++14 in order to take advantage of new features introduced by that standard. +* [Change] Improved the diff process in such way to avoid generating unnecessary/noise commands related to changing types of columns to integer and setting nextval() call as default value. +* [Change] Move the FK settings, copy options and name patterns group boxes to a dedicated tab on RelationshipWidget. +* [Change] Improved the models destruction when closing the application. +* [Change] Improved the Index/Exclude/ParitionKey elements handling by creating a generic form/grid that handles these kinds of objects (ElementsTableWidget). +* [Change] Modified the RelationshipWidget in order to handle partitioning relationships. +* [Change] Modified RelationshipConfigWidget in order to write name partterns for partitioning relationships. +* [Change] Improved the reverse engineering performance by avoiding update relationships as they are being imported. +* [Change] Improved the object duplication feature in ModelWidget. +* [Change] When the model is loaded it is copied to the temporary models storage as a first version of the temporary dbm file. +* [Change] pgModeler will now use the official docs url in the help buttons. +* [Fix] Fixed a crash while renaming view's children objects. +* [Fix] Fixed the rendering of views which contain only a single reference that is the whole object's defintion. +* [Fix] Fixed the column name deduction for recursive views. +* [Fix] Fixed a bug that was causing crashes while configure new constraints on tables. +* [Fix] Fixed a regression in schema's rectangle selection. +* [Fix] Fixed an artifact when user switched on and off the compact view. +* [Fix] Fixed a bug in DatabaseModel::destroyObjects that could lead to segfault when the destroyed model had permissions on it. +* [Fix] Fixed a bug when importing columns which data types is some user defined type in form of array, e.g., custom_type[]. +* [Fix] Fixed a bug that was causing special primary key configured on a relationship to make the original primary key of the table to disappear after disconnect the relationship. Now pgModeler stores in memory the original PK prior the connection of relationship and creation of the special PK. When disconnected the relationship, the original primary key is restored on its parent table. +* [Fix] Fixed the class Relationship to reuse compatible columns when handling partitioning relationships. +* [Fix] Fixed the diff process in such way to create new columns with their respective COMMENT ON statement when present. +* [Fix] Fixed the detection of comment changes for columns on diff process. +* [Fix] Making pgModeler honor the columns arrangement in primary keys. +* [Fix] Fixed a bug that was causing FK relationship deletion to crash the application sometimes. +* [Fix] Some fixes were done in the ModelOverviewWidget in order to support large models without exceed the screen size when configuring the size of the overall widget. From 104f0e73c7299ce9bdd6289b28507d1b04dd6573 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 29 Nov 2018 10:31:44 -0300 Subject: [PATCH 249/425] Additional update in RELEASENOTES.md --- RELEASENOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4ff262aa87..a5aa971b79 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -12,7 +12,7 @@ The overall performance of the reverse engineering was improved which, in conseq In the new features side, we added scene layers which goals is to introduce a new level of visual segmentation of graphical objects. Another new feature created is the support to view columns that are deduced from the relationships between these objects and the tables.
-Also, still in the design view, tables and views can have their attributes paginated or even collapsed to minimize the area occupied by these objects making big objects easier to visualize.
+Still in the design view in order to be more close to PostgreSQL 10+ new features pgModeler is now capable of handling declarative table partitioning (this includes code generation, reverse engineering and models comparison). Also, tables and views can have their attributes paginated or even collapsed to minimize the area occupied by these objects making big objects easier to visualize.
Now, about the bug fixes, several crashes were eliminated making the tool more stable for different usages, the reverse engineering received some patches so it can import correctly user-defined type in form of arrays and many others
From 0e5bf2bdd22ac8942d6265248ef8c0b4f2d0b604 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 2 Jan 2019 08:54:17 -0300 Subject: [PATCH 250/425] Fixed a bug in object finder that was causing objects from a hidden layer to be displayed causing inconsistency on the layer state (issue #1222). --- libobjrenderer/src/baseobjectview.h | 6 +++--- libpgmodeler_ui/src/modelwidget.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index fe2a2717d0..59a512cf1b 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -116,9 +116,6 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { //! \brief Defines in which layer the object is visible void setLayer(unsigned layer); - //! \brief Returns the layer in which the object is visible - unsigned getLayer(void); - public: static constexpr double VertSpacing=2.0f, HorizSpacing=2.0f, @@ -196,6 +193,9 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { //! \brief Returns the current factor between the default font size and the current defined one static double getFontFactor(void); + //! \brief Returns the layer in which the object is visible + unsigned getLayer(void); + protected slots: //! \brief Make the basic object operations void __configureObject(void); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index ea5a3a44e0..581d175a73 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -3462,7 +3462,7 @@ void ModelWidget::fadeObjects(const vector &objects, bool fade_in) obj_view->setOpacity(fade_in ? 1 : min_object_opacity); //If the minimum opacity is zero the object hidden - obj_view->setVisible(fade_in || (!fade_in && min_object_opacity > 0)); + obj_view->setVisible(scene->isLayerActive(obj_view->getLayer()) && (fade_in || (!fade_in && min_object_opacity > 0))); this->modified = true; } From 5b423793482d43b07a8e6e3c2624cf88a127ecdf Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 2 Jan 2019 11:55:38 -0300 Subject: [PATCH 251/425] Version upgrade 0.9.2-alpha1 -> 0.9.2-beta --- libutils/src/globalattributes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index ae3684174d..7895b2e3ec 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -25,7 +25,7 @@ namespace GlobalAttributes { PgModelerAppName=QString("pgmodeler"), PgModelerURI=QString("pgmodeler.io"), PGMODELER_REVERSE_URI=QString("io.pgmodeler"), - PgModelerVersion=QString("0.9.2-alpha1"), + PgModelerVersion=QString("0.9.2-beta"), PgModelerBuildNumber=QString(BUILDNUM), PgModelerSite=QString("https://pgmodeler.io"), PgModelerSupport=QString("https://pgmodeler.io/support/docs"), From 69a39a13322c2eff50f9c192432498cdf57efa34 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 3 Jan 2019 11:19:26 -0300 Subject: [PATCH 252/425] Fixed the CLI in order to restore the layers information when fixing a broken model (issue #1225) --- libpgmodeler/src/databasemodel.h | 1 + main-cli/src/pgmodelercli.cpp | 36 +++++++++++++++++++++++++------- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 8f6e890295..5e88537cce 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -648,6 +648,7 @@ class DatabaseModel: public QObject, public BaseObject { friend class DatabaseImportHelper; friend class ModelWidget; + friend class PgModelerCli; }; #endif diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index fadb229452..d07c1027b6 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -679,7 +679,6 @@ void PgModelerCli::extractObjectXML(void) QString buf, lin, def_xml, end_tag; QTextStream ts; QRegExp regexp(QString("^(\\<\\?xml)(.)*(\\<%1)( )*").arg(Attributes::DbModel)), - default_obj=QRegExp(QString("(default)(\\-)(schema|owner|collation|tablespace)")), //[schema].[func_name](...OUT [type]...) func_signature=QRegExp(QString("(\")(.)+(\\.)(.)+(\\()(.)*(OUT )(.)+(\\))(\")")), @@ -708,9 +707,37 @@ void PgModelerCli::extractObjectXML(void) throw Exception(trUtf8("Invalid input file! It seems that is not a pgModeler generated model or the file is corrupted!"), ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { + //Extracting layers informations from the tag + QRegExp dbm_regexp = QRegExp(TagExpr.arg(Attributes::DbModel)), + db_end_regexp = QRegExp(EndTagExpr.arg(Attributes::Database)); + int attr_start =-1, attr_end = -1, dbm_start = dbm_regexp.indexIn(buf); + QString aux_buf = buf.mid(dbm_start, buf.indexOf(db_end_regexp) - dbm_start), + layers, active_layers, attr_expr = QString("(%1)( )*(=)(\")"); + QList act_layers_ids; + + //Layers names + attr_start = aux_buf.indexOf(Attributes::Layers); + attr_end = aux_buf.indexOf(Attributes::ActiveLayers); + layers = aux_buf.mid(attr_start, attr_end - attr_start); + layers.remove(QRegExp(attr_expr.arg(Attributes::Layers))); + layers.remove('"'); + model->setLayers(layers.trimmed().split(';', QString::SkipEmptyParts)); + + //Active layers + attr_start = attr_end; + attr_end = aux_buf.indexOf('>', attr_start); + active_layers = aux_buf.mid(attr_start, attr_end - attr_start); + active_layers.remove(QRegExp(attr_expr.arg(Attributes::ActiveLayers))); + active_layers.remove('"'); + + for(auto id : active_layers.trimmed().split(';', QString::SkipEmptyParts)) + act_layers_ids.push_back(id.toUInt()); + + model->setActiveLayers(act_layers_ids); + //Remove the header entry from buffer buf.remove(start, regexp.matchedLength()+1); - buf.remove(0, buf.indexOf(QString("\n"))); + buf.remove(0, buf.indexOf(QString("<%1").arg(Attributes::Database))); buf.remove(QString("<\\%1>").arg(Attributes::DbModel)); ts.setString(&buf); @@ -739,14 +766,9 @@ void PgModelerCli::extractObjectXML(void) if(is_rel && (((short_tag && lin.contains(QString("/>"))) || (lin.contains(QString("[a-z]+")) && !containsRelAttributes(lin))))) open_tag=close_tag=true; - else if(lin.contains(default_obj)) - { - lin.clear(); - } else { //If the line contains an objects open tag - //if((lin.startsWith('<') || lin.startsWith(QString("\n<"))) && !open_tag) if(lin.contains(QRegExp("^(((\n)|(\t))*(<))")) && !open_tag) { //Check the flag indicating an open tag From 454b217d976b8cdaa2435b58d2b734e1dee1a882 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 10 Jan 2019 14:05:18 -0300 Subject: [PATCH 253/425] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running --- libpgmodeler_ui/src/sqlexecutionhelper.h | 1 - libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 +- libpgmodeler_ui/src/sqltoolwidget.cpp | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.h b/libpgmodeler_ui/src/sqlexecutionhelper.h index ab3c5205a4..d2ac5cf041 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.h +++ b/libpgmodeler_ui/src/sqlexecutionhelper.h @@ -67,7 +67,6 @@ class SQLExecutionHelper : public QObject { signals: void s_executionFinished(int rows_affected); - void s_executionCancelled(void); void s_executionAborted(Exception e); }; diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 91014d0669..68c9dd7df7 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -132,7 +132,6 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) sql_exec_hlp.moveToThread(&sql_exec_thread); connect(&sql_exec_thread, SIGNAL(started()), &sql_exec_hlp, SLOT(executeCommand())); - connect(&sql_exec_hlp, SIGNAL(s_executionCancelled()), this, SLOT(finishExecution())); connect(&sql_exec_hlp, SIGNAL(s_executionFinished(int)), this, SLOT(finishExecution(int))); connect(&sql_exec_hlp, SIGNAL(s_executionAborted(Exception)), &sql_exec_thread, SLOT(quit())); connect(&sql_exec_hlp, SIGNAL(s_executionAborted(Exception)), this, SLOT(handleExecutionAborted(Exception))); @@ -145,6 +144,7 @@ SQLExecutionWidget::~SQLExecutionWidget(void) { sql_exec_hlp.cancelCommand(); sql_exec_thread.quit(); + sql_exec_thread.wait(); } destroyResultModel(); diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index f6b4c9a347..4328a8d1cf 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -311,7 +311,10 @@ void SQLToolWidget::closeDatabaseExplorer(int idx) //Closing sql execution tabs related to the database to be closed for(QWidget *wgt : sql_exec_wgts[db_explorer]) + { sql_exec_tbw->removeTab(sql_exec_tbw->indexOf(wgt)); + delete(wgt); + } sql_exec_wgts.remove(db_explorer); databases_tbw->removeTab(idx); @@ -344,6 +347,7 @@ void SQLToolWidget::closeSQLExecutionTab(int idx) if(sql_exec_wgt) delete(sql_exec_wgt); + } void SQLToolWidget::showSnippet(const QString &snip) From 664b4e80964d2eb4ff18c01c7523d7decd7da239 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 19 Jan 2019 14:42:31 -0300 Subject: [PATCH 254/425] Fixed some compilation warning regarding to zero being assigned as null value on constructors declarations --- crashhandler/src/crashhandlerform.h | 2 +- libpgmodeler_ui/src/aggregatewidget.h | 2 +- libpgmodeler_ui/src/appearanceconfigwidget.h | 2 +- libpgmodeler_ui/src/baseform.h | 2 +- libpgmodeler_ui/src/baseobjectwidget.h | 2 +- libpgmodeler_ui/src/bugreportform.h | 2 +- libpgmodeler_ui/src/castwidget.h | 2 +- libpgmodeler_ui/src/collationwidget.h | 2 +- libpgmodeler_ui/src/colorpickerwidget.h | 2 +- libpgmodeler_ui/src/columnwidget.h | 2 +- libpgmodeler_ui/src/configurationform.h | 2 +- libpgmodeler_ui/src/connectionsconfigwidget.h | 2 +- libpgmodeler_ui/src/constraintwidget.h | 2 +- libpgmodeler_ui/src/conversionwidget.h | 2 +- libpgmodeler_ui/src/csvloadwidget.h | 2 +- libpgmodeler_ui/src/databaseexplorerwidget.h | 2 +- libpgmodeler_ui/src/databaseimportform.h | 2 +- libpgmodeler_ui/src/databasewidget.h | 2 +- libpgmodeler_ui/src/datamanipulationform.h | 2 +- libpgmodeler_ui/src/domainwidget.h | 2 +- libpgmodeler_ui/src/eventtriggerwidget.h | 2 +- libpgmodeler_ui/src/extensionwidget.h | 2 +- libpgmodeler_ui/src/findreplacewidget.h | 2 +- libpgmodeler_ui/src/functionwidget.h | 2 +- libpgmodeler_ui/src/generalconfigwidget.h | 2 +- libpgmodeler_ui/src/genericsqlwidget.h | 2 +- libpgmodeler_ui/src/htmlitemdelegate.h | 2 +- libpgmodeler_ui/src/indexwidget.h | 2 +- libpgmodeler_ui/src/languagewidget.h | 2 +- libpgmodeler_ui/src/messagebox.h | 2 +- libpgmodeler_ui/src/metadatahandlingform.h | 2 +- libpgmodeler_ui/src/modeldatabasediffform.h | 2 +- libpgmodeler_ui/src/modelexportform.h | 2 +- libpgmodeler_ui/src/modelfixform.h | 2 +- libpgmodeler_ui/src/modelnavigationwidget.h | 2 +- libpgmodeler_ui/src/modelobjectswidget.h | 2 +- libpgmodeler_ui/src/modelrestorationform.h | 2 +- libpgmodeler_ui/src/modelvalidationwidget.h | 2 +- libpgmodeler_ui/src/numberedtexteditor.h | 2 +- libpgmodeler_ui/src/objectdepsrefswidget.h | 2 +- libpgmodeler_ui/src/objectselectorwidget.h | 4 ++-- libpgmodeler_ui/src/objectstablewidget.h | 2 +- libpgmodeler_ui/src/operationlistwidget.h | 2 +- libpgmodeler_ui/src/operatorclasswidget.h | 2 +- libpgmodeler_ui/src/operatorfamilywidget.h | 2 +- libpgmodeler_ui/src/operatorwidget.h | 2 +- libpgmodeler_ui/src/parameterwidget.h | 2 +- libpgmodeler_ui/src/permissionwidget.h | 2 +- libpgmodeler_ui/src/pgsqltypewidget.h | 2 +- libpgmodeler_ui/src/relationshipconfigwidget.h | 2 +- libpgmodeler_ui/src/relationshipwidget.h | 2 +- libpgmodeler_ui/src/rolewidget.h | 2 +- libpgmodeler_ui/src/rulewidget.h | 2 +- libpgmodeler_ui/src/sceneinfowidget.h | 2 +- libpgmodeler_ui/src/schemawidget.h | 2 +- libpgmodeler_ui/src/sequencewidget.h | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.h | 2 +- libpgmodeler_ui/src/sourcecodewidget.h | 2 +- libpgmodeler_ui/src/sqlexecutionwidget.h | 2 +- libpgmodeler_ui/src/sqltoolwidget.h | 2 +- libpgmodeler_ui/src/tabledatawidget.h | 2 +- libpgmodeler_ui/src/tablespacewidget.h | 2 +- libpgmodeler_ui/src/tablewidget.h | 2 +- libpgmodeler_ui/src/tagwidget.h | 2 +- libpgmodeler_ui/src/textboxwidget.h | 2 +- libpgmodeler_ui/src/triggerwidget.h | 2 +- libpgmodeler_ui/src/typewidget.h | 2 +- libpgmodeler_ui/src/updatenotifierwidget.h | 2 +- libpgmodeler_ui/src/viewwidget.h | 2 +- libpgmodeler_ui/src/welcomewidget.h | 2 +- 70 files changed, 71 insertions(+), 71 deletions(-) diff --git a/crashhandler/src/crashhandlerform.h b/crashhandler/src/crashhandlerform.h index 456c2ec5e8..868c54d3a4 100644 --- a/crashhandler/src/crashhandlerform.h +++ b/crashhandler/src/crashhandlerform.h @@ -61,7 +61,7 @@ class CrashHandlerForm: public BugReportForm { //! \brief Analysis mode argument static const QString AnalysisMode; - CrashHandlerForm(bool analysis_mode=false, QWidget * parent = 0, Qt::WindowFlags f = 0); + CrashHandlerForm(bool analysis_mode=false, QWidget * parent = nullptr, Qt::WindowFlags f = 0); private slots: void loadReport(void); diff --git a/libpgmodeler_ui/src/aggregatewidget.h b/libpgmodeler_ui/src/aggregatewidget.h index 32b8936d3d..0903ff677c 100644 --- a/libpgmodeler_ui/src/aggregatewidget.h +++ b/libpgmodeler_ui/src/aggregatewidget.h @@ -55,7 +55,7 @@ class AggregateWidget: public BaseObjectWidget, public Ui::AggregateWidget { *transition_func_sel; public: - AggregateWidget(QWidget * parent = 0); + AggregateWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Aggregate *aggregate); private slots: diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.h b/libpgmodeler_ui/src/appearanceconfigwidget.h index 40e64f84cf..b6551b01e8 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.h +++ b/libpgmodeler_ui/src/appearanceconfigwidget.h @@ -73,7 +73,7 @@ class AppearanceConfigWidget: public BaseConfigWidget, public Ui::AppearanceConf void updatePlaceholderItem(void); public: - AppearanceConfigWidget(QWidget * parent=0); + AppearanceConfigWidget(QWidget * parent = nullptr); ~AppearanceConfigWidget(void); void saveConfiguration(void); diff --git a/libpgmodeler_ui/src/baseform.h b/libpgmodeler_ui/src/baseform.h index 9b94696bc0..9a9e96acd0 100644 --- a/libpgmodeler_ui/src/baseform.h +++ b/libpgmodeler_ui/src/baseform.h @@ -45,7 +45,7 @@ class BaseForm: public QDialog, public Ui::BaseForm { void closeEvent(QCloseEvent *); public: - BaseForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + BaseForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); void setButtonConfiguration(unsigned button_conf=Messagebox::OkCancelButtons); diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 9b58783220..89996bb7cf 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -144,7 +144,7 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { VERSIONS_INTERVAL=1, AFTER_VERSION=2; - BaseObjectWidget(QWidget * parent = 0, ObjectType obj_type=ObjectType::BaseObject); + BaseObjectWidget(QWidget * parent = nullptr, ObjectType obj_type=ObjectType::BaseObject); virtual ~BaseObjectWidget(void); diff --git a/libpgmodeler_ui/src/bugreportform.h b/libpgmodeler_ui/src/bugreportform.h index 0b218f5552..876b4caa25 100644 --- a/libpgmodeler_ui/src/bugreportform.h +++ b/libpgmodeler_ui/src/bugreportform.h @@ -47,7 +47,7 @@ class BugReportForm : public QDialog, public Ui::BugReportForm { void generateReport(const QByteArray &buf); public: - BugReportForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + BugReportForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); public slots: void generateReport(void); diff --git a/libpgmodeler_ui/src/castwidget.h b/libpgmodeler_ui/src/castwidget.h index 157a779e74..ade9386e2c 100644 --- a/libpgmodeler_ui/src/castwidget.h +++ b/libpgmodeler_ui/src/castwidget.h @@ -40,7 +40,7 @@ class CastWidget: public BaseObjectWidget, public Ui::CastWidget { ObjectSelectorWidget *conv_func_sel; public: - CastWidget(QWidget * parent = 0); + CastWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Cast *cast); public slots: diff --git a/libpgmodeler_ui/src/collationwidget.h b/libpgmodeler_ui/src/collationwidget.h index 8a287e5f50..e181ed226a 100644 --- a/libpgmodeler_ui/src/collationwidget.h +++ b/libpgmodeler_ui/src/collationwidget.h @@ -33,7 +33,7 @@ class CollationWidget: public BaseObjectWidget, public Ui::CollationWidget { Q_OBJECT public: - CollationWidget(QWidget * parent = 0); + CollationWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Collation *collation); public slots: diff --git a/libpgmodeler_ui/src/colorpickerwidget.h b/libpgmodeler_ui/src/colorpickerwidget.h index a90cc84d6f..946d4328c2 100644 --- a/libpgmodeler_ui/src/colorpickerwidget.h +++ b/libpgmodeler_ui/src/colorpickerwidget.h @@ -55,7 +55,7 @@ class ColorPickerWidget: public QWidget, public Ui::ColorPickerWidget { public: static constexpr int MaxColorButtons=20; - explicit ColorPickerWidget(int color_count, QWidget * parent = 0); + explicit ColorPickerWidget(int color_count, QWidget * parent = nullptr); void setColor(int color_idx, const QColor &color); QColor getColor(int color_idx); diff --git a/libpgmodeler_ui/src/columnwidget.h b/libpgmodeler_ui/src/columnwidget.h index c1b8780a0d..09faef2a7b 100644 --- a/libpgmodeler_ui/src/columnwidget.h +++ b/libpgmodeler_ui/src/columnwidget.h @@ -39,7 +39,7 @@ class ColumnWidget: public BaseObjectWidget, public Ui::ColumnWidget { Sequence ident_col_seq; public: - ColumnWidget(QWidget * parent = 0); + ColumnWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Column *column); private slots: diff --git a/libpgmodeler_ui/src/configurationform.h b/libpgmodeler_ui/src/configurationform.h index b81345ddb9..389566d39a 100644 --- a/libpgmodeler_ui/src/configurationform.h +++ b/libpgmodeler_ui/src/configurationform.h @@ -55,7 +55,7 @@ class ConfigurationForm: public QDialog, public Ui::ConfigurationForm { SnippetsConfWgt=4, PluginsConfWgt=5; - ConfigurationForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + ConfigurationForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); ~ConfigurationForm(void); BaseConfigWidget *getConfigurationWidget(unsigned idx); diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.h b/libpgmodeler_ui/src/connectionsconfigwidget.h index c371dedcd8..40c9dd3980 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.h +++ b/libpgmodeler_ui/src/connectionsconfigwidget.h @@ -54,7 +54,7 @@ class ConnectionsConfigWidget: public BaseConfigWidget, public Ui::ConnectionsCo void updateConnectionsCombo(void); public: - ConnectionsConfigWidget(QWidget * parent=0); + ConnectionsConfigWidget(QWidget * parent = nullptr); ~ConnectionsConfigWidget(void); void saveConfiguration(void); diff --git a/libpgmodeler_ui/src/constraintwidget.h b/libpgmodeler_ui/src/constraintwidget.h index 8899355f46..2efb2da960 100644 --- a/libpgmodeler_ui/src/constraintwidget.h +++ b/libpgmodeler_ui/src/constraintwidget.h @@ -56,7 +56,7 @@ class ConstraintWidget: public BaseObjectWidget, public Ui::ConstraintWidget { void addColumn(Column *column, unsigned col_id, int row); public: - ConstraintWidget(QWidget * parent = 0); + ConstraintWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Constraint *constr); private slots: diff --git a/libpgmodeler_ui/src/conversionwidget.h b/libpgmodeler_ui/src/conversionwidget.h index 1bf00490c6..622947d7b3 100644 --- a/libpgmodeler_ui/src/conversionwidget.h +++ b/libpgmodeler_ui/src/conversionwidget.h @@ -34,7 +34,7 @@ class ConversionWidget: public BaseObjectWidget, public Ui::ConversionWidget { ObjectSelectorWidget *conv_func_sel; public: - ConversionWidget(QWidget * parent = 0); + ConversionWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Conversion *conv); private slots: diff --git a/libpgmodeler_ui/src/csvloadwidget.h b/libpgmodeler_ui/src/csvloadwidget.h index ec5f875858..5fe243299a 100644 --- a/libpgmodeler_ui/src/csvloadwidget.h +++ b/libpgmodeler_ui/src/csvloadwidget.h @@ -42,7 +42,7 @@ class CsvLoadWidget : public QWidget, Ui::CsvLoadWidget { QList csv_rows; public: - CsvLoadWidget(QWidget * parent = 0, bool cols_in_first_row = true); + CsvLoadWidget(QWidget * parent = nullptr, bool cols_in_first_row = true); //! \brief Returns the extracted columns QStringList getCsvColumns(void); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.h b/libpgmodeler_ui/src/databaseexplorerwidget.h index 2eafb93f78..e5a0f84e3e 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.h +++ b/libpgmodeler_ui/src/databaseexplorerwidget.h @@ -144,7 +144,7 @@ class DatabaseExplorerWidget: public QWidget, public Ui::DatabaseExplorerWidget QString getObjectSource(BaseObject *object, DatabaseModel *dbmodel); public: - DatabaseExplorerWidget(QWidget * parent = 0); + DatabaseExplorerWidget(QWidget * parent = nullptr); //! \brief Configures the connection used to retrieve and manipulate objects on database void setConnection(Connection conn, const QString &default_db); diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index cc890bab14..a95c422739 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -90,7 +90,7 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { ObjectCount=8, ObjectSource=9; //Only for gropus - DatabaseImportForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + DatabaseImportForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); ~DatabaseImportForm(void); void setModelWidget(ModelWidget *model); diff --git a/libpgmodeler_ui/src/databasewidget.h b/libpgmodeler_ui/src/databasewidget.h index dbc7b1aefe..c44306b4d4 100644 --- a/libpgmodeler_ui/src/databasewidget.h +++ b/libpgmodeler_ui/src/databasewidget.h @@ -38,7 +38,7 @@ class DatabaseWidget: public BaseObjectWidget, public Ui::DatabaseWidget { *def_tablespace_sel; public: - DatabaseWidget(QWidget * parent = 0); + DatabaseWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model); diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index e0dbdf674e..6e1a52879b 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -112,7 +112,7 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { void setColumnsCheckState(Qt::CheckState state); public: - DataManipulationForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + DataManipulationForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); //! \brief Defines the connection and current schema and table to be handled, this method should be called before show the dialog void setAttributes(Connection conn, const QString curr_schema=QString("public"), const QString curr_table=QString(), const QString &filter=QString()); diff --git a/libpgmodeler_ui/src/domainwidget.h b/libpgmodeler_ui/src/domainwidget.h index 1f538bc855..539476901c 100644 --- a/libpgmodeler_ui/src/domainwidget.h +++ b/libpgmodeler_ui/src/domainwidget.h @@ -39,7 +39,7 @@ class DomainWidget: public BaseObjectWidget, public Ui::DomainWidget { ObjectsTableWidget *constr_tab; public: - DomainWidget(QWidget * parent = 0); + DomainWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Domain *domain); private slots: diff --git a/libpgmodeler_ui/src/eventtriggerwidget.h b/libpgmodeler_ui/src/eventtriggerwidget.h index b6dfb1e41c..b9a18de392 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.h +++ b/libpgmodeler_ui/src/eventtriggerwidget.h @@ -38,7 +38,7 @@ class EventTriggerWidget: public BaseObjectWidget, public Ui::EventTriggerWidget ObjectSelectorWidget *function_sel; public: - EventTriggerWidget(QWidget * parent = 0); + EventTriggerWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, EventTrigger *event_trig); public slots: diff --git a/libpgmodeler_ui/src/extensionwidget.h b/libpgmodeler_ui/src/extensionwidget.h index a665234e34..f5f6a1f967 100644 --- a/libpgmodeler_ui/src/extensionwidget.h +++ b/libpgmodeler_ui/src/extensionwidget.h @@ -33,7 +33,7 @@ class ExtensionWidget: public BaseObjectWidget, public Ui::ExtensionWidget { Q_OBJECT public: - ExtensionWidget(QWidget * parent = 0); + ExtensionWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Extension *ext); diff --git a/libpgmodeler_ui/src/findreplacewidget.h b/libpgmodeler_ui/src/findreplacewidget.h index 1c5fbcd17c..d3aef0d7bb 100644 --- a/libpgmodeler_ui/src/findreplacewidget.h +++ b/libpgmodeler_ui/src/findreplacewidget.h @@ -45,7 +45,7 @@ class FindReplaceWidget: public QWidget, public Ui::FindReplaceWidget { void showEvent(QShowEvent *); public: - FindReplaceWidget(QPlainTextEdit *txt_edit, QWidget * parent = 0); + FindReplaceWidget(QPlainTextEdit *txt_edit, QWidget * parent = nullptr); public slots: void replaceText(void); diff --git a/libpgmodeler_ui/src/functionwidget.h b/libpgmodeler_ui/src/functionwidget.h index 491863c282..2ad2a166e0 100644 --- a/libpgmodeler_ui/src/functionwidget.h +++ b/libpgmodeler_ui/src/functionwidget.h @@ -64,7 +64,7 @@ class FunctionWidget: public BaseObjectWidget, public Ui::FunctionWidget { void validateConfiguredFunction(void); public: - FunctionWidget(QWidget * parent = 0); + FunctionWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Function *func); diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index 183d60f143..eb67299f66 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -69,7 +69,7 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg ColorPickerWidget *line_numbers_cp, *line_numbers_bg_cp, *line_highlight_cp; public: - GeneralConfigWidget(QWidget * parent=0); + GeneralConfigWidget(QWidget * parent = nullptr); void saveConfiguration(void); void loadConfiguration(void); diff --git a/libpgmodeler_ui/src/genericsqlwidget.h b/libpgmodeler_ui/src/genericsqlwidget.h index 41586fdcf8..8d3929ad55 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.h +++ b/libpgmodeler_ui/src/genericsqlwidget.h @@ -40,7 +40,7 @@ class GenericSQLWidget: public BaseObjectWidget, public Ui::GenericSQLWidget { CodeCompletionWidget *definition_cp; public: - GenericSQLWidget(QWidget * parent = 0); + GenericSQLWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, GenericSQL *genericsql=nullptr); diff --git a/libpgmodeler_ui/src/htmlitemdelegate.h b/libpgmodeler_ui/src/htmlitemdelegate.h index 902e9d2ee4..2f1b42ec4e 100644 --- a/libpgmodeler_ui/src/htmlitemdelegate.h +++ b/libpgmodeler_ui/src/htmlitemdelegate.h @@ -34,7 +34,7 @@ class HtmlItemDelegate : public PlainTextItemDelegate { Q_OBJECT public: - HtmlItemDelegate(QObject * parent = 0); + HtmlItemDelegate(QObject * parent = nullptr); ~HtmlItemDelegate(void); protected: diff --git a/libpgmodeler_ui/src/indexwidget.h b/libpgmodeler_ui/src/indexwidget.h index 9e550f025d..1841c7c4d3 100644 --- a/libpgmodeler_ui/src/indexwidget.h +++ b/libpgmodeler_ui/src/indexwidget.h @@ -41,7 +41,7 @@ class IndexWidget: public BaseObjectWidget, public Ui::IndexWidget { ElementsTableWidget *elements_tab; public: - IndexWidget(QWidget * parent = 0); + IndexWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, BaseTable *parent_obj, Index *index); private slots: diff --git a/libpgmodeler_ui/src/languagewidget.h b/libpgmodeler_ui/src/languagewidget.h index dad3985938..767c0a5dbe 100644 --- a/libpgmodeler_ui/src/languagewidget.h +++ b/libpgmodeler_ui/src/languagewidget.h @@ -37,7 +37,7 @@ class LanguageWidget: public BaseObjectWidget, public Ui::LanguageWidget { *func_inline_sel; public: - LanguageWidget(QWidget * parent = 0); + LanguageWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Language *language); diff --git a/libpgmodeler_ui/src/messagebox.h b/libpgmodeler_ui/src/messagebox.h index 51552e1515..d60767a571 100644 --- a/libpgmodeler_ui/src/messagebox.h +++ b/libpgmodeler_ui/src/messagebox.h @@ -48,7 +48,7 @@ class Messagebox: public QDialog, public Ui::Messagebox { OkButton=2, AllButtons=3; - Messagebox(QWidget * parent = 0, Qt::WindowFlags f = 0); + Messagebox(QWidget * parent = nullptr, Qt::WindowFlags f = 0); /*! \brief Shows the message box defining the icons and available buttons. User can specify custom button labels as well custom icons. The icons can be a path to a local file diff --git a/libpgmodeler_ui/src/metadatahandlingform.h b/libpgmodeler_ui/src/metadatahandlingform.h index 17b42dae7e..544e2a58b6 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.h +++ b/libpgmodeler_ui/src/metadatahandlingform.h @@ -48,7 +48,7 @@ class MetadataHandlingForm: public QDialog, public Ui::MetadataHandlingForm { void selectFile(bool is_output); public: - MetadataHandlingForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + MetadataHandlingForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); void setModelWidget(ModelWidget *model_wgt); void setModelWidgets(QList models); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index 491dafa83c..32e8d8d999 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -116,7 +116,7 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { ExportThread=3; public: - ModelDatabaseDiffForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + ModelDatabaseDiffForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); ~ModelDatabaseDiffForm(void); void setModelWidget(ModelWidget *model_wgt); diff --git a/libpgmodeler_ui/src/modelexportform.h b/libpgmodeler_ui/src/modelexportform.h index ecc520605f..a4df2e8644 100644 --- a/libpgmodeler_ui/src/modelexportform.h +++ b/libpgmodeler_ui/src/modelexportform.h @@ -59,7 +59,7 @@ class ModelExportForm: public QDialog, public Ui::ModelExportForm { int exec(void){ return(QDialog::Rejected); } public: - ModelExportForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + ModelExportForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); public slots: void exec(ModelWidget *model); diff --git a/libpgmodeler_ui/src/modelfixform.h b/libpgmodeler_ui/src/modelfixform.h index 7387179942..37b1614d7d 100644 --- a/libpgmodeler_ui/src/modelfixform.h +++ b/libpgmodeler_ui/src/modelfixform.h @@ -41,7 +41,7 @@ class ModelFixForm: public QDialog, public Ui::ModelFixForm { void hideEvent(QHideEvent *); public: - ModelFixForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + ModelFixForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); public slots: int exec(void); diff --git a/libpgmodeler_ui/src/modelnavigationwidget.h b/libpgmodeler_ui/src/modelnavigationwidget.h index 900573849b..b89aaa061b 100644 --- a/libpgmodeler_ui/src/modelnavigationwidget.h +++ b/libpgmodeler_ui/src/modelnavigationwidget.h @@ -38,7 +38,7 @@ class ModelNavigationWidget: public QWidget, public Ui::ModelNavigationWidget { void enableNavigationButtons(void); public: - ModelNavigationWidget(QWidget * parent = 0); + ModelNavigationWidget(QWidget * parent = nullptr); //! \brief Returns the combo's current index int getCurrentIndex(void); diff --git a/libpgmodeler_ui/src/modelobjectswidget.h b/libpgmodeler_ui/src/modelobjectswidget.h index e4616a6b3e..0c647e3d6f 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.h +++ b/libpgmodeler_ui/src/modelobjectswidget.h @@ -98,7 +98,7 @@ class ModelObjectsWidget: public QWidget, public Ui::ModelObjectsWidget { bool eventFilter(QObject *object, QEvent *event); public: - ModelObjectsWidget(bool simplified_view=false, QWidget * parent = 0); + ModelObjectsWidget(bool simplified_view=false, QWidget * parent = nullptr); BaseObject *getSelectedObject(void); diff --git a/libpgmodeler_ui/src/modelrestorationform.h b/libpgmodeler_ui/src/modelrestorationform.h index f859f004e3..088e647784 100644 --- a/libpgmodeler_ui/src/modelrestorationform.h +++ b/libpgmodeler_ui/src/modelrestorationform.h @@ -37,7 +37,7 @@ class ModelRestorationForm: public QDialog, public Ui::ModelRestorationForm { HintTextWidget * keep_models_ht; public: - ModelRestorationForm(QWidget * parent = 0, Qt::WindowFlags f = 0); + ModelRestorationForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); //! \brief Returns the list of temporary files existant on tmp/ dir QStringList getTemporaryModels(void); diff --git a/libpgmodeler_ui/src/modelvalidationwidget.h b/libpgmodeler_ui/src/modelvalidationwidget.h index aecc877b39..f8c88d597f 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.h +++ b/libpgmodeler_ui/src/modelvalidationwidget.h @@ -74,7 +74,7 @@ class ModelValidationWidget: public QWidget, public Ui::ModelValidationWidget { void resizeEvent(QResizeEvent *event); public: - ModelValidationWidget(QWidget * parent = 0); + ModelValidationWidget(QWidget * parent = nullptr); //! \brief Sets the database model to work on void setModel(ModelWidget *model_wgt); diff --git a/libpgmodeler_ui/src/numberedtexteditor.h b/libpgmodeler_ui/src/numberedtexteditor.h index 168d12846c..bb85442bc2 100644 --- a/libpgmodeler_ui/src/numberedtexteditor.h +++ b/libpgmodeler_ui/src/numberedtexteditor.h @@ -85,7 +85,7 @@ class NumberedTextEditor : public QPlainTextEdit { void keyPressEvent(QKeyEvent *event); public: - NumberedTextEditor(QWidget * parent = 0, bool handle_ext_files = false); + NumberedTextEditor(QWidget * parent = nullptr, bool handle_ext_files = false); ~NumberedTextEditor(void); static void setDefaultFont(const QFont &font); diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.h b/libpgmodeler_ui/src/objectdepsrefswidget.h index 36aa66960e..82e3e0f55e 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.h +++ b/libpgmodeler_ui/src/objectdepsrefswidget.h @@ -38,7 +38,7 @@ class ObjectDepsRefsWidget: public BaseObjectWidget, public Ui::ObjectDepsRefsWi void setAttributes(DatabaseModel *model, BaseObject *object, BaseObject *parent_obj); public: - ObjectDepsRefsWidget(QWidget * parent = 0); + ObjectDepsRefsWidget(QWidget * parent = nullptr); void setAttributes(ModelWidget *model_wgt, BaseObject *object, BaseObject *parent_obj=nullptr); public slots: diff --git a/libpgmodeler_ui/src/objectselectorwidget.h b/libpgmodeler_ui/src/objectselectorwidget.h index 2ea94b0411..2834c592eb 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.h +++ b/libpgmodeler_ui/src/objectselectorwidget.h @@ -56,8 +56,8 @@ class ObjectSelectorWidget: public QWidget, public Ui::ObjectSelectorWidget { bool eventFilter(QObject *obj, QEvent *evnt); public: - ObjectSelectorWidget(ObjectType sel_obj_type, bool install_highlighter, QWidget * parent = 0); - ObjectSelectorWidget(vector sel_obj_types, bool install_highlighter, QWidget * parent = 0); + ObjectSelectorWidget(ObjectType sel_obj_type, bool install_highlighter, QWidget * parent = nullptr); + ObjectSelectorWidget(vector sel_obj_types, bool install_highlighter, QWidget * parent = nullptr); ~ObjectSelectorWidget(void); //! \brief Enables the creation of new objects from withing the object selector dialog diff --git a/libpgmodeler_ui/src/objectstablewidget.h b/libpgmodeler_ui/src/objectstablewidget.h index bca07c44cc..8bc4bc56b1 100644 --- a/libpgmodeler_ui/src/objectstablewidget.h +++ b/libpgmodeler_ui/src/objectstablewidget.h @@ -55,7 +55,7 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { AllButtons=255, NoButtons=0; - ObjectsTableWidget(unsigned button_conf=AllButtons, bool conf_exclusion=false, QWidget * parent = 0); + ObjectsTableWidget(unsigned button_conf=AllButtons, bool conf_exclusion=false, QWidget * parent = nullptr); //! \brief Sets the table's column count void setColumnCount(unsigned col_count); diff --git a/libpgmodeler_ui/src/operationlistwidget.h b/libpgmodeler_ui/src/operationlistwidget.h index 1647ed265a..1577571e35 100644 --- a/libpgmodeler_ui/src/operationlistwidget.h +++ b/libpgmodeler_ui/src/operationlistwidget.h @@ -40,7 +40,7 @@ class OperationListWidget: public QWidget, public Ui::OperationListWidget { void notifyUpdateOnModel(void); public: - OperationListWidget(QWidget * parent = 0); + OperationListWidget(QWidget * parent = nullptr); public slots: void updateOperationList(void); diff --git a/libpgmodeler_ui/src/operatorclasswidget.h b/libpgmodeler_ui/src/operatorclasswidget.h index 6314db2e3d..059414d672 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.h +++ b/libpgmodeler_ui/src/operatorclasswidget.h @@ -52,7 +52,7 @@ class OperatorClassWidget: public BaseObjectWidget, public Ui::OperatorClassWidg ObjectsTableWidget *elements_tab; public: - OperatorClassWidget(QWidget * parent = 0); + OperatorClassWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, OperatorClass *op_class); private slots: diff --git a/libpgmodeler_ui/src/operatorfamilywidget.h b/libpgmodeler_ui/src/operatorfamilywidget.h index f435da9651..11fba3c3a6 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.h +++ b/libpgmodeler_ui/src/operatorfamilywidget.h @@ -33,7 +33,7 @@ class OperatorFamilyWidget: public BaseObjectWidget, public Ui::OperatorFamilyWi Q_OBJECT public: - OperatorFamilyWidget(QWidget * parent = 0); + OperatorFamilyWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, OperatorFamily *op_family); public slots: diff --git a/libpgmodeler_ui/src/operatorwidget.h b/libpgmodeler_ui/src/operatorwidget.h index 706a071e85..e58493f610 100644 --- a/libpgmodeler_ui/src/operatorwidget.h +++ b/libpgmodeler_ui/src/operatorwidget.h @@ -39,7 +39,7 @@ class OperatorWidget: public BaseObjectWidget, public Ui::OperatorWidget { *operators_sel[2]; public: - OperatorWidget(QWidget * parent = 0); + OperatorWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Operator *oper); diff --git a/libpgmodeler_ui/src/parameterwidget.h b/libpgmodeler_ui/src/parameterwidget.h index 24ff1037e7..42fab1d55f 100644 --- a/libpgmodeler_ui/src/parameterwidget.h +++ b/libpgmodeler_ui/src/parameterwidget.h @@ -37,7 +37,7 @@ class ParameterWidget: public BaseObjectWidget, public Ui::ParameterWidget { Parameter parameter; public: - ParameterWidget(QWidget * parent = 0); + ParameterWidget(QWidget * parent = nullptr); void setAttributes(Parameter parameter, DatabaseModel *model); Parameter getParameter(void); diff --git a/libpgmodeler_ui/src/permissionwidget.h b/libpgmodeler_ui/src/permissionwidget.h index deea3720c4..6901629e72 100644 --- a/libpgmodeler_ui/src/permissionwidget.h +++ b/libpgmodeler_ui/src/permissionwidget.h @@ -53,7 +53,7 @@ class PermissionWidget: public BaseObjectWidget, public Ui::PermissionWidget { bool perms_changed; public: - PermissionWidget(QWidget * parent = 0); + PermissionWidget(QWidget * parent = nullptr); ~PermissionWidget(void); void setAttributes(DatabaseModel *model, BaseObject *objeto_pai, BaseObject *object); diff --git a/libpgmodeler_ui/src/pgsqltypewidget.h b/libpgmodeler_ui/src/pgsqltypewidget.h index 5de7574e69..fe07264c4f 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.h +++ b/libpgmodeler_ui/src/pgsqltypewidget.h @@ -47,7 +47,7 @@ class PgSQLTypeWidget: public QWidget, public Ui::PgSQLTypeWidget { static const QString InvalidType; public: - PgSQLTypeWidget(QWidget * parent = 0, const QString &label=QString()); + PgSQLTypeWidget(QWidget * parent = nullptr, const QString &label=QString()); /*! \brief Lists the PostgreSQL types on the specified combo. The user can configure which types must be shown using the last tree parameters. The DatabaseModel parameter is used to diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.h b/libpgmodeler_ui/src/relationshipconfigwidget.h index cd87c9bac7..9a87ba50bb 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.h +++ b/libpgmodeler_ui/src/relationshipconfigwidget.h @@ -45,7 +45,7 @@ class RelationshipConfigWidget: public BaseConfigWidget, public Ui::Relationshi void hideEvent(QHideEvent *); public: - RelationshipConfigWidget(QWidget * parent=0); + RelationshipConfigWidget(QWidget * parent = nullptr); void saveConfiguration(void); void loadConfiguration(void); diff --git a/libpgmodeler_ui/src/relationshipwidget.h b/libpgmodeler_ui/src/relationshipwidget.h index e3c4e03825..cb49120bc2 100644 --- a/libpgmodeler_ui/src/relationshipwidget.h +++ b/libpgmodeler_ui/src/relationshipwidget.h @@ -84,7 +84,7 @@ class RelationshipWidget: public BaseObjectWidget, public Ui::RelationshipWidget void setAttributes(DatabaseModel *model, OperationList *op_list, Table *src_tab, Table *dst_tab, unsigned rel_type); public: - RelationshipWidget(QWidget * parent = 0); + RelationshipWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, BaseRelationship *base_rel); QSize getIdealSize(void); diff --git a/libpgmodeler_ui/src/rolewidget.h b/libpgmodeler_ui/src/rolewidget.h index 1007af38a9..07b73159aa 100644 --- a/libpgmodeler_ui/src/rolewidget.h +++ b/libpgmodeler_ui/src/rolewidget.h @@ -46,7 +46,7 @@ class RoleWidget: public BaseObjectWidget, public Ui::RoleWidget { void showRoleData(Role *role, unsigned table_id, unsigned row); public: - RoleWidget(QWidget * parent = 0); + RoleWidget(QWidget * parent = nullptr); ~RoleWidget(void); void setAttributes(DatabaseModel *model, OperationList *op_list, Role *role); diff --git a/libpgmodeler_ui/src/rulewidget.h b/libpgmodeler_ui/src/rulewidget.h index 925e8398f0..de46dbc0cc 100644 --- a/libpgmodeler_ui/src/rulewidget.h +++ b/libpgmodeler_ui/src/rulewidget.h @@ -42,7 +42,7 @@ class RuleWidget: public BaseObjectWidget, public Ui::RuleWidget { ObjectsTableWidget *commands_tab; public: - RuleWidget(QWidget * parent = 0); + RuleWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, BaseTable *parent_tab, Rule *rule); private slots: diff --git a/libpgmodeler_ui/src/sceneinfowidget.h b/libpgmodeler_ui/src/sceneinfowidget.h index 33b4d2c9b6..09672ea355 100644 --- a/libpgmodeler_ui/src/sceneinfowidget.h +++ b/libpgmodeler_ui/src/sceneinfowidget.h @@ -33,7 +33,7 @@ class SceneInfoWidget: public QWidget, public Ui::SceneInfoWidget { Q_OBJECT public: - SceneInfoWidget(QWidget * parent = 0); + SceneInfoWidget(QWidget * parent = nullptr); public slots: void updateSelectedObject(BaseObjectView *object); diff --git a/libpgmodeler_ui/src/schemawidget.h b/libpgmodeler_ui/src/schemawidget.h index 8808e8a393..827599ae08 100644 --- a/libpgmodeler_ui/src/schemawidget.h +++ b/libpgmodeler_ui/src/schemawidget.h @@ -36,7 +36,7 @@ class SchemaWidget: public BaseObjectWidget, public Ui::SchemaWidget { ColorPickerWidget *color_picker; public: - SchemaWidget(QWidget * parent = 0); + SchemaWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema); public slots: diff --git a/libpgmodeler_ui/src/sequencewidget.h b/libpgmodeler_ui/src/sequencewidget.h index 47b3cadc53..cf78563a57 100644 --- a/libpgmodeler_ui/src/sequencewidget.h +++ b/libpgmodeler_ui/src/sequencewidget.h @@ -43,7 +43,7 @@ class SequenceWidget: public BaseObjectWidget, public Ui::SequenceWidget { void setAttributesReadonly(DatabaseModel *model, OperationList *op_list, Schema *schema, Sequence *sequence, Column *column); public: - SequenceWidget(QWidget * parent = 0); + SequenceWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Sequence *sequence); public slots: diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.h b/libpgmodeler_ui/src/snippetsconfigwidget.h index 77d8dcdb1c..f7606b6ff5 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.h +++ b/libpgmodeler_ui/src/snippetsconfigwidget.h @@ -66,7 +66,7 @@ class SnippetsConfigWidget: public BaseConfigWidget, public Ui::SnippetsConfigWi attribs_map getSnippetAttributes(void); public: - SnippetsConfigWidget(QWidget * parent=0); + SnippetsConfigWidget(QWidget * parent = nullptr); void saveConfiguration(void); void loadConfiguration(void); diff --git a/libpgmodeler_ui/src/sourcecodewidget.h b/libpgmodeler_ui/src/sourcecodewidget.h index e263747b8a..9c638c21e4 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.h +++ b/libpgmodeler_ui/src/sourcecodewidget.h @@ -47,7 +47,7 @@ class SourceCodeWidget: public BaseObjectWidget, public Ui::SourceCodeWidget { HintTextWidget *code_options_ht; public: - SourceCodeWidget(QWidget * parent = 0); + SourceCodeWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, BaseObject *object=nullptr); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index fb797fac81..3a2aadc45c 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -104,7 +104,7 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { public: static const QString ColumnNullValue; - SQLExecutionWidget(QWidget * parent = 0); + SQLExecutionWidget(QWidget * parent = nullptr); ~SQLExecutionWidget(void); //! \brief Configures the connection to query the server diff --git a/libpgmodeler_ui/src/sqltoolwidget.h b/libpgmodeler_ui/src/sqltoolwidget.h index 841a352935..551f2a68f8 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.h +++ b/libpgmodeler_ui/src/sqltoolwidget.h @@ -55,7 +55,7 @@ class SQLToolWidget: public QWidget, public Ui::SQLToolWidget { bool eventFilter(QObject *object, QEvent *event); public: - SQLToolWidget(QWidget * parent = 0); + SQLToolWidget(QWidget * parent = nullptr); ~SQLToolWidget(void); //! \brief Force the update of the sql command input field and the syntax highligter attached to the opened tabs diff --git a/libpgmodeler_ui/src/tabledatawidget.h b/libpgmodeler_ui/src/tabledatawidget.h index db0069edd0..44df3a492e 100644 --- a/libpgmodeler_ui/src/tabledatawidget.h +++ b/libpgmodeler_ui/src/tabledatawidget.h @@ -61,7 +61,7 @@ class TableDataWidget: public BaseObjectWidget, public Ui::TableDataWidget { public: static const QString PlaceholderColumn; - TableDataWidget(QWidget * parent = 0); + TableDataWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, Table *table); diff --git a/libpgmodeler_ui/src/tablespacewidget.h b/libpgmodeler_ui/src/tablespacewidget.h index 2d2590fe11..4baee8a910 100644 --- a/libpgmodeler_ui/src/tablespacewidget.h +++ b/libpgmodeler_ui/src/tablespacewidget.h @@ -33,7 +33,7 @@ class TablespaceWidget: public BaseObjectWidget, public Ui::TablespaceWidget { Q_OBJECT public: - TablespaceWidget(QWidget * parent = 0); + TablespaceWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Tablespace *tablespc); public slots: diff --git a/libpgmodeler_ui/src/tablewidget.h b/libpgmodeler_ui/src/tablewidget.h index 71a2daadcc..2eaa4b7e91 100644 --- a/libpgmodeler_ui/src/tablewidget.h +++ b/libpgmodeler_ui/src/tablewidget.h @@ -62,7 +62,7 @@ class TableWidget: public BaseObjectWidget, public Ui::TableWidget { int openEditingForm(TableObject *object); public: - TableWidget(QWidget * parent = 0); + TableWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Table *table, double pos_x, double pos_y); diff --git a/libpgmodeler_ui/src/tagwidget.h b/libpgmodeler_ui/src/tagwidget.h index a33cdbcde5..ec2c5c23f3 100644 --- a/libpgmodeler_ui/src/tagwidget.h +++ b/libpgmodeler_ui/src/tagwidget.h @@ -38,7 +38,7 @@ class TagWidget: public BaseObjectWidget, public Ui::TagWidget { map color_pickers; public: - TagWidget(QWidget * parent = 0); + TagWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Tag *tag); diff --git a/libpgmodeler_ui/src/textboxwidget.h b/libpgmodeler_ui/src/textboxwidget.h index 2b79912227..1f02cb3ba2 100644 --- a/libpgmodeler_ui/src/textboxwidget.h +++ b/libpgmodeler_ui/src/textboxwidget.h @@ -33,7 +33,7 @@ class TextboxWidget: public BaseObjectWidget, public Ui::TextboxWidget { Q_OBJECT public: - TextboxWidget(QWidget * parent = 0); + TextboxWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Textbox *txtbox=nullptr, double obj_px=NAN, double obj_py=NAN); diff --git a/libpgmodeler_ui/src/triggerwidget.h b/libpgmodeler_ui/src/triggerwidget.h index 6c72f38420..ca3c4ca47c 100644 --- a/libpgmodeler_ui/src/triggerwidget.h +++ b/libpgmodeler_ui/src/triggerwidget.h @@ -48,7 +48,7 @@ class TriggerWidget: public BaseObjectWidget, public Ui::TriggerWidget { void addColumn(Column *column, int row); public: - TriggerWidget(QWidget * parent = 0); + TriggerWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, BaseTable *parent_table, Trigger *trigger); diff --git a/libpgmodeler_ui/src/typewidget.h b/libpgmodeler_ui/src/typewidget.h index b4041a3348..55af88c337 100644 --- a/libpgmodeler_ui/src/typewidget.h +++ b/libpgmodeler_ui/src/typewidget.h @@ -61,7 +61,7 @@ class TypeWidget: public BaseObjectWidget, public Ui::TypeWidget { PgSQLTypeWidget *attrib_type_wgt; public: - TypeWidget(QWidget * parent = 0); + TypeWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, Type *type); diff --git a/libpgmodeler_ui/src/updatenotifierwidget.h b/libpgmodeler_ui/src/updatenotifierwidget.h index 917cd60bf7..c45511a490 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.h +++ b/libpgmodeler_ui/src/updatenotifierwidget.h @@ -75,7 +75,7 @@ class UpdateNotifierWidget: public QWidget, public Ui::UpdateNotifierWidget { void activateLink(const QString &link); public: - UpdateNotifierWidget(QWidget * parent = 0); + UpdateNotifierWidget(QWidget * parent = nullptr); public slots: void checkForUpdate(void); diff --git a/libpgmodeler_ui/src/viewwidget.h b/libpgmodeler_ui/src/viewwidget.h index a9d4546429..94356c89c5 100644 --- a/libpgmodeler_ui/src/viewwidget.h +++ b/libpgmodeler_ui/src/viewwidget.h @@ -76,7 +76,7 @@ class ViewWidget: public BaseObjectWidget, public Ui::ViewWidget { unsigned getReferenceFlag(int row); public: - ViewWidget(QWidget * parent = 0); + ViewWidget(QWidget * parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, Schema *schema, View *view, double px, double py); diff --git a/libpgmodeler_ui/src/welcomewidget.h b/libpgmodeler_ui/src/welcomewidget.h index 93bce54e33..2826996108 100644 --- a/libpgmodeler_ui/src/welcomewidget.h +++ b/libpgmodeler_ui/src/welcomewidget.h @@ -31,7 +31,7 @@ class WelcomeWidget: public QWidget, public Ui::WelcomeWidget { Q_OBJECT public: - WelcomeWidget(QWidget * parent = 0); + WelcomeWidget(QWidget * parent = nullptr); public slots: }; From 4f574fdeb21d32616459caf94d900d4b7c6f9329 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 20 Jan 2019 17:01:38 -0300 Subject: [PATCH 255/425] Fixed the windows deploy script to use newer version of the compiler in 64bits env --- windeploy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/windeploy.sh b/windeploy.sh index e268694fba..16c6b79ca6 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -66,9 +66,9 @@ if [ $X64_BUILD = 1 ]; then $MINGW_ROOT/zlib1.dll \ $MINGW_ROOT/libxml2-2.dll \ $MINGW_ROOT/libpq.dll \ - $MINGW_ROOT/libeay32.dll \ - $MINGW_ROOT/ssleay32.dll \ - $MINGW_ROOT/liblzma-5.dll" + $MINGW_ROOT/liblzma-5.dll \ + $MINGW_ROOT/libcrypto-1_1-x64.dll \ + $MINGW_ROOT/libssl-1_1-x64.dll" else # Default setting for x86 build QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/${QT_BASE_VERSION}/mingw53_32/" From 1e017bebb48579f933b74e75cbd756c1245659bd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 20 Jan 2019 17:19:32 -0300 Subject: [PATCH 256/425] Minor fixes removing old references to ObjectType::ObjTable --- libpgmodeler/src/baseobject.h | 2 +- libpgmodeler/src/operationlist.cpp | 2 +- libpgmodeler/src/table.cpp | 4 ++-- libpgmodeler/src/table.h | 2 +- libpgmodeler_ui/src/databaseimportform.h | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index dff93e7ab3..c0f67a549e 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -479,7 +479,7 @@ class BaseObject { /*! \brief Returns the valid object types that are child or grouped under the specified type. This method works a litte different from getObjectTypes() since this latter returns all valid types and this one returns only the valid types for the current specified type. For now the only accepted - types are ObjectType::ObjDatabase, ObjectType::ObjSchema and ObjectType::ObjTable */ + types are ObjectType::Database, ObjectType::Schema and ObjectType::Table */ static vector getChildObjectTypes(ObjectType obj_type); /*! \brief Sets the default version when generating the SQL code. This affects all instances of classes that diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 79883da3cb..e160deb6cf 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -698,7 +698,7 @@ void OperationList::executeOperation(Operation *oper, bool redo) obj_idx=oper->getObjectIndex(); /* Converting the parent object, if any, to the correct class according - to the type of the parent object. If ObjectType::ObjTable|ObjectType::ObjView, the pointer + to the type of the parent object. If ObjectType::Table|ObjectType::View, the pointer 'parent_tab' get the reference to table/view and will be used as referential in the operations below. If the parent object is a relationship, the pointer 'parent_rel' get the reference to the relationship */ diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 561e2b3095..059deba9b4 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -360,10 +360,10 @@ void Table::addObject(BaseObject *obj, int obj_idx) #ifdef DEMO_VERSION #warning "DEMO VERSION: table children objects creation limit." - vector *obj_list=(obj_type!=ObjectType::ObjTable ? getObjectList(obj_type) : nullptr); + vector *obj_list=(obj_type!=ObjectType::Table ? getObjectList(obj_type) : nullptr); if((obj_list && obj_list->size() >= GlobalAttributes::MaxObjectCount) || - (obj_type==ObjectType::ObjTable && ancestor_tables.size() >= GlobalAttributes::MaxObjectCount)) + (obj_type==ObjectType::Table && ancestor_tables.size() >= GlobalAttributes::MaxObjectCount)) throw Exception(trUtf8("In demonstration version tables can have only `%1' instances of each child object type or ancestor tables! You've reach this limit for the type: `%2'") .arg(GlobalAttributes::MaxObjectCount) .arg(BaseObject::getTypeName(obj_type)), diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 4b09f49daf..2216f33ab0 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -96,7 +96,7 @@ class Table: public BaseTable { //! \brief The partitioning mode/type used by the table PartitioningType partitioning_type; - /*! \brief Gets one table ancestor (ObjectType::ObjTable) or copy (ObjectType::ObjBaseTable) using its name and stores + /*! \brief Gets one table ancestor (ObjectType::Table) or copy (ObjectType::ObjBaseTable) using its name and stores the index of the found object on parameter 'obj_idx' */ BaseObject *getObject(const QString &name, ObjectType obj_type, int &obj_idx); diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index a95c422739..35c6df81a5 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -116,7 +116,7 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { /*! \brief Retrieve the specified objects from the database and insert them onto the tree view. The "root" parameter is used to associate the group of objects as child of it. The "schema" and "table" parameter are used to filter objects by schema and/or table. - This method automatically returns a list of QTreeWidgetItem when the vector "types" contains ObjectType::ObjSchema or ObjectType::ObjTable or ObjectType::ObjView */ + This method automatically returns a list of QTreeWidgetItem when the vector "types" contains ObjectType::ObjSchema or ObjectType::Table or ObjectType::View */ static vector updateObjectsTree(DatabaseImportHelper &import_helper, QTreeWidget *tree_wgt, vector types, bool checkable_items=false, bool disable_empty_grps=true, QTreeWidgetItem *root=nullptr, const QString &schema=QString(), const QString &table=QString(), unsigned sort_by = 0); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index fd335bee90..8defecda4e 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -471,7 +471,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) int count, count2, i; QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::Schema)) + QString("_grp"))); - //Removing the ObjectType::ObjTable and ObjectType::ObjView types since they are handled separetedly + //Removing the ObjectType::Table and ObjectType::View types since they are handled separetedly types.erase(std::find(types.begin(), types.end(), ObjectType::Table)); types.erase(std::find(types.begin(), types.end(), ObjectType::View)); From 7ec8e51202c5d13cac235cee7deebeada14c135c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 20 Jan 2019 17:51:56 -0300 Subject: [PATCH 257/425] Removing unused break instructions --- libpgmodeler/src/databasemodel.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 33e09573b7..19bc6303fb 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -771,7 +771,7 @@ void DatabaseModel::destroyObjects(void) } objects = getCreationOrder(SchemaParser::XmlDefinition, true); - ritr = objects.rbegin(), + ritr = objects.rbegin(); ritr_end = objects.rend(); while(ritr != ritr_end) @@ -9245,31 +9245,24 @@ BaseObject *DatabaseModel::getObjectPgSQLType(PgSqlType type) { case UserTypeConfig::BaseType: return(this->getObject(*type, ObjectType::Type)); - break; case UserTypeConfig::DomainType: return(this->getObject(*type, ObjectType::Domain)); - break; case UserTypeConfig::TableType: return(this->getObject(*type, ObjectType::Table)); - break; case UserTypeConfig::ViewType: return(this->getObject(*type, ObjectType::View)); - break; case UserTypeConfig::SequenceType: return(this->getObject(*type, ObjectType::Sequence)); - break; case UserTypeConfig::ExtensionType: return(this->getObject(*type, ObjectType::Extension)); - break; default: return(nullptr); - break; } } From fc878089dd0c76c1cccbae01787e506a269e54a9 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 21 Jan 2019 11:40:28 -0300 Subject: [PATCH 258/425] Adding a column labeled "Comment" in TableWidget and ViewWidget to hold comments of children objects (issue #1230) --- libpgmodeler_ui/src/tablewidget.cpp | 19 +++++++++++++------ libpgmodeler_ui/src/viewwidget.cpp | 18 +++++++++++++++--- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 8eaefd4295..2fa7e86e8a 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -99,7 +99,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: connect(tab, SIGNAL(s_rowsMoved(int,int)), this, SLOT(swapObjects(int,int))); } - objects_tab_map[ObjectType::Column]->setColumnCount(6); + objects_tab_map[ObjectType::Column]->setColumnCount(7); objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("PK"), 0); objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Name"), 1); objects_tab_map[ObjectType::Column]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),1); @@ -108,6 +108,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Default Value"), 3); objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Attribute(s)"), 4); objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Alias"), 5); + objects_tab_map[ObjectType::Column]->setHeaderLabel(trUtf8("Comment"), 6); objects_tab_map[ObjectType::Column]->adjustColumnToContents(0); connect(objects_tab_map[ObjectType::Column], &ObjectsTableWidget::s_cellClicked, [&](int row, int col){ @@ -124,7 +125,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: } }); - objects_tab_map[ObjectType::Constraint]->setColumnCount(5); + objects_tab_map[ObjectType::Constraint]->setColumnCount(6); objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[ObjectType::Constraint]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("Type"), 1); @@ -132,8 +133,9 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("ON DELETE"), 2); objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("ON UPDATE"), 3); objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("Alias"), 4); + objects_tab_map[ObjectType::Constraint]->setHeaderLabel(trUtf8("Comment"), 5); - objects_tab_map[ObjectType::Trigger]->setColumnCount(5); + objects_tab_map[ObjectType::Trigger]->setColumnCount(6); objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); @@ -142,21 +144,24 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Events"), 3); objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Alias"), 4); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Comment"), 5); - objects_tab_map[ObjectType::Rule]->setColumnCount(4); + objects_tab_map[ObjectType::Rule]->setColumnCount(5); objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[ObjectType::Rule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Execution"), 1); objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Event"), 2); objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Alias"), 3); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Comment"), 4); - objects_tab_map[ObjectType::Index]->setColumnCount(3); + objects_tab_map[ObjectType::Index]->setColumnCount(4); objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[ObjectType::Index]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Indexing"), 1); objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Alias"), 2); + objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Comment"), 3); - objects_tab_map[ObjectType::Policy]->setColumnCount(7); + objects_tab_map[ObjectType::Policy]->setColumnCount(8); objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[ObjectType::Policy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Command"), 1); @@ -167,6 +172,7 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Roles"), 5); objects_tab_map[ObjectType::Policy]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("role")),5); objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Alias"), 6); + objects_tab_map[ObjectType::Policy]->setHeaderLabel(trUtf8("Comment"), 7); partition_keys_tab = new ElementsTableWidget; partition_keys_tab->setEnabled(false); @@ -606,6 +612,7 @@ void TableWidget::showObjectData(TableObject *object, int row) tab->setRowFont(row, font, ProtRowFgColor, ProtRowBgColor); } + tab->setCellText(object->getComment(), row, tab->getColumnCount() - 1); tab->setRowData(QVariant::fromValue(object), row); } diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 34f3150a41..eddbe90d35 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -89,7 +89,7 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Vi connect(tab, SIGNAL(s_rowDuplicated(int,int)), this, SLOT(duplicateObject(int,int))); } - objects_tab_map[ObjectType::Trigger]->setColumnCount(4); + objects_tab_map[ObjectType::Trigger]->setColumnCount(6); objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Refer. Table"), 1); @@ -97,17 +97,24 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Vi objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Firing"), 2); objects_tab_map[ObjectType::Trigger]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("trigger")),2); objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Events"), 3); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Alias"), 4); + objects_tab_map[ObjectType::Trigger]->setHeaderLabel(trUtf8("Comment"), 5); - objects_tab_map[ObjectType::Index]->setColumnCount(2); + objects_tab_map[ObjectType::Index]->setColumnCount(4); objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[ObjectType::Index]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Indexing"), 1); + objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Alias"), 2); + objects_tab_map[ObjectType::Index]->setHeaderLabel(trUtf8("Comment"), 3); - objects_tab_map[ObjectType::Rule]->setColumnCount(3); + objects_tab_map[ObjectType::Rule]->setColumnCount(5); objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Name"), 0); objects_tab_map[ObjectType::Rule]->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Execution"), 1); objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Event"), 2); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Alias"), 3); + objects_tab_map[ObjectType::Rule]->setHeaderLabel(trUtf8("Comment"), 4); + tablespace_sel->setEnabled(false); tablespace_lbl->setEnabled(false); @@ -373,6 +380,7 @@ void ViewWidget::showObjectData(TableObject *object, int row) str_aux.remove(str_aux.size()-2, 2); tab->setCellText(str_aux ,row,3); + tab->setCellText(trigger->getAlias(), row, 4); } else if(obj_type==ObjectType::Rule) { @@ -383,6 +391,8 @@ void ViewWidget::showObjectData(TableObject *object, int row) //Column 2: Rule event type tab->setCellText(~rule->getEventType(),row,2); + + tab->setCellText(rule->getAlias(), row, 3); } else { @@ -390,8 +400,10 @@ void ViewWidget::showObjectData(TableObject *object, int row) //Column 1: Indexing type tab->setCellText(~index->getIndexingType(),row,1); + tab->setCellText(index->getAlias(), row, 2); } + tab->setCellText(object->getComment(), row, tab->getColumnCount() - 1); tab->setRowData(QVariant::fromValue(object), row); } From 3109eca5abf5f3d56e79924a7c4544bd752084fa Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 21 Jan 2019 11:41:03 -0300 Subject: [PATCH 259/425] Adding info shields provided by shields.io on README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 4f21264c0d..89480f7dd6 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ +[![](https://img.shields.io/github/license/pgmodeler/pgmodeler.svg)](https://github.com/pgmodeler/pgmodeler/blob/master/LICENSE) +[![](https://img.shields.io/github/issues-raw/pgmodeler/pgmodeler.svg)](https://github.com/pgmodeler/pgmodeler/issues) +[![](https://img.shields.io/github/issues-closed-raw/pgmodeler/pgmodeler.svg)](https://github.com/pgmodeler/pgmodeler/issues?q=is%3Aissue+is%3Aclosed) +
+![](https://img.shields.io/github/languages/code-size/pgmodeler/pgmodeler.svg) +[![](https://img.shields.io/github/tag-date/pgmodeler/pgmodeler.svg)](https://github.com/pgmodeler/pgmodeler/tags) +[![](https://img.shields.io/github/last-commit/pgmodeler/pgmodeler/0.9.2-beta.svg)](https://github.com/pgmodeler/pgmodeler/commits/0.9.2-beta) + Introduction ------------ From 287e364037f5968b8778471be64717dae67ebc0a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 29 Jan 2019 11:03:38 -0300 Subject: [PATCH 260/425] Fixed a bug when rendering several self relationships attached to the same table (issue #1201) --- libobjrenderer/src/basetableview.cpp | 24 ++++++++++++++++++++---- libobjrenderer/src/basetableview.h | 4 +++- libobjrenderer/src/relationshipview.cpp | 2 +- libpgmodeler/src/databasemodel.cpp | 2 +- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 95957791e7..26676c480c 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -273,12 +273,28 @@ void BaseTableView::removeConnectedRelationship(BaseRelationship *base_rel) connected_rels.erase(std::find(connected_rels.begin(), connected_rels.end(), base_rel)); } -int BaseTableView::getConnectedRelationshipIndex(BaseRelationship *base_rel) +int BaseTableView::getConnectedRelationshipIndex(BaseRelationship *base_rel, bool only_self_rels) { - vector::iterator itr = std::find(connected_rels.begin(), connected_rels.end(), base_rel); + vector::iterator itr; + vector self_rels, *vet_rels = nullptr; - if(itr != connected_rels.end()) - return(itr - connected_rels.begin()); + if(!only_self_rels) + vet_rels = &connected_rels; + else + { + for(auto &rel : connected_rels) + { + if(rel->isSelfRelationship()) + self_rels.push_back(rel); + } + + vet_rels = &self_rels; + } + + itr = std::find(vet_rels->begin(), vet_rels->end(), base_rel); + + if(itr != vet_rels->end()) + return(itr - vet_rels->begin()); return(-1); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 237093e50d..cfd7b3eb4a 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -89,7 +89,9 @@ class BaseTableView: public BaseObjectView { void removeConnectedRelationship(BaseRelationship *base_rel); - int getConnectedRelationshipIndex(BaseRelationship *base_rel); + /*! \brief Returns the index of the relationship in the list of the connected relationships + * If 'only_self_rels' is true then only self relationship are searched */ + int getConnectedRelationshipIndex(BaseRelationship *base_rel, bool only_self_rels = false); //! \brief Configures the tag object when the source object has one. void configureTag(void); diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 7aad9a529b..066985f602 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -622,7 +622,7 @@ void RelationshipView::configureLine(void) if(rel_cnt > 1) { - int idx = tables[0]->getConnectedRelationshipIndex(base_rel); + int idx = tables[0]->getConnectedRelationshipIndex(base_rel, true); double min_val = min(rect.width(), rect.height()); if(idx < 0) idx =0; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 19bc6303fb..2beceb692d 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3148,9 +3148,9 @@ void DatabaseModel::loadModel(const QString &filename) { emit s_objectLoaded(100, trUtf8("Validating relationships..."), enum_cast(ObjectType::Relationship)); validateRelationships(); - updateTablesFKRelationships(); } + updateTablesFKRelationships(); emit s_objectLoaded(100, trUtf8("Rendering database model..."), enum_cast(ObjectType::BaseObject)); this->setObjectsModified(); } From 7b514737ac44e41983208da0b0a371ce9267dbbd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 30 Jan 2019 11:38:46 -0200 Subject: [PATCH 261/425] Adjusted the deploy script to use Qt 5.12 --- pgmodeler.pri | 8 ++++---- windeploy.sh | 30 +++++++++++++++--------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/pgmodeler.pri b/pgmodeler.pri index 61d94ef72b..b2023fa3ef 100644 --- a/pgmodeler.pri +++ b/pgmodeler.pri @@ -154,10 +154,10 @@ macx { } windows { - !defined(PGSQL_LIB, var): PGSQL_LIB = C:/PostgreSQL/10.1/lib/libpq.dll - !defined(PGSQL_INC, var): PGSQL_INC = C:/PostgreSQL/10.1/include - !defined(XML_INC, var): XML_INC = C:/PostgreSQL/10.1/include - !defined(XML_LIB, var): XML_LIB = C:/PostgreSQL/10.1/bin/libxml2.dll + !defined(PGSQL_LIB, var): PGSQL_LIB = C:/msys64/mingw64/bin/libpq.dll + !defined(PGSQL_INC, var): PGSQL_INC = C:/msys64/mingw64/include + !defined(XML_INC, var): XML_INC = C:/msys64/mingw64/include/libxml2 + !defined(XML_LIB, var): XML_LIB = C:/msys64/mingw64/bin/libxml2-2.dll # Workaround to solve bug of timespec struct on MingW + PostgreSQL < 9.4 QMAKE_CXXFLAGS+="-DHAVE_STRUCT_TIMESPEC" diff --git a/windeploy.sh b/windeploy.sh index 16c6b79ca6..0b49bfa86a 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -1,8 +1,8 @@ #!/bin/bash -QT_INSTALL_VERSION='5.9.3' -QT_BASE_VERSION='5.9.3' -PGSQL_VERSION='10.1' +QT_INSTALL_VERSION='5.12.0' +QT_BASE_VERSION='5.12.0' +PGSQL_VERSION='11' INNOSETUP_CMD='/c/Program Files (x86)/Inno Setup 5/ISCC.exe' LOG=windeploy.log @@ -49,26 +49,26 @@ fi if [ $X64_BUILD = 1 ]; then # Settings for x64 build - QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}-x64/" + QT_ROOT="/c/Qt${QT_INSTALL_VERSION}/" QMAKE_ROOT=$QT_ROOT/bin - MINGW_ROOT="/c/msys_64/mingw64/bin" - PGSQL_ROOT="/c/PostgreSQL/${PGSQL_VERSION}-x64/bin" + MINGW_ROOT="/c/msys64/mingw64/bin" + PGSQL_ROOT="/c/msys64/mingw64/bin" QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release \ XML_INC+=$MINGW_ROOT/../include/libxml2 \ XML_LIB+=$MINGW_ROOT/libxml2-2.dll \ PGSQL_INC+=$MINGW_ROOT/../include \ PGSQL_LIB+=$MINGW_ROOT/libpq.dll" - DEP_LIBS="$MINGW_ROOT/libgcc_s_seh-1.dll \ - $MINGW_ROOT/libstdc++-6.dll \ - $MINGW_ROOT/libwinpthread-1.dll \ - $MINGW_ROOT/libiconv-2.dll \ + DEP_LIBS="$MINGW_ROOT/libcrypto-1_1-x64.dll \ + $MINGW_ROOT/libgcc_s_seh-1.dll \ + $MINGW_ROOT/libiconv-2.dll \ $MINGW_ROOT/libintl-8.dll \ - $MINGW_ROOT/zlib1.dll \ - $MINGW_ROOT/libxml2-2.dll \ - $MINGW_ROOT/libpq.dll \ $MINGW_ROOT/liblzma-5.dll \ - $MINGW_ROOT/libcrypto-1_1-x64.dll \ - $MINGW_ROOT/libssl-1_1-x64.dll" + $MINGW_ROOT/libpq.dll \ + $MINGW_ROOT/libssl-1_1-x64.dll \ + $MINGW_ROOT/libstdc++-6.dll \ + $MINGW_ROOT/libwinpthread-1.dll \ + $MINGW_ROOT/libxml2-2.dll \ + $MINGW_ROOT/zlib1.dll" else # Default setting for x86 build QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/${QT_BASE_VERSION}/mingw53_32/" From 8da828d30613d60d6066d8e176748b9963b069c0 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 30 Jan 2019 17:13:11 -0300 Subject: [PATCH 262/425] Additional adjustment for windows deployment --- pgmodeler.pri | 8 ++++---- windeploy.sh | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pgmodeler.pri b/pgmodeler.pri index b2023fa3ef..61d94ef72b 100644 --- a/pgmodeler.pri +++ b/pgmodeler.pri @@ -154,10 +154,10 @@ macx { } windows { - !defined(PGSQL_LIB, var): PGSQL_LIB = C:/msys64/mingw64/bin/libpq.dll - !defined(PGSQL_INC, var): PGSQL_INC = C:/msys64/mingw64/include - !defined(XML_INC, var): XML_INC = C:/msys64/mingw64/include/libxml2 - !defined(XML_LIB, var): XML_LIB = C:/msys64/mingw64/bin/libxml2-2.dll + !defined(PGSQL_LIB, var): PGSQL_LIB = C:/PostgreSQL/10.1/lib/libpq.dll + !defined(PGSQL_INC, var): PGSQL_INC = C:/PostgreSQL/10.1/include + !defined(XML_INC, var): XML_INC = C:/PostgreSQL/10.1/include + !defined(XML_LIB, var): XML_LIB = C:/PostgreSQL/10.1/bin/libxml2.dll # Workaround to solve bug of timespec struct on MingW + PostgreSQL < 9.4 QMAKE_CXXFLAGS+="-DHAVE_STRUCT_TIMESPEC" diff --git a/windeploy.sh b/windeploy.sh index 0b49bfa86a..235f52a335 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -1,8 +1,5 @@ #!/bin/bash -QT_INSTALL_VERSION='5.12.0' -QT_BASE_VERSION='5.12.0' -PGSQL_VERSION='11' INNOSETUP_CMD='/c/Program Files (x86)/Inno Setup 5/ISCC.exe' LOG=windeploy.log @@ -49,10 +46,12 @@ fi if [ $X64_BUILD = 1 ]; then # Settings for x64 build - QT_ROOT="/c/Qt${QT_INSTALL_VERSION}/" + QT_INSTALL_VERSION='5.12.0' + QT_BASE_VERSION='5.12.0' + QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/" QMAKE_ROOT=$QT_ROOT/bin - MINGW_ROOT="/c/msys64/mingw64/bin" - PGSQL_ROOT="/c/msys64/mingw64/bin" + MINGW_ROOT="/c/msys_64/mingw64/bin" + PGSQL_ROOT="/c/msys_64/mingw64/bin" QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release \ XML_INC+=$MINGW_ROOT/../include/libxml2 \ XML_LIB+=$MINGW_ROOT/libxml2-2.dll \ @@ -71,6 +70,9 @@ if [ $X64_BUILD = 1 ]; then $MINGW_ROOT/zlib1.dll" else # Default setting for x86 build + QT_INSTALL_VERSION='5.9.3' + QT_BASE_VERSION='5.9.3' + PGSQL_VERSION='10.1' QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/${QT_BASE_VERSION}/mingw53_32/" QMAKE_ROOT=$QT_ROOT/bin QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release" From 6d95df32aac34443ca0ce4fd0c41a694521655e8 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 31 Jan 2019 14:23:37 -0300 Subject: [PATCH 263/425] Starting to uniform the installers on all supported platforms --- .../meta/finishmessagewidget.ui | 19 +- installer/template/config/config.xml.tmpl | 14 + installer/template/config/installer_icon.png | Bin 0 -> 12087 bytes installer/template/config/installer_logo.png | Bin 0 -> 5020 bytes installer/template/config/watermark.png | Bin 0 -> 100616 bytes .../packages/io.pgmodeler/meta/LICENSE | 674 ++++++++++++++++++ .../io.pgmodeler/meta/finishmessagewidget.ui | 122 ++++ .../io.pgmodeler/meta/installscript-linux.qs | 55 ++ .../io.pgmodeler/meta/installscript-macos.qs | 55 ++ .../meta/installscript-windows.qs | 55 ++ .../io.pgmodeler/meta/package.xml.tmpl | 16 + linuxdeploy.sh | 43 +- 12 files changed, 1029 insertions(+), 24 deletions(-) create mode 100644 installer/template/config/config.xml.tmpl create mode 100644 installer/template/config/installer_icon.png create mode 100644 installer/template/config/installer_logo.png create mode 100644 installer/template/config/watermark.png create mode 100644 installer/template/packages/io.pgmodeler/meta/LICENSE create mode 100644 installer/template/packages/io.pgmodeler/meta/finishmessagewidget.ui create mode 100644 installer/template/packages/io.pgmodeler/meta/installscript-linux.qs create mode 100644 installer/template/packages/io.pgmodeler/meta/installscript-macos.qs create mode 100644 installer/template/packages/io.pgmodeler/meta/installscript-windows.qs create mode 100644 installer/template/packages/io.pgmodeler/meta/package.xml.tmpl diff --git a/installer/linux/packages/br.com.pgmodeler/meta/finishmessagewidget.ui b/installer/linux/packages/br.com.pgmodeler/meta/finishmessagewidget.ui index ec28890c6b..287bea8fb8 100644 --- a/installer/linux/packages/br.com.pgmodeler/meta/finishmessagewidget.ui +++ b/installer/linux/packages/br.com.pgmodeler/meta/finishmessagewidget.ui @@ -7,7 +7,7 @@ 0 0 548 - 385 + 502
@@ -42,7 +42,6 @@ - 11 75 true @@ -66,11 +65,6 @@ 0 - - - 10 - - Please, read the instructions below to see how to run it. @@ -96,7 +90,6 @@ Courier 10 Pitch - 11 @@ -143,15 +136,7 @@ p, li { white-space: pre-wrap; } - You can find more information about pgModeler on:<br/> -<br/>Official site:<br/> -<a href="http://pgmodeler.com.br"><span style=" text-decoration: underline; color:#0000ff;">http://pgmodeler.com.br</span></a><br/> -<br/>GitHub repository:<br/> -<a href="https://github.com/pgmodeler"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/pgmodeler</span></a><br/> -<br/>Social Networks:<br/> -<a href="http://twitter.com/pgmodeler"><span style=" text-decoration: underline; color:#0000ff;">http://twitter.com/pgmodeler</span></a><br/> -<a href="http://facebook.com/pgmodeler"><span style=" text-decoration: underline; color:#0000ff;">http://facebook.com/pgmodeler</span></a><br/> -<a href="https://plus.google.com/u/0/communities/114191031055593275754"><span style=" text-decoration: underline; color:#0000ff;">https://plus.google.com/u/0/communities/114191031055593275754</span></a><br/> + <html><head/><body><p>You can find more information about pgModeler on:<br/><br/>Official site:<br/><a href="https://pgmodeler.io"><span style=" text-decoration: underline; color:#2980b9;">https://pgmodeler.io</span></a><br/><br/>GitHub repository:<br/><a href="https://github.com/pgmodeler"><span style=" text-decoration: underline; color:#2980b9;">https://github.com/pgmodeler</span></a><br/><br/>Social Networks:<br/><a href="https://twitter.com/pgmodeler"><span style=" text-decoration: underline; color:#2980b9;">https://twitter.com/pgmodeler</span></a><br/><a href="https://facebook.com/pgmodeler"><span style=" text-decoration: underline; color:#2980b9;">https://facebook.com/pgmodeler</span></a></p></body></html> Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse diff --git a/installer/template/config/config.xml.tmpl b/installer/template/config/config.xml.tmpl new file mode 100644 index 0000000000..35d66ef741 --- /dev/null +++ b/installer/template/config/config.xml.tmpl @@ -0,0 +1,14 @@ + + + PostgreSQL Database Modeler + {version} + pgModeler + Raphael Araújo e Silva (raphael@pgmodeler.io) + {prefix} + installer_icon + installer_icon + installer_logo.png + watermark.png + true + true + diff --git a/installer/template/config/installer_icon.png b/installer/template/config/installer_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7156e48a63225959bc8614decf54ba1a1e85be74 GIT binary patch literal 12087 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 z zzL;!vCNEi(v)@qyU)iQE51kv`4(305`lC|t?#Ao2G7sO zB6Pt@7!h6x@v@BYd*%*-6V7{S+HRukk=5@-NMP2R?V)yfH+w_>d47HJCPFaN8D)C7 zTI?q2dM!Zav`N$4QG?kRRP^tskwxGK{zue7H>lp1nlO*^u0xs3(~|J;(&Cp$CW&S# z3DeIavuxcY`@4E+Az=!498X?vCui6r;muS+y0EqeN1Po6FPY~v0(*}^ZxUYQHgXxc zBHq>z#-A&4AvwT-j?T-VNh-nU#7GL$qiM}dn!vC?_fRY~1s>z%&#yAZ4(GN$7P(LY zb~3Usv^9TxZC`~tLH$!oJ2vND=k6M9RLp$=%a2Z!-y4%>8EWSc1OgNWB{Z1;XptpD7{y0|;+6n-7^JFOK-n^|v@&6e%iA}vUF zU+{l7Cv!#X6L<_`GQ+Tl!9L!bosr&I8D`(b5Y38B{dg&bUM~<9K%>RhD}xeD=0-hBkmD)vivU#W7@!P$>ba2TY|5WLAMYXwH?QV8>zz}cW-l7old(mifkEJvISpT_bOWxg* z93YfE9+p04tCW7!YaJWO%pMC@xb7Tdl9;8y+#th-@kt?bjA>GKneoCdHrTliE$mC4 zeyfW-d(C}riG*8RL=tJMK|CWm@V!uKw73W1F)SpxD1!?9?{xT!C-|L9epy)>k{SaA zlS{&pI~hb;&D;i)Fje?Q^7I0Bhl)~4%GuihDJzbeSMJnsJxu~^8gLzD3So9~cx+rI zxbnSx$%4oI9;QmCW45x$k?(73iqQKVTDQxK_4l&+0ewz+)wY;R_@X&7L8a)oeLerg z=2*sWi?bpa8vWEaVFMvxqF`2R`)mq_d46fb^6d?rFK8zVBEv$cb)lKTV*A&EMZ*4Z zn;_hjsXFWkIeN38R+|Gcmw5ymhSNtCnaZFlV(Y}!3prpt*oW>vL~M=tFqNThcrJn% z&ebx!A`xB3{Tx|@P;cAzKBfOctsDkAxwPT)c|QBNTx}KzQKbj#Y~GHW?ujP&YWoqZ3#% zemyPDN!7H9UrYaaS?}grI`i>5DB17&kJHis(Z7Dtx++DKr*|aiuiC6QW~siG)WBnG zBzz9sH>&m!Gui{l-%f!)`{tqfI%Zct-kxr%w!DW*P9{gM0MZ6kx6`u+IH$6+v)hU5 zWf43%Vt@auvxRk6eUZ2*E$)zKrr>q>*aB%4(q&{4(5mRGya)69IokP5#{gGlwU<}> zN3X@`;#SGa{{^iAQvLsmPF#Nn-DP5}$Y~ZV4fC^7VDW_yHuhqT73f2AHqLw0Jx)ONj=YDBFb7#I5qwbm-x zK~|+auuQ2#J4J?NvVR>Xl-jibx34(8G3Kp`L*)zOS-~f zN2<2|-c;oiz`u|Cbb4fA&rvzW7)L=ji`MKCf5Gq%Umw~miOb7p-xnCiF~dy@+!b?7 zhtOdJ&BX9UusJyKPRDvj701Vh$Id;8c@;jO5~XIlsM}qIjn^aVLJ!^Fy~qT#+EW{% zzh?D5m25WaGb+xYntRf07_DHO53O47TsQ9OggXiI}ISUxY%w)9DQQl~Py)oQie^brq8w%NTT+OY};ny1;@ZrLnMzx~3gz?1BT zgRR$N%a3=81tz9v$KyMl*9GHfjHOw&O%=yE207Z8$^kinr!&?@aKr6#w7ME-PsPyF(4}l2X;fa z-o{A!E^=+4UCAS0`8yh6fih&)icT~>xbp6?((q-qApU-+V=gG#6ERXpNBi&&Nv6lu z;K;l_gJGrD8XZGL8+bH&vDT$lApm<`sSWEF6aL1-vSTjJLrPzOjq!3%;_W}O>|E>^ zs;yh2if=s}m!*N%EmBmwVzi04i@rOn0!~q;T|n%K{OCuZ6GpMRzoM a7=HrX>ED)4N7GCI0000 + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation version 3., or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/installer/template/packages/io.pgmodeler/meta/finishmessagewidget.ui b/installer/template/packages/io.pgmodeler/meta/finishmessagewidget.ui new file mode 100644 index 0000000000..58cfc5ff9c --- /dev/null +++ b/installer/template/packages/io.pgmodeler/meta/finishmessagewidget.ui @@ -0,0 +1,122 @@ + + + FinishMessageWidget + + + + 0 + 0 + 494 + 393 + + + + + 0 + 0 + + + + + 16777215 + 470 + + + + Installation finished + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 75 + true + + + + Thank you for using pgModeler! + + + Qt::AlignCenter + + + 16 + + + + + + + + 0 + 0 + + + + Please, read the instructions below to see how to run it. + + + true + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + Courier 10 Pitch + + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Courier 10 Pitch'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; color:#55aa00;"># From console run:</span><span style=" font-size:10pt;"> </span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; color:#7d7d7d;">$&gt;</span><span style=" font-size:10pt;"> cd {installdir} </span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; color:#7d7d7d;">$&gt;</span><span style=" font-size:10pt;"> ./start-pgmodeler.sh </span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; color:#55aa00;"># </span><span style=" font-size:10pt; font-weight:600; color:#55aa00;">NOTE:</span><span style=" font-size:10pt; color:#55aa00;"> if you have installed pgModeler on the default destination </span><span style=" font-size:10pt; font-weight:600; color:#55aa00;">/opt/pgmodeler</span><span style=" font-size:10pt; color:#55aa00;"> you don't need to use the startup script, just call the executable </span><span style=" font-size:10pt; font-weight:600; color:#55aa00;">pgmodeler </span><span style=" font-size:10pt; color:#55aa00;">from</span><span style=" font-size:10pt; font-weight:600; color:#55aa00;"> </span><span style=" font-size:10pt; color:#55aa00;">the default installation folder</span><span style=" font-size:10pt; font-weight:600; color:#55aa00;">. </span><span style=" font-size:10pt; color:#55aa00;">Take a look on </span><span style=" font-size:10pt; font-weight:600; color:#55aa00;">pgmodeler.vars</span><span style=" font-size:10pt; color:#55aa00;"> file to see how to run pgModeler for non standard installations.</span></p></body></html> + + + + + + + + diff --git a/installer/template/packages/io.pgmodeler/meta/installscript-linux.qs b/installer/template/packages/io.pgmodeler/meta/installscript-linux.qs new file mode 100644 index 0000000000..b46031a895 --- /dev/null +++ b/installer/template/packages/io.pgmodeler/meta/installscript-linux.qs @@ -0,0 +1,55 @@ +function Component() +{ + // constructor + installer.installationFinished.connect(this, finishInstall); + installer.addWizardPageItem( component, "FinishMessageWidget", QInstaller.InstallationFinished ); +} + +Component.prototype.isDefault = function() +{ + // select the component by default + return true; +} + +Component.prototype.createOperations = function() +{ + try { + // call the base create operations function + component.createOperations(); + + var installdir=installer.value("TargetDir"); + + start_script=installdir + "/" + "start-pgmodeler.sh"; + mime_update=installdir + "/" + "dbm-mime-type.sh"; + + component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); + component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); + + component.addOperation("Execute", "{0,255}", mime_update, "uninstall"); + component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); + + } catch (e) { + print(e); + } +} + +// called after everything is set up, but before any fie is written +Component.prototype.beginInstallation = function() +{ + // call default implementation which is necessary for most hooks + // in beginInstallation case it makes nothing + component.beginInstallation(); +} + +finishInstall = function() +{ + //Getting the "Finished" page in order to detect if the "Run program" check box is marked + var page = gui.pageWidgetByObjectName( "FinishedPage" ); + + if(installer.status == QInstaller.Success) + { + var page = gui.pageWidgetByObjectName( "FinishedPage" ); + var info_txt=page.FinishMessageWidget.textEdit.html.replace("{installdir}",installer.value("TargetDir")) + page.FinishMessageWidget.textEdit.html=info_txt + } +} diff --git a/installer/template/packages/io.pgmodeler/meta/installscript-macos.qs b/installer/template/packages/io.pgmodeler/meta/installscript-macos.qs new file mode 100644 index 0000000000..b46031a895 --- /dev/null +++ b/installer/template/packages/io.pgmodeler/meta/installscript-macos.qs @@ -0,0 +1,55 @@ +function Component() +{ + // constructor + installer.installationFinished.connect(this, finishInstall); + installer.addWizardPageItem( component, "FinishMessageWidget", QInstaller.InstallationFinished ); +} + +Component.prototype.isDefault = function() +{ + // select the component by default + return true; +} + +Component.prototype.createOperations = function() +{ + try { + // call the base create operations function + component.createOperations(); + + var installdir=installer.value("TargetDir"); + + start_script=installdir + "/" + "start-pgmodeler.sh"; + mime_update=installdir + "/" + "dbm-mime-type.sh"; + + component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); + component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); + + component.addOperation("Execute", "{0,255}", mime_update, "uninstall"); + component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); + + } catch (e) { + print(e); + } +} + +// called after everything is set up, but before any fie is written +Component.prototype.beginInstallation = function() +{ + // call default implementation which is necessary for most hooks + // in beginInstallation case it makes nothing + component.beginInstallation(); +} + +finishInstall = function() +{ + //Getting the "Finished" page in order to detect if the "Run program" check box is marked + var page = gui.pageWidgetByObjectName( "FinishedPage" ); + + if(installer.status == QInstaller.Success) + { + var page = gui.pageWidgetByObjectName( "FinishedPage" ); + var info_txt=page.FinishMessageWidget.textEdit.html.replace("{installdir}",installer.value("TargetDir")) + page.FinishMessageWidget.textEdit.html=info_txt + } +} diff --git a/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs b/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs new file mode 100644 index 0000000000..b46031a895 --- /dev/null +++ b/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs @@ -0,0 +1,55 @@ +function Component() +{ + // constructor + installer.installationFinished.connect(this, finishInstall); + installer.addWizardPageItem( component, "FinishMessageWidget", QInstaller.InstallationFinished ); +} + +Component.prototype.isDefault = function() +{ + // select the component by default + return true; +} + +Component.prototype.createOperations = function() +{ + try { + // call the base create operations function + component.createOperations(); + + var installdir=installer.value("TargetDir"); + + start_script=installdir + "/" + "start-pgmodeler.sh"; + mime_update=installdir + "/" + "dbm-mime-type.sh"; + + component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); + component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); + + component.addOperation("Execute", "{0,255}", mime_update, "uninstall"); + component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); + + } catch (e) { + print(e); + } +} + +// called after everything is set up, but before any fie is written +Component.prototype.beginInstallation = function() +{ + // call default implementation which is necessary for most hooks + // in beginInstallation case it makes nothing + component.beginInstallation(); +} + +finishInstall = function() +{ + //Getting the "Finished" page in order to detect if the "Run program" check box is marked + var page = gui.pageWidgetByObjectName( "FinishedPage" ); + + if(installer.status == QInstaller.Success) + { + var page = gui.pageWidgetByObjectName( "FinishedPage" ); + var info_txt=page.FinishMessageWidget.textEdit.html.replace("{installdir}",installer.value("TargetDir")) + page.FinishMessageWidget.textEdit.html=info_txt + } +} diff --git a/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl b/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl new file mode 100644 index 0000000000..b8015357b2 --- /dev/null +++ b/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl @@ -0,0 +1,16 @@ + + + pgModeler components + Install all required files to run pgModeler + {version} + {date} + io.pgmodeler + + + + script + + + finishmessagewidget.ui + + diff --git a/linuxdeploy.sh b/linuxdeploy.sh index 42b8cf3bc9..cc8a6139a4 100755 --- a/linuxdeploy.sh +++ b/linuxdeploy.sh @@ -4,7 +4,7 @@ case `uname -m` in "x86_64") ARCH="linux64" - FALLBACK_QT_ROOT=/opt/qt-5.9.6/5.9.6/gcc_64 + FALLBACK_QT_ROOT=/opt/qt-5.12.0/5.12.0/gcc_64 FALLBACK_QMAKE_ROOT="$FALLBACK_QT_ROOT/bin" ;; @@ -26,20 +26,29 @@ QMAKE_CMD=qmake LOG="$PWD/linuxdeploy.log" QT_IFW_ROOT=/opt/qt-ifw-3.0.4 +# Detecting current pgModeler version +DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/"),//g' | sed 's/^ *//g' | cut -s -f2` + STARTUP_SCRIPT="start-pgmodeler.sh" MIME_UPDATE_SCRIPT="dbm-mime-type.sh" ENV_VARS_SCRIPT="pgmodeler.vars" BUILD_DIR="$PWD/build" DIST_DIR="$PWD/dist" INSTALL_ROOT="/opt/pgmodeler" -INSTALLER_CONF_DIR="$PWD/installer/linux/config" -INSTALLER_PKG_DIR="$PWD/installer/linux/packages" -INSTALLER_DATA_DIR="$INSTALLER_PKG_DIR/br.com.pgmodeler/data" +FMT_PREFIX="\/opt\/pgmodeler" +INSTALLER_APP_VER=`echo $DEPLOY_VER | cut -d '-' -f1` +INSTALLER_CONF_DIR="$PWD/installer/template/config" +INSTALLER_PKG_DIR="$PWD/installer/template/packages" +INSTALLER_DATA_DIR="$INSTALLER_PKG_DIR/io.pgmodeler/data" +INSTALLER_META_DIR="$INSTALLER_PKG_DIR/io.pgmodeler/meta" +INSTALLER_TMPL_CONFIG="config.xml.tmpl" +INSTALLER_CONFIG="config.xml" +INSTALLER_TMPL_PKG_CONFIG="package.xml.tmpl" +INSTALLER_PKG_CONFIG="package.xml" QT_CONF="$BUILD_DIR/$INSTALL_ROOT/qt.conf" DEP_PLUGINS_DIR="$BUILD_DIR/$INSTALL_ROOT/lib/qtplugins" +BUILD_DATE=`date '+%Y-%m-%d'` -# Detecting current pgModeler version -DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/"),//g' | sed 's/^ *//g' | cut -s -f2` GEN_INSTALLER_OPT='-gen-installer' DEMO_VERSION_OPT='-demo-version' NO_QT_LIBS_OPT='-no-qt-libs' @@ -150,7 +159,7 @@ clear echo echo "pgModeler Linux deployment script" echo "PostgreSQL Database Modeler Project - pgmodeler.io" -echo "Copyright 2006-2018 Raphael A. Silva " +echo "Copyright 2006-2019 Raphael A. Silva " # Identifying System Qt version if [ -e "$QMAKE_ROOT/$QMAKE_CMD" ]; then @@ -373,6 +382,26 @@ if [ $GEN_INST_PKG = 1 ]; then exit 1 fi + # Configuing installer scripts before packaging + cat $INSTALLER_CONF_DIR/$INSTALLER_TMPL_CONFIG | sed -e "s/{version}/$INSTALLER_APP_VER/g" | sed -e "s/{prefix}/$FMT_PREFIX/g" > $INSTALLER_CONF_DIR/$INSTALLER_CONFIG + + if [ $? -ne 0 ]; then + echo + echo "** Failed to create the installer config file!" + echo + exit 1 + fi + + cat $INSTALLER_META_DIR/$INSTALLER_TMPL_PKG_CONFIG | sed -e "s/{version}/$INSTALLER_APP_VER/g" | sed -e "s/{date}/$BUILD_DATE/g" | sed -e "s/{os}/linux/g" > $INSTALLER_META_DIR/$INSTALLER_PKG_CONFIG + + if [ $? -ne 0 ]; then + echo + echo "** Failed to create the package info file!" + echo + exit 1 + fi + + # Packaging installation $QT_IFW_ROOT/bin/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_DIR/$PKGNAME.run" >> $LOG 2>&1 if [ $? -ne 0 ]; then From dc7a5af2fd0bd616f9cd6ae294ced8120de3833d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 31 Jan 2019 16:17:41 -0200 Subject: [PATCH 264/425] Fixed the windows deploy script to use Qt Installer Framework --- windeploy.sh | 69 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/windeploy.sh b/windeploy.sh index 0b49bfa86a..30189df3d0 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -4,6 +4,7 @@ QT_INSTALL_VERSION='5.12.0' QT_BASE_VERSION='5.12.0' PGSQL_VERSION='11' INNOSETUP_CMD='/c/Program Files (x86)/Inno Setup 5/ISCC.exe' +QT_IFW_ROOT='/c/Qt/QtIFW-3.0.6' LOG=windeploy.log # Detecting current pgModeler version @@ -17,6 +18,19 @@ DEMO_VERSION=0 BUILD_ALL_OPT='-build-all' BUILD_ALL=0 +# Installer settings +FMT_PREFIX="C:\\pgmodeler" +INSTALLER_APP_VER=`echo $DEPLOY_VER | cut -d '-' -f1` +INSTALLER_CONF_DIR="$PWD/installer/template/config" +INSTALLER_PKG_DIR="$PWD/installer/template/packages" +INSTALLER_DATA_DIR="$INSTALLER_PKG_DIR/io.pgmodeler/data" +INSTALLER_META_DIR="$INSTALLER_PKG_DIR/io.pgmodeler/meta" +INSTALLER_TMPL_CONFIG="config.xml.tmpl" +INSTALLER_CONFIG="config.xml" +INSTALLER_TMPL_PKG_CONFIG="package.xml.tmpl" +INSTALLER_PKG_CONFIG="package.xml" +BUILD_DATE=`date '+%Y-%m-%d'` + # Setting key paths according to the arch build (x86|x64) # If none of the build type parameter is specified, the default is tu use x86 X64_BUILD_OPT='-x64-build' @@ -127,7 +141,7 @@ clear echo echo "pgModeler Windows deployment script" echo "PostgreSQL Database Modeler Project - pgmodeler.io" -echo "Copyright 2006-2018 Raphael A. Silva " +echo "Copyright 2006-2019 Raphael A. Silva " # Identifying Qt version if [ -e "$QMAKE_ROOT/qmake" ]; then @@ -243,37 +257,46 @@ fi echo "Packaging installation..." -"$INNOSETUP_CMD" $ISSFILE >> $LOG 2>&1 +rm -r $INSTALLER_DATA_DIR >> $LOG 2>&1 +ln -sf "$INSTALL_ROOT" $INSTALLER_DATA_DIR >> $LOG 2>&1 if [ $? -ne 0 ]; then - echo - echo "** Failed to create installer package!" - echo "** Proceeding with basic deployment." - - mkdir $PKGNAME >> $LOG 2>&1 - mv $INSTALL_ROOT/* $PKGNAME >> $LOG 2>&1 - mv $PKGNAME $INSTALL_ROOT >> $LOG 2>&1 - - if [ $? -ne 0 ]; then - echo "** Failed to execute basic deployment!" - exit 1 - fi + echo + echo "** Failed to configure installer data dir!" + echo + exit 1 +fi +# Configuing installer scripts before packaging +cat $INSTALLER_CONF_DIR/$INSTALLER_TMPL_CONFIG | sed -e "s/{version}/$INSTALLER_APP_VER/g" | sed -e "s/{prefix}/$FMT_PREFIX/g" > $INSTALLER_CONF_DIR/$INSTALLER_CONFIG + +if [ $? -ne 0 ]; then echo - echo "Directory created: $PKGNAME" -else - mv $GENINSTALLER build/$PKGFILE >> $LOG 2>&1 - echo "File created: $PKGFILE" -fi + echo "** Failed to create the installer config file!" + echo + exit 1 +fi + +cat $INSTALLER_META_DIR/$INSTALLER_TMPL_PKG_CONFIG | sed -e "s/{version}/$INSTALLER_APP_VER/g" | sed -e "s/{date}/$BUILD_DATE/g" | sed -e "s/{os}/windows/g" > $INSTALLER_META_DIR/$INSTALLER_PKG_CONFIG + +if [ $? -ne 0 ]; then + echo + echo "** Failed to create the package info file!" + echo + exit 1 +fi -mkdir -p $DIST_ROOT >> $LOG 2>&1 -mv $INSTALL_ROOT/$PKGFILE $DIST_ROOT >> $LOG 2>&1 +$QT_IFW_ROOT/bin/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_ROOT/$PKGNAME.exe" >> $LOG 2>&1 if [ $? -ne 0 ]; then - echo "** Failed to move $PKGFILE to $DIST_ROOT!" - exit 1 + echo + echo "** Failed to create installer!" + echo + exit 1 fi +echo "File created: dist/$PKGNAME.exe" + echo "pgModeler successfully deployed!" echo From 96c0a5af6603444d490f444b5f6ff29cfc79d30a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 31 Jan 2019 17:20:20 -0300 Subject: [PATCH 265/425] Adding missing installer icons --- installer/template/config/installer_icon.icns | Bin 0 -> 45354 bytes installer/template/config/installer_icon.ico | Bin 0 -> 99678 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 installer/template/config/installer_icon.icns create mode 100644 installer/template/config/installer_icon.ico diff --git a/installer/template/config/installer_icon.icns b/installer/template/config/installer_icon.icns new file mode 100644 index 0000000000000000000000000000000000000000..7b0bf7a6240662ba439b9d9e379f25e3005821af GIT binary patch literal 45354 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 BgKhu- literal 0 HcmV?d00001 diff --git a/installer/template/config/installer_icon.ico b/installer/template/config/installer_icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..2b12da009d25e32ea9a27a28298797c941ea09e1 GIT binary patch literal 99678 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
;+)`n zN{ejMM~wVdTYs>4fJAeX3Dp&O1B&^PuLNDG#vL zgRQkLeBAY6b4nRu;So@Fh{1B#EZL{7so3k6)y((vb}Fevcz-lDo#$6~8U9T-5Zro8 z9@uaZfeq&odG<$Nzy^M9Gf3S}_QY6vx?Z=PXp zhr}emQ?QFS$|v0_=~RVyQN=wn%hC&Q$gW+^_d69d3-<-)RSM5>OUm1mSy6-Z#tYJ% zX8M+AQmi4eA=FB!VaT-->u@}!?iE*nZ*_KZ&OONUg(pik(skCW3y+OM`zEX zdF3pMaW%_0oRPtpO}<)FwyCJxcOO5CH?P#f2cB2_``}-N3|UEuN6rrglHPqw5byi{ E0OOht)c^nh literal 0 HcmV?d00001 From 929f2b178b6796db39f81bf9dde3fb37c4daf3e3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 1 Feb 2019 09:29:50 -0200 Subject: [PATCH 266/425] Update the installer script for windows systems --- installer/template/config/config.xml.tmpl | 1 + .../packages/io.pgmodeler/meta/installscript-windows.qs | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/installer/template/config/config.xml.tmpl b/installer/template/config/config.xml.tmpl index 35d66ef741..627dccc3fa 100644 --- a/installer/template/config/config.xml.tmpl +++ b/installer/template/config/config.xml.tmpl @@ -11,4 +11,5 @@ watermark.png true true + 400 diff --git a/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs b/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs index b46031a895..6e01401c41 100644 --- a/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs +++ b/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs @@ -19,12 +19,7 @@ Component.prototype.createOperations = function() var installdir=installer.value("TargetDir"); - start_script=installdir + "/" + "start-pgmodeler.sh"; - mime_update=installdir + "/" + "dbm-mime-type.sh"; - - component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); - component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); - + mime_update=installdir + "/" + "pgmodeler-cli.exe"; component.addOperation("Execute", "{0,255}", mime_update, "uninstall"); component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); @@ -33,7 +28,7 @@ Component.prototype.createOperations = function() } } -// called after everything is set up, but before any fie is written +// called after everything is set up, but before any file is written Component.prototype.beginInstallation = function() { // call default implementation which is necessary for most hooks From ee9cd62da4de568623d9dd5a485a6027b0687ce5 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 1 Feb 2019 10:23:51 -0300 Subject: [PATCH 267/425] Adjusted the installer scripts --- installer/template/config/config.xml.tmpl | 1 + .../io.pgmodeler/meta/finishmessagewidget.ui | 55 ++++++++++--------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/installer/template/config/config.xml.tmpl b/installer/template/config/config.xml.tmpl index 627dccc3fa..1015818e92 100644 --- a/installer/template/config/config.xml.tmpl +++ b/installer/template/config/config.xml.tmpl @@ -12,4 +12,5 @@ true true 400 + 500 diff --git a/installer/template/packages/io.pgmodeler/meta/finishmessagewidget.ui b/installer/template/packages/io.pgmodeler/meta/finishmessagewidget.ui index 58cfc5ff9c..ab00a70305 100644 --- a/installer/template/packages/io.pgmodeler/meta/finishmessagewidget.ui +++ b/installer/template/packages/io.pgmodeler/meta/finishmessagewidget.ui @@ -6,8 +6,8 @@ 0 0 - 494 - 393 + 489 + 443 @@ -25,20 +25,39 @@ Installation finished - + - 0 + 2 - 0 + 2 - 0 + 2 - 0 + 2 - + + 2 + + + + + + 0 + 0 + + + + Please, read the instructions below to see how to run it. + + + true + + + + @@ -63,26 +82,10 @@ - - - - - 0 - 0 - - - - Please, read the instructions below to see how to run it. - - - true - - - - + - + 0 0 From 82170143ae7056d57dc632fa64361b38a48f82c8 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 1 Feb 2019 17:42:05 -0200 Subject: [PATCH 268/425] Updated the windeploy.sh and the installer scripts --- installer/template/config/config.xml.tmpl | 3 +++ .../packages/io.pgmodeler/meta/installscript-windows.qs | 6 +++--- .../template/packages/io.pgmodeler/meta/package.xml.tmpl | 2 +- windeploy.sh | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/installer/template/config/config.xml.tmpl b/installer/template/config/config.xml.tmpl index 1015818e92..0a8b7f9b11 100644 --- a/installer/template/config/config.xml.tmpl +++ b/installer/template/config/config.xml.tmpl @@ -13,4 +13,7 @@ true 400 500 + Classic + False + uninstall diff --git a/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs b/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs index 6e01401c41..b524e76b5b 100644 --- a/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs +++ b/installer/template/packages/io.pgmodeler/meta/installscript-windows.qs @@ -19,7 +19,7 @@ Component.prototype.createOperations = function() var installdir=installer.value("TargetDir"); - mime_update=installdir + "/" + "pgmodeler-cli.exe"; + mime_update=installdir + "/" + "pgmodeler-cli.exe -mt"; component.addOperation("Execute", "{0,255}", mime_update, "uninstall"); component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); @@ -44,7 +44,7 @@ finishInstall = function() if(installer.status == QInstaller.Success) { var page = gui.pageWidgetByObjectName( "FinishedPage" ); - var info_txt=page.FinishMessageWidget.textEdit.html.replace("{installdir}",installer.value("TargetDir")) - page.FinishMessageWidget.textEdit.html=info_txt + page.FinishMessageWidget.textEdit.visible=false; + page.FinishMessageWidget.label.visible=false; } } diff --git a/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl b/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl index b8015357b2..3d11643c38 100644 --- a/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl +++ b/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl @@ -9,7 +9,7 @@ script - + finishmessagewidget.ui diff --git a/windeploy.sh b/windeploy.sh index 30189df3d0..1b212ec4be 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -19,7 +19,7 @@ BUILD_ALL_OPT='-build-all' BUILD_ALL=0 # Installer settings -FMT_PREFIX="C:\\pgmodeler" +FMT_PREFIX="C:\/pgmodeler" INSTALLER_APP_VER=`echo $DEPLOY_VER | cut -d '-' -f1` INSTALLER_CONF_DIR="$PWD/installer/template/config" INSTALLER_PKG_DIR="$PWD/installer/template/packages" @@ -277,7 +277,7 @@ if [ $? -ne 0 ]; then exit 1 fi -cat $INSTALLER_META_DIR/$INSTALLER_TMPL_PKG_CONFIG | sed -e "s/{version}/$INSTALLER_APP_VER/g" | sed -e "s/{date}/$BUILD_DATE/g" | sed -e "s/{os}/windows/g" > $INSTALLER_META_DIR/$INSTALLER_PKG_CONFIG +cat $INSTALLER_META_DIR/$INSTALLER_TMPL_PKG_CONFIG | sed -e "s/{version}/$INSTALLER_APP_VER/g" | sed -e "s/{date}/$BUILD_DATE/g" > $INSTALLER_META_DIR/$INSTALLER_PKG_CONFIG if [ $? -ne 0 ]; then echo From d04b3ce891cd73ecc618c7a1f0cd8e4fd4d3568c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 15 Feb 2019 16:51:09 -0300 Subject: [PATCH 269/425] Added missing key words --- conf/defaults/sql-highlight.conf | 1 + conf/sql-highlight.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index d4e132424c..e582b6f051 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -235,6 +235,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index d4e132424c..e582b6f051 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -235,6 +235,7 @@ + From a5e9258e8bfa21cb223ab53905b8598b95429b94 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 15 Feb 2019 16:51:29 -0300 Subject: [PATCH 270/425] Increased the maximum limit of SQL history --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 +- libpgmodeler_ui/ui/datamanipulationform.ui | 2 +- libpgmodeler_ui/ui/generalconfigwidget.ui | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 68c9dd7df7..3def5deb42 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -936,7 +936,7 @@ void SQLExecutionWidget::destroySQLHistory(void) void SQLExecutionWidget::setSQLHistoryMaxLength(int len) { - if(len < 100 || len > 2000) + if(len < 1000 || len > 20000) len = 1000; SQLExecutionWidget::cmd_history_max_len = len; diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index 725d9366e3..a28228aa7b 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -259,7 +259,7 @@ false - 25 + 26 25 diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 23101322d9..7644539da2 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -1263,13 +1263,13 @@ - 100 + 1000 - 10000 + 20000 - 100 + 500 1000 From 0de02be719076fdc076f10d483f2b185e18ccc63 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 19 Feb 2019 10:44:24 -0300 Subject: [PATCH 271/425] Fixed a bug on diff process due to a missing attribute on the generation of diff code for inheritance relationships (issue #1243) --- libpgmodeler/src/relationship.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 8a576e293d..95b323f44b 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -2714,6 +2714,7 @@ QString Relationship::getAlterRelationshipDefinition(bool undo_inh_part) attributes[Attributes::AncestorTable]=QString(); attributes[Attributes::PartitionedTable]=QString(); attributes[Attributes::PartitionBoundExpr]=QString(); + attributes[Attributes::Partitioning]=QString(); if(rel_type == RelationshipGen) { From 2869b0f80d2605e1a28a5d4fd3cfc5ba2fe5d6cf Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 22 Feb 2019 16:13:04 -0300 Subject: [PATCH 272/425] Allowing copied object to be pasted multiple times (issue #1245). This feature works only with copy/paste operation without remove the pasted objects from the clipboard, for cut/paste the behaviour is unchanged. --- libpgmodeler_ui/src/modelwidget.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 581d175a73..20e56a7dd6 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2692,7 +2692,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) if(!ModelWidget::cut_operation) { - copied_objects.clear(); + //copied_objects.clear(); emit s_objectCreated(); } //If its a cut operatoin @@ -3073,9 +3073,6 @@ void ModelWidget::removeObjects(bool cascade) } catch(Exception &e) { - //if(e.getErrorType()==ERR_INVALIDATED_OBJECTS) - // op_list->removeOperations(); - if(op_list->isOperationChainStarted()) op_list->finishOperationChain(); @@ -3095,6 +3092,10 @@ void ModelWidget::removeObjects(bool cascade) emit s_objectRemoved(); msg_box.show(e); } + + /* In case of any object removal we clear the copied objects list in order to avoid + * segfaults when trying to paste an object that was removed previously */ + copied_objects.clear(); } } } From 6fbc8e189b141ef1e7e9c423bac9ff39b3f5103d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 25 Feb 2019 16:54:27 -0300 Subject: [PATCH 273/425] Added missing file installscript.qs --- ...nstallscript-linux.qs => installscript.qs} | 27 +++++++++++++++---- linuxdeploy.sh | 9 ------- 2 files changed, 22 insertions(+), 14 deletions(-) rename installer/template/packages/io.pgmodeler/meta/{installscript-linux.qs => installscript.qs} (62%) diff --git a/installer/template/packages/io.pgmodeler/meta/installscript-linux.qs b/installer/template/packages/io.pgmodeler/meta/installscript.qs similarity index 62% rename from installer/template/packages/io.pgmodeler/meta/installscript-linux.qs rename to installer/template/packages/io.pgmodeler/meta/installscript.qs index b46031a895..cd29fcab2f 100644 --- a/installer/template/packages/io.pgmodeler/meta/installscript-linux.qs +++ b/installer/template/packages/io.pgmodeler/meta/installscript.qs @@ -19,15 +19,23 @@ Component.prototype.createOperations = function() var installdir=installer.value("TargetDir"); + if(systemInfo.productType == "osx") { + return; + } + else if(systemInfo.productType == "windows") { + mime_update=installdir + "/" + "pgmodeler-cli.exe -mt"; + } + else { start_script=installdir + "/" + "start-pgmodeler.sh"; mime_update=installdir + "/" + "dbm-mime-type.sh"; component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); + } - component.addOperation("Execute", "{0,255}", mime_update, "uninstall"); - component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); - + component.addOperation("Execute", "{0,255}", mime_update, "uninstall"); + component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); + } catch (e) { print(e); } @@ -49,7 +57,16 @@ finishInstall = function() if(installer.status == QInstaller.Success) { var page = gui.pageWidgetByObjectName( "FinishedPage" ); - var info_txt=page.FinishMessageWidget.textEdit.html.replace("{installdir}",installer.value("TargetDir")) - page.FinishMessageWidget.textEdit.html=info_txt + + + if(systemInfo.productType == "windows" || systemInfo.productType == "osx") { + var page = gui.pageWidgetByObjectName( "FinishedPage" ); + page.FinishMessageWidget.textEdit.visible=false; + page.FinishMessageWidget.label.visible=false; + } + else { + var info_txt=page.FinishMessageWidget.textEdit.html.replace("{installdir}",installer.value("TargetDir")) + page.FinishMessageWidget.textEdit.html=info_txt + } } } diff --git a/linuxdeploy.sh b/linuxdeploy.sh index cc8a6139a4..fdc36ccfc1 100755 --- a/linuxdeploy.sh +++ b/linuxdeploy.sh @@ -391,15 +391,6 @@ if [ $GEN_INST_PKG = 1 ]; then echo exit 1 fi - - cat $INSTALLER_META_DIR/$INSTALLER_TMPL_PKG_CONFIG | sed -e "s/{version}/$INSTALLER_APP_VER/g" | sed -e "s/{date}/$BUILD_DATE/g" | sed -e "s/{os}/linux/g" > $INSTALLER_META_DIR/$INSTALLER_PKG_CONFIG - - if [ $? -ne 0 ]; then - echo - echo "** Failed to create the package info file!" - echo - exit 1 - fi # Packaging installation $QT_IFW_ROOT/bin/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_DIR/$PKGNAME.run" >> $LOG 2>&1 From 9ae2e8e9f86e203a7f8203a70b246373ba8b380b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 26 Feb 2019 14:33:46 -0300 Subject: [PATCH 274/425] Minor update on disclaimer text at start of the source files. --- crashhandler/src/crashhandlerform.cpp | 2 +- crashhandler/src/crashhandlerform.h | 2 +- crashhandler/src/main.cpp | 2 +- .../io.pgmodeler/meta/installscript.qs | 51 +++++++++---------- libobjrenderer/src/attributestoggleritem.cpp | 2 +- libobjrenderer/src/attributestoggleritem.h | 2 +- libobjrenderer/src/baseobjectview.cpp | 2 +- libobjrenderer/src/baseobjectview.h | 2 +- libobjrenderer/src/basetableview.cpp | 2 +- libobjrenderer/src/basetableview.h | 2 +- libobjrenderer/src/beziercurveitem.cpp | 2 +- libobjrenderer/src/beziercurveitem.h | 2 +- libobjrenderer/src/graphicalview.cpp | 2 +- libobjrenderer/src/graphicalview.h | 2 +- libobjrenderer/src/objectsscene.cpp | 2 +- libobjrenderer/src/objectsscene.h | 2 +- libobjrenderer/src/relationshipview.cpp | 2 +- libobjrenderer/src/relationshipview.h | 2 +- libobjrenderer/src/roundedrectitem.cpp | 2 +- libobjrenderer/src/roundedrectitem.h | 2 +- libobjrenderer/src/schemaview.cpp | 2 +- libobjrenderer/src/schemaview.h | 2 +- libobjrenderer/src/styledtextboxview.h | 2 +- libobjrenderer/src/tableobjectview.cpp | 2 +- libobjrenderer/src/tableobjectview.h | 2 +- libobjrenderer/src/tabletitleview.cpp | 2 +- libobjrenderer/src/tabletitleview.h | 2 +- libobjrenderer/src/tableview.cpp | 2 +- libobjrenderer/src/tableview.h | 2 +- libobjrenderer/src/textboxview.cpp | 2 +- libobjrenderer/src/textboxview.h | 2 +- libobjrenderer/src/textpolygonitem.cpp | 2 +- libobjrenderer/src/textpolygonitem.h | 2 +- libparsers/src/attribsmap.h | 2 +- libparsers/src/attributes.cpp | 2 +- libparsers/src/attributes.h | 2 +- libparsers/src/schemaparser.cpp | 2 +- libparsers/src/schemaparser.h | 2 +- libparsers/src/xmlparser.cpp | 2 +- libparsers/src/xmlparser.h | 2 +- libpgconnector/src/catalog.cpp | 2 +- libpgconnector/src/catalog.h | 2 +- libpgconnector/src/connection.cpp | 2 +- libpgconnector/src/connection.h | 2 +- libpgconnector/src/resultset.cpp | 2 +- libpgconnector/src/resultset.h | 2 +- libpgmodeler/src/aggregate.cpp | 2 +- libpgmodeler/src/aggregate.h | 2 +- libpgmodeler/src/basegraphicobject.cpp | 2 +- libpgmodeler/src/basegraphicobject.h | 2 +- libpgmodeler/src/baseobject.cpp | 2 +- libpgmodeler/src/baseobject.h | 2 +- libpgmodeler/src/baserelationship.cpp | 2 +- libpgmodeler/src/baserelationship.h | 2 +- libpgmodeler/src/basetable.cpp | 2 +- libpgmodeler/src/basetable.h | 2 +- libpgmodeler/src/cast.cpp | 2 +- libpgmodeler/src/cast.h | 2 +- libpgmodeler/src/collation.cpp | 2 +- libpgmodeler/src/collation.h | 2 +- libpgmodeler/src/column.cpp | 2 +- libpgmodeler/src/column.h | 2 +- libpgmodeler/src/constraint.cpp | 2 +- libpgmodeler/src/constraint.h | 2 +- libpgmodeler/src/conversion.cpp | 2 +- libpgmodeler/src/conversion.h | 2 +- libpgmodeler/src/copyoptions.cpp | 2 +- libpgmodeler/src/copyoptions.h | 2 +- libpgmodeler/src/databasemodel.cpp | 2 +- libpgmodeler/src/databasemodel.h | 2 +- libpgmodeler/src/domain.cpp | 2 +- libpgmodeler/src/domain.h | 2 +- libpgmodeler/src/element.cpp | 2 +- libpgmodeler/src/element.h | 2 +- libpgmodeler/src/eventtrigger.cpp | 2 +- libpgmodeler/src/eventtrigger.h | 2 +- libpgmodeler/src/excludeelement.h | 2 +- libpgmodeler/src/extension.h | 2 +- libpgmodeler/src/function.cpp | 2 +- libpgmodeler/src/function.h | 2 +- libpgmodeler/src/genericsql.cpp | 2 +- libpgmodeler/src/genericsql.h | 2 +- libpgmodeler/src/index.cpp | 2 +- libpgmodeler/src/index.h | 2 +- libpgmodeler/src/indexelement.cpp | 2 +- libpgmodeler/src/indexelement.h | 2 +- libpgmodeler/src/language.cpp | 2 +- libpgmodeler/src/language.h | 2 +- libpgmodeler/src/operation.cpp | 2 +- libpgmodeler/src/operation.h | 2 +- libpgmodeler/src/operationlist.cpp | 2 +- libpgmodeler/src/operationlist.h | 2 +- libpgmodeler/src/operator.cpp | 2 +- libpgmodeler/src/operator.h | 2 +- libpgmodeler/src/operatorclass.cpp | 2 +- libpgmodeler/src/operatorclass.h | 2 +- libpgmodeler/src/operatorclasselement.cpp | 2 +- libpgmodeler/src/operatorclasselement.h | 2 +- libpgmodeler/src/operatorfamily.cpp | 2 +- libpgmodeler/src/operatorfamily.h | 2 +- libpgmodeler/src/parameter.cpp | 2 +- libpgmodeler/src/parameter.h | 2 +- libpgmodeler/src/partitionkey.cpp | 2 +- libpgmodeler/src/partitionkey.h | 2 +- libpgmodeler/src/permission.cpp | 2 +- libpgmodeler/src/permission.h | 2 +- libpgmodeler/src/pgmodelerns.cpp | 2 +- libpgmodeler/src/pgmodelerns.h | 2 +- libpgmodeler/src/pgsqltypes.cpp | 2 +- libpgmodeler/src/pgsqltypes.h | 2 +- libpgmodeler/src/policy.cpp | 2 +- libpgmodeler/src/policy.h | 2 +- libpgmodeler/src/reference.cpp | 2 +- libpgmodeler/src/reference.h | 2 +- libpgmodeler/src/relationship.cpp | 2 +- libpgmodeler/src/relationship.h | 2 +- libpgmodeler/src/role.cpp | 2 +- libpgmodeler/src/role.h | 2 +- libpgmodeler/src/rule.cpp | 2 +- libpgmodeler/src/rule.h | 2 +- libpgmodeler/src/schema.cpp | 2 +- libpgmodeler/src/schema.h | 2 +- libpgmodeler/src/sequence.cpp | 2 +- libpgmodeler/src/sequence.h | 2 +- libpgmodeler/src/table.cpp | 2 +- libpgmodeler/src/table.h | 2 +- libpgmodeler/src/tableobject.cpp | 2 +- libpgmodeler/src/tableobject.h | 2 +- libpgmodeler/src/tablespace.cpp | 2 +- libpgmodeler/src/tablespace.h | 2 +- libpgmodeler/src/tag.cpp | 2 +- libpgmodeler/src/tag.h | 2 +- libpgmodeler/src/textbox.cpp | 2 +- libpgmodeler/src/textbox.h | 2 +- libpgmodeler/src/trigger.cpp | 2 +- libpgmodeler/src/trigger.h | 2 +- libpgmodeler/src/type.cpp | 2 +- libpgmodeler/src/type.h | 2 +- libpgmodeler/src/typeattribute.cpp | 2 +- libpgmodeler/src/typeattribute.h | 2 +- libpgmodeler/src/view.cpp | 2 +- libpgmodeler/src/view.h | 2 +- libpgmodeler_ui/src/aboutwidget.cpp | 2 +- libpgmodeler_ui/src/aboutwidget.h | 2 +- libpgmodeler_ui/src/aggregatewidget.cpp | 2 +- libpgmodeler_ui/src/aggregatewidget.h | 2 +- .../src/appearanceconfigwidget.cpp | 2 +- libpgmodeler_ui/src/appearanceconfigwidget.h | 2 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 2 +- libpgmodeler_ui/src/baseconfigwidget.h | 2 +- libpgmodeler_ui/src/baseform.cpp | 2 +- libpgmodeler_ui/src/baseform.h | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 2 +- libpgmodeler_ui/src/baseobjectwidget.h | 2 +- libpgmodeler_ui/src/bugreportform.cpp | 2 +- libpgmodeler_ui/src/bugreportform.h | 2 +- libpgmodeler_ui/src/bulkdataeditwidget.cpp | 2 +- libpgmodeler_ui/src/bulkdataeditwidget.h | 2 +- libpgmodeler_ui/src/castwidget.cpp | 2 +- libpgmodeler_ui/src/castwidget.h | 2 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 2 +- libpgmodeler_ui/src/codecompletionwidget.h | 2 +- libpgmodeler_ui/src/collationwidget.cpp | 2 +- libpgmodeler_ui/src/collationwidget.h | 2 +- libpgmodeler_ui/src/colorpickerwidget.cpp | 2 +- libpgmodeler_ui/src/colorpickerwidget.h | 2 +- libpgmodeler_ui/src/columnwidget.cpp | 2 +- libpgmodeler_ui/src/columnwidget.h | 2 +- libpgmodeler_ui/src/configurationform.cpp | 2 +- libpgmodeler_ui/src/configurationform.h | 2 +- .../src/connectionsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/connectionsconfigwidget.h | 2 +- libpgmodeler_ui/src/constraintwidget.cpp | 2 +- libpgmodeler_ui/src/constraintwidget.h | 2 +- libpgmodeler_ui/src/conversionwidget.cpp | 2 +- libpgmodeler_ui/src/conversionwidget.h | 2 +- libpgmodeler_ui/src/csvloadwidget.cpp | 2 +- libpgmodeler_ui/src/csvloadwidget.h | 2 +- libpgmodeler_ui/src/customsqlwidget.cpp | 2 +- libpgmodeler_ui/src/customsqlwidget.h | 2 +- .../src/databaseexplorerwidget.cpp | 2 +- libpgmodeler_ui/src/databaseexplorerwidget.h | 2 +- libpgmodeler_ui/src/databaseimportform.cpp | 2 +- libpgmodeler_ui/src/databaseimportform.h | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 2 +- libpgmodeler_ui/src/databaseimporthelper.h | 2 +- libpgmodeler_ui/src/databasewidget.cpp | 2 +- libpgmodeler_ui/src/databasewidget.h | 2 +- libpgmodeler_ui/src/datamanipulationform.cpp | 2 +- libpgmodeler_ui/src/datamanipulationform.h | 2 +- libpgmodeler_ui/src/domainwidget.cpp | 2 +- libpgmodeler_ui/src/domainwidget.h | 2 +- libpgmodeler_ui/src/donatewidget.cpp | 2 +- libpgmodeler_ui/src/donatewidget.h | 2 +- libpgmodeler_ui/src/elementstablewidget.cpp | 2 +- libpgmodeler_ui/src/elementstablewidget.h | 2 +- libpgmodeler_ui/src/elementwidget.cpp | 2 +- libpgmodeler_ui/src/elementwidget.h | 2 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 2 +- libpgmodeler_ui/src/eventtriggerwidget.h | 2 +- libpgmodeler_ui/src/extensionwidget.h | 2 +- libpgmodeler_ui/src/findreplacewidget.cpp | 2 +- libpgmodeler_ui/src/findreplacewidget.h | 2 +- libpgmodeler_ui/src/functionwidget.cpp | 2 +- libpgmodeler_ui/src/functionwidget.h | 2 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 2 +- libpgmodeler_ui/src/generalconfigwidget.h | 2 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 2 +- libpgmodeler_ui/src/genericsqlwidget.h | 2 +- libpgmodeler_ui/src/hinttextwidget.cpp | 2 +- libpgmodeler_ui/src/hinttextwidget.h | 2 +- libpgmodeler_ui/src/htmlitemdelegate.cpp | 2 +- libpgmodeler_ui/src/htmlitemdelegate.h | 2 +- libpgmodeler_ui/src/indexwidget.cpp | 2 +- libpgmodeler_ui/src/indexwidget.h | 2 +- libpgmodeler_ui/src/languagewidget.cpp | 2 +- libpgmodeler_ui/src/languagewidget.h | 2 +- libpgmodeler_ui/src/layerswidget.cpp | 2 +- libpgmodeler_ui/src/layerswidget.h | 2 +- libpgmodeler_ui/src/linenumberswidget.cpp | 2 +- libpgmodeler_ui/src/linenumberswidget.h | 2 +- libpgmodeler_ui/src/mainwindow.cpp | 2 +- libpgmodeler_ui/src/mainwindow.h | 2 +- libpgmodeler_ui/src/messagebox.cpp | 2 +- libpgmodeler_ui/src/messagebox.h | 2 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 2 +- libpgmodeler_ui/src/metadatahandlingform.h | 2 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 2 +- libpgmodeler_ui/src/modeldatabasediffform.h | 2 +- libpgmodeler_ui/src/modelexportform.cpp | 2 +- libpgmodeler_ui/src/modelexportform.h | 2 +- libpgmodeler_ui/src/modelexporthelper.h | 2 +- libpgmodeler_ui/src/modelfixform.cpp | 2 +- libpgmodeler_ui/src/modelfixform.h | 2 +- libpgmodeler_ui/src/modelnavigationwidget.cpp | 2 +- libpgmodeler_ui/src/modelnavigationwidget.h | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 2 +- libpgmodeler_ui/src/modelobjectswidget.h | 2 +- libpgmodeler_ui/src/modeloverviewwidget.cpp | 2 +- libpgmodeler_ui/src/modeloverviewwidget.h | 2 +- libpgmodeler_ui/src/modelrestorationform.cpp | 2 +- libpgmodeler_ui/src/modelrestorationform.h | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 2 +- libpgmodeler_ui/src/modelsdiffhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 2 +- libpgmodeler_ui/src/modelvalidationhelper.h | 2 +- libpgmodeler_ui/src/modelvalidationwidget.cpp | 2 +- libpgmodeler_ui/src/modelvalidationwidget.h | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 2 +- libpgmodeler_ui/src/modelwidget.h | 2 +- .../src/newobjectoverlaywidget.cpp | 2 +- libpgmodeler_ui/src/newobjectoverlaywidget.h | 2 +- libpgmodeler_ui/src/numberedtexteditor.cpp | 2 +- libpgmodeler_ui/src/numberedtexteditor.h | 2 +- libpgmodeler_ui/src/objectdepsrefswidget.cpp | 2 +- libpgmodeler_ui/src/objectdepsrefswidget.h | 2 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 2 +- libpgmodeler_ui/src/objectfinderwidget.h | 2 +- libpgmodeler_ui/src/objectrenamewidget.cpp | 2 +- libpgmodeler_ui/src/objectrenamewidget.h | 2 +- libpgmodeler_ui/src/objectsdiffinfo.cpp | 2 +- libpgmodeler_ui/src/objectsdiffinfo.h | 2 +- libpgmodeler_ui/src/objectselectorwidget.cpp | 2 +- libpgmodeler_ui/src/objectselectorwidget.h | 2 +- libpgmodeler_ui/src/objectstablewidget.cpp | 2 +- libpgmodeler_ui/src/objectstablewidget.h | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.h | 2 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 2 +- libpgmodeler_ui/src/operatorclasswidget.h | 2 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 2 +- libpgmodeler_ui/src/operatorfamilywidget.h | 2 +- libpgmodeler_ui/src/operatorwidget.cpp | 2 +- libpgmodeler_ui/src/operatorwidget.h | 2 +- libpgmodeler_ui/src/parameterwidget.cpp | 2 +- libpgmodeler_ui/src/parameterwidget.h | 2 +- libpgmodeler_ui/src/permissionwidget.cpp | 2 +- libpgmodeler_ui/src/permissionwidget.h | 2 +- libpgmodeler_ui/src/pgmodelerplugin.cpp | 2 +- libpgmodeler_ui/src/pgmodelerplugin.h | 2 +- libpgmodeler_ui/src/pgmodeleruins.h | 2 +- libpgmodeler_ui/src/pgsqltypewidget.cpp | 2 +- libpgmodeler_ui/src/pgsqltypewidget.h | 2 +- libpgmodeler_ui/src/plaintextitemdelegate.cpp | 2 +- libpgmodeler_ui/src/plaintextitemdelegate.h | 2 +- libpgmodeler_ui/src/pluginsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/pluginsconfigwidget.h | 2 +- libpgmodeler_ui/src/policywidget.cpp | 2 +- libpgmodeler_ui/src/policywidget.h | 2 +- libpgmodeler_ui/src/referencewidget.cpp | 2 +- libpgmodeler_ui/src/referencewidget.h | 2 +- .../src/relationshipconfigwidget.cpp | 2 +- .../src/relationshipconfigwidget.h | 2 +- libpgmodeler_ui/src/relationshipwidget.cpp | 2 +- libpgmodeler_ui/src/relationshipwidget.h | 2 +- libpgmodeler_ui/src/resultsetmodel.cpp | 2 +- libpgmodeler_ui/src/resultsetmodel.h | 2 +- libpgmodeler_ui/src/rolewidget.cpp | 2 +- libpgmodeler_ui/src/rolewidget.h | 2 +- libpgmodeler_ui/src/rulewidget.cpp | 2 +- libpgmodeler_ui/src/rulewidget.h | 2 +- libpgmodeler_ui/src/sceneinfowidget.cpp | 2 +- libpgmodeler_ui/src/sceneinfowidget.h | 2 +- libpgmodeler_ui/src/schemawidget.cpp | 2 +- libpgmodeler_ui/src/schemawidget.h | 2 +- libpgmodeler_ui/src/sequencewidget.cpp | 2 +- libpgmodeler_ui/src/sequencewidget.h | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 2 +- libpgmodeler_ui/src/snippetsconfigwidget.h | 2 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 2 +- libpgmodeler_ui/src/sourcecodewidget.h | 2 +- libpgmodeler_ui/src/sqlexecutionhelper.cpp | 2 +- libpgmodeler_ui/src/sqlexecutionhelper.h | 2 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 +- libpgmodeler_ui/src/sqlexecutionwidget.h | 2 +- libpgmodeler_ui/src/sqltoolwidget.cpp | 2 +- libpgmodeler_ui/src/sqltoolwidget.h | 2 +- libpgmodeler_ui/src/swapobjectsidswidget.h | 2 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 2 +- libpgmodeler_ui/src/syntaxhighlighter.h | 2 +- libpgmodeler_ui/src/tabledatawidget.cpp | 2 +- libpgmodeler_ui/src/tabledatawidget.h | 2 +- libpgmodeler_ui/src/tablespacewidget.cpp | 2 +- libpgmodeler_ui/src/tablespacewidget.h | 2 +- libpgmodeler_ui/src/tablewidget.cpp | 2 +- libpgmodeler_ui/src/tablewidget.h | 2 +- libpgmodeler_ui/src/tagwidget.cpp | 2 +- libpgmodeler_ui/src/tagwidget.h | 2 +- libpgmodeler_ui/src/taskprogresswidget.cpp | 2 +- libpgmodeler_ui/src/taskprogresswidget.h | 2 +- libpgmodeler_ui/src/textboxwidget.cpp | 2 +- libpgmodeler_ui/src/textboxwidget.h | 2 +- libpgmodeler_ui/src/triggerwidget.cpp | 2 +- libpgmodeler_ui/src/triggerwidget.h | 2 +- libpgmodeler_ui/src/typewidget.cpp | 2 +- libpgmodeler_ui/src/typewidget.h | 2 +- libpgmodeler_ui/src/updatenotifierwidget.cpp | 2 +- libpgmodeler_ui/src/updatenotifierwidget.h | 2 +- libpgmodeler_ui/src/validationinfo.cpp | 2 +- libpgmodeler_ui/src/validationinfo.h | 2 +- libpgmodeler_ui/src/viewwidget.cpp | 2 +- libpgmodeler_ui/src/viewwidget.h | 2 +- libpgmodeler_ui/src/welcomewidget.cpp | 2 +- libpgmodeler_ui/src/welcomewidget.h | 2 +- libutils/src/exception.cpp | 2 +- libutils/src/exception.h | 2 +- libutils/src/globalattributes.cpp | 2 +- libutils/src/globalattributes.h | 2 +- libutils/src/pgsqlversions.cpp | 2 +- libutils/src/pgsqlversions.h | 2 +- main-cli/src/main.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 2 +- main-cli/src/pgmodelercli.h | 2 +- main/src/application.cpp | 2 +- main/src/application.h | 2 +- main/src/main.cpp | 2 +- plugins/dummy/src/dummy.cpp | 2 +- plugins/dummy/src/dummy.h | 2 +- plugins/xml2object/src/xml2object.cpp | 2 +- plugins/xml2object/src/xml2object.h | 2 +- tests/src/baseobjecttest/baseobjecttest.cpp | 2 +- .../databasemodeltest/databasemodeltest.cpp | 2 +- tests/src/linenumberstest/linenumberstest.cpp | 2 +- tests/src/main/main.cpp | 2 +- .../partrelationshiptest.cpp | 2 +- tests/src/roletest/roletest.cpp | 2 +- .../src/schemaparsertest/schemaparsertest.cpp | 2 +- .../syntaxhighlightertest.cpp | 2 +- 368 files changed, 391 insertions(+), 394 deletions(-) diff --git a/crashhandler/src/crashhandlerform.cpp b/crashhandler/src/crashhandlerform.cpp index 5bbe47ffc9..f4ee8f7606 100644 --- a/crashhandler/src/crashhandlerform.cpp +++ b/crashhandler/src/crashhandlerform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/crashhandler/src/crashhandlerform.h b/crashhandler/src/crashhandlerform.h index 868c54d3a4..9aafab089a 100644 --- a/crashhandler/src/crashhandlerform.h +++ b/crashhandler/src/crashhandlerform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/crashhandler/src/main.cpp b/crashhandler/src/main.cpp index 55cd3a9dfd..872f646253 100644 --- a/crashhandler/src/main.cpp +++ b/crashhandler/src/main.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/installer/template/packages/io.pgmodeler/meta/installscript.qs b/installer/template/packages/io.pgmodeler/meta/installscript.qs index cd29fcab2f..2b8a80a0ac 100644 --- a/installer/template/packages/io.pgmodeler/meta/installscript.qs +++ b/installer/template/packages/io.pgmodeler/meta/installscript.qs @@ -19,29 +19,28 @@ Component.prototype.createOperations = function() var installdir=installer.value("TargetDir"); - if(systemInfo.productType == "osx") { + if(systemInfo.productType === "osx") { return; } - else if(systemInfo.productType == "windows") { - mime_update=installdir + "/" + "pgmodeler-cli.exe -mt"; - } - else { - start_script=installdir + "/" + "start-pgmodeler.sh"; - mime_update=installdir + "/" + "dbm-mime-type.sh"; - - component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); - component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); - } - - component.addOperation("Execute", "{0,255}", mime_update, "uninstall"); - component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); - + else if (systemInfo.productType === "windows") { + mime_update=installdir + "/" + "pgmodeler-cli.exe"; + component.addOperation("Execute", "{0,127,255}", mime_update, "-mt", "uninstall"); + component.addOperation("Execute", mime_update, "-mt", "install", "errormessage=** Could not install file association."); + } + else { + start_script=installdir + "/" + "start-pgmodeler.sh"; + mime_update=installdir + "/" + "dbm-mime-type.sh"; + component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); + component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); + component.addOperation("Execute", "{0,127,255}", mime_update, "uninstall"); + component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); + } } catch (e) { print(e); } } -// called after everything is set up, but before any fie is written +// called after everything is set up, but before any file is written Component.prototype.beginInstallation = function() { // call default implementation which is necessary for most hooks @@ -57,16 +56,14 @@ finishInstall = function() if(installer.status == QInstaller.Success) { var page = gui.pageWidgetByObjectName( "FinishedPage" ); - - - if(systemInfo.productType == "windows" || systemInfo.productType == "osx") { - var page = gui.pageWidgetByObjectName( "FinishedPage" ); - page.FinishMessageWidget.textEdit.visible=false; - page.FinishMessageWidget.label.visible=false; - } - else { - var info_txt=page.FinishMessageWidget.textEdit.html.replace("{installdir}",installer.value("TargetDir")) - page.FinishMessageWidget.textEdit.html=info_txt - } + + if (systemInfo.productType === "windows" || systemInfo.productType === "osx") { + page.FinishMessageWidget.textEdit.visible=false; + page.FinishMessageWidget.label.visible=false; + } + else { + var info_txt=page.FinishMessageWidget.textEdit.html.replace("{installdir}",installer.value("TargetDir")); + page.FinishMessageWidget.textEdit.html=info_txt; + } } } diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index f10b557c81..f571e5ce4d 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/attributestoggleritem.h b/libobjrenderer/src/attributestoggleritem.h index f60017502c..794a4bc1f6 100644 --- a/libobjrenderer/src/attributestoggleritem.h +++ b/libobjrenderer/src/attributestoggleritem.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index dcc556220a..eb7518b680 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 59a512cf1b..e9054ec9c5 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 26676c480c..1e82de29f6 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index cfd7b3eb4a..2a663b8628 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/beziercurveitem.cpp b/libobjrenderer/src/beziercurveitem.cpp index d18f64662d..1bce343ebf 100644 --- a/libobjrenderer/src/beziercurveitem.cpp +++ b/libobjrenderer/src/beziercurveitem.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/beziercurveitem.h b/libobjrenderer/src/beziercurveitem.h index 7f8da09c6d..f367dba0b2 100644 --- a/libobjrenderer/src/beziercurveitem.h +++ b/libobjrenderer/src/beziercurveitem.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index 80245ad09a..e7d7d07387 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/graphicalview.h b/libobjrenderer/src/graphicalview.h index 74f559582f..0fc2b85d91 100644 --- a/libobjrenderer/src/graphicalview.h +++ b/libobjrenderer/src/graphicalview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 900cc37448..d34f14cdca 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 5efa3492c6..6e938a95f9 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 066985f602..d8252f7301 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/relationshipview.h b/libobjrenderer/src/relationshipview.h index 67654f2ef9..e32f3bd13e 100644 --- a/libobjrenderer/src/relationshipview.h +++ b/libobjrenderer/src/relationshipview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/roundedrectitem.cpp b/libobjrenderer/src/roundedrectitem.cpp index be8524eb6c..3ccf34ad6f 100644 --- a/libobjrenderer/src/roundedrectitem.cpp +++ b/libobjrenderer/src/roundedrectitem.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/roundedrectitem.h b/libobjrenderer/src/roundedrectitem.h index 43dd5eb5d2..9ff36a9ccc 100644 --- a/libobjrenderer/src/roundedrectitem.h +++ b/libobjrenderer/src/roundedrectitem.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index 60e1a29eae..fce098dd44 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/schemaview.h b/libobjrenderer/src/schemaview.h index f80b591a63..66b18728b5 100644 --- a/libobjrenderer/src/schemaview.h +++ b/libobjrenderer/src/schemaview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/styledtextboxview.h b/libobjrenderer/src/styledtextboxview.h index c368486745..65b8972e30 100644 --- a/libobjrenderer/src/styledtextboxview.h +++ b/libobjrenderer/src/styledtextboxview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 173df676f3..c200098db2 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index d67a3a2a75..1d1aeec450 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 71449c5e05..2a886e41d5 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/tabletitleview.h b/libobjrenderer/src/tabletitleview.h index 17f27c8e7a..e2891e918e 100644 --- a/libobjrenderer/src/tabletitleview.h +++ b/libobjrenderer/src/tabletitleview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index 31daaaab6f..e0e953872f 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/tableview.h b/libobjrenderer/src/tableview.h index 3825896c14..6e6c400b3e 100644 --- a/libobjrenderer/src/tableview.h +++ b/libobjrenderer/src/tableview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 191f19a778..60273e7206 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/textboxview.h b/libobjrenderer/src/textboxview.h index 687f0562b4..be40509e13 100644 --- a/libobjrenderer/src/textboxview.h +++ b/libobjrenderer/src/textboxview.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/textpolygonitem.cpp b/libobjrenderer/src/textpolygonitem.cpp index b3aa2a86f1..3723fb250d 100644 --- a/libobjrenderer/src/textpolygonitem.cpp +++ b/libobjrenderer/src/textpolygonitem.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libobjrenderer/src/textpolygonitem.h b/libobjrenderer/src/textpolygonitem.h index 43fdb53e42..859b96c9cc 100644 --- a/libobjrenderer/src/textpolygonitem.h +++ b/libobjrenderer/src/textpolygonitem.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libparsers/src/attribsmap.h b/libparsers/src/attribsmap.h index fc68c8159d..88e104dd07 100644 --- a/libparsers/src/attribsmap.h +++ b/libparsers/src/attribsmap.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 9309180ed2..eb7cc69fe2 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index f3b57ea31f..33fe0b14d8 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index c6c11724dc..19d3f5c2de 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libparsers/src/schemaparser.h b/libparsers/src/schemaparser.h index e92324058c..16a38f2658 100644 --- a/libparsers/src/schemaparser.h +++ b/libparsers/src/schemaparser.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index 511317a1a7..1c172e3c9f 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libparsers/src/xmlparser.h b/libparsers/src/xmlparser.h index 4c18d1756f..7ba1bd15a6 100644 --- a/libparsers/src/xmlparser.h +++ b/libparsers/src/xmlparser.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 0009fcfb5e..6ce2051efc 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgconnector/src/catalog.h b/libpgconnector/src/catalog.h index 333131aabd..77037780eb 100644 --- a/libpgconnector/src/catalog.h +++ b/libpgconnector/src/catalog.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index 61f882ec6c..7704ea0774 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgconnector/src/connection.h b/libpgconnector/src/connection.h index 610982a918..d9b44c23f5 100644 --- a/libpgconnector/src/connection.h +++ b/libpgconnector/src/connection.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index 61cf5d3ad4..782d8abf16 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgconnector/src/resultset.h b/libpgconnector/src/resultset.h index 63ed0c387c..7be97d0142 100644 --- a/libpgconnector/src/resultset.h +++ b/libpgconnector/src/resultset.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 5c74d24a8e..e6d47a3246 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/aggregate.h b/libpgmodeler/src/aggregate.h index 01ca7c931f..011ca28982 100644 --- a/libpgmodeler/src/aggregate.h +++ b/libpgmodeler/src/aggregate.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 119574b0b8..8f0d8b590b 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/basegraphicobject.h b/libpgmodeler/src/basegraphicobject.h index eecfb889d8..fabe353ae9 100644 --- a/libpgmodeler/src/basegraphicobject.h +++ b/libpgmodeler/src/basegraphicobject.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 126d90a71f..3d5752cfd2 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index c0f67a549e..4b53f16e95 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -1,6 +1,6 @@ /* # PostgreSQL Database Modeler (pgModeler) -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 5bc1ce73b6..ecfe05392e 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/baserelationship.h b/libpgmodeler/src/baserelationship.h index 1857743ed8..5aa2701420 100644 --- a/libpgmodeler/src/baserelationship.h +++ b/libpgmodeler/src/baserelationship.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index 105a223adf..b87da1c9a8 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/basetable.h b/libpgmodeler/src/basetable.h index 301929d134..0e12d680f6 100644 --- a/libpgmodeler/src/basetable.h +++ b/libpgmodeler/src/basetable.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index bf2e039ac1..d1c62e24a5 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/cast.h b/libpgmodeler/src/cast.h index e77dccac24..e16e6a31f6 100644 --- a/libpgmodeler/src/cast.h +++ b/libpgmodeler/src/cast.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index e5b2a84259..fb919ed71e 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/collation.h b/libpgmodeler/src/collation.h index 8cd7d2a363..4872ccbbc6 100644 --- a/libpgmodeler/src/collation.h +++ b/libpgmodeler/src/collation.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 26044726d7..cd784f2f50 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/column.h b/libpgmodeler/src/column.h index 33d4c5907f..24d93fd2ed 100644 --- a/libpgmodeler/src/column.h +++ b/libpgmodeler/src/column.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index 44703f12c1..f62fb17b1a 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/constraint.h b/libpgmodeler/src/constraint.h index 88e2533d6c..da94135e3f 100644 --- a/libpgmodeler/src/constraint.h +++ b/libpgmodeler/src/constraint.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/conversion.cpp b/libpgmodeler/src/conversion.cpp index 6d1e693e30..352266a004 100644 --- a/libpgmodeler/src/conversion.cpp +++ b/libpgmodeler/src/conversion.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/conversion.h b/libpgmodeler/src/conversion.h index a0f7f1a4b9..86bb1942fa 100644 --- a/libpgmodeler/src/conversion.h +++ b/libpgmodeler/src/conversion.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/copyoptions.cpp b/libpgmodeler/src/copyoptions.cpp index b73aad0659..349cb95a1d 100644 --- a/libpgmodeler/src/copyoptions.cpp +++ b/libpgmodeler/src/copyoptions.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/copyoptions.h b/libpgmodeler/src/copyoptions.h index 84aff471e7..26bcc5d7ab 100644 --- a/libpgmodeler/src/copyoptions.h +++ b/libpgmodeler/src/copyoptions.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 2beceb692d..2733c4064a 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 5e88537cce..1ecd0466f6 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index c935843a97..5cba73b4a6 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/domain.h b/libpgmodeler/src/domain.h index b1f5038e77..7ccc7a625d 100644 --- a/libpgmodeler/src/domain.h +++ b/libpgmodeler/src/domain.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/element.cpp b/libpgmodeler/src/element.cpp index 03a6a3e913..7af30819d8 100644 --- a/libpgmodeler/src/element.cpp +++ b/libpgmodeler/src/element.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/element.h b/libpgmodeler/src/element.h index 36bc396c4c..bbaab3582d 100644 --- a/libpgmodeler/src/element.h +++ b/libpgmodeler/src/element.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index 5b2b8166e1..c02c206974 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/eventtrigger.h b/libpgmodeler/src/eventtrigger.h index 0e81d04524..e6e7ada71e 100644 --- a/libpgmodeler/src/eventtrigger.h +++ b/libpgmodeler/src/eventtrigger.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/excludeelement.h b/libpgmodeler/src/excludeelement.h index 8f362b8d8f..9bc86cfac8 100644 --- a/libpgmodeler/src/excludeelement.h +++ b/libpgmodeler/src/excludeelement.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/extension.h b/libpgmodeler/src/extension.h index a2dd9d742d..43e0dbee15 100644 --- a/libpgmodeler/src/extension.h +++ b/libpgmodeler/src/extension.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 629f023e6b..be504db64b 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/function.h b/libpgmodeler/src/function.h index de04b9f50d..51f33bbf71 100644 --- a/libpgmodeler/src/function.h +++ b/libpgmodeler/src/function.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 1b0d6f9fc3..1496494dc2 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/genericsql.h b/libpgmodeler/src/genericsql.h index b21d0ce506..98f57ed430 100644 --- a/libpgmodeler/src/genericsql.h +++ b/libpgmodeler/src/genericsql.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 232f6d88eb..5cc2abaccf 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/index.h b/libpgmodeler/src/index.h index 656f91f095..596d1f7962 100644 --- a/libpgmodeler/src/index.h +++ b/libpgmodeler/src/index.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/indexelement.cpp b/libpgmodeler/src/indexelement.cpp index 538c03226c..a4a7297294 100644 --- a/libpgmodeler/src/indexelement.cpp +++ b/libpgmodeler/src/indexelement.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/indexelement.h b/libpgmodeler/src/indexelement.h index c472a6bc8a..48a05a50da 100644 --- a/libpgmodeler/src/indexelement.h +++ b/libpgmodeler/src/indexelement.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/language.cpp b/libpgmodeler/src/language.cpp index 2b90d090ad..a2a53ae77d 100644 --- a/libpgmodeler/src/language.cpp +++ b/libpgmodeler/src/language.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/language.h b/libpgmodeler/src/language.h index c075140450..52b07a6cfd 100644 --- a/libpgmodeler/src/language.h +++ b/libpgmodeler/src/language.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operation.cpp b/libpgmodeler/src/operation.cpp index d5f645a649..2f20bff6e0 100644 --- a/libpgmodeler/src/operation.cpp +++ b/libpgmodeler/src/operation.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operation.h b/libpgmodeler/src/operation.h index 4444fe7858..f488ebc446 100644 --- a/libpgmodeler/src/operation.h +++ b/libpgmodeler/src/operation.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index e160deb6cf..5a520d81ae 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operationlist.h b/libpgmodeler/src/operationlist.h index b71291d6ec..8760ee4a3e 100644 --- a/libpgmodeler/src/operationlist.h +++ b/libpgmodeler/src/operationlist.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index cc3a79012c..a1086f8ac1 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operator.h b/libpgmodeler/src/operator.h index 345c797906..cad1c68b15 100644 --- a/libpgmodeler/src/operator.h +++ b/libpgmodeler/src/operator.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operatorclass.cpp b/libpgmodeler/src/operatorclass.cpp index 3516c41f7c..fbb251f243 100644 --- a/libpgmodeler/src/operatorclass.cpp +++ b/libpgmodeler/src/operatorclass.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operatorclass.h b/libpgmodeler/src/operatorclass.h index eb049fa0f9..167a5dee48 100644 --- a/libpgmodeler/src/operatorclass.h +++ b/libpgmodeler/src/operatorclass.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operatorclasselement.cpp b/libpgmodeler/src/operatorclasselement.cpp index 68ae0bb521..ba0dbbcc36 100644 --- a/libpgmodeler/src/operatorclasselement.cpp +++ b/libpgmodeler/src/operatorclasselement.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operatorclasselement.h b/libpgmodeler/src/operatorclasselement.h index b73ae9888f..29956bbf86 100644 --- a/libpgmodeler/src/operatorclasselement.h +++ b/libpgmodeler/src/operatorclasselement.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operatorfamily.cpp b/libpgmodeler/src/operatorfamily.cpp index 92de17e7fe..ecfbaa9e97 100644 --- a/libpgmodeler/src/operatorfamily.cpp +++ b/libpgmodeler/src/operatorfamily.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/operatorfamily.h b/libpgmodeler/src/operatorfamily.h index 709ef31c61..97cd10e002 100644 --- a/libpgmodeler/src/operatorfamily.h +++ b/libpgmodeler/src/operatorfamily.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index 7628a2f87f..f8bd80c811 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/parameter.h b/libpgmodeler/src/parameter.h index 71747d598d..5f52e85e4e 100644 --- a/libpgmodeler/src/parameter.h +++ b/libpgmodeler/src/parameter.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/partitionkey.cpp b/libpgmodeler/src/partitionkey.cpp index 48a2c95bea..b40a61c4f4 100644 --- a/libpgmodeler/src/partitionkey.cpp +++ b/libpgmodeler/src/partitionkey.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/partitionkey.h b/libpgmodeler/src/partitionkey.h index 713101ec3d..407bd577cc 100644 --- a/libpgmodeler/src/partitionkey.h +++ b/libpgmodeler/src/partitionkey.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 7dec0b1692..f961e7e425 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/permission.h b/libpgmodeler/src/permission.h index 1152605127..f1f148fb2f 100644 --- a/libpgmodeler/src/permission.h +++ b/libpgmodeler/src/permission.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index 57a38f0a5c..dd9dd03bb9 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/pgmodelerns.h b/libpgmodeler/src/pgmodelerns.h index a13bf1d346..73629d65fd 100644 --- a/libpgmodeler/src/pgmodelerns.h +++ b/libpgmodeler/src/pgmodelerns.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 841b6216b2..7ac32858c5 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/pgsqltypes.h b/libpgmodeler/src/pgsqltypes.h index e746119b99..21051f49c5 100644 --- a/libpgmodeler/src/pgsqltypes.h +++ b/libpgmodeler/src/pgsqltypes.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index 21aaf0c5a1..6e75f5ba48 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/policy.h b/libpgmodeler/src/policy.h index cda7614ea7..63ee4825cc 100644 --- a/libpgmodeler/src/policy.h +++ b/libpgmodeler/src/policy.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 4a2a119046..9a4afd6a96 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/reference.h b/libpgmodeler/src/reference.h index 58fbf50a56..5753441d2f 100644 --- a/libpgmodeler/src/reference.h +++ b/libpgmodeler/src/reference.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 95b323f44b..56879fe877 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/relationship.h b/libpgmodeler/src/relationship.h index 2edff60fa9..4e776b5495 100644 --- a/libpgmodeler/src/relationship.h +++ b/libpgmodeler/src/relationship.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index f2cbab35bd..e6c53f54ca 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/role.h b/libpgmodeler/src/role.h index f15d8f70db..2b38015eb3 100644 --- a/libpgmodeler/src/role.h +++ b/libpgmodeler/src/role.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/rule.cpp b/libpgmodeler/src/rule.cpp index 2713d7a473..21b5b2f1dd 100644 --- a/libpgmodeler/src/rule.cpp +++ b/libpgmodeler/src/rule.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/rule.h b/libpgmodeler/src/rule.h index 90379857ee..56c9e7ac8c 100644 --- a/libpgmodeler/src/rule.h +++ b/libpgmodeler/src/rule.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/schema.cpp b/libpgmodeler/src/schema.cpp index 802c132cf2..257fa2d6fc 100644 --- a/libpgmodeler/src/schema.cpp +++ b/libpgmodeler/src/schema.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/schema.h b/libpgmodeler/src/schema.h index 99174dcb27..79e1f19f8c 100644 --- a/libpgmodeler/src/schema.h +++ b/libpgmodeler/src/schema.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 0ad64f2ca7..9d3570c81b 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/sequence.h b/libpgmodeler/src/sequence.h index 8c92c037f7..f63700c80c 100644 --- a/libpgmodeler/src/sequence.h +++ b/libpgmodeler/src/sequence.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 059deba9b4..f76bfad70a 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/table.h b/libpgmodeler/src/table.h index 2216f33ab0..87ac2e2cab 100644 --- a/libpgmodeler/src/table.h +++ b/libpgmodeler/src/table.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/tableobject.cpp b/libpgmodeler/src/tableobject.cpp index 8030b21b86..8d3514cd1b 100644 --- a/libpgmodeler/src/tableobject.cpp +++ b/libpgmodeler/src/tableobject.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/tableobject.h b/libpgmodeler/src/tableobject.h index 06e155d0f9..35058d82af 100644 --- a/libpgmodeler/src/tableobject.h +++ b/libpgmodeler/src/tableobject.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/tablespace.cpp b/libpgmodeler/src/tablespace.cpp index 3e2aae5ac2..3973edde96 100644 --- a/libpgmodeler/src/tablespace.cpp +++ b/libpgmodeler/src/tablespace.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/tablespace.h b/libpgmodeler/src/tablespace.h index 4ea0052549..03eff268e4 100644 --- a/libpgmodeler/src/tablespace.h +++ b/libpgmodeler/src/tablespace.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index 4a46a216bf..aece39988c 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/tag.h b/libpgmodeler/src/tag.h index 15559eb6af..b31b407d89 100644 --- a/libpgmodeler/src/tag.h +++ b/libpgmodeler/src/tag.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index af8e1a60e7..dbb81aaef1 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/textbox.h b/libpgmodeler/src/textbox.h index 18319e1ce8..c6db6a8f1d 100644 --- a/libpgmodeler/src/textbox.h +++ b/libpgmodeler/src/textbox.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/trigger.cpp b/libpgmodeler/src/trigger.cpp index 15f548dd61..0c75999bf8 100644 --- a/libpgmodeler/src/trigger.cpp +++ b/libpgmodeler/src/trigger.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/trigger.h b/libpgmodeler/src/trigger.h index 3e5eb93424..1951823f11 100644 --- a/libpgmodeler/src/trigger.h +++ b/libpgmodeler/src/trigger.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 82973d04e0..826c0de562 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/type.h b/libpgmodeler/src/type.h index 21a8a93dd8..aed37a7b44 100644 --- a/libpgmodeler/src/type.h +++ b/libpgmodeler/src/type.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/typeattribute.cpp b/libpgmodeler/src/typeattribute.cpp index 00aee07be8..cc1ac3aa35 100644 --- a/libpgmodeler/src/typeattribute.cpp +++ b/libpgmodeler/src/typeattribute.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/typeattribute.h b/libpgmodeler/src/typeattribute.h index 89592783cb..6417c7321e 100644 --- a/libpgmodeler/src/typeattribute.h +++ b/libpgmodeler/src/typeattribute.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 3c52860add..e83a4fa4c6 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler/src/view.h b/libpgmodeler/src/view.h index 2993ae3e66..14178de510 100644 --- a/libpgmodeler/src/view.h +++ b/libpgmodeler/src/view.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/aboutwidget.cpp b/libpgmodeler_ui/src/aboutwidget.cpp index 813ecb2a91..974fb96c18 100644 --- a/libpgmodeler_ui/src/aboutwidget.cpp +++ b/libpgmodeler_ui/src/aboutwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/aboutwidget.h b/libpgmodeler_ui/src/aboutwidget.h index 046441549d..5178546797 100644 --- a/libpgmodeler_ui/src/aboutwidget.h +++ b/libpgmodeler_ui/src/aboutwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index 67e53fbfda..424de8a05f 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/aggregatewidget.h b/libpgmodeler_ui/src/aggregatewidget.h index 0903ff677c..1c8d45cbe7 100644 --- a/libpgmodeler_ui/src/aggregatewidget.h +++ b/libpgmodeler_ui/src/aggregatewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index 57f8aec5e8..c4b9f9d14a 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.h b/libpgmodeler_ui/src/appearanceconfigwidget.h index b6551b01e8..d5c58d30fd 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.h +++ b/libpgmodeler_ui/src/appearanceconfigwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index c6ac1f43c2..05c40644e1 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/baseconfigwidget.h b/libpgmodeler_ui/src/baseconfigwidget.h index 36f8ddbc51..760c6bc3fc 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.h +++ b/libpgmodeler_ui/src/baseconfigwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp index d8642086c4..1079e80599 100644 --- a/libpgmodeler_ui/src/baseform.cpp +++ b/libpgmodeler_ui/src/baseform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/baseform.h b/libpgmodeler_ui/src/baseform.h index 9a9e96acd0..519fb3895d 100644 --- a/libpgmodeler_ui/src/baseform.h +++ b/libpgmodeler_ui/src/baseform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 390eb5787e..8ba0945c24 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 89996bb7cf..76be821c76 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/bugreportform.cpp b/libpgmodeler_ui/src/bugreportform.cpp index 188120de28..66f1a3b7ba 100644 --- a/libpgmodeler_ui/src/bugreportform.cpp +++ b/libpgmodeler_ui/src/bugreportform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/bugreportform.h b/libpgmodeler_ui/src/bugreportform.h index 876b4caa25..8c627bc6a9 100644 --- a/libpgmodeler_ui/src/bugreportform.h +++ b/libpgmodeler_ui/src/bugreportform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/bulkdataeditwidget.cpp b/libpgmodeler_ui/src/bulkdataeditwidget.cpp index a94af2ac89..f868755fa6 100644 --- a/libpgmodeler_ui/src/bulkdataeditwidget.cpp +++ b/libpgmodeler_ui/src/bulkdataeditwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/bulkdataeditwidget.h b/libpgmodeler_ui/src/bulkdataeditwidget.h index bad6b36ff4..82f41b027d 100644 --- a/libpgmodeler_ui/src/bulkdataeditwidget.h +++ b/libpgmodeler_ui/src/bulkdataeditwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/castwidget.cpp b/libpgmodeler_ui/src/castwidget.cpp index 7b99a635b4..ae1c781a5d 100644 --- a/libpgmodeler_ui/src/castwidget.cpp +++ b/libpgmodeler_ui/src/castwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/castwidget.h b/libpgmodeler_ui/src/castwidget.h index ade9386e2c..3511d18124 100644 --- a/libpgmodeler_ui/src/castwidget.h +++ b/libpgmodeler_ui/src/castwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 67bf261ce0..4b8c0b5cd6 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/codecompletionwidget.h b/libpgmodeler_ui/src/codecompletionwidget.h index d8faf7a3d5..a38d2e1e05 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.h +++ b/libpgmodeler_ui/src/codecompletionwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/collationwidget.cpp b/libpgmodeler_ui/src/collationwidget.cpp index 2d75c6dfe6..cb546820d0 100644 --- a/libpgmodeler_ui/src/collationwidget.cpp +++ b/libpgmodeler_ui/src/collationwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/collationwidget.h b/libpgmodeler_ui/src/collationwidget.h index e181ed226a..442e2d0842 100644 --- a/libpgmodeler_ui/src/collationwidget.h +++ b/libpgmodeler_ui/src/collationwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/colorpickerwidget.cpp b/libpgmodeler_ui/src/colorpickerwidget.cpp index 3364fea826..84a6fcd3af 100644 --- a/libpgmodeler_ui/src/colorpickerwidget.cpp +++ b/libpgmodeler_ui/src/colorpickerwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/colorpickerwidget.h b/libpgmodeler_ui/src/colorpickerwidget.h index 946d4328c2..25be79bac8 100644 --- a/libpgmodeler_ui/src/colorpickerwidget.h +++ b/libpgmodeler_ui/src/colorpickerwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 3a84691465..68911189f6 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/columnwidget.h b/libpgmodeler_ui/src/columnwidget.h index 09faef2a7b..84c9515e3a 100644 --- a/libpgmodeler_ui/src/columnwidget.h +++ b/libpgmodeler_ui/src/columnwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index adbafb7a63..04e5921b4d 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/configurationform.h b/libpgmodeler_ui/src/configurationform.h index 389566d39a..ef4d7c3db3 100644 --- a/libpgmodeler_ui/src/configurationform.h +++ b/libpgmodeler_ui/src/configurationform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 431199694b..08646dbd62 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.h b/libpgmodeler_ui/src/connectionsconfigwidget.h index 40c9dd3980..4446c6fcc7 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.h +++ b/libpgmodeler_ui/src/connectionsconfigwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 2f1cb106a9..439792668f 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/constraintwidget.h b/libpgmodeler_ui/src/constraintwidget.h index 2efb2da960..bd0994f879 100644 --- a/libpgmodeler_ui/src/constraintwidget.h +++ b/libpgmodeler_ui/src/constraintwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/conversionwidget.cpp b/libpgmodeler_ui/src/conversionwidget.cpp index d5a59700a4..fd7942961a 100644 --- a/libpgmodeler_ui/src/conversionwidget.cpp +++ b/libpgmodeler_ui/src/conversionwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/conversionwidget.h b/libpgmodeler_ui/src/conversionwidget.h index 622947d7b3..1366b479be 100644 --- a/libpgmodeler_ui/src/conversionwidget.h +++ b/libpgmodeler_ui/src/conversionwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/csvloadwidget.cpp b/libpgmodeler_ui/src/csvloadwidget.cpp index 6aa8334d03..c8e7ed13b7 100644 --- a/libpgmodeler_ui/src/csvloadwidget.cpp +++ b/libpgmodeler_ui/src/csvloadwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/csvloadwidget.h b/libpgmodeler_ui/src/csvloadwidget.h index 5fe243299a..bdc4b85eb9 100644 --- a/libpgmodeler_ui/src/csvloadwidget.h +++ b/libpgmodeler_ui/src/csvloadwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index 13460bff9d..61bf3b39f9 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/customsqlwidget.h b/libpgmodeler_ui/src/customsqlwidget.h index 0cc69627b7..6e279c7373 100644 --- a/libpgmodeler_ui/src/customsqlwidget.h +++ b/libpgmodeler_ui/src/customsqlwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 201e93a7df..99657ac373 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.h b/libpgmodeler_ui/src/databaseexplorerwidget.h index e5a0f84e3e..d0bbb3e880 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.h +++ b/libpgmodeler_ui/src/databaseexplorerwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 4074525333..11d7e1d21d 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index 35c6df81a5..3ce68bb359 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index febf3675fe..d1fe540311 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index e46211c4b2..8171caa796 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/databasewidget.cpp b/libpgmodeler_ui/src/databasewidget.cpp index e9cddb8798..8759f1d28c 100644 --- a/libpgmodeler_ui/src/databasewidget.cpp +++ b/libpgmodeler_ui/src/databasewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/databasewidget.h b/libpgmodeler_ui/src/databasewidget.h index c44306b4d4..43094bf17e 100644 --- a/libpgmodeler_ui/src/databasewidget.h +++ b/libpgmodeler_ui/src/databasewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 339ba3bc85..be72097075 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 6e1a52879b..3dfc2762ed 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index b1d224208c..248d8dfab6 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/domainwidget.h b/libpgmodeler_ui/src/domainwidget.h index 539476901c..2167e3e98e 100644 --- a/libpgmodeler_ui/src/domainwidget.h +++ b/libpgmodeler_ui/src/domainwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/donatewidget.cpp b/libpgmodeler_ui/src/donatewidget.cpp index fbfa9853a9..bbc2a81dfd 100644 --- a/libpgmodeler_ui/src/donatewidget.cpp +++ b/libpgmodeler_ui/src/donatewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/donatewidget.h b/libpgmodeler_ui/src/donatewidget.h index 764e945378..7376ffd2c0 100644 --- a/libpgmodeler_ui/src/donatewidget.h +++ b/libpgmodeler_ui/src/donatewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/elementstablewidget.cpp b/libpgmodeler_ui/src/elementstablewidget.cpp index fec169792d..060b855113 100644 --- a/libpgmodeler_ui/src/elementstablewidget.cpp +++ b/libpgmodeler_ui/src/elementstablewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/elementstablewidget.h b/libpgmodeler_ui/src/elementstablewidget.h index 946129d882..9ec2e66869 100644 --- a/libpgmodeler_ui/src/elementstablewidget.h +++ b/libpgmodeler_ui/src/elementstablewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index 22eb14d6db..416ad354b6 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/elementwidget.h b/libpgmodeler_ui/src/elementwidget.h index b296217b2f..2e74a4fb74 100644 --- a/libpgmodeler_ui/src/elementwidget.h +++ b/libpgmodeler_ui/src/elementwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index c8eba88533..d646788ba4 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/eventtriggerwidget.h b/libpgmodeler_ui/src/eventtriggerwidget.h index b9a18de392..09094a4284 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.h +++ b/libpgmodeler_ui/src/eventtriggerwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/extensionwidget.h b/libpgmodeler_ui/src/extensionwidget.h index f5f6a1f967..1f42fec4ac 100644 --- a/libpgmodeler_ui/src/extensionwidget.h +++ b/libpgmodeler_ui/src/extensionwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/findreplacewidget.cpp b/libpgmodeler_ui/src/findreplacewidget.cpp index b1809845e6..42ebafb815 100644 --- a/libpgmodeler_ui/src/findreplacewidget.cpp +++ b/libpgmodeler_ui/src/findreplacewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/findreplacewidget.h b/libpgmodeler_ui/src/findreplacewidget.h index d3aef0d7bb..9571e98833 100644 --- a/libpgmodeler_ui/src/findreplacewidget.h +++ b/libpgmodeler_ui/src/findreplacewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index 462acacc00..783afda322 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/functionwidget.h b/libpgmodeler_ui/src/functionwidget.h index 2ad2a166e0..1600acd1af 100644 --- a/libpgmodeler_ui/src/functionwidget.h +++ b/libpgmodeler_ui/src/functionwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index bcf53e0ef5..d915248bd9 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index eb67299f66..5f28c402a7 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 1abfd9b32b..99cc38651d 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/genericsqlwidget.h b/libpgmodeler_ui/src/genericsqlwidget.h index 8d3929ad55..4cbe5f2067 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.h +++ b/libpgmodeler_ui/src/genericsqlwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/hinttextwidget.cpp b/libpgmodeler_ui/src/hinttextwidget.cpp index ade25a1f59..c41f5b95ef 100644 --- a/libpgmodeler_ui/src/hinttextwidget.cpp +++ b/libpgmodeler_ui/src/hinttextwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/hinttextwidget.h b/libpgmodeler_ui/src/hinttextwidget.h index 75306602da..bc5c345391 100644 --- a/libpgmodeler_ui/src/hinttextwidget.h +++ b/libpgmodeler_ui/src/hinttextwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/htmlitemdelegate.cpp b/libpgmodeler_ui/src/htmlitemdelegate.cpp index 1a196bec24..f30a5bec25 100644 --- a/libpgmodeler_ui/src/htmlitemdelegate.cpp +++ b/libpgmodeler_ui/src/htmlitemdelegate.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/htmlitemdelegate.h b/libpgmodeler_ui/src/htmlitemdelegate.h index 2f1b42ec4e..8bf17eeb0e 100644 --- a/libpgmodeler_ui/src/htmlitemdelegate.h +++ b/libpgmodeler_ui/src/htmlitemdelegate.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index 16e74603b8..ca16f7d940 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/indexwidget.h b/libpgmodeler_ui/src/indexwidget.h index 1841c7c4d3..ec2edfc063 100644 --- a/libpgmodeler_ui/src/indexwidget.h +++ b/libpgmodeler_ui/src/indexwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/languagewidget.cpp b/libpgmodeler_ui/src/languagewidget.cpp index 2388f8cdb6..211a6a3a88 100644 --- a/libpgmodeler_ui/src/languagewidget.cpp +++ b/libpgmodeler_ui/src/languagewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/languagewidget.h b/libpgmodeler_ui/src/languagewidget.h index 767c0a5dbe..3d915076c9 100644 --- a/libpgmodeler_ui/src/languagewidget.h +++ b/libpgmodeler_ui/src/languagewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/layerswidget.cpp b/libpgmodeler_ui/src/layerswidget.cpp index a599c6bb08..800814f738 100644 --- a/libpgmodeler_ui/src/layerswidget.cpp +++ b/libpgmodeler_ui/src/layerswidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/layerswidget.h b/libpgmodeler_ui/src/layerswidget.h index 47e7683f8f..7e461c5e0a 100644 --- a/libpgmodeler_ui/src/layerswidget.h +++ b/libpgmodeler_ui/src/layerswidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/linenumberswidget.cpp b/libpgmodeler_ui/src/linenumberswidget.cpp index 0006827a0c..10fe35be3c 100644 --- a/libpgmodeler_ui/src/linenumberswidget.cpp +++ b/libpgmodeler_ui/src/linenumberswidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/linenumberswidget.h b/libpgmodeler_ui/src/linenumberswidget.h index 420f63b2c6..8df8932b9c 100644 --- a/libpgmodeler_ui/src/linenumberswidget.h +++ b/libpgmodeler_ui/src/linenumberswidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 93e00d98b4..deeae60163 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index b3f86b6fd4..19dbabedf4 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/messagebox.cpp b/libpgmodeler_ui/src/messagebox.cpp index b6aef37062..aaa75826cd 100644 --- a/libpgmodeler_ui/src/messagebox.cpp +++ b/libpgmodeler_ui/src/messagebox.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/messagebox.h b/libpgmodeler_ui/src/messagebox.h index d60767a571..4226304fec 100644 --- a/libpgmodeler_ui/src/messagebox.h +++ b/libpgmodeler_ui/src/messagebox.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 9caebdaa4c..788b154689 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/metadatahandlingform.h b/libpgmodeler_ui/src/metadatahandlingform.h index 544e2a58b6..ccaa2187f8 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.h +++ b/libpgmodeler_ui/src/metadatahandlingform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index b629e5c98d..49cbc8895d 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index 32e8d8d999..aea6320be3 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index 0ea365c6f1..e427aa3b7e 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelexportform.h b/libpgmodeler_ui/src/modelexportform.h index a4df2e8644..951a8e988f 100644 --- a/libpgmodeler_ui/src/modelexportform.h +++ b/libpgmodeler_ui/src/modelexportform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelexporthelper.h b/libpgmodeler_ui/src/modelexporthelper.h index 126391a661..1031a6fade 100644 --- a/libpgmodeler_ui/src/modelexporthelper.h +++ b/libpgmodeler_ui/src/modelexporthelper.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelfixform.cpp b/libpgmodeler_ui/src/modelfixform.cpp index 4b5c174431..5934145e6b 100644 --- a/libpgmodeler_ui/src/modelfixform.cpp +++ b/libpgmodeler_ui/src/modelfixform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelfixform.h b/libpgmodeler_ui/src/modelfixform.h index 37b1614d7d..05e156cde8 100644 --- a/libpgmodeler_ui/src/modelfixform.h +++ b/libpgmodeler_ui/src/modelfixform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelnavigationwidget.cpp b/libpgmodeler_ui/src/modelnavigationwidget.cpp index 7dd94f1403..49edffd2b2 100644 --- a/libpgmodeler_ui/src/modelnavigationwidget.cpp +++ b/libpgmodeler_ui/src/modelnavigationwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelnavigationwidget.h b/libpgmodeler_ui/src/modelnavigationwidget.h index b89aaa061b..37950de4cf 100644 --- a/libpgmodeler_ui/src/modelnavigationwidget.h +++ b/libpgmodeler_ui/src/modelnavigationwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 8defecda4e..38e9ced79b 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelobjectswidget.h b/libpgmodeler_ui/src/modelobjectswidget.h index 0c647e3d6f..21f2b5cc7a 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.h +++ b/libpgmodeler_ui/src/modelobjectswidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modeloverviewwidget.cpp b/libpgmodeler_ui/src/modeloverviewwidget.cpp index 04ccd326ac..46ff297197 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.cpp +++ b/libpgmodeler_ui/src/modeloverviewwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modeloverviewwidget.h b/libpgmodeler_ui/src/modeloverviewwidget.h index 1c32853560..5861f17b3d 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.h +++ b/libpgmodeler_ui/src/modeloverviewwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelrestorationform.cpp b/libpgmodeler_ui/src/modelrestorationform.cpp index 7c0dacabf0..8ca6c0cb6d 100644 --- a/libpgmodeler_ui/src/modelrestorationform.cpp +++ b/libpgmodeler_ui/src/modelrestorationform.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelrestorationform.h b/libpgmodeler_ui/src/modelrestorationform.h index 088e647784..eec67d3c0c 100644 --- a/libpgmodeler_ui/src/modelrestorationform.h +++ b/libpgmodeler_ui/src/modelrestorationform.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 6e40c94042..74b82a45a7 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelsdiffhelper.h b/libpgmodeler_ui/src/modelsdiffhelper.h index d0c61d8330..6130f3acef 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.h +++ b/libpgmodeler_ui/src/modelsdiffhelper.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index 94a1bbc229..08e78203af 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelvalidationhelper.h b/libpgmodeler_ui/src/modelvalidationhelper.h index d8cd5d6483..58bcb66479 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.h +++ b/libpgmodeler_ui/src/modelvalidationhelper.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 6633b09ec8..2b9810d1f6 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelvalidationwidget.h b/libpgmodeler_ui/src/modelvalidationwidget.h index f8c88d597f..d9a8197136 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.h +++ b/libpgmodeler_ui/src/modelvalidationwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 20e56a7dd6..6933544da6 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index bf59932a9d..3bc8a99558 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index ad0b6b38b8..ee47561655 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.h b/libpgmodeler_ui/src/newobjectoverlaywidget.h index eeec324a6c..20d113657c 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.h +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/numberedtexteditor.cpp b/libpgmodeler_ui/src/numberedtexteditor.cpp index 0364819a16..87fe6dd3c9 100644 --- a/libpgmodeler_ui/src/numberedtexteditor.cpp +++ b/libpgmodeler_ui/src/numberedtexteditor.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/numberedtexteditor.h b/libpgmodeler_ui/src/numberedtexteditor.h index bb85442bc2..125cd5dbe7 100644 --- a/libpgmodeler_ui/src/numberedtexteditor.h +++ b/libpgmodeler_ui/src/numberedtexteditor.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index 0c375b7547..81ad97db5f 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.h b/libpgmodeler_ui/src/objectdepsrefswidget.h index 82e3e0f55e..cb0b2dfb57 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.h +++ b/libpgmodeler_ui/src/objectdepsrefswidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index b16a63198a..a820dea1a5 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectfinderwidget.h b/libpgmodeler_ui/src/objectfinderwidget.h index c0d6154df6..1d8fe5e276 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.h +++ b/libpgmodeler_ui/src/objectfinderwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectrenamewidget.cpp b/libpgmodeler_ui/src/objectrenamewidget.cpp index 821bb2ef78..28856e7a64 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.cpp +++ b/libpgmodeler_ui/src/objectrenamewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectrenamewidget.h b/libpgmodeler_ui/src/objectrenamewidget.h index 5de5aa33bd..778b4a760a 100644 --- a/libpgmodeler_ui/src/objectrenamewidget.h +++ b/libpgmodeler_ui/src/objectrenamewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectsdiffinfo.cpp b/libpgmodeler_ui/src/objectsdiffinfo.cpp index 5dfaccf2e7..feebee3b90 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.cpp +++ b/libpgmodeler_ui/src/objectsdiffinfo.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectsdiffinfo.h b/libpgmodeler_ui/src/objectsdiffinfo.h index bbc9e5356a..49177263d4 100644 --- a/libpgmodeler_ui/src/objectsdiffinfo.h +++ b/libpgmodeler_ui/src/objectsdiffinfo.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectselectorwidget.cpp b/libpgmodeler_ui/src/objectselectorwidget.cpp index c6494d181f..06ba308a86 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.cpp +++ b/libpgmodeler_ui/src/objectselectorwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectselectorwidget.h b/libpgmodeler_ui/src/objectselectorwidget.h index 2834c592eb..e4a99eb69e 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.h +++ b/libpgmodeler_ui/src/objectselectorwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 6c4e45bb0b..99f486cbac 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/objectstablewidget.h b/libpgmodeler_ui/src/objectstablewidget.h index 8bc4bc56b1..4dea990fee 100644 --- a/libpgmodeler_ui/src/objectstablewidget.h +++ b/libpgmodeler_ui/src/objectstablewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index cfed8d40f5..fd8672bcd2 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/operationlistwidget.h b/libpgmodeler_ui/src/operationlistwidget.h index 1577571e35..58c40806b1 100644 --- a/libpgmodeler_ui/src/operationlistwidget.h +++ b/libpgmodeler_ui/src/operationlistwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 511829dd45..46f0dd16b1 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/operatorclasswidget.h b/libpgmodeler_ui/src/operatorclasswidget.h index 059414d672..03ac0f708b 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.h +++ b/libpgmodeler_ui/src/operatorclasswidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index 689ada4ce3..cbc3bc539d 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/operatorfamilywidget.h b/libpgmodeler_ui/src/operatorfamilywidget.h index 11fba3c3a6..48434bc79d 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.h +++ b/libpgmodeler_ui/src/operatorfamilywidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/operatorwidget.cpp b/libpgmodeler_ui/src/operatorwidget.cpp index 9f7f6a5b96..a1d17ed10c 100644 --- a/libpgmodeler_ui/src/operatorwidget.cpp +++ b/libpgmodeler_ui/src/operatorwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/operatorwidget.h b/libpgmodeler_ui/src/operatorwidget.h index e58493f610..f31cb4ce80 100644 --- a/libpgmodeler_ui/src/operatorwidget.h +++ b/libpgmodeler_ui/src/operatorwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/parameterwidget.cpp b/libpgmodeler_ui/src/parameterwidget.cpp index 5f8c0a3510..472cb97904 100644 --- a/libpgmodeler_ui/src/parameterwidget.cpp +++ b/libpgmodeler_ui/src/parameterwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/parameterwidget.h b/libpgmodeler_ui/src/parameterwidget.h index 42fab1d55f..cb07bfd0e6 100644 --- a/libpgmodeler_ui/src/parameterwidget.h +++ b/libpgmodeler_ui/src/parameterwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index b9acdccd99..02ae55b3ce 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/permissionwidget.h b/libpgmodeler_ui/src/permissionwidget.h index 6901629e72..034da53bff 100644 --- a/libpgmodeler_ui/src/permissionwidget.h +++ b/libpgmodeler_ui/src/permissionwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/pgmodelerplugin.cpp b/libpgmodeler_ui/src/pgmodelerplugin.cpp index 8bc3eefadf..ec413741a4 100644 --- a/libpgmodeler_ui/src/pgmodelerplugin.cpp +++ b/libpgmodeler_ui/src/pgmodelerplugin.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/pgmodelerplugin.h b/libpgmodeler_ui/src/pgmodelerplugin.h index 0467cc71f7..c6e68c119d 100644 --- a/libpgmodeler_ui/src/pgmodelerplugin.h +++ b/libpgmodeler_ui/src/pgmodelerplugin.h @@ -1,7 +1,7 @@ /* # Projeto: Modelador de Banco de Dados PostgreSQL (pgsqlDBM) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/pgmodeleruins.h b/libpgmodeler_ui/src/pgmodeleruins.h index 066011a9e5..9ac3c839eb 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.h +++ b/libpgmodeler_ui/src/pgmodeleruins.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/pgsqltypewidget.cpp b/libpgmodeler_ui/src/pgsqltypewidget.cpp index a64e1b4e45..ac3d73b1de 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.cpp +++ b/libpgmodeler_ui/src/pgsqltypewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/pgsqltypewidget.h b/libpgmodeler_ui/src/pgsqltypewidget.h index fe07264c4f..57ce845d5d 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.h +++ b/libpgmodeler_ui/src/pgsqltypewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/plaintextitemdelegate.cpp b/libpgmodeler_ui/src/plaintextitemdelegate.cpp index 63376a8265..2d98f44c92 100644 --- a/libpgmodeler_ui/src/plaintextitemdelegate.cpp +++ b/libpgmodeler_ui/src/plaintextitemdelegate.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/plaintextitemdelegate.h b/libpgmodeler_ui/src/plaintextitemdelegate.h index ddb50f7a9a..fa23a5f98c 100644 --- a/libpgmodeler_ui/src/plaintextitemdelegate.h +++ b/libpgmodeler_ui/src/plaintextitemdelegate.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.cpp b/libpgmodeler_ui/src/pluginsconfigwidget.cpp index 43e6477c42..70da88570f 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.cpp +++ b/libpgmodeler_ui/src/pluginsconfigwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.h b/libpgmodeler_ui/src/pluginsconfigwidget.h index 47982b2752..132bfa451d 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.h +++ b/libpgmodeler_ui/src/pluginsconfigwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index 45a44a077d..eaee54702c 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/policywidget.h b/libpgmodeler_ui/src/policywidget.h index b007a7476b..3502ce5267 100644 --- a/libpgmodeler_ui/src/policywidget.h +++ b/libpgmodeler_ui/src/policywidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 6a2c18318a..7d6d4347a6 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/referencewidget.h b/libpgmodeler_ui/src/referencewidget.h index f3f89e68f4..2209fc6821 100644 --- a/libpgmodeler_ui/src/referencewidget.h +++ b/libpgmodeler_ui/src/referencewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 3d3d7e8e21..81294df1c5 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.h b/libpgmodeler_ui/src/relationshipconfigwidget.h index 9a87ba50bb..dfa8b86f16 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.h +++ b/libpgmodeler_ui/src/relationshipconfigwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index 1138039281..a609bb6e7c 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/relationshipwidget.h b/libpgmodeler_ui/src/relationshipwidget.h index cb49120bc2..bf24ffe2ce 100644 --- a/libpgmodeler_ui/src/relationshipwidget.h +++ b/libpgmodeler_ui/src/relationshipwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index 46a7da444a..c68d285d73 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/resultsetmodel.h b/libpgmodeler_ui/src/resultsetmodel.h index 770d50e352..6d97c64e4b 100644 --- a/libpgmodeler_ui/src/resultsetmodel.h +++ b/libpgmodeler_ui/src/resultsetmodel.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index c2a8bb9cb0..d256e203f7 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/rolewidget.h b/libpgmodeler_ui/src/rolewidget.h index 07b73159aa..4bc09e082c 100644 --- a/libpgmodeler_ui/src/rolewidget.h +++ b/libpgmodeler_ui/src/rolewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index 7c1442d570..d2a4709358 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/rulewidget.h b/libpgmodeler_ui/src/rulewidget.h index de46dbc0cc..934da3a086 100644 --- a/libpgmodeler_ui/src/rulewidget.h +++ b/libpgmodeler_ui/src/rulewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sceneinfowidget.cpp b/libpgmodeler_ui/src/sceneinfowidget.cpp index 6283b62153..77b46d7984 100644 --- a/libpgmodeler_ui/src/sceneinfowidget.cpp +++ b/libpgmodeler_ui/src/sceneinfowidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sceneinfowidget.h b/libpgmodeler_ui/src/sceneinfowidget.h index 09672ea355..8350e28d76 100644 --- a/libpgmodeler_ui/src/sceneinfowidget.h +++ b/libpgmodeler_ui/src/sceneinfowidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/schemawidget.cpp b/libpgmodeler_ui/src/schemawidget.cpp index ee4576ac9d..74f4e36bed 100644 --- a/libpgmodeler_ui/src/schemawidget.cpp +++ b/libpgmodeler_ui/src/schemawidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/schemawidget.h b/libpgmodeler_ui/src/schemawidget.h index 827599ae08..4396bf6ede 100644 --- a/libpgmodeler_ui/src/schemawidget.h +++ b/libpgmodeler_ui/src/schemawidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sequencewidget.cpp b/libpgmodeler_ui/src/sequencewidget.cpp index a294e419b3..18987f4157 100644 --- a/libpgmodeler_ui/src/sequencewidget.cpp +++ b/libpgmodeler_ui/src/sequencewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sequencewidget.h b/libpgmodeler_ui/src/sequencewidget.h index cf78563a57..d7a12aada8 100644 --- a/libpgmodeler_ui/src/sequencewidget.h +++ b/libpgmodeler_ui/src/sequencewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index 778f4c718f..b6c0772838 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.h b/libpgmodeler_ui/src/snippetsconfigwidget.h index f7606b6ff5..5e9099e935 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.h +++ b/libpgmodeler_ui/src/snippetsconfigwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index 314c23b577..fece249fd0 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sourcecodewidget.h b/libpgmodeler_ui/src/sourcecodewidget.h index 9c638c21e4..b9d285ff40 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.h +++ b/libpgmodeler_ui/src/sourcecodewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.cpp b/libpgmodeler_ui/src/sqlexecutionhelper.cpp index 8a3221624c..7bf20ac842 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.cpp +++ b/libpgmodeler_ui/src/sqlexecutionhelper.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sqlexecutionhelper.h b/libpgmodeler_ui/src/sqlexecutionhelper.h index d2ac5cf041..a9d4b8d698 100644 --- a/libpgmodeler_ui/src/sqlexecutionhelper.h +++ b/libpgmodeler_ui/src/sqlexecutionhelper.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 3def5deb42..f352692849 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index 3a2aadc45c..b55d134118 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 4328a8d1cf..6dc1fda46d 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/sqltoolwidget.h b/libpgmodeler_ui/src/sqltoolwidget.h index 551f2a68f8..e989b1fb2c 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.h +++ b/libpgmodeler_ui/src/sqltoolwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.h b/libpgmodeler_ui/src/swapobjectsidswidget.h index e42712657b..db04d67c68 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.h +++ b/libpgmodeler_ui/src/swapobjectsidswidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 983921b065..997a98d35a 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/syntaxhighlighter.h b/libpgmodeler_ui/src/syntaxhighlighter.h index c2badb46d5..08f6c21f83 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.h +++ b/libpgmodeler_ui/src/syntaxhighlighter.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 78583a6728..58058a3fa8 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/tabledatawidget.h b/libpgmodeler_ui/src/tabledatawidget.h index 44df3a492e..fe723d35d8 100644 --- a/libpgmodeler_ui/src/tabledatawidget.h +++ b/libpgmodeler_ui/src/tabledatawidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/tablespacewidget.cpp b/libpgmodeler_ui/src/tablespacewidget.cpp index bced93e943..52a0f23543 100644 --- a/libpgmodeler_ui/src/tablespacewidget.cpp +++ b/libpgmodeler_ui/src/tablespacewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/tablespacewidget.h b/libpgmodeler_ui/src/tablespacewidget.h index 4baee8a910..0798f1e34f 100644 --- a/libpgmodeler_ui/src/tablespacewidget.h +++ b/libpgmodeler_ui/src/tablespacewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 2fa7e86e8a..0411cfb30c 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/tablewidget.h b/libpgmodeler_ui/src/tablewidget.h index 2eaa4b7e91..53c2174c45 100644 --- a/libpgmodeler_ui/src/tablewidget.h +++ b/libpgmodeler_ui/src/tablewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/tagwidget.cpp b/libpgmodeler_ui/src/tagwidget.cpp index 47bd04f789..51709721b0 100644 --- a/libpgmodeler_ui/src/tagwidget.cpp +++ b/libpgmodeler_ui/src/tagwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/tagwidget.h b/libpgmodeler_ui/src/tagwidget.h index ec2c5c23f3..738cb2d6be 100644 --- a/libpgmodeler_ui/src/tagwidget.h +++ b/libpgmodeler_ui/src/tagwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/taskprogresswidget.cpp b/libpgmodeler_ui/src/taskprogresswidget.cpp index 5b16dbe4ce..7afd95da79 100644 --- a/libpgmodeler_ui/src/taskprogresswidget.cpp +++ b/libpgmodeler_ui/src/taskprogresswidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/taskprogresswidget.h b/libpgmodeler_ui/src/taskprogresswidget.h index 7b9a08294c..84a87cf2c1 100644 --- a/libpgmodeler_ui/src/taskprogresswidget.h +++ b/libpgmodeler_ui/src/taskprogresswidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/textboxwidget.cpp b/libpgmodeler_ui/src/textboxwidget.cpp index a88627213f..339c0fe2da 100644 --- a/libpgmodeler_ui/src/textboxwidget.cpp +++ b/libpgmodeler_ui/src/textboxwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/textboxwidget.h b/libpgmodeler_ui/src/textboxwidget.h index 1f02cb3ba2..bc8c450f07 100644 --- a/libpgmodeler_ui/src/textboxwidget.h +++ b/libpgmodeler_ui/src/textboxwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index 24aaf11aea..bd17e5ce84 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/triggerwidget.h b/libpgmodeler_ui/src/triggerwidget.h index ca3c4ca47c..7fd1184458 100644 --- a/libpgmodeler_ui/src/triggerwidget.h +++ b/libpgmodeler_ui/src/triggerwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index dd2e7d0d0d..8ed18fc51e 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/typewidget.h b/libpgmodeler_ui/src/typewidget.h index 55af88c337..3ae6db0615 100644 --- a/libpgmodeler_ui/src/typewidget.h +++ b/libpgmodeler_ui/src/typewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/updatenotifierwidget.cpp b/libpgmodeler_ui/src/updatenotifierwidget.cpp index 0d38cb707d..b8a47b5430 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.cpp +++ b/libpgmodeler_ui/src/updatenotifierwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/updatenotifierwidget.h b/libpgmodeler_ui/src/updatenotifierwidget.h index c45511a490..701f885ed9 100644 --- a/libpgmodeler_ui/src/updatenotifierwidget.h +++ b/libpgmodeler_ui/src/updatenotifierwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/validationinfo.cpp b/libpgmodeler_ui/src/validationinfo.cpp index dbca650ef4..10eda993ab 100644 --- a/libpgmodeler_ui/src/validationinfo.cpp +++ b/libpgmodeler_ui/src/validationinfo.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/validationinfo.h b/libpgmodeler_ui/src/validationinfo.h index 5240c64514..6428528667 100644 --- a/libpgmodeler_ui/src/validationinfo.h +++ b/libpgmodeler_ui/src/validationinfo.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index eddbe90d35..c11aa07c54 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/viewwidget.h b/libpgmodeler_ui/src/viewwidget.h index 94356c89c5..1640b7415c 100644 --- a/libpgmodeler_ui/src/viewwidget.h +++ b/libpgmodeler_ui/src/viewwidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/welcomewidget.cpp b/libpgmodeler_ui/src/welcomewidget.cpp index c525505e76..cf7dcacc4a 100644 --- a/libpgmodeler_ui/src/welcomewidget.cpp +++ b/libpgmodeler_ui/src/welcomewidget.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libpgmodeler_ui/src/welcomewidget.h b/libpgmodeler_ui/src/welcomewidget.h index 2826996108..9ca1c9745d 100644 --- a/libpgmodeler_ui/src/welcomewidget.h +++ b/libpgmodeler_ui/src/welcomewidget.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 865116673e..ac9c1f2727 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 3aa08239b4..2bc89aeaa1 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index 7895b2e3ec..e51e4b2e50 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libutils/src/globalattributes.h b/libutils/src/globalattributes.h index 2349e4f272..2fb5759b6e 100644 --- a/libutils/src/globalattributes.h +++ b/libutils/src/globalattributes.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libutils/src/pgsqlversions.cpp b/libutils/src/pgsqlversions.cpp index 509c822699..c4d3072af9 100644 --- a/libutils/src/pgsqlversions.cpp +++ b/libutils/src/pgsqlversions.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/libutils/src/pgsqlversions.h b/libutils/src/pgsqlversions.h index 48e5e7264c..31802e0f11 100644 --- a/libutils/src/pgsqlversions.h +++ b/libutils/src/pgsqlversions.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/main-cli/src/main.cpp b/main-cli/src/main.cpp index 73c07ee793..ade7f1e184 100644 --- a/main-cli/src/main.cpp +++ b/main-cli/src/main.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index d07c1027b6..836f1ac9b4 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/main-cli/src/pgmodelercli.h b/main-cli/src/pgmodelercli.h index 338e6a55a5..19f8999127 100644 --- a/main-cli/src/pgmodelercli.h +++ b/main-cli/src/pgmodelercli.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/main/src/application.cpp b/main/src/application.cpp index 8be45ebc5a..ede68f058d 100644 --- a/main/src/application.cpp +++ b/main/src/application.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/main/src/application.h b/main/src/application.h index ae9c530c9e..ee29177470 100644 --- a/main/src/application.h +++ b/main/src/application.h @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/main/src/main.cpp b/main/src/main.cpp index 491ecf3fe8..2b69717d18 100644 --- a/main/src/main.cpp +++ b/main/src/main.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/plugins/dummy/src/dummy.cpp b/plugins/dummy/src/dummy.cpp index bb6177f7bb..01f73cd304 100644 --- a/plugins/dummy/src/dummy.cpp +++ b/plugins/dummy/src/dummy.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/plugins/dummy/src/dummy.h b/plugins/dummy/src/dummy.h index a9f7ed13ec..b0351cf8a5 100644 --- a/plugins/dummy/src/dummy.h +++ b/plugins/dummy/src/dummy.h @@ -1,7 +1,7 @@ /* # Projeto: Modelador de Banco de Dados PostgreSQL (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/plugins/xml2object/src/xml2object.cpp b/plugins/xml2object/src/xml2object.cpp index 31495c1382..22d034010d 100644 --- a/plugins/xml2object/src/xml2object.cpp +++ b/plugins/xml2object/src/xml2object.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/plugins/xml2object/src/xml2object.h b/plugins/xml2object/src/xml2object.h index 005d7d660a..18bc64963d 100644 --- a/plugins/xml2object/src/xml2object.h +++ b/plugins/xml2object/src/xml2object.h @@ -1,7 +1,7 @@ /* # Projeto: Modelador de Banco de Dados PostgreSQL (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/src/baseobjecttest/baseobjecttest.cpp b/tests/src/baseobjecttest/baseobjecttest.cpp index 374d7b0414..b6d0a9aef4 100644 --- a/tests/src/baseobjecttest/baseobjecttest.cpp +++ b/tests/src/baseobjecttest/baseobjecttest.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/src/databasemodeltest/databasemodeltest.cpp b/tests/src/databasemodeltest/databasemodeltest.cpp index 79a283c752..a4dccd55e2 100644 --- a/tests/src/databasemodeltest/databasemodeltest.cpp +++ b/tests/src/databasemodeltest/databasemodeltest.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/src/linenumberstest/linenumberstest.cpp b/tests/src/linenumberstest/linenumberstest.cpp index 8fe9823259..5b0b0d027b 100644 --- a/tests/src/linenumberstest/linenumberstest.cpp +++ b/tests/src/linenumberstest/linenumberstest.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/src/main/main.cpp b/tests/src/main/main.cpp index 65e12c4912..ca8d4f94b1 100644 --- a/tests/src/main/main.cpp +++ b/tests/src/main/main.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/src/partrelationshiptest/partrelationshiptest.cpp b/tests/src/partrelationshiptest/partrelationshiptest.cpp index f9f7f4a687..736bc82af7 100644 --- a/tests/src/partrelationshiptest/partrelationshiptest.cpp +++ b/tests/src/partrelationshiptest/partrelationshiptest.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/src/roletest/roletest.cpp b/tests/src/roletest/roletest.cpp index c381495b82..554922c30c 100644 --- a/tests/src/roletest/roletest.cpp +++ b/tests/src/roletest/roletest.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/src/schemaparsertest/schemaparsertest.cpp b/tests/src/schemaparsertest/schemaparsertest.cpp index e040acdf82..945ad689b0 100644 --- a/tests/src/schemaparsertest/schemaparsertest.cpp +++ b/tests/src/schemaparsertest/schemaparsertest.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/src/syntaxhighlightertest/syntaxhighlightertest.cpp b/tests/src/syntaxhighlightertest/syntaxhighlightertest.cpp index d49ec3b726..b816022cc1 100644 --- a/tests/src/syntaxhighlightertest/syntaxhighlightertest.cpp +++ b/tests/src/syntaxhighlightertest/syntaxhighlightertest.cpp @@ -1,7 +1,7 @@ /* # PostgreSQL Database Modeler (pgModeler) # -# Copyright 2006-2018 - Raphael Araújo e Silva +# Copyright 2006-2019 - Raphael Araújo e Silva # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by From 05398cd79d775975095b04b26370449f901bea05 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 27 Feb 2019 15:37:43 -0300 Subject: [PATCH 275/425] Fixed a bug that was causing syntax error if the last column of a table had the SQL code disabled --- libpgmodeler/src/table.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index f76bfad70a..15104b2186 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -244,9 +244,19 @@ void Table::setColumnsAttribute(unsigned def_type, bool incl_rel_added_cols) { if(!str_cols.isEmpty()) { - count=str_cols.size(); - if(str_cols[count-2]==',' || str_cols[count-2]=='\n') - str_cols.remove(count-2,2); + count = str_cols.size(); + + // Removing the last comma from the columns SQL + if(str_cols[count-2] == ',' || str_cols[count-2] == '\n') + str_cols.remove(count - 2, 2); + + /* Special case: if we have the last column's SQL disabled we need to remove + * the comma from the last line (the enabled one) in order to avoid syntax error */ + int disabled_col_idx = str_cols.lastIndexOf(QString("-- ")), + last_comma_idx = str_cols.lastIndexOf(',', disabled_col_idx); + + if(last_comma_idx >= 0 && last_comma_idx < disabled_col_idx) + str_cols.remove(last_comma_idx, 1); } attributes[Attributes::InhColumns]=inh_cols; From 0366c8fb271b037d56b2b78064d4a15db168b9b2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 28 Feb 2019 17:13:55 -0300 Subject: [PATCH 276/425] Start to add support to results filtering in SQLExecutionWidget --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 78 ++++++++- libpgmodeler_ui/src/sqlexecutionwidget.h | 4 +- libpgmodeler_ui/ui/findreplacewidget.ui | 14 +- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 190 ++++++++++++++++++++- 4 files changed, 272 insertions(+), 14 deletions(-) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index f352692849..6827d9b07a 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -94,6 +94,24 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) file_menu.addAction(action_save_as); file_tb->setMenu(&file_menu); + filter_wgt->setVisible(false); + + connect(columns_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(filterResults())); + connect(filter_edt, SIGNAL(textChanged(QString)), this, SLOT(filterResults())); + connect(filter_tb, SIGNAL(toggled(bool)), filter_wgt, SLOT(setVisible(bool))); + connect(hide_tb, SIGNAL(clicked(bool)), filter_tb, SLOT(click())); + + connect(exact_chk, SIGNAL(toggled(bool)), this, SLOT(filterResults())); + connect(exact_chk, &QCheckBox::toggled, [&](bool checked){ + regexp_chk->setChecked(false); + regexp_chk->setEnabled(!checked); + case_sensitive_chk->setChecked(false); + case_sensitive_chk->setEnabled(!checked); + }); + + connect(regexp_chk, SIGNAL(toggled(bool)), this, SLOT(filterResults())); + connect(case_sensitive_chk, SIGNAL(toggled(bool)), this, SLOT(filterResults())); + connect(action_load, SIGNAL(triggered(bool)), this, SLOT(loadCommands())); connect(action_save, SIGNAL(triggered(bool)), this, SLOT(saveCommands())); connect(action_save_as, SIGNAL(triggered(bool)), this, SLOT(saveCommands())); @@ -200,11 +218,6 @@ void SQLExecutionWidget::enableCommandButtons(void) clear_btn->setEnabled(run_sql_tb->isEnabled()); } -void SQLExecutionWidget::fillResultsTable(void) -{ - -} - void SQLExecutionWidget::showEvent(QShowEvent *) { sql_cmd_txt->setFocus(); @@ -228,6 +241,7 @@ void SQLExecutionWidget::resizeEvent(QResizeEvent *event) export_tb->setToolButtonStyle(style); output_tb->setToolButtonStyle(style); stop_tb->setToolButtonStyle(style); + filter_tb->setToolButtonStyle(style); } } @@ -353,6 +367,8 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) msgoutput_lst->setVisible(true); results_parent->setVisible(false); export_tb->setEnabled(false); + filter_tb->setEnabled(false); + filter_tb->setChecked(false); output_tbw->setTabText(0, trUtf8("Results")); output_tbw->setTabText(1, trUtf8("Messages (%1)").arg(msgoutput_lst->count())); @@ -374,12 +390,26 @@ void SQLExecutionWidget::finishExecution(int rows_affected) results_tbw->setSortingEnabled(false); results_tbw->blockSignals(true); results_tbw->setUpdatesEnabled(false); + destroyResultModel(); + results_tbw->setModel(res_model); results_tbw->resizeColumnsToContents(); results_tbw->setUpdatesEnabled(true); results_tbw->blockSignals(false); + filter_edt->blockSignals(true); + filter_edt->clear(); + filter_edt->blockSignals(false); + + columns_cmb->blockSignals(true); + columns_cmb->clear(); + + for(int col = 0; col < res_model->columnCount(QModelIndex()); col++) + columns_cmb->addItem(res_model->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString()); + + columns_cmb->blockSignals(false); + end_exec=QDateTime::currentDateTime().toMSecsSinceEpoch(); total_exec = end_exec - start_exec; @@ -389,6 +419,7 @@ void SQLExecutionWidget::finishExecution(int rows_affected) output_tbw->setTabEnabled(0, !empty); results_parent->setVisible(!empty); export_tb->setEnabled(!empty); + filter_tb->setEnabled(!empty); if(!empty) { @@ -425,6 +456,43 @@ void SQLExecutionWidget::finishExecution(int rows_affected) sql_exec_thread.quit(); } +void SQLExecutionWidget::filterResults(void) +{ + QModelIndexList list; + Qt::MatchFlags flags = Qt::MatchStartsWith; + int rows_cnt = results_tbw->model()->rowCount(); + + if(exact_chk->isChecked()) + flags = Qt::MatchExactly; + else + { + if(regexp_chk->isChecked()) + flags |= Qt::MatchRegExp; + + if(case_sensitive_chk->isChecked()) + flags |= Qt::MatchCaseSensitive; + } + + list = results_tbw->model()->match(results_tbw->model()->index(0, columns_cmb->currentIndex()), + Qt::DisplayRole, filter_edt->text(), -1, flags); + + results_tbw->model()->blockSignals(true); + results_tbw->blockSignals(true); + + for(int row = 0; row < rows_cnt; row++) + results_tbw->hideRow(row); + + if(!list.isEmpty()) + { + for(auto &idx : list) + results_tbw->showRow(idx.row()); + } + + results_tbw->model()->blockSignals(false); + results_tbw->blockSignals(false); + results_tbw->update(); +} + void SQLExecutionWidget::addToSQLHistory(const QString &cmd, unsigned rows, const QString &error) { if(!cmd.isEmpty()) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index b55d134118..0ea1ddb288 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -83,8 +83,6 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { //! \brief Stores the command on the sql command history void addToSQLHistory(const QString &cmd, unsigned rows=0, const QString &error=QString()); - void fillResultsTable(void); - static void validateSQLHistoryLength(const QString &conn_id, const QString &fmt_cmd = QString(), NumberedTextEditor *cmd_history_txt = nullptr); void switchToExecutionMode(bool value); @@ -171,6 +169,8 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { void finishExecution(int rows_affected = 0); + void filterResults(void); + friend class SQLToolWidget; }; diff --git a/libpgmodeler_ui/ui/findreplacewidget.ui b/libpgmodeler_ui/ui/findreplacewidget.ui index d5972e866d..f49e77883b 100644 --- a/libpgmodeler_ui/ui/findreplacewidget.ui +++ b/libpgmodeler_ui/ui/findreplacewidget.ui @@ -7,7 +7,7 @@ 0 0 704 - 64 + 68 @@ -46,7 +46,11 @@ - + + + true + + @@ -215,7 +219,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 8aff7454a7..908aa96c3b 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -438,6 +438,50 @@ + + + + false + + + + 0 + 30 + + + + Filter the retrived results + + + Filter + + + + :/icones/icones/filter.png:/icones/icones/filter.png + + + + 22 + 22 + + + + Alt+X + + + true + + + false + + + Qt::ToolButtonTextBesideIcon + + + true + + + @@ -627,7 +671,7 @@ QTabWidget::South - 1 + 0 false @@ -668,9 +712,9 @@ 0 - 0 + 6 - + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed @@ -688,7 +732,7 @@ true - 25 + 26 25 @@ -698,6 +742,144 @@ + + + + + + Qt::Horizontal + + + + 253 + 20 + + + + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + 0 + 0 + + + + true + + + + + + + + 0 + 0 + + + + Case sensitive + + + + + + + + 0 + 0 + + + + Regular expression + + + + + + + + 0 + 0 + + + + Exact match + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 20 + 20 + + + + + 20 + 20 + + + + Hide this widget + + + ... + + + + :/icones/icones/fechar1.png:/icones/icones/fechar1.png + + + true + + + + + + From b0e2b6c6ffc8c62da37ab1d902fcc61b5063ccef Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 1 Mar 2019 14:48:17 -0300 Subject: [PATCH 277/425] Finished the result set filtering in SQLExecutionWidget --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 18 ++++++++---------- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 6827d9b07a..47b875fe1b 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -98,8 +98,8 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) connect(columns_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(filterResults())); connect(filter_edt, SIGNAL(textChanged(QString)), this, SLOT(filterResults())); - connect(filter_tb, SIGNAL(toggled(bool)), filter_wgt, SLOT(setVisible(bool))); connect(hide_tb, SIGNAL(clicked(bool)), filter_tb, SLOT(click())); + connect(filter_tb, SIGNAL(toggled(bool)), filter_wgt, SLOT(setVisible(bool))); connect(exact_chk, SIGNAL(toggled(bool)), this, SLOT(filterResults())); connect(exact_chk, &QCheckBox::toggled, [&](bool checked){ @@ -464,20 +464,17 @@ void SQLExecutionWidget::filterResults(void) if(exact_chk->isChecked()) flags = Qt::MatchExactly; - else - { - if(regexp_chk->isChecked()) - flags |= Qt::MatchRegExp; + else if(regexp_chk->isChecked()) + flags = Qt::MatchRegExp; - if(case_sensitive_chk->isChecked()) - flags |= Qt::MatchCaseSensitive; - } + if(case_sensitive_chk->isChecked()) + flags |= Qt::MatchCaseSensitive; list = results_tbw->model()->match(results_tbw->model()->index(0, columns_cmb->currentIndex()), Qt::DisplayRole, filter_edt->text(), -1, flags); - results_tbw->model()->blockSignals(true); results_tbw->blockSignals(true); + results_tbw->setUpdatesEnabled(false); for(int row = 0; row < rows_cnt; row++) results_tbw->hideRow(row); @@ -488,8 +485,8 @@ void SQLExecutionWidget::filterResults(void) results_tbw->showRow(idx.row()); } - results_tbw->model()->blockSignals(false); results_tbw->blockSignals(false); + results_tbw->setUpdatesEnabled(true); results_tbw->update(); } @@ -565,6 +562,7 @@ void SQLExecutionWidget::switchToExecutionMode(bool value) sql_cmd_txt->setEnabled(!value); cmd_history_parent->setEnabled(!value); find_history_parent->setEnabled(!value); + filter_tb->setEnabled(!value); if(value) { diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 908aa96c3b..f59b0457c9 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -453,7 +453,7 @@ Filter the retrived results - Filter + F&ilter @@ -466,7 +466,7 @@ - Alt+X + Alt+I true From 5b0744e28d062b8fbae07950b6ba142535694db2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 1 Mar 2019 17:46:10 -0300 Subject: [PATCH 278/425] Enabling quick clear button on several input fields --- libpgmodeler_ui/ui/baseobjectwidget.ui | 6 ++++ libpgmodeler_ui/ui/bugreportform.ui | 6 +++- libpgmodeler_ui/ui/connectionsconfigwidget.ui | 33 +++++++++++++++++-- libpgmodeler_ui/ui/csvloadwidget.ui | 6 +++- libpgmodeler_ui/ui/databasewidget.ui | 6 ++++ libpgmodeler_ui/ui/domainwidget.ui | 14 ++++++-- libpgmodeler_ui/ui/eventtriggerwidget.ui | 6 +++- libpgmodeler_ui/ui/extensionwidget.ui | 6 ++++ libpgmodeler_ui/ui/functionwidget.ui | 6 ++++ libpgmodeler_ui/ui/generalconfigwidget.ui | 9 +++++ libpgmodeler_ui/ui/metadatahandlingform.ui | 9 ++++- libpgmodeler_ui/ui/modeldatabasediffform.ui | 3 ++ libpgmodeler_ui/ui/modelexportform.ui | 6 ++++ libpgmodeler_ui/ui/modelfixform.ui | 18 ++++++++-- libpgmodeler_ui/ui/objectdepsrefswidget.ui | 4 +-- libpgmodeler_ui/ui/objectfinderwidget.ui | 5 ++- libpgmodeler_ui/ui/objectrenamewidget.ui | 3 ++ libpgmodeler_ui/ui/operatorwidget.ui | 2 +- libpgmodeler_ui/ui/parameterwidget.ui | 5 ++- libpgmodeler_ui/ui/referencewidget.ui | 18 ++++++++++ libpgmodeler_ui/ui/relationshipwidget.ui | 3 ++ libpgmodeler_ui/ui/rolewidget.ui | 3 ++ libpgmodeler_ui/ui/sequencewidget.ui | 15 +++++++++ libpgmodeler_ui/ui/snippetsconfigwidget.ui | 6 ++++ libpgmodeler_ui/ui/tablespacewidget.ui | 14 +++++++- libpgmodeler_ui/ui/triggerwidget.ui | 9 +++++ libpgmodeler_ui/ui/typewidget.ui | 21 ++++++++++-- 27 files changed, 220 insertions(+), 22 deletions(-) diff --git a/libpgmodeler_ui/ui/baseobjectwidget.ui b/libpgmodeler_ui/ui/baseobjectwidget.ui index 1d0f66d1a1..de3f7deec7 100644 --- a/libpgmodeler_ui/ui/baseobjectwidget.ui +++ b/libpgmodeler_ui/ui/baseobjectwidget.ui @@ -80,6 +80,9 @@ + + true + @@ -541,6 +544,9 @@ This will disable the code of all child and referrer objects. + + true + diff --git a/libpgmodeler_ui/ui/bugreportform.ui b/libpgmodeler_ui/ui/bugreportform.ui index bbcc725ce2..99f2929e1d 100644 --- a/libpgmodeler_ui/ui/bugreportform.ui +++ b/libpgmodeler_ui/ui/bugreportform.ui @@ -350,7 +350,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/connectionsconfigwidget.ui b/libpgmodeler_ui/ui/connectionsconfigwidget.ui index d1710ec20f..dfa311db35 100644 --- a/libpgmodeler_ui/ui/connectionsconfigwidget.ui +++ b/libpgmodeler_ui/ui/connectionsconfigwidget.ui @@ -7,7 +7,7 @@ 0 0 562 - 442 + 446 @@ -405,6 +405,9 @@ + + true + @@ -450,7 +453,7 @@ - false + true @@ -499,7 +502,7 @@ QLineEdit::Password - false + true @@ -536,6 +539,9 @@ Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. + + true + @@ -597,6 +603,9 @@ + + true + @@ -682,6 +691,9 @@ + + true + @@ -777,6 +789,9 @@ + + true + @@ -842,6 +857,9 @@ + + true + @@ -851,6 +869,9 @@ true + + true + @@ -908,6 +929,9 @@ + + true + @@ -969,6 +993,9 @@ + + true + diff --git a/libpgmodeler_ui/ui/csvloadwidget.ui b/libpgmodeler_ui/ui/csvloadwidget.ui index c32cb6d6b5..d8b9384c5b 100644 --- a/libpgmodeler_ui/ui/csvloadwidget.ui +++ b/libpgmodeler_ui/ui/csvloadwidget.ui @@ -64,7 +64,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/databasewidget.ui b/libpgmodeler_ui/ui/databasewidget.ui index 4bf82b86a7..77097e7df2 100644 --- a/libpgmodeler_ui/ui/databasewidget.ui +++ b/libpgmodeler_ui/ui/databasewidget.ui @@ -78,6 +78,9 @@ 25 + + true + @@ -101,6 +104,9 @@ 25 + + true + diff --git a/libpgmodeler_ui/ui/domainwidget.ui b/libpgmodeler_ui/ui/domainwidget.ui index 4e40619310..36d8adeb4d 100644 --- a/libpgmodeler_ui/ui/domainwidget.ui +++ b/libpgmodeler_ui/ui/domainwidget.ui @@ -7,7 +7,7 @@ 0 0 487 - 132 + 140 @@ -55,7 +55,11 @@ - + + + true + + @@ -93,7 +97,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/eventtriggerwidget.ui b/libpgmodeler_ui/ui/eventtriggerwidget.ui index 7290e2b1b1..402caae30c 100644 --- a/libpgmodeler_ui/ui/eventtriggerwidget.ui +++ b/libpgmodeler_ui/ui/eventtriggerwidget.ui @@ -91,7 +91,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/extensionwidget.ui b/libpgmodeler_ui/ui/extensionwidget.ui index a883670b1e..e310160c04 100644 --- a/libpgmodeler_ui/ui/extensionwidget.ui +++ b/libpgmodeler_ui/ui/extensionwidget.ui @@ -53,6 +53,9 @@ 0 + + true + @@ -82,6 +85,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/functionwidget.ui b/libpgmodeler_ui/ui/functionwidget.ui index bbc468d9c2..6a1e3720dd 100644 --- a/libpgmodeler_ui/ui/functionwidget.ui +++ b/libpgmodeler_ui/ui/functionwidget.ui @@ -544,6 +544,9 @@ 0 + + true + @@ -573,6 +576,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 7644539da2..c20b23fc86 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -1158,6 +1158,9 @@ false + + true + @@ -1165,6 +1168,9 @@ true + + false + @@ -1473,6 +1479,9 @@ false + + true + diff --git a/libpgmodeler_ui/ui/metadatahandlingform.ui b/libpgmodeler_ui/ui/metadatahandlingform.ui index 7f486c5b2d..9423076f5d 100644 --- a/libpgmodeler_ui/ui/metadatahandlingform.ui +++ b/libpgmodeler_ui/ui/metadatahandlingform.ui @@ -990,7 +990,11 @@ - + + + true + + @@ -1208,6 +1212,9 @@ true + + true + diff --git a/libpgmodeler_ui/ui/modeldatabasediffform.ui b/libpgmodeler_ui/ui/modeldatabasediffform.ui index 38c521c64c..092b2f0005 100644 --- a/libpgmodeler_ui/ui/modeldatabasediffform.ui +++ b/libpgmodeler_ui/ui/modeldatabasediffform.ui @@ -650,6 +650,9 @@ false + + true + diff --git a/libpgmodeler_ui/ui/modelexportform.ui b/libpgmodeler_ui/ui/modelexportform.ui index b2d4447626..cf3e35e16d 100644 --- a/libpgmodeler_ui/ui/modelexportform.ui +++ b/libpgmodeler_ui/ui/modelexportform.ui @@ -683,6 +683,9 @@ true + + false + @@ -1026,6 +1029,9 @@ true + + false + diff --git a/libpgmodeler_ui/ui/modelfixform.ui b/libpgmodeler_ui/ui/modelfixform.ui index 7619e432ea..d0c6bab739 100644 --- a/libpgmodeler_ui/ui/modelfixform.ui +++ b/libpgmodeler_ui/ui/modelfixform.ui @@ -252,7 +252,11 @@ p, li { white-space: pre-wrap; } - + + + true + + @@ -472,7 +476,11 @@ p, li { white-space: pre-wrap; } 0 - + + + true + + @@ -571,7 +579,11 @@ p, li { white-space: pre-wrap; } - + + + true + + diff --git a/libpgmodeler_ui/ui/objectdepsrefswidget.ui b/libpgmodeler_ui/ui/objectdepsrefswidget.ui index b9845ed5c9..009eb5398c 100644 --- a/libpgmodeler_ui/ui/objectdepsrefswidget.ui +++ b/libpgmodeler_ui/ui/objectdepsrefswidget.ui @@ -109,7 +109,7 @@ false - 25 + 26 false @@ -262,7 +262,7 @@ false - 25 + 26 false diff --git a/libpgmodeler_ui/ui/objectfinderwidget.ui b/libpgmodeler_ui/ui/objectfinderwidget.ui index 48375a48b1..3380d48e29 100644 --- a/libpgmodeler_ui/ui/objectfinderwidget.ui +++ b/libpgmodeler_ui/ui/objectfinderwidget.ui @@ -68,6 +68,9 @@ 0 + + true + @@ -545,7 +548,7 @@ false - 25 + 26 false diff --git a/libpgmodeler_ui/ui/objectrenamewidget.ui b/libpgmodeler_ui/ui/objectrenamewidget.ui index ac46b9b480..3edf8e18ef 100644 --- a/libpgmodeler_ui/ui/objectrenamewidget.ui +++ b/libpgmodeler_ui/ui/objectrenamewidget.ui @@ -229,6 +229,9 @@ 9 + + true + diff --git a/libpgmodeler_ui/ui/operatorwidget.ui b/libpgmodeler_ui/ui/operatorwidget.ui index 26d7fd8cde..cfa63fb91e 100644 --- a/libpgmodeler_ui/ui/operatorwidget.ui +++ b/libpgmodeler_ui/ui/operatorwidget.ui @@ -7,7 +7,7 @@ 0 0 522 - 192 + 224 diff --git a/libpgmodeler_ui/ui/parameterwidget.ui b/libpgmodeler_ui/ui/parameterwidget.ui index 9e9c1a8442..2ba8605b27 100644 --- a/libpgmodeler_ui/ui/parameterwidget.ui +++ b/libpgmodeler_ui/ui/parameterwidget.ui @@ -50,6 +50,9 @@ 23 + + true + @@ -76,7 +79,7 @@ 83 129 200 - 24 + 30 diff --git a/libpgmodeler_ui/ui/referencewidget.ui b/libpgmodeler_ui/ui/referencewidget.ui index b252ccd749..a20a590261 100644 --- a/libpgmodeler_ui/ui/referencewidget.ui +++ b/libpgmodeler_ui/ui/referencewidget.ui @@ -279,6 +279,9 @@ + + true + @@ -352,6 +355,9 @@ 0 + + true + @@ -378,6 +384,9 @@ 0 + + true + @@ -414,6 +423,9 @@ 0 + + true + @@ -542,6 +554,9 @@ + + true + @@ -619,6 +634,9 @@ + + true + diff --git a/libpgmodeler_ui/ui/relationshipwidget.ui b/libpgmodeler_ui/ui/relationshipwidget.ui index 5e012412d7..fd7fdde52b 100644 --- a/libpgmodeler_ui/ui/relationshipwidget.ui +++ b/libpgmodeler_ui/ui/relationshipwidget.ui @@ -471,6 +471,9 @@ Name of the table generated from many to many relationship + + true + diff --git a/libpgmodeler_ui/ui/rolewidget.ui b/libpgmodeler_ui/ui/rolewidget.ui index 9d746c7376..ec8505d6c8 100644 --- a/libpgmodeler_ui/ui/rolewidget.ui +++ b/libpgmodeler_ui/ui/rolewidget.ui @@ -213,6 +213,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/sequencewidget.ui b/libpgmodeler_ui/ui/sequencewidget.ui index 524accdafd..26819e294c 100644 --- a/libpgmodeler_ui/ui/sequencewidget.ui +++ b/libpgmodeler_ui/ui/sequencewidget.ui @@ -88,6 +88,9 @@ false + + true + @@ -116,6 +119,9 @@ false + + true + @@ -144,6 +150,9 @@ false + + true + @@ -172,6 +181,9 @@ false + + true + @@ -200,6 +212,9 @@ false + + true + diff --git a/libpgmodeler_ui/ui/snippetsconfigwidget.ui b/libpgmodeler_ui/ui/snippetsconfigwidget.ui index 2b9c846ebe..259cf6ddc8 100644 --- a/libpgmodeler_ui/ui/snippetsconfigwidget.ui +++ b/libpgmodeler_ui/ui/snippetsconfigwidget.ui @@ -104,6 +104,9 @@ 0 + + true + @@ -146,6 +149,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/tablespacewidget.ui b/libpgmodeler_ui/ui/tablespacewidget.ui index 0f8b233ad4..13634b0069 100644 --- a/libpgmodeler_ui/ui/tablespacewidget.ui +++ b/libpgmodeler_ui/ui/tablespacewidget.ui @@ -20,7 +20,16 @@ Form - + + 2 + + + 2 + + + 2 + + 2 @@ -58,6 +67,9 @@ false + + true + diff --git a/libpgmodeler_ui/ui/triggerwidget.ui b/libpgmodeler_ui/ui/triggerwidget.ui index 03422827fb..65b67075d7 100644 --- a/libpgmodeler_ui/ui/triggerwidget.ui +++ b/libpgmodeler_ui/ui/triggerwidget.ui @@ -107,6 +107,9 @@ 0 + + true + @@ -664,6 +667,9 @@ 0 + + true + @@ -688,6 +694,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/typewidget.ui b/libpgmodeler_ui/ui/typewidget.ui index fe646d2b61..b6d7b7cacc 100644 --- a/libpgmodeler_ui/ui/typewidget.ui +++ b/libpgmodeler_ui/ui/typewidget.ui @@ -240,6 +240,9 @@ 1 + + true + @@ -250,7 +253,11 @@ - + + + true + + @@ -414,7 +421,11 @@ - + + + true + + @@ -460,7 +471,11 @@ - + + + true + + From fdd33d7dc9f6d9b8d0562ddcb0ae787cc2e6bee0 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 1 Mar 2019 17:46:10 -0300 Subject: [PATCH 279/425] Enabling quick clear button on several input fields --- libpgmodeler_ui/ui/baseobjectwidget.ui | 6 ++++ libpgmodeler_ui/ui/bugreportform.ui | 6 +++- libpgmodeler_ui/ui/connectionsconfigwidget.ui | 33 +++++++++++++++++-- libpgmodeler_ui/ui/csvloadwidget.ui | 6 +++- libpgmodeler_ui/ui/databasewidget.ui | 6 ++++ libpgmodeler_ui/ui/domainwidget.ui | 14 ++++++-- libpgmodeler_ui/ui/eventtriggerwidget.ui | 6 +++- libpgmodeler_ui/ui/extensionwidget.ui | 6 ++++ libpgmodeler_ui/ui/functionwidget.ui | 6 ++++ libpgmodeler_ui/ui/generalconfigwidget.ui | 9 +++++ libpgmodeler_ui/ui/metadatahandlingform.ui | 9 ++++- libpgmodeler_ui/ui/modeldatabasediffform.ui | 3 ++ libpgmodeler_ui/ui/modelexportform.ui | 6 ++++ libpgmodeler_ui/ui/modelfixform.ui | 18 ++++++++-- libpgmodeler_ui/ui/objectdepsrefswidget.ui | 4 +-- libpgmodeler_ui/ui/objectfinderwidget.ui | 5 ++- libpgmodeler_ui/ui/objectrenamewidget.ui | 3 ++ libpgmodeler_ui/ui/operatorwidget.ui | 2 +- libpgmodeler_ui/ui/parameterwidget.ui | 5 ++- libpgmodeler_ui/ui/referencewidget.ui | 18 ++++++++++ libpgmodeler_ui/ui/relationshipwidget.ui | 3 ++ libpgmodeler_ui/ui/rolewidget.ui | 3 ++ libpgmodeler_ui/ui/sequencewidget.ui | 15 +++++++++ libpgmodeler_ui/ui/snippetsconfigwidget.ui | 6 ++++ libpgmodeler_ui/ui/tablespacewidget.ui | 14 +++++++- libpgmodeler_ui/ui/triggerwidget.ui | 9 +++++ libpgmodeler_ui/ui/typewidget.ui | 21 ++++++++++-- 27 files changed, 220 insertions(+), 22 deletions(-) diff --git a/libpgmodeler_ui/ui/baseobjectwidget.ui b/libpgmodeler_ui/ui/baseobjectwidget.ui index 1d0f66d1a1..de3f7deec7 100644 --- a/libpgmodeler_ui/ui/baseobjectwidget.ui +++ b/libpgmodeler_ui/ui/baseobjectwidget.ui @@ -80,6 +80,9 @@ + + true + @@ -541,6 +544,9 @@ This will disable the code of all child and referrer objects. + + true + diff --git a/libpgmodeler_ui/ui/bugreportform.ui b/libpgmodeler_ui/ui/bugreportform.ui index bbcc725ce2..99f2929e1d 100644 --- a/libpgmodeler_ui/ui/bugreportform.ui +++ b/libpgmodeler_ui/ui/bugreportform.ui @@ -350,7 +350,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/connectionsconfigwidget.ui b/libpgmodeler_ui/ui/connectionsconfigwidget.ui index d1710ec20f..dfa311db35 100644 --- a/libpgmodeler_ui/ui/connectionsconfigwidget.ui +++ b/libpgmodeler_ui/ui/connectionsconfigwidget.ui @@ -7,7 +7,7 @@ 0 0 562 - 442 + 446 @@ -405,6 +405,9 @@ + + true + @@ -450,7 +453,7 @@ - false + true @@ -499,7 +502,7 @@ QLineEdit::Password - false + true @@ -536,6 +539,9 @@ Specify additional connection parameters in the form [param]=[value]. These parameters are described in the <strong>libpq</strong> chapter at PostgreSQL docs. + + true + @@ -597,6 +603,9 @@ + + true + @@ -682,6 +691,9 @@ + + true + @@ -777,6 +789,9 @@ + + true + @@ -842,6 +857,9 @@ + + true + @@ -851,6 +869,9 @@ true + + true + @@ -908,6 +929,9 @@ + + true + @@ -969,6 +993,9 @@ + + true + diff --git a/libpgmodeler_ui/ui/csvloadwidget.ui b/libpgmodeler_ui/ui/csvloadwidget.ui index c32cb6d6b5..d8b9384c5b 100644 --- a/libpgmodeler_ui/ui/csvloadwidget.ui +++ b/libpgmodeler_ui/ui/csvloadwidget.ui @@ -64,7 +64,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/databasewidget.ui b/libpgmodeler_ui/ui/databasewidget.ui index 4bf82b86a7..77097e7df2 100644 --- a/libpgmodeler_ui/ui/databasewidget.ui +++ b/libpgmodeler_ui/ui/databasewidget.ui @@ -78,6 +78,9 @@ 25 + + true + @@ -101,6 +104,9 @@ 25 + + true + diff --git a/libpgmodeler_ui/ui/domainwidget.ui b/libpgmodeler_ui/ui/domainwidget.ui index 4e40619310..36d8adeb4d 100644 --- a/libpgmodeler_ui/ui/domainwidget.ui +++ b/libpgmodeler_ui/ui/domainwidget.ui @@ -7,7 +7,7 @@ 0 0 487 - 132 + 140 @@ -55,7 +55,11 @@ - + + + true + + @@ -93,7 +97,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/eventtriggerwidget.ui b/libpgmodeler_ui/ui/eventtriggerwidget.ui index 7290e2b1b1..402caae30c 100644 --- a/libpgmodeler_ui/ui/eventtriggerwidget.ui +++ b/libpgmodeler_ui/ui/eventtriggerwidget.ui @@ -91,7 +91,11 @@ - + + + true + + diff --git a/libpgmodeler_ui/ui/extensionwidget.ui b/libpgmodeler_ui/ui/extensionwidget.ui index a883670b1e..e310160c04 100644 --- a/libpgmodeler_ui/ui/extensionwidget.ui +++ b/libpgmodeler_ui/ui/extensionwidget.ui @@ -53,6 +53,9 @@ 0 + + true + @@ -82,6 +85,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/functionwidget.ui b/libpgmodeler_ui/ui/functionwidget.ui index bbc468d9c2..6a1e3720dd 100644 --- a/libpgmodeler_ui/ui/functionwidget.ui +++ b/libpgmodeler_ui/ui/functionwidget.ui @@ -544,6 +544,9 @@ 0 + + true + @@ -573,6 +576,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 7644539da2..c20b23fc86 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -1158,6 +1158,9 @@ false + + true + @@ -1165,6 +1168,9 @@ true + + false + @@ -1473,6 +1479,9 @@ false + + true + diff --git a/libpgmodeler_ui/ui/metadatahandlingform.ui b/libpgmodeler_ui/ui/metadatahandlingform.ui index 7f486c5b2d..38d7828044 100644 --- a/libpgmodeler_ui/ui/metadatahandlingform.ui +++ b/libpgmodeler_ui/ui/metadatahandlingform.ui @@ -990,7 +990,11 @@ - + + + true + + @@ -1208,6 +1212,9 @@ true + + false + diff --git a/libpgmodeler_ui/ui/modeldatabasediffform.ui b/libpgmodeler_ui/ui/modeldatabasediffform.ui index 38c521c64c..092b2f0005 100644 --- a/libpgmodeler_ui/ui/modeldatabasediffform.ui +++ b/libpgmodeler_ui/ui/modeldatabasediffform.ui @@ -650,6 +650,9 @@ false + + true + diff --git a/libpgmodeler_ui/ui/modelexportform.ui b/libpgmodeler_ui/ui/modelexportform.ui index b2d4447626..cf3e35e16d 100644 --- a/libpgmodeler_ui/ui/modelexportform.ui +++ b/libpgmodeler_ui/ui/modelexportform.ui @@ -683,6 +683,9 @@ true + + false + @@ -1026,6 +1029,9 @@ true + + false + diff --git a/libpgmodeler_ui/ui/modelfixform.ui b/libpgmodeler_ui/ui/modelfixform.ui index 7619e432ea..d0c6bab739 100644 --- a/libpgmodeler_ui/ui/modelfixform.ui +++ b/libpgmodeler_ui/ui/modelfixform.ui @@ -252,7 +252,11 @@ p, li { white-space: pre-wrap; } - + + + true + + @@ -472,7 +476,11 @@ p, li { white-space: pre-wrap; } 0 - + + + true + + @@ -571,7 +579,11 @@ p, li { white-space: pre-wrap; } - + + + true + + diff --git a/libpgmodeler_ui/ui/objectdepsrefswidget.ui b/libpgmodeler_ui/ui/objectdepsrefswidget.ui index b9845ed5c9..009eb5398c 100644 --- a/libpgmodeler_ui/ui/objectdepsrefswidget.ui +++ b/libpgmodeler_ui/ui/objectdepsrefswidget.ui @@ -109,7 +109,7 @@ false - 25 + 26 false @@ -262,7 +262,7 @@ false - 25 + 26 false diff --git a/libpgmodeler_ui/ui/objectfinderwidget.ui b/libpgmodeler_ui/ui/objectfinderwidget.ui index 48375a48b1..3380d48e29 100644 --- a/libpgmodeler_ui/ui/objectfinderwidget.ui +++ b/libpgmodeler_ui/ui/objectfinderwidget.ui @@ -68,6 +68,9 @@ 0 + + true + @@ -545,7 +548,7 @@ false - 25 + 26 false diff --git a/libpgmodeler_ui/ui/objectrenamewidget.ui b/libpgmodeler_ui/ui/objectrenamewidget.ui index ac46b9b480..3edf8e18ef 100644 --- a/libpgmodeler_ui/ui/objectrenamewidget.ui +++ b/libpgmodeler_ui/ui/objectrenamewidget.ui @@ -229,6 +229,9 @@ 9 + + true + diff --git a/libpgmodeler_ui/ui/operatorwidget.ui b/libpgmodeler_ui/ui/operatorwidget.ui index 26d7fd8cde..cfa63fb91e 100644 --- a/libpgmodeler_ui/ui/operatorwidget.ui +++ b/libpgmodeler_ui/ui/operatorwidget.ui @@ -7,7 +7,7 @@ 0 0 522 - 192 + 224 diff --git a/libpgmodeler_ui/ui/parameterwidget.ui b/libpgmodeler_ui/ui/parameterwidget.ui index 9e9c1a8442..2ba8605b27 100644 --- a/libpgmodeler_ui/ui/parameterwidget.ui +++ b/libpgmodeler_ui/ui/parameterwidget.ui @@ -50,6 +50,9 @@ 23 + + true + @@ -76,7 +79,7 @@ 83 129 200 - 24 + 30 diff --git a/libpgmodeler_ui/ui/referencewidget.ui b/libpgmodeler_ui/ui/referencewidget.ui index b252ccd749..a20a590261 100644 --- a/libpgmodeler_ui/ui/referencewidget.ui +++ b/libpgmodeler_ui/ui/referencewidget.ui @@ -279,6 +279,9 @@ + + true + @@ -352,6 +355,9 @@ 0 + + true + @@ -378,6 +384,9 @@ 0 + + true + @@ -414,6 +423,9 @@ 0 + + true + @@ -542,6 +554,9 @@ + + true + @@ -619,6 +634,9 @@ + + true + diff --git a/libpgmodeler_ui/ui/relationshipwidget.ui b/libpgmodeler_ui/ui/relationshipwidget.ui index 5e012412d7..fd7fdde52b 100644 --- a/libpgmodeler_ui/ui/relationshipwidget.ui +++ b/libpgmodeler_ui/ui/relationshipwidget.ui @@ -471,6 +471,9 @@ Name of the table generated from many to many relationship + + true + diff --git a/libpgmodeler_ui/ui/rolewidget.ui b/libpgmodeler_ui/ui/rolewidget.ui index 9d746c7376..ec8505d6c8 100644 --- a/libpgmodeler_ui/ui/rolewidget.ui +++ b/libpgmodeler_ui/ui/rolewidget.ui @@ -213,6 +213,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/sequencewidget.ui b/libpgmodeler_ui/ui/sequencewidget.ui index 524accdafd..26819e294c 100644 --- a/libpgmodeler_ui/ui/sequencewidget.ui +++ b/libpgmodeler_ui/ui/sequencewidget.ui @@ -88,6 +88,9 @@ false + + true + @@ -116,6 +119,9 @@ false + + true + @@ -144,6 +150,9 @@ false + + true + @@ -172,6 +181,9 @@ false + + true + @@ -200,6 +212,9 @@ false + + true + diff --git a/libpgmodeler_ui/ui/snippetsconfigwidget.ui b/libpgmodeler_ui/ui/snippetsconfigwidget.ui index 2b9c846ebe..259cf6ddc8 100644 --- a/libpgmodeler_ui/ui/snippetsconfigwidget.ui +++ b/libpgmodeler_ui/ui/snippetsconfigwidget.ui @@ -104,6 +104,9 @@ 0 + + true + @@ -146,6 +149,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/tablespacewidget.ui b/libpgmodeler_ui/ui/tablespacewidget.ui index 0f8b233ad4..13634b0069 100644 --- a/libpgmodeler_ui/ui/tablespacewidget.ui +++ b/libpgmodeler_ui/ui/tablespacewidget.ui @@ -20,7 +20,16 @@ Form - + + 2 + + + 2 + + + 2 + + 2 @@ -58,6 +67,9 @@ false + + true + diff --git a/libpgmodeler_ui/ui/triggerwidget.ui b/libpgmodeler_ui/ui/triggerwidget.ui index 03422827fb..65b67075d7 100644 --- a/libpgmodeler_ui/ui/triggerwidget.ui +++ b/libpgmodeler_ui/ui/triggerwidget.ui @@ -107,6 +107,9 @@ 0 + + true + @@ -664,6 +667,9 @@ 0 + + true + @@ -688,6 +694,9 @@ 0 + + true + diff --git a/libpgmodeler_ui/ui/typewidget.ui b/libpgmodeler_ui/ui/typewidget.ui index fe646d2b61..b6d7b7cacc 100644 --- a/libpgmodeler_ui/ui/typewidget.ui +++ b/libpgmodeler_ui/ui/typewidget.ui @@ -240,6 +240,9 @@ 1 + + true + @@ -250,7 +253,11 @@ - + + + true + + @@ -414,7 +421,11 @@ - + + + true + + @@ -460,7 +471,11 @@ - + + + true + + From 5ffa516fcac67062e67443806d571f02926072f8 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 6 Mar 2019 11:59:35 -0300 Subject: [PATCH 280/425] Added missing data type macaddr8 (issue #1247) --- libpgmodeler/src/pgsqltypes.cpp | 46 +++++++++++++++++---------------- libpgmodeler/src/pgsqltypes.h | 42 +++++++++++++++--------------- 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 7ac32858c5..1800769757 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -73,7 +73,7 @@ QString BaseType::type_list[BaseType::TypesCount]= "brin", //Types used by the class PgSQLType - //offsets 27 to 86 + //offsets 27 to 88 //Note: the type char is different from "char" (with quotes) //Reference: http://www.postgresql.org/docs/9.2/static/datatype-character.html @@ -85,13 +85,13 @@ QString BaseType::type_list[BaseType::TypesCount]= "interval", "boolean", "bool", "point", "line", "lseg", "box", "path", "polygon", "circle", "cidr", "inet", - "macaddr", "bit", "bit varying", "varbit", "uuid", "xml", "json", "jsonb", + "macaddr", "macaddr8", "bit", "bit varying", "varbit", "uuid", "xml", "json", "jsonb", "smallserial", "int2vector", "int2", "int4", "int8", "float4", "float8", "bpchar", "name", "abstime", "aclitem", "gtsvector", "refcursor", "reltime", "tinterval", "tsquery", "tsvector", "txid_snapshot", //Spatial type specifics for the PostGiS extension - //offsets 88 to 101 + //offsets 89 to 102 "box2d","box3d","geometry", "geometry_dump","geography", "geomval", "addbandarg", "rastbandarg", @@ -101,12 +101,12 @@ QString BaseType::type_list[BaseType::TypesCount]= "validatetopology_returntype", //Range-types - //offsets 102 to 107 + //offsets 103 to 108 "int4range", "int8range", "numrange", "tsrange","tstzrange","daterange", //Object Identification type (OID) - //offsets 108 to 122 + //offsets 109 to 123 "oid", "regproc", "regprocedure", "regoper", "regoperator", "regclass", "regrole", "regnamespace", "regtype", @@ -114,31 +114,31 @@ QString BaseType::type_list[BaseType::TypesCount]= "tid", "oidvector", //Pseudo-types - //offsets 123 to 137 + //offsets 124 to 138 "\"any\"","anyarray","anyelement","anyenum", "anynonarray", "anyrange", "cstring","internal","language_handler", "record","trigger","void","opaque", "fdw_handler", "event_trigger", //Interval types - //offsets 138 to 150 + //offsets 139 to 151 "YEAR", "MONTH", "DAY", "HOUR", "MINUTE", "SECOND","YEAR TO MONTH", "DAY TO HOUR","DAY TO MINUTE","DAY TO SECOND", "HOUR TO MINUTE","HOUR TO SECOND","MINUTE TO SECOND", //Types used by the class BehaviorType - //offsets 151 to 153 + //offsets 152 to 154 "CALLED ON NULL INPUT", "RETURNS NULL ON NULL INPUT", "STRICT", //Types used by the class SecurityType - //offsets 154 to 155 + //offsets 155 to 156 "SECURITY INVOKER", "SECURITY DEFINER", //Types used by the class LanguageType - //offsets 156 to 162 + //offsets 157 to 163 "sql", "c", "plpgsql", @@ -148,7 +148,7 @@ QString BaseType::type_list[BaseType::TypesCount]= "internal", //Types used by the class EncodingType - //offsets 163 to 204 + //offsets 164 to 205 "UTF8", "BIG5", "EUC_CN", "EUC_JP", "EUC_JIS_2004", "EUC_KR", "EUC_TW", "GB18030", "GBK", "ISO_8859_5", "ISO_8859_6", "ISO_8859_7", "ISO_8859_8", @@ -161,25 +161,25 @@ QString BaseType::type_list[BaseType::TypesCount]= "WIN1254", "WIN1255", "WIN1256", "WIN1257", "WIN1258", //Types used by the class StorageType - //offsets 205 to 208 + //offsets 206 to 209 "plain", "external", "extended", "main", //Types used by the class MatchType - //offsets 209 to 211 + //offsets 210 to 212 "MATCH FULL", "MATCH PARTIAL", "MATCH SIMPLE", //Types used by the class DeferralType - //offsets 212 to 213 + //offsets 213 to 214 "INITIALLY IMMEDIATE", "INITIALLY DEFERRED", //Types used by the class CategoryType - //offsets 214 to 227 - See table 44-43 on PostgreSQL 8.4 documentation + //offsets 215 to 228 - See table 44-43 on PostgreSQL 8.4 documentation "U", //User-defined types "A", //Array types "B", //Boolean types @@ -196,7 +196,7 @@ QString BaseType::type_list[BaseType::TypesCount]= "X", //Unknown type //Types used by the class FiringType - //offsets 228 to 230 + //offsets 229 to 231 "BEFORE", "AFTER", "INSTEAD OF", @@ -205,7 +205,7 @@ QString BaseType::type_list[BaseType::TypesCount]= These types accepts variations Z, M e ZM. > Example: POINT, POINTZ, POINTM, POINTZM Reference: http://postgis.refractions.net/documentation/manual-2.0/using_postgis_dbmanagement.html */ - //offsets 231 to 246 + //offsets 232 to 247 "POINT", "LINESTRING", "POLYGON", @@ -224,19 +224,19 @@ QString BaseType::type_list[BaseType::TypesCount]= "MULTISURFACE", //Types used by the class EventTriggerType - //offsets 247 to 250 + //offsets 248 to 251 "ddl_command_start", "ddl_command_end", "sql_drop", "table_rewrite", //Types used by the class IdentityType - //offsets 251 to 252 + //offsets 252 to 253 "ALWAYS", "BY DEFAULT", //Types used by the class PolicyCmdType - //offsets 253 to 257 + //offsets 254 to 258 "ALL", "SELECT", "INSERT", @@ -244,7 +244,7 @@ QString BaseType::type_list[BaseType::TypesCount]= "UPDATE", //Types used by the class PartitioningType - //offsets 258 to 260 + //offsets 259 to 261 "RANGE", "LIST", "HASH", @@ -1344,7 +1344,9 @@ bool PgSqlType::isNetworkType(void) return(!isUserType() && (curr_type==QString("cidr") || - curr_type==QString("inet"))); + curr_type==QString("inet") || + curr_type==QString("macaddr") || + curr_type==QString("macaddr8"))); } bool PgSqlType::isGiSType(void) diff --git a/libpgmodeler/src/pgsqltypes.h b/libpgmodeler/src/pgsqltypes.h index 21051f49c5..17a4c15575 100644 --- a/libpgmodeler/src/pgsqltypes.h +++ b/libpgmodeler/src/pgsqltypes.h @@ -33,7 +33,7 @@ class BaseType{ protected: - static constexpr unsigned TypesCount=261; + static constexpr unsigned TypesCount=262; static QString type_list[TypesCount]; //! \brief Index of the type on the type_list vector @@ -210,7 +210,7 @@ class IndexingType: public BaseType{ class IntervalType: public BaseType{ private: - static constexpr unsigned Offset=138; + static constexpr unsigned Offset=139; static constexpr unsigned TypesCount=13; public: @@ -280,7 +280,7 @@ class UserTypeConfig { class SpatialType: public BaseType{ private: unsigned variation; - static constexpr unsigned Offset=231; + static constexpr unsigned Offset=232; static constexpr unsigned TypesCount=16; /*! \brief Used in conjunction with spatial_type, and denotes the SRID value @@ -319,15 +319,15 @@ class SpatialType: public BaseType{ class PgSqlType: public BaseType{ private: static constexpr unsigned Offset=27; - static constexpr unsigned TypesCount=111; + static constexpr unsigned TypesCount=112; //! \brief Offset for oid types - static constexpr unsigned OidStart=108; - static constexpr unsigned OidEnd=122; + static constexpr unsigned OidStart=109; + static constexpr unsigned OidEnd=123; //! \brief Offset for pseudo types - static constexpr unsigned PseudoStart=123; - static constexpr unsigned PseudoEnd=137; + static constexpr unsigned PseudoStart=124; + static constexpr unsigned PseudoEnd=138; //! \brief Configuration for user defined types static vector user_types; @@ -500,7 +500,7 @@ class PgSqlType: public BaseType{ class BehaviorType: public BaseType{ private: - static constexpr unsigned Offset=151; + static constexpr unsigned Offset=152; static constexpr unsigned TypesCount=3; public: @@ -519,7 +519,7 @@ class BehaviorType: public BaseType{ class SecurityType: public BaseType{ private: - static constexpr unsigned Offset=154; + static constexpr unsigned Offset=155; static constexpr unsigned TypesCount=2; public: @@ -537,7 +537,7 @@ class SecurityType: public BaseType{ class LanguageType: public BaseType{ private: - static constexpr unsigned Offset=156; + static constexpr unsigned Offset=157; static constexpr unsigned TypesCount=7; public: @@ -560,7 +560,7 @@ class LanguageType: public BaseType{ class EncodingType: public BaseType{ private: - static constexpr unsigned Offset=163; + static constexpr unsigned Offset=164; static constexpr unsigned TypesCount=42; public: @@ -580,7 +580,7 @@ class EncodingType: public BaseType{ class StorageType: public BaseType{ private: - static constexpr unsigned Offset=205; + static constexpr unsigned Offset=206; static constexpr unsigned TypesCount=4; public: @@ -603,7 +603,7 @@ class StorageType: public BaseType{ class MatchType: public BaseType{ private: - static constexpr unsigned Offset=209; + static constexpr unsigned Offset=210; static constexpr unsigned TypesCount=3; public: @@ -622,7 +622,7 @@ class MatchType: public BaseType{ class DeferralType: public BaseType{ private: - static constexpr unsigned Offset=212; + static constexpr unsigned Offset=213; static constexpr unsigned TypesCount=2; public: @@ -640,7 +640,7 @@ class DeferralType: public BaseType{ class CategoryType: public BaseType{ private: - static constexpr unsigned Offset=214; + static constexpr unsigned Offset=215; static constexpr unsigned TypesCount=14; public: @@ -670,7 +670,7 @@ class CategoryType: public BaseType{ class FiringType: public BaseType{ private: - static constexpr unsigned Offset=228; + static constexpr unsigned Offset=229; static constexpr unsigned TypesCount=3; public: @@ -689,7 +689,7 @@ class FiringType: public BaseType{ class EventTriggerType: public BaseType{ private: - static constexpr unsigned Offset=247; + static constexpr unsigned Offset=248; static constexpr unsigned TypesCount=4; public: @@ -709,7 +709,7 @@ class EventTriggerType: public BaseType{ class IdentityType: public BaseType{ private: - static constexpr unsigned Offset=251; + static constexpr unsigned Offset=252; static constexpr unsigned TypesCount=2; public: @@ -727,7 +727,7 @@ class IdentityType: public BaseType{ class PolicyCmdType: public BaseType { private: - static constexpr unsigned Offset=253; + static constexpr unsigned Offset=254; static constexpr unsigned TypesCount=5; public: @@ -748,7 +748,7 @@ class PolicyCmdType: public BaseType { class PartitioningType: public BaseType { private: - static constexpr unsigned Offset=258; + static constexpr unsigned Offset=259; static constexpr unsigned TypesCount=3; public: From bf54b16d87ee7314bd4ebc4e5c1672c027ca8337 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 7 Mar 2019 08:15:57 -0300 Subject: [PATCH 281/425] Minor fix on button tooltip --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 47b875fe1b..298f04c9f3 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -82,6 +82,7 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) file_tb->setToolTip(file_tb->toolTip() + QString(" (%1)").arg(file_tb->shortcut().toString())); output_tb->setToolTip(output_tb->toolTip() + QString(" (%1)").arg(output_tb->shortcut().toString())); find_tb->setToolTip(find_tb->toolTip() + QString(" (%1)").arg(find_tb->shortcut().toString())); + filter_tb->setToolTip(filter_tb->toolTip() + QString(" (%1)").arg(filter_tb->shortcut().toString())); results_tbw->setItemDelegate(new PlainTextItemDelegate(this, true)); From a3107d1db07caf789f2bc30bc38f26778bd153a1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 8 Mar 2019 14:57:37 -0300 Subject: [PATCH 282/425] Created the class ForeignDataWrapper --- libpgmodeler/libpgmodeler.pro | 30 ++++---- libpgmodeler/src/foreigndatawrapper.cpp | 95 +++++++++++++++++++++++++ libpgmodeler/src/foreigndatawrapper.h | 56 +++++++++++++++ 3 files changed, 167 insertions(+), 14 deletions(-) create mode 100644 libpgmodeler/src/foreigndatawrapper.cpp create mode 100644 libpgmodeler/src/foreigndatawrapper.h diff --git a/libpgmodeler/libpgmodeler.pro b/libpgmodeler/libpgmodeler.pro index acf330c818..245d688c08 100644 --- a/libpgmodeler/libpgmodeler.pro +++ b/libpgmodeler/libpgmodeler.pro @@ -23,7 +23,7 @@ HEADERS += src/textbox.h \ src/column.h \ src/domain.h \ src/aggregate.h \ - src/permission.h \ + src/permission.h \ src/databasemodel.h \ src/role.h \ src/constraint.h \ @@ -56,12 +56,13 @@ HEADERS += src/textbox.h \ src/copyoptions.h \ src/typeattribute.h \ src/extension.h \ - src/pgmodelerns.h \ - src/tag.h \ - src/eventtrigger.h \ - src/genericsql.h \ - src/policy.h \ - src/partitionkey.h + src/pgmodelerns.h \ + src/tag.h \ + src/eventtrigger.h \ + src/genericsql.h \ + src/policy.h \ + src/partitionkey.h \ + src/foreigndatawrapper.h SOURCES += src/textbox.cpp \ src/domain.cpp \ @@ -83,7 +84,7 @@ SOURCES += src/textbox.cpp \ src/view.cpp \ src/conversion.cpp \ src/function.cpp \ - src/permission.cpp \ + src/permission.cpp \ src/databasemodel.cpp \ src/rule.cpp \ src/table.cpp \ @@ -106,12 +107,13 @@ SOURCES += src/textbox.cpp \ src/typeattribute.cpp \ src/extension.cpp \ src/pgmodelerns.cpp \ - src/tag.cpp \ - src/eventtrigger.cpp \ - src/operation.cpp \ - src/genericsql.cpp \ - src/policy.cpp \ - src/partitionkey.cpp + src/tag.cpp \ + src/eventtrigger.cpp \ + src/operation.cpp \ + src/genericsql.cpp \ + src/policy.cpp \ + src/partitionkey.cpp \ + src/foreigndatawrapper.cpp unix|windows: LIBS += -L$$OUT_PWD/../libparsers/ -lparsers \ -L$$OUT_PWD/../libutils/ -lutils diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp new file mode 100644 index 0000000000..3f9c60312f --- /dev/null +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -0,0 +1,95 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "foreigndatawrapper.h" + +ForeignDataWrapper::ForeignDataWrapper(void) +{ + obj_type=ObjectType::ForeignDataWrapper; + validator_func = handler_func = nullptr; +} + +void ForeignDataWrapper::setHandlerFunction(Function *func) +{ + if(func) + { + if(func->getReturnType() != PgSqlType("fwd_handler")) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) + .arg(this->getName(true)) + .arg(this->getTypeName()), + ErrorCode::AsgFunctionInvalidReturnType, __PRETTY_FUNCTION__, __FILE__, __LINE__); + + if(func->getParameterCount() != 0) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) + .arg(this->getName(true)) + .arg(this->getTypeName()), + ErrorCode::AsgFunctionInvalidParamCount, __PRETTY_FUNCTION__, __FILE__, __LINE__); + } + + handler_func = func; +} + +void ForeignDataWrapper::setValidatorFunction(Function *func) +{ + if(func) + { + if(func->getParameterCount() != 2) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParamCount) + .arg(this->getName(true)) + .arg(this->getTypeName()), + ErrorCode::AsgFunctionInvalidParamCount, __PRETTY_FUNCTION__, __FILE__, __LINE__); + + if(func->getParameter(0).getType() != PgSqlType("text", 1) || + func->getParameter(1).getType() != PgSqlType("oid", 1)) + throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) + .arg(this->getName(true)) + .arg(this->getTypeName()), + ErrorCode::AsgFunctionInvalidParamCount, __PRETTY_FUNCTION__, __FILE__, __LINE__); + + } + + validator_func = func; +} + +Function *ForeignDataWrapper::getHandlerFunction(void) +{ + return(handler_func); +} + +Function *ForeignDataWrapper::getValidatorFunction(void) +{ + return(validator_func); +} + +void ForeignDataWrapper::setOptions(const attribs_map &options) +{ + this->options = options; +} + +attribs_map ForeignDataWrapper::getOptions(void) +{ + return(options); +} + +QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) +{ + QString code_def=getCachedCode(def_type, false); + if(!code_def.isEmpty()) return(code_def); + + return(this->BaseObject::__getCodeDefinition(def_type)); +} diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h new file mode 100644 index 0000000000..07a6d128e3 --- /dev/null +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -0,0 +1,56 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler +\class ForeignDataWrapper +\brief Implements the operations to manipulate foreign data wrappers on the database. +*/ + +#ifndef FOREIGN_DATA_WRAPPER_H +#define FOREIGN_DATA_WRAPPER_H + +#include "baseobject.h" +#include "function.h" + +class ForeignDataWrapper: public BaseObject{ + //! \brief Function that executes the functions related to the foreign data wrapper + Function *handler_func, + + //! \brief Function that validates the options passed to the foreign data wrapper + *validator_func; + + //! \brief A set of key/value options associated to the foreign data wrapper + attribs_map options; + + public: + ForeignDataWrapper(void); + + void setHandlerFunction(Function *func); + void setValidatorFunction(Function *func); + + Function *getHandlerFunction(void); + Function *getValidatorFunction(void); + + void setOptions(const attribs_map &options); + attribs_map getOptions(void); + + virtual QString getCodeDefinition(unsigned def_type); +}; + +#endif From 52908fde7c0345a7c5b9d7b5c553cef02d3a6c63 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 8 Mar 2019 14:59:11 -0300 Subject: [PATCH 283/425] Minor change in the PgSqlType constructor by turning some parameters optional in order to facilitate the creation of array only types --- libpgmodeler/src/pgsqltypes.cpp | 12 +++++----- libpgmodeler/src/pgsqltypes.h | 40 +++++++++++++++++++++------------ 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 1800769757..c9d73e7654 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -761,33 +761,33 @@ PgSqlType::PgSqlType(void *ptype) : PgSqlType() (*this) << ptype; } -PgSqlType::PgSqlType(void *ptype, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() +PgSqlType::PgSqlType(void *ptype, unsigned dimension, unsigned length, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() { (*this) << ptype; - setLength(length); setDimension(dimension); + setLength(length); setPrecision(precision); setWithTimezone(with_timezone); setIntervalType(interv_type); setSpatialType(spatial_type); } -PgSqlType::PgSqlType(const QString &type_name, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() +PgSqlType::PgSqlType(const QString &type_name, unsigned dimension, unsigned length, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() { (*this)=type_name; - setLength(length); setDimension(dimension); + setLength(length); setPrecision(precision); setWithTimezone(with_timezone); setIntervalType(interv_type); setSpatialType(spatial_type); } -PgSqlType::PgSqlType(unsigned type_id, unsigned length, unsigned dimension, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() +PgSqlType::PgSqlType(unsigned type_id, unsigned dimension, unsigned length, int precision, bool with_timezone, IntervalType interv_type, SpatialType spatial_type) : PgSqlType() { (*this)=type_id; - setLength(length); setDimension(dimension); + setLength(length); setPrecision(precision); setWithTimezone(with_timezone); setIntervalType(interv_type); diff --git a/libpgmodeler/src/pgsqltypes.h b/libpgmodeler/src/pgsqltypes.h index 17a4c15575..9be7965091 100644 --- a/libpgmodeler/src/pgsqltypes.h +++ b/libpgmodeler/src/pgsqltypes.h @@ -382,20 +382,32 @@ class PgSqlType: public BaseType{ //! \brief Creates a type from a pointer that references an user defined type (Type class) PgSqlType(void *ptype); - PgSqlType(const QString &type_name, unsigned length, - unsigned dimension, int precision, - bool with_timezone, IntervalType interv_type, - SpatialType spatial_type); - - PgSqlType(void *ptipo, unsigned length, - unsigned dimension, int precision, - bool with_timezone, IntervalType interv_type, - SpatialType spatial_type); - - PgSqlType(unsigned type_id, unsigned length, - unsigned dimension, int precision, - bool with_timezone, IntervalType interv_type, - SpatialType spatial_type); + /*! \brief Creates a type from a type name and a series of data like + * dimension, length, precision, timezone option, interval type and spatial type. + * All parameters are optional except type_name and dimension which can be used to quicly create + * array of a certain type. */ + PgSqlType(const QString &type_name, unsigned dimension, + unsigned length = 0, int precision = -1, + bool with_timezone = false, IntervalType interv_type = IntervalType::Null, + SpatialType spatial_type = SpatialType()); + + /*! \brief Creates a type from a pointer to a data type (generally a user defined type, see UserTypeConfig class) + * and a series of data like dimension, length, precision, timezone option, interval type and spatial type. + * All parameters are optional except ptype and dimension which can be used to quickly create + * array of a certain type. */ + PgSqlType(void *ptype, unsigned dimension, + unsigned length = 0, int precision = -1, + bool with_timezone = false, IntervalType interv_type = IntervalType::Null, + SpatialType spatial_type = SpatialType()); + + /*! \brief Creates a type from a type id and a series of data like + * dimension, length, precision, timezone option, interval type and spatial type. + * All parameters are optional except type_id and dimension which can be used to quickly create + * array of a certain type. */ + PgSqlType(unsigned type_id, unsigned dimension, + unsigned length = 0, int precision = -1, + bool with_timezone = false, IntervalType interv_type = IntervalType::Null, + SpatialType spatial_type = SpatialType()); /*! \brief Creates a configured instance of PgSQLType from a string in SQL canonical form, e.g, varchar(255), timestamp with timezone, smallint[] and so on. From 49bcfcd62cc58571f79edef2725616e6bad9af39 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 8 Mar 2019 14:59:47 -0300 Subject: [PATCH 284/425] Minor attributes refactoring on several classes --- libpgmodeler/src/aggregate.cpp | 2 +- libpgmodeler/src/baseobject.cpp | 16 +++++---- libpgmodeler/src/baseobject.h | 3 +- libpgmodeler/src/databasemodel.cpp | 36 ++++++++++---------- libpgmodeler/src/genericsql.cpp | 4 +-- libpgmodeler/src/genericsql.h | 2 +- libpgmodeler/src/operator.cpp | 36 ++++++++++---------- libpgmodeler/src/operator.h | 14 ++++---- libpgmodeler_ui/src/baseobjectwidget.cpp | 8 ++--- libpgmodeler_ui/src/baseobjectwidget.h | 6 ++-- libpgmodeler_ui/src/columnwidget.cpp | 2 +- libpgmodeler_ui/src/constraintwidget.cpp | 4 +-- libpgmodeler_ui/src/elementwidget.cpp | 2 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 2 +- libpgmodeler_ui/src/functionwidget.cpp | 4 +-- libpgmodeler_ui/src/indexwidget.cpp | 4 +-- libpgmodeler_ui/src/operatorclasswidget.cpp | 2 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 2 +- libpgmodeler_ui/src/operatorwidget.cpp | 24 ++++++------- libpgmodeler_ui/src/rolewidget.cpp | 4 +-- libpgmodeler_ui/src/tablewidget.cpp | 8 ++--- libpgmodeler_ui/src/viewwidget.cpp | 6 ++-- 22 files changed, 97 insertions(+), 94 deletions(-) diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index e6d47a3246..75675a1e4f 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -121,7 +121,7 @@ void Aggregate::setSortOperator(Operator *sort_op) 1) The aggregate accepts only one data type 2) The function that defines the operator has the parameter types identical as the input data type of the aggregate */ - func=sort_op->getFunction(Operator::FUNC_OPERATOR); + func=sort_op->getFunction(Operator::FuncOperator); //Validating the condition 1 if(data_types.size()!=1) throw Exception(ErrorCode::AsgInvalidOperatorArguments,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 3d5752cfd2..7f9b2d1206 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -32,9 +32,9 @@ const QString BaseObject::objs_schemas[BaseObject::ObjectTypeCount]={ "sequence", "role", "conversion", "cast", "language", "usertype", "tablespace", "opfamily", "opclass", "database","collation", - "extension", "eventtrigger", "policy", "relationship", - "textbox", "permission", "parameter", "typeattribute", - "tag", "genericsql", "relationship" + "extension", "eventtrigger", "policy", "foreigndatawrapper", + "relationship", "textbox", "permission", "parameter", + "typeattribute", "tag", "genericsql", "relationship" }; const QString BaseObject::obj_type_names[BaseObject::ObjectTypeCount]={ @@ -46,9 +46,10 @@ const QString BaseObject::obj_type_names[BaseObject::ObjectTypeCount]={ QT_TR_NOOP("Cast"), QT_TR_NOOP("Language"), QT_TR_NOOP("Type"), QT_TR_NOOP("Tablespace"), QT_TR_NOOP("Operator Family"), QT_TR_NOOP("Operator Class"), QT_TR_NOOP("Database"), QT_TR_NOOP("Collation"), QT_TR_NOOP("Extension"), - QT_TR_NOOP("Event Trigger"), QT_TR_NOOP("Policy"), QT_TR_NOOP("Relationship"), - QT_TR_NOOP("Textbox"), QT_TR_NOOP("Permission"), QT_TR_NOOP("Parameter"), QT_TR_NOOP("Type Attribute"), - QT_TR_NOOP("Tag"), QT_TR_NOOP("Generic SQL"), QT_TR_NOOP("Basic Relationship") + QT_TR_NOOP("Event Trigger"), QT_TR_NOOP("Policy"), QT_TR_NOOP("Foreign Data Wrapper"), + QT_TR_NOOP("Relationship"), QT_TR_NOOP("Textbox"), QT_TR_NOOP("Permission"), + QT_TR_NOOP("Parameter"), QT_TR_NOOP("Type Attribute"), QT_TR_NOOP("Tag"), + QT_TR_NOOP("Generic SQL"), QT_TR_NOOP("Basic Relationship") }; const QString BaseObject::objs_sql[BaseObject::ObjectTypeCount]={ @@ -58,7 +59,8 @@ const QString BaseObject::objs_sql[BaseObject::ObjectTypeCount]={ QString("OPERATOR"), QString("SEQUENCE"), QString("ROLE"), QString("CONVERSION"), QString("CAST"), QString("LANGUAGE"), QString("TYPE"), QString("TABLESPACE"), QString("OPERATOR FAMILY"), QString("OPERATOR CLASS"), QString("DATABASE"), - QString("COLLATION"), QString("EXTENSION"), QString("EVENT TRIGGER"), QString("POLICY") + QString("COLLATION"), QString("EXTENSION"), QString("EVENT TRIGGER"), + QString("POLICY"), QString("FOREIGN DATA WRAPPER") }; /* Initializes the global id which is shared between instances diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 4b53f16e95..5490566b03 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -63,6 +63,7 @@ enum class ObjectType: unsigned { Extension, EventTrigger, Policy, + ForeignDataWrapper, Relationship, Textbox, Permission, @@ -106,7 +107,7 @@ class BaseObject { unsigned object_id; //! \brief Objects type count declared on enum ObjectType - static constexpr int ObjectTypeCount=37; + static constexpr int ObjectTypeCount=38; /*! \brief Indicates whether the object is protected or not. A protected object indicates that it can not suffer changes in position diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 2733c4064a..6ca7df9e52 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3986,7 +3986,7 @@ PgSqlType DatabaseModel::createPgSQLType(void) type_idx=PgSqlType::getBaseTypeIndex(name); if(type_idx!=PgSqlType::Null) { - return(PgSqlType(name,length,dimension,precision,with_timezone,interv_type, spatial_type)); + return(PgSqlType(name, dimension, length, precision, with_timezone, interv_type, spatial_type)); } else { @@ -3995,7 +3995,7 @@ PgSqlType DatabaseModel::createPgSQLType(void) throw Exception(ErrorCode::RefUserTypeInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); type_idx=PgSqlType::getUserTypeIndex(name, ptype); - return(PgSqlType(type_idx,length,dimension,precision,with_timezone,interv_type,spatial_type)); + return(PgSqlType(type_idx, dimension, length, precision, with_timezone, interv_type, spatial_type)); } } @@ -4387,12 +4387,12 @@ Operator *DatabaseModel::createOperator(void) oper->setMerges(attribs[Attributes::Merges]==Attributes::True); oper->setHashes(attribs[Attributes::Hashes]==Attributes::True); - func_types[Attributes::OperatorFunc]=Operator::FUNC_OPERATOR; - func_types[Attributes::JoinFunc]=Operator::FUNC_JOIN; - func_types[Attributes::RestrictionFunc]=Operator::FUNC_RESTRICT; + func_types[Attributes::OperatorFunc]=Operator::FuncOperator; + func_types[Attributes::JoinFunc]=Operator::FuncJoin; + func_types[Attributes::RestrictionFunc]=Operator::FuncRestrict; - oper_types[Attributes::CommutatorOp]=Operator::OPER_COMMUTATOR; - oper_types[Attributes::NegatorOp]=Operator::OPER_NEGATOR; + oper_types[Attributes::CommutatorOp]=Operator::OperCommutator; + oper_types[Attributes::NegatorOp]=Operator::OperNegator; if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -4424,9 +4424,9 @@ Operator *DatabaseModel::createOperator(void) xmlparser.getElementAttributes(attribs); if(attribs[Attributes::RefType]!=Attributes::RightType) - arg_type=Operator::LEFT_ARG; + arg_type=Operator::LeftArg; else - arg_type=Operator::RIGHT_ARG; + arg_type=Operator::RightArg; type=createPgSQLType(); oper->setArgumentType(type, arg_type); @@ -7679,13 +7679,13 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetFunction(i)) getObjectDependecies(oper->getFunction(i), deps, inc_indirect_deps); } - for(i=Operator::LEFT_ARG; i <= Operator::RIGHT_ARG; i++) + for(i=Operator::LeftArg; i <= Operator::RightArg; i++) { usr_type=getObjectPgSQLType(oper->getArgumentType(i)); @@ -7693,7 +7693,7 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetOperator(i)) getObjectDependecies(oper->getOperator(i), deps, inc_indirect_deps); @@ -8223,9 +8223,9 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector { oper=dynamic_cast(*itr); - if(oper->getFunction(Operator::FUNC_OPERATOR)==func || - oper->getFunction(Operator::FUNC_JOIN)==func || - oper->getFunction(Operator::FUNC_RESTRICT)==func) + if(oper->getFunction(Operator::FuncOperator)==func || + oper->getFunction(Operator::FuncJoin)==func || + oper->getFunction(Operator::FuncRestrict)==func) { refer=true; refs.push_back(oper); @@ -8528,8 +8528,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector oper=dynamic_cast(*itr); itr++; - if(oper->getArgumentType(Operator::LEFT_ARG)==ptr_pgsqltype || - oper->getArgumentType(Operator::RIGHT_ARG)==ptr_pgsqltype) + if(oper->getArgumentType(Operator::LeftArg)==ptr_pgsqltype || + oper->getArgumentType(Operator::RightArg)==ptr_pgsqltype) { refer=true; refs.push_back(oper); @@ -8852,7 +8852,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector oper_aux=dynamic_cast(*itr); itr++; - for(i1=Operator::OPER_COMMUTATOR; i1 <= Operator::OPER_NEGATOR && + for(i1=Operator::OperCommutator; i1 <= Operator::OperNegator && (!exclusion_mode || (exclusion_mode && !refer)); i1++) { if(oper_aux->getOperator(i1)==oper) diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 1496494dc2..215ed7474c 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -44,7 +44,7 @@ QString GenericSQL::getCodeDefinition(unsigned def_type) return(this->BaseObject::__getCodeDefinition(def_type)); } -void GenericSQL::operator = (GenericSQL &genericsql) +/*void GenericSQL::operator = (GenericSQL &genericsql) { (*dynamic_cast(this))=reinterpret_cast(genericsql); -} +}*/ diff --git a/libpgmodeler/src/genericsql.h b/libpgmodeler/src/genericsql.h index 98f57ed430..d06e707056 100644 --- a/libpgmodeler/src/genericsql.h +++ b/libpgmodeler/src/genericsql.h @@ -38,7 +38,7 @@ class GenericSQL: public BaseObject{ QString getDefinition(void); //! \brief Copies the attributes between generic sql objects - void operator = (GenericSQL &genericsql); + // void operator = (GenericSQL &genericsql); virtual QString getCodeDefinition(unsigned def_type); }; diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index a1086f8ac1..9a44615fe4 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -24,15 +24,15 @@ Operator::Operator(void) obj_type=ObjectType::Operator; - for(i=FUNC_OPERATOR; i <= FUNC_RESTRICT; i++) + for(i=FuncOperator; i <= FuncRestrict; i++) functions[i]=nullptr; - for(i=Operator::OPER_COMMUTATOR; i <= OPER_NEGATOR; i++) + for(i=Operator::OperCommutator; i <= OperNegator; i++) operators[i]=nullptr; hashes=merges=false; - argument_types[LEFT_ARG]=PgSqlType(QString("\"any\"")); - argument_types[RIGHT_ARG]=PgSqlType(QString("\"any\"")); + argument_types[LeftArg]=PgSqlType(QString("\"any\"")); + argument_types[RightArg]=PgSqlType(QString("\"any\"")); attributes[Attributes::LeftType]=QString(); attributes[Attributes::RightType]=QString(); @@ -92,9 +92,9 @@ void Operator::setName(const QString &name) void Operator::setFunction(Function *func, unsigned func_type) { //Raises an error if the function type is invalid - if(func_type > FUNC_RESTRICT) + if(func_type > FuncRestrict) throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(func_type==FUNC_OPERATOR) + else if(func_type==FuncOperator) { //Raises an error if the function is not allocated if(!func) @@ -154,7 +154,7 @@ void Operator::setFunction(Function *func, unsigned func_type) void Operator::setArgumentType(PgSqlType arg_type, unsigned arg_id) { //Raises an error if the argument id is invalid - if(arg_id > RIGHT_ARG) + if(arg_id > RightArg) throw Exception(ErrorCode::RefOperatorArgumentInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); setCodeInvalidated(argument_types[arg_id] != arg_type); @@ -164,7 +164,7 @@ void Operator::setArgumentType(PgSqlType arg_type, unsigned arg_id) void Operator::setOperator(Operator *oper, unsigned op_type) { //Raises an error if the operator type is invalid - if(op_type > OPER_NEGATOR) + if(op_type > OperNegator) throw Exception(ErrorCode::RefOperatorInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); else { @@ -174,7 +174,7 @@ void Operator::setOperator(Operator *oper, unsigned op_type) is being defined and its commutator operator is +*+ then the signature of the latter should be +*+ (typeB, typeA). Raises an error when this condition is not satisfied. */ - if(oper && op_type==OPER_COMMUTATOR && argument_types[LEFT_ARG]!=oper->argument_types[RIGHT_ARG]) + if(oper && op_type==OperCommutator && argument_types[LeftArg]!=oper->argument_types[RightArg]) { throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidCommutatorOperator) .arg(oper->getSignature(true)) @@ -186,9 +186,9 @@ void Operator::setOperator(Operator *oper, unsigned op_type) operator to be defined. That is, if the operator !!(typeA) is being set and its negator is !*! then the signature of the latter should be !*! (typeA). Raises an error when this condition is not satisfied. */ - else if(oper && op_type==OPER_NEGATOR && - (argument_types[LEFT_ARG]!=oper->argument_types[LEFT_ARG] && - argument_types[RIGHT_ARG]!=oper->argument_types[RIGHT_ARG])) + else if(oper && op_type==OperNegator && + (argument_types[LeftArg]!=oper->argument_types[LeftArg] && + argument_types[RightArg]!=oper->argument_types[RightArg])) { throw Exception(Exception::getErrorMessage(ErrorCode::AsgInvalidNegatorOperator) .arg(oper->getSignature(true)) @@ -216,7 +216,7 @@ void Operator::setMerges(bool value) Function *Operator::getFunction(unsigned func_type) { //Raises an error if the function type is invalid - if(func_type > FUNC_RESTRICT) + if(func_type > FuncRestrict) throw Exception(ErrorCode::RefOperatorInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(functions[func_type]); @@ -225,7 +225,7 @@ Function *Operator::getFunction(unsigned func_type) PgSqlType Operator::getArgumentType(unsigned arg_id) { //Raises an error if the argument id is invalid - if(arg_id > RIGHT_ARG) + if(arg_id > RightArg) throw Exception(ErrorCode::RefOperatorArgumentInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(argument_types[arg_id]); } @@ -233,7 +233,7 @@ PgSqlType Operator::getArgumentType(unsigned arg_id) Operator *Operator::getOperator(unsigned op_type) { //Raises an error if the operator type is invalid - if(op_type > OPER_NEGATOR) + if(op_type > OperNegator) throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); return(operators[op_type]); @@ -288,7 +288,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) Attributes::JoinFunc, Attributes::RestrictionFunc}; - for(i=Operator::LEFT_ARG; i <= Operator::RIGHT_ARG; i++) + for(i=Operator::LeftArg; i <= Operator::RightArg; i++) { if(def_type==SchemaParser::SqlDefinition) { @@ -302,7 +302,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) } } - for(i=Operator::OPER_COMMUTATOR; i <= Operator::OPER_NEGATOR; i++) + for(i=Operator::OperCommutator; i <= Operator::OperNegator; i++) { if(operators[i]) { @@ -316,7 +316,7 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) } } - for(i=Operator::FUNC_OPERATOR; i <= Operator::FUNC_RESTRICT; i++) + for(i=Operator::FuncOperator; i <= Operator::FuncRestrict; i++) { if(functions[i]) { diff --git a/libpgmodeler/src/operator.h b/libpgmodeler/src/operator.h index cad1c68b15..10527aabcf 100644 --- a/libpgmodeler/src/operator.h +++ b/libpgmodeler/src/operator.h @@ -45,13 +45,13 @@ class Operator: public BaseObject { merges; //! \brief Indicates that the operator can execute a merge join public: - static constexpr unsigned FUNC_OPERATOR=0, - FUNC_JOIN=1, - FUNC_RESTRICT=2, - LEFT_ARG=0, - RIGHT_ARG=1, - OPER_COMMUTATOR=0, - OPER_NEGATOR=1; + static constexpr unsigned FuncOperator=0, + FuncJoin=1, + FuncRestrict=2, + LeftArg=0, + RightArg=1, + OperCommutator=0, + OperNegator=1; Operator(void); diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index 8ba0945c24..13e50b681d 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -495,7 +495,7 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ { QFrame *frame=nullptr; map > fields_map; - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion91)].push_back(collation_lbl); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion91)].push_back(collation_lbl); frame=generateVersionWarningFrame(fields_map); baseobject_grid->addWidget(frame, baseobject_grid->count()+1, 0, 1, 0); frame->setParent(this); @@ -519,11 +519,11 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ QString BaseObjectWidget::generateVersionsInterval(unsigned ver_interv_id, const QString &ini_ver, const QString &end_ver) { - if(ver_interv_id==UNTIL_VERSION && !ini_ver.isEmpty()) + if(ver_interv_id==UntilVersion && !ini_ver.isEmpty()) return(XmlParser::CharLt + QString("= ") + ini_ver); - else if(ver_interv_id==VERSIONS_INTERVAL && !ini_ver.isEmpty() && !end_ver.isEmpty()) + else if(ver_interv_id==VersionsInterval && !ini_ver.isEmpty() && !end_ver.isEmpty()) return(XmlParser::CharGt + QString("= ") + ini_ver + XmlParser::CharAmp + XmlParser::CharLt + QString("= ") + end_ver); - else if(ver_interv_id==AFTER_VERSION && !ini_ver.isEmpty()) + else if(ver_interv_id==AfterVersion && !ini_ver.isEmpty()) return(XmlParser::CharGt + QString("= ") + ini_ver); else return(QString()); diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 76be821c76..7429498aae 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -140,9 +140,9 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { public: //! \brief Constants used to generate version intervals for version alert frame - static constexpr unsigned UNTIL_VERSION=0, - VERSIONS_INTERVAL=1, - AFTER_VERSION=2; + static constexpr unsigned UntilVersion=0, + VersionsInterval=1, + AfterVersion=2; BaseObjectWidget(QWidget * parent = nullptr, ObjectType obj_type=ObjectType::BaseObject); diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 68911189f6..29719108ba 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -54,7 +54,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType configureTabOrder({ data_type }); map > fields_map; - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion100)].push_back(identity_rb); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion100)].push_back(identity_rb); highlightVersionSpecificFields(fields_map); connect(sequence_rb, &QRadioButton::clicked, diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 439792668f..7a00efaad8 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -89,8 +89,8 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob constraint_grid->addWidget(info_frm, constraint_grid->count()+1, 0, 1, 0); info_frm->setParent(this); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion92)].push_back(no_inherit_lbl); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_chk); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion92)].push_back(no_inherit_lbl); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion95)].push_back(indexing_chk); values_map[indexing_chk].push_back(~IndexingType(IndexingType::Brin)); warn_frm=generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index 416ad354b6..f46e6a9a21 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -40,7 +40,7 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) element_grid->addWidget(op_class_sel, 4,1,1,2); element_grid->addWidget(operator_sel, 5,1,1,2); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion91)].push_back(collation_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AfterVersion, PgSqlVersions::PgSqlVersion91)].push_back(collation_lbl); warning_frame=BaseObjectWidget::generateVersionWarningFrame(fields_map); element_grid->addWidget(warning_frame, element_grid->count()+1, 0, 1, 3); warning_frame->setParent(this); diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index d646788ba4..303fa8bbf0 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -42,7 +42,7 @@ EventTriggerWidget::EventTriggerWidget(QWidget *parent): BaseObjectWidget(parent configureFormLayout(eventtrigger_grid, ObjectType::EventTrigger); setRequiredField(function_lbl); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(event_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AfterVersion, PgSqlVersions::PgSqlVersion95)].push_back(event_lbl); values_map[event_lbl].push_back(~EventTriggerType(EventTriggerType::TableRewrite)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index 783afda322..e19d174a4e 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -80,7 +80,7 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, Object ret_table_gb->setLayout(grid1); ret_table_gb->setVisible(false); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion92)].push_back(leakproof_chk); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion92)].push_back(leakproof_chk); frame=generateVersionWarningFrame(fields_map, &value_map); grid->addWidget(frame, grid->count()+1, 0, 1, 5); frame->setParent(func_config_twg->widget(0)); @@ -457,7 +457,7 @@ void FunctionWidget::validateConfiguredFunction(void) else if(obj_type==ObjectType::Operator) { oper=dynamic_cast(object); - for(i1=Operator::FUNC_OPERATOR; i1 <= Operator::FUNC_RESTRICT; i1++) + for(i1=Operator::FuncOperator; i1 <= Operator::FuncRestrict; i1++) { if(oper->getFunction(i1)==func) oper->setFunction(func, i1); diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index ca16f7d940..bf821fda24 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -45,8 +45,8 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: IndexingType::getTypes(list); indexing_cmb->addItems(list); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion92)].push_back(buffering_chk); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AfterVersion, PgSqlVersions::PgSqlVersion92)].push_back(buffering_chk); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AfterVersion, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::Brin)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 46f0dd16b1..835f6a00cf 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -62,7 +62,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare this->setLayout(grid); configureFormLayout(grid, ObjectType::OpClass); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AfterVersion, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::Brin)); frame=BaseObjectWidget::generateVersionWarningFrame(fields_map, &values_map); diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index cbc3bc539d..39b0d5d2ea 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -32,7 +32,7 @@ OperatorFamilyWidget::OperatorFamilyWidget(QWidget *parent): BaseObjectWidget(pa indexing_cmb->addItems(types); setRequiredField(indexing_lbl); - fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); + fields_map[BaseObjectWidget::generateVersionsInterval(BaseObjectWidget::AfterVersion, PgSqlVersions::PgSqlVersion95)].push_back(indexing_lbl); values_map[indexing_lbl].push_back(~IndexingType(IndexingType::Brin)); opfamily_grid->addItem(new QSpacerItem(10,10,QSizePolicy::Minimum,QSizePolicy::Expanding), opfamily_grid->count()+1, 0, 1, 0); diff --git a/libpgmodeler_ui/src/operatorwidget.cpp b/libpgmodeler_ui/src/operatorwidget.cpp index a1d17ed10c..d252808a72 100644 --- a/libpgmodeler_ui/src/operatorwidget.cpp +++ b/libpgmodeler_ui/src/operatorwidget.cpp @@ -47,16 +47,16 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, Object grid=dynamic_cast(attributes_twg->widget(1)->layout()); - for(i=Operator::FUNC_OPERATOR; i <= Operator::FUNC_RESTRICT; i++) + for(i=Operator::FuncOperator; i <= Operator::FuncRestrict; i++) { functions_sel[i]=nullptr; functions_sel[i]=new ObjectSelectorWidget(ObjectType::Function, true, this); - if(i!=Operator::FUNC_OPERATOR) + if(i!=Operator::FuncOperator) grid->addWidget(functions_sel[i],i,1,1,1); } - for(i=Operator::OPER_COMMUTATOR, i1=3; i <= Operator::OPER_NEGATOR; i++,i1++) + for(i=Operator::OperCommutator, i1=3; i <= Operator::OperNegator; i++,i1++) { operators_sel[i]=nullptr; operators_sel[i]=new ObjectSelectorWidget(ObjectType::Operator, true, this); @@ -85,10 +85,10 @@ void OperatorWidget::setAttributes(DatabaseModel *model, OperationList *op_list, BaseObjectWidget::setAttributes(model,op_list, oper, schema); - for(i=Operator::FUNC_OPERATOR; i <= Operator::FUNC_RESTRICT; i++) + for(i=Operator::FuncOperator; i <= Operator::FuncRestrict; i++) functions_sel[i]->setModel(model); - for(i=Operator::OPER_COMMUTATOR; i <= Operator::OPER_NEGATOR; i++) + for(i=Operator::OperCommutator; i <= Operator::OperNegator; i++) operators_sel[i]->setModel(model); if(oper) @@ -96,14 +96,14 @@ void OperatorWidget::setAttributes(DatabaseModel *model, OperationList *op_list, hashes_chk->setChecked(oper->isHashes()); merges_chk->setChecked(oper->isMerges()); - for(i=Operator::FUNC_OPERATOR; i <= Operator::FUNC_RESTRICT; i++) + for(i=Operator::FuncOperator; i <= Operator::FuncRestrict; i++) functions_sel[i]->setSelectedObject(oper->getFunction(i)); - for(i=Operator::OPER_COMMUTATOR; i <= Operator::OPER_NEGATOR; i++) + for(i=Operator::OperCommutator; i <= Operator::OperNegator; i++) operators_sel[i]->setSelectedObject(oper->getOperator(i)); - left_type=oper->getArgumentType(Operator::LEFT_ARG); - right_type=oper->getArgumentType(Operator::RIGHT_ARG); + left_type=oper->getArgumentType(Operator::LeftArg); + right_type=oper->getArgumentType(Operator::RightArg); } arg_types[0]->setAttributes(left_type, model); @@ -125,13 +125,13 @@ void OperatorWidget::applyConfiguration(void) oper->setHashes(hashes_chk->isChecked()); oper->setMerges(merges_chk->isChecked()); - for(i=Operator::LEFT_ARG; i <= Operator::RIGHT_ARG; i++) + for(i=Operator::LeftArg; i <= Operator::RightArg; i++) oper->setArgumentType(arg_types[i]->getPgSQLType(), i); - for(i=Operator::FUNC_OPERATOR; i <= Operator::FUNC_RESTRICT; i++) + for(i=Operator::FuncOperator; i <= Operator::FuncRestrict; i++) oper->setFunction(dynamic_cast(functions_sel[i]->getSelectedObject()), i); - for(i=Operator::OPER_COMMUTATOR; i <= Operator::OPER_NEGATOR; i++) + for(i=Operator::OperCommutator; i <= Operator::OperNegator; i++) oper->setOperator(dynamic_cast(operators_sel[i]->getSelectedObject()), i); finishConfiguration(); diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index d256e203f7..e538a8abe2 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -38,8 +38,8 @@ RoleWidget::RoleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ro role_grid->addWidget(frame, role_grid->count()+1, 0, 1, 4); frame->setParent(this); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion91)].push_back(can_replicate_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(bypass_rls_chk); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion91)].push_back(can_replicate_chk); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion95)].push_back(bypass_rls_chk); frame=generateVersionWarningFrame(fields_map); role_grid->addWidget(frame, role_grid->count()+1, 0, 1, 0); frame->setParent(this); diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index 0411cfb30c..db1df0b1c2 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -51,10 +51,10 @@ TableWidget::TableWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: connect(edt_data_tb, SIGNAL(clicked(bool)), this, SLOT(editData())); misc_btns_lt->insertWidget(1, edt_data_tb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion91)].push_back(unlogged_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(enable_rls_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion95)].push_back(force_rls_chk); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion100)].push_back(partitioning_type_lbl); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion91)].push_back(unlogged_chk); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion95)].push_back(enable_rls_chk); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion95)].push_back(force_rls_chk); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion100)].push_back(partitioning_type_lbl); frame=generateVersionWarningFrame(fields_map); table_grid->addWidget(frame, table_grid->count()+1, 0, 1, 2); frame->setParent(this); diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index c11aa07c54..52f6ef1539 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -120,9 +120,9 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Vi tablespace_lbl->setEnabled(false); configureFormLayout(view_grid, ObjectType::View); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(recursive_rb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(materialized_rb); - fields_map[generateVersionsInterval(AFTER_VERSION, PgSqlVersions::PgSqlVersion93)].push_back(with_no_data_chk); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion93)].push_back(recursive_rb); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion93)].push_back(materialized_rb); + fields_map[generateVersionsInterval(AfterVersion, PgSqlVersions::PgSqlVersion93)].push_back(with_no_data_chk); frame=generateVersionWarningFrame(fields_map); view_grid->addWidget(frame, view_grid->count()+1, 0, 1,3); frame->setParent(this); From b3b58b08b521af3a4aa41cd4d1e4bd4d3665f96f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 8 Mar 2019 15:42:25 -0300 Subject: [PATCH 285/425] Minor refactor on schema files --- schemas/alter/collation.sch | 1 - schemas/alter/column.sch | 1 - schemas/alter/database.sch | 1 - schemas/alter/diff.sch | 1 - schemas/alter/domain.sch | 1 - schemas/alter/domconstraint.sch | 1 - schemas/alter/eventtrigger.sch | 1 - schemas/alter/extension.sch | 1 - schemas/alter/function.sch | 1 - schemas/alter/index.sch | 1 - schemas/alter/owner.sch | 1 - schemas/alter/permission.sch | 1 - schemas/alter/policy.sch | 1 - schemas/alter/relationship.sch | 1 - schemas/alter/rename.sch | 1 - schemas/alter/role.sch | 1 - schemas/alter/schema.sch | 1 - schemas/alter/sequence.sch | 3 +-- schemas/alter/table.sch | 1 - schemas/alter/tablespace.sch | 1 - schemas/alter/truncate.sch | 1 - schemas/alter/usertype.sch | 1 - schemas/sql/aggregate.sch | 1 - schemas/sql/cast.sch | 1 - schemas/sql/collation.sch | 1 - schemas/sql/column.sch | 1 - schemas/sql/comment.sch | 1 - schemas/sql/constraint.sch | 1 - schemas/sql/conversion.sch | 1 - schemas/sql/database.sch | 1 - schemas/sql/dbmodel.sch | 1 - schemas/sql/domain.sch | 1 - schemas/sql/domconstraint.sch | 1 - schemas/sql/drop.sch | 1 - schemas/sql/element.sch | 1 - schemas/sql/eventtrigger.sch | 1 - schemas/sql/excelement.sch | 1 - schemas/sql/extension.sch | 1 - schemas/sql/function.sch | 1 - schemas/sql/genericsql.sch | 1 - schemas/sql/idxelement.sch | 1 - schemas/sql/index.sch | 1 - schemas/sql/language.sch | 1 - schemas/sql/opclass.sch | 1 - schemas/sql/operator.sch | 1 - schemas/sql/opfamily.sch | 1 - schemas/sql/parameter.sch | 1 - schemas/sql/partitionkey.sch | 1 - schemas/sql/permission.sch | 1 - schemas/sql/policy.sch | 1 - schemas/sql/relationship.sch | 1 - schemas/sql/role.sch | 1 - schemas/sql/rule.sch | 1 - schemas/sql/schema.sch | 1 - schemas/sql/sequence.sch | 1 - schemas/sql/table.sch | 1 - schemas/sql/tablespace.sch | 1 - schemas/sql/trigger.sch | 1 - schemas/sql/typeattribute.sch | 1 - schemas/sql/usertype.sch | 1 - schemas/sql/view.sch | 1 - 61 files changed, 1 insertion(+), 62 deletions(-) diff --git a/schemas/alter/collation.sch b/schemas/alter/collation.sch index 8f62142d6e..4c0a835499 100644 --- a/schemas/alter/collation.sch +++ b/schemas/alter/collation.sch @@ -1,5 +1,4 @@ # SQL definition for collation's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/column.sch b/schemas/alter/column.sch index 5b74ea6cc7..4a81625faa 100644 --- a/schemas/alter/column.sch +++ b/schemas/alter/column.sch @@ -1,5 +1,4 @@ # SQL definition for columns's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/database.sch b/schemas/alter/database.sch index c476f185d1..ef61cd55d0 100644 --- a/schemas/alter/database.sch +++ b/schemas/alter/database.sch @@ -1,5 +1,4 @@ # SQL definition for database's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/diff.sch b/schemas/alter/diff.sch index d0d91af49a..297542ce4e 100644 --- a/schemas/alter/diff.sch +++ b/schemas/alter/diff.sch @@ -1,5 +1,4 @@ # Basic structure for the diff script file generated by diff process -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/domain.sch b/schemas/alter/domain.sch index c65758dc3d..4cabe3448f 100644 --- a/schemas/alter/domain.sch +++ b/schemas/alter/domain.sch @@ -1,5 +1,4 @@ # SQL definition for domain's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/domconstraint.sch b/schemas/alter/domconstraint.sch index 74145e32ff..abaaed0f64 100644 --- a/schemas/alter/domconstraint.sch +++ b/schemas/alter/domconstraint.sch @@ -1,5 +1,4 @@ # SQL definition for domain's constraints change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/eventtrigger.sch b/schemas/alter/eventtrigger.sch index 8e27434190..f7096fe611 100644 --- a/schemas/alter/eventtrigger.sch +++ b/schemas/alter/eventtrigger.sch @@ -1,5 +1,4 @@ # SQL definition for event trigger's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/extension.sch b/schemas/alter/extension.sch index 921f52f8ea..5aebe0e6c4 100644 --- a/schemas/alter/extension.sch +++ b/schemas/alter/extension.sch @@ -1,5 +1,4 @@ # SQL definition for extension's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/function.sch b/schemas/alter/function.sch index d51abaa23b..1518de3c4c 100644 --- a/schemas/alter/function.sch +++ b/schemas/alter/function.sch @@ -1,5 +1,4 @@ # SQL definition for function's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/index.sch b/schemas/alter/index.sch index dd64d15e89..8ba154afe5 100644 --- a/schemas/alter/index.sch +++ b/schemas/alter/index.sch @@ -1,5 +1,4 @@ # SQL definition for index's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/owner.sch b/schemas/alter/owner.sch index 00f8aa4d98..6eb0717cd9 100644 --- a/schemas/alter/owner.sch +++ b/schemas/alter/owner.sch @@ -1,5 +1,4 @@ # SQL definition for object's owner attribute change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/permission.sch b/schemas/alter/permission.sch index dcc4650176..dc73c85559 100644 --- a/schemas/alter/permission.sch +++ b/schemas/alter/permission.sch @@ -1,5 +1,4 @@ # SQL definition for permissions change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/policy.sch b/schemas/alter/policy.sch index 66d9f1107c..f636715bac 100644 --- a/schemas/alter/policy.sch +++ b/schemas/alter/policy.sch @@ -1,5 +1,4 @@ # SQL definition for policy's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/relationship.sch b/schemas/alter/relationship.sch index f3ab423f9d..799de44393 100644 --- a/schemas/alter/relationship.sch +++ b/schemas/alter/relationship.sch @@ -1,5 +1,4 @@ # SQL definition for table inheritance configuration -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/rename.sch b/schemas/alter/rename.sch index 4e6f1a5055..e20b155542 100644 --- a/schemas/alter/rename.sch +++ b/schemas/alter/rename.sch @@ -1,5 +1,4 @@ # SQL definition for object renaming -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/role.sch b/schemas/alter/role.sch index 33ed88e867..fd47303672 100644 --- a/schemas/alter/role.sch +++ b/schemas/alter/role.sch @@ -1,5 +1,4 @@ # SQL definition for role's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/schema.sch b/schemas/alter/schema.sch index f470eb0c18..2391647c8f 100644 --- a/schemas/alter/schema.sch +++ b/schemas/alter/schema.sch @@ -1,5 +1,4 @@ # SQL definition for object's schema attribute change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/sequence.sch b/schemas/alter/sequence.sch index a6729a63a0..35083b7d7b 100644 --- a/schemas/alter/sequence.sch +++ b/schemas/alter/sequence.sch @@ -1,5 +1,4 @@ # SQL definition for sequence's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. @@ -52,4 +51,4 @@ %end [-- ddl-end --] $br -%end \ No newline at end of file +%end diff --git a/schemas/alter/table.sch b/schemas/alter/table.sch index 5d28bd1e07..0ceff39d4b 100644 --- a/schemas/alter/table.sch +++ b/schemas/alter/table.sch @@ -1,5 +1,4 @@ # SQL definition for table's attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/tablespace.sch b/schemas/alter/tablespace.sch index 3cc84b0f62..e04fce7433 100644 --- a/schemas/alter/tablespace.sch +++ b/schemas/alter/tablespace.sch @@ -1,5 +1,4 @@ # SQL definition for object's tablespace attribute change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/truncate.sch b/schemas/alter/truncate.sch index 39a822b513..96b18d5f88 100644 --- a/schemas/alter/truncate.sch +++ b/schemas/alter/truncate.sch @@ -1,5 +1,4 @@ # SQL definition for trucate tables -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/alter/usertype.sch b/schemas/alter/usertype.sch index 8a33d348f9..46fd268ae1 100644 --- a/schemas/alter/usertype.sch +++ b/schemas/alter/usertype.sch @@ -1,5 +1,4 @@ # SQL definition for user defined types' attributes change -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/aggregate.sch b/schemas/sql/aggregate.sch index e09d50c723..1cdfabc9d6 100644 --- a/schemas/sql/aggregate.sch +++ b/schemas/sql/aggregate.sch @@ -1,5 +1,4 @@ # SQL definition for aggregate functions -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/cast.sch b/schemas/sql/cast.sch index dc58b061b1..93473b6774 100644 --- a/schemas/sql/cast.sch +++ b/schemas/sql/cast.sch @@ -1,5 +1,4 @@ # SQL definition for type casts -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/collation.sch b/schemas/sql/collation.sch index be15a801b9..7f84ea9110 100644 --- a/schemas/sql/collation.sch +++ b/schemas/sql/collation.sch @@ -1,5 +1,4 @@ # SQL definition for collations -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/column.sch b/schemas/sql/column.sch index dc179e6352..a9e2f8dd6e 100644 --- a/schemas/sql/column.sch +++ b/schemas/sql/column.sch @@ -1,5 +1,4 @@ # SQL definition for columns -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/comment.sch b/schemas/sql/comment.sch index 7aea1c7bea..e6f653ef4f 100644 --- a/schemas/sql/comment.sch +++ b/schemas/sql/comment.sch @@ -1,5 +1,4 @@ # SQL definition for comments -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/constraint.sch b/schemas/sql/constraint.sch index 4e99b50e62..af3fc24101 100644 --- a/schemas/sql/constraint.sch +++ b/schemas/sql/constraint.sch @@ -1,5 +1,4 @@ # SQL definition for constraints -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. %if {decl-in-table} %then diff --git a/schemas/sql/conversion.sch b/schemas/sql/conversion.sch index 0d8d064325..40eb07f226 100644 --- a/schemas/sql/conversion.sch +++ b/schemas/sql/conversion.sch @@ -1,5 +1,4 @@ # SQL definition for encoding conversions -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. [-- object: ] {name} [ | type: ] {sql-object} [ --] $br diff --git a/schemas/sql/database.sch b/schemas/sql/database.sch index deee7dfe15..2ba717302b 100644 --- a/schemas/sql/database.sch +++ b/schemas/sql/database.sch @@ -1,5 +1,4 @@ # SQL definition for databases -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/dbmodel.sch b/schemas/sql/dbmodel.sch index 4642eecdb9..a7d1b13860 100644 --- a/schemas/sql/dbmodel.sch +++ b/schemas/sql/dbmodel.sch @@ -1,5 +1,4 @@ # SQL definition for database model -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/domain.sch b/schemas/sql/domain.sch index d9d4857674..dc08d42a77 100644 --- a/schemas/sql/domain.sch +++ b/schemas/sql/domain.sch @@ -1,5 +1,4 @@ # SQL definition for domains -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/domconstraint.sch b/schemas/sql/domconstraint.sch index 47f67bc7d8..f96c599e87 100644 --- a/schemas/sql/domconstraint.sch +++ b/schemas/sql/domconstraint.sch @@ -1,5 +1,4 @@ # SQL definition for domain's check constraint -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/drop.sch b/schemas/sql/drop.sch index 18ba224b99..becfd741d8 100644 --- a/schemas/sql/drop.sch +++ b/schemas/sql/drop.sch @@ -1,5 +1,4 @@ # SQL command to drop an object -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/element.sch b/schemas/sql/element.sch index 9f708f5156..36a8b7b8c6 100644 --- a/schemas/sql/element.sch +++ b/schemas/sql/element.sch @@ -1,5 +1,4 @@ # SQL definition for operator class elements -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. %if {function} %then diff --git a/schemas/sql/eventtrigger.sch b/schemas/sql/eventtrigger.sch index 75d936f1de..643f4f7eb3 100644 --- a/schemas/sql/eventtrigger.sch +++ b/schemas/sql/eventtrigger.sch @@ -1,5 +1,4 @@ # SQL definition for event triggers -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/excelement.sch b/schemas/sql/excelement.sch index b7f0778d5e..5db94ba2f9 100644 --- a/schemas/sql/excelement.sch +++ b/schemas/sql/excelement.sch @@ -1,5 +1,4 @@ # SQL definition for exclude constraints elements -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. $br $tb $sp $sp diff --git a/schemas/sql/extension.sch b/schemas/sql/extension.sch index 845c7eacd7..1e52d1e769 100644 --- a/schemas/sql/extension.sch +++ b/schemas/sql/extension.sch @@ -1,5 +1,4 @@ # SQL definition for extensions -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/function.sch b/schemas/sql/function.sch index 2c96924ab3..d558e9e108 100644 --- a/schemas/sql/function.sch +++ b/schemas/sql/function.sch @@ -1,5 +1,4 @@ # SQL definition for functions -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. [-- object: ] {name} [ | type: ] {sql-object} [ --] $br diff --git a/schemas/sql/genericsql.sch b/schemas/sql/genericsql.sch index 748a4b62de..bd1a12c24b 100644 --- a/schemas/sql/genericsql.sch +++ b/schemas/sql/genericsql.sch @@ -1,5 +1,4 @@ # SQL definition for generic sql objects -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/idxelement.sch b/schemas/sql/idxelement.sch index 2616540bc6..b51232cf96 100644 --- a/schemas/sql/idxelement.sch +++ b/schemas/sql/idxelement.sch @@ -1,5 +1,4 @@ # SQL definition for index elements -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. $br $tb $sp $sp diff --git a/schemas/sql/index.sch b/schemas/sql/index.sch index ddc673b658..aab06a9e5d 100644 --- a/schemas/sql/index.sch +++ b/schemas/sql/index.sch @@ -1,5 +1,4 @@ # SQL definition for indexes -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/language.sch b/schemas/sql/language.sch index dab7447c42..a61bbb534b 100644 --- a/schemas/sql/language.sch +++ b/schemas/sql/language.sch @@ -1,5 +1,4 @@ # SQL definition for procedural languages -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/opclass.sch b/schemas/sql/opclass.sch index aee3a856a4..12c9b7c0f7 100644 --- a/schemas/sql/opclass.sch +++ b/schemas/sql/opclass.sch @@ -1,5 +1,4 @@ # SQL definition for operator classes -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/operator.sch b/schemas/sql/operator.sch index 2f6eb3a84f..6213d6169c 100644 --- a/schemas/sql/operator.sch +++ b/schemas/sql/operator.sch @@ -1,5 +1,4 @@ # SQL definition for operators -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/opfamily.sch b/schemas/sql/opfamily.sch index 2edd8e3065..6046c21b26 100644 --- a/schemas/sql/opfamily.sch +++ b/schemas/sql/opfamily.sch @@ -1,5 +1,4 @@ # SQL definition for operator family -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/parameter.sch b/schemas/sql/parameter.sch index 4681fdcd01..4c5881e413 100644 --- a/schemas/sql/parameter.sch +++ b/schemas/sql/parameter.sch @@ -1,5 +1,4 @@ # SQL definition for function parameters -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/partitionkey.sch b/schemas/sql/partitionkey.sch index 370ecd144c..9016651918 100644 --- a/schemas/sql/partitionkey.sch +++ b/schemas/sql/partitionkey.sch @@ -1,5 +1,4 @@ # SQL definition for partition key elements -# PostgreSQL Version: 10.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/permission.sch b/schemas/sql/permission.sch index a4c456736b..98649d960c 100644 --- a/schemas/sql/permission.sch +++ b/schemas/sql/permission.sch @@ -1,5 +1,4 @@ # SQL definition for permissions on objects -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/policy.sch b/schemas/sql/policy.sch index 4856c44fdf..aa5e477f1d 100644 --- a/schemas/sql/policy.sch +++ b/schemas/sql/policy.sch @@ -1,5 +1,4 @@ # SQL definition for policy -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/relationship.sch b/schemas/sql/relationship.sch index 2841ae5cee..329322bfd2 100644 --- a/schemas/sql/relationship.sch +++ b/schemas/sql/relationship.sch @@ -1,5 +1,4 @@ # SQL definition for relationships -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/role.sch b/schemas/sql/role.sch index d73d511c5e..99afc85013 100644 --- a/schemas/sql/role.sch +++ b/schemas/sql/role.sch @@ -1,5 +1,4 @@ # SQL definition for type roles -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/rule.sch b/schemas/sql/rule.sch index 0ea1bef2f4..c6f40f28a2 100644 --- a/schemas/sql/rule.sch +++ b/schemas/sql/rule.sch @@ -1,5 +1,4 @@ # SQL definition for rules -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/schema.sch b/schemas/sql/schema.sch index f76cbee720..d21d282463 100644 --- a/schemas/sql/schema.sch +++ b/schemas/sql/schema.sch @@ -1,5 +1,4 @@ # SQL definition for schemas -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/sequence.sch b/schemas/sql/sequence.sch index 32a997fd72..024877de9b 100644 --- a/schemas/sql/sequence.sch +++ b/schemas/sql/sequence.sch @@ -1,5 +1,4 @@ # SQL definition for sequences -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/table.sch b/schemas/sql/table.sch index 70b2c3f4f2..2f2c19fabf 100644 --- a/schemas/sql/table.sch +++ b/schemas/sql/table.sch @@ -1,5 +1,4 @@ # SQL definition for tables -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/tablespace.sch b/schemas/sql/tablespace.sch index b5b56f8a4e..2c1e5970b1 100644 --- a/schemas/sql/tablespace.sch +++ b/schemas/sql/tablespace.sch @@ -1,5 +1,4 @@ # SQL definition for tablespaces -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/trigger.sch b/schemas/sql/trigger.sch index e3c6cb3116..14bc5f2ff1 100644 --- a/schemas/sql/trigger.sch +++ b/schemas/sql/trigger.sch @@ -1,5 +1,4 @@ # SQL definition for triggers -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/typeattribute.sch b/schemas/sql/typeattribute.sch index d5486eeb3d..6e6a344cd5 100644 --- a/schemas/sql/typeattribute.sch +++ b/schemas/sql/typeattribute.sch @@ -1,5 +1,4 @@ # SQL definition for user defined type attributes -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. [ ] {name} $sp {type} diff --git a/schemas/sql/usertype.sch b/schemas/sql/usertype.sch index dc24feb500..73d8c11ff3 100644 --- a/schemas/sql/usertype.sch +++ b/schemas/sql/usertype.sch @@ -1,5 +1,4 @@ # SQL definition for user defined types -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/view.sch b/schemas/sql/view.sch index 336c75a14f..8771b07a58 100644 --- a/schemas/sql/view.sch +++ b/schemas/sql/view.sch @@ -1,5 +1,4 @@ # SQL definition for views -# PostgreSQL Version: 9.x # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. From 75dcc3082735a72619223e8847709e378e3a5b51 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 8 Mar 2019 15:42:43 -0300 Subject: [PATCH 286/425] Adding a test case for foreign data wrappers --- schemas/sql/foreigndatawrapper.sch | 47 +++++++++++++++++++ .../foreigndatawrappertest.cpp | 42 +++++++++++++++++ .../foreigndatawrappertest.pro | 2 + tests/tests.pro | 4 +- 4 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 schemas/sql/foreigndatawrapper.sch create mode 100644 tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp create mode 100644 tests/src/foreigndatawrappertest/foreigndatawrappertest.pro diff --git a/schemas/sql/foreigndatawrapper.sch b/schemas/sql/foreigndatawrapper.sch new file mode 100644 index 0000000000..44b0a30ebd --- /dev/null +++ b/schemas/sql/foreigndatawrapper.sch @@ -0,0 +1,47 @@ +# SQL definition for foreign data wrappers +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. +[-- object: ] {name} [ | type: ] {sql-object} [ --] $br + +[-- ] {drop} + +%if {prepended-sql} %then + {prepended-sql} + $br [-- ddl-end --] $br $br +%end + +[CREATE ] {sql-object} $sp {name} + +$br $tb + +%if %not {handler_func} %then + [NO HANDLER] +%else + [HANDLER ] {handler_func} +%endif + +$br $tb + +%if %not {validator_func} %then + [NO VALIDATOR] +%else + [VALIDATOR ] {validator_func} +%endif + +%if {options} %then + $br $tb [OPTIONS (] {options} ) +%endif + +# This is a special token that pgModeler recognizes as end of DDL command +# when exporting models directly to DBMS. DO NOT REMOVE THIS TOKEN! +$br [-- ddl-end --] $br + +%if {comment} %then {comment} %end +%if {owner} %then {owner} %end + +%if {appended-sql} %then + {appended-sql} + $br [-- ddl-end --] $br +%end + +$br diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp new file mode 100644 index 0000000000..926493358b --- /dev/null +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -0,0 +1,42 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include +#include "foreigndatawrapper.h" + +class ForeignDataWrapperTest: public QObject { + private: + Q_OBJECT + + private slots: + void assignInvalidFunctionRaisesException(void); + void codeGeneratedIsWellFormed(void); +}; + +void ForeignDataWrapperTest::assignInvalidFunctionRaisesException(void) +{ + QCOMPARE(true, true); +} + +void ForeignDataWrapperTest::codeGeneratedIsWellFormed(void) +{ + QCOMPARE(true, true); +} + +QTEST_MAIN(ForeignDataWrapperTest) +#include "foreigndatawrappertest.moc" diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.pro b/tests/src/foreigndatawrappertest/foreigndatawrappertest.pro new file mode 100644 index 0000000000..279537eb88 --- /dev/null +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.pro @@ -0,0 +1,2 @@ +include(../../tests.pri) +SOURCES += foreigndatawrappertest.cpp diff --git a/tests/tests.pro b/tests/tests.pro index a3d827eca2..9cb04ca63e 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -14,5 +14,7 @@ src/syntaxhighlightertest \ src/databasemodeltest \ src/schemaparsertest \ src/linenumberstest \ -src/partrelationshiptest +src/partrelationshiptest \ +src/foreigndatawrappertest + From 3cb62cdd62c9970048b521fba9511f3ce9afe2a6 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 8 Mar 2019 16:53:25 -0300 Subject: [PATCH 287/425] Fixed a bug in CLI that was failing to fix model in certain cases --- main-cli/src/pgmodelercli.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 836f1ac9b4..68b519dd5f 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -637,15 +637,15 @@ void PgModelerCli::handleObjectAddition(BaseObject *object) case ObjectType::Relationship: case ObjectType::BaseRelationship: - item=new RelationshipView(dynamic_cast(graph_obj)); break; + item=new RelationshipView(dynamic_cast(graph_obj)); break; case ObjectType::Schema: - item=new SchemaView(dynamic_cast(graph_obj)); break; + item=new SchemaView(dynamic_cast(graph_obj)); break; default: - item=new StyledTextboxView(dynamic_cast(graph_obj)); break; + item=new StyledTextboxView(dynamic_cast(graph_obj)); break; } @@ -737,7 +737,17 @@ void PgModelerCli::extractObjectXML(void) //Remove the header entry from buffer buf.remove(start, regexp.matchedLength()+1); - buf.remove(0, buf.indexOf(QString("<%1").arg(Attributes::Database))); + + //Checking if the header ends on a role declaration + end = buf.indexOf(QString("<%1").arg(Attributes::Role)); + + // If we found role declarations we clear the header until there + if(end >= 0) + buf.remove(0, end); + else + // Instead, we clear the header until the starting of database declaration + buf.remove(0, buf.indexOf(QString("<%1").arg(Attributes::Database))); + buf.remove(QString("<\\%1>").arg(Attributes::DbModel)); ts.setString(&buf); @@ -1060,7 +1070,7 @@ void PgModelerCli::fixObjectAttributes(QString &obj_xml) //Replacing attribute owner by onwer-col for sequences if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Sequence)))) - obj_xml.replace(Attributes::Owner, Attributes::OwnerColumn); + obj_xml.replace(QRegExp(QString("(%1)( )*(=)(\")").arg(Attributes::Owner)), QString("%1 = \"").arg(Attributes::OwnerColumn)); //Remove sysid attribute from tags. if(obj_xml.contains(TagExpr.arg(BaseObject::getSchemaName(ObjectType::Role)))) From f235d6abfddf05bd7bee94b091825e3ceafcb150 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 12 Mar 2019 07:49:33 -0300 Subject: [PATCH 288/425] Fixed a crash when a query executed in SQLExecutionWidget was a DDL one or was not returning results. --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 298f04c9f3..b04bb4029a 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -406,7 +406,7 @@ void SQLExecutionWidget::finishExecution(int rows_affected) columns_cmb->blockSignals(true); columns_cmb->clear(); - for(int col = 0; col < res_model->columnCount(QModelIndex()); col++) + for(int col = 0; res_model && col < res_model->columnCount(QModelIndex()); col++) columns_cmb->addItem(res_model->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString()); columns_cmb->blockSignals(false); From a512a83f2e8648daa79101a39b9955c6ff0f19d5 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 12 Mar 2019 17:40:19 -0300 Subject: [PATCH 289/425] Adding the ability to view references to store referenced tables This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this commit, a relationship is created between the view and all involved tables. Pending only the UI to allow the user to specify its desired referenced tables on ReferenceWidget --- libparsers/src/attributes.cpp | 2 + libparsers/src/attributes.h | 2 + libpgmodeler/src/databasemodel.cpp | 57 ++++++--- libpgmodeler/src/reference.cpp | 46 ++++++- libpgmodeler/src/reference.h | 11 +- libpgmodeler/src/view.cpp | 9 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 9 ++ libpgmodeler_ui/src/databaseimporthelper.h | 2 +- libutils/src/exception.cpp | 8 +- schemas/catalog/view.sch | 128 +++++++++++-------- schemas/xml/dtd/view.dtd | 6 +- schemas/xml/reference.sch | 3 +- schemas/xml/reftable.sch | 5 + 13 files changed, 203 insertions(+), 85 deletions(-) create mode 100644 schemas/xml/reftable.sch diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index eb7cc69fe2..36c6b9c34f 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -421,6 +421,8 @@ namespace Attributes { RefColumn=QString("ref-column"), RefRoles=QString("ref-roles"), RefTable=QString("ref-table"), + RefTables=QString("ref-tables"), + RefTableTag=QString("reftable"), RefType=QString("ref-type"), Refer=QString("refer"), Reference=QString("reference"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 33fe0b14d8..91179b286b 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -433,6 +433,8 @@ namespace Attributes { RefColumn, RefRoles, RefTable, + RefTables, + RefTableTag, RefType, Refer, Reference, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 6ca7df9e52..595cc4b3da 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1214,15 +1214,17 @@ void DatabaseModel::updateTablesFKRelationships(void) void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) { - Table *tab=nullptr; + Table *table=nullptr; BaseRelationship *rel=nullptr; Reference ref; unsigned i, ref_count, idx; vector::iterator itr, itr_end; + vector tables; if(!view) throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(getObjectIndex(view) < 0 || force_rel_removal) + + if(getObjectIndex(view) < 0 || force_rel_removal) { //Remove all the relationship related to the view when this latter no longer exists itr=base_relationships.begin(); @@ -1262,11 +1264,11 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) rel->getTable(BaseRelationship::DstTable)==view) { if(rel->getTable(BaseRelationship::SrcTable)->getObjectType()==ObjectType::Table) - tab=dynamic_cast
(rel->getTable(BaseRelationship::SrcTable)); + table=dynamic_cast
(rel->getTable(BaseRelationship::SrcTable)); else - tab=dynamic_cast
(rel->getTable(BaseRelationship::DstTable)); + table=dynamic_cast
(rel->getTable(BaseRelationship::DstTable)); - if(!view->isReferencingTable(tab)) + if(!view->isReferencingTable(table)) { removeRelationship(rel); itr=base_relationships.begin() + idx; @@ -1283,16 +1285,27 @@ void DatabaseModel::updateViewRelationships(View *view, bool force_rel_removal) } } - //Creates the relationships from the view references + /* Creates the relationships from the view references + * First we try to create relationship from referecences in SELECT portion of view's definition */ ref_count=view->getReferenceCount(Reference::SqlReferSelect); - for(i=0; i < ref_count; i++) { - ref = view->getReference(i, Reference::SqlReferSelect); - tab = ref.getTable(); + table = view->getReference(i, Reference::SqlReferSelect).getTable(); + if(table) tables.push_back(table); + } + + /* If the view does have tables referenced from SELECT portion we check if + * the table was constructed from a single reference (Reference::SqlViewDefinition). In + * that case we use the list of referenced tables configured in that view reference object */ + if(tables.empty() && view->getReferenceCount(Reference::SqlViewDefinition) > 0) + tables = view->getReference(0, Reference::SqlViewDefinition).getReferencedTables(); + + // Effectively creating the relationships + for(auto &tab : tables) + { + rel = getRelationship(view, tab); - rel=getRelationship(view,tab); - if(tab && !rel) + if(!rel) { rel=new BaseRelationship(BaseRelationship::RelationshipDep, view, tab, false, false); rel->setName(PgModelerNs::generateUniqueName(rel, base_relationships)); @@ -6008,21 +6021,31 @@ View *DatabaseModel::createView(void) xmlparser.accessElement(XmlParser::ChildElement); xmlparser.savePosition(); xmlparser.accessElement(XmlParser::ChildElement); - reference = Reference(xmlparser.getElementContent(),str_aux); + reference = Reference(xmlparser.getElementContent(), str_aux); reference.setReferenceAlias(attribs[Attributes::RefAlias]); xmlparser.restorePosition(); // Creating the columns related to the expression if(xmlparser.accessElement(XmlParser::NextElement)) { - elem = xmlparser.getElementName(); - do { + elem = xmlparser.getElementName(); xmlparser.savePosition(); - column = createColumn(); - reference.addColumn(column); - delete(column); + + if(elem == Attributes::Column) + { + column = createColumn(); + reference.addColumn(column); + delete(column); + } + else if(elem == Attributes::RefTableTag) + { + xmlparser.getElementAttributes(aux_attribs); + table = getTable(aux_attribs[Attributes::Name]); + reference.addReferencedTable(table); + } + xmlparser.restorePosition(); } while(xmlparser.accessElement(XmlParser::NextElement)); diff --git a/libpgmodeler/src/reference.cpp b/libpgmodeler/src/reference.cpp index 9a4afd6a96..f8ae695d36 100644 --- a/libpgmodeler/src/reference.cpp +++ b/libpgmodeler/src/reference.cpp @@ -65,7 +65,38 @@ Reference::Reference(const QString &expression, const QString &expr_alias) void Reference::setDefinitionExpression(bool value) { - is_def_expr=value; + is_def_expr = value; + if(!value) clearReferencedTables(); +} + +void Reference::addReferencedTable(Table *ref_table) +{ + if(!ref_table) + return; + + if(std::find(ref_tables.begin(), ref_tables.end(), ref_table) == ref_tables.end()) + ref_tables.push_back(ref_table); +} + +int Reference::getReferencedTableIndex(Table *ref_table) +{ + int idx = -1; + vector
::iterator itr = std::find(ref_tables.begin(), ref_tables.end(), ref_table); + + if(itr != ref_tables.end()) + idx = itr - ref_tables.begin(); + + return(idx); +} + +void Reference::clearReferencedTables(void) +{ + ref_tables.clear(); +} + +vector
Reference::getReferencedTables(void) +{ + return(ref_tables); } bool Reference::isDefinitionExpression(void) @@ -264,9 +295,10 @@ QString Reference::getSQLDefinition(unsigned sql_type) QString Reference::getXMLDefinition(void) { - attribs_map attribs; + attribs_map attribs, aux_attribs; SchemaParser schparser; Column col_aux; + QStringList ref_tab_names; attribs[Attributes::Table]=QString(); attribs[Attributes::Column]=QString(); @@ -282,6 +314,7 @@ QString Reference::getXMLDefinition(void) attribs[Attributes::Alias]=alias; attribs[Attributes::ColumnAlias]=column_alias; attribs[Attributes::Columns]=QString(); + attribs[Attributes::RefTables]=QString(); for(auto &col : columns) { @@ -291,6 +324,15 @@ QString Reference::getXMLDefinition(void) attribs[Attributes::Columns]+=col_aux.getCodeDefinition(SchemaParser::XmlDefinition); } + if(is_def_expr) + { + for(auto &tab : ref_tables) + { + aux_attribs[Attributes::Name] = tab->getSignature(); + attribs[Attributes::RefTables] += schparser.getCodeDefinition(Attributes::RefTableTag, aux_attribs, SchemaParser::XmlDefinition); + } + } + return(schparser.getCodeDefinition(Attributes::Reference, attribs, SchemaParser::XmlDefinition)); } diff --git a/libpgmodeler/src/reference.h b/libpgmodeler/src/reference.h index 5753441d2f..b388f77813 100644 --- a/libpgmodeler/src/reference.h +++ b/libpgmodeler/src/reference.h @@ -60,12 +60,16 @@ class Reference { //! \brief Indicates if the expression is used as entire view definition bool is_def_expr; - /*! \brief Stores the columns that the reference (when being an expression) generates. + /*! \brief Stores the columns that the reference (when being an expression [is_def_expr]) generates. * These columns are used when drawing a view and that has only on definition expression. * By having columns, instead of drawing the expression as a column of the view, the ones in * this vector are displayed */ vector columns; + /*! \brief Stores the tables that the reference object is using within the expression which defines the view + * when is_def_expr is set. These tables are used to hint the user which tables the view is using. */ + vector
ref_tables; + public: //! \brief Constants used to define the reference type static constexpr unsigned ReferColumn=0, //! \brief The reference is based on a table column @@ -90,6 +94,11 @@ class Reference { reference to be used as the entire view SQL definition */ void setDefinitionExpression(bool value); + void addReferencedTable(Table *ref_table); + int getReferencedTableIndex(Table *ref_table); + void clearReferencedTables(void); + vector
getReferencedTables(void); + //! \brief Gets the referenced table Table *getTable(void); diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index e83a4fa4c6..7b6b7a026d 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -596,8 +596,13 @@ bool View::isReferencingTable(Table *tab) for(i=0; i < count && !found; i++) { - aux_tab=references[i].getTable(); - found=(aux_tab && (aux_tab == tab)); + if(references[i].isDefinitionExpression()) + found = references[i].getReferencedTableIndex(tab); + else + { + aux_tab = references[i].getTable(); + found = (aux_tab && (aux_tab == tab)); + } } return(found); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index d1fe540311..01e23c1116 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1872,6 +1872,8 @@ void DatabaseImportHelper::createView(attribs_map &attribs) unsigned type_oid = 0; QString type_name, type_def, unknown_obj_xml, sch_name; bool is_type_registered = false; + QStringList ref_tab_oids; + Table *ref_tab = nullptr; try { @@ -1939,6 +1941,13 @@ void DatabaseImportHelper::createView(attribs_map &attribs) ref.addColumn(&col); } + // Configuring the reference tables + for(auto &tab_oid : Catalog::parseArrayValues(attribs[Attributes::RefTables])) + { + ref_tab = dbmodel->getTable(getDependencyObject(tab_oid, ObjectType::Table, true, true, false)); + ref.addReferencedTable(ref_tab); + } + attribs[Attributes::References]=ref.getXMLDefinition(); loadObjectXML(ObjectType::View, attribs); diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 8171caa796..36738fddd3 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -214,7 +214,7 @@ class DatabaseImportHelper: public QObject { QStringList parseIndexExpressions(const QString &expr); public: - DatabaseImportHelper(QObject *parent=0); + DatabaseImportHelper(QObject *parent = nullptr); //! \brief Set the connection used to access the PostgreSQL server void setConnection(Connection &conn); diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index ac9c1f2727..f26f992e75 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -70,7 +70,7 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"InvInheritCopyPartRelationship", QT_TR_NOOP("It's not possible to create a self generalization/copy/partition relationship! The table can not inherit or copy its own attributes or be a partition of itself!")}, {"AsgObjectBelongsAnotherTable", QT_TR_NOOP("Assignment of an object that already belongs to another table!")}, {"AsgSchemaSequenceDiffersTableSchema", QT_TR_NOOP("Assignment of a schema to the sequence which differs from the schema of the owner table!")}, - {"//AsgInvalidValueSequenceAttributes", QT_TR_NOOP("Assignment of an invalid value to one of the sequence attributes!")}, + {"AsgInvalidValueSequenceAttributes", QT_TR_NOOP("Assignment of an invalid value to one of the sequence attributes!")}, {"AsgInvalidSequenceMinValue", QT_TR_NOOP("Assignment of a minimum value to the sequence which is greater than the maximum value!")}, {"AsgInvalidSequenceStartValue", QT_TR_NOOP("Assignment of a start value to the sequence which is extrapolating the range defined by minimum and maximum values!")}, {"AsgInvalidSequenceIncrementValue", QT_TR_NOOP("Assignment of a null increment value to the sequence!")}, @@ -163,7 +163,7 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"InvConstratintNoColumns", QT_TR_NOOP("Constraints like primary key, foreign key or unique must have at least one column related to them! For foreign keys must be selected, in addition, the referenced columns!")}, {"ConfigurationNotLoaded", QT_TR_NOOP("Unable to load the configuration file `%1'! Please check if file exists in its folder and/or if it is not corrupted!")}, {"DefaultConfigNotRestored", QT_TR_NOOP("Could not find the default settings file `%1'! To restore default settings check the existence of the file and try again!")}, - {"//ExportFailure", QT_TR_NOOP("The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack!\n\n** Executed SQL command: **\n\n%1")}, + {"ExportFailure", QT_TR_NOOP("The export process failed due to an error triggered by the PostgreSQL server in an attempt to execute a SQL command. For more details about the error check the exception stack!\n\n** Executed SQL command: **\n\n%1")}, {"PluginNotLoaded", QT_TR_NOOP("Could not load the plugin `%1' from the library `%2'! Message returned by plugin manager: `%3'")}, {"PluginsNotLoaded", QT_TR_NOOP("One or more plugins were not activated due to errors during the loading process! Check the exception stack for more details.")}, {"InvalidSyntax", QT_TR_NOOP("Invalid syntax in file `%1', line %2, column %3!")}, @@ -218,7 +218,7 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"RefInvalidFunctionIdTypeConfig", QT_TR_NOOP("Reference to a function id which is incompatible with the user define type configuration!")}, {"AsgInvalidOpClassObject", QT_TR_NOOP("The operator class assigned to the object `%1' (%2) must use `btree' as indexing method!")}, {"InvPostgreSQLVersion", QT_TR_NOOP("Unsupported PostgreSQL version (%1) detected! Valid versions are between %2 and %3.")}, - {"//ValidationFailure", QT_TR_NOOP("The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack!")}, + {"ValidationFailure", QT_TR_NOOP("The validation process failed due to an error triggered by the validation helper. For more details about the error check the exception stack!")}, {"ExtensionHandlingTypeImmutable", QT_TR_NOOP("The extension `%1' is registered as a data type and cannot have the attribute `handles datatype' modified!")}, {"InvAllocationFKRelationship", QT_TR_NOOP("The fk relationship `%1' cannot be created because the foreign-key that represents it was not created on table `%2'!")}, {"AsgInvalidNamePattern", QT_TR_NOOP("Assignement of an invalid object name pattern to the relationship `%1'!")}, @@ -259,7 +259,7 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"InvPartitionKeyCount", QT_TR_NOOP("Invalid amount of partition keys being assinged to the table `%1'! Multiples partition keys are allowed only on `HASH' and `RANGE' partitioning strategies.")}, {"PartKeyObjectInexistsModel", QT_TR_NOOP("A partition key of the table `%1' is referencing the object `%3' (%4) which was not found in the model!")}, {"AsgInvalidColumnPartitionKey", QT_TR_NOOP("The column `%1' can't be assigned to a partition key because it was created by a relatinship and this kind of operation is not yet supported! HINT: create the column manually on the table and then create the partition key using it.")}, - {"RemColumnRefByPartitionKey", QT_TR_NOOP("The column `%1' on the table `%2' can't be removed because it is being referenced by one or more patition keys!")}, + {"RemColumnRefByPartitionKey", QT_TR_NOOP("The column `%1' on the table `%2' can't be removed because it is being referenced by one or more patition keys!")} }; Exception::Exception(void) diff --git a/schemas/catalog/view.sch b/schemas/catalog/view.sch index c59a4a9015..af31181cb1 100644 --- a/schemas/catalog/view.sch +++ b/schemas/catalog/view.sch @@ -3,74 +3,90 @@ # Code generation can be broken if incorrect changes are made. %if {list} %then - [SELECT vw.oid, vw.relname AS name FROM pg_class AS vw ] + [SELECT vw.oid, vw.relname AS name FROM pg_class AS vw ] - %if {schema} %then - [ LEFT JOIN pg_namespace AS ns ON ns.oid=vw.relnamespace ] - %end + %if {schema} %then + [ LEFT JOIN pg_namespace AS ns ON ns.oid=vw.relnamespace ] + %end - %if ({pgsql-ver} <=f "9.2") %then - [ WHERE vw.relkind='v'] - %else - [ WHERE vw.relkind IN ('v','m') ] - %end + %if ({pgsql-ver} <=f "9.2") %then + [ WHERE vw.relkind='v'] + %else + [ WHERE vw.relkind IN ('v','m') ] + %end - %if {schema} %then - [ AND ns.nspname= ] '{schema}' - %end - - %if {last-sys-oid} %then - [ AND vw.oid ] {oid-filter-op} $sp {last-sys-oid} - %end + %if {schema} %then + [ AND ns.nspname= ] '{schema}' + %end - %if {not-ext-object} %then - [ AND ] ( {not-ext-object} ) - %end + %if {last-sys-oid} %then + [ AND vw.oid ] {oid-filter-op} $sp {last-sys-oid} + %end + %if {not-ext-object} %then + [ AND ] ( {not-ext-object} ) + %end %else - %if {attribs} %then - [SELECT vw.oid, vw.relname AS name, vw.relnamespace AS schema, vw.relowner AS owner, - vw.reltablespace AS tablespace, - vw.relacl AS permission, pg_get_viewdef(vw.oid) AS definition, ] - - [ CASE - WHEN vw.relkind='m' THEN TRUE - ELSE FALSE - END AS materialized_bool, ] - + %if {attribs} %then + [SELECT vw.oid, vw.relname AS name, vw.relnamespace AS schema, vw.relowner AS owner, + vw.reltablespace AS tablespace, + vw.relacl AS permission, pg_get_viewdef(vw.oid) AS definition, ] + + # Subquery that retrieves the tables that the view refereces + # Extracted from the definition of the relation information_schema.view_table_usage + [(SELECT array_agg(DISTINCT dt.refobjid) + FROM pg_namespace AS nv, + pg_class AS v, + pg_depend AS dv, + pg_depend AS dt, + pg_class AS t, + pg_namespace AS nt + WHERE nv.oid = v.relnamespace AND v.relkind IN ('v','m') + AND v.oid = dv.refobjid AND dv.refclassid = 'pg_class'::regclass::oid + AND dv.classid = 'pg_rewrite'::regclass::oid AND dv.deptype = 'i' + AND dv.objid = dt.objid AND dv.refobjid <> dt.refobjid AND dt.classid = 'pg_rewrite'::regclass::oid + AND dt.refclassid = 'pg_class'::regclass::oid AND dt.refobjid = t.oid + AND t.relnamespace = nt.oid AND t.relkind IN ('r', 'p') + AND v.oid = ] vw.oid [) AS ref_tables, ] + + [ CASE + WHEN vw.relkind='m' THEN TRUE + ELSE FALSE + END AS materialized_bool, ] + + ({comment}) [ AS comment ] - ({comment}) [ AS comment ] - - [ FROM pg_class AS vw - LEFT JOIN pg_namespace AS ns ON ns.oid = vw.relnamespace ] + [ FROM pg_class AS vw + LEFT JOIN pg_namespace AS ns ON ns.oid = vw.relnamespace ] - %if ({pgsql-ver} <=f "9.2") %then - [ WHERE vw.relkind='v'] - %else - [ WHERE vw.relkind IN ('v','m') ] - %end + %if ({pgsql-ver} <=f "9.2") %then + [ WHERE vw.relkind='v'] + %else + [ WHERE vw.relkind IN ('v','m') ] + %end - %if {last-sys-oid} %then - [ AND vw.oid ] {oid-filter-op} $sp {last-sys-oid} - %end + %if {last-sys-oid} %then + [ AND vw.oid ] {oid-filter-op} $sp {last-sys-oid} + %end - %if {not-ext-object} %then - [ AND ] ( {not-ext-object} ) - %end + %if {not-ext-object} %then + [ AND ] ( {not-ext-object} ) + %end - %if {filter-oids} %or {schema} %then - [ AND ] - %if {filter-oids} %then - [ vw.oid IN (] {filter-oids} ) + %if {filter-oids} %or {schema} %then + [ AND ] + + %if {filter-oids} %then + [ vw.oid IN (] {filter-oids} ) - %if {schema} %then - [ AND ] - %end - %end + %if {schema} %then + [ AND ] + %end + %end - %if {schema} %then - [ ns.nspname= ] '{schema}' - %end - %end + %if {schema} %then + [ ns.nspname= ] '{schema}' + %end + %end %end %end diff --git a/schemas/xml/dtd/view.dtd b/schemas/xml/dtd/view.dtd index 6009bf8be0..8ffbdbbdeb 100644 --- a/schemas/xml/dtd/view.dtd +++ b/schemas/xml/dtd/view.dtd @@ -18,9 +18,13 @@ - + + + + + diff --git a/schemas/xml/reference.sch b/schemas/xml/reference.sch index e06e91b913..1f744e02e2 100644 --- a/schemas/xml/reference.sch +++ b/schemas/xml/reference.sch @@ -22,7 +22,8 @@ $tb $br %if {columns} %then {columns} %end - + %if {ref-tables} %then {ref-tables} %end + $tb $br %else /> $br diff --git a/schemas/xml/reftable.sch b/schemas/xml/reftable.sch new file mode 100644 index 0000000000..07519b3fba --- /dev/null +++ b/schemas/xml/reftable.sch @@ -0,0 +1,5 @@ +# XML definition for view references +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +$tb $tb [] $br From ca8c10ae55ab139c11f9c2af1077b2d52732be4c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 12 Mar 2019 22:48:31 -0300 Subject: [PATCH 290/425] Minor fix View::isReferencingTable --- libpgmodeler/src/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 7b6b7a026d..3a722b577c 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -597,7 +597,7 @@ bool View::isReferencingTable(Table *tab) for(i=0; i < count && !found; i++) { if(references[i].isDefinitionExpression()) - found = references[i].getReferencedTableIndex(tab); + found = references[i].getReferencedTableIndex(tab) >= 0; else { aux_tab = references[i].getTable(); From f824d6fecf7416d3542cf85c872cb4e7489c03c1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 13 Mar 2019 10:28:36 -0300 Subject: [PATCH 291/425] Minor fix a bug on index importing --- libpgmodeler_ui/src/databaseimporthelper.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 01e23c1116..d6ccba55fd 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -2052,6 +2052,8 @@ QStringList DatabaseImportHelper::parseIndexExpressions(const QString &expr) if(word.contains('(') && word.contains(')')) expressions.push_back(word.trimmed()); + else + expressions.push_back(word); word.clear(); open_paren = close_paren = 0; From 5179ff2d553418738079e33836a20a6c150b19fe Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 13 Mar 2019 13:45:02 -0300 Subject: [PATCH 292/425] Added the ability to configure referenced tables on ReferenceWidget --- libpgmodeler_ui/src/mainwindow.cpp | 2 + libpgmodeler_ui/src/objectselectorwidget.cpp | 2 + libpgmodeler_ui/src/objectselectorwidget.h | 4 ++ libpgmodeler_ui/src/referencewidget.cpp | 64 ++++++++++++++++++++ libpgmodeler_ui/src/referencewidget.h | 5 +- libpgmodeler_ui/ui/referencewidget.ui | 18 ++++++ 6 files changed, 93 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index deeae60163..99a08465db 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -321,6 +321,8 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par connect(model_valid_wgt, SIGNAL(s_validationInProgress(bool)), obj_finder_wgt, SLOT(setDisabled(bool))); connect(model_valid_wgt, SIGNAL(s_validationInProgress(bool)), models_tbw, SLOT(setDisabled(bool))); connect(model_valid_wgt, SIGNAL(s_validationInProgress(bool)), this, SLOT(stopTimers(bool))); + connect(model_valid_wgt, SIGNAL(s_validationInProgress(bool)), layers_btn, SLOT(setDisabled(bool))); + connect(model_valid_wgt, SIGNAL(s_validationInProgress(bool)), layers_wgt, SLOT(close())); connect(model_valid_wgt, &ModelValidationWidget::s_validationCanceled, [&](){ pending_op=NoPendingOp; }); connect(model_valid_wgt, SIGNAL(s_validationFinished(bool)), this, SLOT(executePendingOperation(bool))); diff --git a/libpgmodeler_ui/src/objectselectorwidget.cpp b/libpgmodeler_ui/src/objectselectorwidget.cpp index 06ba308a86..3126bfa820 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.cpp +++ b/libpgmodeler_ui/src/objectselectorwidget.cpp @@ -137,6 +137,7 @@ void ObjectSelectorWidget::setSelectedObject(BaseObject *object) .arg(selected_obj->getName(true))); emit s_objectSelected(); + emit s_selectorChanged(true); } else clearSelector(); @@ -176,6 +177,7 @@ void ObjectSelectorWidget::clearSelector(void) obj_name_txt->clear(); rem_object_tb->setEnabled(false); emit s_selectorCleared(); + emit s_selectorChanged(false); } void ObjectSelectorWidget::showObjectView(void) diff --git a/libpgmodeler_ui/src/objectselectorwidget.h b/libpgmodeler_ui/src/objectselectorwidget.h index e4a99eb69e..c4283530cb 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.h +++ b/libpgmodeler_ui/src/objectselectorwidget.h @@ -93,6 +93,10 @@ class ObjectSelectorWidget: public QWidget, public Ui::ObjectSelectorWidget { //! \brief Signal emitted when the user clears the selector void s_selectorCleared(void); + + /*! \brief Signal emitted when the user clears the selector or selects and object + * The boolean param indicates if there's an object selected or not */ + void s_selectorChanged(bool); }; #endif diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 7d6d4347a6..e19385f812 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -51,6 +51,8 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) grid->addWidget(expression_txt, 4, 1, 1, 4); properties_tbw->setTabEnabled(1, false); + properties_tbw->setTabEnabled(2, false); + pgsqltype_wgt = new PgSQLTypeWidget(this); columns_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons, true, this); @@ -70,6 +72,30 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) info_frm->setParent(this); vbox->addWidget(info_frm); + ref_tables_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ (ObjectsTableWidget::UpdateButton | + ObjectsTableWidget::DuplicateButton| + ObjectsTableWidget::EditButton), true, this); + ref_tables_tab->setColumnCount(3); + ref_tables_tab->setHeaderLabel(trUtf8("Name"), 0); + ref_tables_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("uid")),0); + ref_tables_tab->setHeaderLabel(trUtf8("Schema"), 1); + ref_tables_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("schema")),1); + + ref_table_sel=new ObjectSelectorWidget({ ObjectType::Table }, true, this); + ref_table_sel->enableObjectCreation(false); + + QHBoxLayout *hbox = new QHBoxLayout; + hbox->addWidget(ref_table_lbl); + hbox->addWidget(ref_table_sel); + + info_frm=BaseObjectWidget::generateInformationFrame(trUtf8("This tab can be used to inform the tables that the view references. This is just a convenience to make the visualization of this kind of object more intuitive. If no table is specified here no relationship will be displayed in the canvas. Note that no validation will be done to check if the provided tables are really referenced by the view.")); + vbox = new QVBoxLayout; + vbox->setContentsMargins(4,4,4,4); + vbox->addLayout(hbox); + vbox->addWidget(ref_tables_tab); + vbox->addWidget(info_frm); + properties_tbw->widget(2)->setLayout(vbox); + selectReferenceType(); setMinimumSize(640, 480); @@ -78,6 +104,8 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) connect(columns_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editColumn(int))); connect(columns_tab, SIGNAL(s_rowDuplicated(int,int)), this, SLOT(duplicateColumn(int,int))); + connect(ref_tables_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addRefTable(int))); + connect(view_def_chk, SIGNAL(toggled(bool)), select_from_chk, SLOT(setDisabled(bool))); connect(view_def_chk, SIGNAL(toggled(bool)), from_where_chk, SLOT(setDisabled(bool))); connect(view_def_chk, SIGNAL(toggled(bool)), after_where_chk, SLOT(setDisabled(bool))); @@ -85,6 +113,7 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) connect(view_def_chk, &QCheckBox::toggled, [&](bool checked){ properties_tbw->setTabEnabled(1, checked); + properties_tbw->setTabEnabled(2, checked); }); connect(ref_type_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(selectReferenceType(void))); @@ -96,6 +125,11 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) connect(ref_object_sel, &ObjectSelectorWidget::s_selectorCleared, [&](){ col_alias_edt->setEnabled(false); }); + + connect(ref_table_sel, &ObjectSelectorWidget::s_selectorChanged, [&](bool selected){ + ref_tables_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, selected); + }); + } void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseModel *model) @@ -109,6 +143,7 @@ void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseM expression_cp->configureCompletion(model, expression_hl); ref_object_sel->setModel(model); + ref_table_sel->setModel(model); ref_type_cmb->setCurrentIndex(ref.getReferenceType()); ref_alias_edt->setText(ref.getReferenceAlias()); @@ -146,6 +181,21 @@ void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseM } columns_tab->blockSignals(false); + + ref_tables_tab->blockSignals(true); + row = 0; + for(auto &tab : ref.getReferencedTables()) + { + ref_tables_tab->addRow(); + ref_tables_tab->setCellText(tab->getName(), row, 0); + ref_tables_tab->setCellText(tab->getSchema()->getName(), row, 1); + ref_tables_tab->setRowData(QVariant::fromValue(reinterpret_cast(tab)), row); + row++; + } + + ref_tables_tab->blockSignals(false); + columns_tab->clearSelection(); + ref_tables_tab->clearSelection(); } else { @@ -154,6 +204,8 @@ void ReferenceWidget::setAttributes(Reference ref, unsigned ref_flags, DatabaseM after_where_chk->setChecked((ref_flags & Reference::SqlReferWhere) == Reference::SqlReferWhere); end_expr_chk->setChecked((ref_flags & Reference::SqlReferEndExpr) == Reference::SqlReferEndExpr); } + + ref_tables_tab->setButtonsEnabled(ObjectsTableWidget::AddButton, false); } Reference ReferenceWidget::getReference(void) @@ -202,6 +254,9 @@ void ReferenceWidget::applyConfiguration(void) reference.addColumn(columns_tab->getCellText(row, 0), columns_tab->getRowData(row).value(), columns_tab->getCellText(row, 2)); + + for(unsigned row = 0; row < ref_tables_tab->getRowCount(); row++) + reference.addReferencedTable(reinterpret_cast
(ref_tables_tab->getRowData(row).value())); } if(select_from_chk->isChecked()) @@ -245,6 +300,15 @@ void ReferenceWidget::addColumn(int row) columns_tab->removeRow(row); } +void ReferenceWidget::addRefTable(int row) +{ + Table *table = dynamic_cast
(ref_table_sel->getSelectedObject()); + ref_tables_tab->setRowData(QVariant::fromValue(reinterpret_cast(table)), row); + ref_tables_tab->setCellText(table->getName(), row, 0); + ref_tables_tab->setCellText(table->getSchema()->getName(), row, 1); + ref_table_sel->clearSelector(); +} + void ReferenceWidget::updateColumn(int row) { if(!name_edt->text().isEmpty()) diff --git a/libpgmodeler_ui/src/referencewidget.h b/libpgmodeler_ui/src/referencewidget.h index 2209fc6821..ba9980e897 100644 --- a/libpgmodeler_ui/src/referencewidget.h +++ b/libpgmodeler_ui/src/referencewidget.h @@ -41,11 +41,11 @@ class ReferenceWidget : public QWidget, Ui::ReferenceWidget { CodeCompletionWidget *expression_cp; - ObjectSelectorWidget *ref_object_sel; + ObjectSelectorWidget *ref_object_sel, *ref_table_sel; PgSQLTypeWidget *pgsqltype_wgt; - ObjectsTableWidget *columns_tab; + ObjectsTableWidget *columns_tab, *ref_tables_tab; unsigned ref_flags; @@ -68,6 +68,7 @@ class ReferenceWidget : public QWidget, Ui::ReferenceWidget { private slots: void selectReferenceType(void); void addColumn(int row); + void addRefTable(int row); void updateColumn(int row); void editColumn(int row); void duplicateColumn(int src_row, int new_row); diff --git a/libpgmodeler_ui/ui/referencewidget.ui b/libpgmodeler_ui/ui/referencewidget.ui index a20a590261..1a08030f29 100644 --- a/libpgmodeler_ui/ui/referencewidget.ui +++ b/libpgmodeler_ui/ui/referencewidget.ui @@ -643,6 +643,24 @@ + + + Referenced tables + + + + + 30 + 30 + 61 + 22 + + + + Table: + + + From 90d8b9c25cbf19090dbc1c9478f464bb241f9414 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 14 Mar 2019 16:12:30 -0300 Subject: [PATCH 293/425] Improved the ModelValidationWidget in such way that is possible to operate over objects on the output list through their respective context menu (the same as in the ModelWidget) Now its possible to trigger the swap ids dialog for two selected objects, causing their ids to be swapped more quickly. --- crashhandler/src/crashhandlerform.h | 2 +- libpgmodeler_ui/src/aboutwidget.h | 2 +- libpgmodeler_ui/src/baseconfigwidget.h | 2 +- libpgmodeler_ui/src/baseform.h | 2 +- libpgmodeler_ui/src/bugreportform.h | 2 +- libpgmodeler_ui/src/bulkdataeditwidget.h | 2 +- libpgmodeler_ui/src/configurationform.h | 2 +- libpgmodeler_ui/src/customsqlwidget.h | 2 +- libpgmodeler_ui/src/databaseimportform.h | 2 +- libpgmodeler_ui/src/datamanipulationform.h | 2 +- libpgmodeler_ui/src/donatewidget.h | 2 +- libpgmodeler_ui/src/elementstablewidget.h | 2 +- libpgmodeler_ui/src/elementwidget.h | 2 +- libpgmodeler_ui/src/mainwindow.h | 2 +- libpgmodeler_ui/src/messagebox.h | 2 +- libpgmodeler_ui/src/metadatahandlingform.h | 2 +- libpgmodeler_ui/src/modeldatabasediffform.h | 2 +- libpgmodeler_ui/src/modelexportform.h | 2 +- libpgmodeler_ui/src/modelfixform.h | 2 +- libpgmodeler_ui/src/modeloverviewwidget.h | 2 +- libpgmodeler_ui/src/modelrestorationform.h | 2 +- libpgmodeler_ui/src/modelvalidationwidget.cpp | 69 ++++++++++++++++--- libpgmodeler_ui/src/modelvalidationwidget.h | 3 + libpgmodeler_ui/src/modelwidget.cpp | 5 +- libpgmodeler_ui/src/modelwidget.h | 2 +- libpgmodeler_ui/src/objectfinderwidget.h | 2 +- libpgmodeler_ui/src/pluginsconfigwidget.h | 2 +- libpgmodeler_ui/src/policywidget.h | 2 +- libpgmodeler_ui/src/referencewidget.h | 2 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 6 ++ libpgmodeler_ui/src/swapobjectsidswidget.h | 3 +- libpgmodeler_ui/src/taskprogresswidget.h | 2 +- plugins/xml2object/src/xml2objectwidget.h | 2 +- 33 files changed, 104 insertions(+), 38 deletions(-) diff --git a/crashhandler/src/crashhandlerform.h b/crashhandler/src/crashhandlerform.h index 9aafab089a..f6c1190707 100644 --- a/crashhandler/src/crashhandlerform.h +++ b/crashhandler/src/crashhandlerform.h @@ -61,7 +61,7 @@ class CrashHandlerForm: public BugReportForm { //! \brief Analysis mode argument static const QString AnalysisMode; - CrashHandlerForm(bool analysis_mode=false, QWidget * parent = nullptr, Qt::WindowFlags f = 0); + CrashHandlerForm(bool analysis_mode=false, QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); private slots: void loadReport(void); diff --git a/libpgmodeler_ui/src/aboutwidget.h b/libpgmodeler_ui/src/aboutwidget.h index 5178546797..0cf8317e85 100644 --- a/libpgmodeler_ui/src/aboutwidget.h +++ b/libpgmodeler_ui/src/aboutwidget.h @@ -35,7 +35,7 @@ class AboutWidget: public QWidget, public Ui::AboutWidget { Q_OBJECT public: - AboutWidget(QWidget *parent = 0); + AboutWidget(QWidget *parent = nullptr); signals: void s_visibilityChanged(bool value); diff --git a/libpgmodeler_ui/src/baseconfigwidget.h b/libpgmodeler_ui/src/baseconfigwidget.h index 760c6bc3fc..ddd742d448 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.h +++ b/libpgmodeler_ui/src/baseconfigwidget.h @@ -65,7 +65,7 @@ class BaseConfigWidget: public QWidget { void showEvent(QShowEvent *); public: - BaseConfigWidget(QWidget *parent = 0); + BaseConfigWidget(QWidget *parent = nullptr); ~BaseConfigWidget(void){} bool isConfigurationChanged(void); diff --git a/libpgmodeler_ui/src/baseform.h b/libpgmodeler_ui/src/baseform.h index 519fb3895d..d209bd19b3 100644 --- a/libpgmodeler_ui/src/baseform.h +++ b/libpgmodeler_ui/src/baseform.h @@ -45,7 +45,7 @@ class BaseForm: public QDialog, public Ui::BaseForm { void closeEvent(QCloseEvent *); public: - BaseForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + BaseForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); void setButtonConfiguration(unsigned button_conf=Messagebox::OkCancelButtons); diff --git a/libpgmodeler_ui/src/bugreportform.h b/libpgmodeler_ui/src/bugreportform.h index 8c627bc6a9..01a3fe1798 100644 --- a/libpgmodeler_ui/src/bugreportform.h +++ b/libpgmodeler_ui/src/bugreportform.h @@ -47,7 +47,7 @@ class BugReportForm : public QDialog, public Ui::BugReportForm { void generateReport(const QByteArray &buf); public: - BugReportForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + BugReportForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); public slots: void generateReport(void); diff --git a/libpgmodeler_ui/src/bulkdataeditwidget.h b/libpgmodeler_ui/src/bulkdataeditwidget.h index 82f41b027d..33f894d627 100644 --- a/libpgmodeler_ui/src/bulkdataeditwidget.h +++ b/libpgmodeler_ui/src/bulkdataeditwidget.h @@ -29,7 +29,7 @@ class BulkDataEditWidget: public QWidget, public Ui::BulkDataEditWidget { void showEvent(QShowEvent *); public: - BulkDataEditWidget(QWidget *parent = 0); + BulkDataEditWidget(QWidget *parent = nullptr); }; #endif diff --git a/libpgmodeler_ui/src/configurationform.h b/libpgmodeler_ui/src/configurationform.h index ef4d7c3db3..4d9bef2eb6 100644 --- a/libpgmodeler_ui/src/configurationform.h +++ b/libpgmodeler_ui/src/configurationform.h @@ -55,7 +55,7 @@ class ConfigurationForm: public QDialog, public Ui::ConfigurationForm { SnippetsConfWgt=4, PluginsConfWgt=5; - ConfigurationForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + ConfigurationForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); ~ConfigurationForm(void); BaseConfigWidget *getConfigurationWidget(unsigned idx); diff --git a/libpgmodeler_ui/src/customsqlwidget.h b/libpgmodeler_ui/src/customsqlwidget.h index 6e279c7373..05b0e38a7f 100644 --- a/libpgmodeler_ui/src/customsqlwidget.h +++ b/libpgmodeler_ui/src/customsqlwidget.h @@ -58,7 +58,7 @@ class CustomSQLWidget: public BaseObjectWidget, public Ui::CustomSQLWidget { void configureMenus(void); public: - CustomSQLWidget(QWidget *parent=0); + CustomSQLWidget(QWidget *parent = nullptr); void setAttributes(DatabaseModel *model, BaseObject *object); diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index 3ce68bb359..018f1d942b 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -90,7 +90,7 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { ObjectCount=8, ObjectSource=9; //Only for gropus - DatabaseImportForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + DatabaseImportForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); ~DatabaseImportForm(void); void setModelWidget(ModelWidget *model); diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 3dfc2762ed..1c53c94070 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -112,7 +112,7 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { void setColumnsCheckState(Qt::CheckState state); public: - DataManipulationForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + DataManipulationForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); //! \brief Defines the connection and current schema and table to be handled, this method should be called before show the dialog void setAttributes(Connection conn, const QString curr_schema=QString("public"), const QString curr_table=QString(), const QString &filter=QString()); diff --git a/libpgmodeler_ui/src/donatewidget.h b/libpgmodeler_ui/src/donatewidget.h index 7376ffd2c0..aa0cb97b0f 100644 --- a/libpgmodeler_ui/src/donatewidget.h +++ b/libpgmodeler_ui/src/donatewidget.h @@ -34,7 +34,7 @@ class DonateWidget: public QWidget, public Ui::DonateWidget { Q_OBJECT public: - DonateWidget(QWidget *parent = 0); + DonateWidget(QWidget *parent = nullptr); signals: void s_visibilityChanged(bool value); diff --git a/libpgmodeler_ui/src/elementstablewidget.h b/libpgmodeler_ui/src/elementstablewidget.h index 9ec2e66869..e2c907d3b9 100644 --- a/libpgmodeler_ui/src/elementstablewidget.h +++ b/libpgmodeler_ui/src/elementstablewidget.h @@ -70,7 +70,7 @@ class ElementsTableWidget: public QWidget { int openElementForm(Element *elem); public: - ElementsTableWidget(QWidget *parent = 0); + ElementsTableWidget(QWidget *parent = nullptr); ~ElementsTableWidget(void); //! \brief Configures the grid based upon the template Class in use diff --git a/libpgmodeler_ui/src/elementwidget.h b/libpgmodeler_ui/src/elementwidget.h index 2e74a4fb74..e51093b97d 100644 --- a/libpgmodeler_ui/src/elementwidget.h +++ b/libpgmodeler_ui/src/elementwidget.h @@ -73,7 +73,7 @@ class ElementWidget: public QWidget, public Ui::ElementWidget { void createElement(Class *elem); public: - ElementWidget(QWidget *parent = 0); + ElementWidget(QWidget *parent = nullptr); //! \brief Configures the widget to handle the element considering its type (IndexElement, ExcludeElement, PartitionKey) void setAttributes(DatabaseModel *model, BaseObject *parent_obj, Element *elem); diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 19dbabedf4..cca27abef2 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -171,7 +171,7 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { void showFixMessage(Exception &e, const QString &filename); public: - MainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0); + MainWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = 0); ~MainWindow(void); //! \brief Loads a set of models from string list diff --git a/libpgmodeler_ui/src/messagebox.h b/libpgmodeler_ui/src/messagebox.h index 4226304fec..89dd923b5d 100644 --- a/libpgmodeler_ui/src/messagebox.h +++ b/libpgmodeler_ui/src/messagebox.h @@ -48,7 +48,7 @@ class Messagebox: public QDialog, public Ui::Messagebox { OkButton=2, AllButtons=3; - Messagebox(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + Messagebox(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); /*! \brief Shows the message box defining the icons and available buttons. User can specify custom button labels as well custom icons. The icons can be a path to a local file diff --git a/libpgmodeler_ui/src/metadatahandlingform.h b/libpgmodeler_ui/src/metadatahandlingform.h index ccaa2187f8..587c8b0509 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.h +++ b/libpgmodeler_ui/src/metadatahandlingform.h @@ -48,7 +48,7 @@ class MetadataHandlingForm: public QDialog, public Ui::MetadataHandlingForm { void selectFile(bool is_output); public: - MetadataHandlingForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + MetadataHandlingForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); void setModelWidget(ModelWidget *model_wgt); void setModelWidgets(QList models); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index aea6320be3..4a816f57dd 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -116,7 +116,7 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { ExportThread=3; public: - ModelDatabaseDiffForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + ModelDatabaseDiffForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); ~ModelDatabaseDiffForm(void); void setModelWidget(ModelWidget *model_wgt); diff --git a/libpgmodeler_ui/src/modelexportform.h b/libpgmodeler_ui/src/modelexportform.h index 951a8e988f..f8d1881cf4 100644 --- a/libpgmodeler_ui/src/modelexportform.h +++ b/libpgmodeler_ui/src/modelexportform.h @@ -59,7 +59,7 @@ class ModelExportForm: public QDialog, public Ui::ModelExportForm { int exec(void){ return(QDialog::Rejected); } public: - ModelExportForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + ModelExportForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); public slots: void exec(ModelWidget *model); diff --git a/libpgmodeler_ui/src/modelfixform.h b/libpgmodeler_ui/src/modelfixform.h index 05e156cde8..1a5842835a 100644 --- a/libpgmodeler_ui/src/modelfixform.h +++ b/libpgmodeler_ui/src/modelfixform.h @@ -41,7 +41,7 @@ class ModelFixForm: public QDialog, public Ui::ModelFixForm { void hideEvent(QHideEvent *); public: - ModelFixForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + ModelFixForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); public slots: int exec(void); diff --git a/libpgmodeler_ui/src/modeloverviewwidget.h b/libpgmodeler_ui/src/modeloverviewwidget.h index 5861f17b3d..1b87caec92 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.h +++ b/libpgmodeler_ui/src/modeloverviewwidget.h @@ -69,7 +69,7 @@ class ModelOverviewWidget: public QWidget, public Ui::ModelOverviewWidget { void updateOverview(bool force_update); public: - ModelOverviewWidget(QWidget *parent = 0); + ModelOverviewWidget(QWidget *parent = nullptr); public slots: //! \brief Updates the overview (only if the widget is visible) diff --git a/libpgmodeler_ui/src/modelrestorationform.h b/libpgmodeler_ui/src/modelrestorationform.h index eec67d3c0c..a85d28961e 100644 --- a/libpgmodeler_ui/src/modelrestorationform.h +++ b/libpgmodeler_ui/src/modelrestorationform.h @@ -37,7 +37,7 @@ class ModelRestorationForm: public QDialog, public Ui::ModelRestorationForm { HintTextWidget * keep_models_ht; public: - ModelRestorationForm(QWidget * parent = nullptr, Qt::WindowFlags f = 0); + ModelRestorationForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); //! \brief Returns the list of temporary files existant on tmp/ dir QStringList getTemporaryModels(void); diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 2b9810d1f6..d72bd16473 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -65,6 +65,29 @@ ModelValidationWidget::ModelValidationWidget(QWidget *parent): QWidget(parent) } } +bool ModelValidationWidget::eventFilter(QObject *object, QEvent *event) +{ + QMouseEvent *m_event=dynamic_cast(event); + + //Executes the search when user press enter/return on the pattern field + if(m_event && m_event->buttons() == Qt::RightButton) + { + QLabel *label = dynamic_cast(object); + + if(label->hasSelectedText()) + { + label->setContextMenuPolicy(Qt::DefaultContextMenu); + } + else + { + label->setContextMenuPolicy(Qt::NoContextMenu); + selectObject(); + } + } + + return(QWidget::eventFilter(object, event)); +} + void ModelValidationWidget::createThread(void) { if(!validation_thread) @@ -217,8 +240,11 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) BaseTable *table=nullptr; TableObject *tab_obj=nullptr; QString ref_name; + BaseObject *ref_obj=nullptr; + label->installEventFilter(this); label->setTextInteractionFlags(Qt::TextSelectableByMouse); + if(val_info.getValidationType()==ValidationInfo::BrokenReference) label->setText(trUtf8("The object %1 (%2) [id: %3] is being referenced by %4 object(s) before its creation.") .arg(val_info.getObject()->getName(true).remove('"')) @@ -279,6 +305,9 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) else label->setText(val_info.getErrors().at(0)); + /* Store the reference of the object in order to allow opening the editing form when the user clicks the item on the output + * So the needed fixes can be done manually */ + item->setData(1, Qt::UserRole, QVariant::fromValue(reinterpret_cast(val_info.getObject()))); if(val_info.getValidationType()==ValidationInfo::SqlValidationError || val_info.getValidationType()==ValidationInfo::ValidationAborted) @@ -323,16 +352,24 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) refs=val_info.getReferences(); while(!refs.empty()) { + ref_obj = refs.back(); + item1=new QTreeWidgetItem(item); label1=new QLabel; label1->setTextInteractionFlags(Qt::TextSelectableByMouse); - item1->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(refs.back()->getSchemaName()))); - tab_obj=dynamic_cast(refs.back()); - ref_name=refs.back()->getName(true); + label1->installEventFilter(this); + item1->setIcon(0, QPixmap(PgModelerUiNs::getIconPath(ref_obj->getSchemaName()))); + + /* Store the reference of the referrer object in order to allow opening the editing form when the user clicks the item on the output + * So the needed fixes can be done manually */ + item1->setData(1, Qt::UserRole, QVariant::fromValue(reinterpret_cast(ref_obj))); + + tab_obj=dynamic_cast(ref_obj); + ref_name=ref_obj->getName(true); if(tab_obj) - ref_name=dynamic_cast(refs.back())->getParentTable()->getName(true) + QString(".") + ref_name; + ref_name=dynamic_cast(ref_obj)->getParentTable()->getName(true) + QString(".") + ref_name; if(val_info.getValidationType()==ValidationInfo::NoUniqueName) { @@ -355,20 +392,20 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) label1->setText(trUtf8("Conflicting object: %1 (%2).") .arg(ref_name.remove('"')) - .arg(refs.back()->getTypeName())); + .arg(ref_obj->getTypeName())); } else { if(val_info.getValidationType()==ValidationInfo::SpObjBrokenReference) label1->setText(trUtf8("Relationship: %1 [id: %2].") .arg(ref_name.remove('"')) - .arg(refs.back()->getObjectId())); + .arg(ref_obj->getObjectId())); else { label1->setText(trUtf8("Referrer object: %1 (%2) [id: %3].") .arg(ref_name.remove('"')) - .arg(refs.back()->getTypeName()) - .arg(refs.back()->getObjectId())); + .arg(ref_obj->getTypeName()) + .arg(ref_obj->getObjectId())); } } @@ -576,3 +613,19 @@ void ModelValidationWidget::swapObjectsIds(void) parent_form.exec(); GeneralConfigWidget::saveWidgetGeometry(&parent_form, this->metaObject()->className()); } + +void ModelValidationWidget::selectObject(void) +{ + QTreeWidgetItem *item = output_trw->currentItem(); + + if(item && !validation_thread->isRunning()) + { + BaseObject *selected_obj=reinterpret_cast(item->data(1, Qt::UserRole).value()); + + if(selected_obj && QApplication::mouseButtons() == Qt::RightButton) + { + model_wgt->configureObjectMenu(selected_obj); + model_wgt->showObjectMenu(); + } + } +} diff --git a/libpgmodeler_ui/src/modelvalidationwidget.h b/libpgmodeler_ui/src/modelvalidationwidget.h index d9a8197136..a58d6609e5 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.h +++ b/libpgmodeler_ui/src/modelvalidationwidget.h @@ -70,8 +70,11 @@ class ModelValidationWidget: public QWidget, public Ui::ModelValidationWidget { void configureValidation(void); + void selectObject(void); + protected: void resizeEvent(QResizeEvent *event); + bool eventFilter(QObject *object, QEvent *event); public: ModelValidationWidget(QWidget * parent = nullptr); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 6933544da6..b48a1d153b 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -4083,7 +4083,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) actions.pop_back(); } - if(objects.empty() || (objects.size()==1 && objects[0]==db_model)) + if(objects.size() <= 2) { popup_menu.addSeparator(); popup_menu.addAction(action_edit_creation_order); @@ -4496,6 +4496,9 @@ void ModelWidget::editCreationOrder(void) swap_ids_wgt->setModel(this->getDatabaseModel()); + if(!selected_objects.empty()) + swap_ids_wgt->setSelectedObjects(selected_objects[0], selected_objects.size() == 2 ? selected_objects[1] : nullptr); + connect(swap_ids_wgt, &SwapObjectsIdsWidget::s_objectsIdsSwapped, [&](){ this->op_list->removeOperations(); emit s_objectManipulated(); diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index 3bc8a99558..90e683d187 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -289,7 +289,7 @@ class ModelWidget: public QWidget { MaximumZoom=5.000001, ZoomIncrement=0.050000; - ModelWidget(QWidget *parent = 0); + ModelWidget(QWidget *parent = nullptr); ~ModelWidget(void); /*! \brief Configures the scene aligning the object to the grid and resizing the scene diff --git a/libpgmodeler_ui/src/objectfinderwidget.h b/libpgmodeler_ui/src/objectfinderwidget.h index 1d8fe5e276..b55189ad32 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.h +++ b/libpgmodeler_ui/src/objectfinderwidget.h @@ -52,7 +52,7 @@ class ObjectFinderWidget : public QWidget, public Ui::ObjectFinderWidget { void resizeEvent(QResizeEvent *event); public: - ObjectFinderWidget(QWidget *parent = 0); + ObjectFinderWidget(QWidget *parent = nullptr); //! \brief Lists all valid types in a QListWidget static void updateObjectTypeList(QListWidget *list_wgt); diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.h b/libpgmodeler_ui/src/pluginsconfigwidget.h index 132bfa451d..e9ba8f764c 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.h +++ b/libpgmodeler_ui/src/pluginsconfigwidget.h @@ -50,7 +50,7 @@ class PluginsConfigWidget: public BaseConfigWidget, public Ui::PluginsConfigWidg void addConfigurationParam(const QString &, const attribs_map &){} public: - PluginsConfigWidget(QWidget *parent = 0); + PluginsConfigWidget(QWidget *parent = nullptr); ~PluginsConfigWidget(void); //! \brief Since plugins has its own configurations this method load all plugins instead diff --git a/libpgmodeler_ui/src/policywidget.h b/libpgmodeler_ui/src/policywidget.h index 3502ce5267..f289060c81 100644 --- a/libpgmodeler_ui/src/policywidget.h +++ b/libpgmodeler_ui/src/policywidget.h @@ -39,7 +39,7 @@ class PolicyWidget : public BaseObjectWidget, Ui::PolicyWidget { NumberedTextEditor *using_edt, *check_edt; public: - PolicyWidget(QWidget *parent = 0); + PolicyWidget(QWidget *parent = nullptr); void setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *parent_obj, Policy *policy); diff --git a/libpgmodeler_ui/src/referencewidget.h b/libpgmodeler_ui/src/referencewidget.h index ba9980e897..59824548a7 100644 --- a/libpgmodeler_ui/src/referencewidget.h +++ b/libpgmodeler_ui/src/referencewidget.h @@ -56,7 +56,7 @@ class ReferenceWidget : public QWidget, Ui::ReferenceWidget { void handleColumn(int row); public: - explicit ReferenceWidget(QWidget *parent = 0); + explicit ReferenceWidget(QWidget *parent = nullptr); void setAttributes(Reference ref, unsigned ref_flags, DatabaseModel *model); Reference getReference(void); diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index 99c1f85c1b..d2293103d8 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -112,6 +112,12 @@ void SwapObjectsIdsWidget::setModel(DatabaseModel *model) fillCreationOrderGrid(); } +void SwapObjectsIdsWidget::setSelectedObjects(BaseObject *src_object, BaseObject *dst_objct) +{ + src_object_sel->setSelectedObject(src_object); + dst_object_sel->setSelectedObject(dst_objct); +} + void SwapObjectsIdsWidget::fillCreationOrderGrid(void) { objects_tbw->clearContents(); diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.h b/libpgmodeler_ui/src/swapobjectsidswidget.h index db04d67c68..2435b6b604 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.h +++ b/libpgmodeler_ui/src/swapobjectsidswidget.h @@ -44,9 +44,10 @@ class SwapObjectsIdsWidget: public QWidget, public Ui::SwapObjectsIdsWidget { void fillCreationOrderGrid(void); public: - SwapObjectsIdsWidget(QWidget *parent = 0, Qt::WindowFlags f = 0); + SwapObjectsIdsWidget(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Widget); ~SwapObjectsIdsWidget(void); void setModel(DatabaseModel *model); + void setSelectedObjects(BaseObject *src_object, BaseObject *dst_objct); private slots: void showObjectId(void); diff --git a/libpgmodeler_ui/src/taskprogresswidget.h b/libpgmodeler_ui/src/taskprogresswidget.h index 84a87cf2c1..e94f67ae9f 100644 --- a/libpgmodeler_ui/src/taskprogresswidget.h +++ b/libpgmodeler_ui/src/taskprogresswidget.h @@ -40,7 +40,7 @@ class TaskProgressWidget: public QDialog, public Ui::TaskProgressWidget map icons; public: - TaskProgressWidget(QWidget *parent=0, Qt::WindowFlags f=0); + TaskProgressWidget(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Widget); void addIcon(unsigned id, const QIcon &ico); public slots: diff --git a/plugins/xml2object/src/xml2objectwidget.h b/plugins/xml2object/src/xml2objectwidget.h index 638f33a4b5..2c5ab3fbf1 100644 --- a/plugins/xml2object/src/xml2objectwidget.h +++ b/plugins/xml2object/src/xml2objectwidget.h @@ -14,7 +14,7 @@ class Xml2ObjectWidget: public QDialog, public Ui::Xml2ObjectWidget { OperationList *op_list; public: - Xml2ObjectWidget(QWidget *parent = 0, Qt::WindowFlags f = 0); + Xml2ObjectWidget(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::Widget); public slots: void show(DatabaseModel *model, OperationList *op_list); From ff39dfefa0a3390590cae863682ff3a8374ee833 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 22 Mar 2019 16:03:42 -0300 Subject: [PATCH 294/425] Writing some tests for the class ForeignDataWrapper Renamed the method Exception::getErrorType to Exception::getErrorCode --- crashhandler/src/main.cpp | 2 +- libobjrenderer/src/baseobjectview.cpp | 2 +- libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libparsers/src/schemaparser.cpp | 12 +- libparsers/src/xmlparser.cpp | 4 +- libpgconnector/src/catalog.cpp | 32 +-- libpgconnector/src/connection.cpp | 2 +- libpgconnector/src/resultset.cpp | 4 +- libpgmodeler/src/aggregate.cpp | 2 +- libpgmodeler/src/baseobject.cpp | 14 +- libpgmodeler/src/baserelationship.cpp | 4 +- libpgmodeler/src/basetable.cpp | 2 +- libpgmodeler/src/collation.cpp | 2 +- libpgmodeler/src/column.cpp | 4 +- libpgmodeler/src/constraint.cpp | 10 +- libpgmodeler/src/databasemodel.cpp | 206 +++++++++--------- libpgmodeler/src/domain.cpp | 2 +- libpgmodeler/src/eventtrigger.cpp | 2 +- libpgmodeler/src/extension.cpp | 2 +- libpgmodeler/src/foreigndatawrapper.cpp | 8 +- libpgmodeler/src/function.cpp | 2 +- libpgmodeler/src/index.cpp | 8 +- libpgmodeler/src/operationlist.cpp | 8 +- libpgmodeler/src/parameter.cpp | 9 + libpgmodeler/src/parameter.h | 1 + libpgmodeler/src/permission.cpp | 2 +- libpgmodeler/src/pgsqltypes.cpp | 2 +- libpgmodeler/src/policy.cpp | 2 +- libpgmodeler/src/relationship.cpp | 32 +-- libpgmodeler/src/role.cpp | 2 +- libpgmodeler/src/sequence.cpp | 2 +- libpgmodeler/src/table.cpp | 54 ++--- libpgmodeler/src/tag.cpp | 10 +- libpgmodeler/src/type.cpp | 2 +- libpgmodeler/src/view.cpp | 30 +-- libpgmodeler_ui/src/aggregatewidget.cpp | 6 +- .../src/appearanceconfigwidget.cpp | 8 +- libpgmodeler_ui/src/baseconfigwidget.cpp | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 10 +- libpgmodeler_ui/src/baseobjectwidget.h | 2 +- libpgmodeler_ui/src/castwidget.cpp | 4 +- libpgmodeler_ui/src/collationwidget.cpp | 4 +- libpgmodeler_ui/src/columnwidget.cpp | 4 +- libpgmodeler_ui/src/configurationform.cpp | 2 +- .../src/connectionsconfigwidget.cpp | 14 +- libpgmodeler_ui/src/constraintwidget.cpp | 6 +- libpgmodeler_ui/src/conversionwidget.cpp | 4 +- libpgmodeler_ui/src/customsqlwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 20 +- libpgmodeler_ui/src/databaseimportform.cpp | 14 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 98 ++++----- libpgmodeler_ui/src/databasewidget.cpp | 4 +- libpgmodeler_ui/src/datamanipulationform.cpp | 12 +- libpgmodeler_ui/src/domainwidget.cpp | 4 +- libpgmodeler_ui/src/elementstablewidget.cpp | 2 +- libpgmodeler_ui/src/elementwidget.cpp | 4 +- libpgmodeler_ui/src/eventtriggerwidget.cpp | 2 +- libpgmodeler_ui/src/extensionwidget.cpp | 2 +- libpgmodeler_ui/src/functionwidget.cpp | 6 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 6 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 2 +- libpgmodeler_ui/src/indexwidget.cpp | 4 +- libpgmodeler_ui/src/languagewidget.cpp | 4 +- libpgmodeler_ui/src/mainwindow.cpp | 12 +- libpgmodeler_ui/src/metadatahandlingform.cpp | 2 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 8 +- libpgmodeler_ui/src/modelexportform.cpp | 2 +- libpgmodeler_ui/src/modelexporthelper.cpp | 14 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 10 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 10 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 4 +- libpgmodeler_ui/src/modelvalidationwidget.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 50 ++--- libpgmodeler_ui/src/objectselectorwidget.cpp | 8 +- libpgmodeler_ui/src/objectstablewidget.cpp | 2 +- libpgmodeler_ui/src/operationlistwidget.cpp | 8 +- libpgmodeler_ui/src/operatorclasswidget.cpp | 6 +- libpgmodeler_ui/src/operatorfamilywidget.cpp | 2 +- libpgmodeler_ui/src/operatorwidget.cpp | 4 +- libpgmodeler_ui/src/parameterwidget.cpp | 4 +- libpgmodeler_ui/src/permissionwidget.cpp | 4 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 2 +- libpgmodeler_ui/src/pgsqltypewidget.cpp | 6 +- libpgmodeler_ui/src/policywidget.cpp | 4 +- libpgmodeler_ui/src/referencewidget.cpp | 2 +- .../src/relationshipconfigwidget.cpp | 6 +- libpgmodeler_ui/src/relationshipwidget.cpp | 24 +- libpgmodeler_ui/src/resultsetmodel.cpp | 4 +- libpgmodeler_ui/src/rolewidget.cpp | 2 +- libpgmodeler_ui/src/rulewidget.cpp | 4 +- libpgmodeler_ui/src/schemawidget.cpp | 2 +- libpgmodeler_ui/src/sequencewidget.cpp | 4 +- libpgmodeler_ui/src/snippetsconfigwidget.cpp | 10 +- libpgmodeler_ui/src/sourcecodewidget.cpp | 6 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 12 +- libpgmodeler_ui/src/sqltoolwidget.cpp | 10 +- libpgmodeler_ui/src/swapobjectsidswidget.cpp | 4 +- libpgmodeler_ui/src/syntaxhighlighter.cpp | 2 +- libpgmodeler_ui/src/tabledatawidget.cpp | 2 +- libpgmodeler_ui/src/tablespacewidget.cpp | 2 +- libpgmodeler_ui/src/tablewidget.cpp | 20 +- libpgmodeler_ui/src/tagwidget.cpp | 2 +- libpgmodeler_ui/src/textboxwidget.cpp | 2 +- libpgmodeler_ui/src/triggerwidget.cpp | 8 +- libpgmodeler_ui/src/typewidget.cpp | 6 +- libpgmodeler_ui/src/viewwidget.cpp | 14 +- libutils/src/exception.cpp | 4 +- libutils/src/exception.h | 2 +- main-cli/src/main.cpp | 2 +- main-cli/src/pgmodelercli.cpp | 6 +- main/src/application.cpp | 2 +- main/src/main.cpp | 2 +- plugins/xml2object/src/xml2objectwidget.cpp | 2 +- schemas/sql/foreigndatawrapper.sch | 14 +- .../foreigndatawrappertest.cpp | 123 ++++++++++- .../partrelationshiptest.cpp | 4 +- 117 files changed, 673 insertions(+), 538 deletions(-) diff --git a/crashhandler/src/main.cpp b/crashhandler/src/main.cpp index 872f646253..349bb13c53 100644 --- a/crashhandler/src/main.cpp +++ b/crashhandler/src/main.cpp @@ -44,6 +44,6 @@ int main(int argc, char **argv) { QTextStream out(stdout); out << e.getExceptionsText(); - return(enum_cast(e.getErrorType())); + return(enum_cast(e.getErrorCode())); } } diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index eb7518b680..7edf71007a 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -243,7 +243,7 @@ void BaseObjectView::loadObjectsStyle(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__, __FILE__, __LINE__, &e, config_file); + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__, __FILE__, __LINE__, &e, config_file); } } diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 36c6b9c34f..d3242811f7 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -351,6 +351,7 @@ namespace Attributes { OperatorFunc=QString("operfunc"), Operator=QString("operator"), Operators=QString("operators"), + Options=QString("options"), OriginalPk=QString("original-pk"), OutputFunc=QString("output"), OwnerColumn=QString("owner-col"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 91179b286b..8f5ed3a560 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -363,6 +363,7 @@ namespace Attributes { OperatorFunc, Operator, Operators, + Options, OriginalPk, OutputFunc, OwnerColumn, diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 19d3f5c2de..7765ed81d4 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -550,7 +550,7 @@ bool SchemaParser::evaluateComparisonExpr(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } if(error) @@ -634,7 +634,7 @@ void SchemaParser::defineAttribute(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } if(!error) @@ -708,7 +708,7 @@ void SchemaParser::unsetAttribute(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } bool SchemaParser::evaluateExpression(void) @@ -839,7 +839,7 @@ bool SchemaParser::evaluateExpression(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } if(error) @@ -907,7 +907,7 @@ QString SchemaParser::getCodeDefinition(const QString & obj_name, attribs_map &a } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(), __PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1436,6 +1436,6 @@ QString SchemaParser::getCodeDefinition(const QString &filename, attribs_map &at } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index 1c172e3c9f..17f36b1b85 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -88,7 +88,7 @@ void XmlParser::loadXMLFile(const QString &filename) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -119,7 +119,7 @@ void XmlParser::loadXMLBuffer(const QString &xml_buf) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 6ce2051efc..967b0366a5 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -108,7 +108,7 @@ void Catalog::setConnection(Connection &conn) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -254,7 +254,7 @@ void Catalog::executeCatalogQuery(const QString &qry_type, ObjectType obj_type, } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, QString("catalog: %1").arg(BaseObject::getSchemaName(obj_type))); } } @@ -274,7 +274,7 @@ unsigned Catalog::getObjectCount(ObjectType obj_type, const QString &sch_name, c } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -322,7 +322,7 @@ void Catalog::getObjectsOIDs(map > &obj_oids, map Catalog::getObjectsNames(vector obj_types, const } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -437,7 +437,7 @@ attribs_map Catalog::getAttributes(const QString &obj_name, ObjectType obj_type, } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -470,7 +470,7 @@ vector Catalog::getMultipleAttributes(ObjectType obj_type, attribs_ } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -504,7 +504,7 @@ vector Catalog::getMultipleAttributes(const QString &catalog_sch, a } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -522,7 +522,7 @@ QString Catalog::getCommentQuery(const QString &oid_field, bool is_shared_obj) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, QString("catalog: %1").arg(query_id)); } } @@ -542,7 +542,7 @@ QString Catalog::getNotExtObjectQuery(const QString &oid_field) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, QString("catalog: %1").arg(query_id)); } } @@ -607,7 +607,7 @@ vector Catalog::getObjectsAttributes(ObjectType obj_type, const QSt } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, QApplication::translate("Catalog","Object type: %1","", -1).arg(BaseObject::getSchemaName(obj_type))); } } @@ -621,7 +621,7 @@ attribs_map Catalog::getObjectAttributes(ObjectType obj_type, unsigned oid, cons } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, QApplication::translate("Catalog","Object type: %1","", -1).arg(BaseObject::getSchemaName(obj_type))); } } @@ -652,7 +652,7 @@ QString Catalog::getObjectOID(const QString &name, ObjectType obj_type, const QS } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, QApplication::translate("Catalog","Object type: %1","", -1).arg(BaseObject::getSchemaName(obj_type))); } } @@ -691,7 +691,7 @@ attribs_map Catalog::getServerAttributes(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, QApplication::translate("Catalog","Object type: server","", -1)); } @@ -800,6 +800,6 @@ void Catalog::operator = (const Catalog &catalog) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgconnector/src/connection.cpp b/libpgconnector/src/connection.cpp index 7704ea0774..2a6ee04f7b 100644 --- a/libpgconnector/src/connection.cpp +++ b/libpgconnector/src/connection.cpp @@ -501,7 +501,7 @@ void Connection::switchToDatabase(const QString &dbname) connection_params[ParamDbName]=prev_dbname; connect(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index 782d8abf16..3715eb5c73 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -138,7 +138,7 @@ int ResultSet::validateColumnName(const QString &column_name) catch(Exception &e) { //Capture and redirect any generated exception - throw Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__, __FILE__, __LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__, __FILE__, __LINE__, &e); } } @@ -247,7 +247,7 @@ bool ResultSet::isColumnBinaryFormat(const QString &column_name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__, __FILE__, __LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__, __FILE__, __LINE__, &e); } /* Returns the column format in the current tuple. diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index 75675a1e4f..a07d650f7f 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -284,7 +284,7 @@ QString Aggregate::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 7f9b2d1206..f414b79576 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -858,13 +858,13 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) schparser.restartParser(); clearAttributes(); - if(e.getErrorType()==ErrorCode::UndefinedAttributeValue) + if(e.getErrorCode()==ErrorCode::UndefinedAttributeValue) throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(this->getName(true)) .arg(this->getTypeName()), ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1089,7 +1089,7 @@ bool BaseObject::isCodeDiffersFrom(BaseObject *object, const vector &ig } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1140,7 +1140,7 @@ QString BaseObject::getDropDefinition(bool cascade) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1160,7 +1160,7 @@ QString BaseObject::getAlterDefinition(QString sch_name, attribs_map &attribs, b } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1222,7 +1222,7 @@ QString BaseObject::getAlterDefinition(BaseObject *object, bool ignore_name_diff } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } return(alter); @@ -1248,6 +1248,6 @@ QString BaseObject::getAlterCommentDefinition(BaseObject *object, attribs_map at } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index ecfe05392e..646685cbaf 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -69,7 +69,7 @@ BaseRelationship::BaseRelationship(unsigned rel_type, BaseTable *src_tab, BaseTa } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -177,7 +177,7 @@ void BaseRelationship::setName(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler/src/basetable.cpp b/libpgmodeler/src/basetable.cpp index b87da1c9a8..2610475291 100644 --- a/libpgmodeler/src/basetable.cpp +++ b/libpgmodeler/src/basetable.cpp @@ -58,7 +58,7 @@ QString BaseTable::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/collation.cpp b/libpgmodeler/src/collation.cpp index fb919ed71e..0c06819926 100644 --- a/libpgmodeler/src/collation.cpp +++ b/libpgmodeler/src/collation.cpp @@ -139,6 +139,6 @@ QString Collation::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index cd784f2f50..8876c0e2c3 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -58,7 +58,7 @@ void Column::setName(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -378,7 +378,7 @@ QString Column::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/constraint.cpp b/libpgmodeler/src/constraint.cpp index f62fb17b1a..84c56b70eb 100644 --- a/libpgmodeler/src/constraint.cpp +++ b/libpgmodeler/src/constraint.cpp @@ -182,7 +182,7 @@ void Constraint::setTablespace(BaseObject *tabspc) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -499,7 +499,7 @@ void Constraint::addExcludeElements(vector &elems) catch(Exception &e) { excl_elements = elems_bkp; - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -541,7 +541,7 @@ void Constraint::addExcludeElement(const QString &expr, Operator *oper, Operator } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -574,7 +574,7 @@ void Constraint::addExcludeElement(Column *column, Operator *oper, OperatorClass } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -759,6 +759,6 @@ bool Constraint::isCodeDiffersFrom(BaseObject *object, const vector &ig } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 595cc4b3da..3e59e77d04 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -218,7 +218,7 @@ void DatabaseModel::addObject(BaseObject *object, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } } @@ -286,7 +286,7 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } } @@ -436,7 +436,7 @@ void DatabaseModel::__addObject(BaseObject *object, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } obj_list=getObjectList(object->getObjectType()); @@ -835,7 +835,7 @@ void DatabaseModel::addTable(Table *table, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -859,7 +859,7 @@ void DatabaseModel::removeTable(Table *table, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -872,7 +872,7 @@ void DatabaseModel::addSequence(Sequence *sequence, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -894,7 +894,7 @@ void DatabaseModel::removeSequence(Sequence *sequence, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -906,7 +906,7 @@ void DatabaseModel::addCollation(Collation *collation, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -928,7 +928,7 @@ void DatabaseModel::removeCollation(Collation *collation, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -943,7 +943,7 @@ void DatabaseModel::addExtension(Extension *extension, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -965,7 +965,7 @@ void DatabaseModel::addTag(Tag *tag, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -977,7 +977,7 @@ void DatabaseModel::removeTag(Tag *tag, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -999,7 +999,7 @@ void DatabaseModel::addEventTrigger(EventTrigger *evnttrig, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1011,7 +1011,7 @@ void DatabaseModel::removeEventTrigger(EventTrigger *evnttrig, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1033,7 +1033,7 @@ void DatabaseModel::addGenericSQL(GenericSQL *genericsql, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1045,7 +1045,7 @@ void DatabaseModel::removeGenericSQL(GenericSQL *genericsql, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1070,7 +1070,7 @@ void DatabaseModel::removeExtension(Extension *extension, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1086,7 +1086,7 @@ void DatabaseModel::addView(View *view, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1112,7 +1112,7 @@ void DatabaseModel::removeView(View *view, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1346,7 +1346,7 @@ void DatabaseModel::disconnectRelationships(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1494,7 +1494,7 @@ void DatabaseModel::validateRelationships(void) /* If the relationship connection failed after 'rels_gen_pk' times at the different errors or exists on the fail_rels vector (already tried to be validated) it will be deleted from model */ - if((e.getErrorType() != ErrorCode::InvLinkTablesNoPrimaryKey && conn_tries[rel] > rels_gen_pk) || + if((e.getErrorCode() != ErrorCode::InvLinkTablesNoPrimaryKey && conn_tries[rel] > rels_gen_pk) || (std::find(fail_rels.begin(), fail_rels.end(), rel)!=fail_rels.end())) { //Removes the relationship @@ -1510,7 +1510,7 @@ void DatabaseModel::validateRelationships(void) the connection tries exceed the size of the relationship the relationship is isolated on a "failed to validate" list. This list will be appended to the main rel list when there is only one relationship to be validated */ - else if(e.getErrorType()==ErrorCode::InvLinkTablesNoPrimaryKey && + else if(e.getErrorCode()==ErrorCode::InvLinkTablesNoPrimaryKey && (conn_tries[rel] > rels.size() || rel->getRelationshipType()==BaseRelationship::RelationshipNn)) { @@ -1741,7 +1741,7 @@ void DatabaseModel::checkRelationshipRedundancy(Relationship *rel) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1945,7 +1945,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1983,7 +1983,7 @@ void DatabaseModel::createSpecialObject(const QString &xml_def, unsigned obj_id) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, xml_def); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, xml_def); } } @@ -2033,7 +2033,7 @@ void DatabaseModel::addRelationship(BaseRelationship *rel, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2076,7 +2076,7 @@ void DatabaseModel::removeRelationship(BaseRelationship *rel, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2176,7 +2176,7 @@ void DatabaseModel::addTextbox(Textbox *txtbox, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2188,7 +2188,7 @@ void DatabaseModel::removeTextbox(Textbox *txtbox, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2210,7 +2210,7 @@ void DatabaseModel::addSchema(Schema *schema, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2232,7 +2232,7 @@ void DatabaseModel::removeSchema(Schema *schema, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2244,7 +2244,7 @@ void DatabaseModel::addRole(Role *role, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2266,7 +2266,7 @@ void DatabaseModel::removeRole(Role *role, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2278,7 +2278,7 @@ void DatabaseModel::addTablespace(Tablespace *tabspc, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2300,7 +2300,7 @@ void DatabaseModel::removeTablespace(Tablespace *tabspc, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2312,7 +2312,7 @@ void DatabaseModel::addCast(Cast *cast, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2324,7 +2324,7 @@ void DatabaseModel::removeCast(Cast *cast, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2346,7 +2346,7 @@ void DatabaseModel::addConversion(Conversion *conv, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2358,7 +2358,7 @@ void DatabaseModel::removeConversion(Conversion *conv, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2381,7 +2381,7 @@ void DatabaseModel::addLanguage(Language *lang, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2403,7 +2403,7 @@ void DatabaseModel::removeLanguage(Language *lang, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2415,7 +2415,7 @@ void DatabaseModel::addFunction(Function *func, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2437,7 +2437,7 @@ void DatabaseModel::removeFunction(Function *func, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2449,7 +2449,7 @@ void DatabaseModel::addAggregate(Aggregate *aggreg, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2471,7 +2471,7 @@ void DatabaseModel::removeAggregate(Aggregate *aggreg, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2513,7 +2513,7 @@ void DatabaseModel::addDomain(Domain *domain, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } } @@ -2526,7 +2526,7 @@ void DatabaseModel::removeDomain(Domain *domain, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2548,7 +2548,7 @@ void DatabaseModel::addOperatorFamily(OperatorFamily *op_family, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2570,7 +2570,7 @@ void DatabaseModel::removeOperatorFamily(OperatorFamily *op_family, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2582,7 +2582,7 @@ void DatabaseModel::addOperatorClass(OperatorClass *op_class, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2594,7 +2594,7 @@ void DatabaseModel::removeOperatorClass(OperatorClass *op_class, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2616,7 +2616,7 @@ void DatabaseModel::addOperator(Operator *oper, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2628,7 +2628,7 @@ void DatabaseModel::removeOperator(Operator *oper, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2679,7 +2679,7 @@ void DatabaseModel::addType(Type *type, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } } @@ -2692,7 +2692,7 @@ void DatabaseModel::removeType(Type *type, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2717,7 +2717,7 @@ void DatabaseModel::removeUserType(BaseObject *object, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2745,7 +2745,7 @@ void DatabaseModel::addPermissions(const vector &perms) itr++; } - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2781,7 +2781,7 @@ void DatabaseModel::addPermission(Permission *perm) } catch(Exception &e) { - if(e.getErrorType()==ErrorCode::AsgDuplicatedObject) + if(e.getErrorCode()==ErrorCode::AsgDuplicatedObject) throw Exception(Exception::getErrorMessage(ErrorCode::AsgDuplicatedPermission) .arg(perm->getObject()->getName()) @@ -2789,7 +2789,7 @@ void DatabaseModel::addPermission(Permission *perm) ErrorCode::AsgDuplicatedPermission,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2801,7 +2801,7 @@ void DatabaseModel::removePermission(Permission *perm) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -3111,7 +3111,7 @@ void DatabaseModel::loadModel(const QString &filename) catch(Exception &e) { QString info_adicional=QString(QObject::trUtf8("%1 (line: %2)")).arg(xmlparser.getLoadedFilename()).arg(xmlparser.getCurrentElement()->line); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, info_adicional); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, info_adicional); } } } @@ -3175,13 +3175,13 @@ void DatabaseModel::loadModel(const QString &filename) if(xmlparser.getCurrentElement()) extra_info=QString(QObject::trUtf8("%1 (line: %2)")).arg(xmlparser.getLoadedFilename()).arg(xmlparser.getCurrentElement()->line); - if(e.getErrorType()>=ErrorCode::InvalidSyntax) + if(e.getErrorCode()>=ErrorCode::InvalidSyntax) { str_aux=Exception::getErrorMessage(ErrorCode::InvModelFileNotLoaded).arg(filename); throw Exception(str_aux,ErrorCode::InvModelFileNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } } } @@ -3566,7 +3566,7 @@ Role *DatabaseModel::createRole(void) catch(Exception &e) { if(role) delete(role); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(role); @@ -3587,7 +3587,7 @@ Tablespace *DatabaseModel::createTablespace(void) catch(Exception &e) { if(tabspc) delete(tabspc); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(tabspc); @@ -3611,7 +3611,7 @@ Schema *DatabaseModel::createSchema(void) catch(Exception &e) { if(schema) delete(schema); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(schema); @@ -3687,7 +3687,7 @@ Language *DatabaseModel::createLanguage(void) catch(Exception &e) { if(lang) delete(lang); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(lang); @@ -3779,7 +3779,7 @@ Function *DatabaseModel::createFunction(void) catch(Exception &e) { xmlparser.restorePosition(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } //Gets the function language @@ -3834,13 +3834,13 @@ Function *DatabaseModel::createFunction(void) delete(func); } - if(e.getErrorType()==ErrorCode::RefUserTypeInexistsModel) + if(e.getErrorCode()==ErrorCode::RefUserTypeInexistsModel) throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(str_aux) .arg(BaseObject::getTypeName(ObjectType::Function)), ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(func); @@ -3887,7 +3887,7 @@ Parameter DatabaseModel::createParameter(void) { QString extra_info=getErrorExtraInfo(); xmlparser.restorePosition(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } return(param); @@ -3949,7 +3949,7 @@ TypeAttribute DatabaseModel::createTypeAttribute(void) { QString extra_info=getErrorExtraInfo(); xmlparser.restorePosition(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } return(tpattrib); @@ -4183,13 +4183,13 @@ Type *DatabaseModel::createType(void) delete(type); } - if(e.getErrorType()==ErrorCode::RefUserTypeInexistsModel) + if(e.getErrorCode()==ErrorCode::RefUserTypeInexistsModel) throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(str_aux) .arg(type->getTypeName()), ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, getErrorExtraInfo()); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(type); @@ -4242,7 +4242,7 @@ Domain *DatabaseModel::createDomain(void) catch(Exception &e) { if(domain) delete(domain); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(domain); @@ -4315,7 +4315,7 @@ Cast *DatabaseModel::createCast(void) catch(Exception &e) { if(cast) delete(cast); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(cast); @@ -4374,7 +4374,7 @@ Conversion *DatabaseModel::createConversion(void) catch(Exception &e) { if(conv) delete(conv); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(conv); @@ -4469,7 +4469,7 @@ Operator *DatabaseModel::createOperator(void) catch(Exception &e) { if(oper) delete(oper); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(oper); @@ -4587,7 +4587,7 @@ OperatorClass *DatabaseModel::createOperatorClass(void) catch(Exception &e) { if(op_class) delete(op_class); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(op_class); @@ -4608,7 +4608,7 @@ OperatorFamily *DatabaseModel::createOperatorFamily(void) catch(Exception &e) { if(op_family) delete(op_family); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(op_family); @@ -4677,7 +4677,7 @@ Aggregate *DatabaseModel::createAggregate(void) catch(Exception &e) { if(aggreg) delete(aggreg); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(aggreg); @@ -4830,7 +4830,7 @@ Table *DatabaseModel::createTable(void) xmlparser.restorePosition(); if(table) delete(table); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } return(table); @@ -4893,7 +4893,7 @@ Column *DatabaseModel::createColumn(void) catch(Exception &e) { if(column) delete(column); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(column); @@ -5108,7 +5108,7 @@ Constraint *DatabaseModel::createConstraint(BaseObject *parent_obj) catch(Exception &e) { if(constr) delete(constr); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(constr); @@ -5317,7 +5317,7 @@ QString DatabaseModel::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -5392,7 +5392,7 @@ Index *DatabaseModel::createIndex(void) catch(Exception &e) { if(index) delete(index); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(index); @@ -5472,7 +5472,7 @@ Rule *DatabaseModel::createRule(void) catch(Exception &e) { if(rule) delete(rule); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(rule); @@ -5630,7 +5630,7 @@ Trigger *DatabaseModel::createTrigger(void) catch(Exception &e) { if(trigger) delete(trigger); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(trigger); @@ -5722,7 +5722,7 @@ Policy *DatabaseModel::createPolicy(void) catch(Exception &e) { if(policy) delete(policy); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(policy); @@ -5782,7 +5782,7 @@ EventTrigger *DatabaseModel::createEventTrigger(void) catch(Exception &e) { if(event_trig) delete(event_trig); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(event_trig); @@ -5810,7 +5810,7 @@ GenericSQL *DatabaseModel::createGenericSQL(void) catch(Exception &e) { if(genericsql) delete(genericsql); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(genericsql); @@ -5916,7 +5916,7 @@ Sequence *DatabaseModel::createSequence(bool ignore_onwer) catch(Exception &e) { if(sequence) delete(sequence); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(sequence); @@ -6137,7 +6137,7 @@ View *DatabaseModel::createView(void) catch(Exception &e) { if(view) delete(view); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(view); @@ -6191,7 +6191,7 @@ Collation *DatabaseModel::createCollation(void) catch(Exception &e) { if(collation) delete(collation); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(collation); @@ -6215,7 +6215,7 @@ Extension *DatabaseModel::createExtension(void) catch(Exception &e) { if(extension) delete(extension); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(extension); @@ -6255,7 +6255,7 @@ Tag *DatabaseModel::createTag(void) catch(Exception &e) { if(tag) delete(tag); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } } @@ -6286,7 +6286,7 @@ Textbox *DatabaseModel::createTextbox(void) catch(Exception &e) { if(txtbox) delete(txtbox); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(txtbox); @@ -6572,7 +6572,7 @@ BaseRelationship *DatabaseModel::createRelationship(void) if(base_rel && base_rel->getObjectType()==ObjectType::Relationship) delete(base_rel); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } if(rel) @@ -6730,7 +6730,7 @@ Permission *DatabaseModel::createPermission(void) catch(Exception &e) { if(perm) delete(perm); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); } return(perm); @@ -6803,7 +6803,7 @@ void DatabaseModel::validateRelationships(TableObject *object, Table *parent_tab } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -6874,7 +6874,7 @@ QString DatabaseModel::__getCodeDefinition(unsigned def_type) { this->appended_sql=bkp_appended_sql; this->prepended_sql=bkp_prepended_sql; - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -7070,7 +7070,7 @@ QString DatabaseModel::getCodeDefinition(unsigned def_type, bool export_file) } } } - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } attribs_aux[Attributes::ExportToFile]=(export_file ? Attributes::True : QString()); @@ -10209,7 +10209,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(xmlparser.getCurrentElement()) extra_info=QString(QObject::trUtf8("%1 (line: %2)")).arg(xmlparser.getLoadedFilename()).arg(xmlparser.getCurrentElement()->line); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, extra_info); } } diff --git a/libpgmodeler/src/domain.cpp b/libpgmodeler/src/domain.cpp index 5cba73b4a6..33900ef74f 100644 --- a/libpgmodeler/src/domain.cpp +++ b/libpgmodeler/src/domain.cpp @@ -227,6 +227,6 @@ QString Domain::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/eventtrigger.cpp b/libpgmodeler/src/eventtrigger.cpp index c02c206974..e2662e5fb8 100644 --- a/libpgmodeler/src/eventtrigger.cpp +++ b/libpgmodeler/src/eventtrigger.cpp @@ -148,6 +148,6 @@ QString EventTrigger::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/extension.cpp b/libpgmodeler/src/extension.cpp index faafca7e79..7093023cc6 100644 --- a/libpgmodeler/src/extension.cpp +++ b/libpgmodeler/src/extension.cpp @@ -113,7 +113,7 @@ QString Extension::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 3f9c60312f..37562db201 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -22,13 +22,17 @@ ForeignDataWrapper::ForeignDataWrapper(void) { obj_type=ObjectType::ForeignDataWrapper; validator_func = handler_func = nullptr; + + attributes[Attributes::HandlerFunc] = QString(); + attributes[Attributes::ValidatorFunc] = QString(); + attributes[Attributes::Options] = QString(); } void ForeignDataWrapper::setHandlerFunction(Function *func) { if(func) { - if(func->getReturnType() != PgSqlType("fwd_handler")) + if(func->getReturnType() != PgSqlType("fdw_handler")) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidReturnType) .arg(this->getName(true)) .arg(this->getTypeName()), @@ -59,7 +63,7 @@ void ForeignDataWrapper::setValidatorFunction(Function *func) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName(true)) .arg(this->getTypeName()), - ErrorCode::AsgFunctionInvalidParamCount, __PRETTY_FUNCTION__, __FILE__, __LINE__); + ErrorCode::AsgFunctionInvalidParameters, __PRETTY_FUNCTION__, __FILE__, __LINE__); } diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index be504db64b..820762ef05 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -547,6 +547,6 @@ QString Function::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index 5cc2abaccf..a5cc67a92f 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -110,7 +110,7 @@ void Index::addIndexElement(const QString &expr, Collation *coll, OperatorClass } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -144,7 +144,7 @@ void Index::addIndexElement(Column *column, Collation *coll, OperatorClass *op_c } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -162,7 +162,7 @@ void Index::addIndexElements(vector &elems) catch(Exception &e) { idx_elements = elems_bkp; - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -406,7 +406,7 @@ QString Index::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 5a520d81ae..0a9cce0377 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -182,7 +182,7 @@ void OperationList::addToPool(BaseObject *object, unsigned op_type) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -491,7 +491,7 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje removeFromPool(object_pool.size()-1); delete(operation); } - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -617,7 +617,7 @@ void OperationList::undoOperation(void) while(!ignore_chain && isUndoAvailable() && operation->getChainType()!=Operation::NoChain); - if(error.getErrorType()!=ErrorCode::Custom) + if(error.getErrorCode()!=ErrorCode::Custom) throw Exception(ErrorCode::UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); } } @@ -672,7 +672,7 @@ void OperationList::redoOperation(void) while(!ignore_chain && isRedoAvailable() && operation->getChainType()!=Operation::NoChain); - if(error.getErrorType()!=ErrorCode::Custom) + if(error.getErrorCode()!=ErrorCode::Custom) throw Exception(ErrorCode::UndoRedoOperationInvalidObject,__PRETTY_FUNCTION__,__FILE__,__LINE__, &error); } } diff --git a/libpgmodeler/src/parameter.cpp b/libpgmodeler/src/parameter.cpp index f8bd80c811..b2d13a2f3b 100644 --- a/libpgmodeler/src/parameter.cpp +++ b/libpgmodeler/src/parameter.cpp @@ -24,6 +24,15 @@ Parameter::Parameter(void) is_in=is_out=is_variadic=false; } +Parameter::Parameter(const QString &name, PgSqlType type, bool in, bool out, bool variadic) : Parameter() +{ + setName(name); + setType(type); + setIn(in); + setOut(out); + setVariadic(variadic); +} + void Parameter::setType(PgSqlType type) { if(!type.isArrayType() && !type.isPolymorphicType() && is_variadic) diff --git a/libpgmodeler/src/parameter.h b/libpgmodeler/src/parameter.h index 5f52e85e4e..d8f9672a4e 100644 --- a/libpgmodeler/src/parameter.h +++ b/libpgmodeler/src/parameter.h @@ -34,6 +34,7 @@ class Parameter: public Column { public: Parameter(void); + Parameter(const QString &name, PgSqlType type, bool in = false, bool out = false, bool variadic = false); void setType(PgSqlType type); void setIn(bool value); diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index f961e7e425..a60b4b4023 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -515,6 +515,6 @@ QString Permission::getDropDefinition(bool cascade) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index c9d73e7654..0e6c9dc360 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -913,7 +913,7 @@ PgSqlType PgSqlType::parseString(const QString &str) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, str); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, str); } } diff --git a/libpgmodeler/src/policy.cpp b/libpgmodeler/src/policy.cpp index 6e75f5ba48..85ea6c705c 100644 --- a/libpgmodeler/src/policy.cpp +++ b/libpgmodeler/src/policy.cpp @@ -178,7 +178,7 @@ QString Policy::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/relationship.cpp b/libpgmodeler/src/relationship.cpp index 56879fe877..0a6608cf79 100644 --- a/libpgmodeler/src/relationship.cpp +++ b/libpgmodeler/src/relationship.cpp @@ -176,7 +176,7 @@ Relationship::Relationship(unsigned rel_type, Table *src_tab, } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -559,13 +559,13 @@ void Relationship::addObject(TableObject *tab_obj, int obj_idx) } catch(Exception &e) { - if(e.getErrorType()==ErrorCode::UndefinedAttributeValue) + if(e.getErrorCode()==ErrorCode::UndefinedAttributeValue) throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(tab_obj->getName()) .arg(tab_obj->getTypeName()), ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -871,7 +871,7 @@ void Relationship::addConstraints(Table *recv_tab) itr++; } - throw Exception(e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1133,7 +1133,7 @@ void Relationship::addColumnsRelGenPart(void) this->connected=true; this->disconnectRelationship(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1174,7 +1174,7 @@ void Relationship::addConstraintsRelGenPart(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1255,7 +1255,7 @@ void Relationship::connectRelationship(void) delete(table_relnn); table_relnn=nullptr; } - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1323,7 +1323,7 @@ void Relationship::configureIndentifierRel(Table *recv_tab) pk_relident=nullptr; } - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1366,7 +1366,7 @@ void Relationship::addUniqueKey(Table *recv_tab) uq_rel11=nullptr; } - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1494,7 +1494,7 @@ void Relationship::addForeignKey(Table *ref_tab, Table *recv_tab, ActionType del fk_rel1n=nullptr; } - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1532,7 +1532,7 @@ void Relationship::addAttributes(Table *recv_tab) itr++; } - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1647,7 +1647,7 @@ void Relationship::copyColumns(Table *ref_tab, Table *recv_tab, bool not_null, b prev_ref_col_names.clear(); pk_columns.clear(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1727,7 +1727,7 @@ void Relationship::addColumnsRel11(void) this->connected=true; this->disconnectRelationship(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1804,7 +1804,7 @@ void Relationship::addColumnsRel1n(void) this->connected=true; this->disconnectRelationship(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1894,7 +1894,7 @@ void Relationship::addColumnsRelNn(void) //Forcing the relationship as connected to perform the disconnection operations this->connected=true; this->disconnectRelationship(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2278,7 +2278,7 @@ void Relationship::disconnectRelationship(bool rem_tab_objs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index e6c53f54ca..3f16164cab 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -386,6 +386,6 @@ QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/sequence.cpp b/libpgmodeler/src/sequence.cpp index 9d3570c81b..d72250af4b 100644 --- a/libpgmodeler/src/sequence.cpp +++ b/libpgmodeler/src/sequence.cpp @@ -469,7 +469,7 @@ QString Sequence::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 15104b2186..7f9e27ff7a 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -485,13 +485,13 @@ void Table::addObject(BaseObject *obj, int obj_idx) } catch(Exception &e) { - if(e.getErrorType()==ErrorCode::UndefinedAttributeValue) + if(e.getErrorCode()==ErrorCode::UndefinedAttributeValue) throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(obj->getName()) .arg(obj->getTypeName()), ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -504,7 +504,7 @@ void Table::addColumn(Column *col, int idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -516,7 +516,7 @@ void Table::addTrigger(Trigger *trig, int idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -528,7 +528,7 @@ void Table::addIndex(Index *ind, int idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -540,7 +540,7 @@ void Table::addRule(Rule *reg, int idx_reg) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -552,7 +552,7 @@ void Table::addPolicy(Policy *pol, int idx_pol) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -598,7 +598,7 @@ void Table::addConstraint(Constraint *constr, int idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -610,7 +610,7 @@ void Table::addAncestorTable(Table *tab, int idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -734,7 +734,7 @@ void Table::removeObject(BaseObject *obj) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -847,7 +847,7 @@ void Table::removeColumn(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -859,7 +859,7 @@ void Table::removeColumn(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -871,7 +871,7 @@ void Table::removeTrigger(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -883,7 +883,7 @@ void Table::removeTrigger(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -895,7 +895,7 @@ void Table::removeIndex(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -907,7 +907,7 @@ void Table::removeIndex(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -919,7 +919,7 @@ void Table::removeRule(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -931,7 +931,7 @@ void Table::removeRule(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -943,7 +943,7 @@ void Table::removePolicy(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -955,7 +955,7 @@ void Table::removePolicy(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -967,7 +967,7 @@ void Table::removeConstraint(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -979,7 +979,7 @@ void Table::removeConstraint(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -991,7 +991,7 @@ void Table::removeAncestorTable(const QString &name) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1003,7 +1003,7 @@ void Table::removeAncestorTable(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1766,7 +1766,7 @@ void Table::swapObjectsIndexes(ObjectType obj_type, unsigned idx1, unsigned idx2 } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1921,7 +1921,7 @@ QString Table::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1935,7 +1935,7 @@ QString Table::getTruncateDefinition(bool cascade) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/tag.cpp b/libpgmodeler/src/tag.cpp index aece39988c..38f7c546d5 100644 --- a/libpgmodeler/src/tag.cpp +++ b/libpgmodeler/src/tag.cpp @@ -64,7 +64,7 @@ void Tag::setElementColor(const QString &elem_id, const QColor &color, unsigned } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -86,7 +86,7 @@ void Tag::setElementColors(const QString &elem_id, const QString &colors) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -99,7 +99,7 @@ QColor Tag::getElementColor(const QString &elem_id, unsigned color_id) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -130,7 +130,7 @@ QLinearGradient Tag::getFillStyle(const QString &elem_id) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -168,7 +168,7 @@ QString Tag::getCodeDefinition(unsigned def_type, bool reduced_form) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } return(BaseObject::getCodeDefinition(def_type, reduced_form)); diff --git a/libpgmodeler/src/type.cpp b/libpgmodeler/src/type.cpp index 826c0de562..12fb203989 100644 --- a/libpgmodeler/src/type.cpp +++ b/libpgmodeler/src/type.cpp @@ -805,7 +805,7 @@ QString Type::getAlterDefinition(BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 3a722b577c..0194678311 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -827,13 +827,13 @@ void View::addObject(BaseObject *obj, int obj_idx) } catch(Exception &e) { - if(e.getErrorType()==ErrorCode::UndefinedAttributeValue) + if(e.getErrorCode()==ErrorCode::UndefinedAttributeValue) throw Exception(Exception::getErrorMessage(ErrorCode::AsgObjectInvalidDefinition) .arg(obj->getName()) .arg(obj->getTypeName()), ErrorCode::AsgObjectInvalidDefinition,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -846,7 +846,7 @@ void View::addTrigger(Trigger *trig, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -858,7 +858,7 @@ void View::addRule(Rule *rule, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -870,7 +870,7 @@ void View::addIndex(Index *index, int obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -897,7 +897,7 @@ void View::removeObject(BaseObject *obj) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -909,7 +909,7 @@ void View::removeObject(const QString &name, ObjectType obj_type) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -921,7 +921,7 @@ void View::removeTrigger(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -933,7 +933,7 @@ void View::removeRule(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -945,7 +945,7 @@ void View::removeIndex(unsigned idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -974,7 +974,7 @@ TableObject *View::getObject(const QString &name, ObjectType obj_type) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -986,7 +986,7 @@ Trigger *View::getTrigger(unsigned obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -998,7 +998,7 @@ Rule *View::getRule(unsigned obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1010,7 +1010,7 @@ Index *View::getIndex(unsigned obj_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1022,7 +1022,7 @@ unsigned View::getObjectCount(ObjectType obj_type, bool) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/aggregatewidget.cpp b/libpgmodeler_ui/src/aggregatewidget.cpp index 424de8a05f..c90d971f88 100644 --- a/libpgmodeler_ui/src/aggregatewidget.cpp +++ b/libpgmodeler_ui/src/aggregatewidget.cpp @@ -79,7 +79,7 @@ AggregateWidget::AggregateWidget(QWidget *parent): BaseObjectWidget(parent, Obje } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -135,7 +135,7 @@ void AggregateWidget::handleDataType(int row) if(input_types_tab->getCellText(row, 0).isEmpty()) input_types_tab->removeRow(row); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -168,7 +168,7 @@ void AggregateWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/appearanceconfigwidget.cpp b/libpgmodeler_ui/src/appearanceconfigwidget.cpp index c4b9f9d14a..81cbb6c323 100644 --- a/libpgmodeler_ui/src/appearanceconfigwidget.cpp +++ b/libpgmodeler_ui/src/appearanceconfigwidget.cpp @@ -205,7 +205,7 @@ void AppearanceConfigWidget::loadExampleModel(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -245,7 +245,7 @@ void AppearanceConfigWidget::loadConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); } } @@ -312,7 +312,7 @@ void AppearanceConfigWidget::saveConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -424,7 +424,7 @@ void AppearanceConfigWidget::restoreDefaults(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/baseconfigwidget.cpp b/libpgmodeler_ui/src/baseconfigwidget.cpp index 05c40644e1..49c4b250b7 100644 --- a/libpgmodeler_ui/src/baseconfigwidget.cpp +++ b/libpgmodeler_ui/src/baseconfigwidget.cpp @@ -196,7 +196,7 @@ void BaseConfigWidget::loadConfiguration(const QString &conf_id, mapobject->getName()).arg(this->object->getTypeName()), ErrorCode::RequiredFieldsNotFilled,__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -965,6 +965,6 @@ void BaseObjectWidget::registerNewObject(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 7429498aae..6130b7845f 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -225,7 +225,7 @@ void BaseObjectWidget::startConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/castwidget.cpp b/libpgmodeler_ui/src/castwidget.cpp index ae1c781a5d..ed5586a57c 100644 --- a/libpgmodeler_ui/src/castwidget.cpp +++ b/libpgmodeler_ui/src/castwidget.cpp @@ -58,7 +58,7 @@ CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ca } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -113,7 +113,7 @@ void CastWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/collationwidget.cpp b/libpgmodeler_ui/src/collationwidget.cpp index cb546820d0..1b1f22227f 100644 --- a/libpgmodeler_ui/src/collationwidget.cpp +++ b/libpgmodeler_ui/src/collationwidget.cpp @@ -66,7 +66,7 @@ CollationWidget::CollationWidget(QWidget *parent): BaseObjectWidget(parent, Obje } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -170,6 +170,6 @@ void CollationWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/columnwidget.cpp b/libpgmodeler_ui/src/columnwidget.cpp index 29719108ba..af0ffe3412 100644 --- a/libpgmodeler_ui/src/columnwidget.cpp +++ b/libpgmodeler_ui/src/columnwidget.cpp @@ -91,7 +91,7 @@ ColumnWidget::ColumnWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -205,7 +205,7 @@ void ColumnWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index 04e5921b4d..245a0f6611 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -115,7 +115,7 @@ void ConfigurationForm::loadConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==ErrorCode::PluginsNotLoaded) + if(e.getErrorCode()==ErrorCode::PluginsNotLoaded) { msg_box.show(e); } diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 08646dbd62..726de560ff 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -165,7 +165,7 @@ void ConnectionsConfigWidget::loadConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); } } @@ -253,7 +253,7 @@ void ConnectionsConfigWidget::duplicateConnection(void) if(new_conn) delete(new_conn); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -287,7 +287,7 @@ void ConnectionsConfigWidget::handleConnection(void) if(add_tb->isVisible()) delete(conn); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -442,7 +442,7 @@ void ConnectionsConfigWidget::testConnection(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -465,7 +465,7 @@ void ConnectionsConfigWidget::restoreDefaults(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -533,7 +533,7 @@ void ConnectionsConfigWidget::saveConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -626,7 +626,7 @@ bool ConnectionsConfigWidget::openConnectionsConfiguration(QComboBox *combo, boo catch(Exception &e) { combo->setCurrentIndex(0); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } return(conn_saved); diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 7a00efaad8..1a9cdfbb75 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -119,7 +119,7 @@ ConstraintWidget::ConstraintWidget(QWidget *parent): BaseObjectWidget(parent, Ob } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -161,7 +161,7 @@ void ConstraintWidget::addColumn(int row) catch(Exception &e) { aux_col_tab->removeRow(row); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -271,7 +271,7 @@ void ConstraintWidget::updateColumnsCombo(unsigned col_id) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/conversionwidget.cpp b/libpgmodeler_ui/src/conversionwidget.cpp index fd7942961a..e7d3db6d06 100644 --- a/libpgmodeler_ui/src/conversionwidget.cpp +++ b/libpgmodeler_ui/src/conversionwidget.cpp @@ -52,7 +52,7 @@ ConversionWidget::ConversionWidget(QWidget *parent): BaseObjectWidget(parent, Ob } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -91,7 +91,7 @@ void ConversionWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/customsqlwidget.cpp b/libpgmodeler_ui/src/customsqlwidget.cpp index 61bf3b39f9..3f8913596f 100644 --- a/libpgmodeler_ui/src/customsqlwidget.cpp +++ b/libpgmodeler_ui/src/customsqlwidget.cpp @@ -93,7 +93,7 @@ CustomSQLWidget::CustomSQLWidget(QWidget *parent) : BaseObjectWidget(parent) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -157,7 +157,7 @@ void CustomSQLWidget::setAttributes(DatabaseModel *model, BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 99657ac373..31688f41d9 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -430,7 +430,7 @@ void DatabaseExplorerWidget::formatOidAttribs(attribs_map &attribs, QStringList } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -610,7 +610,7 @@ void DatabaseExplorerWidget::formatSequenceAttribs(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -892,7 +892,7 @@ QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -927,7 +927,7 @@ QStringList DatabaseExplorerWidget::getObjectsNames(ObjectType obj_type, const Q } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -945,7 +945,7 @@ QString DatabaseExplorerWidget::getObjectName(ObjectType obj_type, const QString } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1010,7 +1010,7 @@ void DatabaseExplorerWidget::listObjects(void) catch(Exception &e) { QApplication::restoreOverrideCursor(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1348,7 +1348,7 @@ bool DatabaseExplorerWidget::truncateTable(const QString &sch_name, const QStrin } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__); } } @@ -1537,7 +1537,7 @@ void DatabaseExplorerWidget::loadObjectProperties(bool force_reload) catch(Exception &e) { QApplication::restoreOverrideCursor(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -1693,7 +1693,7 @@ void DatabaseExplorerWidget::showObjectProperties(bool force_reload) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -2002,7 +2002,7 @@ void DatabaseExplorerWidget::dropDatabase(void) .arg(dbname).arg(connection.getConnectionParam(Connection::ParamAlias)), ErrorCode::DropCurrentDBDefault,__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 11d7e1d21d..7830a739b0 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -225,7 +225,7 @@ void DatabaseImportForm::importDatabase(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -329,7 +329,7 @@ void DatabaseImportForm::listObjects(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -366,7 +366,7 @@ void DatabaseImportForm::listDatabases(void) db_objects_tw->clear(); database_cmb->clear(); database_cmb->setEnabled(false); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -409,7 +409,7 @@ void DatabaseImportForm::captureThreadError(Exception e) createThread(); database_cmb->setCurrentIndex(0); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } void DatabaseImportForm::filterObjects(void) @@ -622,7 +622,7 @@ void DatabaseImportForm::listDatabases(DatabaseImportHelper &import_helper, QCom } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -736,7 +736,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { task_prog_wgt.close(); tree_wgt->clear(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -890,7 +890,7 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } return(items_vect); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index d6ccba55fd..ac09e91039 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -41,7 +41,7 @@ void DatabaseImportHelper::setConnection(Connection &conn) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -60,7 +60,7 @@ void DatabaseImportHelper::setCurrentDatabase(const QString &dbname) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -133,7 +133,7 @@ attribs_map DatabaseImportHelper::getObjects(ObjectType obj_type, const QString } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -146,7 +146,7 @@ vector DatabaseImportHelper::getObjects(vector obj_type } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -285,7 +285,7 @@ void DatabaseImportHelper::retrieveTableColumns(const QString &sch_name, const Q } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -375,7 +375,7 @@ void DatabaseImportHelper::createObjects(void) { //In case of some error store the oid and the error in separated lists not_created_objs.push_back(*itr); - aux_errors.push_back(Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); + aux_errors.push_back(Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); } progress=(i/static_cast(not_created_objs.size())) * 100; @@ -393,7 +393,7 @@ void DatabaseImportHelper::createObjects(void) /* If the previous list size is the same as the not_created_object list means that no object was created in this interaction which means error */ if(prev_size==not_created_objs.size() && !ignore_errors) - throw Exception(aux_errors.back().getErrorMessage(), aux_errors.back().getErrorType(), + throw Exception(aux_errors.back().getErrorMessage(), aux_errors.back().getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, aux_errors); else if(ignore_errors) errors.insert(errors.end(), aux_errors.begin(), aux_errors.end()); @@ -436,9 +436,9 @@ void DatabaseImportHelper::createConstraints(void) catch(Exception &e) { if(ignore_errors) - errors.push_back(Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); + errors.push_back(Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); else - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } progress=(i/static_cast(constr_creation_order.size())) * 100; @@ -498,9 +498,9 @@ void DatabaseImportHelper::createPermissions(void) catch(Exception &e) { if(ignore_errors) - errors.push_back(Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); + errors.push_back(Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); else - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -536,7 +536,7 @@ void DatabaseImportHelper::updateFKRelationships(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -643,10 +643,10 @@ void DatabaseImportHelper::importDatabase(void) /* When running in a separated thread (other than the main application thread) redirects the error in form of signal */ if(this->thread() && this->thread()!=qApp->thread()) - emit s_importAborted(Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo())); + emit s_importAborted(Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo())); else //Redirects any error to the user - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); } } @@ -769,7 +769,7 @@ QString DatabaseImportHelper::getComment(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -852,7 +852,7 @@ QString DatabaseImportHelper::getDependencyObject(const QString &oid, ObjectType } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -879,7 +879,7 @@ void DatabaseImportHelper::loadObjectXML(ObjectType obj_type, attribs_map &attri } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xml_buf); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xml_buf); } } @@ -936,7 +936,7 @@ void DatabaseImportHelper::createTablespace(attribs_map &attribs) catch(Exception &e) { if(tabspc) delete(tabspc); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -959,7 +959,7 @@ void DatabaseImportHelper::createSchema(attribs_map &attribs) catch(Exception &e) { if(schema) delete(schema); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -984,7 +984,7 @@ void DatabaseImportHelper::createRole(attribs_map &attribs) catch(Exception &e) { if(role) delete(role); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1026,7 +1026,7 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) catch(Exception &e) { if(dom) delete(dom); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1044,7 +1044,7 @@ void DatabaseImportHelper::createExtension(attribs_map &attribs) catch(Exception &e) { if(ext) delete(ext); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1172,7 +1172,7 @@ void DatabaseImportHelper::createFunction(attribs_map &attribs) catch(Exception &e) { if(func) delete(func); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1209,7 +1209,7 @@ void DatabaseImportHelper::createLanguage(attribs_map &attribs) catch(Exception &e) { if(lang) delete(lang); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1227,7 +1227,7 @@ void DatabaseImportHelper::createOperatorFamily(attribs_map &attribs) catch(Exception &e) { if(opfam) delete(opfam); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1309,7 +1309,7 @@ void DatabaseImportHelper::createOperatorClass(attribs_map &attribs) catch(Exception &e) { if(opclass) delete(opclass); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1368,7 +1368,7 @@ void DatabaseImportHelper::createOperator(attribs_map &attribs) catch(Exception &e) { if(oper) delete(oper); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1386,7 +1386,7 @@ void DatabaseImportHelper::createCollation(attribs_map &attribs) catch(Exception &e) { if(coll) delete(coll); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1407,7 +1407,7 @@ void DatabaseImportHelper::createCast(attribs_map &attribs) catch(Exception &e) { if(cast) delete(cast); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1426,7 +1426,7 @@ void DatabaseImportHelper::createConversion(attribs_map &attribs) catch(Exception &e) { if(conv) delete(conv); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1491,7 +1491,7 @@ void DatabaseImportHelper::createSequence(attribs_map &attribs) catch(Exception &e) { if(seq) delete(seq); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1538,7 +1538,7 @@ void DatabaseImportHelper::createAggregate(attribs_map &attribs) catch(Exception &e) { if(agg) delete(agg); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1623,7 +1623,7 @@ void DatabaseImportHelper::createType(attribs_map &attribs) catch(Exception &e) { if(type) delete(type); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1859,7 +1859,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) catch(Exception &e) { if(table) delete(table); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1957,7 +1957,7 @@ void DatabaseImportHelper::createView(attribs_map &attribs) catch(Exception &e) { if(view) delete(view); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -1992,7 +1992,7 @@ void DatabaseImportHelper::createRule(attribs_map &attribs) catch(Exception &e) { if(rule) delete(rule); - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -2015,7 +2015,7 @@ void DatabaseImportHelper::createTrigger(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -2145,7 +2145,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -2258,7 +2258,7 @@ void DatabaseImportHelper::createConstraint(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -2274,7 +2274,7 @@ void DatabaseImportHelper::createPolicy(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -2295,7 +2295,7 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -2395,9 +2395,9 @@ void DatabaseImportHelper::createPermission(attribs_map &attribs) if(perm) delete(perm); if(ignore_errors) - errors.push_back(Exception(e.getErrorMessage(), e.getErrorType(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); + errors.push_back(Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); else - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -2422,7 +2422,7 @@ void DatabaseImportHelper::createTableInheritances(void) if(ignore_errors) errors.push_back(e); else - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -2465,7 +2465,7 @@ void DatabaseImportHelper::createTablePartitionings(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2502,7 +2502,7 @@ void DatabaseImportHelper::destroyDetachedColumns(void) if(ignore_errors) errors.push_back(e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } } @@ -2616,7 +2616,7 @@ void DatabaseImportHelper::__createTableInheritances(void) if(ignore_errors) errors.push_back(e); else - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -2635,7 +2635,7 @@ void DatabaseImportHelper::configureDatabase(attribs_map &attribs) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(), + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } } @@ -2882,7 +2882,7 @@ QString DatabaseImportHelper::getType(const QString &oid_str, bool generate_xml, } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/databasewidget.cpp b/libpgmodeler_ui/src/databasewidget.cpp index 8759f1d28c..bf650bc1a7 100644 --- a/libpgmodeler_ui/src/databasewidget.cpp +++ b/libpgmodeler_ui/src/databasewidget.cpp @@ -73,7 +73,7 @@ DatabaseWidget::DatabaseWidget(QWidget *parent): BaseObjectWidget(parent, Object } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -153,6 +153,6 @@ void DatabaseWidget::applyConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index be72097075..18ae04cdbb 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -247,7 +247,7 @@ void DataManipulationForm::setAttributes(Connection conn, const QString curr_sch } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -314,7 +314,7 @@ void DataManipulationForm::listColumns(void) catch(Exception &e) { catalog.closeConnection(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -438,7 +438,7 @@ void DataManipulationForm::retrieveData(void) QApplication::restoreOverrideCursor(); conn_sql.close(); catalog.closeConnection(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -710,7 +710,7 @@ void DataManipulationForm::listObjects(QComboBox *combo, vector obj_ catch(Exception &e) { catalog.closeConnection(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -774,7 +774,7 @@ void DataManipulationForm::retrievePKColumns(const QString &schema, const QStrin catch(Exception &e) { catalog.closeConnection(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -902,7 +902,7 @@ void DataManipulationForm::retrieveFKColumns(const QString &schema, const QStrin catch(Exception &e) { catalog.closeConnection(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/domainwidget.cpp b/libpgmodeler_ui/src/domainwidget.cpp index 248d8dfab6..6f0e593c66 100644 --- a/libpgmodeler_ui/src/domainwidget.cpp +++ b/libpgmodeler_ui/src/domainwidget.cpp @@ -60,7 +60,7 @@ DomainWidget::DomainWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -133,7 +133,7 @@ void DomainWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/elementstablewidget.cpp b/libpgmodeler_ui/src/elementstablewidget.cpp index 060b855113..84af5f4d64 100644 --- a/libpgmodeler_ui/src/elementstablewidget.cpp +++ b/libpgmodeler_ui/src/elementstablewidget.cpp @@ -58,7 +58,7 @@ ElementsTableWidget::ElementsTableWidget(QWidget *parent) : QWidget(parent) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/elementwidget.cpp b/libpgmodeler_ui/src/elementwidget.cpp index f46e6a9a21..186df506e1 100644 --- a/libpgmodeler_ui/src/elementwidget.cpp +++ b/libpgmodeler_ui/src/elementwidget.cpp @@ -78,7 +78,7 @@ ElementWidget::ElementWidget(QWidget *parent) : QWidget(parent) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -243,7 +243,7 @@ void ElementWidget::updateColumnsCombo(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/eventtriggerwidget.cpp b/libpgmodeler_ui/src/eventtriggerwidget.cpp index 303fa8bbf0..4fa8e17d4b 100644 --- a/libpgmodeler_ui/src/eventtriggerwidget.cpp +++ b/libpgmodeler_ui/src/eventtriggerwidget.cpp @@ -125,7 +125,7 @@ void EventTriggerWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/extensionwidget.cpp b/libpgmodeler_ui/src/extensionwidget.cpp index c4bc0ca0ac..969acf99c3 100644 --- a/libpgmodeler_ui/src/extensionwidget.cpp +++ b/libpgmodeler_ui/src/extensionwidget.cpp @@ -43,6 +43,6 @@ void ExtensionWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/functionwidget.cpp b/libpgmodeler_ui/src/functionwidget.cpp index e19d174a4e..1ea0bff99c 100644 --- a/libpgmodeler_ui/src/functionwidget.cpp +++ b/libpgmodeler_ui/src/functionwidget.cpp @@ -118,7 +118,7 @@ FunctionWidget::FunctionWidget(QWidget *parent): BaseObjectWidget(parent, Object } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -225,7 +225,7 @@ Parameter FunctionWidget::getParameter(ObjectsTableWidget *tab, unsigned row) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -565,7 +565,7 @@ void FunctionWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index d915248bd9..a27b1469ce 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -367,7 +367,7 @@ void GeneralConfigWidget::loadConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); } } @@ -594,7 +594,7 @@ void GeneralConfigWidget::saveConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -666,7 +666,7 @@ void GeneralConfigWidget::restoreDefaults(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 99cc38651d..049b8cf6e4 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -62,7 +62,7 @@ void GenericSQLWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index bf821fda24..45949bbccc 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -65,7 +65,7 @@ IndexWidget::IndexWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType:: } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -159,7 +159,7 @@ void IndexWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/languagewidget.cpp b/libpgmodeler_ui/src/languagewidget.cpp index 211a6a3a88..e50bd20f2e 100644 --- a/libpgmodeler_ui/src/languagewidget.cpp +++ b/libpgmodeler_ui/src/languagewidget.cpp @@ -51,7 +51,7 @@ LanguageWidget::LanguageWidget(QWidget *parent): BaseObjectWidget(parent, Object } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -93,7 +93,7 @@ void LanguageWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 99a08465db..a0676a3636 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -168,7 +168,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } connect(central_wgt->new_tb, SIGNAL(clicked()), this, SLOT(addModel())); @@ -852,7 +852,7 @@ void MainWindow::loadModelFromAction(void) if(QFileInfo(filename).exists()) showFixMessage(e, filename); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } } @@ -931,7 +931,7 @@ void MainWindow::addModel(const QString &filename) //delete(model_tab); updateToolsState(true); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -955,7 +955,7 @@ void MainWindow::addModel(const QString &filename) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -982,7 +982,7 @@ void MainWindow::addModel(ModelWidget *model_wgt) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1438,7 +1438,7 @@ void MainWindow::saveModel(ModelWidget *model) catch(Exception &e) { stopTimers(false); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } #endif } diff --git a/libpgmodeler_ui/src/metadatahandlingform.cpp b/libpgmodeler_ui/src/metadatahandlingform.cpp index 788b154689..db918eb8b9 100644 --- a/libpgmodeler_ui/src/metadatahandlingform.cpp +++ b/libpgmodeler_ui/src/metadatahandlingform.cpp @@ -263,7 +263,7 @@ void MetadataHandlingForm::handleObjectsMetada(void) ico_lbl->setPixmap(icon); progress_lbl->setText(trUtf8("Metadata processing aborted!")); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 49cbc8895d..ce21abcb45 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -144,7 +144,7 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -378,7 +378,7 @@ void ModelDatabaseDiffForm::listDatabases(void) db_cmb->clear(); db_cmb->setEnabled(false); db_lbl->setEnabled(false); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -490,7 +490,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -698,7 +698,7 @@ void ModelDatabaseDiffForm::captureThreadError(Exception e) item=PgModelerUiNs::createOutputTreeItem(output_trw, PgModelerUiNs::formatMessage(e.getErrorMessage()), *progress_ico_lbl->pixmap(), nullptr, false, true); PgModelerUiNs::createExceptionsTree(output_trw, e, item); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } void ModelDatabaseDiffForm::handleImportFinished(Exception e) diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index e427aa3b7e..89dd8ea48c 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -302,7 +302,7 @@ void ModelExportForm::captureThreadError(Exception e) ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_erro"))); finishExport(trUtf8("Exporting process aborted!")); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } void ModelExportForm::cancelExport(void) diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index a7fd0bccac..984bd252a4 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -26,9 +26,9 @@ void ModelExportHelper::abortExport(Exception &e) //When running in a separated thread (other than the main application thread) redirects the error in form of signal if(this->thread() && this->thread()!=qApp->thread()) - emit s_exportAborted(Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e)); + emit s_exportAborted(Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e)); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } void ModelExportHelper::handleSQLError(Exception &e, const QString &sql_cmd, bool ignore_dup) @@ -39,7 +39,7 @@ void ModelExportHelper::handleSQLError(Exception &e, const QString &sql_cmd, boo emit s_errorIgnored(e.getExtraInfo(), e.getErrorMessage(), sql_cmd); //Raises an excpetion if the error returned by the database is not listed in the ignored list of errors else if(ignored_errors.indexOf(e.getExtraInfo()) < 0) - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, sql_cmd); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e, sql_cmd); else errors.push_back(e); } @@ -82,7 +82,7 @@ void ModelExportHelper::exportToSQL(DatabaseModel *db_model, const QString &file catch(Exception &e) { disconnect(db_model, nullptr, this, nullptr); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } disconnect(db_model, nullptr, this, nullptr); @@ -236,7 +236,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -560,13 +560,13 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c if(this->thread() && this->thread()!=qApp->thread()) { errors.push_back(e); - emit s_exportAborted(Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, errors)); + emit s_exportAborted(Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, errors)); } else { //Redirects any error to terrorsr if(errors.empty()) - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); else { errors.push_back(e); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 38e9ced79b..9973fd0125 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -537,7 +537,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -595,7 +595,7 @@ void ModelObjectsWidget::updateTableTree(QTreeWidgetItem *root, BaseObject *sche } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -661,7 +661,7 @@ void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schem } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } @@ -692,7 +692,7 @@ void ModelObjectsWidget::updatePermissionTree(QTreeWidgetItem *root, BaseObject } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -780,7 +780,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } objectstree_tw->sortByColumn(0, Qt::AscendingOrder); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 74b82a45a7..ee8d416fd1 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -109,7 +109,7 @@ void ModelsDiffHelper::diffModels(void) } catch(Exception &e) { - emit s_diffAborted(Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo())); + emit s_diffAborted(Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo())); } destroyTempObjects(); @@ -389,7 +389,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -600,7 +600,7 @@ void ModelsDiffHelper::generateDiffInfo(unsigned diff_type, BaseObject *object, } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -946,7 +946,7 @@ void ModelsDiffHelper::processDiffInfos(void) for(Type *type : types) type->convertFunctionParameters(true); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -986,7 +986,7 @@ QString ModelsDiffHelper::getCodeDefinition(BaseObject *object, bool drop_cmd) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index 08e78203af..62b3a6735a 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -201,7 +201,7 @@ void ModelValidationHelper::resolveConflict(ValidationInfo &info) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -590,7 +590,7 @@ void ModelValidationHelper::validateModel(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index d72bd16473..8a25aca113 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -61,7 +61,7 @@ ModelValidationWidget::ModelValidationWidget(QWidget *parent): QWidget(parent) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index b48a1d153b..057a8ea388 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1361,7 +1361,7 @@ void ModelWidget::convertRelationshipNN(void) op_list->ignoreOperationChain(false); } - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } } @@ -1400,7 +1400,7 @@ void ModelWidget::loadModel(const QString &filename) { task_prog_wgt.close(); this->modified=false; - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1617,7 +1617,7 @@ void ModelWidget::saveModel(const QString &filename) { task_prog_wgt.close(); disconnect(db_model, nullptr, &task_prog_wgt, nullptr); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1978,7 +1978,7 @@ void ModelWidget::moveToSchema(void) if(op_id >=0 && op_id > op_curr_idx) op_list->removeLastOperation(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2041,7 +2041,7 @@ void ModelWidget::changeOwner(void) if(op_id >=0 && op_id >= op_curr_idx) op_list->removeLastOperation(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2078,7 +2078,7 @@ void ModelWidget::setTag(void) if(op_id >=0 && op_id > op_curr_idx) op_list->removeLastOperation(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2247,7 +2247,7 @@ void ModelWidget::protectObject(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -2770,7 +2770,7 @@ void ModelWidget::duplicateObject(void) if(op_id >= 0) op_list->removeLastOperation(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -3005,14 +3005,14 @@ void ModelWidget::removeObjects(bool cascade) } catch(Exception &e) { - if(cascade && (e.getErrorType()==ErrorCode::RemInvalidatedObjects || - e.getErrorType()==ErrorCode::RemDirectReference || - e.getErrorType()==ErrorCode::RemInderectReference || - e.getErrorType()==ErrorCode::RemProtectedObject || - e.getErrorType()==ErrorCode::OprReservedObject)) + if(cascade && (e.getErrorCode()==ErrorCode::RemInvalidatedObjects || + e.getErrorCode()==ErrorCode::RemDirectReference || + e.getErrorCode()==ErrorCode::RemInderectReference || + e.getErrorCode()==ErrorCode::RemProtectedObject || + e.getErrorCode()==ErrorCode::OprReservedObject)) errors.push_back(e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } else @@ -3035,14 +3035,14 @@ void ModelWidget::removeObjects(bool cascade) } catch(Exception &e) { - if(cascade && (e.getErrorType()==ErrorCode::RemInvalidatedObjects || - e.getErrorType()==ErrorCode::RemDirectReference || - e.getErrorType()==ErrorCode::RemInderectReference || - e.getErrorType()==ErrorCode::RemProtectedObject || - e.getErrorType()==ErrorCode::OprReservedObject)) + if(cascade && (e.getErrorCode()==ErrorCode::RemInvalidatedObjects || + e.getErrorCode()==ErrorCode::RemDirectReference || + e.getErrorCode()==ErrorCode::RemInderectReference || + e.getErrorCode()==ErrorCode::RemProtectedObject || + e.getErrorCode()==ErrorCode::OprReservedObject)) errors.push_back(e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } if(rel) @@ -4225,7 +4225,7 @@ void ModelWidget::createSequenceFromColumn(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -4265,7 +4265,7 @@ void ModelWidget::convertIntegerToSerial(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -4285,7 +4285,7 @@ void ModelWidget::breakRelationshipLine(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -4325,7 +4325,7 @@ void ModelWidget::breakRelationshipLine(BaseRelationship *rel, unsigned break_ty } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -4371,7 +4371,7 @@ void ModelWidget::removeRelationshipPoints(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/objectselectorwidget.cpp b/libpgmodeler_ui/src/objectselectorwidget.cpp index 3126bfa820..c095aea88e 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.cpp +++ b/libpgmodeler_ui/src/objectselectorwidget.cpp @@ -27,7 +27,7 @@ ObjectSelectorWidget::ObjectSelectorWidget(ObjectType sel_obj_type, bool install } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -40,7 +40,7 @@ ObjectSelectorWidget::ObjectSelectorWidget(vector sel_obj_types, boo } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -76,7 +76,7 @@ void ObjectSelectorWidget::configureSelector(bool install_highlighter) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -156,7 +156,7 @@ void ObjectSelectorWidget::setSelectedObject(const QString &obj_name, ObjectType } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 99f486cbac..4a54318be4 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -182,7 +182,7 @@ void ObjectsTableWidget::clearCellText(unsigned row_idx, unsigned col_idx) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/operationlistwidget.cpp b/libpgmodeler_ui/src/operationlistwidget.cpp index fd8672bcd2..8e03638a6c 100644 --- a/libpgmodeler_ui/src/operationlistwidget.cpp +++ b/libpgmodeler_ui/src/operationlistwidget.cpp @@ -169,13 +169,13 @@ void OperationListWidget::undoOperation(void) QApplication::restoreOverrideCursor(); this->updateOperationList(); - if(e.getErrorType()==ErrorCode::UndoRedoOperationInvalidObject) + if(e.getErrorCode()==ErrorCode::UndoRedoOperationInvalidObject) { Messagebox msg_box; msg_box.show(e, "", Messagebox::AlertIcon); } else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -193,13 +193,13 @@ void OperationListWidget::redoOperation(void) { QApplication::restoreOverrideCursor(); - if(e.getErrorType()==ErrorCode::UndoRedoOperationInvalidObject) + if(e.getErrorCode()==ErrorCode::UndoRedoOperationInvalidObject) { Messagebox msg_box; msg_box.show(e, "", Messagebox::AlertIcon); } else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/operatorclasswidget.cpp b/libpgmodeler_ui/src/operatorclasswidget.cpp index 835f6a00cf..65b2abf690 100644 --- a/libpgmodeler_ui/src/operatorclasswidget.cpp +++ b/libpgmodeler_ui/src/operatorclasswidget.cpp @@ -94,7 +94,7 @@ OperatorClassWidget::OperatorClassWidget(QWidget *parent): BaseObjectWidget(pare } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -199,7 +199,7 @@ void OperatorClassWidget::handleElement(int lin_idx) if(elements_tab->getCellText(lin_idx, 0).isEmpty()) elements_tab->removeRow(lin_idx); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -264,7 +264,7 @@ void OperatorClassWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/operatorfamilywidget.cpp b/libpgmodeler_ui/src/operatorfamilywidget.cpp index 39b0d5d2ea..5ee0d4ff21 100644 --- a/libpgmodeler_ui/src/operatorfamilywidget.cpp +++ b/libpgmodeler_ui/src/operatorfamilywidget.cpp @@ -69,7 +69,7 @@ void OperatorFamilyWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/operatorwidget.cpp b/libpgmodeler_ui/src/operatorwidget.cpp index d252808a72..2f21f23107 100644 --- a/libpgmodeler_ui/src/operatorwidget.cpp +++ b/libpgmodeler_ui/src/operatorwidget.cpp @@ -74,7 +74,7 @@ OperatorWidget::OperatorWidget(QWidget *parent): BaseObjectWidget(parent, Object } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -139,7 +139,7 @@ void OperatorWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/parameterwidget.cpp b/libpgmodeler_ui/src/parameterwidget.cpp index 472cb97904..9b7e7d7827 100644 --- a/libpgmodeler_ui/src/parameterwidget.cpp +++ b/libpgmodeler_ui/src/parameterwidget.cpp @@ -51,7 +51,7 @@ ParameterWidget::ParameterWidget(QWidget *parent): BaseObjectWidget(parent, Obje } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -90,7 +90,7 @@ void ParameterWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 02ae55b3ce..37fa64ab2c 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -294,7 +294,7 @@ void PermissionWidget::addPermission(void) } cancelOperation(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -344,7 +344,7 @@ void PermissionWidget::updatePermission(void) delete(perm_bkp); cancelOperation(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index 79dd7baedc..ea6366d0a2 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -263,7 +263,7 @@ namespace PgModelerUiNs { text=QString("%1 (%2)").arg(ex.getFile()).arg(ex.getLine()); createOutputTreeItem(exceptions_trw, text, QPixmap(getIconPath("codigofonte")), item, false, true); - text=QString("%1 (%2)").arg(Exception::getErrorCode(ex.getErrorType())).arg(enum_cast(ex.getErrorType())); + text=QString("%1 (%2)").arg(Exception::getErrorCode(ex.getErrorCode())).arg(enum_cast(ex.getErrorCode())); createOutputTreeItem(exceptions_trw, text, QPixmap(getIconPath("msgbox_alerta")), item, false, true); child_item=createOutputTreeItem(exceptions_trw, ex.getErrorMessage(), QPixmap(getIconPath("msgbox_erro")), item, false, true); diff --git a/libpgmodeler_ui/src/pgsqltypewidget.cpp b/libpgmodeler_ui/src/pgsqltypewidget.cpp index ac3d73b1de..d92d981eb9 100644 --- a/libpgmodeler_ui/src/pgsqltypewidget.cpp +++ b/libpgmodeler_ui/src/pgsqltypewidget.cpp @@ -62,7 +62,7 @@ PgSQLTypeWidget::PgSQLTypeWidget(QWidget *parent, const QString &label) : QWidge } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -140,7 +140,7 @@ void PgSQLTypeWidget::updateTypeFormat(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -206,7 +206,7 @@ void PgSQLTypeWidget::setAttributes(PgSqlType type, DatabaseModel *model, unsig } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/policywidget.cpp b/libpgmodeler_ui/src/policywidget.cpp index eaee54702c..5c04f825f5 100644 --- a/libpgmodeler_ui/src/policywidget.cpp +++ b/libpgmodeler_ui/src/policywidget.cpp @@ -67,7 +67,7 @@ PolicyWidget::PolicyWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -140,6 +140,6 @@ void PolicyWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index e19385f812..3e81d78c1c 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -276,7 +276,7 @@ void ReferenceWidget::applyConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/relationshipconfigwidget.cpp b/libpgmodeler_ui/src/relationshipconfigwidget.cpp index 81294df1c5..36c22e6504 100644 --- a/libpgmodeler_ui/src/relationshipconfigwidget.cpp +++ b/libpgmodeler_ui/src/relationshipconfigwidget.cpp @@ -124,7 +124,7 @@ void RelationshipConfigWidget::loadConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); } } @@ -172,7 +172,7 @@ void RelationshipConfigWidget::saveConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -201,7 +201,7 @@ void RelationshipConfigWidget::restoreDefaults(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/relationshipwidget.cpp b/libpgmodeler_ui/src/relationshipwidget.cpp index a609bb6e7c..e911a101c6 100644 --- a/libpgmodeler_ui/src/relationshipwidget.cpp +++ b/libpgmodeler_ui/src/relationshipwidget.cpp @@ -210,7 +210,7 @@ RelationshipWidget::RelationshipWidget(QWidget *parent): BaseObjectWidget(parent } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -233,7 +233,7 @@ void RelationshipWidget::setAttributes(DatabaseModel *model, OperationList *op_l } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -588,7 +588,7 @@ void RelationshipWidget::listObjects(ObjectType obj_type) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -670,7 +670,7 @@ void RelationshipWidget::listAdvancedObjects(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -775,7 +775,7 @@ void RelationshipWidget::addObject(void) catch(Exception &e) { listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -829,7 +829,7 @@ void RelationshipWidget::duplicateObject(int curr_row, int new_row) } listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -862,7 +862,7 @@ void RelationshipWidget::editObject(int row) { listObjects(obj_type); op_list->ignoreOperationChain(false); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -937,7 +937,7 @@ void RelationshipWidget::removeObjects(void) } listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -975,7 +975,7 @@ void RelationshipWidget::removeObject(int row) } listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1172,10 +1172,10 @@ void RelationshipWidget::applyConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==ErrorCode::RemInvalidatedObjects) + if(e.getErrorCode()==ErrorCode::RemInvalidatedObjects) msg_box.show(e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1185,7 +1185,7 @@ void RelationshipWidget::applyConfiguration(void) catch(Exception &e) { model->validateRelationships(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/resultsetmodel.cpp b/libpgmodeler_ui/src/resultsetmodel.cpp index c68d285d73..5e0ff3dcf2 100644 --- a/libpgmodeler_ui/src/resultsetmodel.cpp +++ b/libpgmodeler_ui/src/resultsetmodel.cpp @@ -72,7 +72,7 @@ ResultSetModel::ResultSetModel(ResultSet &res, Catalog &catalog, QObject *parent } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -168,7 +168,7 @@ void ResultSetModel::append(ResultSet &res) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index e538a8abe2..d1041b093e 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -291,6 +291,6 @@ void RoleWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/rulewidget.cpp b/libpgmodeler_ui/src/rulewidget.cpp index d2a4709358..f2fbc17fc5 100644 --- a/libpgmodeler_ui/src/rulewidget.cpp +++ b/libpgmodeler_ui/src/rulewidget.cpp @@ -62,7 +62,7 @@ RuleWidget::RuleWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ru } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -136,7 +136,7 @@ void RuleWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/schemawidget.cpp b/libpgmodeler_ui/src/schemawidget.cpp index 74f4e36bed..2b410bc584 100644 --- a/libpgmodeler_ui/src/schemawidget.cpp +++ b/libpgmodeler_ui/src/schemawidget.cpp @@ -86,7 +86,7 @@ void SchemaWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/sequencewidget.cpp b/libpgmodeler_ui/src/sequencewidget.cpp index 18987f4157..31596fb673 100644 --- a/libpgmodeler_ui/src/sequencewidget.cpp +++ b/libpgmodeler_ui/src/sequencewidget.cpp @@ -42,7 +42,7 @@ SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, Object } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -115,7 +115,7 @@ void SequenceWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/snippetsconfigwidget.cpp b/libpgmodeler_ui/src/snippetsconfigwidget.cpp index b6c0772838..7479c8e489 100644 --- a/libpgmodeler_ui/src/snippetsconfigwidget.cpp +++ b/libpgmodeler_ui/src/snippetsconfigwidget.cpp @@ -68,7 +68,7 @@ SnippetsConfigWidget::SnippetsConfigWidget(QWidget * parent) : BaseConfigWidget( } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } enableEditMode(false); @@ -187,7 +187,7 @@ QString SnippetsConfigWidget::parseSnippet(attribs_map snippet, attribs_map attr } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -287,7 +287,7 @@ void SnippetsConfigWidget::loadConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, e.getExtraInfo()); } } @@ -476,7 +476,7 @@ void SnippetsConfigWidget::saveConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -490,7 +490,7 @@ void SnippetsConfigWidget::restoreDefaults(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/sourcecodewidget.cpp b/libpgmodeler_ui/src/sourcecodewidget.cpp index fece249fd0..d04d5072ec 100644 --- a/libpgmodeler_ui/src/sourcecodewidget.cpp +++ b/libpgmodeler_ui/src/sourcecodewidget.cpp @@ -59,7 +59,7 @@ SourceCodeWidget::SourceCodeWidget(QWidget *parent): BaseObjectWidget(parent) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -213,7 +213,7 @@ void SourceCodeWidget::generateSourceCode(int) disconnect(this->model, nullptr, task_prog_wgt, nullptr); delete(task_prog_wgt); } - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -251,7 +251,7 @@ void SourceCodeWidget::setAttributes(DatabaseModel *model, BaseObject *object) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index b04bb4029a..2407287e67 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -342,7 +342,7 @@ void SQLExecutionWidget::fillResultsTable(Catalog &catalog, ResultSet &res, QTab } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -357,8 +357,8 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) QString("%1 %2").arg(time_str).arg(e.getErrorMessage()), QPixmap(PgModelerUiNs::getIconPath("msgbox_erro")), false); - if(e.getErrorType()==ErrorCode::ConnectionTimeout || - e.getErrorType()==ErrorCode::ConnectionBroken) + if(e.getErrorCode()==ErrorCode::ConnectionTimeout || + e.getErrorCode()==ErrorCode::ConnectionBroken) { PgModelerUiNs::createOutputListItem(msgoutput_lst, QString("%1 %2").arg(time_str).arg(trUtf8("No results retrieved or changes done due to the error above! Run the command again.")), @@ -933,7 +933,7 @@ void SQLExecutionWidget::saveSQLHistory(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -979,7 +979,7 @@ void SQLExecutionWidget::loadSQLHistory(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1027,7 +1027,7 @@ void SQLExecutionWidget::enableSQLExecution(bool enable) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 6dc1fda46d..546bef4838 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -183,7 +183,7 @@ void SQLToolWidget::connectToServer(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -217,7 +217,7 @@ void SQLToolWidget::disconnectFromDatabases(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -239,7 +239,7 @@ void SQLToolWidget::handleDatabaseDropped(const QString &dbname) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -277,7 +277,7 @@ void SQLToolWidget::browseDatabase(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -301,7 +301,7 @@ void SQLToolWidget::addSQLExecutionTab(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/libpgmodeler_ui/src/swapobjectsidswidget.cpp b/libpgmodeler_ui/src/swapobjectsidswidget.cpp index d2293103d8..021f4f54ae 100644 --- a/libpgmodeler_ui/src/swapobjectsidswidget.cpp +++ b/libpgmodeler_ui/src/swapobjectsidswidget.cpp @@ -90,7 +90,7 @@ SwapObjectsIdsWidget::SwapObjectsIdsWidget(QWidget *parent, Qt::WindowFlags f) : } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -232,7 +232,7 @@ void SwapObjectsIdsWidget::swapObjectsIds(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index 997a98d35a..b706651e6d 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -577,7 +577,7 @@ void SyntaxHighlighter::loadConfiguration(const QString &filename) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } } diff --git a/libpgmodeler_ui/src/tabledatawidget.cpp b/libpgmodeler_ui/src/tabledatawidget.cpp index 58058a3fa8..36e26652b5 100644 --- a/libpgmodeler_ui/src/tabledatawidget.cpp +++ b/libpgmodeler_ui/src/tabledatawidget.cpp @@ -589,7 +589,7 @@ void TableDataWidget::applyConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/tablespacewidget.cpp b/libpgmodeler_ui/src/tablespacewidget.cpp index 52a0f23543..8260b19c27 100644 --- a/libpgmodeler_ui/src/tablespacewidget.cpp +++ b/libpgmodeler_ui/src/tablespacewidget.cpp @@ -58,7 +58,7 @@ void TablespaceWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/tablewidget.cpp b/libpgmodeler_ui/src/tablewidget.cpp index db1df0b1c2..69273c3f76 100644 --- a/libpgmodeler_ui/src/tablewidget.cpp +++ b/libpgmodeler_ui/src/tablewidget.cpp @@ -337,7 +337,7 @@ void TableWidget::setAttributes(DatabaseModel *model, OperationList *op_list, Sc } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -379,7 +379,7 @@ void TableWidget::listObjects(ObjectType obj_type) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -421,7 +421,7 @@ void TableWidget::handleObject(void) catch(Exception &e) { listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -669,7 +669,7 @@ void TableWidget::removeObjects(void) listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -714,7 +714,7 @@ void TableWidget::removeObject(int row) } listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -757,7 +757,7 @@ void TableWidget::duplicateObject(int sel_row, int new_row) } listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -790,7 +790,7 @@ void TableWidget::TableWidget::swapObjects(int idx1, int idx2) catch(Exception &e) { listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -919,10 +919,10 @@ void TableWidget::applyConfiguration(void) { Messagebox msg_box; - if(e.getErrorType()==ErrorCode::RemInvalidatedObjects) + if(e.getErrorCode()==ErrorCode::RemInvalidatedObjects) msg_box.show(e); else - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } op_list->finishOperationChain(); @@ -944,7 +944,7 @@ void TableWidget::applyConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/tagwidget.cpp b/libpgmodeler_ui/src/tagwidget.cpp index 51709721b0..7a87965e0d 100644 --- a/libpgmodeler_ui/src/tagwidget.cpp +++ b/libpgmodeler_ui/src/tagwidget.cpp @@ -105,7 +105,7 @@ void TagWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/textboxwidget.cpp b/libpgmodeler_ui/src/textboxwidget.cpp index 339c0fe2da..ca628ecce7 100644 --- a/libpgmodeler_ui/src/textboxwidget.cpp +++ b/libpgmodeler_ui/src/textboxwidget.cpp @@ -85,7 +85,7 @@ void TextboxWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/triggerwidget.cpp b/libpgmodeler_ui/src/triggerwidget.cpp index bd17e5ce84..ec3f07ff68 100644 --- a/libpgmodeler_ui/src/triggerwidget.cpp +++ b/libpgmodeler_ui/src/triggerwidget.cpp @@ -85,7 +85,7 @@ TriggerWidget::TriggerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectTy } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -152,7 +152,7 @@ void TriggerWidget::addColumn(int lin_idx) catch(Exception &e) { columns_tab->removeRow(lin_idx); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -195,7 +195,7 @@ void TriggerWidget::updateColumnsCombo(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -321,7 +321,7 @@ void TriggerWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/typewidget.cpp b/libpgmodeler_ui/src/typewidget.cpp index 8ed18fc51e..b20da59116 100644 --- a/libpgmodeler_ui/src/typewidget.cpp +++ b/libpgmodeler_ui/src/typewidget.cpp @@ -131,7 +131,7 @@ TypeWidget::TypeWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ty } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -200,7 +200,7 @@ void TypeWidget::handleAttribute(int row) if(attributes_tab->getCellText(row,0).isEmpty()) attributes_tab->removeRow(row); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -358,7 +358,7 @@ void TypeWidget::applyConfiguration(void) catch(Exception &e) { cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libpgmodeler_ui/src/viewwidget.cpp b/libpgmodeler_ui/src/viewwidget.cpp index 52f6ef1539..53bd0eca7a 100644 --- a/libpgmodeler_ui/src/viewwidget.cpp +++ b/libpgmodeler_ui/src/viewwidget.cpp @@ -149,7 +149,7 @@ ViewWidget::ViewWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Vi } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -200,7 +200,7 @@ void ViewWidget::handleObject(void) catch(Exception &e) { listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -243,7 +243,7 @@ void ViewWidget::duplicateObject(int curr_row, int new_row) } listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -283,7 +283,7 @@ void ViewWidget::removeObjects(void) } listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -314,7 +314,7 @@ void ViewWidget::removeObject(int row) catch(Exception &e) { listObjects(obj_type); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -433,7 +433,7 @@ void ViewWidget::listObjects(ObjectType obj_type) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -750,7 +750,7 @@ void ViewWidget::applyConfiguration(void) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index f26f992e75..49ed2a1bf7 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -386,7 +386,7 @@ QString Exception::getLine(void) return(QString("%1").arg(line)); } -ErrorCode Exception::getErrorType(void) +ErrorCode Exception::getErrorCode(void) { return(error_code); } @@ -439,7 +439,7 @@ QString Exception::getExceptionsText(void) { exceptions_txt+=QString("[%1] %2 (%3)\n").arg(idx).arg(itr->getFile()).arg(itr->getLine()); exceptions_txt+=QString(" %1\n").arg(itr->getMethod()); - exceptions_txt+=QString(" [%1] %2\n").arg(Exception::getErrorCode(itr->getErrorType())).arg(itr->getErrorMessage()); + exceptions_txt+=QString(" [%1] %2\n").arg(Exception::getErrorCode(itr->getErrorCode())).arg(itr->getErrorMessage()); if(!itr->getExtraInfo().isEmpty()) exceptions_txt+=QString(" ** %1\n\n").arg(itr->getExtraInfo()); diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 2bc89aeaa1..94b8755a05 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -344,7 +344,7 @@ class Exception { QString getMethod(void); QString getFile(void); QString getLine(void); - ErrorCode getErrorType(void); + ErrorCode getErrorCode(void); QString getExtraInfo(void); //! \brief Gets the full exception stack diff --git a/main-cli/src/main.cpp b/main-cli/src/main.cpp index ade7f1e184..8953ce1675 100644 --- a/main-cli/src/main.cpp +++ b/main-cli/src/main.cpp @@ -49,7 +49,7 @@ int main(int argc, char **argv) out << endl; out << e.getExceptionsText(); out << QString("** pgmodeler-cli aborted due to critical error(s). **") << endl << endl; - return(e.getErrorType()==ErrorCode::Custom ? -1 : enum_cast(e.getErrorType())); + return(e.getErrorCode()==ErrorCode::Custom ? -1 : enum_cast(e.getErrorCode())); } #endif } diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 68b519dd5f..1e2925915c 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -968,7 +968,7 @@ void PgModelerCli::recreateObjects(void) if(obj_type!=ObjectType::Database) fail_objs.push_back(xml_def); else - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } if(objs_xml.isEmpty() && (!fail_objs.isEmpty() || !constr.isEmpty())) @@ -1337,7 +1337,7 @@ void PgModelerCli::importDatabase(DatabaseModel *model, Connection conn) } catch(Exception &e) { - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -1694,7 +1694,7 @@ void PgModelerCli::handleMimeDatabase(bool uninstall) } catch(Exception &e) { - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } #else #ifdef Q_OS_WIN diff --git a/main/src/application.cpp b/main/src/application.cpp index ede68f058d..c1de046df2 100644 --- a/main/src/application.cpp +++ b/main/src/application.cpp @@ -159,7 +159,7 @@ void Application::createUserConfiguration(void) { Messagebox msg_box; msg_box.show(e, trUtf8("Failed to create initial configuration in `%1'! Check if the current user has write permission over that path and at least read permission over `%2'.").arg(GlobalAttributes::ConfigurationsDir, CONFDIR)); - throw Exception(e.getErrorMessage(),e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } diff --git a/main/src/main.cpp b/main/src/main.cpp index 2b69717d18..1b8d49dc91 100644 --- a/main/src/main.cpp +++ b/main/src/main.cpp @@ -150,6 +150,6 @@ int main(int argc, char **argv) { QTextStream ts(stdout); ts << e.getExceptionsText(); - return(enum_cast(e.getErrorType())); + return(enum_cast(e.getErrorCode())); } } diff --git a/plugins/xml2object/src/xml2objectwidget.cpp b/plugins/xml2object/src/xml2objectwidget.cpp index c9366ff023..4b60e2310d 100644 --- a/plugins/xml2object/src/xml2objectwidget.cpp +++ b/plugins/xml2object/src/xml2objectwidget.cpp @@ -102,7 +102,7 @@ void Xml2ObjectWidget::generateObject(void) op_list->undoOperation(); op_list->removeLastOperation(); - throw Exception(e.getErrorMessage(), e.getErrorType(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } diff --git a/schemas/sql/foreigndatawrapper.sch b/schemas/sql/foreigndatawrapper.sch index 44b0a30ebd..3a0cdfd6d5 100644 --- a/schemas/sql/foreigndatawrapper.sch +++ b/schemas/sql/foreigndatawrapper.sch @@ -14,23 +14,23 @@ $br $tb -%if %not {handler_func} %then +%if %not {handler} %then [NO HANDLER] %else - [HANDLER ] {handler_func} -%endif + [HANDLER ] {handler} +%end $br $tb -%if %not {validator_func} %then +%if %not {validator} %then [NO VALIDATOR] %else - [VALIDATOR ] {validator_func} -%endif + [VALIDATOR ] {validator} +%end %if {options} %then $br $tb [OPTIONS (] {options} ) -%endif +%end # This is a special token that pgModeler recognizes as end of DDL command # when exporting models directly to DBMS. DO NOT REMOVE THIS TOKEN! diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp index 926493358b..59192760e5 100644 --- a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -24,18 +24,137 @@ class ForeignDataWrapperTest: public QObject { Q_OBJECT private slots: + void assignValidFunctionDoesntRaiseException(void); void assignInvalidFunctionRaisesException(void); void codeGeneratedIsWellFormed(void); }; +void ForeignDataWrapperTest::assignValidFunctionDoesntRaiseException(void) +{ + ForeignDataWrapper fdw; + Function func_handler, func_validator; + + fdw.setName("fdw"); + + try + { + func_handler.setName("func_handler"); + func_handler.setReturnType(PgSqlType("fdw_handler")); + fdw.setHandlerFunction(&func_handler); + } + catch(Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } + + try + { + func_validator.setName("func_validator"); + func_validator.addParameter(Parameter("param1", PgSqlType("text"))); + func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); + fdw.setValidatorFunction(&func_validator); + } + catch(Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } +} + void ForeignDataWrapperTest::assignInvalidFunctionRaisesException(void) { - QCOMPARE(true, true); + ForeignDataWrapper fdw; + Function func_handler, func_validator; + + fdw.setName("fdw"); + func_handler.setName("func_handler"); + func_validator.setName("func_validator"); + + try + { + func_handler.setReturnType(PgSqlType("fdw_handler")); + func_handler.addParameter(Parameter("param1", PgSqlType("integer"))); + fdw.setHandlerFunction(&func_handler); + QFAIL("Expected exception(s) not raised!"); + } + catch(Exception &e) + { + QVERIFY(e.getErrorCode() == ErrorCode::AsgFunctionInvalidParamCount); + } + + try + { + func_handler.removeParameters(); + func_handler.setReturnType(PgSqlType("trigger")); + fdw.setHandlerFunction(&func_handler); + QFAIL("Expected exception(s) not raised!"); + } + catch(Exception &e) + { + QVERIFY(e.getErrorCode() == ErrorCode::AsgFunctionInvalidReturnType); + } + + try + { + func_validator.addParameter(Parameter("param1", PgSqlType("integer"))); + func_validator.addParameter(Parameter("param2", PgSqlType("varchar"))); + fdw.setValidatorFunction(&func_validator); + QFAIL("Expected exception(s) not raised!"); + } + catch(Exception &e) + { + QVERIFY(e.getErrorCode() == ErrorCode::AsgFunctionInvalidParameters); + } + + try + { + func_validator.removeParameters(); + func_validator.addParameter(Parameter("param1", PgSqlType("text"))); + func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); + func_validator.addParameter(Parameter("param3", PgSqlType("smallint"))); + fdw.setValidatorFunction(&func_validator); + QFAIL("Expected exception(s) not raised!"); + } + catch(Exception &e) + { + QVERIFY(e.getErrorCode() == ErrorCode::AsgFunctionInvalidParamCount); + } } void ForeignDataWrapperTest::codeGeneratedIsWellFormed(void) { - QCOMPARE(true, true); + ForeignDataWrapper fdw; + Schema public_sch; + Function func_handler, func_validator; + QString sql_code =QString( +"-- object: fdw | type: FOREIGN DATA WRAPPER -- \ +-- DROP FOREIGN DATA WRAPPER IF EXISTS fdw CASCADE; \ +CREATE FOREIGN DATA WRAPPER fdw \ +HANDLER public.func_handler \ +VALIDATOR public.func_validator \ +OPTIONS ('opt1' 'value1', 'opt2' 'value2');").simplified(); + + public_sch.setName("public"); + + fdw.setName("fdw"); + func_handler.setName("func_handler"); + func_handler.setReturnType(PgSqlType("fdw_handler")); + func_handler.setSchema(&public_sch); + fdw.setHandlerFunction(&func_handler); + + func_validator.setName("func_validator"); + func_validator.addParameter(Parameter("param1", PgSqlType("text"))); + func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); + func_validator.setSchema(&public_sch); + fdw.setValidatorFunction(&func_validator); + + try + { + QCOMPARE(sql_code, fdw.getCodeDefinition(SchemaParser::SqlDefinition).simplified()); + } + catch (Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } } QTEST_MAIN(ForeignDataWrapperTest) diff --git a/tests/src/partrelationshiptest/partrelationshiptest.cpp b/tests/src/partrelationshiptest/partrelationshiptest.cpp index 736bc82af7..bb39c7499c 100644 --- a/tests/src/partrelationshiptest/partrelationshiptest.cpp +++ b/tests/src/partrelationshiptest/partrelationshiptest.cpp @@ -162,7 +162,7 @@ void PartRelationhipTest::connRelTablePartionHasMoreColsThanPartitionedTableShou } catch(Exception &e) { - QVERIFY(e.getErrorType() == ErrorCode::InvColumnCountPartRel); + QVERIFY(e.getErrorCode() == ErrorCode::InvColumnCountPartRel); } } @@ -209,7 +209,7 @@ void PartRelationhipTest::connRelTablePartionHasDifferentColsThanPartitionedTabl } catch(Exception &e) { - QVERIFY(e.getErrorType() == ErrorCode::InvColumnCountPartRel); + QVERIFY(e.getErrorCode() == ErrorCode::InvColumnCountPartRel); } } From 2bee1e484ea321fdb7f415998d509e1add6fabba Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 25 Mar 2019 11:28:02 -0300 Subject: [PATCH 295/425] Added the method PgSqlType::isExactTo in order to do a full comparison (all attributes) between two data types ForeignDataWrapper now is capable of generate its SQL code (pending XML) --- libpgmodeler/src/foreigndatawrapper.cpp | 48 ++++++++++++++++++- libpgmodeler/src/foreigndatawrapper.h | 3 ++ libpgmodeler/src/pgsqltypes.cpp | 18 +++++-- libpgmodeler/src/pgsqltypes.h | 18 ++++++- libutils/src/exception.cpp | 5 +- libutils/src/exception.h | 7 +-- schemas/sql/foreigndatawrapper.sch | 2 + .../foreigndatawrappertest.cpp | 41 +++++++++------- 8 files changed, 112 insertions(+), 30 deletions(-) diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 37562db201..d59f99f1e3 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -58,8 +58,8 @@ void ForeignDataWrapper::setValidatorFunction(Function *func) .arg(this->getTypeName()), ErrorCode::AsgFunctionInvalidParamCount, __PRETTY_FUNCTION__, __FILE__, __LINE__); - if(func->getParameter(0).getType() != PgSqlType("text", 1) || - func->getParameter(1).getType() != PgSqlType("oid", 1)) + if(!func->getParameter(0).getType().isExactTo(PgSqlType("text", 1)) || + !func->getParameter(1).getType().isExactTo(PgSqlType("oid"))) throw Exception(Exception::getErrorMessage(ErrorCode::AsgFunctionInvalidParameters) .arg(this->getName(true)) .arg(this->getTypeName()), @@ -80,11 +80,35 @@ Function *ForeignDataWrapper::getValidatorFunction(void) return(validator_func); } +void ForeignDataWrapper::setOption(const QString &opt, const QString &value) +{ + if(opt.isEmpty()) + throw Exception(ErrorCode::AsgOptionInvalidName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + options[opt] = value; +} + void ForeignDataWrapper::setOptions(const attribs_map &options) { + for(auto &itr : options) + { + if(itr.first.isEmpty()) + throw Exception(ErrorCode::AsgOptionInvalidName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + this->options = options; } +void ForeignDataWrapper::removeOption(const QString &opt) +{ + options.erase(opt); +} + +void ForeignDataWrapper::removeOptions(void) +{ + options.clear(); +} + attribs_map ForeignDataWrapper::getOptions(void) { return(options); @@ -95,5 +119,25 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); + QStringList fmt_options; + + if(def_type == SchemaParser::SqlDefinition) + { + if(handler_func) + attributes[Attributes::HandlerFunc] = handler_func->getSignature(); + + if(validator_func) + attributes[Attributes::ValidatorFunc] = validator_func->getSignature(); + + for(auto &itr : options) + fmt_options += QString("%1 '%2'").arg(itr.first).arg(itr.second); + + attributes[Attributes::Options] = fmt_options.join(','); + } + else + { + + } + return(this->BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h index 07a6d128e3..2038d5b707 100644 --- a/libpgmodeler/src/foreigndatawrapper.h +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -47,7 +47,10 @@ class ForeignDataWrapper: public BaseObject{ Function *getHandlerFunction(void); Function *getValidatorFunction(void); + void setOption(const QString &opt, const QString &value); void setOptions(const attribs_map &options); + void removeOption(const QString &opt); + void removeOptions(void); attribs_map getOptions(void); virtual QString getCodeDefinition(unsigned def_type); diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index 0e6c9dc360..ca244d32cf 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1509,7 +1509,18 @@ bool PgSqlType::isEquivalentTo(PgSqlType type) return(this_idx < types.size() && type_idx < types.size() && this_idx==type_idx && - this->isArrayType()==type.isArrayType()); + this->isArrayType()==type.isArrayType()); +} + +bool PgSqlType::isExactTo(PgSqlType type) +{ + return(this->type_idx == type.type_idx && + this->dimension == type.dimension && + this->length == type.length && + this->precision == type.precision && + this->with_timezone == type.with_timezone && + this->interval_type == type.interval_type && + this->spatial_type == type.spatial_type); } PgSqlType PgSqlType::getAliasType(void) @@ -1535,9 +1546,8 @@ void PgSqlType::setDimension(unsigned dim) { int idx=getUserTypeIndex(~(*this), nullptr) - (PseudoEnd + 1); if(static_cast(idx) < user_types.size() && - (user_types[idx].type_conf==UserTypeConfig::DomainType || - user_types[idx].type_conf==UserTypeConfig::SequenceType)) - throw Exception(ErrorCode::AsgInvalidDomainArray,__PRETTY_FUNCTION__,__FILE__,__LINE__); + user_types[idx].type_conf==UserTypeConfig::SequenceType) + throw Exception(ErrorCode::AsgInvalidSequenceTypeArray,__PRETTY_FUNCTION__,__FILE__,__LINE__); } dimension=dim; diff --git a/libpgmodeler/src/pgsqltypes.h b/libpgmodeler/src/pgsqltypes.h index 9be7965091..f31ffaf477 100644 --- a/libpgmodeler/src/pgsqltypes.h +++ b/libpgmodeler/src/pgsqltypes.h @@ -465,6 +465,12 @@ class PgSqlType: public BaseType{ smallint is compatible with int2, and so on. */ bool isEquivalentTo(PgSqlType type); + /*! \brief Returns true if the provided type is exactly the same as the "this". + * This method compares ALL attributes of the type. Note that this method is + * different from the operatores == (PgSqlType) because this latter compares only + * the indexes of the types. This method is useful if one need to fully compare the types */ + bool isExactTo(PgSqlType type); + PgSqlType getAliasType(void); QString getCodeDefinition(unsigned def_type, QString ref_type=QString()); QString operator ~ (void); @@ -475,12 +481,22 @@ class PgSqlType: public BaseType{ unsigned operator << (void *ptype); unsigned operator = (unsigned type_id); unsigned operator = (const QString &type_name); + + //! \brief Compares the index of the "this" with the provided type index. If an exact match is needed use isExactTo() bool operator == (unsigned type_idx); + + //! \brief Compares the index of the "this" with the provided type. If an exact match is needed use isExactTo() bool operator == (PgSqlType type); + + //! \brief Compares the index of the "this" with the provided type name index. If an exact match is needed use isExactTo() bool operator == (const QString &type_name); + + //! \brief Compares the index of the "this" with the provided type reference. If an exact match is needed use isExactTo() bool operator == (void *ptype); + + // The methods below are just the oposite of the == versions bool operator != (const QString &type_name); - bool operator != (PgSqlType type); + bool operator != (PgSqlType type); bool operator != (unsigned type_idx); /*! \brief Returns the pointer to the user defined type which denotes the diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 49ed2a1bf7..c38dc58197 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -137,7 +137,7 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"PermissionRefInexistObject", QT_TR_NOOP("A permission is referencing the object `%1' (%2) which was not found in the model!")}, {"InvObjectAllocationNoSchema", QT_TR_NOOP("The object `%1' (%2) can not be created because its not being assigned to any schema!")}, {"AsgTablespaceDuplicatedDirectory", QT_TR_NOOP("The tablespace `%1' can not be inserted into the model because it points to the same directory as the tablespace `%2'!")}, - {"AsgInvalidDomainArray", QT_TR_NOOP("It is not possible to create arrays of domains or sequences (dimension >= 1)! PostgreSQL does not yet implement this feature!")}, + {"AsgInvalidSequenceTypeArray", QT_TR_NOOP("It is not possible to create arrays sequences (dimension >= 1)! PostgreSQL does not yet implement this feature!")}, {"AsgSourceCodeFuncCLanguage", QT_TR_NOOP("The function `%1' can not get a source code as a definition because its language is set to C. Use the attributes symbol and dynamic library instead!")}, {"AsgRefLibraryFuncLanguageNotC", QT_TR_NOOP("The function `%1' can have the attributes symbol and dynamic library configured only if the language is set to C. For all other cases you must specify a source code that defines it in the DBMS!")}, {"AsgInvalidCommutatorOperator", QT_TR_NOOP("The operator `%1' can not be assigned as a commutator of operator `%2' because it has incompatible settings!")}, @@ -259,7 +259,8 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"InvPartitionKeyCount", QT_TR_NOOP("Invalid amount of partition keys being assinged to the table `%1'! Multiples partition keys are allowed only on `HASH' and `RANGE' partitioning strategies.")}, {"PartKeyObjectInexistsModel", QT_TR_NOOP("A partition key of the table `%1' is referencing the object `%3' (%4) which was not found in the model!")}, {"AsgInvalidColumnPartitionKey", QT_TR_NOOP("The column `%1' can't be assigned to a partition key because it was created by a relatinship and this kind of operation is not yet supported! HINT: create the column manually on the table and then create the partition key using it.")}, - {"RemColumnRefByPartitionKey", QT_TR_NOOP("The column `%1' on the table `%2' can't be removed because it is being referenced by one or more patition keys!")} + {"RemColumnRefByPartitionKey", QT_TR_NOOP("The column `%1' on the table `%2' can't be removed because it is being referenced by one or more patition keys!")}, + {"AsgOptionInvalidName", QT_TR_NOOP("Assignment of an option to the object with an invalid name!")} }; Exception::Exception(void) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 94b8755a05..5054e37f5d 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -162,7 +162,7 @@ enum class ErrorCode: unsigned { PermissionRefInexistObject, InvObjectAllocationNoSchema, AsgTablespaceDuplicatedDirectory, - AsgInvalidDomainArray, + AsgInvalidSequenceTypeArray, AsgSourceCodeFuncCLanguage, AsgRefLibraryFuncLanguageNotC, AsgInvalidCommutatorOperator, @@ -284,12 +284,13 @@ enum class ErrorCode: unsigned { InvPartitionKeyCount, PartKeyObjectInexistsModel, AsgInvalidColumnPartitionKey, - RemColumnRefByPartitionKey + RemColumnRefByPartitionKey, + AsgOptionInvalidName }; class Exception { private: - static constexpr unsigned ErrorCount=241; + static constexpr unsigned ErrorCount=242; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ diff --git a/schemas/sql/foreigndatawrapper.sch b/schemas/sql/foreigndatawrapper.sch index 3a0cdfd6d5..da1c818a60 100644 --- a/schemas/sql/foreigndatawrapper.sch +++ b/schemas/sql/foreigndatawrapper.sch @@ -32,6 +32,8 @@ $br $tb $br $tb [OPTIONS (] {options} ) %end +; + # This is a special token that pgModeler recognizes as end of DDL command # when exporting models directly to DBMS. DO NOT REMOVE THIS TOKEN! $br [-- ddl-end --] $br diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp index 59192760e5..0a2e05ce66 100644 --- a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -50,7 +50,7 @@ void ForeignDataWrapperTest::assignValidFunctionDoesntRaiseException(void) try { func_validator.setName("func_validator"); - func_validator.addParameter(Parameter("param1", PgSqlType("text"))); + func_validator.addParameter(Parameter("param1", PgSqlType("text", 1))); func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); fdw.setValidatorFunction(&func_validator); } @@ -129,27 +129,32 @@ void ForeignDataWrapperTest::codeGeneratedIsWellFormed(void) "-- object: fdw | type: FOREIGN DATA WRAPPER -- \ -- DROP FOREIGN DATA WRAPPER IF EXISTS fdw CASCADE; \ CREATE FOREIGN DATA WRAPPER fdw \ -HANDLER public.func_handler \ -VALIDATOR public.func_validator \ -OPTIONS ('opt1' 'value1', 'opt2' 'value2');").simplified(); +HANDLER public.func_handler() \ +VALIDATOR public.func_validator(text[],oid) \ +OPTIONS (opt1 'value1',opt2 'value2'); \ +-- ddl-end --").simplified(); - public_sch.setName("public"); + try + { + public_sch.setName("public"); - fdw.setName("fdw"); - func_handler.setName("func_handler"); - func_handler.setReturnType(PgSqlType("fdw_handler")); - func_handler.setSchema(&public_sch); - fdw.setHandlerFunction(&func_handler); + fdw.setName("fdw"); + func_handler.setName("func_handler"); + func_handler.setReturnType(PgSqlType("fdw_handler")); + func_handler.setSchema(&public_sch); + fdw.setHandlerFunction(&func_handler); - func_validator.setName("func_validator"); - func_validator.addParameter(Parameter("param1", PgSqlType("text"))); - func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); - func_validator.setSchema(&public_sch); - fdw.setValidatorFunction(&func_validator); + func_validator.setName("func_validator"); + func_validator.addParameter(Parameter("param1", PgSqlType("text", 1))); + func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); + func_validator.setSchema(&public_sch); + fdw.setValidatorFunction(&func_validator); - try - { - QCOMPARE(sql_code, fdw.getCodeDefinition(SchemaParser::SqlDefinition).simplified()); + fdw.setOption("opt1", "value1"); + fdw.setOption("opt2", "value2"); + + QString res_sql_code = fdw.getCodeDefinition(SchemaParser::SqlDefinition).simplified(); + QCOMPARE(sql_code, res_sql_code); } catch (Exception &e) { From e854da22e2b2e6035cdb1d8f31785e34bb1fd1c7 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 25 Mar 2019 17:34:46 -0300 Subject: [PATCH 296/425] Minor adjustment on ForeignDataWrapperTest --- libpgmodeler/src/baseobject.cpp | 2 +- .../foreigndatawrappertest/foreigndatawrappertest.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index f414b79576..548a988a42 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -404,7 +404,7 @@ bool BaseObject::acceptsOwner(ObjectType obj_type) obj_type==ObjectType::Tablespace || obj_type==ObjectType::Database || obj_type==ObjectType::OpClass || obj_type==ObjectType::OpFamily || obj_type==ObjectType::Collation || obj_type==ObjectType::View || - obj_type==ObjectType::EventTrigger); + obj_type==ObjectType::EventTrigger || obj_type==ObjectType::ForeignDataWrapper); } bool BaseObject::acceptsOwner(void) diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp index 0a2e05ce66..1a3e4a85cf 100644 --- a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -123,6 +123,7 @@ void ForeignDataWrapperTest::assignInvalidFunctionRaisesException(void) void ForeignDataWrapperTest::codeGeneratedIsWellFormed(void) { ForeignDataWrapper fdw; + Role owner; Schema public_sch; Function func_handler, func_validator; QString sql_code =QString( @@ -132,13 +133,19 @@ CREATE FOREIGN DATA WRAPPER fdw \ HANDLER public.func_handler() \ VALIDATOR public.func_validator(text[],oid) \ OPTIONS (opt1 'value1',opt2 'value2'); \ --- ddl-end --").simplified(); +-- ddl-end -- \ +COMMENT ON FOREIGN DATA WRAPPER fdw IS 'This is a test comment on FDW'; \ +-- ddl-end -- \ +ALTER FOREIGN DATA WRAPPER fdw OWNER TO postgres; \ +-- ddl-end -- ").simplified(); try { public_sch.setName("public"); + owner.setName("postgres"); fdw.setName("fdw"); + fdw.setOwner(&owner); func_handler.setName("func_handler"); func_handler.setReturnType(PgSqlType("fdw_handler")); func_handler.setSchema(&public_sch); @@ -152,6 +159,7 @@ OPTIONS (opt1 'value1',opt2 'value2'); \ fdw.setOption("opt1", "value1"); fdw.setOption("opt2", "value2"); + fdw.setComment("This is a test comment on FDW"); QString res_sql_code = fdw.getCodeDefinition(SchemaParser::SqlDefinition).simplified(); QCOMPARE(sql_code, res_sql_code); From 12de96258d6db644d4cc6e183b0dfb09bd468f19 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 26 Mar 2019 11:37:56 -0300 Subject: [PATCH 297/425] Fixed a bug that could crash the application when no language was specified to a funcion and the SQL/XML code was being generated. --- libpgmodeler/src/function.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index 820762ef05..ad286d5650 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -473,6 +473,12 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::Language]=language->getCodeDefinition(def_type,true); attributes[Attributes::ReturnType]=return_type.getCodeDefinition(def_type); } + + if(language->getName()==~LanguageType(LanguageType::C)) + { + attributes[Attributes::Symbol]=symbol; + attributes[Attributes::Library]=library; + } } setTableReturnTypeAttribute(def_type); @@ -484,12 +490,6 @@ QString Function::getCodeDefinition(unsigned def_type, bool reduced_form) attributes[Attributes::BehaviorType]=(~behavior_type); attributes[Attributes::Definition]=source_code; - if(language->getName()==~LanguageType(LanguageType::C)) - { - attributes[Attributes::Symbol]=symbol; - attributes[Attributes::Library]=library; - } - attributes[Attributes::Signature]=signature; return(BaseObject::getCodeDefinition(def_type, reduced_form)); } From bd2420975d14988041281399fa92c1ed6c660797 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 26 Mar 2019 11:38:46 -0300 Subject: [PATCH 298/425] Added support to XML code generation to ForeignDataWrapper --- libpgmodeler/src/foreigndatawrapper.cpp | 29 ++++++++++--------- libpgmodeler/src/foreigndatawrapper.h | 2 ++ schemas/xml/dtd/foreigndatawrapper.dtd | 9 ++++++ schemas/xml/foreigndatawrapper.sch | 29 +++++++++++++++++++ .../foreigndatawrappertest.cpp | 11 +++++++ 5 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 schemas/xml/dtd/foreigndatawrapper.dtd create mode 100644 schemas/xml/foreigndatawrapper.sch diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index d59f99f1e3..dbf64278be 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -18,6 +18,8 @@ #include "foreigndatawrapper.h" +const QString ForeignDataWrapper::OptionSeparator = QString("•"); + ForeignDataWrapper::ForeignDataWrapper(void) { obj_type=ObjectType::ForeignDataWrapper; @@ -120,24 +122,25 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) if(!code_def.isEmpty()) return(code_def); QStringList fmt_options; + bool is_sql_def = (def_type == SchemaParser::SqlDefinition); - if(def_type == SchemaParser::SqlDefinition) + if(handler_func) { - if(handler_func) - attributes[Attributes::HandlerFunc] = handler_func->getSignature(); - - if(validator_func) - attributes[Attributes::ValidatorFunc] = validator_func->getSignature(); - - for(auto &itr : options) - fmt_options += QString("%1 '%2'").arg(itr.first).arg(itr.second); - - attributes[Attributes::Options] = fmt_options.join(','); + handler_func->setAttribute(Attributes::RefType, Attributes::HandlerFunc); + attributes[Attributes::HandlerFunc] = is_sql_def ? handler_func->getSignature() : handler_func->getCodeDefinition(def_type, true); } - else - { + if(validator_func) + { + validator_func->setAttribute(Attributes::RefType, Attributes::ValidatorFunc); + attributes[Attributes::ValidatorFunc] = is_sql_def ? validator_func->getSignature() : validator_func->getCodeDefinition(def_type, true); } + for(auto &itr : options) + fmt_options += is_sql_def ? QString("%1 '%2'").arg(itr.first).arg(itr.second) : + QString("%1%2%3").arg(itr.first).arg(OptionSeparator).arg(itr.second); + + attributes[Attributes::Options] = fmt_options.join(is_sql_def ? QChar(',') : OptionSeparator); + return(this->BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h index 2038d5b707..256b3fe542 100644 --- a/libpgmodeler/src/foreigndatawrapper.h +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -39,6 +39,8 @@ class ForeignDataWrapper: public BaseObject{ attribs_map options; public: + static const QString OptionSeparator; + ForeignDataWrapper(void); void setHandlerFunction(Function *func); diff --git a/schemas/xml/dtd/foreigndatawrapper.dtd b/schemas/xml/dtd/foreigndatawrapper.dtd new file mode 100644 index 0000000000..78b4689c6e --- /dev/null +++ b/schemas/xml/dtd/foreigndatawrapper.dtd @@ -0,0 +1,9 @@ + + + + + + diff --git a/schemas/xml/foreigndatawrapper.sch b/schemas/xml/foreigndatawrapper.sch new file mode 100644 index 0000000000..d9f7f83e2e --- /dev/null +++ b/schemas/xml/foreigndatawrapper.sch @@ -0,0 +1,29 @@ +# XML definition for indexes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[ $br + +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + +%if {handler} %then {handler} %end +%if {validator} %then {validator} %end + + diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp index 1a3e4a85cf..04791d2906 100644 --- a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -139,6 +139,14 @@ COMMENT ON FOREIGN DATA WRAPPER fdw IS 'This is a test comment on FDW'; \ ALTER FOREIGN DATA WRAPPER fdw OWNER TO postgres; \ -- ddl-end -- ").simplified(); + QString xml_code =QString( +" \ + \ + \ + \ + \ +").replace("*", ForeignDataWrapper::OptionSeparator).simplified(); + try { public_sch.setName("public"); @@ -163,6 +171,9 @@ ALTER FOREIGN DATA WRAPPER fdw OWNER TO postgres; \ QString res_sql_code = fdw.getCodeDefinition(SchemaParser::SqlDefinition).simplified(); QCOMPARE(sql_code, res_sql_code); + + QString res_xml_code = fdw.getCodeDefinition(SchemaParser::XmlDefinition).simplified(); + QCOMPARE(xml_code, res_xml_code); } catch (Exception &e) { From 8f7d3a6eae5fad13ff62e981b393830c14c463f4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 26 Mar 2019 16:22:22 -0300 Subject: [PATCH 299/425] Added methods for foreign data wrapper handling on DatabaseModel Minor code refactoring on Table and View classes --- libpgmodeler/src/baseobject.cpp | 2 +- libpgmodeler/src/databasemodel.cpp | 408 +++++++++--------- libpgmodeler/src/databasemodel.h | 12 + libpgmodeler/src/foreigndatawrapper.cpp | 1 - libpgmodeler/src/foreigndatawrapper.h | 1 + libpgmodeler/src/table.cpp | 19 +- libpgmodeler/src/view.cpp | 10 +- .../foreigndatawrappertest.cpp | 15 +- 8 files changed, 262 insertions(+), 206 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 548a988a42..09434f8068 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -943,7 +943,7 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector::iterator itr; if(inc_table_objs) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 3e59e77d04..018b1c4e8a 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -50,6 +50,35 @@ DatabaseModel::DatabaseModel(void) attributes[Attributes::PrependAtBod]=QString(); attributes[Attributes::AllowConns]=QString(); attributes[Attributes::IsTemplate]=QString(); + + obj_lists = { + { ObjectType::Textbox, &textboxes }, + { ObjectType::Table, &tables }, + { ObjectType::Function, &functions }, + { ObjectType::Aggregate, &aggregates }, + { ObjectType::Schema, &schemas }, + { ObjectType::View, &views }, + { ObjectType::Type, &types }, + { ObjectType::Role, &roles }, + { ObjectType::Tablespace, &tablespaces }, + { ObjectType::Language, &languages }, + { ObjectType::Cast, &casts }, + { ObjectType::Conversion, &conversions }, + { ObjectType::Operator, &operators }, + { ObjectType::OpClass, &op_classes }, + { ObjectType::OpFamily, &op_families }, + { ObjectType::Domain, &domains }, + { ObjectType::Sequence, &sequences }, + { ObjectType::BaseRelationship, &base_relationships }, + { ObjectType::Relationship, &relationships }, + { ObjectType::Permission, &permissions }, + { ObjectType::Collation, &collations }, + { ObjectType::Extension, &extensions }, + { ObjectType::Tag, &tags }, + { ObjectType::EventTrigger, &eventtriggers }, + { ObjectType::GenericSql, &genericsqls }, + { ObjectType::ForeignDataWrapper, &fdata_wrappers } + }; } DatabaseModel::DatabaseModel(ModelWidget *model_wgt):DatabaseModel() @@ -102,124 +131,77 @@ void DatabaseModel::setAuthor(const QString &author) vector *DatabaseModel::getObjectList(ObjectType obj_type) { - if(obj_type==ObjectType::Textbox) - return(&textboxes); - else if(obj_type==ObjectType::Table) - return(&tables); - else if(obj_type==ObjectType::Function) - return(&functions); - else if(obj_type==ObjectType::Aggregate) - return(&aggregates); - else if(obj_type==ObjectType::Schema) - return(&schemas); - else if(obj_type==ObjectType::View) - return(&views); - else if(obj_type==ObjectType::Type) - return(&types); - else if(obj_type==ObjectType::Role) - return(&roles); - else if(obj_type==ObjectType::Tablespace) - return(&tablespaces); - else if(obj_type==ObjectType::Language) - return(&languages); - else if(obj_type==ObjectType::Cast) - return(&casts); - else if(obj_type==ObjectType::Conversion) - return(&conversions); - else if(obj_type==ObjectType::Operator) - return(&operators); - else if(obj_type==ObjectType::OpClass) - return(&op_classes); - else if(obj_type==ObjectType::OpFamily) - return(&op_families); - else if(obj_type==ObjectType::Domain) - return(&domains); - else if(obj_type==ObjectType::Sequence) - return(&sequences); - else if(obj_type==ObjectType::BaseRelationship) - return(&base_relationships); - else if(obj_type==ObjectType::Relationship) - return(&relationships); - else if(obj_type==ObjectType::Permission) - return(&permissions); - else if(obj_type==ObjectType::Collation) - return(&collations); - else if(obj_type==ObjectType::Extension) - return(&extensions); - else if(obj_type==ObjectType::Tag) - return(&tags); - else if(obj_type==ObjectType::EventTrigger) - return(&eventtriggers); - else if(obj_type==ObjectType::GenericSql) - return(&genericsqls); - else + if(obj_lists.count(obj_type) == 0) return(nullptr); + + return(obj_lists[obj_type]); } void DatabaseModel::addObject(BaseObject *object, int obj_idx) { ObjectType obj_type; - if(object) + if(!object) + return; + + try { - try - { - obj_type=object->getObjectType(); + obj_type=object->getObjectType(); - if(obj_type==ObjectType::Relationship || - obj_type==ObjectType::BaseRelationship) - addRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Textbox) - addTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Table) - addTable(dynamic_cast
(object), obj_idx); - else if(obj_type==ObjectType::Function) - addFunction(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Aggregate) - addAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Schema) - addSchema(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::View) - addView(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Type) - addType(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Role) - addRole(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Tablespace) - addTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Language) - addLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Cast) - addCast(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Conversion) - addConversion(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Operator) - addOperator(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::OpClass) - addOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::OpFamily) - addOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Domain) - addDomain(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Sequence) - addSequence(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Collation) - addCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Extension) - addExtension(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Tag) - addTag(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Permission) - addPermission(dynamic_cast(object)); - else if(obj_type==ObjectType::EventTrigger) - addEventTrigger(dynamic_cast(object)); - else if(obj_type==ObjectType::GenericSql) - addGenericSQL(dynamic_cast(object)); - } - catch(Exception &e) - { - throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); - } + if(obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) + addRelationship(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Textbox) + addTextbox(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Table) + addTable(dynamic_cast
(object), obj_idx); + else if(obj_type==ObjectType::Function) + addFunction(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Aggregate) + addAggregate(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Schema) + addSchema(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::View) + addView(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Type) + addType(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Role) + addRole(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Tablespace) + addTablespace(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Language) + addLanguage(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Cast) + addCast(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Conversion) + addConversion(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Operator) + addOperator(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::OpClass) + addOperatorClass(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::OpFamily) + addOperatorFamily(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Domain) + addDomain(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Sequence) + addSequence(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Collation) + addCollation(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Extension) + addExtension(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Tag) + addTag(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Permission) + addPermission(dynamic_cast(object)); + else if(obj_type==ObjectType::EventTrigger) + addEventTrigger(dynamic_cast(object)); + else if(obj_type==ObjectType::GenericSql) + addGenericSQL(dynamic_cast(object)); + else if(obj_type==ObjectType::ForeignDataWrapper) + addForeignDataWrapper(dynamic_cast(object)); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } @@ -227,88 +209,16 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) { ObjectType obj_type; + if(!object) + return; - if(object) - { - try - { - obj_type=object->getObjectType(); - - if(obj_type==ObjectType::Relationship || - obj_type==ObjectType::BaseRelationship) - removeRelationship(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Textbox) - removeTextbox(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Table) - removeTable(dynamic_cast
(object), obj_idx); - else if(obj_type==ObjectType::Function) - removeFunction(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Aggregate) - removeAggregate(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Schema) - removeSchema(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::View) - removeView(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Type) - removeType(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Role) - removeRole(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Tablespace) - removeTablespace(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Language) - removeLanguage(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Cast) - removeCast(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Conversion) - removeConversion(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Operator) - removeOperator(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::OpClass) - removeOperatorClass(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::OpFamily) - removeOperatorFamily(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Domain) - removeDomain(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Sequence) - removeSequence(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Collation) - removeCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Extension) - removeExtension(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Tag) - removeTag(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Permission) - removePermission(dynamic_cast(object)); - else if(obj_type==ObjectType::EventTrigger) - removeEventTrigger(dynamic_cast(object)); - else if(obj_type==ObjectType::GenericSql) - removeGenericSQL(dynamic_cast(object)); - } - catch(Exception &e) - { - throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); - } - } -} - -void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) -{ - if(TableObject::isTableObject(obj_type) || - obj_type==ObjectType::BaseObject || obj_type==ObjectType::BaseRelationship || - obj_type==ObjectType::Database) - throw Exception(ErrorCode::RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); - - else + try { - vector *obj_list=nullptr; - BaseObject *object=nullptr; - - obj_list=getObjectList(obj_type); - if(obj_idx >= obj_list->size()) - throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + obj_type=object->getObjectType(); - object=(*obj_list)[obj_idx]; - if(obj_type==ObjectType::Textbox) + if(obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) + removeRelationship(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Textbox) removeTextbox(dynamic_cast(object), obj_idx); else if(obj_type==ObjectType::Table) removeTable(dynamic_cast
(object), obj_idx); @@ -344,15 +254,88 @@ void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) removeSequence(dynamic_cast(object), obj_idx); else if(obj_type==ObjectType::Collation) removeCollation(dynamic_cast(object), obj_idx); - else if(obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) - removeRelationship(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Extension) + removeExtension(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Tag) + removeTag(dynamic_cast(object), obj_idx); else if(obj_type==ObjectType::Permission) removePermission(dynamic_cast(object)); else if(obj_type==ObjectType::EventTrigger) - removeEventTrigger(dynamic_cast(object), obj_idx); + removeEventTrigger(dynamic_cast(object)); else if(obj_type==ObjectType::GenericSql) - removeGenericSQL(dynamic_cast(object), obj_idx); + removeGenericSQL(dynamic_cast(object)); + else if(obj_type==ObjectType::ForeignDataWrapper) + removeForeignDataWrapper(dynamic_cast(object)); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } + +} + +void DatabaseModel::removeObject(unsigned obj_idx, ObjectType obj_type) +{ + if(TableObject::isTableObject(obj_type) || + obj_type==ObjectType::BaseObject || obj_type==ObjectType::BaseRelationship || + obj_type==ObjectType::Database) + throw Exception(ErrorCode::RemObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + vector *obj_list=nullptr; + BaseObject *object=nullptr; + + obj_list=getObjectList(obj_type); + if(obj_idx >= obj_list->size()) + throw Exception(ErrorCode::RefObjectInvalidIndex,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + object=(*obj_list)[obj_idx]; + if(obj_type==ObjectType::Textbox) + removeTextbox(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Table) + removeTable(dynamic_cast
(object), obj_idx); + else if(obj_type==ObjectType::Function) + removeFunction(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Aggregate) + removeAggregate(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Schema) + removeSchema(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::View) + removeView(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Type) + removeType(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Role) + removeRole(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Tablespace) + removeTablespace(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Language) + removeLanguage(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Cast) + removeCast(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Conversion) + removeConversion(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Operator) + removeOperator(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::OpClass) + removeOperatorClass(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::OpFamily) + removeOperatorFamily(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Domain) + removeDomain(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Sequence) + removeSequence(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Collation) + removeCollation(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Relationship || obj_type==ObjectType::BaseRelationship) + removeRelationship(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::Permission) + removePermission(dynamic_cast(object)); + else if(obj_type==ObjectType::EventTrigger) + removeEventTrigger(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::GenericSql) + removeGenericSQL(dynamic_cast(object), obj_idx); + else if(obj_type==ObjectType::ForeignDataWrapper) + removeForeignDataWrapper(dynamic_cast(object), obj_idx); + } void DatabaseModel::__addObject(BaseObject *object, int obj_idx) @@ -1059,6 +1042,40 @@ GenericSQL *DatabaseModel::getGenericSQL(const QString &name) return(dynamic_cast(getObject(name, ObjectType::GenericSql))); } +void DatabaseModel::addForeignDataWrapper(ForeignDataWrapper *fdata_wrapper, int obj_idx) +{ + try + { + __addObject(fdata_wrapper, obj_idx); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void DatabaseModel::removeForeignDataWrapper(ForeignDataWrapper *fdata_wrapper, int obj_idx) +{ + try + { + __removeObject(fdata_wrapper, obj_idx); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } +} + +ForeignDataWrapper *DatabaseModel::getForeignDataWrapper(unsigned obj_idx) +{ + return(dynamic_cast(getObject(obj_idx, ObjectType::ForeignDataWrapper))); +} + +ForeignDataWrapper *DatabaseModel::getForeignDataWrapper(const QString &name) +{ + return(dynamic_cast(getObject(name, ObjectType::ForeignDataWrapper))); +} + void DatabaseModel::removeExtension(Extension *extension, int obj_idx) { try @@ -7975,6 +7992,13 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetTrigger(i)->getReferencedTable(), deps, inc_indirect_deps); } } + //** Getting the dependecies for foreign data wrapper ** + else if(obj_type == ObjectType::ForeignDataWrapper) + { + ForeignDataWrapper *fdw = dynamic_cast(object); + getObjectDependecies(fdw->getHandlerFunction(), deps, inc_indirect_deps); + getObjectDependecies(fdw->getValidatorFunction(), deps, inc_indirect_deps); + } if(obj_type == ObjectType::Table || obj_type == ObjectType::View) { diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 1ecd0466f6..352e30453a 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -54,6 +54,7 @@ Additionally, this class, saves, loads and generates the XML/SQL definition of a #include "tag.h" #include "eventtrigger.h" #include "genericsql.h" +#include "foreigndatawrapper.h" #include #include @@ -63,6 +64,10 @@ class DatabaseModel: public QObject, public BaseObject { private: Q_OBJECT + /*! \brief Stores the references of all object lists of each type. This map is used by getObjectList() in order + * to return the list according to the provided type */ + map *> obj_lists; + static unsigned dbmodel_id; XmlParser xmlparser; @@ -87,6 +92,7 @@ class DatabaseModel: public QObject, public BaseObject { //! \brief Database localizations (LC_CTYPE, LC_COLLATE) localizations[2]; + //! \brief Stores the objects of each type that are considered the default ones associated to new objects map default_objs; //! \brief Maximum number of connections @@ -124,6 +130,7 @@ class DatabaseModel: public QObject, public BaseObject { vector tags; vector eventtriggers; vector genericsqls; + vector fdata_wrappers; /*! \brief Stores the xml definition for special objects. This map is used when revalidating the relationships */ @@ -486,6 +493,11 @@ class DatabaseModel: public QObject, public BaseObject { GenericSQL *getGenericSQL(unsigned obj_idx); GenericSQL *getGenericSQL(const QString &name); + void addForeignDataWrapper(ForeignDataWrapper *fdata_wrapper, int obj_idx=-1); + void removeForeignDataWrapper(ForeignDataWrapper *fdata_wrapper, int obj_idx=-1); + ForeignDataWrapper *getForeignDataWrapper(unsigned obj_idx); + ForeignDataWrapper *getForeignDataWrapper(const QString &name); + void addPermission(Permission *perm); void removePermission(Permission *perm); diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index dbf64278be..c9406abaf1 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -66,7 +66,6 @@ void ForeignDataWrapper::setValidatorFunction(Function *func) .arg(this->getName(true)) .arg(this->getTypeName()), ErrorCode::AsgFunctionInvalidParameters, __PRETTY_FUNCTION__, __FILE__, __LINE__); - } validator_func = func; diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h index 256b3fe542..1a92492f64 100644 --- a/libpgmodeler/src/foreigndatawrapper.h +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -39,6 +39,7 @@ class ForeignDataWrapper: public BaseObject{ attribs_map options; public: + //! \brief Store the character used to separate options/values in the XML code static const QString OptionSeparator; ForeignDataWrapper(void); diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index 7f9e27ff7a..ee4c11c525 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -343,18 +343,23 @@ vector *Table::getObjectList(ObjectType obj_type) { if(obj_type==ObjectType::Column) return(&columns); - else if(obj_type==ObjectType::Constraint) + + if(obj_type==ObjectType::Constraint) return(&constraints); - else if(obj_type==ObjectType::Rule) + + if(obj_type==ObjectType::Rule) return(&rules); - else if(obj_type==ObjectType::Trigger) + + if(obj_type==ObjectType::Trigger) return(&triggers); - else if(obj_type==ObjectType::Index) + + if(obj_type==ObjectType::Index) return(&indexes); - else if(obj_type==ObjectType::Policy) + + if(obj_type==ObjectType::Policy) return(&policies); - else - throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void Table::addObject(BaseObject *obj, int obj_idx) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 0194678311..32d553c104 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -1045,12 +1045,14 @@ vector *View::getObjectList(ObjectType obj_type) { if(obj_type==ObjectType::Trigger) return(&triggers); - else if(obj_type==ObjectType::Rule) + + if(obj_type==ObjectType::Rule) return(&rules); - else if(obj_type==ObjectType::Index) + + if(obj_type==ObjectType::Index) return(&indexes); - else - throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + throw Exception(ErrorCode::ObtObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } void View::removeObjects(void) diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp index 04791d2906..2d3833f380 100644 --- a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -17,7 +17,7 @@ */ #include -#include "foreigndatawrapper.h" +#include "databasemodel.h" class ForeignDataWrapperTest: public QObject { private: @@ -27,6 +27,7 @@ class ForeignDataWrapperTest: public QObject { void assignValidFunctionDoesntRaiseException(void); void assignInvalidFunctionRaisesException(void); void codeGeneratedIsWellFormed(void); + void modelReturnsFDWasFunctionsReferences(void); }; void ForeignDataWrapperTest::assignValidFunctionDoesntRaiseException(void) @@ -181,5 +182,17 @@ ALTER FOREIGN DATA WRAPPER fdw OWNER TO postgres; \ } } +void ForeignDataWrapperTest::modelReturnsFDWasFunctionsReferences(void) +{ + try + { + DatabaseModel model; + } + catch (Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } +} + QTEST_MAIN(ForeignDataWrapperTest) #include "foreigndatawrappertest.moc" From 3f3b6a36fcef7460bea60476499427523817a4ae Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 26 Mar 2019 17:40:23 -0300 Subject: [PATCH 300/425] Improved the method DatabaseModel::getObjectReferences to detected foreign data wrappers as functions' references --- libpgmodeler/src/databasemodel.cpp | 17 ++++- .../foreigndatawrappertest.cpp | 63 ++++++++++++++++++- 2 files changed, 76 insertions(+), 4 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 018b1c4e8a..06f634125b 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -8197,7 +8197,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector vector::iterator itr, itr_end; ObjectType obj_types[]={ObjectType::Cast, ObjectType::EventTrigger, ObjectType::Conversion, ObjectType::Aggregate, ObjectType::Operator, ObjectType::OpClass, - ObjectType::Table, ObjectType::Type, ObjectType::Language }; + ObjectType::Table, ObjectType::Type, ObjectType::Language, ObjectType::ForeignDataWrapper }; unsigned i, i1, count, cnt=sizeof(obj_types)/sizeof(ObjectType); Table *tab=nullptr; Aggregate *aggreg=nullptr; @@ -8206,6 +8206,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector Type *type=nullptr; Language *lang=nullptr; OperatorClass *opclass=nullptr; + ForeignDataWrapper *fdw=nullptr; for(i=0; i < cnt && (!exclusion_mode || (exclusion_mode && !refer)); i++) { @@ -8351,6 +8352,20 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } + else if(obj_types[i]==ObjectType::ForeignDataWrapper) + { + while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) + { + fdw=dynamic_cast(*itr); + itr++; + + if(fdw->getHandlerFunction() == func || fdw->getValidatorFunction() == func) + { + refer=true; + refs.push_back(fdw); + } + } + } } } diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp index 2d3833f380..04bda19fe2 100644 --- a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -27,7 +27,7 @@ class ForeignDataWrapperTest: public QObject { void assignValidFunctionDoesntRaiseException(void); void assignInvalidFunctionRaisesException(void); void codeGeneratedIsWellFormed(void); - void modelReturnsFDWasFunctionsReferences(void); + void modelReturnsDepsAndRefsForFDW(void); }; void ForeignDataWrapperTest::assignValidFunctionDoesntRaiseException(void) @@ -182,11 +182,68 @@ ALTER FOREIGN DATA WRAPPER fdw OWNER TO postgres; \ } } -void ForeignDataWrapperTest::modelReturnsFDWasFunctionsReferences(void) +void ForeignDataWrapperTest::modelReturnsDepsAndRefsForFDW(void) { + DatabaseModel model; + ForeignDataWrapper fdw; + Role owner; + Schema public_sch; + Function func_handler, func_validator; + Language lang; + try { - DatabaseModel model; + public_sch.setName("public"); + owner.setName("postgres"); + + model.addSchema(&public_sch); + model.addRole(&owner); + + fdw.setName("fdw"); + fdw.setOwner(&owner); + func_handler.setName("func_handler"); + func_handler.setReturnType(PgSqlType("fdw_handler")); + func_handler.setSchema(&public_sch); + func_handler.setSourceCode("foo"); + func_handler.setOwner(&owner); + func_handler.setLanguage(&lang); + fdw.setHandlerFunction(&func_handler); + + func_validator.setName("func_validator"); + func_validator.addParameter(Parameter("param1", PgSqlType("text", 1))); + func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); + func_validator.setSchema(&public_sch); + func_validator.setSourceCode("foo"); + func_validator.setOwner(&owner); + func_validator.setLanguage(&lang); + fdw.setValidatorFunction(&func_validator); + + fdw.setOption("opt1", "value1"); + fdw.setOption("opt2", "value2"); + fdw.setComment("This is a test comment on FDW"); + + model.addFunction(&func_handler); + model.addFunction(&func_validator); + model.addForeignDataWrapper(&fdw); + + vector deps; + model.getObjectDependecies(&fdw, deps); + + QVERIFY(deps.size() >= 3); + + deps.clear(); + model.getObjectReferences(&func_validator, deps); + QVERIFY(deps.size() == 1); + + deps.clear(); + model.getObjectReferences(&func_handler, deps); + QVERIFY(deps.size() == 1); + + model.removeForeignDataWrapper(&fdw); + model.removeFunction(&func_handler); + model.removeFunction(&func_validator); + model.removeSchema(&public_sch); + model.removeRole(&owner); } catch (Exception &e) { From 68ddb64ff553d2b7056027acba2bf2ce32933261 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 27 Mar 2019 09:50:10 -0300 Subject: [PATCH 301/425] Added the ForeignDataWrapper object to the ModelObjectsWidget listing --- libpgmodeler_ui/src/modelobjectswidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 9973fd0125..f44a2bf888 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -710,7 +710,8 @@ void ModelObjectsWidget::updateDatabaseTree(void) ObjectType types[]={ ObjectType::Role, ObjectType::Tablespace, ObjectType::Language, ObjectType::Cast, ObjectType::Textbox, ObjectType::Relationship, ObjectType::EventTrigger, - ObjectType::Tag, ObjectType::GenericSql, ObjectType::Extension }; + ObjectType::Tag, ObjectType::GenericSql, ObjectType::Extension, + ObjectType::ForeignDataWrapper }; unsigned count, i, i1, type_cnt=sizeof(types)/sizeof(ObjectType); try From 8e9e1c97c2d0a029685de8e19224bad09be1a750 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 2 Apr 2019 15:28:41 -0300 Subject: [PATCH 302/425] Adding support to creation of foreign data wrappers from xml code at DatabaseModel --- libpgmodeler/src/databasemodel.cpp | 125 +++++++++++++++--- libpgmodeler/src/databasemodel.h | 1 + libpgmodeler/src/foreigndatawrapper.cpp | 7 +- libpgmodeler/src/foreigndatawrapper.h | 3 +- .../foreigndatawrappertest.cpp | 81 +++++++++++- 5 files changed, 194 insertions(+), 23 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 06f634125b..ebf16cb3ea 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -727,6 +727,7 @@ void DatabaseModel::destroyObjects(void) map objects; map::reverse_iterator ritr, ritr_end; vector rem_obj_types; + BaseGraphicObject *graph_obj = nullptr; //Blocking signals of all graphical objects to avoid uneeded updates in the destruction this->blockSignals(true); @@ -734,7 +735,12 @@ void DatabaseModel::destroyObjects(void) for(unsigned i=0; i < 5; i++) { for(auto &object : *this->getObjectList(graph_types[i])) - dynamic_cast(object)->blockSignals(true); + { + graph_obj = dynamic_cast(object); + + if(graph_obj) + dynamic_cast(object)->blockSignals(true); + } } try @@ -3270,6 +3276,8 @@ BaseObject *DatabaseModel::createObject(ObjectType obj_type) object=createGenericSQL(); else if(obj_type==ObjectType::Policy) object=createPolicy(); + else if(obj_type==ObjectType::ForeignDataWrapper) + object=createForeignDataWrapper(); } return(object); @@ -5833,6 +5841,91 @@ GenericSQL *DatabaseModel::createGenericSQL(void) return(genericsql); } +ForeignDataWrapper *DatabaseModel::createForeignDataWrapper(void) +{ + attribs_map attribs; + ForeignDataWrapper *fdw=nullptr; + BaseObject *func=nullptr; + QString signature, ref_type; + ObjectType obj_type; + QStringList options, opt_val; + int count = 0; + + try + { + fdw = new ForeignDataWrapper; + + xmlparser.getElementAttributes(attribs); + setBasicAttributes(fdw); + + options = attribs[Attributes::Options].split(ForeignDataWrapper::OptionsSeparator); + + for(auto &option : options) + { + opt_val = option.split(ForeignDataWrapper::OptionValueSeparator); + + if(opt_val.size() < 2) + continue; + + fdw->setOption(opt_val[0], opt_val[1]); + } + + if(xmlparser.accessElement(XmlParser::ChildElement)) + { + do + { + if(xmlparser.getElementType() == XML_ELEMENT_NODE) + { + obj_type = BaseObject::getObjectType(xmlparser.getElementName()); + + if(obj_type == ObjectType::Function) + { + xmlparser.getElementAttributes(attribs); + + //Gets the function reference type + ref_type = attribs[Attributes::RefType]; + + //Try to retrieve one the functions of the fdw + if(ref_type == Attributes::ValidatorFunc || ref_type == Attributes::HandlerFunc) + { + //Gets the function signature and tries to retrieve it from the model + signature = attribs[Attributes::Signature]; + func = getObject(signature, ObjectType::Function); + + //Raises an error if the function doesn't exists + if(!func) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) + .arg(fdw->getName()) + .arg(fdw->getTypeName()) + .arg(signature) + .arg(BaseObject::getTypeName(ObjectType::Function)), + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + if(ref_type == Attributes::ValidatorFunc) + fdw->setValidatorFunction(dynamic_cast(func)); + else if(ref_type == Attributes::HandlerFunc) + fdw->setHandlerFunction(dynamic_cast(func)); + } + else + //Raises an error if the function type is invalid + throw Exception(ErrorCode::RefFunctionInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + } + } + while(xmlparser.accessElement(XmlParser::NextElement)); + } + } + catch(Exception &e) + { + if(fdw) + delete(fdw); + + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + } + + return(fdw); +} + void DatabaseModel::updateViewsReferencingTable(Table *table) { BaseRelationship *rel = nullptr; @@ -7114,13 +7207,12 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b Constraint *constr=nullptr; View *view=nullptr; Relationship *rel=nullptr; - ObjectType aux_obj_types[]={ ObjectType::Role, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Tag }, - obj_types[]={ ObjectType::EventTrigger, ObjectType::Collation, ObjectType::Language, ObjectType::Function, ObjectType::Type, - ObjectType::Cast, ObjectType::Conversion, ObjectType::Extension, - ObjectType::Operator, ObjectType::OpFamily, ObjectType::OpClass, - ObjectType::Aggregate, ObjectType::Domain, ObjectType::Textbox, ObjectType::BaseRelationship, - ObjectType::Relationship, ObjectType::Table, ObjectType::View, ObjectType::Sequence, ObjectType::GenericSql }; - unsigned i=0, aux_obj_cnt=sizeof(aux_obj_types)/sizeof(ObjectType), count=sizeof(obj_types)/sizeof(ObjectType); + ObjectType aux_obj_types[]={ ObjectType::Role, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Tag }; + + vector obj_types_vect = getObjectTypes(false, { ObjectType::Role, ObjectType::Tablespace, ObjectType::Schema, + ObjectType::Tag, ObjectType::Database, ObjectType::Permission }); + + unsigned i=0, aux_obj_cnt=sizeof(aux_obj_types)/sizeof(ObjectType); //The first objects on the map will be roles, tablespaces, schemas and tags for(i=0; i < aux_obj_cnt; i++) @@ -7137,14 +7229,14 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b //Includes the database model on the objects map permitting to create the code in a correct order objects_map[this->getObjectId()]=this; - for(i=0; i < count; i++) + for(auto &obj_type : obj_types_vect) { //For SQL definition, only the textbox and base relationship does not enters to the code generation list if(def_type==SchemaParser::SqlDefinition && - (obj_types[i]==ObjectType::Textbox || obj_types[i]==ObjectType::BaseRelationship)) + (obj_type==ObjectType::Textbox || obj_type==ObjectType::BaseRelationship)) obj_list=nullptr; else - obj_list=getObjectList(obj_types[i]); + obj_list=getObjectList(obj_type); if(obj_list) { @@ -7180,11 +7272,14 @@ map DatabaseModel::getCreationOrder(unsigned def_type, b on the map of objects. */ for(auto &obj : tables) { - table=dynamic_cast
(obj); - count=table->getConstraintCount(); - for(i=0; i < count; i++) + table = dynamic_cast
(obj); + //count = table->getConstraintCount(); + + //for(i=0; i < count; i++) + for(auto &obj : *table->getObjectList(ObjectType::Constraint)) { - constr=table->getConstraint(i); + //table->getConstraint(i); + constr = dynamic_cast(obj); /* Case the constraint is a special object stores it on the objects map. Independently to the configuration, foreign keys are discarded in this iteration because on the end of the method diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 352e30453a..493721ac29 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -556,6 +556,7 @@ class DatabaseModel: public QObject, public BaseObject { Policy *createPolicy(void); EventTrigger *createEventTrigger(void); GenericSQL *createGenericSQL(void); + ForeignDataWrapper *createForeignDataWrapper(void); //! \brief Update views that reference the provided table forcing the column name deduction and redraw of the former objects void updateViewsReferencingTable(Table *table); diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index c9406abaf1..5d0c8e3dbc 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -18,7 +18,8 @@ #include "foreigndatawrapper.h" -const QString ForeignDataWrapper::OptionSeparator = QString("•"); +const QString ForeignDataWrapper::OptionsSeparator = QString(","); +const QString ForeignDataWrapper::OptionValueSeparator = QString("•"); ForeignDataWrapper::ForeignDataWrapper(void) { @@ -137,9 +138,9 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) for(auto &itr : options) fmt_options += is_sql_def ? QString("%1 '%2'").arg(itr.first).arg(itr.second) : - QString("%1%2%3").arg(itr.first).arg(OptionSeparator).arg(itr.second); + QString("%1%2%3").arg(itr.first).arg(OptionValueSeparator).arg(itr.second); - attributes[Attributes::Options] = fmt_options.join(is_sql_def ? QChar(',') : OptionSeparator); + attributes[Attributes::Options] = fmt_options.join(OptionsSeparator); return(this->BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h index 1a92492f64..9d536247e9 100644 --- a/libpgmodeler/src/foreigndatawrapper.h +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -40,7 +40,8 @@ class ForeignDataWrapper: public BaseObject{ public: //! \brief Store the character used to separate options/values in the XML code - static const QString OptionSeparator; + static const QString OptionsSeparator; + static const QString OptionValueSeparator; ForeignDataWrapper(void); diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp index 04bda19fe2..a6a617cd94 100644 --- a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -28,6 +28,7 @@ class ForeignDataWrapperTest: public QObject { void assignInvalidFunctionRaisesException(void); void codeGeneratedIsWellFormed(void); void modelReturnsDepsAndRefsForFDW(void); + void modelCreatesFDWfromXMLandResultingXMLisEqual(void); }; void ForeignDataWrapperTest::assignValidFunctionDoesntRaiseException(void) @@ -141,12 +142,13 @@ ALTER FOREIGN DATA WRAPPER fdw OWNER TO postgres; \ -- ddl-end -- ").simplified(); QString xml_code =QString( -" \ +" \ \ \ \ \ -").replace("*", ForeignDataWrapper::OptionSeparator).simplified(); +").replace("#", ForeignDataWrapper::OptionValueSeparator) + .replace("*", ForeignDataWrapper::OptionsSeparator).simplified(); try { @@ -185,11 +187,11 @@ ALTER FOREIGN DATA WRAPPER fdw OWNER TO postgres; \ void ForeignDataWrapperTest::modelReturnsDepsAndRefsForFDW(void) { DatabaseModel model; - ForeignDataWrapper fdw; Role owner; Schema public_sch; - Function func_handler, func_validator; Language lang; + Function func_handler, func_validator; + ForeignDataWrapper fdw; try { @@ -242,6 +244,7 @@ void ForeignDataWrapperTest::modelReturnsDepsAndRefsForFDW(void) model.removeForeignDataWrapper(&fdw); model.removeFunction(&func_handler); model.removeFunction(&func_validator); + model.removeLanguage(&lang); model.removeSchema(&public_sch); model.removeRole(&owner); } @@ -251,5 +254,75 @@ void ForeignDataWrapperTest::modelReturnsDepsAndRefsForFDW(void) } } +void ForeignDataWrapperTest::modelCreatesFDWfromXMLandResultingXMLisEqual(void) +{ + DatabaseModel model; + Role owner; + Schema public_sch; + Language lang; + Function func_handler, func_validator; + ForeignDataWrapper *fdw = nullptr; + QString xml_code, res_xml_code; + + try + { + public_sch.setName("public"); + owner.setName("postgres"); + + model.addSchema(&public_sch); + model.addRole(&owner); + + func_handler.setName("func_handler"); + func_handler.setReturnType(PgSqlType("fdw_handler")); + func_handler.setSchema(&public_sch); + func_handler.setSourceCode("foo"); + func_handler.setOwner(&owner); + func_handler.setLanguage(&lang); + + func_validator.setName("func_validator"); + func_validator.addParameter(Parameter("param1", PgSqlType("text", 1))); + func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); + func_validator.setSchema(&public_sch); + func_validator.setSourceCode("foo"); + func_validator.setOwner(&owner); + func_validator.setLanguage(&lang); + + model.addFunction(&func_handler); + model.addFunction(&func_validator); + + xml_code=QString(" \ + \ + \ + \ + \ +").replace("#", ForeignDataWrapper::OptionValueSeparator) + .replace("*", ForeignDataWrapper::OptionsSeparator); + + model.getXMLParser()->loadXMLBuffer(xml_code); + fdw = dynamic_cast(model.createObject(ObjectType::ForeignDataWrapper)); + + model.removeForeignDataWrapper(fdw); + model.removeFunction(&func_handler); + model.removeFunction(&func_validator); + model.removeLanguage(&lang); + model.removeSchema(&public_sch); + model.removeRole(&owner); + + QVERIFY(fdw != nullptr); + + res_xml_code = fdw->getCodeDefinition(SchemaParser::XmlDefinition).simplified(); + xml_code = xml_code.simplified(); + + if(fdw) + delete(fdw); + + QCOMPARE(xml_code, res_xml_code); + } + catch (Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } +} + QTEST_MAIN(ForeignDataWrapperTest) #include "foreigndatawrappertest.moc" From b6a59b0c2fc3816c9cbcd21be424c4cf0808459d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 4 Apr 2019 11:14:11 -0300 Subject: [PATCH 303/425] Created the form to handle foreign data wrappers in the model --- libpgmodeler/src/databasemodel.cpp | 1 - .../res/icones/foreigndatawrapper.png | Bin 0 -> 2071 bytes .../res/icones/foreigndatawrapper_grp.png | Bin 0 -> 1999 bytes libpgmodeler_ui/res/resources.qrc | 2 + .../src/foreigndatawrapperwidget.cpp | 102 +++++++++++++ .../src/foreigndatawrapperwidget.h | 48 ++++++ libpgmodeler_ui/src/modelwidget.cpp | 30 ++-- .../ui/foreigndatawrapperwidget.ui | 138 ++++++++++++++++++ 8 files changed, 306 insertions(+), 15 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/foreigndatawrapper.png create mode 100644 libpgmodeler_ui/res/icones/foreigndatawrapper_grp.png create mode 100644 libpgmodeler_ui/src/foreigndatawrapperwidget.cpp create mode 100644 libpgmodeler_ui/src/foreigndatawrapperwidget.h create mode 100644 libpgmodeler_ui/ui/foreigndatawrapperwidget.ui diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index ebf16cb3ea..e9357e0f37 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -5849,7 +5849,6 @@ ForeignDataWrapper *DatabaseModel::createForeignDataWrapper(void) QString signature, ref_type; ObjectType obj_type; QStringList options, opt_val; - int count = 0; try { diff --git a/libpgmodeler_ui/res/icones/foreigndatawrapper.png b/libpgmodeler_ui/res/icones/foreigndatawrapper.png new file mode 100644 index 0000000000000000000000000000000000000000..1822358c0294afb427683089b75febf45f393b3d GIT binary patch literal 2071 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 B=d=I- literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/icones/foreigndatawrapper_grp.png b/libpgmodeler_ui/res/icones/foreigndatawrapper_grp.png new file mode 100644 index 0000000000000000000000000000000000000000..9eb0d5a595028b9ba8b4dddd2002f6c60f4b1219 GIT binary patch literal 1999 zcmV;=2Qc`FP)+9Wi>UnlA=Q^8)nac?n@0!t+JulOSJZc_^7#uqX$pm^#*?*^bPE4ZhkxbUkS&W zH7`p5^^11?^iO|2BRabJ#Z6b22t?At=ktn#e>)9vU>H8UVY`2ZM(8_L6MAfcHP62mCe=Wc53H6MKlt{lw~H5LHwZr z-~Q$X>&;u;Ulr6`^Lnn{c~}94v74&uuWj48^VuIPUpb3`n1q!GLZ}p!l=5VegLpDc zA}({P={*AeK@55$C*N;o$>LgsroNqse7&~a^-lPa1k8G3yLIbVR{wa*mIj0nl;umD zy>J)PBpX5q{GI`JzjlymHN|{u$8(=zBA#k3c2wFgW|_AyeHbQ2Q!sn>(~Dntp>bDD zwF5bw<}Xdh$SS*WUjW%i)tioX{_dPmd*?0pHl-Lkk zc5HmCOpKg*_ZONbwU~@1`ZPO*dAVG_=H|)8 zGr85$!qHRbsaw33vhoV{?`~r8oN@|EvKR=*X?Jzg?+b9|N-NVAJPn$LL8l`t9Uu}9 z^6GDP*y`)+jx4C(`NhwSKzaG%cO+-TY$q?K_F3K*tRaSPII>GUsse{c}{8 z!ynwaahGh#`RFg}JF-&Y}z+^B|mT%-{+g)^q?BRnXkR%;C zy^;AdtErzm19P?sgTX*J9A)$7Wj05p?bi>CfY<9xCc_2QE7vYsbj}?m*4vF#QpRU7 zQ7~mHQ_3q40yH5ZXB13ooc6X>j$gb@i>rr3N~R#!Oi`hQb7x!Y`#Z~jmC7_L>re=(OPm8nDEteJ)6_;1fsG`5m!{vWA^TU^($3z;xY()U+j7mJMAj`_IfJhg` zktT8tgIKc+7|gktt%ca^4(dt`R23!gyH4FZf9u|X2MI_4XhM-gp|)#-K3(~m^(!mK zV`56KLL#jZh-Mf{$b{m8_>Da*np=rZ(~uBILPLzKb&`P`YaUg0W31!Ah5a3n`BXmu zs6ZHq0I^7<$JOUfFJHR6KJSxE)Kxhs%`?%_)sH6vDOtnhKf%1R6qKw5QxTY_AX&;F zr-XP?q4V79blwYkBfWR`UK|(}V0b`O zS~Zhft{x6Mqgaw52)U4QXF}*Y$RU!EZU+1w()}%jlfb0L@hjmtCIfLLlMLLrvhOE< zc=OQtw&pwBuM^2+5?PkXWHR)7{rCc54q3};*kt~a+53^%0%H-G*{SJfmFy#o=#LxcSBz+sx4Lkz{!$g&DLJwj8FMx0C1 z#~W`A1-&$J0b`jMxX;92-`eLk8}#@G2Kf6mKO!rSNH~fjrw~Fz5;9_>LJ3WL%$p?i z`jGseaX|kN{i6V~HBHg`J-3~gF8GRlp^RhJ6LSrD7O-X;n4v#IeT@N%RzTE^q$W`^ zaT3WCS}Kg1PSFu94mUYt`@KV{_@f9ItrLTT?bluHH_!LEyFxKf*dFcav$%S#lC3Dt zRJ(+v3k!&0RKloATqwzybgFL-`>$5~;*!&OdgQ#%AI%z}Gs=LnP4V9@IYvYd4K9L{%-`(956oNa(M;n{EkO|5R^9GxUdk`O{0{(~9~P+$bJ h09A(l^8e&?{BMR38(whWULF7d002ovPDHLkV1nhKy#)XO literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/resources.qrc b/libpgmodeler_ui/res/resources.qrc index 737babd83d..ac0c5f7d5e 100644 --- a/libpgmodeler_ui/res/resources.qrc +++ b/libpgmodeler_ui/res/resources.qrc @@ -253,6 +253,8 @@ icones/dellayer.png icones/clearlayers.png icones/movetolayer.png + icones/foreigndatawrapper_grp.png + icones/foreigndatawrapper.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp b/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp new file mode 100644 index 0000000000..ebbcd7f704 --- /dev/null +++ b/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp @@ -0,0 +1,102 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "foreigndatawrapperwidget.h" + +ForeignDataWrapperWidget::ForeignDataWrapperWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ForeignDataWrapper) +{ + try + { + QHBoxLayout *hbox = nullptr; + + Ui_ForeignDataWrapperWidget::setupUi(this); + + func_handler_sel=nullptr; + func_validator_sel=nullptr; + + func_handler_ht = new HintTextWidget(func_handler_hint, this); + func_handler_ht->setText(trUtf8("The handler function must have the following signature: fdw_handler function_name()")); + + func_validator_ht = new HintTextWidget(func_validator_hint, this); + func_validator_ht->setText(trUtf8("The validator function must have the following signature: function_name(text[],oid). The return type of ths function is ignored.")); + + func_handler_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); + func_validator_sel=new ObjectSelectorWidget(ObjectType::Function, true, this); + + hbox = new QHBoxLayout; + hbox->setContentsMargins(0,0,0,0); + hbox->addWidget(func_handler_sel); + func_handler_wgt->setLayout(hbox); + + hbox = new QHBoxLayout; + hbox->setContentsMargins(0,0,0,0); + hbox->addWidget(func_validator_sel); + func_validator_wgt->setLayout(hbox); + + options_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons, true, this); + fdw_grid->addWidget(options_tab, 2, 0, 1, 3); + + configureFormLayout(fdw_grid, ObjectType::ForeignDataWrapper); + + configureTabOrder({ func_handler_sel, func_handler_ht, + func_validator_sel, func_validator_ht }); + + setMinimumSize(600, 400); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void ForeignDataWrapperWidget::setAttributes(DatabaseModel *model, OperationList *op_list, ForeignDataWrapper *fdw) +{ + BaseObjectWidget::setAttributes(model, op_list, fdw); + + func_handler_sel->setModel(model); + func_validator_sel->setModel(model); + + if(fdw) + { + func_handler_sel->setSelectedObject(fdw->getHandlerFunction()); + func_validator_sel->setSelectedObject(fdw->getValidatorFunction()); + } +} + +void ForeignDataWrapperWidget::applyConfiguration(void) +{ + try + { + ForeignDataWrapper *fdw=nullptr; + + startConfiguration(); + + fdw=dynamic_cast(this->object); + fdw->setHandlerFunction(dynamic_cast(func_handler_sel->getSelectedObject())); + fdw->setValidatorFunction(dynamic_cast(func_validator_sel->getSelectedObject())); + + BaseObjectWidget::applyConfiguration(); + finishConfiguration(); + } + catch(Exception &e) + { + cancelConfiguration(); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + diff --git a/libpgmodeler_ui/src/foreigndatawrapperwidget.h b/libpgmodeler_ui/src/foreigndatawrapperwidget.h new file mode 100644 index 0000000000..3d915076c9 --- /dev/null +++ b/libpgmodeler_ui/src/foreigndatawrapperwidget.h @@ -0,0 +1,48 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler_ui +\class LanguageWidget +\brief Implements the operations to create/edit languages via form. +*/ + +#ifndef LANGUAGE_WIDGET_H +#define LANGUAGE_WIDGET_H + +#include "baseobjectwidget.h" +#include "ui_languagewidget.h" + +class LanguageWidget: public BaseObjectWidget, public Ui::LanguageWidget { + private: + Q_OBJECT + + ObjectSelectorWidget *func_handler_sel, + *func_validator_sel, + *func_inline_sel; + + public: + LanguageWidget(QWidget * parent = nullptr); + + void setAttributes(DatabaseModel *model, OperationList *op_list, Language *language); + + public slots: + void applyConfiguration(void); +}; + +#endif diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 057a8ea388..8fa8255288 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -58,6 +58,7 @@ #include "policywidget.h" #include "tabledatawidget.h" #include "generalconfigwidget.h" +#include "foreigndatawrapperwidget.h" vector ModelWidget::copied_objects; vector ModelWidget::cutted_objects; @@ -81,19 +82,22 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) QAction *action=nullptr; QString str_ico; QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen"), QString("part") }; - ObjectType types[]={ ObjectType::Table, ObjectType::View, ObjectType::Textbox, ObjectType::Relationship, + /*ObjectType types[]={ ObjectType::Table, ObjectType::View, ObjectType::Textbox, ObjectType::Relationship, ObjectType::Cast, ObjectType::Conversion, ObjectType::Domain, ObjectType::Function, ObjectType::Aggregate, ObjectType::Language, ObjectType::OpClass, ObjectType::Operator, ObjectType::OpFamily, ObjectType::Role, ObjectType::Schema, ObjectType::Sequence, ObjectType::Type, ObjectType::Column, ObjectType::Constraint, ObjectType::Rule, ObjectType::Trigger, ObjectType::Index, ObjectType::Policy, ObjectType::Tablespace, ObjectType::Collation, ObjectType::Extension, ObjectType::EventTrigger, ObjectType::Tag, - ObjectType::GenericSql }; - unsigned i, obj_cnt=sizeof(types)/sizeof(ObjectType), + ObjectType::GenericSql }; */ + unsigned i, /*obj_cnt=sizeof(types)/sizeof(ObjectType),*/ rel_types_id[]={ BaseRelationship::Relationship11, BaseRelationship::Relationship1n, BaseRelationship::RelationshipNn, BaseRelationship::RelationshipDep, BaseRelationship::RelationshipGen, BaseRelationship::RelationshipPart}; + vector types_vect = BaseObject::getObjectTypes(true, { ObjectType::Database, ObjectType::Permission, + ObjectType::BaseRelationship}); + current_zoom=1; modified=panning_mode=false; new_obj_type=ObjectType::BaseObject; @@ -379,11 +383,11 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) action_break_rel_line->setMenu(&break_rel_menu); //Alocatting the object creation actions - for(i=0; i < obj_cnt; i++) + for(auto &type : types_vect) { - actions_new_objects[types[i]]=new QAction(QIcon(PgModelerUiNs::getIconPath(types[i])), BaseObject::getTypeName(types[i]), this); - actions_new_objects[types[i]]->setData(QVariant(enum_cast(types[i]))); - connect(actions_new_objects[types[i]], SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); + actions_new_objects[type]=new QAction(QIcon(PgModelerUiNs::getIconPath(type)), BaseObject::getTypeName(type), this); + actions_new_objects[type]->setData(QVariant(enum_cast(type))); + connect(actions_new_objects[type], SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); } //Creating the relationship submenu @@ -1823,6 +1827,8 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb genericsql_wgt->setAttributes(db_model, op_list, dynamic_cast(object)); res=openEditingForm(genericsql_wgt); } + else if(obj_type==ObjectType::ForeignDataWrapper) + res = openEditingForm(object); else { DatabaseWidget *database_wgt=new DatabaseWidget; @@ -3701,15 +3707,11 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Case there is no selected object or the selected object is the database model if(objects.empty() || (objects.size()==1 && objects[0]==db_model)) { - ObjectType types[]={ ObjectType::Aggregate, ObjectType::Cast, ObjectType::EventTrigger, ObjectType::Collation, ObjectType::Conversion, ObjectType::Domain, - ObjectType::Extension, ObjectType::Function, ObjectType::GenericSql, ObjectType::Language, ObjectType::OpClass, ObjectType::Operator, - ObjectType::OpFamily, ObjectType::Relationship, ObjectType::Role, ObjectType::Schema, ObjectType::Sequence, - ObjectType::Table, ObjectType::Tablespace, ObjectType::Textbox, ObjectType::Type, ObjectType::View, ObjectType::Tag }; - unsigned cnt = sizeof(types)/sizeof(ObjectType); + vector types_vect = BaseObject::getObjectTypes(false, { ObjectType::Database, ObjectType::Permission, ObjectType::BaseRelationship }); //Configures the "New object" menu with the types at database level - for(i=0; i < cnt; i++) - new_object_menu.addAction(actions_new_objects[types[i]]); + for(auto &type : types_vect) + new_object_menu.addAction(actions_new_objects[type]); action_new_object->setMenu(&new_object_menu); popup_menu.addAction(action_new_object); diff --git a/libpgmodeler_ui/ui/foreigndatawrapperwidget.ui b/libpgmodeler_ui/ui/foreigndatawrapperwidget.ui new file mode 100644 index 0000000000..84a767602c --- /dev/null +++ b/libpgmodeler_ui/ui/foreigndatawrapperwidget.ui @@ -0,0 +1,138 @@ + + + ForeignDataWrapperWidget + + + + 0 + 0 + 337 + 61 + + + + + 0 + 0 + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Handler: + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Validator: + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + From 6e786de04db7fe9a6be7336571e964414467fd2e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 4 Apr 2019 11:14:39 -0300 Subject: [PATCH 304/425] Minor adjustments on the icons of the buttons in ObjectsTableWidget --- libpgmodeler/src/baseobject.cpp | 8 ++-- libpgmodeler_ui/libpgmodeler_ui.pro | 9 ++-- libpgmodeler_ui/res/icones/delrow.png | Bin 918 -> 908 bytes libpgmodeler_ui/res/icones/delrows.png | Bin 1482 -> 1415 bytes .../res/icones/foreigndatawrapper.png | Bin 2071 -> 2359 bytes libpgmodeler_ui/res/icones/resizecols.png | Bin 895 -> 862 bytes .../src/foreigndatawrapperwidget.h | 26 +++++++----- libpgmodeler_ui/ui/objectstablewidget.ui | 39 +++++++++--------- 8 files changed, 45 insertions(+), 37 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 09434f8068..896e9a1c5f 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -940,10 +940,10 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector vet_types={ ObjectType::BaseRelationship, ObjectType::Aggregate, ObjectType::Cast, ObjectType::Collation, ObjectType::Conversion, ObjectType::Database, ObjectType::Domain, ObjectType::Extension, ObjectType::EventTrigger, - ObjectType::Tag, ObjectType::Function, ObjectType::Language, ObjectType::OpClass, ObjectType::Operator, - ObjectType::OpFamily, ObjectType::Relationship, ObjectType::Role, ObjectType::Schema, - ObjectType::Sequence, ObjectType::Table, ObjectType::Tablespace, ObjectType::Textbox, - ObjectType::Type, ObjectType::View, ObjectType::Permission, ObjectType::GenericSql, ObjectType::ForeignDataWrapper }; + ObjectType::ForeignDataWrapper, ObjectType::Function, ObjectType::GenericSql, ObjectType::Language, ObjectType::OpClass, + ObjectType::Operator, ObjectType::OpFamily, ObjectType::Permission, ObjectType::Relationship, ObjectType::Role, ObjectType::Schema, + ObjectType::Sequence, ObjectType::Table, ObjectType::Tablespace, ObjectType::Tag, ObjectType::Textbox, + ObjectType::Type, ObjectType::View }; vector::iterator itr; if(inc_table_objs) diff --git a/libpgmodeler_ui/libpgmodeler_ui.pro b/libpgmodeler_ui/libpgmodeler_ui.pro index 60f03cc545..f458c7bc89 100644 --- a/libpgmodeler_ui/libpgmodeler_ui.pro +++ b/libpgmodeler_ui/libpgmodeler_ui.pro @@ -117,7 +117,8 @@ SOURCES += src/mainwindow.cpp \ src/sqlexecutionhelper.cpp \ src/elementstablewidget.cpp \ src/elementwidget.cpp \ - src/layerswidget.cpp + src/layerswidget.cpp \ + src/foreigndatawrapperwidget.cpp HEADERS += src/mainwindow.h \ @@ -222,7 +223,8 @@ HEADERS += src/mainwindow.h \ src/sqlexecutionhelper.h \ src/elementstablewidget.h \ src/elementwidget.h \ - src/layerswidget.h + src/layerswidget.h \ + src/foreigndatawrapperwidget.h FORMS += ui/mainwindow.ui \ ui/textboxwidget.ui \ @@ -307,7 +309,8 @@ FORMS += ui/mainwindow.ui \ ui/objectstablewidget.ui \ ui/referencewidget.ui \ ui/elementwidget.ui \ - ui/layerswidget.ui + ui/layerswidget.ui \ + ui/foreigndatawrapperwidget.ui unix|windows: LIBS += -L$$OUT_PWD/../libobjrenderer/ -lobjrenderer \ -L$$OUT_PWD/../libpgconnector/ -lpgconnector \ diff --git a/libpgmodeler_ui/res/icones/delrow.png b/libpgmodeler_ui/res/icones/delrow.png index 2556e26a445ea04f31356a2c324dfb659d94d465..33ab7be33ec23766c7e1ec497fc1b53a283a44be 100644 GIT binary patch delta 885 zcmV-*1B(2X2aE@hB!3BTNLh0L01ejw01ejxLMWSf0009%NklbIvxxL*nipC83UFJfaiJeJkJ48sZ`7u08}a!tgfz_oUHjQW+no-7t9#-S+q}@ zPv_`ZUq@~R&d<*wrF1roq6l#un;ap8lcQs8LWp7j?8Vh;6`tog066E^+}t!{CnqPU z)oLd0bULWjY9_za={ydAKApWti}3jP*lc=sc7`NLOn=<#^$d$TZZ@0604SwE2tl=4 zbp%ET0p}dP@0)_9QpsU}F@}1*ZuVo0J^l*9Ff{k8T?pYY(ChUa4P-Ik`+ji%ngOi= zU4T;RFu*xSyn)98K5^6aoMMD=RBwPqAjejvI}J zqY*oPlm_&v!!UGCr{95gyFI3Qn}M_@eBXys>gipOeh0J$8jXfo!x(d7n}IBQ@Ex#E zLn(z2B9j4K@bvW5iGv_8qRj_E=?4C4Km#bufb)A`Zx144(bwHwC;pzA|CWkh4~O{y*jE4m9}W*EF3w|n z8yizaNYewh2>*pm)c|mJf~Q(m|4#xy^%W?k@HPxVDRsIakLM|z1>hBc1wzR0IF4uM z=Wgex-d&!}ZA+2_obw@oH2?zu*ERqO;01tLA;hPxt*!Tz(wRaP9tLpT@Ap3fn7OZY z4Y>ae%K#Ptyu43hsrjc^3?Kn81n?8U4*)6+z&85K01^OF7q#sV%&k&i_QssK00000 LNkvXXu0mjfTKtj| delta 876 zcmV-y1C#uW2bKqrBo78+OGiWi{{a60|De66laV18e*gz`Nliru-~|H{GAPDia2@~v z10zX9K~z}7bvQ<5;Ns!}LI`8SFbokz5!rCg4I8cN!8y+dApUT< zT!!nq1^~x#u(h>Cb7yB~s8lMXx7%%0DiyMCx7*_Z&~F!iNGIXx=_ze`etr%qCF#EJ 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 diff --git a/libpgmodeler_ui/res/icones/foreigndatawrapper.png b/libpgmodeler_ui/res/icones/foreigndatawrapper.png index 1822358c0294afb427683089b75febf45f393b3d..691461de89a6d82b2352a7931f64611e9db08c46 100644 GIT binary patch delta 2323 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 O0000n1f8NwLYEF+ zf{5r63elww9in4tK~NA8B}oU5L4QPe6#4_)6|I>Oof)Hpr77$D=%6#sj_=IQ>UQc2 zFFQQ%JMZ(^@AJ&Nv+%!5Bm+}ZQ@0C+!UrKlx2mcDc%Fynd4IUB8-2#F^TdGPp6A`0 znVI>NNi;n@{cC%BJMev9Iy}#78m{X`V`pclX*3#*Xl!h31mol5zmoa1WWe*h?n0q} zuImUPq5-6SMs|t=h7tq;0KL7vG#ZWWmH@u*N1L60+6?^q;w+Bi(AU=&tyx=J@`g4 zP4Rfv#Uirfw**C$8j87*NxWLwk`P@M*s*Nkf~HEp=lbUqodKLOG`^kewpk% zfXo5YG;thI}of!|*;IK-l1M9q8Y9hbLti29{+}uh#)M^JxD% z4?tTzAk+Q1%K$w4z8|~tu^R^S0mvL^s|4YxnA9id@BpbNp-guMEv|Nb|mJ1*Vf}=kL@pIr^b@yj_ad9yhK$_Y*2Moi& zwr%S5`k~H&Tma!?C{wvyMpf15BosoRX&SVyLVkd($57XGY}=+*t3?1Ecc4`dsH#e} zT5Wb(|x~yu!CiECV&9Jpcdz07*qoM6N<$g7_DUrT_o{ delta 851 zcmV-Z1FZbs2LA?-Ie#%pL_t(oh2@veOB7)k$3O4vxLc7~#43TdD@tmYpi^{d=`2W> zh%TWZA(-Hyb47=sAnGDXkVnBkAnH>D9Ob0(7kKuU>}5`W9Gyr=(jBYnVzl=A-6 z)YNn$(d6Xh`p(XdW7~FQlTrqnWm#U^-Q5keTCL`_&CN|`XlQ6X98V2*NGY4M*({o- zA%yT65c~A(6#ERtaU1~h`8>5+t@%Iz+qS*Mx*rFDUtXQXG)>yt+PpcdtE;rOwgND= zHntA{;QR3R$bbF=0RV1atM|{$L04B7xm=Epjt*~rE|;Udy}kaj2D6W51M8KZlp>vp z1=uT?*f06}{i#R_;*PoLNCXHw;FqRpn5KzkS>7DOFpyHF2jDsor9z>As;cz&_j`*j zEiKXA-Hi}}k;#$t0HS`8uIrel$>QRoH@>{QjBVTLI)C6ePUM2cVi8qU>Fw?H#+#a& zJO}uk5c+&Eit2jJ2iI-$9RA^9V!KtN(I9(0uJc99%=270o-jErDCy2CX)#`psFf8Jw5dx z9}+nl14!D2nxw)rAm& zdf4dO2-uwzI11n#a9#-U+p?@vEiEmHxoc!`ziit^Rn;xvBJcy)_5&!u3E-4r7_SBg z2TaEmMLBt>2nPdfSF6?Mz{$N>+YtP3m<7%QXZ9v#LgUAg1=zqA@C*0}IAH+4l#~H% dK)ONw`UCm}0uAZu - :/icones/icones/adicionar.png:/icones/icones/adicionar.png + :/icones/icones/addrow.png:/icones/icones/addrow.png @@ -100,7 +100,7 @@ - :/icones/icones/remover.png:/icones/icones/remover.png + :/icones/icones/delrow.png:/icones/icones/delrow.png @@ -114,7 +114,7 @@ - + false @@ -131,14 +131,14 @@ - Update Item + Remove All - :/icones/icones/atualizar.png:/icones/icones/atualizar.png + :/icones/icones/delrows.png:/icones/icones/delrows.png @@ -147,12 +147,12 @@ - Alt+R + Shift+Del - + false @@ -169,14 +169,14 @@ - Remove All + Duplicate item - :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png + :/icones/icones/duprow.png:/icones/icones/duprow.png @@ -185,12 +185,12 @@ - Shift+Del + Ctrl+D - + false @@ -207,14 +207,14 @@ - Duplicate item + Edit Item - :/icones/icones/duplicate.png:/icones/icones/duplicate.png + :/icones/icones/editdata.png:/icones/icones/editdata.png @@ -223,12 +223,12 @@ - Ctrl+D + Space - + false @@ -245,14 +245,14 @@ - Edit Item + Update Item - :/icones/icones/editar.png:/icones/icones/editar.png + :/icones/icones/atualizar.png:/icones/icones/atualizar.png @@ -261,7 +261,7 @@ - Space + Alt+R @@ -493,7 +493,7 @@ false - 25 + 26 true @@ -543,7 +543,6 @@ add_tb remove_tb - update_tb remove_all_tb edit_tb move_up_tb From 090ee6b897c3f5753f47000b75f4a4bca9c8bc05 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 4 Apr 2019 11:31:23 -0300 Subject: [PATCH 305/425] Added a FDW button on NewObjectOverlayWidget Added the WRAPPER key word to sql-highlight --- conf/defaults/sql-highlight.conf | 1 + conf/sql-highlight.conf | 1 + libpgmodeler/src/pgmodelerns.cpp | 4 +- .../src/newobjectoverlaywidget.cpp | 15 +- libpgmodeler_ui/ui/newobjectoverlaywidget.ui | 132 ++++++++++++------ 5 files changed, 101 insertions(+), 52 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index e582b6f051..8e82cdd53f 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -398,6 +398,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index e582b6f051..8e82cdd53f 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -398,6 +398,7 @@ + diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index dd9dd03bb9..79e08b7b33 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -150,9 +150,11 @@ namespace PgModelerNs { case ObjectType::GenericSql: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; + case ObjectType::ForeignDataWrapper: + copyObject(psrc_obj, dynamic_cast(copy_obj)); + break; default: throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); - break; } } diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index ee47561655..58d4a65202 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -56,7 +56,8 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par { rule_tb, std::make_tuple(trUtf8("V"), ObjectType::Rule) }, { trigger_tb, std::make_tuple(trUtf8("B"), ObjectType::Trigger) }, { policy_tb, std::make_tuple(trUtf8("9"), ObjectType::Policy) }, - { genericsql_tb, std::make_tuple(trUtf8("8"), ObjectType::GenericSql) } }; + { genericsql_tb, std::make_tuple(trUtf8("8"), ObjectType::GenericSql) }, + { fdw_tb, std::make_tuple(trUtf8("7"), ObjectType::ForeignDataWrapper) } }; map> rel_shortcuts={ { rel11_tb, std::make_tuple(trUtf8("1"), 0) }, { rel1n_tb, std::make_tuple(trUtf8("2"), 1) }, @@ -114,19 +115,19 @@ void NewObjectOverlayWidget::setSelectedObjects(vector &sel_objs) else if(sel_objs.empty()) obj_type=ObjectType::Database; - db_objs_grp->setVisible(obj_type==ObjectType::Database); - sch_objs_grp->setVisible(obj_type==ObjectType::Database || obj_type==ObjectType::Schema); + db_objs_grp->setVisible(obj_type==ObjectType::Database); + sch_objs_grp->setVisible(obj_type==ObjectType::Database || obj_type==ObjectType::Schema); - tab_objs_grp->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View || obj_type==ObjectType::Relationship); + tab_objs_grp->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View || obj_type==ObjectType::Relationship); column_tb->setDisabled(obj_type==ObjectType::View); constraint_tb->setDisabled(obj_type==ObjectType::View); index_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); rule_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); trigger_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); - policy_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); + policy_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); tab_perms_tb->setVisible(obj_type==ObjectType::Table || obj_type==ObjectType::View); - rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==ObjectType::Table) || - (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==ObjectType::Table && sel_objs.at(1)->getObjectType()==ObjectType::Table)); + rels_grp->setVisible((sel_objs.size()==1 && sel_objs.at(0)->getObjectType()==ObjectType::Table) || + (sel_objs.size()==2 && sel_objs.at(0)->getObjectType()==ObjectType::Table && sel_objs.at(1)->getObjectType()==ObjectType::Table)); overlay_frm->adjustSize(); this->adjustSize(); diff --git a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui index 8d7c9d5c92..55c903fb75 100644 --- a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui +++ b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui @@ -124,8 +124,8 @@ 6 - - + + 0 @@ -148,11 +148,11 @@ Qt::NoFocus - Schema + Cast - :/icones/icones/schema.png:/icones/icones/schema.png + :/icones/icones/cast.png:/icones/icones/cast.png @@ -160,6 +160,9 @@ 32 + + A + QToolButton::InstantPopup @@ -168,8 +171,8 @@ - - + + 0 @@ -192,11 +195,11 @@ Qt::NoFocus - Tablespace + Permissions - :/icones/icones/tablespace.png:/icones/icones/tablespace.png + :/icones/icones/permission.png:/icones/icones/permission.png @@ -212,8 +215,8 @@ - - + + 0 @@ -236,11 +239,11 @@ Qt::NoFocus - Role + Textbox - :/icones/icones/role.png:/icones/icones/role.png + :/icones/icones/textbox.png:/icones/icones/textbox.png @@ -256,8 +259,8 @@ - - + + 0 @@ -280,11 +283,11 @@ Qt::NoFocus - Language + Tag - :/icones/icones/language.png:/icones/icones/language.png + :/icones/icones/tag.png:/icones/icones/tag.png @@ -300,8 +303,8 @@ - - + + 0 @@ -324,11 +327,11 @@ Qt::NoFocus - Generic SQL + Tablespace - :/icones/icones/genericsql.png:/icones/icones/genericsql.png + :/icones/icones/tablespace.png:/icones/icones/tablespace.png @@ -344,8 +347,8 @@ - - + + 0 @@ -368,11 +371,11 @@ Qt::NoFocus - Tag + Schema - :/icones/icones/tag.png:/icones/icones/tag.png + :/icones/icones/schema.png:/icones/icones/schema.png @@ -388,8 +391,8 @@ - - + + 0 @@ -412,11 +415,11 @@ Qt::NoFocus - Cast + Role - :/icones/icones/cast.png:/icones/icones/cast.png + :/icones/icones/role.png:/icones/icones/role.png @@ -424,9 +427,6 @@ 32 - - A - QToolButton::InstantPopup @@ -435,8 +435,8 @@ - - + + 0 @@ -459,11 +459,11 @@ Qt::NoFocus - Extension + Generic SQL - :/icones/icones/extension.png:/icones/icones/extension.png + :/icones/icones/genericsql.png:/icones/icones/genericsql.png @@ -479,7 +479,7 @@ - + @@ -523,8 +523,8 @@ - - + + 0 @@ -547,11 +547,11 @@ Qt::NoFocus - Textbox + Extension - :/icones/icones/textbox.png:/icones/icones/textbox.png + :/icones/icones/extension.png:/icones/icones/extension.png @@ -567,8 +567,8 @@ - - + + 0 @@ -591,11 +591,55 @@ Qt::NoFocus - Permissions + Language - :/icones/icones/permission.png:/icones/icones/permission.png + :/icones/icones/language.png:/icones/icones/language.png + + + + 32 + 32 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Data Wrapper + + + + :/icones/icones/foreigndatawrapper.png:/icones/icones/foreigndatawrapper.png From 569dcf1efe04a64e7984292cba1a1d76e66512c4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 5 Apr 2019 16:53:09 -0300 Subject: [PATCH 306/425] Finished constructing the form to handle foreign data wrappers --- conf/defaults/sql-highlight.conf | 1 + conf/sql-highlight.conf | 1 + .../src/foreigndatawrapperwidget.cpp | 24 ++++++++++++++++++- .../src/foreigndatawrapperwidget.h | 1 - libpgmodeler_ui/src/objectstablewidget.cpp | 9 ++++++- libpgmodeler_ui/src/objectstablewidget.h | 10 ++++++++ schemas/xml/dtd/dbmodel.dtd | 2 ++ 7 files changed, 45 insertions(+), 3 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index 8e82cdd53f..729c7a23f9 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -286,6 +286,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index 8e82cdd53f..729c7a23f9 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -286,6 +286,7 @@ + diff --git a/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp b/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp index ebbcd7f704..217312a5c2 100644 --- a/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp +++ b/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp @@ -48,7 +48,13 @@ ForeignDataWrapperWidget::ForeignDataWrapperWidget(QWidget *parent): BaseObjectW hbox->addWidget(func_validator_sel); func_validator_wgt->setLayout(hbox); - options_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons, true, this); + options_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::EditButton | ObjectsTableWidget::UpdateButton), true, this); + options_tab->setCellsEditable(true); + options_tab->setColumnCount(2); + options_tab->setHeaderLabel(trUtf8("Option"), 0); + options_tab->setHeaderLabel(trUtf8("Value"), 1); + fdw_grid->addWidget(options_tab, 2, 0, 1, 3); configureFormLayout(fdw_grid, ObjectType::ForeignDataWrapper); @@ -75,6 +81,18 @@ void ForeignDataWrapperWidget::setAttributes(DatabaseModel *model, OperationList { func_handler_sel->setSelectedObject(fdw->getHandlerFunction()); func_validator_sel->setSelectedObject(fdw->getValidatorFunction()); + + options_tab->blockSignals(true); + + for(auto &itr : fdw->getOptions()) + { + options_tab->addRow(); + options_tab->setCellText(itr.first, options_tab->getRowCount() - 1, 0); + options_tab->setCellText(itr.second, options_tab->getRowCount() - 1, 1); + } + + options_tab->clearSelection(); + options_tab->blockSignals(false); } } @@ -90,6 +108,10 @@ void ForeignDataWrapperWidget::applyConfiguration(void) fdw->setHandlerFunction(dynamic_cast(func_handler_sel->getSelectedObject())); fdw->setValidatorFunction(dynamic_cast(func_validator_sel->getSelectedObject())); + fdw->removeOptions(); + for(unsigned row = 0; row < options_tab->getRowCount(); row++) + fdw->setOption(options_tab->getCellText(row, 0), options_tab->getCellText(row, 1)); + BaseObjectWidget::applyConfiguration(); finishConfiguration(); } diff --git a/libpgmodeler_ui/src/foreigndatawrapperwidget.h b/libpgmodeler_ui/src/foreigndatawrapperwidget.h index edf5f294f4..182de72449 100644 --- a/libpgmodeler_ui/src/foreigndatawrapperwidget.h +++ b/libpgmodeler_ui/src/foreigndatawrapperwidget.h @@ -44,7 +44,6 @@ class ForeignDataWrapperWidget: public BaseObjectWidget, public Ui::ForeignDataW public: ForeignDataWrapperWidget(QWidget * parent = nullptr); - void setAttributes(DatabaseModel *model, OperationList *op_list, ForeignDataWrapper *fdw); public slots: diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 4a54318be4..267b460575 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -48,6 +48,7 @@ ObjectsTableWidget::ObjectsTableWidget(unsigned button_conf, bool conf_exclusion }); this->conf_exclusion=conf_exclusion; + cells_editable = false; setButtonConfiguration(button_conf); setColumnCount(1); @@ -345,7 +346,7 @@ void ObjectsTableWidget::addRow(unsigned lin_idx) for(col_idx=0; col_idx < col_cont; col_idx++) { - item=new QTableWidgetItem; + item=new QTableWidgetItem; table_tbw->setItem(lin_idx,col_idx,item); } @@ -614,6 +615,12 @@ void ObjectsTableWidget::setButtonsEnabled(unsigned button_conf, bool value) resize_cols_tb->setEnabled(value && table_tbw->rowCount() > 0); } +void ObjectsTableWidget::setCellsEditable(bool value) +{ + table_tbw->setSelectionBehavior(value ? QAbstractItemView::SelectItems : QAbstractItemView::SelectRows); + table_tbw->setEditTriggers(value ? QAbstractItemView::AllEditTriggers : QAbstractItemView::NoEditTriggers); +} + void ObjectsTableWidget::setButtonsEnabled(void) { setButtonsEnabled(AllButtons, true); diff --git a/libpgmodeler_ui/src/objectstablewidget.h b/libpgmodeler_ui/src/objectstablewidget.h index 4dea990fee..8651d98bdb 100644 --- a/libpgmodeler_ui/src/objectstablewidget.h +++ b/libpgmodeler_ui/src/objectstablewidget.h @@ -40,6 +40,10 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { to remove an element from table. By default, the exclusions are made without confirmation */ bool conf_exclusion; + /*! \brief Indicates that cells' texts can be edited by the user. When changing the text of a cell + * the signal s_cellTextChanged(int,int) is emitted */ + bool cells_editable; + QTableWidgetItem *getItem(unsigned row_idx, unsigned col_idx); public: @@ -172,6 +176,8 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { //! \brief Controls the enable state of each button void setButtonsEnabled(unsigned button_conf, bool value); + void setCellsEditable(bool value); + signals: //! \brief Signal emitted when a new row is added. The new row index is send with the signal void s_rowAdded(int); @@ -203,8 +209,12 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { //! \brief Signal emitted when a column is added. The column index is sent together with the signal void s_columnAdded(int); + //! \brief Signal emitted when a specific cell is clicked. The column and rows indexes are sent together with the signal void s_cellClicked(int, int); + //! \brief Signal emitted when a specific cell has its text changed. The column and rows indexes are sent together with the signal + void s_cellTextChanged(int, int); + protected: void resizeEvent(QResizeEvent *); }; diff --git a/schemas/xml/dtd/dbmodel.dtd b/schemas/xml/dtd/dbmodel.dtd index 1b0ee4823b..2d5f067442 100644 --- a/schemas/xml/dtd/dbmodel.dtd +++ b/schemas/xml/dtd/dbmodel.dtd @@ -66,6 +66,8 @@ %genericsql; %policy; + +%foreigndatawrapper; From f80e73336fd89ce32408af1de4c39cdb829fd67f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 5 Apr 2019 17:18:19 -0300 Subject: [PATCH 307/425] Starting to add catalog query for fdw reverse engineering --- libpgconnector/src/catalog.cpp | 4 ++-- libpgmodeler/src/baseobject.cpp | 26 +++++++++++++++--------- schemas/catalog/foreigndatawrapper.sch | 28 ++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 schemas/catalog/foreigndatawrapper.sch diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 967b0366a5..750bba7ad5 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -38,7 +38,7 @@ map Catalog::oid_fields= {ObjectType::Sequence, "sq.oid"}, {ObjectType::Domain, "dm.oid"}, {ObjectType::Type, "tp.oid"}, {ObjectType::Table, "tb.oid"}, {ObjectType::Column, "cl.oid"}, {ObjectType::Constraint, "cs.oid"}, {ObjectType::Rule, "rl.oid"}, {ObjectType::Trigger, "tg.oid"}, {ObjectType::Index, "id.indexrelid"}, - {ObjectType::EventTrigger, "et.oid"}, {ObjectType::Policy, "pl.oid"} + {ObjectType::EventTrigger, "et.oid"}, {ObjectType::Policy, "pl.oid"}, {ObjectType::ForeignDataWrapper, "fw.oid"} }; map Catalog::ext_oid_fields={ @@ -58,7 +58,7 @@ map Catalog::name_fields= {ObjectType::Sequence, "relname"}, {ObjectType::Domain, "typname"}, {ObjectType::Type, "typname"}, {ObjectType::Table, "relname"}, {ObjectType::Column, "attname"}, {ObjectType::Constraint, "conname"}, {ObjectType::Rule, "rulename"}, {ObjectType::Trigger, "tgname"}, {ObjectType::Index, "relname"}, - {ObjectType::EventTrigger, "evtname"}, {ObjectType::Policy, "polname"} + {ObjectType::EventTrigger, "evtname"}, {ObjectType::Policy, "polname"}, {ObjectType::ForeignDataWrapper, "fdwname"} }; Catalog::Catalog(void) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 896e9a1c5f..37ac1a5e56 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -969,16 +969,24 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector BaseObject::getChildObjectTypes(ObjectType obj_type) { if(obj_type==ObjectType::Database) - return(vector()={ObjectType::Cast, ObjectType::Role, ObjectType::Language, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Extension, ObjectType::EventTrigger}); - else if(obj_type==ObjectType::Schema) - return(vector()={ObjectType::Aggregate, ObjectType::Conversion, ObjectType::Collation, ObjectType::Domain, ObjectType::Function, - ObjectType::OpClass, ObjectType::Operator, ObjectType::OpFamily, ObjectType::Sequence, ObjectType::Type, ObjectType::Table, ObjectType::View}); - else if(obj_type==ObjectType::Table) - return(vector()={ObjectType::Column, ObjectType::Constraint, ObjectType::Rule, ObjectType::Trigger, ObjectType::Index, ObjectType::Policy}); - else if(obj_type==ObjectType::View) + return(vector()={ ObjectType::Cast, ObjectType::Role, ObjectType::Language, + ObjectType::Tablespace, ObjectType::Schema, ObjectType::Extension, + ObjectType::EventTrigger, ObjectType::ForeignDataWrapper }); + + if(obj_type==ObjectType::Schema) + return(vector()={ ObjectType::Aggregate, ObjectType::Conversion, ObjectType::Collation, + ObjectType::Domain, ObjectType::Function, ObjectType::OpClass, + ObjectType::Operator, ObjectType::OpFamily, ObjectType::Sequence, + ObjectType::Type, ObjectType::Table, ObjectType::View }); + + if(obj_type==ObjectType::Table) + return(vector()={ ObjectType::Column, ObjectType::Constraint, ObjectType::Rule, + ObjectType::Trigger, ObjectType::Index, ObjectType::Policy }); + + if(obj_type==ObjectType::View) return(vector()={ObjectType::Rule, ObjectType::Trigger, ObjectType::Index}); - else - return(vector()={}); + + return(vector()={}); } void BaseObject::setPgSQLVersion(const QString &ver) diff --git a/schemas/catalog/foreigndatawrapper.sch b/schemas/catalog/foreigndatawrapper.sch new file mode 100644 index 0000000000..df3f0f4b9c --- /dev/null +++ b/schemas/catalog/foreigndatawrapper.sch @@ -0,0 +1,28 @@ +# Catalog queries for foreign data wrappers +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {list} %then + [ SELECT fw.oid, fdwname AS name FROM pg_foreign_data_wrapper AS fw ] + + %if {last-sys-oid} %or {not-ext-object} %then + [ WHERE ] + + %if {last-sys-oid} %then + [ fw.oid ] {oid-filter-op} $sp {last-sys-oid} + %end + + %if {not-ext-object} %then + + %if {last-sys-oid} %then + [ AND ] + %end + + ( {not-ext-object} ) + %end + %end +%else + + + +%end From 335f74bcebeea9755891d8ed0e402dde0873c4c6 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 8 Apr 2019 17:42:00 -0300 Subject: [PATCH 308/425] Added support to set permissions to FDWs --- libpgmodeler/src/permission.cpp | 21 ++++++++++++--------- libpgmodeler/src/permission.h | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index a60b4b4023..df65791a30 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -59,7 +59,8 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) result=(obj_type==ObjectType::Table || obj_type==ObjectType::Column || obj_type==ObjectType::View || obj_type==ObjectType::Sequence || obj_type==ObjectType::Database || obj_type==ObjectType::Function || obj_type==ObjectType::Aggregate || obj_type==ObjectType::Language || obj_type==ObjectType::Schema || - obj_type==ObjectType::Tablespace || obj_type==ObjectType::Domain || obj_type==ObjectType::Type); + obj_type==ObjectType::Tablespace || obj_type==ObjectType::Domain || obj_type==ObjectType::Type || + obj_type==ObjectType::ForeignDataWrapper); //Validating privilege @@ -81,19 +82,19 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) Linguage: USAGE Schema: CREATE | USAGE Tablespace: CREATE - View: SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER */ + View: SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER + Foreign Data Wrapper: USAGE */ result=result && - - (((obj_type==ObjectType::Table || obj_type==ObjectType::View) && - (priv_id==PrivSelect || priv_id==PrivInsert || - priv_id==PrivUpdate || priv_id==PrivDelete || - priv_id==PrivReferences || priv_id==PrivTrigger)) || + (((obj_type==ObjectType::Table || obj_type==ObjectType::View) && + (priv_id==PrivSelect || priv_id==PrivInsert || + priv_id==PrivUpdate || priv_id==PrivDelete || + priv_id==PrivReferences || priv_id==PrivTrigger)) || ((obj_type==ObjectType::Table || obj_type==ObjectType::View) && priv_id==PrivTruncate) || (obj_type==ObjectType::Column && (priv_id==PrivSelect ||priv_id==PrivInsert || - priv_id==PrivUpdate || priv_id==PrivReferences)) || + priv_id==PrivUpdate || priv_id==PrivReferences)) || (obj_type==ObjectType::Sequence && (priv_id==PrivUsage || priv_id==PrivSelect || priv_id==PrivUpdate)) || @@ -107,7 +108,9 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) (obj_type==ObjectType::Schema && (priv_id==PrivUsage || priv_id==PrivCreate)) || - (obj_type==ObjectType::Tablespace && priv_id==PrivCreate)); + (obj_type==ObjectType::Tablespace && priv_id==PrivCreate) || + + (obj_type==ObjectType::ForeignDataWrapper && priv_id==PrivUsage)); } return(result); diff --git a/libpgmodeler/src/permission.h b/libpgmodeler/src/permission.h index f1f148fb2f..bb2ade32f5 100644 --- a/libpgmodeler/src/permission.h +++ b/libpgmodeler/src/permission.h @@ -43,7 +43,7 @@ class Permission: public BaseObject { * view * sequence * database - * foreign-data wrapper (not implemented) + * foreign-data wrapper * foreign server (not implemented) * large objects (not implemented) * function From 9b9131be759125f8ff443bff1139c195cabf8b1a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 9 Apr 2019 09:21:10 -0300 Subject: [PATCH 309/425] Foreign data wrappers are now fully imported using reverse engineering --- libpgmodeler/src/databasemodel.cpp | 5 ++-- libpgmodeler/src/foreigndatawrapper.cpp | 6 ++-- libpgmodeler_ui/src/databaseimporthelper.cpp | 27 ++++++++++++++++++ libpgmodeler_ui/src/databaseimporthelper.h | 1 + libpgmodeler_ui/src/modelexporthelper.cpp | 17 ++++++----- schemas/catalog/foreigndatawrapper.sch | 30 ++++++++++++++++++++ 6 files changed, 71 insertions(+), 15 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index e9357e0f37..e5b48565b8 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -754,9 +754,8 @@ void DatabaseModel::destroyObjects(void) /* DEBUG: An exception at this point shouldn't never occur but if * it is raised, we spit out the error to the stdout in order to try to * find out the problem! */ - QTextStream out(stdout); - out << trUtf8("** FAIL TO DESTROY ALL OBJECTS **") << endl; - out << e.getExceptionsText() << endl; + qDebug("** FAIL TO DESTROY ALL OBJECTS **"); + qDebug(e.getExceptionsText().toStdString().c_str()); } objects = getCreationOrder(SchemaParser::XmlDefinition, true); diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 5d0c8e3dbc..1250852075 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -19,7 +19,7 @@ #include "foreigndatawrapper.h" const QString ForeignDataWrapper::OptionsSeparator = QString(","); -const QString ForeignDataWrapper::OptionValueSeparator = QString("•"); +const QString ForeignDataWrapper::OptionValueSeparator = QString("="); ForeignDataWrapper::ForeignDataWrapper(void) { @@ -127,13 +127,13 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) if(handler_func) { handler_func->setAttribute(Attributes::RefType, Attributes::HandlerFunc); - attributes[Attributes::HandlerFunc] = is_sql_def ? handler_func->getSignature() : handler_func->getCodeDefinition(def_type, true); + attributes[Attributes::HandlerFunc] = is_sql_def ? handler_func->getName(true) : handler_func->getCodeDefinition(def_type, true); } if(validator_func) { validator_func->setAttribute(Attributes::RefType, Attributes::ValidatorFunc); - attributes[Attributes::ValidatorFunc] = is_sql_def ? validator_func->getSignature() : validator_func->getCodeDefinition(def_type, true); + attributes[Attributes::ValidatorFunc] = is_sql_def ? validator_func->getName(true) : validator_func->getCodeDefinition(def_type, true); } for(auto &itr : options) diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index ac09e91039..87ce3ccf60 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -734,6 +734,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) case ObjectType::Constraint: createConstraint(attribs); break; case ObjectType::Policy: createPolicy(attribs); break; case ObjectType::EventTrigger: createEventTrigger(attribs); break; + case ObjectType::ForeignDataWrapper: createForeignDataWrapper(attribs); break; default: if(debug_mode) @@ -2300,6 +2301,32 @@ void DatabaseImportHelper::createEventTrigger(attribs_map &attribs) } } +void DatabaseImportHelper::createForeignDataWrapper(attribs_map &attribs) +{ + ForeignDataWrapper *fdw=nullptr; + + try + { + QStringList func_types={ Attributes::ValidatorFunc, Attributes::HandlerFunc }; + + for(auto &func_tp : func_types) + attribs[func_tp] = getDependencyObject(attribs[func_tp], ObjectType::Function, true , true, true, {{Attributes::RefType, func_tp}}); + + attribs[Attributes::Options] = Catalog::parseArrayValues(attribs[Attributes::Options]).join(ForeignDataWrapper::OptionsSeparator); + + loadObjectXML(ObjectType::ForeignDataWrapper, attribs); + fdw = dbmodel->createForeignDataWrapper(); + dbmodel->addForeignDataWrapper(fdw); + } + catch(Exception &e) + { + if(fdw) delete(fdw); + throw Exception(e.getErrorMessage(), e.getErrorCode(), + __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); + } + +} + void DatabaseImportHelper::createPermission(attribs_map &attribs) { ObjectType obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 36738fddd3..9dcd29411a 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -160,6 +160,7 @@ class DatabaseImportHelper: public QObject { void createPolicy(attribs_map &attribs); void createPermission(attribs_map &attribs); void createEventTrigger(attribs_map &attribs); + void createForeignDataWrapper(attribs_map &attribs); void __createTableInheritances(void); void createTableInheritances(void); void createTablePartitionings(void); diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 984bd252a4..93c1281adc 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -198,7 +198,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename painter.setRenderHint(QPainter::SmoothPixmapTransform, true); emit s_progressUpdated((page_idx/static_cast(pages.size())) * 90, - trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), ObjectType::BaseObject); + trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), ObjectType::BaseObject); //Render the entire viewport onto the pixmap view->render(&painter, QRectF(QPointF(0,0), pix.size()), retv); @@ -776,14 +776,13 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co drop_tab_obj_reg(QString("^((\\-\\-)+( )*)+(%1)(.)+(DROP)(.)+").arg(alter_tab)), reg_aux; - vector obj_types={ ObjectType::Role, ObjectType::Function, ObjectType::Trigger, ObjectType::Index, ObjectType::Policy, - ObjectType::Rule, ObjectType::Table, ObjectType::View, ObjectType::Domain, - ObjectType::Schema, ObjectType::Aggregate, ObjectType::OpFamily, - ObjectType::OpClass, ObjectType::Operator, ObjectType::Sequence, - ObjectType::Conversion, ObjectType::Cast, ObjectType::Language, - ObjectType::Collation, ObjectType::Extension, ObjectType::Type, - ObjectType::EventTrigger, ObjectType::Database }; - + vector obj_types={ ObjectType::Role, ObjectType::Function, ObjectType::Trigger, ObjectType::Index, + ObjectType::Policy, ObjectType::Rule, ObjectType::Table, ObjectType::View, ObjectType::Domain, + ObjectType::Schema, ObjectType::Aggregate, ObjectType::OpFamily, + ObjectType::OpClass, ObjectType::Operator, ObjectType::Sequence, + ObjectType::Conversion, ObjectType::Cast, ObjectType::Language, + ObjectType::Collation, ObjectType::Extension, ObjectType::Type, + ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::Database }; /* Extract each SQL command from the buffer and execute them separately. This is done to permit the user, in case of error, identify what object is wrongly configured. */ diff --git a/schemas/catalog/foreigndatawrapper.sch b/schemas/catalog/foreigndatawrapper.sch index df3f0f4b9c..10a8c41b78 100644 --- a/schemas/catalog/foreigndatawrapper.sch +++ b/schemas/catalog/foreigndatawrapper.sch @@ -22,7 +22,37 @@ %end %end %else + %if {attribs} %then + [SELECT oid, fdwname AS name, + fdwhandler AS handler, fdwvalidator AS validator, + fdwacl AS permission, fdwowner AS owner, fdwoptions AS options, ] + ({comment}) [ AS comment ] + [ FROM pg_foreign_data_wrapper AS fw ] + + %if {last-sys-oid} %then + [ WHERE oid ] {oid-filter-op} $sp {last-sys-oid} + %end + + %if {not-ext-object} %then + %if {last-sys-oid} %then + [ AND ] + %else + [ WHERE ] + %end + + ( {not-ext-object} ) + %end + %if {filter-oids} %then + %if {last-sys-oid} %or {not-ext-object} %then + [ AND ] + %else + [ WHERE ] + %end + + [ oid IN (] {filter-oids} ) + %end + %end %end From 2ffacaa864ae47e57459ebbedff66ddcb7e44435 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 9 Apr 2019 16:55:49 -0300 Subject: [PATCH 310/425] Added support to diff foreign data wrappers (pending fdw options diff detection) --- libpgmodeler/src/baseobject.cpp | 13 +++--- libpgmodeler/src/foreigndatawrapper.cpp | 41 +++++++++++++++++++ libpgmodeler/src/foreigndatawrapper.h | 1 + .../src/databaseexplorerwidget.cpp | 14 +++++-- libpgmodeler_ui/src/databaseexplorerwidget.h | 1 + libpgmodeler_ui/src/databaseimporthelper.cpp | 1 - libpgmodeler_ui/src/modelsdiffhelper.cpp | 19 ++++----- schemas/catalog/foreigndatawrapper.sch | 13 ++++-- schemas/sql/foreigndatawrapper.sch | 14 ++++--- 9 files changed, 87 insertions(+), 30 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 37ac1a5e56..b23a41c026 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -450,12 +450,13 @@ bool BaseObject::acceptsCustomSQL(ObjectType obj_type) bool BaseObject::acceptsAlterCommand(ObjectType obj_type) { return(obj_type==ObjectType::Collation || obj_type==ObjectType::Column || - obj_type==ObjectType::Domain || obj_type==ObjectType::EventTrigger || - obj_type==ObjectType::Extension || obj_type==ObjectType::Function || - obj_type==ObjectType::Index || obj_type==ObjectType::Role || - obj_type==ObjectType::Schema || obj_type==ObjectType::Sequence || - obj_type==ObjectType::Table || obj_type==ObjectType::Tablespace || - obj_type==ObjectType::Type || obj_type==ObjectType::Policy); + obj_type==ObjectType::Domain || obj_type==ObjectType::EventTrigger || + obj_type==ObjectType::Extension || obj_type==ObjectType::Function || + obj_type==ObjectType::Index || obj_type==ObjectType::Role || + obj_type==ObjectType::Schema || obj_type==ObjectType::Sequence || + obj_type==ObjectType::Table || obj_type==ObjectType::Tablespace || + obj_type==ObjectType::Type || obj_type==ObjectType::Policy || + obj_type==ObjectType::ForeignDataWrapper); } bool BaseObject::acceptsDropCommand(ObjectType obj_type) diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 1250852075..392da4703f 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -144,3 +144,44 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) return(this->BaseObject::__getCodeDefinition(def_type)); } + +QString ForeignDataWrapper::getAlterDefinition(BaseObject *object) +{ + ForeignDataWrapper *fdw=dynamic_cast(object); + + if(!fdw) + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + try + { + attribs_map attribs; + QStringList func_attribs = { Attributes::ValidatorFunc, Attributes::HandlerFunc }; + Function *this_funcs[2] = { this->getValidatorFunction(), this->getHandlerFunction() }, + *fdw_funcs[2] = { fdw->getValidatorFunction(), fdw->getHandlerFunction() }, + *this_func = nullptr, *fdw_func = nullptr; + + attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); + + for(int i = 0; i < 2; i++) + { + this_func = this_funcs[i]; + fdw_func = fdw_funcs[i]; + + if(!fdw_func) + attribs[func_attribs[i]] = Attributes::Unset; + else if(fdw_func && + (!this_func || + (this_func && this_func->getSignature() != fdw_func->getSignature()))) + attribs[func_attribs[i]] = fdw_func->getName(true); + } + + // Comparing the options + + copyAttributes(attribs); + return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } +} diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h index 9d536247e9..b5bc087baf 100644 --- a/libpgmodeler/src/foreigndatawrapper.h +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -58,6 +58,7 @@ class ForeignDataWrapper: public BaseObject{ attribs_map getOptions(void); virtual QString getCodeDefinition(unsigned def_type); + virtual QString getAlterDefinition(BaseObject *object); }; #endif diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 31688f41d9..780bd2c407 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -130,7 +130,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::TuplesIns, QT_TR_NOOP("Tuples inserted")}, {Attributes::IsPartitioned, QT_TR_NOOP("Partitioned")}, {Attributes::PartitionedTable, QT_TR_NOOP("Partition of")}, {Attributes::PartitionBoundExpr, QT_TR_NOOP("Partition bound expr.")}, {Attributes::DeadRowsAmount, QT_TR_NOOP("Dead rows amount")}, {Attributes::PartitionKey, QT_TR_NOOP("Partition keys")}, - {Attributes::Partitioning, QT_TR_NOOP("Partitioning")} + {Attributes::Partitioning, QT_TR_NOOP("Partitioning")}, {Attributes::Options, QT_TR_NOOP("Options")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) @@ -343,6 +343,7 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) case ObjectType::Constraint: formatConstraintAttribs(attribs); break; case ObjectType::Index: formatIndexAttribs(attribs); break; case ObjectType::Policy: formatPolicyAttribs(attribs); break; + case ObjectType::ForeignDataWrapper: formatForeignDataWrapperAttribs(attribs); break; default: break; } } @@ -468,10 +469,9 @@ void DatabaseExplorerWidget::formatAggregateAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatLanguageAttribs(attribs_map &attribs) { formatBooleanAttribs(attribs, { Attributes::Trusted }); - formatOidAttribs(attribs, { Attributes::ValidatorFunc, - Attributes::HandlerFunc, - Attributes::InlineFunc }, ObjectType::Function, false); + Attributes::HandlerFunc, + Attributes::InlineFunc }, ObjectType::Function, false); } void DatabaseExplorerWidget::formatRoleAttribs(attribs_map &attribs) @@ -823,6 +823,12 @@ void DatabaseExplorerWidget::formatPolicyAttribs(attribs_map &attribs) attribs[Attributes::Roles] = getObjectsNames(ObjectType::Role, Catalog::parseArrayValues(attribs[Attributes::Roles])).join(ElemSeparator); } +void DatabaseExplorerWidget::formatForeignDataWrapperAttribs(attribs_map &attribs) +{ + attribs[Attributes::Options]=Catalog::parseArrayValues(attribs[Attributes::Options]).join(ElemSeparator); + formatOidAttribs(attribs, { Attributes::ValidatorFunc, Attributes::HandlerFunc }, ObjectType::Function, false); +} + QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) { try diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.h b/libpgmodeler_ui/src/databaseexplorerwidget.h index d0bbb3e880..c236d74a16 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.h +++ b/libpgmodeler_ui/src/databaseexplorerwidget.h @@ -132,6 +132,7 @@ class DatabaseExplorerWidget: public QWidget, public Ui::DatabaseExplorerWidget void formatConstraintAttribs(attribs_map &attribs); void formatIndexAttribs(attribs_map &attribs); void formatPolicyAttribs(attribs_map &attribs); + void formatForeignDataWrapperAttribs(attribs_map &attribs); void handleSelectedSnippet(const QString &snip_id); //! \brief Extract an attribute map containing the basic attributes for drop/rename commands diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 87ce3ccf60..d0d36ef074 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -2324,7 +2324,6 @@ void DatabaseImportHelper::createForeignDataWrapper(attribs_map &attribs) throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); } - } void DatabaseImportHelper::createPermission(attribs_map &attribs) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index ee8d416fd1..ca8072b7fe 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -219,8 +219,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) aux_model=source_model; factor=25; } - else if(diff_type==ObjectsDiffInfo::CreateObject || - diff_type==ObjectsDiffInfo::AlterObject) + else if(diff_type==ObjectsDiffInfo::CreateObject || diff_type==ObjectsDiffInfo::AlterObject) { /* For creation or modification of objects the order followed is the same as the creation order on the source model */ @@ -246,22 +245,22 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) (diff_type!=ObjectsDiffInfo::DropObject))) { emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), - trUtf8("Processing object `%1' (%2)...").arg(object->getSignature()).arg(object->getTypeName()), - object->getObjectType()); + trUtf8("Processing object `%1' (%2)...").arg(object->getSignature()).arg(object->getTypeName()), + object->getObjectType()); //Processing objects that are not database, table child object (they are processed further) if(obj_type!=ObjectType::Database && !TableObject::isTableObject(obj_type)) { /* Processing permissions. If the operation is DROP and keep_obj_perms is true the - the permission is ignored */ + * the permission is ignored */ if(obj_type==ObjectType::Permission && ((diff_type==ObjectsDiffInfo::DropObject && - !diff_opts[OptKeepObjectPerms]) || + !diff_opts[OptKeepObjectPerms]) || (diff_type==ObjectsDiffInfo::CreateObject && - (aux_model->getPermissionIndex(dynamic_cast(object), true) < 0 || - !diff_opts[OptKeepObjectPerms])))) + (aux_model->getPermissionIndex(dynamic_cast(object), true) < 0 || + !diff_opts[OptKeepObjectPerms])))) generateDiffInfo(diff_type, object); //Processing relationship (in this case only generalization and patitioning ones are considered) @@ -312,8 +311,8 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) if(diff_type != ObjectsDiffInfo::DropObject && aux_object) { /* Try to get a diff from the retrieve object and the current object, - comparing only basic attributes like schema, tablespace and owner - this is why the BaseObject::getAlterDefinition is called */ + * comparing only basic attributes like schema, tablespace and owner + * this is why the BaseObject::getAlterDefinition is called */ objs_differs=!aux_object->BaseObject::getAlterDefinition(object).isEmpty(); //If the objects does not differ, try to compare their XML definition diff --git a/schemas/catalog/foreigndatawrapper.sch b/schemas/catalog/foreigndatawrapper.sch index 10a8c41b78..f290036f2b 100644 --- a/schemas/catalog/foreigndatawrapper.sch +++ b/schemas/catalog/foreigndatawrapper.sch @@ -23,9 +23,16 @@ %end %else %if {attribs} %then - [SELECT oid, fdwname AS name, - fdwhandler AS handler, fdwvalidator AS validator, - fdwacl AS permission, fdwowner AS owner, fdwoptions AS options, ] + [SELECT oid, fdwname AS name, ] + + %if ({pgsql-ver} >=f "9.1") %then + [ fdwhandler AS handler, ] + %else + [ NULL AS handler, ] + %end + + [ fdwvalidator AS validator, + fdwacl AS permission, fdwowner AS owner, fdwoptions AS options, ] ({comment}) [ AS comment ] diff --git a/schemas/sql/foreigndatawrapper.sch b/schemas/sql/foreigndatawrapper.sch index da1c818a60..55be60d4ae 100644 --- a/schemas/sql/foreigndatawrapper.sch +++ b/schemas/sql/foreigndatawrapper.sch @@ -12,12 +12,14 @@ [CREATE ] {sql-object} $sp {name} -$br $tb - -%if %not {handler} %then - [NO HANDLER] -%else - [HANDLER ] {handler} +%if ({pgsql-ver} >=f "9.1") %then + $br $tb + + %if %not {handler} %then + [NO HANDLER] + %else + [HANDLER ] {handler} + %end %end $br $tb From 3bd9b9f6479ed3bbe35de5764e4867d609d31c03 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 10 Apr 2019 11:00:19 -0300 Subject: [PATCH 311/425] Fixed a crash related to destruction of special objects on DatabaseModel::destroyObjects --- libpgmodeler/src/databasemodel.cpp | 4 ++-- schemas/alter/foreigndatawrapper.sch | 35 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 schemas/alter/foreigndatawrapper.sch diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index e5b48565b8..5168b50e08 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1948,8 +1948,8 @@ void DatabaseModel::storeSpecialObjectsXML(void) //Making a copy of the permissions list to avoid iterator invalidation when removing an object rem_objects.assign(permissions.begin(), permissions.end()); - itr=permissions.begin(); - itr_end=permissions.end(); + itr=rem_objects.begin(); + itr_end=rem_objects.end(); while(itr!=itr_end) { diff --git a/schemas/alter/foreigndatawrapper.sch b/schemas/alter/foreigndatawrapper.sch new file mode 100644 index 0000000000..fbb1108dcf --- /dev/null +++ b/schemas/alter/foreigndatawrapper.sch @@ -0,0 +1,35 @@ +# SQL definition for function's attributes change +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +{alter-cmds} + +%if {has-changes} %then + [ALTER ] {sql-object} $sp {signature} + + %if ({pgsql-ver} >=f "9.1") %and {handler} %then + $br $tb + + %if ({handler} == "unset") %then + [ NO HANDLER] + %else + [ HANDLER ] {handler} + %end + %end + + %if {validator} %then + $br $tb + + %if ({validator} == "unset") %then + [ NO VALIDATOR] + %else + [ VALIDATOR ] {validator} + %end + %end + +; $br + +[-- ddl-end --] $br + +%end + From 36218e0134e8bf5cfe7f61314673ae4fc44f94fd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 11 Apr 2019 15:23:51 -0300 Subject: [PATCH 312/425] Finished the diff process for ForeignDataWrapper --- libparsers/src/attributes.cpp | 2 +- libpgmodeler/src/foreigndatawrapper.cpp | 21 +++++++++++++++++++-- schemas/alter/foreigndatawrapper.sch | 5 +++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index d3242811f7..1b5a9a71e2 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -601,6 +601,6 @@ namespace Attributes { WordSeparators=QString("word-separators"), WorkingDir=QString("working-dir"), XPos=QString("x"), - YPos=QString("y"); + YPos=QString("y"); } diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 392da4703f..278b51133e 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -155,13 +155,14 @@ QString ForeignDataWrapper::getAlterDefinition(BaseObject *object) try { attribs_map attribs; - QStringList func_attribs = { Attributes::ValidatorFunc, Attributes::HandlerFunc }; + QStringList opts, func_attribs = { Attributes::ValidatorFunc, Attributes::HandlerFunc }; Function *this_funcs[2] = { this->getValidatorFunction(), this->getHandlerFunction() }, *fdw_funcs[2] = { fdw->getValidatorFunction(), fdw->getHandlerFunction() }, *this_func = nullptr, *fdw_func = nullptr; attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); + // Comparing FDW functions for(int i = 0; i < 2; i++) { this_func = this_funcs[i]; @@ -175,9 +176,25 @@ QString ForeignDataWrapper::getAlterDefinition(BaseObject *object) attribs[func_attribs[i]] = fdw_func->getName(true); } - // Comparing the options + // Comparing FDW options (to be modified or added) + for(auto &opt : fdw->options) + { + if(this->options.count(opt.first) == 0) + opts.push_back(QString("ADD %1 '%2'").arg(opt.first).arg(opt.second)); + else if(this->options[opt.first] != opt.second) + opts.push_back(QString("SET %1 '%3'").arg(opt.first).arg(opt.second)); + } + + // Comparing FDW options (to be removed) + for(auto &opt : this->options) + { + if(fdw->options.count(opt.first) == 0) + opts.push_back(QString("DROP %1").arg(opt.first)); + } + attribs[Attributes::Options] = opts.join(OptionsSeparator); copyAttributes(attribs); + return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); } catch(Exception &e) diff --git a/schemas/alter/foreigndatawrapper.sch b/schemas/alter/foreigndatawrapper.sch index fbb1108dcf..7c836ff53e 100644 --- a/schemas/alter/foreigndatawrapper.sch +++ b/schemas/alter/foreigndatawrapper.sch @@ -26,6 +26,11 @@ [ VALIDATOR ] {validator} %end %end + + %if {options} %then + $br $tb + [ OPTIONS (] {options} [)] + %end ; $br From baf31ac92fbcf83e557a615279e894747020e4a4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 11 Apr 2019 16:43:40 -0300 Subject: [PATCH 313/425] Added code snippets for FDW --- conf/defaults/snippets.conf | 358 +++++++++++++++++++----------------- conf/snippets.conf | 12 ++ 2 files changed, 197 insertions(+), 173 deletions(-) diff --git a/conf/defaults/snippets.conf b/conf/defaults/snippets.conf index b53b039f9b..a35325c533 100644 --- a/conf/defaults/snippets.conf +++ b/conf/defaults/snippets.conf @@ -1,7 +1,7 @@ @@ -13,13 +13,13 @@ $ob [ , INITCOND = ] {initial-cond} $sp $cb $br $ob [ , SORTOP = ] {sort-op} $sp $cb $br ) $br]]> - + - + - + - + @@ -47,7 +47,7 @@ $ob [ LC_CTYPE = ] {lc-ctype} $sp $cb $br $ob [ TABLESPACE = ] {tablespace} $sp $cb $br $ob [ CONNECTION LIMIT = ] {connlimit} $sp $cb $br]]> - + @@ -59,7 +59,7 @@ $ob [ DEFAULT ] {default-value} $cb $br $ob [ CONSTRAINT ] {constraint} $cb $br $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - + @@ -67,7 +67,7 @@ $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - + @@ -84,7 +84,7 @@ $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - + @@ -92,23 +92,23 @@ $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - + - + - + - - - + + + - + + + + + + + + $br $br [-- Function returns a single result or results of the same type ] $br -RETURNS $ob [ SET OF ] $cb $sp {return-type} $br +RETURNS $ob [ SET OF ] $cb $sp {return-type} $br [-- Function returns a table ] $br [RETURNS TABLE (] {col-name} $sp {col-type} $ob [, ...] $cb ) $br $br [-- Definition for C based function ] $br -[AS ] '{library}' [, ] '{definition}' $br +[AS ] '{library}' [, ] '{definition}' $br [-- Definition for SQL or PL/PGSQL based function ] $br [AS $$] $br @@ -149,7 +161,7 @@ $ob [ NOT ] $cb LEAKPROOF $br [ROWS ] {row-amount} $br [LANGUAGE ] {language} $br]]> - + - - + + @@ -209,8 +221,8 @@ $ob [ IMMUTABLE | STABLE | VOLATILE ] $cb $br]]> - - + + @@ -222,7 +234,7 @@ $ob [ EXTERNAL ] $cb [ SECURITY ] $ob [ INVOKER | DEFINER ] $cb $br]]> - + - - + + - + - + - - + + - - + + - - + + - + - + - - + + - + - + %if ({superuser}=="false") %then {no-mod} %end SUPERUSER $br %if ({createdb}=="false") %then {no-mod} %end CREATEDB $br -%if ({createrole}=="false") %then {no-mod} %end CREATEROLE $br +%if ({createrole}=="false") %then {no-mod} %end CREATEROLE $br %if ({inherit}=="false") %then {no-mod} %end INHERIT $br %if ({login}=="false") %then {no-mod} %end LOGIN $br %if ({replication}=="false") %then {no-mod} %end REPLICATION $br @@ -366,19 +378,19 @@ $br]]> $ob [ ENCRYPTED | UNENCRYPTED ] $cb [ PASSWORD ] '{new-password}' $br [VALID UNTIL ] '{validity}' $br]]> - + - - + + @@ -392,8 +404,8 @@ $ob [ START ] {start} $sp $cb $br $ob [ CACHE ] {cache} $sp $cb $br $ob $sp $ob [ NO ] $cb [ CYCLE ] $sp $cb $br $ob [ OWNED BY ] $ob $sp {owner-col} [ | NONE ] $cb $sp $cb $br]]> - - + + %if ({cycle}=="false") %then [NO ] %end CYCLE $br [OWNED BY ] %if {owner-col} %then {owner-col} %else [ NONE] %end $br]]> - - + + [OWNED BY ] %if {owner-col} %then {owner-col} %else [ NONE] %end $br]]> - + - - - - + + - - + + - - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + [)] $br $ob [ TABLESPACE ] {tablespace} $sp $cb $br]]> - + - + - + - - + + @@ -647,21 +659,21 @@ $ob [ TABLESPACE ] {tablespace} $sp $cb $br]]> - + - - + + - - + + - + - + %end $br]]> - - + + - - - + + + [ TO ] $oc new-name $cc $br %end]]> - + - + @@ -749,126 +761,126 @@ $ob [ WHERE (] {predicate} ) $cb $br]]> - + - - + + + + + + + + + Date: Fri, 12 Apr 2019 11:23:57 -0300 Subject: [PATCH 314/425] Start adding foreign server support --- conf/dtd/snippets.dtd | 2 +- libpgmodeler/libpgmodeler.pro | 8 +++- libpgmodeler/src/baseobject.cpp | 10 ++-- libpgmodeler/src/baseobject.h | 7 +-- libpgmodeler/src/databasemodel.cpp | 3 +- libpgmodeler/src/databasemodel.h | 53 ++++++++++----------- libpgmodeler/src/foreigndatawrapper.cpp | 40 +--------------- libpgmodeler/src/foreigndatawrapper.h | 16 +------ libpgmodeler/src/foreignobject.cpp | 61 +++++++++++++++++++++++++ libpgmodeler/src/foreignobject.h | 51 +++++++++++++++++++++ libpgmodeler/src/server.cpp | 33 +++++++++++++ libpgmodeler/src/server.h | 39 ++++++++++++++++ 12 files changed, 232 insertions(+), 91 deletions(-) create mode 100644 libpgmodeler/src/foreignobject.cpp create mode 100644 libpgmodeler/src/foreignobject.h create mode 100644 libpgmodeler/src/server.cpp create mode 100644 libpgmodeler/src/server.h diff --git a/conf/dtd/snippets.dtd b/conf/dtd/snippets.dtd index 56ec1c01a9..f14f10df54 100644 --- a/conf/dtd/snippets.dtd +++ b/conf/dtd/snippets.dtd @@ -13,5 +13,5 @@ + extension|eventtrigger|general|policy|foreigndatawrapper|server) "general"> diff --git a/libpgmodeler/libpgmodeler.pro b/libpgmodeler/libpgmodeler.pro index 245d688c08..61ac42c8ed 100644 --- a/libpgmodeler/libpgmodeler.pro +++ b/libpgmodeler/libpgmodeler.pro @@ -62,7 +62,9 @@ HEADERS += src/textbox.h \ src/genericsql.h \ src/policy.h \ src/partitionkey.h \ - src/foreigndatawrapper.h + src/foreigndatawrapper.h \ + src/server.h \ + src/foreignobject.h SOURCES += src/textbox.cpp \ src/domain.cpp \ @@ -113,7 +115,9 @@ SOURCES += src/textbox.cpp \ src/genericsql.cpp \ src/policy.cpp \ src/partitionkey.cpp \ - src/foreigndatawrapper.cpp + src/foreigndatawrapper.cpp \ + src/server.cpp \ + src/foreignobject.cpp unix|windows: LIBS += -L$$OUT_PWD/../libparsers/ -lparsers \ -L$$OUT_PWD/../libutils/ -lutils diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index b23a41c026..30e363ebdc 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -33,7 +33,7 @@ const QString BaseObject::objs_schemas[BaseObject::ObjectTypeCount]={ "language", "usertype", "tablespace", "opfamily", "opclass", "database","collation", "extension", "eventtrigger", "policy", "foreigndatawrapper", - "relationship", "textbox", "permission", "parameter", + "server", "relationship", "textbox", "permission", "parameter", "typeattribute", "tag", "genericsql", "relationship" }; @@ -47,7 +47,7 @@ const QString BaseObject::obj_type_names[BaseObject::ObjectTypeCount]={ QT_TR_NOOP("Operator Family"), QT_TR_NOOP("Operator Class"), QT_TR_NOOP("Database"), QT_TR_NOOP("Collation"), QT_TR_NOOP("Extension"), QT_TR_NOOP("Event Trigger"), QT_TR_NOOP("Policy"), QT_TR_NOOP("Foreign Data Wrapper"), - QT_TR_NOOP("Relationship"), QT_TR_NOOP("Textbox"), QT_TR_NOOP("Permission"), + QT_TR_NOOP("Server"), QT_TR_NOOP("Relationship"), QT_TR_NOOP("Textbox"), QT_TR_NOOP("Permission"), QT_TR_NOOP("Parameter"), QT_TR_NOOP("Type Attribute"), QT_TR_NOOP("Tag"), QT_TR_NOOP("Generic SQL"), QT_TR_NOOP("Basic Relationship") }; @@ -60,7 +60,7 @@ const QString BaseObject::objs_sql[BaseObject::ObjectTypeCount]={ QString("CAST"), QString("LANGUAGE"), QString("TYPE"), QString("TABLESPACE"), QString("OPERATOR FAMILY"), QString("OPERATOR CLASS"), QString("DATABASE"), QString("COLLATION"), QString("EXTENSION"), QString("EVENT TRIGGER"), - QString("POLICY"), QString("FOREIGN DATA WRAPPER") + QString("POLICY"), QString("FOREIGN DATA WRAPPER"), QString("SERVER") }; /* Initializes the global id which is shared between instances @@ -125,7 +125,7 @@ ObjectType BaseObject::getObjectType(const QString &type_name) { ObjectType obj_type=ObjectType::BaseObject; - for(int i=0; i < BaseObject::ObjectTypeCount; i++) + for(unsigned i=0; i < BaseObject::ObjectTypeCount; i++) { if(objs_schemas[i]==type_name) { @@ -943,7 +943,7 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector::iterator itr; diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 5490566b03..f42b2fdf00 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -64,6 +64,7 @@ enum class ObjectType: unsigned { EventTrigger, Policy, ForeignDataWrapper, + Server, Relationship, Textbox, Permission, @@ -72,8 +73,8 @@ enum class ObjectType: unsigned { Tag, GenericSql, BaseRelationship, - BaseObject, - BaseTable + BaseTable, + BaseObject }; class BaseObject { @@ -107,7 +108,7 @@ class BaseObject { unsigned object_id; //! \brief Objects type count declared on enum ObjectType - static constexpr int ObjectTypeCount=38; + static constexpr unsigned ObjectTypeCount=enum_cast(ObjectType::BaseObject) + 1; /*! \brief Indicates whether the object is protected or not. A protected object indicates that it can not suffer changes in position diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 5168b50e08..724a33db98 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -77,7 +77,8 @@ DatabaseModel::DatabaseModel(void) { ObjectType::Tag, &tags }, { ObjectType::EventTrigger, &eventtriggers }, { ObjectType::GenericSql, &genericsqls }, - { ObjectType::ForeignDataWrapper, &fdata_wrappers } + { ObjectType::ForeignDataWrapper, &fdata_wrappers }, + { ObjectType::Server, &servers } }; } diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 493721ac29..4152d36861 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -105,32 +105,33 @@ class DatabaseModel: public QObject, public BaseObject { allow_conns; //! \brief Vectors that stores all the objects types - vector textboxes; - vector relationships; - vector base_relationships; - vector functions; - vector schemas; - vector views; - vector tables; - vector types; - vector roles; - vector tablespaces; - vector languages; - vector aggregates; - vector casts; - vector conversions; - vector operators; - vector op_classes; - vector op_families; - vector domains; - vector sequences; - vector permissions; - vector collations; - vector extensions; - vector tags; - vector eventtriggers; - vector genericsqls; - vector fdata_wrappers; + vector textboxes, + relationships, + base_relationships, + functions, + schemas, + views, + tables, + types, + roles, + tablespaces, + languages, + aggregates, + casts, + conversions, + operators, + op_classes, + op_families, + domains, + sequences, + permissions, + collations, + extensions, + tags, + eventtriggers, + genericsqls, + fdata_wrappers, + servers; /*! \brief Stores the xml definition for special objects. This map is used when revalidating the relationships */ diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 278b51133e..462cfb0a65 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -18,17 +18,13 @@ #include "foreigndatawrapper.h" -const QString ForeignDataWrapper::OptionsSeparator = QString(","); -const QString ForeignDataWrapper::OptionValueSeparator = QString("="); - -ForeignDataWrapper::ForeignDataWrapper(void) +ForeignDataWrapper::ForeignDataWrapper(void) : ForeignObject() { obj_type=ObjectType::ForeignDataWrapper; validator_func = handler_func = nullptr; attributes[Attributes::HandlerFunc] = QString(); attributes[Attributes::ValidatorFunc] = QString(); - attributes[Attributes::Options] = QString(); } void ForeignDataWrapper::setHandlerFunction(Function *func) @@ -82,40 +78,6 @@ Function *ForeignDataWrapper::getValidatorFunction(void) return(validator_func); } -void ForeignDataWrapper::setOption(const QString &opt, const QString &value) -{ - if(opt.isEmpty()) - throw Exception(ErrorCode::AsgOptionInvalidName,__PRETTY_FUNCTION__,__FILE__,__LINE__); - - options[opt] = value; -} - -void ForeignDataWrapper::setOptions(const attribs_map &options) -{ - for(auto &itr : options) - { - if(itr.first.isEmpty()) - throw Exception(ErrorCode::AsgOptionInvalidName,__PRETTY_FUNCTION__,__FILE__,__LINE__); - } - - this->options = options; -} - -void ForeignDataWrapper::removeOption(const QString &opt) -{ - options.erase(opt); -} - -void ForeignDataWrapper::removeOptions(void) -{ - options.clear(); -} - -attribs_map ForeignDataWrapper::getOptions(void) -{ - return(options); -} - QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) { QString code_def=getCachedCode(def_type, false); diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h index b5bc087baf..2b62c0ffd8 100644 --- a/libpgmodeler/src/foreigndatawrapper.h +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -27,22 +27,16 @@ #include "baseobject.h" #include "function.h" +#include "foreignobject.h" -class ForeignDataWrapper: public BaseObject{ +class ForeignDataWrapper: public ForeignObject { //! \brief Function that executes the functions related to the foreign data wrapper Function *handler_func, //! \brief Function that validates the options passed to the foreign data wrapper *validator_func; - //! \brief A set of key/value options associated to the foreign data wrapper - attribs_map options; - public: - //! \brief Store the character used to separate options/values in the XML code - static const QString OptionsSeparator; - static const QString OptionValueSeparator; - ForeignDataWrapper(void); void setHandlerFunction(Function *func); @@ -51,12 +45,6 @@ class ForeignDataWrapper: public BaseObject{ Function *getHandlerFunction(void); Function *getValidatorFunction(void); - void setOption(const QString &opt, const QString &value); - void setOptions(const attribs_map &options); - void removeOption(const QString &opt); - void removeOptions(void); - attribs_map getOptions(void); - virtual QString getCodeDefinition(unsigned def_type); virtual QString getAlterDefinition(BaseObject *object); }; diff --git a/libpgmodeler/src/foreignobject.cpp b/libpgmodeler/src/foreignobject.cpp new file mode 100644 index 0000000000..0aad350044 --- /dev/null +++ b/libpgmodeler/src/foreignobject.cpp @@ -0,0 +1,61 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "foreignobject.h" + +const QString ForeignObject::OptionsSeparator = QString(","); +const QString ForeignObject::OptionValueSeparator = QString("="); + +ForeignObject::ForeignObject(void) : BaseObject() +{ + attributes[Attributes::Options] = QString(); +} + +void ForeignObject::setOption(const QString &opt, const QString &value) +{ + if(opt.isEmpty()) + throw Exception(ErrorCode::AsgOptionInvalidName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + options[opt] = value; +} + +void ForeignObject::setOptions(const attribs_map &options) +{ + for(auto &itr : options) + { + if(itr.first.isEmpty()) + throw Exception(ErrorCode::AsgOptionInvalidName,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + + this->options = options; +} + +void ForeignObject::removeOption(const QString &opt) +{ + options.erase(opt); +} + +void ForeignObject::removeOptions(void) +{ + options.clear(); +} + +attribs_map ForeignObject::getOptions(void) +{ + return(options); +} diff --git a/libpgmodeler/src/foreignobject.h b/libpgmodeler/src/foreignobject.h new file mode 100644 index 0000000000..097d9c77c1 --- /dev/null +++ b/libpgmodeler/src/foreignobject.h @@ -0,0 +1,51 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler +\class ForeignObject +\brief Implements the basic operations to handle common attributes of foreign data wrapper, foreign servers and foreign tables. +*/ + +#ifndef FOREIGN_OBJECT_H +#define FOREIGN_OBJECT_H + +#include "baseobject.h" + +class ForeignObject: public BaseObject { + protected: + //! \brief A set of key/value options associated to the foreign object + attribs_map options; + + public: + //! \brief Store the character used to separate options/values in the XML code + static const QString OptionsSeparator; + static const QString OptionValueSeparator; + + ForeignObject(void); + + void setOption(const QString &opt, const QString &value); + void setOptions(const attribs_map &options); + void removeOption(const QString &opt); + void removeOptions(void); + attribs_map getOptions(void); + + virtual QString getCodeDefinition(unsigned) = 0; +}; + +#endif diff --git a/libpgmodeler/src/server.cpp b/libpgmodeler/src/server.cpp new file mode 100644 index 0000000000..a0cb51b98d --- /dev/null +++ b/libpgmodeler/src/server.cpp @@ -0,0 +1,33 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "server.h" + +Server::Server(void) : ForeignObject() +{ + obj_type=ObjectType::ForeignDataWrapper; + attributes[Attributes::Options] = QString(); +} + +QString Server::getCodeDefinition(unsigned def_type) +{ + QString code_def=getCachedCode(def_type, false); + if(!code_def.isEmpty()) return(code_def); + + return(this->BaseObject::__getCodeDefinition(def_type)); +} diff --git a/libpgmodeler/src/server.h b/libpgmodeler/src/server.h new file mode 100644 index 0000000000..8cc6f060c4 --- /dev/null +++ b/libpgmodeler/src/server.h @@ -0,0 +1,39 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler +\class Server +\brief Implements the operations to manipulate foreign servers on the database. +*/ + +#ifndef SERVER_H +#define SERVER_H + +#include "baseobject.h" +#include "foreigndatawrapper.h" + +class Server: public ForeignObject{ + + public: + Server(void); + + virtual QString getCodeDefinition(unsigned def_type); +}; + +#endif From e258144ee15f0630d4044a981919b694c0a291b4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 12 Apr 2019 11:27:13 -0300 Subject: [PATCH 315/425] Adding missing schema file for foreign server --- schemas/sql/server.sch | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 schemas/sql/server.sch diff --git a/schemas/sql/server.sch b/schemas/sql/server.sch new file mode 100644 index 0000000000..4e242e15ef --- /dev/null +++ b/schemas/sql/server.sch @@ -0,0 +1,28 @@ +# SQL definition for schemas +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[-- object: ] {name} [ | type: ] {sql-object} [ --] $br + +[-- ] {drop} + +%if {prepended-sql} %then + {prepended-sql} + $br [-- ddl-end --] $br $br +%end + +[CREATE SERVER ] {name}; $br + +# This is a special token that pgModeler recognizes as end of DDL command +# when exporting models directly to DBMS. DO NOT REMOVE THIS TOKEN! +[-- ddl-end --] $br + +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end + +%if {appended-sql} %then + {appended-sql} + $br [-- ddl-end --] $br +%end + +$br From 5c3a469b52a26e5c4ca8897ac5def7132adee334 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 12 Apr 2019 16:26:40 -0300 Subject: [PATCH 316/425] Added tests for Server object --- libparsers/src/attributes.cpp | 2 + libparsers/src/attributes.h | 2 + libpgmodeler/src/databasemodel.h | 1 + libpgmodeler/src/foreigndatawrapper.cpp | 7 +- libpgmodeler/src/foreigndatawrapper.h | 1 + libpgmodeler/src/foreignobject.cpp | 12 ++ libpgmodeler/src/foreignobject.h | 2 + libpgmodeler/src/server.cpp | 42 ++++- libpgmodeler/src/server.h | 14 +- schemas/sql/foreigndatawrapper.sch | 2 - schemas/sql/server.sch | 15 +- tests/src/servertest/servertest.cpp | 223 ++++++++++++++++++++++++ tests/src/servertest/servertest.pro | 2 + tests/tests.pro | 3 +- 14 files changed, 314 insertions(+), 14 deletions(-) create mode 100644 tests/src/servertest/servertest.cpp create mode 100644 tests/src/servertest/servertest.pro diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 1b5a9a71e2..2f7d86dd23 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -207,6 +207,7 @@ namespace Attributes { FadedOut=QString("faded-out"), Family=QString("family"), FastUpdate=QString("fast-update"), + Fdw=QString("fdw"), FileAssociated=QString("file-associated"), FillColor=QString("fill-color"), FilterOids=QString("filter-oids"), @@ -583,6 +584,7 @@ namespace Attributes { Values=QString("values"), Variable=QString("variable"), Variation=QString("variation"), + Version=QString("version"), ViewBody=QString("view-body"), ViewExtBody=QString("view-ext-body"), ViewName=QString("view-name"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 8f5ed3a560..f47c052360 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -222,6 +222,7 @@ namespace Attributes { FadedOut, Family, FastUpdate, + Fdw, FileAssociated, FillColor, FilterOids, @@ -589,6 +590,7 @@ namespace Attributes { Values, Variable, Variation, + Version, ViewBody, ViewExtBody, ViewName, diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 4152d36861..bae6e5c3b4 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -55,6 +55,7 @@ Additionally, this class, saves, loads and generates the XML/SQL definition of a #include "eventtrigger.h" #include "genericsql.h" #include "foreigndatawrapper.h" +#include "server.h" #include #include diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 462cfb0a65..8edab5673d 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -98,12 +98,7 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) attributes[Attributes::ValidatorFunc] = is_sql_def ? validator_func->getName(true) : validator_func->getCodeDefinition(def_type, true); } - for(auto &itr : options) - fmt_options += is_sql_def ? QString("%1 '%2'").arg(itr.first).arg(itr.second) : - QString("%1%2%3").arg(itr.first).arg(OptionValueSeparator).arg(itr.second); - - attributes[Attributes::Options] = fmt_options.join(OptionsSeparator); - + setOptionsAttribute(def_type); return(this->BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h index 2b62c0ffd8..18a13a47f2 100644 --- a/libpgmodeler/src/foreigndatawrapper.h +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -30,6 +30,7 @@ #include "foreignobject.h" class ForeignDataWrapper: public ForeignObject { + private: //! \brief Function that executes the functions related to the foreign data wrapper Function *handler_func, diff --git a/libpgmodeler/src/foreignobject.cpp b/libpgmodeler/src/foreignobject.cpp index 0aad350044..a96465f6f1 100644 --- a/libpgmodeler/src/foreignobject.cpp +++ b/libpgmodeler/src/foreignobject.cpp @@ -59,3 +59,15 @@ attribs_map ForeignObject::getOptions(void) { return(options); } + +void ForeignObject::setOptionsAttribute(unsigned def_type) +{ + QStringList fmt_options; + + for(auto &itr : options) + fmt_options += def_type == SchemaParser::SqlDefinition ? + QString("%1 '%2'").arg(itr.first).arg(itr.second) : + QString("%1%2%3").arg(itr.first).arg(OptionValueSeparator).arg(itr.second); + + attributes[Attributes::Options] = fmt_options.join(OptionsSeparator); +} diff --git a/libpgmodeler/src/foreignobject.h b/libpgmodeler/src/foreignobject.h index 097d9c77c1..6e130e3602 100644 --- a/libpgmodeler/src/foreignobject.h +++ b/libpgmodeler/src/foreignobject.h @@ -32,6 +32,8 @@ class ForeignObject: public BaseObject { //! \brief A set of key/value options associated to the foreign object attribs_map options; + void setOptionsAttribute(unsigned def_type); + public: //! \brief Store the character used to separate options/values in the XML code static const QString OptionsSeparator; diff --git a/libpgmodeler/src/server.cpp b/libpgmodeler/src/server.cpp index a0cb51b98d..a46b9cf76f 100644 --- a/libpgmodeler/src/server.cpp +++ b/libpgmodeler/src/server.cpp @@ -20,8 +20,43 @@ Server::Server(void) : ForeignObject() { - obj_type=ObjectType::ForeignDataWrapper; + obj_type = ObjectType::Server; + fdata_wrapper = nullptr; + attributes[Attributes::Options] = QString(); + attributes[Attributes::Version] = QString(); + attributes[Attributes::Type] = QString(); + attributes[Attributes::Object] = QString(); +} + +void Server::setType(const QString &type) +{ + this->type = type; +} + +void Server::setVersion(const QString &version) +{ + this->version = version; +} + +void Server::setForeignDataWrapper(ForeignDataWrapper *fdw) +{ + fdata_wrapper = fdw; +} + +QString Server::getType(void) +{ + return(type); +} + +QString Server::getVersion(void) +{ + return(version); +} + +ForeignDataWrapper *Server::getForeignDataWrapper(void) +{ + return(fdata_wrapper); } QString Server::getCodeDefinition(unsigned def_type) @@ -29,5 +64,10 @@ QString Server::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); + attributes[Attributes::Version] = version; + attributes[Attributes::Type] = type; + attributes[Attributes::Fdw] = fdata_wrapper ? fdata_wrapper->getName(true) : QString(); + + setOptionsAttribute(def_type); return(this->BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/server.h b/libpgmodeler/src/server.h index 8cc6f060c4..28496b86ce 100644 --- a/libpgmodeler/src/server.h +++ b/libpgmodeler/src/server.h @@ -28,11 +28,23 @@ #include "baseobject.h" #include "foreigndatawrapper.h" -class Server: public ForeignObject{ +class Server: public ForeignObject { + private: + ForeignDataWrapper *fdata_wrapper; + + QString type, version; public: Server(void); + void setType(const QString &type); + void setVersion(const QString &version); + void setForeignDataWrapper(ForeignDataWrapper *fdw); + + QString getType(void); + QString getVersion(void); + ForeignDataWrapper *getForeignDataWrapper(void); + virtual QString getCodeDefinition(unsigned def_type); }; diff --git a/schemas/sql/foreigndatawrapper.sch b/schemas/sql/foreigndatawrapper.sch index 55be60d4ae..9d04ec0d1b 100644 --- a/schemas/sql/foreigndatawrapper.sch +++ b/schemas/sql/foreigndatawrapper.sch @@ -36,8 +36,6 @@ $br $tb ; -# This is a special token that pgModeler recognizes as end of DDL command -# when exporting models directly to DBMS. DO NOT REMOVE THIS TOKEN! $br [-- ddl-end --] $br %if {comment} %then {comment} %end diff --git a/schemas/sql/server.sch b/schemas/sql/server.sch index 4e242e15ef..faff7468d9 100644 --- a/schemas/sql/server.sch +++ b/schemas/sql/server.sch @@ -11,10 +11,19 @@ $br [-- ddl-end --] $br $br %end -[CREATE SERVER ] {name}; $br +[CREATE SERVER ] {name} +$br $tb + +%if {type} %then + [ TYPE ] ${type} +%end + +%if {version} %then + [ VERSION ] ${version} +%end + +$br $tb [FOREIGN DATA WRAPPER ] {fdw} -# This is a special token that pgModeler recognizes as end of DDL command -# when exporting models directly to DBMS. DO NOT REMOVE THIS TOKEN! [-- ddl-end --] $br %if {owner} %then {owner} %end diff --git a/tests/src/servertest/servertest.cpp b/tests/src/servertest/servertest.cpp new file mode 100644 index 0000000000..e5dfe0386c --- /dev/null +++ b/tests/src/servertest/servertest.cpp @@ -0,0 +1,223 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include +#include "databasemodel.h" + +class ServerTest: public QObject { + private: + Q_OBJECT + + private slots: + void codeGeneratedIsWellFormed(void); + void modelReturnsDepsAndRefsForServer(void); + void modelCreatesServerfromXMLandResultingXMLisEqual(void); +}; + +void ServerTest::codeGeneratedIsWellFormed(void) +{ + Server server; + Role owner; + QString sql_code =QString( +"-- object: server_test | type: SERVER -- \ +-- DROP SERVER IF EXISTS fdw CASCADE; \ +CREATE SERVER server_test \ +TYPE 'dbtype' \ +VERSION '1.0' \ +FOREIGN DATA WRAPPER fdw \ +OPTIONS (opt1 'value1',opt2 'value2'); \ +-- ddl-end -- \ +COMMENT ON SERVER server_test IS 'This is a test comment on server'; \ +-- ddl-end -- \ +ALTER SERVER server OWNER TO postgres; \ +-- ddl-end -- ").simplified(); + + QString xml_code =QString( +" \ + \ + \ + \ + \ +").replace("#", Server::OptionValueSeparator) + .replace("*", Server::OptionsSeparator).simplified(); + + try + { + owner.setName("postgres"); + + server.setName("server_test"); + server.setOwner(&owner); + + server.setOption("opt1", "value1"); + server.setOption("opt2", "value2"); + server.setComment("This is a test comment on server"); + + QString res_sql_code = server.getCodeDefinition(SchemaParser::SqlDefinition).simplified(); + QCOMPARE(sql_code, res_sql_code); + + QString res_xml_code = server.getCodeDefinition(SchemaParser::XmlDefinition).simplified(); + QCOMPARE(xml_code, res_xml_code); + } + catch (Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } +} + +void ServerTest::modelReturnsDepsAndRefsForServer(void) +{ + /*DatabaseModel model; + Role owner; + Schema public_sch; + Language lang; + Function func_handler, func_validator; + ForeignDataWrapper fdw; + + try + { + public_sch.setName("public"); + owner.setName("postgres"); + + model.addSchema(&public_sch); + model.addRole(&owner); + + fdw.setName("fdw"); + fdw.setOwner(&owner); + func_handler.setName("func_handler"); + func_handler.setReturnType(PgSqlType("fdw_handler")); + func_handler.setSchema(&public_sch); + func_handler.setSourceCode("foo"); + func_handler.setOwner(&owner); + func_handler.setLanguage(&lang); + fdw.setHandlerFunction(&func_handler); + + func_validator.setName("func_validator"); + func_validator.addParameter(Parameter("param1", PgSqlType("text", 1))); + func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); + func_validator.setSchema(&public_sch); + func_validator.setSourceCode("foo"); + func_validator.setOwner(&owner); + func_validator.setLanguage(&lang); + fdw.setValidatorFunction(&func_validator); + + fdw.setOption("opt1", "value1"); + fdw.setOption("opt2", "value2"); + fdw.setComment("This is a test comment on FDW"); + + model.addFunction(&func_handler); + model.addFunction(&func_validator); + model.addForeignDataWrapper(&fdw); + + vector deps; + model.getObjectDependecies(&fdw, deps); + + QVERIFY(deps.size() >= 3); + + deps.clear(); + model.getObjectReferences(&func_validator, deps); + QVERIFY(deps.size() == 1); + + deps.clear(); + model.getObjectReferences(&func_handler, deps); + QVERIFY(deps.size() == 1); + + model.removeForeignDataWrapper(&fdw); + model.removeFunction(&func_handler); + model.removeFunction(&func_validator); + model.removeLanguage(&lang); + model.removeSchema(&public_sch); + model.removeRole(&owner); + } + catch (Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } */ +} + +void ServerTest::modelCreatesServerfromXMLandResultingXMLisEqual(void) +{ + /*DatabaseModel model; + Role owner; + Schema public_sch; + Language lang; + Function func_handler, func_validator; + ForeignDataWrapper *fdw = nullptr; + QString xml_code, res_xml_code; + + try + { + public_sch.setName("public"); + owner.setName("postgres"); + + model.addSchema(&public_sch); + model.addRole(&owner); + + func_handler.setName("func_handler"); + func_handler.setReturnType(PgSqlType("fdw_handler")); + func_handler.setSchema(&public_sch); + func_handler.setSourceCode("foo"); + func_handler.setOwner(&owner); + func_handler.setLanguage(&lang); + + func_validator.setName("func_validator"); + func_validator.addParameter(Parameter("param1", PgSqlType("text", 1))); + func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); + func_validator.setSchema(&public_sch); + func_validator.setSourceCode("foo"); + func_validator.setOwner(&owner); + func_validator.setLanguage(&lang); + + model.addFunction(&func_handler); + model.addFunction(&func_validator); + + xml_code=QString(" \ + \ + \ + \ + \ +").replace("#", ForeignDataWrapper::OptionValueSeparator) + .replace("*", ForeignDataWrapper::OptionsSeparator); + + model.getXMLParser()->loadXMLBuffer(xml_code); + fdw = dynamic_cast(model.createObject(ObjectType::ForeignDataWrapper)); + + model.removeForeignDataWrapper(fdw); + model.removeFunction(&func_handler); + model.removeFunction(&func_validator); + model.removeLanguage(&lang); + model.removeSchema(&public_sch); + model.removeRole(&owner); + + QVERIFY(fdw != nullptr); + + res_xml_code = fdw->getCodeDefinition(SchemaParser::XmlDefinition).simplified(); + xml_code = xml_code.simplified(); + + if(fdw) + delete(fdw); + + QCOMPARE(xml_code, res_xml_code); + } + catch (Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + } */ +} + +QTEST_MAIN(ServerTest) +#include "servertest.moc" diff --git a/tests/src/servertest/servertest.pro b/tests/src/servertest/servertest.pro new file mode 100644 index 0000000000..be77102343 --- /dev/null +++ b/tests/src/servertest/servertest.pro @@ -0,0 +1,2 @@ +include(../../tests.pri) +SOURCES += servertest.cpp diff --git a/tests/tests.pro b/tests/tests.pro index 9cb04ca63e..a978e4ad1a 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -15,6 +15,7 @@ src/databasemodeltest \ src/schemaparsertest \ src/linenumberstest \ src/partrelationshiptest \ -src/foreigndatawrappertest +src/foreigndatawrappertest \ +src/servertest From 56397c303b1aef9a923afd9211606ba43706196d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 15 Apr 2019 10:54:03 -0300 Subject: [PATCH 317/425] The class Server is now able to generate SQL and XML code --- libpgmodeler/src/baseobject.cpp | 3 +- libpgmodeler/src/databasemodel.cpp | 34 +++++++++ libpgmodeler/src/databasemodel.h | 9 ++- libpgmodeler/src/foreigndatawrapper.cpp | 7 +- libpgmodeler/src/foreigndatawrapper.h | 1 + libpgmodeler/src/server.cpp | 9 ++- libpgmodeler/src/server.h | 1 + schemas/sql/foreigndatawrapper.sch | 2 +- schemas/sql/server.sch | 12 +++- schemas/xml/dtd/dbmodel.dtd | 2 + schemas/xml/dtd/server.dtd | 11 +++ schemas/xml/foreigndatawrapper.sch | 42 ++++++----- schemas/xml/server.sch | 35 ++++++++++ .../foreigndatawrappertest.cpp | 8 +-- tests/src/servertest/servertest.cpp | 69 ++++++------------- 15 files changed, 168 insertions(+), 77 deletions(-) create mode 100644 schemas/xml/dtd/server.dtd create mode 100644 schemas/xml/server.sch diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 30e363ebdc..ef6fcbfa79 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -404,7 +404,8 @@ bool BaseObject::acceptsOwner(ObjectType obj_type) obj_type==ObjectType::Tablespace || obj_type==ObjectType::Database || obj_type==ObjectType::OpClass || obj_type==ObjectType::OpFamily || obj_type==ObjectType::Collation || obj_type==ObjectType::View || - obj_type==ObjectType::EventTrigger || obj_type==ObjectType::ForeignDataWrapper); + obj_type==ObjectType::EventTrigger || obj_type==ObjectType::ForeignDataWrapper || + obj_type==ObjectType::Server); } bool BaseObject::acceptsOwner(void) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 724a33db98..eeb9adc8c4 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1082,6 +1082,40 @@ ForeignDataWrapper *DatabaseModel::getForeignDataWrapper(const QString &name) return(dynamic_cast(getObject(name, ObjectType::ForeignDataWrapper))); } +void DatabaseModel::addServer(Server *server, int obj_idx) +{ + try + { + __addObject(server, obj_idx); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void DatabaseModel::removeServer(Server *server, int obj_idx) +{ + try + { + __removeObject(server, obj_idx); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } +} + +Server *DatabaseModel::getServer(unsigned obj_idx) +{ + return(dynamic_cast(getObject(obj_idx, ObjectType::Server))); +} + +Server *DatabaseModel::getServer(const QString &name) +{ + return(dynamic_cast(getObject(name, ObjectType::Server))); +} + void DatabaseModel::removeExtension(Extension *extension, int obj_idx) { try diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index bae6e5c3b4..d1e6984dcd 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -262,8 +262,8 @@ class DatabaseModel: public QObject, public BaseObject { BaseObject *getObject(unsigned obj_idx, ObjectType obj_type); /*! \brief Loads a database model from a file. In case of loading errors - the objects in the model will not be destroyed automatically. The user need to call - destroyObjects() or delete the entire model */ + the objects in the model will not be destroyed automatically. The user need to call + destroyObjects() or delete the entire model */ void loadModel(const QString &filename); //! \brief Sets the database encoding @@ -500,6 +500,11 @@ class DatabaseModel: public QObject, public BaseObject { ForeignDataWrapper *getForeignDataWrapper(unsigned obj_idx); ForeignDataWrapper *getForeignDataWrapper(const QString &name); + void addServer(Server *server, int obj_idx=-1); + void removeServer(Server *server, int obj_idx=-1); + Server *getServer(unsigned obj_idx); + Server *getServer(const QString &name); + void addPermission(Permission *perm); void removePermission(Permission *perm); diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 8edab5673d..785ad333b8 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -79,6 +79,11 @@ Function *ForeignDataWrapper::getValidatorFunction(void) } QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) +{ + return(getCodeDefinition(def_type, false)); +} + +QString ForeignDataWrapper::getCodeDefinition(unsigned def_type, bool reduced_form) { QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); @@ -99,7 +104,7 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) } setOptionsAttribute(def_type); - return(this->BaseObject::__getCodeDefinition(def_type)); + return(this->BaseObject::getCodeDefinition(def_type, reduced_form)); } QString ForeignDataWrapper::getAlterDefinition(BaseObject *object) diff --git a/libpgmodeler/src/foreigndatawrapper.h b/libpgmodeler/src/foreigndatawrapper.h index 18a13a47f2..120a28fbda 100644 --- a/libpgmodeler/src/foreigndatawrapper.h +++ b/libpgmodeler/src/foreigndatawrapper.h @@ -47,6 +47,7 @@ class ForeignDataWrapper: public ForeignObject { Function *getValidatorFunction(void); virtual QString getCodeDefinition(unsigned def_type); + virtual QString getCodeDefinition(unsigned def_type, bool reduced_form); virtual QString getAlterDefinition(BaseObject *object); }; diff --git a/libpgmodeler/src/server.cpp b/libpgmodeler/src/server.cpp index a46b9cf76f..a29dc00692 100644 --- a/libpgmodeler/src/server.cpp +++ b/libpgmodeler/src/server.cpp @@ -66,7 +66,14 @@ QString Server::getCodeDefinition(unsigned def_type) attributes[Attributes::Version] = version; attributes[Attributes::Type] = type; - attributes[Attributes::Fdw] = fdata_wrapper ? fdata_wrapper->getName(true) : QString(); + attributes[Attributes::Fdw] = QString(); + + if(fdata_wrapper) + { + attributes[Attributes::Fdw] = def_type == SchemaParser::SqlDefinition ? + fdata_wrapper->getName(true) : + fdata_wrapper->getCodeDefinition(def_type, true); + } setOptionsAttribute(def_type); return(this->BaseObject::__getCodeDefinition(def_type)); diff --git a/libpgmodeler/src/server.h b/libpgmodeler/src/server.h index 28496b86ce..85d48f4bcb 100644 --- a/libpgmodeler/src/server.h +++ b/libpgmodeler/src/server.h @@ -30,6 +30,7 @@ class Server: public ForeignObject { private: + //! \brief The foreign data wrapper which manages the server ForeignDataWrapper *fdata_wrapper; QString type, version; diff --git a/schemas/sql/foreigndatawrapper.sch b/schemas/sql/foreigndatawrapper.sch index 9d04ec0d1b..cf8dd26327 100644 --- a/schemas/sql/foreigndatawrapper.sch +++ b/schemas/sql/foreigndatawrapper.sch @@ -38,8 +38,8 @@ $br $tb $br [-- ddl-end --] $br -%if {comment} %then {comment} %end %if {owner} %then {owner} %end +%if {comment} %then {comment} %end %if {appended-sql} %then {appended-sql} diff --git a/schemas/sql/server.sch b/schemas/sql/server.sch index faff7468d9..f043ccb0db 100644 --- a/schemas/sql/server.sch +++ b/schemas/sql/server.sch @@ -15,16 +15,22 @@ $br $tb %if {type} %then - [ TYPE ] ${type} + [ TYPE ] '{type}' %end %if {version} %then - [ VERSION ] ${version} + [ VERSION ] '{version}' %end $br $tb [FOREIGN DATA WRAPPER ] {fdw} -[-- ddl-end --] $br +%if {options} %then + $br $tb [OPTIONS (] {options} ) +%end + +; + +$br [-- ddl-end --] $br %if {owner} %then {owner} %end %if {comment} %then {comment} %end diff --git a/schemas/xml/dtd/dbmodel.dtd b/schemas/xml/dtd/dbmodel.dtd index 2d5f067442..c720166c08 100644 --- a/schemas/xml/dtd/dbmodel.dtd +++ b/schemas/xml/dtd/dbmodel.dtd @@ -68,6 +68,8 @@ %policy; %foreigndatawrapper; + +%server; diff --git a/schemas/xml/dtd/server.dtd b/schemas/xml/dtd/server.dtd new file mode 100644 index 0000000000..b3cb9b95d9 --- /dev/null +++ b/schemas/xml/dtd/server.dtd @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/schemas/xml/foreigndatawrapper.sch b/schemas/xml/foreigndatawrapper.sch index d9f7f83e2e..8416f9d453 100644 --- a/schemas/xml/foreigndatawrapper.sch +++ b/schemas/xml/foreigndatawrapper.sch @@ -2,28 +2,36 @@ # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. +%if {reduced-form} %then + $tb +%end + [ $br +%else + %if {options} %then + [ options=] "{options}" + %end -%if {protected} %then - [ protected=] "true" -%end + %if {protected} %then + [ protected=] "true" + %end -%if {sql-disabled} %then - [ sql-disabled=] "true" -%end + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end -> $br + > $br -%if {owner} %then {owner} %end -%if {comment} %then {comment} %end -%if {appended-sql} %then {appended-sql} %end -%if {prepended-sql} %then {prepended-sql} %end + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end -%if {handler} %then {handler} %end -%if {validator} %then {validator} %end + %if {handler} %then {handler} %end + %if {validator} %then {validator} %end - + +%end diff --git a/schemas/xml/server.sch b/schemas/xml/server.sch new file mode 100644 index 0000000000..8f264714c3 --- /dev/null +++ b/schemas/xml/server.sch @@ -0,0 +1,35 @@ +# XML definition for servers +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[ $br + +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end +%if {fdw} %then {fdw} %end + + diff --git a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp index a6a617cd94..6bf70bb55c 100644 --- a/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp +++ b/tests/src/foreigndatawrappertest/foreigndatawrappertest.cpp @@ -132,13 +132,13 @@ void ForeignDataWrapperTest::codeGeneratedIsWellFormed(void) "-- object: fdw | type: FOREIGN DATA WRAPPER -- \ -- DROP FOREIGN DATA WRAPPER IF EXISTS fdw CASCADE; \ CREATE FOREIGN DATA WRAPPER fdw \ -HANDLER public.func_handler() \ -VALIDATOR public.func_validator(text[],oid) \ +HANDLER public.func_handler \ +VALIDATOR public.func_validator \ OPTIONS (opt1 'value1',opt2 'value2'); \ -- ddl-end -- \ -COMMENT ON FOREIGN DATA WRAPPER fdw IS 'This is a test comment on FDW'; \ --- ddl-end -- \ ALTER FOREIGN DATA WRAPPER fdw OWNER TO postgres; \ + -- ddl-end -- \ + COMMENT ON FOREIGN DATA WRAPPER fdw IS 'This is a test comment on FDW'; \ -- ddl-end -- ").simplified(); QString xml_code =QString( diff --git a/tests/src/servertest/servertest.cpp b/tests/src/servertest/servertest.cpp index e5dfe0386c..e225b21be5 100644 --- a/tests/src/servertest/servertest.cpp +++ b/tests/src/servertest/servertest.cpp @@ -31,41 +31,44 @@ class ServerTest: public QObject { void ServerTest::codeGeneratedIsWellFormed(void) { + ForeignDataWrapper fdw; Server server; Role owner; QString sql_code =QString( "-- object: server_test | type: SERVER -- \ --- DROP SERVER IF EXISTS fdw CASCADE; \ +-- DROP SERVER IF EXISTS server_test CASCADE; \ CREATE SERVER server_test \ TYPE 'dbtype' \ VERSION '1.0' \ FOREIGN DATA WRAPPER fdw \ OPTIONS (opt1 'value1',opt2 'value2'); \ -- ddl-end -- \ -COMMENT ON SERVER server_test IS 'This is a test comment on server'; \ +ALTER SERVER server_test OWNER TO postgres; \ -- ddl-end -- \ -ALTER SERVER server OWNER TO postgres; \ +COMMENT ON SERVER server_test IS 'This is a test comment on server'; \ -- ddl-end -- ").simplified(); QString xml_code =QString( -" \ +" \ \ - \ - \ - \ -").replace("#", Server::OptionValueSeparator) + \ + \ +").replace("#", Server::OptionValueSeparator) .replace("*", Server::OptionsSeparator).simplified(); try { owner.setName("postgres"); + fdw.setName("fdw"); server.setName("server_test"); server.setOwner(&owner); - + server.setType("dbtype"); + server.setVersion("1.0"); server.setOption("opt1", "value1"); server.setOption("opt2", "value2"); server.setComment("This is a test comment on server"); + server.setForeignDataWrapper(&fdw); QString res_sql_code = server.getCodeDefinition(SchemaParser::SqlDefinition).simplified(); QCOMPARE(sql_code, res_sql_code); @@ -75,18 +78,17 @@ ALTER SERVER server OWNER TO postgres; \ } catch (Exception &e) { - QFAIL(e.getErrorMessage().toStdString().c_str()); + QFAIL(e.getExceptionsText().toStdString().c_str()); } } void ServerTest::modelReturnsDepsAndRefsForServer(void) { - /*DatabaseModel model; + DatabaseModel model; Role owner; Schema public_sch; - Language lang; - Function func_handler, func_validator; ForeignDataWrapper fdw; + Server server; try { @@ -97,56 +99,29 @@ void ServerTest::modelReturnsDepsAndRefsForServer(void) model.addRole(&owner); fdw.setName("fdw"); - fdw.setOwner(&owner); - func_handler.setName("func_handler"); - func_handler.setReturnType(PgSqlType("fdw_handler")); - func_handler.setSchema(&public_sch); - func_handler.setSourceCode("foo"); - func_handler.setOwner(&owner); - func_handler.setLanguage(&lang); - fdw.setHandlerFunction(&func_handler); - - func_validator.setName("func_validator"); - func_validator.addParameter(Parameter("param1", PgSqlType("text", 1))); - func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); - func_validator.setSchema(&public_sch); - func_validator.setSourceCode("foo"); - func_validator.setOwner(&owner); - func_validator.setLanguage(&lang); - fdw.setValidatorFunction(&func_validator); - - fdw.setOption("opt1", "value1"); - fdw.setOption("opt2", "value2"); - fdw.setComment("This is a test comment on FDW"); - - model.addFunction(&func_handler); - model.addFunction(&func_validator); model.addForeignDataWrapper(&fdw); + server.setName("server_test"); + server.setForeignDataWrapper(&fdw); + vector deps; - model.getObjectDependecies(&fdw, deps); + model.getObjectDependecies(&server, deps); QVERIFY(deps.size() >= 3); deps.clear(); - model.getObjectReferences(&func_validator, deps); - QVERIFY(deps.size() == 1); - - deps.clear(); - model.getObjectReferences(&func_handler, deps); + model.getObjectReferences(&fdw, deps); QVERIFY(deps.size() == 1); + model.removeServer(&server); model.removeForeignDataWrapper(&fdw); - model.removeFunction(&func_handler); - model.removeFunction(&func_validator); - model.removeLanguage(&lang); model.removeSchema(&public_sch); model.removeRole(&owner); } catch (Exception &e) { QFAIL(e.getErrorMessage().toStdString().c_str()); - } */ + } } void ServerTest::modelCreatesServerfromXMLandResultingXMLisEqual(void) From 3cd46e8d61034cb851c5fdab77161c50ed06c58e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 15 Apr 2019 16:27:42 -0300 Subject: [PATCH 318/425] Added methods in DatabaseModel to add/remove/retrieve server objects --- libpgmodeler/src/databasemodel.cpp | 10 ++++++++++ tests/src/servertest/servertest.cpp | 13 ++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index eeb9adc8c4..3a4737fcdc 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -199,6 +199,8 @@ void DatabaseModel::addObject(BaseObject *object, int obj_idx) addGenericSQL(dynamic_cast(object)); else if(obj_type==ObjectType::ForeignDataWrapper) addForeignDataWrapper(dynamic_cast(object)); + else if(obj_type==ObjectType::Server) + addServer(dynamic_cast(object)); } catch(Exception &e) { @@ -267,6 +269,8 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) removeGenericSQL(dynamic_cast(object)); else if(obj_type==ObjectType::ForeignDataWrapper) removeForeignDataWrapper(dynamic_cast(object)); + else if(obj_type==ObjectType::Server) + removeServer(dynamic_cast(object)); } catch(Exception &e) { @@ -8127,6 +8131,12 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetHandlerFunction(), deps, inc_indirect_deps); getObjectDependecies(fdw->getValidatorFunction(), deps, inc_indirect_deps); } + //** Getting the dependecies for server ** + else if(obj_type == ObjectType::Server) + { + Server *server = dynamic_cast(object); + getObjectDependecies(server->getForeignDataWrapper(), deps, inc_indirect_deps); + } if(obj_type == ObjectType::Table || obj_type == ObjectType::View) { diff --git a/tests/src/servertest/servertest.cpp b/tests/src/servertest/servertest.cpp index e225b21be5..6c4c702438 100644 --- a/tests/src/servertest/servertest.cpp +++ b/tests/src/servertest/servertest.cpp @@ -103,20 +103,19 @@ void ServerTest::modelReturnsDepsAndRefsForServer(void) server.setName("server_test"); server.setForeignDataWrapper(&fdw); + model.addServer(&server); - vector deps; + vector refs, deps; model.getObjectDependecies(&server, deps); - QVERIFY(deps.size() >= 3); - - deps.clear(); - model.getObjectReferences(&fdw, deps); - QVERIFY(deps.size() == 1); - + model.getObjectReferences(&fdw, refs); model.removeServer(&server); model.removeForeignDataWrapper(&fdw); model.removeSchema(&public_sch); model.removeRole(&owner); + + QVERIFY(deps.size() >= 2); + QVERIFY(refs.size() == 1); } catch (Exception &e) { From 80167c063bc9677a1b62de9e891c34cc60a77777 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 22 Apr 2019 15:51:42 -0300 Subject: [PATCH 319/425] Added support to create server objects from XML Start to add support to server objects reverse engineering --- libpgconnector/src/catalog.cpp | 8 +- libpgmodeler/src/baseobject.cpp | 2 +- libpgmodeler/src/databasemodel.cpp | 89 ++++++++++++++++++ libpgmodeler/src/databasemodel.h | 1 + libpgmodeler/src/permission.cpp | 5 +- libpgmodeler_ui/res/icones/connserver.png | Bin 0 -> 847 bytes libpgmodeler_ui/res/icones/server.png | Bin 847 -> 1578 bytes libpgmodeler_ui/res/icones/server_grp.png | Bin 0 -> 1337 bytes libpgmodeler_ui/res/resources.qrc | 2 + .../src/connectionsconfigwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 2 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 52 +++++----- schemas/catalog/server.sch | 78 ++++++++++----- tests/src/servertest/servertest.cpp | 63 +++++-------- 14 files changed, 206 insertions(+), 100 deletions(-) create mode 100644 libpgmodeler_ui/res/icones/connserver.png create mode 100644 libpgmodeler_ui/res/icones/server_grp.png diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 750bba7ad5..289e633a0a 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -38,7 +38,8 @@ map Catalog::oid_fields= {ObjectType::Sequence, "sq.oid"}, {ObjectType::Domain, "dm.oid"}, {ObjectType::Type, "tp.oid"}, {ObjectType::Table, "tb.oid"}, {ObjectType::Column, "cl.oid"}, {ObjectType::Constraint, "cs.oid"}, {ObjectType::Rule, "rl.oid"}, {ObjectType::Trigger, "tg.oid"}, {ObjectType::Index, "id.indexrelid"}, - {ObjectType::EventTrigger, "et.oid"}, {ObjectType::Policy, "pl.oid"}, {ObjectType::ForeignDataWrapper, "fw.oid"} + {ObjectType::EventTrigger, "et.oid"}, {ObjectType::Policy, "pl.oid"}, {ObjectType::ForeignDataWrapper, "fw.oid"}, + {ObjectType::Server, "sv.oid"} }; map Catalog::ext_oid_fields={ @@ -58,7 +59,8 @@ map Catalog::name_fields= {ObjectType::Sequence, "relname"}, {ObjectType::Domain, "typname"}, {ObjectType::Type, "typname"}, {ObjectType::Table, "relname"}, {ObjectType::Column, "attname"}, {ObjectType::Constraint, "conname"}, {ObjectType::Rule, "rulename"}, {ObjectType::Trigger, "tgname"}, {ObjectType::Index, "relname"}, - {ObjectType::EventTrigger, "evtname"}, {ObjectType::Policy, "polname"}, {ObjectType::ForeignDataWrapper, "fdwname"} + {ObjectType::EventTrigger, "evtname"}, {ObjectType::Policy, "polname"}, {ObjectType::ForeignDataWrapper, "fdwname"}, + {ObjectType::Server, "srvname"} }; Catalog::Catalog(void) @@ -667,7 +669,7 @@ attribs_map Catalog::getServerAttributes(void) QString sql, attr_name; attribs_map tuple, attribs_aux; - loadCatalogQuery(QString("server")); + loadCatalogQuery(QString("serverinfo")); schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); sql = schparser.getCodeDefinition(attribs).simplified(); diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index ef6fcbfa79..4ebc3c7ae2 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -973,7 +973,7 @@ vector BaseObject::getChildObjectTypes(ObjectType obj_type) if(obj_type==ObjectType::Database) return(vector()={ ObjectType::Cast, ObjectType::Role, ObjectType::Language, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Extension, - ObjectType::EventTrigger, ObjectType::ForeignDataWrapper }); + ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::Server }); if(obj_type==ObjectType::Schema) return(vector()={ ObjectType::Aggregate, ObjectType::Conversion, ObjectType::Collation, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 3a4737fcdc..029f4ece15 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -3316,6 +3316,8 @@ BaseObject *DatabaseModel::createObject(ObjectType obj_type) object=createPolicy(); else if(obj_type==ObjectType::ForeignDataWrapper) object=createForeignDataWrapper(); + else if(obj_type==ObjectType::Server) + object=createServer(); } return(object); @@ -5963,6 +5965,73 @@ ForeignDataWrapper *DatabaseModel::createForeignDataWrapper(void) return(fdw); } +Server *DatabaseModel::createServer(void) +{ + attribs_map attribs; + Server *server = nullptr; + BaseObject *fdw = nullptr; + ObjectType obj_type; + QStringList options, opt_val; + + try + { + server = new Server; + + xmlparser.getElementAttributes(attribs); + setBasicAttributes(server); + + options = attribs[Attributes::Options].split(ForeignDataWrapper::OptionsSeparator); + + for(auto &option : options) + { + opt_val = option.split(ForeignDataWrapper::OptionValueSeparator); + + if(opt_val.size() < 2) + continue; + + server->setOption(opt_val[0], opt_val[1]); + } + + if(xmlparser.accessElement(XmlParser::ChildElement)) + { + do + { + if(xmlparser.getElementType() == XML_ELEMENT_NODE) + { + obj_type = BaseObject::getObjectType(xmlparser.getElementName()); + + if(obj_type == ObjectType::ForeignDataWrapper) + { + xmlparser.getElementAttributes(attribs); + fdw = getObject(attribs[Attributes::Name], ObjectType::ForeignDataWrapper); + + //Raises an error if the fdw doesn't exists + if(!fdw) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) + .arg(server->getName()) + .arg(server->getTypeName()) + .arg(attribs[Attributes::Name]) + .arg(BaseObject::getTypeName(ObjectType::ForeignDataWrapper)), + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + server->setForeignDataWrapper(dynamic_cast(fdw)); + } + } + } + while(xmlparser.accessElement(XmlParser::NextElement)); + } + } + catch(Exception &e) + { + if(server) + delete(server); + + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + } + + return(server); +} + void DatabaseModel::updateViewsReferencingTable(Table *table) { BaseRelationship *rel = nullptr; @@ -9338,6 +9407,26 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } } + + if(obj_type==ObjectType::ForeignDataWrapper && (!exclusion_mode || (exclusion_mode && !refer))) + { + vector::iterator itr, itr_end; + vector list; + ForeignDataWrapper *fdw=dynamic_cast(object); + + itr=servers.begin(); + itr_end=servers.end(); + + while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) + { + if(dynamic_cast(*itr)->getForeignDataWrapper() == fdw) + { + refer=true; + refs.push_back(*itr); + } + itr++; + } + } } } diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index d1e6984dcd..0175d994a6 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -564,6 +564,7 @@ class DatabaseModel: public QObject, public BaseObject { EventTrigger *createEventTrigger(void); GenericSQL *createGenericSQL(void); ForeignDataWrapper *createForeignDataWrapper(void); + Server *createServer(void); //! \brief Update views that reference the provided table forcing the column name deduction and redraw of the former objects void updateViewsReferencingTable(Table *table); diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index df65791a30..dbb938a961 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -60,13 +60,12 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) obj_type==ObjectType::Sequence || obj_type==ObjectType::Database || obj_type==ObjectType::Function || obj_type==ObjectType::Aggregate || obj_type==ObjectType::Language || obj_type==ObjectType::Schema || obj_type==ObjectType::Tablespace || obj_type==ObjectType::Domain || obj_type==ObjectType::Type || - obj_type==ObjectType::ForeignDataWrapper); + obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::Server); //Validating privilege if(result && priv_id <= PrivUsage) { - /* Some privileges are valid only for certain types of objects. If the user try to assign a privilege P for an object that does not accept this privilege the same @@ -110,7 +109,7 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) (obj_type==ObjectType::Tablespace && priv_id==PrivCreate) || - (obj_type==ObjectType::ForeignDataWrapper && priv_id==PrivUsage)); + ((obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::Server) && priv_id==PrivUsage)); } return(result); diff --git a/libpgmodeler_ui/res/icones/connserver.png b/libpgmodeler_ui/res/icones/connserver.png new file mode 100644 index 0000000000000000000000000000000000000000..1d38e4f9c807e24f3c6ec1d169464bc4c77b5d01 GIT binary patch literal 847 zcmV-V1F-ywP)?uTqbzX*P&AH z*4EaZ`M#eU96)Q$=;$cx>+8N!>TMq1&Q$~|l?qo^S7cdcLMMtM%H^^V*T?|C{{Frx z6@Xf;_Ou270QlW@ZM@^NhGk8J}N&E|`K>o!26(Ri68$t&O+rPT9}^98_;qNqoHOc72`Pk-BLwcal+E&Xa)Rw^Q? zZQFl3j`O?YIQzDUsDp!pqUU*85CmE&rIRF4TI*t(rta3()}7GM!2zbGrqt2V(fIuQ zyzRPfQY;p`p68Ke*%#N>*MY5+l3K0S5s@rOl7fghmSx#WDa*1fH8L^+fQa-&+wC@I zXJ>tbx~|K_!~_5*Cnut{zS`K>P$E(g5gSO0#o~3LP>5`R-QC>}z=wy#!Z7>+;PmvA z^Ye2ml?tU&3E%e_8ymaF?{qq(Y1;cfK0bc$d0uUAZ|{$X^o_gV^74||*;!hx)`Nlj zVR?D^&7gH-1LNc4v|2677sqjo zgFec@9Yh4BRIe!8?KV*qk!4wLUMWSXR5H>tK8QpF5uwxRpp?2dYOS#>%jnkh*#>}t z<3C&W$qd|~+wEdm*1&NX3~fMb-P`hh<5L>AcL8{Wfv<*g^a;KW!!Y+T(hp%63h)x> z+oO4HSOBQk>z|W^!+-}+-rea--~}+sfGql;3)})1z=Qt*69aq<{+!_pwhKhS4bZnQ Z{{n0Bt;F1FCQ$$Y002ovPDHLkV1l6;naKbE literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/icones/server.png b/libpgmodeler_ui/res/icones/server.png index 1d38e4f9c807e24f3c6ec1d169464bc4c77b5d01..6c9321da5e431efbe8658459194e24c069acdc89 100644 GIT binary patch delta 1561 zcmV+!2Il$C2C58@B!32COGiWi{{a60|De66lK=n!32;bRa{vGf6951U69E94oEQKA z00(qQO+^Re1QrqqAxGqZM*si?w@E}nR9M61muqYsR~5&9cXnrA_O9*3!CrU0u3a}y zOq^g#frOO67bJ=*1>t@}afH&S5|t4kkP?(gK;aWogj5kBA%6uV3nU&9e1Mi$TH@Aj zq9!qEYA3i(?Rf2YsD{PMD@?J~J{h^6JCR z?fZZK!}or1Ux4A^;a=BucLPrdAsW~2hk&rI>kk#--DQ)3z5P6Ou!CZ$jA>b{7F}*F z6o@oE&VSanR;8mw-LbbnJ<`*ad{H>Jey^%(Syk2dR8<`fODV{gqG}9bkibIDd71w zpB(5By;{YZ0>1CFyEnUS z|G}^KZDQyqC3{pxmk8R^;zkmHJ(Z)3GkME#r`_xB6_(6bWyBJ!L0|Prz z6osDdPCU=!Zx`M~RV2%$ia-X>0@rH>$Y!%-vsnNODFWD(@|oDSs#0 z38cjHd_2u%zvm$o1*F6<3^J|FT$sI0$!owh=FANNyuS)8%Oa6T;5rVv(ukv|d~|yk zy-!O1Gj-SdNEjJLK=Kkbh1oyz<67 zMBUV#E0bg2skIr!9t2P<7TLSIiQoPCEi!$*EH5uJdU=W&qXj?E@jM^t+61=2O}z|O z5#h%x7vK2HkLPDza{v`^*8^yJ|Dvz2??dNwI?eq2JkN&0{PFzTyy` zr0*hKn>tmZs&(?(z7hK7c64|-@>7KUM9nkJ?NiH0X= zPG=Ee6)6SMF)6REF3ryT^UAI1SAXsM?jmppSOBWE0Bivs15#@tyPt*DB9#K_fw&MN z5(>o>&od2R5tsu?Kml0U=;ky9G}gFe#hR{Ezy&Hm5pW*#!oL7lrV`Ty&K3p+00000 LNkvXXu0mjf^+oq- delta 824 zcmV-81IPTT49^CTB!2{RLP=Bz2nYy#2xN!=00Ra|L_t(oh3%KmOC(1W$3NB6J^f>& zEO7{iotaAx>LLqz$nGDJ+Z=;EL=n79@Q{Ooo;?HxA>h%AXEFc4=HNk=J&Xu~dkTsM z4;~~kO;1g?{c>3+VRfc!Tysjkm!hk_eBbvK?^Rd9e;vw{xPQ2~__NmfClju1+dpn^ zZ~yXmTc2QIVPS4%Wu<+4dn*P&AH*4EaZ`M#eU96)Q$=;$cx>+8N!>TMq1&Q$~| zl?qo^S7cdcLVqWUBFg2m5!c87!2bTeDHVWPt@gAA0OPDKE-s8Ub8Fz=#!x#jOlD7R zU}k0p&-0A9N*SMT<^~QA4~<3P|04Vwo12^On$6~me(N?sqtSSoB*`n_8>Q6qkMjk< zj-seXeoPTgPfvf_YPH@kEiL_OSyn0{scqYTI*#+Z<9|5&wuq>MgM*^yd07wyS}CQI zBvD%HVw$Gz*4EaY(9ppFrlzLU(b3WP{QSJ_x^7Y|7Q3G3k!9Hz*Vos9t(1~lt=18d zEJ>1rh&YyI*-9zPvMe<+G6H~z^hDe3HfLvNeS^BL%f!S404FCWqP4!-*w|1aQVtK8QpF5uwxRpp?2dYOS#>%jnkh*#>}t<3C&W$qd|~+wEdm*1&NX3~fMb-P`hh z<5L>AcL8{Wfv<*g^a;KW!!Y+T(hp%63h)x>+oO4HSOBQk>z|W^!+-}+-rea--~}+s zfH5rkpbOjr7r=x60TTm!4E~(q3$_bHzzxv1FaH8-@~y<&Y9>(t0000n@b2q$=#lM>fWr- zp3CATl(H!lTD8HFLx{GRfHA~YyHSbhCez)GNwX%K{l7c2GdQ~1dGLj&1PfQ0083g zI4vzL7>2PaFG&)SNaT&4cu4@$G?|;5!!$Rav=9PCQFa%=G|iH`|Mvt0R;z_4Paf?a zfDnRcG|K+{`!_)pizX8jQ%p>Z0fLWvde#IOmFlVV_4S0T)On#`drt`9~vAS{5}?oogNw*8s8DX`Sa)ZRaaMgbX~8LW!XA4HO0}R zM==b8LZLu(Ax_t^gA82#8lTTcDwRSA@yfOJ^z=wGGc#jDLqlRm0Diy!r$V7{Q<5Yx zGBT3Aa^*_Ds;Vq5F5>YVVDG*?v^F*Fnx4w=@URAGFDGNM7?LC*%YsZn=kBA(uIX9Q zg08MEip3(iypFExgq91trf11n>-R59GQ+_%r#cnFuhBCY{DaZaTbQOnPfyS4PMTNQ zLX^wpu-P40%{-}ermUXfaD=+LdIEvKda7=@+ z4=S=ld9~U}csw2yMZq*pnws3GkyXO;%O&+x=O0yM$5w!WHO1@ z>vfjWvr;=Y0l3}nVjvLMyS2&zlGp2fT29YO?AY{nX=%v-VlT$F^sKabNjq`&KRpG* z!3=wC+J+rM2u#!57`ko{U0CDCq5FiFWInoZ)pP9q&#Jd&LAlU0jZi2=CX*!>NidzW zQ?7Y6w;iCtZKwChK|-q%%d6RWJ^t40&n?+Ohb1*@u~^3ae*fH#03=Dm<#N&7+)UAk zqFG%mJ`b0)Ba=>(H5AfHJyvU)Ci^Pyo;-1=(PjNy7}^(>YGcOl_s>Z?S-icyozBiq zIy*Z#a=4A?+%sfZMpacNCnt%=6B~9cJo}r*rdC`vPORj~rW51~8t=UAk#3FucCNeI zdkANb62BwfH=4Ake1^`ef6sWDOMPB)fyM6^mdHu&*5krazek|!QgnX)@z^ildR_V&&uJ00000NkvXXu0mjf+VqT7 literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/resources.qrc b/libpgmodeler_ui/res/resources.qrc index ac0c5f7d5e..0778c2d7c4 100644 --- a/libpgmodeler_ui/res/resources.qrc +++ b/libpgmodeler_ui/res/resources.qrc @@ -255,6 +255,8 @@ icones/movetolayer.png icones/foreigndatawrapper_grp.png icones/foreigndatawrapper.png + icones/connserver.png + icones/server_grp.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 726de560ff..c428075516 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -81,7 +81,7 @@ void ConnectionsConfigWidget::updateConnectionsCombo(void) connections_cmb->clear(); for(auto &conn : connections) - connections_cmb->addItem(QIcon(QString(":icones/icones/server.png")), conn->getConnectionId()); + connections_cmb->addItem(QIcon(PgModelerUiNs::getIconPath("connserver")), conn->getConnectionId()); } void ConnectionsConfigWidget::destroyConnections(void) @@ -576,7 +576,7 @@ void ConnectionsConfigWidget::fillConnectionsComboBox(QComboBox *combo, bool inc for(auto &itr : connections) { - combo->addItem(QIcon(QString(":icones/icones/server.png")), itr.first, QVariant::fromValue(itr.second)); + combo->addItem(QIcon(PgModelerUiNs::getIconPath("connserver")), itr.first, QVariant::fromValue(itr.second)); if(!def_conn && itr.second->isDefaultForOperation(check_def_for)) def_conn=itr.second; diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 780bd2c407..174992db7a 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -997,7 +997,7 @@ void DatabaseExplorerWidget::listObjects(void) curr_root = objects_trw->topLevelItem(0); objects_trw->takeTopLevelItem(0); root->setText(0, connection.getConnectionId(true)); - root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("server"))); + root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("connserver"))); root->setData(DatabaseImportForm::ObjectId, Qt::UserRole, -1); root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, enum_cast(ObjectType::BaseObject)); root->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index f44a2bf888..4b38f4fad6 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -468,7 +468,7 @@ void ModelObjectsWidget::updateSchemaTree(QTreeWidgetItem *root) QFont font; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr, *item3=nullptr; vector types = BaseObject::getChildObjectTypes(ObjectType::Schema); - int count, count2, i; + int count = 0, count2 = 0, i = 0; QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::Schema)) + QString("_grp"))); //Removing the ObjectType::Table and ObjectType::View types since they are handled separetedly @@ -609,8 +609,8 @@ void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schem View *view=nullptr; QTreeWidgetItem *item=nullptr, *item1=nullptr, *item2=nullptr; QFont font; - ObjectType types[]={ ObjectType::Rule, ObjectType::Trigger, ObjectType::Index }; - int count, count1, type_cnt=sizeof(types)/sizeof(ObjectType), i, i1, i2; + vector types = BaseObject::getChildObjectTypes(ObjectType::View); + int count = 0, count1 = 0, i = 0, i2 = 0; QPixmap group_icon=QPixmap(PgModelerUiNs::getIconPath(QString(BaseObject::getSchemaName(ObjectType::View)) + QString("_grp"))); try @@ -621,8 +621,7 @@ void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schem //Create a table group item item=new QTreeWidgetItem(root); item->setIcon(0,group_icon); - item->setText(0,BaseObject::getTypeName(ObjectType::View) + - QString(" (%1)").arg(obj_list.size())); + item->setText(0,BaseObject::getTypeName(ObjectType::View) + QString(" (%1)").arg(obj_list.size())); item->setData(1, Qt::UserRole, QVariant(enum_cast(ObjectType::View))); font=item->font(0); @@ -630,29 +629,29 @@ void ModelObjectsWidget::updateViewTree(QTreeWidgetItem *root, BaseObject *schem item->setFont(0, font); count=obj_list.size(); + for(i=0; i < count; i++) { view=dynamic_cast(obj_list[i]); item1=createItemForObject(view, item); //Creating the group for the child objects (rules, triggers) - for(i1=0; i1 < type_cnt; i1++) + for(auto &type : types) { - if(visible_objs_map[types[i1]]) + if(visible_objs_map[type]) { item2=new QTreeWidgetItem(item1); - item2->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(types[i1]) + QString("_grp")))); + item2->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(type) + QString("_grp")))); font=item2->font(0); font.setItalic(true); item2->setFont(0, font); - count1=view->getObjectCount(types[i1]); - item2->setText(0,BaseObject::getTypeName(types[i1]) + - QString(" (%1)").arg(count1)); + count1 = view->getObjectCount(type); + item2->setText(0,BaseObject::getTypeName(type) + QString(" (%1)").arg(count1)); for(i2=0; i2 < count1; i2++) { - object=view->getObject(i2,types[i1]); + object=view->getObject(i2, type); createItemForObject(object, item2); } } @@ -707,12 +706,14 @@ void ModelObjectsWidget::updateDatabaseTree(void) QTreeWidgetItem *root=nullptr,*item1=nullptr, *item2=nullptr; QFont font; vector ref_list, tree_state, obj_list; - ObjectType types[]={ ObjectType::Role, ObjectType::Tablespace, - ObjectType::Language, ObjectType::Cast, ObjectType::Textbox, - ObjectType::Relationship, ObjectType::EventTrigger, - ObjectType::Tag, ObjectType::GenericSql, ObjectType::Extension, - ObjectType::ForeignDataWrapper }; - unsigned count, i, i1, type_cnt=sizeof(types)/sizeof(ObjectType); + vector types = BaseObject::getChildObjectTypes(ObjectType::Database); + unsigned count = 0, i = 0, i1 = 0; + + types.push_back(ObjectType::Tag); + types.push_back(ObjectType::GenericSql); + types.push_back(ObjectType::Textbox); + types.push_back(ObjectType::Relationship); + types.erase(std::find(types.begin(), types.end(), ObjectType::Schema)); try { @@ -729,20 +730,20 @@ void ModelObjectsWidget::updateDatabaseTree(void) updateSchemaTree(root); - for(i=0; i < type_cnt; i++) + for(auto &type : types) { - if(visible_objs_map[types[i]]) + if(visible_objs_map[type]) { item1=new QTreeWidgetItem(root); - str_aux=QString(BaseObject::getSchemaName(types[i])); + str_aux=QString(BaseObject::getSchemaName(type)); item1->setIcon(0,QPixmap(PgModelerUiNs::getIconPath(str_aux + QString("_grp")))); - item1->setData(1, Qt::UserRole, QVariant(enum_cast(types[i]))); + item1->setData(1, Qt::UserRole, QVariant(enum_cast(type))); - obj_list=(*db_model->getObjectList(types[i])); + obj_list=(*db_model->getObjectList(type)); //Special case for relationship, merging the base relationship list to the relationship list - if(types[i]==ObjectType::Relationship) + if(type==ObjectType::Relationship) { vector obj_list_aux; obj_list_aux=(*db_model->getObjectList(ObjectType::BaseRelationship)); @@ -750,8 +751,7 @@ void ModelObjectsWidget::updateDatabaseTree(void) } count=obj_list.size(); - item1->setText(0,BaseObject::getTypeName(types[i]) + - QString(" (%1)").arg(count)); + item1->setText(0,BaseObject::getTypeName(type) + QString(" (%1)").arg(count)); font=item1->font(0); font.setItalic(true); item1->setFont(0, font); diff --git a/schemas/catalog/server.sch b/schemas/catalog/server.sch index 351ab517fe..88206f3fbe 100644 --- a/schemas/catalog/server.sch +++ b/schemas/catalog/server.sch @@ -1,26 +1,58 @@ -# Catalog queries for server attributes +# Catalog queries for foreign server # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -[SELECT name AS attribute, setting AS value FROM pg_settings WHERE name -IN ( - 'client_encoding', - 'config_file', - 'data_directory', - 'dynamic_library_path', - 'dynamic_shared_memory_type', - 'hba_file', - 'lc_collate', - 'lc_ctype', - 'listen_addresses', - 'max_connections', - 'port', - 'server_encoding', - 'ssl', - 'ssl_ca_file', - 'ssl_cert_file', - 'ssl_crl_file', - 'ssl_key_file', - 'password_encryption', - 'ident_file' -);] +%if {list} %then + [ SELECT sv.oid, srvname AS name FROM pg_foreign_server AS sv ] + + %if {last-sys-oid} %or {not-ext-object} %then + [ WHERE ] + + %if {last-sys-oid} %then + [ sv.oid ] {oid-filter-op} $sp {last-sys-oid} + %end + + %if {not-ext-object} %then + + %if {last-sys-oid} %then + [ AND ] + %end + + ( {not-ext-object} ) + %end + %end +%else + %if {attribs} %then + [SELECT oid, srvname AS name, srvversion AS version, srvtype AS type, + srvfdw AS foreigndatawrapper, srvacl AS permission, srvowner AS owner, + srvoptions AS options, ] + + ({comment}) [ AS comment ] + + [ FROM pg_foreign_server AS sv ] + + %if {last-sys-oid} %then + [ WHERE oid ] {oid-filter-op} $sp {last-sys-oid} + %end + + %if {not-ext-object} %then + %if {last-sys-oid} %then + [ AND ] + %else + [ WHERE ] + %end + + ( {not-ext-object} ) + %end + + %if {filter-oids} %then + %if {last-sys-oid} %or {not-ext-object} %then + [ AND ] + %else + [ WHERE ] + %end + + [ oid IN (] {filter-oids} ) + %end + %end +%end diff --git a/tests/src/servertest/servertest.cpp b/tests/src/servertest/servertest.cpp index 6c4c702438..730af34221 100644 --- a/tests/src/servertest/servertest.cpp +++ b/tests/src/servertest/servertest.cpp @@ -125,12 +125,11 @@ void ServerTest::modelReturnsDepsAndRefsForServer(void) void ServerTest::modelCreatesServerfromXMLandResultingXMLisEqual(void) { - /*DatabaseModel model; + DatabaseModel model; Role owner; Schema public_sch; - Language lang; - Function func_handler, func_validator; - ForeignDataWrapper *fdw = nullptr; + ForeignDataWrapper fdw; + Server *server = nullptr; QString xml_code, res_xml_code; try @@ -141,56 +140,38 @@ void ServerTest::modelCreatesServerfromXMLandResultingXMLisEqual(void) model.addSchema(&public_sch); model.addRole(&owner); - func_handler.setName("func_handler"); - func_handler.setReturnType(PgSqlType("fdw_handler")); - func_handler.setSchema(&public_sch); - func_handler.setSourceCode("foo"); - func_handler.setOwner(&owner); - func_handler.setLanguage(&lang); - - func_validator.setName("func_validator"); - func_validator.addParameter(Parameter("param1", PgSqlType("text", 1))); - func_validator.addParameter(Parameter("param2", PgSqlType("oid"))); - func_validator.setSchema(&public_sch); - func_validator.setSourceCode("foo"); - func_validator.setOwner(&owner); - func_validator.setLanguage(&lang); - - model.addFunction(&func_handler); - model.addFunction(&func_validator); - - xml_code=QString(" \ + fdw.setName("fdw"); + model.addForeignDataWrapper(&fdw); + + xml_code=QString(" \ \ - \ - \ - \ -").replace("#", ForeignDataWrapper::OptionValueSeparator) - .replace("*", ForeignDataWrapper::OptionsSeparator); + \ + \ +").replace("#", ForeignDataWrapper::OptionValueSeparator) + .replace("*", ForeignDataWrapper::OptionsSeparator); model.getXMLParser()->loadXMLBuffer(xml_code); - fdw = dynamic_cast(model.createObject(ObjectType::ForeignDataWrapper)); + server = dynamic_cast(model.createObject(ObjectType::Server)); - model.removeForeignDataWrapper(fdw); - model.removeFunction(&func_handler); - model.removeFunction(&func_validator); - model.removeLanguage(&lang); - model.removeSchema(&public_sch); - model.removeRole(&owner); - - QVERIFY(fdw != nullptr); + QVERIFY(server != nullptr); - res_xml_code = fdw->getCodeDefinition(SchemaParser::XmlDefinition).simplified(); + res_xml_code = server->getCodeDefinition(SchemaParser::XmlDefinition).simplified(); xml_code = xml_code.simplified(); - if(fdw) - delete(fdw); + model.removeServer(server); + model.removeForeignDataWrapper(&fdw); + model.removeSchema(&public_sch); + model.removeRole(&owner); + + if(server) + delete(server); QCOMPARE(xml_code, res_xml_code); } catch (Exception &e) { QFAIL(e.getErrorMessage().toStdString().c_str()); - } */ + } } QTEST_MAIN(ServerTest) From b2ab427b87c287d220e0878652931a9d9da49a85 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 22 Apr 2019 17:26:20 -0300 Subject: [PATCH 320/425] Finished the reverse engineering of server object --- conf/defaults/sql-highlight.conf | 1 + conf/sql-highlight.conf | 1 + libpgmodeler/src/permission.cpp | 12 ++++++---- .../src/databaseexplorerwidget.cpp | 5 +++-- libpgmodeler_ui/src/databaseimporthelper.cpp | 22 +++++++++++++++++++ libpgmodeler_ui/src/databaseimporthelper.h | 1 + schemas/catalog/server.sch | 2 +- schemas/sql/extension.sch | 6 ++--- schemas/sql/foreigndatawrapper.sch | 6 ++--- schemas/sql/language.sch | 4 ++-- schemas/sql/server.sch | 5 ++--- schemas/xml/dtd/permission.dtd | 2 +- 12 files changed, 48 insertions(+), 19 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index 729c7a23f9..86e29d1967 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -338,6 +338,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index 729c7a23f9..86e29d1967 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -338,6 +338,7 @@ + diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index dbb938a961..1082a406f3 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -427,12 +427,16 @@ QString Permission::getCodeDefinition(unsigned def_type) if(def_type==SchemaParser::SqlDefinition) { - //Views and Tables uses the same key word when setting permission (TABLE) - attributes[Attributes::Type]= - (object->getObjectType()==ObjectType::View ? BaseObject::getSQLName(ObjectType::Table): BaseObject::getSQLName(object->getObjectType())); + if(obj_type == ObjectType::View) + //Views and Tables uses the same key word when setting permission (TABLE) + attributes[Attributes::Type] = BaseObject::getSQLName(ObjectType::Table); + else if(obj_type == ObjectType::Server) + attributes[Attributes::Type] = QString("FOREIGN ") + object->getSQLName(); + else + attributes[Attributes::Type] = BaseObject::getSQLName(obj_type); } else - attributes[Attributes::Type]=BaseObject::getSchemaName(object->getObjectType()); + attributes[Attributes::Type]=BaseObject::getSchemaName(obj_type); if(obj_type==ObjectType::Column) { diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 174992db7a..a3d08fc537 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -1829,8 +1829,9 @@ void DatabaseExplorerWidget::loadObjectSource(void) dbmodel.createSystemObjects(false); import_hlp.setConnection(connection); import_hlp.setCurrentDatabase(connection.getConnectionParam(Connection::ParamDbName)); - import_hlp.setImportOptions(toggle_disp_menu.actions().at(0)->isChecked(), - toggle_disp_menu.actions().at(1)->isChecked(), + + import_hlp.setImportOptions(show_sys_objs->isChecked(), + show_ext_objs->isChecked(), true, false, false, false, false); import_hlp.setSelectedOIDs(&dbmodel, {{ObjectType::Database, {db_oid}}, {obj_type,{oid}}}, {}); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index d0d36ef074..1fbf7ba484 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -735,6 +735,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) case ObjectType::Policy: createPolicy(attribs); break; case ObjectType::EventTrigger: createEventTrigger(attribs); break; case ObjectType::ForeignDataWrapper: createForeignDataWrapper(attribs); break; + case ObjectType::Server: createServer(attribs); break; default: if(debug_mode) @@ -2326,6 +2327,27 @@ void DatabaseImportHelper::createForeignDataWrapper(attribs_map &attribs) } } +void DatabaseImportHelper::createServer(attribs_map &attribs) +{ + Server *server=nullptr; + + try + { + attribs[Attributes::Fdw] = getDependencyObject(attribs[Attributes::Fdw], ObjectType::ForeignDataWrapper, true , true, true); + attribs[Attributes::Options] = Catalog::parseArrayValues(attribs[Attributes::Options]).join(ForeignDataWrapper::OptionsSeparator); + + loadObjectXML(ObjectType::Server, attribs); + server = dbmodel->createServer(); + dbmodel->addServer(server); + } + catch(Exception &e) + { + if(server) delete(server); + throw Exception(e.getErrorMessage(), e.getErrorCode(), + __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); + } +} + void DatabaseImportHelper::createPermission(attribs_map &attribs) { ObjectType obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 9dcd29411a..75555dba55 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -161,6 +161,7 @@ class DatabaseImportHelper: public QObject { void createPermission(attribs_map &attribs); void createEventTrigger(attribs_map &attribs); void createForeignDataWrapper(attribs_map &attribs); + void createServer(attribs_map &attribs); void __createTableInheritances(void); void createTableInheritances(void); void createTablePartitionings(void); diff --git a/schemas/catalog/server.sch b/schemas/catalog/server.sch index 88206f3fbe..58d00b63be 100644 --- a/schemas/catalog/server.sch +++ b/schemas/catalog/server.sch @@ -24,7 +24,7 @@ %else %if {attribs} %then [SELECT oid, srvname AS name, srvversion AS version, srvtype AS type, - srvfdw AS foreigndatawrapper, srvacl AS permission, srvowner AS owner, + srvfdw AS fdw, srvacl AS permission, srvowner AS owner, srvoptions AS options, ] ({comment}) [ AS comment ] diff --git a/schemas/sql/extension.sch b/schemas/sql/extension.sch index 1e52d1e769..78f374385d 100644 --- a/schemas/sql/extension.sch +++ b/schemas/sql/extension.sch @@ -16,15 +16,15 @@ [CREATE EXTENSION ] {name} $br %if {schema} %then - [ WITH SCHEMA ] {schema} + [WITH SCHEMA ] {schema} %end %if {cur-version} %then - $br [ VERSION ] '{cur-version}' + $br [VERSION ] '{cur-version}' %end %if {old-version} %then - $br [ FROM ] '{old-version}' + $br [FROM ] '{old-version}' %end ; $br diff --git a/schemas/sql/foreigndatawrapper.sch b/schemas/sql/foreigndatawrapper.sch index cf8dd26327..a65d7e6a38 100644 --- a/schemas/sql/foreigndatawrapper.sch +++ b/schemas/sql/foreigndatawrapper.sch @@ -13,7 +13,7 @@ [CREATE ] {sql-object} $sp {name} %if ({pgsql-ver} >=f "9.1") %then - $br $tb + $br %if %not {handler} %then [NO HANDLER] @@ -22,7 +22,7 @@ %end %end -$br $tb +$br %if %not {validator} %then [NO VALIDATOR] @@ -31,7 +31,7 @@ $br $tb %end %if {options} %then - $br $tb [OPTIONS (] {options} ) + $br [OPTIONS (] {options} ) %end ; diff --git a/schemas/sql/language.sch b/schemas/sql/language.sch index a61bbb534b..ec73098679 100644 --- a/schemas/sql/language.sch +++ b/schemas/sql/language.sch @@ -24,11 +24,11 @@ %end %if {validator} %then - $br $tb [VALIDATOR ] {validator} + $br [VALIDATOR ] {validator} %end %if {inline} %then - $br $tb [INLINE ] {inline} + $br [INLINE ] {inline} %end ; $br diff --git a/schemas/sql/server.sch b/schemas/sql/server.sch index f043ccb0db..b9285fb1e1 100644 --- a/schemas/sql/server.sch +++ b/schemas/sql/server.sch @@ -12,7 +12,6 @@ %end [CREATE SERVER ] {name} -$br $tb %if {type} %then [ TYPE ] '{type}' @@ -22,10 +21,10 @@ $br $tb [ VERSION ] '{version}' %end -$br $tb [FOREIGN DATA WRAPPER ] {fdw} +$br [FOREIGN DATA WRAPPER ] {fdw} %if {options} %then - $br $tb [OPTIONS (] {options} ) + $br [OPTIONS (] {options} ) %end ; diff --git a/schemas/xml/dtd/permission.dtd b/schemas/xml/dtd/permission.dtd index f7db5da3d0..2a9aed9632 100644 --- a/schemas/xml/dtd/permission.dtd +++ b/schemas/xml/dtd/permission.dtd @@ -25,6 +25,6 @@ - + From 0f34ac2fb8d81c430c5bad9462eb53c47786afba Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 22 Apr 2019 17:32:15 -0300 Subject: [PATCH 321/425] Formatting server objects' attributes on DatabaseExplorerWidget --- libpgmodeler_ui/src/databaseexplorerwidget.cpp | 10 +++++++++- libpgmodeler_ui/src/databaseexplorerwidget.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index a3d08fc537..58a6e8f0c2 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -130,7 +130,8 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::TuplesIns, QT_TR_NOOP("Tuples inserted")}, {Attributes::IsPartitioned, QT_TR_NOOP("Partitioned")}, {Attributes::PartitionedTable, QT_TR_NOOP("Partition of")}, {Attributes::PartitionBoundExpr, QT_TR_NOOP("Partition bound expr.")}, {Attributes::DeadRowsAmount, QT_TR_NOOP("Dead rows amount")}, {Attributes::PartitionKey, QT_TR_NOOP("Partition keys")}, - {Attributes::Partitioning, QT_TR_NOOP("Partitioning")}, {Attributes::Options, QT_TR_NOOP("Options")} + {Attributes::Partitioning, QT_TR_NOOP("Partitioning")}, {Attributes::Options, QT_TR_NOOP("Options")}, + {Attributes::Fdw, QT_TR_NOOP("Foreign data wrapper")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) @@ -344,6 +345,7 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) case ObjectType::Index: formatIndexAttribs(attribs); break; case ObjectType::Policy: formatPolicyAttribs(attribs); break; case ObjectType::ForeignDataWrapper: formatForeignDataWrapperAttribs(attribs); break; + case ObjectType::Server: formatServerAttribs(attribs); break; default: break; } } @@ -829,6 +831,12 @@ void DatabaseExplorerWidget::formatForeignDataWrapperAttribs(attribs_map &attrib formatOidAttribs(attribs, { Attributes::ValidatorFunc, Attributes::HandlerFunc }, ObjectType::Function, false); } +void DatabaseExplorerWidget::formatServerAttribs(attribs_map &attribs) +{ + attribs[Attributes::Options]=Catalog::parseArrayValues(attribs[Attributes::Options]).join(ElemSeparator); + formatOidAttribs(attribs, { Attributes::Fdw }, ObjectType::ForeignDataWrapper, false); +} + QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) { try diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.h b/libpgmodeler_ui/src/databaseexplorerwidget.h index c236d74a16..01c6286b18 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.h +++ b/libpgmodeler_ui/src/databaseexplorerwidget.h @@ -133,6 +133,7 @@ class DatabaseExplorerWidget: public QWidget, public Ui::DatabaseExplorerWidget void formatIndexAttribs(attribs_map &attribs); void formatPolicyAttribs(attribs_map &attribs); void formatForeignDataWrapperAttribs(attribs_map &attribs); + void formatServerAttribs(attribs_map &attribs); void handleSelectedSnippet(const QString &snip_id); //! \brief Extract an attribute map containing the basic attributes for drop/rename commands From 1fe5f9729ed858bb4e943ded2920320c37c70360 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Apr 2019 11:22:15 -0300 Subject: [PATCH 322/425] Fixed a bug that was causing tables not to be moved on the canvas using mouse --- libpgmodeler/src/baseobject.h | 6 +++--- libpgmodeler_ui/src/modelwidget.cpp | 7 ++++--- schemas/catalog/serverinfo.sch | 26 ++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 schemas/catalog/serverinfo.sch diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index f42b2fdf00..90a0e34f80 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -73,8 +73,8 @@ enum class ObjectType: unsigned { Tag, GenericSql, BaseRelationship, - BaseTable, - BaseObject + BaseObject, + BaseTable }; class BaseObject { @@ -108,7 +108,7 @@ class BaseObject { unsigned object_id; //! \brief Objects type count declared on enum ObjectType - static constexpr unsigned ObjectTypeCount=enum_cast(ObjectType::BaseObject) + 1; + static constexpr unsigned ObjectTypeCount=enum_cast(ObjectType::BaseTable) + 1; /*! \brief Indicates whether the object is protected or not. A protected object indicates that it can not suffer changes in position diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 8fa8255288..848ad26191 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -798,7 +798,7 @@ void ModelWidget::handleObjectAddition(BaseObject *object) case ObjectType::Relationship: case ObjectType::BaseRelationship: - item=new RelationshipView(dynamic_cast(graph_obj)); break; + item=new RelationshipView(dynamic_cast(graph_obj)); break; case ObjectType::Schema: @@ -810,7 +810,7 @@ void ModelWidget::handleObjectAddition(BaseObject *object) break; default: - item=new StyledTextboxView(dynamic_cast(graph_obj)); break; + item=new StyledTextboxView(dynamic_cast(graph_obj)); break; } @@ -2601,7 +2601,8 @@ void ModelWidget::pasteObjects(bool duplicate_mode) while(itr!=itr_end) { - object=(*itr); + object = (*itr); + obj_type = object->getObjectType(); itr++; if(orig_obj_names[object].count() && obj_type!=ObjectType::Cast) diff --git a/schemas/catalog/serverinfo.sch b/schemas/catalog/serverinfo.sch new file mode 100644 index 0000000000..351ab517fe --- /dev/null +++ b/schemas/catalog/serverinfo.sch @@ -0,0 +1,26 @@ +# Catalog queries for server attributes +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[SELECT name AS attribute, setting AS value FROM pg_settings WHERE name +IN ( + 'client_encoding', + 'config_file', + 'data_directory', + 'dynamic_library_path', + 'dynamic_shared_memory_type', + 'hba_file', + 'lc_collate', + 'lc_ctype', + 'listen_addresses', + 'max_connections', + 'port', + 'server_encoding', + 'ssl', + 'ssl_ca_file', + 'ssl_cert_file', + 'ssl_crl_file', + 'ssl_key_file', + 'password_encryption', + 'ident_file' +);] From 85abb14447b136795ffb3dcccc7c760177866f4a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 23 Apr 2019 17:45:26 -0300 Subject: [PATCH 323/425] Renamed the class Server to ForeignServer Added a form to handle foreign server --- libpgconnector/src/catalog.cpp | 6 +- libpgmodeler/libpgmodeler.pro | 8 +- libpgmodeler/src/baseobject.cpp | 10 +- libpgmodeler/src/baseobject.h | 2 +- libpgmodeler/src/databasemodel.cpp | 36 +++--- libpgmodeler/src/databasemodel.h | 12 +- .../src/{server.cpp => foreignserver.cpp} | 20 ++-- .../src/{server.h => foreignserver.h} | 8 +- libpgmodeler/src/permission.cpp | 6 +- libpgmodeler_ui/libpgmodeler_ui.pro | 9 +- libpgmodeler_ui/res/icones/connserver.png | Bin 847 -> 0 bytes libpgmodeler_ui/res/icones/foreignserver.png | Bin 0 -> 1578 bytes .../{server_grp.png => foreignserver_grp.png} | Bin libpgmodeler_ui/res/icones/server.png | Bin 1578 -> 847 bytes libpgmodeler_ui/res/resources.qrc | 4 +- .../src/connectionsconfigwidget.cpp | 4 +- .../src/databaseexplorerwidget.cpp | 4 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 6 +- libpgmodeler_ui/src/foreignserverwidget.cpp | 109 ++++++++++++++++++ libpgmodeler_ui/src/foreignserverwidget.h | 48 ++++++++ libpgmodeler_ui/src/modelwidget.cpp | 3 + libpgmodeler_ui/ui/foreignserverwidget.ui | 71 ++++++++++++ schemas/catalog/foreignserver.sch | 58 ++++++++++ schemas/catalog/server.sch | 78 ++++--------- schemas/catalog/serverinfo.sch | 26 ----- schemas/sql/{server.sch => foreignserver.sch} | 0 schemas/xml/dtd/foreignserver.dtd | 11 ++ schemas/xml/dtd/server.dtd | 11 -- schemas/xml/{server.sch => foreignserver.sch} | 0 tests/src/servertest/servertest.cpp | 12 +- 30 files changed, 398 insertions(+), 164 deletions(-) rename libpgmodeler/src/{server.cpp => foreignserver.cpp} (76%) rename libpgmodeler/src/{server.h => foreignserver.h} (92%) delete mode 100644 libpgmodeler_ui/res/icones/connserver.png create mode 100644 libpgmodeler_ui/res/icones/foreignserver.png rename libpgmodeler_ui/res/icones/{server_grp.png => foreignserver_grp.png} (100%) create mode 100644 libpgmodeler_ui/src/foreignserverwidget.cpp create mode 100644 libpgmodeler_ui/src/foreignserverwidget.h create mode 100644 libpgmodeler_ui/ui/foreignserverwidget.ui create mode 100644 schemas/catalog/foreignserver.sch delete mode 100644 schemas/catalog/serverinfo.sch rename schemas/sql/{server.sch => foreignserver.sch} (100%) create mode 100644 schemas/xml/dtd/foreignserver.dtd delete mode 100644 schemas/xml/dtd/server.dtd rename schemas/xml/{server.sch => foreignserver.sch} (100%) diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 289e633a0a..a74a6bfc6a 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -39,7 +39,7 @@ map Catalog::oid_fields= {ObjectType::Table, "tb.oid"}, {ObjectType::Column, "cl.oid"}, {ObjectType::Constraint, "cs.oid"}, {ObjectType::Rule, "rl.oid"}, {ObjectType::Trigger, "tg.oid"}, {ObjectType::Index, "id.indexrelid"}, {ObjectType::EventTrigger, "et.oid"}, {ObjectType::Policy, "pl.oid"}, {ObjectType::ForeignDataWrapper, "fw.oid"}, - {ObjectType::Server, "sv.oid"} + {ObjectType::ForeignServer, "sv.oid"} }; map Catalog::ext_oid_fields={ @@ -60,7 +60,7 @@ map Catalog::name_fields= {ObjectType::Table, "relname"}, {ObjectType::Column, "attname"}, {ObjectType::Constraint, "conname"}, {ObjectType::Rule, "rulename"}, {ObjectType::Trigger, "tgname"}, {ObjectType::Index, "relname"}, {ObjectType::EventTrigger, "evtname"}, {ObjectType::Policy, "polname"}, {ObjectType::ForeignDataWrapper, "fdwname"}, - {ObjectType::Server, "srvname"} + {ObjectType::ForeignServer, "srvname"} }; Catalog::Catalog(void) @@ -669,7 +669,7 @@ attribs_map Catalog::getServerAttributes(void) QString sql, attr_name; attribs_map tuple, attribs_aux; - loadCatalogQuery(QString("serverinfo")); + loadCatalogQuery(QString("server")); schparser.ignoreUnkownAttributes(true); schparser.ignoreEmptyAttributes(true); sql = schparser.getCodeDefinition(attribs).simplified(); diff --git a/libpgmodeler/libpgmodeler.pro b/libpgmodeler/libpgmodeler.pro index 61ac42c8ed..2cfa2fabdf 100644 --- a/libpgmodeler/libpgmodeler.pro +++ b/libpgmodeler/libpgmodeler.pro @@ -63,8 +63,8 @@ HEADERS += src/textbox.h \ src/policy.h \ src/partitionkey.h \ src/foreigndatawrapper.h \ - src/server.h \ - src/foreignobject.h + src/foreignobject.h \ + src/foreignserver.h SOURCES += src/textbox.cpp \ src/domain.cpp \ @@ -116,8 +116,8 @@ SOURCES += src/textbox.cpp \ src/policy.cpp \ src/partitionkey.cpp \ src/foreigndatawrapper.cpp \ - src/server.cpp \ - src/foreignobject.cpp + src/foreignobject.cpp \ + src/foreignserver.cpp unix|windows: LIBS += -L$$OUT_PWD/../libparsers/ -lparsers \ -L$$OUT_PWD/../libutils/ -lutils diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 4ebc3c7ae2..b8cd71c37b 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -33,7 +33,7 @@ const QString BaseObject::objs_schemas[BaseObject::ObjectTypeCount]={ "language", "usertype", "tablespace", "opfamily", "opclass", "database","collation", "extension", "eventtrigger", "policy", "foreigndatawrapper", - "server", "relationship", "textbox", "permission", "parameter", + "foreignserver", "relationship", "textbox", "permission", "parameter", "typeattribute", "tag", "genericsql", "relationship" }; @@ -47,7 +47,7 @@ const QString BaseObject::obj_type_names[BaseObject::ObjectTypeCount]={ QT_TR_NOOP("Operator Family"), QT_TR_NOOP("Operator Class"), QT_TR_NOOP("Database"), QT_TR_NOOP("Collation"), QT_TR_NOOP("Extension"), QT_TR_NOOP("Event Trigger"), QT_TR_NOOP("Policy"), QT_TR_NOOP("Foreign Data Wrapper"), - QT_TR_NOOP("Server"), QT_TR_NOOP("Relationship"), QT_TR_NOOP("Textbox"), QT_TR_NOOP("Permission"), + QT_TR_NOOP("Foreign Server"), QT_TR_NOOP("Relationship"), QT_TR_NOOP("Textbox"), QT_TR_NOOP("Permission"), QT_TR_NOOP("Parameter"), QT_TR_NOOP("Type Attribute"), QT_TR_NOOP("Tag"), QT_TR_NOOP("Generic SQL"), QT_TR_NOOP("Basic Relationship") }; @@ -405,7 +405,7 @@ bool BaseObject::acceptsOwner(ObjectType obj_type) obj_type==ObjectType::OpClass || obj_type==ObjectType::OpFamily || obj_type==ObjectType::Collation || obj_type==ObjectType::View || obj_type==ObjectType::EventTrigger || obj_type==ObjectType::ForeignDataWrapper || - obj_type==ObjectType::Server); + obj_type==ObjectType::ForeignServer); } bool BaseObject::acceptsOwner(void) @@ -944,7 +944,7 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector::iterator itr; @@ -973,7 +973,7 @@ vector BaseObject::getChildObjectTypes(ObjectType obj_type) if(obj_type==ObjectType::Database) return(vector()={ ObjectType::Cast, ObjectType::Role, ObjectType::Language, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Extension, - ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::Server }); + ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::ForeignServer }); if(obj_type==ObjectType::Schema) return(vector()={ ObjectType::Aggregate, ObjectType::Conversion, ObjectType::Collation, diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 90a0e34f80..0c7098f643 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -64,7 +64,7 @@ enum class ObjectType: unsigned { EventTrigger, Policy, ForeignDataWrapper, - Server, + ForeignServer, Relationship, Textbox, Permission, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 029f4ece15..e0f160fbf7 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -78,7 +78,7 @@ DatabaseModel::DatabaseModel(void) { ObjectType::EventTrigger, &eventtriggers }, { ObjectType::GenericSql, &genericsqls }, { ObjectType::ForeignDataWrapper, &fdata_wrappers }, - { ObjectType::Server, &servers } + { ObjectType::ForeignServer, &servers } }; } @@ -199,8 +199,8 @@ void DatabaseModel::addObject(BaseObject *object, int obj_idx) addGenericSQL(dynamic_cast(object)); else if(obj_type==ObjectType::ForeignDataWrapper) addForeignDataWrapper(dynamic_cast(object)); - else if(obj_type==ObjectType::Server) - addServer(dynamic_cast(object)); + else if(obj_type==ObjectType::ForeignServer) + addServer(dynamic_cast(object)); } catch(Exception &e) { @@ -269,8 +269,8 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) removeGenericSQL(dynamic_cast(object)); else if(obj_type==ObjectType::ForeignDataWrapper) removeForeignDataWrapper(dynamic_cast(object)); - else if(obj_type==ObjectType::Server) - removeServer(dynamic_cast(object)); + else if(obj_type==ObjectType::ForeignServer) + removeServer(dynamic_cast(object)); } catch(Exception &e) { @@ -1086,7 +1086,7 @@ ForeignDataWrapper *DatabaseModel::getForeignDataWrapper(const QString &name) return(dynamic_cast(getObject(name, ObjectType::ForeignDataWrapper))); } -void DatabaseModel::addServer(Server *server, int obj_idx) +void DatabaseModel::addServer(ForeignServer *server, int obj_idx) { try { @@ -1098,7 +1098,7 @@ void DatabaseModel::addServer(Server *server, int obj_idx) } } -void DatabaseModel::removeServer(Server *server, int obj_idx) +void DatabaseModel::removeServer(ForeignServer *server, int obj_idx) { try { @@ -1110,14 +1110,14 @@ void DatabaseModel::removeServer(Server *server, int obj_idx) } } -Server *DatabaseModel::getServer(unsigned obj_idx) +ForeignServer *DatabaseModel::getServer(unsigned obj_idx) { - return(dynamic_cast(getObject(obj_idx, ObjectType::Server))); + return(dynamic_cast(getObject(obj_idx, ObjectType::ForeignServer))); } -Server *DatabaseModel::getServer(const QString &name) +ForeignServer *DatabaseModel::getServer(const QString &name) { - return(dynamic_cast(getObject(name, ObjectType::Server))); + return(dynamic_cast(getObject(name, ObjectType::ForeignServer))); } void DatabaseModel::removeExtension(Extension *extension, int obj_idx) @@ -3316,7 +3316,7 @@ BaseObject *DatabaseModel::createObject(ObjectType obj_type) object=createPolicy(); else if(obj_type==ObjectType::ForeignDataWrapper) object=createForeignDataWrapper(); - else if(obj_type==ObjectType::Server) + else if(obj_type==ObjectType::ForeignServer) object=createServer(); } @@ -5965,17 +5965,17 @@ ForeignDataWrapper *DatabaseModel::createForeignDataWrapper(void) return(fdw); } -Server *DatabaseModel::createServer(void) +ForeignServer *DatabaseModel::createServer(void) { attribs_map attribs; - Server *server = nullptr; + ForeignServer *server = nullptr; BaseObject *fdw = nullptr; ObjectType obj_type; QStringList options, opt_val; try { - server = new Server; + server = new ForeignServer; xmlparser.getElementAttributes(attribs); setBasicAttributes(server); @@ -8201,9 +8201,9 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vectorgetValidatorFunction(), deps, inc_indirect_deps); } //** Getting the dependecies for server ** - else if(obj_type == ObjectType::Server) + else if(obj_type == ObjectType::ForeignServer) { - Server *server = dynamic_cast(object); + ForeignServer *server = dynamic_cast(object); getObjectDependecies(server->getForeignDataWrapper(), deps, inc_indirect_deps); } @@ -9419,7 +9419,7 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { - if(dynamic_cast(*itr)->getForeignDataWrapper() == fdw) + if(dynamic_cast(*itr)->getForeignDataWrapper() == fdw) { refer=true; refs.push_back(*itr); diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 0175d994a6..5a334d6972 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -55,7 +55,7 @@ Additionally, this class, saves, loads and generates the XML/SQL definition of a #include "eventtrigger.h" #include "genericsql.h" #include "foreigndatawrapper.h" -#include "server.h" +#include "foreignserver.h" #include #include @@ -500,10 +500,10 @@ class DatabaseModel: public QObject, public BaseObject { ForeignDataWrapper *getForeignDataWrapper(unsigned obj_idx); ForeignDataWrapper *getForeignDataWrapper(const QString &name); - void addServer(Server *server, int obj_idx=-1); - void removeServer(Server *server, int obj_idx=-1); - Server *getServer(unsigned obj_idx); - Server *getServer(const QString &name); + void addServer(ForeignServer *server, int obj_idx=-1); + void removeServer(ForeignServer *server, int obj_idx=-1); + ForeignServer *getServer(unsigned obj_idx); + ForeignServer *getServer(const QString &name); void addPermission(Permission *perm); void removePermission(Permission *perm); @@ -564,7 +564,7 @@ class DatabaseModel: public QObject, public BaseObject { EventTrigger *createEventTrigger(void); GenericSQL *createGenericSQL(void); ForeignDataWrapper *createForeignDataWrapper(void); - Server *createServer(void); + ForeignServer *createServer(void); //! \brief Update views that reference the provided table forcing the column name deduction and redraw of the former objects void updateViewsReferencingTable(Table *table); diff --git a/libpgmodeler/src/server.cpp b/libpgmodeler/src/foreignserver.cpp similarity index 76% rename from libpgmodeler/src/server.cpp rename to libpgmodeler/src/foreignserver.cpp index a29dc00692..0b8c1b0169 100644 --- a/libpgmodeler/src/server.cpp +++ b/libpgmodeler/src/foreignserver.cpp @@ -16,11 +16,11 @@ # Also, you can get the complete GNU General Public License at */ -#include "server.h" +#include "foreignserver.h" -Server::Server(void) : ForeignObject() +ForeignServer::ForeignServer(void) : ForeignObject() { - obj_type = ObjectType::Server; + obj_type = ObjectType::ForeignServer; fdata_wrapper = nullptr; attributes[Attributes::Options] = QString(); @@ -29,37 +29,37 @@ Server::Server(void) : ForeignObject() attributes[Attributes::Object] = QString(); } -void Server::setType(const QString &type) +void ForeignServer::setType(const QString &type) { this->type = type; } -void Server::setVersion(const QString &version) +void ForeignServer::setVersion(const QString &version) { this->version = version; } -void Server::setForeignDataWrapper(ForeignDataWrapper *fdw) +void ForeignServer::setForeignDataWrapper(ForeignDataWrapper *fdw) { fdata_wrapper = fdw; } -QString Server::getType(void) +QString ForeignServer::getType(void) { return(type); } -QString Server::getVersion(void) +QString ForeignServer::getVersion(void) { return(version); } -ForeignDataWrapper *Server::getForeignDataWrapper(void) +ForeignDataWrapper *ForeignServer::getForeignDataWrapper(void) { return(fdata_wrapper); } -QString Server::getCodeDefinition(unsigned def_type) +QString ForeignServer::getCodeDefinition(unsigned def_type) { QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); diff --git a/libpgmodeler/src/server.h b/libpgmodeler/src/foreignserver.h similarity index 92% rename from libpgmodeler/src/server.h rename to libpgmodeler/src/foreignserver.h index 85d48f4bcb..def3df843f 100644 --- a/libpgmodeler/src/server.h +++ b/libpgmodeler/src/foreignserver.h @@ -22,13 +22,13 @@ \brief Implements the operations to manipulate foreign servers on the database. */ -#ifndef SERVER_H -#define SERVER_H +#ifndef FOREIGN_SERVER_H +#define FOREIGN_SERVER_H #include "baseobject.h" #include "foreigndatawrapper.h" -class Server: public ForeignObject { +class ForeignServer: public ForeignObject { private: //! \brief The foreign data wrapper which manages the server ForeignDataWrapper *fdata_wrapper; @@ -36,7 +36,7 @@ class Server: public ForeignObject { QString type, version; public: - Server(void); + ForeignServer(void); void setType(const QString &type); void setVersion(const QString &version); diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index 1082a406f3..dc6c421803 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -60,7 +60,7 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) obj_type==ObjectType::Sequence || obj_type==ObjectType::Database || obj_type==ObjectType::Function || obj_type==ObjectType::Aggregate || obj_type==ObjectType::Language || obj_type==ObjectType::Schema || obj_type==ObjectType::Tablespace || obj_type==ObjectType::Domain || obj_type==ObjectType::Type || - obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::Server); + obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::ForeignServer); //Validating privilege @@ -109,7 +109,7 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) (obj_type==ObjectType::Tablespace && priv_id==PrivCreate) || - ((obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::Server) && priv_id==PrivUsage)); + ((obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::ForeignServer) && priv_id==PrivUsage)); } return(result); @@ -430,7 +430,7 @@ QString Permission::getCodeDefinition(unsigned def_type) if(obj_type == ObjectType::View) //Views and Tables uses the same key word when setting permission (TABLE) attributes[Attributes::Type] = BaseObject::getSQLName(ObjectType::Table); - else if(obj_type == ObjectType::Server) + else if(obj_type == ObjectType::ForeignServer) attributes[Attributes::Type] = QString("FOREIGN ") + object->getSQLName(); else attributes[Attributes::Type] = BaseObject::getSQLName(obj_type); diff --git a/libpgmodeler_ui/libpgmodeler_ui.pro b/libpgmodeler_ui/libpgmodeler_ui.pro index f458c7bc89..4cc4716695 100644 --- a/libpgmodeler_ui/libpgmodeler_ui.pro +++ b/libpgmodeler_ui/libpgmodeler_ui.pro @@ -118,7 +118,8 @@ SOURCES += src/mainwindow.cpp \ src/elementstablewidget.cpp \ src/elementwidget.cpp \ src/layerswidget.cpp \ - src/foreigndatawrapperwidget.cpp + src/foreigndatawrapperwidget.cpp \ + src/foreignserverwidget.cpp HEADERS += src/mainwindow.h \ @@ -224,7 +225,8 @@ HEADERS += src/mainwindow.h \ src/elementstablewidget.h \ src/elementwidget.h \ src/layerswidget.h \ - src/foreigndatawrapperwidget.h + src/foreigndatawrapperwidget.h \ + src/foreignserverwidget.h FORMS += ui/mainwindow.ui \ ui/textboxwidget.ui \ @@ -310,7 +312,8 @@ FORMS += ui/mainwindow.ui \ ui/referencewidget.ui \ ui/elementwidget.ui \ ui/layerswidget.ui \ - ui/foreigndatawrapperwidget.ui + ui/foreigndatawrapperwidget.ui \ + ui/foreignserverwidget.ui unix|windows: LIBS += -L$$OUT_PWD/../libobjrenderer/ -lobjrenderer \ -L$$OUT_PWD/../libpgconnector/ -lpgconnector \ diff --git a/libpgmodeler_ui/res/icones/connserver.png b/libpgmodeler_ui/res/icones/connserver.png deleted file mode 100644 index 1d38e4f9c807e24f3c6ec1d169464bc4c77b5d01..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 847 zcmV-V1F-ywP)?uTqbzX*P&AH z*4EaZ`M#eU96)Q$=;$cx>+8N!>TMq1&Q$~|l?qo^S7cdcLMMtM%H^^V*T?|C{{Frx z6@Xf;_Ou270QlW@ZM@^NhGk8J}N&E|`K>o!26(Ri68$t&O+rPT9}^98_;qNqoHOc72`Pk-BLwcal+E&Xa)Rw^Q? zZQFl3j`O?YIQzDUsDp!pqUU*85CmE&rIRF4TI*t(rta3()}7GM!2zbGrqt2V(fIuQ zyzRPfQY;p`p68Ke*%#N>*MY5+l3K0S5s@rOl7fghmSx#WDa*1fH8L^+fQa-&+wC@I zXJ>tbx~|K_!~_5*Cnut{zS`K>P$E(g5gSO0#o~3LP>5`R-QC>}z=wy#!Z7>+;PmvA z^Ye2ml?tU&3E%e_8ymaF?{qq(Y1;cfK0bc$d0uUAZ|{$X^o_gV^74||*;!hx)`Nlj zVR?D^&7gH-1LNc4v|2677sqjo zgFec@9Yh4BRIe!8?KV*qk!4wLUMWSXR5H>tK8QpF5uwxRpp?2dYOS#>%jnkh*#>}t z<3C&W$qd|~+wEdm*1&NX3~fMb-P`hh<5L>AcL8{Wfv<*g^a;KW!!Y+T(hp%63h)x> z+oO4HSOBQk>z|W^!+-}+-rea--~}+sfGql;3)})1z=Qt*69aq<{+!_pwhKhS4bZnQ Z{{n0Bt;F1FCQ$$Y002ovPDHLkV1l6;naKbE diff --git a/libpgmodeler_ui/res/icones/foreignserver.png b/libpgmodeler_ui/res/icones/foreignserver.png new file mode 100644 index 0000000000000000000000000000000000000000..6c9321da5e431efbe8658459194e24c069acdc89 GIT binary patch literal 1578 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 LNkvXXu0mjf^+oq- diff --git a/libpgmodeler_ui/res/resources.qrc b/libpgmodeler_ui/res/resources.qrc index 0778c2d7c4..e3bc1b6c11 100644 --- a/libpgmodeler_ui/res/resources.qrc +++ b/libpgmodeler_ui/res/resources.qrc @@ -255,8 +255,8 @@ icones/movetolayer.png icones/foreigndatawrapper_grp.png icones/foreigndatawrapper.png - icones/connserver.png - icones/server_grp.png + icones/foreignserver.png + icones/foreignserver_grp.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index c428075516..5170fc2de2 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -81,7 +81,7 @@ void ConnectionsConfigWidget::updateConnectionsCombo(void) connections_cmb->clear(); for(auto &conn : connections) - connections_cmb->addItem(QIcon(PgModelerUiNs::getIconPath("connserver")), conn->getConnectionId()); + connections_cmb->addItem(QIcon(PgModelerUiNs::getIconPath("server")), conn->getConnectionId()); } void ConnectionsConfigWidget::destroyConnections(void) @@ -576,7 +576,7 @@ void ConnectionsConfigWidget::fillConnectionsComboBox(QComboBox *combo, bool inc for(auto &itr : connections) { - combo->addItem(QIcon(PgModelerUiNs::getIconPath("connserver")), itr.first, QVariant::fromValue(itr.second)); + combo->addItem(QIcon(PgModelerUiNs::getIconPath("server")), itr.first, QVariant::fromValue(itr.second)); if(!def_conn && itr.second->isDefaultForOperation(check_def_for)) def_conn=itr.second; diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 58a6e8f0c2..8f82842ae8 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -345,7 +345,7 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) case ObjectType::Index: formatIndexAttribs(attribs); break; case ObjectType::Policy: formatPolicyAttribs(attribs); break; case ObjectType::ForeignDataWrapper: formatForeignDataWrapperAttribs(attribs); break; - case ObjectType::Server: formatServerAttribs(attribs); break; + case ObjectType::ForeignServer: formatServerAttribs(attribs); break; default: break; } } @@ -1005,7 +1005,7 @@ void DatabaseExplorerWidget::listObjects(void) curr_root = objects_trw->topLevelItem(0); objects_trw->takeTopLevelItem(0); root->setText(0, connection.getConnectionId(true)); - root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("connserver"))); + root->setIcon(0, QPixmap(PgModelerUiNs::getIconPath("server"))); root->setData(DatabaseImportForm::ObjectId, Qt::UserRole, -1); root->setData(DatabaseImportForm::ObjectTypeId, Qt::UserRole, enum_cast(ObjectType::BaseObject)); root->setData(DatabaseImportForm::ObjectSource, Qt::UserRole, trUtf8("-- Source code unavailable for this kind of object --")); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 1fbf7ba484..cfa4ab1229 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -735,7 +735,7 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) case ObjectType::Policy: createPolicy(attribs); break; case ObjectType::EventTrigger: createEventTrigger(attribs); break; case ObjectType::ForeignDataWrapper: createForeignDataWrapper(attribs); break; - case ObjectType::Server: createServer(attribs); break; + case ObjectType::ForeignServer: createServer(attribs); break; default: if(debug_mode) @@ -2329,14 +2329,14 @@ void DatabaseImportHelper::createForeignDataWrapper(attribs_map &attribs) void DatabaseImportHelper::createServer(attribs_map &attribs) { - Server *server=nullptr; + ForeignServer *server=nullptr; try { attribs[Attributes::Fdw] = getDependencyObject(attribs[Attributes::Fdw], ObjectType::ForeignDataWrapper, true , true, true); attribs[Attributes::Options] = Catalog::parseArrayValues(attribs[Attributes::Options]).join(ForeignDataWrapper::OptionsSeparator); - loadObjectXML(ObjectType::Server, attribs); + loadObjectXML(ObjectType::ForeignServer, attribs); server = dbmodel->createServer(); dbmodel->addServer(server); } diff --git a/libpgmodeler_ui/src/foreignserverwidget.cpp b/libpgmodeler_ui/src/foreignserverwidget.cpp new file mode 100644 index 0000000000..3c4a69a6f3 --- /dev/null +++ b/libpgmodeler_ui/src/foreignserverwidget.cpp @@ -0,0 +1,109 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "foreignserverwidget.h" + +ForeignServerWidget::ForeignServerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ForeignDataWrapper) +{ + try + { + QHBoxLayout *hbox = nullptr; + + Ui_ForeignServerWidget::setupUi(this); + + fdw_sel=nullptr; + fdw_sel=new ObjectSelectorWidget(ObjectType::ForeignDataWrapper, true, this); + + hbox = new QHBoxLayout; + hbox->setContentsMargins(0,0,0,0); + hbox->addWidget(fdw_sel); + fdw_wgt->setLayout(hbox); + + options_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::EditButton | ObjectsTableWidget::UpdateButton), true, this); + options_tab->setCellsEditable(true); + options_tab->setColumnCount(2); + options_tab->setHeaderLabel(trUtf8("Option"), 0); + options_tab->setHeaderLabel(trUtf8("Value"), 1); + + server_grid->addWidget(options_tab, 2, 0, 1, 3); + + configureFormLayout(server_grid, ObjectType::ForeignServer); + + configureTabOrder({ fdw_sel }); + + setMinimumSize(600, 400); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void ForeignServerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, ForeignServer *server) +{ + /*BaseObjectWidget::setAttributes(model, op_list, fdw); + + func_handler_sel->setModel(model); + func_validator_sel->setModel(model); + + if(fdw) + { + func_handler_sel->setSelectedObject(fdw->getHandlerFunction()); + func_validator_sel->setSelectedObject(fdw->getValidatorFunction()); + + options_tab->blockSignals(true); + + for(auto &itr : fdw->getOptions()) + { + options_tab->addRow(); + options_tab->setCellText(itr.first, options_tab->getRowCount() - 1, 0); + options_tab->setCellText(itr.second, options_tab->getRowCount() - 1, 1); + } + + options_tab->clearSelection(); + options_tab->blockSignals(false); + }*/ +} + +void ForeignServerWidget::applyConfiguration(void) +{ + try + { + /*ForeignDataWrapper *fdw=nullptr; + + startConfiguration(); + + fdw=dynamic_cast(this->object); + fdw->setHandlerFunction(dynamic_cast(func_handler_sel->getSelectedObject())); + fdw->setValidatorFunction(dynamic_cast(func_validator_sel->getSelectedObject())); + + fdw->removeOptions(); + for(unsigned row = 0; row < options_tab->getRowCount(); row++) + fdw->setOption(options_tab->getCellText(row, 0), options_tab->getCellText(row, 1)); + + BaseObjectWidget::applyConfiguration(); + finishConfiguration();*/ + } + catch(Exception &e) + { + cancelConfiguration(); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + diff --git a/libpgmodeler_ui/src/foreignserverwidget.h b/libpgmodeler_ui/src/foreignserverwidget.h new file mode 100644 index 0000000000..a556670b0d --- /dev/null +++ b/libpgmodeler_ui/src/foreignserverwidget.h @@ -0,0 +1,48 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler_ui +\class ServerWidget +\brief Implements the operations to create/edit foreign servers via form. +*/ + +#ifndef SERVER_WIDGET_H +#define SERVER_WIDGET_H + +#include "baseobjectwidget.h" +#include "ui_foreignserverwidget.h" +#include "objectstablewidget.h" + +class ForeignServerWidget: public BaseObjectWidget, public Ui::ForeignServerWidget { + private: + Q_OBJECT + + ObjectSelectorWidget *fdw_sel; + + ObjectsTableWidget *options_tab; + + public: + ForeignServerWidget(QWidget * parent = nullptr); + void setAttributes(DatabaseModel *model, OperationList *op_list, ForeignServer *server); + + public slots: + void applyConfiguration(void); +}; + +#endif diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 848ad26191..d007f9357f 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -59,6 +59,7 @@ #include "tabledatawidget.h" #include "generalconfigwidget.h" #include "foreigndatawrapperwidget.h" +#include "foreignserverwidget.h" vector ModelWidget::copied_objects; vector ModelWidget::cutted_objects; @@ -1829,6 +1830,8 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb } else if(obj_type==ObjectType::ForeignDataWrapper) res = openEditingForm(object); + else if(obj_type==ObjectType::ForeignServer) + res = openEditingForm(object); else { DatabaseWidget *database_wgt=new DatabaseWidget; diff --git a/libpgmodeler_ui/ui/foreignserverwidget.ui b/libpgmodeler_ui/ui/foreignserverwidget.ui new file mode 100644 index 0000000000..6a8a4441a2 --- /dev/null +++ b/libpgmodeler_ui/ui/foreignserverwidget.ui @@ -0,0 +1,71 @@ + + + ForeignServerWidget + + + + 0 + 0 + 337 + 22 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + FDW: + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + + + + + diff --git a/schemas/catalog/foreignserver.sch b/schemas/catalog/foreignserver.sch new file mode 100644 index 0000000000..58d00b63be --- /dev/null +++ b/schemas/catalog/foreignserver.sch @@ -0,0 +1,58 @@ +# Catalog queries for foreign server +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {list} %then + [ SELECT sv.oid, srvname AS name FROM pg_foreign_server AS sv ] + + %if {last-sys-oid} %or {not-ext-object} %then + [ WHERE ] + + %if {last-sys-oid} %then + [ sv.oid ] {oid-filter-op} $sp {last-sys-oid} + %end + + %if {not-ext-object} %then + + %if {last-sys-oid} %then + [ AND ] + %end + + ( {not-ext-object} ) + %end + %end +%else + %if {attribs} %then + [SELECT oid, srvname AS name, srvversion AS version, srvtype AS type, + srvfdw AS fdw, srvacl AS permission, srvowner AS owner, + srvoptions AS options, ] + + ({comment}) [ AS comment ] + + [ FROM pg_foreign_server AS sv ] + + %if {last-sys-oid} %then + [ WHERE oid ] {oid-filter-op} $sp {last-sys-oid} + %end + + %if {not-ext-object} %then + %if {last-sys-oid} %then + [ AND ] + %else + [ WHERE ] + %end + + ( {not-ext-object} ) + %end + + %if {filter-oids} %then + %if {last-sys-oid} %or {not-ext-object} %then + [ AND ] + %else + [ WHERE ] + %end + + [ oid IN (] {filter-oids} ) + %end + %end +%end diff --git a/schemas/catalog/server.sch b/schemas/catalog/server.sch index 58d00b63be..351ab517fe 100644 --- a/schemas/catalog/server.sch +++ b/schemas/catalog/server.sch @@ -1,58 +1,26 @@ -# Catalog queries for foreign server +# Catalog queries for server attributes # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -%if {list} %then - [ SELECT sv.oid, srvname AS name FROM pg_foreign_server AS sv ] - - %if {last-sys-oid} %or {not-ext-object} %then - [ WHERE ] - - %if {last-sys-oid} %then - [ sv.oid ] {oid-filter-op} $sp {last-sys-oid} - %end - - %if {not-ext-object} %then - - %if {last-sys-oid} %then - [ AND ] - %end - - ( {not-ext-object} ) - %end - %end -%else - %if {attribs} %then - [SELECT oid, srvname AS name, srvversion AS version, srvtype AS type, - srvfdw AS fdw, srvacl AS permission, srvowner AS owner, - srvoptions AS options, ] - - ({comment}) [ AS comment ] - - [ FROM pg_foreign_server AS sv ] - - %if {last-sys-oid} %then - [ WHERE oid ] {oid-filter-op} $sp {last-sys-oid} - %end - - %if {not-ext-object} %then - %if {last-sys-oid} %then - [ AND ] - %else - [ WHERE ] - %end - - ( {not-ext-object} ) - %end - - %if {filter-oids} %then - %if {last-sys-oid} %or {not-ext-object} %then - [ AND ] - %else - [ WHERE ] - %end - - [ oid IN (] {filter-oids} ) - %end - %end -%end +[SELECT name AS attribute, setting AS value FROM pg_settings WHERE name +IN ( + 'client_encoding', + 'config_file', + 'data_directory', + 'dynamic_library_path', + 'dynamic_shared_memory_type', + 'hba_file', + 'lc_collate', + 'lc_ctype', + 'listen_addresses', + 'max_connections', + 'port', + 'server_encoding', + 'ssl', + 'ssl_ca_file', + 'ssl_cert_file', + 'ssl_crl_file', + 'ssl_key_file', + 'password_encryption', + 'ident_file' +);] diff --git a/schemas/catalog/serverinfo.sch b/schemas/catalog/serverinfo.sch deleted file mode 100644 index 351ab517fe..0000000000 --- a/schemas/catalog/serverinfo.sch +++ /dev/null @@ -1,26 +0,0 @@ -# Catalog queries for server attributes -# CAUTION: Do not modify this file unless you know what you are doing. -# Code generation can be broken if incorrect changes are made. - -[SELECT name AS attribute, setting AS value FROM pg_settings WHERE name -IN ( - 'client_encoding', - 'config_file', - 'data_directory', - 'dynamic_library_path', - 'dynamic_shared_memory_type', - 'hba_file', - 'lc_collate', - 'lc_ctype', - 'listen_addresses', - 'max_connections', - 'port', - 'server_encoding', - 'ssl', - 'ssl_ca_file', - 'ssl_cert_file', - 'ssl_crl_file', - 'ssl_key_file', - 'password_encryption', - 'ident_file' -);] diff --git a/schemas/sql/server.sch b/schemas/sql/foreignserver.sch similarity index 100% rename from schemas/sql/server.sch rename to schemas/sql/foreignserver.sch diff --git a/schemas/xml/dtd/foreignserver.dtd b/schemas/xml/dtd/foreignserver.dtd new file mode 100644 index 0000000000..273ce26ce8 --- /dev/null +++ b/schemas/xml/dtd/foreignserver.dtd @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/schemas/xml/dtd/server.dtd b/schemas/xml/dtd/server.dtd deleted file mode 100644 index b3cb9b95d9..0000000000 --- a/schemas/xml/dtd/server.dtd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - diff --git a/schemas/xml/server.sch b/schemas/xml/foreignserver.sch similarity index 100% rename from schemas/xml/server.sch rename to schemas/xml/foreignserver.sch diff --git a/tests/src/servertest/servertest.cpp b/tests/src/servertest/servertest.cpp index 730af34221..fdb4952d85 100644 --- a/tests/src/servertest/servertest.cpp +++ b/tests/src/servertest/servertest.cpp @@ -32,7 +32,7 @@ class ServerTest: public QObject { void ServerTest::codeGeneratedIsWellFormed(void) { ForeignDataWrapper fdw; - Server server; + ForeignServer server; Role owner; QString sql_code =QString( "-- object: server_test | type: SERVER -- \ @@ -53,8 +53,8 @@ COMMENT ON SERVER server_test IS 'This is a test comment on server'; \ \ \ \ -").replace("#", Server::OptionValueSeparator) - .replace("*", Server::OptionsSeparator).simplified(); +").replace("#", ForeignServer::OptionValueSeparator) + .replace("*", ForeignServer::OptionsSeparator).simplified(); try { @@ -88,7 +88,7 @@ void ServerTest::modelReturnsDepsAndRefsForServer(void) Role owner; Schema public_sch; ForeignDataWrapper fdw; - Server server; + ForeignServer server; try { @@ -129,7 +129,7 @@ void ServerTest::modelCreatesServerfromXMLandResultingXMLisEqual(void) Role owner; Schema public_sch; ForeignDataWrapper fdw; - Server *server = nullptr; + ForeignServer *server = nullptr; QString xml_code, res_xml_code; try @@ -151,7 +151,7 @@ void ServerTest::modelCreatesServerfromXMLandResultingXMLisEqual(void) .replace("*", ForeignDataWrapper::OptionsSeparator); model.getXMLParser()->loadXMLBuffer(xml_code); - server = dynamic_cast(model.createObject(ObjectType::Server)); + server = dynamic_cast(model.createObject(ObjectType::ForeignServer)); QVERIFY(server != nullptr); From f445ebb52f9d05cafcc7a7cea1b04ec711df62b1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Apr 2019 08:45:40 -0300 Subject: [PATCH 324/425] Added the logic to create foreign servers on ForeignServerWidget --- libpgmodeler/src/baseobject.cpp | 4 +- .../src/foreigndatawrapperwidget.cpp | 10 ++- libpgmodeler_ui/src/foreignserverwidget.cpp | 43 ++++----- libpgmodeler_ui/src/modelwidget.cpp | 10 +-- .../ui/foreigndatawrapperwidget.ui | 87 +++++++++++-------- libpgmodeler_ui/ui/foreignserverwidget.ui | 9 +- 6 files changed, 93 insertions(+), 70 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index b8cd71c37b..19f80e442e 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -942,9 +942,9 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector vet_types={ ObjectType::BaseRelationship, ObjectType::Aggregate, ObjectType::Cast, ObjectType::Collation, ObjectType::Conversion, ObjectType::Database, ObjectType::Domain, ObjectType::Extension, ObjectType::EventTrigger, - ObjectType::ForeignDataWrapper, ObjectType::Function, ObjectType::GenericSql, ObjectType::Language, ObjectType::OpClass, + ObjectType::ForeignDataWrapper, ObjectType::ForeignServer, ObjectType::Function, ObjectType::GenericSql, ObjectType::Language, ObjectType::OpClass, ObjectType::Operator, ObjectType::OpFamily, ObjectType::Permission, ObjectType::Relationship, ObjectType::Role, ObjectType::Schema, - ObjectType::Sequence, ObjectType::ForeignServer, ObjectType::Table, ObjectType::Tablespace, ObjectType::Tag, ObjectType::Textbox, + ObjectType::Sequence, ObjectType::Table, ObjectType::Tablespace, ObjectType::Tag, ObjectType::Textbox, ObjectType::Type, ObjectType::View }; vector::iterator itr; diff --git a/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp b/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp index 217312a5c2..6387e9585c 100644 --- a/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp +++ b/libpgmodeler_ui/src/foreigndatawrapperwidget.cpp @@ -55,14 +55,18 @@ ForeignDataWrapperWidget::ForeignDataWrapperWidget(QWidget *parent): BaseObjectW options_tab->setHeaderLabel(trUtf8("Option"), 0); options_tab->setHeaderLabel(trUtf8("Value"), 1); - fdw_grid->addWidget(options_tab, 2, 0, 1, 3); + hbox = new QHBoxLayout; + hbox->setContentsMargins(4,4,4,4); + hbox->addWidget(options_tab); + options_gb->setLayout(hbox); configureFormLayout(fdw_grid, ObjectType::ForeignDataWrapper); configureTabOrder({ func_handler_sel, func_handler_ht, - func_validator_sel, func_validator_ht }); + func_validator_sel, func_validator_ht, + options_tab }); - setMinimumSize(600, 400); + setMinimumSize(600, 420); } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/foreignserverwidget.cpp b/libpgmodeler_ui/src/foreignserverwidget.cpp index 3c4a69a6f3..b1e30ad3aa 100644 --- a/libpgmodeler_ui/src/foreignserverwidget.cpp +++ b/libpgmodeler_ui/src/foreignserverwidget.cpp @@ -18,7 +18,7 @@ #include "foreignserverwidget.h" -ForeignServerWidget::ForeignServerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ForeignDataWrapper) +ForeignServerWidget::ForeignServerWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::ForeignServer) { try { @@ -41,13 +41,18 @@ ForeignServerWidget::ForeignServerWidget(QWidget *parent): BaseObjectWidget(pare options_tab->setHeaderLabel(trUtf8("Option"), 0); options_tab->setHeaderLabel(trUtf8("Value"), 1); - server_grid->addWidget(options_tab, 2, 0, 1, 3); + hbox = new QHBoxLayout; + hbox->setContentsMargins(4,4,4,4); + hbox->addWidget(options_tab); + options_gb->setLayout(hbox); configureFormLayout(server_grid, ObjectType::ForeignServer); - configureTabOrder({ fdw_sel }); + setRequiredField(fdw_sel); + setRequiredField(fdw_lbl); + configureTabOrder({ fdw_sel, options_tab }); - setMinimumSize(600, 400); + setMinimumSize(600, 420); } catch(Exception &e) { @@ -57,19 +62,16 @@ ForeignServerWidget::ForeignServerWidget(QWidget *parent): BaseObjectWidget(pare void ForeignServerWidget::setAttributes(DatabaseModel *model, OperationList *op_list, ForeignServer *server) { - /*BaseObjectWidget::setAttributes(model, op_list, fdw); + BaseObjectWidget::setAttributes(model, op_list, server); - func_handler_sel->setModel(model); - func_validator_sel->setModel(model); + fdw_sel->setModel(model); - if(fdw) + if(server) { - func_handler_sel->setSelectedObject(fdw->getHandlerFunction()); - func_validator_sel->setSelectedObject(fdw->getValidatorFunction()); - + fdw_sel->setSelectedObject(server->getForeignDataWrapper()); options_tab->blockSignals(true); - for(auto &itr : fdw->getOptions()) + for(auto &itr : server->getOptions()) { options_tab->addRow(); options_tab->setCellText(itr.first, options_tab->getRowCount() - 1, 0); @@ -78,27 +80,26 @@ void ForeignServerWidget::setAttributes(DatabaseModel *model, OperationList *op_ options_tab->clearSelection(); options_tab->blockSignals(false); - }*/ + } } void ForeignServerWidget::applyConfiguration(void) { try { - /*ForeignDataWrapper *fdw=nullptr; + ForeignServer *server = nullptr; - startConfiguration(); + startConfiguration(); - fdw=dynamic_cast(this->object); - fdw->setHandlerFunction(dynamic_cast(func_handler_sel->getSelectedObject())); - fdw->setValidatorFunction(dynamic_cast(func_validator_sel->getSelectedObject())); + server = dynamic_cast(this->object); + server->setForeignDataWrapper(dynamic_cast(fdw_sel->getSelectedObject())); - fdw->removeOptions(); + server->removeOptions(); for(unsigned row = 0; row < options_tab->getRowCount(); row++) - fdw->setOption(options_tab->getCellText(row, 0), options_tab->getCellText(row, 1)); + server->setOption(options_tab->getCellText(row, 0), options_tab->getCellText(row, 1)); BaseObjectWidget::applyConfiguration(); - finishConfiguration();*/ + finishConfiguration(); } catch(Exception &e) { diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index d007f9357f..1d580b46a5 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -83,15 +83,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) QAction *action=nullptr; QString str_ico; QStringList rel_types_cod={QString("11"), QString("1n"), QString("nn"), QString("dep"), QString("gen"), QString("part") }; - /*ObjectType types[]={ ObjectType::Table, ObjectType::View, ObjectType::Textbox, ObjectType::Relationship, - ObjectType::Cast, ObjectType::Conversion, ObjectType::Domain, - ObjectType::Function, ObjectType::Aggregate, ObjectType::Language, - ObjectType::OpClass, ObjectType::Operator, ObjectType::OpFamily, - ObjectType::Role, ObjectType::Schema, ObjectType::Sequence, ObjectType::Type, - ObjectType::Column, ObjectType::Constraint, ObjectType::Rule, ObjectType::Trigger, ObjectType::Index, ObjectType::Policy, - ObjectType::Tablespace, ObjectType::Collation, ObjectType::Extension, ObjectType::EventTrigger, ObjectType::Tag, - ObjectType::GenericSql }; */ - unsigned i, /*obj_cnt=sizeof(types)/sizeof(ObjectType),*/ + unsigned i, rel_types_id[]={ BaseRelationship::Relationship11, BaseRelationship::Relationship1n, BaseRelationship::RelationshipNn, BaseRelationship::RelationshipDep, BaseRelationship::RelationshipGen, BaseRelationship::RelationshipPart}; diff --git a/libpgmodeler_ui/ui/foreigndatawrapperwidget.ui b/libpgmodeler_ui/ui/foreigndatawrapperwidget.ui index 84a767602c..d2fe9ab21f 100644 --- a/libpgmodeler_ui/ui/foreigndatawrapperwidget.ui +++ b/libpgmodeler_ui/ui/foreigndatawrapperwidget.ui @@ -7,7 +7,7 @@ 0 0 337 - 61 + 221 @@ -17,8 +17,42 @@ - - + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + 0 @@ -32,14 +66,14 @@ - Handler: + Validator: - - + + - + 0 0 @@ -47,9 +81,12 @@ 0 - 20 + 0 + + Handler: + @@ -74,10 +111,10 @@ - - + + - + 0 0 @@ -85,12 +122,9 @@ 0 - 0 + 20 - - Validator: - @@ -109,25 +143,10 @@ - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - + + + + Options diff --git a/libpgmodeler_ui/ui/foreignserverwidget.ui b/libpgmodeler_ui/ui/foreignserverwidget.ui index 6a8a4441a2..45ea0c7c1b 100644 --- a/libpgmodeler_ui/ui/foreignserverwidget.ui +++ b/libpgmodeler_ui/ui/foreignserverwidget.ui @@ -7,7 +7,7 @@ 0 0 337 - 22 + 130 @@ -64,6 +64,13 @@ + + + + Options + + + From 918c4fcac2ddc9e0ad9d34d36db1ab000fecaa76 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 24 Apr 2019 11:34:15 -0300 Subject: [PATCH 325/425] Minor improvement on ModelDatabaseDiffForm to show the connection id of the databases being imported in the output tree --- libpgmodeler_ui/src/modeldatabasediffform.cpp | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index ce21abcb45..90a522689b 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -445,26 +445,26 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) DatabaseModel *db_model = nullptr; conn1=conn; + step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("import"))); + + conn.switchToDatabase(db_cmb->currentText()); + step_lbl->setText(trUtf8("Step %1/%2: Importing database %3...") .arg(curr_step) .arg(total_steps) - .arg(db_cmb->currentText())); - - step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("import"))); + .arg(conn.getConnectionId(true, true))); if(thread_id == SrcImportThread) src_import_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); else import_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); - conn.switchToDatabase(db_cmb->currentText()); pgsql_ver=conn.getPgSQLVersion(true); - catalog.setConnection(conn); //The import process will exclude built-in array array types, system and extension objects catalog.setFilter(Catalog::ListAllObjects | Catalog::ExclBuiltinArrayTypes | - Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); + Catalog::ExclExtensionObjs | Catalog::ExclSystemObjs); catalog.getObjectsOIDs(obj_oids, col_oids, {{Attributes::FilterTableTypes, Attributes::True}}); obj_oids[ObjectType::Database].push_back(db_cmb->currentData().value()); @@ -485,7 +485,7 @@ void ModelDatabaseDiffForm::importDatabase(unsigned thread_id) import_hlp->setSelectedOIDs(db_model, obj_oids, col_oids); import_hlp->setCurrentDatabase(db_cmb->currentText()); import_hlp->setImportOptions(import_sys_objs_chk->isChecked(), import_ext_objs_chk->isChecked(), true, - ignore_errors_chk->isChecked(), false, false, false); + ignore_errors_chk->isChecked(), false, false, false); thread->start(); } catch(Exception &e) @@ -505,6 +505,9 @@ void ModelDatabaseDiffForm::diffModels(void) .arg(imported_model->getName())); step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("diff"))); + if(src_import_item) + output_trw->collapseItem(src_import_item); + output_trw->collapseItem(import_item); diff_progress=step_pb->value(); @@ -546,21 +549,23 @@ void ModelDatabaseDiffForm::exportDiff(bool confirm) if(!confirm || msg_box.result()==QDialog::Accepted) { + export_conn=new Connection; + *export_conn=*reinterpret_cast(connections_cmb->itemData(connections_cmb->currentIndex()).value()); + settings_tbw->setCurrentIndex(1); apply_on_server_btn->setEnabled(true); - step_lbl->setText(trUtf8("Step %1/%2: Exporting diff to database %3...") + step_lbl->setText(trUtf8("Step %1/%2: Exporting diff to database %3@%4...") .arg(curr_step) .arg(total_steps) - .arg(imported_model->getName())); + .arg(imported_model->getName()) + .arg(export_conn->getConnectionId(true))); step_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("exportar"))); output_trw->collapseItem(diff_item); diff_progress=step_pb->value(); export_item=PgModelerUiNs::createOutputTreeItem(output_trw, step_lbl->text(), *step_ico_lbl->pixmap(), nullptr); - export_conn=new Connection; - *export_conn=*reinterpret_cast(connections_cmb->itemData(connections_cmb->currentIndex()).value()); export_helper->setExportToDBMSParams(sqlcode_txt->toPlainText(), export_conn, database_cmb->currentText(), ignore_duplic_chk->isChecked()); if(ignore_error_codes_chk->isChecked()) @@ -785,7 +790,6 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType msg=PgModelerUiNs::formatMessage(msg); - if(src_import_thread && src_import_thread->isRunning()) { progress_aux = progress/5; From ec555f5082f15f444e402fcd37a985ff7b11724c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Apr 2019 08:42:14 -0300 Subject: [PATCH 326/425] Fixed ForeignServer code generation Added ForeignServer toolbutton in NewObjectOverlayWidget --- libpgmodeler/src/databasemodel.cpp | 12 +- libpgmodeler/src/foreigndatawrapper.cpp | 2 +- libpgmodeler/src/foreignserver.cpp | 7 +- .../src/newobjectoverlaywidget.cpp | 74 ++++----- libpgmodeler_ui/ui/newobjectoverlaywidget.ui | 148 ++++++++++++------ schemas/xml/dtd/dbmodel.dtd | 4 +- schemas/xml/dtd/permission.dtd | 2 +- schemas/xml/foreigndatawrapper.sch | 2 +- schemas/xml/foreignserver.sch | 4 +- 9 files changed, 150 insertions(+), 105 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index e0f160fbf7..ba2fe8eafb 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -6825,7 +6825,7 @@ Permission *DatabaseModel::createPermission(void) ObjectType obj_type; QString parent_name, obj_name; QStringList list; - unsigned i, len, priv_type=Permission::PrivSelect; + unsigned priv_type=Permission::PrivSelect; bool priv_value, grant_op, revoke, cascade; try @@ -6873,19 +6873,17 @@ Permission *DatabaseModel::createPermission(void) if(xmlparser.getElementName()==Attributes::Roles) { xmlparser.getElementAttributes(attribs); + list = attribs[Attributes::Names].split(','); - list=attribs[Attributes::Names].split(','); - len=list.size(); - - for(i=0; i < len; i++) + for(auto &name : list) { - role=dynamic_cast(getObject(list[i].trimmed(),ObjectType::Role)); + role=dynamic_cast(getObject(name.trimmed(), ObjectType::Role)); //Raises an error if the referenced role doesn't exists if(!role) { throw Exception(Exception::getErrorMessage(ErrorCode::PermissionRefInexistObject) - .arg(list[i]) + .arg(name) .arg(BaseObject::getTypeName(ObjectType::Role)), ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 785ad333b8..25e2c194f5 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -85,7 +85,7 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type) QString ForeignDataWrapper::getCodeDefinition(unsigned def_type, bool reduced_form) { - QString code_def=getCachedCode(def_type, false); + QString code_def=getCachedCode(def_type, reduced_form); if(!code_def.isEmpty()) return(code_def); QStringList fmt_options; diff --git a/libpgmodeler/src/foreignserver.cpp b/libpgmodeler/src/foreignserver.cpp index 0b8c1b0169..47eda915d5 100644 --- a/libpgmodeler/src/foreignserver.cpp +++ b/libpgmodeler/src/foreignserver.cpp @@ -70,9 +70,10 @@ QString ForeignServer::getCodeDefinition(unsigned def_type) if(fdata_wrapper) { - attributes[Attributes::Fdw] = def_type == SchemaParser::SqlDefinition ? - fdata_wrapper->getName(true) : - fdata_wrapper->getCodeDefinition(def_type, true); + if(def_type == SchemaParser::SqlDefinition) + attributes[Attributes::Fdw] = fdata_wrapper->getName(true); + else + attributes[Attributes::Fdw] = fdata_wrapper->getCodeDefinition(def_type, true); } setOptionsAttribute(def_type); diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index 58d4a65202..d65607ec91 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -29,42 +29,44 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par int action_idx=0; QList rel_actions=parent->rels_menu->actions(); map> obj_shortcuts={ - { aggregate_tb, std::make_tuple(trUtf8("A"), ObjectType::Aggregate) }, - { cast_tb, std::make_tuple(trUtf8("G"), ObjectType::Cast) }, - { eventtrigger_tb, std::make_tuple(trUtf8("K"), ObjectType::EventTrigger)}, - { collation_tb, std::make_tuple(trUtf8("H"), ObjectType::Collation) }, - { conversion_tb, std::make_tuple(trUtf8("J"), ObjectType::Conversion) }, - { domain_tb, std::make_tuple(trUtf8("D"), ObjectType::Domain) }, - { extension_tb, std::make_tuple(trUtf8("E"), ObjectType::Extension) }, - { function_tb, std::make_tuple(trUtf8("F"), ObjectType::Function) }, - { language_tb, std::make_tuple(trUtf8("L"), ObjectType::Language) }, - { opclass_tb, std::make_tuple(trUtf8("O"), ObjectType::OpClass) }, - { operator_tb, std::make_tuple(trUtf8("U"), ObjectType::Operator) }, - { opfamily_tb, std::make_tuple(trUtf8("I"), ObjectType::OpFamily) }, - { role_tb, std::make_tuple(trUtf8("R"), ObjectType::Role) }, - { schema_tb, std::make_tuple(trUtf8("S"), ObjectType::Schema) }, - { sequence_tb, std::make_tuple(trUtf8("Q"), ObjectType::Sequence) }, - { table_tb, std::make_tuple(trUtf8("T"), ObjectType::Table) }, - { tablespace_tb, std::make_tuple(trUtf8("P"), ObjectType::Tablespace) }, - { textbox_tb, std::make_tuple(trUtf8("M"), ObjectType::Textbox) }, - { type_tb, std::make_tuple(trUtf8("Y"), ObjectType::Type) }, - { view_tb, std::make_tuple(trUtf8("W"), ObjectType::View) }, - { tag_tb, std::make_tuple(trUtf8("9"), ObjectType::Tag) }, - { constraint_tb, std::make_tuple(trUtf8("Z"), ObjectType::Constraint) }, - { index_tb, std::make_tuple(trUtf8("X"), ObjectType::Index) }, - { column_tb, std::make_tuple(trUtf8("C"), ObjectType::Column) }, - { rule_tb, std::make_tuple(trUtf8("V"), ObjectType::Rule) }, - { trigger_tb, std::make_tuple(trUtf8("B"), ObjectType::Trigger) }, - { policy_tb, std::make_tuple(trUtf8("9"), ObjectType::Policy) }, - { genericsql_tb, std::make_tuple(trUtf8("8"), ObjectType::GenericSql) }, - { fdw_tb, std::make_tuple(trUtf8("7"), ObjectType::ForeignDataWrapper) } }; - - map> rel_shortcuts={ { rel11_tb, std::make_tuple(trUtf8("1"), 0) }, - { rel1n_tb, std::make_tuple(trUtf8("2"), 1) }, - { relnn_tb, std::make_tuple(trUtf8("3"), 2) }, - { reldep_tb, std::make_tuple(trUtf8("5"), 3) }, - { relgen_tb, std::make_tuple(trUtf8("4"), 4) }, - { relpart_tb, std::make_tuple(trUtf8("5"), 5) }}; + { aggregate_tb, std::make_tuple(trUtf8("A"), ObjectType::Aggregate) }, + { cast_tb, std::make_tuple(trUtf8("G"), ObjectType::Cast) }, + { eventtrigger_tb, std::make_tuple(trUtf8("K"), ObjectType::EventTrigger)}, + { collation_tb, std::make_tuple(trUtf8("H"), ObjectType::Collation) }, + { conversion_tb, std::make_tuple(trUtf8("J"), ObjectType::Conversion) }, + { domain_tb, std::make_tuple(trUtf8("D"), ObjectType::Domain) }, + { extension_tb, std::make_tuple(trUtf8("E"), ObjectType::Extension) }, + { function_tb, std::make_tuple(trUtf8("F"), ObjectType::Function) }, + { language_tb, std::make_tuple(trUtf8("L"), ObjectType::Language) }, + { opclass_tb, std::make_tuple(trUtf8("O"), ObjectType::OpClass) }, + { operator_tb, std::make_tuple(trUtf8("U"), ObjectType::Operator) }, + { opfamily_tb, std::make_tuple(trUtf8("I"), ObjectType::OpFamily) }, + { role_tb, std::make_tuple(trUtf8("R"), ObjectType::Role) }, + { schema_tb, std::make_tuple(trUtf8("S"), ObjectType::Schema) }, + { sequence_tb, std::make_tuple(trUtf8("Q"), ObjectType::Sequence) }, + { table_tb, std::make_tuple(trUtf8("T"), ObjectType::Table) }, + { tablespace_tb, std::make_tuple(trUtf8("P"), ObjectType::Tablespace) }, + { textbox_tb, std::make_tuple(trUtf8("M"), ObjectType::Textbox) }, + { type_tb, std::make_tuple(trUtf8("Y"), ObjectType::Type) }, + { view_tb, std::make_tuple(trUtf8("W"), ObjectType::View) }, + { tag_tb, std::make_tuple(trUtf8("9"), ObjectType::Tag) }, + { constraint_tb, std::make_tuple(trUtf8("Z"), ObjectType::Constraint) }, + { index_tb, std::make_tuple(trUtf8("X"), ObjectType::Index) }, + { column_tb, std::make_tuple(trUtf8("C"), ObjectType::Column) }, + { rule_tb, std::make_tuple(trUtf8("V"), ObjectType::Rule) }, + { trigger_tb, std::make_tuple(trUtf8("B"), ObjectType::Trigger) }, + { policy_tb, std::make_tuple(trUtf8("9"), ObjectType::Policy) }, + { genericsql_tb, std::make_tuple(trUtf8("8"), ObjectType::GenericSql) }, + { fdw_tb, std::make_tuple(trUtf8("7"), ObjectType::ForeignDataWrapper) }, + { server_tb, std::make_tuple(trUtf8("6"), ObjectType::ForeignServer) }}; + + map> rel_shortcuts={ + { rel11_tb, std::make_tuple(trUtf8("1"), 0) }, + { rel1n_tb, std::make_tuple(trUtf8("2"), 1) }, + { relnn_tb, std::make_tuple(trUtf8("3"), 2) }, + { reldep_tb, std::make_tuple(trUtf8("5"), 3) }, + { relgen_tb, std::make_tuple(trUtf8("4"), 4) }, + { relpart_tb, std::make_tuple(trUtf8("5"), 5) }}; vector permission_btns={db_sch_perms_tb, tab_perms_tb }; diff --git a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui index 55c903fb75..0b460d2454 100644 --- a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui +++ b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui @@ -6,8 +6,8 @@ 0 0 - 426 - 840 + 434 + 911 @@ -124,8 +124,8 @@ 6 - - + + 0 @@ -148,11 +148,11 @@ Qt::NoFocus - Cast + Extension - :/icones/icones/cast.png:/icones/icones/cast.png + :/icones/icones/extension.png:/icones/icones/extension.png @@ -160,8 +160,49 @@ 32 - - A + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Event Trigger + + + + :/icones/icones/eventtrigger.png:/icones/icones/eventtrigger.png + + + + 32 + 32 + QToolButton::InstantPopup @@ -171,8 +212,8 @@ - - + + 0 @@ -195,11 +236,11 @@ Qt::NoFocus - Permissions + Data Wrapper - :/icones/icones/permission.png:/icones/icones/permission.png + :/icones/icones/foreigndatawrapper.png:/icones/icones/foreigndatawrapper.png @@ -215,8 +256,8 @@ - - + + 0 @@ -239,11 +280,11 @@ Qt::NoFocus - Textbox + Cast - :/icones/icones/textbox.png:/icones/icones/textbox.png + :/icones/icones/cast.png:/icones/icones/cast.png @@ -251,6 +292,9 @@ 32 + + A + QToolButton::InstantPopup @@ -259,8 +303,8 @@ - - + + 0 @@ -283,11 +327,11 @@ Qt::NoFocus - Tag + Permissions - :/icones/icones/tag.png:/icones/icones/tag.png + :/icones/icones/permission.png:/icones/icones/permission.png @@ -303,8 +347,8 @@ - - + + 0 @@ -327,11 +371,11 @@ Qt::NoFocus - Tablespace + Textbox - :/icones/icones/tablespace.png:/icones/icones/tablespace.png + :/icones/icones/textbox.png:/icones/icones/textbox.png @@ -347,8 +391,8 @@ - - + + 0 @@ -371,11 +415,11 @@ Qt::NoFocus - Schema + Tag - :/icones/icones/schema.png:/icones/icones/schema.png + :/icones/icones/tag.png:/icones/icones/tag.png @@ -391,8 +435,8 @@ - - + + 0 @@ -415,11 +459,11 @@ Qt::NoFocus - Role + Tablespace - :/icones/icones/role.png:/icones/icones/role.png + :/icones/icones/tablespace.png:/icones/icones/tablespace.png @@ -435,8 +479,8 @@ - - + + 0 @@ -459,11 +503,11 @@ Qt::NoFocus - Generic SQL + Language - :/icones/icones/genericsql.png:/icones/icones/genericsql.png + :/icones/icones/language.png:/icones/icones/language.png @@ -479,8 +523,8 @@ - - + + 0 @@ -503,11 +547,11 @@ Qt::NoFocus - Event Trigger + Generic SQL - :/icones/icones/eventtrigger.png:/icones/icones/eventtrigger.png + :/icones/icones/genericsql.png:/icones/icones/genericsql.png @@ -523,8 +567,8 @@ - - + + 0 @@ -547,11 +591,11 @@ Qt::NoFocus - Extension + Role - :/icones/icones/extension.png:/icones/icones/extension.png + :/icones/icones/role.png:/icones/icones/role.png @@ -567,8 +611,8 @@ - - + + 0 @@ -591,11 +635,11 @@ Qt::NoFocus - Language + Schema - :/icones/icones/language.png:/icones/icones/language.png + :/icones/icones/schema.png:/icones/icones/schema.png @@ -611,8 +655,8 @@ - - + + 0 @@ -635,11 +679,11 @@ Qt::NoFocus - Data Wrapper + Server - :/icones/icones/foreigndatawrapper.png:/icones/icones/foreigndatawrapper.png + :/icones/icones/foreignserver.png:/icones/icones/foreignserver.png diff --git a/schemas/xml/dtd/dbmodel.dtd b/schemas/xml/dtd/dbmodel.dtd index c720166c08..5a83cfce24 100644 --- a/schemas/xml/dtd/dbmodel.dtd +++ b/schemas/xml/dtd/dbmodel.dtd @@ -68,8 +68,8 @@ %policy; %foreigndatawrapper; - -%server; + +%foreignserver; diff --git a/schemas/xml/dtd/permission.dtd b/schemas/xml/dtd/permission.dtd index 2a9aed9632..3b6cc81d26 100644 --- a/schemas/xml/dtd/permission.dtd +++ b/schemas/xml/dtd/permission.dtd @@ -25,6 +25,6 @@ - + diff --git a/schemas/xml/foreigndatawrapper.sch b/schemas/xml/foreigndatawrapper.sch index 8416f9d453..79e33dd23e 100644 --- a/schemas/xml/foreigndatawrapper.sch +++ b/schemas/xml/foreigndatawrapper.sch @@ -33,5 +33,5 @@ %if {handler} %then {handler} %end %if {validator} %then {validator} %end - + $br $br %end diff --git a/schemas/xml/foreignserver.sch b/schemas/xml/foreignserver.sch index 8f264714c3..6aec95595e 100644 --- a/schemas/xml/foreignserver.sch +++ b/schemas/xml/foreignserver.sch @@ -2,7 +2,7 @@ # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -[ + $br $br From f1837b7bc586f4188a2518fa47d2994007402331 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 25 Apr 2019 16:44:14 -0300 Subject: [PATCH 327/425] Created a generic getAlterDefinition on ForeignObject Minor adjustment on ForeignDataWrapper::getAlterDefinition --- libpgmodeler/src/foreigndatawrapper.cpp | 28 ++--------------- libpgmodeler/src/foreignobject.cpp | 38 +++++++++++++++++++++++ libpgmodeler/src/foreignobject.h | 1 + libpgmodeler/src/pgmodelerns.cpp | 41 +++++++++++++------------ 4 files changed, 64 insertions(+), 44 deletions(-) diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 25e2c194f5..5832934404 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -109,20 +109,16 @@ QString ForeignDataWrapper::getCodeDefinition(unsigned def_type, bool reduced_fo QString ForeignDataWrapper::getAlterDefinition(BaseObject *object) { - ForeignDataWrapper *fdw=dynamic_cast(object); - - if(!fdw) - throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - try { + ForeignDataWrapper *fdw=dynamic_cast(object); attribs_map attribs; QStringList opts, func_attribs = { Attributes::ValidatorFunc, Attributes::HandlerFunc }; Function *this_funcs[2] = { this->getValidatorFunction(), this->getHandlerFunction() }, *fdw_funcs[2] = { fdw->getValidatorFunction(), fdw->getHandlerFunction() }, *this_func = nullptr, *fdw_func = nullptr; - attributes[Attributes::AlterCmds]=BaseObject::getAlterDefinition(object); + attributes[Attributes::AlterCmds] = ForeignObject::getAlterDefinition(fdw); // Comparing FDW functions for(int i = 0; i < 2; i++) @@ -130,7 +126,7 @@ QString ForeignDataWrapper::getAlterDefinition(BaseObject *object) this_func = this_funcs[i]; fdw_func = fdw_funcs[i]; - if(!fdw_func) + if(!fdw_func && this_func) attribs[func_attribs[i]] = Attributes::Unset; else if(fdw_func && (!this_func || @@ -138,25 +134,7 @@ QString ForeignDataWrapper::getAlterDefinition(BaseObject *object) attribs[func_attribs[i]] = fdw_func->getName(true); } - // Comparing FDW options (to be modified or added) - for(auto &opt : fdw->options) - { - if(this->options.count(opt.first) == 0) - opts.push_back(QString("ADD %1 '%2'").arg(opt.first).arg(opt.second)); - else if(this->options[opt.first] != opt.second) - opts.push_back(QString("SET %1 '%3'").arg(opt.first).arg(opt.second)); - } - - // Comparing FDW options (to be removed) - for(auto &opt : this->options) - { - if(fdw->options.count(opt.first) == 0) - opts.push_back(QString("DROP %1").arg(opt.first)); - } - - attribs[Attributes::Options] = opts.join(OptionsSeparator); copyAttributes(attribs); - return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); } catch(Exception &e) diff --git a/libpgmodeler/src/foreignobject.cpp b/libpgmodeler/src/foreignobject.cpp index a96465f6f1..09ba1407f0 100644 --- a/libpgmodeler/src/foreignobject.cpp +++ b/libpgmodeler/src/foreignobject.cpp @@ -60,6 +60,44 @@ attribs_map ForeignObject::getOptions(void) return(options); } +QString ForeignObject::getAlterDefinition(BaseObject *object) +{ + try + { + attribs_map attribs; + ForeignObject *fobj = dynamic_cast(object); + QStringList opts; + + if(!fobj) + throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + // Comparing FDW options (to be modified or added) + for(auto &opt : fobj->options) + { + if(this->options.count(opt.first) == 0) + opts.push_back(QString("ADD %1 '%2'").arg(opt.first).arg(opt.second)); + else if(this->options[opt.first] != opt.second) + opts.push_back(QString("SET %1 '%3'").arg(opt.first).arg(opt.second)); + } + + // Comparing FDW options (to be removed) + for(auto &opt : this->options) + { + if(fobj->options.count(opt.first) == 0) + opts.push_back(QString("DROP %1").arg(opt.first)); + } + + attribs[Attributes::Options] = opts.join(OptionsSeparator); + copyAttributes(attribs); + + return(BaseObject::getAlterDefinition(object)); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__, __FILE__, __LINE__, &e); + } +} + void ForeignObject::setOptionsAttribute(unsigned def_type) { QStringList fmt_options; diff --git a/libpgmodeler/src/foreignobject.h b/libpgmodeler/src/foreignobject.h index 6e130e3602..4ef9fe3c66 100644 --- a/libpgmodeler/src/foreignobject.h +++ b/libpgmodeler/src/foreignobject.h @@ -48,6 +48,7 @@ class ForeignObject: public BaseObject { attribs_map getOptions(void); virtual QString getCodeDefinition(unsigned) = 0; + virtual QString getAlterDefinition(BaseObject *object); }; #endif diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index 79e08b7b33..b30f0749bc 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -153,6 +153,9 @@ namespace PgModelerNs { case ObjectType::ForeignDataWrapper: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; + case ObjectType::ForeignServer: + copyObject(psrc_obj, dynamic_cast(copy_obj)); + break; default: throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -163,57 +166,57 @@ namespace PgModelerNs { { static QHash keywords={ {QChar('A'), {QString("ALL"), QString("ANALYSE"), QString("ANALYZE"), QString("AND"), - QString("ANY"), QString("AS"), QString("ASC"), QString("AUTHORIZATION")}}, + QString("ANY"), QString("AS"), QString("ASC"), QString("AUTHORIZATION")}}, {QChar('B'), {QString("BETWEEN"), QString("BIGINT"), QString("BINARY"), QString("BIT"), - QString("BOOLEAN"), QString("BOTH")}}, + QString("BOOLEAN"), QString("BOTH")}}, {QChar('C'), {QString("CASE"), QString("CAST"), QString("CHAR"), QString("CHARACTER"), - QString("CHECK"), QString("COALESCE"), QString("COLLATE"), QString("COLUMN"), - QString("CONSTRAINT"), QString("CONVERT"), QString("CREATE"), QString("CROSS"), - QString("CURRENT_DATE"), QString("CURRENT_TIME"), QString("CURRENT_TIMESTAMP"), QString("CURRENT_USER")}}, + QString("CHECK"), QString("COALESCE"), QString("COLLATE"), QString("COLUMN"), + QString("CONSTRAINT"), QString("CONVERT"), QString("CREATE"), QString("CROSS"), + QString("CURRENT_DATE"), QString("CURRENT_TIME"), QString("CURRENT_TIMESTAMP"), QString("CURRENT_USER")}}, {QChar('D'), {QString("DEC"), QString("DECIMAL"), QString("DEFAULT"), QString("DEFERRABLE"), - QString("DESC"), QString("DISTINCT"), QString("DO")}}, + QString("DESC"), QString("DISTINCT"), QString("DO")}}, {QChar('E'), {QString("ELSE"), QString("END"), QString("EXCEPT"), QString("EXISTS"), - QString("EXTRACT")}}, + QString("EXTRACT")}}, {QChar('F'), {QString("FALSE"), QString("FLOAT"), QString("FOR"), QString("FOREIGN"), - QString("FREEZE"), QString("FROM"), QString("FULL")}}, + QString("FREEZE"), QString("FROM"), QString("FULL")}}, {QChar('G'), {QString("GRANT"), QString("GROUP")}}, {QChar('H'), {QString("HAVING")}}, {QChar('I'), {QString("ILIKE"), QString("IN"), QString("INITIALLY"), QString("INNER"), - QString("INT"), QString("INTEGER"), QString("INTERSECT"), QString("INTERVAL"), - QString("INTO"), QString("IS"), QString("ISNULL")}}, + QString("INT"), QString("INTEGER"), QString("INTERSECT"), QString("INTERVAL"), + QString("INTO"), QString("IS"), QString("ISNULL")}}, {QChar('J'), {QString("JOIN")}}, {QChar('L'), {QString("LEADING"), QString("LEFT"), QString("LIKE"), QString("LIMIT"), - QString("LOCALTIME"), QString("LOCALTIMESTAMP")}}, + QString("LOCALTIME"), QString("LOCALTIMESTAMP")}}, {QChar('N'), {QString("NATURAL"), QString("NCHAR"), QString("NEW"), QString("NOCREATEDB"), - QString("NOCREATEUSER"), QString("NONE"), QString("NOT"), QString("NOTHING"), - QString("NOTIFY"), QString("NOTNULL"), QString("NULL"), QString("NULLIF"), - QString("NUMERIC")}}, + QString("NOCREATEUSER"), QString("NONE"), QString("NOT"), QString("NOTHING"), + QString("NOTIFY"), QString("NOTNULL"), QString("NULL"), QString("NULLIF"), + QString("NUMERIC")}}, {QChar('O'), {QString("OFF"), QString("OFFSET"), QString("OLD"), QString("ON"), - QString("ONLY"), QString("OR"), QString("ORDER"), QString("OUTER"), - QString("OVERLAPS"), QString("OVERLAY")}}, + QString("ONLY"), QString("OR"), QString("ORDER"), QString("OUTER"), + QString("OVERLAPS"), QString("OVERLAY")}}, {QChar('P'), {QString("PLACING"), QString("POSITION"), QString("PRIMARY")}}, {QChar('R'), {QString("REAL"), QString("REFERENCES"), QString("RIGHT"), QString("ROW")}}, {QChar('S'), {QString("SELECT"), QString("SESSION_USER"), QString("SETOF"), QString("SIMILAR"), - QString("SMALLINT"), QString("SOME"), QString("SUBSTRING")}}, + QString("SMALLINT"), QString("SOME"), QString("SUBSTRING")}}, {QChar('T'), {QString("TABLE"), QString("THEN"), QString("TIME"), QString("TIMESTAMP"), - QString("TO"), QString("TRAILING"), QString("TREAT"), QString("TRIM"), - QString("TRUE")}}, + QString("TO"), QString("TRAILING"), QString("TREAT"), QString("TRIM"), + QString("TRUE")}}, {QChar('U'), {QString("UNION"), QString("UNIQUE"), QString("USER"), QString("USING")}}, From 57174fe4c12ac0ba9ae2810446b60cfab2bbd994 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 29 Apr 2019 10:48:55 -0300 Subject: [PATCH 328/425] Added missing fields on ForeignServerWidget Added support to compar foreign servers on diff process --- libpgmodeler/src/baseobject.cpp | 2 +- libpgmodeler/src/databasemodel.cpp | 2 + libpgmodeler/src/foreigndatawrapper.cpp | 2 +- libpgmodeler/src/foreignserver.cpp | 21 ++++++++ libpgmodeler/src/foreignserver.h | 1 + libpgmodeler_ui/src/foreignserverwidget.cpp | 7 ++- libpgmodeler_ui/src/modelexporthelper.cpp | 5 +- libpgmodeler_ui/ui/foreignserverwidget.ui | 60 ++++++++++++++++++--- 8 files changed, 87 insertions(+), 13 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 19f80e442e..75766ea930 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -457,7 +457,7 @@ bool BaseObject::acceptsAlterCommand(ObjectType obj_type) obj_type==ObjectType::Schema || obj_type==ObjectType::Sequence || obj_type==ObjectType::Table || obj_type==ObjectType::Tablespace || obj_type==ObjectType::Type || obj_type==ObjectType::Policy || - obj_type==ObjectType::ForeignDataWrapper); + obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::ForeignServer); } bool BaseObject::acceptsDropCommand(ObjectType obj_type) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index ba2fe8eafb..38fa4cfdab 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -5980,6 +5980,8 @@ ForeignServer *DatabaseModel::createServer(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(server); + server->setType(attribs[Attributes::Type]); + server->setVersion(attribs[Attributes::Version]); options = attribs[Attributes::Options].split(ForeignDataWrapper::OptionsSeparator); for(auto &option : options) diff --git a/libpgmodeler/src/foreigndatawrapper.cpp b/libpgmodeler/src/foreigndatawrapper.cpp index 5832934404..86b620e8a1 100644 --- a/libpgmodeler/src/foreigndatawrapper.cpp +++ b/libpgmodeler/src/foreigndatawrapper.cpp @@ -113,7 +113,7 @@ QString ForeignDataWrapper::getAlterDefinition(BaseObject *object) { ForeignDataWrapper *fdw=dynamic_cast(object); attribs_map attribs; - QStringList opts, func_attribs = { Attributes::ValidatorFunc, Attributes::HandlerFunc }; + QStringList func_attribs = { Attributes::ValidatorFunc, Attributes::HandlerFunc }; Function *this_funcs[2] = { this->getValidatorFunction(), this->getHandlerFunction() }, *fdw_funcs[2] = { fdw->getValidatorFunction(), fdw->getHandlerFunction() }, *this_func = nullptr, *fdw_func = nullptr; diff --git a/libpgmodeler/src/foreignserver.cpp b/libpgmodeler/src/foreignserver.cpp index 47eda915d5..745ccb4f32 100644 --- a/libpgmodeler/src/foreignserver.cpp +++ b/libpgmodeler/src/foreignserver.cpp @@ -79,3 +79,24 @@ QString ForeignServer::getCodeDefinition(unsigned def_type) setOptionsAttribute(def_type); return(this->BaseObject::__getCodeDefinition(def_type)); } + +QString ForeignServer::getAlterDefinition(BaseObject *object) +{ + try + { + ForeignServer *server=dynamic_cast(object); + attribs_map attribs; + + attributes[Attributes::AlterCmds] = ForeignObject::getAlterDefinition(server); + + if(this->version != server->version) + attribs[Attributes::Version] = server->version; + + copyAttributes(attribs); + return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } +} diff --git a/libpgmodeler/src/foreignserver.h b/libpgmodeler/src/foreignserver.h index def3df843f..109fd3b5b7 100644 --- a/libpgmodeler/src/foreignserver.h +++ b/libpgmodeler/src/foreignserver.h @@ -47,6 +47,7 @@ class ForeignServer: public ForeignObject { ForeignDataWrapper *getForeignDataWrapper(void); virtual QString getCodeDefinition(unsigned def_type); + virtual QString getAlterDefinition(BaseObject *object); }; #endif diff --git a/libpgmodeler_ui/src/foreignserverwidget.cpp b/libpgmodeler_ui/src/foreignserverwidget.cpp index b1e30ad3aa..4940e32047 100644 --- a/libpgmodeler_ui/src/foreignserverwidget.cpp +++ b/libpgmodeler_ui/src/foreignserverwidget.cpp @@ -50,7 +50,7 @@ ForeignServerWidget::ForeignServerWidget(QWidget *parent): BaseObjectWidget(pare setRequiredField(fdw_sel); setRequiredField(fdw_lbl); - configureTabOrder({ fdw_sel, options_tab }); + configureTabOrder({ type_edt, version_edt, fdw_sel, options_tab }); setMinimumSize(600, 420); } @@ -68,6 +68,8 @@ void ForeignServerWidget::setAttributes(DatabaseModel *model, OperationList *op_ if(server) { + version_edt->setText(server->getVersion()); + type_edt->setText(server->getType()); fdw_sel->setSelectedObject(server->getForeignDataWrapper()); options_tab->blockSignals(true); @@ -98,6 +100,9 @@ void ForeignServerWidget::applyConfiguration(void) for(unsigned row = 0; row < options_tab->getRowCount(); row++) server->setOption(options_tab->getCellText(row, 0), options_tab->getCellText(row, 1)); + server->setVersion(version_edt->text()); + server->setType(type_edt->text()); + BaseObjectWidget::applyConfiguration(); finishConfiguration(); } diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 93c1281adc..6d3e4a1489 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -782,7 +782,8 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co ObjectType::OpClass, ObjectType::Operator, ObjectType::Sequence, ObjectType::Conversion, ObjectType::Cast, ObjectType::Language, ObjectType::Collation, ObjectType::Extension, ObjectType::Type, - ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::Database }; + ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::ForeignServer, + ObjectType::Database }; /* Extract each SQL command from the buffer and execute them separately. This is done to permit the user, in case of error, identify what object is wrongly configured. */ @@ -889,7 +890,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co obj_type=obj_tp; - //Appeding special tokens when the object is an index or view + if(lin.startsWith(QString("CREATE")) || lin.startsWith(QString("ALTER"))) { if(obj_tp==ObjectType::Index) diff --git a/libpgmodeler_ui/ui/foreignserverwidget.ui b/libpgmodeler_ui/ui/foreignserverwidget.ui index 45ea0c7c1b..d7a915f0cd 100644 --- a/libpgmodeler_ui/ui/foreignserverwidget.ui +++ b/libpgmodeler_ui/ui/foreignserverwidget.ui @@ -6,8 +6,8 @@ 0 0 - 337 - 130 + 462 + 210 @@ -29,7 +29,29 @@ 0 - + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Version: + + + + @@ -48,10 +70,10 @@ - - + + - + 0 0 @@ -59,18 +81,40 @@ 0 - 20 + 0 + + Type: + - + + + + Options + + + + + 0 + 0 + + + + + 0 + 20 + + + + From 0b27e095748d9d3468622f7dc6bbed4b7fa18765 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 29 Apr 2019 11:21:05 -0300 Subject: [PATCH 329/425] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration --- main-cli/src/pgmodelercli.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index 1e2925915c..c5fdefe516 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -739,7 +739,8 @@ void PgModelerCli::extractObjectXML(void) buf.remove(start, regexp.matchedLength()+1); //Checking if the header ends on a role declaration - end = buf.indexOf(QString("<%1").arg(Attributes::Role)); + QRegExp role_regexp = QRegExp(QString("(<%1)(.)*(<\\/%2>)").arg(Attributes::Role).arg(Attributes::Role)); + end = buf.indexOf(role_regexp); // If we found role declarations we clear the header until there if(end >= 0) @@ -774,7 +775,7 @@ void PgModelerCli::extractObjectXML(void) if(is_rel && (((short_tag && lin.contains(QString("/>"))) || - (lin.contains(QString("[a-z]+")) && !containsRelAttributes(lin))))) + (lin.contains(QString("[a-z]+")) && !containsRelAttributes(lin))))) open_tag=close_tag=true; else { From f26fdb7d1f052efddc9b2a9fdb07a2dcf269af02 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 30 Apr 2019 18:15:35 -0300 Subject: [PATCH 330/425] Start to make generic sql objects more dynamic --- libpgmodeler/src/genericsql.cpp | 84 +++++++++++-- libpgmodeler/src/genericsql.h | 25 +++- libpgmodeler_ui/src/genericsqlwidget.cpp | 30 ++++- libpgmodeler_ui/src/genericsqlwidget.h | 13 +- libpgmodeler_ui/ui/genericsqlwidget.ui | 144 ++++++++++++++++++++++- 5 files changed, 277 insertions(+), 19 deletions(-) diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 215ed7474c..ea97315c0e 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -20,7 +20,7 @@ GenericSQL::GenericSQL(void) { - obj_type=ObjectType::GenericSql; + obj_type = ObjectType::GenericSql; attributes[Attributes::Definition] = QString(); } @@ -35,16 +35,86 @@ QString GenericSQL::getDefinition(void) return(definition); } +bool GenericSQL::isObjectRefNameExists(const QString &ref_name) +{ + bool found = false; + vector::iterator itr = objects_refs.begin(), + itr_end = objects_refs.begin(); + + if(!ref_name.isEmpty()) + return(false); + + while(itr != itr_end && !found) + { + found = ((*itr).ref_name == ref_name); + itr++; + } + + return(found); +} + +bool GenericSQL::isObjectReferenced(BaseObject *object) +{ + bool found = false; + vector::iterator itr = objects_refs.begin(), + itr_end = objects_refs.begin(); + + if(!object) + return(false); + + while(itr != itr_end && !found) + { + found = ((*itr).object == object); + itr++; + } + + return(found); +} + +void GenericSQL::addObjectReference(const QString &ref_name, BaseObject *object, bool use_signature, bool format_name) +{ + if(BaseObject::isValidName(ref_name)) + throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + if(!object) + throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + if(isObjectRefNameExists(ref_name)) + throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + objects_refs.push_back(RefConfig(ref_name, object, use_signature, format_name)); + setCodeInvalidated(true); +} + +void GenericSQL::removeObjectReferences(void) +{ + objects_refs.clear(); + setCodeInvalidated(true); +} + QString GenericSQL::getCodeDefinition(unsigned def_type) { QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[Attributes::Definition] = definition; + if(objects_refs.empty()) + attributes[Attributes::Definition] = definition; + else + { + QString fmt_definition, ref_name, ref_value; + + for(auto &ref : objects_refs) + { + ref_name = QString("{%1}").arg(ref.ref_name); + ref_value = ref.use_signature ? + ref.object->getSignature(ref.format_name) : + ref.object->getName(ref.format_name); + + fmt_definition = fmt_definition.replace(ref_name, ref_value); + } + + attributes[Attributes::Definition] = fmt_definition; + } + return(this->BaseObject::__getCodeDefinition(def_type)); } - -/*void GenericSQL::operator = (GenericSQL &genericsql) -{ - (*dynamic_cast(this))=reinterpret_cast(genericsql); -}*/ diff --git a/libpgmodeler/src/genericsql.h b/libpgmodeler/src/genericsql.h index d06e707056..3c7320ebd6 100644 --- a/libpgmodeler/src/genericsql.h +++ b/libpgmodeler/src/genericsql.h @@ -26,19 +26,38 @@ #define GENERIC_SQL_H #include "baseobject.h" +#include class GenericSQL: public BaseObject{ - private: + private: + + struct RefConfig { + QString ref_name; + BaseObject *object; + bool use_signature, format_name; + RefConfig(const QString &_ref_name, BaseObject *_object, bool _use_signature, bool _format_name) : + ref_name(_ref_name), object(_object), use_signature(_use_signature), format_name(_format_name) {} + }; + QString definition; + vector objects_refs; + + bool isObjectRefNameExists(const QString &ref_name); + public: GenericSQL(void); void setDefinition(const QString &def); QString getDefinition(void); - //! \brief Copies the attributes between generic sql objects - // void operator = (GenericSQL &genericsql); + void setParseable(bool value); + bool isParseable(void); + + void addObjectReference(const QString &ref_name, BaseObject *object, bool use_signature, bool format_name); + map getObjectReferences(void); + void removeObjectReferences(void); + bool isObjectReferenced(BaseObject *object); virtual QString getCodeDefinition(unsigned def_type); }; diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 049b8cf6e4..4a27641a02 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -23,16 +23,40 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob Ui_GenericSQLWidget::setupUi(this); configureFormLayout(genericsql_grid, ObjectType::GenericSql); - definition_txt = PgModelerUiNs::createNumberedTextEditor(sqlcode_grp, true); + ref_name_ht = new HintTextWidget(ref_name_hint, this); + ref_name_ht->setText(ref_name_edt->statusTip()); + + use_signature_ht = new HintTextWidget(use_signature_hint, this); + use_signature_ht->setText(use_signature_chk->statusTip()); + + format_name_ht = new HintTextWidget(format_name_hint, this); + format_name_ht->setText(format_name_chk->statusTip()); + + definition_txt = PgModelerUiNs::createNumberedTextEditor(attribs_tbw->widget(0), true); definition_hl = new SyntaxHighlighter(definition_txt); definition_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - definition_cp=new CodeCompletionWidget(definition_txt, true); comment_edt->setVisible(false); comment_lbl->setVisible(false); - sqlcode_grp->layout()->setContentsMargins(4,4,4,4); + preview_txt = PgModelerUiNs::createNumberedTextEditor(attribs_tbw->widget(2), false); + preview_txt->setReadOnly(true); + preview_hl = new SyntaxHighlighter(preview_txt); + preview_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); + preview_txt->setPlainText(trUtf8("-- Preview isn't available when there's no variables configured. --")); + + attribs_tbw->widget(0)->layout()->setContentsMargins(4,4,4,4); + attribs_tbw->widget(0)->layout()->addWidget(definition_txt); + + attribs_tbw->widget(2)->layout()->setContentsMargins(4,4,4,4); + attribs_tbw->widget(2)->layout()->addWidget(preview_txt); + + object_sel = new ObjectSelectorWidget(BaseObject::getObjectTypes(false, { ObjectType::Database}), true, this); + objects_refs_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons, true, this); + references_grid->addWidget(object_sel, 1, 1, 1, 6); + references_grid->addWidget(objects_refs_tab, 2, 0, 1, 7); + setMinimumSize(700, 500); } diff --git a/libpgmodeler_ui/src/genericsqlwidget.h b/libpgmodeler_ui/src/genericsqlwidget.h index 4cbe5f2067..ac8b6f39d1 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.h +++ b/libpgmodeler_ui/src/genericsqlwidget.h @@ -28,17 +28,26 @@ #include "ui_genericsqlwidget.h" #include "baseobjectwidget.h" #include "codecompletionwidget.h" +#include "objectstablewidget.h" +#include "objectselectorwidget.h" +#include "hinttextwidget.h" class GenericSQLWidget: public BaseObjectWidget, public Ui::GenericSQLWidget { private: Q_OBJECT - NumberedTextEditor *definition_txt; + HintTextWidget *ref_name_ht, *use_signature_ht, *format_name_ht; - SyntaxHighlighter *definition_hl; + NumberedTextEditor *definition_txt, *preview_txt; + + SyntaxHighlighter *definition_hl, *preview_hl; CodeCompletionWidget *definition_cp; + ObjectsTableWidget *objects_refs_tab; + + ObjectSelectorWidget *object_sel; + public: GenericSQLWidget(QWidget * parent = nullptr); diff --git a/libpgmodeler_ui/ui/genericsqlwidget.ui b/libpgmodeler_ui/ui/genericsqlwidget.ui index b2da2e2376..0d0d2e04ea 100644 --- a/libpgmodeler_ui/ui/genericsqlwidget.ui +++ b/libpgmodeler_ui/ui/genericsqlwidget.ui @@ -7,7 +7,7 @@ 0 0 651 - 394 + 406 @@ -27,10 +27,146 @@ 2 - - - SQL code + + + 0 + + + SQL code + + + + + References + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + Name: + + + + + + + Use the referenced object's signature instead of its name. For some objects like functions, casts, operators and some others the signature will include parameters types and some other information. + + + Use signature + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + The name of the reference to an object. All occurences of the reference enclosed by <strong>{}</strong> are replaced by the referenced object's name or signature in the generic SQL object's code. + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + The referenced object's name or signature will be automatically quoted when special characters are found. Additionally, for schema qualified objects, the name of the parent schema is prepended to the referenced object's name or signature. This will avoid common SQL syntax errors or loss of semantics. + + + Format name + + + + + + + Object: + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + + Preview + + From 2ea9e0e204fe061577fb8206b80a3d101092cb7d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 30 Apr 2019 18:15:50 -0300 Subject: [PATCH 331/425] Adding missing schema file foreignserver.sch --- schemas/alter/foreignserver.sch | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 schemas/alter/foreignserver.sch diff --git a/schemas/alter/foreignserver.sch b/schemas/alter/foreignserver.sch new file mode 100644 index 0000000000..528ce6b27d --- /dev/null +++ b/schemas/alter/foreignserver.sch @@ -0,0 +1,25 @@ +# SQL definition for foreign sever's attributes change +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +{alter-cmds} + +%if {has-changes} %then + [ALTER ] {sql-object} $sp {signature} + + %if {version} %then + [ VERSION ] '{version}' + + %end + + %if {options} %then + $br $tb + [ OPTIONS (] {options} [)] + %end + +; $br + +[-- ddl-end --] $br + +%end + From 654d90bc85f742416d7b43ba17d3b58971b7ec97 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 3 May 2019 16:16:48 -0300 Subject: [PATCH 332/425] Adding some logics to GenericSQLWidget in order to add and remove a single object reference --- libpgmodeler/src/genericsql.cpp | 50 ++-- libpgmodeler/src/genericsql.h | 9 +- .../src/databaseexplorerwidget.cpp | 6 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 96 ++++++- libpgmodeler_ui/src/genericsqlwidget.h | 9 +- libpgmodeler_ui/src/objectstablewidget.cpp | 6 +- libpgmodeler_ui/src/objectstablewidget.h | 3 + libpgmodeler_ui/ui/genericsqlwidget.ui | 245 +++++++++++------- libutils/src/exception.cpp | 5 +- libutils/src/exception.h | 7 +- 10 files changed, 300 insertions(+), 136 deletions(-) diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index ea97315c0e..664554f881 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -35,29 +35,34 @@ QString GenericSQL::getDefinition(void) return(definition); } -bool GenericSQL::isObjectRefNameExists(const QString &ref_name) +int GenericSQL::getObjectRefNameIndex(const QString &ref_name) { - bool found = false; + int idx = -1; vector::iterator itr = objects_refs.begin(), - itr_end = objects_refs.begin(); + itr_end = objects_refs.end(); - if(!ref_name.isEmpty()) - return(false); + if(ref_name.isEmpty()) + return(-1); - while(itr != itr_end && !found) + while(itr != itr_end) { - found = ((*itr).ref_name == ref_name); + if((*itr).ref_name == ref_name) + { + idx = itr - objects_refs.begin(); + break; + } + itr++; } - return(found); + return(idx); } bool GenericSQL::isObjectReferenced(BaseObject *object) { bool found = false; vector::iterator itr = objects_refs.begin(), - itr_end = objects_refs.begin(); + itr_end = objects_refs.end(); if(!object) return(false); @@ -71,21 +76,32 @@ bool GenericSQL::isObjectReferenced(BaseObject *object) return(found); } -void GenericSQL::addObjectReference(const QString &ref_name, BaseObject *object, bool use_signature, bool format_name) +void GenericSQL::addObjectReference(BaseObject *object, const QString &ref_name, bool use_signature, bool format_name) { - if(BaseObject::isValidName(ref_name)) - throw Exception(ErrorCode::AsgInvalidNameObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!object) - throw Exception(ErrorCode::AsgNotAllocattedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + throw Exception(ErrorCode::AsgNotAllocatedObjectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(isObjectRefNameExists(ref_name)) - throw Exception(ErrorCode::InsDuplicatedElement,__PRETTY_FUNCTION__,__FILE__,__LINE__); + if(!BaseObject::isValidName(ref_name)) + throw Exception(ErrorCode::AsgInvalidNameObjReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + if(getObjectRefNameIndex(ref_name) >= 0) + throw Exception(Exception::getErrorMessage(ErrorCode::InsDuplicatedObjectReference).arg(ref_name), + ErrorCode::InsDuplicatedObjectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); objects_refs.push_back(RefConfig(ref_name, object, use_signature, format_name)); setCodeInvalidated(true); } +void GenericSQL::removeObjectReference(const QString &ref_name) +{ + int idx = getObjectRefNameIndex(ref_name); + + if(idx >= 0) + objects_refs.erase(objects_refs.begin() + idx); + + setCodeInvalidated(true); +} + void GenericSQL::removeObjectReferences(void) { objects_refs.clear(); @@ -101,7 +117,7 @@ QString GenericSQL::getCodeDefinition(unsigned def_type) attributes[Attributes::Definition] = definition; else { - QString fmt_definition, ref_name, ref_value; + QString fmt_definition = definition, ref_name, ref_value; for(auto &ref : objects_refs) { diff --git a/libpgmodeler/src/genericsql.h b/libpgmodeler/src/genericsql.h index 3c7320ebd6..97cc84cf32 100644 --- a/libpgmodeler/src/genericsql.h +++ b/libpgmodeler/src/genericsql.h @@ -43,7 +43,7 @@ class GenericSQL: public BaseObject{ vector objects_refs; - bool isObjectRefNameExists(const QString &ref_name); + int getObjectRefNameIndex(const QString &ref_name); public: GenericSQL(void); @@ -51,11 +51,8 @@ class GenericSQL: public BaseObject{ void setDefinition(const QString &def); QString getDefinition(void); - void setParseable(bool value); - bool isParseable(void); - - void addObjectReference(const QString &ref_name, BaseObject *object, bool use_signature, bool format_name); - map getObjectReferences(void); + void addObjectReference(BaseObject *object, const QString &ref_name, bool use_signature, bool format_name); + void removeObjectReference(const QString &ref_name); void removeObjectReferences(void); bool isObjectReferenced(BaseObject *object); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 8f82842ae8..f7bce9324c 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -28,7 +28,7 @@ const QString DatabaseExplorerWidget::DepNotDefined=QString(); const QString DatabaseExplorerWidget::DepNotFound=QT_TR_NOOP("(not found, OID: %1)"); const QString DatabaseExplorerWidget::ElemSeparator=QString("•"); -const QString DatabaseExplorerWidget::DefaultSourceCode=QT_TR_NOOP("-- Source code not generated! Hit F7 or middle-click the item to load it. --"); +const QString DatabaseExplorerWidget::DefaultSourceCode=QString("-- %1 --").arg(QT_TR_NOOP("Source code not generated! Hit F7 or middle-click the item to load it.")); const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::AdminRoles, QT_TR_NOOP("Admin. roles")}, {Attributes::Alignment, QT_TR_NOOP("Alignment")}, @@ -1850,7 +1850,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) if(obj_type==ObjectType::Type && (oid <= sys_oid || attribs[Attributes::Configuration]==Attributes::BaseType)) { - source=trUtf8("-- Source code genaration for buil-in and base types currently unavailable --"); + source=QString("-- %1 --").arg(trUtf8("Source code genaration for built-in and base types currently unavailable.")); emit s_sourceCodeShowRequested(source); } else @@ -1904,7 +1904,7 @@ void DatabaseExplorerWidget::loadObjectSource(void) if(object) source=getObjectSource(object, &dbmodel); else - source=trUtf8("-- Source code unavailable for the object %1 (%2). --").arg(name).arg(BaseObject::getTypeName(obj_type)); + source=QString("-- %1 --").arg(trUtf8("Source code unavailable for the object %1 (%2).").arg(name).arg(BaseObject::getTypeName(obj_type))); } } diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 4a27641a02..46b61921a1 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -44,7 +44,6 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob preview_txt->setReadOnly(true); preview_hl = new SyntaxHighlighter(preview_txt); preview_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); - preview_txt->setPlainText(trUtf8("-- Preview isn't available when there's no variables configured. --")); attribs_tbw->widget(0)->layout()->setContentsMargins(4,4,4,4); attribs_tbw->widget(0)->layout()->addWidget(definition_txt); @@ -52,12 +51,46 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob attribs_tbw->widget(2)->layout()->setContentsMargins(4,4,4,4); attribs_tbw->widget(2)->layout()->addWidget(preview_txt); - object_sel = new ObjectSelectorWidget(BaseObject::getObjectTypes(false, { ObjectType::Database}), true, this); + object_sel = new ObjectSelectorWidget(BaseObject::getObjectTypes(false, { ObjectType::Database, ObjectType::GenericSql, + ObjectType::Permission, ObjectType::Relationship, + ObjectType::Tag, ObjectType::Textbox }), true, this); objects_refs_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons, true, this); - references_grid->addWidget(object_sel, 1, 1, 1, 6); - references_grid->addWidget(objects_refs_tab, 2, 0, 1, 7); + references_grid->addWidget(object_sel, 0, 1, 1, 1); + references_grid->addWidget(objects_refs_tab, 2, 0, 1, 2); + + objects_refs_tab->setColumnCount(5); + objects_refs_tab->setHeaderLabel(trUtf8("Ref. name"), 0); + objects_refs_tab->setHeaderIcon(QIcon(PgModelerUiNs::getIconPath("uid")), 0); + + objects_refs_tab->setHeaderLabel(trUtf8("Object"), 1); + objects_refs_tab->setHeaderIcon(QIcon(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::Table))), 1); + + objects_refs_tab->setHeaderLabel(trUtf8("Type"), 2); + objects_refs_tab->setHeaderIcon(QIcon(PgModelerUiNs::getIconPath(BaseObject::getSchemaName(ObjectType::Type))), 2); + + objects_refs_tab->setHeaderLabel(trUtf8("Signature"), 3); + objects_refs_tab->setHeaderLabel(trUtf8("Format name"), 4); setMinimumSize(700, 500); + updateCodePreview(); + + connect(object_sel, &ObjectSelectorWidget::s_selectorChanged, [&](bool selected){ + sel_obj_icon_lbl->setPixmap(selected ? PgModelerUiNs::getIconPath(object_sel->getSelectedObject()->getSchemaName()) : QPixmap()); + sel_obj_icon_lbl->setToolTip(selected ? object_sel->getSelectedObject()->getTypeName() : QString()); + }); + + connect(objects_refs_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addObjectReference(int))); + + connect(objects_refs_tab, &ObjectsTableWidget::s_rowAboutToRemove, [&](int row){ + QString ref_name = objects_refs_tab->getCellText(row, 0); + dummy_gsql.removeObjectReference(ref_name); + updateCodePreview(); + }); + + connect(objects_refs_tab, &ObjectsTableWidget::s_rowsRemoved, [&](){ + dummy_gsql.removeObjectReferences(); + updateCodePreview(); + }); } void GenericSQLWidget::setAttributes(DatabaseModel *model, OperationList *op_list, GenericSQL *genericsql) @@ -67,7 +100,8 @@ void GenericSQLWidget::setAttributes(DatabaseModel *model, OperationList *op_lis BaseObjectWidget::setAttributes(model, op_list, genericsql); - definition_cp->configureCompletion(this->model, definition_hl); + object_sel->setModel(model); + definition_cp->configureCompletion(model, definition_hl); } void GenericSQLWidget::applyConfiguration(void) @@ -90,3 +124,55 @@ void GenericSQLWidget::applyConfiguration(void) } } +void GenericSQLWidget::addObjectReference(int row) +{ + try + { + QString ref_name = ref_name_edt->text(); + BaseObject *object = object_sel->getSelectedObject(); + bool use_signature = use_signature_chk->isChecked(), + format_name = format_name_chk->isChecked(); + + dummy_gsql.addObjectReference(object, ref_name, use_signature, format_name); + objects_refs_tab->setCellText(ref_name, row, 0); + objects_refs_tab->setCellText(use_signature ? object->getSignature(format_name) : object->getName(format_name), row, 1); + objects_refs_tab->setCellText(object->getTypeName(), row, 2); + objects_refs_tab->setCellText(use_signature ? trUtf8("Yes") : trUtf8("No"), row, 3); + objects_refs_tab->setCellText(use_signature ? trUtf8("Yes") : trUtf8("No"), row, 4); + + clearObjectReferenceForm(); + updateCodePreview(); + } + catch(Exception &e) + { + objects_refs_tab->removeRow(row); + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void GenericSQLWidget::clearObjectReferenceForm(void) +{ + object_sel->clearSelector(); + ref_name_edt->clear(); + use_signature_chk->setChecked(false); + format_name_chk->setChecked(false); +} + +void GenericSQLWidget::updateCodePreview(void) +{ + try + { + if(objects_refs_tab->getRowCount() > 0 && !definition_txt->toPlainText().isEmpty()) + { + dummy_gsql.setDefinition(definition_txt->toPlainText()); + preview_txt->setPlainText(dummy_gsql.getCodeDefinition(SchemaParser::SqlDefinition)); + } + else + preview_txt->setPlainText(QString("-- %1 --").arg(trUtf8("No definition SQL code or references defined! Preview unavailable."))); + } + catch(Exception &e) + { + preview_txt->setPlainText(QString("/* %1 */").arg(e.getExceptionsText())); + } +} + diff --git a/libpgmodeler_ui/src/genericsqlwidget.h b/libpgmodeler_ui/src/genericsqlwidget.h index ac8b6f39d1..4258f022d5 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.h +++ b/libpgmodeler_ui/src/genericsqlwidget.h @@ -48,13 +48,20 @@ class GenericSQLWidget: public BaseObjectWidget, public Ui::GenericSQLWidget { ObjectSelectorWidget *object_sel; + GenericSQL dummy_gsql; + + void clearObjectReferenceForm(void); + void updateCodePreview(void); + public: GenericSQLWidget(QWidget * parent = nullptr); - void setAttributes(DatabaseModel *model, OperationList *op_list, GenericSQL *genericsql=nullptr); public slots: void applyConfiguration(void); + + private slots: + void addObjectReference(int row); }; #endif diff --git a/libpgmodeler_ui/src/objectstablewidget.cpp b/libpgmodeler_ui/src/objectstablewidget.cpp index 267b460575..b89ee381c3 100644 --- a/libpgmodeler_ui/src/objectstablewidget.cpp +++ b/libpgmodeler_ui/src/objectstablewidget.cpp @@ -407,10 +407,14 @@ void ObjectsTableWidget::removeRow(void) { setRowData(QVariant::fromValue(nullptr), row_idx); item->setData(Qt::UserRole, QVariant::fromValue(nullptr)); - emit s_rowRemoved(row_idx); + + emit s_rowAboutToRemove(row_idx); + table_tbw->removeRow(row_idx); table_tbw->setCurrentItem(nullptr); setButtonsEnabled(); + + emit s_rowRemoved(row_idx); } } } diff --git a/libpgmodeler_ui/src/objectstablewidget.h b/libpgmodeler_ui/src/objectstablewidget.h index 8651d98bdb..545c797ace 100644 --- a/libpgmodeler_ui/src/objectstablewidget.h +++ b/libpgmodeler_ui/src/objectstablewidget.h @@ -191,6 +191,9 @@ class ObjectsTableWidget: public QWidget, public Ui::ObjectsTableWidget { //! \brief Signal emitted when a single row is removed. The row index is sent together with the signal void s_rowRemoved(int); + //! \brief Signal emitted when a single row is about to be removed. The row index is sent together with the signal + void s_rowAboutToRemove(int); + //! \brief Signal emitted when a row is selected. The row index is sent together with the signal void s_rowSelected(int); diff --git a/libpgmodeler_ui/ui/genericsqlwidget.ui b/libpgmodeler_ui/ui/genericsqlwidget.ui index 0d0d2e04ea..030655f6e7 100644 --- a/libpgmodeler_ui/ui/genericsqlwidget.ui +++ b/libpgmodeler_ui/ui/genericsqlwidget.ui @@ -7,7 +7,7 @@ 0 0 651 - 406 + 418 @@ -54,111 +54,156 @@ 4 - - - Name: - - - - - - - Use the referenced object's signature instead of its name. For some objects like functions, casts, operators and some others the signature will include parameters types and some other information. - - - Use signature - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - - - - - The name of the reference to an object. All occurences of the reference enclosed by <strong>{}</strong> are replaced by the referenced object's name or signature in the generic SQL object's code. - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - - - - - The referenced object's name or signature will be automatically quoted when special characters are found. Additionally, for schema qualified objects, the name of the parent schema is prepended to the referenced object's name or signature. This will avoid common SQL syntax errors or loss of semantics. - - - Format name - - + + + + + Object: + + + + + + + + 0 + 0 + + + + + 32 + 32 + + + + + 32 + 32 + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + false + + + Qt::AlignCenter + + + + - + - Object: + Ref. name: - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - + + + + + + The name of the reference to an object. All occurences of the reference enclosed by <strong>{}</strong> are replaced by the referenced object's name or signature in the generic SQL object's code. + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + Use the referenced object's signature instead of its name. For some objects like functions, casts, operators and some others the signature will include parameters types and some other information. + + + Use signature + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + + + The referenced object's name or signature will be automatically quoted when special characters are found. Additionally, for schema qualified objects, the name of the parent schema is prepended to the referenced object's name or signature. This will avoid common SQL syntax errors or loss of semantics. + + + Format name + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index c38dc58197..33a3a60314 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -260,7 +260,10 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"PartKeyObjectInexistsModel", QT_TR_NOOP("A partition key of the table `%1' is referencing the object `%3' (%4) which was not found in the model!")}, {"AsgInvalidColumnPartitionKey", QT_TR_NOOP("The column `%1' can't be assigned to a partition key because it was created by a relatinship and this kind of operation is not yet supported! HINT: create the column manually on the table and then create the partition key using it.")}, {"RemColumnRefByPartitionKey", QT_TR_NOOP("The column `%1' on the table `%2' can't be removed because it is being referenced by one or more patition keys!")}, - {"AsgOptionInvalidName", QT_TR_NOOP("Assignment of an option to the object with an invalid name!")} + {"AsgOptionInvalidName", QT_TR_NOOP("Assignment of an option to the object with an invalid name!")}, + {"AsgInvalidNameObjReference", QT_TR_NOOP("Assignment of an invalid name to the object reference!")}, + {"AsgNotAllocatedObjectReference", QT_TR_NOOP("Assignment of a not allocated object to the object reference!")}, + {"InsDuplicatedObjectReference", QT_TR_NOOP("The object reference name `%1' is already defined!")}, }; Exception::Exception(void) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 5054e37f5d..e61a73b44a 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -285,12 +285,15 @@ enum class ErrorCode: unsigned { PartKeyObjectInexistsModel, AsgInvalidColumnPartitionKey, RemColumnRefByPartitionKey, - AsgOptionInvalidName + AsgOptionInvalidName, + AsgInvalidNameObjReference, + AsgNotAllocatedObjectReference, + InsDuplicatedObjectReference }; class Exception { private: - static constexpr unsigned ErrorCount=242; + static constexpr unsigned ErrorCount=245; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ From d295dce709497a005c86b7e96ae870aa3db01602 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 3 May 2019 17:12:38 -0300 Subject: [PATCH 333/425] Added support to update object references --- libpgmodeler/src/genericsql.cpp | 48 +++++++++++++++++---- libpgmodeler/src/genericsql.h | 2 + libpgmodeler_ui/src/genericsqlwidget.cpp | 53 +++++++++++++++++++----- libpgmodeler_ui/src/genericsqlwidget.h | 7 +++- schemas/xml/dtd/genericsql.dtd | 2 +- 5 files changed, 92 insertions(+), 20 deletions(-) diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 664554f881..4d2c30129a 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -76,20 +76,54 @@ bool GenericSQL::isObjectReferenced(BaseObject *object) return(found); } -void GenericSQL::addObjectReference(BaseObject *object, const QString &ref_name, bool use_signature, bool format_name) +void GenericSQL::validateObjectReference(GenericSQL::RefConfig ref) { - if(!object) + if(!ref.object) throw Exception(ErrorCode::AsgNotAllocatedObjectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(!BaseObject::isValidName(ref_name)) + if(!BaseObject::isValidName(ref.ref_name)) throw Exception(ErrorCode::AsgInvalidNameObjReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(getObjectRefNameIndex(ref_name) >= 0) - throw Exception(Exception::getErrorMessage(ErrorCode::InsDuplicatedObjectReference).arg(ref_name), + if(getObjectRefNameIndex(ref.ref_name) >= 0) + throw Exception(Exception::getErrorMessage(ErrorCode::InsDuplicatedObjectReference).arg(ref.ref_name), ErrorCode::InsDuplicatedObjectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); +} - objects_refs.push_back(RefConfig(ref_name, object, use_signature, format_name)); - setCodeInvalidated(true); +void GenericSQL::addObjectReference(BaseObject *object, const QString &ref_name, bool use_signature, bool format_name) +{ + try + { + RefConfig ref = RefConfig(ref_name, object, use_signature, format_name); + validateObjectReference(ref); + objects_refs.push_back(ref); + setCodeInvalidated(true); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } +} + +void GenericSQL::updateObjectReference(const QString &ref_name, BaseObject *object, const QString &new_ref_name, bool use_signature, bool format_name) +{ + int idx = getObjectRefNameIndex(ref_name); + + if(idx < 0) + return; + + try + { + RefConfig ref = RefConfig(new_ref_name, object, use_signature, format_name); + vector::iterator itr = objects_refs.begin() + idx; + + validateObjectReference(ref); + (*itr) = ref; + setCodeInvalidated(true); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } } void GenericSQL::removeObjectReference(const QString &ref_name) diff --git a/libpgmodeler/src/genericsql.h b/libpgmodeler/src/genericsql.h index 97cc84cf32..bbe9431aaa 100644 --- a/libpgmodeler/src/genericsql.h +++ b/libpgmodeler/src/genericsql.h @@ -44,6 +44,7 @@ class GenericSQL: public BaseObject{ vector objects_refs; int getObjectRefNameIndex(const QString &ref_name); + void validateObjectReference(RefConfig ref); public: GenericSQL(void); @@ -52,6 +53,7 @@ class GenericSQL: public BaseObject{ QString getDefinition(void); void addObjectReference(BaseObject *object, const QString &ref_name, bool use_signature, bool format_name); + void updateObjectReference(const QString &ref_name, BaseObject *object, const QString &new_ref_name, bool use_signature, bool format_name); void removeObjectReference(const QString &ref_name); void removeObjectReferences(void); bool isObjectReferenced(BaseObject *object); diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 46b61921a1..f0fc01bd19 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -72,7 +72,6 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob objects_refs_tab->setHeaderLabel(trUtf8("Format name"), 4); setMinimumSize(700, 500); - updateCodePreview(); connect(object_sel, &ObjectSelectorWidget::s_selectorChanged, [&](bool selected){ sel_obj_icon_lbl->setPixmap(selected ? PgModelerUiNs::getIconPath(object_sel->getSelectedObject()->getSchemaName()) : QPixmap()); @@ -80,17 +79,19 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob }); connect(objects_refs_tab, SIGNAL(s_rowAdded(int)), this, SLOT(addObjectReference(int))); + connect(objects_refs_tab, SIGNAL(s_rowEdited(int)), this, SLOT(editObjectReference(int))); + connect(objects_refs_tab, SIGNAL(s_rowUpdated(int)), this, SLOT(updateObjectReference(int))); connect(objects_refs_tab, &ObjectsTableWidget::s_rowAboutToRemove, [&](int row){ QString ref_name = objects_refs_tab->getCellText(row, 0); dummy_gsql.removeObjectReference(ref_name); - updateCodePreview(); }); connect(objects_refs_tab, &ObjectsTableWidget::s_rowsRemoved, [&](){ dummy_gsql.removeObjectReferences(); - updateCodePreview(); }); + + connect(attribs_tbw, SIGNAL(currentChanged(int)), this, SLOT(updateCodePreview())); } void GenericSQLWidget::setAttributes(DatabaseModel *model, OperationList *op_list, GenericSQL *genericsql) @@ -134,14 +135,8 @@ void GenericSQLWidget::addObjectReference(int row) format_name = format_name_chk->isChecked(); dummy_gsql.addObjectReference(object, ref_name, use_signature, format_name); - objects_refs_tab->setCellText(ref_name, row, 0); - objects_refs_tab->setCellText(use_signature ? object->getSignature(format_name) : object->getName(format_name), row, 1); - objects_refs_tab->setCellText(object->getTypeName(), row, 2); - objects_refs_tab->setCellText(use_signature ? trUtf8("Yes") : trUtf8("No"), row, 3); - objects_refs_tab->setCellText(use_signature ? trUtf8("Yes") : trUtf8("No"), row, 4); - + showObjectReferenceData(row, object, ref_name, use_signature, format_name); clearObjectReferenceForm(); - updateCodePreview(); } catch(Exception &e) { @@ -150,6 +145,34 @@ void GenericSQLWidget::addObjectReference(int row) } } +void GenericSQLWidget::editObjectReference(int row) +{ + ref_name_edt->setText(objects_refs_tab->getCellText(row, 0)); + use_signature_chk->setChecked(objects_refs_tab->getCellText(row, 3) == trUtf8("Yes")); + format_name_chk->setChecked(objects_refs_tab->getCellText(row, 4) == trUtf8("Yes")); + object_sel->setSelectedObject(reinterpret_cast(objects_refs_tab->getRowData(row).value())); +} + +void GenericSQLWidget::updateObjectReference(int row) +{ + QString ref_name = objects_refs_tab->getCellText(row, 0), + new_ref_name = ref_name_edt->text(); + BaseObject *object = object_sel->getSelectedObject(); + bool use_signature = use_signature_chk->isChecked(), + format_name = format_name_chk->isChecked(); + + try + { + dummy_gsql.updateObjectReference(ref_name, object, new_ref_name, use_signature, format_name); + showObjectReferenceData(row, object, new_ref_name, use_signature, format_name); + clearObjectReferenceForm(); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } +} + void GenericSQLWidget::clearObjectReferenceForm(void) { object_sel->clearSelector(); @@ -176,3 +199,13 @@ void GenericSQLWidget::updateCodePreview(void) } } +void GenericSQLWidget::showObjectReferenceData(int row, BaseObject *object, const QString &ref_name, bool use_signature, bool format_name) +{ + objects_refs_tab->setCellText(ref_name, row, 0); + objects_refs_tab->setCellText(use_signature ? object->getSignature(format_name) : object->getName(format_name), row, 1); + objects_refs_tab->setCellText(object->getTypeName(), row, 2); + objects_refs_tab->setCellText(use_signature ? trUtf8("Yes") : trUtf8("No"), row, 3); + objects_refs_tab->setCellText(format_name ? trUtf8("Yes") : trUtf8("No"), row, 4); + objects_refs_tab->setRowData(QVariant::fromValue(reinterpret_cast(object)), row); +} + diff --git a/libpgmodeler_ui/src/genericsqlwidget.h b/libpgmodeler_ui/src/genericsqlwidget.h index 4258f022d5..2c8b875e83 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.h +++ b/libpgmodeler_ui/src/genericsqlwidget.h @@ -50,8 +50,7 @@ class GenericSQLWidget: public BaseObjectWidget, public Ui::GenericSQLWidget { GenericSQL dummy_gsql; - void clearObjectReferenceForm(void); - void updateCodePreview(void); + void showObjectReferenceData(int row, BaseObject *object, const QString &ref_name, bool use_signature, bool format_name); public: GenericSQLWidget(QWidget * parent = nullptr); @@ -61,7 +60,11 @@ class GenericSQLWidget: public BaseObjectWidget, public Ui::GenericSQLWidget { void applyConfiguration(void); private slots: + void updateCodePreview(void); void addObjectReference(int row); + void editObjectReference(int row); + void updateObjectReference(int row); + void clearObjectReferenceForm(void); }; #endif diff --git a/schemas/xml/dtd/genericsql.dtd b/schemas/xml/dtd/genericsql.dtd index 40ec0a02f5..f1a1c8ea5a 100644 --- a/schemas/xml/dtd/genericsql.dtd +++ b/schemas/xml/dtd/genericsql.dtd @@ -2,7 +2,7 @@ CAUTION: Do not modify this file directly on it's code unless you know what you are doing. Unexpected results may occur if the code is changed deliberately. --> - + From 13f00d235c0c0aa76fe2f42c15d9eb411ac7ce77 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 3 May 2019 17:22:32 -0300 Subject: [PATCH 334/425] Improved the object reference update in GenericSQLWidget --- libpgmodeler/src/genericsql.cpp | 13 +++++++++---- libpgmodeler/src/genericsql.h | 2 +- libpgmodeler_ui/src/genericsqlwidget.cpp | 3 +++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 4d2c30129a..851870a6b1 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -76,7 +76,7 @@ bool GenericSQL::isObjectReferenced(BaseObject *object) return(found); } -void GenericSQL::validateObjectReference(GenericSQL::RefConfig ref) +void GenericSQL::validateObjectReference(GenericSQL::RefConfig ref, bool ignore_duplic) { if(!ref.object) throw Exception(ErrorCode::AsgNotAllocatedObjectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -84,7 +84,7 @@ void GenericSQL::validateObjectReference(GenericSQL::RefConfig ref) if(!BaseObject::isValidName(ref.ref_name)) throw Exception(ErrorCode::AsgInvalidNameObjReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); - if(getObjectRefNameIndex(ref.ref_name) >= 0) + if(!ignore_duplic && getObjectRefNameIndex(ref.ref_name) >= 0) throw Exception(Exception::getErrorMessage(ErrorCode::InsDuplicatedObjectReference).arg(ref.ref_name), ErrorCode::InsDuplicatedObjectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); } @@ -94,7 +94,7 @@ void GenericSQL::addObjectReference(BaseObject *object, const QString &ref_name, try { RefConfig ref = RefConfig(ref_name, object, use_signature, format_name); - validateObjectReference(ref); + validateObjectReference(ref, false); objects_refs.push_back(ref); setCodeInvalidated(true); } @@ -115,8 +115,13 @@ void GenericSQL::updateObjectReference(const QString &ref_name, BaseObject *obje { RefConfig ref = RefConfig(new_ref_name, object, use_signature, format_name); vector::iterator itr = objects_refs.begin() + idx; + int idx_aux = getObjectRefNameIndex(new_ref_name); - validateObjectReference(ref); + if(idx_aux != idx) + throw Exception(Exception::getErrorMessage(ErrorCode::InsDuplicatedObjectReference).arg(new_ref_name), + ErrorCode::InsDuplicatedObjectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + validateObjectReference(ref, true); (*itr) = ref; setCodeInvalidated(true); } diff --git a/libpgmodeler/src/genericsql.h b/libpgmodeler/src/genericsql.h index bbe9431aaa..7ecfbd31b1 100644 --- a/libpgmodeler/src/genericsql.h +++ b/libpgmodeler/src/genericsql.h @@ -44,7 +44,7 @@ class GenericSQL: public BaseObject{ vector objects_refs; int getObjectRefNameIndex(const QString &ref_name); - void validateObjectReference(RefConfig ref); + void validateObjectReference(RefConfig ref, bool ignore_duplic); public: GenericSQL(void); diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index f0fc01bd19..bf5092919c 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -140,7 +140,9 @@ void GenericSQLWidget::addObjectReference(int row) } catch(Exception &e) { + objects_refs_tab->blockSignals(true); objects_refs_tab->removeRow(row); + objects_refs_tab->blockSignals(false); throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } } @@ -179,6 +181,7 @@ void GenericSQLWidget::clearObjectReferenceForm(void) ref_name_edt->clear(); use_signature_chk->setChecked(false); format_name_chk->setChecked(false); + objects_refs_tab->clearSelection(); } void GenericSQLWidget::updateCodePreview(void) From 1c37c9511122e426a05f40f24dff482888eae6ed Mon Sep 17 00:00:00 2001 From: Maxzor Date: Sun, 5 May 2019 18:37:18 +0200 Subject: [PATCH 335/425] Search comments and display comments in ObjectFinderWidget --- libpgmodeler/src/databasemodel.cpp | 18 +++++- libpgmodeler/src/databasemodel.h | 2 +- libpgmodeler_ui/src/codecompletionwidget.cpp | 6 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 2 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 11 +++- libpgmodeler_ui/ui/objectfinderwidget.ui | 68 ++++++++++++-------- 6 files changed, 72 insertions(+), 35 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 5168b50e08..950e634b53 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -9538,7 +9538,7 @@ void DatabaseModel::createSystemObjects(bool create_public) setDefaultObject(getObject(QString("public"), ObjectType::Schema), ObjectType::Schema); } -vector DatabaseModel::findObjects(const QString &pattern, vector types, bool format_obj_names, bool case_sensitive, bool is_regexp, bool exact_match) +vector DatabaseModel::findObjects(const QString &pattern, vector types, bool format_obj_names, bool case_sensitive, bool is_regexp, bool exact_match, bool search_comments) { vector list, objs; vector::iterator end; @@ -9547,7 +9547,7 @@ vector DatabaseModel::findObjects(const QString &pattern, vector DatabaseModel::findObjects(const QString &pattern, vectorgetName(true, true); obj_name.remove('"'); + obj_comment=objs.back()->getComment(); } else + { obj_name=objs.back()->getName(); + obj_comment=objs.back()->getComment(); + } - //Try to match the name on the configured regexp + //Try to match on the configured regexp the name... if((exact_match && pattern==obj_name) || (exact_match && regexp.exactMatch(obj_name)) || (!exact_match && regexp.indexIn(obj_name) >= 0)) list.push_back(objs.back()); + //...or the comment. + if(search_comments && ( + (exact_match && pattern==obj_comment) || + (exact_match && regexp.exactMatch(obj_comment)) || + (!exact_match && regexp.indexIn(obj_comment) >= 0))) + list.push_back(objs.back()); + objs.pop_back(); obj_name.clear(); + obj_comment.clear(); } //Removing the duplicate items on the list diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 493721ac29..6bef30f124 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -624,7 +624,7 @@ class DatabaseModel: public QObject, public BaseObject { /*! \brief Returns a list of object searching them using the specified pattern. The search can be delimited by filtering the object's types. The additional bool params are: case sensitive name search, name pattern is a regexp, exact match for names. */ vector findObjects(const QString &pattern, vector types, bool format_obj_names, - bool case_sensitive, bool is_regexp, bool exact_match); + bool case_sensitive, bool is_regexp, bool exact_match, bool search_comments); void setLastPosition(const QPoint &pnt); QPoint getLastPosition(void); diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index 4b8c0b5cd6..a1dac02a74 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -373,7 +373,7 @@ void CodeCompletionWidget::updateList(void) word.remove(completion_trigger); word.remove('"'); - objects=db_model->findObjects(word, { ObjectType::Schema, ObjectType::Table, ObjectType::View }, false, false, false, true); + objects=db_model->findObjects(word, { ObjectType::Schema, ObjectType::Table, ObjectType::View }, false, false, false, true, false); if(objects.size()==1) setQualifyingLevel(objects[0]); @@ -392,7 +392,7 @@ void CodeCompletionWidget::updateList(void) //Negative qualifying level means that user called the completion before a space (empty word) if(qualifying_level < 0) //The default behavior for this is to search all the objects on the model - objects=db_model->findObjects(pattern, types, false, false, !auto_triggered, auto_triggered); + objects=db_model->findObjects(pattern, types, false, false, !auto_triggered, auto_triggered, false); else { QString left_word; @@ -425,7 +425,7 @@ void CodeCompletionWidget::updateList(void) we try to find any object in the model and reset the qualifying level */ else { - objects=db_model->findObjects(pattern, types, false, false, !auto_triggered, auto_triggered); + objects=db_model->findObjects(pattern, types, false, false, !auto_triggered, auto_triggered, false); setQualifyingLevel(nullptr); } diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index f44a2bf888..a40b473d76 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -452,7 +452,7 @@ void ModelObjectsWidget::updateObjectsList(void) visible_types.push_back(tp.first); } - objects=db_model->findObjects(QString(), visible_types,true, false, false, false); + objects=db_model->findObjects(QString(), visible_types,true, false, false, false, false); } diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index a820dea1a5..18178d03c9 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -227,7 +227,7 @@ void ObjectFinderWidget::findObjects(void) //Search the objects on model found_objs=model_wgt->getDatabaseModel()->findObjects(pattern_edt->text(), types, true, - case_sensitive_chk->isChecked(), regexp_chk->isChecked(), exact_match_chk->isChecked()); + case_sensitive_chk->isChecked(), regexp_chk->isChecked(), exact_match_chk->isChecked(), comment_chk->isChecked()); //Show the found objects on the result table updateObjectTable(result_tbw, found_objs); @@ -439,6 +439,15 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorsetItem(lin_idx, 4, tab_item); } + //Sixth column: object comment + if(tab_wgt->columnCount() > 5) + { + tab_item=(new_row ? new QTableWidgetItem : tab_wgt->item(lin_idx, 5)); + tab_item->setFont(fnt); + tab_item->setText(objs[i]->getComment().size()>0 ? objs[i]->getComment() : QString("-")); + if(new_row) tab_wgt->setItem(lin_idx, 5, tab_item); + } + lin_idx++; } diff --git a/libpgmodeler_ui/ui/objectfinderwidget.ui b/libpgmodeler_ui/ui/objectfinderwidget.ui index 3380d48e29..8b8788e359 100644 --- a/libpgmodeler_ui/ui/objectfinderwidget.ui +++ b/libpgmodeler_ui/ui/objectfinderwidget.ui @@ -306,32 +306,6 @@ 4 - - - - - 0 - 0 - - - - Regular Expression - - - - - - - - 0 - 0 - - - - Exact Match - - - @@ -473,6 +447,19 @@ + + + + + 0 + 0 + + + + Regular Expression + + + @@ -486,6 +473,19 @@ + + + + + 0 + 0 + + + + Exact Match + + + @@ -499,6 +499,13 @@ + + + + Search comments + + + @@ -622,6 +629,15 @@ :/icones/icones/usertype.png:/icones/icones/usertype.png + + + Comment + + + + :/icones/icones/editar.png:/icones/icones/editar.png + + From ddfc825c9a01b603612102e54476522152dc9743 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 7 May 2019 09:57:07 -0300 Subject: [PATCH 336/425] Finished the implementation of dynamic generic sql --- libparsers/src/attributes.cpp | 3 + libparsers/src/attributes.h | 3 + libparsers/src/schemaparser.h | 90 ++++++++--------- libpgmodeler/src/databasemodel.cpp | 98 ++++++++++++++++++- libpgmodeler/src/genericsql.cpp | 90 ++++++++++++++--- libpgmodeler/src/genericsql.h | 27 +++-- libpgmodeler/src/operationlist.cpp | 8 +- libpgmodeler/src/table.cpp | 2 + libpgmodeler_ui/src/genericsqlwidget.cpp | 82 ++++++++++------ libpgmodeler_ui/src/genericsqlwidget.h | 2 + libpgmodeler_ui/src/modelvalidationhelper.cpp | 47 ++++++--- schemas/xml/dtd/dbmodel.dtd | 3 +- schemas/xml/dtd/object.dtd | 12 +++ schemas/xml/dtd/permission.dtd | 7 -- schemas/xml/genericsql.sch | 2 + schemas/xml/object.sch | 13 ++- schemas/xml/permission.sch | 9 +- 17 files changed, 366 insertions(+), 132 deletions(-) create mode 100644 schemas/xml/dtd/object.dtd diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index 2f7d86dd23..a30cb30364 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -222,6 +222,7 @@ namespace Attributes { Font=QString("font"), ForegroundColor=QString("foreground-color"), ForeignKeys=QString("foreign-keys"), + FormatName=QString("format-name"), FromExp=QString("from-exp"), FunctionType=QString("function-type"), Function=QString("function"), @@ -420,6 +421,7 @@ namespace Attributes { RecvFunc=QString("receive"), ReducedForm=QString("reduced-form"), RefAlias=QString("ref-alias"), + RefName=QString("ref-name"), RefColumn=QString("ref-column"), RefRoles=QString("ref-roles"), RefTable=QString("ref-table"), @@ -572,6 +574,7 @@ namespace Attributes { UqPattern=QString("uq-pattern"), UsagePriv=QString("usage"), UseCurvedLines=QString("use-curved-lines"), + UseSignature=QString("use-signature"), UsePlaceholders=QString("use-placeholders"), UseSorting=QString("use-sorting"), UseUniqueNames=QString("use-unique-names"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index f47c052360..109bff26e5 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -237,6 +237,7 @@ namespace Attributes { Font, ForegroundColor, ForeignKeys, + FormatName, FromExp, FunctionType, Function, @@ -432,6 +433,7 @@ namespace Attributes { RecvFunc, ReducedForm, RefAlias, + RefName, RefColumn, RefRoles, RefTable, @@ -579,6 +581,7 @@ namespace Attributes { UsagePriv, UseCurvedLines, UsePlaceholders, + UseSignature, UseSorting, UseUniqueNames, UsingExp, diff --git a/libparsers/src/schemaparser.h b/libparsers/src/schemaparser.h index 16a38f2658..b3f1b74026 100644 --- a/libparsers/src/schemaparser.h +++ b/libparsers/src/schemaparser.h @@ -45,50 +45,6 @@ class SchemaParser { attributes avoiding raising exceptions */ bool ignore_empty_atribs; - static const char CharComment, //! \brief Character that starts a comment - CharLineEnd, //! \brief Character that indicates end of line - CharSpace, //! \brief Character that indicates spacing - CharTabulation, //! \brief Character that indicates tabulation - CharIniAttribute, //! \brief Character that indicates a reference to an attribute - CharEndAttribute, //! \brief Character that delimits on the right the attribute name - CharIniConditional, //! \brief Character that starts a conditional instruction - CharIniMetachar, //! \brief Character that starts a metacharacter - CharIniPlainText, //! \brief Character that starts a plain text - CharEndPlainText, //! \brief Character that ends a plain text - CharIniCompExpr, //! \brief Character that starts a comparison expression - CharEndCompExpr, //! \brief Character that ends a comparison expression - CharValueDelim, //! \brief Character that delimiters a value (string) - CharValueOf; /*! \brief Character that is used on %set instructions to - create an attribute name based upon another attribute value */ - - //! \brief Tokens related to conditional instructions and operators - static const QString TokenIf, // %if - TokenThen,// %then - TokenElse,// %else - TokenEnd, // %end - TokenOr, // %or - TokenNot, // %not - TokenAnd, // %and - TokenSet, //%set - TokenUnset; //%unset - - //! \brief Tokens related to metacharacters - static const QString TokenMetaSp,// $sp (space) - TokenMetaBr,// $br (line break) - TokenMetaTb,// $tb (tabulation) - TokenMetaOb,// $ob (open square bracket '[') - TokenMetaCb,// $cb (close square bracket ']') - TokenMetaOc,// $ob (open curly bracket '{') - TokenMetaCc;// $cb (close curly bracket '}') - - //! \brief Tokens related to comparison expressions - static const QString TokenEqOper,// == (equal) - TokenNeOper,// != (not equal) - TokenGtOper,// > (greater than) - TokenLtOper,// < (less than) - TokenGtEqOper,// >= (greater or equal to) - TokenLtEqOper;// <= (less or equal to) - //! \brief RegExp used to validate attribute names static const QRegExp AttribRegExp; @@ -185,6 +141,50 @@ class SchemaParser { QString pgsql_version; public: + static const char CharComment, //! \brief Character that starts a comment + CharLineEnd, //! \brief Character that indicates end of line + CharSpace, //! \brief Character that indicates spacing + CharTabulation, //! \brief Character that indicates tabulation + CharIniAttribute, //! \brief Character that indicates a reference to an attribute + CharEndAttribute, //! \brief Character that delimits on the right the attribute name + CharIniConditional, //! \brief Character that starts a conditional instruction + CharIniMetachar, //! \brief Character that starts a metacharacter + CharIniPlainText, //! \brief Character that starts a plain text + CharEndPlainText, //! \brief Character that ends a plain text + CharIniCompExpr, //! \brief Character that starts a comparison expression + CharEndCompExpr, //! \brief Character that ends a comparison expression + CharValueDelim, //! \brief Character that delimiters a value (string) + CharValueOf; /*! \brief Character that is used on %set instructions to + create an attribute name based upon another attribute value */ + + //! \brief Tokens related to conditional instructions and operators + static const QString TokenIf, // %if + TokenThen,// %then + TokenElse,// %else + TokenEnd, // %end + TokenOr, // %or + TokenNot, // %not + TokenAnd, // %and + TokenSet, //%set + TokenUnset; //%unset + + //! \brief Tokens related to metacharacters + static const QString TokenMetaSp,// $sp (space) + TokenMetaBr,// $br (line break) + TokenMetaTb,// $tb (tabulation) + TokenMetaOb,// $ob (open square bracket '[') + TokenMetaCb,// $cb (close square bracket ']') + TokenMetaOc,// $ob (open curly bracket '{') + TokenMetaCc;// $cb (close curly bracket '}') + + //! \brief Tokens related to comparison expressions + static const QString TokenEqOper,// == (equal) + TokenNeOper,// != (not equal) + TokenGtOper,// > (greater than) + TokenLtOper,// < (less than) + TokenGtEqOper,// >= (greater or equal to) + TokenLtEqOper;// <= (less or equal to) + //! \brief Constants used to get a specific object definition static constexpr unsigned SqlDefinition=0, XmlDefinition=1; @@ -234,7 +234,7 @@ class SchemaParser { QStringList extractAttributes(void); /*! \brief Converts any chars (operators) < > " to the respective XML entities. This method is only - called when generating XML code and only tag attributes are treated.*/ + * called when generating XML code and only tag attributes are treated.*/ static QString convertCharsToXMLEntities(QString buf); }; diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 38fa4cfdab..c8487f35d9 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1819,6 +1819,7 @@ void DatabaseModel::storeSpecialObjectsXML(void) Trigger *trigger=nullptr; View *view=nullptr; BaseRelationship *rel=nullptr; + GenericSQL *generic_sql=nullptr; Reference ref; ObjectType tab_obj_type[3]={ ObjectType::Constraint, ObjectType::Trigger, ObjectType::Index }; bool found=false; @@ -2003,6 +2004,24 @@ void DatabaseModel::storeSpecialObjectsXML(void) delete(permission); } } + + //Making a copy of the generic SQL objects list to avoid iterator invalidation when removing an object + rem_objects.assign(genericsqls.begin(), genericsqls.end()); + itr=rem_objects.begin(); + itr_end=rem_objects.end(); + + while(itr!=itr_end) + { + generic_sql = dynamic_cast(*itr); + itr++; + + if(generic_sql->isReferRelationshipAddedObject()) + { + xml_special_objs[generic_sql->getObjectId()] = generic_sql->getCodeDefinition(SchemaParser::XmlDefinition); + removeGenericSQL(generic_sql); + delete(generic_sql); + } + } } catch(Exception &e) { @@ -5857,19 +5876,66 @@ GenericSQL *DatabaseModel::createGenericSQL(void) { GenericSQL *genericsql=nullptr; attribs_map attribs; + QString elem, parent_name, obj_name; + ObjectType obj_type; + Table *parent_table = nullptr; + BaseObject *object = nullptr; try { - genericsql=new GenericSQL; + genericsql = new GenericSQL; setBasicAttributes(genericsql); if(xmlparser.accessElement(XmlParser::ChildElement)) { - if(xmlparser.getElementType()==XML_ELEMENT_NODE && xmlparser.getElementName() == Attributes::Definition) + do { - xmlparser.accessElement(XmlParser::ChildElement); - genericsql->setDefinition(xmlparser.getElementContent()); + if(xmlparser.getElementType()==XML_ELEMENT_NODE) + { + elem = xmlparser.getElementName(); + + if(elem == Attributes::Definition) + { + xmlparser.savePosition(); + xmlparser.accessElement(XmlParser::ChildElement); + genericsql->setDefinition(xmlparser.getElementContent()); + xmlparser.restorePosition(); + } + else if(elem == Attributes::Object) + { + xmlparser.getElementAttributes(attribs); + + obj_type = BaseObject::getObjectType(attribs[Attributes::Type]); + obj_name = attribs[Attributes::Name]; + parent_name = attribs[Attributes::Parent]; + + //If the object is a column its needed to get the parent table + if(obj_type == ObjectType::Column) + { + parent_table = dynamic_cast
(getObject(parent_name, ObjectType::Table)); + + if(parent_table) + object = parent_table->getColumn(obj_name); + } + else + object = getObject(obj_name, obj_type); + + //Raises an error if the generic object references an object that does not exist + if(!object) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) + .arg(genericsql->getName()) + .arg(genericsql->getTypeName()) + .arg(obj_name) + .arg(BaseObject::getTypeName(obj_type)), + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + genericsql->addObjectReference(object, attribs[Attributes::RefName], + attribs[Attributes::UseSignature] == Attributes::True, + attribs[Attributes::FormatName] == Attributes::True); + } + } } + while(xmlparser.accessElement(XmlParser::NextElement)); } } catch(Exception &e) @@ -8206,6 +8272,14 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); getObjectDependecies(server->getForeignDataWrapper(), deps, inc_indirect_deps); } + //** Getting the dependecies for generic sql ** + else if(obj_type==ObjectType::GenericSql) + { + GenericSQL *generic_sql = dynamic_cast(object); + vector ref_objs = generic_sql->getReferencedObjects(); + for(auto &obj : ref_objs) + getObjectDependecies(obj, deps, inc_indirect_deps); + } if(obj_type == ObjectType::Table || obj_type == ObjectType::View) { @@ -9358,7 +9432,6 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - if(obj_type==ObjectType::Tag && (!exclusion_mode || (exclusion_mode && !refer))) { vector::iterator itr, itr_end; @@ -9427,6 +9500,21 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector itr++; } } + + // Checking if any generic SQL object is referencing the object passed + vector::iterator itr = genericsqls.begin(), + itr_end = genericsqls.end(); + + while(itr != itr_end && (!exclusion_mode || (exclusion_mode && !refer))) + { + if(dynamic_cast(*itr)->isObjectReferenced(object)) + { + refer = true; + refs.push_back(*itr); + } + + itr++; + } } } diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 851870a6b1..672a4f63c8 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -17,11 +17,13 @@ */ #include "genericsql.h" +#include "tableobject.h" GenericSQL::GenericSQL(void) { obj_type = ObjectType::GenericSql; attributes[Attributes::Definition] = QString(); + attributes[Attributes::Objects] = QString(); } void GenericSQL::setDefinition(const QString &def) @@ -35,10 +37,15 @@ QString GenericSQL::getDefinition(void) return(definition); } +vector GenericSQL::getObjectsReferences(void) +{ + return(objects_refs); +} + int GenericSQL::getObjectRefNameIndex(const QString &ref_name) { int idx = -1; - vector::iterator itr = objects_refs.begin(), + vector::iterator itr = objects_refs.begin(), itr_end = objects_refs.end(); if(ref_name.isEmpty()) @@ -61,7 +68,7 @@ int GenericSQL::getObjectRefNameIndex(const QString &ref_name) bool GenericSQL::isObjectReferenced(BaseObject *object) { bool found = false; - vector::iterator itr = objects_refs.begin(), + vector::iterator itr = objects_refs.begin(), itr_end = objects_refs.end(); if(!object) @@ -76,7 +83,34 @@ bool GenericSQL::isObjectReferenced(BaseObject *object) return(found); } -void GenericSQL::validateObjectReference(GenericSQL::RefConfig ref, bool ignore_duplic) +bool GenericSQL::isReferRelationshipAddedObject(void) +{ + bool found = false; + vector::iterator itr = objects_refs.begin(), + itr_end = objects_refs.end(); + TableObject *tab_obj = nullptr; + + while(itr != itr_end && !found) + { + tab_obj = dynamic_cast(itr->object); + found = (tab_obj && tab_obj->isAddedByRelationship()); + itr++; + } + + return(found); +} + +vector GenericSQL::getReferencedObjects(void) +{ + vector ref_objs; + + for(auto &ref : objects_refs) + ref_objs.push_back(ref.object); + + return(ref_objs); +} + +void GenericSQL::validateObjectReference(ObjectRefConfig ref, bool ignore_duplic) { if(!ref.object) throw Exception(ErrorCode::AsgNotAllocatedObjectReference,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -93,7 +127,7 @@ void GenericSQL::addObjectReference(BaseObject *object, const QString &ref_name, { try { - RefConfig ref = RefConfig(ref_name, object, use_signature, format_name); + ObjectRefConfig ref = ObjectRefConfig(ref_name, object, use_signature, format_name); validateObjectReference(ref, false); objects_refs.push_back(ref); setCodeInvalidated(true); @@ -113,8 +147,8 @@ void GenericSQL::updateObjectReference(const QString &ref_name, BaseObject *obje try { - RefConfig ref = RefConfig(new_ref_name, object, use_signature, format_name); - vector::iterator itr = objects_refs.begin() + idx; + ObjectRefConfig ref = ObjectRefConfig(new_ref_name, object, use_signature, format_name); + vector::iterator itr = objects_refs.begin() + idx; int idx_aux = getObjectRefNameIndex(new_ref_name); if(idx_aux != idx) @@ -152,24 +186,48 @@ QString GenericSQL::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - if(objects_refs.empty()) - attributes[Attributes::Definition] = definition; - else + QString fmt_definition = definition, + name_attr = QString("%1%2%3").arg(SchemaParser::CharIniAttribute) + .arg(Attributes::Name) + .arg(SchemaParser::CharEndAttribute); + + if(!objects_refs.empty()) { - QString fmt_definition = definition, ref_name, ref_value; + QString ref_name, ref_value; + attribs_map obj_attrs; for(auto &ref : objects_refs) { - ref_name = QString("{%1}").arg(ref.ref_name); - ref_value = ref.use_signature ? + if(def_type == SchemaParser::XmlDefinition) + { + obj_attrs[Attributes::Name] = ref.object->getSignature(); + obj_attrs[Attributes::Type] = ref.object->getSchemaName(); + obj_attrs[Attributes::RefName] = ref.ref_name; + obj_attrs[Attributes::FormatName] = ref.format_name ? Attributes::True : QString(); + obj_attrs[Attributes::UseSignature] = ref.use_signature ? Attributes::True : QString(); + + schparser.ignoreUnkownAttributes(true); + attributes[Attributes::Objects] += schparser.getCodeDefinition(Attributes::Object, obj_attrs, SchemaParser::XmlDefinition); + } + else + { + ref_name = QString("%1%2%3").arg(SchemaParser::CharIniAttribute) + .arg(ref.ref_name) + .arg(SchemaParser::CharEndAttribute); + ref_value = ref.use_signature ? ref.object->getSignature(ref.format_name) : ref.object->getName(ref.format_name); - - fmt_definition = fmt_definition.replace(ref_name, ref_value); + fmt_definition = fmt_definition.replace(ref_name, ref_value); + } } - - attributes[Attributes::Definition] = fmt_definition; } + // Special case for the {name} attribute which is created automatically when there's no one defined by the user + if(def_type == SchemaParser::SqlDefinition && + fmt_definition.contains(name_attr) && getObjectRefNameIndex(Attributes::Name) < 0) + fmt_definition = fmt_definition.replace(name_attr, this->getName(true)); + + attributes[Attributes::Definition] = fmt_definition; + return(this->BaseObject::__getCodeDefinition(def_type)); } diff --git a/libpgmodeler/src/genericsql.h b/libpgmodeler/src/genericsql.h index 7ecfbd31b1..eff8846a88 100644 --- a/libpgmodeler/src/genericsql.h +++ b/libpgmodeler/src/genericsql.h @@ -29,22 +29,23 @@ #include class GenericSQL: public BaseObject{ - private: - - struct RefConfig { + protected: + struct ObjectRefConfig { QString ref_name; BaseObject *object; bool use_signature, format_name; - RefConfig(const QString &_ref_name, BaseObject *_object, bool _use_signature, bool _format_name) : + ObjectRefConfig(const QString &_ref_name, BaseObject *_object, bool _use_signature, bool _format_name) : ref_name(_ref_name), object(_object), use_signature(_use_signature), format_name(_format_name) {} }; - QString definition; + vector getObjectsReferences(void); - vector objects_refs; + private: + QString definition; + vector objects_refs; int getObjectRefNameIndex(const QString &ref_name); - void validateObjectReference(RefConfig ref, bool ignore_duplic); + void validateObjectReference(ObjectRefConfig ref, bool ignore_duplic); public: GenericSQL(void); @@ -56,9 +57,21 @@ class GenericSQL: public BaseObject{ void updateObjectReference(const QString &ref_name, BaseObject *object, const QString &new_ref_name, bool use_signature, bool format_name); void removeObjectReference(const QString &ref_name); void removeObjectReferences(void); + bool isObjectReferenced(BaseObject *object); + /*! \brief Returns whether the object references columns or constraints added + * by relationship to their parent tables. This method is used as auxiliary + * to control which generic SQL object references objects added by the + * relationship in order to avoid referece breaking due constants + * connections and disconnections of relationships */ + bool isReferRelationshipAddedObject(void); + + vector getReferencedObjects(void); + virtual QString getCodeDefinition(unsigned def_type); + + friend class GenericSQLWidget; }; #endif diff --git a/libpgmodeler/src/operationlist.cpp b/libpgmodeler/src/operationlist.cpp index 0a9cce0377..38ddfdbb70 100644 --- a/libpgmodeler/src/operationlist.cpp +++ b/libpgmodeler/src/operationlist.cpp @@ -462,7 +462,8 @@ int OperationList::registerObject(BaseObject *object, unsigned op_type, int obje else { if((obj_type==ObjectType::Sequence && dynamic_cast(object)->isReferRelationshipAddedColumn()) || - (obj_type==ObjectType::View && dynamic_cast(object)->isReferRelationshipAddedColumn())) + (obj_type==ObjectType::View && dynamic_cast(object)->isReferRelationshipAddedColumn()) || + (obj_type==ObjectType::GenericSql && dynamic_cast(object)->isReferRelationshipAddedObject())) operation->setXMLDefinition(object->getCodeDefinition(SchemaParser::XmlDefinition)); //Case a specific index wasn't specified @@ -734,12 +735,13 @@ void OperationList::executeOperation(Operation *oper, bool redo) aux_obj=model->createView(); else if(obj_type==ObjectType::Column) aux_obj=model->createColumn(); + else if(obj_type==ObjectType::GenericSql) + aux_obj=model->createGenericSQL(); } /* If the operation is a modified/moved object, the object copy stored in the pool will be restored */ - if(op_type==Operation::ObjectModified || - op_type==Operation::ObjectMoved) + if(op_type==Operation::ObjectModified || op_type==Operation::ObjectMoved) { if(obj_type==ObjectType::Relationship) { diff --git a/libpgmodeler/src/table.cpp b/libpgmodeler/src/table.cpp index ee4c11c525..035d66c4fb 100644 --- a/libpgmodeler/src/table.cpp +++ b/libpgmodeler/src/table.cpp @@ -205,6 +205,8 @@ void Table::setRelObjectsIndexesAttribute(void) { aux_attribs[Attributes::Name]=obj_idx.first; aux_attribs[Attributes::Index]=QString::number(obj_idx.second); + + schparser.ignoreUnkownAttributes(true); aux_attribs[Attributes::Objects]+=schparser.getCodeDefinition(Attributes::Object, aux_attribs, SchemaParser::XmlDefinition); } diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index bf5092919c..b2bd9b491e 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -18,8 +18,14 @@ #include "genericsqlwidget.h" +const QRegExp GenericSQLWidget::AttrDelimRegexp = QRegExp(QString("(\\%1)+|(\\%2)+") + .arg(SchemaParser::CharIniAttribute) + .arg(SchemaParser::CharEndAttribute)); + GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::GenericSql) { + vector types; + Ui_GenericSQLWidget::setupUi(this); configureFormLayout(genericsql_grid, ObjectType::GenericSql); @@ -51,9 +57,13 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob attribs_tbw->widget(2)->layout()->setContentsMargins(4,4,4,4); attribs_tbw->widget(2)->layout()->addWidget(preview_txt); - object_sel = new ObjectSelectorWidget(BaseObject::getObjectTypes(false, { ObjectType::Database, ObjectType::GenericSql, - ObjectType::Permission, ObjectType::Relationship, - ObjectType::Tag, ObjectType::Textbox }), true, this); + types = BaseObject::getObjectTypes(false, { ObjectType::Database, ObjectType::GenericSql, + ObjectType::Permission, ObjectType::Relationship, + ObjectType::Tag, ObjectType::Textbox }); + types.push_back(ObjectType::Column); + + object_sel = new ObjectSelectorWidget(types, true, this); + objects_refs_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons, true, this); references_grid->addWidget(object_sel, 0, 1, 1, 1); references_grid->addWidget(objects_refs_tab, 2, 0, 1, 2); @@ -96,40 +106,33 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob void GenericSQLWidget::setAttributes(DatabaseModel *model, OperationList *op_list, GenericSQL *genericsql) { - if(genericsql) - definition_txt->setPlainText(genericsql->getDefinition()); - BaseObjectWidget::setAttributes(model, op_list, genericsql); - object_sel->setModel(model); - definition_cp->configureCompletion(model, definition_hl); -} - -void GenericSQLWidget::applyConfiguration(void) -{ - try + if(genericsql) { - GenericSQL *genericsql=nullptr; + dummy_gsql = *genericsql; + definition_txt->setPlainText(genericsql->getDefinition()); + objects_refs_tab->blockSignals(true); - startConfiguration(); - genericsql=dynamic_cast(this->object); - genericsql->setDefinition(definition_txt->toPlainText()); + for(auto &ref : genericsql->getObjectsReferences()) + { + objects_refs_tab->addRow(); + showObjectReferenceData(objects_refs_tab->getRowCount() - 1, + ref.object, ref.ref_name, ref.use_signature, ref.format_name); + } - BaseObjectWidget::applyConfiguration(); - finishConfiguration(); - } - catch(Exception &e) - { - cancelConfiguration(); - throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + objects_refs_tab->blockSignals(false); } + + object_sel->setModel(model); + definition_cp->configureCompletion(model, definition_hl); } void GenericSQLWidget::addObjectReference(int row) { try { - QString ref_name = ref_name_edt->text(); + QString ref_name = ref_name_edt->text().remove(AttrDelimRegexp); BaseObject *object = object_sel->getSelectedObject(); bool use_signature = use_signature_chk->isChecked(), format_name = format_name_chk->isChecked(); @@ -158,7 +161,7 @@ void GenericSQLWidget::editObjectReference(int row) void GenericSQLWidget::updateObjectReference(int row) { QString ref_name = objects_refs_tab->getCellText(row, 0), - new_ref_name = ref_name_edt->text(); + new_ref_name = ref_name_edt->text().remove(AttrDelimRegexp); BaseObject *object = object_sel->getSelectedObject(); bool use_signature = use_signature_chk->isChecked(), format_name = format_name_chk->isChecked(); @@ -188,13 +191,17 @@ void GenericSQLWidget::updateCodePreview(void) { try { - if(objects_refs_tab->getRowCount() > 0 && !definition_txt->toPlainText().isEmpty()) + if(!name_edt->text().isEmpty() && !definition_txt->toPlainText().isEmpty()) { + if(!name_edt->text().isEmpty()) + dummy_gsql.setName(name_edt->text()); + dummy_gsql.setDefinition(definition_txt->toPlainText()); + dummy_gsql.setCodeInvalidated(true); preview_txt->setPlainText(dummy_gsql.getCodeDefinition(SchemaParser::SqlDefinition)); } else - preview_txt->setPlainText(QString("-- %1 --").arg(trUtf8("No definition SQL code or references defined! Preview unavailable."))); + preview_txt->setPlainText(QString("-- %1 --").arg(trUtf8("No object name, SQL code or references defined! Preview unavailable."))); } catch(Exception &e) { @@ -212,3 +219,22 @@ void GenericSQLWidget::showObjectReferenceData(int row, BaseObject *object, cons objects_refs_tab->setRowData(QVariant::fromValue(reinterpret_cast(object)), row); } +void GenericSQLWidget::applyConfiguration(void) +{ + try + { + GenericSQL *genericsql=nullptr; + + startConfiguration(); + genericsql=dynamic_cast(this->object); + *genericsql = dummy_gsql; + + BaseObjectWidget::applyConfiguration(); + finishConfiguration(); + } + catch(Exception &e) + { + cancelConfiguration(); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} diff --git a/libpgmodeler_ui/src/genericsqlwidget.h b/libpgmodeler_ui/src/genericsqlwidget.h index 2c8b875e83..0a598bf2e9 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.h +++ b/libpgmodeler_ui/src/genericsqlwidget.h @@ -50,6 +50,8 @@ class GenericSQLWidget: public BaseObjectWidget, public Ui::GenericSQLWidget { GenericSQL dummy_gsql; + static const QRegExp AttrDelimRegexp; + void showObjectReferenceData(int row, BaseObject *object, const QString &ref_name, bool use_signature, bool format_name); public: diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index 62b3a6735a..250b513e33 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -264,8 +264,9 @@ void ModelValidationHelper::validateModel(void) try { ObjectType types[]={ ObjectType::Role, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Language, ObjectType::Function, - ObjectType::Type, ObjectType::Domain, ObjectType::Sequence, ObjectType::Operator, ObjectType::OpFamily, - ObjectType::OpClass, ObjectType::Collation, ObjectType::Table, ObjectType::Extension, ObjectType::View, ObjectType::Relationship }, + ObjectType::Type, ObjectType::Domain, ObjectType::Sequence, ObjectType::Operator, ObjectType::OpFamily, + ObjectType::OpClass, ObjectType::Collation, ObjectType::Table, ObjectType::Extension, ObjectType::View, + ObjectType::Relationship, ObjectType::ForeignDataWrapper, ObjectType::ForeignServer, ObjectType::GenericSql }, aux_types[]={ ObjectType::Table, ObjectType::View }, tab_obj_types[]={ ObjectType::Constraint, ObjectType::Index }, obj_type; @@ -308,7 +309,7 @@ void ModelValidationHelper::validateModel(void) emit s_objectProcessed(signal_msg.arg(object->getName()).arg(object->getTypeName()), object->getObjectType()); /* Special validation case: For generalization and copy relationships validates the ids of participant tables. - * Reference table cannot own an id greater thant receiver table */ + Reference table cannot own an id greater thant receiver table */ if(obj_type==ObjectType::Relationship) { rel=dynamic_cast(object); @@ -337,14 +338,13 @@ void ModelValidationHelper::validateModel(void) col=dynamic_cast(tab_obj); /* If the current referrer object has an id less than reference object's id - then it will be pushed into the list of invalid references. The only exception is - for foreign keys that are discarded from any validation since they are always created - at end of code defintion being free of any reference breaking. */ + * then it will be pushed into the list of invalid references. The only exception is + * for foreign keys that are discarded from any validation since they are always created + * at end of code defintion being free of any reference breaking. */ if(object != refs.back() && ( ((col || (constr && constr->getConstraintType()!=ConstraintType::ForeignKey)) && - (tab_obj->getParentTable()->getObjectId() <= object->getObjectId())) - || + (tab_obj->getParentTable()->getObjectId() <= object->getObjectId())) || (!constr && refs.back()->getObjectId() <= object->getObjectId())) ) { @@ -360,9 +360,9 @@ void ModelValidationHelper::validateModel(void) } /* Validating a special object. The validation made here is to check if the special object - (constraint/index/trigger/view) references a column added by a relationship and - that relationship is being created after the creation of the special object */ - if(obj_type==ObjectType::Table || obj_type==ObjectType::View /* || obj_type==ObjectType::ObjSequence */) + * (constraint/index/trigger/view) references a column added by a relationship and + * that relationship is being created after the creation of the special object */ + if(obj_type==ObjectType::Table || obj_type==ObjectType::View || obj_type == ObjectType::GenericSql) { vector tab_aux_types={ ObjectType::Constraint, ObjectType::Trigger, ObjectType::Index }; vector *tab_objs; @@ -370,16 +370,18 @@ void ModelValidationHelper::validateModel(void) vector rels; BaseObject *rel=nullptr; View *view=nullptr; + GenericSQL *gen_sql=nullptr; Constraint *constr=nullptr; table=dynamic_cast
(object); view=dynamic_cast(object); + gen_sql = dynamic_cast(object); if(table) { /* Checking the table children objects if they references some columns added by relationship. - If so, the id of the relationships are swapped with the child object if the first is created - after the latter. */ + * If so, the id of the relationships are swapped with the child object if the first is created + * after the latter. */ for(auto &obj_tp : tab_aux_types) { tab_objs = table->getObjectList(obj_tp); @@ -416,7 +418,7 @@ void ModelValidationHelper::validateModel(void) } } } - else + else if(view) { ref_cols=view->getRelationshipAddedColumns(); @@ -428,6 +430,23 @@ void ModelValidationHelper::validateModel(void) rels.push_back(rel); } + generateValidationInfo(ValidationInfo::SpObjBrokenReference, object, rels); + } + else + { + Column *col = nullptr; + + for(auto &ref_obj : gen_sql->getReferencedObjects()) + { + col = dynamic_cast(ref_obj); + if(!col) continue; + + rel = col->getParentRelationship(); + + if(rel->getObjectId() > object->getObjectId() && std::find(rels.begin(), rels.end(), rel) == rels.end()) + rels.push_back(rel); + } + generateValidationInfo(ValidationInfo::SpObjBrokenReference, object, rels); } } diff --git a/schemas/xml/dtd/dbmodel.dtd b/schemas/xml/dtd/dbmodel.dtd index 5a83cfce24..bc2981a7e3 100644 --- a/schemas/xml/dtd/dbmodel.dtd +++ b/schemas/xml/dtd/dbmodel.dtd @@ -6,6 +6,8 @@ %baseelements; %basetype; + +%object; %role; @@ -72,7 +74,6 @@ %foreignserver; - diff --git a/schemas/xml/dtd/object.dtd b/schemas/xml/dtd/object.dtd new file mode 100644 index 0000000000..2047dd8dc2 --- /dev/null +++ b/schemas/xml/dtd/object.dtd @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/schemas/xml/dtd/permission.dtd b/schemas/xml/dtd/permission.dtd index 3b6cc81d26..a470a5c0ca 100644 --- a/schemas/xml/dtd/permission.dtd +++ b/schemas/xml/dtd/permission.dtd @@ -21,10 +21,3 @@ - - - - - - - diff --git a/schemas/xml/genericsql.sch b/schemas/xml/genericsql.sch index 7e307e41c0..895c48ec9f 100644 --- a/schemas/xml/genericsql.sch +++ b/schemas/xml/genericsql.sch @@ -15,4 +15,6 @@ $tb $br + %if {objects} %then {objects} %end + $br $br diff --git a/schemas/xml/object.sch b/schemas/xml/object.sch index 0824ef1f02..716a3a4810 100644 --- a/schemas/xml/object.sch +++ b/schemas/xml/object.sch @@ -1,4 +1,15 @@ # XML definition for custom index for a single column or constraint # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. -$tb $tb [ $br \ No newline at end of file + +%if {index} %then $tb %end +$tb [ $br diff --git a/schemas/xml/permission.sch b/schemas/xml/permission.sch index 8b03dd5b8c..003275cef6 100644 --- a/schemas/xml/permission.sch +++ b/schemas/xml/permission.sch @@ -16,13 +16,12 @@ > $br - $tb [] $br + [ type=] "{type}" [/>] $br %if {roles} %then $tb [] $br From faa6a5e65d8476dddc51c08aec080f1542132763 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 7 May 2019 10:16:32 -0300 Subject: [PATCH 337/425] Added missing code documentation --- libpgmodeler/src/genericsql.cpp | 5 +++++ libpgmodeler/src/genericsql.h | 23 ++++++++++++++++++++--- libpgmodeler_ui/src/genericsqlwidget.cpp | 6 +++++- libpgmodeler_ui/src/genericsqlwidget.h | 3 +++ 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/libpgmodeler/src/genericsql.cpp b/libpgmodeler/src/genericsql.cpp index 672a4f63c8..30ac105088 100644 --- a/libpgmodeler/src/genericsql.cpp +++ b/libpgmodeler/src/genericsql.cpp @@ -211,12 +211,17 @@ QString GenericSQL::getCodeDefinition(unsigned def_type) } else { + /* In order to use a reference name in the object's SQL code, the reference should be writter in the for + * {ref_name} so it can be replaced by the corresponding value in the SQL code */ ref_name = QString("%1%2%3").arg(SchemaParser::CharIniAttribute) .arg(ref.ref_name) .arg(SchemaParser::CharEndAttribute); + + // Configuring the value of the reference ref_value = ref.use_signature ? ref.object->getSignature(ref.format_name) : ref.object->getName(ref.format_name); + fmt_definition = fmt_definition.replace(ref_name, ref_value); } } diff --git a/libpgmodeler/src/genericsql.h b/libpgmodeler/src/genericsql.h index eff8846a88..6f44bfc22f 100644 --- a/libpgmodeler/src/genericsql.h +++ b/libpgmodeler/src/genericsql.h @@ -30,21 +30,34 @@ class GenericSQL: public BaseObject{ protected: + + //! \brief This is a internal structure used to hold object references configuration struct ObjectRefConfig { - QString ref_name; - BaseObject *object; - bool use_signature, format_name; + QString ref_name; // Name of the reference (in SQL it be used between {} in order to be parsed) + BaseObject *object; // The object being referenced + bool use_signature, // Indicates that the signature of the object should be used instead of the name + format_name; // Indicates that the name of the object need to be automatically quoted or the schema name appended ObjectRefConfig(const QString &_ref_name, BaseObject *_object, bool _use_signature, bool _format_name) : ref_name(_ref_name), object(_object), use_signature(_use_signature), format_name(_format_name) {} }; + //! \brief Returns a copy of the objects references list vector getObjectsReferences(void); private: + //! \brief The SQL definition of the generic object QString definition; + + //! \brief The list of references to other object in the model vector objects_refs; + /*! \brief Returns the index of a object reference searching by its name. + * A negative return value indicates the reference doens't exist */ int getObjectRefNameIndex(const QString &ref_name); + + /*! \brief Check if the provided object reference is correclty configured. + * The method will raise exceptions if any validation rule is broken. + * The parameter ignore_duplic makes the method ignore duplicated references names */ void validateObjectReference(ObjectRefConfig ref, bool ignore_duplic); public: @@ -58,6 +71,7 @@ class GenericSQL: public BaseObject{ void removeObjectReference(const QString &ref_name); void removeObjectReferences(void); + //! \brief Returns true when the provided object is being referenced by the generic SQL object bool isObjectReferenced(BaseObject *object); /*! \brief Returns whether the object references columns or constraints added @@ -67,6 +81,9 @@ class GenericSQL: public BaseObject{ * connections and disconnections of relationships */ bool isReferRelationshipAddedObject(void); + /*! \brief Returns a list of objectes being referenced by the generic object. + * For performance reasons this method doesn't eliminate duplicated values in + * the retunring list*/ vector getReferencedObjects(void); virtual QString getCodeDefinition(unsigned def_type); diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index b2bd9b491e..326aec5614 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -57,6 +57,7 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob attribs_tbw->widget(2)->layout()->setContentsMargins(4,4,4,4); attribs_tbw->widget(2)->layout()->addWidget(preview_txt); + // Configuring the object types accepted by object references types = BaseObject::getObjectTypes(false, { ObjectType::Database, ObjectType::GenericSql, ObjectType::Permission, ObjectType::Relationship, ObjectType::Tag, ObjectType::Textbox }); @@ -101,7 +102,10 @@ GenericSQLWidget::GenericSQLWidget(QWidget *parent): BaseObjectWidget(parent, Ob dummy_gsql.removeObjectReferences(); }); - connect(attribs_tbw, SIGNAL(currentChanged(int)), this, SLOT(updateCodePreview())); + connect(attribs_tbw, &QTabWidget::currentChanged, [&](int idx){ + if(idx == attribs_tbw->count() - 1) + updateCodePreview(); + }); } void GenericSQLWidget::setAttributes(DatabaseModel *model, OperationList *op_list, GenericSQL *genericsql) diff --git a/libpgmodeler_ui/src/genericsqlwidget.h b/libpgmodeler_ui/src/genericsqlwidget.h index 0a598bf2e9..0c1ec99d06 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.h +++ b/libpgmodeler_ui/src/genericsqlwidget.h @@ -48,8 +48,11 @@ class GenericSQLWidget: public BaseObjectWidget, public Ui::GenericSQLWidget { ObjectSelectorWidget *object_sel; + /*! \brief This dummy object is used to generated the code preview while the user changes the fields + * in form. Once the dummy is configure it is copied to the real object being handled by the form (this->object) */ GenericSQL dummy_gsql; + //! \brief A regular expression used to remove attribute/reference delimiters {} from the names of configured references static const QRegExp AttrDelimRegexp; void showObjectReferenceData(int row, BaseObject *object, const QString &ref_name, bool use_signature, bool format_name); From 0713157c08643475a6aece7517a9c064fccddd60 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 7 May 2019 14:52:34 -0300 Subject: [PATCH 338/425] Improved the object search mechanism in such way that various attributes of the object can be matched. New searchable attribute may be added in the future. --- libpgmodeler/src/aggregate.cpp | 11 + libpgmodeler/src/aggregate.h | 3 + libpgmodeler/src/baseobject.cpp | 15 + libpgmodeler/src/baseobject.h | 21 +- libpgmodeler/src/cast.cpp | 10 + libpgmodeler/src/cast.h | 3 + libpgmodeler/src/column.cpp | 6 + libpgmodeler/src/column.h | 2 + libpgmodeler/src/databasemodel.cpp | 46 +-- libpgmodeler/src/databasemodel.h | 5 +- libpgmodeler/src/function.cpp | 13 + libpgmodeler/src/function.h | 3 + libpgmodeler/src/operator.cpp | 10 + libpgmodeler/src/operator.h | 3 + libpgmodeler_ui/src/codecompletionwidget.cpp | 6 +- libpgmodeler_ui/src/modelobjectswidget.cpp | 3 +- libpgmodeler_ui/src/objectfinderwidget.cpp | 50 ++- libpgmodeler_ui/src/objectfinderwidget.h | 10 +- libpgmodeler_ui/ui/objectfinderwidget.ui | 391 +++++++++---------- 19 files changed, 356 insertions(+), 255 deletions(-) diff --git a/libpgmodeler/src/aggregate.cpp b/libpgmodeler/src/aggregate.cpp index a07d650f7f..81dc0771b4 100644 --- a/libpgmodeler/src/aggregate.cpp +++ b/libpgmodeler/src/aggregate.cpp @@ -303,3 +303,14 @@ QString Aggregate::getSignature(bool format) return(BaseObject::getSignature(format) + QString("(%1)").arg(types.join(','))); } +void Aggregate::configureSearchAttributes(void) +{ + QStringList list; + + BaseObject::configureSearchAttributes(); + + for(auto &type : data_types) + list += *type; + + search_attribs[Attributes::Type] = list.join("; "); +} diff --git a/libpgmodeler/src/aggregate.h b/libpgmodeler/src/aggregate.h index 011ca28982..079acf7f7d 100644 --- a/libpgmodeler/src/aggregate.h +++ b/libpgmodeler/src/aggregate.h @@ -63,6 +63,9 @@ class Aggregate: public BaseObject { //! \brief Checks if the passed function is valid according to the rule of aggregate definition bool isValidFunction(unsigned func_idx, Function *func); + protected: + virtual void configureSearchAttributes(void); + public: //! \brief Constants used to reference the functions used by the aggregate static constexpr unsigned FinalFunc=0, diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 75766ea930..a38190e527 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -1001,6 +1001,11 @@ QString BaseObject::getPgSQLVersion(void) return(pgsql_ver); } +attribs_map BaseObject::getSearchAttributes(void) +{ + return(search_attribs); +} + void BaseObject::enableCachedCode(bool value) { use_cached_code=value; @@ -1037,6 +1042,16 @@ void BaseObject::setCodeInvalidated(bool value) } } +void BaseObject::configureSearchAttributes(void) +{ + search_attribs[Attributes::Name] = this->getName(false); + search_attribs[Attributes::Signature] = this->getSignature(false); + search_attribs[Attributes::Schema] = schema ? schema->getName(false) : QString(); + search_attribs[Attributes::Tablespace] = tablespace ? tablespace->getName(false) : QString(); + search_attribs[Attributes::Owner] = owner ? owner->getName(false) : QString(); + search_attribs[Attributes::Comment] = comment; +} + bool BaseObject::isCodeInvalidated(void) { return(use_cached_code && code_invalidated); diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 0c7098f643..4e045ea299 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -85,12 +85,12 @@ class BaseObject { //! \brief Indicates the the cached code enabled static bool use_cached_code; - //! \brief Stores the database wich the object belongs - BaseObject *database; - //! \brief Stores the set of special (valid) chars that forces the object's name quoting static const QByteArray special_chars; + //! \brief Stores the database wich the object belongs + BaseObject *database; + protected: SchemaParser schparser; @@ -134,6 +134,7 @@ class BaseObject { //! \brief Stores the cached xml and sql code QString cached_code[2], + //! \brief Stores the xml code in reduced form cached_reduced_code; @@ -180,13 +181,16 @@ class BaseObject { //! \brief The set of SQL commands prepended on the objectc's definition prepended_sql; - /*! \brief Stores the attributes and their values ​​shaped in strings to be used by SchemaParser on the object's code definition creation. The attribute name related to model objects are defined in ParsersAttributes namespace. */ - attribs_map attributes; + attribs_map attributes, + + /*! \brief Stores the attributes and their vales which can be used by the + * searching mechanism to match patters */ + search_attribs; - /*! \brief Type of object, may have one of the values ​​of the enum ObjectType OBJ_* + /*! \brief Type of object, may have one of the values ​​of the enum ObjectType It was used a numeric type to avoid the use excessive of RTTI. */ ObjectType obj_type; @@ -460,6 +464,8 @@ class BaseObject { This method has no effect when the cached code support is disables. See enableCachedCode() */ virtual void setCodeInvalidated(bool value); + virtual void configureSearchAttributes(void); + //! \brief Returns if the code (sql and xml) is invalidated bool isCodeInvalidated(void); @@ -491,6 +497,9 @@ class BaseObject { //! \brief Returns the current version for SQL code generation static QString getPgSQLVersion(void); + //! \brief Returns the set of attributes used by the search mechanism + attribs_map getSearchAttributes(void); + friend class DatabaseModel; friend class ModelValidationHelper; friend class DatabaseImportHelper; diff --git a/libpgmodeler/src/cast.cpp b/libpgmodeler/src/cast.cpp index d1c62e24a5..5656e4c3a8 100644 --- a/libpgmodeler/src/cast.cpp +++ b/libpgmodeler/src/cast.cpp @@ -204,3 +204,13 @@ QString Cast::getSignature(bool) return(BaseObject::getSignature(false)); } +void Cast::configureSearchAttributes(void) +{ + QStringList arg_types; + + BaseObject::configureSearchAttributes(); + + arg_types += *types[0]; + arg_types += *types[1]; + search_attribs[Attributes::Type] = arg_types.join("; "); +} diff --git a/libpgmodeler/src/cast.h b/libpgmodeler/src/cast.h index e16e6a31f6..23a08f448a 100644 --- a/libpgmodeler/src/cast.h +++ b/libpgmodeler/src/cast.h @@ -47,6 +47,9 @@ class Cast: public BaseObject { function of the source data type */ bool is_in_out; + protected: + virtual void configureSearchAttributes(void); + public: //! \brief Constants used to access the data types envolved in the cast static constexpr unsigned SrcType=0, diff --git a/libpgmodeler/src/column.cpp b/libpgmodeler/src/column.cpp index 8876c0e2c3..5c35b09a33 100644 --- a/libpgmodeler/src/column.cpp +++ b/libpgmodeler/src/column.cpp @@ -382,6 +382,12 @@ QString Column::getAlterDefinition(BaseObject *object) } } +void Column::configureSearchAttributes(void) +{ + BaseObject::configureSearchAttributes(); + search_attribs[Attributes::Type] = *type; +} + void Column::operator = (Column &col) { this->comment=col.comment; diff --git a/libpgmodeler/src/column.h b/libpgmodeler/src/column.h index 24d93fd2ed..0c937e01ed 100644 --- a/libpgmodeler/src/column.h +++ b/libpgmodeler/src/column.h @@ -77,6 +77,8 @@ class Column: public TableObject{ //! \brief Underlying sequence's cache value (only for identity column) seq_cache; + virtual void configureSearchAttributes(void); + public: Column(void); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index b7d8562c2a..e03a03ad7f 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -9760,7 +9760,7 @@ void DatabaseModel::createSystemObjects(bool create_public) setDefaultObject(getObject(QString("public"), ObjectType::Schema), ObjectType::Schema); } -vector DatabaseModel::findObjects(const QString &pattern, vector types, bool format_obj_names, bool case_sensitive, bool is_regexp, bool exact_match, bool search_comments) +vector DatabaseModel::findObjects(const QString &pattern, vector types, bool case_sensitive, bool is_regexp, bool exact_match, const QString &search_attr) { vector list, objs; vector::iterator end; @@ -9769,7 +9769,8 @@ vector DatabaseModel::findObjects(const QString &pattern, vector DatabaseModel::findObjects(const QString &pattern, vectorgetObjectType())) - { - TableObject *tab_obj=dynamic_cast(objs.back()); - - if(tab_obj->getParentTable()) - obj_name=tab_obj->getParentTable()->getName(true); - } - - obj_name+=objs.back()->getName(true, true); - obj_name.remove('"'); - obj_comment=objs.back()->getComment(); - } - else - { - obj_name=objs.back()->getName(); - obj_comment=objs.back()->getComment(); - } - - //Try to match on the configured regexp the name... - if((exact_match && pattern==obj_name) || - (exact_match && regexp.exactMatch(obj_name)) || - (!exact_match && regexp.indexIn(obj_name) >= 0)) - list.push_back(objs.back()); + object = objs.back(); + object->configureSearchAttributes(); + srch_attribs = object->getSearchAttributes(); - //...or the comment. - if(search_comments && ( - (exact_match && pattern==obj_comment) || - (exact_match && regexp.exactMatch(obj_comment)) || - (!exact_match && regexp.indexIn(obj_comment) >= 0))) - list.push_back(objs.back()); + if((exact_match && pattern == srch_attribs[search_attr]) || + (exact_match && regexp.exactMatch(srch_attribs[search_attr])) || + (!exact_match && regexp.indexIn(srch_attribs[search_attr]) >= 0)) + list.push_back(object); objs.pop_back(); - obj_name.clear(); - obj_comment.clear(); } //Removing the duplicate items on the list diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index e3294aa1b5..64350612d3 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -631,8 +631,9 @@ class DatabaseModel: public QObject, public BaseObject { /*! \brief Returns a list of object searching them using the specified pattern. The search can be delimited by filtering the object's types. The additional bool params are: case sensitive name search, name pattern is a regexp, exact match for names. */ - vector findObjects(const QString &pattern, vector types, bool format_obj_names, - bool case_sensitive, bool is_regexp, bool exact_match, bool search_comments); + vector findObjects(const QString &pattern, vector types, + bool case_sensitive, bool is_regexp, bool exact_match, + const QString &search_attr = Attributes::Name); void setLastPosition(const QPoint &pnt); QPoint getLastPosition(void); diff --git a/libpgmodeler/src/function.cpp b/libpgmodeler/src/function.cpp index ad286d5650..1471d021a6 100644 --- a/libpgmodeler/src/function.cpp +++ b/libpgmodeler/src/function.cpp @@ -550,3 +550,16 @@ QString Function::getAlterDefinition(BaseObject *object) throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); } } + +void Function::configureSearchAttributes(void) +{ + QStringList param_types; + + BaseObject::configureSearchAttributes(); + search_attribs[Attributes::ReturnType] = ret_table_columns.empty() ? *return_type : QString(); + + for(auto ¶m : parameters) + param_types += *param.getType(); + + search_attribs[Attributes::Type] = param_types.join("; "); +} diff --git a/libpgmodeler/src/function.h b/libpgmodeler/src/function.h index 51f33bbf71..10283a11ef 100644 --- a/libpgmodeler/src/function.h +++ b/libpgmodeler/src/function.h @@ -87,6 +87,9 @@ class Function: public BaseObject { //! \brief Formats the function return type to be used by the SchemaParser void setTableReturnTypeAttribute(unsigned def_type); + protected: + virtual void configureSearchAttributes(void); + public: Function(void); diff --git a/libpgmodeler/src/operator.cpp b/libpgmodeler/src/operator.cpp index 9a44615fe4..14864ee028 100644 --- a/libpgmodeler/src/operator.cpp +++ b/libpgmodeler/src/operator.cpp @@ -337,3 +337,13 @@ QString Operator::getCodeDefinition(unsigned def_type, bool reduced_form) return(BaseObject::getCodeDefinition(def_type, reduced_form)); } +void Operator::configureSearchAttributes(void) +{ + QStringList arg_types; + + BaseObject::configureSearchAttributes(); + + arg_types += *argument_types[0]; + arg_types += *argument_types[1]; + search_attribs[Attributes::Type] = arg_types.join("; "); +} diff --git a/libpgmodeler/src/operator.h b/libpgmodeler/src/operator.h index 10527aabcf..aa73ef18d0 100644 --- a/libpgmodeler/src/operator.h +++ b/libpgmodeler/src/operator.h @@ -44,6 +44,9 @@ class Operator: public BaseObject { bool hashes, //! \brief Indicates that the operator can execute a hash join merges; //! \brief Indicates that the operator can execute a merge join + protected: + virtual void configureSearchAttributes(void); + public: static constexpr unsigned FuncOperator=0, FuncJoin=1, diff --git a/libpgmodeler_ui/src/codecompletionwidget.cpp b/libpgmodeler_ui/src/codecompletionwidget.cpp index a1dac02a74..b3fca997e6 100644 --- a/libpgmodeler_ui/src/codecompletionwidget.cpp +++ b/libpgmodeler_ui/src/codecompletionwidget.cpp @@ -373,7 +373,7 @@ void CodeCompletionWidget::updateList(void) word.remove(completion_trigger); word.remove('"'); - objects=db_model->findObjects(word, { ObjectType::Schema, ObjectType::Table, ObjectType::View }, false, false, false, true, false); + objects=db_model->findObjects(word, { ObjectType::Schema, ObjectType::Table, ObjectType::View }, false, false, true); if(objects.size()==1) setQualifyingLevel(objects[0]); @@ -392,7 +392,7 @@ void CodeCompletionWidget::updateList(void) //Negative qualifying level means that user called the completion before a space (empty word) if(qualifying_level < 0) //The default behavior for this is to search all the objects on the model - objects=db_model->findObjects(pattern, types, false, false, !auto_triggered, auto_triggered, false); + objects=db_model->findObjects(pattern, types, false, !auto_triggered, auto_triggered); else { QString left_word; @@ -425,7 +425,7 @@ void CodeCompletionWidget::updateList(void) we try to find any object in the model and reset the qualifying level */ else { - objects=db_model->findObjects(pattern, types, false, false, !auto_triggered, auto_triggered, false); + objects=db_model->findObjects(pattern, types, false, !auto_triggered, auto_triggered); setQualifyingLevel(nullptr); } diff --git a/libpgmodeler_ui/src/modelobjectswidget.cpp b/libpgmodeler_ui/src/modelobjectswidget.cpp index 1277d2b5f2..10a602916b 100644 --- a/libpgmodeler_ui/src/modelobjectswidget.cpp +++ b/libpgmodeler_ui/src/modelobjectswidget.cpp @@ -452,8 +452,7 @@ void ModelObjectsWidget::updateObjectsList(void) visible_types.push_back(tp.first); } - objects=db_model->findObjects(QString(), visible_types,true, false, false, false, false); - + objects=db_model->findObjects(QString(), visible_types, false, false, false); } ObjectFinderWidget::updateObjectTable(objectslist_tbw, objects); diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 18178d03c9..9011cd0f1e 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -19,6 +19,16 @@ #include "objectfinderwidget.h" #include "pgmodeleruins.h" +const QStringList ObjectFinderWidget::search_attribs = +{ Attributes::Name, Attributes::Comment, Attributes::Signature, + Attributes::Schema, Attributes::Owner, Attributes::Tablespace, + Attributes::Type, Attributes::ReturnType }; + +const QStringList ObjectFinderWidget::search_attribs_i18n = +{ QT_TR_NOOP("Name"), QT_TR_NOOP("Comment"), QT_TR_NOOP("Signature"), + QT_TR_NOOP("Schema"), QT_TR_NOOP("Owner"), QT_TR_NOOP("Tablespace"), + QT_TR_NOOP("Data type"), QT_TR_NOOP("Return type")}; + ObjectFinderWidget::ObjectFinderWidget(QWidget *parent) : QWidget(parent) { setupUi(this); @@ -49,6 +59,9 @@ ObjectFinderWidget::ObjectFinderWidget(QWidget *parent) : QWidget(parent) connect(select_all_btn, SIGNAL(clicked(void)), this, SLOT(setAllObjectsChecked(void))); connect(clear_all_btn, SIGNAL(clicked(void)), this, SLOT(setAllObjectsChecked(void))); + for(auto &attr : search_attribs_i18n) + search_attrs_cmb->addItem(attr); + this->setModel(nullptr); pattern_edt->installEventFilter(this); } @@ -216,6 +229,9 @@ void ObjectFinderWidget::findObjects(void) if(model_wgt) { vector types; + QString search_attr = search_attribs.at(search_attrs_cmb->currentIndex()); + QTableWidgetItem *item = result_tbw->horizontalHeaderItem(result_tbw->columnCount() - 1); + clearResult(); //Getting the selected object types @@ -226,19 +242,30 @@ void ObjectFinderWidget::findObjects(void) } //Search the objects on model - found_objs=model_wgt->getDatabaseModel()->findObjects(pattern_edt->text(), types, true, - case_sensitive_chk->isChecked(), regexp_chk->isChecked(), exact_match_chk->isChecked(), comment_chk->isChecked()); + found_objs=model_wgt->getDatabaseModel()->findObjects(pattern_edt->text(), types, + case_sensitive_chk->isChecked(), regexp_chk->isChecked(), + exact_match_chk->isChecked(), + search_attr); //Show the found objects on the result table - updateObjectTable(result_tbw, found_objs); + updateObjectTable(result_tbw, found_objs, search_attr); + + //Rename the last column of the results grid wth the name of the field used to search objects + if(search_attr != Attributes::Name && + search_attr != Attributes::Schema && + search_attr != Attributes::Comment) + item->setText(search_attrs_cmb->currentText()); + else + item->setText(trUtf8("Comment")); + found_lbl->setVisible(true); //Show a message indicating the number of found objects if(!found_objs.empty()) { found_lbl->setText(trUtf8("Found %1 object(s).").arg(found_objs.size())); - result_tbw->resizeColumnsToContents(); result_tbw->horizontalHeader()->setStretchLastSection(true); + result_tbw->resizeColumnsToContents(); } else found_lbl->setText(trUtf8("No objects found.")); @@ -314,7 +341,7 @@ void ObjectFinderWidget::setAllObjectsChecked(void) obj_types_lst->item(i)->setCheckState((checked ? Qt::Checked : Qt::Unchecked)); } -void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vector &objs) +void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vector &objs, const QString &search_attr) { if(tab_wgt && tab_wgt->columnCount()!=0) { @@ -441,10 +468,18 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorcolumnCount() > 5) - { + { tab_item=(new_row ? new QTableWidgetItem : tab_wgt->item(lin_idx, 5)); + fnt.setItalic(false); tab_item->setFont(fnt); - tab_item->setText(objs[i]->getComment().size()>0 ? objs[i]->getComment() : QString("-")); + + if(search_attr != Attributes::Name && + search_attr != Attributes::Schema && + search_attr != Attributes::Comment) + tab_item->setText(objs[i]->getSearchAttributes().at(search_attr)); + else + tab_item->setText(objs[i]->getComment()); + if(new_row) tab_wgt->setItem(lin_idx, 5, tab_item); } @@ -456,6 +491,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorsetUpdatesEnabled(true); tab_wgt->setSortingEnabled(true); + tab_wgt->resizeColumnsToContents(); } } diff --git a/libpgmodeler_ui/src/objectfinderwidget.h b/libpgmodeler_ui/src/objectfinderwidget.h index b55189ad32..b307320fd8 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.h +++ b/libpgmodeler_ui/src/objectfinderwidget.h @@ -34,6 +34,14 @@ class ObjectFinderWidget : public QWidget, public Ui::ObjectFinderWidget { private: Q_OBJECT + /*! \brief Store in a unordered list the attributes in order to allow the user + * select which attribute will be used to search objects */ + static const QStringList search_attribs, + + /*! \brief Store in a unordered list the attributes in a translated way in order to + * populate the combo box used to select which attribute will be used to search objects */ + search_attribs_i18n; + vector found_objs; QMenu select_menu, fade_menu; @@ -59,7 +67,7 @@ class ObjectFinderWidget : public QWidget, public Ui::ObjectFinderWidget { /*! \brief Lists the objects of a vector in a QTableWidget. Any row of table contains the reference to the object on the first column */ - static void updateObjectTable(QTableWidget *tab_wgt, vector &objects); + static void updateObjectTable(QTableWidget *tab_wgt, vector &objects, const QString &search_attr = Attributes::Name); //! \brief Sets the database model to work on void setModel(ModelWidget *model_wgt); diff --git a/libpgmodeler_ui/ui/objectfinderwidget.ui b/libpgmodeler_ui/ui/objectfinderwidget.ui index 8b8788e359..724cc07ca8 100644 --- a/libpgmodeler_ui/ui/objectfinderwidget.ui +++ b/libpgmodeler_ui/ui/objectfinderwidget.ui @@ -38,19 +38,44 @@ 4 - - + + + + true + - + 0 0 + + + 0 + 0 + + + + Defines the search filter + - ... + Filter - - 10 + + + :/icones/icones/filter.png:/icones/icones/filter.png + + + + 20 + 20 + + + + true + + + Qt::ToolButtonTextBesideIcon @@ -73,8 +98,27 @@ - - + + + + + 0 + 0 + + + + + 50 + 0 + + + + Pattern: + + + + + false @@ -91,14 +135,14 @@ - Clears the search results + (Un)selects the graphical objects in the results grid - Clear + Select - :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png + :/icones/icones/selmovobjeto.png:/icones/icones/selmovobjeto.png @@ -106,80 +150,73 @@ 20 + + false + + + QToolButton::InstantPopup + Qt::ToolButtonTextBesideIcon - - + + 0 0 - - - 50 - 0 - - - Pattern: + ... + + + 10 - - - - - 20 - 20 - + + + + false - + + + 0 + 0 + + + - 20 - 20 + 0 + 0 - Hide this widget + Clears the search results - ... + Clear - :/icones/icones/fechar1.png:/icones/icones/fechar1.png - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding + :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png - + - 40 + 20 20 - + + Qt::ToolButtonTextBesideIcon + + - - - true - + 0 @@ -192,15 +229,12 @@ 0 - - Defines the search filter - - Filter + Find - :/icones/icones/filter.png:/icones/icones/filter.png + :/icones/icones/objselect.png:/icones/icones/objselect.png @@ -208,16 +242,42 @@ 20 - - true - Qt::ToolButtonTextBesideIcon - - + + + + + 20 + 20 + + + + + 20 + 20 + + + + Hide this widget + + + ... + + + + :/icones/icones/fechar1.png:/icones/icones/fechar1.png + + + true + + + + + false @@ -234,14 +294,14 @@ - (Un)selects the graphical objects in the results grid + Fades outs all the graphical objects in the results grid (or those not listed). The current fade in/out state of all objects is modified. - Select + Fade out - :/icones/icones/selmovobjeto.png:/icones/icones/selmovobjeto.png + :/icones/icones/fadeout.png:/icones/icones/fadeout.png @@ -260,7 +320,7 @@ - + Qt::Vertical @@ -306,7 +366,59 @@ 4 - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Regular Expression + + + + + + + + 0 + 0 + + + + Case Sensitive + + + + + + + + 0 + 0 + + + + Exact Match + + + + 2 @@ -447,65 +559,6 @@ - - - - - 0 - 0 - - - - Regular Expression - - - - - - - - 0 - 0 - - - - Case Sensitive - - - - - - - - 0 - 0 - - - - Exact Match - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Search comments - - - @@ -633,89 +686,31 @@ Comment - - - :/icones/icones/editar.png:/icones/icones/editar.png + + AlignLeading|AlignVCenter - - - - - 0 - 0 - - - - - 0 - 0 - - - - Find + + + + Qt::Horizontal - - - :/icones/icones/objselect.png:/icones/icones/objselect.png + + QSizePolicy::Expanding - + - 20 + 40 20 - - Qt::ToolButtonTextBesideIcon - - + - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Fades outs all the graphical objects in the results grid (or those not listed). The current fade in/out state of all objects is modified. - - - Fade out - - - - :/icones/icones/fadeout.png:/icones/icones/fadeout.png - - - - 20 - 20 - - - - false - - - QToolButton::InstantPopup - - - Qt::ToolButtonTextBesideIcon - - + + From 0e2107269ca7ce4dc1a844a6fab40b2e00ab0ff0 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 7 May 2019 16:26:56 -0300 Subject: [PATCH 339/425] Adding missing tootip on ObjectFinderWidget --- libpgmodeler_ui/src/objectfinderwidget.cpp | 1 + libpgmodeler_ui/ui/objectfinderwidget.ui | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 9011cd0f1e..1db8fce767 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -492,6 +492,7 @@ void ObjectFinderWidget::updateObjectTable(QTableWidget *tab_wgt, vectorsetUpdatesEnabled(true); tab_wgt->setSortingEnabled(true); tab_wgt->resizeColumnsToContents(); + tab_wgt->resizeRowsToContents(); } } diff --git a/libpgmodeler_ui/ui/objectfinderwidget.ui b/libpgmodeler_ui/ui/objectfinderwidget.ui index 724cc07ca8..3cb3e2e923 100644 --- a/libpgmodeler_ui/ui/objectfinderwidget.ui +++ b/libpgmodeler_ui/ui/objectfinderwidget.ui @@ -710,7 +710,11 @@ - + + + The attribute of the objects in which the search will occur + + From eaced1d64056e02f7e7ff09bebb94543d749aa0c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 8 May 2019 10:22:36 -0300 Subject: [PATCH 340/425] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. --- libpgmodeler/src/databasemodel.cpp | 12 ++++++++++-- libpgmodeler_ui/src/constraintwidget.cpp | 6 ++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index e03a03ad7f..3df89b66ae 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1210,13 +1210,21 @@ void DatabaseModel::updateTableFKRelationships(Table *table) rel->getTable(BaseRelationship::DstTable)==table)) { Constraint *fk = rel->getReferenceForeignKey(); + if(rel->getTable(BaseRelationship::SrcTable)==table) ref_tab=dynamic_cast
(rel->getTable(BaseRelationship::DstTable)); else ref_tab=dynamic_cast
(rel->getTable(BaseRelationship::SrcTable)); - //Removes the relationship if the table does'nt references the 'ref_tab' - if(fk->getReferencedTable() == ref_tab && table->getObjectIndex(fk) < 0) + /* Removes the relationship if the following cases happen: + * 1) The foreign key references a table different from ref_tab, which means, the user + * have changed the fk manually by setting a new referenced table but the relationship tied to the fk + * does not reflect the new reference. + * + * 2) The fk references the correct table but the source table does not own the fk anymore, which means, + * the fk as removed manually by the user. */ + if(fk->getReferencedTable() != ref_tab || + (fk->getReferencedTable() == ref_tab && table->getObjectIndex(fk) < 0)) { removeRelationship(rel); itr1=base_relationships.begin() + idx; diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 1a9cdfbb75..34c166b4f7 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -279,14 +279,16 @@ void ConstraintWidget::selectReferencedTable(void) { Table *table=dynamic_cast
(ref_table_sel->getSelectedObject()); - if(!table) + if(!table || dynamic_cast(this->object)->getReferencedTable() != table) { - ref_column_cmb->clear(); ref_columns_tab->blockSignals(true); ref_columns_tab->removeRows(); ref_columns_tab->setEnabled(false); ref_columns_tab->blockSignals(false); } + + if(!table) + ref_column_cmb->clear(); else { ref_columns_tab->setEnabled(true); From 89d614870136703e958ea3785ca499efdc7a95fe Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 8 May 2019 11:51:11 -0300 Subject: [PATCH 341/425] Change "New object" action in popup menu in order categorize object types when clicking the database object diminishing the amount of items displayed on the screen. --- libpgmodeler_ui/src/modelwidget.cpp | 28 ++++++++++++++++++++++------ libpgmodeler_ui/src/modelwidget.h | 10 ++++++++-- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 1d580b46a5..c7e4bc71ac 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -383,6 +383,22 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(actions_new_objects[type], SIGNAL(triggered(bool)), this, SLOT(addNewObject(void))); } + // Configuring the submenu of database level objects + action_database_category = new QAction(QIcon(PgModelerUiNs::getIconPath(ObjectType::Database)), trUtf8("Database object"), this); + action_database_category->setMenu(&database_category_menu); + types_vect = BaseObject::getChildObjectTypes(ObjectType::Database); + + for(auto &type : types_vect) + database_category_menu.addAction(actions_new_objects[type]); + + // Configuring the submenu of schema level objects + action_schema_category = new QAction(QIcon(PgModelerUiNs::getIconPath(ObjectType::Schema)), trUtf8("Schema object"), this); + action_schema_category->setMenu(&schema_category_menu); + types_vect = BaseObject::getChildObjectTypes(ObjectType::Schema); + + for(auto &type : types_vect) + schema_category_menu.addAction(actions_new_objects[type]); + //Creating the relationship submenu rels_menu=new QMenu(this); actions_new_objects[ObjectType::Relationship]->setMenu(rels_menu); @@ -3703,12 +3719,12 @@ void ModelWidget::configurePopupMenu(const vector &objects) //Case there is no selected object or the selected object is the database model if(objects.empty() || (objects.size()==1 && objects[0]==db_model)) { - vector types_vect = BaseObject::getObjectTypes(false, { ObjectType::Database, ObjectType::Permission, ObjectType::BaseRelationship }); - - //Configures the "New object" menu with the types at database level - for(auto &type : types_vect) - new_object_menu.addAction(actions_new_objects[type]); - + new_object_menu.addAction(action_database_category); + new_object_menu.addAction(action_schema_category); + new_object_menu.addAction(actions_new_objects[ObjectType::Relationship]); + new_object_menu.addAction(actions_new_objects[ObjectType::GenericSql]); + new_object_menu.addAction(actions_new_objects[ObjectType::Tag]); + new_object_menu.addAction(actions_new_objects[ObjectType::Textbox]); action_new_object->setMenu(&new_object_menu); popup_menu.addAction(action_new_object); diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index 90e683d187..aef1d8b187 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -123,7 +123,11 @@ class ModelWidget: public QWidget { jump_to_tab_menu, - toggle_sch_rects_menu; + toggle_sch_rects_menu, + + database_category_menu, + + schema_category_menu; //! \brief Stores the selected object on the scene vector selected_objects; @@ -252,7 +256,9 @@ class ModelWidget: public QWidget { *action_schemas_rects, *action_show_schemas_rects, *action_hide_schemas_rects, - *action_edit_data; + *action_edit_data, + *action_database_category, + *action_schema_category; //! \brief Actions used to create new objects on the model map actions_new_objects; From 57217f66decc519d9b025e24c23d3cab8fe27488 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 8 May 2019 15:12:22 -0300 Subject: [PATCH 342/425] Updated the CHANGELOG.md Added code snippets for foreign server --- CHANGELOG.md | 63 +++++++ conf/defaults/snippets.conf | 357 +++++++++++++++++++----------------- conf/dtd/snippets.dtd | 2 +- conf/snippets.conf | 11 ++ 4 files changed, 259 insertions(+), 174 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46b3c0abc3..6115ef7646 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,69 @@ Change Log --------- +v0.9.2-beta +------ +Release date: May 13, 2019
+ +* [New] Added support to foreign server. +* [New] Added support to foreign data wrapper. +* [New] Adding missing tootip on ObjectFinderWidget. +* [New] Generic SQL objects now support dynamic references to objects which can be used in the definition code. +* [New] Added support to compare foreign servers on diff process. +* [New] Created a generic getAlterDefinition on ForeignObject. +* [New] Added ForeignServer toolbutton in NewObjectOverlayWidget. +* [New] Added support to the reverse engineering foreign server objects. +* [New] Added code snippets for foreign data wrapper and foreign server. +* [New] Added support to diff foreign data wrappers +* [New] Added support to set permissions to foreign data wrapper. +* [New] Added the WRAPPER and SERVER key words to sql-highlight.conf. +* [New] Added the method PgSqlType::isExactTo in order to do a full comparison (all attributes) between two data types. +* [New] Adding the ability to view references to store referenced tables. This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this relationship is created between the view and all involved tables. +* [New] Added missing data type macaddr8. +* [New] Enabling quick clear button on several input fields. +* [New] Added support to result set filtering in the SQL execution widget. +* [New] Adding a column labeled "Comment" in TableWidget and ViewWidget to hold comments of children objects. +* [Change] Change "New object" action in popup menu in order categorize object types when clicking the database object diminishing the amount of items displayed on the screen. +* [Change] Improved the object search mechanism in such way that various attributes of the object can be matched. New searchable attribute may be added in the future. +* [Change] Added missing code documentation. +* [Change] Minor adjustment on ForeignDataWrapper::getAlterDefinition. +* [Change] Minor improvement on ModelDatabaseDiffForm to show the connection id of the databases being imported in the output tree. +* [Change] Formatting server objects' attributes on DatabaseExplorerWidget. +* [Change] Minor adjustments on the icons of the buttons in ObjectsTableWidget. +* [Change] Improved the method DatabaseModel::getObjectReferences to detected foreign data wrappers as functions' references. +* [Change] Minor code refactoring on Table and View classes. +* [Change] Renamed the method Exception::getErrorType to Exception::getErrorCode. +* [Change] Improved the ModelValidationWidget in such way that is possible to operate over objects on the output list through their respective context menu (the same as in the ModelWidget). +* [Change] Now its possible to trigger the swap ids dialog for two selected objects, causing their ids to be swapped more quickly. +* [Change] Minor refactor on schema files. +* [Change] Minor attributes refactoring on several classes. +* [Change] Minor change in the PgSqlType constructor by turning some parameters optional in order to facilitate the creation of array only types. +* [Change] Minor update on disclaimer text at start of the source files. +* [Change] Allowing copied object to be pasted multiple times. This feature works only with copy/paste operation without remove the pasted objects from the clipboard, for cut/paste the behaviour is unchanged. +* [Change] Increased the maximum limit of SQL history. +* [Change] Updated the windeploy.sh and the installer scripts. +* [Change] Adjusted the installer scripts. +* [Change] Changed the windows deploy script to use Qt Installer Framework. +* [Change] Adjusted the deploy script to use Qt 5.12. +* [Change] Fixed the windows deploy script to use newer version of the compiler in 64 bits environment. +* [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. +* [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. +* [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. +* [Fix] Fixed a bug that was causing tables not to be moved on the canvas using mouse. +* [Fix] Fixed a crash related to destruction of special objects on DatabaseModel::destroyObjects. +* [Fix] Fixed a bug that could crash the application when no language was specified to a funcion and the SQL/XML code was being generated. +* [Fix] Minor fix a bug on index importing. +* [Fix] Minor fix on View::isReferencingTable. +* [Fix] Fixed a crash when a query executed in SQLExecutionWidget was a DDL one or was not returning results. +* [Fix] Fixed a bug in CLI that was failing to fix model in certain cases. +* [Fix] Minor fix on buttons tooltips. +* [Fix] Fixed a bug that was causing syntax error if the last column of a table had the SQL code disabled. +* [Fix] Fixed a bug on diff process due to a missing attribute on the generation of diff code for inheritance relationships. +* [Fix] Fixed a bug when rendering several self relationships attached to the same table. +* [Fix] Fixed the CLI in order to restore the layers information when fixing a broken model. +* [Fix] Fixed a bug in object finder that was causing objects from a hidden layer to be displayed causing inconsistency on the layer state. + + v0.9.2-alpha1 ------ Release date: December 17, 2018
diff --git a/conf/defaults/snippets.conf b/conf/defaults/snippets.conf index a35325c533..d4a2a0f3c9 100644 --- a/conf/defaults/snippets.conf +++ b/conf/defaults/snippets.conf @@ -1,7 +1,7 @@ @@ -13,13 +13,13 @@ $ob [ , INITCOND = ] {initial-cond} $sp $cb $br $ob [ , SORTOP = ] {sort-op} $sp $cb $br ) $br]]> - + - + - + - + @@ -47,7 +47,7 @@ $ob [ LC_CTYPE = ] {lc-ctype} $sp $cb $br $ob [ TABLESPACE = ] {tablespace} $sp $cb $br $ob [ CONNECTION LIMIT = ] {connlimit} $sp $cb $br]]> - + @@ -59,7 +59,7 @@ $ob [ DEFAULT ] {default-value} $cb $br $ob [ CONSTRAINT ] {constraint} $cb $br $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - + @@ -67,7 +67,7 @@ $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - + @@ -84,7 +84,7 @@ $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - + @@ -92,23 +92,23 @@ $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - + - + - + - - - + + + - + + + + + + + + + - + - - + + @@ -221,8 +232,8 @@ $ob [ IMMUTABLE | STABLE | VOLATILE ] $cb $br]]> - - + + @@ -234,7 +245,7 @@ $ob [ EXTERNAL ] $cb [ SECURITY ] $ob [ INVOKER | DEFINER ] $cb $br]]> - + - - + + - + - + - - + + - - + + - - + + - + - + - - + + - + - + %if ({superuser}=="false") %then {no-mod} %end SUPERUSER $br %if ({createdb}=="false") %then {no-mod} %end CREATEDB $br -%if ({createrole}=="false") %then {no-mod} %end CREATEROLE $br +%if ({createrole}=="false") %then {no-mod} %end CREATEROLE $br %if ({inherit}=="false") %then {no-mod} %end INHERIT $br %if ({login}=="false") %then {no-mod} %end LOGIN $br %if ({replication}=="false") %then {no-mod} %end REPLICATION $br @@ -378,19 +389,19 @@ $br]]> $ob [ ENCRYPTED | UNENCRYPTED ] $cb [ PASSWORD ] '{new-password}' $br [VALID UNTIL ] '{validity}' $br]]> - + - - + + @@ -404,8 +415,8 @@ $ob [ START ] {start} $sp $cb $br $ob [ CACHE ] {cache} $sp $cb $br $ob $sp $ob [ NO ] $cb [ CYCLE ] $sp $cb $br $ob [ OWNED BY ] $ob $sp {owner-col} [ | NONE ] $cb $sp $cb $br]]> - - + + %if ({cycle}=="false") %then [NO ] %end CYCLE $br [OWNED BY ] %if {owner-col} %then {owner-col} %else [ NONE] %end $br]]> - - + + [OWNED BY ] %if {owner-col} %then {owner-col} %else [ NONE] %end $br]]> - + - - - - + + - - + + - - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + [)] $br $ob [ TABLESPACE ] {tablespace} $sp $cb $br]]> - + - + - + - - + + @@ -659,21 +670,21 @@ $ob [ TABLESPACE ] {tablespace} $sp $cb $br]]> - + - - + + - - + + - + - + %end $br]]> - - + + - - - + + + [ TO ] $oc new-name $cc $br %end]]> - + - + @@ -761,126 +772,126 @@ $ob [ WHERE (] {predicate} ) $cb $br]]> - + - - + + + extension|eventtrigger|general|policy|foreigndatawrapper|foreignserver) "general"> diff --git a/conf/snippets.conf b/conf/snippets.conf index 8dd890ea71..d4a2a0f3c9 100644 --- a/conf/snippets.conf +++ b/conf/snippets.conf @@ -133,6 +133,17 @@ $tb $ob [ HANDLER ] {handler} [ | NO HANDLER ] $cb $br $tb $ob [ VALIDATOR ] {validator} [ | NO VALIDATOR ] $cb $br]]> + + + + + + + + Date: Thu, 9 May 2019 09:37:07 -0300 Subject: [PATCH 343/425] Adjusted the resize parameters in DataManipulationForm to avoid wrong dialog resizings mainly on Windows. Adjusted the build parameters for macOS and Windows on pgmodeler.pri --- CHANGELOG.md | 1 + libpgmodeler_ui/ui/datamanipulationform.ui | 7 +++++-- pgmodeler.pri | 12 ++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6115ef7646..b27b603641 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ v0.9.2-beta * [Change] Adjusted the deploy script to use Qt 5.12. * [Change] Fixed the windows deploy script to use newer version of the compiler in 64 bits environment. * [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. +* [Change] Adjusted the resize parameters in DataManipulationForm to avoid wrong dialog resizings mainly on Windows. * [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. * [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. * [Fix] Fixed a bug that was causing tables not to be moved on the canvas using mouse. diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index a28228aa7b..3282d4dfa8 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -210,8 +210,11 @@ true - - QAbstractScrollArea::AdjustToContents + + + 0 + 0 + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked diff --git a/pgmodeler.pri b/pgmodeler.pri index 61d94ef72b..480236d884 100644 --- a/pgmodeler.pri +++ b/pgmodeler.pri @@ -146,18 +146,18 @@ unix:!macx { } macx { - PGSQL_LIB = /Library/PostgreSQL/10/lib/libpq.dylib - PGSQL_INC = /Library/PostgreSQL/10/include + PGSQL_LIB = /Library/PostgreSQL/11/lib/libpq.dylib + PGSQL_INC = /Library/PostgreSQL/11/include XML_INC = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2 XML_LIB = /usr/lib/libxml2.dylib INCLUDEPATH += $$PGSQL_INC $$XML_INC } windows { - !defined(PGSQL_LIB, var): PGSQL_LIB = C:/PostgreSQL/10.1/lib/libpq.dll - !defined(PGSQL_INC, var): PGSQL_INC = C:/PostgreSQL/10.1/include - !defined(XML_INC, var): XML_INC = C:/PostgreSQL/10.1/include - !defined(XML_LIB, var): XML_LIB = C:/PostgreSQL/10.1/bin/libxml2.dll + !defined(PGSQL_LIB, var): PGSQL_LIB = C:/msys_64/mingw64/bin/libpq.dll + !defined(PGSQL_INC, var): PGSQL_INC = C:/msys_64/mingw64/include + !defined(XML_INC, var): XML_INC = C:/msys_64/mingw64/include/libxml2 + !defined(XML_LIB, var): XML_LIB = C:/msys_64/mingw64/bin/libxml2-2.dll # Workaround to solve bug of timespec struct on MingW + PostgreSQL < 9.4 QMAKE_CXXFLAGS+="-DHAVE_STRUCT_TIMESPEC" From eb9a728a3dedf0c5d76890fdfa697c30cefdf26e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 9 May 2019 21:34:15 -0300 Subject: [PATCH 344/425] Minor fix in mac deploy script to use Qt 5.12 and PostgreSQL 11 --- macdeploy.sh | 6 +++--- main/res/Info.plist | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/macdeploy.sh b/macdeploy.sh index cda1d4e6e7..1a212edc21 100755 --- a/macdeploy.sh +++ b/macdeploy.sh @@ -1,8 +1,8 @@ #!/bin/bash USR=`whoami` -PGSQL_ROOT=/Library/PostgreSQL/10 -QT_ROOT=/Users/$USR/Qt5.11.2/5.11.2/clang_64 +PGSQL_ROOT=/Library/PostgreSQL/11 +QT_ROOT=/Users/$USR/Qt5.12.3/5.12.3/clang_64 QMAKE_ARGS="-r CONFIG+=x86_64 CONFIG+=release -spec macx-clang" LOG=macdeploy.log @@ -41,7 +41,7 @@ clear echo echo "pgModeler Mac OSX deployment script" echo "PostgreSQL Database Modeler Project - pgmodeler.io" -echo "Copyright 2006-2018 Raphael A. Silva " +echo "Copyright 2006-2019 Raphael A. Silva " # Identifying System Qt version if [ -e "$QT_ROOT/bin/qmake" ]; then diff --git a/main/res/Info.plist b/main/res/Info.plist index 330902878e..0df7f3ecf9 100644 --- a/main/res/Info.plist +++ b/main/res/Info.plist @@ -33,7 +33,7 @@ CFBundleSignature ???? CFBundleVersion - 0.8.0 + 0.9.2 CSResourcesFileMapped NSPrincipalClass From 568823c332f364b58163ed23935ed10c2c5388d4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 10 May 2019 17:29:03 -0300 Subject: [PATCH 345/425] Fixed the importing of simple CSV file containing windows CRLF chars (issue #1270) --- libpgmodeler_ui/src/csvloadwidget.cpp | 30 +++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/libpgmodeler_ui/src/csvloadwidget.cpp b/libpgmodeler_ui/src/csvloadwidget.cpp index c8e7ed13b7..1e0db46cd4 100644 --- a/libpgmodeler_ui/src/csvloadwidget.cpp +++ b/libpgmodeler_ui/src/csvloadwidget.cpp @@ -87,22 +87,33 @@ QList CsvLoadWidget::loadCsvFromBuffer(const QString &csv_buffer, c if(!csv_buffer.isEmpty()) { QString double_quote=QString("%1%1").arg(text_delim), - placeholder = QString("⁋"), aux_buffer = csv_buffer; - QStringList values, rows; + placeholder = QString(QChar::ReplacementCharacter), + aux_buffer = csv_buffer, + win_line_break = QString("%1%2").arg(QChar(QChar::CarriageReturn)).arg(QChar(QChar::LineFeed)), + mac_line_break = QString("%1").arg(QChar(QChar::CarriageReturn)); + QStringList values, rows, aux_values; QRegExp empty_val; - //If no custom separator is specified we use the default ';' - aux_buffer.replace(QString("\r\n"), placeholder); - rows=aux_buffer.split(QChar::LineFeed, QString::SkipEmptyParts); - rows.replaceInStrings(placeholder, QString("\r\n")); + if(aux_buffer.contains(win_line_break)) + aux_buffer.replace(win_line_break, QString(QChar::LineFeed)); + else if(aux_buffer.contains(mac_line_break)) + aux_buffer.replace(mac_line_break, QString(QChar::LineFeed)); if(cols_in_first_row) { - csv_cols=rows[0].split(separator); + int lf_idx = aux_buffer.indexOf(QChar::LineFeed); + + if(lf_idx < 0) + lf_idx = aux_buffer.size(); + + csv_cols=aux_buffer.mid(0, lf_idx).split(separator); csv_cols.replaceInStrings(text_delim, QString()); - rows.removeAt(0); + aux_buffer.replace(0, lf_idx + 1, QString()); } + aux_buffer.replace(QString("%1%2").arg(QChar(QChar::LineFeed)).arg(text_delim), placeholder); + rows = aux_buffer.split(placeholder, QString::SkipEmptyParts); + //Configuring an regexp to remove empty quoted values, e.g, "", if(!text_delim.isEmpty()) empty_val = QRegExp(QString("(\\%1\\%1)(\\%2)").arg(text_delim).arg(separator)); @@ -113,12 +124,13 @@ QList CsvLoadWidget::loadCsvFromBuffer(const QString &csv_buffer, c row.replace(empty_val, separator); /* In order to preserve double quotes (double delimiters) inside the values, - we first replace them by a placeholder, erase the delimiters and restore the previous value */ + * we first replace them by a placeholder, erase the delimiters and restore the previous value */ row.replace(double_quote, placeholder); row.replace(text_delim, QString()); row.replace(placeholder, double_quote); values = row.split(separator); + for(int i =0; i < values.count(); i++) values[i] = values[i].trimmed(); From 4ba2355633f69c6f6afabed3e7ba72cda879b47c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 10 May 2019 17:29:28 -0300 Subject: [PATCH 346/425] Minor updates on README.md and RELEASENOTES.md (wip) --- README.md | 1 + RELEASENOTES.md | 101 ++++++++++++-------------------- libpgmodeler/src/permission.cpp | 3 +- libpgmodeler/src/permission.h | 2 +- 4 files changed, 43 insertions(+), 64 deletions(-) diff --git a/README.md b/README.md index 89480f7dd6..b61f33a6c2 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ For details about installation process from source code visit the [Installation] Known Issues ----------- +* pgModeler can't handle correctly the importing of complex CSV files (multilined cell values) in data manipulation form or pasting CSV content of that complexity on that dialog. * Due to the usage of Qt's raster engine to draw objects, the process of handling objects on the canvas tends to get slower as lots of objects are created causing constant CPU usage. A heavy performance degradation can be noticed when dealing with models with ~500+ tables and/or relationships. There're plans to improve the speed of drawing operations for large models for future releases. * The diff process still presents false-positive results due its limitations. Sometimes, there is the need to run the process twice to get the full changes. * pgModeler does not fully supports the [quoted identifier notation](http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS). When using quoted identifiers only the following characters are accepted in the middle of names: a-z A-Z 0-9 _ . @ $ - / \ space. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index a5aa971b79..4959a63215 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,64 +1,41 @@ -v0.9.2-alpha1 +v0.9.2-beta ------ -Release date: December 17, 2018
-Changes since: v0.9.2-alpha
- -Summary: finally, after four months, we have a new version out of the oven! This one has A LOT of changes that range from several code refactoring and performance improvements to the introduction of new interesting features like table partitioning and canvas layers.
- -First, let's talk about the changes and improvements. The objects drawing operations received a good set of patches making it a bit faster and less memory consuming. Putting these improvements in numbers, we have reduced in ~40% the internal size of a database model which means less objects to keep in memory as well to be drawn giving a good performance gain. You can see more details here: https://bit.ly/2Q3XMT5
- -The overall performance of the reverse engineering was improved which, in consequence, have enhanced the diff process performance as well. The diff process received some fixes and changes and now it is generating less false-positive changes.
- -In the new features side, we added scene layers which goals is to introduce a new level of visual segmentation of graphical objects. Another new feature created is the support to view columns that are deduced from the relationships between these objects and the tables.
- -Still in the design view in order to be more close to PostgreSQL 10+ new features pgModeler is now capable of handling declarative table partitioning (this includes code generation, reverse engineering and models comparison). Also, tables and views can have their attributes paginated or even collapsed to minimize the area occupied by these objects making big objects easier to visualize.
- -Now, about the bug fixes, several crashes were eliminated making the tool more stable for different usages, the reverse engineering received some patches so it can import correctly user-defined type in form of arrays and many others
- -Finally, some of the key changes of this release are listed below. For the complete list of changes, fixes and new feautures, please, read the CHANGELOG.md.
- -* [New] Added support to scene layers. -* [New] Added support to view's columns importing in DatabaseImportHelper. -* [New] Added the ability to load view columns from database model file in DatabaseModel::createView. -* [New] Added a tab "Columns" in ReferenceWidget where the user will be able to insert columns to be used as view columns. -* [New] Added support to pagination of tables and views columns pagination. -* [New] Added a fix step on CLI to remove the deprecated attribute hide-ext-attribs from tables and views xml code. -* [New] Added a configuration option to control attributes per pages in tables and views. -* [New] Added support to save collapsing states and current attributes pages to the database model file. -* [New] Added support to OLD/NEW tables aliases on triggers. -* [New] Added support for partition attaching/detaching detection in diff process. -* [New] Added support to importing partitioned/partition tables on DatabaseImportHelper. -* [New] Added support to resize grid cells to fit contents on ObjectsTableWidget. -* [New] Added support to hide columns on data manipulation dialog. -* [Change] Minor fixes in OperationList in order to force views to be updated correctly when operating over a table which is referenced by those objects. -* [Change] Minor adjustments on SchemaView and BaseTableView (and its children classes) to update the geometry when they switch from invisble to visible state. -* [Change] Improved the update of views when referenced columns and tables change their structure. -* [Change] Improved database model loading times by avoiding the rendering of tables while the children objects (indexes, trigger, rules, etc) are being added. -* [Change] The zoom in/out level is now sensible on how much the user rolls the mouse wheel. -* [Change] Code refactoring done in order to make it more close to C++14 in order to take advantage of new features introduced by that standard. -* [Change] Improved the diff process in such way to avoid generating unnecessary/noise commands related to changing types of columns to integer and setting nextval() call as default value. -* [Change] Move the FK settings, copy options and name patterns group boxes to a dedicated tab on RelationshipWidget. -* [Change] Improved the models destruction when closing the application. -* [Change] Improved the Index/Exclude/ParitionKey elements handling by creating a generic form/grid that handles these kinds of objects (ElementsTableWidget). -* [Change] Modified the RelationshipWidget in order to handle partitioning relationships. -* [Change] Modified RelationshipConfigWidget in order to write name partterns for partitioning relationships. -* [Change] Improved the reverse engineering performance by avoiding update relationships as they are being imported. -* [Change] Improved the object duplication feature in ModelWidget. -* [Change] When the model is loaded it is copied to the temporary models storage as a first version of the temporary dbm file. -* [Change] pgModeler will now use the official docs url in the help buttons. -* [Fix] Fixed a crash while renaming view's children objects. -* [Fix] Fixed the rendering of views which contain only a single reference that is the whole object's defintion. -* [Fix] Fixed the column name deduction for recursive views. -* [Fix] Fixed a bug that was causing crashes while configure new constraints on tables. -* [Fix] Fixed a regression in schema's rectangle selection. -* [Fix] Fixed an artifact when user switched on and off the compact view. -* [Fix] Fixed a bug in DatabaseModel::destroyObjects that could lead to segfault when the destroyed model had permissions on it. -* [Fix] Fixed a bug when importing columns which data types is some user defined type in form of array, e.g., custom_type[]. -* [Fix] Fixed a bug that was causing special primary key configured on a relationship to make the original primary key of the table to disappear after disconnect the relationship. Now pgModeler stores in memory the original PK prior the connection of relationship and creation of the special PK. When disconnected the relationship, the original primary key is restored on its parent table. -* [Fix] Fixed the class Relationship to reuse compatible columns when handling partitioning relationships. -* [Fix] Fixed the diff process in such way to create new columns with their respective COMMENT ON statement when present. -* [Fix] Fixed the detection of comment changes for columns on diff process. -* [Fix] Making pgModeler honor the columns arrangement in primary keys. -* [Fix] Fixed a bug that was causing FK relationship deletion to crash the application sometimes. -* [Fix] Some fixes were done in the ModelOverviewWidget in order to support large models without exceed the screen size when configuring the size of the overall widget. +Release date: May 13, 2019
+Changes since: v0.9.2-alpha1
+ +Summary: + +Finally, some of the key changes of this release are listed below. For the complete list of changes, fixes and new feautures, please, read the file CHANGELOG.md.
+ +* [New] Added support to foreign server. +* [New] Added support to foreign data wrapper. +* [New] Generic SQL objects now support dynamic references to objects which can be used in the definition code. +* [New] Added support to compare foreign servers on diff process. +* [New] Added support to the reverse engineering foreign server objects. +* [New] Added code snippets for foreign data wrapper and foreign server. +* [New] Added support to diff foreign data wrappers +* [New] Added support to set permissions to foreign data wrapper. +* [New] Added the WRAPPER and SERVER key words to sql-highlight.conf. +* [New] Adding the ability to view references to store referenced tables making possible to identify which tables are linked to a view. +* [New] Added missing data type macaddr8. +* [New] Added support to result set filtering in the SQL execution widget. +* [Change] Change "New object" action in popup menu in order categorize object types when clicking the database object diminishing the amount of items displayed on the screen. +* [Change] Improved the object search mechanism in such way that various attributes of the object can be matched. New searchable attribute may be added in the future. +* [Change] Minor improvement on ModelDatabaseDiffForm to show the connection id of the databases being imported in the output tree. +* [Change] Improved the ModelValidationWidget in such way that is possible to operate over objects on the output list through their respective context menu (the same as in the ModelWidget). +* [Change] Now its possible to trigger the swap ids dialog for two selected objects, causing their ids to be swapped more quickly. +* [Change] Allowing copied object to be pasted multiple times. This feature works only with copy/paste operation without remove the pasted objects from the clipboard, for cut/paste the behaviour is unchanged. +* [Change] Increased the maximum limit of SQL history. +* [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. +* [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. +* [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. +* [Fix] Fixed a bug that was causing tables not to be moved on the canvas using mouse. +* [Fix] Fixed a bug that could crash the application when no language was specified to a funcion and the SQL/XML code was being generated. +* [Fix] Minor fix a bug on index importing. +* [Fix] Fixed a crash when a query executed in SQLExecutionWidget was a DDL one or was not returning results. +* [Fix] Fixed a bug that was causing syntax error if the last column of a table had the SQL code disabled. +* [Fix] Fixed a bug on diff process due to a missing attribute on the generation of diff code for inheritance relationships. +* [Fix] Fixed a bug when rendering several self relationships attached to the same table. +* [Fix] Fixed the CLI in order to restore the layers information when fixing a broken model. +* [Fix] Fixed a bug in object finder that was causing objects from a hidden layer to be displayed causing inconsistency on the layer state. diff --git a/libpgmodeler/src/permission.cpp b/libpgmodeler/src/permission.cpp index dc6c421803..36d55aa09a 100644 --- a/libpgmodeler/src/permission.cpp +++ b/libpgmodeler/src/permission.cpp @@ -82,7 +82,8 @@ bool Permission::acceptsPermission(ObjectType obj_type, int privilege) Schema: CREATE | USAGE Tablespace: CREATE View: SELECT | INSERT | UPDATE | DELETE | REFERENCES | TRIGGER - Foreign Data Wrapper: USAGE */ + Foreign Data Wrapper: USAGE + Foreign Server: USAGE */ result=result && (((obj_type==ObjectType::Table || obj_type==ObjectType::View) && (priv_id==PrivSelect || priv_id==PrivInsert || diff --git a/libpgmodeler/src/permission.h b/libpgmodeler/src/permission.h index bb2ade32f5..658d474ded 100644 --- a/libpgmodeler/src/permission.h +++ b/libpgmodeler/src/permission.h @@ -44,7 +44,7 @@ class Permission: public BaseObject { * sequence * database * foreign-data wrapper - * foreign server (not implemented) + * foreign server * large objects (not implemented) * function * aggregate From 0a8a050ac896224919ab3d8d998e14ab0fe311fd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 10 May 2019 17:30:44 -0300 Subject: [PATCH 347/425] Removed unused variable --- libpgmodeler_ui/src/csvloadwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/csvloadwidget.cpp b/libpgmodeler_ui/src/csvloadwidget.cpp index 1e0db46cd4..88cf760c51 100644 --- a/libpgmodeler_ui/src/csvloadwidget.cpp +++ b/libpgmodeler_ui/src/csvloadwidget.cpp @@ -91,7 +91,7 @@ QList CsvLoadWidget::loadCsvFromBuffer(const QString &csv_buffer, c aux_buffer = csv_buffer, win_line_break = QString("%1%2").arg(QChar(QChar::CarriageReturn)).arg(QChar(QChar::LineFeed)), mac_line_break = QString("%1").arg(QChar(QChar::CarriageReturn)); - QStringList values, rows, aux_values; + QStringList values, rows; QRegExp empty_val; if(aux_buffer.contains(win_line_break)) From cbc13c0412ab4045a6df81280efcb0467f85f92d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 11 May 2019 10:51:40 -0300 Subject: [PATCH 348/425] Updates on CHANGELOG.md and RELEASENOTES.md for 0.9.2-beta --- CHANGELOG.md | 2 +- RELEASENOTES.md | 22 ++++++++++++++++++---- linuxdeploy.sh | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b27b603641..8a748d7826 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ v0.9.2-beta * [New] Added support to set permissions to foreign data wrapper. * [New] Added the WRAPPER and SERVER key words to sql-highlight.conf. * [New] Added the method PgSqlType::isExactTo in order to do a full comparison (all attributes) between two data types. -* [New] Adding the ability to view references to store referenced tables. This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this relationship is created between the view and all involved tables. +* [New] Added the ability to view references to store referenced tables. This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this feature a relationship is created between the view and all involved tables. * [New] Added missing data type macaddr8. * [New] Enabling quick clear button on several input fields. * [New] Added support to result set filtering in the SQL execution widget. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4959a63215..e7a65f8cda 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,12 +1,26 @@ v0.9.2-beta ------ -Release date: May 13, 2019
+Release date: May 14, 2019
Changes since: v0.9.2-alpha1
-Summary: +Summary: a brand new version has come to you after a work of almost five months on it. This one brings important features requested long ago and several patches to improve the tool's usability.
-Finally, some of the key changes of this release are listed below. For the complete list of changes, fixes and new feautures, please, read the file CHANGELOG.md.
+pgModeler now supports foreign datawrappers and foreign servers natively. This means that you can create, export, import and diff these kinds of objects. For now, foreign tables aren't supported but the schedule is to release this support until the end of this development cycle when lauching the stable 0.9.2.
+ +In order to provide a temporary workaround for the lack of foreign table support the generic SQL objects were improved in such way to store references to another objects in the model which helps to keep track of name changes and giving a touch of dynamicity to this that kind of object.
+ +Now its possible, for instance, create a foreign table from a generic SQL which references a foreign server and any name change on the referenced object will cause the code of the generic SQL (in this case, the foreign table) to be automatically updated avoiding export problems.
+ +In SQL execution widget it's now possible to quickly filter the result set retrieved from a SQL command. This is useful if you need to filter a small set of data without the need of rewrite the the SQL command to get the desired result. The filter basically matches a keyword against a column of the rows on the result grid updating on-the-fly the data visualization.
+ +This release also brings some changes in the available features: the first is the ability to search for objects in the canvas by matching other attributes not only the name. For instance, you can search items by matching a keyword against object's comments, data types, schemas and some others.
+ +A second change is the categorization of the action "New object" in order to diminish the amount of items displayed in the same menu and organizing object types hierarchically.
+ +Now, for the bug fixes, in this release they fix crashes and broken code generation as well improve the objects handling in the canvas.
+ +Lastly, some of the key change log entries of this release are listed below. For the complete list of changes/fixes, please, refer to the file CHANGELOG.md.
* [New] Added support to foreign server. * [New] Added support to foreign data wrapper. @@ -17,7 +31,7 @@ Finally, some of the key changes of this release are listed below. For the compl * [New] Added support to diff foreign data wrappers * [New] Added support to set permissions to foreign data wrapper. * [New] Added the WRAPPER and SERVER key words to sql-highlight.conf. -* [New] Adding the ability to view references to store referenced tables making possible to identify which tables are linked to a view. +* [New] Added the ability to view references to store referenced tables. This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this feature a relationship is created between the view and all involved tables. * [New] Added missing data type macaddr8. * [New] Added support to result set filtering in the SQL execution widget. * [Change] Change "New object" action in popup menu in order categorize object types when clicking the database object diminishing the amount of items displayed on the screen. diff --git a/linuxdeploy.sh b/linuxdeploy.sh index fdc36ccfc1..c8c5717be6 100755 --- a/linuxdeploy.sh +++ b/linuxdeploy.sh @@ -4,7 +4,7 @@ case `uname -m` in "x86_64") ARCH="linux64" - FALLBACK_QT_ROOT=/opt/qt-5.12.0/5.12.0/gcc_64 + FALLBACK_QT_ROOT=/opt/qt-5.12.3/5.12.3/gcc_64 FALLBACK_QMAKE_ROOT="$FALLBACK_QT_ROOT/bin" ;; From 29c96cf985c821aab61a15458ae00e926467dca2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 11 May 2019 17:22:08 +0000 Subject: [PATCH 349/425] Fixed the windows deploy script to use MSYS2 structure by default --- windeploy.sh | 128 +++++++++++++++++++++++++-------------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/windeploy.sh b/windeploy.sh index 75ba44793d..ce00bb0a7c 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -1,7 +1,5 @@ #!/bin/bash -INNOSETUP_CMD='/c/Program Files (x86)/Inno Setup 5/ISCC.exe' -QT_IFW_ROOT='/c/Qt/QtIFW-3.0.6' LOG=windeploy.log # Detecting current pgModeler version @@ -58,52 +56,37 @@ else PKGNAME="pgmodeler-$DEPLOY_VER-windows$WIN_BITS" fi -if [ $X64_BUILD = 1 ]; then - # Settings for x64 build - QT_INSTALL_VERSION='5.12.0' - QT_BASE_VERSION='5.12.0' - QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/" - QMAKE_ROOT=$QT_ROOT/bin - MINGW_ROOT="/c/msys_64/mingw64/bin" - PGSQL_ROOT="/c/msys_64/mingw64/bin" - QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release \ - XML_INC+=$MINGW_ROOT/../include/libxml2 \ - XML_LIB+=$MINGW_ROOT/libxml2-2.dll \ - PGSQL_INC+=$MINGW_ROOT/../include \ - PGSQL_LIB+=$MINGW_ROOT/libpq.dll" - DEP_LIBS="$MINGW_ROOT/libcrypto-1_1-x64.dll \ - $MINGW_ROOT/libgcc_s_seh-1.dll \ - $MINGW_ROOT/libiconv-2.dll \ - $MINGW_ROOT/libintl-8.dll \ - $MINGW_ROOT/liblzma-5.dll \ - $MINGW_ROOT/libpq.dll \ - $MINGW_ROOT/libssl-1_1-x64.dll \ - $MINGW_ROOT/libstdc++-6.dll \ - $MINGW_ROOT/libwinpthread-1.dll \ - $MINGW_ROOT/libxml2-2.dll \ - $MINGW_ROOT/zlib1.dll" +# Settings for x64 build +if [ $X64_BUILD = 1 ]; then + QT_ROOT="/c/msys_64/mingw64" + MINGW_ROOT="/c/msys_64/mingw64/bin" + DEP_LIBS="$DEP_LIBS \ + $MINGW_ROOT/libssl-1_1-x64.dll \ + $MINGW_ROOT/libcrypto-1_1-x64.dll \ + $MINGW_ROOT/libgcc_s_seh-1.dll" +# Settings for x86 build else - # Default setting for x86 build - QT_INSTALL_VERSION='5.9.3' - QT_BASE_VERSION='5.9.3' - PGSQL_VERSION='10.1' - QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/${QT_BASE_VERSION}/mingw53_32/" - QMAKE_ROOT=$QT_ROOT/bin - QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release" - MINGW_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/Tools/mingw530_32/bin" - PGSQL_ROOT="/c/PostgreSQL/${PGSQL_VERSION}/bin" - DEP_LIBS="$QMAKE_ROOT/libgcc_s_dw2-1.dll \ - $QMAKE_ROOT/libstdc++-6.dll \ - $QMAKE_ROOT/libwinpthread-1.dll \ - $PGSQL_ROOT/libiconv-2.dll \ - $PGSQL_ROOT/libintl-8.dll \ - $PGSQL_ROOT/zlib1.dll \ - $PGSQL_ROOT/libxml2.dll \ - $PGSQL_ROOT/libpq.dll \ - $PGSQL_ROOT/libeay32.dll \ - $PGSQL_ROOT/ssleay32.dll" + QT_ROOT="/c/msys_64/mingw32" + MINGW_ROOT="/c/msys_64/mingw32/bin" + DEP_LIBS="$DEP_LIBS \ + $MINGW_ROOT/libssl-1_1.dll \ + $MINGW_ROOT/libcrypto-1_1.dll \ + $MINGW_ROOT/libgcc_s_dw2-1.dll" fi +# Common settings for both architectures +QT_INSTALL_VERSION='5.12.3' +QT_BASE_VERSION='5.12.3' +QT_PLUGINS_ROOT="$QT_ROOT/share/qt5/plugins" +QMAKE_ROOT=$MINGW_ROOT +QT_IFW_ROOT=$MINGW_ROOT +PGSQL_ROOT=$MINGW_ROOT +QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release \ + XML_INC+=$MINGW_ROOT/../include/libxml2 \ + XML_LIB+=$MINGW_ROOT/libxml2-2.dll \ + PGSQL_INC+=$MINGW_ROOT/../include \ + PGSQL_LIB+=$MINGW_ROOT/libpq.dll" + if [ $DEMO_VERSION = 1 ]; then QMAKE_ARGS="$QMAKE_ARGS DEMO_VERSION+=true" fi @@ -112,18 +95,37 @@ PKGFILE=$PKGNAME.exe GENINSTALLER=pgmodeler.exe INSTALL_ROOT="$PWD/build" DIST_ROOT="$PWD/dist" -ISSFILE=./installer/windows/pgmodeler.iss QT_CONF="$INSTALL_ROOT/qt.conf" DEP_PLUGINS_DIR="$INSTALL_ROOT/qtplugins" PLUGINS="dummy xml2object" # Common dependency libraries -DEP_LIBS+=" $QMAKE_ROOT/Qt5Core.dll \ - $QMAKE_ROOT/Qt5Gui.dll \ - $QMAKE_ROOT/Qt5Widgets.dll \ - $QMAKE_ROOT/Qt5PrintSupport.dll \ - $QMAKE_ROOT/Qt5Network.dll \ - $QMAKE_ROOT/Qt5Svg.dll " +DEP_LIBS="$DEP_LIBS \ + $MINGW_ROOT/libicuin*.dll \ + $MINGW_ROOT/libicuuc*.dll \ + $MINGW_ROOT/libicudt*.dll \ + $MINGW_ROOT/libpcre2-16-0.dll \ + $MINGW_ROOT/libharfbuzz-0.dll \ + $MINGW_ROOT/libpng16-16.dll \ + $MINGW_ROOT/libfreetype-6.dll \ + $MINGW_ROOT/libgraphite2.dll \ + $MINGW_ROOT/libglib-2.0-0.dll \ + $MINGW_ROOT/libpcre-1.dll \ + $MINGW_ROOT/libbz2-1.dll \ + $MINGW_ROOT/libstdc++-6.dll \ + $MINGW_ROOT/libwinpthread-1.dll \ + $MINGW_ROOT/zlib1.dll \ + $MINGW_ROOT/libpq.dll \ + $MINGW_ROOT/libxml2-2.dll \ + $MINGW_ROOT/liblzma-5.dll \ + $MINGW_ROOT/libiconv-2.dll \ + $MINGW_ROOT/libintl-8.dll \ + $QMAKE_ROOT/Qt5Core.dll \ + $QMAKE_ROOT/Qt5Gui.dll \ + $QMAKE_ROOT/Qt5Widgets.dll \ + $QMAKE_ROOT/Qt5PrintSupport.dll \ + $QMAKE_ROOT/Qt5Network.dll \ + $QMAKE_ROOT/Qt5Svg.dll " #Dependency qt plugins copied to build dir DEP_PLUGINS="imageformats/qicns.dll \ @@ -197,7 +199,7 @@ if [ $? -ne 0 ]; then fi echo "Compiling code..." -$MINGW_ROOT/mingw32-make.exe -j7 >> $LOG 2>&1 +$MINGW_ROOT/mingw32-make.exe -j10 >> $LOG 2>&1 if [ $? -ne 0 ]; then echo @@ -238,7 +240,7 @@ echo "Libraries=." >> $QT_CONF for plug in $DEP_PLUGINS; do pdir=`dirname $plug` mkdir -p $DEP_PLUGINS_DIR/$pdir >> $LOG 2>&1 - cp $QT_ROOT/plugins/$plug $DEP_PLUGINS_DIR/$pdir >> $LOG 2>&1 + cp $QT_PLUGINS_ROOT/$plug $DEP_PLUGINS_DIR/$pdir >> $LOG 2>&1 if [ $? -ne 0 ]; then echo @@ -248,14 +250,14 @@ for plug in $DEP_PLUGINS; do fi done -$MINGW_ROOT/mingw32-make.exe install >> $LOG 2>&1 +#$MINGW_ROOT/mingw32-make.exe install >> $LOG 2>&1 -if [ $? -ne 0 ]; then - echo - echo "** Installation failed!" - echo - exit 1 -fi +#if [ $? -ne 0 ]; then +# echo +# echo "** Installation failed!" +# echo +# exit 1 +#fi echo "Packaging installation..." @@ -288,7 +290,7 @@ if [ $? -ne 0 ]; then exit 1 fi -$QT_IFW_ROOT/bin/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_ROOT/$PKGNAME.exe" >> $LOG 2>&1 +$QT_IFW_ROOT/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_ROOT/$PKGNAME.exe" >> $LOG 2>&1 if [ $? -ne 0 ]; then echo @@ -304,6 +306,4 @@ echo if [ $BUILD_ALL -eq 1 ]; then sh windeploy.sh -demo-version - sh windeploy.sh -x64-build - sh windeploy.sh -x64-build -demo-version fi From 488965652147ee960bd203ab49f435400b34fb94 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 11 May 2019 17:22:08 +0000 Subject: [PATCH 350/425] Fixed a bug that was causing domain constraints not to be extracted correctly during reverse engineering (issue #1272) --- .../src/databaseexplorerwidget.cpp | 5 + libpgmodeler_ui/src/databaseimporthelper.cpp | 2 +- schemas/catalog/domain.sch | 2 +- windeploy.sh | 128 +++++++++--------- 4 files changed, 71 insertions(+), 66 deletions(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index f7bce9324c..25e5df323b 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -496,6 +496,11 @@ void DatabaseExplorerWidget::formatConversionAttribs(attribs_map &attribs) void DatabaseExplorerWidget::formatDomainAttribs(attribs_map &attribs) { + QStringList contrs = Catalog::parseArrayValues(attribs[Attributes::Constraints]); + + contrs.replaceInStrings(Table::DataSeparator, QChar(':')); + attribs[Attributes::Constraints] = contrs.join(Table::DataSeparator); + formatBooleanAttribs(attribs, { Attributes::NotNull }); attribs[Attributes::Type]=getObjectName(ObjectType::Type, attribs[Attributes::Type]); } diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index cfa4ab1229..82f68648f7 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1007,7 +1007,7 @@ void DatabaseImportHelper::createDomain(attribs_map &attribs) { constr.remove(0, 1); constr.remove(constr.length() - 1, 1); - constr_attrs = constr.split(QChar(':')); + constr_attrs = constr.split(Table::DataSeparator); aux_attribs[Attributes::Name] = constr_attrs.at(0); diff --git a/schemas/catalog/domain.sch b/schemas/catalog/domain.sch index 04c8d0e539..469c18c811 100644 --- a/schemas/catalog/domain.sch +++ b/schemas/catalog/domain.sch @@ -45,7 +45,7 @@ dm.typnotnull AS not_null_bool, _dm1.interval_type, _dm1.domain_default AS default_value, - (select array_agg(conname || ':' || consrc) from pg_constraint where contypid = dm.oid) as constraints, + (select array_agg(conname || '•' || consrc) from pg_constraint where contypid = dm.oid) as constraints, ] ({comment}) [ AS comment ] diff --git a/windeploy.sh b/windeploy.sh index 75ba44793d..ce00bb0a7c 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -1,7 +1,5 @@ #!/bin/bash -INNOSETUP_CMD='/c/Program Files (x86)/Inno Setup 5/ISCC.exe' -QT_IFW_ROOT='/c/Qt/QtIFW-3.0.6' LOG=windeploy.log # Detecting current pgModeler version @@ -58,52 +56,37 @@ else PKGNAME="pgmodeler-$DEPLOY_VER-windows$WIN_BITS" fi -if [ $X64_BUILD = 1 ]; then - # Settings for x64 build - QT_INSTALL_VERSION='5.12.0' - QT_BASE_VERSION='5.12.0' - QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/" - QMAKE_ROOT=$QT_ROOT/bin - MINGW_ROOT="/c/msys_64/mingw64/bin" - PGSQL_ROOT="/c/msys_64/mingw64/bin" - QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release \ - XML_INC+=$MINGW_ROOT/../include/libxml2 \ - XML_LIB+=$MINGW_ROOT/libxml2-2.dll \ - PGSQL_INC+=$MINGW_ROOT/../include \ - PGSQL_LIB+=$MINGW_ROOT/libpq.dll" - DEP_LIBS="$MINGW_ROOT/libcrypto-1_1-x64.dll \ - $MINGW_ROOT/libgcc_s_seh-1.dll \ - $MINGW_ROOT/libiconv-2.dll \ - $MINGW_ROOT/libintl-8.dll \ - $MINGW_ROOT/liblzma-5.dll \ - $MINGW_ROOT/libpq.dll \ - $MINGW_ROOT/libssl-1_1-x64.dll \ - $MINGW_ROOT/libstdc++-6.dll \ - $MINGW_ROOT/libwinpthread-1.dll \ - $MINGW_ROOT/libxml2-2.dll \ - $MINGW_ROOT/zlib1.dll" +# Settings for x64 build +if [ $X64_BUILD = 1 ]; then + QT_ROOT="/c/msys_64/mingw64" + MINGW_ROOT="/c/msys_64/mingw64/bin" + DEP_LIBS="$DEP_LIBS \ + $MINGW_ROOT/libssl-1_1-x64.dll \ + $MINGW_ROOT/libcrypto-1_1-x64.dll \ + $MINGW_ROOT/libgcc_s_seh-1.dll" +# Settings for x86 build else - # Default setting for x86 build - QT_INSTALL_VERSION='5.9.3' - QT_BASE_VERSION='5.9.3' - PGSQL_VERSION='10.1' - QT_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/${QT_BASE_VERSION}/mingw53_32/" - QMAKE_ROOT=$QT_ROOT/bin - QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release" - MINGW_ROOT="/c/Qt/Qt${QT_INSTALL_VERSION}/Tools/mingw530_32/bin" - PGSQL_ROOT="/c/PostgreSQL/${PGSQL_VERSION}/bin" - DEP_LIBS="$QMAKE_ROOT/libgcc_s_dw2-1.dll \ - $QMAKE_ROOT/libstdc++-6.dll \ - $QMAKE_ROOT/libwinpthread-1.dll \ - $PGSQL_ROOT/libiconv-2.dll \ - $PGSQL_ROOT/libintl-8.dll \ - $PGSQL_ROOT/zlib1.dll \ - $PGSQL_ROOT/libxml2.dll \ - $PGSQL_ROOT/libpq.dll \ - $PGSQL_ROOT/libeay32.dll \ - $PGSQL_ROOT/ssleay32.dll" + QT_ROOT="/c/msys_64/mingw32" + MINGW_ROOT="/c/msys_64/mingw32/bin" + DEP_LIBS="$DEP_LIBS \ + $MINGW_ROOT/libssl-1_1.dll \ + $MINGW_ROOT/libcrypto-1_1.dll \ + $MINGW_ROOT/libgcc_s_dw2-1.dll" fi +# Common settings for both architectures +QT_INSTALL_VERSION='5.12.3' +QT_BASE_VERSION='5.12.3' +QT_PLUGINS_ROOT="$QT_ROOT/share/qt5/plugins" +QMAKE_ROOT=$MINGW_ROOT +QT_IFW_ROOT=$MINGW_ROOT +PGSQL_ROOT=$MINGW_ROOT +QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release \ + XML_INC+=$MINGW_ROOT/../include/libxml2 \ + XML_LIB+=$MINGW_ROOT/libxml2-2.dll \ + PGSQL_INC+=$MINGW_ROOT/../include \ + PGSQL_LIB+=$MINGW_ROOT/libpq.dll" + if [ $DEMO_VERSION = 1 ]; then QMAKE_ARGS="$QMAKE_ARGS DEMO_VERSION+=true" fi @@ -112,18 +95,37 @@ PKGFILE=$PKGNAME.exe GENINSTALLER=pgmodeler.exe INSTALL_ROOT="$PWD/build" DIST_ROOT="$PWD/dist" -ISSFILE=./installer/windows/pgmodeler.iss QT_CONF="$INSTALL_ROOT/qt.conf" DEP_PLUGINS_DIR="$INSTALL_ROOT/qtplugins" PLUGINS="dummy xml2object" # Common dependency libraries -DEP_LIBS+=" $QMAKE_ROOT/Qt5Core.dll \ - $QMAKE_ROOT/Qt5Gui.dll \ - $QMAKE_ROOT/Qt5Widgets.dll \ - $QMAKE_ROOT/Qt5PrintSupport.dll \ - $QMAKE_ROOT/Qt5Network.dll \ - $QMAKE_ROOT/Qt5Svg.dll " +DEP_LIBS="$DEP_LIBS \ + $MINGW_ROOT/libicuin*.dll \ + $MINGW_ROOT/libicuuc*.dll \ + $MINGW_ROOT/libicudt*.dll \ + $MINGW_ROOT/libpcre2-16-0.dll \ + $MINGW_ROOT/libharfbuzz-0.dll \ + $MINGW_ROOT/libpng16-16.dll \ + $MINGW_ROOT/libfreetype-6.dll \ + $MINGW_ROOT/libgraphite2.dll \ + $MINGW_ROOT/libglib-2.0-0.dll \ + $MINGW_ROOT/libpcre-1.dll \ + $MINGW_ROOT/libbz2-1.dll \ + $MINGW_ROOT/libstdc++-6.dll \ + $MINGW_ROOT/libwinpthread-1.dll \ + $MINGW_ROOT/zlib1.dll \ + $MINGW_ROOT/libpq.dll \ + $MINGW_ROOT/libxml2-2.dll \ + $MINGW_ROOT/liblzma-5.dll \ + $MINGW_ROOT/libiconv-2.dll \ + $MINGW_ROOT/libintl-8.dll \ + $QMAKE_ROOT/Qt5Core.dll \ + $QMAKE_ROOT/Qt5Gui.dll \ + $QMAKE_ROOT/Qt5Widgets.dll \ + $QMAKE_ROOT/Qt5PrintSupport.dll \ + $QMAKE_ROOT/Qt5Network.dll \ + $QMAKE_ROOT/Qt5Svg.dll " #Dependency qt plugins copied to build dir DEP_PLUGINS="imageformats/qicns.dll \ @@ -197,7 +199,7 @@ if [ $? -ne 0 ]; then fi echo "Compiling code..." -$MINGW_ROOT/mingw32-make.exe -j7 >> $LOG 2>&1 +$MINGW_ROOT/mingw32-make.exe -j10 >> $LOG 2>&1 if [ $? -ne 0 ]; then echo @@ -238,7 +240,7 @@ echo "Libraries=." >> $QT_CONF for plug in $DEP_PLUGINS; do pdir=`dirname $plug` mkdir -p $DEP_PLUGINS_DIR/$pdir >> $LOG 2>&1 - cp $QT_ROOT/plugins/$plug $DEP_PLUGINS_DIR/$pdir >> $LOG 2>&1 + cp $QT_PLUGINS_ROOT/$plug $DEP_PLUGINS_DIR/$pdir >> $LOG 2>&1 if [ $? -ne 0 ]; then echo @@ -248,14 +250,14 @@ for plug in $DEP_PLUGINS; do fi done -$MINGW_ROOT/mingw32-make.exe install >> $LOG 2>&1 +#$MINGW_ROOT/mingw32-make.exe install >> $LOG 2>&1 -if [ $? -ne 0 ]; then - echo - echo "** Installation failed!" - echo - exit 1 -fi +#if [ $? -ne 0 ]; then +# echo +# echo "** Installation failed!" +# echo +# exit 1 +#fi echo "Packaging installation..." @@ -288,7 +290,7 @@ if [ $? -ne 0 ]; then exit 1 fi -$QT_IFW_ROOT/bin/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_ROOT/$PKGNAME.exe" >> $LOG 2>&1 +$QT_IFW_ROOT/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_ROOT/$PKGNAME.exe" >> $LOG 2>&1 if [ $? -ne 0 ]; then echo @@ -304,6 +306,4 @@ echo if [ $BUILD_ALL -eq 1 ]; then sh windeploy.sh -demo-version - sh windeploy.sh -x64-build - sh windeploy.sh -x64-build -demo-version fi From dbf449df65218f1fb93c5fd2bc78119c445f0c4a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 13 May 2019 10:39:56 -0300 Subject: [PATCH 351/425] Minor update on CHANGELOG.md and RELEASENOTES.md for 0.9.2-beta --- CHANGELOG.md | 3 ++- RELEASENOTES.md | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a748d7826..0085dbac3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Change Log v0.9.2-beta ------ -Release date: May 13, 2019
+Release date: May 15, 2019
* [New] Added support to foreign server. * [New] Added support to foreign data wrapper. @@ -48,6 +48,7 @@ v0.9.2-beta * [Change] Fixed the windows deploy script to use newer version of the compiler in 64 bits environment. * [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. * [Change] Adjusted the resize parameters in DataManipulationForm to avoid wrong dialog resizings mainly on Windows. +* [Fix] Fixed a bug that was causing domain constraints not to be extracted correctly during reverse engineering. * [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. * [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. * [Fix] Fixed a bug that was causing tables not to be moved on the canvas using mouse. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index e7a65f8cda..6058ed93cb 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,7 +1,7 @@ v0.9.2-beta ------ -Release date: May 14, 2019
+Release date: May 15, 2019
Changes since: v0.9.2-alpha1
Summary: a brand new version has come to you after a work of almost five months on it. This one brings important features requested long ago and several patches to improve the tool's usability.
@@ -42,6 +42,7 @@ Lastly, some of the key change log entries of this release are listed below. For * [Change] Allowing copied object to be pasted multiple times. This feature works only with copy/paste operation without remove the pasted objects from the clipboard, for cut/paste the behaviour is unchanged. * [Change] Increased the maximum limit of SQL history. * [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. +* [Fix] Fixed a bug that was causing domain constraints not to be extracted correctly during reverse engineering. * [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. * [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. * [Fix] Fixed a bug that was causing tables not to be moved on the canvas using mouse. From c33943f1dfdc70b7c4f8d6d7ee1e39b897764c9f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 14 May 2019 14:33:50 -0300 Subject: [PATCH 352/425] Fixed the objects aligning to grid making it more precise (issue #1273) Removing the forced usage of float values to avoid compiler warnings Replaced the usage of float variables/attributes by double --- libobjrenderer/src/attributestoggleritem.cpp | 2 +- libobjrenderer/src/baseobjectview.cpp | 17 +++-- libobjrenderer/src/baseobjectview.h | 8 +-- libobjrenderer/src/basetableview.cpp | 8 +-- libobjrenderer/src/basetableview.h | 6 +- libobjrenderer/src/objectsscene.cpp | 52 +++++++++------ libobjrenderer/src/objectsscene.h | 11 ++-- libobjrenderer/src/relationshipview.cpp | 66 +++++++++---------- libobjrenderer/src/relationshipview.h | 4 +- libobjrenderer/src/schemaview.cpp | 2 +- libobjrenderer/src/styledtextboxview.cpp | 4 +- libobjrenderer/src/tableobjectview.cpp | 16 ++--- libobjrenderer/src/tabletitleview.cpp | 4 +- libobjrenderer/src/tableview.cpp | 4 +- libobjrenderer/src/textboxview.cpp | 12 ++-- libpgmodeler/src/databasemodel.cpp | 32 ++++----- libpgmodeler/src/textbox.cpp | 2 +- libpgmodeler_ui/src/aboutwidget.cpp | 2 +- libpgmodeler_ui/src/baseform.cpp | 10 +-- libpgmodeler_ui/src/databaseimportform.cpp | 6 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 18 ++--- libpgmodeler_ui/src/generalconfigwidget.cpp | 13 ++-- libpgmodeler_ui/src/mainwindow.cpp | 2 +- libpgmodeler_ui/src/messagebox.cpp | 2 +- libpgmodeler_ui/src/modelexportform.cpp | 2 +- libpgmodeler_ui/src/modelexporthelper.cpp | 14 ++-- libpgmodeler_ui/src/modelfixform.cpp | 2 +- libpgmodeler_ui/src/modeloverviewwidget.cpp | 4 +- libpgmodeler_ui/src/modeloverviewwidget.h | 2 +- libpgmodeler_ui/src/modelsdiffhelper.cpp | 6 +- libpgmodeler_ui/src/modelvalidationhelper.cpp | 8 +-- libpgmodeler_ui/src/modelwidget.cpp | 41 ++++++------ libpgmodeler_ui/src/modelwidget.h | 2 +- libpgmodeler_ui/src/numberedtexteditor.cpp | 2 +- libpgmodeler_ui/src/pgmodeleruins.cpp | 20 +++--- libpgmodeler_ui/src/pgmodeleruins.h | 2 +- libpgmodeler_ui/src/sceneinfowidget.cpp | 10 +-- libpgmodeler_ui/src/syntaxhighlighter.cpp | 2 +- libpgmodeler_ui/src/welcomewidget.cpp | 4 +- 39 files changed, 221 insertions(+), 203 deletions(-) diff --git a/libobjrenderer/src/attributestoggleritem.cpp b/libobjrenderer/src/attributestoggleritem.cpp index f571e5ce4d..3959cb3592 100644 --- a/libobjrenderer/src/attributestoggleritem.cpp +++ b/libobjrenderer/src/attributestoggleritem.cpp @@ -344,7 +344,7 @@ void AttributesTogglerItem::createButtonPolygons(void) return; QPolygonF *pol = nullptr; - double fnt_factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, + double fnt_factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0, pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(), factor = fnt_factor * pixel_ratio; diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 7edf71007a..3179934e5d 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -19,6 +19,7 @@ #include "baseobjectview.h" #include "textboxview.h" #include "roundedrectitem.h" +#include "objectsscene.h" map BaseObjectView::font_config; map> BaseObjectView::color_config; @@ -388,6 +389,9 @@ QVariant BaseObjectView::itemChange(GraphicsItemChange change, const QVariant &v if(graph_obj && !graph_obj->isProtected()) { + if(ObjectsScene::isAlignObjectsToGrid()) + this->setPos(ObjectsScene::alignPointToGrid(this->scenePos())); + graph_obj->setPosition(this->scenePos()); this->configurePositionInfo(this->pos()); } @@ -456,8 +460,9 @@ void BaseObjectView::configurePositionInfo(QPointF pos) pos_info_item->setFont(fnt); pos_info_item->setTextBrush(font_config[Attributes::PositionInfo].foreground()); - pos_info_item->setText(QString(" x:%1 y:%2 ").arg(roundf(pos.x())).arg(roundf(pos.y()))); + pos_info_item->setText(QString(" x:%1 y:%2 ").arg(round(pos.x())).arg(round(pos.y()))); pos_info_item->setPolygon(QPolygonF(pos_info_item->getTextBoundingRect())); + pos_info_item->setPos(-0.5, -pos_info_item->boundingRect().height()/2); } } @@ -512,7 +517,7 @@ void BaseObjectView::configureProtectedIcon(void) pol.append(QPointF(6,2)); pol.append(QPointF(5,2)); pol.append(QPointF(4,3)); pol.append(QPointF(4,5)); - if(factor!=1.0f) + if(factor!=1.0) TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor, pol.boundingRect().height() * factor); @@ -527,7 +532,7 @@ void BaseObjectView::configureProtectedIcon(void) pol.append(QPointF(10,10)); pol.append(QPointF(1,10)); pol.append(QPointF(0,9)); pol.append(QPointF(0,6)); - if(factor!=1.0f) + if(factor!=1.0) TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor, pol.boundingRect().height() * factor); @@ -572,8 +577,8 @@ unsigned BaseObjectView::getSelectionOrder(void) QPointF BaseObjectView::getCenter(void) { - return(QPointF(this->pos().x() + this->boundingRect().width()/2.0f, - this->pos().y() + this->boundingRect().height()/2.0f)); + return(QPointF(this->pos().x() + this->boundingRect().width()/2.0, + this->pos().y() + this->boundingRect().height()/2.0)); } void BaseObjectView::togglePlaceholder(bool visible) @@ -624,7 +629,7 @@ unsigned BaseObjectView::getLayer(void) double BaseObjectView::getScreenDpiFactor(void) { QScreen *screen = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow())); - double factor = screen->logicalDotsPerInch() / 96.0f; + double factor = screen->logicalDotsPerInch() / 96.0; double pixel_ratio = screen->devicePixelRatio(); if(factor < 1) diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index e9054ec9c5..27993f7020 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -117,10 +117,10 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { void setLayer(unsigned layer); public: - static constexpr double VertSpacing=2.0f, - HorizSpacing=2.0f, - DefaultFontSize=9.0f, - ObjectBorderWidth=0.85f; + static constexpr double VertSpacing=2.0, + HorizSpacing=2.0, + DefaultFontSize=9.0, + ObjectBorderWidth=0.85; static constexpr int ObjectAlphaChannel=128; diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 1e82de29f6..bcee0aa67c 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -329,7 +329,7 @@ void BaseTableView::configureTag(void) double bottom; QFont fnt=BaseObjectView::getFontStyle(Attributes::Tag).font(); - fnt.setPointSizeF(fnt.pointSizeF() * 0.80f); + fnt.setPointSizeF(fnt.pointSizeF() * 0.80); tag_item->setFont(fnt); tag_item->setText(tag->getName()); tag_item->setBrush(BaseObjectView::getFontStyle(Attributes::Tag).foreground()); @@ -348,16 +348,16 @@ void BaseTableView::configureTag(void) tag_item->setPolygon(pol); tag_item->setPen(BaseObjectView::getBorderStyle(Attributes::Tag)); tag_item->setBrush(BaseObjectView::getFillStyle(Attributes::Tag)); - tag_item->setPos(-5, bottom - 1.5f); + tag_item->setPos(-5, bottom - 1.5); tag_item->setTextPos(HorizSpacing/2, 0); } } -void BaseTableView::__configureObject(float width) +void BaseTableView::__configureObject(double width) { BaseTable *tab = dynamic_cast(getSourceObject()); double height = 0, - factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0f, + factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0, pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(); QPen pen = body->pen(); diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 2a663b8628..b90b7d8f08 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -66,9 +66,7 @@ class BaseTableView: public BaseObjectView { RoundedRectItem *body, //! \brief Extended table attributes (indexes, rules, triggers) section body - *ext_attribs_body, - - *placeholder; + *ext_attribs_body; AttributesTogglerItem *attribs_toggler; @@ -98,7 +96,7 @@ class BaseTableView: public BaseObjectView { /*! \brief Configures basic attributes of the table. A width need to be provided so the extended attributes section can follow the same width as the body and title */ - void __configureObject(float width); + void __configureObject(double width); //! \brief Determines the table width based upon its subsection (title, body and extended attribs) double calculateWidth(void); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index d34f14cdca..53831881f6 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -358,13 +358,13 @@ bool ObjectsScene::isCornerMoveEnabled(void) QPointF ObjectsScene::alignPointToGrid(const QPointF &pnt) { - QPointF p(roundf(pnt.x()/grid_size) * grid_size, - roundf(pnt.y()/grid_size) * grid_size); + int px = static_cast(round(pnt.x()/static_cast(grid_size))) * grid_size, + py = static_cast(round(pnt.y()/static_cast(grid_size))) * grid_size; - if(p.x() < 0) p.setX(0); - if(p.y() < 0) p.setY(0); + if(px < 0) px = 0; + if(py < 0) py = 0; - return(p); + return(QPointF(px, py)); } void ObjectsScene::setSceneRect(const QRectF &rect) @@ -477,7 +477,7 @@ void ObjectsScene::setGridSize(unsigned size) { pen.setColor(QColor(75,115,195)); pen.setStyle(Qt::DashLine); - pen.setWidthF(1.0f); + pen.setWidthF(1.0); painter.setPen(pen); painter.drawLine(width-1, 0,width-1,img_h-1); painter.drawLine(0, height-1,img_w-1,height-1); @@ -546,11 +546,19 @@ void ObjectsScene::setGridOptions(bool show_grd, bool align_objs_grd, bool show_ } } -void ObjectsScene::getGridOptions(bool &show_grd, bool &align_objs_grd, bool &show_pag_dlm) +bool ObjectsScene::isAlignObjectsToGrid(void) { - show_grd=ObjectsScene::show_grid; - align_objs_grd=ObjectsScene::align_objs_grid; - show_pag_dlm=ObjectsScene::show_page_delim; + return(align_objs_grid); +} + +bool ObjectsScene::isShowGrid(void) +{ + return(show_grid); +} + +bool ObjectsScene::isShowPageDelimiters(void) +{ + return(show_page_delim); } void ObjectsScene::setPaperConfiguration(QPrinter::PaperSize paper_sz, QPrinter::Orientation orient, QRectF margins, QSizeF custom_size) @@ -912,7 +920,7 @@ void ObjectsScene::keyPressEvent(QKeyEvent *event) event->key() == Qt::Key_Left || event->key() == Qt::Key_Right) && !selectedItems().isEmpty()) { - float dx = 0, dy = 0; + double dx = 0, dy = 0; BaseObjectView *obj_view=nullptr; QRectF brect = itemsBoundingRect(true, true); @@ -1006,8 +1014,10 @@ void ObjectsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) if(!rel_line->isVisible()) { + int sel_items_count = this->selectedItems().size(); + //Case the user starts a object moviment - if(!this->selectedItems().isEmpty() && !moving_objs /*&& event->modifiers()==Qt::NoModifier*/) + if(sel_items_count != 0 && !moving_objs) { if(BaseObjectView::isPlaceholderEnabled()) { @@ -1026,7 +1036,7 @@ void ObjectsScene::mouseMoveEvent(QGraphicsSceneMouseEvent *event) } //If the alignment to grid is active, adjust the event scene position - if(align_objs_grid && !selection_rect->isVisible()) + if(align_objs_grid && !selection_rect->isVisible() && sel_items_count <= 1) event->setScenePos(this->alignPointToGrid(event->scenePos())); else if(selection_rect->isVisible()) { @@ -1214,8 +1224,8 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) { rect=this->itemsBoundingRect(); rect.setTopLeft(QPointF(0,0)); - rect.setWidth(rect.width() * 1.05f); - rect.setHeight(rect.height() * 1.05f); + rect.setWidth(rect.width() * 1.05); + rect.setHeight(rect.height() * 1.05); this->setSceneRect(rect); } @@ -1316,12 +1326,12 @@ vector ObjectsScene::getPagesForPrinting(const QSizeF &paper_size, const unsigned h_page=0, v_page=0, start_h=99999, start_v=99999; QList list; - page_width=ceilf(paper_size.width() - margin.width()-1); - page_height=ceilf(paper_size.height() - margin.height()-1); + page_width=ceil(paper_size.width() - margin.width()-1); + page_height=ceil(paper_size.height() - margin.height()-1); //Calculates the horizontal and vertical page count based upon the passed paper size - h_page_cnt=roundf(this->sceneRect().width()/page_width) + 1; - v_page_cnt=roundf(this->sceneRect().height()/page_height) + 1; + h_page_cnt=round(this->sceneRect().width()/page_width) + 1; + v_page_cnt=round(this->sceneRect().height()/page_height) + 1; //Calculates the maximum count of horizontal and vertical pages for(v_page=0; v_page < v_page_cnt; v_page++) @@ -1351,8 +1361,8 @@ vector ObjectsScene::getPagesForPrinting(const QSizeF &paper_size, const } //Re calculates the maximum page count based upon the maximum page size - h_page_cnt=roundf(max_rect.width()/page_width); - v_page_cnt=roundf(max_rect.height()/page_height); + h_page_cnt=round(max_rect.width()/page_width); + v_page_cnt=round(max_rect.height()/page_height); //Inserts the page rectangles on the list for(v_page=static_cast(start_v); v_page < v_page_cnt; v_page++) diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 6e938a95f9..b8cb328a26 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -108,9 +108,6 @@ class ObjectsScene: public QGraphicsScene { //! \brief Line used as a guide when inserting new relationship QGraphicsLineItem *rel_line; - //! \brief Aligns the specified point in relation to the grid - static QPointF alignPointToGrid(const QPointF &pnt); - /*! \brief Indicates if the mouse cursor is under a move spot portion of scene. Additionally this method configures the direction of movement when returning true */ bool mouseIsAtCorner(void); @@ -202,7 +199,10 @@ class ObjectsScene: public QGraphicsScene { static void setGridSize(unsigned size); static void setGridOptions(bool show_grd, bool align_objs_grd, bool show_page_dlm); - static void getGridOptions(bool &show_grd, bool &align_objs_grd, bool &show_pag_dlm); + + static bool isAlignObjectsToGrid(void); + static bool isShowGrid(void); + static bool isShowPageDelimiters(void); static void setPaperConfiguration(QPrinter::PaperSize paper_sz, QPrinter::Orientation orient, QRectF margins, QSizeF custom_size=QSizeF(0,0)); static void getPaperConfiguration(QPrinter::PaperSize &paper_sz, QPrinter::Orientation &orient, QRectF &margins, QSizeF &custom_size); @@ -214,6 +214,9 @@ class ObjectsScene: public QGraphicsScene { void removeItem(QGraphicsItem *item); void setSceneRect(const QRectF &rect); + //! \brief Aligns the specified point in relation to the grid + static QPointF alignPointToGrid(const QPointF &pnt); + /*! \brief Returns the items bounding rect. By default the method returns the same as QGraphicsScene::itemsBoundingRect. If the parameter seek_only_db_objs is true the returned rect will have the origin point calculated based upon the visible objects that inherits BaseObjectView and are database model objects (tables, views, textboxes, schemas and relationships). diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index d8252f7301..5ebaf9c73d 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -255,10 +255,10 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant QColor cor1=BaseObjectView::getBorderStyle(Attributes::ObjSelection).color(), cor2=line_color; - color.setRedF((cor1.redF() + cor2.greenF())/2.0f); - color.setGreenF((cor1.greenF() + cor2.greenF())/2.0f); - color.setBlueF((cor1.blueF() + cor2.blueF())/2.0f); - color.setAlphaF((cor1.alphaF() + cor2.alphaF())/2.0f); + color.setRedF((cor1.redF() + cor2.greenF())/2.0); + color.setGreenF((cor1.greenF() + cor2.greenF())/2.0); + color.setBlueF((cor1.blueF() + cor2.blueF())/2.0); + color.setAlphaF((cor1.alphaF() + cor2.alphaF())/2.0); } else color=line_color; @@ -309,9 +309,9 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant for(auto &stop : grad_stops) { color = stop.second; - color.setRedF((color.redF() + sel_color.greenF())/2.0f); - color.setGreenF((color.greenF() + sel_color.greenF())/2.0f); - color.setBlueF((color.blueF() + sel_color.blueF())/2.0f); + color.setRedF((color.redF() + sel_color.greenF())/2.0); + color.setGreenF((color.greenF() + sel_color.greenF())/2.0); + color.setBlueF((color.blueF() + sel_color.blueF())/2.0); grad.setColorAt(color_id++, color); } @@ -626,12 +626,12 @@ void RelationshipView::configureLine(void) double min_val = min(rect.width(), rect.height()); if(idx < 0) idx =0; - pos_factor = min_val * 0.08f * idx; + pos_factor = min_val * 0.08 * idx; } p_central[0].setX(pos.x() + rect.width()); - p_central[0].setY(pos.y() + (rect.height() / 3.0f) + pos_factor); - p_central[1].setX(pos.x() + (rect.width() / 1.5f) - pos_factor); + p_central[0].setY(pos.y() + (rect.height() / 3.0) + pos_factor); + p_central[1].setX(pos.x() + (rect.width() / 1.5) - pos_factor); p_central[1].setY(pos.y()); if(p_central[0].y() > pos.y() + rect.height()) @@ -858,7 +858,7 @@ void RelationshipView::configureLine(void) { conn_rels_cnt[tab_idx] = tables[tab_idx]->getConnectedRelsCount(base_rel->getTable(BaseRelationship::SrcTable), base_rel->getTable(BaseRelationship::DstTable)); - conn_rels_factors[tab_idx] = conn_rels_cnt[tab_idx] == 1 ? 1 : 0.08f * (tables[tab_idx]->getConnectedRelationshipIndex(base_rel)); + conn_rels_factors[tab_idx] = conn_rels_cnt[tab_idx] == 1 ? 1 : 0.08 * (tables[tab_idx]->getConnectedRelationshipIndex(base_rel)); if(!points.empty()) { @@ -1026,8 +1026,8 @@ void RelationshipView::configureLine(void) p_central[1]=points[idx_lin_desc-1]; //Calculates the middle point and inserts it on the point vector - p_int.setX((p_central[0].x() + p_central[1].x())/2.0f); - p_int.setY((p_central[0].y() + p_central[1].y())/2.0f); + p_int.setX((p_central[0].x() + p_central[1].x())/2.0); + p_int.setY((p_central[0].y() + p_central[1].y())/2.0); points.insert(points.begin() + idx_lin_desc, p_int); } @@ -1059,9 +1059,9 @@ void RelationshipView::configureLine(void) //If the relationship is identifier or bidirectional, the line has its thickness modified if(rel && (rel->isIdentifier() && vet_idx==0)) - pen.setWidthF(ObjectBorderWidth * 1.90f); + pen.setWidthF(ObjectBorderWidth * 1.90); else - pen.setWidthF(ObjectBorderWidth * 1.45f); + pen.setWidthF(ObjectBorderWidth * 1.45); lin->setLine(QLineF(ref_pnt->at(i), ref_points[vet_idx])); lin->setPen(pen); @@ -1096,9 +1096,9 @@ void RelationshipView::configureLine(void) //If the relationship is identifier or bidirectional, the line has its thickness modified if(rel && (rel->isIdentifier() && i >= idx_lin_desc)) - pen.setWidthF(ObjectBorderWidth * 1.90f); + pen.setWidthF(ObjectBorderWidth * 1.90); else - pen.setWidthF(ObjectBorderWidth * 1.45f); + pen.setWidthF(ObjectBorderWidth * 1.45); lin->setLine(QLineF(points[i], points[i+1])); lin->setPen(pen); @@ -1328,7 +1328,7 @@ void RelationshipView::configureDescriptor(void) } //Resizes the polygon according the font factor - if(factor!=1.0f) + if(factor!=1.0) TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor , pol.boundingRect().height() * factor); @@ -1380,8 +1380,8 @@ void RelationshipView::configureDescriptor(void) pnt=lin.p1(); else { - pnt.setX((lin.p1().x() + lin.p2().x()) / 2.0f); - pnt.setY((lin.p1().y() + lin.p2().y()) / 2.0f); + pnt.setX((lin.p1().x() + lin.p2().x()) / 2.0); + pnt.setY((lin.p1().y() + lin.p2().y()) / 2.0); } angle = -lin.angle(); @@ -1392,11 +1392,11 @@ void RelationshipView::configureDescriptor(void) obj_shadow->setRotation(angle); } - x=x1=pnt.x() - (pol.boundingRect().width()/2.0f); - y=y1=pnt.y() - (pol.boundingRect().height()/2.0f); + x=x1=pnt.x() - (pol.boundingRect().width()/2.0); + y=y1=pnt.y() - (pol.boundingRect().height()/2.0); - protected_icon->setPos(x + ((pol.boundingRect().width()/2.0f) * 0.60f), - y + ((pol.boundingRect().height()/2.0f) * 0.55f)); + protected_icon->setPos(x + ((pol.boundingRect().width()/2.0) * 0.60), + y + ((pol.boundingRect().height()/2.0) * 0.55)); configureSQLDisabledInfo(); x1+=6 * HorizSpacing; @@ -1417,7 +1417,7 @@ void RelationshipView::configureDescriptor(void) pol_item=dynamic_cast(obj_shadow); pol_item->setPolygon(pol); pol_item->setTransformOriginPoint(obj_shadow->boundingRect().center()); - pol_item->setPos(x + 2.5f, y + 3.5f); + pol_item->setPos(x + 2.5, y + 3.5); pol_item->setPen(Qt::NoPen); pol_item->setBrush(QColor(50,50,50,60)); @@ -1715,7 +1715,7 @@ void RelationshipView::configureAttributes(void) fmt=font_config[Attributes::Attribute]; font=fmt.font(); - font.setPointSizeF(font.pointSizeF() * 0.80f); + font.setPointSizeF(font.pointSizeF() * 0.80); //Configures the rectangle used as base for creation of attribute descriptor rect.setTopLeft(QPointF(0,0)); @@ -1724,7 +1724,7 @@ void RelationshipView::configureAttributes(void) //Calculates the first attribute position based upon the attribute count and descriptor size count=rel->getAttributeCount(); px=descriptor->pos().x() + descriptor->boundingRect().width() + ((3 * HorizSpacing) * factor); - py=descriptor->pos().y() - (count * rect.height()/(4.0f * factor)); + py=descriptor->pos().y() - (count * rect.height()/(4.0 * factor)); for(i=0; i < count; i++) { @@ -1789,8 +1789,8 @@ void RelationshipView::configureAttributes(void) pol.append(text->boundingRect().bottomLeft()); sel_attrib->setPolygon(pol); - p_aux=this->mapToItem(attrib, descriptor->pos().x() + (descriptor->boundingRect().width()/2.0f), - descriptor->pos().y() + (descriptor->boundingRect().height()/2.0f)); + p_aux=this->mapToItem(attrib, descriptor->pos().x() + (descriptor->boundingRect().width()/2.0), + descriptor->pos().y() + (descriptor->boundingRect().height()/2.0)); lin->setLine(QLineF(p_aux, desc->boundingRect().center())); py+=desc->boundingRect().height() + (2 * VertSpacing); @@ -1821,7 +1821,7 @@ void RelationshipView::configureLabels(void) pnt=descriptor->pos(); x=pnt.x() - ((labels[BaseRelationship::RelNameLabel]->boundingRect().width() - - descriptor->boundingRect().width())/2.0f); + descriptor->boundingRect().width())/2.0); if(base_rel->isSelfRelationship()) y=pnt.y() - labels[BaseRelationship::RelNameLabel]->boundingRect().height() - (2 * VertSpacing); @@ -1873,7 +1873,7 @@ void RelationshipView::configureLabels(void) for(idx=0; idx < 2; idx++) { pos=conn_points[idx]; - da=labels[idx]->boundingRect().height()/2.0f; + da=labels[idx]->boundingRect().height()/2.0; if((rel_type!=BaseRelationship::RelationshipFk && pos.x() < tables[idx]->pos().x()) || (rel_type==BaseRelationship::RelationshipFk && pos.x() >= tables[idx]->pos().x())) @@ -1938,8 +1938,8 @@ void RelationshipView::configureLabels(void) pf=lins[idx].p1(); } - dl=labels[label_ids[idx]]->boundingRect().width()/2.0f; - da=labels[label_ids[idx]]->boundingRect().height()/2.0f; + dl=labels[label_ids[idx]]->boundingRect().width()/2.0; + da=labels[label_ids[idx]]->boundingRect().height()/2.0; x=pi.x() - dl; y=pi.y() - da; diff --git a/libobjrenderer/src/relationshipview.h b/libobjrenderer/src/relationshipview.h index e32f3bd13e..6a9f26481d 100644 --- a/libobjrenderer/src/relationshipview.h +++ b/libobjrenderer/src/relationshipview.h @@ -35,10 +35,10 @@ class RelationshipView: public BaseObjectView { Q_OBJECT //! \brief Graphical point radius - static constexpr double GraphicPointRadius=6.0f; + static constexpr double GraphicPointRadius=6.0; //! \brief Length of the lines linked to fk/pk columns - static constexpr double ConnLineLength=20.0f; + static constexpr double ConnLineLength=20.0; //! \brief Indicates that the relationship labels must be hidden static bool hide_name_label; diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index fce098dd44..a3fe2e223d 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -204,7 +204,7 @@ void SchemaView::configureObject(void) font=BaseObjectView::getFontStyle(Attributes::Global).font(); font.setItalic(true); font.setBold(true); - font.setPointSizeF(font.pointSizeF() * 1.3f); + font.setPointSizeF(font.pointSizeF() * 1.3); sch_name->setFont(font); sch_name->setPos(HorizSpacing, VertSpacing); diff --git a/libobjrenderer/src/styledtextboxview.cpp b/libobjrenderer/src/styledtextboxview.cpp index 0d58ef1a27..fcb3cfce69 100644 --- a/libobjrenderer/src/styledtextboxview.cpp +++ b/libobjrenderer/src/styledtextboxview.cpp @@ -41,8 +41,8 @@ void StyledTextboxView::configureObject(void) pnt=pol.at(2); pol.remove(2); - pol.insert(2, QPointF(pnt.x(), roundf(pnt.y() - fold->boundingRect().height()))); - pol.insert(3, QPointF(roundf(pnt.x() - fold->boundingRect().width()), pnt.y())); + pol.insert(2, QPointF(pnt.x(), round(pnt.y() - fold->boundingRect().height()))); + pol.insert(3, QPointF(round(pnt.x() - fold->boundingRect().width()), pnt.y())); text_item->setPolygon(pol); rect = text_item->boundingRect(); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index c200098db2..e1e7e14eb0 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -93,7 +93,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) { QGraphicsEllipseItem *desc=dynamic_cast(descriptor); - desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0f * factor, 9.0f * factor))); + desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0 * factor, 9.0 * factor))); if(column->isNotNull()) attrib=Attributes::NnColumn; @@ -103,7 +103,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setBrush(this->getFillStyle(attrib)); pen = this->getBorderStyle(attrib); - pen.setWidthF(ObjectBorderWidth * 1.15f); + pen.setWidthF(ObjectBorderWidth * 1.15); desc->setPen(pen); } else @@ -135,7 +135,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) pol.append(QPointF(9,4)); pol.append(QPointF(5,0)); } - if(factor!=1.0f) + if(factor!=1.0) TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor, pol.boundingRect().height() * factor); @@ -143,7 +143,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) desc->setBrush(this->getFillStyle(attrib)); pen = this->getBorderStyle(attrib); - pen.setWidthF(ObjectBorderWidth * 1.15f); + pen.setWidthF(ObjectBorderWidth * 1.15); desc->setPen(pen); } } @@ -156,25 +156,25 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) pol.append(QPointF(5,0)); pol.append(QPointF(0,5)); pol.append(QPointF(4,9)); pol.append(QPointF(9,9)); pol.append(QPointF(9,4)); - if(factor!=1.0f) + if(factor!=1.0) TextPolygonItem::resizePolygon(pol, pol.boundingRect().width() * factor , pol.boundingRect().height() * factor); desc->setPolygon(pol); desc->setBrush(this->getFillStyle(tab_obj->getSchemaName())); pen = this->getBorderStyle(tab_obj->getSchemaName()); - pen.setWidthF(ObjectBorderWidth * 1.15f); + pen.setWidthF(ObjectBorderWidth * 1.15); desc->setPen(pen); } else { QGraphicsEllipseItem *desc=dynamic_cast(descriptor); - desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0f * factor, 9.0f * factor))); + desc->setRect(QRectF(QPointF(0,0), QSizeF(9.0 * factor, 9.0 * factor))); desc->setBrush(this->getFillStyle(Attributes::Reference)); pen = this->getBorderStyle(Attributes::Reference); - pen.setWidthF(ObjectBorderWidth * 1.15f); + pen.setWidthF(ObjectBorderWidth * 1.15); desc->setPen(pen); } } diff --git a/libobjrenderer/src/tabletitleview.cpp b/libobjrenderer/src/tabletitleview.cpp index 2a886e41d5..533eef5cad 100644 --- a/libobjrenderer/src/tabletitleview.cpp +++ b/libobjrenderer/src/tabletitleview.cpp @@ -134,10 +134,10 @@ void TableTitleView::resizeTitle(double width, double height) box->setRect(QRectF(0,0, width, height)); if(schema_name->text()==QString(" ")) - obj_name->setPos((box->boundingRect().width() - obj_name->boundingRect().width())/2.0f, py); + obj_name->setPos((box->boundingRect().width() - obj_name->boundingRect().width())/2.0, py); else { - schema_name->setPos((box->boundingRect().width() - (schema_name->boundingRect().width() + obj_name->boundingRect().width()))/2.0f, py); + schema_name->setPos((box->boundingRect().width() - (schema_name->boundingRect().width() + obj_name->boundingRect().width()))/2.0, py); obj_name->setPos(schema_name->pos().x() + schema_name->boundingRect().width(), py); } diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index e0e953872f..c48e665461 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -225,8 +225,8 @@ void TableView::configureObject(void) tab_obj=dynamic_cast(col_item->getSourceObject()); cy=title->boundingRect().height() + col_item->pos().y() + (col_item->boundingRect().height()/2); conn_points[tab_obj].resize(2); - conn_points[tab_obj][LeftConnPoint]=QPointF(col_item->pos().x() - 1.5f, cy); - conn_points[tab_obj][RightConnPoint]=QPointF(col_item->pos().x() + width - 1.5f , cy); + conn_points[tab_obj][LeftConnPoint]=QPointF(col_item->pos().x() - 1.5, cy); + conn_points[tab_obj][RightConnPoint]=QPointF(col_item->pos().x() + width - 1.5 , cy); } } } diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 60273e7206..3099b48c36 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -77,10 +77,10 @@ void TextboxView::__configureObject(void) QTextCharFormat fmt=font_config[Attributes::Global]; QPolygonF polygon; - polygon.append(QPointF(0.0f,0.0f)); - polygon.append(QPointF(1.0f,0.0f)); - polygon.append(QPointF(1.0f,1.0f)); - polygon.append(QPointF(0.0f,1.0f)); + polygon.append(QPointF(0.0,0.0)); + polygon.append(QPointF(1.0,0.0)); + polygon.append(QPointF(1.0,1.0)); + polygon.append(QPointF(0.0,1.0)); if(!override_style) { @@ -102,8 +102,8 @@ void TextboxView::__configureObject(void) text_item->setText(txtbox->getComment()); text_item->setTextPos(HorizSpacing * 2, VertSpacing * (text_item->getFont().italic() ? 0.90 : 0.50)); - TextPolygonItem::resizePolygon(polygon, roundf(text_item->getTextBoundingRect().width() + (2.5 * HorizSpacing)), - roundf(text_item->getTextBoundingRect().height() + (1.5 * VertSpacing))); + TextPolygonItem::resizePolygon(polygon, round(text_item->getTextBoundingRect().width() + (2.5 * HorizSpacing)), + round(text_item->getTextBoundingRect().height() + (1.5 * VertSpacing))); text_item->setPos(0,0); text_item->setPolygon(polygon); diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 3df89b66ae..8be2d7bc81 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -606,7 +606,7 @@ BaseObject *DatabaseModel::getObject(const QString &name, ObjectType obj_type, i if(found) { object=(*itr); - obj_idx=(itr-obj_list->begin()); + obj_idx=(itr - obj_list->begin()); } else obj_idx=-1; } @@ -3187,7 +3187,7 @@ void DatabaseModel::loadModel(const QString &filename) dynamic_cast(object)->getRelationshipType()==BaseRelationship::RelationshipGen) found_inh_rel=true; - emit s_objectLoaded((xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()))*100, + emit s_objectLoaded((xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()))*100, trUtf8("Loading: `%1' (%2)") .arg(object->getName()) .arg(object->getTypeName()), @@ -6836,8 +6836,8 @@ BaseRelationship *DatabaseModel::createRelationship(void) xmlparser.restorePosition(); base_rel->setLabelDistance(labels_id[str_aux], - QPointF(attribs[Attributes::XPos].toFloat(), - attribs[Attributes::YPos].toFloat())); + QPointF(attribs[Attributes::XPos].toDouble(), + attribs[Attributes::YPos].toDouble())); } else if(elem==Attributes::SpecialPkCols && rel) { @@ -10008,8 +10008,8 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option dst_tab=rel->getTable(BaseRelationship::DstTable); //Since the generated table does not have a position we create one based upon the source tables positions - pnt.setX((src_tab->getPosition().x() + dst_tab->getPosition().x())/2.0f); - pnt.setY((src_tab->getPosition().y() + dst_tab->getPosition().y())/2.0f); + pnt.setX((src_tab->getPosition().x() + dst_tab->getPosition().x())/2.0); + pnt.setY((src_tab->getPosition().y() + dst_tab->getPosition().y())/2.0); tab_nn->setPosition(pnt); objects.push_back(tab_nn); @@ -10058,7 +10058,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option //When handling a tag , textbox or generic sql we just extract their XML code if(obj_type==ObjectType::Textbox || obj_type==ObjectType::Tag || obj_type == ObjectType::GenericSql) { - emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, + emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving object `%1' (%2)") .arg(object->getName()).arg(object->getTypeName()), enum_cast(obj_type)); @@ -10224,7 +10224,7 @@ void DatabaseModel::saveObjectsMetadata(const QString &filename, unsigned option (save_collapsemode && !attribs[Attributes::CollapseMode].isEmpty()) || (save_objs_aliases && !attribs[Attributes::Alias].isEmpty())) { - emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, + emit s_objectLoaded(((idx++)/static_cast(objects.size()))*100, trUtf8("Saving metadata of the object `%1' (%2)") .arg(object->getSignature()).arg(object->getTypeName()), enum_cast(obj_type)); @@ -10355,7 +10355,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option xmlparser.savePosition(); obj_type=BaseObject::getObjectType(attribs[Attributes::Type]); - progress=xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()) * 100; + progress=xmlparser.getCurrentBufferLine()/static_cast(xmlparser.getBufferLineCount()) * 100; if(obj_type==ObjectType::Database) { @@ -10368,10 +10368,10 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option default_objs[ObjectType::Collation]=getCollation(attribs[Attributes::DefaultCollation]); default_objs[ObjectType::Tablespace]=getTablespace(attribs[Attributes::DefaultTablespace]); author=attribs[Attributes::ModelAuthor]; - last_zoom=attribs[Attributes::LastZoom].toFloat(); + last_zoom=attribs[Attributes::LastZoom].toDouble(); if(pos.size()>=2) - last_pos=QPoint(pos[0].toFloat(), pos[1].toFloat()); + last_pos=QPoint(pos[0].toInt(), pos[1].toInt()); } object=this; @@ -10448,8 +10448,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option //Retrieving and storing the points if(aux_elem==Attributes::Position) { - points.push_back(QPointF(aux_attrib[Attributes::XPos].toFloat(), - aux_attrib[Attributes::YPos].toFloat())); + points.push_back(QPointF(aux_attrib[Attributes::XPos].toDouble(), + aux_attrib[Attributes::YPos].toDouble())); } //Retrieving and storing the labels' custom positions else if(aux_elem==Attributes::Label) @@ -10460,8 +10460,8 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option if(xmlparser.accessElement(XmlParser::ChildElement)) { xmlparser.getElementAttributes(aux_attrib); - labels_pos[labels_attrs[ref_type]]=QPointF(aux_attrib[Attributes::XPos].toFloat(), - aux_attrib[Attributes::YPos].toFloat()); + labels_pos[labels_attrs[ref_type]]=QPointF(aux_attrib[Attributes::XPos].toDouble(), + aux_attrib[Attributes::YPos].toDouble()); } xmlparser.restorePosition(); @@ -10511,7 +10511,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option for(unsigned id=BaseRelationship::SrcCardLabel; id <= BaseRelationship::RelNameLabel; id++) { rel->setLabelDistance(id, labels_pos[id]); - labels_pos[id]=QPointF(NAN,NAN); + labels_pos[id]=QPointF(NAN, NAN); } } } diff --git a/libpgmodeler/src/textbox.cpp b/libpgmodeler/src/textbox.cpp index dbb81aaef1..6b46d8b8dc 100644 --- a/libpgmodeler/src/textbox.cpp +++ b/libpgmodeler/src/textbox.cpp @@ -21,7 +21,7 @@ Textbox::Textbox(void) { obj_type=ObjectType::Textbox; - font_size=9.0f; + font_size=9.0; text_attributes[0]=text_attributes[1]=text_attributes[2]=false; attributes[Attributes::Italic]=QString(); attributes[Attributes::Bold]=QString(); diff --git a/libpgmodeler_ui/src/aboutwidget.cpp b/libpgmodeler_ui/src/aboutwidget.cpp index 974fb96c18..6fcf4ce570 100644 --- a/libpgmodeler_ui/src/aboutwidget.cpp +++ b/libpgmodeler_ui/src/aboutwidget.cpp @@ -45,7 +45,7 @@ AboutWidget::AboutWidget(QWidget *parent) : QWidget(parent) emit s_visibilityChanged(false); }); - float factor = BaseObjectView::getScreenDpiFactor(); + double factor = BaseObjectView::getScreenDpiFactor(); this->adjustSize(); this->resize(this->minimumWidth() * factor, this->minimumHeight() * factor); } diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp index 1079e80599..8dce5853db 100644 --- a/libpgmodeler_ui/src/baseform.cpp +++ b/libpgmodeler_ui/src/baseform.cpp @@ -45,16 +45,16 @@ void BaseForm::resizeForm(QWidget *widget) int max_h = 0, max_w = 0, curr_w =0, curr_h = 0, screen_id = qApp->desktop()->screenNumber(qApp->activeWindow()); QScreen *screen=qApp->screens().at(screen_id); - float dpi_factor = 0; - float pixel_ratio = 0; + double dpi_factor = 0; + double pixel_ratio = 0; max_w = screen->size().width() * 0.70; max_h = screen->size().height() * 0.70; - dpi_factor = screen->logicalDotsPerInch() / 96.0f; + dpi_factor = screen->logicalDotsPerInch() / 96.0; pixel_ratio = screen->devicePixelRatio(); - if(dpi_factor <= 1.01f) - dpi_factor = 1.0f; + if(dpi_factor <= 1.01) + dpi_factor = 1.0; vbox->setContentsMargins(2,2,2,2); diff --git a/libpgmodeler_ui/src/databaseimportform.cpp b/libpgmodeler_ui/src/databaseimportform.cpp index 7830a739b0..8c0ea5b167 100644 --- a/libpgmodeler_ui/src/databaseimportform.cpp +++ b/libpgmodeler_ui/src/databaseimportform.cpp @@ -638,7 +638,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { QTreeWidgetItem *db_item=nullptr, *item=nullptr; vector sch_items, tab_items; - float inc=0, inc1=0, aux_prog=0; + double inc=0, inc1=0, aux_prog=0; if(!create_dummy_item) { @@ -687,7 +687,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW { ObjectType obj_type = ObjectType::BaseObject; aux_prog=task_prog_wgt.progress_pb->value(); - inc=40/static_cast(sch_items.size()); + inc=40/static_cast(sch_items.size()); while(!sch_items.empty()) { @@ -698,7 +698,7 @@ void DatabaseImportForm::listObjects(DatabaseImportHelper &import_helper, QTreeW BaseObject::getChildObjectTypes(ObjectType::Schema), checkable_items, disable_empty_grps, sch_items.back(), sch_items.back()->text(0)); - inc1=(60/static_cast(tab_items.size()))/static_cast(sch_items.size()); + inc1=(60/static_cast(tab_items.size()))/static_cast(sch_items.size()); while(!tab_items.empty()) { aux_prog+=inc1; diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 82f68648f7..cf1f1a1dbe 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -209,7 +209,7 @@ void DatabaseImportHelper::retrieveSystemObjects(void) itr++; } - progress=(i/static_cast(cnt))*10; + progress=(i/static_cast(cnt))*10; } } @@ -244,7 +244,7 @@ void DatabaseImportHelper::retrieveUserObjects(void) } objects.clear(); - progress=(i/static_cast(object_oids.size()))*100; + progress=(i/static_cast(object_oids.size()))*100; oid_itr++; i++; } @@ -262,7 +262,7 @@ void DatabaseImportHelper::retrieveUserObjects(void) if(names.size() > 1) retrieveTableColumns(names[0], names[1], col_itr->second); - progress=(i/static_cast(column_oids.size()))*100; + progress=(i/static_cast(column_oids.size()))*100; col_itr++; i++; } } @@ -328,7 +328,7 @@ void DatabaseImportHelper::createObjects(void) not_created_objs.push_back(oid); } - progress=(i/static_cast(creation_order.size())) * 100; + progress=(i/static_cast(creation_order.size())) * 100; } #ifdef DEMO_VERSION @@ -378,7 +378,7 @@ void DatabaseImportHelper::createObjects(void) aux_errors.push_back(Exception(e.getErrorMessage(), e.getErrorCode(), __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, dumpObjectAttributes(attribs))); } - progress=(i/static_cast(not_created_objs.size())) * 100; + progress=(i/static_cast(not_created_objs.size())) * 100; } tries++; @@ -441,7 +441,7 @@ void DatabaseImportHelper::createConstraints(void) throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); } - progress=(i/static_cast(constr_creation_order.size())) * 100; + progress=(i/static_cast(constr_creation_order.size())) * 100; } } @@ -469,7 +469,7 @@ void DatabaseImportHelper::createPermissions(void) createPermission(attribs); itr_obj++; - progress=((i++)/static_cast(obj_perms.size())) * 100; + progress=((i++)/static_cast(obj_perms.size())) * 100; } emit s_progressUpdated(progress, trUtf8("Creating columns permissions..."), ObjectType::Permission); @@ -492,7 +492,7 @@ void DatabaseImportHelper::createPermissions(void) } itr_cols++; - progress=((i++)/static_cast(col_perms.size())) * 100; + progress=((i++)/static_cast(col_perms.size())) * 100; } } catch(Exception &e) @@ -530,7 +530,7 @@ void DatabaseImportHelper::updateFKRelationships(void) dbmodel->updateTableFKRelationships(tab); - progress=(i/static_cast(count)) * 90; + progress=(i/static_cast(count)) * 90; itr_tab++; i++; } } diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index a27b1469ce..5835d13da6 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -494,10 +494,9 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::AttribsPerPage]=QString::number(attribs_per_page_spb->value()); config_params[Attributes::Configuration][Attributes::ExtAttribsPerPage]=QString::number(ext_attribs_per_page_spb->value()); - ObjectsScene::getGridOptions(show_grid, align_grid, show_delim); - config_params[Attributes::Configuration][Attributes::ShowCanvasGrid]=(show_grid ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::ShowPageDelimiters]=(show_delim ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::AlignObjsToGrid]=(align_grid ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::ShowCanvasGrid]=(ObjectsScene::isShowGrid() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::ShowPageDelimiters]=(ObjectsScene::isShowPageDelimiters() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::AlignObjsToGrid]=(ObjectsScene::isAlignObjectsToGrid() ? Attributes::True : QString()); unity_cmb->setCurrentIndex(UnitMilimeters); config_params[Attributes::Configuration][Attributes::PaperMargin]=QString("%1,%2,%3,%4").arg(left_marg->value()) @@ -604,8 +603,8 @@ void GeneralConfigWidget::applyConfiguration(void) QFont fnt; double fnt_size=config_params[Attributes::Configuration][Attributes::CodeFontSize].toDouble(); - if(fnt_size < 5.0f) - fnt_size=5.0f; + if(fnt_size < 5.0) + fnt_size=5.0; if(!save_restore_geometry_chk->isChecked()) widgets_geom.clear(); @@ -673,7 +672,7 @@ void GeneralConfigWidget::restoreDefaults(void) void GeneralConfigWidget::convertMarginUnity(void) { static int prev_unity=UnitMilimeters; - double conv_factor[]={1.0f, 2.83f, 0.04f, 0.1f}, + double conv_factor[]={1.0, 2.83, 0.04, 0.1}, left, right, top, bottom, width, height; left=left_marg->value() / conv_factor[prev_unity]; diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index a0676a3636..1c814e1073 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -780,7 +780,7 @@ void MainWindow::saveTemporaryModels(void) for(int i=0; i < count; i++) { model=dynamic_cast(models_tbw->widget(i)); - bg_saving_pb->setValue(((i+1)/static_cast(count)) * 100); + bg_saving_pb->setValue(((i+1)/static_cast(count)) * 100); if(model->isModified()) model->getDatabaseModel()->saveModel(model->getTempFilename(), SchemaParser::XmlDefinition); diff --git a/libpgmodeler_ui/src/messagebox.cpp b/libpgmodeler_ui/src/messagebox.cpp index aaa75826cd..7f3c1d6c37 100644 --- a/libpgmodeler_ui/src/messagebox.cpp +++ b/libpgmodeler_ui/src/messagebox.cpp @@ -218,7 +218,7 @@ void Messagebox::show(const QString &title, const QString &msg, unsigned icon_ty else if(size.height() >= max_h) this->setMinimumHeight(max_h); - float factor = BaseObjectView::getScreenDpiFactor(); + double factor = BaseObjectView::getScreenDpiFactor(); this->resize(this->minimumWidth() * factor, this->minimumHeight() * factor); QDialog::exec(); diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index 89dd8ea48c..3a0ff14007 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -96,7 +96,7 @@ ModelExportForm::ModelExportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(p pgsqlvers_cmb->addItems(PgSqlVersions::AllVersions); pgsqlvers1_cmb->addItems(PgSqlVersions::AllVersions); - double values[]={ ModelWidget::MinimumZoom, 0.10f, 0.25f, 0.5f, 0.75f, 1, 1.25f, 1.50f, 1.75f, 2, + double values[]={ ModelWidget::MinimumZoom, 0.10, 0.25, 0.5, 0.75, 1, 1.25, 1.50, 1.75, 2, 2.25, 2.50, 2.75, 3, 3.25, 3.50, 3.75, ModelWidget::MaximumZoom }; unsigned cnt=sizeof(values)/sizeof(double); diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 6d3e4a1489..74daa9e518 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -117,7 +117,9 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename scene->clearSelection(); //Make a backup of the current scene options - ObjectsScene::getGridOptions(shw_grd, align_objs, shw_dlm); + shw_grd = ObjectsScene::isShowGrid(); + align_objs = ObjectsScene::isAlignObjectsToGrid(); + shw_dlm = ObjectsScene::isShowPageDelimiters(); //Sets the options passed by the user ObjectsScene::setGridOptions(show_grid, false, show_delim); @@ -197,7 +199,7 @@ void ModelExportHelper::exportToPNG(ObjectsScene *scene, const QString &filename painter.setRenderHint(QPainter::TextAntialiasing, true); painter.setRenderHint(QPainter::SmoothPixmapTransform, true); - emit s_progressUpdated((page_idx/static_cast(pages.size())) * 90, + emit s_progressUpdated((page_idx/static_cast(pages.size())) * 90, trUtf8("Rendering objects to page %1/%2.").arg(page_idx).arg(pages.size()), ObjectType::BaseObject); //Render the entire viewport onto the pixmap @@ -251,7 +253,9 @@ void ModelExportHelper::exportToSVG(ObjectsScene *scene, const QString &filename QFileInfo fi(filename); //Making a backup of the current scene options - ObjectsScene::getGridOptions(shw_grd, align_objs, shw_dlm); + shw_grd = ObjectsScene::isShowGrid(); + shw_dlm = ObjectsScene::isShowPageDelimiters(); + align_objs = ObjectsScene::isAlignObjectsToGrid(); scene->setBackgroundBrush(Qt::NoBrush); //Disabling grid and delimiters @@ -414,7 +418,7 @@ void ModelExportHelper::exportToDBMS(DatabaseModel *db_model, Connection conn, c for(i=0; i < count && !export_canceled; i++) { object=db_model->getObject(i, types[type_id]); - progress=((10 * (type_id+1)) + ((i/static_cast(count)) * 10)); + progress=((10 * (type_id+1)) + ((i/static_cast(count)) * 10)); try { @@ -806,7 +810,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co //Cleanup single line comments lin=ts.readLine(); curr_size+=lin.size(); - aux_prog=progress + ((curr_size/static_cast(buf_size)) * factor); + aux_prog=progress + ((curr_size/static_cast(buf_size)) * factor); /* If the simulation mode is off and the drop objects option is checked, check if the current line matches one of the accepted drop commands diff --git a/libpgmodeler_ui/src/modelfixform.cpp b/libpgmodeler_ui/src/modelfixform.cpp index 5934145e6b..0cf13e1308 100644 --- a/libpgmodeler_ui/src/modelfixform.cpp +++ b/libpgmodeler_ui/src/modelfixform.cpp @@ -38,7 +38,7 @@ ModelFixForm::ModelFixForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, if(!confs[Attributes::Configuration][Attributes::CodeFont].isEmpty()) { double size=confs[Attributes::Configuration][Attributes::CodeFontSize].toDouble(); - if(size < 5.0f) size=5.0f; + if(size < 5.0) size=5.0; output_txt->setFontFamily(confs[Attributes::Configuration][Attributes::CodeFont]); output_txt->setFontPointSize(size); diff --git a/libpgmodeler_ui/src/modeloverviewwidget.cpp b/libpgmodeler_ui/src/modeloverviewwidget.cpp index 46ff297197..1dd51053a8 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.cpp +++ b/libpgmodeler_ui/src/modeloverviewwidget.cpp @@ -207,8 +207,8 @@ void ModelOverviewWidget::resizeOverview(void) curr_size.setHeight(curr_size.height() * ResizeFactor); //If the size exceeds the screen's width or height in 90% - if(curr_size.width() > screen_rect.width() * 0.90f || - curr_size.height() > screen_rect.height() * 0.90f) + if(curr_size.width() > screen_rect.width() * 0.90 || + curr_size.height() > screen_rect.height() * 0.90) { int max_val = std::max(scene_rect.width(), scene_rect.height()); diff --git a/libpgmodeler_ui/src/modeloverviewwidget.h b/libpgmodeler_ui/src/modeloverviewwidget.h index 1b87caec92..6557f29f0e 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.h +++ b/libpgmodeler_ui/src/modeloverviewwidget.h @@ -54,7 +54,7 @@ class ModelOverviewWidget: public QWidget, public Ui::ModelOverviewWidget { QSize pixmap_size; //! \brief Resize factor applied to overview widgets (default: 20% of the scene original size) - static constexpr double ResizeFactor=0.20f; + static constexpr double ResizeFactor=0.20; void mouseDoubleClickEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *event); diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index ca8072b7fe..44a593cf86 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -244,7 +244,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) ((diff_type==ObjectsDiffInfo::DropObject && (!diff_opts[OptKeepClusterObjs] || (diff_opts[OptKeepClusterObjs] && obj_type!=ObjectType::Role && obj_type!=ObjectType::Tablespace))) || (diff_type!=ObjectsDiffInfo::DropObject))) { - emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), + emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), trUtf8("Processing object `%1' (%2)...").arg(object->getSignature()).arg(object->getTypeName()), object->getObjectType()); @@ -377,7 +377,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) else { generateDiffInfo(ObjectsDiffInfo::IgnoreObject, object); - emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), + emit s_progressUpdated(prog + ((idx/static_cast(obj_order.size())) * factor), trUtf8("Skipping object `%1' (%2)...").arg(object->getSignature()).arg(object->getTypeName()), object->getObjectType()); @@ -677,7 +677,7 @@ void ModelsDiffHelper::processDiffInfos(void) constr=dynamic_cast(object); col=dynamic_cast(object); - emit s_progressUpdated((idx++/static_cast(diff_infos.size())) * 100, + emit s_progressUpdated((idx++/static_cast(diff_infos.size())) * 100, trUtf8("Processing `%1' info for object `%2' (%3)...") .arg(diff.getDiffTypeString()).arg(object->getSignature()).arg(object->getTypeName()), obj_type); diff --git a/libpgmodeler_ui/src/modelvalidationhelper.cpp b/libpgmodeler_ui/src/modelvalidationhelper.cpp index 250b513e33..24d40cfaee 100644 --- a/libpgmodeler_ui/src/modelvalidationhelper.cpp +++ b/libpgmodeler_ui/src/modelvalidationhelper.cpp @@ -457,7 +457,7 @@ void ModelValidationHelper::validateModel(void) } //Emit a signal containing the validation progress - progress=((i+1)/static_cast(count))*20; + progress=((i+1)/static_cast(count))*20; emit s_progressUpdated(progress, QString()); } @@ -530,7 +530,7 @@ void ModelValidationHelper::validateModel(void) } //Emit a signal containing the validation progress - progress=20 + ((i/static_cast(dup_objects.size()))*20); + progress=20 + ((i/static_cast(dup_objects.size()))*20); emit s_progressUpdated(progress, QString()); i++; mitr++; @@ -556,7 +556,7 @@ void ModelValidationHelper::validateModel(void) generateValidationInfo(ValidationInfo::MissingExtension, col, {}); } - progress=30 + ((i/static_cast(obj_list->size()))*20); + progress=30 + ((i/static_cast(obj_list->size()))*20); } } @@ -571,7 +571,7 @@ void ModelValidationHelper::validateModel(void) while(itr!=obj_list->end() && !valid_canceled) { - progress=40 + ((i/static_cast(obj_list->size()))*20); + progress=40 + ((i/static_cast(obj_list->size()))*20); if(dynamic_cast(*itr)->isInvalidated()) generateValidationInfo(ValidationInfo::BrokenRelConfig, *itr, {}); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index c7e4bc71ac..b4c65b37e4 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -68,7 +68,7 @@ bool ModelWidget::save_restore_pos=true; bool ModelWidget::disable_render_smooth=false; bool ModelWidget::simple_obj_creation=true; ModelWidget *ModelWidget::src_model=nullptr; -float ModelWidget::min_object_opacity=0.10f; +double ModelWidget::min_object_opacity=0.10; constexpr unsigned ModelWidget::BreakVertNinetyDegrees; constexpr unsigned ModelWidget::BreakHorizNinetyDegrees; @@ -572,7 +572,7 @@ bool ModelWidget::eventFilter(QObject *object, QEvent *event) object == viewport->verticalScrollBar()) && event->type() == QEvent::Wheel && w_event->modifiers()==Qt::ControlModifier) { - double zoom_inc = roundf(fabs(w_event->angleDelta().y())/120) * ZoomIncrement; + double zoom_inc = round(fabs(w_event->angleDelta().y())/120) * ZoomIncrement; if(w_event->angleDelta().y() < 0) this->applyZoom(this->current_zoom - zoom_inc); @@ -861,8 +861,8 @@ void ModelWidget::addNewObject(void) pos=menu_pos; //Otherwise inserts the new object at the middle of bounding rect else - pos=QPointF(sch_graph->pos().x() + (size.width()/2.0f), - sch_graph->pos().y() + (size.height()/2.0f)); + pos=QPointF(sch_graph->pos().x() + (size.width()/2.0), + sch_graph->pos().y() + (size.height()/2.0)); this->showObjectForm(obj_type, nullptr, parent_obj, pos); } @@ -1302,8 +1302,8 @@ void ModelWidget::convertRelationshipNN(void) op_list->registerObject(rel, Operation::ObjectRemoved); //The default position for the table will be the middle point between the relationship participant tables - pnt.setX((src_tab->getPosition().x() + dst_tab->getPosition().x())/2.0f); - pnt.setY((src_tab->getPosition().y() + dst_tab->getPosition().y())/2.0f); + pnt.setX((src_tab->getPosition().x() + dst_tab->getPosition().x())/2.0); + pnt.setY((src_tab->getPosition().y() + dst_tab->getPosition().y())/2.0); tab->setPosition(pnt); //Adds the new table to the model @@ -1420,9 +1420,6 @@ void ModelWidget::loadModel(const QString &filename) void ModelWidget::adjustSceneSize(void) { QRectF scene_rect, objs_rect; - bool align_objs, show_grid, show_delims; - - ObjectsScene::getGridOptions(show_grid, align_objs, show_delims); scene_rect=scene->sceneRect(); objs_rect=scene->itemsBoundingRect(); @@ -1436,7 +1433,7 @@ void ModelWidget::adjustSceneSize(void) scene->setSceneRect(scene_rect); viewport->centerOn(0,0); - if(align_objs) + if(ObjectsScene::isAlignObjectsToGrid()) { scene->alignObjectsToGrid(); db_model->setObjectsModified({ ObjectType::Relationship, ObjectType::BaseRelationship }); @@ -1463,7 +1460,9 @@ void ModelWidget::printModel(QPrinter *printer, bool print_grid, bool print_page h_top_mid, h_bottom_mid, v_left_mid, v_right_mid, dx, dy, dx1, dy1; //Make a backup of the current grid options - ObjectsScene::getGridOptions(show_grid, align_objs, show_delims); + show_grid = ObjectsScene::isShowGrid(); + align_objs = ObjectsScene::isAlignObjectsToGrid(); + show_delims = ObjectsScene::isShowPageDelimiters(); //Reconfigure the grid options based upon the passed settings ObjectsScene::setGridOptions(print_grid, align_objs, false); @@ -1485,9 +1484,9 @@ void ModelWidget::printModel(QPrinter *printer, bool print_grid, bool print_page //Creates a painter to draw the model directly on the printer QPainter painter(printer); painter.setRenderHint(QPainter::Antialiasing); - font.setPointSizeF(7.5f); + font.setPointSizeF(7.5); pen.setColor(QColor(120,120,120)); - pen.setWidthF(1.0f); + pen.setWidthF(1.0); //Calculates the auxiliary points to draw the page delimiter lines top_left.setX(0); top_left.setY(0); @@ -2433,7 +2432,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) tab_obj=dynamic_cast(object); itr++; pos++; - task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, + task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Validating object: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), enum_cast(object->getObjectType())); @@ -2535,7 +2534,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) itr++; pos++; - task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, + task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Generating XML for: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), enum_cast(object->getObjectType())); @@ -2640,7 +2639,7 @@ void ModelWidget::pasteObjects(bool duplicate_mode) try { pos++; - task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, + task_prog_wgt.updateProgress((pos/static_cast(copied_objects.size()))*100, trUtf8("Pasting object: `%1' (%2)").arg(object->getName()) .arg(object->getTypeName()), enum_cast(object->getObjectType())); @@ -4139,7 +4138,7 @@ void ModelWidget::setMinimumObjectOpacity(unsigned min_opacity) if(min_opacity > 70) min_opacity = 70; - ModelWidget::min_object_opacity = static_cast(min_opacity)/100.0f; + ModelWidget::min_object_opacity = static_cast(min_opacity)/100.0; } void ModelWidget::highlightObject(void) @@ -4835,13 +4834,13 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) if(tables.size() >= 4) { - max_w *= 0.50f; - max_h *= 0.50f; + max_w *= 0.50; + max_h *= 0.50; } else { - max_w *= 1.15f; - max_h *= 1.15f; + max_w *= 1.15; + max_h *= 1.15; } uniform_int_distribution dist_x(start.x(), start.x() + max_w), diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index aef1d8b187..df25f8cbc8 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -63,7 +63,7 @@ class ModelWidget: public QWidget { disable_render_smooth; //! \brief Indicates if the minimum object opacity used when appliyng fade out to objects - static float min_object_opacity; + static double min_object_opacity; /*! \brief Stores the model that generates the copy/cut operation. This model is updated from the destination model whenever a past/cut operation is done. */ diff --git a/libpgmodeler_ui/src/numberedtexteditor.cpp b/libpgmodeler_ui/src/numberedtexteditor.cpp index 87fe6dd3c9..bcfa247388 100644 --- a/libpgmodeler_ui/src/numberedtexteditor.cpp +++ b/libpgmodeler_ui/src/numberedtexteditor.cpp @@ -45,7 +45,7 @@ NumberedTextEditor::NumberedTextEditor(QWidget * parent, bool handle_ext_files) QHBoxLayout *hbox = new QHBoxLayout, *hbox1 = new QHBoxLayout; QFont font = this->font(); - font.setPointSizeF(font.pointSizeF() * 0.95f); + font.setPointSizeF(font.pointSizeF() * 0.95); top_widget = new QWidget(this); top_widget->setAutoFillBackground(true); diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index ea6366d0a2..cd3a0e5a16 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -211,29 +211,29 @@ namespace PgModelerUiNs { void configureWidgetFont(QWidget *widget, unsigned factor_id) { - float factor = 1; + double factor = 1; switch(factor_id) { case SmallFontFactor: - factor=0.80f; + factor=0.80; break; case MediumFontFactor: - factor=0.90f; + factor=0.90; break; case BigFontFactor: - factor=1.10f; + factor=1.10; break; case HugeFontFactor: default: - factor=1.40f; + factor=1.40; break; } __configureWidgetFont(widget, factor); } - void __configureWidgetFont(QWidget *widget, float factor) + void __configureWidgetFont(QWidget *widget, double factor) { if(!widget) return; @@ -295,14 +295,14 @@ namespace PgModelerUiNs { int max_h = 0, curr_w =0, curr_h = 0, screen_id = qApp->desktop()->screenNumber(qApp->activeWindow()); QScreen *screen=qApp->screens().at(screen_id); - float dpi_factor = 0; - float pixel_ratio = 0; + double dpi_factor = 0; + double pixel_ratio = 0; - dpi_factor = screen->logicalDotsPerInch() / 96.0f; + dpi_factor = screen->logicalDotsPerInch() / 96.0; pixel_ratio = screen->devicePixelRatio(); //If the dpi_factor is unchanged (1) we keep the dialog original dimension - if(dpi_factor <= 1.01f) + if(dpi_factor <= 1.01) return; max_h = screen->size().height() * 0.70; diff --git a/libpgmodeler_ui/src/pgmodeleruins.h b/libpgmodeler_ui/src/pgmodeleruins.h index 9ac3c839eb..d7d5cb785e 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.h +++ b/libpgmodeler_ui/src/pgmodeleruins.h @@ -39,7 +39,7 @@ namespace PgModelerUiNs { HugeFontFactor = 3; extern void configureWidgetFont(QWidget *widget, unsigned factor_id); - extern void __configureWidgetFont(QWidget *widget, float factor); + extern void __configureWidgetFont(QWidget *widget, double factor); /*! \brief Creates a NumberedTextEditor instance automatically assigning it to 'parent'. This method will create a layout if 'parent' doesn't has one. If parent has a layout diff --git a/libpgmodeler_ui/src/sceneinfowidget.cpp b/libpgmodeler_ui/src/sceneinfowidget.cpp index 77b46d7984..8cc73242e3 100644 --- a/libpgmodeler_ui/src/sceneinfowidget.cpp +++ b/libpgmodeler_ui/src/sceneinfowidget.cpp @@ -54,10 +54,10 @@ void SceneInfoWidget::updateSelectedObject(BaseObjectView *object) obj_icon_lbl->setPixmap(PgModelerUiNs::getIconPath(object->getSourceObject()->getSchemaName())); obj_name_lbl->setText(QString("%1 (%2)").arg(object->getSourceObject()->getSignature()).arg(object->getSourceObject()->getTypeName())); obj_pos_info_lbl->setText(QString("(%1, %2) [w: %3, h: %4]") - .arg(roundf(rect.left())) - .arg(roundf(rect.top())) - .arg(roundf(rect.width())) - .arg(roundf(rect.height()))); + .arg(round(rect.left())) + .arg(round(rect.top())) + .arg(round(rect.width())) + .arg(round(rect.height()))); } } @@ -76,7 +76,7 @@ void SceneInfoWidget::updateSelectedObjects(int obj_count, const QRectF &objs_re void SceneInfoWidget::updateMousePosition(const QPointF &mouse_pos) { - mouse_pos_info_lbl->setText(QString("%1, %2").arg(roundf(mouse_pos.x())).arg(roundf(mouse_pos.y()))); + mouse_pos_info_lbl->setText(QString("%1, %2").arg(round(mouse_pos.x())).arg(round(mouse_pos.y()))); } void SceneInfoWidget::updateSceneZoom(double zoom) diff --git a/libpgmodeler_ui/src/syntaxhighlighter.cpp b/libpgmodeler_ui/src/syntaxhighlighter.cpp index b706651e6d..4f0e8112f8 100644 --- a/libpgmodeler_ui/src/syntaxhighlighter.cpp +++ b/libpgmodeler_ui/src/syntaxhighlighter.cpp @@ -38,7 +38,7 @@ SyntaxHighlighter::SyntaxHighlighter(QPlainTextEdit *parent, bool single_line_mo if(single_line_mode) { QFontMetrics fm=QFontMetrics(default_font); - int height=fm.height() + (fm.lineSpacing()/static_cast(1.3)); + int height=fm.height() + (fm.lineSpacing()/static_cast(1.3)); parent->setMinimumHeight(height); parent->setMaximumHeight(height); parent->setSizePolicy(parent->sizePolicy().horizontalPolicy(), QSizePolicy::Fixed); diff --git a/libpgmodeler_ui/src/welcomewidget.cpp b/libpgmodeler_ui/src/welcomewidget.cpp index cf7dcacc4a..d11ec1875c 100644 --- a/libpgmodeler_ui/src/welcomewidget.cpp +++ b/libpgmodeler_ui/src/welcomewidget.cpp @@ -36,9 +36,9 @@ WelcomeWidget::WelcomeWidget(QWidget *parent): QWidget(parent) btn->setGraphicsEffect(shadow); #ifdef Q_OS_LINUX - PgModelerUiNs::__configureWidgetFont(btn, 1.20f); + PgModelerUiNs::__configureWidgetFont(btn, 1.20); #else - PgModelerUiNs::__configureWidgetFont(btn, 1.50f); + PgModelerUiNs::__configureWidgetFont(btn, 1.50); #endif } } From c644b08a9ceca29bcb628703ca645da965123bf4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 14 May 2019 17:38:34 -0300 Subject: [PATCH 353/425] Some code cleanups in order to remove compiler warnings --- CHANGELOG.md | 2 +- RELEASENOTES.md | 2 +- libobjrenderer/src/baseobjectview.cpp | 2 +- libobjrenderer/src/basetableview.cpp | 4 +- libobjrenderer/src/objectsscene.cpp | 16 ++++---- libobjrenderer/src/objectsscene.h | 2 +- libobjrenderer/src/relationshipview.cpp | 6 +-- libparsers/src/schemaparser.cpp | 1 - libpgconnector/src/resultset.cpp | 2 - libpgmodeler/src/baserelationship.cpp | 42 +++++++++++---------- libpgmodeler/src/databasemodel.cpp | 4 +- libpgmodeler_ui/src/baseform.cpp | 2 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 6 +-- libpgmodeler_ui/src/baseobjectwidget.h | 4 +- libpgmodeler_ui/src/generalconfigwidget.cpp | 3 +- libpgmodeler_ui/src/indexwidget.cpp | 1 - libpgmodeler_ui/src/layerswidget.cpp | 1 - libpgmodeler_ui/src/modeloverviewwidget.cpp | 4 +- libpgmodeler_ui/src/modelwidget.h | 2 +- libpgmodeler_ui/src/referencewidget.cpp | 2 +- libpgmodeler_ui/src/rolewidget.cpp | 2 +- libpgmodeler_ui/src/sequencewidget.cpp | 2 +- libpgmodeler_ui/src/textboxwidget.h | 2 +- libutils/libutils.pro | 3 +- libutils/src/doublenan.h | 27 +++++++++++++ libutils/src/exception.h | 1 + 26 files changed, 85 insertions(+), 60 deletions(-) create mode 100644 libutils/src/doublenan.h diff --git a/CHANGELOG.md b/CHANGELOG.md index 0085dbac3e..02df2e892b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Change Log v0.9.2-beta ------ -Release date: May 15, 2019
+Release date: May 21, 2019
* [New] Added support to foreign server. * [New] Added support to foreign data wrapper. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 6058ed93cb..bd94663589 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,7 +1,7 @@ v0.9.2-beta ------ -Release date: May 15, 2019
+Release date: May 21, 2019
Changes since: v0.9.2-alpha1
Summary: a brand new version has come to you after a work of almost five months on it. This one brings important features requested long ago and several patches to improve the tool's usability.
diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 3179934e5d..dada50b6bf 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -489,7 +489,7 @@ void BaseObjectView::configureSQLDisabledInfo(void) sql_disabled_item->setPen(BaseObjectView::getBorderStyle(Attributes::PositionInfo)); sql_disabled_item->setBrush(BaseObjectView::getFillStyle(Attributes::PositionInfo)); - px=bounding_rect.width() - sql_disabled_item->boundingRect().width() + (1.5 * HorizSpacing), + px=bounding_rect.width() - sql_disabled_item->boundingRect().width() + (1.5 * HorizSpacing); py=-(sql_disabled_item->boundingRect().height()/2); sql_disabled_item->setPos(px, py); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index bcee0aa67c..8eaede1348 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -232,10 +232,10 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) } else if(!items.isEmpty()) { - BaseObjectView *item=dynamic_cast(items[item_idx]); + BaseObjectView *item=dynamic_cast(items[static_cast(item_idx)]); //Configures the selection with the item's dimension - if(obj_selection->boundingRect().height()!=item->boundingRect().height()) + if(obj_selection->boundingRect().height() != item->boundingRect().height()) { dynamic_cast(obj_selection)->setBorderRadius(2); dynamic_cast(obj_selection)->setRect(QRectF(0, 0, diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 53831881f6..5b921b7773 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -39,8 +39,8 @@ ObjectsScene::ObjectsScene(void) enable_range_sel=true; this->setBackgroundBrush(grid); - sel_ini_pnt.setX(NAN); - sel_ini_pnt.setY(NAN); + sel_ini_pnt.setX(DNaN); + sel_ini_pnt.setY(DNaN); selection_rect=new QGraphicsPolygonItem; selection_rect->setVisible(false); @@ -453,8 +453,8 @@ void ObjectsScene::setGridSize(unsigned size) height=aux_size.height()/static_cast(size) * size; //Calculates the grid pixmpa size - img_w=ceil(width/size)*size; - img_h=ceil(height/size)*size; + img_w=ceil(width/size) * size; + img_h=ceil(height/size) * size; grid_size=size; grid_img=QImage(img_w, img_h, QImage::Format_ARGB32); @@ -1083,8 +1083,8 @@ void ObjectsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) selection_rect->setVisible(false); selection_rect->setPolygon(pol); - sel_ini_pnt.setX(NAN); - sel_ini_pnt.setY(NAN); + sel_ini_pnt.setX(DNaN); + sel_ini_pnt.setY(DNaN); if(!this->selectedItems().isEmpty()) emit s_objectsSelectedInRange(); @@ -1250,8 +1250,8 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) emit s_objectsMoved(true); moving_objs=false; - sel_ini_pnt.setX(NAN); - sel_ini_pnt.setY(NAN); + sel_ini_pnt.setX(DNaN); + sel_ini_pnt.setY(DNaN); } void ObjectsScene::alignObjectsToGrid(void) diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index b8cb328a26..0a816f2f7f 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -137,7 +137,7 @@ class ObjectsScene: public QGraphicsScene { void keyReleaseEvent(QKeyEvent *event); //! \brief Draws a line from the point 'p_start' to the cursor position and simulates the relationship creation - void showRelationshipLine(bool value, const QPointF &p_start=QPointF(NAN,NAN)); + void showRelationshipLine(bool value, const QPointF &p_start=QPointF(DNaN,DNaN)); void blockItemsSignals(bool block); diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 5ebaf9c73d..958ef448db 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -1676,9 +1676,9 @@ void RelationshipView::configureCrowsFootDescriptors(void) * is between one of the coordinates of the relationship line used in the operation. * * If it matches we'll use the use one of the extremes of the relationship line in the matching coordinate */ - min_x = qMin(rel_lines[tab_id].p1().x(), rel_lines[tab_id].p2().x()), - max_x = qMax(rel_lines[tab_id].p1().x(), rel_lines[tab_id].p2().x()), - min_y = qMin(rel_lines[tab_id].p1().y(), rel_lines[tab_id].p2().y()), + min_x = qMin(rel_lines[tab_id].p1().x(), rel_lines[tab_id].p2().x()); + max_x = qMax(rel_lines[tab_id].p1().x(), rel_lines[tab_id].p2().x()); + min_y = qMin(rel_lines[tab_id].p1().y(), rel_lines[tab_id].p2().y()); max_y = qMax(rel_lines[tab_id].p1().y(), rel_lines[tab_id].p2().y()); if(pi.x() >= min_x && pi.x() <= max_x) diff --git a/libparsers/src/schemaparser.cpp b/libparsers/src/schemaparser.cpp index 7765ed81d4..c8763556fa 100644 --- a/libparsers/src/schemaparser.cpp +++ b/libparsers/src/schemaparser.cpp @@ -702,7 +702,6 @@ void SchemaParser::unsetAttribute(void) throw Exception(Exception::getErrorMessage(ErrorCode::InvalidSyntax) .arg(filename).arg((line + comment_count + 1)).arg((column+1)), ErrorCode::InvalidSyntax,__PRETTY_FUNCTION__,__FILE__,__LINE__); - break; } } } diff --git a/libpgconnector/src/resultset.cpp b/libpgconnector/src/resultset.cpp index 3715eb5c73..567ca21653 100644 --- a/libpgconnector/src/resultset.cpp +++ b/libpgconnector/src/resultset.cpp @@ -43,14 +43,12 @@ ResultSet::ResultSet(PGresult *sql_result) //Generating an error in case the server returns an incomprehensible response case PGRES_BAD_RESPONSE: throw Exception(ErrorCode::IncomprehensibleDBMSResponse, __PRETTY_FUNCTION__, __FILE__, __LINE__); - break; //Generating an error in case the server returns a fatal error case PGRES_FATAL_ERROR: str_aux=Exception::getErrorMessage(ErrorCode::DBMSFatalError) .arg(PQresultErrorMessage(sql_result)); throw Exception(str_aux,ErrorCode::DBMSFatalError, __PRETTY_FUNCTION__, __FILE__, __LINE__); - break; //In case of sucess states the result will be created case PGRES_COMMAND_OK: diff --git a/libpgmodeler/src/baserelationship.cpp b/libpgmodeler/src/baserelationship.cpp index 646685cbaf..72177f57eb 100644 --- a/libpgmodeler/src/baserelationship.cpp +++ b/libpgmodeler/src/baserelationship.cpp @@ -54,7 +54,7 @@ BaseRelationship::BaseRelationship(unsigned rel_type, BaseTable *src_tab, BaseTa for(unsigned i=0; i < 3; i++) { lables[i]=nullptr; - lables_dist[i]=QPointF(NAN, NAN); + lables_dist[i]=QPointF(DNaN, DNaN); } configureRelationship(); @@ -465,7 +465,7 @@ QColor BaseRelationship::getCustomColor(void) void BaseRelationship::resetLabelsDistance(void) { for(unsigned i=0; i < 3; i++) - this->setLabelDistance(i, QPointF(NAN,NAN)); + this->setLabelDistance(i, QPointF(DNaN,DNaN)); } vector BaseRelationship::getPoints(void) @@ -505,18 +505,19 @@ QString BaseRelationship::getRelTypeAttribute(void) { switch(rel_type) { - case Relationship11: return(Attributes::Relationship11); break; - case Relationship1n: return(Attributes::Relationship1n); break; - case RelationshipNn: return(Attributes::RelationshipNn); break; - case RelationshipGen: return(Attributes::RelationshipGen); break; - case RelationshipPart: return(Attributes::RelationshipPart); break; - case RelationshipFk: return(Attributes::RelationshipFk); break; + case Relationship11: return(Attributes::Relationship11); + case Relationship1n: return(Attributes::Relationship1n); + case RelationshipNn: return(Attributes::RelationshipNn); + case RelationshipGen: return(Attributes::RelationshipGen); + case RelationshipPart: return(Attributes::RelationshipPart); + case RelationshipFk: return(Attributes::RelationshipFk); default: + { if(src_table->getObjectType()==ObjectType::View) return(Attributes::RelationshipTabView); else return(Attributes::RelationshipDep); - break; + } } } @@ -524,18 +525,19 @@ QString BaseRelationship::getRelationshipTypeName(unsigned rel_type, bool is_vie { switch(rel_type) { - case Relationship11: return(trUtf8("One-to-one")); break; - case Relationship1n: return(trUtf8("One-to-many")); break; - case RelationshipNn: return(trUtf8("Many-to-many")); break; - case RelationshipGen: return(trUtf8("Inheritance")); break; - case RelationshipPart: return(trUtf8("Partitioning")); break; - case RelationshipFk: return(trUtf8("FK relationship")); break; + case Relationship11: return(trUtf8("One-to-one")); + case Relationship1n: return(trUtf8("One-to-many")); + case RelationshipNn: return(trUtf8("Many-to-many")); + case RelationshipGen: return(trUtf8("Inheritance")); + case RelationshipPart: return(trUtf8("Partitioning")); + case RelationshipFk: return(trUtf8("FK relationship")); default: - if(is_view) - return(trUtf8("Dependency")); - else - return(trUtf8("Copy")); - break; + { + if(is_view) + return(trUtf8("Dependency")); + else + return(trUtf8("Copy")); + } } } diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 8be2d7bc81..ccad7ce9ec 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -10279,7 +10279,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option BaseTable *src_tab=nullptr, *dst_tab=nullptr, *base_tab=nullptr; vector points; map labels_attrs; - vector labels_pos={ QPointF(NAN,NAN), QPointF(NAN,NAN), QPointF(NAN,NAN) }; + vector labels_pos={ QPointF(DNaN,DNaN), QPointF(DNaN,DNaN), QPointF(DNaN,DNaN) }; BaseRelationship *rel=nullptr; Schema *schema=nullptr; Tag *tag=nullptr; @@ -10511,7 +10511,7 @@ void DatabaseModel::loadObjectsMetadata(const QString &filename, unsigned option for(unsigned id=BaseRelationship::SrcCardLabel; id <= BaseRelationship::RelNameLabel; id++) { rel->setLabelDistance(id, labels_pos[id]); - labels_pos[id]=QPointF(NAN, NAN); + labels_pos[id]=QPointF(DNaN, DNaN); } } } diff --git a/libpgmodeler_ui/src/baseform.cpp b/libpgmodeler_ui/src/baseform.cpp index 8dce5853db..e45ef52a41 100644 --- a/libpgmodeler_ui/src/baseform.cpp +++ b/libpgmodeler_ui/src/baseform.cpp @@ -87,7 +87,7 @@ void BaseForm::resizeForm(QWidget *widget) main_frm->setLayout(vbox); this->adjustSize(); - curr_h=this->height(), + curr_h=this->height(); curr_w=min_size.width(); // If the current height is greater than the widget's minimum height we will use a medium value diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index e9efef4d58..b2060e2ba2 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -45,8 +45,8 @@ BaseObjectWidget::BaseObjectWidget(QWidget *parent, ObjectType obj_type): QWidge prev_schema=nullptr; op_list=nullptr; object=nullptr; - object_px=NAN; - object_py=NAN; + object_px=DNaN; + object_py=DNaN; schema_sel=nullptr; owner_sel=nullptr; tablespace_sel=nullptr; @@ -184,7 +184,7 @@ void BaseObjectWidget::setRequiredField(QWidget *widget) void BaseObjectWidget::setAttributes(DatabaseModel *model, BaseObject *object, BaseObject *parent_obj) { - setAttributes(model, nullptr, object, parent_obj, NAN, NAN, false); + setAttributes(model, nullptr, object, parent_obj, DNaN, DNaN, false); } void BaseObjectWidget::disableReferencesSQL(BaseObject *object) diff --git a/libpgmodeler_ui/src/baseobjectwidget.h b/libpgmodeler_ui/src/baseobjectwidget.h index 6130b7845f..5c8ec5247a 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.h +++ b/libpgmodeler_ui/src/baseobjectwidget.h @@ -124,11 +124,11 @@ class BaseObjectWidget: public QWidget, public Ui::BaseObjectWidget { void setAttributes(DatabaseModel *model, OperationList *op_list, BaseObject *object, BaseObject *parent_obj=nullptr, - double obj_px=NAN, double obj_py=NAN, bool uses_op_list=true); + double obj_px=DNaN, double obj_py=DNaN, bool uses_op_list=true); /*! \brief This method is a simplification of the original setAttributes. This method must be used only on forms that does not make use of operaton list and not treat graphical objects, since it calls - this original one whit the op_list=nullptr and obj_px=NAN, obj_py=NAN */ + this original one whit the op_list=nullptr and obj_px=DoubleNaN, obj_py=DoubleNaN */ void setAttributes(DatabaseModel *model, BaseObject *object, BaseObject *parent_obj); //! \brief Disable the object's refereces SQL code diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 5835d13da6..b91136c05a 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -456,7 +456,6 @@ void GeneralConfigWidget::saveConfiguration(void) attribs_map attribs; map::iterator itr, itr_end; QString file_sch, root_dir, widget_sch; - bool show_grid=false, show_delim=false, align_grid=false; root_dir=GlobalAttributes::TmplConfigurationDir + GlobalAttributes::DirSeparator; @@ -640,7 +639,7 @@ void GeneralConfigWidget::applyConfiguration(void) SQLExecutionWidget::setSQLHistoryMaxLength(history_max_length_spb->value()); fnt.setFamily(config_params[Attributes::Configuration][Attributes::CodeFont]); - fnt.setPointSize(fnt_size); + fnt.setPointSizeF(fnt_size); NumberedTextEditor::setLineNumbersVisible(disp_line_numbers_chk->isChecked()); NumberedTextEditor::setLineHighlightColor(line_highlight_cp->getColor(0)); NumberedTextEditor::setHighlightLines(hightlight_lines_chk->isChecked()); diff --git a/libpgmodeler_ui/src/indexwidget.cpp b/libpgmodeler_ui/src/indexwidget.cpp index 45949bbccc..6bd9e240c2 100644 --- a/libpgmodeler_ui/src/indexwidget.cpp +++ b/libpgmodeler_ui/src/indexwidget.cpp @@ -74,7 +74,6 @@ void IndexWidget::selectIndexingType(void) fast_update_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::Gin); buffering_chk->setEnabled(IndexingType(indexing_cmb->currentText())==IndexingType::Gist); fill_factor_sb->setEnabled(fill_factor_chk->isChecked() && fill_factor_chk->isEnabled()); - //enableSortingOptions(); } /*void IndexWidget::enableSortingOptions(void) diff --git a/libpgmodeler_ui/src/layerswidget.cpp b/libpgmodeler_ui/src/layerswidget.cpp index 800814f738..32269b33ca 100644 --- a/libpgmodeler_ui/src/layerswidget.cpp +++ b/libpgmodeler_ui/src/layerswidget.cpp @@ -17,7 +17,6 @@ */ #include "layerswidget.h" -#include LayersWidget::LayersWidget(QWidget *parent) : QWidget(parent) { diff --git a/libpgmodeler_ui/src/modeloverviewwidget.cpp b/libpgmodeler_ui/src/modeloverviewwidget.cpp index 1dd51053a8..b65a8e93a3 100644 --- a/libpgmodeler_ui/src/modeloverviewwidget.cpp +++ b/libpgmodeler_ui/src/modeloverviewwidget.cpp @@ -307,8 +307,8 @@ void ModelOverviewWidget::mouseMoveEvent(QMouseEvent *event) rect.setBottom(y + height); rect1=label->geometry(); - this->model->viewport->horizontalScrollBar()->setValue(ceilf(zoom_factor * scene_rect.width() * (rect.x()/static_cast(rect1.width())))); - this->model->viewport->verticalScrollBar()->setValue(ceilf(zoom_factor * scene_rect.height() * (rect.y()/static_cast(rect1.height())))); + this->model->viewport->horizontalScrollBar()->setValue(ceil(zoom_factor * scene_rect.width() * (rect.x()/static_cast(rect1.width())))); + this->model->viewport->verticalScrollBar()->setValue(ceil(zoom_factor * scene_rect.height() * (rect.y()/static_cast(rect1.height())))); } } diff --git a/libpgmodeler_ui/src/modelwidget.h b/libpgmodeler_ui/src/modelwidget.h index df25f8cbc8..771ac531fb 100644 --- a/libpgmodeler_ui/src/modelwidget.h +++ b/libpgmodeler_ui/src/modelwidget.h @@ -312,7 +312,7 @@ class ModelWidget: public QWidget { QString getTempFilename(void); //! \brief Shows the editing form according to the passed object type - void showObjectForm(ObjectType obj_type, BaseObject *object=nullptr, BaseObject *parent_obj=nullptr, const QPointF &pos=QPointF(NAN, NAN)); + void showObjectForm(ObjectType obj_type, BaseObject *object=nullptr, BaseObject *parent_obj=nullptr, const QPointF &pos=QPointF(DNaN, DNaN)); //! \brief Applies a zoom factor to the model void applyZoom(double zoom); diff --git a/libpgmodeler_ui/src/referencewidget.cpp b/libpgmodeler_ui/src/referencewidget.cpp index 3e81d78c1c..f4af6d1ffd 100644 --- a/libpgmodeler_ui/src/referencewidget.cpp +++ b/libpgmodeler_ui/src/referencewidget.cpp @@ -81,7 +81,7 @@ ReferenceWidget::ReferenceWidget(QWidget *parent) : QWidget(parent) ref_tables_tab->setHeaderLabel(trUtf8("Schema"), 1); ref_tables_tab->setHeaderIcon(QPixmap(PgModelerUiNs::getIconPath("schema")),1); - ref_table_sel=new ObjectSelectorWidget({ ObjectType::Table }, true, this); + ref_table_sel=new ObjectSelectorWidget(ObjectType::Table, true, this); ref_table_sel->enableObjectCreation(false); QHBoxLayout *hbox = new QHBoxLayout; diff --git a/libpgmodeler_ui/src/rolewidget.cpp b/libpgmodeler_ui/src/rolewidget.cpp index d1041b093e..a3b3a5b335 100644 --- a/libpgmodeler_ui/src/rolewidget.cpp +++ b/libpgmodeler_ui/src/rolewidget.cpp @@ -93,7 +93,7 @@ void RoleWidget::configureRoleSelection(void) //Disconnects all signals from the member role tables for(i=0; i < 3; i++) - disconnect(members_tab[i],0,this,0); + disconnect(members_tab[i], nullptr,this, nullptr); //Connects the signal/slots only on the current table connect(members_tab[members_twg->currentIndex()], SIGNAL(s_rowAdded(int)), this, SLOT(selectMemberRole(void))); diff --git a/libpgmodeler_ui/src/sequencewidget.cpp b/libpgmodeler_ui/src/sequencewidget.cpp index 31596fb673..40ddc7a22c 100644 --- a/libpgmodeler_ui/src/sequencewidget.cpp +++ b/libpgmodeler_ui/src/sequencewidget.cpp @@ -49,7 +49,7 @@ SequenceWidget::SequenceWidget(QWidget *parent): BaseObjectWidget(parent, Object void SequenceWidget::setAttributesReadonly(DatabaseModel *model, OperationList *op_list, Schema *schema, Sequence *sequence, Column *column) { setAttributes(model, sequence); - BaseObjectWidget::setAttributes(model, op_list, sequence, schema, NAN, NAN, false); + BaseObjectWidget::setAttributes(model, op_list, sequence, schema, DNaN, DNaN, false); name_edt->setReadOnly(true); comment_edt->setEnabled(false); diff --git a/libpgmodeler_ui/src/textboxwidget.h b/libpgmodeler_ui/src/textboxwidget.h index bc8c450f07..c83da289ed 100644 --- a/libpgmodeler_ui/src/textboxwidget.h +++ b/libpgmodeler_ui/src/textboxwidget.h @@ -35,7 +35,7 @@ class TextboxWidget: public BaseObjectWidget, public Ui::TextboxWidget { public: TextboxWidget(QWidget * parent = nullptr); - void setAttributes(DatabaseModel *model, OperationList *op_list, Textbox *txtbox=nullptr, double obj_px=NAN, double obj_py=NAN); + void setAttributes(DatabaseModel *model, OperationList *op_list, Textbox *txtbox=nullptr, double obj_px=DNaN, double obj_py=DNaN); private slots: void selectTextColor(void); diff --git a/libutils/libutils.pro b/libutils/libutils.pro index 7b13ae079d..38e6236b14 100644 --- a/libutils/libutils.pro +++ b/libutils/libutils.pro @@ -15,7 +15,8 @@ windows: DESTDIR = $$PWD HEADERS += src/exception.h \ src/globalattributes.h \ - src/pgsqlversions.h + src/pgsqlversions.h \ + src/doublenan.h SOURCES += src/exception.cpp \ src/globalattributes.cpp \ diff --git a/libutils/src/doublenan.h b/libutils/src/doublenan.h new file mode 100644 index 0000000000..c2ae880199 --- /dev/null +++ b/libutils/src/doublenan.h @@ -0,0 +1,27 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libutils +\brief Definition of a shortcut to double NAN used by some portions of pgModeler mainly when dealing with graphical operations +*/ + +#ifndef DOUBLE_NAN_H +#define DOUBLE_NAN_H + # define DNaN (__builtin_nan ("")) +#endif diff --git a/libutils/src/exception.h b/libutils/src/exception.h index e61a73b44a..4ec6d29042 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -27,6 +27,7 @@ #define EXCEPTION_H #include +#include "doublenan.h" #include #include #include From 7f6cdb2012cc1ce83187f13d582290570d9de1bc Mon Sep 17 00:00:00 2001 From: ndotb Date: Wed, 15 May 2019 01:39:32 -0400 Subject: [PATCH 354/425] validation ui: icons, error text greying out icons when warnings or errors=0. error text language set for single or multiple errors --- libpgmodeler_ui/src/modelvalidationwidget.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 8a25aca113..1b3c4c1f55 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -194,6 +194,8 @@ void ModelValidationWidget::clearOutput(void) prog_info_wgt->setVisible(false); fix_btn->setEnabled(false); validation_prog_pb->setValue(0); + warn_lbl->setEnabled(false); + error_lbl->setEnabled(false); warn_count_lbl->setText(QString("%1").arg(0)); error_count_lbl->setText(QString("%1").arg(0)); } @@ -291,7 +293,9 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) .arg(val_info.getObject()->getName(true).remove('"')) .arg(val_info.getObject()->getObjectId())); else if(val_info.getValidationType()==ValidationInfo::SqlValidationError) - label->setText(trUtf8("SQL validation failed due to error(s) below. NOTE: These errors does not invalidates the model but may affect operations like export and diff.")); + label->setText(trUtf8("SQL validation failed due to error%1 below. NOTE: %2 not invalidate the model but may affect operations like export and diff.") + .arg(val_info.getErrors().count() == 1 ? "" : "s") + .arg(val_info.getErrors().count() == 1 ? "This error does" : "These errors do")); else if(val_info.getValidationType() == ValidationInfo::MissingExtension) { Column *col = dynamic_cast(val_info.getObject()); @@ -421,6 +425,8 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) //Stores the validatin on the current tree item item->setData(0, Qt::UserRole, QVariant::fromValue(val_info)); + warn_lbl->setEnabled(validation_helper->getWarningCount() > 0); + error_lbl->setEnabled(validation_helper->getErrorCount() > 0); warn_count_lbl->setText(QString("%1").arg(validation_helper->getWarningCount())); error_count_lbl->setText(QString("%1").arg(validation_helper->getErrorCount())); output_trw->setItemHidden(item, false); @@ -462,18 +468,23 @@ void ModelValidationWidget::updateProgress(int prog, QString msg, ObjectType obj validation_helper->getErrorCount()==0 && validation_helper->getWarningCount()==0) { + error_lbl->setEnabled(false); error_count_lbl->setText(QString::number(0)); fix_btn->setEnabled(false); if(sql_validation_chk->isChecked() && connections_cmb->currentIndex() <= 0) { + warn_lbl->setEnabled(true); warn_count_lbl->setText(QString::number(1)); PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("SQL validation not executed! No connection defined."), QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta"))); } else + { + warn_lbl->setEnabled(false); warn_count_lbl->setText(QString::number(0)); + } PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("Database model successfully validated."), From 8e1e45fc77f1e7a9c3584339137556c695e23eaa Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 15 May 2019 07:45:37 -0300 Subject: [PATCH 355/425] Minor validation message fix --- libpgmodeler_ui/src/modelvalidationwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/modelvalidationwidget.cpp b/libpgmodeler_ui/src/modelvalidationwidget.cpp index 8a25aca113..19c41107b7 100644 --- a/libpgmodeler_ui/src/modelvalidationwidget.cpp +++ b/libpgmodeler_ui/src/modelvalidationwidget.cpp @@ -280,7 +280,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) else ref_name=val_info.getObject()->getName(true).remove('"'); - label->setText(trUtf8("The object %1 (%2) has a name that conflicts with %3 object's name(s).") + label->setText(trUtf8("The object %1 (%2) has a name that conflicts with %3 object name(s).") .arg(ref_name) .arg(val_info.getObject()->getTypeName()) .arg(val_info.getReferences().size())); @@ -291,7 +291,7 @@ void ModelValidationWidget::updateValidation(ValidationInfo val_info) .arg(val_info.getObject()->getName(true).remove('"')) .arg(val_info.getObject()->getObjectId())); else if(val_info.getValidationType()==ValidationInfo::SqlValidationError) - label->setText(trUtf8("SQL validation failed due to error(s) below. NOTE: These errors does not invalidates the model but may affect operations like export and diff.")); + label->setText(trUtf8("SQL validation failed due to the error(s) below. NOTE: Errors during SQL validation don't invalidate the model but may affect operations like export and diff.")); else if(val_info.getValidationType() == ValidationInfo::MissingExtension) { Column *col = dynamic_cast(val_info.getObject()); From 8ce9aee6556286f247ebc308e6ce8e7bbcbf2be2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 15 May 2019 15:22:09 -0300 Subject: [PATCH 356/425] Additional fix in DatabaseModel in order to update FK rels correctly. --- libpgmodeler/src/databasemodel.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index ccad7ce9ec..55c3b6d336 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1181,19 +1181,16 @@ void DatabaseModel::updateTableFKRelationships(Table *table) { if(!table) throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - else if(table->getDatabase()==this) + + if(table->getDatabase()==this) { Table *ref_tab=nullptr; BaseRelationship *rel=nullptr; - Constraint *fk=nullptr; unsigned idx; vector fks; - vector::iterator itr, itr_end; vector::iterator itr1, itr1_end; table->getForeignKeys(fks); - itr=fks.begin(); - itr_end=fks.end(); /* First remove the invalid relationships (the foreign key that generates the relationship no longer exists) */ @@ -1223,8 +1220,8 @@ void DatabaseModel::updateTableFKRelationships(Table *table) * * 2) The fk references the correct table but the source table does not own the fk anymore, which means, * the fk as removed manually by the user. */ - if(fk->getReferencedTable() != ref_tab || - (fk->getReferencedTable() == ref_tab && table->getObjectIndex(fk) < 0)) + if((table->getObjectIndex(fk) >= 0 && fk->getReferencedTable() != ref_tab) || + (table->getObjectIndex(fk) < 0 && fk->getReferencedTable() == ref_tab)) { removeRelationship(rel); itr1=base_relationships.begin() + idx; @@ -1243,11 +1240,9 @@ void DatabaseModel::updateTableFKRelationships(Table *table) } //Creating the relationships from the foreign keys - while(itr!=itr_end) + for(auto &fk : fks) { - fk=(*itr); ref_tab=dynamic_cast
(fk->getReferencedTable()); - itr++; //Only creates the relationship if does'nt exist one between the tables rel=getRelationship(table, ref_tab, fk); From 8539bb8db3afc0496214c960ad801ff74496334f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 15 May 2019 17:18:05 -0300 Subject: [PATCH 357/425] Fixed a bug in DataManipulationForm that was deleting new rows wrongly --- libpgmodeler_ui/src/datamanipulationform.cpp | 10 +++++++--- libpgmodeler_ui/src/datamanipulationform.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 18ae04cdbb..caf334322f 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -1093,7 +1093,7 @@ void DataManipulationForm::duplicateRows(void) } } -void DataManipulationForm::removeNewRows(const vector &ins_rows) +void DataManipulationForm::removeNewRows(vector ins_rows) { if(!ins_rows.empty()) { @@ -1106,8 +1106,12 @@ void DataManipulationForm::removeNewRows(const vector &ins_rows) markOperationOnRow(NoOperation, ins_rows[idx]); //Remove the rows - for(idx=0; idx < cnt; idx++) - results_tbw->removeRow(ins_rows[0]); + std::sort(ins_rows.begin(), ins_rows.end()); + while(!ins_rows.empty()) + { + results_tbw->removeRow(ins_rows.back()); + ins_rows.pop_back(); + } //Reorganizing the changed rows vector to avoid row index out-of-bound errors row_idx=results_tbw->rowCount() - 1; diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 1c53c94070..8f55d44d08 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -97,7 +97,7 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { QString getDMLCommand(int row); //! \brief Remove the rows marked as OP_INSERT which ids are specified on the parameter vector - void removeNewRows(const vector &ins_rows); + void removeNewRows(vector ins_rows); //! \brief Reset the state of changed rows, clearing all attributes used to control the modifications on them void clearChangedRows(void); From 1f364d0ac3ed2e4c7bdaff49104fe1c7a84c0036 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 May 2019 09:54:39 -0300 Subject: [PATCH 358/425] Formatting the path of the bug report file according to the running OS --- libpgmodeler_ui/src/bugreportform.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/bugreportform.cpp b/libpgmodeler_ui/src/bugreportform.cpp index 66f1a3b7ba..f7d775a104 100644 --- a/libpgmodeler_ui/src/bugreportform.cpp +++ b/libpgmodeler_ui/src/bugreportform.cpp @@ -115,7 +115,8 @@ void BugReportForm::generateReport(const QByteArray &buf) output.write(comp_buf.data(), comp_buf.size()); output.close(); - msgbox.show(trUtf8("Bug report successfuly generated! Please, send the file %1 to %2 in order be analyzed. Thank you for the collaboration!").arg(filename).arg(GlobalAttributes::BugReportEmail), + msgbox.show(trUtf8("Bug report successfuly generated! Please, send the file %1 to %2 in order be analyzed. Thank you for the collaboration!") + .arg(QDir::toNativeSeparators(filename)).arg(GlobalAttributes::BugReportEmail), Messagebox::InfoIcon); } } From 2ccab89808c7508db5cf872e340672a52428bc9b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 May 2019 09:55:56 -0300 Subject: [PATCH 359/425] Fixed the diff process in such way to avoid to generate false-positive changes related to table constraints. --- libpgmodeler_ui/src/modelsdiffhelper.cpp | 34 +++++++++++------------- libpgmodeler_ui/src/modelsdiffhelper.h | 9 +++++++ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/libpgmodeler_ui/src/modelsdiffhelper.cpp b/libpgmodeler_ui/src/modelsdiffhelper.cpp index 44a593cf86..a496bd0010 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.cpp +++ b/libpgmodeler_ui/src/modelsdiffhelper.cpp @@ -20,6 +20,18 @@ #include #include "pgmodelerns.h" +const vector ModelsDiffHelper::TableObjsIgnoredAttribs = { Attributes::Alias }; + +const vector ModelsDiffHelper::ObjectsIgnoredAttribs = { + Attributes::MaxObjCount, Attributes::Protected, Attributes::SqlDisabled, + Attributes::RectVisible, Attributes::FillColor, Attributes::FadedOut, + Attributes::CollapseMode, Attributes::AttribsPage, Attributes::ExtAttribsPage, + Attributes::Pagination, Attributes::Alias }; + +const vector ModelsDiffHelper::ObjectsIgnoredTags = { + Attributes::Role, Attributes::Tablespace, Attributes::Collation, + Attributes::Position, Attributes::AppendedSql, Attributes::PrependedSql }; + ModelsDiffHelper::ModelsDiffHelper(void) { diff_canceled=false; @@ -172,7 +184,7 @@ void ModelsDiffHelper::diffTables(Table *src_table, Table *imp_table, unsigned d (constr && constr->getConstraintType()!=ConstraintType::ForeignKey))) { //If there are some differences on the XML code of the objects - if(tab_obj->isCodeDiffersFrom(aux_obj)) + if(tab_obj->isCodeDiffersFrom(aux_obj, TableObjsIgnoredAttribs)) generateDiffInfo(ObjectsDiffInfo::AlterObject, tab_obj, aux_obj); } @@ -317,23 +329,7 @@ void ModelsDiffHelper::diffModels(unsigned diff_type) //If the objects does not differ, try to compare their XML definition if(!objs_differs) - xml_differs=object->isCodeDiffersFrom(aux_object, - { Attributes::MaxObjCount, - Attributes::Protected, - Attributes::SqlDisabled, - Attributes::RectVisible, - Attributes::FillColor, - Attributes::FadedOut, - Attributes::CollapseMode, - Attributes::AttribsPage, - Attributes::ExtAttribsPage, - Attributes::Pagination}, - { Attributes::Role, - Attributes::Tablespace, - Attributes::Collation, - Attributes::Position, - Attributes::AppendedSql, - Attributes::PrependedSql }); + xml_differs=object->isCodeDiffersFrom(aux_object, ObjectsIgnoredAttribs, ObjectsIgnoredTags); //If a difference was detected between the objects if(objs_differs || xml_differs) @@ -440,7 +436,7 @@ void ModelsDiffHelper::diffTableObject(TableObject *tab_obj, unsigned diff_type) else generateDiffInfo(ObjectsDiffInfo::IgnoreObject, tab_obj); } - else if(diff_type!=ObjectsDiffInfo::DropObject && tab_obj->isCodeDiffersFrom(aux_tab_obj)) + else if(diff_type!=ObjectsDiffInfo::DropObject && tab_obj->isCodeDiffersFrom(aux_tab_obj, TableObjsIgnoredAttribs)) generateDiffInfo(ObjectsDiffInfo::AlterObject, tab_obj, aux_tab_obj); } diff --git a/libpgmodeler_ui/src/modelsdiffhelper.h b/libpgmodeler_ui/src/modelsdiffhelper.h index 6130f3acef..62716eb394 100644 --- a/libpgmodeler_ui/src/modelsdiffhelper.h +++ b/libpgmodeler_ui/src/modelsdiffhelper.h @@ -33,6 +33,15 @@ class ModelsDiffHelper: public QObject { private: Q_OBJECT + //! \brief List of attributes ignored when comparing XML code of table children objects + static const vector TableObjsIgnoredAttribs, + + //! \brief List of attributes ignored when comparing XML code of database objects + ObjectsIgnoredAttribs, + + //! \brief List of tags ignored when comparing XML code of database objects + ObjectsIgnoredTags; + //! \brief Stores the SQL code that represents the diff between model and database QString diff_def, From 44048911e6fa389e699cfa36b4a7051968b4864a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 May 2019 11:08:38 -0300 Subject: [PATCH 360/425] Added an option to make the diff GUI less verbose to improve performance on slow systems --- libpgmodeler_ui/src/modeldatabasediffform.cpp | 60 ++++++++++++------- libpgmodeler_ui/src/modeldatabasediffform.h | 2 +- libpgmodeler_ui/ui/modeldatabasediffform.ui | 36 +++++++++++ 3 files changed, 75 insertions(+), 23 deletions(-) diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 90a522689b..5bcd104607 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -97,6 +97,9 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) ignore_error_codes_ht=new HintTextWidget(ignore_extra_errors_hint, this); ignore_error_codes_ht->setText(ignore_error_codes_chk->statusTip()); + less_verbose_ht = new HintTextWidget(less_verbose_hint, this); + less_verbose_ht->setText(less_verbose_chk->statusTip()); + sqlcode_hl=new SyntaxHighlighter(sqlcode_txt); sqlcode_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); @@ -794,9 +797,12 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType { progress_aux = progress/5; - PgModelerUiNs::createOutputTreeItem(output_trw, msg, - QPixmap(PgModelerUiNs::getIconPath(obj_type)), - src_import_item); + if(!less_verbose_chk->isChecked()) + { + PgModelerUiNs::createOutputTreeItem(output_trw, msg, + QPixmap(PgModelerUiNs::getIconPath(obj_type)), + src_import_item); + } } else if(import_thread && import_thread->isRunning()) { @@ -805,9 +811,12 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType else progress_aux = 20 + (progress/5); - PgModelerUiNs::createOutputTreeItem(output_trw, msg, - QPixmap(PgModelerUiNs::getIconPath(obj_type)), - import_item); + if(!less_verbose_chk->isChecked()) + { + PgModelerUiNs::createOutputTreeItem(output_trw, msg, + QPixmap(PgModelerUiNs::getIconPath(obj_type)), + import_item); + } } else if(diff_thread && diff_thread->isRunning()) { @@ -827,15 +836,18 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_aux = diff_progress + (progress/3); - if(obj_type==ObjectType::BaseObject) - ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); - else - ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); + if(!less_verbose_chk->isChecked()) + { + if(obj_type==ObjectType::BaseObject) + ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); + else + ico=QPixmap(PgModelerUiNs::getIconPath(obj_type)); - item=PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico, export_item, false); + item=PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico, export_item, false); - if(!cmd.isEmpty()) - PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); + if(!cmd.isEmpty()) + PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); + } } if(progress_aux > step_pb->value()) @@ -849,29 +861,33 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType else progress_ico_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); - this->repaint(); + //this->repaint(); } void ModelDatabaseDiffForm::updateDiffInfo(ObjectsDiffInfo diff_info) { map buttons={ {ObjectsDiffInfo::CreateObject, create_tb}, - {ObjectsDiffInfo::DropObject, drop_tb}, - {ObjectsDiffInfo::AlterObject, alter_tb}, - {ObjectsDiffInfo::IgnoreObject, ignore_tb} }; + {ObjectsDiffInfo::DropObject, drop_tb}, + {ObjectsDiffInfo::AlterObject, alter_tb}, + {ObjectsDiffInfo::IgnoreObject, ignore_tb} }; unsigned diff_type=diff_info.getDiffType(); QToolButton *btn=buttons[diff_type]; QTreeWidgetItem *item=nullptr; - item=PgModelerUiNs::createOutputTreeItem(output_trw, - PgModelerUiNs::formatMessage(diff_info.getInfoMessage()), - QPixmap(PgModelerUiNs::getIconPath(diff_info.getObject()->getSchemaName())), diff_item); - item->setData(0, Qt::UserRole, diff_info.getDiffType()); + if(!less_verbose_chk->isChecked()) + { + item=PgModelerUiNs::createOutputTreeItem(output_trw, + PgModelerUiNs::formatMessage(diff_info.getInfoMessage()), + QPixmap(PgModelerUiNs::getIconPath(diff_info.getObject()->getSchemaName())), diff_item); + item->setData(0, Qt::UserRole, diff_info.getDiffType()); + } if(diff_helper) btn->setText(QString::number(diff_helper->getDiffTypeCount(diff_type))); - output_trw->setItemHidden(item, !btn->isChecked()); + if(item) + output_trw->setItemHidden(item, !btn->isChecked()); } void ModelDatabaseDiffForm::selectOutputFile(void) diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index 4a816f57dd..94a21d6b1f 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -51,7 +51,7 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { *cascade_mode_ht, *pgsql_ver_ht, *recreate_unmod_ht, *keep_obj_perms_ht, *ignore_duplic_ht, *reuse_sequences_ht, *preserve_db_name_ht, *dont_drop_missing_objs_ht, - *ignore_error_codes_ht, *drop_missing_cols_constr_ht; + *ignore_error_codes_ht, *drop_missing_cols_constr_ht, *less_verbose_ht; //! \brief Syntax highlighter used on the diff preview tab SyntaxHighlighter *sqlcode_hl; diff --git a/libpgmodeler_ui/ui/modeldatabasediffform.ui b/libpgmodeler_ui/ui/modeldatabasediffform.ui index 092b2f0005..7145b27f23 100644 --- a/libpgmodeler_ui/ui/modeldatabasediffform.ui +++ b/libpgmodeler_ui/ui/modeldatabasediffform.ui @@ -1232,6 +1232,42 @@ + + + + + + Reduces the verbosity of the diff process causing a small performance gain on slow systems. + + + Reduce process verbosity + + + + + + + + 0 + 0 + + + + + 22 + 22 + + + + + 22 + 22 + + + + + + From ec090eb7f9b51c8b985a614c0364c6fa8dd1a181 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 May 2019 16:29:14 -0300 Subject: [PATCH 361/425] Start to add support to reduced verbose on diff, export and import --- conf/defaults/pgmodeler.conf | 3 +- conf/dtd/pgmodeler.dtd | 1 + conf/pgmodeler.conf | 3 +- conf/schemas/pgmodeler.sch | 1 + libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libpgmodeler_ui/src/databaseimportform.cpp | 8 + libpgmodeler_ui/src/generalconfigwidget.cpp | 6 + libpgmodeler_ui/src/generalconfigwidget.h | 2 +- libpgmodeler_ui/src/modeldatabasediffform.cpp | 31 +- libpgmodeler_ui/src/modeldatabasediffform.h | 2 +- libpgmodeler_ui/ui/generalconfigwidget.ui | 419 ++++++++++-------- libpgmodeler_ui/ui/modeldatabasediffform.ui | 36 -- 13 files changed, 274 insertions(+), 240 deletions(-) diff --git a/conf/defaults/pgmodeler.conf b/conf/defaults/pgmodeler.conf index 77ed3484cc..ac84116ee6 100644 --- a/conf/defaults/pgmodeler.conf +++ b/conf/defaults/pgmodeler.conf @@ -41,7 +41,8 @@ history-max-length="1000" use-curved-lines="true" compact-view="false" - save-restore-geometry="true"/> + save-restore-geometry="true" + reduce-verbosity="false"/> diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd index 9550fa9113..fcb3b25fc0 100644 --- a/conf/dtd/pgmodeler.dtd +++ b/conf/dtd/pgmodeler.dtd @@ -48,6 +48,7 @@ + diff --git a/conf/pgmodeler.conf b/conf/pgmodeler.conf index 77ed3484cc..ac84116ee6 100644 --- a/conf/pgmodeler.conf +++ b/conf/pgmodeler.conf @@ -41,7 +41,8 @@ history-max-length="1000" use-curved-lines="true" compact-view="false" - save-restore-geometry="true"/> + save-restore-geometry="true" + reduce-verbosity="false"/> diff --git a/conf/schemas/pgmodeler.sch b/conf/schemas/pgmodeler.sch index 68992b4a74..b0a09ab174 100644 --- a/conf/schemas/pgmodeler.sch +++ b/conf/schemas/pgmodeler.sch @@ -51,6 +51,7 @@ $sp [ DatabaseImportForm::DatabaseImportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { @@ -184,6 +185,10 @@ void DatabaseImportForm::importDatabase(void) { try { + QTextStream out(stdout); + out << "Start: " << QDateTime::currentDateTime().toMSecsSinceEpoch() << endl; + + Messagebox msg_box; map> obj_oids; @@ -559,6 +564,9 @@ void DatabaseImportForm::finishImport(const QString &msg) if(!create_model) model_wgt->getOperationList()->removeOperations(); } + + QTextStream out(stdout); + out << "End: " << QDateTime::currentDateTime().toMSecsSinceEpoch() << endl; } void DatabaseImportForm::showEvent(QShowEvent *) diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index b91136c05a..4261200c30 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -133,6 +133,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]=QString(); config_params[Attributes::Configuration][Attributes::AttribsPerPage]=QString(); config_params[Attributes::Configuration][Attributes::ExtAttribsPerPage]=QString(); + config_params[Attributes::Configuration][Attributes::ReduceVerbosity]=QString(); simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this); simp_obj_creation_ht->setText(simple_obj_creation_chk->statusTip()); @@ -188,6 +189,9 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa attribs_per_page_ht=new HintTextWidget(attributes_per_page_hint, this); attribs_per_page_ht->setText(attribs_per_page_spb->statusTip()); + reduce_verbosity_ht = new HintTextWidget(reduce_verbosity_hint, this); + reduce_verbosity_ht->setText(reduce_verbosity_chk->statusTip()); + selectPaperSize(); QList chk_boxes=this->findChildren(); @@ -341,6 +345,7 @@ void GeneralConfigWidget::loadConfiguration(void) save_restore_geometry_chk->setChecked(config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]==Attributes::True); reset_sizes_tb->setEnabled(save_restore_geometry_chk->isChecked()); + reduce_verbosity_chk->setChecked(config_params[Attributes::Configuration][Attributes::ReduceVerbosity]==Attributes::True); int ui_idx = ui_language_cmb->findData(config_params[Attributes::Configuration][Attributes::UiLanguage]); ui_language_cmb->setCurrentIndex(ui_idx >= 0 ? ui_idx : 0); @@ -529,6 +534,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::CompactView]=(BaseObjectView::isCompactViewEnabled() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]=(save_restore_geometry_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::ReduceVerbosity]=(reduce_verbosity_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::File]=QString(); config_params[Attributes::Configuration][Attributes::RecentModels]=QString(); diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index 5f28c402a7..a32a45612b 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -64,7 +64,7 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg *hide_ext_attribs_ht, *hide_table_tags_ht, *hide_rel_name_ht, *code_completion_ht, *use_placeholders_ht, *min_obj_opacity_ht, *autosave_ht, *op_history_ht, *ui_language_ht, *grid_size_ht, - *use_curved_lines_ht, *max_result_rows_ht, *attribs_per_page_ht; + *use_curved_lines_ht, *max_result_rows_ht, *attribs_per_page_ht, *reduce_verbosity_ht; ColorPickerWidget *line_numbers_cp, *line_numbers_bg_cp, *line_highlight_cp; diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 5bcd104607..12f571f5d8 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -97,9 +97,6 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) ignore_error_codes_ht=new HintTextWidget(ignore_extra_errors_hint, this); ignore_error_codes_ht->setText(ignore_error_codes_chk->statusTip()); - less_verbose_ht = new HintTextWidget(less_verbose_hint, this); - less_verbose_ht->setText(less_verbose_chk->statusTip()); - sqlcode_hl=new SyntaxHighlighter(sqlcode_txt); sqlcode_hl->loadConfiguration(GlobalAttributes::SQLHighlightConfPath); @@ -797,12 +794,13 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType { progress_aux = progress/5; - if(!less_verbose_chk->isChecked()) - { + #warning "Verbosity reduction point." + //if(!less_verbose_chk->isChecked()) + //{ PgModelerUiNs::createOutputTreeItem(output_trw, msg, QPixmap(PgModelerUiNs::getIconPath(obj_type)), src_import_item); - } + //} } else if(import_thread && import_thread->isRunning()) { @@ -811,12 +809,13 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType else progress_aux = 20 + (progress/5); - if(!less_verbose_chk->isChecked()) - { + #warning "Verbosity reduction point." + //if(!less_verbose_chk->isChecked()) + //{ PgModelerUiNs::createOutputTreeItem(output_trw, msg, QPixmap(PgModelerUiNs::getIconPath(obj_type)), import_item); - } + //} } else if(diff_thread && diff_thread->isRunning()) { @@ -836,8 +835,9 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_aux = diff_progress + (progress/3); - if(!less_verbose_chk->isChecked()) - { + #warning "Verbosity reduction point." + //if(!less_verbose_chk->isChecked()) + //{ if(obj_type==ObjectType::BaseObject) ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); else @@ -847,7 +847,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType if(!cmd.isEmpty()) PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); - } + //} } if(progress_aux > step_pb->value()) @@ -875,13 +875,14 @@ void ModelDatabaseDiffForm::updateDiffInfo(ObjectsDiffInfo diff_info) QToolButton *btn=buttons[diff_type]; QTreeWidgetItem *item=nullptr; - if(!less_verbose_chk->isChecked()) - { + #warning "Verbosity reduction point." + //if(!less_verbose_chk->isChecked()) + //{ item=PgModelerUiNs::createOutputTreeItem(output_trw, PgModelerUiNs::formatMessage(diff_info.getInfoMessage()), QPixmap(PgModelerUiNs::getIconPath(diff_info.getObject()->getSchemaName())), diff_item); item->setData(0, Qt::UserRole, diff_info.getDiffType()); - } + //} if(diff_helper) btn->setText(QString::number(diff_helper->getDiffTypeCount(diff_type))); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index 94a21d6b1f..4a816f57dd 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -51,7 +51,7 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { *cascade_mode_ht, *pgsql_ver_ht, *recreate_unmod_ht, *keep_obj_perms_ht, *ignore_duplic_ht, *reuse_sequences_ht, *preserve_db_name_ht, *dont_drop_missing_objs_ht, - *ignore_error_codes_ht, *drop_missing_cols_constr_ht, *less_verbose_ht; + *ignore_error_codes_ht, *drop_missing_cols_constr_ht; //! \brief Syntax highlighter used on the diff preview tab SyntaxHighlighter *sqlcode_hl; diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index c20b23fc86..5381830fe6 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -60,6 +60,19 @@ 4 + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -1119,19 +1132,6 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - - @@ -1150,16 +1150,122 @@ 4 - - - - + + + + + + Save/restore dialogs sizes + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 25 + 20 + + + + + + + + false + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 16777215 + + + + Qt::StrongFocus + + + Reset the dialogs sizes and positions to their default values. + + + Reset sizes + + + + :/icones/icones/atualizar.png:/icones/icones/atualizar.png + + + + 22 + 22 + + + + Qt::ToolButtonTextBesideIcon + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 100 + 20 + + + + + + + + + + + 0 + 0 + - - false + + + 22 + 22 + - - true + + + 22 + 22 + + + + + + + + Souce code editor args: @@ -1173,8 +1279,41 @@ - - + + + + + 0 + 0 + + + + + 0 + 0 + + + + SQL history max. length: + + + + + + + Souce code editor: + + + + + + + Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. + + + + + 0 @@ -1194,7 +1333,7 @@ - Browse the source code editor application + Open in file manager @@ -1211,44 +1350,41 @@ - - - - Check if there is a new version on server + + + + + 0 + 0 + - - Check updates at startup + + + 0 + 0 + - - false + + + 16777215 + 16777215 + - - - - - - Configurations directory: + + Browse the source code editor application - - - - - Souce code editor: + - - - - - - Souce code editor args: + + + :/icones/icones/abrir.png:/icones/icones/abrir.png - - - - - - User interface language: + + + 22 + 22 + @@ -1385,94 +1521,35 @@ - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Open in file manager - + + - - - - - :/icones/icones/abrir.png:/icones/icones/abrir.png - - - - 22 - 22 - + Configurations directory: - - - - Overrides the default user interface language defined by the system. Requires restarting the program. <strong>NOTE:</strong> UI translations are third party collaborations thus any typo or mistake should be reported directly to their respective maintainers. + + + + User interface language: - - - - - 0 - 0 - + + + + - - - 0 - 0 - + + false - - SQL history max. length: + + true - - + + @@ -1484,89 +1561,61 @@ - - + + + + Check if there is a new version on server + + + Check updates at startup + + + false + + + + + - + + + Reduces the verbosity of the export, import and diff process causing less information to be displayed in the output in return of some performance gain on slower systems. This options causes less UI operations to be performed so the processes can run faster. + - Save/restore dialogs sizes + Reduce export, import and diff processes verbosity - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 25 - 20 - - - - - - - - false - + - + 0 0 - 0 - 30 + 22 + 22 - - 16777215 - 16777215 - - - - Qt::StrongFocus - - - Reset the dialogs sizes and positions to their default values. - - - Reset sizes - - - - :/icones/icones/atualizar.png:/icones/icones/atualizar.png - - 22 22 - - Qt::ToolButtonTextBesideIcon - - + Qt::Horizontal - - QSizePolicy::Fixed - - 100 + 40 20 diff --git a/libpgmodeler_ui/ui/modeldatabasediffform.ui b/libpgmodeler_ui/ui/modeldatabasediffform.ui index 7145b27f23..092b2f0005 100644 --- a/libpgmodeler_ui/ui/modeldatabasediffform.ui +++ b/libpgmodeler_ui/ui/modeldatabasediffform.ui @@ -1232,42 +1232,6 @@ - - - - - - Reduces the verbosity of the diff process causing a small performance gain on slow systems. - - - Reduce process verbosity - - - - - - - - 0 - 0 - - - - - 22 - 22 - - - - - 22 - 22 - - - - - - From d1d4550f99f8991cec025254fb25c2510a395d29 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 16 May 2019 23:13:31 -0300 Subject: [PATCH 362/425] Applying the reduced verbosity on DatabaseImportForm, ModelDatabaseDiffForm and ModelExportForm. --- conf/defaults/pgmodeler.conf | 2 +- conf/dtd/pgmodeler.dtd | 2 +- conf/pgmodeler.conf | 2 +- conf/schemas/pgmodeler.sch | 2 +- libparsers/src/attributes.cpp | 2 +- libparsers/src/attributes.h | 2 +- libpgmodeler_ui/src/databaseimportform.cpp | 24 +++++++----- libpgmodeler_ui/src/databaseimportform.h | 7 ++++ libpgmodeler_ui/src/generalconfigwidget.cpp | 17 +++++--- libpgmodeler_ui/src/modeldatabasediffform.cpp | 39 +++++++++++-------- libpgmodeler_ui/src/modeldatabasediffform.h | 7 ++++ libpgmodeler_ui/src/modelexportform.cpp | 14 ++++++- libpgmodeler_ui/src/modelexportform.h | 7 ++++ libpgmodeler_ui/ui/generalconfigwidget.ui | 10 ++--- 14 files changed, 94 insertions(+), 43 deletions(-) diff --git a/conf/defaults/pgmodeler.conf b/conf/defaults/pgmodeler.conf index ac84116ee6..e4436cd3b6 100644 --- a/conf/defaults/pgmodeler.conf +++ b/conf/defaults/pgmodeler.conf @@ -42,7 +42,7 @@ use-curved-lines="true" compact-view="false" save-restore-geometry="true" - reduce-verbosity="false"/> + low-verbosity="false"/> diff --git a/conf/dtd/pgmodeler.dtd b/conf/dtd/pgmodeler.dtd index fcb3b25fc0..8d829ddb6a 100644 --- a/conf/dtd/pgmodeler.dtd +++ b/conf/dtd/pgmodeler.dtd @@ -48,7 +48,7 @@ - + diff --git a/conf/pgmodeler.conf b/conf/pgmodeler.conf index ac84116ee6..e4436cd3b6 100644 --- a/conf/pgmodeler.conf +++ b/conf/pgmodeler.conf @@ -42,7 +42,7 @@ use-curved-lines="true" compact-view="false" save-restore-geometry="true" - reduce-verbosity="false"/> + low-verbosity="false"/> diff --git a/conf/schemas/pgmodeler.sch b/conf/schemas/pgmodeler.sch index b0a09ab174..ead482f0f1 100644 --- a/conf/schemas/pgmodeler.sch +++ b/conf/schemas/pgmodeler.sch @@ -51,7 +51,7 @@ $sp [ + +bool DatabaseImportForm::low_verbosity = false; DatabaseImportForm::DatabaseImportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { @@ -104,6 +105,11 @@ void DatabaseImportForm::setModelWidget(ModelWidget *model) import_to_model_chk->setEnabled(model!=nullptr); } +void DatabaseImportForm::setLowVerbosity(bool value) +{ + low_verbosity = value; +} + void DatabaseImportForm::createThread(void) { import_thread=new QThread; @@ -152,7 +158,9 @@ void DatabaseImportForm::updateProgress(int progress, QString msg, ObjectType ob ico=QPixmap(PgModelerUiNs::getIconPath("msgbox_info")); ico_lbl->setPixmap(ico); - PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico); + + if(!low_verbosity) + PgModelerUiNs::createOutputTreeItem(output_trw, msg, ico); } void DatabaseImportForm::setItemCheckState(QTreeWidgetItem *item, int) @@ -185,10 +193,6 @@ void DatabaseImportForm::importDatabase(void) { try { - QTextStream out(stdout); - out << "Start: " << QDateTime::currentDateTime().toMSecsSinceEpoch() << endl; - - Messagebox msg_box; map> obj_oids; @@ -207,6 +211,10 @@ void DatabaseImportForm::importDatabase(void) settings_tbw->setTabEnabled(1, true); settings_tbw->setCurrentIndex(1); + if(low_verbosity) + PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("Low verbosity is set: only key informations and errors will be displayed."), + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), nullptr, false); + getCheckedItems(obj_oids, col_oids); obj_oids[ObjectType::Database].push_back(database_cmb->itemData(database_cmb->currentIndex()).value()); @@ -564,9 +572,6 @@ void DatabaseImportForm::finishImport(const QString &msg) if(!create_model) model_wgt->getOperationList()->removeOperations(); } - - QTextStream out(stdout); - out << "End: " << QDateTime::currentDateTime().toMSecsSinceEpoch() << endl; } void DatabaseImportForm::showEvent(QShowEvent *) @@ -891,7 +896,6 @@ vector DatabaseImportForm::updateObjectsTree(DatabaseImportHe } tree_wgt->addTopLevelItems(groups_list); - //tree_wgt->setSortingEnabled(true); tree_wgt->sortItems(sort_by, Qt::AscendingOrder); tree_wgt->setUpdatesEnabled(true); tree_wgt->blockSignals(false); diff --git a/libpgmodeler_ui/src/databaseimportform.h b/libpgmodeler_ui/src/databaseimportform.h index 018f1d942b..66f69bf309 100644 --- a/libpgmodeler_ui/src/databaseimportform.h +++ b/libpgmodeler_ui/src/databaseimportform.h @@ -34,6 +34,10 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { private: Q_OBJECT + + /*! \brief Indicates if the full output generated during the process should be displayed + * When this attribute is true, only errors and some key info messages are displayed. */ + static bool low_verbosity; //! \brief Custom delegate used to paint html texts in output tree HtmlItemDelegate *htmlitem_del; @@ -94,6 +98,9 @@ class DatabaseImportForm: public QDialog, public Ui::DatabaseImportForm { ~DatabaseImportForm(void); void setModelWidget(ModelWidget *model); + + //! \brief Defines if all the output generated during the import process should be displayed + static void setLowVerbosity(bool value); //! \brief Returns the configured model widget ModelWidget *getModelWidget(void); diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 4261200c30..62aeb52c80 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -25,6 +25,9 @@ #include "numberedtexteditor.h" #include "linenumberswidget.h" #include "sqlexecutionwidget.h" +#include "modeldatabasediffform.h" +#include "databaseimportform.h" +#include "modelexportform.h" map GeneralConfigWidget::config_params; map GeneralConfigWidget::widgets_geom; @@ -133,7 +136,7 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]=QString(); config_params[Attributes::Configuration][Attributes::AttribsPerPage]=QString(); config_params[Attributes::Configuration][Attributes::ExtAttribsPerPage]=QString(); - config_params[Attributes::Configuration][Attributes::ReduceVerbosity]=QString(); + config_params[Attributes::Configuration][Attributes::LowVerbosity]=QString(); simp_obj_creation_ht=new HintTextWidget(simp_obj_creation_hint, this); simp_obj_creation_ht->setText(simple_obj_creation_chk->statusTip()); @@ -189,8 +192,8 @@ GeneralConfigWidget::GeneralConfigWidget(QWidget * parent) : BaseConfigWidget(pa attribs_per_page_ht=new HintTextWidget(attributes_per_page_hint, this); attribs_per_page_ht->setText(attribs_per_page_spb->statusTip()); - reduce_verbosity_ht = new HintTextWidget(reduce_verbosity_hint, this); - reduce_verbosity_ht->setText(reduce_verbosity_chk->statusTip()); + reduce_verbosity_ht = new HintTextWidget(low_verbosity_hint, this); + reduce_verbosity_ht->setText(low_verbosity_chk->statusTip()); selectPaperSize(); @@ -345,7 +348,7 @@ void GeneralConfigWidget::loadConfiguration(void) save_restore_geometry_chk->setChecked(config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]==Attributes::True); reset_sizes_tb->setEnabled(save_restore_geometry_chk->isChecked()); - reduce_verbosity_chk->setChecked(config_params[Attributes::Configuration][Attributes::ReduceVerbosity]==Attributes::True); + low_verbosity_chk->setChecked(config_params[Attributes::Configuration][Attributes::LowVerbosity]==Attributes::True); int ui_idx = ui_language_cmb->findData(config_params[Attributes::Configuration][Attributes::UiLanguage]); ui_language_cmb->setCurrentIndex(ui_idx >= 0 ? ui_idx : 0); @@ -534,7 +537,7 @@ void GeneralConfigWidget::saveConfiguration(void) config_params[Attributes::Configuration][Attributes::CompactView]=(BaseObjectView::isCompactViewEnabled() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::SaveRestoreGeometry]=(save_restore_geometry_chk->isChecked() ? Attributes::True : QString()); - config_params[Attributes::Configuration][Attributes::ReduceVerbosity]=(reduce_verbosity_chk->isChecked() ? Attributes::True : QString()); + config_params[Attributes::Configuration][Attributes::LowVerbosity]=(low_verbosity_chk->isChecked() ? Attributes::True : QString()); config_params[Attributes::Configuration][Attributes::File]=QString(); config_params[Attributes::Configuration][Attributes::RecentModels]=QString(); @@ -654,6 +657,10 @@ void GeneralConfigWidget::applyConfiguration(void) NumberedTextEditor::setSourceEditorAppArgs(source_editor_args_edt->text()); LineNumbersWidget::setColors(line_numbers_cp->getColor(0), line_numbers_bg_cp->getColor(0)); SyntaxHighlighter::setDefaultFont(fnt); + + ModelDatabaseDiffForm::setLowVerbosity(low_verbosity_chk->isChecked()); + DatabaseImportForm::setLowVerbosity(low_verbosity_chk->isChecked()); + ModelExportForm::setLowVerbosity(low_verbosity_chk->isChecked()); } void GeneralConfigWidget::restoreDefaults(void) diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 12f571f5d8..6a91c94f08 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -21,6 +21,8 @@ #include "databaseimportform.h" #include "pgmodeleruins.h" +bool ModelDatabaseDiffForm::low_verbosity = false; + ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { try @@ -173,6 +175,11 @@ void ModelDatabaseDiffForm::setModelWidget(ModelWidget *model_wgt) } } +void ModelDatabaseDiffForm::setLowVerbosity(bool value) +{ + low_verbosity = value; +} + void ModelDatabaseDiffForm::resetForm(void) { ConnectionsConfigWidget::fillConnectionsComboBox(src_connections_cmb, true); @@ -405,6 +412,10 @@ void ModelDatabaseDiffForm::generateDiff(void) clearOutput(); curr_step = 1; + if(low_verbosity) + PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("Low verbosity is set: only key informations and errors will be displayed."), + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), nullptr, false); + if(src_model_rb->isChecked()) { source_model = loaded_model; @@ -794,13 +805,12 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType { progress_aux = progress/5; - #warning "Verbosity reduction point." - //if(!less_verbose_chk->isChecked()) - //{ + if(!low_verbosity) + { PgModelerUiNs::createOutputTreeItem(output_trw, msg, QPixmap(PgModelerUiNs::getIconPath(obj_type)), src_import_item); - //} + } } else if(import_thread && import_thread->isRunning()) { @@ -809,13 +819,12 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType else progress_aux = 20 + (progress/5); - #warning "Verbosity reduction point." - //if(!less_verbose_chk->isChecked()) - //{ + if(!low_verbosity) + { PgModelerUiNs::createOutputTreeItem(output_trw, msg, QPixmap(PgModelerUiNs::getIconPath(obj_type)), import_item); - //} + } } else if(diff_thread && diff_thread->isRunning()) { @@ -835,9 +844,8 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType progress_aux = diff_progress + (progress/3); - #warning "Verbosity reduction point." - //if(!less_verbose_chk->isChecked()) - //{ + if(!low_verbosity) + { if(obj_type==ObjectType::BaseObject) ico=QPixmap(PgModelerUiNs::getIconPath("codigosql")); else @@ -847,7 +855,7 @@ void ModelDatabaseDiffForm::updateProgress(int progress, QString msg, ObjectType if(!cmd.isEmpty()) PgModelerUiNs::createOutputTreeItem(output_trw, cmd, QPixmap(), item, false); - //} + } } if(progress_aux > step_pb->value()) @@ -875,14 +883,13 @@ void ModelDatabaseDiffForm::updateDiffInfo(ObjectsDiffInfo diff_info) QToolButton *btn=buttons[diff_type]; QTreeWidgetItem *item=nullptr; - #warning "Verbosity reduction point." - //if(!less_verbose_chk->isChecked()) - //{ + if(!low_verbosity) + { item=PgModelerUiNs::createOutputTreeItem(output_trw, PgModelerUiNs::formatMessage(diff_info.getInfoMessage()), QPixmap(PgModelerUiNs::getIconPath(diff_info.getObject()->getSchemaName())), diff_item); item->setData(0, Qt::UserRole, diff_info.getDiffType()); - //} + } if(diff_helper) btn->setText(QString::number(diff_helper->getDiffTypeCount(diff_type))); diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index 4a816f57dd..1419608ac5 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -39,6 +39,10 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { private: Q_OBJECT + /*! \brief Indicates if the full output generated during the process should be displayed + * When this attribute is true, only errors and some key info messages are displayed. */ + static bool low_verbosity; + NumberedTextEditor *sqlcode_txt; //! \brief Custom delegate used to paint html texts in output tree @@ -121,6 +125,9 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { void setModelWidget(ModelWidget *model_wgt); + //! \brief Defines if all the output generated during the import process should be displayed + static void setLowVerbosity(bool value); + private slots: void listDatabases(void); void enableDiffMode(void); diff --git a/libpgmodeler_ui/src/modelexportform.cpp b/libpgmodeler_ui/src/modelexportform.cpp index 3a0ff14007..cc947d3531 100644 --- a/libpgmodeler_ui/src/modelexportform.cpp +++ b/libpgmodeler_ui/src/modelexportform.cpp @@ -21,6 +21,8 @@ #include "configurationform.h" #include "pgmodeleruins.h" +bool ModelExportForm::low_verbosity = false; + ModelExportForm::ModelExportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f) { model=nullptr; @@ -108,6 +110,11 @@ ModelExportForm::ModelExportForm(QWidget *parent, Qt::WindowFlags f) : QDialog(p settings_tbw->setTabEnabled(1, false); } +void ModelExportForm::setLowVerbosity(bool value) +{ + low_verbosity = value; +} + void ModelExportForm::exec(ModelWidget *model) { if(model) @@ -150,7 +157,8 @@ void ModelExportForm::updateProgress(int progress, QString msg, ObjectType obj_t ico_lbl->setPixmap(ico); - if(!is_code_gen) + // If low_verbosity is set only messages hinted by obj_type == BaseObject are show because they hold key info messages + if(!is_code_gen && (!low_verbosity || (low_verbosity && obj_type == ObjectType::BaseObject && cmd.isEmpty()))) { item=PgModelerUiNs::createOutputTreeItem(output_trw, text, ico, nullptr, false); @@ -203,6 +211,10 @@ void ModelExportForm::exportModel(void) QString version; Connection *conn=reinterpret_cast(connections_cmb->itemData(connections_cmb->currentIndex()).value()); + if(low_verbosity) + PgModelerUiNs::createOutputTreeItem(output_trw, trUtf8("Low verbosity is set: only key informations and errors will be displayed."), + QPixmap(PgModelerUiNs::getIconPath("msgbox_alerta")), nullptr, false); + //If the user chose a specific version if(pgsqlvers1_cmb->isEnabled()) version=pgsqlvers1_cmb->currentText(); diff --git a/libpgmodeler_ui/src/modelexportform.h b/libpgmodeler_ui/src/modelexportform.h index f8d1881cf4..8688f2a919 100644 --- a/libpgmodeler_ui/src/modelexportform.h +++ b/libpgmodeler_ui/src/modelexportform.h @@ -36,6 +36,10 @@ class ModelExportForm: public QDialog, public Ui::ModelExportForm { private: Q_OBJECT + /*! \brief Indicates if the full output generated during the process should be displayed + * When this attribute is true, only errors and some key info messages are displayed. */ + static bool low_verbosity; + //! \brief Custom delegate used to paint html texts in output tree HtmlItemDelegate *htmlitem_del; @@ -61,6 +65,9 @@ class ModelExportForm: public QDialog, public Ui::ModelExportForm { public: ModelExportForm(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget); + //! \brief Defines if all the output generated during the import process should be displayed + static void setLowVerbosity(bool value); + public slots: void exec(ModelWidget *model); diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 5381830fe6..0e6929b8ee 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -6,7 +6,7 @@ 0 0 - 794 + 795 712 @@ -1577,17 +1577,17 @@ - + - Reduces the verbosity of the export, import and diff process causing less information to be displayed in the output in return of some performance gain on slower systems. This options causes less UI operations to be performed so the processes can run faster. + Reduces the verbosity of the export, import and diff process causing only key info messages and errors to be displayed. This options causes less UI operations to be performed to display progress messages and this can benefit slow systems making these processes run faster. - Reduce export, import and diff processes verbosity + Use low verbosity for export, import and diff processes - + 0 From f6a3935065512c0f504cd2d6af76f3da29c7f548 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 22 May 2019 08:57:12 -0300 Subject: [PATCH 363/425] Limiting the number of recent models in pgmodeler.conf --- libpgmodeler_ui/src/configurationform.cpp | 5 +++-- libpgmodeler_ui/src/generalconfigwidget.cpp | 5 ++++- libpgmodeler_ui/src/generalconfigwidget.h | 3 +++ libpgmodeler_ui/src/mainwindow.cpp | 2 +- libpgmodeler_ui/src/mainwindow.h | 3 --- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/libpgmodeler_ui/src/configurationform.cpp b/libpgmodeler_ui/src/configurationform.cpp index 245a0f6611..e7a9f9d9b1 100644 --- a/libpgmodeler_ui/src/configurationform.cpp +++ b/libpgmodeler_ui/src/configurationform.cpp @@ -30,8 +30,8 @@ ConfigurationForm::ConfigurationForm(QWidget *parent, Qt::WindowFlags f) : QDial plugins_conf=new PluginsConfigWidget(this); QWidgetList wgt_list={ general_conf, relationships_conf, - appearance_conf, connections_conf, - snippets_conf, plugins_conf}; + appearance_conf, connections_conf, + snippets_conf, plugins_conf}; for(int i=GeneralConfWgt; i <= PluginsConfWgt; i++) confs_stw->addWidget(wgt_list[i]); @@ -42,6 +42,7 @@ ConfigurationForm::ConfigurationForm(QWidget *parent, Qt::WindowFlags f) : QDial connect(defaults_btn, SIGNAL(clicked(void)), this, SLOT(restoreDefaults(void))); icons_lst->setCurrentRow(GeneralConfWgt); + setMinimumSize(890, 740); } ConfigurationForm::~ConfigurationForm(void) diff --git a/libpgmodeler_ui/src/generalconfigwidget.cpp b/libpgmodeler_ui/src/generalconfigwidget.cpp index 4261200c30..5762224ca9 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.cpp +++ b/libpgmodeler_ui/src/generalconfigwidget.cpp @@ -461,6 +461,7 @@ void GeneralConfigWidget::saveConfiguration(void) attribs_map attribs; map::iterator itr, itr_end; QString file_sch, root_dir, widget_sch; + int recent_mdl_idx = 0; root_dir=GlobalAttributes::TmplConfigurationDir + GlobalAttributes::DirSeparator; @@ -556,10 +557,12 @@ void GeneralConfigWidget::saveConfiguration(void) schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); } //Checking if the current attribute is a file to be stored in a tag - else if((itr->first).contains(QRegExp(QString("(") + Attributes::Recent + QString(")([0-9]+)")))) + else if(recent_mdl_idx < MaxRecentModels && (itr->first).contains(QRegExp(QString("(") + Attributes::Recent + QString(")([0-9]+)")))) { config_params[Attributes::Configuration][Attributes::RecentModels]+= schparser.convertCharsToXMLEntities(schparser.getCodeDefinition(file_sch, itr->second)); + + recent_mdl_idx++; } else if(itr->first==Attributes::Validator || itr->first==Attributes::ObjectFinder || diff --git a/libpgmodeler_ui/src/generalconfigwidget.h b/libpgmodeler_ui/src/generalconfigwidget.h index a32a45612b..2bd75c551d 100644 --- a/libpgmodeler_ui/src/generalconfigwidget.h +++ b/libpgmodeler_ui/src/generalconfigwidget.h @@ -69,6 +69,9 @@ class GeneralConfigWidget: public BaseConfigWidget, public Ui::GeneralConfigWidg ColorPickerWidget *line_numbers_cp, *line_numbers_bg_cp, *line_highlight_cp; public: + //! \brief Maximum number of files listed as recent models + static constexpr int MaxRecentModels=15; + GeneralConfigWidget(QWidget * parent = nullptr); void saveConfiguration(void); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 1c814e1073..89e0f400fd 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -810,7 +810,7 @@ void MainWindow::updateRecentModelsMenu(void) recent_mdls_menu.clear(); recent_models.removeDuplicates(); - for(int i=0; i < recent_models.size() && i < MaxRecentModels; i++) + for(int i=0; i < recent_models.size() && i < GeneralConfigWidget::MaxRecentModels; i++) { act=recent_mdls_menu.addAction(QFileInfo(recent_models[i]).fileName(),this,SLOT(loadModelFromAction(void))); act->setToolTip(recent_models[i]); diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index cca27abef2..66e34cc982 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -56,9 +56,6 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { private: Q_OBJECT - //! \brief Maximum number of files listed on recent models menu - static constexpr int MaxRecentModels=15; - static constexpr int GeneralActionsCount=8; static constexpr int WelcomeView=0, From ce1a6b62dfefa101098e39d9d539796159a72fd0 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 22 May 2019 09:09:10 -0300 Subject: [PATCH 364/425] Updates on CHANGELOG.md and RELEASENOTES.md --- CHANGELOG.md | 2 +- RELEASENOTES.md | 2 +- libpgmodeler_ui/ui/generalconfigwidget.ui | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02df2e892b..d349059fb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ Change Log v0.9.2-beta ------ -Release date: May 21, 2019
+Release date: May 26, 2019
* [New] Added support to foreign server. * [New] Added support to foreign data wrapper. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index bd94663589..52695844a6 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,7 +1,7 @@ v0.9.2-beta ------ -Release date: May 21, 2019
+Release date: May 26, 2019
Changes since: v0.9.2-alpha1
Summary: a brand new version has come to you after a work of almost five months on it. This one brings important features requested long ago and several patches to improve the tool's usability.
diff --git a/libpgmodeler_ui/ui/generalconfigwidget.ui b/libpgmodeler_ui/ui/generalconfigwidget.ui index 0e6929b8ee..fca73a6de5 100644 --- a/libpgmodeler_ui/ui/generalconfigwidget.ui +++ b/libpgmodeler_ui/ui/generalconfigwidget.ui @@ -1579,10 +1579,10 @@ - Reduces the verbosity of the export, import and diff process causing only key info messages and errors to be displayed. This options causes less UI operations to be performed to display progress messages and this can benefit slow systems making these processes run faster. + Reduces the verbosity of the export, import and diff process causing only key info messages and errors to be displayed. This option causes less UI operations to be performed when displaying progress messages and, as a consequence, it makes these processes run faster. - Use low verbosity for export, import and diff processes + Low verbosity for the export, import and diff processes From 7f5a1316d60a2bed6cc65b71a9635b4f51ea20cb Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 23 May 2019 08:29:22 -0300 Subject: [PATCH 365/425] Minor adjustment on installer scripts --- .../template/packages/io.pgmodeler/meta/installscript.qs | 4 ++-- windeploy.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/template/packages/io.pgmodeler/meta/installscript.qs b/installer/template/packages/io.pgmodeler/meta/installscript.qs index 2b8a80a0ac..4232ae5ff7 100644 --- a/installer/template/packages/io.pgmodeler/meta/installscript.qs +++ b/installer/template/packages/io.pgmodeler/meta/installscript.qs @@ -25,7 +25,7 @@ Component.prototype.createOperations = function() else if (systemInfo.productType === "windows") { mime_update=installdir + "/" + "pgmodeler-cli.exe"; component.addOperation("Execute", "{0,127,255}", mime_update, "-mt", "uninstall"); - component.addOperation("Execute", mime_update, "-mt", "install", "errormessage=** Could not install file association."); + component.addOperation("Execute", "{0,127,255}", mime_update, "-mt", "install"); } else { start_script=installdir + "/" + "start-pgmodeler.sh"; @@ -33,7 +33,7 @@ Component.prototype.createOperations = function() component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); component.addOperation("Execute", "{0,127,255}", mime_update, "uninstall"); - component.addOperation("Execute", mime_update, "install", "errormessage=** Could not install file association."); + component.addOperation("Execute", "{0,127,255}", mime_update, "install"); } } catch (e) { print(e); diff --git a/windeploy.sh b/windeploy.sh index ce00bb0a7c..545e5fcd53 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -14,7 +14,7 @@ BUILD_ALL_OPT='-build-all' BUILD_ALL=0 # Installer settings -FMT_PREFIX="C:\/pgmodeler" +FMT_PREFIX="C:\/Program Files\/pgmodeler" INSTALLER_APP_VER=`echo $DEPLOY_VER | cut -d '-' -f1` INSTALLER_CONF_DIR="$PWD/installer/template/config" INSTALLER_PKG_DIR="$PWD/installer/template/packages" From ec2b7e79e6d1297569fa820bfbf8b8bf15cffef2 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 23 May 2019 16:17:54 -0300 Subject: [PATCH 366/425] Fixed the installer generation whe deploying on Windows --- installer/template/config/config.xml.tmpl | 1 + .../packages/io.pgmodeler/meta/installscript.qs | 13 +++++++++---- .../packages/io.pgmodeler/meta/package.xml.tmpl | 1 + windeploy.sh | 16 ++++------------ 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/installer/template/config/config.xml.tmpl b/installer/template/config/config.xml.tmpl index 0a8b7f9b11..94cba3422c 100644 --- a/installer/template/config/config.xml.tmpl +++ b/installer/template/config/config.xml.tmpl @@ -16,4 +16,5 @@ Classic False uninstall + pgModeler diff --git a/installer/template/packages/io.pgmodeler/meta/installscript.qs b/installer/template/packages/io.pgmodeler/meta/installscript.qs index 4232ae5ff7..30eebce13d 100644 --- a/installer/template/packages/io.pgmodeler/meta/installscript.qs +++ b/installer/template/packages/io.pgmodeler/meta/installscript.qs @@ -23,17 +23,22 @@ Component.prototype.createOperations = function() return; } else if (systemInfo.productType === "windows") { + + component.addOperation("CreateShortcut", "@TargetDir@/pgmodeler.exe", "@StartMenuDir@/pgModeler.lnk", + "workingDirectory=@TargetDir@", "iconPath=@TargetDir@/pgmodeler.exe", + "iconId=0", "description=PostgreSQL Database Modeler"); + mime_update=installdir + "/" + "pgmodeler-cli.exe"; - component.addOperation("Execute", "{0,127,255}", mime_update, "-mt", "uninstall"); - component.addOperation("Execute", "{0,127,255}", mime_update, "-mt", "install"); + component.addOperation("Execute", "{-1,0,127,255}", mime_update, "-mt", "uninstall"); + component.addOperation("Execute", "{-1,0,127,255}", mime_update, "-mt", "install"); } else { start_script=installdir + "/" + "start-pgmodeler.sh"; mime_update=installdir + "/" + "dbm-mime-type.sh"; component.addOperation("Execute", "chmod", "+x", start_script, "errormessage=** Could not set executable flag for file " + start_script); component.addOperation("Execute", "chmod", "+x", mime_update, "errormessage=** Could not set executable flag for file " + mime_update); - component.addOperation("Execute", "{0,127,255}", mime_update, "uninstall"); - component.addOperation("Execute", "{0,127,255}", mime_update, "install"); + component.addOperation("Execute", "{-1,0,127,255}", mime_update, "uninstall"); + component.addOperation("Execute", "{-1,0,127,255}", mime_update, "install"); } } catch (e) { print(e); diff --git a/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl b/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl index 3d11643c38..b2b17a78f8 100644 --- a/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl +++ b/installer/template/packages/io.pgmodeler/meta/package.xml.tmpl @@ -13,4 +13,5 @@ finishmessagewidget.ui + true diff --git a/windeploy.sh b/windeploy.sh index 545e5fcd53..20e835d9d6 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -42,6 +42,7 @@ for param in $@; do X64_BUILD=1 DEST_ARCH="x64" WIN_BITS="64" + BUILD_ARCH_PARAM=$X64_BUILD_OPT fi if [[ "$param" == "$BUILD_ALL_OPT" ]]; then BUILD_ALL=1 @@ -79,7 +80,7 @@ QT_INSTALL_VERSION='5.12.3' QT_BASE_VERSION='5.12.3' QT_PLUGINS_ROOT="$QT_ROOT/share/qt5/plugins" QMAKE_ROOT=$MINGW_ROOT -QT_IFW_ROOT=$MINGW_ROOT +QT_IFW_ROOT=/c/qt-ifw PGSQL_ROOT=$MINGW_ROOT QMAKE_ARGS="-r -spec win32-g++ CONFIG+=release \ XML_INC+=$MINGW_ROOT/../include/libxml2 \ @@ -250,15 +251,6 @@ for plug in $DEP_PLUGINS; do fi done -#$MINGW_ROOT/mingw32-make.exe install >> $LOG 2>&1 - -#if [ $? -ne 0 ]; then -# echo -# echo "** Installation failed!" -# echo -# exit 1 -#fi - echo "Packaging installation..." rm -r $INSTALLER_DATA_DIR >> $LOG 2>&1 @@ -290,7 +282,7 @@ if [ $? -ne 0 ]; then exit 1 fi -$QT_IFW_ROOT/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_ROOT/$PKGNAME.exe" >> $LOG 2>&1 +$QT_IFW_ROOT/bin/binarycreator -v -c $INSTALLER_CONF_DIR/config.xml -p $INSTALLER_PKG_DIR "$DIST_ROOT/$PKGNAME.exe" >> $LOG 2>&1 if [ $? -ne 0 ]; then echo @@ -305,5 +297,5 @@ echo "pgModeler successfully deployed!" echo if [ $BUILD_ALL -eq 1 ]; then - sh windeploy.sh -demo-version + sh windeploy.sh -demo-version $BUILD_ARCH_PARAM fi From 559b012c416c356c6826a8cc07685257699bb6f3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 24 May 2019 09:02:58 -0300 Subject: [PATCH 367/425] Updates on CHANGELOG.md and RELEASENOTES.md for 0.9.2-beta --- CHANGELOG.md | 4 +++- RELEASENOTES.md | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d349059fb4..0a3e40cf33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,9 @@ Change Log v0.9.2-beta ------ -Release date: May 26, 2019
+Release date: May 27, 2019
+* [New] Added support to reduced verbosity on diff, export and import processes in order to improve performance. * [New] Added support to foreign server. * [New] Added support to foreign data wrapper. * [New] Adding missing tootip on ObjectFinderWidget. @@ -48,6 +49,7 @@ v0.9.2-beta * [Change] Fixed the windows deploy script to use newer version of the compiler in 64 bits environment. * [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. * [Change] Adjusted the resize parameters in DataManipulationForm to avoid wrong dialog resizings mainly on Windows. +* [Fix] Fixed a bug in DataManipulationForm that was deleting new rows wrongly. * [Fix] Fixed a bug that was causing domain constraints not to be extracted correctly during reverse engineering. * [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. * [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 52695844a6..0babb1704d 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,10 +1,10 @@ v0.9.2-beta ------ -Release date: May 26, 2019
+Release date: May 27, 2019
Changes since: v0.9.2-alpha1
-Summary: a brand new version has come to you after a work of almost five months on it. This one brings important features requested long ago and several patches to improve the tool's usability.
+Summary: a brand new version has come to you after a work of almost five months. This one brings important features requested long ago and several patches to improve the tool's usability.
pgModeler now supports foreign datawrappers and foreign servers natively. This means that you can create, export, import and diff these kinds of objects. For now, foreign tables aren't supported but the schedule is to release this support until the end of this development cycle when lauching the stable 0.9.2.
@@ -12,7 +12,7 @@ In order to provide a temporary workaround for the lack of foreign table support Now its possible, for instance, create a foreign table from a generic SQL which references a foreign server and any name change on the referenced object will cause the code of the generic SQL (in this case, the foreign table) to be automatically updated avoiding export problems.
-In SQL execution widget it's now possible to quickly filter the result set retrieved from a SQL command. This is useful if you need to filter a small set of data without the need of rewrite the the SQL command to get the desired result. The filter basically matches a keyword against a column of the rows on the result grid updating on-the-fly the data visualization.
+In the SQL execution widget it's now possible to quickly filter the result set retrieved from a SQL command. This is useful if you need to filter a small set of data without the need of rewrite the SQL command to get the desired result. The filter basically matches a keyword against a column of the rows on the result grid updating on-the-fly the data visualization.
This release also brings some changes in the available features: the first is the ability to search for objects in the canvas by matching other attributes not only the name. For instance, you can search items by matching a keyword against object's comments, data types, schemas and some others.
@@ -22,6 +22,7 @@ Now, for the bug fixes, in this release they fix crashes and broken code generat Lastly, some of the key change log entries of this release are listed below. For the complete list of changes/fixes, please, refer to the file CHANGELOG.md.
+* [New] Added support to reduced verbosity on diff, export and import processes in order to improve performance. * [New] Added support to foreign server. * [New] Added support to foreign data wrapper. * [New] Generic SQL objects now support dynamic references to objects which can be used in the definition code. @@ -42,6 +43,7 @@ Lastly, some of the key change log entries of this release are listed below. For * [Change] Allowing copied object to be pasted multiple times. This feature works only with copy/paste operation without remove the pasted objects from the clipboard, for cut/paste the behaviour is unchanged. * [Change] Increased the maximum limit of SQL history. * [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. +* [Fix] Fixed a bug in DataManipulationForm that was deleting new rows wrongly. * [Fix] Fixed a bug that was causing domain constraints not to be extracted correctly during reverse engineering. * [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. * [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. From 297e75496afd64e741b722d81391ff0f1de47286 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 26 May 2019 16:21:16 -0300 Subject: [PATCH 368/425] Starting to add support to user mappings --- libpgconnector/src/catalog.cpp | 2 +- libpgmodeler/libpgmodeler.pro | 2 + libpgmodeler/src/baseobject.cpp | 20 ++- libpgmodeler/src/baseobject.h | 1 + libpgmodeler/src/databasemodel.cpp | 3 +- libpgmodeler/src/databasemodel.h | 3 +- libpgmodeler/src/usermapping.cpp | 80 ++++++++++ libpgmodeler/src/usermapping.h | 47 ++++++ libpgmodeler_ui/res/icones/usermapping.png | Bin 0 -> 2199 bytes .../res/icones/usermapping_grp.png | Bin 0 -> 1992 bytes libpgmodeler_ui/res/resources.qrc | 2 + .../src/newobjectoverlaywidget.cpp | 3 +- libpgmodeler_ui/ui/newobjectoverlaywidget.ui | 138 ++++++++++++------ schemas/sql/usermapping.sch | 42 ++++++ 14 files changed, 284 insertions(+), 59 deletions(-) create mode 100644 libpgmodeler/src/usermapping.cpp create mode 100644 libpgmodeler/src/usermapping.h create mode 100644 libpgmodeler_ui/res/icones/usermapping.png create mode 100644 libpgmodeler_ui/res/icones/usermapping_grp.png create mode 100644 schemas/sql/usermapping.sch diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index a74a6bfc6a..0d121b4de3 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -39,7 +39,7 @@ map Catalog::oid_fields= {ObjectType::Table, "tb.oid"}, {ObjectType::Column, "cl.oid"}, {ObjectType::Constraint, "cs.oid"}, {ObjectType::Rule, "rl.oid"}, {ObjectType::Trigger, "tg.oid"}, {ObjectType::Index, "id.indexrelid"}, {ObjectType::EventTrigger, "et.oid"}, {ObjectType::Policy, "pl.oid"}, {ObjectType::ForeignDataWrapper, "fw.oid"}, - {ObjectType::ForeignServer, "sv.oid"} + {ObjectType::ForeignServer, "sv.oid"}, {ObjectType::UserMapping, "um.umid"} }; map Catalog::ext_oid_fields={ diff --git a/libpgmodeler/libpgmodeler.pro b/libpgmodeler/libpgmodeler.pro index 2cfa2fabdf..22470e0355 100644 --- a/libpgmodeler/libpgmodeler.pro +++ b/libpgmodeler/libpgmodeler.pro @@ -41,6 +41,7 @@ HEADERS += src/textbox.h \ src/basegraphicobject.h \ src/relationship.h \ src/table.h \ + src/usermapping.h \ src/view.h \ src/operatorfamily.h \ src/operatorclasselement.h \ @@ -83,6 +84,7 @@ SOURCES += src/textbox.cpp \ src/language.cpp \ src/role.cpp \ src/sequence.cpp \ + src/usermapping.cpp \ src/view.cpp \ src/conversion.cpp \ src/function.cpp \ diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index a38190e527..47b5bad5e6 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -33,8 +33,9 @@ const QString BaseObject::objs_schemas[BaseObject::ObjectTypeCount]={ "language", "usertype", "tablespace", "opfamily", "opclass", "database","collation", "extension", "eventtrigger", "policy", "foreigndatawrapper", - "foreignserver", "relationship", "textbox", "permission", "parameter", - "typeattribute", "tag", "genericsql", "relationship" + "foreignserver", "usermapping", "relationship", "textbox", + "permission", "parameter", "typeattribute", "tag", + "genericsql", "relationship" }; const QString BaseObject::obj_type_names[BaseObject::ObjectTypeCount]={ @@ -47,9 +48,10 @@ const QString BaseObject::obj_type_names[BaseObject::ObjectTypeCount]={ QT_TR_NOOP("Operator Family"), QT_TR_NOOP("Operator Class"), QT_TR_NOOP("Database"), QT_TR_NOOP("Collation"), QT_TR_NOOP("Extension"), QT_TR_NOOP("Event Trigger"), QT_TR_NOOP("Policy"), QT_TR_NOOP("Foreign Data Wrapper"), - QT_TR_NOOP("Foreign Server"), QT_TR_NOOP("Relationship"), QT_TR_NOOP("Textbox"), QT_TR_NOOP("Permission"), - QT_TR_NOOP("Parameter"), QT_TR_NOOP("Type Attribute"), QT_TR_NOOP("Tag"), - QT_TR_NOOP("Generic SQL"), QT_TR_NOOP("Basic Relationship") + QT_TR_NOOP("Foreign Server"), QT_TR_NOOP("User Mapping"), QT_TR_NOOP("Relationship"), + QT_TR_NOOP("Textbox"), QT_TR_NOOP("Permission"), QT_TR_NOOP("Parameter"), + QT_TR_NOOP("Type Attribute"), QT_TR_NOOP("Tag"), QT_TR_NOOP("Generic SQL"), + QT_TR_NOOP("Basic Relationship") }; const QString BaseObject::objs_sql[BaseObject::ObjectTypeCount]={ @@ -60,7 +62,8 @@ const QString BaseObject::objs_sql[BaseObject::ObjectTypeCount]={ QString("CAST"), QString("LANGUAGE"), QString("TYPE"), QString("TABLESPACE"), QString("OPERATOR FAMILY"), QString("OPERATOR CLASS"), QString("DATABASE"), QString("COLLATION"), QString("EXTENSION"), QString("EVENT TRIGGER"), - QString("POLICY"), QString("FOREIGN DATA WRAPPER"), QString("SERVER") + QString("POLICY"), QString("FOREIGN DATA WRAPPER"), QString("SERVER"), + QString("USER MAPPING") }; /* Initializes the global id which is shared between instances @@ -945,7 +948,7 @@ vector BaseObject::getObjectTypes(bool inc_table_objs, vector::iterator itr; if(inc_table_objs) @@ -973,7 +976,8 @@ vector BaseObject::getChildObjectTypes(ObjectType obj_type) if(obj_type==ObjectType::Database) return(vector()={ ObjectType::Cast, ObjectType::Role, ObjectType::Language, ObjectType::Tablespace, ObjectType::Schema, ObjectType::Extension, - ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::ForeignServer }); + ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::ForeignServer, + ObjectType::UserMapping }); if(obj_type==ObjectType::Schema) return(vector()={ ObjectType::Aggregate, ObjectType::Conversion, ObjectType::Collation, diff --git a/libpgmodeler/src/baseobject.h b/libpgmodeler/src/baseobject.h index 4e045ea299..54869aa534 100644 --- a/libpgmodeler/src/baseobject.h +++ b/libpgmodeler/src/baseobject.h @@ -65,6 +65,7 @@ enum class ObjectType: unsigned { Policy, ForeignDataWrapper, ForeignServer, + UserMapping, Relationship, Textbox, Permission, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 55c3b6d336..82ce3b2800 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -78,7 +78,8 @@ DatabaseModel::DatabaseModel(void) { ObjectType::EventTrigger, &eventtriggers }, { ObjectType::GenericSql, &genericsqls }, { ObjectType::ForeignDataWrapper, &fdata_wrappers }, - { ObjectType::ForeignServer, &servers } + { ObjectType::ForeignServer, &servers }, + { ObjectType::UserMapping, &usermappings } }; } diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 64350612d3..90d8119736 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -132,7 +132,8 @@ class DatabaseModel: public QObject, public BaseObject { eventtriggers, genericsqls, fdata_wrappers, - servers; + servers, + usermappings; /*! \brief Stores the xml definition for special objects. This map is used when revalidating the relationships */ diff --git a/libpgmodeler/src/usermapping.cpp b/libpgmodeler/src/usermapping.cpp new file mode 100644 index 0000000000..7d10bc19d2 --- /dev/null +++ b/libpgmodeler/src/usermapping.cpp @@ -0,0 +1,80 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "usermapping.h" + +UserMapping::UserMapping(void) : ForeignObject() +{ + obj_type = ObjectType::UserMapping; + foreign_server = nullptr; + + attributes[Attributes::Version] = QString(); + attributes[Attributes::Object] = QString(); +} + +void UserMapping::setForeignServer(ForeignServer *server) +{ + foreign_server = server; +} + +ForeignServer *UserMapping::getForeignServer(void) +{ + return(foreign_server); +} + +QString UserMapping::getCodeDefinition(unsigned def_type) +{ + QString code_def=getCachedCode(def_type, false); + if(!code_def.isEmpty()) return(code_def); + + /*attributes[Attributes::Version] = version; + attributes[Attributes::Type] = type; + attributes[Attributes::Fdw] = QString(); + + if(fdata_wrapper) + { + if(def_type == SchemaParser::SqlDefinition) + attributes[Attributes::Fdw] = fdata_wrapper->getName(true); + else + attributes[Attributes::Fdw] = fdata_wrapper->getCodeDefinition(def_type, true); + } + + setOptionsAttribute(def_type); + return(this->BaseObject::__getCodeDefinition(def_type));*/ +} + +QString UserMapping::getAlterDefinition(BaseObject *object) +{ + /*try + { + ForeignServer *server=dynamic_cast(object); + attribs_map attribs; + + attributes[Attributes::AlterCmds] = ForeignObject::getAlterDefinition(server); + + if(this->version != server->version) + attribs[Attributes::Version] = server->version; + + copyAttributes(attribs); + return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + }*/ +} diff --git a/libpgmodeler/src/usermapping.h b/libpgmodeler/src/usermapping.h new file mode 100644 index 0000000000..b5ebc746f3 --- /dev/null +++ b/libpgmodeler/src/usermapping.h @@ -0,0 +1,47 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler +\class Server +\brief Implements the operations to manipulate user mappings on the database. +*/ + +#ifndef USER_MAPPING_H +#define USER_MAPPING_H + +#include "baseobject.h" +#include "foreignserver.h" + +class UserMapping: public ForeignObject { + private: + //! \brief The foreign server which is managed by this user mapping the server + ForeignServer *foreign_server; + + public: + UserMapping(void); + + void setForeignServer(ForeignServer *server); + ForeignServer *getForeignServer(void); + + virtual QString getCodeDefinition(unsigned def_type); + virtual QString getAlterDefinition(BaseObject *object); + +}; + +#endif diff --git a/libpgmodeler_ui/res/icones/usermapping.png b/libpgmodeler_ui/res/icones/usermapping.png new file mode 100644 index 0000000000000000000000000000000000000000..05f14c58087c09959d333e251759ca5e2225817b GIT binary patch literal 2199 zcmV;I2x#|-P)QtRplMWKhJr&Z@u@PdoQ=Wg}y^7LJ?YF4lSZ%7+%&8MTu_CY=cF~7M;3H zv$=)r50E^P?+@f&`PRInD1PctQ(h9Dv6f3>Aw7tFMzMgZ>+y1acQKOmE z-^s~&&Uwyrp6~N}e&65kdjub`+u8{rJMhwN(X{b%y z1F-jg@5+DNPH?&bC{vA4g_gjvkR%C3kr4u1SE4>v_V+%y-1Yhcl#5x8%^lsl``>-n z{rpATX$4RyX3yq}5k|(+oXh6O7YfKujwOqi%AQ~X$rD1&C-M2zudi6D@8-q#S4}H` zmqhWG@sYyqg?tWKkudZ!m()e@cq>q~*(jk|fQyxVpUOmCJG?)ATX6MtEN;8((u410 z2B{qP5t2RVrcG_Fi(?jXj0~3R;FNQ?mJY(JPFoBtTZXTxv2JhKI^(SfyX1lf10#8S zArEy%lFN-+jL~i+#fMc&Be2MwEA&ho3xZL9WxUF-8HS1NfFe80s*#CB44zAWm&2!B ztlSV*b^weFsl1Q-Utg|I7XYz#eW2xT!SHBK{{8)u}y5tAeS$a z&RLv2XX4lvu49oLJtq_)woV5NoHq`ezj@2_*uSOefh@UYT-~^Q6(=z01}c= zoOHI3%@6lIp6-6`QJ{2DEC9TUN2txWxY670UjE3ynv1x3#>mpBjCJxMyB-!gY zwh5$xQ$Q9l0Oz6r2!VXXN+KH`y7n#IC>p<5dZZQbNGg(JVgR1WNu2xcyKikU7+k3+ ziXI4rY;T~#waNx%qxgxBevVbxj(qqhKmO5Q6xYSRd{gX+y6QzWyLLVG!sMz<$3*Yg zuKs=356o`?^5)H(mvnS=JiTz?LS)55eqxldv+pq@(Lg8?$1EG?CwCm@0uYX4BZN5r z%`_RTUR->`4_QgQ`fJNhNX;faXnj47Cq@@6o8#OcQQ6MhT}MdLLtV+ z#<=y{w{g6?NMGNp_&m>2HVfSR%}4QiLxA%^IsQ-I-hq~;`(t@?jQ06!1f#H1!nj*WMmc()6m9Kv*TWS>iYT|HW*SE!PY zpc3c3(lMGAMfl;f3wWbvC%%>tz2O1ou3k)6_e*s5yiR3h0!fk(Lg2bCLI`wSN7FQ- z(J(bN4a}TX`$0^&?uVlEwR;$T<@htdN)0DnpA<$+9YO+J8UssEgomM050@=!p}eR_ zx!@rYYbKM4cBR#Ne!h@q-x5#ha1-2#mW`8AS6LBSV1@( zMo|=^(I|mH07X%-Z5yxGi{m&bib6J<<>=9)Pk(C0Sn(LE5zJ|AT(WKcg1M-YkKxoX zflM>&7ygt|$t0B;p`pH>VyT3p2s%3t(9+U^Wm#l08I~?xN@r&$e!rhoDn(sg9sT|N zG&MC5i^Y&-nQhy)tx-M=z`ncK4bZlWZ63)-Ds`44uk>&I^@c|t7#|;JXlRIi`}Wb^ z-cBZyA(2RM;J^W5u^5J7FgQ5KvSrISdGaLDXq4{mZe&@ev$K;xAb{(-R99DDsER+$ z9O2OWZg2UmzC$ey!*?`KMYm;HtXZ>$Xf#SyRTX}}pH-_?QB_riZQDd55z^^2t*x!7 zs!BW_Cmasb(a}LJmqU`y{|^c2vj7aFPH^b$1G9GCVfH(YgX_9Tl7y@vLSULErfIT&|9%3200RR97=}SUpGQ?y6h%Rn&xfA-*&cA5hF9(+4G;(f z%wn-fTU#6R=FJ13wYBx*?_W@iEX!iak|nsVdqJO~C>%R>3`vqczidreFc^$%-MaNp znxkmQ(XUe6`bPuNAtnQs--`fO#W-jmMwRQ|3^Pg#!M6lO;XtX0{X)SOrQvq Z{s*;Mg&~Wf@BIJ(002ovPDHLkV1lI`8>avO literal 0 HcmV?d00001 diff --git a/libpgmodeler_ui/res/icones/usermapping_grp.png b/libpgmodeler_ui/res/icones/usermapping_grp.png new file mode 100644 index 0000000000000000000000000000000000000000..289d9b0ffc8bcfa0165d00c7db6128e6f188973e GIT binary patch literal 1992 zcmV;(2RHbMP)7%zUd=dggfNcw@DwvY} zmlX?((?2tNYL-1M`8>eE4P*l}9ViqYlmG*OBQvwYY!pZ`nJ`Ea8Ob`=4=vM8rX-rG zdOPOqX_@h$1V{k!(MU)BB+HYbpdX*#&&+}x!C9~jlYItqVkl$BvXmLWJT-Xyfe4s9 z9b?tz!ZV%G{z=gxouOcyS@{{*(p~iR^>O-K9oPGVMN5jz=gwY@^nUCNJY1E#AfXH{ zu%yFHM*!cX5iSjiT&q1v$F&BQ&M%^@IM?`~xG=<&h>N(2qUxBW81>#=bjXiU-t!#G zrj9;vF2r!a)De%FK(`Q!+p)RU5DW%6Z`?_*CqQ#+8@+w~6iv?&GxC;TomxpomUDXZ zOLKnzu`u8p4tnF`hTq<3i*|MQS^8wh;_~=-m{}>W&>w5%L31Gv49G8=%0R^h^xfLbxdN6M(<9J zMD}r_-OWUP@$lv~gG~oY+UM+P)9>4gEjbwXzqP8yH{uocFK?=pt)xD*%3k427fzeZ zI+`ZXpLCGXXaYe?u${eRrb>*Dk2AY4hsh;X2u2Ihp10`>So=C{pTBI9FYbMO(}CuD z+JQZ+kspa?)oT6jfv0k}o~N8jJ%sg_gPtu6>pA3 zb9O_`+~SHVRac2=AtK{J21Bik1&8r^BaBx25KZIAnvIWgA(~Ry`*VB7oKjDL5}|Ft&(d{Y#peq!$>k)^ZKI{733GB8 z9XFyR;$9Xlo_|*^{-bl_A*)Fgr6XliDpUU#7Y0j^Joh}NwHICc0brp#Q*icR1A*Xnd#Cy_{CG#a^+i(h&x z0LM{yVVip?@Sxv3o4aZG-YUa^p3mFwyvEwqUtw&_hpvOFsyLla?DkAV zQ9@M{XsU{IF9KRm#MQ|wVsD&mXnVIXC4Xf?3}&TTGCP_ZyD~@GSBQr1G+AG1B=MJxiM%wy<}0< ztnF@R4oQOrJeL0~(dCe2Nge9W6SkGi@#{C+>Fsj0}ajLYRhk|YfG zTfhIEi;DM)ws-e*pC}mHb}JUvo@i>ijLl|4QB*oQI z1Obc1f+&g~{*3;g*m%flYHY7P{`BRV&syb-m>@t_RyIbX35&%-Nl6J7iv^dicones/foreigndatawrapper.png icones/foreignserver.png icones/foreignserver_grp.png + icones/usermapping.png + icones/usermapping_grp.png imagens/model2sql.png diff --git a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp index d65607ec91..a272afd0c4 100644 --- a/libpgmodeler_ui/src/newobjectoverlaywidget.cpp +++ b/libpgmodeler_ui/src/newobjectoverlaywidget.cpp @@ -58,7 +58,8 @@ NewObjectOverlayWidget::NewObjectOverlayWidget(ModelWidget *parent): QWidget(par { policy_tb, std::make_tuple(trUtf8("9"), ObjectType::Policy) }, { genericsql_tb, std::make_tuple(trUtf8("8"), ObjectType::GenericSql) }, { fdw_tb, std::make_tuple(trUtf8("7"), ObjectType::ForeignDataWrapper) }, - { server_tb, std::make_tuple(trUtf8("6"), ObjectType::ForeignServer) }}; + { server_tb, std::make_tuple(trUtf8("6"), ObjectType::ForeignServer) }, + { user_mapping_tb, std::make_tuple(trUtf8("5"), ObjectType::UserMapping) }}; map> rel_shortcuts={ { rel11_tb, std::make_tuple(trUtf8("1"), 0) }, diff --git a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui index 0b460d2454..7d5d85b21d 100644 --- a/libpgmodeler_ui/ui/newobjectoverlaywidget.ui +++ b/libpgmodeler_ui/ui/newobjectoverlaywidget.ui @@ -124,8 +124,8 @@ 6 - - + + 0 @@ -148,11 +148,11 @@ Qt::NoFocus - Extension + Generic SQL - :/icones/icones/extension.png:/icones/icones/extension.png + :/icones/icones/genericsql.png:/icones/icones/genericsql.png @@ -168,8 +168,8 @@ - - + + 0 @@ -192,11 +192,11 @@ Qt::NoFocus - Event Trigger + Extension - :/icones/icones/eventtrigger.png:/icones/icones/eventtrigger.png + :/icones/icones/extension.png:/icones/icones/extension.png @@ -256,8 +256,8 @@ - - + + 0 @@ -280,11 +280,11 @@ Qt::NoFocus - Cast + Permissions - :/icones/icones/cast.png:/icones/icones/cast.png + :/icones/icones/permission.png:/icones/icones/permission.png @@ -292,9 +292,6 @@ 32 - - A - QToolButton::InstantPopup @@ -303,8 +300,8 @@ - - + + 0 @@ -327,11 +324,11 @@ Qt::NoFocus - Permissions + Role - :/icones/icones/permission.png:/icones/icones/permission.png + :/icones/icones/role.png:/icones/icones/role.png @@ -347,8 +344,8 @@ - - + + 0 @@ -371,11 +368,11 @@ Qt::NoFocus - Textbox + Server - :/icones/icones/textbox.png:/icones/icones/textbox.png + :/icones/icones/foreignserver.png:/icones/icones/foreignserver.png @@ -391,8 +388,8 @@ - - + + 0 @@ -415,11 +412,11 @@ Qt::NoFocus - Tag + Schema - :/icones/icones/tag.png:/icones/icones/tag.png + :/icones/icones/schema.png:/icones/icones/schema.png @@ -435,8 +432,8 @@ - - + + 0 @@ -459,11 +456,11 @@ Qt::NoFocus - Tablespace + Event Trigger - :/icones/icones/tablespace.png:/icones/icones/tablespace.png + :/icones/icones/eventtrigger.png:/icones/icones/eventtrigger.png @@ -523,8 +520,8 @@ - - + + 0 @@ -547,11 +544,58 @@ Qt::NoFocus - Generic SQL + Cast - :/icones/icones/genericsql.png:/icones/icones/genericsql.png + :/icones/icones/cast.png:/icones/icones/cast.png + + + + 32 + 32 + + + + A + + + QToolButton::InstantPopup + + + Qt::ToolButtonTextUnderIcon + + + + + + + + 0 + 0 + + + + + 95 + 50 + + + + + 50 + false + + + + Qt::NoFocus + + + Tablespace + + + + :/icones/icones/tablespace.png:/icones/icones/tablespace.png @@ -567,8 +611,8 @@ - - + + 0 @@ -591,11 +635,11 @@ Qt::NoFocus - Role + Tag - :/icones/icones/role.png:/icones/icones/role.png + :/icones/icones/tag.png:/icones/icones/tag.png @@ -611,8 +655,8 @@ - - + + 0 @@ -635,11 +679,11 @@ Qt::NoFocus - Schema + Textbox - :/icones/icones/schema.png:/icones/icones/schema.png + :/icones/icones/textbox.png:/icones/icones/textbox.png @@ -655,8 +699,8 @@ - - + + 0 @@ -679,11 +723,11 @@ Qt::NoFocus - Server + User mapping - :/icones/icones/foreignserver.png:/icones/icones/foreignserver.png + :/icones/icones/usermapping.png:/icones/icones/usermapping.png diff --git a/schemas/sql/usermapping.sch b/schemas/sql/usermapping.sch new file mode 100644 index 0000000000..b9285fb1e1 --- /dev/null +++ b/schemas/sql/usermapping.sch @@ -0,0 +1,42 @@ +# SQL definition for schemas +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[-- object: ] {name} [ | type: ] {sql-object} [ --] $br + +[-- ] {drop} + +%if {prepended-sql} %then + {prepended-sql} + $br [-- ddl-end --] $br $br +%end + +[CREATE SERVER ] {name} + +%if {type} %then + [ TYPE ] '{type}' +%end + +%if {version} %then + [ VERSION ] '{version}' +%end + +$br [FOREIGN DATA WRAPPER ] {fdw} + +%if {options} %then + $br [OPTIONS (] {options} ) +%end + +; + +$br [-- ddl-end --] $br + +%if {owner} %then {owner} %end +%if {comment} %then {comment} %end + +%if {appended-sql} %then + {appended-sql} + $br [-- ddl-end --] $br +%end + +$br From eadc5b7330a7fd11dc1a4e5b5e986a318ccb2f08 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 26 May 2019 18:33:18 -0300 Subject: [PATCH 369/425] User mapping class is now able to generate SQL and XML code --- libparsers/src/attributes.cpp | 1 + libparsers/src/attributes.h | 1 + libpgmodeler/src/databasemodel.cpp | 34 +++ libpgmodeler/src/databasemodel.h | 6 + libpgmodeler/src/pgmodelerns.cpp | 3 + libpgmodeler/src/usermapping.cpp | 50 +++-- libpgmodeler/src/usermapping.h | 9 + schemas/alter/usermapping.sch | 25 +++ schemas/catalog/usermapping.sch | 58 ++++++ schemas/sql/foreignserver.sch | 2 +- schemas/sql/usermapping.sch | 17 +- schemas/xml/usermapping.sch | 30 +++ tests/src/usermappingtest/usermappingtest.cpp | 197 ++++++++++++++++++ tests/src/usermappingtest/usermappingtest.pro | 2 + tests/tests.pro | 3 +- 15 files changed, 409 insertions(+), 29 deletions(-) create mode 100644 schemas/alter/usermapping.sch create mode 100644 schemas/catalog/usermapping.sch create mode 100644 schemas/xml/usermapping.sch create mode 100644 tests/src/usermappingtest/usermappingtest.cpp create mode 100644 tests/src/usermappingtest/usermappingtest.pro diff --git a/libparsers/src/attributes.cpp b/libparsers/src/attributes.cpp index b776f1a835..ff678d39cc 100644 --- a/libparsers/src/attributes.cpp +++ b/libparsers/src/attributes.cpp @@ -476,6 +476,7 @@ namespace Attributes { SelectObjects=QString("select-objects"), SendFunc=QString("send"), Sequence=QString("sequence"), + Server=QString("server"), ServerEncoding=QString("server-encoding"), ServerVersion=QString("server-version"), ServerPid=QString("server-pid"), diff --git a/libparsers/src/attributes.h b/libparsers/src/attributes.h index 113606778b..2d0f8a6cf1 100644 --- a/libparsers/src/attributes.h +++ b/libparsers/src/attributes.h @@ -485,6 +485,7 @@ namespace Attributes { SelectObjects, SendFunc, Sequence, + Server, ServerEncoding, ServerVersion, ServerPid, diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 82ce3b2800..75cbf058ae 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -1121,6 +1121,40 @@ ForeignServer *DatabaseModel::getServer(const QString &name) return(dynamic_cast(getObject(name, ObjectType::ForeignServer))); } +void DatabaseModel::addUserMapping(UserMapping *usrmap, int obj_idx) +{ + try + { + __addObject(usrmap, obj_idx); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void DatabaseModel::removeUserMapping(ForeignServer *usrmap, int obj_idx) +{ + try + { + __removeObject(usrmap, obj_idx); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(), e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); + } +} + +UserMapping *DatabaseModel::getUserMapping(unsigned obj_idx) +{ + return(dynamic_cast(getObject(obj_idx, ObjectType::UserMapping))); +} + +UserMapping *DatabaseModel::getUserMapping(const QString &name) +{ + return(dynamic_cast(getObject(name, ObjectType::UserMapping))); +} + void DatabaseModel::removeExtension(Extension *extension, int obj_idx) { try diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index 90d8119736..b82a995d41 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -56,6 +56,7 @@ Additionally, this class, saves, loads and generates the XML/SQL definition of a #include "genericsql.h" #include "foreigndatawrapper.h" #include "foreignserver.h" +#include "usermapping.h" #include #include @@ -506,6 +507,11 @@ class DatabaseModel: public QObject, public BaseObject { ForeignServer *getServer(unsigned obj_idx); ForeignServer *getServer(const QString &name); + void addUserMapping(UserMapping *usrmap, int obj_idx=-1); + void removeUserMapping(ForeignServer *usrmap, int obj_idx=-1); + UserMapping *getUserMapping(unsigned obj_idx); + UserMapping *getUserMapping(const QString &name); + void addPermission(Permission *perm); void removePermission(Permission *perm); diff --git a/libpgmodeler/src/pgmodelerns.cpp b/libpgmodeler/src/pgmodelerns.cpp index b30f0749bc..f91bf74e47 100644 --- a/libpgmodeler/src/pgmodelerns.cpp +++ b/libpgmodeler/src/pgmodelerns.cpp @@ -156,6 +156,9 @@ namespace PgModelerNs { case ObjectType::ForeignServer: copyObject(psrc_obj, dynamic_cast(copy_obj)); break; + case ObjectType::UserMapping: + copyObject(psrc_obj, dynamic_cast(copy_obj)); + break; default: throw Exception(ErrorCode::OprObjectInvalidType,__PRETTY_FUNCTION__,__FILE__,__LINE__); } diff --git a/libpgmodeler/src/usermapping.cpp b/libpgmodeler/src/usermapping.cpp index 7d10bc19d2..10a8399174 100644 --- a/libpgmodeler/src/usermapping.cpp +++ b/libpgmodeler/src/usermapping.cpp @@ -22,14 +22,18 @@ UserMapping::UserMapping(void) : ForeignObject() { obj_type = ObjectType::UserMapping; foreign_server = nullptr; + role = nullptr; + setName(""); - attributes[Attributes::Version] = QString(); - attributes[Attributes::Object] = QString(); + attributes[Attributes::Role] = QString(); + attributes[Attributes::Server] = QString(); } void UserMapping::setForeignServer(ForeignServer *server) { + setCodeInvalidated(foreign_server != server); foreign_server = server; + setName(""); } ForeignServer *UserMapping::getForeignServer(void) @@ -37,25 +41,41 @@ ForeignServer *UserMapping::getForeignServer(void) return(foreign_server); } +void UserMapping::setRole(Role *role) +{ + setCodeInvalidated(this->role != role); + this->role = role; + setName(""); +} + +void UserMapping::setName(const QString &) +{ + //Configures a fixed name for the user mapping (in form: role@server) + this->obj_name=QString("%1@%2").arg(role ? role->getName() : QString("public")) + .arg(foreign_server ? foreign_server->getName() : QString()); +} + +QString UserMapping::getName(bool, bool) +{ + return(this->obj_name); +} + +QString UserMapping::getSignature(bool) +{ + return(QString("FOR %1 SERVER %2").arg(role ? role->getName() : QString("public")) + .arg(foreign_server ? foreign_server->getName() : QString())); +} + QString UserMapping::getCodeDefinition(unsigned def_type) { QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - /*attributes[Attributes::Version] = version; - attributes[Attributes::Type] = type; - attributes[Attributes::Fdw] = QString(); - - if(fdata_wrapper) - { - if(def_type == SchemaParser::SqlDefinition) - attributes[Attributes::Fdw] = fdata_wrapper->getName(true); - else - attributes[Attributes::Fdw] = fdata_wrapper->getCodeDefinition(def_type, true); - } - + attributes[Attributes::Role] = role ? role->getName(def_type == SchemaParser::SqlDefinition) : QString(); + attributes[Attributes::Server] = foreign_server ? foreign_server->getName(def_type == SchemaParser::SqlDefinition) : QString(); setOptionsAttribute(def_type); - return(this->BaseObject::__getCodeDefinition(def_type));*/ + + return(this->BaseObject::__getCodeDefinition(def_type)); } QString UserMapping::getAlterDefinition(BaseObject *object) diff --git a/libpgmodeler/src/usermapping.h b/libpgmodeler/src/usermapping.h index b5ebc746f3..7599ecbd34 100644 --- a/libpgmodeler/src/usermapping.h +++ b/libpgmodeler/src/usermapping.h @@ -33,12 +33,21 @@ class UserMapping: public ForeignObject { //! \brief The foreign server which is managed by this user mapping the server ForeignServer *foreign_server; + //! \brief The role mapped to this user mapping (if the roles is null means that the user mapping is for PUBLIC) + Role *role; + public: UserMapping(void); void setForeignServer(ForeignServer *server); ForeignServer *getForeignServer(void); + void setRole(Role *role); + Role *getRole(void); + + virtual void setName(const QString &); + virtual QString getName(bool = false, bool = false); + virtual QString getSignature(bool = false); virtual QString getCodeDefinition(unsigned def_type); virtual QString getAlterDefinition(BaseObject *object); diff --git a/schemas/alter/usermapping.sch b/schemas/alter/usermapping.sch new file mode 100644 index 0000000000..528ce6b27d --- /dev/null +++ b/schemas/alter/usermapping.sch @@ -0,0 +1,25 @@ +# SQL definition for foreign sever's attributes change +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +{alter-cmds} + +%if {has-changes} %then + [ALTER ] {sql-object} $sp {signature} + + %if {version} %then + [ VERSION ] '{version}' + + %end + + %if {options} %then + $br $tb + [ OPTIONS (] {options} [)] + %end + +; $br + +[-- ddl-end --] $br + +%end + diff --git a/schemas/catalog/usermapping.sch b/schemas/catalog/usermapping.sch new file mode 100644 index 0000000000..251c83a5d3 --- /dev/null +++ b/schemas/catalog/usermapping.sch @@ -0,0 +1,58 @@ +# Catalog queries for user mapping +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +%if {list} %then + [ SELECT um.umid, um.usename || '@' || um.srvname AS name FROM pg_user_mappings AS um ] + + %if {last-sys-oid} %or {not-ext-object} %then + [ WHERE ] + + %if {last-sys-oid} %then + [ um.umid ] {oid-filter-op} $sp {last-sys-oid} + %end + + %if {not-ext-object} %then + + %if {last-sys-oid} %then + [ AND ] + %end + + ( {not-ext-object} ) + %end + %end +%else + # %if {attribs} %then + # [SELECT oid, srvname AS name, srvversion AS version, srvtype AS type, + # srvfdw AS fdw, srvacl AS permission, srvowner AS owner, + # srvoptions AS options, ] + + # ({comment}) [ AS comment ] + + # [ FROM pg_foreign_server AS sv ] + + # %if {last-sys-oid} %then + # [ WHERE oid ] {oid-filter-op} $sp {last-sys-oid} + # %end + + # %if {not-ext-object} %then + # %if {last-sys-oid} %then + # [ AND ] + # %else + # [ WHERE ] + # %end + + # ( {not-ext-object} ) + # %end + + # %if {filter-oids} %then + # %if {last-sys-oid} %or {not-ext-object} %then + # [ AND ] + # %else + # [ WHERE ] + # %end + + # [ oid IN (] {filter-oids} ) + # %end + # %end +%end diff --git a/schemas/sql/foreignserver.sch b/schemas/sql/foreignserver.sch index b9285fb1e1..7d8462edfe 100644 --- a/schemas/sql/foreignserver.sch +++ b/schemas/sql/foreignserver.sch @@ -1,4 +1,4 @@ -# SQL definition for schemas +# SQL definition for foreign server # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. diff --git a/schemas/sql/usermapping.sch b/schemas/sql/usermapping.sch index b9285fb1e1..31cb5e88da 100644 --- a/schemas/sql/usermapping.sch +++ b/schemas/sql/usermapping.sch @@ -1,4 +1,4 @@ -# SQL definition for schemas +# SQL definition for user mapping # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. @@ -11,27 +11,20 @@ $br [-- ddl-end --] $br $br %end -[CREATE SERVER ] {name} +[CREATE USER MAPPING FOR ] -%if {type} %then - [ TYPE ] '{type}' -%end - -%if {version} %then - [ VERSION ] '{version}' -%end +%if {role} %then {role} %else PUBLIC %end $br -$br [FOREIGN DATA WRAPPER ] {fdw} +[SERVER ] {server} %if {options} %then - $br [OPTIONS (] {options} ) + $br [OPTIONS (] {options} ) %end ; $br [-- ddl-end --] $br -%if {owner} %then {owner} %end %if {comment} %then {comment} %end %if {appended-sql} %then diff --git a/schemas/xml/usermapping.sch b/schemas/xml/usermapping.sch new file mode 100644 index 0000000000..9209c120dc --- /dev/null +++ b/schemas/xml/usermapping.sch @@ -0,0 +1,30 @@ +# XML definition for user mappings +# CAUTION: Do not modify this file unless you know what you are doing. +# Code generation can be broken if incorrect changes are made. + +[ $br + +%if {appended-sql} %then {appended-sql} %end +%if {prepended-sql} %then {prepended-sql} %end + + $br $br diff --git a/tests/src/usermappingtest/usermappingtest.cpp b/tests/src/usermappingtest/usermappingtest.cpp new file mode 100644 index 0000000000..4a8211c885 --- /dev/null +++ b/tests/src/usermappingtest/usermappingtest.cpp @@ -0,0 +1,197 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include +#include "databasemodel.h" + +class UserMappingTest: public QObject { + private: + Q_OBJECT + + private slots: + void generatesNameCorrectly(void); + void codeGeneratedIsWellFormed(void); + void modelReturnsDepsAndRefsForUserMapping(void); + void modelCreatesUserMappingfromXMLandResultingXMLisEqual(void); +}; + +void UserMappingTest::generatesNameCorrectly(void) +{ + ForeignDataWrapper fdw; + ForeignServer server; + Role role; + UserMapping usr_mapping; + + role.setName("postgres"); + fdw.setName("fdw"); + + server.setName("server_test"); + server.setOwner(&role); + server.setForeignDataWrapper(&fdw); + + QCOMPARE(usr_mapping.getName(), "public@"); + + usr_mapping.setForeignServer(&server); + QCOMPARE(usr_mapping.getName(), "public@server_test"); + + usr_mapping.setRole(&role); + QCOMPARE(usr_mapping.getName(), "postgres@server_test"); + + usr_mapping.setRole(nullptr); + usr_mapping.setForeignServer(nullptr); + QCOMPARE(usr_mapping.getName(), "public@"); +} + +void UserMappingTest::codeGeneratedIsWellFormed(void) +{ + ForeignDataWrapper fdw; + ForeignServer server; + Role role; + UserMapping usr_mapping; + QString sql_code =QString( +"-- object: postgres@server_test | type: USER MAPPING -- \ +-- DROP USER MAPPING IF EXISTS FOR postgres SERVER server_test; \ +CREATE USER MAPPING FOR postgres \ +SERVER server_test \ +OPTIONS (opt1 'value1',opt2 'value2'); \ +-- ddl-end -- ").simplified(); + +QString xml_code =QString( +" ") + .replace("#", ForeignServer::OptionValueSeparator) + .replace("*", ForeignServer::OptionsSeparator).simplified(); + + try + { + role.setName("postgres"); + fdw.setName("fdw"); + + server.setName("server_test"); + server.setOwner(&role); + server.setForeignDataWrapper(&fdw); + usr_mapping.setForeignServer(&server); + usr_mapping.setRole(&role); + usr_mapping.setOption("opt1", "value1"); + usr_mapping.setOption("opt2", "value2"); + + QString res_sql_code = usr_mapping.getCodeDefinition(SchemaParser::SqlDefinition).simplified(); + QCOMPARE(sql_code, res_sql_code); + + QString res_xml_code = usr_mapping.getCodeDefinition(SchemaParser::XmlDefinition).simplified(); + QCOMPARE(xml_code, res_xml_code); + } + catch (Exception &e) + { + QFAIL(e.getExceptionsText().toStdString().c_str()); + } +} + +void UserMappingTest::modelReturnsDepsAndRefsForUserMapping(void) +{ + /*DatabaseModel model; + Role owner; + Schema public_sch; + ForeignDataWrapper fdw; + ForeignServer server; + + try + { + public_sch.setName("public"); + owner.setName("postgres"); + + model.addSchema(&public_sch); + model.addRole(&owner); + + fdw.setName("fdw"); + model.addForeignDataWrapper(&fdw); + + server.setName("server_test"); + server.setForeignDataWrapper(&fdw); + model.addServer(&server); + + vector refs, deps; + model.getObjectDependecies(&server, deps); + + model.getObjectReferences(&fdw, refs); + model.removeServer(&server); + model.removeForeignDataWrapper(&fdw); + model.removeSchema(&public_sch); + model.removeRole(&owner); + + QVERIFY(deps.size() >= 2); + QVERIFY(refs.size() == 1); + } + catch (Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + }*/ +} + +void UserMappingTest::modelCreatesUserMappingfromXMLandResultingXMLisEqual(void) +{ + /*DatabaseModel model; + Role owner; + Schema public_sch; + ForeignDataWrapper fdw; + ForeignServer *server = nullptr; + QString xml_code, res_xml_code; + + try + { + public_sch.setName("public"); + owner.setName("postgres"); + + model.addSchema(&public_sch); + model.addRole(&owner); + + fdw.setName("fdw"); + model.addForeignDataWrapper(&fdw); + + xml_code=QString(" \ + \ + \ + \ +").replace("#", ForeignDataWrapper::OptionValueSeparator) + .replace("*", ForeignDataWrapper::OptionsSeparator); + + model.getXMLParser()->loadXMLBuffer(xml_code); + server = dynamic_cast(model.createObject(ObjectType::ForeignServer)); + + QVERIFY(server != nullptr); + + res_xml_code = server->getCodeDefinition(SchemaParser::XmlDefinition).simplified(); + xml_code = xml_code.simplified(); + + model.removeServer(server); + model.removeForeignDataWrapper(&fdw); + model.removeSchema(&public_sch); + model.removeRole(&owner); + + if(server) + delete(server); + + QCOMPARE(xml_code, res_xml_code); + } + catch (Exception &e) + { + QFAIL(e.getErrorMessage().toStdString().c_str()); + }*/ +} + +QTEST_MAIN(UserMappingTest) +#include "usermappingtest.moc" diff --git a/tests/src/usermappingtest/usermappingtest.pro b/tests/src/usermappingtest/usermappingtest.pro new file mode 100644 index 0000000000..a72afdc380 --- /dev/null +++ b/tests/src/usermappingtest/usermappingtest.pro @@ -0,0 +1,2 @@ +include(../../tests.pri) +SOURCES += usermappingtest.cpp diff --git a/tests/tests.pro b/tests/tests.pro index a978e4ad1a..8cebc9177a 100644 --- a/tests/tests.pro +++ b/tests/tests.pro @@ -16,6 +16,7 @@ src/schemaparsertest \ src/linenumberstest \ src/partrelationshiptest \ src/foreigndatawrappertest \ -src/servertest +src/servertest \ +src/usermappingtest From 15677b80602e2c4601a693cc571e46e14ab45ac6 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 28 May 2019 11:08:49 -0300 Subject: [PATCH 370/425] Added the ability to import user mappings from database --- libpgmodeler/src/baseobject.cpp | 8 +- libpgmodeler/src/databasemodel.cpp | 168 +++++++++++++----- libpgmodeler/src/databasemodel.h | 15 +- libpgmodeler/src/foreignserver.cpp | 9 +- libpgmodeler/src/foreignserver.h | 1 + libpgmodeler/src/role.cpp | 9 +- libpgmodeler/src/role.h | 1 + libpgmodeler/src/usermapping.cpp | 31 ++-- libpgmodeler/src/usermapping.h | 9 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 30 +++- libpgmodeler_ui/src/databaseimporthelper.h | 3 +- schemas/alter/owner.sch | 1 - schemas/catalog/usermapping.sch | 52 +++--- schemas/sql/usermapping.sch | 2 +- schemas/xml/dtd/dbmodel.dtd | 2 + schemas/xml/foreignserver.sch | 50 +++--- schemas/xml/usermapping.sch | 8 +- tests/src/servertest/servertest.cpp | 14 +- tests/src/usermappingtest/usermappingtest.cpp | 94 +++++----- 19 files changed, 317 insertions(+), 190 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 47b5bad5e6..49d09d159c 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -408,7 +408,7 @@ bool BaseObject::acceptsOwner(ObjectType obj_type) obj_type==ObjectType::OpClass || obj_type==ObjectType::OpFamily || obj_type==ObjectType::Collation || obj_type==ObjectType::View || obj_type==ObjectType::EventTrigger || obj_type==ObjectType::ForeignDataWrapper || - obj_type==ObjectType::ForeignServer); + obj_type==ObjectType::ForeignServer || obj_type==ObjectType::UserMapping); } bool BaseObject::acceptsOwner(void) @@ -755,10 +755,10 @@ QString BaseObject::getCodeDefinition(unsigned def_type, bool reduced_form) { attributes[Attributes::Owner]=owner->getName(format); - /** Only tablespaces and database do not have an ALTER OWNER SET + /* Only tablespaces, database and user mapping do not have an ALTER OWNER SET because the rule says that PostgreSQL tablespaces and database should be created - with just a command line isolated from the others **/ - if(obj_type!=ObjectType::Tablespace && obj_type!=ObjectType::Database) + with just a command line isolated from the others */ + if(obj_type!=ObjectType::Tablespace && obj_type!=ObjectType::Database && obj_type!=ObjectType::UserMapping) { SchemaParser sch_parser; QString filename=GlobalAttributes::SchemasRootDir + GlobalAttributes::DirSeparator + diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index 75cbf058ae..e5cbee187f 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -78,7 +78,7 @@ DatabaseModel::DatabaseModel(void) { ObjectType::EventTrigger, &eventtriggers }, { ObjectType::GenericSql, &genericsqls }, { ObjectType::ForeignDataWrapper, &fdata_wrappers }, - { ObjectType::ForeignServer, &servers }, + { ObjectType::ForeignServer, &foreign_servers }, { ObjectType::UserMapping, &usermappings } }; } @@ -201,7 +201,7 @@ void DatabaseModel::addObject(BaseObject *object, int obj_idx) else if(obj_type==ObjectType::ForeignDataWrapper) addForeignDataWrapper(dynamic_cast(object)); else if(obj_type==ObjectType::ForeignServer) - addServer(dynamic_cast(object)); + addForeignServer(dynamic_cast(object)); } catch(Exception &e) { @@ -271,7 +271,7 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) else if(obj_type==ObjectType::ForeignDataWrapper) removeForeignDataWrapper(dynamic_cast(object)); else if(obj_type==ObjectType::ForeignServer) - removeServer(dynamic_cast(object)); + removeForeignServer(dynamic_cast(object)); } catch(Exception &e) { @@ -1087,7 +1087,7 @@ ForeignDataWrapper *DatabaseModel::getForeignDataWrapper(const QString &name) return(dynamic_cast(getObject(name, ObjectType::ForeignDataWrapper))); } -void DatabaseModel::addServer(ForeignServer *server, int obj_idx) +void DatabaseModel::addForeignServer(ForeignServer *server, int obj_idx) { try { @@ -1099,7 +1099,7 @@ void DatabaseModel::addServer(ForeignServer *server, int obj_idx) } } -void DatabaseModel::removeServer(ForeignServer *server, int obj_idx) +void DatabaseModel::removeForeignServer(ForeignServer *server, int obj_idx) { try { @@ -1111,12 +1111,12 @@ void DatabaseModel::removeServer(ForeignServer *server, int obj_idx) } } -ForeignServer *DatabaseModel::getServer(unsigned obj_idx) +ForeignServer *DatabaseModel::getForeignServer(unsigned obj_idx) { return(dynamic_cast(getObject(obj_idx, ObjectType::ForeignServer))); } -ForeignServer *DatabaseModel::getServer(const QString &name) +ForeignServer *DatabaseModel::getForeignServer(const QString &name) { return(dynamic_cast(getObject(name, ObjectType::ForeignServer))); } @@ -1133,7 +1133,7 @@ void DatabaseModel::addUserMapping(UserMapping *usrmap, int obj_idx) } } -void DatabaseModel::removeUserMapping(ForeignServer *usrmap, int obj_idx) +void DatabaseModel::removeUserMapping(UserMapping *usrmap, int obj_idx) { try { @@ -3374,7 +3374,9 @@ BaseObject *DatabaseModel::createObject(ObjectType obj_type) else if(obj_type==ObjectType::ForeignDataWrapper) object=createForeignDataWrapper(); else if(obj_type==ObjectType::ForeignServer) - object=createServer(); + object=createForeignServer(); + else if(obj_type==ObjectType::UserMapping) + object=createUserMapping(); } return(object); @@ -3388,6 +3390,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) Schema *schema=nullptr; ObjectType obj_type=ObjectType::BaseObject, obj_type_aux; bool has_error=false, protected_obj=false, sql_disabled=false; + ForeignObject *frn_object = dynamic_cast(object); if(!object) throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); @@ -3396,7 +3399,7 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) obj_type_aux=object->getObjectType(); - if(obj_type_aux!=ObjectType::Cast) + if(obj_type_aux!=ObjectType::Cast && obj_type_aux != ObjectType::UserMapping) object->setName(attribs[Attributes::Name]); if(BaseObject::acceptsAlias(obj_type_aux)) @@ -3405,6 +3408,21 @@ void DatabaseModel::setBasicAttributes(BaseObject *object) protected_obj=attribs[Attributes::Protected]==Attributes::True; sql_disabled=attribs[Attributes::SqlDisabled]==Attributes::True; + if(frn_object) + { + QStringList opt_val; + + for(auto &option : attribs[Attributes::Options].split(ForeignObject::OptionsSeparator)) + { + opt_val = option.split(UserMapping::OptionValueSeparator); + + if(opt_val.size() < 2) + continue; + + frn_object->setOption(opt_val[0], opt_val[1]); + } + } + xmlparser.savePosition(); if(xmlparser.accessElement(XmlParser::ChildElement)) @@ -5992,7 +6010,6 @@ ForeignDataWrapper *DatabaseModel::createForeignDataWrapper(void) BaseObject *func=nullptr; QString signature, ref_type; ObjectType obj_type; - QStringList options, opt_val; try { @@ -6001,18 +6018,6 @@ ForeignDataWrapper *DatabaseModel::createForeignDataWrapper(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(fdw); - options = attribs[Attributes::Options].split(ForeignDataWrapper::OptionsSeparator); - - for(auto &option : options) - { - opt_val = option.split(ForeignDataWrapper::OptionValueSeparator); - - if(opt_val.size() < 2) - continue; - - fdw->setOption(opt_val[0], opt_val[1]); - } - if(xmlparser.accessElement(XmlParser::ChildElement)) { do @@ -6069,13 +6074,12 @@ ForeignDataWrapper *DatabaseModel::createForeignDataWrapper(void) return(fdw); } -ForeignServer *DatabaseModel::createServer(void) +ForeignServer *DatabaseModel::createForeignServer(void) { attribs_map attribs; ForeignServer *server = nullptr; BaseObject *fdw = nullptr; ObjectType obj_type; - QStringList options, opt_val; try { @@ -6083,20 +6087,8 @@ ForeignServer *DatabaseModel::createServer(void) xmlparser.getElementAttributes(attribs); setBasicAttributes(server); - server->setType(attribs[Attributes::Type]); server->setVersion(attribs[Attributes::Version]); - options = attribs[Attributes::Options].split(ForeignDataWrapper::OptionsSeparator); - - for(auto &option : options) - { - opt_val = option.split(ForeignDataWrapper::OptionValueSeparator); - - if(opt_val.size() < 2) - continue; - - server->setOption(opt_val[0], opt_val[1]); - } if(xmlparser.accessElement(XmlParser::ChildElement)) { @@ -6138,6 +6130,62 @@ ForeignServer *DatabaseModel::createServer(void) return(server); } +UserMapping *DatabaseModel::createUserMapping(void) +{ + attribs_map attribs; + UserMapping *user_map = nullptr; + ForeignServer *server = nullptr; + ObjectType obj_type; + + try + { + user_map = new UserMapping; + + xmlparser.getElementAttributes(attribs); + setBasicAttributes(user_map); + + if(xmlparser.accessElement(XmlParser::ChildElement)) + { + do + { + if(xmlparser.getElementType() == XML_ELEMENT_NODE) + { + obj_type = BaseObject::getObjectType(xmlparser.getElementName()); + + if(obj_type == ObjectType::ForeignServer) + { + xmlparser.savePosition(); + xmlparser.getElementAttributes(attribs); + server = dynamic_cast(getObject(attribs[Attributes::Name], ObjectType::ForeignServer)); + + //Raises an error if the server doesn't exists + if(!server) + throw Exception(Exception::getErrorMessage(ErrorCode::RefObjectInexistsModel) + .arg(user_map->getName()) + .arg(user_map->getTypeName()) + .arg(attribs[Attributes::Name]) + .arg(BaseObject::getTypeName(ObjectType::ForeignServer)), + ErrorCode::RefObjectInexistsModel,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + user_map->setForeignServer(server); + xmlparser.restorePosition(); + } + } + } + while(xmlparser.accessElement(XmlParser::NextElement)); + } + } + catch(Exception &e) + { + if(user_map) + delete(user_map); + + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e, getErrorExtraInfo()); + } + + return(user_map); +} + void DatabaseModel::updateViewsReferencingTable(Table *table) { BaseRelationship *rel = nullptr; @@ -8318,6 +8366,12 @@ void DatabaseModel::getObjectDependecies(BaseObject *object, vector(object); + getObjectDependecies(usr_map->getForeignServer(), deps, inc_indirect_deps); + } if(obj_type == ObjectType::Table || obj_type == ObjectType::View) { @@ -8939,11 +8993,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector { vector *obj_list=nullptr; vector::iterator itr, itr_end; - ObjectType obj_types[13]={ObjectType::Function, ObjectType::Table, ObjectType::Domain, + vector obj_types = { + ObjectType::Function, ObjectType::Table, ObjectType::Domain, ObjectType::Aggregate, ObjectType::Schema, ObjectType::Operator, ObjectType::Sequence, ObjectType::Conversion, ObjectType::Language, ObjectType::Tablespace, - ObjectType::Type, ObjectType::OpFamily, ObjectType::OpClass}; + ObjectType::Type, ObjectType::OpFamily, ObjectType::OpClass, + ObjectType::UserMapping }; + vector::iterator itr_tp, itr_tp_end; unsigned i,i1, count; Role *role_aux=nullptr; Role *role=dynamic_cast(object); @@ -8987,9 +9044,14 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } - for(i=0; i < 13 && (!exclusion_mode || (exclusion_mode && !refer)); i++) + itr_tp = obj_types.begin(); + itr_tp_end = obj_types.end(); + + while(itr_tp != itr_tp_end && (!exclusion_mode || (exclusion_mode && !refer))) { - obj_list=getObjectList(obj_types[i]); + obj_list=getObjectList(*itr_tp); + itr_tp++; + itr=obj_list->begin(); itr_end=obj_list->end(); @@ -9525,8 +9587,8 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector vector list; ForeignDataWrapper *fdw=dynamic_cast(object); - itr=servers.begin(); - itr_end=servers.end(); + itr=foreign_servers.begin(); + itr_end=foreign_servers.end(); while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) { @@ -9539,6 +9601,26 @@ void DatabaseModel::getObjectReferences(BaseObject *object, vector } } + if(obj_type==ObjectType::ForeignServer && (!exclusion_mode || (exclusion_mode && !refer))) + { + vector::iterator itr, itr_end; + vector list; + ForeignServer *srv=dynamic_cast(object); + + itr=usermappings.begin(); + itr_end=usermappings.end(); + + while(itr!=itr_end && (!exclusion_mode || (exclusion_mode && !refer))) + { + if(dynamic_cast(*itr)->getForeignServer() == srv) + { + refer=true; + refs.push_back(*itr); + } + itr++; + } + } + // Checking if any generic SQL object is referencing the object passed vector::iterator itr = genericsqls.begin(), itr_end = genericsqls.end(); diff --git a/libpgmodeler/src/databasemodel.h b/libpgmodeler/src/databasemodel.h index b82a995d41..184bd7f24a 100644 --- a/libpgmodeler/src/databasemodel.h +++ b/libpgmodeler/src/databasemodel.h @@ -133,7 +133,7 @@ class DatabaseModel: public QObject, public BaseObject { eventtriggers, genericsqls, fdata_wrappers, - servers, + foreign_servers, usermappings; /*! \brief Stores the xml definition for special objects. This map is used @@ -502,13 +502,13 @@ class DatabaseModel: public QObject, public BaseObject { ForeignDataWrapper *getForeignDataWrapper(unsigned obj_idx); ForeignDataWrapper *getForeignDataWrapper(const QString &name); - void addServer(ForeignServer *server, int obj_idx=-1); - void removeServer(ForeignServer *server, int obj_idx=-1); - ForeignServer *getServer(unsigned obj_idx); - ForeignServer *getServer(const QString &name); + void addForeignServer(ForeignServer *server, int obj_idx=-1); + void removeForeignServer(ForeignServer *server, int obj_idx=-1); + ForeignServer *getForeignServer(unsigned obj_idx); + ForeignServer *getForeignServer(const QString &name); void addUserMapping(UserMapping *usrmap, int obj_idx=-1); - void removeUserMapping(ForeignServer *usrmap, int obj_idx=-1); + void removeUserMapping(UserMapping *usrmap, int obj_idx=-1); UserMapping *getUserMapping(unsigned obj_idx); UserMapping *getUserMapping(const QString &name); @@ -571,7 +571,8 @@ class DatabaseModel: public QObject, public BaseObject { EventTrigger *createEventTrigger(void); GenericSQL *createGenericSQL(void); ForeignDataWrapper *createForeignDataWrapper(void); - ForeignServer *createServer(void); + ForeignServer *createForeignServer(void); + UserMapping *createUserMapping(void); //! \brief Update views that reference the provided table forcing the column name deduction and redraw of the former objects void updateViewsReferencingTable(Table *table); diff --git a/libpgmodeler/src/foreignserver.cpp b/libpgmodeler/src/foreignserver.cpp index 745ccb4f32..1ccfa145d6 100644 --- a/libpgmodeler/src/foreignserver.cpp +++ b/libpgmodeler/src/foreignserver.cpp @@ -61,7 +61,12 @@ ForeignDataWrapper *ForeignServer::getForeignDataWrapper(void) QString ForeignServer::getCodeDefinition(unsigned def_type) { - QString code_def=getCachedCode(def_type, false); + return(getCodeDefinition(def_type, false)); +} + +QString ForeignServer::getCodeDefinition(unsigned def_type, bool reduced_form) +{ + QString code_def=getCachedCode(def_type, reduced_form); if(!code_def.isEmpty()) return(code_def); attributes[Attributes::Version] = version; @@ -77,7 +82,7 @@ QString ForeignServer::getCodeDefinition(unsigned def_type) } setOptionsAttribute(def_type); - return(this->BaseObject::__getCodeDefinition(def_type)); + return(this->BaseObject::getCodeDefinition(def_type, reduced_form)); } QString ForeignServer::getAlterDefinition(BaseObject *object) diff --git a/libpgmodeler/src/foreignserver.h b/libpgmodeler/src/foreignserver.h index 109fd3b5b7..856df6ebe5 100644 --- a/libpgmodeler/src/foreignserver.h +++ b/libpgmodeler/src/foreignserver.h @@ -47,6 +47,7 @@ class ForeignServer: public ForeignObject { ForeignDataWrapper *getForeignDataWrapper(void); virtual QString getCodeDefinition(unsigned def_type); + virtual QString getCodeDefinition(unsigned def_type, bool reduced_form); virtual QString getAlterDefinition(BaseObject *object); }; diff --git a/libpgmodeler/src/role.cpp b/libpgmodeler/src/role.cpp index 3f16164cab..c6e18bb05a 100644 --- a/libpgmodeler/src/role.cpp +++ b/libpgmodeler/src/role.cpp @@ -325,7 +325,12 @@ QString Role::getPassword(void) QString Role::getCodeDefinition(unsigned def_type) { - QString code_def=getCachedCode(def_type, false); + return(getCodeDefinition(def_type, false)); +} + +QString Role::getCodeDefinition(unsigned def_type, bool reduced_form) +{ + QString code_def=getCachedCode(def_type, reduced_form); if(!code_def.isEmpty()) return(code_def); unsigned i; @@ -347,7 +352,7 @@ QString Role::getCodeDefinition(unsigned def_type) if(conn_limit >= 0) attributes[Attributes::ConnLimit]=QString("%1").arg(conn_limit); - return(BaseObject::__getCodeDefinition(def_type)); + return(BaseObject::getCodeDefinition(def_type, reduced_form)); } QString Role::getAlterDefinition(BaseObject *object, bool ignore_name_diff) diff --git a/libpgmodeler/src/role.h b/libpgmodeler/src/role.h index 2b38015eb3..ec08b2a118 100644 --- a/libpgmodeler/src/role.h +++ b/libpgmodeler/src/role.h @@ -120,6 +120,7 @@ class Role: public BaseObject { //! \brief Returns the SQL / XML definition for the role virtual QString getCodeDefinition(unsigned def_type) final; + virtual QString getCodeDefinition(unsigned def_type, bool reduced_form) final; virtual QString getAlterDefinition(BaseObject *object, bool ignore_name_diff=false) final; }; diff --git a/libpgmodeler/src/usermapping.cpp b/libpgmodeler/src/usermapping.cpp index 10a8399174..80737b8195 100644 --- a/libpgmodeler/src/usermapping.cpp +++ b/libpgmodeler/src/usermapping.cpp @@ -22,10 +22,7 @@ UserMapping::UserMapping(void) : ForeignObject() { obj_type = ObjectType::UserMapping; foreign_server = nullptr; - role = nullptr; setName(""); - - attributes[Attributes::Role] = QString(); attributes[Attributes::Server] = QString(); } @@ -41,17 +38,16 @@ ForeignServer *UserMapping::getForeignServer(void) return(foreign_server); } -void UserMapping::setRole(Role *role) +void UserMapping::setOwner(BaseObject *role) { - setCodeInvalidated(this->role != role); - this->role = role; + BaseObject::setOwner(role); setName(""); } void UserMapping::setName(const QString &) { //Configures a fixed name for the user mapping (in form: role@server) - this->obj_name=QString("%1@%2").arg(role ? role->getName() : QString("public")) + this->obj_name=QString("%1@%2").arg(owner ? owner->getName() : QString("public")) .arg(foreign_server ? foreign_server->getName() : QString()); } @@ -62,7 +58,7 @@ QString UserMapping::getName(bool, bool) QString UserMapping::getSignature(bool) { - return(QString("FOR %1 SERVER %2").arg(role ? role->getName() : QString("public")) + return(QString("FOR %1 SERVER %2").arg(owner ? owner->getName() : QString("public")) .arg(foreign_server ? foreign_server->getName() : QString())); } @@ -71,10 +67,18 @@ QString UserMapping::getCodeDefinition(unsigned def_type) QString code_def=getCachedCode(def_type, false); if(!code_def.isEmpty()) return(code_def); - attributes[Attributes::Role] = role ? role->getName(def_type == SchemaParser::SqlDefinition) : QString(); - attributes[Attributes::Server] = foreign_server ? foreign_server->getName(def_type == SchemaParser::SqlDefinition) : QString(); - setOptionsAttribute(def_type); + attributes[Attributes::Role] = QString(); + attributes[Attributes::Server] = QString(); + + if(foreign_server) + { + if(def_type == SchemaParser::SqlDefinition) + attributes[Attributes::Server] = foreign_server->getName(true); + else + attributes[Attributes::Server] = foreign_server->getCodeDefinition(def_type, true); + } + setOptionsAttribute(def_type); return(this->BaseObject::__getCodeDefinition(def_type)); } @@ -98,3 +102,8 @@ QString UserMapping::getAlterDefinition(BaseObject *object) throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); }*/ } + +QString UserMapping::getDropDefinition(bool) +{ + return(BaseObject::getDropDefinition(false)); +} diff --git a/libpgmodeler/src/usermapping.h b/libpgmodeler/src/usermapping.h index 7599ecbd34..0d9eb7117b 100644 --- a/libpgmodeler/src/usermapping.h +++ b/libpgmodeler/src/usermapping.h @@ -33,24 +33,19 @@ class UserMapping: public ForeignObject { //! \brief The foreign server which is managed by this user mapping the server ForeignServer *foreign_server; - //! \brief The role mapped to this user mapping (if the roles is null means that the user mapping is for PUBLIC) - Role *role; - public: UserMapping(void); void setForeignServer(ForeignServer *server); ForeignServer *getForeignServer(void); - void setRole(Role *role); - Role *getRole(void); - virtual void setName(const QString &); + virtual void setOwner(BaseObject *role); virtual QString getName(bool = false, bool = false); virtual QString getSignature(bool = false); virtual QString getCodeDefinition(unsigned def_type); virtual QString getAlterDefinition(BaseObject *object); - + virtual QString getDropDefinition(bool); }; #endif diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index cf1f1a1dbe..4ecc816923 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -735,7 +735,8 @@ void DatabaseImportHelper::createObject(attribs_map &attribs) case ObjectType::Policy: createPolicy(attribs); break; case ObjectType::EventTrigger: createEventTrigger(attribs); break; case ObjectType::ForeignDataWrapper: createForeignDataWrapper(attribs); break; - case ObjectType::ForeignServer: createServer(attribs); break; + case ObjectType::ForeignServer: createForeignServer(attribs); break; + case ObjectType::UserMapping: createUserMapping(attribs); break; default: if(debug_mode) @@ -2327,7 +2328,7 @@ void DatabaseImportHelper::createForeignDataWrapper(attribs_map &attribs) } } -void DatabaseImportHelper::createServer(attribs_map &attribs) +void DatabaseImportHelper::createForeignServer(attribs_map &attribs) { ForeignServer *server=nullptr; @@ -2337,8 +2338,8 @@ void DatabaseImportHelper::createServer(attribs_map &attribs) attribs[Attributes::Options] = Catalog::parseArrayValues(attribs[Attributes::Options]).join(ForeignDataWrapper::OptionsSeparator); loadObjectXML(ObjectType::ForeignServer, attribs); - server = dbmodel->createServer(); - dbmodel->addServer(server); + server = dbmodel->createForeignServer(); + dbmodel->addForeignServer(server); } catch(Exception &e) { @@ -2348,6 +2349,27 @@ void DatabaseImportHelper::createServer(attribs_map &attribs) } } +void DatabaseImportHelper::createUserMapping(attribs_map &attribs) +{ + UserMapping *usr_map=nullptr; + + try + { + attribs[Attributes::Server] = getDependencyObject(attribs[Attributes::Server], ObjectType::ForeignServer, true , true, true); + attribs[Attributes::Options] = Catalog::parseArrayValues(attribs[Attributes::Options]).join(ForeignDataWrapper::OptionsSeparator); + + loadObjectXML(ObjectType::UserMapping, attribs); + usr_map = dbmodel->createUserMapping(); + dbmodel->addUserMapping(usr_map); + } + catch(Exception &e) + { + if(usr_map) delete(usr_map); + throw Exception(e.getErrorMessage(), e.getErrorCode(), + __PRETTY_FUNCTION__,__FILE__,__LINE__, &e, xmlparser->getXMLBuffer()); + } +} + void DatabaseImportHelper::createPermission(attribs_map &attribs) { ObjectType obj_type=static_cast(attribs[Attributes::ObjectType].toUInt()); diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 75555dba55..87463a506b 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -161,7 +161,8 @@ class DatabaseImportHelper: public QObject { void createPermission(attribs_map &attribs); void createEventTrigger(attribs_map &attribs); void createForeignDataWrapper(attribs_map &attribs); - void createServer(attribs_map &attribs); + void createForeignServer(attribs_map &attribs); + void createUserMapping(attribs_map &attribs); void __createTableInheritances(void); void createTableInheritances(void); void createTablePartitionings(void); diff --git a/schemas/alter/owner.sch b/schemas/alter/owner.sch index 6eb0717cd9..19e7c4c406 100644 --- a/schemas/alter/owner.sch +++ b/schemas/alter/owner.sch @@ -3,5 +3,4 @@ # Code generation can be broken if incorrect changes are made. [ALTER ] {sql-object} $sp {signature} [ OWNER TO ] {owner}; - $br [-- ddl-end --] $br diff --git a/schemas/catalog/usermapping.sch b/schemas/catalog/usermapping.sch index 251c83a5d3..92d91408b8 100644 --- a/schemas/catalog/usermapping.sch +++ b/schemas/catalog/usermapping.sch @@ -22,37 +22,33 @@ %end %end %else - # %if {attribs} %then - # [SELECT oid, srvname AS name, srvversion AS version, srvtype AS type, - # srvfdw AS fdw, srvacl AS permission, srvowner AS owner, - # srvoptions AS options, ] - - # ({comment}) [ AS comment ] - - # [ FROM pg_foreign_server AS sv ] + %if {attribs} %then + [SELECT umid AS oid, usename || '@' || srvname AS name, um.srvid AS server, + umuser AS owner, umoptions AS options + FROM pg_user_mappings AS um ] - # %if {last-sys-oid} %then - # [ WHERE oid ] {oid-filter-op} $sp {last-sys-oid} - # %end + %if {last-sys-oid} %then + [ WHERE umid ] {oid-filter-op} $sp {last-sys-oid} + %end - # %if {not-ext-object} %then - # %if {last-sys-oid} %then - # [ AND ] - # %else - # [ WHERE ] - # %end + %if {not-ext-object} %then + %if {last-sys-oid} %then + [ AND ] + %else + [ WHERE ] + %end - # ( {not-ext-object} ) - # %end + ( {not-ext-object} ) + %end - # %if {filter-oids} %then - # %if {last-sys-oid} %or {not-ext-object} %then - # [ AND ] - # %else - # [ WHERE ] - # %end + %if {filter-oids} %then + %if {last-sys-oid} %or {not-ext-object} %then + [ AND ] + %else + [ WHERE ] + %end - # [ oid IN (] {filter-oids} ) - # %end - # %end + [ umid IN (] {filter-oids} ) + %end + %end %end diff --git a/schemas/sql/usermapping.sch b/schemas/sql/usermapping.sch index 31cb5e88da..f7f007a98f 100644 --- a/schemas/sql/usermapping.sch +++ b/schemas/sql/usermapping.sch @@ -13,7 +13,7 @@ [CREATE USER MAPPING FOR ] -%if {role} %then {role} %else PUBLIC %end $br +%if {owner} %then {owner} %else PUBLIC %end $br [SERVER ] {server} diff --git a/schemas/xml/dtd/dbmodel.dtd b/schemas/xml/dtd/dbmodel.dtd index bc2981a7e3..affe172c16 100644 --- a/schemas/xml/dtd/dbmodel.dtd +++ b/schemas/xml/dtd/dbmodel.dtd @@ -72,6 +72,8 @@ %foreigndatawrapper; %foreignserver; + +%usermapping; diff --git a/schemas/xml/foreignserver.sch b/schemas/xml/foreignserver.sch index 6aec95595e..0774c4016d 100644 --- a/schemas/xml/foreignserver.sch +++ b/schemas/xml/foreignserver.sch @@ -2,34 +2,40 @@ # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. +%if {reduced-form} %then $tb %end + [ $br +%else + %if {type} %then + [ type=] "{type}" + %end -%if {version} %then - [ version=] "{version}" -%end + %if {version} %then + [ version=] "{version}" + %end -%if {options} %then - [ options=] "{options}" -%end + %if {options} %then + [ options=] "{options}" + %end -%if {protected} %then - [ protected=] "true" -%end + %if {protected} %then + [ protected=] "true" + %end -%if {sql-disabled} %then - [ sql-disabled=] "true" -%end + %if {sql-disabled} %then + [ sql-disabled=] "true" + %end -> $br + > $br -%if {owner} %then {owner} %end -%if {comment} %then {comment} %end -%if {appended-sql} %then {appended-sql} %end -%if {prepended-sql} %then {prepended-sql} %end -%if {fdw} %then {fdw} %end + %if {owner} %then {owner} %end + %if {comment} %then {comment} %end + %if {appended-sql} %then {appended-sql} %end + %if {prepended-sql} %then {prepended-sql} %end + %if {fdw} %then {fdw} %end - $br $br + $br $br +%end diff --git a/schemas/xml/usermapping.sch b/schemas/xml/usermapping.sch index 9209c120dc..25c1d364e8 100644 --- a/schemas/xml/usermapping.sch +++ b/schemas/xml/usermapping.sch @@ -4,12 +4,6 @@ [ $br +%if {owner} %then {owner} %end +%if {server} %then {server} %end %if {appended-sql} %then {appended-sql} %end %if {prepended-sql} %then {prepended-sql} %end diff --git a/tests/src/servertest/servertest.cpp b/tests/src/servertest/servertest.cpp index fdb4952d85..80393bee4b 100644 --- a/tests/src/servertest/servertest.cpp +++ b/tests/src/servertest/servertest.cpp @@ -49,11 +49,11 @@ COMMENT ON SERVER server_test IS 'This is a test comment on server'; \ -- ddl-end -- ").simplified(); QString xml_code =QString( -" \ +" \ \ \ \ -").replace("#", ForeignServer::OptionValueSeparator) +").replace("#", ForeignServer::OptionValueSeparator) .replace("*", ForeignServer::OptionsSeparator).simplified(); try @@ -103,13 +103,13 @@ void ServerTest::modelReturnsDepsAndRefsForServer(void) server.setName("server_test"); server.setForeignDataWrapper(&fdw); - model.addServer(&server); + model.addForeignServer(&server); vector refs, deps; model.getObjectDependecies(&server, deps); model.getObjectReferences(&fdw, refs); - model.removeServer(&server); + model.removeForeignServer(&server); model.removeForeignDataWrapper(&fdw); model.removeSchema(&public_sch); model.removeRole(&owner); @@ -143,11 +143,11 @@ void ServerTest::modelCreatesServerfromXMLandResultingXMLisEqual(void) fdw.setName("fdw"); model.addForeignDataWrapper(&fdw); - xml_code=QString(" \ + xml_code=QString(" \ \ \ \ -").replace("#", ForeignDataWrapper::OptionValueSeparator) +").replace("#", ForeignDataWrapper::OptionValueSeparator) .replace("*", ForeignDataWrapper::OptionsSeparator); model.getXMLParser()->loadXMLBuffer(xml_code); @@ -158,7 +158,7 @@ void ServerTest::modelCreatesServerfromXMLandResultingXMLisEqual(void) res_xml_code = server->getCodeDefinition(SchemaParser::XmlDefinition).simplified(); xml_code = xml_code.simplified(); - model.removeServer(server); + model.removeForeignServer(server); model.removeForeignDataWrapper(&fdw); model.removeSchema(&public_sch); model.removeRole(&owner); diff --git a/tests/src/usermappingtest/usermappingtest.cpp b/tests/src/usermappingtest/usermappingtest.cpp index 4a8211c885..a2327939bc 100644 --- a/tests/src/usermappingtest/usermappingtest.cpp +++ b/tests/src/usermappingtest/usermappingtest.cpp @@ -49,10 +49,10 @@ void UserMappingTest::generatesNameCorrectly(void) usr_mapping.setForeignServer(&server); QCOMPARE(usr_mapping.getName(), "public@server_test"); - usr_mapping.setRole(&role); + usr_mapping.setOwner(&role); QCOMPARE(usr_mapping.getName(), "postgres@server_test"); - usr_mapping.setRole(nullptr); + usr_mapping.setOwner(nullptr); usr_mapping.setForeignServer(nullptr); QCOMPARE(usr_mapping.getName(), "public@"); } @@ -72,7 +72,10 @@ OPTIONS (opt1 'value1',opt2 'value2'); \ -- ddl-end -- ").simplified(); QString xml_code =QString( -" ") +" \ + \ + \ +") .replace("#", ForeignServer::OptionValueSeparator) .replace("*", ForeignServer::OptionsSeparator).simplified(); @@ -85,7 +88,7 @@ QString xml_code =QString( server.setOwner(&role); server.setForeignDataWrapper(&fdw); usr_mapping.setForeignServer(&server); - usr_mapping.setRole(&role); + usr_mapping.setOwner(&role); usr_mapping.setOption("opt1", "value1"); usr_mapping.setOption("opt2", "value2"); @@ -103,35 +106,37 @@ QString xml_code =QString( void UserMappingTest::modelReturnsDepsAndRefsForUserMapping(void) { - /*DatabaseModel model; - Role owner; - Schema public_sch; + DatabaseModel model; ForeignDataWrapper fdw; ForeignServer server; + Role role; + UserMapping usr_mapping; try { - public_sch.setName("public"); - owner.setName("postgres"); - - model.addSchema(&public_sch); - model.addRole(&owner); - + role.setName("postgres"); fdw.setName("fdw"); - model.addForeignDataWrapper(&fdw); server.setName("server_test"); + server.setOwner(&role); server.setForeignDataWrapper(&fdw); - model.addServer(&server); + usr_mapping.setForeignServer(&server); + usr_mapping.setOwner(&role); + usr_mapping.setOption("opt1", "value1"); + usr_mapping.setOption("opt2", "value2"); + + model.addRole(&role); + model.addForeignServer(&server); + model.addUserMapping(&usr_mapping); vector refs, deps; - model.getObjectDependecies(&server, deps); + model.getObjectDependecies(&usr_mapping, deps); - model.getObjectReferences(&fdw, refs); - model.removeServer(&server); + model.getObjectReferences(&server, refs); + model.removeUserMapping(&usr_mapping); + model.removeForeignServer(&server); model.removeForeignDataWrapper(&fdw); - model.removeSchema(&public_sch); - model.removeRole(&owner); + model.removeRole(&role); QVERIFY(deps.size() >= 2); QVERIFY(refs.size() == 1); @@ -139,58 +144,59 @@ void UserMappingTest::modelReturnsDepsAndRefsForUserMapping(void) catch (Exception &e) { QFAIL(e.getErrorMessage().toStdString().c_str()); - }*/ + } } void UserMappingTest::modelCreatesUserMappingfromXMLandResultingXMLisEqual(void) { - /*DatabaseModel model; - Role owner; - Schema public_sch; + DatabaseModel model; ForeignDataWrapper fdw; - ForeignServer *server = nullptr; + ForeignServer server; + Role role; + UserMapping *usr_map = nullptr; QString xml_code, res_xml_code; try { - public_sch.setName("public"); - owner.setName("postgres"); + role.setName("postgres"); + fdw.setName("fdw"); - model.addSchema(&public_sch); - model.addRole(&owner); + server.setName("server_test"); + server.setOwner(&role); + server.setForeignDataWrapper(&fdw); - fdw.setName("fdw"); + model.addRole(&role); + model.addForeignServer(&server); model.addForeignDataWrapper(&fdw); - xml_code=QString(" \ + xml_code=QString(" \ \ - \ - \ -").replace("#", ForeignDataWrapper::OptionValueSeparator) - .replace("*", ForeignDataWrapper::OptionsSeparator); + \ +").replace("#", ForeignObject::OptionValueSeparator) + .replace("*", ForeignObject::OptionsSeparator); model.getXMLParser()->loadXMLBuffer(xml_code); - server = dynamic_cast(model.createObject(ObjectType::ForeignServer)); + usr_map = dynamic_cast(model.createObject(ObjectType::UserMapping)); - QVERIFY(server != nullptr); + QVERIFY(usr_map != nullptr); - res_xml_code = server->getCodeDefinition(SchemaParser::XmlDefinition).simplified(); + res_xml_code = usr_map->getCodeDefinition(SchemaParser::XmlDefinition).simplified(); xml_code = xml_code.simplified(); - model.removeServer(server); + model.removeUserMapping(usr_map); + model.removeForeignServer(&server); model.removeForeignDataWrapper(&fdw); - model.removeSchema(&public_sch); - model.removeRole(&owner); + model.removeRole(&role); - if(server) - delete(server); + if(usr_map) + delete(usr_map); QCOMPARE(xml_code, res_xml_code); } catch (Exception &e) { QFAIL(e.getErrorMessage().toStdString().c_str()); - }*/ + } } QTEST_MAIN(UserMappingTest) From 5f0f6a52517b3a3fc7ee5bdc174c6e42af16ca75 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 28 May 2019 11:20:05 -0300 Subject: [PATCH 371/425] Minor fix on ObjectDepsRefsWidget to display the name instead of signature of constraints and user mappings --- conf/defaults/sql-highlight.conf | 1 + conf/sql-highlight.conf | 1 + libpgmodeler_ui/src/objectdepsrefswidget.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/conf/defaults/sql-highlight.conf b/conf/defaults/sql-highlight.conf index 86e29d1967..432039a509 100644 --- a/conf/defaults/sql-highlight.conf +++ b/conf/defaults/sql-highlight.conf @@ -253,6 +253,7 @@ + diff --git a/conf/sql-highlight.conf b/conf/sql-highlight.conf index 86e29d1967..432039a509 100644 --- a/conf/sql-highlight.conf +++ b/conf/sql-highlight.conf @@ -253,6 +253,7 @@ + diff --git a/libpgmodeler_ui/src/objectdepsrefswidget.cpp b/libpgmodeler_ui/src/objectdepsrefswidget.cpp index 81ad97db5f..d5cec676aa 100644 --- a/libpgmodeler_ui/src/objectdepsrefswidget.cpp +++ b/libpgmodeler_ui/src/objectdepsrefswidget.cpp @@ -41,13 +41,15 @@ void ObjectDepsRefsWidget::setAttributes(DatabaseModel *model, BaseObject *objec { BaseObjectWidget::setAttributes(model, object, parent_obj); + if(object->getObjectType() == ObjectType::Constraint || + object->getObjectType() == ObjectType::UserMapping) + name_edt->setText(object->getName()); + this->name_edt->setReadOnly(true); this->protected_obj_frm->setVisible(false); this->comment_edt->setVisible(false); this->comment_lbl->setVisible(false); - obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(object->getObjectType()))); - updateObjectTables(); } From 87da21b0c4ac5a8739d85e6a7041c329b9269b43 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 28 May 2019 15:40:47 -0300 Subject: [PATCH 372/425] Added a basic implementation of user mapping comparison in UserMapping --- libpgmodeler/src/baseobject.cpp | 3 ++- libpgmodeler/src/foreignobject.cpp | 4 ++-- libpgmodeler/src/usermapping.cpp | 14 +++----------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/libpgmodeler/src/baseobject.cpp b/libpgmodeler/src/baseobject.cpp index 49d09d159c..39cd60f415 100644 --- a/libpgmodeler/src/baseobject.cpp +++ b/libpgmodeler/src/baseobject.cpp @@ -460,7 +460,8 @@ bool BaseObject::acceptsAlterCommand(ObjectType obj_type) obj_type==ObjectType::Schema || obj_type==ObjectType::Sequence || obj_type==ObjectType::Table || obj_type==ObjectType::Tablespace || obj_type==ObjectType::Type || obj_type==ObjectType::Policy || - obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::ForeignServer); + obj_type==ObjectType::ForeignDataWrapper || obj_type==ObjectType::ForeignServer || + obj_type==ObjectType::UserMapping); } bool BaseObject::acceptsDropCommand(ObjectType obj_type) diff --git a/libpgmodeler/src/foreignobject.cpp b/libpgmodeler/src/foreignobject.cpp index 09ba1407f0..97b2bbe760 100644 --- a/libpgmodeler/src/foreignobject.cpp +++ b/libpgmodeler/src/foreignobject.cpp @@ -71,7 +71,7 @@ QString ForeignObject::getAlterDefinition(BaseObject *object) if(!fobj) throw Exception(ErrorCode::OprNotAllocatedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); - // Comparing FDW options (to be modified or added) + // Comparing options (to be modified or added) for(auto &opt : fobj->options) { if(this->options.count(opt.first) == 0) @@ -80,7 +80,7 @@ QString ForeignObject::getAlterDefinition(BaseObject *object) opts.push_back(QString("SET %1 '%3'").arg(opt.first).arg(opt.second)); } - // Comparing FDW options (to be removed) + // Comparing options (to be removed) for(auto &opt : this->options) { if(fobj->options.count(opt.first) == 0) diff --git a/libpgmodeler/src/usermapping.cpp b/libpgmodeler/src/usermapping.cpp index 80737b8195..e77f4e4cce 100644 --- a/libpgmodeler/src/usermapping.cpp +++ b/libpgmodeler/src/usermapping.cpp @@ -84,23 +84,15 @@ QString UserMapping::getCodeDefinition(unsigned def_type) QString UserMapping::getAlterDefinition(BaseObject *object) { - /*try + try { - ForeignServer *server=dynamic_cast(object); - attribs_map attribs; - - attributes[Attributes::AlterCmds] = ForeignObject::getAlterDefinition(server); - - if(this->version != server->version) - attribs[Attributes::Version] = server->version; - - copyAttributes(attribs); + attributes[Attributes::AlterCmds] = ForeignObject::getAlterDefinition(object); return(BaseObject::getAlterDefinition(this->getSchemaName(), attributes, false, true)); } catch(Exception &e) { throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e); - }*/ + } } QString UserMapping::getDropDefinition(bool) From 0c4a1356fa8b9893d01c4e38a7377eb287d74a6b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 28 May 2019 18:24:23 -0300 Subject: [PATCH 373/425] Added support to edit user mappings from forms Added support to diff user mappings --- libpgmodeler/src/databasemodel.cpp | 4 + libpgmodeler_ui/libpgmodeler_ui.pro | 9 +- libpgmodeler_ui/src/baseobjectwidget.cpp | 13 ++- libpgmodeler_ui/src/castwidget.cpp | 6 -- libpgmodeler_ui/src/foreignserverwidget.h | 6 +- libpgmodeler_ui/src/modelexporthelper.cpp | 9 +- libpgmodeler_ui/src/modelwidget.cpp | 3 + libpgmodeler_ui/src/permissionwidget.cpp | 4 - libpgmodeler_ui/src/usermappingwidget.cpp | 109 ++++++++++++++++++++++ libpgmodeler_ui/src/usermappingwidget.h | 48 ++++++++++ libpgmodeler_ui/ui/usermappingwidget.ui | 78 ++++++++++++++++ schemas/alter/usermapping.sch | 8 +- schemas/catalog/usermapping.sch | 2 +- schemas/xml/dtd/foreignserver.dtd | 2 +- schemas/xml/dtd/usermapping.dtd | 9 ++ 15 files changed, 282 insertions(+), 28 deletions(-) create mode 100644 libpgmodeler_ui/src/usermappingwidget.cpp create mode 100644 libpgmodeler_ui/src/usermappingwidget.h create mode 100644 libpgmodeler_ui/ui/usermappingwidget.ui create mode 100644 schemas/xml/dtd/usermapping.dtd diff --git a/libpgmodeler/src/databasemodel.cpp b/libpgmodeler/src/databasemodel.cpp index e5cbee187f..9cf98c4a5a 100644 --- a/libpgmodeler/src/databasemodel.cpp +++ b/libpgmodeler/src/databasemodel.cpp @@ -202,6 +202,8 @@ void DatabaseModel::addObject(BaseObject *object, int obj_idx) addForeignDataWrapper(dynamic_cast(object)); else if(obj_type==ObjectType::ForeignServer) addForeignServer(dynamic_cast(object)); + else if(obj_type==ObjectType::UserMapping) + addUserMapping(dynamic_cast(object)); } catch(Exception &e) { @@ -272,6 +274,8 @@ void DatabaseModel::removeObject(BaseObject *object, int obj_idx) removeForeignDataWrapper(dynamic_cast(object)); else if(obj_type==ObjectType::ForeignServer) removeForeignServer(dynamic_cast(object)); + else if(obj_type==ObjectType::UserMapping) + removeUserMapping(dynamic_cast(object)); } catch(Exception &e) { diff --git a/libpgmodeler_ui/libpgmodeler_ui.pro b/libpgmodeler_ui/libpgmodeler_ui.pro index 4cc4716695..97bb31e847 100644 --- a/libpgmodeler_ui/libpgmodeler_ui.pro +++ b/libpgmodeler_ui/libpgmodeler_ui.pro @@ -119,7 +119,8 @@ SOURCES += src/mainwindow.cpp \ src/elementwidget.cpp \ src/layerswidget.cpp \ src/foreigndatawrapperwidget.cpp \ - src/foreignserverwidget.cpp + src/foreignserverwidget.cpp \ + src/usermappingwidget.cpp HEADERS += src/mainwindow.h \ @@ -226,7 +227,8 @@ HEADERS += src/mainwindow.h \ src/elementwidget.h \ src/layerswidget.h \ src/foreigndatawrapperwidget.h \ - src/foreignserverwidget.h + src/foreignserverwidget.h \ + src/usermappingwidget.h FORMS += ui/mainwindow.ui \ ui/textboxwidget.ui \ @@ -313,7 +315,8 @@ FORMS += ui/mainwindow.ui \ ui/elementwidget.ui \ ui/layerswidget.ui \ ui/foreigndatawrapperwidget.ui \ - ui/foreignserverwidget.ui + ui/foreignserverwidget.ui \ + ui/usermappingwidget.ui unix|windows: LIBS += -L$$OUT_PWD/../libobjrenderer/ -lobjrenderer \ -L$$OUT_PWD/../libpgconnector/ -lpgconnector \ diff --git a/libpgmodeler_ui/src/baseobjectwidget.cpp b/libpgmodeler_ui/src/baseobjectwidget.cpp index b2060e2ba2..bd3706fc93 100644 --- a/libpgmodeler_ui/src/baseobjectwidget.cpp +++ b/libpgmodeler_ui/src/baseobjectwidget.cpp @@ -469,7 +469,9 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ collation_lbl->setVisible(BaseObject::acceptsCollation(obj_type)); collation_sel->setVisible(BaseObject::acceptsCollation(obj_type)); - show_comment=obj_type!=ObjectType::Relationship && obj_type!=ObjectType::Textbox && obj_type!=ObjectType::Parameter; + show_comment=obj_type!=ObjectType::Relationship && obj_type!=ObjectType::Textbox && + obj_type!=ObjectType::Parameter && obj_type!=ObjectType::UserMapping && + obj_type!=ObjectType::Permission; comment_lbl->setVisible(show_comment); comment_edt->setVisible(show_comment); @@ -478,11 +480,18 @@ void BaseObjectWidget::configureFormLayout(QGridLayout *grid, ObjectType obj_typ obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath(obj_type))); obj_icon_lbl->setToolTip(BaseObject::getTypeName(obj_type)); - if(obj_type!=ObjectType::Permission && obj_type!=ObjectType::Cast) + if(obj_type!=ObjectType::Permission && obj_type!=ObjectType::Cast && obj_type!=ObjectType::UserMapping) { setRequiredField(name_lbl); setRequiredField(name_edt); } + else + { + QFont font=name_edt->font(); + name_edt->setReadOnly(true); + font.setItalic(true); + name_edt->setFont(font); + } if(obj_type!=ObjectType::Extension) { diff --git a/libpgmodeler_ui/src/castwidget.cpp b/libpgmodeler_ui/src/castwidget.cpp index ed5586a57c..91fcbc5fa4 100644 --- a/libpgmodeler_ui/src/castwidget.cpp +++ b/libpgmodeler_ui/src/castwidget.cpp @@ -22,7 +22,6 @@ CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ca { try { - QFont font; QFrame *frame=nullptr; QSpacerItem *spacer=new QSpacerItem(10,1,QSizePolicy::Fixed,QSizePolicy::Expanding); @@ -38,11 +37,6 @@ CastWidget::CastWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::Ca configureFormLayout(cast_grid, ObjectType::Cast); - name_edt->setReadOnly(true); - font=name_edt->font(); - font.setItalic(true); - name_edt->setFont(font); - frame=generateInformationFrame(trUtf8("The function to be assigned to a cast from typeA to typeB must have the following signature: typeB function(typeA, integer, boolean).")); cast_grid->addItem(spacer, cast_grid->count()+1, 0, 1, 0); cast_grid->addWidget(frame, cast_grid->count()+1, 0, 1, 0); diff --git a/libpgmodeler_ui/src/foreignserverwidget.h b/libpgmodeler_ui/src/foreignserverwidget.h index a556670b0d..08232b46eb 100644 --- a/libpgmodeler_ui/src/foreignserverwidget.h +++ b/libpgmodeler_ui/src/foreignserverwidget.h @@ -18,12 +18,12 @@ /** \ingroup libpgmodeler_ui -\class ServerWidget +\class ForeignServerWidget \brief Implements the operations to create/edit foreign servers via form. */ -#ifndef SERVER_WIDGET_H -#define SERVER_WIDGET_H +#ifndef FOREIGN_SERVER_WIDGET_H +#define FOREIGN_SERVER_WIDGET_H #include "baseobjectwidget.h" #include "ui_foreignserverwidget.h" diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 74daa9e518..59d9612c16 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -787,7 +787,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co ObjectType::Conversion, ObjectType::Cast, ObjectType::Language, ObjectType::Collation, ObjectType::Extension, ObjectType::Type, ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::ForeignServer, - ObjectType::Database }; + ObjectType::UserMapping, ObjectType::Database }; /* Extract each SQL command from the buffer and execute them separately. This is done to permit the user, in case of error, identify what object is wrongly configured. */ @@ -937,7 +937,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co lin=lin.mid(reg_aux.matchedLength(), sql_cmd.indexOf('\n')).simplified(); lin.remove('"'); - if(obj_tp!=ObjectType::Cast) + if(obj_tp!=ObjectType::Cast && obj_tp != ObjectType::UserMapping) { int spc_idx=lin.indexOf(' '); obj_name=lin.mid(0, (spc_idx >= 0 ? spc_idx + 1 : lin.size())); @@ -948,6 +948,11 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co obj_name=obj_name.remove(')').simplified(); } } + else if(obj_tp == ObjectType::UserMapping) + { +#warning "TODO: extract the name of the role and server which composes the user mapping" + obj_name="**TODO**"; + } else { obj_name=QString("cast") + lin.replace(QString(" AS "),QString(",")); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index b4c65b37e4..2a69677441 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -60,6 +60,7 @@ #include "generalconfigwidget.h" #include "foreigndatawrapperwidget.h" #include "foreignserverwidget.h" +#include "usermappingwidget.h" vector ModelWidget::copied_objects; vector ModelWidget::cutted_objects; @@ -1839,6 +1840,8 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb res = openEditingForm(object); else if(obj_type==ObjectType::ForeignServer) res = openEditingForm(object); + else if(obj_type==ObjectType::UserMapping) + res = openEditingForm(object); else { DatabaseWidget *database_wgt=new DatabaseWidget; diff --git a/libpgmodeler_ui/src/permissionwidget.cpp b/libpgmodeler_ui/src/permissionwidget.cpp index 37fa64ab2c..0c539cad5b 100644 --- a/libpgmodeler_ui/src/permissionwidget.cpp +++ b/libpgmodeler_ui/src/permissionwidget.cpp @@ -41,10 +41,6 @@ PermissionWidget::PermissionWidget(QWidget *parent): BaseObjectWidget(parent, Ob configureFormLayout(permission_grid, ObjectType::Permission); - name_edt->setReadOnly(true); - comment_edt->setVisible(false); - comment_lbl->setVisible(false); - roles_tab=new ObjectsTableWidget(ObjectsTableWidget::AddButton | ObjectsTableWidget::RemoveButton | ObjectsTableWidget::EditButton, false, this); diff --git a/libpgmodeler_ui/src/usermappingwidget.cpp b/libpgmodeler_ui/src/usermappingwidget.cpp new file mode 100644 index 0000000000..c2bf263cf6 --- /dev/null +++ b/libpgmodeler_ui/src/usermappingwidget.cpp @@ -0,0 +1,109 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +#include "usermappingwidget.h" + +UserMappingWidget::UserMappingWidget(QWidget *parent): BaseObjectWidget(parent, ObjectType::UserMapping) +{ + try + { + QHBoxLayout *hbox = nullptr; + + Ui_UserMappingWidget::setupUi(this); + + server_sel=nullptr; + server_sel=new ObjectSelectorWidget(ObjectType::ForeignServer, true, this); + + hbox = new QHBoxLayout; + hbox->setContentsMargins(0,0,0,0); + hbox->addWidget(server_sel); + server_wgt->setLayout(hbox); + + options_tab = new ObjectsTableWidget(ObjectsTableWidget::AllButtons ^ + (ObjectsTableWidget::EditButton | ObjectsTableWidget::UpdateButton), true, this); + options_tab->setCellsEditable(true); + options_tab->setColumnCount(2); + options_tab->setHeaderLabel(trUtf8("Option"), 0); + options_tab->setHeaderLabel(trUtf8("Value"), 1); + + hbox = new QHBoxLayout; + hbox->setContentsMargins(4,4,4,4); + hbox->addWidget(options_tab); + options_gb->setLayout(hbox); + + configureFormLayout(server_grid, ObjectType::UserMapping); + + setRequiredField(server_sel); + setRequiredField(server_lbl); + configureTabOrder({ server_sel, options_tab }); + + setMinimumSize(550, 280); + } + catch(Exception &e) + { + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + +void UserMappingWidget::setAttributes(DatabaseModel *model, OperationList *op_list, UserMapping *user_map) +{ + BaseObjectWidget::setAttributes(model, op_list, user_map); + server_sel->setModel(model); + + if(user_map) + { + server_sel->setSelectedObject(user_map->getForeignServer()); + options_tab->blockSignals(true); + + for(auto &itr : user_map->getOptions()) + { + options_tab->addRow(); + options_tab->setCellText(itr.first, options_tab->getRowCount() - 1, 0); + options_tab->setCellText(itr.second, options_tab->getRowCount() - 1, 1); + } + + options_tab->clearSelection(); + options_tab->blockSignals(false); + } +} + +void UserMappingWidget::applyConfiguration(void) +{ + try + { + UserMapping *user_map = nullptr; + + startConfiguration(); + + user_map = dynamic_cast(this->object); + user_map->setForeignServer(dynamic_cast(server_sel->getSelectedObject())); + + user_map->removeOptions(); + for(unsigned row = 0; row < options_tab->getRowCount(); row++) + user_map->setOption(options_tab->getCellText(row, 0), options_tab->getCellText(row, 1)); + + BaseObjectWidget::applyConfiguration(); + finishConfiguration(); + } + catch(Exception &e) + { + cancelConfiguration(); + throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); + } +} + diff --git a/libpgmodeler_ui/src/usermappingwidget.h b/libpgmodeler_ui/src/usermappingwidget.h new file mode 100644 index 0000000000..f646e7fd29 --- /dev/null +++ b/libpgmodeler_ui/src/usermappingwidget.h @@ -0,0 +1,48 @@ +/* +# PostgreSQL Database Modeler (pgModeler) +# +# Copyright 2006-2019 - Raphael Araújo e Silva +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# The complete text of GPLv3 is at LICENSE file on source code root directory. +# Also, you can get the complete GNU General Public License at +*/ + +/** +\ingroup libpgmodeler_ui +\class UserMappingWidget +\brief Implements the operations to create/edit user mappings via form. +*/ + +#ifndef USER_MAPPING_WIDGET_H +#define USER_MAPPING_WIDGET_H + +#include "baseobjectwidget.h" +#include "ui_usermappingwidget.h" +#include "objectstablewidget.h" + +class UserMappingWidget: public BaseObjectWidget, public Ui::UserMappingWidget { + private: + Q_OBJECT + + ObjectSelectorWidget *server_sel; + + ObjectsTableWidget *options_tab; + + public: + UserMappingWidget(QWidget * parent = nullptr); + void setAttributes(DatabaseModel *model, OperationList *op_list, UserMapping *user_map); + + public slots: + void applyConfiguration(void); +}; + +#endif diff --git a/libpgmodeler_ui/ui/usermappingwidget.ui b/libpgmodeler_ui/ui/usermappingwidget.ui new file mode 100644 index 0000000000..205741bfab --- /dev/null +++ b/libpgmodeler_ui/ui/usermappingwidget.ui @@ -0,0 +1,78 @@ + + + UserMappingWidget + + + + 0 + 0 + 462 + 210 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Server: + + + + + + + Options + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + + + + + diff --git a/schemas/alter/usermapping.sch b/schemas/alter/usermapping.sch index 528ce6b27d..fcc312ebe8 100644 --- a/schemas/alter/usermapping.sch +++ b/schemas/alter/usermapping.sch @@ -1,4 +1,4 @@ -# SQL definition for foreign sever's attributes change +# SQL definition for user mapping's attributes change # CAUTION: Do not modify this file unless you know what you are doing. # Code generation can be broken if incorrect changes are made. @@ -7,11 +7,7 @@ %if {has-changes} %then [ALTER ] {sql-object} $sp {signature} - %if {version} %then - [ VERSION ] '{version}' - - %end - + %if {options} %then $br $tb [ OPTIONS (] {options} [)] diff --git a/schemas/catalog/usermapping.sch b/schemas/catalog/usermapping.sch index 92d91408b8..4b07d85127 100644 --- a/schemas/catalog/usermapping.sch +++ b/schemas/catalog/usermapping.sch @@ -3,7 +3,7 @@ # Code generation can be broken if incorrect changes are made. %if {list} %then - [ SELECT um.umid, um.usename || '@' || um.srvname AS name FROM pg_user_mappings AS um ] + [ SELECT um.umid AS oid, um.usename || '@' || um.srvname AS name FROM pg_user_mappings AS um ] %if {last-sys-oid} %or {not-ext-object} %then [ WHERE ] diff --git a/schemas/xml/dtd/foreignserver.dtd b/schemas/xml/dtd/foreignserver.dtd index 273ce26ce8..b9abb46e87 100644 --- a/schemas/xml/dtd/foreignserver.dtd +++ b/schemas/xml/dtd/foreignserver.dtd @@ -2,7 +2,7 @@ CAUTION: Do not modify this file directly on it's code unless you know what you are doing. Unexpected results may occur if the code is changed deliberately. --> - + diff --git a/schemas/xml/dtd/usermapping.dtd b/schemas/xml/dtd/usermapping.dtd new file mode 100644 index 0000000000..bf99399153 --- /dev/null +++ b/schemas/xml/dtd/usermapping.dtd @@ -0,0 +1,9 @@ + + + + + + From 62695eb6d24a325dd0aba5f3982fabc59197897a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 29 May 2019 09:41:34 -0300 Subject: [PATCH 374/425] Fixed the ModelExportHelper to display user mappings in the output --- libpgmodeler_ui/src/modelexporthelper.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 59d9612c16..d4077e04ba 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -950,8 +950,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co } else if(obj_tp == ObjectType::UserMapping) { -#warning "TODO: extract the name of the role and server which composes the user mapping" - obj_name="**TODO**"; + obj_name.prepend(lin.remove(QString("FOR")).trimmed() + QChar('@')); } else { From b3871a43d3cf7062f90e941ed3ba018da29b505c Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 29 May 2019 10:24:34 -0300 Subject: [PATCH 375/425] Added snippets for user mapping. Minor update on CHANGELOG.md and RELEASENOTES.md for 0.9.2-beta --- CHANGELOG.md | 11 +- RELEASENOTES.md | 8 +- conf/defaults/snippets.conf | 1041 +++++++++-------- conf/dtd/snippets.dtd | 2 +- conf/snippets.conf | 1041 +++++++++-------- .../src/databaseexplorerwidget.cpp | 9 +- libpgmodeler_ui/src/databaseexplorerwidget.h | 1 + 7 files changed, 1068 insertions(+), 1045 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a3e40cf33..6396393f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,21 +3,24 @@ Change Log v0.9.2-beta ------ -Release date: May 27, 2019
+Release date: May 31, 2019
-* [New] Added support to reduced verbosity on diff, export and import processes in order to improve performance. +* [New] Added support to user mapping. * [New] Added support to foreign server. * [New] Added support to foreign data wrapper. +* [New] Added support to reduced verbosity on diff, export and import processes in order to improve performance. * [New] Adding missing tootip on ObjectFinderWidget. * [New] Generic SQL objects now support dynamic references to objects which can be used in the definition code. * [New] Added support to compare foreign servers on diff process. * [New] Created a generic getAlterDefinition on ForeignObject. * [New] Added ForeignServer toolbutton in NewObjectOverlayWidget. +* [New] Added support to the reverse engineering user mapping objects. * [New] Added support to the reverse engineering foreign server objects. * [New] Added code snippets for foreign data wrapper and foreign server. -* [New] Added support to diff foreign data wrappers +* [New] Added support to diff user mapping. +* [New] Added support to diff foreign data wrappers. * [New] Added support to set permissions to foreign data wrapper. -* [New] Added the WRAPPER and SERVER key words to sql-highlight.conf. +* [New] Added the WRAPPER, SERVER and MAPPING key words to sql-highlight.conf. * [New] Added the method PgSqlType::isExactTo in order to do a full comparison (all attributes) between two data types. * [New] Added the ability to view references to store referenced tables. This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this feature a relationship is created between the view and all involved tables. * [New] Added missing data type macaddr8. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0babb1704d..74ef279164 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,7 +1,7 @@ v0.9.2-beta ------ -Release date: May 27, 2019
+Release date: May 31, 2019
Changes since: v0.9.2-alpha1
Summary: a brand new version has come to you after a work of almost five months. This one brings important features requested long ago and several patches to improve the tool's usability.
@@ -22,16 +22,18 @@ Now, for the bug fixes, in this release they fix crashes and broken code generat Lastly, some of the key change log entries of this release are listed below. For the complete list of changes/fixes, please, refer to the file CHANGELOG.md.
-* [New] Added support to reduced verbosity on diff, export and import processes in order to improve performance. +* [New] Added support to user mapping. * [New] Added support to foreign server. * [New] Added support to foreign data wrapper. +* [New] Added support to reduced verbosity on diff, export and import processes in order to improve performance. * [New] Generic SQL objects now support dynamic references to objects which can be used in the definition code. * [New] Added support to compare foreign servers on diff process. +* [New] Added support to the reverse engineering user mapping objects. * [New] Added support to the reverse engineering foreign server objects. * [New] Added code snippets for foreign data wrapper and foreign server. * [New] Added support to diff foreign data wrappers * [New] Added support to set permissions to foreign data wrapper. -* [New] Added the WRAPPER and SERVER key words to sql-highlight.conf. +* [New] Added the WRAPPER, SERVER and MAPPING key words to sql-highlight.conf. * [New] Added the ability to view references to store referenced tables. This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this feature a relationship is created between the view and all involved tables. * [New] Added missing data type macaddr8. * [New] Added support to result set filtering in the SQL execution widget. diff --git a/conf/defaults/snippets.conf b/conf/defaults/snippets.conf index d4a2a0f3c9..fa4075ff22 100644 --- a/conf/defaults/snippets.conf +++ b/conf/defaults/snippets.conf @@ -1,9 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - - - + + + @@ -59,56 +323,50 @@ $ob [ DEFAULT ] {default-value} $cb $br $ob [ CONSTRAINT ] {constraint} $cb $br $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - - - + + + - - - - - - + + - - + + - - - + + + - + - + + + + + - - - - - - + - - + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + $br $br [-- Function returns a single result or results of the same type ] $br -RETURNS $ob [ SET OF ] $cb $sp {return-type} $br +RETURNS $ob [ SET OF ] $cb $sp {return-type} $br [-- Function returns a table ] $br [RETURNS TABLE (] {col-name} $sp {col-type} $ob [, ...] $cb ) $br $br [-- Definition for C based function ] $br -[AS ] '{library}' [, ] '{definition}' $br +[AS ] '{library}' [, ] '{definition}' $br [-- Definition for SQL or PL/PGSQL based function ] $br [AS $$] $br @@ -172,22 +467,12 @@ $ob [ NOT ] $cb LEAKPROOF $br [ROWS ] {row-amount} $br [LANGUAGE ] {language} $br]]> - - - + + + - + +[LANGUAGE plpgsql] $br]]> - + - - - - - - - - - - - - - - - - - - - - +[LANGUAGE sql] $br]]> - - - - - - + + - + - - - - - - - - - - - - - + - + - + - - + + - + + + + - +$ob [ ENCRYPTED | UNENCRYPTED ] $cb [ PASSWORD ] '{new-password}' $br +[VALID UNTIL ] '{validity}' $br]]> - + - - + +$ob [ ENCRYPTED | UNENCRYPTED ] $cb [ PASSWORD ] '{password}' $br +[VALID UNTIL ] '{validity}' $br +[IN ROLE ] {ref-roles} $br +[ROLE ] {member-roles} $br +[ADMIN ] {admin-roles} $br]]> - + - - + - - - - - - + %if ({cycle}=="false") %then [NO ] %end CYCLE $br [OWNED BY ] %if {owner-col} %then {owner-col} %else [ NONE] %end $br]]> - - - - + + + [OWNED BY ] %if {owner-col} %then {owner-col} %else [ NONE] %end $br]]> - - - + + + - - + + - - + + -%if ({constraint}=="true") %then - [ CONSTRAINT ] -%end + + + -[ TRIGGER ] {name} $br + + + -{firing-type} + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - - - - - - - - - - - - - + + - - + + - - - - - - - - - - - - + + - - - - - - + + - - + + - - + + - - - - - - - - diff --git a/conf/dtd/snippets.dtd b/conf/dtd/snippets.dtd index a28dccd444..cd4831a649 100644 --- a/conf/dtd/snippets.dtd +++ b/conf/dtd/snippets.dtd @@ -13,5 +13,5 @@ + extension|eventtrigger|general|policy|foreigndatawrapper|foreignserver|usermapping) "general"> diff --git a/conf/snippets.conf b/conf/snippets.conf index d4a2a0f3c9..fa4075ff22 100644 --- a/conf/snippets.conf +++ b/conf/snippets.conf @@ -1,9 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + - - - + + + @@ -59,56 +323,50 @@ $ob [ DEFAULT ] {default-value} $cb $br $ob [ CONSTRAINT ] {constraint} $cb $br $ob [ NOT NULL | NULL | CHECK ] ({expression}) $cb $br]]> - - - + + + - - - - - - + + - - + + - - - + + + - + - + + + + + - - - - - - + - - + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + $br $br [-- Function returns a single result or results of the same type ] $br -RETURNS $ob [ SET OF ] $cb $sp {return-type} $br +RETURNS $ob [ SET OF ] $cb $sp {return-type} $br [-- Function returns a table ] $br [RETURNS TABLE (] {col-name} $sp {col-type} $ob [, ...] $cb ) $br $br [-- Definition for C based function ] $br -[AS ] '{library}' [, ] '{definition}' $br +[AS ] '{library}' [, ] '{definition}' $br [-- Definition for SQL or PL/PGSQL based function ] $br [AS $$] $br @@ -172,22 +467,12 @@ $ob [ NOT ] $cb LEAKPROOF $br [ROWS ] {row-amount} $br [LANGUAGE ] {language} $br]]> - - - + + + - + +[LANGUAGE plpgsql] $br]]> - + - - - - - - - - - - - - - - - - - - - - +[LANGUAGE sql] $br]]> - - - - - - + + - + - - - - - - - - - - - - - + - + - + - - + + - + + + + - +$ob [ ENCRYPTED | UNENCRYPTED ] $cb [ PASSWORD ] '{new-password}' $br +[VALID UNTIL ] '{validity}' $br]]> - + - - + +$ob [ ENCRYPTED | UNENCRYPTED ] $cb [ PASSWORD ] '{password}' $br +[VALID UNTIL ] '{validity}' $br +[IN ROLE ] {ref-roles} $br +[ROLE ] {member-roles} $br +[ADMIN ] {admin-roles} $br]]> - + - - + - - - - - - + %if ({cycle}=="false") %then [NO ] %end CYCLE $br [OWNED BY ] %if {owner-col} %then {owner-col} %else [ NONE] %end $br]]> - - - - + + + [OWNED BY ] %if {owner-col} %then {owner-col} %else [ NONE] %end $br]]> - - - + + + - - + + - - + + -%if ({constraint}=="true") %then - [ CONSTRAINT ] -%end + + + -[ TRIGGER ] {name} $br + + + -{firing-type} + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - - - - - - - - - - - - - + + - - + + - - - - - - - - - - - - + + - - - - - - + + - - + + - - + + - - - - - - - - diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 25e5df323b..9e40281966 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -131,7 +131,7 @@ const attribs_map DatabaseExplorerWidget::attribs_i18n { {Attributes::PartitionedTable, QT_TR_NOOP("Partition of")}, {Attributes::PartitionBoundExpr, QT_TR_NOOP("Partition bound expr.")}, {Attributes::DeadRowsAmount, QT_TR_NOOP("Dead rows amount")}, {Attributes::PartitionKey, QT_TR_NOOP("Partition keys")}, {Attributes::Partitioning, QT_TR_NOOP("Partitioning")}, {Attributes::Options, QT_TR_NOOP("Options")}, - {Attributes::Fdw, QT_TR_NOOP("Foreign data wrapper")} + {Attributes::Fdw, QT_TR_NOOP("Foreign data wrapper")}, {Attributes::Server, QT_TR_NOOP("Server")} }; DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) @@ -346,6 +346,7 @@ attribs_map DatabaseExplorerWidget::formatObjectAttribs(attribs_map &attribs) case ObjectType::Policy: formatPolicyAttribs(attribs); break; case ObjectType::ForeignDataWrapper: formatForeignDataWrapperAttribs(attribs); break; case ObjectType::ForeignServer: formatServerAttribs(attribs); break; + case ObjectType::UserMapping: formatUserMappingAttribs(attribs); break; default: break; } } @@ -842,6 +843,12 @@ void DatabaseExplorerWidget::formatServerAttribs(attribs_map &attribs) formatOidAttribs(attribs, { Attributes::Fdw }, ObjectType::ForeignDataWrapper, false); } +void DatabaseExplorerWidget::formatUserMappingAttribs(attribs_map &attribs) +{ + attribs[Attributes::Options]=Catalog::parseArrayValues(attribs[Attributes::Options]).join(ElemSeparator); + formatOidAttribs(attribs, { Attributes::Server }, ObjectType::ForeignServer, false); +} + QString DatabaseExplorerWidget::formatObjectName(attribs_map &attribs) { try diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.h b/libpgmodeler_ui/src/databaseexplorerwidget.h index 01c6286b18..483b3615d2 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.h +++ b/libpgmodeler_ui/src/databaseexplorerwidget.h @@ -134,6 +134,7 @@ class DatabaseExplorerWidget: public QWidget, public Ui::DatabaseExplorerWidget void formatPolicyAttribs(attribs_map &attribs); void formatForeignDataWrapperAttribs(attribs_map &attribs); void formatServerAttribs(attribs_map &attribs); + void formatUserMappingAttribs(attribs_map &attribs); void handleSelectedSnippet(const QString &snip_id); //! \brief Extract an attribute map containing the basic attributes for drop/rename commands From 90f12f65fe7de31a11081cc8c136e669a3b3abd1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 29 May 2019 10:31:45 -0300 Subject: [PATCH 376/425] Minor update on RELEASENOTES.md --- RELEASENOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 74ef279164..3baf04a108 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -6,7 +6,7 @@ v0.9.2-beta Summary: a brand new version has come to you after a work of almost five months. This one brings important features requested long ago and several patches to improve the tool's usability.
-pgModeler now supports foreign datawrappers and foreign servers natively. This means that you can create, export, import and diff these kinds of objects. For now, foreign tables aren't supported but the schedule is to release this support until the end of this development cycle when lauching the stable 0.9.2.
+pgModeler now supports foreign datawrappers, foreign servers and user mappings natively. This means that you can create, export, import and diff these kinds of objects. For now, foreign tables aren't supported but the schedule is to release this support until the end of this development cycle when lauching the stable 0.9.2.
In order to provide a temporary workaround for the lack of foreign table support the generic SQL objects were improved in such way to store references to another objects in the model which helps to keep track of name changes and giving a touch of dynamicity to this that kind of object.
From a1fec7fe4904dd8a8a868055b6632a25f0b4e217 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 29 May 2019 10:40:33 -0300 Subject: [PATCH 377/425] Fixed the ObjectSelectorWidget to show user mappings names instead of signature --- libpgmodeler_ui/src/objectselectorwidget.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libpgmodeler_ui/src/objectselectorwidget.cpp b/libpgmodeler_ui/src/objectselectorwidget.cpp index c095aea88e..02c3456cff 100644 --- a/libpgmodeler_ui/src/objectselectorwidget.cpp +++ b/libpgmodeler_ui/src/objectselectorwidget.cpp @@ -119,7 +119,7 @@ QString ObjectSelectorWidget::getSelectedObjectName(void) void ObjectSelectorWidget::setSelectedObject(BaseObject *object) { - ObjectType obj_type; + ObjectType obj_type = ObjectType::BaseObject; if(object) obj_type=object->getObjectType(); @@ -129,8 +129,13 @@ void ObjectSelectorWidget::setSelectedObject(BaseObject *object) rem_object_tb->setEnabled(object); this->selected_obj=object; - if(object->getObjectType()!=ObjectType::Constraint) - obj_name_txt->setPlainText(selected_obj->getSignature()); + if(obj_type != ObjectType::Constraint) + { + if(obj_type != ObjectType::UserMapping) + obj_name_txt->setPlainText(selected_obj->getSignature()); + else + obj_name_txt->setPlainText(selected_obj->getName()); + } else obj_name_txt->setPlainText(QString("%1.%2") .arg(dynamic_cast(selected_obj)->getParentTable()->getSignature()) From f478a860de8f85bca90a0ec7f81a8385fe9a41de Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 29 May 2019 15:58:32 -0300 Subject: [PATCH 378/425] Changed the shortcut of run command action in SQLExecutionWidget to F5 Changed the tree update action shortcut in DatabaseExplorerWidget to F6 --- libpgmodeler_ui/src/databaseexplorerwidget.cpp | 6 +++--- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 9e40281966..864eb2195e 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -184,7 +184,7 @@ DatabaseExplorerWidget::DatabaseExplorerWidget(QWidget *parent): QWidget(parent) properties_action=new QAction(QIcon(QString(":icones/icones/editar.png")), trUtf8("Reload properties"), &handle_menu); refresh_action=new QAction(QIcon(QString(":icones/icones/atualizar.png")), trUtf8("Update"), &handle_menu); - refresh_action->setShortcut(QKeySequence(Qt::Key_F5)); + refresh_action->setShortcut(QKeySequence(Qt::Key_F6)); rename_action=new QAction(QIcon(QString(":icones/icones/rename.png")), trUtf8("Rename"), &handle_menu); rename_action->setShortcut(QKeySequence(Qt::Key_F2)); @@ -260,7 +260,7 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) { QKeyEvent *k_event=dynamic_cast(event); - if(k_event->key()==Qt::Key_Delete || k_event->key()==Qt::Key_F5 || + if(k_event->key()==Qt::Key_Delete || k_event->key()==Qt::Key_F6 || k_event->key()==Qt::Key_Space || k_event->key()==Qt::Key_F2 || k_event->key()==Qt::Key_Escape || k_event->key()==Qt::Key_Return || k_event->key()==Qt::Key_Enter || k_event->key()==Qt::Key_F7) @@ -282,7 +282,7 @@ bool DatabaseExplorerWidget::eventFilter(QObject *object, QEvent *event) } } } - else if(k_event->key()==Qt::Key_F5) + else if(k_event->key()==Qt::Key_F6) updateItem(objects_trw->currentItem()); else if(k_event->key()==Qt::Key_F2) startObjectRename(objects_trw->currentItem()); diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index f59b0457c9..49febacff5 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -164,7 +164,7 @@
- F6 + F5 Qt::ToolButtonTextBesideIcon From f850406421e96ab1f97ea49f3a8d6b9e05a7e42d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 29 May 2019 16:01:02 -0300 Subject: [PATCH 379/425] Minor update on CHANGELOG.md for 0.9.2-beta --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6396393f58..97c8f57cd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ v0.9.2-beta * [New] Enabling quick clear button on several input fields. * [New] Added support to result set filtering in the SQL execution widget. * [New] Adding a column labeled "Comment" in TableWidget and ViewWidget to hold comments of children objects. +* [Change] Changed the shortcut of run SQL action in SQLExecutionWidget to F5. +* [Change] Changed the shortcut of tree update action in DatabaseExplorerWidget to F6. * [Change] Change "New object" action in popup menu in order categorize object types when clicking the database object diminishing the amount of items displayed on the screen. * [Change] Improved the object search mechanism in such way that various attributes of the object can be matched. New searchable attribute may be added in the future. * [Change] Added missing code documentation. From e528ad548cd88c337e88b036956a4425f69585b0 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 30 May 2019 11:20:55 -0300 Subject: [PATCH 380/425] Fix a bug in model export helper that wasn't identifying correctly create/alter/drop commands Fixed the metadata.dtd in order to declare object tag used by generic SQL objects --- libpgmodeler_ui/src/modelexporthelper.cpp | 79 ++++++++++++----------- schemas/xml/dtd/metadata.dtd | 3 + 2 files changed, 46 insertions(+), 36 deletions(-) diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index d4077e04ba..5fe283e822 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -787,7 +787,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co ObjectType::Conversion, ObjectType::Cast, ObjectType::Language, ObjectType::Collation, ObjectType::Extension, ObjectType::Type, ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::ForeignServer, - ObjectType::UserMapping, ObjectType::Database }; + ObjectType::UserMapping, ObjectType::BaseObject }; /* Extract each SQL command from the buffer and execute them separately. This is done to permit the user, in case of error, identify what object is wrongly configured. */ @@ -894,7 +894,6 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co obj_type=obj_tp; - if(lin.startsWith(QString("CREATE")) || lin.startsWith(QString("ALTER"))) { if(obj_tp==ObjectType::Index) @@ -937,36 +936,53 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co lin=lin.mid(reg_aux.matchedLength(), sql_cmd.indexOf('\n')).simplified(); lin.remove('"'); - if(obj_tp!=ObjectType::Cast && obj_tp != ObjectType::UserMapping) + if(obj_tp != ObjectType::BaseObject) { - int spc_idx=lin.indexOf(' '); - obj_name=lin.mid(0, (spc_idx >= 0 ? spc_idx + 1 : lin.size())); - - if(obj_tp!=ObjectType::Function) + if(obj_tp!=ObjectType::Cast && obj_tp != ObjectType::UserMapping) { - obj_name=obj_name.remove('(').simplified(); - obj_name=obj_name.remove(')').simplified(); + int spc_idx=lin.indexOf(' '); + obj_name=lin.mid(0, (spc_idx >= 0 ? spc_idx + 1 : lin.size())); + + if(obj_tp!=ObjectType::Function) + { + obj_name=obj_name.remove('(').simplified(); + obj_name=obj_name.remove(')').simplified(); + } } + else if(obj_tp == ObjectType::UserMapping) + { + obj_name.prepend(lin.remove(QString("FOR")).trimmed() + QChar('@')); + } + else + { + obj_name=QString("cast") + lin.replace(QString(" AS "),QString(",")); + } + + //Stores the object type name + obj_tp_name=BaseObject::getTypeName(obj_tp); + obj_name.remove(';'); + + if(is_create) + msg=trUtf8("Creating object `%1' (%2)").arg(obj_name).arg(obj_tp_name); + else if(is_drop) + msg=trUtf8("Dropping object `%1' (%2)").arg(obj_name).arg(obj_tp_name); + else + msg=trUtf8("Changing object `%1' (%2)").arg(obj_name).arg(obj_tp_name); } - else if(obj_tp == ObjectType::UserMapping) - { - obj_name.prepend(lin.remove(QString("FOR")).trimmed() + QChar('@')); - } + // If the type of the object being create can't be identified else { - obj_name=QString("cast") + lin.replace(QString(" AS "),QString(",")); - } + QString aux_cmd_type; - //Stores the object type name - obj_tp_name=BaseObject::getTypeName(obj_tp); - obj_name.remove(';'); + if(is_create) + aux_cmd_type = QString("CREATE"); + else if(is_drop) + aux_cmd_type = QString("DROP"); + else + aux_cmd_type = QString("ALTER"); - if(is_create) - msg=trUtf8("Creating object `%1' (%2)").arg(obj_name).arg(obj_tp_name); - else if(is_drop) - msg=trUtf8("Dropping object `%1' (%2)").arg(obj_name).arg(obj_tp_name); - else - msg=trUtf8("Changing object `%1' (%2)").arg(obj_name).arg(obj_tp_name); + msg=trUtf8("Running auxiliary `%1' command...").arg(aux_cmd_type); + } break; } @@ -984,25 +1000,16 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co //Executes the extracted SQL command if(!sql_cmd.isEmpty()) - { - if(obj_type!=ObjectType::Database) - conn.executeDDLCommand(sql_cmd); - else - db_sql_cmds.push_back(sql_cmd); - } + conn.executeDDLCommand(sql_cmd); sql_cmd.clear(); ddl_tk_found=false; } - if(ts.atEnd() && !db_sql_cmds.empty()) + if(ts.atEnd() && !orig_conn_db_name.isEmpty()) { conn.close(); - aux_conn=conn; - aux_conn.setConnectionParam(Connection::ParamDbName, orig_conn_db_name); - aux_conn.connect(); - for(QString cmd : db_sql_cmds) - aux_conn.executeDDLCommand(cmd); + conn.setConnectionParam(Connection::ParamDbName, orig_conn_db_name); } } catch(Exception &e) diff --git a/schemas/xml/dtd/metadata.dtd b/schemas/xml/dtd/metadata.dtd index 7bae17ae26..4d9d6d5100 100644 --- a/schemas/xml/dtd/metadata.dtd +++ b/schemas/xml/dtd/metadata.dtd @@ -14,6 +14,9 @@ %tag; + +%object; + %genericsql; From b3465bd48919431b12c59eeff43bf8e7f9961a4f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 30 May 2019 11:40:47 -0300 Subject: [PATCH 381/425] Fixed the usertype.sch to avoid selecting types related to foreign tables --- schemas/catalog/usertype.sch | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/schemas/catalog/usertype.sch b/schemas/catalog/usertype.sch index 056b72aa3e..7006193e01 100644 --- a/schemas/catalog/usertype.sch +++ b/schemas/catalog/usertype.sch @@ -14,9 +14,9 @@ [ typtype IN ('p','b','c','e','r') AND typname NOT LIKE 'pg_%' ] - #Excluding types related to tables/views/sequeces/materialized views + #Excluding types related to tables/views/sequeces/materialized views/foreign tables %if {filter-tab-types} %then - [ AND (SELECT count(oid) FROM pg_class WHERE relname=typname AND relkind IN ('r','S','v','m','p'))=0 ] + [ AND (SELECT count(oid) FROM pg_class WHERE relname=typname AND relkind IN ('r','S','v','m','p','f'))=0 ] %end %if {exc-builtin-arrays} %then @@ -44,6 +44,8 @@ WHEN relkind = 'v' THEN 'view' WHEN relkind = 'm' THEN 'view' WHEN typtype = 'd' THEN 'domain' + WHEN typtype = 'p' THEN 'table' + WHEN typtype = 'f' THEN 'foreigntable' END AS type_class FROM pg_class WHERE oid=tp.typrelid), tp.typrelid AS object_id, ] #TODO: Discover which field is the acl for user defined types on PgSQL 9.0 @@ -134,7 +136,7 @@ #Excluding types related to tables/views/sequeces/materialized views %if {filter-tab-types} %then - [ AND (SELECT count(oid) FROM pg_class WHERE relname=typname AND relkind IN ('r','S','v','m','p'))=0 ] + [ AND (SELECT count(oid) FROM pg_class WHERE relname=typname AND relkind IN ('r','S','v','m','p','f'))=0 ] %end %if {exc-builtin-arrays} %then From 676d02f846389210467c3ebb39e685af54ea0434 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 30 May 2019 11:43:59 -0300 Subject: [PATCH 382/425] Fixed the generic sql form to force the update of the object's definition when applying configurations --- libpgmodeler_ui/src/genericsqlwidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libpgmodeler_ui/src/genericsqlwidget.cpp b/libpgmodeler_ui/src/genericsqlwidget.cpp index 326aec5614..6e82fc797a 100644 --- a/libpgmodeler_ui/src/genericsqlwidget.cpp +++ b/libpgmodeler_ui/src/genericsqlwidget.cpp @@ -231,6 +231,7 @@ void GenericSQLWidget::applyConfiguration(void) startConfiguration(); genericsql=dynamic_cast(this->object); + dummy_gsql.setDefinition(definition_txt->toPlainText()); *genericsql = dummy_gsql; BaseObjectWidget::applyConfiguration(); From 7eaa80eeda4a29798503d63c8ecc34f0af630f07 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 30 May 2019 11:45:13 -0300 Subject: [PATCH 383/425] Restored a behavior of ModelExportHelper --- libpgmodeler_ui/src/modelexporthelper.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/libpgmodeler_ui/src/modelexporthelper.cpp b/libpgmodeler_ui/src/modelexporthelper.cpp index 5fe283e822..f2ba043b58 100644 --- a/libpgmodeler_ui/src/modelexporthelper.cpp +++ b/libpgmodeler_ui/src/modelexporthelper.cpp @@ -787,7 +787,7 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co ObjectType::Conversion, ObjectType::Cast, ObjectType::Language, ObjectType::Collation, ObjectType::Extension, ObjectType::Type, ObjectType::EventTrigger, ObjectType::ForeignDataWrapper, ObjectType::ForeignServer, - ObjectType::UserMapping, ObjectType::BaseObject }; + ObjectType::UserMapping, ObjectType::Database, ObjectType::BaseObject }; /* Extract each SQL command from the buffer and execute them separately. This is done to permit the user, in case of error, identify what object is wrongly configured. */ @@ -1000,16 +1000,25 @@ void ModelExportHelper::exportBufferToDBMS(const QString &buffer, Connection &co //Executes the extracted SQL command if(!sql_cmd.isEmpty()) - conn.executeDDLCommand(sql_cmd); + { + if(obj_type != ObjectType::Database) + conn.executeDDLCommand(sql_cmd); + else + db_sql_cmds.push_back(sql_cmd); + } sql_cmd.clear(); ddl_tk_found=false; } - if(ts.atEnd() && !orig_conn_db_name.isEmpty()) + if(ts.atEnd() && !db_sql_cmds.empty()) { conn.close(); - conn.setConnectionParam(Connection::ParamDbName, orig_conn_db_name); + aux_conn=conn; + aux_conn.setConnectionParam(Connection::ParamDbName, orig_conn_db_name); + aux_conn.connect(); + for(QString cmd : db_sql_cmds) + aux_conn.executeDDLCommand(cmd); } } catch(Exception &e) From e9539f4f89dceda8e8d7aaa453e8ae48fe80cc07 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 31 May 2019 13:24:04 -0300 Subject: [PATCH 384/425] Fixed a crash while selecting referenced tables on ConstraintWidget (issues #1284 #1283) --- libpgmodeler_ui/src/constraintwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/constraintwidget.cpp b/libpgmodeler_ui/src/constraintwidget.cpp index 34c166b4f7..16eb907ec0 100644 --- a/libpgmodeler_ui/src/constraintwidget.cpp +++ b/libpgmodeler_ui/src/constraintwidget.cpp @@ -279,7 +279,7 @@ void ConstraintWidget::selectReferencedTable(void) { Table *table=dynamic_cast
(ref_table_sel->getSelectedObject()); - if(!table || dynamic_cast(this->object)->getReferencedTable() != table) + if(!table || (this->object && dynamic_cast(this->object)->getReferencedTable() != table)) { ref_columns_tab->blockSignals(true); ref_columns_tab->removeRows(); From 72b26663bf2e1ead76f1066a828bd38e03b57dad Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 5 Jun 2019 08:05:29 -0300 Subject: [PATCH 385/425] Minor fix on SQLExecutionWidget to avoid results grid to overlap command execution history widget in certain cases. --- libpgmodeler_ui/ui/databaseexplorerwidget.ui | 2 +- libpgmodeler_ui/ui/sqlexecutionwidget.ui | 112 ++++++++----------- libutils/src/globalattributes.cpp | 2 +- 3 files changed, 51 insertions(+), 65 deletions(-) diff --git a/libpgmodeler_ui/ui/databaseexplorerwidget.ui b/libpgmodeler_ui/ui/databaseexplorerwidget.ui index 87dbacb9d4..0612af7c5a 100644 --- a/libpgmodeler_ui/ui/databaseexplorerwidget.ui +++ b/libpgmodeler_ui/ui/databaseexplorerwidget.ui @@ -614,7 +614,7 @@ false - 25 + 26 false diff --git a/libpgmodeler_ui/ui/sqlexecutionwidget.ui b/libpgmodeler_ui/ui/sqlexecutionwidget.ui index 49febacff5..bfbba57794 100644 --- a/libpgmodeler_ui/ui/sqlexecutionwidget.ui +++ b/libpgmodeler_ui/ui/sqlexecutionwidget.ui @@ -680,6 +680,9 @@ false + + false + Results @@ -696,69 +699,6 @@ 4 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - - - QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed - - - true - - - QAbstractItemView::ContiguousSelection - - - false - - - true - - - 26 - - - 25 - - - - - - - - - - - - Qt::Horizontal - - - - 253 - 20 - - - - - - @@ -880,6 +820,52 @@ + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 6 + + + + + QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed + + + true + + + QAbstractItemView::ContiguousSelection + + + false + + + true + + + 26 + + + 25 + + + + + + diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index e51e4b2e50..9f3f111fbe 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -25,7 +25,7 @@ namespace GlobalAttributes { PgModelerAppName=QString("pgmodeler"), PgModelerURI=QString("pgmodeler.io"), PGMODELER_REVERSE_URI=QString("io.pgmodeler"), - PgModelerVersion=QString("0.9.2-beta"), + PgModelerVersion=QString("0.9.2-beta1"), PgModelerBuildNumber=QString(BUILDNUM), PgModelerSite=QString("https://pgmodeler.io"), PgModelerSupport=QString("https://pgmodeler.io/support/docs"), From e392c0db3db9b162d3aaf37f4b7b653687e6ef66 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 5 Jun 2019 08:24:56 -0300 Subject: [PATCH 386/425] Moved the method DatabaseImportHelper::parseIndexExpressions to Catalog Fixed the display of index expressions on DatabaseExplorerWidget --- libpgconnector/src/catalog.cpp | 45 +++++++++++++++++ libpgconnector/src/catalog.h | 4 ++ .../src/databaseexplorerwidget.cpp | 2 +- libpgmodeler_ui/src/databaseimporthelper.cpp | 49 +------------------ libpgmodeler_ui/src/databaseimporthelper.h | 4 -- 5 files changed, 52 insertions(+), 52 deletions(-) diff --git a/libpgconnector/src/catalog.cpp b/libpgconnector/src/catalog.cpp index 0d121b4de3..d5c98c71cb 100644 --- a/libpgconnector/src/catalog.cpp +++ b/libpgconnector/src/catalog.cpp @@ -786,6 +786,51 @@ QStringList Catalog::parseRuleCommands(const QString &cmds) return(cmds.mid(start,(end - start) + 1).split(';', QString::SkipEmptyParts)); } +QStringList Catalog::parseIndexExpressions(const QString &expr) +{ + int open_paren = 0, close_paren = 0, pos = 0; + QStringList expressions; + QChar chr; + QString word; + bool open_apos = false; + + if(!expr.isEmpty()) + { + while(pos < expr.length()) + { + chr = expr[pos++]; + word += chr; + + if(chr == QChar('\'')) + open_apos = !open_apos; + + if(!open_apos && chr == QChar('(')) + open_paren++; + else if(!open_apos && chr == QChar(')')) + close_paren++; + + if(chr == QChar(',') || pos == expr.length()) + { + if(open_paren == close_paren) + { + if(word.endsWith(QChar(','))) + word.remove(word.length() - 1, 1); + + if(word.contains('(') && word.contains(')')) + expressions.push_back(word.trimmed()); + else + expressions.push_back(word); + + word.clear(); + open_paren = close_paren = 0; + } + } + } + } + + return(expressions); +} + void Catalog::operator = (const Catalog &catalog) { try diff --git a/libpgconnector/src/catalog.h b/libpgconnector/src/catalog.h index 77037780eb..8b588f1b33 100644 --- a/libpgconnector/src/catalog.h +++ b/libpgconnector/src/catalog.h @@ -218,6 +218,10 @@ class Catalog { //! \brief Parse the raw commands of a rule retrieved by the catalog and returns only the relevant parts static QStringList parseRuleCommands(const QString &cmd); + /*! \brief Parse a set of expressions related to an index returned by the pg_get_expr(oid) and separates + * them as a string list. */ + static QStringList parseIndexExpressions(const QString &expr); + /*! \brief Enable/disable the use of cached catalog queries. When enabled, the schema files read for the first are stored in memory so in the next time the same catalog query must be used it'll be read right from the memory and not from the disk anymore */ static void enableCachedQueries(bool value); diff --git a/libpgmodeler_ui/src/databaseexplorerwidget.cpp b/libpgmodeler_ui/src/databaseexplorerwidget.cpp index 864eb2195e..d581f13e7d 100644 --- a/libpgmodeler_ui/src/databaseexplorerwidget.cpp +++ b/libpgmodeler_ui/src/databaseexplorerwidget.cpp @@ -814,7 +814,7 @@ void DatabaseExplorerWidget::formatIndexAttribs(attribs_map &attribs) formatBooleanAttribs(attribs, { Attributes::Unique }); - attribs[Attributes::Expressions]=Catalog::parseArrayValues(attribs[Attributes::Expressions]).join(ElemSeparator); + attribs[Attributes::Expressions]=Catalog::parseIndexExpressions(attribs[Attributes::Expressions]).join(ElemSeparator); attribs[Attributes::Collations]=getObjectsNames(ObjectType::Collation, Catalog::parseArrayValues(attribs[Attributes::Collations])).join(ElemSeparator); diff --git a/libpgmodeler_ui/src/databaseimporthelper.cpp b/libpgmodeler_ui/src/databaseimporthelper.cpp index 4ecc816923..8453c442e0 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.cpp +++ b/libpgmodeler_ui/src/databaseimporthelper.cpp @@ -1813,7 +1813,7 @@ void DatabaseImportHelper::createTable(attribs_map &attribs) cols=Catalog::parseArrayValues(attribs[Attributes::PartKeyCols]); collations=Catalog::parseArrayValues(attribs[Attributes::PartKeyColls]); opclasses=Catalog::parseArrayValues(attribs[Attributes::PartKeyOpCls]); - exprs = parseIndexExpressions(attribs[Attributes::PartKeyExprs]); + exprs = Catalog::parseIndexExpressions(attribs[Attributes::PartKeyExprs]); for(int i = 0; i < cols.size(); i++) { @@ -2023,51 +2023,6 @@ void DatabaseImportHelper::createTrigger(attribs_map &attribs) } } -QStringList DatabaseImportHelper::parseIndexExpressions(const QString &expr) -{ - int open_paren = 0, close_paren = 0, pos = 0; - QStringList expressions; - QChar chr; - QString word; - bool open_apos = false; - - if(!expr.isEmpty()) - { - while(pos < expr.length()) - { - chr = expr[pos++]; - word += chr; - - if(chr == QChar('\'')) - open_apos = !open_apos; - - if(!open_apos && chr == QChar('(')) - open_paren++; - else if(!open_apos && chr == QChar(')')) - close_paren++; - - if(chr == QChar(',') || pos == expr.length()) - { - if(open_paren == close_paren) - { - if(word.endsWith(QChar(','))) - word.remove(word.length() - 1, 1); - - if(word.contains('(') && word.contains(')')) - expressions.push_back(word.trimmed()); - else - expressions.push_back(word); - - word.clear(); - open_paren = close_paren = 0; - } - } - } - } - - return(expressions); -} - void DatabaseImportHelper::createIndex(attribs_map &attribs) { try @@ -2099,7 +2054,7 @@ void DatabaseImportHelper::createIndex(attribs_map &attribs) cols=Catalog::parseArrayValues(attribs[Attributes::Columns]); collations=Catalog::parseArrayValues(attribs[Attributes::Collations]); opclasses=Catalog::parseArrayValues(attribs[Attributes::OpClasses]); - exprs = parseIndexExpressions(attribs[Attributes::Expressions]); + exprs = Catalog::parseIndexExpressions(attribs[Attributes::Expressions]); for(i=0; i < cols.size(); i++) { diff --git a/libpgmodeler_ui/src/databaseimporthelper.h b/libpgmodeler_ui/src/databaseimporthelper.h index 87463a506b..00b5ef6eec 100644 --- a/libpgmodeler_ui/src/databaseimporthelper.h +++ b/libpgmodeler_ui/src/databaseimporthelper.h @@ -211,10 +211,6 @@ class DatabaseImportHelper: public QObject { //! \brief Return a string containing all attributes and their values in a formatted way QString dumpObjectAttributes(attribs_map &attribs); - - /*! \brief Parse a set of expressions related to an index returned by the pg_get_expr(oid) and separates - * them as a string list. */ - QStringList parseIndexExpressions(const QString &expr); public: DatabaseImportHelper(QObject *parent = nullptr); From be2154f09691ef7409a4b34a6ad52561a539d977 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 11 Jun 2019 08:26:36 -0300 Subject: [PATCH 387/425] Fixed a bug that was causing the generation of broken code on views (issue #1292) --- libpgmodeler/src/view.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler/src/view.cpp b/libpgmodeler/src/view.cpp index 32d553c104..2ecf38a042 100644 --- a/libpgmodeler/src/view.cpp +++ b/libpgmodeler/src/view.cpp @@ -520,7 +520,7 @@ void View::setDefinitionAttribute(void) } decl=decl.trimmed(); - if(!decl.endsWith(QChar(';'))) + if(!decl.isEmpty() && !decl.endsWith(QChar(';'))) decl.append(QChar(';')); attributes[Attributes::Definition]=decl; From 4dfa429d81f9ad657195b6b214639b1b7257a709 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 11 Jun 2019 16:03:15 -0300 Subject: [PATCH 388/425] Avoiding applying fillfactor to gin indexes --- libpgmodeler/src/index.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libpgmodeler/src/index.cpp b/libpgmodeler/src/index.cpp index a5cc67a92f..cdfb5843bb 100644 --- a/libpgmodeler/src/index.cpp +++ b/libpgmodeler/src/index.cpp @@ -351,7 +351,7 @@ QString Index::getCodeDefinition(unsigned def_type) if(this->indexing_type==IndexingType::Gist) attributes[Attributes::StorageParams]=attributes[Attributes::Buffering]=(index_attribs[Buffering] ? Attributes::True : QString()); - if(/*this->indexing_type==IndexingType::btree && */fill_factor >= 10) + if(this->indexing_type!=IndexingType::Gin && fill_factor >= 10) { attributes[Attributes::Factor]=QString("%1").arg(fill_factor); attributes[Attributes::StorageParams]=Attributes::True; @@ -389,7 +389,8 @@ QString Index::getAlterDefinition(BaseObject *object) if(this->indexing_type==index->indexing_type) { - if(this->fill_factor!=index->fill_factor && index->fill_factor >= 10) + if(this->indexing_type != IndexingType::Gin && + this->fill_factor!=index->fill_factor && index->fill_factor >= 10) attribs[Attributes::Factor]=QString::number(index->fill_factor); if(this->indexing_type==IndexingType::Gin && From 70277468cf052a2069a240367d59953c26027fd4 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 17 Jun 2019 13:34:12 -0300 Subject: [PATCH 389/425] Fixed the progress calculation of dbm files loading. --- libparsers/src/xmlparser.cpp | 30 +++++++++++++++++++++++++++--- libparsers/src/xmlparser.h | 4 ++++ 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index 17f36b1b85..4e0d1c6e0a 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -30,6 +30,7 @@ XmlParser::XmlParser(void) root_elem=nullptr; curr_elem=nullptr; xml_doc=nullptr; + curr_line = 0; xmlInitParser(); } @@ -160,7 +161,7 @@ void XmlParser::readBuffer(void) buffer+=xml_decl; //Configures the parser, initially, to not validate the document against the dtd - parser_opt=( XML_PARSE_NOBLANKS | XML_PARSE_NONET | XML_PARSE_NOENT ); + parser_opt=( XML_PARSE_NOBLANKS | XML_PARSE_NONET | XML_PARSE_NOENT | XML_PARSE_BIG_LINES); //If the dtd declarions is setup if(!dtd_decl.isEmpty()) @@ -250,6 +251,7 @@ void XmlParser::restartNavigation(void) void XmlParser::restartParser(void) { root_elem=curr_elem=nullptr; + curr_line = 0; if(xml_doc) { @@ -285,8 +287,22 @@ bool XmlParser::accessElement(unsigned elem_type) has_elem=hasElement(elem_type); if(has_elem) + { curr_elem=elems[elem_type]; + /* NOTE: Due to XML2 implementation big line numbers are stored in the psvi + * attribute so we need to reinterpret cast the value and return the real value */ + if(curr_elem->line == 65535 && curr_elem->next && curr_elem->next->psvi != nullptr) + { + int aux_line = static_cast(reinterpret_cast(curr_elem->next->psvi)); + + if(curr_line < aux_line) + curr_line = aux_line; + } + else if(curr_elem->line > curr_line) + curr_line = curr_elem->line; + } + return(has_elem); } @@ -401,7 +417,7 @@ QString XmlParser::getXMLBuffer(void) int XmlParser::getCurrentBufferLine(void) { if(curr_elem) - return(curr_elem->line); + return(curr_line); else return(0); } @@ -409,10 +425,18 @@ int XmlParser::getCurrentBufferLine(void) int XmlParser::getBufferLineCount(void) { if(xml_doc) + { /* To get the very last line of the document is necessary to call the last element of the last because xml_doc->last->line stores the - last line of the root element */ + last line of the root element. + + NOTE: Due to XML2 implementation big line numbers are stored in the psvi + attribute so we need to reinterpret cast the value and return the real value */ + if(xml_doc->last->last->line == 65535 && xml_doc->last->last->psvi != nullptr) + return(static_cast(reinterpret_cast(xml_doc->last->last->psvi))); + return(xml_doc->last->last->line); + } else return(0); } diff --git a/libparsers/src/xmlparser.h b/libparsers/src/xmlparser.h index 7ba1bd15a6..16b77d8357 100644 --- a/libparsers/src/xmlparser.h +++ b/libparsers/src/xmlparser.h @@ -43,8 +43,12 @@ class XmlParser { //! \brief Stores the xml document (element tree) generated after the buffer reading xmlDoc *xml_doc; + //! \brief Stores the approximated line position on the current parsed buffer + int curr_line; + //! \brief Stores the reference to the root element of the element tree xmlNode *root_elem, + //! \brief Stores the current element that parser is analyzing *curr_elem; From 5671315ff410ec57957ccb5b57a15f48d7046041 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 18 Jun 2019 10:11:10 -0300 Subject: [PATCH 390/425] Fixed a false-positive diff result when dealing with timestamptz (issue #1280) --- libpgmodeler/src/pgsqltypes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpgmodeler/src/pgsqltypes.cpp b/libpgmodeler/src/pgsqltypes.cpp index ca244d32cf..cafb9c8dff 100644 --- a/libpgmodeler/src/pgsqltypes.cpp +++ b/libpgmodeler/src/pgsqltypes.cpp @@ -1486,8 +1486,8 @@ bool PgSqlType::isEquivalentTo(PgSqlType type) {QString("bit varying"),QString("varbit")}, {QString("oid"),QString("regproc"),QString("regprocedure"), QString("regoper"),QString("regoperator"),QString("regclass"), - QString("regtype"),QString("regconfig"),QString("regdictionary")}}; - + QString("regtype"),QString("regconfig"),QString("regdictionary")}, + {QString("timestamptz"),QString("timestamp with time zone")}}; //If the types are equal there is no need to perform further operations if(*this==type) From 095b9afc51e70111ed3d2c47feb8bb3e835ae0ff Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 19 Jun 2019 10:55:53 -0300 Subject: [PATCH 391/425] Making the mime update operation return exit code 0 even if there was errors (still displayed in the console). This will avoid the installer to abort installation when the dbm mime update fails. --- main-cli/src/pgmodelercli.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index c5fdefe516..a936dba68a 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -1486,11 +1486,18 @@ void PgModelerCli::diffModelDatabase(void) void PgModelerCli::updateMimeType(void) { #ifndef Q_OS_MAC + try + { printMessage(trUtf8("Starting mime update...")); handleMimeDatabase(parsed_opts[DbmMimeType]==Uninstall); printMessage(trUtf8("Mime database successfully updated!\n")); + } + catch (Exception &e) + { + out << e.getExceptionsText() << endl; + } #endif } From 6ccc77d8387c6397cca5215646da8b650f36b920 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 19 Jun 2019 17:26:52 -0300 Subject: [PATCH 392/425] Added a button to create a new data manipulation form from within another data manipulation form Added a confirmation message before closing a database explorer widget --- libpgmodeler_ui/src/datamanipulationform.cpp | 10 +++- libpgmodeler_ui/src/datamanipulationform.h | 3 ++ libpgmodeler_ui/src/sqltoolwidget.cpp | 14 +++++ libpgmodeler_ui/ui/datamanipulationform.ui | 54 ++++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index caf334322f..f0bc267d8c 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -146,6 +146,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): connect(move_up_tb, SIGNAL(clicked()), this, SLOT(swapColumns())); connect(filter_tb, SIGNAL(toggled(bool)), filter_tbw, SLOT(setVisible(bool))); connect(truncate_tb, SIGNAL(clicked(bool)), this, SLOT(truncateTable())); + connect(new_window_tb, SIGNAL(clicked(bool)), this, SLOT(openNewWindow())); connect(bulkedit_tb, &QToolButton::clicked, [&](){ PgModelerUiNs::bulkDataEdit(results_tbw); @@ -1515,5 +1516,12 @@ void DataManipulationForm::toggleColumnDisplay(QListWidgetItem *item) results_tbw->horizontalHeader()->setSectionHidden(idx, hide); item->setCheckState(hide ? Qt::Unchecked : Qt::Checked); item->setData(Qt::UserRole, item->checkState()); - } + } +} + +void DataManipulationForm::openNewWindow(void) +{ + DataManipulationForm *data_manip = new DataManipulationForm; + data_manip->setAttributes(tmpl_conn_params, QString()); + data_manip->show(); } diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 8f55d44d08..8bada4cc91 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -193,6 +193,9 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { //! \brief Display or hides a column when the related item is interacted in the column list at filter section void toggleColumnDisplay(QListWidgetItem *item); + + //! \brief Opens a new data manipulation windows + void openNewWindow(void); }; #endif diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 546bef4838..93a1bf94ad 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -260,6 +260,7 @@ void SQLToolWidget::browseDatabase(void) db_explorer_wgt->listObjects(); databases_tbw->addTab(db_explorer_wgt, database_cmb->currentText()); + databases_tbw->setTabToolTip(databases_tbw->count() - 1, db_explorer_wgt->getConnection().getConnectionId(true, true)); databases_tbw->setCurrentWidget(db_explorer_wgt); connect(db_explorer_wgt, SIGNAL(s_databaseDropped(QString)), this, SLOT(handleDatabaseDropped(QString))); @@ -309,6 +310,19 @@ void SQLToolWidget::closeDatabaseExplorer(int idx) { DatabaseExplorerWidget *db_explorer=dynamic_cast(databases_tbw->widget(idx)); + /* Display a message box confirming the database explorer tab only if the user + * click the close button on the DatabaseExplorerWidget instance */ + if(sender() == databases_tbw) + { + Messagebox msg_box; + msg_box.show(trUtf8("Warning"), + trUtf8("ATTENTION: Close the database being browsed will close any opened SQL execution pane related to it! Do you really want to proceed?"), + Messagebox::AlertIcon, Messagebox::YesNoButtons); + + if(msg_box.result() != QDialog::Accepted) + return; + } + //Closing sql execution tabs related to the database to be closed for(QWidget *wgt : sql_exec_wgts[db_explorer]) { diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index 3282d4dfa8..c40ad47b7a 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -1740,6 +1740,60 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 8 + 20 + + + + + + + + true + + + + 0 + 0 + + + + Open a new data manipulation window + + + New window + + + + :/icones/icones/novoobjeto.png:/icones/icones/novoobjeto.png + + + + 22 + 22 + + + + Ctrl+N + + + Qt::ToolButtonIconOnly + + + true + + + From 1b4cf61a1e721c2a8a4c9667854a02530ab5dbff Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 23 Jun 2019 18:04:59 -0300 Subject: [PATCH 393/425] Changed the way the model saving timers are controlled to avoid infinity savings on the model (when the auto saving option is disabled) making the application unusable (issue #1295) --- libpgmodeler_ui/src/mainwindow.cpp | 12 +++++++----- libpgmodeler_ui/src/mainwindow.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 89e0f400fd..2cc2786677 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -565,8 +565,10 @@ void MainWindow::stopTimers(bool value) } else { - tmpmodel_save_timer.start(); - model_save_timer.start(); + tmpmodel_save_timer.start(); + + if(model_save_timer.interval() < InfinityInterval) + model_save_timer.start(); } } @@ -1303,8 +1305,8 @@ void MainWindow::applyConfigurations(void) if(!conf_wgt->autosave_interv_chk->isChecked()) { //Stop the save timer - model_save_timer.stop(); - model_save_timer.setInterval(0); + model_save_timer.setInterval(InfinityInterval); + model_save_timer.stop(); } else { @@ -1313,7 +1315,7 @@ void MainWindow::applyConfigurations(void) } //Temporary models are saved every five minutes - tmpmodel_save_timer.setInterval(model_save_timer.interval() != 0 ? model_save_timer.interval()/2 : 300000); + tmpmodel_save_timer.setInterval(model_save_timer.interval() < InfinityInterval ? model_save_timer.interval()/2 : 300000); tmpmodel_save_timer.start(); QApplication::setOverrideCursor(Qt::WaitCursor); diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 66e34cc982..26a65567b7 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -60,7 +60,8 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { static constexpr int WelcomeView=0, DesignView=1, - ManageView=2; + ManageView=2, + InfinityInterval = INT_MAX; static bool confirm_validation; From 94d38b33cd04a093ae4ba38151e738c72b1a56cd Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 26 Jun 2019 17:08:33 -0300 Subject: [PATCH 394/425] Minor adjustment on buttons shortcuts/tooltips on DataManipulationForm --- libpgmodeler_ui/src/datamanipulationform.cpp | 14 +++--- libpgmodeler_ui/ui/datamanipulationform.ui | 47 +++++++------------- 2 files changed, 26 insertions(+), 35 deletions(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index f0bc267d8c..5ecd9db1d0 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -71,18 +71,22 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): }); truncate_tb->setMenu(&truncate_menu); - truncate_menu.addAction(QIcon(PgModelerUiNs::getIconPath("truncate")), trUtf8("Truncate"), this, SLOT(truncateTable()))->setData(QVariant::fromValue(false)); - truncate_menu.addAction(QIcon(PgModelerUiNs::getIconPath("trunccascade")), trUtf8("Truncate cascade"), this, SLOT(truncateTable()))->setData(QVariant::fromValue(true)); + truncate_menu.addAction(QIcon(PgModelerUiNs::getIconPath("truncate")), trUtf8("Truncate"), this, SLOT(truncateTable()), QKeySequence("Ctrl+Del"))->setData(QVariant::fromValue(false)); + truncate_menu.addAction(QIcon(PgModelerUiNs::getIconPath("trunccascade")), trUtf8("Truncate cascade"), this, SLOT(truncateTable()), QKeySequence("Ctrl+Shift+Del"))->setData(QVariant::fromValue(true)); copy_tb->setMenu(©_menu); refresh_tb->setToolTip(refresh_tb->toolTip() + QString(" (%1)").arg(refresh_tb->shortcut().toString())); save_tb->setToolTip(save_tb->toolTip() + QString(" (%1)").arg(save_tb->shortcut().toString())); - undo_tb->setToolTip(undo_tb->toolTip() + QString(" (%1)").arg(undo_tb->shortcut().toString())); + paste_tb->setToolTip(paste_tb->toolTip() + QString(" (%1)").arg(paste_tb->shortcut().toString())); export_tb->setToolTip(export_tb->toolTip() + QString(" (%1)").arg(export_tb->shortcut().toString())); - delete_tb->setToolTip(delete_tb->toolTip() + QString(" (%1)").arg(delete_tb->shortcut().toString())); + undo_tb->setToolTip(undo_tb->toolTip() + QString(" (%1)").arg(undo_tb->shortcut().toString())); add_tb->setToolTip(add_tb->toolTip() + QString(" (%1)").arg(add_tb->shortcut().toString())); + delete_tb->setToolTip(delete_tb->toolTip() + QString(" (%1)").arg(delete_tb->shortcut().toString())); + bulkedit_tb->setToolTip(bulkedit_tb->toolTip() + QString(" (%1)").arg(bulkedit_tb->shortcut().toString())); duplicate_tb->setToolTip(duplicate_tb->toolTip() + QString(" (%1)").arg(duplicate_tb->shortcut().toString())); - paste_tb->setToolTip(paste_tb->toolTip() + QString(" (%1)").arg(paste_tb->shortcut().toString())); + csv_load_tb->setToolTip(csv_load_tb->toolTip() + QString(" (%1)").arg(csv_load_tb->shortcut().toString())); + filter_tb->setToolTip(filter_tb->toolTip() + QString(" (%1)").arg(filter_tb->shortcut().toString())); + new_window_tb->setToolTip(new_window_tb->toolTip() + QString(" (%1)").arg(new_window_tb->shortcut().toString())); result_info_wgt->setVisible(false); //Forcing the splitter that handles the bottom widgets to resize its children to their minimum size diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index c40ad47b7a..07f0df1cd6 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -1645,22 +1645,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 8 - 20 - - - - @@ -1689,7 +1673,7 @@ - + Ctrl+L true @@ -1729,6 +1713,9 @@ 22 + + Ctrl+F + true @@ -1756,6 +1743,19 @@ + + + + Qt::Horizontal + + + + 235 + 20 + + + + @@ -1794,19 +1794,6 @@ - - - - Qt::Horizontal - - - - 235 - 20 - - - - From b6dfaa843ff1b2f6b29d1a1152cbcb36c9dcd387 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 27 Jun 2019 15:17:37 -0300 Subject: [PATCH 395/425] Improved the diff code preview allowing the user to close the dialog without going back to previous tab and click 'Cancel' (issue #1297) Added support to load the generated diff code in the SQL tool and automatically browsing the destination server for manual diff applying. --- .../src/connectionsconfigwidget.cpp | 11 +++ libpgmodeler_ui/src/connectionsconfigwidget.h | 3 + libpgmodeler_ui/src/mainwindow.cpp | 5 ++ libpgmodeler_ui/src/modeldatabasediffform.cpp | 51 ++++++++++- libpgmodeler_ui/src/modeldatabasediffform.h | 6 ++ libpgmodeler_ui/src/sqlexecutionwidget.cpp | 8 +- libpgmodeler_ui/src/sqlexecutionwidget.h | 3 + libpgmodeler_ui/src/sqltoolwidget.cpp | 49 +++++++++-- libpgmodeler_ui/src/sqltoolwidget.h | 12 ++- libpgmodeler_ui/ui/modeldatabasediffform.ui | 85 +++++++++++++++++-- 10 files changed, 216 insertions(+), 17 deletions(-) diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.cpp b/libpgmodeler_ui/src/connectionsconfigwidget.cpp index 5170fc2de2..162a925d5c 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.cpp +++ b/libpgmodeler_ui/src/connectionsconfigwidget.cpp @@ -553,6 +553,17 @@ void ConnectionsConfigWidget::getConnections(map &conns, } } +Connection *ConnectionsConfigWidget::getConnection(const QString &conn_id) +{ + for(Connection *conn : connections) + { + if(conn->getConnectionId() == conn_id) + return(conn); + } + + return(nullptr); +} + void ConnectionsConfigWidget::fillConnectionsComboBox(QComboBox *combo, bool incl_placeholder, unsigned check_def_for) { map connections; diff --git a/libpgmodeler_ui/src/connectionsconfigwidget.h b/libpgmodeler_ui/src/connectionsconfigwidget.h index 4446c6fcc7..ccd7731790 100644 --- a/libpgmodeler_ui/src/connectionsconfigwidget.h +++ b/libpgmodeler_ui/src/connectionsconfigwidget.h @@ -64,6 +64,9 @@ class ConnectionsConfigWidget: public BaseConfigWidget, public Ui::ConnectionsCo //! \brief Fills the passed map with all the loaded connections. static void getConnections(map &conns, bool inc_hosts=true); + + //! \brief Return a connection with the provided ID. If no connection is found the method returns nullptr + static Connection *getConnection(const QString &conn_id); //! \brief Fills the passed combobox with all the loaded connections static void fillConnectionsComboBox(QComboBox *combo, bool incl_placeholder, unsigned check_def_for=Connection::OpNone); diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 2cc2786677..2cc24519ca 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -1536,6 +1536,10 @@ void MainWindow::diffModelDatabase(void) stopTimers(true); connect(&modeldb_diff_frm, &ModelDatabaseDiffForm::s_connectionsUpdateRequest, [&](){ updateConnections(true); }); + connect(&modeldb_diff_frm, &ModelDatabaseDiffForm::s_loadDiffInSQLTool, [&](QString conn_id, QString database, QString filename){ + action_manage->toggle(); + sql_tool_wgt->addSQLExecutionTab(conn_id, database, filename); + }); PgModelerUiNs::resizeDialog(&modeldb_diff_frm); GeneralConfigWidget::restoreWidgetGeometry(&modeldb_diff_frm); @@ -2088,3 +2092,4 @@ void MainWindow::toggleLayersWidget(bool show) tb_pos.y() - layers_wgt->height() * 0.80); layers_wgt->setVisible(show); } + diff --git a/libpgmodeler_ui/src/modeldatabasediffform.cpp b/libpgmodeler_ui/src/modeldatabasediffform.cpp index 6a91c94f08..6d6b2c261e 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.cpp +++ b/libpgmodeler_ui/src/modeldatabasediffform.cpp @@ -20,6 +20,7 @@ #include "configurationform.h" #include "databaseimportform.h" #include "pgmodeleruins.h" +#include bool ModelDatabaseDiffForm::low_verbosity = false; @@ -131,6 +132,7 @@ ModelDatabaseDiffForm::ModelDatabaseDiffForm(QWidget *parent, Qt::WindowFlags f) connect(src_database_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(enableDiffMode())); connect(src_model_rb, SIGNAL(toggled(bool)), this, SLOT(enableDiffMode())); connect(src_database_rb, SIGNAL(toggled(bool)), this, SLOT(enableDiffMode())); + connect(open_in_sql_tool_btn, SIGNAL(clicked(bool)), this, SLOT(loadDiffInSQLTool())); #ifdef DEMO_VERSION #warning "DEMO VERSION: forcing ignore errors in diff due to the object count limit." @@ -198,11 +200,12 @@ void ModelDatabaseDiffForm::resetForm(void) void ModelDatabaseDiffForm::closeEvent(QCloseEvent *event) { //Ignore the close event when the thread is running - if(process_paused || - (import_thread && import_thread->isRunning()) || + if((import_thread && import_thread->isRunning()) || (diff_thread && diff_thread->isRunning()) || - (export_thread && export_thread->isRunning())) + (export_thread && export_thread->isRunning())) event->ignore(); + else if(process_paused) + cancelOperation(true); } void ModelDatabaseDiffForm::showEvent(QShowEvent *) @@ -429,6 +432,7 @@ void ModelDatabaseDiffForm::generateDiff(void) buttons_wgt->setEnabled(false); cancel_btn->setEnabled(true); generate_btn->setEnabled(false); + close_btn->setEnabled(false); settings_tbw->setTabEnabled(0, false); settings_tbw->setTabEnabled(1, true); @@ -583,12 +587,14 @@ void ModelDatabaseDiffForm::exportDiff(bool confirm) export_helper->setIgnoredErrors(error_codes_edt->text().simplified().split(' ')); export_thread->start(); + close_btn->setEnabled(false); } else if(msg_box.isCancelled()) cancelOperation(true); else { process_paused=true; + close_btn->setEnabled(true); settings_tbw->setCurrentIndex(2); apply_on_server_btn->setVisible(true); output_trw->collapseItem(diff_item); @@ -613,6 +619,44 @@ void ModelDatabaseDiffForm::filterDiffInfos(void) } } +void ModelDatabaseDiffForm::loadDiffInSQLTool(void) +{ + QString database = database_cmb->currentText(), filename; + QFile out_tmp_file; + Connection conn=(*reinterpret_cast(connections_cmb->itemData(connections_cmb->currentIndex()).value())); + QByteArray buffer; + QTemporaryFile tmp_sql_file; + + cancelOperation(true); + + if(store_in_file_rb->isChecked()) + filename = file_edt->text(); + else + { + tmp_sql_file.setFileTemplate(GlobalAttributes::TemporaryDir + + GlobalAttributes::DirSeparator + + QString("diff_%1_XXXXXX.sql").arg(database)); + + tmp_sql_file.open(); + filename = tmp_sql_file.fileName(); + tmp_sql_file.close(); + + out_tmp_file.setFileName(filename); + out_tmp_file.open(QFile::WriteOnly); + + if(!out_tmp_file.isOpen()) + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotWritten).arg(out_tmp_file.fileName()), + ErrorCode::FileDirectoryNotWritten,__PRETTY_FUNCTION__,__FILE__,__LINE__); + + buffer.append(sqlcode_txt->toPlainText()); + out_tmp_file.write(buffer); + out_tmp_file.close(); + } + + emit s_loadDiffInSQLTool(conn.getConnectionId(), database, filename); + close(); +} + void ModelDatabaseDiffForm::resetButtons(void) { buttons_wgt->setEnabled(true); @@ -701,6 +745,7 @@ void ModelDatabaseDiffForm::cancelOperation(bool cancel_by_user) resetButtons(); process_paused=false; + close_btn->setEnabled(true); } void ModelDatabaseDiffForm::captureThreadError(Exception e) diff --git a/libpgmodeler_ui/src/modeldatabasediffform.h b/libpgmodeler_ui/src/modeldatabasediffform.h index 1419608ac5..9c899508ae 100644 --- a/libpgmodeler_ui/src/modeldatabasediffform.h +++ b/libpgmodeler_ui/src/modeldatabasediffform.h @@ -145,11 +145,17 @@ class ModelDatabaseDiffForm: public QDialog, public Ui::ModelDatabaseDiffForm { void diffModels(void); void exportDiff(bool confirm=true); void filterDiffInfos(void); + void loadDiffInSQLTool(void); signals: /*! \brief This signal is emitted whenever the user changes the connections settings within this widget without use the main configurations dialog */ void s_connectionsUpdateRequest(void); + + /*! \brief This signal is emitted whenever the user wants to load the generated diff in the sql tool + * The signal contains the connection id, the database name and the temp filename that is generated containing + * the commands to be loaded */ + void s_loadDiffInSQLTool(QString conn_id, QString database, QString sql_file); }; #endif diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 2407287e67..0aea2b3499 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -209,7 +209,13 @@ void SQLExecutionWidget::setConnection(Connection conn) .arg(conn.getConnectionParam(Connection::ParamDbName)) .arg(conn.getConnectionParam(Connection::ParamServerIp).isEmpty() ? conn.getConnectionParam(Connection::ParamServerFqdn) : conn.getConnectionParam(Connection::ParamServerIp)) - .arg(conn.getConnectionParam(Connection::ParamPort))); + .arg(conn.getConnectionParam(Connection::ParamPort))); +} + +void SQLExecutionWidget::setSQLCommand(const QString &sql) +{ + sql_cmd_txt->clear(); + sql_cmd_txt->setPlainText(sql); } void SQLExecutionWidget::enableCommandButtons(void) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.h b/libpgmodeler_ui/src/sqlexecutionwidget.h index 0ea1ddb288..d8559b2c95 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.h +++ b/libpgmodeler_ui/src/sqlexecutionwidget.h @@ -108,6 +108,9 @@ class SQLExecutionWidget: public QWidget, public Ui::SQLExecutionWidget { //! \brief Configures the connection to query the server void setConnection(Connection conn); + //! \brief Insert the provided sql commands in the input field. This method clears the current commands before adding new content + void setSQLCommand(const QString &sql); + /*! \brief Fills up the results grid based upon the specified result set. The parameter store_data will make each item store the text as its data */ static void fillResultsTable(Catalog &catalog, ResultSet &res, QTableWidget *results_tbw, bool store_data=false); diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 93a1bf94ad..9e8e7a3bc4 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -18,9 +18,7 @@ #include "sqltoolwidget.h" #include "taskprogresswidget.h" -#include "databaseexplorerwidget.h" #include "snippetsconfigwidget.h" -#include "sqlexecutionwidget.h" #include "connectionsconfigwidget.h" #include "pgmodeleruins.h" @@ -243,7 +241,7 @@ void SQLToolWidget::handleDatabaseDropped(const QString &dbname) } } -void SQLToolWidget::browseDatabase(void) +DatabaseExplorerWidget *SQLToolWidget::browseDatabase(void) { try { @@ -274,6 +272,8 @@ void SQLToolWidget::browseDatabase(void) /* Forcing the signal s_sqlExecutionRequested to be emitted to properly register the new tab on the map of sql panes related to the database explorer */ db_explorer_wgt->runsql_tb->click(); + + return(db_explorer_wgt); } } catch(Exception &e) @@ -282,7 +282,7 @@ void SQLToolWidget::browseDatabase(void) } } -void SQLToolWidget::addSQLExecutionTab(void) +SQLExecutionWidget *SQLToolWidget::addSQLExecutionTab(void) { try { @@ -291,7 +291,7 @@ void SQLToolWidget::addSQLExecutionTab(void) Connection conn; if(!db_explorer_wgt) - return; + return(nullptr); conn = db_explorer_wgt->getConnection(); sql_exec_wgt->setConnection(conn); @@ -299,6 +299,8 @@ void SQLToolWidget::addSQLExecutionTab(void) sql_exec_tbw->setCurrentWidget(sql_exec_wgt); sql_exec_tbw->currentWidget()->layout()->setContentsMargins(4,4,4,4); sql_exec_wgts[db_explorer_wgt].push_back(sql_exec_wgt); + + return(sql_exec_wgt); } catch(Exception &e) { @@ -306,6 +308,43 @@ void SQLToolWidget::addSQLExecutionTab(void) } } +void SQLToolWidget::addSQLExecutionTab(const QString &conn_id, const QString &database, const QString &sql_file) +{ + map conns; + SQLExecutionWidget *sql_exec_wgt = nullptr; + DatabaseExplorerWidget *db_explorer_wgt = nullptr; + QFile file; + + if(!ConnectionsConfigWidget::getConnection(conn_id)) + { + throw Exception(trUtf8("Failed to load the file `%1' in SQL tool because the connection ID `%2' was not found!") + .arg(sql_file).arg(conn_id), + ErrorCode::Custom,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + else if(!QFileInfo(sql_file).exists()) + { + throw Exception(Exception::getErrorMessage(ErrorCode::FileDirectoryNotAccessed).arg(sql_file), + ErrorCode::FileDirectoryNotAccessed,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + + // Connect to the server using the provided connection id + connections_cmb->setCurrentText(conn_id); + connectToServer(); + + // Browse the database and retrive the database explorer instace generated + database_cmb->setCurrentText(database); + db_explorer_wgt = browseDatabase(); + + /* Now we get the sql execution widget created from the previous operation + * in order to load the sql file there */ + sql_exec_wgt = dynamic_cast(sql_exec_wgts[db_explorer_wgt].at(0)); + + file.setFileName(sql_file); + file.open(QFile::ReadOnly); + sql_exec_wgt->setSQLCommand(file.readAll()); + file.close(); +} + void SQLToolWidget::closeDatabaseExplorer(int idx) { DatabaseExplorerWidget *db_explorer=dynamic_cast(databases_tbw->widget(idx)); diff --git a/libpgmodeler_ui/src/sqltoolwidget.h b/libpgmodeler_ui/src/sqltoolwidget.h index e989b1fb2c..a7a5fb98b0 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.h +++ b/libpgmodeler_ui/src/sqltoolwidget.h @@ -33,6 +33,8 @@ #include "findreplacewidget.h" #include "codecompletionwidget.h" #include "numberedtexteditor.h" +#include "databaseexplorerwidget.h" +#include "sqlexecutionwidget.h" class SQLToolWidget: public QWidget, public Ui::SQLToolWidget { private: @@ -66,6 +68,10 @@ class SQLToolWidget: public QWidget, public Ui::SQLToolWidget { void clearDatabases(void); + protected slots: + //! \brief Add a tab by browsing a database in the specified connectio, loads the sql file and put its contents on a SQL execution + void addSQLExecutionTab(const QString &conn_id, const QString &database, const QString &sql_file); + private slots: //! \brief Opens a connection to the selected server void connectToServer(void); @@ -77,10 +83,10 @@ class SQLToolWidget: public QWidget, public Ui::SQLToolWidget { void handleDatabaseDropped(const QString &dbname); //! \brief Open the current database in a database explorer instance - void browseDatabase(void); + DatabaseExplorerWidget *browseDatabase(void); //! \brief Add a tab to permit the SQL execution for the current database being browsed - void addSQLExecutionTab(void); + SQLExecutionWidget *addSQLExecutionTab(void); //! \brief Show the selected snippet on the current opened SQL execution tab void showSnippet(const QString &snip); @@ -95,6 +101,8 @@ class SQLToolWidget: public QWidget, public Ui::SQLToolWidget { /*! \brief This signal is emitted whenever the user changes the connections settings within this widget without use the main configurations dialog */ void s_connectionsUpdateRequest(void); + + friend class MainWindow; }; #endif diff --git a/libpgmodeler_ui/ui/modeldatabasediffform.ui b/libpgmodeler_ui/ui/modeldatabasediffform.ui index 092b2f0005..8087ecf11f 100644 --- a/libpgmodeler_ui/ui/modeldatabasediffform.ui +++ b/libpgmodeler_ui/ui/modeldatabasediffform.ui @@ -2122,7 +2122,61 @@ 4 - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + 16777215 + 16777215 + + + + + + + &Apply diff + + + + :/icones/icones/diff.png:/icones/icones/diff.png + + + + 22 + 22 + + + + false + + + + @@ -2132,8 +2186,21 @@ - - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + 0 @@ -2152,12 +2219,15 @@ 16777215 + + Loads the generated diff code in the destination server for manual applying. + - &Apply diff + Open in SQL Tool - :/icones/icones/diff.png:/icones/icones/diff.png + :/icones/icones/codigosql.png:/icones/icones/codigosql.png @@ -2165,8 +2235,11 @@ 22 + + false + - true + false From 706b0739a305704c22f6a413b71b7e35086ea94b Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 28 Jun 2019 16:56:30 -0300 Subject: [PATCH 396/425] Start to add table children objects multiselection (WIP) --- libobjrenderer/src/baseobjectview.cpp | 18 -------- libobjrenderer/src/basetableview.cpp | 64 ++++++++++++++++++++++---- libobjrenderer/src/basetableview.h | 17 +++++-- libobjrenderer/src/objectsscene.cpp | 40 ++++++++++++++-- libobjrenderer/src/objectsscene.h | 16 ++++++- libobjrenderer/src/tableobjectview.cpp | 57 +++++++++++++++++++---- libobjrenderer/src/tableobjectview.h | 8 +++- libpgmodeler_ui/src/modelwidget.cpp | 2 + libpgmodeler_ui/src/sqltoolwidget.cpp | 8 ++-- 9 files changed, 181 insertions(+), 49 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index dada50b6bf..0b140194a1 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -71,13 +71,6 @@ void BaseObjectView::setSourceObject(BaseObject *object) if(!graph_obj) { - if(obj_selection) - { - this->removeFromGroup(obj_selection); - delete(obj_selection); - obj_selection=nullptr; - } - if(obj_shadow) { this->removeFromGroup(obj_shadow); @@ -99,17 +92,6 @@ void BaseObjectView::setSourceObject(BaseObject *object) pos_info_item=nullptr; } - /*if(sql_disabled_box) - { - this->removeFromGroup(sql_disabled_txt); - delete(sql_disabled_txt); - sql_disabled_txt=nullptr; - - this->removeFromGroup(sql_disabled_box); - delete(sql_disabled_box); - sql_disabled_box=nullptr; - }*/ - if(sql_disabled_item) { this->removeFromGroup(sql_disabled_item); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 8eaede1348..3058b944ec 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -69,7 +69,7 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) this->addToGroup(attribs_toggler); this->setAcceptHoverEvents(true); - sel_child_obj=nullptr; + sel_child_obj_view=nullptr; configurePlaceholder(); connect(attribs_toggler, SIGNAL(s_collapseModeChanged(CollapseMode)), this, SLOT(configureCollapsedSections(CollapseMode))); @@ -136,34 +136,61 @@ QVariant BaseTableView::itemChange(GraphicsItemChange change, const QVariant &va emit s_objectMoved(); BaseObjectView::itemChange(change, value); - return(value); } void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) { //Emit a signal containing the select child object if the user right-click the focused item - if(!this->isSelected() && event->buttons()==Qt::RightButton && sel_child_obj) + if(!this->isSelected() && event->buttons()==Qt::RightButton) { if(this->scene()) this->scene()->clearSelection(); + clearChildrenSelection(); + /* Deactivate the table in order not to hide the child object selection. The table object is reativated when the context menu is hidden */ this->setEnabled(false); - emit s_childObjectSelected(sel_child_obj); + emit s_popupMenuRequested(dynamic_cast(sel_child_obj_view->getSourceObject())); } else { QPointF pnt = attribs_toggler->mapFromScene(event->scenePos()); //If the user clicks the extended attributes toggler - if(!this->isSelected() && event->buttons()==Qt::LeftButton && + if(!this->isSelected() && event->buttons()==Qt::LeftButton && event->modifiers() == Qt::NoModifier && attribs_toggler->isVisible() && attribs_toggler->boundingRect().contains(pnt)) attribs_toggler->setButtonSelected(pnt, true); - BaseObjectView::mousePressEvent(event); + if(sel_child_obj_view && event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) + { + this->setFlag(QGraphicsItem::ItemIsSelectable, false); + sel_child_obj_view->setFakeSelection(!sel_child_obj_view->hasFakeSelection()); + + if(!sel_child_obj_view->hasFakeSelection()) + { + vector::iterator itr = + std::find(sel_child_objs.begin(), sel_child_objs.end(), sel_child_obj_view); + + if(itr != sel_child_objs.end()) + sel_child_objs.erase(itr); + } + else + sel_child_objs.push_back(sel_child_obj_view); + + sel_child_obj_view = nullptr; + event->ignore(); + emit s_childrenSelectionChanged(); + + QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); + } + else if((this->flags() & QGraphicsItem::ItemIsSelectable) == QGraphicsItem::ItemIsSelectable) + { + clearChildrenSelection(); + BaseObjectView::mousePressEvent(event); + } } } @@ -190,7 +217,7 @@ void BaseTableView::hoverLeaveEvent(QGraphicsSceneHoverEvent *) obj_selection->setVisible(false); attribs_toggler->clearButtonsSelection(); - sel_child_obj=nullptr; + sel_child_obj_view=nullptr; } void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) @@ -232,7 +259,7 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) } else if(!items.isEmpty()) { - BaseObjectView *item=dynamic_cast(items[static_cast(item_idx)]); + TableObjectView *item=dynamic_cast(items[static_cast(item_idx)]); //Configures the selection with the item's dimension if(obj_selection->boundingRect().height() != item->boundingRect().height()) @@ -249,7 +276,7 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) obj_selection->setPos(QPointF(title->pos().x() + HorizSpacing, -rect1.top() + VertSpacing/2)); //Stores the selected child object - sel_child_obj=dynamic_cast(item->getSourceObject()); + sel_child_obj_view = item; this->setToolTip(item->toolTip()); } } @@ -439,6 +466,25 @@ void BaseTableView::configureObjectShadow(void) rect_item->setPos(3.5, 4.5); } +vector BaseTableView::getSelectedChidren(void) +{ + return(sel_child_objs); +} + +void BaseTableView::clearChildrenSelection(void) +{ + if(sel_child_objs.empty()) + return; + + while(!sel_child_objs.empty()) + { + sel_child_objs.back()->setFakeSelection(false); + sel_child_objs.pop_back(); + } + + emit s_childrenSelectionChanged(); +} + void BaseTableView::startGeometryUpdate(void) { //We need to force the object to be not selectable so further calls to mousePressEvent doesn't select the object diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index b90b7d8f08..b6683562ba 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -41,6 +41,9 @@ class BaseTableView: public BaseObjectView { /*! \brief Stores the references to the relationships connected to this table. */ vector connected_rels; + //! \brief Stores the selected child objects in order to retrieve them in ObjectScene/ModelWidget + vector sel_child_objs; + protected: /*! \brief This attributes indicates that the object's geometry update is pending demanding a * call to configureObject(). This attribute is set to true only when the objects is invisible @@ -73,7 +76,7 @@ class BaseTableView: public BaseObjectView { TextPolygonItem *tag_item; //! \brief Stores the reference to the child object currently selected on table - TableObject *sel_child_obj; + TableObjectView *sel_child_obj_view; //! \brief Table title TableTitleView *title; @@ -159,6 +162,11 @@ class BaseTableView: public BaseObjectView { //! \brief Configures the shadow for the table void configureObjectShadow(void); + //! \brief Returns a list of selected children objects + vector getSelectedChidren(void); + + void clearChildrenSelection(void); + private slots: /*! \brief This slot reconfigures the table when the attributes toggler emits the signal s_collapseModeChanged * hiding or exposing the sections related to the current collapse mode */ @@ -178,8 +186,11 @@ class BaseTableView: public BaseObjectView { //! \brief Signal emitted to indicate that the relationships attached to the table need to be updated void s_relUpdateRequest(void); - //! \brief Signal emitted when the user right-click a focused table child object - void s_childObjectSelected(TableObject *); + //! \brief Signal emitted when the user right-click a focused table child object requesting a popup menu + void s_popupMenuRequested(TableObject *); + + //! \brief Signal emitted when the user clicks a focused table child object and holding Control+Shift + void s_childrenSelectionChanged(void); //! \brief Signal emitted when the user toggles the table's collapse mode void s_collapseModeChanged(void); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 5b921b7773..58978a4eef 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -630,7 +630,7 @@ void ObjectsScene::configurePrinter(QPrinter *printer, const QSizeF &custom_size custom_paper_size=orig_custom_sz; } -void ObjectsScene::emitChildObjectSelection(TableObject *child_obj) +void ObjectsScene::handlePopupMenuRequested(TableObject *child_obj) { /* Treats the TableView::s_childObjectSelect() only when there is no other object selected on the scene */ @@ -638,12 +638,27 @@ void ObjectsScene::emitChildObjectSelection(TableObject *child_obj) emit s_popupMenuRequested(child_obj); } -void ObjectsScene::emitObjectSelection(BaseGraphicObject *object, bool selected) +void ObjectsScene::handleObjectSelection(BaseGraphicObject *object, bool selected) { if(object) emit s_objectSelected(object, selected); } +void ObjectsScene::handleChildrenSelectionChanged(void) +{ + BaseTableView *tab_view = dynamic_cast(sender()); + + if(!tab_view) + return; + + if(tab_view->getSelectedChidren().empty()) + tabs_sel_children.removeAll(tab_view); + else + tabs_sel_children.append(tab_view); + + emit s_childrenSelectionChanged(); +} + void ObjectsScene::addItem(QGraphicsItem *item) { if(item) @@ -656,7 +671,8 @@ void ObjectsScene::addItem(QGraphicsItem *item) connect(rel, SIGNAL(s_relationshipModified(BaseGraphicObject*)), this, SIGNAL(s_objectModified(BaseGraphicObject*))); else if(tab) { - connect(tab, SIGNAL(s_childObjectSelected(TableObject*)), this, SLOT(emitChildObjectSelection(TableObject*))); + connect(tab, SIGNAL(s_popupMenuRequested(TableObject*)), this, SLOT(handlePopupMenuRequested(TableObject*))); + connect(tab, SIGNAL(s_childrenSelectionChanged()), this, SLOT(handleChildrenSelectionChanged())); connect(tab, SIGNAL(s_collapseModeChanged()), this, SIGNAL(s_collapseModeChanged())); connect(tab, SIGNAL(s_paginationToggled()), this, SIGNAL(s_paginationToggled())); connect(tab, SIGNAL(s_currentPageChanged()), this, SIGNAL(s_currentPageChanged())); @@ -665,7 +681,7 @@ void ObjectsScene::addItem(QGraphicsItem *item) if(obj) { obj->setVisible(isLayerActive(obj->getLayer())); - connect(obj, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(emitObjectSelection(BaseGraphicObject*,bool))); + connect(obj, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(handleObjectSelection(BaseGraphicObject*,bool))); } QGraphicsScene::addItem(item); @@ -1318,6 +1334,12 @@ void ObjectsScene::update(void) QGraphicsScene::update(this->sceneRect()); } +void ObjectsScene::clearSelection(void) +{ + tabs_sel_children.clear(); + QGraphicsScene::clearSelection(); +} + vector ObjectsScene::getPagesForPrinting(const QSizeF &paper_size, const QSizeF &margin, unsigned &h_page_cnt, unsigned &v_page_cnt) { vector pages; @@ -1391,3 +1413,13 @@ bool ObjectsScene::isMovingObjects(void) { return(moving_objs); } + +QList ObjectsScene::selectedItems(void) const +{ + QList items = QGraphicsScene::selectedItems(); + + for(auto &obj_view :tabs_sel_children) + items.push_back(obj_view); + + return(items); +} diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 0a816f2f7f..36ce52cf90 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -42,6 +42,9 @@ class ObjectsScene: public QGraphicsScene { vector removed_objs; + //! \brief Holds the tables/views which have selected children objects + QList tabs_sel_children; + //! \brief Indicates if the corner move is enabled for the scene static bool corner_move, @@ -235,9 +238,12 @@ class ObjectsScene: public QGraphicsScene { bool isRelationshipLineVisible(void); bool isMovingObjects(void); + QList selectedItems(void) const; + public slots: void alignObjectsToGrid(void); void update(void); + void clearSelection(void); //! \brief Toggles the object range selection void enableRangeSelection(bool value); @@ -251,10 +257,13 @@ class ObjectsScene: public QGraphicsScene { void moveObjectScene(void); //! \brief Handles and redirects the signal emitted by the selected child object - void emitChildObjectSelection(TableObject *child_obj); + void handlePopupMenuRequested(TableObject *child_obj); //! \brief Handles and redirects the signal emitted by the selected object - void emitObjectSelection(BaseGraphicObject *object, bool selected); + void handleObjectSelection(BaseGraphicObject *object, bool selected); + + //! \brief Handles the tables children objects selection changes + void handleChildrenSelectionChanged(void); signals: //! \brief Signal emitted when the user start or finalizes a object movement. @@ -299,6 +308,9 @@ class ObjectsScene: public QGraphicsScene { //! \brief Signal emitted when objects are moved from a layer to another void s_objectsMovedLayer(void); + //! \brief Signal emitted when tables children objects have their selection statuses changed + void s_childrenSelectionChanged(void); + friend class ModelWidget; }; diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index e1e7e14eb0..7a969df4f6 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -32,24 +32,21 @@ const QString TableObjectView::ConstrDelimEnd=QString("»"); TableObjectView::TableObjectView(TableObject *object) : BaseObjectView(object) { descriptor=nullptr; + fake_selection=false; + obj_selection=new RoundedRectItem; for(unsigned i=0; i < 3; i++) - { lables[i]=new QGraphicsSimpleTextItem; - //this->addToGroup(lables[i]); - } } TableObjectView::~TableObjectView(void) { - //this->removeFromGroup(descriptor); delete(descriptor); for(unsigned i=0; i < 3; i++) - { - //this->removeFromGroup(lables[i]); delete(lables[i]); - } + + delete(obj_selection); } void TableObjectView::configureDescriptor(ConstraintType constr_type) @@ -71,7 +68,6 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) if(descriptor && ((ellipse_desc && !dynamic_cast(descriptor)) || (!ellipse_desc && dynamic_cast(descriptor)))) { - //this->removeFromGroup(descriptor); delete(descriptor); descriptor=nullptr; } @@ -645,6 +641,45 @@ QString TableObjectView::getConstraintString(Column *column) else return(QString()); } +void TableObjectView::setFakeSelection(bool value) +{ + fake_selection = value; + configureObjectSelection(); + + if(value) + sel_order=++BaseObjectView::global_sel_order; + else + sel_order = 0; +} + +bool TableObjectView::hasFakeSelection(void) +{ + return(fake_selection); +} + +void TableObjectView::configureObjectSelection(void) +{ + QGraphicsItem *parent = this->parentItem(); + RoundedRectItem *rect_item=dynamic_cast(obj_selection); + QRectF rect = this->boundingRect(); + + rect.setX(0); + rect.setY(0); + rect.setHeight(rect.height() - VertSpacing); + + // An small hack to capture the width of the table in which the item is child of + if(parent->parentItem()) + rect.setWidth(parent->parentItem()->boundingRect().width() - (2.5 * HorizSpacing)); + else + rect.setWidth(rect.width() - (3.5 * HorizSpacing)); + + rect_item->setBorderRadius(2); + rect_item->setRect(rect); + rect_item->setPos(0, VertSpacing/2); + rect_item->setBrush(this->getFillStyle(Attributes::ObjSelection)); + rect_item->setPen(this->getBorderStyle(Attributes::ObjSelection)); +} + void TableObjectView::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { painter->save(); @@ -662,6 +697,12 @@ void TableObjectView::paint(QPainter *painter, const QStyleOptionGraphicsItem *o lables[i]->paint(painter, option, widget); painter->restore(); } + + if(fake_selection) + { + painter->translate(obj_selection->pos()); + obj_selection->paint(painter, option, widget); + } } QRectF TableObjectView::boundingRect(void) const diff --git a/libobjrenderer/src/tableobjectview.h b/libobjrenderer/src/tableobjectview.h index 1d1aeec450..4077462b02 100644 --- a/libobjrenderer/src/tableobjectview.h +++ b/libobjrenderer/src/tableobjectview.h @@ -37,6 +37,8 @@ class TableObjectView: public BaseObjectView //! \brief Table object descriptor QGraphicsItem *descriptor; + bool fake_selection; + //! \brief Labels used to show objects informatoni (name, type, constraints/aliases) QGraphicsSimpleTextItem *lables[3]; @@ -92,12 +94,14 @@ class TableObjectView: public BaseObjectView that is applyed to the passed column */ static QString getConstraintString(Column *column); + void setFakeSelection(bool value); + bool hasFakeSelection(void); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr); virtual QRectF boundingRect(void) const; - + virtual void configureObjectSelection(void); void configureObjectShadow(void) = delete; - void configureObjectSelection(void) = delete; }; #endif diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 2a69677441..45c60eebb5 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -489,6 +489,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(scene, SIGNAL(s_popupMenuRequested(BaseObject*)), this, SLOT(configureObjectMenu(BaseObject *))); connect(scene, SIGNAL(s_popupMenuRequested(void)), this, SLOT(showObjectMenu(void))); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), this, SLOT(configureObjectSelection(void))); + connect(scene, SIGNAL(s_childrenSelectionChanged()), this, SLOT(configureObjectSelection(void))); connect(scene, SIGNAL(s_objectsSelectedInRange(void)), this, SLOT(configureObjectSelection(void))); connect(scene, &ObjectsScene::s_collapseModeChanged, [&](){ modified = true; }); connect(scene, &ObjectsScene::s_paginationToggled, [&](){ modified = true; }); @@ -499,6 +500,7 @@ ModelWidget::ModelWidget(QWidget *parent) : QWidget(parent) connect(scene, SIGNAL(s_popupMenuRequested(BaseObject*)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_popupMenuRequested(void)), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_objectSelected(BaseGraphicObject*,bool)), new_obj_overlay_wgt, SLOT(hide())); + connect(scene, SIGNAL(s_childrenSelectionChanged()), new_obj_overlay_wgt, SLOT(hide())); connect(scene, SIGNAL(s_objectsScenePressed(Qt::MouseButtons)), new_obj_overlay_wgt, SLOT(hide())); viewport->installEventFilter(this); diff --git a/libpgmodeler_ui/src/sqltoolwidget.cpp b/libpgmodeler_ui/src/sqltoolwidget.cpp index 9e8e7a3bc4..7c803e7b6d 100644 --- a/libpgmodeler_ui/src/sqltoolwidget.cpp +++ b/libpgmodeler_ui/src/sqltoolwidget.cpp @@ -245,13 +245,15 @@ DatabaseExplorerWidget *SQLToolWidget::browseDatabase(void) { try { + DatabaseExplorerWidget *db_explorer_wgt=nullptr; + //If the selected database is already being browse do not create another explorer instance if(database_cmb->currentIndex() > 0) { Connection conn=(*reinterpret_cast(connections_cmb->itemData(connections_cmb->currentIndex()).value())); QString maintainance_db=conn.getConnectionParam(Connection::ParamDbName); - DatabaseExplorerWidget *db_explorer_wgt=new DatabaseExplorerWidget; + db_explorer_wgt=new DatabaseExplorerWidget; db_explorer_wgt->setObjectName(database_cmb->currentText()); conn.setConnectionParam(Connection::ParamDbName, database_cmb->currentText()); db_explorer_wgt->setConnection(conn, maintainance_db); @@ -272,9 +274,9 @@ DatabaseExplorerWidget *SQLToolWidget::browseDatabase(void) /* Forcing the signal s_sqlExecutionRequested to be emitted to properly register the new tab on the map of sql panes related to the database explorer */ db_explorer_wgt->runsql_tb->click(); - - return(db_explorer_wgt); } + + return(db_explorer_wgt); } catch(Exception &e) { From 65d0325823d33693fa5c9dd39b4b3daafd85b521 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 29 Jun 2019 09:34:24 -0300 Subject: [PATCH 397/425] Starting to add support to snapshot builds --- libutils/src/globalattributes.cpp | 10 ++++++++- linuxdeploy.sh | 35 ++++++++++++++++++++++++------- pgmodeler.pri | 3 +++ 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index 9f3f111fbe..1cf5ba4f28 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -25,7 +25,15 @@ namespace GlobalAttributes { PgModelerAppName=QString("pgmodeler"), PgModelerURI=QString("pgmodeler.io"), PGMODELER_REVERSE_URI=QString("io.pgmodeler"), - PgModelerVersion=QString("0.9.2-beta1"), + PgModelerVersion=QString("0.9.2-beta1") + + /* Appending the snapshot build number to the version number + * when the external variable SNAPSHOT_BUILD is defined */ + #if defined(SNAPSHOT_BUILD) + + QString("_snapshot") + BUILDNUM + #endif + , + PgModelerBuildNumber=QString(BUILDNUM), PgModelerSite=QString("https://pgmodeler.io"), PgModelerSupport=QString("https://pgmodeler.io/support/docs"), diff --git a/linuxdeploy.sh b/linuxdeploy.sh index c8c5717be6..68ed500ee6 100755 --- a/linuxdeploy.sh +++ b/linuxdeploy.sh @@ -27,7 +27,7 @@ LOG="$PWD/linuxdeploy.log" QT_IFW_ROOT=/opt/qt-ifw-3.0.4 # Detecting current pgModeler version -DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/"),//g' | sed 's/^ *//g' | cut -s -f2` +DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/")//g' | sed 's/^ *//g' | cut -s -f2` STARTUP_SCRIPT="start-pgmodeler.sh" MIME_UPDATE_SCRIPT="dbm-mime-type.sh" @@ -47,13 +47,15 @@ INSTALLER_TMPL_PKG_CONFIG="package.xml.tmpl" INSTALLER_PKG_CONFIG="package.xml" QT_CONF="$BUILD_DIR/$INSTALL_ROOT/qt.conf" DEP_PLUGINS_DIR="$BUILD_DIR/$INSTALL_ROOT/lib/qtplugins" -BUILD_DATE=`date '+%Y-%m-%d'` - +BUILD_DATE=`date '+%Y%m%d'` + +SNAPSHOT_OPT='-snapshot' GEN_INSTALLER_OPT='-gen-installer' DEMO_VERSION_OPT='-demo-version' NO_QT_LIBS_OPT='-no-qt-libs' BUILD_ALL_OPT='-build-all' COMPRESS_INSTALLER_OPT='-comp-installer' +SNAPSHOT=0 GEN_INST_PKG=0 COMP_INST_PKG=0 DEMO_VERSION=0 @@ -101,6 +103,12 @@ for param in $@; do COMP_INST_PKG=1 fi + if [[ "$param" == "$SNAPSHOT_OPT" ]]; then + SNAPSHOT=1 + QMAKE_ARGS="$QMAKE_ARGS SNAPSHOT_BUILD+=true" + DEPLOY_VER="${DEPLOY_VER}_snapshot${BUILD_DATE}" + fi + if [[ "$param" == "$DEMO_VERSION_OPT" ]]; then DEMO_VERSION=1 GEN_INST_PKG=1 @@ -220,6 +228,10 @@ if [ $GEN_INST_PKG = 1 ]; then fi +if [ $SNAPSHOT = 1 ]; then + echo "Building snapshot version. (Found $SNAPSHOT_OPT)" +fi + if [ $DEMO_VERSION = 1 ]; then echo "Building demonstration version. (Found $DEMO_VERSION_OPT)" fi @@ -427,9 +439,16 @@ echo "pgModeler successfully deployed!" echo if [ $BUILD_ALL = 1 ]; then - if [ $COMP_INST_PKG = 1 ]; then - ./linuxdeploy.sh $DEMO_VERSION_OPT $COMPRESS_INSTALLER_OPT - else - ./linuxdeploy.sh $DEMO_VERSION_OPT - fi + + EXTRA_OPT="" + + if [ $SNAPSHOT = 1 ]; then + EXTRA_OPT="$SNAPSHOT_OPT" + fi + + if [ $COMP_INST_PKG = 1 ]; then + ./linuxdeploy.sh $DEMO_VERSION_OPT $COMPRESS_INSTALLER_OPT $EXTRA_OPT + else + ./linuxdeploy.sh $DEMO_VERSION_OPT $EXTRA_OPT + fi fi diff --git a/pgmodeler.pri b/pgmodeler.pri index 480236d884..5bb9c5905d 100644 --- a/pgmodeler.pri +++ b/pgmodeler.pri @@ -17,6 +17,9 @@ MOC_DIR = moc OBJECTS_DIR = obj UI_DIR = src +# Setting up the flag passed to compiler to indicate a snapshot build +defined(SNAPSHOT_BUILD, var): DEFINES+=SNAPSHOT_BUILD + # Setting up the flag passed to compiler to build the demo version defined(DEMO_VERSION, var): DEFINES+=DEMO_VERSION From 766924bc5b937860c7355acdcdff5dc183c22618 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 29 Jun 2019 16:36:22 -0300 Subject: [PATCH 398/425] Changed the way the PSVI attribute is handled in xmlparser to retrieve big line numbers on a xml doc --- libparsers/src/xmlparser.cpp | 16 ++++++++++++---- libutils/src/globalattributes.cpp | 6 +++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/libparsers/src/xmlparser.cpp b/libparsers/src/xmlparser.cpp index 4e0d1c6e0a..1c4d65e956 100644 --- a/libparsers/src/xmlparser.cpp +++ b/libparsers/src/xmlparser.cpp @@ -291,10 +291,14 @@ bool XmlParser::accessElement(unsigned elem_type) curr_elem=elems[elem_type]; /* NOTE: Due to XML2 implementation big line numbers are stored in the psvi - * attribute so we need to reinterpret cast the value and return the real value */ + * attribute so we need to convert the void* to char and convert it back to integer value */ if(curr_elem->line == 65535 && curr_elem->next && curr_elem->next->psvi != nullptr) { - int aux_line = static_cast(reinterpret_cast(curr_elem->next->psvi)); + char hex_value[10] = ""; + int aux_line = 0; + + sprintf(hex_value, "%p", curr_elem->next->psvi); + aux_line = static_cast(strtol(hex_value, nullptr, 16)); if(curr_line < aux_line) curr_line = aux_line; @@ -431,9 +435,13 @@ int XmlParser::getBufferLineCount(void) last line of the root element. NOTE: Due to XML2 implementation big line numbers are stored in the psvi - attribute so we need to reinterpret cast the value and return the real value */ + attribute so we need to convert the void* to char and convert it back to integer value */ if(xml_doc->last->last->line == 65535 && xml_doc->last->last->psvi != nullptr) - return(static_cast(reinterpret_cast(xml_doc->last->last->psvi))); + { + char hex_value[10] = ""; + sprintf(hex_value, "%p", xml_doc->last->last->psvi); + return(static_cast(strtol(hex_value, nullptr, 16))); + } return(xml_doc->last->last->line); } diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index 1cf5ba4f28..745f52556e 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -22,9 +22,6 @@ namespace GlobalAttributes { const QString - PgModelerAppName=QString("pgmodeler"), - PgModelerURI=QString("pgmodeler.io"), - PGMODELER_REVERSE_URI=QString("io.pgmodeler"), PgModelerVersion=QString("0.9.2-beta1") /* Appending the snapshot build number to the version number @@ -33,7 +30,10 @@ namespace GlobalAttributes { + QString("_snapshot") + BUILDNUM #endif , + /****/ + PgModelerAppName=QString("pgmodeler"), + PgModelerURI=QString("pgmodeler.io"), PgModelerBuildNumber=QString(BUILDNUM), PgModelerSite=QString("https://pgmodeler.io"), PgModelerSupport=QString("https://pgmodeler.io/support/docs"), From 84767c3354496333f78d4d24198f250333629181 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 29 Jun 2019 23:51:18 +0000 Subject: [PATCH 399/425] Adjusted the windows deployment script to accept snapshot builds --- windeploy.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/windeploy.sh b/windeploy.sh index 20e835d9d6..fae2a823d5 100644 --- a/windeploy.sh +++ b/windeploy.sh @@ -3,7 +3,7 @@ LOG=windeploy.log # Detecting current pgModeler version -DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/"),//g'` +DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/")//g'` DEPLOY_VER=${DEPLOY_VER/PGMODELER_VERSION=\"/} DEPLOY_VER=`echo ${DEPLOY_VER/\",/} | tr -d ' '` @@ -13,6 +13,9 @@ DEMO_VERSION=0 BUILD_ALL_OPT='-build-all' BUILD_ALL=0 +SNAPSHOT_OPT='-snapshot' +SNAPSHOT=0 + # Installer settings FMT_PREFIX="C:\/Program Files\/pgmodeler" INSTALLER_APP_VER=`echo $DEPLOY_VER | cut -d '-' -f1` @@ -25,6 +28,7 @@ INSTALLER_CONFIG="config.xml" INSTALLER_TMPL_PKG_CONFIG="package.xml.tmpl" INSTALLER_PKG_CONFIG="package.xml" BUILD_DATE=`date '+%Y-%m-%d'` +BUILD_NUM=`date '+%Y%m%d'` # Setting key paths according to the arch build (x86|x64) # If none of the build type parameter is specified, the default is tu use x86 @@ -48,6 +52,10 @@ for param in $@; do BUILD_ALL=1 DEMO_VERSION=0 fi + if [[ "$param" == "$SNAPSHOT_OPT" ]]; then + SNAPSHOT=1 + DEPLOY_VER="${DEPLOY_VER}_snapshot${BUILD_NUM}" + fi done # Define the base name of the binary @@ -92,6 +100,11 @@ if [ $DEMO_VERSION = 1 ]; then QMAKE_ARGS="$QMAKE_ARGS DEMO_VERSION+=true" fi +if [ $SNAPSHOT = 1 ]; then + QMAKE_ARGS="$QMAKE_ARGS SNAPSHOT_BUILD+=true" +fi + + PKGFILE=$PKGNAME.exe GENINSTALLER=pgmodeler.exe INSTALL_ROOT="$PWD/build" @@ -175,6 +188,10 @@ fi echo echo "Deploying version: $DEPLOY_VER" +if [ $SNAPSHOT = 1 ]; then + echo "Building snapshot version. (Found $SNAPSHOT_OPT)" +fi + if [ $DEMO_VERSION = 1 ]; then echo "Building demonstration version. (Found $DEMO_VERSION_OPT)" fi @@ -297,5 +314,11 @@ echo "pgModeler successfully deployed!" echo if [ $BUILD_ALL -eq 1 ]; then - sh windeploy.sh -demo-version $BUILD_ARCH_PARAM + EXTRA_OPT="" + + if [ $SNAPSHOT = 1 ]; then + EXTRA_OPT="$SNAPSHOT_OPT" + fi + + sh windeploy.sh -demo-version $BUILD_ARCH_PARAM $EXTRA_OPT fi From 8ae2ae5d06b060e82862c6b4ac611e193046b8a3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sat, 29 Jun 2019 21:14:50 -0300 Subject: [PATCH 400/425] Fixed the mac deployment script to accept snapshot builds Restored the removed global attribute PgModelerReverseURI --- libutils/src/globalattributes.cpp | 5 +++-- libutils/src/globalattributes.h | 1 + macdeploy.sh | 19 +++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/libutils/src/globalattributes.cpp b/libutils/src/globalattributes.cpp index 745f52556e..2f7b2cf897 100644 --- a/libutils/src/globalattributes.cpp +++ b/libutils/src/globalattributes.cpp @@ -34,6 +34,7 @@ namespace GlobalAttributes { PgModelerAppName=QString("pgmodeler"), PgModelerURI=QString("pgmodeler.io"), + PgModelerReverseURI=QString("io.pgmodeler"), PgModelerBuildNumber=QString(BUILDNUM), PgModelerSite=QString("https://pgmodeler.io"), PgModelerSupport=QString("https://pgmodeler.io/support/docs"), @@ -89,10 +90,10 @@ namespace GlobalAttributes { #if defined(Q_OS_MAC) ConfigurationsDir=getPathFromEnv(QString("PGMODELER_CONF_DIR"), - QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1").arg(PGMODELER_REVERSE_URI)), + QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1").arg(PgModelerReverseURI)), TemporaryDir=getPathFromEnv(QString("PGMODELER_TMP_DIR"), - QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1/tmp").arg(PGMODELER_REVERSE_URI)), + QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QString("/%1/tmp").arg(PgModelerReverseURI)), #elif defined(Q_OS_LINUX) ConfigurationsDir=getPathFromEnv(QString("PGMODELER_CONF_DIR"), diff --git a/libutils/src/globalattributes.h b/libutils/src/globalattributes.h index 2fb5759b6e..97caa92556 100644 --- a/libutils/src/globalattributes.h +++ b/libutils/src/globalattributes.h @@ -40,6 +40,7 @@ namespace GlobalAttributes { extern const QString PgModelerAppName, PgModelerURI, + PgModelerReverseURI, PgModelerVersion, PgModelerBuildNumber, PgModelerSite, diff --git a/macdeploy.sh b/macdeploy.sh index 1a212edc21..29db01f2df 100755 --- a/macdeploy.sh +++ b/macdeploy.sh @@ -7,22 +7,25 @@ QMAKE_ARGS="-r CONFIG+=x86_64 CONFIG+=release -spec macx-clang" LOG=macdeploy.log # Detecting current pgModeler version -DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/"),//g' | sed 's/^ *//g' | cut -s -f2` +DEPLOY_VER=`cat libutils/src/globalattributes.cpp | grep PgModelerVersion | sed 's/PgModelerVersion=QString("//g' | sed 's/")//g' | sed 's/^ *//g' | cut -s -f2` BUILD_NUM=$(date '+%Y%m%d') -WITH_BUILD_NUM='-with-build-num' DEMO_VERSION_OPT='-demo-version' DEMO_VERSION=0 +SNAPSHOT_OPT='-snapshot' +SNAPSHOT=0 for param in $@; do - if [[ "$param" == "$WITH_BUILD_NUM" ]]; then - PKGNAME="${PKGNAME}_${BUILD_NUM}" - fi - if [[ "$param" == "$DEMO_VERSION_OPT" ]]; then DEMO_VERSION=1 QMAKE_ARGS="$QMAKE_ARGS DEMO_VERSION+=true" fi + + if [[ "$param" == "$SNAPSHOT_OPT" ]]; then + SNAPSHOT=1 + QMAKE_ARGS="$QMAKE_ARGS SNAPSHOT_BUILD+=true" + DEPLOY_VER="${DEPLOY_VER}_snapshot${BUILD_NUM}" + fi done if [ $DEMO_VERSION = 1 ]; then @@ -69,6 +72,10 @@ fi echo echo "Deploying version: $DEPLOY_VER" +if [ $SNAPSHOT = 1 ]; then + echo "Building snapshot version. (Found $SNAPSHOT_OPT)" +fi + if [ $DEMO_VERSION = 1 ]; then echo "Building demonstration version. (Found $DEMO_VERSION_OPT)" fi From 65309612efac723e36e021947cab4af96161d28a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 30 Jun 2019 22:45:17 -0300 Subject: [PATCH 401/425] Adding support to duplicate several table objects at once --- libobjrenderer/src/basetableview.cpp | 60 ++++++++++-------- libobjrenderer/src/basetableview.h | 13 +++- libobjrenderer/src/objectsscene.cpp | 78 +++++++++++++++++------ libobjrenderer/src/objectsscene.h | 3 + libobjrenderer/src/tableobjectview.cpp | 15 ++++- libpgmodeler_ui/src/modelwidget.cpp | 87 +++++++++++++++++++------- 6 files changed, 181 insertions(+), 75 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 3058b944ec..aaa7d0cd0c 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -72,9 +72,15 @@ BaseTableView::BaseTableView(BaseTable *base_tab) : BaseObjectView(base_tab) sel_child_obj_view=nullptr; configurePlaceholder(); + sel_enabler_timer.setInterval(500); + connect(attribs_toggler, SIGNAL(s_collapseModeChanged(CollapseMode)), this, SLOT(configureCollapsedSections(CollapseMode))); connect(attribs_toggler, SIGNAL(s_paginationToggled(bool)), this, SLOT(togglePagination(bool))); connect(attribs_toggler, SIGNAL(s_currentPageChanged(unsigned,unsigned)), this, SLOT(configureCurrentPage(unsigned,unsigned))); + + connect(&sel_enabler_timer, &QTimer::timeout, [&](){ + this->setFlag(QGraphicsItem::ItemIsSelectable, true); + }); } BaseTableView::~BaseTableView(void) @@ -142,18 +148,20 @@ QVariant BaseTableView::itemChange(GraphicsItemChange change, const QVariant &va void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) { //Emit a signal containing the select child object if the user right-click the focused item - if(!this->isSelected() && event->buttons()==Qt::RightButton) + if(!this->isSelected() && event->buttons()==Qt::RightButton && sel_child_obj_view) { - if(this->scene()) - this->scene()->clearSelection(); - - clearChildrenSelection(); - - /* Deactivate the table in order not to hide the child object selection. - The table object is reativated when the context menu is hidden */ - this->setEnabled(false); + // Avoiding clear selection when the focused child item is amongst the other selected children + if(!sel_child_objs.contains(sel_child_obj_view)) + { + // Forcing the selection clearing when we right click an child object that is not selected yet + emit s_sceneClearRequested(); + clearChildrenSelection(); - emit s_popupMenuRequested(dynamic_cast(sel_child_obj_view->getSourceObject())); + /* Deactivate the table in order not to hide the child object selection. + The table object is reativated when the context menu is hidden */ + this->setEnabled(false); + emit s_popupMenuRequested(dynamic_cast(sel_child_obj_view->getSourceObject())); + } } else { @@ -170,24 +178,24 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) sel_child_obj_view->setFakeSelection(!sel_child_obj_view->hasFakeSelection()); if(!sel_child_obj_view->hasFakeSelection()) - { - vector::iterator itr = - std::find(sel_child_objs.begin(), sel_child_objs.end(), sel_child_obj_view); - - if(itr != sel_child_objs.end()) - sel_child_objs.erase(itr); - } + sel_child_objs.removeAll(sel_child_obj_view); else - sel_child_objs.push_back(sel_child_obj_view); + sel_child_objs.append(sel_child_obj_view); sel_child_obj_view = nullptr; event->ignore(); emit s_childrenSelectionChanged(); - - QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); + sel_enabler_timer.start(); } else if((this->flags() & QGraphicsItem::ItemIsSelectable) == QGraphicsItem::ItemIsSelectable) { + // Forcing the scene selection clearing when we right click the table itself directly + if(this->scene() && event->buttons() == Qt::RightButton) + { + emit s_sceneClearRequested(); + this->setSelected(true); + } + clearChildrenSelection(); BaseObjectView::mousePressEvent(event); } @@ -466,22 +474,20 @@ void BaseTableView::configureObjectShadow(void) rect_item->setPos(3.5, 4.5); } -vector BaseTableView::getSelectedChidren(void) +QList BaseTableView::getSelectedChidren(void) { return(sel_child_objs); } void BaseTableView::clearChildrenSelection(void) { - if(sel_child_objs.empty()) + if(sel_child_objs.isEmpty()) return; - while(!sel_child_objs.empty()) - { - sel_child_objs.back()->setFakeSelection(false); - sel_child_objs.pop_back(); - } + for(auto &tab_obj : sel_child_objs) + tab_obj->setFakeSelection(false); + sel_child_objs.clear(); emit s_childrenSelectionChanged(); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index b6683562ba..1a94962acb 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -38,11 +38,16 @@ class BaseTableView: public BaseObjectView { private: Q_OBJECT + /*! \brief This timer is used to control the selection enabling of the object + * in mouse presse event in order to avoid select it instead of a child. + * See mousePressEvent() for details */ + QTimer sel_enabler_timer; + /*! \brief Stores the references to the relationships connected to this table. */ vector connected_rels; //! \brief Stores the selected child objects in order to retrieve them in ObjectScene/ModelWidget - vector sel_child_objs; + QList sel_child_objs; protected: /*! \brief This attributes indicates that the object's geometry update is pending demanding a @@ -163,8 +168,9 @@ class BaseTableView: public BaseObjectView { void configureObjectShadow(void); //! \brief Returns a list of selected children objects - vector getSelectedChidren(void); + QList getSelectedChidren(void); + //! \brief Clear the selection over all selected children void clearChildrenSelection(void); private slots: @@ -201,6 +207,9 @@ class BaseTableView: public BaseObjectView { //! \brief Signal emitted when the user changes the current table's attributes page void s_currentPageChanged(void); + //! \brief Signal emitted when the object need the scene to clear its selection + void s_sceneClearRequested(void); + friend class RelationshipView; }; diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 58978a4eef..0745cdbd0a 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -632,20 +632,24 @@ void ObjectsScene::configurePrinter(QPrinter *printer, const QSizeF &custom_size void ObjectsScene::handlePopupMenuRequested(TableObject *child_obj) { - /* Treats the TableView::s_childObjectSelect() only when there is no - other object selected on the scene */ - if(this->selectedItems().isEmpty()) - emit s_popupMenuRequested(child_obj); + //if(this->selectedItems().isEmpty()) + emit s_popupMenuRequested(child_obj); } void ObjectsScene::handleObjectSelection(BaseGraphicObject *object, bool selected) { + QTextStream out(stdout); + out << "handleObjectSelection" << endl; + if(object) emit s_objectSelected(object, selected); } void ObjectsScene::handleChildrenSelectionChanged(void) { + QTextStream out(stdout); + out << "handleChildrenSelectionChanged" << endl; + BaseTableView *tab_view = dynamic_cast(sender()); if(!tab_view) @@ -653,7 +657,7 @@ void ObjectsScene::handleChildrenSelectionChanged(void) if(tab_view->getSelectedChidren().empty()) tabs_sel_children.removeAll(tab_view); - else + else if(!tabs_sel_children.contains(tab_view)) tabs_sel_children.append(tab_view); emit s_childrenSelectionChanged(); @@ -676,6 +680,7 @@ void ObjectsScene::addItem(QGraphicsItem *item) connect(tab, SIGNAL(s_collapseModeChanged()), this, SIGNAL(s_collapseModeChanged())); connect(tab, SIGNAL(s_paginationToggled()), this, SIGNAL(s_paginationToggled())); connect(tab, SIGNAL(s_currentPageChanged()), this, SIGNAL(s_currentPageChanged())); + connect(tab, SIGNAL(s_sceneClearRequested()), this, SLOT(clearSelection())); } if(obj) @@ -744,8 +749,8 @@ void ObjectsScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) void ObjectsScene::mousePressEvent(QGraphicsSceneMouseEvent *event) { //Gets the item at mouse position - QGraphicsItem* item=this->itemAt(event->scenePos().x(), event->scenePos().y(), QTransform()); - bool is_deselection = !this->selectedItems().isEmpty() && !this->itemAt(event->scenePos(), QTransform()); + QGraphicsItem* item=this->itemAt(event->scenePos(), QTransform()); + bool is_deselection = !this->selectedItems().isEmpty() && !item; if(selectedItems().empty()) emit s_objectsScenePressed(event->buttons()); @@ -760,6 +765,12 @@ void ObjectsScene::mousePressEvent(QGraphicsSceneMouseEvent *event) if(is_deselection) this->blockItemsSignals(true); + /* If we're handling a deselection of the user selected another object whitout being holding Control + * we need to deselect the tables' children objects too */ + if(is_deselection || (event->buttons()==Qt::LeftButton && (event->modifiers() & Qt::ControlModifier) != Qt::ControlModifier)) + //Forcing the clear on all selected table children object + clearTablesChildrenSelection(); + QGraphicsScene::mousePressEvent(event); if(is_deselection) @@ -1109,7 +1120,6 @@ void ObjectsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) { - unsigned i, count; QList items=this->selectedItems(), rel_list; double x1,y1,x2,y2, dx, dy; QRectF rect; @@ -1122,6 +1132,7 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) RelationshipView *rel=nullptr; BaseObjectView *obj_view=nullptr; BaseTableView *tab_view=nullptr; + TableObjectView *tab_obj_view=nullptr; QSet tables; //Gathering the relationships inside the selected schemsa in order to move their points too @@ -1130,6 +1141,11 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) obj_view=dynamic_cast(item); sch_view=dynamic_cast(item); tab_view=dynamic_cast(item); + tab_obj_view=dynamic_cast(item); + + // Ignoring table objects items + if(tab_obj_view) + continue; if(obj_view) obj_view->togglePlaceholder(false); @@ -1175,25 +1191,28 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) dx=pnt_end.x() - sel_ini_pnt.x(); dy=pnt_end.y() - sel_ini_pnt.y(); - count=items.size(); - for(i=0; i < count; i++) + for(auto &item : items) { - rel=dynamic_cast(items[i]); + // Ignoring table objects items + tab_obj_view=dynamic_cast(item); + if(tab_obj_view) continue; + + rel=dynamic_cast(item); if(!rel) { if(align_objs_grid) - items[i]->setPos(alignPointToGrid(items[i]->pos())); + item->setPos(alignPointToGrid(item->pos())); else { - QPointF p=items[i]->pos(); + QPointF p=item->pos(); if(p.x() < 0) p.setX(0); if(p.y() < 0) p.setY(0); - items[i]->setPos(p); + item->setPos(p); } - rect.setTopLeft(items[i]->pos()); - rect.setSize(items[i]->boundingRect().size()); + rect.setTopLeft(item->pos()); + rect.setSize(item->boundingRect().size()); } else { @@ -1201,7 +1220,7 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) too. Since relationships cannot be moved naturally (by user) this will be done by the scene. NOTE: this operation is done ONLY WHEN there is more than one object selected! */ points=rel->getSourceObject()->getPoints(); - if(count > 1 && !points.empty()) + if(items.size() > 1 && !points.empty()) { itr=points.begin(); while(itr!=points.end()) @@ -1334,9 +1353,17 @@ void ObjectsScene::update(void) QGraphicsScene::update(this->sceneRect()); } -void ObjectsScene::clearSelection(void) +void ObjectsScene::clearTablesChildrenSelection(void) { + for(auto &tab_obj_view : tabs_sel_children) + tab_obj_view->clearChildrenSelection(); + tabs_sel_children.clear(); +} + +void ObjectsScene::clearSelection(void) +{ + clearTablesChildrenSelection(); QGraphicsScene::clearSelection(); } @@ -1416,10 +1443,21 @@ bool ObjectsScene::isMovingObjects(void) QList ObjectsScene::selectedItems(void) const { + if(tabs_sel_children.empty()) + return(QGraphicsScene::selectedItems()); + QList items = QGraphicsScene::selectedItems(); - for(auto &obj_view :tabs_sel_children) - items.push_back(obj_view); + for(auto &tab_view :tabs_sel_children) + { + for(auto &tab_obj : tab_view->getSelectedChidren()) + items.append(tab_obj); + } return(items); } + +bool ObjectsScene::hasOnlyTableChildrenSelection() const +{ + return(QGraphicsScene::selectedItems().isEmpty() && !tabs_sel_children.isEmpty()); +} diff --git a/libobjrenderer/src/objectsscene.h b/libobjrenderer/src/objectsscene.h index 36ce52cf90..188de734d1 100644 --- a/libobjrenderer/src/objectsscene.h +++ b/libobjrenderer/src/objectsscene.h @@ -128,6 +128,8 @@ class ObjectsScene: public QGraphicsScene { //! \brief Formats the name of the layer removing any invalid chars and doing the desambiguation in case the name already exists QString formatLayerName(const QString &name); + void clearTablesChildrenSelection(void); + protected: //! \brief Brush used to draw the grid over the scene static QBrush grid; @@ -239,6 +241,7 @@ class ObjectsScene: public QGraphicsScene { bool isMovingObjects(void); QList selectedItems(void) const; + bool hasOnlyTableChildrenSelection(void) const; public slots: void alignObjectsToGrid(void); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 7a969df4f6..820903d417 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -33,10 +33,12 @@ TableObjectView::TableObjectView(TableObject *object) : BaseObjectView(object) { descriptor=nullptr; fake_selection=false; - obj_selection=new RoundedRectItem; for(unsigned i=0; i < 3; i++) lables[i]=new QGraphicsSimpleTextItem; + + if(obj_selection) + delete(obj_selection); } TableObjectView::~TableObjectView(void) @@ -650,6 +652,8 @@ void TableObjectView::setFakeSelection(bool value) sel_order=++BaseObjectView::global_sel_order; else sel_order = 0; + + update(); } bool TableObjectView::hasFakeSelection(void) @@ -660,9 +664,16 @@ bool TableObjectView::hasFakeSelection(void) void TableObjectView::configureObjectSelection(void) { QGraphicsItem *parent = this->parentItem(); - RoundedRectItem *rect_item=dynamic_cast(obj_selection); + RoundedRectItem *rect_item=nullptr; QRectF rect = this->boundingRect(); + /* In order to avoid unnecessary memory usage by items that eventually will + * get selection we allocate the object selection rectangle only if the object + * itself is selected by the user, and it'll be allocated until the object's destruction */ + if(!obj_selection) + obj_selection=new RoundedRectItem; + + rect_item = dynamic_cast(obj_selection); rect.setX(0); rect.setY(0); rect.setHeight(rect.height() - VertSpacing); diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 45c60eebb5..6c7c7d05b5 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -951,6 +951,8 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) while(itr!=itr_end) { obj=dynamic_cast(*itr); + itr++; + if(!obj) continue; if(!dynamic_cast(obj) && (obj && !obj->isProtected())) { @@ -971,9 +973,7 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) reg_tables.push_back(tab->getSourceObject()); } } - } - - itr++; + } } } else @@ -982,8 +982,9 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) while(itr!=itr_end) { - obj=dynamic_cast(*itr); + obj = dynamic_cast(*itr); itr++; + if(!obj) continue; if(obj->getObjectType()==ObjectType::Table || obj->getObjectType()==ObjectType::View) { @@ -1701,7 +1702,8 @@ void ModelWidget::showObjectForm(ObjectType obj_type, BaseObject *object, BaseOb { try { - unsigned rel_type=0, res = QDialog::Rejected; + unsigned rel_type=0; + int res = QDialog::Rejected; Schema *sel_schema=dynamic_cast(parent_obj); QPointF obj_pos=pos; @@ -2750,33 +2752,70 @@ void ModelWidget::duplicateObject(void) try { - if(selected_objects.size() == 1 && TableObject::isTableObject(selected_objects[0]->getObjectType())) + if(scene->hasOnlyTableChildrenSelection()) { - BaseObject *object = selected_objects[0], *dup_object=nullptr; + Schema *schema = nullptr; + BaseObject *dup_object=nullptr; BaseTable *table = nullptr; - ObjectType obj_type = object->getObjectType(); + ObjectType obj_type; + QList upd_schemas; + QList upd_view_ref_tables; + QList upd_tables; + QList upd_fk_rels; - table = dynamic_cast(object)->getParentTable(); - PgModelerNs::copyObject(&dup_object, object, obj_type); + op_list->startOperationChain(); - if(table->getObjectType() == ObjectType::Table) - dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); - else - dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); + for(auto &tab_obj : selected_objects) + { + dup_object=nullptr; + obj_type = tab_obj->getObjectType(); + table = dynamic_cast(tab_obj)->getParentTable(); + schema = dynamic_cast(table->getSchema()); + PgModelerNs::copyObject(&dup_object, tab_obj, obj_type); + + if(table->getObjectType() == ObjectType::Table) + dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast
(table)->getObjectList(obj_type), false, QString("_cp"))); + else + dup_object->setName(PgModelerNs::generateUniqueName(dup_object, *dynamic_cast(table)->getObjectList(obj_type), false, QString("_cp"))); + + op_id=op_list->registerObject(dup_object, Operation::ObjectCreated, -1, table); + table->addObject(dup_object); + + // Flagging the table to be repainted + if(!upd_tables.contains(table)) + upd_tables.append(table); + + // Flagging the schema to be repainted + if(!upd_schemas.contains(schema)) + upd_schemas.append(schema); + + // Flagging the table to have the view references (relationships) updated + if(!upd_view_ref_tables.contains(table) && obj_type == ObjectType::Column) + upd_view_ref_tables.append(table); + // Flagging the table to have its fk relationships updated + else if(!upd_fk_rels.contains(table) && + obj_type == ObjectType::Constraint && + dynamic_cast(tab_obj)->getConstraintType() == ConstraintType::ForeignKey) + upd_fk_rels.append(table); + } - op_id=op_list->registerObject(dup_object, Operation::ObjectCreated, -1, table); - table->addObject(dup_object); - table->setModified(true); - dynamic_cast(table->getSchema())->setModified(true); + op_list->finishOperationChain(); + scene->clearSelection(); - if(obj_type == ObjectType::Column) + for(auto &tab : upd_tables) + tab->setModified(true); + + for(auto &sch : upd_schemas) + sch->setModified(true); + + for(auto &tab : upd_view_ref_tables) { - db_model->validateRelationships(); - db_model->updateViewsReferencingTable(dynamic_cast
(table)); + db_model->validateRelationships(); + db_model->updateViewsReferencingTable(dynamic_cast
(tab)); } - else if(obj_type == ObjectType::Constraint && - dynamic_cast(object)->getConstraintType() == ConstraintType::ForeignKey) - db_model->updateTableFKRelationships(dynamic_cast
(table)); + + for(auto &tab : upd_fk_rels) + db_model->updateTableFKRelationships(dynamic_cast
(tab)); emit s_objectCreated(); } From b7539ec6d8d5dcc43e1ee22b24690ff6f629d0f5 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 30 Jun 2019 23:23:40 -0300 Subject: [PATCH 402/425] Avoiding selecting table items in BaseTableView::mousePressEvent which doens't contain an underlying (source) object Improved the object protection action in ModelWidget in order to accept the multi item selection on tables --- libobjrenderer/src/basetableview.cpp | 7 ++- libobjrenderer/src/tableobjectview.cpp | 4 +- libpgmodeler_ui/src/modelwidget.cpp | 81 ++++++++++---------------- 3 files changed, 40 insertions(+), 52 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index aaa7d0cd0c..42b245c070 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -151,7 +151,7 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) if(!this->isSelected() && event->buttons()==Qt::RightButton && sel_child_obj_view) { // Avoiding clear selection when the focused child item is amongst the other selected children - if(!sel_child_objs.contains(sel_child_obj_view)) + if(sel_child_obj_view->getSourceObject() && !sel_child_objs.contains(sel_child_obj_view)) { // Forcing the selection clearing when we right click an child object that is not selected yet emit s_sceneClearRequested(); @@ -172,7 +172,10 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) attribs_toggler->isVisible() && attribs_toggler->boundingRect().contains(pnt)) attribs_toggler->setButtonSelected(pnt, true); - if(sel_child_obj_view && event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) + /* We select children object only if the have a source object (column, constraint, trigger, etc). View references + * items should not be selected here because they do not have a source object */ + if(sel_child_obj_view && sel_child_obj_view->getSourceObject() && + event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) { this->setFlag(QGraphicsItem::ItemIsSelectable, false); sel_child_obj_view->setFakeSelection(!sel_child_obj_view->hasFakeSelection()); diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index 820903d417..aa9ea74578 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -646,10 +646,12 @@ QString TableObjectView::getConstraintString(Column *column) void TableObjectView::setFakeSelection(bool value) { fake_selection = value; - configureObjectSelection(); if(value) + { + configureObjectSelection(); sel_order=++BaseObjectView::global_sel_order; + } else sel_order = 0; diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 6c7c7d05b5..36b9b4eed4 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -2179,53 +2179,14 @@ void ModelWidget::protectObject(void) QObject *obj_sender=sender(); ObjectType obj_type; TableObject *tab_obj=nullptr; - BaseObject *object=nullptr; - BaseGraphicObject *graph_obj=nullptr; bool protect=false; - vector::iterator itr, itr_end; + QList upd_objects; + Messagebox msgbox; scene->blockSignals(true); - if(this->selected_objects.size()==1) - { - tab_obj=dynamic_cast(this->selected_objects[0]); - graph_obj=dynamic_cast(this->selected_objects[0]); - - if(graph_obj) - { - bool protect=!graph_obj->isProtected(); - - if(graph_obj->getObjectType()==ObjectType::Schema) - { - Messagebox msgbox; - msgbox.show(QString(QT_TR_NOOP("Do you want to %1 the selected schema's children too?")).arg(protect ? QT_TR_NOOP("protect") : QT_TR_NOOP("unprotect")), - Messagebox::ConfirmIcon, Messagebox::YesNoButtons); - - if(msgbox.result()==QDialog::Accepted) - { - vector objects(db_model->getObjects(this->selected_objects[0])); - - for(BaseObject *obj : objects) - obj->setProtected(protect); - } - } - - graph_obj->setProtected(protect); - } - else if(tab_obj) - { - tab_obj->setProtected(!tab_obj->isProtected()); - - //Force the update of the parent table - dynamic_cast
(tab_obj->getParentTable())->setModified(true); - } - else - { - this->selected_objects[0]->setProtected(!this->selected_objects[0]->isProtected()); - } - } //Protects the whole model if there is no selected object - else if(this->selected_objects.empty()) + if(this->selected_objects.empty()) { if(obj_sender==action_protect || obj_sender==action_unprotect) db_model->setProtected(!db_model->isProtected()); @@ -2233,16 +2194,10 @@ void ModelWidget::protectObject(void) //If there is more than one selected object, make a batch protection/unprotection else { - itr=this->selected_objects.begin(); - itr_end=this->selected_objects.end(); protect=(!this->selected_objects[0]->isProtected()); - while(itr!=itr_end) + for(auto &object : selected_objects) { - object=(*itr); - - itr++; - obj_type=object->getObjectType(); if(obj_type==ObjectType::Column || obj_type==ObjectType::Constraint) @@ -2257,10 +2212,37 @@ void ModelWidget::protectObject(void) } } + // Applying protection status for the schema children objects + if(obj_type==ObjectType::Schema) + { + if(!msgbox.isCustomOptionChecked()) + { + msgbox.setCustomOptionText("Apply to all other selected schemas"); + msgbox.show(QString(QT_TR_NOOP("Do you want to %1 the children of the schema %2 too?")) + .arg(protect ? QT_TR_NOOP("protect") : QT_TR_NOOP("unprotect")).arg(object->getName()), + Messagebox::ConfirmIcon, Messagebox::YesNoButtons); + } + + if(msgbox.result()==QDialog::Accepted || msgbox.isCustomOptionChecked()) + { + vector objects(db_model->getObjects(object)); + + for(BaseObject *obj : objects) + obj->setProtected(protect); + } + } + object->setProtected(protect); + tab_obj = dynamic_cast(object); + + if(tab_obj && !upd_objects.contains(tab_obj->getParentTable())) + upd_objects.push_back(tab_obj->getParentTable()); } } + for(auto &obj : upd_objects) + obj->setModified(true); + protected_model_frm->setVisible(db_model->isProtected()); scene->blockSignals(false); scene->clearSelection(); @@ -2817,6 +2799,7 @@ void ModelWidget::duplicateObject(void) for(auto &tab : upd_fk_rels) db_model->updateTableFKRelationships(dynamic_cast
(tab)); + this->setModified(true); emit s_objectCreated(); } else if(!selected_objects.empty()) From 1d3d6774b793c3315bb1a79b79c79ffd52ffd95a Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 30 Jun 2019 23:50:42 -0300 Subject: [PATCH 403/425] Renamed BaseObjectView::getSourceObject to getUnderlyingObject Forcing the fake object selection status of TableObjectView to be false when the parent table/view is being configured --- libobjrenderer/src/baseobjectview.cpp | 18 +++++------ libobjrenderer/src/baseobjectview.h | 2 +- libobjrenderer/src/basetableview.cpp | 30 +++++++++--------- libobjrenderer/src/basetableview.h | 2 +- libobjrenderer/src/graphicalview.cpp | 5 ++- libobjrenderer/src/objectsscene.cpp | 28 ++++++++--------- libobjrenderer/src/relationshipview.cpp | 42 ++++++++++++------------- libobjrenderer/src/relationshipview.h | 2 +- libobjrenderer/src/schemaview.cpp | 4 +-- libobjrenderer/src/tableobjectview.cpp | 17 ++++++---- libobjrenderer/src/tableview.cpp | 8 +++-- libobjrenderer/src/textboxview.cpp | 2 +- libpgmodeler_ui/src/modelwidget.cpp | 16 +++++----- libpgmodeler_ui/src/sceneinfowidget.cpp | 4 +-- 14 files changed, 96 insertions(+), 84 deletions(-) diff --git a/libobjrenderer/src/baseobjectview.cpp b/libobjrenderer/src/baseobjectview.cpp index 0b140194a1..0d2884b382 100644 --- a/libobjrenderer/src/baseobjectview.cpp +++ b/libobjrenderer/src/baseobjectview.cpp @@ -150,7 +150,7 @@ void BaseObjectView::setSourceObject(BaseObject *object) } } -BaseObject *BaseObjectView::getSourceObject(void) +BaseObject *BaseObjectView::getUnderlyingObject(void) { return(reinterpret_cast(this->data(0).value())); } @@ -367,7 +367,7 @@ QVariant BaseObjectView::itemChange(GraphicsItemChange change, const QVariant &v { if(change==ItemPositionHasChanged) { - BaseGraphicObject *graph_obj=dynamic_cast(this->getSourceObject()); + BaseGraphicObject *graph_obj=dynamic_cast(this->getUnderlyingObject()); if(graph_obj && !graph_obj->isProtected()) { @@ -385,7 +385,7 @@ QVariant BaseObjectView::itemChange(GraphicsItemChange change, const QVariant &v obj_selection->setVisible(value.toBool()); this->configurePositionInfo(this->pos()); - emit s_objectSelected(dynamic_cast(this->getSourceObject()), value.toBool()); + emit s_objectSelected(dynamic_cast(this->getUnderlyingObject()), value.toBool()); } return(value); @@ -406,7 +406,7 @@ QRectF BaseObjectView::boundingRect(void) const void BaseObjectView::toggleProtectionIcon(bool value) { - BaseGraphicObject *obj_graf=dynamic_cast(this->getSourceObject()); + BaseGraphicObject *obj_graf=dynamic_cast(this->getUnderlyingObject()); protected_icon->setVisible(value); this->setFlag(QGraphicsItem::ItemIsMovable, !value); @@ -455,9 +455,9 @@ void BaseObjectView::configureSQLDisabledInfo(void) { double px=0, py=0; - sql_disabled_item->setVisible(this->getSourceObject()->isSQLDisabled()); + sql_disabled_item->setVisible(this->getUnderlyingObject()->isSQLDisabled()); - if(this->getSourceObject()->isSQLDisabled()) + if(this->getUnderlyingObject()->isSQLDisabled()) { QTextCharFormat char_fmt; char_fmt=BaseObjectView::getFontStyle(Attributes::PositionInfo); @@ -539,7 +539,7 @@ void BaseObjectView::configurePlaceholder(void) void BaseObjectView::__configureObject(void) { - BaseGraphicObject *graph_obj=dynamic_cast(this->getSourceObject()); + BaseGraphicObject *graph_obj=dynamic_cast(this->getUnderlyingObject()); if(graph_obj) { @@ -592,7 +592,7 @@ double BaseObjectView::getFontFactor(void) void BaseObjectView::setLayer(unsigned layer) { - BaseGraphicObject *graph_obj = dynamic_cast(this->getSourceObject()); + BaseGraphicObject *graph_obj = dynamic_cast(this->getUnderlyingObject()); if(graph_obj) graph_obj->setLayer(layer); @@ -600,7 +600,7 @@ void BaseObjectView::setLayer(unsigned layer) unsigned BaseObjectView::getLayer(void) { - BaseGraphicObject *graph_obj = dynamic_cast(this->getSourceObject()); + BaseGraphicObject *graph_obj = dynamic_cast(this->getUnderlyingObject()); if(graph_obj) return(graph_obj->getLayer()); diff --git a/libobjrenderer/src/baseobjectview.h b/libobjrenderer/src/baseobjectview.h index 27993f7020..2b05c1aa0f 100644 --- a/libobjrenderer/src/baseobjectview.h +++ b/libobjrenderer/src/baseobjectview.h @@ -134,7 +134,7 @@ class BaseObjectView: public QObject, public QGraphicsItemGroup { QVariant itemChange(GraphicsItemChange change, const QVariant &value); //! \brief Returns the object that is representend by the graphical object - BaseObject *getSourceObject(void); + BaseObject *getUnderlyingObject(void); //! \brief Loads the font / color styels for the objects from a XML configuration file static void loadObjectsStyle(void); diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index 42b245c070..c0357b6204 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -151,7 +151,7 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) if(!this->isSelected() && event->buttons()==Qt::RightButton && sel_child_obj_view) { // Avoiding clear selection when the focused child item is amongst the other selected children - if(sel_child_obj_view->getSourceObject() && !sel_child_objs.contains(sel_child_obj_view)) + if(sel_child_obj_view->getUnderlyingObject() && !sel_child_objs.contains(sel_child_obj_view)) { // Forcing the selection clearing when we right click an child object that is not selected yet emit s_sceneClearRequested(); @@ -160,7 +160,7 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) /* Deactivate the table in order not to hide the child object selection. The table object is reativated when the context menu is hidden */ this->setEnabled(false); - emit s_popupMenuRequested(dynamic_cast(sel_child_obj_view->getSourceObject())); + emit s_popupMenuRequested(dynamic_cast(sel_child_obj_view->getUnderlyingObject())); } } else @@ -174,7 +174,7 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) /* We select children object only if the have a source object (column, constraint, trigger, etc). View references * items should not be selected here because they do not have a source object */ - if(sel_child_obj_view && sel_child_obj_view->getSourceObject() && + if(sel_child_obj_view && sel_child_obj_view->getUnderlyingObject() && event->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier)) { this->setFlag(QGraphicsItem::ItemIsSelectable, false); @@ -245,7 +245,7 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) items.append(columns->childItems()); if(!hide_ext_attribs && - dynamic_cast(this->getSourceObject())->getCollapseMode() == CollapseMode::NotCollapsed) + dynamic_cast(this->getUnderlyingObject())->getCollapseMode() == CollapseMode::NotCollapsed) { items.append(ext_attribs->childItems()); ext_height=ext_attribs->boundingRect().height(); @@ -295,7 +295,7 @@ void BaseTableView::hoverMoveEvent(QGraphicsSceneHoverEvent *event) void BaseTableView::addConnectedRelationship(BaseRelationship *base_rel) { - BaseTable *tab = dynamic_cast(getSourceObject()); + BaseTable *tab = dynamic_cast(getUnderlyingObject()); if(!base_rel || (base_rel && @@ -355,7 +355,7 @@ unsigned BaseTableView::getConnectedRelsCount(BaseTable *src_tab, BaseTable *dst void BaseTableView::configureTag(void) { - BaseTable *tab=dynamic_cast(this->getSourceObject()); + BaseTable *tab=dynamic_cast(this->getUnderlyingObject()); Tag *tag=tab->getTag(); tag_item->setVisible(tag!=nullptr && !hide_tags); @@ -393,7 +393,7 @@ void BaseTableView::configureTag(void) void BaseTableView::__configureObject(double width) { - BaseTable *tab = dynamic_cast(getSourceObject()); + BaseTable *tab = dynamic_cast(getUnderlyingObject()); double height = 0, factor = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->logicalDotsPerInch() / 96.0, pixel_ratio = qApp->screens().at(qApp->desktop()->screenNumber(qApp->activeWindow()))->devicePixelRatio(); @@ -428,9 +428,9 @@ void BaseTableView::__configureObject(double width) attribs_toggler->setPos(title->pos().x(), height - attribs_toggler->boundingRect().height()); - this->table_tooltip=this->getSourceObject()->getName(true) + - QString(" (") + this->getSourceObject()->getTypeName() + QString(") \n") + - QString("Id: %1\n").arg(this->getSourceObject()->getObjectId()) + + this->table_tooltip=this->getUnderlyingObject()->getName(true) + + QString(" (") + this->getUnderlyingObject()->getTypeName() + QString(") \n") + + QString("Id: %1\n").arg(this->getUnderlyingObject()->getObjectId()) + trUtf8("Connected rels: %1").arg(this->getConnectRelsCount()); this->setToolTip(this->table_tooltip); @@ -510,7 +510,7 @@ void BaseTableView::finishGeometryUpdate(void) QTimer::singleShot(300, [&]{ this->setFlag(QGraphicsItem::ItemIsSelectable, true); }); //Updating the schema box that holds the object (if visible) - dynamic_cast(this->getSourceObject()->getSchema())->setModified(true); + dynamic_cast(this->getUnderlyingObject()->getSchema())->setModified(true); } bool BaseTableView::configurePaginationParams(unsigned section_id, unsigned total_attrs, unsigned &start_attr, unsigned &end_attr) @@ -518,7 +518,7 @@ bool BaseTableView::configurePaginationParams(unsigned section_id, unsigned tota if(section_id > BaseTable::ExtAttribsSection) return false; - BaseTable *table = dynamic_cast(getSourceObject()); + BaseTable *table = dynamic_cast(getUnderlyingObject()); unsigned attr_per_page = attribs_per_page[section_id]; start_attr = end_attr = 0; @@ -563,14 +563,14 @@ bool BaseTableView::configurePaginationParams(unsigned section_id, unsigned tota void BaseTableView::configureCollapsedSections(CollapseMode coll_mode) { startGeometryUpdate(); - dynamic_cast(this->getSourceObject())->setCollapseMode(coll_mode); + dynamic_cast(this->getUnderlyingObject())->setCollapseMode(coll_mode); finishGeometryUpdate(); emit s_collapseModeChanged(); } void BaseTableView::togglePagination(bool enabled) { - BaseTable *tab = dynamic_cast(this->getSourceObject()); + BaseTable *tab = dynamic_cast(this->getUnderlyingObject()); startGeometryUpdate(); tab->setPaginationEnabled(enabled); @@ -582,7 +582,7 @@ void BaseTableView::togglePagination(bool enabled) void BaseTableView::configureCurrentPage(unsigned section_id, unsigned page) { startGeometryUpdate(); - dynamic_cast(this->getSourceObject())->setCurrentPage(section_id, page); + dynamic_cast(this->getUnderlyingObject())->setCurrentPage(section_id, page); finishGeometryUpdate(); emit s_currentPageChanged(); } diff --git a/libobjrenderer/src/basetableview.h b/libobjrenderer/src/basetableview.h index 1a94962acb..d25963df79 100644 --- a/libobjrenderer/src/basetableview.h +++ b/libobjrenderer/src/basetableview.h @@ -46,10 +46,10 @@ class BaseTableView: public BaseObjectView { /*! \brief Stores the references to the relationships connected to this table. */ vector connected_rels; + protected: //! \brief Stores the selected child objects in order to retrieve them in ObjectScene/ModelWidget QList sel_child_objs; - protected: /*! \brief This attributes indicates that the object's geometry update is pending demanding a * call to configureObject(). This attribute is set to true only when the objects is invisible * the the configureObject is called. Once the object gets visible again this attribute is set diff --git a/libobjrenderer/src/graphicalview.cpp b/libobjrenderer/src/graphicalview.cpp index e7d7d07387..30903c9845 100644 --- a/libobjrenderer/src/graphicalview.cpp +++ b/libobjrenderer/src/graphicalview.cpp @@ -40,7 +40,7 @@ void GraphicalView::configureObject(void) return; } - View *view=dynamic_cast(this->getSourceObject()); + View *view=dynamic_cast(this->getUnderlyingObject()); int i = 0, count = 0; unsigned start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; QPen pen; @@ -60,6 +60,9 @@ void GraphicalView::configureObject(void) CollapseMode collapse_mode = view->getCollapseMode(); bool has_col_pag = false, has_ext_pag = false; + // Clear the selected children objects vector since we'll (re)configure the whole view + sel_child_objs.clear(); + //Configures the view's title title->configureObject(view); diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 0745cdbd0a..a30e6f33b6 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -247,7 +247,7 @@ void ObjectsScene::setActiveLayers(QList layers_idxs) if(!obj_view->isVisible() && is_in_layer) { if(!sch_view || - (sch_view && dynamic_cast(sch_view->getSourceObject())->isRectVisible())) + (sch_view && dynamic_cast(sch_view->getUnderlyingObject())->isRectVisible())) obj_view->setVisible(true); } else if(obj_view->isVisible() && !is_in_layer) @@ -391,7 +391,7 @@ QRectF ObjectsScene::itemsBoundingRect(bool seek_only_db_objs, bool selected_onl if(obj_view && obj_view->isVisible()) { - graph_obj=dynamic_cast(obj_view->getSourceObject()); + graph_obj=dynamic_cast(obj_view->getUnderlyingObject()); if(graph_obj) { @@ -508,9 +508,9 @@ void ObjectsScene::showRelationshipLine(bool value, const QPointF &p_start) object=dynamic_cast(items.front()); - if(object && object->getSourceObject()) + if(object && object->getUnderlyingObject()) { - base_obj=dynamic_cast(object->getSourceObject()); + base_obj=dynamic_cast(object->getUnderlyingObject()); if(!value && base_obj && base_obj->getObjectType()!=ObjectType::Relationship && @@ -710,8 +710,8 @@ void ObjectsScene::removeItem(QGraphicsItem *item) if(object) { disconnect(object, nullptr, this, nullptr); - disconnect(object, nullptr, dynamic_cast(object->getSourceObject()), nullptr); - disconnect(dynamic_cast(object->getSourceObject()), nullptr, object, nullptr); + disconnect(object, nullptr, dynamic_cast(object->getUnderlyingObject()), nullptr); + disconnect(dynamic_cast(object->getUnderlyingObject()), nullptr, object, nullptr); removed_objs.push_back(object); } } @@ -739,7 +739,7 @@ void ObjectsScene::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) BaseObjectView *obj=dynamic_cast(this->selectedItems().at(0)); if(obj) - emit s_objectDoubleClicked(dynamic_cast(obj->getSourceObject())); + emit s_objectDoubleClicked(dynamic_cast(obj->getUnderlyingObject())); } else //Emit a signal indicating that no object was selected @@ -1155,7 +1155,7 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) else if(sch_view) { //Get the schema object - Schema *schema=dynamic_cast(sch_view->getSourceObject()); + Schema *schema=dynamic_cast(sch_view->getUnderlyingObject()); if(!schema->isProtected()) { @@ -1219,7 +1219,7 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) /* If the relationship has points added to the line is necessary to move the points too. Since relationships cannot be moved naturally (by user) this will be done by the scene. NOTE: this operation is done ONLY WHEN there is more than one object selected! */ - points=rel->getSourceObject()->getPoints(); + points=rel->getUnderlyingObject()->getPoints(); if(items.size() > 1 && !points.empty()) { itr=points.begin(); @@ -1237,7 +1237,7 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) } //Assing the new points to relationship and reconfigure its line - rel->getSourceObject()->setPoints(points); + rel->getUnderlyingObject()->setPoints(points); rel->configureLine(); } @@ -1272,7 +1272,7 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) if(align_objs_grid) { tab_view->setPos(alignPointToGrid(tab_view->pos())); - schemas.insert(dynamic_cast(tab_view->getSourceObject()->getSchema())); + schemas.insert(dynamic_cast(tab_view->getUnderlyingObject()->getSchema())); } if(BaseObjectView::isPlaceholderEnabled()) @@ -1312,14 +1312,14 @@ void ObjectsScene::alignObjectsToGrid(void) else if(rel) { //Align the relationship points - points=rel->getSourceObject()->getPoints(); + points=rel->getUnderlyingObject()->getPoints(); count1=points.size(); for(i1=0; i1 < count1; i1++) points[i1]=this->alignPointToGrid(points[i1]); if(count1 > 0) { - rel->getSourceObject()->setPoints(points); + rel->getUnderlyingObject()->setPoints(points); rel->configureLine(); } @@ -1335,7 +1335,7 @@ void ObjectsScene::alignObjectsToGrid(void) else if(!dynamic_cast(items[i])) items[i]->setPos(this->alignPointToGrid(items[i]->pos())); else - schemas.push_back(dynamic_cast(dynamic_cast(items[i])->getSourceObject())); + schemas.push_back(dynamic_cast(dynamic_cast(items[i])->getUnderlyingObject())); } } diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 958ef448db..675f2e1fe9 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -204,9 +204,9 @@ QPointF RelationshipView::getConnectionPoint(unsigned table_idx) return(conn_points[table_idx]); } -BaseRelationship *RelationshipView::getSourceObject(void) +BaseRelationship *RelationshipView::getUnderlyingObject(void) { - return(dynamic_cast(this->BaseObjectView::getSourceObject())); + return(dynamic_cast(this->BaseObjectView::getUnderlyingObject())); } TextboxView *RelationshipView::getLabel(unsigned lab_idx) @@ -227,7 +227,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant { unsigned i, count; QPen pen; - QColor color, line_color=this->getSourceObject()->getCustomColor(); + QColor color, line_color=this->getUnderlyingObject()->getCustomColor(); vector rel_lines; this->setSelectionOrder(value.toBool()); @@ -320,7 +320,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant else round_cf_descriptors[idx]->setBrush(descriptor->brush()); - if(this->getSourceObject()->getRelationshipType() == BaseRelationship::RelationshipFk) + if(this->getUnderlyingObject()->getRelationshipType() == BaseRelationship::RelationshipFk) pen.setStyle(Qt::DashLine); round_cf_descriptors[idx]->setPen(pen); @@ -332,7 +332,7 @@ QVariant RelationshipView::itemChange(GraphicsItemChange change, const QVariant for(i=0; i < count; i++) attributes[i]->childItems().at(3)->setVisible(value.toBool()); - emit s_objectSelected(dynamic_cast(this->getSourceObject()), value.toBool()); + emit s_objectSelected(dynamic_cast(this->getUnderlyingObject()), value.toBool()); } return(value); @@ -345,9 +345,9 @@ void RelationshipView::mousePressEvent(QGraphicsSceneMouseEvent *event) BaseObjectView::mousePressEvent(event); this->setFlag(QGraphicsItem::ItemIsMovable, false); - if(!this->getSourceObject()->isProtected()) + if(!this->getUnderlyingObject()->isProtected()) { - BaseRelationship *base_rel=this->getSourceObject(); + BaseRelationship *base_rel=this->getUnderlyingObject(); //Resets the labels position when mid-button is pressed if(event->buttons()==Qt::LeftButton && event->modifiers()==(Qt::AltModifier | Qt::ShiftModifier)) @@ -460,7 +460,7 @@ void RelationshipView::mousePressEvent(QGraphicsSceneMouseEvent *event) void RelationshipView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { if(this->isSelected() && event->buttons()==Qt::LeftButton && - !this->getSourceObject()->isProtected()) + !this->getUnderlyingObject()->isProtected()) { if(dynamic_cast(sel_object)) { @@ -472,7 +472,7 @@ void RelationshipView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) //We only include the point if it is not inside the tables' bounding rect if(!brect.contains(event->pos()) && !brect1.contains(event->pos())) { - BaseRelationship *rel_base=this->getSourceObject(); + BaseRelationship *rel_base=this->getUnderlyingObject(); vector points=rel_base->getPoints(); points[sel_object_idx]=event->pos(); @@ -489,7 +489,7 @@ void RelationshipView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void RelationshipView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { - BaseRelationship *base_rel=this->getSourceObject(); + BaseRelationship *base_rel=this->getUnderlyingObject(); if(event->button()==Qt::LeftButton) { @@ -511,7 +511,7 @@ void RelationshipView::disconnectTables(void) { if(tables[0] && tables[1]) { - BaseRelationship *rel_base=this->getSourceObject(); + BaseRelationship *rel_base=this->getUnderlyingObject(); tables[0]->removeConnectedRelationship(rel_base); @@ -546,7 +546,7 @@ void RelationshipView::connectTables(void) void RelationshipView::configureObject(void) { - BaseRelationship *rel_base=this->getSourceObject(); + BaseRelationship *rel_base=this->getUnderlyingObject(); tables[0]=dynamic_cast(rel_base->getTable(BaseRelationship::SrcTable)->getReceiverObject()); tables[1]=dynamic_cast(rel_base->getTable(BaseRelationship::DstTable)->getReceiverObject()); @@ -582,7 +582,7 @@ void RelationshipView::configureLine(void) if(!configuring_line) { - BaseRelationship *base_rel=this->getSourceObject(); + BaseRelationship *base_rel=this->getUnderlyingObject(); Relationship *rel=dynamic_cast(base_rel); vector points, fk_points, pk_points; QGraphicsLineItem *lin=nullptr; @@ -1264,7 +1264,7 @@ void RelationshipView::configureDescriptor(void) { QLineF lin; QPolygonF pol; - BaseRelationship *base_rel=this->getSourceObject(); + BaseRelationship *base_rel=this->getUnderlyingObject(); Relationship *rel=dynamic_cast(base_rel); unsigned rel_type=base_rel->getRelationshipType(); double x, y, x1, y1, angle = 0, @@ -1437,7 +1437,7 @@ void RelationshipView::configureDescriptor(void) void RelationshipView::configureCrowsFootDescriptors(void) { - BaseRelationship * base_rel = dynamic_cast(this->getSourceObject()); + BaseRelationship * base_rel = dynamic_cast(this->getUnderlyingObject()); Relationship *rel=dynamic_cast(base_rel); //Hiding all descriptors related to crow's foot when the notation is not being used @@ -1693,7 +1693,7 @@ void RelationshipView::configureCrowsFootDescriptors(void) void RelationshipView::configureAttributes(void) { - Relationship *rel=dynamic_cast(this->getSourceObject()); + Relationship *rel=dynamic_cast(this->getUnderlyingObject()); if(rel) { @@ -1812,7 +1812,7 @@ void RelationshipView::configureLabels(void) { double x=0,y=0; QPointF pnt; - BaseRelationship *base_rel=this->getSourceObject(); + BaseRelationship *base_rel=this->getUnderlyingObject(); unsigned rel_type=base_rel->getRelationshipType(); QPointF label_dist; @@ -1833,7 +1833,7 @@ void RelationshipView::configureLabels(void) if(!hide_name_label) { - Textbox *txtbox = dynamic_cast(labels[BaseRelationship::RelNameLabel]->getSourceObject()); + Textbox *txtbox = dynamic_cast(labels[BaseRelationship::RelNameLabel]->getUnderlyingObject()); if(compact_view && !base_rel->getAlias().isEmpty()) { @@ -1984,7 +1984,7 @@ void RelationshipView::configureLabelPosition(unsigned label_id, double x, doubl if(labels[label_id]) { - BaseRelationship *base_rel=this->getSourceObject(); + BaseRelationship *base_rel=this->getUnderlyingObject(); QTextCharFormat char_fmt; QPointF label_dist; @@ -2005,7 +2005,7 @@ void RelationshipView::configureLabelPosition(unsigned label_id, double x, doubl labels[label_id]->setFontStyle(char_fmt); labels[label_id]->setColorStyle(BaseObjectView::getFillStyle(Attributes::Label), BaseObjectView::getBorderStyle(Attributes::Label)); - dynamic_cast(labels[label_id]->getSourceObject())->setModified(true); + dynamic_cast(labels[label_id]->getUnderlyingObject())->setModified(true); } } @@ -2015,7 +2015,7 @@ QRectF RelationshipView::__boundingRect(void) unsigned i, count; QPointF p; QRectF rect; - vector points=dynamic_cast(this->getSourceObject())->getPoints(); + vector points=dynamic_cast(this->getUnderlyingObject())->getPoints(); //The reference size will be the relationship descriptor dimension x1=descriptor->pos().x(); diff --git a/libobjrenderer/src/relationshipview.h b/libobjrenderer/src/relationshipview.h index 6a9f26481d..eae957c5b4 100644 --- a/libobjrenderer/src/relationshipview.h +++ b/libobjrenderer/src/relationshipview.h @@ -169,7 +169,7 @@ class RelationshipView: public BaseObjectView { QRectF __boundingRect(void); //! \brief Returns the relationship that generates the graphical representation - BaseRelationship *getSourceObject(void); + BaseRelationship *getUnderlyingObject(void); //! \brief Hides the relationship's name label. This applies to all relationship instances static void setHideNameLabel(bool value); diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index a3fe2e223d..40bd08bc54 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -73,7 +73,7 @@ void SchemaView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) void SchemaView::fetchChildren(void) { - Schema *schema=dynamic_cast(this->getSourceObject()); + Schema *schema=dynamic_cast(this->getUnderlyingObject()); DatabaseModel *model=dynamic_cast(schema->getDatabase()); vector objs, objs1; @@ -166,7 +166,7 @@ void SchemaView::moveTo(QPointF new_pos) void SchemaView::configureObject(void) { - Schema *schema=dynamic_cast(this->getSourceObject()); + Schema *schema=dynamic_cast(this->getUnderlyingObject()); this->fetchChildren(); /* Only configures the schema view if the rectangle is visible and there are diff --git a/libobjrenderer/src/tableobjectview.cpp b/libobjrenderer/src/tableobjectview.cpp index aa9ea74578..7a018ea68a 100644 --- a/libobjrenderer/src/tableobjectview.cpp +++ b/libobjrenderer/src/tableobjectview.cpp @@ -54,14 +54,14 @@ TableObjectView::~TableObjectView(void) void TableObjectView::configureDescriptor(ConstraintType constr_type) { ObjectType obj_type=ObjectType::BaseObject; - Column *column=dynamic_cast(this->getSourceObject()); + Column *column=dynamic_cast(this->getUnderlyingObject()); bool ellipse_desc=false; double factor=(font_config[Attributes::Global].font().pointSizeF()/DefaultFontSize) * BaseObjectView::getScreenDpiFactor(); QPen pen; //Based upon the source object type the descriptor is allocated - if(this->getSourceObject()) - obj_type=this->getSourceObject()->getObjectType(); + if(this->getUnderlyingObject()) + obj_type=this->getUnderlyingObject()->getObjectType(); /* Elliptical descriptor is used to columns (with or without not-null constraint), for other object types, polygonal descriptor is usded */ @@ -147,7 +147,7 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) } else if(obj_type != ObjectType::BaseObject) { - TableObject *tab_obj=dynamic_cast(this->getSourceObject()); + TableObject *tab_obj=dynamic_cast(this->getUnderlyingObject()); QGraphicsPolygonItem *desc=dynamic_cast(descriptor); QPolygonF pol; @@ -179,12 +179,12 @@ void TableObjectView::configureDescriptor(ConstraintType constr_type) void TableObjectView::configureObject(void) { - if(this->getSourceObject()) + if(this->getUnderlyingObject()) { QTextCharFormat fmt; double px = 0; QString str_constr, tooltip, atribs_tip; - TableObject *tab_obj=dynamic_cast(this->getSourceObject()); + TableObject *tab_obj=dynamic_cast(this->getUnderlyingObject()); Column *column=dynamic_cast(tab_obj); ConstraintType constr_type=ConstraintType::Null; bool sql_disabled=false; @@ -192,6 +192,7 @@ void TableObjectView::configureObject(void) tooltip=tab_obj->getName() + QString(" (") + tab_obj->getTypeName() + QString(")"); tooltip+=QString("\nId: %1").arg(tab_obj->getObjectId()); sql_disabled=tab_obj->isSQLDisabled(); + fake_selection=false; if(column) { @@ -645,6 +646,10 @@ QString TableObjectView::getConstraintString(Column *column) void TableObjectView::setFakeSelection(bool value) { + // Fake selection is used only by instances that own and underlying object (column, constratin, trigger,etc) + if(!this->getUnderlyingObject()) + return; + fake_selection = value; if(value) diff --git a/libobjrenderer/src/tableview.cpp b/libobjrenderer/src/tableview.cpp index c48e665461..2b6e1119d9 100644 --- a/libobjrenderer/src/tableview.cpp +++ b/libobjrenderer/src/tableview.cpp @@ -35,7 +35,7 @@ void TableView::configureObject(void) return; } - Table *table=dynamic_cast
(this->getSourceObject()); + Table *table=dynamic_cast
(this->getUnderlyingObject()); int i, count, obj_idx; double width=0, px=0, cy=0, old_width=0, old_height=0; unsigned start_col = 0, end_col = 0, start_ext = 0, end_ext = 0; @@ -55,6 +55,10 @@ void TableView::configureObject(void) ObjectType::Rule, ObjectType::Policy }; bool has_col_pag = false, has_ext_pag = false; + + // Clear the selected children objects vector since we'll (re)configure the whole table + sel_child_objs.clear(); + //Configures the table title title->configureObject(table); @@ -222,7 +226,7 @@ void TableView::configureObject(void) //Generating the connection points of the columns if(obj_idx==0) { - tab_obj=dynamic_cast(col_item->getSourceObject()); + tab_obj=dynamic_cast(col_item->getUnderlyingObject()); cy=title->boundingRect().height() + col_item->pos().y() + (col_item->boundingRect().height()/2); conn_points[tab_obj].resize(2); conn_points[tab_obj][LeftConnPoint]=QPointF(col_item->pos().x() - 1.5, cy); diff --git a/libobjrenderer/src/textboxview.cpp b/libobjrenderer/src/textboxview.cpp index 3099b48c36..4032a18a42 100644 --- a/libobjrenderer/src/textboxview.cpp +++ b/libobjrenderer/src/textboxview.cpp @@ -73,7 +73,7 @@ void TextboxView::setToolTip(const QString &tooltip) void TextboxView::__configureObject(void) { - Textbox *txtbox=dynamic_cast(this->getSourceObject()); + Textbox *txtbox=dynamic_cast(this->getUnderlyingObject()); QTextCharFormat fmt=font_config[Attributes::Global]; QPolygonF polygon; diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 36b9b4eed4..82e409548c 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -967,10 +967,10 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) tables=dynamic_cast(schema->getReceiverObject())->getChildren(); for(auto &tab : tables) { - op_list->registerObject(tab->getSourceObject(), Operation::ObjectMoved); + op_list->registerObject(tab->getUnderlyingObject(), Operation::ObjectMoved); //Registers the table on a auxiliary list to avoid multiple registration on operation history - reg_tables.push_back(tab->getSourceObject()); + reg_tables.push_back(tab->getUnderlyingObject()); } } } @@ -1060,7 +1060,7 @@ void ModelWidget::configureObjectSelection(void) while(itr!=objs_map.end()) { item=dynamic_cast(itr->second); - selected_objects.push_back(item->getSourceObject()); + selected_objects.push_back(item->getUnderlyingObject()); itr++; } @@ -4622,7 +4622,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) //Positioning the root object at the top-left portion of canvas root->setPos(QPointF(50, 50)); - evaluated_tabs.push_back(root->getSourceObject()); + evaluated_tabs.push_back(root->getUnderlyingObject()); items_rect = rearrangeTablesHierarchically(root, evaluated_tabs); max_w = items_rect.width(); @@ -4657,12 +4657,12 @@ void ModelWidget::rearrangeTablesHierarchically(void) } //Once determined the new root we perform the positioning of its "children" - if(root && std::find(evaluated_tabs.begin(), evaluated_tabs.end(), root->getSourceObject()) == evaluated_tabs.end()) + if(root && std::find(evaluated_tabs.begin(), evaluated_tabs.end(), root->getUnderlyingObject()) == evaluated_tabs.end()) { root->setPos(QPointF(50, items_rect.bottom() + 50)); - evaluated_tabs.push_back(root->getSourceObject()); + evaluated_tabs.push_back(root->getUnderlyingObject()); items_rect = rearrangeTablesHierarchically(root, evaluated_tabs); - not_evaluated.erase(std::find(not_evaluated.begin(), not_evaluated.end(), root->getSourceObject())); + not_evaluated.erase(std::find(not_evaluated.begin(), not_evaluated.end(), root->getUnderlyingObject())); if(items_rect.width() > max_w) max_w = items_rect.width(); @@ -4734,7 +4734,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) QRectF ModelWidget::rearrangeTablesHierarchically(BaseTableView *root, vector &evaluated_tabs) { - BaseTable *base_tab = dynamic_cast(root->getSourceObject()), + BaseTable *base_tab = dynamic_cast(root->getUnderlyingObject()), *src_tab = nullptr, *dst_tab = nullptr, *curr_tab = nullptr; vector rels ; double px = 0, py = 0, px1 = 0, py1 = 0; diff --git a/libpgmodeler_ui/src/sceneinfowidget.cpp b/libpgmodeler_ui/src/sceneinfowidget.cpp index 8cc73242e3..bb068458dd 100644 --- a/libpgmodeler_ui/src/sceneinfowidget.cpp +++ b/libpgmodeler_ui/src/sceneinfowidget.cpp @@ -51,8 +51,8 @@ void SceneInfoWidget::updateSelectedObject(BaseObjectView *object) object->boundingRect().width(), object->boundingRect().height()); - obj_icon_lbl->setPixmap(PgModelerUiNs::getIconPath(object->getSourceObject()->getSchemaName())); - obj_name_lbl->setText(QString("%1 (%2)").arg(object->getSourceObject()->getSignature()).arg(object->getSourceObject()->getTypeName())); + obj_icon_lbl->setPixmap(PgModelerUiNs::getIconPath(object->getUnderlyingObject()->getSchemaName())); + obj_name_lbl->setText(QString("%1 (%2)").arg(object->getUnderlyingObject()->getSignature()).arg(object->getUnderlyingObject()->getTypeName())); obj_pos_info_lbl->setText(QString("(%1, %2) [w: %3, h: %4]") .arg(round(rect.left())) .arg(round(rect.top())) From 31218eeaa9ae80289e62c3e0fd3c5db75051d050 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Sun, 30 Jun 2019 23:54:46 -0300 Subject: [PATCH 404/425] Avoiding clear the whole scene selection when the table is already selecet and user requested popup menu --- libobjrenderer/src/basetableview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index c0357b6204..a678fe79ed 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -193,13 +193,13 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) else if((this->flags() & QGraphicsItem::ItemIsSelectable) == QGraphicsItem::ItemIsSelectable) { // Forcing the scene selection clearing when we right click the table itself directly - if(this->scene() && event->buttons() == Qt::RightButton) + if(event->buttons() == Qt::RightButton && !this->isSelected()) { emit s_sceneClearRequested(); + clearChildrenSelection(); this->setSelected(true); } - clearChildrenSelection(); BaseObjectView::mousePressEvent(event); } } From c50f87e116c5361fce1c4039be9d7a8bbd1c5658 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 1 Jul 2019 13:55:01 -0300 Subject: [PATCH 405/425] Fixed a bug in ModelWidget::removeObjects that was causing the removal of relationship added columns Fixed the ModelWidget::configurePopupMenu to consider the table's multi item selection --- libobjrenderer/src/basetableview.cpp | 2 +- libobjrenderer/src/objectsscene.cpp | 7 ------- libpgmodeler_ui/src/modelwidget.cpp | 14 +++++++++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libobjrenderer/src/basetableview.cpp b/libobjrenderer/src/basetableview.cpp index a678fe79ed..203ec33929 100644 --- a/libobjrenderer/src/basetableview.cpp +++ b/libobjrenderer/src/basetableview.cpp @@ -196,10 +196,10 @@ void BaseTableView::mousePressEvent(QGraphicsSceneMouseEvent *event) if(event->buttons() == Qt::RightButton && !this->isSelected()) { emit s_sceneClearRequested(); - clearChildrenSelection(); this->setSelected(true); } + clearChildrenSelection(); BaseObjectView::mousePressEvent(event); } } diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index a30e6f33b6..9894af6c94 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -632,24 +632,17 @@ void ObjectsScene::configurePrinter(QPrinter *printer, const QSizeF &custom_size void ObjectsScene::handlePopupMenuRequested(TableObject *child_obj) { - //if(this->selectedItems().isEmpty()) emit s_popupMenuRequested(child_obj); } void ObjectsScene::handleObjectSelection(BaseGraphicObject *object, bool selected) { - QTextStream out(stdout); - out << "handleObjectSelection" << endl; - if(object) emit s_objectSelected(object, selected); } void ObjectsScene::handleChildrenSelectionChanged(void) { - QTextStream out(stdout); - out << "handleChildrenSelectionChanged" << endl; - BaseTableView *tab_view = dynamic_cast(sender()); if(!tab_view) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 82e409548c..9d76c67b60 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -3017,6 +3017,14 @@ void ModelWidget::removeObjects(bool cascade) if(tab_obj) { + if(tab_obj->isAddedByRelationship()) + { + throw Exception(Exception::getErrorMessage(ErrorCode::RemProtectedObject) + .arg(tab_obj->getName(true)) + .arg(tab_obj->getTypeName()), + ErrorCode::RemProtectedObject,__PRETTY_FUNCTION__,__FILE__,__LINE__); + } + table=dynamic_cast(tab_obj->getParentTable()); obj_idx=table->getObjectIndex(tab_obj->getName(true), obj_type); @@ -3398,7 +3406,7 @@ void ModelWidget::configureFadeMenu(void) fade_in_menu.clear(); fade_out_menu.clear(); - if(is_db_selected || selected_objects.size() > 1) + if(is_db_selected || (selected_objects.size() > 1 && !scene->hasOnlyTableChildrenSelection())) { fade_menu.addAction(action_fade_in); fade_menu.addAction(action_fade_out); @@ -3447,7 +3455,7 @@ void ModelWidget::configureFadeMenu(void) action_fade_out->setMenu(nullptr); } } - else + else if(selected_objects.size() == 1) { ObjectType obj_type = selected_objects[0]->getObjectType(); @@ -3968,7 +3976,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) } if(!tab_obj && - (objects.empty() || objects.size() > 1 || + (objects.empty() || (objects.size() > 1 && !scene->hasOnlyTableChildrenSelection()) || (objects.size() == 1 && (objects[0]->getObjectType() == ObjectType::Database || objects[0]->getObjectType() == ObjectType::Tag || BaseGraphicObject::isGraphicObject(objects[0]->getObjectType()))))) From a21f2765db23b7d2493970c4ea6e379e89f329b8 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 1 Jul 2019 14:34:48 -0300 Subject: [PATCH 406/425] Minor adjustment on SceneInfoWidget to avoid display dimensions of selected columns/constraints on the canvas (dimensions temporarily not available) Rename the method BaseGraphicObject::getReceiverObject to getOverlyingObject (to make sense with its counter part BaseObjctView::getUnderlyingObject) --- libobjrenderer/src/objectsscene.cpp | 4 +- libobjrenderer/src/relationshipview.cpp | 20 +++--- libobjrenderer/src/schemaview.cpp | 2 +- libpgmodeler/src/basegraphicobject.cpp | 2 +- libpgmodeler/src/basegraphicobject.h | 4 +- libpgmodeler_ui/src/modelwidget.cpp | 71 +++++++++++----------- libpgmodeler_ui/src/objectfinderwidget.cpp | 4 +- libpgmodeler_ui/src/sceneinfowidget.cpp | 3 + main-cli/src/pgmodelercli.cpp | 2 +- 9 files changed, 59 insertions(+), 53 deletions(-) diff --git a/libobjrenderer/src/objectsscene.cpp b/libobjrenderer/src/objectsscene.cpp index 9894af6c94..d6b8e32193 100644 --- a/libobjrenderer/src/objectsscene.cpp +++ b/libobjrenderer/src/objectsscene.cpp @@ -1163,9 +1163,9 @@ void ObjectsScene::finishObjectsMove(const QPointF &pnt_end) /* If the relationship contains points and it is not selected then it will be included on the list in order to move their custom line points */ - if(!dynamic_cast(base_rel->getReceiverObject())->isSelected() && + if(!dynamic_cast(base_rel->getOverlyingObject())->isSelected() && !base_rel->getPoints().empty()) - rel_list.push_back(dynamic_cast(base_rel->getReceiverObject())); + rel_list.push_back(dynamic_cast(base_rel->getOverlyingObject())); } tables.unite(sch_view->getChildren().toSet()); diff --git a/libobjrenderer/src/relationshipview.cpp b/libobjrenderer/src/relationshipview.cpp index 675f2e1fe9..bee6ae454d 100644 --- a/libobjrenderer/src/relationshipview.cpp +++ b/libobjrenderer/src/relationshipview.cpp @@ -548,8 +548,8 @@ void RelationshipView::configureObject(void) { BaseRelationship *rel_base=this->getUnderlyingObject(); - tables[0]=dynamic_cast(rel_base->getTable(BaseRelationship::SrcTable)->getReceiverObject()); - tables[1]=dynamic_cast(rel_base->getTable(BaseRelationship::DstTable)->getReceiverObject()); + tables[0]=dynamic_cast(rel_base->getTable(BaseRelationship::SrcTable)->getOverlyingObject()); + tables[1]=dynamic_cast(rel_base->getTable(BaseRelationship::DstTable)->getOverlyingObject()); tables[0]->addConnectedRelationship(rel_base); @@ -659,8 +659,8 @@ void RelationshipView::configureLine(void) rel->getRelationshipType()==Relationship::Relationship11 && rel->isIdentifier()) { - tables[0]=dynamic_cast(rel->getReferenceTable()->getReceiverObject()); - tables[1]=dynamic_cast(rel->getReceiverTable()->getReceiverObject()); + tables[0]=dynamic_cast(rel->getReferenceTable()->getOverlyingObject()); + tables[1]=dynamic_cast(rel->getReceiverTable()->getOverlyingObject()); } if(line_conn_mode==ConnectCenterPoints || line_conn_mode==ConnectTableEdges || !rel_1n) @@ -704,8 +704,8 @@ void RelationshipView::configureLine(void) } rec_tab->getForeignKeys(fks, true, ref_tab); - ref_tab_view=dynamic_cast(ref_tab->getReceiverObject()); - rec_tab_view=dynamic_cast(rec_tab->getReceiverObject()); + ref_tab_view=dynamic_cast(ref_tab->getOverlyingObject()); + rec_tab_view=dynamic_cast(rec_tab->getOverlyingObject()); //Create the table's rectangles to detect where to connect the relationship ref_tab_rect=QRectF(ref_tab_view->pos(), ref_tab_view->boundingRect().size()); @@ -1471,15 +1471,15 @@ void RelationshipView::configureCrowsFootDescriptors(void) if(rel_type == BaseRelationship::RelationshipNn || rel_type == BaseRelationship::RelationshipFk) { - tables[BaseRelationship::SrcTable] = dynamic_cast(base_rel->getTable(BaseRelationship::SrcTable)->getReceiverObject()); - tables[BaseRelationship::DstTable] = dynamic_cast(base_rel->getTable(BaseRelationship::DstTable)->getReceiverObject()); + tables[BaseRelationship::SrcTable] = dynamic_cast(base_rel->getTable(BaseRelationship::SrcTable)->getOverlyingObject()); + tables[BaseRelationship::DstTable] = dynamic_cast(base_rel->getTable(BaseRelationship::DstTable)->getOverlyingObject()); mandatory[BaseRelationship::SrcTable] = base_rel->isTableMandatory(BaseRelationship::SrcTable); mandatory[BaseRelationship::DstTable] = base_rel->isTableMandatory(BaseRelationship::DstTable); } else { - tables[BaseRelationship::SrcTable] = dynamic_cast(rel->getReferenceTable()->getReceiverObject()); - tables[BaseRelationship::DstTable] = dynamic_cast(rel->getReceiverTable()->getReceiverObject()); + tables[BaseRelationship::SrcTable] = dynamic_cast(rel->getReferenceTable()->getOverlyingObject()); + tables[BaseRelationship::DstTable] = dynamic_cast(rel->getReceiverTable()->getOverlyingObject()); mandatory[BaseRelationship::SrcTable] = rel->isReferenceTableMandatory(); mandatory[BaseRelationship::DstTable] = rel->isReceiverTableMandatory(); diff --git a/libobjrenderer/src/schemaview.cpp b/libobjrenderer/src/schemaview.cpp index 40bd08bc54..0752db0267 100644 --- a/libobjrenderer/src/schemaview.cpp +++ b/libobjrenderer/src/schemaview.cpp @@ -85,7 +85,7 @@ void SchemaView::fetchChildren(void) children.clear(); while(!objs.empty()) { - children.push_front(dynamic_cast(dynamic_cast(objs.back())->getReceiverObject())); + children.push_front(dynamic_cast(dynamic_cast(objs.back())->getOverlyingObject())); objs.pop_back(); } } diff --git a/libpgmodeler/src/basegraphicobject.cpp b/libpgmodeler/src/basegraphicobject.cpp index 8f0d8b590b..a79933cc90 100644 --- a/libpgmodeler/src/basegraphicobject.cpp +++ b/libpgmodeler/src/basegraphicobject.cpp @@ -113,7 +113,7 @@ void BaseGraphicObject::setReceiverObject(QObject *obj) receiver_object=obj; } -QObject *BaseGraphicObject::getReceiverObject(void) +QObject *BaseGraphicObject::getOverlyingObject(void) { return(receiver_object); } diff --git a/libpgmodeler/src/basegraphicobject.h b/libpgmodeler/src/basegraphicobject.h index fabe353ae9..3f2e991fe6 100644 --- a/libpgmodeler/src/basegraphicobject.h +++ b/libpgmodeler/src/basegraphicobject.h @@ -106,8 +106,8 @@ class BaseGraphicObject: public QObject, public BaseObject { //! \brief Assigns on object to other mading the correct attribute copy void operator = (BaseGraphicObject &obj); - //! \brief Gets the current receiver object that graphically represents the 'this' object - QObject *getReceiverObject(void); + //! \brief Gets the current overlying (top object, scene object) that graphically represents the 'this' object + QObject *getOverlyingObject(void); //! \brief Returns the code definition of the object virtual QString getCodeDefinition(unsigned)=0; diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 9d76c67b60..1eb62ddf04 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -854,7 +854,7 @@ void ModelWidget::addNewObject(void) //Creating a table or view inside a schema if(parent_obj && parent_obj->getObjectType()==ObjectType::Schema && (obj_type==ObjectType::Table || obj_type==ObjectType::View)) { - BaseObjectView *sch_graph=dynamic_cast(dynamic_cast(parent_obj)->getReceiverObject()); + BaseObjectView *sch_graph=dynamic_cast(dynamic_cast(parent_obj)->getOverlyingObject()); QSizeF size = sch_graph->boundingRect().size(); QPointF pos, menu_pos = viewport->mapToScene(this->mapFromGlobal(popup_menu.pos())); QRectF rect = QRectF(sch_graph->pos(), size); @@ -914,7 +914,7 @@ void ModelWidget::handleObjectRemoval(BaseObject *object) if(graph_obj) { - scene->removeItem(dynamic_cast(graph_obj->getReceiverObject())); + scene->removeItem(dynamic_cast(graph_obj->getOverlyingObject())); //Updates the parent schema if the removed object were a table or view if(graph_obj->getSchema() && @@ -964,7 +964,7 @@ void ModelWidget::handleObjectsMovement(bool end_moviment) else if(schema) { //For schemas, when they are moved, the original position of tables are registered instead of the position of schema itself - tables=dynamic_cast(schema->getReceiverObject())->getChildren(); + tables=dynamic_cast(schema->getOverlyingObject())->getChildren(); for(auto &tab : tables) { op_list->registerObject(tab->getUnderlyingObject(), Operation::ObjectMoved); @@ -1026,9 +1026,12 @@ void ModelWidget::emitSceneInteracted(void) else if(selected_objects.size() == 1) { BaseGraphicObject *base_obj = dynamic_cast(selected_objects[0]); + TableObject *tab_obj=dynamic_cast(selected_objects[0]); if(base_obj) - emit s_sceneInteracted(dynamic_cast(base_obj->getReceiverObject())); + emit s_sceneInteracted(dynamic_cast(base_obj->getOverlyingObject())); + else if(tab_obj) + emit s_sceneInteracted(1, QRect()); else emit s_sceneInteracted(nullptr); } @@ -1085,7 +1088,7 @@ void ModelWidget::configureObjectSelection(void) count==1 && obj_type1==ObjectType::Table && new_obj_type > ObjectType::BaseTable && QApplication::keyboardModifiers()==0) { BaseGraphicObject *graph_obj=dynamic_cast(selected_objects[0]); - BaseObjectView *object=dynamic_cast(graph_obj->getReceiverObject()); + BaseObjectView *object=dynamic_cast(graph_obj->getOverlyingObject()); scene->showRelationshipLine(true, QPointF(object->scenePos().x() + object->boundingRect().width()/2, @@ -1148,7 +1151,7 @@ void ModelWidget::selectAllObjects(void) for(auto &obj : objs) { - obj_view = dynamic_cast(dynamic_cast(obj)->getReceiverObject()); + obj_view = dynamic_cast(dynamic_cast(obj)->getOverlyingObject()); if(obj_view) { @@ -1967,14 +1970,14 @@ void ModelWidget::moveToSchema(void) //If the object is a graphical one, move it to a position near to the new schema box if(obj_graph) { - SchemaView *dst_schema=dynamic_cast(schema->getReceiverObject()); + SchemaView *dst_schema=dynamic_cast(schema->getOverlyingObject()); QPointF p; if(dst_schema && dst_schema->isVisible()) { p.setX(dst_schema->pos().x()); p.setY(dst_schema->pos().y() + dst_schema->boundingRect().height() + BaseObjectView::VertSpacing); - dynamic_cast(obj_graph->getReceiverObject())->setPos(p); + dynamic_cast(obj_graph->getOverlyingObject())->setPos(p); } } @@ -2148,7 +2151,7 @@ void ModelWidget::selectSchemaChildren(void) scene->clearSelection(); dynamic_cast( - dynamic_cast(schema->getReceiverObject()))->selectChildren(); + dynamic_cast(schema->getOverlyingObject()))->selectChildren(); } void ModelWidget::selectTaggedTables(void) @@ -2167,7 +2170,7 @@ void ModelWidget::selectTaggedTables(void) for(auto object : objects) { - obj_view = dynamic_cast(dynamic_cast(object)->getReceiverObject()); + obj_view = dynamic_cast(dynamic_cast(object)->getOverlyingObject()); obj_view->setSelected(true); } } @@ -3180,7 +3183,7 @@ void ModelWidget::showObjectMenu(void) if(tab_obj && tab_obj->getParentTable()) //Get the graphical representation for table - tab=dynamic_cast(tab_obj->getParentTable()->getReceiverObject()); + tab=dynamic_cast(tab_obj->getParentTable()->getOverlyingObject()); } magnifier_area_lbl->hide(); @@ -3468,7 +3471,7 @@ void ModelWidget::configureFadeMenu(void) } else { - BaseObjectView *obj_view = dynamic_cast(dynamic_cast(selected_objects[0])->getReceiverObject()); + BaseObjectView *obj_view = dynamic_cast(dynamic_cast(selected_objects[0])->getOverlyingObject()); if(obj_view) { @@ -3506,7 +3509,7 @@ void ModelWidget::fadeObjects(const vector &objects, bool fade_in) (schema && !schema->isRectVisible())) continue; - obj_view = dynamic_cast(dynamic_cast(obj)->getReceiverObject()); + obj_view = dynamic_cast(dynamic_cast(obj)->getOverlyingObject()); if(obj_view) { @@ -3715,7 +3718,7 @@ void ModelWidget::updateObjectsOpacity(void) for(auto object : *db_model->getObjectList(type)) { base_obj = dynamic_cast(object); - obj_view = dynamic_cast(base_obj->getReceiverObject()); + obj_view = dynamic_cast(base_obj->getOverlyingObject()); if(obj_view && ((base_obj->isFadedOut() && obj_view->opacity() == 1) || @@ -4187,7 +4190,7 @@ void ModelWidget::highlightObject(void) if(graph_obj) { - BaseObjectView *obj_view=dynamic_cast(graph_obj->getReceiverObject()); + BaseObjectView *obj_view=dynamic_cast(graph_obj->getOverlyingObject()); scene->clearSelection(); obj_view->setSelected(true); @@ -4343,7 +4346,7 @@ void ModelWidget::breakRelationshipLine(BaseRelationship *rel, unsigned break_ty try { - RelationshipView *rel_view=dynamic_cast(rel->getReceiverObject()); + RelationshipView *rel_view=dynamic_cast(rel->getOverlyingObject()); double dx, dy; QPointF src_pnt, dst_pnt; @@ -4441,7 +4444,7 @@ void ModelWidget::rearrangeSchemasInGrid(QPointF origin, unsigned tabs_per_row, schemas over the screen */ schema->setRectVisible(true); - sch_view=dynamic_cast(schema->getReceiverObject()); + sch_view=dynamic_cast(schema->getOverlyingObject()); schema->setModified(true); //The schema is processed only there are tables inside of it @@ -4510,7 +4513,7 @@ void ModelWidget::rearrangeTablesInGrid(Schema *schema, QPointF origin, unsigned while(itr!=tables.end()) { base_tab=dynamic_cast(*itr); - tab_view=dynamic_cast(base_tab->getReceiverObject()); + tab_view=dynamic_cast(base_tab->getOverlyingObject()); tab_view->setPos(QPointF(x,y)); //Defining the maximum y position to avoid table boxes colliding vertically @@ -4568,7 +4571,7 @@ void ModelWidget::jumpToTable(void) tab = reinterpret_cast(act->data().value()); scene->clearSelection(); - tab_view = dynamic_cast(tab->getReceiverObject()); + tab_view = dynamic_cast(tab->getOverlyingObject()); tab_view->setSelected(true); viewport->centerOn(tab_view); } @@ -4611,7 +4614,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) graph_obj = dynamic_cast(obj); dynamic_cast(graph_obj->getSchema())->setRectVisible(false); - tab_view = dynamic_cast(graph_obj->getReceiverObject()); + tab_view = dynamic_cast(graph_obj->getOverlyingObject()); if(tab_view->getConnectRelsCount() > num_rels) { @@ -4655,7 +4658,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) //Determining which table has the greater number of relationships attached for(auto &tab : not_evaluated) { - tab_view = dynamic_cast(dynamic_cast(tab)->getReceiverObject()); + tab_view = dynamic_cast(dynamic_cast(tab)->getOverlyingObject()); if(tab_view->getConnectRelsCount() > num_rels) { @@ -4677,7 +4680,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) } else { - tab_view = dynamic_cast(dynamic_cast(not_evaluated.front())->getReceiverObject()); + tab_view = dynamic_cast(dynamic_cast(not_evaluated.front())->getOverlyingObject()); //If the table/view has not relationships connected we separate it in a new list for further rearrangement if(tab_view->getConnectRelsCount() == 0) @@ -4698,7 +4701,7 @@ void ModelWidget::rearrangeTablesHierarchically(void) for(auto &obj : objects) { - obj_view = dynamic_cast(dynamic_cast(obj)->getReceiverObject()); + obj_view = dynamic_cast(dynamic_cast(obj)->getOverlyingObject()); obj_view->setPos(px, py); px += obj_view->boundingRect().width() + 100; @@ -4754,7 +4757,7 @@ QRectF ModelWidget::rearrangeTablesHierarchically(BaseTableView *root, vector(base_tab->getReceiverObject()); + tab_view = dynamic_cast(base_tab->getOverlyingObject()); rels = db_model->getRelationships(base_tab); for(auto &rel : rels) @@ -4786,7 +4789,7 @@ QRectF ModelWidget::rearrangeTablesHierarchically(BaseTableView *root, vector(next_tab->getReceiverObject()); + tab_view = dynamic_cast(next_tab->getOverlyingObject()); //Temporarily unprotecting the table so it can be moved if(next_tab->isProtected()) @@ -4834,14 +4837,14 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) if(tables.size() <= 2) { base_tab = dynamic_cast(tables[0]); - curr_tab = dynamic_cast(base_tab->getReceiverObject()); + curr_tab = dynamic_cast(base_tab->getOverlyingObject()); curr_tab->setPos(start); if(tables.size() > 1) { tab_view = curr_tab; base_tab = dynamic_cast(tables[1]); - curr_tab = dynamic_cast(base_tab->getReceiverObject()); + curr_tab = dynamic_cast(base_tab->getOverlyingObject()); curr_tab->setPos(start + QPointF(tab_view->boundingRect().width() * 1.25, 0)); } } @@ -4862,7 +4865,7 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) for(auto &tab : tables) { base_tab = dynamic_cast(tab); - curr_tab = dynamic_cast(base_tab->getReceiverObject()); + curr_tab = dynamic_cast(base_tab->getOverlyingObject()); max_w += curr_tab->boundingRect().width(); max_h += curr_tab->boundingRect().height(); } @@ -4885,7 +4888,7 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) for(auto &tab : tables) { base_tab = dynamic_cast(tab); - curr_tab = dynamic_cast(base_tab->getReceiverObject()); + curr_tab = dynamic_cast(base_tab->getOverlyingObject()); pos.setX(dist_x(rand_num_engine)); pos.setY(dist_y(rand_num_engine)); curr_tab->setPos(pos); @@ -4896,7 +4899,7 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) for(auto &tab : tables) { base_tab = dynamic_cast(tab); - curr_tab = dynamic_cast(base_tab->getReceiverObject()); + curr_tab = dynamic_cast(base_tab->getOverlyingObject()); curr_brect = QRectF(curr_tab->pos(), curr_tab->boundingRect().size()); tries = 0; @@ -4910,7 +4913,7 @@ void ModelWidget::rearrangeTablesInSchema(Schema *schema, QPointF start) continue; base_tab = dynamic_cast(tab1); - comp_tab = dynamic_cast(base_tab->getReceiverObject()); + comp_tab = dynamic_cast(base_tab->getOverlyingObject()); comp_brect = QRectF(comp_tab->pos(), comp_tab->boundingRect().size()); irect = comp_brect.intersected(curr_brect); @@ -4962,7 +4965,7 @@ void ModelWidget::rearrangeTablesInSchemas(void) for(auto &sch : schemas) { schema = dynamic_cast(sch); - sch_view = dynamic_cast(schema->getReceiverObject()); + sch_view = dynamic_cast(schema->getOverlyingObject()); if(!sch_view) continue; @@ -4983,7 +4986,7 @@ void ModelWidget::rearrangeTablesInSchemas(void) for(auto &sch : schemas) { schema = dynamic_cast(sch); - sch_view = dynamic_cast(schema->getReceiverObject()); + sch_view = dynamic_cast(schema->getOverlyingObject()); tries = 0; if(!sch_view) continue; @@ -4997,7 +5000,7 @@ void ModelWidget::rearrangeTablesInSchemas(void) for(auto &sch1 : schemas) { schema = dynamic_cast(sch1); - sch_view_aux = dynamic_cast(schema->getReceiverObject()); + sch_view_aux = dynamic_cast(schema->getOverlyingObject()); if(sch == sch1 || !sch_view_aux) continue; diff --git a/libpgmodeler_ui/src/objectfinderwidget.cpp b/libpgmodeler_ui/src/objectfinderwidget.cpp index 1db8fce767..f20934647f 100644 --- a/libpgmodeler_ui/src/objectfinderwidget.cpp +++ b/libpgmodeler_ui/src/objectfinderwidget.cpp @@ -181,7 +181,7 @@ void ObjectFinderWidget::selectObjects(void) if(graph_obj) { - obj_view = dynamic_cast(graph_obj->getReceiverObject()); + obj_view = dynamic_cast(graph_obj->getOverlyingObject()); if(obj_view) { @@ -295,7 +295,7 @@ void ObjectFinderWidget::selectObject(void) if(graph_obj) { - BaseObjectView *obj=dynamic_cast(graph_obj->getReceiverObject()); + BaseObjectView *obj=dynamic_cast(graph_obj->getOverlyingObject()); if(obj) { diff --git a/libpgmodeler_ui/src/sceneinfowidget.cpp b/libpgmodeler_ui/src/sceneinfowidget.cpp index bb068458dd..bbb9b83fdd 100644 --- a/libpgmodeler_ui/src/sceneinfowidget.cpp +++ b/libpgmodeler_ui/src/sceneinfowidget.cpp @@ -65,6 +65,9 @@ void SceneInfoWidget::updateSelectedObjects(int obj_count, const QRectF &objs_re { QRect rect = objs_rect.toRect(); + if(!rect.isValid()) + rect = QRect(0,0,0,0); + obj_icon_lbl->setPixmap(QPixmap(PgModelerUiNs::getIconPath("seltodos"))); obj_name_lbl->setText(trUtf8("Sel. objects: %1").arg(obj_count)); obj_pos_info_lbl->setText(QString("(%1, %2) [w: %3, h: %4]") diff --git a/main-cli/src/pgmodelercli.cpp b/main-cli/src/pgmodelercli.cpp index a936dba68a..1506c459fc 100644 --- a/main-cli/src/pgmodelercli.cpp +++ b/main-cli/src/pgmodelercli.cpp @@ -663,7 +663,7 @@ void PgModelerCli::handleObjectRemoval(BaseObject *object) if(graph_obj) { - scene->removeItem(dynamic_cast(graph_obj->getReceiverObject())); + scene->removeItem(dynamic_cast(graph_obj->getOverlyingObject())); //Updates the parent schema if the removed object were a table or view if(graph_obj->getSchema() && From 89fd3a266944cf6a47e3833a66f472290a3b5ae1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 1 Jul 2019 14:39:37 -0300 Subject: [PATCH 407/425] Avoiding showing the "Swap ids" action in popup menu when we have only columns/constraints selected --- libpgmodeler_ui/src/modelwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 1eb62ddf04..d502cc9dd5 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -4134,7 +4134,7 @@ void ModelWidget::configurePopupMenu(const vector &objects) actions.pop_back(); } - if(objects.size() <= 2) + if(objects.size() <= 2 && !scene->hasOnlyTableChildrenSelection()) { popup_menu.addSeparator(); popup_menu.addAction(action_edit_creation_order); From 8db0618b42fbddae2bafd1ffed0136fd4d032ea1 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 1 Jul 2019 15:31:07 -0300 Subject: [PATCH 408/425] Exposing the main window to plugins to make the extra features development more flexible --- libpgmodeler_ui/src/mainwindow.cpp | 2 +- libpgmodeler_ui/src/pgmodelerplugin.cpp | 6 ++++++ libpgmodeler_ui/src/pgmodelerplugin.h | 8 ++++++- libpgmodeler_ui/src/pluginsconfigwidget.cpp | 10 ++++++++- libpgmodeler_ui/src/pluginsconfigwidget.h | 2 +- plugins/dummy/src/dummy.cpp | 24 ++++++++++++++++++++- plugins/dummy/src/dummy.h | 2 ++ 7 files changed, 49 insertions(+), 5 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 2cc24519ca..7d2df73283 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -81,7 +81,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par configuration_form->loadConfiguration(); plugins_conf_wgt=dynamic_cast(configuration_form->getConfigurationWidget(ConfigurationForm::PluginsConfWgt)); - plugins_conf_wgt->installPluginsActions(nullptr, plugins_menu, this, SLOT(executePlugin(void))); + plugins_conf_wgt->installPluginsActions(nullptr, plugins_menu, this, SLOT(executePlugin(void)), this); plugins_menu->setEnabled(!plugins_menu->isEmpty()); action_plugins->setEnabled(!plugins_menu->isEmpty()); action_plugins->setMenu(plugins_menu); diff --git a/libpgmodeler_ui/src/pgmodelerplugin.cpp b/libpgmodeler_ui/src/pgmodelerplugin.cpp index ec413741a4..8fc0b096b8 100644 --- a/libpgmodeler_ui/src/pgmodelerplugin.cpp +++ b/libpgmodeler_ui/src/pgmodelerplugin.cpp @@ -25,6 +25,7 @@ PgModelerPlugin::PgModelerPlugin(void) QFont font; QWidget *widget=nullptr; + main_window = nullptr; plugin_info_frm=new BaseForm; gridLayout=new QGridLayout; @@ -90,3 +91,8 @@ void PgModelerPlugin::configurePluginInfo(const QString &title, const QString &v ico.load(ico_filename); icon_lbl->setPixmap(ico); } + +void PgModelerPlugin::setMainWindow(QMainWindow *main_window) +{ + this->main_window = main_window; +} diff --git a/libpgmodeler_ui/src/pgmodelerplugin.h b/libpgmodeler_ui/src/pgmodelerplugin.h index c6e68c119d..eb7e3ae2fd 100644 --- a/libpgmodeler_ui/src/pgmodelerplugin.h +++ b/libpgmodeler_ui/src/pgmodelerplugin.h @@ -51,6 +51,8 @@ class PgModelerPlugin { protected: BaseForm *plugin_info_frm; + QMainWindow *main_window; + private: QLabel *icon_lbl, *title_lbl, @@ -86,7 +88,11 @@ class PgModelerPlugin { //! \brief Sets the plugin's all attributes at once. void configurePluginInfo(const QString &title, const QString &version, const QString &author, - const QString &description, const QString &ico_filename); + const QString &description, const QString &ico_filename); + + /*! \brief Sets the main window of the application so it can perform advanced operations like + * add custom widget, access the models, and much more */ + virtual void setMainWindow(QMainWindow *main_window); }; /* Declares the class PgModelerPlugin as interface, this means that the class is a base diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.cpp b/libpgmodeler_ui/src/pluginsconfigwidget.cpp index 70da88570f..2912e428ec 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.cpp +++ b/libpgmodeler_ui/src/pluginsconfigwidget.cpp @@ -147,11 +147,12 @@ void PluginsConfigWidget::loadConfiguration(void) throw Exception(ErrorCode::PluginsNotLoaded,__PRETTY_FUNCTION__,__FILE__,__LINE__, errors); } -void PluginsConfigWidget::installPluginsActions(QToolBar *toolbar, QMenu *menu, QObject *recv, const char *slot) +void PluginsConfigWidget::installPluginsActions(QToolBar *toolbar, QMenu *menu, QObject *recv, const char *slot, QMainWindow *main_window) { if((toolbar || menu) && slot) { vector::iterator itr=plugins_actions.begin(); + PgModelerPlugin *plugin = nullptr; while(itr!=plugins_actions.end()) { @@ -161,6 +162,13 @@ void PluginsConfigWidget::installPluginsActions(QToolBar *toolbar, QMenu *menu, if(menu) menu->addAction(*itr); + // Exposing the main window instance to the plugin + if(main_window) + { + plugin =reinterpret_cast((*itr)->data().value()); + plugin->setMainWindow(main_window); + } + connect(*itr, SIGNAL(triggered(void)), recv, slot); itr++; } diff --git a/libpgmodeler_ui/src/pluginsconfigwidget.h b/libpgmodeler_ui/src/pluginsconfigwidget.h index e9ba8f764c..dda2673abd 100644 --- a/libpgmodeler_ui/src/pluginsconfigwidget.h +++ b/libpgmodeler_ui/src/pluginsconfigwidget.h @@ -58,7 +58,7 @@ class PluginsConfigWidget: public BaseConfigWidget, public Ui::PluginsConfigWidg /*! \brief Install the created actions on menu and toolbars. Additionally the user must specify the receiver object and slot executed when the actions is activated */ - void installPluginsActions(QToolBar *toolbar, QMenu *menu, QObject *recv, const char *slot); + void installPluginsActions(QToolBar *toolbar, QMenu *menu, QObject *recv, const char *slot, QMainWindow *main_window); private slots: void showPluginInfo(int idx); diff --git a/plugins/dummy/src/dummy.cpp b/plugins/dummy/src/dummy.cpp index 01f73cd304..13cf98e63e 100644 --- a/plugins/dummy/src/dummy.cpp +++ b/plugins/dummy/src/dummy.cpp @@ -19,6 +19,7 @@ #include "dummy.h" #include "exception.h" #include "messagebox.h" +#include "mainwindow.h" Dummy::Dummy(void) { @@ -64,7 +65,28 @@ void Dummy::executePlugin(ModelWidget *) Messagebox msgbox; msgbox.show(trUtf8("Plugin successfully loaded!"), trUtf8("Plugin successfully loaded! Check the plugins wiki page to know how to create your own plugins."), - Messagebox::InfoIcon); + Messagebox::InfoIcon); +} + +void Dummy::setMainWindow(QMainWindow *main_window) +{ + this->main_window = main_window; + + /* The sample code below shows how to interact with the exposed main window by adding + * a tool button to the bottom widgets bar. + * + * You can use this basic approach to add more UI elements to it. + * To do so, open the design file mainwindow.ui to see the name of the widgets you + * need to handle */ + + //MainWindow *mw = dynamic_cast(main_window); + //QToolButton *tb = new QToolButton(mw->tool_btns_bar_wgt); + //mw->tool_btns_bar_wgt->layout()->addWidget(tb); + //tb->setText("This is a test button"); + //connect(tb, &QToolButton::clicked, [&](){ + // Messagebox msgbox; + // msgbox.show(trUtf8("Alert"), trUtf8("This is a message box triggered by the click signal emitted by the test button!"), Messagebox::AlertIcon); + //}); } QKeySequence Dummy::getPluginShortcut(void) diff --git a/plugins/dummy/src/dummy.h b/plugins/dummy/src/dummy.h index b0351cf8a5..83ce79850c 100644 --- a/plugins/dummy/src/dummy.h +++ b/plugins/dummy/src/dummy.h @@ -46,6 +46,8 @@ class Dummy: public QObject, public PgModelerPlugin { QKeySequence getPluginShortcut(void); void executePlugin(ModelWidget *); + virtual void setMainWindow(QMainWindow *main_window); + public slots: void showPluginInfo(void); }; From 72711b8646d703b29f0a9f8b2f50799733744871 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 2 Jul 2019 09:24:51 -0300 Subject: [PATCH 409/425] Enabling/disabling the save model action according to the model's modified status --- libpgmodeler_ui/src/mainwindow.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 7d2df73283..081ac3ea41 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -894,7 +894,7 @@ void MainWindow::addModel(const QString &filename) obj_name=model_tab->db_model->getName(); models_tbw->blockSignals(true); - models_tbw->setUpdatesEnabled(false); + models_tbw->setUpdatesEnabled(false); models_tbw->addTab(model_tab, obj_name); models_tbw->setCurrentIndex(models_tbw->count()-1); models_tbw->blockSignals(false); @@ -938,19 +938,20 @@ void MainWindow::addModel(const QString &filename) } model_nav_wgt->addModel(model_tab); - models_tbw->setUpdatesEnabled(true); + models_tbw->setUpdatesEnabled(true); models_tbw->setVisible(true); setCurrentModel(); - if(start_timers) + if(start_timers) { - if(model_save_timer.interval() > 0) + if(model_save_timer.interval() > 0) model_save_timer.start(); tmpmodel_save_timer.start(); - } + } model_tab->setModified(false); + action_save_model->setEnabled(false); if(action_alin_objs_grade->isChecked()) current_model->scene->alignObjectsToGrid(); @@ -1435,6 +1436,7 @@ void MainWindow::saveModel(ModelWidget *model) } stopTimers(false); + action_save_model->setEnabled(false); } } catch(Exception &e) @@ -1688,7 +1690,7 @@ void MainWindow::updateToolsState(bool model_closed) action_print->setEnabled(enabled); action_save_as->setEnabled(enabled); - action_save_model->setEnabled(enabled); + action_save_model->setEnabled(!model_closed && current_model && current_model->isModified()); action_save_all->setEnabled(enabled); action_export->setEnabled(enabled); action_close_model->setEnabled(enabled); From ef4daa7a6e7a49dc75828f6bf2903e14a6488221 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Tue, 2 Jul 2019 14:01:55 -0300 Subject: [PATCH 410/425] Setting the default behavior of result set filtering to Qt::MatchContains on SQLExecutionWidget --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 0aea2b3499..d45c1bda8b 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -472,7 +472,9 @@ void SQLExecutionWidget::filterResults(void) if(exact_chk->isChecked()) flags = Qt::MatchExactly; else if(regexp_chk->isChecked()) - flags = Qt::MatchRegExp; + flags = Qt::MatchRegExp; + else + flags = Qt::MatchContains; if(case_sensitive_chk->isChecked()) flags |= Qt::MatchCaseSensitive; From b11d3123658f30c3e0baeb4c6f94c0beb5882202 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 3 Jul 2019 15:34:57 -0300 Subject: [PATCH 411/425] Fixed the object duplication action when only a single table object is selected Automatically focusing the filter input on SQLExecutionWidget when toggling the filter widget --- libpgmodeler_ui/src/modelwidget.cpp | 4 ++-- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index d502cc9dd5..70be97aaad 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1625,7 +1625,6 @@ void ModelWidget::saveModel(const QString &filename) saveLastCanvasPosition(); db_model->saveModel(filename, SchemaParser::XmlDefinition); - this->filename=filename; task_prog_wgt.close(); @@ -2737,7 +2736,8 @@ void ModelWidget::duplicateObject(void) try { - if(scene->hasOnlyTableChildrenSelection()) + if(scene->hasOnlyTableChildrenSelection() || + (selected_objects.size() == 1 && TableObject::isTableObject(selected_objects[0]->getObjectType()))) { Schema *schema = nullptr; BaseObject *dup_object=nullptr; diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index d45c1bda8b..53e26cdcaf 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -100,7 +100,15 @@ SQLExecutionWidget::SQLExecutionWidget(QWidget * parent) : QWidget(parent) connect(columns_cmb, SIGNAL(currentIndexChanged(int)), this, SLOT(filterResults())); connect(filter_edt, SIGNAL(textChanged(QString)), this, SLOT(filterResults())); connect(hide_tb, SIGNAL(clicked(bool)), filter_tb, SLOT(click())); - connect(filter_tb, SIGNAL(toggled(bool)), filter_wgt, SLOT(setVisible(bool))); + + connect(filter_tb, &QToolButton::toggled, [&](bool checked){ + filter_wgt->setVisible(checked); + + if(checked) + filter_edt->setFocus(); + else + sql_cmd_txt->setFocus(); + }); connect(exact_chk, SIGNAL(toggled(bool)), this, SLOT(filterResults())); connect(exact_chk, &QCheckBox::toggled, [&](bool checked){ From 6b56b171f6f740b70beb1bfe449353969bd99788 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Wed, 3 Jul 2019 17:31:18 -0300 Subject: [PATCH 412/425] Testing a new way to save models by copying the original file to a backup and saving a new one with the original name of the backup --- libpgmodeler_ui/src/modelwidget.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 70be97aaad..4a5e665769 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1616,6 +1616,9 @@ void ModelWidget::saveModel(void) void ModelWidget::saveModel(const QString &filename) { TaskProgressWidget task_prog_wgt(this); + QString bkpfile; + QTemporaryFile tmpfile; + bool exists = QFile::exists(filename); try { @@ -1623,6 +1626,21 @@ void ModelWidget::saveModel(const QString &filename) task_prog_wgt.setWindowTitle(trUtf8("Saving database model")); task_prog_wgt.show(); + if(exists) + { + tmpfile.setAutoRemove(false); + tmpfile.setFileTemplate(GlobalAttributes::TemporaryDir + + GlobalAttributes::DirSeparator + + QString("tmp_%1_XXXXXX.dbmk").arg(this->db_model->getName())); + tmpfile.open(); + bkpfile = tmpfile.fileName(); + tmpfile.close(); + tmpfile.remove(); + + QFile::copy(filename, bkpfile); + QFile::remove(filename); + } + saveLastCanvasPosition(); db_model->saveModel(filename, SchemaParser::XmlDefinition); this->filename=filename; @@ -1630,9 +1648,18 @@ void ModelWidget::saveModel(const QString &filename) task_prog_wgt.close(); disconnect(db_model, nullptr, &task_prog_wgt, nullptr); this->modified=false; + + if(exists) + QFile::remove(bkpfile); } catch(Exception &e) { + if(exists && QFile::exists(bkpfile)) + { + QFile::remove(filename); + QFile::copy(bkpfile, filename); + } + task_prog_wgt.close(); disconnect(db_model, nullptr, &task_prog_wgt, nullptr); throw Exception(e.getErrorMessage(),e.getErrorCode(),__PRETTY_FUNCTION__,__FILE__,__LINE__, &e); From d59663cc38542087fffe0f87c2c8e10a97f397da Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 4 Jul 2019 16:58:58 -0300 Subject: [PATCH 413/425] Improved the clipboard text pasting on DataManipulationForm in order to parse the text as CSV when Ctrl+Shift+V is pressed Added a new action on DataManipulationForm that is to clear the selected items by pressing Ctrl+R --- libpgmodeler_ui/src/datamanipulationform.cpp | 156 +++++++++++-------- libpgmodeler_ui/src/datamanipulationform.h | 15 +- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 4 - libpgmodeler_ui/ui/datamanipulationform.ui | 74 ++++++--- 4 files changed, 158 insertions(+), 91 deletions(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 5ecd9db1d0..ab36a2532b 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -27,8 +27,6 @@ #include "generalconfigwidget.h" const QColor DataManipulationForm::RowColors[3]={ QColor(QString("#C0FFC0")), QColor(QString("#FFFFC0")), QColor(QString("#FFC0C0")) }; -bool DataManipulationForm::has_csv_clipboard=false; - constexpr unsigned DataManipulationForm::NoOperation; constexpr unsigned DataManipulationForm::OpInsert; constexpr unsigned DataManipulationForm::OpUpdate; @@ -56,9 +54,9 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): act = copy_menu.addAction(trUtf8("Copy as CSV")); act->setShortcut(QKeySequence("Ctrl+C")); + connect(act, &QAction::triggered, [&](){ SQLExecutionWidget::copySelection(results_tbw, false, true); - has_csv_clipboard = true; paste_tb->setEnabled(true); }); @@ -66,10 +64,24 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): act->setShortcut(QKeySequence("Ctrl+Shift+C")); connect(act, &QAction::triggered, [&](){ SQLExecutionWidget::copySelection(results_tbw, false, false); - has_csv_clipboard = false; paste_tb->setEnabled(true); }); + act = paste_menu.addAction(trUtf8("Paste as text")); + act->setShortcut(QKeySequence("Ctrl+V")); + connect(act, &QAction::triggered, [&](){ + loadDataFromCsv(true, false); + paste_tb->setEnabled(false); + }); + + act = paste_menu.addAction(trUtf8("Paste as CSV")); + act->setShortcut(QKeySequence("Ctrl+Shift+V")); + connect(act, &QAction::triggered, [&](){ + loadDataFromCsv(true, true); + paste_tb->setEnabled(false); + }); + + paste_tb->setMenu(&paste_menu); truncate_tb->setMenu(&truncate_menu); truncate_menu.addAction(QIcon(PgModelerUiNs::getIconPath("truncate")), trUtf8("Truncate"), this, SLOT(truncateTable()), QKeySequence("Ctrl+Del"))->setData(QVariant::fromValue(false)); truncate_menu.addAction(QIcon(PgModelerUiNs::getIconPath("trunccascade")), trUtf8("Truncate cascade"), this, SLOT(truncateTable()), QKeySequence("Ctrl+Shift+Del"))->setData(QVariant::fromValue(true)); @@ -87,6 +99,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): csv_load_tb->setToolTip(csv_load_tb->toolTip() + QString(" (%1)").arg(csv_load_tb->shortcut().toString())); filter_tb->setToolTip(filter_tb->toolTip() + QString(" (%1)").arg(filter_tb->shortcut().toString())); new_window_tb->setToolTip(new_window_tb->toolTip() + QString(" (%1)").arg(new_window_tb->shortcut().toString())); + clear_tb->setToolTip(clear_tb->toolTip() + QString("%1").arg(clear_tb->shortcut().toString())); result_info_wgt->setVisible(false); //Forcing the splitter that handles the bottom widgets to resize its children to their minimum size @@ -102,11 +115,6 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): csv_load_parent->setLayout(layout); csv_load_parent->setMinimumSize(csv_load_wgt->minimumSize()); - connect(paste_tb, &QToolButton::clicked, [&]{ - loadDataFromCsv(true); - paste_tb->setEnabled(false); - }); - connect(columns_lst, &QListWidget::itemDoubleClicked, [&](QListWidgetItem *item){ if(item->checkState() == Qt::Checked) item->setCheckState(Qt::Unchecked); @@ -124,6 +132,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): setColumnsCheckState(Qt::Unchecked); }); + connect(clear_tb, SIGNAL(clicked(bool)), this, SLOT(clearItemsText())); connect(columns_lst, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(toggleColumnDisplay(QListWidgetItem*))); connect(csv_load_tb, SIGNAL(toggled(bool)), csv_load_parent, SLOT(setVisible(bool))); connect(close_btn, SIGNAL(clicked()), this, SLOT(reject())); @@ -168,44 +177,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): //Using the QueuedConnection here to avoid the "edit: editing failed" when editing and navigating through items using tab key connect(results_tbw, SIGNAL(currentCellChanged(int,int,int,int)), this, SLOT(insertRowOnTabPress(int,int,int,int)), Qt::QueuedConnection); - connect(results_tbw, &QTableWidget::itemPressed, - [&](){ - if(QApplication::mouseButtons()==Qt::RightButton) - { - QMenu item_menu; - QAction *act = nullptr; - ObjectType obj_type=static_cast(table_cmb->currentData().toUInt()); - - act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("copiar")), trUtf8("Copy items")); - act->setMenu(©_menu); - - act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("colar")), trUtf8("Pase items")); - act->setShortcut(paste_tb->shortcut()); - connect(act, SIGNAL(triggered(bool)), paste_tb, SLOT(click())); - act->setEnabled(!qApp->clipboard()->text().isEmpty() && obj_type == ObjectType::Table); - - if(obj_type == ObjectType::Table) - { - item_menu.addSeparator(); - act = item_menu.addAction(browse_tabs_tb->icon(), trUtf8("Browse tables")); - act->setMenu(&fks_menu); - act->setEnabled(browse_tabs_tb->isEnabled()); - - item_menu.addSeparator(); - act = item_menu.addAction(duplicate_tb->icon(), trUtf8("Duplicate row(s)"), this, SLOT(duplicateRows()), duplicate_tb->shortcut()); - act->setEnabled(duplicate_tb->isEnabled()); - - act = item_menu.addAction(delete_tb->icon(), trUtf8("Delete row(s)"), this, SLOT(markDeleteOnRows()), delete_tb->shortcut()); - act->setEnabled(delete_tb->isEnabled()); - - act = item_menu.addAction(bulkedit_tb->icon(), trUtf8("Edit cell(s)"), bulkedit_tb, SLOT(click()), bulkedit_tb->shortcut()); - act->setEnabled(bulkedit_tb->isEnabled()); - } - - item_menu.exec(QCursor::pos()); - } - }); - + connect(results_tbw, SIGNAL(itemPressed(QTableWidgetItem *)), this, SLOT(showPopupMenu())); connect(export_tb, &QToolButton::clicked, [&](){ SQLExecutionWidget::exportResults(results_tbw); }); @@ -256,15 +228,22 @@ void DataManipulationForm::setAttributes(Connection conn, const QString curr_sch } } -void DataManipulationForm::setHasCsvClipboard(bool value) +void DataManipulationForm::reject(void) { - has_csv_clipboard = value; + GeneralConfigWidget::saveWidgetGeometry(this); + QDialog::reject(); } -void DataManipulationForm::reject(void) +void DataManipulationForm::clearItemsText(void) { - GeneralConfigWidget::saveWidgetGeometry(this); - QDialog::reject(); + for(auto &sel : results_tbw->selectedRanges()) + { + for(int row = sel.topRow(); row <= sel.bottomRow(); row++) + { + for(int col = sel.leftColumn(); col <= sel.rightColumn(); col++) + results_tbw->item(row,col)->setText(""); + } + } } void DataManipulationForm::listTables(void) @@ -480,6 +459,7 @@ void DataManipulationForm::enableRowControlButtons(void) delete_tb->setEnabled(cols_selected); duplicate_tb->setEnabled(cols_selected); copy_tb->setEnabled(sel_ranges.count() != 0); + clear_tb->setEnabled(sel_ranges.count() != 0); paste_tb->setEnabled(!qApp->clipboard()->text().isEmpty() && table_cmb->currentData().toUInt() == enum_cast(ObjectType::Table) && !col_names.isEmpty()); @@ -519,8 +499,8 @@ void DataManipulationForm::enableColumnControlButtons(void) rem_ord_col_tb->setEnabled(ord_columns_lst->currentRow() >= 0); move_up_tb->setEnabled(ord_columns_lst->count() > 1 && ord_columns_lst->currentRow() > 0); move_down_tb->setEnabled(ord_columns_lst->count() > 1 && - ord_columns_lst->currentRow() >= 0 && - ord_columns_lst->currentRow() <= ord_columns_lst->count() - 2); + ord_columns_lst->currentRow() >= 0 && + ord_columns_lst->currentRow() <= ord_columns_lst->count() - 2); } void DataManipulationForm::swapColumns(void) @@ -546,7 +526,7 @@ void DataManipulationForm::swapColumns(void) ord_columns_lst->setCurrentRow(new_idx); } -void DataManipulationForm::loadDataFromCsv(bool load_from_clipboard) +void DataManipulationForm::loadDataFromCsv(bool load_from_clipboard, bool force_csv_parsing) { QList rows; QStringList cols; @@ -557,13 +537,22 @@ void DataManipulationForm::loadDataFromCsv(bool load_from_clipboard) if(qApp->clipboard()->text().isEmpty()) return; - if(has_csv_clipboard) - rows = CsvLoadWidget::loadCsvFromBuffer(qApp->clipboard()->text(), QString(";"), QString("\""), true, cols); - else - rows = CsvLoadWidget::loadCsvFromBuffer(qApp->clipboard()->text(), QString("\t"), QString(), false, cols); + QString csv_pattern="(%1)(.)*(%1)(;)"; + QString separator="\t", delimiter="", text=qApp->clipboard()->text(); - has_csv_clipboard = false; - qApp->clipboard()->clear(); + if(force_csv_parsing) + { + if(text.contains(QRegExp(csv_pattern.arg("\"")))) + delimiter="\""; + else if(text.contains(QRegExp(csv_pattern.arg("'")))) + delimiter="'"; + + // If one of the patterns matched the buffer we configure the right delimiter for csv buffer + if(!delimiter.isEmpty()) + separator=";"; + } + + rows = CsvLoadWidget::loadCsvFromBuffer(text, separator, delimiter, false, cols); } else { @@ -595,8 +584,11 @@ void DataManipulationForm::loadDataFromCsv(bool load_from_clipboard) addRow(); row_id=results_tbw->rowCount() - 1; - for(int i = 0; i < values.count() && i < cols.count(); i++) + for(int i = 0; i < values.count(); i++) { + if(i > values.count()) + break; + if((!load_from_clipboard && csv_load_wgt->isColumnsInFirstRow()) || (load_from_clipboard && !cols.isEmpty())) { @@ -1529,3 +1521,43 @@ void DataManipulationForm::openNewWindow(void) data_manip->setAttributes(tmpl_conn_params, QString()); data_manip->show(); } + +void DataManipulationForm::showPopupMenu(void) +{ + if(QApplication::mouseButtons()==Qt::RightButton) + { + QMenu item_menu; + QAction *act = nullptr; + ObjectType obj_type=static_cast(table_cmb->currentData().toUInt()); + + act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("copiar")), trUtf8("Copy items")); + act->setMenu(©_menu); + + act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("colar")), trUtf8("Pase items")); + act->setMenu(&paste_menu); + act->setEnabled(paste_tb->isEnabled()); + + act = item_menu.addAction(QIcon(PgModelerUiNs::getIconPath("limpar")), trUtf8("Clear items")); + act->setEnabled(!results_tbw->selectedRanges().isEmpty()); + + if(obj_type == ObjectType::Table) + { + item_menu.addSeparator(); + act = item_menu.addAction(browse_tabs_tb->icon(), trUtf8("Browse tables")); + act->setMenu(&fks_menu); + act->setEnabled(browse_tabs_tb->isEnabled()); + + item_menu.addSeparator(); + act = item_menu.addAction(duplicate_tb->icon(), trUtf8("Duplicate row(s)"), this, SLOT(duplicateRows()), duplicate_tb->shortcut()); + act->setEnabled(duplicate_tb->isEnabled()); + + act = item_menu.addAction(delete_tb->icon(), trUtf8("Delete row(s)"), this, SLOT(markDeleteOnRows()), delete_tb->shortcut()); + act->setEnabled(delete_tb->isEnabled()); + + act = item_menu.addAction(bulkedit_tb->icon(), trUtf8("Edit cell(s)"), bulkedit_tb, SLOT(click()), bulkedit_tb->shortcut()); + act->setEnabled(bulkedit_tb->isEnabled()); + } + + item_menu.exec(QCursor::pos()); + } +} diff --git a/libpgmodeler_ui/src/datamanipulationform.h b/libpgmodeler_ui/src/datamanipulationform.h index 8bada4cc91..342a3b354a 100644 --- a/libpgmodeler_ui/src/datamanipulationform.h +++ b/libpgmodeler_ui/src/datamanipulationform.h @@ -44,16 +44,14 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { //! \brief Default row colors for each operation type static const QColor RowColors[3]; - static bool has_csv_clipboard; - CsvLoadWidget *csv_load_wgt; SyntaxHighlighter *filter_hl; CodeCompletionWidget *code_compl_wgt; - QMenu fks_menu, copy_menu, truncate_menu; - + QMenu fks_menu, copy_menu, truncate_menu, paste_menu; + //! \brief Store the template connection params to be used by catalogs and command execution connections attribs_map tmpl_conn_params; @@ -117,11 +115,11 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { //! \brief Defines the connection and current schema and table to be handled, this method should be called before show the dialog void setAttributes(Connection conn, const QString curr_schema=QString("public"), const QString curr_table=QString(), const QString &filter=QString()); - static void setHasCsvClipboard(bool value); - private slots: void reject(void); + void clearItemsText(void); + //! \brief List the tables based upon the current schema void listTables(void); @@ -180,7 +178,7 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { void swapColumns(void); //! \brief Add new rows to the grid based upon the CSV loaded - void loadDataFromCsv(bool load_from_clipboard = false); + void loadDataFromCsv(bool load_from_clipboard = false, bool force_csv_parsing = false); //! \brief Browse the referenced table data using the selected row in the results grid void browseReferencedTable(void); @@ -196,6 +194,9 @@ class DataManipulationForm: public QDialog, public Ui::DataManipulationForm { //! \brief Opens a new data manipulation windows void openNewWindow(void); + + //! \brief Shows the popup menu over the current selection + void showPopupMenu(void); }; #endif diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 53e26cdcaf..037857fdb8 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -848,10 +848,6 @@ void SQLExecutionWidget::copySelection(QTableView *results_tbw, bool use_popup, { //Generates the csv buffer and assigns it to application's clipboard buf=generateCSVBuffer(results_tbw); - - /* Making DataManipulationForm instances know that the clipboard has csv buffer - * in order to paste the contents properly */ - DataManipulationForm::setHasCsvClipboard(true); } else if((use_popup && act == act_txt) || (!use_popup && !csv_is_default)) { diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index 07f0df1cd6..698647e0b3 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -1246,6 +1246,22 @@ + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + @@ -1311,8 +1327,46 @@ 22 + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + Clears the items selected on the grid + + + Clear + + + + :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png + + + + 22 + 22 + + - Ctrl+V + Ctrl+R QToolButton::InstantPopup @@ -1411,7 +1465,7 @@ - 8 + 10 20 @@ -1727,22 +1781,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 8 - 20 - - - - From d49116d38f1ea1f4f3a4ac635c01c5dc17bfe6fc Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 5 Jul 2019 12:08:31 -0300 Subject: [PATCH 414/425] Improved the UI of the DataManipulationForm by rearranging the tool buttons to the left of the dialog --- conf/defaults/ui-style.conf | 82 +- conf/ui-style.conf | 56 +- libpgmodeler_ui/src/datamanipulationform.cpp | 22 +- libpgmodeler_ui/src/mainwindow.cpp | 17 +- libpgmodeler_ui/src/mainwindow.h | 3 - libpgmodeler_ui/src/pgmodeleruins.cpp | 13 + libpgmodeler_ui/src/pgmodeleruins.h | 3 + libpgmodeler_ui/src/welcomewidget.cpp | 8 +- libpgmodeler_ui/ui/datamanipulationform.ui | 3462 +++++++++--------- 9 files changed, 1934 insertions(+), 1732 deletions(-) diff --git a/conf/defaults/ui-style.conf b/conf/defaults/ui-style.conf index 2836c7578b..1c8abb56b2 100644 --- a/conf/defaults/ui-style.conf +++ b/conf/defaults/ui-style.conf @@ -32,7 +32,7 @@ UpdateNotifierWidget > QFrame border-radius: 5px; } -AboutWidget > QFrame > QLabel#title_lbl, +AboutWidget > QFrame > QLabel#title_lbl, AboutWidget > QFrame > QLabel#about_lbl, AboutWidget > QFrame > QLabel#build_lbl, AboutWidget > QFrame > QLabel#copyright_lbl { @@ -89,7 +89,7 @@ NewObjectOverlayWidget > QFrame > QGroupBox > QWidget > QToolButton:hover font-weight: bold; background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #80e0e0e0 , stop: 1 #80ffffff); border: 1px solid #c0a0a0a0; - color: #000; + color: #000; } @@ -105,7 +105,7 @@ QWidget#bg_widget { background-repeat: repeat-xy; } -QMenuBar { +QMenuBar { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6394DE, stop: 1 #4C7DD0); border: transparent; } @@ -137,7 +137,7 @@ QMenuBar::item:disabled { color: #505050; } -QToolBar#general_tb { +QToolBar#general_tb { background-image: url(":/styles/styles/toolbar_bg.png"); background-repeat: repeat-y; border-bottom: 1px solid #505050; @@ -173,7 +173,7 @@ WelcomeWidget > QToolButton::menu-indicator } QToolBar#general_tb > QToolButton -{ +{ color: #f0f0f0; min-width: 65px; margin-bottom: 2px; @@ -183,12 +183,12 @@ QToolBar#general_tb > QToolButton } QToolBar#general_tb -{ +{ border-right: 1px solid #202020; } QToolBar#general_tb::separator -{ +{ background-color: #80404040; border-top: 1px solid #202020; border-left: 1px solid #202020; @@ -202,10 +202,10 @@ QToolBar#general_tb > QToolButton#qt_toolbar_ext_button min-height: 20px; } -QToolBar#general_tb > QToolButton:hover, +QToolBar#general_tb > QToolButton:hover, WelcomeWidget > QToolButton:hover, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button -{ +{ color: #fff; background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #80606060 , stop: 1 #80A0A0A0); border-top: 1px solid qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #A0A0A0 , stop: 1 #606060); @@ -219,7 +219,7 @@ QToolBar#general_tb > QToolButton:pressed, WelcomeWidget > QToolButton:pressed, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:hover, QToolBar#general_tb > QToolButton#qt_toolbar_ext_button:pressed -{ +{ color: #fff; background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #804aa5ff , stop: 1 #8081cdff); border-top: 1px solid qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #48a5fc , stop: 1 #3a86cc); @@ -234,7 +234,7 @@ WelcomeWidget > QToolButton:disabled } QToolBar#general_tb > QToolButton:disabled -{ +{ color: #808080; } @@ -304,7 +304,7 @@ QToolBar#update_tb { border-color: #808080; } -QToolBar#update_tb > QToolButton +QToolBar#update_tb > QToolButton { min-width: 25px; max-width: 200px; @@ -396,10 +396,6 @@ QTabWidget#models_tbw > QTabBar::tab:selected { margin-top: 0px; } -SQLToolWidget > QWidget#bg_frame { - -} - /* Floating hint widget member of HintTextWidget */ HintTextWidget { @@ -450,5 +446,57 @@ QTabWidget#sql_exec_tbw > QTabBar::close-button:hover { QWidget#menu_title_wgt { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffffff , stop: 1 #E6E6E6); - border: 1px solid #c0a0a0a0; + border: 1px solid #c0a0a0a0; +} + +/* DataManipulationForm styles */ +QWidget#bnts_parent_wgt { + background-image: url(":/styles/styles/toolbar_bg.png"); + background-repeat: repeat-y; + border: 1px solid #202020; + padding: 0; + margin: 0; +} + +QWidget#bnts_parent_wgt > QToolButton +{ + color: #fff; + margin-left: 3px; + margin-right: 3px; +} + +QWidget#bnts_parent_wgt > QToolButton:disabled +{ + color: #808080; +} + +QWidget#bnts_parent_wgt > QToolButton:hover +{ + color: #fff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #80606060 , stop: 1 #80A0A0A0); + border-top: 1px solid qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #A0A0A0 , stop: 1 #606060); + border-left: 1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A0A0A0 , stop: 1 #606060); + border-right: 1px solid #808080; + border-bottom: 1px solid #606060; +} + +QWidget#bnts_parent_wgt > QToolButton:checked, +QWidget#bnts_parent_wgt > QToolButton:pressed +{ + color: #fff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #804aa5ff , stop: 1 #8081cdff); + border-top: 1px solid qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #48a5fc , stop: 1 #3a86cc); + border-left: 1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #48a5fc , stop: 1 #3a86cc); + border-right: 1px solid #3a86cc; + border-bottom: 1px solid #3a86cc; +} + +QWidget#bnts_parent_wgt > QFrame +{ + background-color: #80404040; + border-top: 1px solid #202020; + border-left: 1px solid #202020; + border-right: 1px solid #606060; + border-bottom: 1px solid #606060; + height: 1px; } diff --git a/conf/ui-style.conf b/conf/ui-style.conf index 2836c7578b..c980f5b5d2 100644 --- a/conf/ui-style.conf +++ b/conf/ui-style.conf @@ -396,10 +396,6 @@ QTabWidget#models_tbw > QTabBar::tab:selected { margin-top: 0px; } -SQLToolWidget > QWidget#bg_frame { - -} - /* Floating hint widget member of HintTextWidget */ HintTextWidget { @@ -452,3 +448,55 @@ QWidget#menu_title_wgt { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffffff , stop: 1 #E6E6E6); border: 1px solid #c0a0a0a0; } + +/* DataManipulationForm styles */ +QWidget#bnts_parent_wgt { + background-image: url(":/styles/styles/toolbar_bg.png"); + background-repeat: repeat-y; + border: 1px solid #202020; + padding: 0; + margin: 0; +} + +QWidget#bnts_parent_wgt > QToolButton +{ + color: #fff; + margin-left: 3px; + margin-right: 3px; +} + +QWidget#bnts_parent_wgt > QToolButton:disabled +{ + color: #808080; +} + +QWidget#bnts_parent_wgt > QToolButton:hover +{ + color: #fff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #80606060 , stop: 1 #80A0A0A0); + border-top: 1px solid qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #A0A0A0 , stop: 1 #606060); + border-left: 1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #A0A0A0 , stop: 1 #606060); + border-right: 1px solid #808080; + border-bottom: 1px solid #606060; +} + +QWidget#bnts_parent_wgt > QToolButton:checked, +QWidget#bnts_parent_wgt > QToolButton:pressed +{ + color: #fff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #804aa5ff , stop: 1 #8081cdff); + border-top: 1px solid qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #48a5fc , stop: 1 #3a86cc); + border-left: 1px solid qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #48a5fc , stop: 1 #3a86cc); + border-right: 1px solid #3a86cc; + border-bottom: 1px solid #3a86cc; +} + +QWidget#bnts_parent_wgt > QFrame +{ + background-color: #80404040; + border-top: 1px solid #202020; + border-left: 1px solid #202020; + border-right: 1px solid #606060; + border-bottom: 1px solid #606060; + height: 1px; +} diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index ab36a2532b..39aabbc87b 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -35,11 +35,25 @@ constexpr unsigned DataManipulationForm::OpDelete; DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): QDialog(parent, f) { QAction *act = nullptr; + QToolButton *btn = nullptr; + QFont fnt; + setupUi(this); setWindowFlags(Qt::Dialog | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint); - table_oid=0; + for(auto &obj : bnts_parent_wgt->children()) + { + btn = dynamic_cast(obj); + if(!btn) continue; + + fnt = btn->font(); + fnt.setBold(true); + btn->setFont(fnt); + PgModelerUiNs::createDropShadow(btn); + PgModelerUiNs::configureWidgetFont(btn, PgModelerUiNs::MediumFontFactor); + } + table_oid=0; PgModelerUiNs::configureWidgetFont(hint_lbl, PgModelerUiNs::MediumFontFactor); PgModelerUiNs::configureWidgetFont(warning_lbl, PgModelerUiNs::MediumFontFactor); @@ -99,7 +113,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): csv_load_tb->setToolTip(csv_load_tb->toolTip() + QString(" (%1)").arg(csv_load_tb->shortcut().toString())); filter_tb->setToolTip(filter_tb->toolTip() + QString(" (%1)").arg(filter_tb->shortcut().toString())); new_window_tb->setToolTip(new_window_tb->toolTip() + QString(" (%1)").arg(new_window_tb->shortcut().toString())); - clear_tb->setToolTip(clear_tb->toolTip() + QString("%1").arg(clear_tb->shortcut().toString())); + clear_tb->setToolTip(clear_tb->toolTip() + QString(" (%1)").arg(clear_tb->shortcut().toString())); result_info_wgt->setVisible(false); //Forcing the splitter that handles the bottom widgets to resize its children to their minimum size @@ -1444,8 +1458,8 @@ void DataManipulationForm::resizeEvent(QResizeEvent *event) Qt::ToolButtonStyle style = Qt::ToolButtonIconOnly; QToolButton *btn = nullptr; - if(event->size().width() > this->baseSize().width()) - style = Qt::ToolButtonTextBesideIcon; + if(event->size().height() > this->baseSize().height()) + style = Qt::ToolButtonTextUnderIcon; if(refresh_tb->toolButtonStyle() != style) { diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 081ac3ea41..9c10aab155 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -365,7 +365,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(par font = btn->font(); font.setBold(true); btn->setFont(font); - btn->setGraphicsEffect(createDropShadow(btn)); + PgModelerUiNs::createDropShadow(btn); } } @@ -1087,7 +1087,7 @@ void MainWindow::setCurrentModel(void) font = btn->font(); font.setBold(true); btn->setFont(font); - btn->setGraphicsEffect(createDropShadow(tool_btn)); + PgModelerUiNs::createDropShadow(btn); } edit_menu->addAction(current_model->action_copy); @@ -1814,19 +1814,6 @@ void MainWindow::setFloatingWidgetPos(QWidget *widget, QAction *act, QToolBar *t } } -QGraphicsDropShadowEffect *MainWindow::createDropShadow(QToolButton *btn) -{ - QGraphicsDropShadowEffect *shadow=nullptr; - - shadow=new QGraphicsDropShadowEffect(btn); - shadow->setXOffset(2); - shadow->setYOffset(2); - shadow->setBlurRadius(5); - shadow->setColor(QColor(0,0,0, 100)); - - return(shadow); -} - void MainWindow::configureSamplesMenu(void) { QDir dir(GlobalAttributes::SamplesDir); diff --git a/libpgmodeler_ui/src/mainwindow.h b/libpgmodeler_ui/src/mainwindow.h index 26a65567b7..311715c4d4 100644 --- a/libpgmodeler_ui/src/mainwindow.h +++ b/libpgmodeler_ui/src/mainwindow.h @@ -153,9 +153,6 @@ class MainWindow: public QMainWindow, public Ui::MainWindow { //! \brief Set the postion of a floating widget based upon an action at a tool bar void setFloatingWidgetPos(QWidget *widget, QAction *act, QToolBar *toolbar, bool map_to_window); - //! \brief Creates drop shadown on a tool button that represents an QAction - QGraphicsDropShadowEffect *createDropShadow(QToolButton *btn); - void configureSamplesMenu(void); /*! \brief Stores the current checkboxes states of the main dock widgets on the set of configuration params diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index cd3a0e5a16..ba88c83973 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -2,6 +2,7 @@ #include "messagebox.h" #include "databasemodel.h" #include +#include #include "numberedtexteditor.h" #include #include @@ -367,4 +368,16 @@ namespace PgModelerUiNs { } } } + + void createDropShadow(QToolButton *btn, int x_offset, int y_offset, int radius) + { + QGraphicsDropShadowEffect *shadow=nullptr; + + shadow=new QGraphicsDropShadowEffect(btn); + shadow->setXOffset(x_offset); + shadow->setYOffset(y_offset); + shadow->setBlurRadius(radius); + shadow->setColor(QColor(0,0,0, 100)); + btn->setGraphicsEffect(shadow); + } } diff --git a/libpgmodeler_ui/src/pgmodeleruins.h b/libpgmodeler_ui/src/pgmodeleruins.h index d7d5cb785e..559ec0d854 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.h +++ b/libpgmodeler_ui/src/pgmodeleruins.h @@ -81,6 +81,9 @@ namespace PgModelerUiNs { //! brief Changes the values of the grid selection at once extern void bulkDataEdit(QTableWidget *results_tbw); + + //! \brief Creates drop shadown on a tool button that represents an QAction + extern void createDropShadow(QToolButton *btn, int x_offset = 2, int y_offset = 2, int radius = 5); } #endif diff --git a/libpgmodeler_ui/src/welcomewidget.cpp b/libpgmodeler_ui/src/welcomewidget.cpp index d11ec1875c..c489609199 100644 --- a/libpgmodeler_ui/src/welcomewidget.cpp +++ b/libpgmodeler_ui/src/welcomewidget.cpp @@ -17,7 +17,6 @@ */ #include "welcomewidget.h" -#include #include "pgmodeleruins.h" WelcomeWidget::WelcomeWidget(QWidget *parent): QWidget(parent) @@ -25,15 +24,10 @@ WelcomeWidget::WelcomeWidget(QWidget *parent): QWidget(parent) setupUi(this); QList btns= { new_tb, open_tb, recent_tb, last_session_tb, sample_tb, support_tb }; - QGraphicsDropShadowEffect *shadow=nullptr; for(auto &btn : btns) { - shadow=new QGraphicsDropShadowEffect(this); - shadow->setXOffset(3); - shadow->setYOffset(3); - shadow->setBlurRadius(10); - btn->setGraphicsEffect(shadow); + PgModelerUiNs::createDropShadow(btn, 3, 3, 10); #ifdef Q_OS_LINUX PgModelerUiNs::__configureWidgetFont(btn, 1.20); diff --git a/libpgmodeler_ui/ui/datamanipulationform.ui b/libpgmodeler_ui/ui/datamanipulationform.ui index 698647e0b3..5f276b0133 100644 --- a/libpgmodeler_ui/ui/datamanipulationform.ui +++ b/libpgmodeler_ui/ui/datamanipulationform.ui @@ -6,20 +6,20 @@ 0 0 - 961 - 600 + 897 + 650 700 - 600 + 650 1250 - 0 + 900 @@ -34,7 +34,7 @@ - 2 + 0 2 @@ -45,117 +45,7 @@ 2 - - - - 2 - - - 2 - - - 2 - - - 2 - - - 6 - - - - - - 0 - 0 - - - - - 127 - 0 - - - - - - - - - - Qt::PlainText - - - :/imagens/imagens/pgmodeler_name.png - - - - - - - - 0 - 0 - - - - - 90 - 32 - - - - - 16777215 - 16777215 - - - - false - - - - - - &Close - - - - :/icones/icones/fechar1.png:/icones/icones/fechar1.png - - - - 20 - 20 - - - - false - - - false - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - + @@ -182,1652 +72,963 @@ 4 - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - false - - - - true - - - - 0 - 0 - - - - QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::SelectItems - - - QAbstractItemView::ScrollPerItem - - - QAbstractItemView::ScrollPerPixel - - - false - - - 0 - - - 0 - - - true - - - 30 - - - false - - - true - - - false - - - false - - - 26 - - - 25 - - - false - - - - - 0 - - - - Filter - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - Qt::Vertical - - - false - - - - Expression - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - - - - - Order && Limit - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - 0 - 0 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Add Item - - - - - - - :/icones/icones/adicionar.png:/icones/icones/adicionar.png - - - - 20 - 20 - - - - Ins - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Remove Item - - - - - - - :/icones/icones/remover.png:/icones/icones/remover.png - - - - 20 - 20 - - - - Del - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Clear the order by columns list - - - - - - - :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png - - - - 20 - 20 - - - - Del - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Move selected item up - - - - - - - :/icones/icones/movercima.png:/icones/icones/movercima.png - - - - 20 - 20 - - - - Del - - - - - - - false - - - - 0 - 0 - - - - - 0 - 0 - - - - Move selected item down - - - - - - - :/icones/icones/moverbaixo.png:/icones/icones/moverbaixo.png - - - - 20 - 20 - - - - Del - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 0 - - - - 0 - - - 1000000 - - - 50 - - - 1000 - - - - - - - - 0 - 0 - - - - Column: - - - - - - - - 0 - 0 - - - - results (Use <strong>0</strong> for no limit) - - - - - - - Limit in: - - - - - - - - - - 0 - 0 - - - - QComboBox::InsertAlphabetically - - - - - - - - 0 - 0 - - - - ASC - - - true - - - - - - - - 0 - 0 - - - - DESC - - - - - - - - - - - - - - Columns - - - - 4 - - - 4 - - - 4 - - - 4 - - - - - - - - - - Qt::Horizontal - - - - 58 - 20 - - - - - - - - - 0 - 0 - - - - Select all - - - - - - - - 0 - 0 - - - - Clear all - - - - - - - Qt::Horizontal - - - - 58 - 20 - - - - - - - - - - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - 24 - 24 - - - - - 24 - 24 - - - - - - - Qt::AutoText - - - :/icones/icones/msgbox_alerta.png - - - true - - - - - - - - 50 - false - false - false - false - true - - - - - - - true - - - - - - - - - - - 0 - 0 - - - - - 2 - - - 2 - - - 2 - - - 2 - - - - - - 0 - 0 - - - - - false - - - - - - - -1 - - - - - + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + Schema: + + + + + + + + 0 + 0 + + + + 20 + + + QComboBox::InsertAtBottom + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + Table: + + + + + + + + 0 + 0 + + + + 20 + + + QComboBox::InsertAtBottom + + + QComboBox::AdjustToContentsOnFirstShow + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + Hide views + + + true + + + + + + + + + 0 + + + + + + 20 + 20 + + + + + 22 + 22 + + + + + + + :/icones/icones/database.png + + + true + + + + + + + + 0 + 0 + + + + + + + 5 + + + + + + - - + + - + 0 0 - - - 0 - 30 - - - - QFrame::StyledPanel + + Qt::Horizontal - - QFrame::Raised + + false - - - 2 + + + true - - 2 + + + 0 + 0 + - - 2 + + QAbstractItemView::AnyKeyPressed|QAbstractItemView::DoubleClicked - - 2 + + true - - - - - 24 - 24 - - - - - 24 - 24 - - - - + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectItems + + + QAbstractItemView::ScrollPerItem + + + QAbstractItemView::ScrollPerPixel + + + false + + + 0 + + + 0 + + + true + + + 30 + + + false + + + true + + + false + + + false + + + 26 + + + 25 + + + false + + + + + 0 + + + + Filter + + + + 4 - - Qt::AutoText + + 4 - - :/icones/icones/msgbox_info.png + + 4 - - true + + 4 - - - - - - - 0 - 0 - + + + + Qt::Vertical + + + false + + + + Expression + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + + + + + Order && Limit + + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Add Item + + + + + + + :/icones/icones/adicionar.png:/icones/icones/adicionar.png + + + + 20 + 20 + + + + Ins + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Remove Item + + + + + + + :/icones/icones/remover.png:/icones/icones/remover.png + + + + 20 + 20 + + + + Del + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Clear the order by columns list + + + + + + + :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png + + + + 20 + 20 + + + + Del + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Move selected item up + + + + + + + :/icones/icones/movercima.png:/icones/icones/movercima.png + + + + 20 + 20 + + + + Del + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Move selected item down + + + + + + + :/icones/icones/moverbaixo.png:/icones/icones/moverbaixo.png + + + + 20 + 20 + + + + Del + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + 0 + + + 1000000 + + + 50 + + + 1000 + + + + + + + + 0 + 0 + + + + Column: + + + + + + + + 0 + 0 + + + + results (Use <strong>0</strong> for no limit) + + + + + + + Limit in: + + + + + + + + + + 0 + 0 + + + + QComboBox::InsertAlphabetically + + + + + + + + 0 + 0 + + + + ASC + + + true + + + + + + + + 0 + 0 + + + + DESC + + + + + + + + + + + + + + Columns + + + + 4 - - - 50 - false - false - false - true - + + 4 - - <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> + + 4 - - true + + 4 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 0 - - - - Schema: - - - - - - - - 0 - 0 - - - - 20 - - - QComboBox::InsertAtBottom - - - - 16 - 16 - - - - - - - - - 0 - 0 - - - - Table: - - - - - - - - 0 - 0 - - - - 20 - - - QComboBox::InsertAtBottom - - - QComboBox::AdjustToContentsOnFirstShow - - - - 16 - 16 - - - - - - - - - 0 - 0 - - - - Hide views - - - true - - - - - - - - - 0 - - - - - - 20 - 20 - - - - - 22 - 22 - - - - - - - :/icones/icones/database.png - - - true - - - - - - - - 0 - 0 - - - - - - - 5 - - - - - - + + + + + + + + + Qt::Horizontal + + + + 58 + 20 + + + + + + + + + 0 + 0 + + + + Select all + + + + + + + + 0 + 0 + + + + Clear all + + + + + + + Qt::Horizontal + + + + 58 + 20 + + + + + + + + + + - - + + + + + 0 + 0 + + 0 - 0 + 30 - - - 4 - + + QFrame::StyledPanel + + + QFrame::Raised + + - 0 + 2 - 0 + 2 - 0 - - - 0 + 2 - - - - false - - - - 0 - 0 - - - - Refresh listing - - - Refresh - - - - :/icones/icones/atualizar.png:/icones/icones/atualizar.png - - - - 22 - 22 - - - - F5 - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - - - - 0 - 0 - - - - Save changes - - - Save - - - - :/icones/icones/salvar.png:/icones/icones/salvar.png - - - - 22 - 22 - - - - Ctrl+S - - - Qt::ToolButtonIconOnly - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - false - - - - 0 - 0 - - - - Copy items on the grid - - - Copy - - - - :/icones/icones/copiar.png:/icones/icones/copiar.png - - - - 22 - 22 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - - - - 0 - 0 - - - - Paste items on the grid - - - Paste - - - - :/icones/icones/colar.png:/icones/icones/colar.png - - - - 22 - 22 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - - - - 0 - 0 - - - - Clears the items selected on the grid - - - Clear - - - - :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png - - - - 22 - 22 - - - - Ctrl+R - - - QToolButton::InstantPopup - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - - - - 0 - 0 - - - - Export results to CSV file - - - Export - - - - :/icones/icones/exportdata.png:/icones/icones/exportdata.png - - - - 22 - 22 - - - - Ctrl+X - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - - - - 0 - 0 - - - - Browse referenced tables - - - Browse - - - - :/icones/icones/browsetable.png:/icones/icones/browsetable.png - - - - 22 - 22 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonIconOnly - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - false - - - - 0 - 0 - - - - Undo modifications - - - Undo - - - - :/icones/icones/desfazer.png:/icones/icones/desfazer.png - - - - 22 - 22 - - - - Ctrl+Z - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - - - - 0 - 0 - - - - Add empty rows - - - Add - - - - :/icones/icones/addrow.png:/icones/icones/addrow.png - - - - 22 - 22 - - - - Ins - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - - - - 0 - 0 - - - - Mark the selected rows to be deleted - - - Delete - - - - :/icones/icones/delrow.png:/icones/icones/delrow.png - - - - 22 - 22 - - - - Del - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - + + 2 + + + - 0 - 0 - - - - Change the values of all selected cells at once - - - Edit - - - - :/icones/icones/bulkedit.png:/icones/icones/bulkedit.png - - - - 22 - 22 + 24 + 24 - - Ctrl+E - - - Qt::ToolButtonIconOnly - - - true - - - - - - - false - - + - 0 - 0 + 24 + 24 - - Duplicate the selected rows - - Duplicate - - - - :/icones/icones/duprow.png:/icones/icones/duprow.png - - - - 22 - 22 - + - - Ctrl+D + + Qt::AutoText - - Qt::ToolButtonIconOnly + + :/icones/icones/msgbox_info.png - + true - - - - false - - - - 0 - 0 - + + + + + 0 + 0 + - - Truncate the browsed table + + + 50 + false + false + false + true + - Truncate - - - - :/icones/icones/truncate.png:/icones/icones/truncate.png - - - - 22 - 22 - - - - QToolButton::InstantPopup - - - Qt::ToolButtonIconOnly + <html><head/><body><p>Empty values are assumed as <span style=" font-weight:600;">DEFAULT</span>. To use special values like <span style=" font-weight:600;">NULL</span>, a function call like <span style=" font-weight:600;">now()</span> or a specific data escaping, enclose values in two slashes, e.g., <span style=" font-weight:600;">/value/</span>. To use a slash as part of the value prepend the backslash character, e.g., <span style=" font-weight:600;">\/</span>.</p></body></html> - + true + + + + + + + + 0 + 0 + + + + + 2 + + + 2 + + + 2 + + + 2 + - - - true - - - - 0 - 0 - + + + + 0 + 0 + - - Add new rows from a CSV file + + + false + - Load CSV - - - - :/icones/icones/loadcsv.png:/icones/icones/loadcsv.png - - - - 22 - 22 - - - - Ctrl+L - - - true - - - Qt::ToolButtonIconOnly + - - true + + -1 - - - - false - - - - 0 - 0 - - - - Filter the result set + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + 50 + false + false + false + false + true + - Filter - - - - :/icones/icones/filter.png:/icones/icones/filter.png - - - - 22 - 22 - - - - Ctrl+F - - - true - - - Qt::ToolButtonIconOnly + - + true - - - - Qt::Horizontal - - + + + - 235 - 20 + 24 + 24 - - - - - - true - - + - 0 - 0 + 24 + 24 - - Open a new data manipulation window - - New window - - - - :/icones/icones/novoobjeto.png:/icones/icones/novoobjeto.png - - - - 22 - 22 - + - - Ctrl+N + + Qt::AutoText - - Qt::ToolButtonIconOnly + + :/icones/icones/msgbox_alerta.png - + true @@ -1838,6 +1039,903 @@ + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 0 + + + 3 + + + 0 + + + 3 + + + 4 + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Add empty rows + + + Add + + + + :/icones/icones/addrow.png:/icones/icones/addrow.png + + + + 25 + 25 + + + + Ins + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Clears the items selected on the grid + + + Clear + + + + :/icones/icones/limpartexto.png:/icones/icones/limpartexto.png + + + + 25 + 25 + + + + Ctrl+R + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Horizontal + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Change the values of all selected cells at once + + + Edit + + + + :/icones/icones/bulkedit.png:/icones/icones/bulkedit.png + + + + 25 + 25 + + + + Ctrl+E + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Browse referenced tables + + + Browse + + + + :/icones/icones/browsetable.png:/icones/icones/browsetable.png + + + + 25 + 25 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Add new rows from a CSV file + + + Load CSV + + + + :/icones/icones/loadcsv.png:/icones/icones/loadcsv.png + + + + 25 + 25 + + + + Ctrl+L + + + true + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Copy items on the grid + + + Copy + + + + :/icones/icones/copiar.png:/icones/icones/copiar.png + + + + 25 + 25 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Duplicate the selected rows + + + Duplicate + + + + :/icones/icones/duprow.png:/icones/icones/duprow.png + + + + 25 + 25 + + + + Ctrl+D + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Horizontal + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Filter the result set + + + Filter + + + + :/icones/icones/filter.png:/icones/icones/filter.png + + + + 25 + 25 + + + + Ctrl+F + + + true + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Mark the selected rows to be deleted + + + Delete + + + + :/icones/icones/delrow.png:/icones/icones/delrow.png + + + + 25 + 25 + + + + Del + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + true + + + + 0 + 0 + + + + + 0 + 0 + + + + Open a new data manipulation window + + + New + + + + :/icones/icones/novoobjeto.png:/icones/icones/novoobjeto.png + + + + 25 + 25 + + + + Ctrl+N + + + Qt::ToolButtonIconOnly + + + true + + + + + + + Qt::Horizontal + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Paste items on the grid + + + Paste + + + + :/icones/icones/colar.png:/icones/icones/colar.png + + + + 25 + 25 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Save changes + + + Save + + + + :/icones/icones/salvar.png:/icones/icones/salvar.png + + + + 25 + 25 + + + + Ctrl+S + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Undo modifications + + + Undo + + + + :/icones/icones/desfazer.png:/icones/icones/desfazer.png + + + + 25 + 25 + + + + Ctrl+Z + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Export results to CSV file + + + Export + + + + :/icones/icones/exportdata.png:/icones/icones/exportdata.png + + + + 25 + 25 + + + + Ctrl+X + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Refresh listing + + + Refresh + + + + :/icones/icones/atualizar.png:/icones/icones/atualizar.png + + + + 25 + 25 + + + + F5 + + + Qt::ToolButtonIconOnly + + + true + + + + + + + false + + + + 0 + 0 + + + + + 0 + 0 + + + + Truncate the browsed table + + + Truncate + + + + :/icones/icones/truncate.png:/icones/icones/truncate.png + + + + 25 + 25 + + + + QToolButton::InstantPopup + + + Qt::ToolButtonIconOnly + + + true + + + + + + + + + + 2 + + + 2 + + + 2 + + + 2 + + + 6 + + + + + + 0 + 0 + + + + + 127 + 0 + + + + + + + + + + Qt::PlainText + + + :/imagens/imagens/pgmodeler_name.png + + + + + + + + 0 + 0 + + + + + 90 + 32 + + + + + 16777215 + 16777215 + + + + false + + + + + + &Close + + + + :/icones/icones/fechar1.png:/icones/icones/fechar1.png + + + + 20 + 20 + + + + false + + + false + + + false + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + From d6a5b8492ad7cc97e867fc11fa5fd84adcbc8a9d Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Fri, 5 Jul 2019 13:54:56 -0300 Subject: [PATCH 415/425] Minor adjustment on tool buttons font size on DataManipulationForm --- libpgmodeler_ui/src/datamanipulationform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/datamanipulationform.cpp b/libpgmodeler_ui/src/datamanipulationform.cpp index 39aabbc87b..40b395f92b 100644 --- a/libpgmodeler_ui/src/datamanipulationform.cpp +++ b/libpgmodeler_ui/src/datamanipulationform.cpp @@ -50,7 +50,7 @@ DataManipulationForm::DataManipulationForm(QWidget * parent, Qt::WindowFlags f): fnt.setBold(true); btn->setFont(fnt); PgModelerUiNs::createDropShadow(btn); - PgModelerUiNs::configureWidgetFont(btn, PgModelerUiNs::MediumFontFactor); + PgModelerUiNs::configureWidgetFont(btn, PgModelerUiNs::SmallFontFactor); } table_oid=0; From dd0bba12d3a25a56a6e2b94f2d667e5aed8a527e Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 8 Jul 2019 12:03:40 -0300 Subject: [PATCH 416/425] Added a routine to write a backup file during the saving of model files --- libpgmodeler_ui/src/mainwindow.cpp | 15 +-------------- libpgmodeler_ui/src/modelrestorationform.cpp | 18 ++++++++++++------ libpgmodeler_ui/src/modelrestorationform.h | 5 ++++- libpgmodeler_ui/src/modelwidget.cpp | 16 +++++++++++++++- libutils/src/exception.cpp | 1 + libutils/src/exception.h | 5 +++-- 6 files changed, 36 insertions(+), 24 deletions(-) diff --git a/libpgmodeler_ui/src/mainwindow.cpp b/libpgmodeler_ui/src/mainwindow.cpp index 9c10aab155..df2ec6f820 100644 --- a/libpgmodeler_ui/src/mainwindow.cpp +++ b/libpgmodeler_ui/src/mainwindow.cpp @@ -720,20 +720,7 @@ void MainWindow::closeEvent(QCloseEvent *event) storeDockWidgetsSettings(); conf_wgt->saveConfiguration(); - restoration_form->removeTemporaryModels(); - - //Remove import log files - QDir dir(GlobalAttributes::TemporaryDir); - QStringList log_files; - - dir.setNameFilters({QString("*.log")}); - log_files=dir.entryList(QDir::Files); - - while(!log_files.isEmpty()) - { - dir.remove(log_files.front()); - log_files.pop_front(); - } + restoration_form->removeTemporaryFiles(); SQLExecutionWidget::saveSQLHistory(); qApp->quit(); diff --git a/libpgmodeler_ui/src/modelrestorationform.cpp b/libpgmodeler_ui/src/modelrestorationform.cpp index 8ca6c0cb6d..d8c97370c1 100644 --- a/libpgmodeler_ui/src/modelrestorationform.cpp +++ b/libpgmodeler_ui/src/modelrestorationform.cpp @@ -48,7 +48,6 @@ int ModelRestorationForm::exec(void) QRegExp regexp=QRegExp("(\\getTemporaryModels().isEmpty()); } +void ModelRestorationForm::removeTemporaryFiles(void) +{ + QDir tmp_file; + QStringList tmp_files = QDir(GlobalAttributes::TemporaryDir, QString("*.dbm;*.dbk;*.omf;*.sql;*.log"), + QDir::Name, QDir::Files | QDir::NoDotAndDotDot).entryList(); + + for(auto &file : tmp_files) + tmp_file.remove(GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + file); +} + void ModelRestorationForm::removeTemporaryModels(void) { QStringList file_list=this->getTemporaryModels(); QDir tmp_file; - while(!file_list.isEmpty()) - { - tmp_file.remove(GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + file_list.front()); - file_list.pop_front(); - } + for(auto &file : file_list) + tmp_file.remove(GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + file); } void ModelRestorationForm::removeTemporaryModel(const QString &tmp_model) diff --git a/libpgmodeler_ui/src/modelrestorationform.h b/libpgmodeler_ui/src/modelrestorationform.h index a85d28961e..3baa89e9f1 100644 --- a/libpgmodeler_ui/src/modelrestorationform.h +++ b/libpgmodeler_ui/src/modelrestorationform.h @@ -48,7 +48,10 @@ class ModelRestorationForm: public QDialog, public Ui::ModelRestorationForm { public slots: int exec(void); - //! \brief Clears the tmp/ dir removing all temporary files + //! \brief Clears the tmp/ dir by removing all temporary files (*.dbm, *.dbk, *.omf, *.sql. *.log) + void removeTemporaryFiles(void); + + //! \brief Clears the tmp/ dir removing all temporary models (*.dbm) void removeTemporaryModels(void); //! \brief Remove only the specified temp model diff --git a/libpgmodeler_ui/src/modelwidget.cpp b/libpgmodeler_ui/src/modelwidget.cpp index 4a5e665769..0e92ef1387 100644 --- a/libpgmodeler_ui/src/modelwidget.cpp +++ b/libpgmodeler_ui/src/modelwidget.cpp @@ -1626,18 +1626,25 @@ void ModelWidget::saveModel(const QString &filename) task_prog_wgt.setWindowTitle(trUtf8("Saving database model")); task_prog_wgt.show(); + /* If the original file exists we need to make a back first to avoid + * in order to recover it in case of failures */ if(exists) { + // Generate a temporary backup file tmpfile.setAutoRemove(false); tmpfile.setFileTemplate(GlobalAttributes::TemporaryDir + GlobalAttributes::DirSeparator + - QString("tmp_%1_XXXXXX.dbmk").arg(this->db_model->getName())); + QString("%1_XXXXXX.dbk").arg(this->db_model->getName())); tmpfile.open(); bkpfile = tmpfile.fileName(); tmpfile.close(); tmpfile.remove(); + /* Copy the original database model file prior to the saving to store + * its last state in a safe place (temporary storage of the tool ~/.config/pgmodeler by default */ QFile::copy(filename, bkpfile); + + // Remove the original filename before create a new one in the same path QFile::remove(filename); } @@ -1649,6 +1656,13 @@ void ModelWidget::saveModel(const QString &filename) disconnect(db_model, nullptr, &task_prog_wgt, nullptr); this->modified=false; + /* Doing a final check to the file regarding its size. + * If we have a zero-byte file something went wrong during the saving process (disk failure, thread errors, etc) + * so we raise an error to the user and restore the backup file to its original path */ + if(QFileInfo(filename).size() == 0) + throw Exception(Exception::getErrorMessage(ErrorCode::ModelFileInvalidSize).arg(filename).arg(bkpfile), + ErrorCode::ModelFileInvalidSize,__PRETTY_FUNCTION__,__FILE__,__LINE__); + if(exists) QFile::remove(bkpfile); } diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index 33a3a60314..ade9e33103 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -264,6 +264,7 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"AsgInvalidNameObjReference", QT_TR_NOOP("Assignment of an invalid name to the object reference!")}, {"AsgNotAllocatedObjectReference", QT_TR_NOOP("Assignment of a not allocated object to the object reference!")}, {"InsDuplicatedObjectReference", QT_TR_NOOP("The object reference name `%1' is already defined!")}, + {"ModelFileInvalidSize", QT_TR_NOOP("A zero-byte file was detected while saving the file `%1'. In order to avoid data loss the original contents of the file prior to the last saving was restored and a security copy kept on `%2'. You can copy that backup file to a safe place as a last resort to avoid the complete data loss! Note that the backup file will be erased when the application is closed.")} }; Exception::Exception(void) diff --git a/libutils/src/exception.h b/libutils/src/exception.h index 4ec6d29042..7dee6d4fa1 100644 --- a/libutils/src/exception.h +++ b/libutils/src/exception.h @@ -289,12 +289,13 @@ enum class ErrorCode: unsigned { AsgOptionInvalidName, AsgInvalidNameObjReference, AsgNotAllocatedObjectReference, - InsDuplicatedObjectReference + InsDuplicatedObjectReference, + ModelFileInvalidSize }; class Exception { private: - static constexpr unsigned ErrorCount=245; + static constexpr unsigned ErrorCount=246; /*! \brief Stores other exceptions before raise the 'this' exception. This structure can be used to simulate a stack trace to improve the debug */ From c5b27808b4ff53fcea6fe3b8c63a0a6649ca7cbf Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 8 Jul 2019 12:07:18 -0300 Subject: [PATCH 417/425] Minor error message change --- libutils/src/exception.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libutils/src/exception.cpp b/libutils/src/exception.cpp index ade9e33103..cbc5e578e2 100644 --- a/libutils/src/exception.cpp +++ b/libutils/src/exception.cpp @@ -264,7 +264,7 @@ QString Exception::messages[Exception::ErrorCount][2]={ {"AsgInvalidNameObjReference", QT_TR_NOOP("Assignment of an invalid name to the object reference!")}, {"AsgNotAllocatedObjectReference", QT_TR_NOOP("Assignment of a not allocated object to the object reference!")}, {"InsDuplicatedObjectReference", QT_TR_NOOP("The object reference name `%1' is already defined!")}, - {"ModelFileInvalidSize", QT_TR_NOOP("A zero-byte file was detected while saving the file `%1'. In order to avoid data loss the original contents of the file prior to the last saving was restored and a security copy kept on `%2'. You can copy that backup file to a safe place as a last resort to avoid the complete data loss! Note that the backup file will be erased when the application is closed.")} + {"ModelFileInvalidSize", QT_TR_NOOP("A zero-byte file was detected while saving to `%1'. In order to avoid data loss the original contents of the file prior to the last saving was restored and a security copy kept on `%2'. You can copy that backup file to a safe place as a last resort to avoid the complete data loss! Note that the backup file will be erased when the application is closed.")} }; Exception::Exception(void) From fe5ecd3eb5c79ad33da618cfa797ec599588df07 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 8 Aug 2019 17:09:51 -0300 Subject: [PATCH 418/425] Adjusted the font weight on WelcomeWidget (only for Linux) --- libpgmodeler_ui/src/welcomewidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpgmodeler_ui/src/welcomewidget.cpp b/libpgmodeler_ui/src/welcomewidget.cpp index c489609199..85de550389 100644 --- a/libpgmodeler_ui/src/welcomewidget.cpp +++ b/libpgmodeler_ui/src/welcomewidget.cpp @@ -30,7 +30,7 @@ WelcomeWidget::WelcomeWidget(QWidget *parent): QWidget(parent) PgModelerUiNs::createDropShadow(btn, 3, 3, 10); #ifdef Q_OS_LINUX - PgModelerUiNs::__configureWidgetFont(btn, 1.20); + PgModelerUiNs::__configureWidgetFont(btn, 1.30); #else PgModelerUiNs::__configureWidgetFont(btn, 1.50); #endif From 1dfb13a59caca73fa726e85d4693615004efdf91 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 29 Aug 2019 11:13:08 -0300 Subject: [PATCH 419/425] Minor improvement on CSV text copying to exclude from the buffer the hidden columns. --- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 037857fdb8..8192bb6ffd 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -795,7 +795,12 @@ QByteArray SQLExecutionWidget::generateBuffer(QTableView *results_tbw, QChar sep { //Creating the header for(col=start_col; col < max_col; col++) + { + if(results_tbw->isColumnHidden(col)) + continue; + line.append(str_pattern.arg(model->headerData(col, Qt::Horizontal).toString())); + } buf.append(line.join(separator)); buf.append('\n'); @@ -807,6 +812,9 @@ QByteArray SQLExecutionWidget::generateBuffer(QTableView *results_tbw, QChar sep { for(col=start_col; col < max_col; col++) { + if(results_tbw->isColumnHidden(col)) + continue; + index = model->index(row, col); line.append(str_pattern.arg(index.data().toString())); } From cc5f9d7f6a4cabb857a6c90ffa701138b20657a8 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Thu, 29 Aug 2019 16:54:47 -0300 Subject: [PATCH 420/425] Updates on CHANGELOG.md and RELEASENOTES.md for 0.9.2-beta1 --- CHANGELOG.md | 43 ++++++++++++++++++++++ RELEASENOTES.md | 95 +++++++++++++++++++------------------------------ 2 files changed, 80 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97c8f57cd9..1b066c9a34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,49 @@ Change Log --------- +v0.9.2-beta1 +------ +Release date: September 2, 2019
+ +* [New] Added a routine to write a backup file during the saving of model files in order to avoid data loss in some rare cases. +* [New] Added a new action on DataManipulationForm to clear the selected items by pressing Ctrl+R. +* [New] Enabling/disabling the save model action according to the model's modified status. +* [New] The main window instance is now exposed to plugins to make the extra features development more flexible. +* [New] Avoiding selecting table items in BaseTableView::mousePressEvent which doens't contain an underlying (source) object. +* [New] Adding support to duplicate several table objects at once. +* [New] Added support to table children multiselection by using Ctrl+Shift+Click on them. +* [New] Added support to load the generated diff code in the SQL tool and automatically browsing the destination server for manual diff applying. +* [New] Added a button to create a new data manipulation form from within another data manipulation form. +* [New] Added a confirmation message before closing a database explorer widget. +* [Change] Minor improvement on CSV text copying to exclude from the buffer the hidden columns. +* [Change] Adjusted the font weight on WelcomeWidget (only for Linux). +* [Change] Minor adjustment on tool buttons font size on DataManipulationForm. +* [Change] Improved the UI of the DataManipulationForm by rearranging the tool buttons to the left of the dialog. +* [Change] Improved the clipboard text pasting on DataManipulationForm in order to parse the text as CSV when Ctrl+Shift+V is pressed. +* [Change] The filter input on SQLExecutionWidget is now automatically focused when toggling the filter widget. +* [Change] Changed the default behavior of result set filtering to Qt::MatchContains on SQLExecutionWidget. +* [Change] Avoiding showing the "Swap ids" action in popup menu when we have only columns/constraints selected +* [Change] Minor adjustment on SceneInfoWidget to avoid display dimensions of selected columns/constraints on the canvas. +* [Change] Renamed the method BaseGraphicObject::getReceiverObject to getOverlyingObject (to make sense with its counter part BaseObjctView::getUnderlyingObject) +* [Change] Avoiding clear the whole scene selection when the table is already selected and the user requested popup menu. +* [Change] Renamed BaseObjectView::getSourceObject to getUnderlyingObject. +* [Change] Improved the object protection action in ModelWidget in order to accept the multi item selection on tables. +* [Change] Changed the way the PSVI attribute is handled in xmlparser to retrieve big line numbers on a xml document. +* [Change] Improved the diff code preview allowing the user to close the dialog without going back to previous tab and click 'Cancel'. +* [Change] Minor adjustment on buttons shortcuts/tooltips on DataManipulationForm. +* [Change] Changed the way the model saving timers are controlled to avoid infinity savings on the model (when the auto saving option is disabled) making the application unusable. +* [Change] Making the mime update operation return exit code 0 even if there was errors (still displayed in the console). This will avoid the installer to abort installation when the dbm mime update fails. +* [Change] Avoiding applying fillfactor to gin indexes. +* [Change] Moved the method DatabaseImportHelper::parseIndexExpressions to Catalog class. +* [Fix] Fixed the object duplication action when only a single table object is selected. +* [Fix] Fixed a bug in ModelWidget::removeObjects that was causing the removal of relationship added columns +* [Fix] Fixed the ModelWidget::configurePopupMenu to consider the table's multi item selection. +* [Fix] Fixed a false-positive diff result when dealing with timestamptz. +* [Fix] Fixed the progress calculation of dbm files loading. +* [Fix] Fixed a bug that was causing the generation of broken view code. +* [Fix] Fixed the display of index expressions on DatabaseExplorerWidget. +* [Fix] Minor fix on SQLExecutionWidget to avoid results grid to overlap command execution history widget in certain cases. + v0.9.2-beta ------ Release date: May 31, 2019
diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3baf04a108..4748b0f2f0 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,60 +1,39 @@ -v0.9.2-beta +v0.9.2-beta1 ------ -Release date: May 31, 2019
-Changes since: v0.9.2-alpha1
- -Summary: a brand new version has come to you after a work of almost five months. This one brings important features requested long ago and several patches to improve the tool's usability.
- -pgModeler now supports foreign datawrappers, foreign servers and user mappings natively. This means that you can create, export, import and diff these kinds of objects. For now, foreign tables aren't supported but the schedule is to release this support until the end of this development cycle when lauching the stable 0.9.2.
- -In order to provide a temporary workaround for the lack of foreign table support the generic SQL objects were improved in such way to store references to another objects in the model which helps to keep track of name changes and giving a touch of dynamicity to this that kind of object.
- -Now its possible, for instance, create a foreign table from a generic SQL which references a foreign server and any name change on the referenced object will cause the code of the generic SQL (in this case, the foreign table) to be automatically updated avoiding export problems.
- -In the SQL execution widget it's now possible to quickly filter the result set retrieved from a SQL command. This is useful if you need to filter a small set of data without the need of rewrite the SQL command to get the desired result. The filter basically matches a keyword against a column of the rows on the result grid updating on-the-fly the data visualization.
- -This release also brings some changes in the available features: the first is the ability to search for objects in the canvas by matching other attributes not only the name. For instance, you can search items by matching a keyword against object's comments, data types, schemas and some others.
- -A second change is the categorization of the action "New object" in order to diminish the amount of items displayed in the same menu and organizing object types hierarchically.
- -Now, for the bug fixes, in this release they fix crashes and broken code generation as well improve the objects handling in the canvas.
- -Lastly, some of the key change log entries of this release are listed below. For the complete list of changes/fixes, please, refer to the file CHANGELOG.md.
- -* [New] Added support to user mapping. -* [New] Added support to foreign server. -* [New] Added support to foreign data wrapper. -* [New] Added support to reduced verbosity on diff, export and import processes in order to improve performance. -* [New] Generic SQL objects now support dynamic references to objects which can be used in the definition code. -* [New] Added support to compare foreign servers on diff process. -* [New] Added support to the reverse engineering user mapping objects. -* [New] Added support to the reverse engineering foreign server objects. -* [New] Added code snippets for foreign data wrapper and foreign server. -* [New] Added support to diff foreign data wrappers -* [New] Added support to set permissions to foreign data wrapper. -* [New] Added the WRAPPER, SERVER and MAPPING key words to sql-highlight.conf. -* [New] Added the ability to view references to store referenced tables. This feature will cause relationships to be created between the view and the referenced tables. This is useful when we're using reverse engineering feature in which, in previous versions, couldn't determine the tables that were linked to a view. Now, with this feature a relationship is created between the view and all involved tables. -* [New] Added missing data type macaddr8. -* [New] Added support to result set filtering in the SQL execution widget. -* [Change] Change "New object" action in popup menu in order categorize object types when clicking the database object diminishing the amount of items displayed on the screen. -* [Change] Improved the object search mechanism in such way that various attributes of the object can be matched. New searchable attribute may be added in the future. -* [Change] Minor improvement on ModelDatabaseDiffForm to show the connection id of the databases being imported in the output tree. -* [Change] Improved the ModelValidationWidget in such way that is possible to operate over objects on the output list through their respective context menu (the same as in the ModelWidget). -* [Change] Now its possible to trigger the swap ids dialog for two selected objects, causing their ids to be swapped more quickly. -* [Change] Allowing copied object to be pasted multiple times. This feature works only with copy/paste operation without remove the pasted objects from the clipboard, for cut/paste the behaviour is unchanged. -* [Change] Increased the maximum limit of SQL history. -* [Change] Minor improvements in SQLToolWidget and SQLExecutionWidget to avoid segmentation faults when trying to close a execution tab while the command is still running. -* [Fix] Fixed a bug in DataManipulationForm that was deleting new rows wrongly. -* [Fix] Fixed a bug that was causing domain constraints not to be extracted correctly during reverse engineering. -* [Fix] Fixed a bug that was causing a fk relationship not to be deleted if the fk tied to it was changed by the user. -* [Fix] Fixed a bug on CLI that was not fixing broken models correctly when they had no role declaration. -* [Fix] Fixed a bug that was causing tables not to be moved on the canvas using mouse. -* [Fix] Fixed a bug that could crash the application when no language was specified to a funcion and the SQL/XML code was being generated. -* [Fix] Minor fix a bug on index importing. -* [Fix] Fixed a crash when a query executed in SQLExecutionWidget was a DDL one or was not returning results. -* [Fix] Fixed a bug that was causing syntax error if the last column of a table had the SQL code disabled. -* [Fix] Fixed a bug on diff process due to a missing attribute on the generation of diff code for inheritance relationships. -* [Fix] Fixed a bug when rendering several self relationships attached to the same table. -* [Fix] Fixed the CLI in order to restore the layers information when fixing a broken model. -* [Fix] Fixed a bug in object finder that was causing objects from a hidden layer to be displayed causing inconsistency on the layer state. +Release date: September 2, 2019
+Changes since: v0.9.2-beta
+ +Summary: this release brings a few improvements as we're starting to deaccelarate the development of new features and concentrating on minor changes and bug fixes until the stable 0.9.2 is done.
+ +The main focus was to improve the data manipulation form, fix some small UI problems and bugs on some features detected previously.
+ +The file saving was patched in such way to write a backup file prior to the saving of a model to avoid data loss in rare circumstances (mainly on macOS systems).
+ +The diff process was also fixed due to a bug that was returning some false-positive results when dealing with timestamptz columns.
+ +This version also brings the ability to select multiple table children (columns, contraints, triggers, etc) and operate over them by using the design popup menu.
+ +Finally, some changes of this version are detailed below. For the complete list of changes/fixes, please, read the CHANGELOG.md.
+ +* [New] Added a routine to write a backup file during the saving of model files in order to avoid data loss in some rare cases. +* [New] Added a new action on DataManipulationForm to clear the selected items by pressing Ctrl+R. +* [New] Adding support to duplicate several table objects at once. +* [New] Added support to table children multiselection by using Ctrl+Shift+Click on them. +* [New] Added support to load the generated diff code in the SQL tool and automatically browsing the destination server for manual diff applying. +* [New] Added a button to create a new data manipulation form from within another data manipulation form. +* [Change] Minor improvement on CSV text copying to exclude from the buffer the hidden columns. +* [Change] Improved the UI of the DataManipulationForm by rearranging the tool buttons to the left of the dialog. +* [Change] Improved the clipboard text pasting on DataManipulationForm in order to parse the text as CSV when Ctrl+Shift+V is pressed. +* [Change] Minor adjustment on SceneInfoWidget to avoid display dimensions of selected columns/constraints on the canvas. +* [Change] Improved the object protection action in ModelWidget in order to accept the multi item selection on tables. +* [Change] Improved the diff code preview allowing the user to close the dialog without going back to previous tab and click 'Cancel'. +* [Change] Changed the way the model saving timers are controlled to avoid infinity savings on the model (when the auto saving option is disabled) making the application unusable. +* [Fix] Fixed the object duplication action when only a single table object is selected. +* [Fix] Fixed a bug in ModelWidget::removeObjects that was causing the removal of relationship added columns +* [Fix] Fixed the ModelWidget::configurePopupMenu to consider the table's multi item selection. +* [Fix] Fixed a false-positive diff result when dealing with timestamptz. +* [Fix] Fixed the progress calculation of dbm files loading. +* [Fix] Fixed a bug that was causing the generation of broken view code. +* [Fix] Fixed the display of index expressions on DatabaseExplorerWidget. +* [Fix] Minor fix on SQLExecutionWidget to avoid results grid to overlap command execution history widget in certain cases. From 619c9666fa4bbc3fe1cc686baeb1b17473795c9f Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 2 Sep 2019 08:01:30 -0300 Subject: [PATCH 421/425] Fixed a broken diff code generation for policies (issue #1313) --- schemas/alter/policy.sch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schemas/alter/policy.sch b/schemas/alter/policy.sch index f636715bac..0828298d00 100644 --- a/schemas/alter/policy.sch +++ b/schemas/alter/policy.sch @@ -24,5 +24,6 @@ %if {check-exp} %then $br $tb [WITH CHECK (] {check-exp} [)] %end - {ddl-end} + + ; $br [-- ddl-end --] $br %end From 6a250833b78a6aa894d30d6d43aa49186f63f2e3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 2 Sep 2019 08:15:52 -0300 Subject: [PATCH 422/425] Updates on CHANGELOG.md and RELEASENOTES.md for 0.9.2-beta1 --- CHANGELOG.md | 1 + RELEASENOTES.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b066c9a34..d707c273f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ v0.9.2-beta1 * [Change] Making the mime update operation return exit code 0 even if there was errors (still displayed in the console). This will avoid the installer to abort installation when the dbm mime update fails. * [Change] Avoiding applying fillfactor to gin indexes. * [Change] Moved the method DatabaseImportHelper::parseIndexExpressions to Catalog class. +* [Fix] Fixed a broken diff code generation for policies. * [Fix] Fixed the object duplication action when only a single table object is selected. * [Fix] Fixed a bug in ModelWidget::removeObjects that was causing the removal of relationship added columns * [Fix] Fixed the ModelWidget::configurePopupMenu to consider the table's multi item selection. diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4748b0f2f0..4768815981 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -29,6 +29,7 @@ Finally, some changes of this version are detailed below. For the complete list * [Change] Improved the object protection action in ModelWidget in order to accept the multi item selection on tables. * [Change] Improved the diff code preview allowing the user to close the dialog without going back to previous tab and click 'Cancel'. * [Change] Changed the way the model saving timers are controlled to avoid infinity savings on the model (when the auto saving option is disabled) making the application unusable. +* [Fix] Fixed a broken diff code generation for policies. * [Fix] Fixed the object duplication action when only a single table object is selected. * [Fix] Fixed a bug in ModelWidget::removeObjects that was causing the removal of relationship added columns * [Fix] Fixed the ModelWidget::configurePopupMenu to consider the table's multi item selection. From 1a6dc18a9035ffccc2d844eeddf7bd9d5025b091 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 2 Sep 2019 18:01:38 -0300 Subject: [PATCH 423/425] Minor adjustments in PgModelerUiNs::createOutputListItem and PgModelerUiNs::createOutputTreeItem to better display formatted messages --- libpgmodeler_ui/src/pgmodeleruins.cpp | 15 +++++++++++++-- libpgmodeler_ui/src/sqlexecutionwidget.cpp | 10 +++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/libpgmodeler_ui/src/pgmodeleruins.cpp b/libpgmodeler_ui/src/pgmodeleruins.cpp index ba88c83973..1c206f9cc4 100644 --- a/libpgmodeler_ui/src/pgmodeleruins.cpp +++ b/libpgmodeler_ui/src/pgmodeleruins.cpp @@ -51,6 +51,8 @@ namespace PgModelerUiNs { label->setUpdatesEnabled(true); label->setMinimumHeight(output_trw->iconSize().height() * 1.5); label->setMaximumHeight(label->heightForWidth(label->width())); + + item->setSizeHint(0, QSize(label->width(), label->minimumHeight())); output_trw->setItemWidget(item, 0, label); } @@ -76,13 +78,22 @@ namespace PgModelerUiNs { item->setText(text); else { - QLabel *label=new QLabel(text); + QLabel *label=new QLabel; int txt_height = 0; txt_height = output_lst->fontMetrics().height() * text.count(QString("
")); if(txt_height == 0) - txt_height = output_lst->fontMetrics().height(); + txt_height = output_lst->fontMetrics().height() * 1.25; + else + txt_height *= 1.05; + + label->setUpdatesEnabled(false); + label->setTextFormat(Qt::AutoText); + label->setText(text); + label->setWordWrap(true); + label->setTextInteractionFlags(Qt::TextSelectableByMouse); + label->setUpdatesEnabled(true); item->setSizeHint(QSize(output_lst->width(), txt_height)); output_lst->setItemWidget(item, label); diff --git a/libpgmodeler_ui/src/sqlexecutionwidget.cpp b/libpgmodeler_ui/src/sqlexecutionwidget.cpp index 8192bb6ffd..6ac3a57064 100644 --- a/libpgmodeler_ui/src/sqlexecutionwidget.cpp +++ b/libpgmodeler_ui/src/sqlexecutionwidget.cpp @@ -368,8 +368,8 @@ void SQLExecutionWidget::handleExecutionAborted(Exception e) msgoutput_lst->clear(); PgModelerUiNs::createOutputListItem(msgoutput_lst, - QString("%1 %2").arg(time_str).arg(e.getErrorMessage()), - QPixmap(PgModelerUiNs::getIconPath("msgbox_erro")), false); + PgModelerUiNs::formatMessage(QString("%1 %2").arg(time_str).arg(e.getErrorMessage())), + QPixmap(PgModelerUiNs::getIconPath("msgbox_erro"))); if(e.getErrorCode()==ErrorCode::ConnectionTimeout || e.getErrorCode()==ErrorCode::ConnectionBroken) @@ -628,9 +628,9 @@ void SQLExecutionWidget::runSQLCommand(void) output_tbw->setTabText(0, trUtf8("Results")); output_tbw->setCurrentIndex(1); PgModelerUiNs::createOutputListItem(msgoutput_lst, - PgModelerUiNs::formatMessage(trUtf8("[%1]: SQL command is running...") - .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz")))), - QPixmap(PgModelerUiNs::getIconPath("msgbox_info"))); + trUtf8("[%1]: SQL command is running...") + .arg(QTime::currentTime().toString(QString("hh:mm:ss.zzz"))), + QPixmap(PgModelerUiNs::getIconPath("msgbox_info")), false); } void SQLExecutionWidget::saveCommands(void) From a9a5ea8ee231311187ba32d4ba61c476635a2fa3 Mon Sep 17 00:00:00 2001 From: "Raphael A. Silva" Date: Mon, 2 Sep 2019 19:28:36 -0300 Subject: [PATCH 424/425] Updates on CHANGELOG.md for 0.9.2-beta1 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d707c273f1..e1f0ae95f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ v0.9.2-beta1 * [New] Added support to load the generated diff code in the SQL tool and automatically browsing the destination server for manual diff applying. * [New] Added a button to create a new data manipulation form from within another data manipulation form. * [New] Added a confirmation message before closing a database explorer widget. +* [Change] Minor adjustments in PgModelerUiNs::createOutputListItem and PgModelerUiNs::createOutputTreeItem to better display formatted messages. * [Change] Minor improvement on CSV text copying to exclude from the buffer the hidden columns. * [Change] Adjusted the font weight on WelcomeWidget (only for Linux). * [Change] Minor adjustment on tool buttons font size on DataManipulationForm. From 00bc86f6c3692606ff55e8e54bf1fe8238190c7a Mon Sep 17 00:00:00 2001 From: Felipe Soares Barbosa Silveira Date: Sat, 26 Oct 2019 09:56:11 -0300 Subject: [PATCH 425/425] Translation correction --- lang/pt_BR.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/pt_BR.ts b/lang/pt_BR.ts index 8b1f3fc5cf..5147272158 100644 --- a/lang/pt_BR.ts +++ b/lang/pt_BR.ts @@ -11210,14 +11210,14 @@ Relationship: %1 Indexing - Indexação + Indexando WelcomeWidget Form - Formulário + Formulário New model